diff --git a/copilot/js/main.js b/copilot/js/main.js index c8e6005b..1bdc75a9 100644 --- a/copilot/js/main.js +++ b/copilot/js/main.js @@ -1,17 +1,17 @@ -"use strict";var eco=Object.create;var hCe=Object.defineProperty;var tco=Object.getOwnPropertyDescriptor;var rco=Object.getOwnPropertyNames;var nco=Object.getPrototypeOf,ico=Object.prototype.hasOwnProperty;var fQr=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),pQr=t=>{throw TypeError(t)};var a=(t,e)=>hCe(t,"name",{value:e,configurable:!0});var ve=(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}},ki=(t,e)=>{for(var r in e)hCe(t,r,{get:e[r],enumerable:!0})},hQr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of rco(e))!ico.call(t,o)&&o!==r&&hCe(t,o,{get:()=>e[o],enumerable:!(n=tco(e,o))||n.enumerable});return t};var de=(t,e,r)=>(r=t!=null?eco(nco(t)):{},hQr(e||!t||!t.__esModule?hCe(r,"default",{value:t,enumerable:!0}):r,t)),ba=t=>hQr(hCe({},"__esModule",{value:!0}),t);var Rkt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&pQr("Object expected");var n,o;r&&(n=e[fQr("asyncDispose")]),n===void 0&&(n=e[fQr("dispose")],r&&(o=n)),typeof n!="function"&&pQr("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},kkt=(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=ve(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var bQr,SQr=ve(()=>{p();bQr="ffffffff-ffff-ffff-ffff-ffffffffffff"});var TQr,IQr=ve(()=>{p();TQr="00000000-0000-0000-0000-000000000000"});var xQr,wQr=ve(()=>{p();xQr=/^(?:[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 gco(t){return typeof t=="string"&&xQr.test(t)}var nU,mCe=ve(()=>{p();wQr();a(gco,"validate");nU=gco});function Aco(t){if(!nU(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 XL,gCe=ve(()=>{p();mCe();a(Aco,"parse");XL=Aco});function h_(t,e=0){return(dA[t[e+0]]+dA[t[e+1]]+dA[t[e+2]]+dA[t[e+3]]+"-"+dA[t[e+4]]+dA[t[e+5]]+"-"+dA[t[e+6]]+dA[t[e+7]]+"-"+dA[t[e+8]]+dA[t[e+9]]+"-"+dA[t[e+10]]+dA[t[e+11]]+dA[t[e+12]]+dA[t[e+13]]+dA[t[e+14]]+dA[t[e+15]]).toLowerCase()}function yco(t,e=0){let r=h_(t,e);if(!nU(r))throw TypeError("Stringified UUID is invalid");return r}var dA,RQr,eB=ve(()=>{p();mCe();dA=[];for(let t=0;t<256;++t)dA.push((t+256).toString(16).slice(1));a(h_,"unsafeStringify");a(yco,"stringify");RQr=yco});function tB(){return crypto.getRandomValues(Eco)}var Eco,D6e=ve(()=>{p();Eco=new Uint8Array(16);a(tB,"rng")});function _co(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=kQr(t.random??t.rng?.()??tB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=tB();vco(ACe,s,c),n=kQr(c,ACe.msecs,ACe.nsecs,o?void 0:ACe.clockseq,o?void 0:ACe.node,e,r)}return e??h_(n)}function vco(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 ACe,N6e,Okt=ve(()=>{p();D6e();eB();ACe={};a(_co,"v1");a(vco,"updateV1State");a(kQr,"v1Bytes");N6e=_co});function yCe(t){let e=typeof t=="string"?XL(t):t,r=Cco(e);return typeof t=="string"?h_(r):r}function Cco(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 Lkt=ve(()=>{p();gCe();eB();a(yCe,"v1ToV6");a(Cco,"_v1ToV6")});function bco(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,PQr.createHash)("md5").update(t).digest()}var PQr,DQr,NQr=ve(()=>{p();PQr=require("node:crypto");a(bco,"md5");DQr=bco});function Sco(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 h_(u)}var M6e,O6e,Bkt=ve(()=>{p();gCe();eB();a(Sco,"stringToBytes");M6e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",O6e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(ECe,"v35")});function Fkt(t,e,r,n){return ECe(48,DQr,t,e,r,n)}var MQr,OQr=ve(()=>{p();NQr();Bkt();a(Fkt,"v3");Fkt.DNS=M6e;Fkt.URL=O6e;MQr=Fkt});function Tco(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Ico(t,e,r)}function Ico(t,e,r){t=t||{};let n=t.random??t.rng?.()??tB();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 h_(n)}var Mt,LQr=ve(()=>{p();D6e();eB();a(Tco,"v4");a(Ico,"_v4");Mt=Tco});function xco(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,BQr.createHash)("sha1").update(t).digest()}var BQr,FQr,UQr=ve(()=>{p();BQr=require("node:crypto");a(xco,"sha1");FQr=xco});function Ukt(t,e,r,n){return ECe(80,FQr,t,e,r,n)}var QQr,qQr=ve(()=>{p();UQr();Bkt();a(Ukt,"v5");Ukt.DNS=M6e;Ukt.URL=O6e;QQr=Ukt});function wco(t,e,r){t??={},r??=0;let n=N6e({...t,_v6:!0},new Uint8Array(16));if(n=yCe(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 h_(n)}var jQr,HQr=ve(()=>{p();eB();Okt();Lkt();a(wco,"v6");jQr=wco});function Qkt(t){let e=typeof t=="string"?XL(t):t,r=Rco(e);return typeof t=="string"?h_(r):r}function Rco(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 GQr=ve(()=>{p();gCe();eB();a(Qkt,"v6ToV1");a(Rco,"_v6ToV1")});function kco(t,e,r){let n;if(t)n=$Qr(t.random??t.rng?.()??tB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=tB();Pco(qkt,o,s),n=$Qr(s,qkt.msecs,qkt.seq,e,r)}return e??h_(n)}function Pco(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 $Qr(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 qkt,VQr,WQr=ve(()=>{p();D6e();eB();qkt={};a(kco,"v7");a(Pco,"updateV7State");a($Qr,"v7Bytes");VQr=kco});function Dco(t){if(!nU(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var zQr,YQr=ve(()=>{p();mCe();a(Dco,"version");zQr=Dco});var Cc={};ki(Cc,{MAX:()=>bQr,NIL:()=>TQr,parse:()=>XL,stringify:()=>RQr,v1:()=>N6e,v1ToV6:()=>yCe,v3:()=>MQr,v4:()=>Mt,v5:()=>QQr,v6:()=>jQr,v6ToV1:()=>Qkt,v7:()=>VQr,validate:()=>nU,version:()=>zQr});var Mo=ve(()=>{p();SQr();IQr();gCe();eB();Okt();Lkt();OQr();LQr();qQr();HQr();GQr();WQr();mCe();YQr()});var V0=I(jkt=>{"use strict";p();jkt.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})};jkt.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 JQr=I(($sl,KQr)=>{p();var iU=require("constants"),Nco=process.cwd,L6e=null,Mco=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return L6e||(L6e=Nco.call(process)),L6e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Hkt=process.chdir,process.chdir=function(t){L6e=null,Hkt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Hkt));var Hkt;KQr.exports=Oco;function Oco(t){iU.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(){}),Mco==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(f){function h(m,g,A){var y=Date.now(),E=0;f(m,g,a(function _(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(g,function(b,T){b&&b.code==="ENOENT"?f(m,g,_):A(v)})},E),E<100&&(E+=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(_&&typeof _=="function"){var b=0;v=a(function(T,w,R){if(T&&T.code==="EAGAIN"&&b<10)return b++,f.call(t,m,g,A,y,E,v);_.apply(this,arguments)},"callback")}return f.call(t,m,g,A,y,E,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 E=0;;)try{return f.call(t,h,m,g,A,y)}catch(_){if(_.code==="EAGAIN"&&E<10){E++;continue}throw _}}})(t.readSync);function e(f){f.lchmod=function(h,m,g){f.open(h,iU.O_WRONLY|iU.O_SYMLINK,m,function(A,y){if(A){g&&g(A);return}f.fchmod(y,m,function(E){f.close(y,function(_){g&&g(E||_)})})})},f.lchmodSync=function(h,m){var g=f.openSync(h,iU.O_WRONLY|iU.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){iU.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,iU.O_SYMLINK,function(y,E){if(y){A&&A(y);return}f.futimes(E,m,g,function(_){f.close(E,function(v){A&&A(_||v)})})})},f.lutimesSync=function(h,m,g){var A=f.openSync(h,iU.O_SYMLINK),y,E=!0;try{y=f.futimesSync(A,m,g),E=!1}finally{if(E)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,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.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(Oco,"patch")});var eqr=I((zsl,XQr)=>{p();var ZQr=require("stream").Stream;XQr.exports=Lco;function Lco(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);ZQr.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);ZQr.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(Lco,"legacy")});var rqr=I((Jsl,tqr)=>{"use strict";p();tqr.exports=Fco;var Bco=Object.getPrototypeOf||function(t){return t.__proto__};function Fco(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Bco(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a(Fco,"clone")});var Eoe=I((eal,Vkt)=>{p();var sf=require("fs"),Uco=JQr(),Qco=eqr(),qco=rqr(),B6e=require("util"),fA,U6e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(fA=Symbol.for("graceful-fs.queue"),U6e=Symbol.for("graceful-fs.previous")):(fA="___graceful-fs.queue",U6e="___graceful-fs.previous");function jco(){}a(jco,"noop");function oqr(t,e){Object.defineProperty(t,fA,{get:a(function(){return e},"get")})}a(oqr,"publishQueue");var SW=jco;B6e.debuglog?SW=B6e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(SW=a(function(){var t=B6e.format.apply(B6e,arguments);t="GFS4: "+t.split(/\n/).join(` -GFS4: `),console.error(t)},"debug"));sf[fA]||(nqr=global[fA]||[],oqr(sf,nqr),sf.close=(function(t){function e(r,n){return t.call(sf,r,function(o){o||iqr(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,U6e,{value:t}),e})(sf.close),sf.closeSync=(function(t){function e(r){t.apply(sf,arguments),iqr()}return a(e,"closeSync"),Object.defineProperty(e,U6e,{value:t}),e})(sf.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){SW(sf[fA]),require("assert").equal(sf[fA].length,0)}));var nqr;global[fA]||oqr(global,sf[fA]);Vkt.exports=Gkt(qco(sf));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!sf.__patched&&(Vkt.exports=Gkt(sf),sf.__patched=!0);function Gkt(t){Uco(t),t.gracefulify=Gkt,t.createReadStream=w,t.createWriteStream=R;var e=t.readFile;t.readFile=r;function r(D,N,L){return typeof N=="function"&&(L=N,N=null),B(D,N,L);function B(q,M,O,j){return e(q,M,function(Q){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?yoe([B,[q,M,O],Q,j||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}a(B,"go$readFile")}a(r,"readFile");var n=t.writeFile;t.writeFile=o;function o(D,N,L,B){return typeof L=="function"&&(B=L,L=null),q(D,N,L,B);function q(M,O,j,Q,U){return n(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$writeFile")}a(o,"writeFile");var s=t.appendFile;s&&(t.appendFile=c);function c(D,N,L,B){return typeof L=="function"&&(B=L,L=null),q(D,N,L,B);function q(M,O,j,Q,U){return s(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$appendFile")}a(c,"appendFile");var l=t.copyFile;l&&(t.copyFile=u);function u(D,N,L,B){return typeof L=="function"&&(B=L,L=0),q(D,N,L,B);function q(M,O,j,Q,U){return l(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.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,L){typeof N=="function"&&(L=N,N=null);var B=f.test(process.version)?a(function(O,j,Q,U){return d(O,q(O,j,Q,U))},"go$readdir"):a(function(O,j,Q,U){return d(O,j,q(O,j,Q,U))},"go$readdir");return B(D,N,L);function q(M,O,j,Q){return function(U,Y){U&&(U.code==="EMFILE"||U.code==="ENFILE")?yoe([B,[M,O,j],U,Q||Date.now(),Date.now()]):(Y&&Y.sort&&Y.sort(),typeof j=="function"&&j.call(this,U,Y))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=Qco(t);_=m.ReadStream,b=m.WriteStream}var g=t.ReadStream;g&&(_.prototype=Object.create(g.prototype),_.prototype.open=v);var A=t.WriteStream;A&&(b.prototype=Object.create(A.prototype),b.prototype.open=T),Object.defineProperty(t,"ReadStream",{get:a(function(){return _},"get"),set:a(function(D){_=D},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:a(function(){return b},"get"),set:a(function(D){b=D},"set"),enumerable:!0,configurable:!0});var y=_;Object.defineProperty(t,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(D){y=D},"set"),enumerable:!0,configurable:!0});var E=b;Object.defineProperty(t,"FileWriteStream",{get:a(function(){return E},"get"),set:a(function(D){E=D},"set"),enumerable:!0,configurable:!0});function _(D,N){return this instanceof _?(g.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}a(_,"ReadStream");function v(){var D=this;P(D.path,D.flags,D.mode,function(N,L){N?(D.autoClose&&D.destroy(),D.emit("error",N)):(D.fd=L,D.emit("open",L),D.read())})}a(v,"ReadStream$open");function b(D,N){return this instanceof b?(A.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}a(b,"WriteStream");function T(){var D=this;P(D.path,D.flags,D.mode,function(N,L){N?(D.destroy(),D.emit("error",N)):(D.fd=L,D.emit("open",L))})}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=P;function P(D,N,L,B){return typeof L=="function"&&(B=L,L=null),q(D,N,L,B);function q(M,O,j,Q,U){return x(M,O,j,function(Y,W){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$open")}return a(P,"open"),t}a(Gkt,"patch");function yoe(t){SW("ENQUEUE",t[0].name,t[1]),sf[fA].push(t),$kt()}a(yoe,"enqueue");var F6e;function iqr(){for(var t=Date.now(),e=0;e2&&(sf[fA][e][3]=t,sf[fA][e][4]=t);$kt()}a(iqr,"resetQueue");function $kt(){if(clearTimeout(F6e),F6e=void 0,sf[fA].length!==0){var t=sf[fA].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)SW("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){SW("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?(SW("RETRY",e.name,r),e.apply(null,r.concat([o]))):sf[fA].push(t)}F6e===void 0&&(F6e=setTimeout($kt,0))}}a($kt,"retry")});var g_=I(rB=>{"use strict";p();var sqr=V0().fromCallback,m_=Eoe(),Hco=["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 m_[t]=="function");Object.assign(rB,m_);Hco.forEach(t=>{rB[t]=sqr(m_[t])});rB.exists=function(t,e){return typeof e=="function"?m_.exists(t,e):new Promise(r=>m_.exists(t,r))};rB.read=function(t,e,r,n,o,s){return typeof s=="function"?m_.read(t,e,r,n,o,s):new Promise((c,l)=>{m_.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};rB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.write(t,e,...r):new Promise((n,o)=>{m_.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};rB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.readv(t,e,...r):new Promise((n,o)=>{m_.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};rB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.writev(t,e,...r):new Promise((n,o)=>{m_.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof m_.realpath.native=="function"?rB.realpath.native=sqr(m_.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var cqr=I((oal,aqr)=>{"use strict";p();var Gco=require("path");aqr.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Gco.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var fqr=I((cal,Wkt)=>{"use strict";p();var lqr=g_(),{checkPath:uqr}=cqr(),dqr=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");Wkt.exports.makeDir=async(t,e)=>(uqr(t),lqr.mkdir(t,{mode:dqr(e),recursive:!0}));Wkt.exports.makeDirSync=(t,e)=>(uqr(t),lqr.mkdirSync(t,{mode:dqr(e),recursive:!0}))});var Rk=I((dal,pqr)=>{"use strict";p();var $co=V0().fromPromise,{makeDir:Vco,makeDirSync:zkt}=fqr(),Ykt=$co(Vco);pqr.exports={mkdirs:Ykt,mkdirsSync:zkt,mkdirp:Ykt,mkdirpSync:zkt,ensureDir:Ykt,ensureDirSync:zkt}});var oU=I((pal,mqr)=>{"use strict";p();var Wco=V0().fromPromise,hqr=g_();function zco(t){return hqr.access(t).then(()=>!0).catch(()=>!1)}a(zco,"pathExists");mqr.exports={pathExists:Wco(zco),pathExistsSync:hqr.existsSync}});var Kkt=I((gal,gqr)=>{"use strict";p();var _oe=g_(),Yco=V0().fromPromise;async function Kco(t,e,r){let n=await _oe.open(t,"r+"),o=null;try{await _oe.futimes(n,e,r)}finally{try{await _oe.close(n)}catch(s){o=s}}if(o)throw o}a(Kco,"utimesMillis");function Jco(t,e,r){let n=_oe.openSync(t,"r+");return _oe.futimesSync(n,e,r),_oe.closeSync(n)}a(Jco,"utimesMillisSync");gqr.exports={utimesMillis:Yco(Kco),utimesMillisSync:Jco}});var TW=I((Eal,_qr)=>{"use strict";p();var voe=g_(),W0=require("path"),Aqr=V0().fromPromise;function Zco(t,e,r){let n=r.dereference?o=>voe.stat(o,{bigint:!0}):o=>voe.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(Zco,"getStats");function Xco(t,e,r){let n,o=r.dereference?c=>voe.statSync(c,{bigint:!0}):c=>voe.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(Xco,"getStatsSync");async function elo(t,e,r,n){let{srcStat:o,destStat:s}=await Zco(t,e,n);if(s){if(_Ce(o,s)){let c=W0.basename(t),l=W0.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()&&Jkt(t,e))throw new Error(Q6e(t,e,r));return{srcStat:o,destStat:s}}a(elo,"checkPaths");function tlo(t,e,r,n){let{srcStat:o,destStat:s}=Xco(t,e,n);if(s){if(_Ce(o,s)){let c=W0.basename(t),l=W0.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()&&Jkt(t,e))throw new Error(Q6e(t,e,r));return{srcStat:o,destStat:s}}a(tlo,"checkPathsSync");async function yqr(t,e,r,n){let o=W0.resolve(W0.dirname(t)),s=W0.resolve(W0.dirname(r));if(s===o||s===W0.parse(s).root)return;let c;try{c=await voe.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(_Ce(e,c))throw new Error(Q6e(t,r,n));return yqr(t,e,s,n)}a(yqr,"checkParentPaths");function Eqr(t,e,r,n){let o=W0.resolve(W0.dirname(t)),s=W0.resolve(W0.dirname(r));if(s===o||s===W0.parse(s).root)return;let c;try{c=voe.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(_Ce(e,c))throw new Error(Q6e(t,r,n));return Eqr(t,e,s,n)}a(Eqr,"checkParentPathsSync");function _Ce(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(_Ce,"areIdentical");function Jkt(t,e){let r=W0.resolve(t).split(W0.sep).filter(o=>o),n=W0.resolve(e).split(W0.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(Jkt,"isSrcSubdir");function Q6e(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(Q6e,"errMsg");_qr.exports={checkPaths:Aqr(elo),checkPathsSync:tlo,checkParentPaths:Aqr(yqr),checkParentPathsSync:Eqr,isSrcSubdir:Jkt,areIdentical:_Ce}});var Cqr=I((Cal,vqr)=>{"use strict";p();async function rlo(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(rlo,"asyncIteratorConcurrentProcess");vqr.exports={asyncIteratorConcurrentProcess:rlo}});var xqr=I((Tal,Iqr)=>{"use strict";p();var Oy=g_(),vCe=require("path"),{mkdirs:nlo}=Rk(),{pathExists:ilo}=oU(),{utimesMillis:olo}=Kkt(),CCe=TW(),{asyncIteratorConcurrentProcess:slo}=Cqr();async function alo(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 ico=Object.create;var mCe=Object.defineProperty;var oco=Object.getOwnPropertyDescriptor;var sco=Object.getOwnPropertyNames;var aco=Object.getPrototypeOf,cco=Object.prototype.hasOwnProperty;var pQr=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),hQr=t=>{throw TypeError(t)};var a=(t,e)=>mCe(t,"name",{value:e,configurable:!0});var ve=(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}},ki=(t,e)=>{for(var r in e)mCe(t,r,{get:e[r],enumerable:!0})},mQr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of sco(e))!cco.call(t,o)&&o!==r&&mCe(t,o,{get:()=>e[o],enumerable:!(n=oco(e,o))||n.enumerable});return t};var de=(t,e,r)=>(r=t!=null?ico(aco(t)):{},mQr(e||!t||!t.__esModule?mCe(r,"default",{value:t,enumerable:!0}):r,t)),Ca=t=>mQr(mCe({},"__esModule",{value:!0}),t);var kkt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&hQr("Object expected");var n,o;r&&(n=e[pQr("asyncDispose")]),n===void 0&&(n=e[pQr("dispose")],r&&(o=n)),typeof n!="function"&&hQr("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},Pkt=(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=ve(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var SQr,TQr=ve(()=>{p();SQr="ffffffff-ffff-ffff-ffff-ffffffffffff"});var IQr,xQr=ve(()=>{p();IQr="00000000-0000-0000-0000-000000000000"});var wQr,RQr=ve(()=>{p();wQr=/^(?:[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 _co(t){return typeof t=="string"&&wQr.test(t)}var iU,gCe=ve(()=>{p();RQr();a(_co,"validate");iU=_co});function vco(t){if(!iU(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 XL,ACe=ve(()=>{p();gCe();a(vco,"parse");XL=vco});function h_(t,e=0){return(dA[t[e+0]]+dA[t[e+1]]+dA[t[e+2]]+dA[t[e+3]]+"-"+dA[t[e+4]]+dA[t[e+5]]+"-"+dA[t[e+6]]+dA[t[e+7]]+"-"+dA[t[e+8]]+dA[t[e+9]]+"-"+dA[t[e+10]]+dA[t[e+11]]+dA[t[e+12]]+dA[t[e+13]]+dA[t[e+14]]+dA[t[e+15]]).toLowerCase()}function Cco(t,e=0){let r=h_(t,e);if(!iU(r))throw TypeError("Stringified UUID is invalid");return r}var dA,kQr,eB=ve(()=>{p();gCe();dA=[];for(let t=0;t<256;++t)dA.push((t+256).toString(16).slice(1));a(h_,"unsafeStringify");a(Cco,"stringify");kQr=Cco});function tB(){return crypto.getRandomValues(bco)}var bco,M6e=ve(()=>{p();bco=new Uint8Array(16);a(tB,"rng")});function Sco(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=PQr(t.random??t.rng?.()??tB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=tB();Tco(yCe,s,c),n=PQr(c,yCe.msecs,yCe.nsecs,o?void 0:yCe.clockseq,o?void 0:yCe.node,e,r)}return e??h_(n)}function Tco(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 yCe,O6e,Lkt=ve(()=>{p();M6e();eB();yCe={};a(Sco,"v1");a(Tco,"updateV1State");a(PQr,"v1Bytes");O6e=Sco});function ECe(t){let e=typeof t=="string"?XL(t):t,r=Ico(e);return typeof t=="string"?h_(r):r}function Ico(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 Bkt=ve(()=>{p();ACe();eB();a(ECe,"v1ToV6");a(Ico,"_v1ToV6")});function xco(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,DQr.createHash)("md5").update(t).digest()}var DQr,NQr,MQr=ve(()=>{p();DQr=require("node:crypto");a(xco,"md5");NQr=xco});function wco(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 h_(u)}var L6e,B6e,Fkt=ve(()=>{p();ACe();eB();a(wco,"stringToBytes");L6e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",B6e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(_Ce,"v35")});function Ukt(t,e,r,n){return _Ce(48,NQr,t,e,r,n)}var OQr,LQr=ve(()=>{p();MQr();Fkt();a(Ukt,"v3");Ukt.DNS=L6e;Ukt.URL=B6e;OQr=Ukt});function Rco(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():kco(t,e,r)}function kco(t,e,r){t=t||{};let n=t.random??t.rng?.()??tB();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 h_(n)}var Mt,BQr=ve(()=>{p();M6e();eB();a(Rco,"v4");a(kco,"_v4");Mt=Rco});function Pco(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,FQr.createHash)("sha1").update(t).digest()}var FQr,UQr,QQr=ve(()=>{p();FQr=require("node:crypto");a(Pco,"sha1");UQr=Pco});function Qkt(t,e,r,n){return _Ce(80,UQr,t,e,r,n)}var qQr,jQr=ve(()=>{p();QQr();Fkt();a(Qkt,"v5");Qkt.DNS=L6e;Qkt.URL=B6e;qQr=Qkt});function Dco(t,e,r){t??={},r??=0;let n=O6e({...t,_v6:!0},new Uint8Array(16));if(n=ECe(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 h_(n)}var HQr,GQr=ve(()=>{p();eB();Lkt();Bkt();a(Dco,"v6");HQr=Dco});function qkt(t){let e=typeof t=="string"?XL(t):t,r=Nco(e);return typeof t=="string"?h_(r):r}function Nco(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 $Qr=ve(()=>{p();ACe();eB();a(qkt,"v6ToV1");a(Nco,"_v6ToV1")});function Mco(t,e,r){let n;if(t)n=VQr(t.random??t.rng?.()??tB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=tB();Oco(jkt,o,s),n=VQr(s,jkt.msecs,jkt.seq,e,r)}return e??h_(n)}function Oco(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 VQr(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 jkt,WQr,zQr=ve(()=>{p();M6e();eB();jkt={};a(Mco,"v7");a(Oco,"updateV7State");a(VQr,"v7Bytes");WQr=Mco});function Lco(t){if(!iU(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var YQr,KQr=ve(()=>{p();gCe();a(Lco,"version");YQr=Lco});var Cc={};ki(Cc,{MAX:()=>SQr,NIL:()=>IQr,parse:()=>XL,stringify:()=>kQr,v1:()=>O6e,v1ToV6:()=>ECe,v3:()=>OQr,v4:()=>Mt,v5:()=>qQr,v6:()=>HQr,v6ToV1:()=>qkt,v7:()=>WQr,validate:()=>iU,version:()=>YQr});var Oo=ve(()=>{p();TQr();xQr();ACe();eB();Lkt();Bkt();LQr();BQr();jQr();GQr();$Qr();zQr();gCe();KQr()});var V0=I(Hkt=>{"use strict";p();Hkt.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})};Hkt.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 ZQr=I((Jsl,JQr)=>{p();var oU=require("constants"),Bco=process.cwd,F6e=null,Fco=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return F6e||(F6e=Bco.call(process)),F6e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Gkt=process.chdir,process.chdir=function(t){F6e=null,Gkt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Gkt));var Gkt;JQr.exports=Uco;function Uco(t){oU.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(){}),Fco==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(f){function h(m,g,A){var y=Date.now(),E=0;f(m,g,a(function _(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(g,function(b,T){b&&b.code==="ENOENT"?f(m,g,_):A(v)})},E),E<100&&(E+=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(_&&typeof _=="function"){var b=0;v=a(function(T,w,R){if(T&&T.code==="EAGAIN"&&b<10)return b++,f.call(t,m,g,A,y,E,v);_.apply(this,arguments)},"callback")}return f.call(t,m,g,A,y,E,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 E=0;;)try{return f.call(t,h,m,g,A,y)}catch(_){if(_.code==="EAGAIN"&&E<10){E++;continue}throw _}}})(t.readSync);function e(f){f.lchmod=function(h,m,g){f.open(h,oU.O_WRONLY|oU.O_SYMLINK,m,function(A,y){if(A){g&&g(A);return}f.fchmod(y,m,function(E){f.close(y,function(_){g&&g(E||_)})})})},f.lchmodSync=function(h,m){var g=f.openSync(h,oU.O_WRONLY|oU.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){oU.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,oU.O_SYMLINK,function(y,E){if(y){A&&A(y);return}f.futimes(E,m,g,function(_){f.close(E,function(v){A&&A(_||v)})})})},f.lutimesSync=function(h,m,g){var A=f.openSync(h,oU.O_SYMLINK),y,E=!0;try{y=f.futimesSync(A,m,g),E=!1}finally{if(E)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,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.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(Uco,"patch")});var tqr=I((eal,eqr)=>{p();var XQr=require("stream").Stream;eqr.exports=Qco;function Qco(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);XQr.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);XQr.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(Qco,"legacy")});var nqr=I((nal,rqr)=>{"use strict";p();rqr.exports=jco;var qco=Object.getPrototypeOf||function(t){return t.__proto__};function jco(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:qco(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a(jco,"clone")});var Eoe=I((sal,Wkt)=>{p();var sf=require("fs"),Hco=ZQr(),Gco=tqr(),$co=nqr(),U6e=require("util"),fA,q6e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(fA=Symbol.for("graceful-fs.queue"),q6e=Symbol.for("graceful-fs.previous")):(fA="___graceful-fs.queue",q6e="___graceful-fs.previous");function Vco(){}a(Vco,"noop");function sqr(t,e){Object.defineProperty(t,fA,{get:a(function(){return e},"get")})}a(sqr,"publishQueue");var TW=Vco;U6e.debuglog?TW=U6e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(TW=a(function(){var t=U6e.format.apply(U6e,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t)},"debug"));sf[fA]||(iqr=global[fA]||[],sqr(sf,iqr),sf.close=(function(t){function e(r,n){return t.call(sf,r,function(o){o||oqr(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,q6e,{value:t}),e})(sf.close),sf.closeSync=(function(t){function e(r){t.apply(sf,arguments),oqr()}return a(e,"closeSync"),Object.defineProperty(e,q6e,{value:t}),e})(sf.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){TW(sf[fA]),require("assert").equal(sf[fA].length,0)}));var iqr;global[fA]||sqr(global,sf[fA]);Wkt.exports=$kt($co(sf));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!sf.__patched&&(Wkt.exports=$kt(sf),sf.__patched=!0);function $kt(t){Hco(t),t.gracefulify=$kt,t.createReadStream=w,t.createWriteStream=R;var e=t.readFile;t.readFile=r;function r(D,N,L){return typeof N=="function"&&(L=N,N=null),B(D,N,L);function B(q,M,O,j){return e(q,M,function(Q){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?yoe([B,[q,M,O],Q,j||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}a(B,"go$readFile")}a(r,"readFile");var n=t.writeFile;t.writeFile=o;function o(D,N,L,B){return typeof L=="function"&&(B=L,L=null),q(D,N,L,B);function q(M,O,j,Q,U){return n(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$writeFile")}a(o,"writeFile");var s=t.appendFile;s&&(t.appendFile=c);function c(D,N,L,B){return typeof L=="function"&&(B=L,L=null),q(D,N,L,B);function q(M,O,j,Q,U){return s(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$appendFile")}a(c,"appendFile");var l=t.copyFile;l&&(t.copyFile=u);function u(D,N,L,B){return typeof L=="function"&&(B=L,L=0),q(D,N,L,B);function q(M,O,j,Q,U){return l(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.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,L){typeof N=="function"&&(L=N,N=null);var B=f.test(process.version)?a(function(O,j,Q,U){return d(O,q(O,j,Q,U))},"go$readdir"):a(function(O,j,Q,U){return d(O,j,q(O,j,Q,U))},"go$readdir");return B(D,N,L);function q(M,O,j,Q){return function(U,Y){U&&(U.code==="EMFILE"||U.code==="ENFILE")?yoe([B,[M,O,j],U,Q||Date.now(),Date.now()]):(Y&&Y.sort&&Y.sort(),typeof j=="function"&&j.call(this,U,Y))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=Gco(t);_=m.ReadStream,b=m.WriteStream}var g=t.ReadStream;g&&(_.prototype=Object.create(g.prototype),_.prototype.open=v);var A=t.WriteStream;A&&(b.prototype=Object.create(A.prototype),b.prototype.open=T),Object.defineProperty(t,"ReadStream",{get:a(function(){return _},"get"),set:a(function(D){_=D},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:a(function(){return b},"get"),set:a(function(D){b=D},"set"),enumerable:!0,configurable:!0});var y=_;Object.defineProperty(t,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(D){y=D},"set"),enumerable:!0,configurable:!0});var E=b;Object.defineProperty(t,"FileWriteStream",{get:a(function(){return E},"get"),set:a(function(D){E=D},"set"),enumerable:!0,configurable:!0});function _(D,N){return this instanceof _?(g.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}a(_,"ReadStream");function v(){var D=this;P(D.path,D.flags,D.mode,function(N,L){N?(D.autoClose&&D.destroy(),D.emit("error",N)):(D.fd=L,D.emit("open",L),D.read())})}a(v,"ReadStream$open");function b(D,N){return this instanceof b?(A.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}a(b,"WriteStream");function T(){var D=this;P(D.path,D.flags,D.mode,function(N,L){N?(D.destroy(),D.emit("error",N)):(D.fd=L,D.emit("open",L))})}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=P;function P(D,N,L,B){return typeof L=="function"&&(B=L,L=null),q(D,N,L,B);function q(M,O,j,Q,U){return x(M,O,j,function(Y,W){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$open")}return a(P,"open"),t}a($kt,"patch");function yoe(t){TW("ENQUEUE",t[0].name,t[1]),sf[fA].push(t),Vkt()}a(yoe,"enqueue");var Q6e;function oqr(){for(var t=Date.now(),e=0;e2&&(sf[fA][e][3]=t,sf[fA][e][4]=t);Vkt()}a(oqr,"resetQueue");function Vkt(){if(clearTimeout(Q6e),Q6e=void 0,sf[fA].length!==0){var t=sf[fA].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)TW("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){TW("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?(TW("RETRY",e.name,r),e.apply(null,r.concat([o]))):sf[fA].push(t)}Q6e===void 0&&(Q6e=setTimeout(Vkt,0))}}a(Vkt,"retry")});var g_=I(rB=>{"use strict";p();var aqr=V0().fromCallback,m_=Eoe(),Wco=["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 m_[t]=="function");Object.assign(rB,m_);Wco.forEach(t=>{rB[t]=aqr(m_[t])});rB.exists=function(t,e){return typeof e=="function"?m_.exists(t,e):new Promise(r=>m_.exists(t,r))};rB.read=function(t,e,r,n,o,s){return typeof s=="function"?m_.read(t,e,r,n,o,s):new Promise((c,l)=>{m_.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};rB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.write(t,e,...r):new Promise((n,o)=>{m_.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};rB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.readv(t,e,...r):new Promise((n,o)=>{m_.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};rB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.writev(t,e,...r):new Promise((n,o)=>{m_.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof m_.realpath.native=="function"?rB.realpath.native=aqr(m_.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var lqr=I((dal,cqr)=>{"use strict";p();var zco=require("path");cqr.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(zco.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var pqr=I((hal,zkt)=>{"use strict";p();var uqr=g_(),{checkPath:dqr}=lqr(),fqr=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");zkt.exports.makeDir=async(t,e)=>(dqr(t),uqr.mkdir(t,{mode:fqr(e),recursive:!0}));zkt.exports.makeDirSync=(t,e)=>(dqr(t),uqr.mkdirSync(t,{mode:fqr(e),recursive:!0}))});var kk=I((Aal,hqr)=>{"use strict";p();var Yco=V0().fromPromise,{makeDir:Kco,makeDirSync:Ykt}=pqr(),Kkt=Yco(Kco);hqr.exports={mkdirs:Kkt,mkdirsSync:Ykt,mkdirp:Kkt,mkdirpSync:Ykt,ensureDir:Kkt,ensureDirSync:Ykt}});var sU=I((Eal,gqr)=>{"use strict";p();var Jco=V0().fromPromise,mqr=g_();function Zco(t){return mqr.access(t).then(()=>!0).catch(()=>!1)}a(Zco,"pathExists");gqr.exports={pathExists:Jco(Zco),pathExistsSync:mqr.existsSync}});var Jkt=I((Cal,Aqr)=>{"use strict";p();var _oe=g_(),Xco=V0().fromPromise;async function elo(t,e,r){let n=await _oe.open(t,"r+"),o=null;try{await _oe.futimes(n,e,r)}finally{try{await _oe.close(n)}catch(s){o=s}}if(o)throw o}a(elo,"utimesMillis");function tlo(t,e,r){let n=_oe.openSync(t,"r+");return _oe.futimesSync(n,e,r),_oe.closeSync(n)}a(tlo,"utimesMillisSync");Aqr.exports={utimesMillis:Xco(elo),utimesMillisSync:tlo}});var IW=I((Tal,vqr)=>{"use strict";p();var voe=g_(),W0=require("path"),yqr=V0().fromPromise;function rlo(t,e,r){let n=r.dereference?o=>voe.stat(o,{bigint:!0}):o=>voe.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(rlo,"getStats");function nlo(t,e,r){let n,o=r.dereference?c=>voe.statSync(c,{bigint:!0}):c=>voe.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(nlo,"getStatsSync");async function ilo(t,e,r,n){let{srcStat:o,destStat:s}=await rlo(t,e,n);if(s){if(vCe(o,s)){let c=W0.basename(t),l=W0.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()&&Zkt(t,e))throw new Error(j6e(t,e,r));return{srcStat:o,destStat:s}}a(ilo,"checkPaths");function olo(t,e,r,n){let{srcStat:o,destStat:s}=nlo(t,e,n);if(s){if(vCe(o,s)){let c=W0.basename(t),l=W0.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()&&Zkt(t,e))throw new Error(j6e(t,e,r));return{srcStat:o,destStat:s}}a(olo,"checkPathsSync");async function Eqr(t,e,r,n){let o=W0.resolve(W0.dirname(t)),s=W0.resolve(W0.dirname(r));if(s===o||s===W0.parse(s).root)return;let c;try{c=await voe.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(vCe(e,c))throw new Error(j6e(t,r,n));return Eqr(t,e,s,n)}a(Eqr,"checkParentPaths");function _qr(t,e,r,n){let o=W0.resolve(W0.dirname(t)),s=W0.resolve(W0.dirname(r));if(s===o||s===W0.parse(s).root)return;let c;try{c=voe.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(vCe(e,c))throw new Error(j6e(t,r,n));return _qr(t,e,s,n)}a(_qr,"checkParentPathsSync");function vCe(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(vCe,"areIdentical");function Zkt(t,e){let r=W0.resolve(t).split(W0.sep).filter(o=>o),n=W0.resolve(e).split(W0.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(Zkt,"isSrcSubdir");function j6e(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(j6e,"errMsg");vqr.exports={checkPaths:yqr(ilo),checkPathsSync:olo,checkParentPaths:yqr(Eqr),checkParentPathsSync:_qr,isSrcSubdir:Zkt,areIdentical:vCe}});var bqr=I((wal,Cqr)=>{"use strict";p();async function slo(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(slo,"asyncIteratorConcurrentProcess");Cqr.exports={asyncIteratorConcurrentProcess:slo}});var wqr=I((Pal,xqr)=>{"use strict";p();var Oy=g_(),CCe=require("path"),{mkdirs:alo}=kk(),{pathExists:clo}=sU(),{utimesMillis:llo}=Jkt(),bCe=IW(),{asyncIteratorConcurrentProcess:ulo}=bqr();async function dlo(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 CCe.checkPaths(t,e,"copy",r);if(await CCe.checkParentPaths(t,n,e,"copy"),!await Sqr(t,e,r))return;let c=vCe.dirname(e);await ilo(c)||await nlo(c),await Tqr(o,t,e,r)}a(alo,"copy");async function Sqr(t,e,r){return r.filter?r.filter(t,e):!0}a(Sqr,"runFilter");async function Tqr(t,e,r,n){let s=await(n.dereference?Oy.stat:Oy.lstat)(e);if(s.isDirectory())return dlo(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return clo(s,t,e,r,n);if(s.isSymbolicLink())return flo(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(Tqr,"getStatsAndPerformCopy");async function clo(t,e,r,n,o){if(!e)return bqr(t,r,n,o);if(o.overwrite)return await Oy.unlink(n),bqr(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(clo,"onFile");async function bqr(t,e,r,n){if(await Oy.copyFile(e,r),n.preserveTimestamps){llo(t.mode)&&await ulo(r,t.mode);let o=await Oy.stat(e);await olo(r,o.atime,o.mtime)}return Oy.chmod(r,t.mode)}a(bqr,"copyFile");function llo(t){return(t&128)===0}a(llo,"fileIsNotWritable");function ulo(t,e){return Oy.chmod(t,e|128)}a(ulo,"makeFileWritable");async function dlo(t,e,r,n,o){e||await Oy.mkdir(n),await slo(await Oy.opendir(r),async s=>{let c=vCe.join(r,s.name),l=vCe.join(n,s.name);if(await Sqr(c,l,o)){let{destStat:d}=await CCe.checkPaths(c,l,"copy",o);await Tqr(d,c,l,o)}}),e||await Oy.chmod(n,t.mode)}a(dlo,"onDir");async function flo(t,e,r,n){let o=await Oy.readlink(e);if(n.dereference&&(o=vCe.resolve(process.cwd(),o)),!t)return Oy.symlink(o,r);let s=null;try{s=await Oy.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return Oy.symlink(o,r);throw c}if(n.dereference&&(s=vCe.resolve(process.cwd(),s)),o!==s){if(CCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(CCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await Oy.unlink(r),Oy.symlink(o,r)}a(flo,"onLink");Iqr.exports=alo});var Dqr=I((wal,Pqr)=>{"use strict";p();var A_=Eoe(),bCe=require("path"),plo=Rk().mkdirsSync,hlo=Kkt().utimesMillisSync,SCe=TW();function mlo(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 bCe.checkPaths(t,e,"copy",r);if(await bCe.checkParentPaths(t,n,e,"copy"),!await Tqr(t,e,r))return;let c=CCe.dirname(e);await clo(c)||await alo(c),await Iqr(o,t,e,r)}a(dlo,"copy");async function Tqr(t,e,r){return r.filter?r.filter(t,e):!0}a(Tqr,"runFilter");async function Iqr(t,e,r,n){let s=await(n.dereference?Oy.stat:Oy.lstat)(e);if(s.isDirectory())return mlo(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return flo(s,t,e,r,n);if(s.isSymbolicLink())return glo(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(Iqr,"getStatsAndPerformCopy");async function flo(t,e,r,n,o){if(!e)return Sqr(t,r,n,o);if(o.overwrite)return await Oy.unlink(n),Sqr(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(flo,"onFile");async function Sqr(t,e,r,n){if(await Oy.copyFile(e,r),n.preserveTimestamps){plo(t.mode)&&await hlo(r,t.mode);let o=await Oy.stat(e);await llo(r,o.atime,o.mtime)}return Oy.chmod(r,t.mode)}a(Sqr,"copyFile");function plo(t){return(t&128)===0}a(plo,"fileIsNotWritable");function hlo(t,e){return Oy.chmod(t,e|128)}a(hlo,"makeFileWritable");async function mlo(t,e,r,n,o){e||await Oy.mkdir(n),await ulo(await Oy.opendir(r),async s=>{let c=CCe.join(r,s.name),l=CCe.join(n,s.name);if(await Tqr(c,l,o)){let{destStat:d}=await bCe.checkPaths(c,l,"copy",o);await Iqr(d,c,l,o)}}),e||await Oy.chmod(n,t.mode)}a(mlo,"onDir");async function glo(t,e,r,n){let o=await Oy.readlink(e);if(n.dereference&&(o=CCe.resolve(process.cwd(),o)),!t)return Oy.symlink(o,r);let s=null;try{s=await Oy.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return Oy.symlink(o,r);throw c}if(n.dereference&&(s=CCe.resolve(process.cwd(),s)),o!==s){if(bCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(bCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await Oy.unlink(r),Oy.symlink(o,r)}a(glo,"onLink");xqr.exports=dlo});var Nqr=I((Mal,Dqr)=>{"use strict";p();var A_=Eoe(),SCe=require("path"),Alo=kk().mkdirsSync,ylo=Jkt().utimesMillisSync,TCe=IW();function Elo(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}=SCe.checkPathsSync(t,e,"copy",r);if(SCe.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let s=bCe.dirname(e);return A_.existsSync(s)||plo(s),wqr(o,t,e,r)}a(mlo,"copySync");function wqr(t,e,r,n){let s=(n.dereference?A_.statSync:A_.lstatSync)(e);if(s.isDirectory())return Clo(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return glo(s,t,e,r,n);if(s.isSymbolicLink())return Tlo(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(wqr,"getStats");function glo(t,e,r,n,o){return e?Alo(t,r,n,o):Rqr(t,r,n,o)}a(glo,"onFile");function Alo(t,e,r,n){if(n.overwrite)return A_.unlinkSync(r),Rqr(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}a(Alo,"mayCopyFile");function Rqr(t,e,r,n){return A_.copyFileSync(e,r),n.preserveTimestamps&&ylo(t.mode,e,r),Zkt(r,t.mode)}a(Rqr,"copyFile");function ylo(t,e,r){return Elo(t)&&_lo(r,t),vlo(e,r)}a(ylo,"handleTimestamps");function Elo(t){return(t&128)===0}a(Elo,"fileIsNotWritable");function _lo(t,e){return Zkt(t,e|128)}a(_lo,"makeFileWritable");function Zkt(t,e){return A_.chmodSync(t,e)}a(Zkt,"setDestMode");function vlo(t,e){let r=A_.statSync(t);return hlo(e,r.atime,r.mtime)}a(vlo,"setDestTimestamps");function Clo(t,e,r,n,o){return e?kqr(r,n,o):blo(t.mode,r,n,o)}a(Clo,"onDir");function blo(t,e,r,n){return A_.mkdirSync(r),kqr(e,r,n),Zkt(r,t)}a(blo,"mkDirAndCopy");function kqr(t,e,r){let n=A_.opendirSync(t);try{let o;for(;(o=n.readSync())!==null;)Slo(o.name,t,e,r)}finally{n.closeSync()}}a(kqr,"copyDir");function Slo(t,e,r,n){let o=bCe.join(e,t),s=bCe.join(r,t);if(n.filter&&!n.filter(o,s))return;let{destStat:c}=SCe.checkPathsSync(o,s,"copy",n);return wqr(c,o,s,n)}a(Slo,"copyDirItem");function Tlo(t,e,r,n){let o=A_.readlinkSync(e);if(n.dereference&&(o=bCe.resolve(process.cwd(),o)),t){let s;try{s=A_.readlinkSync(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return A_.symlinkSync(o,r);throw c}if(n.dereference&&(s=bCe.resolve(process.cwd(),s)),o!==s){if(SCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(SCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return Ilo(o,r)}else return A_.symlinkSync(o,r)}a(Tlo,"onLink");function Ilo(t,e){return A_.unlinkSync(e),A_.symlinkSync(t,e)}a(Ilo,"copyLink");Pqr.exports=mlo});var q6e=I((Pal,Nqr)=>{"use strict";p();var xlo=V0().fromPromise;Nqr.exports={copy:xlo(xqr()),copySync:Dqr()}});var TCe=I((Nal,Oqr)=>{"use strict";p();var Mqr=Eoe(),wlo=V0().fromCallback;function Rlo(t,e){Mqr.rm(t,{recursive:!0,force:!0},e)}a(Rlo,"remove");function klo(t){Mqr.rmSync(t,{recursive:!0,force:!0})}a(klo,"removeSync");Oqr.exports={remove:wlo(Rlo),removeSync:klo}});var Hqr=I((Lal,jqr)=>{"use strict";p();var Plo=V0().fromPromise,Fqr=g_(),Uqr=require("path"),Qqr=Rk(),qqr=TCe(),Lqr=Plo(a(async function(e){let r;try{r=await Fqr.readdir(e)}catch{return Qqr.mkdirs(e)}return Promise.all(r.map(n=>qqr.remove(Uqr.join(e,n))))},"emptyDir"));function Bqr(t){let e;try{e=Fqr.readdirSync(t)}catch{return Qqr.mkdirsSync(t)}e.forEach(r=>{r=Uqr.join(t,r),qqr.removeSync(r)})}a(Bqr,"emptyDirSync");jqr.exports={emptyDirSync:Bqr,emptydirSync:Bqr,emptyDir:Lqr,emptydir:Lqr}});var Wqr=I((Ual,Vqr)=>{"use strict";p();var Dlo=V0().fromPromise,Gqr=require("path"),nB=g_(),$qr=Rk();async function Nlo(t){let e;try{e=await nB.stat(t)}catch{}if(e&&e.isFile())return;let r=Gqr.dirname(t),n=null;try{n=await nB.stat(r)}catch(o){if(o.code==="ENOENT"){await $qr.mkdirs(r),await nB.writeFile(t,"");return}else throw o}n.isDirectory()?await nB.writeFile(t,""):await nB.readdir(r)}a(Nlo,"createFile");function Mlo(t){let e;try{e=nB.statSync(t)}catch{}if(e&&e.isFile())return;let r=Gqr.dirname(t);try{nB.statSync(r).isDirectory()||nB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")$qr.mkdirsSync(r);else throw n}nB.writeFileSync(t,"")}a(Mlo,"createFileSync");Vqr.exports={createFile:Dlo(Nlo),createFileSync:Mlo}});var Zqr=I((jal,Jqr)=>{"use strict";p();var Olo=V0().fromPromise,zqr=require("path"),sU=g_(),Yqr=Rk(),{pathExists:Llo}=oU(),{areIdentical:Kqr}=TW();async function Blo(t,e){let r;try{r=await sU.lstat(e)}catch{}let n;try{n=await sU.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&Kqr(n,r))return;let o=zqr.dirname(e);await Llo(o)||await Yqr.mkdirs(o),await sU.link(t,e)}a(Blo,"createLink");function Flo(t,e){let r;try{r=sU.lstatSync(e)}catch{}try{let s=sU.lstatSync(t);if(r&&Kqr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=zqr.dirname(e);return sU.existsSync(n)||Yqr.mkdirsSync(n),sU.linkSync(t,e)}a(Flo,"createLinkSync");Jqr.exports={createLink:Olo(Blo),createLinkSync:Flo}});var ejr=I(($al,Xqr)=>{"use strict";p();var aU=require("path"),ICe=g_(),{pathExists:Ulo}=oU(),Qlo=V0().fromPromise;async function qlo(t,e){if(aU.isAbsolute(t)){try{await ICe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=aU.dirname(e),n=aU.join(r,t);if(await Ulo(n))return{toCwd:n,toDst:t};try{await ICe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:aU.relative(r,t)}}a(qlo,"symlinkPaths");function jlo(t,e){if(aU.isAbsolute(t)){if(!ICe.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=aU.dirname(e),n=aU.join(r,t);if(ICe.existsSync(n))return{toCwd:n,toDst:t};if(!ICe.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:aU.relative(r,t)}}a(jlo,"symlinkPathsSync");Xqr.exports={symlinkPaths:Qlo(qlo),symlinkPathsSync:jlo}});var njr=I((zal,rjr)=>{"use strict";p();var tjr=g_(),Hlo=V0().fromPromise;async function Glo(t,e){if(e)return e;let r;try{r=await tjr.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Glo,"symlinkType");function $lo(t,e){if(e)return e;let r;try{r=tjr.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a($lo,"symlinkTypeSync");rjr.exports={symlinkType:Hlo(Glo),symlinkTypeSync:$lo}});var sjr=I((Jal,ojr)=>{"use strict";p();var Vlo=V0().fromPromise,cU=require("path"),rC=g_(),{mkdirs:Wlo,mkdirsSync:zlo}=Rk(),{symlinkPaths:Ylo,symlinkPathsSync:Klo}=ejr(),{symlinkType:Jlo,symlinkTypeSync:Zlo}=njr(),{pathExists:Xlo}=oU(),{areIdentical:ijr}=TW();async function euo(t,e,r){let n;try{n=await rC.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(cU.isAbsolute(t))l=await rC.stat(t);else{let d=cU.dirname(e),f=cU.join(d,t);try{l=await rC.stat(f)}catch{l=await rC.stat(t)}}let u=await rC.stat(e);if(ijr(l,u))return}let o=await Ylo(t,e);t=o.toDst;let s=await Jlo(o.toCwd,r),c=cU.dirname(e);return await Xlo(c)||await Wlo(c),rC.symlink(t,e,s)}a(euo,"createSymlink");function tuo(t,e,r){let n;try{n=rC.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(cU.isAbsolute(t))l=rC.statSync(t);else{let d=cU.dirname(e),f=cU.join(d,t);try{l=rC.statSync(f)}catch{l=rC.statSync(t)}}let u=rC.statSync(e);if(ijr(l,u))return}let o=Klo(t,e);t=o.toDst,r=Zlo(o.toCwd,r);let s=cU.dirname(e);return rC.existsSync(s)||zlo(s),rC.symlinkSync(t,e,r)}a(tuo,"createSymlinkSync");ojr.exports={createSymlink:Vlo(euo),createSymlinkSync:tuo}});var hjr=I((ecl,pjr)=>{"use strict";p();var{createFile:ajr,createFileSync:cjr}=Wqr(),{createLink:ljr,createLinkSync:ujr}=Zqr(),{createSymlink:djr,createSymlinkSync:fjr}=sjr();pjr.exports={createFile:ajr,createFileSync:cjr,ensureFile:ajr,ensureFileSync:cjr,createLink:ljr,createLinkSync:ujr,ensureLink:ljr,ensureLinkSync:ujr,createSymlink:djr,createSymlinkSync:fjr,ensureSymlink:djr,ensureSymlinkSync:fjr}});var j6e=I((rcl,mjr)=>{p();function ruo(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(ruo,"stringify");function nuo(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(nuo,"stripBom");mjr.exports={stringify:ruo,stripBom:nuo}});var Ejr=I((ocl,yjr)=>{p();var Coe;try{Coe=Eoe()}catch{Coe=require("fs")}var H6e=V0(),{stringify:gjr,stripBom:Ajr}=j6e();async function iuo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Coe,n="throws"in e?e.throws:!0,o=await H6e.fromCallback(r.readFile)(t,e);o=Ajr(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(iuo,"_readFile");var ouo=H6e.fromPromise(iuo);function suo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Coe,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=Ajr(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(suo,"readFileSync");async function auo(t,e,r={}){let n=r.fs||Coe,o=gjr(e,r);await H6e.fromCallback(n.writeFile)(t,o,r)}a(auo,"_writeFile");var cuo=H6e.fromPromise(auo);function luo(t,e,r={}){let n=r.fs||Coe,o=gjr(e,r);return n.writeFileSync(t,o,r)}a(luo,"writeFileSync");yjr.exports={readFile:ouo,readFileSync:suo,writeFile:cuo,writeFileSync:luo}});var vjr=I((ccl,_jr)=>{"use strict";p();var G6e=Ejr();_jr.exports={readJson:G6e.readFile,readJsonSync:G6e.readFileSync,writeJson:G6e.writeFile,writeJsonSync:G6e.writeFileSync}});var $6e=I((ucl,Sjr)=>{"use strict";p();var uuo=V0().fromPromise,Xkt=g_(),Cjr=require("path"),bjr=Rk(),duo=oU().pathExists;async function fuo(t,e,r="utf-8"){let n=Cjr.dirname(t);return await duo(n)||await bjr.mkdirs(n),Xkt.writeFile(t,e,r)}a(fuo,"outputFile");function puo(t,...e){let r=Cjr.dirname(t);Xkt.existsSync(r)||bjr.mkdirsSync(r),Xkt.writeFileSync(t,...e)}a(puo,"outputFileSync");Sjr.exports={outputFile:uuo(fuo),outputFileSync:puo}});var Ijr=I((pcl,Tjr)=>{"use strict";p();var{stringify:huo}=j6e(),{outputFile:muo}=$6e();async function guo(t,e,r={}){let n=huo(e,r);await muo(t,n,r)}a(guo,"outputJson");Tjr.exports=guo});var wjr=I((gcl,xjr)=>{"use strict";p();var{stringify:Auo}=j6e(),{outputFileSync:yuo}=$6e();function Euo(t,e,r){let n=Auo(e,r);yuo(t,n,r)}a(Euo,"outputJsonSync");xjr.exports=Euo});var kjr=I((Ecl,Rjr)=>{"use strict";p();var _uo=V0().fromPromise,y_=vjr();y_.outputJson=_uo(Ijr());y_.outputJsonSync=wjr();y_.outputJSON=y_.outputJson;y_.outputJSONSync=y_.outputJsonSync;y_.writeJSON=y_.writeJson;y_.writeJSONSync=y_.writeJsonSync;y_.readJSON=y_.readJson;y_.readJSONSync=y_.readJsonSync;Rjr.exports=y_});var Ojr=I((vcl,Mjr)=>{"use strict";p();var vuo=g_(),Pjr=require("path"),{copy:Cuo}=q6e(),{remove:Njr}=TCe(),{mkdirp:buo}=Rk(),{pathExists:Suo}=oU(),Djr=TW();async function Tuo(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await Djr.checkPaths(t,e,"move",r);await Djr.checkParentPaths(t,o,e,"move");let c=Pjr.dirname(e);return Pjr.parse(c).root!==c&&await buo(c),Iuo(t,e,n,s)}a(Tuo,"move");async function Iuo(t,e,r,n){if(!n){if(r)await Njr(e);else if(await Suo(e))throw new Error("dest already exists.")}try{await vuo.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await xuo(t,e,r)}}a(Iuo,"doRename");async function xuo(t,e,r){return await Cuo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Njr(t)}a(xuo,"moveAcrossDevice");Mjr.exports=Tuo});var Qjr=I((Scl,Ujr)=>{"use strict";p();var Bjr=Eoe(),tPt=require("path"),wuo=q6e().copySync,Fjr=TCe().removeSync,Ruo=Rk().mkdirpSync,Ljr=TW();function kuo(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=Ljr.checkPathsSync(t,e,"move",r);return Ljr.checkParentPathsSync(t,o,e,"move"),Puo(e)||Ruo(tPt.dirname(e)),Duo(t,e,n,s)}a(kuo,"moveSync");function Puo(t){let e=tPt.dirname(t);return tPt.parse(e).root===e}a(Puo,"isParentRoot");function Duo(t,e,r,n){if(n)return ePt(t,e,r);if(r)return Fjr(e),ePt(t,e,r);if(Bjr.existsSync(e))throw new Error("dest already exists.");return ePt(t,e,r)}a(Duo,"doRename");function ePt(t,e,r){try{Bjr.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return Nuo(t,e,r)}}a(ePt,"rename");function Nuo(t,e,r){return wuo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Fjr(t)}a(Nuo,"moveAcrossDevice");Ujr.exports=kuo});var jjr=I((xcl,qjr)=>{"use strict";p();var Muo=V0().fromPromise;qjr.exports={move:Muo(Ojr()),moveSync:Qjr()}});var Gjr=I((Rcl,Hjr)=>{"use strict";p();Hjr.exports={...g_(),...q6e(),...Hqr(),...hjr(),...kjr(),...Rk(),...jjr(),...$6e(),...oU(),...TCe()}});var W6e=I((Pcl,Wjr)=>{p();var rPt=require("fs"),V6e=require("path"),xCe=V6e.join,Ouo=V6e.dirname,$jr=rPt.accessSync&&function(t){try{rPt.accessSync(t)}catch{return!1}return!0}||rPt.existsSync||V6e.existsSync,Vjr={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 Luo(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(Vjr).map(function(u){u in t||(t[u]=Vjr[u])}),t.module_root||(t.module_root=Buo(__filename)),V6e.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 Plo=V0().fromPromise;Mqr.exports={copy:Plo(wqr()),copySync:Nqr()}});var ICe=I((Ual,Lqr)=>{"use strict";p();var Oqr=Eoe(),Dlo=V0().fromCallback;function Nlo(t,e){Oqr.rm(t,{recursive:!0,force:!0},e)}a(Nlo,"remove");function Mlo(t){Oqr.rmSync(t,{recursive:!0,force:!0})}a(Mlo,"removeSync");Lqr.exports={remove:Dlo(Nlo),removeSync:Mlo}});var Gqr=I((jal,Hqr)=>{"use strict";p();var Olo=V0().fromPromise,Uqr=g_(),Qqr=require("path"),qqr=kk(),jqr=ICe(),Bqr=Olo(a(async function(e){let r;try{r=await Uqr.readdir(e)}catch{return qqr.mkdirs(e)}return Promise.all(r.map(n=>jqr.remove(Qqr.join(e,n))))},"emptyDir"));function Fqr(t){let e;try{e=Uqr.readdirSync(t)}catch{return qqr.mkdirsSync(t)}e.forEach(r=>{r=Qqr.join(t,r),jqr.removeSync(r)})}a(Fqr,"emptyDirSync");Hqr.exports={emptyDirSync:Fqr,emptydirSync:Fqr,emptyDir:Bqr,emptydir:Bqr}});var zqr=I(($al,Wqr)=>{"use strict";p();var Llo=V0().fromPromise,$qr=require("path"),nB=g_(),Vqr=kk();async function Blo(t){let e;try{e=await nB.stat(t)}catch{}if(e&&e.isFile())return;let r=$qr.dirname(t),n=null;try{n=await nB.stat(r)}catch(o){if(o.code==="ENOENT"){await Vqr.mkdirs(r),await nB.writeFile(t,"");return}else throw o}n.isDirectory()?await nB.writeFile(t,""):await nB.readdir(r)}a(Blo,"createFile");function Flo(t){let e;try{e=nB.statSync(t)}catch{}if(e&&e.isFile())return;let r=$qr.dirname(t);try{nB.statSync(r).isDirectory()||nB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")Vqr.mkdirsSync(r);else throw n}nB.writeFileSync(t,"")}a(Flo,"createFileSync");Wqr.exports={createFile:Llo(Blo),createFileSync:Flo}});var Xqr=I((zal,Zqr)=>{"use strict";p();var Ulo=V0().fromPromise,Yqr=require("path"),aU=g_(),Kqr=kk(),{pathExists:Qlo}=sU(),{areIdentical:Jqr}=IW();async function qlo(t,e){let r;try{r=await aU.lstat(e)}catch{}let n;try{n=await aU.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&Jqr(n,r))return;let o=Yqr.dirname(e);await Qlo(o)||await Kqr.mkdirs(o),await aU.link(t,e)}a(qlo,"createLink");function jlo(t,e){let r;try{r=aU.lstatSync(e)}catch{}try{let s=aU.lstatSync(t);if(r&&Jqr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=Yqr.dirname(e);return aU.existsSync(n)||Kqr.mkdirsSync(n),aU.linkSync(t,e)}a(jlo,"createLinkSync");Zqr.exports={createLink:Ulo(qlo),createLinkSync:jlo}});var tjr=I((Jal,ejr)=>{"use strict";p();var cU=require("path"),xCe=g_(),{pathExists:Hlo}=sU(),Glo=V0().fromPromise;async function $lo(t,e){if(cU.isAbsolute(t)){try{await xCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=cU.dirname(e),n=cU.join(r,t);if(await Hlo(n))return{toCwd:n,toDst:t};try{await xCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:cU.relative(r,t)}}a($lo,"symlinkPaths");function Vlo(t,e){if(cU.isAbsolute(t)){if(!xCe.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=cU.dirname(e),n=cU.join(r,t);if(xCe.existsSync(n))return{toCwd:n,toDst:t};if(!xCe.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:cU.relative(r,t)}}a(Vlo,"symlinkPathsSync");ejr.exports={symlinkPaths:Glo($lo),symlinkPathsSync:Vlo}});var ijr=I((ecl,njr)=>{"use strict";p();var rjr=g_(),Wlo=V0().fromPromise;async function zlo(t,e){if(e)return e;let r;try{r=await rjr.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(zlo,"symlinkType");function Ylo(t,e){if(e)return e;let r;try{r=rjr.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Ylo,"symlinkTypeSync");njr.exports={symlinkType:Wlo(zlo),symlinkTypeSync:Ylo}});var ajr=I((ncl,sjr)=>{"use strict";p();var Klo=V0().fromPromise,lU=require("path"),nC=g_(),{mkdirs:Jlo,mkdirsSync:Zlo}=kk(),{symlinkPaths:Xlo,symlinkPathsSync:euo}=tjr(),{symlinkType:tuo,symlinkTypeSync:ruo}=ijr(),{pathExists:nuo}=sU(),{areIdentical:ojr}=IW();async function iuo(t,e,r){let n;try{n=await nC.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(lU.isAbsolute(t))l=await nC.stat(t);else{let d=lU.dirname(e),f=lU.join(d,t);try{l=await nC.stat(f)}catch{l=await nC.stat(t)}}let u=await nC.stat(e);if(ojr(l,u))return}let o=await Xlo(t,e);t=o.toDst;let s=await tuo(o.toCwd,r),c=lU.dirname(e);return await nuo(c)||await Jlo(c),nC.symlink(t,e,s)}a(iuo,"createSymlink");function ouo(t,e,r){let n;try{n=nC.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(lU.isAbsolute(t))l=nC.statSync(t);else{let d=lU.dirname(e),f=lU.join(d,t);try{l=nC.statSync(f)}catch{l=nC.statSync(t)}}let u=nC.statSync(e);if(ojr(l,u))return}let o=euo(t,e);t=o.toDst,r=ruo(o.toCwd,r);let s=lU.dirname(e);return nC.existsSync(s)||Zlo(s),nC.symlinkSync(t,e,r)}a(ouo,"createSymlinkSync");sjr.exports={createSymlink:Klo(iuo),createSymlinkSync:ouo}});var mjr=I((scl,hjr)=>{"use strict";p();var{createFile:cjr,createFileSync:ljr}=zqr(),{createLink:ujr,createLinkSync:djr}=Xqr(),{createSymlink:fjr,createSymlinkSync:pjr}=ajr();hjr.exports={createFile:cjr,createFileSync:ljr,ensureFile:cjr,ensureFileSync:ljr,createLink:ujr,createLinkSync:djr,ensureLink:ujr,ensureLinkSync:djr,createSymlink:fjr,createSymlinkSync:pjr,ensureSymlink:fjr,ensureSymlinkSync:pjr}});var G6e=I((ccl,gjr)=>{p();function suo(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(suo,"stringify");function auo(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(auo,"stripBom");gjr.exports={stringify:suo,stripBom:auo}});var _jr=I((dcl,Ejr)=>{p();var Coe;try{Coe=Eoe()}catch{Coe=require("fs")}var $6e=V0(),{stringify:Ajr,stripBom:yjr}=G6e();async function cuo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Coe,n="throws"in e?e.throws:!0,o=await $6e.fromCallback(r.readFile)(t,e);o=yjr(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(cuo,"_readFile");var luo=$6e.fromPromise(cuo);function uuo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Coe,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=yjr(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(uuo,"readFileSync");async function duo(t,e,r={}){let n=r.fs||Coe,o=Ajr(e,r);await $6e.fromCallback(n.writeFile)(t,o,r)}a(duo,"_writeFile");var fuo=$6e.fromPromise(duo);function puo(t,e,r={}){let n=r.fs||Coe,o=Ajr(e,r);return n.writeFileSync(t,o,r)}a(puo,"writeFileSync");Ejr.exports={readFile:luo,readFileSync:uuo,writeFile:fuo,writeFileSync:puo}});var Cjr=I((hcl,vjr)=>{"use strict";p();var V6e=_jr();vjr.exports={readJson:V6e.readFile,readJsonSync:V6e.readFileSync,writeJson:V6e.writeFile,writeJsonSync:V6e.writeFileSync}});var W6e=I((gcl,Tjr)=>{"use strict";p();var huo=V0().fromPromise,ePt=g_(),bjr=require("path"),Sjr=kk(),muo=sU().pathExists;async function guo(t,e,r="utf-8"){let n=bjr.dirname(t);return await muo(n)||await Sjr.mkdirs(n),ePt.writeFile(t,e,r)}a(guo,"outputFile");function Auo(t,...e){let r=bjr.dirname(t);ePt.existsSync(r)||Sjr.mkdirsSync(r),ePt.writeFileSync(t,...e)}a(Auo,"outputFileSync");Tjr.exports={outputFile:huo(guo),outputFileSync:Auo}});var xjr=I((Ecl,Ijr)=>{"use strict";p();var{stringify:yuo}=G6e(),{outputFile:Euo}=W6e();async function _uo(t,e,r={}){let n=yuo(e,r);await Euo(t,n,r)}a(_uo,"outputJson");Ijr.exports=_uo});var Rjr=I((Ccl,wjr)=>{"use strict";p();var{stringify:vuo}=G6e(),{outputFileSync:Cuo}=W6e();function buo(t,e,r){let n=vuo(e,r);Cuo(t,n,r)}a(buo,"outputJsonSync");wjr.exports=buo});var Pjr=I((Tcl,kjr)=>{"use strict";p();var Suo=V0().fromPromise,y_=Cjr();y_.outputJson=Suo(xjr());y_.outputJsonSync=Rjr();y_.outputJSON=y_.outputJson;y_.outputJSONSync=y_.outputJsonSync;y_.writeJSON=y_.writeJson;y_.writeJSONSync=y_.writeJsonSync;y_.readJSON=y_.readJson;y_.readJSONSync=y_.readJsonSync;kjr.exports=y_});var Ljr=I((xcl,Ojr)=>{"use strict";p();var Tuo=g_(),Djr=require("path"),{copy:Iuo}=H6e(),{remove:Mjr}=ICe(),{mkdirp:xuo}=kk(),{pathExists:wuo}=sU(),Njr=IW();async function Ruo(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await Njr.checkPaths(t,e,"move",r);await Njr.checkParentPaths(t,o,e,"move");let c=Djr.dirname(e);return Djr.parse(c).root!==c&&await xuo(c),kuo(t,e,n,s)}a(Ruo,"move");async function kuo(t,e,r,n){if(!n){if(r)await Mjr(e);else if(await wuo(e))throw new Error("dest already exists.")}try{await Tuo.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await Puo(t,e,r)}}a(kuo,"doRename");async function Puo(t,e,r){return await Iuo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Mjr(t)}a(Puo,"moveAcrossDevice");Ojr.exports=Ruo});var qjr=I((kcl,Qjr)=>{"use strict";p();var Fjr=Eoe(),rPt=require("path"),Duo=H6e().copySync,Ujr=ICe().removeSync,Nuo=kk().mkdirpSync,Bjr=IW();function Muo(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=Bjr.checkPathsSync(t,e,"move",r);return Bjr.checkParentPathsSync(t,o,e,"move"),Ouo(e)||Nuo(rPt.dirname(e)),Luo(t,e,n,s)}a(Muo,"moveSync");function Ouo(t){let e=rPt.dirname(t);return rPt.parse(e).root===e}a(Ouo,"isParentRoot");function Luo(t,e,r,n){if(n)return tPt(t,e,r);if(r)return Ujr(e),tPt(t,e,r);if(Fjr.existsSync(e))throw new Error("dest already exists.");return tPt(t,e,r)}a(Luo,"doRename");function tPt(t,e,r){try{Fjr.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return Buo(t,e,r)}}a(tPt,"rename");function Buo(t,e,r){return Duo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Ujr(t)}a(Buo,"moveAcrossDevice");Qjr.exports=Muo});var Hjr=I((Ncl,jjr)=>{"use strict";p();var Fuo=V0().fromPromise;jjr.exports={move:Fuo(Ljr()),moveSync:qjr()}});var $jr=I((Ocl,Gjr)=>{"use strict";p();Gjr.exports={...g_(),...H6e(),...Gqr(),...mjr(),...Pjr(),...kk(),...Hjr(),...W6e(),...sU(),...ICe()}});var Y6e=I((Bcl,zjr)=>{p();var nPt=require("fs"),z6e=require("path"),wCe=z6e.join,Uuo=z6e.dirname,Vjr=nPt.accessSync&&function(t){try{nPt.accessSync(t)}catch{return!1}return!0}||nPt.existsSync||z6e.existsSync,Wjr={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 Quo(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(Wjr).map(function(u){u in t||(t[u]=Wjr[u])}),t.module_root||(t.module_root=quo(__filename)),z6e.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 Fuo=FI&&FI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Uuo=FI&&FI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zjr=FI&&FI.__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)&&Fuo(e,t,r);return Uuo(e,t),e};Object.defineProperty(FI,"__esModule",{value:!0});FI.setDeviceId=FI.getDeviceId=void 0;var z6e=zjr(require("path")),Y6e=zjr(Gjr()),Yjr=process.platform==="win32"?W6e()("windows"):null,Quo="deviceid";function Kjr(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=z6e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??z6e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return z6e.join(t,"Microsoft","DeveloperTools")}a(Kjr,"getDirectory");function nPt(){return z6e.join(Kjr(),Quo)}a(nPt,"getDeviceIdFilePath");async function quo(){return process.platform==="win32"?Yjr?.GetDeviceId():await juo(nPt())?Y6e.readFile(nPt(),"utf8"):void 0}a(quo,"getDeviceId");FI.getDeviceId=quo;async function juo(t){try{return await Y6e.promises.access(t),!0}catch{return!1}}a(juo,"exists");async function Huo(t){process.platform==="win32"?Yjr?.SetDeviceId(t):(await Y6e.ensureDir(Kjr()),await Y6e.writeFile(nPt(),t,"utf8"))}a(Huo,"setDeviceId");FI.setDeviceId=Huo});var Xjr=I(ZN=>{"use strict";p();var Guo=ZN&&ZN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$uo=ZN&&ZN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Vuo=ZN&&ZN.__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)&&Guo(e,t,r);return $uo(e,t),e};Object.defineProperty(ZN,"__esModule",{value:!0});ZN.getDeviceId=void 0;var Wuo=(Mo(),ba(Cc)),Zjr=Vuo(Jjr());async function zuo(){let t;try{t=await Zjr.getDeviceId()}catch{}if(t)return t;{let e=(0,Wuo.v4)().toLowerCase();return await Zjr.setDeviceId(e),e}}a(zuo,"getDeviceId");ZN.getDeviceId=zuo});var eHr=I(IW=>{"use strict";p();var Yuo=IW&&IW.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Kuo=IW&&IW.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yuo(e,t,r)};Object.defineProperty(IW,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");Kuo(Xjr(),IW)});var sa=I((J6e,tHr)=>{p();(function(t,e){typeof J6e=="object"?tHr.exports=J6e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(J6e,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 _(){}return a(_,"F"),function(v){var b;return _.prototype=v,b=new _,_.prototype=null,b}})(),c={},l=c.lib={},u=l.Base=(function(){return{extend:a(function(_){var v=s(this);return _&&v.mixIn(_),(!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 _=this.extend();return _.init.apply(_,arguments),_},"create"),init:a(function(){},"init"),mixIn:a(function(_){for(var v in _)_.hasOwnProperty(v)&&(this[v]=_[v]);_.hasOwnProperty("toString")&&(this.toString=_.toString)},"mixIn"),clone:a(function(){return this.init.prototype.extend(this)},"clone")}})(),d=l.WordArray=u.extend({init:a(function(_,v){_=this.words=_||[],v!=r?this.sigBytes=v:this.sigBytes=_.length*4},"init"),toString:a(function(_){return(_||h).stringify(this)},"toString"),concat:a(function(_){var v=this.words,b=_.words,T=this.sigBytes,w=_.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 P=0;P>>2]=b[P>>>2];return this.sigBytes+=w,this},"concat"),clamp:a(function(){var _=this.words,v=this.sigBytes;_[v>>>2]&=4294967295<<32-v%4*8,_.length=e.ceil(v/4)},"clamp"),clone:a(function(){var _=u.clone.call(this);return _.words=this.words.slice(0),_},"clone"),random:a(function(_){for(var v=[],b=0;b<_;b+=4)v.push(o());return new d.init(v,_)},"random")}),f=c.enc={},h=f.Hex={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>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(_){for(var v=_.length,b=[],T=0;T>>3]|=parseInt(_.substr(T,2),16)<<24-T%8*4;return new d.init(b,v/2)},"parse")},m=f.Latin1={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push(String.fromCharCode(R))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>2]|=(_.charCodeAt(T)&255)<<24-T%4*8;return new d.init(b,v)},"parse")},g=f.Utf8={stringify:a(function(_){try{return decodeURIComponent(escape(m.stringify(_)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:a(function(_){return m.parse(unescape(encodeURIComponent(_)))},"parse")},A=l.BufferedBlockAlgorithm=u.extend({reset:a(function(){this._data=new d.init,this._nDataBytes=0},"reset"),_append:a(function(_){typeof _=="string"&&(_=g.parse(_)),this._data.concat(_),this._nDataBytes+=_.sigBytes},"_append"),_process:a(function(_){var v,b=this._data,T=b.words,w=b.sigBytes,R=this.blockSize,x=R*4,P=w/x;_?P=e.ceil(P):P=e.max((P|0)-this._minBufferSize,0);var D=P*R,N=e.min(D*4,w);if(D){for(var L=0;L{p();(function(t,e){typeof Z6e=="object"?rHr.exports=Z6e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Z6e,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 X6e=="object"?nHr.exports=X6e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(X6e,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 sHr=I((e9e,oHr)=>{p();(function(t,e){typeof e9e=="object"?oHr.exports=e9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(e9e,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 lU=I((t9e,aHr)=>{p();(function(t,e){typeof t9e=="object"?aHr.exports=t9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(t9e,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,E=g<<16|A<<8|y,_=0;_<4&&m+_*.75>>6*(3-_)&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 lHr=I((r9e,cHr)=>{p();(function(t,e){typeof r9e=="object"?cHr.exports=r9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(r9e,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,E=d[g+2>>>2]>>>24-(g+2)%4*8&255,_=A<<16|y<<8|E,v=0;v<4&&g+v*.75>>6*(3-v)&63));var b=h.charAt(64);if(b)for(;m.length%4;)m.push(b);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 uU=I((n9e,uHr)=>{p();(function(t,e){typeof n9e=="object"?uHr.exports=n9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(n9e,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 E=A+y,_=g[E];g[E]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}var v=this._hash.words,b=g[A+0],T=g[A+1],w=g[A+2],R=g[A+3],x=g[A+4],P=g[A+5],D=g[A+6],N=g[A+7],L=g[A+8],B=g[A+9],q=g[A+10],M=g[A+11],O=g[A+12],j=g[A+13],Q=g[A+14],U=g[A+15],Y=v[0],W=v[1],V=v[2],z=v[3];Y=d(Y,W,V,z,b,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,P,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,L,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,O,7,l[12]),z=d(z,Y,W,V,j,12,l[13]),V=d(V,z,Y,W,Q,17,l[14]),W=d(W,V,z,Y,U,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,b,20,l[19]),Y=f(Y,W,V,z,P,5,l[20]),z=f(z,Y,W,V,q,9,l[21]),V=f(V,z,Y,W,U,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,Q,9,l[25]),V=f(V,z,Y,W,R,14,l[26]),W=f(W,V,z,Y,L,20,l[27]),Y=f(Y,W,V,z,j,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,O,20,l[31]),Y=h(Y,W,V,z,P,4,l[32]),z=h(z,Y,W,V,L,11,l[33]),V=h(V,z,Y,W,M,16,l[34]),W=h(W,V,z,Y,Q,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,j,4,l[40]),z=h(z,Y,W,V,b,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,O,11,l[45]),V=h(V,z,Y,W,U,16,l[46]),W=h(W,V,z,Y,w,23,l[47]),Y=m(Y,W,V,z,b,6,l[48]),z=m(z,Y,W,V,N,10,l[49]),V=m(V,z,Y,W,Q,15,l[50]),W=m(W,V,z,Y,P,21,l[51]),Y=m(Y,W,V,z,O,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,L,6,l[56]),z=m(z,Y,W,V,U,10,l[57]),V=m(V,z,Y,W,D,15,l[58]),W=m(W,V,z,Y,j,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,E=g.sigBytes*8;A[E>>>5]|=128<<24-E%32;var _=e.floor(y/4294967296),v=y;A[(E+64>>>9<<4)+15]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,A[(E+64>>>9<<4)+14]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,g.sigBytes=(A.length+1)*4,this._process();for(var b=this._hash,T=b.words,w=0;w<4;w++){var R=T[w];T[w]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}return b},"_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,b){var T=g+(A&y|~A&E)+_+b;return(T<>>32-v)+A}a(d,"FF");function f(g,A,y,E,_,v,b){var T=g+(A&E|y&~E)+_+b;return(T<>>32-v)+A}a(f,"GG");function h(g,A,y,E,_,v,b){var T=g+(A^y^E)+_+b;return(T<>>32-v)+A}a(h,"HH");function m(g,A,y,E,_,v,b){var T=g+(y^(A|~E))+_+b;return(T<>>32-v)+A}a(m,"II"),r.MD5=s._createHelper(u),r.HmacMD5=s._createHmacHelper(u)})(Math),t.MD5})});var sPt=I((i9e,dHr)=>{p();(function(t,e){typeof i9e=="object"?dHr.exports=i9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(i9e,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],E=0;E<80;E++){if(E<16)c[E]=u[d+E]|0;else{var _=c[E-3]^c[E-8]^c[E-14]^c[E-16];c[E]=_<<1|_>>>31}var v=(h<<5|h>>>27)+y+c[E];E<20?v+=(m&g|~m&A)+1518500249:E<40?v+=(m^g^A)+1859775393:E<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 s9e=I((o9e,fHr)=>{p();(function(t,e){typeof o9e=="object"?fHr.exports=o9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(o9e,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=e.sqrt(y),_=2;_<=E;_++)if(!(y%_))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],E=g[2],_=g[3],v=g[4],b=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],P=(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]=P+d[R-7]+N+d[R-16]}var L=v&b^~v&T,B=A&y^A&E^y&E,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),O=w+M+L+u[R]+d[R],j=q+B;w=T,T=b,b=v,v=_+O|0,_=E,E=y,y=A,A=O+j|0}g[0]=g[0]+A|0,g[1]=g[1]+y|0,g[2]=g[2]+E|0,g[3]=g[3]+_|0,g[4]=g[4]+v|0,g[5]=g[5]+b|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 hHr=I((a9e,pHr)=>{p();(function(t,e,r){typeof a9e=="object"?pHr.exports=a9e=e(sa(),s9e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(a9e,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 aPt=I((c9e,mHr)=>{p();(function(t,e,r){typeof c9e=="object"?mHr.exports=c9e=e(sa(),wCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(c9e,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],E=A[1],_=A[2],v=A[3],b=A[4],T=A[5],w=A[6],R=A[7],x=y.high,P=y.low,D=E.high,N=E.low,L=_.high,B=_.low,q=v.high,M=v.low,O=b.high,j=b.low,Q=T.high,U=T.low,Y=w.high,W=w.low,V=R.high,z=R.low,ie=x,H=P,re=D,le=N,Le=L,ge=B,Ue=q,ke=M,X=O,ee=j,K=Q,he=U,Z=Y,ue=W,qe=V,ne=z,ce=0;ce<80;ce++){var Ne,we,Be=f[ce];if(ce<16)we=Be.high=m[g+ce*2]|0,Ne=Be.low=m[g+ce*2+1]|0;else{var rt=f[ce-15],st=rt.high,_t=rt.low,Dt=(st>>>1|_t<<31)^(st>>>8|_t<<24)^st>>>7,$t=(_t>>>1|st<<31)^(_t>>>8|st<<24)^(_t>>>7|st<<25),Gt=f[ce-2],Ie=Gt.high,F=Gt.low,be=(Ie>>>19|F<<13)^(Ie<<3|F>>>29)^Ie>>>6,Qe=(F>>>19|Ie<<13)^(F<<3|Ie>>>29)^(F>>>6|Ie<<26),pe=f[ce-7],Se=pe.high,Fe=pe.low,te=f[ce-16],Te=te.high,Ge=te.low;Ne=$t+Fe,we=Dt+Se+(Ne>>>0<$t>>>0?1:0),Ne=Ne+Qe,we=we+be+(Ne>>>0>>0?1:0),Ne=Ne+Ge,we=we+Te+(Ne>>>0>>0?1:0),Be.high=we,Be.low=Ne}var J=X&K^~X&Z,se=ee&he^~ee&ue,me=ie&re^ie&Le^re&Le,Ce=H&le^H&ge^le&ge,He=(ie>>>28|H<<4)^(ie<<30|H>>>2)^(ie<<25|H>>>7),$e=(H>>>28|ie<<4)^(H<<30|ie>>>2)^(H<<25|ie>>>7),et=(X>>>14|ee<<18)^(X>>>18|ee<<14)^(X<<23|ee>>>9),ct=(ee>>>14|X<<18)^(ee>>>18|X<<14)^(ee<<23|X>>>9),bt=d[ce],ht=bt.high,We=bt.low,ae=ne+ct,Re=qe+et+(ae>>>0>>0?1:0),ae=ae+se,Re=Re+J+(ae>>>0>>0?1:0),ae=ae+We,Re=Re+ht+(ae>>>0>>0?1:0),ae=ae+Ne,Re=Re+we+(ae>>>0>>0?1:0),Me=$e+Ce,ye=He+me+(Me>>>0<$e>>>0?1:0);qe=Z,ne=ue,Z=K,ue=he,K=X,he=ee,ee=ke+ae|0,X=Ue+Re+(ee>>>0>>0?1:0)|0,Ue=Le,ke=ge,Le=re,ge=le,re=ie,le=H,H=ae+Me|0,ie=Re+ye+(H>>>0>>0?1:0)|0}P=y.low=P+H,y.high=x+ie+(P>>>0>>0?1:0),N=E.low=N+le,E.high=D+re+(N>>>0>>0?1:0),B=_.low=B+ge,_.high=L+Le+(B>>>0>>0?1:0),M=v.low=M+ke,v.high=q+Ue+(M>>>0>>0?1:0),j=b.low=j+ee,b.high=O+X+(j>>>0>>0?1:0),U=T.low=U+he,T.high=Q+K+(U>>>0>>0?1:0),W=w.low=W+ue,w.high=Y+Z+(W>>>0>>0?1:0),z=R.low=z+ne,R.high=V+qe+(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 E=this._hash.toX32();return E},"_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 AHr=I((l9e,gHr)=>{p();(function(t,e,r){typeof l9e=="object"?gHr.exports=l9e=e(sa(),wCe(),aPt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(l9e,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 EHr=I((u9e,yHr)=>{p();(function(t,e,r){typeof u9e=="object"?yHr.exports=u9e=e(sa(),wCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(u9e,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,E=0;E<24;E++){d[A+5*y]=(E+1)*(E+2)/2%64;var _=y%5,v=(2*A+3*y)%5;A=_,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 b=1,T=0;T<24;T++){for(var w=0,R=0,x=0;x<7;x++){if(b&1){var P=(1<>>24)&16711935|(b<<24|b>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var w=E[v];w.high^=T,w.low^=b}for(var R=0;R<24;R++){for(var x=0;x<5;x++){for(var P=0,D=0,N=0;N<5;N++){var w=E[x+5*N];P^=w.high,D^=w.low}var L=m[x];L.high=P,L.low=D}for(var x=0;x<5;x++)for(var B=m[(x+4)%5],q=m[(x+1)%5],M=q.high,O=q.low,P=B.high^(M<<1|O>>>31),D=B.low^(O<<1|M>>>31),N=0;N<5;N++){var w=E[x+5*N];w.high^=P,w.low^=D}for(var j=1;j<25;j++){var P,D,w=E[j],Q=w.high,U=w.low,Y=d[j];Y<32?(P=Q<>>32-Y,D=U<>>32-Y):(P=U<>>64-Y,D=Q<>>64-Y);var W=m[f[j]];W.high=P,W.low=D}var V=m[0],z=E[0];V.high=z.high,V.low=z.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var j=x+5*N,w=E[j],ie=m[j],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=E[0],le=h[R];w.high^=le.high,w.low^=le.low}},"_doProcessBlock"),_doFinalize:a(function(){var A=this._data,y=A.words,E=this._nDataBytes*8,_=A.sigBytes*8,v=this.blockSize*32;y[_>>>5]|=1<<24-_%32,y[(e.ceil((_+1)/v)*v>>>5)-1]|=128,A.sigBytes=y.length*4,this._process();for(var b=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),E=0;E<25;E++)y[E]=y[E].clone();return A},"clone")});r.SHA3=s._createHelper(g),r.HmacSHA3=s._createHmacHelper(g)})(Math),t.SHA3})});var vHr=I((d9e,_Hr)=>{p();(function(t,e){typeof d9e=="object"?_Hr.exports=d9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(d9e,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,P=T[x];T[x]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360}var D=this._hash.words,N=h.words,L=m.words,B=l.words,q=u.words,M=d.words,O=f.words,j,Q,U,Y,W,V,z,ie,H,re;V=j=D[0],z=Q=D[1],ie=U=D[2],H=Y=D[3],re=W=D[4];for(var le,R=0;R<80;R+=1)le=j+T[w+B[R]]|0,R<16?le+=A(Q,U,Y)+N[0]:R<32?le+=y(Q,U,Y)+N[1]:R<48?le+=E(Q,U,Y)+N[2]:R<64?le+=_(Q,U,Y)+N[3]:le+=v(Q,U,Y)+N[4],le=le|0,le=b(le,M[R]),le=le+W|0,j=W,W=Y,Y=b(U,10),U=Q,Q=le,le=V+T[w+q[R]]|0,R<16?le+=v(z,ie,H)+L[0]:R<32?le+=_(z,ie,H)+L[1]:R<48?le+=E(z,ie,H)+L[2]:R<64?le+=y(z,ie,H)+L[3]:le+=A(z,ie,H)+L[4],le=le|0,le=b(le,O[R]),le=le+re|0,V=re,re=H,H=b(ie,10),ie=z,z=le;le=D[1]+U+H|0,D[1]=D[2]+Y+re|0,D[2]=D[3]+W+V|0,D[3]=D[4]+j+z|0,D[4]=D[0]+Q+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 P=this._hash,D=P.words,N=0;N<5;N++){var L=D[N];D[N]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return P},"_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 E(T,w,R){return(T|~w)^R}a(E,"f3");function _(T,w,R){return T&R|w&~R}a(_,"f4");function v(T,w,R){return T^(w|~R)}a(v,"f5");function b(T,w){return T<>>32-w}a(b,"rotl"),r.RIPEMD160=s._createHelper(g),r.HmacRIPEMD160=s._createHmacHelper(g)})(Math),t.RIPEMD160})});var p9e=I((f9e,CHr)=>{p();(function(t,e){typeof f9e=="object"?CHr.exports=f9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(f9e,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,E=0;E{p();(function(t,e,r){typeof h9e=="object"?bHr.exports=h9e=e(sa(),s9e(),p9e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(h9e,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,E=A.words,_=h.keySize,v=h.iterations;y.length<_;){var b=m.update(f).finalize(A);m.reset();for(var T=b.words,w=T.length,R=b,x=1;x{p();(function(t,e,r){typeof m9e=="object"?THr.exports=m9e=e(sa(),sPt(),p9e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(m9e,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,E=h.iterations;A.length{p();(function(t,e,r){typeof g9e=="object"?IHr.exports=g9e=e(sa(),oB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(g9e,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(L,B){return this.create(this._ENC_XFORM_MODE,L,B)},"createEncryptor"),createDecryptor:a(function(L,B){return this.create(this._DEC_XFORM_MODE,L,B)},"createDecryptor"),init:a(function(L,B,q){this.cfg=this.cfg.extend(q),this._xformMode=L,this._key=B,this.reset()},"init"),reset:a(function(){c.reset.call(this),this._doReset()},"reset"),process:a(function(L){return this._append(L),this._process()},"process"),finalize:a(function(L){L&&this._append(L);var B=this._doFinalize();return B},"finalize"),keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function L(B){return typeof B=="string"?N:x}return a(L,"selectCipherStrategy"),function(B){return{encrypt:a(function(q,M,O){return L(M).encrypt(B,q,M,O)},"encrypt"),decrypt:a(function(q,M,O){return L(M).decrypt(B,q,M,O)},"decrypt")}}})()}),g=n.StreamCipher=m.extend({_doFinalize:a(function(){var L=this._process(!0);return L},"_doFinalize"),blockSize:1}),A=r.mode={},y=n.BlockCipherMode=o.extend({createEncryptor:a(function(L,B){return this.Encryptor.create(L,B)},"createEncryptor"),createDecryptor:a(function(L,B){return this.Decryptor.create(L,B)},"createDecryptor"),init:a(function(L,B){this._cipher=L,this._iv=B},"init")}),E=A.CBC=(function(){var L=y.extend();L.Encryptor=L.extend({processBlock:a(function(q,M){var O=this._cipher,j=O.blockSize;B.call(this,q,M,j),O.encryptBlock(q,M),this._prevBlock=q.slice(M,M+j)},"processBlock")}),L.Decryptor=L.extend({processBlock:a(function(q,M){var O=this._cipher,j=O.blockSize,Q=q.slice(M,M+j);O.decryptBlock(q,M),B.call(this,q,M,j),this._prevBlock=Q},"processBlock")});function B(q,M,O){var j,Q=this._iv;Q?(j=Q,this._iv=e):j=this._prevBlock;for(var U=0;U>>2]&255;L.sigBytes-=B},"unpad")},b=n.BlockCipher=m.extend({cfg:m.cfg.extend({mode:E,padding:v}),reset:a(function(){var L;m.reset.call(this);var B=this.cfg,q=B.iv,M=B.mode;this._xformMode==this._ENC_XFORM_MODE?L=M.createEncryptor:(L=M.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==L?this._mode.init(this,q&&q.words):(this._mode=L.call(M,this,q&&q.words),this._mode.__creator=L)},"reset"),_doProcessBlock:a(function(L,B){this._mode.processBlock(L,B)},"_doProcessBlock"),_doFinalize:a(function(){var L,B=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(B.pad(this._data,this.blockSize),L=this._process(!0)):(L=this._process(!0),B.unpad(L)),L},"_doFinalize"),blockSize:128/32}),T=n.CipherParams=o.extend({init:a(function(L){this.mixIn(L)},"init"),toString:a(function(L){return(L||this.formatter).stringify(this)},"toString")}),w=r.format={},R=w.OpenSSL={stringify:a(function(L){var B,q=L.ciphertext,M=L.salt;return M?B=s.create([1398893684,1701076831]).concat(M).concat(q):B=q,B.toString(d)},"stringify"),parse:a(function(L){var B,q=d.parse(L),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(L,B,q,M){M=this.cfg.extend(M);var O=L.createEncryptor(q,M),j=O.finalize(B),Q=O.cfg;return T.create({ciphertext:j,key:q,iv:Q.iv,algorithm:L,mode:Q.mode,padding:Q.padding,blockSize:L.blockSize,formatter:M.format})},"encrypt"),decrypt:a(function(L,B,q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var O=L.createDecryptor(q,M).finalize(B.ciphertext);return O},"decrypt"),_parse:a(function(L,B){return typeof L=="string"?B.parse(L,this):L},"_parse")}),P=r.kdf={},D=P.OpenSSL={execute:a(function(L,B,q,M,O){if(M||(M=s.random(64/8)),O)var j=h.create({keySize:B+q,hasher:O}).compute(L,M);else var j=h.create({keySize:B+q}).compute(L,M);var Q=s.create(j.words.slice(B),q*4);return j.sigBytes=B*4,T.create({key:j,iv:Q,salt:M})},"execute")},N=n.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:D}),encrypt:a(function(L,B,q,M){M=this.cfg.extend(M);var O=M.kdf.execute(q,L.keySize,L.ivSize,M.salt,M.hasher);M.iv=O.iv;var j=x.encrypt.call(this,L,B,O.key,M);return j.mixIn(O),j},"encrypt"),decrypt:a(function(L,B,q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var O=M.kdf.execute(q,L.keySize,L.ivSize,B.salt,M.hasher);M.iv=O.iv;var j=x.decrypt.call(this,L,B,O.key,M);return j},"decrypt")})})()})});var wHr=I((A9e,xHr)=>{p();(function(t,e,r){typeof A9e=="object"?xHr.exports=A9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(A9e,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 y9e=="object"?RHr.exports=y9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(y9e,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 E9e=="object"?PHr.exports=E9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(E9e,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 _9e=="object"?NHr.exports=_9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(_9e,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 v9e=="object"?OHr.exports=v9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(v9e,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 FHr=I((C9e,BHr)=>{p();(function(t,e,r){typeof C9e=="object"?BHr.exports=C9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(C9e,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 QHr=I((b9e,UHr)=>{p();(function(t,e,r){typeof b9e=="object"?UHr.exports=b9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(b9e,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 jHr=I((S9e,qHr)=>{p();(function(t,e,r){typeof S9e=="object"?qHr.exports=S9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(S9e,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 GHr=I((T9e,HHr)=>{p();(function(t,e,r){typeof T9e=="object"?HHr.exports=T9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(T9e,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 VHr=I((I9e,$Hr)=>{p();(function(t,e,r){typeof I9e=="object"?$Hr.exports=I9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(I9e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var zHr=I((x9e,WHr)=>{p();(function(t,e,r){typeof x9e=="object"?WHr.exports=x9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(x9e,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 KHr=I((w9e,YHr)=>{p();(function(t,e,r){typeof w9e=="object"?YHr.exports=w9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(w9e,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 _=[],v=0;v<256;v++)v<128?_[v]=v<<1:_[v]=v<<1^283;for(var b=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[b]=w,c[w]=b;var R=_[b],x=_[R],P=_[x],D=_[w]*257^w*16843008;l[b]=D<<24|D>>>8,u[b]=D<<16|D>>>16,d[b]=D<<8|D>>>24,f[b]=D;var D=P*16843009^x*65537^R*257^b*16843008;h[w]=D<<24|D>>>8,m[w]=D<<16|D>>>16,g[w]=D<<8|D>>>24,A[w]=D,b?(b=R^_[_[_[P^R]]],T^=_[_[T]]):b=T=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],E=o.AES=n.extend({_doReset:a(function(){var _;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,b=v.words,T=v.sigBytes/4,w=this._nRounds=T+6,R=(w+1)*4,x=this._keySchedule=[],P=0;P6&&P%T==4&&(_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255]):(_=_<<8|_>>>24,_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255],_^=y[P/T|0]<<24),x[P]=x[P-T]^_);for(var D=this._invKeySchedule=[],N=0;N>>24]]^m[s[_>>>16&255]]^g[s[_>>>8&255]]^A[s[_&255]]}}},"_doReset"),encryptBlock:a(function(_,v){this._doCryptBlock(_,v,this._keySchedule,l,u,d,f,s)},"encryptBlock"),decryptBlock:a(function(_,v){var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b,this._doCryptBlock(_,v,this._invKeySchedule,h,m,g,A,c);var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b},"decryptBlock"),_doCryptBlock:a(function(_,v,b,T,w,R,x,P){for(var D=this._nRounds,N=_[v]^b[0],L=_[v+1]^b[1],B=_[v+2]^b[2],q=_[v+3]^b[3],M=4,O=1;O>>24]^w[L>>>16&255]^R[B>>>8&255]^x[q&255]^b[M++],Q=T[L>>>24]^w[B>>>16&255]^R[q>>>8&255]^x[N&255]^b[M++],U=T[B>>>24]^w[q>>>16&255]^R[N>>>8&255]^x[L&255]^b[M++],Y=T[q>>>24]^w[N>>>16&255]^R[L>>>8&255]^x[B&255]^b[M++];N=j,L=Q,B=U,q=Y}var j=(P[N>>>24]<<24|P[L>>>16&255]<<16|P[B>>>8&255]<<8|P[q&255])^b[M++],Q=(P[L>>>24]<<24|P[B>>>16&255]<<16|P[q>>>8&255]<<8|P[N&255])^b[M++],U=(P[B>>>24]<<24|P[q>>>16&255]<<16|P[N>>>8&255]<<8|P[L&255])^b[M++],Y=(P[q>>>24]<<24|P[N>>>16&255]<<16|P[L>>>8&255]<<8|P[B&255])^b[M++];_[v]=j,_[v+1]=Q,_[v+2]=U,_[v+3]=Y},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(E)})(),t.AES})});var ZHr=I((R9e,JHr)=>{p();(function(t,e,r){typeof R9e=="object"?JHr.exports=R9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(R9e,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,E=y.words,_=[],v=0;v<56;v++){var b=c[v]-1;_[v]=E[b>>>5]>>>31-b%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]|=_[(l[v]-1+x)%28]<<31-v%6,R[4+(v/6|0)]|=_[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 P=this._invSubKeys=[],v=0;v<16;v++)P[v]=T[15-v]},"_doReset"),encryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._subKeys)},"encryptBlock"),decryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._invSubKeys)},"decryptBlock"),_doCryptBlock:a(function(y,E,_){this._lBlock=y[E],this._rBlock=y[E+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 b=_[v],T=this._lBlock,w=this._rBlock,R=0,x=0;x<8;x++)R|=d[x][((w^b[x])&f[x])>>>0];this._lBlock=w,this._rBlock=T^R}var P=this._lBlock;this._lBlock=this._rBlock,this._rBlock=P,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[E]=this._lBlock,y[E+1]=this._rBlock},"_doCryptBlock"),keySize:64/32,ivSize:64/32,blockSize:64/32});function m(y,E){var _=(this._lBlock>>>y^this._rBlock)&E;this._rBlock^=_,this._lBlock^=_<>>y^this._lBlock)&E;this._lBlock^=_,this._rBlock^=_<192.");var _=E.slice(0,2),v=E.length<4?E.slice(0,2):E.slice(2,4),b=E.length<6?E.slice(0,2):E.slice(4,6);this._des1=h.createEncryptor(n.create(_)),this._des2=h.createEncryptor(n.create(v)),this._des3=h.createEncryptor(n.create(b))},"_doReset"),encryptBlock:a(function(y,E){this._des1.encryptBlock(y,E),this._des2.decryptBlock(y,E),this._des3.encryptBlock(y,E)},"encryptBlock"),decryptBlock:a(function(y,E){this._des3.decryptBlock(y,E),this._des2.encryptBlock(y,E),this._des1.decryptBlock(y,E)},"decryptBlock"),keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=o._createHelper(A)})(),t.TripleDES})});var eGr=I((k9e,XHr)=>{p();(function(t,e,r){typeof k9e=="object"?XHr.exports=k9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(k9e,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 E=h[m];h[m]=h[g],h[g]=E}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 rGr=I((P9e,tGr)=>{p();(function(t,e,r){typeof P9e=="object"?tGr.exports=P9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(P9e,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,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;A[0]^=v,A[1]^=T,A[2]^=b,A[3]^=w,A[4]^=v,A[5]^=T,A[6]^=b,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,E=((A*A>>>17)+A*y>>>15)+y*y,_=((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 iGr=I((D9e,nGr)=>{p();(function(t,e,r){typeof D9e=="object"?nGr.exports=D9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(D9e,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,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;g[0]^=v,g[1]^=T,g[2]^=b,g[3]^=w,g[4]^=v,g[5]^=T,g[6]^=b,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,E=((A*A>>>17)+A*y>>>15)+y*y,_=((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 sGr=I((N9e,oGr)=>{p();(function(t,e,r){typeof N9e=="object"?oGr.exports=N9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(N9e,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 E=y>>24&255,_=y>>16&255,v=y>>8&255,b=y&255,T=A.sbox[0][E]+A.sbox[1][_];return T=T^A.sbox[2][v],T=T+A.sbox[3][b],T}a(d,"F");function f(A,y,E){let _=y,v=E,b;for(let T=0;T1;--T)_=_^A.pbox[T],v=d(A,_)^v,b=_,_=v,v=b;return b=_,_=v,v=b,v=v^A.pbox[1],_=_^A.pbox[0],{left:_,right:v}}a(h,"BlowFish_Decrypt");function m(A,y,E){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 _=0;for(let w=0;w=E&&(_=0);let v=0,b=0,T=0;for(let w=0;w{p();(function(t,e,r){typeof M9e=="object"?aGr.exports=M9e=e(sa(),wCe(),iHr(),sHr(),lU(),lHr(),uU(),sPt(),s9e(),hHr(),aPt(),AHr(),EHr(),vHr(),p9e(),SHr(),oB(),jm(),wHr(),kHr(),DHr(),MHr(),LHr(),FHr(),QHr(),jHr(),GHr(),VHr(),zHr(),KHr(),ZHr(),eGr(),rGr(),iGr(),sGr()):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)})(M9e,function(t){return t})});var Xoe=I(qy=>{"use strict";p();Object.defineProperty(qy,"__esModule",{value:!0});qy.stringArray=qy.array=qy.func=qy.error=qy.number=qy.string=qy.boolean=void 0;function hAo(t){return t===!0||t===!1}a(hAo,"boolean");qy.boolean=hAo;function jVr(t){return typeof t=="string"||t instanceof String}a(jVr,"string");qy.string=jVr;function mAo(t){return typeof t=="number"||t instanceof Number}a(mAo,"number");qy.number=mAo;function gAo(t){return t instanceof Error}a(gAo,"error");qy.error=gAo;function AAo(t){return typeof t=="function"}a(AAo,"func");qy.func=AAo;function HVr(t){return Array.isArray(t)}a(HVr,"array");qy.array=HVr;function yAo(t){return HVr(t)&&t.every(e=>jVr(e))}a(yAo,"stringArray");qy.stringArray=yAo});var D2t=I(pi=>{"use strict";p();Object.defineProperty(pi,"__esModule",{value:!0});pi.Message=pi.NotificationType9=pi.NotificationType8=pi.NotificationType7=pi.NotificationType6=pi.NotificationType5=pi.NotificationType4=pi.NotificationType3=pi.NotificationType2=pi.NotificationType1=pi.NotificationType0=pi.NotificationType=pi.RequestType9=pi.RequestType8=pi.RequestType7=pi.RequestType6=pi.RequestType5=pi.RequestType4=pi.RequestType3=pi.RequestType2=pi.RequestType1=pi.RequestType=pi.RequestType0=pi.AbstractMessageSignature=pi.ParameterStructures=pi.ResponseError=pi.ErrorCodes=void 0;var BW=Xoe(),c2t;(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})(c2t||(pi.ErrorCodes=c2t={}));var l2t=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=BW.number(e)?e:c2t.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}};pi.ResponseError=l2t;var lC=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}};pi.ParameterStructures=lC;lC.auto=new lC("auto");lC.byPosition=new lC("byPosition");lC.byName=new lC("byName");var ju=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return lC.auto}};pi.AbstractMessageSignature=ju;var u2t=class extends ju{static{a(this,"RequestType0")}constructor(e){super(e,0)}};pi.RequestType0=u2t;var d2t=class extends ju{static{a(this,"RequestType")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType=d2t;var f2t=class extends ju{static{a(this,"RequestType1")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType1=f2t;var p2t=class extends ju{static{a(this,"RequestType2")}constructor(e){super(e,2)}};pi.RequestType2=p2t;var h2t=class extends ju{static{a(this,"RequestType3")}constructor(e){super(e,3)}};pi.RequestType3=h2t;var m2t=class extends ju{static{a(this,"RequestType4")}constructor(e){super(e,4)}};pi.RequestType4=m2t;var g2t=class extends ju{static{a(this,"RequestType5")}constructor(e){super(e,5)}};pi.RequestType5=g2t;var A2t=class extends ju{static{a(this,"RequestType6")}constructor(e){super(e,6)}};pi.RequestType6=A2t;var y2t=class extends ju{static{a(this,"RequestType7")}constructor(e){super(e,7)}};pi.RequestType7=y2t;var E2t=class extends ju{static{a(this,"RequestType8")}constructor(e){super(e,8)}};pi.RequestType8=E2t;var _2t=class extends ju{static{a(this,"RequestType9")}constructor(e){super(e,9)}};pi.RequestType9=_2t;var v2t=class extends ju{static{a(this,"NotificationType")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType=v2t;var C2t=class extends ju{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};pi.NotificationType0=C2t;var b2t=class extends ju{static{a(this,"NotificationType1")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType1=b2t;var S2t=class extends ju{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};pi.NotificationType2=S2t;var T2t=class extends ju{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};pi.NotificationType3=T2t;var I2t=class extends ju{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};pi.NotificationType4=I2t;var x2t=class extends ju{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};pi.NotificationType5=x2t;var w2t=class extends ju{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};pi.NotificationType6=w2t;var R2t=class extends ju{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};pi.NotificationType7=R2t;var k2t=class extends ju{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};pi.NotificationType8=k2t;var P2t=class extends ju{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};pi.NotificationType9=P2t;var GVr;(function(t){function e(o){let s=o;return s&&BW.string(s.method)&&(BW.string(s.id)||BW.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&BW.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)&&(BW.string(s.id)||BW.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(GVr||(pi.Message=GVr={}))});var M2t=I(TU=>{"use strict";p();var $Vr;Object.defineProperty(TU,"__esModule",{value:!0});TU.LRUCache=TU.LinkedMap=TU.Touch=void 0;var jy;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(jy||(TU.Touch=jy={}));var gUe=class{static{a(this,"LinkedMap")}constructor(){this[$Vr]="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=jy.None){let n=this._map.get(e);if(n)return r!==jy.None&&this.touch(n,r),n.value}set(e,r,n=jy.None){let o=this._map.get(e);if(o)o.value=r,n!==jy.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case jy.None:this.addItemLast(o);break;case jy.First:this.addItemFirst(o);break;case jy.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}[($Vr=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!==jy.First&&r!==jy.Last)){if(r===jy.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===jy.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)}};TU.LinkedMap=gUe;var N2t=class extends gUe{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=jy.AsNew){return super.get(e,r)}peek(e){return super.get(e,jy.None)}set(e,r){return super.set(e,r,jy.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};TU.LRUCache=N2t});var WVr=I(AUe=>{"use strict";p();Object.defineProperty(AUe,"__esModule",{value:!0});AUe.Disposable=void 0;var VVr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(VVr||(AUe.Disposable=VVr={}))});var IU=I(B2t=>{"use strict";p();Object.defineProperty(B2t,"__esModule",{value:!0});var O2t;function L2t(){if(O2t===void 0)throw new Error("No runtime abstraction layer installed");return O2t}a(L2t,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");O2t=r}a(e,"install"),t.install=e})(L2t||(L2t={}));B2t.default=L2t});var tse=I(ese=>{"use strict";p();Object.defineProperty(ese,"__esModule",{value:!0});ese.Emitter=ese.Event=void 0;var EAo=IU(),zVr;(function(t){let e={dispose(){}};t.None=function(){return e}})(zVr||(ese.Event=zVr={}));var F2t=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 F2t),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)}};ese.Emitter=yUe;yUe._noop=function(){}});var vUe=I(rse=>{"use strict";p();Object.defineProperty(rse,"__esModule",{value:!0});rse.CancellationTokenSource=rse.CancellationToken=void 0;var _Ao=IU(),vAo=Xoe(),U2t=tse(),EUe;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:U2t.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:U2t.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||vAo.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(EUe||(rse.CancellationToken=EUe={}));var CAo=Object.freeze(function(t,e){let r=(0,_Ao.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),_Ue=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?CAo:(this._emitter||(this._emitter=new U2t.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Q2t=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new _Ue),this._token}cancel(){this._token?this._token.cancel():this._token=EUe.Cancelled}dispose(){this._token?this._token instanceof _Ue&&this._token.dispose():this._token=EUe.None}};rse.CancellationTokenSource=Q2t});var YVr=I(nse=>{"use strict";p();Object.defineProperty(nse,"__esModule",{value:!0});nse.SharedArrayReceiverStrategy=nse.SharedArraySenderStrategy=void 0;var bAo=vUe(),zCe;(function(t){t.Continue=0,t.Cancelled=1})(zCe||(zCe={}));var q2t=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]=zCe.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,zCe.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};nse.SharedArraySenderStrategy=q2t;var j2t=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===zCe.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},H2t=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new j2t(e)}cancel(){}dispose(){}},G2t=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new bAo.CancellationTokenSource:new H2t(r)}};nse.SharedArrayReceiverStrategy=G2t});var V2t=I(CUe=>{"use strict";p();Object.defineProperty(CUe,"__esModule",{value:!0});CUe.Semaphore=void 0;var SAo=IU(),$2t=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,SAo.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()}}};CUe.Semaphore=$2t});var JVr=I(xU=>{"use strict";p();Object.defineProperty(xU,"__esModule",{value:!0});xU.ReadableStreamMessageReader=xU.AbstractMessageReader=xU.MessageReader=void 0;var z2t=IU(),ise=Xoe(),W2t=tse(),TAo=V2t(),KVr;(function(t){function e(r){let n=r;return n&&ise.func(n.listen)&&ise.func(n.dispose)&&ise.func(n.onError)&&ise.func(n.onClose)&&ise.func(n.onPartialMessage)}a(e,"is"),t.is=e})(KVr||(xU.MessageReader=KVr={}));var bUe=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new W2t.Emitter,this.closeEmitter=new W2t.Emitter,this.partialMessageEmitter=new W2t.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: ${ise.string(e.message)?e.message:"unknown"}`)}};xU.AbstractMessageReader=bUe;var Y2t;(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,z2t.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(Y2t||(Y2t={}));var K2t=class extends bUe{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=Y2t.fromOptions(r),this.buffer=(0,z2t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new TAo.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,z2t.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))}};xU.ReadableStreamMessageReader=K2t});var rWr=I(wU=>{"use strict";p();Object.defineProperty(wU,"__esModule",{value:!0});wU.WriteableStreamMessageWriter=wU.AbstractMessageWriter=wU.MessageWriter=void 0;var ZVr=IU(),YCe=Xoe(),IAo=V2t(),XVr=tse(),xAo="Content-Length: ",eWr=`\r -`,tWr;(function(t){function e(r){let n=r;return n&&YCe.func(n.dispose)&&YCe.func(n.onClose)&&YCe.func(n.onError)&&YCe.func(n.write)}a(e,"is"),t.is=e})(tWr||(wU.MessageWriter=tWr={}));var SUe=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new XVr.Emitter,this.closeEmitter=new XVr.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: ${YCe.string(e.message)?e.message:"unknown"}`)}};wU.AbstractMessageWriter=SUe;var J2t;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,ZVr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,ZVr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(J2t||(J2t={}));var Z2t=class extends SUe{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=J2t.fromOptions(r),this.errorCount=0,this.writeSemaphore=new IAo.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(xAo,n.byteLength.toString(),eWr),o.push(eWr),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()}};wU.WriteableStreamMessageWriter=Z2t});var nWr=I(TUe=>{"use strict";p();Object.defineProperty(TUe,"__esModule",{value:!0});TUe.AbstractMessageBuffer=void 0;var wAo=13,RAo=10,kAo=`\r -`,X2t=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}};TUe.AbstractMessageBuffer=X2t});var cWr=I(Oo=>{"use strict";p();Object.defineProperty(Oo,"__esModule",{value:!0});Oo.createMessageConnection=Oo.ConnectionOptions=Oo.MessageStrategy=Oo.CancellationStrategy=Oo.CancellationSenderStrategy=Oo.CancellationReceiverStrategy=Oo.RequestCancellationReceiverStrategy=Oo.IdCancellationReceiverStrategy=Oo.ConnectionStrategy=Oo.ConnectionError=Oo.ConnectionErrors=Oo.LogTraceNotification=Oo.SetTraceNotification=Oo.TraceFormat=Oo.TraceValues=Oo.Trace=Oo.NullLogger=Oo.ProgressType=Oo.ProgressToken=void 0;var iWr=IU(),lf=Xoe(),Vi=D2t(),oWr=M2t(),KCe=tse(),eDt=vUe(),XCe;(function(t){t.type=new Vi.NotificationType("$/cancelRequest")})(XCe||(XCe={}));var tDt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(tDt||(Oo.ProgressToken=tDt={}));var JCe;(function(t){t.type=new Vi.NotificationType("$/progress")})(JCe||(JCe={}));var rDt=class{static{a(this,"ProgressType")}constructor(){}};Oo.ProgressType=rDt;var nDt;(function(t){function e(r){return lf.func(r)}a(e,"is"),t.is=e})(nDt||(nDt={}));Oo.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var bc;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(bc||(Oo.Trace=bc={}));var sWr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(sWr||(Oo.TraceValues=sWr={}));(function(t){function e(n){if(!lf.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})(bc||(Oo.Trace=bc={}));var G1;(function(t){t.Text="text",t.JSON="json"})(G1||(Oo.TraceFormat=G1={}));(function(t){function e(r){return lf.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(G1||(Oo.TraceFormat=G1={}));var iDt;(function(t){t.type=new Vi.NotificationType("$/setTrace")})(iDt||(Oo.SetTraceNotification=iDt={}));var IUe;(function(t){t.type=new Vi.NotificationType("$/logTrace")})(IUe||(Oo.LogTraceNotification=IUe={}));var ZCe;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(ZCe||(Oo.ConnectionErrors=ZCe={}));var ose=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Oo.ConnectionError=ose;var oDt;(function(t){function e(r){let n=r;return n&&lf.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(oDt||(Oo.ConnectionStrategy=oDt={}));var xUe;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&lf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lf.func(n.dispose))}a(e,"is"),t.is=e})(xUe||(Oo.IdCancellationReceiverStrategy=xUe={}));var sDt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&lf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lf.func(n.dispose))}a(e,"is"),t.is=e})(sDt||(Oo.RequestCancellationReceiverStrategy=sDt={}));var wUe;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new eDt.CancellationTokenSource}});function e(r){return xUe.is(r)||sDt.is(r)}a(e,"is"),t.is=e})(wUe||(Oo.CancellationReceiverStrategy=wUe={}));var RUe;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(XCe.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&lf.func(n.sendCancellation)&&lf.func(n.cleanup)}a(e,"is"),t.is=e})(RUe||(Oo.CancellationSenderStrategy=RUe={}));var kUe;(function(t){t.Message=Object.freeze({receiver:wUe.Message,sender:RUe.Message});function e(r){let n=r;return n&&wUe.is(n.receiver)&&RUe.is(n.sender)}a(e,"is"),t.is=e})(kUe||(Oo.CancellationStrategy=kUe={}));var PUe;(function(t){function e(r){let n=r;return n&&lf.func(n.handleMessage)}a(e,"is"),t.is=e})(PUe||(Oo.MessageStrategy=PUe={}));var aWr;(function(t){function e(r){let n=r;return n&&(kUe.is(n.cancellationStrategy)||oDt.is(n.connectionStrategy)||PUe.is(n.messageStrategy))}a(e,"is"),t.is=e})(aWr||(Oo.ConnectionOptions=aWr={}));var $k;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})($k||($k={}));function PAo(t,e,r,n){let o=r!==void 0?r:Oo.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new oWr.LinkedMap,E=new Map,_=new Set,v=new Map,b=bc.Off,T=G1.Text,w,R=$k.New,x=new KCe.Emitter,P=new KCe.Emitter,D=new KCe.Emitter,N=new KCe.Emitter,L=new KCe.Emitter,B=n&&n.cancellationStrategy?n.cancellationStrategy:kUe.Message;function q(Ie){if(Ie===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ie.toString()}a(q,"createRequestQueueKey");function M(Ie){return Ie===null?"res-unknown-"+(++l).toString():"res-"+Ie.toString()}a(M,"createResponseQueueKey");function O(){return"not-"+(++c).toString()}a(O,"createNotificationQueueKey");function j(Ie,F){Vi.Message.isRequest(F)?Ie.set(q(F.id),F):Vi.Message.isResponse(F)?Ie.set(M(F.id),F):Ie.set(O(),F)}a(j,"addMessageToQueue");function Q(Ie){}a(Q,"cancelUndispatched");function U(){return R===$k.Listening}a(U,"isListening");function Y(){return R===$k.Closed}a(Y,"isClosed");function W(){return R===$k.Disposed}a(W,"isDisposed");function V(){(R===$k.New||R===$k.Listening)&&(R=$k.Closed,P.fire(void 0))}a(V,"closeHandler");function z(Ie){x.fire([Ie,void 0,void 0])}a(z,"readErrorHandler");function ie(Ie){x.fire(Ie)}a(ie,"writeErrorHandler"),t.onClose(V),t.onError(z),e.onClose(V),e.onError(ie);function H(){A||y.size===0||(A=(0,iWr.default)().timer.setImmediate(()=>{A=void 0,le()}))}a(H,"triggerMessageQueue");function re(Ie){Vi.Message.isRequest(Ie)?ge(Ie):Vi.Message.isNotification(Ie)?ke(Ie):Vi.Message.isResponse(Ie)?Ue(Ie):X(Ie)}a(re,"handleMessage");function le(){if(y.size===0)return;let Ie=y.shift();try{let F=n?.messageStrategy;PUe.is(F)?F.handleMessage(Ie,re):re(Ie)}finally{H()}}a(le,"processMessageQueue");let Le=a(Ie=>{try{if(Vi.Message.isNotification(Ie)&&Ie.method===XCe.type.method){let F=Ie.params.id,be=q(F),Qe=y.get(be);if(Vi.Message.isRequest(Qe)){let Se=n?.connectionStrategy,Fe=Se&&Se.cancelUndispatched?Se.cancelUndispatched(Qe,Q):void 0;if(Fe&&(Fe.error!==void 0||Fe.result!==void 0)){y.delete(be),v.delete(F),Fe.id=Qe.id,Z(Fe,Ie.method,Date.now()),e.write(Fe).catch(()=>o.error("Sending response for canceled message failed."));return}}let pe=v.get(F);if(pe!==void 0){pe.cancel(),qe(Ie);return}else _.add(F)}j(y,Ie)}finally{H()}},"callback");function ge(Ie){if(W())return;function F(Te,Ge,J){let se={jsonrpc:u,id:Ie.id};Te instanceof Vi.ResponseError?se.error=Te.toJson():se.result=Te===void 0?null:Te,Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(F,"reply");function be(Te,Ge,J){let se={jsonrpc:u,id:Ie.id,error:Te.toJson()};Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(be,"replyError");function Qe(Te,Ge,J){Te===void 0&&(Te=null);let se={jsonrpc:u,id:Ie.id,result:Te};Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(Qe,"replySuccess"),ue(Ie);let pe=f.get(Ie.method),Se,Fe;pe&&(Se=pe.type,Fe=pe.handler);let te=Date.now();if(Fe||d){let Te=Ie.id??String(Date.now()),Ge=xUe.is(B.receiver)?B.receiver.createCancellationTokenSource(Te):B.receiver.createCancellationTokenSource(Ie);Ie.id!==null&&_.has(Ie.id)&&Ge.cancel(),Ie.id!==null&&v.set(Te,Ge);try{let J;if(Fe)if(Ie.params===void 0){if(Se!==void 0&&Se.numberOfParams!==0){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines ${Se.numberOfParams} params but received none.`),Ie.method,te);return}J=Fe(Ge.token)}else if(Array.isArray(Ie.params)){if(Se!==void 0&&Se.parameterStructures===Vi.ParameterStructures.byName){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by name but received parameters by position`),Ie.method,te);return}J=Fe(...Ie.params,Ge.token)}else{if(Se!==void 0&&Se.parameterStructures===Vi.ParameterStructures.byPosition){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by position but received parameters by name`),Ie.method,te);return}J=Fe(Ie.params,Ge.token)}else d&&(J=d(Ie.method,Ie.params,Ge.token));let se=J;J?se.then?se.then(me=>{v.delete(Te),F(me,Ie.method,te)},me=>{v.delete(Te),me instanceof Vi.ResponseError?be(me,Ie.method,te):me&&lf.string(me.message)?be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${me.message}`),Ie.method,te):be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}):(v.delete(Te),F(J,Ie.method,te)):(v.delete(Te),Qe(J,Ie.method,te))}catch(J){v.delete(Te),J instanceof Vi.ResponseError?F(J,Ie.method,te):J&&lf.string(J.message)?be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${J.message}`),Ie.method,te):be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}}else be(new Vi.ResponseError(Vi.ErrorCodes.MethodNotFound,`Unhandled method ${Ie.method}`),Ie.method,te)}a(ge,"handleRequest");function Ue(Ie){if(!W())if(Ie.id===null)Ie.error?o.error(`Received response message without id: Error is: -${JSON.stringify(Ie.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let F=Ie.id,be=E.get(F);if(ne(Ie,be),be!==void 0){E.delete(F);try{if(Ie.error){let Qe=Ie.error;be.reject(new Vi.ResponseError(Qe.code,Qe.message,Qe.data))}else if(Ie.result!==void 0)be.resolve(Ie.result);else throw new Error("Should never happen.")}catch(Qe){Qe.message?o.error(`Response handler '${be.method}' failed with message: ${Qe.message}`):o.error(`Response handler '${be.method}' failed unexpectedly.`)}}}}a(Ue,"handleResponse");function ke(Ie){if(W())return;let F,be;if(Ie.method===XCe.type.method){let Qe=Ie.params.id;_.delete(Qe),qe(Ie);return}else{let Qe=m.get(Ie.method);Qe&&(be=Qe.handler,F=Qe.type)}if(be||h)try{if(qe(Ie),be)if(Ie.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==Vi.ParameterStructures.byName&&o.error(`Notification ${Ie.method} defines ${F.numberOfParams} params but received none.`),be();else if(Array.isArray(Ie.params)){let Qe=Ie.params;Ie.method===JCe.type.method&&Qe.length===2&&tDt.is(Qe[0])?be({token:Qe[0],value:Qe[1]}):(F!==void 0&&(F.parameterStructures===Vi.ParameterStructures.byName&&o.error(`Notification ${Ie.method} defines parameters by name but received parameters by position`),F.numberOfParams!==Ie.params.length&&o.error(`Notification ${Ie.method} defines ${F.numberOfParams} params but received ${Qe.length} arguments`)),be(...Qe))}else F!==void 0&&F.parameterStructures===Vi.ParameterStructures.byPosition&&o.error(`Notification ${Ie.method} defines parameters by position but received parameters by name`),be(Ie.params);else h&&h(Ie.method,Ie.params)}catch(Qe){Qe.message?o.error(`Notification handler '${Ie.method}' failed with message: ${Qe.message}`):o.error(`Notification handler '${Ie.method}' failed unexpectedly.`)}else D.fire(Ie)}a(ke,"handleNotification");function X(Ie){if(!Ie){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message: +`)),l.tries=r,l}a(Quo,"bindings");zjr.exports=Quo;function quo(t){for(var e=Uuo(t),r;;){if(e==="."&&(e=process.cwd()),Vjr(wCe(e,"dist")))return wCe(e,"dist");if(Vjr(wCe(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=wCe(e,"..")}}a(quo,"getRoot")});var Zjr=I(QI=>{"use strict";p();var juo=QI&&QI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Huo=QI&&QI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Yjr=QI&&QI.__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)&&juo(e,t,r);return Huo(e,t),e};Object.defineProperty(QI,"__esModule",{value:!0});QI.setDeviceId=QI.getDeviceId=void 0;var K6e=Yjr(require("path")),J6e=Yjr($jr()),Kjr=process.platform==="win32"?Y6e()("windows"):null,Guo="deviceid";function Jjr(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=K6e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??K6e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return K6e.join(t,"Microsoft","DeveloperTools")}a(Jjr,"getDirectory");function iPt(){return K6e.join(Jjr(),Guo)}a(iPt,"getDeviceIdFilePath");async function $uo(){return process.platform==="win32"?Kjr?.GetDeviceId():await Vuo(iPt())?J6e.readFile(iPt(),"utf8"):void 0}a($uo,"getDeviceId");QI.getDeviceId=$uo;async function Vuo(t){try{return await J6e.promises.access(t),!0}catch{return!1}}a(Vuo,"exists");async function Wuo(t){process.platform==="win32"?Kjr?.SetDeviceId(t):(await J6e.ensureDir(Jjr()),await J6e.writeFile(iPt(),t,"utf8"))}a(Wuo,"setDeviceId");QI.setDeviceId=Wuo});var eHr=I(XN=>{"use strict";p();var zuo=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]})),Yuo=XN&&XN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Kuo=XN&&XN.__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)&&zuo(e,t,r);return Yuo(e,t),e};Object.defineProperty(XN,"__esModule",{value:!0});XN.getDeviceId=void 0;var Juo=(Oo(),Ca(Cc)),Xjr=Kuo(Zjr());async function Zuo(){let t;try{t=await Xjr.getDeviceId()}catch{}if(t)return t;{let e=(0,Juo.v4)().toLowerCase();return await Xjr.setDeviceId(e),e}}a(Zuo,"getDeviceId");XN.getDeviceId=Zuo});var tHr=I(xW=>{"use strict";p();var Xuo=xW&&xW.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),edo=xW&&xW.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Xuo(e,t,r)};Object.defineProperty(xW,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");edo(eHr(),xW)});var sa=I((X6e,rHr)=>{p();(function(t,e){typeof X6e=="object"?rHr.exports=X6e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(X6e,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 _(){}return a(_,"F"),function(v){var b;return _.prototype=v,b=new _,_.prototype=null,b}})(),c={},l=c.lib={},u=l.Base=(function(){return{extend:a(function(_){var v=s(this);return _&&v.mixIn(_),(!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 _=this.extend();return _.init.apply(_,arguments),_},"create"),init:a(function(){},"init"),mixIn:a(function(_){for(var v in _)_.hasOwnProperty(v)&&(this[v]=_[v]);_.hasOwnProperty("toString")&&(this.toString=_.toString)},"mixIn"),clone:a(function(){return this.init.prototype.extend(this)},"clone")}})(),d=l.WordArray=u.extend({init:a(function(_,v){_=this.words=_||[],v!=r?this.sigBytes=v:this.sigBytes=_.length*4},"init"),toString:a(function(_){return(_||h).stringify(this)},"toString"),concat:a(function(_){var v=this.words,b=_.words,T=this.sigBytes,w=_.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 P=0;P>>2]=b[P>>>2];return this.sigBytes+=w,this},"concat"),clamp:a(function(){var _=this.words,v=this.sigBytes;_[v>>>2]&=4294967295<<32-v%4*8,_.length=e.ceil(v/4)},"clamp"),clone:a(function(){var _=u.clone.call(this);return _.words=this.words.slice(0),_},"clone"),random:a(function(_){for(var v=[],b=0;b<_;b+=4)v.push(o());return new d.init(v,_)},"random")}),f=c.enc={},h=f.Hex={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>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(_){for(var v=_.length,b=[],T=0;T>>3]|=parseInt(_.substr(T,2),16)<<24-T%8*4;return new d.init(b,v/2)},"parse")},m=f.Latin1={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push(String.fromCharCode(R))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>2]|=(_.charCodeAt(T)&255)<<24-T%4*8;return new d.init(b,v)},"parse")},g=f.Utf8={stringify:a(function(_){try{return decodeURIComponent(escape(m.stringify(_)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:a(function(_){return m.parse(unescape(encodeURIComponent(_)))},"parse")},A=l.BufferedBlockAlgorithm=u.extend({reset:a(function(){this._data=new d.init,this._nDataBytes=0},"reset"),_append:a(function(_){typeof _=="string"&&(_=g.parse(_)),this._data.concat(_),this._nDataBytes+=_.sigBytes},"_append"),_process:a(function(_){var v,b=this._data,T=b.words,w=b.sigBytes,R=this.blockSize,x=R*4,P=w/x;_?P=e.ceil(P):P=e.max((P|0)-this._minBufferSize,0);var D=P*R,N=e.min(D*4,w);if(D){for(var L=0;L{p();(function(t,e){typeof e9e=="object"?nHr.exports=e9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(e9e,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 t9e=="object"?iHr.exports=t9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(t9e,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 aHr=I((r9e,sHr)=>{p();(function(t,e){typeof r9e=="object"?sHr.exports=r9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(r9e,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 uU=I((n9e,cHr)=>{p();(function(t,e){typeof n9e=="object"?cHr.exports=n9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(n9e,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,E=g<<16|A<<8|y,_=0;_<4&&m+_*.75>>6*(3-_)&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 uHr=I((i9e,lHr)=>{p();(function(t,e){typeof i9e=="object"?lHr.exports=i9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(i9e,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,E=d[g+2>>>2]>>>24-(g+2)%4*8&255,_=A<<16|y<<8|E,v=0;v<4&&g+v*.75>>6*(3-v)&63));var b=h.charAt(64);if(b)for(;m.length%4;)m.push(b);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 dU=I((o9e,dHr)=>{p();(function(t,e){typeof o9e=="object"?dHr.exports=o9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(o9e,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 E=A+y,_=g[E];g[E]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}var v=this._hash.words,b=g[A+0],T=g[A+1],w=g[A+2],R=g[A+3],x=g[A+4],P=g[A+5],D=g[A+6],N=g[A+7],L=g[A+8],B=g[A+9],q=g[A+10],M=g[A+11],O=g[A+12],j=g[A+13],Q=g[A+14],U=g[A+15],Y=v[0],W=v[1],V=v[2],z=v[3];Y=d(Y,W,V,z,b,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,P,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,L,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,O,7,l[12]),z=d(z,Y,W,V,j,12,l[13]),V=d(V,z,Y,W,Q,17,l[14]),W=d(W,V,z,Y,U,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,b,20,l[19]),Y=f(Y,W,V,z,P,5,l[20]),z=f(z,Y,W,V,q,9,l[21]),V=f(V,z,Y,W,U,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,Q,9,l[25]),V=f(V,z,Y,W,R,14,l[26]),W=f(W,V,z,Y,L,20,l[27]),Y=f(Y,W,V,z,j,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,O,20,l[31]),Y=h(Y,W,V,z,P,4,l[32]),z=h(z,Y,W,V,L,11,l[33]),V=h(V,z,Y,W,M,16,l[34]),W=h(W,V,z,Y,Q,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,j,4,l[40]),z=h(z,Y,W,V,b,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,O,11,l[45]),V=h(V,z,Y,W,U,16,l[46]),W=h(W,V,z,Y,w,23,l[47]),Y=m(Y,W,V,z,b,6,l[48]),z=m(z,Y,W,V,N,10,l[49]),V=m(V,z,Y,W,Q,15,l[50]),W=m(W,V,z,Y,P,21,l[51]),Y=m(Y,W,V,z,O,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,L,6,l[56]),z=m(z,Y,W,V,U,10,l[57]),V=m(V,z,Y,W,D,15,l[58]),W=m(W,V,z,Y,j,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,E=g.sigBytes*8;A[E>>>5]|=128<<24-E%32;var _=e.floor(y/4294967296),v=y;A[(E+64>>>9<<4)+15]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,A[(E+64>>>9<<4)+14]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,g.sigBytes=(A.length+1)*4,this._process();for(var b=this._hash,T=b.words,w=0;w<4;w++){var R=T[w];T[w]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}return b},"_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,b){var T=g+(A&y|~A&E)+_+b;return(T<>>32-v)+A}a(d,"FF");function f(g,A,y,E,_,v,b){var T=g+(A&E|y&~E)+_+b;return(T<>>32-v)+A}a(f,"GG");function h(g,A,y,E,_,v,b){var T=g+(A^y^E)+_+b;return(T<>>32-v)+A}a(h,"HH");function m(g,A,y,E,_,v,b){var T=g+(y^(A|~E))+_+b;return(T<>>32-v)+A}a(m,"II"),r.MD5=s._createHelper(u),r.HmacMD5=s._createHmacHelper(u)})(Math),t.MD5})});var aPt=I((s9e,fHr)=>{p();(function(t,e){typeof s9e=="object"?fHr.exports=s9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(s9e,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],E=0;E<80;E++){if(E<16)c[E]=u[d+E]|0;else{var _=c[E-3]^c[E-8]^c[E-14]^c[E-16];c[E]=_<<1|_>>>31}var v=(h<<5|h>>>27)+y+c[E];E<20?v+=(m&g|~m&A)+1518500249:E<40?v+=(m^g^A)+1859775393:E<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 c9e=I((a9e,pHr)=>{p();(function(t,e){typeof a9e=="object"?pHr.exports=a9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(a9e,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=e.sqrt(y),_=2;_<=E;_++)if(!(y%_))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],E=g[2],_=g[3],v=g[4],b=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],P=(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]=P+d[R-7]+N+d[R-16]}var L=v&b^~v&T,B=A&y^A&E^y&E,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),O=w+M+L+u[R]+d[R],j=q+B;w=T,T=b,b=v,v=_+O|0,_=E,E=y,y=A,A=O+j|0}g[0]=g[0]+A|0,g[1]=g[1]+y|0,g[2]=g[2]+E|0,g[3]=g[3]+_|0,g[4]=g[4]+v|0,g[5]=g[5]+b|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 mHr=I((l9e,hHr)=>{p();(function(t,e,r){typeof l9e=="object"?hHr.exports=l9e=e(sa(),c9e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(l9e,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 cPt=I((u9e,gHr)=>{p();(function(t,e,r){typeof u9e=="object"?gHr.exports=u9e=e(sa(),RCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(u9e,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],E=A[1],_=A[2],v=A[3],b=A[4],T=A[5],w=A[6],R=A[7],x=y.high,P=y.low,D=E.high,N=E.low,L=_.high,B=_.low,q=v.high,M=v.low,O=b.high,j=b.low,Q=T.high,U=T.low,Y=w.high,W=w.low,V=R.high,z=R.low,ie=x,H=P,re=D,le=N,Le=L,ge=B,Ue=q,ke=M,X=O,ee=j,K=Q,he=U,Z=Y,ue=W,qe=V,ne=z,ce=0;ce<80;ce++){var Ne,we,Be=f[ce];if(ce<16)we=Be.high=m[g+ce*2]|0,Ne=Be.low=m[g+ce*2+1]|0;else{var rt=f[ce-15],st=rt.high,_t=rt.low,Dt=(st>>>1|_t<<31)^(st>>>8|_t<<24)^st>>>7,$t=(_t>>>1|st<<31)^(_t>>>8|st<<24)^(_t>>>7|st<<25),Gt=f[ce-2],Ie=Gt.high,F=Gt.low,be=(Ie>>>19|F<<13)^(Ie<<3|F>>>29)^Ie>>>6,Qe=(F>>>19|Ie<<13)^(F<<3|Ie>>>29)^(F>>>6|Ie<<26),pe=f[ce-7],Se=pe.high,Fe=pe.low,te=f[ce-16],Te=te.high,Ge=te.low;Ne=$t+Fe,we=Dt+Se+(Ne>>>0<$t>>>0?1:0),Ne=Ne+Qe,we=we+be+(Ne>>>0>>0?1:0),Ne=Ne+Ge,we=we+Te+(Ne>>>0>>0?1:0),Be.high=we,Be.low=Ne}var J=X&K^~X&Z,se=ee&he^~ee&ue,me=ie&re^ie&Le^re&Le,Ce=H&le^H&ge^le&ge,He=(ie>>>28|H<<4)^(ie<<30|H>>>2)^(ie<<25|H>>>7),$e=(H>>>28|ie<<4)^(H<<30|ie>>>2)^(H<<25|ie>>>7),et=(X>>>14|ee<<18)^(X>>>18|ee<<14)^(X<<23|ee>>>9),ct=(ee>>>14|X<<18)^(ee>>>18|X<<14)^(ee<<23|X>>>9),bt=d[ce],ht=bt.high,We=bt.low,ae=ne+ct,Re=qe+et+(ae>>>0>>0?1:0),ae=ae+se,Re=Re+J+(ae>>>0>>0?1:0),ae=ae+We,Re=Re+ht+(ae>>>0>>0?1:0),ae=ae+Ne,Re=Re+we+(ae>>>0>>0?1:0),Me=$e+Ce,ye=He+me+(Me>>>0<$e>>>0?1:0);qe=Z,ne=ue,Z=K,ue=he,K=X,he=ee,ee=ke+ae|0,X=Ue+Re+(ee>>>0>>0?1:0)|0,Ue=Le,ke=ge,Le=re,ge=le,re=ie,le=H,H=ae+Me|0,ie=Re+ye+(H>>>0>>0?1:0)|0}P=y.low=P+H,y.high=x+ie+(P>>>0>>0?1:0),N=E.low=N+le,E.high=D+re+(N>>>0>>0?1:0),B=_.low=B+ge,_.high=L+Le+(B>>>0>>0?1:0),M=v.low=M+ke,v.high=q+Ue+(M>>>0>>0?1:0),j=b.low=j+ee,b.high=O+X+(j>>>0>>0?1:0),U=T.low=U+he,T.high=Q+K+(U>>>0>>0?1:0),W=w.low=W+ue,w.high=Y+Z+(W>>>0>>0?1:0),z=R.low=z+ne,R.high=V+qe+(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 E=this._hash.toX32();return E},"_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 yHr=I((d9e,AHr)=>{p();(function(t,e,r){typeof d9e=="object"?AHr.exports=d9e=e(sa(),RCe(),cPt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(d9e,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 _Hr=I((f9e,EHr)=>{p();(function(t,e,r){typeof f9e=="object"?EHr.exports=f9e=e(sa(),RCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(f9e,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,E=0;E<24;E++){d[A+5*y]=(E+1)*(E+2)/2%64;var _=y%5,v=(2*A+3*y)%5;A=_,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 b=1,T=0;T<24;T++){for(var w=0,R=0,x=0;x<7;x++){if(b&1){var P=(1<>>24)&16711935|(b<<24|b>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var w=E[v];w.high^=T,w.low^=b}for(var R=0;R<24;R++){for(var x=0;x<5;x++){for(var P=0,D=0,N=0;N<5;N++){var w=E[x+5*N];P^=w.high,D^=w.low}var L=m[x];L.high=P,L.low=D}for(var x=0;x<5;x++)for(var B=m[(x+4)%5],q=m[(x+1)%5],M=q.high,O=q.low,P=B.high^(M<<1|O>>>31),D=B.low^(O<<1|M>>>31),N=0;N<5;N++){var w=E[x+5*N];w.high^=P,w.low^=D}for(var j=1;j<25;j++){var P,D,w=E[j],Q=w.high,U=w.low,Y=d[j];Y<32?(P=Q<>>32-Y,D=U<>>32-Y):(P=U<>>64-Y,D=Q<>>64-Y);var W=m[f[j]];W.high=P,W.low=D}var V=m[0],z=E[0];V.high=z.high,V.low=z.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var j=x+5*N,w=E[j],ie=m[j],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=E[0],le=h[R];w.high^=le.high,w.low^=le.low}},"_doProcessBlock"),_doFinalize:a(function(){var A=this._data,y=A.words,E=this._nDataBytes*8,_=A.sigBytes*8,v=this.blockSize*32;y[_>>>5]|=1<<24-_%32,y[(e.ceil((_+1)/v)*v>>>5)-1]|=128,A.sigBytes=y.length*4,this._process();for(var b=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),E=0;E<25;E++)y[E]=y[E].clone();return A},"clone")});r.SHA3=s._createHelper(g),r.HmacSHA3=s._createHmacHelper(g)})(Math),t.SHA3})});var CHr=I((p9e,vHr)=>{p();(function(t,e){typeof p9e=="object"?vHr.exports=p9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(p9e,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,P=T[x];T[x]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360}var D=this._hash.words,N=h.words,L=m.words,B=l.words,q=u.words,M=d.words,O=f.words,j,Q,U,Y,W,V,z,ie,H,re;V=j=D[0],z=Q=D[1],ie=U=D[2],H=Y=D[3],re=W=D[4];for(var le,R=0;R<80;R+=1)le=j+T[w+B[R]]|0,R<16?le+=A(Q,U,Y)+N[0]:R<32?le+=y(Q,U,Y)+N[1]:R<48?le+=E(Q,U,Y)+N[2]:R<64?le+=_(Q,U,Y)+N[3]:le+=v(Q,U,Y)+N[4],le=le|0,le=b(le,M[R]),le=le+W|0,j=W,W=Y,Y=b(U,10),U=Q,Q=le,le=V+T[w+q[R]]|0,R<16?le+=v(z,ie,H)+L[0]:R<32?le+=_(z,ie,H)+L[1]:R<48?le+=E(z,ie,H)+L[2]:R<64?le+=y(z,ie,H)+L[3]:le+=A(z,ie,H)+L[4],le=le|0,le=b(le,O[R]),le=le+re|0,V=re,re=H,H=b(ie,10),ie=z,z=le;le=D[1]+U+H|0,D[1]=D[2]+Y+re|0,D[2]=D[3]+W+V|0,D[3]=D[4]+j+z|0,D[4]=D[0]+Q+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 P=this._hash,D=P.words,N=0;N<5;N++){var L=D[N];D[N]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return P},"_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 E(T,w,R){return(T|~w)^R}a(E,"f3");function _(T,w,R){return T&R|w&~R}a(_,"f4");function v(T,w,R){return T^(w|~R)}a(v,"f5");function b(T,w){return T<>>32-w}a(b,"rotl"),r.RIPEMD160=s._createHelper(g),r.HmacRIPEMD160=s._createHmacHelper(g)})(Math),t.RIPEMD160})});var m9e=I((h9e,bHr)=>{p();(function(t,e){typeof h9e=="object"?bHr.exports=h9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(h9e,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,E=0;E{p();(function(t,e,r){typeof g9e=="object"?SHr.exports=g9e=e(sa(),c9e(),m9e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(g9e,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,E=A.words,_=h.keySize,v=h.iterations;y.length<_;){var b=m.update(f).finalize(A);m.reset();for(var T=b.words,w=T.length,R=b,x=1;x{p();(function(t,e,r){typeof A9e=="object"?IHr.exports=A9e=e(sa(),aPt(),m9e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(A9e,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,E=h.iterations;A.length{p();(function(t,e,r){typeof y9e=="object"?xHr.exports=y9e=e(sa(),oB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(y9e,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(L,B){return this.create(this._ENC_XFORM_MODE,L,B)},"createEncryptor"),createDecryptor:a(function(L,B){return this.create(this._DEC_XFORM_MODE,L,B)},"createDecryptor"),init:a(function(L,B,q){this.cfg=this.cfg.extend(q),this._xformMode=L,this._key=B,this.reset()},"init"),reset:a(function(){c.reset.call(this),this._doReset()},"reset"),process:a(function(L){return this._append(L),this._process()},"process"),finalize:a(function(L){L&&this._append(L);var B=this._doFinalize();return B},"finalize"),keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function L(B){return typeof B=="string"?N:x}return a(L,"selectCipherStrategy"),function(B){return{encrypt:a(function(q,M,O){return L(M).encrypt(B,q,M,O)},"encrypt"),decrypt:a(function(q,M,O){return L(M).decrypt(B,q,M,O)},"decrypt")}}})()}),g=n.StreamCipher=m.extend({_doFinalize:a(function(){var L=this._process(!0);return L},"_doFinalize"),blockSize:1}),A=r.mode={},y=n.BlockCipherMode=o.extend({createEncryptor:a(function(L,B){return this.Encryptor.create(L,B)},"createEncryptor"),createDecryptor:a(function(L,B){return this.Decryptor.create(L,B)},"createDecryptor"),init:a(function(L,B){this._cipher=L,this._iv=B},"init")}),E=A.CBC=(function(){var L=y.extend();L.Encryptor=L.extend({processBlock:a(function(q,M){var O=this._cipher,j=O.blockSize;B.call(this,q,M,j),O.encryptBlock(q,M),this._prevBlock=q.slice(M,M+j)},"processBlock")}),L.Decryptor=L.extend({processBlock:a(function(q,M){var O=this._cipher,j=O.blockSize,Q=q.slice(M,M+j);O.decryptBlock(q,M),B.call(this,q,M,j),this._prevBlock=Q},"processBlock")});function B(q,M,O){var j,Q=this._iv;Q?(j=Q,this._iv=e):j=this._prevBlock;for(var U=0;U>>2]&255;L.sigBytes-=B},"unpad")},b=n.BlockCipher=m.extend({cfg:m.cfg.extend({mode:E,padding:v}),reset:a(function(){var L;m.reset.call(this);var B=this.cfg,q=B.iv,M=B.mode;this._xformMode==this._ENC_XFORM_MODE?L=M.createEncryptor:(L=M.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==L?this._mode.init(this,q&&q.words):(this._mode=L.call(M,this,q&&q.words),this._mode.__creator=L)},"reset"),_doProcessBlock:a(function(L,B){this._mode.processBlock(L,B)},"_doProcessBlock"),_doFinalize:a(function(){var L,B=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(B.pad(this._data,this.blockSize),L=this._process(!0)):(L=this._process(!0),B.unpad(L)),L},"_doFinalize"),blockSize:128/32}),T=n.CipherParams=o.extend({init:a(function(L){this.mixIn(L)},"init"),toString:a(function(L){return(L||this.formatter).stringify(this)},"toString")}),w=r.format={},R=w.OpenSSL={stringify:a(function(L){var B,q=L.ciphertext,M=L.salt;return M?B=s.create([1398893684,1701076831]).concat(M).concat(q):B=q,B.toString(d)},"stringify"),parse:a(function(L){var B,q=d.parse(L),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(L,B,q,M){M=this.cfg.extend(M);var O=L.createEncryptor(q,M),j=O.finalize(B),Q=O.cfg;return T.create({ciphertext:j,key:q,iv:Q.iv,algorithm:L,mode:Q.mode,padding:Q.padding,blockSize:L.blockSize,formatter:M.format})},"encrypt"),decrypt:a(function(L,B,q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var O=L.createDecryptor(q,M).finalize(B.ciphertext);return O},"decrypt"),_parse:a(function(L,B){return typeof L=="string"?B.parse(L,this):L},"_parse")}),P=r.kdf={},D=P.OpenSSL={execute:a(function(L,B,q,M,O){if(M||(M=s.random(64/8)),O)var j=h.create({keySize:B+q,hasher:O}).compute(L,M);else var j=h.create({keySize:B+q}).compute(L,M);var Q=s.create(j.words.slice(B),q*4);return j.sigBytes=B*4,T.create({key:j,iv:Q,salt:M})},"execute")},N=n.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:D}),encrypt:a(function(L,B,q,M){M=this.cfg.extend(M);var O=M.kdf.execute(q,L.keySize,L.ivSize,M.salt,M.hasher);M.iv=O.iv;var j=x.encrypt.call(this,L,B,O.key,M);return j.mixIn(O),j},"encrypt"),decrypt:a(function(L,B,q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var O=M.kdf.execute(q,L.keySize,L.ivSize,B.salt,M.hasher);M.iv=O.iv;var j=x.decrypt.call(this,L,B,O.key,M);return j},"decrypt")})})()})});var RHr=I((E9e,wHr)=>{p();(function(t,e,r){typeof E9e=="object"?wHr.exports=E9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(E9e,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 _9e=="object"?kHr.exports=_9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(_9e,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 v9e=="object"?DHr.exports=v9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(v9e,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 C9e=="object"?MHr.exports=C9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(C9e,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 b9e=="object"?LHr.exports=b9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(b9e,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 UHr=I((S9e,FHr)=>{p();(function(t,e,r){typeof S9e=="object"?FHr.exports=S9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(S9e,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 qHr=I((T9e,QHr)=>{p();(function(t,e,r){typeof T9e=="object"?QHr.exports=T9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(T9e,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 HHr=I((I9e,jHr)=>{p();(function(t,e,r){typeof I9e=="object"?jHr.exports=I9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(I9e,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 $Hr=I((x9e,GHr)=>{p();(function(t,e,r){typeof x9e=="object"?GHr.exports=x9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(x9e,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 WHr=I((w9e,VHr)=>{p();(function(t,e,r){typeof w9e=="object"?VHr.exports=w9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(w9e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var YHr=I((R9e,zHr)=>{p();(function(t,e,r){typeof R9e=="object"?zHr.exports=R9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(R9e,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 JHr=I((k9e,KHr)=>{p();(function(t,e,r){typeof k9e=="object"?KHr.exports=k9e=e(sa(),uU(),dU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(k9e,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 _=[],v=0;v<256;v++)v<128?_[v]=v<<1:_[v]=v<<1^283;for(var b=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[b]=w,c[w]=b;var R=_[b],x=_[R],P=_[x],D=_[w]*257^w*16843008;l[b]=D<<24|D>>>8,u[b]=D<<16|D>>>16,d[b]=D<<8|D>>>24,f[b]=D;var D=P*16843009^x*65537^R*257^b*16843008;h[w]=D<<24|D>>>8,m[w]=D<<16|D>>>16,g[w]=D<<8|D>>>24,A[w]=D,b?(b=R^_[_[_[P^R]]],T^=_[_[T]]):b=T=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],E=o.AES=n.extend({_doReset:a(function(){var _;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,b=v.words,T=v.sigBytes/4,w=this._nRounds=T+6,R=(w+1)*4,x=this._keySchedule=[],P=0;P6&&P%T==4&&(_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255]):(_=_<<8|_>>>24,_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255],_^=y[P/T|0]<<24),x[P]=x[P-T]^_);for(var D=this._invKeySchedule=[],N=0;N>>24]]^m[s[_>>>16&255]]^g[s[_>>>8&255]]^A[s[_&255]]}}},"_doReset"),encryptBlock:a(function(_,v){this._doCryptBlock(_,v,this._keySchedule,l,u,d,f,s)},"encryptBlock"),decryptBlock:a(function(_,v){var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b,this._doCryptBlock(_,v,this._invKeySchedule,h,m,g,A,c);var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b},"decryptBlock"),_doCryptBlock:a(function(_,v,b,T,w,R,x,P){for(var D=this._nRounds,N=_[v]^b[0],L=_[v+1]^b[1],B=_[v+2]^b[2],q=_[v+3]^b[3],M=4,O=1;O>>24]^w[L>>>16&255]^R[B>>>8&255]^x[q&255]^b[M++],Q=T[L>>>24]^w[B>>>16&255]^R[q>>>8&255]^x[N&255]^b[M++],U=T[B>>>24]^w[q>>>16&255]^R[N>>>8&255]^x[L&255]^b[M++],Y=T[q>>>24]^w[N>>>16&255]^R[L>>>8&255]^x[B&255]^b[M++];N=j,L=Q,B=U,q=Y}var j=(P[N>>>24]<<24|P[L>>>16&255]<<16|P[B>>>8&255]<<8|P[q&255])^b[M++],Q=(P[L>>>24]<<24|P[B>>>16&255]<<16|P[q>>>8&255]<<8|P[N&255])^b[M++],U=(P[B>>>24]<<24|P[q>>>16&255]<<16|P[N>>>8&255]<<8|P[L&255])^b[M++],Y=(P[q>>>24]<<24|P[N>>>16&255]<<16|P[L>>>8&255]<<8|P[B&255])^b[M++];_[v]=j,_[v+1]=Q,_[v+2]=U,_[v+3]=Y},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(E)})(),t.AES})});var XHr=I((P9e,ZHr)=>{p();(function(t,e,r){typeof P9e=="object"?ZHr.exports=P9e=e(sa(),uU(),dU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(P9e,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,E=y.words,_=[],v=0;v<56;v++){var b=c[v]-1;_[v]=E[b>>>5]>>>31-b%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]|=_[(l[v]-1+x)%28]<<31-v%6,R[4+(v/6|0)]|=_[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 P=this._invSubKeys=[],v=0;v<16;v++)P[v]=T[15-v]},"_doReset"),encryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._subKeys)},"encryptBlock"),decryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._invSubKeys)},"decryptBlock"),_doCryptBlock:a(function(y,E,_){this._lBlock=y[E],this._rBlock=y[E+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 b=_[v],T=this._lBlock,w=this._rBlock,R=0,x=0;x<8;x++)R|=d[x][((w^b[x])&f[x])>>>0];this._lBlock=w,this._rBlock=T^R}var P=this._lBlock;this._lBlock=this._rBlock,this._rBlock=P,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[E]=this._lBlock,y[E+1]=this._rBlock},"_doCryptBlock"),keySize:64/32,ivSize:64/32,blockSize:64/32});function m(y,E){var _=(this._lBlock>>>y^this._rBlock)&E;this._rBlock^=_,this._lBlock^=_<>>y^this._lBlock)&E;this._lBlock^=_,this._rBlock^=_<192.");var _=E.slice(0,2),v=E.length<4?E.slice(0,2):E.slice(2,4),b=E.length<6?E.slice(0,2):E.slice(4,6);this._des1=h.createEncryptor(n.create(_)),this._des2=h.createEncryptor(n.create(v)),this._des3=h.createEncryptor(n.create(b))},"_doReset"),encryptBlock:a(function(y,E){this._des1.encryptBlock(y,E),this._des2.decryptBlock(y,E),this._des3.encryptBlock(y,E)},"encryptBlock"),decryptBlock:a(function(y,E){this._des3.decryptBlock(y,E),this._des2.encryptBlock(y,E),this._des1.decryptBlock(y,E)},"decryptBlock"),keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=o._createHelper(A)})(),t.TripleDES})});var tGr=I((D9e,eGr)=>{p();(function(t,e,r){typeof D9e=="object"?eGr.exports=D9e=e(sa(),uU(),dU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(D9e,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 E=h[m];h[m]=h[g],h[g]=E}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 nGr=I((N9e,rGr)=>{p();(function(t,e,r){typeof N9e=="object"?rGr.exports=N9e=e(sa(),uU(),dU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(N9e,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,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;A[0]^=v,A[1]^=T,A[2]^=b,A[3]^=w,A[4]^=v,A[5]^=T,A[6]^=b,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,E=((A*A>>>17)+A*y>>>15)+y*y,_=((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 oGr=I((M9e,iGr)=>{p();(function(t,e,r){typeof M9e=="object"?iGr.exports=M9e=e(sa(),uU(),dU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(M9e,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,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;g[0]^=v,g[1]^=T,g[2]^=b,g[3]^=w,g[4]^=v,g[5]^=T,g[6]^=b,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,E=((A*A>>>17)+A*y>>>15)+y*y,_=((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 aGr=I((O9e,sGr)=>{p();(function(t,e,r){typeof O9e=="object"?sGr.exports=O9e=e(sa(),uU(),dU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(O9e,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 E=y>>24&255,_=y>>16&255,v=y>>8&255,b=y&255,T=A.sbox[0][E]+A.sbox[1][_];return T=T^A.sbox[2][v],T=T+A.sbox[3][b],T}a(d,"F");function f(A,y,E){let _=y,v=E,b;for(let T=0;T1;--T)_=_^A.pbox[T],v=d(A,_)^v,b=_,_=v,v=b;return b=_,_=v,v=b,v=v^A.pbox[1],_=_^A.pbox[0],{left:_,right:v}}a(h,"BlowFish_Decrypt");function m(A,y,E){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 _=0;for(let w=0;w=E&&(_=0);let v=0,b=0,T=0;for(let w=0;w{p();(function(t,e,r){typeof L9e=="object"?cGr.exports=L9e=e(sa(),RCe(),oHr(),aHr(),uU(),uHr(),dU(),aPt(),c9e(),mHr(),cPt(),yHr(),_Hr(),CHr(),m9e(),THr(),oB(),jm(),RHr(),PHr(),NHr(),OHr(),BHr(),UHr(),qHr(),HHr(),$Hr(),WHr(),YHr(),JHr(),XHr(),tGr(),nGr(),oGr(),aGr()):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)})(L9e,function(t){return t})});var Xoe=I(qy=>{"use strict";p();Object.defineProperty(qy,"__esModule",{value:!0});qy.stringArray=qy.array=qy.func=qy.error=qy.number=qy.string=qy.boolean=void 0;function yAo(t){return t===!0||t===!1}a(yAo,"boolean");qy.boolean=yAo;function HVr(t){return typeof t=="string"||t instanceof String}a(HVr,"string");qy.string=HVr;function EAo(t){return typeof t=="number"||t instanceof Number}a(EAo,"number");qy.number=EAo;function _Ao(t){return t instanceof Error}a(_Ao,"error");qy.error=_Ao;function vAo(t){return typeof t=="function"}a(vAo,"func");qy.func=vAo;function GVr(t){return Array.isArray(t)}a(GVr,"array");qy.array=GVr;function CAo(t){return GVr(t)&&t.every(e=>HVr(e))}a(CAo,"stringArray");qy.stringArray=CAo});var N2t=I(pi=>{"use strict";p();Object.defineProperty(pi,"__esModule",{value:!0});pi.Message=pi.NotificationType9=pi.NotificationType8=pi.NotificationType7=pi.NotificationType6=pi.NotificationType5=pi.NotificationType4=pi.NotificationType3=pi.NotificationType2=pi.NotificationType1=pi.NotificationType0=pi.NotificationType=pi.RequestType9=pi.RequestType8=pi.RequestType7=pi.RequestType6=pi.RequestType5=pi.RequestType4=pi.RequestType3=pi.RequestType2=pi.RequestType1=pi.RequestType=pi.RequestType0=pi.AbstractMessageSignature=pi.ParameterStructures=pi.ResponseError=pi.ErrorCodes=void 0;var FW=Xoe(),l2t;(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})(l2t||(pi.ErrorCodes=l2t={}));var u2t=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=FW.number(e)?e:l2t.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}};pi.ResponseError=u2t;var uC=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}};pi.ParameterStructures=uC;uC.auto=new uC("auto");uC.byPosition=new uC("byPosition");uC.byName=new uC("byName");var ju=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return uC.auto}};pi.AbstractMessageSignature=ju;var d2t=class extends ju{static{a(this,"RequestType0")}constructor(e){super(e,0)}};pi.RequestType0=d2t;var f2t=class extends ju{static{a(this,"RequestType")}constructor(e,r=uC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType=f2t;var p2t=class extends ju{static{a(this,"RequestType1")}constructor(e,r=uC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType1=p2t;var h2t=class extends ju{static{a(this,"RequestType2")}constructor(e){super(e,2)}};pi.RequestType2=h2t;var m2t=class extends ju{static{a(this,"RequestType3")}constructor(e){super(e,3)}};pi.RequestType3=m2t;var g2t=class extends ju{static{a(this,"RequestType4")}constructor(e){super(e,4)}};pi.RequestType4=g2t;var A2t=class extends ju{static{a(this,"RequestType5")}constructor(e){super(e,5)}};pi.RequestType5=A2t;var y2t=class extends ju{static{a(this,"RequestType6")}constructor(e){super(e,6)}};pi.RequestType6=y2t;var E2t=class extends ju{static{a(this,"RequestType7")}constructor(e){super(e,7)}};pi.RequestType7=E2t;var _2t=class extends ju{static{a(this,"RequestType8")}constructor(e){super(e,8)}};pi.RequestType8=_2t;var v2t=class extends ju{static{a(this,"RequestType9")}constructor(e){super(e,9)}};pi.RequestType9=v2t;var C2t=class extends ju{static{a(this,"NotificationType")}constructor(e,r=uC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType=C2t;var b2t=class extends ju{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};pi.NotificationType0=b2t;var S2t=class extends ju{static{a(this,"NotificationType1")}constructor(e,r=uC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType1=S2t;var T2t=class extends ju{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};pi.NotificationType2=T2t;var I2t=class extends ju{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};pi.NotificationType3=I2t;var x2t=class extends ju{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};pi.NotificationType4=x2t;var w2t=class extends ju{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};pi.NotificationType5=w2t;var R2t=class extends ju{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};pi.NotificationType6=R2t;var k2t=class extends ju{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};pi.NotificationType7=k2t;var P2t=class extends ju{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};pi.NotificationType8=P2t;var D2t=class extends ju{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};pi.NotificationType9=D2t;var $Vr;(function(t){function e(o){let s=o;return s&&FW.string(s.method)&&(FW.string(s.id)||FW.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&FW.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)&&(FW.string(s.id)||FW.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})($Vr||(pi.Message=$Vr={}))});var O2t=I(IU=>{"use strict";p();var VVr;Object.defineProperty(IU,"__esModule",{value:!0});IU.LRUCache=IU.LinkedMap=IU.Touch=void 0;var jy;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(jy||(IU.Touch=jy={}));var yUe=class{static{a(this,"LinkedMap")}constructor(){this[VVr]="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=jy.None){let n=this._map.get(e);if(n)return r!==jy.None&&this.touch(n,r),n.value}set(e,r,n=jy.None){let o=this._map.get(e);if(o)o.value=r,n!==jy.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case jy.None:this.addItemLast(o);break;case jy.First:this.addItemFirst(o);break;case jy.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}[(VVr=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!==jy.First&&r!==jy.Last)){if(r===jy.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===jy.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)}};IU.LinkedMap=yUe;var M2t=class extends yUe{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=jy.AsNew){return super.get(e,r)}peek(e){return super.get(e,jy.None)}set(e,r){return super.set(e,r,jy.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};IU.LRUCache=M2t});var zVr=I(EUe=>{"use strict";p();Object.defineProperty(EUe,"__esModule",{value:!0});EUe.Disposable=void 0;var WVr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(WVr||(EUe.Disposable=WVr={}))});var xU=I(F2t=>{"use strict";p();Object.defineProperty(F2t,"__esModule",{value:!0});var L2t;function B2t(){if(L2t===void 0)throw new Error("No runtime abstraction layer installed");return L2t}a(B2t,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");L2t=r}a(e,"install"),t.install=e})(B2t||(B2t={}));F2t.default=B2t});var tse=I(ese=>{"use strict";p();Object.defineProperty(ese,"__esModule",{value:!0});ese.Emitter=ese.Event=void 0;var bAo=xU(),YVr;(function(t){let e={dispose(){}};t.None=function(){return e}})(YVr||(ese.Event=YVr={}));var U2t=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 U2t),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)}};ese.Emitter=_Ue;_Ue._noop=function(){}});var bUe=I(rse=>{"use strict";p();Object.defineProperty(rse,"__esModule",{value:!0});rse.CancellationTokenSource=rse.CancellationToken=void 0;var SAo=xU(),TAo=Xoe(),Q2t=tse(),vUe;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Q2t.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Q2t.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||TAo.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(vUe||(rse.CancellationToken=vUe={}));var IAo=Object.freeze(function(t,e){let r=(0,SAo.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),CUe=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?IAo:(this._emitter||(this._emitter=new Q2t.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},q2t=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new CUe),this._token}cancel(){this._token?this._token.cancel():this._token=vUe.Cancelled}dispose(){this._token?this._token instanceof CUe&&this._token.dispose():this._token=vUe.None}};rse.CancellationTokenSource=q2t});var KVr=I(nse=>{"use strict";p();Object.defineProperty(nse,"__esModule",{value:!0});nse.SharedArrayReceiverStrategy=nse.SharedArraySenderStrategy=void 0;var xAo=bUe(),YCe;(function(t){t.Continue=0,t.Cancelled=1})(YCe||(YCe={}));var j2t=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]=YCe.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,YCe.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};nse.SharedArraySenderStrategy=j2t;var H2t=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===YCe.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},G2t=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new H2t(e)}cancel(){}dispose(){}},$2t=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new xAo.CancellationTokenSource:new G2t(r)}};nse.SharedArrayReceiverStrategy=$2t});var W2t=I(SUe=>{"use strict";p();Object.defineProperty(SUe,"__esModule",{value:!0});SUe.Semaphore=void 0;var wAo=xU(),V2t=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,wAo.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()}}};SUe.Semaphore=V2t});var ZVr=I(wU=>{"use strict";p();Object.defineProperty(wU,"__esModule",{value:!0});wU.ReadableStreamMessageReader=wU.AbstractMessageReader=wU.MessageReader=void 0;var Y2t=xU(),ise=Xoe(),z2t=tse(),RAo=W2t(),JVr;(function(t){function e(r){let n=r;return n&&ise.func(n.listen)&&ise.func(n.dispose)&&ise.func(n.onError)&&ise.func(n.onClose)&&ise.func(n.onPartialMessage)}a(e,"is"),t.is=e})(JVr||(wU.MessageReader=JVr={}));var TUe=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new z2t.Emitter,this.closeEmitter=new z2t.Emitter,this.partialMessageEmitter=new z2t.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: ${ise.string(e.message)?e.message:"unknown"}`)}};wU.AbstractMessageReader=TUe;var K2t;(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,Y2t.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(K2t||(K2t={}));var J2t=class extends TUe{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=K2t.fromOptions(r),this.buffer=(0,Y2t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new RAo.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,Y2t.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))}};wU.ReadableStreamMessageReader=J2t});var nWr=I(RU=>{"use strict";p();Object.defineProperty(RU,"__esModule",{value:!0});RU.WriteableStreamMessageWriter=RU.AbstractMessageWriter=RU.MessageWriter=void 0;var XVr=xU(),KCe=Xoe(),kAo=W2t(),eWr=tse(),PAo="Content-Length: ",tWr=`\r +`,rWr;(function(t){function e(r){let n=r;return n&&KCe.func(n.dispose)&&KCe.func(n.onClose)&&KCe.func(n.onError)&&KCe.func(n.write)}a(e,"is"),t.is=e})(rWr||(RU.MessageWriter=rWr={}));var IUe=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new eWr.Emitter,this.closeEmitter=new eWr.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: ${KCe.string(e.message)?e.message:"unknown"}`)}};RU.AbstractMessageWriter=IUe;var Z2t;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,XVr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,XVr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(Z2t||(Z2t={}));var X2t=class extends IUe{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=Z2t.fromOptions(r),this.errorCount=0,this.writeSemaphore=new kAo.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(PAo,n.byteLength.toString(),tWr),o.push(tWr),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()}};RU.WriteableStreamMessageWriter=X2t});var iWr=I(xUe=>{"use strict";p();Object.defineProperty(xUe,"__esModule",{value:!0});xUe.AbstractMessageBuffer=void 0;var DAo=13,NAo=10,MAo=`\r +`,eDt=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}};xUe.AbstractMessageBuffer=eDt});var lWr=I(Lo=>{"use strict";p();Object.defineProperty(Lo,"__esModule",{value:!0});Lo.createMessageConnection=Lo.ConnectionOptions=Lo.MessageStrategy=Lo.CancellationStrategy=Lo.CancellationSenderStrategy=Lo.CancellationReceiverStrategy=Lo.RequestCancellationReceiverStrategy=Lo.IdCancellationReceiverStrategy=Lo.ConnectionStrategy=Lo.ConnectionError=Lo.ConnectionErrors=Lo.LogTraceNotification=Lo.SetTraceNotification=Lo.TraceFormat=Lo.TraceValues=Lo.Trace=Lo.NullLogger=Lo.ProgressType=Lo.ProgressToken=void 0;var oWr=xU(),lf=Xoe(),Vi=N2t(),sWr=O2t(),JCe=tse(),tDt=bUe(),ebe;(function(t){t.type=new Vi.NotificationType("$/cancelRequest")})(ebe||(ebe={}));var rDt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(rDt||(Lo.ProgressToken=rDt={}));var ZCe;(function(t){t.type=new Vi.NotificationType("$/progress")})(ZCe||(ZCe={}));var nDt=class{static{a(this,"ProgressType")}constructor(){}};Lo.ProgressType=nDt;var iDt;(function(t){function e(r){return lf.func(r)}a(e,"is"),t.is=e})(iDt||(iDt={}));Lo.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var bc;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(bc||(Lo.Trace=bc={}));var aWr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(aWr||(Lo.TraceValues=aWr={}));(function(t){function e(n){if(!lf.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})(bc||(Lo.Trace=bc={}));var G1;(function(t){t.Text="text",t.JSON="json"})(G1||(Lo.TraceFormat=G1={}));(function(t){function e(r){return lf.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(G1||(Lo.TraceFormat=G1={}));var oDt;(function(t){t.type=new Vi.NotificationType("$/setTrace")})(oDt||(Lo.SetTraceNotification=oDt={}));var wUe;(function(t){t.type=new Vi.NotificationType("$/logTrace")})(wUe||(Lo.LogTraceNotification=wUe={}));var XCe;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(XCe||(Lo.ConnectionErrors=XCe={}));var ose=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Lo.ConnectionError=ose;var sDt;(function(t){function e(r){let n=r;return n&&lf.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(sDt||(Lo.ConnectionStrategy=sDt={}));var RUe;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&lf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lf.func(n.dispose))}a(e,"is"),t.is=e})(RUe||(Lo.IdCancellationReceiverStrategy=RUe={}));var aDt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&lf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lf.func(n.dispose))}a(e,"is"),t.is=e})(aDt||(Lo.RequestCancellationReceiverStrategy=aDt={}));var kUe;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new tDt.CancellationTokenSource}});function e(r){return RUe.is(r)||aDt.is(r)}a(e,"is"),t.is=e})(kUe||(Lo.CancellationReceiverStrategy=kUe={}));var PUe;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(ebe.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&lf.func(n.sendCancellation)&&lf.func(n.cleanup)}a(e,"is"),t.is=e})(PUe||(Lo.CancellationSenderStrategy=PUe={}));var DUe;(function(t){t.Message=Object.freeze({receiver:kUe.Message,sender:PUe.Message});function e(r){let n=r;return n&&kUe.is(n.receiver)&&PUe.is(n.sender)}a(e,"is"),t.is=e})(DUe||(Lo.CancellationStrategy=DUe={}));var NUe;(function(t){function e(r){let n=r;return n&&lf.func(n.handleMessage)}a(e,"is"),t.is=e})(NUe||(Lo.MessageStrategy=NUe={}));var cWr;(function(t){function e(r){let n=r;return n&&(DUe.is(n.cancellationStrategy)||sDt.is(n.connectionStrategy)||NUe.is(n.messageStrategy))}a(e,"is"),t.is=e})(cWr||(Lo.ConnectionOptions=cWr={}));var Vk;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Vk||(Vk={}));function OAo(t,e,r,n){let o=r!==void 0?r:Lo.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new sWr.LinkedMap,E=new Map,_=new Set,v=new Map,b=bc.Off,T=G1.Text,w,R=Vk.New,x=new JCe.Emitter,P=new JCe.Emitter,D=new JCe.Emitter,N=new JCe.Emitter,L=new JCe.Emitter,B=n&&n.cancellationStrategy?n.cancellationStrategy:DUe.Message;function q(Ie){if(Ie===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ie.toString()}a(q,"createRequestQueueKey");function M(Ie){return Ie===null?"res-unknown-"+(++l).toString():"res-"+Ie.toString()}a(M,"createResponseQueueKey");function O(){return"not-"+(++c).toString()}a(O,"createNotificationQueueKey");function j(Ie,F){Vi.Message.isRequest(F)?Ie.set(q(F.id),F):Vi.Message.isResponse(F)?Ie.set(M(F.id),F):Ie.set(O(),F)}a(j,"addMessageToQueue");function Q(Ie){}a(Q,"cancelUndispatched");function U(){return R===Vk.Listening}a(U,"isListening");function Y(){return R===Vk.Closed}a(Y,"isClosed");function W(){return R===Vk.Disposed}a(W,"isDisposed");function V(){(R===Vk.New||R===Vk.Listening)&&(R=Vk.Closed,P.fire(void 0))}a(V,"closeHandler");function z(Ie){x.fire([Ie,void 0,void 0])}a(z,"readErrorHandler");function ie(Ie){x.fire(Ie)}a(ie,"writeErrorHandler"),t.onClose(V),t.onError(z),e.onClose(V),e.onError(ie);function H(){A||y.size===0||(A=(0,oWr.default)().timer.setImmediate(()=>{A=void 0,le()}))}a(H,"triggerMessageQueue");function re(Ie){Vi.Message.isRequest(Ie)?ge(Ie):Vi.Message.isNotification(Ie)?ke(Ie):Vi.Message.isResponse(Ie)?Ue(Ie):X(Ie)}a(re,"handleMessage");function le(){if(y.size===0)return;let Ie=y.shift();try{let F=n?.messageStrategy;NUe.is(F)?F.handleMessage(Ie,re):re(Ie)}finally{H()}}a(le,"processMessageQueue");let Le=a(Ie=>{try{if(Vi.Message.isNotification(Ie)&&Ie.method===ebe.type.method){let F=Ie.params.id,be=q(F),Qe=y.get(be);if(Vi.Message.isRequest(Qe)){let Se=n?.connectionStrategy,Fe=Se&&Se.cancelUndispatched?Se.cancelUndispatched(Qe,Q):void 0;if(Fe&&(Fe.error!==void 0||Fe.result!==void 0)){y.delete(be),v.delete(F),Fe.id=Qe.id,Z(Fe,Ie.method,Date.now()),e.write(Fe).catch(()=>o.error("Sending response for canceled message failed."));return}}let pe=v.get(F);if(pe!==void 0){pe.cancel(),qe(Ie);return}else _.add(F)}j(y,Ie)}finally{H()}},"callback");function ge(Ie){if(W())return;function F(Te,Ge,J){let se={jsonrpc:u,id:Ie.id};Te instanceof Vi.ResponseError?se.error=Te.toJson():se.result=Te===void 0?null:Te,Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(F,"reply");function be(Te,Ge,J){let se={jsonrpc:u,id:Ie.id,error:Te.toJson()};Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(be,"replyError");function Qe(Te,Ge,J){Te===void 0&&(Te=null);let se={jsonrpc:u,id:Ie.id,result:Te};Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(Qe,"replySuccess"),ue(Ie);let pe=f.get(Ie.method),Se,Fe;pe&&(Se=pe.type,Fe=pe.handler);let te=Date.now();if(Fe||d){let Te=Ie.id??String(Date.now()),Ge=RUe.is(B.receiver)?B.receiver.createCancellationTokenSource(Te):B.receiver.createCancellationTokenSource(Ie);Ie.id!==null&&_.has(Ie.id)&&Ge.cancel(),Ie.id!==null&&v.set(Te,Ge);try{let J;if(Fe)if(Ie.params===void 0){if(Se!==void 0&&Se.numberOfParams!==0){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines ${Se.numberOfParams} params but received none.`),Ie.method,te);return}J=Fe(Ge.token)}else if(Array.isArray(Ie.params)){if(Se!==void 0&&Se.parameterStructures===Vi.ParameterStructures.byName){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by name but received parameters by position`),Ie.method,te);return}J=Fe(...Ie.params,Ge.token)}else{if(Se!==void 0&&Se.parameterStructures===Vi.ParameterStructures.byPosition){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by position but received parameters by name`),Ie.method,te);return}J=Fe(Ie.params,Ge.token)}else d&&(J=d(Ie.method,Ie.params,Ge.token));let se=J;J?se.then?se.then(me=>{v.delete(Te),F(me,Ie.method,te)},me=>{v.delete(Te),me instanceof Vi.ResponseError?be(me,Ie.method,te):me&&lf.string(me.message)?be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${me.message}`),Ie.method,te):be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}):(v.delete(Te),F(J,Ie.method,te)):(v.delete(Te),Qe(J,Ie.method,te))}catch(J){v.delete(Te),J instanceof Vi.ResponseError?F(J,Ie.method,te):J&&lf.string(J.message)?be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${J.message}`),Ie.method,te):be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}}else be(new Vi.ResponseError(Vi.ErrorCodes.MethodNotFound,`Unhandled method ${Ie.method}`),Ie.method,te)}a(ge,"handleRequest");function Ue(Ie){if(!W())if(Ie.id===null)Ie.error?o.error(`Received response message without id: Error is: +${JSON.stringify(Ie.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let F=Ie.id,be=E.get(F);if(ne(Ie,be),be!==void 0){E.delete(F);try{if(Ie.error){let Qe=Ie.error;be.reject(new Vi.ResponseError(Qe.code,Qe.message,Qe.data))}else if(Ie.result!==void 0)be.resolve(Ie.result);else throw new Error("Should never happen.")}catch(Qe){Qe.message?o.error(`Response handler '${be.method}' failed with message: ${Qe.message}`):o.error(`Response handler '${be.method}' failed unexpectedly.`)}}}}a(Ue,"handleResponse");function ke(Ie){if(W())return;let F,be;if(Ie.method===ebe.type.method){let Qe=Ie.params.id;_.delete(Qe),qe(Ie);return}else{let Qe=m.get(Ie.method);Qe&&(be=Qe.handler,F=Qe.type)}if(be||h)try{if(qe(Ie),be)if(Ie.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==Vi.ParameterStructures.byName&&o.error(`Notification ${Ie.method} defines ${F.numberOfParams} params but received none.`),be();else if(Array.isArray(Ie.params)){let Qe=Ie.params;Ie.method===ZCe.type.method&&Qe.length===2&&rDt.is(Qe[0])?be({token:Qe[0],value:Qe[1]}):(F!==void 0&&(F.parameterStructures===Vi.ParameterStructures.byName&&o.error(`Notification ${Ie.method} defines parameters by name but received parameters by position`),F.numberOfParams!==Ie.params.length&&o.error(`Notification ${Ie.method} defines ${F.numberOfParams} params but received ${Qe.length} arguments`)),be(...Qe))}else F!==void 0&&F.parameterStructures===Vi.ParameterStructures.byPosition&&o.error(`Notification ${Ie.method} defines parameters by position but received parameters by name`),be(Ie.params);else h&&h(Ie.method,Ie.params)}catch(Qe){Qe.message?o.error(`Notification handler '${Ie.method}' failed with message: ${Qe.message}`):o.error(`Notification handler '${Ie.method}' failed unexpectedly.`)}else D.fire(Ie)}a(ke,"handleNotification");function X(Ie){if(!Ie){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(Ie,null,4)}`);let F=Ie;if(lf.string(F.id)||lf.number(F.id)){let be=F.id,Qe=E.get(be);Qe&&Qe.reject(new Error("The received response has neither a result nor an error property."))}}a(X,"handleInvalidMessage");function ee(Ie){if(Ie!=null)switch(b){case bc.Verbose:return JSON.stringify(Ie,null,4);case bc.Compact:return JSON.stringify(Ie);default:return}}a(ee,"stringifyTrace");function K(Ie){if(!(b===bc.Off||!w))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} `),w.log(`Sending request '${Ie.method} - (${Ie.id})'.`,F)}else ce("send-request",Ie)}a(K,"traceSendingRequest");function he(Ie){if(!(b===bc.Off||!w))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} @@ -26,7 +26,7 @@ ${JSON.stringify(Ie,null,4)}`);let F=Ie;if(lf.string(F.id)||lf.number(F.id)){let `)),w.log(`Sending response '${F} - (${Ie.id})'. Processing request took ${Date.now()-be}ms`,Qe)}else ce("send-response",Ie)}a(Z,"traceSendingResponse");function ue(Ie){if(!(b===bc.Off||!w))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} -`),w.log(`Received request '${Ie.method} - (${Ie.id})'.`,F)}else ce("receive-request",Ie)}a(ue,"traceReceivedRequest");function qe(Ie){if(!(b===bc.Off||!w||Ie.method===IUe.type.method))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} +`),w.log(`Received request '${Ie.method} - (${Ie.id})'.`,F)}else ce("receive-request",Ie)}a(ue,"traceReceivedRequest");function qe(Ie){if(!(b===bc.Off||!w||Ie.method===wUe.type.method))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} `:F=`No parameters provided. @@ -36,58 +36,58 @@ ${JSON.stringify(Ie,null,4)}`);let F=Ie;if(lf.string(F.id)||lf.number(F.id)){let `:Ie.error===void 0&&(be=`No result returned. -`)),F){let Qe=Ie.error?` Request failed: ${Ie.error.message} (${Ie.error.code}).`:"";w.log(`Received response '${F.method} - (${Ie.id})' in ${Date.now()-F.timerStart}ms.${Qe}`,be)}else w.log(`Received response ${Ie.id} without active response promise.`,be)}else ce("receive-response",Ie)}a(ne,"traceReceivedResponse");function ce(Ie,F){if(!w||b===bc.Off)return;let be={isLSPMessage:!0,type:Ie,message:F,timestamp:Date.now()};w.log(be)}a(ce,"logLSPMessage");function Ne(){if(Y())throw new ose(ZCe.Closed,"Connection is closed.");if(W())throw new ose(ZCe.Disposed,"Connection is disposed.")}a(Ne,"throwIfClosedOrDisposed");function we(){if(U())throw new ose(ZCe.AlreadyListening,"Connection is already listening")}a(we,"throwIfListening");function Be(){if(!U())throw new Error("Call listen() first.")}a(Be,"throwIfNotListening");function rt(Ie){return Ie===void 0?null:Ie}a(rt,"undefinedToNull");function st(Ie){if(Ie!==null)return Ie}a(st,"nullToUndefined");function _t(Ie){return Ie!=null&&!Array.isArray(Ie)&&typeof Ie=="object"}a(_t,"isNamedParam");function Dt(Ie,F){switch(Ie){case Vi.ParameterStructures.auto:return _t(F)?st(F):[rt(F)];case Vi.ParameterStructures.byName:if(!_t(F))throw new Error("Received parameters by name but param is not an object literal.");return st(F);case Vi.ParameterStructures.byPosition:return[rt(F)];default:throw new Error(`Unknown parameter structure ${Ie.toString()}`)}}a(Dt,"computeSingleParam");function $t(Ie,F){let be,Qe=Ie.numberOfParams;switch(Qe){case 0:be=void 0;break;case 1:be=Dt(Ie.parameterStructures,F[0]);break;default:be=[];for(let pe=0;pe{Ne();let be,Qe;if(lf.string(Ie)){be=Ie;let Se=F[0],Fe=0,te=Vi.ParameterStructures.auto;Vi.ParameterStructures.is(Se)&&(Fe=1,te=Se);let Te=F.length,Ge=Te-Fe;switch(Ge){case 0:Qe=void 0;break;case 1:Qe=Dt(te,F[Fe]);break;default:if(te===Vi.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);Qe=F.slice(Fe,Te).map(J=>rt(J));break}}else{let Se=F;be=Ie.method,Qe=$t(Ie,Se)}let pe={jsonrpc:u,method:be,params:Qe};return he(pe),e.write(pe).catch(Se=>{throw o.error("Sending notification failed."),Se})},"sendNotification"),onNotification:a((Ie,F)=>{Ne();let be;return lf.func(Ie)?h=Ie:F&&(lf.string(Ie)?(be=Ie,m.set(Ie,{type:void 0,handler:F})):(be=Ie.method,m.set(Ie.method,{type:Ie,handler:F}))),{dispose:a(()=>{be!==void 0?m.delete(be):h=void 0},"dispose")}},"onNotification"),onProgress:a((Ie,F,be)=>{if(g.has(F))throw new Error(`Progress handler for token ${F} already registered`);return g.set(F,be),{dispose:a(()=>{g.delete(F)},"dispose")}},"onProgress"),sendProgress:a((Ie,F,be)=>Gt.sendNotification(JCe.type,{token:F,value:be}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((Ie,...F)=>{Ne(),Be();let be,Qe,pe;if(lf.string(Ie)){be=Ie;let Te=F[0],Ge=F[F.length-1],J=0,se=Vi.ParameterStructures.auto;Vi.ParameterStructures.is(Te)&&(J=1,se=Te);let me=F.length;eDt.CancellationToken.is(Ge)&&(me=me-1,pe=Ge);let Ce=me-J;switch(Ce){case 0:Qe=void 0;break;case 1:Qe=Dt(se,F[J]);break;default:if(se===Vi.ParameterStructures.byName)throw new Error(`Received ${Ce} parameters for 'by Name' request parameter structure.`);Qe=F.slice(J,me).map(He=>rt(He));break}}else{let Te=F;be=Ie.method,Qe=$t(Ie,Te);let Ge=Ie.numberOfParams;pe=eDt.CancellationToken.is(Te[Ge])?Te[Ge]:void 0}let Se=s++,Fe;pe&&(Fe=pe.onCancellationRequested(()=>{let Te=B.sender.sendCancellation(Gt,Se);return Te===void 0?(o.log(`Received no promise from cancellation strategy when cancelling id ${Se}`),Promise.resolve()):Te.catch(()=>{o.log(`Sending cancellation messages for id ${Se} failed`)})}));let te={jsonrpc:u,id:Se,method:be,params:Qe};return K(te),typeof B.sender.enableCancellation=="function"&&B.sender.enableCancellation(te),new Promise(async(Te,Ge)=>{let J=a(Ce=>{Te(Ce),B.sender.cleanup(Se),Fe?.dispose()},"resolveWithCleanup"),se=a(Ce=>{Ge(Ce),B.sender.cleanup(Se),Fe?.dispose()},"rejectWithCleanup"),me={method:be,timerStart:Date.now(),resolve:J,reject:se};try{await e.write(te),E.set(Se,me)}catch(Ce){throw o.error("Sending request failed."),me.reject(new Vi.ResponseError(Vi.ErrorCodes.MessageWriteError,Ce.message?Ce.message:"Unknown reason")),Ce}})},"sendRequest"),onRequest:a((Ie,F)=>{Ne();let be=null;return nDt.is(Ie)?(be=void 0,d=Ie):lf.string(Ie)?(be=null,F!==void 0&&(be=Ie,f.set(Ie,{handler:F,type:void 0}))):F!==void 0&&(be=Ie.method,f.set(Ie.method,{type:Ie,handler:F})),{dispose:a(()=>{be!==null&&(be!==void 0?f.delete(be):d=void 0)},"dispose")}},"onRequest"),hasPendingResponse:a(()=>E.size>0,"hasPendingResponse"),trace:a(async(Ie,F,be)=>{let Qe=!1,pe=G1.Text;be!==void 0&&(lf.boolean(be)?Qe=be:(Qe=be.sendNotification||!1,pe=be.traceFormat||G1.Text)),b=Ie,T=pe,b===bc.Off?w=void 0:w=F,Qe&&!Y()&&!W()&&await Gt.sendNotification(iDt.type,{value:bc.toString(Ie)})},"trace"),onError:x.event,onClose:P.event,onUnhandledNotification:D.event,onDispose:L.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if(W())return;R=$k.Disposed,L.fire(void 0);let Ie=new Vi.ResponseError(Vi.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of E.values())F.reject(Ie);E=new Map,v=new Map,_=new Set,y=new oWr.LinkedMap,lf.func(e.dispose)&&e.dispose(),lf.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ne(),we(),R=$k.Listening,t.listen(Le)},"listen"),inspect:a(()=>{(0,iWr.default)().console.log("inspect")},"inspect")};return Gt.onNotification(IUe.type,Ie=>{if(b===bc.Off||!w)return;let F=b===bc.Verbose||b===bc.Compact;w.log(Ie.message,F?Ie.verbose:void 0)}),Gt.onNotification(JCe.type,Ie=>{let F=g.get(Ie.token);F?F(Ie.value):N.fire(Ie)}),Gt}a(PAo,"createMessageConnection");Oo.createMessageConnection=PAo});var DUe=I(Bt=>{"use strict";p();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.ProgressType=Bt.ProgressToken=Bt.createMessageConnection=Bt.NullLogger=Bt.ConnectionOptions=Bt.ConnectionStrategy=Bt.AbstractMessageBuffer=Bt.WriteableStreamMessageWriter=Bt.AbstractMessageWriter=Bt.MessageWriter=Bt.ReadableStreamMessageReader=Bt.AbstractMessageReader=Bt.MessageReader=Bt.SharedArrayReceiverStrategy=Bt.SharedArraySenderStrategy=Bt.CancellationToken=Bt.CancellationTokenSource=Bt.Emitter=Bt.Event=Bt.Disposable=Bt.LRUCache=Bt.Touch=Bt.LinkedMap=Bt.ParameterStructures=Bt.NotificationType9=Bt.NotificationType8=Bt.NotificationType7=Bt.NotificationType6=Bt.NotificationType5=Bt.NotificationType4=Bt.NotificationType3=Bt.NotificationType2=Bt.NotificationType1=Bt.NotificationType0=Bt.NotificationType=Bt.ErrorCodes=Bt.ResponseError=Bt.RequestType9=Bt.RequestType8=Bt.RequestType7=Bt.RequestType6=Bt.RequestType5=Bt.RequestType4=Bt.RequestType3=Bt.RequestType2=Bt.RequestType1=Bt.RequestType0=Bt.RequestType=Bt.Message=Bt.RAL=void 0;Bt.MessageStrategy=Bt.CancellationStrategy=Bt.CancellationSenderStrategy=Bt.CancellationReceiverStrategy=Bt.ConnectionError=Bt.ConnectionErrors=Bt.LogTraceNotification=Bt.SetTraceNotification=Bt.TraceFormat=Bt.TraceValues=Bt.Trace=void 0;var cu=D2t();Object.defineProperty(Bt,"Message",{enumerable:!0,get:a(function(){return cu.Message},"get")});Object.defineProperty(Bt,"RequestType",{enumerable:!0,get:a(function(){return cu.RequestType},"get")});Object.defineProperty(Bt,"RequestType0",{enumerable:!0,get:a(function(){return cu.RequestType0},"get")});Object.defineProperty(Bt,"RequestType1",{enumerable:!0,get:a(function(){return cu.RequestType1},"get")});Object.defineProperty(Bt,"RequestType2",{enumerable:!0,get:a(function(){return cu.RequestType2},"get")});Object.defineProperty(Bt,"RequestType3",{enumerable:!0,get:a(function(){return cu.RequestType3},"get")});Object.defineProperty(Bt,"RequestType4",{enumerable:!0,get:a(function(){return cu.RequestType4},"get")});Object.defineProperty(Bt,"RequestType5",{enumerable:!0,get:a(function(){return cu.RequestType5},"get")});Object.defineProperty(Bt,"RequestType6",{enumerable:!0,get:a(function(){return cu.RequestType6},"get")});Object.defineProperty(Bt,"RequestType7",{enumerable:!0,get:a(function(){return cu.RequestType7},"get")});Object.defineProperty(Bt,"RequestType8",{enumerable:!0,get:a(function(){return cu.RequestType8},"get")});Object.defineProperty(Bt,"RequestType9",{enumerable:!0,get:a(function(){return cu.RequestType9},"get")});Object.defineProperty(Bt,"ResponseError",{enumerable:!0,get:a(function(){return cu.ResponseError},"get")});Object.defineProperty(Bt,"ErrorCodes",{enumerable:!0,get:a(function(){return cu.ErrorCodes},"get")});Object.defineProperty(Bt,"NotificationType",{enumerable:!0,get:a(function(){return cu.NotificationType},"get")});Object.defineProperty(Bt,"NotificationType0",{enumerable:!0,get:a(function(){return cu.NotificationType0},"get")});Object.defineProperty(Bt,"NotificationType1",{enumerable:!0,get:a(function(){return cu.NotificationType1},"get")});Object.defineProperty(Bt,"NotificationType2",{enumerable:!0,get:a(function(){return cu.NotificationType2},"get")});Object.defineProperty(Bt,"NotificationType3",{enumerable:!0,get:a(function(){return cu.NotificationType3},"get")});Object.defineProperty(Bt,"NotificationType4",{enumerable:!0,get:a(function(){return cu.NotificationType4},"get")});Object.defineProperty(Bt,"NotificationType5",{enumerable:!0,get:a(function(){return cu.NotificationType5},"get")});Object.defineProperty(Bt,"NotificationType6",{enumerable:!0,get:a(function(){return cu.NotificationType6},"get")});Object.defineProperty(Bt,"NotificationType7",{enumerable:!0,get:a(function(){return cu.NotificationType7},"get")});Object.defineProperty(Bt,"NotificationType8",{enumerable:!0,get:a(function(){return cu.NotificationType8},"get")});Object.defineProperty(Bt,"NotificationType9",{enumerable:!0,get:a(function(){return cu.NotificationType9},"get")});Object.defineProperty(Bt,"ParameterStructures",{enumerable:!0,get:a(function(){return cu.ParameterStructures},"get")});var aDt=M2t();Object.defineProperty(Bt,"LinkedMap",{enumerable:!0,get:a(function(){return aDt.LinkedMap},"get")});Object.defineProperty(Bt,"LRUCache",{enumerable:!0,get:a(function(){return aDt.LRUCache},"get")});Object.defineProperty(Bt,"Touch",{enumerable:!0,get:a(function(){return aDt.Touch},"get")});var DAo=WVr();Object.defineProperty(Bt,"Disposable",{enumerable:!0,get:a(function(){return DAo.Disposable},"get")});var lWr=tse();Object.defineProperty(Bt,"Event",{enumerable:!0,get:a(function(){return lWr.Event},"get")});Object.defineProperty(Bt,"Emitter",{enumerable:!0,get:a(function(){return lWr.Emitter},"get")});var uWr=vUe();Object.defineProperty(Bt,"CancellationTokenSource",{enumerable:!0,get:a(function(){return uWr.CancellationTokenSource},"get")});Object.defineProperty(Bt,"CancellationToken",{enumerable:!0,get:a(function(){return uWr.CancellationToken},"get")});var dWr=YVr();Object.defineProperty(Bt,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return dWr.SharedArraySenderStrategy},"get")});Object.defineProperty(Bt,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return dWr.SharedArrayReceiverStrategy},"get")});var cDt=JVr();Object.defineProperty(Bt,"MessageReader",{enumerable:!0,get:a(function(){return cDt.MessageReader},"get")});Object.defineProperty(Bt,"AbstractMessageReader",{enumerable:!0,get:a(function(){return cDt.AbstractMessageReader},"get")});Object.defineProperty(Bt,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return cDt.ReadableStreamMessageReader},"get")});var lDt=rWr();Object.defineProperty(Bt,"MessageWriter",{enumerable:!0,get:a(function(){return lDt.MessageWriter},"get")});Object.defineProperty(Bt,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return lDt.AbstractMessageWriter},"get")});Object.defineProperty(Bt,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return lDt.WriteableStreamMessageWriter},"get")});var NAo=nWr();Object.defineProperty(Bt,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return NAo.AbstractMessageBuffer},"get")});var gA=cWr();Object.defineProperty(Bt,"ConnectionStrategy",{enumerable:!0,get:a(function(){return gA.ConnectionStrategy},"get")});Object.defineProperty(Bt,"ConnectionOptions",{enumerable:!0,get:a(function(){return gA.ConnectionOptions},"get")});Object.defineProperty(Bt,"NullLogger",{enumerable:!0,get:a(function(){return gA.NullLogger},"get")});Object.defineProperty(Bt,"createMessageConnection",{enumerable:!0,get:a(function(){return gA.createMessageConnection},"get")});Object.defineProperty(Bt,"ProgressToken",{enumerable:!0,get:a(function(){return gA.ProgressToken},"get")});Object.defineProperty(Bt,"ProgressType",{enumerable:!0,get:a(function(){return gA.ProgressType},"get")});Object.defineProperty(Bt,"Trace",{enumerable:!0,get:a(function(){return gA.Trace},"get")});Object.defineProperty(Bt,"TraceValues",{enumerable:!0,get:a(function(){return gA.TraceValues},"get")});Object.defineProperty(Bt,"TraceFormat",{enumerable:!0,get:a(function(){return gA.TraceFormat},"get")});Object.defineProperty(Bt,"SetTraceNotification",{enumerable:!0,get:a(function(){return gA.SetTraceNotification},"get")});Object.defineProperty(Bt,"LogTraceNotification",{enumerable:!0,get:a(function(){return gA.LogTraceNotification},"get")});Object.defineProperty(Bt,"ConnectionErrors",{enumerable:!0,get:a(function(){return gA.ConnectionErrors},"get")});Object.defineProperty(Bt,"ConnectionError",{enumerable:!0,get:a(function(){return gA.ConnectionError},"get")});Object.defineProperty(Bt,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return gA.CancellationReceiverStrategy},"get")});Object.defineProperty(Bt,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return gA.CancellationSenderStrategy},"get")});Object.defineProperty(Bt,"CancellationStrategy",{enumerable:!0,get:a(function(){return gA.CancellationStrategy},"get")});Object.defineProperty(Bt,"MessageStrategy",{enumerable:!0,get:a(function(){return gA.MessageStrategy},"get")});var MAo=IU();Bt.RAL=MAo.default});var hWr=I(pDt=>{"use strict";p();Object.defineProperty(pDt,"__esModule",{value:!0});var fWr=require("util"),_B=DUe(),NUe=class t extends _B.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 fWr.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)}};NUe.emptyBuffer=Buffer.allocUnsafe(0);var uDt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),_B.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),_B.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),_B.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),_B.Disposable.create(()=>this.stream.off("data",e))}},dDt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),_B.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),_B.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),_B.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()}},pWr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new NUe(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 fWr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new uDt(t),"asReadableStream"),asWritableStream:a(t=>new dDt(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 fDt(){return pWr}a(fDt,"RIL");(function(t){function e(){_B.RAL.install(pWr)}a(e,"install"),t.install=e})(fDt||(fDt={}));pDt.default=fDt});var QW=I(xa=>{"use strict";p();var OAo=xa&&xa.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LAo=xa&&xa.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OAo(e,t,r)};Object.defineProperty(xa,"__esModule",{value:!0});xa.createMessageConnection=xa.createServerSocketTransport=xa.createClientSocketTransport=xa.createServerPipeTransport=xa.createClientPipeTransport=xa.generateRandomPipeName=xa.StreamMessageWriter=xa.StreamMessageReader=xa.SocketMessageWriter=xa.SocketMessageReader=xa.PortMessageWriter=xa.PortMessageReader=xa.IPCMessageWriter=xa.IPCMessageReader=void 0;var sse=hWr();sse.default.install();var mWr=require("path"),BAo=require("os"),FAo=require("crypto"),LUe=require("net"),$1=DUe();LAo(DUe(),xa);var hDt=class extends $1.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),$1.Disposable.create(()=>this.process.off("message",e))}};xa.IPCMessageReader=hDt;var mDt=class extends $1.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(){}};xa.IPCMessageWriter=mDt;var gDt=class extends $1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new $1.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)}};xa.PortMessageReader=gDt;var ADt=class extends $1.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(){}};xa.PortMessageWriter=ADt;var FW=class extends $1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,sse.default)().stream.asReadableStream(e),r)}};xa.SocketMessageReader=FW;var UW=class extends $1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,sse.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};xa.SocketMessageWriter=UW;var MUe=class extends $1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,sse.default)().stream.asReadableStream(e),r)}};xa.StreamMessageReader=MUe;var OUe=class extends $1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,sse.default)().stream.asWritableStream(e),r)}};xa.StreamMessageWriter=OUe;var gWr=process.env.XDG_RUNTIME_DIR,UAo=new Map([["linux",107],["darwin",103]]);function QAo(){let t=(0,FAo.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;gWr?e=mWr.join(gWr,`vscode-ipc-${t}.sock`):e=mWr.join(BAo.tmpdir(),`vscode-${t}.sock`);let r=UAo.get(process.platform);return r!==void 0&&e.length>r&&(0,sse.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(QAo,"generateRandomPipeName");xa.generateRandomPipeName=QAo;function qAo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,LUe.createServer)(l=>{c.close(),r([new FW(l,e),new UW(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(qAo,"createClientPipeTransport");xa.createClientPipeTransport=qAo;function jAo(t,e="utf-8"){let r=(0,LUe.createConnection)(t);return[new FW(r,e),new UW(r,e)]}a(jAo,"createServerPipeTransport");xa.createServerPipeTransport=jAo;function HAo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,LUe.createServer)(l=>{c.close(),r([new FW(l,e),new UW(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(HAo,"createClientSocketTransport");xa.createClientSocketTransport=HAo;function GAo(t,e="utf-8"){let r=(0,LUe.createConnection)(t,"127.0.0.1");return[new FW(r,e),new UW(r,e)]}a(GAo,"createServerSocketTransport");xa.createServerSocketTransport=GAo;function $Ao(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a($Ao,"isReadableStream");function VAo(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(VAo,"isWritableStream");function WAo(t,e,r,n){r||(r=$1.NullLogger);let o=$Ao(t)?new MUe(t):t,s=VAo(e)?new OUe(e):e;return $1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,$1.createMessageConnection)(o,s,r,n)}a(WAo,"createMessageConnection");xa.createMessageConnection=WAo});var yDt=I((MIl,AWr)=>{"use strict";p();AWr.exports=QW()});var ebe=I((yWr,BUe)=>{p();(function(t){if(typeof BUe=="object"&&typeof BUe.exports=="object"){var e=t(require,yWr);e!==void 0&&(BUe.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(ae){function Re(Me){return typeof Me=="string"}a(Re,"is"),ae.is=Re})(r||(e.DocumentUri=r={}));var n;(function(ae){function Re(Me){return typeof Me=="string"}a(Re,"is"),ae.is=Re})(n||(e.URI=n={}));var o;(function(ae){ae.MIN_VALUE=-2147483648,ae.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ae.MIN_VALUE<=Me&&Me<=ae.MAX_VALUE}a(Re,"is"),ae.is=Re})(o||(e.integer=o={}));var s;(function(ae){ae.MIN_VALUE=0,ae.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ae.MIN_VALUE<=Me&&Me<=ae.MAX_VALUE}a(Re,"is"),ae.is=Re})(s||(e.uinteger=s={}));var c;(function(ae){function Re(ye,oe){return ye===Number.MAX_VALUE&&(ye=s.MAX_VALUE),oe===Number.MAX_VALUE&&(oe=s.MAX_VALUE),{line:ye,character:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.line)&&We.uinteger(oe.character)}a(Me,"is"),ae.is=Me})(c||(e.Position=c={}));var l;(function(ae){function Re(ye,oe,ze,at){if(We.uinteger(ye)&&We.uinteger(oe)&&We.uinteger(ze)&&We.uinteger(at))return{start:c.create(ye,oe),end:c.create(ze,at)};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(ze,", ").concat(at,"]"))}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&c.is(oe.start)&&c.is(oe.end)}a(Me,"is"),ae.is=Me})(l||(e.Range=l={}));var u;(function(ae){function Re(ye,oe){return{uri:ye,range:oe}}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(u||(e.Location=u={}));var d;(function(ae){function Re(ye,oe,ze,at){return{targetUri:ye,targetRange:oe,targetSelectionRange:ze,originSelectionRange:at}}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(d||(e.LocationLink=d={}));var f;(function(ae){function Re(ye,oe,ze,at){return{red:ye,green:oe,blue:ze,alpha:at}}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(f||(e.Color=f={}));var h;(function(ae){function Re(ye,oe){return{range:ye,color:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&f.is(oe.color)}a(Me,"is"),ae.is=Me})(h||(e.ColorInformation=h={}));var m;(function(ae){function Re(ye,oe,ze){return{label:ye,textEdit:oe,additionalTextEdits:ze}}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(m||(e.ColorPresentation=m={}));var g;(function(ae){ae.Comment="comment",ae.Imports="imports",ae.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(ae){function Re(ye,oe,ze,at,Vt,gr){var cr={startLine:ye,endLine:oe};return We.defined(ze)&&(cr.startCharacter=ze),We.defined(at)&&(cr.endCharacter=at),We.defined(Vt)&&(cr.kind=Vt),We.defined(gr)&&(cr.collapsedText=gr),cr}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(A||(e.FoldingRange=A={}));var y;(function(ae){function Re(ye,oe){return{location:ye,message:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&u.is(oe.location)&&We.string(oe.message)}a(Me,"is"),ae.is=Me})(y||(e.DiagnosticRelatedInformation=y={}));var E;(function(ae){ae.Error=1,ae.Warning=2,ae.Information=3,ae.Hint=4})(E||(e.DiagnosticSeverity=E={}));var _;(function(ae){ae.Unnecessary=1,ae.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(ae){function Re(Me){var ye=Me;return We.objectLiteral(ye)&&We.string(ye.href)}a(Re,"is"),ae.is=Re})(v||(e.CodeDescription=v={}));var b;(function(ae){function Re(ye,oe,ze,at,Vt,gr){var cr={range:ye,message:oe};return We.defined(ze)&&(cr.severity=ze),We.defined(at)&&(cr.code=at),We.defined(Vt)&&(cr.source=Vt),We.defined(gr)&&(cr.relatedInformation=gr),cr}a(Re,"create"),ae.create=Re;function Me(ye){var oe,ze=ye;return We.defined(ze)&&l.is(ze.range)&&We.string(ze.message)&&(We.number(ze.severity)||We.undefined(ze.severity))&&(We.integer(ze.code)||We.string(ze.code)||We.undefined(ze.code))&&(We.undefined(ze.codeDescription)||We.string((oe=ze.codeDescription)===null||oe===void 0?void 0:oe.href))&&(We.string(ze.source)||We.undefined(ze.source))&&(We.undefined(ze.relatedInformation)||We.typedArray(ze.relatedInformation,y.is))}a(Me,"is"),ae.is=Me})(b||(e.Diagnostic=b={}));var T;(function(ae){function Re(ye,oe){for(var ze=[],at=2;at0&&(Vt.arguments=ze),Vt}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.title)&&We.string(oe.command)}a(Me,"is"),ae.is=Me})(T||(e.Command=T={}));var w;(function(ae){function Re(ze,at){return{range:ze,newText:at}}a(Re,"replace"),ae.replace=Re;function Me(ze,at){return{range:{start:ze,end:ze},newText:at}}a(Me,"insert"),ae.insert=Me;function ye(ze){return{range:ze,newText:""}}a(ye,"del"),ae.del=ye;function oe(ze){var at=ze;return We.objectLiteral(at)&&We.string(at.newText)&&l.is(at.range)}a(oe,"is"),ae.is=oe})(w||(e.TextEdit=w={}));var R;(function(ae){function Re(ye,oe,ze){var at={label:ye};return oe!==void 0&&(at.needsConfirmation=oe),ze!==void 0&&(at.description=ze),at}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(R||(e.ChangeAnnotation=R={}));var x;(function(ae){function Re(Me){var ye=Me;return We.string(ye)}a(Re,"is"),ae.is=Re})(x||(e.ChangeAnnotationIdentifier=x={}));var P;(function(ae){function Re(ze,at,Vt){return{range:ze,newText:at,annotationId:Vt}}a(Re,"replace"),ae.replace=Re;function Me(ze,at,Vt){return{range:{start:ze,end:ze},newText:at,annotationId:Vt}}a(Me,"insert"),ae.insert=Me;function ye(ze,at){return{range:ze,newText:"",annotationId:at}}a(ye,"del"),ae.del=ye;function oe(ze){var at=ze;return w.is(at)&&(R.is(at.annotationId)||x.is(at.annotationId))}a(oe,"is"),ae.is=oe})(P||(e.AnnotatedTextEdit=P={}));var D;(function(ae){function Re(ye,oe){return{textDocument:ye,edits:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&Y.is(oe.textDocument)&&Array.isArray(oe.edits)}a(Me,"is"),ae.is=Me})(D||(e.TextDocumentEdit=D={}));var N;(function(ae){function Re(ye,oe,ze){var at={kind:"create",uri:ye};return oe!==void 0&&(oe.overwrite!==void 0||oe.ignoreIfExists!==void 0)&&(at.options=oe),ze!==void 0&&(at.annotationId=ze),at}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(N||(e.CreateFile=N={}));var L;(function(ae){function Re(ye,oe,ze,at){var Vt={kind:"rename",oldUri:ye,newUri:oe};return ze!==void 0&&(ze.overwrite!==void 0||ze.ignoreIfExists!==void 0)&&(Vt.options=ze),at!==void 0&&(Vt.annotationId=at),Vt}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(L||(e.RenameFile=L={}));var B;(function(ae){function Re(ye,oe,ze){var at={kind:"delete",uri:ye};return oe!==void 0&&(oe.recursive!==void 0||oe.ignoreIfNotExists!==void 0)&&(at.options=oe),ze!==void 0&&(at.annotationId=ze),at}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(B||(e.DeleteFile=B={}));var q;(function(ae){function Re(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)||L.is(oe)||B.is(oe):D.is(oe)}))}a(Re,"is"),ae.is=Re})(q||(e.WorkspaceEdit=q={}));var M=(function(){function ae(Re,Me){this.edits=Re,this.changeAnnotations=Me}return a(ae,"TextEditChangeImpl"),ae.prototype.insert=function(Re,Me,ye){var oe,ze;if(ye===void 0?oe=w.insert(Re,Me):x.is(ye)?(ze=ye,oe=P.insert(Re,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ye),oe=P.insert(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ae.prototype.replace=function(Re,Me,ye){var oe,ze;if(ye===void 0?oe=w.replace(Re,Me):x.is(ye)?(ze=ye,oe=P.replace(Re,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ye),oe=P.replace(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ae.prototype.delete=function(Re,Me){var ye,oe;if(Me===void 0?ye=w.del(Re):x.is(Me)?(oe=Me,ye=P.del(Re,Me)):(this.assertChangeAnnotations(this.changeAnnotations),oe=this.changeAnnotations.manage(Me),ye=P.del(Re,oe)),this.edits.push(ye),oe!==void 0)return oe},ae.prototype.add=function(Re){this.edits.push(Re)},ae.prototype.all=function(){return this.edits},ae.prototype.clear=function(){this.edits.splice(0,this.edits.length)},ae.prototype.assertChangeAnnotations=function(Re){if(Re===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},ae})(),O=(function(){function ae(Re){this._annotations=Re===void 0?Object.create(null):Re,this._counter=0,this._size=0}return a(ae,"ChangeAnnotations"),ae.prototype.all=function(){return this._annotations},Object.defineProperty(ae.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),ae.prototype.manage=function(Re,Me){var ye;if(x.is(Re)?ye=Re:(ye=this.nextId(),Me=Re),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},ae.prototype.nextId=function(){return this._counter++,this._counter.toString()},ae})(),j=(function(){function ae(Re){var Me=this;this._textEditChanges=Object.create(null),Re!==void 0?(this._workspaceEdit=Re,Re.documentChanges?(this._changeAnnotations=new O(Re.changeAnnotations),Re.changeAnnotations=this._changeAnnotations.all(),Re.documentChanges.forEach(function(ye){if(D.is(ye)){var oe=new M(ye.edits,Me._changeAnnotations);Me._textEditChanges[ye.textDocument.uri]=oe}})):Re.changes&&Object.keys(Re.changes).forEach(function(ye){var oe=new M(Re.changes[ye]);Me._textEditChanges[ye]=oe})):this._workspaceEdit={}}return a(ae,"WorkspaceChange"),Object.defineProperty(ae.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}),ae.prototype.getTextEditChange=function(Re){if(Y.is(Re)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Me={uri:Re.uri,version:Re.version},ye=this._textEditChanges[Me.uri];if(!ye){var oe=[],ze={textDocument:Me,edits:oe};this._workspaceEdit.documentChanges.push(ze),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[Re];if(!ye){var oe=[];this._workspaceEdit.changes[Re]=oe,ye=new M(oe),this._textEditChanges[Re]=ye}return ye}},ae.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new O,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},ae.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},ae.prototype.createFile=function(Re,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 ze,at;if(oe===void 0?ze=N.create(Re,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=N.create(Re,ye,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ae.prototype.renameFile=function(Re,Me,ye,oe){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var ze;R.is(ye)||x.is(ye)?ze=ye:oe=ye;var at,Vt;if(ze===void 0?at=L.create(Re,Me,oe):(Vt=x.is(ze)?ze:this._changeAnnotations.manage(ze),at=L.create(Re,Me,oe,Vt)),this._workspaceEdit.documentChanges.push(at),Vt!==void 0)return Vt},ae.prototype.deleteFile=function(Re,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 ze,at;if(oe===void 0?ze=B.create(Re,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=B.create(Re,ye,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ae})();e.WorkspaceChange=j;var Q;(function(ae){function Re(ye){return{uri:ye}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)}a(Me,"is"),ae.is=Me})(Q||(e.TextDocumentIdentifier=Q={}));var U;(function(ae){function Re(ye,oe){return{uri:ye,version:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.integer(oe.version)}a(Me,"is"),ae.is=Me})(U||(e.VersionedTextDocumentIdentifier=U={}));var Y;(function(ae){function Re(ye,oe){return{uri:ye,version:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&(oe.version===null||We.integer(oe.version))}a(Me,"is"),ae.is=Me})(Y||(e.OptionalVersionedTextDocumentIdentifier=Y={}));var W;(function(ae){function Re(ye,oe,ze,at){return{uri:ye,languageId:oe,version:ze,text:at}}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(W||(e.TextDocumentItem=W={}));var V;(function(ae){ae.PlainText="plaintext",ae.Markdown="markdown";function Re(Me){var ye=Me;return ye===ae.PlainText||ye===ae.Markdown}a(Re,"is"),ae.is=Re})(V||(e.MarkupKind=V={}));var z;(function(ae){function Re(Me){var ye=Me;return We.objectLiteral(Me)&&V.is(ye.kind)&&We.string(ye.value)}a(Re,"is"),ae.is=Re})(z||(e.MarkupContent=z={}));var ie;(function(ae){ae.Text=1,ae.Method=2,ae.Function=3,ae.Constructor=4,ae.Field=5,ae.Variable=6,ae.Class=7,ae.Interface=8,ae.Module=9,ae.Property=10,ae.Unit=11,ae.Value=12,ae.Enum=13,ae.Keyword=14,ae.Snippet=15,ae.Color=16,ae.File=17,ae.Reference=18,ae.Folder=19,ae.EnumMember=20,ae.Constant=21,ae.Struct=22,ae.Event=23,ae.Operator=24,ae.TypeParameter=25})(ie||(e.CompletionItemKind=ie={}));var H;(function(ae){ae.PlainText=1,ae.Snippet=2})(H||(e.InsertTextFormat=H={}));var re;(function(ae){ae.Deprecated=1})(re||(e.CompletionItemTag=re={}));var le;(function(ae){function Re(ye,oe,ze){return{newText:ye,insert:oe,replace:ze}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return oe&&We.string(oe.newText)&&l.is(oe.insert)&&l.is(oe.replace)}a(Me,"is"),ae.is=Me})(le||(e.InsertReplaceEdit=le={}));var Le;(function(ae){ae.asIs=1,ae.adjustIndentation=2})(Le||(e.InsertTextMode=Le={}));var ge;(function(ae){function Re(Me){var ye=Me;return ye&&(We.string(ye.detail)||ye.detail===void 0)&&(We.string(ye.description)||ye.description===void 0)}a(Re,"is"),ae.is=Re})(ge||(e.CompletionItemLabelDetails=ge={}));var Ue;(function(ae){function Re(Me){return{label:Me}}a(Re,"create"),ae.create=Re})(Ue||(e.CompletionItem=Ue={}));var ke;(function(ae){function Re(Me,ye){return{items:Me||[],isIncomplete:!!ye}}a(Re,"create"),ae.create=Re})(ke||(e.CompletionList=ke={}));var X;(function(ae){function Re(ye){return ye.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(Re,"fromPlainText"),ae.fromPlainText=Re;function Me(ye){var oe=ye;return We.string(oe)||We.objectLiteral(oe)&&We.string(oe.language)&&We.string(oe.value)}a(Me,"is"),ae.is=Me})(X||(e.MarkedString=X={}));var ee;(function(ae){function Re(Me){var ye=Me;return!!ye&&We.objectLiteral(ye)&&(z.is(ye.contents)||X.is(ye.contents)||We.typedArray(ye.contents,X.is))&&(Me.range===void 0||l.is(Me.range))}a(Re,"is"),ae.is=Re})(ee||(e.Hover=ee={}));var K;(function(ae){function Re(Me,ye){return ye?{label:Me,documentation:ye}:{label:Me}}a(Re,"create"),ae.create=Re})(K||(e.ParameterInformation=K={}));var he;(function(ae){function Re(Me,ye){for(var oe=[],ze=2;ze{Ne();let be,Qe;if(lf.string(Ie)){be=Ie;let Se=F[0],Fe=0,te=Vi.ParameterStructures.auto;Vi.ParameterStructures.is(Se)&&(Fe=1,te=Se);let Te=F.length,Ge=Te-Fe;switch(Ge){case 0:Qe=void 0;break;case 1:Qe=Dt(te,F[Fe]);break;default:if(te===Vi.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);Qe=F.slice(Fe,Te).map(J=>rt(J));break}}else{let Se=F;be=Ie.method,Qe=$t(Ie,Se)}let pe={jsonrpc:u,method:be,params:Qe};return he(pe),e.write(pe).catch(Se=>{throw o.error("Sending notification failed."),Se})},"sendNotification"),onNotification:a((Ie,F)=>{Ne();let be;return lf.func(Ie)?h=Ie:F&&(lf.string(Ie)?(be=Ie,m.set(Ie,{type:void 0,handler:F})):(be=Ie.method,m.set(Ie.method,{type:Ie,handler:F}))),{dispose:a(()=>{be!==void 0?m.delete(be):h=void 0},"dispose")}},"onNotification"),onProgress:a((Ie,F,be)=>{if(g.has(F))throw new Error(`Progress handler for token ${F} already registered`);return g.set(F,be),{dispose:a(()=>{g.delete(F)},"dispose")}},"onProgress"),sendProgress:a((Ie,F,be)=>Gt.sendNotification(ZCe.type,{token:F,value:be}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((Ie,...F)=>{Ne(),Be();let be,Qe,pe;if(lf.string(Ie)){be=Ie;let Te=F[0],Ge=F[F.length-1],J=0,se=Vi.ParameterStructures.auto;Vi.ParameterStructures.is(Te)&&(J=1,se=Te);let me=F.length;tDt.CancellationToken.is(Ge)&&(me=me-1,pe=Ge);let Ce=me-J;switch(Ce){case 0:Qe=void 0;break;case 1:Qe=Dt(se,F[J]);break;default:if(se===Vi.ParameterStructures.byName)throw new Error(`Received ${Ce} parameters for 'by Name' request parameter structure.`);Qe=F.slice(J,me).map(He=>rt(He));break}}else{let Te=F;be=Ie.method,Qe=$t(Ie,Te);let Ge=Ie.numberOfParams;pe=tDt.CancellationToken.is(Te[Ge])?Te[Ge]:void 0}let Se=s++,Fe;pe&&(Fe=pe.onCancellationRequested(()=>{let Te=B.sender.sendCancellation(Gt,Se);return Te===void 0?(o.log(`Received no promise from cancellation strategy when cancelling id ${Se}`),Promise.resolve()):Te.catch(()=>{o.log(`Sending cancellation messages for id ${Se} failed`)})}));let te={jsonrpc:u,id:Se,method:be,params:Qe};return K(te),typeof B.sender.enableCancellation=="function"&&B.sender.enableCancellation(te),new Promise(async(Te,Ge)=>{let J=a(Ce=>{Te(Ce),B.sender.cleanup(Se),Fe?.dispose()},"resolveWithCleanup"),se=a(Ce=>{Ge(Ce),B.sender.cleanup(Se),Fe?.dispose()},"rejectWithCleanup"),me={method:be,timerStart:Date.now(),resolve:J,reject:se};try{await e.write(te),E.set(Se,me)}catch(Ce){throw o.error("Sending request failed."),me.reject(new Vi.ResponseError(Vi.ErrorCodes.MessageWriteError,Ce.message?Ce.message:"Unknown reason")),Ce}})},"sendRequest"),onRequest:a((Ie,F)=>{Ne();let be=null;return iDt.is(Ie)?(be=void 0,d=Ie):lf.string(Ie)?(be=null,F!==void 0&&(be=Ie,f.set(Ie,{handler:F,type:void 0}))):F!==void 0&&(be=Ie.method,f.set(Ie.method,{type:Ie,handler:F})),{dispose:a(()=>{be!==null&&(be!==void 0?f.delete(be):d=void 0)},"dispose")}},"onRequest"),hasPendingResponse:a(()=>E.size>0,"hasPendingResponse"),trace:a(async(Ie,F,be)=>{let Qe=!1,pe=G1.Text;be!==void 0&&(lf.boolean(be)?Qe=be:(Qe=be.sendNotification||!1,pe=be.traceFormat||G1.Text)),b=Ie,T=pe,b===bc.Off?w=void 0:w=F,Qe&&!Y()&&!W()&&await Gt.sendNotification(oDt.type,{value:bc.toString(Ie)})},"trace"),onError:x.event,onClose:P.event,onUnhandledNotification:D.event,onDispose:L.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if(W())return;R=Vk.Disposed,L.fire(void 0);let Ie=new Vi.ResponseError(Vi.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of E.values())F.reject(Ie);E=new Map,v=new Map,_=new Set,y=new sWr.LinkedMap,lf.func(e.dispose)&&e.dispose(),lf.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ne(),we(),R=Vk.Listening,t.listen(Le)},"listen"),inspect:a(()=>{(0,oWr.default)().console.log("inspect")},"inspect")};return Gt.onNotification(wUe.type,Ie=>{if(b===bc.Off||!w)return;let F=b===bc.Verbose||b===bc.Compact;w.log(Ie.message,F?Ie.verbose:void 0)}),Gt.onNotification(ZCe.type,Ie=>{let F=g.get(Ie.token);F?F(Ie.value):N.fire(Ie)}),Gt}a(OAo,"createMessageConnection");Lo.createMessageConnection=OAo});var MUe=I(Bt=>{"use strict";p();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.ProgressType=Bt.ProgressToken=Bt.createMessageConnection=Bt.NullLogger=Bt.ConnectionOptions=Bt.ConnectionStrategy=Bt.AbstractMessageBuffer=Bt.WriteableStreamMessageWriter=Bt.AbstractMessageWriter=Bt.MessageWriter=Bt.ReadableStreamMessageReader=Bt.AbstractMessageReader=Bt.MessageReader=Bt.SharedArrayReceiverStrategy=Bt.SharedArraySenderStrategy=Bt.CancellationToken=Bt.CancellationTokenSource=Bt.Emitter=Bt.Event=Bt.Disposable=Bt.LRUCache=Bt.Touch=Bt.LinkedMap=Bt.ParameterStructures=Bt.NotificationType9=Bt.NotificationType8=Bt.NotificationType7=Bt.NotificationType6=Bt.NotificationType5=Bt.NotificationType4=Bt.NotificationType3=Bt.NotificationType2=Bt.NotificationType1=Bt.NotificationType0=Bt.NotificationType=Bt.ErrorCodes=Bt.ResponseError=Bt.RequestType9=Bt.RequestType8=Bt.RequestType7=Bt.RequestType6=Bt.RequestType5=Bt.RequestType4=Bt.RequestType3=Bt.RequestType2=Bt.RequestType1=Bt.RequestType0=Bt.RequestType=Bt.Message=Bt.RAL=void 0;Bt.MessageStrategy=Bt.CancellationStrategy=Bt.CancellationSenderStrategy=Bt.CancellationReceiverStrategy=Bt.ConnectionError=Bt.ConnectionErrors=Bt.LogTraceNotification=Bt.SetTraceNotification=Bt.TraceFormat=Bt.TraceValues=Bt.Trace=void 0;var cu=N2t();Object.defineProperty(Bt,"Message",{enumerable:!0,get:a(function(){return cu.Message},"get")});Object.defineProperty(Bt,"RequestType",{enumerable:!0,get:a(function(){return cu.RequestType},"get")});Object.defineProperty(Bt,"RequestType0",{enumerable:!0,get:a(function(){return cu.RequestType0},"get")});Object.defineProperty(Bt,"RequestType1",{enumerable:!0,get:a(function(){return cu.RequestType1},"get")});Object.defineProperty(Bt,"RequestType2",{enumerable:!0,get:a(function(){return cu.RequestType2},"get")});Object.defineProperty(Bt,"RequestType3",{enumerable:!0,get:a(function(){return cu.RequestType3},"get")});Object.defineProperty(Bt,"RequestType4",{enumerable:!0,get:a(function(){return cu.RequestType4},"get")});Object.defineProperty(Bt,"RequestType5",{enumerable:!0,get:a(function(){return cu.RequestType5},"get")});Object.defineProperty(Bt,"RequestType6",{enumerable:!0,get:a(function(){return cu.RequestType6},"get")});Object.defineProperty(Bt,"RequestType7",{enumerable:!0,get:a(function(){return cu.RequestType7},"get")});Object.defineProperty(Bt,"RequestType8",{enumerable:!0,get:a(function(){return cu.RequestType8},"get")});Object.defineProperty(Bt,"RequestType9",{enumerable:!0,get:a(function(){return cu.RequestType9},"get")});Object.defineProperty(Bt,"ResponseError",{enumerable:!0,get:a(function(){return cu.ResponseError},"get")});Object.defineProperty(Bt,"ErrorCodes",{enumerable:!0,get:a(function(){return cu.ErrorCodes},"get")});Object.defineProperty(Bt,"NotificationType",{enumerable:!0,get:a(function(){return cu.NotificationType},"get")});Object.defineProperty(Bt,"NotificationType0",{enumerable:!0,get:a(function(){return cu.NotificationType0},"get")});Object.defineProperty(Bt,"NotificationType1",{enumerable:!0,get:a(function(){return cu.NotificationType1},"get")});Object.defineProperty(Bt,"NotificationType2",{enumerable:!0,get:a(function(){return cu.NotificationType2},"get")});Object.defineProperty(Bt,"NotificationType3",{enumerable:!0,get:a(function(){return cu.NotificationType3},"get")});Object.defineProperty(Bt,"NotificationType4",{enumerable:!0,get:a(function(){return cu.NotificationType4},"get")});Object.defineProperty(Bt,"NotificationType5",{enumerable:!0,get:a(function(){return cu.NotificationType5},"get")});Object.defineProperty(Bt,"NotificationType6",{enumerable:!0,get:a(function(){return cu.NotificationType6},"get")});Object.defineProperty(Bt,"NotificationType7",{enumerable:!0,get:a(function(){return cu.NotificationType7},"get")});Object.defineProperty(Bt,"NotificationType8",{enumerable:!0,get:a(function(){return cu.NotificationType8},"get")});Object.defineProperty(Bt,"NotificationType9",{enumerable:!0,get:a(function(){return cu.NotificationType9},"get")});Object.defineProperty(Bt,"ParameterStructures",{enumerable:!0,get:a(function(){return cu.ParameterStructures},"get")});var cDt=O2t();Object.defineProperty(Bt,"LinkedMap",{enumerable:!0,get:a(function(){return cDt.LinkedMap},"get")});Object.defineProperty(Bt,"LRUCache",{enumerable:!0,get:a(function(){return cDt.LRUCache},"get")});Object.defineProperty(Bt,"Touch",{enumerable:!0,get:a(function(){return cDt.Touch},"get")});var LAo=zVr();Object.defineProperty(Bt,"Disposable",{enumerable:!0,get:a(function(){return LAo.Disposable},"get")});var uWr=tse();Object.defineProperty(Bt,"Event",{enumerable:!0,get:a(function(){return uWr.Event},"get")});Object.defineProperty(Bt,"Emitter",{enumerable:!0,get:a(function(){return uWr.Emitter},"get")});var dWr=bUe();Object.defineProperty(Bt,"CancellationTokenSource",{enumerable:!0,get:a(function(){return dWr.CancellationTokenSource},"get")});Object.defineProperty(Bt,"CancellationToken",{enumerable:!0,get:a(function(){return dWr.CancellationToken},"get")});var fWr=KVr();Object.defineProperty(Bt,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return fWr.SharedArraySenderStrategy},"get")});Object.defineProperty(Bt,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return fWr.SharedArrayReceiverStrategy},"get")});var lDt=ZVr();Object.defineProperty(Bt,"MessageReader",{enumerable:!0,get:a(function(){return lDt.MessageReader},"get")});Object.defineProperty(Bt,"AbstractMessageReader",{enumerable:!0,get:a(function(){return lDt.AbstractMessageReader},"get")});Object.defineProperty(Bt,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return lDt.ReadableStreamMessageReader},"get")});var uDt=nWr();Object.defineProperty(Bt,"MessageWriter",{enumerable:!0,get:a(function(){return uDt.MessageWriter},"get")});Object.defineProperty(Bt,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return uDt.AbstractMessageWriter},"get")});Object.defineProperty(Bt,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return uDt.WriteableStreamMessageWriter},"get")});var BAo=iWr();Object.defineProperty(Bt,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return BAo.AbstractMessageBuffer},"get")});var gA=lWr();Object.defineProperty(Bt,"ConnectionStrategy",{enumerable:!0,get:a(function(){return gA.ConnectionStrategy},"get")});Object.defineProperty(Bt,"ConnectionOptions",{enumerable:!0,get:a(function(){return gA.ConnectionOptions},"get")});Object.defineProperty(Bt,"NullLogger",{enumerable:!0,get:a(function(){return gA.NullLogger},"get")});Object.defineProperty(Bt,"createMessageConnection",{enumerable:!0,get:a(function(){return gA.createMessageConnection},"get")});Object.defineProperty(Bt,"ProgressToken",{enumerable:!0,get:a(function(){return gA.ProgressToken},"get")});Object.defineProperty(Bt,"ProgressType",{enumerable:!0,get:a(function(){return gA.ProgressType},"get")});Object.defineProperty(Bt,"Trace",{enumerable:!0,get:a(function(){return gA.Trace},"get")});Object.defineProperty(Bt,"TraceValues",{enumerable:!0,get:a(function(){return gA.TraceValues},"get")});Object.defineProperty(Bt,"TraceFormat",{enumerable:!0,get:a(function(){return gA.TraceFormat},"get")});Object.defineProperty(Bt,"SetTraceNotification",{enumerable:!0,get:a(function(){return gA.SetTraceNotification},"get")});Object.defineProperty(Bt,"LogTraceNotification",{enumerable:!0,get:a(function(){return gA.LogTraceNotification},"get")});Object.defineProperty(Bt,"ConnectionErrors",{enumerable:!0,get:a(function(){return gA.ConnectionErrors},"get")});Object.defineProperty(Bt,"ConnectionError",{enumerable:!0,get:a(function(){return gA.ConnectionError},"get")});Object.defineProperty(Bt,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return gA.CancellationReceiverStrategy},"get")});Object.defineProperty(Bt,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return gA.CancellationSenderStrategy},"get")});Object.defineProperty(Bt,"CancellationStrategy",{enumerable:!0,get:a(function(){return gA.CancellationStrategy},"get")});Object.defineProperty(Bt,"MessageStrategy",{enumerable:!0,get:a(function(){return gA.MessageStrategy},"get")});var FAo=xU();Bt.RAL=FAo.default});var mWr=I(hDt=>{"use strict";p();Object.defineProperty(hDt,"__esModule",{value:!0});var pWr=require("util"),_B=MUe(),OUe=class t extends _B.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 pWr.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)}};OUe.emptyBuffer=Buffer.allocUnsafe(0);var dDt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),_B.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),_B.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),_B.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),_B.Disposable.create(()=>this.stream.off("data",e))}},fDt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),_B.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),_B.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),_B.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()}},hWr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new OUe(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 pWr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new dDt(t),"asReadableStream"),asWritableStream:a(t=>new fDt(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 pDt(){return hWr}a(pDt,"RIL");(function(t){function e(){_B.RAL.install(hWr)}a(e,"install"),t.install=e})(pDt||(pDt={}));hDt.default=pDt});var qW=I(Ia=>{"use strict";p();var UAo=Ia&&Ia.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Ia&&Ia.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UAo(e,t,r)};Object.defineProperty(Ia,"__esModule",{value:!0});Ia.createMessageConnection=Ia.createServerSocketTransport=Ia.createClientSocketTransport=Ia.createServerPipeTransport=Ia.createClientPipeTransport=Ia.generateRandomPipeName=Ia.StreamMessageWriter=Ia.StreamMessageReader=Ia.SocketMessageWriter=Ia.SocketMessageReader=Ia.PortMessageWriter=Ia.PortMessageReader=Ia.IPCMessageWriter=Ia.IPCMessageReader=void 0;var sse=mWr();sse.default.install();var gWr=require("path"),qAo=require("os"),jAo=require("crypto"),FUe=require("net"),$1=MUe();QAo(MUe(),Ia);var mDt=class extends $1.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),$1.Disposable.create(()=>this.process.off("message",e))}};Ia.IPCMessageReader=mDt;var gDt=class extends $1.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(){}};Ia.IPCMessageWriter=gDt;var ADt=class extends $1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new $1.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)}};Ia.PortMessageReader=ADt;var yDt=class extends $1.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(){}};Ia.PortMessageWriter=yDt;var UW=class extends $1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,sse.default)().stream.asReadableStream(e),r)}};Ia.SocketMessageReader=UW;var QW=class extends $1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,sse.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ia.SocketMessageWriter=QW;var LUe=class extends $1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,sse.default)().stream.asReadableStream(e),r)}};Ia.StreamMessageReader=LUe;var BUe=class extends $1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,sse.default)().stream.asWritableStream(e),r)}};Ia.StreamMessageWriter=BUe;var AWr=process.env.XDG_RUNTIME_DIR,HAo=new Map([["linux",107],["darwin",103]]);function GAo(){let t=(0,jAo.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;AWr?e=gWr.join(AWr,`vscode-ipc-${t}.sock`):e=gWr.join(qAo.tmpdir(),`vscode-${t}.sock`);let r=HAo.get(process.platform);return r!==void 0&&e.length>r&&(0,sse.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(GAo,"generateRandomPipeName");Ia.generateRandomPipeName=GAo;function $Ao(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,FUe.createServer)(l=>{c.close(),r([new UW(l,e),new QW(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a($Ao,"createClientPipeTransport");Ia.createClientPipeTransport=$Ao;function VAo(t,e="utf-8"){let r=(0,FUe.createConnection)(t);return[new UW(r,e),new QW(r,e)]}a(VAo,"createServerPipeTransport");Ia.createServerPipeTransport=VAo;function WAo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,FUe.createServer)(l=>{c.close(),r([new UW(l,e),new QW(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(WAo,"createClientSocketTransport");Ia.createClientSocketTransport=WAo;function zAo(t,e="utf-8"){let r=(0,FUe.createConnection)(t,"127.0.0.1");return[new UW(r,e),new QW(r,e)]}a(zAo,"createServerSocketTransport");Ia.createServerSocketTransport=zAo;function YAo(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a(YAo,"isReadableStream");function KAo(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(KAo,"isWritableStream");function JAo(t,e,r,n){r||(r=$1.NullLogger);let o=YAo(t)?new LUe(t):t,s=KAo(e)?new BUe(e):e;return $1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,$1.createMessageConnection)(o,s,r,n)}a(JAo,"createMessageConnection");Ia.createMessageConnection=JAo});var EDt=I((QIl,yWr)=>{"use strict";p();yWr.exports=qW()});var tbe=I((EWr,UUe)=>{p();(function(t){if(typeof UUe=="object"&&typeof UUe.exports=="object"){var e=t(require,EWr);e!==void 0&&(UUe.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(ae){function Re(Me){return typeof Me=="string"}a(Re,"is"),ae.is=Re})(r||(e.DocumentUri=r={}));var n;(function(ae){function Re(Me){return typeof Me=="string"}a(Re,"is"),ae.is=Re})(n||(e.URI=n={}));var o;(function(ae){ae.MIN_VALUE=-2147483648,ae.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ae.MIN_VALUE<=Me&&Me<=ae.MAX_VALUE}a(Re,"is"),ae.is=Re})(o||(e.integer=o={}));var s;(function(ae){ae.MIN_VALUE=0,ae.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ae.MIN_VALUE<=Me&&Me<=ae.MAX_VALUE}a(Re,"is"),ae.is=Re})(s||(e.uinteger=s={}));var c;(function(ae){function Re(ye,oe){return ye===Number.MAX_VALUE&&(ye=s.MAX_VALUE),oe===Number.MAX_VALUE&&(oe=s.MAX_VALUE),{line:ye,character:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.line)&&We.uinteger(oe.character)}a(Me,"is"),ae.is=Me})(c||(e.Position=c={}));var l;(function(ae){function Re(ye,oe,ze,at){if(We.uinteger(ye)&&We.uinteger(oe)&&We.uinteger(ze)&&We.uinteger(at))return{start:c.create(ye,oe),end:c.create(ze,at)};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(ze,", ").concat(at,"]"))}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&c.is(oe.start)&&c.is(oe.end)}a(Me,"is"),ae.is=Me})(l||(e.Range=l={}));var u;(function(ae){function Re(ye,oe){return{uri:ye,range:oe}}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(u||(e.Location=u={}));var d;(function(ae){function Re(ye,oe,ze,at){return{targetUri:ye,targetRange:oe,targetSelectionRange:ze,originSelectionRange:at}}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(d||(e.LocationLink=d={}));var f;(function(ae){function Re(ye,oe,ze,at){return{red:ye,green:oe,blue:ze,alpha:at}}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(f||(e.Color=f={}));var h;(function(ae){function Re(ye,oe){return{range:ye,color:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&f.is(oe.color)}a(Me,"is"),ae.is=Me})(h||(e.ColorInformation=h={}));var m;(function(ae){function Re(ye,oe,ze){return{label:ye,textEdit:oe,additionalTextEdits:ze}}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(m||(e.ColorPresentation=m={}));var g;(function(ae){ae.Comment="comment",ae.Imports="imports",ae.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(ae){function Re(ye,oe,ze,at,Vt,gr){var cr={startLine:ye,endLine:oe};return We.defined(ze)&&(cr.startCharacter=ze),We.defined(at)&&(cr.endCharacter=at),We.defined(Vt)&&(cr.kind=Vt),We.defined(gr)&&(cr.collapsedText=gr),cr}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(A||(e.FoldingRange=A={}));var y;(function(ae){function Re(ye,oe){return{location:ye,message:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&u.is(oe.location)&&We.string(oe.message)}a(Me,"is"),ae.is=Me})(y||(e.DiagnosticRelatedInformation=y={}));var E;(function(ae){ae.Error=1,ae.Warning=2,ae.Information=3,ae.Hint=4})(E||(e.DiagnosticSeverity=E={}));var _;(function(ae){ae.Unnecessary=1,ae.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(ae){function Re(Me){var ye=Me;return We.objectLiteral(ye)&&We.string(ye.href)}a(Re,"is"),ae.is=Re})(v||(e.CodeDescription=v={}));var b;(function(ae){function Re(ye,oe,ze,at,Vt,gr){var cr={range:ye,message:oe};return We.defined(ze)&&(cr.severity=ze),We.defined(at)&&(cr.code=at),We.defined(Vt)&&(cr.source=Vt),We.defined(gr)&&(cr.relatedInformation=gr),cr}a(Re,"create"),ae.create=Re;function Me(ye){var oe,ze=ye;return We.defined(ze)&&l.is(ze.range)&&We.string(ze.message)&&(We.number(ze.severity)||We.undefined(ze.severity))&&(We.integer(ze.code)||We.string(ze.code)||We.undefined(ze.code))&&(We.undefined(ze.codeDescription)||We.string((oe=ze.codeDescription)===null||oe===void 0?void 0:oe.href))&&(We.string(ze.source)||We.undefined(ze.source))&&(We.undefined(ze.relatedInformation)||We.typedArray(ze.relatedInformation,y.is))}a(Me,"is"),ae.is=Me})(b||(e.Diagnostic=b={}));var T;(function(ae){function Re(ye,oe){for(var ze=[],at=2;at0&&(Vt.arguments=ze),Vt}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.title)&&We.string(oe.command)}a(Me,"is"),ae.is=Me})(T||(e.Command=T={}));var w;(function(ae){function Re(ze,at){return{range:ze,newText:at}}a(Re,"replace"),ae.replace=Re;function Me(ze,at){return{range:{start:ze,end:ze},newText:at}}a(Me,"insert"),ae.insert=Me;function ye(ze){return{range:ze,newText:""}}a(ye,"del"),ae.del=ye;function oe(ze){var at=ze;return We.objectLiteral(at)&&We.string(at.newText)&&l.is(at.range)}a(oe,"is"),ae.is=oe})(w||(e.TextEdit=w={}));var R;(function(ae){function Re(ye,oe,ze){var at={label:ye};return oe!==void 0&&(at.needsConfirmation=oe),ze!==void 0&&(at.description=ze),at}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(R||(e.ChangeAnnotation=R={}));var x;(function(ae){function Re(Me){var ye=Me;return We.string(ye)}a(Re,"is"),ae.is=Re})(x||(e.ChangeAnnotationIdentifier=x={}));var P;(function(ae){function Re(ze,at,Vt){return{range:ze,newText:at,annotationId:Vt}}a(Re,"replace"),ae.replace=Re;function Me(ze,at,Vt){return{range:{start:ze,end:ze},newText:at,annotationId:Vt}}a(Me,"insert"),ae.insert=Me;function ye(ze,at){return{range:ze,newText:"",annotationId:at}}a(ye,"del"),ae.del=ye;function oe(ze){var at=ze;return w.is(at)&&(R.is(at.annotationId)||x.is(at.annotationId))}a(oe,"is"),ae.is=oe})(P||(e.AnnotatedTextEdit=P={}));var D;(function(ae){function Re(ye,oe){return{textDocument:ye,edits:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&Y.is(oe.textDocument)&&Array.isArray(oe.edits)}a(Me,"is"),ae.is=Me})(D||(e.TextDocumentEdit=D={}));var N;(function(ae){function Re(ye,oe,ze){var at={kind:"create",uri:ye};return oe!==void 0&&(oe.overwrite!==void 0||oe.ignoreIfExists!==void 0)&&(at.options=oe),ze!==void 0&&(at.annotationId=ze),at}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(N||(e.CreateFile=N={}));var L;(function(ae){function Re(ye,oe,ze,at){var Vt={kind:"rename",oldUri:ye,newUri:oe};return ze!==void 0&&(ze.overwrite!==void 0||ze.ignoreIfExists!==void 0)&&(Vt.options=ze),at!==void 0&&(Vt.annotationId=at),Vt}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(L||(e.RenameFile=L={}));var B;(function(ae){function Re(ye,oe,ze){var at={kind:"delete",uri:ye};return oe!==void 0&&(oe.recursive!==void 0||oe.ignoreIfNotExists!==void 0)&&(at.options=oe),ze!==void 0&&(at.annotationId=ze),at}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(B||(e.DeleteFile=B={}));var q;(function(ae){function Re(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)||L.is(oe)||B.is(oe):D.is(oe)}))}a(Re,"is"),ae.is=Re})(q||(e.WorkspaceEdit=q={}));var M=(function(){function ae(Re,Me){this.edits=Re,this.changeAnnotations=Me}return a(ae,"TextEditChangeImpl"),ae.prototype.insert=function(Re,Me,ye){var oe,ze;if(ye===void 0?oe=w.insert(Re,Me):x.is(ye)?(ze=ye,oe=P.insert(Re,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ye),oe=P.insert(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ae.prototype.replace=function(Re,Me,ye){var oe,ze;if(ye===void 0?oe=w.replace(Re,Me):x.is(ye)?(ze=ye,oe=P.replace(Re,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ye),oe=P.replace(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ae.prototype.delete=function(Re,Me){var ye,oe;if(Me===void 0?ye=w.del(Re):x.is(Me)?(oe=Me,ye=P.del(Re,Me)):(this.assertChangeAnnotations(this.changeAnnotations),oe=this.changeAnnotations.manage(Me),ye=P.del(Re,oe)),this.edits.push(ye),oe!==void 0)return oe},ae.prototype.add=function(Re){this.edits.push(Re)},ae.prototype.all=function(){return this.edits},ae.prototype.clear=function(){this.edits.splice(0,this.edits.length)},ae.prototype.assertChangeAnnotations=function(Re){if(Re===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},ae})(),O=(function(){function ae(Re){this._annotations=Re===void 0?Object.create(null):Re,this._counter=0,this._size=0}return a(ae,"ChangeAnnotations"),ae.prototype.all=function(){return this._annotations},Object.defineProperty(ae.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),ae.prototype.manage=function(Re,Me){var ye;if(x.is(Re)?ye=Re:(ye=this.nextId(),Me=Re),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},ae.prototype.nextId=function(){return this._counter++,this._counter.toString()},ae})(),j=(function(){function ae(Re){var Me=this;this._textEditChanges=Object.create(null),Re!==void 0?(this._workspaceEdit=Re,Re.documentChanges?(this._changeAnnotations=new O(Re.changeAnnotations),Re.changeAnnotations=this._changeAnnotations.all(),Re.documentChanges.forEach(function(ye){if(D.is(ye)){var oe=new M(ye.edits,Me._changeAnnotations);Me._textEditChanges[ye.textDocument.uri]=oe}})):Re.changes&&Object.keys(Re.changes).forEach(function(ye){var oe=new M(Re.changes[ye]);Me._textEditChanges[ye]=oe})):this._workspaceEdit={}}return a(ae,"WorkspaceChange"),Object.defineProperty(ae.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}),ae.prototype.getTextEditChange=function(Re){if(Y.is(Re)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Me={uri:Re.uri,version:Re.version},ye=this._textEditChanges[Me.uri];if(!ye){var oe=[],ze={textDocument:Me,edits:oe};this._workspaceEdit.documentChanges.push(ze),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[Re];if(!ye){var oe=[];this._workspaceEdit.changes[Re]=oe,ye=new M(oe),this._textEditChanges[Re]=ye}return ye}},ae.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new O,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},ae.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},ae.prototype.createFile=function(Re,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 ze,at;if(oe===void 0?ze=N.create(Re,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=N.create(Re,ye,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ae.prototype.renameFile=function(Re,Me,ye,oe){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var ze;R.is(ye)||x.is(ye)?ze=ye:oe=ye;var at,Vt;if(ze===void 0?at=L.create(Re,Me,oe):(Vt=x.is(ze)?ze:this._changeAnnotations.manage(ze),at=L.create(Re,Me,oe,Vt)),this._workspaceEdit.documentChanges.push(at),Vt!==void 0)return Vt},ae.prototype.deleteFile=function(Re,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 ze,at;if(oe===void 0?ze=B.create(Re,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=B.create(Re,ye,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ae})();e.WorkspaceChange=j;var Q;(function(ae){function Re(ye){return{uri:ye}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)}a(Me,"is"),ae.is=Me})(Q||(e.TextDocumentIdentifier=Q={}));var U;(function(ae){function Re(ye,oe){return{uri:ye,version:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.integer(oe.version)}a(Me,"is"),ae.is=Me})(U||(e.VersionedTextDocumentIdentifier=U={}));var Y;(function(ae){function Re(ye,oe){return{uri:ye,version:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&(oe.version===null||We.integer(oe.version))}a(Me,"is"),ae.is=Me})(Y||(e.OptionalVersionedTextDocumentIdentifier=Y={}));var W;(function(ae){function Re(ye,oe,ze,at){return{uri:ye,languageId:oe,version:ze,text:at}}a(Re,"create"),ae.create=Re;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"),ae.is=Me})(W||(e.TextDocumentItem=W={}));var V;(function(ae){ae.PlainText="plaintext",ae.Markdown="markdown";function Re(Me){var ye=Me;return ye===ae.PlainText||ye===ae.Markdown}a(Re,"is"),ae.is=Re})(V||(e.MarkupKind=V={}));var z;(function(ae){function Re(Me){var ye=Me;return We.objectLiteral(Me)&&V.is(ye.kind)&&We.string(ye.value)}a(Re,"is"),ae.is=Re})(z||(e.MarkupContent=z={}));var ie;(function(ae){ae.Text=1,ae.Method=2,ae.Function=3,ae.Constructor=4,ae.Field=5,ae.Variable=6,ae.Class=7,ae.Interface=8,ae.Module=9,ae.Property=10,ae.Unit=11,ae.Value=12,ae.Enum=13,ae.Keyword=14,ae.Snippet=15,ae.Color=16,ae.File=17,ae.Reference=18,ae.Folder=19,ae.EnumMember=20,ae.Constant=21,ae.Struct=22,ae.Event=23,ae.Operator=24,ae.TypeParameter=25})(ie||(e.CompletionItemKind=ie={}));var H;(function(ae){ae.PlainText=1,ae.Snippet=2})(H||(e.InsertTextFormat=H={}));var re;(function(ae){ae.Deprecated=1})(re||(e.CompletionItemTag=re={}));var le;(function(ae){function Re(ye,oe,ze){return{newText:ye,insert:oe,replace:ze}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return oe&&We.string(oe.newText)&&l.is(oe.insert)&&l.is(oe.replace)}a(Me,"is"),ae.is=Me})(le||(e.InsertReplaceEdit=le={}));var Le;(function(ae){ae.asIs=1,ae.adjustIndentation=2})(Le||(e.InsertTextMode=Le={}));var ge;(function(ae){function Re(Me){var ye=Me;return ye&&(We.string(ye.detail)||ye.detail===void 0)&&(We.string(ye.description)||ye.description===void 0)}a(Re,"is"),ae.is=Re})(ge||(e.CompletionItemLabelDetails=ge={}));var Ue;(function(ae){function Re(Me){return{label:Me}}a(Re,"create"),ae.create=Re})(Ue||(e.CompletionItem=Ue={}));var ke;(function(ae){function Re(Me,ye){return{items:Me||[],isIncomplete:!!ye}}a(Re,"create"),ae.create=Re})(ke||(e.CompletionList=ke={}));var X;(function(ae){function Re(ye){return ye.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(Re,"fromPlainText"),ae.fromPlainText=Re;function Me(ye){var oe=ye;return We.string(oe)||We.objectLiteral(oe)&&We.string(oe.language)&&We.string(oe.value)}a(Me,"is"),ae.is=Me})(X||(e.MarkedString=X={}));var ee;(function(ae){function Re(Me){var ye=Me;return!!ye&&We.objectLiteral(ye)&&(z.is(ye.contents)||X.is(ye.contents)||We.typedArray(ye.contents,X.is))&&(Me.range===void 0||l.is(Me.range))}a(Re,"is"),ae.is=Re})(ee||(e.Hover=ee={}));var K;(function(ae){function Re(Me,ye){return ye?{label:Me,documentation:ye}:{label:Me}}a(Re,"create"),ae.create=Re})(K||(e.ParameterInformation=K={}));var he;(function(ae){function Re(Me,ye){for(var oe=[],ze=2;ze=0;Mr--){var Hr=gr[Mr],Gr=ze.offsetAt(Hr.range.start),Yt=ze.offsetAt(Hr.range.end);if(Yt<=cr)Vt=Vt.substring(0,Gr)+Hr.newText+Vt.substring(Yt,Vt.length);else throw new Error("Overlapping edit");cr=Gr}return Vt}a(ye,"applyEdits"),ae.applyEdits=ye;function oe(ze,at){if(ze.length<=1)return ze;var Vt=ze.length/2|0,gr=ze.slice(0,Vt),cr=ze.slice(Vt);oe(gr,at),oe(cr,at);for(var Mr=0,Hr=0,Gr=0;Mr=0;Mr--){var Hr=gr[Mr],Gr=ze.offsetAt(Hr.range.start),Yt=ze.offsetAt(Hr.range.end);if(Yt<=cr)Vt=Vt.substring(0,Gr)+Hr.newText+Vt.substring(Yt,Vt.length);else throw new Error("Overlapping edit");cr=Gr}return Vt}a(ye,"applyEdits"),ae.applyEdits=ye;function oe(ze,at){if(ze.length<=1)return ze;var Vt=ze.length/2|0,gr=ze.slice(0,Vt),cr=ze.slice(Vt);oe(gr,at),oe(cr,at);for(var Mr=0,Hr=0,Gr=0;Mr0&&Re.push(Me.length),this._lineOffsets=Re}return this._lineOffsets},ae.prototype.positionAt=function(Re){Re=Math.max(Math.min(Re,this._content.length),0);var Me=this.getLineOffsets(),ye=0,oe=Me.length;if(oe===0)return c.create(0,Re);for(;yeRe?oe=ze:ye=ze+1}var at=ye-1;return c.create(at,Re-Me[at])},ae.prototype.offsetAt=function(Re){var Me=this.getLineOffsets();if(Re.line>=Me.length)return this._content.length;if(Re.line<0)return 0;var ye=Me[Re.line],oe=Re.line+1"u"}a(ye,"undefined"),ae.undefined=ye;function oe(Yt){return Yt===!0||Yt===!1}a(oe,"boolean"),ae.boolean=oe;function ze(Yt){return Re.call(Yt)==="[object String]"}a(ze,"string"),ae.string=ze;function at(Yt){return Re.call(Yt)==="[object Number]"}a(at,"number"),ae.number=at;function Vt(Yt,_r,$0){return Re.call(Yt)==="[object Number]"&&_r<=Yt&&Yt<=$0}a(Vt,"numberRange"),ae.numberRange=Vt;function gr(Yt){return Re.call(Yt)==="[object Number]"&&-2147483648<=Yt&&Yt<=2147483647}a(gr,"integer"),ae.integer=gr;function cr(Yt){return Re.call(Yt)==="[object Number]"&&0<=Yt&&Yt<=2147483647}a(cr,"uinteger"),ae.uinteger=cr;function Mr(Yt){return Re.call(Yt)==="[object Function]"}a(Mr,"func"),ae.func=Mr;function Hr(Yt){return Yt!==null&&typeof Yt=="object"}a(Hr,"objectLiteral"),ae.objectLiteral=Hr;function Gr(Yt,_r){return Array.isArray(Yt)&&Yt.every(_r)}a(Gr,"typedArray"),ae.typedArray=Gr})(We||(We={}))})});var Pd=I(uC=>{"use strict";p();Object.defineProperty(uC,"__esModule",{value:!0});uC.ProtocolNotificationType=uC.ProtocolNotificationType0=uC.ProtocolRequestType=uC.ProtocolRequestType0=uC.RegistrationType=uC.MessageDirection=void 0;var ase=QW(),EWr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(EWr||(uC.MessageDirection=EWr={}));var EDt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};uC.RegistrationType=EDt;var _Dt=class extends ase.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};uC.ProtocolRequestType0=_Dt;var vDt=class extends ase.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,ase.ParameterStructures.byName)}};uC.ProtocolRequestType=vDt;var CDt=class extends ase.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};uC.ProtocolNotificationType0=CDt;var bDt=class extends ase.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,ase.ParameterStructures.byName)}};uC.ProtocolNotificationType=bDt});var FUe=I(wh=>{"use strict";p();Object.defineProperty(wh,"__esModule",{value:!0});wh.objectLiteral=wh.typedArray=wh.stringArray=wh.array=wh.func=wh.error=wh.number=wh.string=wh.boolean=void 0;function zAo(t){return t===!0||t===!1}a(zAo,"boolean");wh.boolean=zAo;function _Wr(t){return typeof t=="string"||t instanceof String}a(_Wr,"string");wh.string=_Wr;function YAo(t){return typeof t=="number"||t instanceof Number}a(YAo,"number");wh.number=YAo;function KAo(t){return t instanceof Error}a(KAo,"error");wh.error=KAo;function JAo(t){return typeof t=="function"}a(JAo,"func");wh.func=JAo;function vWr(t){return Array.isArray(t)}a(vWr,"array");wh.array=vWr;function ZAo(t){return vWr(t)&&t.every(e=>_Wr(e))}a(ZAo,"stringArray");wh.stringArray=ZAo;function XAo(t,e){return Array.isArray(t)&&t.every(e)}a(XAo,"typedArray");wh.typedArray=XAo;function eyo(t){return t!==null&&typeof t=="object"}a(eyo,"objectLiteral");wh.objectLiteral=eyo});var SWr=I(UUe=>{"use strict";p();Object.defineProperty(UUe,"__esModule",{value:!0});UUe.ImplementationRequest=void 0;var CWr=Pd(),bWr;(function(t){t.method="textDocument/implementation",t.messageDirection=CWr.MessageDirection.clientToServer,t.type=new CWr.ProtocolRequestType(t.method)})(bWr||(UUe.ImplementationRequest=bWr={}))});var xWr=I(QUe=>{"use strict";p();Object.defineProperty(QUe,"__esModule",{value:!0});QUe.TypeDefinitionRequest=void 0;var TWr=Pd(),IWr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=TWr.MessageDirection.clientToServer,t.type=new TWr.ProtocolRequestType(t.method)})(IWr||(QUe.TypeDefinitionRequest=IWr={}))});var kWr=I(cse=>{"use strict";p();Object.defineProperty(cse,"__esModule",{value:!0});cse.DidChangeWorkspaceFoldersNotification=cse.WorkspaceFoldersRequest=void 0;var qUe=Pd(),wWr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=qUe.MessageDirection.serverToClient,t.type=new qUe.ProtocolRequestType0(t.method)})(wWr||(cse.WorkspaceFoldersRequest=wWr={}));var RWr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=qUe.MessageDirection.clientToServer,t.type=new qUe.ProtocolNotificationType(t.method)})(RWr||(cse.DidChangeWorkspaceFoldersNotification=RWr={}))});var NWr=I(jUe=>{"use strict";p();Object.defineProperty(jUe,"__esModule",{value:!0});jUe.ConfigurationRequest=void 0;var PWr=Pd(),DWr;(function(t){t.method="workspace/configuration",t.messageDirection=PWr.MessageDirection.serverToClient,t.type=new PWr.ProtocolRequestType(t.method)})(DWr||(jUe.ConfigurationRequest=DWr={}))});var LWr=I(lse=>{"use strict";p();Object.defineProperty(lse,"__esModule",{value:!0});lse.ColorPresentationRequest=lse.DocumentColorRequest=void 0;var HUe=Pd(),MWr;(function(t){t.method="textDocument/documentColor",t.messageDirection=HUe.MessageDirection.clientToServer,t.type=new HUe.ProtocolRequestType(t.method)})(MWr||(lse.DocumentColorRequest=MWr={}));var OWr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=HUe.MessageDirection.clientToServer,t.type=new HUe.ProtocolRequestType(t.method)})(OWr||(lse.ColorPresentationRequest=OWr={}))});var UWr=I(use=>{"use strict";p();Object.defineProperty(use,"__esModule",{value:!0});use.FoldingRangeRefreshRequest=use.FoldingRangeRequest=void 0;var GUe=Pd(),BWr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=GUe.MessageDirection.clientToServer,t.type=new GUe.ProtocolRequestType(t.method)})(BWr||(use.FoldingRangeRequest=BWr={}));var FWr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=GUe.MessageDirection.serverToClient,t.type=new GUe.ProtocolRequestType0(t.method)})(FWr||(use.FoldingRangeRefreshRequest=FWr={}))});var jWr=I($Ue=>{"use strict";p();Object.defineProperty($Ue,"__esModule",{value:!0});$Ue.DeclarationRequest=void 0;var QWr=Pd(),qWr;(function(t){t.method="textDocument/declaration",t.messageDirection=QWr.MessageDirection.clientToServer,t.type=new QWr.ProtocolRequestType(t.method)})(qWr||($Ue.DeclarationRequest=qWr={}))});var $Wr=I(VUe=>{"use strict";p();Object.defineProperty(VUe,"__esModule",{value:!0});VUe.SelectionRangeRequest=void 0;var HWr=Pd(),GWr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=HWr.MessageDirection.clientToServer,t.type=new HWr.ProtocolRequestType(t.method)})(GWr||(VUe.SelectionRangeRequest=GWr={}))});var YWr=I(RU=>{"use strict";p();Object.defineProperty(RU,"__esModule",{value:!0});RU.WorkDoneProgressCancelNotification=RU.WorkDoneProgressCreateRequest=RU.WorkDoneProgress=void 0;var tyo=QW(),WUe=Pd(),VWr;(function(t){t.type=new tyo.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(VWr||(RU.WorkDoneProgress=VWr={}));var WWr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=WUe.MessageDirection.serverToClient,t.type=new WUe.ProtocolRequestType(t.method)})(WWr||(RU.WorkDoneProgressCreateRequest=WWr={}));var zWr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=WUe.MessageDirection.clientToServer,t.type=new WUe.ProtocolNotificationType(t.method)})(zWr||(RU.WorkDoneProgressCancelNotification=zWr={}))});var XWr=I(kU=>{"use strict";p();Object.defineProperty(kU,"__esModule",{value:!0});kU.CallHierarchyOutgoingCallsRequest=kU.CallHierarchyIncomingCallsRequest=kU.CallHierarchyPrepareRequest=void 0;var dse=Pd(),KWr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(KWr||(kU.CallHierarchyPrepareRequest=KWr={}));var JWr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(JWr||(kU.CallHierarchyIncomingCallsRequest=JWr={}));var ZWr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(ZWr||(kU.CallHierarchyOutgoingCallsRequest=ZWr={}))});var ozr=I(dC=>{"use strict";p();Object.defineProperty(dC,"__esModule",{value:!0});dC.SemanticTokensRefreshRequest=dC.SemanticTokensRangeRequest=dC.SemanticTokensDeltaRequest=dC.SemanticTokensRequest=dC.SemanticTokensRegistrationType=dC.TokenFormat=void 0;var vB=Pd(),ezr;(function(t){t.Relative="relative"})(ezr||(dC.TokenFormat=ezr={}));var tbe;(function(t){t.method="textDocument/semanticTokens",t.type=new vB.RegistrationType(t.method)})(tbe||(dC.SemanticTokensRegistrationType=tbe={}));var tzr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=tbe.method})(tzr||(dC.SemanticTokensRequest=tzr={}));var rzr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=tbe.method})(rzr||(dC.SemanticTokensDeltaRequest=rzr={}));var nzr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=tbe.method})(nzr||(dC.SemanticTokensRangeRequest=nzr={}));var izr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=vB.MessageDirection.serverToClient,t.type=new vB.ProtocolRequestType0(t.method)})(izr||(dC.SemanticTokensRefreshRequest=izr={}))});var czr=I(zUe=>{"use strict";p();Object.defineProperty(zUe,"__esModule",{value:!0});zUe.ShowDocumentRequest=void 0;var szr=Pd(),azr;(function(t){t.method="window/showDocument",t.messageDirection=szr.MessageDirection.serverToClient,t.type=new szr.ProtocolRequestType(t.method)})(azr||(zUe.ShowDocumentRequest=azr={}))});var dzr=I(YUe=>{"use strict";p();Object.defineProperty(YUe,"__esModule",{value:!0});YUe.LinkedEditingRangeRequest=void 0;var lzr=Pd(),uzr;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=lzr.MessageDirection.clientToServer,t.type=new lzr.ProtocolRequestType(t.method)})(uzr||(YUe.LinkedEditingRangeRequest=uzr={}))});var Ezr=I(Hy=>{"use strict";p();Object.defineProperty(Hy,"__esModule",{value:!0});Hy.WillDeleteFilesRequest=Hy.DidDeleteFilesNotification=Hy.DidRenameFilesNotification=Hy.WillRenameFilesRequest=Hy.DidCreateFilesNotification=Hy.WillCreateFilesRequest=Hy.FileOperationPatternKind=void 0;var YI=Pd(),fzr;(function(t){t.file="file",t.folder="folder"})(fzr||(Hy.FileOperationPatternKind=fzr={}));var pzr;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolRequestType(t.method)})(pzr||(Hy.WillCreateFilesRequest=pzr={}));var hzr;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolNotificationType(t.method)})(hzr||(Hy.DidCreateFilesNotification=hzr={}));var mzr;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolRequestType(t.method)})(mzr||(Hy.WillRenameFilesRequest=mzr={}));var gzr;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolNotificationType(t.method)})(gzr||(Hy.DidRenameFilesNotification=gzr={}));var Azr;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolNotificationType(t.method)})(Azr||(Hy.DidDeleteFilesNotification=Azr={}));var yzr;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolRequestType(t.method)})(yzr||(Hy.WillDeleteFilesRequest=yzr={}))});var Szr=I(PU=>{"use strict";p();Object.defineProperty(PU,"__esModule",{value:!0});PU.MonikerRequest=PU.MonikerKind=PU.UniquenessLevel=void 0;var _zr=Pd(),vzr;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(vzr||(PU.UniquenessLevel=vzr={}));var Czr;(function(t){t.$import="import",t.$export="export",t.local="local"})(Czr||(PU.MonikerKind=Czr={}));var bzr;(function(t){t.method="textDocument/moniker",t.messageDirection=_zr.MessageDirection.clientToServer,t.type=new _zr.ProtocolRequestType(t.method)})(bzr||(PU.MonikerRequest=bzr={}))});var wzr=I(DU=>{"use strict";p();Object.defineProperty(DU,"__esModule",{value:!0});DU.TypeHierarchySubtypesRequest=DU.TypeHierarchySupertypesRequest=DU.TypeHierarchyPrepareRequest=void 0;var fse=Pd(),Tzr;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(Tzr||(DU.TypeHierarchyPrepareRequest=Tzr={}));var Izr;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(Izr||(DU.TypeHierarchySupertypesRequest=Izr={}));var xzr;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(xzr||(DU.TypeHierarchySubtypesRequest=xzr={}))});var Pzr=I(pse=>{"use strict";p();Object.defineProperty(pse,"__esModule",{value:!0});pse.InlineValueRefreshRequest=pse.InlineValueRequest=void 0;var KUe=Pd(),Rzr;(function(t){t.method="textDocument/inlineValue",t.messageDirection=KUe.MessageDirection.clientToServer,t.type=new KUe.ProtocolRequestType(t.method)})(Rzr||(pse.InlineValueRequest=Rzr={}));var kzr;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=KUe.MessageDirection.serverToClient,t.type=new KUe.ProtocolRequestType0(t.method)})(kzr||(pse.InlineValueRefreshRequest=kzr={}))});var Ozr=I(NU=>{"use strict";p();Object.defineProperty(NU,"__esModule",{value:!0});NU.InlayHintRefreshRequest=NU.InlayHintResolveRequest=NU.InlayHintRequest=void 0;var hse=Pd(),Dzr;(function(t){t.method="textDocument/inlayHint",t.messageDirection=hse.MessageDirection.clientToServer,t.type=new hse.ProtocolRequestType(t.method)})(Dzr||(NU.InlayHintRequest=Dzr={}));var Nzr;(function(t){t.method="inlayHint/resolve",t.messageDirection=hse.MessageDirection.clientToServer,t.type=new hse.ProtocolRequestType(t.method)})(Nzr||(NU.InlayHintResolveRequest=Nzr={}));var Mzr;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=hse.MessageDirection.serverToClient,t.type=new hse.ProtocolRequestType0(t.method)})(Mzr||(NU.InlayHintRefreshRequest=Mzr={}))});var jzr=I(KI=>{"use strict";p();Object.defineProperty(KI,"__esModule",{value:!0});KI.DiagnosticRefreshRequest=KI.WorkspaceDiagnosticRequest=KI.DocumentDiagnosticRequest=KI.DocumentDiagnosticReportKind=KI.DiagnosticServerCancellationData=void 0;var qzr=QW(),ryo=FUe(),mse=Pd(),Lzr;(function(t){function e(r){let n=r;return n&&ryo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(Lzr||(KI.DiagnosticServerCancellationData=Lzr={}));var Bzr;(function(t){t.Full="full",t.Unchanged="unchanged"})(Bzr||(KI.DocumentDiagnosticReportKind=Bzr={}));var Fzr;(function(t){t.method="textDocument/diagnostic",t.messageDirection=mse.MessageDirection.clientToServer,t.type=new mse.ProtocolRequestType(t.method),t.partialResult=new qzr.ProgressType})(Fzr||(KI.DocumentDiagnosticRequest=Fzr={}));var Uzr;(function(t){t.method="workspace/diagnostic",t.messageDirection=mse.MessageDirection.clientToServer,t.type=new mse.ProtocolRequestType(t.method),t.partialResult=new qzr.ProgressType})(Uzr||(KI.WorkspaceDiagnosticRequest=Uzr={}));var Qzr;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=mse.MessageDirection.serverToClient,t.type=new mse.ProtocolRequestType0(t.method)})(Qzr||(KI.DiagnosticRefreshRequest=Qzr={}))});var Yzr=I(Hf=>{"use strict";p();Object.defineProperty(Hf,"__esModule",{value:!0});Hf.DidCloseNotebookDocumentNotification=Hf.DidSaveNotebookDocumentNotification=Hf.DidChangeNotebookDocumentNotification=Hf.NotebookCellArrayChange=Hf.DidOpenNotebookDocumentNotification=Hf.NotebookDocumentSyncRegistrationType=Hf.NotebookDocument=Hf.NotebookCell=Hf.ExecutionSummary=Hf.NotebookCellKind=void 0;var rbe=ebe(),Vk=FUe(),iM=Pd(),SDt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(SDt||(Hf.NotebookCellKind=SDt={}));var TDt;(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 Vk.objectLiteral(s)&&rbe.uinteger.is(s.executionOrder)&&(s.success===void 0||Vk.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})(TDt||(Hf.ExecutionSummary=TDt={}));var JUe;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return Vk.objectLiteral(c)&&SDt.is(c.kind)&&rbe.DocumentUri.is(c.document)&&(c.metadata===void 0||Vk.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)&&!TDt.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(ZUe,"__esModule",{value:!0});ZUe.InlineCompletionRequest=void 0;var Kzr=Pd(),Jzr;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Kzr.MessageDirection.clientToServer,t.type=new Kzr.ProtocolRequestType(t.method)})(Jzr||(ZUe.InlineCompletionRequest=Jzr={}))});var dKr=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 br=Pd(),Xzr=ebe(),Z0=FUe(),nyo=SWr();Object.defineProperty(Ve,"ImplementationRequest",{enumerable:!0,get:a(function(){return nyo.ImplementationRequest},"get")});var iyo=xWr();Object.defineProperty(Ve,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return iyo.TypeDefinitionRequest},"get")});var aKr=kWr();Object.defineProperty(Ve,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return aKr.WorkspaceFoldersRequest},"get")});Object.defineProperty(Ve,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return aKr.DidChangeWorkspaceFoldersNotification},"get")});var oyo=NWr();Object.defineProperty(Ve,"ConfigurationRequest",{enumerable:!0,get:a(function(){return oyo.ConfigurationRequest},"get")});var cKr=LWr();Object.defineProperty(Ve,"DocumentColorRequest",{enumerable:!0,get:a(function(){return cKr.DocumentColorRequest},"get")});Object.defineProperty(Ve,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return cKr.ColorPresentationRequest},"get")});var lKr=UWr();Object.defineProperty(Ve,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return lKr.FoldingRangeRequest},"get")});Object.defineProperty(Ve,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return lKr.FoldingRangeRefreshRequest},"get")});var syo=jWr();Object.defineProperty(Ve,"DeclarationRequest",{enumerable:!0,get:a(function(){return syo.DeclarationRequest},"get")});var ayo=$Wr();Object.defineProperty(Ve,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return ayo.SelectionRangeRequest},"get")});var kDt=YWr();Object.defineProperty(Ve,"WorkDoneProgress",{enumerable:!0,get:a(function(){return kDt.WorkDoneProgress},"get")});Object.defineProperty(Ve,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return kDt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Ve,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return kDt.WorkDoneProgressCancelNotification},"get")});var PDt=XWr();Object.defineProperty(Ve,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return PDt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return PDt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return PDt.CallHierarchyPrepareRequest},"get")});var Ase=ozr();Object.defineProperty(Ve,"TokenFormat",{enumerable:!0,get:a(function(){return Ase.TokenFormat},"get")});Object.defineProperty(Ve,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRequest},"get")});Object.defineProperty(Ve,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRangeRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRegistrationType},"get")});var cyo=czr();Object.defineProperty(Ve,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return cyo.ShowDocumentRequest},"get")});var lyo=dzr();Object.defineProperty(Ve,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return lyo.LinkedEditingRangeRequest},"get")});var qW=Ezr();Object.defineProperty(Ve,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return qW.FileOperationPatternKind},"get")});Object.defineProperty(Ve,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return qW.DidCreateFilesNotification},"get")});Object.defineProperty(Ve,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return qW.WillCreateFilesRequest},"get")});Object.defineProperty(Ve,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return qW.DidRenameFilesNotification},"get")});Object.defineProperty(Ve,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return qW.WillRenameFilesRequest},"get")});Object.defineProperty(Ve,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return qW.DidDeleteFilesNotification},"get")});Object.defineProperty(Ve,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return qW.WillDeleteFilesRequest},"get")});var DDt=Szr();Object.defineProperty(Ve,"UniquenessLevel",{enumerable:!0,get:a(function(){return DDt.UniquenessLevel},"get")});Object.defineProperty(Ve,"MonikerKind",{enumerable:!0,get:a(function(){return DDt.MonikerKind},"get")});Object.defineProperty(Ve,"MonikerRequest",{enumerable:!0,get:a(function(){return DDt.MonikerRequest},"get")});var NDt=wzr();Object.defineProperty(Ve,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return NDt.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return NDt.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return NDt.TypeHierarchySupertypesRequest},"get")});var uKr=Pzr();Object.defineProperty(Ve,"InlineValueRequest",{enumerable:!0,get:a(function(){return uKr.InlineValueRequest},"get")});Object.defineProperty(Ve,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return uKr.InlineValueRefreshRequest},"get")});var MDt=Ozr();Object.defineProperty(Ve,"InlayHintRequest",{enumerable:!0,get:a(function(){return MDt.InlayHintRequest},"get")});Object.defineProperty(Ve,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return MDt.InlayHintResolveRequest},"get")});Object.defineProperty(Ve,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return MDt.InlayHintRefreshRequest},"get")});var nbe=jzr();Object.defineProperty(Ve,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return nbe.DiagnosticServerCancellationData},"get")});Object.defineProperty(Ve,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return nbe.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Ve,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return nbe.DocumentDiagnosticRequest},"get")});Object.defineProperty(Ve,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return nbe.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Ve,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return nbe.DiagnosticRefreshRequest},"get")});var oM=Yzr();Object.defineProperty(Ve,"NotebookCellKind",{enumerable:!0,get:a(function(){return oM.NotebookCellKind},"get")});Object.defineProperty(Ve,"ExecutionSummary",{enumerable:!0,get:a(function(){return oM.ExecutionSummary},"get")});Object.defineProperty(Ve,"NotebookCell",{enumerable:!0,get:a(function(){return oM.NotebookCell},"get")});Object.defineProperty(Ve,"NotebookDocument",{enumerable:!0,get:a(function(){return oM.NotebookDocument},"get")});Object.defineProperty(Ve,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return oM.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Ve,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return oM.NotebookCellArrayChange},"get")});Object.defineProperty(Ve,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidCloseNotebookDocumentNotification},"get")});var uyo=Zzr();Object.defineProperty(Ve,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return uyo.InlineCompletionRequest},"get")});var IDt;(function(t){function e(r){let n=r;return Z0.string(n)||Z0.string(n.language)||Z0.string(n.scheme)||Z0.string(n.pattern)}a(e,"is"),t.is=e})(IDt||(Ve.TextDocumentFilter=IDt={}));var xDt;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(Z0.string(n.notebookType)||Z0.string(n.scheme)||Z0.string(n.pattern))}a(e,"is"),t.is=e})(xDt||(Ve.NotebookDocumentFilter=xDt={}));var wDt;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(Z0.string(n.notebook)||xDt.is(n.notebook))&&(n.language===void 0||Z0.string(n.language))}a(e,"is"),t.is=e})(wDt||(Ve.NotebookCellTextDocumentFilter=wDt={}));var RDt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Z0.string(n)&&!IDt.is(n)&&!wDt.is(n))return!1;return!0}a(e,"is"),t.is=e})(RDt||(Ve.DocumentSelector=RDt={}));var eYr;(function(t){t.method="client/registerCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(eYr||(Ve.RegistrationRequest=eYr={}));var tYr;(function(t){t.method="client/unregisterCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(tYr||(Ve.UnregistrationRequest=tYr={}));var rYr;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(rYr||(Ve.ResourceOperationKind=rYr={}));var nYr;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(nYr||(Ve.FailureHandlingKind=nYr={}));var iYr;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(iYr||(Ve.PositionEncodingKind=iYr={}));var oYr;(function(t){function e(r){let n=r;return n&&Z0.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(oYr||(Ve.StaticRegistrationOptions=oYr={}));var sYr;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||RDt.is(n.documentSelector))}a(e,"is"),t.is=e})(sYr||(Ve.TextDocumentRegistrationOptions=sYr={}));var aYr;(function(t){function e(n){let o=n;return Z0.objectLiteral(o)&&(o.workDoneProgress===void 0||Z0.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&Z0.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(aYr||(Ve.WorkDoneProgressOptions=aYr={}));var cYr;(function(t){t.method="initialize",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(cYr||(Ve.InitializeRequest=cYr={}));var lYr;(function(t){t.unknownProtocolVersion=1})(lYr||(Ve.InitializeErrorCodes=lYr={}));var uYr;(function(t){t.method="initialized",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(uYr||(Ve.InitializedNotification=uYr={}));var dYr;(function(t){t.method="shutdown",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType0(t.method)})(dYr||(Ve.ShutdownRequest=dYr={}));var fYr;(function(t){t.method="exit",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType0(t.method)})(fYr||(Ve.ExitNotification=fYr={}));var pYr;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(pYr||(Ve.DidChangeConfigurationNotification=pYr={}));var hYr;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(hYr||(Ve.MessageType=hYr={}));var mYr;(function(t){t.method="window/showMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(mYr||(Ve.ShowMessageNotification=mYr={}));var gYr;(function(t){t.method="window/showMessageRequest",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(gYr||(Ve.ShowMessageRequest=gYr={}));var AYr;(function(t){t.method="window/logMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(AYr||(Ve.LogMessageNotification=AYr={}));var yYr;(function(t){t.method="telemetry/event",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(yYr||(Ve.TelemetryEventNotification=yYr={}));var EYr;(function(t){t.None=0,t.Full=1,t.Incremental=2})(EYr||(Ve.TextDocumentSyncKind=EYr={}));var _Yr;(function(t){t.method="textDocument/didOpen",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(_Yr||(Ve.DidOpenTextDocumentNotification=_Yr={}));var vYr;(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})(vYr||(Ve.TextDocumentContentChangeEvent=vYr={}));var CYr;(function(t){t.method="textDocument/didChange",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(CYr||(Ve.DidChangeTextDocumentNotification=CYr={}));var bYr;(function(t){t.method="textDocument/didClose",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(bYr||(Ve.DidCloseTextDocumentNotification=bYr={}));var SYr;(function(t){t.method="textDocument/didSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(SYr||(Ve.DidSaveTextDocumentNotification=SYr={}));var TYr;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(TYr||(Ve.TextDocumentSaveReason=TYr={}));var IYr;(function(t){t.method="textDocument/willSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(IYr||(Ve.WillSaveTextDocumentNotification=IYr={}));var xYr;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(xYr||(Ve.WillSaveTextDocumentWaitUntilRequest=xYr={}));var wYr;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(wYr||(Ve.DidChangeWatchedFilesNotification=wYr={}));var RYr;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(RYr||(Ve.FileChangeType=RYr={}));var kYr;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(Xzr.URI.is(n.baseUri)||Xzr.WorkspaceFolder.is(n.baseUri))&&Z0.string(n.pattern)}a(e,"is"),t.is=e})(kYr||(Ve.RelativePattern=kYr={}));var PYr;(function(t){t.Create=1,t.Change=2,t.Delete=4})(PYr||(Ve.WatchKind=PYr={}));var DYr;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(DYr||(Ve.PublishDiagnosticsNotification=DYr={}));var NYr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(NYr||(Ve.CompletionTriggerKind=NYr={}));var MYr;(function(t){t.method="textDocument/completion",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(MYr||(Ve.CompletionRequest=MYr={}));var OYr;(function(t){t.method="completionItem/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(OYr||(Ve.CompletionResolveRequest=OYr={}));var LYr;(function(t){t.method="textDocument/hover",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(LYr||(Ve.HoverRequest=LYr={}));var BYr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(BYr||(Ve.SignatureHelpTriggerKind=BYr={}));var FYr;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(FYr||(Ve.SignatureHelpRequest=FYr={}));var UYr;(function(t){t.method="textDocument/definition",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(UYr||(Ve.DefinitionRequest=UYr={}));var QYr;(function(t){t.method="textDocument/references",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(QYr||(Ve.ReferencesRequest=QYr={}));var qYr;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(qYr||(Ve.DocumentHighlightRequest=qYr={}));var jYr;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(jYr||(Ve.DocumentSymbolRequest=jYr={}));var HYr;(function(t){t.method="textDocument/codeAction",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(HYr||(Ve.CodeActionRequest=HYr={}));var GYr;(function(t){t.method="codeAction/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(GYr||(Ve.CodeActionResolveRequest=GYr={}));var $Yr;(function(t){t.method="workspace/symbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})($Yr||(Ve.WorkspaceSymbolRequest=$Yr={}));var VYr;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(VYr||(Ve.WorkspaceSymbolResolveRequest=VYr={}));var WYr;(function(t){t.method="textDocument/codeLens",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(WYr||(Ve.CodeLensRequest=WYr={}));var zYr;(function(t){t.method="codeLens/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(zYr||(Ve.CodeLensResolveRequest=zYr={}));var YYr;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType0(t.method)})(YYr||(Ve.CodeLensRefreshRequest=YYr={}));var KYr;(function(t){t.method="textDocument/documentLink",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(KYr||(Ve.DocumentLinkRequest=KYr={}));var JYr;(function(t){t.method="documentLink/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(JYr||(Ve.DocumentLinkResolveRequest=JYr={}));var ZYr;(function(t){t.method="textDocument/formatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(ZYr||(Ve.DocumentFormattingRequest=ZYr={}));var XYr;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(XYr||(Ve.DocumentRangeFormattingRequest=XYr={}));var eKr;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(eKr||(Ve.DocumentRangesFormattingRequest=eKr={}));var tKr;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(tKr||(Ve.DocumentOnTypeFormattingRequest=tKr={}));var rKr;(function(t){t.Identifier=1})(rKr||(Ve.PrepareSupportDefaultBehavior=rKr={}));var nKr;(function(t){t.method="textDocument/rename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(nKr||(Ve.RenameRequest=nKr={}));var iKr;(function(t){t.method="textDocument/prepareRename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(iKr||(Ve.PrepareRenameRequest=iKr={}));var oKr;(function(t){t.method="workspace/executeCommand",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(oKr||(Ve.ExecuteCommandRequest=oKr={}));var sKr;(function(t){t.method="workspace/applyEdit",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType("workspace/applyEdit")})(sKr||(Ve.ApplyWorkspaceEditRequest=sKr={}))});var pKr=I(XUe=>{"use strict";p();Object.defineProperty(XUe,"__esModule",{value:!0});XUe.createProtocolConnection=void 0;var fKr=QW();function dyo(t,e,r,n){return fKr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,fKr.createMessageConnection)(t,e,r,n)}a(dyo,"createProtocolConnection");XUe.createProtocolConnection=dyo});var mKr=I(fC=>{"use strict";p();var fyo=fC&&fC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),e7e=fC&&fC.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fyo(e,t,r)};Object.defineProperty(fC,"__esModule",{value:!0});fC.LSPErrorCodes=fC.createProtocolConnection=void 0;e7e(QW(),fC);e7e(ebe(),fC);e7e(Pd(),fC);e7e(dKr(),fC);var pyo=pKr();Object.defineProperty(fC,"createProtocolConnection",{enumerable:!0,get:a(function(){return pyo.createProtocolConnection},"get")});var hKr;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(hKr||(fC.LSPErrorCodes=hKr={}))});var ri=I(sM=>{"use strict";p();var hyo=sM&&sM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gKr=sM&&sM.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hyo(e,t,r)};Object.defineProperty(sM,"__esModule",{value:!0});sM.createProtocolConnection=void 0;var myo=yDt();gKr(yDt(),sM);gKr(mKr(),sM);function gyo(t,e,r,n){return(0,myo.createMessageConnection)(t,e,r,n)}a(gyo,"createProtocolConnection");sM.createProtocolConnection=gyo});var q5t=I(kje=>{"use strict";p();Object.defineProperty(kje,"__esModule",{value:!0});kje.state=void 0;kje.state={instrumenterImplementation:void 0}});var Tce=I((_Bt,_nn)=>{p();var kHe=require("buffer"),HM=kHe.Buffer;function Enn(t,e){for(var r in t)e[r]=t[r]}a(Enn,"copyProps");HM.from&&HM.alloc&&HM.allocUnsafe&&HM.allocUnsafeSlow?_nn.exports=kHe:(Enn(kHe,_Bt),_Bt.Buffer=vY);function vY(t,e,r){return HM(t,e,r)}a(vY,"SafeBuffer");vY.prototype=Object.create(HM.prototype);Enn(HM,vY);vY.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return HM(t,e,r)};vY.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=HM(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};vY.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return HM(t)};vY.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return kHe.SlowBuffer(t)}});var vBt=I((ZJl,vnn)=>{p();var PHe=Tce().Buffer,PTo=require("stream"),DTo=require("util");function DHe(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=PHe.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=PHe.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(DHe,"DataStream");DTo.inherits(DHe,PTo);DHe.prototype.write=a(function(e){this.buffer=PHe.concat([this.buffer,PHe.from(e)]),this.emit("data",e)},"write");DHe.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");vnn.exports=DHe});var bnn=I((tZl,Cnn)=>{"use strict";p();function CBt(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(CBt,"getParamSize");var NTo={ES256:CBt(256),ES384:CBt(384),ES512:CBt(521)};function MTo(t){var e=NTo[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(MTo,"getParamBytesForAlg");Cnn.exports=MTo});var knn=I((iZl,Rnn)=>{"use strict";p();var NHe=Tce().Buffer,Tnn=bnn(),MHe=128,Inn=0,OTo=32,LTo=16,BTo=2,xnn=LTo|OTo|Inn<<6,OHe=BTo|Inn<<6;function FTo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(FTo,"base64Url");function wnn(t){if(NHe.isBuffer(t))return t;if(typeof t=="string")return NHe.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(wnn,"signatureAsBuffer");function UTo(t,e){t=wnn(t);var r=Tnn(e),n=r+1,o=t.length,s=0;if(t[s++]!==xnn)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(MHe|1)&&(c=t[s++]),o-s=MHe;return o&&--n,n}a(Snn,"countPadding");function QTo(t,e){t=wnn(t);var r=Tnn(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=Snn(t,0,r),s=Snn(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var tTe=require("buffer").Buffer,bBt=require("buffer").SlowBuffer;Pnn.exports=LHe;function LHe(t,e){if(!tTe.isBuffer(t)||!tTe.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var xce=Tce().Buffer,xx=require("crypto"),Mnn=knn(),Nnn=require("util"),HTo=`"%s" is not a valid algorithm. +`&&oe++}ye&&Me.length>0&&Re.push(Me.length),this._lineOffsets=Re}return this._lineOffsets},ae.prototype.positionAt=function(Re){Re=Math.max(Math.min(Re,this._content.length),0);var Me=this.getLineOffsets(),ye=0,oe=Me.length;if(oe===0)return c.create(0,Re);for(;yeRe?oe=ze:ye=ze+1}var at=ye-1;return c.create(at,Re-Me[at])},ae.prototype.offsetAt=function(Re){var Me=this.getLineOffsets();if(Re.line>=Me.length)return this._content.length;if(Re.line<0)return 0;var ye=Me[Re.line],oe=Re.line+1"u"}a(ye,"undefined"),ae.undefined=ye;function oe(Yt){return Yt===!0||Yt===!1}a(oe,"boolean"),ae.boolean=oe;function ze(Yt){return Re.call(Yt)==="[object String]"}a(ze,"string"),ae.string=ze;function at(Yt){return Re.call(Yt)==="[object Number]"}a(at,"number"),ae.number=at;function Vt(Yt,_r,$0){return Re.call(Yt)==="[object Number]"&&_r<=Yt&&Yt<=$0}a(Vt,"numberRange"),ae.numberRange=Vt;function gr(Yt){return Re.call(Yt)==="[object Number]"&&-2147483648<=Yt&&Yt<=2147483647}a(gr,"integer"),ae.integer=gr;function cr(Yt){return Re.call(Yt)==="[object Number]"&&0<=Yt&&Yt<=2147483647}a(cr,"uinteger"),ae.uinteger=cr;function Mr(Yt){return Re.call(Yt)==="[object Function]"}a(Mr,"func"),ae.func=Mr;function Hr(Yt){return Yt!==null&&typeof Yt=="object"}a(Hr,"objectLiteral"),ae.objectLiteral=Hr;function Gr(Yt,_r){return Array.isArray(Yt)&&Yt.every(_r)}a(Gr,"typedArray"),ae.typedArray=Gr})(We||(We={}))})});var Pd=I(dC=>{"use strict";p();Object.defineProperty(dC,"__esModule",{value:!0});dC.ProtocolNotificationType=dC.ProtocolNotificationType0=dC.ProtocolRequestType=dC.ProtocolRequestType0=dC.RegistrationType=dC.MessageDirection=void 0;var ase=qW(),_Wr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(_Wr||(dC.MessageDirection=_Wr={}));var _Dt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};dC.RegistrationType=_Dt;var vDt=class extends ase.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};dC.ProtocolRequestType0=vDt;var CDt=class extends ase.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,ase.ParameterStructures.byName)}};dC.ProtocolRequestType=CDt;var bDt=class extends ase.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};dC.ProtocolNotificationType0=bDt;var SDt=class extends ase.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,ase.ParameterStructures.byName)}};dC.ProtocolNotificationType=SDt});var QUe=I(wh=>{"use strict";p();Object.defineProperty(wh,"__esModule",{value:!0});wh.objectLiteral=wh.typedArray=wh.stringArray=wh.array=wh.func=wh.error=wh.number=wh.string=wh.boolean=void 0;function ZAo(t){return t===!0||t===!1}a(ZAo,"boolean");wh.boolean=ZAo;function vWr(t){return typeof t=="string"||t instanceof String}a(vWr,"string");wh.string=vWr;function XAo(t){return typeof t=="number"||t instanceof Number}a(XAo,"number");wh.number=XAo;function eyo(t){return t instanceof Error}a(eyo,"error");wh.error=eyo;function tyo(t){return typeof t=="function"}a(tyo,"func");wh.func=tyo;function CWr(t){return Array.isArray(t)}a(CWr,"array");wh.array=CWr;function ryo(t){return CWr(t)&&t.every(e=>vWr(e))}a(ryo,"stringArray");wh.stringArray=ryo;function nyo(t,e){return Array.isArray(t)&&t.every(e)}a(nyo,"typedArray");wh.typedArray=nyo;function iyo(t){return t!==null&&typeof t=="object"}a(iyo,"objectLiteral");wh.objectLiteral=iyo});var TWr=I(qUe=>{"use strict";p();Object.defineProperty(qUe,"__esModule",{value:!0});qUe.ImplementationRequest=void 0;var bWr=Pd(),SWr;(function(t){t.method="textDocument/implementation",t.messageDirection=bWr.MessageDirection.clientToServer,t.type=new bWr.ProtocolRequestType(t.method)})(SWr||(qUe.ImplementationRequest=SWr={}))});var wWr=I(jUe=>{"use strict";p();Object.defineProperty(jUe,"__esModule",{value:!0});jUe.TypeDefinitionRequest=void 0;var IWr=Pd(),xWr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=IWr.MessageDirection.clientToServer,t.type=new IWr.ProtocolRequestType(t.method)})(xWr||(jUe.TypeDefinitionRequest=xWr={}))});var PWr=I(cse=>{"use strict";p();Object.defineProperty(cse,"__esModule",{value:!0});cse.DidChangeWorkspaceFoldersNotification=cse.WorkspaceFoldersRequest=void 0;var HUe=Pd(),RWr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=HUe.MessageDirection.serverToClient,t.type=new HUe.ProtocolRequestType0(t.method)})(RWr||(cse.WorkspaceFoldersRequest=RWr={}));var kWr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=HUe.MessageDirection.clientToServer,t.type=new HUe.ProtocolNotificationType(t.method)})(kWr||(cse.DidChangeWorkspaceFoldersNotification=kWr={}))});var MWr=I(GUe=>{"use strict";p();Object.defineProperty(GUe,"__esModule",{value:!0});GUe.ConfigurationRequest=void 0;var DWr=Pd(),NWr;(function(t){t.method="workspace/configuration",t.messageDirection=DWr.MessageDirection.serverToClient,t.type=new DWr.ProtocolRequestType(t.method)})(NWr||(GUe.ConfigurationRequest=NWr={}))});var BWr=I(lse=>{"use strict";p();Object.defineProperty(lse,"__esModule",{value:!0});lse.ColorPresentationRequest=lse.DocumentColorRequest=void 0;var $Ue=Pd(),OWr;(function(t){t.method="textDocument/documentColor",t.messageDirection=$Ue.MessageDirection.clientToServer,t.type=new $Ue.ProtocolRequestType(t.method)})(OWr||(lse.DocumentColorRequest=OWr={}));var LWr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=$Ue.MessageDirection.clientToServer,t.type=new $Ue.ProtocolRequestType(t.method)})(LWr||(lse.ColorPresentationRequest=LWr={}))});var QWr=I(use=>{"use strict";p();Object.defineProperty(use,"__esModule",{value:!0});use.FoldingRangeRefreshRequest=use.FoldingRangeRequest=void 0;var VUe=Pd(),FWr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=VUe.MessageDirection.clientToServer,t.type=new VUe.ProtocolRequestType(t.method)})(FWr||(use.FoldingRangeRequest=FWr={}));var UWr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=VUe.MessageDirection.serverToClient,t.type=new VUe.ProtocolRequestType0(t.method)})(UWr||(use.FoldingRangeRefreshRequest=UWr={}))});var HWr=I(WUe=>{"use strict";p();Object.defineProperty(WUe,"__esModule",{value:!0});WUe.DeclarationRequest=void 0;var qWr=Pd(),jWr;(function(t){t.method="textDocument/declaration",t.messageDirection=qWr.MessageDirection.clientToServer,t.type=new qWr.ProtocolRequestType(t.method)})(jWr||(WUe.DeclarationRequest=jWr={}))});var VWr=I(zUe=>{"use strict";p();Object.defineProperty(zUe,"__esModule",{value:!0});zUe.SelectionRangeRequest=void 0;var GWr=Pd(),$Wr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=GWr.MessageDirection.clientToServer,t.type=new GWr.ProtocolRequestType(t.method)})($Wr||(zUe.SelectionRangeRequest=$Wr={}))});var KWr=I(kU=>{"use strict";p();Object.defineProperty(kU,"__esModule",{value:!0});kU.WorkDoneProgressCancelNotification=kU.WorkDoneProgressCreateRequest=kU.WorkDoneProgress=void 0;var oyo=qW(),YUe=Pd(),WWr;(function(t){t.type=new oyo.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(WWr||(kU.WorkDoneProgress=WWr={}));var zWr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=YUe.MessageDirection.serverToClient,t.type=new YUe.ProtocolRequestType(t.method)})(zWr||(kU.WorkDoneProgressCreateRequest=zWr={}));var YWr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=YUe.MessageDirection.clientToServer,t.type=new YUe.ProtocolNotificationType(t.method)})(YWr||(kU.WorkDoneProgressCancelNotification=YWr={}))});var ezr=I(PU=>{"use strict";p();Object.defineProperty(PU,"__esModule",{value:!0});PU.CallHierarchyOutgoingCallsRequest=PU.CallHierarchyIncomingCallsRequest=PU.CallHierarchyPrepareRequest=void 0;var dse=Pd(),JWr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(JWr||(PU.CallHierarchyPrepareRequest=JWr={}));var ZWr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(ZWr||(PU.CallHierarchyIncomingCallsRequest=ZWr={}));var XWr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(XWr||(PU.CallHierarchyOutgoingCallsRequest=XWr={}))});var szr=I(fC=>{"use strict";p();Object.defineProperty(fC,"__esModule",{value:!0});fC.SemanticTokensRefreshRequest=fC.SemanticTokensRangeRequest=fC.SemanticTokensDeltaRequest=fC.SemanticTokensRequest=fC.SemanticTokensRegistrationType=fC.TokenFormat=void 0;var vB=Pd(),tzr;(function(t){t.Relative="relative"})(tzr||(fC.TokenFormat=tzr={}));var rbe;(function(t){t.method="textDocument/semanticTokens",t.type=new vB.RegistrationType(t.method)})(rbe||(fC.SemanticTokensRegistrationType=rbe={}));var rzr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=rbe.method})(rzr||(fC.SemanticTokensRequest=rzr={}));var nzr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=rbe.method})(nzr||(fC.SemanticTokensDeltaRequest=nzr={}));var izr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=rbe.method})(izr||(fC.SemanticTokensRangeRequest=izr={}));var ozr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=vB.MessageDirection.serverToClient,t.type=new vB.ProtocolRequestType0(t.method)})(ozr||(fC.SemanticTokensRefreshRequest=ozr={}))});var lzr=I(KUe=>{"use strict";p();Object.defineProperty(KUe,"__esModule",{value:!0});KUe.ShowDocumentRequest=void 0;var azr=Pd(),czr;(function(t){t.method="window/showDocument",t.messageDirection=azr.MessageDirection.serverToClient,t.type=new azr.ProtocolRequestType(t.method)})(czr||(KUe.ShowDocumentRequest=czr={}))});var fzr=I(JUe=>{"use strict";p();Object.defineProperty(JUe,"__esModule",{value:!0});JUe.LinkedEditingRangeRequest=void 0;var uzr=Pd(),dzr;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=uzr.MessageDirection.clientToServer,t.type=new uzr.ProtocolRequestType(t.method)})(dzr||(JUe.LinkedEditingRangeRequest=dzr={}))});var _zr=I(Hy=>{"use strict";p();Object.defineProperty(Hy,"__esModule",{value:!0});Hy.WillDeleteFilesRequest=Hy.DidDeleteFilesNotification=Hy.DidRenameFilesNotification=Hy.WillRenameFilesRequest=Hy.DidCreateFilesNotification=Hy.WillCreateFilesRequest=Hy.FileOperationPatternKind=void 0;var JI=Pd(),pzr;(function(t){t.file="file",t.folder="folder"})(pzr||(Hy.FileOperationPatternKind=pzr={}));var hzr;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=JI.MessageDirection.clientToServer,t.type=new JI.ProtocolRequestType(t.method)})(hzr||(Hy.WillCreateFilesRequest=hzr={}));var mzr;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=JI.MessageDirection.clientToServer,t.type=new JI.ProtocolNotificationType(t.method)})(mzr||(Hy.DidCreateFilesNotification=mzr={}));var gzr;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=JI.MessageDirection.clientToServer,t.type=new JI.ProtocolRequestType(t.method)})(gzr||(Hy.WillRenameFilesRequest=gzr={}));var Azr;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=JI.MessageDirection.clientToServer,t.type=new JI.ProtocolNotificationType(t.method)})(Azr||(Hy.DidRenameFilesNotification=Azr={}));var yzr;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=JI.MessageDirection.clientToServer,t.type=new JI.ProtocolNotificationType(t.method)})(yzr||(Hy.DidDeleteFilesNotification=yzr={}));var Ezr;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=JI.MessageDirection.clientToServer,t.type=new JI.ProtocolRequestType(t.method)})(Ezr||(Hy.WillDeleteFilesRequest=Ezr={}))});var Tzr=I(DU=>{"use strict";p();Object.defineProperty(DU,"__esModule",{value:!0});DU.MonikerRequest=DU.MonikerKind=DU.UniquenessLevel=void 0;var vzr=Pd(),Czr;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Czr||(DU.UniquenessLevel=Czr={}));var bzr;(function(t){t.$import="import",t.$export="export",t.local="local"})(bzr||(DU.MonikerKind=bzr={}));var Szr;(function(t){t.method="textDocument/moniker",t.messageDirection=vzr.MessageDirection.clientToServer,t.type=new vzr.ProtocolRequestType(t.method)})(Szr||(DU.MonikerRequest=Szr={}))});var Rzr=I(NU=>{"use strict";p();Object.defineProperty(NU,"__esModule",{value:!0});NU.TypeHierarchySubtypesRequest=NU.TypeHierarchySupertypesRequest=NU.TypeHierarchyPrepareRequest=void 0;var fse=Pd(),Izr;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(Izr||(NU.TypeHierarchyPrepareRequest=Izr={}));var xzr;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(xzr||(NU.TypeHierarchySupertypesRequest=xzr={}));var wzr;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(wzr||(NU.TypeHierarchySubtypesRequest=wzr={}))});var Dzr=I(pse=>{"use strict";p();Object.defineProperty(pse,"__esModule",{value:!0});pse.InlineValueRefreshRequest=pse.InlineValueRequest=void 0;var ZUe=Pd(),kzr;(function(t){t.method="textDocument/inlineValue",t.messageDirection=ZUe.MessageDirection.clientToServer,t.type=new ZUe.ProtocolRequestType(t.method)})(kzr||(pse.InlineValueRequest=kzr={}));var Pzr;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=ZUe.MessageDirection.serverToClient,t.type=new ZUe.ProtocolRequestType0(t.method)})(Pzr||(pse.InlineValueRefreshRequest=Pzr={}))});var Lzr=I(MU=>{"use strict";p();Object.defineProperty(MU,"__esModule",{value:!0});MU.InlayHintRefreshRequest=MU.InlayHintResolveRequest=MU.InlayHintRequest=void 0;var hse=Pd(),Nzr;(function(t){t.method="textDocument/inlayHint",t.messageDirection=hse.MessageDirection.clientToServer,t.type=new hse.ProtocolRequestType(t.method)})(Nzr||(MU.InlayHintRequest=Nzr={}));var Mzr;(function(t){t.method="inlayHint/resolve",t.messageDirection=hse.MessageDirection.clientToServer,t.type=new hse.ProtocolRequestType(t.method)})(Mzr||(MU.InlayHintResolveRequest=Mzr={}));var Ozr;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=hse.MessageDirection.serverToClient,t.type=new hse.ProtocolRequestType0(t.method)})(Ozr||(MU.InlayHintRefreshRequest=Ozr={}))});var Hzr=I(ZI=>{"use strict";p();Object.defineProperty(ZI,"__esModule",{value:!0});ZI.DiagnosticRefreshRequest=ZI.WorkspaceDiagnosticRequest=ZI.DocumentDiagnosticRequest=ZI.DocumentDiagnosticReportKind=ZI.DiagnosticServerCancellationData=void 0;var jzr=qW(),syo=QUe(),mse=Pd(),Bzr;(function(t){function e(r){let n=r;return n&&syo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(Bzr||(ZI.DiagnosticServerCancellationData=Bzr={}));var Fzr;(function(t){t.Full="full",t.Unchanged="unchanged"})(Fzr||(ZI.DocumentDiagnosticReportKind=Fzr={}));var Uzr;(function(t){t.method="textDocument/diagnostic",t.messageDirection=mse.MessageDirection.clientToServer,t.type=new mse.ProtocolRequestType(t.method),t.partialResult=new jzr.ProgressType})(Uzr||(ZI.DocumentDiagnosticRequest=Uzr={}));var Qzr;(function(t){t.method="workspace/diagnostic",t.messageDirection=mse.MessageDirection.clientToServer,t.type=new mse.ProtocolRequestType(t.method),t.partialResult=new jzr.ProgressType})(Qzr||(ZI.WorkspaceDiagnosticRequest=Qzr={}));var qzr;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=mse.MessageDirection.serverToClient,t.type=new mse.ProtocolRequestType0(t.method)})(qzr||(ZI.DiagnosticRefreshRequest=qzr={}))});var Kzr=I(Hf=>{"use strict";p();Object.defineProperty(Hf,"__esModule",{value:!0});Hf.DidCloseNotebookDocumentNotification=Hf.DidSaveNotebookDocumentNotification=Hf.DidChangeNotebookDocumentNotification=Hf.NotebookCellArrayChange=Hf.DidOpenNotebookDocumentNotification=Hf.NotebookDocumentSyncRegistrationType=Hf.NotebookDocument=Hf.NotebookCell=Hf.ExecutionSummary=Hf.NotebookCellKind=void 0;var nbe=tbe(),Wk=QUe(),oM=Pd(),TDt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(TDt||(Hf.NotebookCellKind=TDt={}));var IDt;(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 Wk.objectLiteral(s)&&nbe.uinteger.is(s.executionOrder)&&(s.success===void 0||Wk.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})(IDt||(Hf.ExecutionSummary=IDt={}));var XUe;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return Wk.objectLiteral(c)&&TDt.is(c.kind)&&nbe.DocumentUri.is(c.document)&&(c.metadata===void 0||Wk.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)&&!IDt.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(e7e,"__esModule",{value:!0});e7e.InlineCompletionRequest=void 0;var Jzr=Pd(),Zzr;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Jzr.MessageDirection.clientToServer,t.type=new Jzr.ProtocolRequestType(t.method)})(Zzr||(e7e.InlineCompletionRequest=Zzr={}))});var fKr=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 br=Pd(),eYr=tbe(),Z0=QUe(),ayo=TWr();Object.defineProperty(Ve,"ImplementationRequest",{enumerable:!0,get:a(function(){return ayo.ImplementationRequest},"get")});var cyo=wWr();Object.defineProperty(Ve,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return cyo.TypeDefinitionRequest},"get")});var cKr=PWr();Object.defineProperty(Ve,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return cKr.WorkspaceFoldersRequest},"get")});Object.defineProperty(Ve,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return cKr.DidChangeWorkspaceFoldersNotification},"get")});var lyo=MWr();Object.defineProperty(Ve,"ConfigurationRequest",{enumerable:!0,get:a(function(){return lyo.ConfigurationRequest},"get")});var lKr=BWr();Object.defineProperty(Ve,"DocumentColorRequest",{enumerable:!0,get:a(function(){return lKr.DocumentColorRequest},"get")});Object.defineProperty(Ve,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return lKr.ColorPresentationRequest},"get")});var uKr=QWr();Object.defineProperty(Ve,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return uKr.FoldingRangeRequest},"get")});Object.defineProperty(Ve,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return uKr.FoldingRangeRefreshRequest},"get")});var uyo=HWr();Object.defineProperty(Ve,"DeclarationRequest",{enumerable:!0,get:a(function(){return uyo.DeclarationRequest},"get")});var dyo=VWr();Object.defineProperty(Ve,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return dyo.SelectionRangeRequest},"get")});var PDt=KWr();Object.defineProperty(Ve,"WorkDoneProgress",{enumerable:!0,get:a(function(){return PDt.WorkDoneProgress},"get")});Object.defineProperty(Ve,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return PDt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Ve,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return PDt.WorkDoneProgressCancelNotification},"get")});var DDt=ezr();Object.defineProperty(Ve,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return DDt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return DDt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return DDt.CallHierarchyPrepareRequest},"get")});var Ase=szr();Object.defineProperty(Ve,"TokenFormat",{enumerable:!0,get:a(function(){return Ase.TokenFormat},"get")});Object.defineProperty(Ve,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRequest},"get")});Object.defineProperty(Ve,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRangeRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRegistrationType},"get")});var fyo=lzr();Object.defineProperty(Ve,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return fyo.ShowDocumentRequest},"get")});var pyo=fzr();Object.defineProperty(Ve,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return pyo.LinkedEditingRangeRequest},"get")});var jW=_zr();Object.defineProperty(Ve,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return jW.FileOperationPatternKind},"get")});Object.defineProperty(Ve,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return jW.DidCreateFilesNotification},"get")});Object.defineProperty(Ve,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return jW.WillCreateFilesRequest},"get")});Object.defineProperty(Ve,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return jW.DidRenameFilesNotification},"get")});Object.defineProperty(Ve,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return jW.WillRenameFilesRequest},"get")});Object.defineProperty(Ve,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return jW.DidDeleteFilesNotification},"get")});Object.defineProperty(Ve,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return jW.WillDeleteFilesRequest},"get")});var NDt=Tzr();Object.defineProperty(Ve,"UniquenessLevel",{enumerable:!0,get:a(function(){return NDt.UniquenessLevel},"get")});Object.defineProperty(Ve,"MonikerKind",{enumerable:!0,get:a(function(){return NDt.MonikerKind},"get")});Object.defineProperty(Ve,"MonikerRequest",{enumerable:!0,get:a(function(){return NDt.MonikerRequest},"get")});var MDt=Rzr();Object.defineProperty(Ve,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return MDt.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return MDt.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return MDt.TypeHierarchySupertypesRequest},"get")});var dKr=Dzr();Object.defineProperty(Ve,"InlineValueRequest",{enumerable:!0,get:a(function(){return dKr.InlineValueRequest},"get")});Object.defineProperty(Ve,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return dKr.InlineValueRefreshRequest},"get")});var ODt=Lzr();Object.defineProperty(Ve,"InlayHintRequest",{enumerable:!0,get:a(function(){return ODt.InlayHintRequest},"get")});Object.defineProperty(Ve,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return ODt.InlayHintResolveRequest},"get")});Object.defineProperty(Ve,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return ODt.InlayHintRefreshRequest},"get")});var ibe=Hzr();Object.defineProperty(Ve,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return ibe.DiagnosticServerCancellationData},"get")});Object.defineProperty(Ve,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return ibe.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Ve,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return ibe.DocumentDiagnosticRequest},"get")});Object.defineProperty(Ve,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return ibe.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Ve,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return ibe.DiagnosticRefreshRequest},"get")});var sM=Kzr();Object.defineProperty(Ve,"NotebookCellKind",{enumerable:!0,get:a(function(){return sM.NotebookCellKind},"get")});Object.defineProperty(Ve,"ExecutionSummary",{enumerable:!0,get:a(function(){return sM.ExecutionSummary},"get")});Object.defineProperty(Ve,"NotebookCell",{enumerable:!0,get:a(function(){return sM.NotebookCell},"get")});Object.defineProperty(Ve,"NotebookDocument",{enumerable:!0,get:a(function(){return sM.NotebookDocument},"get")});Object.defineProperty(Ve,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return sM.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Ve,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return sM.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return sM.NotebookCellArrayChange},"get")});Object.defineProperty(Ve,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return sM.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return sM.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return sM.DidCloseNotebookDocumentNotification},"get")});var hyo=Xzr();Object.defineProperty(Ve,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return hyo.InlineCompletionRequest},"get")});var xDt;(function(t){function e(r){let n=r;return Z0.string(n)||Z0.string(n.language)||Z0.string(n.scheme)||Z0.string(n.pattern)}a(e,"is"),t.is=e})(xDt||(Ve.TextDocumentFilter=xDt={}));var wDt;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(Z0.string(n.notebookType)||Z0.string(n.scheme)||Z0.string(n.pattern))}a(e,"is"),t.is=e})(wDt||(Ve.NotebookDocumentFilter=wDt={}));var RDt;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(Z0.string(n.notebook)||wDt.is(n.notebook))&&(n.language===void 0||Z0.string(n.language))}a(e,"is"),t.is=e})(RDt||(Ve.NotebookCellTextDocumentFilter=RDt={}));var kDt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Z0.string(n)&&!xDt.is(n)&&!RDt.is(n))return!1;return!0}a(e,"is"),t.is=e})(kDt||(Ve.DocumentSelector=kDt={}));var tYr;(function(t){t.method="client/registerCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(tYr||(Ve.RegistrationRequest=tYr={}));var rYr;(function(t){t.method="client/unregisterCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(rYr||(Ve.UnregistrationRequest=rYr={}));var nYr;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(nYr||(Ve.ResourceOperationKind=nYr={}));var iYr;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(iYr||(Ve.FailureHandlingKind=iYr={}));var oYr;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(oYr||(Ve.PositionEncodingKind=oYr={}));var sYr;(function(t){function e(r){let n=r;return n&&Z0.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(sYr||(Ve.StaticRegistrationOptions=sYr={}));var aYr;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||kDt.is(n.documentSelector))}a(e,"is"),t.is=e})(aYr||(Ve.TextDocumentRegistrationOptions=aYr={}));var cYr;(function(t){function e(n){let o=n;return Z0.objectLiteral(o)&&(o.workDoneProgress===void 0||Z0.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&Z0.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(cYr||(Ve.WorkDoneProgressOptions=cYr={}));var lYr;(function(t){t.method="initialize",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(lYr||(Ve.InitializeRequest=lYr={}));var uYr;(function(t){t.unknownProtocolVersion=1})(uYr||(Ve.InitializeErrorCodes=uYr={}));var dYr;(function(t){t.method="initialized",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(dYr||(Ve.InitializedNotification=dYr={}));var fYr;(function(t){t.method="shutdown",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType0(t.method)})(fYr||(Ve.ShutdownRequest=fYr={}));var pYr;(function(t){t.method="exit",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType0(t.method)})(pYr||(Ve.ExitNotification=pYr={}));var hYr;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(hYr||(Ve.DidChangeConfigurationNotification=hYr={}));var mYr;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(mYr||(Ve.MessageType=mYr={}));var gYr;(function(t){t.method="window/showMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(gYr||(Ve.ShowMessageNotification=gYr={}));var AYr;(function(t){t.method="window/showMessageRequest",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(AYr||(Ve.ShowMessageRequest=AYr={}));var yYr;(function(t){t.method="window/logMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(yYr||(Ve.LogMessageNotification=yYr={}));var EYr;(function(t){t.method="telemetry/event",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(EYr||(Ve.TelemetryEventNotification=EYr={}));var _Yr;(function(t){t.None=0,t.Full=1,t.Incremental=2})(_Yr||(Ve.TextDocumentSyncKind=_Yr={}));var vYr;(function(t){t.method="textDocument/didOpen",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(vYr||(Ve.DidOpenTextDocumentNotification=vYr={}));var CYr;(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})(CYr||(Ve.TextDocumentContentChangeEvent=CYr={}));var bYr;(function(t){t.method="textDocument/didChange",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(bYr||(Ve.DidChangeTextDocumentNotification=bYr={}));var SYr;(function(t){t.method="textDocument/didClose",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(SYr||(Ve.DidCloseTextDocumentNotification=SYr={}));var TYr;(function(t){t.method="textDocument/didSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(TYr||(Ve.DidSaveTextDocumentNotification=TYr={}));var IYr;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(IYr||(Ve.TextDocumentSaveReason=IYr={}));var xYr;(function(t){t.method="textDocument/willSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(xYr||(Ve.WillSaveTextDocumentNotification=xYr={}));var wYr;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(wYr||(Ve.WillSaveTextDocumentWaitUntilRequest=wYr={}));var RYr;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(RYr||(Ve.DidChangeWatchedFilesNotification=RYr={}));var kYr;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(kYr||(Ve.FileChangeType=kYr={}));var PYr;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(eYr.URI.is(n.baseUri)||eYr.WorkspaceFolder.is(n.baseUri))&&Z0.string(n.pattern)}a(e,"is"),t.is=e})(PYr||(Ve.RelativePattern=PYr={}));var DYr;(function(t){t.Create=1,t.Change=2,t.Delete=4})(DYr||(Ve.WatchKind=DYr={}));var NYr;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(NYr||(Ve.PublishDiagnosticsNotification=NYr={}));var MYr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(MYr||(Ve.CompletionTriggerKind=MYr={}));var OYr;(function(t){t.method="textDocument/completion",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(OYr||(Ve.CompletionRequest=OYr={}));var LYr;(function(t){t.method="completionItem/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(LYr||(Ve.CompletionResolveRequest=LYr={}));var BYr;(function(t){t.method="textDocument/hover",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(BYr||(Ve.HoverRequest=BYr={}));var FYr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(FYr||(Ve.SignatureHelpTriggerKind=FYr={}));var UYr;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(UYr||(Ve.SignatureHelpRequest=UYr={}));var QYr;(function(t){t.method="textDocument/definition",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(QYr||(Ve.DefinitionRequest=QYr={}));var qYr;(function(t){t.method="textDocument/references",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(qYr||(Ve.ReferencesRequest=qYr={}));var jYr;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(jYr||(Ve.DocumentHighlightRequest=jYr={}));var HYr;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(HYr||(Ve.DocumentSymbolRequest=HYr={}));var GYr;(function(t){t.method="textDocument/codeAction",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(GYr||(Ve.CodeActionRequest=GYr={}));var $Yr;(function(t){t.method="codeAction/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})($Yr||(Ve.CodeActionResolveRequest=$Yr={}));var VYr;(function(t){t.method="workspace/symbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(VYr||(Ve.WorkspaceSymbolRequest=VYr={}));var WYr;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(WYr||(Ve.WorkspaceSymbolResolveRequest=WYr={}));var zYr;(function(t){t.method="textDocument/codeLens",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(zYr||(Ve.CodeLensRequest=zYr={}));var YYr;(function(t){t.method="codeLens/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(YYr||(Ve.CodeLensResolveRequest=YYr={}));var KYr;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType0(t.method)})(KYr||(Ve.CodeLensRefreshRequest=KYr={}));var JYr;(function(t){t.method="textDocument/documentLink",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(JYr||(Ve.DocumentLinkRequest=JYr={}));var ZYr;(function(t){t.method="documentLink/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(ZYr||(Ve.DocumentLinkResolveRequest=ZYr={}));var XYr;(function(t){t.method="textDocument/formatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(XYr||(Ve.DocumentFormattingRequest=XYr={}));var eKr;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(eKr||(Ve.DocumentRangeFormattingRequest=eKr={}));var tKr;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(tKr||(Ve.DocumentRangesFormattingRequest=tKr={}));var rKr;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(rKr||(Ve.DocumentOnTypeFormattingRequest=rKr={}));var nKr;(function(t){t.Identifier=1})(nKr||(Ve.PrepareSupportDefaultBehavior=nKr={}));var iKr;(function(t){t.method="textDocument/rename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(iKr||(Ve.RenameRequest=iKr={}));var oKr;(function(t){t.method="textDocument/prepareRename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(oKr||(Ve.PrepareRenameRequest=oKr={}));var sKr;(function(t){t.method="workspace/executeCommand",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(sKr||(Ve.ExecuteCommandRequest=sKr={}));var aKr;(function(t){t.method="workspace/applyEdit",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType("workspace/applyEdit")})(aKr||(Ve.ApplyWorkspaceEditRequest=aKr={}))});var hKr=I(t7e=>{"use strict";p();Object.defineProperty(t7e,"__esModule",{value:!0});t7e.createProtocolConnection=void 0;var pKr=qW();function myo(t,e,r,n){return pKr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,pKr.createMessageConnection)(t,e,r,n)}a(myo,"createProtocolConnection");t7e.createProtocolConnection=myo});var gKr=I(pC=>{"use strict";p();var gyo=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]})),r7e=pC&&pC.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gyo(e,t,r)};Object.defineProperty(pC,"__esModule",{value:!0});pC.LSPErrorCodes=pC.createProtocolConnection=void 0;r7e(qW(),pC);r7e(tbe(),pC);r7e(Pd(),pC);r7e(fKr(),pC);var Ayo=hKr();Object.defineProperty(pC,"createProtocolConnection",{enumerable:!0,get:a(function(){return Ayo.createProtocolConnection},"get")});var mKr;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(mKr||(pC.LSPErrorCodes=mKr={}))});var ti=I(aM=>{"use strict";p();var yyo=aM&&aM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),AKr=aM&&aM.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yyo(e,t,r)};Object.defineProperty(aM,"__esModule",{value:!0});aM.createProtocolConnection=void 0;var Eyo=EDt();AKr(EDt(),aM);AKr(gKr(),aM);function _yo(t,e,r,n){return(0,Eyo.createMessageConnection)(t,e,r,n)}a(_yo,"createProtocolConnection");aM.createProtocolConnection=_yo});var j5t=I(Dje=>{"use strict";p();Object.defineProperty(Dje,"__esModule",{value:!0});Dje.state=void 0;Dje.state={instrumenterImplementation:void 0}});var Tce=I((vBt,vnn)=>{p();var DHe=require("buffer"),GM=DHe.Buffer;function _nn(t,e){for(var r in t)e[r]=t[r]}a(_nn,"copyProps");GM.from&&GM.alloc&&GM.allocUnsafe&&GM.allocUnsafeSlow?vnn.exports=DHe:(_nn(DHe,vBt),vBt.Buffer=CY);function CY(t,e,r){return GM(t,e,r)}a(CY,"SafeBuffer");CY.prototype=Object.create(GM.prototype);_nn(GM,CY);CY.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return GM(t,e,r)};CY.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=GM(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};CY.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return GM(t)};CY.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return DHe.SlowBuffer(t)}});var CBt=I((iZl,Cnn)=>{p();var NHe=Tce().Buffer,OTo=require("stream"),LTo=require("util");function MHe(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=NHe.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=NHe.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(MHe,"DataStream");LTo.inherits(MHe,OTo);MHe.prototype.write=a(function(e){this.buffer=NHe.concat([this.buffer,NHe.from(e)]),this.emit("data",e)},"write");MHe.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Cnn.exports=MHe});var Snn=I((aZl,bnn)=>{"use strict";p();function bBt(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(bBt,"getParamSize");var BTo={ES256:bBt(256),ES384:bBt(384),ES512:bBt(521)};function FTo(t){var e=BTo[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(FTo,"getParamBytesForAlg");bnn.exports=FTo});var Pnn=I((uZl,knn)=>{"use strict";p();var OHe=Tce().Buffer,Inn=Snn(),LHe=128,xnn=0,UTo=32,QTo=16,qTo=2,wnn=QTo|UTo|xnn<<6,BHe=qTo|xnn<<6;function jTo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(jTo,"base64Url");function Rnn(t){if(OHe.isBuffer(t))return t;if(typeof t=="string")return OHe.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(Rnn,"signatureAsBuffer");function HTo(t,e){t=Rnn(t);var r=Inn(e),n=r+1,o=t.length,s=0;if(t[s++]!==wnn)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(LHe|1)&&(c=t[s++]),o-s=LHe;return o&&--n,n}a(Tnn,"countPadding");function GTo(t,e){t=Rnn(t);var r=Inn(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=Tnn(t,0,r),s=Tnn(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var rTe=require("buffer").Buffer,SBt=require("buffer").SlowBuffer;Dnn.exports=FHe;function FHe(t,e){if(!rTe.isBuffer(t)||!rTe.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var xce=Tce().Buffer,wx=require("crypto"),Onn=Pnn(),Mnn=require("util"),WTo=`"%s" is not a valid algorithm. Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,rTe="secret must be a string or buffer",Ice="key must be a string or a buffer",GTo="key must be a string, a buffer or an object",TBt=typeof xx.createPublicKey=="function";TBt&&(Ice+=" or a KeyObject",rTe+="or a KeyObject");function Onn(t){if(!xce.isBuffer(t)&&typeof t!="string"&&(!TBt||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw gP(Ice)}a(Onn,"checkIsPublicKey");function Lnn(t){if(!xce.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw gP(GTo)}a(Lnn,"checkIsPrivateKey");function $To(t){if(!xce.isBuffer(t)){if(typeof t=="string")return t;if(!TBt||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw gP(rTe)}}a($To,"checkIsSecretKey");function IBt(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(IBt,"fromBase64");function Bnn(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var tIo=require("buffer").Buffer;jnn.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||tIo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var znn=I((gZl,Wnn)=>{p();var rIo=Tce().Buffer,Hnn=vBt(),nIo=xBt(),iIo=require("stream"),Gnn=wBt(),RBt=require("util");function $nn(t,e){return rIo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a($nn,"base64url");function oIo(t,e,r){r=r||"utf8";var n=$nn(Gnn(t),"binary"),o=$nn(Gnn(e),r);return RBt.format("%s.%s",n,o)}a(oIo,"jwsSecuredInput");function Vnn(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=nIo(e.alg),c=oIo(e,r,o),l=s.sign(c,n);return RBt.format("%s.%s",c,l)}a(Vnn,"jwsSign");function BHe(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 Hnn(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Hnn(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(BHe,"SignStream");RBt.inherits(BHe,iIo);BHe.prototype.sign=a(function(){try{var e=Vnn({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");BHe.sign=Vnn;Wnn.exports=BHe});var iin=I((EZl,nin)=>{p();var Knn=Tce().Buffer,Ynn=vBt(),sIo=xBt(),aIo=require("stream"),Jnn=wBt(),cIo=require("util"),lIo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function uIo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(uIo,"isObject");function dIo(t){if(uIo(t))return t;try{return JSON.parse(t)}catch{return}}a(dIo,"safeJsonParse");function Znn(t){var e=t.split(".",1)[0];return dIo(Knn.from(e,"base64").toString("binary"))}a(Znn,"headerFromJWS");function fIo(t){return t.split(".",2).join(".")}a(fIo,"securedInputFromJWS");function Xnn(t){return t.split(".")[2]}a(Xnn,"signatureFromJWS");function pIo(t,e){e=e||"utf8";var r=t.split(".")[1];return Knn.from(r,"base64").toString(e)}a(pIo,"payloadFromJWS");function ein(t){return lIo.test(t)&&!!Znn(t)}a(ein,"isValidJws");function tin(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=Jnn(t);var o=Xnn(t),s=fIo(t),c=sIo(e);return c.verify(s,o,r)}a(tin,"jwsVerify");function rin(t,e){if(e=e||{},t=Jnn(t),!ein(t))return null;var r=Znn(t);if(!r)return null;var n=pIo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:Xnn(t)}}a(rin,"jwsDecode");function wce(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 Ynn(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new Ynn(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(wce,"VerifyStream");cIo.inherits(wce,aIo);wce.prototype.verify=a(function(){try{var e=tin(this.signature.buffer,this.algorithm,this.key.buffer),r=rin(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");wce.decode=rin;wce.isValid=ein;wce.verify=tin;nin.exports=wce});var UHe=I(Z7=>{p();var oin=znn(),FHe=iin(),hIo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Z7.ALGORITHMS=hIo;Z7.sign=oin.sign;Z7.verify=FHe.verify;Z7.decode=FHe.decode;Z7.isValid=FHe.isValid;Z7.createSign=a(function(e){return new oin(e)},"createSign");Z7.createVerify=a(function(e){return new FHe(e)},"createVerify")});var kBt=I((TZl,sin)=>{p();var mIo=UHe();sin.exports=function(t,e){e=e||{};var r=mIo.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 iTe=I((xZl,ain)=>{p();var QHe=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");QHe.prototype=Object.create(Error.prototype);QHe.prototype.constructor=QHe;ain.exports=QHe});var PBt=I((kZl,lin)=>{p();var cin=iTe(),qHe=a(function(t,e){cin.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");qHe.prototype=Object.create(cin.prototype);qHe.prototype.constructor=qHe;lin.exports=qHe});var DBt=I((NZl,din)=>{p();var uin=iTe(),jHe=a(function(t,e){uin.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");jHe.prototype=Object.create(uin.prototype);jHe.prototype.constructor=jHe;din.exports=jHe});var NBt=I((LZl,fin)=>{p();var Rce=1e3,kce=Rce*60,Pce=kce*60,CY=Pce*24,gIo=CY*7,AIo=CY*365.25;fin.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return yIo(t);if(r==="number"&&isFinite(t))return e.long?_Io(t):EIo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function yIo(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*AIo;case"weeks":case"week":case"w":return r*gIo;case"days":case"day":case"d":return r*CY;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Pce;case"minutes":case"minute":case"mins":case"min":case"m":return r*kce;case"seconds":case"second":case"secs":case"sec":case"s":return r*Rce;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(yIo,"parse");function EIo(t){var e=Math.abs(t);return e>=CY?Math.round(t/CY)+"d":e>=Pce?Math.round(t/Pce)+"h":e>=kce?Math.round(t/kce)+"m":e>=Rce?Math.round(t/Rce)+"s":t+"ms"}a(EIo,"fmtShort");function _Io(t){var e=Math.abs(t);return e>=CY?HHe(t,e,CY,"day"):e>=Pce?HHe(t,e,Pce,"hour"):e>=kce?HHe(t,e,kce,"minute"):e>=Rce?HHe(t,e,Rce,"second"):t+" ms"}a(_Io,"fmtLong");function HHe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(HHe,"plural")});var MBt=I((UZl,pin)=>{p();var vIo=NBt();pin.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=vIo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var Dce=I((qZl,hin)=>{"use strict";p();var CIo="2.0.0",bIo=Number.MAX_SAFE_INTEGER||9007199254740991,SIo=16,TIo=250,IIo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];hin.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:SIo,MAX_SAFE_BUILD_LENGTH:TIo,MAX_SAFE_INTEGER:bIo,RELEASE_TYPES:IIo,SEMVER_SPEC_VERSION:CIo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var oTe=I((HZl,min)=>{"use strict";p();var xIo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};min.exports=xIo});var Nce=I((GM,gin)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:OBt,MAX_SAFE_BUILD_LENGTH:wIo,MAX_LENGTH:RIo}=Dce(),kIo=oTe();GM=gin.exports={};var PIo=GM.re=[],DIo=GM.safeRe=[],xn=GM.src=[],NIo=GM.safeSrc=[],wn=GM.t={},MIo=0,LBt="[a-zA-Z0-9-]",OIo=[["\\s",1],["\\d",RIo],[LBt,wIo]],LIo=a(t=>{for(let[e,r]of OIo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Uo=a((t,e,r)=>{let n=LIo(e),o=MIo++;kIo(t,o,e),wn[t]=o,xn[o]=e,NIo[o]=n,PIo[o]=new RegExp(e,r?"g":void 0),DIo[o]=new RegExp(n,r?"g":void 0)},"createToken");Uo("NUMERICIDENTIFIER","0|[1-9]\\d*");Uo("NUMERICIDENTIFIERLOOSE","\\d+");Uo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${LBt}*`);Uo("MAINVERSION",`(${xn[wn.NUMERICIDENTIFIER]})\\.(${xn[wn.NUMERICIDENTIFIER]})\\.(${xn[wn.NUMERICIDENTIFIER]})`);Uo("MAINVERSIONLOOSE",`(${xn[wn.NUMERICIDENTIFIERLOOSE]})\\.(${xn[wn.NUMERICIDENTIFIERLOOSE]})\\.(${xn[wn.NUMERICIDENTIFIERLOOSE]})`);Uo("PRERELEASEIDENTIFIER",`(?:${xn[wn.NONNUMERICIDENTIFIER]}|${xn[wn.NUMERICIDENTIFIER]})`);Uo("PRERELEASEIDENTIFIERLOOSE",`(?:${xn[wn.NONNUMERICIDENTIFIER]}|${xn[wn.NUMERICIDENTIFIERLOOSE]})`);Uo("PRERELEASE",`(?:-(${xn[wn.PRERELEASEIDENTIFIER]}(?:\\.${xn[wn.PRERELEASEIDENTIFIER]})*))`);Uo("PRERELEASELOOSE",`(?:-?(${xn[wn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${xn[wn.PRERELEASEIDENTIFIERLOOSE]})*))`);Uo("BUILDIDENTIFIER",`${LBt}+`);Uo("BUILD",`(?:\\+(${xn[wn.BUILDIDENTIFIER]}(?:\\.${xn[wn.BUILDIDENTIFIER]})*))`);Uo("FULLPLAIN",`v?${xn[wn.MAINVERSION]}${xn[wn.PRERELEASE]}?${xn[wn.BUILD]}?`);Uo("FULL",`^${xn[wn.FULLPLAIN]}$`);Uo("LOOSEPLAIN",`[v=\\s]*${xn[wn.MAINVERSIONLOOSE]}${xn[wn.PRERELEASELOOSE]}?${xn[wn.BUILD]}?`);Uo("LOOSE",`^${xn[wn.LOOSEPLAIN]}$`);Uo("GTLT","((?:<|>)?=?)");Uo("XRANGEIDENTIFIERLOOSE",`${xn[wn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Uo("XRANGEIDENTIFIER",`${xn[wn.NUMERICIDENTIFIER]}|x|X|\\*`);Uo("XRANGEPLAIN",`[v=\\s]*(${xn[wn.XRANGEIDENTIFIER]})(?:\\.(${xn[wn.XRANGEIDENTIFIER]})(?:\\.(${xn[wn.XRANGEIDENTIFIER]})(?:${xn[wn.PRERELEASE]})?${xn[wn.BUILD]}?)?)?`);Uo("XRANGEPLAINLOOSE",`[v=\\s]*(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:${xn[wn.PRERELEASELOOSE]})?${xn[wn.BUILD]}?)?)?`);Uo("XRANGE",`^${xn[wn.GTLT]}\\s*${xn[wn.XRANGEPLAIN]}$`);Uo("XRANGELOOSE",`^${xn[wn.GTLT]}\\s*${xn[wn.XRANGEPLAINLOOSE]}$`);Uo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${OBt}})(?:\\.(\\d{1,${OBt}}))?(?:\\.(\\d{1,${OBt}}))?`);Uo("COERCE",`${xn[wn.COERCEPLAIN]}(?:$|[^\\d])`);Uo("COERCEFULL",xn[wn.COERCEPLAIN]+`(?:${xn[wn.PRERELEASE]})?(?:${xn[wn.BUILD]})?(?:$|[^\\d])`);Uo("COERCERTL",xn[wn.COERCE],!0);Uo("COERCERTLFULL",xn[wn.COERCEFULL],!0);Uo("LONETILDE","(?:~>?)");Uo("TILDETRIM",`(\\s*)${xn[wn.LONETILDE]}\\s+`,!0);GM.tildeTrimReplace="$1~";Uo("TILDE",`^${xn[wn.LONETILDE]}${xn[wn.XRANGEPLAIN]}$`);Uo("TILDELOOSE",`^${xn[wn.LONETILDE]}${xn[wn.XRANGEPLAINLOOSE]}$`);Uo("LONECARET","(?:\\^)");Uo("CARETTRIM",`(\\s*)${xn[wn.LONECARET]}\\s+`,!0);GM.caretTrimReplace="$1^";Uo("CARET",`^${xn[wn.LONECARET]}${xn[wn.XRANGEPLAIN]}$`);Uo("CARETLOOSE",`^${xn[wn.LONECARET]}${xn[wn.XRANGEPLAINLOOSE]}$`);Uo("COMPARATORLOOSE",`^${xn[wn.GTLT]}\\s*(${xn[wn.LOOSEPLAIN]})$|^$`);Uo("COMPARATOR",`^${xn[wn.GTLT]}\\s*(${xn[wn.FULLPLAIN]})$|^$`);Uo("COMPARATORTRIM",`(\\s*)${xn[wn.GTLT]}\\s*(${xn[wn.LOOSEPLAIN]}|${xn[wn.XRANGEPLAIN]})`,!0);GM.comparatorTrimReplace="$1$2$3";Uo("HYPHENRANGE",`^\\s*(${xn[wn.XRANGEPLAIN]})\\s+-\\s+(${xn[wn.XRANGEPLAIN]})\\s*$`);Uo("HYPHENRANGELOOSE",`^\\s*(${xn[wn.XRANGEPLAINLOOSE]})\\s+-\\s+(${xn[wn.XRANGEPLAINLOOSE]})\\s*$`);Uo("STAR","(<|>)?=?\\s*\\*");Uo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Uo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var GHe=I((WZl,Ain)=>{"use strict";p();var BIo=Object.freeze({loose:!0}),FIo=Object.freeze({}),UIo=a(t=>t?typeof t!="object"?BIo:t:FIo,"parseOptions");Ain.exports=UIo});var BBt=I((KZl,_in)=>{"use strict";p();var yin=/^[0-9]+$/,Ein=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tEin(e,t),"rcompareIdentifiers");_in.exports={compareIdentifiers:Ein,rcompareIdentifiers:QIo}});var bA=I((XZl,Cin)=>{"use strict";p();var $He=oTe(),{MAX_LENGTH:vin,MAX_SAFE_INTEGER:VHe}=Dce(),{safeRe:WHe,t:zHe}=Nce(),qIo=GHe(),{compareIdentifiers:FBt}=BBt(),jIo=a((t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;nvin)throw new TypeError(`version is longer than ${vin} characters`);$He("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?WHe[zHe.LOOSE]:WHe[zHe.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>VHe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>VHe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>VHe||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($He("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 FBt(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($He("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 FBt(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?WHe[zHe.PRERELEASELOOSE]:WHe[zHe.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]),jIo(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}};Cin.exports=UBt});var X7=I((rXl,Sin)=>{"use strict";p();var bin=bA(),HIo=a((t,e,r=!1)=>{if(t instanceof bin)return t;try{return new bin(t,e)}catch(n){if(!r)return null;throw n}},"parse");Sin.exports=HIo});var Iin=I((oXl,Tin)=>{"use strict";p();var GIo=X7(),$Io=a((t,e)=>{let r=GIo(t,e);return r?r.version:null},"valid");Tin.exports=$Io});var win=I((cXl,xin)=>{"use strict";p();var VIo=X7(),WIo=a((t,e)=>{let r=VIo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");xin.exports=WIo});var Pin=I((dXl,kin)=>{"use strict";p();var Rin=bA(),zIo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Rin(t instanceof Rin?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");kin.exports=zIo});var Min=I((hXl,Nin)=>{"use strict";p();var Din=X7(),YIo=a((t,e)=>{let r=Din(t,null,!0),n=Din(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");Nin.exports=YIo});var Lin=I((AXl,Oin)=>{"use strict";p();var KIo=bA(),JIo=a((t,e)=>new KIo(t,e).major,"major");Oin.exports=JIo});var Fin=I((_Xl,Bin)=>{"use strict";p();var ZIo=bA(),XIo=a((t,e)=>new ZIo(t,e).minor,"minor");Bin.exports=XIo});var Qin=I((bXl,Uin)=>{"use strict";p();var exo=bA(),txo=a((t,e)=>new exo(t,e).patch,"patch");Uin.exports=txo});var jin=I((IXl,qin)=>{"use strict";p();var rxo=X7(),nxo=a((t,e)=>{let r=rxo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");qin.exports=nxo});var wx=I((RXl,Gin)=>{"use strict";p();var Hin=bA(),ixo=a((t,e,r)=>new Hin(t,r).compare(new Hin(e,r)),"compare");Gin.exports=ixo});var Vin=I((DXl,$in)=>{"use strict";p();var oxo=wx(),sxo=a((t,e,r)=>oxo(e,t,r),"rcompare");$in.exports=sxo});var zin=I((OXl,Win)=>{"use strict";p();var axo=wx(),cxo=a((t,e)=>axo(t,e,!0),"compareLoose");Win.exports=cxo});var YHe=I((FXl,Kin)=>{"use strict";p();var Yin=bA(),lxo=a((t,e,r)=>{let n=new Yin(t,r),o=new Yin(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");Kin.exports=lxo});var Zin=I((qXl,Jin)=>{"use strict";p();var uxo=YHe(),dxo=a((t,e)=>t.sort((r,n)=>uxo(r,n,e)),"sort");Jin.exports=dxo});var eon=I((GXl,Xin)=>{"use strict";p();var fxo=YHe(),pxo=a((t,e)=>t.sort((r,n)=>fxo(n,r,e)),"rsort");Xin.exports=pxo});var sTe=I((WXl,ton)=>{"use strict";p();var hxo=wx(),mxo=a((t,e,r)=>hxo(t,e,r)>0,"gt");ton.exports=mxo});var KHe=I((KXl,ron)=>{"use strict";p();var gxo=wx(),Axo=a((t,e,r)=>gxo(t,e,r)<0,"lt");ron.exports=Axo});var QBt=I((XXl,non)=>{"use strict";p();var yxo=wx(),Exo=a((t,e,r)=>yxo(t,e,r)===0,"eq");non.exports=Exo});var qBt=I((reu,ion)=>{"use strict";p();var _xo=wx(),vxo=a((t,e,r)=>_xo(t,e,r)!==0,"neq");ion.exports=vxo});var JHe=I((oeu,oon)=>{"use strict";p();var Cxo=wx(),bxo=a((t,e,r)=>Cxo(t,e,r)>=0,"gte");oon.exports=bxo});var ZHe=I((ceu,son)=>{"use strict";p();var Sxo=wx(),Txo=a((t,e,r)=>Sxo(t,e,r)<=0,"lte");son.exports=Txo});var jBt=I((deu,aon)=>{"use strict";p();var Ixo=QBt(),xxo=qBt(),wxo=sTe(),Rxo=JHe(),kxo=KHe(),Pxo=ZHe(),Dxo=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 Ixo(t,r,n);case"!=":return xxo(t,r,n);case">":return wxo(t,r,n);case">=":return Rxo(t,r,n);case"<":return kxo(t,r,n);case"<=":return Pxo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");aon.exports=Dxo});var lon=I((heu,con)=>{"use strict";p();var Nxo=bA(),Mxo=X7(),{safeRe:XHe,t:eGe}=Nce(),Oxo=a((t,e)=>{if(t instanceof Nxo)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?XHe[eGe.COERCEFULL]:XHe[eGe.COERCE]);else{let u=e.includePrerelease?XHe[eGe.COERCERTLFULL]:XHe[eGe.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 Mxo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");con.exports=Oxo});var don=I((Aeu,uon)=>{"use strict";p();var Lxo=X7(),Bxo=Dce(),Fxo=bA(),Uxo=a((t,e,r)=>{if(!Bxo.RELEASE_TYPES.includes(e))return null;let n=Qxo(t,r);return n&&qxo(n,e)},"truncate"),Qxo=a((t,e)=>{let r=t instanceof Fxo?t.version:t;return Lxo(r,e)},"cloneInputVersion"),qxo=a((t,e)=>{if(jxo(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"),jxo=a(t=>t.startsWith("pre"),"isPrerelease");uon.exports=Uxo});var pon=I((_eu,fon)=>{"use strict";p();var HBt=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}};fon.exports=HBt});var Rx=I((beu,Aon)=>{"use strict";p();var Hxo=/\s+/g,GBt=class t{static{a(this,"Range")}constructor(e,r){if(r=$xo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof $Bt)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(Hxo," "),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=>!mon(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&&ewo(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(Xxo,"");let n=((this.options.includePrerelease&&Jxo)|(this.options.loose&&Zxo))+":"+e,o=hon.get(n);if(o)return o;let s=this.options.loose,c=s?N_[SA.HYPHENRANGELOOSE]:N_[SA.HYPHENRANGE];e=e.replace(c,dwo(this.options.includePrerelease)),Ku("hyphen replace",e),e=e.replace(N_[SA.COMPARATORTRIM],zxo),Ku("comparator trim",e),e=e.replace(N_[SA.TILDETRIM],Yxo),Ku("tilde trim",e),e=e.replace(N_[SA.CARETTRIM],Kxo),Ku("caret trim",e);let l=e.split(" ").map(h=>two(h,this.options)).join(" ").split(/\s+/).map(h=>uwo(h,this.options));s&&(l=l.filter(h=>(Ku("loose invalid filter",h,this.options),!!h.match(N_[SA.COMPARATORLOOSE])))),Ku("range list",l);let u=new Map,d=l.map(h=>new $Bt(h,this.options));for(let h of d){if(mon(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return hon.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>gon(n,r)&&e.set.some(o=>gon(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 Vxo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),ewo=a(t=>t.value==="","isAny"),gon=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"),two=a((t,e)=>(t=t.replace(N_[SA.BUILD],""),Ku("comp",t,e),t=owo(t,e),Ku("caret",t),t=nwo(t,e),Ku("tildes",t),t=awo(t,e),Ku("xrange",t),t=lwo(t,e),Ku("stars",t),t),"parseComparator"),n0=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),rwo=a((t,e,r)=>n0(t)&&!n0(e)||n0(e)&&r&&!n0(r),"invalidXRangeOrder"),nwo=a((t,e)=>t.trim().split(/\s+/).map(r=>iwo(r,e)).join(" "),"replaceTildes"),iwo=a((t,e)=>{let r=e.loose?N_[SA.TILDELOOSE]:N_[SA.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Ku("tilde",t,o,s,c,l,u);let d;return n0(s)?d="":n0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:n0(l)?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:u?(Ku("replaceTilde pr",u),d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`):d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`,Ku("tilde return",d),d})},"replaceTilde"),owo=a((t,e)=>t.trim().split(/\s+/).map(r=>swo(r,e)).join(" "),"replaceCarets"),swo=a((t,e)=>{Ku("caret",t,e);let r=e.loose?N_[SA.CARETLOOSE]:N_[SA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Ku("caret",t,o,s,c,l,u);let d;return n0(s)?d="":n0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:n0(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(Ku("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`):(Ku("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`),Ku("caret return",d),d})},"replaceCaret"),awo=a((t,e)=>(Ku("replaceXRanges",t,e),t.split(/\s+/).map(r=>cwo(r,e)).join(" ")),"replaceXRanges"),cwo=a((t,e)=>{t=t.trim();let r=e.loose?N_[SA.XRANGELOOSE]:N_[SA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{if(Ku("xRange",t,n,o,s,c,l,u),rwo(s,c,l))return t;let d=n0(s),f=d||n0(c),h=f||n0(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`),Ku("xRange return",n),n})},"replaceXRange"),lwo=a((t,e)=>(Ku("replaceStars",t,e),t.trim().replace(N_[SA.STAR],"")),"replaceStars"),uwo=a((t,e)=>(Ku("replaceGTE0",t,e),t.trim().replace(N_[e.includePrerelease?SA.GTE0PRE:SA.GTE0],"")),"replaceGTE0"),dwo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(n0(n)?r="":n0(o)?r=`>=${n}.0.0${t?"-0":""}`:n0(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,n0(d)?u="":n0(f)?u=`<${+d+1}.0.0-0`:n0(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"),fwo=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 aTe=I((Ieu,bon)=>{"use strict";p();var cTe=Symbol("SemVer ANY"),zBt=class t{static{a(this,"Comparator")}static get ANY(){return cTe}constructor(e,r){if(r=yon(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),WBt("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===cTe?this.value="":this.value=this.operator+this.semver.version,WBt("comp",this)}parse(e){let r=this.options.loose?Eon[_on.COMPARATORLOOSE]:Eon[_on.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 von(n[2],this.options.loose):this.semver=cTe}toString(){return this.value}test(e){if(WBt("Comparator.test",e,this.options.loose),this.semver===cTe||e===cTe)return!0;if(typeof e=="string")try{e=new von(e,this.options)}catch{return!1}return VBt(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 Con(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Con(this.value,r).test(e.semver):(r=yon(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("=")||VBt(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||VBt(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};bon.exports=zBt;var yon=GHe(),{safeRe:Eon,t:_on}=Nce(),VBt=jBt(),WBt=oTe(),von=bA(),Con=Rx()});var lTe=I((Reu,Son)=>{"use strict";p();var pwo=Rx(),hwo=a((t,e,r)=>{try{e=new pwo(e,r)}catch{return!1}return e.test(t)},"satisfies");Son.exports=hwo});var Ion=I((Deu,Ton)=>{"use strict";p();var mwo=Rx(),gwo=a((t,e)=>new mwo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");Ton.exports=gwo});var won=I((Oeu,xon)=>{"use strict";p();var Awo=bA(),ywo=Rx(),Ewo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new ywo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Awo(n,r))}),n},"maxSatisfying");xon.exports=Ewo});var kon=I((Feu,Ron)=>{"use strict";p();var _wo=bA(),vwo=Rx(),Cwo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new vwo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new _wo(n,r))}),n},"minSatisfying");Ron.exports=Cwo});var Non=I((qeu,Don)=>{"use strict";p();var YBt=bA(),bwo=Rx(),Pon=sTe(),Swo=a((t,e)=>{t=new bwo(t,e);let r=new YBt("0.0.0");if(t.test(r)||(r=new YBt("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new YBt(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||Pon(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||Pon(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");Don.exports=Swo});var Oon=I((Geu,Mon)=>{"use strict";p();var Two=Rx(),Iwo=a((t,e)=>{try{return new Two(t,e).range||"*"}catch{return null}},"validRange");Mon.exports=Iwo});var tGe=I((Weu,Uon)=>{"use strict";p();var xwo=bA(),Fon=aTe(),{ANY:wwo}=Fon,Rwo=Rx(),kwo=lTe(),Lon=sTe(),Bon=KHe(),Pwo=ZHe(),Dwo=JHe(),Nwo=a((t,e,r,n)=>{t=new xwo(t,n),e=new Rwo(e,n);let o,s,c,l,u;switch(r){case">":o=Lon,s=Pwo,c=Bon,l=">",u=">=";break;case"<":o=Bon,s=Dwo,c=Lon,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(kwo(t,e,n))return!1;for(let d=0;d{g.semver===wwo&&(g=new Fon(">=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");Uon.exports=Nwo});var qon=I((Keu,Qon)=>{"use strict";p();var Mwo=tGe(),Owo=a((t,e,r)=>Mwo(t,e,">",r),"gtr");Qon.exports=Owo});var Hon=I((Xeu,jon)=>{"use strict";p();var Lwo=tGe(),Bwo=a((t,e,r)=>Lwo(t,e,"<",r),"ltr");jon.exports=Bwo});var Von=I((rtu,$on)=>{"use strict";p();var Gon=Rx(),Fwo=a((t,e,r)=>(t=new Gon(t,r),e=new Gon(e,r),t.intersects(e,r)),"intersects");$on.exports=Fwo});var zon=I((otu,Won)=>{"use strict";p();var Uwo=lTe(),Qwo=wx();Won.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>Qwo(f,h,r));for(let f of c)Uwo(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 Yon=Rx(),ZBt=aTe(),{ANY:KBt}=ZBt,JBt=lTe(),XBt=wx(),qwo=a((t,e,r={})=>{if(t===e)return!0;t=new Yon(t,r),e=new Yon(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=Hwo(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),jwo=[new ZBt(">=0.0.0-0")],Kon=[new ZBt(">=0.0.0")],Hwo=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===KBt){if(e.length===1&&e[0].semver===KBt)return!0;r.includePrerelease?t=jwo:t=Kon}if(e.length===1&&e[0].semver===KBt){if(r.includePrerelease)return!0;e=Kon}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=Jon(o,g,r):g.operator==="<"||g.operator==="<="?s=Zon(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=XBt(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&&!JBt(g,String(o),r)||s&&!JBt(g,String(s),r))return null;for(let A of e)if(!JBt(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=Jon(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=Zon(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"),Jon=a((t,e,r)=>{if(!t)return e;let n=XBt(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),Zon=a((t,e,r)=>{if(!t)return e;let n=XBt(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");Xon.exports=qwo});var AP=I((utu,nsn)=>{"use strict";p();var e3t=Nce(),tsn=Dce(),Gwo=bA(),rsn=BBt(),$wo=X7(),Vwo=Iin(),Wwo=win(),zwo=Pin(),Ywo=Min(),Kwo=Lin(),Jwo=Fin(),Zwo=Qin(),Xwo=jin(),eRo=wx(),tRo=Vin(),rRo=zin(),nRo=YHe(),iRo=Zin(),oRo=eon(),sRo=sTe(),aRo=KHe(),cRo=QBt(),lRo=qBt(),uRo=JHe(),dRo=ZHe(),fRo=jBt(),pRo=lon(),hRo=don(),mRo=aTe(),gRo=Rx(),ARo=lTe(),yRo=Ion(),ERo=won(),_Ro=kon(),vRo=Non(),CRo=Oon(),bRo=tGe(),SRo=qon(),TRo=Hon(),IRo=Von(),xRo=zon(),wRo=esn();nsn.exports={parse:$wo,valid:Vwo,clean:Wwo,inc:zwo,diff:Ywo,major:Kwo,minor:Jwo,patch:Zwo,prerelease:Xwo,compare:eRo,rcompare:tRo,compareLoose:rRo,compareBuild:nRo,sort:iRo,rsort:oRo,gt:sRo,lt:aRo,eq:cRo,neq:lRo,gte:uRo,lte:dRo,cmp:fRo,coerce:pRo,truncate:hRo,Comparator:mRo,Range:gRo,satisfies:ARo,toComparators:yRo,maxSatisfying:ERo,minSatisfying:_Ro,minVersion:vRo,validRange:CRo,outside:bRo,gtr:SRo,ltr:TRo,intersects:IRo,simplifyRange:xRo,subset:wRo,SemVer:Gwo,re:e3t.re,src:e3t.src,tokens:e3t.t,SEMVER_SPEC_VERSION:tsn.SEMVER_SPEC_VERSION,RELEASE_TYPES:tsn.RELEASE_TYPES,compareIdentifiers:rsn.compareIdentifiers,rcompareIdentifiers:rsn.rcompareIdentifiers}});var osn=I((ftu,isn)=>{p();var RRo=AP();isn.exports=RRo.satisfies(process.version,">=15.7.0")});var asn=I((htu,ssn)=>{p();var kRo=AP();ssn.exports=kRo.satisfies(process.version,">=16.9.0")});var t3t=I((gtu,csn)=>{p();var PRo=osn(),DRo=asn(),NRo={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},MRo={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};csn.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=NRo[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(PRo)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=MRo[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(DRo){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 r3t=I((ytu,lsn)=>{p();var ORo=AP();lsn.exports=ORo.satisfies(process.version,"^6.12.0 || >=8.0.0")});var fsn=I((_tu,dsn)=>{p();var pu=iTe(),LRo=PBt(),usn=DBt(),BRo=kBt(),FRo=MBt(),URo=t3t(),QRo=r3t(),qRo=UHe(),{KeyObject:jRo,createSecretKey:HRo,createPublicKey:GRo}=require("crypto"),n3t=["RS256","RS384","RS512"],$Ro=["ES256","ES384","ES512"],i3t=["RS256","RS384","RS512"],VRo=["HS256","HS384","HS512"];QRo&&(n3t.splice(n3t.length,0,"PS256","PS384","PS512"),i3t.splice(i3t.length,0,"PS256","PS384","PS512"));dsn.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 pu("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new pu("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new pu("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new pu("jwt must be provided"));if(typeof t!="string")return o(new pu("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new pu("jwt malformed"));let l;try{l=BRo(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new pu("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new pu("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 pu("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new pu("jwt signature is required"));if(m&&!h)return o(new pu("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new pu('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof jRo))try{h=GRo(h)}catch{try{h=HRo(typeof h=="string"?Buffer.from(h):h)}catch{return o(new pu("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=VRo:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=i3t:h.asymmetricKeyType==="ec"?r.algorithms=$Ro:r.algorithms=n3t),r.algorithms.indexOf(l.header.alg)===-1)return o(new pu("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new pu(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new pu(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{URo(u.alg,h)}catch(y){return o(y)}let g;try{g=qRo.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new pu("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new pu("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new LRo("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new pu("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new usn("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(b){return b instanceof RegExp?b.test(v):b===v})}))return o(new pu("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 pu("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new pu("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new pu("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new pu("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new pu("iat required when maxAge is specified"));let y=FRo(r.maxAge,A.iat);if(typeof y>"u")return o(new pu('"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 usn("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 ysn=I((btu,Asn)=>{p();var psn=1/0,msn=9007199254740991,WRo=17976931348623157e292,hsn=NaN,zRo="[object Arguments]",YRo="[object Function]",KRo="[object GeneratorFunction]",JRo="[object String]",ZRo="[object Symbol]",XRo=/^\s+|\s+$/g,eko=/^[-+]0x[0-9a-f]+$/i,tko=/^0b[01]+$/i,rko=/^0o[0-7]+$/i,nko=/^(?:0|[1-9]\d*)$/,iko=parseInt;function oko(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&ako(t,e,r)>-1}a(Eko,"includes");function _ko(t){return vko(t)&&s3t.call(t,"callee")&&(!fko.call(t,"callee")||nGe.call(t)==zRo)}a(_ko,"isArguments");var gsn=Array.isArray;function a3t(t){return t!=null&&bko(t.length)&&!Cko(t)}a(a3t,"isArrayLike");function vko(t){return c3t(t)&&a3t(t)}a(vko,"isArrayLikeObject");function Cko(t){var e=o3t(t)?nGe.call(t):"";return e==YRo||e==KRo}a(Cko,"isFunction");function bko(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=msn}a(bko,"isLength");function o3t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(o3t,"isObject");function c3t(t){return!!t&&typeof t=="object"}a(c3t,"isObjectLike");function Sko(t){return typeof t=="string"||!gsn(t)&&c3t(t)&&nGe.call(t)==JRo}a(Sko,"isString");function Tko(t){return typeof t=="symbol"||c3t(t)&&nGe.call(t)==ZRo}a(Tko,"isSymbol");function Iko(t){if(!t)return t===0?t:0;if(t=wko(t),t===psn||t===-psn){var e=t<0?-1:1;return e*WRo}return t===t?t:0}a(Iko,"toFinite");function xko(t){var e=Iko(t),r=e%1;return e===e?r?e-r:e:0}a(xko,"toInteger");function wko(t){if(typeof t=="number")return t;if(Tko(t))return hsn;if(o3t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=o3t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(XRo,"");var r=tko.test(t);return r||rko.test(t)?iko(t.slice(2),r?2:8):eko.test(t)?hsn:+t}a(wko,"toNumber");function Rko(t){return a3t(t)?mko(t):gko(t)}a(Rko,"keys");function kko(t){return t?uko(t,Rko(t)):[]}a(kko,"values");Asn.exports=Eko});var _sn=I((Itu,Esn)=>{p();var Pko="[object Boolean]",Dko=Object.prototype,Nko=Dko.toString;function Mko(t){return t===!0||t===!1||Oko(t)&&Nko.call(t)==Pko}a(Mko,"isBoolean");function Oko(t){return!!t&&typeof t=="object"}a(Oko,"isObjectLike");Esn.exports=Mko});var Tsn=I((Rtu,Ssn)=>{p();var vsn=1/0,Lko=17976931348623157e292,Csn=NaN,Bko="[object Symbol]",Fko=/^\s+|\s+$/g,Uko=/^[-+]0x[0-9a-f]+$/i,Qko=/^0b[01]+$/i,qko=/^0o[0-7]+$/i,jko=parseInt,Hko=Object.prototype,Gko=Hko.toString;function $ko(t){return typeof t=="number"&&t==Yko(t)}a($ko,"isInteger");function bsn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(bsn,"isObject");function Vko(t){return!!t&&typeof t=="object"}a(Vko,"isObjectLike");function Wko(t){return typeof t=="symbol"||Vko(t)&&Gko.call(t)==Bko}a(Wko,"isSymbol");function zko(t){if(!t)return t===0?t:0;if(t=Kko(t),t===vsn||t===-vsn){var e=t<0?-1:1;return e*Lko}return t===t?t:0}a(zko,"toFinite");function Yko(t){var e=zko(t),r=e%1;return e===e?r?e-r:e:0}a(Yko,"toInteger");function Kko(t){if(typeof t=="number")return t;if(Wko(t))return Csn;if(bsn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=bsn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Fko,"");var r=Qko.test(t);return r||qko.test(t)?jko(t.slice(2),r?2:8):Uko.test(t)?Csn:+t}a(Kko,"toNumber");Ssn.exports=$ko});var xsn=I((Dtu,Isn)=>{p();var Jko="[object Number]",Zko=Object.prototype,Xko=Zko.toString;function ePo(t){return!!t&&typeof t=="object"}a(ePo,"isObjectLike");function tPo(t){return typeof t=="number"||ePo(t)&&Xko.call(t)==Jko}a(tPo,"isNumber");Isn.exports=tPo});var Psn=I((Otu,ksn)=>{p();var rPo="[object Object]";function nPo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(nPo,"isHostObject");function iPo(t,e){return function(r){return t(e(r))}}a(iPo,"overArg");var oPo=Function.prototype,wsn=Object.prototype,Rsn=oPo.toString,sPo=wsn.hasOwnProperty,aPo=Rsn.call(Object),cPo=wsn.toString,lPo=iPo(Object.getPrototypeOf,Object);function uPo(t){return!!t&&typeof t=="object"}a(uPo,"isObjectLike");function dPo(t){if(!uPo(t)||cPo.call(t)!=rPo||nPo(t))return!1;var e=lPo(t);if(e===null)return!0;var r=sPo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Rsn.call(r)==aPo}a(dPo,"isPlainObject");ksn.exports=dPo});var Nsn=I((Ftu,Dsn)=>{p();var fPo="[object String]",pPo=Object.prototype,hPo=pPo.toString,mPo=Array.isArray;function gPo(t){return!!t&&typeof t=="object"}a(gPo,"isObjectLike");function APo(t){return typeof t=="string"||!mPo(t)&&gPo(t)&&hPo.call(t)==fPo}a(APo,"isString");Dsn.exports=APo});var Fsn=I((qtu,Bsn)=>{p();var yPo="Expected a function",Msn=1/0,EPo=17976931348623157e292,Osn=NaN,_Po="[object Symbol]",vPo=/^\s+|\s+$/g,CPo=/^[-+]0x[0-9a-f]+$/i,bPo=/^0b[01]+$/i,SPo=/^0o[0-7]+$/i,TPo=parseInt,IPo=Object.prototype,xPo=IPo.toString;function wPo(t,e){var r;if(typeof e!="function")throw new TypeError(yPo);return t=NPo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(wPo,"before");function RPo(t){return wPo(2,t)}a(RPo,"once");function Lsn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Lsn,"isObject");function kPo(t){return!!t&&typeof t=="object"}a(kPo,"isObjectLike");function PPo(t){return typeof t=="symbol"||kPo(t)&&xPo.call(t)==_Po}a(PPo,"isSymbol");function DPo(t){if(!t)return t===0?t:0;if(t=MPo(t),t===Msn||t===-Msn){var e=t<0?-1:1;return e*EPo}return t===t?t:0}a(DPo,"toFinite");function NPo(t){var e=DPo(t),r=e%1;return e===e?r?e-r:e:0}a(NPo,"toInteger");function MPo(t){if(typeof t=="number")return t;if(PPo(t))return Osn;if(Lsn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Lsn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(vPo,"");var r=bPo.test(t);return r||SPo.test(t)?TPo(t.slice(2),r?2:8):CPo.test(t)?Osn:+t}a(MPo,"toNumber");Bsn.exports=RPo});var Wsn=I((Gtu,Vsn)=>{p();var Usn=MBt(),OPo=r3t(),LPo=t3t(),Qsn=UHe(),BPo=ysn(),iGe=_sn(),qsn=Tsn(),l3t=xsn(),Hsn=Psn(),eQ=Nsn(),FPo=Fsn(),{KeyObject:UPo,createSecretKey:QPo,createPrivateKey:qPo}=require("crypto"),Gsn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];OPo&&Gsn.splice(3,0,"PS256","PS384","PS512");var jPo={expiresIn:{isValid:a(function(t){return qsn(t)||eQ(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return qsn(t)||eQ(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return eQ(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:BPo.bind(null,Gsn),message:'"algorithm" must be a valid string enum value'},header:{isValid:Hsn,message:'"header" must be an object'},encoding:{isValid:eQ,message:'"encoding" must be a string'},issuer:{isValid:eQ,message:'"issuer" must be a string'},subject:{isValid:eQ,message:'"subject" must be a string'},jwtid:{isValid:eQ,message:'"jwtid" must be a string'},noTimestamp:{isValid:iGe,message:'"noTimestamp" must be a boolean'},keyid:{isValid:eQ,message:'"keyid" must be a string'},mutatePayload:{isValid:iGe,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:iGe,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:iGe,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},HPo={iat:{isValid:l3t,message:'"iat" should be a number of seconds'},exp:{isValid:l3t,message:'"exp" should be a number of seconds'},nbf:{isValid:l3t,message:'"nbf" should be a number of seconds'}};function $sn(t,e,r,n){if(!Hsn(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($sn,"validate");function GPo(t){return $sn(jPo,!1,t,"options")}a(GPo,"validateOptions");function $Po(t){return $sn(HPo,!0,t,"payload")}a($Po,"validatePayload");var jsn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},VPo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Vsn.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 UPo))try{e=qPo(e)}catch{try{e=QPo(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{$Po(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=VPo.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{GPo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{LPo(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=Usn(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=Usn(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(jsn).forEach(function(d){let f=jsn[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&&FPo(n),Qsn.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=Qsn.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 Ysn=I((Wtu,zsn)=>{p();zsn.exports={decode:kBt(),verify:fsn(),sign:Wsn(),JsonWebTokenError:iTe(),NotBeforeError:PBt(),TokenExpiredError:DBt()}});var Q3t=I((qlu,Yan)=>{p();function z2o(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=NBt(),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 P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,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(E=>{m=E},"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();CS.formatArgs=K2o;CS.save=J2o;CS.load=Z2o;CS.useColors=Y2o;CS.storage=X2o();CS.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`."))}})();CS.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 Y2o(){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(Y2o,"useColors");function K2o(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+OGe.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(K2o,"formatArgs");CS.log=console.debug||console.log||(()=>{});function J2o(t){try{t?CS.storage.setItem("debug",t):CS.storage.removeItem("debug")}catch{}}a(J2o,"save");function Z2o(){let t;try{t=CS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(Z2o,"load");function X2o(){try{return localStorage}catch{}}a(X2o,"localstorage");OGe.exports=Q3t()(CS);var{formatters:eDo}=OGe.exports;eDo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Zan=I((Vlu,Jan)=>{"use strict";p();Jan.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 tDo=require("os"),Xan=require("tty"),Px=Zan(),{env:og}=process,nQ;Px("no-color")||Px("no-colors")||Px("color=false")||Px("color=never")?nQ=0:(Px("color")||Px("colors")||Px("color=true")||Px("color=always"))&&(nQ=1);"FORCE_COLOR"in og&&(og.FORCE_COLOR==="true"?nQ=1:og.FORCE_COLOR==="false"?nQ=0:nQ=og.FORCE_COLOR.length===0?1:Math.min(parseInt(og.FORCE_COLOR,10),3));function q3t(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(q3t,"translateLevel");function j3t(t,e){if(nQ===0)return 0;if(Px("color=16m")||Px("color=full")||Px("color=truecolor"))return 3;if(Px("color=256"))return 2;if(t&&!e&&nQ===void 0)return 0;let r=nQ||0;if(og.TERM==="dumb")return r;if(process.platform==="win32"){let n=tDo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in og)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in og)||og.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in og)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(og.TEAMCITY_VERSION)?1:0;if(og.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in og){let n=parseInt((og.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(og.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(og.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(og.TERM)||"COLORTERM"in og?1:r}a(j3t,"supportsColor");function rDo(t){let e=j3t(t,t&&t.isTTY);return q3t(e)}a(rDo,"getSupportLevel");ecn.exports={supportsColor:rDo,stdout:q3t(j3t(!0,Xan.isatty(1))),stderr:q3t(j3t(!0,Xan.isatty(2)))}});var rcn=I((IA,FGe)=>{p();var nDo=require("tty"),BGe=require("util");IA.init=uDo;IA.log=aDo;IA.formatArgs=oDo;IA.save=cDo;IA.load=lDo;IA.useColors=iDo;IA.destroy=BGe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");IA.colors=[6,2,3,4,5,1];try{let t=LGe();t&&(t.stderr||t).level>=2&&(IA.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{}IA.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 iDo(){return"colors"in IA.inspectOpts?!!IA.inspectOpts.colors:nDo.isatty(process.stderr.fd)}a(iDo,"useColors");function oDo(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".`,nTe="secret must be a string or buffer",Ice="key must be a string or a buffer",zTo="key must be a string, a buffer or an object",IBt=typeof wx.createPublicKey=="function";IBt&&(Ice+=" or a KeyObject",nTe+="or a KeyObject");function Lnn(t){if(!xce.isBuffer(t)&&typeof t!="string"&&(!IBt||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw AP(Ice)}a(Lnn,"checkIsPublicKey");function Bnn(t){if(!xce.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw AP(zTo)}a(Bnn,"checkIsPrivateKey");function YTo(t){if(!xce.isBuffer(t)){if(typeof t=="string")return t;if(!IBt||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw AP(nTe)}}a(YTo,"checkIsSecretKey");function xBt(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(xBt,"fromBase64");function Fnn(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var oIo=require("buffer").Buffer;Hnn.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||oIo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var Ynn=I((CZl,znn)=>{p();var sIo=Tce().Buffer,Gnn=CBt(),aIo=wBt(),cIo=require("stream"),$nn=RBt(),kBt=require("util");function Vnn(t,e){return sIo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(Vnn,"base64url");function lIo(t,e,r){r=r||"utf8";var n=Vnn($nn(t),"binary"),o=Vnn($nn(e),r);return kBt.format("%s.%s",n,o)}a(lIo,"jwsSecuredInput");function Wnn(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=aIo(e.alg),c=lIo(e,r,o),l=s.sign(c,n);return kBt.format("%s.%s",c,l)}a(Wnn,"jwsSign");function UHe(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 Gnn(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Gnn(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(UHe,"SignStream");kBt.inherits(UHe,cIo);UHe.prototype.sign=a(function(){try{var e=Wnn({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");UHe.sign=Wnn;znn.exports=UHe});var oin=I((TZl,iin)=>{p();var Jnn=Tce().Buffer,Knn=CBt(),uIo=wBt(),dIo=require("stream"),Znn=RBt(),fIo=require("util"),pIo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function hIo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(hIo,"isObject");function mIo(t){if(hIo(t))return t;try{return JSON.parse(t)}catch{return}}a(mIo,"safeJsonParse");function Xnn(t){var e=t.split(".",1)[0];return mIo(Jnn.from(e,"base64").toString("binary"))}a(Xnn,"headerFromJWS");function gIo(t){return t.split(".",2).join(".")}a(gIo,"securedInputFromJWS");function ein(t){return t.split(".")[2]}a(ein,"signatureFromJWS");function AIo(t,e){e=e||"utf8";var r=t.split(".")[1];return Jnn.from(r,"base64").toString(e)}a(AIo,"payloadFromJWS");function tin(t){return pIo.test(t)&&!!Xnn(t)}a(tin,"isValidJws");function rin(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=Znn(t);var o=ein(t),s=gIo(t),c=uIo(e);return c.verify(s,o,r)}a(rin,"jwsVerify");function nin(t,e){if(e=e||{},t=Znn(t),!tin(t))return null;var r=Xnn(t);if(!r)return null;var n=AIo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:ein(t)}}a(nin,"jwsDecode");function wce(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 Knn(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new Knn(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(wce,"VerifyStream");fIo.inherits(wce,dIo);wce.prototype.verify=a(function(){try{var e=rin(this.signature.buffer,this.algorithm,this.key.buffer),r=nin(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");wce.decode=nin;wce.isValid=tin;wce.verify=rin;iin.exports=wce});var qHe=I(X7=>{p();var sin=Ynn(),QHe=oin(),yIo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];X7.ALGORITHMS=yIo;X7.sign=sin.sign;X7.verify=QHe.verify;X7.decode=QHe.decode;X7.isValid=QHe.isValid;X7.createSign=a(function(e){return new sin(e)},"createSign");X7.createVerify=a(function(e){return new QHe(e)},"createVerify")});var PBt=I((PZl,ain)=>{p();var EIo=qHe();ain.exports=function(t,e){e=e||{};var r=EIo.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 oTe=I((NZl,cin)=>{p();var jHe=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");jHe.prototype=Object.create(Error.prototype);jHe.prototype.constructor=jHe;cin.exports=jHe});var DBt=I((LZl,uin)=>{p();var lin=oTe(),HHe=a(function(t,e){lin.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");HHe.prototype=Object.create(lin.prototype);HHe.prototype.constructor=HHe;uin.exports=HHe});var NBt=I((UZl,fin)=>{p();var din=oTe(),GHe=a(function(t,e){din.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");GHe.prototype=Object.create(din.prototype);GHe.prototype.constructor=GHe;fin.exports=GHe});var MBt=I((jZl,pin)=>{p();var Rce=1e3,kce=Rce*60,Pce=kce*60,bY=Pce*24,_Io=bY*7,vIo=bY*365.25;pin.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return CIo(t);if(r==="number"&&isFinite(t))return e.long?SIo(t):bIo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function CIo(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*vIo;case"weeks":case"week":case"w":return r*_Io;case"days":case"day":case"d":return r*bY;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Pce;case"minutes":case"minute":case"mins":case"min":case"m":return r*kce;case"seconds":case"second":case"secs":case"sec":case"s":return r*Rce;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(CIo,"parse");function bIo(t){var e=Math.abs(t);return e>=bY?Math.round(t/bY)+"d":e>=Pce?Math.round(t/Pce)+"h":e>=kce?Math.round(t/kce)+"m":e>=Rce?Math.round(t/Rce)+"s":t+"ms"}a(bIo,"fmtShort");function SIo(t){var e=Math.abs(t);return e>=bY?$He(t,e,bY,"day"):e>=Pce?$He(t,e,Pce,"hour"):e>=kce?$He(t,e,kce,"minute"):e>=Rce?$He(t,e,Rce,"second"):t+" ms"}a(SIo,"fmtLong");function $He(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a($He,"plural")});var OBt=I(($Zl,hin)=>{p();var TIo=MBt();hin.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=TIo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var Dce=I((WZl,min)=>{"use strict";p();var IIo="2.0.0",xIo=Number.MAX_SAFE_INTEGER||9007199254740991,wIo=16,RIo=250,kIo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];min.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:wIo,MAX_SAFE_BUILD_LENGTH:RIo,MAX_SAFE_INTEGER:xIo,RELEASE_TYPES:kIo,SEMVER_SPEC_VERSION:IIo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var sTe=I((YZl,gin)=>{"use strict";p();var PIo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};gin.exports=PIo});var Nce=I(($M,Ain)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:LBt,MAX_SAFE_BUILD_LENGTH:DIo,MAX_LENGTH:NIo}=Dce(),MIo=sTe();$M=Ain.exports={};var OIo=$M.re=[],LIo=$M.safeRe=[],xn=$M.src=[],BIo=$M.safeSrc=[],wn=$M.t={},FIo=0,BBt="[a-zA-Z0-9-]",UIo=[["\\s",1],["\\d",NIo],[BBt,DIo]],QIo=a(t=>{for(let[e,r]of UIo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Qo=a((t,e,r)=>{let n=QIo(e),o=FIo++;MIo(t,o,e),wn[t]=o,xn[o]=e,BIo[o]=n,OIo[o]=new RegExp(e,r?"g":void 0),LIo[o]=new RegExp(n,r?"g":void 0)},"createToken");Qo("NUMERICIDENTIFIER","0|[1-9]\\d*");Qo("NUMERICIDENTIFIERLOOSE","\\d+");Qo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${BBt}*`);Qo("MAINVERSION",`(${xn[wn.NUMERICIDENTIFIER]})\\.(${xn[wn.NUMERICIDENTIFIER]})\\.(${xn[wn.NUMERICIDENTIFIER]})`);Qo("MAINVERSIONLOOSE",`(${xn[wn.NUMERICIDENTIFIERLOOSE]})\\.(${xn[wn.NUMERICIDENTIFIERLOOSE]})\\.(${xn[wn.NUMERICIDENTIFIERLOOSE]})`);Qo("PRERELEASEIDENTIFIER",`(?:${xn[wn.NONNUMERICIDENTIFIER]}|${xn[wn.NUMERICIDENTIFIER]})`);Qo("PRERELEASEIDENTIFIERLOOSE",`(?:${xn[wn.NONNUMERICIDENTIFIER]}|${xn[wn.NUMERICIDENTIFIERLOOSE]})`);Qo("PRERELEASE",`(?:-(${xn[wn.PRERELEASEIDENTIFIER]}(?:\\.${xn[wn.PRERELEASEIDENTIFIER]})*))`);Qo("PRERELEASELOOSE",`(?:-?(${xn[wn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${xn[wn.PRERELEASEIDENTIFIERLOOSE]})*))`);Qo("BUILDIDENTIFIER",`${BBt}+`);Qo("BUILD",`(?:\\+(${xn[wn.BUILDIDENTIFIER]}(?:\\.${xn[wn.BUILDIDENTIFIER]})*))`);Qo("FULLPLAIN",`v?${xn[wn.MAINVERSION]}${xn[wn.PRERELEASE]}?${xn[wn.BUILD]}?`);Qo("FULL",`^${xn[wn.FULLPLAIN]}$`);Qo("LOOSEPLAIN",`[v=\\s]*${xn[wn.MAINVERSIONLOOSE]}${xn[wn.PRERELEASELOOSE]}?${xn[wn.BUILD]}?`);Qo("LOOSE",`^${xn[wn.LOOSEPLAIN]}$`);Qo("GTLT","((?:<|>)?=?)");Qo("XRANGEIDENTIFIERLOOSE",`${xn[wn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Qo("XRANGEIDENTIFIER",`${xn[wn.NUMERICIDENTIFIER]}|x|X|\\*`);Qo("XRANGEPLAIN",`[v=\\s]*(${xn[wn.XRANGEIDENTIFIER]})(?:\\.(${xn[wn.XRANGEIDENTIFIER]})(?:\\.(${xn[wn.XRANGEIDENTIFIER]})(?:${xn[wn.PRERELEASE]})?${xn[wn.BUILD]}?)?)?`);Qo("XRANGEPLAINLOOSE",`[v=\\s]*(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:${xn[wn.PRERELEASELOOSE]})?${xn[wn.BUILD]}?)?)?`);Qo("XRANGE",`^${xn[wn.GTLT]}\\s*${xn[wn.XRANGEPLAIN]}$`);Qo("XRANGELOOSE",`^${xn[wn.GTLT]}\\s*${xn[wn.XRANGEPLAINLOOSE]}$`);Qo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${LBt}})(?:\\.(\\d{1,${LBt}}))?(?:\\.(\\d{1,${LBt}}))?`);Qo("COERCE",`${xn[wn.COERCEPLAIN]}(?:$|[^\\d])`);Qo("COERCEFULL",xn[wn.COERCEPLAIN]+`(?:${xn[wn.PRERELEASE]})?(?:${xn[wn.BUILD]})?(?:$|[^\\d])`);Qo("COERCERTL",xn[wn.COERCE],!0);Qo("COERCERTLFULL",xn[wn.COERCEFULL],!0);Qo("LONETILDE","(?:~>?)");Qo("TILDETRIM",`(\\s*)${xn[wn.LONETILDE]}\\s+`,!0);$M.tildeTrimReplace="$1~";Qo("TILDE",`^${xn[wn.LONETILDE]}${xn[wn.XRANGEPLAIN]}$`);Qo("TILDELOOSE",`^${xn[wn.LONETILDE]}${xn[wn.XRANGEPLAINLOOSE]}$`);Qo("LONECARET","(?:\\^)");Qo("CARETTRIM",`(\\s*)${xn[wn.LONECARET]}\\s+`,!0);$M.caretTrimReplace="$1^";Qo("CARET",`^${xn[wn.LONECARET]}${xn[wn.XRANGEPLAIN]}$`);Qo("CARETLOOSE",`^${xn[wn.LONECARET]}${xn[wn.XRANGEPLAINLOOSE]}$`);Qo("COMPARATORLOOSE",`^${xn[wn.GTLT]}\\s*(${xn[wn.LOOSEPLAIN]})$|^$`);Qo("COMPARATOR",`^${xn[wn.GTLT]}\\s*(${xn[wn.FULLPLAIN]})$|^$`);Qo("COMPARATORTRIM",`(\\s*)${xn[wn.GTLT]}\\s*(${xn[wn.LOOSEPLAIN]}|${xn[wn.XRANGEPLAIN]})`,!0);$M.comparatorTrimReplace="$1$2$3";Qo("HYPHENRANGE",`^\\s*(${xn[wn.XRANGEPLAIN]})\\s+-\\s+(${xn[wn.XRANGEPLAIN]})\\s*$`);Qo("HYPHENRANGELOOSE",`^\\s*(${xn[wn.XRANGEPLAINLOOSE]})\\s+-\\s+(${xn[wn.XRANGEPLAINLOOSE]})\\s*$`);Qo("STAR","(<|>)?=?\\s*\\*");Qo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Qo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var VHe=I((XZl,yin)=>{"use strict";p();var qIo=Object.freeze({loose:!0}),jIo=Object.freeze({}),HIo=a(t=>t?typeof t!="object"?qIo:t:jIo,"parseOptions");yin.exports=HIo});var FBt=I((rXl,vin)=>{"use strict";p();var Ein=/^[0-9]+$/,_in=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t_in(e,t),"rcompareIdentifiers");vin.exports={compareIdentifiers:_in,rcompareIdentifiers:GIo}});var bA=I((oXl,bin)=>{"use strict";p();var WHe=sTe(),{MAX_LENGTH:Cin,MAX_SAFE_INTEGER:zHe}=Dce(),{safeRe:YHe,t:KHe}=Nce(),$Io=VHe(),{compareIdentifiers:UBt}=FBt(),VIo=a((t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;nCin)throw new TypeError(`version is longer than ${Cin} characters`);WHe("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?YHe[KHe.LOOSE]:YHe[KHe.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>zHe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>zHe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>zHe||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(WHe("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 UBt(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(WHe("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 UBt(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?YHe[KHe.PRERELEASELOOSE]:YHe[KHe.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]),VIo(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}};bin.exports=QBt});var eQ=I((cXl,Tin)=>{"use strict";p();var Sin=bA(),WIo=a((t,e,r=!1)=>{if(t instanceof Sin)return t;try{return new Sin(t,e)}catch(n){if(!r)return null;throw n}},"parse");Tin.exports=WIo});var xin=I((dXl,Iin)=>{"use strict";p();var zIo=eQ(),YIo=a((t,e)=>{let r=zIo(t,e);return r?r.version:null},"valid");Iin.exports=YIo});var Rin=I((hXl,win)=>{"use strict";p();var KIo=eQ(),JIo=a((t,e)=>{let r=KIo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");win.exports=JIo});var Din=I((AXl,Pin)=>{"use strict";p();var kin=bA(),ZIo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new kin(t instanceof kin?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");Pin.exports=ZIo});var Oin=I((_Xl,Min)=>{"use strict";p();var Nin=eQ(),XIo=a((t,e)=>{let r=Nin(t,null,!0),n=Nin(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");Min.exports=XIo});var Bin=I((bXl,Lin)=>{"use strict";p();var exo=bA(),txo=a((t,e)=>new exo(t,e).major,"major");Lin.exports=txo});var Uin=I((IXl,Fin)=>{"use strict";p();var rxo=bA(),nxo=a((t,e)=>new rxo(t,e).minor,"minor");Fin.exports=nxo});var qin=I((RXl,Qin)=>{"use strict";p();var ixo=bA(),oxo=a((t,e)=>new ixo(t,e).patch,"patch");Qin.exports=oxo});var Hin=I((DXl,jin)=>{"use strict";p();var sxo=eQ(),axo=a((t,e)=>{let r=sxo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");jin.exports=axo});var Rx=I((OXl,$in)=>{"use strict";p();var Gin=bA(),cxo=a((t,e,r)=>new Gin(t,r).compare(new Gin(e,r)),"compare");$in.exports=cxo});var Win=I((FXl,Vin)=>{"use strict";p();var lxo=Rx(),uxo=a((t,e,r)=>lxo(e,t,r),"rcompare");Vin.exports=uxo});var Yin=I((qXl,zin)=>{"use strict";p();var dxo=Rx(),fxo=a((t,e)=>dxo(t,e,!0),"compareLoose");zin.exports=fxo});var JHe=I((GXl,Jin)=>{"use strict";p();var Kin=bA(),pxo=a((t,e,r)=>{let n=new Kin(t,r),o=new Kin(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");Jin.exports=pxo});var Xin=I((WXl,Zin)=>{"use strict";p();var hxo=JHe(),mxo=a((t,e)=>t.sort((r,n)=>hxo(r,n,e)),"sort");Zin.exports=mxo});var ton=I((KXl,eon)=>{"use strict";p();var gxo=JHe(),Axo=a((t,e)=>t.sort((r,n)=>gxo(n,r,e)),"rsort");eon.exports=Axo});var aTe=I((XXl,ron)=>{"use strict";p();var yxo=Rx(),Exo=a((t,e,r)=>yxo(t,e,r)>0,"gt");ron.exports=Exo});var ZHe=I((reu,non)=>{"use strict";p();var _xo=Rx(),vxo=a((t,e,r)=>_xo(t,e,r)<0,"lt");non.exports=vxo});var qBt=I((oeu,ion)=>{"use strict";p();var Cxo=Rx(),bxo=a((t,e,r)=>Cxo(t,e,r)===0,"eq");ion.exports=bxo});var jBt=I((ceu,oon)=>{"use strict";p();var Sxo=Rx(),Txo=a((t,e,r)=>Sxo(t,e,r)!==0,"neq");oon.exports=Txo});var XHe=I((deu,son)=>{"use strict";p();var Ixo=Rx(),xxo=a((t,e,r)=>Ixo(t,e,r)>=0,"gte");son.exports=xxo});var eGe=I((heu,aon)=>{"use strict";p();var wxo=Rx(),Rxo=a((t,e,r)=>wxo(t,e,r)<=0,"lte");aon.exports=Rxo});var HBt=I((Aeu,con)=>{"use strict";p();var kxo=qBt(),Pxo=jBt(),Dxo=aTe(),Nxo=XHe(),Mxo=ZHe(),Oxo=eGe(),Lxo=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 kxo(t,r,n);case"!=":return Pxo(t,r,n);case">":return Dxo(t,r,n);case">=":return Nxo(t,r,n);case"<":return Mxo(t,r,n);case"<=":return Oxo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");con.exports=Lxo});var uon=I((_eu,lon)=>{"use strict";p();var Bxo=bA(),Fxo=eQ(),{safeRe:tGe,t:rGe}=Nce(),Uxo=a((t,e)=>{if(t instanceof Bxo)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?tGe[rGe.COERCEFULL]:tGe[rGe.COERCE]);else{let u=e.includePrerelease?tGe[rGe.COERCERTLFULL]:tGe[rGe.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 Fxo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");lon.exports=Uxo});var fon=I((beu,don)=>{"use strict";p();var Qxo=eQ(),qxo=Dce(),jxo=bA(),Hxo=a((t,e,r)=>{if(!qxo.RELEASE_TYPES.includes(e))return null;let n=Gxo(t,r);return n&&$xo(n,e)},"truncate"),Gxo=a((t,e)=>{let r=t instanceof jxo?t.version:t;return Qxo(r,e)},"cloneInputVersion"),$xo=a((t,e)=>{if(Vxo(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"),Vxo=a(t=>t.startsWith("pre"),"isPrerelease");don.exports=Hxo});var hon=I((Ieu,pon)=>{"use strict";p();var GBt=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}};pon.exports=GBt});var kx=I((Reu,yon)=>{"use strict";p();var Wxo=/\s+/g,$Bt=class t{static{a(this,"Range")}constructor(e,r){if(r=Yxo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof VBt)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(Wxo," "),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=>!gon(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&&iwo(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(nwo,"");let n=((this.options.includePrerelease&&two)|(this.options.loose&&rwo))+":"+e,o=mon.get(n);if(o)return o;let s=this.options.loose,c=s?N_[SA.HYPHENRANGELOOSE]:N_[SA.HYPHENRANGE];e=e.replace(c,mwo(this.options.includePrerelease)),Ku("hyphen replace",e),e=e.replace(N_[SA.COMPARATORTRIM],Zxo),Ku("comparator trim",e),e=e.replace(N_[SA.TILDETRIM],Xxo),Ku("tilde trim",e),e=e.replace(N_[SA.CARETTRIM],ewo),Ku("caret trim",e);let l=e.split(" ").map(h=>owo(h,this.options)).join(" ").split(/\s+/).map(h=>hwo(h,this.options));s&&(l=l.filter(h=>(Ku("loose invalid filter",h,this.options),!!h.match(N_[SA.COMPARATORLOOSE])))),Ku("range list",l);let u=new Map,d=l.map(h=>new VBt(h,this.options));for(let h of d){if(gon(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return mon.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Aon(n,r)&&e.set.some(o=>Aon(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 Kxo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),iwo=a(t=>t.value==="","isAny"),Aon=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"),owo=a((t,e)=>(t=t.replace(N_[SA.BUILD],""),Ku("comp",t,e),t=lwo(t,e),Ku("caret",t),t=awo(t,e),Ku("tildes",t),t=dwo(t,e),Ku("xrange",t),t=pwo(t,e),Ku("stars",t),t),"parseComparator"),n0=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),swo=a((t,e,r)=>n0(t)&&!n0(e)||n0(e)&&r&&!n0(r),"invalidXRangeOrder"),awo=a((t,e)=>t.trim().split(/\s+/).map(r=>cwo(r,e)).join(" "),"replaceTildes"),cwo=a((t,e)=>{let r=e.loose?N_[SA.TILDELOOSE]:N_[SA.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Ku("tilde",t,o,s,c,l,u);let d;return n0(s)?d="":n0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:n0(l)?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:u?(Ku("replaceTilde pr",u),d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`):d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`,Ku("tilde return",d),d})},"replaceTilde"),lwo=a((t,e)=>t.trim().split(/\s+/).map(r=>uwo(r,e)).join(" "),"replaceCarets"),uwo=a((t,e)=>{Ku("caret",t,e);let r=e.loose?N_[SA.CARETLOOSE]:N_[SA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Ku("caret",t,o,s,c,l,u);let d;return n0(s)?d="":n0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:n0(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(Ku("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`):(Ku("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`),Ku("caret return",d),d})},"replaceCaret"),dwo=a((t,e)=>(Ku("replaceXRanges",t,e),t.split(/\s+/).map(r=>fwo(r,e)).join(" ")),"replaceXRanges"),fwo=a((t,e)=>{t=t.trim();let r=e.loose?N_[SA.XRANGELOOSE]:N_[SA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{if(Ku("xRange",t,n,o,s,c,l,u),swo(s,c,l))return t;let d=n0(s),f=d||n0(c),h=f||n0(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`),Ku("xRange return",n),n})},"replaceXRange"),pwo=a((t,e)=>(Ku("replaceStars",t,e),t.trim().replace(N_[SA.STAR],"")),"replaceStars"),hwo=a((t,e)=>(Ku("replaceGTE0",t,e),t.trim().replace(N_[e.includePrerelease?SA.GTE0PRE:SA.GTE0],"")),"replaceGTE0"),mwo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(n0(n)?r="":n0(o)?r=`>=${n}.0.0${t?"-0":""}`:n0(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,n0(d)?u="":n0(f)?u=`<${+d+1}.0.0-0`:n0(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"),gwo=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 cTe=I((Deu,Son)=>{"use strict";p();var lTe=Symbol("SemVer ANY"),YBt=class t{static{a(this,"Comparator")}static get ANY(){return lTe}constructor(e,r){if(r=Eon(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),zBt("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===lTe?this.value="":this.value=this.operator+this.semver.version,zBt("comp",this)}parse(e){let r=this.options.loose?_on[von.COMPARATORLOOSE]:_on[von.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 Con(n[2],this.options.loose):this.semver=lTe}toString(){return this.value}test(e){if(zBt("Comparator.test",e,this.options.loose),this.semver===lTe||e===lTe)return!0;if(typeof e=="string")try{e=new Con(e,this.options)}catch{return!1}return WBt(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 bon(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new bon(this.value,r).test(e.semver):(r=Eon(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("=")||WBt(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||WBt(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Son.exports=YBt;var Eon=VHe(),{safeRe:_on,t:von}=Nce(),WBt=HBt(),zBt=sTe(),Con=bA(),bon=kx()});var uTe=I((Oeu,Ton)=>{"use strict";p();var Awo=kx(),ywo=a((t,e,r)=>{try{e=new Awo(e,r)}catch{return!1}return e.test(t)},"satisfies");Ton.exports=ywo});var xon=I((Feu,Ion)=>{"use strict";p();var Ewo=kx(),_wo=a((t,e)=>new Ewo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");Ion.exports=_wo});var Ron=I((qeu,won)=>{"use strict";p();var vwo=bA(),Cwo=kx(),bwo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new Cwo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new vwo(n,r))}),n},"maxSatisfying");won.exports=bwo});var Pon=I((Geu,kon)=>{"use strict";p();var Swo=bA(),Two=kx(),Iwo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new Two(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Swo(n,r))}),n},"minSatisfying");kon.exports=Iwo});var Mon=I((Weu,Non)=>{"use strict";p();var KBt=bA(),xwo=kx(),Don=aTe(),wwo=a((t,e)=>{t=new xwo(t,e);let r=new KBt("0.0.0");if(t.test(r)||(r=new KBt("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new KBt(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||Don(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||Don(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");Non.exports=wwo});var Lon=I((Keu,Oon)=>{"use strict";p();var Rwo=kx(),kwo=a((t,e)=>{try{return new Rwo(t,e).range||"*"}catch{return null}},"validRange");Oon.exports=kwo});var nGe=I((Xeu,Qon)=>{"use strict";p();var Pwo=bA(),Uon=cTe(),{ANY:Dwo}=Uon,Nwo=kx(),Mwo=uTe(),Bon=aTe(),Fon=ZHe(),Owo=eGe(),Lwo=XHe(),Bwo=a((t,e,r,n)=>{t=new Pwo(t,n),e=new Nwo(e,n);let o,s,c,l,u;switch(r){case">":o=Bon,s=Owo,c=Fon,l=">",u=">=";break;case"<":o=Fon,s=Lwo,c=Bon,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Mwo(t,e,n))return!1;for(let d=0;d{g.semver===Dwo&&(g=new Uon(">=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");Qon.exports=Bwo});var jon=I((rtu,qon)=>{"use strict";p();var Fwo=nGe(),Uwo=a((t,e,r)=>Fwo(t,e,">",r),"gtr");qon.exports=Uwo});var Gon=I((otu,Hon)=>{"use strict";p();var Qwo=nGe(),qwo=a((t,e,r)=>Qwo(t,e,"<",r),"ltr");Hon.exports=qwo});var Won=I((ctu,Von)=>{"use strict";p();var $on=kx(),jwo=a((t,e,r)=>(t=new $on(t,r),e=new $on(e,r),t.intersects(e,r)),"intersects");Von.exports=jwo});var Yon=I((dtu,zon)=>{"use strict";p();var Hwo=uTe(),Gwo=Rx();zon.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>Gwo(f,h,r));for(let f of c)Hwo(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 Kon=kx(),XBt=cTe(),{ANY:JBt}=XBt,ZBt=uTe(),e3t=Rx(),$wo=a((t,e,r={})=>{if(t===e)return!0;t=new Kon(t,r),e=new Kon(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=Wwo(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),Vwo=[new XBt(">=0.0.0-0")],Jon=[new XBt(">=0.0.0")],Wwo=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===JBt){if(e.length===1&&e[0].semver===JBt)return!0;r.includePrerelease?t=Vwo:t=Jon}if(e.length===1&&e[0].semver===JBt){if(r.includePrerelease)return!0;e=Jon}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=Zon(o,g,r):g.operator==="<"||g.operator==="<="?s=Xon(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=e3t(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&&!ZBt(g,String(o),r)||s&&!ZBt(g,String(s),r))return null;for(let A of e)if(!ZBt(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=Zon(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=Xon(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"),Zon=a((t,e,r)=>{if(!t)return e;let n=e3t(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),Xon=a((t,e,r)=>{if(!t)return e;let n=e3t(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");esn.exports=$wo});var yP=I((gtu,isn)=>{"use strict";p();var t3t=Nce(),rsn=Dce(),zwo=bA(),nsn=FBt(),Ywo=eQ(),Kwo=xin(),Jwo=Rin(),Zwo=Din(),Xwo=Oin(),eRo=Bin(),tRo=Uin(),rRo=qin(),nRo=Hin(),iRo=Rx(),oRo=Win(),sRo=Yin(),aRo=JHe(),cRo=Xin(),lRo=ton(),uRo=aTe(),dRo=ZHe(),fRo=qBt(),pRo=jBt(),hRo=XHe(),mRo=eGe(),gRo=HBt(),ARo=uon(),yRo=fon(),ERo=cTe(),_Ro=kx(),vRo=uTe(),CRo=xon(),bRo=Ron(),SRo=Pon(),TRo=Mon(),IRo=Lon(),xRo=nGe(),wRo=jon(),RRo=Gon(),kRo=Won(),PRo=Yon(),DRo=tsn();isn.exports={parse:Ywo,valid:Kwo,clean:Jwo,inc:Zwo,diff:Xwo,major:eRo,minor:tRo,patch:rRo,prerelease:nRo,compare:iRo,rcompare:oRo,compareLoose:sRo,compareBuild:aRo,sort:cRo,rsort:lRo,gt:uRo,lt:dRo,eq:fRo,neq:pRo,gte:hRo,lte:mRo,cmp:gRo,coerce:ARo,truncate:yRo,Comparator:ERo,Range:_Ro,satisfies:vRo,toComparators:CRo,maxSatisfying:bRo,minSatisfying:SRo,minVersion:TRo,validRange:IRo,outside:xRo,gtr:wRo,ltr:RRo,intersects:kRo,simplifyRange:PRo,subset:DRo,SemVer:zwo,re:t3t.re,src:t3t.src,tokens:t3t.t,SEMVER_SPEC_VERSION:rsn.SEMVER_SPEC_VERSION,RELEASE_TYPES:rsn.RELEASE_TYPES,compareIdentifiers:nsn.compareIdentifiers,rcompareIdentifiers:nsn.rcompareIdentifiers}});var ssn=I((ytu,osn)=>{p();var NRo=yP();osn.exports=NRo.satisfies(process.version,">=15.7.0")});var csn=I((_tu,asn)=>{p();var MRo=yP();asn.exports=MRo.satisfies(process.version,">=16.9.0")});var r3t=I((Ctu,lsn)=>{p();var ORo=ssn(),LRo=csn(),BRo={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},FRo={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};lsn.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=BRo[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(ORo)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=FRo[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(LRo){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 n3t=I((Stu,usn)=>{p();var URo=yP();usn.exports=URo.satisfies(process.version,"^6.12.0 || >=8.0.0")});var psn=I((Itu,fsn)=>{p();var pu=oTe(),QRo=DBt(),dsn=NBt(),qRo=PBt(),jRo=OBt(),HRo=r3t(),GRo=n3t(),$Ro=qHe(),{KeyObject:VRo,createSecretKey:WRo,createPublicKey:zRo}=require("crypto"),i3t=["RS256","RS384","RS512"],YRo=["ES256","ES384","ES512"],o3t=["RS256","RS384","RS512"],KRo=["HS256","HS384","HS512"];GRo&&(i3t.splice(i3t.length,0,"PS256","PS384","PS512"),o3t.splice(o3t.length,0,"PS256","PS384","PS512"));fsn.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 pu("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new pu("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new pu("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new pu("jwt must be provided"));if(typeof t!="string")return o(new pu("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new pu("jwt malformed"));let l;try{l=qRo(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new pu("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new pu("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 pu("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new pu("jwt signature is required"));if(m&&!h)return o(new pu("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new pu('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof VRo))try{h=zRo(h)}catch{try{h=WRo(typeof h=="string"?Buffer.from(h):h)}catch{return o(new pu("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=KRo:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=o3t:h.asymmetricKeyType==="ec"?r.algorithms=YRo:r.algorithms=i3t),r.algorithms.indexOf(l.header.alg)===-1)return o(new pu("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new pu(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new pu(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{HRo(u.alg,h)}catch(y){return o(y)}let g;try{g=$Ro.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new pu("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new pu("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new QRo("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new pu("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new dsn("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(b){return b instanceof RegExp?b.test(v):b===v})}))return o(new pu("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 pu("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new pu("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new pu("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new pu("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new pu("iat required when maxAge is specified"));let y=jRo(r.maxAge,A.iat);if(typeof y>"u")return o(new pu('"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 dsn("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 Esn=I((Rtu,ysn)=>{p();var hsn=1/0,gsn=9007199254740991,JRo=17976931348623157e292,msn=NaN,ZRo="[object Arguments]",XRo="[object Function]",eko="[object GeneratorFunction]",tko="[object String]",rko="[object Symbol]",nko=/^\s+|\s+$/g,iko=/^[-+]0x[0-9a-f]+$/i,oko=/^0b[01]+$/i,sko=/^0o[0-7]+$/i,ako=/^(?:0|[1-9]\d*)$/,cko=parseInt;function lko(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&dko(t,e,r)>-1}a(bko,"includes");function Sko(t){return Tko(t)&&a3t.call(t,"callee")&&(!gko.call(t,"callee")||oGe.call(t)==ZRo)}a(Sko,"isArguments");var Asn=Array.isArray;function c3t(t){return t!=null&&xko(t.length)&&!Iko(t)}a(c3t,"isArrayLike");function Tko(t){return l3t(t)&&c3t(t)}a(Tko,"isArrayLikeObject");function Iko(t){var e=s3t(t)?oGe.call(t):"";return e==XRo||e==eko}a(Iko,"isFunction");function xko(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=gsn}a(xko,"isLength");function s3t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(s3t,"isObject");function l3t(t){return!!t&&typeof t=="object"}a(l3t,"isObjectLike");function wko(t){return typeof t=="string"||!Asn(t)&&l3t(t)&&oGe.call(t)==tko}a(wko,"isString");function Rko(t){return typeof t=="symbol"||l3t(t)&&oGe.call(t)==rko}a(Rko,"isSymbol");function kko(t){if(!t)return t===0?t:0;if(t=Dko(t),t===hsn||t===-hsn){var e=t<0?-1:1;return e*JRo}return t===t?t:0}a(kko,"toFinite");function Pko(t){var e=kko(t),r=e%1;return e===e?r?e-r:e:0}a(Pko,"toInteger");function Dko(t){if(typeof t=="number")return t;if(Rko(t))return msn;if(s3t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=s3t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(nko,"");var r=oko.test(t);return r||sko.test(t)?cko(t.slice(2),r?2:8):iko.test(t)?msn:+t}a(Dko,"toNumber");function Nko(t){return c3t(t)?Eko(t):_ko(t)}a(Nko,"keys");function Mko(t){return t?hko(t,Nko(t)):[]}a(Mko,"values");ysn.exports=bko});var vsn=I((Dtu,_sn)=>{p();var Oko="[object Boolean]",Lko=Object.prototype,Bko=Lko.toString;function Fko(t){return t===!0||t===!1||Uko(t)&&Bko.call(t)==Oko}a(Fko,"isBoolean");function Uko(t){return!!t&&typeof t=="object"}a(Uko,"isObjectLike");_sn.exports=Fko});var Isn=I((Otu,Tsn)=>{p();var Csn=1/0,Qko=17976931348623157e292,bsn=NaN,qko="[object Symbol]",jko=/^\s+|\s+$/g,Hko=/^[-+]0x[0-9a-f]+$/i,Gko=/^0b[01]+$/i,$ko=/^0o[0-7]+$/i,Vko=parseInt,Wko=Object.prototype,zko=Wko.toString;function Yko(t){return typeof t=="number"&&t==Xko(t)}a(Yko,"isInteger");function Ssn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Ssn,"isObject");function Kko(t){return!!t&&typeof t=="object"}a(Kko,"isObjectLike");function Jko(t){return typeof t=="symbol"||Kko(t)&&zko.call(t)==qko}a(Jko,"isSymbol");function Zko(t){if(!t)return t===0?t:0;if(t=ePo(t),t===Csn||t===-Csn){var e=t<0?-1:1;return e*Qko}return t===t?t:0}a(Zko,"toFinite");function Xko(t){var e=Zko(t),r=e%1;return e===e?r?e-r:e:0}a(Xko,"toInteger");function ePo(t){if(typeof t=="number")return t;if(Jko(t))return bsn;if(Ssn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ssn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(jko,"");var r=Gko.test(t);return r||$ko.test(t)?Vko(t.slice(2),r?2:8):Hko.test(t)?bsn:+t}a(ePo,"toNumber");Tsn.exports=Yko});var wsn=I((Ftu,xsn)=>{p();var tPo="[object Number]",rPo=Object.prototype,nPo=rPo.toString;function iPo(t){return!!t&&typeof t=="object"}a(iPo,"isObjectLike");function oPo(t){return typeof t=="number"||iPo(t)&&nPo.call(t)==tPo}a(oPo,"isNumber");xsn.exports=oPo});var Dsn=I((qtu,Psn)=>{p();var sPo="[object Object]";function aPo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(aPo,"isHostObject");function cPo(t,e){return function(r){return t(e(r))}}a(cPo,"overArg");var lPo=Function.prototype,Rsn=Object.prototype,ksn=lPo.toString,uPo=Rsn.hasOwnProperty,dPo=ksn.call(Object),fPo=Rsn.toString,pPo=cPo(Object.getPrototypeOf,Object);function hPo(t){return!!t&&typeof t=="object"}a(hPo,"isObjectLike");function mPo(t){if(!hPo(t)||fPo.call(t)!=sPo||aPo(t))return!1;var e=pPo(t);if(e===null)return!0;var r=uPo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ksn.call(r)==dPo}a(mPo,"isPlainObject");Psn.exports=mPo});var Msn=I((Gtu,Nsn)=>{p();var gPo="[object String]",APo=Object.prototype,yPo=APo.toString,EPo=Array.isArray;function _Po(t){return!!t&&typeof t=="object"}a(_Po,"isObjectLike");function vPo(t){return typeof t=="string"||!EPo(t)&&_Po(t)&&yPo.call(t)==gPo}a(vPo,"isString");Nsn.exports=vPo});var Usn=I((Wtu,Fsn)=>{p();var CPo="Expected a function",Osn=1/0,bPo=17976931348623157e292,Lsn=NaN,SPo="[object Symbol]",TPo=/^\s+|\s+$/g,IPo=/^[-+]0x[0-9a-f]+$/i,xPo=/^0b[01]+$/i,wPo=/^0o[0-7]+$/i,RPo=parseInt,kPo=Object.prototype,PPo=kPo.toString;function DPo(t,e){var r;if(typeof e!="function")throw new TypeError(CPo);return t=BPo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(DPo,"before");function NPo(t){return DPo(2,t)}a(NPo,"once");function Bsn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Bsn,"isObject");function MPo(t){return!!t&&typeof t=="object"}a(MPo,"isObjectLike");function OPo(t){return typeof t=="symbol"||MPo(t)&&PPo.call(t)==SPo}a(OPo,"isSymbol");function LPo(t){if(!t)return t===0?t:0;if(t=FPo(t),t===Osn||t===-Osn){var e=t<0?-1:1;return e*bPo}return t===t?t:0}a(LPo,"toFinite");function BPo(t){var e=LPo(t),r=e%1;return e===e?r?e-r:e:0}a(BPo,"toInteger");function FPo(t){if(typeof t=="number")return t;if(OPo(t))return Lsn;if(Bsn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Bsn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(TPo,"");var r=xPo.test(t);return r||wPo.test(t)?RPo(t.slice(2),r?2:8):IPo.test(t)?Lsn:+t}a(FPo,"toNumber");Fsn.exports=NPo});var zsn=I((Ktu,Wsn)=>{p();var Qsn=OBt(),UPo=n3t(),QPo=r3t(),qsn=qHe(),qPo=Esn(),sGe=vsn(),jsn=Isn(),u3t=wsn(),Gsn=Dsn(),tQ=Msn(),jPo=Usn(),{KeyObject:HPo,createSecretKey:GPo,createPrivateKey:$Po}=require("crypto"),$sn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];UPo&&$sn.splice(3,0,"PS256","PS384","PS512");var VPo={expiresIn:{isValid:a(function(t){return jsn(t)||tQ(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return jsn(t)||tQ(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return tQ(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:qPo.bind(null,$sn),message:'"algorithm" must be a valid string enum value'},header:{isValid:Gsn,message:'"header" must be an object'},encoding:{isValid:tQ,message:'"encoding" must be a string'},issuer:{isValid:tQ,message:'"issuer" must be a string'},subject:{isValid:tQ,message:'"subject" must be a string'},jwtid:{isValid:tQ,message:'"jwtid" must be a string'},noTimestamp:{isValid:sGe,message:'"noTimestamp" must be a boolean'},keyid:{isValid:tQ,message:'"keyid" must be a string'},mutatePayload:{isValid:sGe,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:sGe,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:sGe,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},WPo={iat:{isValid:u3t,message:'"iat" should be a number of seconds'},exp:{isValid:u3t,message:'"exp" should be a number of seconds'},nbf:{isValid:u3t,message:'"nbf" should be a number of seconds'}};function Vsn(t,e,r,n){if(!Gsn(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(Vsn,"validate");function zPo(t){return Vsn(VPo,!1,t,"options")}a(zPo,"validateOptions");function YPo(t){return Vsn(WPo,!0,t,"payload")}a(YPo,"validatePayload");var Hsn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},KPo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Wsn.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 HPo))try{e=$Po(e)}catch{try{e=GPo(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{YPo(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=KPo.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{zPo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{QPo(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=Qsn(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=Qsn(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(Hsn).forEach(function(d){let f=Hsn[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&&jPo(n),qsn.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=qsn.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 Ksn=I((Xtu,Ysn)=>{p();Ysn.exports={decode:PBt(),verify:psn(),sign:zsn(),JsonWebTokenError:oTe(),NotBeforeError:DBt(),TokenExpiredError:NBt()}});var q3t=I((Wlu,Kan)=>{p();function Z2o(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=MBt(),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 P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,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(E=>{m=E},"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();bS.formatArgs=eDo;bS.save=tDo;bS.load=rDo;bS.useColors=X2o;bS.storage=nDo();bS.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`."))}})();bS.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 X2o(){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(X2o,"useColors");function eDo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+BGe.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(eDo,"formatArgs");bS.log=console.debug||console.log||(()=>{});function tDo(t){try{t?bS.storage.setItem("debug",t):bS.storage.removeItem("debug")}catch{}}a(tDo,"save");function rDo(){let t;try{t=bS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(rDo,"load");function nDo(){try{return localStorage}catch{}}a(nDo,"localstorage");BGe.exports=q3t()(bS);var{formatters:iDo}=BGe.exports;iDo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Xan=I((Zlu,Zan)=>{"use strict";p();Zan.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 oDo=require("os"),ecn=require("tty"),Dx=Xan(),{env:og}=process,iQ;Dx("no-color")||Dx("no-colors")||Dx("color=false")||Dx("color=never")?iQ=0:(Dx("color")||Dx("colors")||Dx("color=true")||Dx("color=always"))&&(iQ=1);"FORCE_COLOR"in og&&(og.FORCE_COLOR==="true"?iQ=1:og.FORCE_COLOR==="false"?iQ=0:iQ=og.FORCE_COLOR.length===0?1:Math.min(parseInt(og.FORCE_COLOR,10),3));function j3t(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(j3t,"translateLevel");function H3t(t,e){if(iQ===0)return 0;if(Dx("color=16m")||Dx("color=full")||Dx("color=truecolor"))return 3;if(Dx("color=256"))return 2;if(t&&!e&&iQ===void 0)return 0;let r=iQ||0;if(og.TERM==="dumb")return r;if(process.platform==="win32"){let n=oDo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in og)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in og)||og.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in og)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(og.TEAMCITY_VERSION)?1:0;if(og.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in og){let n=parseInt((og.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(og.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(og.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(og.TERM)||"COLORTERM"in og?1:r}a(H3t,"supportsColor");function sDo(t){let e=H3t(t,t&&t.isTTY);return j3t(e)}a(sDo,"getSupportLevel");tcn.exports={supportsColor:sDo,stdout:j3t(H3t(!0,ecn.isatty(1))),stderr:j3t(H3t(!0,ecn.isatty(2)))}});var ncn=I((IA,QGe)=>{p();var aDo=require("tty"),UGe=require("util");IA.init=hDo;IA.log=dDo;IA.formatArgs=lDo;IA.save=fDo;IA.load=pDo;IA.useColors=cDo;IA.destroy=UGe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");IA.colors=[6,2,3,4,5,1];try{let t=FGe();t&&(t.stderr||t).level>=2&&(IA.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{}IA.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 cDo(){return"colors"in IA.inspectOpts?!!IA.inspectOpts.colors:aDo.isatty(process.stderr.fd)}a(cDo,"useColors");function lDo(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+"+FGe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=sDo()+e+" "+t[0]}a(oDo,"formatArgs");function sDo(){return IA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(sDo,"getDate");function aDo(...t){return process.stderr.write(BGe.format(...t)+` -`)}a(aDo,"log");function cDo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(cDo,"save");function lDo(){return process.env.DEBUG}a(lDo,"load");function uDo(t){t.inspectOpts={};let e=Object.keys(IA.inspectOpts);for(let r=0;re.trim()).join(" ")};tcn.O=function(t){return this.inspectOpts.colors=this.useColors,BGe.inspect(t,this.inspectOpts)}});var EP=I((Xlu,H3t)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?H3t.exports=Kan():H3t.exports=rcn()});var ocn=I(xC=>{"use strict";p();var dDo=xC&&xC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fDo=xC&&xC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ncn=xC&&xC.__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)&&dDo(e,t,r);return fDo(e,t),e};Object.defineProperty(xC,"__esModule",{value:!0});xC.req=xC.json=xC.toBuffer=void 0;var pDo=ncn(require("http")),hDo=ncn(require("https"));async function icn(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(icn,"toBuffer");xC.toBuffer=icn;async function mDo(t){let r=(await icn(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(mDo,"json");xC.json=mDo;function gDo(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?hDo:pDo).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(gDo,"req");xC.req=gDo});var $3t=I(bS=>{"use strict";p();var acn=bS&&bS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ADo=bS&&bS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ccn=bS&&bS.__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)&&acn(e,t,r);return ADo(e,t),e},yDo=bS&&bS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&acn(e,t,r)};Object.defineProperty(bS,"__esModule",{value:!0});bS.Agent=void 0;var EDo=ccn(require("net")),scn=ccn(require("http")),_Do=require("https");yDo(ocn(),bS);var zM=Symbol("AgentBaseInternalState"),G3t=class extends scn.Agent{static{a(this,"Agent")}constructor(e){super(e),this[zM]={}}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 EDo.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))?_Do.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 scn.Agent)return l.addRequest(e,o);this[zM].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[zM].currentSocket;if(this[zM].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[zM].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[zM]&&(this[zM].defaultPort=e)}get protocol(){return this[zM].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[zM]&&(this[zM].protocol=e)}};bS.Agent=G3t});var lcn=I(Wce=>{"use strict";p();var vDo=Wce&&Wce.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wce,"__esModule",{value:!0});Wce.parseProxyResponse=void 0;var CDo=vDo(EP()),UGe=(0,CDo.default)("https-proxy-agent:parse-proxy-response");function bDo(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(),UGe("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),UGe("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+"+QGe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=uDo()+e+" "+t[0]}a(lDo,"formatArgs");function uDo(){return IA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(uDo,"getDate");function dDo(...t){return process.stderr.write(UGe.format(...t)+` +`)}a(dDo,"log");function fDo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(fDo,"save");function pDo(){return process.env.DEBUG}a(pDo,"load");function hDo(t){t.inspectOpts={};let e=Object.keys(IA.inspectOpts);for(let r=0;re.trim()).join(" ")};rcn.O=function(t){return this.inspectOpts.colors=this.useColors,UGe.inspect(t,this.inspectOpts)}});var _P=I((ouu,G3t)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?G3t.exports=Jan():G3t.exports=ncn()});var scn=I(wC=>{"use strict";p();var mDo=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]})),gDo=wC&&wC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),icn=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)&&mDo(e,t,r);return gDo(e,t),e};Object.defineProperty(wC,"__esModule",{value:!0});wC.req=wC.json=wC.toBuffer=void 0;var ADo=icn(require("http")),yDo=icn(require("https"));async function ocn(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(ocn,"toBuffer");wC.toBuffer=ocn;async function EDo(t){let r=(await ocn(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(EDo,"json");wC.json=EDo;function _Do(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?yDo:ADo).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(_Do,"req");wC.req=_Do});var V3t=I(SS=>{"use strict";p();var ccn=SS&&SS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vDo=SS&&SS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lcn=SS&&SS.__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)&&ccn(e,t,r);return vDo(e,t),e},CDo=SS&&SS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ccn(e,t,r)};Object.defineProperty(SS,"__esModule",{value:!0});SS.Agent=void 0;var bDo=lcn(require("net")),acn=lcn(require("http")),SDo=require("https");CDo(scn(),SS);var YM=Symbol("AgentBaseInternalState"),$3t=class extends acn.Agent{static{a(this,"Agent")}constructor(e){super(e),this[YM]={}}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 bDo.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))?SDo.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 acn.Agent)return l.addRequest(e,o);this[YM].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[YM].currentSocket;if(this[YM].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[YM].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[YM]&&(this[YM].defaultPort=e)}get protocol(){return this[YM].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[YM]&&(this[YM].protocol=e)}};SS.Agent=$3t});var ucn=I(Wce=>{"use strict";p();var TDo=Wce&&Wce.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wce,"__esModule",{value:!0});Wce.parseProxyResponse=void 0;var IDo=TDo(_P()),qGe=(0,IDo.default)("https-proxy-agent:parse-proxy-response");function xDo(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(),qGe("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),qGe("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){UGe("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(" "),E=+y[1],_=y.slice(2).join(" "),v={};for(let b of g){if(!b)continue;let T=b.indexOf(":");if(T===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${b}"`));let w=b.slice(0,T).toLowerCase(),R=b.slice(T+1).trimStart(),x=v[w];typeof x=="string"?v[w]=[x,R]:Array.isArray(x)?x.push(R):v[w]=R}UGe("got proxy server response: %o %o",A,v),c(),e({connect:{statusCode:E,statusText:_,headers:v},buffered:h})}a(d,"ondata"),t.on("error",u),t.on("end",l),s()})}a(bDo,"parseProxyResponse");Wce.parseProxyResponse=bDo});var W3t=I(Dx=>{"use strict";p();var SDo=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]})),TDo=Dx&&Dx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fcn=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)&&SDo(e,t,r);return TDo(e,t),e},pcn=Dx&&Dx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dx,"__esModule",{value:!0});Dx.HttpsProxyAgent=void 0;var V3t=fcn(require("net")),ucn=fcn(require("tls")),IDo=pcn(require("assert")),xDo=pcn(EP()),wDo=$3t(),RDo=require("url"),kDo=lcn(),CTe=(0,xDo.default)("https-proxy-agent"),QGe=class extends wDo.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new RDo.URL(e):e,this.proxyHeaders=r?.headers??{},CTe("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?dcn(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:"){CTe("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=ucn.connect({...this.connectOpts,servername:m})}else CTe("Creating `net.Socket`: %o",this.connectOpts),o=V3t.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=V3t.isIPv6(r.host)?`[${r.host}]`:r.host,l=`CONNECT ${c}:${r.port} HTTP/1.1\r +`);if(m===-1){qGe("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(" "),E=+y[1],_=y.slice(2).join(" "),v={};for(let b of g){if(!b)continue;let T=b.indexOf(":");if(T===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${b}"`));let w=b.slice(0,T).toLowerCase(),R=b.slice(T+1).trimStart(),x=v[w];typeof x=="string"?v[w]=[x,R]:Array.isArray(x)?x.push(R):v[w]=R}qGe("got proxy server response: %o %o",A,v),c(),e({connect:{statusCode:E,statusText:_,headers:v},buffered:h})}a(d,"ondata"),t.on("error",u),t.on("end",l),s()})}a(xDo,"parseProxyResponse");Wce.parseProxyResponse=xDo});var z3t=I(Nx=>{"use strict";p();var wDo=Nx&&Nx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RDo=Nx&&Nx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pcn=Nx&&Nx.__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)&&wDo(e,t,r);return RDo(e,t),e},hcn=Nx&&Nx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nx,"__esModule",{value:!0});Nx.HttpsProxyAgent=void 0;var W3t=pcn(require("net")),dcn=pcn(require("tls")),kDo=hcn(require("assert")),PDo=hcn(_P()),DDo=V3t(),NDo=require("url"),MDo=ucn(),bTe=(0,PDo.default)("https-proxy-agent"),jGe=class extends DDo.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new NDo.URL(e):e,this.proxyHeaders=r?.headers??{},bTe("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?fcn(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:"){bTe("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=dcn.connect({...this.connectOpts,servername:m})}else bTe("Creating `net.Socket`: %o",this.connectOpts),o=W3t.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=W3t.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,kDo.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",PDo),r.secureEndpoint){CTe("Upgrading socket connection to TLS");let m=r.servername||r.host;return ucn.connect({...dcn(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new V3t.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{CTe("Replaying proxy buffer for failed request"),(0,IDo.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};QGe.protocols=["http","https"];Dx.HttpsProxyAgent=QGe;function PDo(t){t.resume()}a(PDo,"resume");function dcn(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(dcn,"omit")});var z3t=I(Nx=>{"use strict";p();var DDo=Nx&&Nx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NDo=Nx&&Nx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mcn=Nx&&Nx.__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)&&DDo(e,t,r);return NDo(e,t),e},MDo=Nx&&Nx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nx,"__esModule",{value:!0});Nx.HttpProxyAgent=void 0;var ODo=mcn(require("net")),LDo=mcn(require("tls")),BDo=MDo(EP()),FDo=require("events"),UDo=$3t(),hcn=require("url"),zce=(0,BDo.default)("http-proxy-agent"),qGe=class extends UDo.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new hcn.URL(e):e,this.proxyHeaders=r?.headers??{},zce("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?QDo(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 hcn.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;zce("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(zce("Patching connection write() output buffer with updated header"),n=e.outputData[0].data,o=n.indexOf(`\r +`;let u=(0,MDo.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",ODo),r.secureEndpoint){bTe("Upgrading socket connection to TLS");let m=r.servername||r.host;return dcn.connect({...fcn(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new W3t.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{bTe("Replaying proxy buffer for failed request"),(0,kDo.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};jGe.protocols=["http","https"];Nx.HttpsProxyAgent=jGe;function ODo(t){t.resume()}a(ODo,"resume");function fcn(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(fcn,"omit")});var Y3t=I(Mx=>{"use strict";p();var LDo=Mx&&Mx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BDo=Mx&&Mx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gcn=Mx&&Mx.__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)&&LDo(e,t,r);return BDo(e,t),e},FDo=Mx&&Mx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mx,"__esModule",{value:!0});Mx.HttpProxyAgent=void 0;var UDo=gcn(require("net")),QDo=gcn(require("tls")),qDo=FDo(_P()),jDo=require("events"),HDo=V3t(),mcn=require("url"),zce=(0,qDo.default)("http-proxy-agent"),HGe=class extends HDo.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new mcn.URL(e):e,this.proxyHeaders=r?.headers??{},zce("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?GDo(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 mcn.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;zce("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(zce("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),zce("Output buffer: %o",e.outputData[0].data));let s;return this.proxy.protocol==="https:"?(zce("Creating `tls.Socket`: %o",this.connectOpts),s=LDo.connect(this.connectOpts)):(zce("Creating `net.Socket`: %o",this.connectOpts),s=ODo.connect(this.connectOpts)),await(0,FDo.once)(s,"connect"),s}};qGe.protocols=["http","https"];Nx.HttpProxyAgent=qGe;function QDo(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(QDo,"omit")});var iQ={};ki(iQ,{__addDisposableResource:()=>Gcn,__assign:()=>WGe,__asyncDelegator:()=>Bcn,__asyncGenerator:()=>bTe,__asyncValues:()=>KGe,__await:()=>SS,__awaiter:()=>Pcn,__classPrivateFieldGet:()=>qcn,__classPrivateFieldIn:()=>Hcn,__classPrivateFieldSet:()=>jcn,__createBinding:()=>YGe,__decorate:()=>Scn,__disposeResources:()=>$cn,__esDecorate:()=>Icn,__exportStar:()=>Ncn,__extends:()=>Ccn,__generator:()=>Dcn,__importDefault:()=>Qcn,__importStar:()=>Ucn,__makeTemplateObject:()=>Fcn,__metadata:()=>kcn,__param:()=>Tcn,__propKey:()=>wcn,__read:()=>eFt,__rest:()=>bcn,__rewriteRelativeImportExtension:()=>Vcn,__runInitializers:()=>xcn,__setFunctionName:()=>Rcn,__spread:()=>Mcn,__spreadArray:()=>Lcn,__spreadArrays:()=>Ocn,__values:()=>zGe,default:()=>ZDo});function Ccn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Z3t(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function bcn(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 Tcn(t,e){return function(r,n){e(r,n,t)}}function Icn(t,e,r,n,o,s){function c(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}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(_){if(m)throw new TypeError("Cannot add initializers after decoration has completed");s.push(c(_||null))};var E=(0,r[g])(l==="accessor"?{get:f.get,set:f.set}:f[u],A);if(l==="accessor"){if(E===void 0)continue;if(E===null||typeof E!="object")throw new TypeError("Object expected");(h=c(E.get))&&(f.get=h),(h=c(E.set))&&(f.set=h),(h=c(E.init))&&o.unshift(h)}else(h=c(E))&&(l==="field"?o.unshift(h):f[u]=h)}d&&Object.defineProperty(d,n.name,f),m=!0}function xcn(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 eFt(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 Mcn(){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 SS?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 Bcn(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:SS(t[o](c)),done:!1}:s?s(c):c}:s}}function KGe(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 zGe=="function"?zGe(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 Fcn(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Ucn(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=X3t(t),n=0;n{p();Z3t=a(function(t,e){return Z3t=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])},Z3t(t,e)},"extendStatics");a(Ccn,"__extends");WGe=a(function(){return WGe=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(a$e,"__esModule",{value:!0});a$e.state=void 0;a$e.state={operationRequestMap:new WeakMap}});function XNo(){try{return xFt.default.statSync("/.dockerenv"),!0}catch{return!1}}function eMo(){try{return xFt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function wFt(){return IFt===void 0&&(IFt=XNo()||eMo()),IFt}var xFt,IFt,Tln=ve(()=>{p();xFt=de(require("node:fs"),1);a(XNo,"hasDockerEnv");a(eMo,"hasDockerCGroup");a(wFt,"isDocker")});function Zce(){return RFt===void 0&&(RFt=tMo()||wFt()),RFt}var Iln,RFt,tMo,kFt=ve(()=>{p();Iln=de(require("node:fs"),1);Tln();tMo=a(()=>{try{return Iln.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(Zce,"isInsideContainer")});var PFt,wln,Rln,xln,cQ,DFt=ve(()=>{p();PFt=de(require("node:process"),1),wln=de(require("node:os"),1),Rln=de(require("node:fs"),1);kFt();xln=a(()=>{if(PFt.default.platform!=="linux")return!1;if(wln.default.release().toLowerCase().includes("microsoft"))return!Zce();try{return Rln.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Zce():!1}catch{return!1}},"isWsl"),cQ=PFt.default.env.__IS_WSL_TEST__?xln:xln()});var NFt,RTe,rMo,nMo,MFt,kln=ve(()=>{p();NFt=de(require("node:process"),1),RTe=de(require("node:fs/promises"),1);DFt();DFt();rMo=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await RTe.default.access(r,RTe.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await RTe.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),nMo=a(async()=>`${await rMo()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),MFt=a(async()=>cQ?nMo():`${NFt.default.env.SYSTEMROOT||NFt.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function lQ(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 Pln=ve(()=>{p();a(lQ,"defineLazyProperty")});async function OFt(){if(Nln.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await iMo("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var Dln,Nln,Mln,iMo,Oln=ve(()=>{p();Dln=require("node:util"),Nln=de(require("node:process"),1),Mln=require("node:child_process"),iMo=(0,Dln.promisify)(Mln.execFile);a(OFt,"defaultBrowserId")});async function Fln(t,{humanReadableOutput:e=!0}={}){if(Lln.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await oMo("osascript",["-e",t,r]);return n.trim()}var Lln,Bln,LFt,oMo,Uln=ve(()=>{p();Lln=de(require("node:process"),1),Bln=require("node:util"),LFt=require("node:child_process"),oMo=(0,Bln.promisify)(LFt.execFile);a(Fln,"runAppleScript")});async function BFt(t){return Fln(`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 Qln=ve(()=>{p();Uln();a(BFt,"bundleName")});async function FFt(t=sMo){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 l$e(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=aMo[n];if(!o)throw new l$e(`Unknown browser ID: ${n}`);return o}var qln,jln,sMo,aMo,l$e,Hln=ve(()=>{p();qln=require("node:util"),jln=require("node:child_process"),sMo=(0,qln.promisify)(jln.execFile),aMo={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"}},l$e=class extends Error{static{a(this,"UnknownBrowserError")}};a(FFt,"defaultBrowser")});async function UFt(){if(u$e.default.platform==="darwin"){let t=await OFt();return{name:await BFt(t),id:t}}if(u$e.default.platform==="linux"){let{stdout:t}=await cMo("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:lMo(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(u$e.default.platform==="win32")return FFt();throw new Error("Only macOS, Linux, and Windows are supported")}var Gln,u$e,$ln,cMo,lMo,Vln=ve(()=>{p();Gln=require("node:util"),u$e=de(require("node:process"),1),$ln=require("node:child_process");Oln();Qln();Hln();cMo=(0,Gln.promisify)($ln.execFile),lMo=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(UFt,"defaultBrowser")});var Xln={};ki(Xln,{apps:()=>uQ,default:()=>PTe,openApp:()=>pMo});async function dMo(){let t=await MFt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=jFt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await uMo(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 Kln(t){if(typeof t=="string"||Array.isArray(t))return t;let{[zln]:e}=t;if(!e)throw new Error(`${zln} is not supported`);return e}function f$e({[Xce]:t},{wsl:e}){if(e&&cQ)return Kln(e);if(!t)throw new Error(`${Xce} is not supported`);return Kln(t)}var qFt,jFt,HFt,Jln,Zln,GFt,d$e,uMo,QFt,Wln,Xce,zln,Yln,kTe,fMo,pMo,uQ,PTe,p$e=ve(()=>{p();qFt=de(require("node:process"),1),jFt=require("node:buffer"),HFt=de(require("node:path"),1),Jln=require("node:url"),Zln=require("node:util"),GFt=de(require("node:child_process"),1),d$e=de(require("node:fs/promises"),1);kln();Pln();Vln();kFt();uMo=(0,Zln.promisify)(GFt.default.execFile),QFt=HFt.default.dirname((0,Jln.fileURLToPath)(importMetaUrlShim)),Wln=HFt.default.join(QFt,"xdg-open"),{platform:Xce,arch:zln}=qFt.default;a(dMo,"getWindowsDefaultBrowserFromWsl");Yln=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),kTe=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return Yln(t.app,l=>kTe({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return Yln(e,l=>kTe({...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=cQ?await dMo():await UFt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),kTe({...t,app:{name:uQ[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(Xce==="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(Xce==="win32"||cQ&&!Zce()&&!e){n=await MFt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),cQ||(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=jFt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!QFt||QFt==="/",u=!1;try{await d$e.default.access(Wln,d$e.constants.X_OK),u=!0}catch{}n=qFt.default.versions.electron??(Xce==="android"||l||!u)?"xdg-open":Wln}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Xce==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=GFt.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"),fMo=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return kTe({...e,target:t})},"open"),pMo=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 kTe({...e,app:{name:t,arguments:r}})},"openApp");a(Kln,"detectArchBinary");a(f$e,"detectPlatformBinary");uQ={};lQ(uQ,"chrome",()=>f$e({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"]}}));lQ(uQ,"brave",()=>f$e({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"]}}));lQ(uQ,"firefox",()=>f$e({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));lQ(uQ,"edge",()=>f$e({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));lQ(uQ,"browser",()=>"browser");lQ(uQ,"browserPrivate",()=>"browserPrivate");PTe=fMo});var h8t=I((dxu,sdn)=>{"use strict";p();sdn.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 cdn=I((hxu,adn)=>{"use strict";p();var v4o=h8t();function C4o(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=v4o(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(C4o,"parsePath");adn.exports=C4o});var hdn=I((Axu,pdn)=>{"use strict";p();var b4o=cdn();function S4o(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(S4o,"_interopDefaultLegacy");var T4o=S4o(b4o);function I4o(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(I4o,"getAugmentedNamespace");var udn={},x4o="text/plain",w4o="us-ascii",ldn=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),R4o=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===w4o)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==x4o)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function k4o(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 R4o(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];ldn(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()])ldn(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(k4o,"normalizeUrl");var P4o=Object.freeze({__proto__:null,default:k4o}),D4o=I4o(P4o);Object.defineProperty(udn,"__esModule",{value:!0});var N4o=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},M4o=D4o,O4o=ddn(M4o),L4o=T4o.default,B4o=ddn(L4o);function ddn(t){return t&&t.__esModule?t:{default:t}}a(ddn,"_interopRequireDefault");var fdn=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":N4o(r))!=="object"&&(r={stripHash:!1}),e=(0,O4o.default)(e,r));var s=(0,B4o.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");fdn.MAX_INPUT_LENGTH=2048;var F4o=udn.default=fdn;pdn.exports=F4o});var Adn=I((_xu,gdn)=>{"use strict";p();var U4o=h8t();function mdn(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=U4o(t);if(t=t.substring(t.indexOf("://")+3),mdn(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var Q4o=hdn(),ydn=Adn();function q4o(t){let e=Q4o(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),ydn(e.protocols)||e.protocols.length===0&&ydn(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(q4o,"gitUp");Edn.exports=q4o});var Cdn=I((Ixu,vdn)=>{"use strict";p();var j4o=_dn();function m8t(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=j4o(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return m8t.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 E=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/,_=E.exec(n.pathname);return _!=null&&(n.source="bitbucket-server",_[1]==="users"?n.owner="~"+_[2]:n.owner=_[2],n.organization=n.owner,n.name=_[3],s=_[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=$4o(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(m8t,"gitUrlParse");m8t.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?H4o(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+G4o(t)+o;default:return t.href}};function H4o(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(H4o,"buildToken");function G4o(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(G4o,"buildPath");function $4o(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a($4o,"findLongestMatchingSubstring");vdn.exports=m8t});var ale=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 O=t[e++];if(q+=(O&127)*M,M*=128,!(O&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;h$cn,__assign:()=>YGe,__asyncDelegator:()=>Fcn,__asyncGenerator:()=>STe,__asyncValues:()=>ZGe,__await:()=>TS,__awaiter:()=>Dcn,__classPrivateFieldGet:()=>jcn,__classPrivateFieldIn:()=>Gcn,__classPrivateFieldSet:()=>Hcn,__createBinding:()=>JGe,__decorate:()=>Tcn,__disposeResources:()=>Vcn,__esDecorate:()=>xcn,__exportStar:()=>Mcn,__extends:()=>bcn,__generator:()=>Ncn,__importDefault:()=>qcn,__importStar:()=>Qcn,__makeTemplateObject:()=>Ucn,__metadata:()=>Pcn,__param:()=>Icn,__propKey:()=>Rcn,__read:()=>tFt,__rest:()=>Scn,__rewriteRelativeImportExtension:()=>Wcn,__runInitializers:()=>wcn,__setFunctionName:()=>kcn,__spread:()=>Ocn,__spreadArray:()=>Bcn,__spreadArrays:()=>Lcn,__values:()=>KGe,default:()=>rNo});function bcn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");X3t(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Scn(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 Icn(t,e){return function(r,n){e(r,n,t)}}function xcn(t,e,r,n,o,s){function c(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}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(_){if(m)throw new TypeError("Cannot add initializers after decoration has completed");s.push(c(_||null))};var E=(0,r[g])(l==="accessor"?{get:f.get,set:f.set}:f[u],A);if(l==="accessor"){if(E===void 0)continue;if(E===null||typeof E!="object")throw new TypeError("Object expected");(h=c(E.get))&&(f.get=h),(h=c(E.set))&&(f.set=h),(h=c(E.init))&&o.unshift(h)}else(h=c(E))&&(l==="field"?o.unshift(h):f[u]=h)}d&&Object.defineProperty(d,n.name,f),m=!0}function wcn(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 tFt(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 Ocn(){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 TS?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 Fcn(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:TS(t[o](c)),done:!1}:s?s(c):c}:s}}function ZGe(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 KGe=="function"?KGe(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 Ucn(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Qcn(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=eFt(t),n=0;n{p();X3t=a(function(t,e){return X3t=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])},X3t(t,e)},"extendStatics");a(bcn,"__extends");YGe=a(function(){return YGe=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(l$e,"__esModule",{value:!0});l$e.state=void 0;l$e.state={operationRequestMap:new WeakMap}});function nMo(){try{return wFt.default.statSync("/.dockerenv"),!0}catch{return!1}}function iMo(){try{return wFt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function RFt(){return xFt===void 0&&(xFt=nMo()||iMo()),xFt}var wFt,xFt,Iln=ve(()=>{p();wFt=de(require("node:fs"),1);a(nMo,"hasDockerEnv");a(iMo,"hasDockerCGroup");a(RFt,"isDocker")});function Zce(){return kFt===void 0&&(kFt=oMo()||RFt()),kFt}var xln,kFt,oMo,PFt=ve(()=>{p();xln=de(require("node:fs"),1);Iln();oMo=a(()=>{try{return xln.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(Zce,"isInsideContainer")});var DFt,Rln,kln,wln,lQ,NFt=ve(()=>{p();DFt=de(require("node:process"),1),Rln=de(require("node:os"),1),kln=de(require("node:fs"),1);PFt();wln=a(()=>{if(DFt.default.platform!=="linux")return!1;if(Rln.default.release().toLowerCase().includes("microsoft"))return!Zce();try{return kln.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Zce():!1}catch{return!1}},"isWsl"),lQ=DFt.default.env.__IS_WSL_TEST__?wln:wln()});var MFt,kTe,sMo,aMo,OFt,Pln=ve(()=>{p();MFt=de(require("node:process"),1),kTe=de(require("node:fs/promises"),1);NFt();NFt();sMo=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await kTe.default.access(r,kTe.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await kTe.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),aMo=a(async()=>`${await sMo()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),OFt=a(async()=>lQ?aMo():`${MFt.default.env.SYSTEMROOT||MFt.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function uQ(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 Dln=ve(()=>{p();a(uQ,"defineLazyProperty")});async function LFt(){if(Mln.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await cMo("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var Nln,Mln,Oln,cMo,Lln=ve(()=>{p();Nln=require("node:util"),Mln=de(require("node:process"),1),Oln=require("node:child_process"),cMo=(0,Nln.promisify)(Oln.execFile);a(LFt,"defaultBrowserId")});async function Uln(t,{humanReadableOutput:e=!0}={}){if(Bln.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await lMo("osascript",["-e",t,r]);return n.trim()}var Bln,Fln,BFt,lMo,Qln=ve(()=>{p();Bln=de(require("node:process"),1),Fln=require("node:util"),BFt=require("node:child_process"),lMo=(0,Fln.promisify)(BFt.execFile);a(Uln,"runAppleScript")});async function FFt(t){return Uln(`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 qln=ve(()=>{p();Qln();a(FFt,"bundleName")});async function UFt(t=uMo){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 d$e(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=dMo[n];if(!o)throw new d$e(`Unknown browser ID: ${n}`);return o}var jln,Hln,uMo,dMo,d$e,Gln=ve(()=>{p();jln=require("node:util"),Hln=require("node:child_process"),uMo=(0,jln.promisify)(Hln.execFile),dMo={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"}},d$e=class extends Error{static{a(this,"UnknownBrowserError")}};a(UFt,"defaultBrowser")});async function QFt(){if(f$e.default.platform==="darwin"){let t=await LFt();return{name:await FFt(t),id:t}}if(f$e.default.platform==="linux"){let{stdout:t}=await fMo("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:pMo(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(f$e.default.platform==="win32")return UFt();throw new Error("Only macOS, Linux, and Windows are supported")}var $ln,f$e,Vln,fMo,pMo,Wln=ve(()=>{p();$ln=require("node:util"),f$e=de(require("node:process"),1),Vln=require("node:child_process");Lln();qln();Gln();fMo=(0,$ln.promisify)(Vln.execFile),pMo=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(QFt,"defaultBrowser")});var eun={};ki(eun,{apps:()=>dQ,default:()=>DTe,openApp:()=>AMo});async function mMo(){let t=await OFt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=HFt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await hMo(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 Jln(t){if(typeof t=="string"||Array.isArray(t))return t;let{[Yln]:e}=t;if(!e)throw new Error(`${Yln} is not supported`);return e}function h$e({[Xce]:t},{wsl:e}){if(e&&lQ)return Jln(e);if(!t)throw new Error(`${Xce} is not supported`);return Jln(t)}var jFt,HFt,GFt,Zln,Xln,$Ft,p$e,hMo,qFt,zln,Xce,Yln,Kln,PTe,gMo,AMo,dQ,DTe,m$e=ve(()=>{p();jFt=de(require("node:process"),1),HFt=require("node:buffer"),GFt=de(require("node:path"),1),Zln=require("node:url"),Xln=require("node:util"),$Ft=de(require("node:child_process"),1),p$e=de(require("node:fs/promises"),1);Pln();Dln();Wln();PFt();hMo=(0,Xln.promisify)($Ft.default.execFile),qFt=GFt.default.dirname((0,Zln.fileURLToPath)(importMetaUrlShim)),zln=GFt.default.join(qFt,"xdg-open"),{platform:Xce,arch:Yln}=jFt.default;a(mMo,"getWindowsDefaultBrowserFromWsl");Kln=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),PTe=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return Kln(t.app,l=>PTe({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return Kln(e,l=>PTe({...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=lQ?await mMo():await QFt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),PTe({...t,app:{name:dQ[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(Xce==="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(Xce==="win32"||lQ&&!Zce()&&!e){n=await OFt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),lQ||(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=HFt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!qFt||qFt==="/",u=!1;try{await p$e.default.access(zln,p$e.constants.X_OK),u=!0}catch{}n=jFt.default.versions.electron??(Xce==="android"||l||!u)?"xdg-open":zln}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Xce==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=$Ft.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"),gMo=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return PTe({...e,target:t})},"open"),AMo=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 PTe({...e,app:{name:t,arguments:r}})},"openApp");a(Jln,"detectArchBinary");a(h$e,"detectPlatformBinary");dQ={};uQ(dQ,"chrome",()=>h$e({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"]}}));uQ(dQ,"brave",()=>h$e({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"]}}));uQ(dQ,"firefox",()=>h$e({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));uQ(dQ,"edge",()=>h$e({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));uQ(dQ,"browser",()=>"browser");uQ(dQ,"browserPrivate",()=>"browserPrivate");DTe=gMo});var m8t=I((Axu,adn)=>{"use strict";p();adn.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 ldn=I((_xu,cdn)=>{"use strict";p();var T4o=m8t();function I4o(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=T4o(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(I4o,"parsePath");cdn.exports=I4o});var mdn=I((bxu,hdn)=>{"use strict";p();var x4o=ldn();function w4o(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(w4o,"_interopDefaultLegacy");var R4o=w4o(x4o);function k4o(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(k4o,"getAugmentedNamespace");var ddn={},P4o="text/plain",D4o="us-ascii",udn=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),N4o=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===D4o)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==P4o)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function M4o(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 N4o(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];udn(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()])udn(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(M4o,"normalizeUrl");var O4o=Object.freeze({__proto__:null,default:M4o}),L4o=k4o(O4o);Object.defineProperty(ddn,"__esModule",{value:!0});var B4o=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},F4o=L4o,U4o=fdn(F4o),Q4o=R4o.default,q4o=fdn(Q4o);function fdn(t){return t&&t.__esModule?t:{default:t}}a(fdn,"_interopRequireDefault");var pdn=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":B4o(r))!=="object"&&(r={stripHash:!1}),e=(0,U4o.default)(e,r));var s=(0,q4o.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");pdn.MAX_INPUT_LENGTH=2048;var j4o=ddn.default=pdn;hdn.exports=j4o});var ydn=I((Ixu,Adn)=>{"use strict";p();var H4o=m8t();function gdn(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=H4o(t);if(t=t.substring(t.indexOf("://")+3),gdn(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var G4o=mdn(),Edn=ydn();function $4o(t){let e=G4o(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),Edn(e.protocols)||e.protocols.length===0&&Edn(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($4o,"gitUp");_dn.exports=$4o});var bdn=I((Dxu,Cdn)=>{"use strict";p();var V4o=vdn();function g8t(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=V4o(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return g8t.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 E=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/,_=E.exec(n.pathname);return _!=null&&(n.source="bitbucket-server",_[1]==="users"?n.owner="~"+_[2]:n.owner=_[2],n.organization=n.owner,n.name=_[3],s=_[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=Y4o(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(g8t,"gitUrlParse");g8t.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?W4o(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+z4o(t)+o;default:return t.href}};function W4o(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(W4o,"buildToken");function z4o(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(z4o,"buildPath");function Y4o(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a(Y4o,"findLongestMatchingSubstring");Cdn.exports=g8t});var ale=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 O=t[e++];if(q+=(O&127)*M,M*=128,!(O&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,P=!0,D=!0,N;switch(x){case"any-not-eq?":case"not-eq?":P=!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,O=v[2].name;A[y].push(j=>{let Q=[],U=[];for(let W of j)W.name===M&&Q.push(W.node),W.name===O&&U.push(W.node);let Y=a((W,V,z)=>z?W.text===V.text:W.text!==V.text,"compare");return D?Q.every(W=>U.some(V=>Y(W,V,P))):Q.some(W=>U.some(V=>Y(W,V,P)))})}else{N=v[1].name;let M=v[2].value,O=a(Q=>Q.text===M,"matches"),j=a(Q=>Q.text!==M,"doesNotMatch");A[y].push(Q=>{let U=[];for(let W of Q)W.name===N&&U.push(W.node);let Y=P?O:j;return D?U.every(Y):U.some(Y)})}break;case"any-not-match?":case"not-match?":P=!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 L=new RegExp(v[2].value);D=!x.startsWith("any-"),A[y].push(M=>{let O=[];for(let Q of M)Q.name===N&&O.push(Q.node.text);let j=a((Q,U)=>U?L.test(Q):!L.test(Q),"test");return O.length===0?!P:D?O.every(Q=>j(Q,P)):O.some(Q=>j(Q,P))});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?":P=!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 O=[];for(let j of M)j.name===N&&O.push(j.node.text);return O.length===0?!P:O.every(j=>q.includes(j))===P});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(_))){h[m]={pattern:y,captures:_};let v=this.setProperties[y];v&&(h[m].setProperties=v);let b=this.assertedProperties[y];b&&(h[m].assertedProperties=b);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[_],b=this.setProperties[y];b&&(v.setProperties=b);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 qdn=I((Kwu,Qdn)=>{"use strict";p();var RLo=require("path"),kLo=RLo.join(__dirname,"compiled",process.platform,process.arch,"keytar.node");Qdn.exports=require(kLo)});var epn={};ki(epn,{TextDocument:()=>S3});function E6t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);E6t(n,e),E6t(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 l3o(t){let e=Xfn(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var nWe,S3,_6t=ve(()=>{"use strict";p();nWe=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=Xfn(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=Jfn(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&&Zfn(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 nWe(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof nWe)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=E6t(s.map(l3o),(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})(S3||(S3={}));a(E6t,"mergeSort");a(Jfn,"computeLineOffsets");a(Zfn,"isEOL");a(Xfn,"getWellformedRange");a(l3o,"getWellformedEdit")});var pWe=I(Vh=>{"use strict";p();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.thenable=Vh.typedArray=Vh.stringArray=Vh.array=Vh.func=Vh.error=Vh.number=Vh.string=Vh.boolean=void 0;function h3o(t){return t===!0||t===!1}a(h3o,"boolean");Vh.boolean=h3o;function uhn(t){return typeof t=="string"||t instanceof String}a(uhn,"string");Vh.string=uhn;function m3o(t){return typeof t=="number"||t instanceof Number}a(m3o,"number");Vh.number=m3o;function g3o(t){return t instanceof Error}a(g3o,"error");Vh.error=g3o;function dhn(t){return typeof t=="function"}a(dhn,"func");Vh.func=dhn;function fhn(t){return Array.isArray(t)}a(fhn,"array");Vh.array=fhn;function A3o(t){return fhn(t)&&t.every(e=>uhn(e))}a(A3o,"stringArray");Vh.stringArray=A3o;function y3o(t,e){return Array.isArray(t)&&t.every(e)}a(y3o,"typedArray");Vh.typedArray=y3o;function E3o(t){return t&&dhn(t.then)}a(E3o,"thenable");Vh.thenable=E3o});var F6t=I(Fx=>{"use strict";p();Object.defineProperty(Fx,"__esModule",{value:!0});Fx.generateUuid=Fx.parse=Fx.isUUID=Fx.v4=Fx.empty=void 0;var bIe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},SIe=class t extends bIe{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(""))}};SIe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];SIe._timeHighBits=["8","9","a","b"];Fx.empty=new bIe("00000000-0000-0000-0000-000000000000");function phn(){return new SIe}a(phn,"v4");Fx.v4=phn;var _3o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function hhn(t){return _3o.test(t)}a(hhn,"isUUID");Fx.isUUID=hhn;function v3o(t){if(!hhn(t))throw new Error("invalid uuid");return new bIe(t)}a(v3o,"parse");Fx.parse=v3o;function C3o(){return phn().asHex()}a(C3o,"generateUuid");Fx.generateUuid=C3o});var mhn=I(DQ=>{"use strict";p();Object.defineProperty(DQ,"__esModule",{value:!0});DQ.attachPartialResult=DQ.ProgressFeature=DQ.attachWorkDone=void 0;var PQ=ri(),b3o=F6t(),$Y=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(PQ.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(PQ.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(PQ.WorkDoneProgress.type,this._token,{kind:"end"})}};$Y.Instances=new Map;var hWe=class extends $Y{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new PQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},TIe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},mWe=class extends TIe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new PQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function S3o(t,e){if(e===void 0||e.workDoneToken===void 0)return new TIe;let r=e.workDoneToken;return delete e.workDoneToken,new $Y(t,r)}a(S3o,"attachWorkDone");DQ.attachWorkDone=S3o;var T3o=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(PQ.WorkDoneProgressCancelNotification.type,r=>{let n=$Y.Instances.get(r.token);(n instanceof hWe||n instanceof mWe)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new TIe:new $Y(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,b3o.generateUuid)();return this.connection.sendRequest(PQ.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new hWe(this.connection,e))}else return Promise.resolve(new mWe)}},"ProgressFeature");DQ.ProgressFeature=T3o;var U6t;(function(t){t.type=new PQ.ProgressType})(U6t||(U6t={}));var Q6t=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(U6t.type,this._token,e)}};function I3o(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new Q6t(t,r)}a(I3o,"attachPartialResult");DQ.attachPartialResult=I3o});var ghn=I(gWe=>{"use strict";p();Object.defineProperty(gWe,"__esModule",{value:!0});gWe.ConfigurationFeature=void 0;var x3o=ri(),w3o=pWe(),R3o=a(t=>class extends t{getConfiguration(e){return e?w3o.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(x3o.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");gWe.ConfigurationFeature=R3o});var Ahn=I(yWe=>{"use strict";p();Object.defineProperty(yWe,"__esModule",{value:!0});yWe.WorkspaceFoldersFeature=void 0;var AWe=ri(),k3o=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 AWe.Emitter,this.connection.onNotification(AWe.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(AWe.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(AWe.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");yWe.WorkspaceFoldersFeature=k3o});var yhn=I(EWe=>{"use strict";p();Object.defineProperty(EWe,"__esModule",{value:!0});EWe.CallHierarchyFeature=void 0;var q6t=ri(),P3o=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(q6t.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=q6t.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=q6t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");EWe.CallHierarchyFeature=P3o});var H6t=I(NQ=>{"use strict";p();Object.defineProperty(NQ,"__esModule",{value:!0});NQ.SemanticTokensBuilder=NQ.SemanticTokensDiff=NQ.SemanticTokensFeature=void 0;var _We=ri(),D3o=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(_We.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=_We.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=_We.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=_We.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");NQ.SemanticTokensFeature=D3o;var vWe=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 vWe(this._prevData,this._data).computeDiff()}:this.build()}};NQ.SemanticTokensBuilder=j6t});var Ehn=I(CWe=>{"use strict";p();Object.defineProperty(CWe,"__esModule",{value:!0});CWe.ShowDocumentFeature=void 0;var N3o=ri(),M3o=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(N3o.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");CWe.ShowDocumentFeature=M3o});var _hn=I(bWe=>{"use strict";p();Object.defineProperty(bWe,"__esModule",{value:!0});bWe.FileOperationsFeature=void 0;var Tle=ri(),O3o=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Tle.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Tle.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Tle.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Tle.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Tle.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Tle.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");bWe.FileOperationsFeature=O3o});var vhn=I(SWe=>{"use strict";p();Object.defineProperty(SWe,"__esModule",{value:!0});SWe.LinkedEditingRangeFeature=void 0;var L3o=ri(),B3o=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(L3o.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");SWe.LinkedEditingRangeFeature=B3o});var Chn=I(TWe=>{"use strict";p();Object.defineProperty(TWe,"__esModule",{value:!0});TWe.TypeHierarchyFeature=void 0;var G6t=ri(),F3o=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(G6t.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=G6t.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=G6t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");TWe.TypeHierarchyFeature=F3o});var Shn=I(IWe=>{"use strict";p();Object.defineProperty(IWe,"__esModule",{value:!0});IWe.InlineValueFeature=void 0;var bhn=ri(),U3o=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(bhn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(bhn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");IWe.InlineValueFeature=U3o});var Ihn=I(xWe=>{"use strict";p();Object.defineProperty(xWe,"__esModule",{value:!0});xWe.FoldingRangeFeature=void 0;var Thn=ri(),Q3o=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(Thn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=Thn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");xWe.FoldingRangeFeature=Q3o});var xhn=I(wWe=>{"use strict";p();Object.defineProperty(wWe,"__esModule",{value:!0});wWe.InlayHintFeature=void 0;var $6t=ri(),q3o=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest($6t.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest($6t.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest($6t.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");wWe.InlayHintFeature=q3o});var whn=I(RWe=>{"use strict";p();Object.defineProperty(RWe,"__esModule",{value:!0});RWe.DiagnosticFeature=void 0;var IIe=ri(),j3o=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(IIe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(IIe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(IIe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(IIe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(IIe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");RWe.DiagnosticFeature=j3o});var W6t=I(kWe=>{"use strict";p();Object.defineProperty(kWe,"__esModule",{value:!0});kWe.TextDocuments=void 0;var VY=ri(),V6t=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new VY.Emitter,this._onDidOpen=new VY.Emitter,this._onDidClose=new VY.Emitter,this._onDidSave=new VY.Emitter,this._onWillSave=new VY.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=VY.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}))})),VY.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};kWe.TextDocuments=V6t});var Y6t=I(Ile=>{"use strict";p();Object.defineProperty(Ile,"__esModule",{value:!0});Ile.NotebookDocuments=Ile.NotebookSyncFeature=void 0;var Ux=ri(),Rhn=W6t(),H3o=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(Ux.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(Ux.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(Ux.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(Ux.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");Ile.NotebookSyncFeature=H3o;var PWe=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,Ux.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Ux.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Ux.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}};PWe.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var z6t=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof Rhn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Rhn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Ux.Emitter,this._onDidChange=new Ux.Emitter,this._onDidSave=new Ux.Emitter,this._onDidClose=new Ux.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 PWe,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 _=u.cells;if(_.structure!==void 0){let v=_.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),_.structure.didOpen!==void 0)for(let b of _.structure.didOpen)r.openTextDocument({textDocument:b}),d.push(b.uri);if(_.structure.didClose)for(let b of _.structure.didClose)r.closeTextDocument({textDocument:b}),f.push(b.uri)}if(_.data!==void 0){let v=new Map(_.data.map(b=>[b.document,b]));for(let b=0;b<=s.cells.length;b++){let T=v.get(s.cells[b].document);if(T!==void 0){let w=s.cells.splice(b,1,T);if(h.push({old:w[0],new:T}),v.delete(T.document),v.size===0)break}}}if(_.textContent!==void 0)for(let v of _.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 _ of d)A.push(this.getNotebookCell(_));let y=[];for(let _ of f)y.push(this.getNotebookCell(_));let E=[];for(let _ of m)E.push(this.getNotebookCell(_));(A.length>0||y.length>0||h.length>0||E.length>0)&&(g.cells={added:A,removed:y,changed:{data:h,textContent:E}}),(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)}})),Ux.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Ile.NotebookDocuments=z6t});var khn=I(DWe=>{"use strict";p();Object.defineProperty(DWe,"__esModule",{value:!0});DWe.MonikerFeature=void 0;var G3o=ri(),$3o=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=G3o.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");DWe.MonikerFeature=$3o});var t9t=I(gc=>{"use strict";p();Object.defineProperty(gc,"__esModule",{value:!0});gc.createConnection=gc.combineFeatures=gc.combineNotebooksFeatures=gc.combineLanguagesFeatures=gc.combineWorkspaceFeatures=gc.combineWindowFeatures=gc.combineClientFeatures=gc.combineTracerFeatures=gc.combineTelemetryFeatures=gc.combineConsoleFeatures=gc._NotebooksImpl=gc._LanguagesImpl=gc.BulkUnregistration=gc.BulkRegistration=gc.ErrorMessageTracker=void 0;var Kr=ri(),Qx=pWe(),J6t=F6t(),To=mhn(),V3o=ghn(),W3o=Ahn(),z3o=yhn(),Y3o=H6t(),K3o=Ehn(),J3o=_hn(),Z3o=vhn(),X3o=Chn(),eFo=Shn(),tFo=Ihn(),rFo=xhn(),nFo=whn(),iFo=Y6t(),oFo=khn();function K6t(t){if(t!==null)return t}a(K6t,"null2Undefined");var Z6t=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)})}};gc.ErrorMessageTracker=Z6t;var NWe=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(Kr.MessageType.Error,e)}warn(e){this.send(Kr.MessageType.Warning,e)}info(e){this.send(Kr.MessageType.Info,e)}log(e){this.send(Kr.MessageType.Log,e)}debug(e){this.send(Kr.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Kr.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Kr.RAL)().console.error("Sending log message failed")})}},X6t=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:Kr.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(K6t)}showWarningMessage(e,...r){let n={type:Kr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(K6t)}showInformationMessage(e,...r){let n={type:Kr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(K6t)}},Phn=(0,K3o.ShowDocumentFeature)((0,To.ProgressFeature)(X6t)),Dhn;(function(t){function e(){return new MWe}a(e,"create"),t.create=e})(Dhn||(gc.BulkRegistration=Dhn={}));var MWe=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=Qx.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=J6t.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Nhn;(function(t){function e(){return new xIe(void 0,[])}a(e,"create"),t.create=e})(Nhn||(gc.BulkUnregistration=Nhn={}));var xIe=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(Kr.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=Qx.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(Kr.UnregistrationRequest.type,o).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},OWe=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 MWe?this.registerMany(e):e instanceof xIe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=Qx.string(r)?r:r.method,s=J6t.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Kr.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=Qx.string(e)?e:e.method,o=J6t.generateUuid(),s={registrations:[{id:o,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Kr.RegistrationRequest.type,s).then(c=>Kr.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(Kr.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(Kr.RegistrationRequest.type,r).then(()=>new xIe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},e9t=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(Kr.ApplyWorkspaceEditRequest.type,n)}},Mhn=(0,J3o.FileOperationsFeature)((0,W3o.WorkspaceFoldersFeature)((0,V3o.ConfigurationFeature)(e9t))),LWe=class{static{a(this,"TracerImpl")}constructor(){this._trace=Kr.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!==Kr.Trace.Off&&this.connection.sendNotification(Kr.LogTraceNotification.type,{message:e,verbose:this._trace===Kr.Trace.Verbose?r:void 0}).catch(()=>{})}},BWe=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(Kr.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},FWe=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,To.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,To.attachPartialResult)(this.connection,r)}};gc._LanguagesImpl=FWe;var Ohn=(0,tFo.FoldingRangeFeature)((0,oFo.MonikerFeature)((0,nFo.DiagnosticFeature)((0,rFo.InlayHintFeature)((0,eFo.InlineValueFeature)((0,X3o.TypeHierarchyFeature)((0,Z3o.LinkedEditingRangeFeature)((0,Y3o.SemanticTokensFeature)((0,z3o.CallHierarchyFeature)(FWe))))))))),UWe=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,To.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,To.attachPartialResult)(this.connection,r)}};gc._NotebooksImpl=UWe;var Lhn=(0,iFo.NotebookSyncFeature)(UWe);function Bhn(t,e){return function(r){return e(t(r))}}a(Bhn,"combineConsoleFeatures");gc.combineConsoleFeatures=Bhn;function Fhn(t,e){return function(r){return e(t(r))}}a(Fhn,"combineTelemetryFeatures");gc.combineTelemetryFeatures=Fhn;function Uhn(t,e){return function(r){return e(t(r))}}a(Uhn,"combineTracerFeatures");gc.combineTracerFeatures=Uhn;function Qhn(t,e){return function(r){return e(t(r))}}a(Qhn,"combineClientFeatures");gc.combineClientFeatures=Qhn;function qhn(t,e){return function(r){return e(t(r))}}a(qhn,"combineWindowFeatures");gc.combineWindowFeatures=qhn;function jhn(t,e){return function(r){return e(t(r))}}a(jhn,"combineWorkspaceFeatures");gc.combineWorkspaceFeatures=jhn;function Hhn(t,e){return function(r){return e(t(r))}}a(Hhn,"combineLanguagesFeatures");gc.combineLanguagesFeatures=Hhn;function Ghn(t,e){return function(r){return e(t(r))}}a(Ghn,"combineNotebooksFeatures");gc.combineNotebooksFeatures=Ghn;function sFo(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,Bhn),tracer:r(t.tracer,e.tracer,Uhn),telemetry:r(t.telemetry,e.telemetry,Fhn),client:r(t.client,e.client,Qhn),window:r(t.window,e.window,qhn),workspace:r(t.workspace,e.workspace,jhn),languages:r(t.languages,e.languages,Hhn),notebooks:r(t.notebooks,e.notebooks,Ghn)}}a(sFo,"combineFeatures");gc.combineFeatures=sFo;function aFo(t,e,r){let n=r&&r.console?new(r.console(NWe)):new NWe,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(LWe)):new LWe,c=r&&r.telemetry?new(r.telemetry(BWe)):new BWe,l=r&&r.client?new(r.client(OWe)):new OWe,u=r&&r.window?new(r.window(Phn)):new Phn,d=r&&r.workspace?new(r.workspace(Mhn)):new Mhn,f=r&&r.languages?new(r.languages(Ohn)):new Ohn,h=r&&r.notebooks?new(r.notebooks(Lhn)):new Lhn,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:Qx.thenable(v)?new Promise((b,T)=>{v.then(w=>b(w),w=>T(w))}):Promise.resolve(v)}a(g,"asPromise");let A,y,E,_={listen:a(()=>o.listen(),"listen"),sendRequest:a((v,...b)=>o.sendRequest(Qx.string(v)?v:v.method,...b),"sendRequest"),onRequest:a((v,b)=>o.onRequest(v,b),"onRequest"),sendNotification:a((v,b)=>{let T=Qx.string(v)?v:v.method;return o.sendNotification(T,b)},"sendNotification"),onNotification:a((v,b)=>o.onNotification(v,b),"onNotification"),onProgress:o.onProgress,sendProgress:o.sendProgress,onInitialize:a(v=>(y=v,{dispose:a(()=>{y=void 0},"dispose")}),"onInitialize"),onInitialized:a(v=>o.onNotification(Kr.InitializedNotification.type,v),"onInitialized"),onShutdown:a(v=>(A=v,{dispose:a(()=>{A=void 0},"dispose")}),"onShutdown"),onExit:a(v=>(E=v,{dispose:a(()=>{E=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(Kr.DidChangeConfigurationNotification.type,v),"onDidChangeConfiguration"),onDidChangeWatchedFiles:a(v=>o.onNotification(Kr.DidChangeWatchedFilesNotification.type,v),"onDidChangeWatchedFiles"),__textDocumentSync:void 0,onDidOpenTextDocument:a(v=>o.onNotification(Kr.DidOpenTextDocumentNotification.type,v),"onDidOpenTextDocument"),onDidChangeTextDocument:a(v=>o.onNotification(Kr.DidChangeTextDocumentNotification.type,v),"onDidChangeTextDocument"),onDidCloseTextDocument:a(v=>o.onNotification(Kr.DidCloseTextDocumentNotification.type,v),"onDidCloseTextDocument"),onWillSaveTextDocument:a(v=>o.onNotification(Kr.WillSaveTextDocumentNotification.type,v),"onWillSaveTextDocument"),onWillSaveTextDocumentWaitUntil:a(v=>o.onRequest(Kr.WillSaveTextDocumentWaitUntilRequest.type,v),"onWillSaveTextDocumentWaitUntil"),onDidSaveTextDocument:a(v=>o.onNotification(Kr.DidSaveTextDocumentNotification.type,v),"onDidSaveTextDocument"),sendDiagnostics:a(v=>o.sendNotification(Kr.PublishDiagnosticsNotification.type,v),"sendDiagnostics"),onHover:a(v=>o.onRequest(Kr.HoverRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Kr.CompletionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCompletion"),onCompletionResolve:a(v=>o.onRequest(Kr.CompletionResolveRequest.type,v),"onCompletionResolve"),onSignatureHelp:a(v=>o.onRequest(Kr.SignatureHelpRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Kr.DeclarationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Kr.DefinitionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Kr.TypeDefinitionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Kr.ImplementationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onImplementation"),onReferences:a(v=>o.onRequest(Kr.ReferencesRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Kr.DocumentHighlightRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Kr.DocumentSymbolRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Kr.WorkspaceSymbolRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onWorkspaceSymbol"),onWorkspaceSymbolResolve:a(v=>o.onRequest(Kr.WorkspaceSymbolResolveRequest.type,v),"onWorkspaceSymbolResolve"),onCodeAction:a(v=>o.onRequest(Kr.CodeActionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCodeAction"),onCodeActionResolve:a(v=>o.onRequest(Kr.CodeActionResolveRequest.type,(b,T)=>v(b,T)),"onCodeActionResolve"),onCodeLens:a(v=>o.onRequest(Kr.CodeLensRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCodeLens"),onCodeLensResolve:a(v=>o.onRequest(Kr.CodeLensResolveRequest.type,(b,T)=>v(b,T)),"onCodeLensResolve"),onDocumentFormatting:a(v=>o.onRequest(Kr.DocumentFormattingRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Kr.DocumentRangeFormattingRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onDocumentRangeFormatting"),onDocumentOnTypeFormatting:a(v=>o.onRequest(Kr.DocumentOnTypeFormattingRequest.type,(b,T)=>v(b,T)),"onDocumentOnTypeFormatting"),onRenameRequest:a(v=>o.onRequest(Kr.RenameRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onRenameRequest"),onPrepareRename:a(v=>o.onRequest(Kr.PrepareRenameRequest.type,(b,T)=>v(b,T)),"onPrepareRename"),onDocumentLinks:a(v=>o.onRequest(Kr.DocumentLinkRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentLinks"),onDocumentLinkResolve:a(v=>o.onRequest(Kr.DocumentLinkResolveRequest.type,(b,T)=>v(b,T)),"onDocumentLinkResolve"),onDocumentColor:a(v=>o.onRequest(Kr.DocumentColorRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Kr.ColorPresentationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Kr.FoldingRangeRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Kr.SelectionRangeRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Kr.ExecuteCommandRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onExecuteCommand"),dispose:a(()=>o.dispose(),"dispose")};for(let v of m)v.attach(_);return o.onRequest(Kr.InitializeRequest.type,v=>{e.initialize(v),Qx.string(v.trace)&&(s.trace=Kr.Trace.fromString(v.trace));for(let b of m)b.initialize(v.capabilities);if(y){let b=y(v,new Kr.CancellationTokenSource().token,(0,To.attachWorkDone)(o,v),void 0);return g(b).then(T=>{if(T instanceof Kr.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=Qx.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None:!Qx.number(R.textDocumentSync)&&!Qx.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=Qx.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None);for(let x of m)x.fillServerCapabilities(R);return w})}else{let b={capabilities:{textDocumentSync:Kr.TextDocumentSyncKind.None}};for(let T of m)T.fillServerCapabilities(b.capabilities);return b}}),o.onRequest(Kr.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Kr.CancellationTokenSource().token)}),o.onNotification(Kr.ExitNotification.type,()=>{try{E&&E()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),o.onNotification(Kr.SetTraceNotification.type,v=>{s.trace=Kr.Trace.fromString(v.value)}),_}a(aFo,"createConnection");gc.createConnection=aFo});var $hn=I(DC=>{"use strict";p();Object.defineProperty(DC,"__esModule",{value:!0});DC.resolveModulePath=DC.FileSystem=DC.resolveGlobalYarnPath=DC.resolveGlobalNodePath=DC.resolve=DC.uriToFilePath=void 0;var cFo=require("url"),kP=require("path"),r9t=require("fs"),s9t=require("child_process");function lFo(t){let e=cFo.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 kP.normalize(r.join("/"))}a(lFo,"uriToFilePath");DC.uriToFilePath=lFo;function n9t(){return process.platform==="win32"}a(n9t,"isWindows");function QWe(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&&r9t.existsSync(e)&&(d[o]?d[o]=e+kP.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,s9t.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(QWe,"resolve");DC.resolve=QWe;function i9t(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};n9t()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,s9t.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?n9t()?kP.join(c,"node_modules"):kP.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(i9t,"resolveGlobalNodePath");DC.resolveGlobalNodePath=i9t;function uFo(t){let e="yarn",r={encoding:"utf8"};n9t()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,s9t.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 kP.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(uFo,"resolveGlobalYarnPath");DC.resolveGlobalYarnPath=uFo;var o9t;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!r9t.existsSync(__filename.toUpperCase())||!r9t.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?kP.normalize(s).indexOf(kP.normalize(o))===0:kP.normalize(s).toLowerCase().indexOf(kP.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(o9t||(DC.FileSystem=o9t={}));function dFo(t,e,r,n){return r?(kP.isAbsolute(r)||(r=kP.join(t,r)),QWe(e,r,r,n).then(o=>o9t.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>QWe(e,i9t(n),t,n))):QWe(e,i9t(n),t,n)}a(dFo,"resolveModulePath");DC.resolveModulePath=dFo});var a9t=I((eLu,Vhn)=>{"use strict";p();Vhn.exports=ri()});var Whn=I(qWe=>{"use strict";p();Object.defineProperty(qWe,"__esModule",{value:!0});qWe.InlineCompletionFeature=void 0;var fFo=ri(),pFo=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(fFo.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");qWe.InlineCompletionFeature=pFo});var Khn=I(oE=>{"use strict";p();var hFo=oE&&oE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Yhn=oE&&oE.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hFo(e,t,r)};Object.defineProperty(oE,"__esModule",{value:!0});oE.ProposedFeatures=oE.NotebookDocuments=oE.TextDocuments=oE.SemanticTokensBuilder=void 0;var mFo=H6t();Object.defineProperty(oE,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return mFo.SemanticTokensBuilder},"get")});var gFo=Whn();Yhn(ri(),oE);var AFo=W6t();Object.defineProperty(oE,"TextDocuments",{enumerable:!0,get:a(function(){return AFo.TextDocuments},"get")});var yFo=Y6t();Object.defineProperty(oE,"NotebookDocuments",{enumerable:!0,get:a(function(){return yFo.NotebookDocuments},"get")});Yhn(t9t(),oE);var zhn;(function(t){t.all={__brand:"features",languages:gFo.InlineCompletionFeature}})(zhn||(oE.ProposedFeatures=zhn={}))});var Xc=I(qx=>{"use strict";p();var EFo=qx&&qx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),emn=qx&&qx.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EFo(e,t,r)};Object.defineProperty(qx,"__esModule",{value:!0});qx.createConnection=qx.Files=void 0;var Jhn=require("node:util"),c9t=pWe(),_Fo=t9t(),wIe=$hn(),WY=a9t();emn(a9t(),qx);emn(Khn(),qx);var Zhn;(function(t){t.uriToFilePath=wIe.uriToFilePath,t.resolveGlobalNodePath=wIe.resolveGlobalNodePath,t.resolveGlobalYarnPath=wIe.resolveGlobalYarnPath,t.resolve=wIe.resolve,t.resolveModulePath=wIe.resolveModulePath})(Zhn||(qx.Files=Zhn={}));var Xhn;function jWe(){if(Xhn!==void 0)try{Xhn.end()}catch{}}a(jWe,"endProtocolConnection");var xle=!1,tmn;function vFo(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(tmn=setInterval(()=>{try{process.kill(n,0)}catch{jWe(),process.exit(xle?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;c9t.number(e)&&tmn===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(xle?0:1)}},3e3)},"initialize"),get shutdownReceived(){return xle},set shutdownReceived(t){xle=t},exit:a(t=>{jWe(),process.exit(t)},"exit")};function bFo(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),WY.ConnectionStrategy.is(t)||WY.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),SFo(s,c,l,o)}a(bFo,"createConnection");qx.createConnection=bFo;function SFo(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{jWe(),process.exit(xle?0:1)}),u.on("close",()=>{jWe(),process.exit(xle?0:1)})}let l=a(u=>{let d=(0,WY.createProtocolConnection)(t,e,u,r);return o&&TFo(u),d},"connectionFactory");return(0,_Fo.createConnection)(l,CFo,n)}a(SFo,"_createConnection");function TFo(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,Jhn.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,Jhn.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(TFo,"patchConsole")});var PP=I((fLu,rmn)=>{"use strict";p();rmn.exports=Xc()});var Mmn=I((n3u,Nmn)=>{"use strict";p();Nmn.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 D0n=I(s0=>{"use strict";p();var G9t=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),I8o=G9t(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,E=parseInt("100",8),_=parseInt("010",8),v=parseInt("001",8),b=E|_;return!!(g&v||g&_&&m.has(y)||g&E&&A===d||g&b&&d===0)},"A")}),x8o=G9t(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")}),w8o=G9t(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),x0n=s0&&s0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),R8o=s0&&s0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w0n=s0&&s0.__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:D8o,sync:N8o}=D0n(),{join:M8o,delimiter:O8o,sep:N0n,posix:M0n}=require("path"),O0n=process.platform==="win32",L0n=new RegExp(`[${M0n.sep}${N0n===M0n.sep?"":N0n}]`.replace(/(\\)/g,"\\$1")),L8o=new RegExp(`^\\.${L0n.source}`),B0n=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),F0n=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=O8o})=>{let o=t.match(L0n)?[""]:[...O0n?[process.cwd()]:[],...(e||"").split(n)];if(O0n){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"),U0n=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&L8o.test(e)?e.slice(0,2):"")+M8o(r,e)},"getPathPart"),Q0n=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=F0n(t,e),s=[];for(let c of r){let l=U0n(c,t);for(let u of n){let d=l+u;if(await D8o(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 B0n(t)},"which"),B8o=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=F0n(t,e),s=[];for(let c of r){let l=U0n(c,t);for(let u of n){let d=l+u;if(N8o(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 B0n(t)},"whichSync");q0n.exports=Q0n;Q0n.sync=B8o});var GIe=I((U7u,rAn)=>{"use strict";p();var Zgn="[^\\\\/]",_9o="(?=.)",Xgn="[^/]",lUt="(?:\\/|$)",eAn="(?:^|\\/)",uUt=`\\.{1,2}${lUt}`,v9o="(?!\\.)",C9o=`(?!${eAn}${uUt})`,b9o=`(?!\\.{0,1}${lUt})`,S9o=`(?!${uUt})`,T9o="[^.\\/]",I9o=`${Xgn}*?`,x9o="/",tAn={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:_9o,QMARK:Xgn,END_ANCHOR:lUt,DOTS_SLASH:uUt,NO_DOT:v9o,NO_DOTS:C9o,NO_DOT_SLASH:b9o,NO_DOTS_SLASH:S9o,QMARK_NO_DOT:T9o,STAR:I9o,START_ANCHOR:eAn,SEP:x9o},w9o={...tAn,SLASH_LITERAL:"[\\\\/]",QMARK:Zgn,STAR:`${Zgn}*?`,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:"\\"},R9o={__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"};rAn.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:R9o,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?w9o:tAn}}});var $Ie=I(LC=>{"use strict";p();var{REGEX_BACKSLASH:k9o,REGEX_REMOVE_BACKSLASH:P9o,REGEX_SPECIAL_CHARS:D9o,REGEX_SPECIAL_CHARS_GLOBAL:N9o}=GIe();LC.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);LC.hasRegexChars=t=>D9o.test(t);LC.isRegexChar=t=>t.length===1&&LC.hasRegexChars(t);LC.escapeRegex=t=>t.replace(N9o,"\\$1");LC.toPosixSlashes=t=>t.replace(k9o,"/");LC.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};LC.removeBackslashes=t=>t.replace(P9o,e=>e==="\\"?"":e);LC.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?LC.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};LC.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};LC.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};LC.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var uAn=I((H7u,lAn)=>{"use strict";p();var nAn=$Ie(),{CHAR_ASTERISK:dUt,CHAR_AT:M9o,CHAR_BACKWARD_SLASH:VIe,CHAR_COMMA:O9o,CHAR_DOT:fUt,CHAR_EXCLAMATION_MARK:pUt,CHAR_FORWARD_SLASH:cAn,CHAR_LEFT_CURLY_BRACE:hUt,CHAR_LEFT_PARENTHESES:mUt,CHAR_LEFT_SQUARE_BRACKET:L9o,CHAR_PLUS:B9o,CHAR_QUESTION_MARK:iAn,CHAR_RIGHT_CURLY_BRACE:F9o,CHAR_RIGHT_PARENTHESES:oAn,CHAR_RIGHT_SQUARE_BRACKET:U9o}=GIe(),sAn=a(t=>t===cAn||t===VIe,"isPathSeparator"),aAn=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),Q9o=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,E=!1,_=!1,v=!1,b=!1,T=!1,w=!1,R=0,x,P,D={value:"",depth:0,isGlob:!1},N=a(()=>d>=n,"eos"),L=a(()=>u.charCodeAt(d+1),"peek"),B=a(()=>(x=P,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),O=u.slice(h)):A===!0?(q="",O=u):q=u,q&&q!==""&&q!=="/"&&q!==u&&sAn(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),r.unescape===!0&&(O&&(O=nAn.removeBackslashes(O)),q&&v===!0&&(q=nAn.removeBackslashes(q)));let j={prefix:M,input:t,start:f,base:q,glob:O,isBrace:m,isBracket:g,isGlob:A,isExtglob:y,isGlobstar:E,negated:b,negatedExtglob:T};if(r.tokens===!0&&(j.maxDepth=0,sAn(P)||c.push(D),j.tokens=c),r.parts===!0||r.tokens===!0){let Q;for(let U=0;U{"use strict";p();var WIe=GIe(),QS=$Ie(),{MAX_LENGTH:Dze,POSIX_REGEX_SOURCE:q9o,REGEX_NON_SPECIAL_CHARS:j9o,REGEX_SPECIAL_CHARS_BACKREF:H9o,REPLACEMENTS:dAn}=WIe,G9o=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=>QS.escapeRegex(o)).join("..")}return r},"expandRange"),Qle=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),fAn=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"),$9o=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"),pAn=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if($9o(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),V9o=a(t=>{let e=t.map(pAn).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"),W9o=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=pAn(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?QS.escapeRegex(r[0]):`[${r.map(o=>QS.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),z9o=a(t=>{let e=0,r=t.trim(),n=gUt(r);for(;n;)e++,r=n.body.trim(),n=gUt(r);return e},"repeatedExtglobRecursion"),Y9o=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:WIe.DEFAULT_MAX_EXTGLOB_RECURSION,n=fAn(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||V9o(n)))return{risky:!0};for(let o of n){let s=W9o(o);if(s)return{risky:!0,safeOutput:s};if(z9o(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),AUt=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=dAn[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Dze,r.maxLength):Dze,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=WIe.globChars(r.windows),d=WIe.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:m,ONE_CHAR:g,DOTS_SLASH:A,NO_DOT:y,NO_DOT_SLASH:E,NO_DOTS_SLASH:_,QMARK:v,QMARK_NO_DOT:b,STAR:T,START_ANCHOR:w}=u,R=a(ge=>`(${l}(?:(?!${w}${ge.dot?A:f}).)*?)`,"globstar"),x=r.dot?"":y,P=r.dot?v:b,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=QS.removePrefix(t,N),o=t.length;let L=[],B=[],q=[],M=s,O,j=a(()=>N.index===o-1,"eos"),Q=N.peek=(ge=1)=>t[N.index+ge],U=N.advance=()=>t[++N.index]||"",Y=a(()=>t.slice(N.index+1),"remaining"),W=a((ge="",Ue=0)=>{N.consumed+=ge,N.index+=Ue},"consume"),V=a(ge=>{N.output+=ge.output!=null?ge.output:ge.value,W(ge.value)},"append"),z=a(()=>{let ge=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)U(),N.start++,ge++;return ge%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),ie=a(ge=>{N[ge]++,q.push(ge)},"increment"),H=a(ge=>{N[ge]--,q.pop()},"decrement"),re=a(ge=>{if(M.type==="globstar"){let Ue=N.braces>0&&(ge.type==="comma"||ge.type==="brace"),ke=ge.extglob===!0||L.length&&(ge.type==="pipe"||ge.type==="paren");ge.type!=="slash"&&ge.type!=="paren"&&!Ue&&!ke&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(L.length&&ge.type!=="paren"&&(L[L.length-1].inner+=ge.value),(ge.value||ge.output)&&V(ge),M&&M.type==="text"&&ge.type==="text"){M.output=(M.output||M.value)+ge.value,M.value+=ge.value;return}ge.prev=M,c.push(ge),M=ge},"push"),le=a((ge,Ue)=>{let ke={...d[Ue],conditions:1,inner:""};ke.prev=M,ke.parens=N.parens,ke.output=N.output,ke.startIndex=N.index,ke.tokensIndex=c.length;let X=(r.capture?"(":"")+ke.open;ie("parens"),re({type:ge,value:Ue,output:N.output?"":g}),re({type:"paren",extglob:!0,value:U(),output:X}),L.push(ke)},"extglobOpen"),Le=a(ge=>{let Ue=t.slice(ge.startIndex,N.index+1),ke=t.slice(ge.startIndex+2,N.index),X=Y9o(ke,r);if((ge.type==="plus"||ge.type==="star")&&X.risky){let he=X.safeOutput?(ge.output?"":g)+(r.capture?`(${X.safeOutput})`:X.safeOutput):void 0,Z=c[ge.tokensIndex];Z.type="text",Z.value=Ue,Z.output=he||QS.escapeRegex(Ue);for(let ue=ge.tokensIndex+1;ue1&&ge.inner.includes("/")&&(he=R(r)),(he!==D||j()||/^\)+$/.test(Y()))&&(ee=ge.close=`)$))${he}`),ge.inner.includes("*")&&(K=Y())&&/^\.[^\\/.]+$/.test(K)){let Z=AUt(K,{...e,fastpaths:!1}).output;ee=ge.close=`)${Z})${he})`}ge.prev.type==="bos"&&(N.negatedExtglob=!0)}re({type:"paren",extglob:!0,value:O,output:ee}),H("parens")},"extglobClose");if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let ge=!1,Ue=t.replace(H9o,(ke,X,ee,K,he,Z)=>K==="\\"?(ge=!0,ke):K==="?"?X?X+K+(he?v.repeat(he.length):""):Z===0?P+(he?v.repeat(he.length):""):v.repeat(ee.length):K==="."?f.repeat(ee.length):K==="*"?X?X+K+(he?D:""):D:X?ke:`\\${ke}`);return ge===!0&&(r.unescape===!0?Ue=Ue.replace(/\\/g,""):Ue=Ue.replace(/\\+/g,ke=>ke.length%2===0?"\\\\":ke?"\\":"")),Ue===t&&r.contains===!0?(N.output=t,N):(N.output=QS.wrapOutput(Ue,N,e),N)}for(;!j();){if(O=U(),O==="\0")continue;if(O==="\\"){let ke=Q();if(ke==="/"&&r.bash!==!0||ke==="."||ke===";")continue;if(!ke){O+="\\",re({type:"text",value:O});continue}let X=/^\\+/.exec(Y()),ee=0;if(X&&X[0].length>2&&(ee=X[0].length,N.index+=ee,ee%2!==0&&(O+="\\")),r.unescape===!0?O=U():O+=U(),N.brackets===0){re({type:"text",value:O});continue}}if(N.brackets>0&&(O!=="]"||M.value==="["||M.value==="[^")){if(r.posix!==!1&&O===":"){let ke=M.value.slice(1);if(ke.includes("[")&&(M.posix=!0,ke.includes(":"))){let X=M.value.lastIndexOf("["),ee=M.value.slice(0,X),K=M.value.slice(X+2),he=q9o[K];if(he){M.value=ee+he,N.backtrack=!0,U(),!s.output&&c.indexOf(M)===1&&(s.output=g);continue}}}(O==="["&&Q()!==":"||O==="-"&&Q()==="]")&&(O=`\\${O}`),O==="]"&&(M.value==="["||M.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&M.value==="["&&(O="^"),M.value+=O,V({value:O});continue}if(N.quotes===1&&O!=='"'){O=QS.escapeRegex(O),M.value+=O,V({value:O});continue}if(O==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:O});continue}if(O==="("){ie("parens"),re({type:"paren",value:O});continue}if(O===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Qle("opening","("));let ke=L[L.length-1];if(ke&&N.parens===ke.parens+1){Le(L.pop());continue}re({type:"paren",value:O,output:N.parens?")":"\\)"}),H("parens");continue}if(O==="["){if(r.nobracket===!0||!Y().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Qle("closing","]"));O=`\\${O}`}else ie("brackets");re({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||M&&M.type==="bracket"&&M.value.length===1){re({type:"text",value:O,output:`\\${O}`});continue}if(N.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Qle("opening","["));re({type:"text",value:O,output:`\\${O}`});continue}H("brackets");let ke=M.value.slice(1);if(M.posix!==!0&&ke[0]==="^"&&!ke.includes("/")&&(O=`/${O}`),M.value+=O,V({value:O}),r.literalBrackets===!1||QS.hasRegexChars(ke))continue;let X=QS.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=X,M.value=X;continue}M.value=`(${l}${X}|${M.value})`,N.output+=M.value;continue}if(O==="{"&&r.nobrace!==!0){ie("braces");let ke={type:"brace",value:O,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};B.push(ke),re(ke);continue}if(O==="}"){let ke=B[B.length-1];if(r.nobrace===!0||!ke){re({type:"text",value:O,output:O});continue}let X=")";if(ke.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);X=G9o(K,r),N.backtrack=!0}if(ke.comma!==!0&&ke.dots!==!0){let ee=N.output.slice(0,ke.outputIndex),K=N.tokens.slice(ke.tokensIndex);ke.value=ke.output="\\{",O=X="\\}",N.output=ee;for(let he of K)N.output+=he.output||he.value}re({type:"brace",value:O,output:X}),H("braces"),B.pop();continue}if(O==="|"){L.length>0&&L[L.length-1].conditions++,re({type:"text",value:O});continue}if(O===","){let ke=O,X=B[B.length-1];X&&q[q.length-1]==="braces"&&(X.comma=!0,ke="|"),re({type:"comma",value:O,output:ke});continue}if(O==="/"){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:O,output:m});continue}if(O==="."){if(N.braces>0&&M.type==="dot"){M.value==="."&&(M.output=f);let ke=B[B.length-1];M.type="dots",M.output+=O,M.value+=O,ke.dots=!0;continue}if(N.braces+N.parens===0&&M.type!=="bos"&&M.type!=="slash"){re({type:"text",value:O,output:f});continue}re({type:"dot",value:O,output:f});continue}if(O==="?"){if(!(M&&M.value==="(")&&r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){le("qmark",O);continue}if(M&&M.type==="paren"){let X=Q(),ee=O;(M.value==="("&&!/[!=<:]/.test(X)||X==="<"&&!/<([!=]|\w+>)/.test(Y()))&&(ee=`\\${O}`),re({type:"text",value:O,output:ee});continue}if(r.dot!==!0&&(M.type==="slash"||M.type==="bos")){re({type:"qmark",value:O,output:b});continue}re({type:"qmark",value:O,output:v});continue}if(O==="!"){if(r.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){le("negate",O);continue}if(r.nonegate!==!0&&N.index===0){z();continue}}if(O==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){le("plus",O);continue}if(M&&M.value==="("||r.regex===!1){re({type:"plus",value:O,output:h});continue}if(M&&(M.type==="bracket"||M.type==="paren"||M.type==="brace")||N.parens>0){re({type:"plus",value:O});continue}re({type:"plus",value:h});continue}if(O==="@"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){re({type:"at",extglob:!0,value:O,output:""});continue}re({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let ke=j9o.exec(Y());ke&&(O+=ke[0],N.index+=ke[0].length),re({type:"text",value:O});continue}if(M&&(M.type==="globstar"||M.star===!0)){M.type="star",M.star=!0,M.value+=O,M.output=D,N.backtrack=!0,N.globstar=!0,W(O);continue}let ge=Y();if(r.noextglob!==!0&&/^\([^?]/.test(ge)){le("star",O);continue}if(M.type==="star"){if(r.noglobstar===!0){W(O);continue}let ke=M.prev,X=ke.prev,ee=ke.type==="slash"||ke.type==="bos",K=X&&(X.type==="star"||X.type==="globstar");if(r.bash===!0&&(!ee||ge[0]&&ge[0]!=="/")){re({type:"star",value:O,output:""});continue}let he=N.braces>0&&(ke.type==="comma"||ke.type==="brace"),Z=L.length&&(ke.type==="pipe"||ke.type==="paren");if(!ee&&ke.type!=="paren"&&!he&&!Z){re({type:"star",value:O,output:""});continue}for(;ge.slice(0,3)==="/**";){let ue=t[N.index+4];if(ue&&ue!=="/")break;ge=ge.slice(3),W("/**",3)}if(ke.type==="bos"&&j()){M.type="globstar",M.value+=O,M.output=R(r),N.output=M.output,N.globstar=!0,W(O);continue}if(ke.type==="slash"&&ke.prev.type!=="bos"&&!K&&j()){N.output=N.output.slice(0,-(ke.output+M.output).length),ke.output=`(?:${ke.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=O,N.globstar=!0,N.output+=ke.output+M.output,W(O);continue}if(ke.type==="slash"&&ke.prev.type!=="bos"&&ge[0]==="/"){let ue=ge[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(ke.output+M.output).length),ke.output=`(?:${ke.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${ue})`,M.value+=O,N.output+=ke.output+M.output,N.globstar=!0,W(O+U()),re({type:"slash",value:"/",output:""});continue}if(ke.type==="bos"&&ge[0]==="/"){M.type="globstar",M.value+=O,M.output=`(?:^|${m}|${R(r)}${m})`,N.output=M.output,N.globstar=!0,W(O+U()),re({type:"slash",value:"/",output:""});continue}N.output=N.output.slice(0,-M.output.length),M.type="globstar",M.output=R(r),M.value+=O,N.output+=M.output,N.globstar=!0,W(O);continue}let Ue={type:"star",value:O,output:D};if(r.bash===!0){Ue.output=".*?",(M.type==="bos"||M.type==="slash")&&(Ue.output=x+Ue.output),re(Ue);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){Ue.output=O,re(Ue);continue}(N.index===N.start||M.type==="slash"||M.type==="dot")&&(M.type==="dot"?(N.output+=E,M.output+=E):r.dot===!0?(N.output+=_,M.output+=_):(N.output+=x,M.output+=x),Q()!=="*"&&(N.output+=g,M.output+=g)),re(Ue)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing","]"));N.output=QS.escapeLast(N.output,"["),H("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing",")"));N.output=QS.escapeLast(N.output,"("),H("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing","}"));N.output=QS.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 ge of N.tokens)N.output+=ge.output!=null?ge.output:ge.value,ge.suffix&&(N.output+=ge.suffix)}return N},"parse");AUt.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Dze,r.maxLength):Dze,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=dAn[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}=WIe.globChars(r.windows),A=r.dot?f:d,y=r.dot?h:d,E=r.capture?"":"?:",_={negated:!1,prefix:""},v=r.bash===!0?".*?":m;r.capture&&(v=`(${v})`);let b=a(x=>x.noglobstar===!0?v:`(${E}(?:(?!${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+b(r);case"**/*":return`(?:${A}${b(r)}${c})?${y}${l}${v}`;case"**/*.*":return`(?:${A}${b(r)}${c})?${y}${v}${s}${l}${v}`;case"**/.*":return`(?:${A}${b(r)}${c})?${s}${l}${v}`;default:{let P=/^(.*?)\.(\w+)$/.exec(x);if(!P)return;let D=T(P[1]);return D?D+s+P[2]:void 0}}},"create"),w=QS.removePrefix(t,_),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};hAn.exports=AUt});var yAn=I((Y7u,AAn)=>{"use strict";p();var K9o=uAn(),yUt=mAn(),gAn=$Ie(),J9o=GIe(),Z9o=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),Zp=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>Zp(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=Z9o(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?Zp.compileRe(t,e):Zp.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=Zp(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=Zp.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");Zp.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?gAn.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=Zp.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};Zp.matchBase=(t,e,r)=>(e instanceof RegExp?e:Zp.makeRe(e,r)).test(gAn.basename(t));Zp.isMatch=(t,e,r)=>Zp(e,r)(t);Zp.parse=(t,e)=>Array.isArray(t)?t.map(r=>Zp.parse(r,e)):yUt(t,{...e,fastpaths:!1});Zp.scan=(t,e)=>K9o(t,e);Zp.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=Zp.toRegex(l,e);return n===!0&&(u.state=t),u};Zp.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=yUt.fastpaths(t,e)),o.output||(o=yUt(t,e)),Zp.compileRe(o,e,r,n)};Zp.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/$^/}};Zp.constants=J9o;AAn.exports=Zp});var CAn=I((Z7u,vAn)=>{"use strict";p();var EAn=yAn(),X9o=$Ie();function _An(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:X9o.isWindows()}),EAn(t,e,r)}a(_An,"picomatch");Object.assign(_An,EAn);vAn.exports=_An});var SAn=I((tQu,bAn)=>{p();bAn.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 xAn=I((iQu,IAn)=>{p();var eUo=SAn(),TAn={"{":"}","(":")","[":"]"},tUo=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=TAn[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),rUo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var yK=require("path"),nUo=CAn(),iUo=xAn();function Nze(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(iUo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=nUo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(yK.resolve(t,o))}return e}a(Nze,"normalizeOptions");wAn.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(yK.resolve(e),yK.resolve(r),Nze(e,n))},getEventsSince(e,r,n){return t.getEventsSince(yK.resolve(e),yK.resolve(r),Nze(e,n))},async subscribe(e,r,n){return e=yK.resolve(e),n=Nze(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(yK.resolve(e),r,Nze(e,n))}})});var kAn=I(zIe=>{"use strict";p();var oUo=require("path"),{createWrapper:sUo}=RAn();function aUo(){return oUo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(aUo,"resolveBindingPath");var cUo=require(aUo()),Mze=sUo(cUo);zIe.writeSnapshot=Mze.writeSnapshot;zIe.getEventsSince=Mze.getEventsSince;zIe.subscribe=Mze.subscribe;zIe.unsubscribe=Mze.unsubscribe});var q_=I(Qze=>{"use strict";p();Object.defineProperty(Qze,"__esModule",{value:!0});Qze.Position=void 0;var bUt=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(qze,"__esModule",{value:!0});qze.Range=void 0;var LAn=q_(),SUt=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 LAn.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new LAn.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}};qze.Range=SUt});var Fyn=I(l7t=>{"use strict";p();Object.defineProperty(l7t,"__esModule",{value:!0});l7t.assertNever=f7o;function f7o(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(f7o,"assertNever")});var lxe=I(F3=>{"use strict";p();Object.defineProperty(F3,"__esModule",{value:!0});F3.ChatCompletionContentPartOpaque=F3.ChatCompletionContentPartKind=F3.ChatRole=void 0;var p7o=Fyn(),hYe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(hYe||(F3.ChatRole=hYe={}));(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,p7o.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(hYe||(F3.ChatRole=hYe={}));var Uyn;(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"})(Uyn||(F3.ChatCompletionContentPartKind=Uyn={}));var Qyn;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(Qyn||(F3.ChatCompletionContentPartOpaque=Qyn={}))});var u7t=I(EO=>{"use strict";p();Object.defineProperty(EO,"__esModule",{value:!0});EO.BaseTokensPerName=EO.BaseTokensPerMessage=EO.BaseTokensPerCompletion=EO.ChatRole=void 0;var qyn;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(qyn||(EO.ChatRole=qyn={}));EO.BaseTokensPerCompletion=3;EO.BaseTokensPerMessage=3;EO.BaseTokensPerName=1});var $yn=I(gYe=>{"use strict";p();Object.defineProperty(gYe,"__esModule",{value:!0});gYe.toOpenAiChatMessage=Gyn;gYe.toOpenAIChatMessages=m7o;var _O=lxe(),mYe=u7t(),h7o=sq();function jyn(t){return t.filter(e=>e.type===_O.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(jyn,"onlyStringContent");function Hyn(t){let e=t.map(r=>{if(r.type===_O.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===_O.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===_O.ChatCompletionContentPartKind.Document)return;if(r.type===_O.ChatCompletionContentPartKind.Opaque&&_O.ChatCompletionContentPartOpaque.usableIn(r,h7o.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(Hyn,"stringAndImageContent");function Gyn(t){switch(t.role){case _O.ChatRole.System:return{role:mYe.ChatRole.System,content:jyn(t.content),name:t.name};case _O.ChatRole.User:return{role:mYe.ChatRole.User,content:Hyn(t.content),name:t.name};case _O.ChatRole.Assistant:return{role:mYe.ChatRole.Assistant,content:jyn(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case _O.ChatRole.Tool:return{role:mYe.ChatRole.Tool,content:Hyn(t.content),tool_call_id:t.toolCallId};default:return}}a(Gyn,"toOpenAiChatMessage");function m7o(t){return t.map(Gyn).filter(e=>!!e)}a(m7o,"toOpenAIChatMessages")});var Wyn=I(EYe=>{"use strict";p();Object.defineProperty(EYe,"__esModule",{value:!0});EYe.toVsCodeChatMessage=Vyn;EYe.toVsCodeChatMessages=g7o;var yYe=lxe();function AYe(t){return t.filter(e=>e.type===yYe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(AYe,"onlyStringContent");var aq;function Vyn(t){switch(aq??=require("vscode"),t.role){case yYe.ChatRole.Assistant:let e=aq.LanguageModelChatMessage.Assistant(AYe(t.content),t.name);return t.toolCalls&&(e.content=[new aq.LanguageModelTextPart(AYe(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 aq.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case yYe.ChatRole.User:return aq.LanguageModelChatMessage.User(AYe(t.content),t.name);case yYe.ChatRole.Tool:{let r=aq.LanguageModelChatMessage.User("");return r.content=[new aq.LanguageModelToolResultPart(t.toolCallId,[new aq.LanguageModelTextPart(AYe(t.content))])],r}default:return}}a(Vyn,"toVsCodeChatMessage");function g7o(t){return t.map(Vyn).filter(e=>!!e)}a(g7o,"toVsCodeChatMessages")});var sq=I(FP=>{"use strict";p();Object.defineProperty(FP,"__esModule",{value:!0});FP.OutputMode=FP.Raw=FP.OpenAI=void 0;FP.toMode=d7t;FP.toVSCode=A7o;FP.toOpenAI=y7o;var zyn=$yn(),Yyn=Wyn();FP.OpenAI=u7t();FP.Raw=lxe();var IK;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(IK||(FP.OutputMode=IK={}));function d7t(t,e){switch(t){case IK.Raw:return e;case IK.VSCode:return e instanceof Array?(0,Yyn.toVsCodeChatMessages)(e):(0,Yyn.toVsCodeChatMessage)(e);case IK.OpenAI:return e instanceof Array?(0,zyn.toOpenAIChatMessages)(e):(0,zyn.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(d7t,"toMode");function A7o(t){return d7t(IK.VSCode,t)}a(A7o,"toVSCode");function y7o(t){return d7t(IK.OpenAI,t)}a(y7o,"toOpenAI")});var f7t=I(uxe=>{"use strict";p();Object.defineProperty(uxe,"__esModule",{value:!0});uxe.jsonRetainedProps=void 0;uxe.forEachNode=Kyn;uxe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function Kyn(t,e){if(e(t),t.type===1)for(let r of t.children)Kyn(r,e)}a(Kyn,"forEachNode")});var Jyn=I(p7t=>{"use strict";p();Object.defineProperty(p7t,"__esModule",{value:!0});p7t.once=E7o;function E7o(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(E7o,"once")});var A7t=I(hg=>{"use strict";p();Object.defineProperty(hg,"__esModule",{value:!0});hg.BudgetExceededError=hg.MaterializedChatMessageDocument=hg.MaterializedChatMessageImage=hg.MaterializedChatMessageBreakpoint=hg.MaterializedChatMessageOpaque=hg.MaterializedChatMessage=hg.MaterializedChatMessageTextChunk=hg.GenericMaterializedContainer=void 0;var xK=Jyn(),RA=sq(),U3=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=lq(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 sEn(e,this.children,r)}allMetadata(){return oEn(this)}findById(e){return g7t(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)_7o(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof QP&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof QP||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return m7t(this,e),e}};hg.GenericMaterializedContainer=U3;var dxe=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,xK.once)(async e=>await e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};hg.MaterializedChatMessageTextChunk=dxe;var QP=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=sEn(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return m7t(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return g7t(e,this)}_tokenCount=(0,xK.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,RA.toMode)(e.mode,r))});_upperBound=(0,xK.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,xK.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===RA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===RA.Raw.ChatCompletionContentPartKind.Image||n.type===RA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,RA.toMode)(e.mode,r))});_text=(0,xK.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of nEn(this)){if(r instanceof wK||r instanceof RK||r instanceof cq){e.push(r);continue}if(r instanceof UP){e.at(-1)instanceof UP?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(_))){h[m]={pattern:y,captures:_};let v=this.setProperties[y];v&&(h[m].setProperties=v);let b=this.assertedProperties[y];b&&(h[m].assertedProperties=b);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[_],b=this.setProperties[y];b&&(v.setProperties=b);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 jdn=I((rRu,qdn)=>{"use strict";p();var NLo=require("path"),MLo=NLo.join(__dirname,"compiled",process.platform,process.arch,"keytar.node");qdn.exports=require(MLo)});var tpn={};ki(tpn,{TextDocument:()=>S3});function _6t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);_6t(n,e),_6t(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 p3o(t){let e=epn(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var oWe,S3,v6t=ve(()=>{"use strict";p();oWe=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=epn(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=Zfn(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&&Xfn(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 oWe(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof oWe)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=_6t(s.map(p3o),(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})(S3||(S3={}));a(_6t,"mergeSort");a(Zfn,"computeLineOffsets");a(Xfn,"isEOL");a(epn,"getWellformedRange");a(p3o,"getWellformedEdit")});var mWe=I(Vh=>{"use strict";p();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.thenable=Vh.typedArray=Vh.stringArray=Vh.array=Vh.func=Vh.error=Vh.number=Vh.string=Vh.boolean=void 0;function y3o(t){return t===!0||t===!1}a(y3o,"boolean");Vh.boolean=y3o;function dhn(t){return typeof t=="string"||t instanceof String}a(dhn,"string");Vh.string=dhn;function E3o(t){return typeof t=="number"||t instanceof Number}a(E3o,"number");Vh.number=E3o;function _3o(t){return t instanceof Error}a(_3o,"error");Vh.error=_3o;function fhn(t){return typeof t=="function"}a(fhn,"func");Vh.func=fhn;function phn(t){return Array.isArray(t)}a(phn,"array");Vh.array=phn;function v3o(t){return phn(t)&&t.every(e=>dhn(e))}a(v3o,"stringArray");Vh.stringArray=v3o;function C3o(t,e){return Array.isArray(t)&&t.every(e)}a(C3o,"typedArray");Vh.typedArray=C3o;function b3o(t){return t&&fhn(t.then)}a(b3o,"thenable");Vh.thenable=b3o});var U6t=I(Ux=>{"use strict";p();Object.defineProperty(Ux,"__esModule",{value:!0});Ux.generateUuid=Ux.parse=Ux.isUUID=Ux.v4=Ux.empty=void 0;var SIe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},TIe=class t extends SIe{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(""))}};TIe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];TIe._timeHighBits=["8","9","a","b"];Ux.empty=new SIe("00000000-0000-0000-0000-000000000000");function hhn(){return new TIe}a(hhn,"v4");Ux.v4=hhn;var S3o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function mhn(t){return S3o.test(t)}a(mhn,"isUUID");Ux.isUUID=mhn;function T3o(t){if(!mhn(t))throw new Error("invalid uuid");return new SIe(t)}a(T3o,"parse");Ux.parse=T3o;function I3o(){return hhn().asHex()}a(I3o,"generateUuid");Ux.generateUuid=I3o});var ghn=I(NQ=>{"use strict";p();Object.defineProperty(NQ,"__esModule",{value:!0});NQ.attachPartialResult=NQ.ProgressFeature=NQ.attachWorkDone=void 0;var DQ=ti(),x3o=U6t(),VY=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(DQ.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(DQ.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(DQ.WorkDoneProgress.type,this._token,{kind:"end"})}};VY.Instances=new Map;var gWe=class extends VY{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new DQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},IIe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},AWe=class extends IIe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new DQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function w3o(t,e){if(e===void 0||e.workDoneToken===void 0)return new IIe;let r=e.workDoneToken;return delete e.workDoneToken,new VY(t,r)}a(w3o,"attachWorkDone");NQ.attachWorkDone=w3o;var R3o=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(DQ.WorkDoneProgressCancelNotification.type,r=>{let n=VY.Instances.get(r.token);(n instanceof gWe||n instanceof AWe)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new IIe:new VY(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,x3o.generateUuid)();return this.connection.sendRequest(DQ.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new gWe(this.connection,e))}else return Promise.resolve(new AWe)}},"ProgressFeature");NQ.ProgressFeature=R3o;var Q6t;(function(t){t.type=new DQ.ProgressType})(Q6t||(Q6t={}));var q6t=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(Q6t.type,this._token,e)}};function k3o(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new q6t(t,r)}a(k3o,"attachPartialResult");NQ.attachPartialResult=k3o});var Ahn=I(yWe=>{"use strict";p();Object.defineProperty(yWe,"__esModule",{value:!0});yWe.ConfigurationFeature=void 0;var P3o=ti(),D3o=mWe(),N3o=a(t=>class extends t{getConfiguration(e){return e?D3o.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(P3o.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");yWe.ConfigurationFeature=N3o});var yhn=I(_We=>{"use strict";p();Object.defineProperty(_We,"__esModule",{value:!0});_We.WorkspaceFoldersFeature=void 0;var EWe=ti(),M3o=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 EWe.Emitter,this.connection.onNotification(EWe.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(EWe.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(EWe.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");_We.WorkspaceFoldersFeature=M3o});var Ehn=I(vWe=>{"use strict";p();Object.defineProperty(vWe,"__esModule",{value:!0});vWe.CallHierarchyFeature=void 0;var j6t=ti(),O3o=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(j6t.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=j6t.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=j6t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");vWe.CallHierarchyFeature=O3o});var G6t=I(MQ=>{"use strict";p();Object.defineProperty(MQ,"__esModule",{value:!0});MQ.SemanticTokensBuilder=MQ.SemanticTokensDiff=MQ.SemanticTokensFeature=void 0;var CWe=ti(),L3o=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(CWe.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=CWe.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=CWe.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=CWe.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");MQ.SemanticTokensFeature=L3o;var bWe=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 bWe(this._prevData,this._data).computeDiff()}:this.build()}};MQ.SemanticTokensBuilder=H6t});var _hn=I(SWe=>{"use strict";p();Object.defineProperty(SWe,"__esModule",{value:!0});SWe.ShowDocumentFeature=void 0;var B3o=ti(),F3o=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(B3o.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");SWe.ShowDocumentFeature=F3o});var vhn=I(TWe=>{"use strict";p();Object.defineProperty(TWe,"__esModule",{value:!0});TWe.FileOperationsFeature=void 0;var Tle=ti(),U3o=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Tle.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Tle.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Tle.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Tle.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Tle.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Tle.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");TWe.FileOperationsFeature=U3o});var Chn=I(IWe=>{"use strict";p();Object.defineProperty(IWe,"__esModule",{value:!0});IWe.LinkedEditingRangeFeature=void 0;var Q3o=ti(),q3o=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(Q3o.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");IWe.LinkedEditingRangeFeature=q3o});var bhn=I(xWe=>{"use strict";p();Object.defineProperty(xWe,"__esModule",{value:!0});xWe.TypeHierarchyFeature=void 0;var $6t=ti(),j3o=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest($6t.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=$6t.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=$6t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");xWe.TypeHierarchyFeature=j3o});var Thn=I(wWe=>{"use strict";p();Object.defineProperty(wWe,"__esModule",{value:!0});wWe.InlineValueFeature=void 0;var Shn=ti(),H3o=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(Shn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(Shn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");wWe.InlineValueFeature=H3o});var xhn=I(RWe=>{"use strict";p();Object.defineProperty(RWe,"__esModule",{value:!0});RWe.FoldingRangeFeature=void 0;var Ihn=ti(),G3o=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(Ihn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=Ihn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");RWe.FoldingRangeFeature=G3o});var whn=I(kWe=>{"use strict";p();Object.defineProperty(kWe,"__esModule",{value:!0});kWe.InlayHintFeature=void 0;var V6t=ti(),$3o=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest(V6t.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(V6t.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest(V6t.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");kWe.InlayHintFeature=$3o});var Rhn=I(PWe=>{"use strict";p();Object.defineProperty(PWe,"__esModule",{value:!0});PWe.DiagnosticFeature=void 0;var xIe=ti(),V3o=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(xIe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(xIe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(xIe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(xIe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(xIe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");PWe.DiagnosticFeature=V3o});var z6t=I(DWe=>{"use strict";p();Object.defineProperty(DWe,"__esModule",{value:!0});DWe.TextDocuments=void 0;var WY=ti(),W6t=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new WY.Emitter,this._onDidOpen=new WY.Emitter,this._onDidClose=new WY.Emitter,this._onDidSave=new WY.Emitter,this._onWillSave=new WY.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=WY.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}))})),WY.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};DWe.TextDocuments=W6t});var K6t=I(Ile=>{"use strict";p();Object.defineProperty(Ile,"__esModule",{value:!0});Ile.NotebookDocuments=Ile.NotebookSyncFeature=void 0;var Qx=ti(),khn=z6t(),W3o=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(Qx.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(Qx.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(Qx.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(Qx.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");Ile.NotebookSyncFeature=W3o;var NWe=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,Qx.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Qx.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Qx.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}};NWe.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var Y6t=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof khn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new khn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Qx.Emitter,this._onDidChange=new Qx.Emitter,this._onDidSave=new Qx.Emitter,this._onDidClose=new Qx.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 NWe,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 _=u.cells;if(_.structure!==void 0){let v=_.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),_.structure.didOpen!==void 0)for(let b of _.structure.didOpen)r.openTextDocument({textDocument:b}),d.push(b.uri);if(_.structure.didClose)for(let b of _.structure.didClose)r.closeTextDocument({textDocument:b}),f.push(b.uri)}if(_.data!==void 0){let v=new Map(_.data.map(b=>[b.document,b]));for(let b=0;b<=s.cells.length;b++){let T=v.get(s.cells[b].document);if(T!==void 0){let w=s.cells.splice(b,1,T);if(h.push({old:w[0],new:T}),v.delete(T.document),v.size===0)break}}}if(_.textContent!==void 0)for(let v of _.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 _ of d)A.push(this.getNotebookCell(_));let y=[];for(let _ of f)y.push(this.getNotebookCell(_));let E=[];for(let _ of m)E.push(this.getNotebookCell(_));(A.length>0||y.length>0||h.length>0||E.length>0)&&(g.cells={added:A,removed:y,changed:{data:h,textContent:E}}),(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)}})),Qx.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Ile.NotebookDocuments=Y6t});var Phn=I(MWe=>{"use strict";p();Object.defineProperty(MWe,"__esModule",{value:!0});MWe.MonikerFeature=void 0;var z3o=ti(),Y3o=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=z3o.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");MWe.MonikerFeature=Y3o});var r9t=I(gc=>{"use strict";p();Object.defineProperty(gc,"__esModule",{value:!0});gc.createConnection=gc.combineFeatures=gc.combineNotebooksFeatures=gc.combineLanguagesFeatures=gc.combineWorkspaceFeatures=gc.combineWindowFeatures=gc.combineClientFeatures=gc.combineTracerFeatures=gc.combineTelemetryFeatures=gc.combineConsoleFeatures=gc._NotebooksImpl=gc._LanguagesImpl=gc.BulkUnregistration=gc.BulkRegistration=gc.ErrorMessageTracker=void 0;var Kr=ti(),qx=mWe(),Z6t=U6t(),Io=ghn(),K3o=Ahn(),J3o=yhn(),Z3o=Ehn(),X3o=G6t(),eFo=_hn(),tFo=vhn(),rFo=Chn(),nFo=bhn(),iFo=Thn(),oFo=xhn(),sFo=whn(),aFo=Rhn(),cFo=K6t(),lFo=Phn();function J6t(t){if(t!==null)return t}a(J6t,"null2Undefined");var X6t=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)})}};gc.ErrorMessageTracker=X6t;var OWe=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(Kr.MessageType.Error,e)}warn(e){this.send(Kr.MessageType.Warning,e)}info(e){this.send(Kr.MessageType.Info,e)}log(e){this.send(Kr.MessageType.Log,e)}debug(e){this.send(Kr.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Kr.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Kr.RAL)().console.error("Sending log message failed")})}},e9t=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:Kr.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(J6t)}showWarningMessage(e,...r){let n={type:Kr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(J6t)}showInformationMessage(e,...r){let n={type:Kr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(J6t)}},Dhn=(0,eFo.ShowDocumentFeature)((0,Io.ProgressFeature)(e9t)),Nhn;(function(t){function e(){return new LWe}a(e,"create"),t.create=e})(Nhn||(gc.BulkRegistration=Nhn={}));var LWe=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=qx.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=Z6t.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Mhn;(function(t){function e(){return new wIe(void 0,[])}a(e,"create"),t.create=e})(Mhn||(gc.BulkUnregistration=Mhn={}));var wIe=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(Kr.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=qx.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(Kr.UnregistrationRequest.type,o).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},BWe=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 LWe?this.registerMany(e):e instanceof wIe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=qx.string(r)?r:r.method,s=Z6t.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Kr.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=qx.string(e)?e:e.method,o=Z6t.generateUuid(),s={registrations:[{id:o,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Kr.RegistrationRequest.type,s).then(c=>Kr.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(Kr.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(Kr.RegistrationRequest.type,r).then(()=>new wIe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},t9t=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(Kr.ApplyWorkspaceEditRequest.type,n)}},Ohn=(0,tFo.FileOperationsFeature)((0,J3o.WorkspaceFoldersFeature)((0,K3o.ConfigurationFeature)(t9t))),FWe=class{static{a(this,"TracerImpl")}constructor(){this._trace=Kr.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!==Kr.Trace.Off&&this.connection.sendNotification(Kr.LogTraceNotification.type,{message:e,verbose:this._trace===Kr.Trace.Verbose?r:void 0}).catch(()=>{})}},UWe=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(Kr.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},QWe=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,Io.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,Io.attachPartialResult)(this.connection,r)}};gc._LanguagesImpl=QWe;var Lhn=(0,oFo.FoldingRangeFeature)((0,lFo.MonikerFeature)((0,aFo.DiagnosticFeature)((0,sFo.InlayHintFeature)((0,iFo.InlineValueFeature)((0,nFo.TypeHierarchyFeature)((0,rFo.LinkedEditingRangeFeature)((0,X3o.SemanticTokensFeature)((0,Z3o.CallHierarchyFeature)(QWe))))))))),qWe=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,Io.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,Io.attachPartialResult)(this.connection,r)}};gc._NotebooksImpl=qWe;var Bhn=(0,cFo.NotebookSyncFeature)(qWe);function Fhn(t,e){return function(r){return e(t(r))}}a(Fhn,"combineConsoleFeatures");gc.combineConsoleFeatures=Fhn;function Uhn(t,e){return function(r){return e(t(r))}}a(Uhn,"combineTelemetryFeatures");gc.combineTelemetryFeatures=Uhn;function Qhn(t,e){return function(r){return e(t(r))}}a(Qhn,"combineTracerFeatures");gc.combineTracerFeatures=Qhn;function qhn(t,e){return function(r){return e(t(r))}}a(qhn,"combineClientFeatures");gc.combineClientFeatures=qhn;function jhn(t,e){return function(r){return e(t(r))}}a(jhn,"combineWindowFeatures");gc.combineWindowFeatures=jhn;function Hhn(t,e){return function(r){return e(t(r))}}a(Hhn,"combineWorkspaceFeatures");gc.combineWorkspaceFeatures=Hhn;function Ghn(t,e){return function(r){return e(t(r))}}a(Ghn,"combineLanguagesFeatures");gc.combineLanguagesFeatures=Ghn;function $hn(t,e){return function(r){return e(t(r))}}a($hn,"combineNotebooksFeatures");gc.combineNotebooksFeatures=$hn;function uFo(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,Fhn),tracer:r(t.tracer,e.tracer,Qhn),telemetry:r(t.telemetry,e.telemetry,Uhn),client:r(t.client,e.client,qhn),window:r(t.window,e.window,jhn),workspace:r(t.workspace,e.workspace,Hhn),languages:r(t.languages,e.languages,Ghn),notebooks:r(t.notebooks,e.notebooks,$hn)}}a(uFo,"combineFeatures");gc.combineFeatures=uFo;function dFo(t,e,r){let n=r&&r.console?new(r.console(OWe)):new OWe,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(FWe)):new FWe,c=r&&r.telemetry?new(r.telemetry(UWe)):new UWe,l=r&&r.client?new(r.client(BWe)):new BWe,u=r&&r.window?new(r.window(Dhn)):new Dhn,d=r&&r.workspace?new(r.workspace(Ohn)):new Ohn,f=r&&r.languages?new(r.languages(Lhn)):new Lhn,h=r&&r.notebooks?new(r.notebooks(Bhn)):new Bhn,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:qx.thenable(v)?new Promise((b,T)=>{v.then(w=>b(w),w=>T(w))}):Promise.resolve(v)}a(g,"asPromise");let A,y,E,_={listen:a(()=>o.listen(),"listen"),sendRequest:a((v,...b)=>o.sendRequest(qx.string(v)?v:v.method,...b),"sendRequest"),onRequest:a((v,b)=>o.onRequest(v,b),"onRequest"),sendNotification:a((v,b)=>{let T=qx.string(v)?v:v.method;return o.sendNotification(T,b)},"sendNotification"),onNotification:a((v,b)=>o.onNotification(v,b),"onNotification"),onProgress:o.onProgress,sendProgress:o.sendProgress,onInitialize:a(v=>(y=v,{dispose:a(()=>{y=void 0},"dispose")}),"onInitialize"),onInitialized:a(v=>o.onNotification(Kr.InitializedNotification.type,v),"onInitialized"),onShutdown:a(v=>(A=v,{dispose:a(()=>{A=void 0},"dispose")}),"onShutdown"),onExit:a(v=>(E=v,{dispose:a(()=>{E=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(Kr.DidChangeConfigurationNotification.type,v),"onDidChangeConfiguration"),onDidChangeWatchedFiles:a(v=>o.onNotification(Kr.DidChangeWatchedFilesNotification.type,v),"onDidChangeWatchedFiles"),__textDocumentSync:void 0,onDidOpenTextDocument:a(v=>o.onNotification(Kr.DidOpenTextDocumentNotification.type,v),"onDidOpenTextDocument"),onDidChangeTextDocument:a(v=>o.onNotification(Kr.DidChangeTextDocumentNotification.type,v),"onDidChangeTextDocument"),onDidCloseTextDocument:a(v=>o.onNotification(Kr.DidCloseTextDocumentNotification.type,v),"onDidCloseTextDocument"),onWillSaveTextDocument:a(v=>o.onNotification(Kr.WillSaveTextDocumentNotification.type,v),"onWillSaveTextDocument"),onWillSaveTextDocumentWaitUntil:a(v=>o.onRequest(Kr.WillSaveTextDocumentWaitUntilRequest.type,v),"onWillSaveTextDocumentWaitUntil"),onDidSaveTextDocument:a(v=>o.onNotification(Kr.DidSaveTextDocumentNotification.type,v),"onDidSaveTextDocument"),sendDiagnostics:a(v=>o.sendNotification(Kr.PublishDiagnosticsNotification.type,v),"sendDiagnostics"),onHover:a(v=>o.onRequest(Kr.HoverRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Kr.CompletionRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onCompletion"),onCompletionResolve:a(v=>o.onRequest(Kr.CompletionResolveRequest.type,v),"onCompletionResolve"),onSignatureHelp:a(v=>o.onRequest(Kr.SignatureHelpRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Kr.DeclarationRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Kr.DefinitionRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Kr.TypeDefinitionRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Kr.ImplementationRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onImplementation"),onReferences:a(v=>o.onRequest(Kr.ReferencesRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Kr.DocumentHighlightRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Kr.DocumentSymbolRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Kr.WorkspaceSymbolRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onWorkspaceSymbol"),onWorkspaceSymbolResolve:a(v=>o.onRequest(Kr.WorkspaceSymbolResolveRequest.type,v),"onWorkspaceSymbolResolve"),onCodeAction:a(v=>o.onRequest(Kr.CodeActionRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onCodeAction"),onCodeActionResolve:a(v=>o.onRequest(Kr.CodeActionResolveRequest.type,(b,T)=>v(b,T)),"onCodeActionResolve"),onCodeLens:a(v=>o.onRequest(Kr.CodeLensRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onCodeLens"),onCodeLensResolve:a(v=>o.onRequest(Kr.CodeLensResolveRequest.type,(b,T)=>v(b,T)),"onCodeLensResolve"),onDocumentFormatting:a(v=>o.onRequest(Kr.DocumentFormattingRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Kr.DocumentRangeFormattingRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),void 0)),"onDocumentRangeFormatting"),onDocumentOnTypeFormatting:a(v=>o.onRequest(Kr.DocumentOnTypeFormattingRequest.type,(b,T)=>v(b,T)),"onDocumentOnTypeFormatting"),onRenameRequest:a(v=>o.onRequest(Kr.RenameRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),void 0)),"onRenameRequest"),onPrepareRename:a(v=>o.onRequest(Kr.PrepareRenameRequest.type,(b,T)=>v(b,T)),"onPrepareRename"),onDocumentLinks:a(v=>o.onRequest(Kr.DocumentLinkRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onDocumentLinks"),onDocumentLinkResolve:a(v=>o.onRequest(Kr.DocumentLinkResolveRequest.type,(b,T)=>v(b,T)),"onDocumentLinkResolve"),onDocumentColor:a(v=>o.onRequest(Kr.DocumentColorRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Kr.ColorPresentationRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Kr.FoldingRangeRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Kr.SelectionRangeRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Kr.ExecuteCommandRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),void 0)),"onExecuteCommand"),dispose:a(()=>o.dispose(),"dispose")};for(let v of m)v.attach(_);return o.onRequest(Kr.InitializeRequest.type,v=>{e.initialize(v),qx.string(v.trace)&&(s.trace=Kr.Trace.fromString(v.trace));for(let b of m)b.initialize(v.capabilities);if(y){let b=y(v,new Kr.CancellationTokenSource().token,(0,Io.attachWorkDone)(o,v),void 0);return g(b).then(T=>{if(T instanceof Kr.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=qx.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None:!qx.number(R.textDocumentSync)&&!qx.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=qx.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None);for(let x of m)x.fillServerCapabilities(R);return w})}else{let b={capabilities:{textDocumentSync:Kr.TextDocumentSyncKind.None}};for(let T of m)T.fillServerCapabilities(b.capabilities);return b}}),o.onRequest(Kr.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Kr.CancellationTokenSource().token)}),o.onNotification(Kr.ExitNotification.type,()=>{try{E&&E()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),o.onNotification(Kr.SetTraceNotification.type,v=>{s.trace=Kr.Trace.fromString(v.value)}),_}a(dFo,"createConnection");gc.createConnection=dFo});var Vhn=I(NC=>{"use strict";p();Object.defineProperty(NC,"__esModule",{value:!0});NC.resolveModulePath=NC.FileSystem=NC.resolveGlobalYarnPath=NC.resolveGlobalNodePath=NC.resolve=NC.uriToFilePath=void 0;var fFo=require("url"),PP=require("path"),n9t=require("fs"),a9t=require("child_process");function pFo(t){let e=fFo.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 PP.normalize(r.join("/"))}a(pFo,"uriToFilePath");NC.uriToFilePath=pFo;function i9t(){return process.platform==="win32"}a(i9t,"isWindows");function jWe(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&&n9t.existsSync(e)&&(d[o]?d[o]=e+PP.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,a9t.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(jWe,"resolve");NC.resolve=jWe;function o9t(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};i9t()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,a9t.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?i9t()?PP.join(c,"node_modules"):PP.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(o9t,"resolveGlobalNodePath");NC.resolveGlobalNodePath=o9t;function hFo(t){let e="yarn",r={encoding:"utf8"};i9t()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,a9t.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 PP.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(hFo,"resolveGlobalYarnPath");NC.resolveGlobalYarnPath=hFo;var s9t;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!n9t.existsSync(__filename.toUpperCase())||!n9t.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?PP.normalize(s).indexOf(PP.normalize(o))===0:PP.normalize(s).toLowerCase().indexOf(PP.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(s9t||(NC.FileSystem=s9t={}));function mFo(t,e,r,n){return r?(PP.isAbsolute(r)||(r=PP.join(t,r)),jWe(e,r,r,n).then(o=>s9t.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>jWe(e,o9t(n),t,n))):jWe(e,o9t(n),t,n)}a(mFo,"resolveModulePath");NC.resolveModulePath=mFo});var c9t=I((sLu,Whn)=>{"use strict";p();Whn.exports=ti()});var zhn=I(HWe=>{"use strict";p();Object.defineProperty(HWe,"__esModule",{value:!0});HWe.InlineCompletionFeature=void 0;var gFo=ti(),AFo=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(gFo.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");HWe.InlineCompletionFeature=AFo});var Jhn=I(oE=>{"use strict";p();var yFo=oE&&oE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Khn=oE&&oE.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yFo(e,t,r)};Object.defineProperty(oE,"__esModule",{value:!0});oE.ProposedFeatures=oE.NotebookDocuments=oE.TextDocuments=oE.SemanticTokensBuilder=void 0;var EFo=G6t();Object.defineProperty(oE,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return EFo.SemanticTokensBuilder},"get")});var _Fo=zhn();Khn(ti(),oE);var vFo=z6t();Object.defineProperty(oE,"TextDocuments",{enumerable:!0,get:a(function(){return vFo.TextDocuments},"get")});var CFo=K6t();Object.defineProperty(oE,"NotebookDocuments",{enumerable:!0,get:a(function(){return CFo.NotebookDocuments},"get")});Khn(r9t(),oE);var Yhn;(function(t){t.all={__brand:"features",languages:_Fo.InlineCompletionFeature}})(Yhn||(oE.ProposedFeatures=Yhn={}))});var Xc=I(jx=>{"use strict";p();var bFo=jx&&jx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tmn=jx&&jx.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bFo(e,t,r)};Object.defineProperty(jx,"__esModule",{value:!0});jx.createConnection=jx.Files=void 0;var Zhn=require("node:util"),l9t=mWe(),SFo=r9t(),RIe=Vhn(),zY=c9t();tmn(c9t(),jx);tmn(Jhn(),jx);var Xhn;(function(t){t.uriToFilePath=RIe.uriToFilePath,t.resolveGlobalNodePath=RIe.resolveGlobalNodePath,t.resolveGlobalYarnPath=RIe.resolveGlobalYarnPath,t.resolve=RIe.resolve,t.resolveModulePath=RIe.resolveModulePath})(Xhn||(jx.Files=Xhn={}));var emn;function GWe(){if(emn!==void 0)try{emn.end()}catch{}}a(GWe,"endProtocolConnection");var xle=!1,rmn;function TFo(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(rmn=setInterval(()=>{try{process.kill(n,0)}catch{GWe(),process.exit(xle?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;l9t.number(e)&&rmn===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(xle?0:1)}},3e3)},"initialize"),get shutdownReceived(){return xle},set shutdownReceived(t){xle=t},exit:a(t=>{GWe(),process.exit(t)},"exit")};function xFo(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),zY.ConnectionStrategy.is(t)||zY.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),wFo(s,c,l,o)}a(xFo,"createConnection");jx.createConnection=xFo;function wFo(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{GWe(),process.exit(xle?0:1)}),u.on("close",()=>{GWe(),process.exit(xle?0:1)})}let l=a(u=>{let d=(0,zY.createProtocolConnection)(t,e,u,r);return o&&RFo(u),d},"connectionFactory");return(0,SFo.createConnection)(l,IFo,n)}a(wFo,"_createConnection");function RFo(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,Zhn.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,Zhn.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(RFo,"patchConsole")});var DP=I((yLu,nmn)=>{"use strict";p();nmn.exports=Xc()});var Omn=I((l3u,Mmn)=>{"use strict";p();Mmn.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 N0n=I(s0=>{"use strict";p();var $9t=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),k8o=$9t(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,E=parseInt("100",8),_=parseInt("010",8),v=parseInt("001",8),b=E|_;return!!(g&v||g&_&&m.has(y)||g&E&&A===d||g&b&&d===0)},"A")}),P8o=$9t(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")}),D8o=$9t(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),w0n=s0&&s0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N8o=s0&&s0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),R0n=s0&&s0.__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:L8o,sync:B8o}=N0n(),{join:F8o,delimiter:U8o,sep:M0n,posix:O0n}=require("path"),L0n=process.platform==="win32",B0n=new RegExp(`[${O0n.sep}${M0n===O0n.sep?"":M0n}]`.replace(/(\\)/g,"\\$1")),Q8o=new RegExp(`^\\.${B0n.source}`),F0n=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),U0n=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=U8o})=>{let o=t.match(B0n)?[""]:[...L0n?[process.cwd()]:[],...(e||"").split(n)];if(L0n){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"),Q0n=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&Q8o.test(e)?e.slice(0,2):"")+F8o(r,e)},"getPathPart"),q0n=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=U0n(t,e),s=[];for(let c of r){let l=Q0n(c,t);for(let u of n){let d=l+u;if(await L8o(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 F0n(t)},"which"),q8o=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=U0n(t,e),s=[];for(let c of r){let l=Q0n(c,t);for(let u of n){let d=l+u;if(B8o(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 F0n(t)},"whichSync");j0n.exports=q0n;q0n.sync=q8o});var $Ie=I(($7u,nAn)=>{"use strict";p();var Xgn="[^\\\\/]",S9o="(?=.)",eAn="[^/]",uUt="(?:\\/|$)",tAn="(?:^|\\/)",dUt=`\\.{1,2}${uUt}`,T9o="(?!\\.)",I9o=`(?!${tAn}${dUt})`,x9o=`(?!\\.{0,1}${uUt})`,w9o=`(?!${dUt})`,R9o="[^.\\/]",k9o=`${eAn}*?`,P9o="/",rAn={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:S9o,QMARK:eAn,END_ANCHOR:uUt,DOTS_SLASH:dUt,NO_DOT:T9o,NO_DOTS:I9o,NO_DOT_SLASH:x9o,NO_DOTS_SLASH:w9o,QMARK_NO_DOT:R9o,STAR:k9o,START_ANCHOR:tAn,SEP:P9o},D9o={...rAn,SLASH_LITERAL:"[\\\\/]",QMARK:Xgn,STAR:`${Xgn}*?`,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:"\\"},N9o={__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"};nAn.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:N9o,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?D9o:rAn}}});var VIe=I(BC=>{"use strict";p();var{REGEX_BACKSLASH:M9o,REGEX_REMOVE_BACKSLASH:O9o,REGEX_SPECIAL_CHARS:L9o,REGEX_SPECIAL_CHARS_GLOBAL:B9o}=$Ie();BC.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);BC.hasRegexChars=t=>L9o.test(t);BC.isRegexChar=t=>t.length===1&&BC.hasRegexChars(t);BC.escapeRegex=t=>t.replace(B9o,"\\$1");BC.toPosixSlashes=t=>t.replace(M9o,"/");BC.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};BC.removeBackslashes=t=>t.replace(O9o,e=>e==="\\"?"":e);BC.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?BC.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};BC.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};BC.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};BC.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var dAn=I((Y7u,uAn)=>{"use strict";p();var iAn=VIe(),{CHAR_ASTERISK:fUt,CHAR_AT:F9o,CHAR_BACKWARD_SLASH:WIe,CHAR_COMMA:U9o,CHAR_DOT:pUt,CHAR_EXCLAMATION_MARK:hUt,CHAR_FORWARD_SLASH:lAn,CHAR_LEFT_CURLY_BRACE:mUt,CHAR_LEFT_PARENTHESES:gUt,CHAR_LEFT_SQUARE_BRACKET:Q9o,CHAR_PLUS:q9o,CHAR_QUESTION_MARK:oAn,CHAR_RIGHT_CURLY_BRACE:j9o,CHAR_RIGHT_PARENTHESES:sAn,CHAR_RIGHT_SQUARE_BRACKET:H9o}=$Ie(),aAn=a(t=>t===lAn||t===WIe,"isPathSeparator"),cAn=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),G9o=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,E=!1,_=!1,v=!1,b=!1,T=!1,w=!1,R=0,x,P,D={value:"",depth:0,isGlob:!1},N=a(()=>d>=n,"eos"),L=a(()=>u.charCodeAt(d+1),"peek"),B=a(()=>(x=P,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),O=u.slice(h)):A===!0?(q="",O=u):q=u,q&&q!==""&&q!=="/"&&q!==u&&aAn(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),r.unescape===!0&&(O&&(O=iAn.removeBackslashes(O)),q&&v===!0&&(q=iAn.removeBackslashes(q)));let j={prefix:M,input:t,start:f,base:q,glob:O,isBrace:m,isBracket:g,isGlob:A,isExtglob:y,isGlobstar:E,negated:b,negatedExtglob:T};if(r.tokens===!0&&(j.maxDepth=0,aAn(P)||c.push(D),j.tokens=c),r.parts===!0||r.tokens===!0){let Q;for(let U=0;U{"use strict";p();var zIe=$Ie(),jS=VIe(),{MAX_LENGTH:Mze,POSIX_REGEX_SOURCE:$9o,REGEX_NON_SPECIAL_CHARS:V9o,REGEX_SPECIAL_CHARS_BACKREF:W9o,REPLACEMENTS:fAn}=zIe,z9o=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=>jS.escapeRegex(o)).join("..")}return r},"expandRange"),Qle=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),pAn=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"),Y9o=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"),hAn=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Y9o(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),K9o=a(t=>{let e=t.map(hAn).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"),J9o=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=hAn(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?jS.escapeRegex(r[0]):`[${r.map(o=>jS.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),Z9o=a(t=>{let e=0,r=t.trim(),n=AUt(r);for(;n;)e++,r=n.body.trim(),n=AUt(r);return e},"repeatedExtglobRecursion"),X9o=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:zIe.DEFAULT_MAX_EXTGLOB_RECURSION,n=pAn(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||K9o(n)))return{risky:!0};for(let o of n){let s=J9o(o);if(s)return{risky:!0,safeOutput:s};if(Z9o(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),yUt=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=fAn[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Mze,r.maxLength):Mze,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=zIe.globChars(r.windows),d=zIe.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:m,ONE_CHAR:g,DOTS_SLASH:A,NO_DOT:y,NO_DOT_SLASH:E,NO_DOTS_SLASH:_,QMARK:v,QMARK_NO_DOT:b,STAR:T,START_ANCHOR:w}=u,R=a(ge=>`(${l}(?:(?!${w}${ge.dot?A:f}).)*?)`,"globstar"),x=r.dot?"":y,P=r.dot?v:b,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=jS.removePrefix(t,N),o=t.length;let L=[],B=[],q=[],M=s,O,j=a(()=>N.index===o-1,"eos"),Q=N.peek=(ge=1)=>t[N.index+ge],U=N.advance=()=>t[++N.index]||"",Y=a(()=>t.slice(N.index+1),"remaining"),W=a((ge="",Ue=0)=>{N.consumed+=ge,N.index+=Ue},"consume"),V=a(ge=>{N.output+=ge.output!=null?ge.output:ge.value,W(ge.value)},"append"),z=a(()=>{let ge=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)U(),N.start++,ge++;return ge%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),ie=a(ge=>{N[ge]++,q.push(ge)},"increment"),H=a(ge=>{N[ge]--,q.pop()},"decrement"),re=a(ge=>{if(M.type==="globstar"){let Ue=N.braces>0&&(ge.type==="comma"||ge.type==="brace"),ke=ge.extglob===!0||L.length&&(ge.type==="pipe"||ge.type==="paren");ge.type!=="slash"&&ge.type!=="paren"&&!Ue&&!ke&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(L.length&&ge.type!=="paren"&&(L[L.length-1].inner+=ge.value),(ge.value||ge.output)&&V(ge),M&&M.type==="text"&&ge.type==="text"){M.output=(M.output||M.value)+ge.value,M.value+=ge.value;return}ge.prev=M,c.push(ge),M=ge},"push"),le=a((ge,Ue)=>{let ke={...d[Ue],conditions:1,inner:""};ke.prev=M,ke.parens=N.parens,ke.output=N.output,ke.startIndex=N.index,ke.tokensIndex=c.length;let X=(r.capture?"(":"")+ke.open;ie("parens"),re({type:ge,value:Ue,output:N.output?"":g}),re({type:"paren",extglob:!0,value:U(),output:X}),L.push(ke)},"extglobOpen"),Le=a(ge=>{let Ue=t.slice(ge.startIndex,N.index+1),ke=t.slice(ge.startIndex+2,N.index),X=X9o(ke,r);if((ge.type==="plus"||ge.type==="star")&&X.risky){let he=X.safeOutput?(ge.output?"":g)+(r.capture?`(${X.safeOutput})`:X.safeOutput):void 0,Z=c[ge.tokensIndex];Z.type="text",Z.value=Ue,Z.output=he||jS.escapeRegex(Ue);for(let ue=ge.tokensIndex+1;ue1&&ge.inner.includes("/")&&(he=R(r)),(he!==D||j()||/^\)+$/.test(Y()))&&(ee=ge.close=`)$))${he}`),ge.inner.includes("*")&&(K=Y())&&/^\.[^\\/.]+$/.test(K)){let Z=yUt(K,{...e,fastpaths:!1}).output;ee=ge.close=`)${Z})${he})`}ge.prev.type==="bos"&&(N.negatedExtglob=!0)}re({type:"paren",extglob:!0,value:O,output:ee}),H("parens")},"extglobClose");if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let ge=!1,Ue=t.replace(W9o,(ke,X,ee,K,he,Z)=>K==="\\"?(ge=!0,ke):K==="?"?X?X+K+(he?v.repeat(he.length):""):Z===0?P+(he?v.repeat(he.length):""):v.repeat(ee.length):K==="."?f.repeat(ee.length):K==="*"?X?X+K+(he?D:""):D:X?ke:`\\${ke}`);return ge===!0&&(r.unescape===!0?Ue=Ue.replace(/\\/g,""):Ue=Ue.replace(/\\+/g,ke=>ke.length%2===0?"\\\\":ke?"\\":"")),Ue===t&&r.contains===!0?(N.output=t,N):(N.output=jS.wrapOutput(Ue,N,e),N)}for(;!j();){if(O=U(),O==="\0")continue;if(O==="\\"){let ke=Q();if(ke==="/"&&r.bash!==!0||ke==="."||ke===";")continue;if(!ke){O+="\\",re({type:"text",value:O});continue}let X=/^\\+/.exec(Y()),ee=0;if(X&&X[0].length>2&&(ee=X[0].length,N.index+=ee,ee%2!==0&&(O+="\\")),r.unescape===!0?O=U():O+=U(),N.brackets===0){re({type:"text",value:O});continue}}if(N.brackets>0&&(O!=="]"||M.value==="["||M.value==="[^")){if(r.posix!==!1&&O===":"){let ke=M.value.slice(1);if(ke.includes("[")&&(M.posix=!0,ke.includes(":"))){let X=M.value.lastIndexOf("["),ee=M.value.slice(0,X),K=M.value.slice(X+2),he=$9o[K];if(he){M.value=ee+he,N.backtrack=!0,U(),!s.output&&c.indexOf(M)===1&&(s.output=g);continue}}}(O==="["&&Q()!==":"||O==="-"&&Q()==="]")&&(O=`\\${O}`),O==="]"&&(M.value==="["||M.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&M.value==="["&&(O="^"),M.value+=O,V({value:O});continue}if(N.quotes===1&&O!=='"'){O=jS.escapeRegex(O),M.value+=O,V({value:O});continue}if(O==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:O});continue}if(O==="("){ie("parens"),re({type:"paren",value:O});continue}if(O===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Qle("opening","("));let ke=L[L.length-1];if(ke&&N.parens===ke.parens+1){Le(L.pop());continue}re({type:"paren",value:O,output:N.parens?")":"\\)"}),H("parens");continue}if(O==="["){if(r.nobracket===!0||!Y().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Qle("closing","]"));O=`\\${O}`}else ie("brackets");re({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||M&&M.type==="bracket"&&M.value.length===1){re({type:"text",value:O,output:`\\${O}`});continue}if(N.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Qle("opening","["));re({type:"text",value:O,output:`\\${O}`});continue}H("brackets");let ke=M.value.slice(1);if(M.posix!==!0&&ke[0]==="^"&&!ke.includes("/")&&(O=`/${O}`),M.value+=O,V({value:O}),r.literalBrackets===!1||jS.hasRegexChars(ke))continue;let X=jS.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=X,M.value=X;continue}M.value=`(${l}${X}|${M.value})`,N.output+=M.value;continue}if(O==="{"&&r.nobrace!==!0){ie("braces");let ke={type:"brace",value:O,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};B.push(ke),re(ke);continue}if(O==="}"){let ke=B[B.length-1];if(r.nobrace===!0||!ke){re({type:"text",value:O,output:O});continue}let X=")";if(ke.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);X=z9o(K,r),N.backtrack=!0}if(ke.comma!==!0&&ke.dots!==!0){let ee=N.output.slice(0,ke.outputIndex),K=N.tokens.slice(ke.tokensIndex);ke.value=ke.output="\\{",O=X="\\}",N.output=ee;for(let he of K)N.output+=he.output||he.value}re({type:"brace",value:O,output:X}),H("braces"),B.pop();continue}if(O==="|"){L.length>0&&L[L.length-1].conditions++,re({type:"text",value:O});continue}if(O===","){let ke=O,X=B[B.length-1];X&&q[q.length-1]==="braces"&&(X.comma=!0,ke="|"),re({type:"comma",value:O,output:ke});continue}if(O==="/"){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:O,output:m});continue}if(O==="."){if(N.braces>0&&M.type==="dot"){M.value==="."&&(M.output=f);let ke=B[B.length-1];M.type="dots",M.output+=O,M.value+=O,ke.dots=!0;continue}if(N.braces+N.parens===0&&M.type!=="bos"&&M.type!=="slash"){re({type:"text",value:O,output:f});continue}re({type:"dot",value:O,output:f});continue}if(O==="?"){if(!(M&&M.value==="(")&&r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){le("qmark",O);continue}if(M&&M.type==="paren"){let X=Q(),ee=O;(M.value==="("&&!/[!=<:]/.test(X)||X==="<"&&!/<([!=]|\w+>)/.test(Y()))&&(ee=`\\${O}`),re({type:"text",value:O,output:ee});continue}if(r.dot!==!0&&(M.type==="slash"||M.type==="bos")){re({type:"qmark",value:O,output:b});continue}re({type:"qmark",value:O,output:v});continue}if(O==="!"){if(r.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){le("negate",O);continue}if(r.nonegate!==!0&&N.index===0){z();continue}}if(O==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){le("plus",O);continue}if(M&&M.value==="("||r.regex===!1){re({type:"plus",value:O,output:h});continue}if(M&&(M.type==="bracket"||M.type==="paren"||M.type==="brace")||N.parens>0){re({type:"plus",value:O});continue}re({type:"plus",value:h});continue}if(O==="@"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){re({type:"at",extglob:!0,value:O,output:""});continue}re({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let ke=V9o.exec(Y());ke&&(O+=ke[0],N.index+=ke[0].length),re({type:"text",value:O});continue}if(M&&(M.type==="globstar"||M.star===!0)){M.type="star",M.star=!0,M.value+=O,M.output=D,N.backtrack=!0,N.globstar=!0,W(O);continue}let ge=Y();if(r.noextglob!==!0&&/^\([^?]/.test(ge)){le("star",O);continue}if(M.type==="star"){if(r.noglobstar===!0){W(O);continue}let ke=M.prev,X=ke.prev,ee=ke.type==="slash"||ke.type==="bos",K=X&&(X.type==="star"||X.type==="globstar");if(r.bash===!0&&(!ee||ge[0]&&ge[0]!=="/")){re({type:"star",value:O,output:""});continue}let he=N.braces>0&&(ke.type==="comma"||ke.type==="brace"),Z=L.length&&(ke.type==="pipe"||ke.type==="paren");if(!ee&&ke.type!=="paren"&&!he&&!Z){re({type:"star",value:O,output:""});continue}for(;ge.slice(0,3)==="/**";){let ue=t[N.index+4];if(ue&&ue!=="/")break;ge=ge.slice(3),W("/**",3)}if(ke.type==="bos"&&j()){M.type="globstar",M.value+=O,M.output=R(r),N.output=M.output,N.globstar=!0,W(O);continue}if(ke.type==="slash"&&ke.prev.type!=="bos"&&!K&&j()){N.output=N.output.slice(0,-(ke.output+M.output).length),ke.output=`(?:${ke.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=O,N.globstar=!0,N.output+=ke.output+M.output,W(O);continue}if(ke.type==="slash"&&ke.prev.type!=="bos"&&ge[0]==="/"){let ue=ge[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(ke.output+M.output).length),ke.output=`(?:${ke.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${ue})`,M.value+=O,N.output+=ke.output+M.output,N.globstar=!0,W(O+U()),re({type:"slash",value:"/",output:""});continue}if(ke.type==="bos"&&ge[0]==="/"){M.type="globstar",M.value+=O,M.output=`(?:^|${m}|${R(r)}${m})`,N.output=M.output,N.globstar=!0,W(O+U()),re({type:"slash",value:"/",output:""});continue}N.output=N.output.slice(0,-M.output.length),M.type="globstar",M.output=R(r),M.value+=O,N.output+=M.output,N.globstar=!0,W(O);continue}let Ue={type:"star",value:O,output:D};if(r.bash===!0){Ue.output=".*?",(M.type==="bos"||M.type==="slash")&&(Ue.output=x+Ue.output),re(Ue);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){Ue.output=O,re(Ue);continue}(N.index===N.start||M.type==="slash"||M.type==="dot")&&(M.type==="dot"?(N.output+=E,M.output+=E):r.dot===!0?(N.output+=_,M.output+=_):(N.output+=x,M.output+=x),Q()!=="*"&&(N.output+=g,M.output+=g)),re(Ue)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing","]"));N.output=jS.escapeLast(N.output,"["),H("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing",")"));N.output=jS.escapeLast(N.output,"("),H("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing","}"));N.output=jS.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 ge of N.tokens)N.output+=ge.output!=null?ge.output:ge.value,ge.suffix&&(N.output+=ge.suffix)}return N},"parse");yUt.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Mze,r.maxLength):Mze,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=fAn[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}=zIe.globChars(r.windows),A=r.dot?f:d,y=r.dot?h:d,E=r.capture?"":"?:",_={negated:!1,prefix:""},v=r.bash===!0?".*?":m;r.capture&&(v=`(${v})`);let b=a(x=>x.noglobstar===!0?v:`(${E}(?:(?!${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+b(r);case"**/*":return`(?:${A}${b(r)}${c})?${y}${l}${v}`;case"**/*.*":return`(?:${A}${b(r)}${c})?${y}${v}${s}${l}${v}`;case"**/.*":return`(?:${A}${b(r)}${c})?${s}${l}${v}`;default:{let P=/^(.*?)\.(\w+)$/.exec(x);if(!P)return;let D=T(P[1]);return D?D+s+P[2]:void 0}}},"create"),w=jS.removePrefix(t,_),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};mAn.exports=yUt});var EAn=I((tQu,yAn)=>{"use strict";p();var eUo=dAn(),EUt=gAn(),AAn=VIe(),tUo=$Ie(),rUo=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),Zp=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>Zp(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=rUo(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?Zp.compileRe(t,e):Zp.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=Zp(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=Zp.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");Zp.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?AAn.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=Zp.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};Zp.matchBase=(t,e,r)=>(e instanceof RegExp?e:Zp.makeRe(e,r)).test(AAn.basename(t));Zp.isMatch=(t,e,r)=>Zp(e,r)(t);Zp.parse=(t,e)=>Array.isArray(t)?t.map(r=>Zp.parse(r,e)):EUt(t,{...e,fastpaths:!1});Zp.scan=(t,e)=>eUo(t,e);Zp.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=Zp.toRegex(l,e);return n===!0&&(u.state=t),u};Zp.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=EUt.fastpaths(t,e)),o.output||(o=EUt(t,e)),Zp.compileRe(o,e,r,n)};Zp.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/$^/}};Zp.constants=tUo;yAn.exports=Zp});var bAn=I((iQu,CAn)=>{"use strict";p();var _An=EAn(),nUo=VIe();function vAn(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:nUo.isWindows()}),_An(t,e,r)}a(vAn,"picomatch");Object.assign(vAn,_An);CAn.exports=vAn});var TAn=I((aQu,SAn)=>{p();SAn.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 wAn=I((uQu,xAn)=>{p();var iUo=TAn(),IAn={"{":"}","(":")","[":"]"},oUo=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=IAn[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),sUo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var yK=require("path"),aUo=bAn(),cUo=wAn();function Oze(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(cUo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=aUo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(yK.resolve(t,o))}return e}a(Oze,"normalizeOptions");RAn.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(yK.resolve(e),yK.resolve(r),Oze(e,n))},getEventsSince(e,r,n){return t.getEventsSince(yK.resolve(e),yK.resolve(r),Oze(e,n))},async subscribe(e,r,n){return e=yK.resolve(e),n=Oze(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(yK.resolve(e),r,Oze(e,n))}})});var PAn=I(YIe=>{"use strict";p();var lUo=require("path"),{createWrapper:uUo}=kAn();function dUo(){return lUo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(dUo,"resolveBindingPath");var fUo=require(dUo()),Lze=uUo(fUo);YIe.writeSnapshot=Lze.writeSnapshot;YIe.getEventsSince=Lze.getEventsSince;YIe.subscribe=Lze.subscribe;YIe.unsubscribe=Lze.unsubscribe});var q_=I(jze=>{"use strict";p();Object.defineProperty(jze,"__esModule",{value:!0});jze.Position=void 0;var SUt=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(Hze,"__esModule",{value:!0});Hze.Range=void 0;var BAn=q_(),TUt=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 BAn.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new BAn.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}};Hze.Range=TUt});var Uyn=I(u7t=>{"use strict";p();Object.defineProperty(u7t,"__esModule",{value:!0});u7t.assertNever=g7o;function g7o(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(g7o,"assertNever")});var lxe=I(U3=>{"use strict";p();Object.defineProperty(U3,"__esModule",{value:!0});U3.ChatCompletionContentPartOpaque=U3.ChatCompletionContentPartKind=U3.ChatRole=void 0;var A7o=Uyn(),AYe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(AYe||(U3.ChatRole=AYe={}));(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,A7o.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(AYe||(U3.ChatRole=AYe={}));var Qyn;(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"})(Qyn||(U3.ChatCompletionContentPartKind=Qyn={}));var qyn;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(qyn||(U3.ChatCompletionContentPartOpaque=qyn={}))});var d7t=I(EO=>{"use strict";p();Object.defineProperty(EO,"__esModule",{value:!0});EO.BaseTokensPerName=EO.BaseTokensPerMessage=EO.BaseTokensPerCompletion=EO.ChatRole=void 0;var jyn;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(jyn||(EO.ChatRole=jyn={}));EO.BaseTokensPerCompletion=3;EO.BaseTokensPerMessage=3;EO.BaseTokensPerName=1});var Vyn=I(EYe=>{"use strict";p();Object.defineProperty(EYe,"__esModule",{value:!0});EYe.toOpenAiChatMessage=$yn;EYe.toOpenAIChatMessages=E7o;var _O=lxe(),yYe=d7t(),y7o=aq();function Hyn(t){return t.filter(e=>e.type===_O.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(Hyn,"onlyStringContent");function Gyn(t){let e=t.map(r=>{if(r.type===_O.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===_O.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===_O.ChatCompletionContentPartKind.Document)return;if(r.type===_O.ChatCompletionContentPartKind.Opaque&&_O.ChatCompletionContentPartOpaque.usableIn(r,y7o.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(Gyn,"stringAndImageContent");function $yn(t){switch(t.role){case _O.ChatRole.System:return{role:yYe.ChatRole.System,content:Hyn(t.content),name:t.name};case _O.ChatRole.User:return{role:yYe.ChatRole.User,content:Gyn(t.content),name:t.name};case _O.ChatRole.Assistant:return{role:yYe.ChatRole.Assistant,content:Hyn(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case _O.ChatRole.Tool:return{role:yYe.ChatRole.Tool,content:Gyn(t.content),tool_call_id:t.toolCallId};default:return}}a($yn,"toOpenAiChatMessage");function E7o(t){return t.map($yn).filter(e=>!!e)}a(E7o,"toOpenAIChatMessages")});var zyn=I(CYe=>{"use strict";p();Object.defineProperty(CYe,"__esModule",{value:!0});CYe.toVsCodeChatMessage=Wyn;CYe.toVsCodeChatMessages=_7o;var vYe=lxe();function _Ye(t){return t.filter(e=>e.type===vYe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(_Ye,"onlyStringContent");var cq;function Wyn(t){switch(cq??=require("vscode"),t.role){case vYe.ChatRole.Assistant:let e=cq.LanguageModelChatMessage.Assistant(_Ye(t.content),t.name);return t.toolCalls&&(e.content=[new cq.LanguageModelTextPart(_Ye(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 cq.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case vYe.ChatRole.User:return cq.LanguageModelChatMessage.User(_Ye(t.content),t.name);case vYe.ChatRole.Tool:{let r=cq.LanguageModelChatMessage.User("");return r.content=[new cq.LanguageModelToolResultPart(t.toolCallId,[new cq.LanguageModelTextPart(_Ye(t.content))])],r}default:return}}a(Wyn,"toVsCodeChatMessage");function _7o(t){return t.map(Wyn).filter(e=>!!e)}a(_7o,"toVsCodeChatMessages")});var aq=I(UP=>{"use strict";p();Object.defineProperty(UP,"__esModule",{value:!0});UP.OutputMode=UP.Raw=UP.OpenAI=void 0;UP.toMode=f7t;UP.toVSCode=v7o;UP.toOpenAI=C7o;var Yyn=Vyn(),Kyn=zyn();UP.OpenAI=d7t();UP.Raw=lxe();var IK;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(IK||(UP.OutputMode=IK={}));function f7t(t,e){switch(t){case IK.Raw:return e;case IK.VSCode:return e instanceof Array?(0,Kyn.toVsCodeChatMessages)(e):(0,Kyn.toVsCodeChatMessage)(e);case IK.OpenAI:return e instanceof Array?(0,Yyn.toOpenAIChatMessages)(e):(0,Yyn.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(f7t,"toMode");function v7o(t){return f7t(IK.VSCode,t)}a(v7o,"toVSCode");function C7o(t){return f7t(IK.OpenAI,t)}a(C7o,"toOpenAI")});var p7t=I(uxe=>{"use strict";p();Object.defineProperty(uxe,"__esModule",{value:!0});uxe.jsonRetainedProps=void 0;uxe.forEachNode=Jyn;uxe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function Jyn(t,e){if(e(t),t.type===1)for(let r of t.children)Jyn(r,e)}a(Jyn,"forEachNode")});var Zyn=I(h7t=>{"use strict";p();Object.defineProperty(h7t,"__esModule",{value:!0});h7t.once=b7o;function b7o(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(b7o,"once")});var y7t=I(hg=>{"use strict";p();Object.defineProperty(hg,"__esModule",{value:!0});hg.BudgetExceededError=hg.MaterializedChatMessageDocument=hg.MaterializedChatMessageImage=hg.MaterializedChatMessageBreakpoint=hg.MaterializedChatMessageOpaque=hg.MaterializedChatMessage=hg.MaterializedChatMessageTextChunk=hg.GenericMaterializedContainer=void 0;var xK=Zyn(),RA=aq(),Q3=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=uq(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 aEn(e,this.children,r)}allMetadata(){return sEn(this)}findById(e){return A7t(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)S7o(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof qP&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof qP||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return g7t(this,e),e}};hg.GenericMaterializedContainer=Q3;var dxe=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,xK.once)(async e=>await e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};hg.MaterializedChatMessageTextChunk=dxe;var qP=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=aEn(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return g7t(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return A7t(e,this)}_tokenCount=(0,xK.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,RA.toMode)(e.mode,r))});_upperBound=(0,xK.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,xK.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===RA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===RA.Raw.ChatCompletionContentPartKind.Image||n.type===RA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,RA.toMode)(e.mode,r))});_text=(0,xK.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of iEn(this)){if(r instanceof wK||r instanceof RK||r instanceof lq){e.push(r);continue}if(r instanceof QP){e.at(-1)instanceof QP?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:RA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof wK)return{type:RA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:aEn(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof RK)return{type:RA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof cq)return{type:RA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof UP)return r.part;throw new Error("Unexpected element type")});if(this.role===RA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===RA.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===RA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===RA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};hg.MaterializedChatMessage=QP;var cq=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&&RA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};hg.MaterializedChatMessageOpaque=cq;var UP=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};hg.MaterializedChatMessageBreakpoint=UP;var wK=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,xK.once)(async e=>e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:aEn(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};hg.MaterializedChatMessageImage=wK;var RK=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,xK.once)(async e=>e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};hg.MaterializedChatMessageDocument=RK;function lq(t){return t instanceof U3||t instanceof QP}a(lq,"isContainerType");function rEn(t){return t instanceof dxe||t instanceof wK||t instanceof RK||t instanceof cq||t instanceof UP}a(rEn,"isContentType");function _7o(t){if(!lq(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(_7o,"assertContainerOrChatMessage");function*nEn(t,e=!1){for(let r of t.children)r instanceof dxe?(yield{content:r,isTextSibling:e},e=!0):r instanceof wK||r instanceof RK||r instanceof cq||r instanceof UP?yield{content:r,isTextSibling:!1}:r instanceof cq?yield{content:r,isTextSibling:!0}:(r&&(yield*nEn(r,e)),e=!1)}a(nEn,"contentChunks");function v7o(t,e){let r;function n(o,s){if(rEn(o))(!r||o.priorityn instanceof UP):t instanceof U3&&(r=t.children.some(iEn)),Zyn.set(t,r),r}a(iEn,"hasCachePoint");function C7o(t){if(t instanceof QP)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof QP)return!1;return!0}a(C7o,"shouldLookForCachePointInNode");function m7t(t,e){let r;if(t instanceof U3&&t.has(1)){v7o(t,e);return}let n=C7o(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 QP?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};hg.BudgetExceededError=_Ye;function Xyn(t){if(!lq(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(Xyn,"getLowestPriorityAmongChildren");function*oEn(t){yield*t.metadata;for(let e of t.children)lq(e)?yield*oEn(e):yield*e.metadata}a(oEn,"allMetadata");function sEn(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,lq(r)&&e.push(...r.children)}}a(eEn,"forEachNode");function b7o(t){let e=t;for(;e.parent;)e=e.parent;return e}a(b7o,"getRoot");function tEn(t){return t instanceof U3&&t.keepWithId!==void 0}a(tEn,"isKeepWith");var h7t=new Set;function S7o(t,e){let r=new Set;for(let n of eEn(t))tEn(n)&&!h7t.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)h7t.add(n);try{let n=b7o(t);for(let o of eEn(n))tEn(o)&&r.has(o.keepWithId)?fxe(o,e):o instanceof QP&&o.toolCalls&&(o.toolCalls=T7o(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&&fxe(o,e))}finally{for(let n of r)h7t.delete(n)}}a(S7o,"removeOtherKeepWiths");function g7t(t,e){if(e.id===t)return e;for(let r of e.children)if(lq(r)){let n=g7t(t,r);if(n)return n}}a(g7t,"findNodeById");function fxe(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),S7o(t,e),r.isEmpty?fxe(r,e):r.onChunksChange())}a(fxe,"removeNode");function aEn(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(aEn,"getEncodedBase64");function T7o(t,e){for(let r=0;r{"use strict";p();function I7o(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(I7o,"_vscpp");function cEn(){throw new Error("This should not be invoked!")}a(cEn,"_vscppf");cEn.isFragment=!0;globalThis.vscpp=I7o;globalThis.vscppf=cEn});var E7t=I(vYe=>{"use strict";p();Object.defineProperty(vYe,"__esModule",{value:!0});vYe.PromptElement=void 0;lEn();var y7t=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}};vYe.PromptElement=y7t});var k7t=I(Qs=>{"use strict";p();Object.defineProperty(Qs,"__esModule",{value:!0});Qs.LogicalWrapper=Qs.IfEmpty=Qs.AbstractKeepWith=Qs.TokenLimit=Qs.Expandable=Qs.Chunk=Qs.LegacyPrioritization=Qs.ToolResult=Qs.PrioritizedList=Qs.Document=Qs.Image=Qs.TextChunk=Qs.ToolMessage=Qs.AssistantMessage=Qs.UserMessage=Qs.SystemMessage=Qs.BaseChatMessage=void 0;Qs.isChatMessagePromptElement=x7o;Qs.useKeepWith=P7o;var hxe=Io(),$S=E7t();function x7o(t){return t instanceof CYe||t instanceof bYe||t instanceof SYe}a(x7o,"isChatMessagePromptElement");var kK=class extends $S.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.BaseChatMessage=kK;var CYe=class extends kK{static{a(this,"SystemMessage")}constructor(e){e.role=hxe.Raw.ChatRole.System,super(e)}};Qs.SystemMessage=CYe;var bYe=class extends kK{static{a(this,"UserMessage")}constructor(e){e.role=hxe.Raw.ChatRole.User,super(e)}};Qs.UserMessage=bYe;var SYe=class extends kK{static{a(this,"AssistantMessage")}constructor(e){e.role=hxe.Raw.ChatRole.Assistant,super(e)}};Qs.AssistantMessage=SYe;var w7o=/\s+/g,_7t=class extends kK{static{a(this,"ToolMessage")}constructor(e){e.role=hxe.Raw.ChatRole.Tool,super(e)}};Qs.ToolMessage=_7t;var TYe=class extends $S.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?w7o: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 R7o(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Qs.TextChunk=TYe;async function R7o(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(R7o,"getTextContentBelowBudget");var v7t=class extends $S.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Image=v7t;var C7t=class extends $S.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Document=C7t;var b7t=class extends $S.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(TYe,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Qs.PrioritizedList=b7t;var S7t=class extends $S.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})}))}};Qs.ToolResult=S7t;var T7t=class extends $S.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.LegacyPrioritization=T7t;var I7t=class extends $S.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Chunk=I7t;var x7t=class extends $S.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Qs.Expandable=x7t;var w7t=class extends $S.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.TokenLimit=w7t;var IYe=class extends $S.PromptElement{static{a(this,"AbstractKeepWith")}};Qs.AbstractKeepWith=IYe;var k7o=0;function P7o(){let t=k7o++;return class extends IYe{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(P7o,"useKeepWith");var R7t=class extends $S.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp(pxe,null,this.props.alt),vscpp(pxe,{flexGrow:1},this.props.children))}};Qs.IfEmpty=R7t;var pxe=class extends $S.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.LogicalWrapper=pxe});var dEn=I(mxe=>{"use strict";p();Object.defineProperty(mxe,"__esModule",{value:!0});mxe.localize=D7o;mxe.localize2=N7o;mxe.getConfiguredDefaultLocale=M7o;function uEn(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(uEn,"_format");function D7o(t,e,...r){return uEn(e,r)}a(D7o,"localize");function N7o(t,e,...r){let n=uEn(e,r);return{original:n,value:n}}a(N7o,"localize2");function M7o(t){}a(M7o,"getConfiguredDefaultLocale")});var M7t=I(Sr=>{"use strict";p();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.isAndroid=Sr.isEdge=Sr.isSafari=Sr.isFirefox=Sr.isChrome=Sr.OS=Sr.setTimeout0=Sr.setTimeout0IsFaster=Sr.translationsConfigFile=Sr.platformLocale=Sr.locale=Sr.Language=Sr.language=Sr.userAgent=Sr.platform=Sr.isCI=Sr.isMobile=Sr.isIOS=Sr.webWorkerOrigin=Sr.isWebWorker=Sr.isWeb=Sr.isElectron=Sr.isNative=Sr.isLinuxSnap=Sr.isLinux=Sr.isMacintosh=Sr.isWindows=Sr.LANGUAGE_DEFAULT=void 0;Sr.PlatformToString=L7o;Sr.isLittleEndian=B7o;Sr.isBigSurOrNewer=F7o;var fEn=dEn();Sr.LANGUAGE_DEFAULT="en";var yxe=!1,Exe=!1,Axe=!1,gEn=!1,AEn=!1,D7t=!1,yEn=!1,N7t=!1,EEn=!1,_En=!1,gxe,xYe=Sr.LANGUAGE_DEFAULT,P7t=Sr.LANGUAGE_DEFAULT,vEn,Q3,q3=globalThis,VS;typeof q3.vscode<"u"&&typeof q3.vscode.process<"u"?VS=q3.vscode.process:typeof process<"u"&&(VS=process);var CEn=typeof VS?.versions?.electron=="string",O7o=CEn&&VS?.type==="renderer";if(typeof VS=="object"){yxe=VS.platform==="win32",Exe=VS.platform==="darwin",Axe=VS.platform==="linux",gEn=Axe&&!!VS.env.SNAP&&!!VS.env.SNAP_REVISION,yEn=CEn,EEn=!!VS.env.CI||!!VS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,gxe=Sr.LANGUAGE_DEFAULT,xYe=Sr.LANGUAGE_DEFAULT;let t=VS.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];gxe=e.locale,P7t=e.osLocale,xYe=r||Sr.LANGUAGE_DEFAULT,vEn=e._translationsConfigFile}catch{}AEn=!0}else typeof navigator=="object"&&!O7o?(Q3=navigator.userAgent,yxe=Q3.indexOf("Windows")>=0,Exe=Q3.indexOf("Macintosh")>=0,N7t=(Q3.indexOf("Macintosh")>=0||Q3.indexOf("iPad")>=0||Q3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Axe=Q3.indexOf("Linux")>=0,_En=Q3?.indexOf("Mobi")>=0,D7t=!0,gxe=fEn.getConfiguredDefaultLocale(fEn.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||Sr.LANGUAGE_DEFAULT,xYe=gxe,P7t=navigator.language):console.error("Unable to resolve platform.");function L7o(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(L7o,"PlatformToString");var wYe=0;Exe?wYe=1:yxe?wYe=3:Axe&&(wYe=2);Sr.isWindows=yxe;Sr.isMacintosh=Exe;Sr.isLinux=Axe;Sr.isLinuxSnap=gEn;Sr.isNative=AEn;Sr.isElectron=yEn;Sr.isWeb=D7t;Sr.isWebWorker=D7t&&typeof q3.importScripts=="function";Sr.webWorkerOrigin=Sr.isWebWorker?q3.origin:void 0;Sr.isIOS=N7t;Sr.isMobile=_En;Sr.isCI=EEn;Sr.platform=wYe;Sr.userAgent=Q3;Sr.language=xYe;var pEn;(function(t){function e(){return Sr.language}a(e,"value"),t.value=e;function r(){return Sr.language.length===2?Sr.language==="en":Sr.language.length>=3?Sr.language[0]==="e"&&Sr.language[1]==="n"&&Sr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return Sr.language==="en"}a(n,"isDefault"),t.isDefault=n})(pEn||(Sr.Language=pEn={}));Sr.locale=gxe;Sr.platformLocale=P7t;Sr.translationsConfigFile=vEn;Sr.setTimeout0IsFaster=typeof q3.postMessage=="function"&&!q3.importScripts;Sr.setTimeout0=(()=>{if(Sr.setTimeout0IsFaster){let t=[];q3.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}),q3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();Sr.OS=Exe||N7t?2:yxe?1:3;var hEn=!0,mEn=!1;function B7o(){if(!mEn){mEn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,hEn=new Uint16Array(t.buffer)[0]===513}return hEn}a(B7o,"isLittleEndian");Sr.isChrome=!!(Sr.userAgent&&Sr.userAgent.indexOf("Chrome")>=0);Sr.isFirefox=!!(Sr.userAgent&&Sr.userAgent.indexOf("Firefox")>=0);Sr.isSafari=!!(!Sr.isChrome&&Sr.userAgent&&Sr.userAgent.indexOf("Safari")>=0);Sr.isEdge=!!(Sr.userAgent&&Sr.userAgent.indexOf("Edg/")>=0);Sr.isAndroid=!!(Sr.userAgent&&Sr.userAgent.indexOf("Android")>=0);function F7o(t){return parseFloat(t)>=20}a(F7o,"isBigSurOrNewer")});var SEn=I(vO=>{"use strict";p();Object.defineProperty(vO,"__esModule",{value:!0});vO.arch=vO.platform=vO.env=vO.cwd=void 0;var bEn=M7t(),PK,O7t=globalThis.vscode;if(typeof O7t<"u"&&typeof O7t.process<"u"){let t=O7t.process;PK={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?PK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:PK={get platform(){return bEn.isWindows?"win32":bEn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};vO.cwd=PK.cwd;vO.env=PK.env;vO.platform=PK.platform;vO.arch=PK.arch});var IEn=I(An=>{"use strict";p();Object.defineProperty(An,"__esModule",{value:!0});An.delimiter=An.sep=An.toNamespacedPath=An.parse=An.format=An.extname=An.basename=An.dirname=An.relative=An.resolve=An.join=An.isAbsolute=An.normalize=An.posix=An.win32=void 0;var eue=SEn(),U7o=65,Q7o=97,q7o=90,j7o=122,fq=46,mg=47,FC=92,uq=58,H7o=63,RYe=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 G7o(t,e){if(t===null||typeof t!="object")throw new RYe(e,"Object",t)}a(G7o,"validateObject");function ip(t,e){if(typeof t!="string")throw new RYe(e,"string",t)}a(ip,"validateString");var UC=eue.platform==="win32";function ns(t){return t===mg||t===FC}a(ns,"isPathSeparator");function L7t(t){return t===mg}a(L7t,"isPosixPathSeparator");function dq(t){return t>=U7o&&t<=q7o||t>=Q7o&&t<=j7o}a(dq,"isWindowsDeviceRoot");function kYe(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===fq&&l!==-1?++l:l=-1}return o}a(kYe,"normalizeString");function TEn(t,e){G7o(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(TEn,"_format");An.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],ip(s,"path"),s.length===0)continue}else e.length===0?s=eue.cwd():(s=eue.env[`=${e}`]||eue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===FC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)ns(f)&&(l=1,d=!0);else if(ns(f))if(d=!0,ns(s.charCodeAt(1))){let h=2,m=h;for(;h2&&ns(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=kYe(r,!n,"\\",ns),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){ip(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return L7t(s)?"\\":t;if(ns(s))if(o=!0,ns(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ns(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&ns(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){ip(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return ns(r)||e>2&&dq(r)&&t.charCodeAt(1)===uq&&ns(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"&&ns(r.charCodeAt(0))){++o;let s=r.length;s>1&&ns(r.charCodeAt(1))&&(++o,s>2&&(ns(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return An.win32.normalize(e)},relative(t,e){if(ip(t,"from"),ip(e,"to"),t===e)return"";let r=An.win32.resolve(t),n=An.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===FC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===FC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===FC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===FC?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)===FC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===FC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=An.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===FC){if(e.charCodeAt(1)===FC){let r=e.charCodeAt(2);if(r!==H7o&&r!==fq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(dq(e.charCodeAt(0))&&e.charCodeAt(1)===uq&&e.charCodeAt(2)===FC)return`\\\\?\\${e}`;return t},dirname(t){ip(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return ns(o)?t:".";if(ns(o)){if(r=n=1,ns(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ns(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(ns(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&&ip(e,"ext"),ip(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&dq(t.charCodeAt(0))&&t.charCodeAt(1)===uq&&(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(ns(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(ns(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){ip(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===uq&&dq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(ns(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===fq?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:TEn.bind(null,"\\"),parse(t){ip(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 ns(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(ns(o)){if(n=1,ns(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),ns(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===fq?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 $7o=(()=>{if(UC){let t=/\\/g;return()=>{let e=eue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>eue.cwd()})();An.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:$7o();ip(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===mg)}return e=kYe(e,!r,"/",L7t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(ip(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===mg,r=t.charCodeAt(t.length-1)===mg;return t=kYe(t,!e,"/",L7t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return ip(t,"path"),t.length>0&&t.charCodeAt(0)===mg},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?".":An.posix.normalize(e)},relative(t,e){if(ip(t,"from"),ip(e,"to"),t===e||(t=An.posix.resolve(t),e=An.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)===mg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===mg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===mg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(ip(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===mg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===mg){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&&ip(e,"ext"),ip(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===mg){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)===mg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){ip(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===mg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===fq?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:TEn.bind(null,"/"),parse(t){ip(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===mg,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===mg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===fq?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};An.posix.win32=An.win32.win32=An.win32;An.posix.posix=An.win32.posix=An.posix;An.normalize=UC?An.win32.normalize:An.posix.normalize;An.isAbsolute=UC?An.win32.isAbsolute:An.posix.isAbsolute;An.join=UC?An.win32.join:An.posix.join;An.resolve=UC?An.win32.resolve:An.posix.resolve;An.relative=UC?An.win32.relative:An.posix.relative;An.dirname=UC?An.win32.dirname:An.posix.dirname;An.basename=UC?An.win32.basename:An.posix.basename;An.extname=UC?An.win32.extname:An.posix.extname;An.format=UC?An.win32.format:An.posix.format;An.parse=UC?An.win32.parse:An.posix.parse;An.toNamespacedPath=UC?An.win32.toNamespacedPath:An.posix.toNamespacedPath;An.sep=UC?An.win32.sep:An.posix.sep;An.delimiter=UC?An.win32.delimiter:An.posix.delimiter});var NEn=I(tue=>{"use strict";p();Object.defineProperty(tue,"__esModule",{value:!0});tue.URI=void 0;tue.isUriComponents=X7o;tue.uriToFsPath=MYe;var xEn=IEn(),DYe=M7t(),V7o=/^\w[\w\d+.-]*$/,W7o=/^\//,z7o=/^\/\//;function Y7o(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&&!V7o.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!W7o.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(z7o.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(Y7o,"_validateUri");function K7o(t,e){return!t&&!e?"file":t}a(K7o,"_schemeFix");function J7o(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==qP&&(e=qP+e):e=qP;break}return e}a(J7o,"_referenceResolution");var Hl="",qP="/",Z7o=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,NYe=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||Hl,this.authority=e.authority||Hl,this.path=e.path||Hl,this.query=e.query||Hl,this.fragment=e.fragment||Hl):(this.scheme=K7o(e,c),this.authority=r||Hl,this.path=J7o(this.scheme,n||Hl),this.query=o||Hl,this.fragment=s||Hl,Y7o(this,c))}get fsPath(){return MYe(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=Hl),n===void 0?n=this.authority:n===null&&(n=Hl),o===void 0?o=this.path:o===null&&(o=Hl),s===void 0?s=this.query:s===null&&(s=Hl),c===void 0?c=this.fragment:c===null&&(c=Hl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new pq(r,n,o,s,c)}static parse(e,r=!1){let n=Z7o.exec(e);return n?new pq(n[2]||Hl,PYe(n[4]||Hl),PYe(n[5]||Hl),PYe(n[7]||Hl),PYe(n[9]||Hl),r):new pq(Hl,Hl,Hl,Hl,Hl)}static file(e){let r=Hl;if(DYe.isWindows&&(e=e.replace(/\\/g,qP)),e[0]===qP&&e[1]===qP){let n=e.indexOf(qP,2);n===-1?(r=e.substring(2),e=qP):(r=e.substring(2,n),e=e.substring(n)||qP)}return new pq("file",r,e,Hl,Hl)}static from(e,r){return new pq(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 DYe.isWindows&&e.scheme==="file"?n=t.file(xEn.win32.join(MYe(e,!0),...r)).path:n=xEn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return B7t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new pq(e);return r._formatted=e.external??null,r._fsPath=e._sep===kEn?e.fsPath??null:null,r}}else return e}};tue.URI=NYe;function X7o(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(X7o,"isUriComponents");var kEn=DYe.isWindows?1:void 0,pq=class extends NYe{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=MYe(this,!1)),this._fsPath}toString(e=!1){return e?B7t(this,!0):(this._formatted||(this._formatted=B7t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=kEn),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}},PEn={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 wEn(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=PEn[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(wEn,"encodeURIComponentFast");function eQo(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,DYe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(MYe,"uriToFsPath");function B7t(t,e){let r=e?eQo:wEn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=qP,n+=qP),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:wEn(u,!1,!1)),n}a(B7t,"_asFormatted");function DEn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+DEn(t.substr(3)):t}}a(DEn,"decodeURIComponentGraceful");var REn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function PYe(t){return t.match(REn)?t.replace(REn,e=>DEn(e)):t}a(PYe,"percentDecode")});var Q7t=I(hq=>{"use strict";p();Object.defineProperty(hq,"__esModule",{value:!0});hq.PromptReference=hq.ChatResponseReferencePartStatusKind=hq.PromptMetadata=void 0;var _xe=NEn(),F7t=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};hq.PromptMetadata=F7t;var MEn;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(MEn||(hq.ChatResponseReferencePartStatusKind=MEn={}));var U7t=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?_xe.URI.from(n):{uri:_xe.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?_xe.URI.from(e.iconPath):"light"in e.iconPath?{light:_xe.URI.from(e.iconPath.light),dark:_xe.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}}};hq.PromptReference=U7t});var z7t=I(rue=>{"use strict";p();Object.defineProperty(rue,"__esModule",{value:!0});rue.PromptRenderer=rue.MetadataMap=void 0;var tQo=f7t(),mq=A7t(),NK=sq(),Bd=k7t(),W7t=Q7t(),LYe;(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")})})(LYe||(rue.MetadataMap=LYe={}));var q7t=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new UYe(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=FEn(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 Bd.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(E.tokenLimit===void 0)return!1;let _=E.element.props.flexBasis??1,v=_/h;return Math.floor(e.remainingTokenBudget*v){let v=(E.element.props.flexBasis??1)/h;return{tokenBudget:g[_]?E.tokenLimit:Math.floor((e.remainingTokenBudget-m)*v),endpoint:e.endpoint,countTokens:a((b,T)=>this._tokenizer.tokenLength(typeof b=="string"?{type:NK.Raw.ChatCompletionContentPartKind.Text,text:b}:b,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:E.element.node.id,tokenBudget:A[_].tokenBudget}))}),await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=await LEn(E,()=>_.prepare?.(A[v],n,o));E.node.setState(b)}));let y=await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=A[v];return await LEn(E,()=>_.render(E.node.getState(),b,n,o))}));for(let[E,{element:_,promptElementInstance:v}]of d.entries()){let b=A[E],T=y[E];if(!T)continue;let w=await this._processPromptRenderPiece(new DK(b.tokenBudget,this._endpoint),_,v,T,n,o);v instanceof Bd.Expandable&&this._growables.push({initialConsume:w,elem:_.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=BEn(o),u=new DK(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await rQo(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 DK(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,NK.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new DK(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 CO))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(QYe),h=o.map(m=>{if(!(m instanceof CO)||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(QYe);return{metadata:LYe.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 mq.BudgetExceededError&&(m.metadata=LYe.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 Bd.Expandable))throw new Error("unreachable: expected growable");let l=new UYe(null,0,s.elem.id),u=new DK(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:NK.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===Bd.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},BYe(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 CO(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 CO(u));else this._handleIntrinsic(e,l.name,l.props,BYe(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};rue.PromptRenderer=q7t;async function rQo(t,e,r,n){let o=0;if((0,Bd.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,NK.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:NK.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(rQo,"computeTokensConsumedByLiterals");function BEn(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new G7t(String(t))):nQo(t)?BYe(t.children,e):iQo(t)?BYe(t,e):typeof t.ctor=="string"?e.push(new j7t(t.ctor,t.props,t.children)):e.push(new H7t(t.ctor,t.props,t.children)),e)}a(BEn,"flattenAndReduce");function BYe(t,e=[]){for(let r of t)BEn(r,e);return e}a(BYe,"flattenAndReduceArr");var j7t=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},H7t=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},G7t=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},FYe=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 mq.MaterializedChatMessageOpaque(e,{type:NK.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},DK=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}},UYe=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 CO(W7t.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return vxe.fromJSON(o,c,s);case 3:return FYe.fromJSON(o,c,s);default:}}).filter(QYe),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new Bd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,Bd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new Bd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new Bd.Image(r.props);break;case 4:o._obj=new Bd.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 Bd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof Bd.Chunk&&(this._objFlags|=2),this._obj instanceof Bd.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 vxe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new vxe(this,r,` -`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new FYe(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(QYe),props:{},references:this._metadata.filter(r=>r instanceof CO).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=OYe(this._obj.props,tQo.jsonRetainedProps)),this._obj instanceof Bd.BaseChatMessage)e.ctor=1,Object.assign(e.props,OYe(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof Bd.Image)return{...e,ctor:3,props:{...e.props,...OYe(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof Bd.Document)return{...e,ctor:4,props:{...e.props,...OYe(this._obj.props,["data","mediaType"])}};this._obj instanceof Bd.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 Bd.Image)return new mq.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 Bd.Document)return new mq.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 Bd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new mq.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof Bd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof Bd.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 mq.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 Bd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof Bd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new $7t({type:NK.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},$7t=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new mq.MaterializedChatMessageBreakpoint(e,this.part)}},vxe=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 CO(W7t.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 mq.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 CO).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function nQo(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(nQo,"isFragmentCtor");function QYe(t){return t!==void 0}a(QYe,"isDefined");var V7t=class extends W7t.PromptMetadata{static{a(this,"InternalMetadata")}},CO=class extends V7t{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function iQo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(iQo,"isIterable");function OYe(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(OYe,"pickProps");function FEn(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(FEn,"atPath");var OEn=new WeakSet;async function LEn(t,e){try{return await e()}catch(r){throw r instanceof Error&&!OEn.has(r)&&r.constructor.name!=="CancellationError"&&(OEn.add(r),r.message+=` (at tsx element ${FEn(t.path)})`),r}}a(LEn,"annotateError")});var UEn=I(qYe=>{"use strict";p();Object.defineProperty(qYe,"__esModule",{value:!0});qYe.VSCodeTokenizer=void 0;var Y7t=sq(),K7t=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=Y7t.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==Y7t.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===Y7t.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};qYe.VSCodeTokenizer=K7t});var QEn=I(nue=>{"use strict";p();Object.defineProperty(nue,"__esModule",{value:!0});nue.tracerCss=nue.tracerSrc=void 0;nue.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';nue.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 $En=I(HYe=>{"use strict";p();Object.defineProperty(HYe,"__esModule",{value:!0});HYe.HTMLTracer=void 0;var qEn=QEn(),gq=A7t(),oQo=sq(),J7t=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 Z7t.create({epochs:this.epochs,traceData:HEn(this.traceData)})}serveRouter(e){return new jYe({baseAddress:e,epochs:this.epochs,traceData:HEn(this.traceData)})}};HYe.HTMLTracer=J7t;var jYe=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:RA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof wK)return{type:RA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:cEn(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof RK)return{type:RA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof lq)return{type:RA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof QP)return r.part;throw new Error("Unexpected element type")});if(this.role===RA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===RA.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===RA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===RA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};hg.MaterializedChatMessage=qP;var lq=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&&RA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};hg.MaterializedChatMessageOpaque=lq;var QP=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};hg.MaterializedChatMessageBreakpoint=QP;var wK=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,xK.once)(async e=>e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:cEn(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};hg.MaterializedChatMessageImage=wK;var RK=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,xK.once)(async e=>e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};hg.MaterializedChatMessageDocument=RK;function uq(t){return t instanceof Q3||t instanceof qP}a(uq,"isContainerType");function nEn(t){return t instanceof dxe||t instanceof wK||t instanceof RK||t instanceof lq||t instanceof QP}a(nEn,"isContentType");function S7o(t){if(!uq(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(S7o,"assertContainerOrChatMessage");function*iEn(t,e=!1){for(let r of t.children)r instanceof dxe?(yield{content:r,isTextSibling:e},e=!0):r instanceof wK||r instanceof RK||r instanceof lq||r instanceof QP?yield{content:r,isTextSibling:!1}:r instanceof lq?yield{content:r,isTextSibling:!0}:(r&&(yield*iEn(r,e)),e=!1)}a(iEn,"contentChunks");function T7o(t,e){let r;function n(o,s){if(nEn(o))(!r||o.priorityn instanceof QP):t instanceof Q3&&(r=t.children.some(oEn)),Xyn.set(t,r),r}a(oEn,"hasCachePoint");function I7o(t){if(t instanceof qP)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof qP)return!1;return!0}a(I7o,"shouldLookForCachePointInNode");function g7t(t,e){let r;if(t instanceof Q3&&t.has(1)){T7o(t,e);return}let n=I7o(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 qP?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};hg.BudgetExceededError=bYe;function eEn(t){if(!uq(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(eEn,"getLowestPriorityAmongChildren");function*sEn(t){yield*t.metadata;for(let e of t.children)uq(e)?yield*sEn(e):yield*e.metadata}a(sEn,"allMetadata");function aEn(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,uq(r)&&e.push(...r.children)}}a(tEn,"forEachNode");function x7o(t){let e=t;for(;e.parent;)e=e.parent;return e}a(x7o,"getRoot");function rEn(t){return t instanceof Q3&&t.keepWithId!==void 0}a(rEn,"isKeepWith");var m7t=new Set;function w7o(t,e){let r=new Set;for(let n of tEn(t))rEn(n)&&!m7t.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)m7t.add(n);try{let n=x7o(t);for(let o of tEn(n))rEn(o)&&r.has(o.keepWithId)?fxe(o,e):o instanceof qP&&o.toolCalls&&(o.toolCalls=R7o(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&&fxe(o,e))}finally{for(let n of r)m7t.delete(n)}}a(w7o,"removeOtherKeepWiths");function A7t(t,e){if(e.id===t)return e;for(let r of e.children)if(uq(r)){let n=A7t(t,r);if(n)return n}}a(A7t,"findNodeById");function fxe(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),w7o(t,e),r.isEmpty?fxe(r,e):r.onChunksChange())}a(fxe,"removeNode");function cEn(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(cEn,"getEncodedBase64");function R7o(t,e){for(let r=0;r{"use strict";p();function k7o(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(k7o,"_vscpp");function lEn(){throw new Error("This should not be invoked!")}a(lEn,"_vscppf");lEn.isFragment=!0;globalThis.vscpp=k7o;globalThis.vscppf=lEn});var _7t=I(SYe=>{"use strict";p();Object.defineProperty(SYe,"__esModule",{value:!0});SYe.PromptElement=void 0;uEn();var E7t=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}};SYe.PromptElement=E7t});var P7t=I(Qs=>{"use strict";p();Object.defineProperty(Qs,"__esModule",{value:!0});Qs.LogicalWrapper=Qs.IfEmpty=Qs.AbstractKeepWith=Qs.TokenLimit=Qs.Expandable=Qs.Chunk=Qs.LegacyPrioritization=Qs.ToolResult=Qs.PrioritizedList=Qs.Document=Qs.Image=Qs.TextChunk=Qs.ToolMessage=Qs.AssistantMessage=Qs.UserMessage=Qs.SystemMessage=Qs.BaseChatMessage=void 0;Qs.isChatMessagePromptElement=P7o;Qs.useKeepWith=O7o;var hxe=xo(),WS=_7t();function P7o(t){return t instanceof TYe||t instanceof IYe||t instanceof xYe}a(P7o,"isChatMessagePromptElement");var kK=class extends WS.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.BaseChatMessage=kK;var TYe=class extends kK{static{a(this,"SystemMessage")}constructor(e){e.role=hxe.Raw.ChatRole.System,super(e)}};Qs.SystemMessage=TYe;var IYe=class extends kK{static{a(this,"UserMessage")}constructor(e){e.role=hxe.Raw.ChatRole.User,super(e)}};Qs.UserMessage=IYe;var xYe=class extends kK{static{a(this,"AssistantMessage")}constructor(e){e.role=hxe.Raw.ChatRole.Assistant,super(e)}};Qs.AssistantMessage=xYe;var D7o=/\s+/g,v7t=class extends kK{static{a(this,"ToolMessage")}constructor(e){e.role=hxe.Raw.ChatRole.Tool,super(e)}};Qs.ToolMessage=v7t;var wYe=class extends WS.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?D7o: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 N7o(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Qs.TextChunk=wYe;async function N7o(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(N7o,"getTextContentBelowBudget");var C7t=class extends WS.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Image=C7t;var b7t=class extends WS.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Document=b7t;var S7t=class extends WS.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(wYe,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Qs.PrioritizedList=S7t;var T7t=class extends WS.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})}))}};Qs.ToolResult=T7t;var I7t=class extends WS.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.LegacyPrioritization=I7t;var x7t=class extends WS.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Chunk=x7t;var w7t=class extends WS.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Qs.Expandable=w7t;var R7t=class extends WS.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.TokenLimit=R7t;var RYe=class extends WS.PromptElement{static{a(this,"AbstractKeepWith")}};Qs.AbstractKeepWith=RYe;var M7o=0;function O7o(){let t=M7o++;return class extends RYe{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(O7o,"useKeepWith");var k7t=class extends WS.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp(pxe,null,this.props.alt),vscpp(pxe,{flexGrow:1},this.props.children))}};Qs.IfEmpty=k7t;var pxe=class extends WS.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.LogicalWrapper=pxe});var fEn=I(mxe=>{"use strict";p();Object.defineProperty(mxe,"__esModule",{value:!0});mxe.localize=L7o;mxe.localize2=B7o;mxe.getConfiguredDefaultLocale=F7o;function dEn(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(dEn,"_format");function L7o(t,e,...r){return dEn(e,r)}a(L7o,"localize");function B7o(t,e,...r){let n=dEn(e,r);return{original:n,value:n}}a(B7o,"localize2");function F7o(t){}a(F7o,"getConfiguredDefaultLocale")});var O7t=I(Sr=>{"use strict";p();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.isAndroid=Sr.isEdge=Sr.isSafari=Sr.isFirefox=Sr.isChrome=Sr.OS=Sr.setTimeout0=Sr.setTimeout0IsFaster=Sr.translationsConfigFile=Sr.platformLocale=Sr.locale=Sr.Language=Sr.language=Sr.userAgent=Sr.platform=Sr.isCI=Sr.isMobile=Sr.isIOS=Sr.webWorkerOrigin=Sr.isWebWorker=Sr.isWeb=Sr.isElectron=Sr.isNative=Sr.isLinuxSnap=Sr.isLinux=Sr.isMacintosh=Sr.isWindows=Sr.LANGUAGE_DEFAULT=void 0;Sr.PlatformToString=Q7o;Sr.isLittleEndian=q7o;Sr.isBigSurOrNewer=j7o;var pEn=fEn();Sr.LANGUAGE_DEFAULT="en";var yxe=!1,Exe=!1,Axe=!1,AEn=!1,yEn=!1,N7t=!1,EEn=!1,M7t=!1,_En=!1,vEn=!1,gxe,kYe=Sr.LANGUAGE_DEFAULT,D7t=Sr.LANGUAGE_DEFAULT,CEn,q3,j3=globalThis,zS;typeof j3.vscode<"u"&&typeof j3.vscode.process<"u"?zS=j3.vscode.process:typeof process<"u"&&(zS=process);var bEn=typeof zS?.versions?.electron=="string",U7o=bEn&&zS?.type==="renderer";if(typeof zS=="object"){yxe=zS.platform==="win32",Exe=zS.platform==="darwin",Axe=zS.platform==="linux",AEn=Axe&&!!zS.env.SNAP&&!!zS.env.SNAP_REVISION,EEn=bEn,_En=!!zS.env.CI||!!zS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,gxe=Sr.LANGUAGE_DEFAULT,kYe=Sr.LANGUAGE_DEFAULT;let t=zS.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];gxe=e.locale,D7t=e.osLocale,kYe=r||Sr.LANGUAGE_DEFAULT,CEn=e._translationsConfigFile}catch{}yEn=!0}else typeof navigator=="object"&&!U7o?(q3=navigator.userAgent,yxe=q3.indexOf("Windows")>=0,Exe=q3.indexOf("Macintosh")>=0,M7t=(q3.indexOf("Macintosh")>=0||q3.indexOf("iPad")>=0||q3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Axe=q3.indexOf("Linux")>=0,vEn=q3?.indexOf("Mobi")>=0,N7t=!0,gxe=pEn.getConfiguredDefaultLocale(pEn.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||Sr.LANGUAGE_DEFAULT,kYe=gxe,D7t=navigator.language):console.error("Unable to resolve platform.");function Q7o(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(Q7o,"PlatformToString");var PYe=0;Exe?PYe=1:yxe?PYe=3:Axe&&(PYe=2);Sr.isWindows=yxe;Sr.isMacintosh=Exe;Sr.isLinux=Axe;Sr.isLinuxSnap=AEn;Sr.isNative=yEn;Sr.isElectron=EEn;Sr.isWeb=N7t;Sr.isWebWorker=N7t&&typeof j3.importScripts=="function";Sr.webWorkerOrigin=Sr.isWebWorker?j3.origin:void 0;Sr.isIOS=M7t;Sr.isMobile=vEn;Sr.isCI=_En;Sr.platform=PYe;Sr.userAgent=q3;Sr.language=kYe;var hEn;(function(t){function e(){return Sr.language}a(e,"value"),t.value=e;function r(){return Sr.language.length===2?Sr.language==="en":Sr.language.length>=3?Sr.language[0]==="e"&&Sr.language[1]==="n"&&Sr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return Sr.language==="en"}a(n,"isDefault"),t.isDefault=n})(hEn||(Sr.Language=hEn={}));Sr.locale=gxe;Sr.platformLocale=D7t;Sr.translationsConfigFile=CEn;Sr.setTimeout0IsFaster=typeof j3.postMessage=="function"&&!j3.importScripts;Sr.setTimeout0=(()=>{if(Sr.setTimeout0IsFaster){let t=[];j3.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}),j3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();Sr.OS=Exe||M7t?2:yxe?1:3;var mEn=!0,gEn=!1;function q7o(){if(!gEn){gEn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,mEn=new Uint16Array(t.buffer)[0]===513}return mEn}a(q7o,"isLittleEndian");Sr.isChrome=!!(Sr.userAgent&&Sr.userAgent.indexOf("Chrome")>=0);Sr.isFirefox=!!(Sr.userAgent&&Sr.userAgent.indexOf("Firefox")>=0);Sr.isSafari=!!(!Sr.isChrome&&Sr.userAgent&&Sr.userAgent.indexOf("Safari")>=0);Sr.isEdge=!!(Sr.userAgent&&Sr.userAgent.indexOf("Edg/")>=0);Sr.isAndroid=!!(Sr.userAgent&&Sr.userAgent.indexOf("Android")>=0);function j7o(t){return parseFloat(t)>=20}a(j7o,"isBigSurOrNewer")});var TEn=I(vO=>{"use strict";p();Object.defineProperty(vO,"__esModule",{value:!0});vO.arch=vO.platform=vO.env=vO.cwd=void 0;var SEn=O7t(),PK,L7t=globalThis.vscode;if(typeof L7t<"u"&&typeof L7t.process<"u"){let t=L7t.process;PK={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?PK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:PK={get platform(){return SEn.isWindows?"win32":SEn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};vO.cwd=PK.cwd;vO.env=PK.env;vO.platform=PK.platform;vO.arch=PK.arch});var xEn=I(An=>{"use strict";p();Object.defineProperty(An,"__esModule",{value:!0});An.delimiter=An.sep=An.toNamespacedPath=An.parse=An.format=An.extname=An.basename=An.dirname=An.relative=An.resolve=An.join=An.isAbsolute=An.normalize=An.posix=An.win32=void 0;var eue=TEn(),H7o=65,G7o=97,$7o=90,V7o=122,pq=46,mg=47,FC=92,dq=58,W7o=63,DYe=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 z7o(t,e){if(t===null||typeof t!="object")throw new DYe(e,"Object",t)}a(z7o,"validateObject");function ip(t,e){if(typeof t!="string")throw new DYe(e,"string",t)}a(ip,"validateString");var UC=eue.platform==="win32";function ns(t){return t===mg||t===FC}a(ns,"isPathSeparator");function B7t(t){return t===mg}a(B7t,"isPosixPathSeparator");function fq(t){return t>=H7o&&t<=$7o||t>=G7o&&t<=V7o}a(fq,"isWindowsDeviceRoot");function NYe(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===pq&&l!==-1?++l:l=-1}return o}a(NYe,"normalizeString");function IEn(t,e){z7o(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(IEn,"_format");An.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],ip(s,"path"),s.length===0)continue}else e.length===0?s=eue.cwd():(s=eue.env[`=${e}`]||eue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===FC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)ns(f)&&(l=1,d=!0);else if(ns(f))if(d=!0,ns(s.charCodeAt(1))){let h=2,m=h;for(;h2&&ns(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=NYe(r,!n,"\\",ns),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){ip(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return B7t(s)?"\\":t;if(ns(s))if(o=!0,ns(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ns(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&ns(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){ip(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return ns(r)||e>2&&fq(r)&&t.charCodeAt(1)===dq&&ns(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"&&ns(r.charCodeAt(0))){++o;let s=r.length;s>1&&ns(r.charCodeAt(1))&&(++o,s>2&&(ns(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return An.win32.normalize(e)},relative(t,e){if(ip(t,"from"),ip(e,"to"),t===e)return"";let r=An.win32.resolve(t),n=An.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===FC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===FC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===FC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===FC?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)===FC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===FC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=An.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===FC){if(e.charCodeAt(1)===FC){let r=e.charCodeAt(2);if(r!==W7o&&r!==pq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(fq(e.charCodeAt(0))&&e.charCodeAt(1)===dq&&e.charCodeAt(2)===FC)return`\\\\?\\${e}`;return t},dirname(t){ip(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return ns(o)?t:".";if(ns(o)){if(r=n=1,ns(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ns(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(ns(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&&ip(e,"ext"),ip(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&fq(t.charCodeAt(0))&&t.charCodeAt(1)===dq&&(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(ns(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(ns(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){ip(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===dq&&fq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(ns(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===pq?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:IEn.bind(null,"\\"),parse(t){ip(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 ns(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(ns(o)){if(n=1,ns(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),ns(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===pq?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 Y7o=(()=>{if(UC){let t=/\\/g;return()=>{let e=eue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>eue.cwd()})();An.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:Y7o();ip(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===mg)}return e=NYe(e,!r,"/",B7t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(ip(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===mg,r=t.charCodeAt(t.length-1)===mg;return t=NYe(t,!e,"/",B7t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return ip(t,"path"),t.length>0&&t.charCodeAt(0)===mg},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?".":An.posix.normalize(e)},relative(t,e){if(ip(t,"from"),ip(e,"to"),t===e||(t=An.posix.resolve(t),e=An.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)===mg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===mg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===mg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(ip(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===mg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===mg){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&&ip(e,"ext"),ip(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===mg){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)===mg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){ip(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===mg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===pq?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:IEn.bind(null,"/"),parse(t){ip(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===mg,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===mg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===pq?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};An.posix.win32=An.win32.win32=An.win32;An.posix.posix=An.win32.posix=An.posix;An.normalize=UC?An.win32.normalize:An.posix.normalize;An.isAbsolute=UC?An.win32.isAbsolute:An.posix.isAbsolute;An.join=UC?An.win32.join:An.posix.join;An.resolve=UC?An.win32.resolve:An.posix.resolve;An.relative=UC?An.win32.relative:An.posix.relative;An.dirname=UC?An.win32.dirname:An.posix.dirname;An.basename=UC?An.win32.basename:An.posix.basename;An.extname=UC?An.win32.extname:An.posix.extname;An.format=UC?An.win32.format:An.posix.format;An.parse=UC?An.win32.parse:An.posix.parse;An.toNamespacedPath=UC?An.win32.toNamespacedPath:An.posix.toNamespacedPath;An.sep=UC?An.win32.sep:An.posix.sep;An.delimiter=UC?An.win32.delimiter:An.posix.delimiter});var MEn=I(tue=>{"use strict";p();Object.defineProperty(tue,"__esModule",{value:!0});tue.URI=void 0;tue.isUriComponents=nQo;tue.uriToFsPath=BYe;var wEn=xEn(),OYe=O7t(),K7o=/^\w[\w\d+.-]*$/,J7o=/^\//,Z7o=/^\/\//;function X7o(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&&!K7o.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!J7o.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(Z7o.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(X7o,"_validateUri");function eQo(t,e){return!t&&!e?"file":t}a(eQo,"_schemeFix");function tQo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==jP&&(e=jP+e):e=jP;break}return e}a(tQo,"_referenceResolution");var Hl="",jP="/",rQo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,LYe=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||Hl,this.authority=e.authority||Hl,this.path=e.path||Hl,this.query=e.query||Hl,this.fragment=e.fragment||Hl):(this.scheme=eQo(e,c),this.authority=r||Hl,this.path=tQo(this.scheme,n||Hl),this.query=o||Hl,this.fragment=s||Hl,X7o(this,c))}get fsPath(){return BYe(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=Hl),n===void 0?n=this.authority:n===null&&(n=Hl),o===void 0?o=this.path:o===null&&(o=Hl),s===void 0?s=this.query:s===null&&(s=Hl),c===void 0?c=this.fragment:c===null&&(c=Hl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new hq(r,n,o,s,c)}static parse(e,r=!1){let n=rQo.exec(e);return n?new hq(n[2]||Hl,MYe(n[4]||Hl),MYe(n[5]||Hl),MYe(n[7]||Hl),MYe(n[9]||Hl),r):new hq(Hl,Hl,Hl,Hl,Hl)}static file(e){let r=Hl;if(OYe.isWindows&&(e=e.replace(/\\/g,jP)),e[0]===jP&&e[1]===jP){let n=e.indexOf(jP,2);n===-1?(r=e.substring(2),e=jP):(r=e.substring(2,n),e=e.substring(n)||jP)}return new hq("file",r,e,Hl,Hl)}static from(e,r){return new hq(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 OYe.isWindows&&e.scheme==="file"?n=t.file(wEn.win32.join(BYe(e,!0),...r)).path:n=wEn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return F7t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new hq(e);return r._formatted=e.external??null,r._fsPath=e._sep===PEn?e.fsPath??null:null,r}}else return e}};tue.URI=LYe;function nQo(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(nQo,"isUriComponents");var PEn=OYe.isWindows?1:void 0,hq=class extends LYe{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=BYe(this,!1)),this._fsPath}toString(e=!1){return e?F7t(this,!0):(this._formatted||(this._formatted=F7t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=PEn),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}},DEn={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 REn(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=DEn[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(REn,"encodeURIComponentFast");function iQo(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,OYe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(BYe,"uriToFsPath");function F7t(t,e){let r=e?iQo:REn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=jP,n+=jP),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:REn(u,!1,!1)),n}a(F7t,"_asFormatted");function NEn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+NEn(t.substr(3)):t}}a(NEn,"decodeURIComponentGraceful");var kEn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function MYe(t){return t.match(kEn)?t.replace(kEn,e=>NEn(e)):t}a(MYe,"percentDecode")});var q7t=I(mq=>{"use strict";p();Object.defineProperty(mq,"__esModule",{value:!0});mq.PromptReference=mq.ChatResponseReferencePartStatusKind=mq.PromptMetadata=void 0;var _xe=MEn(),U7t=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};mq.PromptMetadata=U7t;var OEn;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(OEn||(mq.ChatResponseReferencePartStatusKind=OEn={}));var Q7t=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?_xe.URI.from(n):{uri:_xe.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?_xe.URI.from(e.iconPath):"light"in e.iconPath?{light:_xe.URI.from(e.iconPath.light),dark:_xe.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}}};mq.PromptReference=Q7t});var Y7t=I(rue=>{"use strict";p();Object.defineProperty(rue,"__esModule",{value:!0});rue.PromptRenderer=rue.MetadataMap=void 0;var oQo=p7t(),gq=y7t(),NK=aq(),Bd=P7t(),z7t=q7t(),UYe;(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")})})(UYe||(rue.MetadataMap=UYe={}));var j7t=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new jYe(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=UEn(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 Bd.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(E.tokenLimit===void 0)return!1;let _=E.element.props.flexBasis??1,v=_/h;return Math.floor(e.remainingTokenBudget*v){let v=(E.element.props.flexBasis??1)/h;return{tokenBudget:g[_]?E.tokenLimit:Math.floor((e.remainingTokenBudget-m)*v),endpoint:e.endpoint,countTokens:a((b,T)=>this._tokenizer.tokenLength(typeof b=="string"?{type:NK.Raw.ChatCompletionContentPartKind.Text,text:b}:b,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:E.element.node.id,tokenBudget:A[_].tokenBudget}))}),await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=await BEn(E,()=>_.prepare?.(A[v],n,o));E.node.setState(b)}));let y=await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=A[v];return await BEn(E,()=>_.render(E.node.getState(),b,n,o))}));for(let[E,{element:_,promptElementInstance:v}]of d.entries()){let b=A[E],T=y[E];if(!T)continue;let w=await this._processPromptRenderPiece(new DK(b.tokenBudget,this._endpoint),_,v,T,n,o);v instanceof Bd.Expandable&&this._growables.push({initialConsume:w,elem:_.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=FEn(o),u=new DK(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await sQo(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 DK(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,NK.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new DK(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 CO))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(HYe),h=o.map(m=>{if(!(m instanceof CO)||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(HYe);return{metadata:UYe.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 gq.BudgetExceededError&&(m.metadata=UYe.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 Bd.Expandable))throw new Error("unreachable: expected growable");let l=new jYe(null,0,s.elem.id),u=new DK(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:NK.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===Bd.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},QYe(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 CO(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 CO(u));else this._handleIntrinsic(e,l.name,l.props,QYe(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};rue.PromptRenderer=j7t;async function sQo(t,e,r,n){let o=0;if((0,Bd.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,NK.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:NK.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(sQo,"computeTokensConsumedByLiterals");function FEn(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new $7t(String(t))):aQo(t)?QYe(t.children,e):cQo(t)?QYe(t,e):typeof t.ctor=="string"?e.push(new H7t(t.ctor,t.props,t.children)):e.push(new G7t(t.ctor,t.props,t.children)),e)}a(FEn,"flattenAndReduce");function QYe(t,e=[]){for(let r of t)FEn(r,e);return e}a(QYe,"flattenAndReduceArr");var H7t=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},G7t=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},$7t=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},qYe=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 gq.MaterializedChatMessageOpaque(e,{type:NK.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},DK=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}},jYe=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 CO(z7t.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return vxe.fromJSON(o,c,s);case 3:return qYe.fromJSON(o,c,s);default:}}).filter(HYe),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new Bd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,Bd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new Bd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new Bd.Image(r.props);break;case 4:o._obj=new Bd.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 Bd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof Bd.Chunk&&(this._objFlags|=2),this._obj instanceof Bd.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 vxe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new vxe(this,r,` +`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new qYe(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(HYe),props:{},references:this._metadata.filter(r=>r instanceof CO).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=FYe(this._obj.props,oQo.jsonRetainedProps)),this._obj instanceof Bd.BaseChatMessage)e.ctor=1,Object.assign(e.props,FYe(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof Bd.Image)return{...e,ctor:3,props:{...e.props,...FYe(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof Bd.Document)return{...e,ctor:4,props:{...e.props,...FYe(this._obj.props,["data","mediaType"])}};this._obj instanceof Bd.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 Bd.Image)return new gq.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 Bd.Document)return new gq.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 Bd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new gq.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof Bd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof Bd.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 gq.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 Bd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof Bd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new V7t({type:NK.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},V7t=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new gq.MaterializedChatMessageBreakpoint(e,this.part)}},vxe=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 CO(z7t.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 gq.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 CO).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function aQo(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(aQo,"isFragmentCtor");function HYe(t){return t!==void 0}a(HYe,"isDefined");var W7t=class extends z7t.PromptMetadata{static{a(this,"InternalMetadata")}},CO=class extends W7t{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function cQo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(cQo,"isIterable");function FYe(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(FYe,"pickProps");function UEn(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(UEn,"atPath");var LEn=new WeakSet;async function BEn(t,e){try{return await e()}catch(r){throw r instanceof Error&&!LEn.has(r)&&r.constructor.name!=="CancellationError"&&(LEn.add(r),r.message+=` (at tsx element ${UEn(t.path)})`),r}}a(BEn,"annotateError")});var QEn=I(GYe=>{"use strict";p();Object.defineProperty(GYe,"__esModule",{value:!0});GYe.VSCodeTokenizer=void 0;var K7t=aq(),J7t=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=K7t.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==K7t.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===K7t.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};GYe.VSCodeTokenizer=J7t});var qEn=I(nue=>{"use strict";p();Object.defineProperty(nue,"__esModule",{value:!0});nue.tracerCss=nue.tracerSrc=void 0;nue.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';nue.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 VEn=I(VYe=>{"use strict";p();Object.defineProperty(VYe,"__esModule",{value:!0});VYe.HTMLTracer=void 0;var jEn=qEn(),Aq=y7t(),lQo=aq(),Z7t=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 X7t.create({epochs:this.epochs,traceData:GEn(this.traceData)})}serveRouter(e){return new $Ye({baseAddress:e,epochs:this.epochs,traceData:GEn(this.traceData)})}};VYe.HTMLTracer=Z7t;var $Ye=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 jEn(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)})}},Z7t=class t extends jYe{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 jEn(t,e){return{container:await GEn(t,e.container,!1),removed:e.removed,budget:e.budget}}a(jEn,"serializeRenderData");async function GEn(t,e,r){let n={metadata:e.metadata.map(aQo),priority:e.priority};if(e instanceof gq.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof gq.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof gq.MaterializedChatMessageOpaque||e instanceof gq.MaterializedChatMessageBreakpoint||e instanceof gq.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>GEn(t,s,r||e instanceof gq.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof gq.GenericMaterializedContainer)return{...o,type:0};if(e instanceof gq.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:oQo.Raw.ChatRole.display(e.role),text:s}}}sQo(e)}a(GEn,"serializeMaterialized");function sQo(t){throw new Error("unreachable")}a(sQo,"assertNever");function aQo(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(aQo,"serializeMetadata");var HEn=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var WEn=I(VEn=>{"use strict";p();Object.defineProperty(VEn,"__esModule",{value:!0})});var YEn=I(zEn=>{"use strict";p();Object.defineProperty(zEn,"__esModule",{value:!0})});var JEn=I(KEn=>{"use strict";p();Object.defineProperty(KEn,"__esModule",{value:!0})});var Io=I(ed=>{"use strict";p();var cQo=ed&&ed.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MK=ed&&ed.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cQo(e,t,r)};Object.defineProperty(ed,"__esModule",{value:!0});ed.contentType=ed.PromptRenderer=ed.MetadataMap=ed.PromptElement=ed.JSONTree=void 0;ed.renderPrompt=dQo;ed.renderElementJSON=fQo;var X7t=sq(),ZEn=z7t(),lQo=UEn();MK($En(),ed);ed.JSONTree=f7t();MK(sq(),ed);MK(k7t(),ed);MK(Q7t(),ed);MK(WEn(),ed);MK(YEn(),ed);MK(JEn(),ed);var uQo=E7t();Object.defineProperty(ed,"PromptElement",{enumerable:!0,get:a(function(){return uQo.PromptElement},"get")});var XEn=z7t();Object.defineProperty(ed,"MetadataMap",{enumerable:!0,get:a(function(){return XEn.MetadataMap},"get")});Object.defineProperty(ed,"PromptRenderer",{enumerable:!0,get:a(function(){return XEn.PromptRenderer},"get")});async function dQo(t,e,r,n,o,s,c=X7t.OutputMode.VSCode){let l="countTokens"in n?new lQo.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new ZEn.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(dQo,"renderPrompt");ed.contentType="application/vnd.codechat.prompt+json.1";function fQo(t,e,r,n){return new ZEn.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:X7t.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===X7t.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(fQo,"renderElementJSON")});var cCn=I((Asd,Uxe)=>{"use strict";p();var eJe=a(function(){},"NullObject");eJe.prototype=Object.create(null);var ZKe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,XKe=/\\([\v\u0020-\u00ff])/gu,oCn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,GK={type:"",parameters:new eJe};Object.freeze(GK.parameters);Object.freeze(GK);function sCn(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(oCn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new eJe};if(e===-1)return n;let o,s,c;for(ZKe.lastIndex=e;s=ZKe.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),XKe.test(c)&&(c=c.replace(XKe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(sCn,"parse");function aCn(t){if(typeof t!="string")return GK;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(oCn.test(r)===!1)return GK;let n={type:r.toLowerCase(),parameters:new eJe};if(e===-1)return n;let o,s,c;for(ZKe.lastIndex=e;s=ZKe.exec(t);){if(s.index!==e)return GK;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),XKe.test(c)&&(c=c.replace(XKe,"$1"))),n.parameters[o]=c}return e!==t.length?GK:n}a(aCn,"safeParse");Uxe.exports.default={parse:sCn,safeParse:aCn};Uxe.exports.parse=sCn;Uxe.exports.safeParse=aCn;Uxe.exports.defaultContentType=GK});var xq=I(Eg=>{"use strict";p();Object.defineProperty(Eg,"__esModule",{value:!0});Eg.MonotonousArray=void 0;Eg.findLast=jHo;Eg.findLastIdx=tbn;Eg.findFirst=HHo;Eg.findFirstIdx=rbn;Eg.findLastMonotonous=GHo;Eg.findLastIdxMonotonous=Fqt;Eg.findFirstMonotonous=$Ho;Eg.findFirstIdxMonotonousOrArrLen=Uqt;Eg.findFirstIdxMonotonous=VHo;Eg.findFirstMax=nbn;Eg.findLastMax=WHo;Eg.findFirstMin=zHo;Eg.findMaxIdx=YHo;Eg.mapFindFirst=KHo;function jHo(t,e,r=t.length-1){let n=tbn(t,e,r);if(n!==-1)return t[n]}a(jHo,"findLast");function tbn(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(tbn,"findLastIdx");function HHo(t,e,r=0){let n=rbn(t,e,r);if(n!==-1)return t[n]}a(HHo,"findFirst");function rbn(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(nbn,"findFirstMax");function WHo(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(WHo,"findLastMax");function zHo(t,e){return nbn(t,(r,n)=>-e(r,n))}a(zHo,"findFirstMin");function YHo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(YHo,"findMaxIdx");function KHo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(KHo,"mapFindFirst")});var Rs=I(wo=>{"use strict";p();Object.defineProperty(wo,"__esModule",{value:!0});wo.BugIndicatingError=wo.ErrorNoTelemetry=wo.ExpectedError=wo.NotSupportedError=wo.NotImplementedError=wo.ReadonlyError=wo.PendingMigrationError=wo.CancellationError=wo.canceledName=wo.errorHandler=wo.ErrorHandler=void 0;wo.setUnexpectedErrorHandler=JHo;wo.isSigPipeError=ZHo;wo.onBugIndicatingError=XHo;wo.onUnexpectedError=eGo;wo.onUnexpectedExternalError=tGo;wo.transformErrorForSerialization=ibn;wo.transformErrorFromSerialization=obn;wo.isCancellationError=Vqt;wo.canceled=rGo;wo.illegalArgument=nGo;wo.illegalState=iGo;wo.getErrorMessage=oGo;var SJe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?zK.isErrorNoTelemetry(e)?new zK(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 HEn(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)})}},X7t=class t extends $Ye{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 HEn(t,e){return{container:await $En(t,e.container,!1),removed:e.removed,budget:e.budget}}a(HEn,"serializeRenderData");async function $En(t,e,r){let n={metadata:e.metadata.map(dQo),priority:e.priority};if(e instanceof Aq.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof Aq.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof Aq.MaterializedChatMessageOpaque||e instanceof Aq.MaterializedChatMessageBreakpoint||e instanceof Aq.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>$En(t,s,r||e instanceof Aq.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof Aq.GenericMaterializedContainer)return{...o,type:0};if(e instanceof Aq.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:lQo.Raw.ChatRole.display(e.role),text:s}}}uQo(e)}a($En,"serializeMaterialized");function uQo(t){throw new Error("unreachable")}a(uQo,"assertNever");function dQo(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(dQo,"serializeMetadata");var GEn=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var zEn=I(WEn=>{"use strict";p();Object.defineProperty(WEn,"__esModule",{value:!0})});var KEn=I(YEn=>{"use strict";p();Object.defineProperty(YEn,"__esModule",{value:!0})});var ZEn=I(JEn=>{"use strict";p();Object.defineProperty(JEn,"__esModule",{value:!0})});var xo=I(ed=>{"use strict";p();var fQo=ed&&ed.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MK=ed&&ed.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fQo(e,t,r)};Object.defineProperty(ed,"__esModule",{value:!0});ed.contentType=ed.PromptRenderer=ed.MetadataMap=ed.PromptElement=ed.JSONTree=void 0;ed.renderPrompt=mQo;ed.renderElementJSON=gQo;var eQt=aq(),XEn=Y7t(),pQo=QEn();MK(VEn(),ed);ed.JSONTree=p7t();MK(aq(),ed);MK(P7t(),ed);MK(q7t(),ed);MK(zEn(),ed);MK(KEn(),ed);MK(ZEn(),ed);var hQo=_7t();Object.defineProperty(ed,"PromptElement",{enumerable:!0,get:a(function(){return hQo.PromptElement},"get")});var e_n=Y7t();Object.defineProperty(ed,"MetadataMap",{enumerable:!0,get:a(function(){return e_n.MetadataMap},"get")});Object.defineProperty(ed,"PromptRenderer",{enumerable:!0,get:a(function(){return e_n.PromptRenderer},"get")});async function mQo(t,e,r,n,o,s,c=eQt.OutputMode.VSCode){let l="countTokens"in n?new pQo.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new XEn.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(mQo,"renderPrompt");ed.contentType="application/vnd.codechat.prompt+json.1";function gQo(t,e,r,n){return new XEn.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:eQt.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===eQt.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(gQo,"renderElementJSON")});var lCn=I((Ssd,Uxe)=>{"use strict";p();var nJe=a(function(){},"NullObject");nJe.prototype=Object.create(null);var tJe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,rJe=/\\([\v\u0020-\u00ff])/gu,sCn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,GK={type:"",parameters:new nJe};Object.freeze(GK.parameters);Object.freeze(GK);function aCn(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(sCn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new nJe};if(e===-1)return n;let o,s,c;for(tJe.lastIndex=e;s=tJe.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),rJe.test(c)&&(c=c.replace(rJe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(aCn,"parse");function cCn(t){if(typeof t!="string")return GK;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(sCn.test(r)===!1)return GK;let n={type:r.toLowerCase(),parameters:new nJe};if(e===-1)return n;let o,s,c;for(tJe.lastIndex=e;s=tJe.exec(t);){if(s.index!==e)return GK;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),rJe.test(c)&&(c=c.replace(rJe,"$1"))),n.parameters[o]=c}return e!==t.length?GK:n}a(cCn,"safeParse");Uxe.exports.default={parse:aCn,safeParse:cCn};Uxe.exports.parse=aCn;Uxe.exports.safeParse=cCn;Uxe.exports.defaultContentType=GK});var wq=I(Eg=>{"use strict";p();Object.defineProperty(Eg,"__esModule",{value:!0});Eg.MonotonousArray=void 0;Eg.findLast=VHo;Eg.findLastIdx=rbn;Eg.findFirst=WHo;Eg.findFirstIdx=nbn;Eg.findLastMonotonous=zHo;Eg.findLastIdxMonotonous=Uqt;Eg.findFirstMonotonous=YHo;Eg.findFirstIdxMonotonousOrArrLen=Qqt;Eg.findFirstIdxMonotonous=KHo;Eg.findFirstMax=ibn;Eg.findLastMax=JHo;Eg.findFirstMin=ZHo;Eg.findMaxIdx=XHo;Eg.mapFindFirst=eGo;function VHo(t,e,r=t.length-1){let n=rbn(t,e,r);if(n!==-1)return t[n]}a(VHo,"findLast");function rbn(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(rbn,"findLastIdx");function WHo(t,e,r=0){let n=nbn(t,e,r);if(n!==-1)return t[n]}a(WHo,"findFirst");function nbn(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(ibn,"findFirstMax");function JHo(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(JHo,"findLastMax");function ZHo(t,e){return ibn(t,(r,n)=>-e(r,n))}a(ZHo,"findFirstMin");function XHo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(XHo,"findMaxIdx");function eGo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(eGo,"mapFindFirst")});var Rs=I(Ro=>{"use strict";p();Object.defineProperty(Ro,"__esModule",{value:!0});Ro.BugIndicatingError=Ro.ErrorNoTelemetry=Ro.ExpectedError=Ro.NotSupportedError=Ro.NotImplementedError=Ro.ReadonlyError=Ro.PendingMigrationError=Ro.CancellationError=Ro.canceledName=Ro.errorHandler=Ro.ErrorHandler=void 0;Ro.setUnexpectedErrorHandler=tGo;Ro.isSigPipeError=rGo;Ro.onBugIndicatingError=nGo;Ro.onUnexpectedError=iGo;Ro.onUnexpectedExternalError=oGo;Ro.transformErrorForSerialization=obn;Ro.transformErrorFromSerialization=sbn;Ro.isCancellationError=Wqt;Ro.canceled=sGo;Ro.illegalArgument=aGo;Ro.illegalState=cGo;Ro.getErrorMessage=lGo;var xJe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?zK.isErrorNoTelemetry(e)?new zK(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)}};wo.ErrorHandler=SJe;wo.errorHandler=new SJe;function JHo(t){wo.errorHandler.setUnexpectedErrorHandler(t)}a(JHo,"setUnexpectedErrorHandler");function ZHo(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(ZHo,"isSigPipeError");function XHo(t){wo.errorHandler.onUnexpectedError(t)}a(XHo,"onBugIndicatingError");function eGo(t){Vqt(t)||wo.errorHandler.onUnexpectedError(t)}a(eGo,"onUnexpectedError");function tGo(t){Vqt(t)||wo.errorHandler.onUnexpectedExternalError(t)}a(tGo,"onUnexpectedExternalError");function ibn(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:zK.isErrorNoTelemetry(t),cause:n?ibn(n):void 0,code:t.code}}return t}a(ibn,"transformErrorForSerialization");function obn(t){let e;return t.noTelemetry?e=new zK:(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=obn(t.cause)),e}a(obn,"transformErrorFromSerialization");wo.canceledName="Canceled";function Vqt(t){return t instanceof TJe?!0:t instanceof Error&&t.name===wo.canceledName&&t.message===wo.canceledName}a(Vqt,"isCancellationError");var TJe=class extends Error{static{a(this,"CancellationError")}constructor(){super(wo.canceledName),this.name=this.message}};wo.CancellationError=TJe;var Qqt=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}};wo.PendingMigrationError=Qqt;function rGo(){let t=new Error(wo.canceledName);return t.name=t.message,t}a(rGo,"canceled");function nGo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(nGo,"illegalArgument");function iGo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(iGo,"illegalState");var qqt=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};wo.ReadonlyError=qqt;function oGo(t){return t?t.message?t.message:t.stack?t.stack.split(` -`)[0]:String(t):"Error"}a(oGo,"getErrorMessage");var jqt=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};wo.NotImplementedError=jqt;var Hqt=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};wo.NotSupportedError=Hqt;var Gqt=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};wo.ExpectedError=Gqt;var zK=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"}};wo.ErrorNoTelemetry=zK;var $qt=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};wo.BugIndicatingError=$qt});var Sl=I(Wn=>{"use strict";p();Object.defineProperty(Wn,"__esModule",{value:!0});Wn.Permutation=Wn.CallbackIterable=Wn.ArrayQueue=Wn.booleanComparator=Wn.numberComparator=Wn.CompareResult=void 0;Wn.tail=cGo;Wn.equals=lGo;Wn.removeFastWithoutKeepingOrder=uGo;Wn.binarySearch=dGo;Wn.binarySearch2=sbn;Wn.quickSelect=Wqt;Wn.groupBy=fGo;Wn.groupAdjacentBy=pGo;Wn.forEachAdjacent=hGo;Wn.forEachWithNeighbors=mGo;Wn.concatArrays=gGo;Wn.sortedDiff=abn;Wn.delta=AGo;Wn.top=yGo;Wn.topAsync=EGo;Wn.coalesce=_Go;Wn.coalesceInPlace=vGo;Wn.move=CGo;Wn.isFalsyOrEmpty=bGo;Wn.isNonEmptyArray=SGo;Wn.distinct=TGo;Wn.uniqueFilter=IGo;Wn.commonPrefixLength=xGo;Wn.range=wGo;Wn.index=RGo;Wn.insert=kGo;Wn.remove=lbn;Wn.arrayInsert=PGo;Wn.shuffle=DGo;Wn.pushToStart=NGo;Wn.pushToEnd=MGo;Wn.pushMany=OGo;Wn.mapArrayOrNot=LGo;Wn.mapFilter=BGo;Wn.withoutDuplicates=FGo;Wn.asArray=UGo;Wn.getRandomElement=QGo;Wn.insertInto=ubn;Wn.splice=qGo;Wn.compareBy=jGo;Wn.tieBreakComparators=HGo;Wn.reverseOrder=VGo;Wn.compareUndefinedSmallest=WGo;Wn.findAsync=zGo;Wn.sum=YGo;Wn.sumBy=KGo;var sGo=xq(),aGo=Rs();function cGo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(cGo,"tail");function lGo(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(dGo,"binarySearch");function sbn(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(sbn,"binarySearch2");function Wqt(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(abn,"sortedDiff");function AGo(t,e,r){let n=abn(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(AGo,"delta");function yGo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return cbn(t,e,n,r,t.length),n}a(yGo,"top");function EGo(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 aGo.CancellationError;cbn(t,e,u,d,f)}return u})().then(s,c)})}a(EGo,"topAsync");function cbn(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(cbn,"topStep");function _Go(t){return t.filter(e=>!!e)}a(_Go,"coalesce");function vGo(t){let e=0;for(let r=0;r0}a(SGo,"isNonEmptyArray");function TGo(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(TGo,"distinct");function IGo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(IGo,"uniqueFilter");function xGo(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(wGo,"range");function RGo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(RGo,"index");function kGo(t,e){return t.push(e),()=>lbn(t,e)}a(kGo,"insert");function lbn(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(lbn,"remove");function PGo(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(PGo,"arrayInsert");function DGo(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(DGo,"shuffle");function NGo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(NGo,"pushToStart");function MGo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(MGo,"pushToEnd");function OGo(t,e){for(let r of e)t.push(r)}a(OGo,"pushMany");function LGo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(LGo,"mapArrayOrNot");function BGo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(BGo,"mapFilter");function FGo(t){let e=new Set(t);return Array.from(e)}a(FGo,"withoutDuplicates");function UGo(t){return Array.isArray(t)?t:[t]}a(UGo,"asArray");function QGo(t){return t[Math.floor(Math.random()*t.length)]}a(QGo,"getRandomElement");function ubn(t,e,r){let n=dbn(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})(wq||(Wn.CompareResult=wq={}));function jGo(t,e){return(r,n)=>e(t(r),t(n))}a(jGo,"compareBy");function HGo(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!wq.isNeitherLessOrGreaterThan(o))return o}return wq.neitherLessOrGreaterThan}}a(HGo,"tieBreakComparators");var GGo=a((t,e)=>t-e,"numberComparator");Wn.numberComparator=GGo;var $Go=a((t,e)=>(0,Wn.numberComparator)(t?1:0,e?1:0),"booleanComparator");Wn.booleanComparator=$Go;function VGo(t){return(e,r)=>-t(e,r)}a(VGo,"reverseOrder");function WGo(t){return(e,r)=>e===void 0?r===void 0?wq.neitherLessOrGreaterThan:wq.lessThan:r===void 0?wq.greaterThan:t(e,r)}a(WGo,"compareUndefinedSmallest");var zqt=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}};Wn.ArrayQueue=zqt;var Yqt=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||wq.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};Wn.CallbackIterable=Yqt;var Kqt=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(zGo,"findAsync");function YGo(t){return t.reduce((e,r)=>e+r,0)}a(YGo,"sum");function KGo(t,e){return t.reduce((r,n)=>r+e(n),0)}a(KGo,"sumBy")});var Xqt=I(V3=>{"use strict";p();var pbn;Object.defineProperty(V3,"__esModule",{value:!0});V3.SetWithKey=void 0;V3.groupBy=XGo;V3.groupByMap=e$o;V3.diffSets=t$o;V3.diffMaps=r$o;V3.intersection=n$o;function XGo(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(XGo,"groupBy");function e$o(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(e$o,"groupByMap");function t$o(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(t$o,"diffSets");function r$o(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(r$o,"diffMaps");function n$o(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(n$o,"intersection");var Zqt=class{static{a(this,"SetWithKey")}static{pbn=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[pbn]="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()}};V3.SetWithKey=Zqt});var tjt=I(ejt=>{"use strict";p();Object.defineProperty(ejt,"__esModule",{value:!0});ejt.createSingleCallFunction=i$o;function i$o(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(i$o,"createSingleCallFunction")});var zP=I(Ud=>{"use strict";p();var hbn,mbn,gbn;Object.defineProperty(Ud,"__esModule",{value:!0});Ud.NKeyMap=Ud.SetMap=Ud.BidirectionalMap=Ud.CounterSet=Ud.MRUCache=Ud.LRUCache=Ud.LinkedMap=Ud.ResourceSet=Ud.ResourceMap=void 0;Ud.getOrSet=o$o;Ud.mapToString=s$o;Ud.setToString=a$o;Ud.mapsStrictEqualIgnoreOrder=l$o;function o$o(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(o$o,"getOrSet");function s$o(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(s$o,"mapToString");function a$o(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(a$o,"setToString");var rjt=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function c$o(t){return Array.isArray(t)}a(c$o,"isEntries");var Jxe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[hbn]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(c$o(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 rjt(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]}*[(hbn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Ud.ResourceMap=Jxe;var njt=class{static{a(this,"ResourceSet")}constructor(e,r){this[mbn]="ResourceSet",!e||typeof e=="function"?this._map=new Jxe(e):(this._map=new Jxe(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()}[(mbn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};Ud.ResourceSet=njt;var IJe=class{static{a(this,"LinkedMap")}constructor(){this[gbn]="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}[(gbn=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)}};Ud.LinkedMap=IJe;var xJe=class extends IJe{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))}},ijt=class extends xJe{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}};Ud.LRUCache=ijt;var ojt=class extends xJe{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}};Ud.MRUCache=ojt;var sjt=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)}};Ud.CounterSet=sjt;var ajt=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()}};Ud.BidirectionalMap=ajt;var cjt=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}};Ud.SetMap=cjt;function l$o(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(l$o,"mapsStrictEqualIgnoreOrder");var ljt=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)}};Ro.ErrorHandler=xJe;Ro.errorHandler=new xJe;function tGo(t){Ro.errorHandler.setUnexpectedErrorHandler(t)}a(tGo,"setUnexpectedErrorHandler");function rGo(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(rGo,"isSigPipeError");function nGo(t){Ro.errorHandler.onUnexpectedError(t)}a(nGo,"onBugIndicatingError");function iGo(t){Wqt(t)||Ro.errorHandler.onUnexpectedError(t)}a(iGo,"onUnexpectedError");function oGo(t){Wqt(t)||Ro.errorHandler.onUnexpectedExternalError(t)}a(oGo,"onUnexpectedExternalError");function obn(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:zK.isErrorNoTelemetry(t),cause:n?obn(n):void 0,code:t.code}}return t}a(obn,"transformErrorForSerialization");function sbn(t){let e;return t.noTelemetry?e=new zK:(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=sbn(t.cause)),e}a(sbn,"transformErrorFromSerialization");Ro.canceledName="Canceled";function Wqt(t){return t instanceof wJe?!0:t instanceof Error&&t.name===Ro.canceledName&&t.message===Ro.canceledName}a(Wqt,"isCancellationError");var wJe=class extends Error{static{a(this,"CancellationError")}constructor(){super(Ro.canceledName),this.name=this.message}};Ro.CancellationError=wJe;var qqt=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}};Ro.PendingMigrationError=qqt;function sGo(){let t=new Error(Ro.canceledName);return t.name=t.message,t}a(sGo,"canceled");function aGo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(aGo,"illegalArgument");function cGo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(cGo,"illegalState");var jqt=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};Ro.ReadonlyError=jqt;function lGo(t){return t?t.message?t.message:t.stack?t.stack.split(` +`)[0]:String(t):"Error"}a(lGo,"getErrorMessage");var Hqt=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};Ro.NotImplementedError=Hqt;var Gqt=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};Ro.NotSupportedError=Gqt;var $qt=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};Ro.ExpectedError=$qt;var zK=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"}};Ro.ErrorNoTelemetry=zK;var Vqt=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};Ro.BugIndicatingError=Vqt});var Sl=I(Wn=>{"use strict";p();Object.defineProperty(Wn,"__esModule",{value:!0});Wn.Permutation=Wn.CallbackIterable=Wn.ArrayQueue=Wn.booleanComparator=Wn.numberComparator=Wn.CompareResult=void 0;Wn.tail=fGo;Wn.equals=pGo;Wn.removeFastWithoutKeepingOrder=hGo;Wn.binarySearch=mGo;Wn.binarySearch2=abn;Wn.quickSelect=zqt;Wn.groupBy=gGo;Wn.groupAdjacentBy=AGo;Wn.forEachAdjacent=yGo;Wn.forEachWithNeighbors=EGo;Wn.concatArrays=_Go;Wn.sortedDiff=cbn;Wn.delta=vGo;Wn.top=CGo;Wn.topAsync=bGo;Wn.coalesce=SGo;Wn.coalesceInPlace=TGo;Wn.move=IGo;Wn.isFalsyOrEmpty=xGo;Wn.isNonEmptyArray=wGo;Wn.distinct=RGo;Wn.uniqueFilter=kGo;Wn.commonPrefixLength=PGo;Wn.range=DGo;Wn.index=NGo;Wn.insert=MGo;Wn.remove=ubn;Wn.arrayInsert=OGo;Wn.shuffle=LGo;Wn.pushToStart=BGo;Wn.pushToEnd=FGo;Wn.pushMany=UGo;Wn.mapArrayOrNot=QGo;Wn.mapFilter=qGo;Wn.withoutDuplicates=jGo;Wn.asArray=HGo;Wn.getRandomElement=GGo;Wn.insertInto=dbn;Wn.splice=$Go;Wn.compareBy=VGo;Wn.tieBreakComparators=WGo;Wn.reverseOrder=KGo;Wn.compareUndefinedSmallest=JGo;Wn.findAsync=ZGo;Wn.sum=XGo;Wn.sumBy=e$o;var uGo=wq(),dGo=Rs();function fGo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(fGo,"tail");function pGo(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(mGo,"binarySearch");function abn(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(abn,"binarySearch2");function zqt(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(cbn,"sortedDiff");function vGo(t,e,r){let n=cbn(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(vGo,"delta");function CGo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return lbn(t,e,n,r,t.length),n}a(CGo,"top");function bGo(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 dGo.CancellationError;lbn(t,e,u,d,f)}return u})().then(s,c)})}a(bGo,"topAsync");function lbn(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(lbn,"topStep");function SGo(t){return t.filter(e=>!!e)}a(SGo,"coalesce");function TGo(t){let e=0;for(let r=0;r0}a(wGo,"isNonEmptyArray");function RGo(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(RGo,"distinct");function kGo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(kGo,"uniqueFilter");function PGo(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(DGo,"range");function NGo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(NGo,"index");function MGo(t,e){return t.push(e),()=>ubn(t,e)}a(MGo,"insert");function ubn(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(ubn,"remove");function OGo(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(OGo,"arrayInsert");function LGo(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(LGo,"shuffle");function BGo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(BGo,"pushToStart");function FGo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(FGo,"pushToEnd");function UGo(t,e){for(let r of e)t.push(r)}a(UGo,"pushMany");function QGo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(QGo,"mapArrayOrNot");function qGo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(qGo,"mapFilter");function jGo(t){let e=new Set(t);return Array.from(e)}a(jGo,"withoutDuplicates");function HGo(t){return Array.isArray(t)?t:[t]}a(HGo,"asArray");function GGo(t){return t[Math.floor(Math.random()*t.length)]}a(GGo,"getRandomElement");function dbn(t,e,r){let n=fbn(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})(Rq||(Wn.CompareResult=Rq={}));function VGo(t,e){return(r,n)=>e(t(r),t(n))}a(VGo,"compareBy");function WGo(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!Rq.isNeitherLessOrGreaterThan(o))return o}return Rq.neitherLessOrGreaterThan}}a(WGo,"tieBreakComparators");var zGo=a((t,e)=>t-e,"numberComparator");Wn.numberComparator=zGo;var YGo=a((t,e)=>(0,Wn.numberComparator)(t?1:0,e?1:0),"booleanComparator");Wn.booleanComparator=YGo;function KGo(t){return(e,r)=>-t(e,r)}a(KGo,"reverseOrder");function JGo(t){return(e,r)=>e===void 0?r===void 0?Rq.neitherLessOrGreaterThan:Rq.lessThan:r===void 0?Rq.greaterThan:t(e,r)}a(JGo,"compareUndefinedSmallest");var Yqt=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}};Wn.ArrayQueue=Yqt;var Kqt=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||Rq.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};Wn.CallbackIterable=Kqt;var Jqt=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(ZGo,"findAsync");function XGo(t){return t.reduce((e,r)=>e+r,0)}a(XGo,"sum");function e$o(t,e){return t.reduce((r,n)=>r+e(n),0)}a(e$o,"sumBy")});var ejt=I(W3=>{"use strict";p();var hbn;Object.defineProperty(W3,"__esModule",{value:!0});W3.SetWithKey=void 0;W3.groupBy=n$o;W3.groupByMap=i$o;W3.diffSets=o$o;W3.diffMaps=s$o;W3.intersection=a$o;function n$o(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(n$o,"groupBy");function i$o(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(i$o,"groupByMap");function o$o(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(o$o,"diffSets");function s$o(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(s$o,"diffMaps");function a$o(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(a$o,"intersection");var Xqt=class{static{a(this,"SetWithKey")}static{hbn=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[hbn]="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()}};W3.SetWithKey=Xqt});var rjt=I(tjt=>{"use strict";p();Object.defineProperty(tjt,"__esModule",{value:!0});tjt.createSingleCallFunction=c$o;function c$o(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(c$o,"createSingleCallFunction")});var YP=I(Ud=>{"use strict";p();var mbn,gbn,Abn;Object.defineProperty(Ud,"__esModule",{value:!0});Ud.NKeyMap=Ud.SetMap=Ud.BidirectionalMap=Ud.CounterSet=Ud.MRUCache=Ud.LRUCache=Ud.LinkedMap=Ud.ResourceSet=Ud.ResourceMap=void 0;Ud.getOrSet=l$o;Ud.mapToString=u$o;Ud.setToString=d$o;Ud.mapsStrictEqualIgnoreOrder=p$o;function l$o(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(l$o,"getOrSet");function u$o(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(u$o,"mapToString");function d$o(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(d$o,"setToString");var njt=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function f$o(t){return Array.isArray(t)}a(f$o,"isEntries");var Jxe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[mbn]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(f$o(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 njt(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]}*[(mbn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Ud.ResourceMap=Jxe;var ijt=class{static{a(this,"ResourceSet")}constructor(e,r){this[gbn]="ResourceSet",!e||typeof e=="function"?this._map=new Jxe(e):(this._map=new Jxe(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()}[(gbn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};Ud.ResourceSet=ijt;var RJe=class{static{a(this,"LinkedMap")}constructor(){this[Abn]="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}[(Abn=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)}};Ud.LinkedMap=RJe;var kJe=class extends RJe{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))}},ojt=class extends kJe{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}};Ud.LRUCache=ojt;var sjt=class extends kJe{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}};Ud.MRUCache=sjt;var ajt=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)}};Ud.CounterSet=ajt;var cjt=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()}};Ud.BidirectionalMap=cjt;var ljt=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}};Ud.SetMap=ljt;function p$o(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(p$o,"mapsStrictEqualIgnoreOrder");var ujt=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)}};Ud.NKeyMap=ljt});var rd=I(W3=>{"use strict";p();Object.defineProperty(W3,"__esModule",{value:!0});W3.ok=u$o;W3.assertNever=d$o;W3.softAssertNever=f$o;W3.assert=p$o;W3.softAssert=h$o;W3.assertFn=m$o;W3.checkAdjacentItems=g$o;var Zxe=Rs();function u$o(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(u$o,"ok");function d$o(t,e="Unreachable"){throw new Error(e)}a(d$o,"assertNever");function f$o(t){}a(f$o,"softAssertNever");function p$o(t,e="unexpected state"){if(!t)throw typeof e=="string"?new Zxe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(p$o,"assert");function h$o(t,e="Soft Assertion Failed"){t||(0,Zxe.onUnexpectedError)(new Zxe.BugIndicatingError(e))}a(h$o,"softAssert");function m$o(t){if(!t()){debugger;t(),(0,Zxe.onUnexpectedError)(new Zxe.BugIndicatingError("Assertion Failed"))}}a(m$o,"assertFn");function g$o(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(Tl,"__esModule",{value:!0});Tl.isOneOf=void 0;Tl.isString=ujt;Tl.isStringArray=y$o;Tl.isArrayOf=Abn;Tl.isObject=ybn;Tl.isTypedArray=E$o;Tl.isNumber=_$o;Tl.isIterable=v$o;Tl.isAsyncIterable=C$o;Tl.isBoolean=b$o;Tl.isUndefined=Ebn;Tl.isDefined=S$o;Tl.isUndefinedOrNull=wJe;Tl.assertType=T$o;Tl.assertReturnsDefined=I$o;Tl.assertDefined=x$o;Tl.assertReturnsAllDefined=w$o;Tl.typeCheck=k$o;Tl.isEmptyObject=D$o;Tl.isFunction=djt;Tl.areFunctions=N$o;Tl.validateConstraints=M$o;Tl.validateConstraint=_bn;Tl.upcast=O$o;Tl.hasKey=L$o;var A$o=rd();function ujt(t){return typeof t=="string"}a(ujt,"isString");function y$o(t){return Abn(t,ujt)}a(y$o,"isStringArray");function Abn(t,e){return Array.isArray(t)&&t.every(e)}a(Abn,"isArrayOf");function ybn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(ybn,"isObject");function E$o(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(E$o,"isTypedArray");function _$o(t){return typeof t=="number"&&!isNaN(t)}a(_$o,"isNumber");function v$o(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(v$o,"isIterable");function C$o(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(C$o,"isAsyncIterable");function b$o(t){return t===!0||t===!1}a(b$o,"isBoolean");function Ebn(t){return typeof t>"u"}a(Ebn,"isUndefined");function S$o(t){return!wJe(t)}a(S$o,"isDefined");function wJe(t){return Ebn(t)||t===null}a(wJe,"isUndefinedOrNull");function T$o(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(T$o,"assertType");function I$o(t){return(0,A$o.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(I$o,"assertReturnsDefined");function x$o(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(x$o,"assertDefined");function w$o(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");Tl.isOneOf=R$o;function k$o(t){}a(k$o,"typeCheck");var P$o=Object.prototype.hasOwnProperty;function D$o(t){if(!ybn(t))return!1;for(let e in t)if(P$o.call(t,e))return!1;return!0}a(D$o,"isEmptyObject");function djt(t){return typeof t=="function"}a(djt,"isFunction");function N$o(...t){return t.length>0&&t.every(djt)}a(N$o,"areFunctions");function M$o(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(RJe,"__esModule",{value:!0});RJe.Iterable=void 0;var B$o=KS(),vbn;(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 P=x.length-1;P>=0;P--)yield x[P]}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,P){let D=0;for(let N of x)if(P(N,D++))return!0;return!1}a(f,"some"),t.some=f;function h(x,P){let D=0;for(let N of x)if(!P(N,D++))return!1;return!0}a(h,"every"),t.every=h;function m(x,P){for(let D of x)if(P(D))return D}a(m,"find"),t.find=m;function*g(x,P){for(let D of x)P(D)&&(yield D)}a(g,"filter"),t.filter=g;function*A(x,P){let D=0;for(let N of x)yield P(N,D++)}a(A,"map"),t.map=A;function*y(x,P){let D=0;for(let N of x)yield*P(N,D++)}a(y,"flatMap"),t.flatMap=y;function*E(...x){for(let P of x)(0,B$o.isIterable)(P)?yield*P:yield P}a(E,"concat"),t.concat=E;function _(x,P,D){let N=D;for(let L of x)N=P(N,L);return N}a(_,"reduce"),t.reduce=_;function v(x){let P=0;for(let D of x)P++;return P}a(v,"length"),t.length=v;function*b(x,P,D=x.length){for(P<-x.length&&(P=0),P<0&&(P+=x.length),D<0?D+=x.length:D>x.length&&(D=x.length);P{"use strict";p();Object.defineProperty(hs,"__esModule",{value:!0});hs.DisposableResourceMap=hs.DisposableSet=hs.DisposableMap=hs.ImmortalReference=hs.AsyncReferenceCollection=hs.ReferenceCollection=hs.RefCountedDisposable=hs.MandatoryMutableDisposable=hs.MutableDisposable=hs.Disposable=hs.DisposableStore=hs.DisposableTracker=hs.GCBasedDisposableTracker=void 0;hs.setDisposableTracker=Tbn;hs.trackDisposable=KK;hs.markAsDisposed=JK;hs.markAsSingleton=H$o;hs.isDisposable=Ibn;hs.dispose=ewe;hs.disposeIfDisposable=G$o;hs.combinedDisposable=$$o;hs.toDisposable=bjt;hs.disposeOnReturn=V$o;hs.thenIfNotDisposed=W$o;hs.thenRegisterOrDispose=z$o;var Cbn=Sl(),F$o=Xqt(),Sbn=zP(),U$o=tjt(),Q$o=fjt(),bbn=Rs(),q$o=!1,YK=null,pjt=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)}};hs.GCBasedDisposableTracker=pjt;var hjt=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 Sbn.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,Cbn.compareBy)(u=>u.idx,Cbn.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(z3,"__esModule",{value:!0});z3.ok=h$o;z3.assertNever=m$o;z3.softAssertNever=g$o;z3.assert=A$o;z3.softAssert=y$o;z3.assertFn=E$o;z3.checkAdjacentItems=_$o;var Zxe=Rs();function h$o(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(h$o,"ok");function m$o(t,e="Unreachable"){throw new Error(e)}a(m$o,"assertNever");function g$o(t){}a(g$o,"softAssertNever");function A$o(t,e="unexpected state"){if(!t)throw typeof e=="string"?new Zxe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(A$o,"assert");function y$o(t,e="Soft Assertion Failed"){t||(0,Zxe.onUnexpectedError)(new Zxe.BugIndicatingError(e))}a(y$o,"softAssert");function E$o(t){if(!t()){debugger;t(),(0,Zxe.onUnexpectedError)(new Zxe.BugIndicatingError("Assertion Failed"))}}a(E$o,"assertFn");function _$o(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(Tl,"__esModule",{value:!0});Tl.isOneOf=void 0;Tl.isString=djt;Tl.isStringArray=C$o;Tl.isArrayOf=ybn;Tl.isObject=Ebn;Tl.isTypedArray=b$o;Tl.isNumber=S$o;Tl.isIterable=T$o;Tl.isAsyncIterable=I$o;Tl.isBoolean=x$o;Tl.isUndefined=_bn;Tl.isDefined=w$o;Tl.isUndefinedOrNull=PJe;Tl.assertType=R$o;Tl.assertReturnsDefined=k$o;Tl.assertDefined=P$o;Tl.assertReturnsAllDefined=D$o;Tl.typeCheck=M$o;Tl.isEmptyObject=L$o;Tl.isFunction=fjt;Tl.areFunctions=B$o;Tl.validateConstraints=F$o;Tl.validateConstraint=vbn;Tl.upcast=U$o;Tl.hasKey=Q$o;var v$o=rd();function djt(t){return typeof t=="string"}a(djt,"isString");function C$o(t){return ybn(t,djt)}a(C$o,"isStringArray");function ybn(t,e){return Array.isArray(t)&&t.every(e)}a(ybn,"isArrayOf");function Ebn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Ebn,"isObject");function b$o(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(b$o,"isTypedArray");function S$o(t){return typeof t=="number"&&!isNaN(t)}a(S$o,"isNumber");function T$o(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(T$o,"isIterable");function I$o(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(I$o,"isAsyncIterable");function x$o(t){return t===!0||t===!1}a(x$o,"isBoolean");function _bn(t){return typeof t>"u"}a(_bn,"isUndefined");function w$o(t){return!PJe(t)}a(w$o,"isDefined");function PJe(t){return _bn(t)||t===null}a(PJe,"isUndefinedOrNull");function R$o(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(R$o,"assertType");function k$o(t){return(0,v$o.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(k$o,"assertReturnsDefined");function P$o(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(P$o,"assertDefined");function D$o(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");Tl.isOneOf=N$o;function M$o(t){}a(M$o,"typeCheck");var O$o=Object.prototype.hasOwnProperty;function L$o(t){if(!Ebn(t))return!1;for(let e in t)if(O$o.call(t,e))return!1;return!0}a(L$o,"isEmptyObject");function fjt(t){return typeof t=="function"}a(fjt,"isFunction");function B$o(...t){return t.length>0&&t.every(fjt)}a(B$o,"areFunctions");function F$o(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(DJe,"__esModule",{value:!0});DJe.Iterable=void 0;var q$o=ZS(),Cbn;(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 P=x.length-1;P>=0;P--)yield x[P]}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,P){let D=0;for(let N of x)if(P(N,D++))return!0;return!1}a(f,"some"),t.some=f;function h(x,P){let D=0;for(let N of x)if(!P(N,D++))return!1;return!0}a(h,"every"),t.every=h;function m(x,P){for(let D of x)if(P(D))return D}a(m,"find"),t.find=m;function*g(x,P){for(let D of x)P(D)&&(yield D)}a(g,"filter"),t.filter=g;function*A(x,P){let D=0;for(let N of x)yield P(N,D++)}a(A,"map"),t.map=A;function*y(x,P){let D=0;for(let N of x)yield*P(N,D++)}a(y,"flatMap"),t.flatMap=y;function*E(...x){for(let P of x)(0,q$o.isIterable)(P)?yield*P:yield P}a(E,"concat"),t.concat=E;function _(x,P,D){let N=D;for(let L of x)N=P(N,L);return N}a(_,"reduce"),t.reduce=_;function v(x){let P=0;for(let D of x)P++;return P}a(v,"length"),t.length=v;function*b(x,P,D=x.length){for(P<-x.length&&(P=0),P<0&&(P+=x.length),D<0?D+=x.length:D>x.length&&(D=x.length);P{"use strict";p();Object.defineProperty(hs,"__esModule",{value:!0});hs.DisposableResourceMap=hs.DisposableSet=hs.DisposableMap=hs.ImmortalReference=hs.AsyncReferenceCollection=hs.ReferenceCollection=hs.RefCountedDisposable=hs.MandatoryMutableDisposable=hs.MutableDisposable=hs.Disposable=hs.DisposableStore=hs.DisposableTracker=hs.GCBasedDisposableTracker=void 0;hs.setDisposableTracker=Ibn;hs.trackDisposable=KK;hs.markAsDisposed=JK;hs.markAsSingleton=W$o;hs.isDisposable=xbn;hs.dispose=ewe;hs.disposeIfDisposable=z$o;hs.combinedDisposable=Y$o;hs.toDisposable=Sjt;hs.disposeOnReturn=K$o;hs.thenIfNotDisposed=J$o;hs.thenRegisterOrDispose=Z$o;var bbn=Sl(),j$o=ejt(),Tbn=YP(),H$o=rjt(),G$o=pjt(),Sbn=Rs(),$$o=!1,YK=null,hjt=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)}};hs.GCBasedDisposableTracker=hjt;var mjt=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 Tbn.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,bbn.compareBy)(u=>u.idx,bbn.numberComparator));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;ho(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))_&&f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` +`)),y=(0,j$o.groupBy)([...A].map(E=>o(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))_&&f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` ==================== Leaking disposable ${l}/${n.length}: ${u.value.constructor.name} ==================== @@ -100,129 +100,129 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};hs.DisposableTracker=hjt;function Tbn(t){YK=t}a(Tbn,"setDisposableTracker");if(q$o){let t="__is_disposable_tracked__";Tbn(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!==_ue.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==_ue.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function KK(t){return YK?.trackDisposable(t),t}a(KK,"trackDisposable");function JK(t){YK?.markAsDisposed(t)}a(JK,"markAsDisposed");function z3(t,e){YK?.setParent(t,e)}a(z3,"setParentOfDisposable");function j$o(t,e){if(YK)for(let r of t)YK.setParent(r,e)}a(j$o,"setParentOfDisposables");function H$o(t){return YK?.markAsSingleton(t),t}a(H$o,"markAsSingleton");function Ibn(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(Ibn,"isDisposable");function ewe(t){if(Q$o.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(ewe,"dispose");function G$o(t){for(let e of t)Ibn(e)&&e.dispose();return[]}a(G$o,"disposeIfDisposable");function $$o(...t){let e=bjt(()=>ewe(t));return j$o(t,e),e}a($$o,"combinedDisposable");var mjt=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,KK(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,JK(this),this._fn()}}};function bjt(t){return new mjt(t)}a(bjt,"toDisposable");var Xxe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,KK(this)}dispose(){this._isDisposed||(JK(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ewe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===_ue.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return z3(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)&&z3(e,null)}assertNotDisposed(){this._isDisposed&&(0,bbn.onUnexpectedError)(new bbn.BugIndicatingError("Object disposed"))}};hs.DisposableStore=Xxe;var _ue=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new Xxe,KK(this),z3(this._store,this)}dispose(){JK(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};hs.Disposable=_ue;var kJe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,KK(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&z3(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,JK(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&z3(e,null),e}};hs.MutableDisposable=kJe;var gjt=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new kJe,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()}};hs.MandatoryMutableDisposable=gjt;var Ajt=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}};hs.RefCountedDisposable=Ajt;var yjt=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,U$o.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};hs.ReferenceCollection=yjt;var Ejt=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}}};hs.AsyncReferenceCollection=Ejt;var _jt=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};hs.ImmortalReference=_jt;function V$o(t){let e=new Xxe;try{t(e)}finally{e.dispose()}}a(V$o,"disposeOnReturn");var PJe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,KK(this)}dispose(){JK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ewe(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),z3(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&z3(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};hs.DisposableMap=PJe;var vjt=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,KK(this)}dispose(){JK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ewe(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),z3(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return z3(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};hs.DisposableSet=vjt;function W$o(t,e){let r=!1;return t.then(n=>{r||e(n)}),bjt(()=>{r=!0})}a(W$o,"thenIfNotDisposed");function z$o(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(z$o,"thenRegisterOrDispose");var Cjt=class extends PJe{static{a(this,"DisposableResourceMap")}constructor(){super(new Sbn.ResourceMap)}};hs.DisposableResourceMap=Cjt});var vue=I(DJe=>{"use strict";p();Object.defineProperty(DJe,"__esModule",{value:!0});DJe.LinkedList=void 0;var yu=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}},Sjt=class{static{a(this,"LinkedList")}constructor(){this._first=yu.Undefined,this._last=yu.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===yu.Undefined}clear(){let e=this._first;for(;e!==yu.Undefined;){let r=e.next;e.prev=yu.Undefined,e.next=yu.Undefined,e=r}this._first=yu.Undefined,this._last=yu.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new yu(e);if(this._first===yu.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!==yu.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==yu.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==yu.Undefined)return this._last.element}_remove(e){if(e.prev!==yu.Undefined&&e.next!==yu.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===yu.Undefined&&e.next===yu.Undefined?(this._first=yu.Undefined,this._last=yu.Undefined):e.next===yu.Undefined?(this._last=this._last.prev,this._last.next=yu.Undefined):e.prev===yu.Undefined&&(this._first=this._first.next,this._first.prev=yu.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==yu.Undefined;)yield e.element,e=e.next}};DJe.LinkedList=Sjt});var kbn=I(Cue=>{"use strict";p();Object.defineProperty(Cue,"__esModule",{value:!0});Cue.getNLSMessages=xbn;Cue.getNLSLanguage=wbn;Cue.localize=K$o;Cue.localize2=J$o;function xbn(){return globalThis._VSCODE_NLS_MESSAGES}a(xbn,"getNLSMessages");function wbn(){return globalThis._VSCODE_NLS_LANGUAGE}a(wbn,"getNLSLanguage");var Y$o=wbn()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function NJe(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}),Y$o&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(NJe,"_format");function K$o(t,e,...r){return NJe(typeof t=="number"?Rbn(t,e):e,r)}a(K$o,"localize");function Rbn(t,e){let r=xbn()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(Rbn,"lookupMessage");function J$o(t,e,...r){let n;typeof t=="number"?n=Rbn(t,e):n=e;let o=NJe(n,r);return{value:o,original:e===n?o:NJe(e,r)}}a(J$o,"localize2")});var Rq=I(pr=>{"use strict";p();var Z$o=pr&&pr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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$o=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),eVo=pr&&pr.__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,iwe=Y3.indexOf("Macintosh")>=0,xjt=(Y3.indexOf("Macintosh")>=0||Y3.indexOf("iPad")>=0||Y3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,rwe=Y3.indexOf("Linux")>=0,Fbn=Y3?.indexOf("Mobi")>=0,Ijt=!0,MJe=tVo.getNLSLanguage()||pr.LANGUAGE_DEFAULT,twe=navigator.language.toLowerCase(),Tjt=twe):console.error("Unable to resolve platform.");function nVo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(nVo,"PlatformToString");var OJe=0;iwe?OJe=1:nwe?OJe=3:rwe&&(OJe=2);pr.isWindows=nwe;pr.isMacintosh=iwe;pr.isLinux=rwe;pr.isLinuxSnap=Mbn;pr.isNative=Obn;pr.isElectron=Lbn;pr.isWeb=Ijt;pr.isWebWorker=Ijt&&typeof K3.importScripts=="function";pr.webWorkerOrigin=pr.isWebWorker?K3.origin:void 0;pr.isIOS=xjt;pr.isMobile=Fbn;pr.isCI=Bbn;pr.platform=OJe;pr.userAgent=Y3;pr.language=MJe;var Pbn;(function(t){function e(){return pr.language}a(e,"value"),t.value=e;function r(){return pr.language.length===2?pr.language==="en":pr.language.length>=3?pr.language[0]==="e"&&pr.language[1]==="n"&&pr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return pr.language==="en"}a(n,"isDefault"),t.isDefault=n})(Pbn||(pr.Language=Pbn={}));pr.locale=twe;pr.platformLocale=Tjt;pr.translationsConfigFile=Ubn;pr.setTimeout0IsFaster=typeof K3.postMessage=="function"&&!K3.importScripts;pr.setTimeout0=(()=>{if(pr.setTimeout0IsFaster){let t=[];K3.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}),K3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();pr.OS=iwe||xjt?2:nwe?1:3;var Dbn=!0,Nbn=!1;function iVo(){if(!Nbn){Nbn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,Dbn=new Uint16Array(t.buffer)[0]===513}return Dbn}a(iVo,"isLittleEndian");pr.isChrome=!!(pr.userAgent&&pr.userAgent.indexOf("Chrome")>=0);pr.isFirefox=!!(pr.userAgent&&pr.userAgent.indexOf("Firefox")>=0);pr.isSafari=!!(!pr.isChrome&&pr.userAgent&&pr.userAgent.indexOf("Safari")>=0);pr.isEdge=!!(pr.userAgent&&pr.userAgent.indexOf("Edg/")>=0);pr.isAndroid=!!(pr.userAgent&&pr.userAgent.indexOf("Android")>=0);function oVo(t){return parseFloat(t)>=25}a(oVo,"isTahoeOrNewer")});var owe=I(BO=>{"use strict";p();Object.defineProperty(BO,"__esModule",{value:!0});BO.arch=BO.platform=BO.env=BO.cwd=void 0;var qbn=Rq(),ZK,wjt=globalThis.vscode;if(typeof wjt<"u"&&typeof wjt.process<"u"){let t=wjt.process;ZK={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"?ZK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:ZK={get platform(){return qbn.isWindows?"win32":qbn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};BO.cwd=ZK.cwd;BO.env=ZK.env;BO.platform=ZK.platform;BO.arch=ZK.arch});var FO=I(LJe=>{"use strict";p();Object.defineProperty(LJe,"__esModule",{value:!0});LJe.StopWatch=void 0;var sVo=globalThis.performance.now.bind(globalThis.performance),Rjt=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:sVo,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}};LJe.StopWatch=Rjt});var Ic=I(Ga=>{"use strict";p();Object.defineProperty(Ga,"__esModule",{value:!0});Ga.ValueWithChangeEvent=Ga.Relay=Ga.EventBufferer=Ga.DynamicListEventMultiplexer=Ga.EventMultiplexer=Ga.MicrotaskEmitter=Ga.DebounceEmitter=Ga.PauseableEmitter=Ga.AsyncEmitter=Ga.createEventDeliveryQueue=Ga.Emitter=Ga.ListenerRefusalError=Ga.ListenerLeakError=Ga.EventProfiling=Ga.Event=void 0;Ga.setGlobalLeakWarningThreshold=pVo;Ga.trackSetChanges=AVo;var aVo=Xqt(),swe=Rs(),cVo=tjt(),WC=Ro(),Vbn=vue(),lVo=owe(),uVo=FO(),jbn=!1,dVo=!1,fVo=100,Hbn=6e4;function Gbn(){return!!lVo.env.VSCODE_DEV}a(Gbn,"_isBufferLeakWarningEnabled");var BJe;(function(t){t.None=()=>WC.Disposable.None;function e(M){if(dVo){let{onDidAddListener:O}=M,j=Sue.create(),Q=0;M.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),j.print()),O?.()}}}a(e,"_addLeakageTraceLogic");function r(M,O,j){return g(M,()=>{},0,void 0,O??!0,void 0,j)}a(r,"defer"),t.defer=r;function n(M){return(O,j=null,Q)=>{let U=!1,Y;return Y=M(W=>{if(!U)return Y?Y.dispose():U=!0,O.call(j,W)},null,Q),U&&Y.dispose(),Y}}a(n,"once"),t.once=n;function o(M,O){return t.once(t.filter(M,O))}a(o,"onceIf"),t.onceIf=o;function s(M,O,j){return h((Q,U=null,Y)=>M(W=>Q.call(U,O(W)),null,Y),j)}a(s,"map"),t.map=s;function c(M,O,j){return h((Q,U=null,Y)=>M(W=>{O(W),Q.call(U,W)},null,Y),j)}a(c,"forEach"),t.forEach=c;function l(M,O,j){return h((Q,U=null,Y)=>M(W=>O(W)&&Q.call(U,W),null,Y),j)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(O,j=null,Q)=>{let U=(0,WC.combinedDisposable)(...M.map(Y=>Y(W=>O.call(j,W))));return m(U,Q)}}a(d,"any"),t.any=d;function f(M,O,j,Q){let U=j;return s(M,Y=>(U=O(U,Y),U),Q)}a(f,"reduce"),t.reduce=f;function h(M,O){let j,Q={onWillAddFirstListener(){j=M(U.fire,U)},onDidRemoveLastListener(){j?.dispose()}};O||e(Q);let U=new dE(Q);return O?.add(U),U.event}a(h,"snapshot");function m(M,O){return O instanceof Array?O.push(M):O&&O.add(M),M}a(m,"addAndReturnDisposable");function g(M,O,j=100,Q=!1,U=!1,Y,W){let V,z,ie,H=0,re,le={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(ge=>{H++,z=O(z,ge),Q&&!ie&&(Le.fire(z),z=void 0),re=a(()=>{let Ue=z;z=void 0,ie=void 0,(!Q||H>1)&&Le.fire(Ue),H=0},"doFire"),typeof j=="number"?(ie&&clearTimeout(ie),ie=setTimeout(re,j)):ie===void 0&&(ie=null,queueMicrotask(re))})},onWillRemoveListener(){U&&H>0&&re?.()},onDidRemoveLastListener(){re=void 0,V.dispose()}};W||e(le);let Le=new dE(le);return W?.add(Le),Le.event}a(g,"debounce"),t.debounce=g;function A(M,O=0,j,Q){return t.debounce(M,(U,Y)=>U?(U.push(Y),U):[Y],O,void 0,j??!0,void 0,Q)}a(A,"accumulate"),t.accumulate=A;function y(M,O,j=100,Q=!0,U=!0,Y,W){let V,z,ie,H=0,re={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(Le=>{H++,z=O(z,Le),ie===void 0&&(Q&&(le.fire(z),z=void 0,H=0),typeof j=="number"?ie=setTimeout(()=>{U&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0},j):(ie=0,queueMicrotask(()=>{U&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0})))})},onDidRemoveLastListener(){V.dispose()}};W||e(re);let le=new dE(re);return W?.add(le),le.event}a(y,"throttle"),t.throttle=y;function E(M,O=(Q,U)=>Q===U,j){let Q=!0,U;return l(M,Y=>{let W=Q||!O(Y,U);return Q=!1,U=Y,W},j)}a(E,"latch"),t.latch=E;function _(M,O,j){return[t.filter(M,O,j),t.filter(M,Q=>!O(Q),j)]}a(_,"split"),t.split=_;function v(M,O,j=!1,Q=[],U){let Y=Q.slice(),W;Gbn()&&(W={stack:Sue.create(),timerId:setTimeout(()=>{Y&&Y.length>0&&W&&!W.warned&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered for ${Hbn/1e3}s without being consumed. Buffered here:`),W.stack.print())},Hbn),warned:!1},U&&U.add((0,WC.toDisposable)(()=>clearTimeout(W.timerId))));let V=a(()=>{W&&clearTimeout(W.timerId)},"clearLeakWarningTimer"),z=M(re=>{Y?(Y.push(re),Gbn()&&W&&!W.warned&&Y.length>=fVo&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered without being consumed. Buffered here:`),W.stack.print())):H.fire(re)});U&&U.add(z);let ie=a(()=>{Y?.forEach(re=>H.fire(re)),Y=null,V()},"flush"),H=new dE({onWillAddFirstListener(){z||(z=M(re=>H.fire(re)),U&&U.add(z))},onDidAddFirstListener(){Y&&(j?setTimeout(ie):ie())},onDidRemoveLastListener(){z&&z.dispose(),z=null,V()}});return U&&U.add(H),H.event}a(v,"buffer"),t.buffer=v;function b(M,O){return a((Q,U,Y)=>{let W=O(new w);return M(function(V){let z=W.evaluate(V);z!==T&&Q.call(U,z)},void 0,Y)},"fn")}a(b,"chain"),t.chain=b;let T=Symbol("HaltChainable");class w{static{a(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(j=>(O(j),j)),this}filter(O){return this.steps.push(j=>O(j)?j:T),this}reduce(O,j){let Q=j;return this.steps.push(U=>(Q=O(Q,U),Q)),this}latch(O=(j,Q)=>j===Q){let j=!0,Q;return this.steps.push(U=>{let Y=j||!O(U,Q);return j=!1,Q=U,Y?U:T}),this}evaluate(O){for(let j of this.steps)if(O=j(O),O===T)break;return O}}function R(M,O,j=Q=>Q){let Q=a((...V)=>W.fire(j(...V)),"fn"),U=a(()=>M.on(O,Q),"onFirstListenerAdd"),Y=a(()=>M.removeListener(O,Q),"onLastListenerRemove"),W=new dE({onWillAddFirstListener:U,onDidRemoveLastListener:Y});return W.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,O,j=Q=>Q){let Q=a((...V)=>W.fire(j(...V)),"fn"),U=a(()=>M.addEventListener(O,Q),"onFirstListenerAdd"),Y=a(()=>M.removeEventListener(O,Q),"onLastListenerRemove"),W=new dE({onWillAddFirstListener:U,onDidRemoveLastListener:Y});return W.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function P(M,O){let j,Q,U=new Promise(Y=>{Q=n(M)(Y),Ujt(Q,O),j=a(()=>{$bn(Q,O)},"cancelRef")});return U.cancel=j,O&&U.finally(()=>$bn(Q,O)),U}a(P,"toPromise"),t.toPromise=P;function D(M,O){return M(j=>O.fire(j))}a(D,"forward"),t.forward=D;function N(M,O,j){return O(j),M(Q=>O(Q))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class L{static{a(this,"EmitterObserver")}constructor(O,j){this._observable=O,this._counter=0,this._hasChanged=!1;let Q={onWillAddFirstListener:a(()=>{O.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{O.removeObserver(this)},"onDidRemoveLastListener")};j||e(Q),this.emitter=new dE(Q),j&&j.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,j){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(M,O){return new L(M,O).emitter.event}a(B,"fromObservable"),t.fromObservable=B;function q(M){return(O,j,Q)=>{let U=0,Y=!1,W={beginUpdate(){U++},endUpdate(){U--,U===0&&(M.reportChanges(),Y&&(Y=!1,O.call(j)))},handlePossibleChange(){},handleChange(){Y=!0}};M.addObserver(W),M.reportChanges();let V={dispose(){M.removeObserver(W)}};return Ujt(V,Q),V}}a(q,"fromObservableLight"),t.fromObservableLight=q})(BJe||(Ga.Event=BJe={}));var FJe=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 uVo.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}}};Ga.EventProfiling=FJe;var awe=-1;function pVo(t){let e=awe;return awe=t,{dispose(){awe=e}}}a(pVo,"setGlobalLeakWarningThreshold");var kjt=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 cwe(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!==_ue.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==_ue.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function KK(t){return YK?.trackDisposable(t),t}a(KK,"trackDisposable");function JK(t){YK?.markAsDisposed(t)}a(JK,"markAsDisposed");function Y3(t,e){YK?.setParent(t,e)}a(Y3,"setParentOfDisposable");function V$o(t,e){if(YK)for(let r of t)YK.setParent(r,e)}a(V$o,"setParentOfDisposables");function W$o(t){return YK?.markAsSingleton(t),t}a(W$o,"markAsSingleton");function xbn(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(xbn,"isDisposable");function ewe(t){if(G$o.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(ewe,"dispose");function z$o(t){for(let e of t)xbn(e)&&e.dispose();return[]}a(z$o,"disposeIfDisposable");function Y$o(...t){let e=Sjt(()=>ewe(t));return V$o(t,e),e}a(Y$o,"combinedDisposable");var gjt=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,KK(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,JK(this),this._fn()}}};function Sjt(t){return new gjt(t)}a(Sjt,"toDisposable");var Xxe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,KK(this)}dispose(){this._isDisposed||(JK(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ewe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===_ue.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return Y3(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)&&Y3(e,null)}assertNotDisposed(){this._isDisposed&&(0,Sbn.onUnexpectedError)(new Sbn.BugIndicatingError("Object disposed"))}};hs.DisposableStore=Xxe;var _ue=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new Xxe,KK(this),Y3(this._store,this)}dispose(){JK(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};hs.Disposable=_ue;var NJe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,KK(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&Y3(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,JK(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&Y3(e,null),e}};hs.MutableDisposable=NJe;var Ajt=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new NJe,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()}};hs.MandatoryMutableDisposable=Ajt;var yjt=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}};hs.RefCountedDisposable=yjt;var Ejt=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,H$o.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};hs.ReferenceCollection=Ejt;var _jt=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}}};hs.AsyncReferenceCollection=_jt;var vjt=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};hs.ImmortalReference=vjt;function K$o(t){let e=new Xxe;try{t(e)}finally{e.dispose()}}a(K$o,"disposeOnReturn");var MJe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,KK(this)}dispose(){JK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ewe(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),Y3(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&Y3(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};hs.DisposableMap=MJe;var Cjt=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,KK(this)}dispose(){JK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ewe(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),Y3(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return Y3(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};hs.DisposableSet=Cjt;function J$o(t,e){let r=!1;return t.then(n=>{r||e(n)}),Sjt(()=>{r=!0})}a(J$o,"thenIfNotDisposed");function Z$o(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(Z$o,"thenRegisterOrDispose");var bjt=class extends MJe{static{a(this,"DisposableResourceMap")}constructor(){super(new Tbn.ResourceMap)}};hs.DisposableResourceMap=bjt});var vue=I(OJe=>{"use strict";p();Object.defineProperty(OJe,"__esModule",{value:!0});OJe.LinkedList=void 0;var yu=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}},Tjt=class{static{a(this,"LinkedList")}constructor(){this._first=yu.Undefined,this._last=yu.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===yu.Undefined}clear(){let e=this._first;for(;e!==yu.Undefined;){let r=e.next;e.prev=yu.Undefined,e.next=yu.Undefined,e=r}this._first=yu.Undefined,this._last=yu.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new yu(e);if(this._first===yu.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!==yu.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==yu.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==yu.Undefined)return this._last.element}_remove(e){if(e.prev!==yu.Undefined&&e.next!==yu.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===yu.Undefined&&e.next===yu.Undefined?(this._first=yu.Undefined,this._last=yu.Undefined):e.next===yu.Undefined?(this._last=this._last.prev,this._last.next=yu.Undefined):e.prev===yu.Undefined&&(this._first=this._first.next,this._first.prev=yu.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==yu.Undefined;)yield e.element,e=e.next}};OJe.LinkedList=Tjt});var Pbn=I(Cue=>{"use strict";p();Object.defineProperty(Cue,"__esModule",{value:!0});Cue.getNLSMessages=wbn;Cue.getNLSLanguage=Rbn;Cue.localize=eVo;Cue.localize2=tVo;function wbn(){return globalThis._VSCODE_NLS_MESSAGES}a(wbn,"getNLSMessages");function Rbn(){return globalThis._VSCODE_NLS_LANGUAGE}a(Rbn,"getNLSLanguage");var X$o=Rbn()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function LJe(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}),X$o&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(LJe,"_format");function eVo(t,e,...r){return LJe(typeof t=="number"?kbn(t,e):e,r)}a(eVo,"localize");function kbn(t,e){let r=wbn()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(kbn,"lookupMessage");function tVo(t,e,...r){let n;typeof t=="number"?n=kbn(t,e):n=e;let o=LJe(n,r);return{value:o,original:e===n?o:LJe(e,r)}}a(tVo,"localize2")});var kq=I(pr=>{"use strict";p();var rVo=pr&&pr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nVo=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),iVo=pr&&pr.__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,iwe=K3.indexOf("Macintosh")>=0,wjt=(K3.indexOf("Macintosh")>=0||K3.indexOf("iPad")>=0||K3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,rwe=K3.indexOf("Linux")>=0,Ubn=K3?.indexOf("Mobi")>=0,xjt=!0,BJe=oVo.getNLSLanguage()||pr.LANGUAGE_DEFAULT,twe=navigator.language.toLowerCase(),Ijt=twe):console.error("Unable to resolve platform.");function aVo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(aVo,"PlatformToString");var FJe=0;iwe?FJe=1:nwe?FJe=3:rwe&&(FJe=2);pr.isWindows=nwe;pr.isMacintosh=iwe;pr.isLinux=rwe;pr.isLinuxSnap=Obn;pr.isNative=Lbn;pr.isElectron=Bbn;pr.isWeb=xjt;pr.isWebWorker=xjt&&typeof J3.importScripts=="function";pr.webWorkerOrigin=pr.isWebWorker?J3.origin:void 0;pr.isIOS=wjt;pr.isMobile=Ubn;pr.isCI=Fbn;pr.platform=FJe;pr.userAgent=K3;pr.language=BJe;var Dbn;(function(t){function e(){return pr.language}a(e,"value"),t.value=e;function r(){return pr.language.length===2?pr.language==="en":pr.language.length>=3?pr.language[0]==="e"&&pr.language[1]==="n"&&pr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return pr.language==="en"}a(n,"isDefault"),t.isDefault=n})(Dbn||(pr.Language=Dbn={}));pr.locale=twe;pr.platformLocale=Ijt;pr.translationsConfigFile=Qbn;pr.setTimeout0IsFaster=typeof J3.postMessage=="function"&&!J3.importScripts;pr.setTimeout0=(()=>{if(pr.setTimeout0IsFaster){let t=[];J3.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}),J3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();pr.OS=iwe||wjt?2:nwe?1:3;var Nbn=!0,Mbn=!1;function cVo(){if(!Mbn){Mbn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,Nbn=new Uint16Array(t.buffer)[0]===513}return Nbn}a(cVo,"isLittleEndian");pr.isChrome=!!(pr.userAgent&&pr.userAgent.indexOf("Chrome")>=0);pr.isFirefox=!!(pr.userAgent&&pr.userAgent.indexOf("Firefox")>=0);pr.isSafari=!!(!pr.isChrome&&pr.userAgent&&pr.userAgent.indexOf("Safari")>=0);pr.isEdge=!!(pr.userAgent&&pr.userAgent.indexOf("Edg/")>=0);pr.isAndroid=!!(pr.userAgent&&pr.userAgent.indexOf("Android")>=0);function lVo(t){return parseFloat(t)>=25}a(lVo,"isTahoeOrNewer")});var owe=I(BO=>{"use strict";p();Object.defineProperty(BO,"__esModule",{value:!0});BO.arch=BO.platform=BO.env=BO.cwd=void 0;var jbn=kq(),ZK,Rjt=globalThis.vscode;if(typeof Rjt<"u"&&typeof Rjt.process<"u"){let t=Rjt.process;ZK={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"?ZK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:ZK={get platform(){return jbn.isWindows?"win32":jbn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};BO.cwd=ZK.cwd;BO.env=ZK.env;BO.platform=ZK.platform;BO.arch=ZK.arch});var FO=I(UJe=>{"use strict";p();Object.defineProperty(UJe,"__esModule",{value:!0});UJe.StopWatch=void 0;var uVo=globalThis.performance.now.bind(globalThis.performance),kjt=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:uVo,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}};UJe.StopWatch=kjt});var Ic=I(Ga=>{"use strict";p();Object.defineProperty(Ga,"__esModule",{value:!0});Ga.ValueWithChangeEvent=Ga.Relay=Ga.EventBufferer=Ga.DynamicListEventMultiplexer=Ga.EventMultiplexer=Ga.MicrotaskEmitter=Ga.DebounceEmitter=Ga.PauseableEmitter=Ga.AsyncEmitter=Ga.createEventDeliveryQueue=Ga.Emitter=Ga.ListenerRefusalError=Ga.ListenerLeakError=Ga.EventProfiling=Ga.Event=void 0;Ga.setGlobalLeakWarningThreshold=AVo;Ga.trackSetChanges=vVo;var dVo=ejt(),swe=Rs(),fVo=rjt(),WC=ko(),Wbn=vue(),pVo=owe(),hVo=FO(),Hbn=!1,mVo=!1,gVo=100,Gbn=6e4;function $bn(){return!!pVo.env.VSCODE_DEV}a($bn,"_isBufferLeakWarningEnabled");var QJe;(function(t){t.None=()=>WC.Disposable.None;function e(M){if(mVo){let{onDidAddListener:O}=M,j=Sue.create(),Q=0;M.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),j.print()),O?.()}}}a(e,"_addLeakageTraceLogic");function r(M,O,j){return g(M,()=>{},0,void 0,O??!0,void 0,j)}a(r,"defer"),t.defer=r;function n(M){return(O,j=null,Q)=>{let U=!1,Y;return Y=M(W=>{if(!U)return Y?Y.dispose():U=!0,O.call(j,W)},null,Q),U&&Y.dispose(),Y}}a(n,"once"),t.once=n;function o(M,O){return t.once(t.filter(M,O))}a(o,"onceIf"),t.onceIf=o;function s(M,O,j){return h((Q,U=null,Y)=>M(W=>Q.call(U,O(W)),null,Y),j)}a(s,"map"),t.map=s;function c(M,O,j){return h((Q,U=null,Y)=>M(W=>{O(W),Q.call(U,W)},null,Y),j)}a(c,"forEach"),t.forEach=c;function l(M,O,j){return h((Q,U=null,Y)=>M(W=>O(W)&&Q.call(U,W),null,Y),j)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(O,j=null,Q)=>{let U=(0,WC.combinedDisposable)(...M.map(Y=>Y(W=>O.call(j,W))));return m(U,Q)}}a(d,"any"),t.any=d;function f(M,O,j,Q){let U=j;return s(M,Y=>(U=O(U,Y),U),Q)}a(f,"reduce"),t.reduce=f;function h(M,O){let j,Q={onWillAddFirstListener(){j=M(U.fire,U)},onDidRemoveLastListener(){j?.dispose()}};O||e(Q);let U=new dE(Q);return O?.add(U),U.event}a(h,"snapshot");function m(M,O){return O instanceof Array?O.push(M):O&&O.add(M),M}a(m,"addAndReturnDisposable");function g(M,O,j=100,Q=!1,U=!1,Y,W){let V,z,ie,H=0,re,le={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(ge=>{H++,z=O(z,ge),Q&&!ie&&(Le.fire(z),z=void 0),re=a(()=>{let Ue=z;z=void 0,ie=void 0,(!Q||H>1)&&Le.fire(Ue),H=0},"doFire"),typeof j=="number"?(ie&&clearTimeout(ie),ie=setTimeout(re,j)):ie===void 0&&(ie=null,queueMicrotask(re))})},onWillRemoveListener(){U&&H>0&&re?.()},onDidRemoveLastListener(){re=void 0,V.dispose()}};W||e(le);let Le=new dE(le);return W?.add(Le),Le.event}a(g,"debounce"),t.debounce=g;function A(M,O=0,j,Q){return t.debounce(M,(U,Y)=>U?(U.push(Y),U):[Y],O,void 0,j??!0,void 0,Q)}a(A,"accumulate"),t.accumulate=A;function y(M,O,j=100,Q=!0,U=!0,Y,W){let V,z,ie,H=0,re={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(Le=>{H++,z=O(z,Le),ie===void 0&&(Q&&(le.fire(z),z=void 0,H=0),typeof j=="number"?ie=setTimeout(()=>{U&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0},j):(ie=0,queueMicrotask(()=>{U&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0})))})},onDidRemoveLastListener(){V.dispose()}};W||e(re);let le=new dE(re);return W?.add(le),le.event}a(y,"throttle"),t.throttle=y;function E(M,O=(Q,U)=>Q===U,j){let Q=!0,U;return l(M,Y=>{let W=Q||!O(Y,U);return Q=!1,U=Y,W},j)}a(E,"latch"),t.latch=E;function _(M,O,j){return[t.filter(M,O,j),t.filter(M,Q=>!O(Q),j)]}a(_,"split"),t.split=_;function v(M,O,j=!1,Q=[],U){let Y=Q.slice(),W;$bn()&&(W={stack:Sue.create(),timerId:setTimeout(()=>{Y&&Y.length>0&&W&&!W.warned&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered for ${Gbn/1e3}s without being consumed. Buffered here:`),W.stack.print())},Gbn),warned:!1},U&&U.add((0,WC.toDisposable)(()=>clearTimeout(W.timerId))));let V=a(()=>{W&&clearTimeout(W.timerId)},"clearLeakWarningTimer"),z=M(re=>{Y?(Y.push(re),$bn()&&W&&!W.warned&&Y.length>=gVo&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered without being consumed. Buffered here:`),W.stack.print())):H.fire(re)});U&&U.add(z);let ie=a(()=>{Y?.forEach(re=>H.fire(re)),Y=null,V()},"flush"),H=new dE({onWillAddFirstListener(){z||(z=M(re=>H.fire(re)),U&&U.add(z))},onDidAddFirstListener(){Y&&(j?setTimeout(ie):ie())},onDidRemoveLastListener(){z&&z.dispose(),z=null,V()}});return U&&U.add(H),H.event}a(v,"buffer"),t.buffer=v;function b(M,O){return a((Q,U,Y)=>{let W=O(new w);return M(function(V){let z=W.evaluate(V);z!==T&&Q.call(U,z)},void 0,Y)},"fn")}a(b,"chain"),t.chain=b;let T=Symbol("HaltChainable");class w{static{a(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(j=>(O(j),j)),this}filter(O){return this.steps.push(j=>O(j)?j:T),this}reduce(O,j){let Q=j;return this.steps.push(U=>(Q=O(Q,U),Q)),this}latch(O=(j,Q)=>j===Q){let j=!0,Q;return this.steps.push(U=>{let Y=j||!O(U,Q);return j=!1,Q=U,Y?U:T}),this}evaluate(O){for(let j of this.steps)if(O=j(O),O===T)break;return O}}function R(M,O,j=Q=>Q){let Q=a((...V)=>W.fire(j(...V)),"fn"),U=a(()=>M.on(O,Q),"onFirstListenerAdd"),Y=a(()=>M.removeListener(O,Q),"onLastListenerRemove"),W=new dE({onWillAddFirstListener:U,onDidRemoveLastListener:Y});return W.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,O,j=Q=>Q){let Q=a((...V)=>W.fire(j(...V)),"fn"),U=a(()=>M.addEventListener(O,Q),"onFirstListenerAdd"),Y=a(()=>M.removeEventListener(O,Q),"onLastListenerRemove"),W=new dE({onWillAddFirstListener:U,onDidRemoveLastListener:Y});return W.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function P(M,O){let j,Q,U=new Promise(Y=>{Q=n(M)(Y),Qjt(Q,O),j=a(()=>{Vbn(Q,O)},"cancelRef")});return U.cancel=j,O&&U.finally(()=>Vbn(Q,O)),U}a(P,"toPromise"),t.toPromise=P;function D(M,O){return M(j=>O.fire(j))}a(D,"forward"),t.forward=D;function N(M,O,j){return O(j),M(Q=>O(Q))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class L{static{a(this,"EmitterObserver")}constructor(O,j){this._observable=O,this._counter=0,this._hasChanged=!1;let Q={onWillAddFirstListener:a(()=>{O.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{O.removeObserver(this)},"onDidRemoveLastListener")};j||e(Q),this.emitter=new dE(Q),j&&j.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,j){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(M,O){return new L(M,O).emitter.event}a(B,"fromObservable"),t.fromObservable=B;function q(M){return(O,j,Q)=>{let U=0,Y=!1,W={beginUpdate(){U++},endUpdate(){U--,U===0&&(M.reportChanges(),Y&&(Y=!1,O.call(j)))},handlePossibleChange(){},handleChange(){Y=!0}};M.addObserver(W),M.reportChanges();let V={dispose(){M.removeObserver(W)}};return Qjt(V,Q),V}}a(q,"fromObservableLight"),t.fromObservableLight=q})(QJe||(Ga.Event=QJe={}));var qJe=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 hVo.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}}};Ga.EventProfiling=qJe;var awe=-1;function AVo(t){let e=awe;return awe=t,{dispose(){awe=e}}}a(AVo,"setGlobalLeakWarningThreshold");var Pjt=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 cwe(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 bue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new kjt(e?.onListenerError??swe.onUnexpectedError,this._options?.leakWarningThreshold??awe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new FJe(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(jbn){let e=this._listeners;queueMicrotask(()=>{Wbn(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 UJe(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||swe.onUnexpectedError)(h),WC.Disposable.None}if(this._disposed)return WC.Disposable.None;r&&(e=e.bind(r));let o=new bue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Sue.create(),s=this._leakageMon.check(o.stack,this._size+1)),jbn&&(o.stack=c??Sue.create()),this._listeners?this._listeners instanceof bue?(this._deliveryQueue??=new QJe,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,WC.toDisposable)(()=>{s?.(),this._removeListener(o)});return Ujt(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*mVo<=r.length){let s=0;for(let c=0;c0}};Ga.Emitter=dE;var gVo=a(()=>new QJe,"createEventDeliveryQueue");Ga.createEventDeliveryQueue=gVo;var QJe=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}},Pjt=class extends dE{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new Vbn.LinkedList),Wbn(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,swe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,swe.onUnexpectedError)(d.reason)})}}};Ga.AsyncEmitter=Pjt;var qJe=class extends dE{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new Vbn.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))}};Ga.PauseableEmitter=qJe;var Djt=class extends qJe{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)}};Ga.DebounceEmitter=Djt;var Njt=class extends dE{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=[]}))}};Ga.MicrotaskEmitter=Njt;var jJe=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new dE({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,WC.toDisposable)((0,cVo.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=[]}};Ga.EventMultiplexer=jJe;var Mjt=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new WC.DisposableStore;let s=this._store.add(new jJe),c=this._store.add(new WC.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()}};Ga.DynamicListEventMultiplexer=Mjt;var Ojt=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}};Ga.EventBufferer=Ojt;var Ljt=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=BJe.None,this.inputEventListener=WC.Disposable.None,this.emitter=new dE({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()}};Ga.Relay=Ljt;var Bjt=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new Fjt(e)}constructor(e){this._value=e,this._onDidChange=new dE,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};Ga.ValueWithChangeEvent=Bjt;var Fjt=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=BJe.None}};function AVo(t,e,r){let n=new WC.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new WC.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,aVo.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(AVo,"trackSetChanges");function Ujt(t,e){e instanceof WC.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(Ujt,"addToDisposables");function $bn(t,e){if(e instanceof WC.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a($bn,"disposeAndRemove")});var YP=I(J3=>{"use strict";p();Object.defineProperty(J3,"__esModule",{value:!0});J3.CancellationTokenPool=J3.CancellationTokenSource=J3.CancellationToken=void 0;J3.cancelOnDispose=EVo;var zbn=Ic(),yVo=Ro(),Ybn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),HJe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof Tue?!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:zbn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ybn})})(HJe||(J3.CancellationToken=HJe={}));var Tue=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?Ybn:(this._emitter||(this._emitter=new zbn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},lwe=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 Tue),this._token}cancel(){this._token?this._token instanceof Tue&&this._token.cancel():this._token=HJe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Tue&&this._token.dispose():this._token=HJe.None}};J3.CancellationTokenSource=lwe;function EVo(t){let e=new lwe;return t.add({dispose(){e.cancel()}}),e.token}a(EVo,"cancelOnDispose");var Qjt=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new lwe,this._listeners=new yVo.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()}};J3.CancellationTokenPool=Qjt});var NA=I(Jr=>{"use strict";p();var _Vo=Jr&&Jr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vVo=Jr&&Jr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),CVo=Jr&&Jr.__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=bVo&&t<=TVo||t>=SVo&&t<=IVo}a(X3,"isWindowsDeviceRoot");function $Je(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===XK&&l!==-1?++l:l=-1}return o}a($Je,"normalizeString");function RVo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(RVo,"formatExt");function Kbn(t,e){wVo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${RVo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(Kbn,"_format");Jr.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],cp(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=Iue.cwd():(s=Iue.env[`=${e}`]||Iue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===zC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Ko(f)&&(l=1,d=!0);else if(Ko(f))if(d=!0,Ko(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Ko(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=$Je(r,!n,"\\",Ko),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){cp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return qjt(s)?"\\":t;if(Ko(s))if(o=!0,Ko(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Ko(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Ko(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&X3(c.charCodeAt(0))&&c.charCodeAt(1)===Z3)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||Ko(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){cp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Ko(r)||e>2&&X3(r)&&t.charCodeAt(1)===Z3&&Ko(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"&&Ko(r.charCodeAt(0))){++o;let s=r.length;s>1&&Ko(r.charCodeAt(1))&&(++o,s>2&&(Ko(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Jr.win32.normalize(e)},relative(t,e){if(cp(t,"from"),cp(e,"to"),t===e)return"";let r=Jr.win32.resolve(t),n=Jr.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 E=A.length,_=y.length,v=E<_?E:_,b;for(b=0;bv?y.slice(b).join("\\"):E>v?"..\\".repeat(E-1-b)+"..":"":"..\\".repeat(E-b)+y.slice(b).join("\\")}let o=0;for(;oo&&t.charCodeAt(s-1)===zC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===zC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===zC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===zC?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)===zC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===zC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Jr.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===zC){if(e.charCodeAt(1)===zC){let r=e.charCodeAt(2);if(r!==xVo&&r!==XK)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(X3(e.charCodeAt(0))&&e.charCodeAt(1)===Z3&&e.charCodeAt(2)===zC)return`\\\\?\\${e}`;return e},dirname(t){cp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Ko(o)?t:".";if(Ko(o)){if(r=n=1,Ko(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Ko(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Ko(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&&cp(e,"suffix"),cp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&X3(t.charCodeAt(0))&&t.charCodeAt(1)===Z3&&(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(Ko(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(Ko(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){cp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===Z3&&X3(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Ko(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===XK?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:Kbn.bind(null,"\\"),parse(t){cp(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 Ko(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Ko(o)){if(n=1,Ko(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),Ko(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===XK?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 kVo=(()=>{if(YC){let t=/\\/g;return()=>{let e=Iue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Iue.cwd()})();Jr.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];cp(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===_g)}if(!r){let n=kVo();e=`${n}/${e}`,r=n.charCodeAt(0)===_g}return e=$Je(e,!r,"/",qjt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(cp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===_g,r=t.charCodeAt(t.length-1)===_g;return t=$Je(t,!e,"/",qjt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return cp(t,"path"),t.length>0&&t.charCodeAt(0)===_g},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":Jr.posix.normalize(e.join("/"))},relative(t,e){if(cp(t,"from"),cp(e,"to"),t===e||(t=Jr.posix.resolve(t),e=Jr.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)===_g)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===_g?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===_g)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(cp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===_g,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===_g){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&&cp(e,"suffix"),cp(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===_g){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)===_g){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){cp(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:Kbn.bind(null,"/"),parse(t){cp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===_g,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===_g){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===XK?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};Jr.posix.win32=Jr.win32.win32=Jr.win32;Jr.posix.posix=Jr.win32.posix=Jr.posix;Jr.normalize=YC?Jr.win32.normalize:Jr.posix.normalize;Jr.isAbsolute=YC?Jr.win32.isAbsolute:Jr.posix.isAbsolute;Jr.join=YC?Jr.win32.join:Jr.posix.join;Jr.resolve=YC?Jr.win32.resolve:Jr.posix.resolve;Jr.relative=YC?Jr.win32.relative:Jr.posix.relative;Jr.dirname=YC?Jr.win32.dirname:Jr.posix.dirname;Jr.basename=YC?Jr.win32.basename:Jr.posix.basename;Jr.extname=YC?Jr.win32.extname:Jr.posix.extname;Jr.format=YC?Jr.win32.format:Jr.posix.format;Jr.parse=YC?Jr.win32.parse:Jr.posix.parse;Jr.toNamespacedPath=YC?Jr.win32.toNamespacedPath:Jr.posix.toNamespacedPath;Jr.sep=YC?Jr.win32.sep:Jr.posix.sep;Jr.delimiter=YC?Jr.win32.delimiter:Jr.posix.delimiter});var WJe=I(KP=>{"use strict";p();Object.defineProperty(KP,"__esModule",{value:!0});KP.WeakCachedFunction=KP.CachedFunction=KP.LRUCachedFunction=KP.Cache=void 0;KP.identity=VJe;var PVo=YP(),jjt=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new PVo.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};KP.Cache=jjt;function VJe(t){return t}a(VJe,"identity");var Hjt=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=VJe):(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}};KP.LRUCachedFunction=Hjt;var Gjt=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=VJe):(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}};KP.CachedFunction=Gjt;var $jt=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=VJe):(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}};KP.WeakCachedFunction=$jt});var eF=I(zJe=>{"use strict";p();Object.defineProperty(zJe,"__esModule",{value:!0});zJe.Lazy=void 0;var kq;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(kq||(kq={}));var Vjt=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=kq.Uninitialized}get hasValue(){return this._state===kq.Completed}get value(){if(this._state===kq.Uninitialized){this._state=kq.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=kq.Completed}}else if(this._state===kq.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}};zJe.Lazy=Vjt});var em=I(kr=>{"use strict";p();Object.defineProperty(kr,"__esModule",{value:!0});kr.Ellipsis=kr.InvisibleCharacters=kr.AmbiguousCharacters=kr.noBreakWhitespace=kr.UTF8_BOM_CHARACTER=kr.UNUSUAL_LINE_TERMINATORS=kr.GraphemeIterator=kr.CodePointIterator=void 0;kr.isFalsyOrWhitespace=NVo;kr.format=OVo;kr.format2=BVo;kr.htmlAttributeEncodeValue=FVo;kr.escape=UVo;kr.escapeRegExpCharacters=Xbn;kr.count=QVo;kr.truncate=qVo;kr.truncateMiddle=jVo;kr.trim=HVo;kr.ltrim=e1n;kr.rtrim=t1n;kr.convertSimple2RegExpPattern=GVo;kr.createRegExp=$Vo;kr.regExpLeadsToEndlessLoop=VVo;kr.joinStrings=WVo;kr.splitLines=zVo;kr.splitLinesIncludeSeparators=YVo;kr.indexOfPattern=KVo;kr.firstNonWhitespaceIndex=r1n;kr.getLeadingWhitespace=JVo;kr.lastNonWhitespaceIndex=ZVo;kr.getIndentationLength=XVo;kr.replaceAsync=eWo;kr.compare=tWo;kr.compareSubstring=n1n;kr.compareIgnoreCase=rWo;kr.compareSubstringIgnoreCase=dwe;kr.isAsciiDigit=nWo;kr.isLowerAsciiLetter=zjt;kr.isUpperAsciiLetter=iWo;kr.equalsIgnoreCase=i1n;kr.equals=oWo;kr.startsWithIgnoreCase=sWo;kr.endsWithIgnoreCase=aWo;kr.commonPrefixLength=cWo;kr.commonSuffixLength=lWo;kr.isHighSurrogate=Jjt;kr.isLowSurrogate=YJe;kr.computeCodePoint=Zjt;kr.getNextCodePoint=o1n;kr.nextCharLength=s1n;kr.prevCharLength=a1n;kr.getCharContainingOffset=dWo;kr.charCount=fWo;kr.containsRTL=hWo;kr.isBasicASCII=gWo;kr.containsUnusualLineTerminators=AWo;kr.isFullWidthCharacter=yWo;kr.isEmojiImprecise=c1n;kr.lcut=EWo;kr.rcut=_Wo;kr.forAnsiStringParts=SWo;kr.removeAnsiEscapeCodes=u1n;kr.removeAnsiEscapeCodesFromPrompt=IWo;kr.startsWithUTF8BOM=d1n;kr.stripUTF8BOM=xWo;kr.fuzzyContains=wWo;kr.containsUppercaseCharacter=RWo;kr.uppercaseFirstLetter=kWo;kr.getNLines=PWo;kr.singleLetterHash=DWo;kr.getGraphemeBreakType=NWo;kr.getLeftDeleteOffset=OWo;kr.multibyteAwareBtoa=UWo;var DVo=WJe(),Jbn=eF();function NVo(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(NVo,"isFalsyOrWhitespace");var MVo=/{(\d+)}/g;function OVo(t,...e){return e.length===0?t:t.replace(MVo,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(OVo,"format");var LVo=/{([^}]+)}/g;function BVo(t,e){return Object.keys(e).length===0?t:t.replace(LVo,(r,n)=>e[n]??r)}a(BVo,"format2");function FVo(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(FVo,"htmlAttributeEncodeValue");function UVo(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(UVo,"escape");function Xbn(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(Xbn,"escapeRegExpCharacters");function QVo(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(QVo,"count");function qVo(t,e,r=kr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(qVo,"truncate");function jVo(t,e,r=kr.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(jVo,"truncateMiddle");function HVo(t,e=" "){let r=e1n(t,e);return t1n(r,e)}a(HVo,"trim");function e1n(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(t1n,"rtrim");function GVo(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(GVo,"convertSimple2RegExpPattern");function $Vo(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=Xbn(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($Vo,"createRegExp");function VVo(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(VVo,"regExpLeadsToEndlessLoop");function WVo(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(WVo,"joinStrings");function zVo(t){return t.split(/\r\n|\r|\n/)}a(zVo,"splitLines");function YVo(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(ZVo,"lastNonWhitespaceIndex");function XVo(t){let e=r1n(t);return e===-1?t.length:e}a(XVo,"getIndentationLength");function eWo(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(eWo,"replaceAsync");function tWo(t,e){return te?1:0}a(tWo,"compare");function n1n(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(n1n,"compareSubstring");function rWo(t,e){return dwe(t,e,0,t.length,0,e.length)}a(rWo,"compareIgnoreCase");function dwe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return n1n(t.toLowerCase(),e.toLowerCase(),r,n,o,s);zjt(u)&&(u-=32),zjt(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(dwe,"compareSubstringIgnoreCase");function nWo(t){return t>=48&&t<=57}a(nWo,"isAsciiDigit");function zjt(t){return t>=97&&t<=122}a(zjt,"isLowerAsciiLetter");function iWo(t){return t>=65&&t<=90}a(iWo,"isUpperAsciiLetter");function i1n(t,e){return t.length===e.length&&dwe(t,e)===0}a(i1n,"equalsIgnoreCase");function oWo(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&i1n(t,e)}a(oWo,"equals");function sWo(t,e){let r=e.length;return r<=t.length&&dwe(t,e,0,r)===0}a(sWo,"startsWithIgnoreCase");function aWo(t,e){let r=t.length,n=r-e.length;return n>=0&&dwe(t,e,n,r)===0}a(aWo,"endsWithIgnoreCase");function cWo(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(Jjt(n))return Zjt(n,r)}return r}a(uWo,"getPrevCodePoint");var xue=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=uWo(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=o1n(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};kr.CodePointIterator=xue;var wue=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new xue(e,r)}nextGraphemeLength(){let e=uwe.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(Zbn(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=uwe.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(Zbn(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};kr.GraphemeIterator=wue;function s1n(t,e){return new wue(t,e).nextGraphemeLength()}a(s1n,"nextCharLength");function a1n(t,e){return new wue(t,e).prevGraphemeLength()}a(a1n,"prevCharLength");function dWo(t,e){e>0&&YJe(t.charCodeAt(e))&&e--;let r=e+s1n(t,e);return[r-a1n(t,r),r]}a(dWo,"getCharContainingOffset");function fWo(t){let e=new wue(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(fWo,"charCount");var Wjt;function pWo(){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(pWo,"makeContainsRtl");function hWo(t){return Wjt||(Wjt=pWo()),Wjt.test(t)}a(hWo,"containsRTL");var mWo=/^[\t\n\r\x20-\x7E]*$/;function gWo(t){return mWo.test(t)}a(gWo,"isBasicASCII");kr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function AWo(t){return kr.UNUSUAL_LINE_TERMINATORS.test(t)}a(AWo,"containsUnusualLineTerminators");function yWo(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(yWo,"isFullWidthCharacter");function c1n(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(c1n,"isEmojiImprecise");function EWo(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@^`{}|~]/,CWo=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,bWo=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,l1n=new RegExp("(?:"+[vWo.source,CWo.source,bWo.source].join("|")+")","g");function*SWo(t){let e=0;for(let r of t.matchAll(l1n))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(SWo,"forAnsiStringParts");function u1n(t){return t&&(t=t.replace(l1n,"")),t}a(u1n,"removeAnsiEscapeCodes");var TWo=/\\\[.*?\\\]/g;function IWo(t){return u1n(t).replace(TWo,"")}a(IWo,"removeAnsiEscapeCodesFromPrompt");kr.UTF8_BOM_CHARACTER="\uFEFF";function d1n(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(d1n,"startsWithUTF8BOM");function xWo(t){return d1n(t)?t.substr(1):t}a(xWo,"stripUTF8BOM");function wWo(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(PWo,"getNLines");function DWo(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(DWo,"singleLetterHash");function NWo(t){return uwe.getInstance().getGraphemeBreakType(t)}a(NWo,"getGraphemeBreakType");function Zbn(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(Zbn,"breakBetweenGraphemeBreakType");var uwe=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=MWo()}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 MWo(){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(MWo,"getGraphemeBreakRawData");function OWo(t,e){if(t===0)return 0;let r=LWo(t,e);if(r!==void 0)return r;let n=new xue(e,t);return n.prevCodePoint(),n.offset}a(OWo,"getLeftDeleteOffset");function LWo(t,e){let r=new xue(e,t),n=r.prevCodePoint();for(;BWo(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!c1n(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(LWo,"getOffsetBeforeLastEmojiComponent");function BWo(t){return 127995<=t&&t<=127999}a(BWo,"isEmojiModifier");kr.noBreakWhitespace="\xA0";var Yjt=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new Jbn.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 DVo.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 Jbn.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(d0,"__esModule",{value:!0});d0.isPathSeparator=tF;d0.toSlashes=f1n;d0.toPosixPath=qWo;d0.getRoot=jWo;d0.isUNC=HWo;d0.isValidBasename=WWo;d0.isEqual=zWo;d0.isEqualOrParent=YWo;d0.isWindowsDriveLetter=Xjt;d0.sanitizeFilePath=KWo;d0.removeTrailingPathSeparator=p1n;d0.isRootOrDriveLetter=JWo;d0.hasDriveLetter=eHt;d0.getDriveLetter=ZWo;d0.indexOfPath=XWo;d0.parseLineAndColumnAware=ezo;d0.randomPath=nzo;var u0=NA(),Pq=Rq(),KJe=em(),QWo=KS();function tF(t){return t===47||t===92}a(tF,"isPathSeparator");function f1n(t){return t.replace(/[\\/]/g,u0.posix.sep)}a(f1n,"toSlashes");function qWo(t){return t.indexOf("/")===-1&&(t=f1n(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(qWo,"toPosixPath");function jWo(t,e=u0.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(tF(n)){if(tF(t.charCodeAt(1))&&!tF(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,$Wo=/[/]/g,VWo=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function WWo(t,e=Pq.isWindows){let r=e?GWo:$Wo;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&VWo.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(WWo,"isValidBasename");function zWo(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,KJe.equalsIgnoreCase)(t,e)}a(zWo,"isEqual");function YWo(t,e,r,n=!1){let o=n?u0.posix.sep:u0.sep;if(t===e)return!0;if(!t||!e||((t.indexOf("..")>=0||e.indexOf("..")>=0)&&(t=n?u0.posix.normalize(t):(0,u0.normalize)(t),e=n?u0.posix.normalize(e):(0,u0.normalize)(e)),e.length>t.length))return!1;if(r){if(!(0,KJe.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(YWo,"isEqualOrParent");function Xjt(t){return t>=65&&t<=90||t>=97&&t<=122}a(Xjt,"isWindowsDriveLetter");function KWo(t,e){return Pq.isWindows&&t.endsWith(":")&&(t+=u0.sep),(0,u0.isAbsolute)(t)||(t=(0,u0.join)(e,t)),t=(0,u0.normalize)(t),p1n(t)}a(KWo,"sanitizeFilePath");function p1n(t){return Pq.isWindows?(t=(0,KJe.rtrim)(t,u0.sep),t.endsWith(":")&&(t+=u0.sep)):(t=(0,KJe.rtrim)(t,u0.sep),t||(t=u0.sep)),t}a(p1n,"removeTrailingPathSeparator");function JWo(t){let e=(0,u0.normalize)(t);return Pq.isWindows?t.length>3?!1:eHt(e)&&(t.length===2||e.charCodeAt(2)===92):e===u0.posix.sep}a(JWo,"isRootOrDriveLetter");function eHt(t,e=Pq.isWindows){return e?Xjt(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(eHt,"hasDriveLetter");function ZWo(t,e=Pq.isWindows){return eHt(t,e)?t[0]:void 0}a(ZWo,"getDriveLetter");function XWo(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(XWo,"indexOfPath");function ezo(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,QWo.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(ezo,"parseLineAndColumnAware");var tzo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",rzo="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function nzo(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var izo=iw&&iw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ozo=iw&&iw.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),szo=iw&&iw.__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(!czo.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(lzo.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(uzo,"_validateUri");function dzo(t,e){return!t&&!e?"file":t}a(dzo,"_schemeFix");function fzo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==JP&&(e=JP+e):e=JP;break}return e}a(fzo,"_referenceResolution");var Gl="",JP="/",pzo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,XJe=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||Gl,this.authority=e.authority||Gl,this.path=e.path||Gl,this.query=e.query||Gl,this.fragment=e.fragment||Gl):(this.scheme=dzo(e,c),this.authority=r||Gl,this.path=fzo(this.scheme,n||Gl),this.query=o||Gl,this.fragment=s||Gl,uzo(this,c))}get fsPath(){return eZe(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=Gl),n===void 0?n=this.authority:n===null&&(n=Gl),o===void 0?o=this.path:o===null&&(o=Gl),s===void 0?s=this.query:s===null&&(s=Gl),c===void 0?c=this.fragment:c===null&&(c=Gl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new Dq(r,n,o,s,c)}static parse(e,r=!1){let n=pzo.exec(e);return n?new Dq(n[2]||Gl,JJe(n[4]||Gl),JJe(n[5]||Gl),JJe(n[7]||Gl),JJe(n[9]||Gl),r):new Dq(Gl,Gl,Gl,Gl,Gl)}static file(e){let r=Gl;if(ZJe.isWindows&&(e=e.replace(/\\/g,JP)),e[0]===JP&&e[1]===JP){let n=e.indexOf(JP,2);n===-1?(r=e.substring(2),e=JP):(r=e.substring(2,n),e=e.substring(n)||JP)}return new Dq("file",r,e,Gl,Gl)}static from(e,r){return new Dq(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 ZJe.isWindows&&e.scheme==="file"?n=t.file(h1n.win32.join(eZe(e,!0),...r)).path:n=h1n.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return rHt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new Dq(e);return r._formatted=e.external??null,r._fsPath=e._sep===A1n?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};iw.URI=XJe;function hzo(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(hzo,"isUriComponents");var A1n=ZJe.isWindows?1:void 0,Dq=class extends XJe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=eZe(this,!1)),this._fsPath}toString(e=!1){return e?rHt(this,!0):(this._formatted||(this._formatted=rHt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=A1n),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}},y1n={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 m1n(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=y1n[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(m1n,"encodeURIComponentFast");function mzo(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,ZJe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(eZe,"uriToFsPath");function rHt(t,e){let r=e?mzo:m1n,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=JP,n+=JP),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:m1n(u,!1,!1)),n}a(rHt,"_asFormatted");function E1n(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+E1n(t.substr(3)):t}}a(E1n,"decodeURIComponentGraceful");var g1n=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function JJe(t){return t.match(g1n)?t.replace(g1n,e=>E1n(e)):t}a(JJe,"percentDecode")});var tJ=I(ms=>{"use strict";p();var gzo=ms&&ms.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Azo=ms&&ms.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aHt=ms&&ms.__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;oC1n(t,r))}a(Ezo,"matchesSomeScheme");ms.connectionTokenCookieName="vscode-tkn";ms.connectionTokenQueryName="tkn";var oHt=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=iHt.posix.join(r??"/",b1n(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return iHt.posix.join(this._serverRootPath,UO.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 yzo.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+=`&${ms.connectionTokenQueryName}=${encodeURIComponent(s)}`),eJ.URI.from({scheme:nHt.isWeb?this._preferredWebSchema:UO.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};ms.RemoteAuthorities=new oHt;function b1n(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(b1n,"getServerProductSegment");ms.builtinExtensionsPath="vs/../../extensions";ms.nodeModulesPath="vs/../../node_modules";ms.nodeModulesAsarPath="vs/../../node_modules.asar";ms.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";ms.VSCODE_AUTHORITY="vscode-app";var sHt=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=ms.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===UO.vscodeRemote?ms.RemoteAuthorities.rewrite(e):e.scheme===UO.file&&(nHt.isNative||nHt.webWorkerOrigin===`${UO.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:UO.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===UO.vscodeFileResource?e.with({scheme:UO.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(eJ.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return eJ.URI.joinPath(eJ.URI.parse(r,!0),e);let n=iHt.join(r,e);return eJ.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};ms.FileAccess=new sHt;ms.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});ms.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var v1n;(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:eJ.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})(v1n||(ms.COI=v1n={}))});var ZP=I(yr=>{"use strict";p();var _zo=yr&&yr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vzo=yr&&yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),I1n=yr&&yr.__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;oRue.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=Y_.sep){return(0,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=Y_.sep){let n=!1;if(e.scheme===Nq.Schemas.file){let o=QO(e);n=o!==void 0&&o.length===Rue.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,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path+"/"}):e}};yr.ExtUri=kue;yr.extUri=new kue(()=>!1);yr.extUriBiasedIgnorePathCase=new kue(t=>t.scheme===Nq.Schemas.file?!x1n.isLinux:!0);yr.extUriIgnorePathCase=new kue(t=>!0);yr.isEqual=yr.extUri.isEqual.bind(yr.extUri);yr.isEqualOrParent=yr.extUri.isEqualOrParent.bind(yr.extUri);yr.getComparisonKey=yr.extUri.getComparisonKey.bind(yr.extUri);yr.basenameOrAuthority=yr.extUri.basenameOrAuthority.bind(yr.extUri);yr.basename=yr.extUri.basename.bind(yr.extUri);yr.extname=yr.extUri.extname.bind(yr.extUri);yr.dirname=yr.extUri.dirname.bind(yr.extUri);yr.joinPath=yr.extUri.joinPath.bind(yr.extUri);yr.normalizePath=yr.extUri.normalizePath.bind(yr.extUri);yr.relativePath=yr.extUri.relativePath.bind(yr.extUri);yr.resolvePath=yr.extUri.resolvePath.bind(yr.extUri);yr.isAbsolutePath=yr.extUri.isAbsolutePath.bind(yr.extUri);yr.isEqualAuthority=yr.extUri.isEqualAuthority.bind(yr.extUri);yr.hasTrailingPathSeparator=yr.extUri.hasTrailingPathSeparator.bind(yr.extUri);yr.removeTrailingPathSeparator=yr.extUri.removeTrailingPathSeparator.bind(yr.extUri);yr.addTrailingPathSeparator=yr.extUri.addTrailingPathSeparator.bind(yr.extUri);function Czo(t,e){let r=[];for(let n=0;nc===n?!1:(0,yr.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(Czo,"distinctParents");var T1n;(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})(T1n||(yr.DataUri=T1n={}));function bzo(t,e,r){if(e){let n=t.path;return n&&n[0]!==Y_.posix.sep&&(n=Y_.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a(bzo,"toLocalResource")});var w1n=I(tZe=>{"use strict";p();Object.defineProperty(tZe,"__esModule",{value:!0});tZe.MicrotaskDelay=void 0;tZe.MicrotaskDelay=Symbol("MicrotaskDelay")});var nl=I(Kt=>{"use strict";p();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.AsyncReader=Kt.AsyncReaderEndOfStream=Kt.CancelableAsyncIterableProducer=Kt.AsyncIterableProducer=Kt.AsyncIterableSource=Kt.AsyncIterableObject=Kt.LazyStatefulPromise=Kt.StatefulPromise=Kt.Promises=Kt.DeferredPromise=Kt.IntervalCounter=Kt.TaskSequentializer=Kt.GlobalIdleValue=Kt.AbstractIdleValue=Kt._runWhenIdle=Kt.runWhenGlobalIdle=Kt.ThrottledWorker=Kt.RunOnceWorker=Kt.ProcessTimeRunOnceScheduler=Kt.RunOnceScheduler=Kt.IntervalTimer=Kt.TimeoutTimer=Kt.TaskQueue=Kt.ResourceQueue=Kt.LimitedQueue=Kt.Queue=Kt.Limiter=Kt.AutoOpenBarrier=Kt.Barrier=Kt.ThrottledDelayer=Kt.Delayer=Kt.SequencerByKey=Kt.Sequencer=Kt.Throttler=void 0;Kt.isThenable=P1n;Kt.createCancelablePromise=D1n;Kt.raceCancellation=N1n;Kt.raceCancellationError=xzo;Kt.rejectIfNotCanceled=wzo;Kt.notCancellablePromise=Rzo;Kt.raceCancellablePromises=kzo;Kt.raceTimeout=M1n;Kt.asPromise=Pzo;Kt.promiseWithResolvers=O1n;Kt.timeout=xHt;Kt.disposableTimeout=Mzo;Kt.sequence=Ozo;Kt.first=Lzo;Kt.firstParallel=Bzo;Kt.installFakeRunWhenIdle=Fzo;Kt.retry=Uzo;Kt.createCancelableAsyncIterableProducer=Qzo;Kt.cancellableIterable=qzo;Kt.createTimeout=jzo;var IHt=YP(),K_=Rs(),pwe=Ic(),Mq=Ro(),R1n=ZP(),Szo=Rq(),Tzo=w1n(),Izo=eF();function P1n(t){return!!t&&typeof t.then=="function"}a(P1n,"isThenable");function D1n(t){let e=new IHt.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new K_.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,Mq.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(D1n,"createCancelablePromise");function N1n(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(N1n,"raceCancellation");function xzo(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new K_.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(xzo,"raceCancellationError");function wzo(t){if(!(0,K_.isCancellationError)(t))return Promise.reject(t)}a(wzo,"rejectIfNotCanceled");function Rzo(t){return new Promise((e,r)=>{t.then(e,r)})}a(Rzo,"notCancellablePromise");function kzo(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(kzo,"raceCancellablePromises");function M1n(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(M1n,"raceTimeout");function Pzo(t){return new Promise((e,r)=>{let n=t();P1n(n)?n.then(e,r):e(n)})}a(Pzo,"asPromise");function O1n(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(O1n,"promiseWithResolvers");var rZe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new IHt.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()}};Kt.Throttler=rZe;var cHt=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Kt.Sequencer=cHt;var lHt=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()}};Kt.SequencerByKey=lHt;var Dzo=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"),Nzo=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),nZe=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===Tzo.MicrotaskDelay?Nzo(n):Dzo(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new K_.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Kt.Delayer=nZe;var uHt=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new nZe(e),this.throttler=new rZe}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()}};Kt.ThrottledDelayer=uHt;var iZe=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}};Kt.Barrier=iZe;var dHt=class extends iZe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Kt.AutoOpenBarrier=dHt;function xHt(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new K_.CancellationError)})}):D1n(r=>xHt(t,r))}a(xHt,"timeout");function Mzo(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,Mq.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(Mzo,"disposableTimeout");function Ozo(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(Lzo,"first");function Bzo(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(Bzo,"firstParallel");var oZe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new pwe.Emitter}whenIdle(){return this.size>0?pwe.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()}};Kt.Limiter=oZe;var sZe=class extends oZe{static{a(this,"Queue")}constructor(){super(1)}};Kt.Queue=sZe;var fHt=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new cZe,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};Kt.LimitedQueue=fHt;var pHt=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 rF;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=R1n.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=R1n.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new sZe;let c=this.drainListenerCount++,l=pwe.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 Mq.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()}};Kt.ResourceQueue=pHt;var hHt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new rF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new rF;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 K_.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 K_.CancellationError)}};Kt.TaskQueue=hHt;var mHt=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 K_.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 K_.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Kt.TimeoutTimer=mHt;var gHt=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 K_.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,Mq.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Kt.IntervalTimer=gHt;var hwe=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?.()}};Kt.RunOnceScheduler=hwe;var AHt=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?.())}};Kt.ProcessTimeRunOnceScheduler=AHt;var yHt=class extends hwe{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()}};Kt.RunOnceWorker=yHt;var EHt=class extends Mq.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new Mq.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 hwe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Kt.ThrottledWorker=EHt;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Kt._runWhenIdle=(e,r,n)=>{(0,Szo.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)}}}:Kt._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))}}},Kt.runWhenGlobalIdle=(e,r)=>(0,Kt._runWhenIdle)(globalThis,e,r)})();function Fzo(t){let e=Kt._runWhenIdle,r=Kt.runWhenGlobalIdle;return Kt._runWhenIdle=t,Kt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,Mq.toDisposable)(()=>{Kt._runWhenIdle=e,Kt.runWhenGlobalIdle=r})}a(Fzo,"installFakeRunWhenIdle");var aZe=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,Kt._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}};Kt.AbstractIdleValue=aZe;var _Ht=class extends aZe{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Kt.GlobalIdleValue=_Ht;async function Uzo(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}=O1n();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}};Kt.TaskSequentializer=cZe;var vHt=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}};Kt.IntervalCounter=vHt;var rF=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 K_.CancellationError)}};Kt.DeferredPromise=rF;var k1n;(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})(k1n||(Kt.Promises=k1n={}));var lZe=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 K_.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Kt.StatefulPromise=lZe;var CHt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new Izo.Lazy(()=>new lZe(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Kt.LazyStatefulPromise=CHt;var uZe=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 pwe.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=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())}};Kt.AsyncIterableObject=uZe;function Qzo(t){let e=new IHt.CancellationTokenSource,r=t(e.token);return new fZe(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new K_.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(Qzo,"createCancelableAsyncIterableProducer");var bHt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new rF,this._asyncIterable=new uZe(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)}};Kt.AsyncIterableSource=bHt;function qzo(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await N1n(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(qzo,"cancellableIterable");var SHt=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 K_.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 rF;return this._unsatisfiedConsumers.push(e),e.p}}},dZe=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new SHt,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 rF,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}};Kt.AsyncIterableProducer=dZe;var fZe=class extends dZe{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Kt.CancelableAsyncIterableProducer=fZe;Kt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var THt=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?Kt.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,r){do{let n=await this.peek();if(n===Kt.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?Kt.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return Kt.AsyncReaderEndOfStream;throw new K_.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await M1n(this._extendBuffer(),e),this._atEnd)return Kt.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)}};Kt.AsyncReader=THt;function jzo(t,e){let r=setTimeout(e,t);return(0,Mq.toDisposable)(()=>clearTimeout(r))}a(jzo,"createTimeout")});var H1n=I(JS=>{"use strict";p();var Wzo=JS&&JS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(JS,"__esModule",{value:!0});var zzo=require("fs"),Yzo=Wzo(EP()),Due=Yzo.default("@kwsites/file-exists");function Kzo(t,e,r){Due("checking %s",t);try{let n=zzo.statSync(t);return n.isFile()&&e?(Due("[OK] path represents a file"),!0):n.isDirectory()&&r?(Due("[OK] path represents a directory"),!0):(Due("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Due("[FAIL] path is not accessible: %o",n),!1;throw Due("[FATAL] %o",n),n}}a(Kzo,"check");function Jzo(t,e=JS.READABLE){return Kzo(t,(e&JS.FILE)>0,(e&JS.FOLDER)>0)}a(Jzo,"exists");JS.exists=Jzo;JS.FILE=1;JS.FOLDER=2;JS.READABLE=JS.FILE+JS.FOLDER});var G1n=I(yZe=>{"use strict";p();function Zzo(t){for(var e in t)yZe.hasOwnProperty(e)||(yZe[e]=t[e])}a(Zzo,"__export");Object.defineProperty(yZe,"__esModule",{value:!0});Zzo(H1n())});var V1n=I((k0d,$1n)=>{p();var Oue=1e3,Lue=Oue*60,Bue=Lue*60,rJ=Bue*24,Xzo=rJ*7,eYo=rJ*365.25;$1n.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return tYo(t);if(r==="number"&&isFinite(t))return e.long?nYo(t):rYo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function tYo(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*eYo;case"weeks":case"week":case"w":return r*Xzo;case"days":case"day":case"d":return r*rJ;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Bue;case"minutes":case"minute":case"mins":case"min":case"m":return r*Lue;case"seconds":case"second":case"secs":case"sec":case"s":return r*Oue;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(tYo,"parse");function rYo(t){var e=Math.abs(t);return e>=rJ?Math.round(t/rJ)+"d":e>=Bue?Math.round(t/Bue)+"h":e>=Lue?Math.round(t/Lue)+"m":e>=Oue?Math.round(t/Oue)+"s":t+"ms"}a(rYo,"fmtShort");function nYo(t){var e=Math.abs(t);return e>=rJ?EZe(t,e,rJ,"day"):e>=Bue?EZe(t,e,Bue,"hour"):e>=Lue?EZe(t,e,Lue,"minute"):e>=Oue?EZe(t,e,Oue,"second"):t+" ms"}a(nYo,"fmtLong");function EZe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(EZe,"plural")});var PHt=I((N0d,W1n)=>{p();function iYo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=V1n(),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 P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,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(E=>{m=E},"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(iYo,"setup");W1n.exports=iYo});var z1n=I((ZS,_Ze)=>{p();ZS.formatArgs=sYo;ZS.save=aYo;ZS.load=cYo;ZS.useColors=oYo;ZS.storage=lYo();ZS.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`."))}})();ZS.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 oYo(){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(oYo,"useColors");function sYo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+_Ze.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(sYo,"formatArgs");ZS.log=console.debug||console.log||(()=>{});function aYo(t){try{t?ZS.storage.setItem("debug",t):ZS.storage.removeItem("debug")}catch{}}a(aYo,"save");function cYo(){let t;try{t=ZS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(cYo,"load");function lYo(){try{return localStorage}catch{}}a(lYo,"localstorage");_Ze.exports=PHt()(ZS);var{formatters:uYo}=_Ze.exports;uYo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var K1n=I((vg,CZe)=>{p();var dYo=require("tty"),vZe=require("util");vg.init=yYo;vg.log=mYo;vg.formatArgs=pYo;vg.save=gYo;vg.load=AYo;vg.useColors=fYo;vg.destroy=vZe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");vg.colors=[6,2,3,4,5,1];try{let t=LGe();t&&(t.stderr||t).level>=2&&(vg.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{}vg.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 fYo(){return"colors"in vg.inspectOpts?!!vg.inspectOpts.colors:dYo.isatty(process.stderr.fd)}a(fYo,"useColors");function pYo(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(` +`))}},cwe=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"}};Ga.ListenerLeakError=cwe;var jJe=class extends cwe{static{a(this,"ListenerRefusalError")}constructor(e,r,n,o,s){super(e,r,n,o,s),this.name="ListenerRefusalError"}};Ga.ListenerRefusalError=jJe;var yVo=0,bue=class{static{a(this,"UniqueContainer")}constructor(e){this.value=e,this.id=yVo++}},EVo=2,zbn=a((t,e)=>{if(t instanceof bue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new Pjt(e?.onListenerError??swe.onUnexpectedError,this._options?.leakWarningThreshold??awe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new qJe(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(Hbn){let e=this._listeners;queueMicrotask(()=>{zbn(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 jJe(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||swe.onUnexpectedError)(h),WC.Disposable.None}if(this._disposed)return WC.Disposable.None;r&&(e=e.bind(r));let o=new bue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Sue.create(),s=this._leakageMon.check(o.stack,this._size+1)),Hbn&&(o.stack=c??Sue.create()),this._listeners?this._listeners instanceof bue?(this._deliveryQueue??=new HJe,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,WC.toDisposable)(()=>{s?.(),this._removeListener(o)});return Qjt(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*EVo<=r.length){let s=0;for(let c=0;c0}};Ga.Emitter=dE;var _Vo=a(()=>new HJe,"createEventDeliveryQueue");Ga.createEventDeliveryQueue=_Vo;var HJe=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}},Djt=class extends dE{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new Wbn.LinkedList),zbn(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,swe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,swe.onUnexpectedError)(d.reason)})}}};Ga.AsyncEmitter=Djt;var GJe=class extends dE{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new Wbn.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))}};Ga.PauseableEmitter=GJe;var Njt=class extends GJe{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)}};Ga.DebounceEmitter=Njt;var Mjt=class extends dE{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=[]}))}};Ga.MicrotaskEmitter=Mjt;var $Je=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new dE({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,WC.toDisposable)((0,fVo.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=[]}};Ga.EventMultiplexer=$Je;var Ojt=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new WC.DisposableStore;let s=this._store.add(new $Je),c=this._store.add(new WC.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()}};Ga.DynamicListEventMultiplexer=Ojt;var Ljt=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}};Ga.EventBufferer=Ljt;var Bjt=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=QJe.None,this.inputEventListener=WC.Disposable.None,this.emitter=new dE({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()}};Ga.Relay=Bjt;var Fjt=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new Ujt(e)}constructor(e){this._value=e,this._onDidChange=new dE,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};Ga.ValueWithChangeEvent=Fjt;var Ujt=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=QJe.None}};function vVo(t,e,r){let n=new WC.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new WC.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,dVo.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(vVo,"trackSetChanges");function Qjt(t,e){e instanceof WC.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(Qjt,"addToDisposables");function Vbn(t,e){if(e instanceof WC.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a(Vbn,"disposeAndRemove")});var KP=I(Z3=>{"use strict";p();Object.defineProperty(Z3,"__esModule",{value:!0});Z3.CancellationTokenPool=Z3.CancellationTokenSource=Z3.CancellationToken=void 0;Z3.cancelOnDispose=bVo;var Ybn=Ic(),CVo=ko(),Kbn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),VJe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof Tue?!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:Ybn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Kbn})})(VJe||(Z3.CancellationToken=VJe={}));var Tue=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?Kbn:(this._emitter||(this._emitter=new Ybn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},lwe=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 Tue),this._token}cancel(){this._token?this._token instanceof Tue&&this._token.cancel():this._token=VJe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Tue&&this._token.dispose():this._token=VJe.None}};Z3.CancellationTokenSource=lwe;function bVo(t){let e=new lwe;return t.add({dispose(){e.cancel()}}),e.token}a(bVo,"cancelOnDispose");var qjt=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new lwe,this._listeners=new CVo.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()}};Z3.CancellationTokenPool=qjt});var NA=I(Jr=>{"use strict";p();var SVo=Jr&&Jr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TVo=Jr&&Jr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),IVo=Jr&&Jr.__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=xVo&&t<=RVo||t>=wVo&&t<=kVo}a(eF,"isWindowsDeviceRoot");function zJe(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===XK&&l!==-1?++l:l=-1}return o}a(zJe,"normalizeString");function NVo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(NVo,"formatExt");function Jbn(t,e){DVo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${NVo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(Jbn,"_format");Jr.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],cp(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=Iue.cwd():(s=Iue.env[`=${e}`]||Iue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===zC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Jo(f)&&(l=1,d=!0);else if(Jo(f))if(d=!0,Jo(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Jo(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=zJe(r,!n,"\\",Jo),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){cp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return jjt(s)?"\\":t;if(Jo(s))if(o=!0,Jo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Jo(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Jo(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&eF(c.charCodeAt(0))&&c.charCodeAt(1)===X3)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||Jo(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){cp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Jo(r)||e>2&&eF(r)&&t.charCodeAt(1)===X3&&Jo(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"&&Jo(r.charCodeAt(0))){++o;let s=r.length;s>1&&Jo(r.charCodeAt(1))&&(++o,s>2&&(Jo(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Jr.win32.normalize(e)},relative(t,e){if(cp(t,"from"),cp(e,"to"),t===e)return"";let r=Jr.win32.resolve(t),n=Jr.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 E=A.length,_=y.length,v=E<_?E:_,b;for(b=0;bv?y.slice(b).join("\\"):E>v?"..\\".repeat(E-1-b)+"..":"":"..\\".repeat(E-b)+y.slice(b).join("\\")}let o=0;for(;oo&&t.charCodeAt(s-1)===zC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===zC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===zC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===zC?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)===zC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===zC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Jr.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===zC){if(e.charCodeAt(1)===zC){let r=e.charCodeAt(2);if(r!==PVo&&r!==XK)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(eF(e.charCodeAt(0))&&e.charCodeAt(1)===X3&&e.charCodeAt(2)===zC)return`\\\\?\\${e}`;return e},dirname(t){cp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Jo(o)?t:".";if(Jo(o)){if(r=n=1,Jo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Jo(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Jo(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&&cp(e,"suffix"),cp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&eF(t.charCodeAt(0))&&t.charCodeAt(1)===X3&&(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(Jo(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(Jo(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){cp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===X3&&eF(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Jo(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===XK?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:Jbn.bind(null,"\\"),parse(t){cp(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 Jo(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Jo(o)){if(n=1,Jo(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),Jo(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===XK?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 MVo=(()=>{if(YC){let t=/\\/g;return()=>{let e=Iue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Iue.cwd()})();Jr.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];cp(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===_g)}if(!r){let n=MVo();e=`${n}/${e}`,r=n.charCodeAt(0)===_g}return e=zJe(e,!r,"/",jjt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(cp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===_g,r=t.charCodeAt(t.length-1)===_g;return t=zJe(t,!e,"/",jjt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return cp(t,"path"),t.length>0&&t.charCodeAt(0)===_g},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":Jr.posix.normalize(e.join("/"))},relative(t,e){if(cp(t,"from"),cp(e,"to"),t===e||(t=Jr.posix.resolve(t),e=Jr.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)===_g)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===_g?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===_g)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(cp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===_g,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===_g){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&&cp(e,"suffix"),cp(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===_g){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)===_g){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){cp(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:Jbn.bind(null,"/"),parse(t){cp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===_g,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===_g){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===XK?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};Jr.posix.win32=Jr.win32.win32=Jr.win32;Jr.posix.posix=Jr.win32.posix=Jr.posix;Jr.normalize=YC?Jr.win32.normalize:Jr.posix.normalize;Jr.isAbsolute=YC?Jr.win32.isAbsolute:Jr.posix.isAbsolute;Jr.join=YC?Jr.win32.join:Jr.posix.join;Jr.resolve=YC?Jr.win32.resolve:Jr.posix.resolve;Jr.relative=YC?Jr.win32.relative:Jr.posix.relative;Jr.dirname=YC?Jr.win32.dirname:Jr.posix.dirname;Jr.basename=YC?Jr.win32.basename:Jr.posix.basename;Jr.extname=YC?Jr.win32.extname:Jr.posix.extname;Jr.format=YC?Jr.win32.format:Jr.posix.format;Jr.parse=YC?Jr.win32.parse:Jr.posix.parse;Jr.toNamespacedPath=YC?Jr.win32.toNamespacedPath:Jr.posix.toNamespacedPath;Jr.sep=YC?Jr.win32.sep:Jr.posix.sep;Jr.delimiter=YC?Jr.win32.delimiter:Jr.posix.delimiter});var KJe=I(JP=>{"use strict";p();Object.defineProperty(JP,"__esModule",{value:!0});JP.WeakCachedFunction=JP.CachedFunction=JP.LRUCachedFunction=JP.Cache=void 0;JP.identity=YJe;var OVo=KP(),Hjt=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new OVo.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};JP.Cache=Hjt;function YJe(t){return t}a(YJe,"identity");var Gjt=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=YJe):(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}};JP.LRUCachedFunction=Gjt;var $jt=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=YJe):(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}};JP.CachedFunction=$jt;var Vjt=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=YJe):(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}};JP.WeakCachedFunction=Vjt});var tF=I(JJe=>{"use strict";p();Object.defineProperty(JJe,"__esModule",{value:!0});JJe.Lazy=void 0;var Pq;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(Pq||(Pq={}));var Wjt=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=Pq.Uninitialized}get hasValue(){return this._state===Pq.Completed}get value(){if(this._state===Pq.Uninitialized){this._state=Pq.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=Pq.Completed}}else if(this._state===Pq.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}};JJe.Lazy=Wjt});var em=I(kr=>{"use strict";p();Object.defineProperty(kr,"__esModule",{value:!0});kr.Ellipsis=kr.InvisibleCharacters=kr.AmbiguousCharacters=kr.noBreakWhitespace=kr.UTF8_BOM_CHARACTER=kr.UNUSUAL_LINE_TERMINATORS=kr.GraphemeIterator=kr.CodePointIterator=void 0;kr.isFalsyOrWhitespace=BVo;kr.format=UVo;kr.format2=qVo;kr.htmlAttributeEncodeValue=jVo;kr.escape=HVo;kr.escapeRegExpCharacters=e1n;kr.count=GVo;kr.truncate=$Vo;kr.truncateMiddle=VVo;kr.trim=WVo;kr.ltrim=t1n;kr.rtrim=r1n;kr.convertSimple2RegExpPattern=zVo;kr.createRegExp=YVo;kr.regExpLeadsToEndlessLoop=KVo;kr.joinStrings=JVo;kr.splitLines=ZVo;kr.splitLinesIncludeSeparators=XVo;kr.indexOfPattern=eWo;kr.firstNonWhitespaceIndex=n1n;kr.getLeadingWhitespace=tWo;kr.lastNonWhitespaceIndex=rWo;kr.getIndentationLength=nWo;kr.replaceAsync=iWo;kr.compare=oWo;kr.compareSubstring=i1n;kr.compareIgnoreCase=sWo;kr.compareSubstringIgnoreCase=dwe;kr.isAsciiDigit=aWo;kr.isLowerAsciiLetter=Yjt;kr.isUpperAsciiLetter=cWo;kr.equalsIgnoreCase=o1n;kr.equals=lWo;kr.startsWithIgnoreCase=uWo;kr.endsWithIgnoreCase=dWo;kr.commonPrefixLength=fWo;kr.commonSuffixLength=pWo;kr.isHighSurrogate=Zjt;kr.isLowSurrogate=ZJe;kr.computeCodePoint=Xjt;kr.getNextCodePoint=s1n;kr.nextCharLength=a1n;kr.prevCharLength=c1n;kr.getCharContainingOffset=mWo;kr.charCount=gWo;kr.containsRTL=yWo;kr.isBasicASCII=_Wo;kr.containsUnusualLineTerminators=vWo;kr.isFullWidthCharacter=CWo;kr.isEmojiImprecise=l1n;kr.lcut=bWo;kr.rcut=SWo;kr.forAnsiStringParts=wWo;kr.removeAnsiEscapeCodes=d1n;kr.removeAnsiEscapeCodesFromPrompt=kWo;kr.startsWithUTF8BOM=f1n;kr.stripUTF8BOM=PWo;kr.fuzzyContains=DWo;kr.containsUppercaseCharacter=NWo;kr.uppercaseFirstLetter=MWo;kr.getNLines=OWo;kr.singleLetterHash=LWo;kr.getGraphemeBreakType=BWo;kr.getLeftDeleteOffset=UWo;kr.multibyteAwareBtoa=HWo;var LVo=KJe(),Zbn=tF();function BVo(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(BVo,"isFalsyOrWhitespace");var FVo=/{(\d+)}/g;function UVo(t,...e){return e.length===0?t:t.replace(FVo,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(UVo,"format");var QVo=/{([^}]+)}/g;function qVo(t,e){return Object.keys(e).length===0?t:t.replace(QVo,(r,n)=>e[n]??r)}a(qVo,"format2");function jVo(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(jVo,"htmlAttributeEncodeValue");function HVo(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(HVo,"escape");function e1n(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(e1n,"escapeRegExpCharacters");function GVo(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(GVo,"count");function $Vo(t,e,r=kr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a($Vo,"truncate");function VVo(t,e,r=kr.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(VVo,"truncateMiddle");function WVo(t,e=" "){let r=t1n(t,e);return r1n(r,e)}a(WVo,"trim");function t1n(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(r1n,"rtrim");function zVo(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(zVo,"convertSimple2RegExpPattern");function YVo(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=e1n(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(YVo,"createRegExp");function KVo(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(KVo,"regExpLeadsToEndlessLoop");function JVo(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(JVo,"joinStrings");function ZVo(t){return t.split(/\r\n|\r|\n/)}a(ZVo,"splitLines");function XVo(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(rWo,"lastNonWhitespaceIndex");function nWo(t){let e=n1n(t);return e===-1?t.length:e}a(nWo,"getIndentationLength");function iWo(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(iWo,"replaceAsync");function oWo(t,e){return te?1:0}a(oWo,"compare");function i1n(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(i1n,"compareSubstring");function sWo(t,e){return dwe(t,e,0,t.length,0,e.length)}a(sWo,"compareIgnoreCase");function dwe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return i1n(t.toLowerCase(),e.toLowerCase(),r,n,o,s);Yjt(u)&&(u-=32),Yjt(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(dwe,"compareSubstringIgnoreCase");function aWo(t){return t>=48&&t<=57}a(aWo,"isAsciiDigit");function Yjt(t){return t>=97&&t<=122}a(Yjt,"isLowerAsciiLetter");function cWo(t){return t>=65&&t<=90}a(cWo,"isUpperAsciiLetter");function o1n(t,e){return t.length===e.length&&dwe(t,e)===0}a(o1n,"equalsIgnoreCase");function lWo(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&o1n(t,e)}a(lWo,"equals");function uWo(t,e){let r=e.length;return r<=t.length&&dwe(t,e,0,r)===0}a(uWo,"startsWithIgnoreCase");function dWo(t,e){let r=t.length,n=r-e.length;return n>=0&&dwe(t,e,n,r)===0}a(dWo,"endsWithIgnoreCase");function fWo(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(Zjt(n))return Xjt(n,r)}return r}a(hWo,"getPrevCodePoint");var xue=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=hWo(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=s1n(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};kr.CodePointIterator=xue;var wue=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new xue(e,r)}nextGraphemeLength(){let e=uwe.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(Xbn(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=uwe.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(Xbn(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};kr.GraphemeIterator=wue;function a1n(t,e){return new wue(t,e).nextGraphemeLength()}a(a1n,"nextCharLength");function c1n(t,e){return new wue(t,e).prevGraphemeLength()}a(c1n,"prevCharLength");function mWo(t,e){e>0&&ZJe(t.charCodeAt(e))&&e--;let r=e+a1n(t,e);return[r-c1n(t,r),r]}a(mWo,"getCharContainingOffset");function gWo(t){let e=new wue(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(gWo,"charCount");var zjt;function AWo(){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(AWo,"makeContainsRtl");function yWo(t){return zjt||(zjt=AWo()),zjt.test(t)}a(yWo,"containsRTL");var EWo=/^[\t\n\r\x20-\x7E]*$/;function _Wo(t){return EWo.test(t)}a(_Wo,"isBasicASCII");kr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function vWo(t){return kr.UNUSUAL_LINE_TERMINATORS.test(t)}a(vWo,"containsUnusualLineTerminators");function CWo(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(CWo,"isFullWidthCharacter");function l1n(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(l1n,"isEmojiImprecise");function bWo(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@^`{}|~]/,IWo=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,xWo=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,u1n=new RegExp("(?:"+[TWo.source,IWo.source,xWo.source].join("|")+")","g");function*wWo(t){let e=0;for(let r of t.matchAll(u1n))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(wWo,"forAnsiStringParts");function d1n(t){return t&&(t=t.replace(u1n,"")),t}a(d1n,"removeAnsiEscapeCodes");var RWo=/\\\[.*?\\\]/g;function kWo(t){return d1n(t).replace(RWo,"")}a(kWo,"removeAnsiEscapeCodesFromPrompt");kr.UTF8_BOM_CHARACTER="\uFEFF";function f1n(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(f1n,"startsWithUTF8BOM");function PWo(t){return f1n(t)?t.substr(1):t}a(PWo,"stripUTF8BOM");function DWo(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(OWo,"getNLines");function LWo(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(LWo,"singleLetterHash");function BWo(t){return uwe.getInstance().getGraphemeBreakType(t)}a(BWo,"getGraphemeBreakType");function Xbn(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(Xbn,"breakBetweenGraphemeBreakType");var uwe=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=FWo()}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 FWo(){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(FWo,"getGraphemeBreakRawData");function UWo(t,e){if(t===0)return 0;let r=QWo(t,e);if(r!==void 0)return r;let n=new xue(e,t);return n.prevCodePoint(),n.offset}a(UWo,"getLeftDeleteOffset");function QWo(t,e){let r=new xue(e,t),n=r.prevCodePoint();for(;qWo(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!l1n(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(QWo,"getOffsetBeforeLastEmojiComponent");function qWo(t){return 127995<=t&&t<=127999}a(qWo,"isEmojiModifier");kr.noBreakWhitespace="\xA0";var Kjt=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new Zbn.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 LVo.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 Zbn.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(d0,"__esModule",{value:!0});d0.isPathSeparator=rF;d0.toSlashes=p1n;d0.toPosixPath=$Wo;d0.getRoot=VWo;d0.isUNC=WWo;d0.isValidBasename=JWo;d0.isEqual=ZWo;d0.isEqualOrParent=XWo;d0.isWindowsDriveLetter=eHt;d0.sanitizeFilePath=ezo;d0.removeTrailingPathSeparator=h1n;d0.isRootOrDriveLetter=tzo;d0.hasDriveLetter=tHt;d0.getDriveLetter=rzo;d0.indexOfPath=nzo;d0.parseLineAndColumnAware=izo;d0.randomPath=azo;var u0=NA(),Dq=kq(),XJe=em(),GWo=ZS();function rF(t){return t===47||t===92}a(rF,"isPathSeparator");function p1n(t){return t.replace(/[\\/]/g,u0.posix.sep)}a(p1n,"toSlashes");function $Wo(t){return t.indexOf("/")===-1&&(t=p1n(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a($Wo,"toPosixPath");function VWo(t,e=u0.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(rF(n)){if(rF(t.charCodeAt(1))&&!rF(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,YWo=/[/]/g,KWo=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function JWo(t,e=Dq.isWindows){let r=e?zWo:YWo;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&KWo.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(JWo,"isValidBasename");function ZWo(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,XJe.equalsIgnoreCase)(t,e)}a(ZWo,"isEqual");function XWo(t,e,r,n=!1){let o=n?u0.posix.sep:u0.sep;if(t===e)return!0;if(!t||!e||((t.indexOf("..")>=0||e.indexOf("..")>=0)&&(t=n?u0.posix.normalize(t):(0,u0.normalize)(t),e=n?u0.posix.normalize(e):(0,u0.normalize)(e)),e.length>t.length))return!1;if(r){if(!(0,XJe.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(XWo,"isEqualOrParent");function eHt(t){return t>=65&&t<=90||t>=97&&t<=122}a(eHt,"isWindowsDriveLetter");function ezo(t,e){return Dq.isWindows&&t.endsWith(":")&&(t+=u0.sep),(0,u0.isAbsolute)(t)||(t=(0,u0.join)(e,t)),t=(0,u0.normalize)(t),h1n(t)}a(ezo,"sanitizeFilePath");function h1n(t){return Dq.isWindows?(t=(0,XJe.rtrim)(t,u0.sep),t.endsWith(":")&&(t+=u0.sep)):(t=(0,XJe.rtrim)(t,u0.sep),t||(t=u0.sep)),t}a(h1n,"removeTrailingPathSeparator");function tzo(t){let e=(0,u0.normalize)(t);return Dq.isWindows?t.length>3?!1:tHt(e)&&(t.length===2||e.charCodeAt(2)===92):e===u0.posix.sep}a(tzo,"isRootOrDriveLetter");function tHt(t,e=Dq.isWindows){return e?eHt(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(tHt,"hasDriveLetter");function rzo(t,e=Dq.isWindows){return tHt(t,e)?t[0]:void 0}a(rzo,"getDriveLetter");function nzo(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(nzo,"indexOfPath");function izo(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,GWo.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(izo,"parseLineAndColumnAware");var ozo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",szo="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function azo(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var czo=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]})),lzo=ow&&ow.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),uzo=ow&&ow.__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(!fzo.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(pzo.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(hzo,"_validateUri");function mzo(t,e){return!t&&!e?"file":t}a(mzo,"_schemeFix");function gzo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==ZP&&(e=ZP+e):e=ZP;break}return e}a(gzo,"_referenceResolution");var Gl="",ZP="/",Azo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,rZe=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||Gl,this.authority=e.authority||Gl,this.path=e.path||Gl,this.query=e.query||Gl,this.fragment=e.fragment||Gl):(this.scheme=mzo(e,c),this.authority=r||Gl,this.path=gzo(this.scheme,n||Gl),this.query=o||Gl,this.fragment=s||Gl,hzo(this,c))}get fsPath(){return nZe(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=Gl),n===void 0?n=this.authority:n===null&&(n=Gl),o===void 0?o=this.path:o===null&&(o=Gl),s===void 0?s=this.query:s===null&&(s=Gl),c===void 0?c=this.fragment:c===null&&(c=Gl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new Nq(r,n,o,s,c)}static parse(e,r=!1){let n=Azo.exec(e);return n?new Nq(n[2]||Gl,eZe(n[4]||Gl),eZe(n[5]||Gl),eZe(n[7]||Gl),eZe(n[9]||Gl),r):new Nq(Gl,Gl,Gl,Gl,Gl)}static file(e){let r=Gl;if(tZe.isWindows&&(e=e.replace(/\\/g,ZP)),e[0]===ZP&&e[1]===ZP){let n=e.indexOf(ZP,2);n===-1?(r=e.substring(2),e=ZP):(r=e.substring(2,n),e=e.substring(n)||ZP)}return new Nq("file",r,e,Gl,Gl)}static from(e,r){return new Nq(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 tZe.isWindows&&e.scheme==="file"?n=t.file(m1n.win32.join(nZe(e,!0),...r)).path:n=m1n.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return nHt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new Nq(e);return r._formatted=e.external??null,r._fsPath=e._sep===y1n?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};ow.URI=rZe;function yzo(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(yzo,"isUriComponents");var y1n=tZe.isWindows?1:void 0,Nq=class extends rZe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=nZe(this,!1)),this._fsPath}toString(e=!1){return e?nHt(this,!0):(this._formatted||(this._formatted=nHt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=y1n),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}},E1n={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 g1n(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=E1n[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(g1n,"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,tZe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(nZe,"uriToFsPath");function nHt(t,e){let r=e?Ezo:g1n,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=ZP,n+=ZP),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:g1n(u,!1,!1)),n}a(nHt,"_asFormatted");function _1n(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+_1n(t.substr(3)):t}}a(_1n,"decodeURIComponentGraceful");var A1n=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function eZe(t){return t.match(A1n)?t.replace(A1n,e=>_1n(e)):t}a(eZe,"percentDecode")});var tJ=I(ms=>{"use strict";p();var _zo=ms&&ms.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vzo=ms&&ms.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cHt=ms&&ms.__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;ob1n(t,r))}a(bzo,"matchesSomeScheme");ms.connectionTokenCookieName="vscode-tkn";ms.connectionTokenQueryName="tkn";var sHt=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=oHt.posix.join(r??"/",S1n(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return oHt.posix.join(this._serverRootPath,UO.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 Czo.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+=`&${ms.connectionTokenQueryName}=${encodeURIComponent(s)}`),eJ.URI.from({scheme:iHt.isWeb?this._preferredWebSchema:UO.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};ms.RemoteAuthorities=new sHt;function S1n(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(S1n,"getServerProductSegment");ms.builtinExtensionsPath="vs/../../extensions";ms.nodeModulesPath="vs/../../node_modules";ms.nodeModulesAsarPath="vs/../../node_modules.asar";ms.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";ms.VSCODE_AUTHORITY="vscode-app";var aHt=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=ms.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===UO.vscodeRemote?ms.RemoteAuthorities.rewrite(e):e.scheme===UO.file&&(iHt.isNative||iHt.webWorkerOrigin===`${UO.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:UO.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===UO.vscodeFileResource?e.with({scheme:UO.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(eJ.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return eJ.URI.joinPath(eJ.URI.parse(r,!0),e);let n=oHt.join(r,e);return eJ.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};ms.FileAccess=new aHt;ms.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});ms.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var C1n;(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:eJ.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})(C1n||(ms.COI=C1n={}))});var XP=I(yr=>{"use strict";p();var Szo=yr&&yr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Tzo=yr&&yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),x1n=yr&&yr.__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;oRue.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=K_.sep){return(0,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=K_.sep){let n=!1;if(e.scheme===Mq.Schemas.file){let o=QO(e);n=o!==void 0&&o.length===Rue.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,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path+"/"}):e}};yr.ExtUri=kue;yr.extUri=new kue(()=>!1);yr.extUriBiasedIgnorePathCase=new kue(t=>t.scheme===Mq.Schemas.file?!w1n.isLinux:!0);yr.extUriIgnorePathCase=new kue(t=>!0);yr.isEqual=yr.extUri.isEqual.bind(yr.extUri);yr.isEqualOrParent=yr.extUri.isEqualOrParent.bind(yr.extUri);yr.getComparisonKey=yr.extUri.getComparisonKey.bind(yr.extUri);yr.basenameOrAuthority=yr.extUri.basenameOrAuthority.bind(yr.extUri);yr.basename=yr.extUri.basename.bind(yr.extUri);yr.extname=yr.extUri.extname.bind(yr.extUri);yr.dirname=yr.extUri.dirname.bind(yr.extUri);yr.joinPath=yr.extUri.joinPath.bind(yr.extUri);yr.normalizePath=yr.extUri.normalizePath.bind(yr.extUri);yr.relativePath=yr.extUri.relativePath.bind(yr.extUri);yr.resolvePath=yr.extUri.resolvePath.bind(yr.extUri);yr.isAbsolutePath=yr.extUri.isAbsolutePath.bind(yr.extUri);yr.isEqualAuthority=yr.extUri.isEqualAuthority.bind(yr.extUri);yr.hasTrailingPathSeparator=yr.extUri.hasTrailingPathSeparator.bind(yr.extUri);yr.removeTrailingPathSeparator=yr.extUri.removeTrailingPathSeparator.bind(yr.extUri);yr.addTrailingPathSeparator=yr.extUri.addTrailingPathSeparator.bind(yr.extUri);function Izo(t,e){let r=[];for(let n=0;nc===n?!1:(0,yr.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(Izo,"distinctParents");var I1n;(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})(I1n||(yr.DataUri=I1n={}));function xzo(t,e,r){if(e){let n=t.path;return n&&n[0]!==K_.posix.sep&&(n=K_.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a(xzo,"toLocalResource")});var R1n=I(iZe=>{"use strict";p();Object.defineProperty(iZe,"__esModule",{value:!0});iZe.MicrotaskDelay=void 0;iZe.MicrotaskDelay=Symbol("MicrotaskDelay")});var nl=I(Kt=>{"use strict";p();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.AsyncReader=Kt.AsyncReaderEndOfStream=Kt.CancelableAsyncIterableProducer=Kt.AsyncIterableProducer=Kt.AsyncIterableSource=Kt.AsyncIterableObject=Kt.LazyStatefulPromise=Kt.StatefulPromise=Kt.Promises=Kt.DeferredPromise=Kt.IntervalCounter=Kt.TaskSequentializer=Kt.GlobalIdleValue=Kt.AbstractIdleValue=Kt._runWhenIdle=Kt.runWhenGlobalIdle=Kt.ThrottledWorker=Kt.RunOnceWorker=Kt.ProcessTimeRunOnceScheduler=Kt.RunOnceScheduler=Kt.IntervalTimer=Kt.TimeoutTimer=Kt.TaskQueue=Kt.ResourceQueue=Kt.LimitedQueue=Kt.Queue=Kt.Limiter=Kt.AutoOpenBarrier=Kt.Barrier=Kt.ThrottledDelayer=Kt.Delayer=Kt.SequencerByKey=Kt.Sequencer=Kt.Throttler=void 0;Kt.isThenable=D1n;Kt.createCancelablePromise=N1n;Kt.raceCancellation=M1n;Kt.raceCancellationError=Pzo;Kt.rejectIfNotCanceled=Dzo;Kt.notCancellablePromise=Nzo;Kt.raceCancellablePromises=Mzo;Kt.raceTimeout=O1n;Kt.asPromise=Ozo;Kt.promiseWithResolvers=L1n;Kt.timeout=wHt;Kt.disposableTimeout=Fzo;Kt.sequence=Uzo;Kt.first=Qzo;Kt.firstParallel=qzo;Kt.installFakeRunWhenIdle=jzo;Kt.retry=Hzo;Kt.createCancelableAsyncIterableProducer=Gzo;Kt.cancellableIterable=$zo;Kt.createTimeout=Vzo;var xHt=KP(),J_=Rs(),pwe=Ic(),Oq=ko(),k1n=XP(),wzo=kq(),Rzo=R1n(),kzo=tF();function D1n(t){return!!t&&typeof t.then=="function"}a(D1n,"isThenable");function N1n(t){let e=new xHt.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new J_.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,Oq.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(N1n,"createCancelablePromise");function M1n(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(M1n,"raceCancellation");function Pzo(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new J_.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(Pzo,"raceCancellationError");function Dzo(t){if(!(0,J_.isCancellationError)(t))return Promise.reject(t)}a(Dzo,"rejectIfNotCanceled");function Nzo(t){return new Promise((e,r)=>{t.then(e,r)})}a(Nzo,"notCancellablePromise");function Mzo(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(Mzo,"raceCancellablePromises");function O1n(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(O1n,"raceTimeout");function Ozo(t){return new Promise((e,r)=>{let n=t();D1n(n)?n.then(e,r):e(n)})}a(Ozo,"asPromise");function L1n(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(L1n,"promiseWithResolvers");var oZe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new xHt.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()}};Kt.Throttler=oZe;var lHt=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Kt.Sequencer=lHt;var uHt=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()}};Kt.SequencerByKey=uHt;var Lzo=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"),Bzo=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),sZe=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===Rzo.MicrotaskDelay?Bzo(n):Lzo(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new J_.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Kt.Delayer=sZe;var dHt=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new sZe(e),this.throttler=new oZe}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()}};Kt.ThrottledDelayer=dHt;var aZe=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}};Kt.Barrier=aZe;var fHt=class extends aZe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Kt.AutoOpenBarrier=fHt;function wHt(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new J_.CancellationError)})}):N1n(r=>wHt(t,r))}a(wHt,"timeout");function Fzo(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,Oq.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(Fzo,"disposableTimeout");function Uzo(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(Qzo,"first");function qzo(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(qzo,"firstParallel");var cZe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new pwe.Emitter}whenIdle(){return this.size>0?pwe.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()}};Kt.Limiter=cZe;var lZe=class extends cZe{static{a(this,"Queue")}constructor(){super(1)}};Kt.Queue=lZe;var pHt=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new dZe,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};Kt.LimitedQueue=pHt;var hHt=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 nF;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=k1n.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=k1n.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new lZe;let c=this.drainListenerCount++,l=pwe.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 Oq.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()}};Kt.ResourceQueue=hHt;var mHt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new nF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new nF;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 J_.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 J_.CancellationError)}};Kt.TaskQueue=mHt;var gHt=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 J_.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 J_.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Kt.TimeoutTimer=gHt;var AHt=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 J_.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,Oq.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Kt.IntervalTimer=AHt;var hwe=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?.()}};Kt.RunOnceScheduler=hwe;var yHt=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?.())}};Kt.ProcessTimeRunOnceScheduler=yHt;var EHt=class extends hwe{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()}};Kt.RunOnceWorker=EHt;var _Ht=class extends Oq.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new Oq.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 hwe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Kt.ThrottledWorker=_Ht;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Kt._runWhenIdle=(e,r,n)=>{(0,wzo.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)}}}:Kt._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))}}},Kt.runWhenGlobalIdle=(e,r)=>(0,Kt._runWhenIdle)(globalThis,e,r)})();function jzo(t){let e=Kt._runWhenIdle,r=Kt.runWhenGlobalIdle;return Kt._runWhenIdle=t,Kt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,Oq.toDisposable)(()=>{Kt._runWhenIdle=e,Kt.runWhenGlobalIdle=r})}a(jzo,"installFakeRunWhenIdle");var uZe=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,Kt._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}};Kt.AbstractIdleValue=uZe;var vHt=class extends uZe{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Kt.GlobalIdleValue=vHt;async function Hzo(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}=L1n();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}};Kt.TaskSequentializer=dZe;var CHt=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}};Kt.IntervalCounter=CHt;var nF=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 J_.CancellationError)}};Kt.DeferredPromise=nF;var P1n;(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})(P1n||(Kt.Promises=P1n={}));var fZe=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 J_.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Kt.StatefulPromise=fZe;var bHt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new kzo.Lazy(()=>new fZe(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Kt.LazyStatefulPromise=bHt;var pZe=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 pwe.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=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())}};Kt.AsyncIterableObject=pZe;function Gzo(t){let e=new xHt.CancellationTokenSource,r=t(e.token);return new mZe(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new J_.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(Gzo,"createCancelableAsyncIterableProducer");var SHt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new nF,this._asyncIterable=new pZe(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)}};Kt.AsyncIterableSource=SHt;function $zo(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await M1n(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a($zo,"cancellableIterable");var THt=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 J_.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 nF;return this._unsatisfiedConsumers.push(e),e.p}}},hZe=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new THt,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 nF,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}};Kt.AsyncIterableProducer=hZe;var mZe=class extends hZe{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Kt.CancelableAsyncIterableProducer=mZe;Kt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var IHt=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?Kt.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,r){do{let n=await this.peek();if(n===Kt.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?Kt.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return Kt.AsyncReaderEndOfStream;throw new J_.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await O1n(this._extendBuffer(),e),this._atEnd)return Kt.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)}};Kt.AsyncReader=IHt;function Vzo(t,e){let r=setTimeout(e,t);return(0,Oq.toDisposable)(()=>clearTimeout(r))}a(Vzo,"createTimeout")});var G1n=I(XS=>{"use strict";p();var Jzo=XS&&XS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(XS,"__esModule",{value:!0});var Zzo=require("fs"),Xzo=Jzo(_P()),Due=Xzo.default("@kwsites/file-exists");function eYo(t,e,r){Due("checking %s",t);try{let n=Zzo.statSync(t);return n.isFile()&&e?(Due("[OK] path represents a file"),!0):n.isDirectory()&&r?(Due("[OK] path represents a directory"),!0):(Due("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Due("[FAIL] path is not accessible: %o",n),!1;throw Due("[FATAL] %o",n),n}}a(eYo,"check");function tYo(t,e=XS.READABLE){return eYo(t,(e&XS.FILE)>0,(e&XS.FOLDER)>0)}a(tYo,"exists");XS.exists=tYo;XS.FILE=1;XS.FOLDER=2;XS.READABLE=XS.FILE+XS.FOLDER});var $1n=I(vZe=>{"use strict";p();function rYo(t){for(var e in t)vZe.hasOwnProperty(e)||(vZe[e]=t[e])}a(rYo,"__export");Object.defineProperty(vZe,"__esModule",{value:!0});rYo(G1n())});var W1n=I((B0d,V1n)=>{p();var Oue=1e3,Lue=Oue*60,Bue=Lue*60,rJ=Bue*24,nYo=rJ*7,iYo=rJ*365.25;V1n.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return oYo(t);if(r==="number"&&isFinite(t))return e.long?aYo(t):sYo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function oYo(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*iYo;case"weeks":case"week":case"w":return r*nYo;case"days":case"day":case"d":return r*rJ;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Bue;case"minutes":case"minute":case"mins":case"min":case"m":return r*Lue;case"seconds":case"second":case"secs":case"sec":case"s":return r*Oue;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(oYo,"parse");function sYo(t){var e=Math.abs(t);return e>=rJ?Math.round(t/rJ)+"d":e>=Bue?Math.round(t/Bue)+"h":e>=Lue?Math.round(t/Lue)+"m":e>=Oue?Math.round(t/Oue)+"s":t+"ms"}a(sYo,"fmtShort");function aYo(t){var e=Math.abs(t);return e>=rJ?CZe(t,e,rJ,"day"):e>=Bue?CZe(t,e,Bue,"hour"):e>=Lue?CZe(t,e,Lue,"minute"):e>=Oue?CZe(t,e,Oue,"second"):t+" ms"}a(aYo,"fmtLong");function CZe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(CZe,"plural")});var DHt=I((Q0d,z1n)=>{p();function cYo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=W1n(),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 P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,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(E=>{m=E},"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(cYo,"setup");z1n.exports=cYo});var Y1n=I((eT,bZe)=>{p();eT.formatArgs=uYo;eT.save=dYo;eT.load=fYo;eT.useColors=lYo;eT.storage=pYo();eT.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`."))}})();eT.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 lYo(){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(lYo,"useColors");function uYo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+bZe.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(uYo,"formatArgs");eT.log=console.debug||console.log||(()=>{});function dYo(t){try{t?eT.storage.setItem("debug",t):eT.storage.removeItem("debug")}catch{}}a(dYo,"save");function fYo(){let t;try{t=eT.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(fYo,"load");function pYo(){try{return localStorage}catch{}}a(pYo,"localstorage");bZe.exports=DHt()(eT);var{formatters:hYo}=bZe.exports;hYo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var J1n=I((vg,TZe)=>{p();var mYo=require("tty"),SZe=require("util");vg.init=CYo;vg.log=EYo;vg.formatArgs=AYo;vg.save=_Yo;vg.load=vYo;vg.useColors=gYo;vg.destroy=SZe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");vg.colors=[6,2,3,4,5,1];try{let t=FGe();t&&(t.stderr||t).level>=2&&(vg.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{}vg.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 gYo(){return"colors"in vg.inspectOpts?!!vg.inspectOpts.colors:mYo.isatty(process.stderr.fd)}a(gYo,"useColors");function AYo(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+"+CZe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=hYo()+e+" "+t[0]}a(pYo,"formatArgs");function hYo(){return vg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(hYo,"getDate");function mYo(...t){return process.stderr.write(vZe.formatWithOptions(vg.inspectOpts,...t)+` -`)}a(mYo,"log");function gYo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(gYo,"save");function AYo(){return process.env.DEBUG}a(AYo,"load");function yYo(t){t.inspectOpts={};let e=Object.keys(vg.inspectOpts);for(let r=0;re.trim()).join(" ")};Y1n.O=function(t){return this.inspectOpts.colors=this.useColors,vZe.inspect(t,this.inspectOpts)}});var J1n=I((Q0d,DHt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?DHt.exports=z1n():DHt.exports=K1n()});var MHt=I(nJ=>{"use strict";p();Object.defineProperty(nJ,"__esModule",{value:!0});nJ.createDeferred=nJ.deferred=void 0;function NHt(){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(NHt,"deferred");nJ.deferred=NHt;nJ.createDeferred=NHt;nJ.default=NHt});var zZe=I(eT=>{"use strict";p();Object.defineProperty(eT,"__esModule",{value:!0});eT.deepClone=XIn;eT.deepFreeze=nXo;eT.cloneAndChange=iXo;eT.mixin=txn;eT.equals=xwe;eT.safeStringify=oXo;eT.stableStringify=sXo;eT.distinct=aXo;eT.getCaseInsensitive=cXo;eT.filter=lXo;eT.mapValues=uXo;var Fq=KS();function XIn(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"?XIn(n):n}),e}a(XIn,"deepClone");function nXo(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(exn.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,Fq.isTypedArray)(o)&&e.push(o)}}return t}a(nXo,"deepFreeze");var exn=Object.prototype.hasOwnProperty;function iXo(t,e){return OGt(t,e,new Set)}a(iXo,"cloneAndChange");function OGt(t,e,r){if((0,Fq.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(OGt(s,e,r));return o}if((0,Fq.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)exn.call(t,s)&&(o[s]=OGt(t[s],e,r));return r.delete(t),o}return t}a(OGt,"_cloneAndChange");function txn(t,e,r=!0){return(0,Fq.isObject)(t)?((0,Fq.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,Fq.isObject)(t[n])&&(0,Fq.isObject)(e[n])?txn(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(txn,"mixin");function xwe(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,Fq.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(oXo,"safeStringify");function sXo(t){if(t===void 0)return"undefined";try{return LGt(t,new WeakSet)}catch{return""}}a(sXo,"stableStringify");function LGt(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=>LGt(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)+":"+LGt(s,e))}return"{"+n.join(",")+"}"}a(LGt,"_stableStringify");function aXo(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];xwe(s,c)||(r[o]=c)}),r}a(aXo,"distinct");function cXo(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(cXo,"getCaseInsensitive");function lXo(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(lXo,"filter");function uXo(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(uXo,"mapValues")});var X_=I(YZe=>{"use strict";p();Object.defineProperty(YZe,"__esModule",{value:!0});YZe.ErrorUtils=void 0;var dXo=zZe(),rxn;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,dXo.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(rxn||(YZe.ErrorUtils=rxn={}))});var uw=I(KZe=>{"use strict";p();Object.defineProperty(KZe,"__esModule",{value:!0});KZe.Result=void 0;var BGt=X_(),nxn;(function(t){function e(c){return new FGt(c)}a(e,"ok"),t.ok=e;function r(c){return new UGt(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(BGt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(BGt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(nxn||(KZe.Result=nxn={}));var FGt=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}},UGt=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:BGt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var jd=I((rZd,u2n)=>{p();u2n.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 Ec=I((iZd,O2n)=>{"use strict";p();var d2n=Symbol.for("undici.error.UND_ERR"),Hd=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[d2n]===!0}[d2n]=!0},f2n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),NZt=class extends Hd{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[f2n]===!0}[f2n]=!0},p2n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),MZt=class extends Hd{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[p2n]===!0}[p2n]=!0},h2n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),OZt=class extends Hd{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[h2n]===!0}[h2n]=!0},m2n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),LZt=class extends Hd{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[m2n]===!0}[m2n]=!0},g2n=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),BZt=class extends Hd{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[g2n]===!0}[g2n]=!0},A2n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),FZt=class extends Hd{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[A2n]===!0}[A2n]=!0},y2n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),UZt=class extends Hd{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[y2n]===!0}[y2n]=!0},E2n=Symbol.for("undici.error.UND_ERR_ABORT"),Lrt=class extends Hd{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[E2n]===!0}[E2n]=!0},_2n=Symbol.for("undici.error.UND_ERR_ABORTED"),QZt=class extends Lrt{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[_2n]===!0}[_2n]=!0},v2n=Symbol.for("undici.error.UND_ERR_INFO"),qZt=class extends Hd{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[v2n]===!0}[v2n]=!0},C2n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),jZt=class extends Hd{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[C2n]===!0}[C2n]=!0},b2n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),HZt=class extends Hd{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[b2n]===!0}[b2n]=!0},S2n=Symbol.for("undici.error.UND_ERR_DESTROYED"),GZt=class extends Hd{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[S2n]===!0}[S2n]=!0},T2n=Symbol.for("undici.error.UND_ERR_CLOSED"),$Zt=class extends Hd{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[T2n]===!0}[T2n]=!0},I2n=Symbol.for("undici.error.UND_ERR_SOCKET"),VZt=class extends Hd{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[I2n]===!0}[I2n]=!0},x2n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),WZt=class extends Hd{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[x2n]===!0}[x2n]=!0},w2n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),zZt=class extends Hd{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[w2n]===!0}[w2n]=!0},R2n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),YZt=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[R2n]===!0}[R2n]=!0},k2n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),KZt=class extends Hd{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[k2n]===!0}[k2n]=!0},P2n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),JZt=class extends Hd{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[P2n]===!0}[P2n]=!0},D2n=Symbol.for("undici.error.UND_ERR_RESPONSE"),ZZt=class extends Hd{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[D2n]===!0}[D2n]=!0},N2n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),XZt=class extends Hd{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[N2n]===!0}[N2n]=!0},M2n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),eXt=class extends Hd{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[M2n]===!0}get[M2n](){return!0}};O2n.exports={AbortError:Lrt,HTTPParserError:YZt,UndiciError:Hd,HeadersTimeoutError:MZt,HeadersOverflowError:OZt,BodyTimeoutError:LZt,RequestContentLengthMismatchError:jZt,ConnectTimeoutError:NZt,ResponseStatusCodeError:BZt,InvalidArgumentError:FZt,InvalidReturnValueError:UZt,RequestAbortedError:QZt,ClientDestroyedError:GZt,ClientClosedError:$Zt,InformationalError:qZt,SocketError:VZt,NotSupportedError:WZt,ResponseContentLengthMismatchError:HZt,BalancedPoolMissingUpstreamError:zZt,ResponseExceededMaxSizeError:KZt,RequestRetryError:JZt,ResponseError:ZZt,SecureProxyConnectionError:XZt,MessageSizeExceededError:eXt}});var Frt=I((aZd,L2n)=>{"use strict";p();var Brt={},tXt=["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:B2n,headerNameLowerCasedRecord:Dls}=Frt(),rXt=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 KRe=require("node:assert"),{kDestroyed:j2n,kBodyUsed:Gde,kListeners:nXt,kBody:q2n}=jd(),{IncomingMessage:Nls}=require("node:http"),jrt=require("node:stream"),Mls=require("node:net"),{Blob:Ols}=require("node:buffer"),Lls=require("node:util"),{stringify:Bls}=require("node:querystring"),{EventEmitter:Fls}=require("node:events"),{InvalidArgumentError:xg}=Ec(),{headerNameLowerCasedRecord:Uls}=Frt(),{tree:H2n}=Q2n(),[Qls,qls]=process.versions.node.split(".").map(t=>Number(t)),qrt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[q2n]=e,this[Gde]=!1}async*[Symbol.asyncIterator](){KRe(!this[Gde],"disturbed"),this[Gde]=!0,yield*this[q2n]}};function jls(t){return Hrt(t)?(z2n(t)===0&&t.on("data",function(){KRe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Gde]=!1,Fls.prototype.on.call(t,"data",function(){this[Gde]=!0})),t):t&&typeof t.pipeTo=="function"?new qrt(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&W2n(t)?new qrt(t):t}a(jls,"wrapRequestBody");function Hls(){}a(Hls,"nop");function Hrt(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Hrt,"isStream");function G2n(t){if(t===null)return!1;if(t instanceof Ols)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(G2n,"isBlobLike");function Gls(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=Bls(e);return r&&(t+="?"+r),t}a(Gls,"buildURL");function $2n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a($2n,"isValidPort");function Qrt(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Qrt,"isHttpOrHttpsPrefixed");function V2n(t){if(typeof t=="string"){if(t=new URL(t),!Qrt(t.origin||t.protocol))throw new xg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new xg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&$2n(t.port)===!1)throw new xg("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 xg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new xg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new xg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new xg("Invalid URL origin: the origin must be a string or null/undefined.");if(!Qrt(t.origin||t.protocol))throw new xg("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(!Qrt(t.origin||t.protocol))throw new xg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(V2n,"parseURL");function $ls(t){if(t=V2n(t),t.pathname!=="/"||t.search||t.hash)throw new xg("invalid url");return t}a($ls,"parseOrigin");function Vls(t){if(t[0]==="["){let r=t.indexOf("]");return KRe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(Vls,"getHostname");function Wls(t){if(!t)return null;KRe(typeof t=="string");let e=Vls(t);return Mls.isIP(e)?"":e}a(Wls,"getServerName");function zls(t){return JSON.parse(JSON.stringify(t))}a(zls,"deepClone");function Yls(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(Yls,"isAsyncIterable");function W2n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(W2n,"isIterable");function z2n(t){if(t==null)return 0;if(Hrt(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(G2n(t))return t.size!=null?t.size:null;if(J2n(t))return t.byteLength}return null}a(z2n,"bodyLength");function Y2n(t){return t&&!!(t.destroyed||t[j2n]||jrt.isDestroyed?.(t))}a(Y2n,"isDestroyed");function Kls(t,e){t==null||!Hrt(t)||Y2n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===Nls&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[j2n]=!0))}a(Kls,"destroy");var Jls=/timeout=(\d+)/;function Zls(t){let e=t.toString().match(Jls);return e?parseInt(e[1],10)*1e3:null}a(Zls,"parseKeepAliveTimeout");function K2n(t){return typeof t=="string"?Uls[t]??t.toLowerCase():H2n.lookup(t)??t.toString("latin1").toLowerCase()}a(K2n,"headerNameToString");function Xls(t){return H2n.lookup(t)??t.toString("latin1").toLowerCase()}a(Xls,"bufferToLowerCasedHeaderName");function eus(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(eus,"parseHeaders");function tus(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(aus,"ReadableStreamFrom");function cus(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(cus,"isFormDataLike");function lus(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(lus,"addAbortListener");var uus=typeof String.prototype.toWellFormed=="function",dus=typeof String.prototype.isWellFormed=="function";function Z2n(t){return uus?`${t}`.toWellFormed():Lls.toUSVString(t)}a(Z2n,"toUSVString");function fus(t){return dus?`${t}`.isWellFormed():Z2n(t)===`${t}`}a(fus,"isUSVString");function X2n(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(X2n,"isTokenCharCode");function pus(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Fc=require("node:diagnostics_channel"),sXt=require("node:util"),Grt=sXt.debuglog("undici"),oXt=sXt.debuglog("fetch"),QJ=sXt.debuglog("websocket"),nDn=!1,_us={beforeConnect:Fc.channel("undici:client:beforeConnect"),connected:Fc.channel("undici:client:connected"),connectError:Fc.channel("undici:client:connectError"),sendHeaders:Fc.channel("undici:client:sendHeaders"),create:Fc.channel("undici:request:create"),bodySent:Fc.channel("undici:request:bodySent"),headers:Fc.channel("undici:request:headers"),trailers:Fc.channel("undici:request:trailers"),error:Fc.channel("undici:request:error"),open:Fc.channel("undici:websocket:open"),close:Fc.channel("undici:websocket:close"),socketError:Fc.channel("undici:websocket:socket_error"),ping:Fc.channel("undici:websocket:ping"),pong:Fc.channel("undici:websocket:pong")};if(Grt.enabled||oXt.enabled){let t=oXt.enabled?oXt:Grt;Fc.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)}),Fc.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)}),Fc.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)}),Fc.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)}),Fc.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)}),Fc.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)}),Fc.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)}),nDn=!0}if(QJ.enabled){if(!nDn){let t=Grt.enabled?Grt:QJ;Fc.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)}),Fc.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)}),Fc.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)}),Fc.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)})}Fc.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:r}}=t;QJ("connection opened %s%s",e,r?`:${r}`:"")}),Fc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;QJ("closed connection to %s - %s %s",e.url,r,n)}),Fc.channel("undici:websocket:socket_error").subscribe(t=>{QJ("connection errored - %s",t.message)}),Fc.channel("undici:websocket:ping").subscribe(t=>{QJ("ping received")}),Fc.channel("undici:websocket:pong").subscribe(t=>{QJ("pong received")})}iDn.exports={channels:_us}});var cDn=I((AZd,aDn)=>{"use strict";p();var{InvalidArgumentError:Su,NotSupportedError:vus}=Ec(),TF=require("node:assert"),{isValidHTTPToken:sDn,isValidHeaderValue:aXt,isStream:Cus,destroy:bus,isBuffer:Sus,isFormDataLike:Tus,isIterable:Ius,isBlobLike:xus,buildURL:wus,validateHandler:Rus,getServerName:kus,normalizedMethodRecords:Pus}=qs(),{channels:c5}=$de(),{headerNameLowerCasedRecord:oDn}=Frt(),Dus=/[^\u0021-\u00ff]/,_w=Symbol("handler"),cXt=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},E){if(typeof r!="string")throw new Su("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Su("path must be an absolute URL or start with a slash");if(Dus.test(r))throw new Su("invalid request path");if(typeof n!="string")throw new Su("method must be a string");if(Pus[n]===void 0&&!sDn(n))throw new Su("invalid request method");if(d&&typeof d!="string")throw new Su("upgrade must be a string");if(d&&!aXt(d))throw new Su("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Su("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Su("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Su("invalid reset");if(A!=null&&typeof A!="boolean")throw new Su("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(Cus(o)){this.body=o;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=a(function(){bus(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(Sus(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(Tus(o)||Ius(o)||xus(o))this.body=o;else throw new Su("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?wus(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 Su("headers array must be even");for(let _=0;_{"use strict";p();var Nus=require("node:events"),Vrt=class extends Nus{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 lXt(this,n)}},lXt=class extends Vrt{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)}};lDn.exports=Vrt});var Yde=I((bZd,uDn)=>{"use strict";p();var Mus=JRe(),{ClientDestroyedError:uXt,ClientClosedError:Ous,InvalidArgumentError:Vde}=Ec(),{kDestroy:Lus,kClose:Bus,kClosed:ZRe,kDestroyed:Wde,kDispatch:dXt,kInterceptors:qJ}=jd(),IF=Symbol("onDestroyed"),zde=Symbol("onClosed"),Wrt=Symbol("Intercepted Dispatch"),fXt=class extends Mus{static{a(this,"DispatcherBase")}constructor(){super(),this[Wde]=!1,this[IF]=null,this[ZRe]=!1,this[zde]=[]}get destroyed(){return this[Wde]}get closed(){return this[ZRe]}get interceptors(){return this[qJ]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[qJ][r]!="function")throw new Vde("interceptor must be an function")}this[qJ]=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 Vde("invalid callback");if(this[Wde]){queueMicrotask(()=>e(new uXt,null));return}if(this[ZRe]){this[zde]?this[zde].push(e):queueMicrotask(()=>e(null,null));return}this[ZRe]=!0,this[zde].push(e);let r=a(()=>{let n=this[zde];this[zde]=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 Vde("invalid callback");if(this[Wde]){this[IF]?this[IF].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new uXt),this[Wde]=!0,this[IF]=this[IF]||[],this[IF].push(r);let n=a(()=>{let o=this[IF];this[IF]=null;for(let s=0;s{queueMicrotask(n)})}[Wrt](e,r){if(!this[qJ]||this[qJ].length===0)return this[Wrt]=this[dXt],this[dXt](e,r);let n=this[dXt].bind(this);for(let o=this[qJ].length-1;o>=0;o--)n=this[qJ][o](n);return this[Wrt]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new Vde("handler must be an object");try{if(!e||typeof e!="object")throw new Vde("opts must be an object.");if(this[Wde]||this[IF])throw new uXt;if(this[ZRe])throw new Ous;return this[Wrt](e,r)}catch(n){if(typeof r.onError!="function")throw new Vde("invalid onError method");return r.onError(n),!1}}};uDn.exports=fXt});var EXt=I((IZd,hDn)=>{"use strict";p();var Kde=0,pXt=1e3,hXt=(pXt>>1)-1,xF,mXt=Symbol("kFastTimer"),wF=[],gXt=-2,AXt=-1,fDn=0,dDn=1;function yXt(){Kde+=hXt;let t=0,e=wF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=AXt,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===AXt?(r._state=gXt,--e!==0&&(wF[t]=wF[e])):++t}wF.length=e,wF.length!==0&&pDn()}a(yXt,"onTick");function pDn(){xF?xF.refresh():(clearTimeout(xF),xF=setTimeout(yXt,hXt),xF.unref&&xF.unref())}a(pDn,"refreshTimeout");var zrt=class{static{a(this,"FastTimer")}[mXt]=!0;_state=gXt;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===gXt&&wF.push(this),(!xF||wF.length===1)&&pDn(),this._state=fDn}clear(){this._state=AXt,this._idleStart=-1}};hDn.exports={setTimeout(t,e,r){return e<=pXt?setTimeout(t,e,r):new zrt(t,e,r)},clearTimeout(t){t[mXt]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new zrt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Kde},tick(t=0){Kde+=t-pXt+1,yXt(),yXt()},reset(){Kde=0,wF.length=0,clearTimeout(xF),xF=null},kFastTimer:mXt}});var XRe=I((PZd,EDn)=>{"use strict";p();var Fus=require("node:net"),mDn=require("node:assert"),yDn=qs(),{InvalidArgumentError:Uus,ConnectTimeoutError:Qus}=Ec(),Yrt=EXt();function gDn(){}a(gDn,"noop");var _Xt,vXt;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?vXt=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 qus({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new Uus("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new vXt(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},E){let _;if(h==="https:"){_Xt||(_Xt=require("node:tls")),g=g||c.servername||yDn.getServerName(f)||null;let b=g||d;mDn(b);let T=o||l.get(b)||null;m=m||443,_=_Xt.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}),_.on("session",function(w){l.set(b,w)})}else mDn(!y,"httpSocket can only be sent on TLS update"),m=m||80,_=Fus.connect({highWaterMark:64*1024,...c,localAddress:A,port:m,host:d});if(c.keepAlive==null||c.keepAlive){let b=c.keepAliveInitialDelay===void 0?6e4:c.keepAliveInitialDelay;_.setKeepAlive(!0,b)}let v=jus(new WeakRef(_),{timeout:n,hostname:d,port:m});return _.setNoDelay(!0).once(h==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(v),E){let b=E;E=null,b(null,this)}}).on("error",function(b){if(queueMicrotask(v),E){let T=E;E=null,T(b)}}),_},"connect")}a(qus,"buildConnector");var jus=process.platform==="win32"?(t,e)=>{if(!e.timeout)return gDn;let r=null,n=null,o=Yrt.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>ADn(t.deref(),e))})},e.timeout);return()=>{Yrt.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return gDn;let r=null,n=Yrt.setFastTimeout(()=>{r=setImmediate(()=>{ADn(t.deref(),e)})},e.timeout);return()=>{Yrt.clearFastTimeout(n),clearImmediate(r)}};function ADn(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)`,yDn.destroy(t,new Qus(r))}a(ADn,"onConnectTimeout");EDn.exports=qus});var _Dn=I(Krt=>{"use strict";p();Object.defineProperty(Krt,"__esModule",{value:!0});Krt.enumToMap=void 0;function Hus(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(Hus,"enumToMap");Krt.enumToMap=Hus});var vDn=I(Pr=>{"use strict";p();Object.defineProperty(Pr,"__esModule",{value:!0});Pr.SPECIAL_HEADERS=Pr.HEADER_STATE=Pr.MINOR=Pr.MAJOR=Pr.CONNECTION_TOKEN_CHARS=Pr.HEADER_CHARS=Pr.TOKEN=Pr.STRICT_TOKEN=Pr.HEX=Pr.URL_CHAR=Pr.STRICT_URL_CHAR=Pr.USERINFO_CHARS=Pr.MARK=Pr.ALPHANUM=Pr.NUM=Pr.HEX_MAP=Pr.NUM_MAP=Pr.ALPHA=Pr.FINISH=Pr.H_METHOD_MAP=Pr.METHOD_MAP=Pr.METHODS_RTSP=Pr.METHODS_ICE=Pr.METHODS_HTTP=Pr.METHODS=Pr.LENIENT_FLAGS=Pr.FLAGS=Pr.TYPE=Pr.ERROR=void 0;var Gus=_Dn(),$us;(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"})($us=Pr.ERROR||(Pr.ERROR={}));var Vus;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(Vus=Pr.TYPE||(Pr.TYPE={}));var Wus;(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"})(Wus=Pr.FLAGS||(Pr.FLAGS={}));var zus;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(zus=Pr.LENIENT_FLAGS||(Pr.LENIENT_FLAGS={}));var Mi;(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"})(Mi=Pr.METHODS||(Pr.METHODS={}));Pr.METHODS_HTTP=[Mi.DELETE,Mi.GET,Mi.HEAD,Mi.POST,Mi.PUT,Mi.CONNECT,Mi.OPTIONS,Mi.TRACE,Mi.COPY,Mi.LOCK,Mi.MKCOL,Mi.MOVE,Mi.PROPFIND,Mi.PROPPATCH,Mi.SEARCH,Mi.UNLOCK,Mi.BIND,Mi.REBIND,Mi.UNBIND,Mi.ACL,Mi.REPORT,Mi.MKACTIVITY,Mi.CHECKOUT,Mi.MERGE,Mi["M-SEARCH"],Mi.NOTIFY,Mi.SUBSCRIBE,Mi.UNSUBSCRIBE,Mi.PATCH,Mi.PURGE,Mi.MKCALENDAR,Mi.LINK,Mi.UNLINK,Mi.PRI,Mi.SOURCE];Pr.METHODS_ICE=[Mi.SOURCE];Pr.METHODS_RTSP=[Mi.OPTIONS,Mi.DESCRIBE,Mi.ANNOUNCE,Mi.SETUP,Mi.PLAY,Mi.PAUSE,Mi.TEARDOWN,Mi.GET_PARAMETER,Mi.SET_PARAMETER,Mi.REDIRECT,Mi.RECORD,Mi.FLUSH,Mi.GET,Mi.POST];Pr.METHOD_MAP=Gus.enumToMap(Mi);Pr.H_METHOD_MAP={};Object.keys(Pr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(Pr.H_METHOD_MAP[t]=Pr.METHOD_MAP[t])});var Yus;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(Yus=Pr.FINISH||(Pr.FINISH={}));Pr.ALPHA=[];for(let t=65;t<=90;t++)Pr.ALPHA.push(String.fromCharCode(t)),Pr.ALPHA.push(String.fromCharCode(t+32));Pr.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};Pr.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};Pr.NUM=["0","1","2","3","4","5","6","7","8","9"];Pr.ALPHANUM=Pr.ALPHA.concat(Pr.NUM);Pr.MARK=["-","_",".","!","~","*","'","(",")"];Pr.USERINFO_CHARS=Pr.ALPHANUM.concat(Pr.MARK).concat(["%",";",":","&","=","+","$",","]);Pr.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(Pr.ALPHANUM);Pr.URL_CHAR=Pr.STRICT_URL_CHAR.concat([" ","\f"]);for(let t=128;t<=255;t++)Pr.URL_CHAR.push(t);Pr.HEX=Pr.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);Pr.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(Pr.ALPHANUM);Pr.TOKEN=Pr.STRICT_TOKEN.concat([" "]);Pr.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&Pr.HEADER_CHARS.push(t);Pr.CONNECTION_TOKEN_CHARS=Pr.HEADER_CHARS.filter(t=>t!==44);Pr.MAJOR=Pr.NUM_MAP;Pr.MINOR=Pr.MAJOR;var Jde;(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"})(Jde=Pr.HEADER_STATE||(Pr.HEADER_STATE={}));Pr.SPECIAL_HEADERS={connection:Jde.CONNECTION,"content-length":Jde.CONTENT_LENGTH,"proxy-connection":Jde.CONNECTION,"transfer-encoding":Jde.TRANSFER_ENCODING,upgrade:Jde.UPGRADE}});var CXt=I((UZd,CDn)=>{"use strict";p();var{Buffer:Kus}=require("node:buffer");CDn.exports=Kus.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 SDn=I((qZd,bDn)=>{"use strict";p();var{Buffer:Jus}=require("node:buffer");bDn.exports=Jus.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 eke=I((HZd,DDn)=>{"use strict";p();var TDn=["GET","HEAD","POST"],Zus=new Set(TDn),Xus=[101,204,205,304],IDn=[301,302,303,307,308],eds=new Set(IDn),xDn=["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"],tds=new Set(xDn),wDn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],rds=new Set(wDn),nds=["follow","manual","error"],RDn=["GET","HEAD","OPTIONS","TRACE"],ids=new Set(RDn),ods=["navigate","same-origin","no-cors","cors"],sds=["omit","same-origin","include"],ads=["default","no-store","reload","no-cache","force-cache","only-if-cached"],cds=["content-encoding","content-language","content-location","content-type","content-length"],lds=["half"],kDn=["CONNECT","TRACE","TRACK"],uds=new Set(kDn),PDn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],dds=new Set(PDn);DDn.exports={subresource:PDn,forbiddenMethods:kDn,requestBodyHeader:cds,referrerPolicy:wDn,requestRedirect:nds,requestMode:ods,requestCredentials:sds,requestCache:ads,redirectStatus:IDn,corsSafeListedMethods:TDn,nullBodyStatus:Xus,safeMethods:RDn,badPorts:xDn,requestDuplex:lds,subresourceSet:dds,badPortsSet:tds,redirectStatusSet:eds,corsSafeListedMethodsSet:Zus,safeMethodsSet:ids,forbiddenMethodsSet:uds,referrerPolicySet:rds}});var SXt=I(($Zd,NDn)=>{"use strict";p();var bXt=Symbol.for("undici.globalOrigin.1");function fds(){return globalThis[bXt]}a(fds,"getGlobalOrigin");function pds(t){if(t===void 0){Object.defineProperty(globalThis,bXt,{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,bXt,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(pds,"setGlobalOrigin");NDn.exports={getGlobalOrigin:fds,setGlobalOrigin:pds}});var nb=I((zZd,QDn)=>{"use strict";p();var Zrt=require("node:assert"),hds=new TextEncoder,tke=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,mds=/[\u000A\u000D\u0009\u0020]/,gds=/[\u0009\u000A\u000C\u000D\u0020]/g,Ads=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function yds(t){Zrt(t.protocol==="data:");let e=LDn(t,!0);e=e.slice(5);let r={position:0},n=Zde(",",e,r),o=n.length;if(n=Sds(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=BDn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=UDn(c);if(c=_ds(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=TXt(n);return l==="failure"&&(l=TXt("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(yds,"dataURLProcessor");function LDn(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(LDn,"URLSerializer");function Xrt(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(MDn,"isHexCharByte");function ODn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(ODn,"hexByteToNumber");function Eds(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=Zde(";",t,e);if(n=Jrt(n,!1,!0),n.length===0||!tke.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionmds.test(d),t,e);let l=Xrt(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=FDn(t,e,!0),Zde(";",t,e);else if(u=Zde(";",t,e),u=Jrt(u,!1,!0),u.length===0)continue;l.length!==0&&tke.test(l)&&(u.length===0||Ads.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(TXt,"parseMIMEType");function _ds(t){t=t.replace(gds,"");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(_ds,"forgivingBase64");function FDn(t,e,r){let n=e.position,o="";for(Zrt(t[e.position]==='"'),e.position++;o+=Xrt(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{Zrt(s==='"');break}}return r?o:t.slice(n,e.position)}a(FDn,"collectAnHTTPQuotedString");function vds(t){Zrt(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",tke.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(vds,"serializeAMimeType");function Cds(t){return t===13||t===10||t===9||t===32}a(Cds,"isHTTPWhiteSpace");function Jrt(t,e=!0,r=!0){return IXt(t,e,r,Cds)}a(Jrt,"removeHTTPWhitespace");function bds(t){return t===13||t===10||t===9||t===12||t===32}a(bds,"isASCIIWhitespace");function Sds(t,e=!0,r=!0){return IXt(t,e,r,bds)}a(Sds,"removeASCIIWhitespace");function IXt(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(IXt,"removeChars");function UDn(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(UDn,"isomorphicDecode");function Tds(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(Tds,"minimizeSupportedMimeType");QDn.exports={dataURLProcessor:yds,URLSerializer:LDn,collectASequenceOfCodePoints:Xrt,collectASequenceOfCodePointsFast:Zde,stringPercentDecode:BDn,parseMIMEType:TXt,collectAnHTTPQuotedString:FDn,serializeAMimeType:vds,removeChars:IXt,removeHTTPWhitespace:Jrt,minimizeSupportedMimeType:Tds,HTTP_TOKEN_CODEPOINTS:tke,isomorphicDecode:UDn}});var qA=I((JZd,qDn)=>{"use strict";p();var{types:l5,inspect:Ids}=require("node:util"),{markAsUncloneable:xds}=require("node:worker_threads"),{toUSVString:wds}=qs(),Er={};Er.converters={};Er.util={};Er.errors={};Er.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};Er.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 Er.errors.exception({header:t.prefix,message:r})};Er.errors.invalidArgument=function(t){return Er.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};Er.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}};Er.argumentLengthCheck=function({length:t},e,r){if(t{});Er.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 Er.errors.exception({header:"Integer conversion",message:`Could not convert ${Er.util.Stringify(t)} to an integer.`});if(c=Er.util.IntegerPart(c),co)throw Er.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=Er.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e)-1?c-Math.pow(2,e):c)};Er.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};Er.util.Stringify=function(t){switch(Er.util.Type(t)){case"Symbol":return`Symbol(${t.description})`;case"Object":return Ids(t);case"String":return`"${t}"`;default:return`${t}`}};Er.sequenceConverter=function(t){return(e,r,n,o)=>{if(Er.util.Type(e)!=="Object")throw Er.errors.exception({header:r,message:`${n} (${Er.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 Er.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}};Er.recordConverter=function(t,e){return(r,n,o)=>{if(Er.util.Type(r)!=="Object")throw Er.errors.exception({header:n,message:`${o} ("${Er.util.Type(r)}") is not an Object.`});let s={};if(!l5.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}};Er.interfaceConverter=function(t){return(e,r,n,o)=>{if(o?.strict!==!1&&!(e instanceof t))throw Er.errors.exception({header:r,message:`Expected ${n} ("${Er.util.Stringify(e)}") to be an instance of ${t.name}.`});return e}};Er.dictionaryConverter=function(t){return(e,r,n)=>{let o=Er.util.Type(e),s={};if(o==="Null"||o==="Undefined")return s;if(o!=="Object")throw Er.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 Er.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 Er.errors.exception({header:r,message:`${h} is not an accepted type. Expected one of ${c.allowedValues.join(", ")}.`});s[l]=h}}return s}};Er.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};Er.converters.DOMString=function(t,e,r,n){if(t===null&&n?.legacyNullToEmptyString)return"";if(typeof t=="symbol")throw Er.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};Er.converters.ByteString=function(t,e,r){let n=Er.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};Er.converters.USVString=wds;Er.converters.boolean=function(t){return!!t};Er.converters.any=function(t){return t};Er.converters["long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"signed",void 0,e,r)};Er.converters["unsigned long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"unsigned",void 0,e,r)};Er.converters["unsigned long"]=function(t,e,r){return Er.util.ConvertToInt(t,32,"unsigned",void 0,e,r)};Er.converters["unsigned short"]=function(t,e,r,n){return Er.util.ConvertToInt(t,16,"unsigned",n,e,r)};Er.converters.ArrayBuffer=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!l5.isAnyArrayBuffer(t))throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&l5.isSharedArrayBuffer(t))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.resizable||t.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.TypedArray=function(t,e,r,n,o){if(Er.util.Type(t)!=="Object"||!l5.isTypedArray(t)||t.constructor.name!==e.name)throw Er.errors.conversionFailed({prefix:r,argument:`${n} ("${Er.util.Stringify(t)}")`,types:[e.name]});if(o?.allowShared===!1&&l5.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.DataView=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!l5.isDataView(t))throw Er.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&l5.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.BufferSource=function(t,e,r,n){if(l5.isAnyArrayBuffer(t))return Er.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if(l5.isTypedArray(t))return Er.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if(l5.isDataView(t))return Er.converters.DataView(t,e,r,{...n,allowShared:!1});throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["BufferSource"]})};Er.converters["sequence"]=Er.sequenceConverter(Er.converters.ByteString);Er.converters["sequence>"]=Er.sequenceConverter(Er.converters["sequence"]);Er.converters["record"]=Er.recordConverter(Er.converters.ByteString,Er.converters.ByteString);qDn.exports={webidl:Er}});var sT=I((XZd,tNn)=>{"use strict";p();var{Transform:Rds}=require("node:stream"),jDn=require("node:zlib"),{redirectStatusSet:kds,referrerPolicySet:Pds,badPortsSet:Dds}=eke(),{getGlobalOrigin:HDn}=SXt(),{collectASequenceOfCodePoints:jJ,collectAnHTTPQuotedString:Nds,removeChars:Mds,parseMIMEType:Ods}=nb(),{performance:Lds}=require("node:perf_hooks"),{isBlobLike:Bds,ReadableStreamFrom:Fds,isValidHTTPToken:GDn,normalizedMethodRecordsBase:Uds}=qs(),HJ=require("node:assert"),{isUint8Array:Qds}=require("node:util/types"),{webidl:rke}=qA(),$Dn=[],tnt;try{tnt=require("node:crypto");let t=["sha256","sha384","sha512"];$Dn=tnt.getHashes().filter(e=>t.includes(e))}catch{}function VDn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(VDn,"responseURL");function qds(t,e){if(!kds.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&zDn(r)&&(WDn(r)||(r=jds(r)),r=new URL(r,VDn(t))),r&&!r.hash&&(r.hash=e),r}a(qds,"responseLocationURL");function WDn(t){for(let e=0;e126||r<32)return!1}return!0}a(WDn,"isValidEncodedURL");function jds(t){return Buffer.from(t,"binary").toString("utf8")}a(jds,"normalizeBinaryStringToUtf8");function ike(t){return t.urlList[t.urlList.length-1]}a(ike,"requestCurrentURL");function Hds(t){let e=ike(t);return XDn(e)&&Dds.has(e.port)?"blocked":"allowed"}a(Hds,"requestBadPort");function Gds(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(Gds,"isErrorLike");function $ds(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a($ds,"isValidReasonPhrase");var Vds=GDn;function zDn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(zDn,"isValidHeaderValue");function Wds(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(Pds.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(Wds,"setRequestReferrerPolicyOnRedirect");function zds(){return"allowed"}a(zds,"crossOriginResourcePolicyCheck");function Yds(){return"success"}a(Yds,"corsCheck");function Kds(){return"success"}a(Kds,"TAOCheck");function Jds(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(Jds,"appendFetchMetadata");function Zds(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&&wXt(t.origin)&&!wXt(ike(t))&&(e=null);break;case"same-origin":rnt(t,ike(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(Zds,"appendRequestOriginHeader");function Xde(t,e){return t}a(Xde,"coarsenTime");function Xds(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=rnt(t,n),c=nke(n)&&!nke(t.url);switch(e){case"origin":return o??xXt(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=ike(t);return rnt(n,l)?n:nke(n)&&!nke(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(nfs,"determineRequestsReferrer");function xXt(t,e){return HJ(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(xXt,"stripURLForReferrer");function nke(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(nke,"isURLPotentiallyTrustworthy");function ifs(t,e){if(tnt===void 0)return!0;let r=KDn(e);if(r==="no metadata"||r.length===0)return!0;let n=sfs(r),o=afs(r,n);for(let s of o){let c=s.algo,l=s.hash,u=tnt.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)),cfs(u,l))return!0}return!1}a(ifs,"bytesMatch");var ofs=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function KDn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=ofs.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();$Dn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(KDn,"parseMetadata");function sfs(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(ufs,"createDeferredPromise");function dfs(t){return t.controller.state==="aborted"}a(dfs,"isAborted");function ffs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(ffs,"isCancelled");function pfs(t){return Uds[t.toLowerCase()]??t}a(pfs,"normalizeMethod");function hfs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return HJ(typeof e=="string"),e}a(hfs,"serializeJavascriptValueToJSONString");var mfs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function JDn(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,mfs),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(JDn,"createIterator");function gfs(t,e,r,n=0,o=1){let s=JDn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(rke.brandCheck(this,e),rke.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(gfs,"iteratorMixin");async function Afs(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await ZDn(s))}catch(c){o(c)}}a(Afs,"fullyReadBody");function yfs(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(yfs,"isReadableStreamLike");function Efs(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(Efs,"readableStreamClose");var _fs=/[^\x00-\xFF]/;function ent(t){return HJ(!_fs.test(t)),t}a(ent,"isomorphicEncode");async function ZDn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!Qds(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(ZDn,"readAllBytes");function vfs(t){HJ("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(vfs,"urlIsLocal");function wXt(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(wXt,"urlHasHttpsScheme");function XDn(t){HJ("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(XDn,"urlIsHttpHttpsScheme");function Cfs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&jJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&jJ(u=>u===" "||u===" ",r,n);let o=jJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&jJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&jJ(u=>u===" "||u===" ",r,n);let c=jJ(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(Cfs,"simpleRangeHeaderValue");function bfs(t,e,r){let n="bytes ";return n+=ent(`${t}`),n+="-",n+=ent(`${e}`),n+="/",n+=ent(`${r}`),n}a(bfs,"buildContentRange");var RXt=class extends Rds{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?jDn.createInflate(this.#e):jDn.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 Sfs(t){return new RXt(t)}a(Sfs,"createInflate");function Tfs(t){let e=null,r=null,n=null,o=eNn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Ods(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(Tfs,"extractMimeType");function Ifs(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(Ifs,"gettingDecodingSplitting");function eNn(t,e){let r=e.get(t,!0);return r===null?null:Ifs(r)}a(eNn,"getDecodeSplit");var xfs=new TextDecoder;function wfs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),xfs.decode(t))}a(wfs,"utf8DecodeBytes");var kXt=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return HDn()}get origin(){return this.baseUrl?.origin}policyContainer=YDn()},PXt=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new kXt},Rfs=new PXt;tNn.exports={isAborted:dfs,isCancelled:ffs,isValidEncodedURL:WDn,createDeferredPromise:ufs,ReadableStreamFrom:Fds,tryUpgradeRequestToAPotentiallyTrustworthyURL:lfs,clampAndCoarsenConnectionTimingInfo:Xds,coarsenedSharedCurrentTime:efs,determineRequestsReferrer:nfs,makePolicyContainer:YDn,clonePolicyContainer:rfs,appendFetchMetadata:Jds,appendRequestOriginHeader:Zds,TAOCheck:Kds,corsCheck:Yds,crossOriginResourcePolicyCheck:zds,createOpaqueTimingInfo:tfs,setRequestReferrerPolicyOnRedirect:Wds,isValidHTTPToken:GDn,requestBadPort:Hds,requestCurrentURL:ike,responseURL:VDn,responseLocationURL:qds,isBlobLike:Bds,isURLPotentiallyTrustworthy:nke,isValidReasonPhrase:$ds,sameOrigin:rnt,normalizeMethod:pfs,serializeJavascriptValueToJSONString:hfs,iteratorMixin:gfs,createIterator:JDn,isValidHeaderName:Vds,isValidHeaderValue:zDn,isErrorLike:Gds,fullyReadBody:Afs,bytesMatch:ifs,isReadableStreamLike:yfs,readableStreamClose:Efs,isomorphicEncode:ent,urlIsLocal:vfs,urlHasHttpsScheme:wXt,urlIsHttpHttpsScheme:XDn,readAllBytes:ZDn,simpleRangeHeaderValue:Cfs,buildContentRange:bfs,parseMetadata:KDn,createInflate:Sfs,extractMimeType:Tfs,getDecodeSplit:eNn,utf8DecodeBytes:wfs,environmentSettingsObject:Rfs}});var oj=I((rXd,rNn)=>{"use strict";p();rNn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var NXt=I((iXd,nNn)=>{"use strict";p();var{Blob:kfs,File:Pfs}=require("node:buffer"),{kState:RF}=oj(),{webidl:u5}=qA(),DXt=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[RF]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return u5.brandCheck(this,t),this[RF].blobLike.stream(...e)}arrayBuffer(...e){return u5.brandCheck(this,t),this[RF].blobLike.arrayBuffer(...e)}slice(...e){return u5.brandCheck(this,t),this[RF].blobLike.slice(...e)}text(...e){return u5.brandCheck(this,t),this[RF].blobLike.text(...e)}get size(){return u5.brandCheck(this,t),this[RF].blobLike.size}get type(){return u5.brandCheck(this,t),this[RF].blobLike.type}get name(){return u5.brandCheck(this,t),this[RF].name}get lastModified(){return u5.brandCheck(this,t),this[RF].lastModified}get[Symbol.toStringTag](){return"File"}};u5.converters.Blob=u5.interfaceConverter(kfs);function Dfs(t){return t instanceof Pfs||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(Dfs,"isFileLike");nNn.exports={FileLike:DXt,isFileLike:Dfs}});var ske=I((aXd,cNn)=>{"use strict";p();var{isBlobLike:nnt,iteratorMixin:Nfs}=sT(),{kState:nv}=oj(),{kEnumerableProperty:efe}=qs(),{FileLike:iNn,isFileLike:Mfs}=NXt(),{webidl:Tu}=qA(),{File:aNn}=require("node:buffer"),oNn=require("node:util"),sNn=globalThis.File??aNn,oke=class t{static{a(this,"FormData")}constructor(e){if(Tu.util.markAsUncloneable(this),e!==void 0)throw Tu.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[nv]=[]}append(e,r,n=void 0){Tu.brandCheck(this,t);let o="FormData.append";if(Tu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!nnt(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=Tu.converters.USVString(e,o,"name"),r=nnt(r)?Tu.converters.Blob(r,o,"value",{strict:!1}):Tu.converters.USVString(r,o,"value"),n=arguments.length===3?Tu.converters.USVString(n,o,"filename"):void 0;let s=MXt(e,r,n);this[nv].push(s)}delete(e){Tu.brandCheck(this,t);let r="FormData.delete";Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[nv]=this[nv].filter(n=>n.name!==e)}get(e){Tu.brandCheck(this,t);let r="FormData.get";Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name");let n=this[nv].findIndex(o=>o.name===e);return n===-1?null:this[nv][n].value}getAll(e){Tu.brandCheck(this,t);let r="FormData.getAll";return Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[nv].filter(n=>n.name===e).map(n=>n.value)}has(e){Tu.brandCheck(this,t);let r="FormData.has";return Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[nv].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Tu.brandCheck(this,t);let o="FormData.set";if(Tu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!nnt(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=Tu.converters.USVString(e,o,"name"),r=nnt(r)?Tu.converters.Blob(r,o,"name",{strict:!1}):Tu.converters.USVString(r,o,"name"),n=arguments.length===3?Tu.converters.USVString(n,o,"name"):void 0;let s=MXt(e,r,n),c=this[nv].findIndex(l=>l.name===e);c!==-1?this[nv]=[...this[nv].slice(0,c),s,...this[nv].slice(c+1).filter(l=>l.name!==e)]:this[nv].push(s)}[oNn.inspect.custom](e,r){let n=this[nv].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=oNn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};Nfs("FormData",oke,nv,"name","value");Object.defineProperties(oke.prototype,{append:efe,delete:efe,get:efe,getAll:efe,has:efe,set:efe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function MXt(t,e,r){if(typeof e!="string"){if(Mfs(e)||(e=e instanceof Blob?new sNn([e],"blob",{type:e.type}):new iNn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof aNn?new sNn([e],r,n):new iNn(e,r,n)}}return{name:t,value:e}}a(MXt,"makeEntry");cNn.exports={FormData:oke,makeEntry:MXt}});var hNn=I((uXd,pNn)=>{"use strict";p();var{isUSVString:lNn,bufferToLowerCasedHeaderName:Ofs}=qs(),{utf8DecodeBytes:Lfs}=sT(),{HTTP_TOKEN_CODEPOINTS:Bfs,isomorphicDecode:uNn}=nb(),{isFileLike:Ffs}=NXt(),{makeEntry:Ufs}=ske(),int=require("node:assert"),{File:Qfs}=require("node:buffer"),qfs=globalThis.File??Qfs,jfs=Buffer.from('form-data; name="'),dNn=Buffer.from("; filename"),Hfs=Buffer.from("--"),Gfs=Buffer.from(`--\r -`);function $fs(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(Vfs,"validateBoundary");function Wfs(t,e){int(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&&ont(t,Hfs,s)||s.position===t.length-4&&ont(t,Gfs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=zfs(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",$fs(f)||(f=""),g=new qfs([m],d,{type:f})):g=Lfs(Buffer.from(m)),int(lNn(u)),int(typeof g=="string"&&lNn(g)||Ffs(g)),o.push(Ufs(u,g,d))}}a(Wfs,"multipartFormDataParser");function zfs(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=tfe(l=>l!==10&&l!==13&&l!==58,t,e);if(c=OXt(c,!0,!0,l=>l===9||l===32),!Bfs.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,tfe(l=>l===32||l===9,t,e),Ofs(c)){case"content-disposition":{if(r=n=null,!ont(t,jfs,e)||(e.position+=17,r=fNn(t,e),r===null))return"failure";if(ont(t,dNn,e)){let l=e.position+dNn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=fNn(t,e),n===null))return"failure"}break}case"content-type":{let l=tfe(u=>u!==10&&u!==13,t,e);l=OXt(l,!1,!0,u=>u===9||u===32),o=uNn(l);break}case"content-transfer-encoding":{let l=tfe(u=>u!==10&&u!==13,t,e);l=OXt(l,!1,!0,u=>u===9||u===32),s=uNn(l);break}default:tfe(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(zfs,"parseMultipartFormDataHeaders");function fNn(t,e){int(t[e.position-1]===34);let r=tfe(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(fNn,"parseMultipartFormDataName");function tfe(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(OXt,"removeChars");function ont(t,e,r){if(t.length{"use strict";p();var ake=qs(),{ReadableStreamFrom:Yfs,isBlobLike:mNn,isReadableStreamLike:Kfs,readableStreamClose:Jfs,createDeferredPromise:Zfs,fullyReadBody:Xfs,extractMimeType:eps,utf8DecodeBytes:yNn}=sT(),{FormData:gNn}=ske(),{kState:nfe}=oj(),{webidl:tps}=qA(),{Blob:rps}=require("node:buffer"),LXt=require("node:assert"),{isErrored:ENn,isDisturbed:nps}=require("node:stream"),{isArrayBuffer:ips}=require("node:util/types"),{serializeAMimeType:ops}=nb(),{multipartFormDataParser:sps}=hNn(),BXt;try{let t=require("node:crypto");BXt=a(e=>t.randomInt(0,e),"random")}catch{BXt=a(t=>Math.floor(Math.random(t)),"random")}var snt=new TextEncoder;function aps(){}a(aps,"noop");var _Nn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,vNn;_Nn&&(vNn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!nps(e)&&!ENn(e)&&e.cancel("Response object has been garbage collected").catch(aps)}));function CNn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:mNn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?snt.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>Jfs(u))},start(){},type:"bytes"}),LXt(Kfs(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(ips(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(ake.isFormDataLike(t)){let u=`----formdata-undici-0${`${BXt(1e11)}`.padStart(11,"0")}`,d=`--${u}\r +`+s),t.push(o+"m+"+TZe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=yYo()+e+" "+t[0]}a(AYo,"formatArgs");function yYo(){return vg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(yYo,"getDate");function EYo(...t){return process.stderr.write(SZe.formatWithOptions(vg.inspectOpts,...t)+` +`)}a(EYo,"log");function _Yo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(_Yo,"save");function vYo(){return process.env.DEBUG}a(vYo,"load");function CYo(t){t.inspectOpts={};let e=Object.keys(vg.inspectOpts);for(let r=0;re.trim()).join(" ")};K1n.O=function(t){return this.inspectOpts.colors=this.useColors,SZe.inspect(t,this.inspectOpts)}});var Z1n=I((W0d,NHt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?NHt.exports=Y1n():NHt.exports=J1n()});var OHt=I(nJ=>{"use strict";p();Object.defineProperty(nJ,"__esModule",{value:!0});nJ.createDeferred=nJ.deferred=void 0;function MHt(){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(MHt,"deferred");nJ.deferred=MHt;nJ.createDeferred=MHt;nJ.default=MHt});var JZe=I(rT=>{"use strict";p();Object.defineProperty(rT,"__esModule",{value:!0});rT.deepClone=exn;rT.deepFreeze=aXo;rT.cloneAndChange=cXo;rT.mixin=rxn;rT.equals=xwe;rT.safeStringify=lXo;rT.stableStringify=uXo;rT.distinct=dXo;rT.getCaseInsensitive=fXo;rT.filter=pXo;rT.mapValues=hXo;var Uq=ZS();function exn(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"?exn(n):n}),e}a(exn,"deepClone");function aXo(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(txn.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,Uq.isTypedArray)(o)&&e.push(o)}}return t}a(aXo,"deepFreeze");var txn=Object.prototype.hasOwnProperty;function cXo(t,e){return LGt(t,e,new Set)}a(cXo,"cloneAndChange");function LGt(t,e,r){if((0,Uq.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(LGt(s,e,r));return o}if((0,Uq.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)txn.call(t,s)&&(o[s]=LGt(t[s],e,r));return r.delete(t),o}return t}a(LGt,"_cloneAndChange");function rxn(t,e,r=!0){return(0,Uq.isObject)(t)?((0,Uq.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,Uq.isObject)(t[n])&&(0,Uq.isObject)(e[n])?rxn(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(rxn,"mixin");function xwe(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,Uq.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(lXo,"safeStringify");function uXo(t){if(t===void 0)return"undefined";try{return BGt(t,new WeakSet)}catch{return""}}a(uXo,"stableStringify");function BGt(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=>BGt(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)+":"+BGt(s,e))}return"{"+n.join(",")+"}"}a(BGt,"_stableStringify");function dXo(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];xwe(s,c)||(r[o]=c)}),r}a(dXo,"distinct");function fXo(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(fXo,"getCaseInsensitive");function pXo(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(pXo,"filter");function hXo(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(hXo,"mapValues")});var ev=I(ZZe=>{"use strict";p();Object.defineProperty(ZZe,"__esModule",{value:!0});ZZe.ErrorUtils=void 0;var mXo=JZe(),nxn;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,mXo.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(nxn||(ZZe.ErrorUtils=nxn={}))});var dw=I(XZe=>{"use strict";p();Object.defineProperty(XZe,"__esModule",{value:!0});XZe.Result=void 0;var FGt=ev(),ixn;(function(t){function e(c){return new UGt(c)}a(e,"ok"),t.ok=e;function r(c){return new QGt(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(FGt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(FGt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(ixn||(XZe.Result=ixn={}));var UGt=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}},QGt=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:FGt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var jd=I((uZd,d2n)=>{p();d2n.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 Ec=I((fZd,L2n)=>{"use strict";p();var f2n=Symbol.for("undici.error.UND_ERR"),Hd=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[f2n]===!0}[f2n]=!0},p2n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),MZt=class extends Hd{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[p2n]===!0}[p2n]=!0},h2n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),OZt=class extends Hd{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[h2n]===!0}[h2n]=!0},m2n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),LZt=class extends Hd{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[m2n]===!0}[m2n]=!0},g2n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),BZt=class extends Hd{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[g2n]===!0}[g2n]=!0},A2n=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),FZt=class extends Hd{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[A2n]===!0}[A2n]=!0},y2n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),UZt=class extends Hd{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[y2n]===!0}[y2n]=!0},E2n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),QZt=class extends Hd{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[E2n]===!0}[E2n]=!0},_2n=Symbol.for("undici.error.UND_ERR_ABORT"),Urt=class extends Hd{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[_2n]===!0}[_2n]=!0},v2n=Symbol.for("undici.error.UND_ERR_ABORTED"),qZt=class extends Urt{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[v2n]===!0}[v2n]=!0},C2n=Symbol.for("undici.error.UND_ERR_INFO"),jZt=class extends Hd{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[C2n]===!0}[C2n]=!0},b2n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),HZt=class extends Hd{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[b2n]===!0}[b2n]=!0},S2n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),GZt=class extends Hd{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[S2n]===!0}[S2n]=!0},T2n=Symbol.for("undici.error.UND_ERR_DESTROYED"),$Zt=class extends Hd{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[T2n]===!0}[T2n]=!0},I2n=Symbol.for("undici.error.UND_ERR_CLOSED"),VZt=class extends Hd{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[I2n]===!0}[I2n]=!0},x2n=Symbol.for("undici.error.UND_ERR_SOCKET"),WZt=class extends Hd{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[x2n]===!0}[x2n]=!0},w2n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),zZt=class extends Hd{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[w2n]===!0}[w2n]=!0},R2n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),YZt=class extends Hd{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[R2n]===!0}[R2n]=!0},k2n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),KZt=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[k2n]===!0}[k2n]=!0},P2n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),JZt=class extends Hd{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[P2n]===!0}[P2n]=!0},D2n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),ZZt=class extends Hd{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[D2n]===!0}[D2n]=!0},N2n=Symbol.for("undici.error.UND_ERR_RESPONSE"),XZt=class extends Hd{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[N2n]===!0}[N2n]=!0},M2n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),eXt=class extends Hd{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[M2n]===!0}[M2n]=!0},O2n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),tXt=class extends Hd{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[O2n]===!0}get[O2n](){return!0}};L2n.exports={AbortError:Urt,HTTPParserError:KZt,UndiciError:Hd,HeadersTimeoutError:OZt,HeadersOverflowError:LZt,BodyTimeoutError:BZt,RequestContentLengthMismatchError:HZt,ConnectTimeoutError:MZt,ResponseStatusCodeError:FZt,InvalidArgumentError:UZt,InvalidReturnValueError:QZt,RequestAbortedError:qZt,ClientDestroyedError:$Zt,ClientClosedError:VZt,InformationalError:jZt,SocketError:WZt,NotSupportedError:zZt,ResponseContentLengthMismatchError:GZt,BalancedPoolMissingUpstreamError:YZt,ResponseExceededMaxSizeError:JZt,RequestRetryError:ZZt,ResponseError:XZt,SecureProxyConnectionError:eXt,MessageSizeExceededError:tXt}});var qrt=I((mZd,B2n)=>{"use strict";p();var Qrt={},rXt=["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:F2n,headerNameLowerCasedRecord:Bls}=qrt(),nXt=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 KRe=require("node:assert"),{kDestroyed:H2n,kBodyUsed:Gde,kListeners:iXt,kBody:j2n}=jd(),{IncomingMessage:Fls}=require("node:http"),$rt=require("node:stream"),Uls=require("node:net"),{Blob:Qls}=require("node:buffer"),qls=require("node:util"),{stringify:jls}=require("node:querystring"),{EventEmitter:Hls}=require("node:events"),{InvalidArgumentError:xg}=Ec(),{headerNameLowerCasedRecord:Gls}=qrt(),{tree:G2n}=q2n(),[$ls,Vls]=process.versions.node.split(".").map(t=>Number(t)),Grt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[j2n]=e,this[Gde]=!1}async*[Symbol.asyncIterator](){KRe(!this[Gde],"disturbed"),this[Gde]=!0,yield*this[j2n]}};function Wls(t){return Vrt(t)?(Y2n(t)===0&&t.on("data",function(){KRe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Gde]=!1,Hls.prototype.on.call(t,"data",function(){this[Gde]=!0})),t):t&&typeof t.pipeTo=="function"?new Grt(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&z2n(t)?new Grt(t):t}a(Wls,"wrapRequestBody");function zls(){}a(zls,"nop");function Vrt(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Vrt,"isStream");function $2n(t){if(t===null)return!1;if(t instanceof Qls)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($2n,"isBlobLike");function Yls(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=jls(e);return r&&(t+="?"+r),t}a(Yls,"buildURL");function V2n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(V2n,"isValidPort");function Hrt(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Hrt,"isHttpOrHttpsPrefixed");function W2n(t){if(typeof t=="string"){if(t=new URL(t),!Hrt(t.origin||t.protocol))throw new xg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new xg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&V2n(t.port)===!1)throw new xg("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 xg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new xg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new xg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new xg("Invalid URL origin: the origin must be a string or null/undefined.");if(!Hrt(t.origin||t.protocol))throw new xg("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(!Hrt(t.origin||t.protocol))throw new xg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(W2n,"parseURL");function Kls(t){if(t=W2n(t),t.pathname!=="/"||t.search||t.hash)throw new xg("invalid url");return t}a(Kls,"parseOrigin");function Jls(t){if(t[0]==="["){let r=t.indexOf("]");return KRe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(Jls,"getHostname");function Zls(t){if(!t)return null;KRe(typeof t=="string");let e=Jls(t);return Uls.isIP(e)?"":e}a(Zls,"getServerName");function Xls(t){return JSON.parse(JSON.stringify(t))}a(Xls,"deepClone");function eus(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(eus,"isAsyncIterable");function z2n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(z2n,"isIterable");function Y2n(t){if(t==null)return 0;if(Vrt(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if($2n(t))return t.size!=null?t.size:null;if(Z2n(t))return t.byteLength}return null}a(Y2n,"bodyLength");function K2n(t){return t&&!!(t.destroyed||t[H2n]||$rt.isDestroyed?.(t))}a(K2n,"isDestroyed");function tus(t,e){t==null||!Vrt(t)||K2n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===Fls&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[H2n]=!0))}a(tus,"destroy");var rus=/timeout=(\d+)/;function nus(t){let e=t.toString().match(rus);return e?parseInt(e[1],10)*1e3:null}a(nus,"parseKeepAliveTimeout");function J2n(t){return typeof t=="string"?Gls[t]??t.toLowerCase():G2n.lookup(t)??t.toString("latin1").toLowerCase()}a(J2n,"headerNameToString");function ius(t){return G2n.lookup(t)??t.toString("latin1").toLowerCase()}a(ius,"bufferToLowerCasedHeaderName");function ous(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(ous,"parseHeaders");function sus(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(fus,"ReadableStreamFrom");function pus(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(pus,"isFormDataLike");function hus(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(hus,"addAbortListener");var mus=typeof String.prototype.toWellFormed=="function",gus=typeof String.prototype.isWellFormed=="function";function X2n(t){return mus?`${t}`.toWellFormed():qls.toUSVString(t)}a(X2n,"toUSVString");function Aus(t){return gus?`${t}`.isWellFormed():X2n(t)===`${t}`}a(Aus,"isUSVString");function eDn(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(eDn,"isTokenCharCode");function yus(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Fc=require("node:diagnostics_channel"),aXt=require("node:util"),Wrt=aXt.debuglog("undici"),sXt=aXt.debuglog("fetch"),QJ=aXt.debuglog("websocket"),iDn=!1,Tus={beforeConnect:Fc.channel("undici:client:beforeConnect"),connected:Fc.channel("undici:client:connected"),connectError:Fc.channel("undici:client:connectError"),sendHeaders:Fc.channel("undici:client:sendHeaders"),create:Fc.channel("undici:request:create"),bodySent:Fc.channel("undici:request:bodySent"),headers:Fc.channel("undici:request:headers"),trailers:Fc.channel("undici:request:trailers"),error:Fc.channel("undici:request:error"),open:Fc.channel("undici:websocket:open"),close:Fc.channel("undici:websocket:close"),socketError:Fc.channel("undici:websocket:socket_error"),ping:Fc.channel("undici:websocket:ping"),pong:Fc.channel("undici:websocket:pong")};if(Wrt.enabled||sXt.enabled){let t=sXt.enabled?sXt:Wrt;Fc.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)}),Fc.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)}),Fc.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)}),Fc.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)}),Fc.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)}),Fc.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)}),Fc.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)}),iDn=!0}if(QJ.enabled){if(!iDn){let t=Wrt.enabled?Wrt:QJ;Fc.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)}),Fc.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)}),Fc.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)}),Fc.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)})}Fc.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:r}}=t;QJ("connection opened %s%s",e,r?`:${r}`:"")}),Fc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;QJ("closed connection to %s - %s %s",e.url,r,n)}),Fc.channel("undici:websocket:socket_error").subscribe(t=>{QJ("connection errored - %s",t.message)}),Fc.channel("undici:websocket:ping").subscribe(t=>{QJ("ping received")}),Fc.channel("undici:websocket:pong").subscribe(t=>{QJ("pong received")})}oDn.exports={channels:Tus}});var lDn=I((TZd,cDn)=>{"use strict";p();var{InvalidArgumentError:Su,NotSupportedError:Ius}=Ec(),IF=require("node:assert"),{isValidHTTPToken:aDn,isValidHeaderValue:cXt,isStream:xus,destroy:wus,isBuffer:Rus,isFormDataLike:kus,isIterable:Pus,isBlobLike:Dus,buildURL:Nus,validateHandler:Mus,getServerName:Ous,normalizedMethodRecords:Lus}=qs(),{channels:c5}=$de(),{headerNameLowerCasedRecord:sDn}=qrt(),Bus=/[^\u0021-\u00ff]/,vw=Symbol("handler"),lXt=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},E){if(typeof r!="string")throw new Su("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Su("path must be an absolute URL or start with a slash");if(Bus.test(r))throw new Su("invalid request path");if(typeof n!="string")throw new Su("method must be a string");if(Lus[n]===void 0&&!aDn(n))throw new Su("invalid request method");if(d&&typeof d!="string")throw new Su("upgrade must be a string");if(d&&!cXt(d))throw new Su("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Su("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Su("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Su("invalid reset");if(A!=null&&typeof A!="boolean")throw new Su("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(xus(o)){this.body=o;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=a(function(){wus(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(Rus(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(kus(o)||Pus(o)||Dus(o))this.body=o;else throw new Su("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?Nus(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 Su("headers array must be even");for(let _=0;_{"use strict";p();var Fus=require("node:events"),Yrt=class extends Fus{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 uXt(this,n)}},uXt=class extends Yrt{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)}};uDn.exports=Yrt});var Yde=I((PZd,dDn)=>{"use strict";p();var Uus=JRe(),{ClientDestroyedError:dXt,ClientClosedError:Qus,InvalidArgumentError:Vde}=Ec(),{kDestroy:qus,kClose:jus,kClosed:ZRe,kDestroyed:Wde,kDispatch:fXt,kInterceptors:qJ}=jd(),xF=Symbol("onDestroyed"),zde=Symbol("onClosed"),Krt=Symbol("Intercepted Dispatch"),pXt=class extends Uus{static{a(this,"DispatcherBase")}constructor(){super(),this[Wde]=!1,this[xF]=null,this[ZRe]=!1,this[zde]=[]}get destroyed(){return this[Wde]}get closed(){return this[ZRe]}get interceptors(){return this[qJ]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[qJ][r]!="function")throw new Vde("interceptor must be an function")}this[qJ]=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 Vde("invalid callback");if(this[Wde]){queueMicrotask(()=>e(new dXt,null));return}if(this[ZRe]){this[zde]?this[zde].push(e):queueMicrotask(()=>e(null,null));return}this[ZRe]=!0,this[zde].push(e);let r=a(()=>{let n=this[zde];this[zde]=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 Vde("invalid callback");if(this[Wde]){this[xF]?this[xF].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new dXt),this[Wde]=!0,this[xF]=this[xF]||[],this[xF].push(r);let n=a(()=>{let o=this[xF];this[xF]=null;for(let s=0;s{queueMicrotask(n)})}[Krt](e,r){if(!this[qJ]||this[qJ].length===0)return this[Krt]=this[fXt],this[fXt](e,r);let n=this[fXt].bind(this);for(let o=this[qJ].length-1;o>=0;o--)n=this[qJ][o](n);return this[Krt]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new Vde("handler must be an object");try{if(!e||typeof e!="object")throw new Vde("opts must be an object.");if(this[Wde]||this[xF])throw new dXt;if(this[ZRe])throw new Qus;return this[Krt](e,r)}catch(n){if(typeof r.onError!="function")throw new Vde("invalid onError method");return r.onError(n),!1}}};dDn.exports=pXt});var _Xt=I((MZd,mDn)=>{"use strict";p();var Kde=0,hXt=1e3,mXt=(hXt>>1)-1,wF,gXt=Symbol("kFastTimer"),RF=[],AXt=-2,yXt=-1,pDn=0,fDn=1;function EXt(){Kde+=mXt;let t=0,e=RF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=yXt,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===yXt?(r._state=AXt,--e!==0&&(RF[t]=RF[e])):++t}RF.length=e,RF.length!==0&&hDn()}a(EXt,"onTick");function hDn(){wF?wF.refresh():(clearTimeout(wF),wF=setTimeout(EXt,mXt),wF.unref&&wF.unref())}a(hDn,"refreshTimeout");var Jrt=class{static{a(this,"FastTimer")}[gXt]=!0;_state=AXt;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===AXt&&RF.push(this),(!wF||RF.length===1)&&hDn(),this._state=pDn}clear(){this._state=yXt,this._idleStart=-1}};mDn.exports={setTimeout(t,e,r){return e<=hXt?setTimeout(t,e,r):new Jrt(t,e,r)},clearTimeout(t){t[gXt]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Jrt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Kde},tick(t=0){Kde+=t-hXt+1,EXt(),EXt()},reset(){Kde=0,RF.length=0,clearTimeout(wF),wF=null},kFastTimer:gXt}});var XRe=I((UZd,_Dn)=>{"use strict";p();var Hus=require("node:net"),gDn=require("node:assert"),EDn=qs(),{InvalidArgumentError:Gus,ConnectTimeoutError:$us}=Ec(),Zrt=_Xt();function ADn(){}a(ADn,"noop");var vXt,CXt;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?CXt=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 Vus({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new Gus("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new CXt(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},E){let _;if(h==="https:"){vXt||(vXt=require("node:tls")),g=g||c.servername||EDn.getServerName(f)||null;let b=g||d;gDn(b);let T=o||l.get(b)||null;m=m||443,_=vXt.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}),_.on("session",function(w){l.set(b,w)})}else gDn(!y,"httpSocket can only be sent on TLS update"),m=m||80,_=Hus.connect({highWaterMark:64*1024,...c,localAddress:A,port:m,host:d});if(c.keepAlive==null||c.keepAlive){let b=c.keepAliveInitialDelay===void 0?6e4:c.keepAliveInitialDelay;_.setKeepAlive(!0,b)}let v=Wus(new WeakRef(_),{timeout:n,hostname:d,port:m});return _.setNoDelay(!0).once(h==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(v),E){let b=E;E=null,b(null,this)}}).on("error",function(b){if(queueMicrotask(v),E){let T=E;E=null,T(b)}}),_},"connect")}a(Vus,"buildConnector");var Wus=process.platform==="win32"?(t,e)=>{if(!e.timeout)return ADn;let r=null,n=null,o=Zrt.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>yDn(t.deref(),e))})},e.timeout);return()=>{Zrt.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return ADn;let r=null,n=Zrt.setFastTimeout(()=>{r=setImmediate(()=>{yDn(t.deref(),e)})},e.timeout);return()=>{Zrt.clearFastTimeout(n),clearImmediate(r)}};function yDn(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)`,EDn.destroy(t,new $us(r))}a(yDn,"onConnectTimeout");_Dn.exports=Vus});var vDn=I(Xrt=>{"use strict";p();Object.defineProperty(Xrt,"__esModule",{value:!0});Xrt.enumToMap=void 0;function zus(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(zus,"enumToMap");Xrt.enumToMap=zus});var CDn=I(Pr=>{"use strict";p();Object.defineProperty(Pr,"__esModule",{value:!0});Pr.SPECIAL_HEADERS=Pr.HEADER_STATE=Pr.MINOR=Pr.MAJOR=Pr.CONNECTION_TOKEN_CHARS=Pr.HEADER_CHARS=Pr.TOKEN=Pr.STRICT_TOKEN=Pr.HEX=Pr.URL_CHAR=Pr.STRICT_URL_CHAR=Pr.USERINFO_CHARS=Pr.MARK=Pr.ALPHANUM=Pr.NUM=Pr.HEX_MAP=Pr.NUM_MAP=Pr.ALPHA=Pr.FINISH=Pr.H_METHOD_MAP=Pr.METHOD_MAP=Pr.METHODS_RTSP=Pr.METHODS_ICE=Pr.METHODS_HTTP=Pr.METHODS=Pr.LENIENT_FLAGS=Pr.FLAGS=Pr.TYPE=Pr.ERROR=void 0;var Yus=vDn(),Kus;(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"})(Kus=Pr.ERROR||(Pr.ERROR={}));var Jus;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(Jus=Pr.TYPE||(Pr.TYPE={}));var Zus;(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"})(Zus=Pr.FLAGS||(Pr.FLAGS={}));var Xus;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(Xus=Pr.LENIENT_FLAGS||(Pr.LENIENT_FLAGS={}));var Mi;(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"})(Mi=Pr.METHODS||(Pr.METHODS={}));Pr.METHODS_HTTP=[Mi.DELETE,Mi.GET,Mi.HEAD,Mi.POST,Mi.PUT,Mi.CONNECT,Mi.OPTIONS,Mi.TRACE,Mi.COPY,Mi.LOCK,Mi.MKCOL,Mi.MOVE,Mi.PROPFIND,Mi.PROPPATCH,Mi.SEARCH,Mi.UNLOCK,Mi.BIND,Mi.REBIND,Mi.UNBIND,Mi.ACL,Mi.REPORT,Mi.MKACTIVITY,Mi.CHECKOUT,Mi.MERGE,Mi["M-SEARCH"],Mi.NOTIFY,Mi.SUBSCRIBE,Mi.UNSUBSCRIBE,Mi.PATCH,Mi.PURGE,Mi.MKCALENDAR,Mi.LINK,Mi.UNLINK,Mi.PRI,Mi.SOURCE];Pr.METHODS_ICE=[Mi.SOURCE];Pr.METHODS_RTSP=[Mi.OPTIONS,Mi.DESCRIBE,Mi.ANNOUNCE,Mi.SETUP,Mi.PLAY,Mi.PAUSE,Mi.TEARDOWN,Mi.GET_PARAMETER,Mi.SET_PARAMETER,Mi.REDIRECT,Mi.RECORD,Mi.FLUSH,Mi.GET,Mi.POST];Pr.METHOD_MAP=Yus.enumToMap(Mi);Pr.H_METHOD_MAP={};Object.keys(Pr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(Pr.H_METHOD_MAP[t]=Pr.METHOD_MAP[t])});var eds;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(eds=Pr.FINISH||(Pr.FINISH={}));Pr.ALPHA=[];for(let t=65;t<=90;t++)Pr.ALPHA.push(String.fromCharCode(t)),Pr.ALPHA.push(String.fromCharCode(t+32));Pr.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};Pr.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};Pr.NUM=["0","1","2","3","4","5","6","7","8","9"];Pr.ALPHANUM=Pr.ALPHA.concat(Pr.NUM);Pr.MARK=["-","_",".","!","~","*","'","(",")"];Pr.USERINFO_CHARS=Pr.ALPHANUM.concat(Pr.MARK).concat(["%",";",":","&","=","+","$",","]);Pr.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(Pr.ALPHANUM);Pr.URL_CHAR=Pr.STRICT_URL_CHAR.concat([" ","\f"]);for(let t=128;t<=255;t++)Pr.URL_CHAR.push(t);Pr.HEX=Pr.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);Pr.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(Pr.ALPHANUM);Pr.TOKEN=Pr.STRICT_TOKEN.concat([" "]);Pr.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&Pr.HEADER_CHARS.push(t);Pr.CONNECTION_TOKEN_CHARS=Pr.HEADER_CHARS.filter(t=>t!==44);Pr.MAJOR=Pr.NUM_MAP;Pr.MINOR=Pr.MAJOR;var Jde;(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"})(Jde=Pr.HEADER_STATE||(Pr.HEADER_STATE={}));Pr.SPECIAL_HEADERS={connection:Jde.CONNECTION,"content-length":Jde.CONTENT_LENGTH,"proxy-connection":Jde.CONNECTION,"transfer-encoding":Jde.TRANSFER_ENCODING,upgrade:Jde.UPGRADE}});var bXt=I((WZd,bDn)=>{"use strict";p();var{Buffer:tds}=require("node:buffer");bDn.exports=tds.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 TDn=I((YZd,SDn)=>{"use strict";p();var{Buffer:rds}=require("node:buffer");SDn.exports=rds.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 eke=I((JZd,NDn)=>{"use strict";p();var IDn=["GET","HEAD","POST"],nds=new Set(IDn),ids=[101,204,205,304],xDn=[301,302,303,307,308],ods=new Set(xDn),wDn=["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"],sds=new Set(wDn),RDn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],ads=new Set(RDn),cds=["follow","manual","error"],kDn=["GET","HEAD","OPTIONS","TRACE"],lds=new Set(kDn),uds=["navigate","same-origin","no-cors","cors"],dds=["omit","same-origin","include"],fds=["default","no-store","reload","no-cache","force-cache","only-if-cached"],pds=["content-encoding","content-language","content-location","content-type","content-length"],hds=["half"],PDn=["CONNECT","TRACE","TRACK"],mds=new Set(PDn),DDn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],gds=new Set(DDn);NDn.exports={subresource:DDn,forbiddenMethods:PDn,requestBodyHeader:pds,referrerPolicy:RDn,requestRedirect:cds,requestMode:uds,requestCredentials:dds,requestCache:fds,redirectStatus:xDn,corsSafeListedMethods:IDn,nullBodyStatus:ids,safeMethods:kDn,badPorts:wDn,requestDuplex:hds,subresourceSet:gds,badPortsSet:sds,redirectStatusSet:ods,corsSafeListedMethodsSet:nds,safeMethodsSet:lds,forbiddenMethodsSet:mds,referrerPolicySet:ads}});var TXt=I((XZd,MDn)=>{"use strict";p();var SXt=Symbol.for("undici.globalOrigin.1");function Ads(){return globalThis[SXt]}a(Ads,"getGlobalOrigin");function yds(t){if(t===void 0){Object.defineProperty(globalThis,SXt,{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,SXt,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(yds,"setGlobalOrigin");MDn.exports={getGlobalOrigin:Ads,setGlobalOrigin:yds}});var nb=I((rXd,qDn)=>{"use strict";p();var tnt=require("node:assert"),Eds=new TextEncoder,tke=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,_ds=/[\u000A\u000D\u0009\u0020]/,vds=/[\u0009\u000A\u000C\u000D\u0020]/g,Cds=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function bds(t){tnt(t.protocol==="data:");let e=BDn(t,!0);e=e.slice(5);let r={position:0},n=Zde(",",e,r),o=n.length;if(n=Rds(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=FDn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=QDn(c);if(c=Tds(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=IXt(n);return l==="failure"&&(l=IXt("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(bds,"dataURLProcessor");function BDn(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(BDn,"URLSerializer");function rnt(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(ODn,"isHexCharByte");function LDn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(LDn,"hexByteToNumber");function Sds(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=Zde(";",t,e);if(n=ent(n,!1,!0),n.length===0||!tke.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.position_ds.test(d),t,e);let l=rnt(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=UDn(t,e,!0),Zde(";",t,e);else if(u=Zde(";",t,e),u=ent(u,!1,!0),u.length===0)continue;l.length!==0&&tke.test(l)&&(u.length===0||Cds.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(IXt,"parseMIMEType");function Tds(t){t=t.replace(vds,"");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(Tds,"forgivingBase64");function UDn(t,e,r){let n=e.position,o="";for(tnt(t[e.position]==='"'),e.position++;o+=rnt(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{tnt(s==='"');break}}return r?o:t.slice(n,e.position)}a(UDn,"collectAnHTTPQuotedString");function Ids(t){tnt(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",tke.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(Ids,"serializeAMimeType");function xds(t){return t===13||t===10||t===9||t===32}a(xds,"isHTTPWhiteSpace");function ent(t,e=!0,r=!0){return xXt(t,e,r,xds)}a(ent,"removeHTTPWhitespace");function wds(t){return t===13||t===10||t===9||t===12||t===32}a(wds,"isASCIIWhitespace");function Rds(t,e=!0,r=!0){return xXt(t,e,r,wds)}a(Rds,"removeASCIIWhitespace");function xXt(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(xXt,"removeChars");function QDn(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(QDn,"isomorphicDecode");function kds(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(kds,"minimizeSupportedMimeType");qDn.exports={dataURLProcessor:bds,URLSerializer:BDn,collectASequenceOfCodePoints:rnt,collectASequenceOfCodePointsFast:Zde,stringPercentDecode:FDn,parseMIMEType:IXt,collectAnHTTPQuotedString:UDn,serializeAMimeType:Ids,removeChars:xXt,removeHTTPWhitespace:ent,minimizeSupportedMimeType:kds,HTTP_TOKEN_CODEPOINTS:tke,isomorphicDecode:QDn}});var qA=I((oXd,jDn)=>{"use strict";p();var{types:l5,inspect:Pds}=require("node:util"),{markAsUncloneable:Dds}=require("node:worker_threads"),{toUSVString:Nds}=qs(),Er={};Er.converters={};Er.util={};Er.errors={};Er.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};Er.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 Er.errors.exception({header:t.prefix,message:r})};Er.errors.invalidArgument=function(t){return Er.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};Er.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}};Er.argumentLengthCheck=function({length:t},e,r){if(t{});Er.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 Er.errors.exception({header:"Integer conversion",message:`Could not convert ${Er.util.Stringify(t)} to an integer.`});if(c=Er.util.IntegerPart(c),co)throw Er.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=Er.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e)-1?c-Math.pow(2,e):c)};Er.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};Er.util.Stringify=function(t){switch(Er.util.Type(t)){case"Symbol":return`Symbol(${t.description})`;case"Object":return Pds(t);case"String":return`"${t}"`;default:return`${t}`}};Er.sequenceConverter=function(t){return(e,r,n,o)=>{if(Er.util.Type(e)!=="Object")throw Er.errors.exception({header:r,message:`${n} (${Er.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 Er.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}};Er.recordConverter=function(t,e){return(r,n,o)=>{if(Er.util.Type(r)!=="Object")throw Er.errors.exception({header:n,message:`${o} ("${Er.util.Type(r)}") is not an Object.`});let s={};if(!l5.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}};Er.interfaceConverter=function(t){return(e,r,n,o)=>{if(o?.strict!==!1&&!(e instanceof t))throw Er.errors.exception({header:r,message:`Expected ${n} ("${Er.util.Stringify(e)}") to be an instance of ${t.name}.`});return e}};Er.dictionaryConverter=function(t){return(e,r,n)=>{let o=Er.util.Type(e),s={};if(o==="Null"||o==="Undefined")return s;if(o!=="Object")throw Er.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 Er.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 Er.errors.exception({header:r,message:`${h} is not an accepted type. Expected one of ${c.allowedValues.join(", ")}.`});s[l]=h}}return s}};Er.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};Er.converters.DOMString=function(t,e,r,n){if(t===null&&n?.legacyNullToEmptyString)return"";if(typeof t=="symbol")throw Er.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};Er.converters.ByteString=function(t,e,r){let n=Er.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};Er.converters.USVString=Nds;Er.converters.boolean=function(t){return!!t};Er.converters.any=function(t){return t};Er.converters["long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"signed",void 0,e,r)};Er.converters["unsigned long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"unsigned",void 0,e,r)};Er.converters["unsigned long"]=function(t,e,r){return Er.util.ConvertToInt(t,32,"unsigned",void 0,e,r)};Er.converters["unsigned short"]=function(t,e,r,n){return Er.util.ConvertToInt(t,16,"unsigned",n,e,r)};Er.converters.ArrayBuffer=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!l5.isAnyArrayBuffer(t))throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&l5.isSharedArrayBuffer(t))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.resizable||t.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.TypedArray=function(t,e,r,n,o){if(Er.util.Type(t)!=="Object"||!l5.isTypedArray(t)||t.constructor.name!==e.name)throw Er.errors.conversionFailed({prefix:r,argument:`${n} ("${Er.util.Stringify(t)}")`,types:[e.name]});if(o?.allowShared===!1&&l5.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.DataView=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!l5.isDataView(t))throw Er.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&l5.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.BufferSource=function(t,e,r,n){if(l5.isAnyArrayBuffer(t))return Er.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if(l5.isTypedArray(t))return Er.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if(l5.isDataView(t))return Er.converters.DataView(t,e,r,{...n,allowShared:!1});throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["BufferSource"]})};Er.converters["sequence"]=Er.sequenceConverter(Er.converters.ByteString);Er.converters["sequence>"]=Er.sequenceConverter(Er.converters["sequence"]);Er.converters["record"]=Er.recordConverter(Er.converters.ByteString,Er.converters.ByteString);jDn.exports={webidl:Er}});var cT=I((aXd,rNn)=>{"use strict";p();var{Transform:Mds}=require("node:stream"),HDn=require("node:zlib"),{redirectStatusSet:Ods,referrerPolicySet:Lds,badPortsSet:Bds}=eke(),{getGlobalOrigin:GDn}=TXt(),{collectASequenceOfCodePoints:jJ,collectAnHTTPQuotedString:Fds,removeChars:Uds,parseMIMEType:Qds}=nb(),{performance:qds}=require("node:perf_hooks"),{isBlobLike:jds,ReadableStreamFrom:Hds,isValidHTTPToken:$Dn,normalizedMethodRecordsBase:Gds}=qs(),HJ=require("node:assert"),{isUint8Array:$ds}=require("node:util/types"),{webidl:rke}=qA(),VDn=[],int;try{int=require("node:crypto");let t=["sha256","sha384","sha512"];VDn=int.getHashes().filter(e=>t.includes(e))}catch{}function WDn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(WDn,"responseURL");function Vds(t,e){if(!Ods.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&YDn(r)&&(zDn(r)||(r=Wds(r)),r=new URL(r,WDn(t))),r&&!r.hash&&(r.hash=e),r}a(Vds,"responseLocationURL");function zDn(t){for(let e=0;e126||r<32)return!1}return!0}a(zDn,"isValidEncodedURL");function Wds(t){return Buffer.from(t,"binary").toString("utf8")}a(Wds,"normalizeBinaryStringToUtf8");function ike(t){return t.urlList[t.urlList.length-1]}a(ike,"requestCurrentURL");function zds(t){let e=ike(t);return eNn(e)&&Bds.has(e.port)?"blocked":"allowed"}a(zds,"requestBadPort");function Yds(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(Yds,"isErrorLike");function Kds(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(Kds,"isValidReasonPhrase");var Jds=$Dn;function YDn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a(YDn,"isValidHeaderValue");function Zds(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(Lds.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(Zds,"setRequestReferrerPolicyOnRedirect");function Xds(){return"allowed"}a(Xds,"crossOriginResourcePolicyCheck");function efs(){return"success"}a(efs,"corsCheck");function tfs(){return"success"}a(tfs,"TAOCheck");function rfs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(rfs,"appendFetchMetadata");function nfs(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&&RXt(t.origin)&&!RXt(ike(t))&&(e=null);break;case"same-origin":ont(t,ike(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(nfs,"appendRequestOriginHeader");function Xde(t,e){return t}a(Xde,"coarsenTime");function ifs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=ont(t,n),c=nke(n)&&!nke(t.url);switch(e){case"origin":return o??wXt(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=ike(t);return ont(n,l)?n:nke(n)&&!nke(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(cfs,"determineRequestsReferrer");function wXt(t,e){return HJ(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(wXt,"stripURLForReferrer");function nke(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(nke,"isURLPotentiallyTrustworthy");function lfs(t,e){if(int===void 0)return!0;let r=JDn(e);if(r==="no metadata"||r.length===0)return!0;let n=dfs(r),o=ffs(r,n);for(let s of o){let c=s.algo,l=s.hash,u=int.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)),pfs(u,l))return!0}return!1}a(lfs,"bytesMatch");var ufs=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function JDn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=ufs.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();VDn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(JDn,"parseMetadata");function dfs(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(mfs,"createDeferredPromise");function gfs(t){return t.controller.state==="aborted"}a(gfs,"isAborted");function Afs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(Afs,"isCancelled");function yfs(t){return Gds[t.toLowerCase()]??t}a(yfs,"normalizeMethod");function Efs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return HJ(typeof e=="string"),e}a(Efs,"serializeJavascriptValueToJSONString");var _fs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function ZDn(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,_fs),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(ZDn,"createIterator");function vfs(t,e,r,n=0,o=1){let s=ZDn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(rke.brandCheck(this,e),rke.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(vfs,"iteratorMixin");async function Cfs(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await XDn(s))}catch(c){o(c)}}a(Cfs,"fullyReadBody");function bfs(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(bfs,"isReadableStreamLike");function Sfs(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(Sfs,"readableStreamClose");var Tfs=/[^\x00-\xFF]/;function nnt(t){return HJ(!Tfs.test(t)),t}a(nnt,"isomorphicEncode");async function XDn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!$ds(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(XDn,"readAllBytes");function Ifs(t){HJ("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(Ifs,"urlIsLocal");function RXt(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(RXt,"urlHasHttpsScheme");function eNn(t){HJ("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(eNn,"urlIsHttpHttpsScheme");function xfs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&jJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&jJ(u=>u===" "||u===" ",r,n);let o=jJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&jJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&jJ(u=>u===" "||u===" ",r,n);let c=jJ(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(xfs,"simpleRangeHeaderValue");function wfs(t,e,r){let n="bytes ";return n+=nnt(`${t}`),n+="-",n+=nnt(`${e}`),n+="/",n+=nnt(`${r}`),n}a(wfs,"buildContentRange");var kXt=class extends Mds{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?HDn.createInflate(this.#e):HDn.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 Rfs(t){return new kXt(t)}a(Rfs,"createInflate");function kfs(t){let e=null,r=null,n=null,o=tNn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Qds(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(kfs,"extractMimeType");function Pfs(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(Pfs,"gettingDecodingSplitting");function tNn(t,e){let r=e.get(t,!0);return r===null?null:Pfs(r)}a(tNn,"getDecodeSplit");var Dfs=new TextDecoder;function Nfs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),Dfs.decode(t))}a(Nfs,"utf8DecodeBytes");var PXt=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return GDn()}get origin(){return this.baseUrl?.origin}policyContainer=KDn()},DXt=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new PXt},Mfs=new DXt;rNn.exports={isAborted:gfs,isCancelled:Afs,isValidEncodedURL:zDn,createDeferredPromise:mfs,ReadableStreamFrom:Hds,tryUpgradeRequestToAPotentiallyTrustworthyURL:hfs,clampAndCoarsenConnectionTimingInfo:ifs,coarsenedSharedCurrentTime:ofs,determineRequestsReferrer:cfs,makePolicyContainer:KDn,clonePolicyContainer:afs,appendFetchMetadata:rfs,appendRequestOriginHeader:nfs,TAOCheck:tfs,corsCheck:efs,crossOriginResourcePolicyCheck:Xds,createOpaqueTimingInfo:sfs,setRequestReferrerPolicyOnRedirect:Zds,isValidHTTPToken:$Dn,requestBadPort:zds,requestCurrentURL:ike,responseURL:WDn,responseLocationURL:Vds,isBlobLike:jds,isURLPotentiallyTrustworthy:nke,isValidReasonPhrase:Kds,sameOrigin:ont,normalizeMethod:yfs,serializeJavascriptValueToJSONString:Efs,iteratorMixin:vfs,createIterator:ZDn,isValidHeaderName:Jds,isValidHeaderValue:YDn,isErrorLike:Yds,fullyReadBody:Cfs,bytesMatch:lfs,isReadableStreamLike:bfs,readableStreamClose:Sfs,isomorphicEncode:nnt,urlIsLocal:Ifs,urlHasHttpsScheme:RXt,urlIsHttpHttpsScheme:eNn,readAllBytes:XDn,simpleRangeHeaderValue:xfs,buildContentRange:wfs,parseMetadata:JDn,createInflate:Rfs,extractMimeType:kfs,getDecodeSplit:tNn,utf8DecodeBytes:Nfs,environmentSettingsObject:Mfs}});var sj=I((uXd,nNn)=>{"use strict";p();nNn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var MXt=I((fXd,iNn)=>{"use strict";p();var{Blob:Ofs,File:Lfs}=require("node:buffer"),{kState:kF}=sj(),{webidl:u5}=qA(),NXt=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[kF]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return u5.brandCheck(this,t),this[kF].blobLike.stream(...e)}arrayBuffer(...e){return u5.brandCheck(this,t),this[kF].blobLike.arrayBuffer(...e)}slice(...e){return u5.brandCheck(this,t),this[kF].blobLike.slice(...e)}text(...e){return u5.brandCheck(this,t),this[kF].blobLike.text(...e)}get size(){return u5.brandCheck(this,t),this[kF].blobLike.size}get type(){return u5.brandCheck(this,t),this[kF].blobLike.type}get name(){return u5.brandCheck(this,t),this[kF].name}get lastModified(){return u5.brandCheck(this,t),this[kF].lastModified}get[Symbol.toStringTag](){return"File"}};u5.converters.Blob=u5.interfaceConverter(Ofs);function Bfs(t){return t instanceof Lfs||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(Bfs,"isFileLike");iNn.exports={FileLike:NXt,isFileLike:Bfs}});var ske=I((mXd,lNn)=>{"use strict";p();var{isBlobLike:snt,iteratorMixin:Ffs}=cT(),{kState:iv}=sj(),{kEnumerableProperty:efe}=qs(),{FileLike:oNn,isFileLike:Ufs}=MXt(),{webidl:Tu}=qA(),{File:cNn}=require("node:buffer"),sNn=require("node:util"),aNn=globalThis.File??cNn,oke=class t{static{a(this,"FormData")}constructor(e){if(Tu.util.markAsUncloneable(this),e!==void 0)throw Tu.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[iv]=[]}append(e,r,n=void 0){Tu.brandCheck(this,t);let o="FormData.append";if(Tu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!snt(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=Tu.converters.USVString(e,o,"name"),r=snt(r)?Tu.converters.Blob(r,o,"value",{strict:!1}):Tu.converters.USVString(r,o,"value"),n=arguments.length===3?Tu.converters.USVString(n,o,"filename"):void 0;let s=OXt(e,r,n);this[iv].push(s)}delete(e){Tu.brandCheck(this,t);let r="FormData.delete";Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[iv]=this[iv].filter(n=>n.name!==e)}get(e){Tu.brandCheck(this,t);let r="FormData.get";Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name");let n=this[iv].findIndex(o=>o.name===e);return n===-1?null:this[iv][n].value}getAll(e){Tu.brandCheck(this,t);let r="FormData.getAll";return Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[iv].filter(n=>n.name===e).map(n=>n.value)}has(e){Tu.brandCheck(this,t);let r="FormData.has";return Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[iv].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Tu.brandCheck(this,t);let o="FormData.set";if(Tu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!snt(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=Tu.converters.USVString(e,o,"name"),r=snt(r)?Tu.converters.Blob(r,o,"name",{strict:!1}):Tu.converters.USVString(r,o,"name"),n=arguments.length===3?Tu.converters.USVString(n,o,"name"):void 0;let s=OXt(e,r,n),c=this[iv].findIndex(l=>l.name===e);c!==-1?this[iv]=[...this[iv].slice(0,c),s,...this[iv].slice(c+1).filter(l=>l.name!==e)]:this[iv].push(s)}[sNn.inspect.custom](e,r){let n=this[iv].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=sNn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};Ffs("FormData",oke,iv,"name","value");Object.defineProperties(oke.prototype,{append:efe,delete:efe,get:efe,getAll:efe,has:efe,set:efe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function OXt(t,e,r){if(typeof e!="string"){if(Ufs(e)||(e=e instanceof Blob?new aNn([e],"blob",{type:e.type}):new oNn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof cNn?new aNn([e],r,n):new oNn(e,r,n)}}return{name:t,value:e}}a(OXt,"makeEntry");lNn.exports={FormData:oke,makeEntry:OXt}});var mNn=I((yXd,hNn)=>{"use strict";p();var{isUSVString:uNn,bufferToLowerCasedHeaderName:Qfs}=qs(),{utf8DecodeBytes:qfs}=cT(),{HTTP_TOKEN_CODEPOINTS:jfs,isomorphicDecode:dNn}=nb(),{isFileLike:Hfs}=MXt(),{makeEntry:Gfs}=ske(),ant=require("node:assert"),{File:$fs}=require("node:buffer"),Vfs=globalThis.File??$fs,Wfs=Buffer.from('form-data; name="'),fNn=Buffer.from("; filename"),zfs=Buffer.from("--"),Yfs=Buffer.from(`--\r +`);function Kfs(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(Jfs,"validateBoundary");function Zfs(t,e){ant(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&&cnt(t,zfs,s)||s.position===t.length-4&&cnt(t,Yfs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=Xfs(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",Kfs(f)||(f=""),g=new Vfs([m],d,{type:f})):g=qfs(Buffer.from(m)),ant(uNn(u)),ant(typeof g=="string"&&uNn(g)||Hfs(g)),o.push(Gfs(u,g,d))}}a(Zfs,"multipartFormDataParser");function Xfs(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=tfe(l=>l!==10&&l!==13&&l!==58,t,e);if(c=LXt(c,!0,!0,l=>l===9||l===32),!jfs.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,tfe(l=>l===32||l===9,t,e),Qfs(c)){case"content-disposition":{if(r=n=null,!cnt(t,Wfs,e)||(e.position+=17,r=pNn(t,e),r===null))return"failure";if(cnt(t,fNn,e)){let l=e.position+fNn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=pNn(t,e),n===null))return"failure"}break}case"content-type":{let l=tfe(u=>u!==10&&u!==13,t,e);l=LXt(l,!1,!0,u=>u===9||u===32),o=dNn(l);break}case"content-transfer-encoding":{let l=tfe(u=>u!==10&&u!==13,t,e);l=LXt(l,!1,!0,u=>u===9||u===32),s=dNn(l);break}default:tfe(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(Xfs,"parseMultipartFormDataHeaders");function pNn(t,e){ant(t[e.position-1]===34);let r=tfe(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(pNn,"parseMultipartFormDataName");function tfe(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(LXt,"removeChars");function cnt(t,e,r){if(t.length{"use strict";p();var ake=qs(),{ReadableStreamFrom:eps,isBlobLike:gNn,isReadableStreamLike:tps,readableStreamClose:rps,createDeferredPromise:nps,fullyReadBody:ips,extractMimeType:ops,utf8DecodeBytes:ENn}=cT(),{FormData:ANn}=ske(),{kState:nfe}=sj(),{webidl:sps}=qA(),{Blob:aps}=require("node:buffer"),BXt=require("node:assert"),{isErrored:_Nn,isDisturbed:cps}=require("node:stream"),{isArrayBuffer:lps}=require("node:util/types"),{serializeAMimeType:ups}=nb(),{multipartFormDataParser:dps}=mNn(),FXt;try{let t=require("node:crypto");FXt=a(e=>t.randomInt(0,e),"random")}catch{FXt=a(t=>Math.floor(Math.random(t)),"random")}var lnt=new TextEncoder;function fps(){}a(fps,"noop");var vNn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,CNn;vNn&&(CNn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!cps(e)&&!_Nn(e)&&e.cancel("Response object has been garbage collected").catch(fps)}));function bNn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:gNn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?lnt.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>rps(u))},start(){},type:"bytes"}),BXt(tps(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(lps(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(ake.isFormDataLike(t)){let u=`----formdata-undici-0${`${FXt(1e11)}`.padStart(11,"0")}`,d=`--${u}\r Content-Disposition: form-data`;let f=a(E=>E.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"escape"),h=a(E=>E.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 _=="string"){let v=snt.encode(d+`; name="${f(h(E))}"\r +`),"normalizeLinefeeds"),m=[],g=new Uint8Array([13,10]);s=0;let A=!1;for(let[E,_]of t)if(typeof _=="string"){let v=lnt.encode(d+`; name="${f(h(E))}"\r \r ${h(_)}\r -`);m.push(v),s+=v.byteLength}else{let v=snt.encode(`${d}; name="${f(h(E))}"`+(_.name?`; filename="${f(_.name)}"`:"")+`\r +`);m.push(v),s+=v.byteLength}else{let v=lnt.encode(`${d}; name="${f(h(E))}"`+(_.name?`; filename="${f(_.name)}"`:"")+`\r Content-Type: ${_.type||"application/octet-stream"}\r \r -`);m.push(v,_,g),typeof _.size=="number"?s+=v.byteLength+_.size+g.byteLength:A=!0}let y=snt.encode(`--${u}--\r -`);m.push(y),s+=y.byteLength,A&&(s=null),o=t,n=a(async function*(){for(let E of m)E.stream?yield*E.stream():yield E},"action"),c=`multipart/form-data; boundary=${u}`}else if(mNn(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(ake.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:Yfs(t)}if((typeof o=="string"||ake.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(!ENn(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(CNn,"extractBody");function cps(t,e=!1){return t instanceof ReadableStream&&(LXt(!ake.isDisturbed(t),"The body has already been consumed."),LXt(!t.locked,"The stream is locked.")),CNn(t,e)}a(cps,"safelyExtractBody");function lps(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(lps,"cloneBody");function ups(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(ups,"throwIfAborted");function dps(t){return{blob(){return rfe(this,r=>{let n=ANn(this);return n===null?n="":n&&(n=ops(n)),new rps([r],{type:n})},t)},arrayBuffer(){return rfe(this,r=>new Uint8Array(r).buffer,t)},text(){return rfe(this,yNn,t)},json(){return rfe(this,pps,t)},formData(){return rfe(this,r=>{let n=ANn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=sps(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new gNn;return s[nfe]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new gNn;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 rfe(this,r=>new Uint8Array(r),t)}}}a(dps,"bodyMixinMethods");function fps(t){Object.assign(t.prototype,dps(t))}a(fps,"mixinBody");async function rfe(t,e,r){if(tps.brandCheck(t,r),bNn(t))throw new TypeError("Body is unusable: Body has already been read");ups(t[nfe]);let n=Zfs(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[nfe].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await Xfs(t[nfe].body,s,o),n.promise)}a(rfe,"consumeBody");function bNn(t){let e=t[nfe].body;return e!=null&&(e.stream.locked||ake.isDisturbed(e.stream))}a(bNn,"bodyUnusable");function pps(t){return JSON.parse(yNn(t))}a(pps,"parseJSONFromBytes");function ANn(t){let e=t[nfe].headersList,r=eps(e);return r==="failure"?null:r}a(ANn,"bodyMimeType");SNn.exports={extractBody:CNn,safelyExtractBody:cps,cloneBody:lps,mixinBody:fps,streamRegistry:vNn,hasFinalizationRegistry:_Nn,bodyUnusable:bNn}});var ONn=I((gXd,MNn)=>{"use strict";p();var Hi=require("node:assert"),Ao=qs(),{channels:TNn}=$de(),FXt=EXt(),{RequestContentLengthMismatchError:GJ,ResponseContentLengthMismatchError:hps,RequestAbortedError:PNn,HeadersTimeoutError:mps,HeadersOverflowError:gps,SocketError:fnt,InformationalError:ofe,BodyTimeoutError:Aps,HTTPParserError:yps,ResponseExceededMaxSizeError:Eps}=Ec(),{kUrl:DNn,kReset:ib,kClient:jXt,kParser:dp,kBlocking:uke,kRunning:yE,kPending:_ps,kSize:INn,kWriting:aj,kQueue:u2,kNoRef:cke,kKeepAliveDefaultTimeout:vps,kHostHeader:Cps,kPendingIdx:bps,kRunningIdx:vw,kError:Cw,kPipelining:unt,kSocket:sfe,kKeepAliveTimeoutValue:pnt,kMaxHeadersSize:UXt,kKeepAliveMaxTimeout:Sps,kKeepAliveTimeoutThreshold:Tps,kHeadersTimeout:Ips,kBodyTimeout:xps,kStrictContentLength:HXt,kMaxRequests:xNn,kCounter:wps,kMaxResponseSize:Rps,kOnError:kps,kResume:sj,kHTTPContext:NNn}=jd(),d5=vDn(),Pps=Buffer.alloc(0),ant=Buffer[Symbol.species],cnt=Ao.addListener,Dps=Ao.removeAllListeners,QXt;async function Nps(){let t=process.env.JEST_WORKER_ID?CXt():void 0,e;try{e=await WebAssembly.compile(SDn())}catch{e=await WebAssembly.compile(t||CXt())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onStatus(new ant(f5.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(Hi(A0.ptr===r),A0.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onHeaderField(new ant(f5.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onHeaderValue(new ant(f5.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(Hi(A0.ptr===r),A0.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onBody(new ant(f5.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(Hi(A0.ptr===r),A0.onMessageComplete()||0),"wasm_on_message_complete")}})}a(Nps,"lazyllhttp");var qXt=null,GXt=Nps();GXt.catch();var A0=null,f5=null,lnt=0,p5=null,Mps=0,lke=1,afe=2|lke,dnt=4|lke,$Xt=8|Mps,VXt=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){Hi(Number.isFinite(e[UXt])&&e[UXt]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(d5.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[UXt],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Rps]}setTimeout(e,r){e!==this.timeoutValue||r&lke^this.timeoutType&lke?(this.timeout&&(FXt.clearTimeout(this.timeout),this.timeout=null),e&&(r&lke?this.timeout=FXt.setFastTimeout(wNn,e,new WeakRef(this)):(this.timeout=setTimeout(wNn,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||(Hi(this.ptr!=null),Hi(A0==null),this.llhttp.llhttp_resume(this.ptr),Hi(this.timeoutType===dnt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Pps),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Hi(this.ptr!=null),Hi(A0==null),Hi(!this.paused);let{socket:r,llhttp:n}=this;e.length>lnt&&(p5&&n.free(p5),lnt=Math.ceil(e.length/4096)*4096,p5=n.malloc(lnt)),new Uint8Array(n.memory.buffer,p5,lnt).set(e);try{let o;try{f5=e,A0=this,o=n.llhttp_execute(this.ptr,p5,e.length)}catch(c){throw c}finally{A0=null,f5=null}let s=n.llhttp_get_error_pos(this.ptr)-p5;if(o===d5.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===d5.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==d5.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 yps(l,d5.ERROR[o],e.slice(s))}}catch(o){Ao.destroy(r,o)}}destroy(){Hi(this.ptr!=null),Hi(A0==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&FXt.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[u2][r[vw]];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=Ao.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ao.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());this.trackHeader(e.length)}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ao.destroy(this.socket,new gps)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Hi(r),Hi(n[sfe]===o),Hi(!o.destroyed),Hi(!this.paused),Hi((s.length&1)===0);let l=n[u2][n[vw]];Hi(l),Hi(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[dp].destroy(),o[dp]=null,o[jXt]=null,o[Cw]=null,Dps(o),n[sfe]=null,n[NNn]=null,n[u2][n[vw]++]=null,n.emit("disconnect",n[DNn],[n],new ofe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ao.destroy(o,u)}n[sj]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[u2][o[vw]];if(!u)return-1;if(Hi(!this.upgrade),Hi(this.statusCode<200),e===100)return Ao.destroy(s,new fnt("bad response",Ao.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ao.destroy(s,new fnt("bad upgrade",Ao.getSocketInfo(s))),-1;if(Hi(this.timeoutType===afe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[ib]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[xps];this.setTimeout(f,dnt)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Hi(o[yE]===1),this.upgrade=!0,2;if(r)return Hi(o[yE]===1),this.upgrade=!0,2;if(Hi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[unt]){let f=this.keepAlive?Ao.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[Tps],o[Sps]);h<=0?s[ib]=!0:o[pnt]=h}else o[pnt]=o[vps]}else s[ib]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[uke]&&(s[uke]=!1,o[sj]()),d?d5.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[u2][r[vw]];if(Hi(c),Hi(this.timeoutType===dnt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Hi(o>=200),s>-1&&this.bytesRead+e.length>s)return Ao.destroy(n,new Eps),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return d5.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;Hi(n>=100),Hi((this.headers.length&1)===0);let d=e[u2][e[vw]];if(Hi(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 Ao.destroy(r,new hps),-1;if(d.onComplete(s),e[u2][e[vw]++]=null,r[aj])return Hi(e[yE]===0),Ao.destroy(r,new ofe("reset")),d5.ERROR.PAUSED;if(u){if(r[ib]&&e[yE]===0)return Ao.destroy(r,new ofe("reset")),d5.ERROR.PAUSED;e[unt]==null||e[unt]===1?setImmediate(()=>e[sj]()):e[sj]()}else return Ao.destroy(r,new ofe("reset")),d5.ERROR.PAUSED}}};function wNn(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===afe?(!e[aj]||e.writableNeedDrain||n[yE]>1)&&(Hi(!o,"cannot be paused while waiting for headers"),Ao.destroy(e,new mps)):r===dnt?o||Ao.destroy(e,new Aps):r===$Xt&&(Hi(n[yE]===0&&n[pnt]),Ao.destroy(e,new ofe("socket idle timeout")))}a(wNn,"onParserTimeout");async function Ops(t,e){t[sfe]=e,qXt||(qXt=await GXt,GXt=null),e[cke]=!1,e[aj]=!1,e[ib]=!1,e[uke]=!1,e[dp]=new VXt(t,e,qXt),cnt(e,"error",function(n){Hi(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[dp];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[Cw]=n,this[jXt][kps](n)}),cnt(e,"readable",function(){let n=this[dp];n&&n.readMore()}),cnt(e,"end",function(){let n=this[dp];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}Ao.destroy(this,new fnt("other side closed",Ao.getSocketInfo(this)))}),cnt(e,"close",function(){let n=this[jXt],o=this[dp];o&&(!this[Cw]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[dp].destroy(),this[dp]=null);let s=this[Cw]||new fnt("closed",Ao.getSocketInfo(this));if(n[sfe]=null,n[NNn]=null,n.destroyed){Hi(n[_ps]===0);let c=n[u2].splice(n[vw]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[u2][n[vw]];n[u2][n[vw]++]=null,Ao.errorRequest(n,c,s)}n[bps]=n[vw],Hi(n[yE]===0),n.emit("disconnect",n[DNn],[n],s),n[sj]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return Fps(t,...n)},resume(){Lps(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[aj]||e[ib]||e[uke]||n&&(t[yE]>0&&!n.idempotent||t[yE]>0&&(n.upgrade||n.method==="CONNECT")||t[yE]>0&&Ao.bodyLength(n.body)!==0&&(Ao.isStream(n.body)||Ao.isAsyncIterable(n.body)||Ao.isFormDataLike(n.body))))}}}a(Ops,"connectH1");function Lps(t){let e=t[sfe];if(e&&!e.destroyed){if(t[INn]===0?!e[cke]&&e.unref&&(e.unref(),e[cke]=!0):e[cke]&&e.ref&&(e.ref(),e[cke]=!1),t[INn]===0)e[dp].timeoutType!==$Xt&&e[dp].setTimeout(t[pnt],$Xt);else if(t[yE]>0&&e[dp].statusCode<200&&e[dp].timeoutType!==afe){let r=t[u2][t[vw]],n=r.headersTimeout!=null?r.headersTimeout:t[Ips];e[dp].setTimeout(n,afe)}}}a(Lps,"resumeH1");function Bps(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(Bps,"shouldSendContentLength");function Fps(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(Ao.isFormDataLike(u)){QXt||(QXt=ife().extractBody);let[E,_]=QXt(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ao.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ao.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),Bps(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[HXt])return Ao.errorRequest(t,e,new GJ),!1;process.emitWarning(new GJ)}let g=t[sfe],A=a(E=>{e.aborted||e.completed||(Ao.errorRequest(t,e,E||new PNn),Ao.destroy(u),Ao.destroy(g,new ofe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ao.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[ib]=!0),(s||r==="CONNECT")&&(g[ib]=!0),l!=null&&(g[ib]=l),t[xNn]&&g[wps]++>=t[xNn]&&(g[ib]=!0),c&&(g[uke]=!0);let y=`${r} ${n} HTTP/1.1\r +`);m.push(v,_,g),typeof _.size=="number"?s+=v.byteLength+_.size+g.byteLength:A=!0}let y=lnt.encode(`--${u}--\r +`);m.push(y),s+=y.byteLength,A&&(s=null),o=t,n=a(async function*(){for(let E of m)E.stream?yield*E.stream():yield E},"action"),c=`multipart/form-data; boundary=${u}`}else if(gNn(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(ake.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:eps(t)}if((typeof o=="string"||ake.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(!_Nn(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(bNn,"extractBody");function pps(t,e=!1){return t instanceof ReadableStream&&(BXt(!ake.isDisturbed(t),"The body has already been consumed."),BXt(!t.locked,"The stream is locked.")),bNn(t,e)}a(pps,"safelyExtractBody");function hps(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(hps,"cloneBody");function mps(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(mps,"throwIfAborted");function gps(t){return{blob(){return rfe(this,r=>{let n=yNn(this);return n===null?n="":n&&(n=ups(n)),new aps([r],{type:n})},t)},arrayBuffer(){return rfe(this,r=>new Uint8Array(r).buffer,t)},text(){return rfe(this,ENn,t)},json(){return rfe(this,yps,t)},formData(){return rfe(this,r=>{let n=yNn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=dps(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new ANn;return s[nfe]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new ANn;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 rfe(this,r=>new Uint8Array(r),t)}}}a(gps,"bodyMixinMethods");function Aps(t){Object.assign(t.prototype,gps(t))}a(Aps,"mixinBody");async function rfe(t,e,r){if(sps.brandCheck(t,r),SNn(t))throw new TypeError("Body is unusable: Body has already been read");mps(t[nfe]);let n=nps(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[nfe].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await ips(t[nfe].body,s,o),n.promise)}a(rfe,"consumeBody");function SNn(t){let e=t[nfe].body;return e!=null&&(e.stream.locked||ake.isDisturbed(e.stream))}a(SNn,"bodyUnusable");function yps(t){return JSON.parse(ENn(t))}a(yps,"parseJSONFromBytes");function yNn(t){let e=t[nfe].headersList,r=ops(e);return r==="failure"?null:r}a(yNn,"bodyMimeType");TNn.exports={extractBody:bNn,safelyExtractBody:pps,cloneBody:hps,mixinBody:Aps,streamRegistry:CNn,hasFinalizationRegistry:vNn,bodyUnusable:SNn}});var LNn=I((SXd,ONn)=>{"use strict";p();var Hi=require("node:assert"),yo=qs(),{channels:INn}=$de(),UXt=_Xt(),{RequestContentLengthMismatchError:GJ,ResponseContentLengthMismatchError:Eps,RequestAbortedError:DNn,HeadersTimeoutError:_ps,HeadersOverflowError:vps,SocketError:mnt,InformationalError:ofe,BodyTimeoutError:Cps,HTTPParserError:bps,ResponseExceededMaxSizeError:Sps}=Ec(),{kUrl:NNn,kReset:ib,kClient:HXt,kParser:dp,kBlocking:uke,kRunning:yE,kPending:Tps,kSize:xNn,kWriting:cj,kQueue:d2,kNoRef:cke,kKeepAliveDefaultTimeout:Ips,kHostHeader:xps,kPendingIdx:wps,kRunningIdx:Cw,kError:bw,kPipelining:pnt,kSocket:sfe,kKeepAliveTimeoutValue:gnt,kMaxHeadersSize:QXt,kKeepAliveMaxTimeout:Rps,kKeepAliveTimeoutThreshold:kps,kHeadersTimeout:Pps,kBodyTimeout:Dps,kStrictContentLength:GXt,kMaxRequests:wNn,kCounter:Nps,kMaxResponseSize:Mps,kOnError:Ops,kResume:aj,kHTTPContext:MNn}=jd(),d5=CDn(),Lps=Buffer.alloc(0),unt=Buffer[Symbol.species],dnt=yo.addListener,Bps=yo.removeAllListeners,qXt;async function Fps(){let t=process.env.JEST_WORKER_ID?bXt():void 0,e;try{e=await WebAssembly.compile(TDn())}catch{e=await WebAssembly.compile(t||bXt())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onStatus(new unt(f5.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(Hi(A0.ptr===r),A0.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onHeaderField(new unt(f5.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onHeaderValue(new unt(f5.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(Hi(A0.ptr===r),A0.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onBody(new unt(f5.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(Hi(A0.ptr===r),A0.onMessageComplete()||0),"wasm_on_message_complete")}})}a(Fps,"lazyllhttp");var jXt=null,$Xt=Fps();$Xt.catch();var A0=null,f5=null,fnt=0,p5=null,Ups=0,lke=1,afe=2|lke,hnt=4|lke,VXt=8|Ups,WXt=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){Hi(Number.isFinite(e[QXt])&&e[QXt]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(d5.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[QXt],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Mps]}setTimeout(e,r){e!==this.timeoutValue||r&lke^this.timeoutType&lke?(this.timeout&&(UXt.clearTimeout(this.timeout),this.timeout=null),e&&(r&lke?this.timeout=UXt.setFastTimeout(RNn,e,new WeakRef(this)):(this.timeout=setTimeout(RNn,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||(Hi(this.ptr!=null),Hi(A0==null),this.llhttp.llhttp_resume(this.ptr),Hi(this.timeoutType===hnt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Lps),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Hi(this.ptr!=null),Hi(A0==null),Hi(!this.paused);let{socket:r,llhttp:n}=this;e.length>fnt&&(p5&&n.free(p5),fnt=Math.ceil(e.length/4096)*4096,p5=n.malloc(fnt)),new Uint8Array(n.memory.buffer,p5,fnt).set(e);try{let o;try{f5=e,A0=this,o=n.llhttp_execute(this.ptr,p5,e.length)}catch(c){throw c}finally{A0=null,f5=null}let s=n.llhttp_get_error_pos(this.ptr)-p5;if(o===d5.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===d5.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==d5.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 bps(l,d5.ERROR[o],e.slice(s))}}catch(o){yo.destroy(r,o)}}destroy(){Hi(this.ptr!=null),Hi(A0==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&UXt.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[d2][r[Cw]];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=yo.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&yo.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());this.trackHeader(e.length)}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&yo.destroy(this.socket,new vps)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Hi(r),Hi(n[sfe]===o),Hi(!o.destroyed),Hi(!this.paused),Hi((s.length&1)===0);let l=n[d2][n[Cw]];Hi(l),Hi(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[dp].destroy(),o[dp]=null,o[HXt]=null,o[bw]=null,Bps(o),n[sfe]=null,n[MNn]=null,n[d2][n[Cw]++]=null,n.emit("disconnect",n[NNn],[n],new ofe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){yo.destroy(o,u)}n[aj]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[d2][o[Cw]];if(!u)return-1;if(Hi(!this.upgrade),Hi(this.statusCode<200),e===100)return yo.destroy(s,new mnt("bad response",yo.getSocketInfo(s))),-1;if(r&&!u.upgrade)return yo.destroy(s,new mnt("bad upgrade",yo.getSocketInfo(s))),-1;if(Hi(this.timeoutType===afe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[ib]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[Dps];this.setTimeout(f,hnt)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Hi(o[yE]===1),this.upgrade=!0,2;if(r)return Hi(o[yE]===1),this.upgrade=!0,2;if(Hi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[pnt]){let f=this.keepAlive?yo.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[kps],o[Rps]);h<=0?s[ib]=!0:o[gnt]=h}else o[gnt]=o[Ips]}else s[ib]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[uke]&&(s[uke]=!1,o[aj]()),d?d5.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[d2][r[Cw]];if(Hi(c),Hi(this.timeoutType===hnt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Hi(o>=200),s>-1&&this.bytesRead+e.length>s)return yo.destroy(n,new Sps),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return d5.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;Hi(n>=100),Hi((this.headers.length&1)===0);let d=e[d2][e[Cw]];if(Hi(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 yo.destroy(r,new Eps),-1;if(d.onComplete(s),e[d2][e[Cw]++]=null,r[cj])return Hi(e[yE]===0),yo.destroy(r,new ofe("reset")),d5.ERROR.PAUSED;if(u){if(r[ib]&&e[yE]===0)return yo.destroy(r,new ofe("reset")),d5.ERROR.PAUSED;e[pnt]==null||e[pnt]===1?setImmediate(()=>e[aj]()):e[aj]()}else return yo.destroy(r,new ofe("reset")),d5.ERROR.PAUSED}}};function RNn(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===afe?(!e[cj]||e.writableNeedDrain||n[yE]>1)&&(Hi(!o,"cannot be paused while waiting for headers"),yo.destroy(e,new _ps)):r===hnt?o||yo.destroy(e,new Cps):r===VXt&&(Hi(n[yE]===0&&n[gnt]),yo.destroy(e,new ofe("socket idle timeout")))}a(RNn,"onParserTimeout");async function Qps(t,e){t[sfe]=e,jXt||(jXt=await $Xt,$Xt=null),e[cke]=!1,e[cj]=!1,e[ib]=!1,e[uke]=!1,e[dp]=new WXt(t,e,jXt),dnt(e,"error",function(n){Hi(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[dp];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[bw]=n,this[HXt][Ops](n)}),dnt(e,"readable",function(){let n=this[dp];n&&n.readMore()}),dnt(e,"end",function(){let n=this[dp];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}yo.destroy(this,new mnt("other side closed",yo.getSocketInfo(this)))}),dnt(e,"close",function(){let n=this[HXt],o=this[dp];o&&(!this[bw]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[dp].destroy(),this[dp]=null);let s=this[bw]||new mnt("closed",yo.getSocketInfo(this));if(n[sfe]=null,n[MNn]=null,n.destroyed){Hi(n[Tps]===0);let c=n[d2].splice(n[Cw]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[d2][n[Cw]];n[d2][n[Cw]++]=null,yo.errorRequest(n,c,s)}n[wps]=n[Cw],Hi(n[yE]===0),n.emit("disconnect",n[NNn],[n],s),n[aj]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return Hps(t,...n)},resume(){qps(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[cj]||e[ib]||e[uke]||n&&(t[yE]>0&&!n.idempotent||t[yE]>0&&(n.upgrade||n.method==="CONNECT")||t[yE]>0&&yo.bodyLength(n.body)!==0&&(yo.isStream(n.body)||yo.isAsyncIterable(n.body)||yo.isFormDataLike(n.body))))}}}a(Qps,"connectH1");function qps(t){let e=t[sfe];if(e&&!e.destroyed){if(t[xNn]===0?!e[cke]&&e.unref&&(e.unref(),e[cke]=!0):e[cke]&&e.ref&&(e.ref(),e[cke]=!1),t[xNn]===0)e[dp].timeoutType!==VXt&&e[dp].setTimeout(t[gnt],VXt);else if(t[yE]>0&&e[dp].statusCode<200&&e[dp].timeoutType!==afe){let r=t[d2][t[Cw]],n=r.headersTimeout!=null?r.headersTimeout:t[Pps];e[dp].setTimeout(n,afe)}}}a(qps,"resumeH1");function jps(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(jps,"shouldSendContentLength");function Hps(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(yo.isFormDataLike(u)){qXt||(qXt=ife().extractBody);let[E,_]=qXt(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else yo.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=yo.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),jps(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[GXt])return yo.errorRequest(t,e,new GJ),!1;process.emitWarning(new GJ)}let g=t[sfe],A=a(E=>{e.aborted||e.completed||(yo.errorRequest(t,e,E||new DNn),yo.destroy(u),yo.destroy(g,new ofe("aborted")))},"abort");try{e.onConnect(A)}catch(E){yo.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[ib]=!0),(s||r==="CONNECT")&&(g[ib]=!0),l!=null&&(g[ib]=l),t[wNn]&&g[Nps]++>=t[wNn]&&(g[ib]=!0),c&&(g[uke]=!0);let y=`${r} ${n} HTTP/1.1\r `;if(typeof o=="string"?y+=`host: ${o}\r -`:y+=t[Cps],s?y+=`connection: upgrade\r +`:y+=t[xps],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[unt]&&!g[ib]?y+=`connection: keep-alive\r +`:t[pnt]&&!g[ib]?y+=`connection: keep-alive\r `:y+=`connection: close\r `,Array.isArray(d))for(let E=0;E{e.removeListener("error",g)}),!u){let A=new PNn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Hi(o.destroyed||o[aj]&&r[yE]<=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")?Ao.destroy(e,A):Ao.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(Ups,"writeStream");function RNn(t,e,r,n,o,s,c,l){try{e?Ao.isBuffer(e)&&(Hi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return INn.sendHeaders.hasSubscribers&&INn.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?kNn(A,null,t,e,g,f,y,h):yo.isBuffer(u)?kNn(A,u,t,e,g,f,y,h):yo.isBlobLike(u)?typeof u.stream=="function"?PNn(A,u.stream(),t,e,g,f,y,h):$ps(A,u,t,e,g,f,y,h):yo.isStream(u)?Gps(A,u,t,e,g,f,y,h):yo.isIterable(u)?PNn(A,u,t,e,g,f,y,h):Hi(!1),!0}a(Hps,"writeH1");function Gps(t,e,r,n,o,s,c,l){Hi(s!==0||r[yE]===0,"stream body cannot be pipelined");let u=!1,d=new Ant({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){yo.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 DNn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Hi(o.destroyed||o[cj]&&r[yE]<=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")?yo.destroy(e,A):yo.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(Gps,"writeStream");function kNn(t,e,r,n,o,s,c,l){try{e?yo.isBuffer(e)&&(Hi(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[ib]=!0)):s===0?o.write(`${c}content-length: 0\r \r `,"latin1"):(Hi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[sj]()}catch(u){t(u)}}a(RNn,"writeBuffer");async function Qps(t,e,r,n,o,s,c,l){Hi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new GJ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r +`,"latin1")),n.onRequestSent(),r[aj]()}catch(u){t(u)}}a(kNn,"writeBuffer");async function $ps(t,e,r,n,o,s,c,l){Hi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new GJ;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[ib]=!0),r[sj]()}catch(u){t(u)}}a(Qps,"writeBlob");async function kNn(t,e,r,n,o,s,c,l){Hi(s!==0||r[yE]===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)=>{Hi(u===null),o[Cw]?g(o[Cw]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new hnt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[Cw])throw o[Cw];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(kNn,"writeIterable");var hnt=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[aj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[Cw])throw r[Cw];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[HXt])throw new GJ;process.emitWarning(new GJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[ib]=!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[ib]=!0),r[aj]()}catch(u){t(u)}}a($ps,"writeBlob");async function PNn(t,e,r,n,o,s,c,l){Hi(s!==0||r[yE]===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)=>{Hi(u===null),o[bw]?g(o[bw]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Ant({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[bw])throw o[bw];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(PNn,"writeIterable");var Ant=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[cj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[bw])throw r[bw];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[GXt])throw new GJ;process.emitWarning(new GJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[ib]=!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[dp].timeout&&r[dp].timeoutType===afe&&r[dp].timeout.refresh&&r[dp].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[aj]=!1,e[Cw])throw e[Cw];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[dp].timeout&&r[dp].timeoutType===afe&&r[dp].timeout.refresh&&r[dp].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[cj]=!1,e[bw])throw e[bw];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[HXt])throw new GJ;process.emitWarning(new GJ)}e[dp].timeout&&e[dp].timeoutType===afe&&e[dp].timeout.refresh&&e[dp].timeout.refresh(),n[sj]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[aj]=!1,e&&(Hi(n[yE]<=1,"pipeline should only contain this request"),o(e))}};MNn.exports=Ops});var HNn=I((EXd,jNn)=>{"use strict";p();var bw=require("node:assert"),{pipeline:qps}=require("node:stream"),fa=qs(),{RequestContentLengthMismatchError:WXt,RequestAbortedError:LNn,SocketError:dke,InformationalError:zXt}=Ec(),{kUrl:mnt,kReset:Ant,kClient:cfe,kRunning:ynt,kPending:jps,kQueue:cj,kPendingIdx:YXt,kRunningIdx:d2,kError:p2,kSocket:wg,kStrictContentLength:Hps,kOnError:KXt,kMaxConcurrentStreams:qNn,kHTTP2Session:f2,kResume:lj,kSize:Gps,kHTTPContext:$ps}=jd(),kF=Symbol("open streams"),BNn,FNn=!1,gnt;try{gnt=require("node:http2")}catch{gnt={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:Vps,HTTP2_HEADER_METHOD:Wps,HTTP2_HEADER_PATH:zps,HTTP2_HEADER_SCHEME:Yps,HTTP2_HEADER_CONTENT_LENGTH:Kps,HTTP2_HEADER_EXPECT:Jps,HTTP2_HEADER_STATUS:Zps}}=gnt;function Xps(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(Xps,"parseH2Headers");async function ehs(t,e){t[wg]=e,FNn||(FNn=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=gnt.connect(t[mnt],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[qNn]});r[kF]=0,r[cfe]=t,r[wg]=e,fa.addListener(r,"error",rhs),fa.addListener(r,"frameError",nhs),fa.addListener(r,"end",ihs),fa.addListener(r,"goaway",ohs),fa.addListener(r,"close",function(){let{[cfe]:o}=this,{[wg]:s}=o,c=this[wg][p2]||this[p2]||new dke("closed",fa.getSocketInfo(s));if(o[f2]=null,o.destroyed){bw(o[jps]===0);let l=o[cj].splice(o[d2]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return ahs(t,...o)},resume(){ths(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(ehs,"connectH2");function ths(t){let e=t[wg];e?.destroyed===!1&&(t[Gps]===0&&t[qNn]===0?(e.unref(),t[f2].unref()):(e.ref(),t[f2].ref()))}a(ths,"resumeH2");function rhs(t){bw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[wg][p2]=t,this[cfe][KXt](t)}a(rhs,"onHttp2SessionError");function nhs(t,e,r){if(r===0){let n=new zXt(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[wg][p2]=n,this[cfe][KXt](n)}}a(nhs,"onHttp2FrameError");function ihs(){let t=new dke("other side closed",fa.getSocketInfo(this[wg]));this.destroy(t),fa.destroy(this[wg],t)}a(ihs,"onHttp2SessionEnd");function ohs(t){let e=this[p2]||new dke(`HTTP/2: "GOAWAY" frame received with code ${t}`,fa.getSocketInfo(this)),r=this[cfe];if(r[wg]=null,r[$ps]=null,this[f2]!=null&&(this[f2].destroy(e),this[f2]=null),fa.destroy(this[wg],e),r[d2]{e.aborted||e.completed||(T=T||new LNn,fa.errorRequest(t,e,T),m!=null&&fa.destroy(m,T),fa.destroy(f,T),t[cj][t[d2]++]=null,t[lj]())},"abort");try{e.onConnect(y)}catch(T){fa.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[kF],t[cj][t[d2]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[kF],t[cj][t[d2]++]=null}),m.once("close",()=>{r[kF]-=1,r[kF]===0&&r.unref()}),!0;h[zps]=o,h[Yps]="https";let E=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let _=fa.bodyLength(f);if(fa.isFormDataLike(f)){BNn??=ife().extractBody;let[T,w]=BNn(f);h["content-type"]=w,f=T.stream,_=T.length}if(_==null&&(_=e.contentLength),(_===0||!E)&&(_=null),shs(n)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[Hps])return fa.errorRequest(t,e,new WXt),!1;process.emitWarning(new WXt)}_!=null&&(bw(f,"no body must not have content length"),h[Kps]=`${_}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[Jps]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",b)):(m=r.request(h,{endStream:v,signal:u}),b()),++r[kF],m.once("response",T=>{let{[Zps]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new LNn;fa.errorRequest(t,e,x),fa.destroy(m,x);return}e.onHeaders(Number(w),Xps(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[kF]===0&&r.unref(),y(new zXt("HTTP/2: stream half-closed (remote)")),t[cj][t[d2]++]=null,t[YXt]=t[d2],t[lj]()}),m.once("close",()=>{r[kF]-=1,r[kF]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new zXt(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function b(){!f||_===0?UNn(y,m,null,t,e,t[wg],_,E):fa.isBuffer(f)?UNn(y,m,f,t,e,t[wg],_,E):fa.isBlobLike(f)?typeof f.stream=="function"?QNn(y,m,f.stream(),t,e,t[wg],_,E):lhs(y,m,f,t,e,t[wg],_,E):fa.isStream(f)?chs(y,t[wg],E,m,f,t,e,_):fa.isIterable(f)?QNn(y,m,f,t,e,t[wg],_,E):bw(!1)}a(b,"writeBodyH2")}a(ahs,"writeH2");function UNn(t,e,r,n,o,s,c,l){try{r!=null&&fa.isBuffer(r)&&(bw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Ant]=!0),o.onRequestSent(),n[lj]()}catch(u){t(u)}}a(UNn,"writeBuffer");function chs(t,e,r,n,o,s,c,l){bw(l!==0||s[ynt]===0,"stream body cannot be pipelined");let u=qps(o,n,f=>{f?(fa.destroy(u,f),t(f)):(fa.removeAllListeners(u),c.onRequestSent(),r||(e[Ant]=!0),s[lj]())});fa.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(chs,"writeStream");async function lhs(t,e,r,n,o,s,c,l){bw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new WXt;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Ant]=!0),n[lj]()}catch(u){t(u)}}a(lhs,"writeBlob");async function QNn(t,e,r,n,o,s,c,l){bw(c!==0||n[ynt]===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)=>{bw(u===null),s[p2]?m(s[p2]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[p2])throw s[p2];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Ant]=!0),n[lj]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(QNn,"writeIterable");jNn.exports=ehs});var _nt=I((CXd,VNn)=>{"use strict";p();var h5=qs(),{kBodyUsed:fke}=jd(),ZXt=require("node:assert"),{InvalidArgumentError:uhs}=Ec(),dhs=require("node:events"),fhs=[300,301,302,303,307,308],GNn=Symbol("body"),Ent=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[GNn]=e,this[fke]=!1}async*[Symbol.asyncIterator](){ZXt(!this[fke],"disturbed"),this[fke]=!0,yield*this[GNn]}},JXt=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new uhs("maxRedirections must be a positive number");h5.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,h5.isStream(this.opts.body)?(h5.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){ZXt(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[fke]=!1,dhs.prototype.on.call(this.opts.body,"data",function(){this[fke]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Ent(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&h5.isIterable(this.opts.body)&&(this.opts.body=new Ent(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||h5.isDisturbed(this.opts.body)?null:phs(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}=h5.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=hhs(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 phs(t,e){if(fhs.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var mhs=_nt();function ghs({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new mhs(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(ghs,"createRedirectInterceptor");WNn.exports=ghs});var dfe=I((wXd,nMn)=>{"use strict";p();var PF=require("node:assert"),XNn=require("node:net"),Ahs=require("node:http"),$J=qs(),{channels:lfe}=$de(),yhs=cDn(),Ehs=Yde(),{InvalidArgumentError:sh,InformationalError:_hs,ClientDestroyedError:vhs}=Ec(),Chs=XRe(),{kUrl:m5,kServerName:uj,kClient:bhs,kBusy:XXt,kConnect:Shs,kResuming:VJ,kRunning:Ake,kPending:yke,kSize:gke,kQueue:h2,kConnected:Ths,kConnecting:ufe,kNeedDrain:fj,kKeepAliveDefaultTimeout:zNn,kHostHeader:Ihs,kPendingIdx:m2,kRunningIdx:DF,kError:xhs,kPipelining:Cnt,kKeepAliveTimeoutValue:whs,kMaxHeadersSize:Rhs,kKeepAliveMaxTimeout:khs,kKeepAliveTimeoutThreshold:Phs,kHeadersTimeout:Dhs,kBodyTimeout:Nhs,kStrictContentLength:Mhs,kConnector:pke,kMaxRedirections:Ohs,kMaxRequests:eer,kCounter:Lhs,kClose:Bhs,kDestroy:Fhs,kDispatch:Uhs,kInterceptors:YNn,kLocalAddress:hke,kMaxResponseSize:Qhs,kOnError:qhs,kHTTPContext:ah,kMaxConcurrentStreams:jhs,kResume:mke}=jd(),Hhs=ONn(),Ghs=HNn(),KNn=!1,dj=Symbol("kClosedResolve"),JNn=a(()=>{},"noop");function eMn(t){return t[Cnt]??t[ah]?.defaultPipelining??1}a(eMn,"getPipelining");var ter=class extends Ehs{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:E,tls:_,strictContentLength:v,maxCachedSessions:b,maxRedirections:T,connect:w,maxRequestsPerClient:R,localAddress:x,maxResponseSize:P,autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N,maxConcurrentStreams:L,allowH2:B}={}){if(super(),f!==void 0)throw new sh("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new sh("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new sh("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new sh("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new sh("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new sh("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new sh("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new sh("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new sh("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new sh("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new sh("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new sh("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new sh("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new sh("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new sh("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new sh("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||XNn.isIP(x)===0))throw new sh("localAddress must be valid string IP address");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new sh("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new sh("autoSelectFamilyAttemptTimeout must be a positive number");if(B!=null&&typeof B!="boolean")throw new sh("allowH2 must be a valid boolean value");if(L!=null&&(typeof L!="number"||L<1))throw new sh("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=Chs({..._,maxCachedSessions:b,allowH2:B,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[YNn]=r.Client,KNn||(KNn=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[YNn]=[$hs({maxRedirections:T})],this[m5]=$J.parseOrigin(e),this[pke]=w,this[Cnt]=E??1,this[Rhs]=n||Ahs.maxHeaderSize,this[zNn]=h??4e3,this[khs]=g??6e5,this[Phs]=A??2e3,this[whs]=this[zNn],this[uj]=null,this[hke]=x??null,this[VJ]=0,this[fj]=0,this[Ihs]=`host: ${this[m5].hostname}${this[m5].port?`:${this[m5].port}`:""}\r -`,this[Nhs]=u??3e5,this[Dhs]=o??3e5,this[Mhs]=v??!0,this[Ohs]=T,this[eer]=R,this[dj]=null,this[Qhs]=P>-1?P:-1,this[jhs]=L??100,this[ah]=null,this[h2]=[],this[DF]=0,this[m2]=0,this[mke]=q=>rer(this,q),this[qhs]=q=>tMn(this,q)}get pipelining(){return this[Cnt]}set pipelining(e){this[Cnt]=e,this[mke](!0)}get[yke](){return this[h2].length-this[m2]}get[Ake](){return this[m2]-this[DF]}get[gke](){return this[h2].length-this[DF]}get[Ths](){return!!this[ah]&&!this[ufe]&&!this[ah].destroyed}get[XXt](){return!!(this[ah]?.busy(null)||this[gke]>=(eMn(this)||1)||this[yke]>0)}[Shs](e){rMn(this),this.once("connect",e)}[Uhs](e,r){let n=e.origin||this[m5].origin,o=new yhs(n,e,r);return this[h2].push(o),this[VJ]||($J.bodyLength(o.body)==null&&$J.isIterable(o.body)?(this[VJ]=1,queueMicrotask(()=>rer(this))):this[mke](!0)),this[VJ]&&this[fj]!==2&&this[XXt]&&(this[fj]=2),this[fj]<2}async[Bhs](){return new Promise(e=>{this[gke]?this[dj]=e:e(null)})}async[Fhs](e){return new Promise(r=>{let n=this[h2].splice(this[m2]);for(let s=0;s{this[dj]&&(this[dj](),this[dj]=null),r(null)},"callback");this[ah]?(this[ah].destroy(e,o),this[ah]=null):queueMicrotask(o),this[mke]()})}},$hs=vnt();function tMn(t,e){if(t[Ake]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){PF(t[m2]===t[DF]);let r=t[h2].splice(t[DF]);for(let n=0;n{t[pke]({host:e,hostname:r,protocol:n,port:o,servername:t[uj],localAddress:t[hke]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){$J.destroy(s.on("error",JNn),new vhs);return}PF(s);try{t[ah]=s.alpnProtocol==="h2"?await Ghs(t,s):await Hhs(t,s)}catch(c){throw s.destroy().on("error",JNn),c}t[ufe]=!1,s[Lhs]=0,s[eer]=t[eer],s[bhs]=t,s[xhs]=null,lfe.connected.hasSubscribers&&lfe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ah]?.version,servername:t[uj],localAddress:t[hke]},connector:t[pke],socket:s}),t.emit("connect",t[m5],[t])}catch(s){if(t.destroyed)return;if(t[ufe]=!1,lfe.connectError.hasSubscribers&&lfe.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ah]?.version,servername:t[uj],localAddress:t[hke]},connector:t[pke],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(PF(t[Ake]===0);t[yke]>0&&t[h2][t[m2]].servername===t[uj];){let c=t[h2][t[m2]++];$J.errorRequest(t,c,s)}else tMn(t,s);t.emit("connectionError",t[m5],[t],s)}t[mke]()}a(rMn,"connect");function ZNn(t){t[fj]=0,t.emit("drain",t[m5],[t])}a(ZNn,"emitDrain");function rer(t,e){t[VJ]!==2&&(t[VJ]=2,Vhs(t,e),t[VJ]=0,t[DF]>256&&(t[h2].splice(0,t[DF]),t[m2]-=t[DF],t[DF]=0))}a(rer,"resume");function Vhs(t,e){for(;;){if(t.destroyed){PF(t[yke]===0);return}if(t[dj]&&!t[gke]){t[dj](),t[dj]=null;return}if(t[ah]&&t[ah].resume(),t[XXt])t[fj]=2;else if(t[fj]===2){e?(t[fj]=1,queueMicrotask(()=>ZNn(t))):ZNn(t);continue}if(t[yke]===0||t[Ake]>=(eMn(t)||1))return;let r=t[h2][t[m2]];if(t[m5].protocol==="https:"&&t[uj]!==r.servername){if(t[Ake]>0)return;t[uj]=r.servername,t[ah]?.destroy(new _hs("servername changed"),()=>{t[ah]=null,rer(t)})}if(t[ufe])return;if(!t[ah]){rMn(t);return}if(t[ah].destroyed||t[ah].busy(r))return;!r.aborted&&t[ah].write(r)?t[m2]++:t[h2].splice(t[m2],1)}}a(Vhs,"_resume");nMn.exports=ter});var ner=I((DXd,iMn)=>{"use strict";p();var bnt=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)}};iMn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new bnt}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new bnt),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var sMn=I((OXd,oMn)=>{p();var{kFree:Whs,kConnected:zhs,kPending:Yhs,kQueued:Khs,kRunning:Jhs,kSize:Zhs}=jd(),WJ=Symbol("pool"),ier=class{static{a(this,"PoolStats")}constructor(e){this[WJ]=e}get connected(){return this[WJ][zhs]}get free(){return this[WJ][Whs]}get pending(){return this[WJ][Yhs]}get queued(){return this[WJ][Khs]}get running(){return this[WJ][Jhs]}get size(){return this[WJ][Zhs]}};oMn.exports=ier});var uer=I((FXd,gMn)=>{"use strict";p();var Xhs=Yde(),ems=ner(),{kConnected:oer,kSize:aMn,kRunning:cMn,kPending:lMn,kQueued:Eke,kBusy:tms,kFree:rms,kUrl:nms,kClose:ims,kDestroy:oms,kDispatch:sms}=jd(),ams=sMn(),ob=Symbol("clients"),iv=Symbol("needDrain"),_ke=Symbol("queue"),ser=Symbol("closed resolve"),aer=Symbol("onDrain"),uMn=Symbol("onConnect"),dMn=Symbol("onDisconnect"),fMn=Symbol("onConnectionError"),cer=Symbol("get dispatcher"),hMn=Symbol("add client"),mMn=Symbol("remove client"),pMn=Symbol("stats"),ler=class extends Xhs{static{a(this,"PoolBase")}constructor(){super(),this[_ke]=new ems,this[ob]=[],this[Eke]=0;let e=this;this[aer]=a(function(n,o){let s=e[_ke],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[Eke]--,c=!this.dispatch(l.opts,l.handler)}this[iv]=c,!this[iv]&&e[iv]&&(e[iv]=!1,e.emit("drain",n,[e,...o])),e[ser]&&s.isEmpty()&&Promise.all(e[ob].map(l=>l.close())).then(e[ser])},"onDrain"),this[uMn]=(r,n)=>{e.emit("connect",r,[e,...n])},this[dMn]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[fMn]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[pMn]=new ams(this)}get[tms](){return this[iv]}get[oer](){return this[ob].filter(e=>e[oer]).length}get[rms](){return this[ob].filter(e=>e[oer]&&!e[iv]).length}get[lMn](){let e=this[Eke];for(let{[lMn]:r}of this[ob])e+=r;return e}get[cMn](){let e=0;for(let{[cMn]:r}of this[ob])e+=r;return e}get[aMn](){let e=this[Eke];for(let{[aMn]:r}of this[ob])e+=r;return e}get stats(){return this[pMn]}async[ims](){this[_ke].isEmpty()?await Promise.all(this[ob].map(e=>e.close())):await new Promise(e=>{this[ser]=e})}async[oms](e){for(;;){let r=this[_ke].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[ob].map(r=>r.destroy(e)))}[sms](e,r){let n=this[cer]();return n?n.dispatch(e,r)||(n[iv]=!0,this[iv]=!this[cer]()):(this[iv]=!0,this[_ke].push({opts:e,handler:r}),this[Eke]++),!this[iv]}[hMn](e){return e.on("drain",this[aer]).on("connect",this[uMn]).on("disconnect",this[dMn]).on("connectionError",this[fMn]),this[ob].push(e),this[iv]&&queueMicrotask(()=>{this[iv]&&this[aer](e[nms],[this,e])}),this}[mMn](e){e.close(()=>{let r=this[ob].indexOf(e);r!==-1&&this[ob].splice(r,1)}),this[iv]=this[ob].some(r=>!r[iv]&&r.closed!==!0&&r.destroyed!==!0)}};gMn.exports={PoolBase:ler,kClients:ob,kNeedDrain:iv,kAddClient:hMn,kRemoveClient:mMn,kGetDispatcher:cer}});var ffe=I((qXd,_Mn)=>{"use strict";p();var{PoolBase:cms,kClients:Snt,kNeedDrain:lms,kAddClient:ums,kGetDispatcher:dms}=uer(),fms=dfe(),{InvalidArgumentError:der}=Ec(),AMn=qs(),{kUrl:yMn,kInterceptors:pms}=jd(),hms=XRe(),fer=Symbol("options"),per=Symbol("connections"),EMn=Symbol("factory");function mms(t,e){return new fms(t,e)}a(mms,"defaultFactory");var her=class extends cms{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=mms,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 der("invalid connections");if(typeof n!="function")throw new der("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new der("connect must be a function or an object");typeof o!="function"&&(o=hms({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[pms]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[per]=r||null,this[yMn]=AMn.parseOrigin(e),this[fer]={...AMn.deepClone(m),connect:o,allowH2:h},this[fer].interceptors=m.interceptors?{...m.interceptors}:void 0,this[EMn]=n,this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[Snt].indexOf(E);_!==-1&&this[Snt].splice(_,1)}})}[dms](){for(let e of this[Snt])if(!e[lms])return e;if(!this[per]||this[Snt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:gms,InvalidArgumentError:Ams}=Ec(),{PoolBase:yms,kClients:EE,kNeedDrain:vke,kAddClient:Ems,kRemoveClient:_ms,kGetDispatcher:vms}=uer(),Cms=ffe(),{kUrl:mer,kInterceptors:bms}=jd(),{parseOrigin:vMn}=qs(),CMn=Symbol("factory"),Tnt=Symbol("options"),bMn=Symbol("kGreatestCommonDivisor"),zJ=Symbol("kCurrentWeight"),YJ=Symbol("kIndex"),Sw=Symbol("kWeight"),Int=Symbol("kMaxWeightPerServer"),xnt=Symbol("kErrorPenalty");function Sms(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Sms,"getGreatestCommonDivisor");function Tms(t,e){return new Cms(t,e)}a(Tms,"defaultFactory");var ger=class extends yms{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Tms,...n}={}){if(super(),this[Tnt]=n,this[YJ]=-1,this[zJ]=0,this[Int]=this[Tnt].maxWeightPerServer||100,this[xnt]=this[Tnt].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new Ams("factory must be a function.");this[bms]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[CMn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=vMn(e).origin;if(this[EE].find(o=>o[mer].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[CMn](r,Object.assign({},this[Tnt]));this[Ems](n),n.on("connect",()=>{n[Sw]=Math.min(this[Int],n[Sw]+this[xnt])}),n.on("connectionError",()=>{n[Sw]=Math.max(1,n[Sw]-this[xnt]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Sw]=Math.max(1,n[Sw]-this[xnt]),this._updateBalancedPoolStats())});for(let o of this[EE])o[Sw]=this[Int];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[mer].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[_ms](n),this}get upstreams(){return this[EE].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[mer].origin)}[vms](){if(this[EE].length===0)throw new gms;if(!this[EE].find(s=>!s[vke]&&s.closed!==!0&&s.destroyed!==!0)||this[EE].map(s=>s[vke]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[EE].findIndex(s=>!s[vke]);for(;n++this[EE][o][Sw]&&!s[vke]&&(o=this[YJ]),this[YJ]===0&&(this[zJ]=this[zJ]-this[bMn],this[zJ]<=0&&(this[zJ]=this[Int])),s[Sw]>=this[zJ]&&!s[vke])return s}return this[zJ]=this[EE][o][Sw],this[YJ]=o,this[EE][o]}};SMn.exports=ger});var pfe=I((WXd,DMn)=>{"use strict";p();var{InvalidArgumentError:wnt}=Ec(),{kClients:pj,kRunning:IMn,kClose:Ims,kDestroy:xms,kDispatch:wms,kInterceptors:Rms}=jd(),kms=Yde(),Pms=ffe(),Dms=dfe(),Nms=qs(),Mms=vnt(),xMn=Symbol("onConnect"),wMn=Symbol("onDisconnect"),RMn=Symbol("onConnectionError"),Oms=Symbol("maxRedirections"),kMn=Symbol("onDrain"),PMn=Symbol("factory"),Aer=Symbol("options");function Lms(t,e){return e&&e.connections===1?new Dms(t,e):new Pms(t,e)}a(Lms,"defaultFactory");var yer=class extends kms{static{a(this,"Agent")}constructor({factory:e=Lms,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new wnt("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new wnt("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new wnt("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[Rms]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[Mms({maxRedirections:r})],this[Aer]={...Nms.deepClone(o),connect:n},this[Aer].interceptors=o.interceptors?{...o.interceptors}:void 0,this[Oms]=r,this[PMn]=e,this[pj]=new Map,this[kMn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[xMn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[wMn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[RMn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[IMn](){let e=0;for(let r of this[pj].values())e+=r[IMn];return e}[wms](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new wnt("opts.origin must be a non-empty string or URL.");let o=this[pj].get(n);return o||(o=this[PMn](e.origin,this[Aer]).on("drain",this[kMn]).on("connect",this[xMn]).on("disconnect",this[wMn]).on("connectionError",this[RMn]),this[pj].set(n,o)),o.dispatch(e,r)}async[Ims](){let e=[];for(let r of this[pj].values())e.push(r.close());this[pj].clear(),await Promise.all(e)}async[xms](e){let r=[];for(let n of this[pj].values())r.push(n.destroy(e));this[pj].clear(),await Promise.all(r)}};DMn.exports=yer});var ber=I((KXd,HMn)=>{"use strict";p();var{kProxy:Eer,kClose:FMn,kDestroy:UMn,kDispatch:NMn,kInterceptors:Bms}=jd(),{URL:KJ}=require("node:url"),Fms=pfe(),QMn=ffe(),qMn=Yde(),{InvalidArgumentError:hfe,RequestAbortedError:Ums,SecureProxyConnectionError:Qms}=Ec(),MMn=XRe(),jMn=dfe(),Rnt=Symbol("proxy agent"),knt=Symbol("proxy client"),hj=Symbol("proxy headers"),_er=Symbol("request tls settings"),OMn=Symbol("proxy tls settings"),LMn=Symbol("connect endpoint function"),BMn=Symbol("tunnel proxy");function qms(t){return t==="https:"?443:80}a(qms,"defaultProtocolPort");function jms(t,e){return new QMn(t,e)}a(jms,"defaultFactory");var Hms=a(()=>{},"noop");function Gms(t,e){return e.connections===1?new jMn(t,e):new QMn(t,e)}a(Gms,"defaultAgentFactory");var ver=class extends qMn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new hfe("Proxy URL is mandatory");this[hj]=r,o?this.#e=o(e,{connect:n}):this.#e=new jMn(e,{connect:n})}[NMn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new hfe("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 KJ(o);c.host=l}return e.headers={...this[hj],...c},this.#e[NMn](e,r)}async[FMn](){return this.#e.close()}async[UMn](e){return this.#e.destroy(e)}},Cer=class extends qMn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof KJ)&&!e.uri)throw new hfe("Proxy uri is mandatory");let{clientFactory:r=jms}=e;if(typeof r!="function")throw new hfe("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[Eer]={uri:s,protocol:u},this[Bms]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[_er]=e.requestTls,this[OMn]=e.proxyTls,this[hj]=e.headers||{},this[BMn]=n,e.auth&&e.token)throw new hfe("opts.auth cannot be used in combination with opts.token");e.auth?this[hj]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[hj]["proxy-authorization"]=e.token:d&&f&&(this[hj]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=MMn({...e.proxyTls});this[LMn]=MMn({...e.requestTls});let g=e.factory||Gms,A=a((y,E)=>{let{protocol:_}=new KJ(y);return!this[BMn]&&_==="http:"&&this[Eer].protocol==="http:"?new ver(this[Eer].uri,{headers:this[hj],connect:m,factory:g}):g(y,E)},"factory");this[knt]=r(o,{connect:m}),this[Rnt]=new Fms({...e,factory:A,connect:a(async(y,E)=>{let _=y.host;y.port||(_+=`:${qms(y.protocol)}`);try{let{socket:v,statusCode:b}=await this[knt].connect({origin:c,port:l,path:_,signal:y.signal,headers:{...this[hj],host:y.host},servername:this[OMn]?.servername||h});if(b!==200&&(v.on("error",Hms).destroy(),E(new Ums(`Proxy response (${b}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){E(null,v);return}let T;this[_er]?T=this[_er].servername:T=y.servername,this[LMn]({...y,servername:T,httpSocket:v},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new Qms(v)):E(v)}},"connect")})}dispatch(e,r){let n=$ms(e.headers);if(Vms(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new KJ(e.origin);n.host=o}return this[Rnt].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new KJ(e):e instanceof KJ?e:new KJ(e.uri)}async[FMn](){await this[Rnt].close(),await this[knt].close()}async[UMn](){await this[Rnt].destroy(),await this[knt].destroy()}};function $ms(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new hfe("Proxy-Authorization should be sent in ProxyAgent constructor")}a(Vms,"throwIfProxyAuthIsSent");HMn.exports=Cer});var YMn=I((XXd,zMn)=>{"use strict";p();var Wms=Yde(),{kClose:zms,kDestroy:Yms,kClosed:GMn,kDestroyed:$Mn,kDispatch:Kms,kNoProxyAgent:Cke,kHttpProxyAgent:mj,kHttpsProxyAgent:JJ}=jd(),VMn=ber(),Jms=pfe(),Zms={"http:":80,"https:":443},WMn=!1,Ser=class extends Wms{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,WMn||(WMn=!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[Cke]=new Jms(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[mj]=new VMn({...s,uri:c}):this[mj]=this[Cke];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[JJ]=new VMn({...s,uri:l}):this[JJ]=this[mj],this.#o()}[Kms](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[zms](){await this[Cke].close(),this[mj][GMn]||await this[mj].close(),this[JJ][GMn]||await this[JJ].close()}async[Yms](e){await this[Cke].destroy(e),this[mj][$Mn]||await this[mj].destroy(e),this[JJ][$Mn]||await this[JJ].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||Zms[r]||0,this.#i(n,o)?r==="https:"?this[JJ]:this[mj]:this[Cke]}#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 mfe=require("node:assert"),{kRetryHandlerDefaultRetry:KMn}=jd(),{RequestRetryError:bke}=Ec(),{isDisturbed:JMn,parseHeaders:Xms,parseRangeHeader:ZMn,wrapRequestBody:e0s}=qs();function t0s(t){let e=Date.now();return new Date(t).getTime()-e}a(t0s,"calculateRetryAfterHeader");var Ter=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:e0s(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[KMn],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[KMn](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:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?t0s(v):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onHeaders(e,r,n,o){let s=Xms(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new bke("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 bke("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=ZMn(s["content-range"]);if(!l)return this.abort(new bke("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new bke("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return mfe(this.start===u,"content-range mismatch"),mfe(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=ZMn(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;mfe(u!=null&&Number.isFinite(u),"content-range mismatch"),mfe(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 mfe(Number.isFinite(this.start)),mfe(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 bke("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||JMn(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||JMn(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")}};XMn.exports=Ter});var tOn=I((oef,eOn)=>{"use strict";p();var r0s=JRe(),n0s=Pnt(),Ier=class extends r0s{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 n0s({...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()}};eOn.exports=Ier});var Der=I((cef,uOn)=>{"use strict";p();var sOn=require("node:assert"),{Readable:i0s}=require("node:stream"),{RequestAbortedError:aOn,NotSupportedError:o0s,InvalidArgumentError:s0s,AbortError:xer}=Ec(),cOn=qs(),{ReadableStreamFrom:a0s}=qs(),aT=Symbol("kConsume"),Ske=Symbol("kReading"),gj=Symbol("kBody"),rOn=Symbol("kAbort"),lOn=Symbol("kContentType"),nOn=Symbol("kContentLength"),c0s=a(()=>{},"noop"),wer=class extends i0s{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[rOn]=r,this[aT]=null,this[gj]=null,this[lOn]=n,this[nOn]=o,this[Ske]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new aOn),e&&this[rOn](),super.destroy(e)}_destroy(e,r){this[Ske]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[Ske]=!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[Ske]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[aT]&&e!==null?(ker(this[aT],e),this[Ske]?super.push(e):!0):super.push(e)}async text(){return Tke(this,"text")}async json(){return Tke(this,"json")}async blob(){return Tke(this,"blob")}async bytes(){return Tke(this,"bytes")}async arrayBuffer(){return Tke(this,"arrayBuffer")}async formData(){throw new o0s}get bodyUsed(){return cOn.isDisturbed(this)}get body(){return this[gj]||(this[gj]=a0s(this),this[aT]&&(this[gj].getReader(),sOn(this[gj].locked))),this[gj]}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 s0s("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[nOn]>r&&this.destroy(new xer);let c=a(()=>{this.destroy(n.reason??new xer)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new xer):o(null)}).on("error",c0s).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function l0s(t){return t[gj]&&t[gj].locked===!0||t[aT]}a(l0s,"isLocked");function u0s(t){return cOn.isDisturbed(t)||l0s(t)}a(u0s,"isUnusable");async function Tke(t,e){return sOn(!t[aT]),new Promise((r,n)=>{if(u0s(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[aT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){Per(this[aT],o)}).on("close",function(){this[aT].body!==null&&Per(this[aT],new aOn)}),d0s(t[aT])})})}a(Tke,"consume");function d0s(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(Rer,"chunksDecode");function iOn(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 f0s=require("node:assert"),{ResponseStatusCodeError:dOn}=Ec(),{chunksDecode:fOn}=Der(),p0s=128*1024;async function h0s({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){f0s(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>p0s){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new dOn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{pOn(r)?f=JSON.parse(fOn(c,l)):hOn(r)&&(f=fOn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new dOn(u,n,s,f)))}a(h0s,"getResolveErrorBodyCallback");var pOn=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"),hOn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");mOn.exports={getResolveErrorBodyCallback:h0s,isContentTypeApplicationJson:pOn,isContentTypeText:hOn}});var yOn=I((hef,Mer)=>{"use strict";p();var m0s=require("node:assert"),{Readable:g0s}=Der(),{InvalidArgumentError:gfe,RequestAbortedError:gOn}=Ec(),cT=qs(),{getResolveErrorBodyCallback:A0s}=Ner(),{AsyncResource:y0s}=require("node:async_hooks"),Dnt=class extends y0s{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new gfe("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 gfe("invalid callback");if(f&&(typeof f!="number"||f<0))throw new gfe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new gfe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new gfe("invalid method");if(l&&typeof l!="function")throw new gfe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw cT.isStream(c)&&cT.destroy(c.on("error",cT.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,cT.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new gOn:this.removeAbortListener=cT.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new gOn,this.res?cT.destroy(this.res.on("error",cT.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}m0s(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"?cT.parseRawHeaders(r):cT.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?cT.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new g0s({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(A0s,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){cT.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(()=>{cT.destroy(r,e)})),o&&(this.body=null,cT.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function AOn(t,e){if(e===void 0)return new Promise((r,n)=>{AOn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new Dnt(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(AOn,"request");Mer.exports=AOn;Mer.exports.RequestHandler=Dnt});var Ike=I((Aef,vOn)=>{p();var{addAbortListener:E0s}=qs(),{RequestAbortedError:_0s}=Ec(),Afe=Symbol("kListener"),g5=Symbol("kSignal");function EOn(t){t.abort?t.abort(t[g5]?.reason):t.reason=t[g5]?.reason??new _0s,_On(t)}a(EOn,"abort");function v0s(t,e){if(t.reason=null,t[g5]=null,t[Afe]=null,!!e){if(e.aborted){EOn(t);return}t[g5]=e,t[Afe]=()=>{EOn(t)},E0s(t[g5],t[Afe])}}a(v0s,"addSignal");function _On(t){t[g5]&&("removeEventListener"in t[g5]?t[g5].removeEventListener("abort",t[Afe]):t[g5].removeListener("abort",t[Afe]),t[g5]=null,t[Afe]=null)}a(_On,"removeSignal");vOn.exports={addSignal:v0s,removeSignal:_On}});var TOn=I((_ef,SOn)=>{"use strict";p();var C0s=require("node:assert"),{finished:b0s,PassThrough:S0s}=require("node:stream"),{InvalidArgumentError:yfe,InvalidReturnValueError:T0s}=Ec(),g2=qs(),{getResolveErrorBodyCallback:I0s}=Ner(),{AsyncResource:x0s}=require("node:async_hooks"),{addSignal:w0s,removeSignal:COn}=Ike(),Oer=class extends x0s{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new yfe("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 yfe("invalid callback");if(typeof r!="function")throw new yfe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new yfe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new yfe("invalid method");if(u&&typeof u!="function")throw new yfe("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw g2.isStream(l)&&g2.destroy(l.on("error",g2.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,g2.isStream(l)&&l.on("error",h=>{this.onError(h)}),w0s(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}C0s(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"?g2.parseRawHeaders(r):g2.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"?g2.parseHeaders(r):f)["content-type"];h=new S0s,this.callback=null,this.runInAsyncScope(I0s,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 T0s("expected Writable");b0s(h,{readable:!1},g=>{let{callback:A,res:y,opaque:E,trailers:_,abort:v}=this;this.res=null,(g||!y.readable)&&g2.destroy(y,g),this.callback=null,this.runInAsyncScope(A,null,g||null,{opaque:E,trailers:_}),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;COn(this),r&&(this.trailers=g2.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;COn(this),this.factory=null,r?(this.res=null,g2.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,g2.destroy(s,e))}};function bOn(t,e,r){if(r===void 0)return new Promise((n,o)=>{bOn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new Oer(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(bOn,"stream");SOn.exports=bOn});var ROn=I((bef,wOn)=>{"use strict";p();var{Readable:xOn,Duplex:R0s,PassThrough:k0s}=require("node:stream"),{InvalidArgumentError:xke,InvalidReturnValueError:P0s,RequestAbortedError:Ler}=Ec(),Tw=qs(),{AsyncResource:D0s}=require("node:async_hooks"),{addSignal:N0s,removeSignal:M0s}=Ike(),IOn=require("node:assert"),Efe=Symbol("resume"),Ber=class extends xOn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Efe]=null}_read(){let{[Efe]:e}=this;e&&(this[Efe]=null,e())}_destroy(e,r){this._read(),r(e)}},Fer=class extends xOn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Efe]=e}_read(){this[Efe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new Ler),r(e)}},Uer=class extends D0s{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new xke("invalid opts");if(typeof r!="function")throw new xke("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 xke("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new xke("invalid method");if(c&&typeof c!="function")throw new xke("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 Ber().on("error",Tw.nop),this.ret=new R0s({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[Efe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new Ler),A&&u&&A(),Tw.destroy(f,u),Tw.destroy(h,u),Tw.destroy(m,u),M0s(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,N0s(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}IOn(!o,"pipeline cannot be retried"),IOn(!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"?Tw.parseRawHeaders(r):Tw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Fer(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?Tw.parseRawHeaders(r):Tw.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",Tw.nop),u}if(!l||typeof l.on!="function")throw new P0s("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;Tw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||Tw.destroy(u,new Ler)}),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,Tw.destroy(r,e)}};function O0s(t,e){try{let r=new Uer(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new k0s().destroy(r)}}a(O0s,"pipeline");wOn.exports=O0s});var OOn=I((Ief,MOn)=>{"use strict";p();var{InvalidArgumentError:Qer,SocketError:L0s}=Ec(),{AsyncResource:B0s}=require("node:async_hooks"),kOn=qs(),{addSignal:F0s,removeSignal:POn}=Ike(),DOn=require("node:assert"),qer=class extends B0s{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Qer("invalid opts");if(typeof r!="function")throw new Qer("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Qer("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,F0s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}DOn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new L0s("bad upgrade",null)}onUpgrade(e,r,n){DOn(e===101);let{callback:o,opaque:s,context:c}=this;POn(this),this.callback=null;let l=this.responseHeaders==="raw"?kOn.parseRawHeaders(r):kOn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;POn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function NOn(t,e){if(e===void 0)return new Promise((r,n)=>{NOn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new qer(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(NOn,"upgrade");MOn.exports=NOn});var QOn=I((Ref,UOn)=>{"use strict";p();var U0s=require("node:assert"),{AsyncResource:Q0s}=require("node:async_hooks"),{InvalidArgumentError:jer,SocketError:q0s}=Ec(),LOn=qs(),{addSignal:j0s,removeSignal:BOn}=Ike(),Her=class extends Q0s{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new jer("invalid opts");if(typeof r!="function")throw new jer("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new jer("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,j0s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}U0s(this.callback),this.abort=e,this.context=r}onHeaders(){throw new q0s("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;BOn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?LOn.parseRawHeaders(r):LOn.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;BOn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function FOn(t,e){if(e===void 0)return new Promise((r,n)=>{FOn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Her(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(FOn,"connect");UOn.exports=FOn});var qOn=I((Def,_fe)=>{"use strict";p();_fe.exports.request=yOn();_fe.exports.stream=TOn();_fe.exports.pipeline=ROn();_fe.exports.upgrade=OOn();_fe.exports.connect=QOn()});var $er=I((Mef,HOn)=>{"use strict";p();var{UndiciError:H0s}=Ec(),jOn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),Ger=class t extends H0s{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[jOn]===!0}[jOn]=!0};HOn.exports={MockNotMatchedError:Ger}});var vfe=I((Bef,GOn)=>{"use strict";p();GOn.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 wke=I((Uef,t5n)=>{"use strict";p();var{MockNotMatchedError:ZJ}=$er(),{kDispatches:Nnt,kMockAgent:G0s,kOriginalDispatch:$0s,kOrigin:V0s,kGetNetConnect:W0s}=vfe(),{buildURL:z0s}=qs(),{STATUS_CODES:Y0s}=require("node:http"),{types:{isPromise:K0s}}=require("node:util");function NF(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(NF,"matchValue");function VOn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(VOn,"lowerCaseEntries");function WOn(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=WOn(e,r);if(!NF(n,o))return!1}return!0}a(zOn,"matchHeaders");function $On(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($On,"safeUrl");function J0s(t,{path:e,method:r,body:n,headers:o}){let s=NF(t.path,e),c=NF(t.method,r),l=typeof t.body<"u"?NF(t.body,n):!0,u=zOn(t,o);return s&&c&&l&&u}a(J0s,"matchKey");function YOn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(YOn,"getResponseData");function KOn(t,e){let r=e.query?z0s(e.path,e.query):e.path,n=typeof r=="string"?$On(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>NF($On(s),n));if(o.length===0)throw new ZJ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>NF(s,e.method)),o.length===0)throw new ZJ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?NF(s,e.body):!0),o.length===0)throw new ZJ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>zOn(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new ZJ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(KOn,"getMockDispatch");function Z0s(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(Z0s,"addMockDispatch");function Ver(t,e){let r=t.findIndex(n=>n.consumed?J0s(n,e):!1);r!==-1&&t.splice(r,1)}a(Ver,"deleteMockDispatch");function JOn(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(JOn,"buildKey");function Wer(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[Nnt])},d):g(this[Nnt]);function g(y,E=s){let _=Array.isArray(t.headers)?zer(t.headers):t.headers,v=typeof E=="function"?E({...t,headers:_}):E;if(K0s(v)){v.then(R=>g(y,R));return}let b=YOn(v),T=Wer(c),w=Wer(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,ZOn(o)),e.onData?.(Buffer.from(b)),e.onComplete?.(w),Ver(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(XOn,"mockDispatch");function egs(){let t=this[G0s],e=this[V0s],r=this[$0s];return a(function(o,s){if(t.isMockActive)try{XOn.call(this,o,s)}catch(c){if(c instanceof ZJ){let l=t[W0s]();if(l===!1)throw new ZJ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(e5n(l,e))r.call(this,o,s);else throw new ZJ(`${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(egs,"buildMockDispatch");function e5n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>NF(n,r.host)))}a(e5n,"checkNetConnect");function tgs(t){if(t){let{agent:e,...r}=t;return r}}a(tgs,"buildMockOptions");t5n.exports={getResponseData:YOn,getMockDispatch:KOn,addMockDispatch:Z0s,deleteMockDispatch:Ver,buildKey:JOn,generateKeyValues:Wer,matchValue:NF,getResponse:X0s,getStatusText:ZOn,mockDispatch:XOn,buildMockDispatch:egs,checkNetConnect:e5n,buildMockOptions:tgs,getHeaderByName:WOn,buildHeadersFromArray:zer}});var ttr=I((jef,etr)=>{"use strict";p();var{getResponseData:rgs,buildKey:ngs,addMockDispatch:Yer}=wke(),{kDispatches:Mnt,kDispatchKey:Ont,kDefaultHeaders:Ker,kDefaultTrailers:Jer,kContentLength:Zer,kMockDispatch:Lnt}=vfe(),{InvalidArgumentError:A5}=Ec(),{buildURL:igs}=qs(),Cfe=class{static{a(this,"MockScope")}constructor(e){this[Lnt]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new A5("waitInMs must be a valid integer > 0");return this[Lnt].delay=e,this}persist(){return this[Lnt].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new A5("repeatTimes must be a valid integer > 0");return this[Lnt].times=e,this}},Xer=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new A5("opts must be an object");if(typeof e.path>"u")throw new A5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=igs(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[Ont]=ngs(e),this[Mnt]=r,this[Ker]={},this[Jer]={},this[Zer]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=rgs(r),s=this[Zer]?{"content-length":o.length}:{},c={...this[Ker],...s,...n.headers},l={...this[Jer],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new A5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new A5("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 A5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=Yer(this[Mnt],this[Ont],s);return new Cfe(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=Yer(this[Mnt],this[Ont],n);return new Cfe(o)}replyWithError(e){if(typeof e>"u")throw new A5("error must be defined");let r=Yer(this[Mnt],this[Ont],{error:e});return new Cfe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new A5("headers must be defined");return this[Ker]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new A5("trailers must be defined");return this[Jer]=e,this}replyContentLength(){return this[Zer]=!0,this}};etr.exports.MockInterceptor=Xer;etr.exports.MockScope=Cfe});var itr=I(($ef,c5n)=>{"use strict";p();var{promisify:ogs}=require("node:util"),sgs=dfe(),{buildMockDispatch:ags}=wke(),{kDispatches:r5n,kMockAgent:n5n,kClose:i5n,kOriginalClose:o5n,kOrigin:s5n,kOriginalDispatch:cgs,kConnected:rtr}=vfe(),{MockInterceptor:lgs}=ttr(),a5n=jd(),{InvalidArgumentError:ugs}=Ec(),ntr=class extends sgs{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new ugs("Argument opts.agent must implement Agent");this[n5n]=r.agent,this[s5n]=e,this[r5n]=[],this[rtr]=1,this[cgs]=this.dispatch,this[o5n]=this.close.bind(this),this.dispatch=ags.call(this),this.close=this[i5n]}get[a5n.kConnected](){return this[rtr]}intercept(e){return new lgs(e,this[r5n])}async[i5n](){await ogs(this[o5n])(),this[rtr]=0,this[n5n][a5n.kClients].delete(this[s5n])}};c5n.exports=ntr});var atr=I((zef,m5n)=>{"use strict";p();var{promisify:dgs}=require("node:util"),fgs=ffe(),{buildMockDispatch:pgs}=wke(),{kDispatches:l5n,kMockAgent:u5n,kClose:d5n,kOriginalClose:f5n,kOrigin:p5n,kOriginalDispatch:hgs,kConnected:otr}=vfe(),{MockInterceptor:mgs}=ttr(),h5n=jd(),{InvalidArgumentError:ggs}=Ec(),str=class extends fgs{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new ggs("Argument opts.agent must implement Agent");this[u5n]=r.agent,this[p5n]=e,this[l5n]=[],this[otr]=1,this[hgs]=this.dispatch,this[f5n]=this.close.bind(this),this.dispatch=pgs.call(this),this.close=this[d5n]}get[h5n.kConnected](){return this[otr]}intercept(e){return new mgs(e,this[l5n])}async[d5n](){await dgs(this[f5n])(),this[otr]=0,this[u5n][h5n.kClients].delete(this[p5n])}};m5n.exports=str});var A5n=I((Zef,g5n)=>{"use strict";p();var Ags={pronoun:"it",is:"is",was:"was",this:"this"},ygs={pronoun:"they",is:"are",was:"were",this:"these"};g5n.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?Ags:ygs,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var E5n=I((rtf,y5n)=>{"use strict";p();var{Transform:Egs}=require("node:stream"),{Console:_gs}=require("node:console"),vgs=process.versions.icu?"\u2705":"Y ",Cgs=process.versions.icu?"\u274C":"N ";y5n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new Egs({transform(r,n,o){o(null,r)}}),this.logger=new _gs({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?vgs:Cgs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var b5n=I((otf,C5n)=>{"use strict";p();var{kClients:XJ}=jd(),bgs=pfe(),{kAgent:ctr,kMockAgentSet:Bnt,kMockAgentGet:_5n,kDispatches:ltr,kIsMockActive:Fnt,kNetConnect:eZ,kGetNetConnect:Sgs,kOptions:Unt,kFactory:Qnt}=vfe(),Tgs=itr(),Igs=atr(),{matchValue:xgs,buildMockOptions:wgs}=wke(),{InvalidArgumentError:v5n,UndiciError:Rgs}=Ec(),kgs=JRe(),Pgs=A5n(),Dgs=E5n(),utr=class extends kgs{static{a(this,"MockAgent")}constructor(e){if(super(e),this[eZ]=!0,this[Fnt]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new v5n("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new bgs(e);this[ctr]=r,this[XJ]=r[XJ],this[Unt]=wgs(e)}get(e){let r=this[_5n](e);return r||(r=this[Qnt](e),this[Bnt](e,r)),r}dispatch(e,r){return this.get(e.origin),this[ctr].dispatch(e,r)}async close(){await this[ctr].close(),this[XJ].clear()}deactivate(){this[Fnt]=!1}activate(){this[Fnt]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[eZ])?this[eZ].push(e):this[eZ]=[e];else if(typeof e>"u")this[eZ]=!0;else throw new v5n("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[eZ]=!1}get isMockActive(){return this[Fnt]}[Bnt](e,r){this[XJ].set(e,r)}[Qnt](e){let r=Object.assign({agent:this},this[Unt]);return this[Unt]&&this[Unt].connections===1?new Tgs(e,r):new Igs(e,r)}[_5n](e){let r=this[XJ].get(e);if(r)return r;if(typeof e!="string"){let n=this[Qnt]("http://localhost:9999");return this[Bnt](e,n),n}for(let[n,o]of Array.from(this[XJ]))if(o&&typeof n!="string"&&xgs(n,e)){let s=this[Qnt](e);return this[Bnt](e,s),s[ltr]=o[ltr],s}}[Sgs](){return this[eZ]}pendingInterceptors(){let e=this[XJ];return Array.from(e.entries()).flatMap(([r,n])=>n[ltr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new Dgs}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new Pgs("interceptor","interceptors").pluralize(r.length);throw new Rgs(` +`,"latin1"),r!==null&&o!==r){if(n[GXt])throw new GJ;process.emitWarning(new GJ)}e[dp].timeout&&e[dp].timeoutType===afe&&e[dp].timeout.refresh&&e[dp].timeout.refresh(),n[aj]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[cj]=!1,e&&(Hi(n[yE]<=1,"pipeline should only contain this request"),o(e))}};ONn.exports=Qps});var GNn=I((xXd,HNn)=>{"use strict";p();var Sw=require("node:assert"),{pipeline:Vps}=require("node:stream"),da=qs(),{RequestContentLengthMismatchError:zXt,RequestAbortedError:BNn,SocketError:dke,InformationalError:YXt}=Ec(),{kUrl:ynt,kReset:_nt,kClient:cfe,kRunning:vnt,kPending:Wps,kQueue:lj,kPendingIdx:KXt,kRunningIdx:f2,kError:h2,kSocket:wg,kStrictContentLength:zps,kOnError:JXt,kMaxConcurrentStreams:jNn,kHTTP2Session:p2,kResume:uj,kSize:Yps,kHTTPContext:Kps}=jd(),PF=Symbol("open streams"),FNn,UNn=!1,Ent;try{Ent=require("node:http2")}catch{Ent={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:Jps,HTTP2_HEADER_METHOD:Zps,HTTP2_HEADER_PATH:Xps,HTTP2_HEADER_SCHEME:ehs,HTTP2_HEADER_CONTENT_LENGTH:ths,HTTP2_HEADER_EXPECT:rhs,HTTP2_HEADER_STATUS:nhs}}=Ent;function ihs(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(ihs,"parseH2Headers");async function ohs(t,e){t[wg]=e,UNn||(UNn=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=Ent.connect(t[ynt],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[jNn]});r[PF]=0,r[cfe]=t,r[wg]=e,da.addListener(r,"error",ahs),da.addListener(r,"frameError",chs),da.addListener(r,"end",lhs),da.addListener(r,"goaway",uhs),da.addListener(r,"close",function(){let{[cfe]:o}=this,{[wg]:s}=o,c=this[wg][h2]||this[h2]||new dke("closed",da.getSocketInfo(s));if(o[p2]=null,o.destroyed){Sw(o[Wps]===0);let l=o[lj].splice(o[f2]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return fhs(t,...o)},resume(){shs(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(ohs,"connectH2");function shs(t){let e=t[wg];e?.destroyed===!1&&(t[Yps]===0&&t[jNn]===0?(e.unref(),t[p2].unref()):(e.ref(),t[p2].ref()))}a(shs,"resumeH2");function ahs(t){Sw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[wg][h2]=t,this[cfe][JXt](t)}a(ahs,"onHttp2SessionError");function chs(t,e,r){if(r===0){let n=new YXt(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[wg][h2]=n,this[cfe][JXt](n)}}a(chs,"onHttp2FrameError");function lhs(){let t=new dke("other side closed",da.getSocketInfo(this[wg]));this.destroy(t),da.destroy(this[wg],t)}a(lhs,"onHttp2SessionEnd");function uhs(t){let e=this[h2]||new dke(`HTTP/2: "GOAWAY" frame received with code ${t}`,da.getSocketInfo(this)),r=this[cfe];if(r[wg]=null,r[Kps]=null,this[p2]!=null&&(this[p2].destroy(e),this[p2]=null),da.destroy(this[wg],e),r[f2]{e.aborted||e.completed||(T=T||new BNn,da.errorRequest(t,e,T),m!=null&&da.destroy(m,T),da.destroy(f,T),t[lj][t[f2]++]=null,t[uj]())},"abort");try{e.onConnect(y)}catch(T){da.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[PF],t[lj][t[f2]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[PF],t[lj][t[f2]++]=null}),m.once("close",()=>{r[PF]-=1,r[PF]===0&&r.unref()}),!0;h[Xps]=o,h[ehs]="https";let E=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let _=da.bodyLength(f);if(da.isFormDataLike(f)){FNn??=ife().extractBody;let[T,w]=FNn(f);h["content-type"]=w,f=T.stream,_=T.length}if(_==null&&(_=e.contentLength),(_===0||!E)&&(_=null),dhs(n)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[zps])return da.errorRequest(t,e,new zXt),!1;process.emitWarning(new zXt)}_!=null&&(Sw(f,"no body must not have content length"),h[ths]=`${_}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[rhs]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",b)):(m=r.request(h,{endStream:v,signal:u}),b()),++r[PF],m.once("response",T=>{let{[nhs]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new BNn;da.errorRequest(t,e,x),da.destroy(m,x);return}e.onHeaders(Number(w),ihs(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[PF]===0&&r.unref(),y(new YXt("HTTP/2: stream half-closed (remote)")),t[lj][t[f2]++]=null,t[KXt]=t[f2],t[uj]()}),m.once("close",()=>{r[PF]-=1,r[PF]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new YXt(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function b(){!f||_===0?QNn(y,m,null,t,e,t[wg],_,E):da.isBuffer(f)?QNn(y,m,f,t,e,t[wg],_,E):da.isBlobLike(f)?typeof f.stream=="function"?qNn(y,m,f.stream(),t,e,t[wg],_,E):hhs(y,m,f,t,e,t[wg],_,E):da.isStream(f)?phs(y,t[wg],E,m,f,t,e,_):da.isIterable(f)?qNn(y,m,f,t,e,t[wg],_,E):Sw(!1)}a(b,"writeBodyH2")}a(fhs,"writeH2");function QNn(t,e,r,n,o,s,c,l){try{r!=null&&da.isBuffer(r)&&(Sw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[_nt]=!0),o.onRequestSent(),n[uj]()}catch(u){t(u)}}a(QNn,"writeBuffer");function phs(t,e,r,n,o,s,c,l){Sw(l!==0||s[vnt]===0,"stream body cannot be pipelined");let u=Vps(o,n,f=>{f?(da.destroy(u,f),t(f)):(da.removeAllListeners(u),c.onRequestSent(),r||(e[_nt]=!0),s[uj]())});da.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(phs,"writeStream");async function hhs(t,e,r,n,o,s,c,l){Sw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new zXt;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[_nt]=!0),n[uj]()}catch(u){t(u)}}a(hhs,"writeBlob");async function qNn(t,e,r,n,o,s,c,l){Sw(c!==0||n[vnt]===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)=>{Sw(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[_nt]=!0),n[uj]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(qNn,"writeIterable");HNn.exports=ohs});var bnt=I((kXd,WNn)=>{"use strict";p();var h5=qs(),{kBodyUsed:fke}=jd(),XXt=require("node:assert"),{InvalidArgumentError:mhs}=Ec(),ghs=require("node:events"),Ahs=[300,301,302,303,307,308],$Nn=Symbol("body"),Cnt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[$Nn]=e,this[fke]=!1}async*[Symbol.asyncIterator](){XXt(!this[fke],"disturbed"),this[fke]=!0,yield*this[$Nn]}},ZXt=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new mhs("maxRedirections must be a positive number");h5.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,h5.isStream(this.opts.body)?(h5.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){XXt(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[fke]=!1,ghs.prototype.on.call(this.opts.body,"data",function(){this[fke]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Cnt(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&h5.isIterable(this.opts.body)&&(this.opts.body=new Cnt(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||h5.isDisturbed(this.opts.body)?null:yhs(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}=h5.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=Ehs(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 yhs(t,e){if(Ahs.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var _hs=bnt();function vhs({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new _hs(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(vhs,"createRedirectInterceptor");zNn.exports=vhs});var dfe=I((LXd,iMn)=>{"use strict";p();var DF=require("node:assert"),eMn=require("node:net"),Chs=require("node:http"),$J=qs(),{channels:lfe}=$de(),bhs=lDn(),Shs=Yde(),{InvalidArgumentError:sh,InformationalError:Ths,ClientDestroyedError:Ihs}=Ec(),xhs=XRe(),{kUrl:m5,kServerName:dj,kClient:whs,kBusy:eer,kConnect:Rhs,kResuming:VJ,kRunning:Ake,kPending:yke,kSize:gke,kQueue:m2,kConnected:khs,kConnecting:ufe,kNeedDrain:pj,kKeepAliveDefaultTimeout:YNn,kHostHeader:Phs,kPendingIdx:g2,kRunningIdx:NF,kError:Dhs,kPipelining:Tnt,kKeepAliveTimeoutValue:Nhs,kMaxHeadersSize:Mhs,kKeepAliveMaxTimeout:Ohs,kKeepAliveTimeoutThreshold:Lhs,kHeadersTimeout:Bhs,kBodyTimeout:Fhs,kStrictContentLength:Uhs,kConnector:pke,kMaxRedirections:Qhs,kMaxRequests:ter,kCounter:qhs,kClose:jhs,kDestroy:Hhs,kDispatch:Ghs,kInterceptors:KNn,kLocalAddress:hke,kMaxResponseSize:$hs,kOnError:Vhs,kHTTPContext:ah,kMaxConcurrentStreams:Whs,kResume:mke}=jd(),zhs=LNn(),Yhs=GNn(),JNn=!1,fj=Symbol("kClosedResolve"),ZNn=a(()=>{},"noop");function tMn(t){return t[Tnt]??t[ah]?.defaultPipelining??1}a(tMn,"getPipelining");var rer=class extends Shs{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:E,tls:_,strictContentLength:v,maxCachedSessions:b,maxRedirections:T,connect:w,maxRequestsPerClient:R,localAddress:x,maxResponseSize:P,autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N,maxConcurrentStreams:L,allowH2:B}={}){if(super(),f!==void 0)throw new sh("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new sh("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new sh("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new sh("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new sh("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new sh("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new sh("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new sh("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new sh("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new sh("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new sh("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new sh("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new sh("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new sh("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new sh("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new sh("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||eMn.isIP(x)===0))throw new sh("localAddress must be valid string IP address");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new sh("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new sh("autoSelectFamilyAttemptTimeout must be a positive number");if(B!=null&&typeof B!="boolean")throw new sh("allowH2 must be a valid boolean value");if(L!=null&&(typeof L!="number"||L<1))throw new sh("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=xhs({..._,maxCachedSessions:b,allowH2:B,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[KNn]=r.Client,JNn||(JNn=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[KNn]=[Khs({maxRedirections:T})],this[m5]=$J.parseOrigin(e),this[pke]=w,this[Tnt]=E??1,this[Mhs]=n||Chs.maxHeaderSize,this[YNn]=h??4e3,this[Ohs]=g??6e5,this[Lhs]=A??2e3,this[Nhs]=this[YNn],this[dj]=null,this[hke]=x??null,this[VJ]=0,this[pj]=0,this[Phs]=`host: ${this[m5].hostname}${this[m5].port?`:${this[m5].port}`:""}\r +`,this[Fhs]=u??3e5,this[Bhs]=o??3e5,this[Uhs]=v??!0,this[Qhs]=T,this[ter]=R,this[fj]=null,this[$hs]=P>-1?P:-1,this[Whs]=L??100,this[ah]=null,this[m2]=[],this[NF]=0,this[g2]=0,this[mke]=q=>ner(this,q),this[Vhs]=q=>rMn(this,q)}get pipelining(){return this[Tnt]}set pipelining(e){this[Tnt]=e,this[mke](!0)}get[yke](){return this[m2].length-this[g2]}get[Ake](){return this[g2]-this[NF]}get[gke](){return this[m2].length-this[NF]}get[khs](){return!!this[ah]&&!this[ufe]&&!this[ah].destroyed}get[eer](){return!!(this[ah]?.busy(null)||this[gke]>=(tMn(this)||1)||this[yke]>0)}[Rhs](e){nMn(this),this.once("connect",e)}[Ghs](e,r){let n=e.origin||this[m5].origin,o=new bhs(n,e,r);return this[m2].push(o),this[VJ]||($J.bodyLength(o.body)==null&&$J.isIterable(o.body)?(this[VJ]=1,queueMicrotask(()=>ner(this))):this[mke](!0)),this[VJ]&&this[pj]!==2&&this[eer]&&(this[pj]=2),this[pj]<2}async[jhs](){return new Promise(e=>{this[gke]?this[fj]=e:e(null)})}async[Hhs](e){return new Promise(r=>{let n=this[m2].splice(this[g2]);for(let s=0;s{this[fj]&&(this[fj](),this[fj]=null),r(null)},"callback");this[ah]?(this[ah].destroy(e,o),this[ah]=null):queueMicrotask(o),this[mke]()})}},Khs=Snt();function rMn(t,e){if(t[Ake]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){DF(t[g2]===t[NF]);let r=t[m2].splice(t[NF]);for(let n=0;n{t[pke]({host:e,hostname:r,protocol:n,port:o,servername:t[dj],localAddress:t[hke]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){$J.destroy(s.on("error",ZNn),new Ihs);return}DF(s);try{t[ah]=s.alpnProtocol==="h2"?await Yhs(t,s):await zhs(t,s)}catch(c){throw s.destroy().on("error",ZNn),c}t[ufe]=!1,s[qhs]=0,s[ter]=t[ter],s[whs]=t,s[Dhs]=null,lfe.connected.hasSubscribers&&lfe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ah]?.version,servername:t[dj],localAddress:t[hke]},connector:t[pke],socket:s}),t.emit("connect",t[m5],[t])}catch(s){if(t.destroyed)return;if(t[ufe]=!1,lfe.connectError.hasSubscribers&&lfe.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ah]?.version,servername:t[dj],localAddress:t[hke]},connector:t[pke],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(DF(t[Ake]===0);t[yke]>0&&t[m2][t[g2]].servername===t[dj];){let c=t[m2][t[g2]++];$J.errorRequest(t,c,s)}else rMn(t,s);t.emit("connectionError",t[m5],[t],s)}t[mke]()}a(nMn,"connect");function XNn(t){t[pj]=0,t.emit("drain",t[m5],[t])}a(XNn,"emitDrain");function ner(t,e){t[VJ]!==2&&(t[VJ]=2,Jhs(t,e),t[VJ]=0,t[NF]>256&&(t[m2].splice(0,t[NF]),t[g2]-=t[NF],t[NF]=0))}a(ner,"resume");function Jhs(t,e){for(;;){if(t.destroyed){DF(t[yke]===0);return}if(t[fj]&&!t[gke]){t[fj](),t[fj]=null;return}if(t[ah]&&t[ah].resume(),t[eer])t[pj]=2;else if(t[pj]===2){e?(t[pj]=1,queueMicrotask(()=>XNn(t))):XNn(t);continue}if(t[yke]===0||t[Ake]>=(tMn(t)||1))return;let r=t[m2][t[g2]];if(t[m5].protocol==="https:"&&t[dj]!==r.servername){if(t[Ake]>0)return;t[dj]=r.servername,t[ah]?.destroy(new Ths("servername changed"),()=>{t[ah]=null,ner(t)})}if(t[ufe])return;if(!t[ah]){nMn(t);return}if(t[ah].destroyed||t[ah].busy(r))return;!r.aborted&&t[ah].write(r)?t[g2]++:t[m2].splice(t[g2],1)}}a(Jhs,"_resume");iMn.exports=rer});var ier=I((QXd,oMn)=>{"use strict";p();var Int=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)}};oMn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Int}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Int),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var aMn=I((HXd,sMn)=>{p();var{kFree:Zhs,kConnected:Xhs,kPending:ems,kQueued:tms,kRunning:rms,kSize:nms}=jd(),WJ=Symbol("pool"),oer=class{static{a(this,"PoolStats")}constructor(e){this[WJ]=e}get connected(){return this[WJ][Xhs]}get free(){return this[WJ][Zhs]}get pending(){return this[WJ][ems]}get queued(){return this[WJ][tms]}get running(){return this[WJ][rms]}get size(){return this[WJ][nms]}};sMn.exports=oer});var der=I((VXd,AMn)=>{"use strict";p();var ims=Yde(),oms=ier(),{kConnected:ser,kSize:cMn,kRunning:lMn,kPending:uMn,kQueued:Eke,kBusy:sms,kFree:ams,kUrl:cms,kClose:lms,kDestroy:ums,kDispatch:dms}=jd(),fms=aMn(),ob=Symbol("clients"),ov=Symbol("needDrain"),_ke=Symbol("queue"),aer=Symbol("closed resolve"),cer=Symbol("onDrain"),dMn=Symbol("onConnect"),fMn=Symbol("onDisconnect"),pMn=Symbol("onConnectionError"),ler=Symbol("get dispatcher"),mMn=Symbol("add client"),gMn=Symbol("remove client"),hMn=Symbol("stats"),uer=class extends ims{static{a(this,"PoolBase")}constructor(){super(),this[_ke]=new oms,this[ob]=[],this[Eke]=0;let e=this;this[cer]=a(function(n,o){let s=e[_ke],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[Eke]--,c=!this.dispatch(l.opts,l.handler)}this[ov]=c,!this[ov]&&e[ov]&&(e[ov]=!1,e.emit("drain",n,[e,...o])),e[aer]&&s.isEmpty()&&Promise.all(e[ob].map(l=>l.close())).then(e[aer])},"onDrain"),this[dMn]=(r,n)=>{e.emit("connect",r,[e,...n])},this[fMn]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[pMn]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[hMn]=new fms(this)}get[sms](){return this[ov]}get[ser](){return this[ob].filter(e=>e[ser]).length}get[ams](){return this[ob].filter(e=>e[ser]&&!e[ov]).length}get[uMn](){let e=this[Eke];for(let{[uMn]:r}of this[ob])e+=r;return e}get[lMn](){let e=0;for(let{[lMn]:r}of this[ob])e+=r;return e}get[cMn](){let e=this[Eke];for(let{[cMn]:r}of this[ob])e+=r;return e}get stats(){return this[hMn]}async[lms](){this[_ke].isEmpty()?await Promise.all(this[ob].map(e=>e.close())):await new Promise(e=>{this[aer]=e})}async[ums](e){for(;;){let r=this[_ke].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[ob].map(r=>r.destroy(e)))}[dms](e,r){let n=this[ler]();return n?n.dispatch(e,r)||(n[ov]=!0,this[ov]=!this[ler]()):(this[ov]=!0,this[_ke].push({opts:e,handler:r}),this[Eke]++),!this[ov]}[mMn](e){return e.on("drain",this[cer]).on("connect",this[dMn]).on("disconnect",this[fMn]).on("connectionError",this[pMn]),this[ob].push(e),this[ov]&&queueMicrotask(()=>{this[ov]&&this[cer](e[cms],[this,e])}),this}[gMn](e){e.close(()=>{let r=this[ob].indexOf(e);r!==-1&&this[ob].splice(r,1)}),this[ov]=this[ob].some(r=>!r[ov]&&r.closed!==!0&&r.destroyed!==!0)}};AMn.exports={PoolBase:uer,kClients:ob,kNeedDrain:ov,kAddClient:mMn,kRemoveClient:gMn,kGetDispatcher:ler}});var ffe=I((YXd,vMn)=>{"use strict";p();var{PoolBase:pms,kClients:xnt,kNeedDrain:hms,kAddClient:mms,kGetDispatcher:gms}=der(),Ams=dfe(),{InvalidArgumentError:fer}=Ec(),yMn=qs(),{kUrl:EMn,kInterceptors:yms}=jd(),Ems=XRe(),per=Symbol("options"),her=Symbol("connections"),_Mn=Symbol("factory");function _ms(t,e){return new Ams(t,e)}a(_ms,"defaultFactory");var mer=class extends pms{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=_ms,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 fer("invalid connections");if(typeof n!="function")throw new fer("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new fer("connect must be a function or an object");typeof o!="function"&&(o=Ems({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[yms]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[her]=r||null,this[EMn]=yMn.parseOrigin(e),this[per]={...yMn.deepClone(m),connect:o,allowH2:h},this[per].interceptors=m.interceptors?{...m.interceptors}:void 0,this[_Mn]=n,this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[xnt].indexOf(E);_!==-1&&this[xnt].splice(_,1)}})}[gms](){for(let e of this[xnt])if(!e[hms])return e;if(!this[her]||this[xnt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:vms,InvalidArgumentError:Cms}=Ec(),{PoolBase:bms,kClients:EE,kNeedDrain:vke,kAddClient:Sms,kRemoveClient:Tms,kGetDispatcher:Ims}=der(),xms=ffe(),{kUrl:ger,kInterceptors:wms}=jd(),{parseOrigin:CMn}=qs(),bMn=Symbol("factory"),wnt=Symbol("options"),SMn=Symbol("kGreatestCommonDivisor"),zJ=Symbol("kCurrentWeight"),YJ=Symbol("kIndex"),Tw=Symbol("kWeight"),Rnt=Symbol("kMaxWeightPerServer"),knt=Symbol("kErrorPenalty");function Rms(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Rms,"getGreatestCommonDivisor");function kms(t,e){return new xms(t,e)}a(kms,"defaultFactory");var Aer=class extends bms{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=kms,...n}={}){if(super(),this[wnt]=n,this[YJ]=-1,this[zJ]=0,this[Rnt]=this[wnt].maxWeightPerServer||100,this[knt]=this[wnt].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new Cms("factory must be a function.");this[wms]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[bMn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=CMn(e).origin;if(this[EE].find(o=>o[ger].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[bMn](r,Object.assign({},this[wnt]));this[Sms](n),n.on("connect",()=>{n[Tw]=Math.min(this[Rnt],n[Tw]+this[knt])}),n.on("connectionError",()=>{n[Tw]=Math.max(1,n[Tw]-this[knt]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Tw]=Math.max(1,n[Tw]-this[knt]),this._updateBalancedPoolStats())});for(let o of this[EE])o[Tw]=this[Rnt];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[ger].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[Tms](n),this}get upstreams(){return this[EE].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[ger].origin)}[Ims](){if(this[EE].length===0)throw new vms;if(!this[EE].find(s=>!s[vke]&&s.closed!==!0&&s.destroyed!==!0)||this[EE].map(s=>s[vke]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[EE].findIndex(s=>!s[vke]);for(;n++this[EE][o][Tw]&&!s[vke]&&(o=this[YJ]),this[YJ]===0&&(this[zJ]=this[zJ]-this[SMn],this[zJ]<=0&&(this[zJ]=this[Rnt])),s[Tw]>=this[zJ]&&!s[vke])return s}return this[zJ]=this[EE][o][Tw],this[YJ]=o,this[EE][o]}};TMn.exports=Aer});var pfe=I((tef,NMn)=>{"use strict";p();var{InvalidArgumentError:Pnt}=Ec(),{kClients:hj,kRunning:xMn,kClose:Pms,kDestroy:Dms,kDispatch:Nms,kInterceptors:Mms}=jd(),Oms=Yde(),Lms=ffe(),Bms=dfe(),Fms=qs(),Ums=Snt(),wMn=Symbol("onConnect"),RMn=Symbol("onDisconnect"),kMn=Symbol("onConnectionError"),Qms=Symbol("maxRedirections"),PMn=Symbol("onDrain"),DMn=Symbol("factory"),yer=Symbol("options");function qms(t,e){return e&&e.connections===1?new Bms(t,e):new Lms(t,e)}a(qms,"defaultFactory");var Eer=class extends Oms{static{a(this,"Agent")}constructor({factory:e=qms,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new Pnt("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new Pnt("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new Pnt("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[Mms]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[Ums({maxRedirections:r})],this[yer]={...Fms.deepClone(o),connect:n},this[yer].interceptors=o.interceptors?{...o.interceptors}:void 0,this[Qms]=r,this[DMn]=e,this[hj]=new Map,this[PMn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[wMn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[RMn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[kMn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[xMn](){let e=0;for(let r of this[hj].values())e+=r[xMn];return e}[Nms](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new Pnt("opts.origin must be a non-empty string or URL.");let o=this[hj].get(n);return o||(o=this[DMn](e.origin,this[yer]).on("drain",this[PMn]).on("connect",this[wMn]).on("disconnect",this[RMn]).on("connectionError",this[kMn]),this[hj].set(n,o)),o.dispatch(e,r)}async[Pms](){let e=[];for(let r of this[hj].values())e.push(r.close());this[hj].clear(),await Promise.all(e)}async[Dms](e){let r=[];for(let n of this[hj].values())r.push(n.destroy(e));this[hj].clear(),await Promise.all(r)}};NMn.exports=Eer});var Ser=I((ief,GMn)=>{"use strict";p();var{kProxy:_er,kClose:UMn,kDestroy:QMn,kDispatch:MMn,kInterceptors:jms}=jd(),{URL:KJ}=require("node:url"),Hms=pfe(),qMn=ffe(),jMn=Yde(),{InvalidArgumentError:hfe,RequestAbortedError:Gms,SecureProxyConnectionError:$ms}=Ec(),OMn=XRe(),HMn=dfe(),Dnt=Symbol("proxy agent"),Nnt=Symbol("proxy client"),mj=Symbol("proxy headers"),ver=Symbol("request tls settings"),LMn=Symbol("proxy tls settings"),BMn=Symbol("connect endpoint function"),FMn=Symbol("tunnel proxy");function Vms(t){return t==="https:"?443:80}a(Vms,"defaultProtocolPort");function Wms(t,e){return new qMn(t,e)}a(Wms,"defaultFactory");var zms=a(()=>{},"noop");function Yms(t,e){return e.connections===1?new HMn(t,e):new qMn(t,e)}a(Yms,"defaultAgentFactory");var Cer=class extends jMn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new hfe("Proxy URL is mandatory");this[mj]=r,o?this.#e=o(e,{connect:n}):this.#e=new HMn(e,{connect:n})}[MMn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new hfe("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 KJ(o);c.host=l}return e.headers={...this[mj],...c},this.#e[MMn](e,r)}async[UMn](){return this.#e.close()}async[QMn](e){return this.#e.destroy(e)}},ber=class extends jMn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof KJ)&&!e.uri)throw new hfe("Proxy uri is mandatory");let{clientFactory:r=Wms}=e;if(typeof r!="function")throw new hfe("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[_er]={uri:s,protocol:u},this[jms]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[ver]=e.requestTls,this[LMn]=e.proxyTls,this[mj]=e.headers||{},this[FMn]=n,e.auth&&e.token)throw new hfe("opts.auth cannot be used in combination with opts.token");e.auth?this[mj]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[mj]["proxy-authorization"]=e.token:d&&f&&(this[mj]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=OMn({...e.proxyTls});this[BMn]=OMn({...e.requestTls});let g=e.factory||Yms,A=a((y,E)=>{let{protocol:_}=new KJ(y);return!this[FMn]&&_==="http:"&&this[_er].protocol==="http:"?new Cer(this[_er].uri,{headers:this[mj],connect:m,factory:g}):g(y,E)},"factory");this[Nnt]=r(o,{connect:m}),this[Dnt]=new Hms({...e,factory:A,connect:a(async(y,E)=>{let _=y.host;y.port||(_+=`:${Vms(y.protocol)}`);try{let{socket:v,statusCode:b}=await this[Nnt].connect({origin:c,port:l,path:_,signal:y.signal,headers:{...this[mj],host:y.host},servername:this[LMn]?.servername||h});if(b!==200&&(v.on("error",zms).destroy(),E(new Gms(`Proxy response (${b}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){E(null,v);return}let T;this[ver]?T=this[ver].servername:T=y.servername,this[BMn]({...y,servername:T,httpSocket:v},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new $ms(v)):E(v)}},"connect")})}dispatch(e,r){let n=Kms(e.headers);if(Jms(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new KJ(e.origin);n.host=o}return this[Dnt].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new KJ(e):e instanceof KJ?e:new KJ(e.uri)}async[UMn](){await this[Dnt].close(),await this[Nnt].close()}async[QMn](){await this[Dnt].destroy(),await this[Nnt].destroy()}};function Kms(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new hfe("Proxy-Authorization should be sent in ProxyAgent constructor")}a(Jms,"throwIfProxyAuthIsSent");GMn.exports=ber});var KMn=I((aef,YMn)=>{"use strict";p();var Zms=Yde(),{kClose:Xms,kDestroy:e0s,kClosed:$Mn,kDestroyed:VMn,kDispatch:t0s,kNoProxyAgent:Cke,kHttpProxyAgent:gj,kHttpsProxyAgent:JJ}=jd(),WMn=Ser(),r0s=pfe(),n0s={"http:":80,"https:":443},zMn=!1,Ter=class extends Zms{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,zMn||(zMn=!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[Cke]=new r0s(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[gj]=new WMn({...s,uri:c}):this[gj]=this[Cke];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[JJ]=new WMn({...s,uri:l}):this[JJ]=this[gj],this.#o()}[t0s](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[Xms](){await this[Cke].close(),this[gj][$Mn]||await this[gj].close(),this[JJ][$Mn]||await this[JJ].close()}async[e0s](e){await this[Cke].destroy(e),this[gj][VMn]||await this[gj].destroy(e),this[JJ][VMn]||await this[JJ].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||n0s[r]||0,this.#i(n,o)?r==="https:"?this[JJ]:this[gj]:this[Cke]}#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 mfe=require("node:assert"),{kRetryHandlerDefaultRetry:JMn}=jd(),{RequestRetryError:bke}=Ec(),{isDisturbed:ZMn,parseHeaders:i0s,parseRangeHeader:XMn,wrapRequestBody:o0s}=qs();function s0s(t){let e=Date.now();return new Date(t).getTime()-e}a(s0s,"calculateRetryAfterHeader");var Ier=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:o0s(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[JMn],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[JMn](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:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?s0s(v):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onHeaders(e,r,n,o){let s=i0s(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new bke("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 bke("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=XMn(s["content-range"]);if(!l)return this.abort(new bke("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new bke("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return mfe(this.start===u,"content-range mismatch"),mfe(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=XMn(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;mfe(u!=null&&Number.isFinite(u),"content-range mismatch"),mfe(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 mfe(Number.isFinite(this.start)),mfe(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 bke("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||ZMn(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||ZMn(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")}};eOn.exports=Ier});var rOn=I((pef,tOn)=>{"use strict";p();var a0s=JRe(),c0s=Mnt(),xer=class extends a0s{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 c0s({...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()}};tOn.exports=xer});var Ner=I((gef,dOn)=>{"use strict";p();var aOn=require("node:assert"),{Readable:l0s}=require("node:stream"),{RequestAbortedError:cOn,NotSupportedError:u0s,InvalidArgumentError:d0s,AbortError:wer}=Ec(),lOn=qs(),{ReadableStreamFrom:f0s}=qs(),lT=Symbol("kConsume"),Ske=Symbol("kReading"),Aj=Symbol("kBody"),nOn=Symbol("kAbort"),uOn=Symbol("kContentType"),iOn=Symbol("kContentLength"),p0s=a(()=>{},"noop"),Rer=class extends l0s{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[nOn]=r,this[lT]=null,this[Aj]=null,this[uOn]=n,this[iOn]=o,this[Ske]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new cOn),e&&this[nOn](),super.destroy(e)}_destroy(e,r){this[Ske]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[Ske]=!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[Ske]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[lT]&&e!==null?(Per(this[lT],e),this[Ske]?super.push(e):!0):super.push(e)}async text(){return Tke(this,"text")}async json(){return Tke(this,"json")}async blob(){return Tke(this,"blob")}async bytes(){return Tke(this,"bytes")}async arrayBuffer(){return Tke(this,"arrayBuffer")}async formData(){throw new u0s}get bodyUsed(){return lOn.isDisturbed(this)}get body(){return this[Aj]||(this[Aj]=f0s(this),this[lT]&&(this[Aj].getReader(),aOn(this[Aj].locked))),this[Aj]}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 d0s("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[iOn]>r&&this.destroy(new wer);let c=a(()=>{this.destroy(n.reason??new wer)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new wer):o(null)}).on("error",p0s).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function h0s(t){return t[Aj]&&t[Aj].locked===!0||t[lT]}a(h0s,"isLocked");function m0s(t){return lOn.isDisturbed(t)||h0s(t)}a(m0s,"isUnusable");async function Tke(t,e){return aOn(!t[lT]),new Promise((r,n)=>{if(m0s(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[lT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){Der(this[lT],o)}).on("close",function(){this[lT].body!==null&&Der(this[lT],new cOn)}),g0s(t[lT])})})}a(Tke,"consume");function g0s(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(ker,"chunksDecode");function oOn(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 A0s=require("node:assert"),{ResponseStatusCodeError:fOn}=Ec(),{chunksDecode:pOn}=Ner(),y0s=128*1024;async function E0s({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){A0s(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>y0s){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new fOn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{hOn(r)?f=JSON.parse(pOn(c,l)):mOn(r)&&(f=pOn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new fOn(u,n,s,f)))}a(E0s,"getResolveErrorBodyCallback");var hOn=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"),mOn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");gOn.exports={getResolveErrorBodyCallback:E0s,isContentTypeApplicationJson:hOn,isContentTypeText:mOn}});var EOn=I((Cef,Oer)=>{"use strict";p();var _0s=require("node:assert"),{Readable:v0s}=Ner(),{InvalidArgumentError:gfe,RequestAbortedError:AOn}=Ec(),uT=qs(),{getResolveErrorBodyCallback:C0s}=Mer(),{AsyncResource:b0s}=require("node:async_hooks"),Ont=class extends b0s{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new gfe("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 gfe("invalid callback");if(f&&(typeof f!="number"||f<0))throw new gfe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new gfe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new gfe("invalid method");if(l&&typeof l!="function")throw new gfe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw uT.isStream(c)&&uT.destroy(c.on("error",uT.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,uT.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new AOn:this.removeAbortListener=uT.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new AOn,this.res?uT.destroy(this.res.on("error",uT.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}_0s(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"?uT.parseRawHeaders(r):uT.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?uT.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new v0s({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(C0s,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){uT.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(()=>{uT.destroy(r,e)})),o&&(this.body=null,uT.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function yOn(t,e){if(e===void 0)return new Promise((r,n)=>{yOn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new Ont(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(yOn,"request");Oer.exports=yOn;Oer.exports.RequestHandler=Ont});var Ike=I((Tef,COn)=>{p();var{addAbortListener:S0s}=qs(),{RequestAbortedError:T0s}=Ec(),Afe=Symbol("kListener"),g5=Symbol("kSignal");function _On(t){t.abort?t.abort(t[g5]?.reason):t.reason=t[g5]?.reason??new T0s,vOn(t)}a(_On,"abort");function I0s(t,e){if(t.reason=null,t[g5]=null,t[Afe]=null,!!e){if(e.aborted){_On(t);return}t[g5]=e,t[Afe]=()=>{_On(t)},S0s(t[g5],t[Afe])}}a(I0s,"addSignal");function vOn(t){t[g5]&&("removeEventListener"in t[g5]?t[g5].removeEventListener("abort",t[Afe]):t[g5].removeListener("abort",t[Afe]),t[g5]=null,t[Afe]=null)}a(vOn,"removeSignal");COn.exports={addSignal:I0s,removeSignal:vOn}});var IOn=I((wef,TOn)=>{"use strict";p();var x0s=require("node:assert"),{finished:w0s,PassThrough:R0s}=require("node:stream"),{InvalidArgumentError:yfe,InvalidReturnValueError:k0s}=Ec(),A2=qs(),{getResolveErrorBodyCallback:P0s}=Mer(),{AsyncResource:D0s}=require("node:async_hooks"),{addSignal:N0s,removeSignal:bOn}=Ike(),Ler=class extends D0s{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new yfe("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 yfe("invalid callback");if(typeof r!="function")throw new yfe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new yfe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new yfe("invalid method");if(u&&typeof u!="function")throw new yfe("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw A2.isStream(l)&&A2.destroy(l.on("error",A2.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,A2.isStream(l)&&l.on("error",h=>{this.onError(h)}),N0s(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}x0s(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"?A2.parseRawHeaders(r):A2.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"?A2.parseHeaders(r):f)["content-type"];h=new R0s,this.callback=null,this.runInAsyncScope(P0s,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 k0s("expected Writable");w0s(h,{readable:!1},g=>{let{callback:A,res:y,opaque:E,trailers:_,abort:v}=this;this.res=null,(g||!y.readable)&&A2.destroy(y,g),this.callback=null,this.runInAsyncScope(A,null,g||null,{opaque:E,trailers:_}),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;bOn(this),r&&(this.trailers=A2.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;bOn(this),this.factory=null,r?(this.res=null,A2.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,A2.destroy(s,e))}};function SOn(t,e,r){if(r===void 0)return new Promise((n,o)=>{SOn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new Ler(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(SOn,"stream");TOn.exports=SOn});var kOn=I((Pef,ROn)=>{"use strict";p();var{Readable:wOn,Duplex:M0s,PassThrough:O0s}=require("node:stream"),{InvalidArgumentError:xke,InvalidReturnValueError:L0s,RequestAbortedError:Ber}=Ec(),Iw=qs(),{AsyncResource:B0s}=require("node:async_hooks"),{addSignal:F0s,removeSignal:U0s}=Ike(),xOn=require("node:assert"),Efe=Symbol("resume"),Fer=class extends wOn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Efe]=null}_read(){let{[Efe]:e}=this;e&&(this[Efe]=null,e())}_destroy(e,r){this._read(),r(e)}},Uer=class extends wOn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Efe]=e}_read(){this[Efe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new Ber),r(e)}},Qer=class extends B0s{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new xke("invalid opts");if(typeof r!="function")throw new xke("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 xke("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new xke("invalid method");if(c&&typeof c!="function")throw new xke("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 Fer().on("error",Iw.nop),this.ret=new M0s({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[Efe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new Ber),A&&u&&A(),Iw.destroy(f,u),Iw.destroy(h,u),Iw.destroy(m,u),U0s(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,F0s(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}xOn(!o,"pipeline cannot be retried"),xOn(!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"?Iw.parseRawHeaders(r):Iw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Uer(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?Iw.parseRawHeaders(r):Iw.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",Iw.nop),u}if(!l||typeof l.on!="function")throw new L0s("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;Iw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||Iw.destroy(u,new Ber)}),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,Iw.destroy(r,e)}};function Q0s(t,e){try{let r=new Qer(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new O0s().destroy(r)}}a(Q0s,"pipeline");ROn.exports=Q0s});var LOn=I((Mef,OOn)=>{"use strict";p();var{InvalidArgumentError:qer,SocketError:q0s}=Ec(),{AsyncResource:j0s}=require("node:async_hooks"),POn=qs(),{addSignal:H0s,removeSignal:DOn}=Ike(),NOn=require("node:assert"),jer=class extends j0s{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new qer("invalid opts");if(typeof r!="function")throw new qer("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new qer("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,H0s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}NOn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new q0s("bad upgrade",null)}onUpgrade(e,r,n){NOn(e===101);let{callback:o,opaque:s,context:c}=this;DOn(this),this.callback=null;let l=this.responseHeaders==="raw"?POn.parseRawHeaders(r):POn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;DOn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function MOn(t,e){if(e===void 0)return new Promise((r,n)=>{MOn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new jer(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(MOn,"upgrade");OOn.exports=MOn});var qOn=I((Bef,QOn)=>{"use strict";p();var G0s=require("node:assert"),{AsyncResource:$0s}=require("node:async_hooks"),{InvalidArgumentError:Her,SocketError:V0s}=Ec(),BOn=qs(),{addSignal:W0s,removeSignal:FOn}=Ike(),Ger=class extends $0s{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Her("invalid opts");if(typeof r!="function")throw new Her("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Her("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,W0s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}G0s(this.callback),this.abort=e,this.context=r}onHeaders(){throw new V0s("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;FOn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?BOn.parseRawHeaders(r):BOn.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;FOn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function UOn(t,e){if(e===void 0)return new Promise((r,n)=>{UOn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Ger(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(UOn,"connect");QOn.exports=UOn});var jOn=I((Qef,_fe)=>{"use strict";p();_fe.exports.request=EOn();_fe.exports.stream=IOn();_fe.exports.pipeline=kOn();_fe.exports.upgrade=LOn();_fe.exports.connect=qOn()});var Ver=I((jef,GOn)=>{"use strict";p();var{UndiciError:z0s}=Ec(),HOn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),$er=class t extends z0s{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[HOn]===!0}[HOn]=!0};GOn.exports={MockNotMatchedError:$er}});var vfe=I(($ef,$On)=>{"use strict";p();$On.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 wke=I((Wef,r5n)=>{"use strict";p();var{MockNotMatchedError:ZJ}=Ver(),{kDispatches:Lnt,kMockAgent:Y0s,kOriginalDispatch:K0s,kOrigin:J0s,kGetNetConnect:Z0s}=vfe(),{buildURL:X0s}=qs(),{STATUS_CODES:egs}=require("node:http"),{types:{isPromise:tgs}}=require("node:util");function MF(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(MF,"matchValue");function WOn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(WOn,"lowerCaseEntries");function zOn(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=zOn(e,r);if(!MF(n,o))return!1}return!0}a(YOn,"matchHeaders");function VOn(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(VOn,"safeUrl");function rgs(t,{path:e,method:r,body:n,headers:o}){let s=MF(t.path,e),c=MF(t.method,r),l=typeof t.body<"u"?MF(t.body,n):!0,u=YOn(t,o);return s&&c&&l&&u}a(rgs,"matchKey");function KOn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(KOn,"getResponseData");function JOn(t,e){let r=e.query?X0s(e.path,e.query):e.path,n=typeof r=="string"?VOn(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>MF(VOn(s),n));if(o.length===0)throw new ZJ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>MF(s,e.method)),o.length===0)throw new ZJ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?MF(s,e.body):!0),o.length===0)throw new ZJ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>YOn(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new ZJ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(JOn,"getMockDispatch");function ngs(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(ngs,"addMockDispatch");function Wer(t,e){let r=t.findIndex(n=>n.consumed?rgs(n,e):!1);r!==-1&&t.splice(r,1)}a(Wer,"deleteMockDispatch");function ZOn(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(ZOn,"buildKey");function zer(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[Lnt])},d):g(this[Lnt]);function g(y,E=s){let _=Array.isArray(t.headers)?Yer(t.headers):t.headers,v=typeof E=="function"?E({...t,headers:_}):E;if(tgs(v)){v.then(R=>g(y,R));return}let b=KOn(v),T=zer(c),w=zer(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,XOn(o)),e.onData?.(Buffer.from(b)),e.onComplete?.(w),Wer(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(e5n,"mockDispatch");function ogs(){let t=this[Y0s],e=this[J0s],r=this[K0s];return a(function(o,s){if(t.isMockActive)try{e5n.call(this,o,s)}catch(c){if(c instanceof ZJ){let l=t[Z0s]();if(l===!1)throw new ZJ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(t5n(l,e))r.call(this,o,s);else throw new ZJ(`${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(ogs,"buildMockDispatch");function t5n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>MF(n,r.host)))}a(t5n,"checkNetConnect");function sgs(t){if(t){let{agent:e,...r}=t;return r}}a(sgs,"buildMockOptions");r5n.exports={getResponseData:KOn,getMockDispatch:JOn,addMockDispatch:ngs,deleteMockDispatch:Wer,buildKey:ZOn,generateKeyValues:zer,matchValue:MF,getResponse:igs,getStatusText:XOn,mockDispatch:e5n,buildMockDispatch:ogs,checkNetConnect:t5n,buildMockOptions:sgs,getHeaderByName:zOn,buildHeadersFromArray:Yer}});var rtr=I((Kef,ttr)=>{"use strict";p();var{getResponseData:ags,buildKey:cgs,addMockDispatch:Ker}=wke(),{kDispatches:Bnt,kDispatchKey:Fnt,kDefaultHeaders:Jer,kDefaultTrailers:Zer,kContentLength:Xer,kMockDispatch:Unt}=vfe(),{InvalidArgumentError:A5}=Ec(),{buildURL:lgs}=qs(),Cfe=class{static{a(this,"MockScope")}constructor(e){this[Unt]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new A5("waitInMs must be a valid integer > 0");return this[Unt].delay=e,this}persist(){return this[Unt].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new A5("repeatTimes must be a valid integer > 0");return this[Unt].times=e,this}},etr=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new A5("opts must be an object");if(typeof e.path>"u")throw new A5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=lgs(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[Fnt]=cgs(e),this[Bnt]=r,this[Jer]={},this[Zer]={},this[Xer]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=ags(r),s=this[Xer]?{"content-length":o.length}:{},c={...this[Jer],...s,...n.headers},l={...this[Zer],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new A5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new A5("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 A5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=Ker(this[Bnt],this[Fnt],s);return new Cfe(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=Ker(this[Bnt],this[Fnt],n);return new Cfe(o)}replyWithError(e){if(typeof e>"u")throw new A5("error must be defined");let r=Ker(this[Bnt],this[Fnt],{error:e});return new Cfe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new A5("headers must be defined");return this[Jer]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new A5("trailers must be defined");return this[Zer]=e,this}replyContentLength(){return this[Xer]=!0,this}};ttr.exports.MockInterceptor=etr;ttr.exports.MockScope=Cfe});var otr=I((Xef,l5n)=>{"use strict";p();var{promisify:ugs}=require("node:util"),dgs=dfe(),{buildMockDispatch:fgs}=wke(),{kDispatches:n5n,kMockAgent:i5n,kClose:o5n,kOriginalClose:s5n,kOrigin:a5n,kOriginalDispatch:pgs,kConnected:ntr}=vfe(),{MockInterceptor:hgs}=rtr(),c5n=jd(),{InvalidArgumentError:mgs}=Ec(),itr=class extends dgs{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new mgs("Argument opts.agent must implement Agent");this[i5n]=r.agent,this[a5n]=e,this[n5n]=[],this[ntr]=1,this[pgs]=this.dispatch,this[s5n]=this.close.bind(this),this.dispatch=fgs.call(this),this.close=this[o5n]}get[c5n.kConnected](){return this[ntr]}intercept(e){return new hgs(e,this[n5n])}async[o5n](){await ugs(this[s5n])(),this[ntr]=0,this[i5n][c5n.kClients].delete(this[a5n])}};l5n.exports=itr});var ctr=I((rtf,g5n)=>{"use strict";p();var{promisify:ggs}=require("node:util"),Ags=ffe(),{buildMockDispatch:ygs}=wke(),{kDispatches:u5n,kMockAgent:d5n,kClose:f5n,kOriginalClose:p5n,kOrigin:h5n,kOriginalDispatch:Egs,kConnected:str}=vfe(),{MockInterceptor:_gs}=rtr(),m5n=jd(),{InvalidArgumentError:vgs}=Ec(),atr=class extends Ags{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new vgs("Argument opts.agent must implement Agent");this[d5n]=r.agent,this[h5n]=e,this[u5n]=[],this[str]=1,this[Egs]=this.dispatch,this[p5n]=this.close.bind(this),this.dispatch=ygs.call(this),this.close=this[f5n]}get[m5n.kConnected](){return this[str]}intercept(e){return new _gs(e,this[u5n])}async[f5n](){await ggs(this[p5n])(),this[str]=0,this[d5n][m5n.kClients].delete(this[h5n])}};g5n.exports=atr});var y5n=I((stf,A5n)=>{"use strict";p();var Cgs={pronoun:"it",is:"is",was:"was",this:"this"},bgs={pronoun:"they",is:"are",was:"were",this:"these"};A5n.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?Cgs:bgs,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var _5n=I((utf,E5n)=>{"use strict";p();var{Transform:Sgs}=require("node:stream"),{Console:Tgs}=require("node:console"),Igs=process.versions.icu?"\u2705":"Y ",xgs=process.versions.icu?"\u274C":"N ";E5n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new Sgs({transform(r,n,o){o(null,r)}}),this.logger=new Tgs({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?Igs:xgs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var S5n=I((ptf,b5n)=>{"use strict";p();var{kClients:XJ}=jd(),wgs=pfe(),{kAgent:ltr,kMockAgentSet:Qnt,kMockAgentGet:v5n,kDispatches:utr,kIsMockActive:qnt,kNetConnect:eZ,kGetNetConnect:Rgs,kOptions:jnt,kFactory:Hnt}=vfe(),kgs=otr(),Pgs=ctr(),{matchValue:Dgs,buildMockOptions:Ngs}=wke(),{InvalidArgumentError:C5n,UndiciError:Mgs}=Ec(),Ogs=JRe(),Lgs=y5n(),Bgs=_5n(),dtr=class extends Ogs{static{a(this,"MockAgent")}constructor(e){if(super(e),this[eZ]=!0,this[qnt]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new C5n("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new wgs(e);this[ltr]=r,this[XJ]=r[XJ],this[jnt]=Ngs(e)}get(e){let r=this[v5n](e);return r||(r=this[Hnt](e),this[Qnt](e,r)),r}dispatch(e,r){return this.get(e.origin),this[ltr].dispatch(e,r)}async close(){await this[ltr].close(),this[XJ].clear()}deactivate(){this[qnt]=!1}activate(){this[qnt]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[eZ])?this[eZ].push(e):this[eZ]=[e];else if(typeof e>"u")this[eZ]=!0;else throw new C5n("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[eZ]=!1}get isMockActive(){return this[qnt]}[Qnt](e,r){this[XJ].set(e,r)}[Hnt](e){let r=Object.assign({agent:this},this[jnt]);return this[jnt]&&this[jnt].connections===1?new kgs(e,r):new Pgs(e,r)}[v5n](e){let r=this[XJ].get(e);if(r)return r;if(typeof e!="string"){let n=this[Hnt]("http://localhost:9999");return this[Qnt](e,n),n}for(let[n,o]of Array.from(this[XJ]))if(o&&typeof n!="string"&&Dgs(n,e)){let s=this[Hnt](e);return this[Qnt](e,s),s[utr]=o[utr],s}}[Rgs](){return this[eZ]}pendingInterceptors(){let e=this[XJ];return Array.from(e.entries()).flatMap(([r,n])=>n[utr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new Bgs}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new Lgs("interceptor","interceptors").pluralize(r.length);throw new Mgs(` ${n.count} ${n.noun} ${n.is} pending: ${e.format(r)} -`.trim())}};C5n.exports=utr});var qnt=I((ctf,x5n)=>{"use strict";p();var S5n=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Ngs}=Ec(),Mgs=pfe();I5n()===void 0&&T5n(new Mgs);function T5n(t){if(!t||typeof t.dispatch!="function")throw new Ngs("Argument agent must implement Agent");Object.defineProperty(globalThis,S5n,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(T5n,"setGlobalDispatcher");function I5n(){return globalThis[S5n]}a(I5n,"getGlobalDispatcher");x5n.exports={setGlobalDispatcher:T5n,getGlobalDispatcher:I5n}});var jnt=I((ftf,w5n)=>{"use strict";p();w5n.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 k5n=I((mtf,R5n)=>{"use strict";p();var Ogs=_nt();R5n.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 Ogs(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var D5n=I((ytf,P5n)=>{"use strict";p();var Lgs=Pnt();P5n.exports=t=>e=>a(function(n,o){return e(n,new Lgs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var M5n=I((vtf,N5n)=>{"use strict";p();var Bgs=qs(),{InvalidArgumentError:Fgs,RequestAbortedError:Ugs}=Ec(),Qgs=jnt(),dtr=class extends Qgs{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 Fgs("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=Bgs.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new Ugs(`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 qgs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new dtr({maxSize:s},o);return e(n,c)},"Intercept")}a(qgs,"createDumpInterceptor");N5n.exports=qgs});var B5n=I((Stf,L5n)=>{"use strict";p();var{isIP:jgs}=require("node:net"),{lookup:Hgs}=require("node:dns"),Ggs=jnt(),{InvalidArgumentError:bfe,InformationalError:$gs}=Ec(),O5n=Math.pow(2,31)-1,ftr=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 $gs("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){Hgs(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===O5n?(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===O5n?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 ptr(this,e,r)}},ptr=class extends Ggs{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}}};L5n.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new bfe("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new bfe("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new bfe("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new bfe("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new bfe("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new bfe("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 ftr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return jgs(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 tZ=I((xtf,G5n)=>{"use strict";p();var{kConstruct:Vgs}=jd(),{kEnumerableProperty:Sfe}=qs(),{iteratorMixin:Wgs,isValidHeaderName:Rke,isValidHeaderValue:U5n}=sT(),{webidl:$a}=qA(),htr=require("node:assert"),Hnt=require("node:util"),sm=Symbol("headers map"),lT=Symbol("headers map sorted");function F5n(t){return t===10||t===13||t===9||t===32}a(F5n,"isHTTPWhiteSpaceCharCode");function Q5n(t){let e=0,r=t.length;for(;r>e&&F5n(t.charCodeAt(r-1));)--r;for(;r>e&&F5n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(Q5n,"headerValueNormalize");function q5n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(q5n,"fill");function mtr(t,e,r){if(r=Q5n(r),Rke(e)){if(!U5n(r))throw $a.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw $a.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(H5n(t)==="immutable")throw new TypeError("immutable");return gtr(t).append(e,r,!1)}a(mtr,"appendHeader");function j5n(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[sm])r[n++]=[o,s],htr(s!==null);return r.sort(j5n)}}},A2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){$a.util.markAsUncloneable(this),e!==Vgs&&(this.#t=new Gnt,this.#e="none",e!==void 0&&(e=$a.converters.HeadersInit(e,"Headers contructor","init"),q5n(this,e)))}append(e,r){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=$a.converters.ByteString(e,n,"name"),r=$a.converters.ByteString(r,n,"value"),mtr(this,e,r)}delete(e){if($a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.delete"),e=$a.converters.ByteString(e,"Headers.delete","name"),!Rke(e))throw $a.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){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=$a.converters.ByteString(e,r,"name"),!Rke(e))throw $a.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=$a.converters.ByteString(e,r,"name"),!Rke(e))throw $a.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=$a.converters.ByteString(e,n,"name"),r=$a.converters.ByteString(r,n,"value"),r=Q5n(r),Rke(e)){if(!U5n(r))throw $a.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw $a.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){$a.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)):$a.converters["record"](t,e,r)}throw $a.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};G5n.exports={fill:q5n,compareHeaderName:j5n,Headers:A2,HeadersList:Gnt,getHeadersGuard:H5n,setHeadersGuard:zgs,setHeadersList:Ygs,getHeadersList:gtr}});var Pke=I((ktf,r4n)=>{"use strict";p();var{Headers:K5n,HeadersList:$5n,fill:Kgs,getHeadersGuard:Jgs,setHeadersGuard:J5n,setHeadersList:Z5n}=tZ(),{extractBody:V5n,cloneBody:Zgs,mixinBody:Xgs,hasFinalizationRegistry:X5n,streamRegistry:e4n,bodyUnusable:eAs}=ife(),Atr=qs(),W5n=require("node:util"),{kEnumerableProperty:uT}=Atr,{isValidReasonPhrase:tAs,isCancelled:rAs,isAborted:nAs,isBlobLike:iAs,serializeJavascriptValueToJSONString:oAs,isErrorLike:sAs,isomorphicEncode:aAs,environmentSettingsObject:cAs}=sT(),{redirectStatusSet:lAs,nullBodyStatus:uAs}=eke(),{kState:Gd,kHeaders:MF}=oj(),{webidl:ss}=qA(),{FormData:dAs}=ske(),{URLSerializer:z5n}=nb(),{kConstruct:Vnt}=jd(),ytr=require("node:assert"),{types:fAs}=require("node:util"),pAs=new TextEncoder("utf-8"),rZ=class t{static{a(this,"Response")}static error(){return kke(Wnt(),"immutable")}static json(e,r={}){ss.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ss.converters.ResponseInit(r));let n=pAs.encode(oAs(e)),o=V5n(n),s=kke(Tfe({}),"response");return Y5n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ss.argumentLengthCheck(arguments,1,"Response.redirect"),e=ss.converters.USVString(e),r=ss.converters["unsigned short"](r);let n;try{n=new URL(e,cAs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!lAs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=kke(Tfe({}),"immutable");o[Gd].status=r;let s=aAs(z5n(n));return o[Gd].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(ss.util.markAsUncloneable(this),e===Vnt)return;e!==null&&(e=ss.converters.BodyInit(e)),r=ss.converters.ResponseInit(r),this[Gd]=Tfe({}),this[MF]=new K5n(Vnt),J5n(this[MF],"response"),Z5n(this[MF],this[Gd].headersList);let n=null;if(e!=null){let[o,s]=V5n(e);n={body:o,type:s}}Y5n(this,r,n)}get type(){return ss.brandCheck(this,t),this[Gd].type}get url(){ss.brandCheck(this,t);let e=this[Gd].urlList,r=e[e.length-1]??null;return r===null?"":z5n(r,!0)}get redirected(){return ss.brandCheck(this,t),this[Gd].urlList.length>1}get status(){return ss.brandCheck(this,t),this[Gd].status}get ok(){return ss.brandCheck(this,t),this[Gd].status>=200&&this[Gd].status<=299}get statusText(){return ss.brandCheck(this,t),this[Gd].statusText}get headers(){return ss.brandCheck(this,t),this[MF]}get body(){return ss.brandCheck(this,t),this[Gd].body?this[Gd].body.stream:null}get bodyUsed(){return ss.brandCheck(this,t),!!this[Gd].body&&Atr.isDisturbed(this[Gd].body.stream)}clone(){if(ss.brandCheck(this,t),eAs(this))throw ss.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=Etr(this[Gd]);return X5n&&this[Gd].body?.stream&&e4n.register(this,new WeakRef(this[Gd].body.stream)),kke(e,Jgs(this[MF]))}[W5n.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 ${W5n.formatWithOptions(r,n)}`}};Xgs(rZ);Object.defineProperties(rZ.prototype,{type:uT,url:uT,status:uT,ok:uT,redirected:uT,statusText:uT,headers:uT,clone:uT,body:uT,bodyUsed:uT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(rZ,{json:uT,redirect:uT,error:uT});function Etr(t){if(t.internalResponse)return t4n(Etr(t.internalResponse),t.type);let e=Tfe({...t,body:null});return t.body!=null&&(e.body=Zgs(e,t.body)),e}a(Etr,"cloneResponse");function Tfe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new $5n(t?.headersList):new $5n,urlList:t?.urlList?[...t.urlList]:[]}}a(Tfe,"makeResponse");function Wnt(t){let e=sAs(t);return Tfe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Wnt,"makeNetworkError");function hAs(t){return t.type==="error"&&t.status===0}a(hAs,"isNetworkError");function $nt(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 ytr(!(n in e)),r[n]=o,!0}})}a($nt,"makeFilteredResponse");function t4n(t,e){if(e==="basic")return $nt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return $nt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return $nt(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return $nt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});ytr(!1)}a(t4n,"filterResponse");function mAs(t,e=null){return ytr(rAs(t)),nAs(t)?Wnt(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Wnt(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(mAs,"makeAppropriateNetworkError");function Y5n(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&&!tAs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Gd].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Gd].statusText=e.statusText),"headers"in e&&e.headers!=null&&Kgs(t[MF],e.headers),r){if(uAs.includes(t.status))throw ss.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Gd].body=r.body,r.type!=null&&!t[Gd].headersList.contains("content-type",!0)&&t[Gd].headersList.append("content-type",r.type,!0)}}a(Y5n,"initializeResponse");function kke(t,e){let r=new rZ(Vnt);return r[Gd]=t,r[MF]=new K5n(Vnt),Z5n(r[MF],t.headersList),J5n(r[MF],e),X5n&&t.body?.stream&&e4n.register(r,new WeakRef(t.body.stream)),r}a(kke,"fromInnerResponse");ss.converters.ReadableStream=ss.interfaceConverter(ReadableStream);ss.converters.FormData=ss.interfaceConverter(dAs);ss.converters.URLSearchParams=ss.interfaceConverter(URLSearchParams);ss.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ss.converters.USVString(t,e,r):iAs(t)?ss.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||fAs.isArrayBuffer(t)?ss.converters.BufferSource(t,e,r):Atr.isFormDataLike(t)?ss.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?ss.converters.URLSearchParams(t,e,r):ss.converters.DOMString(t,e,r)};ss.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?ss.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:ss.converters.XMLHttpRequestBodyInit(t,e,r)};ss.converters.ResponseInit=ss.dictionaryConverter([{key:"status",converter:ss.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ss.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ss.converters.HeadersInit}]);r4n.exports={isNetworkError:hAs,makeNetworkError:Wnt,makeResponse:Tfe,makeAppropriateNetworkError:mAs,filterResponse:t4n,Response:rZ,cloneResponse:Etr,fromInnerResponse:kke}});var s4n=I((Ntf,o4n)=>{"use strict";p();var{kConnected:n4n,kSize:i4n}=jd(),_tr=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[n4n]===0&&this.value[i4n]===0?void 0:this.value}},vtr=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[n4n]===0&&e[i4n]===0&&this.finalizer(r)})}unregister(e){}};o4n.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:_tr,FinalizationRegistry:vtr}):{WeakRef,FinalizationRegistry}}});var Ife=I((Ltf,v4n)=>{"use strict";p();var{extractBody:gAs,mixinBody:AAs,cloneBody:yAs,bodyUnusable:a4n}=ife(),{Headers:g4n,fill:EAs,HeadersList:Jnt,setHeadersGuard:btr,getHeadersGuard:_As,setHeadersList:A4n,getHeadersList:c4n}=tZ(),{FinalizationRegistry:vAs}=s4n()(),Ynt=qs(),l4n=require("node:util"),{isValidHTTPToken:CAs,sameOrigin:u4n,environmentSettingsObject:znt}=sT(),{forbiddenMethodsSet:bAs,corsSafeListedMethodsSet:SAs,referrerPolicy:TAs,requestRedirect:IAs,requestMode:xAs,requestCredentials:wAs,requestCache:RAs,requestDuplex:kAs}=eke(),{kEnumerableProperty:am,normalizedMethodRecordsBase:PAs,normalizedMethodRecords:DAs}=Ynt,{kHeaders:dT,kSignal:Knt,kState:sd,kDispatcher:Ctr}=oj(),{webidl:Gi}=qA(),{URLSerializer:NAs}=nb(),{kConstruct:Znt}=jd(),MAs=require("node:assert"),{getMaxListeners:d4n,setMaxListeners:f4n,getEventListeners:OAs,defaultMaxListeners:p4n}=require("node:events"),LAs=Symbol("abortController"),y4n=new vAs(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Xnt=new WeakMap;function h4n(t){return e;function e(){let r=t.deref();if(r!==void 0){y4n.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Xnt.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()}Xnt.delete(r.signal)}}}}a(h4n,"buildAbort");var m4n=!1,Aj=class t{static{a(this,"Request")}constructor(e,r={}){if(Gi.util.markAsUncloneable(this),e===Znt)return;let n="Request constructor";Gi.argumentLengthCheck(arguments,1,n),e=Gi.converters.RequestInfo(e,n,"input"),r=Gi.converters.RequestInit(r,n,"init");let o=null,s=null,c=znt.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[Ctr]=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=eit({urlList:[_]}),s="cors"}else this[Ctr]=r.dispatcher||e[Ctr],MAs(e instanceof t),o=e[sd],l=e[Knt];let u=znt.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&u4n(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=eit({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:znt.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 _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!u4n(v,znt.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 Gi.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 _=r.method,v=DAs[_];if(v!==void 0)o.method=v;else{if(!CAs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(bAs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=PAs[b]??_,o.method=_}!m4n&&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"}),m4n=!0)}r.signal!==void 0&&(l=r.signal),this[sd]=o;let m=new AbortController;if(this[Knt]=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[LAs]=m;let _=new WeakRef(m),v=h4n(_);try{(typeof d4n=="function"&&d4n(l)===p4n||OAs(l,"abort").length>=p4n)&&f4n(1500,l)}catch{}Ynt.addAbortListener(l,v),y4n.register(m,{signal:l,abort:v},v)}}if(this[dT]=new g4n(Znt),A4n(this[dT],o.headersList),btr(this[dT],"request"),h==="no-cors"){if(!SAs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);btr(this[dT],"request-no-cors")}if(f){let _=c4n(this[dT]),v=r.headers!==void 0?r.headers:new Jnt(_);if(_.clear(),v instanceof Jnt){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else EAs(this[dT],v)}let g=e instanceof t?e[sd].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[_,v]=gAs(r.body,o.keepalive);A=_,v&&!c4n(this[dT]).contains("content-type",!0)&&this[dT].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 E=y;if(A==null&&g!=null){if(a4n(e))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this[sd].body=E}get method(){return Gi.brandCheck(this,t),this[sd].method}get url(){return Gi.brandCheck(this,t),NAs(this[sd].url)}get headers(){return Gi.brandCheck(this,t),this[dT]}get destination(){return Gi.brandCheck(this,t),this[sd].destination}get referrer(){return Gi.brandCheck(this,t),this[sd].referrer==="no-referrer"?"":this[sd].referrer==="client"?"about:client":this[sd].referrer.toString()}get referrerPolicy(){return Gi.brandCheck(this,t),this[sd].referrerPolicy}get mode(){return Gi.brandCheck(this,t),this[sd].mode}get credentials(){return this[sd].credentials}get cache(){return Gi.brandCheck(this,t),this[sd].cache}get redirect(){return Gi.brandCheck(this,t),this[sd].redirect}get integrity(){return Gi.brandCheck(this,t),this[sd].integrity}get keepalive(){return Gi.brandCheck(this,t),this[sd].keepalive}get isReloadNavigation(){return Gi.brandCheck(this,t),this[sd].reloadNavigation}get isHistoryNavigation(){return Gi.brandCheck(this,t),this[sd].historyNavigation}get signal(){return Gi.brandCheck(this,t),this[Knt]}get body(){return Gi.brandCheck(this,t),this[sd].body?this[sd].body.stream:null}get bodyUsed(){return Gi.brandCheck(this,t),!!this[sd].body&&Ynt.isDisturbed(this[sd].body.stream)}get duplex(){return Gi.brandCheck(this,t),"half"}clone(){if(Gi.brandCheck(this,t),a4n(this))throw new TypeError("unusable");let e=E4n(this[sd]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Xnt.get(this.signal);n===void 0&&(n=new Set,Xnt.set(this.signal,n));let o=new WeakRef(r);n.add(o),Ynt.addAbortListener(r.signal,h4n(o))}return _4n(e,r.signal,_As(this[dT]))}[l4n.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 ${l4n.formatWithOptions(r,n)}`}};AAs(Aj);function eit(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 Jnt(t.headersList):new Jnt}}a(eit,"makeRequest");function E4n(t){let e=eit({...t,body:null});return t.body!=null&&(e.body=yAs(e,t.body)),e}a(E4n,"cloneRequest");function _4n(t,e,r){let n=new Aj(Znt);return n[sd]=t,n[Knt]=e,n[dT]=new g4n(Znt),A4n(n[dT],t.headersList),btr(n[dT],r),n}a(_4n,"fromInnerRequest");Object.defineProperties(Aj.prototype,{method:am,url:am,headers:am,redirect:am,clone:am,signal:am,duplex:am,destination:am,body:am,bodyUsed:am,isHistoryNavigation:am,isReloadNavigation:am,keepalive:am,integrity:am,cache:am,credentials:am,attribute:am,referrerPolicy:am,referrer:am,mode:am,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Gi.converters.Request=Gi.interfaceConverter(Aj);Gi.converters.RequestInfo=function(t,e,r){return typeof t=="string"?Gi.converters.USVString(t,e,r):t instanceof Aj?Gi.converters.Request(t,e,r):Gi.converters.USVString(t,e,r)};Gi.converters.AbortSignal=Gi.interfaceConverter(AbortSignal);Gi.converters.RequestInit=Gi.dictionaryConverter([{key:"method",converter:Gi.converters.ByteString},{key:"headers",converter:Gi.converters.HeadersInit},{key:"body",converter:Gi.nullableConverter(Gi.converters.BodyInit)},{key:"referrer",converter:Gi.converters.USVString},{key:"referrerPolicy",converter:Gi.converters.DOMString,allowedValues:TAs},{key:"mode",converter:Gi.converters.DOMString,allowedValues:xAs},{key:"credentials",converter:Gi.converters.DOMString,allowedValues:wAs},{key:"cache",converter:Gi.converters.DOMString,allowedValues:RAs},{key:"redirect",converter:Gi.converters.DOMString,allowedValues:IAs},{key:"integrity",converter:Gi.converters.DOMString},{key:"keepalive",converter:Gi.converters.boolean},{key:"signal",converter:Gi.nullableConverter(t=>Gi.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:Gi.converters.any},{key:"duplex",converter:Gi.converters.DOMString,allowedValues:kAs},{key:"dispatcher",converter:Gi.converters.any}]);v4n.exports={Request:Aj,makeRequest:eit,fromInnerRequest:_4n,cloneRequest:E4n}});var Nke=I((Utf,L4n)=>{"use strict";p();var{makeNetworkError:sl,makeAppropriateNetworkError:tit,filterResponse:Str,makeResponse:rit,fromInnerResponse:BAs}=Pke(),{HeadersList:C4n}=tZ(),{Request:FAs,cloneRequest:UAs}=Ife(),yj=require("node:zlib"),{bytesMatch:QAs,makePolicyContainer:qAs,clonePolicyContainer:jAs,requestBadPort:HAs,TAOCheck:GAs,appendRequestOriginHeader:$As,responseLocationURL:VAs,requestCurrentURL:y5,setRequestReferrerPolicyOnRedirect:WAs,tryUpgradeRequestToAPotentiallyTrustworthyURL:zAs,createOpaqueTimingInfo:Rtr,appendFetchMetadata:YAs,corsCheck:KAs,crossOriginResourcePolicyCheck:JAs,determineRequestsReferrer:ZAs,coarsenedSharedCurrentTime:Dke,createDeferredPromise:XAs,isBlobLike:eys,sameOrigin:wtr,isCancelled:nZ,isAborted:b4n,isErrorLike:tys,fullyReadBody:rys,readableStreamClose:nys,isomorphicEncode:nit,urlIsLocal:iys,urlIsHttpHttpsScheme:ktr,urlHasHttpsScheme:oys,clampAndCoarsenConnectionTimingInfo:sys,simpleRangeHeaderValue:ays,buildContentRange:cys,createInflate:lys,extractMimeType:uys}=sT(),{kState:x4n,kDispatcher:dys}=oj(),iZ=require("node:assert"),{safelyExtractBody:Ptr,extractBody:S4n}=ife(),{redirectStatusSet:w4n,nullBodyStatus:R4n,safeMethodsSet:fys,requestBodyHeader:pys,subresourceSet:hys}=eke(),mys=require("node:events"),{Readable:gys,pipeline:Ays,finished:yys}=require("node:stream"),{addAbortListener:Eys,isErrored:_ys,isReadable:iit,bufferToLowerCasedHeaderName:T4n}=qs(),{dataURLProcessor:vys,serializeAMimeType:Cys,minimizeSupportedMimeType:bys}=nb(),{getGlobalDispatcher:Sys}=qnt(),{webidl:Tys}=qA(),{STATUS_CODES:Iys}=require("node:http"),xys=["GET","HEAD"],wys=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",Ttr,oit=class extends mys{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 Rys(t){k4n(t,"fetch")}a(Rys,"handleFetchDone");function kys(t,e=void 0){Tys.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=XAs(),n;try{n=new FAs(t,e)}catch(f){return r.reject(f),r.promise}let o=n[x4n];if(n.signal.aborted)return Itr(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 Eys(n.signal,()=>{l=!0,iZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();Itr(r,o,f,n.signal.reason)}),u=D4n({request:o,processResponseEndOfBody:Rys,processResponse:a(f=>{if(!l){if(f.aborted){Itr(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(BAs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[dys]}),r.promise}a(kys,"fetch");function k4n(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;ktr(r)&&n!==null&&(t.timingAllowPassed||(n=Rtr({startTime:n.startTime}),o=""),n.endTime=Dke(),t.timingInfo=n,P4n(n,r.href,e,globalThis,o))}a(k4n,"finalizeAndReportTiming");var P4n=performance.markResourceTiming;function Itr(t,e,r,n){if(t&&t.reject(n),e.body!=null&&iit(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[x4n];o.body!=null&&iit(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(Itr,"abortFetch");function D4n({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=Sys()}){iZ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=Dke(d),h=Rtr({startTime:f}),m={controller:new oit(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return iZ(!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=jAs(t.client.policyContainer):t.policyContainer=qAs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,hys.has(t.destination),N4n(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(D4n,"fetching");async function N4n(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!iys(y5(r))&&(n=sl("local URLs only")),zAs(r),HAs(r)==="blocked"&&(n=sl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=ZAs(r)),n===null&&(n=await(async()=>{let s=y5(r);return wtr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await I4n(t)):r.mode==="same-origin"?sl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?sl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await I4n(t)):ktr(y5(r))?(r.responseTainting="cors",await M4n(t)):sl("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=Str(n,"basic"):r.responseTainting==="cors"?n=Str(n,"cors"):r.responseTainting==="opaque"?n=Str(n,"opaque"):iZ(!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=sl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||R4n.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>xtr(t,sl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!QAs(l,r.integrity)){s("integrity mismatch");return}n.body=Ptr(l)[0],xtr(t,n)},"processBody");await rys(n.body,c,s)}else xtr(t,n)}a(N4n,"mainFetch");function I4n(t){if(nZ(t)&&t.request.redirectCount===0)return Promise.resolve(tit(t));let{request:e}=t,{protocol:r}=y5(e);switch(r){case"about:":return Promise.resolve(sl("about scheme is not supported"));case"blob:":{Ttr||(Ttr=require("node:buffer").resolveObjectURL);let n=y5(e);if(n.search.length!==0)return Promise.resolve(sl("NetworkError when attempting to fetch resource."));let o=Ttr(n.toString());if(e.method!=="GET"||!eys(o))return Promise.resolve(sl("invalid method"));let s=rit(),c=o.size,l=nit(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=ays(d,!0);if(f==="failure")return Promise.resolve(sl("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(sl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=S4n(g);s.body=A[0];let y=nit(`${g.size}`),E=cys(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",E,!0)}else{let d=S4n(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=y5(e),o=vys(n);if(o==="failure")return Promise.resolve(sl("failed to fetch the data URL"));let s=Cys(o.mimeType);return Promise.resolve(rit({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Ptr(o.body)[0]}))}case"file:":return Promise.resolve(sl("not implemented... yet..."));case"http:":case"https:":return M4n(t).catch(n=>sl(n));default:return Promise.resolve(sl("unknown scheme"))}}a(I4n,"schemeFetch");function Pys(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(Pys,"finalizeResponse");function xtr(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=Rtr(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=uys(e.headersList);f!=="failure"&&(u.contentType=bys(f))}t.request.initiatorType!=null&&P4n(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():yys(o.body.stream,()=>{n()})}a(xtr,"fetchFinale");async function M4n(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 O4n(t),e.responseTainting==="cors"&&KAs(e,r)==="failure")return sl("cors failure");GAs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&JAs(e.origin,e.client,e.destination,n)==="blocked"?sl("blocked"):(w4n.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=sl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await Dys(t,r):iZ(!1)),r.timingInfo=o,r)}a(M4n,"httpFetch");function Dys(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=VAs(n,y5(r).hash),o==null)return e}catch(c){return Promise.resolve(sl(c))}if(!ktr(o))return Promise.resolve(sl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(sl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!wtr(r,o))return Promise.resolve(sl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(sl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(sl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!xys.includes(r.method)){r.method="GET",r.body=null;for(let c of pys)r.headersList.delete(c)}wtr(y5(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&&(iZ(r.body.source!=null),r.body=Ptr(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=Dke(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),WAs(r,n),N4n(t,!0)}a(Dys,"httpRedirectFetch");async function O4n(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=UAs(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=nit(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",nit(s.referrer.href),!0),$As(s),YAs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",wys),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)||(oys(y5(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 sl("only if cached");let m=await Nys(o,d,r);!fys.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"?sl():nZ(t)?tit(t):sl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(nZ(t))return tit(t);t.controller.connection.destroy(),c=await O4n(t,e,!0)}return c}a(O4n,"httpNetworkOrCacheFetch");async function Nys(t,e=!1,r=!1){iZ(!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*(_){nZ(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{nZ(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{nZ(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=rit({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=rit({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),tit(t,A)):sl(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{nZ(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:_,value:v}=await t.controller.next();if(b4n(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){nys(t.controller.controller),Pys(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),_ys(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){b4n(t)?(o.aborted=!0,iit(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):iit(h)&&t.controller.controller.error(new TypeError("terminated",{cause:tys(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=y5(n),E=t.controller.dispatcher;return new Promise((_,v)=>E.dispatch({path:y.pathname+y.search,origin:y.origin,method:n.method,body:E.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(b){let{connection:T}=t.controller;s.finalConnectionTimingInfo=sys(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),T.destroyed?b(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",b),this.abort=T.abort=b),s.finalNetworkRequestStartTime=Dke(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=Dke(t.crossOriginIsolatedCapability)},onHeaders(b,T,w,R){if(b<200)return;let x="",P=new C4n;for(let B=0;BM)return v(new Error(`too many content-encodings in response: ${q.length}, maximum allowed is ${M}`)),!0;for(let O=q.length-1;O>=0;--O){let j=q[O].trim();if(j==="x-gzip"||j==="gzip")D.push(yj.createGunzip({flush:yj.constants.Z_SYNC_FLUSH,finishFlush:yj.constants.Z_SYNC_FLUSH}));else if(j==="deflate")D.push(lys({flush:yj.constants.Z_SYNC_FLUSH,finishFlush:yj.constants.Z_SYNC_FLUSH}));else if(j==="br")D.push(yj.createBrotliDecompress({flush:yj.constants.BROTLI_OPERATION_FLUSH,finishFlush:yj.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let L=this.onError.bind(this);return _({status:b,statusText:R,headersList:P,body:D.length?Ays(this.body,...D,B=>{B&&this.onError(B)}).on("error",L):this.body.on("error",L)}),!0},onData(b){if(t.controller.dump)return;let T=b;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(b){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(b),t.controller.terminate(b),v(b)},onUpgrade(b,T,w){if(b!==101)return;let R=new C4n;for(let x=0;x{"use strict";p();B4n.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 U4n=I((Gtf,F4n)=>{"use strict";p();var{webidl:fT}=qA(),sit=Symbol("ProgressEvent state"),Ntr=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=fT.converters.DOMString(e,"ProgressEvent constructor","type"),r=fT.converters.ProgressEventInit(r??{}),super(e,r),this[sit]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return fT.brandCheck(this,t),this[sit].lengthComputable}get loaded(){return fT.brandCheck(this,t),this[sit].loaded}get total(){return fT.brandCheck(this,t),this[sit].total}};fT.converters.ProgressEventInit=fT.dictionaryConverter([{key:"lengthComputable",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:fT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:fT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);F4n.exports={ProgressEvent:Ntr}});var q4n=I((Wtf,Q4n)=>{"use strict";p();function Mys(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(Mys,"getEncoding");Q4n.exports={getEncoding:Mys}});var Y4n=I((Ktf,z4n)=>{"use strict";p();var{kState:xfe,kError:Mtr,kResult:j4n,kAborted:Mke,kLastProgressEventFired:Otr}=Dtr(),{ProgressEvent:Oys}=U4n(),{getEncoding:H4n}=q4n(),{serializeAMimeType:Lys,parseMIMEType:G4n}=nb(),{types:Bys}=require("node:util"),{StringDecoder:$4n}=require("string_decoder"),{btoa:V4n}=require("node:buffer"),Fys={enumerable:!0,writable:!1,configurable:!1};function Uys(t,e,r,n){if(t[xfe]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[xfe]="loading",t[j4n]=null,t[Mtr]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[Mke];)try{let{done:d,value:f}=await l;if(u&&!t[Mke]&&queueMicrotask(()=>{Ej("loadstart",t)}),u=!1,!d&&Bys.isUint8Array(f))c.push(f),(t[Otr]===void 0||Date.now()-t[Otr]>=50)&&!t[Mke]&&(t[Otr]=Date.now(),queueMicrotask(()=>{Ej("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[xfe]="done";try{let h=Qys(c,r,e.type,n);if(t[Mke])return;t[j4n]=h,Ej("load",t)}catch(h){t[Mtr]=h,Ej("error",t)}t[xfe]!=="loading"&&Ej("loadend",t)});break}}catch(d){if(t[Mke])return;queueMicrotask(()=>{t[xfe]="done",t[Mtr]=d,Ej("error",t),t[xfe]!=="loading"&&Ej("loadend",t)});break}})()}a(Uys,"readOperation");function Ej(t,e){let r=new Oys(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(Ej,"fireAProgressEvent");function Qys(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=G4n(r||"application/octet-stream");s!=="failure"&&(o+=Lys(s)),o+=";base64,";let c=new $4n("latin1");for(let l of t)o+=V4n(c.write(l));return o+=V4n(c.end()),o}case"Text":{let o="failure";if(n&&(o=H4n(n)),o==="failure"&&r){let s=G4n(r);s!=="failure"&&(o=H4n(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),qys(t,o)}case"ArrayBuffer":return W4n(t).buffer;case"BinaryString":{let o="",s=new $4n("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(Qys,"packageData");function qys(t,e){let r=W4n(t),n=jys(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(qys,"decode");function jys(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(jys,"BOMSniffing");function W4n(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(W4n,"combineByteSequences");z4n.exports={staticPropertyDescriptors:Fys,readOperation:Uys,fireAProgressEvent:Ej}});var X4n=I((Xtf,Z4n)=>{"use strict";p();var{staticPropertyDescriptors:wfe,readOperation:ait,fireAProgressEvent:K4n}=Y4n(),{kState:oZ,kError:J4n,kResult:cit,kEvents:wc,kAborted:Hys}=Dtr(),{webidl:wl}=qA(),{kEnumerableProperty:sb}=qs(),y2=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[oZ]="empty",this[cit]=null,this[J4n]=null,this[wc]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=wl.converters.Blob(e,{strict:!1}),ait(this,e,"ArrayBuffer")}readAsBinaryString(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=wl.converters.Blob(e,{strict:!1}),ait(this,e,"BinaryString")}readAsText(e,r=void 0){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=wl.converters.Blob(e,{strict:!1}),r!==void 0&&(r=wl.converters.DOMString(r,"FileReader.readAsText","encoding")),ait(this,e,"Text",r)}readAsDataURL(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=wl.converters.Blob(e,{strict:!1}),ait(this,e,"DataURL")}abort(){if(this[oZ]==="empty"||this[oZ]==="done"){this[cit]=null;return}this[oZ]==="loading"&&(this[oZ]="done",this[cit]=null),this[Hys]=!0,K4n("abort",this),this[oZ]!=="loading"&&K4n("loadend",this)}get readyState(){switch(wl.brandCheck(this,t),this[oZ]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return wl.brandCheck(this,t),this[cit]}get error(){return wl.brandCheck(this,t),this[J4n]}get onloadend(){return wl.brandCheck(this,t),this[wc].loadend}set onloadend(e){wl.brandCheck(this,t),this[wc].loadend&&this.removeEventListener("loadend",this[wc].loadend),typeof e=="function"?(this[wc].loadend=e,this.addEventListener("loadend",e)):this[wc].loadend=null}get onerror(){return wl.brandCheck(this,t),this[wc].error}set onerror(e){wl.brandCheck(this,t),this[wc].error&&this.removeEventListener("error",this[wc].error),typeof e=="function"?(this[wc].error=e,this.addEventListener("error",e)):this[wc].error=null}get onloadstart(){return wl.brandCheck(this,t),this[wc].loadstart}set onloadstart(e){wl.brandCheck(this,t),this[wc].loadstart&&this.removeEventListener("loadstart",this[wc].loadstart),typeof e=="function"?(this[wc].loadstart=e,this.addEventListener("loadstart",e)):this[wc].loadstart=null}get onprogress(){return wl.brandCheck(this,t),this[wc].progress}set onprogress(e){wl.brandCheck(this,t),this[wc].progress&&this.removeEventListener("progress",this[wc].progress),typeof e=="function"?(this[wc].progress=e,this.addEventListener("progress",e)):this[wc].progress=null}get onload(){return wl.brandCheck(this,t),this[wc].load}set onload(e){wl.brandCheck(this,t),this[wc].load&&this.removeEventListener("load",this[wc].load),typeof e=="function"?(this[wc].load=e,this.addEventListener("load",e)):this[wc].load=null}get onabort(){return wl.brandCheck(this,t),this[wc].abort}set onabort(e){wl.brandCheck(this,t),this[wc].abort&&this.removeEventListener("abort",this[wc].abort),typeof e=="function"?(this[wc].abort=e,this.addEventListener("abort",e)):this[wc].abort=null}};y2.EMPTY=y2.prototype.EMPTY=0;y2.LOADING=y2.prototype.LOADING=1;y2.DONE=y2.prototype.DONE=2;Object.defineProperties(y2.prototype,{EMPTY:wfe,LOADING:wfe,DONE:wfe,readAsArrayBuffer:sb,readAsBinaryString:sb,readAsText:sb,readAsDataURL:sb,abort:sb,readyState:sb,result:sb,error:sb,onloadstart:sb,onprogress:sb,onload:sb,onabort:sb,onerror:sb,onloadend:sb,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(y2,{EMPTY:wfe,LOADING:wfe,DONE:wfe});Z4n.exports={FileReader:y2}});var lit=I((rrf,eLn)=>{"use strict";p();eLn.exports={kConstruct:jd().kConstruct}});var nLn=I((irf,rLn)=>{"use strict";p();var Gys=require("node:assert"),{URLSerializer:tLn}=nb(),{isValidHeaderName:$ys}=sT();function Vys(t,e,r=!1){let n=tLn(t,r),o=tLn(e,r);return n===o}a(Vys,"urlEquals");function Wys(t){Gys(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),$ys(r)&&e.push(r);return e}a(Wys,"getFieldValues");rLn.exports={urlEquals:Vys,getFieldValues:Wys}});var sLn=I((arf,oLn)=>{"use strict";p();var{kConstruct:zys}=lit(),{urlEquals:Yys,getFieldValues:Ltr}=nLn(),{kEnumerableProperty:sZ,isDisturbed:Kys}=qs(),{webidl:vi}=qA(),{Response:Jys,cloneResponse:Zys,fromInnerResponse:Xys}=Pke(),{Request:OF,fromInnerRequest:eEs}=Ife(),{kState:E2}=oj(),{fetching:tEs}=Nke(),{urlIsHttpHttpsScheme:uit,createDeferredPromise:Rfe,readAllBytes:rEs}=sT(),Btr=require("node:assert"),dit=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==zys&&vi.illegalConstructor(),vi.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){vi.brandCheck(this,t);let n="Cache.match";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.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={}){vi.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){vi.brandCheck(this,t);let r="Cache.add";vi.argumentLengthCheck(arguments,1,r),e=vi.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){vi.brandCheck(this,t);let r="Cache.addAll";vi.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw vi.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=vi.converters.RequestInfo(m),typeof m=="string")continue;let g=m[E2];if(!uit(g.url)||g.method!=="GET")throw vi.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new OF(m)[E2];if(!uit(g.url))throw vi.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Rfe();s.push(tEs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(vi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=Ltr(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(vi.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=Rfe(),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){vi.brandCheck(this,t);let n="Cache.put";vi.argumentLengthCheck(arguments,2,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.Response(r,n,"response");let o=null;if(e instanceof OF?o=e[E2]:o=new OF(e)[E2],!uit(o.url)||o.method!=="GET")throw vi.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[E2];if(s.status===206)throw vi.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=Ltr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw vi.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(Kys(s.body.stream)||s.body.stream.locked))throw vi.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=Zys(s),l=Rfe();if(s.body!=null){let A=s.body.stream.getReader();rEs(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=Rfe(),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={}){vi.brandCheck(this,t);let n="Cache.delete";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof OF){if(o=e[E2],o.method!=="GET"&&!r.ignoreMethod)return!1}else Btr(typeof e=="string"),o=new OF(e)[E2];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Rfe(),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={}){vi.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof OF){if(o=e[E2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new OF(e)[E2]);let s=Rfe(),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=eEs(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 vi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw vi.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);Btr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!uit(u.url))throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw vi.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);Btr(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=""),!Yys(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Ltr(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 OF){if(o=e[E2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new OF(e)[E2]);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=Xys(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(dit.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:sZ,matchAll:sZ,add:sZ,addAll:sZ,put:sZ,delete:sZ,keys:sZ});var iLn=[{key:"ignoreSearch",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];vi.converters.CacheQueryOptions=vi.dictionaryConverter(iLn);vi.converters.MultiCacheQueryOptions=vi.dictionaryConverter([...iLn,{key:"cacheName",converter:vi.converters.DOMString}]);vi.converters.Response=vi.interfaceConverter(Jys);vi.converters["sequence"]=vi.sequenceConverter(vi.converters.RequestInfo);oLn.exports={Cache:dit}});var cLn=I((urf,aLn)=>{"use strict";p();var{kConstruct:Oke}=lit(),{Cache:fit}=sLn(),{webidl:_E}=qA(),{kEnumerableProperty:Lke}=qs(),pit=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==Oke&&_E.illegalConstructor(),_E.util.markAsUncloneable(this)}async match(e,r={}){if(_E.brandCheck(this,t),_E.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=_E.converters.RequestInfo(e),r=_E.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new fit(Oke,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new fit(Oke,n).match(e,r);if(s!==void 0)return s}}async has(e){_E.brandCheck(this,t);let r="CacheStorage.has";return _E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){_E.brandCheck(this,t);let r="CacheStorage.open";if(_E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new fit(Oke,o)}let n=[];return this.#e.set(e,n),new fit(Oke,n)}async delete(e){_E.brandCheck(this,t);let r="CacheStorage.delete";return _E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return _E.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(pit.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Lke,has:Lke,open:Lke,delete:Lke,keys:Lke});aLn.exports={CacheStorage:pit}});var uLn=I((prf,lLn)=>{"use strict";p();lLn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Ftr=I((mrf,mLn)=>{"use strict";p();function nEs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(nEs,"isCTLExcludingHtab");function dLn(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(dLn,"validateCookieName");function fLn(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(fLn,"validateCookieValue");function pLn(t){for(let e=0;ee.toString().padStart(2,"0"));function hLn(t){return typeof t=="number"&&(t=new Date(t)),`${oEs[t.getUTCDay()]}, ${hit[t.getUTCDate()]} ${sEs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${hit[t.getUTCHours()]}:${hit[t.getUTCMinutes()]}:${hit[t.getUTCSeconds()]} GMT`}a(hLn,"toIMFDate");function aEs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(aEs,"validateCookieMaxAge");function cEs(t){if(t.name.length===0)return null;dLn(t.name),fLn(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"&&(aEs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(iEs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(pLn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${hLn(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(cEs,"stringify");mLn.exports={isCTLExcludingHtab:nEs,validateCookieName:dLn,validateCookiePath:pLn,validateCookieValue:fLn,toIMFDate:hLn,stringify:cEs}});var ALn=I((yrf,gLn)=>{"use strict";p();var{maxNameValuePairSize:lEs,maxAttributeValueSize:uEs}=uLn(),{isCTLExcludingHtab:dEs}=Ftr(),{collectASequenceOfCodePointsFast:mit}=nb(),fEs=require("node:assert");function pEs(t){if(dEs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=mit(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=mit("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>lEs?null:{name:n,value:o,...kfe(r)}}a(pEs,"parseSetCookie");function kfe(t,e={}){if(t.length===0)return e;fEs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=mit(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=mit("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>uEs)return kfe(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 kfe(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 kfe(t,e)}a(kfe,"parseUnparsedAttributes");gLn.exports={parseSetCookie:pEs,parseUnparsedAttributes:kfe}});var _Ln=I((vrf,ELn)=>{"use strict";p();var{parseSetCookie:hEs}=ALn(),{stringify:mEs}=Ftr(),{webidl:pa}=qA(),{Headers:git}=tZ();function gEs(t){pa.argumentLengthCheck(arguments,1,"getCookies"),pa.brandCheck(t,git,{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(gEs,"getCookies");function AEs(t,e,r){pa.brandCheck(t,git,{strict:!1});let n="deleteCookie";pa.argumentLengthCheck(arguments,2,n),e=pa.converters.DOMString(e,n,"name"),r=pa.converters.DeleteCookieAttributes(r),yLn(t,{name:e,value:"",expires:new Date(0),...r})}a(AEs,"deleteCookie");function yEs(t){pa.argumentLengthCheck(arguments,1,"getSetCookies"),pa.brandCheck(t,git,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>hEs(r)):[]}a(yEs,"getSetCookies");function yLn(t,e){pa.argumentLengthCheck(arguments,2,"setCookie"),pa.brandCheck(t,git,{strict:!1}),e=pa.converters.Cookie(e);let r=mEs(e);r&&t.append("Set-Cookie",r)}a(yLn,"setCookie");pa.converters.DeleteCookieAttributes=pa.dictionaryConverter([{converter:pa.nullableConverter(pa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);pa.converters.Cookie=pa.dictionaryConverter([{converter:pa.converters.DOMString,key:"name"},{converter:pa.converters.DOMString,key:"value"},{converter:pa.nullableConverter(t=>typeof t=="number"?pa.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:pa.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:pa.sequenceConverter(pa.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);ELn.exports={getCookies:gEs,deleteCookie:AEs,getSetCookies:yEs,setCookie:yLn}});var Dfe=I((Srf,CLn)=>{"use strict";p();var{webidl:hi}=qA(),{kEnumerableProperty:ab}=qs(),{kConstruct:vLn}=jd(),{MessagePort:EEs}=require("node:worker_threads"),Pfe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===vLn){super(arguments[1],arguments[2]),hi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get data(){return hi.brandCheck(this,t),this.#e.data}get origin(){return hi.brandCheck(this,t),this.#e.origin}get lastEventId(){return hi.brandCheck(this,t),this.#e.lastEventId}get source(){return hi.brandCheck(this,t),this.#e.source}get ports(){return hi.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 hi.brandCheck(this,t),hi.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(vLn,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:_Es}=Pfe;delete Pfe.createFastMessageEvent;var Ait=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.CloseEventInit(r),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get wasClean(){return hi.brandCheck(this,t),this.#e.wasClean}get code(){return hi.brandCheck(this,t),this.#e.code}get reason(){return hi.brandCheck(this,t),this.#e.reason}},yit=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";hi.argumentLengthCheck(arguments,1,n),super(e,r),hi.util.markAsUncloneable(this),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return hi.brandCheck(this,t),this.#e.message}get filename(){return hi.brandCheck(this,t),this.#e.filename}get lineno(){return hi.brandCheck(this,t),this.#e.lineno}get colno(){return hi.brandCheck(this,t),this.#e.colno}get error(){return hi.brandCheck(this,t),this.#e.error}};Object.defineProperties(Pfe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:ab,origin:ab,lastEventId:ab,source:ab,ports:ab,initMessageEvent:ab});Object.defineProperties(Ait.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:ab,code:ab,wasClean:ab});Object.defineProperties(yit.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:ab,filename:ab,lineno:ab,colno:ab,error:ab});hi.converters.MessagePort=hi.interfaceConverter(EEs);hi.converters["sequence"]=hi.sequenceConverter(hi.converters.MessagePort);var Utr=[{key:"bubbles",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];hi.converters.MessageEventInit=hi.dictionaryConverter([...Utr,{key:"data",converter:hi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:hi.nullableConverter(hi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:hi.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);hi.converters.CloseEventInit=hi.dictionaryConverter([...Utr,{key:"wasClean",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:hi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);hi.converters.ErrorEventInit=hi.dictionaryConverter([...Utr,{key:"message",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:hi.converters.any}]);CLn.exports={MessageEvent:Pfe,CloseEvent:Ait,ErrorEvent:yit,createFastMessageEvent:_Es}});var aZ=I((xrf,bLn)=>{"use strict";p();var vEs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",CEs={enumerable:!0,writable:!1,configurable:!1},bEs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},SEs={NOT_SENT:0,PROCESSING:1,SENT:2},TEs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},IEs=2**16-1,xEs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},wEs=Buffer.allocUnsafe(0),REs={string:1,typedArray:2,arrayBuffer:3,blob:4};bLn.exports={uid:vEs,sentCloseFrameState:SEs,staticPropertyDescriptors:CEs,states:bEs,opcodes:TEs,maxUnsigned16Bit:IEs,parserStates:xEs,emptyBuffer:wEs,sendHints:REs}});var Bke=I((Rrf,SLn)=>{"use strict";p();SLn.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 Qke=I((Prf,NLn)=>{"use strict";p();var{kReadyState:Fke,kController:kEs,kResponse:PEs,kBinaryType:DEs,kWebSocketURL:NEs}=Bke(),{states:Uke,opcodes:_j}=aZ(),{ErrorEvent:MEs,createFastMessageEvent:OEs}=Dfe(),{isUtf8:LEs}=require("node:buffer"),{collectASequenceOfCodePointsFast:BEs,removeHTTPWhitespace:TLn}=nb();function FEs(t){return t[Fke]===Uke.CONNECTING}a(FEs,"isConnecting");function UEs(t){return t[Fke]===Uke.OPEN}a(UEs,"isEstablished");function QEs(t){return t[Fke]===Uke.CLOSING}a(QEs,"isClosing");function qEs(t){return t[Fke]===Uke.CLOSED}a(qEs,"isClosed");function Qtr(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(Qtr,"fireEvent");function jEs(t,e,r){if(t[Fke]!==Uke.OPEN)return;let n;if(e===_j.TEXT)try{n=DLn(r)}catch{xLn(t,"Received invalid UTF-8 in text frame.");return}else e===_j.BINARY&&(t[DEs]==="blob"?n=new Blob([r]):n=HEs(r));Qtr("message",t,OEs,{origin:t[NEs].origin,data:n})}a(jEs,"websocketMessageReceived");function HEs(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(HEs,"toArrayBuffer");function GEs(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(GEs,"isValidSubprotocol");function $Es(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a($Es,"isValidStatusCode");function xLn(t,e){let{[kEs]:r,[PEs]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&Qtr("error",t,(o,s)=>new MEs(o,s),{error:new Error(e),message:e})}a(xLn,"failWebsocketConnection");function wLn(t){return t===_j.CLOSE||t===_j.PING||t===_j.PONG}a(wLn,"isControlFrame");function RLn(t){return t===_j.CONTINUATION}a(RLn,"isContinuationFrame");function kLn(t){return t===_j.TEXT||t===_j.BINARY}a(kLn,"isTextBinaryFrame");function VEs(t){return kLn(t)||RLn(t)||wLn(t)}a(VEs,"isValidOpcode");function WEs(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(zEs,"isValidClientWindowBits");var PLn=typeof process.versions.icu=="string",ILn=PLn?new TextDecoder("utf-8",{fatal:!0}):void 0,DLn=PLn?ILn.decode.bind(ILn):function(t){if(LEs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};NLn.exports={isConnecting:FEs,isEstablished:UEs,isClosing:QEs,isClosed:qEs,fireEvent:Qtr,isValidSubprotocol:GEs,isValidStatusCode:$Es,failWebsocketConnection:xLn,websocketMessageReceived:jEs,utf8Decode:DLn,isControlFrame:wLn,isContinuationFrame:RLn,isTextBinaryFrame:kLn,isValidOpcode:VEs,parseExtensions:WEs,isValidClientWindowBits:zEs}});var _it=I((Mrf,MLn)=>{"use strict";p();var{maxUnsigned16Bit:YEs}=aZ(),Eit=16386,qtr,qke=null,Nfe=Eit;try{qtr=require("node:crypto")}catch{qtr={randomFillSync:a(function(e,r,n){for(let o=0;oYEs?(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:JEs,states:jke,sentCloseFrameState:vit,emptyBuffer:ZEs,opcodes:XEs}=aZ(),{kReadyState:Hke,kSentClose:Cit,kByteParser:LLn,kReceivedClose:OLn,kResponse:BLn}=Bke(),{fireEvent:e_s,failWebsocketConnection:vj,isClosing:t_s,isClosed:r_s,isEstablished:n_s,parseExtensions:i_s}=Qke(),{channels:Mfe}=$de(),{CloseEvent:o_s}=Dfe(),{makeRequest:s_s}=Ife(),{fetching:a_s}=Nke(),{Headers:c_s,getHeadersList:l_s}=tZ(),{getDecodeSplit:u_s}=sT(),{WebsocketFrameSend:d_s}=_it(),Htr;try{Htr=require("node:crypto")}catch{}function f_s(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=s_s({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=l_s(new c_s(s.headers));l.headersList=h}let u=Htr.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"),a_s({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){vj(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){vj(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){vj(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){vj(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=Htr.createHash("sha1").update(u+JEs).digest("base64");if(m!==g){vj(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=i_s(A),!y.has("permessage-deflate"))){vj(n,"Sec-WebSocket-Extensions header does not match.");return}let E=h.headersList.get("Sec-WebSocket-Protocol");if(E!==null&&!u_s("sec-websocket-protocol",l.headersList).includes(E)){vj(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",FLn),h.socket.on("close",ULn),h.socket.on("error",QLn),Mfe.open.hasSubscribers&&Mfe.open.publish({address:h.socket.address(),protocol:E,extensions:A}),o(h,y)}})}a(f_s,"establishWebSocketConnection");function p_s(t,e,r,n){if(!(t_s(t)||r_s(t)))if(!n_s(t))vj(t,"Connection was closed before it was established."),t[Hke]=jke.CLOSING;else if(t[Cit]===vit.NOT_SENT){t[Cit]=vit.PROCESSING;let o=new d_s;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=ZEs,t[BLn].socket.write(o.createFrame(XEs.CLOSE)),t[Cit]=vit.SENT,t[Hke]=jke.CLOSING}else t[Hke]=jke.CLOSING}a(p_s,"closeWebSocketConnection");function FLn(t){this.ws[LLn].write(t)||this.pause()}a(FLn,"onSocketData");function ULn(){let{ws:t}=this,{[BLn]:e}=t;e.socket.off("data",FLn),e.socket.off("close",ULn),e.socket.off("error",QLn);let r=t[Cit]===vit.SENT&&t[OLn],n=1005,o="",s=t[LLn].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[OLn]||(n=1006),t[Hke]=jke.CLOSED,e_s("close",t,(c,l)=>new o_s(c,l),{wasClean:r,code:n,reason:o}),Mfe.close.hasSubscribers&&Mfe.close.publish({websocket:t,code:n,reason:o})}a(ULn,"onSocketClose");function QLn(t){let{ws:e}=this;e[Hke]=jke.CLOSING,Mfe.socketError.hasSubscribers&&Mfe.socketError.publish(t),this.destroy()}a(QLn,"onSocketError");qLn.exports={establishWebSocketConnection:f_s,closeWebSocketConnection:p_s}});var GLn=I((Qrf,HLn)=>{"use strict";p();var{createInflateRaw:h_s,Z_DEFAULT_WINDOWBITS:m_s}=require("node:zlib"),{isValidClientWindowBits:g_s}=Qke(),{MessageSizeExceededError:jLn}=Ec(),A_s=Buffer.from([0,0,255,255]),bit=Symbol("kBuffer"),Gke=Symbol("kLength"),y_s=4*1024*1024,$tr=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 jLn);return}if(!this.#e){let o=m_s;if(this.#t.serverMaxWindowBits){if(!g_s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=h_s({windowBits:o})}catch(s){n(s);return}this.#e[bit]=[],this.#e[Gke]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[Gke]+=s.length,this.#e[Gke]>y_s){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new jLn)}return}this.#e[bit].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(A_s),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[bit],this.#e[Gke]);this.#e[bit].length=0,this.#e[Gke]=0,this.#n=null,n(null,o)})}};HLn.exports={PerMessageDeflate:$tr}});var eBn=I((Hrf,XLn)=>{"use strict";p();var{Writable:E_s}=require("node:stream"),__s=require("node:assert"),{parserStates:cb,opcodes:Ofe,states:v_s,emptyBuffer:$Ln,sentCloseFrameState:VLn}=aZ(),{kReadyState:C_s,kSentClose:WLn,kResponse:zLn,kReceivedClose:YLn}=Bke(),{channels:Sit}=$de(),{isValidStatusCode:b_s,isValidOpcode:S_s,failWebsocketConnection:pT,websocketMessageReceived:KLn,utf8Decode:T_s,isControlFrame:JLn,isTextBinaryFrame:Vtr,isContinuationFrame:I_s}=Qke(),{WebsocketFrameSend:ZLn}=_it(),{closeWebSocketConnection:x_s}=Gtr(),{PerMessageDeflate:w_s}=GLn(),Wtr=class extends E_s{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=cb.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 w_s(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===cb.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!==Ofe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!S_s(o))return pT(this.ws,"Invalid opcode received"),e();if(s)return pT(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){pT(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){pT(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Vtr(o)){pT(this.ws,"Invalid frame type was fragmented.");return}if(Vtr(o)&&this.#o.length>0){pT(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){pT(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&JLn(o)){pT(this.ws,"Control frame either too large or fragmented");return}if(I_s(o)&&this.#o.length===0&&!this.#i.compressed){pT(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=cb.READ_DATA):l===126?this.#n=cb.PAYLOADLENGTH_16:l===127&&(this.#n=cb.PAYLOADLENGTH_64),Vtr(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===cb.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=cb.READ_DATA}else if(this.#n===cb.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){pT(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=cb.READ_DATA}else if(this.#n===cb.READ_DATA){if(this.#t{if(n){pT(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=cb.INFO,this.#r=!0,this.run(e);return}KLn(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=cb.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);KLn(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=cb.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return $Ln;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){__s(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!b_s(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=T_s(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===Ofe.CLOSE){if(n===1)return pT(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 x_s(this.ws,o,s,s.length),pT(this.ws,s),!1}if(this.ws[WLn]!==VLn.SENT){let o=$Ln;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new ZLn(o);this.ws[zLn].socket.write(s.createFrame(Ofe.CLOSE),c=>{c||(this.ws[WLn]=VLn.SENT)})}return this.ws[C_s]=v_s.CLOSING,this.ws[YLn]=!0,!1}else if(r===Ofe.PING){if(!this.ws[YLn]){let o=new ZLn(e);this.ws[zLn].socket.write(o.createFrame(Ofe.PONG)),Sit.ping.hasSubscribers&&Sit.ping.publish({payload:e})}}else r===Ofe.PONG&&Sit.pong.hasSubscribers&&Sit.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};XLn.exports={ByteParser:Wtr}});var oBn=I((Vrf,iBn)=>{"use strict";p();var{WebsocketFrameSend:R_s}=_it(),{opcodes:tBn,sendHints:Lfe}=aZ(),k_s=ner(),rBn=Buffer[Symbol.species],ztr=class{static{a(this,"SendQueue")}#e=new k_s;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==Lfe.blob){let s=nBn(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=nBn(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 nBn(t,e){return new R_s(P_s(t,e)).createFrame(e===Lfe.string?tBn.TEXT:tBn.BINARY)}a(nBn,"createFrame");function P_s(t,e){switch(e){case Lfe.string:return Buffer.from(t);case Lfe.arrayBuffer:case Lfe.blob:return new rBn(t);case Lfe.typedArray:return new rBn(t.buffer,t.byteOffset,t.byteLength)}}a(P_s,"toBuffer");iBn.exports={SendQueue:ztr}});var hBn=I((Yrf,pBn)=>{"use strict";p();var{webidl:so}=qA(),{URLSerializer:D_s}=nb(),{environmentSettingsObject:sBn}=sT(),{staticPropertyDescriptors:Cj,states:$ke,sentCloseFrameState:N_s,sendHints:Tit}=aZ(),{kWebSocketURL:aBn,kReadyState:Ytr,kController:M_s,kBinaryType:Iit,kResponse:cBn,kSentClose:O_s,kByteParser:L_s}=Bke(),{isConnecting:B_s,isEstablished:F_s,isClosing:U_s,isValidSubprotocol:Q_s,fireEvent:lBn}=Qke(),{establishWebSocketConnection:q_s,closeWebSocketConnection:uBn}=Gtr(),{ByteParser:j_s}=eBn(),{kEnumerableProperty:Iw,isBlobLike:dBn}=qs(),{getGlobalDispatcher:H_s}=qnt(),{types:fBn}=require("node:util"),{ErrorEvent:G_s,CloseEvent:$_s}=Dfe(),{SendQueue:V_s}=oBn(),hT=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(),so.util.markAsUncloneable(this);let n="WebSocket constructor";so.argumentLengthCheck(arguments,1,n);let o=so.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=so.converters.USVString(e,n,"url"),r=o.protocols;let s=sBn.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=>Q_s(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[aBn]=new URL(c.href);let l=sBn.settingsObject;this[M_s]=q_s(c,r,l,this,(u,d)=>this.#o(u,d),o),this[Ytr]=t.CONNECTING,this[O_s]=N_s.NOT_SENT,this[Iit]="blob"}close(e=void 0,r=void 0){so.brandCheck(this,t);let n="WebSocket.close";if(e!==void 0&&(e=so.converters["unsigned short"](e,n,"code",{clamp:!0})),r!==void 0&&(r=so.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");uBn(this,e,r,o)}send(e){so.brandCheck(this,t);let r="WebSocket.send";if(so.argumentLengthCheck(arguments,1,r),e=so.converters.WebSocketSendData(e,r,"data"),B_s(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!F_s(this)||U_s(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},Tit.string)}else fBn.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Tit.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Tit.typedArray)):dBn(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Tit.blob))}get readyState(){return so.brandCheck(this,t),this[Ytr]}get bufferedAmount(){return so.brandCheck(this,t),this.#t}get url(){return so.brandCheck(this,t),D_s(this[aBn])}get extensions(){return so.brandCheck(this,t),this.#n}get protocol(){return so.brandCheck(this,t),this.#r}get onopen(){return so.brandCheck(this,t),this.#e.open}set onopen(e){so.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 so.brandCheck(this,t),this.#e.error}set onerror(e){so.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 so.brandCheck(this,t),this.#e.close}set onclose(e){so.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 so.brandCheck(this,t),this.#e.message}set onmessage(e){so.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 so.brandCheck(this,t),this[Iit]}set binaryType(e){so.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[Iit]="blob":this[Iit]=e}#o(e,r){this[cBn]=e;let n=new j_s(this,r);n.on("drain",W_s),n.on("error",z_s.bind(this)),e.socket.ws=this,this[L_s]=n,this.#i=new V_s(e.socket),this[Ytr]=$ke.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),lBn("open",this)}};hT.CONNECTING=hT.prototype.CONNECTING=$ke.CONNECTING;hT.OPEN=hT.prototype.OPEN=$ke.OPEN;hT.CLOSING=hT.prototype.CLOSING=$ke.CLOSING;hT.CLOSED=hT.prototype.CLOSED=$ke.CLOSED;Object.defineProperties(hT.prototype,{CONNECTING:Cj,OPEN:Cj,CLOSING:Cj,CLOSED:Cj,url:Iw,readyState:Iw,bufferedAmount:Iw,onopen:Iw,onerror:Iw,onclose:Iw,close:Iw,onmessage:Iw,binaryType:Iw,send:Iw,extensions:Iw,protocol:Iw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(hT,{CONNECTING:Cj,OPEN:Cj,CLOSING:Cj,CLOSED:Cj});so.converters["sequence"]=so.sequenceConverter(so.converters.DOMString);so.converters["DOMString or sequence"]=function(t,e,r){return so.util.Type(t)==="Object"&&Symbol.iterator in t?so.converters["sequence"](t):so.converters.DOMString(t,e,r)};so.converters.WebSocketInit=so.dictionaryConverter([{key:"protocols",converter:so.converters["DOMString or sequence"],defaultValue:a(()=>new Array(0),"defaultValue")},{key:"dispatcher",converter:so.converters.any,defaultValue:a(()=>H_s(),"defaultValue")},{key:"headers",converter:so.nullableConverter(so.converters.HeadersInit)}]);so.converters["DOMString or sequence or WebSocketInit"]=function(t){return so.util.Type(t)==="Object"&&!(Symbol.iterator in t)?so.converters.WebSocketInit(t):{protocols:so.converters["DOMString or sequence"](t)}};so.converters.WebSocketSendData=function(t){if(so.util.Type(t)==="Object"){if(dBn(t))return so.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||fBn.isArrayBuffer(t))return so.converters.BufferSource(t)}return so.converters.USVString(t)};function W_s(){this.ws[cBn].socket.resume()}a(W_s,"onParserDrain");function z_s(t){let e,r;t instanceof $_s?(e=t.reason,r=t.code):e=t.message,lBn("error",this,()=>new G_s("error",{error:t,message:e})),uBn(this,r)}a(z_s,"onParserError");pBn.exports={WebSocket:hT}});var Ktr=I((Zrf,mBn)=>{"use strict";p();function Y_s(t){return t.indexOf("\0")===-1}a(Y_s,"isValidLastEventId");function K_s(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(K_s,"isASCIINumber");function J_s(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(J_s,"delay");mBn.exports={isValidLastEventId:Y_s,isASCIINumber:K_s,delay:J_s}});var EBn=I((tnf,yBn)=>{"use strict";p();var{Transform:Z_s}=require("node:stream"),{isASCIINumber:gBn,isValidLastEventId:ABn}=Ktr(),LF=[239,187,191],Jtr=10,xit=13,X_s=58,evs=32,Ztr=class extends Z_s{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]===LF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===LF[0]&&this.buffer[1]===LF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===LF[0]&&this.buffer[1]===LF[1]&&this.buffer[2]===LF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===LF[0]&&this.buffer[1]===LF[1]&&this.buffer[2]===LF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&gBn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&ABn(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}}};yBn.exports={EventSourceStream:Ztr}});var xBn=I((inf,IBn)=>{"use strict";p();var{pipeline:tvs}=require("node:stream"),{fetching:rvs}=Nke(),{makeRequest:nvs}=Ife(),{webidl:BF}=qA(),{EventSourceStream:ivs}=EBn(),{parseMIMEType:ovs}=nb(),{createFastMessageEvent:svs}=Dfe(),{isNetworkError:_Bn}=Pke(),{delay:avs}=Ktr(),{kEnumerableProperty:cZ}=qs(),{environmentSettingsObject:vBn}=sT(),CBn=!1,bBn=3e3,Vke=0,SBn=1,Wke=2,cvs="anonymous",lvs="use-credentials",Bfe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=Vke;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),BF.util.markAsUncloneable(this);let n="EventSource constructor";BF.argumentLengthCheck(arguments,1,n),CBn||(CBn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=BF.converters.USVString(e,n,"url"),r=BF.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:bBn};let o=vBn,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=cvs;r.withCredentials&&(c=lvs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=vBn.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=nvs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===Wke)return;this.#n=Vke;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{_Bn(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(_Bn(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?ovs(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=SBn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new ivs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(svs(u.type,u.options))},"push")});tvs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=rvs(e)}async#u(){this.#n!==Wke&&(this.#n=Vke,this.dispatchEvent(new Event("error")),await avs(this.#a.reconnectionTime),this.#n===Vke&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){BF.brandCheck(this,t),this.#n!==Wke&&(this.#n=Wke,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}},TBn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:Vke,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:SBn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:Wke,writable:!1}};Object.defineProperties(Bfe,TBn);Object.defineProperties(Bfe.prototype,TBn);Object.defineProperties(Bfe.prototype,{close:cZ,onerror:cZ,onmessage:cZ,onopen:cZ,readyState:cZ,url:cZ,withCredentials:cZ});BF.converters.EventSourceInitDict=BF.dictionaryConverter([{key:"withCredentials",converter:BF.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:BF.converters.any}]);IBn.exports={EventSource:Bfe,defaultReconnectionTime:bBn}});var PBn=I((anf,Ki)=>{"use strict";p();var uvs=dfe(),wBn=JRe(),dvs=ffe(),fvs=TMn(),pvs=pfe(),hvs=ber(),mvs=YMn(),gvs=tOn(),RBn=Ec(),Rit=qs(),{InvalidArgumentError:wit}=RBn,Ffe=qOn(),Avs=XRe(),yvs=itr(),Evs=b5n(),_vs=atr(),vvs=$er(),Cvs=Pnt(),{getGlobalDispatcher:kBn,setGlobalDispatcher:bvs}=qnt(),Svs=jnt(),Tvs=_nt(),Ivs=vnt();Object.assign(wBn.prototype,Ffe);Ki.exports.Dispatcher=wBn;Ki.exports.Client=uvs;Ki.exports.Pool=dvs;Ki.exports.BalancedPool=fvs;Ki.exports.Agent=pvs;Ki.exports.ProxyAgent=hvs;Ki.exports.EnvHttpProxyAgent=mvs;Ki.exports.RetryAgent=gvs;Ki.exports.RetryHandler=Cvs;Ki.exports.DecoratorHandler=Svs;Ki.exports.RedirectHandler=Tvs;Ki.exports.createRedirectInterceptor=Ivs;Ki.exports.interceptors={redirect:k5n(),retry:D5n(),dump:M5n(),dns:B5n()};Ki.exports.buildConnector=Avs;Ki.exports.errors=RBn;Ki.exports.util={parseHeaders:Rit.parseHeaders,headerNameToString:Rit.headerNameToString};function zke(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 wit("invalid url");if(r!=null&&typeof r!="object")throw new wit("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new wit("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Rit.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Rit.parseURL(e);let{agent:o,dispatcher:s=kBn()}=r;if(o)throw new wit("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(zke,"makeDispatcher");Ki.exports.setGlobalDispatcher=bvs;Ki.exports.getGlobalDispatcher=kBn;var xvs=Nke().fetch;Ki.exports.fetch=a(async function(e,r=void 0){try{return await xvs(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");Ki.exports.Headers=tZ().Headers;Ki.exports.Response=Pke().Response;Ki.exports.Request=Ife().Request;Ki.exports.FormData=ske().FormData;Ki.exports.File=globalThis.File??require("node:buffer").File;Ki.exports.FileReader=X4n().FileReader;var{setGlobalOrigin:wvs,getGlobalOrigin:Rvs}=SXt();Ki.exports.setGlobalOrigin=wvs;Ki.exports.getGlobalOrigin=Rvs;var{CacheStorage:kvs}=cLn(),{kConstruct:Pvs}=lit();Ki.exports.caches=new kvs(Pvs);var{deleteCookie:Dvs,getCookies:Nvs,getSetCookies:Mvs,setCookie:Ovs}=_Ln();Ki.exports.deleteCookie=Dvs;Ki.exports.getCookies=Nvs;Ki.exports.getSetCookies=Mvs;Ki.exports.setCookie=Ovs;var{parseMIMEType:Lvs,serializeAMimeType:Bvs}=nb();Ki.exports.parseMIMEType=Lvs;Ki.exports.serializeAMimeType=Bvs;var{CloseEvent:Fvs,ErrorEvent:Uvs,MessageEvent:Qvs}=Dfe();Ki.exports.WebSocket=hBn().WebSocket;Ki.exports.CloseEvent=Fvs;Ki.exports.ErrorEvent=Uvs;Ki.exports.MessageEvent=Qvs;Ki.exports.request=zke(Ffe.request);Ki.exports.stream=zke(Ffe.stream);Ki.exports.pipeline=zke(Ffe.pipeline);Ki.exports.connect=zke(Ffe.connect);Ki.exports.upgrade=zke(Ffe.upgrade);Ki.exports.MockClient=yvs;Ki.exports.MockPool=_vs;Ki.exports.MockAgent=Evs;Ki.exports.mockErrors=vvs;var{EventSource:qvs}=xBn();Ki.exports.EventSource=qvs});var As=I((unf,DBn)=>{p();DBn.exports={options:{usePureJavaScript:!1}}});var OBn=I((fnf,MBn)=>{p();var Xtr={};MBn.exports=Xtr;var NBn={};Xtr.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=jvs(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};Xtr.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=NBn[e];if(!r){r=NBn[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(jvs,"_encodeWithByteBuffer")});var ac=I((mnf,UBn)=>{p();var LBn=As(),BBn=OBn(),nt=UBn.exports=LBn.util=LBn.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 Yke(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(Yke,"_checkBitsParam");nt.ByteBuffer=trr;function trr(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;rHvs&&(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){Yke(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){Yke(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 Yke(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 bj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Sj=[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],FBn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";nt.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=bj.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=bj.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":bj.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:BBn.encode,decode:BBn.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+=bj.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=bj.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":bj.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,FBn,e)};nt.binary.base58.decode=function(t,e){return nt.binary.baseN.decode(t,FBn,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){kit($vs,arguments,o)};nt.getItem=function(t,e,r,n){return kit(Vvs,arguments,n)};nt.removeItem=function(t,e,r,n){kit(Wvs,arguments,n)};nt.clearItems=function(t,e,r){kit(zvs,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 Rg=As();ac();QBn.exports=Rg.cipher=Rg.cipher||{};Rg.cipher.algorithms=Rg.cipher.algorithms||{};Rg.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Rg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Rg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Rg.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Rg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Rg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Rg.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Rg.cipher.algorithms[t]=e};Rg.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Rg.cipher.algorithms?Rg.cipher.algorithms[t]:null};var irr=Rg.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)};irr.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=Rg.util.createBuffer(),this.output=t.output||Rg.util.createBuffer(),this.mode.start(e)};irr.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()};irr.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 srr=I((_nf,qBn)=>{p();var kg=As();ac();kg.cipher=kg.cipher||{};var Xs=qBn.exports=kg.cipher.modes=kg.cipher.modes||{};Xs.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)};Xs.ecb.prototype.start=function(t){};Xs.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)};Xs.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)};Xs.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=Dit(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Xs.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)};Xs.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=kg.util.createBuffer(),this._partialBytes=0};Xs.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Dit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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};Xs.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};Xs.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=kg.util.createBuffer(),this._partialBytes=0};Xs.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Dit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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};Xs.ofb.prototype.decrypt=Xs.ofb.prototype.encrypt;Xs.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=kg.util.createBuffer(),this._partialBytes=0};Xs.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Dit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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}Nit(this._inBlock)};Xs.ctr.prototype.decrypt=Xs.ctr.prototype.encrypt;Xs.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=kg.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Xs.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=kg.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=kg.util.createBuffer(t.additionalData):r=kg.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=kg.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(orr(n*8)))}this._inBlock=this._j0.slice(0),Nit(this._inBlock),this._partialBytes=0,r=kg.util.createBuffer(r),this._aDataLength=orr(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()])};Xs.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),Nit(this._inBlock)};Xs.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Nit(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)};Xs.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};Xs.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)};Xs.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=kg.util.createBuffer();for(var n=0;n{p();var Iu=As();Pit();srr();ac();$Bn.exports=Iu.aes=Iu.aes||{};Iu.aes.startEncrypting=function(t,e,r,n){var o=Mit({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};Iu.aes.createEncryptionCipher=function(t,e){return Mit({key:t,output:null,decrypt:!1,mode:e})};Iu.aes.startDecrypting=function(t,e,r,n){var o=Mit({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};Iu.aes.createDecryptionCipher=function(t,e){return Mit({key:t,output:null,decrypt:!0,mode:e})};Iu.aes.Algorithm=function(t,e){lrr||HBn();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return crr(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return crr(r._w,n,o,!0)},"decrypt")}}),r._init=!1};Iu.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=Iu.util.createBuffer(e);else if(Iu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Iu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,ov[r]=l,arr[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)lZ[h][r]=d,_2[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(HBn,"initialize");function GBn(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=Ufe*c,u=s;u>>16&255]<<24^ov[n>>>8&255]<<16^ov[n&255]<<8^ov[n>>>24]^jBn[o]<<24,o++):s>6&&u%s===4&&(n=ov[n>>>24]<<24^ov[n>>>16&255]<<16^ov[n>>>8&255]<<8^ov[n&255]),r[u]=r[u-s]^n;if(e){var d,f=_2[0],h=_2[1],m=_2[2],g=_2[3],A=r.slice(0);l=r.length;for(var u=0,y=l-Ufe;u>>24]]^h[ov[d>>>16&255]]^m[ov[d>>>8&255]]^g[ov[d&255]];r=A}return r}a(GBn,"_expandKey");function crr(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=_2[0],c=_2[1],l=_2[2],u=_2[3],d=arr):(s=lZ[0],c=lZ[1],l=lZ[2],u=lZ[3],d=ov);var f,h,m,g,A,y,E;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 _=3,v=1;v>>24]^c[h>>>16&255]^l[m>>>8&255]^u[g&255]^t[++_],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[++_],g=s[g>>>24]^c[f>>>16&255]^l[h>>>8&255]^u[m&255]^t[++_],f=A,h=y,m=E;r[0]=d[f>>>24]<<24^d[h>>>16&255]<<16^d[m>>>8&255]<<8^d[g&255]^t[++_],r[n?3:1]=d[h>>>24]<<24^d[m>>>16&255]<<16^d[g>>>8&255]<<8^d[f&255]^t[++_],r[2]=d[m>>>24]<<24^d[g>>>16&255]<<16^d[f>>>8&255]<<8^d[h&255]^t[++_],r[n?1:3]=d[g>>>24]<<24^d[f>>>16&255]<<16^d[h>>>8&255]<<8^d[m&255]^t[++_]}a(crr,"_updateBlock");function Mit(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Iu.cipher.createDecipher(r,t.key):n=Iu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Iu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(Mit,"_createCipher")});var Ij=I((Inf,VBn)=>{p();var Kke=As();Kke.pki=Kke.pki||{};var urr=VBn.exports=Kke.pki.oids=Kke.oids=Kke.oids||{};function ir(t,e){urr[t]=e,urr[e]=t}a(ir,"_IN");function Uc(t,e){urr[t]=e}a(Uc,"_I_");ir("1.2.840.113549.1.1.1","rsaEncryption");ir("1.2.840.113549.1.1.4","md5WithRSAEncryption");ir("1.2.840.113549.1.1.5","sha1WithRSAEncryption");ir("1.2.840.113549.1.1.7","RSAES-OAEP");ir("1.2.840.113549.1.1.8","mgf1");ir("1.2.840.113549.1.1.9","pSpecified");ir("1.2.840.113549.1.1.10","RSASSA-PSS");ir("1.2.840.113549.1.1.11","sha256WithRSAEncryption");ir("1.2.840.113549.1.1.12","sha384WithRSAEncryption");ir("1.2.840.113549.1.1.13","sha512WithRSAEncryption");ir("1.3.101.112","EdDSA25519");ir("1.2.840.10040.4.3","dsa-with-sha1");ir("1.3.14.3.2.7","desCBC");ir("1.3.14.3.2.26","sha1");ir("1.3.14.3.2.29","sha1WithRSASignature");ir("2.16.840.1.101.3.4.2.1","sha256");ir("2.16.840.1.101.3.4.2.2","sha384");ir("2.16.840.1.101.3.4.2.3","sha512");ir("2.16.840.1.101.3.4.2.4","sha224");ir("2.16.840.1.101.3.4.2.5","sha512-224");ir("2.16.840.1.101.3.4.2.6","sha512-256");ir("1.2.840.113549.2.2","md2");ir("1.2.840.113549.2.5","md5");ir("1.2.840.113549.1.7.1","data");ir("1.2.840.113549.1.7.2","signedData");ir("1.2.840.113549.1.7.3","envelopedData");ir("1.2.840.113549.1.7.4","signedAndEnvelopedData");ir("1.2.840.113549.1.7.5","digestedData");ir("1.2.840.113549.1.7.6","encryptedData");ir("1.2.840.113549.1.9.1","emailAddress");ir("1.2.840.113549.1.9.2","unstructuredName");ir("1.2.840.113549.1.9.3","contentType");ir("1.2.840.113549.1.9.4","messageDigest");ir("1.2.840.113549.1.9.5","signingTime");ir("1.2.840.113549.1.9.6","counterSignature");ir("1.2.840.113549.1.9.7","challengePassword");ir("1.2.840.113549.1.9.8","unstructuredAddress");ir("1.2.840.113549.1.9.14","extensionRequest");ir("1.2.840.113549.1.9.20","friendlyName");ir("1.2.840.113549.1.9.21","localKeyId");ir("1.2.840.113549.1.9.22.1","x509Certificate");ir("1.2.840.113549.1.12.10.1.1","keyBag");ir("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");ir("1.2.840.113549.1.12.10.1.3","certBag");ir("1.2.840.113549.1.12.10.1.4","crlBag");ir("1.2.840.113549.1.12.10.1.5","secretBag");ir("1.2.840.113549.1.12.10.1.6","safeContentsBag");ir("1.2.840.113549.1.5.13","pkcs5PBES2");ir("1.2.840.113549.1.5.12","pkcs5PBKDF2");ir("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");ir("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");ir("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");ir("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");ir("1.2.840.113549.2.7","hmacWithSHA1");ir("1.2.840.113549.2.8","hmacWithSHA224");ir("1.2.840.113549.2.9","hmacWithSHA256");ir("1.2.840.113549.2.10","hmacWithSHA384");ir("1.2.840.113549.2.11","hmacWithSHA512");ir("1.2.840.113549.3.7","des-EDE3-CBC");ir("2.16.840.1.101.3.4.1.2","aes128-CBC");ir("2.16.840.1.101.3.4.1.22","aes192-CBC");ir("2.16.840.1.101.3.4.1.42","aes256-CBC");ir("2.5.4.3","commonName");ir("2.5.4.4","surname");ir("2.5.4.5","serialNumber");ir("2.5.4.6","countryName");ir("2.5.4.7","localityName");ir("2.5.4.8","stateOrProvinceName");ir("2.5.4.9","streetAddress");ir("2.5.4.10","organizationName");ir("2.5.4.11","organizationalUnitName");ir("2.5.4.12","title");ir("2.5.4.13","description");ir("2.5.4.15","businessCategory");ir("2.5.4.17","postalCode");ir("2.5.4.42","givenName");ir("2.5.4.65","pseudonym");ir("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");ir("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");ir("2.16.840.1.113730.1.1","nsCertType");ir("2.16.840.1.113730.1.13","nsComment");Uc("2.5.29.1","authorityKeyIdentifier");Uc("2.5.29.2","keyAttributes");Uc("2.5.29.3","certificatePolicies");Uc("2.5.29.4","keyUsageRestriction");Uc("2.5.29.5","policyMapping");Uc("2.5.29.6","subtreesConstraint");Uc("2.5.29.7","subjectAltName");Uc("2.5.29.8","issuerAltName");Uc("2.5.29.9","subjectDirectoryAttributes");Uc("2.5.29.10","basicConstraints");Uc("2.5.29.11","nameConstraints");Uc("2.5.29.12","policyConstraints");Uc("2.5.29.13","basicConstraints");ir("2.5.29.14","subjectKeyIdentifier");ir("2.5.29.15","keyUsage");Uc("2.5.29.16","privateKeyUsagePeriod");ir("2.5.29.17","subjectAltName");ir("2.5.29.18","issuerAltName");ir("2.5.29.19","basicConstraints");Uc("2.5.29.20","cRLNumber");Uc("2.5.29.21","cRLReason");Uc("2.5.29.22","expirationDate");Uc("2.5.29.23","instructionCode");Uc("2.5.29.24","invalidityDate");Uc("2.5.29.25","cRLDistributionPoints");Uc("2.5.29.26","issuingDistributionPoint");Uc("2.5.29.27","deltaCRLIndicator");Uc("2.5.29.28","issuingDistributionPoint");Uc("2.5.29.29","certificateIssuer");Uc("2.5.29.30","nameConstraints");ir("2.5.29.31","cRLDistributionPoints");ir("2.5.29.32","certificatePolicies");Uc("2.5.29.33","policyMappings");Uc("2.5.29.34","policyConstraints");ir("2.5.29.35","authorityKeyIdentifier");Uc("2.5.29.36","policyConstraints");ir("2.5.29.37","extKeyUsage");Uc("2.5.29.46","freshestCRL");Uc("2.5.29.54","inhibitAnyPolicy");ir("1.3.6.1.4.1.11129.2.4.2","timestampList");ir("1.3.6.1.5.5.7.1.1","authorityInfoAccess");ir("1.3.6.1.5.5.7.3.1","serverAuth");ir("1.3.6.1.5.5.7.3.2","clientAuth");ir("1.3.6.1.5.5.7.3.3","codeSigning");ir("1.3.6.1.5.5.7.3.4","emailProtection");ir("1.3.6.1.5.5.7.3.8","timeStamping")});var v2=I((Rnf,zBn)=>{p();var ad=As();ac();Ij();var rn=zBn.exports=ad.asn1=ad.asn1||{};rn.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};rn.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};rn.maxDepth=256;rn.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(Jke,"_checkBufferLength");var Yvs=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;Jke(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");rn.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=rn.maxDepth),typeof t=="string"&&(t=ad.util.createBuffer(t));var r=t.length(),n=Oit(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 Oit(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;Jke(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=Yvs(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(Jke(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(Oit(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(Oit(t,u,r+1,n)),e-=o-t.length(),u-=o-t.length();if(f===void 0&&c===rn.Class.UNIVERSAL&&l===rn.Type.BITSTRING&&(h=t.bytes(u)),f===void 0&&n.decodeBitStrings&&c===rn.Class.UNIVERSAL&&l===rn.Type.BITSTRING&&u>1){var g=t.read,A=e,y=0;if(l===rn.Type.BITSTRING&&(Jke(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var E={strict:!0,decodeBitStrings:!0},_=Oit(t,e,r+1,E),v=o-t.length();e-=v,l==rn.Type.BITSTRING&&v++;var b=_.tagClass;v===u&&(b===rn.Class.UNIVERSAL||b===rn.Class.CONTEXT_SPECIFIC)&&(f=[_])}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===rn.Type.BMPSTRING)for(f="";u>0;u-=2)Jke(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 rn.create(c,l,m,f,T)}a(Oit,"_fromDer");rn.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=rn.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};rn.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};rn.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};rn.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};rn.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};rn.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};rn.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)};rn.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())}};b5n.exports=dtr});var Gnt=I((gtf,w5n)=>{"use strict";p();var T5n=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Fgs}=Ec(),Ugs=pfe();x5n()===void 0&&I5n(new Ugs);function I5n(t){if(!t||typeof t.dispatch!="function")throw new Fgs("Argument agent must implement Agent");Object.defineProperty(globalThis,T5n,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(I5n,"setGlobalDispatcher");function x5n(){return globalThis[T5n]}a(x5n,"getGlobalDispatcher");w5n.exports={setGlobalDispatcher:I5n,getGlobalDispatcher:x5n}});var $nt=I((_tf,R5n)=>{"use strict";p();R5n.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 P5n=I((btf,k5n)=>{"use strict";p();var Qgs=bnt();k5n.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 Qgs(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var N5n=I((Itf,D5n)=>{"use strict";p();var qgs=Mnt();D5n.exports=t=>e=>a(function(n,o){return e(n,new qgs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var O5n=I((Rtf,M5n)=>{"use strict";p();var jgs=qs(),{InvalidArgumentError:Hgs,RequestAbortedError:Ggs}=Ec(),$gs=$nt(),ftr=class extends $gs{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 Hgs("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=jgs.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new Ggs(`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 Vgs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new ftr({maxSize:s},o);return e(n,c)},"Intercept")}a(Vgs,"createDumpInterceptor");M5n.exports=Vgs});var F5n=I((Dtf,B5n)=>{"use strict";p();var{isIP:Wgs}=require("node:net"),{lookup:zgs}=require("node:dns"),Ygs=$nt(),{InvalidArgumentError:bfe,InformationalError:Kgs}=Ec(),L5n=Math.pow(2,31)-1,ptr=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 Kgs("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){zgs(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===L5n?(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===L5n?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 htr(this,e,r)}},htr=class extends Ygs{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}}};B5n.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new bfe("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new bfe("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new bfe("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new bfe("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new bfe("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new bfe("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 ptr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return Wgs(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 tZ=I((Otf,$5n)=>{"use strict";p();var{kConstruct:Jgs}=jd(),{kEnumerableProperty:Sfe}=qs(),{iteratorMixin:Zgs,isValidHeaderName:Rke,isValidHeaderValue:Q5n}=cT(),{webidl:$a}=qA(),mtr=require("node:assert"),Vnt=require("node:util"),sm=Symbol("headers map"),dT=Symbol("headers map sorted");function U5n(t){return t===10||t===13||t===9||t===32}a(U5n,"isHTTPWhiteSpaceCharCode");function q5n(t){let e=0,r=t.length;for(;r>e&&U5n(t.charCodeAt(r-1));)--r;for(;r>e&&U5n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(q5n,"headerValueNormalize");function j5n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(j5n,"fill");function gtr(t,e,r){if(r=q5n(r),Rke(e)){if(!Q5n(r))throw $a.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw $a.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(G5n(t)==="immutable")throw new TypeError("immutable");return Atr(t).append(e,r,!1)}a(gtr,"appendHeader");function H5n(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[sm])r[n++]=[o,s],mtr(s!==null);return r.sort(H5n)}}},y2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){$a.util.markAsUncloneable(this),e!==Jgs&&(this.#t=new Wnt,this.#e="none",e!==void 0&&(e=$a.converters.HeadersInit(e,"Headers contructor","init"),j5n(this,e)))}append(e,r){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=$a.converters.ByteString(e,n,"name"),r=$a.converters.ByteString(r,n,"value"),gtr(this,e,r)}delete(e){if($a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.delete"),e=$a.converters.ByteString(e,"Headers.delete","name"),!Rke(e))throw $a.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){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=$a.converters.ByteString(e,r,"name"),!Rke(e))throw $a.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=$a.converters.ByteString(e,r,"name"),!Rke(e))throw $a.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=$a.converters.ByteString(e,n,"name"),r=$a.converters.ByteString(r,n,"value"),r=q5n(r),Rke(e)){if(!Q5n(r))throw $a.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw $a.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){$a.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[dT](){if(this.#t[dT])return this.#t[dT];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[dT]=r;for(let o=0;o>"](t,e,r,n.bind(t)):$a.converters["record"](t,e,r)}throw $a.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};$5n.exports={fill:j5n,compareHeaderName:H5n,Headers:y2,HeadersList:Wnt,getHeadersGuard:G5n,setHeadersGuard:Xgs,setHeadersList:eAs,getHeadersList:Atr}});var Pke=I((Ftf,n4n)=>{"use strict";p();var{Headers:J5n,HeadersList:V5n,fill:tAs,getHeadersGuard:rAs,setHeadersGuard:Z5n,setHeadersList:X5n}=tZ(),{extractBody:W5n,cloneBody:nAs,mixinBody:iAs,hasFinalizationRegistry:e4n,streamRegistry:t4n,bodyUnusable:oAs}=ife(),ytr=qs(),z5n=require("node:util"),{kEnumerableProperty:fT}=ytr,{isValidReasonPhrase:sAs,isCancelled:aAs,isAborted:cAs,isBlobLike:lAs,serializeJavascriptValueToJSONString:uAs,isErrorLike:dAs,isomorphicEncode:fAs,environmentSettingsObject:pAs}=cT(),{redirectStatusSet:hAs,nullBodyStatus:mAs}=eke(),{kState:Gd,kHeaders:OF}=sj(),{webidl:ss}=qA(),{FormData:gAs}=ske(),{URLSerializer:Y5n}=nb(),{kConstruct:Ynt}=jd(),Etr=require("node:assert"),{types:AAs}=require("node:util"),yAs=new TextEncoder("utf-8"),rZ=class t{static{a(this,"Response")}static error(){return kke(Knt(),"immutable")}static json(e,r={}){ss.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ss.converters.ResponseInit(r));let n=yAs.encode(uAs(e)),o=W5n(n),s=kke(Tfe({}),"response");return K5n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ss.argumentLengthCheck(arguments,1,"Response.redirect"),e=ss.converters.USVString(e),r=ss.converters["unsigned short"](r);let n;try{n=new URL(e,pAs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!hAs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=kke(Tfe({}),"immutable");o[Gd].status=r;let s=fAs(Y5n(n));return o[Gd].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(ss.util.markAsUncloneable(this),e===Ynt)return;e!==null&&(e=ss.converters.BodyInit(e)),r=ss.converters.ResponseInit(r),this[Gd]=Tfe({}),this[OF]=new J5n(Ynt),Z5n(this[OF],"response"),X5n(this[OF],this[Gd].headersList);let n=null;if(e!=null){let[o,s]=W5n(e);n={body:o,type:s}}K5n(this,r,n)}get type(){return ss.brandCheck(this,t),this[Gd].type}get url(){ss.brandCheck(this,t);let e=this[Gd].urlList,r=e[e.length-1]??null;return r===null?"":Y5n(r,!0)}get redirected(){return ss.brandCheck(this,t),this[Gd].urlList.length>1}get status(){return ss.brandCheck(this,t),this[Gd].status}get ok(){return ss.brandCheck(this,t),this[Gd].status>=200&&this[Gd].status<=299}get statusText(){return ss.brandCheck(this,t),this[Gd].statusText}get headers(){return ss.brandCheck(this,t),this[OF]}get body(){return ss.brandCheck(this,t),this[Gd].body?this[Gd].body.stream:null}get bodyUsed(){return ss.brandCheck(this,t),!!this[Gd].body&&ytr.isDisturbed(this[Gd].body.stream)}clone(){if(ss.brandCheck(this,t),oAs(this))throw ss.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=_tr(this[Gd]);return e4n&&this[Gd].body?.stream&&t4n.register(this,new WeakRef(this[Gd].body.stream)),kke(e,rAs(this[OF]))}[z5n.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 ${z5n.formatWithOptions(r,n)}`}};iAs(rZ);Object.defineProperties(rZ.prototype,{type:fT,url:fT,status:fT,ok:fT,redirected:fT,statusText:fT,headers:fT,clone:fT,body:fT,bodyUsed:fT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(rZ,{json:fT,redirect:fT,error:fT});function _tr(t){if(t.internalResponse)return r4n(_tr(t.internalResponse),t.type);let e=Tfe({...t,body:null});return t.body!=null&&(e.body=nAs(e,t.body)),e}a(_tr,"cloneResponse");function Tfe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new V5n(t?.headersList):new V5n,urlList:t?.urlList?[...t.urlList]:[]}}a(Tfe,"makeResponse");function Knt(t){let e=dAs(t);return Tfe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Knt,"makeNetworkError");function EAs(t){return t.type==="error"&&t.status===0}a(EAs,"isNetworkError");function znt(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 Etr(!(n in e)),r[n]=o,!0}})}a(znt,"makeFilteredResponse");function r4n(t,e){if(e==="basic")return znt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return znt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return znt(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return znt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Etr(!1)}a(r4n,"filterResponse");function _As(t,e=null){return Etr(aAs(t)),cAs(t)?Knt(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Knt(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(_As,"makeAppropriateNetworkError");function K5n(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&&!sAs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Gd].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Gd].statusText=e.statusText),"headers"in e&&e.headers!=null&&tAs(t[OF],e.headers),r){if(mAs.includes(t.status))throw ss.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Gd].body=r.body,r.type!=null&&!t[Gd].headersList.contains("content-type",!0)&&t[Gd].headersList.append("content-type",r.type,!0)}}a(K5n,"initializeResponse");function kke(t,e){let r=new rZ(Ynt);return r[Gd]=t,r[OF]=new J5n(Ynt),X5n(r[OF],t.headersList),Z5n(r[OF],e),e4n&&t.body?.stream&&t4n.register(r,new WeakRef(t.body.stream)),r}a(kke,"fromInnerResponse");ss.converters.ReadableStream=ss.interfaceConverter(ReadableStream);ss.converters.FormData=ss.interfaceConverter(gAs);ss.converters.URLSearchParams=ss.interfaceConverter(URLSearchParams);ss.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ss.converters.USVString(t,e,r):lAs(t)?ss.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||AAs.isArrayBuffer(t)?ss.converters.BufferSource(t,e,r):ytr.isFormDataLike(t)?ss.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?ss.converters.URLSearchParams(t,e,r):ss.converters.DOMString(t,e,r)};ss.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?ss.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:ss.converters.XMLHttpRequestBodyInit(t,e,r)};ss.converters.ResponseInit=ss.dictionaryConverter([{key:"status",converter:ss.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ss.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ss.converters.HeadersInit}]);n4n.exports={isNetworkError:EAs,makeNetworkError:Knt,makeResponse:Tfe,makeAppropriateNetworkError:_As,filterResponse:r4n,Response:rZ,cloneResponse:_tr,fromInnerResponse:kke}});var a4n=I((qtf,s4n)=>{"use strict";p();var{kConnected:i4n,kSize:o4n}=jd(),vtr=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[i4n]===0&&this.value[o4n]===0?void 0:this.value}},Ctr=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[i4n]===0&&e[o4n]===0&&this.finalizer(r)})}unregister(e){}};s4n.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:vtr,FinalizationRegistry:Ctr}):{WeakRef,FinalizationRegistry}}});var Ife=I((Gtf,C4n)=>{"use strict";p();var{extractBody:vAs,mixinBody:CAs,cloneBody:bAs,bodyUnusable:c4n}=ife(),{Headers:A4n,fill:SAs,HeadersList:eit,setHeadersGuard:Str,getHeadersGuard:TAs,setHeadersList:y4n,getHeadersList:l4n}=tZ(),{FinalizationRegistry:IAs}=a4n()(),Znt=qs(),u4n=require("node:util"),{isValidHTTPToken:xAs,sameOrigin:d4n,environmentSettingsObject:Jnt}=cT(),{forbiddenMethodsSet:wAs,corsSafeListedMethodsSet:RAs,referrerPolicy:kAs,requestRedirect:PAs,requestMode:DAs,requestCredentials:NAs,requestCache:MAs,requestDuplex:OAs}=eke(),{kEnumerableProperty:am,normalizedMethodRecordsBase:LAs,normalizedMethodRecords:BAs}=Znt,{kHeaders:pT,kSignal:Xnt,kState:sd,kDispatcher:btr}=sj(),{webidl:Gi}=qA(),{URLSerializer:FAs}=nb(),{kConstruct:tit}=jd(),UAs=require("node:assert"),{getMaxListeners:f4n,setMaxListeners:p4n,getEventListeners:QAs,defaultMaxListeners:h4n}=require("node:events"),qAs=Symbol("abortController"),E4n=new IAs(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),rit=new WeakMap;function m4n(t){return e;function e(){let r=t.deref();if(r!==void 0){E4n.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=rit.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()}rit.delete(r.signal)}}}}a(m4n,"buildAbort");var g4n=!1,yj=class t{static{a(this,"Request")}constructor(e,r={}){if(Gi.util.markAsUncloneable(this),e===tit)return;let n="Request constructor";Gi.argumentLengthCheck(arguments,1,n),e=Gi.converters.RequestInfo(e,n,"input"),r=Gi.converters.RequestInit(r,n,"init");let o=null,s=null,c=Jnt.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[btr]=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=nit({urlList:[_]}),s="cors"}else this[btr]=r.dispatcher||e[btr],UAs(e instanceof t),o=e[sd],l=e[Xnt];let u=Jnt.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&d4n(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=nit({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Jnt.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 _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!d4n(v,Jnt.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 Gi.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 _=r.method,v=BAs[_];if(v!==void 0)o.method=v;else{if(!xAs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(wAs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=LAs[b]??_,o.method=_}!g4n&&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"}),g4n=!0)}r.signal!==void 0&&(l=r.signal),this[sd]=o;let m=new AbortController;if(this[Xnt]=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[qAs]=m;let _=new WeakRef(m),v=m4n(_);try{(typeof f4n=="function"&&f4n(l)===h4n||QAs(l,"abort").length>=h4n)&&p4n(1500,l)}catch{}Znt.addAbortListener(l,v),E4n.register(m,{signal:l,abort:v},v)}}if(this[pT]=new A4n(tit),y4n(this[pT],o.headersList),Str(this[pT],"request"),h==="no-cors"){if(!RAs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);Str(this[pT],"request-no-cors")}if(f){let _=l4n(this[pT]),v=r.headers!==void 0?r.headers:new eit(_);if(_.clear(),v instanceof eit){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else SAs(this[pT],v)}let g=e instanceof t?e[sd].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[_,v]=vAs(r.body,o.keepalive);A=_,v&&!l4n(this[pT]).contains("content-type",!0)&&this[pT].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 E=y;if(A==null&&g!=null){if(c4n(e))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this[sd].body=E}get method(){return Gi.brandCheck(this,t),this[sd].method}get url(){return Gi.brandCheck(this,t),FAs(this[sd].url)}get headers(){return Gi.brandCheck(this,t),this[pT]}get destination(){return Gi.brandCheck(this,t),this[sd].destination}get referrer(){return Gi.brandCheck(this,t),this[sd].referrer==="no-referrer"?"":this[sd].referrer==="client"?"about:client":this[sd].referrer.toString()}get referrerPolicy(){return Gi.brandCheck(this,t),this[sd].referrerPolicy}get mode(){return Gi.brandCheck(this,t),this[sd].mode}get credentials(){return this[sd].credentials}get cache(){return Gi.brandCheck(this,t),this[sd].cache}get redirect(){return Gi.brandCheck(this,t),this[sd].redirect}get integrity(){return Gi.brandCheck(this,t),this[sd].integrity}get keepalive(){return Gi.brandCheck(this,t),this[sd].keepalive}get isReloadNavigation(){return Gi.brandCheck(this,t),this[sd].reloadNavigation}get isHistoryNavigation(){return Gi.brandCheck(this,t),this[sd].historyNavigation}get signal(){return Gi.brandCheck(this,t),this[Xnt]}get body(){return Gi.brandCheck(this,t),this[sd].body?this[sd].body.stream:null}get bodyUsed(){return Gi.brandCheck(this,t),!!this[sd].body&&Znt.isDisturbed(this[sd].body.stream)}get duplex(){return Gi.brandCheck(this,t),"half"}clone(){if(Gi.brandCheck(this,t),c4n(this))throw new TypeError("unusable");let e=_4n(this[sd]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=rit.get(this.signal);n===void 0&&(n=new Set,rit.set(this.signal,n));let o=new WeakRef(r);n.add(o),Znt.addAbortListener(r.signal,m4n(o))}return v4n(e,r.signal,TAs(this[pT]))}[u4n.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 ${u4n.formatWithOptions(r,n)}`}};CAs(yj);function nit(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 eit(t.headersList):new eit}}a(nit,"makeRequest");function _4n(t){let e=nit({...t,body:null});return t.body!=null&&(e.body=bAs(e,t.body)),e}a(_4n,"cloneRequest");function v4n(t,e,r){let n=new yj(tit);return n[sd]=t,n[Xnt]=e,n[pT]=new A4n(tit),y4n(n[pT],t.headersList),Str(n[pT],r),n}a(v4n,"fromInnerRequest");Object.defineProperties(yj.prototype,{method:am,url:am,headers:am,redirect:am,clone:am,signal:am,duplex:am,destination:am,body:am,bodyUsed:am,isHistoryNavigation:am,isReloadNavigation:am,keepalive:am,integrity:am,cache:am,credentials:am,attribute:am,referrerPolicy:am,referrer:am,mode:am,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Gi.converters.Request=Gi.interfaceConverter(yj);Gi.converters.RequestInfo=function(t,e,r){return typeof t=="string"?Gi.converters.USVString(t,e,r):t instanceof yj?Gi.converters.Request(t,e,r):Gi.converters.USVString(t,e,r)};Gi.converters.AbortSignal=Gi.interfaceConverter(AbortSignal);Gi.converters.RequestInit=Gi.dictionaryConverter([{key:"method",converter:Gi.converters.ByteString},{key:"headers",converter:Gi.converters.HeadersInit},{key:"body",converter:Gi.nullableConverter(Gi.converters.BodyInit)},{key:"referrer",converter:Gi.converters.USVString},{key:"referrerPolicy",converter:Gi.converters.DOMString,allowedValues:kAs},{key:"mode",converter:Gi.converters.DOMString,allowedValues:DAs},{key:"credentials",converter:Gi.converters.DOMString,allowedValues:NAs},{key:"cache",converter:Gi.converters.DOMString,allowedValues:MAs},{key:"redirect",converter:Gi.converters.DOMString,allowedValues:PAs},{key:"integrity",converter:Gi.converters.DOMString},{key:"keepalive",converter:Gi.converters.boolean},{key:"signal",converter:Gi.nullableConverter(t=>Gi.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:Gi.converters.any},{key:"duplex",converter:Gi.converters.DOMString,allowedValues:OAs},{key:"dispatcher",converter:Gi.converters.any}]);C4n.exports={Request:yj,makeRequest:nit,fromInnerRequest:v4n,cloneRequest:_4n}});var Nke=I((Wtf,B4n)=>{"use strict";p();var{makeNetworkError:sl,makeAppropriateNetworkError:iit,filterResponse:Ttr,makeResponse:oit,fromInnerResponse:jAs}=Pke(),{HeadersList:b4n}=tZ(),{Request:HAs,cloneRequest:GAs}=Ife(),Ej=require("node:zlib"),{bytesMatch:$As,makePolicyContainer:VAs,clonePolicyContainer:WAs,requestBadPort:zAs,TAOCheck:YAs,appendRequestOriginHeader:KAs,responseLocationURL:JAs,requestCurrentURL:y5,setRequestReferrerPolicyOnRedirect:ZAs,tryUpgradeRequestToAPotentiallyTrustworthyURL:XAs,createOpaqueTimingInfo:ktr,appendFetchMetadata:eys,corsCheck:tys,crossOriginResourcePolicyCheck:rys,determineRequestsReferrer:nys,coarsenedSharedCurrentTime:Dke,createDeferredPromise:iys,isBlobLike:oys,sameOrigin:Rtr,isCancelled:nZ,isAborted:S4n,isErrorLike:sys,fullyReadBody:ays,readableStreamClose:cys,isomorphicEncode:sit,urlIsLocal:lys,urlIsHttpHttpsScheme:Ptr,urlHasHttpsScheme:uys,clampAndCoarsenConnectionTimingInfo:dys,simpleRangeHeaderValue:fys,buildContentRange:pys,createInflate:hys,extractMimeType:mys}=cT(),{kState:w4n,kDispatcher:gys}=sj(),iZ=require("node:assert"),{safelyExtractBody:Dtr,extractBody:T4n}=ife(),{redirectStatusSet:R4n,nullBodyStatus:k4n,safeMethodsSet:Ays,requestBodyHeader:yys,subresourceSet:Eys}=eke(),_ys=require("node:events"),{Readable:vys,pipeline:Cys,finished:bys}=require("node:stream"),{addAbortListener:Sys,isErrored:Tys,isReadable:ait,bufferToLowerCasedHeaderName:I4n}=qs(),{dataURLProcessor:Iys,serializeAMimeType:xys,minimizeSupportedMimeType:wys}=nb(),{getGlobalDispatcher:Rys}=Gnt(),{webidl:kys}=qA(),{STATUS_CODES:Pys}=require("node:http"),Dys=["GET","HEAD"],Nys=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",Itr,cit=class extends _ys{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 Mys(t){P4n(t,"fetch")}a(Mys,"handleFetchDone");function Oys(t,e=void 0){kys.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=iys(),n;try{n=new HAs(t,e)}catch(f){return r.reject(f),r.promise}let o=n[w4n];if(n.signal.aborted)return xtr(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 Sys(n.signal,()=>{l=!0,iZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();xtr(r,o,f,n.signal.reason)}),u=N4n({request:o,processResponseEndOfBody:Mys,processResponse:a(f=>{if(!l){if(f.aborted){xtr(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(jAs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[gys]}),r.promise}a(Oys,"fetch");function P4n(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;Ptr(r)&&n!==null&&(t.timingAllowPassed||(n=ktr({startTime:n.startTime}),o=""),n.endTime=Dke(),t.timingInfo=n,D4n(n,r.href,e,globalThis,o))}a(P4n,"finalizeAndReportTiming");var D4n=performance.markResourceTiming;function xtr(t,e,r,n){if(t&&t.reject(n),e.body!=null&&ait(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[w4n];o.body!=null&&ait(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(xtr,"abortFetch");function N4n({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=Rys()}){iZ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=Dke(d),h=ktr({startTime:f}),m={controller:new cit(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return iZ(!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=WAs(t.client.policyContainer):t.policyContainer=VAs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,Eys.has(t.destination),M4n(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(N4n,"fetching");async function M4n(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!lys(y5(r))&&(n=sl("local URLs only")),XAs(r),zAs(r)==="blocked"&&(n=sl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=nys(r)),n===null&&(n=await(async()=>{let s=y5(r);return Rtr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await x4n(t)):r.mode==="same-origin"?sl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?sl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await x4n(t)):Ptr(y5(r))?(r.responseTainting="cors",await O4n(t)):sl("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=Ttr(n,"basic"):r.responseTainting==="cors"?n=Ttr(n,"cors"):r.responseTainting==="opaque"?n=Ttr(n,"opaque"):iZ(!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=sl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||k4n.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>wtr(t,sl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!$As(l,r.integrity)){s("integrity mismatch");return}n.body=Dtr(l)[0],wtr(t,n)},"processBody");await ays(n.body,c,s)}else wtr(t,n)}a(M4n,"mainFetch");function x4n(t){if(nZ(t)&&t.request.redirectCount===0)return Promise.resolve(iit(t));let{request:e}=t,{protocol:r}=y5(e);switch(r){case"about:":return Promise.resolve(sl("about scheme is not supported"));case"blob:":{Itr||(Itr=require("node:buffer").resolveObjectURL);let n=y5(e);if(n.search.length!==0)return Promise.resolve(sl("NetworkError when attempting to fetch resource."));let o=Itr(n.toString());if(e.method!=="GET"||!oys(o))return Promise.resolve(sl("invalid method"));let s=oit(),c=o.size,l=sit(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=fys(d,!0);if(f==="failure")return Promise.resolve(sl("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(sl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=T4n(g);s.body=A[0];let y=sit(`${g.size}`),E=pys(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",E,!0)}else{let d=T4n(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=y5(e),o=Iys(n);if(o==="failure")return Promise.resolve(sl("failed to fetch the data URL"));let s=xys(o.mimeType);return Promise.resolve(oit({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Dtr(o.body)[0]}))}case"file:":return Promise.resolve(sl("not implemented... yet..."));case"http:":case"https:":return O4n(t).catch(n=>sl(n));default:return Promise.resolve(sl("unknown scheme"))}}a(x4n,"schemeFetch");function Lys(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(Lys,"finalizeResponse");function wtr(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=ktr(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=mys(e.headersList);f!=="failure"&&(u.contentType=wys(f))}t.request.initiatorType!=null&&D4n(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():bys(o.body.stream,()=>{n()})}a(wtr,"fetchFinale");async function O4n(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 L4n(t),e.responseTainting==="cors"&&tys(e,r)==="failure")return sl("cors failure");YAs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&rys(e.origin,e.client,e.destination,n)==="blocked"?sl("blocked"):(R4n.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=sl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await Bys(t,r):iZ(!1)),r.timingInfo=o,r)}a(O4n,"httpFetch");function Bys(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=JAs(n,y5(r).hash),o==null)return e}catch(c){return Promise.resolve(sl(c))}if(!Ptr(o))return Promise.resolve(sl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(sl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!Rtr(r,o))return Promise.resolve(sl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(sl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(sl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!Dys.includes(r.method)){r.method="GET",r.body=null;for(let c of yys)r.headersList.delete(c)}Rtr(y5(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&&(iZ(r.body.source!=null),r.body=Dtr(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=Dke(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),ZAs(r,n),M4n(t,!0)}a(Bys,"httpRedirectFetch");async function L4n(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=GAs(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=sit(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",sit(s.referrer.href),!0),KAs(s),eys(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",Nys),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)||(uys(y5(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 sl("only if cached");let m=await Fys(o,d,r);!Ays.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"?sl():nZ(t)?iit(t):sl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(nZ(t))return iit(t);t.controller.connection.destroy(),c=await L4n(t,e,!0)}return c}a(L4n,"httpNetworkOrCacheFetch");async function Fys(t,e=!1,r=!1){iZ(!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*(_){nZ(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{nZ(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{nZ(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=oit({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=oit({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),iit(t,A)):sl(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{nZ(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:_,value:v}=await t.controller.next();if(S4n(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){cys(t.controller.controller),Lys(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),Tys(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){S4n(t)?(o.aborted=!0,ait(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):ait(h)&&t.controller.controller.error(new TypeError("terminated",{cause:sys(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=y5(n),E=t.controller.dispatcher;return new Promise((_,v)=>E.dispatch({path:y.pathname+y.search,origin:y.origin,method:n.method,body:E.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(b){let{connection:T}=t.controller;s.finalConnectionTimingInfo=dys(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),T.destroyed?b(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",b),this.abort=T.abort=b),s.finalNetworkRequestStartTime=Dke(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=Dke(t.crossOriginIsolatedCapability)},onHeaders(b,T,w,R){if(b<200)return;let x="",P=new b4n;for(let B=0;BM)return v(new Error(`too many content-encodings in response: ${q.length}, maximum allowed is ${M}`)),!0;for(let O=q.length-1;O>=0;--O){let j=q[O].trim();if(j==="x-gzip"||j==="gzip")D.push(Ej.createGunzip({flush:Ej.constants.Z_SYNC_FLUSH,finishFlush:Ej.constants.Z_SYNC_FLUSH}));else if(j==="deflate")D.push(hys({flush:Ej.constants.Z_SYNC_FLUSH,finishFlush:Ej.constants.Z_SYNC_FLUSH}));else if(j==="br")D.push(Ej.createBrotliDecompress({flush:Ej.constants.BROTLI_OPERATION_FLUSH,finishFlush:Ej.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let L=this.onError.bind(this);return _({status:b,statusText:R,headersList:P,body:D.length?Cys(this.body,...D,B=>{B&&this.onError(B)}).on("error",L):this.body.on("error",L)}),!0},onData(b){if(t.controller.dump)return;let T=b;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(b){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(b),t.controller.terminate(b),v(b)},onUpgrade(b,T,w){if(b!==101)return;let R=new b4n;for(let x=0;x{"use strict";p();F4n.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 Q4n=I((Ztf,U4n)=>{"use strict";p();var{webidl:hT}=qA(),lit=Symbol("ProgressEvent state"),Mtr=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=hT.converters.DOMString(e,"ProgressEvent constructor","type"),r=hT.converters.ProgressEventInit(r??{}),super(e,r),this[lit]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return hT.brandCheck(this,t),this[lit].lengthComputable}get loaded(){return hT.brandCheck(this,t),this[lit].loaded}get total(){return hT.brandCheck(this,t),this[lit].total}};hT.converters.ProgressEventInit=hT.dictionaryConverter([{key:"lengthComputable",converter:hT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:hT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:hT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:hT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:hT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:hT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);U4n.exports={ProgressEvent:Mtr}});var j4n=I((trf,q4n)=>{"use strict";p();function Uys(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(Uys,"getEncoding");q4n.exports={getEncoding:Uys}});var K4n=I((irf,Y4n)=>{"use strict";p();var{kState:xfe,kError:Otr,kResult:H4n,kAborted:Mke,kLastProgressEventFired:Ltr}=Ntr(),{ProgressEvent:Qys}=Q4n(),{getEncoding:G4n}=j4n(),{serializeAMimeType:qys,parseMIMEType:$4n}=nb(),{types:jys}=require("node:util"),{StringDecoder:V4n}=require("string_decoder"),{btoa:W4n}=require("node:buffer"),Hys={enumerable:!0,writable:!1,configurable:!1};function Gys(t,e,r,n){if(t[xfe]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[xfe]="loading",t[H4n]=null,t[Otr]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[Mke];)try{let{done:d,value:f}=await l;if(u&&!t[Mke]&&queueMicrotask(()=>{_j("loadstart",t)}),u=!1,!d&&jys.isUint8Array(f))c.push(f),(t[Ltr]===void 0||Date.now()-t[Ltr]>=50)&&!t[Mke]&&(t[Ltr]=Date.now(),queueMicrotask(()=>{_j("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[xfe]="done";try{let h=$ys(c,r,e.type,n);if(t[Mke])return;t[H4n]=h,_j("load",t)}catch(h){t[Otr]=h,_j("error",t)}t[xfe]!=="loading"&&_j("loadend",t)});break}}catch(d){if(t[Mke])return;queueMicrotask(()=>{t[xfe]="done",t[Otr]=d,_j("error",t),t[xfe]!=="loading"&&_j("loadend",t)});break}})()}a(Gys,"readOperation");function _j(t,e){let r=new Qys(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(_j,"fireAProgressEvent");function $ys(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=$4n(r||"application/octet-stream");s!=="failure"&&(o+=qys(s)),o+=";base64,";let c=new V4n("latin1");for(let l of t)o+=W4n(c.write(l));return o+=W4n(c.end()),o}case"Text":{let o="failure";if(n&&(o=G4n(n)),o==="failure"&&r){let s=$4n(r);s!=="failure"&&(o=G4n(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),Vys(t,o)}case"ArrayBuffer":return z4n(t).buffer;case"BinaryString":{let o="",s=new V4n("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a($ys,"packageData");function Vys(t,e){let r=z4n(t),n=Wys(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(Vys,"decode");function Wys(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(Wys,"BOMSniffing");function z4n(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(z4n,"combineByteSequences");Y4n.exports={staticPropertyDescriptors:Hys,readOperation:Gys,fireAProgressEvent:_j}});var eLn=I((arf,X4n)=>{"use strict";p();var{staticPropertyDescriptors:wfe,readOperation:uit,fireAProgressEvent:J4n}=K4n(),{kState:oZ,kError:Z4n,kResult:dit,kEvents:wc,kAborted:zys}=Ntr(),{webidl:wl}=qA(),{kEnumerableProperty:sb}=qs(),E2=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[oZ]="empty",this[dit]=null,this[Z4n]=null,this[wc]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=wl.converters.Blob(e,{strict:!1}),uit(this,e,"ArrayBuffer")}readAsBinaryString(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=wl.converters.Blob(e,{strict:!1}),uit(this,e,"BinaryString")}readAsText(e,r=void 0){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=wl.converters.Blob(e,{strict:!1}),r!==void 0&&(r=wl.converters.DOMString(r,"FileReader.readAsText","encoding")),uit(this,e,"Text",r)}readAsDataURL(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=wl.converters.Blob(e,{strict:!1}),uit(this,e,"DataURL")}abort(){if(this[oZ]==="empty"||this[oZ]==="done"){this[dit]=null;return}this[oZ]==="loading"&&(this[oZ]="done",this[dit]=null),this[zys]=!0,J4n("abort",this),this[oZ]!=="loading"&&J4n("loadend",this)}get readyState(){switch(wl.brandCheck(this,t),this[oZ]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return wl.brandCheck(this,t),this[dit]}get error(){return wl.brandCheck(this,t),this[Z4n]}get onloadend(){return wl.brandCheck(this,t),this[wc].loadend}set onloadend(e){wl.brandCheck(this,t),this[wc].loadend&&this.removeEventListener("loadend",this[wc].loadend),typeof e=="function"?(this[wc].loadend=e,this.addEventListener("loadend",e)):this[wc].loadend=null}get onerror(){return wl.brandCheck(this,t),this[wc].error}set onerror(e){wl.brandCheck(this,t),this[wc].error&&this.removeEventListener("error",this[wc].error),typeof e=="function"?(this[wc].error=e,this.addEventListener("error",e)):this[wc].error=null}get onloadstart(){return wl.brandCheck(this,t),this[wc].loadstart}set onloadstart(e){wl.brandCheck(this,t),this[wc].loadstart&&this.removeEventListener("loadstart",this[wc].loadstart),typeof e=="function"?(this[wc].loadstart=e,this.addEventListener("loadstart",e)):this[wc].loadstart=null}get onprogress(){return wl.brandCheck(this,t),this[wc].progress}set onprogress(e){wl.brandCheck(this,t),this[wc].progress&&this.removeEventListener("progress",this[wc].progress),typeof e=="function"?(this[wc].progress=e,this.addEventListener("progress",e)):this[wc].progress=null}get onload(){return wl.brandCheck(this,t),this[wc].load}set onload(e){wl.brandCheck(this,t),this[wc].load&&this.removeEventListener("load",this[wc].load),typeof e=="function"?(this[wc].load=e,this.addEventListener("load",e)):this[wc].load=null}get onabort(){return wl.brandCheck(this,t),this[wc].abort}set onabort(e){wl.brandCheck(this,t),this[wc].abort&&this.removeEventListener("abort",this[wc].abort),typeof e=="function"?(this[wc].abort=e,this.addEventListener("abort",e)):this[wc].abort=null}};E2.EMPTY=E2.prototype.EMPTY=0;E2.LOADING=E2.prototype.LOADING=1;E2.DONE=E2.prototype.DONE=2;Object.defineProperties(E2.prototype,{EMPTY:wfe,LOADING:wfe,DONE:wfe,readAsArrayBuffer:sb,readAsBinaryString:sb,readAsText:sb,readAsDataURL:sb,abort:sb,readyState:sb,result:sb,error:sb,onloadstart:sb,onprogress:sb,onload:sb,onabort:sb,onerror:sb,onloadend:sb,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(E2,{EMPTY:wfe,LOADING:wfe,DONE:wfe});X4n.exports={FileReader:E2}});var fit=I((urf,tLn)=>{"use strict";p();tLn.exports={kConstruct:jd().kConstruct}});var iLn=I((frf,nLn)=>{"use strict";p();var Yys=require("node:assert"),{URLSerializer:rLn}=nb(),{isValidHeaderName:Kys}=cT();function Jys(t,e,r=!1){let n=rLn(t,r),o=rLn(e,r);return n===o}a(Jys,"urlEquals");function Zys(t){Yys(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),Kys(r)&&e.push(r);return e}a(Zys,"getFieldValues");nLn.exports={urlEquals:Jys,getFieldValues:Zys}});var aLn=I((mrf,sLn)=>{"use strict";p();var{kConstruct:Xys}=fit(),{urlEquals:eEs,getFieldValues:Btr}=iLn(),{kEnumerableProperty:sZ,isDisturbed:tEs}=qs(),{webidl:vi}=qA(),{Response:rEs,cloneResponse:nEs,fromInnerResponse:iEs}=Pke(),{Request:LF,fromInnerRequest:oEs}=Ife(),{kState:_2}=sj(),{fetching:sEs}=Nke(),{urlIsHttpHttpsScheme:pit,createDeferredPromise:Rfe,readAllBytes:aEs}=cT(),Ftr=require("node:assert"),hit=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==Xys&&vi.illegalConstructor(),vi.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){vi.brandCheck(this,t);let n="Cache.match";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.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={}){vi.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){vi.brandCheck(this,t);let r="Cache.add";vi.argumentLengthCheck(arguments,1,r),e=vi.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){vi.brandCheck(this,t);let r="Cache.addAll";vi.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw vi.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=vi.converters.RequestInfo(m),typeof m=="string")continue;let g=m[_2];if(!pit(g.url)||g.method!=="GET")throw vi.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new LF(m)[_2];if(!pit(g.url))throw vi.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Rfe();s.push(sEs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(vi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=Btr(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(vi.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=Rfe(),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){vi.brandCheck(this,t);let n="Cache.put";vi.argumentLengthCheck(arguments,2,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.Response(r,n,"response");let o=null;if(e instanceof LF?o=e[_2]:o=new LF(e)[_2],!pit(o.url)||o.method!=="GET")throw vi.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[_2];if(s.status===206)throw vi.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=Btr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw vi.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(tEs(s.body.stream)||s.body.stream.locked))throw vi.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=nEs(s),l=Rfe();if(s.body!=null){let A=s.body.stream.getReader();aEs(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=Rfe(),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={}){vi.brandCheck(this,t);let n="Cache.delete";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof LF){if(o=e[_2],o.method!=="GET"&&!r.ignoreMethod)return!1}else Ftr(typeof e=="string"),o=new LF(e)[_2];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Rfe(),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={}){vi.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof LF){if(o=e[_2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new LF(e)[_2]);let s=Rfe(),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=oEs(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 vi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw vi.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);Ftr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!pit(u.url))throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw vi.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);Ftr(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=""),!eEs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Btr(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 LF){if(o=e[_2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new LF(e)[_2]);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=iEs(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(hit.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:sZ,matchAll:sZ,add:sZ,addAll:sZ,put:sZ,delete:sZ,keys:sZ});var oLn=[{key:"ignoreSearch",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];vi.converters.CacheQueryOptions=vi.dictionaryConverter(oLn);vi.converters.MultiCacheQueryOptions=vi.dictionaryConverter([...oLn,{key:"cacheName",converter:vi.converters.DOMString}]);vi.converters.Response=vi.interfaceConverter(rEs);vi.converters["sequence"]=vi.sequenceConverter(vi.converters.RequestInfo);sLn.exports={Cache:hit}});var lLn=I((yrf,cLn)=>{"use strict";p();var{kConstruct:Oke}=fit(),{Cache:mit}=aLn(),{webidl:_E}=qA(),{kEnumerableProperty:Lke}=qs(),git=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==Oke&&_E.illegalConstructor(),_E.util.markAsUncloneable(this)}async match(e,r={}){if(_E.brandCheck(this,t),_E.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=_E.converters.RequestInfo(e),r=_E.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new mit(Oke,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new mit(Oke,n).match(e,r);if(s!==void 0)return s}}async has(e){_E.brandCheck(this,t);let r="CacheStorage.has";return _E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){_E.brandCheck(this,t);let r="CacheStorage.open";if(_E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new mit(Oke,o)}let n=[];return this.#e.set(e,n),new mit(Oke,n)}async delete(e){_E.brandCheck(this,t);let r="CacheStorage.delete";return _E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return _E.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(git.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Lke,has:Lke,open:Lke,delete:Lke,keys:Lke});cLn.exports={CacheStorage:git}});var dLn=I((vrf,uLn)=>{"use strict";p();uLn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Utr=I((brf,gLn)=>{"use strict";p();function cEs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(cEs,"isCTLExcludingHtab");function fLn(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(fLn,"validateCookieName");function pLn(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(pLn,"validateCookieValue");function hLn(t){for(let e=0;ee.toString().padStart(2,"0"));function mLn(t){return typeof t=="number"&&(t=new Date(t)),`${uEs[t.getUTCDay()]}, ${Ait[t.getUTCDate()]} ${dEs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Ait[t.getUTCHours()]}:${Ait[t.getUTCMinutes()]}:${Ait[t.getUTCSeconds()]} GMT`}a(mLn,"toIMFDate");function fEs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(fEs,"validateCookieMaxAge");function pEs(t){if(t.name.length===0)return null;fLn(t.name),pLn(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"&&(fEs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(lEs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(hLn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${mLn(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(pEs,"stringify");gLn.exports={isCTLExcludingHtab:cEs,validateCookieName:fLn,validateCookiePath:hLn,validateCookieValue:pLn,toIMFDate:mLn,stringify:pEs}});var yLn=I((Irf,ALn)=>{"use strict";p();var{maxNameValuePairSize:hEs,maxAttributeValueSize:mEs}=dLn(),{isCTLExcludingHtab:gEs}=Utr(),{collectASequenceOfCodePointsFast:yit}=nb(),AEs=require("node:assert");function yEs(t){if(gEs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=yit(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=yit("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>hEs?null:{name:n,value:o,...kfe(r)}}a(yEs,"parseSetCookie");function kfe(t,e={}){if(t.length===0)return e;AEs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=yit(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=yit("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>mEs)return kfe(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 kfe(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 kfe(t,e)}a(kfe,"parseUnparsedAttributes");ALn.exports={parseSetCookie:yEs,parseUnparsedAttributes:kfe}});var vLn=I((Rrf,_Ln)=>{"use strict";p();var{parseSetCookie:EEs}=yLn(),{stringify:_Es}=Utr(),{webidl:fa}=qA(),{Headers:Eit}=tZ();function vEs(t){fa.argumentLengthCheck(arguments,1,"getCookies"),fa.brandCheck(t,Eit,{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(vEs,"getCookies");function CEs(t,e,r){fa.brandCheck(t,Eit,{strict:!1});let n="deleteCookie";fa.argumentLengthCheck(arguments,2,n),e=fa.converters.DOMString(e,n,"name"),r=fa.converters.DeleteCookieAttributes(r),ELn(t,{name:e,value:"",expires:new Date(0),...r})}a(CEs,"deleteCookie");function bEs(t){fa.argumentLengthCheck(arguments,1,"getSetCookies"),fa.brandCheck(t,Eit,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>EEs(r)):[]}a(bEs,"getSetCookies");function ELn(t,e){fa.argumentLengthCheck(arguments,2,"setCookie"),fa.brandCheck(t,Eit,{strict:!1}),e=fa.converters.Cookie(e);let r=_Es(e);r&&t.append("Set-Cookie",r)}a(ELn,"setCookie");fa.converters.DeleteCookieAttributes=fa.dictionaryConverter([{converter:fa.nullableConverter(fa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:fa.nullableConverter(fa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);fa.converters.Cookie=fa.dictionaryConverter([{converter:fa.converters.DOMString,key:"name"},{converter:fa.converters.DOMString,key:"value"},{converter:fa.nullableConverter(t=>typeof t=="number"?fa.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:fa.nullableConverter(fa.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:fa.nullableConverter(fa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:fa.nullableConverter(fa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:fa.nullableConverter(fa.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:fa.nullableConverter(fa.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:fa.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:fa.sequenceConverter(fa.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);_Ln.exports={getCookies:vEs,deleteCookie:CEs,getSetCookies:bEs,setCookie:ELn}});var Dfe=I((Drf,bLn)=>{"use strict";p();var{webidl:hi}=qA(),{kEnumerableProperty:ab}=qs(),{kConstruct:CLn}=jd(),{MessagePort:SEs}=require("node:worker_threads"),Pfe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===CLn){super(arguments[1],arguments[2]),hi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get data(){return hi.brandCheck(this,t),this.#e.data}get origin(){return hi.brandCheck(this,t),this.#e.origin}get lastEventId(){return hi.brandCheck(this,t),this.#e.lastEventId}get source(){return hi.brandCheck(this,t),this.#e.source}get ports(){return hi.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 hi.brandCheck(this,t),hi.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(CLn,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:TEs}=Pfe;delete Pfe.createFastMessageEvent;var _it=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.CloseEventInit(r),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get wasClean(){return hi.brandCheck(this,t),this.#e.wasClean}get code(){return hi.brandCheck(this,t),this.#e.code}get reason(){return hi.brandCheck(this,t),this.#e.reason}},vit=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";hi.argumentLengthCheck(arguments,1,n),super(e,r),hi.util.markAsUncloneable(this),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return hi.brandCheck(this,t),this.#e.message}get filename(){return hi.brandCheck(this,t),this.#e.filename}get lineno(){return hi.brandCheck(this,t),this.#e.lineno}get colno(){return hi.brandCheck(this,t),this.#e.colno}get error(){return hi.brandCheck(this,t),this.#e.error}};Object.defineProperties(Pfe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:ab,origin:ab,lastEventId:ab,source:ab,ports:ab,initMessageEvent:ab});Object.defineProperties(_it.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:ab,code:ab,wasClean:ab});Object.defineProperties(vit.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:ab,filename:ab,lineno:ab,colno:ab,error:ab});hi.converters.MessagePort=hi.interfaceConverter(SEs);hi.converters["sequence"]=hi.sequenceConverter(hi.converters.MessagePort);var Qtr=[{key:"bubbles",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];hi.converters.MessageEventInit=hi.dictionaryConverter([...Qtr,{key:"data",converter:hi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:hi.nullableConverter(hi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:hi.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);hi.converters.CloseEventInit=hi.dictionaryConverter([...Qtr,{key:"wasClean",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:hi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);hi.converters.ErrorEventInit=hi.dictionaryConverter([...Qtr,{key:"message",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:hi.converters.any}]);bLn.exports={MessageEvent:Pfe,CloseEvent:_it,ErrorEvent:vit,createFastMessageEvent:TEs}});var aZ=I((Orf,SLn)=>{"use strict";p();var IEs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",xEs={enumerable:!0,writable:!1,configurable:!1},wEs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},REs={NOT_SENT:0,PROCESSING:1,SENT:2},kEs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},PEs=2**16-1,DEs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},NEs=Buffer.allocUnsafe(0),MEs={string:1,typedArray:2,arrayBuffer:3,blob:4};SLn.exports={uid:IEs,sentCloseFrameState:REs,staticPropertyDescriptors:xEs,states:wEs,opcodes:kEs,maxUnsigned16Bit:PEs,parserStates:DEs,emptyBuffer:NEs,sendHints:MEs}});var Bke=I((Brf,TLn)=>{"use strict";p();TLn.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 Qke=I((Urf,MLn)=>{"use strict";p();var{kReadyState:Fke,kController:OEs,kResponse:LEs,kBinaryType:BEs,kWebSocketURL:FEs}=Bke(),{states:Uke,opcodes:vj}=aZ(),{ErrorEvent:UEs,createFastMessageEvent:QEs}=Dfe(),{isUtf8:qEs}=require("node:buffer"),{collectASequenceOfCodePointsFast:jEs,removeHTTPWhitespace:ILn}=nb();function HEs(t){return t[Fke]===Uke.CONNECTING}a(HEs,"isConnecting");function GEs(t){return t[Fke]===Uke.OPEN}a(GEs,"isEstablished");function $Es(t){return t[Fke]===Uke.CLOSING}a($Es,"isClosing");function VEs(t){return t[Fke]===Uke.CLOSED}a(VEs,"isClosed");function qtr(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(qtr,"fireEvent");function WEs(t,e,r){if(t[Fke]!==Uke.OPEN)return;let n;if(e===vj.TEXT)try{n=NLn(r)}catch{wLn(t,"Received invalid UTF-8 in text frame.");return}else e===vj.BINARY&&(t[BEs]==="blob"?n=new Blob([r]):n=zEs(r));qtr("message",t,QEs,{origin:t[FEs].origin,data:n})}a(WEs,"websocketMessageReceived");function zEs(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(zEs,"toArrayBuffer");function YEs(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(YEs,"isValidSubprotocol");function KEs(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(KEs,"isValidStatusCode");function wLn(t,e){let{[OEs]:r,[LEs]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&qtr("error",t,(o,s)=>new UEs(o,s),{error:new Error(e),message:e})}a(wLn,"failWebsocketConnection");function RLn(t){return t===vj.CLOSE||t===vj.PING||t===vj.PONG}a(RLn,"isControlFrame");function kLn(t){return t===vj.CONTINUATION}a(kLn,"isContinuationFrame");function PLn(t){return t===vj.TEXT||t===vj.BINARY}a(PLn,"isTextBinaryFrame");function JEs(t){return PLn(t)||kLn(t)||RLn(t)}a(JEs,"isValidOpcode");function ZEs(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(XEs,"isValidClientWindowBits");var DLn=typeof process.versions.icu=="string",xLn=DLn?new TextDecoder("utf-8",{fatal:!0}):void 0,NLn=DLn?xLn.decode.bind(xLn):function(t){if(qEs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};MLn.exports={isConnecting:HEs,isEstablished:GEs,isClosing:$Es,isClosed:VEs,fireEvent:qtr,isValidSubprotocol:YEs,isValidStatusCode:KEs,failWebsocketConnection:wLn,websocketMessageReceived:WEs,utf8Decode:NLn,isControlFrame:RLn,isContinuationFrame:kLn,isTextBinaryFrame:PLn,isValidOpcode:JEs,parseExtensions:ZEs,isValidClientWindowBits:XEs}});var bit=I((jrf,OLn)=>{"use strict";p();var{maxUnsigned16Bit:e_s}=aZ(),Cit=16386,jtr,qke=null,Nfe=Cit;try{jtr=require("node:crypto")}catch{jtr={randomFillSync:a(function(e,r,n){for(let o=0;oe_s?(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:r_s,states:jke,sentCloseFrameState:Sit,emptyBuffer:n_s,opcodes:i_s}=aZ(),{kReadyState:Hke,kSentClose:Tit,kByteParser:BLn,kReceivedClose:LLn,kResponse:FLn}=Bke(),{fireEvent:o_s,failWebsocketConnection:Cj,isClosing:s_s,isClosed:a_s,isEstablished:c_s,parseExtensions:l_s}=Qke(),{channels:Mfe}=$de(),{CloseEvent:u_s}=Dfe(),{makeRequest:d_s}=Ife(),{fetching:f_s}=Nke(),{Headers:p_s,getHeadersList:h_s}=tZ(),{getDecodeSplit:m_s}=cT(),{WebsocketFrameSend:g_s}=bit(),Gtr;try{Gtr=require("node:crypto")}catch{}function A_s(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=d_s({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=h_s(new p_s(s.headers));l.headersList=h}let u=Gtr.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"),f_s({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){Cj(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){Cj(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Cj(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Cj(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=Gtr.createHash("sha1").update(u+r_s).digest("base64");if(m!==g){Cj(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=l_s(A),!y.has("permessage-deflate"))){Cj(n,"Sec-WebSocket-Extensions header does not match.");return}let E=h.headersList.get("Sec-WebSocket-Protocol");if(E!==null&&!m_s("sec-websocket-protocol",l.headersList).includes(E)){Cj(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",ULn),h.socket.on("close",QLn),h.socket.on("error",qLn),Mfe.open.hasSubscribers&&Mfe.open.publish({address:h.socket.address(),protocol:E,extensions:A}),o(h,y)}})}a(A_s,"establishWebSocketConnection");function y_s(t,e,r,n){if(!(s_s(t)||a_s(t)))if(!c_s(t))Cj(t,"Connection was closed before it was established."),t[Hke]=jke.CLOSING;else if(t[Tit]===Sit.NOT_SENT){t[Tit]=Sit.PROCESSING;let o=new g_s;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=n_s,t[FLn].socket.write(o.createFrame(i_s.CLOSE)),t[Tit]=Sit.SENT,t[Hke]=jke.CLOSING}else t[Hke]=jke.CLOSING}a(y_s,"closeWebSocketConnection");function ULn(t){this.ws[BLn].write(t)||this.pause()}a(ULn,"onSocketData");function QLn(){let{ws:t}=this,{[FLn]:e}=t;e.socket.off("data",ULn),e.socket.off("close",QLn),e.socket.off("error",qLn);let r=t[Tit]===Sit.SENT&&t[LLn],n=1005,o="",s=t[BLn].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[LLn]||(n=1006),t[Hke]=jke.CLOSED,o_s("close",t,(c,l)=>new u_s(c,l),{wasClean:r,code:n,reason:o}),Mfe.close.hasSubscribers&&Mfe.close.publish({websocket:t,code:n,reason:o})}a(QLn,"onSocketClose");function qLn(t){let{ws:e}=this;e[Hke]=jke.CLOSING,Mfe.socketError.hasSubscribers&&Mfe.socketError.publish(t),this.destroy()}a(qLn,"onSocketError");jLn.exports={establishWebSocketConnection:A_s,closeWebSocketConnection:y_s}});var $Ln=I((zrf,GLn)=>{"use strict";p();var{createInflateRaw:E_s,Z_DEFAULT_WINDOWBITS:__s}=require("node:zlib"),{isValidClientWindowBits:v_s}=Qke(),{MessageSizeExceededError:HLn}=Ec(),C_s=Buffer.from([0,0,255,255]),Iit=Symbol("kBuffer"),Gke=Symbol("kLength"),b_s=4*1024*1024,Vtr=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 HLn);return}if(!this.#e){let o=__s;if(this.#t.serverMaxWindowBits){if(!v_s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=E_s({windowBits:o})}catch(s){n(s);return}this.#e[Iit]=[],this.#e[Gke]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[Gke]+=s.length,this.#e[Gke]>b_s){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new HLn)}return}this.#e[Iit].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(C_s),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[Iit],this.#e[Gke]);this.#e[Iit].length=0,this.#e[Gke]=0,this.#n=null,n(null,o)})}};GLn.exports={PerMessageDeflate:Vtr}});var tBn=I((Jrf,eBn)=>{"use strict";p();var{Writable:S_s}=require("node:stream"),T_s=require("node:assert"),{parserStates:cb,opcodes:Ofe,states:I_s,emptyBuffer:VLn,sentCloseFrameState:WLn}=aZ(),{kReadyState:x_s,kSentClose:zLn,kResponse:YLn,kReceivedClose:KLn}=Bke(),{channels:xit}=$de(),{isValidStatusCode:w_s,isValidOpcode:R_s,failWebsocketConnection:mT,websocketMessageReceived:JLn,utf8Decode:k_s,isControlFrame:ZLn,isTextBinaryFrame:Wtr,isContinuationFrame:P_s}=Qke(),{WebsocketFrameSend:XLn}=bit(),{closeWebSocketConnection:D_s}=$tr(),{PerMessageDeflate:N_s}=$Ln(),ztr=class extends S_s{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=cb.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 N_s(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===cb.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!==Ofe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!R_s(o))return mT(this.ws,"Invalid opcode received"),e();if(s)return mT(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){mT(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){mT(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Wtr(o)){mT(this.ws,"Invalid frame type was fragmented.");return}if(Wtr(o)&&this.#o.length>0){mT(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){mT(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&ZLn(o)){mT(this.ws,"Control frame either too large or fragmented");return}if(P_s(o)&&this.#o.length===0&&!this.#i.compressed){mT(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=cb.READ_DATA):l===126?this.#n=cb.PAYLOADLENGTH_16:l===127&&(this.#n=cb.PAYLOADLENGTH_64),Wtr(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===cb.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=cb.READ_DATA}else if(this.#n===cb.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){mT(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=cb.READ_DATA}else if(this.#n===cb.READ_DATA){if(this.#t{if(n){mT(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=cb.INFO,this.#r=!0,this.run(e);return}JLn(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=cb.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);JLn(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=cb.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return VLn;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){T_s(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!w_s(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=k_s(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===Ofe.CLOSE){if(n===1)return mT(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 D_s(this.ws,o,s,s.length),mT(this.ws,s),!1}if(this.ws[zLn]!==WLn.SENT){let o=VLn;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new XLn(o);this.ws[YLn].socket.write(s.createFrame(Ofe.CLOSE),c=>{c||(this.ws[zLn]=WLn.SENT)})}return this.ws[x_s]=I_s.CLOSING,this.ws[KLn]=!0,!1}else if(r===Ofe.PING){if(!this.ws[KLn]){let o=new XLn(e);this.ws[YLn].socket.write(o.createFrame(Ofe.PONG)),xit.ping.hasSubscribers&&xit.ping.publish({payload:e})}}else r===Ofe.PONG&&xit.pong.hasSubscribers&&xit.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};eBn.exports={ByteParser:ztr}});var sBn=I((enf,oBn)=>{"use strict";p();var{WebsocketFrameSend:M_s}=bit(),{opcodes:rBn,sendHints:Lfe}=aZ(),O_s=ier(),nBn=Buffer[Symbol.species],Ytr=class{static{a(this,"SendQueue")}#e=new O_s;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==Lfe.blob){let s=iBn(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=iBn(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 iBn(t,e){return new M_s(L_s(t,e)).createFrame(e===Lfe.string?rBn.TEXT:rBn.BINARY)}a(iBn,"createFrame");function L_s(t,e){switch(e){case Lfe.string:return Buffer.from(t);case Lfe.arrayBuffer:case Lfe.blob:return new nBn(t);case Lfe.typedArray:return new nBn(t.buffer,t.byteOffset,t.byteLength)}}a(L_s,"toBuffer");oBn.exports={SendQueue:Ytr}});var mBn=I((nnf,hBn)=>{"use strict";p();var{webidl:so}=qA(),{URLSerializer:B_s}=nb(),{environmentSettingsObject:aBn}=cT(),{staticPropertyDescriptors:bj,states:$ke,sentCloseFrameState:F_s,sendHints:wit}=aZ(),{kWebSocketURL:cBn,kReadyState:Ktr,kController:U_s,kBinaryType:Rit,kResponse:lBn,kSentClose:Q_s,kByteParser:q_s}=Bke(),{isConnecting:j_s,isEstablished:H_s,isClosing:G_s,isValidSubprotocol:$_s,fireEvent:uBn}=Qke(),{establishWebSocketConnection:V_s,closeWebSocketConnection:dBn}=$tr(),{ByteParser:W_s}=tBn(),{kEnumerableProperty:xw,isBlobLike:fBn}=qs(),{getGlobalDispatcher:z_s}=Gnt(),{types:pBn}=require("node:util"),{ErrorEvent:Y_s,CloseEvent:K_s}=Dfe(),{SendQueue:J_s}=sBn(),gT=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(),so.util.markAsUncloneable(this);let n="WebSocket constructor";so.argumentLengthCheck(arguments,1,n);let o=so.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=so.converters.USVString(e,n,"url"),r=o.protocols;let s=aBn.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=>$_s(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[cBn]=new URL(c.href);let l=aBn.settingsObject;this[U_s]=V_s(c,r,l,this,(u,d)=>this.#o(u,d),o),this[Ktr]=t.CONNECTING,this[Q_s]=F_s.NOT_SENT,this[Rit]="blob"}close(e=void 0,r=void 0){so.brandCheck(this,t);let n="WebSocket.close";if(e!==void 0&&(e=so.converters["unsigned short"](e,n,"code",{clamp:!0})),r!==void 0&&(r=so.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");dBn(this,e,r,o)}send(e){so.brandCheck(this,t);let r="WebSocket.send";if(so.argumentLengthCheck(arguments,1,r),e=so.converters.WebSocketSendData(e,r,"data"),j_s(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!H_s(this)||G_s(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},wit.string)}else pBn.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},wit.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},wit.typedArray)):fBn(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},wit.blob))}get readyState(){return so.brandCheck(this,t),this[Ktr]}get bufferedAmount(){return so.brandCheck(this,t),this.#t}get url(){return so.brandCheck(this,t),B_s(this[cBn])}get extensions(){return so.brandCheck(this,t),this.#n}get protocol(){return so.brandCheck(this,t),this.#r}get onopen(){return so.brandCheck(this,t),this.#e.open}set onopen(e){so.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 so.brandCheck(this,t),this.#e.error}set onerror(e){so.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 so.brandCheck(this,t),this.#e.close}set onclose(e){so.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 so.brandCheck(this,t),this.#e.message}set onmessage(e){so.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 so.brandCheck(this,t),this[Rit]}set binaryType(e){so.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[Rit]="blob":this[Rit]=e}#o(e,r){this[lBn]=e;let n=new W_s(this,r);n.on("drain",Z_s),n.on("error",X_s.bind(this)),e.socket.ws=this,this[q_s]=n,this.#i=new J_s(e.socket),this[Ktr]=$ke.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),uBn("open",this)}};gT.CONNECTING=gT.prototype.CONNECTING=$ke.CONNECTING;gT.OPEN=gT.prototype.OPEN=$ke.OPEN;gT.CLOSING=gT.prototype.CLOSING=$ke.CLOSING;gT.CLOSED=gT.prototype.CLOSED=$ke.CLOSED;Object.defineProperties(gT.prototype,{CONNECTING:bj,OPEN:bj,CLOSING:bj,CLOSED:bj,url:xw,readyState:xw,bufferedAmount:xw,onopen:xw,onerror:xw,onclose:xw,close:xw,onmessage:xw,binaryType:xw,send:xw,extensions:xw,protocol:xw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(gT,{CONNECTING:bj,OPEN:bj,CLOSING:bj,CLOSED:bj});so.converters["sequence"]=so.sequenceConverter(so.converters.DOMString);so.converters["DOMString or sequence"]=function(t,e,r){return so.util.Type(t)==="Object"&&Symbol.iterator in t?so.converters["sequence"](t):so.converters.DOMString(t,e,r)};so.converters.WebSocketInit=so.dictionaryConverter([{key:"protocols",converter:so.converters["DOMString or sequence"],defaultValue:a(()=>new Array(0),"defaultValue")},{key:"dispatcher",converter:so.converters.any,defaultValue:a(()=>z_s(),"defaultValue")},{key:"headers",converter:so.nullableConverter(so.converters.HeadersInit)}]);so.converters["DOMString or sequence or WebSocketInit"]=function(t){return so.util.Type(t)==="Object"&&!(Symbol.iterator in t)?so.converters.WebSocketInit(t):{protocols:so.converters["DOMString or sequence"](t)}};so.converters.WebSocketSendData=function(t){if(so.util.Type(t)==="Object"){if(fBn(t))return so.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||pBn.isArrayBuffer(t))return so.converters.BufferSource(t)}return so.converters.USVString(t)};function Z_s(){this.ws[lBn].socket.resume()}a(Z_s,"onParserDrain");function X_s(t){let e,r;t instanceof K_s?(e=t.reason,r=t.code):e=t.message,uBn("error",this,()=>new Y_s("error",{error:t,message:e})),dBn(this,r)}a(X_s,"onParserError");hBn.exports={WebSocket:gT}});var Jtr=I((snf,gBn)=>{"use strict";p();function evs(t){return t.indexOf("\0")===-1}a(evs,"isValidLastEventId");function tvs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(tvs,"isASCIINumber");function rvs(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(rvs,"delay");gBn.exports={isValidLastEventId:evs,isASCIINumber:tvs,delay:rvs}});var _Bn=I((lnf,EBn)=>{"use strict";p();var{Transform:nvs}=require("node:stream"),{isASCIINumber:ABn,isValidLastEventId:yBn}=Jtr(),BF=[239,187,191],Ztr=10,kit=13,ivs=58,ovs=32,Xtr=class extends nvs{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]===BF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===BF[0]&&this.buffer[1]===BF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===BF[0]&&this.buffer[1]===BF[1]&&this.buffer[2]===BF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===BF[0]&&this.buffer[1]===BF[1]&&this.buffer[2]===BF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&ABn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&yBn(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}}};EBn.exports={EventSourceStream:Xtr}});var wBn=I((fnf,xBn)=>{"use strict";p();var{pipeline:svs}=require("node:stream"),{fetching:avs}=Nke(),{makeRequest:cvs}=Ife(),{webidl:FF}=qA(),{EventSourceStream:lvs}=_Bn(),{parseMIMEType:uvs}=nb(),{createFastMessageEvent:dvs}=Dfe(),{isNetworkError:vBn}=Pke(),{delay:fvs}=Jtr(),{kEnumerableProperty:cZ}=qs(),{environmentSettingsObject:CBn}=cT(),bBn=!1,SBn=3e3,Vke=0,TBn=1,Wke=2,pvs="anonymous",hvs="use-credentials",Bfe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=Vke;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),FF.util.markAsUncloneable(this);let n="EventSource constructor";FF.argumentLengthCheck(arguments,1,n),bBn||(bBn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=FF.converters.USVString(e,n,"url"),r=FF.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:SBn};let o=CBn,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=pvs;r.withCredentials&&(c=hvs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=CBn.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=cvs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===Wke)return;this.#n=Vke;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{vBn(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(vBn(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?uvs(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=TBn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new lvs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(dvs(u.type,u.options))},"push")});svs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=avs(e)}async#u(){this.#n!==Wke&&(this.#n=Vke,this.dispatchEvent(new Event("error")),await fvs(this.#a.reconnectionTime),this.#n===Vke&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){FF.brandCheck(this,t),this.#n!==Wke&&(this.#n=Wke,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}},IBn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:Vke,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:TBn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:Wke,writable:!1}};Object.defineProperties(Bfe,IBn);Object.defineProperties(Bfe.prototype,IBn);Object.defineProperties(Bfe.prototype,{close:cZ,onerror:cZ,onmessage:cZ,onopen:cZ,readyState:cZ,url:cZ,withCredentials:cZ});FF.converters.EventSourceInitDict=FF.dictionaryConverter([{key:"withCredentials",converter:FF.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:FF.converters.any}]);xBn.exports={EventSource:Bfe,defaultReconnectionTime:SBn}});var DBn=I((mnf,Ki)=>{"use strict";p();var mvs=dfe(),RBn=JRe(),gvs=ffe(),Avs=IMn(),yvs=pfe(),Evs=Ser(),_vs=KMn(),vvs=rOn(),kBn=Ec(),Dit=qs(),{InvalidArgumentError:Pit}=kBn,Ffe=jOn(),Cvs=XRe(),bvs=otr(),Svs=S5n(),Tvs=ctr(),Ivs=Ver(),xvs=Mnt(),{getGlobalDispatcher:PBn,setGlobalDispatcher:wvs}=Gnt(),Rvs=$nt(),kvs=bnt(),Pvs=Snt();Object.assign(RBn.prototype,Ffe);Ki.exports.Dispatcher=RBn;Ki.exports.Client=mvs;Ki.exports.Pool=gvs;Ki.exports.BalancedPool=Avs;Ki.exports.Agent=yvs;Ki.exports.ProxyAgent=Evs;Ki.exports.EnvHttpProxyAgent=_vs;Ki.exports.RetryAgent=vvs;Ki.exports.RetryHandler=xvs;Ki.exports.DecoratorHandler=Rvs;Ki.exports.RedirectHandler=kvs;Ki.exports.createRedirectInterceptor=Pvs;Ki.exports.interceptors={redirect:P5n(),retry:N5n(),dump:O5n(),dns:F5n()};Ki.exports.buildConnector=Cvs;Ki.exports.errors=kBn;Ki.exports.util={parseHeaders:Dit.parseHeaders,headerNameToString:Dit.headerNameToString};function zke(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 Pit("invalid url");if(r!=null&&typeof r!="object")throw new Pit("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new Pit("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Dit.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Dit.parseURL(e);let{agent:o,dispatcher:s=PBn()}=r;if(o)throw new Pit("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(zke,"makeDispatcher");Ki.exports.setGlobalDispatcher=wvs;Ki.exports.getGlobalDispatcher=PBn;var Dvs=Nke().fetch;Ki.exports.fetch=a(async function(e,r=void 0){try{return await Dvs(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");Ki.exports.Headers=tZ().Headers;Ki.exports.Response=Pke().Response;Ki.exports.Request=Ife().Request;Ki.exports.FormData=ske().FormData;Ki.exports.File=globalThis.File??require("node:buffer").File;Ki.exports.FileReader=eLn().FileReader;var{setGlobalOrigin:Nvs,getGlobalOrigin:Mvs}=TXt();Ki.exports.setGlobalOrigin=Nvs;Ki.exports.getGlobalOrigin=Mvs;var{CacheStorage:Ovs}=lLn(),{kConstruct:Lvs}=fit();Ki.exports.caches=new Ovs(Lvs);var{deleteCookie:Bvs,getCookies:Fvs,getSetCookies:Uvs,setCookie:Qvs}=vLn();Ki.exports.deleteCookie=Bvs;Ki.exports.getCookies=Fvs;Ki.exports.getSetCookies=Uvs;Ki.exports.setCookie=Qvs;var{parseMIMEType:qvs,serializeAMimeType:jvs}=nb();Ki.exports.parseMIMEType=qvs;Ki.exports.serializeAMimeType=jvs;var{CloseEvent:Hvs,ErrorEvent:Gvs,MessageEvent:$vs}=Dfe();Ki.exports.WebSocket=mBn().WebSocket;Ki.exports.CloseEvent=Hvs;Ki.exports.ErrorEvent=Gvs;Ki.exports.MessageEvent=$vs;Ki.exports.request=zke(Ffe.request);Ki.exports.stream=zke(Ffe.stream);Ki.exports.pipeline=zke(Ffe.pipeline);Ki.exports.connect=zke(Ffe.connect);Ki.exports.upgrade=zke(Ffe.upgrade);Ki.exports.MockClient=bvs;Ki.exports.MockPool=Tvs;Ki.exports.MockAgent=Svs;Ki.exports.mockErrors=Ivs;var{EventSource:Vvs}=wBn();Ki.exports.EventSource=Vvs});var As=I((ynf,NBn)=>{p();NBn.exports={options:{usePureJavaScript:!1}}});var LBn=I((_nf,OBn)=>{p();var trr={};OBn.exports=trr;var MBn={};trr.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=Wvs(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};trr.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=MBn[e];if(!r){r=MBn[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(Wvs,"_encodeWithByteBuffer")});var ac=I((bnf,QBn)=>{p();var BBn=As(),FBn=LBn(),nt=QBn.exports=BBn.util=BBn.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 Yke(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(Yke,"_checkBitsParam");nt.ByteBuffer=rrr;function rrr(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;rzvs&&(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){Yke(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){Yke(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 Yke(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 Sj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Tj=[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],UBn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";nt.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=Sj.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Sj.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":Sj.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:FBn.encode,decode:FBn.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+=Sj.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Sj.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":Sj.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,UBn,e)};nt.binary.base58.decode=function(t,e){return nt.binary.baseN.decode(t,UBn,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){Nit(Kvs,arguments,o)};nt.getItem=function(t,e,r,n){return Nit(Jvs,arguments,n)};nt.removeItem=function(t,e,r,n){Nit(Zvs,arguments,n)};nt.clearItems=function(t,e,r){Nit(Xvs,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 Rg=As();ac();qBn.exports=Rg.cipher=Rg.cipher||{};Rg.cipher.algorithms=Rg.cipher.algorithms||{};Rg.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Rg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Rg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Rg.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Rg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Rg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Rg.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Rg.cipher.algorithms[t]=e};Rg.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Rg.cipher.algorithms?Rg.cipher.algorithms[t]:null};var orr=Rg.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)};orr.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=Rg.util.createBuffer(),this.output=t.output||Rg.util.createBuffer(),this.mode.start(e)};orr.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()};orr.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 arr=I((wnf,jBn)=>{p();var kg=As();ac();kg.cipher=kg.cipher||{};var Xs=jBn.exports=kg.cipher.modes=kg.cipher.modes||{};Xs.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)};Xs.ecb.prototype.start=function(t){};Xs.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)};Xs.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)};Xs.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=Oit(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Xs.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)};Xs.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=kg.util.createBuffer(),this._partialBytes=0};Xs.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Oit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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};Xs.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};Xs.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=kg.util.createBuffer(),this._partialBytes=0};Xs.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Oit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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};Xs.ofb.prototype.decrypt=Xs.ofb.prototype.encrypt;Xs.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=kg.util.createBuffer(),this._partialBytes=0};Xs.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Oit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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}Lit(this._inBlock)};Xs.ctr.prototype.decrypt=Xs.ctr.prototype.encrypt;Xs.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=kg.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Xs.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=kg.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=kg.util.createBuffer(t.additionalData):r=kg.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=kg.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(srr(n*8)))}this._inBlock=this._j0.slice(0),Lit(this._inBlock),this._partialBytes=0,r=kg.util.createBuffer(r),this._aDataLength=srr(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()])};Xs.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),Lit(this._inBlock)};Xs.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Lit(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)};Xs.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};Xs.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)};Xs.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=kg.util.createBuffer();for(var n=0;n{p();var Iu=As();Mit();arr();ac();VBn.exports=Iu.aes=Iu.aes||{};Iu.aes.startEncrypting=function(t,e,r,n){var o=Bit({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};Iu.aes.createEncryptionCipher=function(t,e){return Bit({key:t,output:null,decrypt:!1,mode:e})};Iu.aes.startDecrypting=function(t,e,r,n){var o=Bit({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};Iu.aes.createDecryptionCipher=function(t,e){return Bit({key:t,output:null,decrypt:!0,mode:e})};Iu.aes.Algorithm=function(t,e){urr||GBn();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return lrr(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return lrr(r._w,n,o,!0)},"decrypt")}}),r._init=!1};Iu.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=Iu.util.createBuffer(e);else if(Iu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Iu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,sv[r]=l,crr[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)lZ[h][r]=d,v2[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(GBn,"initialize");function $Bn(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=Ufe*c,u=s;u>>16&255]<<24^sv[n>>>8&255]<<16^sv[n&255]<<8^sv[n>>>24]^HBn[o]<<24,o++):s>6&&u%s===4&&(n=sv[n>>>24]<<24^sv[n>>>16&255]<<16^sv[n>>>8&255]<<8^sv[n&255]),r[u]=r[u-s]^n;if(e){var d,f=v2[0],h=v2[1],m=v2[2],g=v2[3],A=r.slice(0);l=r.length;for(var u=0,y=l-Ufe;u>>24]]^h[sv[d>>>16&255]]^m[sv[d>>>8&255]]^g[sv[d&255]];r=A}return r}a($Bn,"_expandKey");function lrr(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=v2[0],c=v2[1],l=v2[2],u=v2[3],d=crr):(s=lZ[0],c=lZ[1],l=lZ[2],u=lZ[3],d=sv);var f,h,m,g,A,y,E;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 _=3,v=1;v>>24]^c[h>>>16&255]^l[m>>>8&255]^u[g&255]^t[++_],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[++_],g=s[g>>>24]^c[f>>>16&255]^l[h>>>8&255]^u[m&255]^t[++_],f=A,h=y,m=E;r[0]=d[f>>>24]<<24^d[h>>>16&255]<<16^d[m>>>8&255]<<8^d[g&255]^t[++_],r[n?3:1]=d[h>>>24]<<24^d[m>>>16&255]<<16^d[g>>>8&255]<<8^d[f&255]^t[++_],r[2]=d[m>>>24]<<24^d[g>>>16&255]<<16^d[f>>>8&255]<<8^d[h&255]^t[++_],r[n?1:3]=d[g>>>24]<<24^d[f>>>16&255]<<16^d[h>>>8&255]<<8^d[m&255]^t[++_]}a(lrr,"_updateBlock");function Bit(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Iu.cipher.createDecipher(r,t.key):n=Iu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Iu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(Bit,"_createCipher")});var xj=I((Mnf,WBn)=>{p();var Kke=As();Kke.pki=Kke.pki||{};var drr=WBn.exports=Kke.pki.oids=Kke.oids=Kke.oids||{};function ir(t,e){drr[t]=e,drr[e]=t}a(ir,"_IN");function Uc(t,e){drr[t]=e}a(Uc,"_I_");ir("1.2.840.113549.1.1.1","rsaEncryption");ir("1.2.840.113549.1.1.4","md5WithRSAEncryption");ir("1.2.840.113549.1.1.5","sha1WithRSAEncryption");ir("1.2.840.113549.1.1.7","RSAES-OAEP");ir("1.2.840.113549.1.1.8","mgf1");ir("1.2.840.113549.1.1.9","pSpecified");ir("1.2.840.113549.1.1.10","RSASSA-PSS");ir("1.2.840.113549.1.1.11","sha256WithRSAEncryption");ir("1.2.840.113549.1.1.12","sha384WithRSAEncryption");ir("1.2.840.113549.1.1.13","sha512WithRSAEncryption");ir("1.3.101.112","EdDSA25519");ir("1.2.840.10040.4.3","dsa-with-sha1");ir("1.3.14.3.2.7","desCBC");ir("1.3.14.3.2.26","sha1");ir("1.3.14.3.2.29","sha1WithRSASignature");ir("2.16.840.1.101.3.4.2.1","sha256");ir("2.16.840.1.101.3.4.2.2","sha384");ir("2.16.840.1.101.3.4.2.3","sha512");ir("2.16.840.1.101.3.4.2.4","sha224");ir("2.16.840.1.101.3.4.2.5","sha512-224");ir("2.16.840.1.101.3.4.2.6","sha512-256");ir("1.2.840.113549.2.2","md2");ir("1.2.840.113549.2.5","md5");ir("1.2.840.113549.1.7.1","data");ir("1.2.840.113549.1.7.2","signedData");ir("1.2.840.113549.1.7.3","envelopedData");ir("1.2.840.113549.1.7.4","signedAndEnvelopedData");ir("1.2.840.113549.1.7.5","digestedData");ir("1.2.840.113549.1.7.6","encryptedData");ir("1.2.840.113549.1.9.1","emailAddress");ir("1.2.840.113549.1.9.2","unstructuredName");ir("1.2.840.113549.1.9.3","contentType");ir("1.2.840.113549.1.9.4","messageDigest");ir("1.2.840.113549.1.9.5","signingTime");ir("1.2.840.113549.1.9.6","counterSignature");ir("1.2.840.113549.1.9.7","challengePassword");ir("1.2.840.113549.1.9.8","unstructuredAddress");ir("1.2.840.113549.1.9.14","extensionRequest");ir("1.2.840.113549.1.9.20","friendlyName");ir("1.2.840.113549.1.9.21","localKeyId");ir("1.2.840.113549.1.9.22.1","x509Certificate");ir("1.2.840.113549.1.12.10.1.1","keyBag");ir("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");ir("1.2.840.113549.1.12.10.1.3","certBag");ir("1.2.840.113549.1.12.10.1.4","crlBag");ir("1.2.840.113549.1.12.10.1.5","secretBag");ir("1.2.840.113549.1.12.10.1.6","safeContentsBag");ir("1.2.840.113549.1.5.13","pkcs5PBES2");ir("1.2.840.113549.1.5.12","pkcs5PBKDF2");ir("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");ir("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");ir("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");ir("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");ir("1.2.840.113549.2.7","hmacWithSHA1");ir("1.2.840.113549.2.8","hmacWithSHA224");ir("1.2.840.113549.2.9","hmacWithSHA256");ir("1.2.840.113549.2.10","hmacWithSHA384");ir("1.2.840.113549.2.11","hmacWithSHA512");ir("1.2.840.113549.3.7","des-EDE3-CBC");ir("2.16.840.1.101.3.4.1.2","aes128-CBC");ir("2.16.840.1.101.3.4.1.22","aes192-CBC");ir("2.16.840.1.101.3.4.1.42","aes256-CBC");ir("2.5.4.3","commonName");ir("2.5.4.4","surname");ir("2.5.4.5","serialNumber");ir("2.5.4.6","countryName");ir("2.5.4.7","localityName");ir("2.5.4.8","stateOrProvinceName");ir("2.5.4.9","streetAddress");ir("2.5.4.10","organizationName");ir("2.5.4.11","organizationalUnitName");ir("2.5.4.12","title");ir("2.5.4.13","description");ir("2.5.4.15","businessCategory");ir("2.5.4.17","postalCode");ir("2.5.4.42","givenName");ir("2.5.4.65","pseudonym");ir("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");ir("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");ir("2.16.840.1.113730.1.1","nsCertType");ir("2.16.840.1.113730.1.13","nsComment");Uc("2.5.29.1","authorityKeyIdentifier");Uc("2.5.29.2","keyAttributes");Uc("2.5.29.3","certificatePolicies");Uc("2.5.29.4","keyUsageRestriction");Uc("2.5.29.5","policyMapping");Uc("2.5.29.6","subtreesConstraint");Uc("2.5.29.7","subjectAltName");Uc("2.5.29.8","issuerAltName");Uc("2.5.29.9","subjectDirectoryAttributes");Uc("2.5.29.10","basicConstraints");Uc("2.5.29.11","nameConstraints");Uc("2.5.29.12","policyConstraints");Uc("2.5.29.13","basicConstraints");ir("2.5.29.14","subjectKeyIdentifier");ir("2.5.29.15","keyUsage");Uc("2.5.29.16","privateKeyUsagePeriod");ir("2.5.29.17","subjectAltName");ir("2.5.29.18","issuerAltName");ir("2.5.29.19","basicConstraints");Uc("2.5.29.20","cRLNumber");Uc("2.5.29.21","cRLReason");Uc("2.5.29.22","expirationDate");Uc("2.5.29.23","instructionCode");Uc("2.5.29.24","invalidityDate");Uc("2.5.29.25","cRLDistributionPoints");Uc("2.5.29.26","issuingDistributionPoint");Uc("2.5.29.27","deltaCRLIndicator");Uc("2.5.29.28","issuingDistributionPoint");Uc("2.5.29.29","certificateIssuer");Uc("2.5.29.30","nameConstraints");ir("2.5.29.31","cRLDistributionPoints");ir("2.5.29.32","certificatePolicies");Uc("2.5.29.33","policyMappings");Uc("2.5.29.34","policyConstraints");ir("2.5.29.35","authorityKeyIdentifier");Uc("2.5.29.36","policyConstraints");ir("2.5.29.37","extKeyUsage");Uc("2.5.29.46","freshestCRL");Uc("2.5.29.54","inhibitAnyPolicy");ir("1.3.6.1.4.1.11129.2.4.2","timestampList");ir("1.3.6.1.5.5.7.1.1","authorityInfoAccess");ir("1.3.6.1.5.5.7.3.1","serverAuth");ir("1.3.6.1.5.5.7.3.2","clientAuth");ir("1.3.6.1.5.5.7.3.3","codeSigning");ir("1.3.6.1.5.5.7.3.4","emailProtection");ir("1.3.6.1.5.5.7.3.8","timeStamping")});var C2=I((Bnf,YBn)=>{p();var ad=As();ac();xj();var rn=YBn.exports=ad.asn1=ad.asn1||{};rn.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};rn.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};rn.maxDepth=256;rn.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(Jke,"_checkBufferLength");var eCs=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;Jke(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");rn.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=rn.maxDepth),typeof t=="string"&&(t=ad.util.createBuffer(t));var r=t.length(),n=Fit(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 Fit(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;Jke(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=eCs(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(Jke(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(Fit(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(Fit(t,u,r+1,n)),e-=o-t.length(),u-=o-t.length();if(f===void 0&&c===rn.Class.UNIVERSAL&&l===rn.Type.BITSTRING&&(h=t.bytes(u)),f===void 0&&n.decodeBitStrings&&c===rn.Class.UNIVERSAL&&l===rn.Type.BITSTRING&&u>1){var g=t.read,A=e,y=0;if(l===rn.Type.BITSTRING&&(Jke(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var E={strict:!0,decodeBitStrings:!0},_=Fit(t,e,r+1,E),v=o-t.length();e-=v,l==rn.Type.BITSTRING&&v++;var b=_.tagClass;v===u&&(b===rn.Class.UNIVERSAL||b===rn.Class.CONTEXT_SPECIFIC)&&(f=[_])}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===rn.Type.BMPSTRING)for(f="";u>0;u-=2)Jke(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 rn.create(c,l,m,f,T)}a(Fit,"_fromDer");rn.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=rn.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};rn.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};rn.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};rn.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};rn.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};rn.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};rn.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)};rn.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===rn.Type.OCTETSTRING)WBn.test(t.value)||(n+="("+t.value+") "),n+="0x"+ad.util.bytesToHex(t.value);else if(t.type===rn.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===rn.Type.PRINTABLESTRING||t.type===rn.Type.IA5String?n+=t.value:WBn.test(t.value)?n+="0x"+ad.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var E5=I((Dnf,YBn)=>{p();var Lit=As();YBn.exports=Lit.md=Lit.md||{};Lit.md.algorithms=Lit.md.algorithms||{}});var qfe=I((Mnf,KBn)=>{p();var FF=As();E5();ac();var Kvs=KBn.exports=FF.hmac=FF.hmac||{};Kvs.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 FF.md.algorithms)e=FF.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=FF.util.createBuffer(c);else if(FF.util.isArray(c)){var l=c;c=FF.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=FF.util.createBuffer(),n=FF.util.createBuffer(),d=c.length();for(var u=0;u{p();var _5=As();E5();ac();var ZBn=e3n.exports=_5.md5=_5.md5||{};_5.md.md5=_5.md.algorithms.md5=ZBn;ZBn.create=function(){XBn||Jvs();var t=null,e=_5.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),JBn(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=_5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(drr.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};JBn(f,r,o);var h=_5.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var drr=null,Bit=null,Zke=null,jfe=null,XBn=!1;function Jvs(){drr="\x80",drr+=_5.util.fillString("\0",64),Bit=[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],Zke=[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],jfe=new Array(64);for(var t=0;t<64;++t)jfe[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);XBn=!0}a(Jvs,"_init");function JBn(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+jfe[f]+e[f],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+jfe[f]+e[Bit[f]],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+jfe[f]+e[Bit[f]],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+jfe[f]+e[Bit[f]],d=Zke[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(JBn,"_update")});var uZ=I((Unf,r3n)=>{p();var Qit=As();ac();var t3n=r3n.exports=Qit.pem=Qit.pem||{};t3n.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+=Uit(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Uit(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Uit(n)),t.headers)for(var o=0;o1?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===rn.Type.OCTETSTRING)zBn.test(t.value)||(n+="("+t.value+") "),n+="0x"+ad.util.bytesToHex(t.value);else if(t.type===rn.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===rn.Type.PRINTABLESTRING||t.type===rn.Type.IA5String?n+=t.value:zBn.test(t.value)?n+="0x"+ad.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var E5=I((Qnf,KBn)=>{p();var Uit=As();KBn.exports=Uit.md=Uit.md||{};Uit.md.algorithms=Uit.md.algorithms||{}});var qfe=I((jnf,JBn)=>{p();var UF=As();E5();ac();var tCs=JBn.exports=UF.hmac=UF.hmac||{};tCs.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 UF.md.algorithms)e=UF.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=UF.util.createBuffer(c);else if(UF.util.isArray(c)){var l=c;c=UF.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=UF.util.createBuffer(),n=UF.util.createBuffer(),d=c.length();for(var u=0;u{p();var _5=As();E5();ac();var XBn=t3n.exports=_5.md5=_5.md5||{};_5.md.md5=_5.md.algorithms.md5=XBn;XBn.create=function(){e3n||rCs();var t=null,e=_5.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),ZBn(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=_5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(frr.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};ZBn(f,r,o);var h=_5.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var frr=null,Qit=null,Zke=null,jfe=null,e3n=!1;function rCs(){frr="\x80",frr+=_5.util.fillString("\0",64),Qit=[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],Zke=[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],jfe=new Array(64);for(var t=0;t<64;++t)jfe[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);e3n=!0}a(rCs,"_init");function ZBn(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+jfe[f]+e[f],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+jfe[f]+e[Qit[f]],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+jfe[f]+e[Qit[f]],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+jfe[f]+e[Qit[f]],d=Zke[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(ZBn,"_update")});var uZ=I((Wnf,n3n)=>{p();var Hit=As();ac();var r3n=n3n.exports=Hit.pem=Hit.pem||{};r3n.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+=jit(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=jit(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=jit(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(Uit,"foldHeader");function Zvs(t){return t.replace(/^\s+/,"")}a(Zvs,"ltrim")});var Xke=I((jnf,i3n)=>{p();var $d=As();Pit();srr();ac();i3n.exports=$d.des=$d.des||{};$d.des.startEncrypting=function(t,e,r,n){var o=qit({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};$d.des.createEncryptionCipher=function(t,e){return qit({key:t,output:null,decrypt:!1,mode:e})};$d.des.startDecrypting=function(t,e,r,n){var o=qit({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};$d.des.createDecryptionCipher=function(t,e){return qit({key:t,output:null,decrypt:!0,mode:e})};$d.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return n3n(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return n3n(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};$d.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=$d.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=aCs(e),this._init=!0}};v5("DES-ECB",$d.cipher.modes.ecb);v5("DES-CBC",$d.cipher.modes.cbc);v5("DES-CFB",$d.cipher.modes.cfb);v5("DES-OFB",$d.cipher.modes.ofb);v5("DES-CTR",$d.cipher.modes.ctr);v5("3DES-ECB",$d.cipher.modes.ecb);v5("3DES-CBC",$d.cipher.modes.cbc);v5("3DES-CFB",$d.cipher.modes.cfb);v5("3DES-OFB",$d.cipher.modes.ofb);v5("3DES-CTR",$d.cipher.modes.ctr);function v5(t,e){var r=a(function(){return new $d.des.Algorithm(t,e)},"factory");$d.cipher.registerAlgorithm(t,r)}a(v5,"registerAlgorithm");var Xvs=[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],eCs=[-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],tCs=[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],rCs=[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],nCs=[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],iCs=[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],oCs=[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],sCs=[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 aCs(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,b,T=0;T>>4^R)&252645135,R^=b,w^=b<<4,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>2^R)&858993459,R^=b,w^=b<<2,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=(R>>>8^w)&16711935,w^=b,R^=b<<8,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=w<<8|R>>>20&240,w=R<<24|R<<8&16711680|R>>>8&65280|R>>>24&240,R=b;for(var x=0;x<_.length;++x){_[x]?(w=w<<2|w>>>26,R=R<<2|R>>>26):(w=w<<1|w>>>27,R=R<<1|R>>>27),w&=-15,R&=-15;var P=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];b=(D>>>16^P)&65535,E[v++]=P^b,E[v++]=D^b<<16}}return E}a(aCs,"_createKeys");function n3n(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^(eCs[g>>>24&63]|rCs[g>>>16&63]|iCs[g>>>8&63]|sCs[g&63]|Xvs[A>>>24&63]|tCs[A>>>16&63]|nCs[A>>>8&63]|oCs[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(n3n,"_updateBlock");function qit(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=$d.cipher.createDecipher(r,t.key):n=$d.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof $d.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(qit,"_createCipher")});var jit=I(($nf,o3n)=>{p();var sv=As();qfe();E5();ac();var cCs=sv.pkcs5=sv.pkcs5||{},UF;sv.util.isNodejs&&!sv.options.usePureJavaScript&&(UF=require("crypto"));o3n.exports=sv.pbkdf2=cCs.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),sv.util.isNodejs&&!sv.options.usePureJavaScript&&UF.pbkdf2&&(o===null||typeof o!="object")&&(UF.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?UF.pbkdf2Sync.length===4?UF.pbkdf2(t,e,r,n,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):UF.pbkdf2(t,e,r,n,o,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):UF.pbkdf2Sync.length===4?UF.pbkdf2Sync(t,e,r,n).toString("binary"):UF.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in sv.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=sv.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=sv.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(sv.util.int32ToBytes(y)),m=A=f.digest().getBytes();for(var E=2;E<=r;++E)f.start(null,null),f.update(A),g=f.digest().getBytes(),m=sv.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(sv.util.int32ToBytes(y)),m=A=f.digest().getBytes(),E=2,v()}a(_,"outer");function v(){if(E<=r)return f.start(null,null),f.update(A),g=f.digest().getBytes(),m=sv.util.xorBytes(m,g,c),A=g,++E,sv.util.setImmediate(v);h+=y{p();var C5=As();E5();ac();var a3n=u3n.exports=C5.sha256=C5.sha256||{};C5.md.sha256=C5.md.algorithms.sha256=a3n;a3n.create=function(){c3n||lCs();var t=null,e=C5.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),s3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=C5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(frr.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};s3n(h,r,o);var m=C5.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 frr=null,c3n=!1,l3n=null;function lCs(){frr="\x80",frr+=C5.util.fillString("\0",64),l3n=[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],c3n=!0}a(lCs,"_init");function s3n(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,E=t.h6,_=t.h7,d=0;d<64;++d)c=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7),l=E^A&(y^E),s=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&h|m&(f^h),n=_+c+l+l3n[d]+e[d],o=s+u,_=E,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+E|0,t.h7=t.h7+_|0,v-=64}}a(s3n,"_update")});var hrr=I((Jnf,d3n)=>{p();var b5=As();ac();var Hit=null;b5.util.isNodejs&&!b5.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Hit=require("crypto"));var uCs=d3n.exports=b5.prng=b5.prng||{};uCs.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=b5.util.createBuffer();e.key=null,E();function E(_){if(_)return f(_);if(y.length()>=d)return f(null,y.getBytes(d));if(e.generated>1048575&&(e.key=null),e.key===null)return b5.util.nextTick(function(){s(E)});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)),b5.util.setImmediate(E)}a(E,"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=b5.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=b5.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=b5.util.createBuffer();if(f)for(;g.length()>16),v+=(_&32767)<<16,v+=_>>15,v=(v&2147483647)+(v>>31),T=v&4294967295;for(var E=0;E<3;++E)b=T>>>(E<<3),b^=Math.floor(Math.random()*256),g.putByte(b&255)}return g.getBytes(d)}return a(u,"defaultSeedFile"),Hit?(e.seedFile=function(d,f){Hit.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return Hit.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((eif,mrr)=>{p();var Pg=As();Tj();prr();hrr();ac();(function(){if(Pg.random&&Pg.random.getBytes){mrr.exports=Pg.random;return}(function(t){var e={},r=new Array(4),n=Pg.util.createBuffer();e.formatKey=function(h){var m=Pg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),Pg.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=Pg.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 Pg.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=Pg.md.sha256;function o(){var h=Pg.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=Pg.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),Pg.options.usePureJavaScript||!Pg.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(!Pg.random)Pg.random=s;else for(var f in s)Pg.random[f]=s[f];Pg.random.createInstance=o,mrr.exports=Pg.random})(typeof jQuery<"u"?jQuery:null)})()});var Arr=I((nif,h3n)=>{p();var lb=As();ac();var grr=[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],f3n=[1,2,3,5],dCs=a(function(t,e){return t<>16-e},"rol"),fCs=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");h3n.exports=lb.rc2=lb.rc2||{};lb.rc2.expandKey=function(t,e){typeof t=="string"&&(t=lb.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(grr[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,grr[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,grr[r.at(l+1)^r.at(l+s)]);return r};var p3n=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=lb.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]=dCs(A[d],f3n[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]=fCs(A[d],f3n[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 E=o.getInt16Le();c!==null&&(r?E^=c.getInt16Le():c.putInt16Le(E)),y.push(E&65535)}f=r?0:63;for(var _=0;_=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 E=o.length()===8?8:8-o.length();o.fillWithByte(E,E)}if(y&&(n=!0,g.update()),!r&&(y=o.length()===0,y))if(A)y=A(8,s,!r);else{var _=s.length(),v=s.at(_-1);v>_?y=!1:s.truncate(v)}return y},"finish")},g},"createCipher");lb.rc2.startEncrypting=function(t,e,r){var n=lb.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};lb.rc2.createEncryptionCipher=function(t,e){return p3n(t,e,!0)};lb.rc2.startDecrypting=function(t,e,r){var n=lb.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};lb.rc2.createDecryptionCipher=function(t,e){return p3n(t,e,!1)}});var tPe=I((sif,C3n)=>{p();var yrr=As();C3n.exports=yrr.jsbn=yrr.jsbn||{};var QF,pCs=0xdeadbeefcafe,m3n=(pCs&16777215)==15715070;function zt(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(zt,"BigInteger");yrr.jsbn.BigInteger=zt;function Va(){return new zt(null)}a(Va,"nbi");function hCs(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(hCs,"am1");function mCs(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(mCs,"am2");function g3n(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(g3n,"am3");typeof navigator>"u"?(zt.prototype.am=g3n,QF=28):m3n&&navigator.appName=="Microsoft Internet Explorer"?(zt.prototype.am=mCs,QF=30):m3n&&navigator.appName!="Netscape"?(zt.prototype.am=hCs,QF=26):(zt.prototype.am=g3n,QF=28);zt.prototype.DB=QF;zt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(ACs,"bnpCopyTo");function yCs(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(yCs,"bnpFromInt");function xj(t){var e=Va();return e.fromInt(t),e}a(xj,"nbv");function ECs(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:y3n(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(_Cs,"bnpClamp");function vCs(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=A3n(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+=A3n(n));return o?s:"0"}a(vCs,"bnToString");function CCs(){var t=Va();return zt.ZERO.subTo(this,t),t}a(CCs,"bnNegate");function bCs(){return this.s<0?this.negate():this}a(bCs,"bnAbs");function SCs(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(SCs,"bnCompareTo");function $it(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($it,"nbits");function TCs(){return this.t<=0?0:this.DB*(this.t-1)+$it(this.data[this.t-1]^this.s&this.DM)}a(TCs,"bnBitLength");function ICs(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(ICs,"bnpDLShiftTo");function xCs(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(wCs,"bnpLShiftTo");function RCs(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(kCs,"bnpSubTo");function PCs(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(DCs,"bnpSquareTo");function NCs(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(_,r)),zt.ONE.dlShiftTo(d,_),_.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,E,0,d))0&&r.rShiftTo(u,r),c<0&&zt.ZERO.subTo(r,r)}}}a(NCs,"bnpDivRemTo");function MCs(t){var e=Va();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(zt.ZERO)>0&&t.subTo(e,e),e}a(MCs,"bnMod");function dZ(t){this.m=t}a(dZ,"Classic");function OCs(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(OCs,"cConvert");function LCs(t){return t}a(LCs,"cRevert");function BCs(t){t.divRemTo(this.m,null,t)}a(BCs,"cReduce");function FCs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(FCs,"cMulTo");function UCs(t,e){t.squareTo(e),this.reduce(e)}a(UCs,"cSqrTo");dZ.prototype.convert=OCs;dZ.prototype.revert=LCs;dZ.prototype.reduce=BCs;dZ.prototype.mulTo=FCs;dZ.prototype.sqrTo=UCs;function QCs(){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(QCs,"bnpInvDigit");function fZ(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(qCs,"montConvert");function jCs(t){var e=Va();return t.copyTo(e),this.reduce(e),e}a(jCs,"montRevert");function HCs(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(HCs,"montReduce");function GCs(t,e){t.squareTo(e),this.reduce(e)}a(GCs,"montSqrTo");function $Cs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a($Cs,"montMulTo");fZ.prototype.convert=qCs;fZ.prototype.revert=jCs;fZ.prototype.reduce=HCs;fZ.prototype.mulTo=$Cs;fZ.prototype.sqrTo=GCs;function VCs(){return(this.t>0?this.data[0]&1:this.s)==0}a(VCs,"bnpIsEven");function WCs(t,e){if(t>4294967295||t<1)return zt.ONE;var r=Va(),n=Va(),o=e.convert(this),s=$it(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(WCs,"bnpExp");function zCs(t,e){var r;return t<256||e.isEven()?r=new dZ(e):r=new fZ(e),this.exp(t,r)}a(zCs,"bnModPowInt");zt.prototype.copyTo=ACs;zt.prototype.fromInt=yCs;zt.prototype.fromString=ECs;zt.prototype.clamp=_Cs;zt.prototype.dlShiftTo=ICs;zt.prototype.drShiftTo=xCs;zt.prototype.lShiftTo=wCs;zt.prototype.rShiftTo=RCs;zt.prototype.subTo=kCs;zt.prototype.multiplyTo=PCs;zt.prototype.squareTo=DCs;zt.prototype.divRemTo=NCs;zt.prototype.invDigit=QCs;zt.prototype.isEven=VCs;zt.prototype.exp=WCs;zt.prototype.toString=vCs;zt.prototype.negate=CCs;zt.prototype.abs=bCs;zt.prototype.compareTo=SCs;zt.prototype.bitLength=TCs;zt.prototype.mod=MCs;zt.prototype.modPowInt=zCs;zt.ZERO=xj(0);zt.ONE=xj(1);function YCs(){var t=Va();return this.copyTo(t),t}a(YCs,"bnClone");function KCs(){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(JCs,"bnByteValue");function ZCs(){return this.t==0?this.s:this.data[0]<<16>>16}a(ZCs,"bnShortValue");function XCs(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(XCs,"bnpChunkSize");function ebs(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(ebs,"bnSigNum");function tbs(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=xj(r),o=Va(),s=Va(),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(tbs,"bnpToRadix");function rbs(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&&zt.ZERO.subTo(this,this)}a(rbs,"bnpFromRadix");function nbs(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(zt.ONE.shiftLeft(t-1),_rr,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(zt.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(ibs,"bnToByteArray");function obs(t){return this.compareTo(t)==0}a(obs,"bnEquals");function sbs(t){return this.compareTo(t)<0?this:t}a(sbs,"bnMin");function abs(t){return this.compareTo(t)>0?this:t}a(abs,"bnMax");function cbs(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(Abs,"lbit");function ybs(){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(Ibs,"bnpAddTo");function xbs(t){var e=Va();return this.addTo(t,e),e}a(xbs,"bnAdd");function wbs(t){var e=Va();return this.subTo(t,e),e}a(wbs,"bnSubtract");function Rbs(t){var e=Va();return this.multiplyTo(t,e),e}a(Rbs,"bnMultiply");function kbs(){var t=Va();return this.squareTo(t),t}a(kbs,"bnSquare");function Pbs(t){var e=Va();return this.divRemTo(t,e,null),e}a(Pbs,"bnDivide");function Dbs(t){var e=Va();return this.divRemTo(t,null,e),e}a(Dbs,"bnRemainder");function Nbs(t){var e=Va(),r=Va();return this.divRemTo(t,e,r),new Array(e,r)}a(Nbs,"bnDivideAndRemainder");function Mbs(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(Mbs,"bnpDMultiply");function Obs(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(Obs,"bnpDAddOffset");function ePe(){}a(ePe,"NullExp");function v3n(t){return t}a(v3n,"nNop");function Lbs(t,e,r){t.multiplyTo(e,r)}a(Lbs,"nMulTo");function Bbs(t,e){t.squareTo(e)}a(Bbs,"nSqrTo");ePe.prototype.convert=v3n;ePe.prototype.revert=v3n;ePe.prototype.mulTo=Lbs;ePe.prototype.sqrTo=Bbs;function Fbs(t){return this.exp(t,new ePe)}a(Fbs,"bnPow");function Ubs(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=Va();return t.copyTo(e),this.reduce(e),e}a(qbs,"barrettConvert");function jbs(t){return t}a(jbs,"barrettRevert");function Hbs(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(Hbs,"barrettReduce");function Gbs(t,e){t.squareTo(e),this.reduce(e)}a(Gbs,"barrettSqrTo");function $bs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a($bs,"barrettMulTo");Gfe.prototype.convert=qbs;Gfe.prototype.revert=jbs;Gfe.prototype.reduce=Hbs;Gfe.prototype.mulTo=$bs;Gfe.prototype.sqrTo=Gbs;function Vbs(t,e){var r=t.bitLength(),n,o=xj(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 dZ(e):e.isEven()?s=new Gfe(e):s=new fZ(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=Va();for(s.sqrTo(c[1],f);l<=d;)c[l]=Va(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=Va(),y;for(r=$it(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(Wbs,"bnGCD");function zbs(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(zbs,"bnpModInt");function Ybs(t){if(this.signum()==0)return zt.ZERO;var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return zt.ZERO;for(var r=t.clone(),n=this.clone(),o=xj(1),s=xj(0),c=xj(0),l=xj(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(zt.ONE)!=0)return zt.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(Ybs,"bnModInverse");var C2=[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],Kbs=(1<<26)/C2[C2.length-1];function Jbs(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=C2[C2.length-1]){for(e=0;e=0);var l=s.modPow(n,this);if(l.compareTo(zt.ONE)!=0&&l.compareTo(e)!=0){for(var u=1;u++{p();var S5=As();E5();ac();var S3n=I3n.exports=S5.sha1=S5.sha1||{};S5.md.sha1=S5.md.algorithms.sha1=S3n;S3n.create=function(){T3n||e1s();var t=null,e=S5.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),b3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=S5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(vrr.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};b3n(h,r,o);var m=S5.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 vrr=null,T3n=!1;function e1s(){vrr="\x80",vrr+=S5.util.fillString("\0",64),T3n=!0}a(e1s,"_init");function b3n(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(b3n,"_update")});var Crr=I((fif,w3n)=>{p();var T5=As();ac();xw();$fe();var x3n=w3n.exports=T5.pkcs1=T5.pkcs1||{};x3n.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=T5.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(Vit,"rsa_mgf1")});var Srr=I((mif,brr)=>{p();var wj=As();ac();tPe();xw();(function(){if(wj.prime){brr.exports=wj.prime;return}var t=brr.exports=wj.prime=wj.prime||{},e=wj.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||wj.random,E={nextBytes:a(function(_){for(var v=y.getBytesSync(_.length),b=0;b<_.length;++b)_[b]=v.charCodeAt(b)},"nextBytes")};if(A.name==="PRIMEINC")return s(h,E,A.options,g);throw new Error("Invalid prime generation algorithm: "+A.name)};function s(h,m,g,A){return"workers"in g?u(h,m,g,A):c(h,m,g,A)}a(s,"primeincFindPrime");function c(h,m,g,A){var y=d(h,m),E=0,_=f(y.bitLength());"millerRabinTests"in g&&(_=g.millerRabinTests);var v=10;"maxBlockTime"in g&&(v=g.maxBlockTime),l(y,h,m,E,_,v,A)}a(c,"primeincFindPrimeWithoutWorkers");function l(h,m,g,A,y,E,_){var v=+new Date;do{if(h.bitLength()>m&&(h=d(m,g)),h.isProbablePrime(y))return _(null,h);h.dAddOffset(r[A++%8],0)}while(E<0||+new Date-v"u")return c(h,m,g,A);var y=d(h,m),E=g.workers,_=g.workLoad||100,v=_*30/8,b=g.workerScript||"forge/prime.worker.js";if(E===-1)return wj.util.estimateCores(function(w,R){w&&(R=2),E=R-1,T()});T();function T(){E=Math.max(1,E);for(var w=[],R=0;Rh&&(y=d(h,m));var q=y.toString(16);N.target.postMessage({hex:q,workLoad:_}),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 rPe=I((yif,O3n)=>{p();var Ci=As();v2();tPe();Ij();Crr();Srr();xw();ac();typeof Wa>"u"&&(Wa=Ci.jsbn.BigInteger);var Wa,Trr=Ci.util.isNodejs?require("crypto"):null,pt=Ci.asn1,Rw=Ci.util;Ci.pki=Ci.pki||{};O3n.exports=Ci.pki.rsa=Ci.rsa=Ci.rsa||{};var qo=Ci.pki,t1s=[6,4,2,4,2,4,6,2],r1s={name:"PrivateKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},n1s={name:"RSAPrivateKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},i1s={name:"RSAPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},o1s=Ci.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},s1s={name:"DigestInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:pt.Class.UNIVERSAL,type:pt.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},a1s=a(function(t){var e;if(t.algorithm in qo.oids)e=qo.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=pt.oidToDer(e).getBytes(),o=pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[]),s=pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[]);s.value.push(pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,n)),s.value.push(pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,""));var c=pt.create(pt.Class.UNIVERSAL,pt.Type.OCTETSTRING,!1,t.digest().getBytes());return o.value.push(s),o.value.push(c),pt.toDer(o).getBytes()},"emsaPkcs1v15encode"),N3n=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(Wa.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Wa.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new Wa(Ci.util.bytesToHex(Ci.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Wa.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");qo.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=M3n(t,e,r)):(o=Ci.util.createBuffer(),o.putBytes(t));for(var c=new Wa(o.toHex(),16),l=N3n(c,e,n),u=l.toString(16),d=Ci.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.util.hexToBytes(u)),d.getBytes()};qo.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 Wa(Ci.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=N3n(c,e,r),u=l.toString(16),d=Ci.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.util.hexToBytes(u)),n!==!1?Wit(d.getBytes(),e,r):d.getBytes()};qo.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||Ci.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};qo.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new Wa(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(l1s(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(t1s[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(Wa.ONE).gcd(t.e).compareTo(Wa.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(Wa.ONE),t.q1=t.q.subtract(Wa.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(Wa.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:qo.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:qo.rsa.setPublicKey(t.n,t.e)}}c=+new Date,l+=c-s,s=c}return t.keys!==null};qo.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),!Ci.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(R3n("generateKeyPair"))return Trr.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:qo.privateKeyFromPem(d),publicKey:qo.publicKeyFromPem(u)})});if(k3n("generateKey")&&k3n("exportKey"))return Rw.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:D3n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return Rw.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=qo.privateKeyFromAsn1(pt.fromDer(Ci.util.createBuffer(l)));n(null,{privateKey:u,publicKey:qo.setRsaPublicKey(u.n,u.e)})}});if(P3n("generateKey")&&P3n("exportKey")){var o=Rw.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:D3n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=Rw.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=qo.privateKeyFromAsn1(pt.fromDer(Ci.util.createBuffer(h)));n(null,{privateKey:m,publicKey:qo.setRsaPublicKey(m.n,m.e)})},d.onerror=function(f){n(f)}},o.onerror=function(l){n(l)};return}}else if(R3n("generateKeyPairSync")){var s=Trr.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:qo.privateKeyFromPem(s.privateKey),publicKey:qo.publicKeyFromPem(s.publicKey)}}}var c=qo.rsa.createKeyPairGenerationState(t,e,r);if(!n)return qo.rsa.stepKeyPairGenerationState(c,0),c.keys;c1s(c,r,n)};qo.setRsaPublicKey=qo.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 M3n(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return Ci.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 qo.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=Wit(d,r,!0,void 0,c);var f=pt.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!pt.validate(f,s1s,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=pt.derToOid(h.algorithmIdentifier);if(!(A===Ci.oids.md2||A===Ci.oids.md5||A===Ci.oids.sha1||A===Ci.oids.sha224||A===Ci.oids.sha256||A===Ci.oids.sha384||A===Ci.oids.sha512||A===Ci.oids["sha512-224"]||A===Ci.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===Ci.oids.md2||A===Ci.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=Wit(d,r,!0,void 0,c),u===d},"verify")});var l=qo.rsa.decrypt(o,r,!0,!1);return s.verify(n,l,r.n.bitLength())},r};qo.setRsaPrivateKey=qo.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=qo.rsa.decrypt(d,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:Wit};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return Ci.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:a1s},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 qo.rsa.encrypt(m,u,h)},u};qo.wrapRsaPrivateKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,pt.integerToDer(0).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,pt.oidToDer(qo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.OCTETSTRING,!1,pt.toDer(t).getBytes())])};qo.privateKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,r1s,e,r)&&(t=pt.fromDer(Ci.util.createBuffer(e.privateKey))),e={},r=[],!pt.validate(t,n1s,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=Ci.util.createBuffer(e.privateKeyModulus).toHex(),s=Ci.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=Ci.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=Ci.util.createBuffer(e.privateKeyPrime1).toHex(),u=Ci.util.createBuffer(e.privateKeyPrime2).toHex(),d=Ci.util.createBuffer(e.privateKeyExponent1).toHex(),f=Ci.util.createBuffer(e.privateKeyExponent2).toHex(),h=Ci.util.createBuffer(e.privateKeyCoefficient).toHex(),qo.setRsaPrivateKey(new Wa(o,16),new Wa(s,16),new Wa(c,16),new Wa(l,16),new Wa(u,16),new Wa(d,16),new Wa(f,16),new Wa(h,16))};qo.privateKeyToAsn1=qo.privateKeyToRSAPrivateKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,pt.integerToDer(0).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.e)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.d)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.p)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.q)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.dP)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.dQ)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.qInv))])};qo.publicKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,o1s,e,r)){var n=pt.derToOid(e.publicKeyOid);if(n!==qo.oids.rsaEncryption){var o=new Error("Cannot read public key. Unknown OID.");throw o.oid=n,o}t=e.rsaPublicKey}if(r=[],!pt.validate(t,i1s,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=Ci.util.createBuffer(e.publicKeyModulus).toHex(),c=Ci.util.createBuffer(e.publicKeyExponent).toHex();return qo.setRsaPublicKey(new Wa(s,16),new Wa(c,16))};qo.publicKeyToAsn1=qo.publicKeyToSubjectPublicKeyInfo=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,pt.oidToDer(qo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.BITSTRING,!1,[qo.publicKeyToRSAPublicKey(t)])])};qo.publicKeyToRSAPublicKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.e))])};function M3n(t,e,r){var n=Ci.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=Ci.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(Wit,"_decodePkcs1_v1_5");function c1s(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){Ci.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(Wa.ONE).gcd(t.e).compareTo(Wa.ONE)!==0){t.p=null,o();return}if(t.q.subtract(Wa.ONE).gcd(t.e).compareTo(Wa.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract(Wa.ONE),t.q1=t.q.subtract(Wa.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(Wa.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:qo.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:qo.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}a(c,"finish")}a(c1s,"_generateKeyPair");function I5(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=Ci.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(I5,"_bnToBytes");function l1s(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(l1s,"_getMillerRabinTests");function R3n(t){return Ci.util.isNodejs&&typeof Trr[t]=="function"}a(R3n,"_detectNodeCrypto");function k3n(t){return typeof Rw.globalScope<"u"&&typeof Rw.globalScope.crypto=="object"&&typeof Rw.globalScope.crypto.subtle=="object"&&typeof Rw.globalScope.crypto.subtle[t]=="function"}a(k3n,"_detectSubtleCrypto");function P3n(t){return typeof Rw.globalScope<"u"&&typeof Rw.globalScope.msCrypto=="object"&&typeof Rw.globalScope.msCrypto.subtle=="object"&&typeof Rw.globalScope.msCrypto.subtle[t]=="function"}a(P3n,"_detectSubtleMsCrypto");function D3n(t){for(var e=Ci.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var _n=As();Tj();v2();Xke();E5();Ij();jit();uZ();xw();Arr();rPe();ac();typeof L3n>"u"&&(L3n=_n.jsbn.BigInteger);var L3n,Nt=_n.asn1,as=_n.pki=_n.pki||{};Q3n.exports=as.pbe=_n.pbe=_n.pbe||{};var pZ=as.oids,u1s={name:"EncryptedPrivateKeyInfo",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},d1s={name:"PBES2Algorithms",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},f1s={name:"pkcs-12PbeParams",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,capture:"iterations"}]};as.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=_n.random.getBytesSync(r.saltSize),o=r.count,s=Nt.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=pZ["aes128-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=pZ["aes192-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=pZ["aes256-CBC"],h=_n.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=pZ.desCBC,h=_n.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=U3n(g),y=_n.pkcs5.pbkdf2(e,n,o,c,A),E=_n.random.getBytesSync(d),_=h(y);_.start(E),_.update(Nt.toDer(t)),_.finish(),u=_.output.getBytes();var v=p1s(n,s,c,g);l=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ.pkcs5PBES2).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ.pkcs5PBKDF2).getBytes()),v]),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(f).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){c=24;var b=new _n.util.ByteBuffer(n),y=as.pbe.generatePkcs12Key(e,b,1,o,c),E=as.pbe.generatePkcs12Key(e,b,2,o,c),_=_n.des.createEncryptionCipher(y);_.start(E),_.update(Nt.toDer(t)),_.finish(),u=_.output.getBytes(),l=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,n),Nt.create(Nt.Class.UNIVERSAL,Nt.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=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[l,Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,u)]);return T};as.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Nt.validate(t,u1s,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=Nt.derToOid(n.encryptionOid),l=as.pbe.getCipher(c,n.encryptionParams,e),u=_n.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Nt.fromDer(l.output)),r};as.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Nt.toDer(t).getBytes()};return _n.pem.encode(r,{maxline:e})};as.encryptedPrivateKeyFromPem=function(t){var e=_n.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 Nt.fromDer(e.body)};as.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=as.wrapRsaPrivateKey(as.privateKeyToAsn1(t));return n=as.encryptPrivateKeyInfo(n,e,r),as.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=_n.random.getBytesSync(8),l=_n.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=_n.random.getBytesSync(8),l=_n.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=_n.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Nt.toDer(as.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:_n.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return _n.pem.encode(h)};as.decryptRsaPrivateKey=function(t,e){var r=null,n=_n.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=_n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=_n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=_n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=_n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=_n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return _n.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return _n.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return _n.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=_n.util.hexToBytes(n.dekInfo.parameters),u=_n.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(_n.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=as.decryptPrivateKeyInfo(Nt.fromDer(r),e):r=Nt.fromDer(r),r!==null&&(r=as.privateKeyFromAsn1(r)),r};as.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in _n.md))throw new Error('"sha1" hash algorithm unavailable.');s=_n.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new _n.util.ByteBuffer,h=new _n.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)B=B>>8,B+=P.at(l)+L.at(l),L.setAt(l,B&255);N.putBuffer(L)}b=N,f.putBuffer(R)}return f.truncate(f.length()-o),f};as.pbe.getCipher=function(t,e,r){switch(t){case as.oids.pkcs5PBES2:return as.pbe.getCipherForPBES2(t,e,r);case as.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case as.oids["pbewithSHAAnd40BitRC2-CBC"]:return as.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}};as.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Nt.validate(e,d1s,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=Nt.derToOid(n.kdfOid),t!==as.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=Nt.derToOid(n.encOid),t!==as.oids["aes128-CBC"]&&t!==as.oids["aes192-CBC"]&&t!==as.oids["aes256-CBC"]&&t!==as.oids["des-EDE3-CBC"]&&t!==as.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=_n.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(as.oids[t]){case"aes128-CBC":u=16,d=_n.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=_n.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=_n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=_n.des.createDecryptionCipher;break;case"desCBC":u=8,d=_n.des.createDecryptionCipher;break}var f=F3n(n.prfOid),h=_n.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};as.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Nt.validate(e,f1s,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=_n.util.createBuffer(n.salt),l=_n.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case as.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=_n.des.startDecrypting;break;case as.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,E){var _=_n.rc2.createDecryptionCipher(y,40);return _.start(E,null),_},"cipherFn");break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=F3n(n.prfOid),m=as.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=as.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};as.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in _n.md))throw new Error('"md5" hash algorithm unavailable.');n=_n.md.md5.create()}e===null&&(e="");for(var o=[B3n(n,t+e)],s=16,c=1;s{p();var Vfe=As();v2();ac();var fn=Vfe.asn1,Wfe=H3n.exports=Vfe.pkcs7asn1=Vfe.pkcs7asn1||{};Vfe.pkcs7=Vfe.pkcs7||{};Vfe.pkcs7.asn1=Wfe;var q3n={name:"ContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Wfe.contentInfoValidator=q3n;var j3n={name:"EncryptedContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Wfe.envelopedDataValidator={name:"EnvelopedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(j3n)};Wfe.encryptedDataValidator={name:"EncryptedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"}].concat(j3n)};var h1s={name:"SignerInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Wfe.signedDataValidator={name:"SignedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},q3n,{name:"SignedData.Certificates",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,capture:"signerInfos",optional:!0,value:[h1s]}]};Wfe.recipientInfoValidator={name:"RecipientInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var wrr=I((Iif,G3n)=>{p();var hZ=As();ac();hZ.mgf=hZ.mgf||{};var m1s=G3n.exports=hZ.mgf.mgf1=hZ.mgf1=hZ.mgf1||{};m1s.create=function(t){var e={generate:a(function(r,n){for(var o=new hZ.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var zit=As();wrr();$3n.exports=zit.mgf=zit.mgf||{};zit.mgf.mgf1=zit.mgf1});var Yit=I((Pif,W3n)=>{p();var mZ=As();xw();ac();var g1s=W3n.exports=mZ.pss=mZ.pss||{};g1s.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=mZ.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||mZ.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+E+"\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)&_)!==0)throw new Error("Bits beyond keysize not zero as expected.");var v=r.generate(E,A),b="";for(h=0;h{p();var bi=As();Tj();v2();Xke();E5();V3n();Ij();uZ();Yit();rPe();ac();var Ae=bi.asn1,Dr=Z3n.exports=bi.pki=bi.pki||{},za=Dr.oids,fp={};fp.CN=za.commonName;fp.commonName="CN";fp.C=za.countryName;fp.countryName="C";fp.L=za.localityName;fp.localityName="L";fp.ST=za.stateOrProvinceName;fp.stateOrProvinceName="ST";fp.O=za.organizationName;fp.organizationName="O";fp.OU=za.organizationalUnitName;fp.organizationalUnitName="OU";fp.E=za.emailAddress;fp.emailAddress="E";var Y3n=bi.pki.rsa.publicKeyValidator,A1s={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"},Y3n,{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"}]},y1s={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"}]}]},E1s={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"},Y3n,{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}]}]}]},_1s={name:"CertificationRequest",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[E1s,{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"}]};Dr.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=Jit({signatureOid:c.signatureOid,type:"certificate"});var d=Ae.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=bi.md.sha1.create(),h=Ae.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return Rj(c.issuer,A)},c.issuer.addField=function(A){kw([A]),c.issuer.attributes.push(A)},c.issuer.attributes=Dr.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=bi.md.sha1.create(),g=Ae.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return Rj(c.subject,A)},c.subject.addField=function(A){kw([A]),c.subject.attributes.push(A)},c.subject.attributes=Dr.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=Dr.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=Dr.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};Dr.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 Dr.oids?e.name=Dr.oids[e.type]:e.shortName&&e.shortName in fp&&(e.name=Dr.oids[fp[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in Dr.oids)e.type=Dr.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 fp&&(e.shortName=fp[e.name]),e.type===za.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(kw,"_fillMissingFields");function J3n(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in Dr.oids&&(t.name=Dr.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in Dr.oids)t.id=Dr.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 za?l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(za[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,[zfe(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=bi.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,[]),E=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(J3n,"_fillMissingExtensionFields");function Rrr(t,e){if(t===za["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(Rrr,"_signatureParametersToAsn1");function v1s(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=C1s&&t0&&n.value.push(Dr.certificateExtensionsToAsn1(t.extensions)),n};Dr.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()),zfe(t.subject),Dr.publicKeyToAsn1(t.publicKey),v1s(t)]);return e};Dr.distinguishedNameToAsn1=function(t){return zfe(t)};Dr.certificateToAsn1=function(t){var e=t.tbsCertificate||Dr.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()),Rrr(t.signatureOid,t.signatureParameters)]),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,"\0"+t.signature)])};Dr.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:Dr.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;bi.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:Dr.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:Dr.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:Dr.certificateError.bad_certificate}),c===null)for(var g={keyUsage:!0,basicConstraints:!0},A=0;c===null&&AE.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:Dr.certificateError.bad_certificate})}}var b=c===null?!0:c.error,T=r.verify?r.verify(b,l,n):b;if(T===!0)c=null;else throw b===!0&&(c={message:"The application rejected the certificate.",error:Dr.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!bi.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 Prr=I((Lif,eFn)=>{p();var xu=As();v2();qfe();Ij();xrr();Irr();xw();rPe();$fe();ac();Zit();var Ke=xu.asn1,ea=xu.pki,iPe=eFn.exports=xu.pkcs12=xu.pkcs12||{},X3n={name:"ContentInfo",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},S1s={name:"PFX",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.INTEGER,constructed:!1,capture:"version"},X3n,{name:"PFX.macData",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Ke.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},T1s={name:"SafeBag",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},I1s={name:"Attribute",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SET,constructed:!0,capture:"values"}]},x1s={name:"CertBag",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Ke.Class.UNIVERSAL,type:Ke.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function nPe(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(nPe,"_getBagsByAttribute");iPe.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Ke.validate(t,S1s,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(E){var _={},v;return"localKeyId"in E?v=E.localKeyId:"localKeyIdHex"in E&&(v=xu.util.hexToBytes(E.localKeyIdHex)),v===void 0&&!("friendlyName"in E)&&"bagType"in E&&(_[E.bagType]=nPe(c.safeContents,null,null,E.bagType)),v!==void 0&&(_.localKeyId=nPe(c.safeContents,"localKeyId",v,E.bagType)),"friendlyName"in E&&(_.friendlyName=nPe(c.safeContents,"friendlyName",E.friendlyName,E.bagType)),_},"getBags"),getBagsByFriendlyName:a(function(E,_){return nPe(c.safeContents,"friendlyName",E,_)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(E,_){return nPe(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(Ke.derToOid(n.contentType)!==ea.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Ke.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Ke.Class.UNIVERSAL||l.type!==Ke.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=krr(l),n.mac){var u=null,d=0,f=Ke.derToOid(n.macAlgorithm);switch(f){case ea.oids.sha1:u=xu.md.sha1.create(),d=20;break;case ea.oids.sha256:u=xu.md.sha256.create(),d=32;break;case ea.oids.sha384:u=xu.md.sha384.create(),d=48;break;case ea.oids.sha512:u=xu.md.sha512.create(),d=64;break;case ea.oids.md5:u=xu.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new xu.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(xu.util.bytesToHex(n.macIterations),16):1,g=iPe.generateKey(r,h,3,m,d,u),A=xu.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 w1s(c,l.value,e,r),c};function krr(t){if(t.composed||t.constructed){for(var e=xu.util.createBuffer(),r=0;r0&&(s=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SET,!0,u));var d=[],f=[];e!==null&&(xu.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var E=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,h),_=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(E).getBytes())])]);d.push(_)}var v=null;if(t!==null){var b=ea.wrapRsaPrivateKey(ea.privateKeyToAsn1(t));r===null?v=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.keyBag).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):v=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.pkcs8ShroudedKeyBag).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[ea.encryptPrivateKeyInfo(b,r,n)]),s]);var T=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[v]),w=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(T).getBytes())])]);d.push(w)}var R=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=xu.md.sha1.create(),P=new xu.util.ByteBuffer(xu.random.getBytes(n.saltSize)),D=n.count,t=iPe.generateKey(r,P,3,D,20),N=xu.hmac.create();N.start(l,t),N.update(Ke.toDer(R).getBytes());var L=N.getMac();x=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.sha1).getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.NULL,!1,"")]),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,L.getBytes())]),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,P.getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.INTEGER,!1,Ke.integerToDer(D).getBytes())])}return Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.INTEGER,!1,Ke.integerToDer(3).getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(R).getBytes())])]),x])};iPe.generateKey=xu.pbe.generatePkcs12Key});var Nrr=I((Uif,tFn)=>{p();var kj=As();v2();Ij();Irr();uZ();jit();Prr();Yit();rPe();ac();Zit();var Drr=kj.asn1,Yfe=tFn.exports=kj.pki=kj.pki||{};Yfe.pemToDer=function(t){var e=kj.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return kj.util.createBuffer(e.body)};Yfe.privateKeyFromPem=function(t){var e=kj.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=Drr.fromDer(e.body);return Yfe.privateKeyFromAsn1(n)};Yfe.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:Drr.toDer(Yfe.privateKeyToAsn1(t)).getBytes()};return kj.pem.encode(r,{maxline:e})};Yfe.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:Drr.toDer(t).getBytes()};return kj.pem.encode(r,{maxline:e})}});var Urr=I((qif,lFn)=>{p();var Jt=As();v2();qfe();Fit();uZ();Nrr();xw();$fe();ac();var rot=a(function(t,e,r,n){var o=Jt.util.createBuffer(),s=t.length>>1,c=s+(t.length&1),l=t.substr(0,c),u=t.substr(s,c),d=Jt.util.createBuffer(),f=Jt.hmac.create();r=e+r;var h=Math.ceil(n/16),m=Math.ceil(n/20);f.start("MD5",l);var g=Jt.util.createBuffer();d.putBytes(r);for(var A=0;A0&&(_e.queue(t,_e.createAlert(t,{level:_e.Alert.Level.warning,description:_e.Alert.Description.no_renegotiation})),_e.flush(t)),t.process()};_e.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});else{var s=e.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:Jt.util.createBuffer(s.getBytes(32)),session_id:mT(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=mT(s,2),n.compression_methods=mT(s,1)),c=r-(c-s.length()),c>0){for(var l=mT(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:mT(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(mT(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:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=_e.getCipherSuite(n.cipher_suite);else for(var m=Jt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure},cipherSuite:Jt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=_e.CompressionMethod.none}return n};_e.createSecurityParameters=function(t,e){var r=t.entity===_e.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:_e.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:_e.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}};_e.handleServerHello=function(t,e,r){var n=_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=iFn,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=L1s,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.session.id=o,t.process()}};_e.handleClientHello=function(t,e,r){var n=_e.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=Jt.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;l<_e.SupportedVersions.length&&(c=_e.SupportedVersions[l],!(c.minor<=n.version.minor));++l);t.version={major:c.major,minor:c.minor},t.session.version=t.version}s!==null?(t.expect=Brr,t.session.resuming=!0,t.session.sp.client_random=n.random.bytes()):(t.expect=t.verifyClient!==!1?H1s:Lrr,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.open=!0,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHello(t)})),t.session.resuming?(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.pending=_e.createConnectionState(t),t.state.current.write=t.state.pending.write,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))):(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)})),t.fail||(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerKeyExchange(t)})),t.verifyClient!==!1&&_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificateRequest(t)})),_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHelloDone(t)})))),_e.flush(t),t.process()}};_e.handleCertificate=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_list:mT(n,3)},s,c,l=[];try{for(;o.certificate_list.length()>0;)s=mT(o.certificate_list,3),c=Jt.asn1.fromDer(s),s=Jt.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:_e.Alert.Level.fatal,description:_e.Alert.Description.bad_certificate}})}var u=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?rFn:Lrr:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],_e.verifyCertificateChain(t,l)&&(t.expect=u?rFn:Lrr)),t.process()};_e.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});t.expect=B1s,t.process()};_e.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:mT(n,2).getBytes()},s=null;if(t.getPrivateKey)try{s=t.getPrivateKey(t,t.session.serverCertificate),s=Jt.pki.privateKeyFromPem(s)}catch(u){t.error(t,{message:"Could not get private key.",cause:u,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.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=Jt.random.getBytes(48)}t.expect=Brr,t.session.clientCertificate!==null&&(t.expect=G1s),t.process()};_e.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:mT(n,1),certificate_authorities:mT(n,2)};t.session.certificateRequest=o,t.expect=F1s,t.process()};_e.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:mT(n,2).getBytes()},c=Jt.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:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure}})}t.expect=Brr,t.process()};_e.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.insufficient_security}},o=0,s=t.verify(t,n.alert.description,o,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!Jt.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=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)}),_e.queue(t,e)),e=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createClientKeyExchange(t)}),_e.queue(t,e),t.expect=q1s;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createCertificateVerify(l,u)})),_e.queue(l,_e.createRecord(l,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),l.state.pending=_e.createConnectionState(l),l.state.current.write=l.state.pending.write,_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createFinished(l)})),l.expect=iFn,_e.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);_e.getClientSignature(t,c)};_e.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var r=t.entity===_e.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=_e.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?U1s:$1s,t.process()};_e.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=Jt.util.createBuffer(),n.putBuffer(t.session.md5.digest()),n.putBuffer(t.session.sha1.digest());var c=t.entity===_e.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=rot;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:_e.Alert.Level.fatal,description:_e.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))),t.expect=c?Q1s:V1s,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,_e.flush(t),t.isConnected=!0,t.connected(t),t.process()};_e.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case _e.Alert.Description.close_notify:o="Connection closed.";break;case _e.Alert.Description.unexpected_message:o="Unexpected message.";break;case _e.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case _e.Alert.Description.decryption_failed:o="Decryption failed.";break;case _e.Alert.Description.record_overflow:o="Record overflow.";break;case _e.Alert.Description.decompression_failure:o="Decompression failed.";break;case _e.Alert.Description.handshake_failure:o="Handshake failure.";break;case _e.Alert.Description.bad_certificate:o="Bad certificate.";break;case _e.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case _e.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case _e.Alert.Description.certificate_expired:o="Certificate expired.";break;case _e.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case _e.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case _e.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case _e.Alert.Description.access_denied:o="Access denied.";break;case _e.Alert.Description.decode_error:o="Decode error.";break;case _e.Alert.Description.decrypt_error:o="Decrypt error.";break;case _e.Alert.Description.export_restriction:o="Export restriction.";break;case _e.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case _e.Alert.Description.insufficient_security:o="Insufficient security.";break;case _e.Alert.Description.internal_error:o="Internal error.";break;case _e.Alert.Description.user_canceled:o="User canceled.";break;case _e.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===_e.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===_e.ConnectionEnd.client?"server":"client",alert:n}),t.process()};_e.handleHandshake=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=Jt.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var s=r.bytes(o+4);r.read+=4,n in tot[t.entity][t.expect]?(t.entity===_e.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:Jt.md.md5.create(),sha1:Jt.md.sha1.create()}),n!==_e.HandshakeType.hello_request&&n!==_e.HandshakeType.certificate_verify&&n!==_e.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),tot[t.entity][t.expect][n](t,e,o)):_e.handleUnexpected(t,e)};_e.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};_e.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===_e.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();_e.queue(t,_e.createRecord(t,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_response,s)})),_e.flush(t)}else if(n===_e.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Jt.util.createBuffer(s))}t.process()};var O1s=0,L1s=1,rFn=2,B1s=3,F1s=4,iFn=5,U1s=6,Q1s=7,q1s=8,j1s=0,H1s=1,Lrr=2,G1s=3,Brr=4,$1s=5,V1s=6,Ee=_e.handleUnexpected,oFn=_e.handleChangeCipherSpec,jA=_e.handleAlert,av=_e.handleHandshake,sFn=_e.handleApplicationData,HA=_e.handleHeartbeat,Frr=[];Frr[_e.ConnectionEnd.client]=[[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[oFn,jA,Ee,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,sFn,HA],[Ee,jA,av,Ee,HA]];Frr[_e.ConnectionEnd.server]=[[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[oFn,jA,Ee,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,sFn,HA],[Ee,jA,av,Ee,HA]];var Pj=_e.handleHelloRequest,W1s=_e.handleServerHello,aFn=_e.handleCertificate,nFn=_e.handleServerKeyExchange,Mrr=_e.handleCertificateRequest,Xit=_e.handleServerHelloDone,cFn=_e.handleFinished,tot=[];tot[_e.ConnectionEnd.client]=[[Ee,Ee,W1s,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,aFn,nFn,Mrr,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,nFn,Mrr,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Mrr,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,cFn],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];var z1s=_e.handleClientHello,Y1s=_e.handleClientKeyExchange,K1s=_e.handleCertificateVerify;tot[_e.ConnectionEnd.server]=[[Ee,z1s,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,aFn,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Y1s,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,K1s,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,cFn],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];_e.generateKeys=function(t,e){var r=rot,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===_e.Versions.TLS_1_0.major&&t.version.minor===_e.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};_e.createConnectionState=function(t){var e=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=_e.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 _e.CompressionMethod.none:break;case _e.CompressionMethod.deflate:n.read.compressFunction=M1s,n.write.compressFunction=N1s;break;default:throw new Error("Unsupported compression algorithm.")}}return n};_e.createRandom=function(){var t=new Date,e=+t+t.getTimezoneOffset()*6e4,r=Jt.util.createBuffer();return r.putInt32(e),r.putBytes(Jt.random.getBytes(28)),r};_e.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};_e.createAlert=function(t,e){var r=Jt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),_e.createRecord(t,{type:_e.ContentType.alert,data:r})};_e.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=Jt.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=Jt.util.createBuffer();return A.putByte(_e.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),Pw(A,1,Jt.util.createBuffer(m)),Pw(A,2,e),Pw(A,1,s),h>0&&Pw(A,2,l),A};_e.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Jt.util.createBuffer();return n.putByte(_e.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),Pw(n,1,Jt.util.createBuffer(e)),n.putByte(t.session.cipherSuite.id[0]),n.putByte(t.session.cipherSuite.id[1]),n.putByte(t.session.compressionMethod),n};_e.createCertificate=function(t){var e=t.entity===_e.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=Jt.util.createBuffer();if(r!==null)try{Jt.util.isArray(r)||(r=[r]);for(var s=null,c=0;c0&&(r.putByte(_e.HandshakeType.server_key_exchange),r.putInt24(e)),r};_e.getClientSignature=function(t,e){var r=Jt.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=Jt.pki.privateKeyFromPem(c)}catch(l){n.error(n,{message:"Could not get private key.",cause:l,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};_e.createCertificateVerify=function(t,e){var r=e.length+2,n=Jt.util.createBuffer();return n.putByte(_e.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};_e.createCertificateRequest=function(t){var e=Jt.util.createBuffer();e.putByte(1);var r=Jt.util.createBuffer();for(var n in t.caStore.certs){var o=t.caStore.certs[n],s=Jt.pki.distinguishedNameToAsn1(o.subject),c=Jt.asn1.toDer(s);r.putInt16(c.length()),r.putBuffer(c)}var l=1+e.length()+2+r.length(),u=Jt.util.createBuffer();return u.putByte(_e.HandshakeType.certificate_request),u.putInt24(l),Pw(u,1,e),Pw(u,2,r),u};_e.createServerHelloDone=function(t){var e=Jt.util.createBuffer();return e.putByte(_e.HandshakeType.server_hello_done),e.putInt24(0),e};_e.createChangeCipherSpec=function(){var t=Jt.util.createBuffer();return t.putByte(1),t};_e.createFinished=function(t){var e=Jt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===_e.ConnectionEnd.client,n=t.session.sp,o=12,s=rot,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Jt.util.createBuffer();return l.putByte(_e.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};_e.createHeartbeat=function(t,e,r){typeof r>"u"&&(r=e.length);var n=Jt.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(Jt.random.getBytes(s)),n};_e.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===_e.ContentType.handshake||e.type===_e.ContentType.alert||e.type===_e.ContentType.change_cipher_spec))){if(e.type===_e.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()<=_e.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>_e.MaxFragment;)n.push(_e.createRecord(t,{type:e.type,data:Jt.util.createBuffer(o.slice(0,_e.MaxFragment))})),o=o.slice(_e.MaxFragment);o.length>0&&n.push(_e.createRecord(t,{type:e.type,data:Jt.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=Jt.util.bytesToHex(o);r.order.push(c),r.cache[c]=s}}return r};_e.createConnection=function(t){var e=null;t.caStore?Jt.util.isArray(t.caStore)?e=Jt.pki.createCaStore(t.caStore):e=t.caStore:e=Jt.pki.createCaStore();var r=t.cipherSuites||null;if(r===null){r=[];for(var n in _e.CipherSuites)r.push(_e.CipherSuites[n])}var o=t.server?_e.ConnectionEnd.server:_e.ConnectionEnd.client,s=t.sessionCache?_e.createSessionCache(t.sessionCache):null,c={version:{major:_e.Version.major,minor:_e.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:Jt.util.createBuffer(),tlsData:Jt.util.createBuffer(),data:Jt.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===_e.ConnectionEnd.client?"client":"server"),h.send&&(_e.queue(f,_e.createAlert(f,h.alert)),_e.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:_e.Version.major,minor:_e.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===_e.ConnectionEnd.client?O1s:j1s,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=_e.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-_e.ContentType.change_cipher_spec,g=Frr[f.entity][f.expect];m in g?g[m](f,h):_e.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:Jt.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:_e.Alert.Level.fatal,description:_e.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:Jt.md.md5.create(),sha1:Jt.md.sha1.create()},h&&(c.version=h.version,c.session.sp=h.sp),c.session.sp.client_random=_e.createRandom().getBytes(),c.open=!0,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.handshake,data:_e.createClientHello(c)})),_e.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 _e.queue(c,_e.createRecord(c,{type:_e.ContentType.application_data,data:Jt.util.createBuffer(f)})),_e.flush(c)},c.prepareHeartbeatRequest=function(f,h){return f instanceof Jt.util.ByteBuffer&&(f=f.bytes()),typeof h>"u"&&(h=f.length),c.expectedHeartbeatPayload=f,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_request,f,h)})),_e.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,_e.queue(c,_e.createAlert(c,{level:_e.Alert.Level.warning,description:_e.Alert.Description.close_notify})),_e.flush(c)),c.closed(c)),c.reset(f)},c};lFn.exports=Jt.tls=Jt.tls||{};for(eot in _e)typeof _e[eot]!="function"&&(Jt.tls[eot]=_e[eot]);var eot;Jt.tls.prf_tls1=rot;Jt.tls.hmac_sha1=D1s;Jt.tls.createSessionCache=_e.createSessionCache;Jt.tls.createConnection=_e.createConnection});var fFn=I((Gif,dFn)=>{p();var Dj=As();Tj();Urr();var Dw=dFn.exports=Dj.tls;Dw.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=Dw.BulkCipherAlgorithm.aes,t.cipher_type=Dw.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Dw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:uFn};Dw.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=Dw.BulkCipherAlgorithm.aes,t.cipher_type=Dw.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Dw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:uFn};function uFn(t,e,r){var n=e.entity===Dj.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:Dj.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:Dj.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=tSs,t.write.cipherFunction=Z1s,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=Dw.hmac_sha1}a(uFn,"initConnectionState");function Z1s(t,e){var r=!1,n=e.macFunction(e.macKey,e.sequenceNumber,t);t.fragment.putBytes(n),e.updateSequenceNumber();var o;t.version.minor===Dw.Versions.TLS_1_0.minor?o=e.cipherState.init?null:e.cipherState.iv:o=Dj.random.getBytesSync(16),e.cipherState.init=!0;var s=e.cipherState.cipher;return s.start({iv:o}),t.version.minor>=Dw.Versions.TLS_1_1.minor&&s.output.putBytes(o),s.update(t.fragment),s.finish(X1s)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(Z1s,"encrypt_aes_cbc_sha1");function X1s(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(X1s,"encrypt_aes_cbc_sha1_padding");function eSs(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=Dj.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=rSs(e.macKey,c,u)&&r,r}a(tSs,"decrypt_aes_cbc_sha1");function rSs(t,e,r){var n=Dj.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(rSs,"compareMacs")});var jrr=I((Wif,gFn)=>{p();var cd=As();E5();ac();var oPe=gFn.exports=cd.sha512=cd.sha512||{};cd.md.sha512=cd.md.algorithms.sha512=oPe;var hFn=cd.sha384=cd.sha512.sha384=cd.sha512.sha384||{};hFn.create=function(){return oPe.create("SHA-384")};cd.md.sha384=cd.md.algorithms.sha384=hFn;cd.sha512.sha256=cd.sha512.sha256||{create:a(function(){return oPe.create("SHA-512/256")},"create")};cd.md["sha512/256"]=cd.md.algorithms["sha512/256"]=cd.sha512.sha256;cd.sha512.sha224=cd.sha512.sha224||{create:a(function(){return oPe.create("SHA-512/224")},"create")};cd.md["sha512/224"]=cd.md.algorithms["sha512/224"]=cd.sha512.sha224;oPe.create=function(t){if(mFn||nSs(),typeof t>"u"&&(t="SHA-512"),!(t in gZ))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=gZ[t],r=null,n=cd.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),pFn(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=cd.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(Qrr.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(O=0;O<16;++O)e[O][0]=r.getInt32()>>>0,e[O][1]=r.getInt32()>>>0;for(;O<80;++O)U=e[O-2],j=U[0],Q=U[1],n=((j>>>19|Q<<13)^(Q>>>29|j<<3)^j>>>6)>>>0,o=((j<<13|Q>>>19)^(Q<<3|j>>>29)^(j<<26|Q>>>6))>>>0,W=e[O-15],j=W[0],Q=W[1],s=((j>>>1|Q<<31)^(j>>>8|Q<<24)^j>>>7)>>>0,c=((j<<31|Q>>>1)^(j<<24|Q>>>8)^(j<<25|Q>>>7))>>>0,Y=e[O-7],V=e[O-16],Q=o+Y[1]+c+V[1],e[O][0]=n+Y[0]+s+V[0]+(Q/4294967296>>>0)>>>0,e[O][1]=Q>>>0;for(y=t[0][0],E=t[0][1],_=t[1][0],v=t[1][1],b=t[2][0],T=t[2][1],w=t[3][0],R=t[3][1],x=t[4][0],P=t[4][1],D=t[5][0],N=t[5][1],L=t[6][0],B=t[6][1],q=t[7][0],M=t[7][1],O=0;O<80;++O)d=((x>>>14|P<<18)^(x>>>18|P<<14)^(P>>>9|x<<23))>>>0,f=((x<<18|P>>>14)^(x<<14|P>>>18)^(P<<23|x>>>9))>>>0,h=(L^x&(D^L))>>>0,m=(B^P&(N^B))>>>0,l=((y>>>28|E<<4)^(E>>>2|y<<30)^(E>>>7|y<<25))>>>0,u=((y<<4|E>>>28)^(E<<30|y>>>2)^(E<<25|y>>>7))>>>0,g=(y&_|b&(y^_))>>>0,A=(E&v|T&(E^v))>>>0,Q=M+f+m+qrr[O][1]+e[O][1],n=q+d+h+qrr[O][0]+e[O][0]+(Q/4294967296>>>0)>>>0,o=Q>>>0,Q=u+A,s=l+g+(Q/4294967296>>>0)>>>0,c=Q>>>0,q=L,M=B,L=D,B=N,D=x,N=P,Q=R+o,x=w+n+(Q/4294967296>>>0)>>>0,P=Q>>>0,w=b,R=T,b=_,T=v,_=y,v=E,Q=o+c,y=n+s+(Q/4294967296>>>0)>>>0,E=Q>>>0;Q=t[0][1]+E,t[0][0]=t[0][0]+y+(Q/4294967296>>>0)>>>0,t[0][1]=Q>>>0,Q=t[1][1]+v,t[1][0]=t[1][0]+_+(Q/4294967296>>>0)>>>0,t[1][1]=Q>>>0,Q=t[2][1]+T,t[2][0]=t[2][0]+b+(Q/4294967296>>>0)>>>0,t[2][1]=Q>>>0,Q=t[3][1]+R,t[3][0]=t[3][0]+w+(Q/4294967296>>>0)>>>0,t[3][1]=Q>>>0,Q=t[4][1]+P,t[4][0]=t[4][0]+x+(Q/4294967296>>>0)>>>0,t[4][1]=Q>>>0,Q=t[5][1]+N,t[5][0]=t[5][0]+D+(Q/4294967296>>>0)>>>0,t[5][1]=Q>>>0,Q=t[6][1]+B,t[6][0]=t[6][0]+L+(Q/4294967296>>>0)>>>0,t[6][1]=Q>>>0,Q=t[7][1]+M,t[7][0]=t[7][0]+q+(Q/4294967296>>>0)>>>0,t[7][1]=Q>>>0,z-=128}}a(pFn,"_update")});var AFn=I(Hrr=>{p();var iSs=As();v2();var Dg=iSs.asn1;Hrr.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Hrr.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var kFn=I((Zif,RFn)=>{p();var GA=As();tPe();xw();jrr();ac();var bFn=AFn(),oSs=bFn.publicKeyValidator,sSs=bFn.privateKeyValidator;typeof yFn>"u"&&(yFn=GA.jsbn.BigInteger);var yFn,$rr=GA.util.ByteBuffer,ub=typeof Buffer>"u"?Uint8Array:Buffer;GA.pki=GA.pki||{};RFn.exports=GA.pki.ed25519=GA.ed25519=GA.ed25519||{};var ta=GA.ed25519;ta.constants={};ta.constants.PUBLIC_KEY_BYTE_LENGTH=32;ta.constants.PRIVATE_KEY_BYTE_LENGTH=64;ta.constants.SEED_BYTE_LENGTH=32;ta.constants.SIGN_BYTE_LENGTH=64;ta.constants.HASH_BYTE_LENGTH=64;ta.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=GA.random.getBytesSync(ta.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==ta.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+ta.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=qF({message:e,encoding:"binary"});for(var r=new ub(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=new ub(ta.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return uSs(r,n),{publicKey:r,privateKey:n}};ta.privateKeyFromAsn1=function(t){var e={},r=[],n=GA.asn1.validate(t,sSs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=GA.asn1.derToOid(e.privateKeyOid),c=GA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=qF({message:GA.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};ta.publicKeyFromAsn1=function(t){var e={},r=[],n=GA.asn1.validate(t,oSs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=GA.asn1.derToOid(e.publicKeyOid),c=GA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==ta.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return qF({message:l,encoding:"binary"})};ta.publicKeyFromPrivateKey=function(t){t=t||{};var e=qF({message:t.privateKey,encoding:"binary"});if(e.length!==ta.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ta.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new ub(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function qF(t){var e=t.message;if(e instanceof Uint8Array||e instanceof ub)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 $rr(e,r)}else if(!(e instanceof $rr))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 ub(e.length()),o=0;o=0;--r){if(t[e+r]sPe[r])return!1}return!1}a(pSs,"_isCanonicalSignatureScalar");function SFn(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)*sPe[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*sPe[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(SFn,"modL");function Wrr(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;SFn(t,e)}a(Wrr,"reduce");function zrr(t,e){var r=$i(),n=$i(),o=$i(),s=$i(),c=$i(),l=$i(),u=$i(),d=$i(),f=$i();Jfe(r,t[1],t[0]),Jfe(f,e[1],e[0]),Wl(r,r,f),Kfe(n,t[0],t[1]),Kfe(f,e[0],e[1]),Wl(n,n,f),Wl(o,t[3],e[3]),Wl(o,o,cSs),Wl(s,t[2],e[2]),Kfe(s,s,s),Jfe(c,n,r),Jfe(l,s,o),Kfe(u,s,o),Kfe(d,n,r),Wl(t[0],c,l),Wl(t[1],d,u),Wl(t[2],u,l),Wl(t[3],c,d)}a(zrr,"add");function vFn(t,e,r){for(var n=0;n<4;++n)wFn(t[n],e[n],r)}a(vFn,"cswap");function Yrr(t,e){var r=$i(),n=$i(),o=$i();ySs(o,e[2]),Wl(r,e[0],o),Wl(n,e[1],o),iot(t,n),t[31]^=IFn(r)<<7}a(Yrr,"pack");function iot(t,e){var r,n,o,s=$i(),c=$i();for(r=0;r<16;++r)c[r]=e[r];for(Grr(c),Grr(c),Grr(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,wFn(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(iot,"pack25519");function hSs(t,e){var r=$i(),n=$i(),o=$i(),s=$i(),c=$i(),l=$i(),u=$i();return Nj(t[2],not),mSs(t[1],e),AZ(o,t[1]),Wl(s,o,aSs),Jfe(o,o,t[2]),Kfe(s,t[2],s),AZ(c,s),AZ(l,c),Wl(u,l,c),Wl(r,u,o),Wl(r,r,s),gSs(r,r),Wl(r,r,o),Wl(r,r,s),Wl(r,r,s),Wl(t[0],r,s),AZ(n,t[0]),Wl(n,n,s),CFn(n,o)&&Wl(t[0],t[0],lSs),AZ(n,t[0]),Wl(n,n,s),CFn(n,o)?-1:(IFn(t[0])===e[31]>>7&&Jfe(t[0],Vrr,t[0]),Wl(t[3],t[0],t[1]),0)}a(hSs,"unpackneg");function mSs(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(mSs,"unpack25519");function gSs(t,e){var r=$i(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)AZ(r,r),n!==1&&Wl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(gSs,"pow2523");function CFn(t,e){var r=new ub(32),n=new ub(32);return iot(r,t),iot(n,e),TFn(r,0,n,0)}a(CFn,"neq25519");function TFn(t,e,r,n){return ASs(t,e,r,n,32)}a(TFn,"crypto_verify_32");function ASs(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(ASs,"vn");function IFn(t){var e=new ub(32);return iot(e,t),e[0]&1}a(IFn,"par25519");function xFn(t,e,r){var n,o;for(Nj(t[0],Vrr),Nj(t[1],not),Nj(t[2],not),Nj(t[3],Vrr),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,vFn(t,e,n),zrr(e,t),zrr(t,t),vFn(t,e,n)}a(xFn,"scalarmult");function Krr(t,e){var r=[$i(),$i(),$i(),$i()];Nj(r[0],EFn),Nj(r[1],_Fn),Nj(r[2],not),Wl(r[3],EFn,_Fn),xFn(t,r,e)}a(Krr,"scalarbase");function Nj(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(Nj,"set25519");function ySs(t,e){var r=$i(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)AZ(r,r),n!==2&&n!==4&&Wl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(ySs,"inv25519");function Grr(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(Grr,"car25519");function wFn(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(wFn,"sel25519");function $i(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var gT=As();ac();xw();tPe();NFn.exports=gT.kem=gT.kem||{};var PFn=gT.jsbn.BigInteger;gT.kem.rsa={};gT.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||gT.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new PFn(gT.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(PFn.ONE)<=0);l=gT.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=gT.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};gT.kem.kdf1=function(t,e){DFn(this,t,0,e||t.digestLength)};gT.kem.kdf2=function(t,e){DFn(this,t,1,e||t.digestLength)};function DFn(t,e,r,n){t.generate=function(o,s){for(var c=new gT.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new gT.util.ByteBuffer,d=r;d{p();var ha=As();ac();BFn.exports=ha.log=ha.log||{};ha.log.levels=["none","error","warning","info","debug","verbose","max"];var oot={},Xrr=[],lPe=null;ha.log.LEVEL_LOCKED=2;ha.log.NO_LEVEL_CHECK=4;ha.log.INTERPOLATE=8;for(x5=0;x5"u"||e?t.flags|=ha.log.LEVEL_LOCKED:t.flags&=~ha.log.LEVEL_LOCKED};ha.log.addLogger=function(t){Xrr.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(OFn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},uPe=a(function(t,e){ha.log.prepareStandard(e);var r=OFn[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),Zfe=ha.log.makeLogger(uPe)):(uPe=a(function(e,r){ha.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),Zfe=ha.log.makeLogger(uPe)),ha.log.setLevel(Zfe,"debug"),ha.log.addLogger(Zfe),lPe=Zfe):console={log:a(function(){},"log")};var Zfe,OFn,uPe;lPe!==null&&typeof window<"u"&&window.location&&(cPe=new URL(window.location.href).searchParams,cPe.has("console.level")&&ha.log.setLevel(lPe,cPe.get("console.level").slice(-1)[0]),cPe.has("console.lock")&&(LFn=cPe.get("console.lock").slice(-1)[0],LFn=="true"&&ha.log.lock(lPe)));var cPe,LFn;ha.log.consoleLogger=lPe});var QFn=I((aof,UFn)=>{p();UFn.exports=E5();Fit();$fe();prr();jrr()});var HFn=I((lof,jFn)=>{p();var Xr=As();Tj();v2();Xke();Ij();uZ();xrr();xw();ac();Zit();var Xe=Xr.asn1,cv=jFn.exports=Xr.pkcs7=Xr.pkcs7||{};cv.messageFromPem=function(t){var e=Xr.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=Xe.fromDer(e.body);return cv.messageFromAsn1(n)};cv.messageToPem=function(t,e){var r={type:"PKCS7",body:Xe.toDer(t.toAsn1()).getBytes()};return Xr.pem.encode(r,{maxline:e})};cv.messageFromAsn1=function(t){var e={},r=[];if(!Xe.validate(t,cv.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=Xe.derToOid(e.contentType),s;switch(o){case Xr.pki.oids.envelopedData:s=cv.createEnvelopedData();break;case Xr.pki.oids.encryptedData:s=cv.createEncryptedData();break;case Xr.pki.oids.signedData:s=cv.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};cv.createSignedData=function(){var t=null;return t={type:Xr.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(tnr(t,n,cv.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(Xe.create(Xe.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(Xe.create(Xe.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SET,!0,t.signerInfos)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[Xe.create(Xe.Class.UNIVERSAL,Xe.Type.OID,!1,Xe.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=Xr.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=Xr.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||Xr.pki.oids.sha1;switch(u){case Xr.pki.oids.sha1:case Xr.pki.oids.sha256:case Xr.pki.oids.sha384:case Xr.pki.oids.sha512:case Xr.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=Xe.create(Xe.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var cm=As();Tj();qfe();Fit();$fe();ac();var aot=GFn.exports=cm.ssh=cm.ssh||{};aot.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(jit,"foldHeader");function nCs(t){return t.replace(/^\s+/,"")}a(nCs,"ltrim")});var Xke=I((Knf,o3n)=>{p();var $d=As();Mit();arr();ac();o3n.exports=$d.des=$d.des||{};$d.des.startEncrypting=function(t,e,r,n){var o=Git({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};$d.des.createEncryptionCipher=function(t,e){return Git({key:t,output:null,decrypt:!1,mode:e})};$d.des.startDecrypting=function(t,e,r,n){var o=Git({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};$d.des.createDecryptionCipher=function(t,e){return Git({key:t,output:null,decrypt:!0,mode:e})};$d.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return i3n(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return i3n(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};$d.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=$d.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=fCs(e),this._init=!0}};v5("DES-ECB",$d.cipher.modes.ecb);v5("DES-CBC",$d.cipher.modes.cbc);v5("DES-CFB",$d.cipher.modes.cfb);v5("DES-OFB",$d.cipher.modes.ofb);v5("DES-CTR",$d.cipher.modes.ctr);v5("3DES-ECB",$d.cipher.modes.ecb);v5("3DES-CBC",$d.cipher.modes.cbc);v5("3DES-CFB",$d.cipher.modes.cfb);v5("3DES-OFB",$d.cipher.modes.ofb);v5("3DES-CTR",$d.cipher.modes.ctr);function v5(t,e){var r=a(function(){return new $d.des.Algorithm(t,e)},"factory");$d.cipher.registerAlgorithm(t,r)}a(v5,"registerAlgorithm");var iCs=[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],oCs=[-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],sCs=[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],aCs=[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],cCs=[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],lCs=[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],uCs=[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],dCs=[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 fCs(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,b,T=0;T>>4^R)&252645135,R^=b,w^=b<<4,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>2^R)&858993459,R^=b,w^=b<<2,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=(R>>>8^w)&16711935,w^=b,R^=b<<8,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=w<<8|R>>>20&240,w=R<<24|R<<8&16711680|R>>>8&65280|R>>>24&240,R=b;for(var x=0;x<_.length;++x){_[x]?(w=w<<2|w>>>26,R=R<<2|R>>>26):(w=w<<1|w>>>27,R=R<<1|R>>>27),w&=-15,R&=-15;var P=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];b=(D>>>16^P)&65535,E[v++]=P^b,E[v++]=D^b<<16}}return E}a(fCs,"_createKeys");function i3n(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^(oCs[g>>>24&63]|aCs[g>>>16&63]|lCs[g>>>8&63]|dCs[g&63]|iCs[A>>>24&63]|sCs[A>>>16&63]|cCs[A>>>8&63]|uCs[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(i3n,"_updateBlock");function Git(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=$d.cipher.createDecipher(r,t.key):n=$d.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof $d.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(Git,"_createCipher")});var $it=I((Xnf,s3n)=>{p();var av=As();qfe();E5();ac();var pCs=av.pkcs5=av.pkcs5||{},QF;av.util.isNodejs&&!av.options.usePureJavaScript&&(QF=require("crypto"));s3n.exports=av.pbkdf2=pCs.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),av.util.isNodejs&&!av.options.usePureJavaScript&&QF.pbkdf2&&(o===null||typeof o!="object")&&(QF.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?QF.pbkdf2Sync.length===4?QF.pbkdf2(t,e,r,n,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):QF.pbkdf2(t,e,r,n,o,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):QF.pbkdf2Sync.length===4?QF.pbkdf2Sync(t,e,r,n).toString("binary"):QF.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in av.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=av.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=av.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(av.util.int32ToBytes(y)),m=A=f.digest().getBytes();for(var E=2;E<=r;++E)f.start(null,null),f.update(A),g=f.digest().getBytes(),m=av.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(av.util.int32ToBytes(y)),m=A=f.digest().getBytes(),E=2,v()}a(_,"outer");function v(){if(E<=r)return f.start(null,null),f.update(A),g=f.digest().getBytes(),m=av.util.xorBytes(m,g,c),A=g,++E,av.util.setImmediate(v);h+=y{p();var C5=As();E5();ac();var c3n=d3n.exports=C5.sha256=C5.sha256||{};C5.md.sha256=C5.md.algorithms.sha256=c3n;c3n.create=function(){l3n||hCs();var t=null,e=C5.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),a3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=C5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(prr.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};a3n(h,r,o);var m=C5.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 prr=null,l3n=!1,u3n=null;function hCs(){prr="\x80",prr+=C5.util.fillString("\0",64),u3n=[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],l3n=!0}a(hCs,"_init");function a3n(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,E=t.h6,_=t.h7,d=0;d<64;++d)c=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7),l=E^A&(y^E),s=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&h|m&(f^h),n=_+c+l+u3n[d]+e[d],o=s+u,_=E,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+E|0,t.h7=t.h7+_|0,v-=64}}a(a3n,"_update")});var mrr=I((oif,f3n)=>{p();var b5=As();ac();var Vit=null;b5.util.isNodejs&&!b5.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Vit=require("crypto"));var mCs=f3n.exports=b5.prng=b5.prng||{};mCs.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=b5.util.createBuffer();e.key=null,E();function E(_){if(_)return f(_);if(y.length()>=d)return f(null,y.getBytes(d));if(e.generated>1048575&&(e.key=null),e.key===null)return b5.util.nextTick(function(){s(E)});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)),b5.util.setImmediate(E)}a(E,"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=b5.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=b5.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=b5.util.createBuffer();if(f)for(;g.length()>16),v+=(_&32767)<<16,v+=_>>15,v=(v&2147483647)+(v>>31),T=v&4294967295;for(var E=0;E<3;++E)b=T>>>(E<<3),b^=Math.floor(Math.random()*256),g.putByte(b&255)}return g.getBytes(d)}return a(u,"defaultSeedFile"),Vit?(e.seedFile=function(d,f){Vit.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return Vit.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 ww=I((cif,grr)=>{p();var Pg=As();Ij();hrr();mrr();ac();(function(){if(Pg.random&&Pg.random.getBytes){grr.exports=Pg.random;return}(function(t){var e={},r=new Array(4),n=Pg.util.createBuffer();e.formatKey=function(h){var m=Pg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),Pg.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=Pg.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 Pg.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=Pg.md.sha256;function o(){var h=Pg.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=Pg.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),Pg.options.usePureJavaScript||!Pg.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(!Pg.random)Pg.random=s;else for(var f in s)Pg.random[f]=s[f];Pg.random.createInstance=o,grr.exports=Pg.random})(typeof jQuery<"u"?jQuery:null)})()});var yrr=I((dif,m3n)=>{p();var lb=As();ac();var Arr=[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],p3n=[1,2,3,5],gCs=a(function(t,e){return t<>16-e},"rol"),ACs=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");m3n.exports=lb.rc2=lb.rc2||{};lb.rc2.expandKey=function(t,e){typeof t=="string"&&(t=lb.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(Arr[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,Arr[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,Arr[r.at(l+1)^r.at(l+s)]);return r};var h3n=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=lb.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]=gCs(A[d],p3n[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]=ACs(A[d],p3n[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 E=o.getInt16Le();c!==null&&(r?E^=c.getInt16Le():c.putInt16Le(E)),y.push(E&65535)}f=r?0:63;for(var _=0;_=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 E=o.length()===8?8:8-o.length();o.fillWithByte(E,E)}if(y&&(n=!0,g.update()),!r&&(y=o.length()===0,y))if(A)y=A(8,s,!r);else{var _=s.length(),v=s.at(_-1);v>_?y=!1:s.truncate(v)}return y},"finish")},g},"createCipher");lb.rc2.startEncrypting=function(t,e,r){var n=lb.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};lb.rc2.createEncryptionCipher=function(t,e){return h3n(t,e,!0)};lb.rc2.startDecrypting=function(t,e,r){var n=lb.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};lb.rc2.createDecryptionCipher=function(t,e){return h3n(t,e,!1)}});var tPe=I((hif,b3n)=>{p();var Err=As();b3n.exports=Err.jsbn=Err.jsbn||{};var qF,yCs=0xdeadbeefcafe,g3n=(yCs&16777215)==15715070;function zt(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(zt,"BigInteger");Err.jsbn.BigInteger=zt;function Va(){return new zt(null)}a(Va,"nbi");function ECs(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(ECs,"am1");function _Cs(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(_Cs,"am2");function A3n(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(A3n,"am3");typeof navigator>"u"?(zt.prototype.am=A3n,qF=28):g3n&&navigator.appName=="Microsoft Internet Explorer"?(zt.prototype.am=_Cs,qF=30):g3n&&navigator.appName!="Netscape"?(zt.prototype.am=ECs,qF=26):(zt.prototype.am=A3n,qF=28);zt.prototype.DB=qF;zt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(CCs,"bnpCopyTo");function bCs(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(bCs,"bnpFromInt");function wj(t){var e=Va();return e.fromInt(t),e}a(wj,"nbv");function SCs(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:E3n(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(TCs,"bnpClamp");function ICs(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=y3n(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+=y3n(n));return o?s:"0"}a(ICs,"bnToString");function xCs(){var t=Va();return zt.ZERO.subTo(this,t),t}a(xCs,"bnNegate");function wCs(){return this.s<0?this.negate():this}a(wCs,"bnAbs");function RCs(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(RCs,"bnCompareTo");function zit(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(zit,"nbits");function kCs(){return this.t<=0?0:this.DB*(this.t-1)+zit(this.data[this.t-1]^this.s&this.DM)}a(kCs,"bnBitLength");function PCs(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(PCs,"bnpDLShiftTo");function DCs(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(NCs,"bnpLShiftTo");function MCs(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(OCs,"bnpSubTo");function LCs(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(BCs,"bnpSquareTo");function FCs(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(_,r)),zt.ONE.dlShiftTo(d,_),_.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,E,0,d))0&&r.rShiftTo(u,r),c<0&&zt.ZERO.subTo(r,r)}}}a(FCs,"bnpDivRemTo");function UCs(t){var e=Va();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(zt.ZERO)>0&&t.subTo(e,e),e}a(UCs,"bnMod");function dZ(t){this.m=t}a(dZ,"Classic");function QCs(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(QCs,"cConvert");function qCs(t){return t}a(qCs,"cRevert");function jCs(t){t.divRemTo(this.m,null,t)}a(jCs,"cReduce");function HCs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(HCs,"cMulTo");function GCs(t,e){t.squareTo(e),this.reduce(e)}a(GCs,"cSqrTo");dZ.prototype.convert=QCs;dZ.prototype.revert=qCs;dZ.prototype.reduce=jCs;dZ.prototype.mulTo=HCs;dZ.prototype.sqrTo=GCs;function $Cs(){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($Cs,"bnpInvDigit");function fZ(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(VCs,"montConvert");function WCs(t){var e=Va();return t.copyTo(e),this.reduce(e),e}a(WCs,"montRevert");function zCs(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(zCs,"montReduce");function YCs(t,e){t.squareTo(e),this.reduce(e)}a(YCs,"montSqrTo");function KCs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(KCs,"montMulTo");fZ.prototype.convert=VCs;fZ.prototype.revert=WCs;fZ.prototype.reduce=zCs;fZ.prototype.mulTo=KCs;fZ.prototype.sqrTo=YCs;function JCs(){return(this.t>0?this.data[0]&1:this.s)==0}a(JCs,"bnpIsEven");function ZCs(t,e){if(t>4294967295||t<1)return zt.ONE;var r=Va(),n=Va(),o=e.convert(this),s=zit(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(ZCs,"bnpExp");function XCs(t,e){var r;return t<256||e.isEven()?r=new dZ(e):r=new fZ(e),this.exp(t,r)}a(XCs,"bnModPowInt");zt.prototype.copyTo=CCs;zt.prototype.fromInt=bCs;zt.prototype.fromString=SCs;zt.prototype.clamp=TCs;zt.prototype.dlShiftTo=PCs;zt.prototype.drShiftTo=DCs;zt.prototype.lShiftTo=NCs;zt.prototype.rShiftTo=MCs;zt.prototype.subTo=OCs;zt.prototype.multiplyTo=LCs;zt.prototype.squareTo=BCs;zt.prototype.divRemTo=FCs;zt.prototype.invDigit=$Cs;zt.prototype.isEven=JCs;zt.prototype.exp=ZCs;zt.prototype.toString=ICs;zt.prototype.negate=xCs;zt.prototype.abs=wCs;zt.prototype.compareTo=RCs;zt.prototype.bitLength=kCs;zt.prototype.mod=UCs;zt.prototype.modPowInt=XCs;zt.ZERO=wj(0);zt.ONE=wj(1);function ebs(){var t=Va();return this.copyTo(t),t}a(ebs,"bnClone");function tbs(){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(rbs,"bnByteValue");function nbs(){return this.t==0?this.s:this.data[0]<<16>>16}a(nbs,"bnShortValue");function ibs(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(ibs,"bnpChunkSize");function obs(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(obs,"bnSigNum");function sbs(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=wj(r),o=Va(),s=Va(),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(sbs,"bnpToRadix");function abs(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&&zt.ZERO.subTo(this,this)}a(abs,"bnpFromRadix");function cbs(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(zt.ONE.shiftLeft(t-1),vrr,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(zt.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(lbs,"bnToByteArray");function ubs(t){return this.compareTo(t)==0}a(ubs,"bnEquals");function dbs(t){return this.compareTo(t)<0?this:t}a(dbs,"bnMin");function fbs(t){return this.compareTo(t)>0?this:t}a(fbs,"bnMax");function pbs(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(Cbs,"lbit");function bbs(){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(Pbs,"bnpAddTo");function Dbs(t){var e=Va();return this.addTo(t,e),e}a(Dbs,"bnAdd");function Nbs(t){var e=Va();return this.subTo(t,e),e}a(Nbs,"bnSubtract");function Mbs(t){var e=Va();return this.multiplyTo(t,e),e}a(Mbs,"bnMultiply");function Obs(){var t=Va();return this.squareTo(t),t}a(Obs,"bnSquare");function Lbs(t){var e=Va();return this.divRemTo(t,e,null),e}a(Lbs,"bnDivide");function Bbs(t){var e=Va();return this.divRemTo(t,null,e),e}a(Bbs,"bnRemainder");function Fbs(t){var e=Va(),r=Va();return this.divRemTo(t,e,r),new Array(e,r)}a(Fbs,"bnDivideAndRemainder");function Ubs(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(Ubs,"bnpDMultiply");function Qbs(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(Qbs,"bnpDAddOffset");function ePe(){}a(ePe,"NullExp");function C3n(t){return t}a(C3n,"nNop");function qbs(t,e,r){t.multiplyTo(e,r)}a(qbs,"nMulTo");function jbs(t,e){t.squareTo(e)}a(jbs,"nSqrTo");ePe.prototype.convert=C3n;ePe.prototype.revert=C3n;ePe.prototype.mulTo=qbs;ePe.prototype.sqrTo=jbs;function Hbs(t){return this.exp(t,new ePe)}a(Hbs,"bnPow");function Gbs(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=Va();return t.copyTo(e),this.reduce(e),e}a(Vbs,"barrettConvert");function Wbs(t){return t}a(Wbs,"barrettRevert");function zbs(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(zbs,"barrettReduce");function Ybs(t,e){t.squareTo(e),this.reduce(e)}a(Ybs,"barrettSqrTo");function Kbs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(Kbs,"barrettMulTo");Gfe.prototype.convert=Vbs;Gfe.prototype.revert=Wbs;Gfe.prototype.reduce=zbs;Gfe.prototype.mulTo=Kbs;Gfe.prototype.sqrTo=Ybs;function Jbs(t,e){var r=t.bitLength(),n,o=wj(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 dZ(e):e.isEven()?s=new Gfe(e):s=new fZ(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=Va();for(s.sqrTo(c[1],f);l<=d;)c[l]=Va(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=Va(),y;for(r=zit(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(Zbs,"bnGCD");function Xbs(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(Xbs,"bnpModInt");function e1s(t){if(this.signum()==0)return zt.ZERO;var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return zt.ZERO;for(var r=t.clone(),n=this.clone(),o=wj(1),s=wj(0),c=wj(0),l=wj(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(zt.ONE)!=0)return zt.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(e1s,"bnModInverse");var b2=[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],t1s=(1<<26)/b2[b2.length-1];function r1s(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=b2[b2.length-1]){for(e=0;e=0);var l=s.modPow(n,this);if(l.compareTo(zt.ONE)!=0&&l.compareTo(e)!=0){for(var u=1;u++{p();var S5=As();E5();ac();var T3n=x3n.exports=S5.sha1=S5.sha1||{};S5.md.sha1=S5.md.algorithms.sha1=T3n;T3n.create=function(){I3n||o1s();var t=null,e=S5.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),S3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=S5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(Crr.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};S3n(h,r,o);var m=S5.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 Crr=null,I3n=!1;function o1s(){Crr="\x80",Crr+=S5.util.fillString("\0",64),I3n=!0}a(o1s,"_init");function S3n(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(S3n,"_update")});var brr=I((_if,R3n)=>{p();var T5=As();ac();ww();$fe();var w3n=R3n.exports=T5.pkcs1=T5.pkcs1||{};w3n.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=T5.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(Yit,"rsa_mgf1")});var Trr=I((bif,Srr)=>{p();var Rj=As();ac();tPe();ww();(function(){if(Rj.prime){Srr.exports=Rj.prime;return}var t=Srr.exports=Rj.prime=Rj.prime||{},e=Rj.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||Rj.random,E={nextBytes:a(function(_){for(var v=y.getBytesSync(_.length),b=0;b<_.length;++b)_[b]=v.charCodeAt(b)},"nextBytes")};if(A.name==="PRIMEINC")return s(h,E,A.options,g);throw new Error("Invalid prime generation algorithm: "+A.name)};function s(h,m,g,A){return"workers"in g?u(h,m,g,A):c(h,m,g,A)}a(s,"primeincFindPrime");function c(h,m,g,A){var y=d(h,m),E=0,_=f(y.bitLength());"millerRabinTests"in g&&(_=g.millerRabinTests);var v=10;"maxBlockTime"in g&&(v=g.maxBlockTime),l(y,h,m,E,_,v,A)}a(c,"primeincFindPrimeWithoutWorkers");function l(h,m,g,A,y,E,_){var v=+new Date;do{if(h.bitLength()>m&&(h=d(m,g)),h.isProbablePrime(y))return _(null,h);h.dAddOffset(r[A++%8],0)}while(E<0||+new Date-v"u")return c(h,m,g,A);var y=d(h,m),E=g.workers,_=g.workLoad||100,v=_*30/8,b=g.workerScript||"forge/prime.worker.js";if(E===-1)return Rj.util.estimateCores(function(w,R){w&&(R=2),E=R-1,T()});T();function T(){E=Math.max(1,E);for(var w=[],R=0;Rh&&(y=d(h,m));var q=y.toString(16);N.target.postMessage({hex:q,workLoad:_}),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 rPe=I((Iif,L3n)=>{p();var Ci=As();C2();tPe();xj();brr();Trr();ww();ac();typeof Wa>"u"&&(Wa=Ci.jsbn.BigInteger);var Wa,Irr=Ci.util.isNodejs?require("crypto"):null,pt=Ci.asn1,kw=Ci.util;Ci.pki=Ci.pki||{};L3n.exports=Ci.pki.rsa=Ci.rsa=Ci.rsa||{};var jo=Ci.pki,s1s=[6,4,2,4,2,4,6,2],a1s={name:"PrivateKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},c1s={name:"RSAPrivateKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},l1s={name:"RSAPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},u1s=Ci.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d1s={name:"DigestInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:pt.Class.UNIVERSAL,type:pt.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},f1s=a(function(t){var e;if(t.algorithm in jo.oids)e=jo.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=pt.oidToDer(e).getBytes(),o=pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[]),s=pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[]);s.value.push(pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,n)),s.value.push(pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,""));var c=pt.create(pt.Class.UNIVERSAL,pt.Type.OCTETSTRING,!1,t.digest().getBytes());return o.value.push(s),o.value.push(c),pt.toDer(o).getBytes()},"emsaPkcs1v15encode"),M3n=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(Wa.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Wa.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new Wa(Ci.util.bytesToHex(Ci.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Wa.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");jo.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=O3n(t,e,r)):(o=Ci.util.createBuffer(),o.putBytes(t));for(var c=new Wa(o.toHex(),16),l=M3n(c,e,n),u=l.toString(16),d=Ci.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.util.hexToBytes(u)),d.getBytes()};jo.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 Wa(Ci.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=M3n(c,e,r),u=l.toString(16),d=Ci.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.util.hexToBytes(u)),n!==!1?Kit(d.getBytes(),e,r):d.getBytes()};jo.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||Ci.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};jo.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new Wa(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(h1s(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(s1s[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(Wa.ONE).gcd(t.e).compareTo(Wa.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(Wa.ONE),t.q1=t.q.subtract(Wa.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(Wa.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:jo.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:jo.rsa.setPublicKey(t.n,t.e)}}c=+new Date,l+=c-s,s=c}return t.keys!==null};jo.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),!Ci.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(k3n("generateKeyPair"))return Irr.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:jo.privateKeyFromPem(d),publicKey:jo.publicKeyFromPem(u)})});if(P3n("generateKey")&&P3n("exportKey"))return kw.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:N3n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return kw.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=jo.privateKeyFromAsn1(pt.fromDer(Ci.util.createBuffer(l)));n(null,{privateKey:u,publicKey:jo.setRsaPublicKey(u.n,u.e)})}});if(D3n("generateKey")&&D3n("exportKey")){var o=kw.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:N3n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=kw.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=jo.privateKeyFromAsn1(pt.fromDer(Ci.util.createBuffer(h)));n(null,{privateKey:m,publicKey:jo.setRsaPublicKey(m.n,m.e)})},d.onerror=function(f){n(f)}},o.onerror=function(l){n(l)};return}}else if(k3n("generateKeyPairSync")){var s=Irr.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:jo.privateKeyFromPem(s.privateKey),publicKey:jo.publicKeyFromPem(s.publicKey)}}}var c=jo.rsa.createKeyPairGenerationState(t,e,r);if(!n)return jo.rsa.stepKeyPairGenerationState(c,0),c.keys;p1s(c,r,n)};jo.setRsaPublicKey=jo.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 O3n(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return Ci.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 jo.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=Kit(d,r,!0,void 0,c);var f=pt.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!pt.validate(f,d1s,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=pt.derToOid(h.algorithmIdentifier);if(!(A===Ci.oids.md2||A===Ci.oids.md5||A===Ci.oids.sha1||A===Ci.oids.sha224||A===Ci.oids.sha256||A===Ci.oids.sha384||A===Ci.oids.sha512||A===Ci.oids["sha512-224"]||A===Ci.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===Ci.oids.md2||A===Ci.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=Kit(d,r,!0,void 0,c),u===d},"verify")});var l=jo.rsa.decrypt(o,r,!0,!1);return s.verify(n,l,r.n.bitLength())},r};jo.setRsaPrivateKey=jo.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=jo.rsa.decrypt(d,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:Kit};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return Ci.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:f1s},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 jo.rsa.encrypt(m,u,h)},u};jo.wrapRsaPrivateKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,pt.integerToDer(0).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,pt.oidToDer(jo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.OCTETSTRING,!1,pt.toDer(t).getBytes())])};jo.privateKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,a1s,e,r)&&(t=pt.fromDer(Ci.util.createBuffer(e.privateKey))),e={},r=[],!pt.validate(t,c1s,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=Ci.util.createBuffer(e.privateKeyModulus).toHex(),s=Ci.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=Ci.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=Ci.util.createBuffer(e.privateKeyPrime1).toHex(),u=Ci.util.createBuffer(e.privateKeyPrime2).toHex(),d=Ci.util.createBuffer(e.privateKeyExponent1).toHex(),f=Ci.util.createBuffer(e.privateKeyExponent2).toHex(),h=Ci.util.createBuffer(e.privateKeyCoefficient).toHex(),jo.setRsaPrivateKey(new Wa(o,16),new Wa(s,16),new Wa(c,16),new Wa(l,16),new Wa(u,16),new Wa(d,16),new Wa(f,16),new Wa(h,16))};jo.privateKeyToAsn1=jo.privateKeyToRSAPrivateKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,pt.integerToDer(0).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.e)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.d)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.p)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.q)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.dP)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.dQ)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.qInv))])};jo.publicKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,u1s,e,r)){var n=pt.derToOid(e.publicKeyOid);if(n!==jo.oids.rsaEncryption){var o=new Error("Cannot read public key. Unknown OID.");throw o.oid=n,o}t=e.rsaPublicKey}if(r=[],!pt.validate(t,l1s,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=Ci.util.createBuffer(e.publicKeyModulus).toHex(),c=Ci.util.createBuffer(e.publicKeyExponent).toHex();return jo.setRsaPublicKey(new Wa(s,16),new Wa(c,16))};jo.publicKeyToAsn1=jo.publicKeyToSubjectPublicKeyInfo=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,pt.oidToDer(jo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.BITSTRING,!1,[jo.publicKeyToRSAPublicKey(t)])])};jo.publicKeyToRSAPublicKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.e))])};function O3n(t,e,r){var n=Ci.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=Ci.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(Kit,"_decodePkcs1_v1_5");function p1s(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){Ci.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(Wa.ONE).gcd(t.e).compareTo(Wa.ONE)!==0){t.p=null,o();return}if(t.q.subtract(Wa.ONE).gcd(t.e).compareTo(Wa.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract(Wa.ONE),t.q1=t.q.subtract(Wa.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(Wa.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:jo.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:jo.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}a(c,"finish")}a(p1s,"_generateKeyPair");function I5(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=Ci.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(I5,"_bnToBytes");function h1s(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(h1s,"_getMillerRabinTests");function k3n(t){return Ci.util.isNodejs&&typeof Irr[t]=="function"}a(k3n,"_detectNodeCrypto");function P3n(t){return typeof kw.globalScope<"u"&&typeof kw.globalScope.crypto=="object"&&typeof kw.globalScope.crypto.subtle=="object"&&typeof kw.globalScope.crypto.subtle[t]=="function"}a(P3n,"_detectSubtleCrypto");function D3n(t){return typeof kw.globalScope<"u"&&typeof kw.globalScope.msCrypto=="object"&&typeof kw.globalScope.msCrypto.subtle=="object"&&typeof kw.globalScope.msCrypto.subtle[t]=="function"}a(D3n,"_detectSubtleMsCrypto");function N3n(t){for(var e=Ci.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var _n=As();Ij();C2();Xke();E5();xj();$it();uZ();ww();yrr();rPe();ac();typeof B3n>"u"&&(B3n=_n.jsbn.BigInteger);var B3n,Nt=_n.asn1,as=_n.pki=_n.pki||{};q3n.exports=as.pbe=_n.pbe=_n.pbe||{};var pZ=as.oids,m1s={name:"EncryptedPrivateKeyInfo",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},g1s={name:"PBES2Algorithms",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},A1s={name:"pkcs-12PbeParams",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,capture:"iterations"}]};as.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=_n.random.getBytesSync(r.saltSize),o=r.count,s=Nt.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=pZ["aes128-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=pZ["aes192-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=pZ["aes256-CBC"],h=_n.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=pZ.desCBC,h=_n.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=Q3n(g),y=_n.pkcs5.pbkdf2(e,n,o,c,A),E=_n.random.getBytesSync(d),_=h(y);_.start(E),_.update(Nt.toDer(t)),_.finish(),u=_.output.getBytes();var v=y1s(n,s,c,g);l=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ.pkcs5PBES2).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ.pkcs5PBKDF2).getBytes()),v]),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(f).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){c=24;var b=new _n.util.ByteBuffer(n),y=as.pbe.generatePkcs12Key(e,b,1,o,c),E=as.pbe.generatePkcs12Key(e,b,2,o,c),_=_n.des.createEncryptionCipher(y);_.start(E),_.update(Nt.toDer(t)),_.finish(),u=_.output.getBytes(),l=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,n),Nt.create(Nt.Class.UNIVERSAL,Nt.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=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[l,Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,u)]);return T};as.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Nt.validate(t,m1s,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=Nt.derToOid(n.encryptionOid),l=as.pbe.getCipher(c,n.encryptionParams,e),u=_n.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Nt.fromDer(l.output)),r};as.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Nt.toDer(t).getBytes()};return _n.pem.encode(r,{maxline:e})};as.encryptedPrivateKeyFromPem=function(t){var e=_n.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 Nt.fromDer(e.body)};as.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=as.wrapRsaPrivateKey(as.privateKeyToAsn1(t));return n=as.encryptPrivateKeyInfo(n,e,r),as.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=_n.random.getBytesSync(8),l=_n.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=_n.random.getBytesSync(8),l=_n.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=_n.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Nt.toDer(as.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:_n.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return _n.pem.encode(h)};as.decryptRsaPrivateKey=function(t,e){var r=null,n=_n.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=_n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=_n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=_n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=_n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=_n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return _n.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return _n.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return _n.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=_n.util.hexToBytes(n.dekInfo.parameters),u=_n.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(_n.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=as.decryptPrivateKeyInfo(Nt.fromDer(r),e):r=Nt.fromDer(r),r!==null&&(r=as.privateKeyFromAsn1(r)),r};as.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in _n.md))throw new Error('"sha1" hash algorithm unavailable.');s=_n.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new _n.util.ByteBuffer,h=new _n.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)B=B>>8,B+=P.at(l)+L.at(l),L.setAt(l,B&255);N.putBuffer(L)}b=N,f.putBuffer(R)}return f.truncate(f.length()-o),f};as.pbe.getCipher=function(t,e,r){switch(t){case as.oids.pkcs5PBES2:return as.pbe.getCipherForPBES2(t,e,r);case as.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case as.oids["pbewithSHAAnd40BitRC2-CBC"]:return as.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}};as.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Nt.validate(e,g1s,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=Nt.derToOid(n.kdfOid),t!==as.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=Nt.derToOid(n.encOid),t!==as.oids["aes128-CBC"]&&t!==as.oids["aes192-CBC"]&&t!==as.oids["aes256-CBC"]&&t!==as.oids["des-EDE3-CBC"]&&t!==as.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=_n.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(as.oids[t]){case"aes128-CBC":u=16,d=_n.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=_n.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=_n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=_n.des.createDecryptionCipher;break;case"desCBC":u=8,d=_n.des.createDecryptionCipher;break}var f=U3n(n.prfOid),h=_n.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};as.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Nt.validate(e,A1s,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=_n.util.createBuffer(n.salt),l=_n.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case as.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=_n.des.startDecrypting;break;case as.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,E){var _=_n.rc2.createDecryptionCipher(y,40);return _.start(E,null),_},"cipherFn");break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=U3n(n.prfOid),m=as.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=as.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};as.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in _n.md))throw new Error('"md5" hash algorithm unavailable.');n=_n.md.md5.create()}e===null&&(e="");for(var o=[F3n(n,t+e)],s=16,c=1;s{p();var Vfe=As();C2();ac();var fn=Vfe.asn1,Wfe=G3n.exports=Vfe.pkcs7asn1=Vfe.pkcs7asn1||{};Vfe.pkcs7=Vfe.pkcs7||{};Vfe.pkcs7.asn1=Wfe;var j3n={name:"ContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Wfe.contentInfoValidator=j3n;var H3n={name:"EncryptedContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Wfe.envelopedDataValidator={name:"EnvelopedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(H3n)};Wfe.encryptedDataValidator={name:"EncryptedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"}].concat(H3n)};var E1s={name:"SignerInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Wfe.signedDataValidator={name:"SignedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},j3n,{name:"SignedData.Certificates",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,capture:"signerInfos",optional:!0,value:[E1s]}]};Wfe.recipientInfoValidator={name:"RecipientInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var Rrr=I((Mif,$3n)=>{p();var hZ=As();ac();hZ.mgf=hZ.mgf||{};var _1s=$3n.exports=hZ.mgf.mgf1=hZ.mgf1=hZ.mgf1||{};_1s.create=function(t){var e={generate:a(function(r,n){for(var o=new hZ.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var Jit=As();Rrr();V3n.exports=Jit.mgf=Jit.mgf||{};Jit.mgf.mgf1=Jit.mgf1});var Zit=I((Uif,z3n)=>{p();var mZ=As();ww();ac();var v1s=z3n.exports=mZ.pss=mZ.pss||{};v1s.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=mZ.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||mZ.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+E+"\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)&_)!==0)throw new Error("Bits beyond keysize not zero as expected.");var v=r.generate(E,A),b="";for(h=0;h{p();var bi=As();Ij();C2();Xke();E5();W3n();xj();uZ();Zit();rPe();ac();var Ae=bi.asn1,Dr=X3n.exports=bi.pki=bi.pki||{},za=Dr.oids,fp={};fp.CN=za.commonName;fp.commonName="CN";fp.C=za.countryName;fp.countryName="C";fp.L=za.localityName;fp.localityName="L";fp.ST=za.stateOrProvinceName;fp.stateOrProvinceName="ST";fp.O=za.organizationName;fp.organizationName="O";fp.OU=za.organizationalUnitName;fp.organizationalUnitName="OU";fp.E=za.emailAddress;fp.emailAddress="E";var K3n=bi.pki.rsa.publicKeyValidator,C1s={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"},K3n,{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"}]},b1s={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"}]}]},S1s={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"},K3n,{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}]}]}]},T1s={name:"CertificationRequest",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[S1s,{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"}]};Dr.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=eot({signatureOid:c.signatureOid,type:"certificate"});var d=Ae.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=bi.md.sha1.create(),h=Ae.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return kj(c.issuer,A)},c.issuer.addField=function(A){Pw([A]),c.issuer.attributes.push(A)},c.issuer.attributes=Dr.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=bi.md.sha1.create(),g=Ae.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return kj(c.subject,A)},c.subject.addField=function(A){Pw([A]),c.subject.attributes.push(A)},c.subject.attributes=Dr.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=Dr.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=Dr.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};Dr.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 Dr.oids?e.name=Dr.oids[e.type]:e.shortName&&e.shortName in fp&&(e.name=Dr.oids[fp[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in Dr.oids)e.type=Dr.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 fp&&(e.shortName=fp[e.name]),e.type===za.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(Pw,"_fillMissingFields");function Z3n(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in Dr.oids&&(t.name=Dr.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in Dr.oids)t.id=Dr.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 za?l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(za[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,[zfe(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=bi.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,[]),E=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(Z3n,"_fillMissingExtensionFields");function krr(t,e){if(t===za["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(krr,"_signatureParametersToAsn1");function I1s(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=x1s&&t0&&n.value.push(Dr.certificateExtensionsToAsn1(t.extensions)),n};Dr.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()),zfe(t.subject),Dr.publicKeyToAsn1(t.publicKey),I1s(t)]);return e};Dr.distinguishedNameToAsn1=function(t){return zfe(t)};Dr.certificateToAsn1=function(t){var e=t.tbsCertificate||Dr.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()),krr(t.signatureOid,t.signatureParameters)]),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,"\0"+t.signature)])};Dr.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:Dr.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;bi.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:Dr.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:Dr.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:Dr.certificateError.bad_certificate}),c===null)for(var g={keyUsage:!0,basicConstraints:!0},A=0;c===null&&AE.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:Dr.certificateError.bad_certificate})}}var b=c===null?!0:c.error,T=r.verify?r.verify(b,l,n):b;if(T===!0)c=null;else throw b===!0&&(c={message:"The application rejected the certificate.",error:Dr.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!bi.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 Drr=I((Gif,tFn)=>{p();var xu=As();C2();qfe();xj();wrr();xrr();ww();rPe();$fe();ac();tot();var Ke=xu.asn1,ea=xu.pki,iPe=tFn.exports=xu.pkcs12=xu.pkcs12||{},eFn={name:"ContentInfo",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},R1s={name:"PFX",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.INTEGER,constructed:!1,capture:"version"},eFn,{name:"PFX.macData",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Ke.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},k1s={name:"SafeBag",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},P1s={name:"Attribute",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SET,constructed:!0,capture:"values"}]},D1s={name:"CertBag",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Ke.Class.UNIVERSAL,type:Ke.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function nPe(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(nPe,"_getBagsByAttribute");iPe.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Ke.validate(t,R1s,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(E){var _={},v;return"localKeyId"in E?v=E.localKeyId:"localKeyIdHex"in E&&(v=xu.util.hexToBytes(E.localKeyIdHex)),v===void 0&&!("friendlyName"in E)&&"bagType"in E&&(_[E.bagType]=nPe(c.safeContents,null,null,E.bagType)),v!==void 0&&(_.localKeyId=nPe(c.safeContents,"localKeyId",v,E.bagType)),"friendlyName"in E&&(_.friendlyName=nPe(c.safeContents,"friendlyName",E.friendlyName,E.bagType)),_},"getBags"),getBagsByFriendlyName:a(function(E,_){return nPe(c.safeContents,"friendlyName",E,_)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(E,_){return nPe(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(Ke.derToOid(n.contentType)!==ea.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Ke.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Ke.Class.UNIVERSAL||l.type!==Ke.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=Prr(l),n.mac){var u=null,d=0,f=Ke.derToOid(n.macAlgorithm);switch(f){case ea.oids.sha1:u=xu.md.sha1.create(),d=20;break;case ea.oids.sha256:u=xu.md.sha256.create(),d=32;break;case ea.oids.sha384:u=xu.md.sha384.create(),d=48;break;case ea.oids.sha512:u=xu.md.sha512.create(),d=64;break;case ea.oids.md5:u=xu.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new xu.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(xu.util.bytesToHex(n.macIterations),16):1,g=iPe.generateKey(r,h,3,m,d,u),A=xu.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 N1s(c,l.value,e,r),c};function Prr(t){if(t.composed||t.constructed){for(var e=xu.util.createBuffer(),r=0;r0&&(s=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SET,!0,u));var d=[],f=[];e!==null&&(xu.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var E=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,h),_=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(E).getBytes())])]);d.push(_)}var v=null;if(t!==null){var b=ea.wrapRsaPrivateKey(ea.privateKeyToAsn1(t));r===null?v=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.keyBag).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):v=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.pkcs8ShroudedKeyBag).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[ea.encryptPrivateKeyInfo(b,r,n)]),s]);var T=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[v]),w=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(T).getBytes())])]);d.push(w)}var R=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=xu.md.sha1.create(),P=new xu.util.ByteBuffer(xu.random.getBytes(n.saltSize)),D=n.count,t=iPe.generateKey(r,P,3,D,20),N=xu.hmac.create();N.start(l,t),N.update(Ke.toDer(R).getBytes());var L=N.getMac();x=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.sha1).getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.NULL,!1,"")]),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,L.getBytes())]),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,P.getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.INTEGER,!1,Ke.integerToDer(D).getBytes())])}return Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.INTEGER,!1,Ke.integerToDer(3).getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(R).getBytes())])]),x])};iPe.generateKey=xu.pbe.generatePkcs12Key});var Mrr=I((Wif,rFn)=>{p();var Pj=As();C2();xj();xrr();uZ();$it();Drr();Zit();rPe();ac();tot();var Nrr=Pj.asn1,Yfe=rFn.exports=Pj.pki=Pj.pki||{};Yfe.pemToDer=function(t){var e=Pj.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Pj.util.createBuffer(e.body)};Yfe.privateKeyFromPem=function(t){var e=Pj.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=Nrr.fromDer(e.body);return Yfe.privateKeyFromAsn1(n)};Yfe.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:Nrr.toDer(Yfe.privateKeyToAsn1(t)).getBytes()};return Pj.pem.encode(r,{maxline:e})};Yfe.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:Nrr.toDer(t).getBytes()};return Pj.pem.encode(r,{maxline:e})}});var Qrr=I((Yif,uFn)=>{p();var Jt=As();C2();qfe();qit();uZ();Mrr();ww();$fe();ac();var oot=a(function(t,e,r,n){var o=Jt.util.createBuffer(),s=t.length>>1,c=s+(t.length&1),l=t.substr(0,c),u=t.substr(s,c),d=Jt.util.createBuffer(),f=Jt.hmac.create();r=e+r;var h=Math.ceil(n/16),m=Math.ceil(n/20);f.start("MD5",l);var g=Jt.util.createBuffer();d.putBytes(r);for(var A=0;A0&&(_e.queue(t,_e.createAlert(t,{level:_e.Alert.Level.warning,description:_e.Alert.Description.no_renegotiation})),_e.flush(t)),t.process()};_e.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});else{var s=e.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:Jt.util.createBuffer(s.getBytes(32)),session_id:AT(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=AT(s,2),n.compression_methods=AT(s,1)),c=r-(c-s.length()),c>0){for(var l=AT(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:AT(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(AT(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:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=_e.getCipherSuite(n.cipher_suite);else for(var m=Jt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure},cipherSuite:Jt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=_e.CompressionMethod.none}return n};_e.createSecurityParameters=function(t,e){var r=t.entity===_e.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:_e.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:_e.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}};_e.handleServerHello=function(t,e,r){var n=_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=oFn,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=q1s,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.session.id=o,t.process()}};_e.handleClientHello=function(t,e,r){var n=_e.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=Jt.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;l<_e.SupportedVersions.length&&(c=_e.SupportedVersions[l],!(c.minor<=n.version.minor));++l);t.version={major:c.major,minor:c.minor},t.session.version=t.version}s!==null?(t.expect=Frr,t.session.resuming=!0,t.session.sp.client_random=n.random.bytes()):(t.expect=t.verifyClient!==!1?z1s:Brr,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.open=!0,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHello(t)})),t.session.resuming?(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.pending=_e.createConnectionState(t),t.state.current.write=t.state.pending.write,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))):(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)})),t.fail||(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerKeyExchange(t)})),t.verifyClient!==!1&&_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificateRequest(t)})),_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHelloDone(t)})))),_e.flush(t),t.process()}};_e.handleCertificate=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_list:AT(n,3)},s,c,l=[];try{for(;o.certificate_list.length()>0;)s=AT(o.certificate_list,3),c=Jt.asn1.fromDer(s),s=Jt.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:_e.Alert.Level.fatal,description:_e.Alert.Description.bad_certificate}})}var u=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?nFn:Brr:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],_e.verifyCertificateChain(t,l)&&(t.expect=u?nFn:Brr)),t.process()};_e.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});t.expect=j1s,t.process()};_e.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:AT(n,2).getBytes()},s=null;if(t.getPrivateKey)try{s=t.getPrivateKey(t,t.session.serverCertificate),s=Jt.pki.privateKeyFromPem(s)}catch(u){t.error(t,{message:"Could not get private key.",cause:u,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.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=Jt.random.getBytes(48)}t.expect=Frr,t.session.clientCertificate!==null&&(t.expect=Y1s),t.process()};_e.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:AT(n,1),certificate_authorities:AT(n,2)};t.session.certificateRequest=o,t.expect=H1s,t.process()};_e.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:AT(n,2).getBytes()},c=Jt.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:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure}})}t.expect=Frr,t.process()};_e.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.insufficient_security}},o=0,s=t.verify(t,n.alert.description,o,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!Jt.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=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)}),_e.queue(t,e)),e=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createClientKeyExchange(t)}),_e.queue(t,e),t.expect=V1s;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createCertificateVerify(l,u)})),_e.queue(l,_e.createRecord(l,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),l.state.pending=_e.createConnectionState(l),l.state.current.write=l.state.pending.write,_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createFinished(l)})),l.expect=oFn,_e.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);_e.getClientSignature(t,c)};_e.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var r=t.entity===_e.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=_e.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?G1s:K1s,t.process()};_e.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=Jt.util.createBuffer(),n.putBuffer(t.session.md5.digest()),n.putBuffer(t.session.sha1.digest());var c=t.entity===_e.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=oot;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:_e.Alert.Level.fatal,description:_e.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))),t.expect=c?$1s:J1s,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,_e.flush(t),t.isConnected=!0,t.connected(t),t.process()};_e.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case _e.Alert.Description.close_notify:o="Connection closed.";break;case _e.Alert.Description.unexpected_message:o="Unexpected message.";break;case _e.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case _e.Alert.Description.decryption_failed:o="Decryption failed.";break;case _e.Alert.Description.record_overflow:o="Record overflow.";break;case _e.Alert.Description.decompression_failure:o="Decompression failed.";break;case _e.Alert.Description.handshake_failure:o="Handshake failure.";break;case _e.Alert.Description.bad_certificate:o="Bad certificate.";break;case _e.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case _e.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case _e.Alert.Description.certificate_expired:o="Certificate expired.";break;case _e.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case _e.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case _e.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case _e.Alert.Description.access_denied:o="Access denied.";break;case _e.Alert.Description.decode_error:o="Decode error.";break;case _e.Alert.Description.decrypt_error:o="Decrypt error.";break;case _e.Alert.Description.export_restriction:o="Export restriction.";break;case _e.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case _e.Alert.Description.insufficient_security:o="Insufficient security.";break;case _e.Alert.Description.internal_error:o="Internal error.";break;case _e.Alert.Description.user_canceled:o="User canceled.";break;case _e.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===_e.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===_e.ConnectionEnd.client?"server":"client",alert:n}),t.process()};_e.handleHandshake=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=Jt.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var s=r.bytes(o+4);r.read+=4,n in iot[t.entity][t.expect]?(t.entity===_e.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:Jt.md.md5.create(),sha1:Jt.md.sha1.create()}),n!==_e.HandshakeType.hello_request&&n!==_e.HandshakeType.certificate_verify&&n!==_e.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),iot[t.entity][t.expect][n](t,e,o)):_e.handleUnexpected(t,e)};_e.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};_e.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===_e.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();_e.queue(t,_e.createRecord(t,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_response,s)})),_e.flush(t)}else if(n===_e.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Jt.util.createBuffer(s))}t.process()};var Q1s=0,q1s=1,nFn=2,j1s=3,H1s=4,oFn=5,G1s=6,$1s=7,V1s=8,W1s=0,z1s=1,Brr=2,Y1s=3,Frr=4,K1s=5,J1s=6,Ee=_e.handleUnexpected,sFn=_e.handleChangeCipherSpec,jA=_e.handleAlert,cv=_e.handleHandshake,aFn=_e.handleApplicationData,HA=_e.handleHeartbeat,Urr=[];Urr[_e.ConnectionEnd.client]=[[Ee,jA,cv,Ee,HA],[Ee,jA,cv,Ee,HA],[Ee,jA,cv,Ee,HA],[Ee,jA,cv,Ee,HA],[Ee,jA,cv,Ee,HA],[sFn,jA,Ee,Ee,HA],[Ee,jA,cv,Ee,HA],[Ee,jA,cv,aFn,HA],[Ee,jA,cv,Ee,HA]];Urr[_e.ConnectionEnd.server]=[[Ee,jA,cv,Ee,HA],[Ee,jA,cv,Ee,HA],[Ee,jA,cv,Ee,HA],[Ee,jA,cv,Ee,HA],[sFn,jA,Ee,Ee,HA],[Ee,jA,cv,Ee,HA],[Ee,jA,cv,aFn,HA],[Ee,jA,cv,Ee,HA]];var Dj=_e.handleHelloRequest,Z1s=_e.handleServerHello,cFn=_e.handleCertificate,iFn=_e.handleServerKeyExchange,Orr=_e.handleCertificateRequest,rot=_e.handleServerHelloDone,lFn=_e.handleFinished,iot=[];iot[_e.ConnectionEnd.client]=[[Ee,Ee,Z1s,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Dj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,cFn,iFn,Orr,rot,Ee,Ee,Ee,Ee,Ee,Ee],[Dj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,iFn,Orr,rot,Ee,Ee,Ee,Ee,Ee,Ee],[Dj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Orr,rot,Ee,Ee,Ee,Ee,Ee,Ee],[Dj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,rot,Ee,Ee,Ee,Ee,Ee,Ee],[Dj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Dj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,lFn],[Dj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Dj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];var X1s=_e.handleClientHello,eSs=_e.handleClientKeyExchange,tSs=_e.handleCertificateVerify;iot[_e.ConnectionEnd.server]=[[Ee,X1s,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,cFn,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,eSs,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,tSs,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,lFn],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];_e.generateKeys=function(t,e){var r=oot,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===_e.Versions.TLS_1_0.major&&t.version.minor===_e.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};_e.createConnectionState=function(t){var e=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=_e.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 _e.CompressionMethod.none:break;case _e.CompressionMethod.deflate:n.read.compressFunction=U1s,n.write.compressFunction=F1s;break;default:throw new Error("Unsupported compression algorithm.")}}return n};_e.createRandom=function(){var t=new Date,e=+t+t.getTimezoneOffset()*6e4,r=Jt.util.createBuffer();return r.putInt32(e),r.putBytes(Jt.random.getBytes(28)),r};_e.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};_e.createAlert=function(t,e){var r=Jt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),_e.createRecord(t,{type:_e.ContentType.alert,data:r})};_e.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=Jt.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=Jt.util.createBuffer();return A.putByte(_e.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),Dw(A,1,Jt.util.createBuffer(m)),Dw(A,2,e),Dw(A,1,s),h>0&&Dw(A,2,l),A};_e.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Jt.util.createBuffer();return n.putByte(_e.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),Dw(n,1,Jt.util.createBuffer(e)),n.putByte(t.session.cipherSuite.id[0]),n.putByte(t.session.cipherSuite.id[1]),n.putByte(t.session.compressionMethod),n};_e.createCertificate=function(t){var e=t.entity===_e.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=Jt.util.createBuffer();if(r!==null)try{Jt.util.isArray(r)||(r=[r]);for(var s=null,c=0;c0&&(r.putByte(_e.HandshakeType.server_key_exchange),r.putInt24(e)),r};_e.getClientSignature=function(t,e){var r=Jt.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=Jt.pki.privateKeyFromPem(c)}catch(l){n.error(n,{message:"Could not get private key.",cause:l,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};_e.createCertificateVerify=function(t,e){var r=e.length+2,n=Jt.util.createBuffer();return n.putByte(_e.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};_e.createCertificateRequest=function(t){var e=Jt.util.createBuffer();e.putByte(1);var r=Jt.util.createBuffer();for(var n in t.caStore.certs){var o=t.caStore.certs[n],s=Jt.pki.distinguishedNameToAsn1(o.subject),c=Jt.asn1.toDer(s);r.putInt16(c.length()),r.putBuffer(c)}var l=1+e.length()+2+r.length(),u=Jt.util.createBuffer();return u.putByte(_e.HandshakeType.certificate_request),u.putInt24(l),Dw(u,1,e),Dw(u,2,r),u};_e.createServerHelloDone=function(t){var e=Jt.util.createBuffer();return e.putByte(_e.HandshakeType.server_hello_done),e.putInt24(0),e};_e.createChangeCipherSpec=function(){var t=Jt.util.createBuffer();return t.putByte(1),t};_e.createFinished=function(t){var e=Jt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===_e.ConnectionEnd.client,n=t.session.sp,o=12,s=oot,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Jt.util.createBuffer();return l.putByte(_e.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};_e.createHeartbeat=function(t,e,r){typeof r>"u"&&(r=e.length);var n=Jt.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(Jt.random.getBytes(s)),n};_e.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===_e.ContentType.handshake||e.type===_e.ContentType.alert||e.type===_e.ContentType.change_cipher_spec))){if(e.type===_e.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()<=_e.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>_e.MaxFragment;)n.push(_e.createRecord(t,{type:e.type,data:Jt.util.createBuffer(o.slice(0,_e.MaxFragment))})),o=o.slice(_e.MaxFragment);o.length>0&&n.push(_e.createRecord(t,{type:e.type,data:Jt.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=Jt.util.bytesToHex(o);r.order.push(c),r.cache[c]=s}}return r};_e.createConnection=function(t){var e=null;t.caStore?Jt.util.isArray(t.caStore)?e=Jt.pki.createCaStore(t.caStore):e=t.caStore:e=Jt.pki.createCaStore();var r=t.cipherSuites||null;if(r===null){r=[];for(var n in _e.CipherSuites)r.push(_e.CipherSuites[n])}var o=t.server?_e.ConnectionEnd.server:_e.ConnectionEnd.client,s=t.sessionCache?_e.createSessionCache(t.sessionCache):null,c={version:{major:_e.Version.major,minor:_e.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:Jt.util.createBuffer(),tlsData:Jt.util.createBuffer(),data:Jt.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===_e.ConnectionEnd.client?"client":"server"),h.send&&(_e.queue(f,_e.createAlert(f,h.alert)),_e.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:_e.Version.major,minor:_e.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===_e.ConnectionEnd.client?Q1s:W1s,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=_e.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-_e.ContentType.change_cipher_spec,g=Urr[f.entity][f.expect];m in g?g[m](f,h):_e.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:Jt.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:_e.Alert.Level.fatal,description:_e.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:Jt.md.md5.create(),sha1:Jt.md.sha1.create()},h&&(c.version=h.version,c.session.sp=h.sp),c.session.sp.client_random=_e.createRandom().getBytes(),c.open=!0,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.handshake,data:_e.createClientHello(c)})),_e.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 _e.queue(c,_e.createRecord(c,{type:_e.ContentType.application_data,data:Jt.util.createBuffer(f)})),_e.flush(c)},c.prepareHeartbeatRequest=function(f,h){return f instanceof Jt.util.ByteBuffer&&(f=f.bytes()),typeof h>"u"&&(h=f.length),c.expectedHeartbeatPayload=f,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_request,f,h)})),_e.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,_e.queue(c,_e.createAlert(c,{level:_e.Alert.Level.warning,description:_e.Alert.Description.close_notify})),_e.flush(c)),c.closed(c)),c.reset(f)},c};uFn.exports=Jt.tls=Jt.tls||{};for(not in _e)typeof _e[not]!="function"&&(Jt.tls[not]=_e[not]);var not;Jt.tls.prf_tls1=oot;Jt.tls.hmac_sha1=B1s;Jt.tls.createSessionCache=_e.createSessionCache;Jt.tls.createConnection=_e.createConnection});var pFn=I((Zif,fFn)=>{p();var Nj=As();Ij();Qrr();var Nw=fFn.exports=Nj.tls;Nw.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=Nw.BulkCipherAlgorithm.aes,t.cipher_type=Nw.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Nw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:dFn};Nw.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=Nw.BulkCipherAlgorithm.aes,t.cipher_type=Nw.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Nw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:dFn};function dFn(t,e,r){var n=e.entity===Nj.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:Nj.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:Nj.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=sSs,t.write.cipherFunction=nSs,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=Nw.hmac_sha1}a(dFn,"initConnectionState");function nSs(t,e){var r=!1,n=e.macFunction(e.macKey,e.sequenceNumber,t);t.fragment.putBytes(n),e.updateSequenceNumber();var o;t.version.minor===Nw.Versions.TLS_1_0.minor?o=e.cipherState.init?null:e.cipherState.iv:o=Nj.random.getBytesSync(16),e.cipherState.init=!0;var s=e.cipherState.cipher;return s.start({iv:o}),t.version.minor>=Nw.Versions.TLS_1_1.minor&&s.output.putBytes(o),s.update(t.fragment),s.finish(iSs)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(nSs,"encrypt_aes_cbc_sha1");function iSs(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(iSs,"encrypt_aes_cbc_sha1_padding");function oSs(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=Nj.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=aSs(e.macKey,c,u)&&r,r}a(sSs,"decrypt_aes_cbc_sha1");function aSs(t,e,r){var n=Nj.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(aSs,"compareMacs")});var Hrr=I((tof,AFn)=>{p();var cd=As();E5();ac();var oPe=AFn.exports=cd.sha512=cd.sha512||{};cd.md.sha512=cd.md.algorithms.sha512=oPe;var mFn=cd.sha384=cd.sha512.sha384=cd.sha512.sha384||{};mFn.create=function(){return oPe.create("SHA-384")};cd.md.sha384=cd.md.algorithms.sha384=mFn;cd.sha512.sha256=cd.sha512.sha256||{create:a(function(){return oPe.create("SHA-512/256")},"create")};cd.md["sha512/256"]=cd.md.algorithms["sha512/256"]=cd.sha512.sha256;cd.sha512.sha224=cd.sha512.sha224||{create:a(function(){return oPe.create("SHA-512/224")},"create")};cd.md["sha512/224"]=cd.md.algorithms["sha512/224"]=cd.sha512.sha224;oPe.create=function(t){if(gFn||cSs(),typeof t>"u"&&(t="SHA-512"),!(t in gZ))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=gZ[t],r=null,n=cd.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),hFn(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=cd.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(qrr.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(O=0;O<16;++O)e[O][0]=r.getInt32()>>>0,e[O][1]=r.getInt32()>>>0;for(;O<80;++O)U=e[O-2],j=U[0],Q=U[1],n=((j>>>19|Q<<13)^(Q>>>29|j<<3)^j>>>6)>>>0,o=((j<<13|Q>>>19)^(Q<<3|j>>>29)^(j<<26|Q>>>6))>>>0,W=e[O-15],j=W[0],Q=W[1],s=((j>>>1|Q<<31)^(j>>>8|Q<<24)^j>>>7)>>>0,c=((j<<31|Q>>>1)^(j<<24|Q>>>8)^(j<<25|Q>>>7))>>>0,Y=e[O-7],V=e[O-16],Q=o+Y[1]+c+V[1],e[O][0]=n+Y[0]+s+V[0]+(Q/4294967296>>>0)>>>0,e[O][1]=Q>>>0;for(y=t[0][0],E=t[0][1],_=t[1][0],v=t[1][1],b=t[2][0],T=t[2][1],w=t[3][0],R=t[3][1],x=t[4][0],P=t[4][1],D=t[5][0],N=t[5][1],L=t[6][0],B=t[6][1],q=t[7][0],M=t[7][1],O=0;O<80;++O)d=((x>>>14|P<<18)^(x>>>18|P<<14)^(P>>>9|x<<23))>>>0,f=((x<<18|P>>>14)^(x<<14|P>>>18)^(P<<23|x>>>9))>>>0,h=(L^x&(D^L))>>>0,m=(B^P&(N^B))>>>0,l=((y>>>28|E<<4)^(E>>>2|y<<30)^(E>>>7|y<<25))>>>0,u=((y<<4|E>>>28)^(E<<30|y>>>2)^(E<<25|y>>>7))>>>0,g=(y&_|b&(y^_))>>>0,A=(E&v|T&(E^v))>>>0,Q=M+f+m+jrr[O][1]+e[O][1],n=q+d+h+jrr[O][0]+e[O][0]+(Q/4294967296>>>0)>>>0,o=Q>>>0,Q=u+A,s=l+g+(Q/4294967296>>>0)>>>0,c=Q>>>0,q=L,M=B,L=D,B=N,D=x,N=P,Q=R+o,x=w+n+(Q/4294967296>>>0)>>>0,P=Q>>>0,w=b,R=T,b=_,T=v,_=y,v=E,Q=o+c,y=n+s+(Q/4294967296>>>0)>>>0,E=Q>>>0;Q=t[0][1]+E,t[0][0]=t[0][0]+y+(Q/4294967296>>>0)>>>0,t[0][1]=Q>>>0,Q=t[1][1]+v,t[1][0]=t[1][0]+_+(Q/4294967296>>>0)>>>0,t[1][1]=Q>>>0,Q=t[2][1]+T,t[2][0]=t[2][0]+b+(Q/4294967296>>>0)>>>0,t[2][1]=Q>>>0,Q=t[3][1]+R,t[3][0]=t[3][0]+w+(Q/4294967296>>>0)>>>0,t[3][1]=Q>>>0,Q=t[4][1]+P,t[4][0]=t[4][0]+x+(Q/4294967296>>>0)>>>0,t[4][1]=Q>>>0,Q=t[5][1]+N,t[5][0]=t[5][0]+D+(Q/4294967296>>>0)>>>0,t[5][1]=Q>>>0,Q=t[6][1]+B,t[6][0]=t[6][0]+L+(Q/4294967296>>>0)>>>0,t[6][1]=Q>>>0,Q=t[7][1]+M,t[7][0]=t[7][0]+q+(Q/4294967296>>>0)>>>0,t[7][1]=Q>>>0,z-=128}}a(hFn,"_update")});var yFn=I(Grr=>{p();var lSs=As();C2();var Dg=lSs.asn1;Grr.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Grr.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var PFn=I((sof,kFn)=>{p();var GA=As();tPe();ww();Hrr();ac();var SFn=yFn(),uSs=SFn.publicKeyValidator,dSs=SFn.privateKeyValidator;typeof EFn>"u"&&(EFn=GA.jsbn.BigInteger);var EFn,Vrr=GA.util.ByteBuffer,ub=typeof Buffer>"u"?Uint8Array:Buffer;GA.pki=GA.pki||{};kFn.exports=GA.pki.ed25519=GA.ed25519=GA.ed25519||{};var ta=GA.ed25519;ta.constants={};ta.constants.PUBLIC_KEY_BYTE_LENGTH=32;ta.constants.PRIVATE_KEY_BYTE_LENGTH=64;ta.constants.SEED_BYTE_LENGTH=32;ta.constants.SIGN_BYTE_LENGTH=64;ta.constants.HASH_BYTE_LENGTH=64;ta.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=GA.random.getBytesSync(ta.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==ta.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+ta.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=jF({message:e,encoding:"binary"});for(var r=new ub(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=new ub(ta.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return mSs(r,n),{publicKey:r,privateKey:n}};ta.privateKeyFromAsn1=function(t){var e={},r=[],n=GA.asn1.validate(t,dSs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=GA.asn1.derToOid(e.privateKeyOid),c=GA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=jF({message:GA.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};ta.publicKeyFromAsn1=function(t){var e={},r=[],n=GA.asn1.validate(t,uSs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=GA.asn1.derToOid(e.publicKeyOid),c=GA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==ta.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return jF({message:l,encoding:"binary"})};ta.publicKeyFromPrivateKey=function(t){t=t||{};var e=jF({message:t.privateKey,encoding:"binary"});if(e.length!==ta.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ta.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new ub(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function jF(t){var e=t.message;if(e instanceof Uint8Array||e instanceof ub)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 Vrr(e,r)}else if(!(e instanceof Vrr))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 ub(e.length()),o=0;o=0;--r){if(t[e+r]sPe[r])return!1}return!1}a(ySs,"_isCanonicalSignatureScalar");function TFn(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)*sPe[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*sPe[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(TFn,"modL");function zrr(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;TFn(t,e)}a(zrr,"reduce");function Yrr(t,e){var r=$i(),n=$i(),o=$i(),s=$i(),c=$i(),l=$i(),u=$i(),d=$i(),f=$i();Jfe(r,t[1],t[0]),Jfe(f,e[1],e[0]),Wl(r,r,f),Kfe(n,t[0],t[1]),Kfe(f,e[0],e[1]),Wl(n,n,f),Wl(o,t[3],e[3]),Wl(o,o,pSs),Wl(s,t[2],e[2]),Kfe(s,s,s),Jfe(c,n,r),Jfe(l,s,o),Kfe(u,s,o),Kfe(d,n,r),Wl(t[0],c,l),Wl(t[1],d,u),Wl(t[2],u,l),Wl(t[3],c,d)}a(Yrr,"add");function CFn(t,e,r){for(var n=0;n<4;++n)RFn(t[n],e[n],r)}a(CFn,"cswap");function Krr(t,e){var r=$i(),n=$i(),o=$i();bSs(o,e[2]),Wl(r,e[0],o),Wl(n,e[1],o),aot(t,n),t[31]^=xFn(r)<<7}a(Krr,"pack");function aot(t,e){var r,n,o,s=$i(),c=$i();for(r=0;r<16;++r)c[r]=e[r];for($rr(c),$rr(c),$rr(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,RFn(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(aot,"pack25519");function ESs(t,e){var r=$i(),n=$i(),o=$i(),s=$i(),c=$i(),l=$i(),u=$i();return Mj(t[2],sot),_Ss(t[1],e),AZ(o,t[1]),Wl(s,o,fSs),Jfe(o,o,t[2]),Kfe(s,t[2],s),AZ(c,s),AZ(l,c),Wl(u,l,c),Wl(r,u,o),Wl(r,r,s),vSs(r,r),Wl(r,r,o),Wl(r,r,s),Wl(r,r,s),Wl(t[0],r,s),AZ(n,t[0]),Wl(n,n,s),bFn(n,o)&&Wl(t[0],t[0],hSs),AZ(n,t[0]),Wl(n,n,s),bFn(n,o)?-1:(xFn(t[0])===e[31]>>7&&Jfe(t[0],Wrr,t[0]),Wl(t[3],t[0],t[1]),0)}a(ESs,"unpackneg");function _Ss(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(_Ss,"unpack25519");function vSs(t,e){var r=$i(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)AZ(r,r),n!==1&&Wl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(vSs,"pow2523");function bFn(t,e){var r=new ub(32),n=new ub(32);return aot(r,t),aot(n,e),IFn(r,0,n,0)}a(bFn,"neq25519");function IFn(t,e,r,n){return CSs(t,e,r,n,32)}a(IFn,"crypto_verify_32");function CSs(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(CSs,"vn");function xFn(t){var e=new ub(32);return aot(e,t),e[0]&1}a(xFn,"par25519");function wFn(t,e,r){var n,o;for(Mj(t[0],Wrr),Mj(t[1],sot),Mj(t[2],sot),Mj(t[3],Wrr),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,CFn(t,e,n),Yrr(e,t),Yrr(t,t),CFn(t,e,n)}a(wFn,"scalarmult");function Jrr(t,e){var r=[$i(),$i(),$i(),$i()];Mj(r[0],_Fn),Mj(r[1],vFn),Mj(r[2],sot),Wl(r[3],_Fn,vFn),wFn(t,r,e)}a(Jrr,"scalarbase");function Mj(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(Mj,"set25519");function bSs(t,e){var r=$i(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)AZ(r,r),n!==2&&n!==4&&Wl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(bSs,"inv25519");function $rr(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($rr,"car25519");function RFn(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(RFn,"sel25519");function $i(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var yT=As();ac();ww();tPe();MFn.exports=yT.kem=yT.kem||{};var DFn=yT.jsbn.BigInteger;yT.kem.rsa={};yT.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||yT.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new DFn(yT.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(DFn.ONE)<=0);l=yT.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=yT.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};yT.kem.kdf1=function(t,e){NFn(this,t,0,e||t.digestLength)};yT.kem.kdf2=function(t,e){NFn(this,t,1,e||t.digestLength)};function NFn(t,e,r,n){t.generate=function(o,s){for(var c=new yT.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new yT.util.ByteBuffer,d=r;d{p();var pa=As();ac();FFn.exports=pa.log=pa.log||{};pa.log.levels=["none","error","warning","info","debug","verbose","max"];var cot={},enr=[],lPe=null;pa.log.LEVEL_LOCKED=2;pa.log.NO_LEVEL_CHECK=4;pa.log.INTERPOLATE=8;for(x5=0;x5"u"||e?t.flags|=pa.log.LEVEL_LOCKED:t.flags&=~pa.log.LEVEL_LOCKED};pa.log.addLogger=function(t){enr.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(LFn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},uPe=a(function(t,e){pa.log.prepareStandard(e);var r=LFn[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),Zfe=pa.log.makeLogger(uPe)):(uPe=a(function(e,r){pa.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),Zfe=pa.log.makeLogger(uPe)),pa.log.setLevel(Zfe,"debug"),pa.log.addLogger(Zfe),lPe=Zfe):console={log:a(function(){},"log")};var Zfe,LFn,uPe;lPe!==null&&typeof window<"u"&&window.location&&(cPe=new URL(window.location.href).searchParams,cPe.has("console.level")&&pa.log.setLevel(lPe,cPe.get("console.level").slice(-1)[0]),cPe.has("console.lock")&&(BFn=cPe.get("console.lock").slice(-1)[0],BFn=="true"&&pa.log.lock(lPe)));var cPe,BFn;pa.log.consoleLogger=lPe});var qFn=I((mof,QFn)=>{p();QFn.exports=E5();qit();$fe();hrr();Hrr()});var GFn=I((Aof,HFn)=>{p();var Xr=As();Ij();C2();Xke();xj();uZ();wrr();ww();ac();tot();var Xe=Xr.asn1,lv=HFn.exports=Xr.pkcs7=Xr.pkcs7||{};lv.messageFromPem=function(t){var e=Xr.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=Xe.fromDer(e.body);return lv.messageFromAsn1(n)};lv.messageToPem=function(t,e){var r={type:"PKCS7",body:Xe.toDer(t.toAsn1()).getBytes()};return Xr.pem.encode(r,{maxline:e})};lv.messageFromAsn1=function(t){var e={},r=[];if(!Xe.validate(t,lv.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=Xe.derToOid(e.contentType),s;switch(o){case Xr.pki.oids.envelopedData:s=lv.createEnvelopedData();break;case Xr.pki.oids.encryptedData:s=lv.createEncryptedData();break;case Xr.pki.oids.signedData:s=lv.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};lv.createSignedData=function(){var t=null;return t={type:Xr.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(rnr(t,n,lv.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(Xe.create(Xe.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(Xe.create(Xe.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SET,!0,t.signerInfos)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[Xe.create(Xe.Class.UNIVERSAL,Xe.Type.OID,!1,Xe.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=Xr.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=Xr.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||Xr.pki.oids.sha1;switch(u){case Xr.pki.oids.sha1:case Xr.pki.oids.sha256:case Xr.pki.oids.sha384:case Xr.pki.oids.sha512:case Xr.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=Xe.create(Xe.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var cm=As();Ij();qfe();qit();$fe();ac();var uot=$Fn.exports=cm.ssh=cm.ssh||{};uot.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=cm.util.createBuffer();Xfe(c,n),w5(c,t.e),w5(c,t.n);var l=cm.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r -`,s+=l;var d=cm.util.createBuffer();w5(d,t.d),w5(d,t.p),w5(d,t.q),w5(d,t.qInv);var f;if(!e)f=cm.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=sot(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=cm.util.createBuffer();g.putBuffer(sot("\0\0\0\0",e)),g.putBuffer(sot("\0\0\0",e));var A=cm.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(cm.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=cm.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\r +`,s+=l;var d=cm.util.createBuffer();w5(d,t.d),w5(d,t.p),w5(d,t.q),w5(d,t.qInv);var f;if(!e)f=cm.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=lot(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=cm.util.createBuffer();g.putBuffer(lot("\0\0\0\0",e)),g.putBuffer(lot("\0\0\0",e));var A=cm.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(cm.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=cm.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\r Private-Lines: `+u+`\r -`,s+=f;var E=sot("putty-private-key-file-mac-key",e),_=cm.util.createBuffer();Xfe(_,n),Xfe(_,o),Xfe(_,r),_.putInt32(c.length()),_.putBuffer(c),_.putInt32(d.length()),_.putBuffer(d);var v=cm.hmac.create();return v.start("sha1",E),v.update(_.bytes()),s+=`\r +`,s+=f;var E=lot("putty-private-key-file-mac-key",e),_=cm.util.createBuffer();Xfe(_,n),Xfe(_,o),Xfe(_,r),_.putInt32(c.length()),_.putBuffer(c),_.putInt32(d.length()),_.putBuffer(d);var v=cm.hmac.create();return v.start("sha1",E),v.update(_.bytes()),s+=`\r Private-MAC: `+v.digest().toHex()+`\r -`,s};aot.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=cm.util.createBuffer();return Xfe(n,r),w5(n,t.e),w5(n,t.n),r+" "+cm.util.encode64(n.bytes())+" "+e};aot.privateKeyToOpenSSH=function(t,e){return e?cm.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):cm.pki.privateKeyToPem(t)};aot.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||cm.md.md5.create(),n="ssh-rsa",o=cm.util.createBuffer();Xfe(o,n),w5(o,t.e),w5(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 w5(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=cm.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(w5,"_addBigIntegerToBuffer");function Xfe(t,e){t.putInt32(e.length),t.putString(e)}a(Xfe,"_addStringToBuffer");function sot(){for(var t=cm.md.sha1.create(),e=arguments.length,r=0;r{p();VFn.exports=As();Tj();fFn();v2();Pit();Xke();kFn();qfe();MFn();FFn();QFn();wrr();jit();uZ();Crr();Prr();HFn();Nrr();Srr();hrr();Yit();xw();Arr();$Fn();Urr();ac()});var KFn=I(yZ=>{"use strict";p();Object.defineProperty(yZ,"__esModule",{value:!0});yZ.convert=yZ.Format=void 0;var dPe=WFn(),Mj;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(Mj=yZ.Format||(yZ.Format={}));function zFn(t){var e=dPe.pki.pemToDer(t),r=dPe.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(zFn,"myASN");function ISs(t){var e=zFn(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(ISs,"txtFormat");function YFn(t,e){switch(e){case Mj.der:return dPe.pki.pemToDer(t);case Mj.pem:return t;case Mj.txt:return ISs(t);case Mj.asn1:return zFn(t);case Mj.fingerprint:var r=dPe.md.sha1.create(),n=YFn(t,Mj.der);return r.update(n.getBytes()),r.digest().toHex();case Mj.x509:return dPe.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(YFn,"convert");yZ.convert=YFn});var r8n=I(db=>{"use strict";p();var Oj=db&&db.__assign||function(){return Oj=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})(rnr.Agent),(0,ZFn.setGlobalDispatcher)(new ZFn.Agent({connect:{ca:e}}))}},"addToGlobalAgent");db.addToGlobalAgent=wSs});var n8n=I((bof,nnr)=>{p();function RSs(){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(RSs,"all");process.platform!=="win32"?nnr.exports.all=()=>[]:nnr.exports.all=RSs});var al=I((kof,l8n)=>{"use strict";p();l8n.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 ynr=I((Dof,p8n)=>{"use strict";p();var tpe=0,fnr=1e3,pnr=(fnr>>1)-1,Lj,hnr=Symbol("kFastTimer"),HF=[],mnr=-2,gnr=-1,d8n=0,u8n=1;function Anr(){tpe+=pnr;let t=0,e=HF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=gnr,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===gnr?(r._state=mnr,--e!==0&&(HF[t]=HF[e])):++t}HF.length=e,HF.length!==0&&f8n()}a(Anr,"onTick");function f8n(){Lj?.refresh?Lj.refresh():(clearTimeout(Lj),Lj=setTimeout(Anr,pnr),Lj?.unref())}a(f8n,"refreshTimeout");var pot=class{static{a(this,"FastTimer")}[hnr]=!0;_state=mnr;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===mnr&&HF.push(this),(!Lj||HF.length===1)&&f8n(),this._state=d8n}clear(){this._state=gnr,this._idleStart=-1}};p8n.exports={setTimeout(t,e,r){return e<=fnr?setTimeout(t,e,r):new pot(t,e,r)},clearTimeout(t){t[hnr]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new pot(t,e,r)},clearFastTimeout(t){t.clear()},now(){return tpe},tick(t=0){tpe+=t-fnr+1,Anr(),Anr()},reset(){tpe=0,HF.length=0,clearTimeout(Lj),Lj=null},kFastTimer:hnr}});var ao=I((Oof,F8n)=>{"use strict";p();var h8n=Symbol.for("undici.error.UND_ERR"),ld=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[h8n]===!0}get[h8n](){return!0}},m8n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),Enr=class extends ld{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[m8n]===!0}get[m8n](){return!0}},g8n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),_nr=class extends ld{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[g8n]===!0}get[g8n](){return!0}},A8n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),vnr=class extends ld{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[A8n]===!0}get[A8n](){return!0}},y8n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),Cnr=class extends ld{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[y8n]===!0}get[y8n](){return!0}},E8n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),bnr=class extends ld{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[E8n]===!0}get[E8n](){return!0}},_8n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),Snr=class extends ld{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[_8n]===!0}get[_8n](){return!0}},v8n=Symbol.for("undici.error.UND_ERR_ABORT"),hot=class extends ld{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[v8n]===!0}get[v8n](){return!0}},C8n=Symbol.for("undici.error.UND_ERR_ABORTED"),Tnr=class extends hot{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[C8n]===!0}get[C8n](){return!0}},b8n=Symbol.for("undici.error.UND_ERR_INFO"),Inr=class extends ld{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[b8n]===!0}get[b8n](){return!0}},S8n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),xnr=class extends ld{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[S8n]===!0}get[S8n](){return!0}},T8n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),wnr=class extends ld{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[T8n]===!0}get[T8n](){return!0}},I8n=Symbol.for("undici.error.UND_ERR_DESTROYED"),Rnr=class extends ld{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[I8n]===!0}get[I8n](){return!0}},x8n=Symbol.for("undici.error.UND_ERR_CLOSED"),knr=class extends ld{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[x8n]===!0}get[x8n](){return!0}},w8n=Symbol.for("undici.error.UND_ERR_SOCKET"),Pnr=class extends ld{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[w8n]===!0}get[w8n](){return!0}},R8n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Dnr=class extends ld{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[R8n]===!0}get[R8n](){return!0}},k8n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),Nnr=class extends ld{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[k8n]===!0}get[k8n](){return!0}},P8n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Mnr=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[P8n]===!0}get[P8n](){return!0}},D8n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),Onr=class extends ld{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[D8n]===!0}get[D8n](){return!0}},N8n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),Lnr=class extends ld{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[N8n]===!0}get[N8n](){return!0}},M8n=Symbol.for("undici.error.UND_ERR_RESPONSE"),Bnr=class extends ld{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[M8n]===!0}get[M8n](){return!0}},O8n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),Fnr=class extends ld{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[O8n]===!0}get[O8n](){return!0}},L8n=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),Unr=class extends ld{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[L8n]===!0}get[L8n](){return!0}},Qnr=class extends ld{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},B8n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),qnr=class extends ld{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[B8n]===!0}get[B8n](){return!0}};F8n.exports={AbortError:hot,HTTPParserError:Mnr,UndiciError:ld,HeadersTimeoutError:_nr,HeadersOverflowError:vnr,BodyTimeoutError:Cnr,RequestContentLengthMismatchError:xnr,ConnectTimeoutError:Enr,InvalidArgumentError:bnr,InvalidReturnValueError:Snr,RequestAbortedError:Tnr,ClientDestroyedError:Rnr,ClientClosedError:knr,InformationalError:Inr,SocketError:Pnr,NotSupportedError:Dnr,ResponseContentLengthMismatchError:wnr,BalancedPoolMissingUpstreamError:Nnr,ResponseExceededMaxSizeError:Onr,RequestRetryError:Lnr,ResponseError:Bnr,SecureProxyConnectionError:Fnr,MaxOriginsReachedError:Unr,Socks5ProxyError:Qnr,MessageSizeExceededError:qnr}});var got=I((Fof,Q8n)=>{"use strict";p();var jnr=["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"],mot={};Object.setPrototypeOf(mot,null);var U8n={};Object.setPrototypeOf(U8n,null);function PSs(t){let e=U8n[t];return e===void 0&&(e=Buffer.from(t)),e}a(PSs,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:q8n,headerNameLowerCasedRecord:DSs}=got(),Hnr=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 fPe=require("node:assert"),{kDestroyed:z8n,kBodyUsed:rpe,kListeners:Eot,kBody:$8n}=al(),{IncomingMessage:NSs}=require("node:http"),Y8n=require("node:stream"),MSs=require("node:net"),{stringify:OSs}=require("node:querystring"),{EventEmitter:LSs}=require("node:events"),yot=ynr(),{InvalidArgumentError:Ng,ConnectTimeoutError:BSs}=ao(),{headerNameLowerCasedRecord:FSs}=got(),{tree:K8n}=G8n(),[USs,QSs]=process.versions.node.split(".",2).map(t=>Number(t)),vot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[$8n]=e,this[rpe]=!1}async*[Symbol.asyncIterator](){fPe(!this[rpe],"disturbed"),this[rpe]=!0,yield*this[$8n]}};function V8n(){}a(V8n,"noop");function qSs(t){return Cot(t)?(r6n(t)===0&&t.on("data",function(){fPe(!1)}),typeof t.readableDidRead!="boolean"&&(t[rpe]=!1,LSs.prototype.on.call(t,"data",function(){this[rpe]=!0})),t):t&&typeof t.pipeTo=="function"?new vot(t):t&&a6n(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&t6n(t)?new vot(t):t}a(qSs,"wrapRequestBody");function Cot(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Cot,"isStream");function J8n(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(J8n,"isBlobLike");function Z8n(t){return t.includes("?")||t.includes("#")}a(Z8n,"pathHasQueryOrFragment");function jSs(t,e){if(Z8n(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=OSs(e);return r&&(t+="?"+r),t}a(jSs,"serializePathWithQuery");function X8n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(X8n,"isValidPort");function _ot(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(_ot,"isHttpOrHttpsPrefixed");function e6n(t){if(typeof t=="string"){if(t=new URL(t),!_ot(t.origin||t.protocol))throw new Ng("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new Ng("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&X8n(t.port)===!1)throw new Ng("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 Ng("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new Ng("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new Ng("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new Ng("Invalid URL origin: the origin must be a string or null/undefined.");if(!_ot(t.origin||t.protocol))throw new Ng("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(!_ot(t.origin||t.protocol))throw new Ng("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(e6n,"parseURL");function HSs(t){if(t=e6n(t),t.pathname!=="/"||t.search||t.hash)throw new Ng("invalid url");return t}a(HSs,"parseOrigin");function GSs(t){if(t[0]==="["){let r=t.indexOf("]");return fPe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(GSs,"getHostname");function $Ss(t){if(!t)return null;fPe(typeof t=="string");let e=GSs(t);return MSs.isIP(e)?"":e}a($Ss,"getServerName");function VSs(t){return JSON.parse(JSON.stringify(t))}a(VSs,"deepClone");function WSs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(WSs,"isAsyncIterable");function t6n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(t6n,"isIterable");function zSs(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(zSs,"hasSafeIterator");function r6n(t){if(t==null)return 0;if(Cot(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(J8n(t))return t.size!=null?t.size:null;if(s6n(t))return t.byteLength}return null}a(r6n,"bodyLength");function n6n(t){return t&&!!(t.destroyed||t[z8n]||Y8n.isDestroyed?.(t))}a(n6n,"isDestroyed");function i6n(t,e){t==null||!Cot(t)||n6n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===NSs&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[z8n]=!0))}a(i6n,"destroy");var YSs=/timeout=(\d+)/;function KSs(t){let e=t.match(YSs);return e?parseInt(e[1],10)*1e3:null}a(KSs,"parseKeepAliveTimeout");function o6n(t){return typeof t=="string"?FSs[t]??t.toLowerCase():K8n.lookup(t)??t.toString("latin1").toLowerCase()}a(o6n,"headerNameToString");function JSs(t){return K8n.lookup(t)??t.toString("latin1").toLowerCase()}a(JSs,"bufferToLowerCasedHeaderName");function ZSs(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(ZSs,"parseHeaders");function XSs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(eTs,"encodeRawHeaders");function s6n(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(s6n,"isBuffer");function tTs(t,e,r){if(!t||typeof t!="object")throw new Ng("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new Ng("invalid onConnect method");if(typeof t.onError!="function")throw new Ng("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new Ng("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new Ng("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new Ng("invalid onHeaders method");if(typeof t.onData!="function")throw new Ng("invalid onData method");if(typeof t.onComplete!="function")throw new Ng("invalid onComplete method")}}}a(tTs,"assertRequestHandler");function rTs(t){return!!(t&&(Y8n.isDisturbed(t)||t[rpe]))}a(rTs,"isDisturbed");function nTs(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(nTs,"getSocketInfo");function iTs(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(iTs,"ReadableStreamFrom");function a6n(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(a6n,"isFormDataLike");function oTs(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(oTs,"addAbortListener");var c6n=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 sTs(t){return c6n[t]===1}a(sTs,"isTokenCharCode");var aTs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function cTs(t){if(t.length>=12)return aTs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return V8n;let r=null,n=null,o=yot.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>W8n(t.deref(),e))})},e.timeout);return()=>{yot.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return V8n;let r=null,n=yot.setFastTimeout(()=>{r=setImmediate(()=>{W8n(t.deref(),e)})},e.timeout);return()=>{yot.clearFastTimeout(n),clearImmediate(r)}};function W8n(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)`,i6n(t,new BSs(r))}a(W8n,"onConnectTimeout");function ATs(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(ATs,"getProtocolFromUrlString");var l6n=Object.create(null);l6n.enumerable=!0;var Gnr={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},u6n={...Gnr,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(Gnr,null);Object.setPrototypeOf(u6n,null);d6n.exports={kEnumerableProperty:l6n,isDisturbed:rTs,isBlobLike:J8n,parseOrigin:HSs,parseURL:e6n,getServerName:$Ss,isStream:Cot,isIterable:t6n,hasSafeIterator:zSs,isAsyncIterable:WSs,isDestroyed:n6n,headerNameToString:o6n,bufferToLowerCasedHeaderName:JSs,addListener:pTs,removeAllListeners:hTs,errorRequest:mTs,parseRawHeaders:XSs,encodeRawHeaders:eTs,parseHeaders:ZSs,parseKeepAliveTimeout:KSs,destroy:i6n,bodyLength:r6n,deepClone:VSs,ReadableStreamFrom:iTs,isBuffer:s6n,assertRequestHandler:tTs,getSocketInfo:nTs,isFormDataLike:a6n,pathHasQueryOrFragment:Z8n,serializePathWithQuery:jSs,addAbortListener:oTs,isValidHTTPToken:cTs,isValidHeaderValue:uTs,isTokenCharCode:sTs,parseRangeHeader:fTs,normalizedMethodRecordsBase:Gnr,normalizedMethodRecords:u6n,isValidPort:X8n,isHttpOrHttpsPrefixed:_ot,nodeMajor:USs,nodeMinor:QSs,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:qSs,setupConnectTimeout:gTs,getProtocolFromUrlString:ATs}});var Wnr=I((Wof,g6n)=>{"use strict";p();var{kConnected:f6n,kPending:p6n,kRunning:h6n,kSize:m6n,kFree:yTs,kQueued:ETs}=al(),$nr=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[f6n],this.pending=e[p6n],this.running=e[h6n],this.size=e[m6n]}},Vnr=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[f6n],this.free=e[yTs],this.pending=e[p6n],this.queued=e[ETs],this.running=e[h6n],this.size=e[m6n]}};g6n.exports={ClientStats:$nr,PoolStats:Vnr}});var Bj=I((Kof,y6n)=>{"use strict";p();var cl=require("node:diagnostics_channel"),Jnr=require("node:util"),EZ=Jnr.debuglog("undici"),pPe=Jnr.debuglog("fetch"),bot=Jnr.debuglog("websocket"),AT={beforeConnect:cl.channel("undici:client:beforeConnect"),connected:cl.channel("undici:client:connected"),connectError:cl.channel("undici:client:connectError"),sendHeaders:cl.channel("undici:client:sendHeaders"),create:cl.channel("undici:request:create"),bodySent:cl.channel("undici:request:bodySent"),bodyChunkSent:cl.channel("undici:request:bodyChunkSent"),bodyChunkReceived:cl.channel("undici:request:bodyChunkReceived"),headers:cl.channel("undici:request:headers"),trailers:cl.channel("undici:request:trailers"),error:cl.channel("undici:request:error"),open:cl.channel("undici:websocket:open"),close:cl.channel("undici:websocket:close"),socketError:cl.channel("undici:websocket:socket_error"),ping:cl.channel("undici:websocket:ping"),pong:cl.channel("undici:websocket:pong"),proxyConnected:cl.channel("undici:proxy:connected")},znr=!1;function A6n(t=EZ){if(!znr){if(AT.beforeConnect.hasSubscribers||AT.connected.hasSubscribers||AT.connectError.hasSubscribers||AT.sendHeaders.hasSubscribers){znr=!0;return}znr=!0,cl.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)}),cl.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)}),cl.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)}),cl.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(A6n,"trackClientEvents");var Ynr=!1;function _Ts(t=EZ){if(!Ynr){if(AT.headers.hasSubscribers||AT.trailers.hasSubscribers||AT.error.hasSubscribers){Ynr=!0;return}Ynr=!0,cl.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)}),cl.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),cl.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(_Ts,"trackRequestEvents");var Knr=!1;function vTs(t=bot){if(!Knr){if(AT.open.hasSubscribers||AT.close.hasSubscribers||AT.socketError.hasSubscribers||AT.ping.hasSubscribers||AT.pong.hasSubscribers){Knr=!0;return}Knr=!0,cl.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")}),cl.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),cl.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),cl.subscribe("undici:websocket:ping",e=>{t("ping received")}),cl.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(vTs,"trackWebSocketEvents");(EZ.enabled||pPe.enabled)&&(A6n(pPe.enabled?pPe:EZ),_Ts(pPe.enabled?pPe:EZ));bot.enabled&&(A6n(EZ.enabled?EZ:bot),vTs(bot));y6n.exports={channels:AT}});var v6n=I((Xof,_6n)=>{"use strict";p();var{InvalidArgumentError:Qc,NotSupportedError:CTs}=ao(),R5=require("node:assert"),{isValidHTTPToken:Znr,isValidHeaderValue:Xnr,isStream:bTs,destroy:STs,isBuffer:TTs,isFormDataLike:ITs,isIterable:xTs,hasSafeIterator:wTs,isBlobLike:RTs,serializePathWithQuery:kTs,assertRequestHandler:PTs,getServerName:DTs,normalizedMethodRecords:NTs,getProtocolFromUrlString:MTs}=Po(),{channels:fb}=Bj(),{headerNameLowerCasedRecord:E6n}=got(),OTs=/[^\u0021-\u00ff]/;function LTs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a(LTs,"isValidContentLengthHeaderValue");var Nw=Symbol("handler"),eir=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:E,typeOfService:_},v){if(typeof r!="string")throw new Qc("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Qc("path must be an absolute URL or start with a slash");if(OTs.test(r))throw new Qc("invalid request path");if(typeof n!="string")throw new Qc("method must be a string");if(NTs[n]===void 0&&!Znr(n))throw new Qc("invalid request method");if(d&&typeof d!="string")throw new Qc("upgrade must be a string");if(d&&!Xnr(d))throw new Qc("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Qc("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Qc("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Qc("invalid reset");if(g!=null&&typeof g!="boolean")throw new Qc("invalid expectContinue");if(y!=null)throw new Qc("invalid throwOnError");if(E!=null&&E!==0)throw new Qc("maxRedirections is not supported, use the redirect interceptor");if(_!=null&&(!Number.isInteger(_)||_<0||_>255))throw new Qc("typeOfService must be an integer between 0 and 255");if(this.headersTimeout=f,this.bodyTimeout=h,this.method=n,this.typeOfService=_??0,this.abort=null,o==null)this.body=null;else if(bTs(o)){this.body=o;let b=this.body._readableState;(!b||!b.autoDestroy)&&(this.endHandler=a(function(){STs(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(TTs(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(ITs(o)||xTs(o)||RTs(o))this.body=o;else throw new Qc("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?kTs(r,c):r,this.origin=e,this.protocol=MTs(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 Qc("headers array must be even");for(let b=0;b{"use strict";p();var{InvalidArgumentError:BTs}=ao();b6n.exports=class C6n{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new C6n(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"),tir(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"),tir(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"),tir(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new BTs("invalid onError method");this.#e.onError?.(r)}};function tir(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(tir,"toRawHeaderValue")});var mPe=I((osf,S6n)=>{"use strict";p();var FTs=require("node:events"),UTs=hPe(),QTs=a(t=>(e,r)=>t(e,UTs.wrap(r)),"wrapInterceptor"),rir=class extends FTs{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=QTs(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")})}};S6n.exports=rir});var x6n=I((csf,I6n)=>{"use strict";p();var{parseHeaders:nir}=Po(),{InvalidArgumentError:qTs}=ao(),iir=Symbol("resume"),oir=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[iir]=null;rawHeaders=null;rawTrailers=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[iir]?.())}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}};I6n.exports=class T6n{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new T6n(e):e}onConnect(e,r){this.#t=new oir(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,nir(r),n)}onHeaders(e,r,n,o){return this.#t[iir]=n,this.#t.rawHeaders=r,this.#e.onResponseStart?.(this.#t,e,nir(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,nir(e))}onError(e){if(!this.#e.onResponseError)throw new qTs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var vZ=I((dsf,w6n)=>{"use strict";p();var jTs=mPe(),HTs=x6n(),{ClientDestroyedError:sir,ClientClosedError:GTs,InvalidArgumentError:Tot}=ao(),{kDestroy:$Ts,kClose:VTs,kClosed:gPe,kDestroyed:npe,kDispatch:WTs}=al(),Fj=Symbol("onDestroyed"),_Z=Symbol("onClosed"),air=Symbol("webSocketOptions"),cir=class extends jTs{static{a(this,"DispatcherBase")}[npe]=!1;[Fj]=null;[gPe]=!1;[_Z]=null;constructor(e){super(),this[air]=e?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[air].maxFragments??131072,maxPayloadSize:this[air].maxPayloadSize??128*1024*1024}}get destroyed(){return this[npe]}get closed(){return this[gPe]}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 Tot("invalid callback");if(this[npe]){let n=new sir;queueMicrotask(()=>e(n,null));return}if(this[gPe]){this[_Z]?this[_Z].push(e):queueMicrotask(()=>e(null,null));return}this[gPe]=!0,this[_Z]??=[],this[_Z].push(e);let r=a(()=>{let n=this[_Z];this[_Z]=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 Tot("invalid callback");if(this[npe]){this[Fj]?this[Fj].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new sir),this[npe]=!0,this[Fj]??=[],this[Fj].push(r);let n=a(()=>{let o=this[Fj];this[Fj]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new Tot("handler must be an object");r=HTs.unwrap(r);try{if(!e||typeof e!="object")throw new Tot("opts must be an object.");if(this[npe]||this[Fj])throw new sir;if(this[gPe])throw new GTs;return this[WTs](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};w6n.exports=cir});var CZ=I((msf,P6n)=>{"use strict";p();var zTs=require("node:net"),R6n=require("node:assert"),k6n=Po(),{InvalidArgumentError:YTs}=ao(),lir,KTs=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 JTs({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new YTs("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new KTs(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:"){lir||(lir=require("node:tls")),A=A||l.servername||k6n.getServerName(h)||null;let T=A||f;R6n(T);let w=s||u.get(T)||null;g=g||443,v=lir.connect({highWaterMark:16384,...l,servername:A,session:w,localAddress:y,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:E,port:g,host:f}),v.on("session",function(R){u.set(T,R)})}else R6n(!E,"httpSocket can only be sent on TLS update"),g=g||80,v=zTs.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 b=k6n.setupConnectTimeout(new WeakRef(v),{timeout:o,hostname:f,port:g});return v.setNoDelay(!0).once(m==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(b),_){let T=_;_=null,T(null,this)}}).on("error",function(T){if(queueMicrotask(b),_){let w=_;_=null,w(T)}}),v},"connect")}a(JTs,"buildConnector");P6n.exports=JTs});var D6n=I(uir=>{"use strict";p();Object.defineProperty(uir,"__esModule",{value:!0});uir.enumToMap=ZTs;function ZTs(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(ZTs,"enumToMap")});var N6n=I(je=>{"use strict";p();Object.defineProperty(je,"__esModule",{value:!0});je.SPECIAL_HEADERS=je.MINOR=je.MAJOR=je.HTAB_SP_VCHAR_OBS_TEXT=je.QUOTED_STRING=je.CONNECTION_TOKEN_CHARS=je.HEADER_CHARS=je.TOKEN=je.HEX=je.URL_CHAR=je.USERINFO_CHARS=je.MARK=je.ALPHANUM=je.NUM=je.HEX_MAP=je.NUM_MAP=je.ALPHA=je.STATUSES_HTTP=je.H_METHOD_MAP=je.METHOD_MAP=je.METHODS_RTSP=je.METHODS_ICE=je.METHODS_HTTP=je.HEADER_STATE=je.FINISH=je.STATUSES=je.METHODS=je.LENIENT_FLAGS=je.FLAGS=je.TYPE=je.ERROR=void 0;var XTs=D6n();je.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};je.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};je.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};je.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};je.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};je.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};je.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};je.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};je.METHODS_HTTP=[je.METHODS.DELETE,je.METHODS.GET,je.METHODS.HEAD,je.METHODS.POST,je.METHODS.PUT,je.METHODS.CONNECT,je.METHODS.OPTIONS,je.METHODS.TRACE,je.METHODS.COPY,je.METHODS.LOCK,je.METHODS.MKCOL,je.METHODS.MOVE,je.METHODS.PROPFIND,je.METHODS.PROPPATCH,je.METHODS.SEARCH,je.METHODS.UNLOCK,je.METHODS.BIND,je.METHODS.REBIND,je.METHODS.UNBIND,je.METHODS.ACL,je.METHODS.REPORT,je.METHODS.MKACTIVITY,je.METHODS.CHECKOUT,je.METHODS.MERGE,je.METHODS["M-SEARCH"],je.METHODS.NOTIFY,je.METHODS.SUBSCRIBE,je.METHODS.UNSUBSCRIBE,je.METHODS.PATCH,je.METHODS.PURGE,je.METHODS.MKCALENDAR,je.METHODS.LINK,je.METHODS.UNLINK,je.METHODS.PRI,je.METHODS.SOURCE,je.METHODS.QUERY];je.METHODS_ICE=[je.METHODS.SOURCE];je.METHODS_RTSP=[je.METHODS.OPTIONS,je.METHODS.DESCRIBE,je.METHODS.ANNOUNCE,je.METHODS.SETUP,je.METHODS.PLAY,je.METHODS.PAUSE,je.METHODS.TEARDOWN,je.METHODS.GET_PARAMETER,je.METHODS.SET_PARAMETER,je.METHODS.REDIRECT,je.METHODS.RECORD,je.METHODS.FLUSH,je.METHODS.GET,je.METHODS.POST];je.METHOD_MAP=(0,XTs.enumToMap)(je.METHODS);je.H_METHOD_MAP=Object.fromEntries(Object.entries(je.METHODS).filter(([t])=>t.startsWith("H")));je.STATUSES_HTTP=[je.STATUSES.CONTINUE,je.STATUSES.SWITCHING_PROTOCOLS,je.STATUSES.PROCESSING,je.STATUSES.EARLY_HINTS,je.STATUSES.RESPONSE_IS_STALE,je.STATUSES.REVALIDATION_FAILED,je.STATUSES.DISCONNECTED_OPERATION,je.STATUSES.HEURISTIC_EXPIRATION,je.STATUSES.MISCELLANEOUS_WARNING,je.STATUSES.OK,je.STATUSES.CREATED,je.STATUSES.ACCEPTED,je.STATUSES.NON_AUTHORITATIVE_INFORMATION,je.STATUSES.NO_CONTENT,je.STATUSES.RESET_CONTENT,je.STATUSES.PARTIAL_CONTENT,je.STATUSES.MULTI_STATUS,je.STATUSES.ALREADY_REPORTED,je.STATUSES.TRANSFORMATION_APPLIED,je.STATUSES.IM_USED,je.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,je.STATUSES.MULTIPLE_CHOICES,je.STATUSES.MOVED_PERMANENTLY,je.STATUSES.FOUND,je.STATUSES.SEE_OTHER,je.STATUSES.NOT_MODIFIED,je.STATUSES.USE_PROXY,je.STATUSES.SWITCH_PROXY,je.STATUSES.TEMPORARY_REDIRECT,je.STATUSES.PERMANENT_REDIRECT,je.STATUSES.BAD_REQUEST,je.STATUSES.UNAUTHORIZED,je.STATUSES.PAYMENT_REQUIRED,je.STATUSES.FORBIDDEN,je.STATUSES.NOT_FOUND,je.STATUSES.METHOD_NOT_ALLOWED,je.STATUSES.NOT_ACCEPTABLE,je.STATUSES.PROXY_AUTHENTICATION_REQUIRED,je.STATUSES.REQUEST_TIMEOUT,je.STATUSES.CONFLICT,je.STATUSES.GONE,je.STATUSES.LENGTH_REQUIRED,je.STATUSES.PRECONDITION_FAILED,je.STATUSES.PAYLOAD_TOO_LARGE,je.STATUSES.URI_TOO_LONG,je.STATUSES.UNSUPPORTED_MEDIA_TYPE,je.STATUSES.RANGE_NOT_SATISFIABLE,je.STATUSES.EXPECTATION_FAILED,je.STATUSES.IM_A_TEAPOT,je.STATUSES.PAGE_EXPIRED,je.STATUSES.ENHANCE_YOUR_CALM,je.STATUSES.MISDIRECTED_REQUEST,je.STATUSES.UNPROCESSABLE_ENTITY,je.STATUSES.LOCKED,je.STATUSES.FAILED_DEPENDENCY,je.STATUSES.TOO_EARLY,je.STATUSES.UPGRADE_REQUIRED,je.STATUSES.PRECONDITION_REQUIRED,je.STATUSES.TOO_MANY_REQUESTS,je.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,je.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,je.STATUSES.LOGIN_TIMEOUT,je.STATUSES.NO_RESPONSE,je.STATUSES.RETRY_WITH,je.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,je.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,je.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,je.STATUSES.INVALID_X_FORWARDED_FOR,je.STATUSES.REQUEST_HEADER_TOO_LARGE,je.STATUSES.SSL_CERTIFICATE_ERROR,je.STATUSES.SSL_CERTIFICATE_REQUIRED,je.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,je.STATUSES.INVALID_TOKEN,je.STATUSES.CLIENT_CLOSED_REQUEST,je.STATUSES.INTERNAL_SERVER_ERROR,je.STATUSES.NOT_IMPLEMENTED,je.STATUSES.BAD_GATEWAY,je.STATUSES.SERVICE_UNAVAILABLE,je.STATUSES.GATEWAY_TIMEOUT,je.STATUSES.HTTP_VERSION_NOT_SUPPORTED,je.STATUSES.VARIANT_ALSO_NEGOTIATES,je.STATUSES.INSUFFICIENT_STORAGE,je.STATUSES.LOOP_DETECTED,je.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,je.STATUSES.NOT_EXTENDED,je.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,je.STATUSES.WEB_SERVER_UNKNOWN_ERROR,je.STATUSES.WEB_SERVER_IS_DOWN,je.STATUSES.CONNECTION_TIMEOUT,je.STATUSES.ORIGIN_IS_UNREACHABLE,je.STATUSES.TIMEOUT_OCCURED,je.STATUSES.SSL_HANDSHAKE_FAILED,je.STATUSES.INVALID_SSL_CERTIFICATE,je.STATUSES.RAILGUN_ERROR,je.STATUSES.SITE_IS_OVERLOADED,je.STATUSES.SITE_IS_FROZEN,je.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,je.STATUSES.NETWORK_READ_TIMEOUT,je.STATUSES.NETWORK_CONNECT_TIMEOUT];je.ALPHA=[];for(let t=65;t<=90;t++)je.ALPHA.push(String.fromCharCode(t)),je.ALPHA.push(String.fromCharCode(t+32));je.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};je.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};je.NUM=["0","1","2","3","4","5","6","7","8","9"];je.ALPHANUM=je.ALPHA.concat(je.NUM);je.MARK=["-","_",".","!","~","*","'","(",")"];je.USERINFO_CHARS=je.ALPHANUM.concat(je.MARK).concat(["%",";",":","&","=","+","$",","]);je.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(je.ALPHANUM);je.HEX=je.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);je.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(je.ALPHANUM);je.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&je.HEADER_CHARS.push(t);je.CONNECTION_TOKEN_CHARS=je.HEADER_CHARS.filter(t=>t!==44);je.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&je.QUOTED_STRING.push(t);je.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)je.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)je.HTAB_SP_VCHAR_OBS_TEXT.push(t);je.MAJOR=je.NUM_MAP;je.MINOR=je.MAJOR;je.SPECIAL_HEADERS={connection:je.HEADER_STATE.CONNECTION,"content-length":je.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":je.HEADER_STATE.CONNECTION,"transfer-encoding":je.HEADER_STATE.TRANSFER_ENCODING,upgrade:je.HEADER_STATE.UPGRADE};je.default={ERROR:je.ERROR,TYPE:je.TYPE,FLAGS:je.FLAGS,LENIENT_FLAGS:je.LENIENT_FLAGS,METHODS:je.METHODS,STATUSES:je.STATUSES,FINISH:je.FINISH,HEADER_STATE:je.HEADER_STATE,ALPHA:je.ALPHA,NUM_MAP:je.NUM_MAP,HEX_MAP:je.HEX_MAP,NUM:je.NUM,ALPHANUM:je.ALPHANUM,MARK:je.MARK,USERINFO_CHARS:je.USERINFO_CHARS,URL_CHAR:je.URL_CHAR,HEX:je.HEX,TOKEN:je.TOKEN,HEADER_CHARS:je.HEADER_CHARS,CONNECTION_TOKEN_CHARS:je.CONNECTION_TOKEN_CHARS,QUOTED_STRING:je.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:je.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:je.MAJOR,MINOR:je.MINOR,SPECIAL_HEADERS:je.SPECIAL_HEADERS,METHODS_HTTP:je.METHODS_HTTP,METHODS_ICE:je.METHODS_ICE,METHODS_RTSP:je.METHODS_RTSP,METHOD_MAP:je.METHOD_MAP,H_METHOD_MAP:je.H_METHOD_MAP,STATUSES_HTTP:je.STATUSES_HTTP}});var fir=I((bsf,M6n)=>{"use strict";p();var{Buffer:eIs}=require("node:buffer"),tIs="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==",dir;Object.defineProperty(M6n,"exports",{get:a(()=>dir||(dir=eIs.from(tIs,"base64")),"get")})});var L6n=I((Isf,O6n)=>{"use strict";p();var{Buffer:rIs}=require("node:buffer"),nIs="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==",pir;Object.defineProperty(O6n,"exports",{get:a(()=>pir||(pir=rIs.from(nIs,"base64")),"get")})});var APe=I((Rsf,G6n)=>{"use strict";p();var B6n=["GET","HEAD","POST"],iIs=new Set(B6n),oIs=[101,204,205,304],F6n=[301,302,303,307,308],sIs=new Set(F6n),U6n=["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"],aIs=new Set(U6n),Q6n=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],cIs=["",...Q6n],lIs=new Set(Q6n),uIs=["follow","manual","error"],q6n=["GET","HEAD","OPTIONS","TRACE"],dIs=new Set(q6n),fIs=["navigate","same-origin","no-cors","cors"],pIs=["omit","same-origin","include"],hIs=["default","no-store","reload","no-cache","force-cache","only-if-cached"],mIs=["content-encoding","content-language","content-location","content-type","content-length"],gIs=["half"],j6n=["CONNECT","TRACE","TRACK"],AIs=new Set(j6n),H6n=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],yIs=new Set(H6n);G6n.exports={subresource:H6n,forbiddenMethods:j6n,requestBodyHeader:mIs,referrerPolicy:cIs,requestRedirect:uIs,requestMode:fIs,requestCredentials:pIs,requestCache:hIs,redirectStatus:F6n,corsSafeListedMethods:B6n,nullBodyStatus:oIs,safeMethods:q6n,badPorts:U6n,requestDuplex:gIs,subresourceSet:yIs,badPortsSet:aIs,redirectStatusSet:sIs,corsSafeListedMethodsSet:iIs,safeMethodsSet:dIs,forbiddenMethodsSet:AIs,referrerPolicyTokens:lIs}});var mir=I((Psf,$6n)=>{"use strict";p();var hir=Symbol.for("undici.globalOrigin.1");function EIs(){return globalThis[hir]}a(EIs,"getGlobalOrigin");function _Is(t){if(t===void 0){Object.defineProperty(globalThis,hir,{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,hir,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(_Is,"setGlobalOrigin");$6n.exports={getGlobalOrigin:EIs,setGlobalOrigin:_Is}});var Iot=I((Msf,V6n)=>{"use strict";p();var vIs=new TextDecoder;function CIs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),vIs.decode(t))}a(CIs,"utf8DecodeBytes");V6n.exports={utf8DecodeBytes:CIs}});var GF=I((Bsf,K6n)=>{"use strict";p();var W6n=require("node:assert"),{utf8DecodeBytes:bIs}=Iot();function SIs(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(wIs,"isomorphicDecode");var RIs=/[^\x00-\xFF]/;function kIs(t){return W6n(!RIs.test(t)),t}a(kIs,"isomorphicEncode");function PIs(t){return JSON.parse(bIs(t))}a(PIs,"parseJSONFromBytes");function DIs(t,e=!0,r=!0){return Y6n(t,e,r,z6n)}a(DIs,"removeASCIIWhitespace");function Y6n(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(Y6n,"removeChars");function NIs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return W6n(typeof e=="string"),e}a(NIs,"serializeJavascriptValueToJSONString");K6n.exports={collectASequenceOfCodePoints:SIs,collectASequenceOfCodePointsFast:TIs,forgivingBase64:xIs,isASCIIWhitespace:z6n,isomorphicDecode:wIs,isomorphicEncode:kIs,parseJSONFromBytes:PIs,removeASCIIWhitespace:DIs,removeChars:Y6n,serializeJavascriptValueToJSONString:NIs}});var Mw=I((Qsf,r9n)=>{"use strict";p();var wot=require("node:assert"),{forgivingBase64:MIs,collectASequenceOfCodePoints:gir,collectASequenceOfCodePointsFast:yPe,isomorphicDecode:OIs,removeASCIIWhitespace:LIs,removeChars:BIs}=GF(),FIs=new TextEncoder,EPe=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,UIs=/[\u000A\u000D\u0009\u0020]/u,QIs=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function qIs(t){wot(t.protocol==="data:");let e=X6n(t,!0);e=e.slice(5);let r={position:0},n=yPe(",",e,r),o=n.length;if(n=LIs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=e9n(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=OIs(c);if(c=MIs(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=Air(n);return l==="failure"&&(l=Air("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(qIs,"dataURLProcessor");function X6n(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(X6n,"URLSerializer");function e9n(t){let e=FIs.encode(t);return jIs(e)}a(e9n,"stringPercentDecode");function J6n(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(J6n,"isHexCharByte");function Z6n(t){return t>=48&&t<=57?t-48:(t&223)-55}a(Z6n,"hexByteToNumber");function jIs(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=yPe(";",t,e);if(n=xot(n,!1,!0),n.length===0||!EPe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionUIs.test(d),t,e);let l=gir(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=t9n(t,e,!0),yPe(";",t,e);else if(u=yPe(";",t,e),u=xot(u,!1,!0),u.length===0)continue;l.length!==0&&EPe.test(l)&&(u.length===0||QIs.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(Air,"parseMIMEType");function t9n(t,e,r=!1){let n=e.position,o="";for(wot(t[e.position]==='"'),e.position++;o+=gir(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(t9n,"collectAnHTTPQuotedString");function HIs(t){wot(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",EPe.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(HIs,"serializeAMimeType");function GIs(t){return t===13||t===10||t===9||t===32}a(GIs,"isHTTPWhiteSpace");function xot(t,e=!0,r=!0){return BIs(t,e,r,GIs)}a(xot,"removeHTTPWhitespace");function $Is(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($Is,"minimizeSupportedMimeType");r9n.exports={dataURLProcessor:qIs,URLSerializer:X6n,stringPercentDecode:e9n,parseMIMEType:Air,collectAnHTTPQuotedString:t9n,serializeAMimeType:HIs,removeHTTPWhitespace:xot,minimizeSupportedMimeType:$Is,HTTP_TOKEN_CODEPOINTS:EPe}});var $F=I((Hsf,Eir)=>{"use strict";p();var n9n={__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 VIs(t){try{return n9n[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(VIs,"detectRuntimeFeatureByNodeModule");function WIs(t,e){return typeof n9n[t]()[e]<"u"}a(WIs,"detectRuntimeFeatureByExportedProperty");var i9n=["markAsUncloneable","zstd"],zIs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},o9n=["crypto","sqlite"],YIs=[...o9n,...i9n];function KIs(t){if(o9n.includes(t))return VIs(`node:${t}`);if(i9n.includes(t)){let[e,r]=zIs[t];return WIs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(KIs,"detectRuntimeFeature");var yir=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(YIs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=KIs(e);return this.#e.set(e,r),r}},s9n=new yir;Eir.exports.runtimeFeatures=s9n;Eir.exports.default=s9n});var $A=I((Vsf,c9n)=>{"use strict";p();var JIs=require("node:assert"),{types:hp,inspect:ZIs}=require("node:util"),{runtimeFeatures:XIs}=$F(),_ir=1,vir=2,Rot=3,kot=4,Cir=5,Pot=6,bir=7,yT=8,a9n=Function.call.bind(Function.prototype[Symbol.hasInstance]),ut={converters:{},util:{},errors:{},is:{}};ut.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};ut.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 ut.errors.exception({header:t.prefix,message:r})};ut.errors.invalidArgument=function(t){return ut.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};ut.brandCheck=function(t,e){if(!a9n(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};ut.brandCheckMultiple=function(t){let e=t.map(r=>ut.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};ut.argumentLengthCheck=function({length:t},e,r){if(ta9n(t,e)};ut.util.Type=function(t){switch(typeof t){case"undefined":return _ir;case"boolean":return vir;case"string":return Rot;case"symbol":return kot;case"number":return Cir;case"bigint":return Pot;case"function":case"object":return t===null?bir:yT}};ut.util.Types={UNDEFINED:_ir,BOOLEAN:vir,STRING:Rot,SYMBOL:kot,NUMBER:Cir,BIGINT:Pot,NULL:bir,OBJECT:yT};ut.util.TypeValueToString=function(t){switch(ut.util.Type(t)){case _ir:return"Undefined";case vir:return"Boolean";case Rot:return"String";case kot:return"Symbol";case Cir:return"Number";case Pot:return"BigInt";case bir:return"Null";case yT:return"Object"}};ut.util.markAsUncloneable=XIs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};ut.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),ut.util.HasFlag(n,ut.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw ut.errors.exception({header:"Integer conversion",message:`Could not convert ${ut.util.Stringify(t)} to an integer.`});if(c=ut.util.IntegerPart(c),co)throw ut.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&ut.util.HasFlag(n,ut.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=ut.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};ut.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};ut.util.Stringify=function(t){switch(ut.util.Type(t)){case kot:return`Symbol(${t.description})`;case yT:return ZIs(t);case Rot:return`"${t}"`;case Pot:return`${t}n`;default:return`${t}`}};ut.util.IsResizableArrayBuffer=function(t){if(hp.isArrayBuffer(t))return t.resizable;if(hp.isSharedArrayBuffer(t))return t.growable;throw ut.errors.exception({header:"IsResizableArrayBuffer",message:`"${ut.util.Stringify(t)}" is not an array buffer.`})};ut.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};ut.sequenceConverter=function(t){return(e,r,n,o)=>{if(ut.util.Type(e)!==yT)throw ut.errors.exception({header:r,message:`${n} (${ut.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 ut.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}};ut.recordConverter=function(t,e){return(r,n,o)=>{if(ut.util.Type(r)!==yT)throw ut.errors.exception({header:n,message:`${o} ("${ut.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!hp.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=ut.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}};ut.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw ut.errors.exception({header:n,message:`Expected ${o} ("${ut.util.Stringify(r)}") to be an instance of ${e}.`});return r}};ut.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&&ut.util.Type(e)!==yT)throw ut.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 ut.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 ut.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};ut.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};ut.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};ut.is.ReadableStream=ut.util.MakeTypeAssertion(ReadableStream);ut.is.Blob=ut.util.MakeTypeAssertion(Blob);ut.is.URLSearchParams=ut.util.MakeTypeAssertion(URLSearchParams);ut.is.File=ut.util.MakeTypeAssertion(File);ut.is.URL=ut.util.MakeTypeAssertion(URL);ut.is.AbortSignal=ut.util.MakeTypeAssertion(AbortSignal);ut.is.MessagePort=ut.util.MakeTypeAssertion(MessagePort);ut.is.BufferSource=function(t){return hp.isArrayBuffer(t)||ArrayBuffer.isView(t)&&hp.isArrayBuffer(t.buffer)};ut.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(hp.isTypedArray(e)||hp.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(JIs(hp.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};ut.converters.DOMString=function(t,e,r,n){if(t===null&&ut.util.HasFlag(n,ut.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw ut.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};ut.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw ut.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};ut.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};ut.converters.boolean=function(t){return!!t};ut.converters.any=function(t){return t};ut.converters["long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"signed",0,e,r)};ut.converters["unsigned long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"unsigned",0,e,r)};ut.converters["unsigned long"]=function(t,e,r){return ut.util.ConvertToInt(t,32,"unsigned",0,e,r)};ut.converters["unsigned short"]=function(t,e,r,n){return ut.util.ConvertToInt(t,16,"unsigned",n,e,r)};ut.converters.ArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};ut.converters.SharedArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isSharedArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};ut.converters.TypedArray=function(t,e,r,n,o){if(ut.util.Type(t)!==yT||!hp.isTypedArray(t)||t.constructor.name!==e.name)throw ut.errors.conversionFailed({prefix:r,argument:`${n} ("${ut.util.Stringify(t)}")`,types:[e.name]});if(!ut.util.HasFlag(o,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(o,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};ut.converters.DataView=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isDataView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["DataView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.ArrayBufferView=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isArrayBufferView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.BufferSource=function(t,e,r,n){if(hp.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(hp.isArrayBufferView(t))return n&=~ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw hp.isSharedArrayBuffer(t)?ut.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};ut.converters.AllowSharedBufferSource=function(t,e,r,n){if(hp.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(hp.isSharedArrayBuffer(t))return ut.converters.SharedArrayBuffer(t,e,r,n);if(hp.isArrayBufferView(t))return n|=ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};ut.converters["sequence"]=ut.sequenceConverter(ut.converters.ByteString);ut.converters["sequence>"]=ut.sequenceConverter(ut.converters["sequence"]);ut.converters["record"]=ut.recordConverter(ut.converters.ByteString,ut.converters.ByteString);ut.converters.Blob=ut.interfaceConverter(ut.is.Blob,"Blob");ut.converters.AbortSignal=ut.interfaceConverter(ut.is.AbortSignal,"AbortSignal");ut.converters.EventHandlerNonNull=function(t){return ut.util.Type(t)!==yT?null:typeof t=="function"?t:()=>{}};ut.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};c9n.exports={webidl:ut}});var ET=I((zsf,C9n)=>{"use strict";p();var{Transform:exs}=require("node:stream"),l9n=require("node:zlib"),{redirectStatusSet:txs,referrerPolicyTokens:rxs,badPortsSet:nxs}=APe(),{getGlobalOrigin:u9n}=mir(),{collectAnHTTPQuotedString:ixs,parseMIMEType:oxs}=Mw(),{performance:sxs}=require("node:perf_hooks"),{ReadableStreamFrom:axs,isValidHTTPToken:d9n,normalizedMethodRecordsBase:cxs}=Po(),vPe=require("node:assert"),{isUint8Array:lxs}=require("node:util/types"),{webidl:Uj}=$A(),{isomorphicEncode:Sir,collectASequenceOfCodePoints:bZ,removeChars:uxs}=GF();function f9n(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(f9n,"responseURL");function dxs(t,e){if(!txs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&h9n(r)&&(p9n(r)||(r=fxs(r)),r=new URL(r,f9n(t))),r&&!r.hash&&(r.hash=e),r}a(dxs,"responseLocationURL");function p9n(t){for(let e=0;e126||r<32)return!1}return!0}a(p9n,"isValidEncodedURL");function fxs(t){return Buffer.from(t,"binary").toString("utf8")}a(fxs,"normalizeBinaryStringToUtf8");function TZ(t){return t.urlList[t.urlList.length-1]}a(TZ,"requestCurrentURL");function pxs(t){let e=TZ(t);return _9n(e)&&nxs.has(e.port)?"blocked":"allowed"}a(pxs,"requestBadPort");function hxs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(hxs,"isErrorLike");function mxs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(mxs,"isValidReasonPhrase");var gxs=d9n;function h9n(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(h9n,"isValidHeaderValue");function Axs(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(rxs.has(o)){r=o;break}}return r}a(Axs,"parseReferrerPolicy");function yxs(t,e){let r=Axs(e);r!==""&&(t.referrerPolicy=r)}a(yxs,"setRequestReferrerPolicyOnRedirect");function Exs(){return"allowed"}a(Exs,"crossOriginResourcePolicyCheck");function _xs(){return"success"}a(_xs,"corsCheck");function vxs(){return"success"}a(vxs,"TAOCheck");function Cxs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(Cxs,"appendFetchMetadata");function bxs(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&&Iir(t.origin)&&!Iir(TZ(t))&&(e=null);break;case"same-origin":_Pe(t,TZ(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(bxs,"appendRequestOriginHeader");function ipe(t,e){return t}a(ipe,"coarsenTime");function Sxs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??Tir(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=TZ(t);return SZ(n)&&!SZ(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=TZ(t);return _Pe(n,s)?n:SZ(n)&&!SZ(s)?"no-referrer":o}case"same-origin":return _Pe(t,n)?n:"no-referrer";case"origin-when-cross-origin":return _Pe(t,n)?n:o;case"no-referrer-when-downgrade":{let s=TZ(t);return SZ(n)&&!SZ(s)?"no-referrer":n}}}a(wxs,"determineRequestsReferrer");function Tir(t,e=!1){return vPe(Uj.is.URL(t)),t=new URL(t),E9n(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(Tir,"stripURLForReferrer");var Rxs=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)$/),kxs=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function g9n(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),kxs(t)):Rxs(t)}a(g9n,"isOriginIPPotentiallyTrustworthy");function Pxs(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||g9n(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(Pxs,"isOriginPotentiallyTrustworthy");function SZ(t){return Uj.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:Pxs(t.origin):!1}a(SZ,"isURLPotentiallyTrustworthy");function Dxs(t){}a(Dxs,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function _Pe(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(_Pe,"sameOrigin");function Nxs(t){return t.controller.state==="aborted"}a(Nxs,"isAborted");function Mxs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(Mxs,"isCancelled");function Oxs(t){return cxs[t.toLowerCase()]??t}a(Oxs,"normalizeMethod");var Lxs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function A9n(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,Lxs),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(A9n,"createIterator");function Bxs(t,e,r,n=0,o=1){let s=A9n(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Uj.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Uj.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Uj.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(Uj.brandCheck(this,e),Uj.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(Bxs,"iteratorMixin");function Fxs(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();y9n(s,n,o)}catch(s){o(s)}}a(Fxs,"fullyReadBody");function Uxs(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(Uxs,"readableStreamClose");async function y9n(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(!lxs(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(y9n,"readAllBytes");function E9n(t){vPe("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(E9n,"urlIsLocal");function Iir(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(Iir,"urlHasHttpsScheme");function _9n(t){vPe("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(_9n,"urlIsHttpHttpsScheme");function Qxs(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(Qxs,"simpleRangeHeaderValue");function qxs(t,e,r){let n="bytes ";return n+=Sir(`${t}`),n+="-",n+=Sir(`${e}`),n+="/",n+=Sir(`${r}`),n}a(qxs,"buildContentRange");var xir=class extends exs{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?l9n.createInflate(this.#e):l9n.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 jxs(t){return new xir(t)}a(jxs,"createInflate");function Hxs(t){let e=null,r=null,n=null,o=v9n("content-type",t);if(o===null)return"failure";for(let s of o){let c=oxs(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(Hxs,"extractMimeType");function Gxs(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(Gxs,"gettingDecodingSplitting");function v9n(t,e){let r=e.get(t,!0);return r===null?null:Gxs(r)}a(v9n,"getDecodeSplit");function $xs(t){return!1}a($xs,"hasAuthenticationEntry");function Vxs(t){return!!(t.username||t.password)}a(Vxs,"includesCredentials");function Wxs(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(Wxs,"isTraversableNavigable");var wir=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return u9n()}get origin(){return this.baseUrl?.origin}policyContainer=m9n()},Rir=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new wir},zxs=new Rir;C9n.exports={isAborted:Nxs,isCancelled:Mxs,isValidEncodedURL:p9n,ReadableStreamFrom:axs,tryUpgradeRequestToAPotentiallyTrustworthyURL:Dxs,clampAndCoarsenConnectionTimingInfo:Sxs,coarsenedSharedCurrentTime:Txs,determineRequestsReferrer:wxs,makePolicyContainer:m9n,clonePolicyContainer:xxs,appendFetchMetadata:Cxs,appendRequestOriginHeader:bxs,TAOCheck:vxs,corsCheck:_xs,crossOriginResourcePolicyCheck:Exs,createOpaqueTimingInfo:Ixs,setRequestReferrerPolicyOnRedirect:yxs,isValidHTTPToken:d9n,requestBadPort:pxs,requestCurrentURL:TZ,responseURL:f9n,responseLocationURL:dxs,isURLPotentiallyTrustworthy:SZ,isValidReasonPhrase:mxs,sameOrigin:_Pe,normalizeMethod:Oxs,iteratorMixin:Bxs,createIterator:A9n,isValidHeaderName:gxs,isValidHeaderValue:h9n,isErrorLike:hxs,fullyReadBody:Fxs,readableStreamClose:Uxs,urlIsLocal:E9n,urlHasHttpsScheme:Iir,urlIsHttpHttpsScheme:_9n,readAllBytes:y9n,simpleRangeHeaderValue:Qxs,buildContentRange:qxs,createInflate:jxs,extractMimeType:Hxs,getDecodeSplit:v9n,environmentSettingsObject:zxs,isOriginIPPotentiallyTrustworthy:g9n,hasAuthenticationEntry:$xs,includesCredentials:Vxs,isTraversableNavigable:Wxs}});var Dot=I((Jsf,S9n)=>{"use strict";p();var{iteratorMixin:Yxs}=ET(),{kEnumerableProperty:ope}=Po(),{webidl:Rc}=$A(),b9n=require("node:util"),VF=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(Rc.util.markAsUncloneable(this),e!==void 0)throw Rc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){Rc.brandCheck(this,t);let o="FormData.append";Rc.argumentLengthCheck(arguments,2,o),e=Rc.converters.USVString(e),arguments.length===3||Rc.is.Blob(r)?(r=Rc.converters.Blob(r,o,"value"),n!==void 0&&(n=Rc.converters.USVString(n))):r=Rc.converters.USVString(r);let s=kir(e,r,n);this.#e.push(s)}delete(e){Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.delete"),e=Rc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.get"),e=Rc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=Rc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.has"),e=Rc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Rc.brandCheck(this,t);let o="FormData.set";Rc.argumentLengthCheck(arguments,2,o),e=Rc.converters.USVString(e),arguments.length===3||Rc.is.Blob(r)?(r=Rc.converters.Blob(r,o,"value"),n!==void 0&&(n=Rc.converters.USVString(n))):r=Rc.converters.USVString(r);let s=kir(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)}[b9n.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=b9n.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:Kxs,setFormDataState:Jxs}=VF;Reflect.deleteProperty(VF,"getFormDataState");Reflect.deleteProperty(VF,"setFormDataState");Yxs("FormData",VF,Kxs,"name","value");Object.defineProperties(VF.prototype,{append:ope,delete:ope,get:ope,getAll:ope,has:ope,set:ope,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function kir(t,e,r){if(typeof e!="string"){if(Rc.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(kir,"makeEntry");Rc.is.FormData=Rc.util.MakeTypeAssertion(VF);S9n.exports={FormData:VF,makeEntry:kir,setFormDataState:Jxs}});var x9n=I((eaf,I9n)=>{"use strict";p();var{bufferToLowerCasedHeaderName:Zxs}=Po(),{HTTP_TOKEN_CODEPOINTS:Xxs}=Mw(),{makeEntry:ews}=Dot(),{webidl:Pir}=$A(),Dir=require("node:assert"),{isomorphicDecode:T9n}=GF(),tws=Buffer.from("--"),Nir=new TextDecoder,rws=new TextDecoder("utf-8",{ignoreBOM:!0});function nws(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(iws,"validateBoundary");function ows(t,e){Dir(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw pb("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw pb("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 pb("expected a value starting with -- and the boundary");if(cws(t,tws,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw pb("expected CRLF");s.position+=2;let l=aws(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 pb("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 pb("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",nws(f)||(f=""),g=new File([m],d,{type:f})):g=rws.decode(Buffer.from(m)),Dir(Pir.is.USVString(u)),Dir(typeof g=="string"&&Pir.is.USVString(g)||Pir.is.File(g)),o.push(ews(u,g,d))}}a(ows,"multipartFormDataParser");function sws(t,e){t[e.position]===59&&e.position++,Ow(c=>c===32||c===9,t,e);let r=Ow(c=>Oir(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++,Ow(c=>c===32||c===9,t,e);let s;if(o){let c=Ow(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 pb("unknown encoding, expected utf-8''");s=decodeURIComponent(Nir.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=Ow(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw pb("Closing quote not found");e.position++,s=Nir.decode(c).replace(/%0A/ig,` -`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=Ow(l=>Oir(l)&&l!==59,t,e);s=Nir.decode(c)}return{name:n,value:s,extended:o}}a(sws,"parseContentDispositionAttribute");function aws(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 pb("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=Ow(l=>l!==10&&l!==13&&l!==58,t,e);if(c=Mir(c,!0,!0,l=>l===9||l===32),!Xxs.test(c.toString()))throw pb("header name does not match the field-name token production");if(t[e.position]!==58)throw pb("expected :");switch(e.position++,Ow(l=>l===32||l===9,t,e),Zxs(c)){case"content-disposition":{r=n=null;let l=!1;if(Ow(d=>Oir(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw pb("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=Mir(l,!1,!0,u=>u===9||u===32),o=T9n(l);break}case"content-transfer-encoding":{let l=Ow(u=>u!==10&&u!==13,t,e);l=Mir(l,!1,!0,u=>u===9||u===32),s=T9n(l);break}default:Ow(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw pb("expected CRLF");e.position+=2}}a(aws,"parseMultipartFormDataHeaders");function Ow(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(Mir,"removeChars");function cws(t,e,r){if(t.length{"use strict";p();function dws(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(dws,"createDeferredPromise");w9n.exports={createDeferredPromise:dws}});var ape=I((saf,N9n)=>{"use strict";p();var Fir=Po(),{ReadableStreamFrom:fws,readableStreamClose:pws,fullyReadBody:hws,extractMimeType:mws}=ET(),{FormData:R9n,setFormDataState:gws}=Dot(),{webidl:b2}=$A(),Lir=require("node:assert"),{isErrored:Bir,isDisturbed:Aws}=require("node:stream"),{isUint8Array:yws}=require("node:util/types"),{serializeAMimeType:Ews}=Mw(),{multipartFormDataParser:_ws}=x9n(),{createDeferredPromise:vws}=CPe(),{parseJSONFromBytes:Cws}=GF(),{utf8DecodeBytes:bws}=Iot(),{runtimeFeatures:Sws}=$F(),Tws=Sws.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),Not=new TextEncoder;function Iws(){}a(Iws,"noop");var xws=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!Aws(e)&&!Bir(e)&&e.cancel("Response object has been garbage collected").catch(Iws)});function P9n(t,e=!1){let r=null,n=null;b2.is.ReadableStream(t)?r=t:b2.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),Lir(b2.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(b2.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(b2.is.BufferSource(t))s=b2.util.getCopyOfBytesHeldByBufferSource(t);else if(b2.is.FormData(t)){let d=`----formdata-undici-0${`${Tws(1e11)}`.padStart(11,"0")}`,f=`--${d}\r +`,s};uot.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=cm.util.createBuffer();return Xfe(n,r),w5(n,t.e),w5(n,t.n),r+" "+cm.util.encode64(n.bytes())+" "+e};uot.privateKeyToOpenSSH=function(t,e){return e?cm.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):cm.pki.privateKeyToPem(t)};uot.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||cm.md.md5.create(),n="ssh-rsa",o=cm.util.createBuffer();Xfe(o,n),w5(o,t.e),w5(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 w5(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=cm.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(w5,"_addBigIntegerToBuffer");function Xfe(t,e){t.putInt32(e.length),t.putString(e)}a(Xfe,"_addStringToBuffer");function lot(){for(var t=cm.md.sha1.create(),e=arguments.length,r=0;r{p();WFn.exports=As();Ij();pFn();C2();Mit();Xke();PFn();qfe();OFn();UFn();qFn();Rrr();$it();uZ();brr();Drr();GFn();Mrr();Trr();mrr();Zit();ww();yrr();VFn();Qrr();ac()});var JFn=I(yZ=>{"use strict";p();Object.defineProperty(yZ,"__esModule",{value:!0});yZ.convert=yZ.Format=void 0;var dPe=zFn(),Oj;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(Oj=yZ.Format||(yZ.Format={}));function YFn(t){var e=dPe.pki.pemToDer(t),r=dPe.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(YFn,"myASN");function PSs(t){var e=YFn(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(PSs,"txtFormat");function KFn(t,e){switch(e){case Oj.der:return dPe.pki.pemToDer(t);case Oj.pem:return t;case Oj.txt:return PSs(t);case Oj.asn1:return YFn(t);case Oj.fingerprint:var r=dPe.md.sha1.create(),n=KFn(t,Oj.der);return r.update(n.getBytes()),r.digest().toHex();case Oj.x509:return dPe.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(KFn,"convert");yZ.convert=KFn});var n8n=I(db=>{"use strict";p();var Lj=db&&db.__assign||function(){return Lj=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})(nnr.Agent),(0,XFn.setGlobalDispatcher)(new XFn.Agent({connect:{ca:e}}))}},"addToGlobalAgent");db.addToGlobalAgent=NSs});var i8n=I((Pof,inr)=>{p();function MSs(){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(MSs,"all");process.platform!=="win32"?inr.exports.all=()=>[]:inr.exports.all=MSs});var al=I((Fof,u8n)=>{"use strict";p();u8n.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 Enr=I((Qof,h8n)=>{"use strict";p();var tpe=0,pnr=1e3,hnr=(pnr>>1)-1,Bj,mnr=Symbol("kFastTimer"),GF=[],gnr=-2,Anr=-1,f8n=0,d8n=1;function ynr(){tpe+=hnr;let t=0,e=GF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=Anr,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===Anr?(r._state=gnr,--e!==0&&(GF[t]=GF[e])):++t}GF.length=e,GF.length!==0&&p8n()}a(ynr,"onTick");function p8n(){Bj?.refresh?Bj.refresh():(clearTimeout(Bj),Bj=setTimeout(ynr,hnr),Bj?.unref())}a(p8n,"refreshTimeout");var got=class{static{a(this,"FastTimer")}[mnr]=!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&&GF.push(this),(!Bj||GF.length===1)&&p8n(),this._state=f8n}clear(){this._state=Anr,this._idleStart=-1}};h8n.exports={setTimeout(t,e,r){return e<=pnr?setTimeout(t,e,r):new got(t,e,r)},clearTimeout(t){t[mnr]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new got(t,e,r)},clearFastTimeout(t){t.clear()},now(){return tpe},tick(t=0){tpe+=t-pnr+1,ynr(),ynr()},reset(){tpe=0,GF.length=0,clearTimeout(Bj),Bj=null},kFastTimer:mnr}});var ao=I((Hof,U8n)=>{"use strict";p();var m8n=Symbol.for("undici.error.UND_ERR"),ld=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[m8n]===!0}get[m8n](){return!0}},g8n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),_nr=class extends ld{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[g8n]===!0}get[g8n](){return!0}},A8n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),vnr=class extends ld{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[A8n]===!0}get[A8n](){return!0}},y8n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),Cnr=class extends ld{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[y8n]===!0}get[y8n](){return!0}},E8n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),bnr=class extends ld{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[E8n]===!0}get[E8n](){return!0}},_8n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),Snr=class extends ld{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[_8n]===!0}get[_8n](){return!0}},v8n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),Tnr=class extends ld{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[v8n]===!0}get[v8n](){return!0}},C8n=Symbol.for("undici.error.UND_ERR_ABORT"),Aot=class extends ld{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[C8n]===!0}get[C8n](){return!0}},b8n=Symbol.for("undici.error.UND_ERR_ABORTED"),Inr=class extends Aot{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[b8n]===!0}get[b8n](){return!0}},S8n=Symbol.for("undici.error.UND_ERR_INFO"),xnr=class extends ld{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[S8n]===!0}get[S8n](){return!0}},T8n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),wnr=class extends ld{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[T8n]===!0}get[T8n](){return!0}},I8n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),Rnr=class extends ld{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[I8n]===!0}get[I8n](){return!0}},x8n=Symbol.for("undici.error.UND_ERR_DESTROYED"),knr=class extends ld{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[x8n]===!0}get[x8n](){return!0}},w8n=Symbol.for("undici.error.UND_ERR_CLOSED"),Pnr=class extends ld{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[w8n]===!0}get[w8n](){return!0}},R8n=Symbol.for("undici.error.UND_ERR_SOCKET"),Dnr=class extends ld{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[R8n]===!0}get[R8n](){return!0}},k8n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Nnr=class extends ld{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[k8n]===!0}get[k8n](){return!0}},P8n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),Mnr=class extends ld{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[P8n]===!0}get[P8n](){return!0}},D8n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Onr=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[D8n]===!0}get[D8n](){return!0}},N8n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),Lnr=class extends ld{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[N8n]===!0}get[N8n](){return!0}},M8n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),Bnr=class extends ld{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[M8n]===!0}get[M8n](){return!0}},O8n=Symbol.for("undici.error.UND_ERR_RESPONSE"),Fnr=class extends ld{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[O8n]===!0}get[O8n](){return!0}},L8n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),Unr=class extends ld{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[L8n]===!0}get[L8n](){return!0}},B8n=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),Qnr=class extends ld{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[B8n]===!0}get[B8n](){return!0}},qnr=class extends ld{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},F8n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),jnr=class extends ld{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[F8n]===!0}get[F8n](){return!0}};U8n.exports={AbortError:Aot,HTTPParserError:Onr,UndiciError:ld,HeadersTimeoutError:vnr,HeadersOverflowError:Cnr,BodyTimeoutError:bnr,RequestContentLengthMismatchError:wnr,ConnectTimeoutError:_nr,InvalidArgumentError:Snr,InvalidReturnValueError:Tnr,RequestAbortedError:Inr,ClientDestroyedError:knr,ClientClosedError:Pnr,InformationalError:xnr,SocketError:Dnr,NotSupportedError:Nnr,ResponseContentLengthMismatchError:Rnr,BalancedPoolMissingUpstreamError:Mnr,ResponseExceededMaxSizeError:Lnr,RequestRetryError:Bnr,ResponseError:Fnr,SecureProxyConnectionError:Unr,MaxOriginsReachedError:Qnr,Socks5ProxyError:qnr,MessageSizeExceededError:jnr}});var Eot=I((Vof,q8n)=>{"use strict";p();var Hnr=["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"],yot={};Object.setPrototypeOf(yot,null);var Q8n={};Object.setPrototypeOf(Q8n,null);function LSs(t){let e=Q8n[t];return e===void 0&&(e=Buffer.from(t)),e}a(LSs,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:j8n,headerNameLowerCasedRecord:BSs}=Eot(),Gnr=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 fPe=require("node:assert"),{kDestroyed:Y8n,kBodyUsed:rpe,kListeners:Cot,kBody:V8n}=al(),{IncomingMessage:FSs}=require("node:http"),K8n=require("node:stream"),USs=require("node:net"),{stringify:QSs}=require("node:querystring"),{EventEmitter:qSs}=require("node:events"),vot=Enr(),{InvalidArgumentError:Ng,ConnectTimeoutError:jSs}=ao(),{headerNameLowerCasedRecord:HSs}=Eot(),{tree:J8n}=$8n(),[GSs,$Ss]=process.versions.node.split(".",2).map(t=>Number(t)),Sot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[V8n]=e,this[rpe]=!1}async*[Symbol.asyncIterator](){fPe(!this[rpe],"disturbed"),this[rpe]=!0,yield*this[V8n]}};function W8n(){}a(W8n,"noop");function VSs(t){return Tot(t)?(n6n(t)===0&&t.on("data",function(){fPe(!1)}),typeof t.readableDidRead!="boolean"&&(t[rpe]=!1,qSs.prototype.on.call(t,"data",function(){this[rpe]=!0})),t):t&&typeof t.pipeTo=="function"?new Sot(t):t&&c6n(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&r6n(t)?new Sot(t):t}a(VSs,"wrapRequestBody");function Tot(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Tot,"isStream");function Z8n(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(Z8n,"isBlobLike");function X8n(t){return t.includes("?")||t.includes("#")}a(X8n,"pathHasQueryOrFragment");function WSs(t,e){if(X8n(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=QSs(e);return r&&(t+="?"+r),t}a(WSs,"serializePathWithQuery");function e6n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(e6n,"isValidPort");function bot(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(bot,"isHttpOrHttpsPrefixed");function t6n(t){if(typeof t=="string"){if(t=new URL(t),!bot(t.origin||t.protocol))throw new Ng("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new Ng("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&e6n(t.port)===!1)throw new Ng("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 Ng("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new Ng("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new Ng("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new Ng("Invalid URL origin: the origin must be a string or null/undefined.");if(!bot(t.origin||t.protocol))throw new Ng("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(!bot(t.origin||t.protocol))throw new Ng("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(t6n,"parseURL");function zSs(t){if(t=t6n(t),t.pathname!=="/"||t.search||t.hash)throw new Ng("invalid url");return t}a(zSs,"parseOrigin");function YSs(t){if(t[0]==="["){let r=t.indexOf("]");return fPe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(YSs,"getHostname");function KSs(t){if(!t)return null;fPe(typeof t=="string");let e=YSs(t);return USs.isIP(e)?"":e}a(KSs,"getServerName");function JSs(t){return JSON.parse(JSON.stringify(t))}a(JSs,"deepClone");function ZSs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(ZSs,"isAsyncIterable");function r6n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(r6n,"isIterable");function XSs(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(XSs,"hasSafeIterator");function n6n(t){if(t==null)return 0;if(Tot(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(Z8n(t))return t.size!=null?t.size:null;if(a6n(t))return t.byteLength}return null}a(n6n,"bodyLength");function i6n(t){return t&&!!(t.destroyed||t[Y8n]||K8n.isDestroyed?.(t))}a(i6n,"isDestroyed");function o6n(t,e){t==null||!Tot(t)||i6n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===FSs&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[Y8n]=!0))}a(o6n,"destroy");var eTs=/timeout=(\d+)/;function tTs(t){let e=t.match(eTs);return e?parseInt(e[1],10)*1e3:null}a(tTs,"parseKeepAliveTimeout");function s6n(t){return typeof t=="string"?HSs[t]??t.toLowerCase():J8n.lookup(t)??t.toString("latin1").toLowerCase()}a(s6n,"headerNameToString");function rTs(t){return J8n.lookup(t)??t.toString("latin1").toLowerCase()}a(rTs,"bufferToLowerCasedHeaderName");function nTs(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(nTs,"parseHeaders");function iTs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(oTs,"encodeRawHeaders");function a6n(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(a6n,"isBuffer");function sTs(t,e,r){if(!t||typeof t!="object")throw new Ng("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new Ng("invalid onConnect method");if(typeof t.onError!="function")throw new Ng("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new Ng("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new Ng("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new Ng("invalid onHeaders method");if(typeof t.onData!="function")throw new Ng("invalid onData method");if(typeof t.onComplete!="function")throw new Ng("invalid onComplete method")}}}a(sTs,"assertRequestHandler");function aTs(t){return!!(t&&(K8n.isDisturbed(t)||t[rpe]))}a(aTs,"isDisturbed");function cTs(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(cTs,"getSocketInfo");function lTs(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(lTs,"ReadableStreamFrom");function c6n(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(c6n,"isFormDataLike");function uTs(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(uTs,"addAbortListener");var l6n=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 dTs(t){return l6n[t]===1}a(dTs,"isTokenCharCode");var fTs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function pTs(t){if(t.length>=12)return fTs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return W8n;let r=null,n=null,o=vot.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>z8n(t.deref(),e))})},e.timeout);return()=>{vot.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return W8n;let r=null,n=vot.setFastTimeout(()=>{r=setImmediate(()=>{z8n(t.deref(),e)})},e.timeout);return()=>{vot.clearFastTimeout(n),clearImmediate(r)}};function z8n(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)`,o6n(t,new jSs(r))}a(z8n,"onConnectTimeout");function CTs(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(CTs,"getProtocolFromUrlString");var u6n=Object.create(null);u6n.enumerable=!0;var $nr={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},d6n={...$nr,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf($nr,null);Object.setPrototypeOf(d6n,null);f6n.exports={kEnumerableProperty:u6n,isDisturbed:aTs,isBlobLike:Z8n,parseOrigin:zSs,parseURL:t6n,getServerName:KSs,isStream:Tot,isIterable:r6n,hasSafeIterator:XSs,isAsyncIterable:ZSs,isDestroyed:i6n,headerNameToString:s6n,bufferToLowerCasedHeaderName:rTs,addListener:yTs,removeAllListeners:ETs,errorRequest:_Ts,parseRawHeaders:iTs,encodeRawHeaders:oTs,parseHeaders:nTs,parseKeepAliveTimeout:tTs,destroy:o6n,bodyLength:n6n,deepClone:JSs,ReadableStreamFrom:lTs,isBuffer:a6n,assertRequestHandler:sTs,getSocketInfo:cTs,isFormDataLike:c6n,pathHasQueryOrFragment:X8n,serializePathWithQuery:WSs,addAbortListener:uTs,isValidHTTPToken:pTs,isValidHeaderValue:mTs,isTokenCharCode:dTs,parseRangeHeader:ATs,normalizedMethodRecordsBase:$nr,normalizedMethodRecords:d6n,isValidPort:e6n,isHttpOrHttpsPrefixed:bot,nodeMajor:GSs,nodeMinor:$Ss,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:VSs,setupConnectTimeout:vTs,getProtocolFromUrlString:CTs}});var znr=I((tsf,A6n)=>{"use strict";p();var{kConnected:p6n,kPending:h6n,kRunning:m6n,kSize:g6n,kFree:bTs,kQueued:STs}=al(),Vnr=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[p6n],this.pending=e[h6n],this.running=e[m6n],this.size=e[g6n]}},Wnr=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[p6n],this.free=e[bTs],this.pending=e[h6n],this.queued=e[STs],this.running=e[m6n],this.size=e[g6n]}};A6n.exports={ClientStats:Vnr,PoolStats:Wnr}});var Fj=I((isf,E6n)=>{"use strict";p();var cl=require("node:diagnostics_channel"),Znr=require("node:util"),EZ=Znr.debuglog("undici"),pPe=Znr.debuglog("fetch"),Iot=Znr.debuglog("websocket"),ET={beforeConnect:cl.channel("undici:client:beforeConnect"),connected:cl.channel("undici:client:connected"),connectError:cl.channel("undici:client:connectError"),sendHeaders:cl.channel("undici:client:sendHeaders"),create:cl.channel("undici:request:create"),bodySent:cl.channel("undici:request:bodySent"),bodyChunkSent:cl.channel("undici:request:bodyChunkSent"),bodyChunkReceived:cl.channel("undici:request:bodyChunkReceived"),headers:cl.channel("undici:request:headers"),trailers:cl.channel("undici:request:trailers"),error:cl.channel("undici:request:error"),open:cl.channel("undici:websocket:open"),close:cl.channel("undici:websocket:close"),socketError:cl.channel("undici:websocket:socket_error"),ping:cl.channel("undici:websocket:ping"),pong:cl.channel("undici:websocket:pong"),proxyConnected:cl.channel("undici:proxy:connected")},Ynr=!1;function y6n(t=EZ){if(!Ynr){if(ET.beforeConnect.hasSubscribers||ET.connected.hasSubscribers||ET.connectError.hasSubscribers||ET.sendHeaders.hasSubscribers){Ynr=!0;return}Ynr=!0,cl.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)}),cl.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)}),cl.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)}),cl.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(y6n,"trackClientEvents");var Knr=!1;function TTs(t=EZ){if(!Knr){if(ET.headers.hasSubscribers||ET.trailers.hasSubscribers||ET.error.hasSubscribers){Knr=!0;return}Knr=!0,cl.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)}),cl.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),cl.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(TTs,"trackRequestEvents");var Jnr=!1;function ITs(t=Iot){if(!Jnr){if(ET.open.hasSubscribers||ET.close.hasSubscribers||ET.socketError.hasSubscribers||ET.ping.hasSubscribers||ET.pong.hasSubscribers){Jnr=!0;return}Jnr=!0,cl.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")}),cl.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),cl.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),cl.subscribe("undici:websocket:ping",e=>{t("ping received")}),cl.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(ITs,"trackWebSocketEvents");(EZ.enabled||pPe.enabled)&&(y6n(pPe.enabled?pPe:EZ),TTs(pPe.enabled?pPe:EZ));Iot.enabled&&(y6n(EZ.enabled?EZ:Iot),ITs(Iot));E6n.exports={channels:ET}});var C6n=I((asf,v6n)=>{"use strict";p();var{InvalidArgumentError:Qc,NotSupportedError:xTs}=ao(),R5=require("node:assert"),{isValidHTTPToken:Xnr,isValidHeaderValue:eir,isStream:wTs,destroy:RTs,isBuffer:kTs,isFormDataLike:PTs,isIterable:DTs,hasSafeIterator:NTs,isBlobLike:MTs,serializePathWithQuery:OTs,assertRequestHandler:LTs,getServerName:BTs,normalizedMethodRecords:FTs,getProtocolFromUrlString:UTs}=Do(),{channels:fb}=Fj(),{headerNameLowerCasedRecord:_6n}=Eot(),QTs=/[^\u0021-\u00ff]/;function qTs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a(qTs,"isValidContentLengthHeaderValue");var Mw=Symbol("handler"),tir=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:E,typeOfService:_},v){if(typeof r!="string")throw new Qc("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Qc("path must be an absolute URL or start with a slash");if(QTs.test(r))throw new Qc("invalid request path");if(typeof n!="string")throw new Qc("method must be a string");if(FTs[n]===void 0&&!Xnr(n))throw new Qc("invalid request method");if(d&&typeof d!="string")throw new Qc("upgrade must be a string");if(d&&!eir(d))throw new Qc("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Qc("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Qc("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Qc("invalid reset");if(g!=null&&typeof g!="boolean")throw new Qc("invalid expectContinue");if(y!=null)throw new Qc("invalid throwOnError");if(E!=null&&E!==0)throw new Qc("maxRedirections is not supported, use the redirect interceptor");if(_!=null&&(!Number.isInteger(_)||_<0||_>255))throw new Qc("typeOfService must be an integer between 0 and 255");if(this.headersTimeout=f,this.bodyTimeout=h,this.method=n,this.typeOfService=_??0,this.abort=null,o==null)this.body=null;else if(wTs(o)){this.body=o;let b=this.body._readableState;(!b||!b.autoDestroy)&&(this.endHandler=a(function(){RTs(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(kTs(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(PTs(o)||DTs(o)||MTs(o))this.body=o;else throw new Qc("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?OTs(r,c):r,this.origin=e,this.protocol=UTs(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 Qc("headers array must be even");for(let b=0;b{"use strict";p();var{InvalidArgumentError:jTs}=ao();S6n.exports=class b6n{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new b6n(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"),rir(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"),rir(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"),rir(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new jTs("invalid onError method");this.#e.onError?.(r)}};function rir(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(rir,"toRawHeaderValue")});var mPe=I((psf,T6n)=>{"use strict";p();var HTs=require("node:events"),GTs=hPe(),$Ts=a(t=>(e,r)=>t(e,GTs.wrap(r)),"wrapInterceptor"),nir=class extends HTs{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=$Ts(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")})}};T6n.exports=nir});var w6n=I((gsf,x6n)=>{"use strict";p();var{parseHeaders:iir}=Do(),{InvalidArgumentError:VTs}=ao(),oir=Symbol("resume"),sir=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[oir]=null;rawHeaders=null;rawTrailers=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[oir]?.())}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}};x6n.exports=class I6n{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new I6n(e):e}onConnect(e,r){this.#t=new sir(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,iir(r),n)}onHeaders(e,r,n,o){return this.#t[oir]=n,this.#t.rawHeaders=r,this.#e.onResponseStart?.(this.#t,e,iir(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,iir(e))}onError(e){if(!this.#e.onResponseError)throw new VTs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var vZ=I((Esf,R6n)=>{"use strict";p();var WTs=mPe(),zTs=w6n(),{ClientDestroyedError:air,ClientClosedError:YTs,InvalidArgumentError:wot}=ao(),{kDestroy:KTs,kClose:JTs,kClosed:gPe,kDestroyed:npe,kDispatch:ZTs}=al(),Uj=Symbol("onDestroyed"),_Z=Symbol("onClosed"),cir=Symbol("webSocketOptions"),lir=class extends WTs{static{a(this,"DispatcherBase")}[npe]=!1;[Uj]=null;[gPe]=!1;[_Z]=null;constructor(e){super(),this[cir]=e?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[cir].maxFragments??131072,maxPayloadSize:this[cir].maxPayloadSize??128*1024*1024}}get destroyed(){return this[npe]}get closed(){return this[gPe]}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 wot("invalid callback");if(this[npe]){let n=new air;queueMicrotask(()=>e(n,null));return}if(this[gPe]){this[_Z]?this[_Z].push(e):queueMicrotask(()=>e(null,null));return}this[gPe]=!0,this[_Z]??=[],this[_Z].push(e);let r=a(()=>{let n=this[_Z];this[_Z]=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 wot("invalid callback");if(this[npe]){this[Uj]?this[Uj].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new air),this[npe]=!0,this[Uj]??=[],this[Uj].push(r);let n=a(()=>{let o=this[Uj];this[Uj]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new wot("handler must be an object");r=zTs.unwrap(r);try{if(!e||typeof e!="object")throw new wot("opts must be an object.");if(this[npe]||this[Uj])throw new air;if(this[gPe])throw new YTs;return this[ZTs](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};R6n.exports=lir});var CZ=I((bsf,D6n)=>{"use strict";p();var XTs=require("node:net"),k6n=require("node:assert"),P6n=Do(),{InvalidArgumentError:eIs}=ao(),uir,tIs=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 rIs({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new eIs("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new tIs(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:"){uir||(uir=require("node:tls")),A=A||l.servername||P6n.getServerName(h)||null;let T=A||f;k6n(T);let w=s||u.get(T)||null;g=g||443,v=uir.connect({highWaterMark:16384,...l,servername:A,session:w,localAddress:y,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:E,port:g,host:f}),v.on("session",function(R){u.set(T,R)})}else k6n(!E,"httpSocket can only be sent on TLS update"),g=g||80,v=XTs.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 b=P6n.setupConnectTimeout(new WeakRef(v),{timeout:o,hostname:f,port:g});return v.setNoDelay(!0).once(m==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(b),_){let T=_;_=null,T(null,this)}}).on("error",function(T){if(queueMicrotask(b),_){let w=_;_=null,w(T)}}),v},"connect")}a(rIs,"buildConnector");D6n.exports=rIs});var N6n=I(dir=>{"use strict";p();Object.defineProperty(dir,"__esModule",{value:!0});dir.enumToMap=nIs;function nIs(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(nIs,"enumToMap")});var M6n=I(je=>{"use strict";p();Object.defineProperty(je,"__esModule",{value:!0});je.SPECIAL_HEADERS=je.MINOR=je.MAJOR=je.HTAB_SP_VCHAR_OBS_TEXT=je.QUOTED_STRING=je.CONNECTION_TOKEN_CHARS=je.HEADER_CHARS=je.TOKEN=je.HEX=je.URL_CHAR=je.USERINFO_CHARS=je.MARK=je.ALPHANUM=je.NUM=je.HEX_MAP=je.NUM_MAP=je.ALPHA=je.STATUSES_HTTP=je.H_METHOD_MAP=je.METHOD_MAP=je.METHODS_RTSP=je.METHODS_ICE=je.METHODS_HTTP=je.HEADER_STATE=je.FINISH=je.STATUSES=je.METHODS=je.LENIENT_FLAGS=je.FLAGS=je.TYPE=je.ERROR=void 0;var iIs=N6n();je.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};je.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};je.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};je.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};je.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};je.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};je.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};je.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};je.METHODS_HTTP=[je.METHODS.DELETE,je.METHODS.GET,je.METHODS.HEAD,je.METHODS.POST,je.METHODS.PUT,je.METHODS.CONNECT,je.METHODS.OPTIONS,je.METHODS.TRACE,je.METHODS.COPY,je.METHODS.LOCK,je.METHODS.MKCOL,je.METHODS.MOVE,je.METHODS.PROPFIND,je.METHODS.PROPPATCH,je.METHODS.SEARCH,je.METHODS.UNLOCK,je.METHODS.BIND,je.METHODS.REBIND,je.METHODS.UNBIND,je.METHODS.ACL,je.METHODS.REPORT,je.METHODS.MKACTIVITY,je.METHODS.CHECKOUT,je.METHODS.MERGE,je.METHODS["M-SEARCH"],je.METHODS.NOTIFY,je.METHODS.SUBSCRIBE,je.METHODS.UNSUBSCRIBE,je.METHODS.PATCH,je.METHODS.PURGE,je.METHODS.MKCALENDAR,je.METHODS.LINK,je.METHODS.UNLINK,je.METHODS.PRI,je.METHODS.SOURCE,je.METHODS.QUERY];je.METHODS_ICE=[je.METHODS.SOURCE];je.METHODS_RTSP=[je.METHODS.OPTIONS,je.METHODS.DESCRIBE,je.METHODS.ANNOUNCE,je.METHODS.SETUP,je.METHODS.PLAY,je.METHODS.PAUSE,je.METHODS.TEARDOWN,je.METHODS.GET_PARAMETER,je.METHODS.SET_PARAMETER,je.METHODS.REDIRECT,je.METHODS.RECORD,je.METHODS.FLUSH,je.METHODS.GET,je.METHODS.POST];je.METHOD_MAP=(0,iIs.enumToMap)(je.METHODS);je.H_METHOD_MAP=Object.fromEntries(Object.entries(je.METHODS).filter(([t])=>t.startsWith("H")));je.STATUSES_HTTP=[je.STATUSES.CONTINUE,je.STATUSES.SWITCHING_PROTOCOLS,je.STATUSES.PROCESSING,je.STATUSES.EARLY_HINTS,je.STATUSES.RESPONSE_IS_STALE,je.STATUSES.REVALIDATION_FAILED,je.STATUSES.DISCONNECTED_OPERATION,je.STATUSES.HEURISTIC_EXPIRATION,je.STATUSES.MISCELLANEOUS_WARNING,je.STATUSES.OK,je.STATUSES.CREATED,je.STATUSES.ACCEPTED,je.STATUSES.NON_AUTHORITATIVE_INFORMATION,je.STATUSES.NO_CONTENT,je.STATUSES.RESET_CONTENT,je.STATUSES.PARTIAL_CONTENT,je.STATUSES.MULTI_STATUS,je.STATUSES.ALREADY_REPORTED,je.STATUSES.TRANSFORMATION_APPLIED,je.STATUSES.IM_USED,je.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,je.STATUSES.MULTIPLE_CHOICES,je.STATUSES.MOVED_PERMANENTLY,je.STATUSES.FOUND,je.STATUSES.SEE_OTHER,je.STATUSES.NOT_MODIFIED,je.STATUSES.USE_PROXY,je.STATUSES.SWITCH_PROXY,je.STATUSES.TEMPORARY_REDIRECT,je.STATUSES.PERMANENT_REDIRECT,je.STATUSES.BAD_REQUEST,je.STATUSES.UNAUTHORIZED,je.STATUSES.PAYMENT_REQUIRED,je.STATUSES.FORBIDDEN,je.STATUSES.NOT_FOUND,je.STATUSES.METHOD_NOT_ALLOWED,je.STATUSES.NOT_ACCEPTABLE,je.STATUSES.PROXY_AUTHENTICATION_REQUIRED,je.STATUSES.REQUEST_TIMEOUT,je.STATUSES.CONFLICT,je.STATUSES.GONE,je.STATUSES.LENGTH_REQUIRED,je.STATUSES.PRECONDITION_FAILED,je.STATUSES.PAYLOAD_TOO_LARGE,je.STATUSES.URI_TOO_LONG,je.STATUSES.UNSUPPORTED_MEDIA_TYPE,je.STATUSES.RANGE_NOT_SATISFIABLE,je.STATUSES.EXPECTATION_FAILED,je.STATUSES.IM_A_TEAPOT,je.STATUSES.PAGE_EXPIRED,je.STATUSES.ENHANCE_YOUR_CALM,je.STATUSES.MISDIRECTED_REQUEST,je.STATUSES.UNPROCESSABLE_ENTITY,je.STATUSES.LOCKED,je.STATUSES.FAILED_DEPENDENCY,je.STATUSES.TOO_EARLY,je.STATUSES.UPGRADE_REQUIRED,je.STATUSES.PRECONDITION_REQUIRED,je.STATUSES.TOO_MANY_REQUESTS,je.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,je.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,je.STATUSES.LOGIN_TIMEOUT,je.STATUSES.NO_RESPONSE,je.STATUSES.RETRY_WITH,je.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,je.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,je.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,je.STATUSES.INVALID_X_FORWARDED_FOR,je.STATUSES.REQUEST_HEADER_TOO_LARGE,je.STATUSES.SSL_CERTIFICATE_ERROR,je.STATUSES.SSL_CERTIFICATE_REQUIRED,je.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,je.STATUSES.INVALID_TOKEN,je.STATUSES.CLIENT_CLOSED_REQUEST,je.STATUSES.INTERNAL_SERVER_ERROR,je.STATUSES.NOT_IMPLEMENTED,je.STATUSES.BAD_GATEWAY,je.STATUSES.SERVICE_UNAVAILABLE,je.STATUSES.GATEWAY_TIMEOUT,je.STATUSES.HTTP_VERSION_NOT_SUPPORTED,je.STATUSES.VARIANT_ALSO_NEGOTIATES,je.STATUSES.INSUFFICIENT_STORAGE,je.STATUSES.LOOP_DETECTED,je.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,je.STATUSES.NOT_EXTENDED,je.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,je.STATUSES.WEB_SERVER_UNKNOWN_ERROR,je.STATUSES.WEB_SERVER_IS_DOWN,je.STATUSES.CONNECTION_TIMEOUT,je.STATUSES.ORIGIN_IS_UNREACHABLE,je.STATUSES.TIMEOUT_OCCURED,je.STATUSES.SSL_HANDSHAKE_FAILED,je.STATUSES.INVALID_SSL_CERTIFICATE,je.STATUSES.RAILGUN_ERROR,je.STATUSES.SITE_IS_OVERLOADED,je.STATUSES.SITE_IS_FROZEN,je.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,je.STATUSES.NETWORK_READ_TIMEOUT,je.STATUSES.NETWORK_CONNECT_TIMEOUT];je.ALPHA=[];for(let t=65;t<=90;t++)je.ALPHA.push(String.fromCharCode(t)),je.ALPHA.push(String.fromCharCode(t+32));je.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};je.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};je.NUM=["0","1","2","3","4","5","6","7","8","9"];je.ALPHANUM=je.ALPHA.concat(je.NUM);je.MARK=["-","_",".","!","~","*","'","(",")"];je.USERINFO_CHARS=je.ALPHANUM.concat(je.MARK).concat(["%",";",":","&","=","+","$",","]);je.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(je.ALPHANUM);je.HEX=je.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);je.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(je.ALPHANUM);je.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&je.HEADER_CHARS.push(t);je.CONNECTION_TOKEN_CHARS=je.HEADER_CHARS.filter(t=>t!==44);je.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&je.QUOTED_STRING.push(t);je.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)je.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)je.HTAB_SP_VCHAR_OBS_TEXT.push(t);je.MAJOR=je.NUM_MAP;je.MINOR=je.MAJOR;je.SPECIAL_HEADERS={connection:je.HEADER_STATE.CONNECTION,"content-length":je.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":je.HEADER_STATE.CONNECTION,"transfer-encoding":je.HEADER_STATE.TRANSFER_ENCODING,upgrade:je.HEADER_STATE.UPGRADE};je.default={ERROR:je.ERROR,TYPE:je.TYPE,FLAGS:je.FLAGS,LENIENT_FLAGS:je.LENIENT_FLAGS,METHODS:je.METHODS,STATUSES:je.STATUSES,FINISH:je.FINISH,HEADER_STATE:je.HEADER_STATE,ALPHA:je.ALPHA,NUM_MAP:je.NUM_MAP,HEX_MAP:je.HEX_MAP,NUM:je.NUM,ALPHANUM:je.ALPHANUM,MARK:je.MARK,USERINFO_CHARS:je.USERINFO_CHARS,URL_CHAR:je.URL_CHAR,HEX:je.HEX,TOKEN:je.TOKEN,HEADER_CHARS:je.HEADER_CHARS,CONNECTION_TOKEN_CHARS:je.CONNECTION_TOKEN_CHARS,QUOTED_STRING:je.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:je.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:je.MAJOR,MINOR:je.MINOR,SPECIAL_HEADERS:je.SPECIAL_HEADERS,METHODS_HTTP:je.METHODS_HTTP,METHODS_ICE:je.METHODS_ICE,METHODS_RTSP:je.METHODS_RTSP,METHOD_MAP:je.METHOD_MAP,H_METHOD_MAP:je.H_METHOD_MAP,STATUSES_HTTP:je.STATUSES_HTTP}});var pir=I((Psf,O6n)=>{"use strict";p();var{Buffer:oIs}=require("node:buffer"),sIs="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==",fir;Object.defineProperty(O6n,"exports",{get:a(()=>fir||(fir=oIs.from(sIs,"base64")),"get")})});var B6n=I((Msf,L6n)=>{"use strict";p();var{Buffer:aIs}=require("node:buffer"),cIs="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==",hir;Object.defineProperty(L6n,"exports",{get:a(()=>hir||(hir=aIs.from(cIs,"base64")),"get")})});var APe=I((Bsf,$6n)=>{"use strict";p();var F6n=["GET","HEAD","POST"],lIs=new Set(F6n),uIs=[101,204,205,304],U6n=[301,302,303,307,308],dIs=new Set(U6n),Q6n=["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"],fIs=new Set(Q6n),q6n=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],pIs=["",...q6n],hIs=new Set(q6n),mIs=["follow","manual","error"],j6n=["GET","HEAD","OPTIONS","TRACE"],gIs=new Set(j6n),AIs=["navigate","same-origin","no-cors","cors"],yIs=["omit","same-origin","include"],EIs=["default","no-store","reload","no-cache","force-cache","only-if-cached"],_Is=["content-encoding","content-language","content-location","content-type","content-length"],vIs=["half"],H6n=["CONNECT","TRACE","TRACK"],CIs=new Set(H6n),G6n=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],bIs=new Set(G6n);$6n.exports={subresource:G6n,forbiddenMethods:H6n,requestBodyHeader:_Is,referrerPolicy:pIs,requestRedirect:mIs,requestMode:AIs,requestCredentials:yIs,requestCache:EIs,redirectStatus:U6n,corsSafeListedMethods:F6n,nullBodyStatus:uIs,safeMethods:j6n,badPorts:Q6n,requestDuplex:vIs,subresourceSet:bIs,badPortsSet:fIs,redirectStatusSet:dIs,corsSafeListedMethodsSet:lIs,safeMethodsSet:gIs,forbiddenMethodsSet:CIs,referrerPolicyTokens:hIs}});var gir=I((Usf,V6n)=>{"use strict";p();var mir=Symbol.for("undici.globalOrigin.1");function SIs(){return globalThis[mir]}a(SIs,"getGlobalOrigin");function TIs(t){if(t===void 0){Object.defineProperty(globalThis,mir,{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,mir,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(TIs,"setGlobalOrigin");V6n.exports={getGlobalOrigin:SIs,setGlobalOrigin:TIs}});var Rot=I((jsf,W6n)=>{"use strict";p();var IIs=new TextDecoder;function xIs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),IIs.decode(t))}a(xIs,"utf8DecodeBytes");W6n.exports={utf8DecodeBytes:xIs}});var $F=I(($sf,J6n)=>{"use strict";p();var z6n=require("node:assert"),{utf8DecodeBytes:wIs}=Rot();function RIs(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(NIs,"isomorphicDecode");var MIs=/[^\x00-\xFF]/;function OIs(t){return z6n(!MIs.test(t)),t}a(OIs,"isomorphicEncode");function LIs(t){return JSON.parse(wIs(t))}a(LIs,"parseJSONFromBytes");function BIs(t,e=!0,r=!0){return K6n(t,e,r,Y6n)}a(BIs,"removeASCIIWhitespace");function K6n(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(K6n,"removeChars");function FIs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return z6n(typeof e=="string"),e}a(FIs,"serializeJavascriptValueToJSONString");J6n.exports={collectASequenceOfCodePoints:RIs,collectASequenceOfCodePointsFast:kIs,forgivingBase64:DIs,isASCIIWhitespace:Y6n,isomorphicDecode:NIs,isomorphicEncode:OIs,parseJSONFromBytes:LIs,removeASCIIWhitespace:BIs,removeChars:K6n,serializeJavascriptValueToJSONString:FIs}});var Ow=I((zsf,n9n)=>{"use strict";p();var Pot=require("node:assert"),{forgivingBase64:UIs,collectASequenceOfCodePoints:Air,collectASequenceOfCodePointsFast:yPe,isomorphicDecode:QIs,removeASCIIWhitespace:qIs,removeChars:jIs}=$F(),HIs=new TextEncoder,EPe=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,GIs=/[\u000A\u000D\u0009\u0020]/u,$Is=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function VIs(t){Pot(t.protocol==="data:");let e=e9n(t,!0);e=e.slice(5);let r={position:0},n=yPe(",",e,r),o=n.length;if(n=qIs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=t9n(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=QIs(c);if(c=UIs(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=yir(n);return l==="failure"&&(l=yir("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(VIs,"dataURLProcessor");function e9n(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(e9n,"URLSerializer");function t9n(t){let e=HIs.encode(t);return WIs(e)}a(t9n,"stringPercentDecode");function Z6n(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(Z6n,"isHexCharByte");function X6n(t){return t>=48&&t<=57?t-48:(t&223)-55}a(X6n,"hexByteToNumber");function WIs(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=yPe(";",t,e);if(n=kot(n,!1,!0),n.length===0||!EPe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionGIs.test(d),t,e);let l=Air(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=r9n(t,e,!0),yPe(";",t,e);else if(u=yPe(";",t,e),u=kot(u,!1,!0),u.length===0)continue;l.length!==0&&EPe.test(l)&&(u.length===0||$Is.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(yir,"parseMIMEType");function r9n(t,e,r=!1){let n=e.position,o="";for(Pot(t[e.position]==='"'),e.position++;o+=Air(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{Pot(s==='"');break}}return r?o:t.slice(n,e.position)}a(r9n,"collectAnHTTPQuotedString");function zIs(t){Pot(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",EPe.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(zIs,"serializeAMimeType");function YIs(t){return t===13||t===10||t===9||t===32}a(YIs,"isHTTPWhiteSpace");function kot(t,e=!0,r=!0){return jIs(t,e,r,YIs)}a(kot,"removeHTTPWhitespace");function KIs(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(KIs,"minimizeSupportedMimeType");n9n.exports={dataURLProcessor:VIs,URLSerializer:e9n,stringPercentDecode:t9n,parseMIMEType:yir,collectAnHTTPQuotedString:r9n,serializeAMimeType:zIs,removeHTTPWhitespace:kot,minimizeSupportedMimeType:KIs,HTTP_TOKEN_CODEPOINTS:EPe}});var VF=I((Jsf,_ir)=>{"use strict";p();var i9n={__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 JIs(t){try{return i9n[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(JIs,"detectRuntimeFeatureByNodeModule");function ZIs(t,e){return typeof i9n[t]()[e]<"u"}a(ZIs,"detectRuntimeFeatureByExportedProperty");var o9n=["markAsUncloneable","zstd"],XIs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},s9n=["crypto","sqlite"],exs=[...s9n,...o9n];function txs(t){if(s9n.includes(t))return JIs(`node:${t}`);if(o9n.includes(t)){let[e,r]=XIs[t];return ZIs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(txs,"detectRuntimeFeature");var Eir=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(exs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=txs(e);return this.#e.set(e,r),r}},a9n=new Eir;_ir.exports.runtimeFeatures=a9n;_ir.exports.default=a9n});var $A=I((eaf,l9n)=>{"use strict";p();var rxs=require("node:assert"),{types:hp,inspect:nxs}=require("node:util"),{runtimeFeatures:ixs}=VF(),vir=1,Cir=2,Dot=3,Not=4,bir=5,Mot=6,Sir=7,_T=8,c9n=Function.call.bind(Function.prototype[Symbol.hasInstance]),ut={converters:{},util:{},errors:{},is:{}};ut.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};ut.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 ut.errors.exception({header:t.prefix,message:r})};ut.errors.invalidArgument=function(t){return ut.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};ut.brandCheck=function(t,e){if(!c9n(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};ut.brandCheckMultiple=function(t){let e=t.map(r=>ut.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};ut.argumentLengthCheck=function({length:t},e,r){if(tc9n(t,e)};ut.util.Type=function(t){switch(typeof t){case"undefined":return vir;case"boolean":return Cir;case"string":return Dot;case"symbol":return Not;case"number":return bir;case"bigint":return Mot;case"function":case"object":return t===null?Sir:_T}};ut.util.Types={UNDEFINED:vir,BOOLEAN:Cir,STRING:Dot,SYMBOL:Not,NUMBER:bir,BIGINT:Mot,NULL:Sir,OBJECT:_T};ut.util.TypeValueToString=function(t){switch(ut.util.Type(t)){case vir:return"Undefined";case Cir:return"Boolean";case Dot:return"String";case Not:return"Symbol";case bir:return"Number";case Mot:return"BigInt";case Sir:return"Null";case _T:return"Object"}};ut.util.markAsUncloneable=ixs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};ut.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),ut.util.HasFlag(n,ut.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw ut.errors.exception({header:"Integer conversion",message:`Could not convert ${ut.util.Stringify(t)} to an integer.`});if(c=ut.util.IntegerPart(c),co)throw ut.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&ut.util.HasFlag(n,ut.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=ut.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};ut.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};ut.util.Stringify=function(t){switch(ut.util.Type(t)){case Not:return`Symbol(${t.description})`;case _T:return nxs(t);case Dot:return`"${t}"`;case Mot:return`${t}n`;default:return`${t}`}};ut.util.IsResizableArrayBuffer=function(t){if(hp.isArrayBuffer(t))return t.resizable;if(hp.isSharedArrayBuffer(t))return t.growable;throw ut.errors.exception({header:"IsResizableArrayBuffer",message:`"${ut.util.Stringify(t)}" is not an array buffer.`})};ut.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};ut.sequenceConverter=function(t){return(e,r,n,o)=>{if(ut.util.Type(e)!==_T)throw ut.errors.exception({header:r,message:`${n} (${ut.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 ut.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}};ut.recordConverter=function(t,e){return(r,n,o)=>{if(ut.util.Type(r)!==_T)throw ut.errors.exception({header:n,message:`${o} ("${ut.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!hp.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=ut.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}};ut.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw ut.errors.exception({header:n,message:`Expected ${o} ("${ut.util.Stringify(r)}") to be an instance of ${e}.`});return r}};ut.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&&ut.util.Type(e)!==_T)throw ut.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 ut.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 ut.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};ut.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};ut.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};ut.is.ReadableStream=ut.util.MakeTypeAssertion(ReadableStream);ut.is.Blob=ut.util.MakeTypeAssertion(Blob);ut.is.URLSearchParams=ut.util.MakeTypeAssertion(URLSearchParams);ut.is.File=ut.util.MakeTypeAssertion(File);ut.is.URL=ut.util.MakeTypeAssertion(URL);ut.is.AbortSignal=ut.util.MakeTypeAssertion(AbortSignal);ut.is.MessagePort=ut.util.MakeTypeAssertion(MessagePort);ut.is.BufferSource=function(t){return hp.isArrayBuffer(t)||ArrayBuffer.isView(t)&&hp.isArrayBuffer(t.buffer)};ut.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(hp.isTypedArray(e)||hp.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(rxs(hp.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};ut.converters.DOMString=function(t,e,r,n){if(t===null&&ut.util.HasFlag(n,ut.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw ut.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};ut.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw ut.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};ut.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};ut.converters.boolean=function(t){return!!t};ut.converters.any=function(t){return t};ut.converters["long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"signed",0,e,r)};ut.converters["unsigned long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"unsigned",0,e,r)};ut.converters["unsigned long"]=function(t,e,r){return ut.util.ConvertToInt(t,32,"unsigned",0,e,r)};ut.converters["unsigned short"]=function(t,e,r,n){return ut.util.ConvertToInt(t,16,"unsigned",n,e,r)};ut.converters.ArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==_T||!hp.isArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};ut.converters.SharedArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==_T||!hp.isSharedArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};ut.converters.TypedArray=function(t,e,r,n,o){if(ut.util.Type(t)!==_T||!hp.isTypedArray(t)||t.constructor.name!==e.name)throw ut.errors.conversionFailed({prefix:r,argument:`${n} ("${ut.util.Stringify(t)}")`,types:[e.name]});if(!ut.util.HasFlag(o,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(o,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};ut.converters.DataView=function(t,e,r,n){if(ut.util.Type(t)!==_T||!hp.isDataView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["DataView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.ArrayBufferView=function(t,e,r,n){if(ut.util.Type(t)!==_T||!hp.isArrayBufferView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.BufferSource=function(t,e,r,n){if(hp.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(hp.isArrayBufferView(t))return n&=~ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw hp.isSharedArrayBuffer(t)?ut.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};ut.converters.AllowSharedBufferSource=function(t,e,r,n){if(hp.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(hp.isSharedArrayBuffer(t))return ut.converters.SharedArrayBuffer(t,e,r,n);if(hp.isArrayBufferView(t))return n|=ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};ut.converters["sequence"]=ut.sequenceConverter(ut.converters.ByteString);ut.converters["sequence>"]=ut.sequenceConverter(ut.converters["sequence"]);ut.converters["record"]=ut.recordConverter(ut.converters.ByteString,ut.converters.ByteString);ut.converters.Blob=ut.interfaceConverter(ut.is.Blob,"Blob");ut.converters.AbortSignal=ut.interfaceConverter(ut.is.AbortSignal,"AbortSignal");ut.converters.EventHandlerNonNull=function(t){return ut.util.Type(t)!==_T?null:typeof t=="function"?t:()=>{}};ut.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};l9n.exports={webidl:ut}});var vT=I((raf,b9n)=>{"use strict";p();var{Transform:oxs}=require("node:stream"),u9n=require("node:zlib"),{redirectStatusSet:sxs,referrerPolicyTokens:axs,badPortsSet:cxs}=APe(),{getGlobalOrigin:d9n}=gir(),{collectAnHTTPQuotedString:lxs,parseMIMEType:uxs}=Ow(),{performance:dxs}=require("node:perf_hooks"),{ReadableStreamFrom:fxs,isValidHTTPToken:f9n,normalizedMethodRecordsBase:pxs}=Do(),vPe=require("node:assert"),{isUint8Array:hxs}=require("node:util/types"),{webidl:Qj}=$A(),{isomorphicEncode:Tir,collectASequenceOfCodePoints:bZ,removeChars:mxs}=$F();function p9n(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(p9n,"responseURL");function gxs(t,e){if(!sxs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&m9n(r)&&(h9n(r)||(r=Axs(r)),r=new URL(r,p9n(t))),r&&!r.hash&&(r.hash=e),r}a(gxs,"responseLocationURL");function h9n(t){for(let e=0;e126||r<32)return!1}return!0}a(h9n,"isValidEncodedURL");function Axs(t){return Buffer.from(t,"binary").toString("utf8")}a(Axs,"normalizeBinaryStringToUtf8");function TZ(t){return t.urlList[t.urlList.length-1]}a(TZ,"requestCurrentURL");function yxs(t){let e=TZ(t);return v9n(e)&&cxs.has(e.port)?"blocked":"allowed"}a(yxs,"requestBadPort");function Exs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(Exs,"isErrorLike");function _xs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(_xs,"isValidReasonPhrase");var vxs=f9n;function m9n(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a(m9n,"isValidHeaderValue");function Cxs(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(axs.has(o)){r=o;break}}return r}a(Cxs,"parseReferrerPolicy");function bxs(t,e){let r=Cxs(e);r!==""&&(t.referrerPolicy=r)}a(bxs,"setRequestReferrerPolicyOnRedirect");function Sxs(){return"allowed"}a(Sxs,"crossOriginResourcePolicyCheck");function Txs(){return"success"}a(Txs,"corsCheck");function Ixs(){return"success"}a(Ixs,"TAOCheck");function xxs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(xxs,"appendFetchMetadata");function wxs(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&&xir(t.origin)&&!xir(TZ(t))&&(e=null);break;case"same-origin":_Pe(t,TZ(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(wxs,"appendRequestOriginHeader");function ipe(t,e){return t}a(ipe,"coarsenTime");function Rxs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??Iir(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=TZ(t);return SZ(n)&&!SZ(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=TZ(t);return _Pe(n,s)?n:SZ(n)&&!SZ(s)?"no-referrer":o}case"same-origin":return _Pe(t,n)?n:"no-referrer";case"origin-when-cross-origin":return _Pe(t,n)?n:o;case"no-referrer-when-downgrade":{let s=TZ(t);return SZ(n)&&!SZ(s)?"no-referrer":n}}}a(Nxs,"determineRequestsReferrer");function Iir(t,e=!1){return vPe(Qj.is.URL(t)),t=new URL(t),_9n(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(Iir,"stripURLForReferrer");var Mxs=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)$/),Oxs=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function A9n(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),Oxs(t)):Mxs(t)}a(A9n,"isOriginIPPotentiallyTrustworthy");function Lxs(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||A9n(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(Lxs,"isOriginPotentiallyTrustworthy");function SZ(t){return Qj.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:Lxs(t.origin):!1}a(SZ,"isURLPotentiallyTrustworthy");function Bxs(t){}a(Bxs,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function _Pe(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(_Pe,"sameOrigin");function Fxs(t){return t.controller.state==="aborted"}a(Fxs,"isAborted");function Uxs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(Uxs,"isCancelled");function Qxs(t){return pxs[t.toLowerCase()]??t}a(Qxs,"normalizeMethod");var qxs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function y9n(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,qxs),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(y9n,"createIterator");function jxs(t,e,r,n=0,o=1){let s=y9n(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Qj.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Qj.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Qj.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(Qj.brandCheck(this,e),Qj.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(jxs,"iteratorMixin");function Hxs(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();E9n(s,n,o)}catch(s){o(s)}}a(Hxs,"fullyReadBody");function Gxs(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(Gxs,"readableStreamClose");async function E9n(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(!hxs(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(E9n,"readAllBytes");function _9n(t){vPe("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(_9n,"urlIsLocal");function xir(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(xir,"urlHasHttpsScheme");function v9n(t){vPe("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(v9n,"urlIsHttpHttpsScheme");function $xs(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($xs,"simpleRangeHeaderValue");function Vxs(t,e,r){let n="bytes ";return n+=Tir(`${t}`),n+="-",n+=Tir(`${e}`),n+="/",n+=Tir(`${r}`),n}a(Vxs,"buildContentRange");var wir=class extends oxs{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?u9n.createInflate(this.#e):u9n.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 Wxs(t){return new wir(t)}a(Wxs,"createInflate");function zxs(t){let e=null,r=null,n=null,o=C9n("content-type",t);if(o===null)return"failure";for(let s of o){let c=uxs(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(zxs,"extractMimeType");function Yxs(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(Yxs,"gettingDecodingSplitting");function C9n(t,e){let r=e.get(t,!0);return r===null?null:Yxs(r)}a(C9n,"getDecodeSplit");function Kxs(t){return!1}a(Kxs,"hasAuthenticationEntry");function Jxs(t){return!!(t.username||t.password)}a(Jxs,"includesCredentials");function Zxs(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(Zxs,"isTraversableNavigable");var Rir=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return d9n()}get origin(){return this.baseUrl?.origin}policyContainer=g9n()},kir=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new Rir},Xxs=new kir;b9n.exports={isAborted:Fxs,isCancelled:Uxs,isValidEncodedURL:h9n,ReadableStreamFrom:fxs,tryUpgradeRequestToAPotentiallyTrustworthyURL:Bxs,clampAndCoarsenConnectionTimingInfo:Rxs,coarsenedSharedCurrentTime:kxs,determineRequestsReferrer:Nxs,makePolicyContainer:g9n,clonePolicyContainer:Dxs,appendFetchMetadata:xxs,appendRequestOriginHeader:wxs,TAOCheck:Ixs,corsCheck:Txs,crossOriginResourcePolicyCheck:Sxs,createOpaqueTimingInfo:Pxs,setRequestReferrerPolicyOnRedirect:bxs,isValidHTTPToken:f9n,requestBadPort:yxs,requestCurrentURL:TZ,responseURL:p9n,responseLocationURL:gxs,isURLPotentiallyTrustworthy:SZ,isValidReasonPhrase:_xs,sameOrigin:_Pe,normalizeMethod:Qxs,iteratorMixin:jxs,createIterator:y9n,isValidHeaderName:vxs,isValidHeaderValue:m9n,isErrorLike:Exs,fullyReadBody:Hxs,readableStreamClose:Gxs,urlIsLocal:_9n,urlHasHttpsScheme:xir,urlIsHttpHttpsScheme:v9n,readAllBytes:E9n,simpleRangeHeaderValue:$xs,buildContentRange:Vxs,createInflate:Wxs,extractMimeType:zxs,getDecodeSplit:C9n,environmentSettingsObject:Xxs,isOriginIPPotentiallyTrustworthy:A9n,hasAuthenticationEntry:Kxs,includesCredentials:Jxs,isTraversableNavigable:Zxs}});var Oot=I((oaf,T9n)=>{"use strict";p();var{iteratorMixin:ews}=vT(),{kEnumerableProperty:ope}=Do(),{webidl:Rc}=$A(),S9n=require("node:util"),WF=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(Rc.util.markAsUncloneable(this),e!==void 0)throw Rc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){Rc.brandCheck(this,t);let o="FormData.append";Rc.argumentLengthCheck(arguments,2,o),e=Rc.converters.USVString(e),arguments.length===3||Rc.is.Blob(r)?(r=Rc.converters.Blob(r,o,"value"),n!==void 0&&(n=Rc.converters.USVString(n))):r=Rc.converters.USVString(r);let s=Pir(e,r,n);this.#e.push(s)}delete(e){Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.delete"),e=Rc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.get"),e=Rc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=Rc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.has"),e=Rc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Rc.brandCheck(this,t);let o="FormData.set";Rc.argumentLengthCheck(arguments,2,o),e=Rc.converters.USVString(e),arguments.length===3||Rc.is.Blob(r)?(r=Rc.converters.Blob(r,o,"value"),n!==void 0&&(n=Rc.converters.USVString(n))):r=Rc.converters.USVString(r);let s=Pir(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)}[S9n.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=S9n.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:tws,setFormDataState:rws}=WF;Reflect.deleteProperty(WF,"getFormDataState");Reflect.deleteProperty(WF,"setFormDataState");ews("FormData",WF,tws,"name","value");Object.defineProperties(WF.prototype,{append:ope,delete:ope,get:ope,getAll:ope,has:ope,set:ope,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function Pir(t,e,r){if(typeof e!="string"){if(Rc.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(Pir,"makeEntry");Rc.is.FormData=Rc.util.MakeTypeAssertion(WF);T9n.exports={FormData:WF,makeEntry:Pir,setFormDataState:rws}});var w9n=I((caf,x9n)=>{"use strict";p();var{bufferToLowerCasedHeaderName:nws}=Do(),{HTTP_TOKEN_CODEPOINTS:iws}=Ow(),{makeEntry:ows}=Oot(),{webidl:Dir}=$A(),Nir=require("node:assert"),{isomorphicDecode:I9n}=$F(),sws=Buffer.from("--"),Mir=new TextDecoder,aws=new TextDecoder("utf-8",{ignoreBOM:!0});function cws(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(lws,"validateBoundary");function uws(t,e){Nir(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw pb("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw pb("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 pb("expected a value starting with -- and the boundary");if(pws(t,sws,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw pb("expected CRLF");s.position+=2;let l=fws(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 pb("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 pb("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",cws(f)||(f=""),g=new File([m],d,{type:f})):g=aws.decode(Buffer.from(m)),Nir(Dir.is.USVString(u)),Nir(typeof g=="string"&&Dir.is.USVString(g)||Dir.is.File(g)),o.push(ows(u,g,d))}}a(uws,"multipartFormDataParser");function dws(t,e){t[e.position]===59&&e.position++,Lw(c=>c===32||c===9,t,e);let r=Lw(c=>Lir(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++,Lw(c=>c===32||c===9,t,e);let s;if(o){let c=Lw(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 pb("unknown encoding, expected utf-8''");s=decodeURIComponent(Mir.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=Lw(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw pb("Closing quote not found");e.position++,s=Mir.decode(c).replace(/%0A/ig,` +`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=Lw(l=>Lir(l)&&l!==59,t,e);s=Mir.decode(c)}return{name:n,value:s,extended:o}}a(dws,"parseContentDispositionAttribute");function fws(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 pb("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=Lw(l=>l!==10&&l!==13&&l!==58,t,e);if(c=Oir(c,!0,!0,l=>l===9||l===32),!iws.test(c.toString()))throw pb("header name does not match the field-name token production");if(t[e.position]!==58)throw pb("expected :");switch(e.position++,Lw(l=>l===32||l===9,t,e),nws(c)){case"content-disposition":{r=n=null;let l=!1;if(Lw(d=>Lir(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw pb("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=Oir(l,!1,!0,u=>u===9||u===32),o=I9n(l);break}case"content-transfer-encoding":{let l=Lw(u=>u!==10&&u!==13,t,e);l=Oir(l,!1,!0,u=>u===9||u===32),s=I9n(l);break}default:Lw(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw pb("expected CRLF");e.position+=2}}a(fws,"parseMultipartFormDataHeaders");function Lw(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(Oir,"removeChars");function pws(t,e,r){if(t.length{"use strict";p();function gws(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(gws,"createDeferredPromise");R9n.exports={createDeferredPromise:gws}});var ape=I((haf,M9n)=>{"use strict";p();var Uir=Do(),{ReadableStreamFrom:Aws,readableStreamClose:yws,fullyReadBody:Ews,extractMimeType:_ws}=vT(),{FormData:k9n,setFormDataState:vws}=Oot(),{webidl:S2}=$A(),Bir=require("node:assert"),{isErrored:Fir,isDisturbed:Cws}=require("node:stream"),{isUint8Array:bws}=require("node:util/types"),{serializeAMimeType:Sws}=Ow(),{multipartFormDataParser:Tws}=w9n(),{createDeferredPromise:Iws}=CPe(),{parseJSONFromBytes:xws}=$F(),{utf8DecodeBytes:wws}=Rot(),{runtimeFeatures:Rws}=VF(),kws=Rws.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),Lot=new TextEncoder;function Pws(){}a(Pws,"noop");var Dws=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!Cws(e)&&!Fir(e)&&e.cancel("Response object has been garbage collected").catch(Pws)});function D9n(t,e=!1){let r=null,n=null;S2.is.ReadableStream(t)?r=t:S2.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),Bir(S2.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(S2.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(S2.is.BufferSource(t))s=S2.util.getCopyOfBytesHeldByBufferSource(t);else if(S2.is.FormData(t)){let d=`----formdata-undici-0${`${kws(1e11)}`.padStart(11,"0")}`,f=`--${d}\r Content-Disposition: form-data`;let h=a(_=>_.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"formdataEscape"),m=a(_=>_.replace(/\r?\n|\r/g,`\r -`),"normalizeLinefeeds"),g=[],A=new Uint8Array([13,10]);c=0;let y=!1;for(let[_,v]of t)if(typeof v=="string"){let b=Not.encode(f+`; name="${h(m(_))}"\r +`),"normalizeLinefeeds"),g=[],A=new Uint8Array([13,10]);c=0;let y=!1;for(let[_,v]of t)if(typeof v=="string"){let b=Lot.encode(f+`; name="${h(m(_))}"\r \r ${m(v)}\r -`);g.push(b),c+=b.byteLength}else{let b=Not.encode(`${f}; name="${h(m(_))}"`+(v.name?`; filename="${h(v.name)}"`:"")+`\r +`);g.push(b),c+=b.byteLength}else{let b=Lot.encode(`${f}; name="${h(m(_))}"`+(v.name?`; filename="${h(v.name)}"`:"")+`\r Content-Type: ${v.type||"application/octet-stream"}\r \r -`);g.push(b,v,A),typeof v.size=="number"?c+=b.byteLength+v.size+A.byteLength:y=!0}let E=Not.encode(`--${d}--\r -`);g.push(E),c+=E.byteLength,y&&(c=null),s=t,o=a(async function*(){for(let _ of g)_.stream?yield*_.stream():yield _},"action"),l=`multipart/form-data; boundary=${d}`}else if(b2.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(Fir.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=b2.is.ReadableStream(t)?t:fws(t)}return(typeof s=="string"||yws(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(Bir(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!Bir(r)&&n.enqueue(typeof d=="string"?Not.encode(d):new Uint8Array(d));queueMicrotask(()=>pws(n))})(),[{stream:r,source:s,length:c},l]}a(P9n,"extractBody");function wws(t,e=!1){return b2.is.ReadableStream(t)&&(Lir(!Fir.isDisturbed(t),"The body has already been consumed."),Lir(!t.locked,"The stream is locked.")),P9n(t,e)}a(wws,"safelyExtractBody");function Rws(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(Rws,"cloneBody");function kws(t,e){return{blob(){return spe(this,n=>{let o=k9n(e(this));return o===null?o="":o&&(o=Ews(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return spe(this,n=>new Uint8Array(n).buffer,t,e)},text(){return spe(this,bws,t,e)},json(){return spe(this,Cws,t,e)},formData(){return spe(this,n=>{let o=k9n(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=_ws(n,o),c=new R9n;return gws(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new R9n;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 spe(this,n=>new Uint8Array(n),t,e)}}}a(kws,"bodyMixinMethods");function Pws(t,e){Object.assign(t.prototype,kws(t,e))}a(Pws,"mixinBody");function spe(t,e,r,n){try{b2.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),D9n(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=vws(),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):(hws(t.body,c,s),o.promise)}a(spe,"consumeBody");function D9n(t){let e=t.body;return e!=null&&(e.stream.locked||Fir.isDisturbed(e.stream))}a(D9n,"bodyUnusable");function k9n(t){let e=t.headersList,r=mws(e);return r==="failure"?null:r}a(k9n,"bodyMimeType");N9n.exports={extractBody:P9n,safelyExtractBody:wws,cloneBody:Rws,mixinBody:Pws,streamRegistry:xws,bodyUnusable:D9n}});var z9n=I((laf,W9n)=>{"use strict";p();var Oi=require("node:assert"),Ti=Po(),{channels:M9n}=Bj(),Uir=ynr(),{RequestContentLengthMismatchError:IZ,ResponseContentLengthMismatchError:O9n,RequestAbortedError:H9n,HeadersTimeoutError:Dws,HeadersOverflowError:Nws,SocketError:xZ,InformationalError:cpe,BodyTimeoutError:Mws,HTTPParserError:Ows,ResponseExceededMaxSizeError:Lws}=ao(),{kUrl:G9n,kReset:hb,kClient:Fot,kParser:ud,kBlocking:TPe,kRunning:lm,kPending:Vir,kSize:L9n,kWriting:Qj,kQueue:S2,kNoRef:bPe,kKeepAliveDefaultTimeout:Bws,kHostHeader:Fws,kPendingIdx:Uws,kRunningIdx:Lw,kError:lv,kPipelining:Lot,kSocket:RZ,kKeepAliveTimeoutValue:Uot,kMaxHeadersSize:Qws,kKeepAliveMaxTimeout:qws,kKeepAliveTimeoutThreshold:jws,kHeadersTimeout:Hws,kBodyTimeout:Gws,kStrictContentLength:jir,kMaxRequests:B9n,kCounter:$ws,kMaxResponseSize:Vws,kOnError:F9n,kResume:WF,kHTTPContext:$9n,kClosed:Hir}=al(),_T=N6n(),U9n=Buffer.alloc(0),Mot=Buffer[Symbol.species],Wws=Ti.removeAllListeners,kZ=Symbol("kIdleSocketValidation"),wZ=Symbol("kIdleSocketValidationTimeout"),Wir=Symbol("kSocketUsed"),Qir;function zws(){let t=process.env.JEST_WORKER_ID?fir():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(L6n())}catch{}return e||(e=new WebAssembly.Module(t||fir())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onStatus(new Mot(k5.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Oi(mp.ptr===n),mp.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onHeaderField(new Mot(k5.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onHeaderValue(new Mot(k5.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Oi(mp.ptr===n),mp.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onBody(new Mot(k5.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Oi(mp.ptr===n),mp.onMessageComplete()),"wasm_on_message_complete")}})}a(zws,"lazyllhttp");var qir=null,mp=null,k5=null,Oot=0,P5=null,Yws=0,SPe=1,lpe=2|SPe,Bot=4|SPe,Gir=8|Yws,$ir=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(_T.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[Qws],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Vws]}setTimeout(e,r){e!==this.timeoutValue||r&SPe^this.timeoutType&SPe?(this.timeout&&(Uir.clearTimeout(this.timeout),this.timeout=null),e&&(r&SPe?this.timeout=Uir.setFastTimeout(Q9n,e,this.timeoutWeakRef):(this.timeout=setTimeout(Q9n,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||(Oi(this.ptr!=null),Oi(mp===null),this.llhttp.llhttp_resume(this.ptr),Oi(this.timeoutType===Bot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||U9n),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Oi(mp===null),Oi(this.ptr!=null),Oi(!this.paused);let{socket:r,llhttp:n}=this;e.length>Oot&&(P5&&n.free(P5),Oot=Math.ceil(e.length/4096)*4096,P5=n.malloc(Oot)),new Uint8Array(n.memory.buffer,P5,Oot).set(e);try{let o;try{k5=e,mp=this,o=n.llhttp_execute(this.ptr,P5,e.length)}finally{mp=null,k5=null}if(o!==_T.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-P5);if(o===_T.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===_T.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Ti.destroy(r,o)}}finish(){Oi(mp===null),Oi(this.ptr!=null),Oi(!this.paused);let{llhttp:e}=this,r;try{mp=this,r=e.llhttp_finish(this.ptr)}finally{mp=null}return r===_T.ERROR.OK?null:r===_T.ERROR.PAUSED||r===_T.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,U9n)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new O9n;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 Ows(l,_T.ERROR[e],r)}destroy(){Oi(mp===null),Oi(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Uir.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[lm]===0)return Ti.destroy(e,new xZ("bad response",Ti.getSocketInfo(e))),-1;let n=r[S2][r[Lw]];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=Ti.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ti.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ti.destroy(this.socket,new Nws)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Oi(r),Oi(n[RZ]===o),Oi(!o.destroyed),Oi(!this.paused),Oi((s.length&1)===0);let l=n[S2][n[Lw]];Oi(l),Oi(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[ud].destroy(),o[ud]=null,o[Fot]=null,o[lv]=null,Wws(o),n[RZ]=null,n[$9n]=null,n[S2][n[Lw]++]=null,n.emit("disconnect",n[G9n],[n],new cpe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ti.destroy(o,u)}n[WF]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;if(o[lm]===0)return Ti.destroy(s,new xZ("bad response",Ti.getSocketInfo(s))),-1;let u=o[S2][o[Lw]];if(!u)return-1;if(Oi(!this.upgrade),Oi(this.statusCode<200),e===100)return Ti.destroy(s,new xZ("bad response",Ti.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ti.destroy(s,new xZ("bad upgrade",Ti.getSocketInfo(s))),-1;if(Oi(this.timeoutType===lpe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[hb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[Gws];this.setTimeout(f,Bot)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Oi(o[lm]===1),this.upgrade=!0,2;if(r)return Oi(o[lm]===1),this.upgrade=!0,2;if(Oi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Lot]){let f=this.keepAlive?Ti.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[jws],o[qws]);h<=0?s[hb]=!0:o[Uot]=h}else o[Uot]=o[Bws]}else s[hb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[TPe]&&(s[TPe]=!1,o[WF]()),d?_T.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[S2][r[Lw]];return Oi(c),Oi(this.timeoutType===Bot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Oi(o>=200),s>-1&&this.bytesRead+e.length>s?(Ti.destroy(n,new Lws),-1):(this.bytesRead+=e.length,c.onData(e)===!1?_T.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;Oi(n>=100),Oi((this.headers.length&1)===0);let d=e[S2][e[Lw]];if(Oi(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 Ti.destroy(r,new O9n),-1;if(d.onComplete(s),e[S2][e[Lw]++]=null,r[Wir]=e[Vir]===0,r[Qj])return Oi(e[lm]===0),Ti.destroy(r,new cpe("reset")),_T.ERROR.PAUSED;if(u){if(r[hb]&&e[lm]===0)return Ti.destroy(r,new cpe("reset")),_T.ERROR.PAUSED;e[Lot]==null||e[Lot]===1?setImmediate(e[WF]):e[WF]()}else return Ti.destroy(r,new cpe("reset")),_T.ERROR.PAUSED;return 0}};function Q9n(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===lpe?(!r[Qj]||r.writableNeedDrain||o[lm]>1)&&(Oi(!s,"cannot be paused while waiting for headers"),Ti.destroy(r,new Dws)):n===Bot?s||Ti.destroy(r,new Mws):n===Gir&&(Oi(o[lm]===0&&o[Uot]),Ti.destroy(r,new cpe("socket idle timeout")))}a(Q9n,"onParserTimeout");function Kws(t,e){if(t[RZ]=e,qir||(qir=zws()),e.errored)throw e.errored;if(e.destroyed)throw new xZ("destroyed");return e[bPe]=!1,e[Qj]=!1,e[hb]=!1,e[TPe]=!1,e[kZ]=0,e[wZ]=null,e[Wir]=!1,e[ud]=new $ir(t,e,qir),Ti.addListener(e,"error",Jws),Ti.addListener(e,"readable",Zws),Ti.addListener(e,"end",Xws),Ti.addListener(e,"close",eRs),e[Hir]=!1,e.on("close",tRs),{version:"h1",defaultPipelining:1,write(r){return oRs(t,r)},resume(){nRs(t)},destroy(r,n){e[Hir]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[Qj]||e[hb]||e[TPe]||e[kZ]===1||r&&(t[lm]>0&&!r.idempotent||t[lm]>0&&(r.upgrade||r.method==="CONNECT")||t[lm]>0&&Ti.bodyLength(r.body)!==0&&(Ti.isStream(r.body)||Ti.isAsyncIterable(r.body)||Ti.isFormDataLike(r.body))))}}}a(Kws,"connectH1");function Jws(t){Oi(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[ud];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[lv]=r,this[Fot][F9n](r));return}this[lv]=t,this[Fot][F9n](t)}a(Jws,"onHttpSocketError");function Zws(){this[ud]?.readMore()}a(Zws,"onHttpSocketReadable");function Xws(){let t=this[ud];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Ti.destroy(this,e);return}Ti.destroy(this,new xZ("other side closed",Ti.getSocketInfo(this)))}a(Xws,"onHttpSocketEnd");function eRs(){let t=this[ud];V9n(this),t&&(!this[lv]&&t.statusCode&&!t.shouldKeepAlive&&(this[lv]=t.finish()||this[lv]),this[ud].destroy(),this[ud]=null);let e=this[lv]||new xZ("closed",Ti.getSocketInfo(this)),r=this[Fot];if(r[RZ]=null,r[$9n]=null,r.destroyed){Oi(r[Vir]===0);let n=r[S2].splice(r[Lw]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[S2][r[Lw]];r[S2][r[Lw]++]=null,Ti.errorRequest(r,n,e)}r[Uws]=r[Lw],Oi(r[lm]===0),r.emit("disconnect",r[G9n],[r],e),r[WF]()}a(eRs,"onHttpSocketClose");function tRs(){this[Hir]=!0}a(tRs,"onSocketClose");function V9n(t){t[wZ]&&(clearTimeout(t[wZ]),t[wZ]=null),t[kZ]=0}a(V9n,"clearIdleSocketValidation");function rRs(t,e){e[kZ]=1,e[wZ]=setTimeout(()=>{e[wZ]=null,e[kZ]=2,t[RZ]===e&&!e.destroyed&&t[WF]()},0),e[wZ].unref?.()}a(rRs,"scheduleIdleSocketValidation");function nRs(t){let e=t[RZ];if(e&&!e.destroyed){if(t[L9n]===0?!e[bPe]&&e.unref&&(e.unref(),e[bPe]=!0):e[bPe]&&e.ref&&(e.ref(),e[bPe]=!1),t[lm]===0&&t[Vir]>0&&e[Wir]){if(e[kZ]===0)return rRs(t,e),e[ud].readMore(),e.destroyed,void 0;if(e[kZ]===1)return e[ud].readMore(),e.destroyed,void 0}if(t[lm]===0&&(e[ud].readMore(),e.destroyed))return;if(t[L9n]===0)e[ud].timeoutType!==Gir&&e[ud].setTimeout(t[Uot],Gir);else if(t[lm]>0&&e[ud].statusCode<200&&e[ud].timeoutType!==lpe){let r=t[S2][t[Lw]],n=r.headersTimeout!=null?r.headersTimeout:t[Hws];e[ud].setTimeout(n,lpe)}}}a(nRs,"resumeH1");function iRs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(iRs,"shouldSendContentLength");function oRs(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(Ti.isFormDataLike(u)){Qir||(Qir=ape().extractBody);let[E,_]=Qir(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ti.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ti.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),iRs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[jir])return Ti.errorRequest(t,e,new IZ),!1;process.emitWarning(new IZ)}let g=t[RZ];V9n(g);let A=a(E=>{e.aborted||e.completed||(Ti.errorRequest(t,e,E||new H9n),Ti.destroy(u),Ti.destroy(g,new cpe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ti.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[hb]=!0),(s||r==="CONNECT")&&(g[hb]=!0),l!=null&&(g[hb]=l),t[B9n]&&g[$ws]++>=t[B9n]&&(g[hb]=!0),c&&(g[TPe]=!0),g.setTypeOfService&&g.setTypeOfService(e.typeOfService);let y=`${r} ${n} HTTP/1.1\r +`);g.push(b,v,A),typeof v.size=="number"?c+=b.byteLength+v.size+A.byteLength:y=!0}let E=Lot.encode(`--${d}--\r +`);g.push(E),c+=E.byteLength,y&&(c=null),s=t,o=a(async function*(){for(let _ of g)_.stream?yield*_.stream():yield _},"action"),l=`multipart/form-data; boundary=${d}`}else if(S2.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(Uir.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=S2.is.ReadableStream(t)?t:Aws(t)}return(typeof s=="string"||bws(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(Fir(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!Fir(r)&&n.enqueue(typeof d=="string"?Lot.encode(d):new Uint8Array(d));queueMicrotask(()=>yws(n))})(),[{stream:r,source:s,length:c},l]}a(D9n,"extractBody");function Nws(t,e=!1){return S2.is.ReadableStream(t)&&(Bir(!Uir.isDisturbed(t),"The body has already been consumed."),Bir(!t.locked,"The stream is locked.")),D9n(t,e)}a(Nws,"safelyExtractBody");function Mws(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(Mws,"cloneBody");function Ows(t,e){return{blob(){return spe(this,n=>{let o=P9n(e(this));return o===null?o="":o&&(o=Sws(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return spe(this,n=>new Uint8Array(n).buffer,t,e)},text(){return spe(this,wws,t,e)},json(){return spe(this,xws,t,e)},formData(){return spe(this,n=>{let o=P9n(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=Tws(n,o),c=new k9n;return vws(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new k9n;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 spe(this,n=>new Uint8Array(n),t,e)}}}a(Ows,"bodyMixinMethods");function Lws(t,e){Object.assign(t.prototype,Ows(t,e))}a(Lws,"mixinBody");function spe(t,e,r,n){try{S2.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),N9n(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=Iws(),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):(Ews(t.body,c,s),o.promise)}a(spe,"consumeBody");function N9n(t){let e=t.body;return e!=null&&(e.stream.locked||Uir.isDisturbed(e.stream))}a(N9n,"bodyUnusable");function P9n(t){let e=t.headersList,r=_ws(e);return r==="failure"?null:r}a(P9n,"bodyMimeType");M9n.exports={extractBody:D9n,safelyExtractBody:Nws,cloneBody:Mws,mixinBody:Lws,streamRegistry:Dws,bodyUnusable:N9n}});var Y9n=I((Aaf,z9n)=>{"use strict";p();var Oi=require("node:assert"),Ti=Do(),{channels:O9n}=Fj(),Qir=Enr(),{RequestContentLengthMismatchError:IZ,ResponseContentLengthMismatchError:L9n,RequestAbortedError:G9n,HeadersTimeoutError:Bws,HeadersOverflowError:Fws,SocketError:xZ,InformationalError:cpe,BodyTimeoutError:Uws,HTTPParserError:Qws,ResponseExceededMaxSizeError:qws}=ao(),{kUrl:$9n,kReset:hb,kClient:qot,kParser:ud,kBlocking:TPe,kRunning:lm,kPending:Wir,kSize:B9n,kWriting:qj,kQueue:T2,kNoRef:bPe,kKeepAliveDefaultTimeout:jws,kHostHeader:Hws,kPendingIdx:Gws,kRunningIdx:Bw,kError:uv,kPipelining:Uot,kSocket:RZ,kKeepAliveTimeoutValue:jot,kMaxHeadersSize:$ws,kKeepAliveMaxTimeout:Vws,kKeepAliveTimeoutThreshold:Wws,kHeadersTimeout:zws,kBodyTimeout:Yws,kStrictContentLength:Hir,kMaxRequests:F9n,kCounter:Kws,kMaxResponseSize:Jws,kOnError:U9n,kResume:zF,kHTTPContext:V9n,kClosed:Gir}=al(),CT=M6n(),Q9n=Buffer.alloc(0),Bot=Buffer[Symbol.species],Zws=Ti.removeAllListeners,kZ=Symbol("kIdleSocketValidation"),wZ=Symbol("kIdleSocketValidationTimeout"),zir=Symbol("kSocketUsed"),qir;function Xws(){let t=process.env.JEST_WORKER_ID?pir():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(B6n())}catch{}return e||(e=new WebAssembly.Module(t||pir())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onStatus(new Bot(k5.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Oi(mp.ptr===n),mp.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onHeaderField(new Bot(k5.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onHeaderValue(new Bot(k5.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Oi(mp.ptr===n),mp.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onBody(new Bot(k5.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Oi(mp.ptr===n),mp.onMessageComplete()),"wasm_on_message_complete")}})}a(Xws,"lazyllhttp");var jir=null,mp=null,k5=null,Fot=0,P5=null,eRs=0,SPe=1,lpe=2|SPe,Qot=4|SPe,$ir=8|eRs,Vir=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(CT.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[$ws],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Jws]}setTimeout(e,r){e!==this.timeoutValue||r&SPe^this.timeoutType&SPe?(this.timeout&&(Qir.clearTimeout(this.timeout),this.timeout=null),e&&(r&SPe?this.timeout=Qir.setFastTimeout(q9n,e,this.timeoutWeakRef):(this.timeout=setTimeout(q9n,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||(Oi(this.ptr!=null),Oi(mp===null),this.llhttp.llhttp_resume(this.ptr),Oi(this.timeoutType===Qot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Q9n),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Oi(mp===null),Oi(this.ptr!=null),Oi(!this.paused);let{socket:r,llhttp:n}=this;e.length>Fot&&(P5&&n.free(P5),Fot=Math.ceil(e.length/4096)*4096,P5=n.malloc(Fot)),new Uint8Array(n.memory.buffer,P5,Fot).set(e);try{let o;try{k5=e,mp=this,o=n.llhttp_execute(this.ptr,P5,e.length)}finally{mp=null,k5=null}if(o!==CT.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-P5);if(o===CT.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===CT.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Ti.destroy(r,o)}}finish(){Oi(mp===null),Oi(this.ptr!=null),Oi(!this.paused);let{llhttp:e}=this,r;try{mp=this,r=e.llhttp_finish(this.ptr)}finally{mp=null}return r===CT.ERROR.OK?null:r===CT.ERROR.PAUSED||r===CT.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,Q9n)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new L9n;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 Qws(l,CT.ERROR[e],r)}destroy(){Oi(mp===null),Oi(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Qir.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[lm]===0)return Ti.destroy(e,new xZ("bad response",Ti.getSocketInfo(e))),-1;let n=r[T2][r[Bw]];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=Ti.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ti.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ti.destroy(this.socket,new Fws)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Oi(r),Oi(n[RZ]===o),Oi(!o.destroyed),Oi(!this.paused),Oi((s.length&1)===0);let l=n[T2][n[Bw]];Oi(l),Oi(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[ud].destroy(),o[ud]=null,o[qot]=null,o[uv]=null,Zws(o),n[RZ]=null,n[V9n]=null,n[T2][n[Bw]++]=null,n.emit("disconnect",n[$9n],[n],new cpe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ti.destroy(o,u)}n[zF]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;if(o[lm]===0)return Ti.destroy(s,new xZ("bad response",Ti.getSocketInfo(s))),-1;let u=o[T2][o[Bw]];if(!u)return-1;if(Oi(!this.upgrade),Oi(this.statusCode<200),e===100)return Ti.destroy(s,new xZ("bad response",Ti.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ti.destroy(s,new xZ("bad upgrade",Ti.getSocketInfo(s))),-1;if(Oi(this.timeoutType===lpe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[hb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[Yws];this.setTimeout(f,Qot)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Oi(o[lm]===1),this.upgrade=!0,2;if(r)return Oi(o[lm]===1),this.upgrade=!0,2;if(Oi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Uot]){let f=this.keepAlive?Ti.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[Wws],o[Vws]);h<=0?s[hb]=!0:o[jot]=h}else o[jot]=o[jws]}else s[hb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[TPe]&&(s[TPe]=!1,o[zF]()),d?CT.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[T2][r[Bw]];return Oi(c),Oi(this.timeoutType===Qot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Oi(o>=200),s>-1&&this.bytesRead+e.length>s?(Ti.destroy(n,new qws),-1):(this.bytesRead+=e.length,c.onData(e)===!1?CT.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;Oi(n>=100),Oi((this.headers.length&1)===0);let d=e[T2][e[Bw]];if(Oi(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 Ti.destroy(r,new L9n),-1;if(d.onComplete(s),e[T2][e[Bw]++]=null,r[zir]=e[Wir]===0,r[qj])return Oi(e[lm]===0),Ti.destroy(r,new cpe("reset")),CT.ERROR.PAUSED;if(u){if(r[hb]&&e[lm]===0)return Ti.destroy(r,new cpe("reset")),CT.ERROR.PAUSED;e[Uot]==null||e[Uot]===1?setImmediate(e[zF]):e[zF]()}else return Ti.destroy(r,new cpe("reset")),CT.ERROR.PAUSED;return 0}};function q9n(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===lpe?(!r[qj]||r.writableNeedDrain||o[lm]>1)&&(Oi(!s,"cannot be paused while waiting for headers"),Ti.destroy(r,new Bws)):n===Qot?s||Ti.destroy(r,new Uws):n===$ir&&(Oi(o[lm]===0&&o[jot]),Ti.destroy(r,new cpe("socket idle timeout")))}a(q9n,"onParserTimeout");function tRs(t,e){if(t[RZ]=e,jir||(jir=Xws()),e.errored)throw e.errored;if(e.destroyed)throw new xZ("destroyed");return e[bPe]=!1,e[qj]=!1,e[hb]=!1,e[TPe]=!1,e[kZ]=0,e[wZ]=null,e[zir]=!1,e[ud]=new Vir(t,e,jir),Ti.addListener(e,"error",rRs),Ti.addListener(e,"readable",nRs),Ti.addListener(e,"end",iRs),Ti.addListener(e,"close",oRs),e[Gir]=!1,e.on("close",sRs),{version:"h1",defaultPipelining:1,write(r){return uRs(t,r)},resume(){cRs(t)},destroy(r,n){e[Gir]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[qj]||e[hb]||e[TPe]||e[kZ]===1||r&&(t[lm]>0&&!r.idempotent||t[lm]>0&&(r.upgrade||r.method==="CONNECT")||t[lm]>0&&Ti.bodyLength(r.body)!==0&&(Ti.isStream(r.body)||Ti.isAsyncIterable(r.body)||Ti.isFormDataLike(r.body))))}}}a(tRs,"connectH1");function rRs(t){Oi(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[ud];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[uv]=r,this[qot][U9n](r));return}this[uv]=t,this[qot][U9n](t)}a(rRs,"onHttpSocketError");function nRs(){this[ud]?.readMore()}a(nRs,"onHttpSocketReadable");function iRs(){let t=this[ud];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Ti.destroy(this,e);return}Ti.destroy(this,new xZ("other side closed",Ti.getSocketInfo(this)))}a(iRs,"onHttpSocketEnd");function oRs(){let t=this[ud];W9n(this),t&&(!this[uv]&&t.statusCode&&!t.shouldKeepAlive&&(this[uv]=t.finish()||this[uv]),this[ud].destroy(),this[ud]=null);let e=this[uv]||new xZ("closed",Ti.getSocketInfo(this)),r=this[qot];if(r[RZ]=null,r[V9n]=null,r.destroyed){Oi(r[Wir]===0);let n=r[T2].splice(r[Bw]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[T2][r[Bw]];r[T2][r[Bw]++]=null,Ti.errorRequest(r,n,e)}r[Gws]=r[Bw],Oi(r[lm]===0),r.emit("disconnect",r[$9n],[r],e),r[zF]()}a(oRs,"onHttpSocketClose");function sRs(){this[Gir]=!0}a(sRs,"onSocketClose");function W9n(t){t[wZ]&&(clearTimeout(t[wZ]),t[wZ]=null),t[kZ]=0}a(W9n,"clearIdleSocketValidation");function aRs(t,e){e[kZ]=1,e[wZ]=setTimeout(()=>{e[wZ]=null,e[kZ]=2,t[RZ]===e&&!e.destroyed&&t[zF]()},0),e[wZ].unref?.()}a(aRs,"scheduleIdleSocketValidation");function cRs(t){let e=t[RZ];if(e&&!e.destroyed){if(t[B9n]===0?!e[bPe]&&e.unref&&(e.unref(),e[bPe]=!0):e[bPe]&&e.ref&&(e.ref(),e[bPe]=!1),t[lm]===0&&t[Wir]>0&&e[zir]){if(e[kZ]===0)return aRs(t,e),e[ud].readMore(),e.destroyed,void 0;if(e[kZ]===1)return e[ud].readMore(),e.destroyed,void 0}if(t[lm]===0&&(e[ud].readMore(),e.destroyed))return;if(t[B9n]===0)e[ud].timeoutType!==$ir&&e[ud].setTimeout(t[jot],$ir);else if(t[lm]>0&&e[ud].statusCode<200&&e[ud].timeoutType!==lpe){let r=t[T2][t[Bw]],n=r.headersTimeout!=null?r.headersTimeout:t[zws];e[ud].setTimeout(n,lpe)}}}a(cRs,"resumeH1");function lRs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(lRs,"shouldSendContentLength");function uRs(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(Ti.isFormDataLike(u)){qir||(qir=ape().extractBody);let[E,_]=qir(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ti.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ti.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),lRs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[Hir])return Ti.errorRequest(t,e,new IZ),!1;process.emitWarning(new IZ)}let g=t[RZ];W9n(g);let A=a(E=>{e.aborted||e.completed||(Ti.errorRequest(t,e,E||new G9n),Ti.destroy(u),Ti.destroy(g,new cpe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ti.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[hb]=!0),(s||r==="CONNECT")&&(g[hb]=!0),l!=null&&(g[hb]=l),t[F9n]&&g[Kws]++>=t[F9n]&&(g[hb]=!0),c&&(g[TPe]=!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[Fws],s?y+=`connection: upgrade\r +`:y+=t[Hws],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[Lot]&&!g[hb]?y+=`connection: keep-alive\r +`:t[Uot]&&!g[hb]?y+=`connection: keep-alive\r `:y+=`connection: close\r `,Array.isArray(d))for(let E=0;E{e.removeListener("error",g)}),!u){let A=new H9n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Oi(o.destroyed||o[Qj]&&r[lm]<=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")?Ti.destroy(e,A):Ti.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(sRs,"writeStream");function q9n(t,e,r,n,o,s,c,l){try{e?Ti.isBuffer(e)&&(Oi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return O9n.sendHeaders.hasSubscribers&&O9n.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?j9n(A,null,t,e,g,f,y,h):Ti.isBuffer(u)?j9n(A,u,t,e,g,f,y,h):Ti.isBlobLike(u)?typeof u.stream=="function"?H9n(A,u.stream(),t,e,g,f,y,h):fRs(A,u,t,e,g,f,y,h):Ti.isStream(u)?dRs(A,u,t,e,g,f,y,h):Ti.isIterable(u)?H9n(A,u,t,e,g,f,y,h):Oi(!1),!0}a(uRs,"writeH1");function dRs(t,e,r,n,o,s,c,l){Oi(s!==0||r[lm]===0,"stream body cannot be pipelined");let u=!1,d=new Hot({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){Ti.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 G9n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Oi(o.destroyed||o[qj]&&r[lm]<=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")?Ti.destroy(e,A):Ti.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(dRs,"writeStream");function j9n(t,e,r,n,o,s,c,l){try{e?Ti.isBuffer(e)&&(Oi(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[hb]=!0)):s===0?o.write(`${c}content-length: 0\r \r `,"latin1"):(Oi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[WF]()}catch(u){t(u)}}a(q9n,"writeBuffer");async function aRs(t,e,r,n,o,s,c,l){Oi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new IZ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r +`,"latin1")),n.onRequestSent(),r[zF]()}catch(u){t(u)}}a(j9n,"writeBuffer");async function fRs(t,e,r,n,o,s,c,l){Oi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new IZ;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[hb]=!0),r[WF]()}catch(u){t(u)}}a(aRs,"writeBlob");async function j9n(t,e,r,n,o,s,c,l){Oi(s!==0||r[lm]===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)=>{Oi(u===null),o[lv]?g(o[lv]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Qot({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[lv])throw o[lv];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(j9n,"writeIterable");var Qot=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[Qj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[lv])throw r[lv];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[jir])throw new IZ;process.emitWarning(new IZ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[hb]=!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[hb]=!0),r[zF]()}catch(u){t(u)}}a(fRs,"writeBlob");async function H9n(t,e,r,n,o,s,c,l){Oi(s!==0||r[lm]===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)=>{Oi(u===null),o[uv]?g(o[uv]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Hot({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[uv])throw o[uv];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(H9n,"writeIterable");var Hot=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[qj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[uv])throw r[uv];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[Hir])throw new IZ;process.emitWarning(new IZ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[hb]=!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[ud].timeout&&r[ud].timeoutType===lpe&&r[ud].timeout.refresh&&r[ud].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[Qj]=!1,e[lv])throw e[lv];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[ud].timeout&&r[ud].timeoutType===lpe&&r[ud].timeout.refresh&&r[ud].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[qj]=!1,e[uv])throw e[uv];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[jir])throw new IZ;process.emitWarning(new IZ)}e[ud].timeout&&e[ud].timeoutType===lpe&&e[ud].timeout.refresh&&e[ud].timeout.refresh(),n[WF]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[Qj]=!1,e&&(Oi(n[lm]<=1,"pipeline should only contain this request"),o(e))}};W9n.exports=Kws});var nUn=I((faf,rUn)=>{"use strict";p();var Fw=require("node:assert"),{pipeline:cRs}=require("node:stream"),ys=Po(),{RequestContentLengthMismatchError:Jir,RequestAbortedError:lRs,SocketError:RPe,InformationalError:qj,InvalidArgumentError:uRs}=ao(),{kUrl:wPe,kReset:Got,kClient:vT,kRunning:kPe,kPending:dRs,kQueue:jj,kPendingIdx:Xir,kRunningIdx:T2,kError:CT,kSocket:xf,kStrictContentLength:fRs,kOnError:upe,kMaxConcurrentStreams:jot,kPingInterval:Y9n,kHTTP2Session:zF,kHTTP2InitialWindowSize:pRs,kHTTP2ConnectionWindowSize:hRs,kResume:D5,kSize:mRs,kHTTPContext:eor,kClosed:Zir,kBodyTimeout:gRs,kEnableConnectProtocol:IPe,kRemoteSettings:xPe,kHTTP2Stream:qot,kHTTP2SessionState:tor}=al(),{channels:K9n}=Bj(),Bw=Symbol("open streams"),J9n,Hot;try{Hot=require("node:http2")}catch{Hot={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:ARs,HTTP2_HEADER_METHOD:Z9n,HTTP2_HEADER_PATH:X9n,HTTP2_HEADER_SCHEME:zir,HTTP2_HEADER_CONTENT_LENGTH:yRs,HTTP2_HEADER_EXPECT:ERs,HTTP2_HEADER_STATUS:Yir,HTTP2_HEADER_PROTOCOL:_Rs,NGHTTP2_REFUSED_STREAM:vRs,NGHTTP2_CANCEL:CRs}}=Hot;function Kir(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(Kir,"parseH2Headers");function bRs(t,e){t[xf]=e;let r=t[pRs],n=t[hRs],o=Hot.connect(t[wPe],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[jot],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[xf]=e,o[Bw]=0,o[vT]=t,o[xf]=e,o[tor]={ping:{interval:t[Y9n]===0?null:setInterval(xRs,t[Y9n],o).unref()}},o[IPe]=!1,o[xPe]=!1,n&&ys.addListener(o,"connect",TRs.bind(o,n)),ys.addListener(o,"error",wRs),ys.addListener(o,"frameError",RRs),ys.addListener(o,"end",kRs),ys.addListener(o,"goaway",PRs),ys.addListener(o,"close",DRs),ys.addListener(o,"remoteSettings",IRs),o.unref(),t[zF]=o,e[zF]=o,ys.addListener(e,"error",MRs),ys.addListener(e,"end",ORs),ys.addListener(e,"close",NRs),e[Zir]=!1,e.on("close",LRs),{version:"h2",defaultPipelining:1/0,write(s){return FRs(t,s)},resume(){SRs(t)},destroy(s,c){e[Zir]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[kPe]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[xPe]===!1||ys.bodyLength(s.body)!==0&&(ys.isStream(s.body)||ys.isAsyncIterable(s.body)||ys.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[xPe]===!1;return!1}}}a(bRs,"connectH2");function SRs(t){let e=t[xf];e?.destroyed===!1&&(t[mRs]===0||t[jot]===0?(e.unref(),t[zF].unref()):(e.ref(),t[zF].ref()))}a(SRs,"resumeH2");function TRs(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(TRs,"applyConnectionWindowSize");function IRs(t){if(this[vT][jot]=t.maxConcurrentStreams??this[vT][jot],this[xPe]===!0&&this[IPe]===!0&&t.enableConnectProtocol===!1){let e=new qj("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[xf][CT]=e,this[vT][upe](e);return}this[IPe]=t.enableConnectProtocol??this[IPe],this[xPe]=!0,this[vT][D5]()}a(IRs,"onHttp2RemoteSettings");function xRs(t){let e=t[tor];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[vT],c=this[vT];if(n!=null){let l=new qj(`HTTP/2: "PING" errored - type ${n.message}`);c[CT]=l,s[upe](l)}else s.emit("ping",o)}a(r,"onPing")}a(xRs,"onHttp2SendPing");function wRs(t){Fw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[xf][CT]=t,this[vT][upe](t)}a(wRs,"onHttp2SessionError");function RRs(t,e,r){if(r===0){let n=new qj(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[xf][CT]=n,this[vT][upe](n)}}a(RRs,"onHttp2FrameError");function kRs(){let t=new RPe("other side closed",ys.getSocketInfo(this[xf]));this.destroy(t),ys.destroy(this[xf],t)}a(kRs,"onHttp2SessionEnd");function PRs(t){let e=this[CT]||new RPe(`HTTP/2: "GOAWAY" frame received with code ${t}`,ys.getSocketInfo(this[xf])),r=this[vT];if(r[xf]=null,r[eor]=null,this.close(),this[zF]=null,ys.destroy(this[xf],e),r[T2]{e.aborted||e.completed||(x=x||new lRs,ys.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[upe](x),t[D5]()),ys.destroy(m,x))},"abort");try{e.onConnect(_)}catch(x){ys.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[IPe]===!1?(ys.errorRequest(t,e,new qj("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[Z9n]="CONNECT",g[_Rs]="websocket",g[X9n]=s,f==="ws:"||f==="wss:"?g[zir]=f==="ws:"?"http":"https":g[zir]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[qot]=!0,A.once("response",(x,P)=>{let{[Yir]:D,...N}=x;e.onUpgrade(D,Kir(N),A),++n[Bw],t[jj][t[T2]++]=null}),A.on("error",()=>{(A.rstCode===vRs||A.rstCode===CRs)&&_(new qj(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[Bw]-=1,n[Bw]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[qot]=!0,A.on("response",x=>{let{[Yir]:P,...D}=x;e.onUpgrade(P,Kir(D),A),++n[Bw],t[jj][t[T2]++]=null}),A.once("close",()=>{n[Bw]-=1,n[Bw]===0&&n.unref()}),A.setTimeout(r),!0);g[X9n]=s,g[zir]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let b=ys.bodyLength(m);if(ys.isFormDataLike(m)){J9n??=ape().extractBody;let[x,P]=J9n(m);g["content-type"]=P,m=x.stream,b=x.length}if(b==null&&(b=e.contentLength),v||(b=null),BRs(o)&&b>0&&e.contentLength!=null&&e.contentLength!==b){if(t[fRs])return ys.errorRequest(t,e,new Jir),!1;process.emitWarning(new Jir)}if(b!=null&&(Fw(m||b===0,"no body must not have content length"),g[yRs]=`${b}`),n.ref(),K9n.sendHeaders.hasSubscribers){let x="";for(let P in g)x+=`${P}: ${g[P]}\r -`;K9n.sendHeaders.publish({request:e,headers:x,socket:n[xf]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[ERs]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[qot]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[qot]=!0,R()),++n[Bw],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[Yir]:P,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(P),Kir(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[jj][t[T2]++]=null,t[D5]()):(_(new qj("HTTP/2: stream half-closed (remote)")),t[jj][t[T2]++]=null,t[Xir]=t[T2],t[D5]())}),A.once("close",()=>{A.removeAllListeners("data"),n[Bw]-=1,n[Bw]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),_(x)}),A.once("frameError",(x,P)=>{A.removeAllListeners("data"),_(new qj(`HTTP/2: "frameError" received - type ${x}, code ${P}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new qj(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[Bw]-=1,n[Bw]===0&&n.unref(),_(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||b===0?eUn(_,A,null,t,e,t[xf],b,v):ys.isBuffer(m)?eUn(_,A,m,t,e,t[xf],b,v):ys.isBlobLike(m)?typeof m.stream=="function"?tUn(_,A,m.stream(),t,e,t[xf],b,v):QRs(_,A,m,t,e,t[xf],b,v):ys.isStream(m)?URs(_,t[xf],v,A,m,t,e,b):ys.isIterable(m)?tUn(_,A,m,t,e,t[xf],b,v):Fw(!1)}a(R,"writeBodyH2")}a(FRs,"writeH2");function eUn(t,e,r,n,o,s,c,l){try{r!=null&&ys.isBuffer(r)&&(Fw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Got]=!0),o.onRequestSent(),n[D5]()}catch(u){t(u)}}a(eUn,"writeBuffer");function URs(t,e,r,n,o,s,c,l){Fw(l!==0||s[kPe]===0,"stream body cannot be pipelined");let u=cRs(o,n,f=>{f?(ys.destroy(u,f),t(f)):(ys.removeAllListeners(u),c.onRequestSent(),r||(e[Got]=!0),s[D5]())});ys.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(URs,"writeStream");async function QRs(t,e,r,n,o,s,c,l){Fw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new Jir;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Got]=!0),n[D5]()}catch(u){t(u)}}a(QRs,"writeBlob");async function tUn(t,e,r,n,o,s,c,l){Fw(c!==0||n[kPe]===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)=>{Fw(u===null),s[CT]?m(s[CT]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[CT])throw s[CT];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Got]=!0),n[D5]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(tUn,"writeIterable");rUn.exports=bRs});var Vj=I((maf,dUn)=>{"use strict";p();var YF=require("node:assert"),aUn=require("node:net"),PPe=require("node:http"),PZ=Po(),{ClientStats:qRs}=Wnr(),{channels:dpe}=Bj(),jRs=v6n(),HRs=vZ(),{InvalidArgumentError:dd,InformationalError:GRs,ClientDestroyedError:$Rs}=ao(),VRs=CZ(),{kUrl:N5,kServerName:$j,kClient:WRs,kBusy:nor,kConnect:zRs,kResuming:DZ,kRunning:OPe,kPending:LPe,kSize:DPe,kQueue:I2,kConnected:YRs,kConnecting:fpe,kNeedDrain:Gj,kKeepAliveDefaultTimeout:iUn,kHostHeader:KRs,kPendingIdx:x2,kRunningIdx:JF,kError:JRs,kPipelining:$ot,kKeepAliveTimeoutValue:ZRs,kMaxHeadersSize:XRs,kKeepAliveMaxTimeout:eks,kKeepAliveTimeoutThreshold:tks,kHeadersTimeout:rks,kBodyTimeout:nks,kStrictContentLength:iks,kConnector:NPe,kMaxRequests:ior,kCounter:oks,kClose:sks,kDestroy:aks,kDispatch:cks,kLocalAddress:MPe,kMaxResponseSize:lks,kOnError:uks,kHTTPContext:ch,kMaxConcurrentStreams:dks,kHTTP2InitialWindowSize:fks,kHTTP2ConnectionWindowSize:pks,kResume:KF,kPingInterval:hks}=al(),mks=z9n(),gks=nUn(),Hj=Symbol("kClosedResolve"),Aks=PPe&&PPe.maxHeaderSize&&Number.isInteger(PPe.maxHeaderSize)&&PPe.maxHeaderSize>0?()=>PPe.maxHeaderSize:()=>{throw new dd("http module not available or http.maxHeaderSize invalid")},oUn=a(()=>{},"noop");function cUn(t){return t[$ot]??t[ch]?.defaultPipelining??1}a(cUn,"getPipelining");var oor=class extends HRs{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:E,strictContentLength:_,maxCachedSessions:v,connect:b,maxRequestsPerClient:T,localAddress:w,maxResponseSize:R,autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P,maxConcurrentStreams:D,allowH2:N,useH2c:L,initialWindowSize:B,connectionWindowSize:q,pingInterval:M,webSocket:O}={}){if(d!==void 0)throw new dd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new dd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new dd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new dd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new dd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new dd("invalid maxHeaderSize")}else r=Aks();if(A!=null&&typeof A!="string")throw new dd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new dd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new dd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new dd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new dd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new dd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new dd("bodyTimeout must be a positive integer or zero");if(b!=null&&typeof b!="function"&&typeof b!="object")throw new dd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new dd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||aUn.isIP(w)===0))throw new dd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new dd("maxResponseSize must be a positive number");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new dd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new dd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new dd("maxConcurrentStreams must be a positive integer, greater than 0");if(L!=null&&typeof L!="boolean")throw new dd("useH2c must be a valid boolean value");if(B!=null&&(!Number.isInteger(B)||B<1))throw new dd("initialWindowSize must be a positive integer, greater than 0");if(q!=null&&(!Number.isInteger(q)||q<1))throw new dd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new dd("pingInterval must be a positive integer, greater or equal to 0");if(super({webSocket:O}),typeof b!="function")b=VRs({...E,maxCachedSessions:v,allowH2:N,useH2c:L,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P}:void 0,...b});else{let j=b;b=a((Q,U)=>j({...Q,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},U),"connect")}this[N5]=PZ.parseOrigin(e),this[NPe]=b,this[$ot]=y??1,this[XRs]=r,this[iUn]=f??4e3,this[eks]=m??6e5,this[tks]=g??2e3,this[ZRs]=this[iUn],this[$j]=null,this[MPe]=w??null,this[DZ]=0,this[Gj]=0,this[KRs]=`host: ${this[N5].hostname}${this[N5].port?`:${this[N5].port}`:""}\r -`,this[nks]=l??3e5,this[rks]=n??3e5,this[iks]=_??!0,this[ior]=T,this[Hj]=null,this[lks]=R>-1?R:-1,this[ch]=null,this[dks]=D??100,this[fks]=B??262144,this[pks]=q??524288,this[hks]=M??6e4,this[I2]=[],this[JF]=0,this[x2]=0,this[KF]=j=>sor(this,j),this[uks]=j=>lUn(this,j)}get pipelining(){return this[$ot]}set pipelining(e){this[$ot]=e,this[KF](!0)}get stats(){return new qRs(this)}get[LPe](){return this[I2].length-this[x2]}get[OPe](){return this[x2]-this[JF]}get[DPe](){return this[I2].length-this[JF]}get[YRs](){return!!this[ch]&&!this[fpe]&&!this[ch].destroyed}get[nor](){return!!(this[ch]?.busy(null)||this[DPe]>=(cUn(this)||1)||this[LPe]>0)}[zRs](e){uUn(this),this.once("connect",e)}[cks](e,r){let n=new jRs(this[N5].origin,e,r);return this[I2].push(n),this[DZ]||(PZ.bodyLength(n.body)==null&&PZ.isIterable(n.body)?(this[DZ]=1,queueMicrotask(()=>sor(this))):this[KF](!0)),this[DZ]&&this[Gj]!==2&&this[nor]&&(this[Gj]=2),this[Gj]<2}[sks](){return new Promise(e=>{this[DPe]?this[Hj]=e:e(null)})}[aks](e){return new Promise(r=>{let n=this[I2].splice(this[x2]);for(let s=0;s{this[Hj]&&(this[Hj](),this[Hj]=null),r(null)},"callback");this[ch]?(this[ch].destroy(e,o),this[ch]=null):queueMicrotask(o),this[KF]()})}};function lUn(t,e){if(t[OPe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){YF(t[x2]===t[JF]);let r=t[I2].splice(t[JF]);for(let n=0;n{if(s){ror(t,s,{host:e,hostname:r,protocol:n,port:o}),t[KF]();return}if(t.destroyed){PZ.destroy(c.on("error",oUn),new $Rs),t[KF]();return}YF(c);try{t[ch]=c.alpnProtocol==="h2"?gks(t,c):mks(t,c)}catch(l){c.destroy().on("error",oUn),ror(t,l,{host:e,hostname:r,protocol:n,port:o}),t[KF]();return}t[fpe]=!1,c[oks]=0,c[ior]=t[ior],c[WRs]=t,c[JRs]=null,dpe.connected.hasSubscribers&&dpe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ch]?.version,servername:t[$j],localAddress:t[MPe]},connector:t[NPe],socket:c}),t.emit("connect",t[N5],[t]),t[KF]()})}catch(s){ror(t,s,{host:e,hostname:r,protocol:n,port:o}),t[KF]()}}a(uUn,"connect");function ror(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[fpe]=!1,dpe.connectError.hasSubscribers&&dpe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[ch]?.version,servername:t[$j],localAddress:t[MPe]},connector:t[NPe],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(YF(t[OPe]===0);t[LPe]>0&&t[I2][t[x2]].servername===t[$j];){let c=t[I2][t[x2]++];PZ.errorRequest(t,c,e)}else lUn(t,e);t.emit("connectionError",t[N5],[t],e)}}a(ror,"handleConnectError");function sUn(t){t[Gj]=0,t.emit("drain",t[N5],[t])}a(sUn,"emitDrain");function sor(t,e){t[DZ]!==2&&(t[DZ]=2,yks(t,e),t[DZ]=0,t[JF]>256&&(t[I2].splice(0,t[JF]),t[x2]-=t[JF],t[JF]=0))}a(sor,"resume");function yks(t,e){for(;;){if(t.destroyed){YF(t[LPe]===0);return}if(t[Hj]&&!t[DPe]){t[Hj](),t[Hj]=null;return}if(t[ch]&&t[ch].resume(),t[nor])t[Gj]=2;else if(t[Gj]===2){e?(t[Gj]=1,queueMicrotask(()=>sUn(t))):sUn(t);continue}if(t[LPe]===0||t[OPe]>=(cUn(t)||1))return;let r=t[I2][t[x2]];if(r===null)return;if(t[N5].protocol==="https:"&&t[$j]!==r.servername){if(t[OPe]>0)return;t[$j]=r.servername,t[ch]?.destroy(new GRs("servername changed"),()=>{t[ch]=null,sor(t)})}if(t[fpe])return;if(!t[ch]){uUn(t);return}if(t[ch].destroyed||t[ch].busy(r))return;!r.aborted&&t[ch].write(r)?t[x2]++:t[I2].splice(t[x2],1)}}a(yks,"_resume");dUn.exports=oor});var aor=I((Eaf,fUn)=>{"use strict";p();var Vot=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)}};fUn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Vot}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Vot),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 Wot=I((Caf,vUn)=>{"use strict";p();var{PoolStats:Eks}=Wnr(),_ks=vZ(),vks=aor(),{kConnected:cor,kSize:pUn,kRunning:hUn,kPending:mUn,kQueued:BPe,kBusy:Cks,kFree:bks,kUrl:Sks,kClose:Tks,kDestroy:Iks,kDispatch:xks}=al(),Mg=Symbol("clients"),uv=Symbol("needDrain"),FPe=Symbol("queue"),lor=Symbol("closed resolve"),uor=Symbol("onDrain"),gUn=Symbol("onConnect"),AUn=Symbol("onDisconnect"),yUn=Symbol("onConnectionError"),dor=Symbol("get dispatcher"),EUn=Symbol("add client"),_Un=Symbol("remove client"),por=class extends _ks{static{a(this,"PoolBase")}[FPe]=new vks;[BPe]=0;[Mg]=[];[uv]=!1;[uor](e,r,n){let o=this[FPe],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[BPe]--,s=!e.dispatch(c.opts,c.handler)}if(e[uv]=s,!s&&this[uv]&&(this[uv]=!1,this.emit("drain",r,[this,...n])),this[lor]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[AUn]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[yUn]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[Cks](){return this[uv]}get[cor](){let e=0;for(let{[cor]:r}of this[Mg])e+=r;return e}get[bks](){let e=0;for(let{[cor]:r,[uv]:n}of this[Mg])e+=r&&!n;return e}get[mUn](){let e=this[BPe];for(let{[mUn]:r}of this[Mg])e+=r;return e}get[hUn](){let e=0;for(let{[hUn]:r}of this[Mg])e+=r;return e}get[pUn](){let e=this[BPe];for(let{[pUn]:r}of this[Mg])e+=r;return e}get stats(){return new Eks(this)}[Tks](){if(this[FPe].isEmpty()){let e=[];for(let r=0;r{this[lor]=e})}[Iks](e){for(;;){let n=this[FPe].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[Mg].length);for(let n=0;n{this[uv]&&this[uor](e,e[Sks],[e,this])}),this}[_Un](e){e.close(()=>{let r=this[Mg].indexOf(e);r!==-1&&this[Mg].splice(r,1)}),this[uv]=this[Mg].some(r=>!r[uv]&&r.closed!==!0&&r.destroyed!==!0)}};vUn.exports={PoolBase:por,kClients:Mg,kNeedDrain:uv,kAddClient:EUn,kRemoveClient:_Un,kGetDispatcher:dor}});var NZ=I((Taf,TUn)=>{"use strict";p();var{PoolBase:wks,kClients:zot,kNeedDrain:Rks,kAddClient:kks,kGetDispatcher:Pks,kRemoveClient:Dks}=Wot(),Nks=Vj(),{InvalidArgumentError:hor}=ao(),CUn=Po(),{kUrl:bUn}=al(),Mks=CZ(),Yot=Symbol("options"),mor=Symbol("connections"),SUn=Symbol("factory");function Oks(t,e){return new Nks(t,e)}a(Oks,"defaultFactory");var gor=class extends wks{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=Oks,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 hor("invalid connections");if(typeof n!="function")throw new hor("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new hor("connect must be a function or an object");typeof o!="function"&&(o=Mks({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(g),this[mor]=r||null,this[bUn]=CUn.parseOrigin(e),this[Yot]={...CUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[Yot].interceptors=g.interceptors?{...g.interceptors}:void 0,this[SUn]=n,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[zot].indexOf(_);v!==-1&&this[zot].splice(v,1)}})}[Pks](){let e=this[Yot].clientTtl;for(let r of this[zot])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[Dks](r);else if(!r[Rks])return r;if(!this[mor]||this[zot].length{"use strict";p();var{BalancedPoolMissingUpstreamError:Lks,InvalidArgumentError:Bks}=ao(),{PoolBase:Fks,kClients:VA,kNeedDrain:UPe,kAddClient:Uks,kRemoveClient:Qks,kGetDispatcher:qks}=Wot(),jks=NZ(),{kUrl:Kot}=al(),Jot=Po(),IUn=Symbol("factory"),QPe=Symbol("options"),xUn=Symbol("kGreatestCommonDivisor"),MZ=Symbol("kCurrentWeight"),OZ=Symbol("kIndex"),Uw=Symbol("kWeight"),Zot=Symbol("kMaxWeightPerServer"),Xot=Symbol("kErrorPenalty");function Hks(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Hks,"getGreatestCommonDivisor");function Gks(t,e){return new jks(t,e)}a(Gks,"defaultFactory");var Aor=class extends Fks{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Gks,...n}={}){if(typeof r!="function")throw new Bks("factory must be a function.");super(n),this[QPe]={...Jot.deepClone(n)},this[QPe].interceptors=n.interceptors?{...n.interceptors}:void 0,this[OZ]=-1,this[MZ]=0,this[Zot]=this[QPe].maxWeightPerServer||100,this[Xot]=this[QPe].errorPenalty||15,Array.isArray(e)||(e=[e]),this[IUn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=Jot.parseOrigin(e).origin;if(this[VA].find(o=>o[Kot].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[IUn](r,this[QPe]);this[Uks](n),n.on("connect",()=>{n[Uw]=Math.min(this[Zot],n[Uw]+this[Xot])}),n.on("connectionError",()=>{n[Uw]=Math.max(1,n[Uw]-this[Xot]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Uw]=Math.max(1,n[Uw]-this[Xot]),this._updateBalancedPoolStats())});for(let o of this[VA])o[Uw]=this[Zot];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Kot].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[Qks](n),this}getUpstream(e){let r=Jot.parseOrigin(e).origin;return this[VA].find(n=>n[Kot].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[VA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Kot].origin)}[qks](){if(this[VA].length===0)throw new Lks;if(!this[VA].find(s=>!s[UPe]&&s.closed!==!0&&s.destroyed!==!0)||this[VA].map(s=>s[UPe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[VA].findIndex(s=>!s[UPe]);for(;n++this[VA][o][Uw]&&!s[UPe]&&(o=this[OZ]),this[OZ]===0&&(this[MZ]=this[MZ]-this[xUn],this[MZ]<=0&&(this[MZ]=this[Zot])),s[Uw]>=this[MZ]&&!s[UPe])return s}return this[MZ]=this[VA][o][Uw],this[OZ]=o,this[VA][o]}};wUn.exports=Aor});var NUn=I((Paf,DUn)=>{"use strict";p();var{PoolBase:$ks,kClients:est,kNeedDrain:Vks,kAddClient:kUn,kGetDispatcher:Wks,kRemoveClient:zks}=Wot(),Yks=Vj(),{InvalidArgumentError:yor}=ao(),PUn=Po(),{kUrl:Eor}=al(),Kks=CZ(),qPe=Symbol("options"),_or=Symbol("connections"),vor=Symbol("factory"),tst=Symbol("index");function Jks(t,e){return new Yks(t,e)}a(Jks,"defaultFactory");var Cor=class extends $ks{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=Jks,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 yor("invalid connections");if(typeof n!="function")throw new yor("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new yor("connect must be a function or an object");typeof o!="function"&&(o=Kks({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[_or]=r||null,this[Eor]=PUn.parseOrigin(e),this[qPe]={...PUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[qPe].interceptors=g.interceptors?{...g.interceptors}:void 0,this[vor]=n,this[tst]=-1,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[est].indexOf(_);v!==-1&&this[est].splice(v,1)}})}[Wks](){let e=this[qPe].clientTtl,r=this[est].length;if(r===0){let o=this[vor](this[Eor],this[qPe]);return this[kUn](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[zks](o),n++;continue}if(!o[Vks])return o;n++}if(!this[_or]||r{"use strict";p();var{InvalidArgumentError:rst,MaxOriginsReachedError:Zks}=ao(),{kClients:Qw,kRunning:MUn,kClose:Xks,kDestroy:ePs,kDispatch:tPs,kUrl:rPs}=al(),nPs=vZ(),iPs=NZ(),oPs=Vj(),sPs=Po(),OUn=Symbol("onConnect"),LUn=Symbol("onDisconnect"),BUn=Symbol("onConnectionError"),FUn=Symbol("onDrain"),UUn=Symbol("factory"),bor=Symbol("options"),jPe=Symbol("origins");function aPs(t,e){return e&&e.connections===1?new oPs(t,e):new iPs(t,e)}a(aPs,"defaultFactory");var Sor=class extends nPs{static{a(this,"Agent")}constructor({factory:e=aPs,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new rst("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new rst("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new rst("maxOrigins must be a number greater than 0");super(o),n&&typeof n!="function"&&(n={...n}),this[bor]={...sPs.deepClone(o),maxOrigins:r,connect:n},this[UUn]=e,this[Qw]=new Map,this[jPe]=new Set,this[FUn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[OUn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[LUn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[BUn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[MUn](){let e=0;for(let{dispatcher:r}of this[Qw].values())e+=r[MUn];return e}[tPs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new rst("opts.origin must be a non-empty string or URL.");if(this[jPe].size>=this[bor].maxOrigins&&!this[jPe].has(n))throw new Zks;let o=this[Qw].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[Qw].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[Qw].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[jPe].delete(n))},"closeClientIfUnused");s=this[UUn](e.origin,this[bor]).on("drain",this[FUn]).on("connect",(l,u)=>{let d=this[Qw].get(n);d&&(d.count+=1),this[OUn](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[LUn](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[BUn](l,u,d)}),this[Qw].set(n,{count:0,dispatcher:s}),this[jPe].add(n)}return s.dispatch(e,r)}[Xks](){let e=[];for(let{dispatcher:r}of this[Qw].values())e.push(r.close());return this[Qw].clear(),Promise.all(e)}[ePs](e){let r=[];for(let{dispatcher:n}of this[Qw].values())r.push(n.destroy(e));return this[Qw].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[Qw].values())r.stats&&(e[r[rPs].origin]=r.stats);return e}};QUn.exports=Sor});var HUn=I((Baf,jUn)=>{"use strict";p();var{Buffer:zj}=require("node:buffer"),Tor=require("node:net"),{InvalidArgumentError:Wj}=ao();function cPs(t){if(Tor.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:zj.from(r)}}if(Tor.isIPv6(t))return{type:4,buffer:qUn(t)};let e=zj.from(t,"utf8");if(e.length>255)throw new Wj("Domain name too long (max 255 bytes)");return{type:3,buffer:zj.concat([zj.from([e.length]),e])}}a(cPs,"parseAddress");function qUn(t){let e=zj.alloc(16),r=t;if(t.includes(".")){let o=t.lastIndexOf(":"),s=t.slice(o+1);if(Tor.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:fPs}=require("node:events"),{Buffer:BZ}=require("node:buffer"),{InvalidArgumentError:ppe,Socks5ProxyError:Yj}=ao(),{debuglog:pPs}=require("node:util"),{parseAddress:hPs}=HUn(),ZF=pPs("undici:socks5"),GUn=BZ.alloc(0),nst=5,hpe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},$Un={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},FZ={IPV4:1,DOMAIN:3,IPV6:4},M5={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},vE={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},Ior=class extends fPs{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new ppe("socket is required");this.socket=e,this.options=r,this.state=vE.INITIAL,this.buffer=GUn,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(hpe.USERNAME_PASSWORD),this.authMethods.push(hpe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){ZF("received data",e.length,"bytes in state",this.state),this.buffer=BZ.concat([this.buffer,e]);try{switch(this.state){case vE.HANDSHAKING:this.handleHandshakeResponse();break;case vE.AUTHENTICATING:this.handleAuthResponse();break;case vE.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){ZF("socket error",e),this.state=vE.ERROR,this.emit("error",e),this.destroy()}onClose(){ZF("socket closed"),this.state=vE.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=vE.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==vE.INITIAL)throw new ppe("Handshake already started");ZF("starting handshake with",this.authMethods.length,"auth methods"),this.state=vE.HANDSHAKING;let e=BZ.alloc(2+this.authMethods.length);e[0]=nst,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!==nst)throw new Yj(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===hpe.NO_ACCEPTABLE)throw new Yj("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),ZF("server selected auth method",r),r===hpe.NO_AUTH)this.markAuthenticated();else if(r===hpe.USERNAME_PASSWORD)this.state=vE.AUTHENTICATING,this.sendAuthRequest();else throw new Yj(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new ppe("Username and password required for authentication");ZF("sending username/password auth");let n=BZ.from(e),o=BZ.from(r);if(n.length>255||o.length>255)throw new ppe("Username or password too long");let s=BZ.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 Yj(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new Yj("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),ZF("authentication successful"),this.markAuthenticated()}connect(e,r){if(this.state===vE.CONNECTING||this.state===vE.CONNECTED)throw new ppe("Connection already in progress");if(this.state!==vE.AUTHENTICATED)throw new ppe("Client must be authenticated before CONNECT");ZF("connecting to",e,r),this.state=vE.CONNECTING;let n=this.buildConnectRequest($Un.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=hPs(r),c=BZ.alloc(4+s.length+2);return c[0]=nst,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!==nst)throw new Yj(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===FZ.IPV4)o+=6;else if(n===FZ.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===FZ.IPV6)o+=18;else throw new Yj(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var{URL:zUn}=require("node:url"),xor,mPs=vZ(),{InvalidArgumentError:YUn}=ao(),{Socks5Client:gPs,STATES:APs}=WUn(),{kDispatch:KUn,kClose:yPs,kDestroy:EPs}=al(),_Ps=NZ(),vPs=CZ(),{debuglog:CPs}=require("node:util"),Kj=CPs("undici:socks5-proxy"),wor=Symbol("proxy url"),bPs=Symbol("proxy headers"),JUn=Symbol("proxy auth"),ZUn=Symbol("proxy protocol"),UZ=Symbol("pools"),XUn=Symbol("connector"),Ror=Symbol("request tls settings"),e7n=!1,kor=class extends mPs{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),e7n||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),e7n=!0),!e)throw new YUn("Proxy URL is mandatory");let n=typeof e=="string"?new zUn(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new YUn("Proxy URL must use socks5:// or socks:// protocol");this[wor]=n,this[bPs]=r.headers||{},this[ZUn]=r.proxyTls?"https:":"http:",this[Ror]=r.requestTls,this[JUn]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[XUn]=r.connect||vPs({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[UZ]=new Map}async createSocks5Connection(e,r){let n=this[wor].hostname,o=parseInt(this[wor].port)||1080;Kj("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{this[XUn]({hostname:n,host:n,port:o,protocol:this[ZUn]},(d,f)=>{d?u(d):l(f)})}),c=new gPs(s,this[JUn]);return c.on("error",l=>{Kj("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===APs.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=>{Kj("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}[KUn](e,r){let{origin:n}=e;Kj("dispatching request to",n,"via SOCKS5");try{let o=String(n),s=this[UZ].get(o);return(!s||s.destroyed||s.closed)&&(s=new _Ps(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(c,l)=>{try{let u=new zUn(n),d=u.hostname,f=parseInt(u.port)||(u.protocol==="https:"?443:80);Kj("establishing SOCKS5 connection to",d,f);let h=await this.createSocks5Connection(d,f),m=h;u.protocol==="https:"&&(xor||(xor=require("node:tls")),Kj("upgrading to TLS"),m=xor.connect({...this[Ror],socket:h,servername:this[Ror]?.servername||d}),await new Promise((g,A)=>{m.once("secureConnect",g),m.once("error",A)})),l(null,m)}catch(u){Kj("SOCKS5 connection error:",u),l(u)}},"connect")}),this[UZ].set(o,s)),s[KUn](e,r)}catch(o){if(Kj("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[yPs](){let e=[];for(let r of this[UZ].values())e.push(r.close());this[UZ].clear(),await Promise.all(e)}async[EPs](e){let r=[];for(let n of this[UZ].values())r.push(n.destroy(e));this[UZ].clear(),await Promise.all(r)}};t7n.exports=kor});var Oor=I((Vaf,p7n)=>{"use strict";p();var{kProxy:mpe,kClose:c7n,kDestroy:l7n,kDispatch:r7n}=al(),SPs=LZ(),u7n=NZ(),d7n=vZ(),{InvalidArgumentError:QZ,RequestAbortedError:TPs,SecureProxyConnectionError:IPs}=ao(),n7n=CZ(),f7n=Vj(),{channels:i7n}=Bj(),xPs=Por(),ist=Symbol("proxy agent"),Jj=Symbol("proxy client"),XF=Symbol("proxy headers"),Dor=Symbol("request tls settings"),o7n=Symbol("proxy tls settings"),s7n=Symbol("connect endpoint function"),a7n=Symbol("tunnel proxy");function wPs(t){return t==="https:"?443:80}a(wPs,"defaultProtocolPort");function RPs(t,e){return new u7n(t,e)}a(RPs,"defaultFactory");var kPs=a(()=>{},"noop");function PPs(t,e){return e.connections===1?new f7n(t,e):new u7n(t,e)}a(PPs,"defaultAgentFactory");var Nor=class extends d7n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new QZ("Proxy URL is mandatory");super(),this[XF]=r,o?this.#e=o(e,{connect:n}):this.#e=new f7n(e,{connect:n})}[r7n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new QZ("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[XF],...c},this.#e[r7n](e,r)}[c7n](){return this.#e.close()}[l7n](e){return this.#e.destroy(e)}},Mor=class extends d7n{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new QZ("Proxy uri is mandatory");let{clientFactory:r=RPs}=e;if(typeof r!="function")throw new QZ("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[mpe]={uri:s,protocol:u},this[Dor]=e.requestTls,this[o7n]=e.proxyTls,this[XF]=e.headers||{},this[a7n]=n,e.auth&&e.token)throw new QZ("opts.auth cannot be used in combination with opts.token");e.auth?this[XF]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[XF]["proxy-authorization"]=e.token:d&&f&&(this[XF]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=n7n({...e.proxyTls});this[s7n]=n7n({...e.requestTls});let g=e.factory||PPs,A=a((y,E)=>{let{protocol:_}=new URL(y);return this[mpe].protocol==="socks5:"||this[mpe].protocol==="socks:"?new xPs(this[mpe].uri,{headers:this[XF],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls,requestTls:e.requestTls}):!this[a7n]&&_==="http:"&&this[mpe].protocol==="http:"?new Nor(this[mpe].uri,{headers:this[XF],connect:m,factory:g}):g(y,E)},"factory");u==="socks5:"||u==="socks:"?this[Jj]=null:this[Jj]=r(o,{connect:m}),this[ist]=new SPs({...e,factory:A,connect:a(async(y,E)=>{if(!this[Jj]){E(new QZ("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${wPs(y.protocol)}`);try{let v={origin:c,port:l,path:_,signal:y.signal,headers:{...this[XF],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[o7n]?.servername||h},{socket:b,statusCode:T}=await this[Jj].connect(v);if(T!==200){b.on("error",kPs).destroy(),E(new TPs(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(i7n.proxyConnected.hasSubscribers&&i7n.proxyConnected.publish({socket:b,connectParams:v}),y.protocol!=="https:"){E(null,b);return}let w;this[Dor]?w=this[Dor].servername:w=y.servername,this[s7n]({...y,servername:w,httpSocket:b},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new IPs(v)):E(v)}},"connect")})}dispatch(e,r){let n=DPs(e.headers);if(NPs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[ist].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[c7n](){let e=[this[ist].close()];return this[Jj]&&e.push(this[Jj].close()),Promise.all(e)}[l7n](){let e=[this[ist].destroy()];return this[Jj]&&e.push(this[Jj].destroy()),Promise.all(e)}};function DPs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new QZ("Proxy-Authorization should be sent in ProxyAgent constructor")}a(NPs,"throwIfProxyAuthIsSent");p7n.exports=Mor});var y7n=I((Yaf,A7n)=>{"use strict";p();var MPs=vZ(),{kClose:OPs,kDestroy:LPs,kClosed:h7n,kDestroyed:m7n,kDispatch:BPs,kNoProxyAgent:HPe,kHttpProxyAgent:Zj,kHttpsProxyAgent:qZ}=al(),g7n=Oor(),FPs=LZ(),UPs={"http:":80,"https:":443},Lor=class extends MPs{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[HPe]=new FPs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[Zj]=new g7n({...s,uri:c}):this[Zj]=this[HPe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[qZ]=new g7n({...s,uri:l}):this[qZ]=this[Zj],this.#o()}[BPs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[OPs](){return Promise.all([this[HPe].close(),!this[Zj][h7n]&&this[Zj].close(),!this[qZ][h7n]&&this[qZ].close()])}[LPs](e){return Promise.all([this[HPe].destroy(e),!this[Zj][m7n]&&this[Zj].destroy(e),!this[qZ][m7n]&&this[qZ].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||UPs[r]||0,this.#i(n,o)?r==="https:"?this[qZ]:this[Zj]:this[HPe]}#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 gpe=require("node:assert"),{kRetryHandlerDefaultRetry:E7n}=al(),{RequestRetryError:GPe}=ao(),QPs=hPe(),{isDisturbed:_7n,parseRangeHeader:v7n,wrapRequestBody:qPs}=Po();function jPs(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(jPs,"calculateRetryAfterHeader");var Bor=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=QPs.wrap(n),this.opts={...s,body:qPs(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[E7n],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(_7n(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[E7n](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:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?jPs(l["retry-after"]):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onResponseStart(e,r,n,o){if(this.error=null,this.retryCount+=1,r>=300){let s=new GPe("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 GPe("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=v7n(n["content-range"]);if(!s)throw new GPe("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new GPe("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});let{start:c,size:l,end:u=l?l-1:null}=s;gpe(this.start===c,"content-range mismatch"),gpe(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=v7n(n["content-range"]);if(s==null){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}let{start:c,size:l,end:u=l?l-1:null}=s;gpe(c!=null&&Number.isFinite(c),"content-range mismatch"),gpe(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}gpe(Number.isFinite(this.start)),gpe(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 GPe("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||_7n(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))}};C7n.exports=Bor});var S7n=I((tcf,b7n)=>{"use strict";p();var HPs=mPe(),GPs=ost(),For=class extends HPs{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 GPs({...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()}};b7n.exports=For});var x7n=I((icf,I7n)=>{"use strict";p();var{InvalidArgumentError:T7n}=ao(),$Ps=Vj(),Uor=class extends $Ps{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new T7n("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 T7n("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};I7n.exports=Uor});var L7n=I((acf,O7n)=>{"use strict";p();var P7n=require("node:assert"),{Readable:VPs}=require("node:stream"),{RequestAbortedError:D7n,NotSupportedError:WPs,InvalidArgumentError:zPs,AbortError:sst}=ao(),N7n=Po(),{ReadableStreamFrom:YPs}=Po(),bT=Symbol("kConsume"),ast=Symbol("kReading"),jZ=Symbol("kBody"),w7n=Symbol("kAbort"),M7n=Symbol("kContentType"),Qor=Symbol("kContentLength"),qor=Symbol("kUsed"),cst=Symbol("kBytesRead"),KPs=a(()=>{},"noop"),jor=class extends VPs{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[w7n]=r,this[bT]=null,this[cst]=0,this[jZ]=null,this[qor]=!1,this[M7n]=n,this[Qor]=Number.isFinite(o)?o:null,this[ast]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new D7n),e&&this[w7n](),this[qor]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[ast]=!0,this[qor]=!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[ast]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[cst]+=e.length,this[bT])?(Gor(this[bT],e),this[ast]?super.push(e):!0):super.push(e)}text(){return $Pe(this,"text")}json(){return $Pe(this,"json")}blob(){return $Pe(this,"blob")}bytes(){return $Pe(this,"bytes")}arrayBuffer(){return $Pe(this,"arrayBuffer")}async formData(){throw new WPs}get bodyUsed(){return N7n.isDisturbed(this)}get body(){return this[jZ]||(this[jZ]=YPs(this),this[bT]&&(this[jZ].getReader(),P7n(this[jZ].locked))),this[jZ]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new zPs("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 sst):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[Qor]&&this[Qor]>n||this[cst]>n)&&this.destroy(new sst),r){let c=a(()=>{this.destroy(r.reason??new sst)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new sst):o(null)})}else this.on("close",o);this.on("error",KPs).on("data",()=>{this[cst]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function JPs(t){return t[jZ]?.locked===!0||t[bT]!==null}a(JPs,"isLocked");function ZPs(t){return N7n.isDisturbed(t)||JPs(t)}a(ZPs,"isUnusable");function $Pe(t,e){return P7n(!t[bT]),new Promise((r,n)=>{if(ZPs(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[bT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){$or(this[bT],o)}).on("close",function(){this[bT].body!==null&&$or(this[bT],new D7n)}),XPs(t[bT])})})}a($Pe,"consume");function XPs(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(Hor,"chunksDecode");function R7n(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 e2s=require("node:assert"),{AsyncResource:t2s}=require("node:async_hooks"),{Readable:r2s}=L7n(),{InvalidArgumentError:Ape,RequestAbortedError:B7n}=ao(),qw=Po();function VPe(){}a(VPe,"noop");var lst=class extends t2s{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Ape("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 Ape("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new Ape("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Ape("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Ape("invalid method");if(l&&typeof l!="function")throw new Ape("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw qw.isStream(c)&&qw.destroy(c.on("error",VPe),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 B7n:n&&(this.removeAbortListener=qw.addAbortListener(n,()=>{this.reason=n.reason??new B7n,this.res?qw.destroy(this.res.on("error",VPe),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}e2s(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"?qw.parseRawHeaders(r):qw.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?qw.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new r2s({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(E){this.res=null,qw.destroy(y.on("error",VPe),E),queueMicrotask(()=>{throw E})}}onData(e){return this.res.push(e)}onComplete(e){qw.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(()=>{qw.destroy(r.on("error",VPe),e)})),o&&(this.body=null,qw.isStream(o)&&(o.on("error",VPe),qw.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function F7n(t,e){if(e===void 0)return new Promise((r,n)=>{F7n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new lst(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(F7n,"request");Vor.exports=F7n;Vor.exports.RequestHandler=lst});var WPe=I((pcf,j7n)=>{"use strict";p();var{addAbortListener:n2s}=Po(),{RequestAbortedError:i2s}=ao(),ype=Symbol("kListener"),O5=Symbol("kSignal");function Q7n(t){t.abort?t.abort(t[O5]?.reason):t.reason=t[O5]?.reason??new i2s,q7n(t)}a(Q7n,"abort");function o2s(t,e){if(t.reason=null,t[O5]=null,t[ype]=null,!!e){if(e.aborted){Q7n(t);return}t[O5]=e,t[ype]=()=>{Q7n(t)},n2s(t[O5],t[ype])}}a(o2s,"addSignal");function q7n(t){t[O5]&&("removeEventListener"in t[O5]?t[O5].removeEventListener("abort",t[ype]):t[O5].removeListener("abort",t[ype]),t[O5]=null,t[ype]=null)}a(q7n,"removeSignal");j7n.exports={addSignal:o2s,removeSignal:q7n}});var V7n=I((gcf,$7n)=>{"use strict";p();var s2s=require("node:assert"),{finished:a2s}=require("node:stream"),{AsyncResource:c2s}=require("node:async_hooks"),{InvalidArgumentError:Epe,InvalidReturnValueError:l2s}=ao(),e8=Po(),{addSignal:u2s,removeSignal:H7n}=WPe();function d2s(){}a(d2s,"noop");var Wor=class extends c2s{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Epe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new Epe("invalid callback");if(typeof r!="function")throw new Epe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Epe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Epe("invalid method");if(u&&typeof u!="function")throw new Epe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw e8.isStream(l)&&e8.destroy(l.on("error",d2s),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,e8.isStream(l)&&l.on("error",f=>{this.onError(f)}),u2s(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}s2s(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"?e8.parseRawHeaders(r):e8.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 l2s("expected Writable");return a2s(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(m||!A?.readable)&&e8.destroy(A,m),this.callback=null,this.runInAsyncScope(g,null,m||null,{opaque:y,trailers:E}),m&&_()}),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;H7n(this),r&&(this.trailers=e8.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;H7n(this),this.factory=null,r?(this.res=null,e8.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,e8.destroy(s,e))}};function G7n(t,e,r){if(r===void 0)return new Promise((n,o)=>{G7n.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new Wor(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(G7n,"stream");$7n.exports=G7n});var K7n=I((Ecf,Y7n)=>{"use strict";p();var{Readable:z7n,Duplex:f2s,PassThrough:p2s}=require("node:stream"),h2s=require("node:assert"),{AsyncResource:m2s}=require("node:async_hooks"),{InvalidArgumentError:zPe,InvalidReturnValueError:g2s,RequestAbortedError:zor}=ao(),L5=Po(),{addSignal:A2s,removeSignal:y2s}=WPe();function W7n(){}a(W7n,"noop");var _pe=Symbol("resume"),Yor=class extends z7n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[_pe]=null}_read(){let{[_pe]:e}=this;e&&(this[_pe]=null,e())}_destroy(e,r){this._read(),r(e)}},Kor=class extends z7n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[_pe]=e}_read(){this[_pe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new zor),r(e)}},Jor=class extends m2s{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new zPe("invalid opts");if(typeof r!="function")throw new zPe("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 zPe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new zPe("invalid method");if(c&&typeof c!="function")throw new zPe("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 Yor().on("error",W7n),this.ret=new f2s({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[_pe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new zor),A&&u&&A(),L5.destroy(f,u),L5.destroy(h,u),L5.destroy(m,u),y2s(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,A2s(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}h2s(!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"?L5.parseRawHeaders(r):L5.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Kor(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?L5.parseRawHeaders(r):L5.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",W7n),u}if(!l||typeof l.on!="function")throw new g2s("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;L5.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||L5.destroy(u,new zor)}),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,L5.destroy(r,e)}};function E2s(t,e){try{let r=new Jor(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new p2s().destroy(r)}}a(E2s,"pipeline");Y7n.exports=E2s});var rQn=I((Ccf,tQn)=>{"use strict";p();var{InvalidArgumentError:Zor,SocketError:_2s}=ao(),{AsyncResource:v2s}=require("node:async_hooks"),J7n=require("node:assert"),Z7n=Po(),{kHTTP2Stream:C2s}=al(),{addSignal:b2s,removeSignal:X7n}=WPe(),Xor=class extends v2s{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Zor("invalid opts");if(typeof r!="function")throw new Zor("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Zor("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,b2s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}J7n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new _2s("bad upgrade",null)}onUpgrade(e,r,n){J7n(n[C2s]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;X7n(this),this.callback=null;let l=this.responseHeaders==="raw"?Z7n.parseRawHeaders(r):Z7n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;X7n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function eQn(t,e){if(e===void 0)return new Promise((r,n)=>{eQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Xor(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(eQn,"upgrade");tQn.exports=eQn});var aQn=I((Tcf,sQn)=>{"use strict";p();var S2s=require("node:assert"),{AsyncResource:T2s}=require("node:async_hooks"),{InvalidArgumentError:esr,SocketError:I2s}=ao(),nQn=Po(),{addSignal:x2s,removeSignal:iQn}=WPe(),tsr=class extends T2s{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new esr("invalid opts");if(typeof r!="function")throw new esr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new esr("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,x2s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}S2s(this.callback),this.abort=e,this.context=r}onHeaders(){throw new I2s("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;iQn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?nQn.parseRawHeaders(r):nQn.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;iQn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function oQn(t,e){if(e===void 0)return new Promise((r,n)=>{oQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new tsr(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(oQn,"connect");sQn.exports=oQn});var cQn=I((wcf,vpe)=>{"use strict";p();vpe.exports.request=U7n();vpe.exports.stream=V7n();vpe.exports.pipeline=K7n();vpe.exports.upgrade=rQn();vpe.exports.connect=aQn()});var nsr=I((kcf,uQn)=>{"use strict";p();var{UndiciError:w2s}=ao(),lQn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),rsr=class extends w2s{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[lQn]===!0}get[lQn](){return!0}};uQn.exports={MockNotMatchedError:rsr}});var HZ=I((Ncf,dQn)=>{"use strict";p();dQn.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 YPe=I((Ocf,CQn)=>{"use strict";p();var{MockNotMatchedError:Cpe}=nsr(),{kDispatches:GZ,kMockAgent:R2s,kOriginalDispatch:k2s,kOrigin:P2s,kGetNetConnect:D2s,kTotalDispatchCount:ssr}=HZ(),{serializePathWithQuery:N2s}=Po(),{STATUS_CODES:M2s}=require("node:http"),{types:{isPromise:O2s}}=require("node:util"),{InvalidArgumentError:isr}=ao();function B5(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(B5,"matchValue");function pQn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(pQn,"lowerCaseEntries");function hQn(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=hQn(e,r);if(!B5(n,o))return!1}return!0}a(mQn,"matchHeaders");function L2s(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(L2s,"normalizeSearchParams");function osr(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(osr,"safeUrl");function B2s(t,{path:e,method:r,body:n,headers:o}){let s=B5(t.path,e),c=B5(t.method,r),l=typeof t.body<"u"?B5(t.body,n):!0,u=mQn(t,o);return s&&c&&l&&u}a(B2s,"matchKey");function gQn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(gQn,"getResponseData");function AQn(t,e){let r=e.query?N2s(e.path,e.query):e.path,n=typeof r=="string"?osr(r):r,o=fQn(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?B5(fQn(osr(c)),o):B5(osr(c),n));if(s.length===0)throw new Cpe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>B5(c,e.method)),s.length===0)throw new Cpe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?B5(c,e.body):!0),s.length===0)throw new Cpe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>mQn(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new Cpe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(AQn,"getMockDispatch");function F2s(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[ssr]=(t[ssr]||0)+1,c}a(F2s,"addMockDispatch");function asr(t,e){let r=t.findIndex(n=>n.consumed?B2s(n,e):!1);r!==-1&&t.splice(r,1)}a(asr,"deleteMockDispatch");function fQn(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(fQn,"removeTrailingSlash");function yQn(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(yQn,"buildKey");function csr(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,E(this[GZ])},d):E(this[GZ]);function E(v,b=s){if(g)return;let T=Array.isArray(t.headers)?lsr(t.headers):t.headers,w=typeof b=="function"?b({...t,headers:T}):b;if(O2s(w))return w.then(D=>E(v,D));if(g)return;let R=gQn(w),x=csr(c),P=csr(l);e.onHeaders?.(o,x,_,EQn(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(P),asr(v,r)}a(E,"handleReply");function _(){}return a(_,"resume"),!0}a(_Qn,"mockDispatch");function Q2s(){let t=this[R2s],e=this[P2s],r=this[k2s];return a(function(o,s){if(t.isMockActive)try{_Qn.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[D2s](),u=this[GZ][ssr]||this[GZ].length,f=`, ${this[GZ].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new Cpe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(vQn(l,e))r.call(this,o,s);else throw new Cpe(`${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(Q2s,"buildMockDispatch");function vQn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>B5(n,r.host)))}a(vQn,"checkNetConnect");function q2s(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(q2s,"normalizeOrigin");function j2s(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new isr("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new isr("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new isr("options.ignoreTrailingSlash must to be a boolean");return r}a(j2s,"buildAndValidateMockOptions");CQn.exports={getResponseData:gQn,getMockDispatch:AQn,addMockDispatch:F2s,deleteMockDispatch:asr,buildKey:yQn,generateKeyValues:csr,matchValue:B5,getResponse:U2s,getStatusText:EQn,mockDispatch:_Qn,buildMockDispatch:Q2s,checkNetConnect:vQn,buildAndValidateMockOptions:j2s,getHeaderByName:hQn,buildHeadersFromArray:lsr,normalizeSearchParams:L2s,normalizeOrigin:q2s}});var gsr=I((Fcf,msr)=>{"use strict";p();var{getResponseData:H2s,buildKey:G2s,addMockDispatch:usr}=YPe(),{kDispatches:ust,kDispatchKey:dst,kDefaultHeaders:dsr,kDefaultTrailers:fsr,kContentLength:psr,kMockDispatch:fst,kIgnoreTrailingSlash:pst}=HZ(),{InvalidArgumentError:F5}=ao(),{serializePathWithQuery:$2s}=Po(),bpe=class{static{a(this,"MockScope")}constructor(e){this[fst]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new F5("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 F5("repeatTimes must be a valid integer > 0");return this[fst].times=e,this}},hsr=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new F5("opts must be an object");if(typeof e.path>"u")throw new F5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=$2s(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]=G2s(e),this[ust]=r,this[pst]=e.ignoreTrailingSlash??!1,this[dsr]={},this[fsr]={},this[psr]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=H2s(r),s=this[psr]?{"content-length":o.length}:{},c={...this[dsr],...s,...n.headers},l={...this[fsr],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new F5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new F5("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 F5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=usr(this[ust],this[dst],s,{ignoreTrailingSlash:this[pst]});return new bpe(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=usr(this[ust],this[dst],n,{ignoreTrailingSlash:this[pst]});return new bpe(o)}replyWithError(e){if(typeof e>"u")throw new F5("error must be defined");let r=usr(this[ust],this[dst],{error:e},{ignoreTrailingSlash:this[pst]});return new bpe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new F5("headers must be defined");return this[dsr]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new F5("trailers must be defined");return this[fsr]=e,this}replyContentLength(){return this[psr]=!0,this}};msr.exports.MockInterceptor=hsr;msr.exports.MockScope=bpe});var _sr=I((qcf,RQn)=>{"use strict";p();var{promisify:V2s}=require("node:util"),W2s=Vj(),{buildMockDispatch:z2s}=YPe(),{kDispatches:Asr,kMockAgent:bQn,kClose:SQn,kOriginalClose:TQn,kOrigin:IQn,kOriginalDispatch:Y2s,kConnected:ysr,kIgnoreTrailingSlash:xQn}=HZ(),{MockInterceptor:K2s}=gsr(),wQn=al(),{InvalidArgumentError:J2s}=ao(),Esr=class extends W2s{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new J2s("Argument opts.agent must implement Agent");super(e,r),this[bQn]=r.agent,this[IQn]=e,this[xQn]=r.ignoreTrailingSlash??!1,this[Asr]=[],this[ysr]=1,this[Y2s]=this.dispatch,this[TQn]=this.close.bind(this),this.dispatch=z2s.call(this),this.close=this[SQn]}get[wQn.kConnected](){return this[ysr]}intercept(e){return new K2s(e&&{ignoreTrailingSlash:this[xQn],...e},this[Asr])}cleanMocks(){this[Asr]=[]}async[SQn](){await V2s(this[TQn])(),this[ysr]=0,this[bQn][wQn.kClients].delete(this[IQn])}};RQn.exports=Esr});var bsr=I((Gcf,Csr)=>{"use strict";p();var{kMockCallHistoryAddLog:Z2s}=HZ(),{InvalidArgumentError:tH}=ao();function Xj(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 tH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(Xj,"handleFilterCallsWithOptions");function X2s(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new tH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(X2s,"buildAndValidateFilterCallsOptions");function eH(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 tH(`${t} parameter should be one of string, regexp, undefined or null`)}}a(eH,"makeFilterCalls");function eDs(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 tH("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(eDs,"computeUrlWithMaybeSearchParameters");var hst=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=eDs(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)}},vsr=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 tH("nthCall must be called with a number");if(!Number.isInteger(e))throw new tH("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new tH("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",...X2s(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=Xj(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=Xj(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=Xj(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=Xj(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=Xj(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=Xj(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=Xj(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=Xj(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new tH("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=eH.call(this,"protocol");filterCallsByHost=eH.call(this,"host");filterCallsByPort=eH.call(this,"port");filterCallsByOrigin=eH.call(this,"origin");filterCallsByPath=eH.call(this,"path");filterCallsByHash=eH.call(this,"hash");filterCallsByFullUrl=eH.call(this,"fullUrl");filterCallsByMethod=eH.call(this,"method");clear(){this.logs=[]}[Z2s](e){let r=new hst(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};Csr.exports.MockCallHistory=vsr;Csr.exports.MockCallHistoryLog=hst});var xsr=I((Wcf,LQn)=>{"use strict";p();var{promisify:tDs}=require("node:util"),rDs=NZ(),{buildMockDispatch:nDs}=YPe(),{kDispatches:Ssr,kMockAgent:kQn,kClose:PQn,kOriginalClose:DQn,kOrigin:NQn,kOriginalDispatch:iDs,kConnected:Tsr,kIgnoreTrailingSlash:MQn}=HZ(),{MockInterceptor:oDs}=gsr(),OQn=al(),{InvalidArgumentError:sDs}=ao(),Isr=class extends rDs{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new sDs("Argument opts.agent must implement Agent");super(e,r),this[kQn]=r.agent,this[NQn]=e,this[MQn]=r.ignoreTrailingSlash??!1,this[Ssr]=[],this[Tsr]=1,this[iDs]=this.dispatch,this[DQn]=this.close.bind(this),this.dispatch=nDs.call(this),this.close=this[PQn]}get[OQn.kConnected](){return this[Tsr]}intercept(e){return new oDs(e&&{ignoreTrailingSlash:this[MQn],...e},this[Ssr])}cleanMocks(){this[Ssr]=[]}async[PQn](){await tDs(this[DQn])(),this[Tsr]=0,this[kQn][OQn.kClients].delete(this[NQn])}};LQn.exports=Isr});var FQn=I((Jcf,BQn)=>{"use strict";p();var{Transform:aDs}=require("node:stream"),{Console:cDs}=require("node:console"),lDs=process.versions.icu?"\u2705":"Y ",uDs=process.versions.icu?"\u274C":"N ";BQn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new aDs({transform(r,n,o){o(null,r)}}),this.logger=new cDs({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?lDs:uDs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var Dsr=I((elf,$Qn)=>{"use strict";p();var{kClients:$Z}=al(),dDs=LZ(),{kAgent:wsr,kMockAgentSet:mst,kMockAgentGet:UQn,kDispatches:Rsr,kIsMockActive:gst,kNetConnect:VZ,kGetNetConnect:fDs,kOptions:Ast,kFactory:yst,kMockAgentRegisterCallHistory:ksr,kMockAgentIsCallHistoryEnabled:KPe,kMockAgentAddCallHistoryLog:QQn,kMockAgentMockCallHistoryInstance:Spe,kMockAgentAcceptsNonStandardSearchParameters:qQn,kMockCallHistoryAddLog:pDs,kIgnoreTrailingSlash:jQn}=HZ(),hDs=_sr(),mDs=xsr(),{matchValue:gDs,normalizeSearchParams:ADs,buildAndValidateMockOptions:yDs,normalizeOrigin:HQn}=YPe(),{InvalidArgumentError:GQn,UndiciError:EDs}=ao(),_Ds=mPe(),vDs=FQn(),{MockCallHistory:CDs}=bsr(),Psr=class extends _Ds{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=yDs(e);if(this[VZ]=!0,this[gst]=!0,this[KPe]=r.enableCallHistory??!1,this[qQn]=r.acceptNonStandardSearchParameters??!1,this[jQn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new GQn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new dDs(e);this[wsr]=n,this[$Z]=n[$Z],this[Ast]=r,this[KPe]&&this[ksr]()}get(e){let r=HQn(e),n=this[jQn]?r.replace(/\/$/,""):r,o=this[UQn](n);return o||(o=this[yst](n),this[mst](n,o)),o}dispatch(e,r){e.origin=HQn(e.origin),this.get(e.origin),this[QQn](e);let n=this[qQn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=ADs(c,n);o.path=`${s}?${l}`}return this[wsr].dispatch(o,r)}async close(){this.clearCallHistory(),await this[wsr].close(),this[$Z].clear()}deactivate(){this[gst]=!1}activate(){this[gst]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[VZ])?this[VZ].push(e):this[VZ]=[e];else if(typeof e>"u")this[VZ]=!0;else throw new GQn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[VZ]=!1}enableCallHistory(){return this[KPe]=!0,this}disableCallHistory(){return this[KPe]=!1,this}getCallHistory(){return this[Spe]}clearCallHistory(){this[Spe]!==void 0&&this[Spe].clear()}get isMockActive(){return this[gst]}[ksr](){this[Spe]===void 0&&(this[Spe]=new CDs)}[QQn](e){this[KPe]&&(this[ksr](),this[Spe][pDs](e))}[mst](e,r){this[$Z].set(e,{count:0,dispatcher:r})}[yst](e){let r=Object.assign({agent:this},this[Ast]);return this[Ast]&&this[Ast].connections===1?new hDs(e,r):new mDs(e,r)}[UQn](e){let r=this[$Z].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[yst]("http://localhost:9999");return this[mst](e,n),n}for(let[n,o]of Array.from(this[$Z]))if(o&&typeof n!="string"&&gDs(n,e)){let s=this[yst](e);return this[mst](e,s),s[Rsr]=o.dispatcher[Rsr],s}}[fDs](){return this[VZ]}pendingInterceptors(){let e=this[$Z];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[Rsr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new vDs}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new EDs(r.length===1?`1 interceptor is pending: +`,"latin1"),r!==null&&o!==r){if(n[Hir])throw new IZ;process.emitWarning(new IZ)}e[ud].timeout&&e[ud].timeoutType===lpe&&e[ud].timeout.refresh&&e[ud].timeout.refresh(),n[zF]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[qj]=!1,e&&(Oi(n[lm]<=1,"pipeline should only contain this request"),o(e))}};z9n.exports=tRs});var iUn=I((_af,nUn)=>{"use strict";p();var Uw=require("node:assert"),{pipeline:pRs}=require("node:stream"),ys=Do(),{RequestContentLengthMismatchError:Zir,RequestAbortedError:hRs,SocketError:RPe,InformationalError:jj,InvalidArgumentError:mRs}=ao(),{kUrl:wPe,kReset:Wot,kClient:bT,kRunning:kPe,kPending:gRs,kQueue:Hj,kPendingIdx:eor,kRunningIdx:I2,kError:ST,kSocket:xf,kStrictContentLength:ARs,kOnError:upe,kMaxConcurrentStreams:$ot,kPingInterval:K9n,kHTTP2Session:YF,kHTTP2InitialWindowSize:yRs,kHTTP2ConnectionWindowSize:ERs,kResume:D5,kSize:_Rs,kHTTPContext:tor,kClosed:Xir,kBodyTimeout:vRs,kEnableConnectProtocol:IPe,kRemoteSettings:xPe,kHTTP2Stream:Got,kHTTP2SessionState:ror}=al(),{channels:J9n}=Fj(),Fw=Symbol("open streams"),Z9n,Vot;try{Vot=require("node:http2")}catch{Vot={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:CRs,HTTP2_HEADER_METHOD:X9n,HTTP2_HEADER_PATH:eUn,HTTP2_HEADER_SCHEME:Yir,HTTP2_HEADER_CONTENT_LENGTH:bRs,HTTP2_HEADER_EXPECT:SRs,HTTP2_HEADER_STATUS:Kir,HTTP2_HEADER_PROTOCOL:TRs,NGHTTP2_REFUSED_STREAM:IRs,NGHTTP2_CANCEL:xRs}}=Vot;function Jir(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(Jir,"parseH2Headers");function wRs(t,e){t[xf]=e;let r=t[yRs],n=t[ERs],o=Vot.connect(t[wPe],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[$ot],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[xf]=e,o[Fw]=0,o[bT]=t,o[xf]=e,o[ror]={ping:{interval:t[K9n]===0?null:setInterval(DRs,t[K9n],o).unref()}},o[IPe]=!1,o[xPe]=!1,n&&ys.addListener(o,"connect",kRs.bind(o,n)),ys.addListener(o,"error",NRs),ys.addListener(o,"frameError",MRs),ys.addListener(o,"end",ORs),ys.addListener(o,"goaway",LRs),ys.addListener(o,"close",BRs),ys.addListener(o,"remoteSettings",PRs),o.unref(),t[YF]=o,e[YF]=o,ys.addListener(e,"error",URs),ys.addListener(e,"end",QRs),ys.addListener(e,"close",FRs),e[Xir]=!1,e.on("close",qRs),{version:"h2",defaultPipelining:1/0,write(s){return HRs(t,s)},resume(){RRs(t)},destroy(s,c){e[Xir]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[kPe]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[xPe]===!1||ys.bodyLength(s.body)!==0&&(ys.isStream(s.body)||ys.isAsyncIterable(s.body)||ys.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[xPe]===!1;return!1}}}a(wRs,"connectH2");function RRs(t){let e=t[xf];e?.destroyed===!1&&(t[_Rs]===0||t[$ot]===0?(e.unref(),t[YF].unref()):(e.ref(),t[YF].ref()))}a(RRs,"resumeH2");function kRs(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(kRs,"applyConnectionWindowSize");function PRs(t){if(this[bT][$ot]=t.maxConcurrentStreams??this[bT][$ot],this[xPe]===!0&&this[IPe]===!0&&t.enableConnectProtocol===!1){let e=new jj("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[xf][ST]=e,this[bT][upe](e);return}this[IPe]=t.enableConnectProtocol??this[IPe],this[xPe]=!0,this[bT][D5]()}a(PRs,"onHttp2RemoteSettings");function DRs(t){let e=t[ror];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[bT],c=this[bT];if(n!=null){let l=new jj(`HTTP/2: "PING" errored - type ${n.message}`);c[ST]=l,s[upe](l)}else s.emit("ping",o)}a(r,"onPing")}a(DRs,"onHttp2SendPing");function NRs(t){Uw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[xf][ST]=t,this[bT][upe](t)}a(NRs,"onHttp2SessionError");function MRs(t,e,r){if(r===0){let n=new jj(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[xf][ST]=n,this[bT][upe](n)}}a(MRs,"onHttp2FrameError");function ORs(){let t=new RPe("other side closed",ys.getSocketInfo(this[xf]));this.destroy(t),ys.destroy(this[xf],t)}a(ORs,"onHttp2SessionEnd");function LRs(t){let e=this[ST]||new RPe(`HTTP/2: "GOAWAY" frame received with code ${t}`,ys.getSocketInfo(this[xf])),r=this[bT];if(r[xf]=null,r[tor]=null,this.close(),this[YF]=null,ys.destroy(this[xf],e),r[I2]{e.aborted||e.completed||(x=x||new hRs,ys.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[upe](x),t[D5]()),ys.destroy(m,x))},"abort");try{e.onConnect(_)}catch(x){ys.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[IPe]===!1?(ys.errorRequest(t,e,new jj("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[X9n]="CONNECT",g[TRs]="websocket",g[eUn]=s,f==="ws:"||f==="wss:"?g[Yir]=f==="ws:"?"http":"https":g[Yir]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[Got]=!0,A.once("response",(x,P)=>{let{[Kir]:D,...N}=x;e.onUpgrade(D,Jir(N),A),++n[Fw],t[Hj][t[I2]++]=null}),A.on("error",()=>{(A.rstCode===IRs||A.rstCode===xRs)&&_(new jj(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[Fw]-=1,n[Fw]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[Got]=!0,A.on("response",x=>{let{[Kir]:P,...D}=x;e.onUpgrade(P,Jir(D),A),++n[Fw],t[Hj][t[I2]++]=null}),A.once("close",()=>{n[Fw]-=1,n[Fw]===0&&n.unref()}),A.setTimeout(r),!0);g[eUn]=s,g[Yir]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let b=ys.bodyLength(m);if(ys.isFormDataLike(m)){Z9n??=ape().extractBody;let[x,P]=Z9n(m);g["content-type"]=P,m=x.stream,b=x.length}if(b==null&&(b=e.contentLength),v||(b=null),jRs(o)&&b>0&&e.contentLength!=null&&e.contentLength!==b){if(t[ARs])return ys.errorRequest(t,e,new Zir),!1;process.emitWarning(new Zir)}if(b!=null&&(Uw(m||b===0,"no body must not have content length"),g[bRs]=`${b}`),n.ref(),J9n.sendHeaders.hasSubscribers){let x="";for(let P in g)x+=`${P}: ${g[P]}\r +`;J9n.sendHeaders.publish({request:e,headers:x,socket:n[xf]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[SRs]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[Got]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[Got]=!0,R()),++n[Fw],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[Kir]:P,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(P),Jir(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[Hj][t[I2]++]=null,t[D5]()):(_(new jj("HTTP/2: stream half-closed (remote)")),t[Hj][t[I2]++]=null,t[eor]=t[I2],t[D5]())}),A.once("close",()=>{A.removeAllListeners("data"),n[Fw]-=1,n[Fw]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),_(x)}),A.once("frameError",(x,P)=>{A.removeAllListeners("data"),_(new jj(`HTTP/2: "frameError" received - type ${x}, code ${P}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new jj(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[Fw]-=1,n[Fw]===0&&n.unref(),_(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||b===0?tUn(_,A,null,t,e,t[xf],b,v):ys.isBuffer(m)?tUn(_,A,m,t,e,t[xf],b,v):ys.isBlobLike(m)?typeof m.stream=="function"?rUn(_,A,m.stream(),t,e,t[xf],b,v):$Rs(_,A,m,t,e,t[xf],b,v):ys.isStream(m)?GRs(_,t[xf],v,A,m,t,e,b):ys.isIterable(m)?rUn(_,A,m,t,e,t[xf],b,v):Uw(!1)}a(R,"writeBodyH2")}a(HRs,"writeH2");function tUn(t,e,r,n,o,s,c,l){try{r!=null&&ys.isBuffer(r)&&(Uw(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[D5]()}catch(u){t(u)}}a(tUn,"writeBuffer");function GRs(t,e,r,n,o,s,c,l){Uw(l!==0||s[kPe]===0,"stream body cannot be pipelined");let u=pRs(o,n,f=>{f?(ys.destroy(u,f),t(f)):(ys.removeAllListeners(u),c.onRequestSent(),r||(e[Wot]=!0),s[D5]())});ys.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(GRs,"writeStream");async function $Rs(t,e,r,n,o,s,c,l){Uw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new Zir;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[D5]()}catch(u){t(u)}}a($Rs,"writeBlob");async function rUn(t,e,r,n,o,s,c,l){Uw(c!==0||n[kPe]===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)=>{Uw(u===null),s[ST]?m(s[ST]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[ST])throw s[ST];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Wot]=!0),n[D5]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(rUn,"writeIterable");nUn.exports=wRs});var Wj=I((baf,fUn)=>{"use strict";p();var KF=require("node:assert"),cUn=require("node:net"),PPe=require("node:http"),PZ=Do(),{ClientStats:VRs}=znr(),{channels:dpe}=Fj(),WRs=C6n(),zRs=vZ(),{InvalidArgumentError:dd,InformationalError:YRs,ClientDestroyedError:KRs}=ao(),JRs=CZ(),{kUrl:N5,kServerName:Vj,kClient:ZRs,kBusy:ior,kConnect:XRs,kResuming:DZ,kRunning:OPe,kPending:LPe,kSize:DPe,kQueue:x2,kConnected:eks,kConnecting:fpe,kNeedDrain:$j,kKeepAliveDefaultTimeout:oUn,kHostHeader:tks,kPendingIdx:w2,kRunningIdx:ZF,kError:rks,kPipelining:zot,kKeepAliveTimeoutValue:nks,kMaxHeadersSize:iks,kKeepAliveMaxTimeout:oks,kKeepAliveTimeoutThreshold:sks,kHeadersTimeout:aks,kBodyTimeout:cks,kStrictContentLength:lks,kConnector:NPe,kMaxRequests:oor,kCounter:uks,kClose:dks,kDestroy:fks,kDispatch:pks,kLocalAddress:MPe,kMaxResponseSize:hks,kOnError:mks,kHTTPContext:ch,kMaxConcurrentStreams:gks,kHTTP2InitialWindowSize:Aks,kHTTP2ConnectionWindowSize:yks,kResume:JF,kPingInterval:Eks}=al(),_ks=Y9n(),vks=iUn(),Gj=Symbol("kClosedResolve"),Cks=PPe&&PPe.maxHeaderSize&&Number.isInteger(PPe.maxHeaderSize)&&PPe.maxHeaderSize>0?()=>PPe.maxHeaderSize:()=>{throw new dd("http module not available or http.maxHeaderSize invalid")},sUn=a(()=>{},"noop");function lUn(t){return t[zot]??t[ch]?.defaultPipelining??1}a(lUn,"getPipelining");var sor=class extends zRs{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:E,strictContentLength:_,maxCachedSessions:v,connect:b,maxRequestsPerClient:T,localAddress:w,maxResponseSize:R,autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P,maxConcurrentStreams:D,allowH2:N,useH2c:L,initialWindowSize:B,connectionWindowSize:q,pingInterval:M,webSocket:O}={}){if(d!==void 0)throw new dd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new dd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new dd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new dd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new dd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new dd("invalid maxHeaderSize")}else r=Cks();if(A!=null&&typeof A!="string")throw new dd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new dd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new dd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new dd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new dd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new dd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new dd("bodyTimeout must be a positive integer or zero");if(b!=null&&typeof b!="function"&&typeof b!="object")throw new dd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new dd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||cUn.isIP(w)===0))throw new dd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new dd("maxResponseSize must be a positive number");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new dd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new dd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new dd("maxConcurrentStreams must be a positive integer, greater than 0");if(L!=null&&typeof L!="boolean")throw new dd("useH2c must be a valid boolean value");if(B!=null&&(!Number.isInteger(B)||B<1))throw new dd("initialWindowSize must be a positive integer, greater than 0");if(q!=null&&(!Number.isInteger(q)||q<1))throw new dd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new dd("pingInterval must be a positive integer, greater or equal to 0");if(super({webSocket:O}),typeof b!="function")b=JRs({...E,maxCachedSessions:v,allowH2:N,useH2c:L,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P}:void 0,...b});else{let j=b;b=a((Q,U)=>j({...Q,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},U),"connect")}this[N5]=PZ.parseOrigin(e),this[NPe]=b,this[zot]=y??1,this[iks]=r,this[oUn]=f??4e3,this[oks]=m??6e5,this[sks]=g??2e3,this[nks]=this[oUn],this[Vj]=null,this[MPe]=w??null,this[DZ]=0,this[$j]=0,this[tks]=`host: ${this[N5].hostname}${this[N5].port?`:${this[N5].port}`:""}\r +`,this[cks]=l??3e5,this[aks]=n??3e5,this[lks]=_??!0,this[oor]=T,this[Gj]=null,this[hks]=R>-1?R:-1,this[ch]=null,this[gks]=D??100,this[Aks]=B??262144,this[yks]=q??524288,this[Eks]=M??6e4,this[x2]=[],this[ZF]=0,this[w2]=0,this[JF]=j=>aor(this,j),this[mks]=j=>uUn(this,j)}get pipelining(){return this[zot]}set pipelining(e){this[zot]=e,this[JF](!0)}get stats(){return new VRs(this)}get[LPe](){return this[x2].length-this[w2]}get[OPe](){return this[w2]-this[ZF]}get[DPe](){return this[x2].length-this[ZF]}get[eks](){return!!this[ch]&&!this[fpe]&&!this[ch].destroyed}get[ior](){return!!(this[ch]?.busy(null)||this[DPe]>=(lUn(this)||1)||this[LPe]>0)}[XRs](e){dUn(this),this.once("connect",e)}[pks](e,r){let n=new WRs(this[N5].origin,e,r);return this[x2].push(n),this[DZ]||(PZ.bodyLength(n.body)==null&&PZ.isIterable(n.body)?(this[DZ]=1,queueMicrotask(()=>aor(this))):this[JF](!0)),this[DZ]&&this[$j]!==2&&this[ior]&&(this[$j]=2),this[$j]<2}[dks](){return new Promise(e=>{this[DPe]?this[Gj]=e:e(null)})}[fks](e){return new Promise(r=>{let n=this[x2].splice(this[w2]);for(let s=0;s{this[Gj]&&(this[Gj](),this[Gj]=null),r(null)},"callback");this[ch]?(this[ch].destroy(e,o),this[ch]=null):queueMicrotask(o),this[JF]()})}};function uUn(t,e){if(t[OPe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){KF(t[w2]===t[ZF]);let r=t[x2].splice(t[ZF]);for(let n=0;n{if(s){nor(t,s,{host:e,hostname:r,protocol:n,port:o}),t[JF]();return}if(t.destroyed){PZ.destroy(c.on("error",sUn),new KRs),t[JF]();return}KF(c);try{t[ch]=c.alpnProtocol==="h2"?vks(t,c):_ks(t,c)}catch(l){c.destroy().on("error",sUn),nor(t,l,{host:e,hostname:r,protocol:n,port:o}),t[JF]();return}t[fpe]=!1,c[uks]=0,c[oor]=t[oor],c[ZRs]=t,c[rks]=null,dpe.connected.hasSubscribers&&dpe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ch]?.version,servername:t[Vj],localAddress:t[MPe]},connector:t[NPe],socket:c}),t.emit("connect",t[N5],[t]),t[JF]()})}catch(s){nor(t,s,{host:e,hostname:r,protocol:n,port:o}),t[JF]()}}a(dUn,"connect");function nor(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[fpe]=!1,dpe.connectError.hasSubscribers&&dpe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[ch]?.version,servername:t[Vj],localAddress:t[MPe]},connector:t[NPe],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(KF(t[OPe]===0);t[LPe]>0&&t[x2][t[w2]].servername===t[Vj];){let c=t[x2][t[w2]++];PZ.errorRequest(t,c,e)}else uUn(t,e);t.emit("connectionError",t[N5],[t],e)}}a(nor,"handleConnectError");function aUn(t){t[$j]=0,t.emit("drain",t[N5],[t])}a(aUn,"emitDrain");function aor(t,e){t[DZ]!==2&&(t[DZ]=2,bks(t,e),t[DZ]=0,t[ZF]>256&&(t[x2].splice(0,t[ZF]),t[w2]-=t[ZF],t[ZF]=0))}a(aor,"resume");function bks(t,e){for(;;){if(t.destroyed){KF(t[LPe]===0);return}if(t[Gj]&&!t[DPe]){t[Gj](),t[Gj]=null;return}if(t[ch]&&t[ch].resume(),t[ior])t[$j]=2;else if(t[$j]===2){e?(t[$j]=1,queueMicrotask(()=>aUn(t))):aUn(t);continue}if(t[LPe]===0||t[OPe]>=(lUn(t)||1))return;let r=t[x2][t[w2]];if(r===null)return;if(t[N5].protocol==="https:"&&t[Vj]!==r.servername){if(t[OPe]>0)return;t[Vj]=r.servername,t[ch]?.destroy(new YRs("servername changed"),()=>{t[ch]=null,aor(t)})}if(t[fpe])return;if(!t[ch]){dUn(t);return}if(t[ch].destroyed||t[ch].busy(r))return;!r.aborted&&t[ch].write(r)?t[w2]++:t[x2].splice(t[w2],1)}}a(bks,"_resume");fUn.exports=sor});var cor=I((xaf,pUn)=>{"use strict";p();var Yot=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)}};pUn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Yot}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Yot),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 Kot=I((kaf,CUn)=>{"use strict";p();var{PoolStats:Sks}=znr(),Tks=vZ(),Iks=cor(),{kConnected:lor,kSize:hUn,kRunning:mUn,kPending:gUn,kQueued:BPe,kBusy:xks,kFree:wks,kUrl:Rks,kClose:kks,kDestroy:Pks,kDispatch:Dks}=al(),Mg=Symbol("clients"),dv=Symbol("needDrain"),FPe=Symbol("queue"),uor=Symbol("closed resolve"),dor=Symbol("onDrain"),AUn=Symbol("onConnect"),yUn=Symbol("onDisconnect"),EUn=Symbol("onConnectionError"),por=Symbol("get dispatcher"),_Un=Symbol("add client"),vUn=Symbol("remove client"),hor=class extends Tks{static{a(this,"PoolBase")}[FPe]=new Iks;[BPe]=0;[Mg]=[];[dv]=!1;[dor](e,r,n){let o=this[FPe],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[BPe]--,s=!e.dispatch(c.opts,c.handler)}if(e[dv]=s,!s&&this[dv]&&(this[dv]=!1,this.emit("drain",r,[this,...n])),this[uor]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[yUn]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[EUn]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[xks](){return this[dv]}get[lor](){let e=0;for(let{[lor]:r}of this[Mg])e+=r;return e}get[wks](){let e=0;for(let{[lor]:r,[dv]:n}of this[Mg])e+=r&&!n;return e}get[gUn](){let e=this[BPe];for(let{[gUn]:r}of this[Mg])e+=r;return e}get[mUn](){let e=0;for(let{[mUn]:r}of this[Mg])e+=r;return e}get[hUn](){let e=this[BPe];for(let{[hUn]:r}of this[Mg])e+=r;return e}get stats(){return new Sks(this)}[kks](){if(this[FPe].isEmpty()){let e=[];for(let r=0;r{this[uor]=e})}[Pks](e){for(;;){let n=this[FPe].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[Mg].length);for(let n=0;n{this[dv]&&this[dor](e,e[Rks],[e,this])}),this}[vUn](e){e.close(()=>{let r=this[Mg].indexOf(e);r!==-1&&this[Mg].splice(r,1)}),this[dv]=this[Mg].some(r=>!r[dv]&&r.closed!==!0&&r.destroyed!==!0)}};CUn.exports={PoolBase:hor,kClients:Mg,kNeedDrain:dv,kAddClient:_Un,kRemoveClient:vUn,kGetDispatcher:por}});var NZ=I((Naf,IUn)=>{"use strict";p();var{PoolBase:Nks,kClients:Jot,kNeedDrain:Mks,kAddClient:Oks,kGetDispatcher:Lks,kRemoveClient:Bks}=Kot(),Fks=Wj(),{InvalidArgumentError:mor}=ao(),bUn=Do(),{kUrl:SUn}=al(),Uks=CZ(),Zot=Symbol("options"),gor=Symbol("connections"),TUn=Symbol("factory");function Qks(t,e){return new Fks(t,e)}a(Qks,"defaultFactory");var Aor=class extends Nks{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=Qks,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 mor("invalid connections");if(typeof n!="function")throw new mor("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new mor("connect must be a function or an object");typeof o!="function"&&(o=Uks({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(g),this[gor]=r||null,this[SUn]=bUn.parseOrigin(e),this[Zot]={...bUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[Zot].interceptors=g.interceptors?{...g.interceptors}:void 0,this[TUn]=n,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[Jot].indexOf(_);v!==-1&&this[Jot].splice(v,1)}})}[Lks](){let e=this[Zot].clientTtl;for(let r of this[Jot])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[Bks](r);else if(!r[Mks])return r;if(!this[gor]||this[Jot].length{"use strict";p();var{BalancedPoolMissingUpstreamError:qks,InvalidArgumentError:jks}=ao(),{PoolBase:Hks,kClients:VA,kNeedDrain:UPe,kAddClient:Gks,kRemoveClient:$ks,kGetDispatcher:Vks}=Kot(),Wks=NZ(),{kUrl:Xot}=al(),est=Do(),xUn=Symbol("factory"),QPe=Symbol("options"),wUn=Symbol("kGreatestCommonDivisor"),MZ=Symbol("kCurrentWeight"),OZ=Symbol("kIndex"),Qw=Symbol("kWeight"),tst=Symbol("kMaxWeightPerServer"),rst=Symbol("kErrorPenalty");function zks(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(zks,"getGreatestCommonDivisor");function Yks(t,e){return new Wks(t,e)}a(Yks,"defaultFactory");var yor=class extends Hks{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Yks,...n}={}){if(typeof r!="function")throw new jks("factory must be a function.");super(n),this[QPe]={...est.deepClone(n)},this[QPe].interceptors=n.interceptors?{...n.interceptors}:void 0,this[OZ]=-1,this[MZ]=0,this[tst]=this[QPe].maxWeightPerServer||100,this[rst]=this[QPe].errorPenalty||15,Array.isArray(e)||(e=[e]),this[xUn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=est.parseOrigin(e).origin;if(this[VA].find(o=>o[Xot].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[xUn](r,this[QPe]);this[Gks](n),n.on("connect",()=>{n[Qw]=Math.min(this[tst],n[Qw]+this[rst])}),n.on("connectionError",()=>{n[Qw]=Math.max(1,n[Qw]-this[rst]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Qw]=Math.max(1,n[Qw]-this[rst]),this._updateBalancedPoolStats())});for(let o of this[VA])o[Qw]=this[tst];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Xot].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[$ks](n),this}getUpstream(e){let r=est.parseOrigin(e).origin;return this[VA].find(n=>n[Xot].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[VA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Xot].origin)}[Vks](){if(this[VA].length===0)throw new qks;if(!this[VA].find(s=>!s[UPe]&&s.closed!==!0&&s.destroyed!==!0)||this[VA].map(s=>s[UPe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[VA].findIndex(s=>!s[UPe]);for(;n++this[VA][o][Qw]&&!s[UPe]&&(o=this[OZ]),this[OZ]===0&&(this[MZ]=this[MZ]-this[wUn],this[MZ]<=0&&(this[MZ]=this[tst])),s[Qw]>=this[MZ]&&!s[UPe])return s}return this[MZ]=this[VA][o][Qw],this[OZ]=o,this[VA][o]}};RUn.exports=yor});var MUn=I((Uaf,NUn)=>{"use strict";p();var{PoolBase:Kks,kClients:nst,kNeedDrain:Jks,kAddClient:PUn,kGetDispatcher:Zks,kRemoveClient:Xks}=Kot(),ePs=Wj(),{InvalidArgumentError:Eor}=ao(),DUn=Do(),{kUrl:_or}=al(),tPs=CZ(),qPe=Symbol("options"),vor=Symbol("connections"),Cor=Symbol("factory"),ist=Symbol("index");function rPs(t,e){return new ePs(t,e)}a(rPs,"defaultFactory");var bor=class extends Kks{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=rPs,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 Eor("invalid connections");if(typeof n!="function")throw new Eor("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new Eor("connect must be a function or an object");typeof o!="function"&&(o=tPs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[vor]=r||null,this[_or]=DUn.parseOrigin(e),this[qPe]={...DUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[qPe].interceptors=g.interceptors?{...g.interceptors}:void 0,this[Cor]=n,this[ist]=-1,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[nst].indexOf(_);v!==-1&&this[nst].splice(v,1)}})}[Zks](){let e=this[qPe].clientTtl,r=this[nst].length;if(r===0){let o=this[Cor](this[_or],this[qPe]);return this[PUn](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[Xks](o),n++;continue}if(!o[Jks])return o;n++}if(!this[vor]||r{"use strict";p();var{InvalidArgumentError:ost,MaxOriginsReachedError:nPs}=ao(),{kClients:qw,kRunning:OUn,kClose:iPs,kDestroy:oPs,kDispatch:sPs,kUrl:aPs}=al(),cPs=vZ(),lPs=NZ(),uPs=Wj(),dPs=Do(),LUn=Symbol("onConnect"),BUn=Symbol("onDisconnect"),FUn=Symbol("onConnectionError"),UUn=Symbol("onDrain"),QUn=Symbol("factory"),Sor=Symbol("options"),jPe=Symbol("origins");function fPs(t,e){return e&&e.connections===1?new uPs(t,e):new lPs(t,e)}a(fPs,"defaultFactory");var Tor=class extends cPs{static{a(this,"Agent")}constructor({factory:e=fPs,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new ost("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new ost("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new ost("maxOrigins must be a number greater than 0");super(o),n&&typeof n!="function"&&(n={...n}),this[Sor]={...dPs.deepClone(o),maxOrigins:r,connect:n},this[QUn]=e,this[qw]=new Map,this[jPe]=new Set,this[UUn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[LUn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[BUn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[FUn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[OUn](){let e=0;for(let{dispatcher:r}of this[qw].values())e+=r[OUn];return e}[sPs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new ost("opts.origin must be a non-empty string or URL.");if(this[jPe].size>=this[Sor].maxOrigins&&!this[jPe].has(n))throw new nPs;let o=this[qw].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[qw].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[qw].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[jPe].delete(n))},"closeClientIfUnused");s=this[QUn](e.origin,this[Sor]).on("drain",this[UUn]).on("connect",(l,u)=>{let d=this[qw].get(n);d&&(d.count+=1),this[LUn](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[BUn](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[FUn](l,u,d)}),this[qw].set(n,{count:0,dispatcher:s}),this[jPe].add(n)}return s.dispatch(e,r)}[iPs](){let e=[];for(let{dispatcher:r}of this[qw].values())e.push(r.close());return this[qw].clear(),Promise.all(e)}[oPs](e){let r=[];for(let{dispatcher:n}of this[qw].values())r.push(n.destroy(e));return this[qw].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[qw].values())r.stats&&(e[r[aPs].origin]=r.stats);return e}};qUn.exports=Tor});var GUn=I(($af,HUn)=>{"use strict";p();var{Buffer:Yj}=require("node:buffer"),Ior=require("node:net"),{InvalidArgumentError:zj}=ao();function pPs(t){if(Ior.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:Yj.from(r)}}if(Ior.isIPv6(t))return{type:4,buffer:jUn(t)};let e=Yj.from(t,"utf8");if(e.length>255)throw new zj("Domain name too long (max 255 bytes)");return{type:3,buffer:Yj.concat([Yj.from([e.length]),e])}}a(pPs,"parseAddress");function jUn(t){let e=Yj.alloc(16),r=t;if(t.includes(".")){let o=t.lastIndexOf(":"),s=t.slice(o+1);if(Ior.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:APs}=require("node:events"),{Buffer:BZ}=require("node:buffer"),{InvalidArgumentError:ppe,Socks5ProxyError:Kj}=ao(),{debuglog:yPs}=require("node:util"),{parseAddress:EPs}=GUn(),XF=yPs("undici:socks5"),$Un=BZ.alloc(0),sst=5,hpe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},VUn={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},FZ={IPV4:1,DOMAIN:3,IPV6:4},M5={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},vE={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},xor=class extends APs{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new ppe("socket is required");this.socket=e,this.options=r,this.state=vE.INITIAL,this.buffer=$Un,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(hpe.USERNAME_PASSWORD),this.authMethods.push(hpe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){XF("received data",e.length,"bytes in state",this.state),this.buffer=BZ.concat([this.buffer,e]);try{switch(this.state){case vE.HANDSHAKING:this.handleHandshakeResponse();break;case vE.AUTHENTICATING:this.handleAuthResponse();break;case vE.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){XF("socket error",e),this.state=vE.ERROR,this.emit("error",e),this.destroy()}onClose(){XF("socket closed"),this.state=vE.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=vE.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==vE.INITIAL)throw new ppe("Handshake already started");XF("starting handshake with",this.authMethods.length,"auth methods"),this.state=vE.HANDSHAKING;let e=BZ.alloc(2+this.authMethods.length);e[0]=sst,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!==sst)throw new Kj(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===hpe.NO_ACCEPTABLE)throw new Kj("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),XF("server selected auth method",r),r===hpe.NO_AUTH)this.markAuthenticated();else if(r===hpe.USERNAME_PASSWORD)this.state=vE.AUTHENTICATING,this.sendAuthRequest();else throw new Kj(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new ppe("Username and password required for authentication");XF("sending username/password auth");let n=BZ.from(e),o=BZ.from(r);if(n.length>255||o.length>255)throw new ppe("Username or password too long");let s=BZ.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 Kj(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new Kj("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),XF("authentication successful"),this.markAuthenticated()}connect(e,r){if(this.state===vE.CONNECTING||this.state===vE.CONNECTED)throw new ppe("Connection already in progress");if(this.state!==vE.AUTHENTICATED)throw new ppe("Client must be authenticated before CONNECT");XF("connecting to",e,r),this.state=vE.CONNECTING;let n=this.buildConnectRequest(VUn.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=EPs(r),c=BZ.alloc(4+s.length+2);return c[0]=sst,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!==sst)throw new Kj(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===FZ.IPV4)o+=6;else if(n===FZ.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===FZ.IPV6)o+=18;else throw new Kj(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var{URL:YUn}=require("node:url"),wor,_Ps=vZ(),{InvalidArgumentError:KUn}=ao(),{Socks5Client:vPs,STATES:CPs}=zUn(),{kDispatch:JUn,kClose:bPs,kDestroy:SPs}=al(),TPs=NZ(),IPs=CZ(),{debuglog:xPs}=require("node:util"),Jj=xPs("undici:socks5-proxy"),Ror=Symbol("proxy url"),wPs=Symbol("proxy headers"),ZUn=Symbol("proxy auth"),XUn=Symbol("proxy protocol"),UZ=Symbol("pools"),e7n=Symbol("connector"),kor=Symbol("request tls settings"),t7n=!1,Por=class extends _Ps{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),t7n||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),t7n=!0),!e)throw new KUn("Proxy URL is mandatory");let n=typeof e=="string"?new YUn(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new KUn("Proxy URL must use socks5:// or socks:// protocol");this[Ror]=n,this[wPs]=r.headers||{},this[XUn]=r.proxyTls?"https:":"http:",this[kor]=r.requestTls,this[ZUn]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[e7n]=r.connect||IPs({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[UZ]=new Map}async createSocks5Connection(e,r){let n=this[Ror].hostname,o=parseInt(this[Ror].port)||1080;Jj("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{this[e7n]({hostname:n,host:n,port:o,protocol:this[XUn]},(d,f)=>{d?u(d):l(f)})}),c=new vPs(s,this[ZUn]);return c.on("error",l=>{Jj("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===CPs.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=>{Jj("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}[JUn](e,r){let{origin:n}=e;Jj("dispatching request to",n,"via SOCKS5");try{let o=String(n),s=this[UZ].get(o);return(!s||s.destroyed||s.closed)&&(s=new TPs(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(c,l)=>{try{let u=new YUn(n),d=u.hostname,f=parseInt(u.port)||(u.protocol==="https:"?443:80);Jj("establishing SOCKS5 connection to",d,f);let h=await this.createSocks5Connection(d,f),m=h;u.protocol==="https:"&&(wor||(wor=require("node:tls")),Jj("upgrading to TLS"),m=wor.connect({...this[kor],socket:h,servername:this[kor]?.servername||d}),await new Promise((g,A)=>{m.once("secureConnect",g),m.once("error",A)})),l(null,m)}catch(u){Jj("SOCKS5 connection error:",u),l(u)}},"connect")}),this[UZ].set(o,s)),s[JUn](e,r)}catch(o){if(Jj("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[bPs](){let e=[];for(let r of this[UZ].values())e.push(r.close());this[UZ].clear(),await Promise.all(e)}async[SPs](e){let r=[];for(let n of this[UZ].values())r.push(n.destroy(e));this[UZ].clear(),await Promise.all(r)}};r7n.exports=Por});var Lor=I((ecf,h7n)=>{"use strict";p();var{kProxy:mpe,kClose:l7n,kDestroy:u7n,kDispatch:n7n}=al(),RPs=LZ(),d7n=NZ(),f7n=vZ(),{InvalidArgumentError:QZ,RequestAbortedError:kPs,SecureProxyConnectionError:PPs}=ao(),i7n=CZ(),p7n=Wj(),{channels:o7n}=Fj(),DPs=Dor(),ast=Symbol("proxy agent"),Zj=Symbol("proxy client"),e8=Symbol("proxy headers"),Nor=Symbol("request tls settings"),s7n=Symbol("proxy tls settings"),a7n=Symbol("connect endpoint function"),c7n=Symbol("tunnel proxy");function NPs(t){return t==="https:"?443:80}a(NPs,"defaultProtocolPort");function MPs(t,e){return new d7n(t,e)}a(MPs,"defaultFactory");var OPs=a(()=>{},"noop");function LPs(t,e){return e.connections===1?new p7n(t,e):new d7n(t,e)}a(LPs,"defaultAgentFactory");var Mor=class extends f7n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new QZ("Proxy URL is mandatory");super(),this[e8]=r,o?this.#e=o(e,{connect:n}):this.#e=new p7n(e,{connect:n})}[n7n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new QZ("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[e8],...c},this.#e[n7n](e,r)}[l7n](){return this.#e.close()}[u7n](e){return this.#e.destroy(e)}},Oor=class extends f7n{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new QZ("Proxy uri is mandatory");let{clientFactory:r=MPs}=e;if(typeof r!="function")throw new QZ("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[mpe]={uri:s,protocol:u},this[Nor]=e.requestTls,this[s7n]=e.proxyTls,this[e8]=e.headers||{},this[c7n]=n,e.auth&&e.token)throw new QZ("opts.auth cannot be used in combination with opts.token");e.auth?this[e8]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[e8]["proxy-authorization"]=e.token:d&&f&&(this[e8]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=i7n({...e.proxyTls});this[a7n]=i7n({...e.requestTls});let g=e.factory||LPs,A=a((y,E)=>{let{protocol:_}=new URL(y);return this[mpe].protocol==="socks5:"||this[mpe].protocol==="socks:"?new DPs(this[mpe].uri,{headers:this[e8],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls,requestTls:e.requestTls}):!this[c7n]&&_==="http:"&&this[mpe].protocol==="http:"?new Mor(this[mpe].uri,{headers:this[e8],connect:m,factory:g}):g(y,E)},"factory");u==="socks5:"||u==="socks:"?this[Zj]=null:this[Zj]=r(o,{connect:m}),this[ast]=new RPs({...e,factory:A,connect:a(async(y,E)=>{if(!this[Zj]){E(new QZ("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${NPs(y.protocol)}`);try{let v={origin:c,port:l,path:_,signal:y.signal,headers:{...this[e8],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[s7n]?.servername||h},{socket:b,statusCode:T}=await this[Zj].connect(v);if(T!==200){b.on("error",OPs).destroy(),E(new kPs(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(o7n.proxyConnected.hasSubscribers&&o7n.proxyConnected.publish({socket:b,connectParams:v}),y.protocol!=="https:"){E(null,b);return}let w;this[Nor]?w=this[Nor].servername:w=y.servername,this[a7n]({...y,servername:w,httpSocket:b},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new PPs(v)):E(v)}},"connect")})}dispatch(e,r){let n=BPs(e.headers);if(FPs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[ast].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[l7n](){let e=[this[ast].close()];return this[Zj]&&e.push(this[Zj].close()),Promise.all(e)}[u7n](){let e=[this[ast].destroy()];return this[Zj]&&e.push(this[Zj].destroy()),Promise.all(e)}};function BPs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new QZ("Proxy-Authorization should be sent in ProxyAgent constructor")}a(FPs,"throwIfProxyAuthIsSent");h7n.exports=Oor});var E7n=I((ncf,y7n)=>{"use strict";p();var UPs=vZ(),{kClose:QPs,kDestroy:qPs,kClosed:m7n,kDestroyed:g7n,kDispatch:jPs,kNoProxyAgent:HPe,kHttpProxyAgent:Xj,kHttpsProxyAgent:qZ}=al(),A7n=Lor(),HPs=LZ(),GPs={"http:":80,"https:":443},Bor=class extends UPs{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[HPe]=new HPs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[Xj]=new A7n({...s,uri:c}):this[Xj]=this[HPe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[qZ]=new A7n({...s,uri:l}):this[qZ]=this[Xj],this.#o()}[jPs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[QPs](){return Promise.all([this[HPe].close(),!this[Xj][m7n]&&this[Xj].close(),!this[qZ][m7n]&&this[qZ].close()])}[qPs](e){return Promise.all([this[HPe].destroy(e),!this[Xj][g7n]&&this[Xj].destroy(e),!this[qZ][g7n]&&this[qZ].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||GPs[r]||0,this.#i(n,o)?r==="https:"?this[qZ]:this[Xj]:this[HPe]}#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 gpe=require("node:assert"),{kRetryHandlerDefaultRetry:_7n}=al(),{RequestRetryError:GPe}=ao(),$Ps=hPe(),{isDisturbed:v7n,parseRangeHeader:C7n,wrapRequestBody:VPs}=Do();function WPs(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(WPs,"calculateRetryAfterHeader");var For=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=$Ps.wrap(n),this.opts={...s,body:VPs(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[_7n],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(v7n(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[_7n](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:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?WPs(l["retry-after"]):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onResponseStart(e,r,n,o){if(this.error=null,this.retryCount+=1,r>=300){let s=new GPe("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 GPe("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=C7n(n["content-range"]);if(!s)throw new GPe("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new GPe("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});let{start:c,size:l,end:u=l?l-1:null}=s;gpe(this.start===c,"content-range mismatch"),gpe(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=C7n(n["content-range"]);if(s==null){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}let{start:c,size:l,end:u=l?l-1:null}=s;gpe(c!=null&&Number.isFinite(c),"content-range mismatch"),gpe(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}gpe(Number.isFinite(this.start)),gpe(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 GPe("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||v7n(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))}};b7n.exports=For});var T7n=I((lcf,S7n)=>{"use strict";p();var zPs=mPe(),YPs=cst(),Uor=class extends zPs{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 YPs({...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()}};S7n.exports=Uor});var w7n=I((fcf,x7n)=>{"use strict";p();var{InvalidArgumentError:I7n}=ao(),KPs=Wj(),Qor=class extends KPs{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new I7n("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 I7n("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};x7n.exports=Qor});var B7n=I((mcf,L7n)=>{"use strict";p();var D7n=require("node:assert"),{Readable:JPs}=require("node:stream"),{RequestAbortedError:N7n,NotSupportedError:ZPs,InvalidArgumentError:XPs,AbortError:lst}=ao(),M7n=Do(),{ReadableStreamFrom:e2s}=Do(),TT=Symbol("kConsume"),ust=Symbol("kReading"),jZ=Symbol("kBody"),R7n=Symbol("kAbort"),O7n=Symbol("kContentType"),qor=Symbol("kContentLength"),jor=Symbol("kUsed"),dst=Symbol("kBytesRead"),t2s=a(()=>{},"noop"),Hor=class extends JPs{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[R7n]=r,this[TT]=null,this[dst]=0,this[jZ]=null,this[jor]=!1,this[O7n]=n,this[qor]=Number.isFinite(o)?o:null,this[ust]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new N7n),e&&this[R7n](),this[jor]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[ust]=!0,this[jor]=!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[ust]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[dst]+=e.length,this[TT])?($or(this[TT],e),this[ust]?super.push(e):!0):super.push(e)}text(){return $Pe(this,"text")}json(){return $Pe(this,"json")}blob(){return $Pe(this,"blob")}bytes(){return $Pe(this,"bytes")}arrayBuffer(){return $Pe(this,"arrayBuffer")}async formData(){throw new ZPs}get bodyUsed(){return M7n.isDisturbed(this)}get body(){return this[jZ]||(this[jZ]=e2s(this),this[TT]&&(this[jZ].getReader(),D7n(this[jZ].locked))),this[jZ]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new XPs("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 lst):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[qor]&&this[qor]>n||this[dst]>n)&&this.destroy(new lst),r){let c=a(()=>{this.destroy(r.reason??new lst)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new lst):o(null)})}else this.on("close",o);this.on("error",t2s).on("data",()=>{this[dst]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function r2s(t){return t[jZ]?.locked===!0||t[TT]!==null}a(r2s,"isLocked");function n2s(t){return M7n.isDisturbed(t)||r2s(t)}a(n2s,"isUnusable");function $Pe(t,e){return D7n(!t[TT]),new Promise((r,n)=>{if(n2s(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[TT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){Vor(this[TT],o)}).on("close",function(){this[TT].body!==null&&Vor(this[TT],new N7n)}),i2s(t[TT])})})}a($Pe,"consume");function i2s(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(Gor,"chunksDecode");function k7n(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 o2s=require("node:assert"),{AsyncResource:s2s}=require("node:async_hooks"),{Readable:a2s}=B7n(),{InvalidArgumentError:Ape,RequestAbortedError:F7n}=ao(),jw=Do();function VPe(){}a(VPe,"noop");var fst=class extends s2s{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Ape("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 Ape("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new Ape("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Ape("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Ape("invalid method");if(l&&typeof l!="function")throw new Ape("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw jw.isStream(c)&&jw.destroy(c.on("error",VPe),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 F7n:n&&(this.removeAbortListener=jw.addAbortListener(n,()=>{this.reason=n.reason??new F7n,this.res?jw.destroy(this.res.on("error",VPe),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}o2s(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"?jw.parseRawHeaders(r):jw.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?jw.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new a2s({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(E){this.res=null,jw.destroy(y.on("error",VPe),E),queueMicrotask(()=>{throw E})}}onData(e){return this.res.push(e)}onComplete(e){jw.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(()=>{jw.destroy(r.on("error",VPe),e)})),o&&(this.body=null,jw.isStream(o)&&(o.on("error",VPe),jw.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function U7n(t,e){if(e===void 0)return new Promise((r,n)=>{U7n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new fst(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(U7n,"request");Wor.exports=U7n;Wor.exports.RequestHandler=fst});var WPe=I((vcf,H7n)=>{"use strict";p();var{addAbortListener:c2s}=Do(),{RequestAbortedError:l2s}=ao(),ype=Symbol("kListener"),O5=Symbol("kSignal");function q7n(t){t.abort?t.abort(t[O5]?.reason):t.reason=t[O5]?.reason??new l2s,j7n(t)}a(q7n,"abort");function u2s(t,e){if(t.reason=null,t[O5]=null,t[ype]=null,!!e){if(e.aborted){q7n(t);return}t[O5]=e,t[ype]=()=>{q7n(t)},c2s(t[O5],t[ype])}}a(u2s,"addSignal");function j7n(t){t[O5]&&("removeEventListener"in t[O5]?t[O5].removeEventListener("abort",t[ype]):t[O5].removeListener("abort",t[ype]),t[O5]=null,t[ype]=null)}a(j7n,"removeSignal");H7n.exports={addSignal:u2s,removeSignal:j7n}});var W7n=I((Scf,V7n)=>{"use strict";p();var d2s=require("node:assert"),{finished:f2s}=require("node:stream"),{AsyncResource:p2s}=require("node:async_hooks"),{InvalidArgumentError:Epe,InvalidReturnValueError:h2s}=ao(),t8=Do(),{addSignal:m2s,removeSignal:G7n}=WPe();function g2s(){}a(g2s,"noop");var zor=class extends p2s{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Epe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new Epe("invalid callback");if(typeof r!="function")throw new Epe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Epe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Epe("invalid method");if(u&&typeof u!="function")throw new Epe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw t8.isStream(l)&&t8.destroy(l.on("error",g2s),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,t8.isStream(l)&&l.on("error",f=>{this.onError(f)}),m2s(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}d2s(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"?t8.parseRawHeaders(r):t8.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 h2s("expected Writable");return f2s(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(m||!A?.readable)&&t8.destroy(A,m),this.callback=null,this.runInAsyncScope(g,null,m||null,{opaque:y,trailers:E}),m&&_()}),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;G7n(this),r&&(this.trailers=t8.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;G7n(this),this.factory=null,r?(this.res=null,t8.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,t8.destroy(s,e))}};function $7n(t,e,r){if(r===void 0)return new Promise((n,o)=>{$7n.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new zor(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($7n,"stream");V7n.exports=$7n});var J7n=I((xcf,K7n)=>{"use strict";p();var{Readable:Y7n,Duplex:A2s,PassThrough:y2s}=require("node:stream"),E2s=require("node:assert"),{AsyncResource:_2s}=require("node:async_hooks"),{InvalidArgumentError:zPe,InvalidReturnValueError:v2s,RequestAbortedError:Yor}=ao(),L5=Do(),{addSignal:C2s,removeSignal:b2s}=WPe();function z7n(){}a(z7n,"noop");var _pe=Symbol("resume"),Kor=class extends Y7n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[_pe]=null}_read(){let{[_pe]:e}=this;e&&(this[_pe]=null,e())}_destroy(e,r){this._read(),r(e)}},Jor=class extends Y7n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[_pe]=e}_read(){this[_pe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new Yor),r(e)}},Zor=class extends _2s{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new zPe("invalid opts");if(typeof r!="function")throw new zPe("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 zPe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new zPe("invalid method");if(c&&typeof c!="function")throw new zPe("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 Kor().on("error",z7n),this.ret=new A2s({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[_pe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new Yor),A&&u&&A(),L5.destroy(f,u),L5.destroy(h,u),L5.destroy(m,u),b2s(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,C2s(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}E2s(!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"?L5.parseRawHeaders(r):L5.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Jor(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?L5.parseRawHeaders(r):L5.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",z7n),u}if(!l||typeof l.on!="function")throw new v2s("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;L5.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||L5.destroy(u,new Yor)}),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,L5.destroy(r,e)}};function S2s(t,e){try{let r=new Zor(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new y2s().destroy(r)}}a(S2s,"pipeline");K7n.exports=S2s});var nQn=I((kcf,rQn)=>{"use strict";p();var{InvalidArgumentError:Xor,SocketError:T2s}=ao(),{AsyncResource:I2s}=require("node:async_hooks"),Z7n=require("node:assert"),X7n=Do(),{kHTTP2Stream:x2s}=al(),{addSignal:w2s,removeSignal:eQn}=WPe(),esr=class extends I2s{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Xor("invalid opts");if(typeof r!="function")throw new Xor("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Xor("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,w2s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}Z7n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new T2s("bad upgrade",null)}onUpgrade(e,r,n){Z7n(n[x2s]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;eQn(this),this.callback=null;let l=this.responseHeaders==="raw"?X7n.parseRawHeaders(r):X7n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;eQn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function tQn(t,e){if(e===void 0)return new Promise((r,n)=>{tQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new esr(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(tQn,"upgrade");rQn.exports=tQn});var cQn=I((Ncf,aQn)=>{"use strict";p();var R2s=require("node:assert"),{AsyncResource:k2s}=require("node:async_hooks"),{InvalidArgumentError:tsr,SocketError:P2s}=ao(),iQn=Do(),{addSignal:D2s,removeSignal:oQn}=WPe(),rsr=class extends k2s{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new tsr("invalid opts");if(typeof r!="function")throw new tsr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new tsr("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,D2s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}R2s(this.callback),this.abort=e,this.context=r}onHeaders(){throw new P2s("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;oQn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?iQn.parseRawHeaders(r):iQn.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;oQn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function sQn(t,e){if(e===void 0)return new Promise((r,n)=>{sQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new rsr(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(sQn,"connect");aQn.exports=sQn});var lQn=I((Lcf,vpe)=>{"use strict";p();vpe.exports.request=Q7n();vpe.exports.stream=W7n();vpe.exports.pipeline=J7n();vpe.exports.upgrade=nQn();vpe.exports.connect=cQn()});var isr=I((Fcf,dQn)=>{"use strict";p();var{UndiciError:N2s}=ao(),uQn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),nsr=class extends N2s{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[uQn]===!0}get[uQn](){return!0}};dQn.exports={MockNotMatchedError:nsr}});var HZ=I((qcf,fQn)=>{"use strict";p();fQn.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 YPe=I((Hcf,bQn)=>{"use strict";p();var{MockNotMatchedError:Cpe}=isr(),{kDispatches:GZ,kMockAgent:M2s,kOriginalDispatch:O2s,kOrigin:L2s,kGetNetConnect:B2s,kTotalDispatchCount:asr}=HZ(),{serializePathWithQuery:F2s}=Do(),{STATUS_CODES:U2s}=require("node:http"),{types:{isPromise:Q2s}}=require("node:util"),{InvalidArgumentError:osr}=ao();function B5(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(B5,"matchValue");function hQn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(hQn,"lowerCaseEntries");function mQn(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=mQn(e,r);if(!B5(n,o))return!1}return!0}a(gQn,"matchHeaders");function q2s(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(q2s,"normalizeSearchParams");function ssr(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(ssr,"safeUrl");function j2s(t,{path:e,method:r,body:n,headers:o}){let s=B5(t.path,e),c=B5(t.method,r),l=typeof t.body<"u"?B5(t.body,n):!0,u=gQn(t,o);return s&&c&&l&&u}a(j2s,"matchKey");function AQn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(AQn,"getResponseData");function yQn(t,e){let r=e.query?F2s(e.path,e.query):e.path,n=typeof r=="string"?ssr(r):r,o=pQn(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?B5(pQn(ssr(c)),o):B5(ssr(c),n));if(s.length===0)throw new Cpe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>B5(c,e.method)),s.length===0)throw new Cpe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?B5(c,e.body):!0),s.length===0)throw new Cpe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>gQn(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new Cpe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(yQn,"getMockDispatch");function H2s(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[asr]=(t[asr]||0)+1,c}a(H2s,"addMockDispatch");function csr(t,e){let r=t.findIndex(n=>n.consumed?j2s(n,e):!1);r!==-1&&t.splice(r,1)}a(csr,"deleteMockDispatch");function pQn(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(pQn,"removeTrailingSlash");function EQn(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(EQn,"buildKey");function lsr(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,E(this[GZ])},d):E(this[GZ]);function E(v,b=s){if(g)return;let T=Array.isArray(t.headers)?usr(t.headers):t.headers,w=typeof b=="function"?b({...t,headers:T}):b;if(Q2s(w))return w.then(D=>E(v,D));if(g)return;let R=AQn(w),x=lsr(c),P=lsr(l);e.onHeaders?.(o,x,_,_Qn(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(P),csr(v,r)}a(E,"handleReply");function _(){}return a(_,"resume"),!0}a(vQn,"mockDispatch");function $2s(){let t=this[M2s],e=this[L2s],r=this[O2s];return a(function(o,s){if(t.isMockActive)try{vQn.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[B2s](),u=this[GZ][asr]||this[GZ].length,f=`, ${this[GZ].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new Cpe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(CQn(l,e))r.call(this,o,s);else throw new Cpe(`${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($2s,"buildMockDispatch");function CQn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>B5(n,r.host)))}a(CQn,"checkNetConnect");function V2s(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(V2s,"normalizeOrigin");function W2s(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new osr("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new osr("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new osr("options.ignoreTrailingSlash must to be a boolean");return r}a(W2s,"buildAndValidateMockOptions");bQn.exports={getResponseData:AQn,getMockDispatch:yQn,addMockDispatch:H2s,deleteMockDispatch:csr,buildKey:EQn,generateKeyValues:lsr,matchValue:B5,getResponse:G2s,getStatusText:_Qn,mockDispatch:vQn,buildMockDispatch:$2s,checkNetConnect:CQn,buildAndValidateMockOptions:W2s,getHeaderByName:mQn,buildHeadersFromArray:usr,normalizeSearchParams:q2s,normalizeOrigin:V2s}});var Asr=I((Vcf,gsr)=>{"use strict";p();var{getResponseData:z2s,buildKey:Y2s,addMockDispatch:dsr}=YPe(),{kDispatches:pst,kDispatchKey:hst,kDefaultHeaders:fsr,kDefaultTrailers:psr,kContentLength:hsr,kMockDispatch:mst,kIgnoreTrailingSlash:gst}=HZ(),{InvalidArgumentError:F5}=ao(),{serializePathWithQuery:K2s}=Do(),bpe=class{static{a(this,"MockScope")}constructor(e){this[mst]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new F5("waitInMs must be a valid integer > 0");return this[mst].delay=e,this}persist(){return this[mst].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new F5("repeatTimes must be a valid integer > 0");return this[mst].times=e,this}},msr=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new F5("opts must be an object");if(typeof e.path>"u")throw new F5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=K2s(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[hst]=Y2s(e),this[pst]=r,this[gst]=e.ignoreTrailingSlash??!1,this[fsr]={},this[psr]={},this[hsr]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=z2s(r),s=this[hsr]?{"content-length":o.length}:{},c={...this[fsr],...s,...n.headers},l={...this[psr],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new F5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new F5("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 F5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=dsr(this[pst],this[hst],s,{ignoreTrailingSlash:this[gst]});return new bpe(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=dsr(this[pst],this[hst],n,{ignoreTrailingSlash:this[gst]});return new bpe(o)}replyWithError(e){if(typeof e>"u")throw new F5("error must be defined");let r=dsr(this[pst],this[hst],{error:e},{ignoreTrailingSlash:this[gst]});return new bpe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new F5("headers must be defined");return this[fsr]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new F5("trailers must be defined");return this[psr]=e,this}replyContentLength(){return this[hsr]=!0,this}};gsr.exports.MockInterceptor=msr;gsr.exports.MockScope=bpe});var vsr=I((Ycf,kQn)=>{"use strict";p();var{promisify:J2s}=require("node:util"),Z2s=Wj(),{buildMockDispatch:X2s}=YPe(),{kDispatches:ysr,kMockAgent:SQn,kClose:TQn,kOriginalClose:IQn,kOrigin:xQn,kOriginalDispatch:eDs,kConnected:Esr,kIgnoreTrailingSlash:wQn}=HZ(),{MockInterceptor:tDs}=Asr(),RQn=al(),{InvalidArgumentError:rDs}=ao(),_sr=class extends Z2s{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new rDs("Argument opts.agent must implement Agent");super(e,r),this[SQn]=r.agent,this[xQn]=e,this[wQn]=r.ignoreTrailingSlash??!1,this[ysr]=[],this[Esr]=1,this[eDs]=this.dispatch,this[IQn]=this.close.bind(this),this.dispatch=X2s.call(this),this.close=this[TQn]}get[RQn.kConnected](){return this[Esr]}intercept(e){return new tDs(e&&{ignoreTrailingSlash:this[wQn],...e},this[ysr])}cleanMocks(){this[ysr]=[]}async[TQn](){await J2s(this[IQn])(),this[Esr]=0,this[SQn][RQn.kClients].delete(this[xQn])}};kQn.exports=_sr});var Ssr=I((Zcf,bsr)=>{"use strict";p();var{kMockCallHistoryAddLog:nDs}=HZ(),{InvalidArgumentError:rH}=ao();function eH(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 rH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(eH,"handleFilterCallsWithOptions");function iDs(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new rH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(iDs,"buildAndValidateFilterCallsOptions");function tH(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 rH(`${t} parameter should be one of string, regexp, undefined or null`)}}a(tH,"makeFilterCalls");function oDs(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 rH("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(oDs,"computeUrlWithMaybeSearchParameters");var Ast=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=oDs(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)}},Csr=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 rH("nthCall must be called with a number");if(!Number.isInteger(e))throw new rH("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new rH("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",...iDs(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=eH(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=eH(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=eH(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=eH(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=eH(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=eH(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=eH(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=eH(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new rH("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=tH.call(this,"protocol");filterCallsByHost=tH.call(this,"host");filterCallsByPort=tH.call(this,"port");filterCallsByOrigin=tH.call(this,"origin");filterCallsByPath=tH.call(this,"path");filterCallsByHash=tH.call(this,"hash");filterCallsByFullUrl=tH.call(this,"fullUrl");filterCallsByMethod=tH.call(this,"method");clear(){this.logs=[]}[nDs](e){let r=new Ast(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};bsr.exports.MockCallHistory=Csr;bsr.exports.MockCallHistoryLog=Ast});var wsr=I((tlf,BQn)=>{"use strict";p();var{promisify:sDs}=require("node:util"),aDs=NZ(),{buildMockDispatch:cDs}=YPe(),{kDispatches:Tsr,kMockAgent:PQn,kClose:DQn,kOriginalClose:NQn,kOrigin:MQn,kOriginalDispatch:lDs,kConnected:Isr,kIgnoreTrailingSlash:OQn}=HZ(),{MockInterceptor:uDs}=Asr(),LQn=al(),{InvalidArgumentError:dDs}=ao(),xsr=class extends aDs{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new dDs("Argument opts.agent must implement Agent");super(e,r),this[PQn]=r.agent,this[MQn]=e,this[OQn]=r.ignoreTrailingSlash??!1,this[Tsr]=[],this[Isr]=1,this[lDs]=this.dispatch,this[NQn]=this.close.bind(this),this.dispatch=cDs.call(this),this.close=this[DQn]}get[LQn.kConnected](){return this[Isr]}intercept(e){return new uDs(e&&{ignoreTrailingSlash:this[OQn],...e},this[Tsr])}cleanMocks(){this[Tsr]=[]}async[DQn](){await sDs(this[NQn])(),this[Isr]=0,this[PQn][LQn.kClients].delete(this[MQn])}};BQn.exports=xsr});var UQn=I((olf,FQn)=>{"use strict";p();var{Transform:fDs}=require("node:stream"),{Console:pDs}=require("node:console"),hDs=process.versions.icu?"\u2705":"Y ",mDs=process.versions.icu?"\u274C":"N ";FQn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new fDs({transform(r,n,o){o(null,r)}}),this.logger=new pDs({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?hDs:mDs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var Nsr=I((clf,VQn)=>{"use strict";p();var{kClients:$Z}=al(),gDs=LZ(),{kAgent:Rsr,kMockAgentSet:yst,kMockAgentGet:QQn,kDispatches:ksr,kIsMockActive:Est,kNetConnect:VZ,kGetNetConnect:ADs,kOptions:_st,kFactory:vst,kMockAgentRegisterCallHistory:Psr,kMockAgentIsCallHistoryEnabled:KPe,kMockAgentAddCallHistoryLog:qQn,kMockAgentMockCallHistoryInstance:Spe,kMockAgentAcceptsNonStandardSearchParameters:jQn,kMockCallHistoryAddLog:yDs,kIgnoreTrailingSlash:HQn}=HZ(),EDs=vsr(),_Ds=wsr(),{matchValue:vDs,normalizeSearchParams:CDs,buildAndValidateMockOptions:bDs,normalizeOrigin:GQn}=YPe(),{InvalidArgumentError:$Qn,UndiciError:SDs}=ao(),TDs=mPe(),IDs=UQn(),{MockCallHistory:xDs}=Ssr(),Dsr=class extends TDs{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=bDs(e);if(this[VZ]=!0,this[Est]=!0,this[KPe]=r.enableCallHistory??!1,this[jQn]=r.acceptNonStandardSearchParameters??!1,this[HQn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new $Qn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new gDs(e);this[Rsr]=n,this[$Z]=n[$Z],this[_st]=r,this[KPe]&&this[Psr]()}get(e){let r=GQn(e),n=this[HQn]?r.replace(/\/$/,""):r,o=this[QQn](n);return o||(o=this[vst](n),this[yst](n,o)),o}dispatch(e,r){e.origin=GQn(e.origin),this.get(e.origin),this[qQn](e);let n=this[jQn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=CDs(c,n);o.path=`${s}?${l}`}return this[Rsr].dispatch(o,r)}async close(){this.clearCallHistory(),await this[Rsr].close(),this[$Z].clear()}deactivate(){this[Est]=!1}activate(){this[Est]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[VZ])?this[VZ].push(e):this[VZ]=[e];else if(typeof e>"u")this[VZ]=!0;else throw new $Qn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[VZ]=!1}enableCallHistory(){return this[KPe]=!0,this}disableCallHistory(){return this[KPe]=!1,this}getCallHistory(){return this[Spe]}clearCallHistory(){this[Spe]!==void 0&&this[Spe].clear()}get isMockActive(){return this[Est]}[Psr](){this[Spe]===void 0&&(this[Spe]=new xDs)}[qQn](e){this[KPe]&&(this[Psr](),this[Spe][yDs](e))}[yst](e,r){this[$Z].set(e,{count:0,dispatcher:r})}[vst](e){let r=Object.assign({agent:this},this[_st]);return this[_st]&&this[_st].connections===1?new EDs(e,r):new _Ds(e,r)}[QQn](e){let r=this[$Z].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[vst]("http://localhost:9999");return this[yst](e,n),n}for(let[n,o]of Array.from(this[$Z]))if(o&&typeof n!="string"&&vDs(n,e)){let s=this[vst](e);return this[yst](e,s),s[ksr]=o.dispatcher[ksr],s}}[ADs](){return this[VZ]}pendingInterceptors(){let e=this[$Z];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[ksr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new IDs}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new SDs(r.length===1?`1 interceptor is pending: ${e.format(r)}`.trim():`${r.length} interceptors are pending: -${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p();var{InvalidArgumentError:bDs}=ao(),{runtimeFeatures:SDs}=$F();function TDs(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(TDs,"createHeaderFilters");var VQn=SDs.has("crypto")?require("node:crypto"):null,IDs=VQn?.hash?t=>VQn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function zQn(t){return Array.isArray(t)&&(t.length&1)===0}a(zQn,"isUndiciHeaders");function xDs(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(xDs,"isUrlExcludedFactory");function wDs(t){let e={};if(!t)return e;if(zQn(t)){for(let r=0;r{"use strict";p();var{writeFile:kDs,readFile:PDs,mkdir:DDs}=require("node:fs/promises"),{dirname:NDs,resolve:KQn}=require("node:path"),{setTimeout:MDs,clearTimeout:JQn}=require("node:timers"),{InvalidArgumentError:ZQn,UndiciError:ODs}=ao(),{hashId:LDs,isUrlExcludedFactory:BDs,normalizeHeaders:XQn,createHeaderFilters:eqn}=Nsr();function JPe(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||XQn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:tqn(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(JPe,"formatRequestKey");function tqn(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(tqn,"filterHeadersForMatching");function rqn(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(rqn,"filterHeadersForStorage");function ZPe(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 LDs(r)}a(ZPe,"createRequestHash");var Msr=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=eqn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=BDs(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=JPe(e,this.#s,this.matchOptions),o=ZPe(n),s=XQn(r.headers),c={statusCode:r.statusCode,headers:rqn(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=JPe(e,this.#s,this.matchOptions),n=ZPe(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 ZQn("Snapshot path is required");try{let n=await PDs(KQn(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 ODs(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new ZQn("Snapshot path is required");let n=KQn(r);await DDs(NDs(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await kDs(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=JPe(e,this.#s,this.matchOptions),n=ZPe(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=JPe(e,this.#s,this.matchOptions),n=ZPe(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&&(JQn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=MDs(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(JQn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};nqn.exports={SnapshotRecorder:Msr,formatRequestKey:JPe,createRequestHash:ZPe,filterHeadersForMatching:tqn,filterHeadersForStorage:rqn,createHeaderFilters:eqn}});var aqn=I((llf,sqn)=>{"use strict";p();var FDs=LZ(),UDs=Dsr(),{SnapshotRecorder:QDs}=iqn(),qDs=hPe(),{InvalidArgumentError:jDs,UndiciError:HDs}=ao(),{validateSnapshotMode:GDs}=Nsr(),mb=Symbol("kSnapshotRecorder"),U5=Symbol("kSnapshotMode"),XPe=Symbol("kSnapshotPath"),Osr=Symbol("kSnapshotLoaded"),Est=Symbol("kRealAgent"),oqn=!1,Lsr=class extends UDs{static{a(this,"SnapshotAgent")}constructor(e={}){oqn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),oqn=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),GDs(r),(r==="playback"||r==="update")&&!n)throw new jDs(`snapshotPath is required when mode is '${r}'`);this[U5]=r,this[XPe]=n,this[mb]=new QDs({snapshotPath:this[XPe],mode:this[U5],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[Osr]=!1,(this[U5]==="record"||this[U5]==="update"||this[U5]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Est]=new FDs(e)),(this[U5]==="playback"||this[U5]==="update")&&this[XPe]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=qDs.wrap(r);let n=this[U5];if(this[mb].isUrlExcluded(e))return this[Est].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[Osr])return this.#e(e,r);let o=this[mb].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new HDs(`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[mb].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[Est].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[mb].loadSnapshots(e||this[XPe]),this[Osr]=!0,this[U5]==="playback"&&this.#n()}async saveSnapshots(e){return this[mb].saveSnapshots(e||this[XPe])}#n(){for(let e of this[mb].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[mb]}getMode(){return this[U5]}clearSnapshots(){this[mb].clear()}resetCallCounts(){this[mb].resetCallCounts()}deleteSnapshot(e){return this[mb].deleteSnapshot(e)}getSnapshotInfo(e){return this[mb].getSnapshotInfo(e)}replaceSnapshots(e){this[mb].replaceSnapshots(e)}async close(){await this[mb].close(),await this[Est]?.close(),await super.close()}};sqn.exports=Lsr});var _st=I((flf,dqn)=>{"use strict";p();var $Ds=Symbol.for("undici.globalDispatcher.2"),cqn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:VDs}=ao(),WDs=LZ();uqn()===void 0&&lqn(new WDs);function lqn(t){if(!t||typeof t.dispatch!="function")throw new VDs("Argument agent must implement Agent");Object.defineProperty(globalThis,$Ds,{value:t,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,cqn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(lqn,"setGlobalDispatcher");function uqn(){return globalThis[cqn]}a(uqn,"getGlobalDispatcher");var zDs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];dqn.exports={setGlobalDispatcher:lqn,getGlobalDispatcher:uqn,installedExports:zDs}});var Tpe=I((glf,fqn)=>{"use strict";p();var t8=require("node:assert"),YDs=hPe();fqn.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=YDs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return t8(!this.#t),t8(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return t8(!this.#t),t8(!this.#r),t8(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return t8(!this.#t),t8(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return t8(!this.#t),t8(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var Qsr=I((Elf,gqn)=>{"use strict";p();var gb=Po(),{kBodyUsed:e2e}=al(),Usr=require("node:assert"),{InvalidArgumentError:Bsr}=ao(),KDs=require("node:events"),JDs=[300,301,302,303,307,308],pqn=Symbol("body"),hqn=a(()=>{},"noop"),vst=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[pqn]=e,this[e2e]=!1}async*[Symbol.asyncIterator](){Usr(!this[e2e],"disturbed"),this[e2e]=!0,yield*this[pqn]}},Fsr=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Bsr("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 Bsr("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=[],gb.isStream(this.opts.body)?(gb.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Usr(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[e2e]=!1,KDs.prototype.on.call(this.opts.body,"data",function(){this[e2e]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new vst(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&gb.isIterable(this.opts.body)&&!gb.isFormDataLike(this.opts.body)&&(this.opts.body=new vst(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",gb.isStream(this.opts.body)&&gb.destroy(this.opts.body.on("error",hqn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",gb.isStream(this.opts.body)&&gb.destroy(this.opts.body.on("error",hqn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||gb.isDisturbed(this.opts.body)||JDs.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}=gb.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 Bsr(`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=ZDs(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 mqn(t,e,r){if(t.length===4)return gb.headerNameToString(t)==="host";if(e&&gb.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=gb.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(mqn,"shouldRemoveHeader");function ZDs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var XDs=Qsr();function eNs({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 XDs(e,s,l,o);return e(l,u)},"Intercept")}a(eNs,"createRedirectInterceptor");Aqn.exports=eNs});var _qn=I((Tlf,Eqn)=>{"use strict";p();var tNs=Tpe(),{ResponseError:rNs}=ao(),qsr=class extends tNs{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 rNs("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)}};Eqn.exports=()=>t=>a(function(r,n){return t(r,new qsr(r,{handler:n}))},"Intercept")});var Cqn=I((wlf,vqn)=>{"use strict";p();var nNs=ost();vqn.exports=t=>e=>a(function(n,o){return e(n,new nNs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var Sqn=I((Plf,bqn)=>{"use strict";p();var{InvalidArgumentError:iNs,RequestAbortedError:oNs}=ao(),sNs=Tpe(),jsr=class extends sNs{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 iNs("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 oNs(`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 aNs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new jsr({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(aNs,"createDumpInterceptor");bqn.exports=aNs});var wqn=I((Mlf,xqn)=>{"use strict";p();var{isIP:cNs}=require("node:net"),{lookup:lNs}=require("node:dns"),uNs=Tpe(),{InvalidArgumentError:WZ,InformationalError:dNs}=ao(),Hsr=Math.pow(2,31)-1;function fNs(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(fNs,"hasSafeIterator");function Tqn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(Tqn,"isHostHeader");function pNs(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"&&fNs(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(pNs,"normalizeHeaders");function hNs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},$sr=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 Gsr(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 dNs("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){lNs(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===Hsr?(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===Hsr?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===Hsr?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 Vsr(this,e,r)}},Vsr=class extends uNs{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:Iqn(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}}};xqn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new WZ("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new WZ("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new WZ("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new WZ("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new WZ("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new WZ("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 WZ("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 $sr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return cNs(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:Iqn(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var Ipe=I((Blf,kqn)=>{"use strict";p();var{safeHTTPMethods:Rqn,pathHasQueryOrFragment:mNs,hasSafeIterator:gNs}=Po(),{serializePathWithQuery:ANs}=Po();function yNs(t){if(!t.origin)throw new Error("opts.origin is undefined");let e=t.path||"/";return t.query&&!mNs(e)&&(e=ANs(e,t.query)),{origin:t.origin.toString(),method:t.method,path:e,headers:t.headers}}a(yNs,"makeCacheKey");function ENs(t){let e;if(t.headers==null)e={};else if(typeof t.headers=="object")if(e={},gNs(t.headers))for(let r of t.headers){if(!Array.isArray(r))throw new Error("opts.headers is not a valid header map");let[n,o]=r;if(typeof n!="string"||typeof o!="string")throw new Error("opts.headers is not a valid header map");e[n.toLowerCase()]=o}else for(let r of Object.keys(t.headers))e[r.toLowerCase()]=t.headers[r];else throw new Error("opts.headers is not an object");return e}a(ENs,"normalizeHeaders");function _Ns(t){if(typeof t!="object")throw new TypeError(`expected key to be object, got ${typeof t}`);for(let e of["origin","method","path"])if(typeof t[e]!="string")throw new TypeError(`expected key.${e} to be string, got ${typeof t[e]}`);if(t.headers!==void 0&&typeof t.headers!="object")throw new TypeError(`expected headers to be object, got ${typeof t}`)}a(_Ns,"assertCacheKey");function vNs(t){if(typeof t!="object")throw new TypeError(`expected value to be object, got ${typeof t}`);for(let e of["statusCode","cachedAt","staleAt","deleteAt"])if(typeof t[e]!="number")throw new TypeError(`expected value.${e} to be number, got ${typeof t[e]}`);if(typeof t.statusMessage!="string")throw new TypeError(`expected value.statusMessage to be string, got ${typeof t.statusMessage}`);if(t.headers!=null&&typeof t.headers!="object")throw new TypeError(`expected value.rawHeaders to be object, got ${typeof t.headers}`);if(t.vary!==void 0&&typeof t.vary!="object")throw new TypeError(`expected value.vary to be object, got ${typeof t.vary}`);if(t.etag!==void 0&&typeof t.etag!="string")throw new TypeError(`expected value.etag to be string, got ${typeof t.etag}`)}a(vNs,"assertCacheValue");function CNs(t){let e={},r;if(Array.isArray(t)){r=[];for(let n of t)r.push(...n.split(","))}else r=t.split(",");for(let n=0;n=2&&l[0]==='"'&&l[l.length-1]==='"'&&(l=l.substring(1,l.length-1));let u=parseInt(l,10);if(u!==u||c==="max-age"&&c in e&&e[c]>=u)continue;e[c]=u;break}case"private":case"no-cache":if(l){if(l[0]==='"'){let u=[l.substring(1)],d=l[l.length-1]==='"';if(!d)for(let f=n+1;f{"use strict";p();function wNs(t){switch(t[3]){case",":return RNs(t);case" ":return kNs(t);default:return PNs(t)}}a(wNs,"parseHttpDate");function RNs(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 g=t.charCodeAt(6);if(g<49||g>57)return;r=g-48}else{let g=t.charCodeAt(5);if(g<49||g>51)return;let A=t.charCodeAt(6);if(A<48||A>57)return;r=(g-48)*10+(A-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 g=t.charCodeAt(18);if(g<48||g>57)return;d=g-48}else{let g=t.charCodeAt(17);if(g<48||g>50)return;let A=t.charCodeAt(18);if(A<48||A>57||g===50&&A>51)return;d=(g-48)*10+(A-48)}let f=0;if(t[20]==="0"){let g=t.charCodeAt(21);if(g<48||g>57)return;f=g-48}else{let g=t.charCodeAt(20);if(g<48||g>53)return;let A=t.charCodeAt(21);if(A<48||A>57)return;f=(g-48)*10+(A-48)}let h=0;if(t[23]==="0"){let g=t.charCodeAt(24);if(g<48||g>57)return;h=g-48}else{let g=t.charCodeAt(23);if(g<48||g>53)return;let A=t.charCodeAt(24);if(A<48||A>57)return;h=(g-48)*10+(A-48)}let m=new Date(Date.UTC(u,n,r,d,f,h));return m.getUTCDay()===e?m:void 0}a(RNs,"parseImfDate");function kNs(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 g=t.charCodeAt(9);if(g<49||g>57)return;n=g-48}else{let g=t.charCodeAt(8);if(g<49||g>51)return;let A=t.charCodeAt(9);if(A<48||A>57)return;n=(g-48)*10+(A-48)}let o=0;if(t[11]==="0"){let g=t.charCodeAt(12);if(g<48||g>57)return;o=g-48}else{let g=t.charCodeAt(11);if(g<48||g>50)return;let A=t.charCodeAt(12);if(A<48||A>57||g===50&&A>51)return;o=(g-48)*10+(A-48)}let s=0;if(t[14]==="0"){let g=t.charCodeAt(15);if(g<48||g>57)return;s=g-48}else{let g=t.charCodeAt(14);if(g<48||g>53)return;let A=t.charCodeAt(15);if(A<48||A>57)return;s=(g-48)*10+(A-48)}let c=0;if(t[17]==="0"){let g=t.charCodeAt(18);if(g<48||g>57)return;c=g-48}else{let g=t.charCodeAt(17);if(g<48||g>53)return;let A=t.charCodeAt(18);if(A<48||A>57)return;c=(g-48)*10+(A-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),m=new Date(Date.UTC(h,r,n,o,s,c));return m.getUTCDay()===e?m:void 0}a(kNs,"parseAscTimeDate");function PNs(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 m=t.charCodeAt(e+3);if(m<49||m>57)return;n=m-48}else{let m=t.charCodeAt(e+2);if(m<49||m>51)return;let g=t.charCodeAt(e+3);if(g<48||g>57)return;n=(m-48)*10+(g-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 m=t.charCodeAt(e+13);if(m<48||m>57)return;u=m-48}else{let m=t.charCodeAt(e+12);if(m<48||m>50)return;let g=t.charCodeAt(e+13);if(g<48||g>57||m===50&&g>51)return;u=(m-48)*10+(g-48)}let d=0;if(t[e+15]==="0"){let m=t.charCodeAt(e+16);if(m<48||m>57)return;d=m-48}else{let m=t.charCodeAt(e+15);if(m<48||m>53)return;let g=t.charCodeAt(e+16);if(g<48||g>57)return;d=(m-48)*10+(g-48)}let f=0;if(t[e+18]==="0"){let m=t.charCodeAt(e+19);if(m<48||m>57)return;f=m-48}else{let m=t.charCodeAt(e+18);if(m<48||m>53)return;let g=t.charCodeAt(e+19);if(g<48||g>57)return;f=(m-48)*10+(g-48)}let h=new Date(Date.UTC(l,o,n,u,d,f));return h.getUTCDay()===r?h:void 0}a(PNs,"parseRfc850Date");Pqn.exports={parseHttpDate:wNs}});var Lqn=I((Hlf,Oqn)=>{"use strict";p();var DNs=Po(),{parseCacheControlHeader:NNs,parseVaryHeader:MNs,isEtagUsable:ONs}=Ipe(),{parseHttpDate:Nqn}=Dqn();function LNs(){}a(LNs,"noop");var Mqn=[200,203,204,206,300,301,308,404,405,410,414,501],BNs=[206],FNs=2147483647e3,Wsr=class{static{a(this,"CacheHandler")}#e;#t;#r;#n;#i;#o;constructor({store:e,type:r,cacheByDefault:n},o,s){this.#n=e,this.#t=r,this.#r=n,this.#e=o,this.#i=s}onRequestStart(e,r){this.#o?.destroy(),this.#o=void 0,this.#i.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#i.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){let s=a(()=>this.#i.onResponseStart?.(e,r,n,o),"downstreamOnHeaders"),c=this;if(!DNs.safeHTTPMethods.includes(this.#e.method)&&r>=200&&r<=399){try{this.#n.delete(this.#e)?.catch?.(LNs)}catch{}return s()}let l=n["cache-control"],u=n["last-modified"]&&Mqn.includes(r);if(!l&&!n.expires&&!u&&!this.#r)return s();let d=l?NNs(l):{};if(!UNs(this.#t,r,n,d,this.#e.headers))return s();let f=Date.now(),h=n.age?QNs(n.age):void 0;if(h&&h>=FNs)return s();let m=typeof n.date=="string"?Nqn(n.date):void 0,g=qNs(this.#t,f,h,n,m,d)??this.#r;if(g===void 0||h&&h>g)return s();let A=m?m.getTime():f,y=g+A;if(f>=y)return s();let E;if(this.#e.headers&&n.vary&&(E=MNs(n.vary,this.#e.headers),!E))return s();let _=jNs(A,d,y),v=HNs(n,d),b={statusCode:r,statusMessage:o,headers:v,vary:E,cacheControlDirectives:d,cachedAt:h?f-h:f,staleAt:y,deleteAt:_};if(r===304){let T=a(R=>{if(!R)return s();if(b.statusCode=R.statusCode,b.statusMessage=R.statusMessage,b.etag=R.etag,b.headers={...R.headers,...v},s(),this.#o=this.#n.createWriteStream(this.#e,b),!(!this.#o||!R?.body))if(typeof R.body.values=="function"){let x=R.body.values(),P=a(()=>{for(let D of x){let N=this.#o.write(D)===!1;if(this.#i.onResponseData?.(e,D),N)break}},"streamCachedBody");this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("drain",()=>{P()}).on("close",function(){c.#o===this&&(c.#o=void 0)}),P()}else typeof R.body.on=="function"&&(R.body.on("data",x=>{this.#o.write(x),this.#i.onResponseData?.(e,x)}).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"),w=this.#n.get(this.#e);w&&typeof w.then=="function"?w.then(T):T(w)}else{if(typeof n.etag=="string"&&ONs(n.etag)&&(b.etag=n.etag),this.#o=this.#n.createWriteStream(this.#e,b),!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 UNs(t,e,r,n,o){return!(e<200||BNs.includes(e)||!Mqn.includes(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?.includes("*")||o?.authorization&&(!n.public&&!n["s-maxage"]&&!n["must-revalidate"]||typeof o.authorization!="string"||Array.isArray(n["no-cache"])&&n["no-cache"].includes("authorization")||Array.isArray(n.private)&&n.private.includes("authorization")))}a(UNs,"canCacheResponse");function QNs(t){let e=parseInt(Array.isArray(t)?t[0]:t);return isNaN(e)?void 0:e*1e3}a(QNs,"getAge");function qNs(t,e,r,n,o,s){if(t==="shared"){let l=s["s-maxage"];if(l!==void 0)return l>0?l*1e3:void 0}let c=s["max-age"];if(c!==void 0)return c>0?c*1e3:void 0;if(typeof n.expires=="string"){let l=Nqn(n.expires);if(l)return e>=l.getTime()||o&&(o>=l||r!==void 0&&r>l-o)?void 0:l.getTime()-e}if(typeof n["last-modified"]=="string"){let l=new Date(n["last-modified"]);if(GNs(l))return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e3}a(qNs,"determineStaleAt");function jNs(t,e,r){let n=-1/0,o=-1/0,s=-1/0;if(e["stale-while-revalidate"]&&(n=r+e["stale-while-revalidate"]*1e3),e["stale-if-error"]&&(o=r+e["stale-if-error"]*1e3),e.immutable&&n===-1/0&&o===-1/0&&(s=t+31536e6),n===-1/0&&o===-1/0&&s===-1/0){let c=r-t;return r+c}return Math.max(r,n,o,s)}a(jNs,"determineDeleteAt");function HNs(t,e){let r=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];t.connection&&(Array.isArray(t.connection)?r.push(...t.connection.map(o=>o.trim())):r.push(...t.connection.split(",").map(o=>o.trim()))),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)t[o]&&(n??={...t},delete n[o]);return n??t}a(HNs,"stripNecessaryHeaders");function GNs(t){return t instanceof Date&&Number.isFinite(t.valueOf())}a(GNs,"isValidDate");Oqn.exports=Wsr});var Ysr=I((Vlf,Uqn)=>{"use strict";p();var{Writable:$Ns}=require("node:stream"),{EventEmitter:VNs}=require("node:events"),{assertCacheKey:Bqn,assertCacheValue:WNs}=Ipe(),zsr=class extends VNs{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){Bqn(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?Fqn(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){Bqn(e),WNs(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new $Ns({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=Fqn(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.#nn.deleteAt>r&&n.method===t.method&&(n.vary==null||Object.keys(n.vary).every(o=>n.vary[o]===null?t.headers[o]===void 0:n.vary[o]===t.headers[o])))}a(Fqn,"findEntry");Uqn.exports=zsr});var qqn=I((Ylf,Qqn)=>{"use strict";p();var zNs=require("node:assert"),Ksr=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(zNs(this.#t!=null),this.#e=r===304||this.#i&&r>=500&&r<=504,this.#t(this.#e,this.#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}};Qqn.exports=Ksr});var $qn=I((Zlf,Gqn)=>{"use strict";p();var jqn=require("node:assert"),{Readable:YNs}=require("node:stream"),xpe=Po(),t2e=Lqn(),KNs=Ysr(),JNs=qqn(),{assertCacheStore:ZNs,assertCacheMethods:XNs,makeCacheKey:eMs,normalizeHeaders:tMs,parseCacheControlHeader:rMs}=Ipe(),{AbortError:nMs}=ao();function iMs(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 oMs(t,e,{headers:r={}}){return!!(e?.["no-cache"]||t.cacheControlDirectives?.["no-cache"]&&!Array.isArray(t.cacheControlDirectives["no-cache"])||r["if-modified-since"]||r["if-none-match"])}a(oMs,"needsRevalidation");function sMs(t,e){let r=Date.now();if(r>t.staleAt){if(e?.["max-stale"]){let n=t.staleAt+e["max-stale"]*1e3;return r>n}return!0}if(e?.["min-fresh"]){let n=t.staleAt-r,o=e["min-fresh"]*1e3;return n<=o}return!1}a(sMs,"isStale");function aMs(t){let e=t.cacheControlDirectives?.["stale-while-revalidate"];if(!e)return!1;let r=Date.now(),n=t.staleAt+e*1e3;return r<=n}a(aMs,"withinStaleWhileRevalidateWindow");function cMs(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,[],Zsr,"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 t2e(e,r,n))}a(cMs,"handleUncachedResponse");function Jsr(t,e,r,n,o,s){let c=xpe.isStream(r.body)?r.body:YNs.from(r.body??[]);jqn(!c.destroyed,"stream should not be destroyed"),jqn(!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 nMs)}};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(Jsr,"sendCachedValue");function Hqn(t,e,r,n,o,s,c){if(!c)return cMs(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new t2e(e,r,n));let u=Math.round((l-c.cachedAt)/1e3);if(s?.["max-age"]&&u>=s["max-age"])return t(o,n);let d=sMs(c,s),f=oMs(c,s,o);if(d||f){if(xpe.isStream(o.body)&&xpe.bodyLength(o.body)!==0)return t(o,new t2e(e,r,n));if(!f&&aMs(c))return Jsr(n,o,c,u,null,!0),queueMicrotask(()=>{let A={...o.headers,"if-modified-since":new Date(c.cachedAt).toUTCString()};if(c.etag&&(A["if-none-match"]=c.etag),c.vary)for(let y in c.vary)c.vary[y]!=null&&(A[y]=c.vary[y]);t({...o,headers:A},new t2e(e,r,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let h=!1,m=c.cacheControlDirectives["stale-if-error"]??s?.["stale-if-error"];m&&(h=l{A?Jsr(n,o,c,u,y,d):xpe.isStream(c.body)&&c.body.on("error",Zsr).destroy()},new t2e(e,r,n),h))}xpe.isStream(o.body)&&o.body.on("error",Zsr).destroy(),Jsr(n,o,c,u,null,!1)}a(Hqn,"handleResult");Gqn.exports=(t={})=>{let{store:e=new KNs,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(ZNs(e,"opts.store"),XNs(r,"opts.methods"),iMs(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=xpe.safeHTTPMethods.filter(u=>r.includes(u)===!1);return u=>(d,f)=>{if(!d.origin||l.includes(d.method))return u(d,f);if(s!==void 0){let A=d.origin.toString().toLowerCase(),y=!1;for(let E=0;EHqn(u,c,m,f,d,h,A)):Hqn(u,c,m,f,d,h,g)}}});var Kqn=I((tuf,Yqn)=>{"use strict";p();var{createInflate:Xsr,createGunzip:Vqn,createBrotliDecompress:lMs,createZstdDecompress:uMs}=require("node:zlib"),{pipeline:dMs}=require("node:stream"),fMs=Tpe(),{runtimeFeatures:pMs}=$F(),Wqn={gzip:Vqn,"x-gzip":Vqn,br:lMs,deflate:Xsr,compress:Xsr,"x-compress":Xsr,...pMs.has("zstd")?{zstd:uMs}:{}},hMs=[204,304],zqn=!1,ear=class extends fMs{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=hMs,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(!Wqn[c])return o.length=0,o;o.push(Wqn[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),dMs(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 mMs(t={}){return zqn||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),zqn=!0),e=>(r,n)=>{let o=new ear(n,t);return e(r,o)}}a(mMs,"createDecompressInterceptor");Yqn.exports=mMs});var Xqn=I((iuf,Zqn)=>{"use strict";p();var{RequestAbortedError:gMs}=ao(),Jqn=5*1024*1024,tar=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=Jqn;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=Jqn){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 gMs(`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)}};Zqn.exports=tar});var tjn=I((auf,ejn)=>{"use strict";p();var AMs=require("node:diagnostics_channel"),yMs=Po(),EMs=Xqn(),{normalizeHeaders:_Ms,makeCacheKey:vMs,makeDeduplicationKey:CMs}=Ipe(),Cst=AMs.channel("undici:request:pending-requests");ejn.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(!yMs.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:_Ms(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=vMs(d),m=CMs(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new EMs(f,()=>{l.delete(m),Cst.hasSubscribers&&Cst.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),Cst.hasSubscribers&&Cst.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var ijn=I((uuf,njn)=>{"use strict";p();var{Writable:bMs}=require("node:stream"),{assertCacheKey:rar,assertCacheValue:SMs}=Ipe(),nar,ST=3,rjn=2*1e3*1e3*1e3;njn.exports=class{static{a(this,"SqliteCacheStore")}#e=rjn;#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>rjn)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}}nar||(nar=require("node:sqlite").DatabaseSync),this.#r=new nar(e?.location??":memory:"),this.#r.exec(` +${e.format(r)}`.trim())}};VQn.exports=Dsr});var Msr=I((dlf,KQn)=>{"use strict";p();var{InvalidArgumentError:wDs}=ao(),{runtimeFeatures:RDs}=VF();function kDs(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(kDs,"createHeaderFilters");var WQn=RDs.has("crypto")?require("node:crypto"):null,PDs=WQn?.hash?t=>WQn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function YQn(t){return Array.isArray(t)&&(t.length&1)===0}a(YQn,"isUndiciHeaders");function DDs(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(DDs,"isUrlExcludedFactory");function NDs(t){let e={};if(!t)return e;if(YQn(t)){for(let r=0;r{"use strict";p();var{writeFile:ODs,readFile:LDs,mkdir:BDs}=require("node:fs/promises"),{dirname:FDs,resolve:JQn}=require("node:path"),{setTimeout:UDs,clearTimeout:ZQn}=require("node:timers"),{InvalidArgumentError:XQn,UndiciError:QDs}=ao(),{hashId:qDs,isUrlExcludedFactory:jDs,normalizeHeaders:eqn,createHeaderFilters:tqn}=Msr();function JPe(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||eqn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:rqn(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(JPe,"formatRequestKey");function rqn(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(rqn,"filterHeadersForMatching");function nqn(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(nqn,"filterHeadersForStorage");function ZPe(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 qDs(r)}a(ZPe,"createRequestHash");var Osr=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=tqn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=jDs(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=JPe(e,this.#s,this.matchOptions),o=ZPe(n),s=eqn(r.headers),c={statusCode:r.statusCode,headers:nqn(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=JPe(e,this.#s,this.matchOptions),n=ZPe(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 XQn("Snapshot path is required");try{let n=await LDs(JQn(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 QDs(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new XQn("Snapshot path is required");let n=JQn(r);await BDs(FDs(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await ODs(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=JPe(e,this.#s,this.matchOptions),n=ZPe(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=JPe(e,this.#s,this.matchOptions),n=ZPe(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&&(ZQn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=UDs(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(ZQn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};iqn.exports={SnapshotRecorder:Osr,formatRequestKey:JPe,createRequestHash:ZPe,filterHeadersForMatching:rqn,filterHeadersForStorage:nqn,createHeaderFilters:tqn}});var cqn=I((Alf,aqn)=>{"use strict";p();var HDs=LZ(),GDs=Nsr(),{SnapshotRecorder:$Ds}=oqn(),VDs=hPe(),{InvalidArgumentError:WDs,UndiciError:zDs}=ao(),{validateSnapshotMode:YDs}=Msr(),mb=Symbol("kSnapshotRecorder"),U5=Symbol("kSnapshotMode"),XPe=Symbol("kSnapshotPath"),Lsr=Symbol("kSnapshotLoaded"),Cst=Symbol("kRealAgent"),sqn=!1,Bsr=class extends GDs{static{a(this,"SnapshotAgent")}constructor(e={}){sqn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),sqn=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),YDs(r),(r==="playback"||r==="update")&&!n)throw new WDs(`snapshotPath is required when mode is '${r}'`);this[U5]=r,this[XPe]=n,this[mb]=new $Ds({snapshotPath:this[XPe],mode:this[U5],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[Lsr]=!1,(this[U5]==="record"||this[U5]==="update"||this[U5]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Cst]=new HDs(e)),(this[U5]==="playback"||this[U5]==="update")&&this[XPe]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=VDs.wrap(r);let n=this[U5];if(this[mb].isUrlExcluded(e))return this[Cst].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[Lsr])return this.#e(e,r);let o=this[mb].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new zDs(`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[mb].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[Cst].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[mb].loadSnapshots(e||this[XPe]),this[Lsr]=!0,this[U5]==="playback"&&this.#n()}async saveSnapshots(e){return this[mb].saveSnapshots(e||this[XPe])}#n(){for(let e of this[mb].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[mb]}getMode(){return this[U5]}clearSnapshots(){this[mb].clear()}resetCallCounts(){this[mb].resetCallCounts()}deleteSnapshot(e){return this[mb].deleteSnapshot(e)}getSnapshotInfo(e){return this[mb].getSnapshotInfo(e)}replaceSnapshots(e){this[mb].replaceSnapshots(e)}async close(){await this[mb].close(),await this[Cst]?.close(),await super.close()}};aqn.exports=Bsr});var bst=I((_lf,fqn)=>{"use strict";p();var KDs=Symbol.for("undici.globalDispatcher.2"),lqn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:JDs}=ao(),ZDs=LZ();dqn()===void 0&&uqn(new ZDs);function uqn(t){if(!t||typeof t.dispatch!="function")throw new JDs("Argument agent must implement Agent");Object.defineProperty(globalThis,KDs,{value:t,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,lqn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(uqn,"setGlobalDispatcher");function dqn(){return globalThis[lqn]}a(dqn,"getGlobalDispatcher");var XDs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];fqn.exports={setGlobalDispatcher:uqn,getGlobalDispatcher:dqn,installedExports:XDs}});var Tpe=I((Slf,pqn)=>{"use strict";p();var r8=require("node:assert"),eNs=hPe();pqn.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=eNs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return r8(!this.#t),r8(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return r8(!this.#t),r8(!this.#r),r8(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return r8(!this.#t),r8(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return r8(!this.#t),r8(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var qsr=I((xlf,Aqn)=>{"use strict";p();var gb=Do(),{kBodyUsed:e2e}=al(),Qsr=require("node:assert"),{InvalidArgumentError:Fsr}=ao(),tNs=require("node:events"),rNs=[300,301,302,303,307,308],hqn=Symbol("body"),mqn=a(()=>{},"noop"),Sst=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[hqn]=e,this[e2e]=!1}async*[Symbol.asyncIterator](){Qsr(!this[e2e],"disturbed"),this[e2e]=!0,yield*this[hqn]}},Usr=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Fsr("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 Fsr("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=[],gb.isStream(this.opts.body)?(gb.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Qsr(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[e2e]=!1,tNs.prototype.on.call(this.opts.body,"data",function(){this[e2e]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Sst(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&gb.isIterable(this.opts.body)&&!gb.isFormDataLike(this.opts.body)&&(this.opts.body=new Sst(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",gb.isStream(this.opts.body)&&gb.destroy(this.opts.body.on("error",mqn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",gb.isStream(this.opts.body)&&gb.destroy(this.opts.body.on("error",mqn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||gb.isDisturbed(this.opts.body)||rNs.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}=gb.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 Fsr(`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=nNs(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 gqn(t,e,r){if(t.length===4)return gb.headerNameToString(t)==="host";if(e&&gb.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=gb.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(gqn,"shouldRemoveHeader");function nNs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var iNs=qsr();function oNs({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 iNs(e,s,l,o);return e(l,u)},"Intercept")}a(oNs,"createRedirectInterceptor");yqn.exports=oNs});var vqn=I((Nlf,_qn)=>{"use strict";p();var sNs=Tpe(),{ResponseError:aNs}=ao(),jsr=class extends sNs{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 aNs("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)}};_qn.exports=()=>t=>a(function(r,n){return t(r,new jsr(r,{handler:n}))},"Intercept")});var bqn=I((Llf,Cqn)=>{"use strict";p();var cNs=cst();Cqn.exports=t=>e=>a(function(n,o){return e(n,new cNs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var Tqn=I((Ulf,Sqn)=>{"use strict";p();var{InvalidArgumentError:lNs,RequestAbortedError:uNs}=ao(),dNs=Tpe(),Hsr=class extends dNs{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 lNs("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 uNs(`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 fNs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new Hsr({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(fNs,"createDumpInterceptor");Sqn.exports=fNs});var Rqn=I((jlf,wqn)=>{"use strict";p();var{isIP:pNs}=require("node:net"),{lookup:hNs}=require("node:dns"),mNs=Tpe(),{InvalidArgumentError:WZ,InformationalError:gNs}=ao(),Gsr=Math.pow(2,31)-1;function ANs(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(ANs,"hasSafeIterator");function Iqn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(Iqn,"isHostHeader");function yNs(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"&&ANs(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(yNs,"normalizeHeaders");function ENs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},Vsr=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 $sr(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 gNs("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){hNs(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===Gsr?(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===Gsr?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===Gsr?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 Wsr(this,e,r)}},Wsr=class extends mNs{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:xqn(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}}};wqn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new WZ("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new WZ("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new WZ("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new WZ("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new WZ("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new WZ("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 WZ("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 Vsr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return pNs(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:xqn(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var Ipe=I(($lf,Pqn)=>{"use strict";p();var{safeHTTPMethods:kqn,pathHasQueryOrFragment:_Ns,hasSafeIterator:vNs}=Do(),{serializePathWithQuery:CNs}=Do();function bNs(t){if(!t.origin)throw new Error("opts.origin is undefined");let e=t.path||"/";return t.query&&!_Ns(e)&&(e=CNs(e,t.query)),{origin:t.origin.toString(),method:t.method,path:e,headers:t.headers}}a(bNs,"makeCacheKey");function SNs(t){let e;if(t.headers==null)e={};else if(typeof t.headers=="object")if(e={},vNs(t.headers))for(let r of t.headers){if(!Array.isArray(r))throw new Error("opts.headers is not a valid header map");let[n,o]=r;if(typeof n!="string"||typeof o!="string")throw new Error("opts.headers is not a valid header map");e[n.toLowerCase()]=o}else for(let r of Object.keys(t.headers))e[r.toLowerCase()]=t.headers[r];else throw new Error("opts.headers is not an object");return e}a(SNs,"normalizeHeaders");function TNs(t){if(typeof t!="object")throw new TypeError(`expected key to be object, got ${typeof t}`);for(let e of["origin","method","path"])if(typeof t[e]!="string")throw new TypeError(`expected key.${e} to be string, got ${typeof t[e]}`);if(t.headers!==void 0&&typeof t.headers!="object")throw new TypeError(`expected headers to be object, got ${typeof t}`)}a(TNs,"assertCacheKey");function INs(t){if(typeof t!="object")throw new TypeError(`expected value to be object, got ${typeof t}`);for(let e of["statusCode","cachedAt","staleAt","deleteAt"])if(typeof t[e]!="number")throw new TypeError(`expected value.${e} to be number, got ${typeof t[e]}`);if(typeof t.statusMessage!="string")throw new TypeError(`expected value.statusMessage to be string, got ${typeof t.statusMessage}`);if(t.headers!=null&&typeof t.headers!="object")throw new TypeError(`expected value.rawHeaders to be object, got ${typeof t.headers}`);if(t.vary!==void 0&&typeof t.vary!="object")throw new TypeError(`expected value.vary to be object, got ${typeof t.vary}`);if(t.etag!==void 0&&typeof t.etag!="string")throw new TypeError(`expected value.etag to be string, got ${typeof t.etag}`)}a(INs,"assertCacheValue");function xNs(t){let e={},r;if(Array.isArray(t)){r=[];for(let n of t)r.push(...n.split(","))}else r=t.split(",");for(let n=0;n=2&&l[0]==='"'&&l[l.length-1]==='"'&&(l=l.substring(1,l.length-1));let u=parseInt(l,10);if(u!==u||c==="max-age"&&c in e&&e[c]>=u)continue;e[c]=u;break}case"private":case"no-cache":if(l){if(l[0]==='"'){let u=[l.substring(1)],d=l[l.length-1]==='"';if(!d)for(let f=n+1;f{"use strict";p();function NNs(t){switch(t[3]){case",":return MNs(t);case" ":return ONs(t);default:return LNs(t)}}a(NNs,"parseHttpDate");function MNs(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 g=t.charCodeAt(6);if(g<49||g>57)return;r=g-48}else{let g=t.charCodeAt(5);if(g<49||g>51)return;let A=t.charCodeAt(6);if(A<48||A>57)return;r=(g-48)*10+(A-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 g=t.charCodeAt(18);if(g<48||g>57)return;d=g-48}else{let g=t.charCodeAt(17);if(g<48||g>50)return;let A=t.charCodeAt(18);if(A<48||A>57||g===50&&A>51)return;d=(g-48)*10+(A-48)}let f=0;if(t[20]==="0"){let g=t.charCodeAt(21);if(g<48||g>57)return;f=g-48}else{let g=t.charCodeAt(20);if(g<48||g>53)return;let A=t.charCodeAt(21);if(A<48||A>57)return;f=(g-48)*10+(A-48)}let h=0;if(t[23]==="0"){let g=t.charCodeAt(24);if(g<48||g>57)return;h=g-48}else{let g=t.charCodeAt(23);if(g<48||g>53)return;let A=t.charCodeAt(24);if(A<48||A>57)return;h=(g-48)*10+(A-48)}let m=new Date(Date.UTC(u,n,r,d,f,h));return m.getUTCDay()===e?m:void 0}a(MNs,"parseImfDate");function ONs(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 g=t.charCodeAt(9);if(g<49||g>57)return;n=g-48}else{let g=t.charCodeAt(8);if(g<49||g>51)return;let A=t.charCodeAt(9);if(A<48||A>57)return;n=(g-48)*10+(A-48)}let o=0;if(t[11]==="0"){let g=t.charCodeAt(12);if(g<48||g>57)return;o=g-48}else{let g=t.charCodeAt(11);if(g<48||g>50)return;let A=t.charCodeAt(12);if(A<48||A>57||g===50&&A>51)return;o=(g-48)*10+(A-48)}let s=0;if(t[14]==="0"){let g=t.charCodeAt(15);if(g<48||g>57)return;s=g-48}else{let g=t.charCodeAt(14);if(g<48||g>53)return;let A=t.charCodeAt(15);if(A<48||A>57)return;s=(g-48)*10+(A-48)}let c=0;if(t[17]==="0"){let g=t.charCodeAt(18);if(g<48||g>57)return;c=g-48}else{let g=t.charCodeAt(17);if(g<48||g>53)return;let A=t.charCodeAt(18);if(A<48||A>57)return;c=(g-48)*10+(A-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),m=new Date(Date.UTC(h,r,n,o,s,c));return m.getUTCDay()===e?m:void 0}a(ONs,"parseAscTimeDate");function LNs(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 m=t.charCodeAt(e+3);if(m<49||m>57)return;n=m-48}else{let m=t.charCodeAt(e+2);if(m<49||m>51)return;let g=t.charCodeAt(e+3);if(g<48||g>57)return;n=(m-48)*10+(g-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 m=t.charCodeAt(e+13);if(m<48||m>57)return;u=m-48}else{let m=t.charCodeAt(e+12);if(m<48||m>50)return;let g=t.charCodeAt(e+13);if(g<48||g>57||m===50&&g>51)return;u=(m-48)*10+(g-48)}let d=0;if(t[e+15]==="0"){let m=t.charCodeAt(e+16);if(m<48||m>57)return;d=m-48}else{let m=t.charCodeAt(e+15);if(m<48||m>53)return;let g=t.charCodeAt(e+16);if(g<48||g>57)return;d=(m-48)*10+(g-48)}let f=0;if(t[e+18]==="0"){let m=t.charCodeAt(e+19);if(m<48||m>57)return;f=m-48}else{let m=t.charCodeAt(e+18);if(m<48||m>53)return;let g=t.charCodeAt(e+19);if(g<48||g>57)return;f=(m-48)*10+(g-48)}let h=new Date(Date.UTC(l,o,n,u,d,f));return h.getUTCDay()===r?h:void 0}a(LNs,"parseRfc850Date");Dqn.exports={parseHttpDate:NNs}});var Bqn=I((Jlf,Lqn)=>{"use strict";p();var BNs=Do(),{parseCacheControlHeader:FNs,parseVaryHeader:UNs,isEtagUsable:QNs}=Ipe(),{parseHttpDate:Mqn}=Nqn();function qNs(){}a(qNs,"noop");var Oqn=[200,203,204,206,300,301,308,404,405,410,414,501],jNs=[206],HNs=2147483647e3,zsr=class{static{a(this,"CacheHandler")}#e;#t;#r;#n;#i;#o;constructor({store:e,type:r,cacheByDefault:n},o,s){this.#n=e,this.#t=r,this.#r=n,this.#e=o,this.#i=s}onRequestStart(e,r){this.#o?.destroy(),this.#o=void 0,this.#i.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#i.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){let s=a(()=>this.#i.onResponseStart?.(e,r,n,o),"downstreamOnHeaders"),c=this;if(!BNs.safeHTTPMethods.includes(this.#e.method)&&r>=200&&r<=399){try{this.#n.delete(this.#e)?.catch?.(qNs)}catch{}return s()}let l=n["cache-control"],u=n["last-modified"]&&Oqn.includes(r);if(!l&&!n.expires&&!u&&!this.#r)return s();let d=l?FNs(l):{};if(!GNs(this.#t,r,n,d,this.#e.headers))return s();let f=Date.now(),h=n.age?$Ns(n.age):void 0;if(h&&h>=HNs)return s();let m=typeof n.date=="string"?Mqn(n.date):void 0,g=VNs(this.#t,f,h,n,m,d)??this.#r;if(g===void 0||h&&h>g)return s();let A=m?m.getTime():f,y=g+A;if(f>=y)return s();let E;if(this.#e.headers&&n.vary&&(E=UNs(n.vary,this.#e.headers),!E))return s();let _=WNs(A,d,y),v=zNs(n,d),b={statusCode:r,statusMessage:o,headers:v,vary:E,cacheControlDirectives:d,cachedAt:h?f-h:f,staleAt:y,deleteAt:_};if(r===304){let T=a(R=>{if(!R)return s();if(b.statusCode=R.statusCode,b.statusMessage=R.statusMessage,b.etag=R.etag,b.headers={...R.headers,...v},s(),this.#o=this.#n.createWriteStream(this.#e,b),!(!this.#o||!R?.body))if(typeof R.body.values=="function"){let x=R.body.values(),P=a(()=>{for(let D of x){let N=this.#o.write(D)===!1;if(this.#i.onResponseData?.(e,D),N)break}},"streamCachedBody");this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("drain",()=>{P()}).on("close",function(){c.#o===this&&(c.#o=void 0)}),P()}else typeof R.body.on=="function"&&(R.body.on("data",x=>{this.#o.write(x),this.#i.onResponseData?.(e,x)}).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"),w=this.#n.get(this.#e);w&&typeof w.then=="function"?w.then(T):T(w)}else{if(typeof n.etag=="string"&&QNs(n.etag)&&(b.etag=n.etag),this.#o=this.#n.createWriteStream(this.#e,b),!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 GNs(t,e,r,n,o){return!(e<200||jNs.includes(e)||!Oqn.includes(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?.includes("*")||o?.authorization&&(!n.public&&!n["s-maxage"]&&!n["must-revalidate"]||typeof o.authorization!="string"||Array.isArray(n["no-cache"])&&n["no-cache"].includes("authorization")||Array.isArray(n.private)&&n.private.includes("authorization")))}a(GNs,"canCacheResponse");function $Ns(t){let e=parseInt(Array.isArray(t)?t[0]:t);return isNaN(e)?void 0:e*1e3}a($Ns,"getAge");function VNs(t,e,r,n,o,s){if(t==="shared"){let l=s["s-maxage"];if(l!==void 0)return l>0?l*1e3:void 0}let c=s["max-age"];if(c!==void 0)return c>0?c*1e3:void 0;if(typeof n.expires=="string"){let l=Mqn(n.expires);if(l)return e>=l.getTime()||o&&(o>=l||r!==void 0&&r>l-o)?void 0:l.getTime()-e}if(typeof n["last-modified"]=="string"){let l=new Date(n["last-modified"]);if(YNs(l))return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e3}a(VNs,"determineStaleAt");function WNs(t,e,r){let n=-1/0,o=-1/0,s=-1/0;if(e["stale-while-revalidate"]&&(n=r+e["stale-while-revalidate"]*1e3),e["stale-if-error"]&&(o=r+e["stale-if-error"]*1e3),e.immutable&&n===-1/0&&o===-1/0&&(s=t+31536e6),n===-1/0&&o===-1/0&&s===-1/0){let c=r-t;return r+c}return Math.max(r,n,o,s)}a(WNs,"determineDeleteAt");function zNs(t,e){let r=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];t.connection&&(Array.isArray(t.connection)?r.push(...t.connection.map(o=>o.trim())):r.push(...t.connection.split(",").map(o=>o.trim()))),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)t[o]&&(n??={...t},delete n[o]);return n??t}a(zNs,"stripNecessaryHeaders");function YNs(t){return t instanceof Date&&Number.isFinite(t.valueOf())}a(YNs,"isValidDate");Lqn.exports=zsr});var Ksr=I((euf,Qqn)=>{"use strict";p();var{Writable:KNs}=require("node:stream"),{EventEmitter:JNs}=require("node:events"),{assertCacheKey:Fqn,assertCacheValue:ZNs}=Ipe(),Ysr=class extends JNs{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){Fqn(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?Uqn(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){Fqn(e),ZNs(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new KNs({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=Uqn(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.#nn.deleteAt>r&&n.method===t.method&&(n.vary==null||Object.keys(n.vary).every(o=>n.vary[o]===null?t.headers[o]===void 0:n.vary[o]===t.headers[o])))}a(Uqn,"findEntry");Qqn.exports=Ysr});var jqn=I((nuf,qqn)=>{"use strict";p();var XNs=require("node:assert"),Jsr=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(XNs(this.#t!=null),this.#e=r===304||this.#i&&r>=500&&r<=504,this.#t(this.#e,this.#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}};qqn.exports=Jsr});var Vqn=I((suf,$qn)=>{"use strict";p();var Hqn=require("node:assert"),{Readable:eMs}=require("node:stream"),xpe=Do(),t2e=Bqn(),tMs=Ksr(),rMs=jqn(),{assertCacheStore:nMs,assertCacheMethods:iMs,makeCacheKey:oMs,normalizeHeaders:sMs,parseCacheControlHeader:aMs}=Ipe(),{AbortError:cMs}=ao();function lMs(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 uMs(t,e,{headers:r={}}){return!!(e?.["no-cache"]||t.cacheControlDirectives?.["no-cache"]&&!Array.isArray(t.cacheControlDirectives["no-cache"])||r["if-modified-since"]||r["if-none-match"])}a(uMs,"needsRevalidation");function dMs(t,e){let r=Date.now();if(r>t.staleAt){if(e?.["max-stale"]){let n=t.staleAt+e["max-stale"]*1e3;return r>n}return!0}if(e?.["min-fresh"]){let n=t.staleAt-r,o=e["min-fresh"]*1e3;return n<=o}return!1}a(dMs,"isStale");function fMs(t){let e=t.cacheControlDirectives?.["stale-while-revalidate"];if(!e)return!1;let r=Date.now(),n=t.staleAt+e*1e3;return r<=n}a(fMs,"withinStaleWhileRevalidateWindow");function pMs(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,[],Xsr,"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 t2e(e,r,n))}a(pMs,"handleUncachedResponse");function Zsr(t,e,r,n,o,s){let c=xpe.isStream(r.body)?r.body:eMs.from(r.body??[]);Hqn(!c.destroyed,"stream should not be destroyed"),Hqn(!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 cMs)}};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(Zsr,"sendCachedValue");function Gqn(t,e,r,n,o,s,c){if(!c)return pMs(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new t2e(e,r,n));let u=Math.round((l-c.cachedAt)/1e3);if(s?.["max-age"]&&u>=s["max-age"])return t(o,n);let d=dMs(c,s),f=uMs(c,s,o);if(d||f){if(xpe.isStream(o.body)&&xpe.bodyLength(o.body)!==0)return t(o,new t2e(e,r,n));if(!f&&fMs(c))return Zsr(n,o,c,u,null,!0),queueMicrotask(()=>{let A={...o.headers,"if-modified-since":new Date(c.cachedAt).toUTCString()};if(c.etag&&(A["if-none-match"]=c.etag),c.vary)for(let y in c.vary)c.vary[y]!=null&&(A[y]=c.vary[y]);t({...o,headers:A},new t2e(e,r,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let h=!1,m=c.cacheControlDirectives["stale-if-error"]??s?.["stale-if-error"];m&&(h=l{A?Zsr(n,o,c,u,y,d):xpe.isStream(c.body)&&c.body.on("error",Xsr).destroy()},new t2e(e,r,n),h))}xpe.isStream(o.body)&&o.body.on("error",Xsr).destroy(),Zsr(n,o,c,u,null,!1)}a(Gqn,"handleResult");$qn.exports=(t={})=>{let{store:e=new tMs,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(nMs(e,"opts.store"),iMs(r,"opts.methods"),lMs(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=xpe.safeHTTPMethods.filter(u=>r.includes(u)===!1);return u=>(d,f)=>{if(!d.origin||l.includes(d.method))return u(d,f);if(s!==void 0){let A=d.origin.toString().toLowerCase(),y=!1;for(let E=0;EGqn(u,c,m,f,d,h,A)):Gqn(u,c,m,f,d,h,g)}}});var Jqn=I((luf,Kqn)=>{"use strict";p();var{createInflate:ear,createGunzip:Wqn,createBrotliDecompress:hMs,createZstdDecompress:mMs}=require("node:zlib"),{pipeline:gMs}=require("node:stream"),AMs=Tpe(),{runtimeFeatures:yMs}=VF(),zqn={gzip:Wqn,"x-gzip":Wqn,br:hMs,deflate:ear,compress:ear,"x-compress":ear,...yMs.has("zstd")?{zstd:mMs}:{}},EMs=[204,304],Yqn=!1,tar=class extends AMs{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=EMs,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(!zqn[c])return o.length=0,o;o.push(zqn[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),gMs(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 _Ms(t={}){return Yqn||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),Yqn=!0),e=>(r,n)=>{let o=new tar(n,t);return e(r,o)}}a(_Ms,"createDecompressInterceptor");Kqn.exports=_Ms});var ejn=I((fuf,Xqn)=>{"use strict";p();var{RequestAbortedError:vMs}=ao(),Zqn=5*1024*1024,rar=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=Zqn;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=Zqn){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 vMs(`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)}};Xqn.exports=rar});var rjn=I((muf,tjn)=>{"use strict";p();var CMs=require("node:diagnostics_channel"),bMs=Do(),SMs=ejn(),{normalizeHeaders:TMs,makeCacheKey:IMs,makeDeduplicationKey:xMs}=Ipe(),Tst=CMs.channel("undici:request:pending-requests");tjn.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(!bMs.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:TMs(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=IMs(d),m=xMs(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new SMs(f,()=>{l.delete(m),Tst.hasSubscribers&&Tst.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),Tst.hasSubscribers&&Tst.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var ojn=I((yuf,ijn)=>{"use strict";p();var{Writable:wMs}=require("node:stream"),{assertCacheKey:nar,assertCacheValue:RMs}=Ipe(),iar,IT=3,njn=2*1e3*1e3*1e3;ijn.exports=class{static{a(this,"SqliteCacheStore")}#e=njn;#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>njn)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}}iar||(iar=require("node:sqlite").DatabaseSync),this.#r=new iar(e?.location??":memory:"),this.#r.exec(` PRAGMA journal_mode = WAL; PRAGMA synchronous = NORMAL; PRAGMA temp_store = memory; PRAGMA optimize; - CREATE TABLE IF NOT EXISTS cacheInterceptorV${ST} ( + CREATE TABLE IF NOT EXISTS cacheInterceptorV${IT} ( -- Data specific to us id INTEGER PRIMARY KEY AUTOINCREMENT, url TEXT NOT NULL, @@ -241,8 +241,8 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p staleAt INTEGER NOT NULL ); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${ST}_getValuesQuery ON cacheInterceptorV${ST}(url, method, deleteAt); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${ST}_deleteByUrlQuery ON cacheInterceptorV${ST}(deleteAt); + CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${IT}_getValuesQuery ON cacheInterceptorV${IT}(url, method, deleteAt); + CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${IT}_deleteByUrlQuery ON cacheInterceptorV${IT}(deleteAt); `),this.#n=this.#r.prepare(` SELECT id, @@ -256,14 +256,14 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p vary, cachedAt, staleAt - FROM cacheInterceptorV${ST} + FROM cacheInterceptorV${IT} WHERE url = ? AND method = ? ORDER BY deleteAt ASC `),this.#i=this.#r.prepare(` - UPDATE cacheInterceptorV${ST} SET + UPDATE cacheInterceptorV${IT} SET body = ?, deleteAt = ?, statusCode = ?, @@ -276,7 +276,7 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p WHERE id = ? `),this.#o=this.#r.prepare(` - INSERT INTO cacheInterceptorV${ST} ( + INSERT INTO cacheInterceptorV${IT} ( url, method, body, @@ -290,121 +290,121 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p cachedAt, staleAt ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - `),this.#a=this.#r.prepare(`DELETE FROM cacheInterceptorV${ST} WHERE url = ?`),this.#c=this.#r.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${ST}`),this.#s=this.#r.prepare(`DELETE FROM cacheInterceptorV${ST} WHERE deleteAt <= ?`),this.#u=this.#t===1/0?null:this.#r.prepare(` - DELETE FROM cacheInterceptorV${ST} + `),this.#a=this.#r.prepare(`DELETE FROM cacheInterceptorV${IT} WHERE url = ?`),this.#c=this.#r.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${IT}`),this.#s=this.#r.prepare(`DELETE FROM cacheInterceptorV${IT} WHERE deleteAt <= ?`),this.#u=this.#t===1/0?null:this.#r.prepare(` + DELETE FROM cacheInterceptorV${IT} WHERE id IN ( SELECT id - FROM cacheInterceptorV${ST} + FROM cacheInterceptorV${IT} ORDER BY cachedAt ASC LIMIT ? ) - `)}close(){this.#r.close()}get(e){rar(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){rar(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){rar(e),SMs(r);let n=0,o=[],s=this;return new bMs({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(!TMs(o[h],f[h])){d=!1;break}}if(d)return u}}};function TMs(t,e){return t==null&&e==null?!0:t==null&&e!=null||t!=null&&e==null?!1:Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:t.every((r,n)=>r===e[n]):t===e}a(TMs,"headerValueEquals")});var zZ=I((puf,djn)=>{"use strict";p();var{kConstruct:IMs}=al(),{kEnumerableProperty:wpe}=Po(),{iteratorMixin:xMs,isValidHeaderName:r2e,isValidHeaderValue:sjn}=ET(),{webidl:Pa}=$A(),iar=require("node:assert"),bst=require("node:util");function ojn(t){return t===10||t===13||t===9||t===32}a(ojn,"isHTTPWhiteSpaceCharCode");function ajn(t){let e=0,r=t.length;for(;r>e&&ojn(t.charCodeAt(r-1));)--r;for(;r>e&&ojn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(ajn,"headerValueNormalize");function cjn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(cjn,"fill");function oar(t,e,r){if(r=ajn(r),r2e(e)){if(!sjn(r))throw Pa.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Pa.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(ujn(t)==="immutable")throw new TypeError("immutable");return Tst(t).append(e,r,!1)}a(oar,"appendHeader");function wMs(t){let e=Tst(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],iar(s!==null);return r.sort(ljn)}}},w2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Pa.util.markAsUncloneable(this),e!==IMs&&(this.#t=new Sst,this.#e="none",e!==void 0&&(e=Pa.converters.HeadersInit(e,"Headers constructor","init"),cjn(this,e)))}append(e,r){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Pa.converters.ByteString(e,n,"name"),r=Pa.converters.ByteString(r,n,"value"),oar(this,e,r)}delete(e){if(Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.delete"),e=Pa.converters.ByteString(e,"Headers.delete","name"),!r2e(e))throw Pa.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){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Pa.converters.ByteString(e,r,"name"),!r2e(e))throw Pa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Pa.converters.ByteString(e,r,"name"),!r2e(e))throw Pa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Pa.converters.ByteString(e,n,"name"),r=Pa.converters.ByteString(r,n,"value"),r=ajn(r),r2e(e)){if(!sjn(r))throw Pa.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Pa.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Pa.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[bst.inspect.custom](e,r){return r.depth??=e,`Headers ${bst.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:ujn,setHeadersGuard:RMs,getHeadersList:Tst,setHeadersList:kMs}=w2;Reflect.deleteProperty(w2,"getHeadersGuard");Reflect.deleteProperty(w2,"setHeadersGuard");Reflect.deleteProperty(w2,"getHeadersList");Reflect.deleteProperty(w2,"setHeadersList");xMs("Headers",w2,wMs,0,1);Object.defineProperties(w2.prototype,{append:wpe,delete:wpe,get:wpe,has:wpe,set:wpe,getSetCookie:wpe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[bst.inspect.custom]:{enumerable:!1}});Pa.converters.HeadersInit=function(t,e,r){if(Pa.util.Type(t)===Pa.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!bst.types.isProxy(t)&&n===w2.prototype.entries)try{return Tst(t).entriesList}catch{}return typeof n=="function"?Pa.converters["sequence>"](t,e,r,n.bind(t)):Pa.converters["record"](t,e,r)}throw Pa.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};djn.exports={fill:cjn,compareHeaderName:ljn,Headers:w2,HeadersList:Sst,getHeadersGuard:ujn,setHeadersGuard:RMs,setHeadersList:kMs,getHeadersList:Tst}});var i2e=I((guf,bjn)=>{"use strict";p();var{Headers:Ajn,HeadersList:fjn,fill:PMs,getHeadersGuard:DMs,setHeadersGuard:yjn,setHeadersList:Ejn}=zZ(),{extractBody:pjn,cloneBody:NMs,mixinBody:MMs,streamRegistry:_jn,bodyUnusable:OMs}=ape(),vjn=Po(),hjn=require("node:util"),{kEnumerableProperty:TT}=vjn,{isValidReasonPhrase:LMs,isCancelled:BMs,isAborted:FMs,isErrorLike:UMs,environmentSettingsObject:QMs}=ET(),{redirectStatusSet:qMs,nullBodyStatus:jMs}=APe(),{webidl:ra}=$A(),{URLSerializer:mjn}=Mw(),{kConstruct:xst}=al(),sar=require("node:assert"),{isomorphicEncode:HMs,serializeJavascriptValueToJSONString:GMs}=GF(),$Ms=new TextEncoder("utf-8"),IT=class t{static{a(this,"Response")}#e;#t;static error(){return n2e(wst(),"immutable")}static json(e,r=void 0){ra.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ra.converters.ResponseInit(r));let n=$Ms.encode(GMs(e)),o=pjn(n),s=n2e(Rpe({}),"response");return gjn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ra.argumentLengthCheck(arguments,1,"Response.redirect"),e=ra.converters.USVString(e),r=ra.converters["unsigned short"](r);let n;try{n=new URL(e,QMs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!qMs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=n2e(Rpe({}),"immutable");o.#t.status=r;let s=HMs(mjn(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(ra.util.markAsUncloneable(this),e===xst)return;e!==null&&(e=ra.converters.BodyInit(e,"Response","body")),r=ra.converters.ResponseInit(r),this.#t=Rpe({}),this.#e=new Ajn(xst),yjn(this.#e,"response"),Ejn(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=pjn(e);n={body:o,type:s}}gjn(this,r,n)}get type(){return ra.brandCheck(this,t),this.#t.type}get url(){ra.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":mjn(r,!0)}get redirected(){return ra.brandCheck(this,t),this.#t.urlList.length>1}get status(){return ra.brandCheck(this,t),this.#t.status}get ok(){return ra.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return ra.brandCheck(this,t),this.#t.statusText}get headers(){return ra.brandCheck(this,t),this.#e}get body(){return ra.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return ra.brandCheck(this,t),!!this.#t.body&&vjn.isDisturbed(this.#t.body.stream)}clone(){if(ra.brandCheck(this,t),OMs(this.#t))throw ra.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=aar(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&_jn.register(this,new WeakRef(this.#t.body.stream)),n2e(e,DMs(this.#e))}[hjn.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 ${hjn.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:VMs,setResponseHeaders:WMs,getResponseState:YZ,setResponseState:zMs}=IT;Reflect.deleteProperty(IT,"getResponseHeaders");Reflect.deleteProperty(IT,"setResponseHeaders");Reflect.deleteProperty(IT,"getResponseState");Reflect.deleteProperty(IT,"setResponseState");MMs(IT,YZ);Object.defineProperties(IT.prototype,{type:TT,url:TT,status:TT,ok:TT,redirected:TT,statusText:TT,headers:TT,clone:TT,body:TT,bodyUsed:TT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(IT,{json:TT,redirect:TT,error:TT});function aar(t){if(t.internalResponse)return Cjn(aar(t.internalResponse),t.type);let e=Rpe({...t,body:null});return t.body!=null&&(e.body=NMs(t.body)),e}a(aar,"cloneResponse");function Rpe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new fjn(t?.headersList):new fjn,urlList:t?.urlList?[...t.urlList]:[]}}a(Rpe,"makeResponse");function wst(t){let e=UMs(t);return Rpe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(wst,"makeNetworkError");function YMs(t){return t.type==="error"&&t.status===0}a(YMs,"isNetworkError");function Ist(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 sar(!(n in e)),r[n]=o,!0}})}a(Ist,"makeFilteredResponse");function Cjn(t,e){if(e==="basic")return Ist(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Ist(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Ist(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return Ist(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});sar(!1)}a(Cjn,"filterResponse");function KMs(t,e=null){return sar(BMs(t)),FMs(t)?wst(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):wst(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(KMs,"makeAppropriateNetworkError");function gjn(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&&!LMs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(YZ(t).status=e.status),"statusText"in e&&e.statusText!=null&&(YZ(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&PMs(VMs(t),e.headers),r){if(jMs.includes(t.status))throw ra.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});YZ(t).body=r.body,r.type!=null&&!YZ(t).headersList.contains("content-type",!0)&&YZ(t).headersList.append("content-type",r.type,!0)}}a(gjn,"initializeResponse");function n2e(t,e){let r=new IT(xst);zMs(r,t);let n=new Ajn(xst);return WMs(r,n),Ejn(n,t.headersList),yjn(n,e),t.urlList.length!==0&&t.body?.stream&&_jn.register(r,new WeakRef(t.body.stream)),r}a(n2e,"fromInnerResponse");ra.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ra.converters.USVString(t,e,r):ra.is.Blob(t)||ra.is.BufferSource(t)||ra.is.FormData(t)||ra.is.URLSearchParams(t)?t:ra.converters.DOMString(t,e,r)};ra.converters.BodyInit=function(t,e,r){return ra.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:ra.converters.XMLHttpRequestBodyInit(t,e,r)};ra.converters.ResponseInit=ra.dictionaryConverter([{key:"status",converter:ra.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ra.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ra.converters.HeadersInit}]);ra.is.Response=ra.util.MakeTypeAssertion(IT);bjn.exports={isNetworkError:YMs,makeNetworkError:wst,makeResponse:Rpe,makeAppropriateNetworkError:KMs,filterResponse:Cjn,Response:IT,cloneResponse:aar,fromInnerResponse:n2e,getResponseState:YZ}});var kpe=I((Euf,Bjn)=>{"use strict";p();var{extractBody:JMs,mixinBody:ZMs,cloneBody:XMs,bodyUnusable:Sjn}=ape(),{Headers:kjn,fill:eOs,HeadersList:Pst,setHeadersGuard:car,getHeadersGuard:tOs,setHeadersList:Pjn,getHeadersList:Tjn}=zZ(),kst=Po(),Ijn=require("node:util"),{isValidHTTPToken:rOs,sameOrigin:xjn,environmentSettingsObject:Rst}=ET(),{forbiddenMethodsSet:nOs,corsSafeListedMethodsSet:iOs,referrerPolicy:oOs,requestRedirect:sOs,requestMode:aOs,requestCredentials:cOs,requestCache:lOs,requestDuplex:uOs}=APe(),{kEnumerableProperty:um,normalizedMethodRecordsBase:dOs,normalizedMethodRecords:fOs}=kst,{webidl:Li}=$A(),{URLSerializer:pOs}=Mw(),{kConstruct:Dst}=al(),hOs=require("node:assert"),{getMaxListeners:Djn,setMaxListeners:mOs,defaultMaxListeners:gOs}=require("node:events"),AOs=Symbol("abortController"),Njn=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Nst=new WeakMap,lar;try{lar=Djn(new AbortController().signal)>0}catch{lar=!1}function wjn(t){return e;function e(){let r=t.deref();if(r!==void 0){Njn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Nst.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()}Nst.delete(r.signal)}}}}a(wjn,"buildAbort");var Rjn=!1,Ab=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Li.util.markAsUncloneable(this),e===Dst)return;Li.argumentLengthCheck(arguments,1,"Request constructor"),e=Li.converters.RequestInfo(e),r=Li.converters.RequestInit(r);let o=null,s=null,c=Rst.settingsObject.baseUrl,l=null;if(typeof e=="string"){this.#t=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=Mst({urlList:[_]}),s="cors"}else hOs(Li.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=Rst.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&xjn(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=Mst({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Rst.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 _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!xjn(v,Rst.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 Li.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 _=r.method,v=fOs[_];if(v!==void 0)o.method=v;else{if(!rOs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(nOs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=dOs[b]??_,o.method=_}!Rjn&&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"}),Rjn=!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[AOs]=m;let _=new WeakRef(m),v=wjn(_);lar&&Djn(l)===gOs&&mOs(1500,l),kst.addAbortListener(l,v),Njn.register(m,{signal:l,abort:v},v)}if(this.#r=new kjn(Dst),Pjn(this.#r,o.headersList),car(this.#r,"request"),h==="no-cors"){if(!iOs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);car(this.#r,"request-no-cors")}if(f){let _=Tjn(this.#r),v=r.headers!==void 0?r.headers:new Pst(_);if(_.clear(),v instanceof Pst){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else eOs(this.#r,v)}let g=Li.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[_,v]=JMs(r.body,o.keepalive);A=_,v&&!Tjn(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 E=y;if(A==null&&g!=null){if(Sjn(e.#n))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this.#n.body=E}get method(){return Li.brandCheck(this,t),this.#n.method}get url(){return Li.brandCheck(this,t),pOs(this.#n.url)}get headers(){return Li.brandCheck(this,t),this.#r}get destination(){return Li.brandCheck(this,t),this.#n.destination}get referrer(){return Li.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Li.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Li.brandCheck(this,t),this.#n.mode}get credentials(){return Li.brandCheck(this,t),this.#n.credentials}get cache(){return Li.brandCheck(this,t),this.#n.cache}get redirect(){return Li.brandCheck(this,t),this.#n.redirect}get integrity(){return Li.brandCheck(this,t),this.#n.integrity}get keepalive(){return Li.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Li.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Li.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Li.brandCheck(this,t),this.#e}get body(){return Li.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Li.brandCheck(this,t),!!this.#n.body&&kst.isDisturbed(this.#n.body.stream)}get duplex(){return Li.brandCheck(this,t),"half"}clone(){if(Li.brandCheck(this,t),Sjn(this.#n))throw new TypeError("unusable");let e=Ojn(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Nst.get(this.signal);n===void 0&&(n=new Set,Nst.set(this.signal,n));let o=new WeakRef(r);n.add(o),kst.addAbortListener(r.signal,wjn(o))}return Ljn(e,this.#t,r.signal,tOs(this.#r))}[Ijn.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 ${Ijn.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:yOs,getRequestDispatcher:EOs,setRequestDispatcher:_Os,setRequestHeaders:vOs,getRequestState:Mjn,setRequestState:COs}=Ab;Reflect.deleteProperty(Ab,"setRequestSignal");Reflect.deleteProperty(Ab,"getRequestDispatcher");Reflect.deleteProperty(Ab,"setRequestDispatcher");Reflect.deleteProperty(Ab,"setRequestHeaders");Reflect.deleteProperty(Ab,"getRequestState");Reflect.deleteProperty(Ab,"setRequestState");ZMs(Ab,Mjn);function Mst(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 Pst(t.headersList):new Pst}}a(Mst,"makeRequest");function Ojn(t){let e=Mst({...t,body:null});return t.body!=null&&(e.body=XMs(t.body)),e}a(Ojn,"cloneRequest");function Ljn(t,e,r,n){let o=new Ab(Dst);COs(o,t),_Os(o,e),yOs(o,r);let s=new kjn(Dst);return vOs(o,s),Pjn(s,t.headersList),car(s,n),o}a(Ljn,"fromInnerRequest");Object.defineProperties(Ab.prototype,{method:um,url:um,headers:um,redirect:um,clone:um,signal:um,duplex:um,destination:um,body:um,bodyUsed:um,isHistoryNavigation:um,isReloadNavigation:um,keepalive:um,integrity:um,cache:um,credentials:um,attribute:um,referrerPolicy:um,referrer:um,mode:um,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Li.is.Request=Li.util.MakeTypeAssertion(Ab);Li.converters.RequestInfo=function(t){return typeof t=="string"?Li.converters.USVString(t):Li.is.Request(t)?t:Li.converters.USVString(t)};Li.converters.RequestInit=Li.dictionaryConverter([{key:"method",converter:Li.converters.ByteString},{key:"headers",converter:Li.converters.HeadersInit},{key:"body",converter:Li.nullableConverter(Li.converters.BodyInit)},{key:"referrer",converter:Li.converters.USVString},{key:"referrerPolicy",converter:Li.converters.DOMString,allowedValues:oOs},{key:"mode",converter:Li.converters.DOMString,allowedValues:aOs},{key:"credentials",converter:Li.converters.DOMString,allowedValues:cOs},{key:"cache",converter:Li.converters.DOMString,allowedValues:lOs},{key:"redirect",converter:Li.converters.DOMString,allowedValues:sOs},{key:"integrity",converter:Li.converters.DOMString},{key:"keepalive",converter:Li.converters.boolean},{key:"signal",converter:Li.nullableConverter(t=>Li.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Li.converters.any},{key:"duplex",converter:Li.converters.DOMString,allowedValues:uOs},{key:"dispatcher",converter:Li.converters.any},{key:"priority",converter:Li.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);Bjn.exports={Request:Ab,makeRequest:Mst,fromInnerRequest:Ljn,cloneRequest:Ojn,getRequestDispatcher:EOs,getRequestState:Mjn}});var $jn=I((Cuf,Gjn)=>{"use strict";p();var bOs=require("node:assert"),{runtimeFeatures:Ujn}=$F(),KZ=new Map([["sha256",0],["sha384",1],["sha512",2]]),uar;if(Ujn.has("crypto")){uar=require("node:crypto");let t=uar.getHashes();t.length===0&&KZ.clear();for(let e of KZ.keys())t.includes(e)===!1&&KZ.delete(e)}else KZ.clear();var Fjn=Map.prototype.get.bind(KZ),dar=Map.prototype.has.bind(KZ),SOs=Ujn.has("crypto")===!1||KZ.size===0?()=>!0:(t,e)=>{let r=qjn(e);if(r.length===0)return!0;let n=Qjn(r);for(let o of n){let s=o.alg,c=o.val,l=jjn(s,t);if(Hjn(l,c))return!0}return!1};function Qjn(t){let e=[],r=null;for(let n of t){if(bOs(dar(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=Fjn(o),c=n.alg,l=Fjn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(Qjn,"getStrongestMetadata");function qjn(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(!dar(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(qjn,"parseMetadata");var jjn=a((t,e)=>uar.hash(t,e,"base64"),"applyAlgorithmToBytes");function Hjn(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:ll,makeAppropriateNetworkError:o2e,filterResponse:far,makeResponse:Ost,fromInnerResponse:TOs,getResponseState:IOs}=i2e(),{HeadersList:par}=zZ(),{Request:xOs,cloneRequest:wOs,getRequestDispatcher:ROs,getRequestState:kOs}=kpe(),R2=require("node:zlib"),{makePolicyContainer:POs,clonePolicyContainer:DOs,requestBadPort:NOs,TAOCheck:MOs,appendRequestOriginHeader:OOs,responseLocationURL:LOs,requestCurrentURL:xT,setRequestReferrerPolicyOnRedirect:BOs,tryUpgradeRequestToAPotentiallyTrustworthyURL:FOs,createOpaqueTimingInfo:Ear,appendFetchMetadata:UOs,corsCheck:QOs,crossOriginResourcePolicyCheck:qOs,determineRequestsReferrer:jOs,coarsenedSharedCurrentTime:s2e,sameOrigin:Aar,isCancelled:rH,isAborted:Vjn,isErrorLike:HOs,fullyReadBody:GOs,readableStreamClose:$Os,urlIsLocal:VOs,urlIsHttpHttpsScheme:Ust,urlHasHttpsScheme:WOs,clampAndCoarsenConnectionTimingInfo:zOs,simpleRangeHeaderValue:YOs,buildContentRange:KOs,createInflate:JOs,extractMimeType:ZOs,hasAuthenticationEntry:XOs,includesCredentials:Wjn,isTraversableNavigable:e5s}=ET(),JZ=require("node:assert"),{safelyExtractBody:Qst,extractBody:zjn}=ape(),{redirectStatusSet:Zjn,nullBodyStatus:Xjn,safeMethodsSet:t5s,requestBodyHeader:r5s,subresourceSet:n5s}=APe(),i5s=require("node:events"),{Readable:o5s,pipeline:s5s,finished:a5s,isErrored:c5s,isReadable:Lst}=require("node:stream"),{addAbortListener:l5s,bufferToLowerCasedHeaderName:Yjn}=Po(),{dataURLProcessor:u5s,serializeAMimeType:d5s,minimizeSupportedMimeType:f5s}=Mw(),{getGlobalDispatcher:p5s}=_st(),{webidl:_ar}=$A(),{STATUS_CODES:Kjn}=require("node:http"),{bytesMatch:h5s}=$jn(),{createDeferredPromise:m5s}=CPe(),{isomorphicEncode:Bst}=GF(),{runtimeFeatures:g5s}=$F(),A5s=g5s.has("zstd"),y5s=["GET","HEAD"],E5s=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",har,Fst=class extends i5s{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 _5s(t){eHn(t,"fetch")}a(_5s,"handleFetchDone");function v5s(t,e=void 0){_ar.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=m5s(),n;try{n=new xOs(t,e)}catch(f){return r.reject(f),r.promise}let o=kOs(n);if(n.signal.aborted)return mar(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 l5s(n.signal,()=>{l=!0,JZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();mar(r,o,f,n.signal.reason,u.controller)}),u=rHn({request:o,processResponseEndOfBody:_5s,processResponse:a(f=>{if(!l){if(f.aborted){mar(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(TOs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:ROs(n),requestObject:n}),r.promise}a(v5s,"fetch");function eHn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;Ust(r)&&n!==null&&(t.timingAllowPassed||(n=Ear({startTime:n.startTime}),o=""),n.endTime=s2e(),t.timingInfo=n,tHn(n,r.href,e,globalThis,o,"",t.status))}a(eHn,"finalizeAndReportTiming");var tHn=performance.markResourceTiming;function mar(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&Lst(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=IOs(r);s.body?.stream!=null&&Lst(s.body.stream)&&o.error(n)}a(mar,"abortFetch");function rHn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=p5s(),requestObject:u=null}){JZ(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=s2e(f),m=Ear({startTime:h}),g={controller:new Fst(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return JZ(!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=DOs(t.client.policyContainer):t.policyContainer=POs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,n5s.has(t.destination),nHn(g,!1),g.controller}a(rHn,"fetching");async function nHn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!VOs(xT(r))&&(n=ll("local URLs only")),FOs(r),NOs(r)==="blocked"&&(n=ll("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=jOs(r)),n===null){let s=xT(r);Aar(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await Jjn(t)):r.mode==="same-origin"?n=ll('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=ll('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await Jjn(t)):Ust(xT(r))?(r.responseTainting="cors",n=await iHn(t)):n=ll("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=far(n,"basic"):r.responseTainting==="cors"?n=far(n,"cors"):r.responseTainting==="opaque"?n=far(n,"opaque"):JZ(!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=ll()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||Xjn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>gar(t,ll(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!h5s(l,r.integrity)){s("integrity mismatch");return}n.body=Qst(l)[0],gar(t,n)},"processBody");GOs(n.body,c,s)}else gar(t,n)}catch(r){t.controller.terminate(r)}}a(nHn,"mainFetch");function Jjn(t){if(rH(t)&&t.request.redirectCount===0)return Promise.resolve(o2e(t));let{request:e}=t,{protocol:r}=xT(e);switch(r){case"about:":return Promise.resolve(ll("about scheme is not supported"));case"blob:":{har||(har=require("node:buffer").resolveObjectURL);let n=xT(e);if(n.search.length!==0)return Promise.resolve(ll("NetworkError when attempting to fetch resource."));let o=har(n.toString());if(e.method!=="GET"||!_ar.is.Blob(o))return Promise.resolve(ll("invalid method"));let s=Ost(),c=o.size,l=Bst(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=YOs(d,!0);if(f==="failure")return Promise.resolve(ll("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(ll("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=zjn(g);s.body=A[0];let y=Bst(`${g.size}`),E=KOs(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",E,!0)}else{let d=zjn(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=xT(e),o=u5s(n);if(o==="failure")return Promise.resolve(ll("failed to fetch the data URL"));let s=d5s(o.mimeType);return Promise.resolve(Ost({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Qst(o.body)[0]}))}case"file:":return Promise.resolve(ll("not implemented... yet..."));case"http:":case"https:":return iHn(t).catch(n=>ll(n));default:return Promise.resolve(ll("unknown scheme"))}}a(Jjn,"schemeFetch");function C5s(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(C5s,"finalizeResponse");function gar(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!Ust(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=Ear(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=ZOs(e.headersList);f!=="failure"&&(u.contentType=f5s(f))}t.request.initiatorType!=null&&tHn(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():a5s(o.body.stream,()=>{n()})}a(gar,"fetchFinale");async function iHn(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 yar(t),e.responseTainting==="cors"&&QOs(e,r)==="failure")return ll("cors failure");MOs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&qOs(e.origin,e.client,e.destination,n)==="blocked"?ll("blocked"):(Zjn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=ll("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await b5s(t,r):JZ(!1)),r.timingInfo=o,r)}a(iHn,"httpFetch");function b5s(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=LOs(n,xT(r).hash),o==null)return e}catch(c){return Promise.resolve(ll(c))}if(!Ust(o))return Promise.resolve(ll("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(ll("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!Aar(r,o))return Promise.resolve(ll('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(ll('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(ll());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!y5s.includes(r.method)){r.method="GET",r.body=null;for(let c of r5s)r.headersList.delete(c)}Aar(xT(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&&(JZ(r.body.source!=null),r.body=Qst(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=s2e(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),BOs(r,n),nHn(t,!0)}a(b5s,"httpRedirectFetch");async function yar(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=wOs(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=Bst(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,_ar.is.URL(s.referrer)&&s.headersList.append("referer",Bst(s.referrer.href),!0),OOs(s),UOs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",E5s,!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)||(WOs(xT(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(!(XOs(s)&&(s.useURLCredentials===void 0||!Wjn(xT(s))))){if(Wjn(xT(s))&&e){let{username:g,password:A}=xT(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 ll("only if cached");let m=await S5s(o,d,r);!t5s.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||e5s(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=Qst(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return rH(t)?o2e(t):c;t.controller.connection.destroy(),c=await yar(t,!0)}if(c.status===407)return n.window==="no-window"?ll():rH(t)?o2e(t):ll("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(rH(t))return o2e(t);t.controller.connection.destroy(),c=await yar(t,e,!0)}return c}a(yar,"httpNetworkOrCacheFetch");async function S5s(t,e=!1,r=!1){JZ(!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*(_){rH(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{rH(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{rH(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=Ost({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=Ost({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),o2e(t,A)):ll(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{rH(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:_,value:v}=await t.controller.next();if(Vjn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){$Os(t.controller.controller),C5s(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),c5s(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){Vjn(t)?(o.aborted=!0,Lst(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Lst(h)&&t.controller.controller.error(new TypeError("terminated",{cause:HOs(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=xT(n),E=t.controller.dispatcher,_=y.pathname+y.search,v=y.search.length===0&&y.href[y.href.length-y.hash.length-1]==="?";return new Promise((b,T)=>E.dispatch({path:v?`${_}?`:_,origin:y.origin,method:n.method,body:E.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=zOs(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=s2e(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=s2e(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,P){if(w<200)return!1;let D=new par;for(let M=0;Mj)return T(new Error(`too many content-encodings in response: ${O.length}, maximum allowed is ${j}`)),!0;for(let Q=O.length-1;Q>=0;--Q){let U=O[Q].trim();if(U==="x-gzip"||U==="gzip")B.push(R2.createGunzip({flush:R2.constants.Z_SYNC_FLUSH,finishFlush:R2.constants.Z_SYNC_FLUSH}));else if(U==="deflate")B.push(JOs({flush:R2.constants.Z_SYNC_FLUSH,finishFlush:R2.constants.Z_SYNC_FLUSH}));else if(U==="br")B.push(R2.createBrotliDecompress({flush:R2.constants.BROTLI_OPERATION_FLUSH,finishFlush:R2.constants.BROTLI_OPERATION_FLUSH}));else if(U==="zstd"&&A5s)B.push(R2.createZstdDecompress({flush:R2.constants.ZSTD_e_continue,finishFlush:R2.constants.ZSTD_e_end}));else{B.length=0;break}}}let q=this.onError.bind(this);return b({status:w,statusText:P,headersList:D,body:B.length?s5s(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,P){if(P.session!=null&&R!==200||P.session==null&&R!==101)return!1;let D=new par;for(let[N,L]of Object.entries(x)){if(L==null)continue;let B=N.toLowerCase();if(Array.isArray(L))for(let q of L)D.append(B,String(q),!0);else D.append(B,String(L),!0)}return b({status:R,statusText:Kjn[R],headersList:D,socket:P}),!0},onUpgrade(w,R,x){if(x.session!=null&&w!==200||x.session==null&&w!==101)return!1;let P=new par;for(let D=0;D{"use strict";p();var T5s=require("node:assert"),{URLSerializer:sHn}=Mw(),{isValidHeaderName:I5s}=ET();function x5s(t,e,r=!1){let n=sHn(t,r),o=sHn(e,r);return n===o}a(x5s,"urlEquals");function w5s(t){T5s(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),I5s(r)&&e.push(r);return e}a(w5s,"getFieldValues");aHn.exports={urlEquals:x5s,getFieldValues:w5s}});var fHn=I((Puf,dHn)=>{"use strict";p();var Car=require("node:assert"),{kConstruct:R5s}=al(),{urlEquals:k5s,getFieldValues:bar}=cHn(),{kEnumerableProperty:ZZ,isDisturbed:P5s}=Po(),{webidl:Xn}=$A(),{cloneResponse:lHn,fromInnerResponse:D5s,getResponseState:N5s}=i2e(),{Request:c2e,fromInnerRequest:M5s,getRequestState:Q5}=kpe(),{fetching:O5s}=a2e(),{urlIsHttpHttpsScheme:qst,readAllBytes:L5s}=ET(),{createDeferredPromise:Ppe}=CPe(),jst=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==R5s&&Xn.illegalConstructor(),Xn.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Xn.brandCheck(this,t);let n="Cache.match";Xn.argumentLengthCheck(arguments,1,n),e=Xn.converters.RequestInfo(e),r=Xn.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={}){Xn.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Xn.converters.RequestInfo(e)),r=Xn.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Xn.brandCheck(this,t),Xn.argumentLengthCheck(arguments,1,"Cache.add"),e=Xn.converters.RequestInfo(e);let n=[e];return await this.addAll(n)}async addAll(e){Xn.brandCheck(this,t);let r="Cache.addAll";Xn.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Xn.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Xn.converters.RequestInfo(m),typeof m=="string")continue;let g=Q5(m);if(!qst(g.url)||g.method!=="GET")throw Xn.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=Q5(new c2e(m));if(!qst(g.url))throw Xn.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Ppe();s.push(O5s({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Xn.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=bar(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Xn.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=Ppe(),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){Xn.brandCheck(this,t);let n="Cache.put";Xn.argumentLengthCheck(arguments,2,n),e=Xn.converters.RequestInfo(e),r=Xn.converters.Response(r,n,"response");let o=null;if(Xn.is.Request(e)?o=Q5(e):o=Q5(new c2e(e)),!qst(o.url)||o.method!=="GET")throw Xn.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=N5s(r);if(s.status===206)throw Xn.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=bar(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Xn.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(P5s(s.body.stream)||s.body.stream.locked))throw Xn.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=lHn(s),l=Ppe();if(s.body!=null){let A=s.body.stream.getReader();L5s(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=Ppe(),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={}){Xn.brandCheck(this,t);let n="Cache.delete";Xn.argumentLengthCheck(arguments,1,n),e=Xn.converters.RequestInfo(e),r=Xn.converters.CacheQueryOptions(r,n,"options");let o=null;if(Xn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else Car(typeof e=="string"),o=Q5(new c2e(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Ppe(),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={}){Xn.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Xn.converters.RequestInfo(e)),r=Xn.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(Xn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=Q5(new c2e(e)));let s=Ppe(),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=M5s(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 Xn.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Xn.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);Car(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!qst(u.url))throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Xn.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);Car(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=""),!k5s(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=bar(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(Xn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=Q5(new c2e(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=D5s(lHn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(jst.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:ZZ,matchAll:ZZ,add:ZZ,addAll:ZZ,put:ZZ,delete:ZZ,keys:ZZ});var uHn=[{key:"ignoreSearch",converter:Xn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Xn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Xn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Xn.converters.CacheQueryOptions=Xn.dictionaryConverter(uHn);Xn.converters.MultiCacheQueryOptions=Xn.dictionaryConverter([...uHn,{key:"cacheName",converter:Xn.converters.DOMString}]);Xn.converters.Response=Xn.interfaceConverter(Xn.is.Response,"Response");Xn.converters["sequence"]=Xn.sequenceConverter(Xn.converters.RequestInfo);dHn.exports={Cache:jst}});var hHn=I((Muf,pHn)=>{"use strict";p();var{Cache:Hst}=fHn(),{webidl:CE}=$A(),{kEnumerableProperty:l2e}=Po(),{kConstruct:u2e}=al(),Gst=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==u2e&&CE.illegalConstructor(),CE.util.markAsUncloneable(this)}async match(e,r={}){if(CE.brandCheck(this,t),CE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=CE.converters.RequestInfo(e),r=CE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Hst(u2e,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Hst(u2e,n).match(e,r);if(s!==void 0)return s}}async has(e){CE.brandCheck(this,t);let r="CacheStorage.has";return CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){CE.brandCheck(this,t);let r="CacheStorage.open";if(CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Hst(u2e,o)}let n=[];return this.#e.set(e,n),new Hst(u2e,n)}async delete(e){CE.brandCheck(this,t);let r="CacheStorage.delete";return CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return CE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Gst.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:l2e,has:l2e,open:l2e,delete:l2e,keys:l2e});pHn.exports={CacheStorage:Gst}});var gHn=I((Buf,mHn)=>{"use strict";p();mHn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Sar=I((Uuf,vHn)=>{"use strict";p();function B5s(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(B5s,"isCTLExcludingHtab");function AHn(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(AHn,"validateCookieName");function yHn(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(yHn,"validateCookieValue");function EHn(t){for(let e=0;ee.toString().padStart(2,"0"));function _Hn(t){return typeof t=="number"&&(t=new Date(t)),`${U5s[t.getUTCDay()]}, ${$st[t.getUTCDate()]} ${Q5s[t.getUTCMonth()]} ${t.getUTCFullYear()} ${$st[t.getUTCHours()]}:${$st[t.getUTCMinutes()]}:${$st[t.getUTCSeconds()]} GMT`}a(_Hn,"toIMFDate");function q5s(t){if(t<0)throw new Error("Invalid cookie max-age")}a(q5s,"validateCookieMaxAge");function j5s(t){if(t.name.length===0)return null;AHn(t.name),yHn(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"&&(q5s(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(F5s(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(EHn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${_Hn(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(j5s,"stringify");vHn.exports={isCTLExcludingHtab:B5s,validateCookieName:AHn,validateCookiePath:EHn,validateCookieValue:yHn,toIMFDate:_Hn,stringify:j5s}});var bHn=I((juf,CHn)=>{"use strict";p();var{collectASequenceOfCodePointsFast:Vst}=GF(),{maxNameValuePairSize:H5s,maxAttributeValueSize:G5s}=gHn(),{isCTLExcludingHtab:$5s}=Sar(),V5s=require("node:assert");function W5s(t){if($5s(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Vst(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Vst("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>H5s?null:{name:n,value:o,...Dpe(r)}}a(W5s,"parseSetCookie");function Dpe(t,e={}){if(t.length===0)return e;V5s(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Vst(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Vst("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>G5s)return Dpe(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 Dpe(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 Dpe(t,e)}a(Dpe,"parseUnparsedAttributes");CHn.exports={parseSetCookie:W5s,parseUnparsedAttributes:Dpe}});var xHn=I(($uf,IHn)=>{"use strict";p();var{parseSetCookie:SHn}=bHn(),{stringify:z5s}=Sar(),{webidl:Ya}=$A(),{Headers:Y5s}=zZ(),Wst=Ya.brandCheckMultiple([Y5s,globalThis.Headers].filter(Boolean));function K5s(t){Ya.argumentLengthCheck(arguments,1,"getCookies"),Wst(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(K5s,"getCookies");function J5s(t,e,r){Wst(t);let n="deleteCookie";Ya.argumentLengthCheck(arguments,2,n),e=Ya.converters.DOMString(e,n,"name"),r=Ya.converters.DeleteCookieAttributes(r),THn(t,{name:e,value:"",expires:new Date(0),...r})}a(J5s,"deleteCookie");function Z5s(t){Ya.argumentLengthCheck(arguments,1,"getSetCookies"),Wst(t);let e=t.getSetCookie();return e?e.map(r=>SHn(r)):[]}a(Z5s,"getSetCookies");function X5s(t){return t=Ya.converters.DOMString(t),SHn(t)}a(X5s,"parseCookie");function THn(t,e){Ya.argumentLengthCheck(arguments,2,"setCookie"),Wst(t),e=Ya.converters.Cookie(e);let r=z5s(e);r&&t.append("set-cookie",r,!0)}a(THn,"setCookie");Ya.converters.DeleteCookieAttributes=Ya.dictionaryConverter([{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Ya.converters.Cookie=Ya.dictionaryConverter([{converter:Ya.converters.DOMString,key:"name"},{converter:Ya.converters.DOMString,key:"value"},{converter:Ya.nullableConverter(t=>typeof t=="number"?Ya.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Ya.sequenceConverter(Ya.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);IHn.exports={getCookies:K5s,deleteCookie:J5s,getSetCookies:Z5s,setCookie:THn,parseCookie:X5s}});var Kst=I((zuf,RHn)=>{"use strict";p();var{webidl:li}=$A(),{kEnumerableProperty:yb}=Po(),{kConstruct:wHn}=al(),Npe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===wHn){super(arguments[1],arguments[2]),li.util.markAsUncloneable(this);return}let n="MessageEvent constructor";li.argumentLengthCheck(arguments,1,n),e=li.converters.DOMString(e,n,"type"),r=li.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,li.util.markAsUncloneable(this)}get data(){return li.brandCheck(this,t),this.#e.data}get origin(){return li.brandCheck(this,t),this.#e.origin}get lastEventId(){return li.brandCheck(this,t),this.#e.lastEventId}get source(){return li.brandCheck(this,t),this.#e.source}get ports(){return li.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 li.brandCheck(this,t),li.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(wHn,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:e4s}=Npe;delete Npe.createFastMessageEvent;var zst=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";li.argumentLengthCheck(arguments,1,n),e=li.converters.DOMString(e,n,"type"),r=li.converters.CloseEventInit(r),super(e,r),this.#e=r,li.util.markAsUncloneable(this)}get wasClean(){return li.brandCheck(this,t),this.#e.wasClean}get code(){return li.brandCheck(this,t),this.#e.code}get reason(){return li.brandCheck(this,t),this.#e.reason}},Yst=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";li.argumentLengthCheck(arguments,1,n),super(e,r),li.util.markAsUncloneable(this),e=li.converters.DOMString(e,n,"type"),r=li.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return li.brandCheck(this,t),this.#e.message}get filename(){return li.brandCheck(this,t),this.#e.filename}get lineno(){return li.brandCheck(this,t),this.#e.lineno}get colno(){return li.brandCheck(this,t),this.#e.colno}get error(){return li.brandCheck(this,t),this.#e.error}};Object.defineProperties(Npe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:yb,origin:yb,lastEventId:yb,source:yb,ports:yb,initMessageEvent:yb});Object.defineProperties(zst.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:yb,code:yb,wasClean:yb});Object.defineProperties(Yst.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:yb,filename:yb,lineno:yb,colno:yb,error:yb});li.converters.MessagePort=li.interfaceConverter(li.is.MessagePort,"MessagePort");li.converters["sequence"]=li.sequenceConverter(li.converters.MessagePort);var Tar=[{key:"bubbles",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];li.converters.MessageEventInit=li.dictionaryConverter([...Tar,{key:"data",converter:li.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:li.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:li.nullableConverter(li.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:li.converters["sequence"],defaultValue:a(()=>[],"defaultValue")}]);li.converters.CloseEventInit=li.dictionaryConverter([...Tar,{key:"wasClean",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:li.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);li.converters.ErrorEventInit=li.dictionaryConverter([...Tar,{key:"message",converter:li.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:li.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:li.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:li.converters.any}]);RHn.exports={MessageEvent:Npe,CloseEvent:zst,ErrorEvent:Yst,createFastMessageEvent:e4s}});var nH=I((Juf,kHn)=>{"use strict";p();var t4s="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",r4s={enumerable:!0,writable:!1,configurable:!1},n4s={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},i4s={SENT:1,RECEIVED:2},o4s={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},s4s=65535,a4s={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},c4s=Buffer.allocUnsafe(0),l4s={text:1,typedArray:2,arrayBuffer:3,blob:4};kHn.exports={uid:t4s,sentCloseFrameState:i4s,staticPropertyDescriptors:r4s,states:n4s,opcodes:o4s,maxUnsigned16Bit:s4s,parserStates:a4s,emptyBuffer:c4s,sendHints:l4s}});var XZ=I((Xuf,OHn)=>{"use strict";p();var{states:Jst,opcodes:Mpe}=nH(),{isUtf8:u4s}=require("node:buffer"),{removeHTTPWhitespace:PHn}=Mw(),{collectASequenceOfCodePointsFast:d4s}=GF();function f4s(t){return t===Jst.CONNECTING}a(f4s,"isConnecting");function p4s(t){return t===Jst.OPEN}a(p4s,"isEstablished");function h4s(t){return t===Jst.CLOSING}a(h4s,"isClosing");function m4s(t){return t===Jst.CLOSED}a(m4s,"isClosed");function g4s(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(g4s,"fireEvent");function A4s(t,e,r){t.onMessage(e,r)}a(A4s,"websocketMessageReceived");function y4s(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(y4s,"toArrayBuffer");function E4s(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(E4s,"isValidSubprotocol");function _4s(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(_4s,"isValidStatusCode");function DHn(t){return t===Mpe.CLOSE||t===Mpe.PING||t===Mpe.PONG}a(DHn,"isControlFrame");function NHn(t){return t===Mpe.CONTINUATION}a(NHn,"isContinuationFrame");function MHn(t){return t===Mpe.TEXT||t===Mpe.BINARY}a(MHn,"isTextBinaryFrame");function v4s(t){return MHn(t)||NHn(t)||DHn(t)}a(v4s,"isValidOpcode");function C4s(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(b4s,"isValidClientWindowBits");function S4s(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(S4s,"getURLRecord");function T4s(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(T4s,"validateCloseCodeAndReason");var I4s=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(u4s(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();OHn.exports={isConnecting:f4s,isEstablished:p4s,isClosing:h4s,isClosed:m4s,fireEvent:g4s,isValidSubprotocol:E4s,isValidStatusCode:_4s,websocketMessageReceived:A4s,utf8Decode:I4s,isControlFrame:DHn,isContinuationFrame:NHn,isTextBinaryFrame:MHn,isValidOpcode:v4s,parseExtensions:C4s,isValidClientWindowBits:b4s,toArrayBuffer:y4s,getURLRecord:S4s,validateCloseCodeAndReason:T4s}});var Lpe=I((rdf,BHn)=>{"use strict";p();var{runtimeFeatures:x4s}=$F(),{maxUnsigned16Bit:LHn,opcodes:w4s}=nH(),Zst=8*1024,d2e=null,Ope=Zst,R4s=x4s.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;oLHn?(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;uLHn?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|w4s.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]}};BHn.exports={WebsocketFrameSend:xar,generateMask:Iar}});var Xst=I((odf,HHn)=>{"use strict";p();var{uid:k4s,states:war,sentCloseFrameState:Rar,emptyBuffer:FHn,opcodes:P4s}=nH(),{parseExtensions:D4s,isClosed:N4s,isClosing:M4s,isEstablished:qHn,isConnecting:O4s,validateCloseCodeAndReason:L4s}=XZ(),{makeRequest:B4s}=kpe(),{fetching:F4s}=a2e(),{Headers:U4s,getHeadersList:Q4s}=zZ(),{getDecodeSplit:q4s}=ET(),{WebsocketFrameSend:j4s}=Lpe(),H4s=require("node:assert"),{runtimeFeatures:G4s}=$F(),UHn=G4s.has("crypto")?require("node:crypto"):null,QHn=!1;function $4s(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=B4s({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=Q4s(new U4s(o.headers));c.headersList=f}let l=UHn.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),F4s({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){q5(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){q5(n,1002,"Received network error or non-200 status code.",f.error);return}}if(QHn===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),QHn=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){q5(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){q5(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){q5(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=UHn.hash("sha1",l+k4s,"base64");if(h!==m){q5(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=D4s(g),!A.has("permessage-deflate"))){q5(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!q4s("sec-websocket-protocol",c.headersList).includes(y)){q5(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($4s,"establishWebSocketConnection");function jHn(t,e,r,n=!1){if(e??=null,r??="",n&&L4s(e,r),!(N4s(t.readyState)||M4s(t.readyState)))if(!qHn(t.readyState))q5(t),t.readyState=war.CLOSING;else if(!t.closeState.has(Rar.SENT)&&!t.closeState.has(Rar.RECEIVED)){let o=new j4s;r.length!==0&&e===null&&(e=1e3),H4s(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=FHn: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=FHn,t.socket.write(o.createFrame(P4s.CLOSE)),t.closeState.add(Rar.SENT),t.readyState=war.CLOSING}else t.readyState=war.CLOSING}a(jHn,"closeWebSocketConnection");function q5(t,e,r,n){qHn(t.readyState)&&jHn(t,e,r,!1),t.controller.abort(),O4s(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(q5,"failWebsocketConnection");HHn.exports={establishWebSocketConnection:$4s,failWebsocketConnection:q5,closeWebSocketConnection:jHn}});var $Hn=I((cdf,GHn)=>{"use strict";p();var{createInflateRaw:V4s,Z_DEFAULT_WINDOWBITS:W4s}=require("node:zlib"),{isValidClientWindowBits:z4s}=XZ(),{MessageSizeExceededError:Y4s}=ao(),K4s=Buffer.from([0,0,255,255]),eat=Symbol("kBuffer"),f2e=Symbol("kLength"),kar=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=W4s;if(this.#t.serverMaxWindowBits){if(!z4s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=V4s({windowBits:o})}catch(s){n(s);return}this.#e[eat]=[],this.#e[f2e]=0,this.#e.on("data",s=>{if(this.#e[f2e]+=s.length,this.#r>0&&this.#e[f2e]>this.#r){n(new Y4s),this.#e.removeAllListeners(),this.#e=null;return}this.#e[eat].push(s)}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#e.write(e),r&&this.#e.write(K4s),this.#e.flush(()=>{if(!this.#e)return;let o=Buffer.concat(this.#e[eat],this.#e[f2e]);this.#e[eat].length=0,this.#e[f2e]=0,n(null,o)})}};GHn.exports={PerMessageDeflate:kar}});var Mar=I((ddf,KHn)=>{"use strict";p();var{Writable:J4s}=require("node:stream"),Z4s=require("node:assert"),{parserStates:Eb,opcodes:Bpe,states:X4s,emptyBuffer:VHn,sentCloseFrameState:p2e}=nH(),{isValidStatusCode:eLs,isValidOpcode:tLs,websocketMessageReceived:WHn,utf8Decode:rLs,isControlFrame:Par,isTextBinaryFrame:Dar,isContinuationFrame:nLs}=XZ(),{failWebsocketConnection:bE}=Xst(),{WebsocketFrameSend:zHn}=Lpe(),{PerMessageDeflate:iLs}=$Hn(),{MessageSizeExceededError:YHn}=ao(),Nar=class extends J4s{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=Eb.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 iLs(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&&!Par(this.#o.opcode)&&this.#o.payloadLength+this.#t>this.#l?(bE(this.#c,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#n;)if(this.#i===Eb.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!==Bpe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!tLs(o))return bE(this.#c,1002,"Invalid opcode received"),e();if(s)return bE(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){bE(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){bE(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Dar(o)){bE(this.#c,1002,"Invalid frame type was fragmented.");return}if(Dar(o)&&this.#s.length>0){bE(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){bE(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&Par(o)){bE(this.#c,1002,"Control frame either too large or fragmented");return}if(nLs(o)&&this.#s.length===0&&!this.#o.compressed){bE(this.#c,1002,"Unexpected continuation frame");return}if(l<=125){if(this.#o.payloadLength=l,this.#i=Eb.READ_DATA,!this.#p())return}else l===126?this.#i=Eb.PAYLOADLENGTH_16:l===127&&(this.#i=Eb.PAYLOADLENGTH_64);Dar(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===Eb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);if(this.#o.payloadLength=r.readUInt16BE(0),this.#i=Eb.READ_DATA,!this.#p())return}else if(this.#i===Eb.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){bE(this.#c,1009,"Received payload length > 2^31 bytes.");return}if(this.#o.payloadLength=o,this.#i=Eb.READ_DATA,!this.#p())return}else if(this.#i===Eb.READ_DATA){if(this.#r{if(n){let s=n instanceof YHn?1009:1007;bE(this.#c,s,n.message);return}if(this.writeFragments(o)){if(this.#l>0&&this.#t>this.#l){bE(this.#c,1009,new YHn().message);return}if(!this.#o.fin){this.#i=Eb.INFO,this.#n=!0,this.run(e);return}WHn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=Eb.INFO,this.run(e)}},this.#t),this.#n=!1;break}else{if(!this.writeFragments(r))return;!this.#o.fragmented&&this.#o.fin&&WHn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#i=Eb.INFO}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return VHn;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?(bE(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&&!eLs(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=rLs(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===Bpe.CLOSE){if(n===1)return bE(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 bE(this.#c,o,s),!1}if(!this.#c.closeState.has(p2e.SENT)&&!this.#c.closeState.has(p2e.RECEIVED)){let o=VHn;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new zHn(o);this.#c.socket.write(s.createFrame(Bpe.CLOSE)),this.#c.closeState.add(p2e.SENT)}return this.#c.readyState=X4s.CLOSING,this.#c.closeState.add(p2e.RECEIVED),!1}else if(r===Bpe.PING){if(!this.#c.closeState.has(p2e.RECEIVED)){let o=new zHn(e);this.#c.socket.write(o.createFrame(Bpe.PONG)),this.#c.onPing(e)}}else r===Bpe.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};KHn.exports={ByteParser:Nar}});var eGn=I((hdf,XHn)=>{"use strict";p();var{WebsocketFrameSend:ZHn}=Lpe(),{opcodes:JHn,sendHints:eX}=nH(),oLs=aor(),Lar=class{static{a(this,"SendQueue")}#e=new oLs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==eX.blob){if(this.#t){let s={promise:null,callback:r,frame:Oar(e,n)};this.#e.push(s)}else if(n===eX.text){let{0:s,1:c}=ZHn.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(Oar(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=Oar(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 Oar(t,e){return new ZHn(sLs(t,e)).createFrame(e===eX.text?JHn.TEXT:JHn.BINARY)}a(Oar,"createFrame");function sLs(t,e){switch(e){case eX.text:case eX.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case eX.arrayBuffer:case eX.blob:return new Uint8Array(t)}}a(sLs,"toBuffer");XHn.exports={SendQueue:Lar}});var sGn=I((Adf,oGn)=>{"use strict";p();var{isArrayBuffer:aLs}=require("node:util/types"),{webidl:mi}=$A(),{URLSerializer:cLs}=Mw(),{environmentSettingsObject:tGn}=ET(),{staticPropertyDescriptors:iH,states:r8,sentCloseFrameState:Bar,sendHints:tat,opcodes:Far}=nH(),{isConnecting:lLs,isEstablished:rGn,isClosing:nGn,isClosed:uLs,isValidSubprotocol:dLs,fireEvent:rat,utf8Decode:fLs,toArrayBuffer:pLs,getURLRecord:hLs}=XZ(),{establishWebSocketConnection:mLs,closeWebSocketConnection:gLs,failWebsocketConnection:iGn}=Xst(),{ByteParser:ALs}=Mar(),{kEnumerableProperty:jw}=Po(),{getGlobalDispatcher:yLs}=_st(),{ErrorEvent:ELs,CloseEvent:_Ls,createFastMessageEvent:vLs}=Kst(),{SendQueue:CLs}=eGn(),{WebsocketFrameSend:bLs}=Lpe(),{channels:j5}=Bj();function SLs(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(SLs,"getSocketAddress");var dv=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=>iGn(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=r8.CLOSING,j5.socketError.hasSubscribers&&j5.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{j5.ping.hasSubscribers&&j5.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{j5.pong.hasSubscribers&&j5.pong.publish({payload:e,websocket:this})},"onPong"),readyState:r8.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),mi.util.markAsUncloneable(this);let n="WebSocket constructor";mi.argumentLengthCheck(arguments,1,n);let o=mi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=mi.converters.USVString(e),r=o.protocols;let s=tGn.settingsObject.baseUrl,c=hLs(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=>dLs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=tGn.settingsObject;this.#o.controller=mLs(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){mi.brandCheck(this,t),e!==void 0&&(e=mi.converters["unsigned short"](e,"WebSocket.close","code",mi.attributes.Clamp)),r!==void 0&&(r=mi.converters.USVString(r)),e??=null,r??="",gLs(this.#o,e,r,!0)}send(e){mi.brandCheck(this,t);let r="WebSocket.send";if(mi.argumentLengthCheck(arguments,1,r),e=mi.converters.WebSocketSendData(e,r,"data"),lLs(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!rGn(this.#o.readyState)||nGn(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},tat.text)}else aLs(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)):mi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},tat.blob))}get readyState(){return mi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return mi.brandCheck(this,t),this.#t}get url(){return mi.brandCheck(this,t),cLs(this.#s)}get extensions(){return mi.brandCheck(this,t),this.#n}get protocol(){return mi.brandCheck(this,t),this.#r}get onopen(){return mi.brandCheck(this,t),this.#e.open}set onopen(e){mi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return mi.brandCheck(this,t),this.#e.error}set onerror(e){mi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return mi.brandCheck(this,t),this.#e.close}set onclose(e){mi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return mi.brandCheck(this,t),this.#e.message}set onmessage(e){mi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return mi.brandCheck(this,t),this.#a}set binaryType(e){mi.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 ALs(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 CLs(e.socket),this.#o.readyState=r8.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),rat("open",this),j5.open.hasSubscribers){let d=e.headersList.entries;j5.open.publish({address:SLs(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!==r8.OPEN)return;let n;if(e===Far.TEXT)try{n=fLs(r)}catch{iGn(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===Far.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=pLs(r));rat("message",this,vLs,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(Bar.SENT)&&this.#o.closeState.has(Bar.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=r8.CLOSED,this.#o.closeState.has(Bar.RECEIVED)||(r=1006,rat("error",this,(s,c)=>new ELs(s,c),{error:new TypeError(n)})),rat("close",this,(s,c)=>new _Ls(s,c),{wasClean:e,code:r,reason:n}),j5.close.hasSubscribers&&j5.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(rGn(n)&&!nGn(n)&&!uLs(n)){let o=new bLs(r);e.#o.socket.write(o.createFrame(Far.PING))}}},{ping:TLs}=dv;Reflect.deleteProperty(dv,"ping");dv.CONNECTING=dv.prototype.CONNECTING=r8.CONNECTING;dv.OPEN=dv.prototype.OPEN=r8.OPEN;dv.CLOSING=dv.prototype.CLOSING=r8.CLOSING;dv.CLOSED=dv.prototype.CLOSED=r8.CLOSED;Object.defineProperties(dv.prototype,{CONNECTING:iH,OPEN:iH,CLOSING:iH,CLOSED:iH,url:jw,readyState:jw,bufferedAmount:jw,onopen:jw,onerror:jw,onclose:jw,close:jw,onmessage:jw,binaryType:jw,send:jw,extensions:jw,protocol:jw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(dv,{CONNECTING:iH,OPEN:iH,CLOSING:iH,CLOSED:iH});mi.converters["sequence"]=mi.sequenceConverter(mi.converters.DOMString);mi.converters["DOMString or sequence"]=function(t,e,r){return mi.util.Type(t)===mi.util.Types.OBJECT&&Symbol.iterator in t?mi.converters["sequence"](t):mi.converters.DOMString(t,e,r)};mi.converters.WebSocketInit=mi.dictionaryConverter([{key:"protocols",converter:mi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:mi.converters.any,defaultValue:a(()=>yLs(),"defaultValue")},{key:"headers",converter:mi.nullableConverter(mi.converters.HeadersInit)}]);mi.converters["DOMString or sequence or WebSocketInit"]=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&!(Symbol.iterator in t)?mi.converters.WebSocketInit(t):{protocols:mi.converters["DOMString or sequence"](t)}};mi.converters.WebSocketSendData=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&(mi.is.Blob(t)||mi.is.BufferSource(t))?t:mi.converters.USVString(t)};oGn.exports={WebSocket:dv,ping:TLs}});var Uar=I((_df,lGn)=>{"use strict";p();var{webidl:nat}=$A(),{validateCloseCodeAndReason:ILs}=XZ(),{kConstruct:aGn}=al(),{kEnumerableProperty:cGn}=Po();function xLs(){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(xLs,"createInheritableDOMException");var tX=class t extends xLs(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=nat.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===aGn)return;r!==null&&(r=nat.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";ILs(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,aGn);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:wLs}=tX;delete tX.createUnvalidatedWebSocketError;Object.defineProperties(tX.prototype,{closeCode:cGn,reason:cGn,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});nat.is.WebSocketError=nat.util.MakeTypeAssertion(tX);lGn.exports={WebSocketError:tX,createUnvalidatedWebSocketError:wLs}});var hGn=I((bdf,pGn)=>{"use strict";p();var{createDeferredPromise:Qar}=CPe(),{environmentSettingsObject:uGn}=ET(),{states:Fpe,opcodes:iat,sentCloseFrameState:Upe}=nH(),{webidl:gp}=$A(),{getURLRecord:RLs,isValidSubprotocol:kLs,isEstablished:PLs,utf8Decode:DLs}=XZ(),{establishWebSocketConnection:NLs,failWebsocketConnection:qar,closeWebSocketConnection:jar}=Xst(),{channels:dGn}=Bj(),{WebsocketFrameSend:MLs}=Lpe(),{ByteParser:OLs}=Mar(),{WebSocketError:LLs,createUnvalidatedWebSocketError:BLs}=Uar(),{kEnumerableProperty:oat}=Po(),{utf8DecodeBytes:FLs}=Iot(),fGn=!1,sat=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=>qar(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=Fpe.CLOSING,dGn.socketError.hasSubscribers&&dGn.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:Fpe.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){fGn||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),fGn=!0),gp.argumentLengthCheck(arguments,1,"WebSocket"),e=gp.converters.USVString(e),r!==null&&(r=gp.converters.WebSocketStreamOptions(r));let n=uGn.settingsObject.baseUrl,o=RLs(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=>kLs(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=Qar(),this.#r=Qar(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{PLs(this.#a.readyState)||(qar(this.#a),this.#a.readyState=Fpe.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=uGn.settingsObject;this.#a.controller=NLs(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=gp.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;jar(this.#a,r,n,!0)}#u(e){e=gp.converters.WebSocketStreamWrite(e);let r=Qar(),n=null,o=null;if(gp.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=iat.BINARY;else{let s;try{s=gp.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=iat.TEXT}if(!this.#a.closeState.has(Upe.SENT)&&!this.#a.closeState.has(Upe.RECEIVED)){let s=new MLs(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 OLs(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=Fpe.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(()=>jar(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!==Fpe.OPEN)return;let n;if(e===iat.TEXT)try{n=DLs(r)}catch{qar(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===iat.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(Upe.SENT)&&this.#a.closeState.has(Upe.RECEIVED);if(this.#a.readyState=Fpe.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new LLs("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(Upe.SENT)&&!this.#a.closeState.has(Upe.RECEIVED)&&(n=1006);let o=r?.reason==null?"":FLs(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=BLs("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";gp.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),jar(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(sat.prototype,{url:oat,opened:oat,closed:oat,close:oat,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});gp.converters.WebSocketStreamOptions=gp.dictionaryConverter([{key:"protocols",converter:gp.sequenceConverter(gp.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:gp.nullableConverter(gp.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);gp.converters.WebSocketCloseInfo=gp.dictionaryConverter([{key:"closeCode",converter:a(t=>gp.converters["unsigned short"](t,gp.attributes.EnforceRange),"converter")},{key:"reason",converter:gp.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);gp.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?gp.converters.USVString(t):gp.converters.BufferSource(t)};pGn.exports={WebSocketStream:sat}});var gGn=I((Idf,mGn)=>{"use strict";p();function ULs(t){return t.indexOf("\0")===-1}a(ULs,"isValidLastEventId");function QLs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(QLs,"isASCIINumber");mGn.exports={isValidLastEventId:ULs,isASCIINumber:QLs}});var _Gn=I((Rdf,EGn)=>{"use strict";p();var{Transform:qLs}=require("node:stream"),{isASCIINumber:AGn,isValidLastEventId:yGn}=gGn(),n8=[239,187,191],Har=10,aat=13,jLs=58,HLs=32,Gar=class extends qLs{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]===n8[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===n8[0]&&this.buffer[1]===n8[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===n8[0]&&this.buffer[1]===n8[1]&&this.buffer[2]===n8[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===n8[0]&&this.buffer[1]===n8[1]&&this.buffer[2]===n8[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&AGn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&yGn(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}}};EGn.exports={EventSourceStream:Gar}});var wGn=I((Ddf,xGn)=>{"use strict";p();var{pipeline:GLs}=require("node:stream"),{fetching:$Ls}=a2e(),{makeRequest:VLs}=kpe(),{webidl:fv}=$A(),{EventSourceStream:WLs}=_Gn(),{parseMIMEType:zLs}=Mw(),{createFastMessageEvent:YLs}=Kst(),{isNetworkError:vGn}=i2e(),{kEnumerableProperty:rX}=Po(),{environmentSettingsObject:CGn}=ET(),bGn=!1,SGn=3e3,h2e=0,TGn=1,m2e=2,KLs="anonymous",JLs="use-credentials",Qpe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=h2e;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),fv.util.markAsUncloneable(this);let n="EventSource constructor";fv.argumentLengthCheck(arguments,1,n),bGn||(bGn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=fv.converters.USVString(e),r=fv.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=CGn,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=KLs;r.withCredentials===!0&&(c=JLs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=CGn.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=VLs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===m2e)return;this.#n=h2e;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!vGn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(vGn(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?zLs(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=TGn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new WLs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(YLs(u.type,u.options))},"push")});GLs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=$Ls(e)}#u(){this.#n!==m2e&&(this.#n=h2e,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===h2e&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){fv.brandCheck(this,t),this.#n!==m2e&&(this.#n=m2e,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=fv.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=fv.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=fv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},IGn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:h2e,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:TGn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:m2e,writable:!1}};Object.defineProperties(Qpe,IGn);Object.defineProperties(Qpe.prototype,IGn);Object.defineProperties(Qpe.prototype,{close:rX,onerror:rX,onmessage:rX,onopen:rX,readyState:rX,url:rX,withCredentials:rX});fv.converters.EventSourceInitDict=fv.dictionaryConverter([{key:"withCredentials",converter:fv.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:fv.converters.any},{key:"node",converter:fv.dictionaryConverter([{key:"reconnectionTime",converter:fv.converters["unsigned long"],defaultValue:a(()=>SGn,"defaultValue")},{key:"dispatcher",converter:fv.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);xGn.exports={EventSource:Qpe,defaultReconnectionTime:SGn}});var $ar=I((Odf,vn)=>{"use strict";p();var ZLs=Vj(),kGn=mPe(),XLs=NZ(),eBs=RUn(),tBs=NUn(),rBs=LZ(),nBs=Oor(),iBs=Por(),oBs=y7n(),sBs=S7n(),aBs=x7n(),PGn=ao(),lat=Po(),{InvalidArgumentError:cat}=PGn,qpe=cQn(),cBs=CZ(),lBs=_sr(),{MockCallHistory:uBs,MockCallHistoryLog:dBs}=bsr(),fBs=Dsr(),pBs=xsr(),hBs=aqn(),mBs=nsr(),gBs=ost(),{getGlobalDispatcher:DGn,setGlobalDispatcher:ABs}=_st(),yBs=Tpe(),EBs=Qsr();Object.assign(kGn.prototype,qpe);vn.exports.Dispatcher=kGn;vn.exports.Client=ZLs;vn.exports.Pool=XLs;vn.exports.BalancedPool=eBs;vn.exports.RoundRobinPool=tBs;vn.exports.Agent=rBs;vn.exports.ProxyAgent=nBs;vn.exports.Socks5ProxyAgent=iBs;vn.exports.EnvHttpProxyAgent=oBs;vn.exports.RetryAgent=sBs;vn.exports.H2CClient=aBs;vn.exports.RetryHandler=gBs;vn.exports.DecoratorHandler=yBs;vn.exports.RedirectHandler=EBs;vn.exports.interceptors={redirect:yqn(),responseError:_qn(),retry:Cqn(),dump:Sqn(),dns:wqn(),cache:$qn(),decompress:Kqn(),deduplicate:tjn()};vn.exports.cacheStores={MemoryCacheStore:Ysr()};var _Bs=ijn();vn.exports.cacheStores.SqliteCacheStore=_Bs;vn.exports.buildConnector=cBs;vn.exports.errors=PGn;vn.exports.util={parseHeaders:lat.parseHeaders,headerNameToString:lat.headerNameToString};function g2e(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 cat("invalid url");if(r!=null&&typeof r!="object")throw new cat("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new cat("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(lat.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=lat.parseURL(e);let{agent:o,dispatcher:s=DGn()}=r;if(o)throw new cat("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(g2e,"makeDispatcher");vn.exports.setGlobalDispatcher=ABs;vn.exports.getGlobalDispatcher=DGn;var vBs=a2e().fetch,RGn=typeof __filename<"u"?__filename:void 0;function NGn(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,NGn),!o.stack)return;let s=o.stack.split(` + `)}close(){this.#r.close()}get(e){nar(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){nar(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){nar(e),RMs(r);let n=0,o=[],s=this;return new wMs({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(!kMs(o[h],f[h])){d=!1;break}}if(d)return u}}};function kMs(t,e){return t==null&&e==null?!0:t==null&&e!=null||t!=null&&e==null?!1:Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:t.every((r,n)=>r===e[n]):t===e}a(kMs,"headerValueEquals")});var zZ=I((vuf,fjn)=>{"use strict";p();var{kConstruct:PMs}=al(),{kEnumerableProperty:wpe}=Do(),{iteratorMixin:DMs,isValidHeaderName:r2e,isValidHeaderValue:ajn}=vT(),{webidl:ka}=$A(),oar=require("node:assert"),Ist=require("node:util");function sjn(t){return t===10||t===13||t===9||t===32}a(sjn,"isHTTPWhiteSpaceCharCode");function cjn(t){let e=0,r=t.length;for(;r>e&&sjn(t.charCodeAt(r-1));)--r;for(;r>e&&sjn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(cjn,"headerValueNormalize");function ljn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(ljn,"fill");function sar(t,e,r){if(r=cjn(r),r2e(e)){if(!ajn(r))throw ka.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw ka.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(djn(t)==="immutable")throw new TypeError("immutable");return wst(t).append(e,r,!1)}a(sar,"appendHeader");function NMs(t){let e=wst(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],oar(s!==null);return r.sort(ujn)}}},R2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){ka.util.markAsUncloneable(this),e!==PMs&&(this.#t=new xst,this.#e="none",e!==void 0&&(e=ka.converters.HeadersInit(e,"Headers constructor","init"),ljn(this,e)))}append(e,r){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=ka.converters.ByteString(e,n,"name"),r=ka.converters.ByteString(r,n,"value"),sar(this,e,r)}delete(e){if(ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,1,"Headers.delete"),e=ka.converters.ByteString(e,"Headers.delete","name"),!r2e(e))throw ka.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){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=ka.converters.ByteString(e,r,"name"),!r2e(e))throw ka.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=ka.converters.ByteString(e,r,"name"),!r2e(e))throw ka.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=ka.converters.ByteString(e,n,"name"),r=ka.converters.ByteString(r,n,"value"),r=cjn(r),r2e(e)){if(!ajn(r))throw ka.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw ka.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){ka.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[Ist.inspect.custom](e,r){return r.depth??=e,`Headers ${Ist.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:djn,setHeadersGuard:MMs,getHeadersList:wst,setHeadersList:OMs}=R2;Reflect.deleteProperty(R2,"getHeadersGuard");Reflect.deleteProperty(R2,"setHeadersGuard");Reflect.deleteProperty(R2,"getHeadersList");Reflect.deleteProperty(R2,"setHeadersList");DMs("Headers",R2,NMs,0,1);Object.defineProperties(R2.prototype,{append:wpe,delete:wpe,get:wpe,has:wpe,set:wpe,getSetCookie:wpe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[Ist.inspect.custom]:{enumerable:!1}});ka.converters.HeadersInit=function(t,e,r){if(ka.util.Type(t)===ka.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!Ist.types.isProxy(t)&&n===R2.prototype.entries)try{return wst(t).entriesList}catch{}return typeof n=="function"?ka.converters["sequence>"](t,e,r,n.bind(t)):ka.converters["record"](t,e,r)}throw ka.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};fjn.exports={fill:ljn,compareHeaderName:ujn,Headers:R2,HeadersList:xst,getHeadersGuard:djn,setHeadersGuard:MMs,setHeadersList:OMs,getHeadersList:wst}});var i2e=I((Suf,Sjn)=>{"use strict";p();var{Headers:yjn,HeadersList:pjn,fill:LMs,getHeadersGuard:BMs,setHeadersGuard:Ejn,setHeadersList:_jn}=zZ(),{extractBody:hjn,cloneBody:FMs,mixinBody:UMs,streamRegistry:vjn,bodyUnusable:QMs}=ape(),Cjn=Do(),mjn=require("node:util"),{kEnumerableProperty:xT}=Cjn,{isValidReasonPhrase:qMs,isCancelled:jMs,isAborted:HMs,isErrorLike:GMs,environmentSettingsObject:$Ms}=vT(),{redirectStatusSet:VMs,nullBodyStatus:WMs}=APe(),{webidl:ra}=$A(),{URLSerializer:gjn}=Ow(),{kConstruct:kst}=al(),aar=require("node:assert"),{isomorphicEncode:zMs,serializeJavascriptValueToJSONString:YMs}=$F(),KMs=new TextEncoder("utf-8"),wT=class t{static{a(this,"Response")}#e;#t;static error(){return n2e(Pst(),"immutable")}static json(e,r=void 0){ra.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ra.converters.ResponseInit(r));let n=KMs.encode(YMs(e)),o=hjn(n),s=n2e(Rpe({}),"response");return Ajn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ra.argumentLengthCheck(arguments,1,"Response.redirect"),e=ra.converters.USVString(e),r=ra.converters["unsigned short"](r);let n;try{n=new URL(e,$Ms.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!VMs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=n2e(Rpe({}),"immutable");o.#t.status=r;let s=zMs(gjn(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(ra.util.markAsUncloneable(this),e===kst)return;e!==null&&(e=ra.converters.BodyInit(e,"Response","body")),r=ra.converters.ResponseInit(r),this.#t=Rpe({}),this.#e=new yjn(kst),Ejn(this.#e,"response"),_jn(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=hjn(e);n={body:o,type:s}}Ajn(this,r,n)}get type(){return ra.brandCheck(this,t),this.#t.type}get url(){ra.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":gjn(r,!0)}get redirected(){return ra.brandCheck(this,t),this.#t.urlList.length>1}get status(){return ra.brandCheck(this,t),this.#t.status}get ok(){return ra.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return ra.brandCheck(this,t),this.#t.statusText}get headers(){return ra.brandCheck(this,t),this.#e}get body(){return ra.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return ra.brandCheck(this,t),!!this.#t.body&&Cjn.isDisturbed(this.#t.body.stream)}clone(){if(ra.brandCheck(this,t),QMs(this.#t))throw ra.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=car(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&vjn.register(this,new WeakRef(this.#t.body.stream)),n2e(e,BMs(this.#e))}[mjn.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 ${mjn.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:JMs,setResponseHeaders:ZMs,getResponseState:YZ,setResponseState:XMs}=wT;Reflect.deleteProperty(wT,"getResponseHeaders");Reflect.deleteProperty(wT,"setResponseHeaders");Reflect.deleteProperty(wT,"getResponseState");Reflect.deleteProperty(wT,"setResponseState");UMs(wT,YZ);Object.defineProperties(wT.prototype,{type:xT,url:xT,status:xT,ok:xT,redirected:xT,statusText:xT,headers:xT,clone:xT,body:xT,bodyUsed:xT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(wT,{json:xT,redirect:xT,error:xT});function car(t){if(t.internalResponse)return bjn(car(t.internalResponse),t.type);let e=Rpe({...t,body:null});return t.body!=null&&(e.body=FMs(t.body)),e}a(car,"cloneResponse");function Rpe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new pjn(t?.headersList):new pjn,urlList:t?.urlList?[...t.urlList]:[]}}a(Rpe,"makeResponse");function Pst(t){let e=GMs(t);return Rpe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Pst,"makeNetworkError");function eOs(t){return t.type==="error"&&t.status===0}a(eOs,"isNetworkError");function Rst(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 aar(!(n in e)),r[n]=o,!0}})}a(Rst,"makeFilteredResponse");function bjn(t,e){if(e==="basic")return Rst(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Rst(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Rst(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return Rst(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});aar(!1)}a(bjn,"filterResponse");function tOs(t,e=null){return aar(jMs(t)),HMs(t)?Pst(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Pst(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(tOs,"makeAppropriateNetworkError");function Ajn(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&&!qMs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(YZ(t).status=e.status),"statusText"in e&&e.statusText!=null&&(YZ(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&LMs(JMs(t),e.headers),r){if(WMs.includes(t.status))throw ra.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});YZ(t).body=r.body,r.type!=null&&!YZ(t).headersList.contains("content-type",!0)&&YZ(t).headersList.append("content-type",r.type,!0)}}a(Ajn,"initializeResponse");function n2e(t,e){let r=new wT(kst);XMs(r,t);let n=new yjn(kst);return ZMs(r,n),_jn(n,t.headersList),Ejn(n,e),t.urlList.length!==0&&t.body?.stream&&vjn.register(r,new WeakRef(t.body.stream)),r}a(n2e,"fromInnerResponse");ra.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ra.converters.USVString(t,e,r):ra.is.Blob(t)||ra.is.BufferSource(t)||ra.is.FormData(t)||ra.is.URLSearchParams(t)?t:ra.converters.DOMString(t,e,r)};ra.converters.BodyInit=function(t,e,r){return ra.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:ra.converters.XMLHttpRequestBodyInit(t,e,r)};ra.converters.ResponseInit=ra.dictionaryConverter([{key:"status",converter:ra.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ra.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ra.converters.HeadersInit}]);ra.is.Response=ra.util.MakeTypeAssertion(wT);Sjn.exports={isNetworkError:eOs,makeNetworkError:Pst,makeResponse:Rpe,makeAppropriateNetworkError:tOs,filterResponse:bjn,Response:wT,cloneResponse:car,fromInnerResponse:n2e,getResponseState:YZ}});var kpe=I((xuf,Fjn)=>{"use strict";p();var{extractBody:rOs,mixinBody:nOs,cloneBody:iOs,bodyUnusable:Tjn}=ape(),{Headers:Pjn,fill:oOs,HeadersList:Mst,setHeadersGuard:lar,getHeadersGuard:sOs,setHeadersList:Djn,getHeadersList:Ijn}=zZ(),Nst=Do(),xjn=require("node:util"),{isValidHTTPToken:aOs,sameOrigin:wjn,environmentSettingsObject:Dst}=vT(),{forbiddenMethodsSet:cOs,corsSafeListedMethodsSet:lOs,referrerPolicy:uOs,requestRedirect:dOs,requestMode:fOs,requestCredentials:pOs,requestCache:hOs,requestDuplex:mOs}=APe(),{kEnumerableProperty:um,normalizedMethodRecordsBase:gOs,normalizedMethodRecords:AOs}=Nst,{webidl:Li}=$A(),{URLSerializer:yOs}=Ow(),{kConstruct:Ost}=al(),EOs=require("node:assert"),{getMaxListeners:Njn,setMaxListeners:_Os,defaultMaxListeners:vOs}=require("node:events"),COs=Symbol("abortController"),Mjn=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Lst=new WeakMap,uar;try{uar=Njn(new AbortController().signal)>0}catch{uar=!1}function Rjn(t){return e;function e(){let r=t.deref();if(r!==void 0){Mjn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Lst.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()}Lst.delete(r.signal)}}}}a(Rjn,"buildAbort");var kjn=!1,Ab=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Li.util.markAsUncloneable(this),e===Ost)return;Li.argumentLengthCheck(arguments,1,"Request constructor"),e=Li.converters.RequestInfo(e),r=Li.converters.RequestInit(r);let o=null,s=null,c=Dst.settingsObject.baseUrl,l=null;if(typeof e=="string"){this.#t=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=Bst({urlList:[_]}),s="cors"}else EOs(Li.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=Dst.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&wjn(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=Bst({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Dst.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 _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!wjn(v,Dst.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 Li.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 _=r.method,v=AOs[_];if(v!==void 0)o.method=v;else{if(!aOs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(cOs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=gOs[b]??_,o.method=_}!kjn&&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"}),kjn=!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[COs]=m;let _=new WeakRef(m),v=Rjn(_);uar&&Njn(l)===vOs&&_Os(1500,l),Nst.addAbortListener(l,v),Mjn.register(m,{signal:l,abort:v},v)}if(this.#r=new Pjn(Ost),Djn(this.#r,o.headersList),lar(this.#r,"request"),h==="no-cors"){if(!lOs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);lar(this.#r,"request-no-cors")}if(f){let _=Ijn(this.#r),v=r.headers!==void 0?r.headers:new Mst(_);if(_.clear(),v instanceof Mst){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else oOs(this.#r,v)}let g=Li.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[_,v]=rOs(r.body,o.keepalive);A=_,v&&!Ijn(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 E=y;if(A==null&&g!=null){if(Tjn(e.#n))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this.#n.body=E}get method(){return Li.brandCheck(this,t),this.#n.method}get url(){return Li.brandCheck(this,t),yOs(this.#n.url)}get headers(){return Li.brandCheck(this,t),this.#r}get destination(){return Li.brandCheck(this,t),this.#n.destination}get referrer(){return Li.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Li.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Li.brandCheck(this,t),this.#n.mode}get credentials(){return Li.brandCheck(this,t),this.#n.credentials}get cache(){return Li.brandCheck(this,t),this.#n.cache}get redirect(){return Li.brandCheck(this,t),this.#n.redirect}get integrity(){return Li.brandCheck(this,t),this.#n.integrity}get keepalive(){return Li.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Li.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Li.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Li.brandCheck(this,t),this.#e}get body(){return Li.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Li.brandCheck(this,t),!!this.#n.body&&Nst.isDisturbed(this.#n.body.stream)}get duplex(){return Li.brandCheck(this,t),"half"}clone(){if(Li.brandCheck(this,t),Tjn(this.#n))throw new TypeError("unusable");let e=Ljn(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Lst.get(this.signal);n===void 0&&(n=new Set,Lst.set(this.signal,n));let o=new WeakRef(r);n.add(o),Nst.addAbortListener(r.signal,Rjn(o))}return Bjn(e,this.#t,r.signal,sOs(this.#r))}[xjn.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 ${xjn.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:bOs,getRequestDispatcher:SOs,setRequestDispatcher:TOs,setRequestHeaders:IOs,getRequestState:Ojn,setRequestState:xOs}=Ab;Reflect.deleteProperty(Ab,"setRequestSignal");Reflect.deleteProperty(Ab,"getRequestDispatcher");Reflect.deleteProperty(Ab,"setRequestDispatcher");Reflect.deleteProperty(Ab,"setRequestHeaders");Reflect.deleteProperty(Ab,"getRequestState");Reflect.deleteProperty(Ab,"setRequestState");nOs(Ab,Ojn);function Bst(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 Mst(t.headersList):new Mst}}a(Bst,"makeRequest");function Ljn(t){let e=Bst({...t,body:null});return t.body!=null&&(e.body=iOs(t.body)),e}a(Ljn,"cloneRequest");function Bjn(t,e,r,n){let o=new Ab(Ost);xOs(o,t),TOs(o,e),bOs(o,r);let s=new Pjn(Ost);return IOs(o,s),Djn(s,t.headersList),lar(s,n),o}a(Bjn,"fromInnerRequest");Object.defineProperties(Ab.prototype,{method:um,url:um,headers:um,redirect:um,clone:um,signal:um,duplex:um,destination:um,body:um,bodyUsed:um,isHistoryNavigation:um,isReloadNavigation:um,keepalive:um,integrity:um,cache:um,credentials:um,attribute:um,referrerPolicy:um,referrer:um,mode:um,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Li.is.Request=Li.util.MakeTypeAssertion(Ab);Li.converters.RequestInfo=function(t){return typeof t=="string"?Li.converters.USVString(t):Li.is.Request(t)?t:Li.converters.USVString(t)};Li.converters.RequestInit=Li.dictionaryConverter([{key:"method",converter:Li.converters.ByteString},{key:"headers",converter:Li.converters.HeadersInit},{key:"body",converter:Li.nullableConverter(Li.converters.BodyInit)},{key:"referrer",converter:Li.converters.USVString},{key:"referrerPolicy",converter:Li.converters.DOMString,allowedValues:uOs},{key:"mode",converter:Li.converters.DOMString,allowedValues:fOs},{key:"credentials",converter:Li.converters.DOMString,allowedValues:pOs},{key:"cache",converter:Li.converters.DOMString,allowedValues:hOs},{key:"redirect",converter:Li.converters.DOMString,allowedValues:dOs},{key:"integrity",converter:Li.converters.DOMString},{key:"keepalive",converter:Li.converters.boolean},{key:"signal",converter:Li.nullableConverter(t=>Li.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Li.converters.any},{key:"duplex",converter:Li.converters.DOMString,allowedValues:mOs},{key:"dispatcher",converter:Li.converters.any},{key:"priority",converter:Li.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);Fjn.exports={Request:Ab,makeRequest:Bst,fromInnerRequest:Bjn,cloneRequest:Ljn,getRequestDispatcher:SOs,getRequestState:Ojn}});var Vjn=I((kuf,$jn)=>{"use strict";p();var wOs=require("node:assert"),{runtimeFeatures:Qjn}=VF(),KZ=new Map([["sha256",0],["sha384",1],["sha512",2]]),dar;if(Qjn.has("crypto")){dar=require("node:crypto");let t=dar.getHashes();t.length===0&&KZ.clear();for(let e of KZ.keys())t.includes(e)===!1&&KZ.delete(e)}else KZ.clear();var Ujn=Map.prototype.get.bind(KZ),far=Map.prototype.has.bind(KZ),ROs=Qjn.has("crypto")===!1||KZ.size===0?()=>!0:(t,e)=>{let r=jjn(e);if(r.length===0)return!0;let n=qjn(r);for(let o of n){let s=o.alg,c=o.val,l=Hjn(s,t);if(Gjn(l,c))return!0}return!1};function qjn(t){let e=[],r=null;for(let n of t){if(wOs(far(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=Ujn(o),c=n.alg,l=Ujn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(qjn,"getStrongestMetadata");function jjn(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(!far(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(jjn,"parseMetadata");var Hjn=a((t,e)=>dar.hash(t,e,"base64"),"applyAlgorithmToBytes");function Gjn(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:ll,makeAppropriateNetworkError:o2e,filterResponse:par,makeResponse:Fst,fromInnerResponse:kOs,getResponseState:POs}=i2e(),{HeadersList:har}=zZ(),{Request:DOs,cloneRequest:NOs,getRequestDispatcher:MOs,getRequestState:OOs}=kpe(),k2=require("node:zlib"),{makePolicyContainer:LOs,clonePolicyContainer:BOs,requestBadPort:FOs,TAOCheck:UOs,appendRequestOriginHeader:QOs,responseLocationURL:qOs,requestCurrentURL:RT,setRequestReferrerPolicyOnRedirect:jOs,tryUpgradeRequestToAPotentiallyTrustworthyURL:HOs,createOpaqueTimingInfo:_ar,appendFetchMetadata:GOs,corsCheck:$Os,crossOriginResourcePolicyCheck:VOs,determineRequestsReferrer:WOs,coarsenedSharedCurrentTime:s2e,sameOrigin:yar,isCancelled:nH,isAborted:Wjn,isErrorLike:zOs,fullyReadBody:YOs,readableStreamClose:KOs,urlIsLocal:JOs,urlIsHttpHttpsScheme:jst,urlHasHttpsScheme:ZOs,clampAndCoarsenConnectionTimingInfo:XOs,simpleRangeHeaderValue:e5s,buildContentRange:t5s,createInflate:r5s,extractMimeType:n5s,hasAuthenticationEntry:i5s,includesCredentials:zjn,isTraversableNavigable:o5s}=vT(),JZ=require("node:assert"),{safelyExtractBody:Hst,extractBody:Yjn}=ape(),{redirectStatusSet:Xjn,nullBodyStatus:eHn,safeMethodsSet:s5s,requestBodyHeader:a5s,subresourceSet:c5s}=APe(),l5s=require("node:events"),{Readable:u5s,pipeline:d5s,finished:f5s,isErrored:p5s,isReadable:Ust}=require("node:stream"),{addAbortListener:h5s,bufferToLowerCasedHeaderName:Kjn}=Do(),{dataURLProcessor:m5s,serializeAMimeType:g5s,minimizeSupportedMimeType:A5s}=Ow(),{getGlobalDispatcher:y5s}=bst(),{webidl:Car}=$A(),{STATUS_CODES:Jjn}=require("node:http"),{bytesMatch:E5s}=Vjn(),{createDeferredPromise:_5s}=CPe(),{isomorphicEncode:Qst}=$F(),{runtimeFeatures:v5s}=VF(),C5s=v5s.has("zstd"),b5s=["GET","HEAD"],S5s=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",mar,qst=class extends l5s{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 T5s(t){tHn(t,"fetch")}a(T5s,"handleFetchDone");function I5s(t,e=void 0){Car.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=_5s(),n;try{n=new DOs(t,e)}catch(f){return r.reject(f),r.promise}let o=OOs(n);if(n.signal.aborted)return gar(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 h5s(n.signal,()=>{l=!0,JZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();gar(r,o,f,n.signal.reason,u.controller)}),u=nHn({request:o,processResponseEndOfBody:T5s,processResponse:a(f=>{if(!l){if(f.aborted){gar(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(kOs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:MOs(n),requestObject:n}),r.promise}a(I5s,"fetch");function tHn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;jst(r)&&n!==null&&(t.timingAllowPassed||(n=_ar({startTime:n.startTime}),o=""),n.endTime=s2e(),t.timingInfo=n,rHn(n,r.href,e,globalThis,o,"",t.status))}a(tHn,"finalizeAndReportTiming");var rHn=performance.markResourceTiming;function gar(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&Ust(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=POs(r);s.body?.stream!=null&&Ust(s.body.stream)&&o.error(n)}a(gar,"abortFetch");function nHn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=y5s(),requestObject:u=null}){JZ(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=s2e(f),m=_ar({startTime:h}),g={controller:new qst(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return JZ(!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=BOs(t.client.policyContainer):t.policyContainer=LOs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,c5s.has(t.destination),iHn(g,!1),g.controller}a(nHn,"fetching");async function iHn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!JOs(RT(r))&&(n=ll("local URLs only")),HOs(r),FOs(r)==="blocked"&&(n=ll("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=WOs(r)),n===null){let s=RT(r);yar(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await Zjn(t)):r.mode==="same-origin"?n=ll('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=ll('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await Zjn(t)):jst(RT(r))?(r.responseTainting="cors",n=await oHn(t)):n=ll("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=par(n,"basic"):r.responseTainting==="cors"?n=par(n,"cors"):r.responseTainting==="opaque"?n=par(n,"opaque"):JZ(!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=ll()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||eHn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>Aar(t,ll(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!E5s(l,r.integrity)){s("integrity mismatch");return}n.body=Hst(l)[0],Aar(t,n)},"processBody");YOs(n.body,c,s)}else Aar(t,n)}catch(r){t.controller.terminate(r)}}a(iHn,"mainFetch");function Zjn(t){if(nH(t)&&t.request.redirectCount===0)return Promise.resolve(o2e(t));let{request:e}=t,{protocol:r}=RT(e);switch(r){case"about:":return Promise.resolve(ll("about scheme is not supported"));case"blob:":{mar||(mar=require("node:buffer").resolveObjectURL);let n=RT(e);if(n.search.length!==0)return Promise.resolve(ll("NetworkError when attempting to fetch resource."));let o=mar(n.toString());if(e.method!=="GET"||!Car.is.Blob(o))return Promise.resolve(ll("invalid method"));let s=Fst(),c=o.size,l=Qst(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=e5s(d,!0);if(f==="failure")return Promise.resolve(ll("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(ll("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=Yjn(g);s.body=A[0];let y=Qst(`${g.size}`),E=t5s(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",E,!0)}else{let d=Yjn(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=RT(e),o=m5s(n);if(o==="failure")return Promise.resolve(ll("failed to fetch the data URL"));let s=g5s(o.mimeType);return Promise.resolve(Fst({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Hst(o.body)[0]}))}case"file:":return Promise.resolve(ll("not implemented... yet..."));case"http:":case"https:":return oHn(t).catch(n=>ll(n));default:return Promise.resolve(ll("unknown scheme"))}}a(Zjn,"schemeFetch");function x5s(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(x5s,"finalizeResponse");function Aar(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!jst(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=_ar(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=n5s(e.headersList);f!=="failure"&&(u.contentType=A5s(f))}t.request.initiatorType!=null&&rHn(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():f5s(o.body.stream,()=>{n()})}a(Aar,"fetchFinale");async function oHn(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 Ear(t),e.responseTainting==="cors"&&$Os(e,r)==="failure")return ll("cors failure");UOs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&VOs(e.origin,e.client,e.destination,n)==="blocked"?ll("blocked"):(Xjn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=ll("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await w5s(t,r):JZ(!1)),r.timingInfo=o,r)}a(oHn,"httpFetch");function w5s(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=qOs(n,RT(r).hash),o==null)return e}catch(c){return Promise.resolve(ll(c))}if(!jst(o))return Promise.resolve(ll("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(ll("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!yar(r,o))return Promise.resolve(ll('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(ll('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(ll());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!b5s.includes(r.method)){r.method="GET",r.body=null;for(let c of a5s)r.headersList.delete(c)}yar(RT(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&&(JZ(r.body.source!=null),r.body=Hst(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=s2e(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),jOs(r,n),iHn(t,!0)}a(w5s,"httpRedirectFetch");async function Ear(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=NOs(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=Qst(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,Car.is.URL(s.referrer)&&s.headersList.append("referer",Qst(s.referrer.href),!0),QOs(s),GOs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",S5s,!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)||(ZOs(RT(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(!(i5s(s)&&(s.useURLCredentials===void 0||!zjn(RT(s))))){if(zjn(RT(s))&&e){let{username:g,password:A}=RT(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 ll("only if cached");let m=await R5s(o,d,r);!s5s.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||o5s(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=Hst(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return nH(t)?o2e(t):c;t.controller.connection.destroy(),c=await Ear(t,!0)}if(c.status===407)return n.window==="no-window"?ll():nH(t)?o2e(t):ll("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(nH(t))return o2e(t);t.controller.connection.destroy(),c=await Ear(t,e,!0)}return c}a(Ear,"httpNetworkOrCacheFetch");async function R5s(t,e=!1,r=!1){JZ(!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*(_){nH(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{nH(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{nH(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=Fst({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=Fst({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),o2e(t,A)):ll(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{nH(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:_,value:v}=await t.controller.next();if(Wjn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){KOs(t.controller.controller),x5s(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),p5s(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){Wjn(t)?(o.aborted=!0,Ust(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Ust(h)&&t.controller.controller.error(new TypeError("terminated",{cause:zOs(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=RT(n),E=t.controller.dispatcher,_=y.pathname+y.search,v=y.search.length===0&&y.href[y.href.length-y.hash.length-1]==="?";return new Promise((b,T)=>E.dispatch({path:v?`${_}?`:_,origin:y.origin,method:n.method,body:E.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=XOs(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=s2e(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=s2e(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,P){if(w<200)return!1;let D=new har;for(let M=0;Mj)return T(new Error(`too many content-encodings in response: ${O.length}, maximum allowed is ${j}`)),!0;for(let Q=O.length-1;Q>=0;--Q){let U=O[Q].trim();if(U==="x-gzip"||U==="gzip")B.push(k2.createGunzip({flush:k2.constants.Z_SYNC_FLUSH,finishFlush:k2.constants.Z_SYNC_FLUSH}));else if(U==="deflate")B.push(r5s({flush:k2.constants.Z_SYNC_FLUSH,finishFlush:k2.constants.Z_SYNC_FLUSH}));else if(U==="br")B.push(k2.createBrotliDecompress({flush:k2.constants.BROTLI_OPERATION_FLUSH,finishFlush:k2.constants.BROTLI_OPERATION_FLUSH}));else if(U==="zstd"&&C5s)B.push(k2.createZstdDecompress({flush:k2.constants.ZSTD_e_continue,finishFlush:k2.constants.ZSTD_e_end}));else{B.length=0;break}}}let q=this.onError.bind(this);return b({status:w,statusText:P,headersList:D,body:B.length?d5s(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,P){if(P.session!=null&&R!==200||P.session==null&&R!==101)return!1;let D=new har;for(let[N,L]of Object.entries(x)){if(L==null)continue;let B=N.toLowerCase();if(Array.isArray(L))for(let q of L)D.append(B,String(q),!0);else D.append(B,String(L),!0)}return b({status:R,statusText:Jjn[R],headersList:D,socket:P}),!0},onUpgrade(w,R,x){if(x.session!=null&&w!==200||x.session==null&&w!==101)return!1;let P=new har;for(let D=0;D{"use strict";p();var k5s=require("node:assert"),{URLSerializer:aHn}=Ow(),{isValidHeaderName:P5s}=vT();function D5s(t,e,r=!1){let n=aHn(t,r),o=aHn(e,r);return n===o}a(D5s,"urlEquals");function N5s(t){k5s(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),P5s(r)&&e.push(r);return e}a(N5s,"getFieldValues");cHn.exports={urlEquals:D5s,getFieldValues:N5s}});var pHn=I((Uuf,fHn)=>{"use strict";p();var bar=require("node:assert"),{kConstruct:M5s}=al(),{urlEquals:O5s,getFieldValues:Sar}=lHn(),{kEnumerableProperty:ZZ,isDisturbed:L5s}=Do(),{webidl:Zn}=$A(),{cloneResponse:uHn,fromInnerResponse:B5s,getResponseState:F5s}=i2e(),{Request:c2e,fromInnerRequest:U5s,getRequestState:Q5}=kpe(),{fetching:Q5s}=a2e(),{urlIsHttpHttpsScheme:Gst,readAllBytes:q5s}=vT(),{createDeferredPromise:Ppe}=CPe(),$st=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==M5s&&Zn.illegalConstructor(),Zn.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Zn.brandCheck(this,t);let n="Cache.match";Zn.argumentLengthCheck(arguments,1,n),e=Zn.converters.RequestInfo(e),r=Zn.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={}){Zn.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Zn.converters.RequestInfo(e)),r=Zn.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Zn.brandCheck(this,t),Zn.argumentLengthCheck(arguments,1,"Cache.add"),e=Zn.converters.RequestInfo(e);let n=[e];return await this.addAll(n)}async addAll(e){Zn.brandCheck(this,t);let r="Cache.addAll";Zn.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Zn.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Zn.converters.RequestInfo(m),typeof m=="string")continue;let g=Q5(m);if(!Gst(g.url)||g.method!=="GET")throw Zn.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=Q5(new c2e(m));if(!Gst(g.url))throw Zn.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Ppe();s.push(Q5s({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Zn.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=Sar(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Zn.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=Ppe(),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){Zn.brandCheck(this,t);let n="Cache.put";Zn.argumentLengthCheck(arguments,2,n),e=Zn.converters.RequestInfo(e),r=Zn.converters.Response(r,n,"response");let o=null;if(Zn.is.Request(e)?o=Q5(e):o=Q5(new c2e(e)),!Gst(o.url)||o.method!=="GET")throw Zn.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=F5s(r);if(s.status===206)throw Zn.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=Sar(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Zn.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(L5s(s.body.stream)||s.body.stream.locked))throw Zn.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=uHn(s),l=Ppe();if(s.body!=null){let A=s.body.stream.getReader();q5s(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=Ppe(),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={}){Zn.brandCheck(this,t);let n="Cache.delete";Zn.argumentLengthCheck(arguments,1,n),e=Zn.converters.RequestInfo(e),r=Zn.converters.CacheQueryOptions(r,n,"options");let o=null;if(Zn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else bar(typeof e=="string"),o=Q5(new c2e(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Ppe(),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={}){Zn.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Zn.converters.RequestInfo(e)),r=Zn.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(Zn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=Q5(new c2e(e)));let s=Ppe(),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=U5s(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 Zn.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Zn.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);bar(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!Gst(u.url))throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Zn.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);bar(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=""),!O5s(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Sar(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(Zn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=Q5(new c2e(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=B5s(uHn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties($st.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:ZZ,matchAll:ZZ,add:ZZ,addAll:ZZ,put:ZZ,delete:ZZ,keys:ZZ});var dHn=[{key:"ignoreSearch",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Zn.converters.CacheQueryOptions=Zn.dictionaryConverter(dHn);Zn.converters.MultiCacheQueryOptions=Zn.dictionaryConverter([...dHn,{key:"cacheName",converter:Zn.converters.DOMString}]);Zn.converters.Response=Zn.interfaceConverter(Zn.is.Response,"Response");Zn.converters["sequence"]=Zn.sequenceConverter(Zn.converters.RequestInfo);fHn.exports={Cache:$st}});var mHn=I((juf,hHn)=>{"use strict";p();var{Cache:Vst}=pHn(),{webidl:CE}=$A(),{kEnumerableProperty:l2e}=Do(),{kConstruct:u2e}=al(),Wst=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==u2e&&CE.illegalConstructor(),CE.util.markAsUncloneable(this)}async match(e,r={}){if(CE.brandCheck(this,t),CE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=CE.converters.RequestInfo(e),r=CE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Vst(u2e,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Vst(u2e,n).match(e,r);if(s!==void 0)return s}}async has(e){CE.brandCheck(this,t);let r="CacheStorage.has";return CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){CE.brandCheck(this,t);let r="CacheStorage.open";if(CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Vst(u2e,o)}let n=[];return this.#e.set(e,n),new Vst(u2e,n)}async delete(e){CE.brandCheck(this,t);let r="CacheStorage.delete";return CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return CE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Wst.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:l2e,has:l2e,open:l2e,delete:l2e,keys:l2e});hHn.exports={CacheStorage:Wst}});var AHn=I(($uf,gHn)=>{"use strict";p();gHn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Tar=I((Wuf,CHn)=>{"use strict";p();function j5s(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(j5s,"isCTLExcludingHtab");function yHn(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(yHn,"validateCookieName");function EHn(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(EHn,"validateCookieValue");function _Hn(t){for(let e=0;ee.toString().padStart(2,"0"));function vHn(t){return typeof t=="number"&&(t=new Date(t)),`${G5s[t.getUTCDay()]}, ${zst[t.getUTCDate()]} ${$5s[t.getUTCMonth()]} ${t.getUTCFullYear()} ${zst[t.getUTCHours()]}:${zst[t.getUTCMinutes()]}:${zst[t.getUTCSeconds()]} GMT`}a(vHn,"toIMFDate");function V5s(t){if(t<0)throw new Error("Invalid cookie max-age")}a(V5s,"validateCookieMaxAge");function W5s(t){if(t.name.length===0)return null;yHn(t.name),EHn(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"&&(V5s(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(H5s(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(_Hn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${vHn(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(W5s,"stringify");CHn.exports={isCTLExcludingHtab:j5s,validateCookieName:yHn,validateCookiePath:_Hn,validateCookieValue:EHn,toIMFDate:vHn,stringify:W5s}});var SHn=I((Kuf,bHn)=>{"use strict";p();var{collectASequenceOfCodePointsFast:Yst}=$F(),{maxNameValuePairSize:z5s,maxAttributeValueSize:Y5s}=AHn(),{isCTLExcludingHtab:K5s}=Tar(),J5s=require("node:assert");function Z5s(t){if(K5s(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Yst(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Yst("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>z5s?null:{name:n,value:o,...Dpe(r)}}a(Z5s,"parseSetCookie");function Dpe(t,e={}){if(t.length===0)return e;J5s(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Yst(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Yst("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>Y5s)return Dpe(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 Dpe(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 Dpe(t,e)}a(Dpe,"parseUnparsedAttributes");bHn.exports={parseSetCookie:Z5s,parseUnparsedAttributes:Dpe}});var wHn=I((Xuf,xHn)=>{"use strict";p();var{parseSetCookie:THn}=SHn(),{stringify:X5s}=Tar(),{webidl:Ya}=$A(),{Headers:e4s}=zZ(),Kst=Ya.brandCheckMultiple([e4s,globalThis.Headers].filter(Boolean));function t4s(t){Ya.argumentLengthCheck(arguments,1,"getCookies"),Kst(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(t4s,"getCookies");function r4s(t,e,r){Kst(t);let n="deleteCookie";Ya.argumentLengthCheck(arguments,2,n),e=Ya.converters.DOMString(e,n,"name"),r=Ya.converters.DeleteCookieAttributes(r),IHn(t,{name:e,value:"",expires:new Date(0),...r})}a(r4s,"deleteCookie");function n4s(t){Ya.argumentLengthCheck(arguments,1,"getSetCookies"),Kst(t);let e=t.getSetCookie();return e?e.map(r=>THn(r)):[]}a(n4s,"getSetCookies");function i4s(t){return t=Ya.converters.DOMString(t),THn(t)}a(i4s,"parseCookie");function IHn(t,e){Ya.argumentLengthCheck(arguments,2,"setCookie"),Kst(t),e=Ya.converters.Cookie(e);let r=X5s(e);r&&t.append("set-cookie",r,!0)}a(IHn,"setCookie");Ya.converters.DeleteCookieAttributes=Ya.dictionaryConverter([{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Ya.converters.Cookie=Ya.dictionaryConverter([{converter:Ya.converters.DOMString,key:"name"},{converter:Ya.converters.DOMString,key:"value"},{converter:Ya.nullableConverter(t=>typeof t=="number"?Ya.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Ya.sequenceConverter(Ya.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);xHn.exports={getCookies:t4s,deleteCookie:r4s,getSetCookies:n4s,setCookie:IHn,parseCookie:i4s}});var Xst=I((rdf,kHn)=>{"use strict";p();var{webidl:li}=$A(),{kEnumerableProperty:yb}=Do(),{kConstruct:RHn}=al(),Npe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===RHn){super(arguments[1],arguments[2]),li.util.markAsUncloneable(this);return}let n="MessageEvent constructor";li.argumentLengthCheck(arguments,1,n),e=li.converters.DOMString(e,n,"type"),r=li.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,li.util.markAsUncloneable(this)}get data(){return li.brandCheck(this,t),this.#e.data}get origin(){return li.brandCheck(this,t),this.#e.origin}get lastEventId(){return li.brandCheck(this,t),this.#e.lastEventId}get source(){return li.brandCheck(this,t),this.#e.source}get ports(){return li.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 li.brandCheck(this,t),li.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(RHn,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:o4s}=Npe;delete Npe.createFastMessageEvent;var Jst=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";li.argumentLengthCheck(arguments,1,n),e=li.converters.DOMString(e,n,"type"),r=li.converters.CloseEventInit(r),super(e,r),this.#e=r,li.util.markAsUncloneable(this)}get wasClean(){return li.brandCheck(this,t),this.#e.wasClean}get code(){return li.brandCheck(this,t),this.#e.code}get reason(){return li.brandCheck(this,t),this.#e.reason}},Zst=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";li.argumentLengthCheck(arguments,1,n),super(e,r),li.util.markAsUncloneable(this),e=li.converters.DOMString(e,n,"type"),r=li.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return li.brandCheck(this,t),this.#e.message}get filename(){return li.brandCheck(this,t),this.#e.filename}get lineno(){return li.brandCheck(this,t),this.#e.lineno}get colno(){return li.brandCheck(this,t),this.#e.colno}get error(){return li.brandCheck(this,t),this.#e.error}};Object.defineProperties(Npe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:yb,origin:yb,lastEventId:yb,source:yb,ports:yb,initMessageEvent:yb});Object.defineProperties(Jst.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:yb,code:yb,wasClean:yb});Object.defineProperties(Zst.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:yb,filename:yb,lineno:yb,colno:yb,error:yb});li.converters.MessagePort=li.interfaceConverter(li.is.MessagePort,"MessagePort");li.converters["sequence"]=li.sequenceConverter(li.converters.MessagePort);var Iar=[{key:"bubbles",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];li.converters.MessageEventInit=li.dictionaryConverter([...Iar,{key:"data",converter:li.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:li.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:li.nullableConverter(li.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:li.converters["sequence"],defaultValue:a(()=>[],"defaultValue")}]);li.converters.CloseEventInit=li.dictionaryConverter([...Iar,{key:"wasClean",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:li.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);li.converters.ErrorEventInit=li.dictionaryConverter([...Iar,{key:"message",converter:li.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:li.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:li.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:li.converters.any}]);kHn.exports={MessageEvent:Npe,CloseEvent:Jst,ErrorEvent:Zst,createFastMessageEvent:o4s}});var iH=I((odf,PHn)=>{"use strict";p();var s4s="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",a4s={enumerable:!0,writable:!1,configurable:!1},c4s={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},l4s={SENT:1,RECEIVED:2},u4s={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},d4s=65535,f4s={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},p4s=Buffer.allocUnsafe(0),h4s={text:1,typedArray:2,arrayBuffer:3,blob:4};PHn.exports={uid:s4s,sentCloseFrameState:l4s,staticPropertyDescriptors:a4s,states:c4s,opcodes:u4s,maxUnsigned16Bit:d4s,parserStates:f4s,emptyBuffer:p4s,sendHints:h4s}});var XZ=I((adf,LHn)=>{"use strict";p();var{states:eat,opcodes:Mpe}=iH(),{isUtf8:m4s}=require("node:buffer"),{removeHTTPWhitespace:DHn}=Ow(),{collectASequenceOfCodePointsFast:g4s}=$F();function A4s(t){return t===eat.CONNECTING}a(A4s,"isConnecting");function y4s(t){return t===eat.OPEN}a(y4s,"isEstablished");function E4s(t){return t===eat.CLOSING}a(E4s,"isClosing");function _4s(t){return t===eat.CLOSED}a(_4s,"isClosed");function v4s(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(v4s,"fireEvent");function C4s(t,e,r){t.onMessage(e,r)}a(C4s,"websocketMessageReceived");function b4s(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(b4s,"toArrayBuffer");function S4s(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(S4s,"isValidSubprotocol");function T4s(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(T4s,"isValidStatusCode");function NHn(t){return t===Mpe.CLOSE||t===Mpe.PING||t===Mpe.PONG}a(NHn,"isControlFrame");function MHn(t){return t===Mpe.CONTINUATION}a(MHn,"isContinuationFrame");function OHn(t){return t===Mpe.TEXT||t===Mpe.BINARY}a(OHn,"isTextBinaryFrame");function I4s(t){return OHn(t)||MHn(t)||NHn(t)}a(I4s,"isValidOpcode");function x4s(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(w4s,"isValidClientWindowBits");function R4s(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(R4s,"getURLRecord");function k4s(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(k4s,"validateCloseCodeAndReason");var P4s=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(m4s(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();LHn.exports={isConnecting:A4s,isEstablished:y4s,isClosing:E4s,isClosed:_4s,fireEvent:v4s,isValidSubprotocol:S4s,isValidStatusCode:T4s,websocketMessageReceived:C4s,utf8Decode:P4s,isControlFrame:NHn,isContinuationFrame:MHn,isTextBinaryFrame:OHn,isValidOpcode:I4s,parseExtensions:x4s,isValidClientWindowBits:w4s,toArrayBuffer:b4s,getURLRecord:R4s,validateCloseCodeAndReason:k4s}});var Lpe=I((udf,FHn)=>{"use strict";p();var{runtimeFeatures:D4s}=VF(),{maxUnsigned16Bit:BHn,opcodes:N4s}=iH(),tat=8*1024,d2e=null,Ope=tat,M4s=D4s.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;oBHn?(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;uBHn?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|N4s.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]}};FHn.exports={WebsocketFrameSend:war,generateMask:xar}});var rat=I((pdf,GHn)=>{"use strict";p();var{uid:O4s,states:Rar,sentCloseFrameState:kar,emptyBuffer:UHn,opcodes:L4s}=iH(),{parseExtensions:B4s,isClosed:F4s,isClosing:U4s,isEstablished:jHn,isConnecting:Q4s,validateCloseCodeAndReason:q4s}=XZ(),{makeRequest:j4s}=kpe(),{fetching:H4s}=a2e(),{Headers:G4s,getHeadersList:$4s}=zZ(),{getDecodeSplit:V4s}=vT(),{WebsocketFrameSend:W4s}=Lpe(),z4s=require("node:assert"),{runtimeFeatures:Y4s}=VF(),QHn=Y4s.has("crypto")?require("node:crypto"):null,qHn=!1;function K4s(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=j4s({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=$4s(new G4s(o.headers));c.headersList=f}let l=QHn.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),H4s({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){q5(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){q5(n,1002,"Received network error or non-200 status code.",f.error);return}}if(qHn===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),qHn=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){q5(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){q5(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){q5(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=QHn.hash("sha1",l+O4s,"base64");if(h!==m){q5(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=B4s(g),!A.has("permessage-deflate"))){q5(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!V4s("sec-websocket-protocol",c.headersList).includes(y)){q5(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(K4s,"establishWebSocketConnection");function HHn(t,e,r,n=!1){if(e??=null,r??="",n&&q4s(e,r),!(F4s(t.readyState)||U4s(t.readyState)))if(!jHn(t.readyState))q5(t),t.readyState=Rar.CLOSING;else if(!t.closeState.has(kar.SENT)&&!t.closeState.has(kar.RECEIVED)){let o=new W4s;r.length!==0&&e===null&&(e=1e3),z4s(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=UHn: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=UHn,t.socket.write(o.createFrame(L4s.CLOSE)),t.closeState.add(kar.SENT),t.readyState=Rar.CLOSING}else t.readyState=Rar.CLOSING}a(HHn,"closeWebSocketConnection");function q5(t,e,r,n){jHn(t.readyState)&&HHn(t,e,r,!1),t.controller.abort(),Q4s(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(q5,"failWebsocketConnection");GHn.exports={establishWebSocketConnection:K4s,failWebsocketConnection:q5,closeWebSocketConnection:HHn}});var VHn=I((gdf,$Hn)=>{"use strict";p();var{createInflateRaw:J4s,Z_DEFAULT_WINDOWBITS:Z4s}=require("node:zlib"),{isValidClientWindowBits:X4s}=XZ(),{MessageSizeExceededError:eLs}=ao(),tLs=Buffer.from([0,0,255,255]),nat=Symbol("kBuffer"),f2e=Symbol("kLength"),Par=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=Z4s;if(this.#t.serverMaxWindowBits){if(!X4s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=J4s({windowBits:o})}catch(s){n(s);return}this.#e[nat]=[],this.#e[f2e]=0,this.#e.on("data",s=>{if(this.#e[f2e]+=s.length,this.#r>0&&this.#e[f2e]>this.#r){n(new eLs),this.#e.removeAllListeners(),this.#e=null;return}this.#e[nat].push(s)}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#e.write(e),r&&this.#e.write(tLs),this.#e.flush(()=>{if(!this.#e)return;let o=Buffer.concat(this.#e[nat],this.#e[f2e]);this.#e[nat].length=0,this.#e[f2e]=0,n(null,o)})}};$Hn.exports={PerMessageDeflate:Par}});var Oar=I((Edf,JHn)=>{"use strict";p();var{Writable:rLs}=require("node:stream"),nLs=require("node:assert"),{parserStates:Eb,opcodes:Bpe,states:iLs,emptyBuffer:WHn,sentCloseFrameState:p2e}=iH(),{isValidStatusCode:oLs,isValidOpcode:sLs,websocketMessageReceived:zHn,utf8Decode:aLs,isControlFrame:Dar,isTextBinaryFrame:Nar,isContinuationFrame:cLs}=XZ(),{failWebsocketConnection:bE}=rat(),{WebsocketFrameSend:YHn}=Lpe(),{PerMessageDeflate:lLs}=VHn(),{MessageSizeExceededError:KHn}=ao(),Mar=class extends rLs{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=Eb.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 lLs(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&&!Dar(this.#o.opcode)&&this.#o.payloadLength+this.#t>this.#l?(bE(this.#c,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#n;)if(this.#i===Eb.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!==Bpe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!sLs(o))return bE(this.#c,1002,"Invalid opcode received"),e();if(s)return bE(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){bE(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){bE(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Nar(o)){bE(this.#c,1002,"Invalid frame type was fragmented.");return}if(Nar(o)&&this.#s.length>0){bE(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){bE(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&Dar(o)){bE(this.#c,1002,"Control frame either too large or fragmented");return}if(cLs(o)&&this.#s.length===0&&!this.#o.compressed){bE(this.#c,1002,"Unexpected continuation frame");return}if(l<=125){if(this.#o.payloadLength=l,this.#i=Eb.READ_DATA,!this.#p())return}else l===126?this.#i=Eb.PAYLOADLENGTH_16:l===127&&(this.#i=Eb.PAYLOADLENGTH_64);Nar(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===Eb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);if(this.#o.payloadLength=r.readUInt16BE(0),this.#i=Eb.READ_DATA,!this.#p())return}else if(this.#i===Eb.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){bE(this.#c,1009,"Received payload length > 2^31 bytes.");return}if(this.#o.payloadLength=o,this.#i=Eb.READ_DATA,!this.#p())return}else if(this.#i===Eb.READ_DATA){if(this.#r{if(n){let s=n instanceof KHn?1009:1007;bE(this.#c,s,n.message);return}if(this.writeFragments(o)){if(this.#l>0&&this.#t>this.#l){bE(this.#c,1009,new KHn().message);return}if(!this.#o.fin){this.#i=Eb.INFO,this.#n=!0,this.run(e);return}zHn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=Eb.INFO,this.run(e)}},this.#t),this.#n=!1;break}else{if(!this.writeFragments(r))return;!this.#o.fragmented&&this.#o.fin&&zHn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#i=Eb.INFO}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return WHn;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?(bE(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&&!oLs(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=aLs(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===Bpe.CLOSE){if(n===1)return bE(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 bE(this.#c,o,s),!1}if(!this.#c.closeState.has(p2e.SENT)&&!this.#c.closeState.has(p2e.RECEIVED)){let o=WHn;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new YHn(o);this.#c.socket.write(s.createFrame(Bpe.CLOSE)),this.#c.closeState.add(p2e.SENT)}return this.#c.readyState=iLs.CLOSING,this.#c.closeState.add(p2e.RECEIVED),!1}else if(r===Bpe.PING){if(!this.#c.closeState.has(p2e.RECEIVED)){let o=new YHn(e);this.#c.socket.write(o.createFrame(Bpe.PONG)),this.#c.onPing(e)}}else r===Bpe.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};JHn.exports={ByteParser:Mar}});var tGn=I((Cdf,eGn)=>{"use strict";p();var{WebsocketFrameSend:XHn}=Lpe(),{opcodes:ZHn,sendHints:eX}=iH(),uLs=cor(),Bar=class{static{a(this,"SendQueue")}#e=new uLs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==eX.blob){if(this.#t){let s={promise:null,callback:r,frame:Lar(e,n)};this.#e.push(s)}else if(n===eX.text){let{0:s,1:c}=XHn.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(Lar(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=Lar(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 Lar(t,e){return new XHn(dLs(t,e)).createFrame(e===eX.text?ZHn.TEXT:ZHn.BINARY)}a(Lar,"createFrame");function dLs(t,e){switch(e){case eX.text:case eX.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case eX.arrayBuffer:case eX.blob:return new Uint8Array(t)}}a(dLs,"toBuffer");eGn.exports={SendQueue:Bar}});var aGn=I((Tdf,sGn)=>{"use strict";p();var{isArrayBuffer:fLs}=require("node:util/types"),{webidl:mi}=$A(),{URLSerializer:pLs}=Ow(),{environmentSettingsObject:rGn}=vT(),{staticPropertyDescriptors:oH,states:n8,sentCloseFrameState:Far,sendHints:iat,opcodes:Uar}=iH(),{isConnecting:hLs,isEstablished:nGn,isClosing:iGn,isClosed:mLs,isValidSubprotocol:gLs,fireEvent:oat,utf8Decode:ALs,toArrayBuffer:yLs,getURLRecord:ELs}=XZ(),{establishWebSocketConnection:_Ls,closeWebSocketConnection:vLs,failWebsocketConnection:oGn}=rat(),{ByteParser:CLs}=Oar(),{kEnumerableProperty:Hw}=Do(),{getGlobalDispatcher:bLs}=bst(),{ErrorEvent:SLs,CloseEvent:TLs,createFastMessageEvent:ILs}=Xst(),{SendQueue:xLs}=tGn(),{WebsocketFrameSend:wLs}=Lpe(),{channels:j5}=Fj();function RLs(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(RLs,"getSocketAddress");var fv=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=>oGn(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=n8.CLOSING,j5.socketError.hasSubscribers&&j5.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{j5.ping.hasSubscribers&&j5.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{j5.pong.hasSubscribers&&j5.pong.publish({payload:e,websocket:this})},"onPong"),readyState:n8.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),mi.util.markAsUncloneable(this);let n="WebSocket constructor";mi.argumentLengthCheck(arguments,1,n);let o=mi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=mi.converters.USVString(e),r=o.protocols;let s=rGn.settingsObject.baseUrl,c=ELs(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=>gLs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=rGn.settingsObject;this.#o.controller=_Ls(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){mi.brandCheck(this,t),e!==void 0&&(e=mi.converters["unsigned short"](e,"WebSocket.close","code",mi.attributes.Clamp)),r!==void 0&&(r=mi.converters.USVString(r)),e??=null,r??="",vLs(this.#o,e,r,!0)}send(e){mi.brandCheck(this,t);let r="WebSocket.send";if(mi.argumentLengthCheck(arguments,1,r),e=mi.converters.WebSocketSendData(e,r,"data"),hLs(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!nGn(this.#o.readyState)||iGn(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},iat.text)}else fLs(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},iat.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},iat.typedArray)):mi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},iat.blob))}get readyState(){return mi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return mi.brandCheck(this,t),this.#t}get url(){return mi.brandCheck(this,t),pLs(this.#s)}get extensions(){return mi.brandCheck(this,t),this.#n}get protocol(){return mi.brandCheck(this,t),this.#r}get onopen(){return mi.brandCheck(this,t),this.#e.open}set onopen(e){mi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return mi.brandCheck(this,t),this.#e.error}set onerror(e){mi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return mi.brandCheck(this,t),this.#e.close}set onclose(e){mi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return mi.brandCheck(this,t),this.#e.message}set onmessage(e){mi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return mi.brandCheck(this,t),this.#a}set binaryType(e){mi.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 CLs(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 xLs(e.socket),this.#o.readyState=n8.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),oat("open",this),j5.open.hasSubscribers){let d=e.headersList.entries;j5.open.publish({address:RLs(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!==n8.OPEN)return;let n;if(e===Uar.TEXT)try{n=ALs(r)}catch{oGn(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===Uar.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=yLs(r));oat("message",this,ILs,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(Far.SENT)&&this.#o.closeState.has(Far.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=n8.CLOSED,this.#o.closeState.has(Far.RECEIVED)||(r=1006,oat("error",this,(s,c)=>new SLs(s,c),{error:new TypeError(n)})),oat("close",this,(s,c)=>new TLs(s,c),{wasClean:e,code:r,reason:n}),j5.close.hasSubscribers&&j5.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(nGn(n)&&!iGn(n)&&!mLs(n)){let o=new wLs(r);e.#o.socket.write(o.createFrame(Uar.PING))}}},{ping:kLs}=fv;Reflect.deleteProperty(fv,"ping");fv.CONNECTING=fv.prototype.CONNECTING=n8.CONNECTING;fv.OPEN=fv.prototype.OPEN=n8.OPEN;fv.CLOSING=fv.prototype.CLOSING=n8.CLOSING;fv.CLOSED=fv.prototype.CLOSED=n8.CLOSED;Object.defineProperties(fv.prototype,{CONNECTING:oH,OPEN:oH,CLOSING:oH,CLOSED:oH,url:Hw,readyState:Hw,bufferedAmount:Hw,onopen:Hw,onerror:Hw,onclose:Hw,close:Hw,onmessage:Hw,binaryType:Hw,send:Hw,extensions:Hw,protocol:Hw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(fv,{CONNECTING:oH,OPEN:oH,CLOSING:oH,CLOSED:oH});mi.converters["sequence"]=mi.sequenceConverter(mi.converters.DOMString);mi.converters["DOMString or sequence"]=function(t,e,r){return mi.util.Type(t)===mi.util.Types.OBJECT&&Symbol.iterator in t?mi.converters["sequence"](t):mi.converters.DOMString(t,e,r)};mi.converters.WebSocketInit=mi.dictionaryConverter([{key:"protocols",converter:mi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:mi.converters.any,defaultValue:a(()=>bLs(),"defaultValue")},{key:"headers",converter:mi.nullableConverter(mi.converters.HeadersInit)}]);mi.converters["DOMString or sequence or WebSocketInit"]=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&!(Symbol.iterator in t)?mi.converters.WebSocketInit(t):{protocols:mi.converters["DOMString or sequence"](t)}};mi.converters.WebSocketSendData=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&(mi.is.Blob(t)||mi.is.BufferSource(t))?t:mi.converters.USVString(t)};sGn.exports={WebSocket:fv,ping:kLs}});var Qar=I((wdf,uGn)=>{"use strict";p();var{webidl:sat}=$A(),{validateCloseCodeAndReason:PLs}=XZ(),{kConstruct:cGn}=al(),{kEnumerableProperty:lGn}=Do();function DLs(){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(DLs,"createInheritableDOMException");var tX=class t extends DLs(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=sat.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===cGn)return;r!==null&&(r=sat.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";PLs(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,cGn);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:NLs}=tX;delete tX.createUnvalidatedWebSocketError;Object.defineProperties(tX.prototype,{closeCode:lGn,reason:lGn,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});sat.is.WebSocketError=sat.util.MakeTypeAssertion(tX);uGn.exports={WebSocketError:tX,createUnvalidatedWebSocketError:NLs}});var mGn=I((Pdf,hGn)=>{"use strict";p();var{createDeferredPromise:qar}=CPe(),{environmentSettingsObject:dGn}=vT(),{states:Fpe,opcodes:aat,sentCloseFrameState:Upe}=iH(),{webidl:gp}=$A(),{getURLRecord:MLs,isValidSubprotocol:OLs,isEstablished:LLs,utf8Decode:BLs}=XZ(),{establishWebSocketConnection:FLs,failWebsocketConnection:jar,closeWebSocketConnection:Har}=rat(),{channels:fGn}=Fj(),{WebsocketFrameSend:ULs}=Lpe(),{ByteParser:QLs}=Oar(),{WebSocketError:qLs,createUnvalidatedWebSocketError:jLs}=Qar(),{kEnumerableProperty:cat}=Do(),{utf8DecodeBytes:HLs}=Rot(),pGn=!1,lat=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=>jar(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=Fpe.CLOSING,fGn.socketError.hasSubscribers&&fGn.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:Fpe.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){pGn||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),pGn=!0),gp.argumentLengthCheck(arguments,1,"WebSocket"),e=gp.converters.USVString(e),r!==null&&(r=gp.converters.WebSocketStreamOptions(r));let n=dGn.settingsObject.baseUrl,o=MLs(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=>OLs(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=qar(),this.#r=qar(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{LLs(this.#a.readyState)||(jar(this.#a),this.#a.readyState=Fpe.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=dGn.settingsObject;this.#a.controller=FLs(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=gp.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;Har(this.#a,r,n,!0)}#u(e){e=gp.converters.WebSocketStreamWrite(e);let r=qar(),n=null,o=null;if(gp.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=aat.BINARY;else{let s;try{s=gp.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=aat.TEXT}if(!this.#a.closeState.has(Upe.SENT)&&!this.#a.closeState.has(Upe.RECEIVED)){let s=new ULs(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 QLs(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=Fpe.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(()=>Har(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!==Fpe.OPEN)return;let n;if(e===aat.TEXT)try{n=BLs(r)}catch{jar(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===aat.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(Upe.SENT)&&this.#a.closeState.has(Upe.RECEIVED);if(this.#a.readyState=Fpe.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new qLs("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(Upe.SENT)&&!this.#a.closeState.has(Upe.RECEIVED)&&(n=1006);let o=r?.reason==null?"":HLs(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=jLs("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";gp.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),Har(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(lat.prototype,{url:cat,opened:cat,closed:cat,close:cat,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});gp.converters.WebSocketStreamOptions=gp.dictionaryConverter([{key:"protocols",converter:gp.sequenceConverter(gp.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:gp.nullableConverter(gp.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);gp.converters.WebSocketCloseInfo=gp.dictionaryConverter([{key:"closeCode",converter:a(t=>gp.converters["unsigned short"](t,gp.attributes.EnforceRange),"converter")},{key:"reason",converter:gp.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);gp.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?gp.converters.USVString(t):gp.converters.BufferSource(t)};hGn.exports={WebSocketStream:lat}});var AGn=I((Mdf,gGn)=>{"use strict";p();function GLs(t){return t.indexOf("\0")===-1}a(GLs,"isValidLastEventId");function $Ls(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a($Ls,"isASCIINumber");gGn.exports={isValidLastEventId:GLs,isASCIINumber:$Ls}});var vGn=I((Bdf,_Gn)=>{"use strict";p();var{Transform:VLs}=require("node:stream"),{isASCIINumber:yGn,isValidLastEventId:EGn}=AGn(),i8=[239,187,191],Gar=10,uat=13,WLs=58,zLs=32,$ar=class extends VLs{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]===i8[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===i8[0]&&this.buffer[1]===i8[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===i8[0]&&this.buffer[1]===i8[1]&&this.buffer[2]===i8[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===i8[0]&&this.buffer[1]===i8[1]&&this.buffer[2]===i8[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&yGn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&EGn(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}}};_Gn.exports={EventSourceStream:$ar}});var RGn=I((Qdf,wGn)=>{"use strict";p();var{pipeline:YLs}=require("node:stream"),{fetching:KLs}=a2e(),{makeRequest:JLs}=kpe(),{webidl:pv}=$A(),{EventSourceStream:ZLs}=vGn(),{parseMIMEType:XLs}=Ow(),{createFastMessageEvent:eBs}=Xst(),{isNetworkError:CGn}=i2e(),{kEnumerableProperty:rX}=Do(),{environmentSettingsObject:bGn}=vT(),SGn=!1,TGn=3e3,h2e=0,IGn=1,m2e=2,tBs="anonymous",rBs="use-credentials",Qpe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=h2e;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),pv.util.markAsUncloneable(this);let n="EventSource constructor";pv.argumentLengthCheck(arguments,1,n),SGn||(SGn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=pv.converters.USVString(e),r=pv.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=bGn,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=tBs;r.withCredentials===!0&&(c=rBs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=bGn.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=JLs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===m2e)return;this.#n=h2e;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!CGn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(CGn(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?XLs(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=IGn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new ZLs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(eBs(u.type,u.options))},"push")});YLs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=KLs(e)}#u(){this.#n!==m2e&&(this.#n=h2e,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===h2e&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){pv.brandCheck(this,t),this.#n!==m2e&&(this.#n=m2e,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=pv.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=pv.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=pv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},xGn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:h2e,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:IGn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:m2e,writable:!1}};Object.defineProperties(Qpe,xGn);Object.defineProperties(Qpe.prototype,xGn);Object.defineProperties(Qpe.prototype,{close:rX,onerror:rX,onmessage:rX,onopen:rX,readyState:rX,url:rX,withCredentials:rX});pv.converters.EventSourceInitDict=pv.dictionaryConverter([{key:"withCredentials",converter:pv.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:pv.converters.any},{key:"node",converter:pv.dictionaryConverter([{key:"reconnectionTime",converter:pv.converters["unsigned long"],defaultValue:a(()=>TGn,"defaultValue")},{key:"dispatcher",converter:pv.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);wGn.exports={EventSource:Qpe,defaultReconnectionTime:TGn}});var Var=I((Hdf,vn)=>{"use strict";p();var nBs=Wj(),PGn=mPe(),iBs=NZ(),oBs=kUn(),sBs=MUn(),aBs=LZ(),cBs=Lor(),lBs=Dor(),uBs=E7n(),dBs=T7n(),fBs=w7n(),DGn=ao(),fat=Do(),{InvalidArgumentError:dat}=DGn,qpe=lQn(),pBs=CZ(),hBs=vsr(),{MockCallHistory:mBs,MockCallHistoryLog:gBs}=Ssr(),ABs=Nsr(),yBs=wsr(),EBs=cqn(),_Bs=isr(),vBs=cst(),{getGlobalDispatcher:NGn,setGlobalDispatcher:CBs}=bst(),bBs=Tpe(),SBs=qsr();Object.assign(PGn.prototype,qpe);vn.exports.Dispatcher=PGn;vn.exports.Client=nBs;vn.exports.Pool=iBs;vn.exports.BalancedPool=oBs;vn.exports.RoundRobinPool=sBs;vn.exports.Agent=aBs;vn.exports.ProxyAgent=cBs;vn.exports.Socks5ProxyAgent=lBs;vn.exports.EnvHttpProxyAgent=uBs;vn.exports.RetryAgent=dBs;vn.exports.H2CClient=fBs;vn.exports.RetryHandler=vBs;vn.exports.DecoratorHandler=bBs;vn.exports.RedirectHandler=SBs;vn.exports.interceptors={redirect:Eqn(),responseError:vqn(),retry:bqn(),dump:Tqn(),dns:Rqn(),cache:Vqn(),decompress:Jqn(),deduplicate:rjn()};vn.exports.cacheStores={MemoryCacheStore:Ksr()};var TBs=ojn();vn.exports.cacheStores.SqliteCacheStore=TBs;vn.exports.buildConnector=pBs;vn.exports.errors=DGn;vn.exports.util={parseHeaders:fat.parseHeaders,headerNameToString:fat.headerNameToString};function g2e(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 dat("invalid url");if(r!=null&&typeof r!="object")throw new dat("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new dat("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(fat.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=fat.parseURL(e);let{agent:o,dispatcher:s=NGn()}=r;if(o)throw new dat("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(g2e,"makeDispatcher");vn.exports.setGlobalDispatcher=CBs;vn.exports.getGlobalDispatcher=NGn;var IBs=a2e().fetch,kGn=typeof __filename<"u"?__filename:void 0;function MGn(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,MGn),!o.stack)return;let s=o.stack.split(` `).slice(1).join(` `);t.stack=r?`${r} -${s}`:o.stack}a(NGn,"appendFetchStackTrace");vn.exports.fetch=a(function(e,r=void 0){return vBs(e,r).catch(n=>{throw RGn?NGn(n,RGn):n&&typeof n=="object"&&Error.captureStackTrace(n,vn.exports.fetch),n})},"fetch");vn.exports.Headers=zZ().Headers;vn.exports.Response=i2e().Response;vn.exports.Request=kpe().Request;vn.exports.FormData=Dot().FormData;var{setGlobalOrigin:CBs,getGlobalOrigin:bBs}=mir();vn.exports.setGlobalOrigin=CBs;vn.exports.getGlobalOrigin=bBs;var{CacheStorage:SBs}=hHn(),{kConstruct:TBs}=al();vn.exports.caches=new SBs(TBs);var{deleteCookie:IBs,getCookies:xBs,getSetCookies:wBs,setCookie:RBs,parseCookie:kBs}=xHn();vn.exports.deleteCookie=IBs;vn.exports.getCookies=xBs;vn.exports.getSetCookies=wBs;vn.exports.setCookie=RBs;vn.exports.parseCookie=kBs;var{parseMIMEType:PBs,serializeAMimeType:DBs}=Mw();vn.exports.parseMIMEType=PBs;vn.exports.serializeAMimeType=DBs;var{CloseEvent:NBs,ErrorEvent:MBs,MessageEvent:OBs}=Kst(),{WebSocket:LBs,ping:BBs}=sGn();vn.exports.WebSocket=LBs;vn.exports.CloseEvent=NBs;vn.exports.ErrorEvent=MBs;vn.exports.MessageEvent=OBs;vn.exports.ping=BBs;vn.exports.WebSocketStream=hGn().WebSocketStream;vn.exports.WebSocketError=Uar().WebSocketError;vn.exports.request=g2e(qpe.request);vn.exports.stream=g2e(qpe.stream);vn.exports.pipeline=g2e(qpe.pipeline);vn.exports.connect=g2e(qpe.connect);vn.exports.upgrade=g2e(qpe.upgrade);vn.exports.MockClient=lBs;vn.exports.MockCallHistory=uBs;vn.exports.MockCallHistoryLog=dBs;vn.exports.MockPool=pBs;vn.exports.MockAgent=fBs;vn.exports.SnapshotAgent=hBs;vn.exports.mockErrors=mBs;var{EventSource:FBs}=wGn();vn.exports.EventSource=FBs;function UBs(){globalThis.fetch=vn.exports.fetch,globalThis.Headers=vn.exports.Headers,globalThis.Response=vn.exports.Response,globalThis.Request=vn.exports.Request,globalThis.FormData=vn.exports.FormData,globalThis.WebSocket=vn.exports.WebSocket,globalThis.CloseEvent=vn.exports.CloseEvent,globalThis.ErrorEvent=vn.exports.ErrorEvent,globalThis.MessageEvent=vn.exports.MessageEvent,globalThis.EventSource=vn.exports.EventSource}a(UBs,"install");vn.exports.install=UBs});var ZGn,XGn=ve(()=>{p();ZGn=typeof globalThis=="object"?globalThis:global});var e$n=ve(()=>{p();XGn()});var t$n=ve(()=>{p();e$n()});var i8,icr=ve(()=>{p();i8="1.9.0"});function f3s(t){var e=new Set([t]),r=new Set,n=t.match(r$n);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(r$n);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 r$n,n$n,i$n=ve(()=>{p();icr();r$n=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(f3s,"_makeCompatibilityCheck");n$n=f3s(i8)});function G5(t,e,r,n){var o;n===void 0&&(n=!1);var s=E2e[y2e]=(o=E2e[y2e])!==null&&o!==void 0?o:{version:i8};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!==i8){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+i8);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+i8+"."),!0}function RT(t){var e,r,n=(e=E2e[y2e])===null||e===void 0?void 0:e.version;if(!(!n||!n$n(n)))return(r=E2e[y2e])===null||r===void 0?void 0:r[t]}function $5(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+i8+".");var r=E2e[y2e];r&&delete r[t]}var p3s,y2e,E2e,iX=ve(()=>{p();t$n();icr();i$n();p3s=i8.split(".")[0],y2e=Symbol.for("opentelemetry.js.api."+p3s),E2e=ZGn;a(G5,"registerGlobal");a(RT,"getGlobal");a($5,"unregisterGlobal")});function _2e(t,e,r){var n=RT("diag");if(n)return r.unshift(e),n[t].apply(n,m3s([],h3s(r),!1))}var h3s,m3s,o$n,s$n=ve(()=>{p();iX();h3s=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},m3s=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"})(Da||(Da={}))});function a$n(t,e){tDa.ALL&&(t=Da.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",Da.ERROR),warn:r("warn",Da.WARN),info:r("info",Da.INFO),debug:r("debug",Da.DEBUG),verbose:r("verbose",Da.VERBOSE)}}var c$n=ve(()=>{p();Aat();a(a$n,"createLogLevelDiagLogger")});var g3s,A3s,y3s,SE,oX=ve(()=>{p();s$n();c$n();Aat();iX();g3s=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},A3s=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 G5("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){$5(y3s,r)},r.createComponentLogger=function(o){return new o$n(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 E3s,_3s,l$n,u$n=ve(()=>{p();E3s=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},_3s=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.")},l$n=(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=E3s(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();d$n=Symbol("BaggageEntryMetadata")});function p$n(t){return t===void 0&&(t={}),new l$n(new Map(Object.entries(t)))}function Hpe(t){return typeof t!="string"&&(v3s.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:d$n,toString:a(function(){return t},"toString")}}var v3s,ocr=ve(()=>{p();oX();u$n();f$n();v3s=SE.instance();a(p$n,"createBaggage");a(Hpe,"baggageEntryMetadataFromString")});function _b(t){return Symbol.for(t)}var C3s,yat,v2e=ve(()=>{p();a(_b,"createContextKey");C3s=(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})(),yat=new C3s});var scr,h$n,m$n=ve(()=>{p();scr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],h$n=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();sX=(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)}})(),b3s=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return D3s},t.prototype.createHistogram=function(e,r){return N3s},t.prototype.createCounter=function(e,r){return P3s},t.prototype.createUpDownCounter=function(e,r){return M3s},t.prototype.createObservableGauge=function(e,r){return L3s},t.prototype.createObservableCounter=function(e,r){return O3s},t.prototype.createObservableUpDownCounter=function(e,r){return B3s},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),Eat=(function(){function t(){}return a(t,"NoopMetric"),t})(),S3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(Eat),T3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(Eat),I3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(Eat),x3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(Eat),acr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),w3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(acr),R3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(acr),k3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(acr),ccr=new b3s,P3s=new S3s,D3s=new I3s,N3s=new x3s,M3s=new T3s,O3s=new w3s,L3s=new R3s,B3s=new k3s;a(g$n,"createNoopMeter")});var _at,A$n=ve(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(_at||(_at={}))});var vat,Cat,ucr=ve(()=>{p();vat={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},Cat={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var F3s,U3s,y$n,E$n=ve(()=>{p();v2e();F3s=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},U3s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();E$n();iX();oX();Q3s=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},q3s=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"})(wf||(wf={}))});var b2e,S2e,Gpe,bat=ve(()=>{p();fcr();b2e="0000000000000000",S2e="00000000000000000000000000000000",Gpe={traceId:S2e,spanId:b2e,traceFlags:wf.NONE}});var aH,Sat=ve(()=>{p();bat();aH=(function(){function t(e){e===void 0&&(e=Gpe),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 Tat(t){return t.getValue(pcr)||void 0}function _$n(){return Tat(sH.getInstance().active())}function T2e(t,e){return t.setValue(pcr,e)}function v$n(t){return t.deleteValue(pcr)}function C$n(t,e){return T2e(t,new aH(e))}function Iat(t){var e;return(e=Tat(t))===null||e===void 0?void 0:e.spanContext()}var pcr,hcr=ve(()=>{p();v2e();Sat();C2e();pcr=_b("OpenTelemetry Context Key SPAN");a(Tat,"getSpan");a(_$n,"getActiveSpan");a(T2e,"setSpan");a(v$n,"deleteSpan");a(C$n,"setSpanContext");a(Iat,"getSpanContext")});function aX(t){return H3s.test(t)&&t!==S2e}function mcr(t){return G3s.test(t)&&t!==b2e}function vb(t){return aX(t.traceId)&&mcr(t.spanId)}function b$n(t){return new aH(t)}var H3s,G3s,xat=ve(()=>{p();bat();Sat();H3s=/^([0-9a-f]{32})$/i,G3s=/^[0-9a-f]{16}$/i;a(aX,"isValidTraceId");a(mcr,"isValidSpanId");a(vb,"isSpanContextValid");a(b$n,"wrapSpanContext")});function $3s(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var gcr,wat,Acr=ve(()=>{p();C2e();hcr();Sat();xat();gcr=sH.getInstance(),wat=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=gcr.active());var o=!!r?.root;if(o)return new aH;var s=n&&Iat(n);return $3s(s)&&vb(s)?new aH(s):new aH},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??gcr.active(),d=this.startSpan(e,s,u),f=T2e(u,d);return gcr.with(f,l,void 0,d)}},t})();a($3s,"isSpanContext")});var V3s,Rat,ycr=ve(()=>{p();Acr();V3s=new wat,Rat=(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):V3s},t})()});var S$n,T$n=ve(()=>{p();Acr();S$n=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new wat},t})()});var W3s,I2e,Ecr=ve(()=>{p();ycr();T$n();W3s=new S$n,I2e=(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 Rat(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:W3s},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 Cb,I$n=ve(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Cb||(Cb={}))});var $pe,x$n=ve(()=>{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"})($pe||($pe={}))});var Vpe,w$n=ve(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Vpe||(Vpe={}))});function R$n(t){return K3s.test(t)}function k$n(t){return J3s.test(t)&&!Z3s.test(t)}var _cr,z3s,Y3s,K3s,J3s,Z3s,P$n=ve(()=>{p();_cr="[_0-9a-z-*/]",z3s="[a-z]"+_cr+"{0,255}",Y3s="[a-z0-9]"+_cr+"{0,240}@[a-z]"+_cr+"{0,13}",K3s=new RegExp("^(?:"+z3s+"|"+Y3s+")$"),J3s=/^[ -~]{0,255}[!-~]$/,Z3s=/,|=/;a(R$n,"validateKey");a(k$n,"validateValue")});var D$n,X3s,N$n,M$n,O$n,L$n=ve(()=>{p();P$n();D$n=32,X3s=512,N$n=",",M$n="=",O$n=(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+M$n+e.get(n)),r},[]).join(N$n)},t.prototype._parse=function(e){e.length>X3s||(this._internalState=e.split(N$n).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(M$n);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);R$n(c)&&k$n(l)&&r.set(c,l)}return r},new Map),this._internalState.size>D$n&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,D$n))))},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 B$n(t){return new O$n(t)}var F$n=ve(()=>{p();L$n();a(B$n,"createTraceState")});var Og,U$n=ve(()=>{p();C2e();Og=sH.getInstance()});var Dn,Q$n=ve(()=>{p();oX();Dn=SE.instance()});var eFs,q$n,j$n=ve(()=>{p();lcr();eFs=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return ccr},t})(),q$n=new eFs});var vcr,H$n,G$n=ve(()=>{p();j$n();iX();oX();vcr="metrics",H$n=(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 G5(vcr,e,SE.instance())},t.prototype.getMeterProvider=function(){return RT(vcr)||q$n},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){$5(vcr,SE.instance())},t})()});var cX,$$n=ve(()=>{p();G$n();cX=H$n.getInstance()});var V$n,W$n=ve(()=>{p();V$n=(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 bcr(t){return t.getValue(Ccr)||void 0}function z$n(){return bcr(sH.getInstance().active())}function Y$n(t,e){return t.setValue(Ccr,e)}function K$n(t){return t.deleteValue(Ccr)}var Ccr,J$n=ve(()=>{p();C2e();v2e();Ccr=_b("OpenTelemetry Baggage Key");a(bcr,"getBaggage");a(z$n,"getActiveBaggage");a(Y$n,"setBaggage");a(K$n,"deleteBaggage")});var Scr,tFs,Z$n,X$n=ve(()=>{p();iX();W$n();ucr();J$n();ocr();oX();Scr="propagation",tFs=new V$n,Z$n=(function(){function t(){this.createBaggage=p$n,this.getBaggage=bcr,this.getActiveBaggage=z$n,this.setBaggage=Y$n,this.deleteBaggage=K$n}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return G5(Scr,e,SE.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Cat),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=vat),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){$5(Scr,SE.instance())},t.prototype._getGlobalPropagator=function(){return RT(Scr)||tFs},t})()});var kT,eVn=ve(()=>{p();X$n();kT=Z$n.getInstance()});var Tcr,tVn,rVn=ve(()=>{p();iX();Ecr();xat();hcr();oX();Tcr="trace",tVn=(function(){function t(){this._proxyTracerProvider=new I2e,this.wrapSpanContext=b$n,this.isSpanContextValid=vb,this.deleteSpan=v$n,this.getSpan=Tat,this.getActiveSpan=_$n,this.getSpanContext=Iat,this.setSpan=T2e,this.setSpanContext=C$n}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=G5(Tcr,this._proxyTracerProvider,SE.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return RT(Tcr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){$5(Tcr,SE.instance()),this._proxyTracerProvider=new I2e},t})()});var wu,nVn=ve(()=>{p();rVn();wu=tVn.getInstance()});var V5={};ki(V5,{DiagConsoleLogger:()=>h$n,DiagLogLevel:()=>Da,INVALID_SPANID:()=>b2e,INVALID_SPAN_CONTEXT:()=>Gpe,INVALID_TRACEID:()=>S2e,ProxyTracer:()=>Rat,ProxyTracerProvider:()=>I2e,ROOT_CONTEXT:()=>yat,SamplingDecision:()=>Cb,SpanKind:()=>$pe,SpanStatusCode:()=>Vpe,TraceFlags:()=>wf,ValueType:()=>_at,baggageEntryMetadataFromString:()=>Hpe,context:()=>Og,createContextKey:()=>_b,createNoopMeter:()=>g$n,createTraceState:()=>B$n,default:()=>rFs,defaultTextMapGetter:()=>vat,defaultTextMapSetter:()=>Cat,diag:()=>Dn,isSpanContextValid:()=>vb,isValidSpanId:()=>mcr,isValidTraceId:()=>aX,metrics:()=>cX,propagation:()=>kT,trace:()=>wu});var rFs,co=ve(()=>{p();ocr();v2e();m$n();Aat();lcr();A$n();ucr();ycr();Ecr();I$n();x$n();w$n();fcr();F$n();xat();bat();U$n();Q$n();$$n();eVn();nVn();rFs={context:Og,diag:Dn,metrics:cX,propagation:kT,trace:wu}});var eDe=I(cc=>{"use strict";p();Object.defineProperty(cc,"__esModule",{value:!0});cc.regexpCode=cc.getEsmExportName=cc.getProperty=cc.safeStringify=cc.stringify=cc.strConcat=cc.addCodeArg=cc.str=cc._=cc.nil=cc._Code=cc.Name=cc.IDENTIFIER=cc._CodeOrName=void 0;var Z2e=class{static{a(this,"_CodeOrName")}};cc._CodeOrName=Z2e;cc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var AX=class extends Z2e{static{a(this,"Name")}constructor(e){if(super(),!cc.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}}};cc.Name=AX;var Ww=class extends Z2e{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 AX&&(r[n.str]=(r[n.str]||0)+1),r),{})}};cc._Code=Ww;cc.nil=new Ww("");function qVn(t,...e){let r=[t[0]],n=0;for(;n{"use strict";p();Object.defineProperty(Sb,"__esModule",{value:!0});Sb.ValueScope=Sb.ValueScopeName=Sb.Scope=Sb.varKinds=Sb.UsedValueState=void 0;var bb=eDe(),alr=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Vat;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Vat||(Sb.UsedValueState=Vat={}));Sb.varKinds={const:new bb.Name("const"),let:new bb.Name("let"),var:new bb.Name("var")};var Wat=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof bb.Name?e:this.name(e)}name(e){return new bb.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}}};Sb.Scope=Wat;var zat=class extends bb.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,bb._)`.${new bb.Name(r)}[${n}]`}};Sb.ValueScopeName=zat;var f6s=(0,bb._)`\n`,clr=class extends Wat{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?f6s:bb.nil}}get(){return this._scope}name(e){return new zat(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,bb._)`${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=bb.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,Vat.Started);let f=r(d);if(f){let h=this.opts.es5?Sb.varKinds.var:Sb.varKinds.const;s=(0,bb._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,bb._)`${s}${f}${this.opts._n}`;else throw new alr(d);u.set(d,Vat.Completed)})}return s}};Sb.ValueScope=clr});var Es=I(Ps=>{"use strict";p();Object.defineProperty(Ps,"__esModule",{value:!0});Ps.or=Ps.and=Ps.not=Ps.CodeGen=Ps.operators=Ps.varKinds=Ps.ValueScopeName=Ps.ValueScope=Ps.Scope=Ps.Name=Ps.regexpCode=Ps.stringify=Ps.getProperty=Ps.nil=Ps.strConcat=Ps.str=Ps._=void 0;var Na=eDe(),D2=llr(),fH=eDe();Object.defineProperty(Ps,"_",{enumerable:!0,get:a(function(){return fH._},"get")});Object.defineProperty(Ps,"str",{enumerable:!0,get:a(function(){return fH.str},"get")});Object.defineProperty(Ps,"strConcat",{enumerable:!0,get:a(function(){return fH.strConcat},"get")});Object.defineProperty(Ps,"nil",{enumerable:!0,get:a(function(){return fH.nil},"get")});Object.defineProperty(Ps,"getProperty",{enumerable:!0,get:a(function(){return fH.getProperty},"get")});Object.defineProperty(Ps,"stringify",{enumerable:!0,get:a(function(){return fH.stringify},"get")});Object.defineProperty(Ps,"regexpCode",{enumerable:!0,get:a(function(){return fH.regexpCode},"get")});Object.defineProperty(Ps,"Name",{enumerable:!0,get:a(function(){return fH.Name},"get")});var Zat=llr();Object.defineProperty(Ps,"Scope",{enumerable:!0,get:a(function(){return Zat.Scope},"get")});Object.defineProperty(Ps,"ValueScope",{enumerable:!0,get:a(function(){return Zat.ValueScope},"get")});Object.defineProperty(Ps,"ValueScopeName",{enumerable:!0,get:a(function(){return Zat.ValueScopeName},"get")});Object.defineProperty(Ps,"varKinds",{enumerable:!0,get:a(function(){return Zat.varKinds},"get")});Ps.operators={GT:new Na._Code(">"),GTE:new Na._Code(">="),LT:new Na._Code("<"),LTE:new Na._Code("<="),EQ:new Na._Code("==="),NEQ:new Na._Code("!=="),NOT:new Na._Code("!"),OR:new Na._Code("||"),AND:new Na._Code("&&"),ADD:new Na._Code("+")};var d8=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},ulr=class extends d8{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?D2.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=Zpe(this.rhs,e,r)),this}get names(){return this.rhs instanceof Na._CodeOrName?this.rhs.names:{}}},Yat=class extends d8{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 Na.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Zpe(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Na.Name?{}:{...this.lhs.names};return Jat(e,this.rhs)}},dlr=class extends Yat{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}},flr=class extends d8{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},plr=class extends d8{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},hlr=class extends d8{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},mlr=class extends d8{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=Zpe(this.code,e,r),this}get names(){return this.code instanceof Na._CodeOrName?this.code.names:{}}},tDe=class extends d8{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)||(p6s(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>_X(e,r.names),{})}},f8=class extends tDe{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},glr=class extends tDe{static{a(this,"Root")}},Jpe=class extends f8{static{a(this,"Else")}};Jpe.kind="else";var yX=class t extends f8{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 Jpe(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(HVn(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=Zpe(this.condition,e,r),this}get names(){let e=super.names;return Jat(e,this.condition),this.else&&_X(e,this.else.names),e}};yX.kind="if";var EX=class extends f8{static{a(this,"For")}};EX.kind="for";var Alr=class extends EX{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=Zpe(this.iteration,e,r),this}get names(){return _X(super.names,this.iteration.names)}},ylr=class extends EX{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?D2.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=Jat(super.names,this.from);return Jat(e,this.to)}},Kat=class extends EX{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=Zpe(this.iterable,e,r),this}get names(){return _X(super.names,this.iterable.names)}},rDe=class extends f8{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)}};rDe.kind="func";var nDe=class extends tDe{static{a(this,"Return")}render(e){return"return "+super.render(e)}};nDe.kind="return";var Elr=class extends f8{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&&_X(e,this.catch.names),this.finally&&_X(e,this.finally.names),e}},iDe=class extends f8{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};iDe.kind="catch";var oDe=class extends f8{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};oDe.kind="finally";var _lr=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 D2.Scope({parent:e}),this._nodes=[new glr]}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 ulr(e,s,n)),s}const(e,r,n){return this._def(D2.varKinds.const,e,r,n)}let(e,r,n){return this._def(D2.varKinds.let,e,r,n)}var(e,r,n){return this._def(D2.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Yat(e,r,n))}add(e,r){return this._leafNode(new dlr(e,Ps.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Na.nil&&this._leafNode(new mlr(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,Na.addCodeArg)(r,o));return r.push("}"),new Na._Code(r)}if(e,r,n){if(this._blockNode(new yX(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 yX(e))}else(){return this._elseNode(new Jpe)}endIf(){return this._endBlockNode(yX,Jpe)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Alr(e),r)}forRange(e,r,n,o,s=this.opts.es5?D2.varKinds.var:D2.varKinds.let){let c=this._scope.toName(e);return this._for(new ylr(s,c,r,n),()=>o(c))}forOf(e,r,n,o=D2.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Na.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Na._)`${c}.length`,l=>{this.var(s,(0,Na._)`${c}[${l}]`),n(s)})}return this._for(new Kat("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?D2.varKinds.var:D2.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Na._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Kat("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(EX)}label(e){return this._leafNode(new flr(e))}break(e){return this._leafNode(new plr(e))}return(e){let r=new nDe;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(nDe)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Elr;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new iDe(s),r(s)}return n&&(this._currNode=o.finally=new oDe,this.code(n)),this._endBlockNode(iDe,oDe)}throw(e){return this._leafNode(new hlr(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=Na.nil,n,o){return this._blockNode(new rDe(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(rDe)}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 yX))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}};Ps.CodeGen=_lr;function _X(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(_X,"addNames");function Jat(t,e){return e instanceof Na._CodeOrName?_X(t,e.names):t}a(Jat,"addExprNames");function Zpe(t,e,r){if(t instanceof Na.Name)return n(t);if(!o(t))return t;return new Na._Code(t._items.reduce((s,c)=>(c instanceof Na.Name&&(c=n(c)),c instanceof Na._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 Na._Code&&s._items.some(c=>c instanceof Na.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a(Zpe,"optimizeExpr");function p6s(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(p6s,"subtractNames");function HVn(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Na._)`!${vlr(t)}`}a(HVn,"not");Ps.not=HVn;var h6s=GVn(Ps.operators.AND);function m6s(...t){return t.reduce(h6s)}a(m6s,"and");Ps.and=m6s;var g6s=GVn(Ps.operators.OR);function A6s(...t){return t.reduce(g6s)}a(A6s,"or");Ps.or=A6s;function GVn(t){return(e,r)=>e===Na.nil?r:r===Na.nil?e:(0,Na._)`${vlr(e)} ${t} ${vlr(r)}`}a(GVn,"mappend");function vlr(t){return t instanceof Na.Name?t:(0,Na._)`(${t})`}a(vlr,"par")});var Ka=I(js=>{"use strict";p();Object.defineProperty(js,"__esModule",{value:!0});js.checkStrictMode=js.getErrorPath=js.Type=js.useFunc=js.setEvaluated=js.evaluatedPropsToName=js.mergeEvaluated=js.eachItem=js.unescapeJsonPointer=js.escapeJsonPointer=js.escapeFragment=js.unescapeFragment=js.schemaRefOrVal=js.schemaHasRulesButRef=js.schemaHasRules=js.checkUnknownRules=js.alwaysValidSchema=js.toHash=void 0;var Yl=Es(),y6s=eDe();function E6s(t){let e={};for(let r of t)e[r]=!0;return e}a(E6s,"toHash");js.toHash=E6s;function _6s(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(WVn(t,e),!zVn(e,t.self.RULES.all))}a(_6s,"alwaysValidSchema");js.alwaysValidSchema=_6s;function WVn(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]||JVn(t,`unknown keyword: "${s}"`)}a(WVn,"checkUnknownRules");js.checkUnknownRules=WVn;function zVn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(zVn,"schemaHasRules");js.schemaHasRules=zVn;function v6s(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(v6s,"schemaHasRulesButRef");js.schemaHasRulesButRef=v6s;function C6s({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Yl._)`${r}`}return(0,Yl._)`${t}${e}${(0,Yl.getProperty)(n)}`}a(C6s,"schemaRefOrVal");js.schemaRefOrVal=C6s;function b6s(t){return YVn(decodeURIComponent(t))}a(b6s,"unescapeFragment");js.unescapeFragment=b6s;function S6s(t){return encodeURIComponent(blr(t))}a(S6s,"escapeFragment");js.escapeFragment=S6s;function blr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(blr,"escapeJsonPointer");js.escapeJsonPointer=blr;function YVn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(YVn,"unescapeJsonPointer");js.unescapeJsonPointer=YVn;function T6s(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(T6s,"eachItem");js.eachItem=T6s;function $Vn({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof Yl.Name?(s instanceof Yl.Name?t(o,s,c):e(o,s,c),c):s instanceof Yl.Name?(e(o,c,s),s):r(s,c);return l===Yl.Name&&!(u instanceof Yl.Name)?n(o,u):u}}a($Vn,"makeMergeEvaluated");js.mergeEvaluated={props:$Vn({mergeNames:a((t,e,r)=>t.if((0,Yl._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Yl._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Yl._)`${r} || {}`).code((0,Yl._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Yl._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Yl._)`${r} || {}`),Slr(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:KVn}),items:$Vn({mergeNames:a((t,e,r)=>t.if((0,Yl._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Yl._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Yl._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Yl._)`${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 KVn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Yl._)`{}`);return e!==void 0&&Slr(t,r,e),r}a(KVn,"evaluatedPropsToName");js.evaluatedPropsToName=KVn;function Slr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Yl._)`${e}${(0,Yl.getProperty)(n)}`,!0))}a(Slr,"setEvaluated");js.setEvaluated=Slr;var VVn={};function I6s(t,e){return t.scopeValue("func",{ref:e,code:VVn[e.code]||(VVn[e.code]=new y6s._Code(e.code))})}a(I6s,"useFunc");js.useFunc=I6s;var Clr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Clr||(js.Type=Clr={}));function x6s(t,e,r){if(t instanceof Yl.Name){let n=e===Clr.Num;return r?n?(0,Yl._)`"[" + ${t} + "]"`:(0,Yl._)`"['" + ${t} + "']"`:n?(0,Yl._)`"/" + ${t}`:(0,Yl._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Yl.getProperty)(t).toString():"/"+blr(t)}a(x6s,"getErrorPath");js.getErrorPath=x6s;function JVn(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(JVn,"checkStrictMode");js.checkStrictMode=JVn});var p8=I(Tlr=>{"use strict";p();Object.defineProperty(Tlr,"__esModule",{value:!0});var TE=Es(),w6s={data:new TE.Name("data"),valCxt:new TE.Name("valCxt"),instancePath:new TE.Name("instancePath"),parentData:new TE.Name("parentData"),parentDataProperty:new TE.Name("parentDataProperty"),rootData:new TE.Name("rootData"),dynamicAnchors:new TE.Name("dynamicAnchors"),vErrors:new TE.Name("vErrors"),errors:new TE.Name("errors"),this:new TE.Name("this"),self:new TE.Name("self"),scope:new TE.Name("scope"),json:new TE.Name("json"),jsonPos:new TE.Name("jsonPos"),jsonLen:new TE.Name("jsonLen"),jsonPart:new TE.Name("jsonPart")};Tlr.default=w6s});var sDe=I(IE=>{"use strict";p();Object.defineProperty(IE,"__esModule",{value:!0});IE.extendErrors=IE.resetErrorsCount=IE.reportExtraError=IE.reportError=IE.keyword$DataError=IE.keywordError=void 0;var Ja=Es(),Xat=Ka(),hv=p8();IE.keywordError={message:a(({keyword:t})=>(0,Ja.str)`must pass "${t}" keyword validation`,"message")};IE.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,Ja.str)`"${t}" keyword must be ${e} ($data)`:(0,Ja.str)`"${t}" keyword is invalid ($data)`,"message")};function R6s(t,e=IE.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=eWn(t,e,r);n??(c||l)?ZVn(s,u):XVn(o,(0,Ja._)`[${u}]`)}a(R6s,"reportError");IE.reportError=R6s;function k6s(t,e=IE.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=eWn(t,e,r);ZVn(o,l),s||c||XVn(n,hv.default.vErrors)}a(k6s,"reportExtraError");IE.reportExtraError=k6s;function P6s(t,e){t.assign(hv.default.errors,e),t.if((0,Ja._)`${hv.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ja._)`${hv.default.vErrors}.length`,e),()=>t.assign(hv.default.vErrors,null)))}a(P6s,"resetErrorsCount");IE.resetErrorsCount=P6s;function D6s({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,hv.default.errors,l=>{t.const(c,(0,Ja._)`${hv.default.vErrors}[${l}]`),t.if((0,Ja._)`${c}.instancePath === undefined`,()=>t.assign((0,Ja._)`${c}.instancePath`,(0,Ja.strConcat)(hv.default.instancePath,s.errorPath))),t.assign((0,Ja._)`${c}.schemaPath`,(0,Ja.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Ja._)`${c}.schema`,r),t.assign((0,Ja._)`${c}.data`,n))})}a(D6s,"extendErrors");IE.extendErrors=D6s;function ZVn(t,e){let r=t.const("err",e);t.if((0,Ja._)`${hv.default.vErrors} === null`,()=>t.assign(hv.default.vErrors,(0,Ja._)`[${r}]`),(0,Ja._)`${hv.default.vErrors}.push(${r})`),t.code((0,Ja._)`${hv.default.errors}++`)}a(ZVn,"addError");function XVn(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,Ja._)`new ${t.ValidationError}(${e})`):(r.assign((0,Ja._)`${n}.errors`,e),r.return(!1))}a(XVn,"returnErrors");var vX={keyword:new Ja.Name("keyword"),schemaPath:new Ja.Name("schemaPath"),params:new Ja.Name("params"),propertyName:new Ja.Name("propertyName"),message:new Ja.Name("message"),schema:new Ja.Name("schema"),parentSchema:new Ja.Name("parentSchema")};function eWn(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Ja._)`{}`:N6s(t,e,r)}a(eWn,"errorObjectCode");function N6s(t,e,r={}){let{gen:n,it:o}=t,s=[M6s(o,r),O6s(t,r)];return L6s(t,e,s),n.object(...s)}a(N6s,"errorObject");function M6s({errorPath:t},{instancePath:e}){let r=e?(0,Ja.str)`${t}${(0,Xat.getErrorPath)(e,Xat.Type.Str)}`:t;return[hv.default.instancePath,(0,Ja.strConcat)(hv.default.instancePath,r)]}a(M6s,"errorInstancePath");function O6s({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,Ja.str)`${e}/${t}`;return r&&(o=(0,Ja.str)`${o}${(0,Xat.getErrorPath)(r,Xat.Type.Str)}`),[vX.schemaPath,o]}a(O6s,"errorSchemaPath");function L6s(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([vX.keyword,o],[vX.params,typeof e=="function"?e(t):e||(0,Ja._)`{}`]),u.messages&&n.push([vX.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([vX.schema,c],[vX.parentSchema,(0,Ja._)`${f}${h}`],[hv.default.data,s]),d&&n.push([vX.propertyName,d])}a(L6s,"extraErrorProps")});var rWn=I(Xpe=>{"use strict";p();Object.defineProperty(Xpe,"__esModule",{value:!0});Xpe.boolOrEmptySchema=Xpe.topBoolOrEmptySchema=void 0;var B6s=sDe(),F6s=Es(),U6s=p8(),Q6s={message:"boolean schema is false"};function q6s(t){let{gen:e,schema:r,validateName:n}=t;r===!1?tWn(t,!1):typeof r=="object"&&r.$async===!0?e.return(U6s.default.data):(e.assign((0,F6s._)`${n}.errors`,null),e.return(!0))}a(q6s,"topBoolOrEmptySchema");Xpe.topBoolOrEmptySchema=q6s;function j6s(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),tWn(t)):r.var(e,!0)}a(j6s,"boolOrEmptySchema");Xpe.boolOrEmptySchema=j6s;function tWn(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,B6s.reportError)(o,Q6s,void 0,e)}a(tWn,"falseSchemaError")});var Ilr=I(ehe=>{"use strict";p();Object.defineProperty(ehe,"__esModule",{value:!0});ehe.getRules=ehe.isJSONType=void 0;var H6s=["string","number","integer","boolean","null","object","array"],G6s=new Set(H6s);function $6s(t){return typeof t=="string"&&G6s.has(t)}a($6s,"isJSONType");ehe.isJSONType=$6s;function V6s(){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(V6s,"getRules");ehe.getRules=V6s});var xlr=I(pH=>{"use strict";p();Object.defineProperty(pH,"__esModule",{value:!0});pH.shouldUseRule=pH.shouldUseGroup=pH.schemaHasRulesForType=void 0;function W6s({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&nWn(t,n)}a(W6s,"schemaHasRulesForType");pH.schemaHasRulesForType=W6s;function nWn(t,e){return e.rules.some(r=>iWn(t,r))}a(nWn,"shouldUseGroup");pH.shouldUseGroup=nWn;function iWn(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(iWn,"shouldUseRule");pH.shouldUseRule=iWn});var aDe=I(xE=>{"use strict";p();Object.defineProperty(xE,"__esModule",{value:!0});xE.reportTypeError=xE.checkDataTypes=xE.checkDataType=xE.coerceAndCheckDataType=xE.getJSONTypes=xE.getSchemaTypes=xE.DataType=void 0;var z6s=Ilr(),Y6s=xlr(),K6s=sDe(),cs=Es(),oWn=Ka(),the;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(the||(xE.DataType=the={}));function J6s(t){let e=sWn(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(J6s,"getSchemaTypes");xE.getSchemaTypes=J6s;function sWn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(z6s.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(sWn,"getJSONTypes");xE.getJSONTypes=sWn;function Z6s(t,e){let{gen:r,data:n,opts:o}=t,s=X6s(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,Y6s.schemaHasRulesForType)(t,e[0]));if(c){let l=Rlr(e,n,o.strictNumbers,the.Wrong);r.if(l,()=>{s.length?e9s(t,e,s):klr(t)})}return c}a(Z6s,"coerceAndCheckDataType");xE.coerceAndCheckDataType=Z6s;var aWn=new Set(["string","number","integer","boolean","null"]);function X6s(t,e){return e?t.filter(r=>aWn.has(r)||e==="array"&&r==="array"):[]}a(X6s,"coerceToTypes");function e9s(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,cs._)`typeof ${o}`),l=n.let("coerced",(0,cs._)`undefined`);s.coerceTypes==="array"&&n.if((0,cs._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,cs._)`${o}[0]`).assign(c,(0,cs._)`typeof ${o}`).if(Rlr(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,cs._)`${l} !== undefined`);for(let d of r)(aWn.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),klr(t),n.endIf(),n.if((0,cs._)`${l} !== undefined`,()=>{n.assign(o,l),t9s(t,l)});function u(d){switch(d){case"string":n.elseIf((0,cs._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,cs._)`"" + ${o}`).elseIf((0,cs._)`${o} === null`).assign(l,(0,cs._)`""`);return;case"number":n.elseIf((0,cs._)`${c} == "boolean" || ${o} === null +${s}`:o.stack}a(MGn,"appendFetchStackTrace");vn.exports.fetch=a(function(e,r=void 0){return IBs(e,r).catch(n=>{throw kGn?MGn(n,kGn):n&&typeof n=="object"&&Error.captureStackTrace(n,vn.exports.fetch),n})},"fetch");vn.exports.Headers=zZ().Headers;vn.exports.Response=i2e().Response;vn.exports.Request=kpe().Request;vn.exports.FormData=Oot().FormData;var{setGlobalOrigin:xBs,getGlobalOrigin:wBs}=gir();vn.exports.setGlobalOrigin=xBs;vn.exports.getGlobalOrigin=wBs;var{CacheStorage:RBs}=mHn(),{kConstruct:kBs}=al();vn.exports.caches=new RBs(kBs);var{deleteCookie:PBs,getCookies:DBs,getSetCookies:NBs,setCookie:MBs,parseCookie:OBs}=wHn();vn.exports.deleteCookie=PBs;vn.exports.getCookies=DBs;vn.exports.getSetCookies=NBs;vn.exports.setCookie=MBs;vn.exports.parseCookie=OBs;var{parseMIMEType:LBs,serializeAMimeType:BBs}=Ow();vn.exports.parseMIMEType=LBs;vn.exports.serializeAMimeType=BBs;var{CloseEvent:FBs,ErrorEvent:UBs,MessageEvent:QBs}=Xst(),{WebSocket:qBs,ping:jBs}=aGn();vn.exports.WebSocket=qBs;vn.exports.CloseEvent=FBs;vn.exports.ErrorEvent=UBs;vn.exports.MessageEvent=QBs;vn.exports.ping=jBs;vn.exports.WebSocketStream=mGn().WebSocketStream;vn.exports.WebSocketError=Qar().WebSocketError;vn.exports.request=g2e(qpe.request);vn.exports.stream=g2e(qpe.stream);vn.exports.pipeline=g2e(qpe.pipeline);vn.exports.connect=g2e(qpe.connect);vn.exports.upgrade=g2e(qpe.upgrade);vn.exports.MockClient=hBs;vn.exports.MockCallHistory=mBs;vn.exports.MockCallHistoryLog=gBs;vn.exports.MockPool=yBs;vn.exports.MockAgent=ABs;vn.exports.SnapshotAgent=EBs;vn.exports.mockErrors=_Bs;var{EventSource:HBs}=RGn();vn.exports.EventSource=HBs;function GBs(){globalThis.fetch=vn.exports.fetch,globalThis.Headers=vn.exports.Headers,globalThis.Response=vn.exports.Response,globalThis.Request=vn.exports.Request,globalThis.FormData=vn.exports.FormData,globalThis.WebSocket=vn.exports.WebSocket,globalThis.CloseEvent=vn.exports.CloseEvent,globalThis.ErrorEvent=vn.exports.ErrorEvent,globalThis.MessageEvent=vn.exports.MessageEvent,globalThis.EventSource=vn.exports.EventSource}a(GBs,"install");vn.exports.install=GBs});var XGn,e$n=ve(()=>{p();XGn=typeof globalThis=="object"?globalThis:global});var t$n=ve(()=>{p();e$n()});var r$n=ve(()=>{p();t$n()});var o8,ocr=ve(()=>{p();o8="1.9.0"});function A3s(t){var e=new Set([t]),r=new Set,n=t.match(n$n);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(n$n);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 n$n,i$n,o$n=ve(()=>{p();ocr();n$n=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(A3s,"_makeCompatibilityCheck");i$n=A3s(o8)});function G5(t,e,r,n){var o;n===void 0&&(n=!1);var s=E2e[y2e]=(o=E2e[y2e])!==null&&o!==void 0?o:{version:o8};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!==o8){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+o8);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+o8+"."),!0}function PT(t){var e,r,n=(e=E2e[y2e])===null||e===void 0?void 0:e.version;if(!(!n||!i$n(n)))return(r=E2e[y2e])===null||r===void 0?void 0:r[t]}function $5(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+o8+".");var r=E2e[y2e];r&&delete r[t]}var y3s,y2e,E2e,iX=ve(()=>{p();r$n();ocr();o$n();y3s=o8.split(".")[0],y2e=Symbol.for("opentelemetry.js.api."+y3s),E2e=XGn;a(G5,"registerGlobal");a(PT,"getGlobal");a($5,"unregisterGlobal")});function _2e(t,e,r){var n=PT("diag");if(n)return r.unshift(e),n[t].apply(n,_3s([],E3s(r),!1))}var E3s,_3s,s$n,a$n=ve(()=>{p();iX();E3s=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},_3s=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"})(Pa||(Pa={}))});function c$n(t,e){tPa.ALL&&(t=Pa.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",Pa.ERROR),warn:r("warn",Pa.WARN),info:r("info",Pa.INFO),debug:r("debug",Pa.DEBUG),verbose:r("verbose",Pa.VERBOSE)}}var l$n=ve(()=>{p();_at();a(c$n,"createLogLevelDiagLogger")});var v3s,C3s,b3s,SE,oX=ve(()=>{p();a$n();l$n();_at();iX();v3s=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},C3s=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 G5("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){$5(b3s,r)},r.createComponentLogger=function(o){return new s$n(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 S3s,T3s,u$n,d$n=ve(()=>{p();S3s=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},T3s=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.")},u$n=(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=S3s(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();f$n=Symbol("BaggageEntryMetadata")});function h$n(t){return t===void 0&&(t={}),new u$n(new Map(Object.entries(t)))}function Hpe(t){return typeof t!="string"&&(I3s.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:f$n,toString:a(function(){return t},"toString")}}var I3s,scr=ve(()=>{p();oX();d$n();p$n();I3s=SE.instance();a(h$n,"createBaggage");a(Hpe,"baggageEntryMetadataFromString")});function _b(t){return Symbol.for(t)}var x3s,vat,v2e=ve(()=>{p();a(_b,"createContextKey");x3s=(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})(),vat=new x3s});var acr,m$n,g$n=ve(()=>{p();acr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],m$n=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();sX=(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)}})(),w3s=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return B3s},t.prototype.createHistogram=function(e,r){return F3s},t.prototype.createCounter=function(e,r){return L3s},t.prototype.createUpDownCounter=function(e,r){return U3s},t.prototype.createObservableGauge=function(e,r){return q3s},t.prototype.createObservableCounter=function(e,r){return Q3s},t.prototype.createObservableUpDownCounter=function(e,r){return j3s},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),Cat=(function(){function t(){}return a(t,"NoopMetric"),t})(),R3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(Cat),k3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(Cat),P3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(Cat),D3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(Cat),ccr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),N3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(ccr),M3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(ccr),O3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(ccr),lcr=new w3s,L3s=new R3s,B3s=new P3s,F3s=new D3s,U3s=new k3s,Q3s=new N3s,q3s=new M3s,j3s=new O3s;a(A$n,"createNoopMeter")});var bat,y$n=ve(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(bat||(bat={}))});var Sat,Tat,dcr=ve(()=>{p();Sat={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},Tat={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var H3s,G3s,E$n,_$n=ve(()=>{p();v2e();H3s=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},G3s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();_$n();iX();oX();$3s=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},V3s=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"})(wf||(wf={}))});var b2e,S2e,Gpe,Iat=ve(()=>{p();pcr();b2e="0000000000000000",S2e="00000000000000000000000000000000",Gpe={traceId:S2e,spanId:b2e,traceFlags:wf.NONE}});var cH,xat=ve(()=>{p();Iat();cH=(function(){function t(e){e===void 0&&(e=Gpe),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 wat(t){return t.getValue(hcr)||void 0}function v$n(){return wat(aH.getInstance().active())}function T2e(t,e){return t.setValue(hcr,e)}function C$n(t){return t.deleteValue(hcr)}function b$n(t,e){return T2e(t,new cH(e))}function Rat(t){var e;return(e=wat(t))===null||e===void 0?void 0:e.spanContext()}var hcr,mcr=ve(()=>{p();v2e();xat();C2e();hcr=_b("OpenTelemetry Context Key SPAN");a(wat,"getSpan");a(v$n,"getActiveSpan");a(T2e,"setSpan");a(C$n,"deleteSpan");a(b$n,"setSpanContext");a(Rat,"getSpanContext")});function aX(t){return z3s.test(t)&&t!==S2e}function gcr(t){return Y3s.test(t)&&t!==b2e}function vb(t){return aX(t.traceId)&&gcr(t.spanId)}function S$n(t){return new cH(t)}var z3s,Y3s,kat=ve(()=>{p();Iat();xat();z3s=/^([0-9a-f]{32})$/i,Y3s=/^[0-9a-f]{16}$/i;a(aX,"isValidTraceId");a(gcr,"isValidSpanId");a(vb,"isSpanContextValid");a(S$n,"wrapSpanContext")});function K3s(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var Acr,Pat,ycr=ve(()=>{p();C2e();mcr();xat();kat();Acr=aH.getInstance(),Pat=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=Acr.active());var o=!!r?.root;if(o)return new cH;var s=n&&Rat(n);return K3s(s)&&vb(s)?new cH(s):new cH},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??Acr.active(),d=this.startSpan(e,s,u),f=T2e(u,d);return Acr.with(f,l,void 0,d)}},t})();a(K3s,"isSpanContext")});var J3s,Dat,Ecr=ve(()=>{p();ycr();J3s=new Pat,Dat=(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):J3s},t})()});var T$n,I$n=ve(()=>{p();ycr();T$n=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new Pat},t})()});var Z3s,I2e,_cr=ve(()=>{p();Ecr();I$n();Z3s=new T$n,I2e=(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 Dat(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Z3s},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 Cb,x$n=ve(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Cb||(Cb={}))});var $pe,w$n=ve(()=>{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"})($pe||($pe={}))});var Vpe,R$n=ve(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Vpe||(Vpe={}))});function k$n(t){return tFs.test(t)}function P$n(t){return rFs.test(t)&&!nFs.test(t)}var vcr,X3s,eFs,tFs,rFs,nFs,D$n=ve(()=>{p();vcr="[_0-9a-z-*/]",X3s="[a-z]"+vcr+"{0,255}",eFs="[a-z0-9]"+vcr+"{0,240}@[a-z]"+vcr+"{0,13}",tFs=new RegExp("^(?:"+X3s+"|"+eFs+")$"),rFs=/^[ -~]{0,255}[!-~]$/,nFs=/,|=/;a(k$n,"validateKey");a(P$n,"validateValue")});var N$n,iFs,M$n,O$n,L$n,B$n=ve(()=>{p();D$n();N$n=32,iFs=512,M$n=",",O$n="=",L$n=(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+O$n+e.get(n)),r},[]).join(M$n)},t.prototype._parse=function(e){e.length>iFs||(this._internalState=e.split(M$n).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(O$n);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);k$n(c)&&P$n(l)&&r.set(c,l)}return r},new Map),this._internalState.size>N$n&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,N$n))))},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 F$n(t){return new L$n(t)}var U$n=ve(()=>{p();B$n();a(F$n,"createTraceState")});var Og,Q$n=ve(()=>{p();C2e();Og=aH.getInstance()});var Dn,q$n=ve(()=>{p();oX();Dn=SE.instance()});var oFs,j$n,H$n=ve(()=>{p();ucr();oFs=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return lcr},t})(),j$n=new oFs});var Ccr,G$n,$$n=ve(()=>{p();H$n();iX();oX();Ccr="metrics",G$n=(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 G5(Ccr,e,SE.instance())},t.prototype.getMeterProvider=function(){return PT(Ccr)||j$n},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){$5(Ccr,SE.instance())},t})()});var cX,V$n=ve(()=>{p();$$n();cX=G$n.getInstance()});var W$n,z$n=ve(()=>{p();W$n=(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 Scr(t){return t.getValue(bcr)||void 0}function Y$n(){return Scr(aH.getInstance().active())}function K$n(t,e){return t.setValue(bcr,e)}function J$n(t){return t.deleteValue(bcr)}var bcr,Z$n=ve(()=>{p();C2e();v2e();bcr=_b("OpenTelemetry Baggage Key");a(Scr,"getBaggage");a(Y$n,"getActiveBaggage");a(K$n,"setBaggage");a(J$n,"deleteBaggage")});var Tcr,sFs,X$n,eVn=ve(()=>{p();iX();z$n();dcr();Z$n();scr();oX();Tcr="propagation",sFs=new W$n,X$n=(function(){function t(){this.createBaggage=h$n,this.getBaggage=Scr,this.getActiveBaggage=Y$n,this.setBaggage=K$n,this.deleteBaggage=J$n}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return G5(Tcr,e,SE.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Tat),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=Sat),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){$5(Tcr,SE.instance())},t.prototype._getGlobalPropagator=function(){return PT(Tcr)||sFs},t})()});var DT,tVn=ve(()=>{p();eVn();DT=X$n.getInstance()});var Icr,rVn,nVn=ve(()=>{p();iX();_cr();kat();mcr();oX();Icr="trace",rVn=(function(){function t(){this._proxyTracerProvider=new I2e,this.wrapSpanContext=S$n,this.isSpanContextValid=vb,this.deleteSpan=C$n,this.getSpan=wat,this.getActiveSpan=v$n,this.getSpanContext=Rat,this.setSpan=T2e,this.setSpanContext=b$n}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=G5(Icr,this._proxyTracerProvider,SE.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return PT(Icr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){$5(Icr,SE.instance()),this._proxyTracerProvider=new I2e},t})()});var wu,iVn=ve(()=>{p();nVn();wu=rVn.getInstance()});var V5={};ki(V5,{DiagConsoleLogger:()=>m$n,DiagLogLevel:()=>Pa,INVALID_SPANID:()=>b2e,INVALID_SPAN_CONTEXT:()=>Gpe,INVALID_TRACEID:()=>S2e,ProxyTracer:()=>Dat,ProxyTracerProvider:()=>I2e,ROOT_CONTEXT:()=>vat,SamplingDecision:()=>Cb,SpanKind:()=>$pe,SpanStatusCode:()=>Vpe,TraceFlags:()=>wf,ValueType:()=>bat,baggageEntryMetadataFromString:()=>Hpe,context:()=>Og,createContextKey:()=>_b,createNoopMeter:()=>A$n,createTraceState:()=>F$n,default:()=>aFs,defaultTextMapGetter:()=>Sat,defaultTextMapSetter:()=>Tat,diag:()=>Dn,isSpanContextValid:()=>vb,isValidSpanId:()=>gcr,isValidTraceId:()=>aX,metrics:()=>cX,propagation:()=>DT,trace:()=>wu});var aFs,co=ve(()=>{p();scr();v2e();g$n();_at();ucr();y$n();dcr();Ecr();_cr();x$n();w$n();R$n();pcr();U$n();kat();Iat();Q$n();q$n();V$n();tVn();iVn();aFs={context:Og,diag:Dn,metrics:cX,propagation:DT,trace:wu}});var eDe=I(cc=>{"use strict";p();Object.defineProperty(cc,"__esModule",{value:!0});cc.regexpCode=cc.getEsmExportName=cc.getProperty=cc.safeStringify=cc.stringify=cc.strConcat=cc.addCodeArg=cc.str=cc._=cc.nil=cc._Code=cc.Name=cc.IDENTIFIER=cc._CodeOrName=void 0;var Z2e=class{static{a(this,"_CodeOrName")}};cc._CodeOrName=Z2e;cc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var AX=class extends Z2e{static{a(this,"Name")}constructor(e){if(super(),!cc.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}}};cc.Name=AX;var zw=class extends Z2e{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 AX&&(r[n.str]=(r[n.str]||0)+1),r),{})}};cc._Code=zw;cc.nil=new zw("");function jVn(t,...e){let r=[t[0]],n=0;for(;n{"use strict";p();Object.defineProperty(Sb,"__esModule",{value:!0});Sb.ValueScope=Sb.ValueScopeName=Sb.Scope=Sb.varKinds=Sb.UsedValueState=void 0;var bb=eDe(),clr=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Yat;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Yat||(Sb.UsedValueState=Yat={}));Sb.varKinds={const:new bb.Name("const"),let:new bb.Name("let"),var:new bb.Name("var")};var Kat=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof bb.Name?e:this.name(e)}name(e){return new bb.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}}};Sb.Scope=Kat;var Jat=class extends bb.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,bb._)`.${new bb.Name(r)}[${n}]`}};Sb.ValueScopeName=Jat;var A6s=(0,bb._)`\n`,llr=class extends Kat{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?A6s:bb.nil}}get(){return this._scope}name(e){return new Jat(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,bb._)`${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=bb.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,Yat.Started);let f=r(d);if(f){let h=this.opts.es5?Sb.varKinds.var:Sb.varKinds.const;s=(0,bb._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,bb._)`${s}${f}${this.opts._n}`;else throw new clr(d);u.set(d,Yat.Completed)})}return s}};Sb.ValueScope=llr});var Es=I(Ps=>{"use strict";p();Object.defineProperty(Ps,"__esModule",{value:!0});Ps.or=Ps.and=Ps.not=Ps.CodeGen=Ps.operators=Ps.varKinds=Ps.ValueScopeName=Ps.ValueScope=Ps.Scope=Ps.Name=Ps.regexpCode=Ps.stringify=Ps.getProperty=Ps.nil=Ps.strConcat=Ps.str=Ps._=void 0;var Da=eDe(),N2=ulr(),pH=eDe();Object.defineProperty(Ps,"_",{enumerable:!0,get:a(function(){return pH._},"get")});Object.defineProperty(Ps,"str",{enumerable:!0,get:a(function(){return pH.str},"get")});Object.defineProperty(Ps,"strConcat",{enumerable:!0,get:a(function(){return pH.strConcat},"get")});Object.defineProperty(Ps,"nil",{enumerable:!0,get:a(function(){return pH.nil},"get")});Object.defineProperty(Ps,"getProperty",{enumerable:!0,get:a(function(){return pH.getProperty},"get")});Object.defineProperty(Ps,"stringify",{enumerable:!0,get:a(function(){return pH.stringify},"get")});Object.defineProperty(Ps,"regexpCode",{enumerable:!0,get:a(function(){return pH.regexpCode},"get")});Object.defineProperty(Ps,"Name",{enumerable:!0,get:a(function(){return pH.Name},"get")});var tct=ulr();Object.defineProperty(Ps,"Scope",{enumerable:!0,get:a(function(){return tct.Scope},"get")});Object.defineProperty(Ps,"ValueScope",{enumerable:!0,get:a(function(){return tct.ValueScope},"get")});Object.defineProperty(Ps,"ValueScopeName",{enumerable:!0,get:a(function(){return tct.ValueScopeName},"get")});Object.defineProperty(Ps,"varKinds",{enumerable:!0,get:a(function(){return tct.varKinds},"get")});Ps.operators={GT:new Da._Code(">"),GTE:new Da._Code(">="),LT:new Da._Code("<"),LTE:new Da._Code("<="),EQ:new Da._Code("==="),NEQ:new Da._Code("!=="),NOT:new Da._Code("!"),OR:new Da._Code("||"),AND:new Da._Code("&&"),ADD:new Da._Code("+")};var f8=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},dlr=class extends f8{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?N2.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=Zpe(this.rhs,e,r)),this}get names(){return this.rhs instanceof Da._CodeOrName?this.rhs.names:{}}},Zat=class extends f8{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 Da.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Zpe(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Da.Name?{}:{...this.lhs.names};return ect(e,this.rhs)}},flr=class extends Zat{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}},plr=class extends f8{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},hlr=class extends f8{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},mlr=class extends f8{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},glr=class extends f8{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=Zpe(this.code,e,r),this}get names(){return this.code instanceof Da._CodeOrName?this.code.names:{}}},tDe=class extends f8{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)||(y6s(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>_X(e,r.names),{})}},p8=class extends tDe{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Alr=class extends tDe{static{a(this,"Root")}},Jpe=class extends p8{static{a(this,"Else")}};Jpe.kind="else";var yX=class t extends p8{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 Jpe(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(GVn(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=Zpe(this.condition,e,r),this}get names(){let e=super.names;return ect(e,this.condition),this.else&&_X(e,this.else.names),e}};yX.kind="if";var EX=class extends p8{static{a(this,"For")}};EX.kind="for";var ylr=class extends EX{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=Zpe(this.iteration,e,r),this}get names(){return _X(super.names,this.iteration.names)}},Elr=class extends EX{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?N2.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=ect(super.names,this.from);return ect(e,this.to)}},Xat=class extends EX{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=Zpe(this.iterable,e,r),this}get names(){return _X(super.names,this.iterable.names)}},rDe=class extends p8{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)}};rDe.kind="func";var nDe=class extends tDe{static{a(this,"Return")}render(e){return"return "+super.render(e)}};nDe.kind="return";var _lr=class extends p8{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&&_X(e,this.catch.names),this.finally&&_X(e,this.finally.names),e}},iDe=class extends p8{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};iDe.kind="catch";var oDe=class extends p8{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};oDe.kind="finally";var vlr=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 N2.Scope({parent:e}),this._nodes=[new Alr]}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 dlr(e,s,n)),s}const(e,r,n){return this._def(N2.varKinds.const,e,r,n)}let(e,r,n){return this._def(N2.varKinds.let,e,r,n)}var(e,r,n){return this._def(N2.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Zat(e,r,n))}add(e,r){return this._leafNode(new flr(e,Ps.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Da.nil&&this._leafNode(new glr(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,Da.addCodeArg)(r,o));return r.push("}"),new Da._Code(r)}if(e,r,n){if(this._blockNode(new yX(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 yX(e))}else(){return this._elseNode(new Jpe)}endIf(){return this._endBlockNode(yX,Jpe)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new ylr(e),r)}forRange(e,r,n,o,s=this.opts.es5?N2.varKinds.var:N2.varKinds.let){let c=this._scope.toName(e);return this._for(new Elr(s,c,r,n),()=>o(c))}forOf(e,r,n,o=N2.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Da.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Da._)`${c}.length`,l=>{this.var(s,(0,Da._)`${c}[${l}]`),n(s)})}return this._for(new Xat("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?N2.varKinds.var:N2.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Da._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Xat("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(EX)}label(e){return this._leafNode(new plr(e))}break(e){return this._leafNode(new hlr(e))}return(e){let r=new nDe;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(nDe)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new _lr;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new iDe(s),r(s)}return n&&(this._currNode=o.finally=new oDe,this.code(n)),this._endBlockNode(iDe,oDe)}throw(e){return this._leafNode(new mlr(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=Da.nil,n,o){return this._blockNode(new rDe(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(rDe)}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 yX))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}};Ps.CodeGen=vlr;function _X(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(_X,"addNames");function ect(t,e){return e instanceof Da._CodeOrName?_X(t,e.names):t}a(ect,"addExprNames");function Zpe(t,e,r){if(t instanceof Da.Name)return n(t);if(!o(t))return t;return new Da._Code(t._items.reduce((s,c)=>(c instanceof Da.Name&&(c=n(c)),c instanceof Da._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 Da._Code&&s._items.some(c=>c instanceof Da.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a(Zpe,"optimizeExpr");function y6s(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(y6s,"subtractNames");function GVn(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Da._)`!${Clr(t)}`}a(GVn,"not");Ps.not=GVn;var E6s=$Vn(Ps.operators.AND);function _6s(...t){return t.reduce(E6s)}a(_6s,"and");Ps.and=_6s;var v6s=$Vn(Ps.operators.OR);function C6s(...t){return t.reduce(v6s)}a(C6s,"or");Ps.or=C6s;function $Vn(t){return(e,r)=>e===Da.nil?r:r===Da.nil?e:(0,Da._)`${Clr(e)} ${t} ${Clr(r)}`}a($Vn,"mappend");function Clr(t){return t instanceof Da.Name?t:(0,Da._)`(${t})`}a(Clr,"par")});var Ka=I(js=>{"use strict";p();Object.defineProperty(js,"__esModule",{value:!0});js.checkStrictMode=js.getErrorPath=js.Type=js.useFunc=js.setEvaluated=js.evaluatedPropsToName=js.mergeEvaluated=js.eachItem=js.unescapeJsonPointer=js.escapeJsonPointer=js.escapeFragment=js.unescapeFragment=js.schemaRefOrVal=js.schemaHasRulesButRef=js.schemaHasRules=js.checkUnknownRules=js.alwaysValidSchema=js.toHash=void 0;var Yl=Es(),b6s=eDe();function S6s(t){let e={};for(let r of t)e[r]=!0;return e}a(S6s,"toHash");js.toHash=S6s;function T6s(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(zVn(t,e),!YVn(e,t.self.RULES.all))}a(T6s,"alwaysValidSchema");js.alwaysValidSchema=T6s;function zVn(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]||ZVn(t,`unknown keyword: "${s}"`)}a(zVn,"checkUnknownRules");js.checkUnknownRules=zVn;function YVn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(YVn,"schemaHasRules");js.schemaHasRules=YVn;function I6s(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(I6s,"schemaHasRulesButRef");js.schemaHasRulesButRef=I6s;function x6s({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Yl._)`${r}`}return(0,Yl._)`${t}${e}${(0,Yl.getProperty)(n)}`}a(x6s,"schemaRefOrVal");js.schemaRefOrVal=x6s;function w6s(t){return KVn(decodeURIComponent(t))}a(w6s,"unescapeFragment");js.unescapeFragment=w6s;function R6s(t){return encodeURIComponent(Slr(t))}a(R6s,"escapeFragment");js.escapeFragment=R6s;function Slr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(Slr,"escapeJsonPointer");js.escapeJsonPointer=Slr;function KVn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(KVn,"unescapeJsonPointer");js.unescapeJsonPointer=KVn;function k6s(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(k6s,"eachItem");js.eachItem=k6s;function VVn({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof Yl.Name?(s instanceof Yl.Name?t(o,s,c):e(o,s,c),c):s instanceof Yl.Name?(e(o,c,s),s):r(s,c);return l===Yl.Name&&!(u instanceof Yl.Name)?n(o,u):u}}a(VVn,"makeMergeEvaluated");js.mergeEvaluated={props:VVn({mergeNames:a((t,e,r)=>t.if((0,Yl._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Yl._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Yl._)`${r} || {}`).code((0,Yl._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Yl._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Yl._)`${r} || {}`),Tlr(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:JVn}),items:VVn({mergeNames:a((t,e,r)=>t.if((0,Yl._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Yl._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Yl._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Yl._)`${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 JVn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Yl._)`{}`);return e!==void 0&&Tlr(t,r,e),r}a(JVn,"evaluatedPropsToName");js.evaluatedPropsToName=JVn;function Tlr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Yl._)`${e}${(0,Yl.getProperty)(n)}`,!0))}a(Tlr,"setEvaluated");js.setEvaluated=Tlr;var WVn={};function P6s(t,e){return t.scopeValue("func",{ref:e,code:WVn[e.code]||(WVn[e.code]=new b6s._Code(e.code))})}a(P6s,"useFunc");js.useFunc=P6s;var blr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(blr||(js.Type=blr={}));function D6s(t,e,r){if(t instanceof Yl.Name){let n=e===blr.Num;return r?n?(0,Yl._)`"[" + ${t} + "]"`:(0,Yl._)`"['" + ${t} + "']"`:n?(0,Yl._)`"/" + ${t}`:(0,Yl._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Yl.getProperty)(t).toString():"/"+Slr(t)}a(D6s,"getErrorPath");js.getErrorPath=D6s;function ZVn(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(ZVn,"checkStrictMode");js.checkStrictMode=ZVn});var h8=I(Ilr=>{"use strict";p();Object.defineProperty(Ilr,"__esModule",{value:!0});var TE=Es(),N6s={data:new TE.Name("data"),valCxt:new TE.Name("valCxt"),instancePath:new TE.Name("instancePath"),parentData:new TE.Name("parentData"),parentDataProperty:new TE.Name("parentDataProperty"),rootData:new TE.Name("rootData"),dynamicAnchors:new TE.Name("dynamicAnchors"),vErrors:new TE.Name("vErrors"),errors:new TE.Name("errors"),this:new TE.Name("this"),self:new TE.Name("self"),scope:new TE.Name("scope"),json:new TE.Name("json"),jsonPos:new TE.Name("jsonPos"),jsonLen:new TE.Name("jsonLen"),jsonPart:new TE.Name("jsonPart")};Ilr.default=N6s});var sDe=I(IE=>{"use strict";p();Object.defineProperty(IE,"__esModule",{value:!0});IE.extendErrors=IE.resetErrorsCount=IE.reportExtraError=IE.reportError=IE.keyword$DataError=IE.keywordError=void 0;var Ja=Es(),rct=Ka(),mv=h8();IE.keywordError={message:a(({keyword:t})=>(0,Ja.str)`must pass "${t}" keyword validation`,"message")};IE.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,Ja.str)`"${t}" keyword must be ${e} ($data)`:(0,Ja.str)`"${t}" keyword is invalid ($data)`,"message")};function M6s(t,e=IE.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=tWn(t,e,r);n??(c||l)?XVn(s,u):eWn(o,(0,Ja._)`[${u}]`)}a(M6s,"reportError");IE.reportError=M6s;function O6s(t,e=IE.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=tWn(t,e,r);XVn(o,l),s||c||eWn(n,mv.default.vErrors)}a(O6s,"reportExtraError");IE.reportExtraError=O6s;function L6s(t,e){t.assign(mv.default.errors,e),t.if((0,Ja._)`${mv.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ja._)`${mv.default.vErrors}.length`,e),()=>t.assign(mv.default.vErrors,null)))}a(L6s,"resetErrorsCount");IE.resetErrorsCount=L6s;function B6s({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,mv.default.errors,l=>{t.const(c,(0,Ja._)`${mv.default.vErrors}[${l}]`),t.if((0,Ja._)`${c}.instancePath === undefined`,()=>t.assign((0,Ja._)`${c}.instancePath`,(0,Ja.strConcat)(mv.default.instancePath,s.errorPath))),t.assign((0,Ja._)`${c}.schemaPath`,(0,Ja.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Ja._)`${c}.schema`,r),t.assign((0,Ja._)`${c}.data`,n))})}a(B6s,"extendErrors");IE.extendErrors=B6s;function XVn(t,e){let r=t.const("err",e);t.if((0,Ja._)`${mv.default.vErrors} === null`,()=>t.assign(mv.default.vErrors,(0,Ja._)`[${r}]`),(0,Ja._)`${mv.default.vErrors}.push(${r})`),t.code((0,Ja._)`${mv.default.errors}++`)}a(XVn,"addError");function eWn(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,Ja._)`new ${t.ValidationError}(${e})`):(r.assign((0,Ja._)`${n}.errors`,e),r.return(!1))}a(eWn,"returnErrors");var vX={keyword:new Ja.Name("keyword"),schemaPath:new Ja.Name("schemaPath"),params:new Ja.Name("params"),propertyName:new Ja.Name("propertyName"),message:new Ja.Name("message"),schema:new Ja.Name("schema"),parentSchema:new Ja.Name("parentSchema")};function tWn(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Ja._)`{}`:F6s(t,e,r)}a(tWn,"errorObjectCode");function F6s(t,e,r={}){let{gen:n,it:o}=t,s=[U6s(o,r),Q6s(t,r)];return q6s(t,e,s),n.object(...s)}a(F6s,"errorObject");function U6s({errorPath:t},{instancePath:e}){let r=e?(0,Ja.str)`${t}${(0,rct.getErrorPath)(e,rct.Type.Str)}`:t;return[mv.default.instancePath,(0,Ja.strConcat)(mv.default.instancePath,r)]}a(U6s,"errorInstancePath");function Q6s({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,Ja.str)`${e}/${t}`;return r&&(o=(0,Ja.str)`${o}${(0,rct.getErrorPath)(r,rct.Type.Str)}`),[vX.schemaPath,o]}a(Q6s,"errorSchemaPath");function q6s(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([vX.keyword,o],[vX.params,typeof e=="function"?e(t):e||(0,Ja._)`{}`]),u.messages&&n.push([vX.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([vX.schema,c],[vX.parentSchema,(0,Ja._)`${f}${h}`],[mv.default.data,s]),d&&n.push([vX.propertyName,d])}a(q6s,"extraErrorProps")});var nWn=I(Xpe=>{"use strict";p();Object.defineProperty(Xpe,"__esModule",{value:!0});Xpe.boolOrEmptySchema=Xpe.topBoolOrEmptySchema=void 0;var j6s=sDe(),H6s=Es(),G6s=h8(),$6s={message:"boolean schema is false"};function V6s(t){let{gen:e,schema:r,validateName:n}=t;r===!1?rWn(t,!1):typeof r=="object"&&r.$async===!0?e.return(G6s.default.data):(e.assign((0,H6s._)`${n}.errors`,null),e.return(!0))}a(V6s,"topBoolOrEmptySchema");Xpe.topBoolOrEmptySchema=V6s;function W6s(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),rWn(t)):r.var(e,!0)}a(W6s,"boolOrEmptySchema");Xpe.boolOrEmptySchema=W6s;function rWn(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,j6s.reportError)(o,$6s,void 0,e)}a(rWn,"falseSchemaError")});var xlr=I(ehe=>{"use strict";p();Object.defineProperty(ehe,"__esModule",{value:!0});ehe.getRules=ehe.isJSONType=void 0;var z6s=["string","number","integer","boolean","null","object","array"],Y6s=new Set(z6s);function K6s(t){return typeof t=="string"&&Y6s.has(t)}a(K6s,"isJSONType");ehe.isJSONType=K6s;function J6s(){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(J6s,"getRules");ehe.getRules=J6s});var wlr=I(hH=>{"use strict";p();Object.defineProperty(hH,"__esModule",{value:!0});hH.shouldUseRule=hH.shouldUseGroup=hH.schemaHasRulesForType=void 0;function Z6s({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&iWn(t,n)}a(Z6s,"schemaHasRulesForType");hH.schemaHasRulesForType=Z6s;function iWn(t,e){return e.rules.some(r=>oWn(t,r))}a(iWn,"shouldUseGroup");hH.shouldUseGroup=iWn;function oWn(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(oWn,"shouldUseRule");hH.shouldUseRule=oWn});var aDe=I(xE=>{"use strict";p();Object.defineProperty(xE,"__esModule",{value:!0});xE.reportTypeError=xE.checkDataTypes=xE.checkDataType=xE.coerceAndCheckDataType=xE.getJSONTypes=xE.getSchemaTypes=xE.DataType=void 0;var X6s=xlr(),e9s=wlr(),t9s=sDe(),cs=Es(),sWn=Ka(),the;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(the||(xE.DataType=the={}));function r9s(t){let e=aWn(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(r9s,"getSchemaTypes");xE.getSchemaTypes=r9s;function aWn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(X6s.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(aWn,"getJSONTypes");xE.getJSONTypes=aWn;function n9s(t,e){let{gen:r,data:n,opts:o}=t,s=i9s(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,e9s.schemaHasRulesForType)(t,e[0]));if(c){let l=klr(e,n,o.strictNumbers,the.Wrong);r.if(l,()=>{s.length?o9s(t,e,s):Plr(t)})}return c}a(n9s,"coerceAndCheckDataType");xE.coerceAndCheckDataType=n9s;var cWn=new Set(["string","number","integer","boolean","null"]);function i9s(t,e){return e?t.filter(r=>cWn.has(r)||e==="array"&&r==="array"):[]}a(i9s,"coerceToTypes");function o9s(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,cs._)`typeof ${o}`),l=n.let("coerced",(0,cs._)`undefined`);s.coerceTypes==="array"&&n.if((0,cs._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,cs._)`${o}[0]`).assign(c,(0,cs._)`typeof ${o}`).if(klr(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,cs._)`${l} !== undefined`);for(let d of r)(cWn.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),Plr(t),n.endIf(),n.if((0,cs._)`${l} !== undefined`,()=>{n.assign(o,l),s9s(t,l)});function u(d){switch(d){case"string":n.elseIf((0,cs._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,cs._)`"" + ${o}`).elseIf((0,cs._)`${o} === null`).assign(l,(0,cs._)`""`);return;case"number":n.elseIf((0,cs._)`${c} == "boolean" || ${o} === null || (${c} == "string" && ${o} && ${o} == +${o})`).assign(l,(0,cs._)`+${o}`);return;case"integer":n.elseIf((0,cs._)`${c} === "boolean" || ${o} === null || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,(0,cs._)`+${o}`);return;case"boolean":n.elseIf((0,cs._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf((0,cs._)`${o} === "true" || ${o} === 1`).assign(l,!0);return;case"null":n.elseIf((0,cs._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(l,null);return;case"array":n.elseIf((0,cs._)`${c} === "string" || ${c} === "number" - || ${c} === "boolean" || ${o} === null`).assign(l,(0,cs._)`[${o}]`)}}a(u,"coerceSpecificType")}a(e9s,"coerceData");function t9s({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,cs._)`${e} !== undefined`,()=>t.assign((0,cs._)`${e}[${r}]`,n))}a(t9s,"assignParentData");function wlr(t,e,r,n=the.Correct){let o=n===the.Correct?cs.operators.EQ:cs.operators.NEQ,s;switch(t){case"null":return(0,cs._)`${e} ${o} null`;case"array":s=(0,cs._)`Array.isArray(${e})`;break;case"object":s=(0,cs._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,cs._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,cs._)`typeof ${e} ${o} ${t}`}return n===the.Correct?s:(0,cs.not)(s);function c(l=cs.nil){return(0,cs.and)((0,cs._)`typeof ${e} == "number"`,l,r?(0,cs._)`isFinite(${e})`:cs.nil)}}a(wlr,"checkDataType");xE.checkDataType=wlr;function Rlr(t,e,r,n){if(t.length===1)return wlr(t[0],e,r,n);let o,s=(0,oWn.toHash)(t);if(s.array&&s.object){let c=(0,cs._)`typeof ${e} != "object"`;o=s.null?c:(0,cs._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=cs.nil;s.number&&delete s.integer;for(let c in s)o=(0,cs.and)(o,wlr(c,e,r,n));return o}a(Rlr,"checkDataTypes");xE.checkDataTypes=Rlr;var r9s={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,cs._)`{type: ${t}}`:(0,cs._)`{type: ${e}}`,"params")};function klr(t){let e=n9s(t);(0,K6s.reportError)(e,r9s)}a(klr,"reportTypeError");xE.reportTypeError=klr;function n9s(t){let{gen:e,data:r,schema:n}=t,o=(0,oWn.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(n9s,"getTypeErrorContext")});var lWn=I(ect=>{"use strict";p();Object.defineProperty(ect,"__esModule",{value:!0});ect.assignDefaults=void 0;var rhe=Es(),i9s=Ka();function o9s(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)cWn(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>cWn(t,s,o.default))}a(o9s,"assignDefaults");ect.assignDefaults=o9s;function cWn(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,rhe._)`${s}${(0,rhe.getProperty)(e)}`;if(o){(0,i9s.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,rhe._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,rhe._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,rhe._)`${l} = ${(0,rhe.stringify)(r)}`)}a(cWn,"assignDefault")});var zw=I(Rl=>{"use strict";p();Object.defineProperty(Rl,"__esModule",{value:!0});Rl.validateUnion=Rl.validateArray=Rl.usePattern=Rl.callValidateCode=Rl.schemaProperties=Rl.allSchemaProperties=Rl.noPropertyInData=Rl.propertyInData=Rl.isOwnProperty=Rl.hasPropFunc=Rl.reportMissingProp=Rl.checkMissingProp=Rl.checkReportMissingProp=void 0;var fd=Es(),Plr=Ka(),hH=p8(),s9s=Ka();function a9s(t,e){let{gen:r,data:n,it:o}=t;r.if(Nlr(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,fd._)`${e}`},!0),t.error()})}a(a9s,"checkReportMissingProp");Rl.checkReportMissingProp=a9s;function c9s({gen:t,data:e,it:{opts:r}},n,o){return(0,fd.or)(...n.map(s=>(0,fd.and)(Nlr(t,e,s,r.ownProperties),(0,fd._)`${o} = ${s}`)))}a(c9s,"checkMissingProp");Rl.checkMissingProp=c9s;function l9s(t,e){t.setParams({missingProperty:e},!0),t.error()}a(l9s,"reportMissingProp");Rl.reportMissingProp=l9s;function uWn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fd._)`Object.prototype.hasOwnProperty`})}a(uWn,"hasPropFunc");Rl.hasPropFunc=uWn;function Dlr(t,e,r){return(0,fd._)`${uWn(t)}.call(${e}, ${r})`}a(Dlr,"isOwnProperty");Rl.isOwnProperty=Dlr;function u9s(t,e,r,n){let o=(0,fd._)`${e}${(0,fd.getProperty)(r)} !== undefined`;return n?(0,fd._)`${o} && ${Dlr(t,e,r)}`:o}a(u9s,"propertyInData");Rl.propertyInData=u9s;function Nlr(t,e,r,n){let o=(0,fd._)`${e}${(0,fd.getProperty)(r)} === undefined`;return n?(0,fd.or)(o,(0,fd.not)(Dlr(t,e,r))):o}a(Nlr,"noPropertyInData");Rl.noPropertyInData=Nlr;function dWn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(dWn,"allSchemaProperties");Rl.allSchemaProperties=dWn;function d9s(t,e){return dWn(e).filter(r=>!(0,Plr.alwaysValidSchema)(t,e[r]))}a(d9s,"schemaProperties");Rl.schemaProperties=d9s;function f9s({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,fd._)`${t}, ${e}, ${n}${o}`:e,h=[[hH.default.instancePath,(0,fd.strConcat)(hH.default.instancePath,s)],[hH.default.parentData,c.parentData],[hH.default.parentDataProperty,c.parentDataProperty],[hH.default.rootData,hH.default.rootData]];c.opts.dynamicRef&&h.push([hH.default.dynamicAnchors,hH.default.dynamicAnchors]);let m=(0,fd._)`${f}, ${r.object(...h)}`;return u!==fd.nil?(0,fd._)`${l}.call(${u}, ${m})`:(0,fd._)`${l}(${m})`}a(f9s,"callValidateCode");Rl.callValidateCode=f9s;var p9s=(0,fd._)`new RegExp`;function h9s({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,fd._)`${o.code==="new RegExp"?p9s:(0,s9s.useFunc)(t,o)}(${r}, ${n})`})}a(h9s,"usePattern");Rl.usePattern=h9s;function m9s(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,fd._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Plr.Type.Num},s),e.if((0,fd.not)(s),l)})}a(c,"validateItems")}a(m9s,"validateArray");Rl.validateArray=m9s;function g9s(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,Plr.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,fd._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,fd.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(g9s,"validateUnion");Rl.validateUnion=g9s});var hWn=I(z5=>{"use strict";p();Object.defineProperty(z5,"__esModule",{value:!0});z5.validateKeywordUsage=z5.validSchemaType=z5.funcKeywordCode=z5.macroKeywordCode=void 0;var mv=Es(),CX=p8(),A9s=zw(),y9s=sDe();function E9s(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=pWn(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(E9s,"macroKeywordCode");z5.macroKeywordCode=E9s;function _9s(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;C9s(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=pWn(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&&fWn(t),E(()=>t.error());else{let _=e.async?g():A();e.modifying&&fWn(t),E(()=>v9s(t,_))}}a(m,"validateKeyword");function g(){let _=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(_,(0,mv._)`${v}.errors`),()=>n.throw(v))),_}a(g,"validateAsync");function A(){let _=(0,mv._)`${f}.errors`;return n.assign(_,null),y(mv.nil),_}a(A,"validateSync");function y(_=e.async?(0,mv._)`await `:mv.nil){let v=u.opts.passContext?CX.default.this:CX.default.self,b=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,mv._)`${_}${(0,A9s.callValidateCode)(t,f,v,b)}`,e.modifying)}a(y,"assignValid");function E(_){var v;n.if((0,mv.not)((v=e.valid)!==null&&v!==void 0?v:h),_)}a(E,"reportErrs")}a(_9s,"funcKeywordCode");z5.funcKeywordCode=_9s;function fWn(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,mv._)`${n.parentData}[${n.parentDataProperty}]`))}a(fWn,"modifyData");function v9s(t,e){let{gen:r}=t;r.if((0,mv._)`Array.isArray(${e})`,()=>{r.assign(CX.default.vErrors,(0,mv._)`${CX.default.vErrors} === null ? ${e} : ${CX.default.vErrors}.concat(${e})`).assign(CX.default.errors,(0,mv._)`${CX.default.vErrors}.length`),(0,y9s.extendErrors)(t)},()=>t.error())}a(v9s,"addErrs");function C9s({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(C9s,"checkAsyncKeyword");function pWn(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(pWn,"useKeyword");function b9s(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(b9s,"validSchemaType");z5.validSchemaType=b9s;function S9s({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(S9s,"validateKeywordUsage");z5.validateKeywordUsage=S9s});var gWn=I(mH=>{"use strict";p();Object.defineProperty(mH,"__esModule",{value:!0});mH.extendSubschemaMode=mH.extendSubschemaData=mH.getSubschema=void 0;var Y5=Es(),mWn=Ka();function T9s(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,Y5._)`${t.schemaPath}${(0,Y5.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Y5._)`${t.schemaPath}${(0,Y5.getProperty)(e)}${(0,Y5.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,mWn.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(T9s,"getSubschema");mH.getSubschema=T9s;function I9s(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,Y5._)`${e.data}${(0,Y5.getProperty)(r)}`,!0);u(m),t.errorPath=(0,Y5.str)`${d}${(0,mWn.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,Y5._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof Y5.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(I9s,"extendSubschemaData");mH.extendSubschemaData=I9s;function x9s(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(x9s,"extendSubschemaMode");mH.extendSubschemaMode=x9s});var Mlr=I((pCf,AWn)=>{"use strict";p();AWn.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 EWn=I((gCf,yWn)=>{"use strict";p();var gH=yWn.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(){};tct(e,n,o,t,"",t)};gH.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};gH.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};gH.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};gH.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 tct(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 gH.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(Tb,"__esModule",{value:!0});Tb.getSchemaRefs=Tb.resolveUrl=Tb.normalizeId=Tb._getFullPath=Tb.getFullPath=Tb.inlineRef=void 0;var R9s=Ka(),k9s=Mlr(),P9s=EWn(),D9s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function N9s(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Olr(t):e?_Wn(t)<=e:!1}a(N9s,"inlineRef");Tb.inlineRef=N9s;var M9s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Olr(t){for(let e in t){if(M9s.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Olr)||typeof r=="object"&&Olr(r))return!0}return!1}a(Olr,"hasRef");function _Wn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!D9s.has(r)&&(typeof t[r]=="object"&&(0,R9s.eachItem)(t[r],n=>e+=_Wn(n)),e===1/0))return 1/0}return e}a(_Wn,"countKeys");function vWn(t,e="",r){r!==!1&&(e=nhe(e));let n=t.parse(e);return CWn(t,n)}a(vWn,"getFullPath");Tb.getFullPath=vWn;function CWn(t,e){return t.serialize(e).split("#")[0]+"#"}a(CWn,"_getFullPath");Tb._getFullPath=CWn;var O9s=/#\/?$/;function nhe(t){return t?t.replace(O9s,""):""}a(nhe,"normalizeId");Tb.normalizeId=nhe;function L9s(t,e,r){return r=nhe(r),t.resolve(e,r)}a(L9s,"resolveUrl");Tb.resolveUrl=L9s;var B9s=/^[a-z_][-a-z0-9._]*$/i;function F9s(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=nhe(t[r]||e),s={"":o},c=vWn(n,o,!1),l={},u=new Set;return P9s(t,{allKeys:!0},(h,m,g,A)=>{if(A===void 0)return;let y=c+m,E=s[A];typeof h[r]=="string"&&(E=_.call(this,h[r])),v.call(this,h.$anchor),v.call(this,h.$dynamicAnchor),s[m]=E;function _(b){let T=this.opts.uriResolver.resolve;if(b=nhe(E?T(E,b):b),u.has(b))throw f(b);u.add(b);let w=this.refs[b];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?d(h,w.schema,b):b!==nhe(y)&&(b[0]==="#"?(d(h,l[b],b),l[b]=h):this.refs[b]=y),b}a(_,"addRef");function v(b){if(typeof b=="string"){if(!B9s.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!k9s(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(F9s,"getSchemaRefs");Tb.getSchemaRefs=F9s});var dDe=I(AH=>{"use strict";p();Object.defineProperty(AH,"__esModule",{value:!0});AH.getData=AH.KeywordCxt=AH.validateFunctionCode=void 0;var xWn=rWn(),bWn=aDe(),Blr=xlr(),rct=aDe(),U9s=lWn(),uDe=hWn(),Llr=gWn(),oi=Es(),po=p8(),Q9s=cDe(),h8=Ka(),lDe=sDe();function q9s(t){if(kWn(t)&&(PWn(t),RWn(t))){G9s(t);return}wWn(t,()=>(0,xWn.topBoolOrEmptySchema)(t))}a(q9s,"validateFunctionCode");AH.validateFunctionCode=q9s;function wWn({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,oi._)`${po.default.data}, ${po.default.valCxt}`,n.$async,()=>{t.code((0,oi._)`"use strict"; ${SWn(r,o)}`),H9s(t,o),t.code(s)}):t.func(e,(0,oi._)`${po.default.data}, ${j9s(o)}`,n.$async,()=>t.code(SWn(r,o)).code(s))}a(wWn,"validateFunction");function j9s(t){return(0,oi._)`{${po.default.instancePath}="", ${po.default.parentData}, ${po.default.parentDataProperty}, ${po.default.rootData}=${po.default.data}${t.dynamicRef?(0,oi._)`, ${po.default.dynamicAnchors}={}`:oi.nil}}={}`}a(j9s,"destructureValCxt");function H9s(t,e){t.if(po.default.valCxt,()=>{t.var(po.default.instancePath,(0,oi._)`${po.default.valCxt}.${po.default.instancePath}`),t.var(po.default.parentData,(0,oi._)`${po.default.valCxt}.${po.default.parentData}`),t.var(po.default.parentDataProperty,(0,oi._)`${po.default.valCxt}.${po.default.parentDataProperty}`),t.var(po.default.rootData,(0,oi._)`${po.default.valCxt}.${po.default.rootData}`),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,oi._)`${po.default.valCxt}.${po.default.dynamicAnchors}`)},()=>{t.var(po.default.instancePath,(0,oi._)`""`),t.var(po.default.parentData,(0,oi._)`undefined`),t.var(po.default.parentDataProperty,(0,oi._)`undefined`),t.var(po.default.rootData,po.default.data),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,oi._)`{}`)})}a(H9s,"destructureValCxtES5");function G9s(t){let{schema:e,opts:r,gen:n}=t;wWn(t,()=>{r.$comment&&e.$comment&&NWn(t),Y9s(t),n.let(po.default.vErrors,null),n.let(po.default.errors,0),r.unevaluated&&$9s(t),DWn(t),Z9s(t)})}a(G9s,"topSchemaObjCode");function $9s(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,oi._)`${r}.evaluated`),e.if((0,oi._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,oi._)`${t.evaluated}.props`,(0,oi._)`undefined`)),e.if((0,oi._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,oi._)`${t.evaluated}.items`,(0,oi._)`undefined`))}a($9s,"resetEvaluated");function SWn(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,oi._)`/*# sourceURL=${r} */`:oi.nil}a(SWn,"funcSourceUrl");function V9s(t,e){if(kWn(t)&&(PWn(t),RWn(t))){W9s(t,e);return}(0,xWn.boolOrEmptySchema)(t,e)}a(V9s,"subschemaCode");function RWn({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(RWn,"schemaCxtHasRules");function kWn(t){return typeof t.schema!="boolean"}a(kWn,"isSchemaObj");function W9s(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&NWn(t),K9s(t),J9s(t);let s=n.const("_errs",po.default.errors);DWn(t,s),n.var(e,(0,oi._)`${s} === ${po.default.errors}`)}a(W9s,"subSchemaObjCode");function PWn(t){(0,h8.checkUnknownRules)(t),z9s(t)}a(PWn,"checkKeywords");function DWn(t,e){if(t.opts.jtd)return TWn(t,[],!1,e);let r=(0,bWn.getSchemaTypes)(t.schema),n=(0,bWn.coerceAndCheckDataType)(t,r);TWn(t,r,!n,e)}a(DWn,"typeAndKeywords");function z9s(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,h8.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(z9s,"checkRefsAndKeywords");function Y9s(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,h8.checkStrictMode)(t,"default is ignored in the schema root")}a(Y9s,"checkNoDefault");function K9s(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Q9s.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(K9s,"updateContext");function J9s(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(J9s,"checkAsyncSchema");function NWn({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,oi._)`${po.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let c=(0,oi.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,oi._)`${po.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(NWn,"commentKeyword");function Z9s(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,oi._)`${po.default.errors} === 0`,()=>e.return(po.default.data),()=>e.throw((0,oi._)`new ${o}(${po.default.vErrors})`)):(e.assign((0,oi._)`${n}.errors`,po.default.vErrors),s.unevaluated&&X9s(t),e.return((0,oi._)`${po.default.errors} === 0`))}a(Z9s,"returnResults");function X9s({gen:t,evaluated:e,props:r,items:n}){r instanceof oi.Name&&t.assign((0,oi._)`${e}.props`,r),n instanceof oi.Name&&t.assign((0,oi._)`${e}.items`,n)}a(X9s,"assignEvaluated");function TWn(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,h8.schemaHasRulesButRef)(s,f))){o.block(()=>OWn(t,"$ref",f.all.$ref.definition));return}u.jtd||eUs(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,Blr.shouldUseGroup)(s,m)&&(m.type?(o.if((0,rct.checkDataType)(m.type,c,u.strictNumbers)),IWn(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,rct.reportTypeError)(t)),o.endIf()):IWn(t,m),l||o.if((0,oi._)`${po.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(TWn,"schemaKeywords");function IWn(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,U9s.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Blr.shouldUseRule)(n,s)&&OWn(t,s.keyword,s.definition,e.type)})}a(IWn,"iterateKeywords");function eUs(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(tUs(t,e),t.opts.allowUnionTypes||rUs(t,e),nUs(t,t.dataTypes))}a(eUs,"checkStrictTypes");function tUs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{MWn(t.dataTypes,r)||Flr(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),oUs(t,e)}}a(tUs,"checkContextTypes");function rUs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Flr(t,"use allowUnionTypes to allow union type keyword")}a(rUs,"checkMultipleTypes");function nUs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Blr.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>iUs(e,c))&&Flr(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(nUs,"checkKeywordTypes");function iUs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(iUs,"hasApplicableType");function MWn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(MWn,"includesType");function oUs(t,e){let r=[];for(let n of t.dataTypes)MWn(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(oUs,"narrowSchemaTypes");function Flr(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,h8.checkStrictMode)(t,e,t.opts.strictTypes)}a(Flr,"strictTypesError");var nct=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,uDe.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,h8.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",LWn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,uDe.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",po.default.errors))}result(e,r,n){this.failResult((0,oi.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,oi.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,oi._)`${r} !== undefined && (${(0,oi.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?lDe.reportExtraError:lDe.reportError)(this,this.def.error,r)}$dataError(){(0,lDe.reportError)(this,this.def.$dataError||lDe.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,lDe.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=oi.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=oi.nil,r=oi.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:c}=this;n.if((0,oi.or)((0,oi._)`${o} === undefined`,r)),e!==oi.nil&&n.assign(e,!0),(s.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==oi.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,oi.or)(c(),l());function c(){if(n.length){if(!(r instanceof oi.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,oi._)`${(0,rct.checkDataTypes)(u,r,s.opts.strictNumbers,rct.DataType.Wrong)}`}return oi.nil}function l(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,oi._)`!${u}(${r})`}return oi.nil}}subschema(e,r){let n=(0,Llr.getSubschema)(this.it,e);(0,Llr.extendSubschemaData)(n,this.it,e),(0,Llr.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return V9s(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=h8.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=h8.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,oi.Name)),!0}};AH.KeywordCxt=nct;function OWn(t,e,r,n){let o=new nct(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,uDe.funcKeywordCode)(o,r):"macro"in r?(0,uDe.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,uDe.funcKeywordCode)(o,r)}a(OWn,"keywordCode");var sUs=/^\/(?:[^~]|~0|~1)*$/,aUs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function LWn(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return po.default.rootData;if(t[0]==="/"){if(!sUs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=po.default.rootData}else{let d=aUs.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,oi._)`${s}${(0,oi.getProperty)((0,h8.unescapeJsonPointer)(d))}`,c=(0,oi._)`${c} && ${s}`);return c;function u(d,f){return`Cannot access ${d} ${f} levels up, current level is ${e}`}}a(LWn,"getData");AH.getData=LWn});var ict=I(Qlr=>{"use strict";p();Object.defineProperty(Qlr,"__esModule",{value:!0});var Ulr=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Qlr.default=Ulr});var fDe=I(Hlr=>{"use strict";p();Object.defineProperty(Hlr,"__esModule",{value:!0});var qlr=cDe(),jlr=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,qlr.resolveUrl)(e,r,n),this.missingSchema=(0,qlr.normalizeId)((0,qlr.getFullPath)(e,this.missingRef))}};Hlr.default=jlr});var sct=I(Yw=>{"use strict";p();Object.defineProperty(Yw,"__esModule",{value:!0});Yw.resolveSchema=Yw.getCompilingSchema=Yw.resolveRef=Yw.compileSchema=Yw.SchemaEnv=void 0;var N2=Es(),cUs=ict(),bX=p8(),M2=cDe(),BWn=Ka(),lUs=dDe(),ihe=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,M2.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Yw.SchemaEnv=ihe;function $lr(t){let e=FWn.call(this,t);if(e)return e;let r=(0,M2.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new N2.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:cUs.default,code:(0,N2._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:bX.default.data,parentData:bX.default.parentData,parentDataProperty:bX.default.parentDataProperty,dataNames:[bX.default.data],dataPathArr:[N2.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,N2.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:N2.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,N2._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,lUs.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(bX.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${bX.default.self}`,`${bX.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 N2.Name?void 0:A,items:y instanceof N2.Name?void 0:y,dynamicProps:A instanceof N2.Name,dynamicItems:y instanceof N2.Name},g.source&&(g.source.evaluated=(0,N2.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($lr,"compileSchema");Yw.compileSchema=$lr;function uUs(t,e,r){var n;r=(0,M2.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=pUs.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 ihe({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=dUs.call(this,s)}a(uUs,"resolveRef");Yw.resolveRef=uUs;function dUs(t){return(0,M2.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:$lr.call(this,t)}a(dUs,"inlineOrCompile");function FWn(t){for(let e of this._compilations)if(fUs(e,t))return e}a(FWn,"getCompilingSchema");Yw.getCompilingSchema=FWn;function fUs(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(fUs,"sameSchemaEnv");function pUs(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||oct.call(this,t,e)}a(pUs,"resolve");function oct(t,e){let r=this.opts.uriResolver.parse(e),n=(0,M2._getFullPath)(this.opts.uriResolver,r),o=(0,M2.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Glr.call(this,r,t);let s=(0,M2.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=oct.call(this,t,c);return typeof l?.schema!="object"?void 0:Glr.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||$lr.call(this,c),s===(0,M2.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,M2.resolveUrl)(this.opts.uriResolver,o,d)),new ihe({schema:l,schemaId:u,root:t,baseId:o})}return Glr.call(this,r,c)}}a(oct,"resolveSchema");Yw.resolveSchema=oct;var hUs=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Glr(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,BWn.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!hUs.has(l)&&d&&(e=(0,M2.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,BWn.schemaHasRulesButRef)(r,this.RULES)){let l=(0,M2.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=oct.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new ihe({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(Glr,"getJsonPointer")});var UWn=I((MCf,mUs)=>{mUs.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 zlr=I((OCf,$Wn)=>{"use strict";p();var gUs=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),qWn=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),Vlr=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),jWn=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),AUs=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Wlr(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(Wlr,"stringArrayToHexStripped");var yUs=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function QWn(t){return t.length=0,!0}a(QWn,"consumeIsZone");function EUs(t,e,r){if(t.length){let n=Wlr(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(EUs,"consumeHextets");function _Us(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=EUs;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=QWn}else{o.push(d);continue}}return o.length&&(l===QWn?r.zone=o.join(""):c?n.push(o.join("")):n.push(Wlr(o))),r.address=n.join(""),r}a(_Us,"getIPV6");function HWn(t){if(vUs(t,":")<2)return{host:t,isIPV6:!1};let e=_Us(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(HWn,"normalizeIPv6");function vUs(t,e){let r=0;for(let n=0;nbUs[n])}a(GWn,"reescapeHostDelimiters");function IUs(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:kUs}=zlr(),PUs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,DUs=["http","https","ws","wss","urn","urn:uuid"];function NUs(t){return DUs.indexOf(t)!==-1}a(NUs,"isValidSchemeName");function Ylr(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(Ylr,"wsIsSecure");function VWn(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(VWn,"httpParse");function WWn(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(WWn,"httpSerialize");function MUs(t){return t.secure=Ylr(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(MUs,"wsParse");function OUs(t){if((t.port===(Ylr(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(OUs,"wsSerialize");function LUs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(PUs);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=Klr(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(LUs,"urnParse");function BUs(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=Klr(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(BUs,"urnSerialize");function FUs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!kUs(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a(FUs,"urnuuidParse");function UUs(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(UUs,"urnuuidSerialize");var zWn={scheme:"http",domainHost:!0,parse:VWn,serialize:WWn},QUs={scheme:"https",domainHost:zWn.domainHost,parse:VWn,serialize:WWn},act={scheme:"ws",domainHost:!0,parse:MUs,serialize:OUs},qUs={scheme:"wss",domainHost:act.domainHost,parse:act.parse,serialize:act.serialize},jUs={scheme:"urn",parse:LUs,serialize:BUs,skipNormalize:!0},HUs={scheme:"urn:uuid",parse:FUs,serialize:UUs,skipNormalize:!0},cct={http:zWn,https:QUs,ws:act,wss:qUs,urn:jUs,"urn:uuid":HUs};Object.setPrototypeOf(cct,null);function Klr(t){return t&&(cct[t]||cct[t.toLowerCase()])||void 0}a(Klr,"getSchemeHandler");YWn.exports={wsIsSecure:Ylr,SCHEMES:cct,isValidSchemeName:NUs,getSchemeHandler:Klr}});var rzn=I((qCf,lct)=>{"use strict";p();var{normalizeIPv6:GUs,removeDotSegments:pDe,recomposeAuthority:$Us,normalizePercentEncoding:VUs,normalizePathEncoding:WUs,escapePreservingEscapes:zUs,reescapeHostDelimiters:YUs,isIPv4:KUs,nonSimpleDomain:JUs}=zlr(),{SCHEMES:ZUs,getSchemeHandler:ZWn}=KWn();function XUs(t,e){return typeof t=="string"?t=i7s(t,e):typeof t=="object"&&(t=ohe(SX(t,e),e)),t}a(XUs,"normalize");function e7s(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=XWn(ohe(t,n),ohe(e,n),n,!0);return n.skipEscape=!0,SX(o,n)}a(e7s,"resolve");function XWn(t,e,r,n){let o={};return n||(t=ohe(SX(t,r),r),e=ohe(SX(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=pDe(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=pDe(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=pDe(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=pDe(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(XWn,"resolveComponent");function t7s(t,e,r){let n=JWn(t,r),o=JWn(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(t7s,"equal");function SX(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=ZWn(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=VUs(r.path):(r.path=zUs(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=$Us(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=pDe(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(SX,"serialize");var r7s=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function n7s(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(n7s,"getParseError");function ezn(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(r7s);if(c){n.scheme=c[1],n.userinfo=c[3],n.host=c[4],n.port=parseInt(c[5],10),n.path=c[6]||"",n.query=c[7],n.fragment=c[8],isNaN(n.port)&&(n.port=c[5]);let l=n7s(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(KUs(n.host)===!1){let f=GUs(n.host);n.host=f.host.toLowerCase(),s=f.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 u=ZWn(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&JUs(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!u||u&&!u.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=YUs(unescape(n.host),s))),n.path&&(n.path=WUs(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}u&&u.parse&&u.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}a(ezn,"parseWithStatus");function ohe(t,e){return ezn(t,e).parsed}a(ohe,"parse");function i7s(t,e){return tzn(t,e).normalized}a(i7s,"normalizeString");function tzn(t,e){let{parsed:r,malformedAuthorityOrPort:n}=ezn(t,e);return{normalized:n?t:SX(r,e),malformedAuthorityOrPort:n}}a(tzn,"normalizeStringWithStatus");function JWn(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=tzn(t,e);return n?void 0:r}if(typeof t=="object")return SX(t,e)}a(JWn,"normalizeComparableURI");var Jlr={SCHEMES:ZUs,normalize:XUs,resolve:e7s,resolveComponent:XWn,equal:t7s,serialize:SX,parse:ohe};lct.exports=Jlr;lct.exports.default=Jlr;lct.exports.fastUri=Jlr});var izn=I(Zlr=>{"use strict";p();Object.defineProperty(Zlr,"__esModule",{value:!0});var nzn=rzn();nzn.code='require("ajv/dist/runtime/uri").default';Zlr.default=nzn});var fzn=I(ZA=>{"use strict";p();Object.defineProperty(ZA,"__esModule",{value:!0});ZA.CodeGen=ZA.Name=ZA.nil=ZA.stringify=ZA.str=ZA._=ZA.KeywordCxt=void 0;var o7s=dDe();Object.defineProperty(ZA,"KeywordCxt",{enumerable:!0,get:a(function(){return o7s.KeywordCxt},"get")});var she=Es();Object.defineProperty(ZA,"_",{enumerable:!0,get:a(function(){return she._},"get")});Object.defineProperty(ZA,"str",{enumerable:!0,get:a(function(){return she.str},"get")});Object.defineProperty(ZA,"stringify",{enumerable:!0,get:a(function(){return she.stringify},"get")});Object.defineProperty(ZA,"nil",{enumerable:!0,get:a(function(){return she.nil},"get")});Object.defineProperty(ZA,"Name",{enumerable:!0,get:a(function(){return she.Name},"get")});Object.defineProperty(ZA,"CodeGen",{enumerable:!0,get:a(function(){return she.CodeGen},"get")});var s7s=ict(),lzn=fDe(),a7s=Ilr(),hDe=sct(),c7s=Es(),mDe=cDe(),uct=aDe(),eur=Ka(),ozn=UWn(),l7s=izn(),uzn=a((t,e)=>new RegExp(t,e),"defaultRegExp");uzn.code="new RegExp";var u7s=["removeAdditional","useDefaults","coerceTypes"],d7s=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f7s={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."},p7s={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},szn=200;function h7s(t){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D;let N=t.strict,L=(e=t.code)===null||e===void 0?void 0:e.optimize,B=L===!0||L===void 0?1:L||0,q=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:uzn,M=(o=t.uriResolver)!==null&&o!==void 0?o:l7s.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:szn,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:szn,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=t.inlineRefs)!==null&&b!==void 0?b:!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:(P=t.unicodeRegExp)!==null&&P!==void 0?P:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:M}}a(h7s,"requiredOptions");var gDe=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,...h7s(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new c7s.ValueScope({scope:{},prefixes:d7s,es5:r,lines:n}),this.logger=_7s(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a7s.getRules)(),azn.call(this,f7s,e,"NOT SUPPORTED"),azn.call(this,p7s,e,"DEPRECATED","warn"),this._metaOpts=y7s.call(this),e.formats&&g7s.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&A7s.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),m7s.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=ozn;n==="id"&&(o={...ozn},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 lzn.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,mDe.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=czn.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new hDe.SchemaEnv({schema:{},schemaId:n});if(r=hDe.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=czn.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,mDe.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(C7s.call(this,n,r),!r)return(0,eur.eachItem)(n,s=>Xlr.call(this,s)),this;S7s.call(this,r);let o={...r,type:(0,uct.getJSONTypes)(r.type),schemaType:(0,uct.getJSONTypes)(r.schemaType)};return(0,eur.eachItem)(n,o.type.length===0?s=>Xlr.call(this,s,o):s=>o.type.forEach(c=>Xlr.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]=dzn(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,mDe.normalizeId)(c||n);let d=mDe.getSchemaRefs.call(this,e,n);return u=new hDe.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):hDe.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{hDe.compileSchema.call(this,e)}finally{this.opts=r}}};gDe.ValidationError=s7s.default;gDe.MissingRefError=lzn.default;ZA.default=gDe;function azn(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(azn,"checkOptions");function czn(t){return t=(0,mDe.normalizeId)(t),this.schemas[t]||this.refs[t]}a(czn,"getSchEnv");function m7s(){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(m7s,"addInitialSchemas");function g7s(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(g7s,"addInitialFormats");function A7s(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(A7s,"addInitialKeywords");function y7s(){let t={...this.opts};for(let e of u7s)delete t[e];return t}a(y7s,"getMetaSchemaOptions");var E7s={log(){},warn(){},error(){}};function _7s(t){if(t===!1)return E7s;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(_7s,"getLogger");var v7s=/^[a-z_$][a-z0-9_$:-]*$/i;function C7s(t,e){let{RULES:r}=this;if((0,eur.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!v7s.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(C7s,"checkKeyword");function Xlr(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,uct.getJSONTypes)(e.type),schemaType:(0,uct.getJSONTypes)(e.schemaType)}};e.before?b7s.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(Xlr,"addRule");function b7s(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(b7s,"addBeforeRule");function S7s(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=dzn(e)),t.validateSchema=this.compile(e,!0))}a(S7s,"keywordMetaschema");var T7s={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function dzn(t){return{anyOf:[t,T7s]}}a(dzn,"schemaOrData")});var pzn=I(tur=>{"use strict";p();Object.defineProperty(tur,"__esModule",{value:!0});var I7s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};tur.default=I7s});var Azn=I(TX=>{"use strict";p();Object.defineProperty(TX,"__esModule",{value:!0});TX.callRef=TX.getValidate=void 0;var x7s=fDe(),hzn=zw(),Ib=Es(),ahe=p8(),mzn=sct(),dct=Ka(),w7s={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=mzn.resolveRef.call(u,d,o,r);if(f===void 0)throw new x7s.default(n.opts.uriResolver,o,r);if(f instanceof mzn.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return fct(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return fct(t,(0,Ib._)`${A}.validate`,d,d.$async)}function m(A){let y=gzn(t,A);fct(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,Ib.stringify)(A)}:{ref:A}),E=e.name("valid"),_=t.subschema({schema:A,dataTypes:[],schemaPath:Ib.nil,topSchemaRef:y,errSchemaPath:r},E);t.mergeEvaluated(_),t.ok(E)}}};function gzn(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ib._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(gzn,"getValidate");TX.getValidate=gzn;function fct(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?ahe.default.this:Ib.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,Ib._)`await ${(0,hzn.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,Ib._)`!(${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,hzn.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,Ib._)`${A}.errors`;o.assign(ahe.default.vErrors,(0,Ib._)`${ahe.default.vErrors} === null ? ${y} : ${ahe.default.vErrors}.concat(${y})`),o.assign(ahe.default.errors,(0,Ib._)`${ahe.default.vErrors}.length`)}a(m,"addErrorsFrom");function g(A){var y;if(!s.opts.unevaluated)return;let E=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=dct.mergeEvaluated.props(o,E.props,s.props));else{let _=o.var("props",(0,Ib._)`${A}.evaluated.props`);s.props=dct.mergeEvaluated.props(o,_,s.props,Ib.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=dct.mergeEvaluated.items(o,E.items,s.items));else{let _=o.var("items",(0,Ib._)`${A}.evaluated.items`);s.items=dct.mergeEvaluated.items(o,_,s.items,Ib.Name)}}a(g,"addEvaluatedFrom")}a(fct,"callRef");TX.callRef=fct;TX.default=w7s});var yzn=I(rur=>{"use strict";p();Object.defineProperty(rur,"__esModule",{value:!0});var R7s=pzn(),k7s=Azn(),P7s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",R7s.default,k7s.default];rur.default=P7s});var Ezn=I(nur=>{"use strict";p();Object.defineProperty(nur,"__esModule",{value:!0});var pct=Es(),yH=pct.operators,hct={maximum:{okStr:"<=",ok:yH.LTE,fail:yH.GT},minimum:{okStr:">=",ok:yH.GTE,fail:yH.LT},exclusiveMaximum:{okStr:"<",ok:yH.LT,fail:yH.GTE},exclusiveMinimum:{okStr:">",ok:yH.GT,fail:yH.LTE}},D7s={message:a(({keyword:t,schemaCode:e})=>(0,pct.str)`must be ${hct[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,pct._)`{comparison: ${hct[t].okStr}, limit: ${e}}`,"params")},N7s={keyword:Object.keys(hct),type:"number",schemaType:"number",$data:!0,error:D7s,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,pct._)`${r} ${hct[e].fail} ${n} || isNaN(${r})`)}};nur.default=N7s});var _zn=I(iur=>{"use strict";p();Object.defineProperty(iur,"__esModule",{value:!0});var ADe=Es(),M7s={message:a(({schemaCode:t})=>(0,ADe.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,ADe._)`{multipleOf: ${t}}`,"params")},O7s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:M7s,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,ADe._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,ADe._)`${c} !== parseInt(${c})`;t.fail$data((0,ADe._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};iur.default=O7s});var Czn=I(our=>{"use strict";p();Object.defineProperty(our,"__esModule",{value:!0});function vzn(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(sur,"__esModule",{value:!0});var IX=Es(),L7s=Ka(),B7s=Czn(),F7s={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,IX.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,IX._)`{limit: ${t}}`,"params")},U7s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:F7s,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?IX.operators.GT:IX.operators.LT,c=o.opts.unicode===!1?(0,IX._)`${r}.length`:(0,IX._)`${(0,L7s.useFunc)(t.gen,B7s.default)}(${r})`;t.fail$data((0,IX._)`${c} ${s} ${n}`)}};sur.default=U7s});var Szn=I(aur=>{"use strict";p();Object.defineProperty(aur,"__esModule",{value:!0});var Q7s=zw(),q7s=Ka(),che=Es(),j7s={message:a(({schemaCode:t})=>(0,che.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,che._)`{pattern: ${t}}`,"params")},H7s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:j7s,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,che._)`new RegExp`:(0,q7s.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,che._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,che._)`!${f}`)}else{let u=(0,Q7s.usePattern)(t,o);t.fail$data((0,che._)`!${u}.test(${r})`)}}};aur.default=H7s});var Tzn=I(cur=>{"use strict";p();Object.defineProperty(cur,"__esModule",{value:!0});var yDe=Es(),G7s={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,yDe.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,yDe._)`{limit: ${t}}`,"params")},$7s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:G7s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?yDe.operators.GT:yDe.operators.LT;t.fail$data((0,yDe._)`Object.keys(${r}).length ${o} ${n}`)}};cur.default=$7s});var Izn=I(lur=>{"use strict";p();Object.defineProperty(lur,"__esModule",{value:!0});var EDe=zw(),_De=Es(),V7s=Ka(),W7s={message:a(({params:{missingProperty:t}})=>(0,_De.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,_De._)`{missingProperty: ${t}}`,"params")},z7s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:W7s,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 E=c.schemaEnv.baseId+c.errSchemaPath,_=`required property "${y}" is not defined at "${E}" (strictRequired)`;(0,V7s.checkStrictMode)(c,_,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(_De.nil,h);else for(let g of r)(0,EDe.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,EDe.checkMissingProp)(t,r,g)),(0,EDe.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,EDe.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,EDe.propertyInData)(e,o,g,l.ownProperties)),e.if((0,_De.not)(A),()=>{t.error(),e.break()})},_De.nil)}a(m,"loopUntilMissing")}};lur.default=z7s});var xzn=I(uur=>{"use strict";p();Object.defineProperty(uur,"__esModule",{value:!0});var vDe=Es(),Y7s={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,vDe.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,vDe._)`{limit: ${t}}`,"params")},K7s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Y7s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?vDe.operators.GT:vDe.operators.LT;t.fail$data((0,vDe._)`${r}.length ${o} ${n}`)}};uur.default=K7s});var mct=I(dur=>{"use strict";p();Object.defineProperty(dur,"__esModule",{value:!0});var wzn=Mlr();wzn.code='require("ajv/dist/runtime/equal").default';dur.default=wzn});var Rzn=I(pur=>{"use strict";p();Object.defineProperty(pur,"__esModule",{value:!0});var fur=aDe(),XA=Es(),J7s=Ka(),Z7s=mct(),X7s={message:a(({params:{i:t,j:e}})=>(0,XA.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,XA._)`{i: ${t}, j: ${e}}`,"params")},eQs={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:X7s,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,fur.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,XA._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,XA._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,XA._)`${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=e.name("item"),_=(0,fur.checkDataTypes)(d,E,l.opts.strictNumbers,fur.DataType.Wrong),v=e.const("indices",(0,XA._)`{}`);e.for((0,XA._)`;${A}--;`,()=>{e.let(E,(0,XA._)`${r}[${A}]`),e.if(_,(0,XA._)`continue`),d.length>1&&e.if((0,XA._)`typeof ${E} == "string"`,(0,XA._)`${E} += "_"`),e.if((0,XA._)`typeof ${v}[${E}] == "number"`,()=>{e.assign(y,(0,XA._)`${v}[${E}]`),t.error(),e.assign(u,!1).break()}).code((0,XA._)`${v}[${E}] = ${A}`)})}a(m,"loopN");function g(A,y){let E=(0,J7s.useFunc)(e,Z7s.default),_=e.name("outer");e.label(_).for((0,XA._)`;${A}--;`,()=>e.for((0,XA._)`${y} = ${A}; ${y}--;`,()=>e.if((0,XA._)`${E}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(_)})))}a(g,"loopN2")}};pur.default=eQs});var kzn=I(mur=>{"use strict";p();Object.defineProperty(mur,"__esModule",{value:!0});var hur=Es(),tQs=Ka(),rQs=mct(),nQs={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,hur._)`{allowedValue: ${t}}`,"params")},iQs={keyword:"const",$data:!0,error:nQs,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,hur._)`!${(0,tQs.useFunc)(e,rQs.default)}(${r}, ${o})`):t.fail((0,hur._)`${s} !== ${r}`)}};mur.default=iQs});var Pzn=I(gur=>{"use strict";p();Object.defineProperty(gur,"__esModule",{value:!0});var CDe=Es(),oQs=Ka(),sQs=mct(),aQs={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,CDe._)`{allowedValues: ${t}}`,"params")},cQs={keyword:"enum",schemaType:"array",$data:!0,error:aQs,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,oQs.useFunc)(e,sQs.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,CDe.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,CDe._)`${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,CDe._)`${d()}(${r}, ${g}[${A}])`:(0,CDe._)`${r} === ${y}`}a(m,"equalCode")}};gur.default=cQs});var Dzn=I(Aur=>{"use strict";p();Object.defineProperty(Aur,"__esModule",{value:!0});var lQs=Ezn(),uQs=_zn(),dQs=bzn(),fQs=Szn(),pQs=Tzn(),hQs=Izn(),mQs=xzn(),gQs=Rzn(),AQs=kzn(),yQs=Pzn(),EQs=[lQs.default,uQs.default,dQs.default,fQs.default,pQs.default,hQs.default,mQs.default,gQs.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},AQs.default,yQs.default];Aur.default=EQs});var Eur=I(bDe=>{"use strict";p();Object.defineProperty(bDe,"__esModule",{value:!0});bDe.validateAdditionalItems=void 0;var xX=Es(),yur=Ka(),_Qs={message:a(({params:{len:t}})=>(0,xX.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,xX._)`{limit: ${t}}`,"params")},vQs={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:_Qs,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,yur.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Nzn(t,n)}};function Nzn(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,xX._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,xX._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,yur.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,xX._)`${l} <= ${e.length}`);r.if((0,xX.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:yur.Type.Num},d),c.allErrors||r.if((0,xX.not)(d),()=>r.break())})}a(u,"validateItems")}a(Nzn,"validateAdditionalItems");bDe.validateAdditionalItems=Nzn;bDe.default=vQs});var _ur=I(SDe=>{"use strict";p();Object.defineProperty(SDe,"__esModule",{value:!0});SDe.validateTuple=void 0;var Mzn=Es(),gct=Ka(),CQs=zw(),bQs={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Ozn(t,"additionalItems",e);r.items=!0,!(0,gct.alwaysValidSchema)(r,e)&&t.ok((0,CQs.validateArray)(t))}};function Ozn(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=gct.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,Mzn._)`${s}.length`);r.forEach((h,m)=>{(0,gct.alwaysValidSchema)(l,h)||(n.if((0,Mzn._)`${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 E=`"${c}" is ${A}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,gct.checkStrictMode)(l,E,m.strictTuples)}}a(f,"checkStrictTuple")}a(Ozn,"validateTuple");SDe.validateTuple=Ozn;SDe.default=bQs});var Lzn=I(vur=>{"use strict";p();Object.defineProperty(vur,"__esModule",{value:!0});var SQs=_ur(),TQs={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,SQs.validateTuple)(t,"items"),"code")};vur.default=TQs});var Fzn=I(Cur=>{"use strict";p();Object.defineProperty(Cur,"__esModule",{value:!0});var Bzn=Es(),IQs=Ka(),xQs=zw(),wQs=Eur(),RQs={message:a(({params:{len:t}})=>(0,Bzn.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,Bzn._)`{limit: ${t}}`,"params")},kQs={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:RQs,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,IQs.alwaysValidSchema)(n,e)&&(o?(0,wQs.validateAdditionalItems)(t,o):t.ok((0,xQs.validateArray)(t)))}};Cur.default=kQs});var Uzn=I(bur=>{"use strict";p();Object.defineProperty(bur,"__esModule",{value:!0});var Kw=Es(),Act=Ka(),PQs={message:a(({params:{min:t,max:e}})=>e===void 0?(0,Kw.str)`must contain at least ${t} valid item(s)`:(0,Kw.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,Kw._)`{minContains: ${t}}`:(0,Kw._)`{minContains: ${t}, maxContains: ${e}}`,"params")},DQs={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:PQs,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,Kw._)`${o}.length`);if(t.setParams({min:c,max:l}),l===void 0&&c===0){(0,Act.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,Act.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Act.alwaysValidSchema)(s,r)){let y=(0,Kw._)`${f} >= ${c}`;l!==void 0&&(y=(0,Kw._)`${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,Kw._)`${o}.length > 0`,m)):(e.let(h,!1),m()),t.result(h,()=>t.reset());function m(){let y=e.name("_valid"),E=e.let("count",0);g(y,()=>e.if(y,()=>A(E)))}a(m,"validateItemsWithCount");function g(y,E){e.forRange("i",0,f,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:Act.Type.Num,compositeRule:!0},y),E()})}a(g,"validateItems");function A(y){e.code((0,Kw._)`${y}++`),l===void 0?e.if((0,Kw._)`${y} >= ${c}`,()=>e.assign(h,!0).break()):(e.if((0,Kw._)`${y} > ${l}`,()=>e.assign(h,!1).break()),c===1?e.assign(h,!0):e.if((0,Kw._)`${y} >= ${c}`,()=>e.assign(h,!0)))}a(A,"checkLimits")}};bur.default=DQs});var jzn=I(K5=>{"use strict";p();Object.defineProperty(K5,"__esModule",{value:!0});K5.validateSchemaDeps=K5.validatePropertyDeps=K5.error=void 0;var Sur=Es(),NQs=Ka(),TDe=zw();K5.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Sur.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Sur._)`{property: ${t}, + || ${c} === "boolean" || ${o} === null`).assign(l,(0,cs._)`[${o}]`)}}a(u,"coerceSpecificType")}a(o9s,"coerceData");function s9s({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,cs._)`${e} !== undefined`,()=>t.assign((0,cs._)`${e}[${r}]`,n))}a(s9s,"assignParentData");function Rlr(t,e,r,n=the.Correct){let o=n===the.Correct?cs.operators.EQ:cs.operators.NEQ,s;switch(t){case"null":return(0,cs._)`${e} ${o} null`;case"array":s=(0,cs._)`Array.isArray(${e})`;break;case"object":s=(0,cs._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,cs._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,cs._)`typeof ${e} ${o} ${t}`}return n===the.Correct?s:(0,cs.not)(s);function c(l=cs.nil){return(0,cs.and)((0,cs._)`typeof ${e} == "number"`,l,r?(0,cs._)`isFinite(${e})`:cs.nil)}}a(Rlr,"checkDataType");xE.checkDataType=Rlr;function klr(t,e,r,n){if(t.length===1)return Rlr(t[0],e,r,n);let o,s=(0,sWn.toHash)(t);if(s.array&&s.object){let c=(0,cs._)`typeof ${e} != "object"`;o=s.null?c:(0,cs._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=cs.nil;s.number&&delete s.integer;for(let c in s)o=(0,cs.and)(o,Rlr(c,e,r,n));return o}a(klr,"checkDataTypes");xE.checkDataTypes=klr;var a9s={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,cs._)`{type: ${t}}`:(0,cs._)`{type: ${e}}`,"params")};function Plr(t){let e=c9s(t);(0,t9s.reportError)(e,a9s)}a(Plr,"reportTypeError");xE.reportTypeError=Plr;function c9s(t){let{gen:e,data:r,schema:n}=t,o=(0,sWn.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(c9s,"getTypeErrorContext")});var uWn=I(nct=>{"use strict";p();Object.defineProperty(nct,"__esModule",{value:!0});nct.assignDefaults=void 0;var rhe=Es(),l9s=Ka();function u9s(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)lWn(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>lWn(t,s,o.default))}a(u9s,"assignDefaults");nct.assignDefaults=u9s;function lWn(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,rhe._)`${s}${(0,rhe.getProperty)(e)}`;if(o){(0,l9s.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,rhe._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,rhe._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,rhe._)`${l} = ${(0,rhe.stringify)(r)}`)}a(lWn,"assignDefault")});var Yw=I(Rl=>{"use strict";p();Object.defineProperty(Rl,"__esModule",{value:!0});Rl.validateUnion=Rl.validateArray=Rl.usePattern=Rl.callValidateCode=Rl.schemaProperties=Rl.allSchemaProperties=Rl.noPropertyInData=Rl.propertyInData=Rl.isOwnProperty=Rl.hasPropFunc=Rl.reportMissingProp=Rl.checkMissingProp=Rl.checkReportMissingProp=void 0;var fd=Es(),Dlr=Ka(),mH=h8(),d9s=Ka();function f9s(t,e){let{gen:r,data:n,it:o}=t;r.if(Mlr(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,fd._)`${e}`},!0),t.error()})}a(f9s,"checkReportMissingProp");Rl.checkReportMissingProp=f9s;function p9s({gen:t,data:e,it:{opts:r}},n,o){return(0,fd.or)(...n.map(s=>(0,fd.and)(Mlr(t,e,s,r.ownProperties),(0,fd._)`${o} = ${s}`)))}a(p9s,"checkMissingProp");Rl.checkMissingProp=p9s;function h9s(t,e){t.setParams({missingProperty:e},!0),t.error()}a(h9s,"reportMissingProp");Rl.reportMissingProp=h9s;function dWn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fd._)`Object.prototype.hasOwnProperty`})}a(dWn,"hasPropFunc");Rl.hasPropFunc=dWn;function Nlr(t,e,r){return(0,fd._)`${dWn(t)}.call(${e}, ${r})`}a(Nlr,"isOwnProperty");Rl.isOwnProperty=Nlr;function m9s(t,e,r,n){let o=(0,fd._)`${e}${(0,fd.getProperty)(r)} !== undefined`;return n?(0,fd._)`${o} && ${Nlr(t,e,r)}`:o}a(m9s,"propertyInData");Rl.propertyInData=m9s;function Mlr(t,e,r,n){let o=(0,fd._)`${e}${(0,fd.getProperty)(r)} === undefined`;return n?(0,fd.or)(o,(0,fd.not)(Nlr(t,e,r))):o}a(Mlr,"noPropertyInData");Rl.noPropertyInData=Mlr;function fWn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(fWn,"allSchemaProperties");Rl.allSchemaProperties=fWn;function g9s(t,e){return fWn(e).filter(r=>!(0,Dlr.alwaysValidSchema)(t,e[r]))}a(g9s,"schemaProperties");Rl.schemaProperties=g9s;function A9s({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,fd._)`${t}, ${e}, ${n}${o}`:e,h=[[mH.default.instancePath,(0,fd.strConcat)(mH.default.instancePath,s)],[mH.default.parentData,c.parentData],[mH.default.parentDataProperty,c.parentDataProperty],[mH.default.rootData,mH.default.rootData]];c.opts.dynamicRef&&h.push([mH.default.dynamicAnchors,mH.default.dynamicAnchors]);let m=(0,fd._)`${f}, ${r.object(...h)}`;return u!==fd.nil?(0,fd._)`${l}.call(${u}, ${m})`:(0,fd._)`${l}(${m})`}a(A9s,"callValidateCode");Rl.callValidateCode=A9s;var y9s=(0,fd._)`new RegExp`;function E9s({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,fd._)`${o.code==="new RegExp"?y9s:(0,d9s.useFunc)(t,o)}(${r}, ${n})`})}a(E9s,"usePattern");Rl.usePattern=E9s;function _9s(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,fd._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Dlr.Type.Num},s),e.if((0,fd.not)(s),l)})}a(c,"validateItems")}a(_9s,"validateArray");Rl.validateArray=_9s;function v9s(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,Dlr.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,fd._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,fd.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(v9s,"validateUnion");Rl.validateUnion=v9s});var mWn=I(z5=>{"use strict";p();Object.defineProperty(z5,"__esModule",{value:!0});z5.validateKeywordUsage=z5.validSchemaType=z5.funcKeywordCode=z5.macroKeywordCode=void 0;var gv=Es(),CX=h8(),C9s=Yw(),b9s=sDe();function S9s(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=hWn(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:gv.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(S9s,"macroKeywordCode");z5.macroKeywordCode=S9s;function T9s(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;x9s(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=hWn(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&&pWn(t),E(()=>t.error());else{let _=e.async?g():A();e.modifying&&pWn(t),E(()=>I9s(t,_))}}a(m,"validateKeyword");function g(){let _=n.let("ruleErrs",null);return n.try(()=>y((0,gv._)`await `),v=>n.assign(h,!1).if((0,gv._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(_,(0,gv._)`${v}.errors`),()=>n.throw(v))),_}a(g,"validateAsync");function A(){let _=(0,gv._)`${f}.errors`;return n.assign(_,null),y(gv.nil),_}a(A,"validateSync");function y(_=e.async?(0,gv._)`await `:gv.nil){let v=u.opts.passContext?CX.default.this:CX.default.self,b=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,gv._)`${_}${(0,C9s.callValidateCode)(t,f,v,b)}`,e.modifying)}a(y,"assignValid");function E(_){var v;n.if((0,gv.not)((v=e.valid)!==null&&v!==void 0?v:h),_)}a(E,"reportErrs")}a(T9s,"funcKeywordCode");z5.funcKeywordCode=T9s;function pWn(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,gv._)`${n.parentData}[${n.parentDataProperty}]`))}a(pWn,"modifyData");function I9s(t,e){let{gen:r}=t;r.if((0,gv._)`Array.isArray(${e})`,()=>{r.assign(CX.default.vErrors,(0,gv._)`${CX.default.vErrors} === null ? ${e} : ${CX.default.vErrors}.concat(${e})`).assign(CX.default.errors,(0,gv._)`${CX.default.vErrors}.length`),(0,b9s.extendErrors)(t)},()=>t.error())}a(I9s,"addErrs");function x9s({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(x9s,"checkAsyncKeyword");function hWn(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,gv.stringify)(r)})}a(hWn,"useKeyword");function w9s(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(w9s,"validSchemaType");z5.validSchemaType=w9s;function R9s({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(R9s,"validateKeywordUsage");z5.validateKeywordUsage=R9s});var AWn=I(gH=>{"use strict";p();Object.defineProperty(gH,"__esModule",{value:!0});gH.extendSubschemaMode=gH.extendSubschemaData=gH.getSubschema=void 0;var Y5=Es(),gWn=Ka();function k9s(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,Y5._)`${t.schemaPath}${(0,Y5.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Y5._)`${t.schemaPath}${(0,Y5.getProperty)(e)}${(0,Y5.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,gWn.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(k9s,"getSubschema");gH.getSubschema=k9s;function P9s(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,Y5._)`${e.data}${(0,Y5.getProperty)(r)}`,!0);u(m),t.errorPath=(0,Y5.str)`${d}${(0,gWn.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,Y5._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof Y5.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(P9s,"extendSubschemaData");gH.extendSubschemaData=P9s;function D9s(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(D9s,"extendSubschemaMode");gH.extendSubschemaMode=D9s});var Olr=I((vCf,yWn)=>{"use strict";p();yWn.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 _Wn=I((SCf,EWn)=>{"use strict";p();var AH=EWn.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(){};ict(e,n,o,t,"",t)};AH.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};AH.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};AH.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};AH.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 ict(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 AH.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(Tb,"__esModule",{value:!0});Tb.getSchemaRefs=Tb.resolveUrl=Tb.normalizeId=Tb._getFullPath=Tb.getFullPath=Tb.inlineRef=void 0;var M9s=Ka(),O9s=Olr(),L9s=_Wn(),B9s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function F9s(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Llr(t):e?vWn(t)<=e:!1}a(F9s,"inlineRef");Tb.inlineRef=F9s;var U9s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Llr(t){for(let e in t){if(U9s.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Llr)||typeof r=="object"&&Llr(r))return!0}return!1}a(Llr,"hasRef");function vWn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!B9s.has(r)&&(typeof t[r]=="object"&&(0,M9s.eachItem)(t[r],n=>e+=vWn(n)),e===1/0))return 1/0}return e}a(vWn,"countKeys");function CWn(t,e="",r){r!==!1&&(e=nhe(e));let n=t.parse(e);return bWn(t,n)}a(CWn,"getFullPath");Tb.getFullPath=CWn;function bWn(t,e){return t.serialize(e).split("#")[0]+"#"}a(bWn,"_getFullPath");Tb._getFullPath=bWn;var Q9s=/#\/?$/;function nhe(t){return t?t.replace(Q9s,""):""}a(nhe,"normalizeId");Tb.normalizeId=nhe;function q9s(t,e,r){return r=nhe(r),t.resolve(e,r)}a(q9s,"resolveUrl");Tb.resolveUrl=q9s;var j9s=/^[a-z_][-a-z0-9._]*$/i;function H9s(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=nhe(t[r]||e),s={"":o},c=CWn(n,o,!1),l={},u=new Set;return L9s(t,{allKeys:!0},(h,m,g,A)=>{if(A===void 0)return;let y=c+m,E=s[A];typeof h[r]=="string"&&(E=_.call(this,h[r])),v.call(this,h.$anchor),v.call(this,h.$dynamicAnchor),s[m]=E;function _(b){let T=this.opts.uriResolver.resolve;if(b=nhe(E?T(E,b):b),u.has(b))throw f(b);u.add(b);let w=this.refs[b];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?d(h,w.schema,b):b!==nhe(y)&&(b[0]==="#"?(d(h,l[b],b),l[b]=h):this.refs[b]=y),b}a(_,"addRef");function v(b){if(typeof b=="string"){if(!j9s.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!O9s(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(H9s,"getSchemaRefs");Tb.getSchemaRefs=H9s});var dDe=I(yH=>{"use strict";p();Object.defineProperty(yH,"__esModule",{value:!0});yH.getData=yH.KeywordCxt=yH.validateFunctionCode=void 0;var wWn=nWn(),SWn=aDe(),Flr=wlr(),oct=aDe(),G9s=uWn(),uDe=mWn(),Blr=AWn(),oi=Es(),po=h8(),$9s=cDe(),m8=Ka(),lDe=sDe();function V9s(t){if(PWn(t)&&(DWn(t),kWn(t))){Y9s(t);return}RWn(t,()=>(0,wWn.topBoolOrEmptySchema)(t))}a(V9s,"validateFunctionCode");yH.validateFunctionCode=V9s;function RWn({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,oi._)`${po.default.data}, ${po.default.valCxt}`,n.$async,()=>{t.code((0,oi._)`"use strict"; ${TWn(r,o)}`),z9s(t,o),t.code(s)}):t.func(e,(0,oi._)`${po.default.data}, ${W9s(o)}`,n.$async,()=>t.code(TWn(r,o)).code(s))}a(RWn,"validateFunction");function W9s(t){return(0,oi._)`{${po.default.instancePath}="", ${po.default.parentData}, ${po.default.parentDataProperty}, ${po.default.rootData}=${po.default.data}${t.dynamicRef?(0,oi._)`, ${po.default.dynamicAnchors}={}`:oi.nil}}={}`}a(W9s,"destructureValCxt");function z9s(t,e){t.if(po.default.valCxt,()=>{t.var(po.default.instancePath,(0,oi._)`${po.default.valCxt}.${po.default.instancePath}`),t.var(po.default.parentData,(0,oi._)`${po.default.valCxt}.${po.default.parentData}`),t.var(po.default.parentDataProperty,(0,oi._)`${po.default.valCxt}.${po.default.parentDataProperty}`),t.var(po.default.rootData,(0,oi._)`${po.default.valCxt}.${po.default.rootData}`),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,oi._)`${po.default.valCxt}.${po.default.dynamicAnchors}`)},()=>{t.var(po.default.instancePath,(0,oi._)`""`),t.var(po.default.parentData,(0,oi._)`undefined`),t.var(po.default.parentDataProperty,(0,oi._)`undefined`),t.var(po.default.rootData,po.default.data),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,oi._)`{}`)})}a(z9s,"destructureValCxtES5");function Y9s(t){let{schema:e,opts:r,gen:n}=t;RWn(t,()=>{r.$comment&&e.$comment&&MWn(t),eUs(t),n.let(po.default.vErrors,null),n.let(po.default.errors,0),r.unevaluated&&K9s(t),NWn(t),nUs(t)})}a(Y9s,"topSchemaObjCode");function K9s(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,oi._)`${r}.evaluated`),e.if((0,oi._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,oi._)`${t.evaluated}.props`,(0,oi._)`undefined`)),e.if((0,oi._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,oi._)`${t.evaluated}.items`,(0,oi._)`undefined`))}a(K9s,"resetEvaluated");function TWn(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,oi._)`/*# sourceURL=${r} */`:oi.nil}a(TWn,"funcSourceUrl");function J9s(t,e){if(PWn(t)&&(DWn(t),kWn(t))){Z9s(t,e);return}(0,wWn.boolOrEmptySchema)(t,e)}a(J9s,"subschemaCode");function kWn({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(kWn,"schemaCxtHasRules");function PWn(t){return typeof t.schema!="boolean"}a(PWn,"isSchemaObj");function Z9s(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&MWn(t),tUs(t),rUs(t);let s=n.const("_errs",po.default.errors);NWn(t,s),n.var(e,(0,oi._)`${s} === ${po.default.errors}`)}a(Z9s,"subSchemaObjCode");function DWn(t){(0,m8.checkUnknownRules)(t),X9s(t)}a(DWn,"checkKeywords");function NWn(t,e){if(t.opts.jtd)return IWn(t,[],!1,e);let r=(0,SWn.getSchemaTypes)(t.schema),n=(0,SWn.coerceAndCheckDataType)(t,r);IWn(t,r,!n,e)}a(NWn,"typeAndKeywords");function X9s(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,m8.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(X9s,"checkRefsAndKeywords");function eUs(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,m8.checkStrictMode)(t,"default is ignored in the schema root")}a(eUs,"checkNoDefault");function tUs(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,$9s.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(tUs,"updateContext");function rUs(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(rUs,"checkAsyncSchema");function MWn({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,oi._)`${po.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let c=(0,oi.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,oi._)`${po.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(MWn,"commentKeyword");function nUs(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,oi._)`${po.default.errors} === 0`,()=>e.return(po.default.data),()=>e.throw((0,oi._)`new ${o}(${po.default.vErrors})`)):(e.assign((0,oi._)`${n}.errors`,po.default.vErrors),s.unevaluated&&iUs(t),e.return((0,oi._)`${po.default.errors} === 0`))}a(nUs,"returnResults");function iUs({gen:t,evaluated:e,props:r,items:n}){r instanceof oi.Name&&t.assign((0,oi._)`${e}.props`,r),n instanceof oi.Name&&t.assign((0,oi._)`${e}.items`,n)}a(iUs,"assignEvaluated");function IWn(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,m8.schemaHasRulesButRef)(s,f))){o.block(()=>LWn(t,"$ref",f.all.$ref.definition));return}u.jtd||oUs(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,Flr.shouldUseGroup)(s,m)&&(m.type?(o.if((0,oct.checkDataType)(m.type,c,u.strictNumbers)),xWn(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,oct.reportTypeError)(t)),o.endIf()):xWn(t,m),l||o.if((0,oi._)`${po.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(IWn,"schemaKeywords");function xWn(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,G9s.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Flr.shouldUseRule)(n,s)&&LWn(t,s.keyword,s.definition,e.type)})}a(xWn,"iterateKeywords");function oUs(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(sUs(t,e),t.opts.allowUnionTypes||aUs(t,e),cUs(t,t.dataTypes))}a(oUs,"checkStrictTypes");function sUs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{OWn(t.dataTypes,r)||Ulr(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),uUs(t,e)}}a(sUs,"checkContextTypes");function aUs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Ulr(t,"use allowUnionTypes to allow union type keyword")}a(aUs,"checkMultipleTypes");function cUs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Flr.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>lUs(e,c))&&Ulr(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(cUs,"checkKeywordTypes");function lUs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(lUs,"hasApplicableType");function OWn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(OWn,"includesType");function uUs(t,e){let r=[];for(let n of t.dataTypes)OWn(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(uUs,"narrowSchemaTypes");function Ulr(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,m8.checkStrictMode)(t,e,t.opts.strictTypes)}a(Ulr,"strictTypesError");var sct=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,uDe.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,m8.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",BWn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,uDe.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",po.default.errors))}result(e,r,n){this.failResult((0,oi.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,oi.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,oi._)`${r} !== undefined && (${(0,oi.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?lDe.reportExtraError:lDe.reportError)(this,this.def.error,r)}$dataError(){(0,lDe.reportError)(this,this.def.$dataError||lDe.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,lDe.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=oi.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=oi.nil,r=oi.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:c}=this;n.if((0,oi.or)((0,oi._)`${o} === undefined`,r)),e!==oi.nil&&n.assign(e,!0),(s.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==oi.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,oi.or)(c(),l());function c(){if(n.length){if(!(r instanceof oi.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,oi._)`${(0,oct.checkDataTypes)(u,r,s.opts.strictNumbers,oct.DataType.Wrong)}`}return oi.nil}function l(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,oi._)`!${u}(${r})`}return oi.nil}}subschema(e,r){let n=(0,Blr.getSubschema)(this.it,e);(0,Blr.extendSubschemaData)(n,this.it,e),(0,Blr.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return J9s(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=m8.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=m8.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,oi.Name)),!0}};yH.KeywordCxt=sct;function LWn(t,e,r,n){let o=new sct(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,uDe.funcKeywordCode)(o,r):"macro"in r?(0,uDe.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,uDe.funcKeywordCode)(o,r)}a(LWn,"keywordCode");var dUs=/^\/(?:[^~]|~0|~1)*$/,fUs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function BWn(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return po.default.rootData;if(t[0]==="/"){if(!dUs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=po.default.rootData}else{let d=fUs.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,oi._)`${s}${(0,oi.getProperty)((0,m8.unescapeJsonPointer)(d))}`,c=(0,oi._)`${c} && ${s}`);return c;function u(d,f){return`Cannot access ${d} ${f} levels up, current level is ${e}`}}a(BWn,"getData");yH.getData=BWn});var act=I(qlr=>{"use strict";p();Object.defineProperty(qlr,"__esModule",{value:!0});var Qlr=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};qlr.default=Qlr});var fDe=I(Glr=>{"use strict";p();Object.defineProperty(Glr,"__esModule",{value:!0});var jlr=cDe(),Hlr=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,jlr.resolveUrl)(e,r,n),this.missingSchema=(0,jlr.normalizeId)((0,jlr.getFullPath)(e,this.missingRef))}};Glr.default=Hlr});var lct=I(Kw=>{"use strict";p();Object.defineProperty(Kw,"__esModule",{value:!0});Kw.resolveSchema=Kw.getCompilingSchema=Kw.resolveRef=Kw.compileSchema=Kw.SchemaEnv=void 0;var M2=Es(),pUs=act(),bX=h8(),O2=cDe(),FWn=Ka(),hUs=dDe(),ihe=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,O2.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Kw.SchemaEnv=ihe;function Vlr(t){let e=UWn.call(this,t);if(e)return e;let r=(0,O2.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new M2.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:pUs.default,code:(0,M2._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:bX.default.data,parentData:bX.default.parentData,parentDataProperty:bX.default.parentDataProperty,dataNames:[bX.default.data],dataPathArr:[M2.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,M2.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:M2.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,M2._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,hUs.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(bX.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${bX.default.self}`,`${bX.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 M2.Name?void 0:A,items:y instanceof M2.Name?void 0:y,dynamicProps:A instanceof M2.Name,dynamicItems:y instanceof M2.Name},g.source&&(g.source.evaluated=(0,M2.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(Vlr,"compileSchema");Kw.compileSchema=Vlr;function mUs(t,e,r){var n;r=(0,O2.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=yUs.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 ihe({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=gUs.call(this,s)}a(mUs,"resolveRef");Kw.resolveRef=mUs;function gUs(t){return(0,O2.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Vlr.call(this,t)}a(gUs,"inlineOrCompile");function UWn(t){for(let e of this._compilations)if(AUs(e,t))return e}a(UWn,"getCompilingSchema");Kw.getCompilingSchema=UWn;function AUs(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(AUs,"sameSchemaEnv");function yUs(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||cct.call(this,t,e)}a(yUs,"resolve");function cct(t,e){let r=this.opts.uriResolver.parse(e),n=(0,O2._getFullPath)(this.opts.uriResolver,r),o=(0,O2.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return $lr.call(this,r,t);let s=(0,O2.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=cct.call(this,t,c);return typeof l?.schema!="object"?void 0:$lr.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||Vlr.call(this,c),s===(0,O2.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,O2.resolveUrl)(this.opts.uriResolver,o,d)),new ihe({schema:l,schemaId:u,root:t,baseId:o})}return $lr.call(this,r,c)}}a(cct,"resolveSchema");Kw.resolveSchema=cct;var EUs=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $lr(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,FWn.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!EUs.has(l)&&d&&(e=(0,O2.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,FWn.schemaHasRulesButRef)(r,this.RULES)){let l=(0,O2.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=cct.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new ihe({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a($lr,"getJsonPointer")});var QWn=I((jCf,_Us)=>{_Us.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 Ylr=I((HCf,VWn)=>{"use strict";p();var vUs=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),jWn=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),Wlr=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),HWn=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),CUs=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function zlr(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(zlr,"stringArrayToHexStripped");var bUs=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function qWn(t){return t.length=0,!0}a(qWn,"consumeIsZone");function SUs(t,e,r){if(t.length){let n=zlr(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(SUs,"consumeHextets");function TUs(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=SUs;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=qWn}else{o.push(d);continue}}return o.length&&(l===qWn?r.zone=o.join(""):c?n.push(o.join("")):n.push(zlr(o))),r.address=n.join(""),r}a(TUs,"getIPV6");function GWn(t){if(IUs(t,":")<2)return{host:t,isIPV6:!1};let e=TUs(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(GWn,"normalizeIPv6");function IUs(t,e){let r=0;for(let n=0;nwUs[n])}a($Wn,"reescapeHostDelimiters");function PUs(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:OUs}=Ylr(),LUs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,BUs=["http","https","ws","wss","urn","urn:uuid"];function FUs(t){return BUs.indexOf(t)!==-1}a(FUs,"isValidSchemeName");function Klr(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(Klr,"wsIsSecure");function WWn(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(WWn,"httpParse");function zWn(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(zWn,"httpSerialize");function UUs(t){return t.secure=Klr(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(UUs,"wsParse");function QUs(t){if((t.port===(Klr(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(QUs,"wsSerialize");function qUs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(LUs);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=Jlr(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(qUs,"urnParse");function jUs(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=Jlr(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(jUs,"urnSerialize");function HUs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!OUs(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a(HUs,"urnuuidParse");function GUs(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(GUs,"urnuuidSerialize");var YWn={scheme:"http",domainHost:!0,parse:WWn,serialize:zWn},$Us={scheme:"https",domainHost:YWn.domainHost,parse:WWn,serialize:zWn},uct={scheme:"ws",domainHost:!0,parse:UUs,serialize:QUs},VUs={scheme:"wss",domainHost:uct.domainHost,parse:uct.parse,serialize:uct.serialize},WUs={scheme:"urn",parse:qUs,serialize:jUs,skipNormalize:!0},zUs={scheme:"urn:uuid",parse:HUs,serialize:GUs,skipNormalize:!0},dct={http:YWn,https:$Us,ws:uct,wss:VUs,urn:WUs,"urn:uuid":zUs};Object.setPrototypeOf(dct,null);function Jlr(t){return t&&(dct[t]||dct[t.toLowerCase()])||void 0}a(Jlr,"getSchemeHandler");KWn.exports={wsIsSecure:Klr,SCHEMES:dct,isValidSchemeName:FUs,getSchemeHandler:Jlr}});var nzn=I((YCf,fct)=>{"use strict";p();var{normalizeIPv6:YUs,removeDotSegments:pDe,recomposeAuthority:KUs,normalizePercentEncoding:JUs,normalizePathEncoding:ZUs,escapePreservingEscapes:XUs,reescapeHostDelimiters:e7s,isIPv4:t7s,nonSimpleDomain:r7s}=Ylr(),{SCHEMES:n7s,getSchemeHandler:XWn}=JWn();function i7s(t,e){return typeof t=="string"?t=l7s(t,e):typeof t=="object"&&(t=ohe(SX(t,e),e)),t}a(i7s,"normalize");function o7s(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=ezn(ohe(t,n),ohe(e,n),n,!0);return n.skipEscape=!0,SX(o,n)}a(o7s,"resolve");function ezn(t,e,r,n){let o={};return n||(t=ohe(SX(t,r),r),e=ohe(SX(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=pDe(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=pDe(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=pDe(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=pDe(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(ezn,"resolveComponent");function s7s(t,e,r){let n=ZWn(t,r),o=ZWn(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(s7s,"equal");function SX(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=XWn(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=JUs(r.path):(r.path=XUs(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=KUs(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=pDe(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(SX,"serialize");var a7s=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function c7s(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(c7s,"getParseError");function tzn(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(a7s);if(c){n.scheme=c[1],n.userinfo=c[3],n.host=c[4],n.port=parseInt(c[5],10),n.path=c[6]||"",n.query=c[7],n.fragment=c[8],isNaN(n.port)&&(n.port=c[5]);let l=c7s(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(t7s(n.host)===!1){let f=YUs(n.host);n.host=f.host.toLowerCase(),s=f.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 u=XWn(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&r7s(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!u||u&&!u.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=e7s(unescape(n.host),s))),n.path&&(n.path=ZUs(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}u&&u.parse&&u.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}a(tzn,"parseWithStatus");function ohe(t,e){return tzn(t,e).parsed}a(ohe,"parse");function l7s(t,e){return rzn(t,e).normalized}a(l7s,"normalizeString");function rzn(t,e){let{parsed:r,malformedAuthorityOrPort:n}=tzn(t,e);return{normalized:n?t:SX(r,e),malformedAuthorityOrPort:n}}a(rzn,"normalizeStringWithStatus");function ZWn(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=rzn(t,e);return n?void 0:r}if(typeof t=="object")return SX(t,e)}a(ZWn,"normalizeComparableURI");var Zlr={SCHEMES:n7s,normalize:i7s,resolve:o7s,resolveComponent:ezn,equal:s7s,serialize:SX,parse:ohe};fct.exports=Zlr;fct.exports.default=Zlr;fct.exports.fastUri=Zlr});var ozn=I(Xlr=>{"use strict";p();Object.defineProperty(Xlr,"__esModule",{value:!0});var izn=nzn();izn.code='require("ajv/dist/runtime/uri").default';Xlr.default=izn});var pzn=I(ZA=>{"use strict";p();Object.defineProperty(ZA,"__esModule",{value:!0});ZA.CodeGen=ZA.Name=ZA.nil=ZA.stringify=ZA.str=ZA._=ZA.KeywordCxt=void 0;var u7s=dDe();Object.defineProperty(ZA,"KeywordCxt",{enumerable:!0,get:a(function(){return u7s.KeywordCxt},"get")});var she=Es();Object.defineProperty(ZA,"_",{enumerable:!0,get:a(function(){return she._},"get")});Object.defineProperty(ZA,"str",{enumerable:!0,get:a(function(){return she.str},"get")});Object.defineProperty(ZA,"stringify",{enumerable:!0,get:a(function(){return she.stringify},"get")});Object.defineProperty(ZA,"nil",{enumerable:!0,get:a(function(){return she.nil},"get")});Object.defineProperty(ZA,"Name",{enumerable:!0,get:a(function(){return she.Name},"get")});Object.defineProperty(ZA,"CodeGen",{enumerable:!0,get:a(function(){return she.CodeGen},"get")});var d7s=act(),uzn=fDe(),f7s=xlr(),hDe=lct(),p7s=Es(),mDe=cDe(),pct=aDe(),tur=Ka(),szn=QWn(),h7s=ozn(),dzn=a((t,e)=>new RegExp(t,e),"defaultRegExp");dzn.code="new RegExp";var m7s=["removeAdditional","useDefaults","coerceTypes"],g7s=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),A7s={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."},y7s={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},azn=200;function E7s(t){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D;let N=t.strict,L=(e=t.code)===null||e===void 0?void 0:e.optimize,B=L===!0||L===void 0?1:L||0,q=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:dzn,M=(o=t.uriResolver)!==null&&o!==void 0?o:h7s.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:azn,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:azn,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=t.inlineRefs)!==null&&b!==void 0?b:!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:(P=t.unicodeRegExp)!==null&&P!==void 0?P:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:M}}a(E7s,"requiredOptions");var gDe=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,...E7s(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new p7s.ValueScope({scope:{},prefixes:g7s,es5:r,lines:n}),this.logger=T7s(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,f7s.getRules)(),czn.call(this,A7s,e,"NOT SUPPORTED"),czn.call(this,y7s,e,"DEPRECATED","warn"),this._metaOpts=b7s.call(this),e.formats&&v7s.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&C7s.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),_7s.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=szn;n==="id"&&(o={...szn},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 uzn.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,mDe.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=lzn.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new hDe.SchemaEnv({schema:{},schemaId:n});if(r=hDe.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=lzn.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,mDe.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(x7s.call(this,n,r),!r)return(0,tur.eachItem)(n,s=>eur.call(this,s)),this;R7s.call(this,r);let o={...r,type:(0,pct.getJSONTypes)(r.type),schemaType:(0,pct.getJSONTypes)(r.schemaType)};return(0,tur.eachItem)(n,o.type.length===0?s=>eur.call(this,s,o):s=>o.type.forEach(c=>eur.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]=fzn(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,mDe.normalizeId)(c||n);let d=mDe.getSchemaRefs.call(this,e,n);return u=new hDe.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):hDe.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{hDe.compileSchema.call(this,e)}finally{this.opts=r}}};gDe.ValidationError=d7s.default;gDe.MissingRefError=uzn.default;ZA.default=gDe;function czn(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(czn,"checkOptions");function lzn(t){return t=(0,mDe.normalizeId)(t),this.schemas[t]||this.refs[t]}a(lzn,"getSchEnv");function _7s(){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(_7s,"addInitialSchemas");function v7s(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(v7s,"addInitialFormats");function C7s(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(C7s,"addInitialKeywords");function b7s(){let t={...this.opts};for(let e of m7s)delete t[e];return t}a(b7s,"getMetaSchemaOptions");var S7s={log(){},warn(){},error(){}};function T7s(t){if(t===!1)return S7s;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(T7s,"getLogger");var I7s=/^[a-z_$][a-z0-9_$:-]*$/i;function x7s(t,e){let{RULES:r}=this;if((0,tur.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!I7s.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(x7s,"checkKeyword");function eur(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,pct.getJSONTypes)(e.type),schemaType:(0,pct.getJSONTypes)(e.schemaType)}};e.before?w7s.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(eur,"addRule");function w7s(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(w7s,"addBeforeRule");function R7s(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=fzn(e)),t.validateSchema=this.compile(e,!0))}a(R7s,"keywordMetaschema");var k7s={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function fzn(t){return{anyOf:[t,k7s]}}a(fzn,"schemaOrData")});var hzn=I(rur=>{"use strict";p();Object.defineProperty(rur,"__esModule",{value:!0});var P7s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};rur.default=P7s});var yzn=I(TX=>{"use strict";p();Object.defineProperty(TX,"__esModule",{value:!0});TX.callRef=TX.getValidate=void 0;var D7s=fDe(),mzn=Yw(),Ib=Es(),ahe=h8(),gzn=lct(),hct=Ka(),N7s={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=gzn.resolveRef.call(u,d,o,r);if(f===void 0)throw new D7s.default(n.opts.uriResolver,o,r);if(f instanceof gzn.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return mct(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return mct(t,(0,Ib._)`${A}.validate`,d,d.$async)}function m(A){let y=Azn(t,A);mct(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,Ib.stringify)(A)}:{ref:A}),E=e.name("valid"),_=t.subschema({schema:A,dataTypes:[],schemaPath:Ib.nil,topSchemaRef:y,errSchemaPath:r},E);t.mergeEvaluated(_),t.ok(E)}}};function Azn(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ib._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(Azn,"getValidate");TX.getValidate=Azn;function mct(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?ahe.default.this:Ib.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,Ib._)`await ${(0,mzn.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,Ib._)`!(${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,mzn.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,Ib._)`${A}.errors`;o.assign(ahe.default.vErrors,(0,Ib._)`${ahe.default.vErrors} === null ? ${y} : ${ahe.default.vErrors}.concat(${y})`),o.assign(ahe.default.errors,(0,Ib._)`${ahe.default.vErrors}.length`)}a(m,"addErrorsFrom");function g(A){var y;if(!s.opts.unevaluated)return;let E=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=hct.mergeEvaluated.props(o,E.props,s.props));else{let _=o.var("props",(0,Ib._)`${A}.evaluated.props`);s.props=hct.mergeEvaluated.props(o,_,s.props,Ib.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=hct.mergeEvaluated.items(o,E.items,s.items));else{let _=o.var("items",(0,Ib._)`${A}.evaluated.items`);s.items=hct.mergeEvaluated.items(o,_,s.items,Ib.Name)}}a(g,"addEvaluatedFrom")}a(mct,"callRef");TX.callRef=mct;TX.default=N7s});var Ezn=I(nur=>{"use strict";p();Object.defineProperty(nur,"__esModule",{value:!0});var M7s=hzn(),O7s=yzn(),L7s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",M7s.default,O7s.default];nur.default=L7s});var _zn=I(iur=>{"use strict";p();Object.defineProperty(iur,"__esModule",{value:!0});var gct=Es(),EH=gct.operators,Act={maximum:{okStr:"<=",ok:EH.LTE,fail:EH.GT},minimum:{okStr:">=",ok:EH.GTE,fail:EH.LT},exclusiveMaximum:{okStr:"<",ok:EH.LT,fail:EH.GTE},exclusiveMinimum:{okStr:">",ok:EH.GT,fail:EH.LTE}},B7s={message:a(({keyword:t,schemaCode:e})=>(0,gct.str)`must be ${Act[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,gct._)`{comparison: ${Act[t].okStr}, limit: ${e}}`,"params")},F7s={keyword:Object.keys(Act),type:"number",schemaType:"number",$data:!0,error:B7s,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,gct._)`${r} ${Act[e].fail} ${n} || isNaN(${r})`)}};iur.default=F7s});var vzn=I(our=>{"use strict";p();Object.defineProperty(our,"__esModule",{value:!0});var ADe=Es(),U7s={message:a(({schemaCode:t})=>(0,ADe.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,ADe._)`{multipleOf: ${t}}`,"params")},Q7s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:U7s,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,ADe._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,ADe._)`${c} !== parseInt(${c})`;t.fail$data((0,ADe._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};our.default=Q7s});var bzn=I(sur=>{"use strict";p();Object.defineProperty(sur,"__esModule",{value:!0});function Czn(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(aur,"__esModule",{value:!0});var IX=Es(),q7s=Ka(),j7s=bzn(),H7s={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,IX.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,IX._)`{limit: ${t}}`,"params")},G7s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:H7s,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?IX.operators.GT:IX.operators.LT,c=o.opts.unicode===!1?(0,IX._)`${r}.length`:(0,IX._)`${(0,q7s.useFunc)(t.gen,j7s.default)}(${r})`;t.fail$data((0,IX._)`${c} ${s} ${n}`)}};aur.default=G7s});var Tzn=I(cur=>{"use strict";p();Object.defineProperty(cur,"__esModule",{value:!0});var $7s=Yw(),V7s=Ka(),che=Es(),W7s={message:a(({schemaCode:t})=>(0,che.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,che._)`{pattern: ${t}}`,"params")},z7s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:W7s,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,che._)`new RegExp`:(0,V7s.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,che._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,che._)`!${f}`)}else{let u=(0,$7s.usePattern)(t,o);t.fail$data((0,che._)`!${u}.test(${r})`)}}};cur.default=z7s});var Izn=I(lur=>{"use strict";p();Object.defineProperty(lur,"__esModule",{value:!0});var yDe=Es(),Y7s={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,yDe.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,yDe._)`{limit: ${t}}`,"params")},K7s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Y7s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?yDe.operators.GT:yDe.operators.LT;t.fail$data((0,yDe._)`Object.keys(${r}).length ${o} ${n}`)}};lur.default=K7s});var xzn=I(uur=>{"use strict";p();Object.defineProperty(uur,"__esModule",{value:!0});var EDe=Yw(),_De=Es(),J7s=Ka(),Z7s={message:a(({params:{missingProperty:t}})=>(0,_De.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,_De._)`{missingProperty: ${t}}`,"params")},X7s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Z7s,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 E=c.schemaEnv.baseId+c.errSchemaPath,_=`required property "${y}" is not defined at "${E}" (strictRequired)`;(0,J7s.checkStrictMode)(c,_,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(_De.nil,h);else for(let g of r)(0,EDe.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,EDe.checkMissingProp)(t,r,g)),(0,EDe.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,EDe.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,EDe.propertyInData)(e,o,g,l.ownProperties)),e.if((0,_De.not)(A),()=>{t.error(),e.break()})},_De.nil)}a(m,"loopUntilMissing")}};uur.default=X7s});var wzn=I(dur=>{"use strict";p();Object.defineProperty(dur,"__esModule",{value:!0});var vDe=Es(),eQs={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,vDe.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,vDe._)`{limit: ${t}}`,"params")},tQs={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:eQs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?vDe.operators.GT:vDe.operators.LT;t.fail$data((0,vDe._)`${r}.length ${o} ${n}`)}};dur.default=tQs});var yct=I(fur=>{"use strict";p();Object.defineProperty(fur,"__esModule",{value:!0});var Rzn=Olr();Rzn.code='require("ajv/dist/runtime/equal").default';fur.default=Rzn});var kzn=I(hur=>{"use strict";p();Object.defineProperty(hur,"__esModule",{value:!0});var pur=aDe(),XA=Es(),rQs=Ka(),nQs=yct(),iQs={message:a(({params:{i:t,j:e}})=>(0,XA.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,XA._)`{i: ${t}, j: ${e}}`,"params")},oQs={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:iQs,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,pur.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,XA._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,XA._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,XA._)`${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=e.name("item"),_=(0,pur.checkDataTypes)(d,E,l.opts.strictNumbers,pur.DataType.Wrong),v=e.const("indices",(0,XA._)`{}`);e.for((0,XA._)`;${A}--;`,()=>{e.let(E,(0,XA._)`${r}[${A}]`),e.if(_,(0,XA._)`continue`),d.length>1&&e.if((0,XA._)`typeof ${E} == "string"`,(0,XA._)`${E} += "_"`),e.if((0,XA._)`typeof ${v}[${E}] == "number"`,()=>{e.assign(y,(0,XA._)`${v}[${E}]`),t.error(),e.assign(u,!1).break()}).code((0,XA._)`${v}[${E}] = ${A}`)})}a(m,"loopN");function g(A,y){let E=(0,rQs.useFunc)(e,nQs.default),_=e.name("outer");e.label(_).for((0,XA._)`;${A}--;`,()=>e.for((0,XA._)`${y} = ${A}; ${y}--;`,()=>e.if((0,XA._)`${E}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(_)})))}a(g,"loopN2")}};hur.default=oQs});var Pzn=I(gur=>{"use strict";p();Object.defineProperty(gur,"__esModule",{value:!0});var mur=Es(),sQs=Ka(),aQs=yct(),cQs={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,mur._)`{allowedValue: ${t}}`,"params")},lQs={keyword:"const",$data:!0,error:cQs,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,mur._)`!${(0,sQs.useFunc)(e,aQs.default)}(${r}, ${o})`):t.fail((0,mur._)`${s} !== ${r}`)}};gur.default=lQs});var Dzn=I(Aur=>{"use strict";p();Object.defineProperty(Aur,"__esModule",{value:!0});var CDe=Es(),uQs=Ka(),dQs=yct(),fQs={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,CDe._)`{allowedValues: ${t}}`,"params")},pQs={keyword:"enum",schemaType:"array",$data:!0,error:fQs,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,uQs.useFunc)(e,dQs.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,CDe.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,CDe._)`${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,CDe._)`${d()}(${r}, ${g}[${A}])`:(0,CDe._)`${r} === ${y}`}a(m,"equalCode")}};Aur.default=pQs});var Nzn=I(yur=>{"use strict";p();Object.defineProperty(yur,"__esModule",{value:!0});var hQs=_zn(),mQs=vzn(),gQs=Szn(),AQs=Tzn(),yQs=Izn(),EQs=xzn(),_Qs=wzn(),vQs=kzn(),CQs=Pzn(),bQs=Dzn(),SQs=[hQs.default,mQs.default,gQs.default,AQs.default,yQs.default,EQs.default,_Qs.default,vQs.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},CQs.default,bQs.default];yur.default=SQs});var _ur=I(bDe=>{"use strict";p();Object.defineProperty(bDe,"__esModule",{value:!0});bDe.validateAdditionalItems=void 0;var xX=Es(),Eur=Ka(),TQs={message:a(({params:{len:t}})=>(0,xX.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,xX._)`{limit: ${t}}`,"params")},IQs={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:TQs,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Eur.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Mzn(t,n)}};function Mzn(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,xX._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,xX._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Eur.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,xX._)`${l} <= ${e.length}`);r.if((0,xX.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:Eur.Type.Num},d),c.allErrors||r.if((0,xX.not)(d),()=>r.break())})}a(u,"validateItems")}a(Mzn,"validateAdditionalItems");bDe.validateAdditionalItems=Mzn;bDe.default=IQs});var vur=I(SDe=>{"use strict";p();Object.defineProperty(SDe,"__esModule",{value:!0});SDe.validateTuple=void 0;var Ozn=Es(),Ect=Ka(),xQs=Yw(),wQs={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Lzn(t,"additionalItems",e);r.items=!0,!(0,Ect.alwaysValidSchema)(r,e)&&t.ok((0,xQs.validateArray)(t))}};function Lzn(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=Ect.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,Ozn._)`${s}.length`);r.forEach((h,m)=>{(0,Ect.alwaysValidSchema)(l,h)||(n.if((0,Ozn._)`${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 E=`"${c}" is ${A}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,Ect.checkStrictMode)(l,E,m.strictTuples)}}a(f,"checkStrictTuple")}a(Lzn,"validateTuple");SDe.validateTuple=Lzn;SDe.default=wQs});var Bzn=I(Cur=>{"use strict";p();Object.defineProperty(Cur,"__esModule",{value:!0});var RQs=vur(),kQs={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,RQs.validateTuple)(t,"items"),"code")};Cur.default=kQs});var Uzn=I(bur=>{"use strict";p();Object.defineProperty(bur,"__esModule",{value:!0});var Fzn=Es(),PQs=Ka(),DQs=Yw(),NQs=_ur(),MQs={message:a(({params:{len:t}})=>(0,Fzn.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,Fzn._)`{limit: ${t}}`,"params")},OQs={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:MQs,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,PQs.alwaysValidSchema)(n,e)&&(o?(0,NQs.validateAdditionalItems)(t,o):t.ok((0,DQs.validateArray)(t)))}};bur.default=OQs});var Qzn=I(Sur=>{"use strict";p();Object.defineProperty(Sur,"__esModule",{value:!0});var Jw=Es(),_ct=Ka(),LQs={message:a(({params:{min:t,max:e}})=>e===void 0?(0,Jw.str)`must contain at least ${t} valid item(s)`:(0,Jw.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,Jw._)`{minContains: ${t}}`:(0,Jw._)`{minContains: ${t}, maxContains: ${e}}`,"params")},BQs={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:LQs,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,Jw._)`${o}.length`);if(t.setParams({min:c,max:l}),l===void 0&&c===0){(0,_ct.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,_ct.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,_ct.alwaysValidSchema)(s,r)){let y=(0,Jw._)`${f} >= ${c}`;l!==void 0&&(y=(0,Jw._)`${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,Jw._)`${o}.length > 0`,m)):(e.let(h,!1),m()),t.result(h,()=>t.reset());function m(){let y=e.name("_valid"),E=e.let("count",0);g(y,()=>e.if(y,()=>A(E)))}a(m,"validateItemsWithCount");function g(y,E){e.forRange("i",0,f,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:_ct.Type.Num,compositeRule:!0},y),E()})}a(g,"validateItems");function A(y){e.code((0,Jw._)`${y}++`),l===void 0?e.if((0,Jw._)`${y} >= ${c}`,()=>e.assign(h,!0).break()):(e.if((0,Jw._)`${y} > ${l}`,()=>e.assign(h,!1).break()),c===1?e.assign(h,!0):e.if((0,Jw._)`${y} >= ${c}`,()=>e.assign(h,!0)))}a(A,"checkLimits")}};Sur.default=BQs});var Hzn=I(K5=>{"use strict";p();Object.defineProperty(K5,"__esModule",{value:!0});K5.validateSchemaDeps=K5.validatePropertyDeps=K5.error=void 0;var Tur=Es(),FQs=Ka(),TDe=Yw();K5.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Tur.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Tur._)`{property: ${t}, missingProperty: ${n}, depsCount: ${e}, - deps: ${r}}`,"params")};var MQs={keyword:"dependencies",type:"object",schemaType:"object",error:K5.error,code(t){let[e,r]=OQs(t);Qzn(t,e),qzn(t,r)}};function OQs({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(OQs,"splitDependencies");function Qzn(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,TDe.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,TDe.checkReportMissingProp)(t,d)}):(r.if((0,Sur._)`${u} && (${(0,TDe.checkMissingProp)(t,l,s)})`),(0,TDe.reportMissingProp)(t,s),r.else())}}a(Qzn,"validatePropertyDeps");K5.validatePropertyDeps=Qzn;function qzn(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,NQs.alwaysValidSchema)(s,e[l])||(r.if((0,TDe.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(qzn,"validateSchemaDeps");K5.validateSchemaDeps=qzn;K5.default=MQs});var Gzn=I(Tur=>{"use strict";p();Object.defineProperty(Tur,"__esModule",{value:!0});var Hzn=Es(),LQs=Ka(),BQs={message:"property name must be valid",params:a(({params:t})=>(0,Hzn._)`{propertyName: ${t.propertyName}}`,"params")},FQs={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:BQs,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,LQs.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,Hzn.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Tur.default=FQs});var xur=I(Iur=>{"use strict";p();Object.defineProperty(Iur,"__esModule",{value:!0});var yct=zw(),O2=Es(),UQs=p8(),Ect=Ka(),QQs={message:"must NOT have additional properties",params:a(({params:t})=>(0,O2._)`{additionalProperty: ${t.additionalProperty}}`,"params")},qQs={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:QQs,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,Ect.alwaysValidSchema)(c,r))return;let d=(0,yct.allSchemaProperties)(n.properties),f=(0,yct.allSchemaProperties)(n.patternProperties);h(),t.ok((0,O2._)`${s} === ${UQs.default.errors}`);function h(){e.forIn("key",o,E=>{!d.length&&!f.length?A(E):e.if(m(E),()=>A(E))})}a(h,"checkAdditionalProperties");function m(E){let _;if(d.length>8){let v=(0,Ect.schemaRefOrVal)(c,n.properties,"properties");_=(0,yct.isOwnProperty)(e,v,E)}else d.length?_=(0,O2.or)(...d.map(v=>(0,O2._)`${E} === ${v}`)):_=O2.nil;return f.length&&(_=(0,O2.or)(_,...f.map(v=>(0,O2._)`${(0,yct.usePattern)(t,v)}.test(${E})`))),(0,O2.not)(_)}a(m,"isAdditional");function g(E){e.code((0,O2._)`delete ${o}[${E}]`)}a(g,"deleteAdditional");function A(E){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Ect.alwaysValidSchema)(c,r)){let _=e.name("valid");u.removeAdditional==="failing"?(y(E,_,!1),e.if((0,O2.not)(_),()=>{t.reset(),g(E)})):(y(E,_),l||e.if((0,O2.not)(_),()=>e.break()))}}a(A,"additionalPropertyCode");function y(E,_,v){let b={keyword:"additionalProperties",dataProp:E,dataPropType:Ect.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}a(y,"applyAdditionalSchema")}};Iur.default=qQs});var Wzn=I(Rur=>{"use strict";p();Object.defineProperty(Rur,"__esModule",{value:!0});var jQs=dDe(),$zn=zw(),wur=Ka(),Vzn=xur(),HQs={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&&Vzn.default.code(new jQs.KeywordCxt(s,Vzn.default,"additionalProperties"));let c=(0,$zn.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=wur.mergeEvaluated.props(e,(0,wur.toHash)(c),s.props));let l=c.filter(h=>!(0,wur.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,$zn.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")}};Rur.default=HQs});var Jzn=I(kur=>{"use strict";p();Object.defineProperty(kur,"__esModule",{value:!0});var zzn=zw(),_ct=Es(),Yzn=Ka(),Kzn=Ka(),GQs={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,zzn.allSchemaProperties)(r),u=l.filter(y=>(0,Yzn.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 _ct.Name)&&(s.props=(0,Kzn.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 E in d)new RegExp(y).test(E)&&(0,Yzn.checkStrictMode)(s,`property ${E} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,E=>{e.if((0,_ct._)`${(0,zzn.usePattern)(t,y)}.test(${E})`,()=>{let _=u.includes(y);_||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:E,dataPropType:Kzn.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,_ct._)`${h}[${E}]`,!0):!_&&!s.allErrors&&e.if((0,_ct.not)(f),()=>e.break())})})}a(A,"validateProperties")}};kur.default=GQs});var Zzn=I(Pur=>{"use strict";p();Object.defineProperty(Pur,"__esModule",{value:!0});var $Qs=Ka(),VQs={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,$Qs.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"}};Pur.default=VQs});var Xzn=I(Dur=>{"use strict";p();Object.defineProperty(Dur,"__esModule",{value:!0});var WQs=zw(),zQs={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:WQs.validateUnion,error:{message:"must match a schema in anyOf"}};Dur.default=zQs});var eYn=I(Nur=>{"use strict";p();Object.defineProperty(Nur,"__esModule",{value:!0});var vct=Es(),YQs=Ka(),KQs={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,vct._)`{passingSchemas: ${t.passing}}`,"params")},JQs={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:KQs,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,YQs.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,vct._)`${u} && ${c}`).assign(c,!1).assign(l,(0,vct._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,vct.Name)})})}a(d,"validateOneOf")}};Nur.default=JQs});var tYn=I(Mur=>{"use strict";p();Object.defineProperty(Mur,"__esModule",{value:!0});var ZQs=Ka(),XQs={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,ZQs.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};Mur.default=XQs});var iYn=I(Our=>{"use strict";p();Object.defineProperty(Our,"__esModule",{value:!0});var Cct=Es(),nYn=Ka(),eqs={message:a(({params:t})=>(0,Cct.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,Cct._)`{failingKeyword: ${t.ifClause}}`,"params")},tqs={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:eqs,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,nYn.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=rYn(n,"then"),s=rYn(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,Cct.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,Cct._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function rYn(t,e){let r=t.schema[e];return r!==void 0&&!(0,nYn.alwaysValidSchema)(t,r)}a(rYn,"hasSchema");Our.default=tqs});var oYn=I(Lur=>{"use strict";p();Object.defineProperty(Lur,"__esModule",{value:!0});var rqs=Ka(),nqs={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,rqs.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Lur.default=nqs});var sYn=I(Bur=>{"use strict";p();Object.defineProperty(Bur,"__esModule",{value:!0});var iqs=Eur(),oqs=Lzn(),sqs=_ur(),aqs=Fzn(),cqs=Uzn(),lqs=jzn(),uqs=Gzn(),dqs=xur(),fqs=Wzn(),pqs=Jzn(),hqs=Zzn(),mqs=Xzn(),gqs=eYn(),Aqs=tYn(),yqs=iYn(),Eqs=oYn();function _qs(t=!1){let e=[hqs.default,mqs.default,gqs.default,Aqs.default,yqs.default,Eqs.default,uqs.default,dqs.default,lqs.default,fqs.default,pqs.default];return t?e.push(oqs.default,aqs.default):e.push(iqs.default,sqs.default),e.push(cqs.default),e}a(_qs,"getApplicator");Bur.default=_qs});var aYn=I(Fur=>{"use strict";p();Object.defineProperty(Fur,"__esModule",{value:!0});var uh=Es(),vqs={message:a(({schemaCode:t})=>(0,uh.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,uh._)`{format: ${t}}`,"params")},Cqs={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:vqs,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,uh._)`${A}[${c}]`),E=r.let("fType"),_=r.let("format");r.if((0,uh._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(E,(0,uh._)`${y}.type || "string"`).assign(_,(0,uh._)`${y}.validate`),()=>r.assign(E,(0,uh._)`"string"`).assign(_,y)),t.fail$data((0,uh.or)(v(),b()));function v(){return u.strictSchema===!1?uh.nil:(0,uh._)`${c} && !${_}`}a(v,"unknownFmt");function b(){let T=f.$async?(0,uh._)`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,uh._)`${_}(${n})`,w=(0,uh._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,uh._)`${_} && ${_} !== true && ${E} === ${e} && !${w}`}a(b,"invalidFmt")}a(m,"validate$DataFormat");function g(){let A=h.formats[s];if(!A){v();return}if(A===!0)return;let[y,E,_]=b(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 b(w){let R=w instanceof RegExp?(0,uh.regexpCode)(w):u.code.formats?(0,uh._)`${u.code.formats}${(0,uh.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,uh._)`${x}.validate`]:["string",w,x]}a(b,"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,uh._)`await ${_}(${n})`}return typeof E=="function"?(0,uh._)`${_}(${n})`:(0,uh._)`${_}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};Fur.default=Cqs});var cYn=I(Uur=>{"use strict";p();Object.defineProperty(Uur,"__esModule",{value:!0});var bqs=aYn(),Sqs=[bqs.default];Uur.default=Sqs});var lYn=I(lhe=>{"use strict";p();Object.defineProperty(lhe,"__esModule",{value:!0});lhe.contentVocabulary=lhe.metadataVocabulary=void 0;lhe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];lhe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var dYn=I(Qur=>{"use strict";p();Object.defineProperty(Qur,"__esModule",{value:!0});var Tqs=yzn(),Iqs=Dzn(),xqs=sYn(),wqs=cYn(),uYn=lYn(),Rqs=[Tqs.default,Iqs.default,(0,xqs.default)(),wqs.default,uYn.metadataVocabulary,uYn.contentVocabulary];Qur.default=Rqs});var pYn=I(bct=>{"use strict";p();Object.defineProperty(bct,"__esModule",{value:!0});bct.DiscrError=void 0;var fYn;(function(t){t.Tag="tag",t.Mapping="mapping"})(fYn||(bct.DiscrError=fYn={}))});var mYn=I(jur=>{"use strict";p();Object.defineProperty(jur,"__esModule",{value:!0});var uhe=Es(),qur=pYn(),hYn=sct(),kqs=fDe(),Pqs=Ka(),Dqs={message:a(({params:{discrError:t,tagName:e}})=>t===qur.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,uhe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},Nqs={keyword:"discriminator",type:"object",schemaType:"object",error:Dqs,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,uhe._)`${r}${(0,uhe.getProperty)(l)}`);e.if((0,uhe._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:qur.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,uhe._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:qur.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,uhe.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=_(o),E=!0;for(let T=0;T{Mqs.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 Gur=I((pd,Hur)=>{"use strict";p();Object.defineProperty(pd,"__esModule",{value:!0});pd.MissingRefError=pd.ValidationError=pd.CodeGen=pd.Name=pd.nil=pd.stringify=pd.str=pd._=pd.KeywordCxt=pd.Ajv=void 0;var Oqs=fzn(),Lqs=dYn(),Bqs=mYn(),AYn=gYn(),Fqs=["/properties"],Sct="http://json-schema.org/draft-07/schema",dhe=class extends Oqs.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),Lqs.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Bqs.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(AYn,Fqs):AYn;this.addMetaSchema(e,Sct,!1),this.refs["http://json-schema.org/schema"]=Sct}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Sct)?Sct:void 0)}};pd.Ajv=dhe;Hur.exports=pd=dhe;Hur.exports.Ajv=dhe;Object.defineProperty(pd,"__esModule",{value:!0});pd.default=dhe;var Uqs=dDe();Object.defineProperty(pd,"KeywordCxt",{enumerable:!0,get:a(function(){return Uqs.KeywordCxt},"get")});var fhe=Es();Object.defineProperty(pd,"_",{enumerable:!0,get:a(function(){return fhe._},"get")});Object.defineProperty(pd,"str",{enumerable:!0,get:a(function(){return fhe.str},"get")});Object.defineProperty(pd,"stringify",{enumerable:!0,get:a(function(){return fhe.stringify},"get")});Object.defineProperty(pd,"nil",{enumerable:!0,get:a(function(){return fhe.nil},"get")});Object.defineProperty(pd,"Name",{enumerable:!0,get:a(function(){return fhe.Name},"get")});Object.defineProperty(pd,"CodeGen",{enumerable:!0,get:a(function(){return fhe.CodeGen},"get")});var Qqs=ict();Object.defineProperty(pd,"ValidationError",{enumerable:!0,get:a(function(){return Qqs.default},"get")});var qqs=fDe();Object.defineProperty(pd,"MissingRefError",{enumerable:!0,get:a(function(){return qqs.default},"get")})});var TYn=I(Z5=>{"use strict";p();Object.defineProperty(Z5,"__esModule",{value:!0});Z5.formatNames=Z5.fastFormats=Z5.fullFormats=void 0;function J5(t,e){return{validate:t,compare:e}}a(J5,"fmtDef");Z5.fullFormats={date:J5(vYn,zur),time:J5(Vur(!0),Yur),"date-time":J5(yYn(!0),bYn),"iso-time":J5(Vur(),CYn),"iso-date-time":J5(yYn(),SYn),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Wqs,"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:ejs,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:zqs,int32:{type:"number",validate:Jqs},int64:{type:"number",validate:Zqs},float:{type:"number",validate:_Yn},double:{type:"number",validate:_Yn},password:!0,binary:!0};Z5.fastFormats={...Z5.fullFormats,date:J5(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,zur),time:J5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Yur),"date-time":J5(/^\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,bYn),"iso-time":J5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,CYn),"iso-date-time":J5(/^\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,SYn),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};Z5.formatNames=Object.keys(Z5.fullFormats);function jqs(t){return t%4===0&&(t%100!==0||t%400===0)}a(jqs,"isLeapYear");var Hqs=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Gqs=[0,31,28,31,30,31,30,31,31,30,31,30,31];function vYn(t){let e=Hqs.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&&jqs(r)?29:Gqs[n])}a(vYn,"date");function zur(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(Vur,"getTime");function Yur(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(Yur,"compareTime");function CYn(t,e){if(!(t&&e))return;let r=$ur.exec(t),n=$ur.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=Yqs}a(Jqs,"validateInt32");function Zqs(t){return Number.isInteger(t)}a(Zqs,"validateInt64");function _Yn(){return!0}a(_Yn,"validateNumber");var Xqs=/[^\\]\\Z/;function ejs(t){if(Xqs.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(ejs,"regex")});var IYn=I(phe=>{"use strict";p();Object.defineProperty(phe,"__esModule",{value:!0});phe.formatLimitDefinition=void 0;var tjs=Gur(),L2=Es(),EH=L2.operators,Tct={formatMaximum:{okStr:"<=",ok:EH.LTE,fail:EH.GT},formatMinimum:{okStr:">=",ok:EH.GTE,fail:EH.LT},formatExclusiveMaximum:{okStr:"<",ok:EH.LT,fail:EH.GTE},formatExclusiveMinimum:{okStr:">",ok:EH.GT,fail:EH.LTE}},rjs={message:a(({keyword:t,schemaCode:e})=>(0,L2.str)`should be ${Tct[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,L2._)`{comparison: ${Tct[t].okStr}, limit: ${e}}`,"params")};phe.formatLimitDefinition={keyword:Object.keys(Tct),type:"string",schemaType:"string",$data:!0,error:rjs,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 tjs.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,L2._)`${m}[${u.schemaCode}]`);t.fail$data((0,L2.or)((0,L2._)`typeof ${g} != "object"`,(0,L2._)`${g} instanceof RegExp`,(0,L2._)`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,L2._)`${c.code.formats}${(0,L2.getProperty)(m)}`:void 0});t.fail$data(h(A))}a(f,"validateFormat");function h(m){return(0,L2._)`${m}.compare(${r}, ${n}) ${Tct[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var njs=a(t=>(t.addKeyword(phe.formatLimitDefinition),t),"formatLimitPlugin");phe.default=njs});var kYn=I((IDe,RYn)=>{"use strict";p();Object.defineProperty(IDe,"__esModule",{value:!0});var hhe=TYn(),ijs=IYn(),Kur=Es(),xYn=new Kur.Name("fullFormats"),ojs=new Kur.Name("fastFormats"),Jur=a((t,e={keywords:!0})=>{if(Array.isArray(e))return wYn(t,e,hhe.fullFormats,xYn),t;let[r,n]=e.mode==="fast"?[hhe.fastFormats,ojs]:[hhe.fullFormats,xYn],o=e.formats||hhe.formatNames;return wYn(t,o,r,n),e.keywords&&(0,ijs.default)(t),t},"formatsPlugin");Jur.get=(t,e="full")=>{let n=(e==="fast"?hhe.fastFormats:hhe.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function wYn(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,Kur._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(wYn,"addFormats");RYn.exports=IDe=Jur;Object.defineProperty(IDe,"__esModule",{value:!0});IDe.default=Jur});var oKn=I((bIf,iKn)=>{p();iKn.exports=nKn;nKn.sync=mjs;var tKn=require("fs");function hjs(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();lKn.exports=aKn;aKn.sync=gjs;var sKn=require("fs");function aKn(t,e,r){sKn.stat(t,function(n,o){r(n,n?!1:cKn(o,e))})}a(aKn,"isexe");function gjs(t,e){return cKn(sKn.statSync(t),e)}a(gjs,"sync");function cKn(t,e){return t.isFile()&&Ajs(t,e)}a(cKn,"checkStat");function Ajs(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(Ajs,"checkMode")});var fKn=I((kIf,dKn)=>{p();var RIf=require("fs"),qct;process.platform==="win32"||global.TESTING_WINDOWS?qct=oKn():qct=uKn();dKn.exports=pdr;pdr.sync=yjs;function pdr(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){pdr(t,e||{},function(s,c){s?o(s):n(c)})})}qct(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(pdr,"isexe");function yjs(t,e){try{return qct.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(yjs,"sync")});var EKn=I((NIf,yKn)=>{p();var The=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",pKn=require("path"),Ejs=The?";":":",hKn=fKn(),mKn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),gKn=a((t,e)=>{let r=e.colon||Ejs,n=t.match(/\//)||The&&t.match(/\\/)?[""]:[...The?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=The?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=The?o.split(r):[""];return The&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),AKn=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=gKn(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(mKn(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=pKn.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];hKn(d+A,{pathExt:s},(y,E)=>{if(!y&&E)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"),_js=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=gKn(t,e),s=[];for(let c=0;c{"use strict";p();var _Kn=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");hdr.exports=_Kn;hdr.exports.default=_Kn});var TKn=I((UIf,SKn)=>{"use strict";p();var CKn=require("path"),vjs=EKn(),Cjs=vKn();function bKn(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=vjs.sync(t.command,{path:r[Cjs({env:r})],pathExt:e?CKn.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=CKn.resolve(o?t.options.cwd:"",c)),c}a(bKn,"resolveCommandAttempt");function bjs(t){return bKn(t)||bKn(t,!0)}a(bjs,"resolveCommand");SKn.exports=bjs});var IKn=I((jIf,gdr)=>{"use strict";p();var mdr=/([()\][%!^"`<>&|;, *?])/g;function Sjs(t){return t=t.replace(mdr,"^$1"),t}a(Sjs,"escapeCommand");function Tjs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(mdr,"^$1"),e&&(t=t.replace(mdr,"^$1")),t}a(Tjs,"escapeArgument");gdr.exports.command=Sjs;gdr.exports.argument=Tjs});var wKn=I(($If,xKn)=>{"use strict";p();xKn.exports=/^#!(.*)/});var kKn=I((WIf,RKn)=>{"use strict";p();var Ijs=wKn();RKn.exports=(t="")=>{let e=t.match(Ijs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var DKn=I((YIf,PKn)=>{"use strict";p();var Adr=require("fs"),xjs=kKn();function wjs(t){let r=Buffer.alloc(150),n;try{n=Adr.openSync(t,"r"),Adr.readSync(n,r,0,150,0),Adr.closeSync(n)}catch{}return xjs(r.toString())}a(wjs,"readShebang");PKn.exports=wjs});var LKn=I((ZIf,OKn)=>{"use strict";p();var Rjs=require("path"),NKn=TKn(),MKn=IKn(),kjs=DKn(),Pjs=process.platform==="win32",Djs=/\.(?:com|exe)$/i,Njs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Mjs(t){t.file=NKn(t);let e=t.file&&kjs(t.file);return e?(t.args.unshift(t.file),t.command=e,NKn(t)):t.file}a(Mjs,"detectShebang");function Ojs(t){if(!Pjs)return t;let e=Mjs(t),r=!Djs.test(e);if(t.options.forceShell||r){let n=Njs.test(e);t.command=Rjs.normalize(t.command),t.command=MKn.command(t.command),t.args=t.args.map(s=>MKn.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(Ojs,"parseNonShell");function Ljs(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:Ojs(n)}a(Ljs,"parse");OKn.exports=Ljs});var UKn=I((txf,FKn)=>{"use strict";p();var ydr=process.platform==="win32";function Edr(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(Edr,"notFoundError");function Bjs(t,e){if(!ydr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=BKn(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(Bjs,"hookChildProcess");function BKn(t,e){return ydr&&t===1&&!e.file?Edr(e.original,"spawn"):null}a(BKn,"verifyENOENT");function Fjs(t,e){return ydr&&t===1&&!e.file?Edr(e.original,"spawnSync"):null}a(Fjs,"verifyENOENTSync");FKn.exports={hookChildProcess:Bjs,verifyENOENT:BKn,verifyENOENTSync:Fjs,notFoundError:Edr}});var jKn=I((ixf,Ihe)=>{"use strict";p();var QKn=require("child_process"),_dr=LKn(),vdr=UKn();function qKn(t,e,r){let n=_dr(t,e,r),o=QKn.spawn(n.command,n.args,n.options);return vdr.hookChildProcess(o,n),o}a(qKn,"spawn");function Ujs(t,e,r){let n=_dr(t,e,r),o=QKn.spawnSync(n.command,n.args,n.options);return o.error=o.error||vdr.verifyENOENTSync(o.status,n),o}a(Ujs,"spawnSync");Ihe.exports=qKn;Ihe.exports.spawn=qKn;Ihe.exports.sync=Ujs;Ihe.exports._parse=_dr;Ihe.exports._enoent=vdr});function BX(t,e=!1){let r=t.length,n=0,o="",s=0,c=16,l=0,u=0,d=0,f=0,h=0;function m(b,T){let w=0,R=0;for(;w=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){b+=t.substring(T,n),h=2;break}let w=t.charCodeAt(n);if(w===34){b+=t.substring(T,n),n++;break}if(w===92){if(b+=t.substring(T,n),n++,n>=r){h=2;break}switch(t.charCodeAt(n++)){case 34:b+='"';break;case 92:b+="\\";break;case 47:b+="/";break;case 98:b+="\b";break;case 102:b+="\f";break;case 110:b+=` -`;break;case 114:b+="\r";break;case 116:b+=" ";break;case 117:let x=m(4,!0);x>=0?b+=String.fromCharCode(x):h=4;break;default:h=5}T=n;continue}if(w>=0&&w<=31)if(GDe(w)){b+=t.substring(T,n),h=2;break}else h=6;n++}return b}a(y,"scanString");function E(){if(o="",h=0,s=n,u=l,f=d,n>=r)return s=r,c=17;let b=t.charCodeAt(n);if(Fdr(b)){do n++,o+=String.fromCharCode(b),b=t.charCodeAt(n);while(Fdr(b));return c=15}if(GDe(b))return n++,o+=String.fromCharCode(b),b===13&&t.charCodeAt(n)===10&&(n++,o+=` -`),l++,d=n,c=14;switch(b){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&&b<=15);return b}return a(v,"scanNextNonTrivia"),{setPosition:g,getPosition:a(()=>n,"getPosition"),scan:e?v:E,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 Fdr(t){return t===32||t===9}function GDe(t){return t===10||t===13}function khe(t){return t>=48&&t<=57}var _Jn,rlt=ve(()=>{"use strict";p();a(BX,"createScanner");a(Fdr,"isWhiteSpace");a(GDe,"isLineBreak");a(khe,"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"})(_Jn||(_Jn={}))});var BT,Phe,Udr,vJn,CJn=ve(()=>{p();BT=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),Phe=200,Udr={" ":{"\n":new Array(Phe).fill(0).map((t,e)=>` + deps: ${r}}`,"params")};var UQs={keyword:"dependencies",type:"object",schemaType:"object",error:K5.error,code(t){let[e,r]=QQs(t);qzn(t,e),jzn(t,r)}};function QQs({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(QQs,"splitDependencies");function qzn(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,TDe.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,TDe.checkReportMissingProp)(t,d)}):(r.if((0,Tur._)`${u} && (${(0,TDe.checkMissingProp)(t,l,s)})`),(0,TDe.reportMissingProp)(t,s),r.else())}}a(qzn,"validatePropertyDeps");K5.validatePropertyDeps=qzn;function jzn(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,FQs.alwaysValidSchema)(s,e[l])||(r.if((0,TDe.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(jzn,"validateSchemaDeps");K5.validateSchemaDeps=jzn;K5.default=UQs});var $zn=I(Iur=>{"use strict";p();Object.defineProperty(Iur,"__esModule",{value:!0});var Gzn=Es(),qQs=Ka(),jQs={message:"property name must be valid",params:a(({params:t})=>(0,Gzn._)`{propertyName: ${t.propertyName}}`,"params")},HQs={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:jQs,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,qQs.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,Gzn.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Iur.default=HQs});var wur=I(xur=>{"use strict";p();Object.defineProperty(xur,"__esModule",{value:!0});var vct=Yw(),L2=Es(),GQs=h8(),Cct=Ka(),$Qs={message:"must NOT have additional properties",params:a(({params:t})=>(0,L2._)`{additionalProperty: ${t.additionalProperty}}`,"params")},VQs={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:$Qs,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,Cct.alwaysValidSchema)(c,r))return;let d=(0,vct.allSchemaProperties)(n.properties),f=(0,vct.allSchemaProperties)(n.patternProperties);h(),t.ok((0,L2._)`${s} === ${GQs.default.errors}`);function h(){e.forIn("key",o,E=>{!d.length&&!f.length?A(E):e.if(m(E),()=>A(E))})}a(h,"checkAdditionalProperties");function m(E){let _;if(d.length>8){let v=(0,Cct.schemaRefOrVal)(c,n.properties,"properties");_=(0,vct.isOwnProperty)(e,v,E)}else d.length?_=(0,L2.or)(...d.map(v=>(0,L2._)`${E} === ${v}`)):_=L2.nil;return f.length&&(_=(0,L2.or)(_,...f.map(v=>(0,L2._)`${(0,vct.usePattern)(t,v)}.test(${E})`))),(0,L2.not)(_)}a(m,"isAdditional");function g(E){e.code((0,L2._)`delete ${o}[${E}]`)}a(g,"deleteAdditional");function A(E){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Cct.alwaysValidSchema)(c,r)){let _=e.name("valid");u.removeAdditional==="failing"?(y(E,_,!1),e.if((0,L2.not)(_),()=>{t.reset(),g(E)})):(y(E,_),l||e.if((0,L2.not)(_),()=>e.break()))}}a(A,"additionalPropertyCode");function y(E,_,v){let b={keyword:"additionalProperties",dataProp:E,dataPropType:Cct.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}a(y,"applyAdditionalSchema")}};xur.default=VQs});var zzn=I(kur=>{"use strict";p();Object.defineProperty(kur,"__esModule",{value:!0});var WQs=dDe(),Vzn=Yw(),Rur=Ka(),Wzn=wur(),zQs={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&&Wzn.default.code(new WQs.KeywordCxt(s,Wzn.default,"additionalProperties"));let c=(0,Vzn.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=Rur.mergeEvaluated.props(e,(0,Rur.toHash)(c),s.props));let l=c.filter(h=>!(0,Rur.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,Vzn.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")}};kur.default=zQs});var Zzn=I(Pur=>{"use strict";p();Object.defineProperty(Pur,"__esModule",{value:!0});var Yzn=Yw(),bct=Es(),Kzn=Ka(),Jzn=Ka(),YQs={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,Yzn.allSchemaProperties)(r),u=l.filter(y=>(0,Kzn.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 bct.Name)&&(s.props=(0,Jzn.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 E in d)new RegExp(y).test(E)&&(0,Kzn.checkStrictMode)(s,`property ${E} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,E=>{e.if((0,bct._)`${(0,Yzn.usePattern)(t,y)}.test(${E})`,()=>{let _=u.includes(y);_||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:E,dataPropType:Jzn.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,bct._)`${h}[${E}]`,!0):!_&&!s.allErrors&&e.if((0,bct.not)(f),()=>e.break())})})}a(A,"validateProperties")}};Pur.default=YQs});var Xzn=I(Dur=>{"use strict";p();Object.defineProperty(Dur,"__esModule",{value:!0});var KQs=Ka(),JQs={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,KQs.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"}};Dur.default=JQs});var eYn=I(Nur=>{"use strict";p();Object.defineProperty(Nur,"__esModule",{value:!0});var ZQs=Yw(),XQs={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ZQs.validateUnion,error:{message:"must match a schema in anyOf"}};Nur.default=XQs});var tYn=I(Mur=>{"use strict";p();Object.defineProperty(Mur,"__esModule",{value:!0});var Sct=Es(),eqs=Ka(),tqs={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,Sct._)`{passingSchemas: ${t.passing}}`,"params")},rqs={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:tqs,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,eqs.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,Sct._)`${u} && ${c}`).assign(c,!1).assign(l,(0,Sct._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,Sct.Name)})})}a(d,"validateOneOf")}};Mur.default=rqs});var rYn=I(Our=>{"use strict";p();Object.defineProperty(Our,"__esModule",{value:!0});var nqs=Ka(),iqs={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,nqs.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};Our.default=iqs});var oYn=I(Lur=>{"use strict";p();Object.defineProperty(Lur,"__esModule",{value:!0});var Tct=Es(),iYn=Ka(),oqs={message:a(({params:t})=>(0,Tct.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,Tct._)`{failingKeyword: ${t.ifClause}}`,"params")},sqs={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:oqs,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,iYn.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=nYn(n,"then"),s=nYn(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,Tct.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,Tct._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function nYn(t,e){let r=t.schema[e];return r!==void 0&&!(0,iYn.alwaysValidSchema)(t,r)}a(nYn,"hasSchema");Lur.default=sqs});var sYn=I(Bur=>{"use strict";p();Object.defineProperty(Bur,"__esModule",{value:!0});var aqs=Ka(),cqs={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,aqs.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Bur.default=cqs});var aYn=I(Fur=>{"use strict";p();Object.defineProperty(Fur,"__esModule",{value:!0});var lqs=_ur(),uqs=Bzn(),dqs=vur(),fqs=Uzn(),pqs=Qzn(),hqs=Hzn(),mqs=$zn(),gqs=wur(),Aqs=zzn(),yqs=Zzn(),Eqs=Xzn(),_qs=eYn(),vqs=tYn(),Cqs=rYn(),bqs=oYn(),Sqs=sYn();function Tqs(t=!1){let e=[Eqs.default,_qs.default,vqs.default,Cqs.default,bqs.default,Sqs.default,mqs.default,gqs.default,hqs.default,Aqs.default,yqs.default];return t?e.push(uqs.default,fqs.default):e.push(lqs.default,dqs.default),e.push(pqs.default),e}a(Tqs,"getApplicator");Fur.default=Tqs});var cYn=I(Uur=>{"use strict";p();Object.defineProperty(Uur,"__esModule",{value:!0});var uh=Es(),Iqs={message:a(({schemaCode:t})=>(0,uh.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,uh._)`{format: ${t}}`,"params")},xqs={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Iqs,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,uh._)`${A}[${c}]`),E=r.let("fType"),_=r.let("format");r.if((0,uh._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(E,(0,uh._)`${y}.type || "string"`).assign(_,(0,uh._)`${y}.validate`),()=>r.assign(E,(0,uh._)`"string"`).assign(_,y)),t.fail$data((0,uh.or)(v(),b()));function v(){return u.strictSchema===!1?uh.nil:(0,uh._)`${c} && !${_}`}a(v,"unknownFmt");function b(){let T=f.$async?(0,uh._)`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,uh._)`${_}(${n})`,w=(0,uh._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,uh._)`${_} && ${_} !== true && ${E} === ${e} && !${w}`}a(b,"invalidFmt")}a(m,"validate$DataFormat");function g(){let A=h.formats[s];if(!A){v();return}if(A===!0)return;let[y,E,_]=b(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 b(w){let R=w instanceof RegExp?(0,uh.regexpCode)(w):u.code.formats?(0,uh._)`${u.code.formats}${(0,uh.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,uh._)`${x}.validate`]:["string",w,x]}a(b,"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,uh._)`await ${_}(${n})`}return typeof E=="function"?(0,uh._)`${_}(${n})`:(0,uh._)`${_}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};Uur.default=xqs});var lYn=I(Qur=>{"use strict";p();Object.defineProperty(Qur,"__esModule",{value:!0});var wqs=cYn(),Rqs=[wqs.default];Qur.default=Rqs});var uYn=I(lhe=>{"use strict";p();Object.defineProperty(lhe,"__esModule",{value:!0});lhe.contentVocabulary=lhe.metadataVocabulary=void 0;lhe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];lhe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var fYn=I(qur=>{"use strict";p();Object.defineProperty(qur,"__esModule",{value:!0});var kqs=Ezn(),Pqs=Nzn(),Dqs=aYn(),Nqs=lYn(),dYn=uYn(),Mqs=[kqs.default,Pqs.default,(0,Dqs.default)(),Nqs.default,dYn.metadataVocabulary,dYn.contentVocabulary];qur.default=Mqs});var hYn=I(Ict=>{"use strict";p();Object.defineProperty(Ict,"__esModule",{value:!0});Ict.DiscrError=void 0;var pYn;(function(t){t.Tag="tag",t.Mapping="mapping"})(pYn||(Ict.DiscrError=pYn={}))});var gYn=I(Hur=>{"use strict";p();Object.defineProperty(Hur,"__esModule",{value:!0});var uhe=Es(),jur=hYn(),mYn=lct(),Oqs=fDe(),Lqs=Ka(),Bqs={message:a(({params:{discrError:t,tagName:e}})=>t===jur.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,uhe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},Fqs={keyword:"discriminator",type:"object",schemaType:"object",error:Bqs,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,uhe._)`${r}${(0,uhe.getProperty)(l)}`);e.if((0,uhe._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:jur.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,uhe._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:jur.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,uhe.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=_(o),E=!0;for(let T=0;T{Uqs.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 $ur=I((pd,Gur)=>{"use strict";p();Object.defineProperty(pd,"__esModule",{value:!0});pd.MissingRefError=pd.ValidationError=pd.CodeGen=pd.Name=pd.nil=pd.stringify=pd.str=pd._=pd.KeywordCxt=pd.Ajv=void 0;var Qqs=pzn(),qqs=fYn(),jqs=gYn(),yYn=AYn(),Hqs=["/properties"],xct="http://json-schema.org/draft-07/schema",dhe=class extends Qqs.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),qqs.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(jqs.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(yYn,Hqs):yYn;this.addMetaSchema(e,xct,!1),this.refs["http://json-schema.org/schema"]=xct}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(xct)?xct:void 0)}};pd.Ajv=dhe;Gur.exports=pd=dhe;Gur.exports.Ajv=dhe;Object.defineProperty(pd,"__esModule",{value:!0});pd.default=dhe;var Gqs=dDe();Object.defineProperty(pd,"KeywordCxt",{enumerable:!0,get:a(function(){return Gqs.KeywordCxt},"get")});var fhe=Es();Object.defineProperty(pd,"_",{enumerable:!0,get:a(function(){return fhe._},"get")});Object.defineProperty(pd,"str",{enumerable:!0,get:a(function(){return fhe.str},"get")});Object.defineProperty(pd,"stringify",{enumerable:!0,get:a(function(){return fhe.stringify},"get")});Object.defineProperty(pd,"nil",{enumerable:!0,get:a(function(){return fhe.nil},"get")});Object.defineProperty(pd,"Name",{enumerable:!0,get:a(function(){return fhe.Name},"get")});Object.defineProperty(pd,"CodeGen",{enumerable:!0,get:a(function(){return fhe.CodeGen},"get")});var $qs=act();Object.defineProperty(pd,"ValidationError",{enumerable:!0,get:a(function(){return $qs.default},"get")});var Vqs=fDe();Object.defineProperty(pd,"MissingRefError",{enumerable:!0,get:a(function(){return Vqs.default},"get")})});var IYn=I(Z5=>{"use strict";p();Object.defineProperty(Z5,"__esModule",{value:!0});Z5.formatNames=Z5.fastFormats=Z5.fullFormats=void 0;function J5(t,e){return{validate:t,compare:e}}a(J5,"fmtDef");Z5.fullFormats={date:J5(CYn,Yur),time:J5(Wur(!0),Kur),"date-time":J5(EYn(!0),SYn),"iso-time":J5(Wur(),bYn),"iso-date-time":J5(EYn(),TYn),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Zqs,"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:ojs,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:Xqs,int32:{type:"number",validate:rjs},int64:{type:"number",validate:njs},float:{type:"number",validate:vYn},double:{type:"number",validate:vYn},password:!0,binary:!0};Z5.fastFormats={...Z5.fullFormats,date:J5(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Yur),time:J5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Kur),"date-time":J5(/^\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,SYn),"iso-time":J5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,bYn),"iso-date-time":J5(/^\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,TYn),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};Z5.formatNames=Object.keys(Z5.fullFormats);function Wqs(t){return t%4===0&&(t%100!==0||t%400===0)}a(Wqs,"isLeapYear");var zqs=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Yqs=[0,31,28,31,30,31,30,31,31,30,31,30,31];function CYn(t){let e=zqs.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&&Wqs(r)?29:Yqs[n])}a(CYn,"date");function Yur(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(Wur,"getTime");function Kur(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(Kur,"compareTime");function bYn(t,e){if(!(t&&e))return;let r=Vur.exec(t),n=Vur.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=ejs}a(rjs,"validateInt32");function njs(t){return Number.isInteger(t)}a(njs,"validateInt64");function vYn(){return!0}a(vYn,"validateNumber");var ijs=/[^\\]\\Z/;function ojs(t){if(ijs.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(ojs,"regex")});var xYn=I(phe=>{"use strict";p();Object.defineProperty(phe,"__esModule",{value:!0});phe.formatLimitDefinition=void 0;var sjs=$ur(),B2=Es(),_H=B2.operators,wct={formatMaximum:{okStr:"<=",ok:_H.LTE,fail:_H.GT},formatMinimum:{okStr:">=",ok:_H.GTE,fail:_H.LT},formatExclusiveMaximum:{okStr:"<",ok:_H.LT,fail:_H.GTE},formatExclusiveMinimum:{okStr:">",ok:_H.GT,fail:_H.LTE}},ajs={message:a(({keyword:t,schemaCode:e})=>(0,B2.str)`should be ${wct[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,B2._)`{comparison: ${wct[t].okStr}, limit: ${e}}`,"params")};phe.formatLimitDefinition={keyword:Object.keys(wct),type:"string",schemaType:"string",$data:!0,error:ajs,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 sjs.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,B2._)`${m}[${u.schemaCode}]`);t.fail$data((0,B2.or)((0,B2._)`typeof ${g} != "object"`,(0,B2._)`${g} instanceof RegExp`,(0,B2._)`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,B2._)`${c.code.formats}${(0,B2.getProperty)(m)}`:void 0});t.fail$data(h(A))}a(f,"validateFormat");function h(m){return(0,B2._)`${m}.compare(${r}, ${n}) ${wct[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var cjs=a(t=>(t.addKeyword(phe.formatLimitDefinition),t),"formatLimitPlugin");phe.default=cjs});var PYn=I((IDe,kYn)=>{"use strict";p();Object.defineProperty(IDe,"__esModule",{value:!0});var hhe=IYn(),ljs=xYn(),Jur=Es(),wYn=new Jur.Name("fullFormats"),ujs=new Jur.Name("fastFormats"),Zur=a((t,e={keywords:!0})=>{if(Array.isArray(e))return RYn(t,e,hhe.fullFormats,wYn),t;let[r,n]=e.mode==="fast"?[hhe.fastFormats,ujs]:[hhe.fullFormats,wYn],o=e.formats||hhe.formatNames;return RYn(t,o,r,n),e.keywords&&(0,ljs.default)(t),t},"formatsPlugin");Zur.get=(t,e="full")=>{let n=(e==="fast"?hhe.fastFormats:hhe.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function RYn(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,Jur._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(RYn,"addFormats");kYn.exports=IDe=Zur;Object.defineProperty(IDe,"__esModule",{value:!0});IDe.default=Zur});var sKn=I((PIf,oKn)=>{p();oKn.exports=iKn;iKn.sync=_js;var rKn=require("fs");function Ejs(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();uKn.exports=cKn;cKn.sync=vjs;var aKn=require("fs");function cKn(t,e,r){aKn.stat(t,function(n,o){r(n,n?!1:lKn(o,e))})}a(cKn,"isexe");function vjs(t,e){return lKn(aKn.statSync(t),e)}a(vjs,"sync");function lKn(t,e){return t.isFile()&&Cjs(t,e)}a(lKn,"checkStat");function Cjs(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(Cjs,"checkMode")});var pKn=I((FIf,fKn)=>{p();var BIf=require("fs"),Gct;process.platform==="win32"||global.TESTING_WINDOWS?Gct=sKn():Gct=dKn();fKn.exports=hdr;hdr.sync=bjs;function hdr(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){hdr(t,e||{},function(s,c){s?o(s):n(c)})})}Gct(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(hdr,"isexe");function bjs(t,e){try{return Gct.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(bjs,"sync")});var _Kn=I((qIf,EKn)=>{p();var The=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",hKn=require("path"),Sjs=The?";":":",mKn=pKn(),gKn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),AKn=a((t,e)=>{let r=e.colon||Sjs,n=t.match(/\//)||The&&t.match(/\\/)?[""]:[...The?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=The?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=The?o.split(r):[""];return The&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),yKn=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=AKn(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(gKn(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=hKn.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];mKn(d+A,{pathExt:s},(y,E)=>{if(!y&&E)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"),Tjs=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=AKn(t,e),s=[];for(let c=0;c{"use strict";p();var vKn=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");mdr.exports=vKn;mdr.exports.default=vKn});var IKn=I((WIf,TKn)=>{"use strict";p();var bKn=require("path"),Ijs=_Kn(),xjs=CKn();function SKn(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=Ijs.sync(t.command,{path:r[xjs({env:r})],pathExt:e?bKn.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=bKn.resolve(o?t.options.cwd:"",c)),c}a(SKn,"resolveCommandAttempt");function wjs(t){return SKn(t)||SKn(t,!0)}a(wjs,"resolveCommand");TKn.exports=wjs});var xKn=I((KIf,Adr)=>{"use strict";p();var gdr=/([()\][%!^"`<>&|;, *?])/g;function Rjs(t){return t=t.replace(gdr,"^$1"),t}a(Rjs,"escapeCommand");function kjs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(gdr,"^$1"),e&&(t=t.replace(gdr,"^$1")),t}a(kjs,"escapeArgument");Adr.exports.command=Rjs;Adr.exports.argument=kjs});var RKn=I((XIf,wKn)=>{"use strict";p();wKn.exports=/^#!(.*)/});var PKn=I((txf,kKn)=>{"use strict";p();var Pjs=RKn();kKn.exports=(t="")=>{let e=t.match(Pjs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var NKn=I((nxf,DKn)=>{"use strict";p();var ydr=require("fs"),Djs=PKn();function Njs(t){let r=Buffer.alloc(150),n;try{n=ydr.openSync(t,"r"),ydr.readSync(n,r,0,150,0),ydr.closeSync(n)}catch{}return Djs(r.toString())}a(Njs,"readShebang");DKn.exports=Njs});var BKn=I((sxf,LKn)=>{"use strict";p();var Mjs=require("path"),MKn=IKn(),OKn=xKn(),Ojs=NKn(),Ljs=process.platform==="win32",Bjs=/\.(?:com|exe)$/i,Fjs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Ujs(t){t.file=MKn(t);let e=t.file&&Ojs(t.file);return e?(t.args.unshift(t.file),t.command=e,MKn(t)):t.file}a(Ujs,"detectShebang");function Qjs(t){if(!Ljs)return t;let e=Ujs(t),r=!Bjs.test(e);if(t.options.forceShell||r){let n=Fjs.test(e);t.command=Mjs.normalize(t.command),t.command=OKn.command(t.command),t.args=t.args.map(s=>OKn.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(Qjs,"parseNonShell");function qjs(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:Qjs(n)}a(qjs,"parse");LKn.exports=qjs});var QKn=I((lxf,UKn)=>{"use strict";p();var Edr=process.platform==="win32";function _dr(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(_dr,"notFoundError");function jjs(t,e){if(!Edr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=FKn(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(jjs,"hookChildProcess");function FKn(t,e){return Edr&&t===1&&!e.file?_dr(e.original,"spawn"):null}a(FKn,"verifyENOENT");function Hjs(t,e){return Edr&&t===1&&!e.file?_dr(e.original,"spawnSync"):null}a(Hjs,"verifyENOENTSync");UKn.exports={hookChildProcess:jjs,verifyENOENT:FKn,verifyENOENTSync:Hjs,notFoundError:_dr}});var HKn=I((fxf,Ihe)=>{"use strict";p();var qKn=require("child_process"),vdr=BKn(),Cdr=QKn();function jKn(t,e,r){let n=vdr(t,e,r),o=qKn.spawn(n.command,n.args,n.options);return Cdr.hookChildProcess(o,n),o}a(jKn,"spawn");function Gjs(t,e,r){let n=vdr(t,e,r),o=qKn.spawnSync(n.command,n.args,n.options);return o.error=o.error||Cdr.verifyENOENTSync(o.status,n),o}a(Gjs,"spawnSync");Ihe.exports=jKn;Ihe.exports.spawn=jKn;Ihe.exports.sync=Gjs;Ihe.exports._parse=vdr;Ihe.exports._enoent=Cdr});function BX(t,e=!1){let r=t.length,n=0,o="",s=0,c=16,l=0,u=0,d=0,f=0,h=0;function m(b,T){let w=0,R=0;for(;w=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){b+=t.substring(T,n),h=2;break}let w=t.charCodeAt(n);if(w===34){b+=t.substring(T,n),n++;break}if(w===92){if(b+=t.substring(T,n),n++,n>=r){h=2;break}switch(t.charCodeAt(n++)){case 34:b+='"';break;case 92:b+="\\";break;case 47:b+="/";break;case 98:b+="\b";break;case 102:b+="\f";break;case 110:b+=` +`;break;case 114:b+="\r";break;case 116:b+=" ";break;case 117:let x=m(4,!0);x>=0?b+=String.fromCharCode(x):h=4;break;default:h=5}T=n;continue}if(w>=0&&w<=31)if($De(w)){b+=t.substring(T,n),h=2;break}else h=6;n++}return b}a(y,"scanString");function E(){if(o="",h=0,s=n,u=l,f=d,n>=r)return s=r,c=17;let b=t.charCodeAt(n);if(Udr(b)){do n++,o+=String.fromCharCode(b),b=t.charCodeAt(n);while(Udr(b));return c=15}if($De(b))return n++,o+=String.fromCharCode(b),b===13&&t.charCodeAt(n)===10&&(n++,o+=` +`),l++,d=n,c=14;switch(b){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&&b<=15);return b}return a(v,"scanNextNonTrivia"),{setPosition:g,getPosition:a(()=>n,"getPosition"),scan:e?v:E,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 Udr(t){return t===32||t===9}function $De(t){return t===10||t===13}function khe(t){return t>=48&&t<=57}var vJn,ilt=ve(()=>{"use strict";p();a(BX,"createScanner");a(Udr,"isWhiteSpace");a($De,"isLineBreak");a(khe,"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"})(vJn||(vJn={}))});var UT,Phe,Qdr,CJn,bJn=ve(()=>{p();UT=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),Phe=200,Qdr={" ":{"\n":new Array(Phe).fill(0).map((t,e)=>` `+" ".repeat(e)),"\r":new Array(Phe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(Phe).fill(0).map((t,e)=>`\r `+" ".repeat(e))}," ":{"\n":new Array(Phe).fill(0).map((t,e)=>` `+" ".repeat(e)),"\r":new Array(Phe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(Phe).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}},vJn=[` +`+" ".repeat(e))}},CJn=[` `,"\r",`\r -`]});function nlt(t,e,r){let n,o,s,c,l;if(e){for(c=e.offset,l=c+e.length,s=c;s>0&&!$De(t,s-1);)s--;let w=l;for(;w1)return Dhe(u,f)+Dhe(m,n+h);let w=m.length*(n+h);return!d||w>Udr[g][u].length?u+Dhe(m,n+h):w<=0?u:Udr[g][u][w]}a(E,"newLinesAndIndent");function _(){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(_,"scanNext");let v=[];function b(w,R,x){!y&&(!e||Rc)&&t.substring(R,x)!==w&&v.push({offset:R,length:x-R,content:w})}a(b,"addEdit");let T=_();if(r.keepLines&&f>0&&b(Dhe(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?BT[m.length*n]:Dhe(m,n);b(R,s,w)}for(;T!==17;){let w=A.getTokenOffset()+A.getTokenLength()+s,R=_(),x="",P=!1;for(;f===0&&(R===12||R===13);){let N=A.getTokenOffset()+s;b(BT[1],w,N),w=A.getTokenOffset()+A.getTokenLength()+s,P=R===12,x=P?E():"",R=_()}if(R===2)T!==1&&h--,r.keepLines&&f>0||!r.keepLines&&T!==1?x=E():r.keepLines&&(x=BT[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=E():r.keepLines&&(x=BT[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=E():x=BT[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=E():x=BT[1];break;case 12:x=E();break;case 13:f>0?x=E():P||(x=BT[1]);break;case 6:r.keepLines&&f>0?x=E():P||(x=BT[1]);break;case 10:r.keepLines&&f>0?x=E():R===6&&!P&&(x="");break;case 7:case 8:case 9:case 11:case 2:case 4:r.keepLines&&f>0?x=E():(R===12||R===13)&&!P?x=BT[1]:R!==5&&R!==17&&(y=!0);break;case 16:y=!0;break}f>0&&(R===12||R===13)&&(x=E())}R===17&&(r.keepLines&&f>0?x=E():x=r.insertFinalNewline?u:"");let D=A.getTokenOffset()+s;b(x,w,D),T=R}return v}function Dhe(t,e){let r="";for(let n=0;n0&&!VDe(t,s-1);)s--;let w=l;for(;w1)return Dhe(u,f)+Dhe(m,n+h);let w=m.length*(n+h);return!d||w>Qdr[g][u].length?u+Dhe(m,n+h):w<=0?u:Qdr[g][u][w]}a(E,"newLinesAndIndent");function _(){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(_,"scanNext");let v=[];function b(w,R,x){!y&&(!e||Rc)&&t.substring(R,x)!==w&&v.push({offset:R,length:x-R,content:w})}a(b,"addEdit");let T=_();if(r.keepLines&&f>0&&b(Dhe(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?UT[m.length*n]:Dhe(m,n);b(R,s,w)}for(;T!==17;){let w=A.getTokenOffset()+A.getTokenLength()+s,R=_(),x="",P=!1;for(;f===0&&(R===12||R===13);){let N=A.getTokenOffset()+s;b(UT[1],w,N),w=A.getTokenOffset()+A.getTokenLength()+s,P=R===12,x=P?E():"",R=_()}if(R===2)T!==1&&h--,r.keepLines&&f>0||!r.keepLines&&T!==1?x=E():r.keepLines&&(x=UT[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=E():r.keepLines&&(x=UT[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=E():x=UT[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=E():x=UT[1];break;case 12:x=E();break;case 13:f>0?x=E():P||(x=UT[1]);break;case 6:r.keepLines&&f>0?x=E():P||(x=UT[1]);break;case 10:r.keepLines&&f>0?x=E():R===6&&!P&&(x="");break;case 7:case 8:case 9:case 11:case 2:case 4:r.keepLines&&f>0?x=E():(R===12||R===13)&&!P?x=UT[1]:R!==5&&R!==17&&(y=!0);break;case 16:y=!0;break}f>0&&(R===12||R===13)&&(x=E())}R===17&&(r.keepLines&&f>0?x=E():x=r.insertFinalNewline?u:"");let D=A.getTokenOffset()+s;b(x,w,D),T=R}return v}function Dhe(t,e){let r="";for(let n=0;n{"use strict";p();rlt();CJn();a(nlt,"format");a(Dhe,"repeat");a(UHs,"computeIndentLevel");a(QHs,"getEOL");a($De,"isEOL")});function bJn(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{zDe(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 olt(t,e=[],r=VDe.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"),zDe(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:IJn(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 WDe(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 qdr(t){if(!t.parent||!t.parent.children)return[];let e=qdr(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 ilt(t){switch(t.type){case"array":return t.children.map(ilt);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=ilt(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function jHs(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?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(l,"toOneArgVisit");function u(M){return M?O=>s===0&&M(O,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),E=u(e.onLiteralValue),_=l(e.onSeparator),v=c(e.onComment),b=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,O=[],j=[]){if(b(M),O.length+j.length>0){let Q=n.getToken();for(;Q!==17;){if(O.indexOf(Q)!==-1){R();break}else if(j.indexOf(Q)!==-1)break;Q=R()}}}a(x,"handleError");function P(M){let O=n.getTokenValue();return M?E(O):(m(O),o.push(O)),R(),!0}a(P,"parseString");function D(){switch(n.getToken()){case 11:let M=n.getTokenValue(),O=Number(M);isNaN(O)&&(x(2),O=0),E(O);break;case 7:E(null);break;case 8:E(!0);break;case 9:E(!1);break;default:return!1}return R(),!0}a(D,"parseLiteral");function N(){return n.getToken()!==10?(x(3,[],[2,5]),!1):(P(!1),n.getToken()===6?(_(":"),R(),q()||x(4,[],[2,5])):x(5,[],[2,5]),o.pop(),!0)}a(N,"parseProperty");function L(){h(),R();let M=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(M||x(4,[],[]),_(","),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(L,"parseObject");function B(){A(),R();let M=!0,O=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(O||x(4,[],[]),_(","),R(),n.getToken()===4&&w)break}else O&&x(6,[],[]);M?(o.push(0),M=!1):o[o.length-1]++,q()||x(4,[],[4,5]),O=!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 L();case 10:return P(!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 TJn(t,e){let r=BX(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 IJn(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 VDe,Hdr=ve(()=>{"use strict";p();rlt();(function(t){t.DEFAULT={allowTrailingComma:!1}})(VDe||(VDe={}));a(bJn,"getLocation");a(SJn,"parse");a(olt,"parseTree");a(WDe,"findNodeAtLocation");a(qdr,"getNodePath");a(ilt,"getNodeValue");a(jHs,"contains");a(jdr,"findNodeAtOffset");a(zDe,"visit");a(TJn,"stripComments");a(IJn,"getNodeType")});function xJn(t,e,r,n){let o=e.slice(),c=olt(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=WDe(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=WDe(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 FX(t,{offset:h,length:m-h,content:""},n)}else return FX(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 FX(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 FX(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 FX(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 FX(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 FX(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function FX(t,e,r){if(!r.formattingOptions)return[e];let n=slt(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!$De(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=slt(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 slt(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var wJn=ve(()=>{"use strict";p();Qdr();Hdr();a(xJn,"setProperty");a(FX,"withFormatting");a(slt,"applyEdit")});var RJn={};ki(RJn,{ParseErrorCode:()=>Vdr,ScanError:()=>Gdr,SyntaxKind:()=>$dr,applyEdits:()=>nGs,createScanner:()=>$Hs,findNodeAtLocation:()=>zHs,findNodeAtOffset:()=>YHs,format:()=>tGs,getLocation:()=>VHs,getNodePath:()=>KHs,getNodeValue:()=>JHs,modify:()=>rGs,parse:()=>Wdr,parseTree:()=>WHs,printParseErrorCode:()=>eGs,stripComments:()=>XHs,visit:()=>ZHs});function eGs(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 tGs(t,e,r){return nlt(t,e,r)}function rGs(t,e,r,n){return xJn(t,e,r,n)}function nGs(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=slt(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var $Hs,Gdr,$dr,VHs,Wdr,WHs,zHs,YHs,KHs,JHs,ZHs,XHs,Vdr,zdr=ve(()=>{"use strict";p();Qdr();wJn();rlt();Hdr();$Hs=BX;(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"})(Gdr||(Gdr={}));(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"})($dr||($dr={}));VHs=bJn,Wdr=SJn,WHs=olt,zHs=WDe,YHs=jdr,KHs=qdr,JHs=ilt,ZHs=zDe,XHs=TJn;(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"})(Vdr||(Vdr={}));a(eGs,"printParseErrorCode");a(tGs,"format");a(rGs,"modify");a(nGs,"applyEdits")});var UT=I(YX=>{"use strict";p();Object.defineProperty(YX,"__esModule",{value:!0});YX.DebugNameData=void 0;YX.getDebugName=Eei;YX.getClassName=_ei;YX.getFunctionName=vei;var tpr=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return Eei(e,this)}};YX.DebugNameData=tpr;var gei=new Map,rpr=new WeakMap;function Eei(t,e){let r=rpr.get(t);if(r)return r;let n=DWs(t,e);if(n){let o=gei.get(n)??0;o++,gei.set(n,o);let s=o===1?n:`${n}#${o}`;return rpr.set(t,s),s}}a(Eei,"getDebugName");function DWs(t,e){let r=rpr.get(t);if(r)return r;let n=e.owner?MWs(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=vei(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=NWs(e.owner,t);if(l!==void 0)return n+l}}a(DWs,"computeDebugName");function NWs(t,e){for(let r in t)if(t[r]===e)return r}a(NWs,"findKey");var Aei=new Map,yei=new WeakMap;function MWs(t){let e=yei.get(t);if(e)return e;let r=_ei(t)??"Object",n=Aei.get(r)??0;n++,Aei.set(r,n);let o=n===1?r:`${r}#${n}`;return yei.set(t,o),o}a(MWs,"formatOwner");function _ei(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(_ei,"getClassName");function vei(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(vei,"getFunctionName")});var Mei=I(_p=>{"use strict";p();var OWs=_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]})),LWs=_p&&_p.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BWs=_p&&_p.__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(Tei,"strictEqualsC");function Iei(t,e,r){return Sei.equals(t,e,r??fut)}a(Iei,"arrayEquals");function xei(t){return(e,r)=>Sei.equals(e,r,t??fut)}a(xei,"arrayEqualsC");function mNe(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;rmNe(t,e)}a(wei,"structuralEqualsC");function FWs(t){return JSON.stringify(npr(t))}a(FWs,"getStructuralKey");var UWs=0,Cei=new WeakMap;function npr(t){if(Array.isArray(t))return t.map(npr);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]=npr(e[n]);return r}else{let e=Cei.get(t);return e===void 0&&(e=UWs++,Cei.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(npr,"toNormalizedJsonStructure");function Rei(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(Rei,"jsonStringifyEquals");function kei(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(kei,"jsonStringifyEqualsC");function Pei(){return(t,e)=>t.equals(e)}a(Pei,"thisEqualsC");function Dei(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(Dei,"equalsIfDefined");function Nei(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(Nei,"equalsIfDefinedC");var bei;(function(t){t.strict=fut,t.strictC=Tei,t.array=Iei,t.arrayC=xei,t.structural=mNe,t.structuralC=wei,t.jsonStringify=Rei,t.jsonStringifyC=kei,t.thisC=Pei,t.ifDefined=Dei,t.ifDefinedC=Nei})(bei||(_p.equals=bei={}))});var gv=I(vp=>{"use strict";p();Object.defineProperty(vp,"__esModule",{value:!0});vp.trackDisposable=vp.toDisposable=vp.markAsDisposed=vp.DisposableStore=vp.Event=vp.onUnexpectedError=vp.onBugIndicatingError=vp.BugIndicatingError=vp.strictEquals=vp.assertFn=void 0;var QWs=rd();Object.defineProperty(vp,"assertFn",{enumerable:!0,get:a(function(){return QWs.assertFn},"get")});var qWs=Mei();Object.defineProperty(vp,"strictEquals",{enumerable:!0,get:a(function(){return qWs.strictEquals},"get")});var ipr=Rs();Object.defineProperty(vp,"BugIndicatingError",{enumerable:!0,get:a(function(){return ipr.BugIndicatingError},"get")});Object.defineProperty(vp,"onBugIndicatingError",{enumerable:!0,get:a(function(){return ipr.onBugIndicatingError},"get")});Object.defineProperty(vp,"onUnexpectedError",{enumerable:!0,get:a(function(){return ipr.onUnexpectedError},"get")});var jWs=Ic();Object.defineProperty(vp,"Event",{enumerable:!0,get:a(function(){return jWs.Event},"get")});var put=Ro();Object.defineProperty(vp,"DisposableStore",{enumerable:!0,get:a(function(){return put.DisposableStore},"get")});Object.defineProperty(vp,"markAsDisposed",{enumerable:!0,get:a(function(){return put.markAsDisposed},"get")});Object.defineProperty(vp,"toDisposable",{enumerable:!0,get:a(function(){return put.toDisposable},"get")});Object.defineProperty(vp,"trackDisposable",{enumerable:!0,get:a(function(){return put.trackDisposable},"get")})});var Oei=I(opr=>{"use strict";p();Object.defineProperty(opr,"__esModule",{value:!0});opr.handleBugIndicatingErrorRecovery=GWs;var HWs=gv();function GWs(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,HWs.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(GWs,"handleBugIndicatingErrorRecovery")});var o4=I(cme=>{"use strict";p();Object.defineProperty(cme,"__esModule",{value:!0});cme.addLogger=$Ws;cme.getLogger=VWs;cme.setLogObservableFn=WWs;cme.logObservable=zWs;var KX;function $Ws(t){KX?KX instanceof hut?KX.loggers.push(t):KX=new hut([KX,t]):KX=t}a($Ws,"addLogger");function VWs(){return KX}a(VWs,"getLogger");var spr;function WWs(t){spr=t}a(WWs,"setLogObservableFn");function zWs(t){spr&&spr(t)}a(zWs,"logObservable");var hut=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 _8=I(DH=>{"use strict";p();Object.defineProperty(DH,"__esModule",{value:!0});DH.TransactionImpl=void 0;DH.transaction=apr;DH.globalTransaction=KWs;DH.asyncTransaction=JWs;DH.subtransaction=ZWs;var Lei=Oei(),YWs=UT(),Bei=o4();function apr(t,e){let r=new lme(t,e);try{t(r)}finally{r.finish()}}a(apr,"transaction");var mut;function KWs(t){if(mut)t(mut);else{let e=new lme(t,void 0);mut=e;try{t(e)}finally{e.finish(),mut=void 0}}}a(KWs,"globalTransaction");async function JWs(t,e){let r=new lme(t,e);try{await t(r)}finally{r.finish()}}a(JWs,"asyncTransaction");function ZWs(t,e,r){t?e(t):apr(e,r)}a(ZWs,"subtransaction");var lme=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,Bei.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,YWs.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,Lei.handleBugIndicatingErrorRecovery)("Transaction already finished!"),apr(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,Lei.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(gut,"__esModule",{value:!0});gut.DebugLocation=void 0;var Fei;(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,cpr.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(Fei||(gut.DebugLocation=Fei={}));var cpr=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` -`),o=XWs(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 XWs(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(XWs,"parseLine")});var H2=I(s4=>{"use strict";p();Object.defineProperty(s4,"__esModule",{value:!0});s4.BaseObservable=s4.ConvenientObservable=void 0;s4._setDerivedOpts=tzs;s4._setRecomputeInitiallyAndOnChange=rzs;s4._setKeepObserved=nzs;s4._setDebugGetObservableGraph=izs;var Uei=QT(),ezs=UT(),ume=o4(),lpr;function tzs(t){lpr=t}a(tzs,"_setDerivedOpts");var Qei;function rzs(t){Qei=t}a(rzs,"_setRecomputeInitiallyAndOnChange");var qei;function nzs(t){qei=t}a(nzs,"_setKeepObserved");var upr;function izs(t){upr=t}a(izs,"_setDebugGetObservableGraph");var Aut=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=Uei.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return lpr({owner:o,debugName:a(()=>{let c=(0,ezs.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 lpr({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(Qei(this,r)),this}keepObserved(e){return e.add(qei(this)),this}get debugValue(){return this.get()}get debug(){return new dpr(this)}};s4.ConvenientObservable=Aut;var dpr=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return upr(this.observable,{type:"dependencies"})}getObserverGraph(){return upr(this.observable,{type:"observers"})}},fpr=class extends Aut{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,ume.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,ume.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,ume.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,ume.getLogger)();return(0,ume.logObservable)(this),e||(0,ume.getLogger)()?.handleObservableCreated(this,Uei.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};s4.BaseObservable=fpr});var v8=I(NH=>{"use strict";p();Object.defineProperty(NH,"__esModule",{value:!0});NH.DisposableObservableValue=NH.ObservableValue=void 0;NH.observableValue=azs;NH.disposableObservableValue=czs;var ozs=_8(),szs=H2(),Hei=gv(),yut=UT(),jei=o4(),Gei=QT();function azs(t,e,r=Gei.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new yut.DebugNameData(void 0,t,void 0):n=new yut.DebugNameData(t,void 0,void 0),new gNe(n,e,Hei.strictEquals,r)}a(azs,"observableValue");var gNe=class extends szs.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,jei.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 ozs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,jei.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}};NH.ObservableValue=gNe;function czs(t,e,r=Gei.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new yut.DebugNameData(void 0,t,void 0):n=new yut.DebugNameData(t,void 0,void 0),new Eut(n,e,Hei.strictEquals,r)}a(czs,"disposableObservableValue");var Eut=class extends gNe{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};NH.DisposableObservableValue=Eut});var Vei=I(_ut=>{"use strict";p();Object.defineProperty(_ut,"__esModule",{value:!0});_ut.LazyObservableValue=void 0;var lzs=_8(),$ei=o4(),uzs=H2(),ppr=class extends uzs.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,$ei.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,$ei.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 lzs.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}};_ut.LazyObservableValue=ppr});var vut=I(hpr=>{"use strict";p();Object.defineProperty(hpr,"__esModule",{value:!0});hpr.observableValueOpts=hzs;var Wei=UT(),zei=gv(),dzs=v8(),fzs=Vei(),pzs=QT();function hzs(t,e,r=pzs.DebugLocation.ofCaller()){return t.lazy?new fzs.LazyObservableValue(new Wei.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??zei.strictEquals,r):new dzs.ObservableValue(new Wei.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??zei.strictEquals,r)}a(hzs,"observableValueOpts")});var but=I(Cut=>{"use strict";p();Object.defineProperty(Cut,"__esModule",{value:!0});Cut.AutorunObserver=void 0;var tR=gv(),ANe=o4();function mzs(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(mzs,"autorunStateToString");var mpr=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,ANe.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,tR.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,ANe.getLogger)()?.handleAutorunDisposed(this),(0,tR.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,ANe.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,tR.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,ANe.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,tR.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,ANe.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,tR.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new tR.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 tR.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new tR.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new tR.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new tR.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:mzs(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,tR.onBugIndicatingError)(new tR.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Cut.AutorunObserver=mpr});var JX=I(rR=>{"use strict";p();Object.defineProperty(rR,"__esModule",{value:!0});rR.autorun=ypr;rR.autorunOpts=yNe;rR.autorunHandleChanges=Yei;rR.autorunWithStoreHandleChanges=yzs;rR.autorunWithStore=Ezs;rR.autorunDelta=_zs;rR.autorunIterableDelta=vzs;rR.autorunPerKeyedItem=Czs;rR.autorunSelfDisposable=bzs;rR.registerAutorunSelfDisposable=Szs;var dme=gv(),gpr=UT(),Apr=but(),fme=QT(),gzs=v8(),Azs=_8();function ypr(t,e=fme.DebugLocation.ofCaller()){return new Apr.AutorunObserver(new gpr.DebugNameData(void 0,void 0,t),t,void 0,e)}a(ypr,"autorun");function yNe(t,e,r=fme.DebugLocation.ofCaller()){return new Apr.AutorunObserver(new gpr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(yNe,"autorunOpts");function Yei(t,e,r=fme.DebugLocation.ofCaller()){return new Apr.AutorunObserver(new gpr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(Yei,"autorunHandleChanges");function yzs(t,e){let r=new dme.DisposableStore,n=Yei({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,dme.toDisposable)(()=>{n.dispose(),r.dispose()})}a(yzs,"autorunWithStoreHandleChanges");function Ezs(t){let e=new dme.DisposableStore,r=yNe({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,dme.toDisposable)(()=>{r.dispose(),e.dispose()})}a(Ezs,"autorunWithStore");function _zs(t,e){let r;return yNe({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(_zs,"autorunDelta");function vzs(t,e,r=n=>n){let n=new Map;return yNe({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(vzs,"autorunIterableDelta");function Czs(t,e,r,n=fme.DebugLocation.ofCaller()){let o=new Map,s=yNe({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,Azs.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 dme.DisposableStore,E={value:(0,gzs.observableValue)("keyedItem",h),store:A};o.set(m,E),d.push({key:m,cell:E})}}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,dme.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(Czs,"autorunPerKeyedItem");function bzs(t,e=fme.DebugLocation.ofCaller()){let r,n=!1;return r=ypr(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(bzs,"autorunSelfDisposable");function Szs(t,e,r=fme.DebugLocation.ofCaller()){let n,o=!1;n=ypr(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(Szs,"registerAutorunSelfDisposable")});var hme=I(pme=>{"use strict";p();Object.defineProperty(pme,"__esModule",{value:!0});pme.DerivedWithSetter=pme.Derived=void 0;var Tzs=H2(),ZX=gv(),Epr=o4();function Izs(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(Izs,"derivedStateToString");var Sut=class extends Tzs.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,Epr.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,Epr.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,ZX.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 ZX.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,ZX.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,Epr.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,ZX.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 ZX.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 ZX.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new ZX.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:Izs(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)}};pme.Derived=Sut;var _pr=class extends Sut{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};pme.DerivedWithSetter=_pr});var Tut=I(MH=>{"use strict";p();Object.defineProperty(MH,"__esModule",{value:!0});MH.derived=wzs;MH.derivedWithSetter=Rzs;MH.derivedOpts=Kei;MH.derivedHandleChanges=kzs;MH.derivedWithStore=Pzs;MH.derivedDisposable=Dzs;var a4=gv(),mme=QT(),eee=UT(),xzs=H2(),tee=hme();function wzs(t,e,r=mme.DebugLocation.ofCaller()){return e!==void 0?new tee.Derived(new eee.DebugNameData(t,void 0,e),e,void 0,void 0,a4.strictEquals,r):new tee.Derived(new eee.DebugNameData(void 0,void 0,t),t,void 0,void 0,a4.strictEquals,r)}a(wzs,"derived");function Rzs(t,e,r,n=mme.DebugLocation.ofCaller()){return new tee.DerivedWithSetter(new eee.DebugNameData(t,void 0,e),e,void 0,void 0,a4.strictEquals,r,n)}a(Rzs,"derivedWithSetter");function Kei(t,e,r=mme.DebugLocation.ofCaller()){return new tee.Derived(new eee.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??a4.strictEquals,r)}a(Kei,"derivedOpts");(0,xzs._setDerivedOpts)(Kei);function kzs(t,e,r=mme.DebugLocation.ofCaller()){return new tee.Derived(new eee.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??a4.strictEquals,r)}a(kzs,"derivedHandleChanges");function Pzs(t,e,r=mme.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new a4.DisposableStore;return new tee.Derived(new eee.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new a4.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),a4.strictEquals,r)}a(Pzs,"derivedWithStore");function Dzs(t,e,r=mme.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new tee.Derived(new eee.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new a4.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},a4.strictEquals,r)}a(Dzs,"derivedDisposable")});var Xei=I(nR=>{"use strict";p();Object.defineProperty(nR,"__esModule",{value:!0});nR.ObservableLazyPromise=nR.ObservableResolvedPromise=nR.PromiseResult=nR.ObservablePromise=nR.ObservableLazy=void 0;var Nzs=JX(),Jei=_8(),Zei=Tut(),Iut=v8(),xut=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,Iut.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};nR.ObservableLazy=xut;var wut=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,Iut.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,Zei.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,Jei.transaction)(n=>{this._value.set(new ENe(r,void 0),n)}),r),r=>{throw(0,Jei.transaction)(n=>{this._value.set(new ENe(void 0,r),n)}),r})}};nR.ObservablePromise=wut;var ENe=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};nR.PromiseResult=ENe;var vpr=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,Iut.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,Iut.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,Nzs.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)}))}};nR.ObservableResolvedPromise=vpr;var Cpr=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new xut(()=>new wut(this._computePromise())),this.cachedPromiseResult=(0,Zei.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};nR.ObservableLazyPromise=Cpr});var Spr=I(c4=>{"use strict";p();Object.defineProperty(c4,"__esModule",{value:!0});c4.cancelOnDispose=c4.CancellationTokenSource=c4.CancellationToken=c4.CancellationError=void 0;var Mzs=Rs();Object.defineProperty(c4,"CancellationError",{enumerable:!0,get:a(function(){return Mzs.CancellationError},"get")});var bpr=YP();Object.defineProperty(c4,"CancellationToken",{enumerable:!0,get:a(function(){return bpr.CancellationToken},"get")});Object.defineProperty(c4,"CancellationTokenSource",{enumerable:!0,get:a(function(){return bpr.CancellationTokenSource},"get")});Object.defineProperty(c4,"cancelOnDispose",{enumerable:!0,get:a(function(){return bpr.cancelOnDispose},"get")})});var eti=I(Rut=>{"use strict";p();Object.defineProperty(Rut,"__esModule",{value:!0});Rut.waitForState=Qzs;Rut.derivedWithCancellationToken=qzs;var Ozs=UT(),Tpr=Spr(),Lzs=gv(),Bzs=JX(),Fzs=hme(),Uzs=QT();function Qzs(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,Bzs.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 Tpr.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new Tpr.CancellationError);return}}c=!1,l&&d.dispose()})}a(Qzs,"waitForState");function qzs(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new Fzs.Derived(new Ozs.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new Tpr.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),Lzs.strictEquals,Uzs.DebugLocation.ofCaller())}a(qzs,"derivedWithCancellationToken")});var OH=I(ree=>{"use strict";p();Object.defineProperty(ree,"__esModule",{value:!0});ree.FromEventObservable=void 0;ree.observableFromEvent=Ipr;ree.observableFromEventOpts=Gzs;var jzs=_8(),rti=gv(),nti=UT(),tti=o4(),Hzs=H2(),iti=QT();function Ipr(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new G2(new nti.DebugNameData(e,void 0,n),r,n,()=>G2.globalTransaction,rti.strictEquals,o??iti.DebugLocation.ofCaller())}a(Ipr,"observableFromEvent");function Gzs(t,e,r,n=iti.DebugLocation.ofCaller()){return new G2(new nti.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??G2.globalTransaction,t.equalsFn??rti.strictEquals,n)}a(Gzs,"observableFromEventOpts");var G2=class extends Hzs.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,jzs.subtransaction)(this._getTransaction(),m=>{(0,tti.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,tti.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}}};ree.FromEventObservable=G2;(function(t){t.Observer=G2;function e(r,n){let o=!1;G2.globalTransaction===void 0&&(G2.globalTransaction=r,o=!0);try{n()}finally{o&&(G2.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(Ipr||(ree.observableFromEvent=Ipr={}))});var wpr=I(xpr=>{"use strict";p();Object.defineProperty(xpr,"__esModule",{value:!0});xpr.observableSignal=Yzs;var $zs=_8(),Vzs=UT(),Wzs=H2(),zzs=QT();function Yzs(t,e=zzs.DebugLocation.ofCaller()){return typeof t=="string"?new kut(t,void 0,e):new kut(void 0,t,e)}a(Yzs,"observableSignal");var kut=class extends Wzs.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new Vzs.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,$zs.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 Dut=I(RE=>{"use strict";p();Object.defineProperty(RE,"__esModule",{value:!0});RE.KeepAliveObserver=void 0;RE.observableFromPromise=Kzs;RE.signalFromObservable=Jzs;RE.debouncedObservable=Zzs;RE.throttledObservable=Xzs;RE.debouncedObservable2=eYs;RE.wasEventTriggeredRecently=tYs;RE.keepObserved=uti;RE.recomputeInitiallyAndOnChange=dti;RE.derivedObservableWithCache=rYs;RE.derivedObservableWithWritableCache=nYs;RE.mapObservableArrayCached=iYs;RE.isObservable=oYs;var oti=JX(),sti=v8(),Rpr=gv(),vNe=Tut(),ati=OH(),cti=wpr(),lti=H2(),kpr=QT();function Kzs(t){let e=(0,sti.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(Kzs,"observableFromPromise");function Jzs(t,e){return(0,vNe.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(Jzs,"signalFromObservable");function Zzs(t,e,r=kpr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,ati.observableFromEvent)(void 0,c=>{let l=(0,oti.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(Zzs,"debouncedObservable");function Xzs(t,e,r=kpr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,ati.observableFromEvent)(void 0,c=>{let l=(0,oti.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(Xzs,"throttledObservable");function eYs(t,e,r=kpr.DebugLocation.ofCaller()){let n=(0,cti.observableSignal)("handleTimeout"),o,s;return(0,vNe.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(eYs,"debouncedObservable2");function tYs(t,e,r){let n=(0,sti.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(tYs,"wasEventTriggeredRecently");function uti(t){let e=new _Ne(!1,void 0);return t.addObserver(e),(0,Rpr.toDisposable)(()=>{t.removeObserver(e)})}a(uti,"keepObserved");(0,lti._setKeepObserved)(uti);function dti(t,e){let r=new _Ne(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,Rpr.toDisposable)(()=>{t.removeObserver(r)})}a(dti,"recomputeInitiallyAndOnChange");(0,lti._setRecomputeInitiallyAndOnChange)(dti);var _Ne=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){}};RE.KeepAliveObserver=_Ne;function rYs(t,e){let r;return(0,vNe.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(rYs,"derivedObservableWithCache");function nYs(t,e){let r,n=(0,cti.observableSignal)("derivedObservableWithWritableCache"),o=(0,vNe.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(nYs,"derivedObservableWithWritableCache");function iYs(t,e,r,n){let o=new Put(r,n);return(0,vNe.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new Put(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a(iYs,"mapObservableArrayCached");var Put=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 Rpr.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 oYs(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(oYs,"isObservable")});var pti=I(Nut=>{"use strict";p();Object.defineProperty(Nut,"__esModule",{value:!0});Nut.recordChanges=sYs;Nut.recordChangesLazy=aYs;var fti=gv();function sYs(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 fti.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(sYs,"recordChanges");function aYs(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 fti.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(aYs,"recordChangesLazy")});var hti=I(Dpr=>{"use strict";p();Object.defineProperty(Dpr,"__esModule",{value:!0});Dpr.constObservable=lYs;var cYs=H2();function lYs(t){return new Ppr(t)}a(lYs,"constObservable");var Ppr=class extends cYs.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 mti=I(Mpr=>{"use strict";p();Object.defineProperty(Mpr,"__esModule",{value:!0});Mpr.observableSignalFromEvent=hYs;var uYs=_8(),dYs=UT(),fYs=H2(),pYs=QT();function hYs(t,e,r=pYs.DebugLocation.ofCaller()){return new Npr(typeof t=="string"?t:new dYs.DebugNameData(t,void 0,void 0),e,r)}a(hYs,"observableSignalFromEvent");var Npr=class extends fYs.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,uYs.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 gti=I(CNe=>{"use strict";p();Object.defineProperty(CNe,"__esModule",{value:!0});CNe.ValueWithChangeEventFromObservable=void 0;CNe.observableFromValueWithChangeEvent=AYs;var mYs=gv(),gYs=OH(),Mut=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return mYs.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};CNe.ValueWithChangeEventFromObservable=Mut;function AYs(t,e){return e instanceof Mut?e.observable:(0,gYs.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(AYs,"observableFromValueWithChangeEvent")});var Eti=I(bNe=>{"use strict";p();Object.defineProperty(bNe,"__esModule",{value:!0});bNe.runOnChange=Ati;bNe.runOnChangeWithStore=yti;bNe.runOnChangeWithCancellationToken=vYs;var yYs=Spr(),EYs=gv(),_Ys=JX();function Ati(t,e){let r,n=!0;return(0,_Ys.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(Ati,"runOnChange");function yti(t,e){let r=new EYs.DisposableStore,n=Ati(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(yti,"runOnChangeWithStore");function vYs(t,e){return yti(t,(r,n,o,s)=>{e(r,n,o,(0,yYs.cancelOnDispose)(s))})}a(vYs,"runOnChangeWithCancellationToken")});var Cti=I(Out=>{"use strict";p();Object.defineProperty(Out,"__esModule",{value:!0});Out.latestChangedValue=TYs;Out.derivedConstOnceDefined=IYs;var _ti=gv(),vti=UT(),CYs=OH(),bYs=JX(),SYs=Dut();function TYs(t,e){if(e.length===0)throw new _ti.BugIndicatingError;let r=!1,n,o=(0,CYs.observableFromEvent)(t,s=>{let c=new _ti.DisposableStore;for(let l of e)c.add((0,bYs.autorunOpts)({debugName:a(()=>(0,vti.getDebugName)(o,new vti.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(TYs,"latestChangedValue");function IYs(t,e){return(0,SYs.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(IYs,"derivedConstOnceDefined")});var bti=I(Lut=>{"use strict";p();Object.defineProperty(Lut,"__esModule",{value:!0});Lut.ObservableSet=void 0;var xYs=vut(),Opr=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,xYs.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"}};Lut.ObservableSet=Opr});var Sti=I(But=>{"use strict";p();Object.defineProperty(But,"__esModule",{value:!0});But.ObservableMap=void 0;var wYs=vut(),Lpr=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,wYs.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"}};But.ObservableMap=Lpr});var Qut=I(Eme=>{"use strict";p();Object.defineProperty(Eme,"__esModule",{value:!0});Eme.ConsoleObservableLogger=void 0;Eme.logObservableToConsole=PYs;Eme.formatValue=yme;var RYs=o4(),kYs=UT(),Tti=hme(),Fut;function PYs(t){Fut||(Fut=new Uut,(0,RYs.addLogger)(Fut)),Fut.addFilteredObj(t)}a(PYs,"logObservableToConsole");var Uut=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 DYs([gme(OYs("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[gme(" "),iR(yme(e.oldValue,70),{color:"red",strikeThrough:!0}),gme(" "),iR(yme(e.newValue,60),{color:"green"})]:[gme(" (unchanged)")]:[gme(" "),iR(yme(e.newValue,60),{color:"green"}),gme(" (initial)")]}handleObservableCreated(e){if(e instanceof Tti.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 Tti.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([Ame("observable value changed"),iR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return iR(" (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([Ame("derived recomputed"),iR(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([Ame("derived cleared"),iR(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Ame("observable from event triggered"),iR(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([Ame("autorun"),iR(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([Ame("transaction"),iR(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};Eme.ConsoleObservableLogger=Uut;function DYs(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(DYs,"consoleTextToArgs");function gme(t){return iR(t,{color:"black"})}a(gme,"normalText");function Ame(t){return iR(LYs(`${t}: `,10),{color:"black",bold:!0})}a(Ame,"formatKind");function iR(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(iR,"styled");function yme(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)?NYs(t,e):MYs(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a(yme,"formatValue");function NYs(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${yme(o,e-r.length)}`}return r+=" ]",r}a(NYs,"formatArray");function MYs(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,kYs.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}: ${yme(c,e-n.length)}`}return n+=r?")":" }",n}a(MYs,"formatObject");function OYs(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(OYs,"repeat");function LYs(t,e){for(;t.length{"use strict";p();Object.defineProperty(qut,"__esModule",{value:!0});qut.SimpleTypedRpcConnection=void 0;var Bpr=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}}};qut.SimpleTypedRpcConnection=Bpr});var xti=I(Fpr=>{"use strict";p();Object.defineProperty(Fpr,"__esModule",{value:!0});Fpr.registerDebugChannel=FYs;var BYs=Iti();function FYs(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=UYs({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},BYs.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(FYs,"registerDebugChannel");function UYs(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(UYs,"createChannelFactoryFromDebugChannel")});var kti=I(LH=>{"use strict";p();Object.defineProperty(LH,"__esModule",{value:!0});LH.Throttler=LH.Debouncer=void 0;LH.deepAssign=wti;LH.deepAssignDeleteNulls=Rti;var Upr=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)}};LH.Debouncer=Upr;var Qpr=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)}};LH.Throttler=Qpr;function wti(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?wti(t[r],e[r]):t[r]=e[r]}a(wti,"deepAssign");function Rti(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"?Rti(t[r],e[r]):t[r]=e[r]}a(Rti,"deepAssignDeleteNulls")});var Nti=I(Hut=>{"use strict";p();Object.defineProperty(Hut,"__esModule",{value:!0});Hut.DevToolsLogger=void 0;var Pti=but(),jut=Qut(),QYs=xti(),qpr=kti(),SNe=KS(),qYs=OH(),nee=Rs(),iee=hme(),Dti=v8(),jYs=QT(),jpr=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,nee.onUnexpectedError)(new nee.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,nee.onUnexpectedError)(new nee.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof iee.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(SNe.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 Pti.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 iee.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,QYs.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(SNe.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(SNe.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(SNe.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(SNe.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof iee.Derived)n.debugSetValue(r);else if(n instanceof Dti.ObservableValue)n.debugSetValue(r);else if(n instanceof qYs.FromEventObservable)n.debugSetValue(r);else throw new nee.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 iee.Derived)return(0,jut.formatValue)(r.debugGetState().value,200);if(r instanceof Dti.ObservableValue)return(0,jut.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 nee.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof iee.Derived)r.debugRecompute();else if(r instanceof Pti.AutorunObserver)r.debugRerun();else throw new nee.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new qpr.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},jYs.DebugLocation.enable()}_handleChange(e){(0,qpr.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,qpr.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 iee.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 iee.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,jut.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,jut.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)}};Hut.DevToolsLogger=jpr});var Bti=I(Hpr=>{"use strict";p();Object.defineProperty(Hpr,"__esModule",{value:!0});Hpr.debugGetObservableGraph=WYs;var HYs=hme(),GYs=OH(),$Ys=v8(),VYs=but(),Mti=Qut();function WYs(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=oee.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?Lti(n,0,o,e).trim():Oti(n,0,o,e).trim()}a(WYs,"debugGetObservableGraph");function Oti(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,Mti.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=oee.from(l,n.debugNamePostProcessor??(d=>d))??oee.unknown(l);s.push(Oti(u,e+1,r,n))}}return s.join(` -`)}a(Oti,"formatObservableInfoWithDependencies");function Lti(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,Mti.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=oee.from(l,n.debugNamePostProcessor??(d=>d))??oee.unknown(l);s.push(Lti(u,e+1,r,n))}}return s.join(` -`)}a(Lti,"formatObservableInfoWithObservers");var oee=class t{static{a(this,"Info")}static from(e,r){if(e instanceof VYs.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 HYs.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 $Ys.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof GYs.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 C8=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 zYs=vut();Object.defineProperty(Ut,"observableValueOpts",{enumerable:!0,get:a(function(){return zYs.observableValueOpts},"get")});var l4=JX();Object.defineProperty(Ut,"autorun",{enumerable:!0,get:a(function(){return l4.autorun},"get")});Object.defineProperty(Ut,"autorunDelta",{enumerable:!0,get:a(function(){return l4.autorunDelta},"get")});Object.defineProperty(Ut,"autorunHandleChanges",{enumerable:!0,get:a(function(){return l4.autorunHandleChanges},"get")});Object.defineProperty(Ut,"autorunOpts",{enumerable:!0,get:a(function(){return l4.autorunOpts},"get")});Object.defineProperty(Ut,"autorunWithStore",{enumerable:!0,get:a(function(){return l4.autorunWithStore},"get")});Object.defineProperty(Ut,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return l4.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Ut,"autorunIterableDelta",{enumerable:!0,get:a(function(){return l4.autorunIterableDelta},"get")});Object.defineProperty(Ut,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return l4.autorunPerKeyedItem},"get")});Object.defineProperty(Ut,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return l4.autorunSelfDisposable},"get")});Object.defineProperty(Ut,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return l4.registerAutorunSelfDisposable},"get")});var YYs=v8();Object.defineProperty(Ut,"disposableObservableValue",{enumerable:!0,get:a(function(){return YYs.disposableObservableValue},"get")});var _me=Tut();Object.defineProperty(Ut,"derived",{enumerable:!0,get:a(function(){return _me.derived},"get")});Object.defineProperty(Ut,"derivedDisposable",{enumerable:!0,get:a(function(){return _me.derivedDisposable},"get")});Object.defineProperty(Ut,"derivedHandleChanges",{enumerable:!0,get:a(function(){return _me.derivedHandleChanges},"get")});Object.defineProperty(Ut,"derivedOpts",{enumerable:!0,get:a(function(){return _me.derivedOpts},"get")});Object.defineProperty(Ut,"derivedWithSetter",{enumerable:!0,get:a(function(){return _me.derivedWithSetter},"get")});Object.defineProperty(Ut,"derivedWithStore",{enumerable:!0,get:a(function(){return _me.derivedWithStore},"get")});var TNe=Xei();Object.defineProperty(Ut,"ObservableLazy",{enumerable:!0,get:a(function(){return TNe.ObservableLazy},"get")});Object.defineProperty(Ut,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return TNe.ObservableLazyPromise},"get")});Object.defineProperty(Ut,"ObservablePromise",{enumerable:!0,get:a(function(){return TNe.ObservablePromise},"get")});Object.defineProperty(Ut,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return TNe.ObservableResolvedPromise},"get")});Object.defineProperty(Ut,"PromiseResult",{enumerable:!0,get:a(function(){return TNe.PromiseResult},"get")});var Uti=eti();Object.defineProperty(Ut,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return Uti.derivedWithCancellationToken},"get")});Object.defineProperty(Ut,"waitForState",{enumerable:!0,get:a(function(){return Uti.waitForState},"get")});var oR=Dut();Object.defineProperty(Ut,"debouncedObservable",{enumerable:!0,get:a(function(){return oR.debouncedObservable},"get")});Object.defineProperty(Ut,"debouncedObservable2",{enumerable:!0,get:a(function(){return oR.debouncedObservable2},"get")});Object.defineProperty(Ut,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return oR.derivedObservableWithCache},"get")});Object.defineProperty(Ut,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return oR.derivedObservableWithWritableCache},"get")});Object.defineProperty(Ut,"keepObserved",{enumerable:!0,get:a(function(){return oR.keepObserved},"get")});Object.defineProperty(Ut,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return oR.mapObservableArrayCached},"get")});Object.defineProperty(Ut,"observableFromPromise",{enumerable:!0,get:a(function(){return oR.observableFromPromise},"get")});Object.defineProperty(Ut,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return oR.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Ut,"signalFromObservable",{enumerable:!0,get:a(function(){return oR.signalFromObservable},"get")});Object.defineProperty(Ut,"throttledObservable",{enumerable:!0,get:a(function(){return oR.throttledObservable},"get")});Object.defineProperty(Ut,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return oR.wasEventTriggeredRecently},"get")});Object.defineProperty(Ut,"isObservable",{enumerable:!0,get:a(function(){return oR.isObservable},"get")});var Qti=pti();Object.defineProperty(Ut,"recordChanges",{enumerable:!0,get:a(function(){return Qti.recordChanges},"get")});Object.defineProperty(Ut,"recordChangesLazy",{enumerable:!0,get:a(function(){return Qti.recordChangesLazy},"get")});var KYs=hti();Object.defineProperty(Ut,"constObservable",{enumerable:!0,get:a(function(){return KYs.constObservable},"get")});var JYs=wpr();Object.defineProperty(Ut,"observableSignal",{enumerable:!0,get:a(function(){return JYs.observableSignal},"get")});var ZYs=OH();Object.defineProperty(Ut,"observableFromEventOpts",{enumerable:!0,get:a(function(){return ZYs.observableFromEventOpts},"get")});var XYs=mti();Object.defineProperty(Ut,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return XYs.observableSignalFromEvent},"get")});var INe=_8();Object.defineProperty(Ut,"asyncTransaction",{enumerable:!0,get:a(function(){return INe.asyncTransaction},"get")});Object.defineProperty(Ut,"globalTransaction",{enumerable:!0,get:a(function(){return INe.globalTransaction},"get")});Object.defineProperty(Ut,"subtransaction",{enumerable:!0,get:a(function(){return INe.subtransaction},"get")});Object.defineProperty(Ut,"transaction",{enumerable:!0,get:a(function(){return INe.transaction},"get")});Object.defineProperty(Ut,"TransactionImpl",{enumerable:!0,get:a(function(){return INe.TransactionImpl},"get")});var qti=gti();Object.defineProperty(Ut,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return qti.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Ut,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return qti.ValueWithChangeEventFromObservable},"get")});var Gpr=Eti();Object.defineProperty(Ut,"runOnChange",{enumerable:!0,get:a(function(){return Gpr.runOnChange},"get")});Object.defineProperty(Ut,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return Gpr.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Ut,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return Gpr.runOnChangeWithStore},"get")});var jti=Cti();Object.defineProperty(Ut,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return jti.derivedConstOnceDefined},"get")});Object.defineProperty(Ut,"latestChangedValue",{enumerable:!0,get:a(function(){return jti.latestChangedValue},"get")});var eKs=OH();Object.defineProperty(Ut,"observableFromEvent",{enumerable:!0,get:a(function(){return eKs.observableFromEvent},"get")});var tKs=v8();Object.defineProperty(Ut,"observableValue",{enumerable:!0,get:a(function(){return tKs.observableValue},"get")});var rKs=bti();Object.defineProperty(Ut,"ObservableSet",{enumerable:!0,get:a(function(){return rKs.ObservableSet},"get")});var nKs=Sti();Object.defineProperty(Ut,"ObservableMap",{enumerable:!0,get:a(function(){return nKs.ObservableMap},"get")});var iKs=QT();Object.defineProperty(Ut,"DebugLocation",{enumerable:!0,get:a(function(){return iKs.DebugLocation},"get")});var $pr=o4(),Hti=Qut(),oKs=Nti(),Fti=owe(),sKs=H2(),aKs=Bti();(0,sKs._setDebugGetObservableGraph)(aKs.debugGetObservableGraph);(0,$pr.setLogObservableFn)(Hti.logObservableToConsole);var cKs=!1;cKs&&(0,$pr.addLogger)(new Hti.ConsoleObservableLogger);Fti.env&&Fti.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,$pr.addLogger)(oKs.DevToolsLogger.getInstance())});var hd=I(vme=>{"use strict";p();Object.defineProperty(vme,"__esModule",{value:!0});vme.OffsetRangeSet=vme.OffsetRange=void 0;var Gut=Rs(),$ut=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 Gut.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 Gut.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Gut.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)}};vme.OffsetRangeSet=Vpr});var $2=I(Sme=>{"use strict";p();Object.defineProperty(Sme,"__esModule",{value:!0});Sme.LineRangeSet=Sme.LineRange=void 0;var Gti=Rs(),lKs=hd(),$ti=eh(),Cme=xq(),Vti=Sl(),bme=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,Vti.compareBy)(e=>e.startLineNumber,Vti.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new Gti.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,Cme.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,Cme.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,Cme.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 bme(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,Cme.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,Cme.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 bme(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};Sme.LineRangeSet=xNe});var Tme=I(Wut=>{"use strict";p();Object.defineProperty(Wut,"__esModule",{value:!0});Wut.TextLength=void 0;var uKs=$2(),Wti=q_(),Vut=eh(),Wpr=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 Vut.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Vut.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Vut.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return uKs.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new Wti.Position(e.lineNumber,e.column+this.columnCount):new Wti.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Vut.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};Wut.TextLength=Wpr});var Yut=I(see=>{"use strict";p();Object.defineProperty(see,"__esModule",{value:!0});see.PositionOffsetTransformer=see.PositionOffsetTransformerBase=void 0;see._setPositionOffsetTransformerDependencies=hKs;var dKs=xq(),fKs=hd(),wNe=q_(),pKs=eh(),zut=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new fKs.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return pKs.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new b8.deps.StringEdit(r)}getStringReplacement(e){return new b8.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new b8.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new b8.deps.TextEdit(r)}};see.PositionOffsetTransformerBase=zut;var b8=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 hKs(t){b8._deps=t}a(hKs,"_setPositionOffsetTransformerDependencies");var zpr=class extends zut{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 wNe.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new wNe.Position(r,o+1)}if(e.column<1)return new wNe.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new wNe.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,dKs.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new wNe.Position(n,o)}getTextLength(e){return b8.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new b8.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};see.PositionOffsetTransformer=zpr});var qT=I(u4=>{"use strict";p();Object.defineProperty(u4,"__esModule",{value:!0});u4.StringText=u4.ArrayText=u4.LineBasedText=u4.AbstractText=void 0;var mKs=rd(),gKs=em(),AKs=q_(),zti=eh(),yKs=Tme(),Yti=Yut(),RNe=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new AKs.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 zti.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Yti.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new zti.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,gKs.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};u4.AbstractText=RNe;var Kut=class extends RNe{static{a(this,"LineBasedText")}constructor(e,r){(0,mKs.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{"use strict";p();ilt();bJn();a(olt,"format");a(Dhe,"repeat");a(GHs,"computeIndentLevel");a($Hs,"getEOL");a(VDe,"isEOL")});function SJn(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{YDe(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 alt(t,e=[],r=WDe.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"),YDe(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:xJn(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 zDe(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 jdr(t){if(!t.parent||!t.parent.children)return[];let e=jdr(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 slt(t){switch(t.type){case"array":return t.children.map(slt);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=slt(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function WHs(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?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(l,"toOneArgVisit");function u(M){return M?O=>s===0&&M(O,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),E=u(e.onLiteralValue),_=l(e.onSeparator),v=c(e.onComment),b=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,O=[],j=[]){if(b(M),O.length+j.length>0){let Q=n.getToken();for(;Q!==17;){if(O.indexOf(Q)!==-1){R();break}else if(j.indexOf(Q)!==-1)break;Q=R()}}}a(x,"handleError");function P(M){let O=n.getTokenValue();return M?E(O):(m(O),o.push(O)),R(),!0}a(P,"parseString");function D(){switch(n.getToken()){case 11:let M=n.getTokenValue(),O=Number(M);isNaN(O)&&(x(2),O=0),E(O);break;case 7:E(null);break;case 8:E(!0);break;case 9:E(!1);break;default:return!1}return R(),!0}a(D,"parseLiteral");function N(){return n.getToken()!==10?(x(3,[],[2,5]),!1):(P(!1),n.getToken()===6?(_(":"),R(),q()||x(4,[],[2,5])):x(5,[],[2,5]),o.pop(),!0)}a(N,"parseProperty");function L(){h(),R();let M=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(M||x(4,[],[]),_(","),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(L,"parseObject");function B(){A(),R();let M=!0,O=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(O||x(4,[],[]),_(","),R(),n.getToken()===4&&w)break}else O&&x(6,[],[]);M?(o.push(0),M=!1):o[o.length-1]++,q()||x(4,[],[4,5]),O=!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 L();case 10:return P(!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 IJn(t,e){let r=BX(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 xJn(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 WDe,Gdr=ve(()=>{"use strict";p();ilt();(function(t){t.DEFAULT={allowTrailingComma:!1}})(WDe||(WDe={}));a(SJn,"getLocation");a(TJn,"parse");a(alt,"parseTree");a(zDe,"findNodeAtLocation");a(jdr,"getNodePath");a(slt,"getNodeValue");a(WHs,"contains");a(Hdr,"findNodeAtOffset");a(YDe,"visit");a(IJn,"stripComments");a(xJn,"getNodeType")});function wJn(t,e,r,n){let o=e.slice(),c=alt(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=zDe(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=zDe(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 FX(t,{offset:h,length:m-h,content:""},n)}else return FX(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 FX(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 FX(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 FX(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 FX(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 FX(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function FX(t,e,r){if(!r.formattingOptions)return[e];let n=clt(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!VDe(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=clt(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 clt(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var RJn=ve(()=>{"use strict";p();qdr();Gdr();a(wJn,"setProperty");a(FX,"withFormatting");a(clt,"applyEdit")});var kJn={};ki(kJn,{ParseErrorCode:()=>Wdr,ScanError:()=>$dr,SyntaxKind:()=>Vdr,applyEdits:()=>cGs,createScanner:()=>KHs,findNodeAtLocation:()=>XHs,findNodeAtOffset:()=>eGs,format:()=>sGs,getLocation:()=>JHs,getNodePath:()=>tGs,getNodeValue:()=>rGs,modify:()=>aGs,parse:()=>zdr,parseTree:()=>ZHs,printParseErrorCode:()=>oGs,stripComments:()=>iGs,visit:()=>nGs});function oGs(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 sGs(t,e,r){return olt(t,e,r)}function aGs(t,e,r,n){return wJn(t,e,r,n)}function cGs(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=clt(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var KHs,$dr,Vdr,JHs,zdr,ZHs,XHs,eGs,tGs,rGs,nGs,iGs,Wdr,Ydr=ve(()=>{"use strict";p();qdr();RJn();ilt();Gdr();KHs=BX;(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"})($dr||($dr={}));(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"})(Vdr||(Vdr={}));JHs=SJn,zdr=TJn,ZHs=alt,XHs=zDe,eGs=Hdr,tGs=jdr,rGs=slt,nGs=YDe,iGs=IJn;(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"})(Wdr||(Wdr={}));a(oGs,"printParseErrorCode");a(sGs,"format");a(aGs,"modify");a(cGs,"applyEdits")});var qT=I(YX=>{"use strict";p();Object.defineProperty(YX,"__esModule",{value:!0});YX.DebugNameData=void 0;YX.getDebugName=bei;YX.getClassName=Sei;YX.getFunctionName=Tei;var rpr=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return bei(e,this)}};YX.DebugNameData=rpr;var _ei=new Map,npr=new WeakMap;function bei(t,e){let r=npr.get(t);if(r)return r;let n=FWs(t,e);if(n){let o=_ei.get(n)??0;o++,_ei.set(n,o);let s=o===1?n:`${n}#${o}`;return npr.set(t,s),s}}a(bei,"getDebugName");function FWs(t,e){let r=npr.get(t);if(r)return r;let n=e.owner?QWs(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=Tei(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=UWs(e.owner,t);if(l!==void 0)return n+l}}a(FWs,"computeDebugName");function UWs(t,e){for(let r in t)if(t[r]===e)return r}a(UWs,"findKey");var vei=new Map,Cei=new WeakMap;function QWs(t){let e=Cei.get(t);if(e)return e;let r=Sei(t)??"Object",n=vei.get(r)??0;n++,vei.set(r,n);let o=n===1?r:`${r}#${n}`;return Cei.set(t,o),o}a(QWs,"formatOwner");function Sei(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(Sei,"getClassName");function Tei(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(Tei,"getFunctionName")});var Fei=I(_p=>{"use strict";p();var qWs=_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]})),jWs=_p&&_p.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HWs=_p&&_p.__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(Rei,"strictEqualsC");function kei(t,e,r){return wei.equals(t,e,r??put)}a(kei,"arrayEquals");function Pei(t){return(e,r)=>wei.equals(e,r,t??put)}a(Pei,"arrayEqualsC");function ANe(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;rANe(t,e)}a(Dei,"structuralEqualsC");function GWs(t){return JSON.stringify(ipr(t))}a(GWs,"getStructuralKey");var $Ws=0,Iei=new WeakMap;function ipr(t){if(Array.isArray(t))return t.map(ipr);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]=ipr(e[n]);return r}else{let e=Iei.get(t);return e===void 0&&(e=$Ws++,Iei.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(ipr,"toNormalizedJsonStructure");function Nei(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(Nei,"jsonStringifyEquals");function Mei(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(Mei,"jsonStringifyEqualsC");function Oei(){return(t,e)=>t.equals(e)}a(Oei,"thisEqualsC");function Lei(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(Lei,"equalsIfDefined");function Bei(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(Bei,"equalsIfDefinedC");var xei;(function(t){t.strict=put,t.strictC=Rei,t.array=kei,t.arrayC=Pei,t.structural=ANe,t.structuralC=Dei,t.jsonStringify=Nei,t.jsonStringifyC=Mei,t.thisC=Oei,t.ifDefined=Lei,t.ifDefinedC=Bei})(xei||(_p.equals=xei={}))});var Av=I(vp=>{"use strict";p();Object.defineProperty(vp,"__esModule",{value:!0});vp.trackDisposable=vp.toDisposable=vp.markAsDisposed=vp.DisposableStore=vp.Event=vp.onUnexpectedError=vp.onBugIndicatingError=vp.BugIndicatingError=vp.strictEquals=vp.assertFn=void 0;var VWs=rd();Object.defineProperty(vp,"assertFn",{enumerable:!0,get:a(function(){return VWs.assertFn},"get")});var WWs=Fei();Object.defineProperty(vp,"strictEquals",{enumerable:!0,get:a(function(){return WWs.strictEquals},"get")});var opr=Rs();Object.defineProperty(vp,"BugIndicatingError",{enumerable:!0,get:a(function(){return opr.BugIndicatingError},"get")});Object.defineProperty(vp,"onBugIndicatingError",{enumerable:!0,get:a(function(){return opr.onBugIndicatingError},"get")});Object.defineProperty(vp,"onUnexpectedError",{enumerable:!0,get:a(function(){return opr.onUnexpectedError},"get")});var zWs=Ic();Object.defineProperty(vp,"Event",{enumerable:!0,get:a(function(){return zWs.Event},"get")});var hut=ko();Object.defineProperty(vp,"DisposableStore",{enumerable:!0,get:a(function(){return hut.DisposableStore},"get")});Object.defineProperty(vp,"markAsDisposed",{enumerable:!0,get:a(function(){return hut.markAsDisposed},"get")});Object.defineProperty(vp,"toDisposable",{enumerable:!0,get:a(function(){return hut.toDisposable},"get")});Object.defineProperty(vp,"trackDisposable",{enumerable:!0,get:a(function(){return hut.trackDisposable},"get")})});var Uei=I(spr=>{"use strict";p();Object.defineProperty(spr,"__esModule",{value:!0});spr.handleBugIndicatingErrorRecovery=KWs;var YWs=Av();function KWs(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,YWs.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(KWs,"handleBugIndicatingErrorRecovery")});var o4=I(lme=>{"use strict";p();Object.defineProperty(lme,"__esModule",{value:!0});lme.addLogger=JWs;lme.getLogger=ZWs;lme.setLogObservableFn=XWs;lme.logObservable=ezs;var KX;function JWs(t){KX?KX instanceof mut?KX.loggers.push(t):KX=new mut([KX,t]):KX=t}a(JWs,"addLogger");function ZWs(){return KX}a(ZWs,"getLogger");var apr;function XWs(t){apr=t}a(XWs,"setLogObservableFn");function ezs(t){apr&&apr(t)}a(ezs,"logObservable");var mut=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 v8=I(NH=>{"use strict";p();Object.defineProperty(NH,"__esModule",{value:!0});NH.TransactionImpl=void 0;NH.transaction=cpr;NH.globalTransaction=rzs;NH.asyncTransaction=nzs;NH.subtransaction=izs;var Qei=Uei(),tzs=qT(),qei=o4();function cpr(t,e){let r=new ume(t,e);try{t(r)}finally{r.finish()}}a(cpr,"transaction");var gut;function rzs(t){if(gut)t(gut);else{let e=new ume(t,void 0);gut=e;try{t(e)}finally{e.finish(),gut=void 0}}}a(rzs,"globalTransaction");async function nzs(t,e){let r=new ume(t,e);try{await t(r)}finally{r.finish()}}a(nzs,"asyncTransaction");function izs(t,e,r){t?e(t):cpr(e,r)}a(izs,"subtransaction");var ume=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,qei.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,tzs.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,Qei.handleBugIndicatingErrorRecovery)("Transaction already finished!"),cpr(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,Qei.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(Aut,"__esModule",{value:!0});Aut.DebugLocation=void 0;var jei;(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,lpr.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(jei||(Aut.DebugLocation=jei={}));var lpr=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` +`),o=ozs(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 ozs(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(ozs,"parseLine")});var G2=I(s4=>{"use strict";p();Object.defineProperty(s4,"__esModule",{value:!0});s4.BaseObservable=s4.ConvenientObservable=void 0;s4._setDerivedOpts=azs;s4._setRecomputeInitiallyAndOnChange=czs;s4._setKeepObserved=lzs;s4._setDebugGetObservableGraph=uzs;var Hei=jT(),szs=qT(),dme=o4(),upr;function azs(t){upr=t}a(azs,"_setDerivedOpts");var Gei;function czs(t){Gei=t}a(czs,"_setRecomputeInitiallyAndOnChange");var $ei;function lzs(t){$ei=t}a(lzs,"_setKeepObserved");var dpr;function uzs(t){dpr=t}a(uzs,"_setDebugGetObservableGraph");var yut=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=Hei.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return upr({owner:o,debugName:a(()=>{let c=(0,szs.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 upr({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(Gei(this,r)),this}keepObserved(e){return e.add($ei(this)),this}get debugValue(){return this.get()}get debug(){return new fpr(this)}};s4.ConvenientObservable=yut;var fpr=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return dpr(this.observable,{type:"dependencies"})}getObserverGraph(){return dpr(this.observable,{type:"observers"})}},ppr=class extends yut{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,dme.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,dme.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,dme.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,dme.getLogger)();return(0,dme.logObservable)(this),e||(0,dme.getLogger)()?.handleObservableCreated(this,Hei.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};s4.BaseObservable=ppr});var C8=I(MH=>{"use strict";p();Object.defineProperty(MH,"__esModule",{value:!0});MH.DisposableObservableValue=MH.ObservableValue=void 0;MH.observableValue=pzs;MH.disposableObservableValue=hzs;var dzs=v8(),fzs=G2(),Wei=Av(),Eut=qT(),Vei=o4(),zei=jT();function pzs(t,e,r=zei.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Eut.DebugNameData(void 0,t,void 0):n=new Eut.DebugNameData(t,void 0,void 0),new yNe(n,e,Wei.strictEquals,r)}a(pzs,"observableValue");var yNe=class extends fzs.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,Vei.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 dzs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,Vei.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}};MH.ObservableValue=yNe;function hzs(t,e,r=zei.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Eut.DebugNameData(void 0,t,void 0):n=new Eut.DebugNameData(t,void 0,void 0),new _ut(n,e,Wei.strictEquals,r)}a(hzs,"disposableObservableValue");var _ut=class extends yNe{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};MH.DisposableObservableValue=_ut});var Kei=I(vut=>{"use strict";p();Object.defineProperty(vut,"__esModule",{value:!0});vut.LazyObservableValue=void 0;var mzs=v8(),Yei=o4(),gzs=G2(),hpr=class extends gzs.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,Yei.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,Yei.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 mzs.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}};vut.LazyObservableValue=hpr});var Cut=I(mpr=>{"use strict";p();Object.defineProperty(mpr,"__esModule",{value:!0});mpr.observableValueOpts=_zs;var Jei=qT(),Zei=Av(),Azs=C8(),yzs=Kei(),Ezs=jT();function _zs(t,e,r=Ezs.DebugLocation.ofCaller()){return t.lazy?new yzs.LazyObservableValue(new Jei.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??Zei.strictEquals,r):new Azs.ObservableValue(new Jei.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??Zei.strictEquals,r)}a(_zs,"observableValueOpts")});var Sut=I(but=>{"use strict";p();Object.defineProperty(but,"__esModule",{value:!0});but.AutorunObserver=void 0;var rR=Av(),ENe=o4();function vzs(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(vzs,"autorunStateToString");var gpr=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,ENe.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,ENe.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,ENe.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,ENe.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,ENe.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:vzs(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}};but.AutorunObserver=gpr});var JX=I(nR=>{"use strict";p();Object.defineProperty(nR,"__esModule",{value:!0});nR.autorun=Epr;nR.autorunOpts=_Ne;nR.autorunHandleChanges=Xei;nR.autorunWithStoreHandleChanges=Szs;nR.autorunWithStore=Tzs;nR.autorunDelta=Izs;nR.autorunIterableDelta=xzs;nR.autorunPerKeyedItem=wzs;nR.autorunSelfDisposable=Rzs;nR.registerAutorunSelfDisposable=kzs;var fme=Av(),Apr=qT(),ypr=Sut(),pme=jT(),Czs=C8(),bzs=v8();function Epr(t,e=pme.DebugLocation.ofCaller()){return new ypr.AutorunObserver(new Apr.DebugNameData(void 0,void 0,t),t,void 0,e)}a(Epr,"autorun");function _Ne(t,e,r=pme.DebugLocation.ofCaller()){return new ypr.AutorunObserver(new Apr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(_Ne,"autorunOpts");function Xei(t,e,r=pme.DebugLocation.ofCaller()){return new ypr.AutorunObserver(new Apr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(Xei,"autorunHandleChanges");function Szs(t,e){let r=new fme.DisposableStore,n=Xei({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,fme.toDisposable)(()=>{n.dispose(),r.dispose()})}a(Szs,"autorunWithStoreHandleChanges");function Tzs(t){let e=new fme.DisposableStore,r=_Ne({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,fme.toDisposable)(()=>{r.dispose(),e.dispose()})}a(Tzs,"autorunWithStore");function Izs(t,e){let r;return _Ne({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(Izs,"autorunDelta");function xzs(t,e,r=n=>n){let n=new Map;return _Ne({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(xzs,"autorunIterableDelta");function wzs(t,e,r,n=pme.DebugLocation.ofCaller()){let o=new Map,s=_Ne({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,bzs.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 fme.DisposableStore,E={value:(0,Czs.observableValue)("keyedItem",h),store:A};o.set(m,E),d.push({key:m,cell:E})}}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,fme.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(wzs,"autorunPerKeyedItem");function Rzs(t,e=pme.DebugLocation.ofCaller()){let r,n=!1;return r=Epr(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(Rzs,"autorunSelfDisposable");function kzs(t,e,r=pme.DebugLocation.ofCaller()){let n,o=!1;n=Epr(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(kzs,"registerAutorunSelfDisposable")});var mme=I(hme=>{"use strict";p();Object.defineProperty(hme,"__esModule",{value:!0});hme.DerivedWithSetter=hme.Derived=void 0;var Pzs=G2(),ZX=Av(),_pr=o4();function Dzs(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(Dzs,"derivedStateToString");var Tut=class extends Pzs.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,_pr.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,_pr.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,ZX.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 ZX.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,ZX.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,_pr.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,ZX.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 ZX.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 ZX.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new ZX.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:Dzs(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)}};hme.Derived=Tut;var vpr=class extends Tut{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};hme.DerivedWithSetter=vpr});var Iut=I(OH=>{"use strict";p();Object.defineProperty(OH,"__esModule",{value:!0});OH.derived=Mzs;OH.derivedWithSetter=Ozs;OH.derivedOpts=eti;OH.derivedHandleChanges=Lzs;OH.derivedWithStore=Bzs;OH.derivedDisposable=Fzs;var a4=Av(),gme=jT(),eee=qT(),Nzs=G2(),tee=mme();function Mzs(t,e,r=gme.DebugLocation.ofCaller()){return e!==void 0?new tee.Derived(new eee.DebugNameData(t,void 0,e),e,void 0,void 0,a4.strictEquals,r):new tee.Derived(new eee.DebugNameData(void 0,void 0,t),t,void 0,void 0,a4.strictEquals,r)}a(Mzs,"derived");function Ozs(t,e,r,n=gme.DebugLocation.ofCaller()){return new tee.DerivedWithSetter(new eee.DebugNameData(t,void 0,e),e,void 0,void 0,a4.strictEquals,r,n)}a(Ozs,"derivedWithSetter");function eti(t,e,r=gme.DebugLocation.ofCaller()){return new tee.Derived(new eee.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??a4.strictEquals,r)}a(eti,"derivedOpts");(0,Nzs._setDerivedOpts)(eti);function Lzs(t,e,r=gme.DebugLocation.ofCaller()){return new tee.Derived(new eee.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??a4.strictEquals,r)}a(Lzs,"derivedHandleChanges");function Bzs(t,e,r=gme.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new a4.DisposableStore;return new tee.Derived(new eee.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new a4.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),a4.strictEquals,r)}a(Bzs,"derivedWithStore");function Fzs(t,e,r=gme.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new tee.Derived(new eee.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new a4.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},a4.strictEquals,r)}a(Fzs,"derivedDisposable")});var nti=I(iR=>{"use strict";p();Object.defineProperty(iR,"__esModule",{value:!0});iR.ObservableLazyPromise=iR.ObservableResolvedPromise=iR.PromiseResult=iR.ObservablePromise=iR.ObservableLazy=void 0;var Uzs=JX(),tti=v8(),rti=Iut(),xut=C8(),wut=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,xut.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};iR.ObservableLazy=wut;var Rut=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,xut.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,rti.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,tti.transaction)(n=>{this._value.set(new vNe(r,void 0),n)}),r),r=>{throw(0,tti.transaction)(n=>{this._value.set(new vNe(void 0,r),n)}),r})}};iR.ObservablePromise=Rut;var vNe=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};iR.PromiseResult=vNe;var Cpr=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,xut.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,xut.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,Uzs.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)}))}};iR.ObservableResolvedPromise=Cpr;var bpr=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new wut(()=>new Rut(this._computePromise())),this.cachedPromiseResult=(0,rti.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};iR.ObservableLazyPromise=bpr});var Tpr=I(c4=>{"use strict";p();Object.defineProperty(c4,"__esModule",{value:!0});c4.cancelOnDispose=c4.CancellationTokenSource=c4.CancellationToken=c4.CancellationError=void 0;var Qzs=Rs();Object.defineProperty(c4,"CancellationError",{enumerable:!0,get:a(function(){return Qzs.CancellationError},"get")});var Spr=KP();Object.defineProperty(c4,"CancellationToken",{enumerable:!0,get:a(function(){return Spr.CancellationToken},"get")});Object.defineProperty(c4,"CancellationTokenSource",{enumerable:!0,get:a(function(){return Spr.CancellationTokenSource},"get")});Object.defineProperty(c4,"cancelOnDispose",{enumerable:!0,get:a(function(){return Spr.cancelOnDispose},"get")})});var iti=I(kut=>{"use strict";p();Object.defineProperty(kut,"__esModule",{value:!0});kut.waitForState=Vzs;kut.derivedWithCancellationToken=Wzs;var qzs=qT(),Ipr=Tpr(),jzs=Av(),Hzs=JX(),Gzs=mme(),$zs=jT();function Vzs(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,Hzs.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 Ipr.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new Ipr.CancellationError);return}}c=!1,l&&d.dispose()})}a(Vzs,"waitForState");function Wzs(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new Gzs.Derived(new qzs.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new Ipr.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),jzs.strictEquals,$zs.DebugLocation.ofCaller())}a(Wzs,"derivedWithCancellationToken")});var LH=I(ree=>{"use strict";p();Object.defineProperty(ree,"__esModule",{value:!0});ree.FromEventObservable=void 0;ree.observableFromEvent=xpr;ree.observableFromEventOpts=Kzs;var zzs=v8(),sti=Av(),ati=qT(),oti=o4(),Yzs=G2(),cti=jT();function xpr(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new $2(new ati.DebugNameData(e,void 0,n),r,n,()=>$2.globalTransaction,sti.strictEquals,o??cti.DebugLocation.ofCaller())}a(xpr,"observableFromEvent");function Kzs(t,e,r,n=cti.DebugLocation.ofCaller()){return new $2(new ati.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??$2.globalTransaction,t.equalsFn??sti.strictEquals,n)}a(Kzs,"observableFromEventOpts");var $2=class extends Yzs.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,zzs.subtransaction)(this._getTransaction(),m=>{(0,oti.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,oti.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}}};ree.FromEventObservable=$2;(function(t){t.Observer=$2;function e(r,n){let o=!1;$2.globalTransaction===void 0&&($2.globalTransaction=r,o=!0);try{n()}finally{o&&($2.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(xpr||(ree.observableFromEvent=xpr={}))});var Rpr=I(wpr=>{"use strict";p();Object.defineProperty(wpr,"__esModule",{value:!0});wpr.observableSignal=tYs;var Jzs=v8(),Zzs=qT(),Xzs=G2(),eYs=jT();function tYs(t,e=eYs.DebugLocation.ofCaller()){return typeof t=="string"?new Put(t,void 0,e):new Put(void 0,t,e)}a(tYs,"observableSignal");var Put=class extends Xzs.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new Zzs.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,Jzs.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 Nut=I(RE=>{"use strict";p();Object.defineProperty(RE,"__esModule",{value:!0});RE.KeepAliveObserver=void 0;RE.observableFromPromise=rYs;RE.signalFromObservable=nYs;RE.debouncedObservable=iYs;RE.throttledObservable=oYs;RE.debouncedObservable2=sYs;RE.wasEventTriggeredRecently=aYs;RE.keepObserved=hti;RE.recomputeInitiallyAndOnChange=mti;RE.derivedObservableWithCache=cYs;RE.derivedObservableWithWritableCache=lYs;RE.mapObservableArrayCached=uYs;RE.isObservable=dYs;var lti=JX(),uti=C8(),kpr=Av(),bNe=Iut(),dti=LH(),fti=Rpr(),pti=G2(),Ppr=jT();function rYs(t){let e=(0,uti.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(rYs,"observableFromPromise");function nYs(t,e){return(0,bNe.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(nYs,"signalFromObservable");function iYs(t,e,r=Ppr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,dti.observableFromEvent)(void 0,c=>{let l=(0,lti.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(iYs,"debouncedObservable");function oYs(t,e,r=Ppr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,dti.observableFromEvent)(void 0,c=>{let l=(0,lti.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(oYs,"throttledObservable");function sYs(t,e,r=Ppr.DebugLocation.ofCaller()){let n=(0,fti.observableSignal)("handleTimeout"),o,s;return(0,bNe.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(sYs,"debouncedObservable2");function aYs(t,e,r){let n=(0,uti.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(aYs,"wasEventTriggeredRecently");function hti(t){let e=new CNe(!1,void 0);return t.addObserver(e),(0,kpr.toDisposable)(()=>{t.removeObserver(e)})}a(hti,"keepObserved");(0,pti._setKeepObserved)(hti);function mti(t,e){let r=new CNe(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,kpr.toDisposable)(()=>{t.removeObserver(r)})}a(mti,"recomputeInitiallyAndOnChange");(0,pti._setRecomputeInitiallyAndOnChange)(mti);var CNe=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){}};RE.KeepAliveObserver=CNe;function cYs(t,e){let r;return(0,bNe.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(cYs,"derivedObservableWithCache");function lYs(t,e){let r,n=(0,fti.observableSignal)("derivedObservableWithWritableCache"),o=(0,bNe.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(lYs,"derivedObservableWithWritableCache");function uYs(t,e,r,n){let o=new Dut(r,n);return(0,bNe.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new Dut(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a(uYs,"mapObservableArrayCached");var Dut=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 kpr.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 dYs(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(dYs,"isObservable")});var Ati=I(Mut=>{"use strict";p();Object.defineProperty(Mut,"__esModule",{value:!0});Mut.recordChanges=fYs;Mut.recordChangesLazy=pYs;var gti=Av();function fYs(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 gti.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(fYs,"recordChanges");function pYs(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 gti.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(pYs,"recordChangesLazy")});var yti=I(Npr=>{"use strict";p();Object.defineProperty(Npr,"__esModule",{value:!0});Npr.constObservable=mYs;var hYs=G2();function mYs(t){return new Dpr(t)}a(mYs,"constObservable");var Dpr=class extends hYs.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 Eti=I(Opr=>{"use strict";p();Object.defineProperty(Opr,"__esModule",{value:!0});Opr.observableSignalFromEvent=_Ys;var gYs=v8(),AYs=qT(),yYs=G2(),EYs=jT();function _Ys(t,e,r=EYs.DebugLocation.ofCaller()){return new Mpr(typeof t=="string"?t:new AYs.DebugNameData(t,void 0,void 0),e,r)}a(_Ys,"observableSignalFromEvent");var Mpr=class extends yYs.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,gYs.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 _ti=I(SNe=>{"use strict";p();Object.defineProperty(SNe,"__esModule",{value:!0});SNe.ValueWithChangeEventFromObservable=void 0;SNe.observableFromValueWithChangeEvent=bYs;var vYs=Av(),CYs=LH(),Out=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return vYs.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};SNe.ValueWithChangeEventFromObservable=Out;function bYs(t,e){return e instanceof Out?e.observable:(0,CYs.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(bYs,"observableFromValueWithChangeEvent")});var bti=I(TNe=>{"use strict";p();Object.defineProperty(TNe,"__esModule",{value:!0});TNe.runOnChange=vti;TNe.runOnChangeWithStore=Cti;TNe.runOnChangeWithCancellationToken=xYs;var SYs=Tpr(),TYs=Av(),IYs=JX();function vti(t,e){let r,n=!0;return(0,IYs.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(vti,"runOnChange");function Cti(t,e){let r=new TYs.DisposableStore,n=vti(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(Cti,"runOnChangeWithStore");function xYs(t,e){return Cti(t,(r,n,o,s)=>{e(r,n,o,(0,SYs.cancelOnDispose)(s))})}a(xYs,"runOnChangeWithCancellationToken")});var Iti=I(Lut=>{"use strict";p();Object.defineProperty(Lut,"__esModule",{value:!0});Lut.latestChangedValue=PYs;Lut.derivedConstOnceDefined=DYs;var Sti=Av(),Tti=qT(),wYs=LH(),RYs=JX(),kYs=Nut();function PYs(t,e){if(e.length===0)throw new Sti.BugIndicatingError;let r=!1,n,o=(0,wYs.observableFromEvent)(t,s=>{let c=new Sti.DisposableStore;for(let l of e)c.add((0,RYs.autorunOpts)({debugName:a(()=>(0,Tti.getDebugName)(o,new Tti.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(PYs,"latestChangedValue");function DYs(t,e){return(0,kYs.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(DYs,"derivedConstOnceDefined")});var xti=I(But=>{"use strict";p();Object.defineProperty(But,"__esModule",{value:!0});But.ObservableSet=void 0;var NYs=Cut(),Lpr=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,NYs.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"}};But.ObservableSet=Lpr});var wti=I(Fut=>{"use strict";p();Object.defineProperty(Fut,"__esModule",{value:!0});Fut.ObservableMap=void 0;var MYs=Cut(),Bpr=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,MYs.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"}};Fut.ObservableMap=Bpr});var qut=I(_me=>{"use strict";p();Object.defineProperty(_me,"__esModule",{value:!0});_me.ConsoleObservableLogger=void 0;_me.logObservableToConsole=BYs;_me.formatValue=Eme;var OYs=o4(),LYs=qT(),Rti=mme(),Uut;function BYs(t){Uut||(Uut=new Qut,(0,OYs.addLogger)(Uut)),Uut.addFilteredObj(t)}a(BYs,"logObservableToConsole");var Qut=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 FYs([Ame(qYs("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[Ame(" "),oR(Eme(e.oldValue,70),{color:"red",strikeThrough:!0}),Ame(" "),oR(Eme(e.newValue,60),{color:"green"})]:[Ame(" (unchanged)")]:[Ame(" "),oR(Eme(e.newValue,60),{color:"green"}),Ame(" (initial)")]}handleObservableCreated(e){if(e instanceof Rti.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 Rti.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([yme("observable value changed"),oR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return oR(" (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([yme("derived recomputed"),oR(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([yme("derived cleared"),oR(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([yme("observable from event triggered"),oR(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([yme("autorun"),oR(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([yme("transaction"),oR(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};_me.ConsoleObservableLogger=Qut;function FYs(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(FYs,"consoleTextToArgs");function Ame(t){return oR(t,{color:"black"})}a(Ame,"normalText");function yme(t){return oR(jYs(`${t}: `,10),{color:"black",bold:!0})}a(yme,"formatKind");function oR(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(oR,"styled");function Eme(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)?UYs(t,e):QYs(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a(Eme,"formatValue");function UYs(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${Eme(o,e-r.length)}`}return r+=" ]",r}a(UYs,"formatArray");function QYs(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,LYs.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}: ${Eme(c,e-n.length)}`}return n+=r?")":" }",n}a(QYs,"formatObject");function qYs(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(qYs,"repeat");function jYs(t,e){for(;t.length{"use strict";p();Object.defineProperty(jut,"__esModule",{value:!0});jut.SimpleTypedRpcConnection=void 0;var Fpr=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}}};jut.SimpleTypedRpcConnection=Fpr});var Pti=I(Upr=>{"use strict";p();Object.defineProperty(Upr,"__esModule",{value:!0});Upr.registerDebugChannel=GYs;var HYs=kti();function GYs(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=$Ys({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},HYs.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(GYs,"registerDebugChannel");function $Ys(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($Ys,"createChannelFactoryFromDebugChannel")});var Mti=I(BH=>{"use strict";p();Object.defineProperty(BH,"__esModule",{value:!0});BH.Throttler=BH.Debouncer=void 0;BH.deepAssign=Dti;BH.deepAssignDeleteNulls=Nti;var Qpr=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)}};BH.Debouncer=Qpr;var qpr=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)}};BH.Throttler=qpr;function Dti(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?Dti(t[r],e[r]):t[r]=e[r]}a(Dti,"deepAssign");function Nti(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"?Nti(t[r],e[r]):t[r]=e[r]}a(Nti,"deepAssignDeleteNulls")});var Bti=I(Gut=>{"use strict";p();Object.defineProperty(Gut,"__esModule",{value:!0});Gut.DevToolsLogger=void 0;var Oti=Sut(),Hut=qut(),VYs=Pti(),jpr=Mti(),INe=ZS(),WYs=LH(),nee=Rs(),iee=mme(),Lti=C8(),zYs=jT(),Hpr=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,nee.onUnexpectedError)(new nee.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,nee.onUnexpectedError)(new nee.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof iee.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(INe.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 Oti.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 iee.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,VYs.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(INe.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(INe.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(INe.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(INe.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof iee.Derived)n.debugSetValue(r);else if(n instanceof Lti.ObservableValue)n.debugSetValue(r);else if(n instanceof WYs.FromEventObservable)n.debugSetValue(r);else throw new nee.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 iee.Derived)return(0,Hut.formatValue)(r.debugGetState().value,200);if(r instanceof Lti.ObservableValue)return(0,Hut.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 nee.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof iee.Derived)r.debugRecompute();else if(r instanceof Oti.AutorunObserver)r.debugRerun();else throw new nee.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new jpr.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},zYs.DebugLocation.enable()}_handleChange(e){(0,jpr.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,jpr.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 iee.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 iee.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,Hut.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,Hut.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)}};Gut.DevToolsLogger=Hpr});var qti=I(Gpr=>{"use strict";p();Object.defineProperty(Gpr,"__esModule",{value:!0});Gpr.debugGetObservableGraph=XYs;var YYs=mme(),KYs=LH(),JYs=C8(),ZYs=Sut(),Fti=qut();function XYs(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=oee.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?Qti(n,0,o,e).trim():Uti(n,0,o,e).trim()}a(XYs,"debugGetObservableGraph");function Uti(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,Fti.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=oee.from(l,n.debugNamePostProcessor??(d=>d))??oee.unknown(l);s.push(Uti(u,e+1,r,n))}}return s.join(` +`)}a(Uti,"formatObservableInfoWithDependencies");function Qti(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,Fti.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=oee.from(l,n.debugNamePostProcessor??(d=>d))??oee.unknown(l);s.push(Qti(u,e+1,r,n))}}return s.join(` +`)}a(Qti,"formatObservableInfoWithObservers");var oee=class t{static{a(this,"Info")}static from(e,r){if(e instanceof ZYs.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 YYs.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 JYs.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof KYs.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 b8=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 eKs=Cut();Object.defineProperty(Ut,"observableValueOpts",{enumerable:!0,get:a(function(){return eKs.observableValueOpts},"get")});var l4=JX();Object.defineProperty(Ut,"autorun",{enumerable:!0,get:a(function(){return l4.autorun},"get")});Object.defineProperty(Ut,"autorunDelta",{enumerable:!0,get:a(function(){return l4.autorunDelta},"get")});Object.defineProperty(Ut,"autorunHandleChanges",{enumerable:!0,get:a(function(){return l4.autorunHandleChanges},"get")});Object.defineProperty(Ut,"autorunOpts",{enumerable:!0,get:a(function(){return l4.autorunOpts},"get")});Object.defineProperty(Ut,"autorunWithStore",{enumerable:!0,get:a(function(){return l4.autorunWithStore},"get")});Object.defineProperty(Ut,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return l4.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Ut,"autorunIterableDelta",{enumerable:!0,get:a(function(){return l4.autorunIterableDelta},"get")});Object.defineProperty(Ut,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return l4.autorunPerKeyedItem},"get")});Object.defineProperty(Ut,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return l4.autorunSelfDisposable},"get")});Object.defineProperty(Ut,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return l4.registerAutorunSelfDisposable},"get")});var tKs=C8();Object.defineProperty(Ut,"disposableObservableValue",{enumerable:!0,get:a(function(){return tKs.disposableObservableValue},"get")});var vme=Iut();Object.defineProperty(Ut,"derived",{enumerable:!0,get:a(function(){return vme.derived},"get")});Object.defineProperty(Ut,"derivedDisposable",{enumerable:!0,get:a(function(){return vme.derivedDisposable},"get")});Object.defineProperty(Ut,"derivedHandleChanges",{enumerable:!0,get:a(function(){return vme.derivedHandleChanges},"get")});Object.defineProperty(Ut,"derivedOpts",{enumerable:!0,get:a(function(){return vme.derivedOpts},"get")});Object.defineProperty(Ut,"derivedWithSetter",{enumerable:!0,get:a(function(){return vme.derivedWithSetter},"get")});Object.defineProperty(Ut,"derivedWithStore",{enumerable:!0,get:a(function(){return vme.derivedWithStore},"get")});var xNe=nti();Object.defineProperty(Ut,"ObservableLazy",{enumerable:!0,get:a(function(){return xNe.ObservableLazy},"get")});Object.defineProperty(Ut,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return xNe.ObservableLazyPromise},"get")});Object.defineProperty(Ut,"ObservablePromise",{enumerable:!0,get:a(function(){return xNe.ObservablePromise},"get")});Object.defineProperty(Ut,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return xNe.ObservableResolvedPromise},"get")});Object.defineProperty(Ut,"PromiseResult",{enumerable:!0,get:a(function(){return xNe.PromiseResult},"get")});var Hti=iti();Object.defineProperty(Ut,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return Hti.derivedWithCancellationToken},"get")});Object.defineProperty(Ut,"waitForState",{enumerable:!0,get:a(function(){return Hti.waitForState},"get")});var sR=Nut();Object.defineProperty(Ut,"debouncedObservable",{enumerable:!0,get:a(function(){return sR.debouncedObservable},"get")});Object.defineProperty(Ut,"debouncedObservable2",{enumerable:!0,get:a(function(){return sR.debouncedObservable2},"get")});Object.defineProperty(Ut,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return sR.derivedObservableWithCache},"get")});Object.defineProperty(Ut,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return sR.derivedObservableWithWritableCache},"get")});Object.defineProperty(Ut,"keepObserved",{enumerable:!0,get:a(function(){return sR.keepObserved},"get")});Object.defineProperty(Ut,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return sR.mapObservableArrayCached},"get")});Object.defineProperty(Ut,"observableFromPromise",{enumerable:!0,get:a(function(){return sR.observableFromPromise},"get")});Object.defineProperty(Ut,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return sR.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Ut,"signalFromObservable",{enumerable:!0,get:a(function(){return sR.signalFromObservable},"get")});Object.defineProperty(Ut,"throttledObservable",{enumerable:!0,get:a(function(){return sR.throttledObservable},"get")});Object.defineProperty(Ut,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return sR.wasEventTriggeredRecently},"get")});Object.defineProperty(Ut,"isObservable",{enumerable:!0,get:a(function(){return sR.isObservable},"get")});var Gti=Ati();Object.defineProperty(Ut,"recordChanges",{enumerable:!0,get:a(function(){return Gti.recordChanges},"get")});Object.defineProperty(Ut,"recordChangesLazy",{enumerable:!0,get:a(function(){return Gti.recordChangesLazy},"get")});var rKs=yti();Object.defineProperty(Ut,"constObservable",{enumerable:!0,get:a(function(){return rKs.constObservable},"get")});var nKs=Rpr();Object.defineProperty(Ut,"observableSignal",{enumerable:!0,get:a(function(){return nKs.observableSignal},"get")});var iKs=LH();Object.defineProperty(Ut,"observableFromEventOpts",{enumerable:!0,get:a(function(){return iKs.observableFromEventOpts},"get")});var oKs=Eti();Object.defineProperty(Ut,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return oKs.observableSignalFromEvent},"get")});var wNe=v8();Object.defineProperty(Ut,"asyncTransaction",{enumerable:!0,get:a(function(){return wNe.asyncTransaction},"get")});Object.defineProperty(Ut,"globalTransaction",{enumerable:!0,get:a(function(){return wNe.globalTransaction},"get")});Object.defineProperty(Ut,"subtransaction",{enumerable:!0,get:a(function(){return wNe.subtransaction},"get")});Object.defineProperty(Ut,"transaction",{enumerable:!0,get:a(function(){return wNe.transaction},"get")});Object.defineProperty(Ut,"TransactionImpl",{enumerable:!0,get:a(function(){return wNe.TransactionImpl},"get")});var $ti=_ti();Object.defineProperty(Ut,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return $ti.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Ut,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return $ti.ValueWithChangeEventFromObservable},"get")});var $pr=bti();Object.defineProperty(Ut,"runOnChange",{enumerable:!0,get:a(function(){return $pr.runOnChange},"get")});Object.defineProperty(Ut,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return $pr.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Ut,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return $pr.runOnChangeWithStore},"get")});var Vti=Iti();Object.defineProperty(Ut,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return Vti.derivedConstOnceDefined},"get")});Object.defineProperty(Ut,"latestChangedValue",{enumerable:!0,get:a(function(){return Vti.latestChangedValue},"get")});var sKs=LH();Object.defineProperty(Ut,"observableFromEvent",{enumerable:!0,get:a(function(){return sKs.observableFromEvent},"get")});var aKs=C8();Object.defineProperty(Ut,"observableValue",{enumerable:!0,get:a(function(){return aKs.observableValue},"get")});var cKs=xti();Object.defineProperty(Ut,"ObservableSet",{enumerable:!0,get:a(function(){return cKs.ObservableSet},"get")});var lKs=wti();Object.defineProperty(Ut,"ObservableMap",{enumerable:!0,get:a(function(){return lKs.ObservableMap},"get")});var uKs=jT();Object.defineProperty(Ut,"DebugLocation",{enumerable:!0,get:a(function(){return uKs.DebugLocation},"get")});var Vpr=o4(),Wti=qut(),dKs=Bti(),jti=owe(),fKs=G2(),pKs=qti();(0,fKs._setDebugGetObservableGraph)(pKs.debugGetObservableGraph);(0,Vpr.setLogObservableFn)(Wti.logObservableToConsole);var hKs=!1;hKs&&(0,Vpr.addLogger)(new Wti.ConsoleObservableLogger);jti.env&&jti.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,Vpr.addLogger)(dKs.DevToolsLogger.getInstance())});var hd=I(Cme=>{"use strict";p();Object.defineProperty(Cme,"__esModule",{value:!0});Cme.OffsetRangeSet=Cme.OffsetRange=void 0;var $ut=Rs(),Vut=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 $ut.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 $ut.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new $ut.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)}};Cme.OffsetRangeSet=Wpr});var V2=I(Tme=>{"use strict";p();Object.defineProperty(Tme,"__esModule",{value:!0});Tme.LineRangeSet=Tme.LineRange=void 0;var zti=Rs(),mKs=hd(),Yti=eh(),bme=wq(),Kti=Sl(),Sme=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,Kti.compareBy)(e=>e.startLineNumber,Kti.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new zti.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,bme.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,bme.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,bme.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 Sme(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,bme.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,bme.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 Sme(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};Tme.LineRangeSet=RNe});var Ime=I(zut=>{"use strict";p();Object.defineProperty(zut,"__esModule",{value:!0});zut.TextLength=void 0;var gKs=V2(),Jti=q_(),Wut=eh(),zpr=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 Wut.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Wut.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Wut.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return gKs.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new Jti.Position(e.lineNumber,e.column+this.columnCount):new Jti.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Wut.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};zut.TextLength=zpr});var Kut=I(see=>{"use strict";p();Object.defineProperty(see,"__esModule",{value:!0});see.PositionOffsetTransformer=see.PositionOffsetTransformerBase=void 0;see._setPositionOffsetTransformerDependencies=_Ks;var AKs=wq(),yKs=hd(),kNe=q_(),EKs=eh(),Yut=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new yKs.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return EKs.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new S8.deps.StringEdit(r)}getStringReplacement(e){return new S8.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new S8.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new S8.deps.TextEdit(r)}};see.PositionOffsetTransformerBase=Yut;var S8=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 _Ks(t){S8._deps=t}a(_Ks,"_setPositionOffsetTransformerDependencies");var Ypr=class extends Yut{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 kNe.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new kNe.Position(r,o+1)}if(e.column<1)return new kNe.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new kNe.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,AKs.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new kNe.Position(n,o)}getTextLength(e){return S8.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new S8.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};see.PositionOffsetTransformer=Ypr});var HT=I(u4=>{"use strict";p();Object.defineProperty(u4,"__esModule",{value:!0});u4.StringText=u4.ArrayText=u4.LineBasedText=u4.AbstractText=void 0;var vKs=rd(),CKs=em(),bKs=q_(),Zti=eh(),SKs=Ime(),Xti=Kut(),PNe=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new bKs.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 Zti.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Xti.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Zti.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,CKs.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};u4.AbstractText=PNe;var Jut=class extends PNe{static{a(this,"LineBasedText")}constructor(e,r){(0,vKs.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)}};u4.ArrayText=Ypr;var Kpr=class extends RNe{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new Yti.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};u4.StringText=Kpr});var Jti=I(d4=>{"use strict";p();Object.defineProperty(d4,"__esModule",{value:!0});d4.AnnotationReplacement=d4.Edit=d4.BaseReplacement=d4.BaseEdit=void 0;var EKs=Sl(),Kti=Rs(),sR=hd(),Jut=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 Kti.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 E=d.slice(sR.OffsetRange.emptyAt(h),new sR.OffsetRange(0,m));s.push(E)}if(!f)throw new Kti.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(sR.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new sR.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new sR.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new sR.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 sR.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(sR.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,EKs.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 sR.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};d4.BaseReplacement=Zut;var Jpr=class t extends Jut{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)}};d4.Edit=Jpr;var Zpr=class t extends Zut{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)}};d4.AnnotationReplacement=Zpr});var kE=I(ny=>{"use strict";p();Object.defineProperty(ny,"__esModule",{value:!0});ny.AnnotatedStringReplacement=ny.AnnotatedStringEdit=ny.VoidEditData=ny.StringReplacement=ny.StringEdit=ny.BaseStringReplacement=ny.BaseStringEdit=void 0;ny.applyEditsToRanges=vKs;var Xut=em(),V2=hd(),_Ks=qT(),Xti=Jti(),kNe=class extends Xti.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(Av.replace(V2.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 f4(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 f4(r)}normalizeEOL(e){return new f4(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=Av.replace(V2.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?f4.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new _Ks.StringText(this.apply(e.value))}mapData(e){return new edt(this.replacements.map(r=>new aee(r.replaceRange,r.newText,e(r))))}};ny.BaseStringEdit=kNe;var PNe=class extends Xti.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,Xut.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,Xut.commonSuffixLength)(r,this.newText)),s=new V2.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new Av(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new Av(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,Xut.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new V2.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,Xut.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new V2.OffsetRange(0,this.newText.length-n))}toEdit(){return new f4([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};ny.BaseStringReplacement=PNe;var f4=class t extends kNe{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 Av(new V2.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 Av(e,r)])}static insert(e,r){return new t([new Av(V2.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new Av(e,"")])}static fromJson(e){return new t(e.map(Av.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(vKs,"applyEditsToRanges");var Xpr=class{static{a(this,"VoidEditData")}join(e){return this}};ny.VoidEditData=Xpr;var edt=class t extends kNe{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 aee(e,r,n)])}static insert(e,r,n){return new t([new aee(V2.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new aee(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(tdt,"__esModule",{value:!0});tdt.LanguageId=void 0;var eri;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(eri||(tdt.LanguageId=eri={}))});var rri=I(BH=>{"use strict";p();Object.defineProperty(BH,"__esModule",{value:!0});BH.EditReasons=BH.TextModelEditReason=BH.EditReason=void 0;var ehr=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 DNe(this.metadata,tri).toKey(e)}};BH.EditReason=ehr;var tri=Symbol("TextModelEditReason"),DNe=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("-")}};BH.TextModelEditReason=DNe;function aR(t){return new DNe(t,tri)}a(aR,"createEditReason");BH.EditReasons={unknown(t){return aR({source:"unknown",name:t.name})},chatApplyEdits(t){return aR({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return aR({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return aR({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return aR({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>aR({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return aR({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>aR({source:"setValue"}),"setValue"),eolChange:a(()=>aR({source:"eolChange"}),"eolChange"),applyEdits:a(()=>aR({source:"applyEdits"}),"applyEdits"),snippet:a(()=>aR({source:"snippet"}),"snippet"),suggest:a(t=>aR({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var cee=I(p4=>{"use strict";p();Object.defineProperty(p4,"__esModule",{value:!0});p4.MutableObservableDocument=p4.MutableObservableWorkspace=p4.StringEditWithReason=p4.ObservableWorkspace=void 0;var bKs=rd(),nri=Ro(),yv=C8(),ori=kE(),SKs=hd(),TKs=qT(),IKs=rdt(),iri=rri(),ndt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,yv.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,yv.derivedWithStore)((e,r)=>{let n=(0,yv.observableValue)("lastActiveDocument",void 0);return r.add((0,yv.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,yv.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)}};p4.ObservableWorkspace=ndt;var Ime=class extends ori.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};p4.StringEditWithReason=Ime;var thr=class extends ndt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,yv.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,bKs.assert)(!this._documents.has(e.id));let n=new idt(e.id,new TKs.StringText(e.initialValue??""),[],e.languageId??IKs.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}};p4.MutableObservableWorkspace=thr;var idt=class extends nri.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,yv.observableValue)(this,r),this._selection=(0,yv.observableValue)(this,n),this._primarySelectionLine=(0,yv.observableValue)(this,void 0),this._visibleRanges=(0,yv.observableValue)(this,[]),this._languageId=(0,yv.observableValue)(this,o),this._version=(0,yv.observableValue)(this,c),this._diagnostics=(0,yv.observableValue)(this,[]),this._register((0,nri.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 Ime?e:new Ime(e.replacements,iri.EditReason.unknown);(0,yv.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=iri.EditReason.unknown,s=new Ime([ori.StringReplacement.replace(new SKs.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,yv.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)}};p4.MutableObservableDocument=idt});var W2=I(lee=>{"use strict";p();var xKs=lee&&lee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wKs=lee&&lee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xKs(e,t,r)};Object.defineProperty(lee,"__esModule",{value:!0});wKs(C8(),lee)});var h4=I(rhr=>{"use strict";p();Object.defineProperty(rhr,"__esModule",{value:!0});rhr.autorunWithChanges=kKs;var RKs=W2();function kKs(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,RKs.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(kKs,"autorunWithChanges")});var Za=I(oy=>{"use strict";p();var Phr=Symbol.for("yaml.alias"),hni=Symbol.for("yaml.document"),$dt=Symbol.for("yaml.map"),mni=Symbol.for("yaml.pair"),Dhr=Symbol.for("yaml.scalar"),Vdt=Symbol.for("yaml.seq"),x8=Symbol.for("yaml.node.type"),dZs=a(t=>!!t&&typeof t=="object"&&t[x8]===Phr,"isAlias"),fZs=a(t=>!!t&&typeof t=="object"&&t[x8]===hni,"isDocument"),pZs=a(t=>!!t&&typeof t=="object"&&t[x8]===$dt,"isMap"),hZs=a(t=>!!t&&typeof t=="object"&&t[x8]===mni,"isPair"),gni=a(t=>!!t&&typeof t=="object"&&t[x8]===Dhr,"isScalar"),mZs=a(t=>!!t&&typeof t=="object"&&t[x8]===Vdt,"isSeq");function Ani(t){if(t&&typeof t=="object")switch(t[x8]){case $dt:case Vdt:return!0}return!1}a(Ani,"isCollection");function gZs(t){if(t&&typeof t=="object")switch(t[x8]){case Phr:case $dt:case Dhr:case Vdt:return!0}return!1}a(gZs,"isNode");var AZs=a(t=>(gni(t)||Ani(t))&&!!t.anchor,"hasAnchor");oy.ALIAS=Phr;oy.DOC=hni;oy.MAP=$dt;oy.NODE_TYPE=x8;oy.PAIR=mni;oy.SCALAR=Dhr;oy.SEQ=Vdt;oy.hasAnchor=AZs;oy.isAlias=dZs;oy.isCollection=Ani;oy.isDocument=fZs;oy.isMap=pZs;oy.isNode=gZs;oy.isPair=hZs;oy.isScalar=gni;oy.isSeq=mZs});var HNe=I(Nhr=>{"use strict";p();var C0=Za(),Lb=Symbol("break visit"),yni=Symbol("skip children"),y4=Symbol("remove node");function Wdt(t,e){let r=Eni(e);C0.isDocument(t)?Nme(null,t.contents,r,Object.freeze([t]))===y4&&(t.contents=null):Nme(null,t,r,Object.freeze([]))}a(Wdt,"visit");Wdt.BREAK=Lb;Wdt.SKIP=yni;Wdt.REMOVE=y4;function Nme(t,e,r,n){let o=_ni(t,e,r,n);if(C0.isNode(o)||C0.isPair(o))return vni(t,n,o),Nme(t,o,r,n);if(typeof o!="symbol"){if(C0.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var Cni=Za(),yZs=HNe(),EZs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_Zs=a(t=>t.replace(/[!,[\]{}]/g,e=>EZs[e]),"escapeTagName"),GNe=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+_Zs(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&&Cni.isNode(e.contents)){let s={};yZs.visit(e.contents,(c,l)=>{Cni.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(` -`)}};GNe.defaultYaml={explicit:!1,version:"1.2"};GNe.defaultTags={"!!":"tag:yaml.org,2002:"};bni.Directives=GNe});var Ydt=I($Ne=>{"use strict";p();var Sni=Za(),vZs=HNe();function CZs(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(CZs,"anchorIsValid");function Tni(t){let e=new Set;return vZs.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(Tni,"anchorNames");function Ini(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(Ini,"findNewAnchor");function bZs(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=Tni(t));let c=Ini(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&&(Sni.isScalar(c.node)||Sni.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(bZs,"createNodeAnchors");$Ne.anchorIsValid=CZs;$Ne.anchorNames=Tni;$Ne.createNodeAnchors=bZs;$Ne.findNewAnchor=Ini});var Ohr=I(xni=>{"use strict";p();function VNe(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 SZs=Za();function wni(t,e,r){if(Array.isArray(t))return t.map((n,o)=>wni(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!SZs.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(wni,"toJS");Rni.toJS=wni});var Kdt=I(Pni=>{"use strict";p();var TZs=Ohr(),kni=Za(),IZs=qH(),Lhr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,kni.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(!kni.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=IZs.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?TZs.applyReviver(s,{"":l},"",l):l}};Pni.NodeBase=Lhr});var WNe=I(Dni=>{"use strict";p();var xZs=Ydt(),wZs=HNe(),Ome=Za(),RZs=Kdt(),kZs=qH(),Bhr=class extends RZs.NodeBase{static{a(this,"Alias")}constructor(e){super(Ome.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=[],wZs.visit(e,{Node:a((s,c)=>{(Ome.isAlias(c)||Ome.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||(kZs.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=Jdt(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(xZs.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 Jdt(t,e,r){if(Ome.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(Ome.isCollection(e)){let n=0;for(let o of e.items){let s=Jdt(t,o,r);s>n&&(n=s)}return n}else if(Ome.isPair(e)){let n=Jdt(t,e.key,r),o=Jdt(t,e.value,r);return Math.max(n,o)}return 1}a(Jdt,"getAliasCount");Dni.Alias=Bhr});var mm=I(Fhr=>{"use strict";p();var PZs=Za(),DZs=Kdt(),NZs=qH(),MZs=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),jH=class extends DZs.NodeBase{static{a(this,"Scalar")}constructor(e){super(PZs.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:NZs.toJS(this.value,e,r)}toString(){return String(this.value)}};jH.BLOCK_FOLDED="BLOCK_FOLDED";jH.BLOCK_LITERAL="BLOCK_LITERAL";jH.PLAIN="PLAIN";jH.QUOTE_DOUBLE="QUOTE_DOUBLE";jH.QUOTE_SINGLE="QUOTE_SINGLE";Fhr.Scalar=jH;Fhr.isScalarValue=MZs});var zNe=I(Mni=>{"use strict";p();var OZs=WNe(),mee=Za(),Nni=mm(),LZs="tag:yaml.org,2002:";function BZs(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(BZs,"findTagObject");function FZs(t,e,r){if(mee.isDocument(t)&&(t=t.contents),mee.isNode(t))return t;if(mee.isPair(t)){let h=r.schema[mee.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 OZs.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=LZs+e.slice(2));let d=BZs(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new Nni.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[mee.MAP]:Symbol.iterator in Object(t)?c[mee.SEQ]:c[mee.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 Nni.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(FZs,"createNode");Mni.createNode=FZs});var Xdt=I(Zdt=>{"use strict";p();var UZs=zNe(),E4=Za(),QZs=Kdt();function Uhr(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 UZs.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(Uhr,"collectionFromPath");var Oni=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),Qhr=class extends QZs.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=>E4.isNode(n)||E4.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(Oni(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(E4.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,Uhr(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(E4.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&&E4.isScalar(s)?s.value:s:E4.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!E4.isPair(r))return!1;let n=r.value;return n==null||e&&E4.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 E4.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(E4.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,Uhr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};Zdt.Collection=Qhr;Zdt.collectionFromPath=Uhr;Zdt.isEmptyPath=Oni});var YNe=I(eft=>{"use strict";p();var qZs=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function qhr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(qhr,"indentComment");var jZs=a((t,e,r)=>t.endsWith(` -`)?qhr(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 SKs.TextLength(this._lineCount-1,e.length)}};u4.LineBasedText=Jut;var Kpr=class extends Jut{static{a(this,"ArrayText")}constructor(e){super(r=>e[r-1],e.length)}};u4.ArrayText=Kpr;var Jpr=class extends PNe{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new Xti.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};u4.StringText=Jpr});var tri=I(d4=>{"use strict";p();Object.defineProperty(d4,"__esModule",{value:!0});d4.AnnotationReplacement=d4.Edit=d4.BaseReplacement=d4.BaseEdit=void 0;var TKs=Sl(),eri=Rs(),aR=hd(),Zut=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 eri.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 E=d.slice(aR.OffsetRange.emptyAt(h),new aR.OffsetRange(0,m));s.push(E)}if(!f)throw new eri.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(aR.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new aR.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new aR.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new aR.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 aR.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(aR.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,TKs.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 aR.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};d4.BaseReplacement=Xut;var Zpr=class t extends Zut{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)}};d4.Edit=Zpr;var Xpr=class t extends Xut{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)}};d4.AnnotationReplacement=Xpr});var kE=I(ny=>{"use strict";p();Object.defineProperty(ny,"__esModule",{value:!0});ny.AnnotatedStringReplacement=ny.AnnotatedStringEdit=ny.VoidEditData=ny.StringReplacement=ny.StringEdit=ny.BaseStringReplacement=ny.BaseStringEdit=void 0;ny.applyEditsToRanges=xKs;var edt=em(),W2=hd(),IKs=HT(),nri=tri(),DNe=class extends nri.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(yv.replace(W2.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 f4(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 f4(r)}normalizeEOL(e){return new f4(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=yv.replace(W2.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?f4.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new IKs.StringText(this.apply(e.value))}mapData(e){return new tdt(this.replacements.map(r=>new aee(r.replaceRange,r.newText,e(r))))}};ny.BaseStringEdit=DNe;var NNe=class extends nri.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,edt.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,edt.commonSuffixLength)(r,this.newText)),s=new W2.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new yv(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new yv(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,edt.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new W2.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,edt.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new W2.OffsetRange(0,this.newText.length-n))}toEdit(){return new f4([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};ny.BaseStringReplacement=NNe;var f4=class t extends DNe{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 yv(new W2.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 yv(e,r)])}static insert(e,r){return new t([new yv(W2.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new yv(e,"")])}static fromJson(e){return new t(e.map(yv.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(xKs,"applyEditsToRanges");var ehr=class{static{a(this,"VoidEditData")}join(e){return this}};ny.VoidEditData=ehr;var tdt=class t extends DNe{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 aee(e,r,n)])}static insert(e,r,n){return new t([new aee(W2.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new aee(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(rdt,"__esModule",{value:!0});rdt.LanguageId=void 0;var iri;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(iri||(rdt.LanguageId=iri={}))});var sri=I(FH=>{"use strict";p();Object.defineProperty(FH,"__esModule",{value:!0});FH.EditReasons=FH.TextModelEditReason=FH.EditReason=void 0;var thr=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 MNe(this.metadata,ori).toKey(e)}};FH.EditReason=thr;var ori=Symbol("TextModelEditReason"),MNe=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("-")}};FH.TextModelEditReason=MNe;function cR(t){return new MNe(t,ori)}a(cR,"createEditReason");FH.EditReasons={unknown(t){return cR({source:"unknown",name:t.name})},chatApplyEdits(t){return cR({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return cR({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return cR({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return cR({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>cR({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return cR({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>cR({source:"setValue"}),"setValue"),eolChange:a(()=>cR({source:"eolChange"}),"eolChange"),applyEdits:a(()=>cR({source:"applyEdits"}),"applyEdits"),snippet:a(()=>cR({source:"snippet"}),"snippet"),suggest:a(t=>cR({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var cee=I(p4=>{"use strict";p();Object.defineProperty(p4,"__esModule",{value:!0});p4.MutableObservableDocument=p4.MutableObservableWorkspace=p4.StringEditWithReason=p4.ObservableWorkspace=void 0;var RKs=rd(),ari=ko(),Ev=b8(),lri=kE(),kKs=hd(),PKs=HT(),DKs=ndt(),cri=sri(),idt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,Ev.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,Ev.derivedWithStore)((e,r)=>{let n=(0,Ev.observableValue)("lastActiveDocument",void 0);return r.add((0,Ev.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,Ev.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)}};p4.ObservableWorkspace=idt;var xme=class extends lri.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};p4.StringEditWithReason=xme;var rhr=class extends idt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,Ev.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,RKs.assert)(!this._documents.has(e.id));let n=new odt(e.id,new PKs.StringText(e.initialValue??""),[],e.languageId??DKs.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}};p4.MutableObservableWorkspace=rhr;var odt=class extends ari.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,Ev.observableValue)(this,r),this._selection=(0,Ev.observableValue)(this,n),this._primarySelectionLine=(0,Ev.observableValue)(this,void 0),this._visibleRanges=(0,Ev.observableValue)(this,[]),this._languageId=(0,Ev.observableValue)(this,o),this._version=(0,Ev.observableValue)(this,c),this._diagnostics=(0,Ev.observableValue)(this,[]),this._register((0,ari.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 xme?e:new xme(e.replacements,cri.EditReason.unknown);(0,Ev.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=cri.EditReason.unknown,s=new xme([lri.StringReplacement.replace(new kKs.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,Ev.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)}};p4.MutableObservableDocument=odt});var z2=I(lee=>{"use strict";p();var NKs=lee&&lee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MKs=lee&&lee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NKs(e,t,r)};Object.defineProperty(lee,"__esModule",{value:!0});MKs(b8(),lee)});var h4=I(nhr=>{"use strict";p();Object.defineProperty(nhr,"__esModule",{value:!0});nhr.autorunWithChanges=LKs;var OKs=z2();function LKs(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,OKs.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(LKs,"autorunWithChanges")});var Za=I(oy=>{"use strict";p();var Dhr=Symbol.for("yaml.alias"),yni=Symbol.for("yaml.document"),Vdt=Symbol.for("yaml.map"),Eni=Symbol.for("yaml.pair"),Nhr=Symbol.for("yaml.scalar"),Wdt=Symbol.for("yaml.seq"),w8=Symbol.for("yaml.node.type"),AZs=a(t=>!!t&&typeof t=="object"&&t[w8]===Dhr,"isAlias"),yZs=a(t=>!!t&&typeof t=="object"&&t[w8]===yni,"isDocument"),EZs=a(t=>!!t&&typeof t=="object"&&t[w8]===Vdt,"isMap"),_Zs=a(t=>!!t&&typeof t=="object"&&t[w8]===Eni,"isPair"),_ni=a(t=>!!t&&typeof t=="object"&&t[w8]===Nhr,"isScalar"),vZs=a(t=>!!t&&typeof t=="object"&&t[w8]===Wdt,"isSeq");function vni(t){if(t&&typeof t=="object")switch(t[w8]){case Vdt:case Wdt:return!0}return!1}a(vni,"isCollection");function CZs(t){if(t&&typeof t=="object")switch(t[w8]){case Dhr:case Vdt:case Nhr:case Wdt:return!0}return!1}a(CZs,"isNode");var bZs=a(t=>(_ni(t)||vni(t))&&!!t.anchor,"hasAnchor");oy.ALIAS=Dhr;oy.DOC=yni;oy.MAP=Vdt;oy.NODE_TYPE=w8;oy.PAIR=Eni;oy.SCALAR=Nhr;oy.SEQ=Wdt;oy.hasAnchor=bZs;oy.isAlias=AZs;oy.isCollection=vni;oy.isDocument=yZs;oy.isMap=EZs;oy.isNode=CZs;oy.isPair=_Zs;oy.isScalar=_ni;oy.isSeq=vZs});var $Ne=I(Mhr=>{"use strict";p();var C0=Za(),Lb=Symbol("break visit"),Cni=Symbol("skip children"),y4=Symbol("remove node");function zdt(t,e){let r=bni(e);C0.isDocument(t)?Mme(null,t.contents,r,Object.freeze([t]))===y4&&(t.contents=null):Mme(null,t,r,Object.freeze([]))}a(zdt,"visit");zdt.BREAK=Lb;zdt.SKIP=Cni;zdt.REMOVE=y4;function Mme(t,e,r,n){let o=Sni(t,e,r,n);if(C0.isNode(o)||C0.isPair(o))return Tni(t,n,o),Mme(t,o,r,n);if(typeof o!="symbol"){if(C0.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var Ini=Za(),SZs=$Ne(),TZs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},IZs=a(t=>t.replace(/[!,[\]{}]/g,e=>TZs[e]),"escapeTagName"),VNe=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+IZs(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&&Ini.isNode(e.contents)){let s={};SZs.visit(e.contents,(c,l)=>{Ini.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(` +`)}};VNe.defaultYaml={explicit:!1,version:"1.2"};VNe.defaultTags={"!!":"tag:yaml.org,2002:"};xni.Directives=VNe});var Kdt=I(WNe=>{"use strict";p();var wni=Za(),xZs=$Ne();function wZs(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(wZs,"anchorIsValid");function Rni(t){let e=new Set;return xZs.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(Rni,"anchorNames");function kni(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(kni,"findNewAnchor");function RZs(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=Rni(t));let c=kni(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&&(wni.isScalar(c.node)||wni.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(RZs,"createNodeAnchors");WNe.anchorIsValid=wZs;WNe.anchorNames=Rni;WNe.createNodeAnchors=RZs;WNe.findNewAnchor=kni});var Lhr=I(Pni=>{"use strict";p();function zNe(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 kZs=Za();function Dni(t,e,r){if(Array.isArray(t))return t.map((n,o)=>Dni(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!kZs.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(Dni,"toJS");Nni.toJS=Dni});var Jdt=I(Oni=>{"use strict";p();var PZs=Lhr(),Mni=Za(),DZs=jH(),Bhr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,Mni.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(!Mni.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=DZs.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?PZs.applyReviver(s,{"":l},"",l):l}};Oni.NodeBase=Bhr});var YNe=I(Lni=>{"use strict";p();var NZs=Kdt(),MZs=$Ne(),Lme=Za(),OZs=Jdt(),LZs=jH(),Fhr=class extends OZs.NodeBase{static{a(this,"Alias")}constructor(e){super(Lme.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=[],MZs.visit(e,{Node:a((s,c)=>{(Lme.isAlias(c)||Lme.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||(LZs.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=Zdt(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(NZs.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 Zdt(t,e,r){if(Lme.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(Lme.isCollection(e)){let n=0;for(let o of e.items){let s=Zdt(t,o,r);s>n&&(n=s)}return n}else if(Lme.isPair(e)){let n=Zdt(t,e.key,r),o=Zdt(t,e.value,r);return Math.max(n,o)}return 1}a(Zdt,"getAliasCount");Lni.Alias=Fhr});var mm=I(Uhr=>{"use strict";p();var BZs=Za(),FZs=Jdt(),UZs=jH(),QZs=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),HH=class extends FZs.NodeBase{static{a(this,"Scalar")}constructor(e){super(BZs.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:UZs.toJS(this.value,e,r)}toString(){return String(this.value)}};HH.BLOCK_FOLDED="BLOCK_FOLDED";HH.BLOCK_LITERAL="BLOCK_LITERAL";HH.PLAIN="PLAIN";HH.QUOTE_DOUBLE="QUOTE_DOUBLE";HH.QUOTE_SINGLE="QUOTE_SINGLE";Uhr.Scalar=HH;Uhr.isScalarValue=QZs});var KNe=I(Fni=>{"use strict";p();var qZs=YNe(),mee=Za(),Bni=mm(),jZs="tag:yaml.org,2002:";function HZs(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(HZs,"findTagObject");function GZs(t,e,r){if(mee.isDocument(t)&&(t=t.contents),mee.isNode(t))return t;if(mee.isPair(t)){let h=r.schema[mee.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 qZs.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=jZs+e.slice(2));let d=HZs(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new Bni.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[mee.MAP]:Symbol.iterator in Object(t)?c[mee.SEQ]:c[mee.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 Bni.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(GZs,"createNode");Fni.createNode=GZs});var eft=I(Xdt=>{"use strict";p();var $Zs=KNe(),E4=Za(),VZs=Jdt();function Qhr(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 $Zs.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(Qhr,"collectionFromPath");var Uni=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),qhr=class extends VZs.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=>E4.isNode(n)||E4.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(Uni(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(E4.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,Qhr(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(E4.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&&E4.isScalar(s)?s.value:s:E4.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!E4.isPair(r))return!1;let n=r.value;return n==null||e&&E4.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 E4.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(E4.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,Qhr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};Xdt.Collection=qhr;Xdt.collectionFromPath=Qhr;Xdt.isEmptyPath=Uni});var JNe=I(tft=>{"use strict";p();var WZs=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function jhr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(jhr,"indentComment");var zZs=a((t,e,r)=>t.endsWith(` +`)?jhr(r,e):r.includes(` `)?` -`+qhr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");eft.indentComment=qhr;eft.lineComment=jZs;eft.stringifyComment=qZs});var Bni=I(KNe=>{"use strict";p();var HZs="flow",jhr="block",tft="quoted";function GZs(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,E=-1,_=-1;r===jhr&&(y=Lni(t,y,e.length),y!==-1&&(h=y+u));for(let b;b=t[y+=1];){if(r===tft&&b==="\\"){switch(E=y,t[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}_=y}if(b===` -`)r===jhr&&(y=Lni(t,y,e.length)),h=y+e.length+u,m=void 0;else{if(b===" "&&g&&g!==" "&&g!==` +`+jhr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");tft.indentComment=jhr;tft.lineComment=zZs;tft.stringifyComment=WZs});var qni=I(ZNe=>{"use strict";p();var YZs="flow",Hhr="block",rft="quoted";function KZs(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,E=-1,_=-1;r===Hhr&&(y=Qni(t,y,e.length),y!==-1&&(h=y+u));for(let b;b=t[y+=1];){if(r===rft&&b==="\\"){switch(E=y,t[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}_=y}if(b===` +`)r===Hhr&&(y=Qni(t,y,e.length)),h=y+e.length+u,m=void 0;else{if(b===" "&&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===tft){for(;g===" "||g===" ";)g=b,b=t[y+=1],A=!0;let T=y>_+1?y-2:E-1;if(f[T])return t;d.push(T),f[T]=!0,h=T+u,m=void 0}else A=!0}g=b}if(A&&l&&l(),d.length===0)return t;c&&c();let v=t.slice(0,d[0]);for(let b=0;b{"use strict";p();var J2=mm(),HH=Bni(),nft=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),ift=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function $Zs(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($Zs,"lineLengthOverLimit");function JNe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(ift(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===rft){for(;g===" "||g===" ";)g=b,b=t[y+=1],A=!0;let T=y>_+1?y-2:E-1;if(f[T])return t;d.push(T),f[T]=!0,h=T+u,m=void 0}else A=!0}g=b}if(A&&l&&l(),d.length===0)return t;c&&c();let v=t.slice(0,d[0]);for(let b=0;b{"use strict";p();var Z2=mm(),GH=qni(),ift=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),oft=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function JZs(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(JZs,"lineLengthOverLimit");function XNe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(oft(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(Ghr,`$&${d}`));let y=!1,E,_=-1;for(E=0;E{R=!0});let P=HH.foldFlowLines(`${v}${w}${g}`,d,HH.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=ift(n,!0);c!=="folded"&&e!==Z2.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{R=!0});let P=GH.foldFlowLines(`${v}${w}${g}`,d,GH.FOLD_BLOCK,x);if(!R)return`>${T} ${d}${P}`}return r=r.replace(/\n+/g,`$&${d}`),`|${T} -${d}${v}${r}${g}`}a(rft,"blockString");function VZs(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 Lme(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` -`)?Lme(s,e):rft(t,e,r,n);if(!l&&!f&&o!==J2.Scalar.PLAIN&&s.includes(` -`))return rft(t,e,r,n);if(ift(s)){if(u==="")return e.forceBlockIndent=!0,rft(t,e,r,n);if(l&&u===d)return Lme(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 Lme(s,e)}return l?h:HH.foldFlowLines(h,u,HH.FOLD_FLOW,nft(e,!1))}a(VZs,"plainString");function WZs(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!==J2.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=J2.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case J2.Scalar.BLOCK_FOLDED:case J2.Scalar.BLOCK_LITERAL:return o||s?Lme(c.value,e):rft(c,e,r,n);case J2.Scalar.QUOTE_DOUBLE:return JNe(c.value,e);case J2.Scalar.QUOTE_SINGLE:return Hhr(c.value,e);case J2.Scalar.PLAIN:return VZs(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(WZs,"stringifyString");Fni.stringifyString=WZs});var XNe=I($hr=>{"use strict";p();var zZs=Ydt(),GH=Za(),YZs=YNe(),KZs=ZNe();function JZs(t,e){let r=Object.assign({blockQuote:!0,commentString:YZs.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(JZs,"createStringifyContext");function ZZs(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(GH.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(ZZs,"getTagObject");function XZs(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(GH.isScalar(t)||GH.isCollection(t))&&t.anchor;s&&zZs.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(XZs,"stringifyProps");function eXs(t,e,r,n){if(GH.isPair(t))return t.toString(e,r,n);if(GH.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=GH.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=ZZs(e.doc.schema.tags,s));let c=XZs(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):GH.isScalar(s)?KZs.stringifyString(s,e,r,n):s.toString(e,r,n);return c?GH.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} -${e.indent}${l}`:l}a(eXs,"stringify");$hr.createStringifyContext=JZs;$hr.stringify=eXs});var jni=I(qni=>{"use strict";p();var w8=Za(),Uni=mm(),Qni=XNe(),eMe=YNe();function tXs({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=w8.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(w8.isCollection(t)||!w8.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||w8.isCollection(t)||(w8.isScalar(t)?t.type===Uni.Scalar.BLOCK_FOLDED||t.type===Uni.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!g&&(h||!s),indent:l+u});let A=!1,y=!1,E=Qni.stringify(t,r,()=>A=!0,()=>y=!0);if(!g&&!r.inFlow&&E.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(),E===""?"?":g?`? ${E}`:E}else if(s&&!h||e==null&&g)return E=`? ${E}`,m&&!A?E+=eMe.lineComment(E,r.indent,d(m)):y&&o&&o(),E;A&&(m=null),g?(m&&(E+=eMe.lineComment(E,r.indent,d(m))),E=`? ${E} -${l}:`):(E=`${E}:`,m&&(E+=eMe.lineComment(E,r.indent,d(m))));let _,v,b;w8.isNode(e)?(_=!!e.spaceBefore,v=e.commentBefore,b=e.comment):(_=!1,v=null,b=null,e&&typeof e=="object"&&(e=c.createNode(e))),r.implicitKey=!1,!g&&!m&&w8.isScalar(e)&&(r.indentAtStart=E.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&w8.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=Qni.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||_||v){if(R=_?` +${d}${v}${r}${g}`}a(nft,"blockString");function ZZs(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 Bme(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` +`)?Bme(s,e):nft(t,e,r,n);if(!l&&!f&&o!==Z2.Scalar.PLAIN&&s.includes(` +`))return nft(t,e,r,n);if(oft(s)){if(u==="")return e.forceBlockIndent=!0,nft(t,e,r,n);if(l&&u===d)return Bme(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 Bme(s,e)}return l?h:GH.foldFlowLines(h,u,GH.FOLD_FLOW,ift(e,!1))}a(ZZs,"plainString");function XZs(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!==Z2.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=Z2.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case Z2.Scalar.BLOCK_FOLDED:case Z2.Scalar.BLOCK_LITERAL:return o||s?Bme(c.value,e):nft(c,e,r,n);case Z2.Scalar.QUOTE_DOUBLE:return XNe(c.value,e);case Z2.Scalar.QUOTE_SINGLE:return Ghr(c.value,e);case Z2.Scalar.PLAIN:return ZZs(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(XZs,"stringifyString");jni.stringifyString=XZs});var tMe=I(Vhr=>{"use strict";p();var eXs=Kdt(),$H=Za(),tXs=JNe(),rXs=eMe();function nXs(t,e){let r=Object.assign({blockQuote:!0,commentString:tXs.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(nXs,"createStringifyContext");function iXs(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($H.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(iXs,"getTagObject");function oXs(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=($H.isScalar(t)||$H.isCollection(t))&&t.anchor;s&&eXs.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(oXs,"stringifyProps");function sXs(t,e,r,n){if($H.isPair(t))return t.toString(e,r,n);if($H.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=$H.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=iXs(e.doc.schema.tags,s));let c=oXs(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):$H.isScalar(s)?rXs.stringifyString(s,e,r,n):s.toString(e,r,n);return c?$H.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} +${e.indent}${l}`:l}a(sXs,"stringify");Vhr.createStringifyContext=nXs;Vhr.stringify=sXs});var Vni=I($ni=>{"use strict";p();var R8=Za(),Hni=mm(),Gni=tMe(),rMe=JNe();function aXs({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=R8.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(R8.isCollection(t)||!R8.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||R8.isCollection(t)||(R8.isScalar(t)?t.type===Hni.Scalar.BLOCK_FOLDED||t.type===Hni.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!g&&(h||!s),indent:l+u});let A=!1,y=!1,E=Gni.stringify(t,r,()=>A=!0,()=>y=!0);if(!g&&!r.inFlow&&E.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(),E===""?"?":g?`? ${E}`:E}else if(s&&!h||e==null&&g)return E=`? ${E}`,m&&!A?E+=rMe.lineComment(E,r.indent,d(m)):y&&o&&o(),E;A&&(m=null),g?(m&&(E+=rMe.lineComment(E,r.indent,d(m))),E=`? ${E} +${l}:`):(E=`${E}:`,m&&(E+=rMe.lineComment(E,r.indent,d(m))));let _,v,b;R8.isNode(e)?(_=!!e.spaceBefore,v=e.commentBefore,b=e.comment):(_=!1,v=null,b=null,e&&typeof e=="object"&&(e=c.createNode(e))),r.implicitKey=!1,!g&&!m&&R8.isScalar(e)&&(r.indentAtStart=E.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&R8.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=Gni.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||_||v){if(R=_?` `:"",v){let x=d(v);R+=` -${eMe.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` +${rMe.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` `&&b&&(R=` `):R+=` -${r.indent}`}else if(!g&&w8.isCollection(e)){let x=w[0],P=w.indexOf(` +${r.indent}`}else if(!g&&R8.isCollection(e)){let x=w[0],P=w.indexOf(` `),D=P!==-1,N=r.inFlow??e.flow??e.items.length===0;if(D||!N){let L=!1;if(D&&(x==="&"||x==="!")){let B=w.indexOf(" ");x==="&"&&B!==-1&&B{"use strict";p();var Hni=require("process");function rXs(t,...e){t==="debug"&&console.log(...e)}a(rXs,"debug");function nXs(t,e){(t==="debug"||t==="warn")&&(typeof Hni.emitWarning=="function"?Hni.emitWarning(e):console.warn(e))}a(nXs,"warn");Vhr.debug=rXs;Vhr.warn=nXs});var cft=I(aft=>{"use strict";p();var tMe=Za(),Gni=mm(),oft="<<",sft={identify:a(t=>t===oft||typeof t=="symbol"&&t.description===oft,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new Gni.Scalar(Symbol(oft)),{addToJSMap:$ni}),"resolve"),stringify:a(()=>oft,"stringify")},iXs=a((t,e)=>(sft.identify(e)||tMe.isScalar(e)&&(!e.type||e.type===Gni.Scalar.PLAIN)&&sft.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===sft.tag&&r.default),"isMergeKey");function $ni(t,e,r){if(r=t&&tMe.isAlias(r)?r.resolve(t.doc):r,tMe.isSeq(r))for(let n of r.items)zhr(t,e,n);else if(Array.isArray(r))for(let n of r)zhr(t,e,n);else zhr(t,e,r)}a($ni,"addMergeToJSMap");function zhr(t,e,r){let n=t&&tMe.isAlias(r)?r.resolve(t.doc):r;if(!tMe.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(zhr,"mergeValue");aft.addMergeToJSMap=$ni;aft.isMergeKey=iXs;aft.merge=sft});var Khr=I(zni=>{"use strict";p();var oXs=Whr(),Vni=cft(),sXs=XNe(),Wni=Za(),Yhr=qH();function aXs(t,e,{key:r,value:n}){if(Wni.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(Vni.isMergeKey(t,r))Vni.addMergeToJSMap(t,e,n);else{let o=Yhr.toJS(r,"",t);if(e instanceof Map)e.set(o,Yhr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=cXs(r,o,t),c=Yhr.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(aXs,"addPairToJSMap");function cXs(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Wni.isNode(t)&&r?.doc){let n=sXs.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)+'..."'),oXs.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(cXs,"stringifyKey");zni.addPairToJSMap=aXs});var $H=I(Jhr=>{"use strict";p();var Yni=zNe(),lXs=jni(),uXs=Khr(),lft=Za();function dXs(t,e,r){let n=Yni.createNode(t,void 0,r),o=Yni.createNode(e,void 0,r);return new uft(n,o)}a(dXs,"createPair");var uft=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,lft.NODE_TYPE,{value:lft.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return lft.isNode(r)&&(r=r.clone(e)),lft.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return uXs.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?lXs.stringifyPair(this,e,r,n):JSON.stringify(this)}};Jhr.Pair=uft;Jhr.createPair=dXs});var Zhr=I(Jni=>{"use strict";p();var gee=Za(),Kni=XNe(),dft=YNe();function fXs(t,e,r){return(e.inFlow??t.flow?hXs:pXs)(t,e,r)}a(fXs,"stringifyCollection");function pXs({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;AE=null,()=>h=!0);E&&(_+=dft.lineComment(_,s,d(E))),h&&E&&(h=!1),m.push(n+_)}let g;if(m.length===0)g=o.start+o.end;else{g=m[0];for(let A=1;A{"use strict";p();var Wni=require("process");function cXs(t,...e){t==="debug"&&console.log(...e)}a(cXs,"debug");function lXs(t,e){(t==="debug"||t==="warn")&&(typeof Wni.emitWarning=="function"?Wni.emitWarning(e):console.warn(e))}a(lXs,"warn");Whr.debug=cXs;Whr.warn=lXs});var lft=I(cft=>{"use strict";p();var nMe=Za(),zni=mm(),sft="<<",aft={identify:a(t=>t===sft||typeof t=="symbol"&&t.description===sft,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new zni.Scalar(Symbol(sft)),{addToJSMap:Yni}),"resolve"),stringify:a(()=>sft,"stringify")},uXs=a((t,e)=>(aft.identify(e)||nMe.isScalar(e)&&(!e.type||e.type===zni.Scalar.PLAIN)&&aft.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===aft.tag&&r.default),"isMergeKey");function Yni(t,e,r){if(r=t&&nMe.isAlias(r)?r.resolve(t.doc):r,nMe.isSeq(r))for(let n of r.items)Yhr(t,e,n);else if(Array.isArray(r))for(let n of r)Yhr(t,e,n);else Yhr(t,e,r)}a(Yni,"addMergeToJSMap");function Yhr(t,e,r){let n=t&&nMe.isAlias(r)?r.resolve(t.doc):r;if(!nMe.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(Yhr,"mergeValue");cft.addMergeToJSMap=Yni;cft.isMergeKey=uXs;cft.merge=aft});var Jhr=I(Zni=>{"use strict";p();var dXs=zhr(),Kni=lft(),fXs=tMe(),Jni=Za(),Khr=jH();function pXs(t,e,{key:r,value:n}){if(Jni.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(Kni.isMergeKey(t,r))Kni.addMergeToJSMap(t,e,n);else{let o=Khr.toJS(r,"",t);if(e instanceof Map)e.set(o,Khr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=hXs(r,o,t),c=Khr.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(pXs,"addPairToJSMap");function hXs(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Jni.isNode(t)&&r?.doc){let n=fXs.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)+'..."'),dXs.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(hXs,"stringifyKey");Zni.addPairToJSMap=pXs});var VH=I(Zhr=>{"use strict";p();var Xni=KNe(),mXs=Vni(),gXs=Jhr(),uft=Za();function AXs(t,e,r){let n=Xni.createNode(t,void 0,r),o=Xni.createNode(e,void 0,r);return new dft(n,o)}a(AXs,"createPair");var dft=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,uft.NODE_TYPE,{value:uft.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return uft.isNode(r)&&(r=r.clone(e)),uft.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return gXs.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?mXs.stringifyPair(this,e,r,n):JSON.stringify(this)}};Zhr.Pair=dft;Zhr.createPair=AXs});var Xhr=I(tii=>{"use strict";p();var gee=Za(),eii=tMe(),fft=JNe();function yXs(t,e,r){return(e.inFlow??t.flow?_Xs:EXs)(t,e,r)}a(yXs,"stringifyCollection");function EXs({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;AE=null,()=>h=!0);E&&(_+=fft.lineComment(_,s,d(E))),h&&E&&(h=!1),m.push(n+_)}let g;if(m.length===0)g=o.start+o.end;else{g=m[0];for(let A=1;AE=null);d||(d=h.length>f||_.includes(` -`)),A0&&(d||(d=h.reduce((v,b)=>v+b.length+2,2)+(_.length+2)>e.options.lineWidth)),d&&(_+=",")),E&&(_+=dft.lineComment(_,n,l(E))),h.push(_),f=h.length}let{start:m,end:g}=r;if(h.length===0)return m+g;if(!d){let A=h.reduce((y,E)=>y+E.length+2,2);d=e.options.lineWidth>0&&A>e.options.lineWidth}if(d){let A=m;for(let y of h)A+=y?` +`+fft.indentComment(d(t),u),l&&l()):h&&c&&c(),g}a(EXs,"stringifyBlockCollection");function _Xs({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;AE=null);d||(d=h.length>f||_.includes(` +`)),A0&&(d||(d=h.reduce((v,b)=>v+b.length+2,2)+(_.length+2)>e.options.lineWidth)),d&&(_+=",")),E&&(_+=fft.lineComment(_,n,l(E))),h.push(_),f=h.length}let{start:m,end:g}=r;if(h.length===0)return m+g;if(!d){let A=h.reduce((y,E)=>y+E.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(hXs,"stringifyFlowCollection");function fft({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=dft.indentComment(e(n),t);r.push(s.trimStart())}}a(fft,"addCommentBefore");Jni.stringifyCollection=fXs});var WH=I(emr=>{"use strict";p();var mXs=Zhr(),gXs=Khr(),AXs=Xdt(),VH=Za(),pft=$H(),yXs=mm();function rMe(t,e){let r=VH.isScalar(e)?e.value:e;for(let n of t)if(VH.isPair(n)&&(n.key===e||n.key===r||VH.isScalar(n.key)&&n.key.value===r))return n}a(rMe,"findPair");var Xhr=class extends AXs.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(VH.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(pft.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;VH.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new pft.Pair(e,e?.value):n=new pft.Pair(e.key,e.value);let o=rMe(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);VH.isScalar(o.value)&&yXs.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=rMe(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=rMe(this.items,e)?.value;return(!r&&VH.isScalar(o)?o.value:o)??void 0}has(e){return!!rMe(this.items,e)}set(e,r){this.add(new pft.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)gXs.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!VH.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})),mXs.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};emr.YAMLMap=Xhr;emr.findPair=rMe});var Bme=I(Xni=>{"use strict";p();var EXs=Za(),Zni=WH(),_Xs={collection:"map",default:!0,nodeClass:Zni.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return EXs.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>Zni.YAMLMap.from(t,e,r),"createNode")};Xni.map=_Xs});var zH=I(eii=>{"use strict";p();var vXs=zNe(),CXs=Zhr(),bXs=Xdt(),mft=Za(),SXs=mm(),TXs=qH(),tmr=class extends bXs.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(mft.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=hft(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=hft(e);if(typeof n!="number")return;let o=this.items[n];return!r&&mft.isScalar(o)?o.value:o}has(e){let r=hft(e);return typeof r=="number"&&r=0?e:null}a(hft,"asItemIndex");eii.YAMLSeq=tmr});var Fme=I(rii=>{"use strict";p();var IXs=Za(),tii=zH(),xXs={collection:"seq",default:!0,nodeClass:tii.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return IXs.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>tii.YAMLSeq.from(t,e,r),"createNode")};rii.seq=xXs});var nMe=I(nii=>{"use strict";p();var wXs=ZNe(),RXs={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),wXs.stringifyString(t,e,r,n)}};nii.string=RXs});var gft=I(sii=>{"use strict";p();var iii=mm(),oii={identify:a(t=>t==null,"identify"),createNode:a(()=>new iii.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new iii.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&oii.test.test(t)?t:e.options.nullStr,"stringify")};sii.nullTag=oii});var rmr=I(cii=>{"use strict";p();var kXs=mm(),aii={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 kXs.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&aii.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};cii.boolTag=aii});var Ume=I(lii=>{"use strict";p();function PXs({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(PXs,"stringifyNumber");lii.stringifyNumber=PXs});var imr=I(Aft=>{"use strict";p();var DXs=mm(),nmr=Ume(),NXs={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:nmr.stringifyNumber},MXs={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():nmr.stringifyNumber(t)}},OXs={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 DXs.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:nmr.stringifyNumber};Aft.float=OXs;Aft.floatExp=MXs;Aft.floatNaN=NXs});var smr=I(Eft=>{"use strict";p();var uii=Ume(),yft=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),omr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function dii(t,e,r){let{value:n}=t;return yft(n)&&n>=0?r+n.toString(e):uii.stringifyNumber(t)}a(dii,"intStringify");var LXs={identify:a(t=>yft(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>omr(t,2,8,r),"resolve"),stringify:a(t=>dii(t,8,"0o"),"stringify")},BXs={identify:yft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>omr(t,0,10,r),"resolve"),stringify:uii.stringifyNumber},FXs={identify:a(t=>yft(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)=>omr(t,2,16,r),"resolve"),stringify:a(t=>dii(t,16,"0x"),"stringify")};Eft.int=BXs;Eft.intHex=FXs;Eft.intOct=LXs});var pii=I(fii=>{"use strict";p();var UXs=Bme(),QXs=gft(),qXs=Fme(),jXs=nMe(),HXs=rmr(),amr=imr(),cmr=smr(),GXs=[UXs.map,qXs.seq,jXs.string,QXs.nullTag,HXs.boolTag,cmr.intOct,cmr.int,cmr.intHex,amr.floatNaN,amr.floatExp,amr.float];fii.schema=GXs});var gii=I(mii=>{"use strict";p();var $Xs=mm(),VXs=Bme(),WXs=Fme();function hii(t){return typeof t=="bigint"||Number.isInteger(t)}a(hii,"intIdentify");var _ft=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),zXs=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:_ft},{identify:a(t=>t==null,"identify"),createNode:a(()=>new $Xs.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:_ft},{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:_ft},{identify:hii,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})=>hii(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:_ft}],YXs={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},KXs=[VXs.map,WXs.seq].concat(zXs,YXs);mii.schema=KXs});var umr=I(Aii=>{"use strict";p();var iMe=require("buffer"),lmr=mm(),JXs=ZNe(),ZXs={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof iMe.Buffer=="function")return iMe.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 vft=Za(),dmr=$H(),XXs=mm(),eea=zH();function yii(t,e){if(vft.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new dmr.Pair(new XXs.Scalar(null));if(n.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${n.commentBefore} +${o}${g}`}else return`${m}${c}${h.join(" ")}${c}${g}`}a(_Xs,"stringifyFlowCollection");function pft({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=fft.indentComment(e(n),t);r.push(s.trimStart())}}a(pft,"addCommentBefore");tii.stringifyCollection=yXs});var zH=I(tmr=>{"use strict";p();var vXs=Xhr(),CXs=Jhr(),bXs=eft(),WH=Za(),hft=VH(),SXs=mm();function iMe(t,e){let r=WH.isScalar(e)?e.value:e;for(let n of t)if(WH.isPair(n)&&(n.key===e||n.key===r||WH.isScalar(n.key)&&n.key.value===r))return n}a(iMe,"findPair");var emr=class extends bXs.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(WH.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(hft.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;WH.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new hft.Pair(e,e?.value):n=new hft.Pair(e.key,e.value);let o=iMe(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);WH.isScalar(o.value)&&SXs.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=iMe(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=iMe(this.items,e)?.value;return(!r&&WH.isScalar(o)?o.value:o)??void 0}has(e){return!!iMe(this.items,e)}set(e,r){this.add(new hft.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)CXs.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!WH.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})),vXs.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};tmr.YAMLMap=emr;tmr.findPair=iMe});var Fme=I(nii=>{"use strict";p();var TXs=Za(),rii=zH(),IXs={collection:"map",default:!0,nodeClass:rii.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return TXs.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>rii.YAMLMap.from(t,e,r),"createNode")};nii.map=IXs});var YH=I(iii=>{"use strict";p();var xXs=KNe(),wXs=Xhr(),RXs=eft(),gft=Za(),kXs=mm(),PXs=jH(),rmr=class extends RXs.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(gft.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=mft(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=mft(e);if(typeof n!="number")return;let o=this.items[n];return!r&&gft.isScalar(o)?o.value:o}has(e){let r=mft(e);return typeof r=="number"&&r=0?e:null}a(mft,"asItemIndex");iii.YAMLSeq=rmr});var Ume=I(sii=>{"use strict";p();var DXs=Za(),oii=YH(),NXs={collection:"seq",default:!0,nodeClass:oii.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return DXs.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>oii.YAMLSeq.from(t,e,r),"createNode")};sii.seq=NXs});var oMe=I(aii=>{"use strict";p();var MXs=eMe(),OXs={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),MXs.stringifyString(t,e,r,n)}};aii.string=OXs});var Aft=I(uii=>{"use strict";p();var cii=mm(),lii={identify:a(t=>t==null,"identify"),createNode:a(()=>new cii.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new cii.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&lii.test.test(t)?t:e.options.nullStr,"stringify")};uii.nullTag=lii});var nmr=I(fii=>{"use strict";p();var LXs=mm(),dii={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 LXs.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&dii.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};fii.boolTag=dii});var Qme=I(pii=>{"use strict";p();function BXs({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(BXs,"stringifyNumber");pii.stringifyNumber=BXs});var omr=I(yft=>{"use strict";p();var FXs=mm(),imr=Qme(),UXs={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:imr.stringifyNumber},QXs={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():imr.stringifyNumber(t)}},qXs={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 FXs.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:imr.stringifyNumber};yft.float=qXs;yft.floatExp=QXs;yft.floatNaN=UXs});var amr=I(_ft=>{"use strict";p();var hii=Qme(),Eft=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),smr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function mii(t,e,r){let{value:n}=t;return Eft(n)&&n>=0?r+n.toString(e):hii.stringifyNumber(t)}a(mii,"intStringify");var jXs={identify:a(t=>Eft(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>smr(t,2,8,r),"resolve"),stringify:a(t=>mii(t,8,"0o"),"stringify")},HXs={identify:Eft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>smr(t,0,10,r),"resolve"),stringify:hii.stringifyNumber},GXs={identify:a(t=>Eft(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)=>smr(t,2,16,r),"resolve"),stringify:a(t=>mii(t,16,"0x"),"stringify")};_ft.int=HXs;_ft.intHex=GXs;_ft.intOct=jXs});var Aii=I(gii=>{"use strict";p();var $Xs=Fme(),VXs=Aft(),WXs=Ume(),zXs=oMe(),YXs=nmr(),cmr=omr(),lmr=amr(),KXs=[$Xs.map,WXs.seq,zXs.string,VXs.nullTag,YXs.boolTag,lmr.intOct,lmr.int,lmr.intHex,cmr.floatNaN,cmr.floatExp,cmr.float];gii.schema=KXs});var _ii=I(Eii=>{"use strict";p();var JXs=mm(),ZXs=Fme(),XXs=Ume();function yii(t){return typeof t=="bigint"||Number.isInteger(t)}a(yii,"intIdentify");var vft=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),eea=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:vft},{identify:a(t=>t==null,"identify"),createNode:a(()=>new JXs.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:vft},{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:vft},{identify:yii,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})=>yii(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:vft}],tea={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},rea=[ZXs.map,XXs.seq].concat(eea,tea);Eii.schema=rea});var dmr=I(vii=>{"use strict";p();var sMe=require("buffer"),umr=mm(),nea=eMe(),iea={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof sMe.Buffer=="function")return sMe.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 Cft=Za(),fmr=VH(),oea=mm(),sea=YH();function Cii(t,e){if(Cft.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new fmr.Pair(new oea.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]=vft.isPair(n)?n:new dmr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(yii,"resolvePairs");function Eii(t,e,r){let{replacer:n}=r,o=new eea.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(dmr.createPair(l,u,r))}return o}a(Eii,"createPairs");var tea={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:yii,createNode:Eii};Cft.createPairs=Eii;Cft.pairs=tea;Cft.resolvePairs=yii});var hmr=I(pmr=>{"use strict";p();var _ii=Za(),fmr=qH(),oMe=WH(),rea=zH(),vii=bft(),Aee=class t extends rea.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=oMe.YAMLMap.prototype.add.bind(this),this.delete=oMe.YAMLMap.prototype.delete.bind(this),this.get=oMe.YAMLMap.prototype.get.bind(this),this.has=oMe.YAMLMap.prototype.has.bind(this),this.set=oMe.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(_ii.isPair(o)?(s=fmr.toJS(o.key,"",r),c=fmr.toJS(o.value,s,r)):s=fmr.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=vii.createPairs(e,r,n),s=new this;return s.items=o.items,s}};Aee.tag="tag:yaml.org,2002:omap";var nea={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:Aee,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=vii.resolvePairs(t,e),n=[];for(let{key:o}of r.items)_ii.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new Aee,r)},createNode:a((t,e,r)=>Aee.from(t,e,r),"createNode")};pmr.YAMLOMap=Aee;pmr.omap=nea});var Iii=I(mmr=>{"use strict";p();var Cii=mm();function bii({value:t,source:e},r){return e&&(t?Sii:Tii).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(bii,"boolStringify");var Sii={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 Cii.Scalar(!0),"resolve"),stringify:bii},Tii={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 Cii.Scalar(!1),"resolve"),stringify:bii};mmr.falseTag=Tii;mmr.trueTag=Sii});var xii=I(Sft=>{"use strict";p();var iea=mm(),gmr=Ume(),oea={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:gmr.stringifyNumber},sea={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():gmr.stringifyNumber(t)}},aea={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 iea.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:gmr.stringifyNumber};Sft.float=aea;Sft.floatExp=sea;Sft.floatNaN=oea});var Rii=I(aMe=>{"use strict";p();var wii=Ume(),sMe=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function Tft(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(Tft,"intResolve");function Amr(t,e,r){let{value:n}=t;if(sMe(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return wii.stringifyNumber(t)}a(Amr,"intStringify");var cea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>Tft(t,2,2,r),"resolve"),stringify:a(t=>Amr(t,2,"0b"),"stringify")},lea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>Tft(t,1,8,r),"resolve"),stringify:a(t=>Amr(t,8,"0"),"stringify")},uea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>Tft(t,0,10,r),"resolve"),stringify:wii.stringifyNumber},dea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>Tft(t,2,16,r),"resolve"),stringify:a(t=>Amr(t,16,"0x"),"stringify")};aMe.int=uea;aMe.intBin=cea;aMe.intHex=dea;aMe.intOct=lea});var Emr=I(ymr=>{"use strict";p();var wft=Za(),Ift=$H(),xft=WH(),yee=class t extends xft.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;wft.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Ift.Pair(e.key,null):r=new Ift.Pair(e,null),xft.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=xft.findPair(this.items,e);return!r&&wft.isPair(n)?wft.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=xft.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Ift.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(Ift.createPair(c,null,n));return s}};yee.tag="tag:yaml.org,2002:set";var fea={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:yee,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>yee.from(t,e,r),"createNode"),resolve(t,e){if(wft.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new yee,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ymr.YAMLSet=yee;ymr.set=fea});var vmr=I(Rft=>{"use strict";p();var pea=Ume();function _mr(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(_mr,"parseSexagesimal");function kii(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 pea.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(kii,"stringifySexagesimal");var hea={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})=>_mr(t,r),"resolve"),stringify:kii},mea={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=>_mr(t,!1),"resolve"),stringify:kii},Pii={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(Pii.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=_mr(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")};Rft.floatTime=mea;Rft.intTime=hea;Rft.timestamp=Pii});var Mii=I(Nii=>{"use strict";p();var gea=Bme(),Aea=gft(),yea=Fme(),Eea=nMe(),_ea=umr(),Dii=Iii(),Cmr=xii(),kft=Rii(),vea=cft(),Cea=hmr(),bea=bft(),Sea=Emr(),bmr=vmr(),Tea=[gea.map,yea.seq,Eea.string,Aea.nullTag,Dii.trueTag,Dii.falseTag,kft.intBin,kft.intOct,kft.int,kft.intHex,Cmr.floatNaN,Cmr.floatExp,Cmr.float,_ea.binary,vea.merge,Cea.omap,bea.pairs,Sea.set,bmr.intTime,bmr.floatTime,bmr.timestamp];Nii.schema=Tea});var Gii=I(Imr=>{"use strict";p();var Fii=Bme(),Iea=gft(),Uii=Fme(),xea=nMe(),wea=rmr(),Smr=imr(),Tmr=smr(),Rea=pii(),kea=gii(),Qii=umr(),cMe=cft(),qii=hmr(),jii=bft(),Oii=Mii(),Hii=Emr(),Pft=vmr(),Lii=new Map([["core",Rea.schema],["failsafe",[Fii.map,Uii.seq,xea.string]],["json",kea.schema],["yaml11",Oii.schema],["yaml-1.1",Oii.schema]]),Bii={binary:Qii.binary,bool:wea.boolTag,float:Smr.float,floatExp:Smr.floatExp,floatNaN:Smr.floatNaN,floatTime:Pft.floatTime,int:Tmr.int,intHex:Tmr.intHex,intOct:Tmr.intOct,intTime:Pft.intTime,map:Fii.map,merge:cMe.merge,null:Iea.nullTag,omap:qii.omap,pairs:jii.pairs,seq:Uii.seq,set:Hii.set,timestamp:Pft.timestamp},Pea={"tag:yaml.org,2002:binary":Qii.binary,"tag:yaml.org,2002:merge":cMe.merge,"tag:yaml.org,2002:omap":qii.omap,"tag:yaml.org,2002:pairs":jii.pairs,"tag:yaml.org,2002:set":Hii.set,"tag:yaml.org,2002:timestamp":Pft.timestamp};function Dea(t,e,r){let n=Lii.get(e);if(n&&!t)return r&&!n.includes(cMe.merge)?n.concat(cMe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(Lii.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(cMe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?Bii[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(Bii).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(Dea,"getTags");Imr.coreKnownTags=Pea;Imr.getTags=Dea});var Rmr=I($ii=>{"use strict";p();var xmr=Za(),Nea=Bme(),Mea=Fme(),Oea=nMe(),Dft=Gii(),Lea=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),wmr=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)?Dft.getTags(e,"compat"):e?Dft.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?Dft.coreKnownTags:{},this.tags=Dft.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,xmr.MAP,{value:Nea.map}),Object.defineProperty(this,xmr.SCALAR,{value:Oea.string}),Object.defineProperty(this,xmr.SEQ,{value:Mea.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?Lea:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};$ii.Schema=wmr});var Wii=I(Vii=>{"use strict";p();var Bea=Za(),kmr=XNe(),lMe=YNe();function Fea(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=kmr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(lMe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(Bea.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(lMe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=kmr.stringify(t.contents,o,()=>l=null,u);l&&(d+=lMe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(kmr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` -`)?(r.push("..."),r.push(lMe.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(lMe.indentComment(s(u),"")))}return r.join(` +${s.comment}`:n.comment}n=o}t.items[r]=Cft.isPair(n)?n:new fmr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(Cii,"resolvePairs");function bii(t,e,r){let{replacer:n}=r,o=new sea.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(fmr.createPair(l,u,r))}return o}a(bii,"createPairs");var aea={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Cii,createNode:bii};bft.createPairs=bii;bft.pairs=aea;bft.resolvePairs=Cii});var mmr=I(hmr=>{"use strict";p();var Sii=Za(),pmr=jH(),aMe=zH(),cea=YH(),Tii=Sft(),Aee=class t extends cea.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=aMe.YAMLMap.prototype.add.bind(this),this.delete=aMe.YAMLMap.prototype.delete.bind(this),this.get=aMe.YAMLMap.prototype.get.bind(this),this.has=aMe.YAMLMap.prototype.has.bind(this),this.set=aMe.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(Sii.isPair(o)?(s=pmr.toJS(o.key,"",r),c=pmr.toJS(o.value,s,r)):s=pmr.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=Tii.createPairs(e,r,n),s=new this;return s.items=o.items,s}};Aee.tag="tag:yaml.org,2002:omap";var lea={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:Aee,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Tii.resolvePairs(t,e),n=[];for(let{key:o}of r.items)Sii.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new Aee,r)},createNode:a((t,e,r)=>Aee.from(t,e,r),"createNode")};hmr.YAMLOMap=Aee;hmr.omap=lea});var kii=I(gmr=>{"use strict";p();var Iii=mm();function xii({value:t,source:e},r){return e&&(t?wii:Rii).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(xii,"boolStringify");var wii={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 Iii.Scalar(!0),"resolve"),stringify:xii},Rii={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 Iii.Scalar(!1),"resolve"),stringify:xii};gmr.falseTag=Rii;gmr.trueTag=wii});var Pii=I(Tft=>{"use strict";p();var uea=mm(),Amr=Qme(),dea={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:Amr.stringifyNumber},fea={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():Amr.stringifyNumber(t)}},pea={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 uea.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:Amr.stringifyNumber};Tft.float=pea;Tft.floatExp=fea;Tft.floatNaN=dea});var Nii=I(lMe=>{"use strict";p();var Dii=Qme(),cMe=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function Ift(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(Ift,"intResolve");function ymr(t,e,r){let{value:n}=t;if(cMe(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return Dii.stringifyNumber(t)}a(ymr,"intStringify");var hea={identify:cMe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>Ift(t,2,2,r),"resolve"),stringify:a(t=>ymr(t,2,"0b"),"stringify")},mea={identify:cMe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>Ift(t,1,8,r),"resolve"),stringify:a(t=>ymr(t,8,"0"),"stringify")},gea={identify:cMe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>Ift(t,0,10,r),"resolve"),stringify:Dii.stringifyNumber},Aea={identify:cMe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>Ift(t,2,16,r),"resolve"),stringify:a(t=>ymr(t,16,"0x"),"stringify")};lMe.int=gea;lMe.intBin=hea;lMe.intHex=Aea;lMe.intOct=mea});var _mr=I(Emr=>{"use strict";p();var Rft=Za(),xft=VH(),wft=zH(),yee=class t extends wft.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;Rft.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new xft.Pair(e.key,null):r=new xft.Pair(e,null),wft.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=wft.findPair(this.items,e);return!r&&Rft.isPair(n)?Rft.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=wft.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new xft.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(xft.createPair(c,null,n));return s}};yee.tag="tag:yaml.org,2002:set";var yea={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:yee,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>yee.from(t,e,r),"createNode"),resolve(t,e){if(Rft.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new yee,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Emr.YAMLSet=yee;Emr.set=yea});var Cmr=I(kft=>{"use strict";p();var Eea=Qme();function vmr(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(vmr,"parseSexagesimal");function Mii(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 Eea.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(Mii,"stringifySexagesimal");var _ea={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})=>vmr(t,r),"resolve"),stringify:Mii},vea={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=>vmr(t,!1),"resolve"),stringify:Mii},Oii={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(Oii.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=vmr(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")};kft.floatTime=vea;kft.intTime=_ea;kft.timestamp=Oii});var Fii=I(Bii=>{"use strict";p();var Cea=Fme(),bea=Aft(),Sea=Ume(),Tea=oMe(),Iea=dmr(),Lii=kii(),bmr=Pii(),Pft=Nii(),xea=lft(),wea=mmr(),Rea=Sft(),kea=_mr(),Smr=Cmr(),Pea=[Cea.map,Sea.seq,Tea.string,bea.nullTag,Lii.trueTag,Lii.falseTag,Pft.intBin,Pft.intOct,Pft.int,Pft.intHex,bmr.floatNaN,bmr.floatExp,bmr.float,Iea.binary,xea.merge,wea.omap,Rea.pairs,kea.set,Smr.intTime,Smr.floatTime,Smr.timestamp];Bii.schema=Pea});var zii=I(xmr=>{"use strict";p();var jii=Fme(),Dea=Aft(),Hii=Ume(),Nea=oMe(),Mea=nmr(),Tmr=omr(),Imr=amr(),Oea=Aii(),Lea=_ii(),Gii=dmr(),uMe=lft(),$ii=mmr(),Vii=Sft(),Uii=Fii(),Wii=_mr(),Dft=Cmr(),Qii=new Map([["core",Oea.schema],["failsafe",[jii.map,Hii.seq,Nea.string]],["json",Lea.schema],["yaml11",Uii.schema],["yaml-1.1",Uii.schema]]),qii={binary:Gii.binary,bool:Mea.boolTag,float:Tmr.float,floatExp:Tmr.floatExp,floatNaN:Tmr.floatNaN,floatTime:Dft.floatTime,int:Imr.int,intHex:Imr.intHex,intOct:Imr.intOct,intTime:Dft.intTime,map:jii.map,merge:uMe.merge,null:Dea.nullTag,omap:$ii.omap,pairs:Vii.pairs,seq:Hii.seq,set:Wii.set,timestamp:Dft.timestamp},Bea={"tag:yaml.org,2002:binary":Gii.binary,"tag:yaml.org,2002:merge":uMe.merge,"tag:yaml.org,2002:omap":$ii.omap,"tag:yaml.org,2002:pairs":Vii.pairs,"tag:yaml.org,2002:set":Wii.set,"tag:yaml.org,2002:timestamp":Dft.timestamp};function Fea(t,e,r){let n=Qii.get(e);if(n&&!t)return r&&!n.includes(uMe.merge)?n.concat(uMe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(Qii.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(uMe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?qii[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(qii).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(Fea,"getTags");xmr.coreKnownTags=Bea;xmr.getTags=Fea});var kmr=I(Yii=>{"use strict";p();var wmr=Za(),Uea=Fme(),Qea=Ume(),qea=oMe(),Nft=zii(),jea=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),Rmr=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)?Nft.getTags(e,"compat"):e?Nft.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?Nft.coreKnownTags:{},this.tags=Nft.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,wmr.MAP,{value:Uea.map}),Object.defineProperty(this,wmr.SCALAR,{value:qea.string}),Object.defineProperty(this,wmr.SEQ,{value:Qea.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?jea:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Yii.Schema=Rmr});var Jii=I(Kii=>{"use strict";p();var Hea=Za(),Pmr=tMe(),dMe=JNe();function Gea(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=Pmr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(dMe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(Hea.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(dMe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=Pmr.stringify(t.contents,o,()=>l=null,u);l&&(d+=dMe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(Pmr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` +`)?(r.push("..."),r.push(dMe.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(dMe.indentComment(s(u),"")))}return r.join(` `)+` -`}a(Fea,"stringifyDocument");Vii.stringifyDocument=Fea});var uMe=I(zii=>{"use strict";p();var Uea=WNe(),Qme=Xdt(),lR=Za(),Qea=$H(),qea=qH(),jea=Rmr(),Hea=Wii(),Pmr=Ydt(),Gea=Ohr(),$ea=zNe(),Dmr=Mhr(),Nmr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,lR.NODE_TYPE,{value:lR.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 Dmr.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,{[lR.NODE_TYPE]:{value:lR.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=lR.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){qme(this.contents)&&this.contents.add(e)}addIn(e,r){qme(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Pmr.anchorNames(this);e.anchor=!r||n.has(r)?Pmr.findNewAnchor(r||"a",n):r}return new Uea.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 E=a(v=>typeof v=="number"||v instanceof String||v instanceof Number,"keyToStr"),_=r.filter(E).map(String);_.length>0&&(r=r.concat(_)),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}=Pmr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=$ea.createNode(e,f,A);return l&&lR.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 Qea.Pair(o,s)}delete(e){return qme(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Qme.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):qme(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return lR.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Qme.isEmptyPath(e)?!r&&lR.isScalar(this.contents)?this.contents.value:this.contents:lR.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return lR.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Qme.isEmptyPath(e)?this.contents!==void 0:lR.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Qme.collectionFromPath(this.schema,[e],r):qme(this.contents)&&this.contents.set(e,r)}setIn(e,r){Qme.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Qme.collectionFromPath(this.schema,Array.from(e),r):qme(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 Dmr.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 Dmr.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 jea.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=qea.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"?Gea.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 Hea.stringifyDocument(this,e)}};function qme(t){if(lR.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(qme,"assertCollection");zii.Document=Nmr});var pMe=I(fMe=>{"use strict";p();var dMe=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}},Mmr=class extends dMe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},Omr=class extends dMe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},Vea=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(Gea,"stringifyDocument");Kii.stringifyDocument=Gea});var fMe=I(Zii=>{"use strict";p();var $ea=YNe(),qme=eft(),uR=Za(),Vea=VH(),Wea=jH(),zea=kmr(),Yea=Jii(),Dmr=Kdt(),Kea=Lhr(),Jea=KNe(),Nmr=Ohr(),Mmr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,uR.NODE_TYPE,{value:uR.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 Nmr.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,{[uR.NODE_TYPE]:{value:uR.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=uR.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){jme(this.contents)&&this.contents.add(e)}addIn(e,r){jme(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Dmr.anchorNames(this);e.anchor=!r||n.has(r)?Dmr.findNewAnchor(r||"a",n):r}return new $ea.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 E=a(v=>typeof v=="number"||v instanceof String||v instanceof Number,"keyToStr"),_=r.filter(E).map(String);_.length>0&&(r=r.concat(_)),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}=Dmr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=Jea.createNode(e,f,A);return l&&uR.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 Vea.Pair(o,s)}delete(e){return jme(this.contents)?this.contents.delete(e):!1}deleteIn(e){return qme.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):jme(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return uR.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return qme.isEmptyPath(e)?!r&&uR.isScalar(this.contents)?this.contents.value:this.contents:uR.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return uR.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return qme.isEmptyPath(e)?this.contents!==void 0:uR.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=qme.collectionFromPath(this.schema,[e],r):jme(this.contents)&&this.contents.set(e,r)}setIn(e,r){qme.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=qme.collectionFromPath(this.schema,Array.from(e),r):jme(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 Nmr.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 Nmr.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 zea.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=Wea.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"?Kea.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 Yea.stringifyDocument(this,e)}};function jme(t){if(uR.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(jme,"assertCollection");Zii.Document=Mmr});var mMe=I(hMe=>{"use strict";p();var pMe=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}},Omr=class extends pMe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},Lmr=class extends pMe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},Zea=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");fMe.YAMLError=dMe;fMe.YAMLParseError=Mmr;fMe.YAMLWarning=Omr;fMe.prettifyError=Vea});var hMe=I(Yii=>{"use strict";p();function Wea(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,E=null,_=null,v=null,b=null,T=null,w=null;for(let P of t)switch(A&&(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma"&&s(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A=!1),y&&(d&&P.type!=="comment"&&P.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),P.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&P.source.includes(" ")&&(y=P),f=!0;break;case"comment":{f||s(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=P.source.substring(1)||" ";h?h+=m+D:h=D,m="",d=!1;break}case"newline":d?h?h+=P.source:(!T||r!=="seq-item-ind")&&(u=!0):m+=P.source,d=!0,g=!0,(E||_)&&(v=P),f=!0;break;case"anchor":E&&s(P,"MULTIPLE_ANCHORS","A node can have at most one anchor"),P.source.endsWith(":")&&s(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=P,w??(w=P.offset),d=!1,f=!1,A=!0;break;case"tag":{_&&s(P,"MULTIPLE_TAGS","A node can have at most one tag"),_=P,w??(w=P.offset),d=!1,f=!1,A=!0;break}case r:(E||_)&&s(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`),T&&s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${e??"collection"}`),T=P,d=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){b&&s(P,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=P,d=!1,f=!1;break}default:s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.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:b,found:T,spaceBefore:u,comment:h,hasNewline:g,anchor:E,tag:_,newlineAfterProp:v,end:x,start:w??x}}a(Wea,"resolveProps");Yii.resolveProps=Wea});var Nft=I(Kii=>{"use strict";p();function Lmr(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(Lmr(e.key)||Lmr(e.value))return!0}return!1;default:return!0}}a(Lmr,"containsNewline");Kii.containsNewline=Lmr});var Bmr=I(Jii=>{"use strict";p();var zea=Nft();function Yea(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&zea.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(Yea,"flowIndentCheck");Jii.flowIndentCheck=Yea});var Fmr=I(Xii=>{"use strict";p();var Zii=Za();function Kea(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||Zii.isScalar(s)&&Zii.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(Kea,"mapIncludes");Xii.mapIncludes=Kea});var ooi=I(ioi=>{"use strict";p();var eoi=$H(),Jea=WH(),toi=hMe(),Zea=Nft(),roi=Bmr(),Xea=Fmr(),noi="All mapping items must start at the same column";function eta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??Jea.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=toi.resolveProps(h,{indicator:"explicit-key-ind",next:m??g?.[0],offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0}),E=!y.found;if(E){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",noi)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` -`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||Zea.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",noi);r.atKey=!0;let _=y.end,v=m?t(r,m,y,o):e(r,_,h,null,y,o);r.schema.compat&&roi.flowIndentCheck(n.indent,m,o),r.atKey=!1,Xea.mapIncludes(r,l.items,v)&&o(_,"DUPLICATE_KEY","Map keys must be unique");let b=toi.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=b.end,b.found){E&&(A?.type==="block-map"&&!b.hasNewline&&o(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&y.start{"use strict";p();var tta=zH(),rta=hMe(),nta=Bmr();function ita({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??tta.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=rta.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&&nta.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a(ita,"resolveBlockSeq");soi.resolveBlockSeq=ita});var jme=I(coi=>{"use strict";p();function ota(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(ota,"resolveEnd");coi.resolveEnd=ota});var foi=I(doi=>{"use strict";p();var sta=Za(),ata=$H(),loi=WH(),cta=zH(),lta=jme(),uoi=hMe(),uta=Nft(),dta=Fmr(),Umr="Block collections are not allowed within flow collections",Qmr=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function fta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?loi.YAMLMap:cta.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 E=0;E0){let E=lta.resolveEnd(A,y,r.options.strict,o);E.comment&&(d.comment?d.comment+=` -`+E.comment:d.comment=E.comment),d.range=[n.offset,y,E.offset]}else d.range=[n.offset,y,y];return d}a(fta,"resolveFlowCollection");doi.resolveFlowCollection=fta});var hoi=I(poi=>{"use strict";p();var pta=Za(),hta=mm(),mta=WH(),gta=zH(),Ata=ooi(),yta=aoi(),Eta=foi();function qmr(t,e,r,n,o,s){let c=r.type==="block-map"?Ata.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?yta.resolveBlockSeq(t,e,r,n,s):Eta.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(qmr,"resolveCollection");function _ta(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),qmr(t,e,r,o,c)}let d=qmr(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=pta.isNode(f)?f:new hta.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(_ta,"composeCollection");poi.composeCollection=_ta});var Hmr=I(moi=>{"use strict";p();var jmr=mm();function vta(t,e,r){let n=e.offset,o=Cta(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?jmr.Scalar.BLOCK_FOLDED:jmr.Scalar.BLOCK_LITERAL,c=e.source?bta(e.source):[],l=c.length;for(let y=c.length-1;y>=0;--y){let E=c[y][1];if(E===""||E==="\r")l=y;else break}if(l===0){let y=o.chomp==="+"&&c.length>0?` +`}},"prettifyError");hMe.YAMLError=pMe;hMe.YAMLParseError=Omr;hMe.YAMLWarning=Lmr;hMe.prettifyError=Zea});var gMe=I(Xii=>{"use strict";p();function Xea(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,E=null,_=null,v=null,b=null,T=null,w=null;for(let P of t)switch(A&&(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma"&&s(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A=!1),y&&(d&&P.type!=="comment"&&P.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),P.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&P.source.includes(" ")&&(y=P),f=!0;break;case"comment":{f||s(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=P.source.substring(1)||" ";h?h+=m+D:h=D,m="",d=!1;break}case"newline":d?h?h+=P.source:(!T||r!=="seq-item-ind")&&(u=!0):m+=P.source,d=!0,g=!0,(E||_)&&(v=P),f=!0;break;case"anchor":E&&s(P,"MULTIPLE_ANCHORS","A node can have at most one anchor"),P.source.endsWith(":")&&s(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=P,w??(w=P.offset),d=!1,f=!1,A=!0;break;case"tag":{_&&s(P,"MULTIPLE_TAGS","A node can have at most one tag"),_=P,w??(w=P.offset),d=!1,f=!1,A=!0;break}case r:(E||_)&&s(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`),T&&s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${e??"collection"}`),T=P,d=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){b&&s(P,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=P,d=!1,f=!1;break}default:s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.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:b,found:T,spaceBefore:u,comment:h,hasNewline:g,anchor:E,tag:_,newlineAfterProp:v,end:x,start:w??x}}a(Xea,"resolveProps");Xii.resolveProps=Xea});var Mft=I(eoi=>{"use strict";p();function Bmr(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(Bmr(e.key)||Bmr(e.value))return!0}return!1;default:return!0}}a(Bmr,"containsNewline");eoi.containsNewline=Bmr});var Fmr=I(toi=>{"use strict";p();var eta=Mft();function tta(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&eta.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(tta,"flowIndentCheck");toi.flowIndentCheck=tta});var Umr=I(noi=>{"use strict";p();var roi=Za();function rta(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||roi.isScalar(s)&&roi.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(rta,"mapIncludes");noi.mapIncludes=rta});var loi=I(coi=>{"use strict";p();var ioi=VH(),nta=zH(),ooi=gMe(),ita=Mft(),soi=Fmr(),ota=Umr(),aoi="All mapping items must start at the same column";function sta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??nta.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=ooi.resolveProps(h,{indicator:"explicit-key-ind",next:m??g?.[0],offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0}),E=!y.found;if(E){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",aoi)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` +`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||ita.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",aoi);r.atKey=!0;let _=y.end,v=m?t(r,m,y,o):e(r,_,h,null,y,o);r.schema.compat&&soi.flowIndentCheck(n.indent,m,o),r.atKey=!1,ota.mapIncludes(r,l.items,v)&&o(_,"DUPLICATE_KEY","Map keys must be unique");let b=ooi.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=b.end,b.found){E&&(A?.type==="block-map"&&!b.hasNewline&&o(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&y.start{"use strict";p();var ata=YH(),cta=gMe(),lta=Fmr();function uta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??ata.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=cta.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&<a.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a(uta,"resolveBlockSeq");uoi.resolveBlockSeq=uta});var Hme=I(foi=>{"use strict";p();function dta(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(dta,"resolveEnd");foi.resolveEnd=dta});var goi=I(moi=>{"use strict";p();var fta=Za(),pta=VH(),poi=zH(),hta=YH(),mta=Hme(),hoi=gMe(),gta=Mft(),Ata=Umr(),Qmr="Block collections are not allowed within flow collections",qmr=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function yta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?poi.YAMLMap:hta.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 E=0;E0){let E=mta.resolveEnd(A,y,r.options.strict,o);E.comment&&(d.comment?d.comment+=` +`+E.comment:d.comment=E.comment),d.range=[n.offset,y,E.offset]}else d.range=[n.offset,y,y];return d}a(yta,"resolveFlowCollection");moi.resolveFlowCollection=yta});var yoi=I(Aoi=>{"use strict";p();var Eta=Za(),_ta=mm(),vta=zH(),Cta=YH(),bta=loi(),Sta=doi(),Tta=goi();function jmr(t,e,r,n,o,s){let c=r.type==="block-map"?bta.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?Sta.resolveBlockSeq(t,e,r,n,s):Tta.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(jmr,"resolveCollection");function Ita(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),jmr(t,e,r,o,c)}let d=jmr(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=Eta.isNode(f)?f:new _ta.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(Ita,"composeCollection");Aoi.composeCollection=Ita});var Gmr=I(Eoi=>{"use strict";p();var Hmr=mm();function xta(t,e,r){let n=e.offset,o=wta(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?Hmr.Scalar.BLOCK_FOLDED:Hmr.Scalar.BLOCK_LITERAL,c=e.source?Rta(e.source):[],l=c.length;for(let y=c.length-1;y>=0;--y){let E=c[y][1];if(E===""||E==="\r")l=y;else break}if(l===0){let y=o.chomp==="+"&&c.length>0?` `.repeat(Math.max(1,c.length-1)):"",E=n+o.length;return e.source&&(E+=e.source.length),{value:y,type:s,comment:o.comment,range:[n,E,E]}}let u=e.indent+o.indent,d=e.offset+o.length,f=0;for(let y=0;yu&&(u=E.length);else{E.length=l;--y)c[y][0].length>u&&(l=y+1);let h="",m="",g=!1;for(let y=0;yu||_[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(vta,"resolveBlockScalar");function Cta({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 Gmr=mm(),Sta=jme();function Tta(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=Gmr.Scalar.PLAIN,u=Ita(s,d);break;case"single-quoted-scalar":l=Gmr.Scalar.QUOTE_SINGLE,u=xta(s,d);break;case"double-quoted-scalar":l=Gmr.Scalar.QUOTE_DOUBLE,u=wta(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=Sta.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(Tta,"resolveFlowScalar");function Ita(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}`),goi(t)}a(Ita,"plainValue");function xta(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),goi(t.slice(1,-1)).replace(/''/g,"'")}a(xta,"singleQuotedValue");function goi(t){let e,r;try{e=new RegExp(`(.*?)(?{"use strict";p();var $mr=mm(),kta=Hme();function Pta(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=$mr.Scalar.PLAIN,u=Dta(s,d);break;case"single-quoted-scalar":l=$mr.Scalar.QUOTE_SINGLE,u=Nta(s,d);break;case"double-quoted-scalar":l=$mr.Scalar.QUOTE_DOUBLE,u=Mta(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=kta.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(Pta,"resolveFlowScalar");function Dta(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}`),_oi(t)}a(Dta,"plainValue");function Nta(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),_oi(t.slice(1,-1)).replace(/''/g,"'")}a(Nta,"singleQuotedValue");function _oi(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(wta,"doubleQuotedValue");function Rta(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(Mta,"doubleQuotedValue");function Ota(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(Rta,"foldNewline");var kta={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Pta(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(Pta,"parseCharCode");Aoi.resolveFlowScalar=Tta});var _oi=I(Eoi=>{"use strict";p();var Eee=Za(),yoi=mm(),Dta=Hmr(),Nta=$mr();function Mta(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?Dta.resolveBlockScalar(t,e,n):Nta.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[Eee.SCALAR]:u?d=Ota(t.schema,o,u,r,n):e.type==="scalar"?d=Lta(t,o,e,n):d=t.schema[Eee.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=Eee.isScalar(h)?h:new yoi.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new yoi.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(Mta,"composeScalar");function Ota(t,e,r,n,o){if(r==="!")return t[Eee.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[Eee.SCALAR])}a(Ota,"findScalarTagByName");function Lta({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[Eee.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[Eee.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(Lta,"findScalarTagByTest");Eoi.composeScalar=Mta});var Coi=I(voi=>{"use strict";p();function Bta(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(Bta,"emptyScalarPosition");voi.emptyScalarPosition=Bta});var Toi=I(Wmr=>{"use strict";p();var Fta=WNe(),Uta=Za(),Qta=hoi(),boi=_oi(),qta=jme(),jta=Coi(),Hta={composeNode:Soi,composeEmptyNode:Vmr};function Soi(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=Gta(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=boi.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=Qta.composeCollection(Hta,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=Vmr(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&&(!Uta.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(Soi,"composeNode");function Vmr(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:jta.emptyScalarPosition(e,r,n),indent:-1,source:""},h=boi.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(Vmr,"composeEmptyNode");function Gta({options:t},{offset:e,source:r,end:n},o){let s=new Fta.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=qta.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(Gta,"composeAlias");Wmr.composeEmptyNode=Vmr;Wmr.composeNode=Soi});var woi=I(xoi=>{"use strict";p();var $ta=uMe(),Ioi=Toi(),Vta=jme(),Wta=hMe();function zta(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new $ta.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=Wta.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?Ioi.composeNode(d,o,f,c):Ioi.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=Vta.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(zta,"composeDoc");xoi.composeDoc=zta});var Ymr=I(Poi=>{"use strict";p();var Yta=require("process"),Kta=Mhr(),Jta=uMe(),mMe=pMe(),Roi=Za(),Zta=woi(),Xta=jme();function gMe(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(gMe,"getErrorPos");function koi(t){let e="",r=!1,n=!1;for(let o=0;o{"use strict";p();var Eee=Za(),Coi=mm(),Fta=Gmr(),Uta=Vmr();function Qta(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?Fta.resolveBlockScalar(t,e,n):Uta.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[Eee.SCALAR]:u?d=qta(t.schema,o,u,r,n):e.type==="scalar"?d=jta(t,o,e,n):d=t.schema[Eee.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=Eee.isScalar(h)?h:new Coi.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new Coi.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(Qta,"composeScalar");function qta(t,e,r,n,o){if(r==="!")return t[Eee.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[Eee.SCALAR])}a(qta,"findScalarTagByName");function jta({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[Eee.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[Eee.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(jta,"findScalarTagByTest");boi.composeScalar=Qta});var Ioi=I(Toi=>{"use strict";p();function Hta(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(Hta,"emptyScalarPosition");Toi.emptyScalarPosition=Hta});var Roi=I(zmr=>{"use strict";p();var Gta=YNe(),$ta=Za(),Vta=yoi(),xoi=Soi(),Wta=Hme(),zta=Ioi(),Yta={composeNode:woi,composeEmptyNode:Wmr};function woi(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=Kta(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=xoi.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=Vta.composeCollection(Yta,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=Wmr(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&&(!$ta.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(woi,"composeNode");function Wmr(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:zta.emptyScalarPosition(e,r,n),indent:-1,source:""},h=xoi.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(Wmr,"composeEmptyNode");function Kta({options:t},{offset:e,source:r,end:n},o){let s=new Gta.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=Wta.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(Kta,"composeAlias");zmr.composeEmptyNode=Wmr;zmr.composeNode=woi});var Doi=I(Poi=>{"use strict";p();var Jta=fMe(),koi=Roi(),Zta=Hme(),Xta=gMe();function era(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new Jta.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=Xta.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?koi.composeNode(d,o,f,c):koi.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=Zta.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(era,"composeDoc");Poi.composeDoc=era});var Kmr=I(Ooi=>{"use strict";p();var tra=require("process"),rra=Ohr(),nra=fMe(),AMe=mMe(),Noi=Za(),ira=Doi(),ora=Hme();function yMe(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(yMe,"getErrorPos");function Moi(t){let e="",r=!1,n=!1;for(let o=0;o{let c=gMe(r);s?this.warnings.push(new mMe.YAMLWarning(c,n,o)):this.errors.push(new mMe.YAMLParseError(c,n,o))},this.directives=new Kta.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=koi(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(Roi.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];Roi.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(Moi,"parsePrelude");var Ymr=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=yMe(r);s?this.warnings.push(new AMe.YAMLWarning(c,n,o)):this.errors.push(new AMe.YAMLParseError(c,n,o))},this.directives=new rra.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=Moi(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(Noi.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];Noi.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:koi(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(Yta.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=gMe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Zta.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 mMe.YAMLParseError(gMe(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 mMe.YAMLParseError(gMe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Xta.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 mMe.YAMLParseError(gMe(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 Jta.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}}};Poi.Composer=zmr});var Moi=I(Mft=>{"use strict";p();var era=Hmr(),tra=$mr(),rra=pMe(),Doi=ZNe();function nra(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 rra.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return tra.resolveFlowScalar(t,e,n);case"block-scalar":return era.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(nra,"resolveAsScalar");function ira(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=Doi.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:Moi(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(tra.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=yMe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=ira.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 AMe.YAMLParseError(yMe(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 AMe.YAMLParseError(yMe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=ora.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 AMe.YAMLParseError(yMe(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 nra.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}}};Ooi.Composer=Ymr});var Foi=I(Oft=>{"use strict";p();var sra=Gmr(),ara=Vmr(),cra=mMe(),Loi=eMe();function lra(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 cra.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ara.resolveFlowScalar(t,e,n);case"block-scalar":return sra.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(lra,"resolveAsScalar");function ura(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=Loi.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 Noi(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(ira,"createScalarToken");function ora(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=Doi.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">":sra(t,u);break;case'"':Kmr(t,u,"double-quoted-scalar");break;case"'":Kmr(t,u,"single-quoted-scalar");break;default:Kmr(t,u,"scalar")}}a(ora,"setScalarValue");function sra(t,e){let r=e.indexOf(` +`,m=[{type:"block-scalar-header",offset:s,indent:n,source:f}];return Boi(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(ura,"createScalarToken");function dra(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=Loi.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">":fra(t,u);break;case'"':Jmr(t,u,"double-quoted-scalar");break;case"'":Jmr(t,u,"single-quoted-scalar");break;default:Jmr(t,u,"scalar")}}a(dra,"setScalarValue");function fra(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}];Noi(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(sra,"setBlockScalarValue");function Noi(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(Noi,"addEndtoBlockProps");function Kmr(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(Kmr,"setFlowScalarValue");Mft.createScalarToken=ira;Mft.resolveAsScalar=nra;Mft.setScalarValue=ora});var Loi=I(Ooi=>{"use strict";p();var ara=a(t=>"type"in t?Lft(t):Oft(t),"stringify");function Lft(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Lft(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Oft(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Oft(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Oft(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(Lft,"stringifyToken");function Oft({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=Lft(e)),r)for(let s of r)o+=s.source;return n&&(o+=Lft(n)),o}a(Oft,"stringifyItem");Ooi.stringify=ara});var Qoi=I(Uoi=>{"use strict";p();var Jmr=Symbol("break visit"),cra=Symbol("skip children"),Boi=Symbol("remove item");function _ee(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Foi(Object.freeze([]),t,e)}a(_ee,"visit");_ee.BREAK=Jmr;_ee.SKIP=cra;_ee.REMOVE=Boi;_ee.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};_ee.parentCollection=(t,e)=>{let r=_ee.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 Foi(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 Zmr=Moi(),lra=Loi(),ura=Qoi(),Xmr="\uFEFF",e0r="",t0r="",r0r="",dra=a(t=>!!t&&"items"in t,"isCollection"),fra=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function pra(t){switch(t){case Xmr:return"";case e0r:return"";case t0r:return"";case r0r:return"";default:return JSON.stringify(t)}}a(pra,"prettyToken");function hra(t){switch(t){case Xmr:return"byte-order-mark";case e0r:return"doc-mode";case t0r:return"flow-error-end";case r0r: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}];Boi(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(fra,"setBlockScalarValue");function Boi(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(Boi,"addEndtoBlockProps");function Jmr(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(Jmr,"setFlowScalarValue");Oft.createScalarToken=ura;Oft.resolveAsScalar=lra;Oft.setScalarValue=dra});var Qoi=I(Uoi=>{"use strict";p();var pra=a(t=>"type"in t?Bft(t):Lft(t),"stringify");function Bft(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Bft(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Lft(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Lft(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Lft(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(Bft,"stringifyToken");function Lft({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=Bft(e)),r)for(let s of r)o+=s.source;return n&&(o+=Bft(n)),o}a(Lft,"stringifyItem");Uoi.stringify=pra});var Goi=I(Hoi=>{"use strict";p();var Zmr=Symbol("break visit"),hra=Symbol("skip children"),qoi=Symbol("remove item");function _ee(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),joi(Object.freeze([]),t,e)}a(_ee,"visit");_ee.BREAK=Zmr;_ee.SKIP=hra;_ee.REMOVE=qoi;_ee.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};_ee.parentCollection=(t,e)=>{let r=_ee.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 joi(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 Xmr=Foi(),mra=Qoi(),gra=Goi(),e0r="\uFEFF",t0r="",r0r="",n0r="",Ara=a(t=>!!t&&"items"in t,"isCollection"),yra=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function Era(t){switch(t){case e0r:return"";case t0r:return"";case r0r:return"";case n0r:return"";default:return JSON.stringify(t)}}a(Era,"prettyToken");function _ra(t){switch(t){case e0r:return"byte-order-mark";case t0r:return"doc-mode";case r0r:return"flow-error-end";case n0r: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(hra,"tokenType");Bb.createScalarToken=Zmr.createScalarToken;Bb.resolveAsScalar=Zmr.resolveAsScalar;Bb.setScalarValue=Zmr.setScalarValue;Bb.stringify=lra.stringify;Bb.visit=ura.visit;Bb.BOM=Xmr;Bb.DOCUMENT=e0r;Bb.FLOW_END=t0r;Bb.SCALAR=r0r;Bb.isCollection=dra;Bb.isScalar=fra;Bb.prettyToken=pra;Bb.tokenType=hra});var o0r=I(joi=>{"use strict";p();var AMe=Bft();function Z2(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}a(Z2,"isEmpty");var qoi=new Set("0123456789ABCDEFabcdef"),mra=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Fft=new Set(",[]{}"),gra=new Set(` ,[]{} -\r `),n0r=a(t=>!t||gra.has(t),"isNotAnchorChar"),i0r=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(_ra,"tokenType");Bb.createScalarToken=Xmr.createScalarToken;Bb.resolveAsScalar=Xmr.resolveAsScalar;Bb.setScalarValue=Xmr.setScalarValue;Bb.stringify=mra.stringify;Bb.visit=gra.visit;Bb.BOM=e0r;Bb.DOCUMENT=t0r;Bb.FLOW_END=r0r;Bb.SCALAR=n0r;Bb.isCollection=Ara;Bb.isScalar=yra;Bb.prettyToken=Era;Bb.tokenType=_ra});var s0r=I(Voi=>{"use strict";p();var EMe=Fft();function X2(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}a(X2,"isEmpty");var $oi=new Set("0123456789ABCDEFabcdef"),vra=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Uft=new Set(",[]{}"),Cra=new Set(` ,[]{} +\r `),i0r=a(t=>!t||Cra.has(t),"isNotAnchorChar"),o0r=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==="...")&&Z2(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Z2(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===":")&&Z2(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(n0r),"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=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&X2(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!X2(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===":")&&X2(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(i0r),"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=>Z2(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` +`,s)}o!==-1&&(r=o-(n[o-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>X2(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 AMe.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(Z2(s)||e&&Fft.has(s))break;r=n}else if(Z2(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 EMe.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(X2(s)||e&&Uft.has(s))break;r=n}else if(X2(o)){let s=this.buffer[n+1];if(o==="\r"&&(s===` `?(n+=1,o=` -`,s=this.buffer[n+1]):r=n),s==="#"||e&&Fft.has(s))break;if(o===` -`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&Fft.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield AMe.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(n0r))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(Z2(r)||e&&Fft.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(;!Z2(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(mra.has(r))r=this.buffer[++e];else if(r==="%"&&qoi.has(this.buffer[e+1])&&qoi.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&&Uft.has(s))break;if(o===` +`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&Uft.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield EMe.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(i0r))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(X2(r)||e&&Uft.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(;!X2(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(vra.has(r))r=this.buffer[++e];else if(r==="%"&&$oi.has(this.buffer[e+1])&&$oi.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)}};joi.Lexer=i0r});var a0r=I(Hoi=>{"use strict";p();var s0r=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 Ara=require("process"),Goi=Bft(),yra=o0r();function YH(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(Hme,"getFirstKeyStartProps");function Voi(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!YH(e.start,"explicit-key-ind")&&!YH(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Woi(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(Voi,"fixFlowSeqItems");var c0r=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 yra.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,Ara.env.LOG_TOKENS&&console.log("|",Goi.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=Goi.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"&&Voi(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&&$oi(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)}};Voi.Lexer=o0r});var c0r=I(Woi=>{"use strict";p();var a0r=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 bra=require("process"),zoi=Fft(),Sra=s0r();function KH(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(Gme,"getFirstKeyStartProps");function Koi(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!KH(e.start,"explicit-key-ind")&&!KH(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Joi(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(Koi,"fixFlowSeqItems");var l0r=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 Sra.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,bra.env.LOG_TOKENS&&console.log("|",zoi.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=zoi.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"&&Koi(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&&Yoi(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(YH(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(Woi(r.key)&&!YH(r.sep,"newline")){let c=Hme(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(YH(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=Hme(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]}):YH(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&&!YH(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||YH(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=Uft(n),s=Hme(o);Voi(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(KH(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(Joi(r.key)&&!KH(r.sep,"newline")){let c=Gme(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(KH(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=Gme(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]}):KH(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&&!KH(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||KH(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=Qft(n),s=Gme(o);Koi(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=Uft(e),n=Hme(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=Uft(e),n=Hme(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())}}};zoi.Parser=c0r});var Xoi=I(EMe=>{"use strict";p();var Yoi=Ymr(),Era=uMe(),yMe=pMe(),_ra=Whr(),vra=Za(),Cra=a0r(),Koi=l0r();function Joi(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Cra.LineCounter||null,prettyErrors:e}}a(Joi,"parseOptions");function bra(t,e={}){let{lineCounter:r,prettyErrors:n}=Joi(e),o=new Koi.Parser(r?.addNewLine),s=new Yoi.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(yMe.prettifyError(t,r)),l.warnings.forEach(yMe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(bra,"parseAllDocuments");function Zoi(t,e={}){let{lineCounter:r,prettyErrors:n}=Joi(e),o=new Koi.Parser(r?.addNewLine),s=new Yoi.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 yMe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(yMe.prettifyError(t,r)),c.warnings.forEach(yMe.prettifyError(t,r))),c}a(Zoi,"parseDocument");function Sra(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=Zoi(t,r);if(!o)return null;if(o.warnings.forEach(s=>_ra.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(Sra,"parse");function Tra(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 vra.isDocument(t)&&!n?t.toString(r):new Era.Document(t,n,r).toString(r)}a(Tra,"stringify");EMe.parse=Sra;EMe.parseAllDocuments=bra;EMe.parseDocument=Zoi;EMe.stringify=Tra});var tsi=I(Hc=>{"use strict";p();var Ira=Ymr(),xra=uMe(),wra=Rmr(),u0r=pMe(),Rra=WNe(),KH=Za(),kra=$H(),Pra=mm(),Dra=WH(),Nra=zH(),Mra=Bft(),Ora=o0r(),Lra=a0r(),Bra=l0r(),Qft=Xoi(),esi=HNe();Hc.Composer=Ira.Composer;Hc.Document=xra.Document;Hc.Schema=wra.Schema;Hc.YAMLError=u0r.YAMLError;Hc.YAMLParseError=u0r.YAMLParseError;Hc.YAMLWarning=u0r.YAMLWarning;Hc.Alias=Rra.Alias;Hc.isAlias=KH.isAlias;Hc.isCollection=KH.isCollection;Hc.isDocument=KH.isDocument;Hc.isMap=KH.isMap;Hc.isNode=KH.isNode;Hc.isPair=KH.isPair;Hc.isScalar=KH.isScalar;Hc.isSeq=KH.isSeq;Hc.Pair=kra.Pair;Hc.Scalar=Pra.Scalar;Hc.YAMLMap=Dra.YAMLMap;Hc.YAMLSeq=Nra.YAMLSeq;Hc.CST=Mra;Hc.Lexer=Ora.Lexer;Hc.LineCounter=Lra.LineCounter;Hc.Parser=Bra.Parser;Hc.parse=Qft.parse;Hc.parseAllDocuments=Qft.parseAllDocuments;Hc.parseDocument=Qft.parseDocument;Hc.stringify=Qft.stringify;Hc.visit=esi.visit;Hc.visitAsync=esi.visitAsync});var rsi=I(qft=>{"use strict";p();Object.defineProperty(qft,"__esModule",{value:!0});qft.FetchCancellationError=void 0;var Fra=Rs(),d0r=class extends Fra.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};qft.FetchCancellationError=d0r});var Gs=I(JH=>{"use strict";p();Object.defineProperty(JH,"__esModule",{value:!0});JH.IInstantiationService=JH._util=void 0;JH.createDecorator=nsi;JH.refineServiceDecorator=Qra;var R8;(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})(R8||(JH._util=R8={}));JH.IInstantiationService=nsi("instantiationService");function Ura(t,e,r){e[R8.DI_TARGET]===e?e[R8.DI_DEPENDENCIES].push({id:t,index:r}):(e[R8.DI_DEPENDENCIES]=[{id:t,index:r}],e[R8.DI_TARGET]=e)}a(Ura,"storeServiceDependency");function nsi(t){if(R8.serviceIds.has(t))return R8.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");Ura(e,r,o)},"id");return e.toString=()=>t,R8.serviceIds.set(t,e),e}a(nsi,"createDecorator");function Qra(t){return t}a(Qra,"refineServiceDecorator")});var Hft=I(jft=>{"use strict";p();Object.defineProperty(jft,"__esModule",{value:!0});jft.SyncDescriptor=void 0;var f0r=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};jft.SyncDescriptor=f0r});var isi=I(Gme=>{"use strict";p();Object.defineProperty(Gme,"__esModule",{value:!0});Gme.Graph=Gme.Node=void 0;var Gft=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};Gme.Node=Gft;var p0r=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 Gft(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=Qft(e),n=Gme(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=Qft(e),n=Gme(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())}}};Zoi.Parser=l0r});var nsi=I(vMe=>{"use strict";p();var Xoi=Kmr(),Tra=fMe(),_Me=mMe(),Ira=zhr(),xra=Za(),wra=c0r(),esi=u0r();function tsi(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new wra.LineCounter||null,prettyErrors:e}}a(tsi,"parseOptions");function Rra(t,e={}){let{lineCounter:r,prettyErrors:n}=tsi(e),o=new esi.Parser(r?.addNewLine),s=new Xoi.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(_Me.prettifyError(t,r)),l.warnings.forEach(_Me.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(Rra,"parseAllDocuments");function rsi(t,e={}){let{lineCounter:r,prettyErrors:n}=tsi(e),o=new esi.Parser(r?.addNewLine),s=new Xoi.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 _Me.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(_Me.prettifyError(t,r)),c.warnings.forEach(_Me.prettifyError(t,r))),c}a(rsi,"parseDocument");function kra(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=rsi(t,r);if(!o)return null;if(o.warnings.forEach(s=>Ira.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(kra,"parse");function Pra(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 xra.isDocument(t)&&!n?t.toString(r):new Tra.Document(t,n,r).toString(r)}a(Pra,"stringify");vMe.parse=kra;vMe.parseAllDocuments=Rra;vMe.parseDocument=rsi;vMe.stringify=Pra});var osi=I(Hc=>{"use strict";p();var Dra=Kmr(),Nra=fMe(),Mra=kmr(),d0r=mMe(),Ora=YNe(),JH=Za(),Lra=VH(),Bra=mm(),Fra=zH(),Ura=YH(),Qra=Fft(),qra=s0r(),jra=c0r(),Hra=u0r(),qft=nsi(),isi=$Ne();Hc.Composer=Dra.Composer;Hc.Document=Nra.Document;Hc.Schema=Mra.Schema;Hc.YAMLError=d0r.YAMLError;Hc.YAMLParseError=d0r.YAMLParseError;Hc.YAMLWarning=d0r.YAMLWarning;Hc.Alias=Ora.Alias;Hc.isAlias=JH.isAlias;Hc.isCollection=JH.isCollection;Hc.isDocument=JH.isDocument;Hc.isMap=JH.isMap;Hc.isNode=JH.isNode;Hc.isPair=JH.isPair;Hc.isScalar=JH.isScalar;Hc.isSeq=JH.isSeq;Hc.Pair=Lra.Pair;Hc.Scalar=Bra.Scalar;Hc.YAMLMap=Fra.YAMLMap;Hc.YAMLSeq=Ura.YAMLSeq;Hc.CST=Qra;Hc.Lexer=qra.Lexer;Hc.LineCounter=jra.LineCounter;Hc.Parser=Hra.Parser;Hc.parse=qft.parse;Hc.parseAllDocuments=qft.parseAllDocuments;Hc.parseDocument=qft.parseDocument;Hc.stringify=qft.stringify;Hc.visit=isi.visit;Hc.visitAsync=isi.visitAsync});var ssi=I(jft=>{"use strict";p();Object.defineProperty(jft,"__esModule",{value:!0});jft.FetchCancellationError=void 0;var Gra=Rs(),f0r=class extends Gra.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};jft.FetchCancellationError=f0r});var Gs=I(ZH=>{"use strict";p();Object.defineProperty(ZH,"__esModule",{value:!0});ZH.IInstantiationService=ZH._util=void 0;ZH.createDecorator=asi;ZH.refineServiceDecorator=Vra;var k8;(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})(k8||(ZH._util=k8={}));ZH.IInstantiationService=asi("instantiationService");function $ra(t,e,r){e[k8.DI_TARGET]===e?e[k8.DI_DEPENDENCIES].push({id:t,index:r}):(e[k8.DI_DEPENDENCIES]=[{id:t,index:r}],e[k8.DI_TARGET]=e)}a($ra,"storeServiceDependency");function asi(t){if(k8.serviceIds.has(t))return k8.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");$ra(e,r,o)},"id");return e.toString=()=>t,k8.serviceIds.set(t,e),e}a(asi,"createDecorator");function Vra(t){return t}a(Vra,"refineServiceDecorator")});var Gft=I(Hft=>{"use strict";p();Object.defineProperty(Hft,"__esModule",{value:!0});Hft.SyncDescriptor=void 0;var p0r=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};Hft.SyncDescriptor=p0r});var csi=I($me=>{"use strict";p();Object.defineProperty($me,"__esModule",{value:!0});$me.Graph=$me.Node=void 0;var $ft=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};$me.Node=$ft;var h0r=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 $ft(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)}}};Gme.Graph=p0r});var m0r=I($ft=>{"use strict";p();Object.defineProperty($ft,"__esModule",{value:!0});$ft.ServiceCollection=void 0;var h0r=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)}};$ft.ServiceCollection=h0r});var ssi=I(Wme=>{"use strict";p();Object.defineProperty(Wme,"__esModule",{value:!0});Wme.Trace=Wme.InstantiationService=void 0;var qra=nl(),jra=Rs(),g0r=Ro(),$me=Hft(),osi=isi(),A0r=Gs(),Hra=m0r(),Gra=vue(),$ra=!1,Vft=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()}`}},y0r=class t{static{a(this,"InstantiationService")}constructor(e=new Hra.ServiceCollection,r=!1,n,o=$ra){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(A0r.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new osi.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,g0r.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,g0r.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=Vme.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,jra.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 $me.SyncDescriptor?(n=Vme.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=Vme.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=A0r._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 $me.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 $me.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 osi.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 Vft(o);for(let d of A0r._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 $me.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 Vft(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof $me.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 $me.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 qra.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 Gra.LinkedList,u.set(h,A)),a((E,_,v)=>{if(d.isInitialized)return d.value[h](E,_,v);{let b={listener:[E,_,v],disposable:void 0},T=A.push(b);return(0,g0r.toDisposable)(()=>{T(),b.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)}};Wme.InstantiationService=y0r;var Vme=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)}}};$me.Graph=h0r});var g0r=I(Vft=>{"use strict";p();Object.defineProperty(Vft,"__esModule",{value:!0});Vft.ServiceCollection=void 0;var m0r=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)}};Vft.ServiceCollection=m0r});var usi=I(zme=>{"use strict";p();Object.defineProperty(zme,"__esModule",{value:!0});zme.Trace=zme.InstantiationService=void 0;var Wra=nl(),zra=Rs(),A0r=ko(),Vme=Gft(),lsi=csi(),y0r=Gs(),Yra=g0r(),Kra=vue(),Jra=!1,Wft=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()}`}},E0r=class t{static{a(this,"InstantiationService")}constructor(e=new Yra.ServiceCollection,r=!1,n,o=Jra){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(y0r.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new lsi.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,A0r.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,A0r.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=Wme.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,zra.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 Vme.SyncDescriptor?(n=Wme.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=Wme.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=y0r._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 Vme.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 Vme.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 lsi.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 Wft(o);for(let d of y0r._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 Vme.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 Wft(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof Vme.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 Vme.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 Wra.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 Kra.LinkedList,u.set(h,A)),a((E,_,v)=>{if(d.isInitialized)return d.value[h](E,_,v);{let b={listener:[E,_,v],disposable:void 0},T=A.push(b);return(0,A0r.toDisposable)(()=>{T(),b.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)}};zme.InstantiationService=E0r;var Wme=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(` -`))}};Wme.Trace=Vme});var nn=I(zme=>{"use strict";p();Object.defineProperty(zme,"__esModule",{value:!0});zme.InstantiationServiceBuilder=zme.createServiceIdentifier=void 0;var Vra=Gs();Object.defineProperty(zme,"createServiceIdentifier",{enumerable:!0,get:a(function(){return Vra.createDecorator},"get")});var Wra=ssi(),asi=m0r(),E0r=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new asi.ServiceCollection(...e):e??new asi.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 Wra.InstantiationService(this._collection,!0)}};zme.InstantiationServiceBuilder=E0r});var _Me=I(uR=>{"use strict";p();Object.defineProperty(uR,"__esModule",{value:!0});uR.NullLanguageContextService=uR.TriggerKind=uR.KnownSources=uR.ContextKind=uR.ILanguageContextService=void 0;var zra=nn();uR.ILanguageContextService=(0,zra.createServiceIdentifier)("ILanguageContextService");var csi;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(csi||(uR.ContextKind=csi={}));var lsi;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(lsi||(uR.KnownSources=lsi={}));var usi;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(usi||(uR.TriggerKind=usi={}));var _0r=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};uR.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new _0r,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var fsi=I(Wft=>{"use strict";p();Object.defineProperty(Wft,"__esModule",{value:!0});Wft.serializeLanguageContext=Kra;Wft.serializeFileDiagnostics=tna;var Yra=eh(),v0r=_Me();function Kra(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:Jra(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(Kra,"serializeLanguageContext");function Jra(t){switch(t.kind){case v0r.ContextKind.Snippet:return Zra(t);case v0r.ContextKind.Trait:return Xra(t);case v0r.ContextKind.DiagnosticBag:return ena(t)}}a(Jra,"serializeLanguageContextItem");function Zra(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(Zra,"serializeSnippetContext");function Xra(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(Xra,"serializeTraitContext");function ena(t){let e=t.values.map(r=>dsi(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(ena,"serializeDiagnosticBagContext");function dsi(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 Yra.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(dsi,"serializeDiagnostic");function tna(t){return t.flatMap(([e,r])=>r.map(n=>dsi(n,e)))}a(tna,"serializeFileDiagnostics")});var b0r=I(C0r=>{"use strict";p();Object.defineProperty(C0r,"__esModule",{value:!0});C0r.stringifyChatMessages=rna;var zft=Io();function rna(t){return t.map(nna).join(` -`)}a(rna,"stringifyChatMessages");function nna({role:t,content:e}){if(t!==zft.Raw.ChatRole.User&&t!==zft.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===zft.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==zft.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} +`))}};zme.Trace=Wme});var nn=I(Yme=>{"use strict";p();Object.defineProperty(Yme,"__esModule",{value:!0});Yme.InstantiationServiceBuilder=Yme.createServiceIdentifier=void 0;var Zra=Gs();Object.defineProperty(Yme,"createServiceIdentifier",{enumerable:!0,get:a(function(){return Zra.createDecorator},"get")});var Xra=usi(),dsi=g0r(),_0r=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new dsi.ServiceCollection(...e):e??new dsi.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 Xra.InstantiationService(this._collection,!0)}};Yme.InstantiationServiceBuilder=_0r});var CMe=I(dR=>{"use strict";p();Object.defineProperty(dR,"__esModule",{value:!0});dR.NullLanguageContextService=dR.TriggerKind=dR.KnownSources=dR.ContextKind=dR.ILanguageContextService=void 0;var ena=nn();dR.ILanguageContextService=(0,ena.createServiceIdentifier)("ILanguageContextService");var fsi;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(fsi||(dR.ContextKind=fsi={}));var psi;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(psi||(dR.KnownSources=psi={}));var hsi;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(hsi||(dR.TriggerKind=hsi={}));var v0r=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};dR.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new v0r,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var gsi=I(zft=>{"use strict";p();Object.defineProperty(zft,"__esModule",{value:!0});zft.serializeLanguageContext=rna;zft.serializeFileDiagnostics=ana;var tna=eh(),C0r=CMe();function rna(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:nna(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(rna,"serializeLanguageContext");function nna(t){switch(t.kind){case C0r.ContextKind.Snippet:return ina(t);case C0r.ContextKind.Trait:return ona(t);case C0r.ContextKind.DiagnosticBag:return sna(t)}}a(nna,"serializeLanguageContextItem");function ina(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(ina,"serializeSnippetContext");function ona(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(ona,"serializeTraitContext");function sna(t){let e=t.values.map(r=>msi(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(sna,"serializeDiagnosticBagContext");function msi(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 tna.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(msi,"serializeDiagnostic");function ana(t){return t.flatMap(([e,r])=>r.map(n=>msi(n,e)))}a(ana,"serializeFileDiagnostics")});var S0r=I(b0r=>{"use strict";p();Object.defineProperty(b0r,"__esModule",{value:!0});b0r.stringifyChatMessages=cna;var Yft=xo();function cna(t){return t.map(lna).join(` +`)}a(cna,"stringifyChatMessages");function lna({role:t,content:e}){if(t!==Yft.Raw.ChatRole.User&&t!==Yft.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===Yft.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==Yft.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} ------ ${n.text} -==================`}a(nna,"stringifyMessage")});var T0r=I(Yft=>{"use strict";p();Object.defineProperty(Yft,"__esModule",{value:!0});Yft.register=ona;Yft.getCodiconFontCharacters=sna;var ina=KS(),S0r=Object.create(null);function ona(t,e){if((0,ina.isString)(e)){let r=S0r[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return S0r[t]=e,{id:t}}a(ona,"register");function sna(){return S0r}a(sna,"getCodiconFontCharacters")});var psi=I(Kft=>{"use strict";p();Object.defineProperty(Kft,"__esModule",{value:!0});Kft.codiconsLibrary=void 0;var $=T0r();Kft.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 I0r=I(k8=>{"use strict";p();Object.defineProperty(k8,"__esModule",{value:!0});k8.Codicon=k8.codiconsDerived=void 0;k8.getAllCodicons=cna;var Gc=T0r(),ana=psi();function cna(){return Object.values(k8.Codicon)}a(cna,"getAllCodicons");k8.codiconsDerived={dialogError:(0,Gc.register)("dialog-error","error"),dialogWarning:(0,Gc.register)("dialog-warning","warning"),dialogInfo:(0,Gc.register)("dialog-info","info"),dialogClose:(0,Gc.register)("dialog-close","close"),treeItemExpanded:(0,Gc.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,Gc.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,Gc.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,Gc.register)("tree-filter-clear","close"),treeItemLoading:(0,Gc.register)("tree-item-loading","loading"),menuSelection:(0,Gc.register)("menu-selection","check"),menuSubmenu:(0,Gc.register)("menu-submenu","chevron-right"),menuBarMore:(0,Gc.register)("menubar-more","more"),scrollbarButtonLeft:(0,Gc.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,Gc.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,Gc.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,Gc.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,Gc.register)("toolbar-more","more"),quickInputBack:(0,Gc.register)("quick-input-back","arrow-left"),dropDownButton:(0,Gc.register)("drop-down-button",60084),symbolCustomColor:(0,Gc.register)("symbol-customcolor",60252),exportIcon:(0,Gc.register)("export",60332),workspaceUnspecified:(0,Gc.register)("workspace-unspecified",60355),newLine:(0,Gc.register)("newline",60394),thumbsDownFilled:(0,Gc.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,Gc.register)("thumbsup-filled",60436),gitFetch:(0,Gc.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,Gc.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,Gc.register)("debug-breakpoint-pending",60377),chatImport:(0,Gc.register)("chat-import",60550),chatExport:(0,Gc.register)("chat-export",60551)};k8.Codicon={...ana.codiconsLibrary,...k8.codiconsDerived}});var R0r=I(vee=>{"use strict";p();Object.defineProperty(vee,"__esModule",{value:!0});vee.ThemeIcon=vee.ThemeColor=void 0;vee.themeColorFromId=lna;var x0r=I0r(),w0r;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(w0r||(vee.ThemeColor=w0r={}));function lna(t){return{id:t}}a(lna,"themeColorFromId");var hsi;(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(x0r.Codicon.error);let[,E,_]=y,v=["codicon","codicon-"+E];return _&&v.push("codicon-modifier-"+_.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"||w0r.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[,E]=y;return{id:E}}a(l,"fromString"),t.fromString=l;function u(A){return{id:A}}a(u,"fromId"),t.fromId=u;function d(A,y){let E=A.id,_=E.lastIndexOf("~");return _!==-1&&(E=E.substring(0,_)),y&&(E=`${E}~${y}`),{id:E}}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===x0r.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===x0r.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(hsi||(vee.ThemeIcon=hsi={}))});var vMe=I(ZH=>{"use strict";p();Object.defineProperty(ZH,"__esModule",{value:!0});ZH.Icon=void 0;ZH.overrideNowValue=una;ZH.now=dna;ZH.shortenOpportunityId=fna;ZH.checkIfCursorAtEndOfLine=pna;var P8=R0r(),k0r=-1;function una(t){k0r=t}a(una,"overrideNowValue");function dna(){return k0r!==-1?k0r:Date.now()}a(dna,"now");var msi;(function(t){t.circleSlash={themeIcon:P8.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:P8.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:P8.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:P8.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:P8.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:P8.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:P8.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:P8.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:P8.ThemeIcon.fromId("thumbsdown"),svg:''}})(msi||(ZH.Icon=msi={}));function fna(t){return t.substring(4,8)}a(fna,"shortenOpportunityId");function pna(t,e){return t.substring(e).match(/^\s*$/)!==null}a(pna,"checkIfCursorAtEndOfLine")});var Zft=I(_4=>{"use strict";p();var hna=_4&&_4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mna=_4&&_4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gna=_4&&_4.__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(Kft,"__esModule",{value:!0});Kft.register=dna;Kft.getCodiconFontCharacters=fna;var una=ZS(),T0r=Object.create(null);function dna(t,e){if((0,una.isString)(e)){let r=T0r[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return T0r[t]=e,{id:t}}a(dna,"register");function fna(){return T0r}a(fna,"getCodiconFontCharacters")});var Asi=I(Jft=>{"use strict";p();Object.defineProperty(Jft,"__esModule",{value:!0});Jft.codiconsLibrary=void 0;var $=I0r();Jft.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 x0r=I(P8=>{"use strict";p();Object.defineProperty(P8,"__esModule",{value:!0});P8.Codicon=P8.codiconsDerived=void 0;P8.getAllCodicons=hna;var Gc=I0r(),pna=Asi();function hna(){return Object.values(P8.Codicon)}a(hna,"getAllCodicons");P8.codiconsDerived={dialogError:(0,Gc.register)("dialog-error","error"),dialogWarning:(0,Gc.register)("dialog-warning","warning"),dialogInfo:(0,Gc.register)("dialog-info","info"),dialogClose:(0,Gc.register)("dialog-close","close"),treeItemExpanded:(0,Gc.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,Gc.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,Gc.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,Gc.register)("tree-filter-clear","close"),treeItemLoading:(0,Gc.register)("tree-item-loading","loading"),menuSelection:(0,Gc.register)("menu-selection","check"),menuSubmenu:(0,Gc.register)("menu-submenu","chevron-right"),menuBarMore:(0,Gc.register)("menubar-more","more"),scrollbarButtonLeft:(0,Gc.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,Gc.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,Gc.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,Gc.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,Gc.register)("toolbar-more","more"),quickInputBack:(0,Gc.register)("quick-input-back","arrow-left"),dropDownButton:(0,Gc.register)("drop-down-button",60084),symbolCustomColor:(0,Gc.register)("symbol-customcolor",60252),exportIcon:(0,Gc.register)("export",60332),workspaceUnspecified:(0,Gc.register)("workspace-unspecified",60355),newLine:(0,Gc.register)("newline",60394),thumbsDownFilled:(0,Gc.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,Gc.register)("thumbsup-filled",60436),gitFetch:(0,Gc.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,Gc.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,Gc.register)("debug-breakpoint-pending",60377),chatImport:(0,Gc.register)("chat-import",60550),chatExport:(0,Gc.register)("chat-export",60551)};P8.Codicon={...pna.codiconsLibrary,...P8.codiconsDerived}});var k0r=I(vee=>{"use strict";p();Object.defineProperty(vee,"__esModule",{value:!0});vee.ThemeIcon=vee.ThemeColor=void 0;vee.themeColorFromId=mna;var w0r=x0r(),R0r;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(R0r||(vee.ThemeColor=R0r={}));function mna(t){return{id:t}}a(mna,"themeColorFromId");var ysi;(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(w0r.Codicon.error);let[,E,_]=y,v=["codicon","codicon-"+E];return _&&v.push("codicon-modifier-"+_.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"||R0r.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[,E]=y;return{id:E}}a(l,"fromString"),t.fromString=l;function u(A){return{id:A}}a(u,"fromId"),t.fromId=u;function d(A,y){let E=A.id,_=E.lastIndexOf("~");return _!==-1&&(E=E.substring(0,_)),y&&(E=`${E}~${y}`),{id:E}}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===w0r.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===w0r.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(ysi||(vee.ThemeIcon=ysi={}))});var bMe=I(XH=>{"use strict";p();Object.defineProperty(XH,"__esModule",{value:!0});XH.Icon=void 0;XH.overrideNowValue=gna;XH.now=Ana;XH.shortenOpportunityId=yna;XH.checkIfCursorAtEndOfLine=Ena;var D8=k0r(),P0r=-1;function gna(t){P0r=t}a(gna,"overrideNowValue");function Ana(){return P0r!==-1?P0r:Date.now()}a(Ana,"now");var Esi;(function(t){t.circleSlash={themeIcon:D8.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:D8.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:D8.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:D8.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:D8.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:D8.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:D8.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:D8.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:D8.ThemeIcon.fromId("thumbsdown"),svg:''}})(Esi||(XH.Icon=Esi={}));function yna(t){return t.substring(4,8)}a(yna,"shortenOpportunityId");function Ena(t,e){return t.substring(e).match(/^\s*$/)!==null}a(Ena,"checkIfCursorAtEndOfLine")});var Xft=I(_4=>{"use strict";p();var _na=_4&&_4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vna=_4&&_4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Cna=_4&&_4.__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(` -`)}return this.error&&(e.push(`## Error ${r}`),e.push("```"),e.push(Jft.ErrorUtils.toString(Jft.ErrorUtils.fromUnknown(this.error))),e.push("```")),this.response&&(e.push(`## Response ${r}`),e.push(`
Click to view +`)}return this.error&&(e.push(`## Error ${r}`),e.push("```"),e.push(Zft.ErrorUtils.toString(Zft.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(gsi.stringify(this._responseResults,null," ")),e.push("```"),e.push(` +`),e.push("```"),e.push(_si.stringify(this._responseResults,null," ")),e.push("```"),e.push(`
`)),this._isAccepted!==void 0&&e.push(`## Accepted : ${this._isAccepted?"Yes":"No"}`),this._rebaseFailure&&(e.push("## Rebase Failure"),e.push(`
Click to view `),e.push(this._rebaseFailure.toMarkdown()),e.push(` @@ -526,8 +526,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(Jft.ErrorUtils.toString(Jft.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.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.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,vna.stringifyChatMessages)(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!=="pending"&&this._outcome!=="reusedInFlight"&&console.warn(`[InlineEditRequestLogContext] outcome transition from '${this._outcome}' to '${e}' (request #${this.requestId})`),this._outcome=e}_resolveIcon(){switch(this._outcome){case"pending":return this._isCompleted?PE.Icon.check:PE.Icon.loading;case"succeeded":return PE.Icon.lightbulbFull;case"noSuggestions":return PE.Icon.circleSlash;case"cached":case"cachedFromGhostText":return PE.Icon.database;case"reusedInFlight":return PE.Icon.gitMerge;case"skipped":case"cancelled":return PE.Icon.skipped;case"errored":return PE.Icon.error;case"previouslyRejected":return PE.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._outcome="previouslyRejected",this._isVisible=!0,this.fireDidChange()}get error(){return this._error}setError(e){this._isVisible=!0,this._error=e,this._error instanceof Ena.FetchCancellationError?this._setOutcome("skipped"):(0,Ana.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 | ${Cna(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(Zft.ErrorUtils.toString(Zft.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.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.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,xna.stringifyChatMessages)(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!=="pending"&&this._outcome!=="reusedInFlight"&&console.warn(`[InlineEditRequestLogContext] outcome transition from '${this._outcome}' to '${e}' (request #${this.requestId})`),this._outcome=e}_resolveIcon(){switch(this._outcome){case"pending":return this._isCompleted?PE.Icon.check:PE.Icon.loading;case"succeeded":return PE.Icon.lightbulbFull;case"noSuggestions":return PE.Icon.circleSlash;case"cached":case"cachedFromGhostText":return PE.Icon.database;case"reusedInFlight":return PE.Icon.gitMerge;case"skipped":case"cancelled":return PE.Icon.skipped;case"errored":return PE.Icon.error;case"previouslyRejected":return PE.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._outcome="previouslyRejected",this._isVisible=!0,this.fireDidChange()}get error(){return this._error}setError(e){this._isVisible=!0,this._error=e,this._error instanceof Tna.FetchCancellationError?this._setOutcome("skipped"):(0,bna.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 | ${wna(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 E=A.trim();return{timestamp:h,segments:g,message:E}});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 E=0;Ethis.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:gsi.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,_na.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};_4.InlineEditRequestLogContext=P0r;function Cna(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(Cna,"basename")});var Asi=I(Xft=>{"use strict";p();Object.defineProperty(Xft,"__esModule",{value:!0});Xft.GhostTextLogContext=void 0;var bna=Zft(),Sna=NA(),D0r=class extends bna.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,Sna.basename)(this.filePath)} (v${this.version})`}};Xft.GhostTextLogContext=D0r});var XH=I(Yme=>{"use strict";p();Object.defineProperty(Yme,"__esModule",{value:!0});Yme.CopilotTokenStore=Yme.ICopilotTokenStore=void 0;var Tna=nn(),Ina=Ic(),xna=Ro();Yme.ICopilotTokenStore=(0,Tna.createServiceIdentifier)("ICopilotTokenStore");var N0r=class extends xna.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new Ina.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()}};Yme.CopilotTokenStore=N0r});var gm=I(sy=>{"use strict";p();var wna=sy&&sy.__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},Rna=sy&&sy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(sy,"__esModule",{value:!0});sy.TelemetryTrustedValue=sy.ITelemetryService=sy.TelemetryUserConfigImpl=sy.ITelemetryUserConfig=void 0;sy.createTrackingIdGetter=Pna;sy.multiplexProperties=Nna;var ysi=nn(),kna=XH();sy.ITelemetryUserConfig=(0,ysi.createServiceIdentifier)("ITelemetryUserConfig");var M0r=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)}};sy.TelemetryUserConfigImpl=M0r;sy.TelemetryUserConfigImpl=M0r=wna([Rna(2,kna.ICopilotTokenStore)],M0r);function Pna(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(Pna,"createTrackingIdGetter");sy.ITelemetryService=(0,ysi.createServiceIdentifier)("ITelemetryService");var O0r=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};sy.TelemetryTrustedValue=O0r;var CMe=8192,Dna=50;function Nna(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>CMe){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+CMe;o{"use strict";p();var Mna=jo&&jo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ona=jo&&jo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Lna=jo&&jo.__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)&&Mna(e,t,r);return Ona(e,t),e},L0r=jo&&jo.__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())})},B0r=jo&&jo.__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 Q0r=bee&&bee.__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())})},q0r=bee&&bee.__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,v4.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 Q0r(this,void 0,void 0,function(){var r,n,o;return q0r(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,v4.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=Cee.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,v4.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 v4.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return Q0r(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return q0r(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,v4.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return Cee.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 bsi=Csi(),Gna="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",$na="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",Vna=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{Wna.exports={}});var tpt=I(Kme=>{"use strict";p();var zna=Kme&&Kme.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kme,"__esModule",{value:!0});Kme.JsonConfig=void 0;var Yna=require("fs"),ept=require("path"),j0r=Kl(),Kna=zna(Tsi()),Jna="APPLICATIONINSIGHTS_CONFIGURATION_FILE",Zna="APPLICATIONINSIGHTS_CONNECTION_STRING",Isi="APPSETTING_",xsi="APPINSIGHTS_INSTRUMENTATIONKEY",wsi="APPINSIGHTS_INSTRUMENTATION_KEY",Xna="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",eia="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",tia="http_proxy",ria="https_proxy",nia="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",iia="APPLICATION_INSIGHTS_NO_STATSBEAT",oia="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",sia="APPLICATION_INSIGHTS_NO_PATCH_MODULES",aia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",cia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",lia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",uia="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",dia="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",fia=(function(){function t(){this.connectionString=process.env[Zna],this.instrumentationKey=process.env[xsi]||process.env[Isi+xsi]||process.env[wsi]||process.env[Isi+wsi],!this.connectionString&&this.instrumentationKey&&j0r.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[eia],this.extendedMetricDisablers=process.env[Xna],this.proxyHttpUrl=process.env[tia],this.proxyHttpsUrl=process.env[ria],this.noDiagnosticChannel=!!process.env[nia],this.disableStatsbeat=!!process.env[iia],this.noHttpAgentKeepAlive=!!process.env[oia],this.noPatchModules=process.env[sia]||"",this.enableWebInstrumentation=!!process.env[aia]||!!process.env[uia],this.webInstrumentationSrc=process.env[lia]||"",this.webInstrumentationConnectionString=process.env[cia]||process.env[dia]||"",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=ept.join(__dirname,"../../");this._tempDir=ept.join(o,n);var s=process.env[Jna];if(s){ept.isAbsolute(s)?this._tempDir=s:this._tempDir=ept.join(o,s);try{e=Yna.readFileSync(this._tempDir,"utf8")}catch(l){j0r.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(Kna.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){j0r.warn("Invalid JSON config file: ",l)}},t})();Kme.JsonConfig=fia});var H0r=I(rpt=>{"use strict";p();Object.defineProperty(rpt,"__esModule",{value:!0});rpt.makePatchingRequire=void 0;var pia=require("path"),hia=AP(),Rsi=Cp(),Psi=require("module"),mia=Object.keys(process.binding("natives")),ksi=Psi.prototype.require;function gia(t){var e={};return a(function(n){var o=ksi.apply(this,arguments);if(t[n]){var s=Psi._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(mia.indexOf(n)<0)try{c=ksi.call(this,pia.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{Aia.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 Cp=I(dR=>{"use strict";p();Object.defineProperty(dR,"__esModule",{value:!0});dR.channel=dR.ContextPreservingEventEmitter=dR.trueFilter=dR.makePatchingRequire=void 0;var yia=H0r(),Eia=H0r();Object.defineProperty(dR,"makePatchingRequire",{enumerable:!0,get:a(function(){return Eia.makePatchingRequire},"get")});var _ia=a(function(t){return!0},"trueFilter");dR.trueFilter=_ia;var Msi=(function(){function t(){this.version=Dsi().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=dR.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=dR.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();co();G0r=_b("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(Jme,"suppressTracing");a(Osi,"unsuppressTracing");a(eG,"isTracingSuppressed")});var Lsi,npt,Zme,ipt,Bsi,Fsi,Usi,$0r=ve(()=>{p();Lsi="=",npt=";",Zme=",",ipt="baggage",Bsi=180,Fsi=4096,Usi=8192});function opt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?Zme:"")+r;return n.length>Usi?e:n},"")}function spt(t){return t.getAllEntries().map(function(e){var r=via(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=npt+o.metadata.toString()),s})}function SMe(t){var e=t.split(npt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(Lsi);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Hpe(e.join(npt))),{key:o,value:s,metadata:c}}}}}function Qsi(t){return typeof t!="string"||t.length===0?{}:t.split(Zme).map(function(e){return SMe(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var via,V0r=ve(()=>{p();co();$0r();via=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(opt,"serializeKeyPairs");a(spt,"getKeyPairs");a(SMe,"parsePairKeyValue");a(Qsi,"parseKeyPairsIntoRecord")});var apt,qsi=ve(()=>{p();co();bMe();$0r();V0r();apt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=kT.getBaggage(e);if(!(!o||eG(e))){var s=spt(o).filter(function(l){return l.length<=Fsi}).slice(0,Bsi),c=opt(s);c.length>0&&n.set(r,ipt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,ipt),s=Array.isArray(o)?o.join(Zme):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(Zme);return l.forEach(function(u){var d=SMe(u);if(d){var f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0?e:kT.setBaggage(e,kT.createBaggage(c))},t.prototype.fields=function(){return[ipt]},t})()});var jsi,Hsi=ve(()=>{p();jsi=(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 tG(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=Gsi(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=Cia(s.value,2),l=c[0],u=c[1];if(!W0r(l)){Dn.warn("Invalid attribute key: "+l);continue}if(!TMe(u)){Dn.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 W0r(t){return typeof t=="string"&&t.length>0}function TMe(t){return t==null?!0:Array.isArray(t)?bia(t):$si(t)}function bia(t){var e,r,n;try{for(var o=Gsi(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if($si(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 $si(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var Gsi,Cia,Vsi=ve(()=>{p();co();Gsi=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.")},Cia=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(tG,"sanitizeAttributes");a(W0r,"isAttributeKey");a(TMe,"isAttributeValue");a(bia,"isHomogeneousAttributeValueArray");a($si,"isValidPrimitiveAttributeValue")});function cpt(){return function(t){Dn.error(Sia(t))}}function Sia(t){return typeof t=="string"?t:JSON.stringify(Tia(t))}function Tia(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 z0r=ve(()=>{p();co();a(cpt,"loggingErrorHandler");a(Sia,"stringifyException");a(Tia,"flattenException")});function zsi(t){Wsi=t}function Ev(t){try{Wsi(t)}catch{}}var Wsi,Y0r=ve(()=>{p();z0r();Wsi=cpt();a(zsi,"setGlobalErrorHandler");a(Ev,"globalErrorHandler")});var Fb,K0r=ve(()=>{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"})(Fb||(Fb={}))});function wia(t){return xia.indexOf(t)>-1}function kia(t){return Ria.indexOf(t)>-1}function Dia(t){return Pia.indexOf(t)>-1}function Nia(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function Mia(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 Oia(t,e,r,n){n===void 0&&(n=Iia);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function Bia(t,e,r){var n=r[t];if(typeof n=="string"){var o=Lia[n.toUpperCase()];o!=null&&(e[t]=o)}}function xMe(t){var e={};for(var r in IMe){var n=r;switch(n){case"OTEL_LOG_LEVEL":Bia(n,e,t);break;default:if(wia(n))Nia(n,e,t);else if(kia(n))Mia(n,e,t);else if(Dia(n))Oia(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var Iia,xia,Ria,Pia,See,Tee,J0r,Z0r,IMe,Lia,X0r=ve(()=>{p();co();K0r();Iia=",",xia=["OTEL_SDK_DISABLED"];a(wia,"isEnvVarABoolean");Ria=["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(kia,"isEnvVarANumber");Pia=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(Dia,"isEnvVarAList");See=1/0,Tee=128,J0r=128,Z0r=128,IMe={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:Da.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:See,OTEL_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:See,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:See,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:J0r,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:Z0r,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Fb.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(Nia,"parseBoolean");a(Mia,"parseNumber");a(Oia,"parseStringList");Lia={ALL:Da.ALL,VERBOSE:Da.VERBOSE,DEBUG:Da.DEBUG,INFO:Da.INFO,WARN:Da.WARN,ERROR:Da.ERROR,NONE:Da.NONE};a(Bia,"setLogLevelFromEnv");a(xMe,"parseEnvironment")});function fR(){var t=xMe(process.env);return Object.assign({},IMe,t)}function Xme(){return xMe(process.env)}var Ysi=ve(()=>{p();X0r();a(fR,"getEnv");a(Xme,"getEnvWithoutDefaults")});var lpt,Ksi=ve(()=>{p();lpt=typeof globalThis=="object"?globalThis:global});function Jsi(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function upt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(Jsi,"intValue");a(upt,"hexToBinary")});function dpt(t){return Buffer.from(upt(t)).toString("base64")}var Zsi=ve(()=>{p();egr();a(dpt,"hexToBase64")});function Xsi(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(fpt[t-1]=1);return fpt.toString("hex",0,t)},"generateId")}var Fia,eai,ppt,fpt,tai=ve(()=>{p();Fia=8,eai=16,ppt=(function(){function t(){this.generateTraceId=Xsi(eai),this.generateSpanId=Xsi(Fia)}return a(t,"RandomIdGenerator"),t})(),fpt=Buffer.allocUnsafe(eai);a(Xsi,"getIdGenerator")});var rai,pR,nai=ve(()=>{p();rai=require("perf_hooks"),pR=rai.performance});var hpt,tgr=ve(()=>{p();hpt="1.30.1"});var iai=ve(()=>{p()});var oai=ve(()=>{p();iai()});var Uia,Qia,qia,jia,sai,aai,cai,lai,Hia,uai,dai=ve(()=>{p();Uia="process.runtime.name",Qia="telemetry.sdk.name",qia="telemetry.sdk.language",jia="telemetry.sdk.version",sai=Uia,aai=Qia,cai=qia,lai=jia,Hia="nodejs",uai=Hia});var fai=ve(()=>{p();dai()});var pai=ve(()=>{p()});var hai=ve(()=>{p()});var mai=ve(()=>{p();oai();fai();pai();hai()});var e0e,rG,gai=ve(()=>{p();tgr();mai();rG=(e0e={},e0e[aai]="opentelemetry",e0e[sai]="node",e0e[cai]=uai,e0e[lai]=hpt,e0e)});function t0e(t){t.unref()}var Aai=ve(()=>{p();a(t0e,"unrefTimer")});var yai=ve(()=>{p();Ysi();Ksi();Zsi();tai();nai();gai();Aai()});var rgr=ve(()=>{p();yai()});function eD(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*$ia);return[r,n]}function r0e(){var t=pR.timeOrigin;if(typeof t!="number"){var e=pR;t=e.timing&&e.timing.fetchStart}return t}function wMe(t){var e=eD(r0e()),r=eD(typeof t=="number"?t:pR.now());return PMe(e,r)}function _ai(t){if(n0e(t))return t;if(typeof t=="number")return t=mpt&&(r[1]-=mpt,r[0]+=1),r}var Eai,Gia,$ia,mpt,Sai=ve(()=>{p();rgr();Eai=9,Gia=6,$ia=Math.pow(10,Gia),mpt=Math.pow(10,Eai);a(eD,"millisToHrTime");a(r0e,"getTimeOrigin");a(wMe,"hrTime");a(_ai,"timeInputToHrTime");a(gpt,"hrTimeDuration");a(vai,"hrTimeToTimeStamp");a(Cai,"hrTimeToNanoseconds");a(bai,"hrTimeToMilliseconds");a(RMe,"hrTimeToMicroseconds");a(n0e,"isTimeInputHrTime");a(kMe,"isTimeInput");a(PMe,"addHrTimes")});var GT,Tai=ve(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(GT||(GT={}))});var Via,Apt,Iai=ve(()=>{p();co();Via=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.")},Apt=(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=Via(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){Dn.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){Dn.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function xai(t){return Yia.test(t)}function wai(t){return Kia.test(t)&&!Jia.test(t)}var ngr,Wia,zia,Yia,Kia,Jia,Rai=ve(()=>{p();ngr="[_0-9a-z-*/]",Wia="[a-z]"+ngr+"{0,255}",zia="[a-z0-9]"+ngr+"{0,240}@[a-z]"+ngr+"{0,13}",Yia=new RegExp("^(?:"+Wia+"|"+zia+")$"),Kia=/^[ -~]{0,255}[!-~]$/,Jia=/,|=/;a(xai,"validateKey");a(wai,"validateValue")});var kai,Zia,Pai,Dai,ypt,igr=ve(()=>{p();Rai();kai=32,Zia=512,Pai=",",Dai="=",ypt=(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+Dai+e.get(n)),r},[]).join(Pai)},t.prototype._parse=function(e){e.length>Zia||(this._internalState=e.split(Pai).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(Dai);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);xai(c)&&wai(l)&&r.set(c,l)}return r},new Map),this._internalState.size>kai&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,kai))))},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 ogr(t){var e=ioa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var DMe,NMe,Xia,eoa,toa,roa,noa,ioa,Ept,Nai=ve(()=>{p();co();bMe();igr();DMe="traceparent",NMe="tracestate",Xia="00",eoa="(?!ff)[\\da-f]{2}",toa="(?![0]{32})[\\da-f]{32}",roa="(?![0]{16})[\\da-f]{16}",noa="[\\da-f]{2}",ioa=new RegExp("^\\s?("+eoa+")-("+toa+")-("+roa+")-("+noa+")(-.*)?\\s?$");a(ogr,"parseTraceParent");Ept=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=wu.getSpanContext(e);if(!(!o||eG(e)||!vb(o))){var s=Xia+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||wf.NONE).toString(16);n.set(r,DMe,s),o.traceState&&n.set(r,NMe,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,DMe);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=ogr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,NMe);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new ypt(typeof u=="string"?u:void 0)}return wu.setSpanContext(e,c)},t.prototype.fields=function(){return[DMe,NMe]},t})()});function Mai(t,e){return t.setValue(sgr,e)}function Oai(t){return t.deleteValue(sgr)}function Lai(t){return t.getValue(sgr)}var sgr,_pt,Bai=ve(()=>{p();co();sgr=_b("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(_pt||(_pt={}));a(Mai,"setRPCMetadata");a(Oai,"deleteRPCMetadata");a(Lai,"getRPCMetadata")});var MMe,agr=ve(()=>{p();co();MMe=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:Cb.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var i0e,cgr=ve(()=>{p();co();i0e=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:Cb.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var Fai,Uai=ve(()=>{p();co();Y0r();agr();cgr();Fai=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(Ev(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new i0e),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new i0e,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new MMe,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new i0e,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new MMe}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=wu.getSpanContext(e);return!l||!vb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&wf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&wf.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 Qai,qai=ve(()=>{p();co();Qai=(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:aX(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 doa(t,e){return function(r){return t(e(r))}}function lgr(t){if(!foa(t)||poa(t)!==ooa)return!1;var e=uoa(t);if(e===null)return!0;var r=Gai.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&jai.call(r)===loa}function foa(t){return t!=null&&typeof t=="object"}function poa(t){return t==null?t===void 0?aoa:soa:Iee&&Iee in Object(t)?hoa(t):moa(t)}function hoa(t){var e=Gai.call(t,Iee),r=t[Iee],n=!1;try{t[Iee]=void 0,n=!0}catch{}var o=$ai.call(t);return n&&(e?t[Iee]=r:delete t[Iee]),o}function moa(t){return $ai.call(t)}var ooa,soa,aoa,coa,jai,loa,uoa,Hai,Gai,Iee,$ai,Vai=ve(()=>{p();ooa="[object Object]",soa="[object Null]",aoa="[object Undefined]",coa=Function.prototype,jai=coa.toString,loa=jai.call(Object),uoa=doa(Object.getPrototypeOf,Object),Hai=Object.prototype,Gai=Hai.hasOwnProperty,Iee=Symbol?Symbol.toStringTag:void 0,$ai=Hai.toString;a(doa,"overArg");a(lgr,"isPlainObject");a(foa,"isObjectLike");a(poa,"baseGetTag");a(hoa,"getRawTag");a(moa,"objectToString")});function bpt(){for(var t=[],e=0;e0;)r=zai(r,t.shift(),0,n);return r}function ugr(t){return Cpt(t)?t.slice():t}function zai(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>goa)){if(r++,vpt(t)||vpt(e)||Yai(e))o=ugr(e);else if(Cpt(t)){if(o=t.slice(),Cpt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(Wai(t,u,n)||Wai(e,u,n))delete o[u];else{if(OMe(f)&&OMe(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]=zai(o[u],d,r,n)}}}}else o=e;return o}}function Wai(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 Aoa(t,e){return!(!lgr(t)||!lgr(e))}var goa,Kai=ve(()=>{p();Vai();goa=20;a(bpt,"merge");a(ugr,"takeValue");a(zai,"mergeTwoObjects");a(Wai,"wasObjectReferenced");a(Cpt,"isArray");a(Yai,"isFunction");a(OMe,"isObject");a(vpt,"isPrimitive");a(Aoa,"shouldMerge")});function Jai(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new dgr("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 yoa,dgr,Zai=ve(()=>{p();yoa=(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)}})(),dgr=(function(t){yoa(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(Jai,"callWithTimeout")});function fgr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function Xai(t,e){var r,n;if(!e)return!1;try{for(var o=Eoa(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(fgr(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 Eoa,eci=ve(()=>{p();Eoa=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(fgr,"urlMatches");a(Xai,"isUrlIgnored")});function tci(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var rci=ve(()=>{p();a(tci,"isWrapped")});var nci,ici=ve(()=>{p();nci=(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 _oa,voa,o0e,oci=ve(()=>{p();ici();_oa=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},voa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();bMe();a(sci,"_export")});var cci={};ki(cci,{AlwaysOffSampler:()=>MMe,AlwaysOnSampler:()=>i0e,AnchoredClock:()=>jsi,BindOnceFuture:()=>o0e,CompositePropagator:()=>Apt,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>Tee,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>See,DEFAULT_ENVIRONMENT:()=>IMe,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>J0r,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>Z0r,ExportResultCode:()=>GT,ParentBasedSampler:()=>Fai,RPCType:()=>_pt,RandomIdGenerator:()=>ppt,SDK_INFO:()=>rG,TRACE_PARENT_HEADER:()=>DMe,TRACE_STATE_HEADER:()=>NMe,TimeoutError:()=>dgr,TraceIdRatioBasedSampler:()=>Qai,TraceState:()=>ypt,TracesSamplerValues:()=>Fb,VERSION:()=>hpt,W3CBaggagePropagator:()=>apt,W3CTraceContextPropagator:()=>Ept,_globalThis:()=>lpt,addHrTimes:()=>PMe,baggageUtils:()=>Coa,callWithTimeout:()=>Jai,deleteRPCMetadata:()=>Oai,getEnv:()=>fR,getEnvWithoutDefaults:()=>Xme,getRPCMetadata:()=>Lai,getTimeOrigin:()=>r0e,globalErrorHandler:()=>Ev,hexToBase64:()=>dpt,hexToBinary:()=>upt,hrTime:()=>wMe,hrTimeDuration:()=>gpt,hrTimeToMicroseconds:()=>RMe,hrTimeToMilliseconds:()=>bai,hrTimeToNanoseconds:()=>Cai,hrTimeToTimeStamp:()=>vai,internal:()=>pgr,isAttributeKey:()=>W0r,isAttributeValue:()=>TMe,isTimeInput:()=>kMe,isTimeInputHrTime:()=>n0e,isTracingSuppressed:()=>eG,isUrlIgnored:()=>Xai,isWrapped:()=>tci,loggingErrorHandler:()=>cpt,merge:()=>bpt,millisToHrTime:()=>eD,otperformance:()=>pR,parseEnvironment:()=>xMe,parseTraceParent:()=>ogr,sanitizeAttributes:()=>tG,setGlobalErrorHandler:()=>zsi,setRPCMetadata:()=>Mai,suppressTracing:()=>Jme,timeInputToHrTime:()=>_ai,unrefTimer:()=>t0e,unsuppressTracing:()=>Osi,urlMatches:()=>fgr});var Coa,pgr,Ub=ve(()=>{p();qsi();Hsi();Vsi();Y0r();z0r();Sai();egr();Tai();V0r();rgr();Iai();Nai();Bai();agr();cgr();Uai();qai();bMe();igr();X0r();Kai();K0r();Zai();eci();rci();oci();tgr();aci();Coa={getKeyPairs:spt,serializeKeyPairs:opt,parseKeyPairsIntoRecord:Qsi,parsePairKeyValue:SMe},pgr={_export:sci}});var boa,Soa,Toa,Spt,Tpt,lci,uci=ve(()=>{p();boa="exception.type",Soa="exception.message",Toa="exception.stacktrace",Spt=boa,Tpt=Soa,lci=Toa});var dci=ve(()=>{p();uci()});var fci=ve(()=>{p()});var pci=ve(()=>{p();fci()});var hci=ve(()=>{p()});var mci=ve(()=>{p()});var gci=ve(()=>{p();dci();pci();hci();mci()});var Aci,yci=ve(()=>{p();Aci="exception"});var hgr,Ioa,Eci,xoa,Ipt,mgr=ve(()=>{p();co();Ub();gci();yci();hgr=function(){return hgr=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.")},Eci=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},xoa=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):(Dn.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=Ioa(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=Eci(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 Dn.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&Dn.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),kMe(r)&&(kMe(n)||(n=r),r=void 0);var o=tG(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,xoa([],Eci(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=hgr({},e),this.status.message!=null&&typeof e.message!="string"&&(Dn.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()){Dn.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=gpt(this.startTime,this.endTime),this._duration[0]<0&&(Dn.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&&Dn.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=pR.now())return wMe(e+this._performanceOffset);if(typeof e=="number")return eD(e);if(e instanceof Date)return eD(e.getTime());if(n0e(e))return e;if(this._startTimeProvided)return eD(Date.now());var r=pR.now()-this._performanceStartTime;return PMe(this.startTime,eD(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[Tpt]=e:e&&(e.code?n[Spt]=e.code.toString():e.name&&(n[Spt]=e.name),e.message&&(n[Tpt]=e.message),e.stack&&(n[lci]=e.stack)),n[Spt]||n[Tpt]?this.addEvent(Aci,n,r):Dn.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&&Dn.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?(Dn.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 tD,LMe=ve(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(tD||(tD={}))});var nG,xpt=ve(()=>{p();LMe();nG=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:tD.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var C4,wpt=ve(()=>{p();LMe();C4=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:tD.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var s0e,ggr=ve(()=>{p();co();Ub();xpt();wpt();s0e=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(Ev(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new C4),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new C4,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new nG,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new C4,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new nG}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=wu.getSpanContext(e);return!l||!vb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&wf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&wf.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 BMe,Agr=ve(()=>{p();co();LMe();BMe=(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:aX(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 Rpt(){var t=fR();return{sampler:ygr(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 ygr(t){switch(t===void 0&&(t=fR()),t.OTEL_TRACES_SAMPLER){case Fb.AlwaysOn:return new C4;case Fb.AlwaysOff:return new nG;case Fb.ParentBasedAlwaysOn:return new s0e({root:new C4});case Fb.ParentBasedAlwaysOff:return new s0e({root:new nG});case Fb.TraceIdRatio:return new BMe(_ci(t));case Fb.ParentBasedTraceIdRatio:return new s0e({root:new BMe(_ci(t))});default:return Dn.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+woa+'".'),new C4}}function _ci(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return Dn.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+a0e+"."),a0e;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+a0e+"."),a0e):e<0||e>1?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+a0e+"."),a0e):e}var woa,a0e,Egr=ve(()=>{p();co();Ub();xpt();wpt();ggr();Agr();woa=Fb.AlwaysOn,a0e=1;a(Rpt,"loadDefaultConfig");a(ygr,"buildSamplerFromEnv");a(_ci,"getSamplerProbabilityFromEnv")});function vci(t){var e={sampler:ygr()},r=Rpt(),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 Cci(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=Xme();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:Tee,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:See,Object.assign({},t,{spanLimits:g})}var _gr=ve(()=>{p();Egr();Ub();a(vci,"mergeConfig");a(Cci,"reconfigureLimits")});var bci,Sci=ve(()=>{p();co();Ub();bci=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=fR();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 o0e(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Dn.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&wf.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&&Dn.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Dn.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,Ev(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),t0e(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var Roa,c0e,Tci=ve(()=>{p();Sci();Roa=(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)}})(),c0e=(function(t){Roa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(bci)});function Ici(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(kpt[t-1]=1);return kpt.toString("hex",0,t)},"generateId")}var koa,xci,l0e,kpt,wci=ve(()=>{p();koa=8,xci=16,l0e=(function(){function t(){this.generateTraceId=Ici(xci),this.generateSpanId=Ici(koa)}return a(t,"RandomIdGenerator"),t})(),kpt=Buffer.allocUnsafe(xci);a(Ici,"getIdGenerator")});var Rci=ve(()=>{p();Tci();wci()});var Ppt=ve(()=>{p();Rci()});var Dpt,vgr=ve(()=>{p();co();Ub();mgr();_gr();Ppt();Dpt=(function(){function t(e,r,n){this._tracerProvider=n;var o=vci(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new l0e,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=Og.active()),r.root&&(n=wu.deleteSpan(n));var l=wu.getSpan(n);if(eG(n)){Dn.debug("Instrumentation suppressed, returning Noop Span");var u=wu.wrapSpanContext(Gpe);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!wu.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:$pe.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:tG(R.attributes)}}),E=tG(r.attributes),_=this._sampler.shouldSample(n,h,e,A,E,y);m=(c=_.traceState)!==null&&c!==void 0?c:m;var v=_.decision===Cb.RECORD_AND_SAMPLED?wf.SAMPLED:wf.NONE,b={traceId:h,spanId:f,traceFlags:v,traceState:m};if(_.decision===Cb.NOT_RECORD){Dn.debug("Recording is off, propagating context in a non-recording span");var u=wu.wrapSpanContext(b);return u}var T=tG(Object.assign(E,_.attributes)),w=new Ipt(this,n,e,b,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??Og.active(),d=this.startSpan(e,s,u),f=wu.setSpan(u,d);return Og.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 kci=ve(()=>{p()});var Pci=ve(()=>{p();kci()});var Poa,Doa,Noa,Moa,Dci,Cgr,bgr,Sgr,Nci=ve(()=>{p();Poa="service.name",Doa="telemetry.sdk.name",Noa="telemetry.sdk.language",Moa="telemetry.sdk.version",Dci=Poa,Cgr=Doa,bgr=Noa,Sgr=Moa});var Mci=ve(()=>{p();Nci()});var Oci=ve(()=>{p()});var Lci=ve(()=>{p()});var Bci=ve(()=>{p();Pci();Mci();Oci();Lci()});function Npt(){return"unknown_service:"+process.argv0}var Fci=ve(()=>{p();a(Npt,"defaultServiceName")});var Uci=ve(()=>{p();Fci()});var Qci=ve(()=>{p();Uci()});var iG,Ooa,Loa,Boa,Mpt,qci=ve(()=>{p();co();Bci();Ub();Qci();iG=function(){return iG=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},Mpt=(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 Dn.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[Dci]=Npt(),e[bgr]=rG[bgr],e[Cgr]=rG[Cgr],e[Sgr]=rG[Sgr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&Dn.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 Ooa(this,void 0,void 0,function(){return Loa(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=iG(iG({},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=Boa(c,2),d=u[0],f=u[1];return iG(iG(iG(iG({},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 jci=ve(()=>{p();qci()});var Opt,Tgr,Hci=ve(()=>{p();Ub();Opt=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.")},Tgr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=Opt(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){Ev(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=Opt(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=Opt(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=Opt(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 Lpt,Igr=ve(()=>{p();Lpt=(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 Foa,Uoa,N8,Gci,$ci=ve(()=>{p();co();Ub();jci();vgr();Egr();Hci();Igr();Ppt();_gr();Foa=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},Uoa=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(fR().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||Dn.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 Apt({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=fR().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||Dn.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new Ept}],["baggage",function(){return new apt}]]),t._registeredExporters=new Map,t})()});var Qoa,Vci,Wci=ve(()=>{p();Ub();Qoa=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.")},Vci=(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:RMe(e.startTime),duration:RMe(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=Qoa(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:GT.SUCCESS})},t})()});var qoa,joa,zci,Yci=ve(()=>{p();Ub();qoa=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},joa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();Ub();Hoa=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())})},Goa=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]nG,AlwaysOnSampler:()=>C4,BasicTracerProvider:()=>Gci,BatchSpanProcessor:()=>c0e,ConsoleSpanExporter:()=>Vci,ForceFlushState:()=>N8,InMemorySpanExporter:()=>zci,NoopSpanProcessor:()=>Lpt,ParentBasedSampler:()=>s0e,RandomIdGenerator:()=>l0e,SamplingDecision:()=>tD,SimpleSpanProcessor:()=>Kci,Span:()=>Ipt,TraceIdRatioBasedSampler:()=>BMe,Tracer:()=>Dpt});var Xci=ve(()=>{p();vgr();$ci();Ppt();Wci();Yci();Jci();Igr();xpt();wpt();ggr();Agr();LMe();mgr()});var FMe,eli,xgr=ve(()=>{p();FMe=class{static{a(this,"NoopLogger")}emit(e){}},eli=new FMe});var wgr,Bpt,Rgr=ve(()=>{p();xgr();wgr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new FMe}},Bpt=new wgr});var Fpt,tli=ve(()=>{p();xgr();Fpt=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):eli}}});var UMe,rli=ve(()=>{p();Rgr();tli();UMe=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new Fpt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Bpt}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 Upt,nli=ve(()=>{p();Upt=typeof globalThis=="object"?globalThis:global});var ili=ve(()=>{p();nli()});var oli=ve(()=>{p();ili()});function sli(t,e,r){return n=>n===t?e:r}var QMe,u0e,kgr,ali=ve(()=>{p();oli();QMe=Symbol.for("io.opentelemetry.js.api.logs"),u0e=Upt;a(sli,"makeGetter");kgr=1});var Qpt,cli=ve(()=>{p();ali();Rgr();rli();Qpt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new UMe}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return u0e[QMe]?this.getLoggerProvider():(u0e[QMe]=sli(kgr,e,Bpt),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=u0e[QMe])===null||e===void 0?void 0:e.call(u0e,kgr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete u0e[QMe],this._proxyLoggerProvider=new UMe}}});var qpt,Pgr=ve(()=>{p();cli();qpt=Qpt.getInstance()});function lli(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var dli=ve(()=>{p();a(lli,"enableInstrumentations");a(uli,"disableInstrumentations")});function fli(t){let e=t.tracerProvider||wu.getTracerProvider(),r=t.meterProvider||cX.getMeterProvider(),n=t.loggerProvider||qpt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return lli(o,e,r,n),()=>{uli(o)}}var pli=ve(()=>{p();co();Pgr();dli();a(fli,"registerInstrumentations")});function Eli(t,e,r){if(!Woa(t))return Dn.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=Joa(t);if(!n)return!1;let o=[],s=_li(n,e,o,r);return s&&!r?.includePrerelease?Yoa(n,o):s}function Woa(t){return typeof t=="string"&&yli.test(t)}function _li(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(Dgr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=ysa(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!Dgr(t,s,r,n))return!1;return!0}return Dgr(t,e,r,n)}function Dgr(t,e,r,n){if(e=Koa(e,n),e.includes(" "))return _li(t,e,r,n);{let o=Zoa(e);return r.push(o),zoa(t,o)}}function zoa(t,e){if(e.invalid)return!1;if(!e.version||Mgr(e.version))return!0;let r=mli(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=mli(n,o)}return Voa[e.op]?.includes(r)}function Yoa(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function Koa(t,e){return t=t.trim(),t=gsa(t,e),t=msa(t),t=Asa(t,e),t=t.trim(),t}function _v(t){return!t||t.toLowerCase()==="x"||t==="*"}function Joa(t){let e=t.match(yli);if(!e){Dn.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 Zoa(t){if(!t)return{};let e=t.match($oa);if(!e)return Dn.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 Mgr(t){return t==="*"||t==="x"||t==="X"}function hli(t){let e=parseInt(t,10);return isNaN(e)?t:e}function Xoa(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 esa(t,e){if(Mgr(t)||Mgr(e))return 0;let[r,n]=Xoa(hli(t),hli(e));return r>n?1:r{let l;return _v(n)?l="":_v(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:_v(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 gsa(t,e){let r=hsa,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return _v(s)?d="":_v(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:_v(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 Asa(t,e){let r=ssa;return t.replace(r,(n,o,s,c,l,u)=>{let d=_v(s),f=d||_v(c),h=f||_v(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 ysa(t,e){let r=csa;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(_v(s)?o="":_v(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:_v(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,_v(h)?f="":_v(m)?f=`<${+h+1}.0.0-0`:_v(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 yli,$oa,Voa,vli,Cli,tsa,rsa,gli,nsa,Ali,isa,Ngr,qMe,osa,ssa,asa,csa,lsa,usa,dsa,fsa,psa,hsa,bli=ve(()=>{p();co();yli=/^(?: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-]+)*))?$/,$oa=/^(?<|>|=|==|<=|>=|~|\^|~>)?\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-]+)*))?$/,Voa={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(Eli,"satisfies");a(Woa,"_validateVersion");a(_li,"_doSatisfies");a(Dgr,"_checkRange");a(zoa,"_satisfies");a(Yoa,"_doPreleaseCheck");a(Koa,"_normalizeRange");a(_v,"isX");a(Joa,"_parseVersion");a(Zoa,"_parseRange");a(Mgr,"_isWildcard");a(hli,"_parseVersionString");a(Xoa,"_normalizeVersionType");a(esa,"_compareVersionStrings");a(mli,"_compareVersionSegments");vli="[a-zA-Z0-9-]",Cli="0|[1-9]\\d*",tsa=`\\d*[a-zA-Z-]${vli}*`,rsa="((?:<|>)?=?)",gli=`(?:${Cli}|${tsa})`,nsa=`(?:-(${gli}(?:\\.${gli})*))`,Ali=`${vli}+`,isa=`(?:\\+(${Ali}(?:\\.${Ali})*))`,Ngr=`${Cli}|x|X|\\*`,qMe=`[v=\\s]*(${Ngr})(?:\\.(${Ngr})(?:\\.(${Ngr})(?:${nsa})?${isa}?)?)?`,osa=`^${rsa}\\s*${qMe}$`,ssa=new RegExp(osa),asa=`^\\s*(${qMe})\\s+-\\s+(${qMe})\\s*$`,csa=new RegExp(asa),lsa="(?:~>?)",usa=`^${lsa}${qMe}$`,dsa=new RegExp(usa),fsa="(?:\\^)",psa=`^${fsa}${qMe}$`,hsa=new RegExp(psa);a(msa,"replaceTilde");a(gsa,"replaceCaret");a(Asa,"replaceXRange");a(ysa,"replaceHyphen")});var d0e=I((Jsp,Ili)=>{"use strict";p();function Ogr(t){return typeof t=="function"}a(Ogr,"isFunction");var vv=console.error.bind(console);function jMe(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(jMe,"defineProperty");function HMe(t){t&&t.logger&&(Ogr(t.logger)?vv=t.logger:vv("new logger isn't a function, not replacing"))}a(HMe,"shimmer");function Sli(t,e,r){if(!t||!t[e]){vv("no original function "+e+" to wrap");return}if(!r){vv("no wrapper function"),vv(new Error().stack);return}if(!Ogr(t[e])||!Ogr(r)){vv("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return jMe(o,"__original",n),jMe(o,"__unwrap",function(){t[e]===o&&jMe(t,e,n)}),jMe(o,"__wrapped",!0),jMe(t,e,o),o}a(Sli,"wrap");function Esa(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{vv("must provide one or more modules to patch"),vv(new Error().stack);return}if(!(e&&Array.isArray(e))){vv("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){Sli(n,o,r)})})}a(Esa,"massWrap");function Tli(t,e){if(!t||!t[e]){vv("no function to unwrap."),vv(new Error().stack);return}if(!t[e].__unwrap)vv("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(Tli,"unwrap");function _sa(t,e){if(t)Array.isArray(t)||(t=[t]);else{vv("must provide one or more modules to patch"),vv(new Error().stack);return}if(!(e&&Array.isArray(e))){vv("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){Tli(r,n)})})}a(_sa,"massUnwrap");HMe.wrap=Sli;HMe.massWrap=Esa;HMe.unwrap=Tli;HMe.massUnwrap=_sa;Ili.exports=HMe});var oG,jpt,xli=ve(()=>{p();co();Pgr();oG=de(d0e()),jpt=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=Dn.createComponentLogger({namespace:e}),this._tracer=wu.getTracer(e,r),this._meter=cX.getMeter(e,r),this._logger=qpt.getLogger(e,r),this._updateMetricInstruments()}_wrap=oG.wrap;_unwrap=oG.unwrap;_massWrap=oG.massWrap;_massUnwrap=oG.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 Rli=I((oap,wli)=>{p();var f0e=1e3,p0e=f0e*60,h0e=p0e*60,xee=h0e*24,vsa=xee*7,Csa=xee*365.25;wli.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return bsa(t);if(r==="number"&&isFinite(t))return e.long?Tsa(t):Ssa(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function bsa(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*Csa;case"weeks":case"week":case"w":return r*vsa;case"days":case"day":case"d":return r*xee;case"hours":case"hour":case"hrs":case"hr":case"h":return r*h0e;case"minutes":case"minute":case"mins":case"min":case"m":return r*p0e;case"seconds":case"second":case"secs":case"sec":case"s":return r*f0e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(bsa,"parse");function Ssa(t){var e=Math.abs(t);return e>=xee?Math.round(t/xee)+"d":e>=h0e?Math.round(t/h0e)+"h":e>=p0e?Math.round(t/p0e)+"m":e>=f0e?Math.round(t/f0e)+"s":t+"ms"}a(Ssa,"fmtShort");function Tsa(t){var e=Math.abs(t);return e>=xee?Hpt(t,e,xee,"day"):e>=h0e?Hpt(t,e,h0e,"hour"):e>=p0e?Hpt(t,e,p0e,"minute"):e>=f0e?Hpt(t,e,f0e,"second"):t+" ms"}a(Tsa,"fmtLong");function Hpt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(Hpt,"plural")});var Lgr=I((cap,kli)=>{p();function Isa(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=Rli(),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 P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,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(E=>{m=E},"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(Isa,"setup");kli.exports=Isa});var Pli=I((Qb,Gpt)=>{p();Qb.formatArgs=wsa;Qb.save=Rsa;Qb.load=ksa;Qb.useColors=xsa;Qb.storage=Psa();Qb.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`."))}})();Qb.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 xsa(){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(xsa,"useColors");function wsa(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Gpt.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(wsa,"formatArgs");Qb.log=console.debug||console.log||(()=>{});function Rsa(t){try{t?Qb.storage.setItem("debug",t):Qb.storage.removeItem("debug")}catch{}}a(Rsa,"save");function ksa(){let t;try{t=Qb.storage.getItem("debug")||Qb.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(ksa,"load");function Psa(){try{return localStorage}catch{}}a(Psa,"localstorage");Gpt.exports=Lgr()(Qb);var{formatters:Dsa}=Gpt.exports;Dsa.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Nli=I((jg,Vpt)=>{p();var Nsa=require("tty"),$pt=require("util");jg.init=Qsa;jg.log=Bsa;jg.formatArgs=Osa;jg.save=Fsa;jg.load=Usa;jg.useColors=Msa;jg.destroy=$pt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");jg.colors=[6,2,3,4,5,1];try{let t=LGe();t&&(t.stderr||t).level>=2&&(jg.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{}jg.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 Msa(){return"colors"in jg.inspectOpts?!!jg.inspectOpts.colors:Nsa.isatty(process.stderr.fd)}a(Msa,"useColors");function Osa(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:_si.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,Ina.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};_4.InlineEditRequestLogContext=D0r;function wna(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(wna,"basename")});var vsi=I(ept=>{"use strict";p();Object.defineProperty(ept,"__esModule",{value:!0});ept.GhostTextLogContext=void 0;var Rna=Xft(),kna=NA(),N0r=class extends Rna.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,kna.basename)(this.filePath)} (v${this.version})`}};ept.GhostTextLogContext=N0r});var eG=I(Kme=>{"use strict";p();Object.defineProperty(Kme,"__esModule",{value:!0});Kme.CopilotTokenStore=Kme.ICopilotTokenStore=void 0;var Pna=nn(),Dna=Ic(),Nna=ko();Kme.ICopilotTokenStore=(0,Pna.createServiceIdentifier)("ICopilotTokenStore");var M0r=class extends Nna.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new Dna.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()}};Kme.CopilotTokenStore=M0r});var gm=I(sy=>{"use strict";p();var Mna=sy&&sy.__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},Ona=sy&&sy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(sy,"__esModule",{value:!0});sy.TelemetryTrustedValue=sy.ITelemetryService=sy.TelemetryUserConfigImpl=sy.ITelemetryUserConfig=void 0;sy.createTrackingIdGetter=Bna;sy.multiplexProperties=Una;var Csi=nn(),Lna=eG();sy.ITelemetryUserConfig=(0,Csi.createServiceIdentifier)("ITelemetryUserConfig");var O0r=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)}};sy.TelemetryUserConfigImpl=O0r;sy.TelemetryUserConfigImpl=O0r=Mna([Ona(2,Lna.ICopilotTokenStore)],O0r);function Bna(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(Bna,"createTrackingIdGetter");sy.ITelemetryService=(0,Csi.createServiceIdentifier)("ITelemetryService");var L0r=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};sy.TelemetryTrustedValue=L0r;var SMe=8192,Fna=50;function Una(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>SMe){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+SMe;o{"use strict";p();var Qna=Ho&&Ho.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qna=Ho&&Ho.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jna=Ho&&Ho.__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)&&Qna(e,t,r);return qna(e,t),e},B0r=Ho&&Ho.__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())})},F0r=Ho&&Ho.__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 q0r=bee&&bee.__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())})},j0r=bee&&bee.__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,v4.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 q0r(this,void 0,void 0,function(){var r,n,o;return j0r(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,v4.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=Cee.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,v4.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 v4.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return q0r(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return j0r(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,v4.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return Cee.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 xsi=Isi(),Kna="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",Jna="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",Zna=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{Xna.exports={}});var rpt=I(Jme=>{"use strict";p();var eia=Jme&&Jme.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jme,"__esModule",{value:!0});Jme.JsonConfig=void 0;var tia=require("fs"),tpt=require("path"),H0r=Kl(),ria=eia(Rsi()),nia="APPLICATIONINSIGHTS_CONFIGURATION_FILE",iia="APPLICATIONINSIGHTS_CONNECTION_STRING",ksi="APPSETTING_",Psi="APPINSIGHTS_INSTRUMENTATIONKEY",Dsi="APPINSIGHTS_INSTRUMENTATION_KEY",oia="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",sia="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",aia="http_proxy",cia="https_proxy",lia="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",uia="APPLICATION_INSIGHTS_NO_STATSBEAT",dia="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",fia="APPLICATION_INSIGHTS_NO_PATCH_MODULES",pia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",hia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",mia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",gia="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",Aia="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",yia=(function(){function t(){this.connectionString=process.env[iia],this.instrumentationKey=process.env[Psi]||process.env[ksi+Psi]||process.env[Dsi]||process.env[ksi+Dsi],!this.connectionString&&this.instrumentationKey&&H0r.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[sia],this.extendedMetricDisablers=process.env[oia],this.proxyHttpUrl=process.env[aia],this.proxyHttpsUrl=process.env[cia],this.noDiagnosticChannel=!!process.env[lia],this.disableStatsbeat=!!process.env[uia],this.noHttpAgentKeepAlive=!!process.env[dia],this.noPatchModules=process.env[fia]||"",this.enableWebInstrumentation=!!process.env[pia]||!!process.env[gia],this.webInstrumentationSrc=process.env[mia]||"",this.webInstrumentationConnectionString=process.env[hia]||process.env[Aia]||"",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=tpt.join(__dirname,"../../");this._tempDir=tpt.join(o,n);var s=process.env[nia];if(s){tpt.isAbsolute(s)?this._tempDir=s:this._tempDir=tpt.join(o,s);try{e=tia.readFileSync(this._tempDir,"utf8")}catch(l){H0r.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(ria.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){H0r.warn("Invalid JSON config file: ",l)}},t})();Jme.JsonConfig=yia});var G0r=I(npt=>{"use strict";p();Object.defineProperty(npt,"__esModule",{value:!0});npt.makePatchingRequire=void 0;var Eia=require("path"),_ia=yP(),Nsi=Cp(),Osi=require("module"),via=Object.keys(process.binding("natives")),Msi=Osi.prototype.require;function Cia(t){var e={};return a(function(n){var o=Msi.apply(this,arguments);if(t[n]){var s=Osi._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(via.indexOf(n)<0)try{c=Msi.call(this,Eia.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{bia.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 Cp=I(fR=>{"use strict";p();Object.defineProperty(fR,"__esModule",{value:!0});fR.channel=fR.ContextPreservingEventEmitter=fR.trueFilter=fR.makePatchingRequire=void 0;var Sia=G0r(),Tia=G0r();Object.defineProperty(fR,"makePatchingRequire",{enumerable:!0,get:a(function(){return Tia.makePatchingRequire},"get")});var Iia=a(function(t){return!0},"trueFilter");fR.trueFilter=Iia;var Fsi=(function(){function t(){this.version=Lsi().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=fR.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=fR.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();co();$0r=_b("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(Zme,"suppressTracing");a(Usi,"unsuppressTracing");a(tG,"isTracingSuppressed")});var Qsi,ipt,Xme,opt,qsi,jsi,Hsi,V0r=ve(()=>{p();Qsi="=",ipt=";",Xme=",",opt="baggage",qsi=180,jsi=4096,Hsi=8192});function spt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?Xme:"")+r;return n.length>Hsi?e:n},"")}function apt(t){return t.getAllEntries().map(function(e){var r=xia(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=ipt+o.metadata.toString()),s})}function IMe(t){var e=t.split(ipt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(Qsi);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Hpe(e.join(ipt))),{key:o,value:s,metadata:c}}}}}function Gsi(t){return typeof t!="string"||t.length===0?{}:t.split(Xme).map(function(e){return IMe(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var xia,W0r=ve(()=>{p();co();V0r();xia=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(spt,"serializeKeyPairs");a(apt,"getKeyPairs");a(IMe,"parsePairKeyValue");a(Gsi,"parseKeyPairsIntoRecord")});var cpt,$si=ve(()=>{p();co();TMe();V0r();W0r();cpt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=DT.getBaggage(e);if(!(!o||tG(e))){var s=apt(o).filter(function(l){return l.length<=jsi}).slice(0,qsi),c=spt(s);c.length>0&&n.set(r,opt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,opt),s=Array.isArray(o)?o.join(Xme):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(Xme);return l.forEach(function(u){var d=IMe(u);if(d){var f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0?e:DT.setBaggage(e,DT.createBaggage(c))},t.prototype.fields=function(){return[opt]},t})()});var Vsi,Wsi=ve(()=>{p();Vsi=(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 rG(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=zsi(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=wia(s.value,2),l=c[0],u=c[1];if(!z0r(l)){Dn.warn("Invalid attribute key: "+l);continue}if(!xMe(u)){Dn.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 z0r(t){return typeof t=="string"&&t.length>0}function xMe(t){return t==null?!0:Array.isArray(t)?Ria(t):Ysi(t)}function Ria(t){var e,r,n;try{for(var o=zsi(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if(Ysi(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 Ysi(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var zsi,wia,Ksi=ve(()=>{p();co();zsi=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.")},wia=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(rG,"sanitizeAttributes");a(z0r,"isAttributeKey");a(xMe,"isAttributeValue");a(Ria,"isHomogeneousAttributeValueArray");a(Ysi,"isValidPrimitiveAttributeValue")});function lpt(){return function(t){Dn.error(kia(t))}}function kia(t){return typeof t=="string"?t:JSON.stringify(Pia(t))}function Pia(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 Y0r=ve(()=>{p();co();a(lpt,"loggingErrorHandler");a(kia,"stringifyException");a(Pia,"flattenException")});function Zsi(t){Jsi=t}function _v(t){try{Jsi(t)}catch{}}var Jsi,K0r=ve(()=>{p();Y0r();Jsi=lpt();a(Zsi,"setGlobalErrorHandler");a(_v,"globalErrorHandler")});var Fb,J0r=ve(()=>{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"})(Fb||(Fb={}))});function Mia(t){return Nia.indexOf(t)>-1}function Lia(t){return Oia.indexOf(t)>-1}function Fia(t){return Bia.indexOf(t)>-1}function Uia(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function Qia(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 qia(t,e,r,n){n===void 0&&(n=Dia);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function Hia(t,e,r){var n=r[t];if(typeof n=="string"){var o=jia[n.toUpperCase()];o!=null&&(e[t]=o)}}function RMe(t){var e={};for(var r in wMe){var n=r;switch(n){case"OTEL_LOG_LEVEL":Hia(n,e,t);break;default:if(Mia(n))Uia(n,e,t);else if(Lia(n))Qia(n,e,t);else if(Fia(n))qia(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var Dia,Nia,Oia,Bia,See,Tee,Z0r,X0r,wMe,jia,egr=ve(()=>{p();co();J0r();Dia=",",Nia=["OTEL_SDK_DISABLED"];a(Mia,"isEnvVarABoolean");Oia=["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(Lia,"isEnvVarANumber");Bia=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(Fia,"isEnvVarAList");See=1/0,Tee=128,Z0r=128,X0r=128,wMe={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:Pa.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:See,OTEL_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:See,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:See,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Z0r,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:X0r,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Fb.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(Uia,"parseBoolean");a(Qia,"parseNumber");a(qia,"parseStringList");jia={ALL:Pa.ALL,VERBOSE:Pa.VERBOSE,DEBUG:Pa.DEBUG,INFO:Pa.INFO,WARN:Pa.WARN,ERROR:Pa.ERROR,NONE:Pa.NONE};a(Hia,"setLogLevelFromEnv");a(RMe,"parseEnvironment")});function pR(){var t=RMe(process.env);return Object.assign({},wMe,t)}function e0e(){return RMe(process.env)}var Xsi=ve(()=>{p();egr();a(pR,"getEnv");a(e0e,"getEnvWithoutDefaults")});var upt,eai=ve(()=>{p();upt=typeof globalThis=="object"?globalThis:global});function tai(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function dpt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(tai,"intValue");a(dpt,"hexToBinary")});function fpt(t){return Buffer.from(dpt(t)).toString("base64")}var rai=ve(()=>{p();tgr();a(fpt,"hexToBase64")});function nai(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(ppt[t-1]=1);return ppt.toString("hex",0,t)},"generateId")}var Gia,iai,hpt,ppt,oai=ve(()=>{p();Gia=8,iai=16,hpt=(function(){function t(){this.generateTraceId=nai(iai),this.generateSpanId=nai(Gia)}return a(t,"RandomIdGenerator"),t})(),ppt=Buffer.allocUnsafe(iai);a(nai,"getIdGenerator")});var sai,hR,aai=ve(()=>{p();sai=require("perf_hooks"),hR=sai.performance});var mpt,rgr=ve(()=>{p();mpt="1.30.1"});var cai=ve(()=>{p()});var lai=ve(()=>{p();cai()});var $ia,Via,Wia,zia,uai,dai,fai,pai,Yia,hai,mai=ve(()=>{p();$ia="process.runtime.name",Via="telemetry.sdk.name",Wia="telemetry.sdk.language",zia="telemetry.sdk.version",uai=$ia,dai=Via,fai=Wia,pai=zia,Yia="nodejs",hai=Yia});var gai=ve(()=>{p();mai()});var Aai=ve(()=>{p()});var yai=ve(()=>{p()});var Eai=ve(()=>{p();lai();gai();Aai();yai()});var t0e,nG,_ai=ve(()=>{p();rgr();Eai();nG=(t0e={},t0e[dai]="opentelemetry",t0e[uai]="node",t0e[fai]=hai,t0e[pai]=mpt,t0e)});function r0e(t){t.unref()}var vai=ve(()=>{p();a(r0e,"unrefTimer")});var Cai=ve(()=>{p();Xsi();eai();rai();oai();aai();_ai();vai()});var ngr=ve(()=>{p();Cai()});function tD(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*Jia);return[r,n]}function n0e(){var t=hR.timeOrigin;if(typeof t!="number"){var e=hR;t=e.timing&&e.timing.fetchStart}return t}function kMe(t){var e=tD(n0e()),r=tD(typeof t=="number"?t:hR.now());return NMe(e,r)}function Sai(t){if(i0e(t))return t;if(typeof t=="number")return t=gpt&&(r[1]-=gpt,r[0]+=1),r}var bai,Kia,Jia,gpt,wai=ve(()=>{p();ngr();bai=9,Kia=6,Jia=Math.pow(10,Kia),gpt=Math.pow(10,bai);a(tD,"millisToHrTime");a(n0e,"getTimeOrigin");a(kMe,"hrTime");a(Sai,"timeInputToHrTime");a(Apt,"hrTimeDuration");a(Tai,"hrTimeToTimeStamp");a(Iai,"hrTimeToNanoseconds");a(xai,"hrTimeToMilliseconds");a(PMe,"hrTimeToMicroseconds");a(i0e,"isTimeInputHrTime");a(DMe,"isTimeInput");a(NMe,"addHrTimes")});var VT,Rai=ve(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(VT||(VT={}))});var Zia,ypt,kai=ve(()=>{p();co();Zia=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.")},ypt=(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=Zia(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){Dn.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){Dn.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function Pai(t){return toa.test(t)}function Dai(t){return roa.test(t)&&!noa.test(t)}var igr,Xia,eoa,toa,roa,noa,Nai=ve(()=>{p();igr="[_0-9a-z-*/]",Xia="[a-z]"+igr+"{0,255}",eoa="[a-z0-9]"+igr+"{0,240}@[a-z]"+igr+"{0,13}",toa=new RegExp("^(?:"+Xia+"|"+eoa+")$"),roa=/^[ -~]{0,255}[!-~]$/,noa=/,|=/;a(Pai,"validateKey");a(Dai,"validateValue")});var Mai,ioa,Oai,Lai,Ept,ogr=ve(()=>{p();Nai();Mai=32,ioa=512,Oai=",",Lai="=",Ept=(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+Lai+e.get(n)),r},[]).join(Oai)},t.prototype._parse=function(e){e.length>ioa||(this._internalState=e.split(Oai).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(Lai);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);Pai(c)&&Dai(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Mai&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Mai))))},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 sgr(t){var e=uoa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var MMe,OMe,ooa,soa,aoa,coa,loa,uoa,_pt,Bai=ve(()=>{p();co();TMe();ogr();MMe="traceparent",OMe="tracestate",ooa="00",soa="(?!ff)[\\da-f]{2}",aoa="(?![0]{32})[\\da-f]{32}",coa="(?![0]{16})[\\da-f]{16}",loa="[\\da-f]{2}",uoa=new RegExp("^\\s?("+soa+")-("+aoa+")-("+coa+")-("+loa+")(-.*)?\\s?$");a(sgr,"parseTraceParent");_pt=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=wu.getSpanContext(e);if(!(!o||tG(e)||!vb(o))){var s=ooa+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||wf.NONE).toString(16);n.set(r,MMe,s),o.traceState&&n.set(r,OMe,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,MMe);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=sgr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,OMe);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new Ept(typeof u=="string"?u:void 0)}return wu.setSpanContext(e,c)},t.prototype.fields=function(){return[MMe,OMe]},t})()});function Fai(t,e){return t.setValue(agr,e)}function Uai(t){return t.deleteValue(agr)}function Qai(t){return t.getValue(agr)}var agr,vpt,qai=ve(()=>{p();co();agr=_b("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(vpt||(vpt={}));a(Fai,"setRPCMetadata");a(Uai,"deleteRPCMetadata");a(Qai,"getRPCMetadata")});var LMe,cgr=ve(()=>{p();co();LMe=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:Cb.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var o0e,lgr=ve(()=>{p();co();o0e=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:Cb.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var jai,Hai=ve(()=>{p();co();K0r();cgr();lgr();jai=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(_v(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new o0e),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new o0e,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new LMe,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new o0e,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new LMe}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=wu.getSpanContext(e);return!l||!vb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&wf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&wf.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 Gai,$ai=ve(()=>{p();co();Gai=(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:aX(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 Aoa(t,e){return function(r){return t(e(r))}}function ugr(t){if(!yoa(t)||Eoa(t)!==doa)return!1;var e=goa(t);if(e===null)return!0;var r=zai.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Vai.call(r)===moa}function yoa(t){return t!=null&&typeof t=="object"}function Eoa(t){return t==null?t===void 0?poa:foa:Iee&&Iee in Object(t)?_oa(t):voa(t)}function _oa(t){var e=zai.call(t,Iee),r=t[Iee],n=!1;try{t[Iee]=void 0,n=!0}catch{}var o=Yai.call(t);return n&&(e?t[Iee]=r:delete t[Iee]),o}function voa(t){return Yai.call(t)}var doa,foa,poa,hoa,Vai,moa,goa,Wai,zai,Iee,Yai,Kai=ve(()=>{p();doa="[object Object]",foa="[object Null]",poa="[object Undefined]",hoa=Function.prototype,Vai=hoa.toString,moa=Vai.call(Object),goa=Aoa(Object.getPrototypeOf,Object),Wai=Object.prototype,zai=Wai.hasOwnProperty,Iee=Symbol?Symbol.toStringTag:void 0,Yai=Wai.toString;a(Aoa,"overArg");a(ugr,"isPlainObject");a(yoa,"isObjectLike");a(Eoa,"baseGetTag");a(_oa,"getRawTag");a(voa,"objectToString")});function Spt(){for(var t=[],e=0;e0;)r=Zai(r,t.shift(),0,n);return r}function dgr(t){return bpt(t)?t.slice():t}function Zai(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>Coa)){if(r++,Cpt(t)||Cpt(e)||Xai(e))o=dgr(e);else if(bpt(t)){if(o=t.slice(),bpt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(Jai(t,u,n)||Jai(e,u,n))delete o[u];else{if(BMe(f)&&BMe(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]=Zai(o[u],d,r,n)}}}}else o=e;return o}}function Jai(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 boa(t,e){return!(!ugr(t)||!ugr(e))}var Coa,eci=ve(()=>{p();Kai();Coa=20;a(Spt,"merge");a(dgr,"takeValue");a(Zai,"mergeTwoObjects");a(Jai,"wasObjectReferenced");a(bpt,"isArray");a(Xai,"isFunction");a(BMe,"isObject");a(Cpt,"isPrimitive");a(boa,"shouldMerge")});function tci(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new fgr("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 Soa,fgr,rci=ve(()=>{p();Soa=(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)}})(),fgr=(function(t){Soa(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(tci,"callWithTimeout")});function pgr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function nci(t,e){var r,n;if(!e)return!1;try{for(var o=Toa(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(pgr(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 Toa,ici=ve(()=>{p();Toa=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(pgr,"urlMatches");a(nci,"isUrlIgnored")});function oci(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var sci=ve(()=>{p();a(oci,"isWrapped")});var aci,cci=ve(()=>{p();aci=(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 Ioa,xoa,s0e,lci=ve(()=>{p();cci();Ioa=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},xoa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();TMe();a(uci,"_export")});var fci={};ki(fci,{AlwaysOffSampler:()=>LMe,AlwaysOnSampler:()=>o0e,AnchoredClock:()=>Vsi,BindOnceFuture:()=>s0e,CompositePropagator:()=>ypt,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>Tee,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>See,DEFAULT_ENVIRONMENT:()=>wMe,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>Z0r,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>X0r,ExportResultCode:()=>VT,ParentBasedSampler:()=>jai,RPCType:()=>vpt,RandomIdGenerator:()=>hpt,SDK_INFO:()=>nG,TRACE_PARENT_HEADER:()=>MMe,TRACE_STATE_HEADER:()=>OMe,TimeoutError:()=>fgr,TraceIdRatioBasedSampler:()=>Gai,TraceState:()=>Ept,TracesSamplerValues:()=>Fb,VERSION:()=>mpt,W3CBaggagePropagator:()=>cpt,W3CTraceContextPropagator:()=>_pt,_globalThis:()=>upt,addHrTimes:()=>NMe,baggageUtils:()=>woa,callWithTimeout:()=>tci,deleteRPCMetadata:()=>Uai,getEnv:()=>pR,getEnvWithoutDefaults:()=>e0e,getRPCMetadata:()=>Qai,getTimeOrigin:()=>n0e,globalErrorHandler:()=>_v,hexToBase64:()=>fpt,hexToBinary:()=>dpt,hrTime:()=>kMe,hrTimeDuration:()=>Apt,hrTimeToMicroseconds:()=>PMe,hrTimeToMilliseconds:()=>xai,hrTimeToNanoseconds:()=>Iai,hrTimeToTimeStamp:()=>Tai,internal:()=>hgr,isAttributeKey:()=>z0r,isAttributeValue:()=>xMe,isTimeInput:()=>DMe,isTimeInputHrTime:()=>i0e,isTracingSuppressed:()=>tG,isUrlIgnored:()=>nci,isWrapped:()=>oci,loggingErrorHandler:()=>lpt,merge:()=>Spt,millisToHrTime:()=>tD,otperformance:()=>hR,parseEnvironment:()=>RMe,parseTraceParent:()=>sgr,sanitizeAttributes:()=>rG,setGlobalErrorHandler:()=>Zsi,setRPCMetadata:()=>Fai,suppressTracing:()=>Zme,timeInputToHrTime:()=>Sai,unrefTimer:()=>r0e,unsuppressTracing:()=>Usi,urlMatches:()=>pgr});var woa,hgr,Ub=ve(()=>{p();$si();Wsi();Ksi();K0r();Y0r();wai();tgr();Rai();W0r();ngr();kai();Bai();qai();cgr();lgr();Hai();$ai();TMe();ogr();egr();eci();J0r();rci();ici();sci();lci();rgr();dci();woa={getKeyPairs:apt,serializeKeyPairs:spt,parseKeyPairsIntoRecord:Gsi,parsePairKeyValue:IMe},hgr={_export:uci}});var Roa,koa,Poa,Tpt,Ipt,pci,hci=ve(()=>{p();Roa="exception.type",koa="exception.message",Poa="exception.stacktrace",Tpt=Roa,Ipt=koa,pci=Poa});var mci=ve(()=>{p();hci()});var gci=ve(()=>{p()});var Aci=ve(()=>{p();gci()});var yci=ve(()=>{p()});var Eci=ve(()=>{p()});var _ci=ve(()=>{p();mci();Aci();yci();Eci()});var vci,Cci=ve(()=>{p();vci="exception"});var mgr,Doa,bci,Noa,xpt,ggr=ve(()=>{p();co();Ub();_ci();Cci();mgr=function(){return mgr=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.")},bci=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},Noa=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):(Dn.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=Doa(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=bci(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 Dn.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&Dn.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),DMe(r)&&(DMe(n)||(n=r),r=void 0);var o=rG(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,Noa([],bci(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=mgr({},e),this.status.message!=null&&typeof e.message!="string"&&(Dn.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()){Dn.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=Apt(this.startTime,this.endTime),this._duration[0]<0&&(Dn.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&&Dn.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=hR.now())return kMe(e+this._performanceOffset);if(typeof e=="number")return tD(e);if(e instanceof Date)return tD(e.getTime());if(i0e(e))return e;if(this._startTimeProvided)return tD(Date.now());var r=hR.now()-this._performanceStartTime;return NMe(this.startTime,tD(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[Ipt]=e:e&&(e.code?n[Tpt]=e.code.toString():e.name&&(n[Tpt]=e.name),e.message&&(n[Ipt]=e.message),e.stack&&(n[pci]=e.stack)),n[Tpt]||n[Ipt]?this.addEvent(vci,n,r):Dn.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&&Dn.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?(Dn.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 rD,FMe=ve(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(rD||(rD={}))});var iG,wpt=ve(()=>{p();FMe();iG=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:rD.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var C4,Rpt=ve(()=>{p();FMe();C4=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:rD.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var a0e,Agr=ve(()=>{p();co();Ub();wpt();Rpt();a0e=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(_v(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new C4),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new C4,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new iG,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new C4,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new iG}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=wu.getSpanContext(e);return!l||!vb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&wf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&wf.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 UMe,ygr=ve(()=>{p();co();FMe();UMe=(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:aX(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 kpt(){var t=pR();return{sampler:Egr(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 Egr(t){switch(t===void 0&&(t=pR()),t.OTEL_TRACES_SAMPLER){case Fb.AlwaysOn:return new C4;case Fb.AlwaysOff:return new iG;case Fb.ParentBasedAlwaysOn:return new a0e({root:new C4});case Fb.ParentBasedAlwaysOff:return new a0e({root:new iG});case Fb.TraceIdRatio:return new UMe(Sci(t));case Fb.ParentBasedTraceIdRatio:return new a0e({root:new UMe(Sci(t))});default:return Dn.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+Moa+'".'),new C4}}function Sci(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return Dn.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+c0e+"."),c0e;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+c0e+"."),c0e):e<0||e>1?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+c0e+"."),c0e):e}var Moa,c0e,_gr=ve(()=>{p();co();Ub();wpt();Rpt();Agr();ygr();Moa=Fb.AlwaysOn,c0e=1;a(kpt,"loadDefaultConfig");a(Egr,"buildSamplerFromEnv");a(Sci,"getSamplerProbabilityFromEnv")});function Tci(t){var e={sampler:Egr()},r=kpt(),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 Ici(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=e0e();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:Tee,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:See,Object.assign({},t,{spanLimits:g})}var vgr=ve(()=>{p();_gr();Ub();a(Tci,"mergeConfig");a(Ici,"reconfigureLimits")});var xci,wci=ve(()=>{p();co();Ub();xci=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=pR();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 s0e(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Dn.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&wf.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&&Dn.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Dn.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,_v(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),r0e(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var Ooa,l0e,Rci=ve(()=>{p();wci();Ooa=(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)}})(),l0e=(function(t){Ooa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(xci)});function kci(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(Ppt[t-1]=1);return Ppt.toString("hex",0,t)},"generateId")}var Loa,Pci,u0e,Ppt,Dci=ve(()=>{p();Loa=8,Pci=16,u0e=(function(){function t(){this.generateTraceId=kci(Pci),this.generateSpanId=kci(Loa)}return a(t,"RandomIdGenerator"),t})(),Ppt=Buffer.allocUnsafe(Pci);a(kci,"getIdGenerator")});var Nci=ve(()=>{p();Rci();Dci()});var Dpt=ve(()=>{p();Nci()});var Npt,Cgr=ve(()=>{p();co();Ub();ggr();vgr();Dpt();Npt=(function(){function t(e,r,n){this._tracerProvider=n;var o=Tci(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new u0e,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=Og.active()),r.root&&(n=wu.deleteSpan(n));var l=wu.getSpan(n);if(tG(n)){Dn.debug("Instrumentation suppressed, returning Noop Span");var u=wu.wrapSpanContext(Gpe);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!wu.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:$pe.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:rG(R.attributes)}}),E=rG(r.attributes),_=this._sampler.shouldSample(n,h,e,A,E,y);m=(c=_.traceState)!==null&&c!==void 0?c:m;var v=_.decision===Cb.RECORD_AND_SAMPLED?wf.SAMPLED:wf.NONE,b={traceId:h,spanId:f,traceFlags:v,traceState:m};if(_.decision===Cb.NOT_RECORD){Dn.debug("Recording is off, propagating context in a non-recording span");var u=wu.wrapSpanContext(b);return u}var T=rG(Object.assign(E,_.attributes)),w=new xpt(this,n,e,b,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??Og.active(),d=this.startSpan(e,s,u),f=wu.setSpan(u,d);return Og.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 Mci=ve(()=>{p()});var Oci=ve(()=>{p();Mci()});var Boa,Foa,Uoa,Qoa,Lci,bgr,Sgr,Tgr,Bci=ve(()=>{p();Boa="service.name",Foa="telemetry.sdk.name",Uoa="telemetry.sdk.language",Qoa="telemetry.sdk.version",Lci=Boa,bgr=Foa,Sgr=Uoa,Tgr=Qoa});var Fci=ve(()=>{p();Bci()});var Uci=ve(()=>{p()});var Qci=ve(()=>{p()});var qci=ve(()=>{p();Oci();Fci();Uci();Qci()});function Mpt(){return"unknown_service:"+process.argv0}var jci=ve(()=>{p();a(Mpt,"defaultServiceName")});var Hci=ve(()=>{p();jci()});var Gci=ve(()=>{p();Hci()});var oG,qoa,joa,Hoa,Opt,$ci=ve(()=>{p();co();qci();Ub();Gci();oG=function(){return oG=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},Opt=(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 Dn.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[Lci]=Mpt(),e[Sgr]=nG[Sgr],e[bgr]=nG[bgr],e[Tgr]=nG[Tgr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&Dn.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 qoa(this,void 0,void 0,function(){return joa(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=oG(oG({},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=Hoa(c,2),d=u[0],f=u[1];return oG(oG(oG(oG({},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 Vci=ve(()=>{p();$ci()});var Lpt,Igr,Wci=ve(()=>{p();Ub();Lpt=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.")},Igr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=Lpt(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){_v(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=Lpt(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=Lpt(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=Lpt(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 Bpt,xgr=ve(()=>{p();Bpt=(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 Goa,$oa,M8,zci,Yci=ve(()=>{p();co();Ub();Vci();Cgr();_gr();Wci();xgr();Dpt();vgr();Goa=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},$oa=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(pR().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||Dn.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 ypt({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=pR().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||Dn.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new _pt}],["baggage",function(){return new cpt}]]),t._registeredExporters=new Map,t})()});var Voa,Kci,Jci=ve(()=>{p();Ub();Voa=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.")},Kci=(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:PMe(e.startTime),duration:PMe(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=Voa(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:VT.SUCCESS})},t})()});var Woa,zoa,Zci,Xci=ve(()=>{p();Ub();Woa=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},zoa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();Ub();Yoa=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())})},Koa=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]iG,AlwaysOnSampler:()=>C4,BasicTracerProvider:()=>zci,BatchSpanProcessor:()=>l0e,ConsoleSpanExporter:()=>Kci,ForceFlushState:()=>M8,InMemorySpanExporter:()=>Zci,NoopSpanProcessor:()=>Bpt,ParentBasedSampler:()=>a0e,RandomIdGenerator:()=>u0e,SamplingDecision:()=>rD,SimpleSpanProcessor:()=>eli,Span:()=>xpt,TraceIdRatioBasedSampler:()=>UMe,Tracer:()=>Npt});var nli=ve(()=>{p();Cgr();Yci();Dpt();Jci();Xci();tli();xgr();wpt();Rpt();Agr();ygr();FMe();ggr()});var QMe,ili,wgr=ve(()=>{p();QMe=class{static{a(this,"NoopLogger")}emit(e){}},ili=new QMe});var Rgr,Fpt,kgr=ve(()=>{p();wgr();Rgr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new QMe}},Fpt=new Rgr});var Upt,oli=ve(()=>{p();wgr();Upt=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):ili}}});var qMe,sli=ve(()=>{p();kgr();oli();qMe=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new Upt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Fpt}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 Qpt,ali=ve(()=>{p();Qpt=typeof globalThis=="object"?globalThis:global});var cli=ve(()=>{p();ali()});var lli=ve(()=>{p();cli()});function uli(t,e,r){return n=>n===t?e:r}var jMe,d0e,Pgr,dli=ve(()=>{p();lli();jMe=Symbol.for("io.opentelemetry.js.api.logs"),d0e=Qpt;a(uli,"makeGetter");Pgr=1});var qpt,fli=ve(()=>{p();dli();kgr();sli();qpt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new qMe}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return d0e[jMe]?this.getLoggerProvider():(d0e[jMe]=uli(Pgr,e,Fpt),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=d0e[jMe])===null||e===void 0?void 0:e.call(d0e,Pgr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete d0e[jMe],this._proxyLoggerProvider=new qMe}}});var jpt,Dgr=ve(()=>{p();fli();jpt=qpt.getInstance()});function pli(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var mli=ve(()=>{p();a(pli,"enableInstrumentations");a(hli,"disableInstrumentations")});function gli(t){let e=t.tracerProvider||wu.getTracerProvider(),r=t.meterProvider||cX.getMeterProvider(),n=t.loggerProvider||jpt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return pli(o,e,r,n),()=>{hli(o)}}var Ali=ve(()=>{p();co();Dgr();mli();a(gli,"registerInstrumentations")});function bli(t,e,r){if(!Xoa(t))return Dn.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=nsa(t);if(!n)return!1;let o=[],s=Sli(n,e,o,r);return s&&!r?.includePrerelease?tsa(n,o):s}function Xoa(t){return typeof t=="string"&&Cli.test(t)}function Sli(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(Ngr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=Ssa(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!Ngr(t,s,r,n))return!1;return!0}return Ngr(t,e,r,n)}function Ngr(t,e,r,n){if(e=rsa(e,n),e.includes(" "))return Sli(t,e,r,n);{let o=isa(e);return r.push(o),esa(t,o)}}function esa(t,e){if(e.invalid)return!1;if(!e.version||Ogr(e.version))return!0;let r=Eli(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=Eli(n,o)}return Zoa[e.op]?.includes(r)}function tsa(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function rsa(t,e){return t=t.trim(),t=Csa(t,e),t=vsa(t),t=bsa(t,e),t=t.trim(),t}function vv(t){return!t||t.toLowerCase()==="x"||t==="*"}function nsa(t){let e=t.match(Cli);if(!e){Dn.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 isa(t){if(!t)return{};let e=t.match(Joa);if(!e)return Dn.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 Ogr(t){return t==="*"||t==="x"||t==="X"}function yli(t){let e=parseInt(t,10);return isNaN(e)?t:e}function osa(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 ssa(t,e){if(Ogr(t)||Ogr(e))return 0;let[r,n]=osa(yli(t),yli(e));return r>n?1:r{let l;return vv(n)?l="":vv(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:vv(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 Csa(t,e){let r=_sa,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return vv(s)?d="":vv(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:vv(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 bsa(t,e){let r=fsa;return t.replace(r,(n,o,s,c,l,u)=>{let d=vv(s),f=d||vv(c),h=f||vv(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 Ssa(t,e){let r=hsa;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(vv(s)?o="":vv(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:vv(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,vv(h)?f="":vv(m)?f=`<${+h+1}.0.0-0`:vv(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 Cli,Joa,Zoa,Tli,Ili,asa,csa,_li,lsa,vli,usa,Mgr,HMe,dsa,fsa,psa,hsa,msa,gsa,Asa,ysa,Esa,_sa,xli=ve(()=>{p();co();Cli=/^(?: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-]+)*))?$/,Joa=/^(?<|>|=|==|<=|>=|~|\^|~>)?\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-]+)*))?$/,Zoa={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(bli,"satisfies");a(Xoa,"_validateVersion");a(Sli,"_doSatisfies");a(Ngr,"_checkRange");a(esa,"_satisfies");a(tsa,"_doPreleaseCheck");a(rsa,"_normalizeRange");a(vv,"isX");a(nsa,"_parseVersion");a(isa,"_parseRange");a(Ogr,"_isWildcard");a(yli,"_parseVersionString");a(osa,"_normalizeVersionType");a(ssa,"_compareVersionStrings");a(Eli,"_compareVersionSegments");Tli="[a-zA-Z0-9-]",Ili="0|[1-9]\\d*",asa=`\\d*[a-zA-Z-]${Tli}*`,csa="((?:<|>)?=?)",_li=`(?:${Ili}|${asa})`,lsa=`(?:-(${_li}(?:\\.${_li})*))`,vli=`${Tli}+`,usa=`(?:\\+(${vli}(?:\\.${vli})*))`,Mgr=`${Ili}|x|X|\\*`,HMe=`[v=\\s]*(${Mgr})(?:\\.(${Mgr})(?:\\.(${Mgr})(?:${lsa})?${usa}?)?)?`,dsa=`^${csa}\\s*${HMe}$`,fsa=new RegExp(dsa),psa=`^\\s*(${HMe})\\s+-\\s+(${HMe})\\s*$`,hsa=new RegExp(psa),msa="(?:~>?)",gsa=`^${msa}${HMe}$`,Asa=new RegExp(gsa),ysa="(?:\\^)",Esa=`^${ysa}${HMe}$`,_sa=new RegExp(Esa);a(vsa,"replaceTilde");a(Csa,"replaceCaret");a(bsa,"replaceXRange");a(Ssa,"replaceHyphen")});var f0e=I((sap,kli)=>{"use strict";p();function Lgr(t){return typeof t=="function"}a(Lgr,"isFunction");var Cv=console.error.bind(console);function GMe(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(GMe,"defineProperty");function $Me(t){t&&t.logger&&(Lgr(t.logger)?Cv=t.logger:Cv("new logger isn't a function, not replacing"))}a($Me,"shimmer");function wli(t,e,r){if(!t||!t[e]){Cv("no original function "+e+" to wrap");return}if(!r){Cv("no wrapper function"),Cv(new Error().stack);return}if(!Lgr(t[e])||!Lgr(r)){Cv("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return GMe(o,"__original",n),GMe(o,"__unwrap",function(){t[e]===o&&GMe(t,e,n)}),GMe(o,"__wrapped",!0),GMe(t,e,o),o}a(wli,"wrap");function Tsa(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{Cv("must provide one or more modules to patch"),Cv(new Error().stack);return}if(!(e&&Array.isArray(e))){Cv("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){wli(n,o,r)})})}a(Tsa,"massWrap");function Rli(t,e){if(!t||!t[e]){Cv("no function to unwrap."),Cv(new Error().stack);return}if(!t[e].__unwrap)Cv("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(Rli,"unwrap");function Isa(t,e){if(t)Array.isArray(t)||(t=[t]);else{Cv("must provide one or more modules to patch"),Cv(new Error().stack);return}if(!(e&&Array.isArray(e))){Cv("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){Rli(r,n)})})}a(Isa,"massUnwrap");$Me.wrap=wli;$Me.massWrap=Tsa;$Me.unwrap=Rli;$Me.massUnwrap=Isa;kli.exports=$Me});var sG,Hpt,Pli=ve(()=>{p();co();Dgr();sG=de(f0e()),Hpt=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=Dn.createComponentLogger({namespace:e}),this._tracer=wu.getTracer(e,r),this._meter=cX.getMeter(e,r),this._logger=jpt.getLogger(e,r),this._updateMetricInstruments()}_wrap=sG.wrap;_unwrap=sG.unwrap;_massWrap=sG.massWrap;_massUnwrap=sG.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 Nli=I((hap,Dli)=>{p();var p0e=1e3,h0e=p0e*60,m0e=h0e*60,xee=m0e*24,xsa=xee*7,wsa=xee*365.25;Dli.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Rsa(t);if(r==="number"&&isFinite(t))return e.long?Psa(t):ksa(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Rsa(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*wsa;case"weeks":case"week":case"w":return r*xsa;case"days":case"day":case"d":return r*xee;case"hours":case"hour":case"hrs":case"hr":case"h":return r*m0e;case"minutes":case"minute":case"mins":case"min":case"m":return r*h0e;case"seconds":case"second":case"secs":case"sec":case"s":return r*p0e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(Rsa,"parse");function ksa(t){var e=Math.abs(t);return e>=xee?Math.round(t/xee)+"d":e>=m0e?Math.round(t/m0e)+"h":e>=h0e?Math.round(t/h0e)+"m":e>=p0e?Math.round(t/p0e)+"s":t+"ms"}a(ksa,"fmtShort");function Psa(t){var e=Math.abs(t);return e>=xee?Gpt(t,e,xee,"day"):e>=m0e?Gpt(t,e,m0e,"hour"):e>=h0e?Gpt(t,e,h0e,"minute"):e>=p0e?Gpt(t,e,p0e,"second"):t+" ms"}a(Psa,"fmtLong");function Gpt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(Gpt,"plural")});var Bgr=I((Aap,Mli)=>{p();function Dsa(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=Nli(),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 P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,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(E=>{m=E},"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(Dsa,"setup");Mli.exports=Dsa});var Oli=I((Qb,$pt)=>{p();Qb.formatArgs=Msa;Qb.save=Osa;Qb.load=Lsa;Qb.useColors=Nsa;Qb.storage=Bsa();Qb.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`."))}})();Qb.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 Nsa(){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(Nsa,"useColors");function Msa(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+$pt.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(Msa,"formatArgs");Qb.log=console.debug||console.log||(()=>{});function Osa(t){try{t?Qb.storage.setItem("debug",t):Qb.storage.removeItem("debug")}catch{}}a(Osa,"save");function Lsa(){let t;try{t=Qb.storage.getItem("debug")||Qb.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(Lsa,"load");function Bsa(){try{return localStorage}catch{}}a(Bsa,"localstorage");$pt.exports=Bgr()(Qb);var{formatters:Fsa}=$pt.exports;Fsa.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Bli=I((jg,Wpt)=>{p();var Usa=require("tty"),Vpt=require("util");jg.init=Vsa;jg.log=Hsa;jg.formatArgs=qsa;jg.save=Gsa;jg.load=$sa;jg.useColors=Qsa;jg.destroy=Vpt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");jg.colors=[6,2,3,4,5,1];try{let t=FGe();t&&(t.stderr||t).level>=2&&(jg.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{}jg.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 Qsa(){return"colors"in jg.inspectOpts?!!jg.inspectOpts.colors:Usa.isatty(process.stderr.fd)}a(Qsa,"useColors");function qsa(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+"+Vpt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Lsa()+e+" "+t[0]}a(Osa,"formatArgs");function Lsa(){return jg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(Lsa,"getDate");function Bsa(...t){return process.stderr.write($pt.formatWithOptions(jg.inspectOpts,...t)+` -`)}a(Bsa,"log");function Fsa(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(Fsa,"save");function Usa(){return process.env.DEBUG}a(Usa,"load");function Qsa(t){t.inspectOpts={};let e=Object.keys(jg.inspectOpts);for(let r=0;re.trim()).join(" ")};Dli.O=function(t){return this.inspectOpts.colors=this.useColors,$pt.inspect(t,this.inspectOpts)}});var Mli=I((map,Bgr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Bgr.exports=Pli():Bgr.exports=Nli()});var Ugr=I((Aap,Oli)=>{"use strict";p();var Fgr=require("path").sep;Oli.exports=function(t){var e=t.split(Fgr),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]+Fgr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+Fgr;return{name:o,basedir:c,path:d}}}});var Qgr=I((Eap,Lli)=>{"use strict";p();var qsa=require("os");Lli.exports=qsa.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 qgr=I((Cap,Bli)=>{p();Bli.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 Fli=I((Sap,GMe)=>{"use strict";p();var jsa=process.platform==="win32",Hsa=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,jgr={};function Gsa(t){return Hsa.exec(t).slice(1)}a(Gsa,"win32SplitPath");jgr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Gsa(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 $sa=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Hgr={};function Vsa(t){return $sa.exec(t).slice(1)}a(Vsa,"posixSplitPath");Hgr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Vsa(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]}};jsa?GMe.exports=jgr.parse:GMe.exports=Hgr.parse;GMe.exports.posix=Hgr.parse;GMe.exports.win32=jgr.parse});var Ggr=I((xap,jli)=>{p();var qli=require("path"),Uli=qli.parse||Fli(),Qli=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=Uli(e);s.dir!==o[o.length-1];)o.push(s.dir),s=Uli(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return qli.resolve(n,l,u)}))},[])},"getNodeModulesDirs");jli.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 Qli(e,o)},r);var s=Qli(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var $gr=I((kap,Hli)=>{p();Hli.exports=function(t,e){return e||{}}});var Vli=I((Dap,$li)=>{"use strict";p();var Wsa="Function.prototype.bind called on incompatible ",zsa=Object.prototype.toString,Ysa=Math.max,Ksa="[object Function]",Gli=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var Xsa=Vli();Wli.exports=Function.prototype.bind||Xsa});var Kli=I((Fap,Yli)=>{"use strict";p();var eaa=Function.prototype.call,taa=Object.prototype.hasOwnProperty,raa=zli();Yli.exports=raa.call(eaa,taa)});var Jli=I((Qap,naa)=>{naa.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 $Me=I((qap,eui)=>{"use strict";p();var iaa=Kli();function oaa(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(oaa,"specifierIncluded");function Zli(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 wee=require("fs"),aaa=Qgr(),Am=require("path"),caa=qgr(),laa=Ggr(),uaa=$gr(),daa=$Me(),faa=process.platform!=="win32"&&wee.realpath&&typeof wee.realpath.native=="function"?wee.realpath.native:wee.realpath,tui=aaa(),paa=a(function(){return[Am.join(tui,".node_modules"),Am.join(tui,".node_libraries")]},"defaultPaths"),haa=a(function(e,r){wee.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"),maa=a(function(e,r){wee.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),gaa=a(function(e,r){faa(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),VMe=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),Aaa=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"),yaa=a(function(e,r,n){for(var o=laa(r,n,e),s=0;s{Eaa.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 cui=I((zap,aui)=>{"use strict";p();var _aa=$Me(),oui=iui(),sui={};for(Wpt in oui)Object.prototype.hasOwnProperty.call(oui,Wpt)&&(sui[Wpt]=_aa(Wpt));var Wpt;aui.exports=sui});var uui=I((Kap,lui)=>{p();var vaa=$Me();lui.exports=a(function(e){return vaa(e)},"isCore")});var pui=I((Xap,fui)=>{p();var Caa=$Me(),Ree=require("fs"),DE=require("path"),baa=Qgr(),Saa=qgr(),Taa=Ggr(),Iaa=$gr(),xaa=process.platform!=="win32"&&Ree.realpathSync&&typeof Ree.realpathSync.native=="function"?Ree.realpathSync.native:Ree.realpathSync,dui=baa(),waa=a(function(){return[DE.join(dui,".node_modules"),DE.join(dui,".node_libraries")]},"defaultPaths"),Raa=a(function(e){try{var r=Ree.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"),kaa=a(function(e){try{var r=Ree.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),Paa=a(function(e){try{return xaa(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),WMe=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),Daa=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),Naa=a(function(e,r,n){for(var o=Taa(r,n,e),s=0;s{p();var zpt=nui();zpt.core=cui();zpt.isCore=uui();zpt.sync=pui();hui.exports=zpt});var mui=I((icp,Maa)=>{Maa.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 Kgr=I((ocp,Ygr)=>{"use strict";p();var g0e=require("path"),rD=require("module"),dh=Mli()("require-in-the-middle"),Oaa=Ugr();Ygr.exports=zMe;Ygr.exports.Hook=zMe;var Wgr,m0e;if(rD.isBuiltin)m0e=rD.isBuiltin;else if(rD.builtinModules)m0e=a(t=>t.startsWith("node:")?!0:(Wgr===void 0&&(Wgr=new Set(rD.builtinModules)),Wgr.has(t)),"isCore");else{let t=Vgr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?m0e=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):m0e=a(n=>!!t.core[n],"isCore")}var Ypt;function Laa(t,e){if(!Ypt)if(require.resolve&&require.resolve.paths)Ypt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=Vgr();Ypt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return Ypt(t,e)}a(Laa,"resolve");var Baa=/([/\\]index)?(\.js)?$/,zgr=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:(dh('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function zMe(t,e,r){if(!(this instanceof zMe))return new zMe(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof rD._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof rD._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,mui().bugs.url);return}this._cache=new zgr,this._unhooked=!1,this._origRequire=rD.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);dh("registering require hook"),this._require=rD.prototype.require=function(u){return n._unhooked===!0?(dh("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?(dh("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=m0e(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);m0e(v)&&(m=v)}}else{if(d)return dh("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=rD._resolveFilename(f,this)}catch(v){return dh('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(dh("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return dh("returning already patched cached module: %s",m),n._cache.get(m,h);let y=o.has(m);y===!1&&o.add(m);let E=d?n._origGetBuiltinModule.apply(this,u):n._origRequire.apply(this,u);if(y===!0)return dh("module is in the process of being patched already - ignoring: %s",m),E;if(o.delete(m),h===!0){if(c===!0&&t.includes(m)===!1)return dh("ignoring core module not on whitelist: %s",m),E;g=m}else if(c===!0&&t.includes(m)){let v=g0e.parse(m);g=v.name,A=v.dir}else{let v=Oaa(m);if(v===void 0)return dh("could not parse filename: %s",m),E;g=v.name,A=v.basedir;let b=Faa(v);dh("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",g,f,b,A);let T=!1;if(c){if(!f.startsWith(".")&&t.includes(f)&&(g=f,T=!0),!t.includes(g)&&!t.includes(b))return E;t.includes(b)&&b!==g&&(g=b,T=!0)}if(!T){let w;try{w=Laa(g,A)}catch{return dh("could not resolve module: %s",g),n._cache.set(m,E,h),E}if(w!==m)if(s===!0)g=g+g0e.sep+g0e.relative(A,m),dh("preparing to process require of internal file: %s",g);else return dh("ignoring require of non-main module file: %s",w),n._cache.set(m,E,h),E}}n._cache.set(m,E,h),dh("calling require hook: %s",g);let _=r(E,g,A);return n._cache.set(m,_,h),dh("returning module: %s",g),_}a(l,"patchedRequire")}a(zMe,"Hook");zMe.prototype.unhook=function(){this._unhooked=!0,this._require===rD.prototype.require?(rD.prototype.require=this._origRequire,dh("require unhook successful")):dh("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,dh("process.getBuiltinModule unhook successful")):dh("process.getBuiltinModule unhook unsuccessful"))};function Faa(t){let e=g0e.sep!=="/"?t.path.split(g0e.sep).join("/"):t.path;return g0e.posix.join(t.name,e).replace(Baa,"")}a(Faa,"resolveModuleName")});var Kpt,Jpt,gui=ve(()=>{p();Kpt=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},Jpt=class{static{a(this,"ModuleNameTrie")}_trie=new Kpt;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new Kpt,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 Qaa(t){return Jgr.sep!=="/"?t.split(Jgr.sep).join("/"):t}var yui,Jgr,Uaa,Zpt,Eui=ve(()=>{p();yui=de(Kgr()),Jgr=de(require("path"));gui();Uaa=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),Zpt=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new Jpt;static _instance;constructor(){this._initialize()}_initialize(){new yui.Hook(null,{internals:!0},(e,r,n)=>{let o=Qaa(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 Uaa?new t:this._instance=this._instance??new t}};a(Qaa,"normalizePathSeparators")});var Tui=I(kee=>{p();var _ui=[],Zgr=new WeakMap,vui=new WeakMap,Cui=new Map,bui=[],qaa={set(t,e,r){return Zgr.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=vui.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 Zgr.get(t)[e](r.value)}};function jaa(t,e,r,n,o){Cui.set(t,o),Zgr.set(e,r),vui.set(e,n);let s=new Proxy(e,qaa);_ui.forEach(c=>c(t,s)),bui.push([t,s])}a(jaa,"register");var Sui=!1;function Haa(){return Sui}a(Haa,"getExperimentalPatchInternals");function Gaa(t){Sui=t}a(Gaa,"setExperimentalPatchInternals");kee.register=jaa;kee.importHooks=_ui;kee.specifiers=Cui;kee.toHook=bui;kee.getExperimentalPatchInternals=Haa;kee.setExperimentalPatchInternals=Gaa});var Pui=I((ycp,A0e)=>{p();var Iui=require("path"),$aa=Ugr(),{fileURLToPath:xui}=require("url"),{MessageChannel:Vaa}=require("worker_threads"),{importHooks:Xgr,specifiers:Waa,toHook:zaa,getExperimentalPatchInternals:Yaa}=Tui();function Rui(t){Xgr.push(t),zaa.forEach(([e,r])=>t(e,r))}a(Rui,"addHook");function kui(t){let e=Xgr.indexOf(t);e>-1&&Xgr.splice(e,1)}a(kui,"removeHook");function wui(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(wui,"callHookFn");var eAr;function Kaa(){let{port1:t,port2:e}=new Vaa,r=0,n;eAr=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(Kaa,"createAddHookMessageChannel");function YMe(t,e,r){if(!(this instanceof YMe))return new YMe(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;eAr&&Array.isArray(t)&&eAr(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=xui(o)}catch{}let d=$aa(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+Iui.sep+Iui.relative(u,xui(c));else if(!Yaa()&&!u.endsWith(Waa.get(c)))continue}wui(r,s,o,u)}}else wui(r,s,o,u)},Rui(this._iitmHook)}a(YMe,"Hook");YMe.prototype.unhook=function(){kui(this._iitmHook)};A0e.exports=YMe;A0e.exports.Hook=YMe;A0e.exports.addHook=Rui;A0e.exports.removeHook=kui;A0e.exports.createAddHookMessageChannel=Kaa});function Dui(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 Nui(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 Xpt(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var tAr=ve(()=>{p();a(Dui,"safeExecuteInTheMiddle");a(Nui,"safeExecuteInTheMiddleAsync");a(Xpt,"isWrapped")});function Mui(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>Eli(e,n,{includePrerelease:r}))}var M8,rAr,KMe,Oui,Lui,Bui,y0e,Fui=ve(()=>{p();M8=de(require("path")),rAr=require("util");bli();KMe=de(d0e());xli();Eui();Oui=de(Pui());co();Lui=de(Kgr()),Bui=require("fs");tAr();y0e=class extends jpt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=Zpt.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(Xpt(e[r])&&this._unwrap(e,r),rAr.types.isProxy(e)){let o=(0,KMe.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,KMe.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>rAr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,KMe.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.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{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.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,Bui.readFileSync)(M8.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{Dn.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 Mui(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=M8.normalize(n);return c.filter(d=>d.name===l).filter(d=>Mui(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&&M8.isAbsolute(l)){let d=M8.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=M8.isAbsolute(e.name)?new Lui.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new Oui.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(Mui,"isSupported")});var JMe,Uui=ve(()=>{p();JMe=require("path")});var Qui=ve(()=>{p();Fui();Uui()});var nAr=ve(()=>{p();Qui()});var eht,qui=ve(()=>{p();eht=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 tht,jui=ve(()=>{p();nAr();tht=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,JMe.normalize)(e)}}});var iAr={};ki(iAr,{InstrumentationBase:()=>y0e,InstrumentationNodeModuleDefinition:()=>eht,InstrumentationNodeModuleFile:()=>tht,isWrapped:()=>Xpt,registerInstrumentations:()=>fli,safeExecuteInTheMiddle:()=>Dui,safeExecuteInTheMiddleAsync:()=>Nui});var oAr=ve(()=>{p();pli();nAr();qui();jui();tAr()});var Gui=I(sAr=>{"use strict";p();Object.defineProperty(sAr,"__esModule",{value:!0});sAr.log=eca;var Hui=(m3(),ba(iQ)),Jaa=require("node:os"),Zaa=Hui.__importDefault(require("node:util")),Xaa=Hui.__importStar(require("node:process"));function eca(t,...e){Xaa.stderr.write(`${Zaa.default.format(t,...e)}${Jaa.EOL}`)}a(eca,"log")});var Yui=I(dAr=>{"use strict";p();Object.defineProperty(dAr,"__esModule",{value:!0});var tca=Gui(),$ui=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Vui,aAr=[],cAr=[],rht=[];$ui&&lAr($ui);var Wui=Object.assign(t=>zui(t),{enable:lAr,enabled:uAr,disable:rca,log:tca.log});function lAr(t){Vui=t,aAr=[],cAr=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?cAr.push(new RegExp(`^${n.substr(1)}$`)):aAr.push(new RegExp(`^${n}$`));for(let n of rht)n.enabled=uAr(n.namespace)}a(lAr,"enable");function uAr(t){if(t.endsWith("*"))return!0;for(let e of cAr)if(e.test(t))return!1;for(let e of aAr)if(e.test(t))return!0;return!1}a(uAr,"enabled");function rca(){let t=Vui||"";return lAr(""),t}a(rca,"disable");function zui(t){let e=Object.assign(r,{enabled:uAr(t),destroy:nca,log:Wui.log,namespace:t,extend:ica});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),rht.push(e),e}a(zui,"createDebugger");function nca(){let t=rht.indexOf(this);return t>=0?(rht.splice(t,1),!0):!1}a(nca,"destroy");function ica(t){let e=zui(`${this.namespace}:${t}`);return e.log=this.log,e}a(ica,"extend");dAr.default=Wui});var sht=I(b4=>{"use strict";p();Object.defineProperty(b4,"__esModule",{value:!0});b4.AzureLogger=void 0;b4.setLogLevel=Zui;b4.getLogLevel=sca;b4.createClientLogger=aca;var oca=(m3(),ba(iQ)),ZMe=oca.__importDefault(Yui()),Jui=new Set,nht=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,oht;b4.AzureLogger=(0,ZMe.default)("azure");b4.AzureLogger.log=(...t)=>{ZMe.default.log(...t)};var fAr=["verbose","info","warning","error"];nht&&(tdi(nht)?Zui(nht):console.error(`AZURE_LOG_LEVEL set to unknown log level '${nht}'; logging is not enabled. Acceptable values: ${fAr.join(", ")}.`));function Zui(t){if(t&&!tdi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${fAr.join(",")}`);oht=t;let e=[];for(let r of Jui)edi(r)&&e.push(r.namespace);ZMe.default.enable(e.join(","))}a(Zui,"setLogLevel");function sca(){return oht}a(sca,"getLogLevel");var Kui={verbose:400,info:300,warning:200,error:100};function aca(t){let e=b4.AzureLogger.extend(t);return Xui(b4.AzureLogger,e),{error:iht(e,"error"),warning:iht(e,"warning"),info:iht(e,"info"),verbose:iht(e,"verbose")}}a(aca,"createClientLogger");function Xui(t,e){e.log=(...r)=>{t.log(...r)}}a(Xui,"patchLogMethod");function iht(t,e){let r=Object.assign(t.extend(e),{level:e});if(Xui(t,r),edi(r)){let n=ZMe.default.disable();ZMe.default.enable(n+","+r.namespace)}return Jui.add(r),r}a(iht,"createLogger");function edi(t){return!!(oht&&Kui[t.level]<=Kui[oht])}a(edi,"shouldEnable");function tdi(t){return fAr.includes(t)}a(tdi,"isAzureLogLevel")});var pAr=I(aht=>{"use strict";p();Object.defineProperty(aht,"__esModule",{value:!0});aht.logger=void 0;var cca=sht();aht.logger=(0,cca.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function cht(t){return t.setValue(hAr,!0)}function rdi(t){return t.deleteValue(hAr)}function E0e(t){return t.getValue(hAr)===!0}var hAr,XMe=ve(()=>{p();co();hAr=_b("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(cht,"suppressTracing");a(rdi,"unsuppressTracing");a(E0e,"isTracingSuppressed")});var lht,ndi=ve(()=>{p();lht="baggage"});function odi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function sdi(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 mAr(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=Hpe(e.join(";"))),{key:o,value:s,metadata:c}}function adi(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=mAr(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var gAr=ve(()=>{p();co();a(odi,"serializeKeyPairs");a(sdi,"getKeyPairs");a(mAr,"parsePairKeyValue");a(adi,"parseKeyPairsIntoRecord")});var dht,cdi=ve(()=>{p();co();XMe();ndi();gAr();dht=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=kT.getBaggage(e);if(!o||E0e(e))return;let s=sdi(o).filter(l=>l.length<=4096).slice(0,180),c=odi(s);c.length>0&&n.set(r,lht,c)}extract(e,r,n){let o=n.get(r,lht),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=mAr(u);if(d){let f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0)?e:kT.setBaggage(e,kT.createBaggage(c))}fields(){return[lht]}}});var fht,ldi=ve(()=>{p();fht=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 udi(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(!dca(r)){Dn.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!AAr(n)){Dn.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function dca(t){return typeof t=="string"&&t!==""}function AAr(t){return t==null?!0:Array.isArray(t)?fca(t):ddi(typeof t)}function fca(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(ddi(n)){e=n;continue}return!1}return!1}}return!0}function ddi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var fdi=ve(()=>{p();co();a(udi,"sanitizeAttributes");a(dca,"isAttributeKey");a(AAr,"isAttributeValue");a(fca,"isHomogeneousAttributeValueArray");a(ddi,"isValidPrimitiveAttributeValueType")});function pht(){return t=>{Dn.error(pca(t))}}function pca(t){return typeof t=="string"?t:JSON.stringify(hca(t))}function hca(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 yAr=ve(()=>{p();co();a(pht,"loggingErrorHandler");a(pca,"stringifyException");a(hca,"flattenException")});function hdi(t){pdi=t}function mdi(t){try{pdi(t)}catch{}}var pdi,gdi=ve(()=>{p();yAr();pdi=pht();a(hdi,"setGlobalErrorHandler");a(mdi,"globalErrorHandler")});function hht(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Dn.warn(`Unknown value ${(0,EAr.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function eOe(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function mht(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Dn.warn(`Unknown value ${(0,EAr.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function ght(t){return eOe(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var EAr,Adi=ve(()=>{p();co();EAr=require("util");a(hht,"getNumberFromEnv");a(eOe,"getStringFromEnv");a(mht,"getBooleanFromEnv");a(ght,"getStringListFromEnv")});var Aht,ydi=ve(()=>{p();Aht=typeof globalThis=="object"?globalThis:global});var Edi,sG,_di=ve(()=>{p();Edi=require("perf_hooks"),sG=Edi.performance});var vdi,Cdi=ve(()=>{p();vdi="2.2.0"});function fh(t){let e={},r=t.length;for(let n=0;n{p();a(fh,"createConstMap")});var bdi,Sdi,Tdi,Idi,xdi,wdi,Rdi,kdi,Pdi,Ddi,Ndi,Mdi,Odi,Ldi,Bdi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,efi,tfi,rfi,nfi,ifi,ofi,sfi,afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Lfi,Bfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,npi,ipi,opi,spi,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi,mca,gca,Aca,yca,Eca,_ca,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,ela,tla,rla,nla,ila,ola,sla,ala,cla,lla,ula,dla,fla,pla,hla,mla,gla,Ala,yla,Ela,_la,vla,Cla,bla,Sla,Tla,Ila,xla,wla,Rla,kla,Pla,Dla,Nla,Mla,Ola,Lla,Bla,Fla,Ula,Qla,qla,jla,Hla,Gla,$la,Vla,Wla,zla,Yla,Kla,Jla,Zla,Xla,eua,tua,rua,nua,iua,oua,sua,aua,cua,lua,uua,dua,fua,pua,hua,mua,gua,Aua,yua,Eua,_ua,vua,Cua,bua,Sua,Tua,Iua,xua,wua,Rua,kua,Pua,Dua,Nua,Mua,Oua,Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi,Lua,Bua,Fua,Uua,Qua,qua,jua,Hua,Gua,$ua,Vua,Wua,zua,Yua,Kua,Jua,Zua,Xua,eda,tda,rda,nda,ida,oda,sda,ada,cda,lda,uda,dda,fda,pda,hda,mda,gda,Ada,yda,Eda,_da,vda,Cda,bda,Sda,Tda,Ida,xda,wda,Rda,Lhi,Bhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi,Ghi,$hi,Vhi,kda,Pda,Dda,Nda,Mda,Oda,Lda,Bda,Fda,Uda,Qda,qda,Whi,zhi,Yhi,Khi,Jhi,jda,Hda,Gda,$da,Vda,Wda,Zhi,Xhi,emi,zda,Yda,Kda,Jda,tmi,rmi,nmi,imi,Zda,Xda,efa,tfa,rfa,omi,smi,ami,cmi,lmi,umi,dmi,nfa,ifa,ofa,sfa,afa,cfa,lfa,ufa,fmi,pmi,hmi,mmi,gmi,dfa,ffa,pfa,hfa,mfa,gfa,Ami,ymi,Emi,_mi,vmi,Cmi,bmi,Smi,Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi,Omi,Lmi,Bmi,Afa,yfa,Efa,_fa,vfa,Cfa,bfa,Sfa,Tfa,Ifa,xfa,wfa,Rfa,kfa,Pfa,Dfa,Nfa,Mfa,Ofa,Lfa,Bfa,Ffa,Fmi,Umi,Qmi,qmi,jmi,Ufa,Qfa,qfa,jfa,Hfa,Gfa,Hmi,Gmi,$fa,Vfa,Wfa,$mi,Vmi,zfa,Yfa,Kfa,Wmi,zmi,Ymi,Kmi,Jmi,Zmi,Xmi,e0i,t0i,r0i,n0i,i0i,o0i,s0i,a0i,c0i,l0i,Jfa,Zfa,Xfa,epa,tpa,rpa,npa,ipa,opa,spa,apa,cpa,lpa,upa,dpa,fpa,ppa,hpa,u0i,d0i,mpa,gpa,Apa,f0i=ve(()=>{p();_Ar();bdi="aws.lambda.invoked_arn",Sdi="db.system",Tdi="db.connection_string",Idi="db.user",xdi="db.jdbc.driver_classname",wdi="db.name",Rdi="db.statement",kdi="db.operation",Pdi="db.mssql.instance_name",Ddi="db.cassandra.keyspace",Ndi="db.cassandra.page_size",Mdi="db.cassandra.consistency_level",Odi="db.cassandra.table",Ldi="db.cassandra.idempotence",Bdi="db.cassandra.speculative_execution_count",Fdi="db.cassandra.coordinator.id",Udi="db.cassandra.coordinator.dc",Qdi="db.hbase.namespace",qdi="db.redis.database_index",jdi="db.mongodb.collection",Hdi="db.sql.table",Gdi="exception.type",$di="exception.message",Vdi="exception.stacktrace",Wdi="exception.escaped",zdi="faas.trigger",Ydi="faas.execution",Kdi="faas.document.collection",Jdi="faas.document.operation",Zdi="faas.document.time",Xdi="faas.document.name",efi="faas.time",tfi="faas.cron",rfi="faas.coldstart",nfi="faas.invoked_name",ifi="faas.invoked_provider",ofi="faas.invoked_region",sfi="net.transport",afi="net.peer.ip",cfi="net.peer.port",lfi="net.peer.name",ufi="net.host.ip",dfi="net.host.port",ffi="net.host.name",pfi="net.host.connection.type",hfi="net.host.connection.subtype",mfi="net.host.carrier.name",gfi="net.host.carrier.mcc",Afi="net.host.carrier.mnc",yfi="net.host.carrier.icc",Efi="peer.service",_fi="enduser.id",vfi="enduser.role",Cfi="enduser.scope",bfi="thread.id",Sfi="thread.name",Tfi="code.function",Ifi="code.namespace",xfi="code.filepath",wfi="code.lineno",Rfi="http.method",kfi="http.url",Pfi="http.target",Dfi="http.host",Nfi="http.scheme",Mfi="http.status_code",Ofi="http.flavor",Lfi="http.user_agent",Bfi="http.request_content_length",Ffi="http.request_content_length_uncompressed",Ufi="http.response_content_length",Qfi="http.response_content_length_uncompressed",qfi="http.server_name",jfi="http.route",Hfi="http.client_ip",Gfi="aws.dynamodb.table_names",$fi="aws.dynamodb.consumed_capacity",Vfi="aws.dynamodb.item_collection_metrics",Wfi="aws.dynamodb.provisioned_read_capacity",zfi="aws.dynamodb.provisioned_write_capacity",Yfi="aws.dynamodb.consistent_read",Kfi="aws.dynamodb.projection",Jfi="aws.dynamodb.limit",Zfi="aws.dynamodb.attributes_to_get",Xfi="aws.dynamodb.index_name",epi="aws.dynamodb.select",tpi="aws.dynamodb.global_secondary_indexes",rpi="aws.dynamodb.local_secondary_indexes",npi="aws.dynamodb.exclusive_start_table",ipi="aws.dynamodb.table_count",opi="aws.dynamodb.scan_forward",spi="aws.dynamodb.segment",api="aws.dynamodb.total_segments",cpi="aws.dynamodb.count",lpi="aws.dynamodb.scanned_count",upi="aws.dynamodb.attribute_definitions",dpi="aws.dynamodb.global_secondary_index_updates",fpi="messaging.system",ppi="messaging.destination",hpi="messaging.destination_kind",mpi="messaging.temp_destination",gpi="messaging.protocol",Api="messaging.protocol_version",ypi="messaging.url",Epi="messaging.message_id",_pi="messaging.conversation_id",vpi="messaging.message_payload_size_bytes",Cpi="messaging.message_payload_compressed_size_bytes",bpi="messaging.operation",Spi="messaging.consumer_id",Tpi="messaging.rabbitmq.routing_key",Ipi="messaging.kafka.message_key",xpi="messaging.kafka.consumer_group",wpi="messaging.kafka.client_id",Rpi="messaging.kafka.partition",kpi="messaging.kafka.tombstone",Ppi="rpc.system",Dpi="rpc.service",Npi="rpc.method",Mpi="rpc.grpc.status_code",Opi="rpc.jsonrpc.version",Lpi="rpc.jsonrpc.request_id",Bpi="rpc.jsonrpc.error_code",Fpi="rpc.jsonrpc.error_message",Upi="message.type",Qpi="message.id",qpi="message.compressed_size",jpi="message.uncompressed_size",mca=bdi,gca=Sdi,Aca=Tdi,yca=Idi,Eca=xdi,_ca=wdi,vca=Rdi,Cca=kdi,bca=Pdi,Sca=Ddi,Tca=Ndi,Ica=Mdi,xca=Odi,wca=Ldi,Rca=Bdi,kca=Fdi,Pca=Udi,Dca=Qdi,Nca=qdi,Mca=jdi,Oca=Hdi,Lca=Gdi,Bca=$di,Fca=Vdi,Uca=Wdi,Qca=zdi,qca=Ydi,jca=Kdi,Hca=Jdi,Gca=Zdi,$ca=Xdi,Vca=efi,Wca=tfi,zca=rfi,Yca=nfi,Kca=ifi,Jca=ofi,Zca=sfi,Xca=afi,ela=cfi,tla=lfi,rla=ufi,nla=dfi,ila=ffi,ola=pfi,sla=hfi,ala=mfi,cla=gfi,lla=Afi,ula=yfi,dla=Efi,fla=_fi,pla=vfi,hla=Cfi,mla=bfi,gla=Sfi,Ala=Tfi,yla=Ifi,Ela=xfi,_la=wfi,vla=Rfi,Cla=kfi,bla=Pfi,Sla=Dfi,Tla=Nfi,Ila=Mfi,xla=Ofi,wla=Lfi,Rla=Bfi,kla=Ffi,Pla=Ufi,Dla=Qfi,Nla=qfi,Mla=jfi,Ola=Hfi,Lla=Gfi,Bla=$fi,Fla=Vfi,Ula=Wfi,Qla=zfi,qla=Yfi,jla=Kfi,Hla=Jfi,Gla=Zfi,$la=Xfi,Vla=epi,Wla=tpi,zla=rpi,Yla=npi,Kla=ipi,Jla=opi,Zla=spi,Xla=api,eua=cpi,tua=lpi,rua=upi,nua=dpi,iua=fpi,oua=ppi,sua=hpi,aua=mpi,cua=gpi,lua=Api,uua=ypi,dua=Epi,fua=_pi,pua=vpi,hua=Cpi,mua=bpi,gua=Spi,Aua=Tpi,yua=Ipi,Eua=xpi,_ua=wpi,vua=Rpi,Cua=kpi,bua=Ppi,Sua=Dpi,Tua=Npi,Iua=Mpi,xua=Opi,wua=Lpi,Rua=Bpi,kua=Fpi,Pua=Upi,Dua=Qpi,Nua=qpi,Mua=jpi,Oua=fh([bdi,Sdi,Tdi,Idi,xdi,wdi,Rdi,kdi,Pdi,Ddi,Ndi,Mdi,Odi,Ldi,Bdi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,efi,tfi,rfi,nfi,ifi,ofi,sfi,afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Lfi,Bfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,npi,ipi,opi,spi,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi]),Hpi="other_sql",Gpi="mssql",$pi="mysql",Vpi="oracle",Wpi="db2",zpi="postgresql",Ypi="redshift",Kpi="hive",Jpi="cloudscape",Zpi="hsqldb",Xpi="progress",ehi="maxdb",thi="hanadb",rhi="ingres",nhi="firstsql",ihi="edb",ohi="cache",shi="adabas",ahi="firebird",chi="derby",lhi="filemaker",uhi="informix",dhi="instantdb",fhi="interbase",phi="mariadb",hhi="netezza",mhi="pervasive",ghi="pointbase",Ahi="sqlite",yhi="sybase",Ehi="teradata",_hi="vertica",vhi="h2",Chi="coldfusion",bhi="cassandra",Shi="hbase",Thi="mongodb",Ihi="redis",xhi="couchbase",whi="couchdb",Rhi="cosmosdb",khi="dynamodb",Phi="neo4j",Dhi="geode",Nhi="elasticsearch",Mhi="memcached",Ohi="cockroachdb",Lua=Hpi,Bua=Gpi,Fua=$pi,Uua=Vpi,Qua=Wpi,qua=zpi,jua=Ypi,Hua=Kpi,Gua=Jpi,$ua=Zpi,Vua=Xpi,Wua=ehi,zua=thi,Yua=rhi,Kua=nhi,Jua=ihi,Zua=ohi,Xua=shi,eda=ahi,tda=chi,rda=lhi,nda=uhi,ida=dhi,oda=fhi,sda=phi,ada=hhi,cda=mhi,lda=ghi,uda=Ahi,dda=yhi,fda=Ehi,pda=_hi,hda=vhi,mda=Chi,gda=bhi,Ada=Shi,yda=Thi,Eda=Ihi,_da=xhi,vda=whi,Cda=Rhi,bda=khi,Sda=Phi,Tda=Dhi,Ida=Nhi,xda=Mhi,wda=Ohi,Rda=fh([Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi]),Lhi="all",Bhi="each_quorum",Fhi="quorum",Uhi="local_quorum",Qhi="one",qhi="two",jhi="three",Hhi="local_one",Ghi="any",$hi="serial",Vhi="local_serial",kda=Lhi,Pda=Bhi,Dda=Fhi,Nda=Uhi,Mda=Qhi,Oda=qhi,Lda=jhi,Bda=Hhi,Fda=Ghi,Uda=$hi,Qda=Vhi,qda=fh([Lhi,Bhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi,Ghi,$hi,Vhi]),Whi="datasource",zhi="http",Yhi="pubsub",Khi="timer",Jhi="other",jda=Whi,Hda=zhi,Gda=Yhi,$da=Khi,Vda=Jhi,Wda=fh([Whi,zhi,Yhi,Khi,Jhi]),Zhi="insert",Xhi="edit",emi="delete",zda=Zhi,Yda=Xhi,Kda=emi,Jda=fh([Zhi,Xhi,emi]),tmi="alibaba_cloud",rmi="aws",nmi="azure",imi="gcp",Zda=tmi,Xda=rmi,efa=nmi,tfa=imi,rfa=fh([tmi,rmi,nmi,imi]),omi="ip_tcp",smi="ip_udp",ami="ip",cmi="unix",lmi="pipe",umi="inproc",dmi="other",nfa=omi,ifa=smi,ofa=ami,sfa=cmi,afa=lmi,cfa=umi,lfa=dmi,ufa=fh([omi,smi,ami,cmi,lmi,umi,dmi]),fmi="wifi",pmi="wired",hmi="cell",mmi="unavailable",gmi="unknown",dfa=fmi,ffa=pmi,pfa=hmi,hfa=mmi,mfa=gmi,gfa=fh([fmi,pmi,hmi,mmi,gmi]),Ami="gprs",ymi="edge",Emi="umts",_mi="cdma",vmi="evdo_0",Cmi="evdo_a",bmi="cdma2000_1xrtt",Smi="hsdpa",Tmi="hsupa",Imi="hspa",xmi="iden",wmi="evdo_b",Rmi="lte",kmi="ehrpd",Pmi="hspap",Dmi="gsm",Nmi="td_scdma",Mmi="iwlan",Omi="nr",Lmi="nrnsa",Bmi="lte_ca",Afa=Ami,yfa=ymi,Efa=Emi,_fa=_mi,vfa=vmi,Cfa=Cmi,bfa=bmi,Sfa=Smi,Tfa=Tmi,Ifa=Imi,xfa=xmi,wfa=wmi,Rfa=Rmi,kfa=kmi,Pfa=Pmi,Dfa=Dmi,Nfa=Nmi,Mfa=Mmi,Ofa=Omi,Lfa=Lmi,Bfa=Bmi,Ffa=fh([Ami,ymi,Emi,_mi,vmi,Cmi,bmi,Smi,Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi,Omi,Lmi,Bmi]),Fmi="1.0",Umi="1.1",Qmi="2.0",qmi="SPDY",jmi="QUIC",Ufa=Fmi,Qfa=Umi,qfa=Qmi,jfa=qmi,Hfa=jmi,Gfa={HTTP_1_0:Fmi,HTTP_1_1:Umi,HTTP_2_0:Qmi,SPDY:qmi,QUIC:jmi},Hmi="queue",Gmi="topic",$fa=Hmi,Vfa=Gmi,Wfa=fh([Hmi,Gmi]),$mi="receive",Vmi="process",zfa=$mi,Yfa=Vmi,Kfa=fh([$mi,Vmi]),Wmi=0,zmi=1,Ymi=2,Kmi=3,Jmi=4,Zmi=5,Xmi=6,e0i=7,t0i=8,r0i=9,n0i=10,i0i=11,o0i=12,s0i=13,a0i=14,c0i=15,l0i=16,Jfa=Wmi,Zfa=zmi,Xfa=Ymi,epa=Kmi,tpa=Jmi,rpa=Zmi,npa=Xmi,ipa=e0i,opa=t0i,spa=r0i,apa=n0i,cpa=i0i,lpa=o0i,upa=s0i,dpa=a0i,fpa=c0i,ppa=l0i,hpa={OK:Wmi,CANCELLED:zmi,UNKNOWN:Ymi,INVALID_ARGUMENT:Kmi,DEADLINE_EXCEEDED:Jmi,NOT_FOUND:Zmi,ALREADY_EXISTS:Xmi,PERMISSION_DENIED:e0i,RESOURCE_EXHAUSTED:t0i,FAILED_PRECONDITION:r0i,ABORTED:n0i,OUT_OF_RANGE:i0i,UNIMPLEMENTED:o0i,INTERNAL:s0i,UNAVAILABLE:a0i,DATA_LOSS:c0i,UNAUTHENTICATED:l0i},u0i="SENT",d0i="RECEIVED",mpa=u0i,gpa=d0i,Apa=fh([u0i,d0i])});var p0i=ve(()=>{p();f0i()});var h0i,m0i,g0i,A0i,y0i,E0i,_0i,v0i,C0i,b0i,S0i,T0i,I0i,x0i,w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i,U0i,Q0i,q0i,j0i,H0i,G0i,$0i,V0i,W0i,z0i,Y0i,K0i,J0i,Z0i,X0i,egi,tgi,rgi,ngi,igi,ogi,sgi,agi,cgi,lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi,kgi,Pgi,Dgi,Ngi,Mgi,Ogi,Lgi,Bgi,Fgi,Ugi,Qgi,ypa,Epa,_pa,vpa,Cpa,bpa,Spa,Tpa,Ipa,xpa,wpa,Rpa,kpa,Ppa,Dpa,Npa,Mpa,Opa,Lpa,Bpa,Fpa,Upa,Qpa,qpa,jpa,Hpa,Gpa,$pa,Vpa,Wpa,zpa,Ypa,Kpa,Jpa,Zpa,Xpa,eha,tha,rha,nha,iha,oha,sha,aha,cha,lha,uha,dha,fha,pha,hha,mha,gha,Aha,yha,Eha,_ha,vha,Cha,bha,Sha,Tha,Iha,xha,wha,Rha,kha,Pha,Dha,Nha,Mha,Oha,Lha,Bha,Fha,Uha,Qha,qha,jha,Hha,Gha,$ha,qgi,jgi,Hgi,Ggi,Vha,Wha,zha,Yha,Kha,$gi,Vgi,Wgi,zgi,Ygi,Kgi,Jgi,Zgi,Xgi,eAi,tAi,rAi,nAi,iAi,oAi,sAi,aAi,Jha,Zha,Xha,ema,tma,rma,nma,ima,oma,sma,ama,cma,lma,uma,dma,fma,pma,hma,cAi,lAi,mma,gma,Ama,uAi,dAi,fAi,pAi,hAi,mAi,gAi,yma,Ema,_ma,vma,Cma,bma,Sma,Tma,AAi,yAi,EAi,_Ai,vAi,CAi,bAi,SAi,TAi,IAi,xAi,Ima,xma,wma,Rma,kma,Pma,Dma,Nma,Mma,Oma,Lma,Bma,wAi,RAi,kAi,PAi,DAi,NAi,MAi,OAi,LAi,BAi,Fma,Uma,Qma,qma,jma,Hma,Gma,$ma,Vma,Wma,zma,FAi=ve(()=>{p();_Ar();h0i="cloud.provider",m0i="cloud.account.id",g0i="cloud.region",A0i="cloud.availability_zone",y0i="cloud.platform",E0i="aws.ecs.container.arn",_0i="aws.ecs.cluster.arn",v0i="aws.ecs.launchtype",C0i="aws.ecs.task.arn",b0i="aws.ecs.task.family",S0i="aws.ecs.task.revision",T0i="aws.eks.cluster.arn",I0i="aws.log.group.names",x0i="aws.log.group.arns",w0i="aws.log.stream.names",R0i="aws.log.stream.arns",k0i="container.name",P0i="container.id",D0i="container.runtime",N0i="container.image.name",M0i="container.image.tag",O0i="deployment.environment",L0i="device.id",B0i="device.model.identifier",F0i="device.model.name",U0i="faas.name",Q0i="faas.id",q0i="faas.version",j0i="faas.instance",H0i="faas.max_memory",G0i="host.id",$0i="host.name",V0i="host.type",W0i="host.arch",z0i="host.image.name",Y0i="host.image.id",K0i="host.image.version",J0i="k8s.cluster.name",Z0i="k8s.node.name",X0i="k8s.node.uid",egi="k8s.namespace.name",tgi="k8s.pod.uid",rgi="k8s.pod.name",ngi="k8s.container.name",igi="k8s.replicaset.uid",ogi="k8s.replicaset.name",sgi="k8s.deployment.uid",agi="k8s.deployment.name",cgi="k8s.statefulset.uid",lgi="k8s.statefulset.name",ugi="k8s.daemonset.uid",dgi="k8s.daemonset.name",fgi="k8s.job.uid",pgi="k8s.job.name",hgi="k8s.cronjob.uid",mgi="k8s.cronjob.name",ggi="os.type",Agi="os.description",ygi="os.name",Egi="os.version",_gi="process.pid",vgi="process.executable.name",Cgi="process.executable.path",bgi="process.command",Sgi="process.command_line",Tgi="process.command_args",Igi="process.owner",xgi="process.runtime.name",wgi="process.runtime.version",Rgi="process.runtime.description",kgi="service.name",Pgi="service.namespace",Dgi="service.instance.id",Ngi="service.version",Mgi="telemetry.sdk.name",Ogi="telemetry.sdk.language",Lgi="telemetry.sdk.version",Bgi="telemetry.auto.version",Fgi="webengine.name",Ugi="webengine.version",Qgi="webengine.description",ypa=h0i,Epa=m0i,_pa=g0i,vpa=A0i,Cpa=y0i,bpa=E0i,Spa=_0i,Tpa=v0i,Ipa=C0i,xpa=b0i,wpa=S0i,Rpa=T0i,kpa=I0i,Ppa=x0i,Dpa=w0i,Npa=R0i,Mpa=k0i,Opa=P0i,Lpa=D0i,Bpa=N0i,Fpa=M0i,Upa=O0i,Qpa=L0i,qpa=B0i,jpa=F0i,Hpa=U0i,Gpa=Q0i,$pa=q0i,Vpa=j0i,Wpa=H0i,zpa=G0i,Ypa=$0i,Kpa=V0i,Jpa=W0i,Zpa=z0i,Xpa=Y0i,eha=K0i,tha=J0i,rha=Z0i,nha=X0i,iha=egi,oha=tgi,sha=rgi,aha=ngi,cha=igi,lha=ogi,uha=sgi,dha=agi,fha=cgi,pha=lgi,hha=ugi,mha=dgi,gha=fgi,Aha=pgi,yha=hgi,Eha=mgi,_ha=ggi,vha=Agi,Cha=ygi,bha=Egi,Sha=_gi,Tha=vgi,Iha=Cgi,xha=bgi,wha=Sgi,Rha=Tgi,kha=Igi,Pha=xgi,Dha=wgi,Nha=Rgi,Mha=kgi,Oha=Pgi,Lha=Dgi,Bha=Ngi,Fha=Mgi,Uha=Ogi,Qha=Lgi,qha=Bgi,jha=Fgi,Hha=Ugi,Gha=Qgi,$ha=fh([h0i,m0i,g0i,A0i,y0i,E0i,_0i,v0i,C0i,b0i,S0i,T0i,I0i,x0i,w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i,U0i,Q0i,q0i,j0i,H0i,G0i,$0i,V0i,W0i,z0i,Y0i,K0i,J0i,Z0i,X0i,egi,tgi,rgi,ngi,igi,ogi,sgi,agi,cgi,lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi,kgi,Pgi,Dgi,Ngi,Mgi,Ogi,Lgi,Bgi,Fgi,Ugi,Qgi]),qgi="alibaba_cloud",jgi="aws",Hgi="azure",Ggi="gcp",Vha=qgi,Wha=jgi,zha=Hgi,Yha=Ggi,Kha=fh([qgi,jgi,Hgi,Ggi]),$gi="alibaba_cloud_ecs",Vgi="alibaba_cloud_fc",Wgi="aws_ec2",zgi="aws_ecs",Ygi="aws_eks",Kgi="aws_lambda",Jgi="aws_elastic_beanstalk",Zgi="azure_vm",Xgi="azure_container_instances",eAi="azure_aks",tAi="azure_functions",rAi="azure_app_service",nAi="gcp_compute_engine",iAi="gcp_cloud_run",oAi="gcp_kubernetes_engine",sAi="gcp_cloud_functions",aAi="gcp_app_engine",Jha=$gi,Zha=Vgi,Xha=Wgi,ema=zgi,tma=Ygi,rma=Kgi,nma=Jgi,ima=Zgi,oma=Xgi,sma=eAi,ama=tAi,cma=rAi,lma=nAi,uma=iAi,dma=oAi,fma=sAi,pma=aAi,hma=fh([$gi,Vgi,Wgi,zgi,Ygi,Kgi,Jgi,Zgi,Xgi,eAi,tAi,rAi,nAi,iAi,oAi,sAi,aAi]),cAi="ec2",lAi="fargate",mma=cAi,gma=lAi,Ama=fh([cAi,lAi]),uAi="amd64",dAi="arm32",fAi="arm64",pAi="ia64",hAi="ppc32",mAi="ppc64",gAi="x86",yma=uAi,Ema=dAi,_ma=fAi,vma=pAi,Cma=hAi,bma=mAi,Sma=gAi,Tma=fh([uAi,dAi,fAi,pAi,hAi,mAi,gAi]),AAi="windows",yAi="linux",EAi="darwin",_Ai="freebsd",vAi="netbsd",CAi="openbsd",bAi="dragonflybsd",SAi="hpux",TAi="aix",IAi="solaris",xAi="z_os",Ima=AAi,xma=yAi,wma=EAi,Rma=_Ai,kma=vAi,Pma=CAi,Dma=bAi,Nma=SAi,Mma=TAi,Oma=IAi,Lma=xAi,Bma=fh([AAi,yAi,EAi,_Ai,vAi,CAi,bAi,SAi,TAi,IAi,xAi]),wAi="cpp",RAi="dotnet",kAi="erlang",PAi="go",DAi="java",NAi="nodejs",MAi="php",OAi="python",LAi="ruby",BAi="webjs",Fma=wAi,Uma=RAi,Qma=kAi,qma=PAi,jma=DAi,Hma=NAi,Gma=MAi,$ma=OAi,Vma=LAi,Wma=BAi,zma=fh([wAi,RAi,kAi,PAi,DAi,NAi,MAi,OAi,LAi,BAi])});var UAi=ve(()=>{p();FAi()});var Yma,Kma,Jma,Zma,Xma,e0a,t0a,r0a,n0a,i0a,o0a,s0a,a0a,c0a,l0a,u0a,d0a,f0a,p0a,h0a,m0a,g0a,A0a,y0a,E0a,_0a,v0a,C0a,b0a,S0a,T0a,I0a,x0a,w0a,R0a,k0a,P0a,D0a,N0a,M0a,O0a,L0a,gup,Aup,B0a,F0a,U0a,Q0a,q0a,j0a,H0a,G0a,$0a,V0a,W0a,z0a,Y0a,K0a,J0a,Z0a,X0a,ega,tga,rga,nga,iga,oga,sga,aga,cga,lga,uga,dga,fga,pga,hga,mga,gga,Aga,yga,Ega,_ga,vga,Cga,bga,Sga,Tga,Iga,xga,wga,Rga,kga,Pga,Dga,Nga,Mga,Oga,Lga,Bga,Fga,Uga,Qga,qga,jga,Hga,Gga,$ga,Vga,Wga,zga,Yga,Kga,Jga,Zga,vAr,Xga,eAa,tAa,rAa,nAa,CAr,iAa,oAa,sAa,aAa,cAa,lAa,bAr,SAr,uAa,dAa,fAa,pAa,hAa,mAa,QAi=ve(()=>{p();Yma="aspnetcore.diagnostics.exception.result",Kma="aborted",Jma="handled",Zma="skipped",Xma="unhandled",e0a="aspnetcore.diagnostics.handler.type",t0a="aspnetcore.rate_limiting.policy",r0a="aspnetcore.rate_limiting.result",n0a="acquired",i0a="endpoint_limiter",o0a="global_limiter",s0a="request_canceled",a0a="aspnetcore.request.is_unhandled",c0a="aspnetcore.routing.is_fallback",l0a="aspnetcore.routing.match_status",u0a="failure",d0a="success",f0a="aspnetcore.user.is_authenticated",p0a="client.address",h0a="client.port",m0a="code.column.number",g0a="code.file.path",A0a="code.function.name",y0a="code.line.number",E0a="code.stacktrace",_0a="db.collection.name",v0a="db.namespace",C0a="db.operation.batch.size",b0a="db.operation.name",S0a="db.query.summary",T0a="db.query.text",I0a="db.response.status_code",x0a="db.stored_procedure.name",w0a="db.system.name",R0a="mariadb",k0a="microsoft.sql_server",P0a="mysql",D0a="postgresql",N0a="dotnet.gc.heap.generation",M0a="gen0",O0a="gen1",L0a="gen2",gup="loh",Aup="poh",B0a="error.type",F0a="_OTHER",U0a="exception.escaped",Q0a="exception.message",q0a="exception.stacktrace",j0a="exception.type",H0a=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),G0a="http.request.method",$0a="_OTHER",V0a="CONNECT",W0a="DELETE",z0a="GET",Y0a="HEAD",K0a="OPTIONS",J0a="PATCH",Z0a="POST",X0a="PUT",ega="TRACE",tga="http.request.method_original",rga="http.request.resend_count",nga=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),iga="http.response.status_code",oga="http.route",sga="jvm.gc.action",aga="jvm.gc.name",cga="jvm.memory.pool.name",lga="jvm.memory.type",uga="heap",dga="non_heap",fga="jvm.thread.daemon",pga="jvm.thread.state",hga="blocked",mga="new",gga="runnable",Aga="terminated",yga="timed_waiting",Ega="waiting",_ga="network.local.address",vga="network.local.port",Cga="network.peer.address",bga="network.peer.port",Sga="network.protocol.name",Tga="network.protocol.version",Iga="network.transport",xga="pipe",wga="quic",Rga="tcp",kga="udp",Pga="unix",Dga="network.type",Nga="ipv4",Mga="ipv6",Oga="otel.scope.name",Lga="otel.scope.version",Bga="otel.status_code",Fga="ERROR",Uga="OK",Qga="otel.status_description",qga="server.address",jga="server.port",Hga="service.name",Gga="service.version",$ga="signalr.connection.status",Vga="app_shutdown",Wga="normal_closure",zga="timeout",Yga="signalr.transport",Kga="long_polling",Jga="server_sent_events",Zga="web_sockets",vAr="telemetry.sdk.language",Xga="cpp",eAa="dotnet",tAa="erlang",rAa="go",nAa="java",CAr="nodejs",iAa="php",oAa="python",sAa="ruby",aAa="rust",cAa="swift",lAa="webjs",bAr="telemetry.sdk.name",SAr="telemetry.sdk.version",uAa="url.fragment",dAa="url.full",fAa="url.path",pAa="url.query",hAa="url.scheme",mAa="user_agent.original"});var gAa,AAa,yAa,EAa,_Aa,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,qAi=ve(()=>{p();gAa="aspnetcore.diagnostics.exceptions",AAa="aspnetcore.rate_limiting.active_request_leases",yAa="aspnetcore.rate_limiting.queued_requests",EAa="aspnetcore.rate_limiting.request.time_in_queue",_Aa="aspnetcore.rate_limiting.request_lease.duration",vAa="aspnetcore.rate_limiting.requests",CAa="aspnetcore.routing.match_attempts",bAa="db.client.operation.duration",SAa="dotnet.assembly.count",TAa="dotnet.exceptions",IAa="dotnet.gc.collections",xAa="dotnet.gc.heap.total_allocated",wAa="dotnet.gc.last_collection.heap.fragmentation.size",RAa="dotnet.gc.last_collection.heap.size",kAa="dotnet.gc.last_collection.memory.committed_size",PAa="dotnet.gc.pause.time",DAa="dotnet.jit.compilation.time",NAa="dotnet.jit.compiled_il.size",MAa="dotnet.jit.compiled_methods",OAa="dotnet.monitor.lock_contentions",LAa="dotnet.process.cpu.count",BAa="dotnet.process.cpu.time",FAa="dotnet.process.memory.working_set",UAa="dotnet.thread_pool.queue.length",QAa="dotnet.thread_pool.thread.count",qAa="dotnet.thread_pool.work_item.count",jAa="dotnet.timer.count",HAa="http.client.request.duration",GAa="http.server.request.duration",$Aa="jvm.class.count",VAa="jvm.class.loaded",WAa="jvm.class.unloaded",zAa="jvm.cpu.count",YAa="jvm.cpu.recent_utilization",KAa="jvm.cpu.time",JAa="jvm.gc.duration",ZAa="jvm.memory.committed",XAa="jvm.memory.limit",eya="jvm.memory.used",tya="jvm.memory.used_after_last_gc",rya="jvm.thread.count",nya="kestrel.active_connections",iya="kestrel.active_tls_handshakes",oya="kestrel.connection.duration",sya="kestrel.queued_connections",aya="kestrel.queued_requests",cya="kestrel.rejected_connections",lya="kestrel.tls_handshake.duration",uya="kestrel.upgraded_connections",dya="signalr.server.active_connections",fya="signalr.server.connection.duration"});var pya,jAi=ve(()=>{p();pya="exception"});var TAr={};ki(TAr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Kma,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Jma,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Zma,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Xma,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>n0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>i0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>o0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>s0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>u0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>d0a,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Yma,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>e0a,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>t0a,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>r0a,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>a0a,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>c0a,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>l0a,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>f0a,ATTR_CLIENT_ADDRESS:()=>p0a,ATTR_CLIENT_PORT:()=>h0a,ATTR_CODE_COLUMN_NUMBER:()=>m0a,ATTR_CODE_FILE_PATH:()=>g0a,ATTR_CODE_FUNCTION_NAME:()=>A0a,ATTR_CODE_LINE_NUMBER:()=>y0a,ATTR_CODE_STACKTRACE:()=>E0a,ATTR_DB_COLLECTION_NAME:()=>_0a,ATTR_DB_NAMESPACE:()=>v0a,ATTR_DB_OPERATION_BATCH_SIZE:()=>C0a,ATTR_DB_OPERATION_NAME:()=>b0a,ATTR_DB_QUERY_SUMMARY:()=>S0a,ATTR_DB_QUERY_TEXT:()=>T0a,ATTR_DB_RESPONSE_STATUS_CODE:()=>I0a,ATTR_DB_STORED_PROCEDURE_NAME:()=>x0a,ATTR_DB_SYSTEM_NAME:()=>w0a,ATTR_DOTNET_GC_HEAP_GENERATION:()=>N0a,ATTR_ERROR_TYPE:()=>B0a,ATTR_EXCEPTION_ESCAPED:()=>U0a,ATTR_EXCEPTION_MESSAGE:()=>Q0a,ATTR_EXCEPTION_STACKTRACE:()=>q0a,ATTR_EXCEPTION_TYPE:()=>j0a,ATTR_HTTP_REQUEST_HEADER:()=>H0a,ATTR_HTTP_REQUEST_METHOD:()=>G0a,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>tga,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>rga,ATTR_HTTP_RESPONSE_HEADER:()=>nga,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>iga,ATTR_HTTP_ROUTE:()=>oga,ATTR_JVM_GC_ACTION:()=>sga,ATTR_JVM_GC_NAME:()=>aga,ATTR_JVM_MEMORY_POOL_NAME:()=>cga,ATTR_JVM_MEMORY_TYPE:()=>lga,ATTR_JVM_THREAD_DAEMON:()=>fga,ATTR_JVM_THREAD_STATE:()=>pga,ATTR_NETWORK_LOCAL_ADDRESS:()=>_ga,ATTR_NETWORK_LOCAL_PORT:()=>vga,ATTR_NETWORK_PEER_ADDRESS:()=>Cga,ATTR_NETWORK_PEER_PORT:()=>bga,ATTR_NETWORK_PROTOCOL_NAME:()=>Sga,ATTR_NETWORK_PROTOCOL_VERSION:()=>Tga,ATTR_NETWORK_TRANSPORT:()=>Iga,ATTR_NETWORK_TYPE:()=>Dga,ATTR_OTEL_SCOPE_NAME:()=>Oga,ATTR_OTEL_SCOPE_VERSION:()=>Lga,ATTR_OTEL_STATUS_CODE:()=>Bga,ATTR_OTEL_STATUS_DESCRIPTION:()=>Qga,ATTR_SERVER_ADDRESS:()=>qga,ATTR_SERVER_PORT:()=>jga,ATTR_SERVICE_NAME:()=>Hga,ATTR_SERVICE_VERSION:()=>Gga,ATTR_SIGNALR_CONNECTION_STATUS:()=>$ga,ATTR_SIGNALR_TRANSPORT:()=>Yga,ATTR_TELEMETRY_SDK_LANGUAGE:()=>vAr,ATTR_TELEMETRY_SDK_NAME:()=>bAr,ATTR_TELEMETRY_SDK_VERSION:()=>SAr,ATTR_URL_FRAGMENT:()=>uAa,ATTR_URL_FULL:()=>dAa,ATTR_URL_PATH:()=>fAa,ATTR_URL_QUERY:()=>pAa,ATTR_URL_SCHEME:()=>hAa,ATTR_USER_AGENT_ORIGINAL:()=>mAa,AWSECSLAUNCHTYPEVALUES_EC2:()=>mma,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>gma,AwsEcsLaunchtypeValues:()=>Ama,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Jha,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Zha,CLOUDPLATFORMVALUES_AWS_EC2:()=>Xha,CLOUDPLATFORMVALUES_AWS_ECS:()=>ema,CLOUDPLATFORMVALUES_AWS_EKS:()=>tma,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>nma,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>rma,CLOUDPLATFORMVALUES_AZURE_AKS:()=>sma,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>cma,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>oma,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>ama,CLOUDPLATFORMVALUES_AZURE_VM:()=>ima,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>pma,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>fma,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>uma,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>lma,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>dma,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Vha,CLOUDPROVIDERVALUES_AWS:()=>Wha,CLOUDPROVIDERVALUES_AZURE:()=>zha,CLOUDPROVIDERVALUES_GCP:()=>Yha,CloudPlatformValues:()=>hma,CloudProviderValues:()=>Kha,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>kda,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>Fda,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Pda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Bda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>Nda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Qda,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Mda,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>Dda,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>Uda,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>Lda,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>Oda,DBSYSTEMVALUES_ADABAS:()=>Xua,DBSYSTEMVALUES_CACHE:()=>Zua,DBSYSTEMVALUES_CASSANDRA:()=>gda,DBSYSTEMVALUES_CLOUDSCAPE:()=>Gua,DBSYSTEMVALUES_COCKROACHDB:()=>wda,DBSYSTEMVALUES_COLDFUSION:()=>mda,DBSYSTEMVALUES_COSMOSDB:()=>Cda,DBSYSTEMVALUES_COUCHBASE:()=>_da,DBSYSTEMVALUES_COUCHDB:()=>vda,DBSYSTEMVALUES_DB2:()=>Qua,DBSYSTEMVALUES_DERBY:()=>tda,DBSYSTEMVALUES_DYNAMODB:()=>bda,DBSYSTEMVALUES_EDB:()=>Jua,DBSYSTEMVALUES_ELASTICSEARCH:()=>Ida,DBSYSTEMVALUES_FILEMAKER:()=>rda,DBSYSTEMVALUES_FIREBIRD:()=>eda,DBSYSTEMVALUES_FIRSTSQL:()=>Kua,DBSYSTEMVALUES_GEODE:()=>Tda,DBSYSTEMVALUES_H2:()=>hda,DBSYSTEMVALUES_HANADB:()=>zua,DBSYSTEMVALUES_HBASE:()=>Ada,DBSYSTEMVALUES_HIVE:()=>Hua,DBSYSTEMVALUES_HSQLDB:()=>$ua,DBSYSTEMVALUES_INFORMIX:()=>nda,DBSYSTEMVALUES_INGRES:()=>Yua,DBSYSTEMVALUES_INSTANTDB:()=>ida,DBSYSTEMVALUES_INTERBASE:()=>oda,DBSYSTEMVALUES_MARIADB:()=>sda,DBSYSTEMVALUES_MAXDB:()=>Wua,DBSYSTEMVALUES_MEMCACHED:()=>xda,DBSYSTEMVALUES_MONGODB:()=>yda,DBSYSTEMVALUES_MSSQL:()=>Bua,DBSYSTEMVALUES_MYSQL:()=>Fua,DBSYSTEMVALUES_NEO4J:()=>Sda,DBSYSTEMVALUES_NETEZZA:()=>ada,DBSYSTEMVALUES_ORACLE:()=>Uua,DBSYSTEMVALUES_OTHER_SQL:()=>Lua,DBSYSTEMVALUES_PERVASIVE:()=>cda,DBSYSTEMVALUES_POINTBASE:()=>lda,DBSYSTEMVALUES_POSTGRESQL:()=>qua,DBSYSTEMVALUES_PROGRESS:()=>Vua,DBSYSTEMVALUES_REDIS:()=>Eda,DBSYSTEMVALUES_REDSHIFT:()=>jua,DBSYSTEMVALUES_SQLITE:()=>uda,DBSYSTEMVALUES_SYBASE:()=>dda,DBSYSTEMVALUES_TERADATA:()=>fda,DBSYSTEMVALUES_VERTICA:()=>pda,DB_SYSTEM_NAME_VALUE_MARIADB:()=>R0a,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>k0a,DB_SYSTEM_NAME_VALUE_MYSQL:()=>P0a,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>D0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>M0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>O0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>L0a,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>gup,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Aup,DbCassandraConsistencyLevelValues:()=>qda,DbSystemValues:()=>Rda,ERROR_TYPE_VALUE_OTHER:()=>F0a,EVENT_EXCEPTION:()=>pya,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Kda,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Yda,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>zda,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Zda,FAASINVOKEDPROVIDERVALUES_AWS:()=>Xda,FAASINVOKEDPROVIDERVALUES_AZURE:()=>efa,FAASINVOKEDPROVIDERVALUES_GCP:()=>tfa,FAASTRIGGERVALUES_DATASOURCE:()=>jda,FAASTRIGGERVALUES_HTTP:()=>Hda,FAASTRIGGERVALUES_OTHER:()=>Vda,FAASTRIGGERVALUES_PUBSUB:()=>Gda,FAASTRIGGERVALUES_TIMER:()=>$da,FaasDocumentOperationValues:()=>Jda,FaasInvokedProviderValues:()=>rfa,FaasTriggerValues:()=>Wda,HOSTARCHVALUES_AMD64:()=>yma,HOSTARCHVALUES_ARM32:()=>Ema,HOSTARCHVALUES_ARM64:()=>_ma,HOSTARCHVALUES_IA64:()=>vma,HOSTARCHVALUES_PPC32:()=>Cma,HOSTARCHVALUES_PPC64:()=>bma,HOSTARCHVALUES_X86:()=>Sma,HTTPFLAVORVALUES_HTTP_1_0:()=>Ufa,HTTPFLAVORVALUES_HTTP_1_1:()=>Qfa,HTTPFLAVORVALUES_HTTP_2_0:()=>qfa,HTTPFLAVORVALUES_QUIC:()=>Hfa,HTTPFLAVORVALUES_SPDY:()=>jfa,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>V0a,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>W0a,HTTP_REQUEST_METHOD_VALUE_GET:()=>z0a,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Y0a,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>K0a,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>$0a,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>J0a,HTTP_REQUEST_METHOD_VALUE_POST:()=>Z0a,HTTP_REQUEST_METHOD_VALUE_PUT:()=>X0a,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>ega,HostArchValues:()=>Tma,HttpFlavorValues:()=>Gfa,JVM_MEMORY_TYPE_VALUE_HEAP:()=>uga,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>dga,JVM_THREAD_STATE_VALUE_BLOCKED:()=>hga,JVM_THREAD_STATE_VALUE_NEW:()=>mga,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>gga,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Aga,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>yga,JVM_THREAD_STATE_VALUE_WAITING:()=>Ega,MESSAGETYPEVALUES_RECEIVED:()=>gpa,MESSAGETYPEVALUES_SENT:()=>mpa,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>$fa,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Vfa,MESSAGINGOPERATIONVALUES_PROCESS:()=>Yfa,MESSAGINGOPERATIONVALUES_RECEIVE:()=>zfa,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>gAa,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>AAa,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>yAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>vAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>_Aa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>EAa,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>CAa,METRIC_DB_CLIENT_OPERATION_DURATION:()=>bAa,METRIC_DOTNET_ASSEMBLY_COUNT:()=>SAa,METRIC_DOTNET_EXCEPTIONS:()=>TAa,METRIC_DOTNET_GC_COLLECTIONS:()=>IAa,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>xAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>wAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>RAa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>kAa,METRIC_DOTNET_GC_PAUSE_TIME:()=>PAa,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>DAa,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>NAa,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>MAa,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>OAa,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>LAa,METRIC_DOTNET_PROCESS_CPU_TIME:()=>BAa,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>FAa,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>UAa,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>QAa,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>qAa,METRIC_DOTNET_TIMER_COUNT:()=>jAa,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>HAa,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>GAa,METRIC_JVM_CLASS_COUNT:()=>$Aa,METRIC_JVM_CLASS_LOADED:()=>VAa,METRIC_JVM_CLASS_UNLOADED:()=>WAa,METRIC_JVM_CPU_COUNT:()=>zAa,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>YAa,METRIC_JVM_CPU_TIME:()=>KAa,METRIC_JVM_GC_DURATION:()=>JAa,METRIC_JVM_MEMORY_COMMITTED:()=>ZAa,METRIC_JVM_MEMORY_LIMIT:()=>XAa,METRIC_JVM_MEMORY_USED:()=>eya,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>tya,METRIC_JVM_THREAD_COUNT:()=>rya,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>nya,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>iya,METRIC_KESTREL_CONNECTION_DURATION:()=>oya,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>sya,METRIC_KESTREL_QUEUED_REQUESTS:()=>aya,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>cya,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>lya,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>uya,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>dya,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>fya,MessageTypeValues:()=>Apa,MessagingDestinationKindValues:()=>Wfa,MessagingOperationValues:()=>Kfa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>_fa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>bfa,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>yfa,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>kfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>vfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Cfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>wfa,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Afa,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>Dfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>Sfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Ifa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Pfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Tfa,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>xfa,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Mfa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>Rfa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Bfa,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>Ofa,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Lfa,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Nfa,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Efa,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>pfa,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>hfa,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>mfa,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>dfa,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>ffa,NETTRANSPORTVALUES_INPROC:()=>cfa,NETTRANSPORTVALUES_IP:()=>ofa,NETTRANSPORTVALUES_IP_TCP:()=>nfa,NETTRANSPORTVALUES_IP_UDP:()=>ifa,NETTRANSPORTVALUES_OTHER:()=>lfa,NETTRANSPORTVALUES_PIPE:()=>afa,NETTRANSPORTVALUES_UNIX:()=>sfa,NETWORK_TRANSPORT_VALUE_PIPE:()=>xga,NETWORK_TRANSPORT_VALUE_QUIC:()=>wga,NETWORK_TRANSPORT_VALUE_TCP:()=>Rga,NETWORK_TRANSPORT_VALUE_UDP:()=>kga,NETWORK_TRANSPORT_VALUE_UNIX:()=>Pga,NETWORK_TYPE_VALUE_IPV4:()=>Nga,NETWORK_TYPE_VALUE_IPV6:()=>Mga,NetHostConnectionSubtypeValues:()=>Ffa,NetHostConnectionTypeValues:()=>gfa,NetTransportValues:()=>ufa,OSTYPEVALUES_AIX:()=>Mma,OSTYPEVALUES_DARWIN:()=>wma,OSTYPEVALUES_DRAGONFLYBSD:()=>Dma,OSTYPEVALUES_FREEBSD:()=>Rma,OSTYPEVALUES_HPUX:()=>Nma,OSTYPEVALUES_LINUX:()=>xma,OSTYPEVALUES_NETBSD:()=>kma,OSTYPEVALUES_OPENBSD:()=>Pma,OSTYPEVALUES_SOLARIS:()=>Oma,OSTYPEVALUES_WINDOWS:()=>Ima,OSTYPEVALUES_Z_OS:()=>Lma,OTEL_STATUS_CODE_VALUE_ERROR:()=>Fga,OTEL_STATUS_CODE_VALUE_OK:()=>Uga,OsTypeValues:()=>Bma,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>apa,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>npa,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Zfa,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>fpa,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>tpa,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>spa,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>upa,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>epa,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>rpa,RPCGRPCSTATUSCODEVALUES_OK:()=>Jfa,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>cpa,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>ipa,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>opa,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>ppa,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>dpa,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>lpa,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Xfa,RpcGrpcStatusCodeValues:()=>hpa,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>Gla,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>rua,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>qla,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Bla,SEMATTRS_AWS_DYNAMODB_COUNT:()=>eua,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Yla,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Wla,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>nua,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>$la,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Fla,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Hla,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>zla,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>jla,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Ula,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Qla,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>tua,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Jla,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Zla,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Vla,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Kla,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Lla,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Xla,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>mca,SEMATTRS_CODE_FILEPATH:()=>Ela,SEMATTRS_CODE_FUNCTION:()=>Ala,SEMATTRS_CODE_LINENO:()=>_la,SEMATTRS_CODE_NAMESPACE:()=>yla,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Ica,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Pca,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>kca,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>wca,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Sca,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Tca,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Rca,SEMATTRS_DB_CASSANDRA_TABLE:()=>xca,SEMATTRS_DB_CONNECTION_STRING:()=>Aca,SEMATTRS_DB_HBASE_NAMESPACE:()=>Dca,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Eca,SEMATTRS_DB_MONGODB_COLLECTION:()=>Mca,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>bca,SEMATTRS_DB_NAME:()=>_ca,SEMATTRS_DB_OPERATION:()=>Cca,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>Nca,SEMATTRS_DB_SQL_TABLE:()=>Oca,SEMATTRS_DB_STATEMENT:()=>vca,SEMATTRS_DB_SYSTEM:()=>gca,SEMATTRS_DB_USER:()=>yca,SEMATTRS_ENDUSER_ID:()=>fla,SEMATTRS_ENDUSER_ROLE:()=>pla,SEMATTRS_ENDUSER_SCOPE:()=>hla,SEMATTRS_EXCEPTION_ESCAPED:()=>Uca,SEMATTRS_EXCEPTION_MESSAGE:()=>Bca,SEMATTRS_EXCEPTION_STACKTRACE:()=>Fca,SEMATTRS_EXCEPTION_TYPE:()=>Lca,SEMATTRS_FAAS_COLDSTART:()=>zca,SEMATTRS_FAAS_CRON:()=>Wca,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>jca,SEMATTRS_FAAS_DOCUMENT_NAME:()=>$ca,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Hca,SEMATTRS_FAAS_DOCUMENT_TIME:()=>Gca,SEMATTRS_FAAS_EXECUTION:()=>qca,SEMATTRS_FAAS_INVOKED_NAME:()=>Yca,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>Kca,SEMATTRS_FAAS_INVOKED_REGION:()=>Jca,SEMATTRS_FAAS_TIME:()=>Vca,SEMATTRS_FAAS_TRIGGER:()=>Qca,SEMATTRS_HTTP_CLIENT_IP:()=>Ola,SEMATTRS_HTTP_FLAVOR:()=>xla,SEMATTRS_HTTP_HOST:()=>Sla,SEMATTRS_HTTP_METHOD:()=>vla,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Rla,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>kla,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>Pla,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>Dla,SEMATTRS_HTTP_ROUTE:()=>Mla,SEMATTRS_HTTP_SCHEME:()=>Tla,SEMATTRS_HTTP_SERVER_NAME:()=>Nla,SEMATTRS_HTTP_STATUS_CODE:()=>Ila,SEMATTRS_HTTP_TARGET:()=>bla,SEMATTRS_HTTP_URL:()=>Cla,SEMATTRS_HTTP_USER_AGENT:()=>wla,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Nua,SEMATTRS_MESSAGE_ID:()=>Dua,SEMATTRS_MESSAGE_TYPE:()=>Pua,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Mua,SEMATTRS_MESSAGING_CONSUMER_ID:()=>gua,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>fua,SEMATTRS_MESSAGING_DESTINATION:()=>oua,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>sua,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>_ua,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Eua,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>yua,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>vua,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Cua,SEMATTRS_MESSAGING_MESSAGE_ID:()=>dua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>hua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>pua,SEMATTRS_MESSAGING_OPERATION:()=>mua,SEMATTRS_MESSAGING_PROTOCOL:()=>cua,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>lua,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Aua,SEMATTRS_MESSAGING_SYSTEM:()=>iua,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>aua,SEMATTRS_MESSAGING_URL:()=>uua,SEMATTRS_NET_HOST_CARRIER_ICC:()=>ula,SEMATTRS_NET_HOST_CARRIER_MCC:()=>cla,SEMATTRS_NET_HOST_CARRIER_MNC:()=>lla,SEMATTRS_NET_HOST_CARRIER_NAME:()=>ala,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>sla,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>ola,SEMATTRS_NET_HOST_IP:()=>rla,SEMATTRS_NET_HOST_NAME:()=>ila,SEMATTRS_NET_HOST_PORT:()=>nla,SEMATTRS_NET_PEER_IP:()=>Xca,SEMATTRS_NET_PEER_NAME:()=>tla,SEMATTRS_NET_PEER_PORT:()=>ela,SEMATTRS_NET_TRANSPORT:()=>Zca,SEMATTRS_PEER_SERVICE:()=>dla,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>Iua,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Rua,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>kua,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>wua,SEMATTRS_RPC_JSONRPC_VERSION:()=>xua,SEMATTRS_RPC_METHOD:()=>Tua,SEMATTRS_RPC_SERVICE:()=>Sua,SEMATTRS_RPC_SYSTEM:()=>bua,SEMATTRS_THREAD_ID:()=>mla,SEMATTRS_THREAD_NAME:()=>gla,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>Spa,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>bpa,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Tpa,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Ipa,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>xpa,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>wpa,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Rpa,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Ppa,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>kpa,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Npa,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>Dpa,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Epa,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>vpa,SEMRESATTRS_CLOUD_PLATFORM:()=>Cpa,SEMRESATTRS_CLOUD_PROVIDER:()=>ypa,SEMRESATTRS_CLOUD_REGION:()=>_pa,SEMRESATTRS_CONTAINER_ID:()=>Opa,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Bpa,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Fpa,SEMRESATTRS_CONTAINER_NAME:()=>Mpa,SEMRESATTRS_CONTAINER_RUNTIME:()=>Lpa,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Upa,SEMRESATTRS_DEVICE_ID:()=>Qpa,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>qpa,SEMRESATTRS_DEVICE_MODEL_NAME:()=>jpa,SEMRESATTRS_FAAS_ID:()=>Gpa,SEMRESATTRS_FAAS_INSTANCE:()=>Vpa,SEMRESATTRS_FAAS_MAX_MEMORY:()=>Wpa,SEMRESATTRS_FAAS_NAME:()=>Hpa,SEMRESATTRS_FAAS_VERSION:()=>$pa,SEMRESATTRS_HOST_ARCH:()=>Jpa,SEMRESATTRS_HOST_ID:()=>zpa,SEMRESATTRS_HOST_IMAGE_ID:()=>Xpa,SEMRESATTRS_HOST_IMAGE_NAME:()=>Zpa,SEMRESATTRS_HOST_IMAGE_VERSION:()=>eha,SEMRESATTRS_HOST_NAME:()=>Ypa,SEMRESATTRS_HOST_TYPE:()=>Kpa,SEMRESATTRS_K8S_CLUSTER_NAME:()=>tha,SEMRESATTRS_K8S_CONTAINER_NAME:()=>aha,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Eha,SEMRESATTRS_K8S_CRONJOB_UID:()=>yha,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>mha,SEMRESATTRS_K8S_DAEMONSET_UID:()=>hha,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>dha,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>uha,SEMRESATTRS_K8S_JOB_NAME:()=>Aha,SEMRESATTRS_K8S_JOB_UID:()=>gha,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>iha,SEMRESATTRS_K8S_NODE_NAME:()=>rha,SEMRESATTRS_K8S_NODE_UID:()=>nha,SEMRESATTRS_K8S_POD_NAME:()=>sha,SEMRESATTRS_K8S_POD_UID:()=>oha,SEMRESATTRS_K8S_REPLICASET_NAME:()=>lha,SEMRESATTRS_K8S_REPLICASET_UID:()=>cha,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>pha,SEMRESATTRS_K8S_STATEFULSET_UID:()=>fha,SEMRESATTRS_OS_DESCRIPTION:()=>vha,SEMRESATTRS_OS_NAME:()=>Cha,SEMRESATTRS_OS_TYPE:()=>_ha,SEMRESATTRS_OS_VERSION:()=>bha,SEMRESATTRS_PROCESS_COMMAND:()=>xha,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Rha,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>wha,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Tha,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Iha,SEMRESATTRS_PROCESS_OWNER:()=>kha,SEMRESATTRS_PROCESS_PID:()=>Sha,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Nha,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Pha,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>Dha,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Lha,SEMRESATTRS_SERVICE_NAME:()=>Mha,SEMRESATTRS_SERVICE_NAMESPACE:()=>Oha,SEMRESATTRS_SERVICE_VERSION:()=>Bha,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>qha,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Uha,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Fha,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Qha,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Gha,SEMRESATTRS_WEBENGINE_NAME:()=>jha,SEMRESATTRS_WEBENGINE_VERSION:()=>Hha,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Vga,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Wga,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>zga,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Kga,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Jga,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Zga,SemanticAttributes:()=>Oua,SemanticResourceAttributes:()=>$ha,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Fma,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Uma,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Qma,TELEMETRYSDKLANGUAGEVALUES_GO:()=>qma,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>jma,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Hma,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Gma,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>$ma,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Vma,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Wma,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>Xga,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>eAa,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>tAa,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>rAa,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>nAa,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>CAr,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>iAa,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>oAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>sAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>aAa,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>cAa,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>lAa,TelemetrySdkLanguageValues:()=>zma});var yht=ve(()=>{p();p0i();UAi();QAi();qAi();jAi()});var HAi,GAi=ve(()=>{p();HAi="process.runtime.name"});var Eht,$Ai=ve(()=>{p();Cdi();yht();GAi();Eht={[bAr]:"opentelemetry",[HAi]:"node",[vAr]:CAr,[SAr]:vdi}});var VAi=ve(()=>{p();Adi();ydi();_di();$Ai()});var IAr=ve(()=>{p();VAi()});function _0e(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*mya);return[r,n]}function vht(){let t=sG.timeOrigin;if(typeof t!="number"){let e=sG;t=e.timing&&e.timing.fetchStart}return t}function xAr(t){let e=_0e(vht()),r=_0e(typeof t=="number"?t:sG.now());return wAr(e,r)}function zAi(t){if(Cht(t))return t;if(typeof t=="number")return t=_ht&&(r[1]-=_ht,r[0]+=1),r}var WAi,hya,mya,_ht,tyi=ve(()=>{p();IAr();WAi=9,hya=6,mya=Math.pow(10,hya),_ht=Math.pow(10,WAi);a(_0e,"millisToHrTime");a(vht,"getTimeOrigin");a(xAr,"hrTime");a(zAi,"timeInputToHrTime");a(YAi,"hrTimeDuration");a(KAi,"hrTimeToTimeStamp");a(JAi,"hrTimeToNanoseconds");a(ZAi,"hrTimeToMilliseconds");a(XAi,"hrTimeToMicroseconds");a(Cht,"isTimeInputHrTime");a(eyi,"isTimeInput");a(wAr,"addHrTimes")});function ryi(t){typeof t!="number"&&t.unref()}var nyi=ve(()=>{p();a(ryi,"unrefTimer")});var bht,iyi=ve(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(bht||(bht={}))});var Sht,oyi=ve(()=>{p();co();Sht=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){Dn.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){Dn.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function syi(t){return yya.test(t)}function ayi(t){return Eya.test(t)&&!_ya.test(t)}var RAr,gya,Aya,yya,Eya,_ya,cyi=ve(()=>{p();RAr="[_0-9a-z-*/]",gya=`[a-z]${RAr}{0,255}`,Aya=`[a-z0-9]${RAr}{0,240}@[a-z]${RAr}{0,13}`,yya=new RegExp(`^(?:${gya}|${Aya})$`),Eya=/^[ -~]{0,255}[!-~]$/,_ya=/,|=/;a(syi,"validateKey");a(ayi,"validateValue")});var lyi,vya,uyi,dyi,v0e,kAr=ve(()=>{p();cyi();lyi=32,vya=512,uyi=",",dyi="=",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+dyi+this.get(r)),e),[]).join(uyi)}_parse(e){e.length>vya||(this._internalState=e.split(uyi).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(dyi);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);syi(c)&&ayi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>lyi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,lyi))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function PAr(t){let e=xya.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var tOe,rOe,Cya,bya,Sya,Tya,Iya,xya,Tht,fyi=ve(()=>{p();co();XMe();kAr();tOe="traceparent",rOe="tracestate",Cya="00",bya="(?!ff)[\\da-f]{2}",Sya="(?![0]{32})[\\da-f]{32}",Tya="(?![0]{16})[\\da-f]{16}",Iya="[\\da-f]{2}",xya=new RegExp(`^\\s?(${bya})-(${Sya})-(${Tya})-(${Iya})(-.*)?\\s?$`);a(PAr,"parseTraceParent");Tht=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=wu.getSpanContext(e);if(!o||E0e(e)||!vb(o))return;let s=`${Cya}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||wf.NONE).toString(16)}`;n.set(r,tOe,s),o.traceState&&n.set(r,rOe,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,tOe);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=PAr(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,rOe);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new v0e(typeof u=="string"?u:void 0)}return wu.setSpanContext(e,c)}fields(){return[tOe,rOe]}}});function pyi(t,e){return t.setValue(DAr,e)}function hyi(t){return t.deleteValue(DAr)}function myi(t){return t.getValue(DAr)}var DAr,Iht,gyi=ve(()=>{p();co();DAr=_b("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(Iht||(Iht={}));a(pyi,"setRPCMetadata");a(hyi,"deleteRPCMetadata");a(myi,"getRPCMetadata")});function NAr(t){if(!Mya(t)||Oya(t)!==wya)return!1;let e=Nya(t);if(e===null)return!0;let r=Eyi.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Ayi.call(r)===Dya}function Mya(t){return t!=null&&typeof t=="object"}function Oya(t){return t==null?t===void 0?kya:Rya:Pee&&Pee in Object(t)?Lya(t):Bya(t)}function Lya(t){let e=Eyi.call(t,Pee),r=t[Pee],n=!1;try{t[Pee]=void 0,n=!0}catch{}let o=_yi.call(t);return n&&(e?t[Pee]=r:delete t[Pee]),o}function Bya(t){return _yi.call(t)}var wya,Rya,kya,Pya,Ayi,Dya,Nya,yyi,Eyi,Pee,_yi,vyi=ve(()=>{p();wya="[object Object]",Rya="[object Null]",kya="[object Undefined]",Pya=Function.prototype,Ayi=Pya.toString,Dya=Ayi.call(Object),Nya=Object.getPrototypeOf,yyi=Object.prototype,Eyi=yyi.hasOwnProperty,Pee=Symbol?Symbol.toStringTag:void 0,_yi=yyi.toString;a(NAr,"isPlainObject");a(Mya,"isObjectLike");a(Oya,"baseGetTag");a(Lya,"getRawTag");a(Bya,"objectToString")});function byi(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=Syi(e,t.shift(),0,r);return e}function MAr(t){return wht(t)?t.slice():t}function Syi(t,e,r=0,n){let o;if(!(r>Fya)){if(r++,xht(t)||xht(e)||Tyi(e))o=MAr(e);else if(wht(t)){if(o=t.slice(),wht(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(Cyi(t,u,n)||Cyi(e,u,n))delete o[u];else{if(nOe(f)&&nOe(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]=Syi(o[u],d,r,n)}}}}else o=e;return o}}function Cyi(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 Uya(t,e){return!(!NAr(t)||!NAr(e))}var Fya,Iyi=ve(()=>{p();vyi();Fya=20;a(byi,"merge");a(MAr,"takeValue");a(Syi,"mergeTwoObjects");a(Cyi,"wasObjectReferenced");a(wht,"isArray");a(Tyi,"isFunction");a(nOe,"isObject");a(xht,"isPrimitive");a(Uya,"shouldMerge")});function xyi(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new iOe("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var iOe,wyi=ve(()=>{p();iOe=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(xyi,"callWithTimeout")});function OAr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function Ryi(t,e){if(!e)return!1;for(let r of e)if(OAr(t,r))return!0;return!1}var kyi=ve(()=>{p();a(OAr,"urlMatches");a(Ryi,"isUrlIgnored")});var Rht,Pyi=ve(()=>{p();Rht=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 kht,Dyi=ve(()=>{p();Pyi();kht=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new Rht;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 Myi(t){if(t==null)return;let e=Nyi[t.toUpperCase()];return e??(Dn.warn(`Unknown log level "${t}", expected one of ${Object.keys(Nyi)}, using default`),Da.INFO)}var Nyi,Oyi=ve(()=>{p();co();Nyi={ALL:Da.ALL,VERBOSE:Da.VERBOSE,DEBUG:Da.DEBUG,INFO:Da.INFO,WARN:Da.WARN,ERROR:Da.ERROR,NONE:Da.NONE};a(Myi,"diagLogLevelFromString")});function Lyi(t,e){return new Promise(r=>{Og.with(cht(Og.active()),()=>{t.export(e,n=>{r(n)})})})}var Byi=ve(()=>{p();co();XMe();a(Lyi,"_export")});var Pht={};ki(Pht,{AnchoredClock:()=>fht,BindOnceFuture:()=>kht,CompositePropagator:()=>Sht,ExportResultCode:()=>bht,RPCType:()=>Iht,SDK_INFO:()=>Eht,TRACE_PARENT_HEADER:()=>tOe,TRACE_STATE_HEADER:()=>rOe,TimeoutError:()=>iOe,TraceState:()=>v0e,W3CBaggagePropagator:()=>dht,W3CTraceContextPropagator:()=>Tht,_globalThis:()=>Aht,addHrTimes:()=>wAr,callWithTimeout:()=>xyi,deleteRPCMetadata:()=>hyi,diagLogLevelFromString:()=>Myi,getBooleanFromEnv:()=>mht,getNumberFromEnv:()=>hht,getRPCMetadata:()=>myi,getStringFromEnv:()=>eOe,getStringListFromEnv:()=>ght,getTimeOrigin:()=>vht,globalErrorHandler:()=>mdi,hrTime:()=>xAr,hrTimeDuration:()=>YAi,hrTimeToMicroseconds:()=>XAi,hrTimeToMilliseconds:()=>ZAi,hrTimeToNanoseconds:()=>JAi,hrTimeToTimeStamp:()=>KAi,internal:()=>Qya,isAttributeValue:()=>AAr,isTimeInput:()=>eyi,isTimeInputHrTime:()=>Cht,isTracingSuppressed:()=>E0e,isUrlIgnored:()=>Ryi,loggingErrorHandler:()=>pht,merge:()=>byi,millisToHrTime:()=>_0e,otperformance:()=>sG,parseKeyPairsIntoRecord:()=>adi,parseTraceParent:()=>PAr,sanitizeAttributes:()=>udi,setGlobalErrorHandler:()=>hdi,setRPCMetadata:()=>pyi,suppressTracing:()=>cht,timeInputToHrTime:()=>zAi,unrefTimer:()=>ryi,unsuppressTracing:()=>rdi,urlMatches:()=>OAr});var Qya,Dht=ve(()=>{p();cdi();ldi();fdi();gdi();yAr();tyi();nyi();iyi();gAr();IAr();oyi();fyi();gyi();XMe();kAr();Iyi();wyi();kyi();Dyi();Oyi();Byi();Qya={_export:Lyi}});var Qyi=I(Nht=>{"use strict";p();Object.defineProperty(Nht,"__esModule",{value:!0});Nht.OpenTelemetrySpanWrapper=void 0;var Fyi=(co(),ba(V5)),Uyi=(Dht(),ba(Pht)),qya=pAr(),LAr=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&jya(e.error)?e.error?(this._span.setStatus({code:Fyi.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:Fyi.SpanStatusCode.ERROR}):e.status==="success"&&qya.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,Uyi.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,Uyi.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};Nht.OpenTelemetrySpanWrapper=LAr;function jya(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(jya,"isRecordableError")});var BAr=I(S4=>{"use strict";p();Object.defineProperty(S4,"__esModule",{value:!0});S4.environmentCache=S4.SDK_VERSION=void 0;S4.envVarToBoolean=Hya;S4.SDK_VERSION="1.0.0-beta.9";S4.environmentCache=new Map;function Hya(t){var e;S4.environmentCache.has(t)||Gya(t);let r=((e=S4.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(Hya,"envVarToBoolean");function Gya(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];S4.environmentCache.set(t,r)}}a(Gya,"loadEnvironmentVariable")});var Gyi=I(Mht=>{"use strict";p();Object.defineProperty(Mht,"__esModule",{value:!0});Mht.toOpenTelemetrySpanKind=Hyi;Mht.toSpanOptions=Vya;var qyi=(co(),ba(V5)),jyi=(Dht(),ba(Pht));function Hyi(t){let e=(t||"internal").toUpperCase();return qyi.SpanKind[e]}a(Hyi,"toOpenTelemetrySpanKind");function $ya(t=[]){return t.reduce((e,r)=>{let n=qyi.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,jyi.sanitizeAttributes)(r.attributes)}),e},[])}a($ya,"toOpenTelemetryLinks");function Vya(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,jyi.sanitizeAttributes)(e),s=Hyi(n),c=$ya(r);return{attributes:o,kind:s,links:c}}a(Vya,"toSpanOptions")});var Wyi=I(aG=>{"use strict";p();Object.defineProperty(aG,"__esModule",{value:!0});aG.OpenTelemetryInstrumenter=aG.propagator=void 0;var T4=(co(),ba(V5)),Vyi=(Dht(),ba(Pht)),Wya=Qyi(),$yi=BAr(),zya=Gyi();aG.propagator=new Vyi.W3CTraceContextPropagator;var FAr=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||T4.context.active(),o;return(0,$yi.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=T4.trace.wrapSpanContext(T4.INVALID_SPAN_CONTEXT):(o=T4.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,zya.toSpanOptions)(r),n),(0,$yi.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,Vyi.suppressTracing)(n))),{span:new Wya.OpenTelemetrySpanWrapper(o),tracingContext:T4.trace.setSpan(n,o)}}withContext(e,r,...n){return T4.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return aG.propagator.extract(T4.context.active(),{traceparent:e},T4.defaultTextMapGetter)}createRequestHeaders(e){let r={};return aG.propagator.inject(e||T4.context.active(),r,T4.defaultTextMapSetter),r}};aG.OpenTelemetryInstrumenter=FAr});var Yyi=I(oOe=>{"use strict";p();Object.defineProperty(oOe,"__esModule",{value:!0});oOe.AzureSdkInstrumentation=void 0;oOe.createAzureSdkInstrumentation=Jya;var zyi=(oAr(),ba(iAr)),Yya=Wyi(),Kya=BAr(),Oht=class extends zyi.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",Kya.SDK_VERSION,Object.assign({},e))}init(){let e=new zyi.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new Yya.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};oOe.AzureSdkInstrumentation=Oht;function Jya(t={}){return new Oht(t)}a(Jya,"createAzureSdkInstrumentation")});var Jyi=I(Lht=>{"use strict";p();Object.defineProperty(Lht,"__esModule",{value:!0});var Kyi=(m3(),ba(iQ));Kyi.__exportStar(pAr(),Lht);Kyi.__exportStar(Yyi(),Lht)});var Xyi=I(hR=>{"use strict";p();Object.defineProperty(hR,"__esModule",{value:!0});hR.enable=hR.azureCoreTracing=hR.AzureMonitorSymbol=void 0;var UAr=Cp();hR.AzureMonitorSymbol="Azure_Monitor_Tracer";var QAr="azure-coretracing",Zyi=!1,Zya=a(function(t){if(Zyi)return t;try{var e=(Xci(),ba(Zci)),r=(co(),ba(V5)),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 E=y.apply(this,arguments);return UAr.channel.publish(QAr,A),E},A},d[hR.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[hR.AzureMonitorSymbol]){var A=g.startSpan;g.startSpan=function(y,E,_){var v=A.call(this,y,E,_),b=v.end;return v.end=function(){var T=b.apply(this,arguments);return UAr.channel.publish(QAr,v),T},v},g[hR.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(oAr(),ba(iAr)),u=Jyi();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}Zyi=!0}catch{}return t},"azureCoreTracingPatchFunction");hR.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:Zya,publisherName:QAr};function Xya(){UAr.channel.registerMonkeyPatch("@azure/core-tracing",hR.azureCoreTracing)}a(Xya,"enable");hR.enable=Xya});var tEi=I(Dee=>{"use strict";p();Object.defineProperty(Dee,"__esModule",{value:!0});Dee.enable=Dee.bunyan=void 0;var eEi=Cp(),eEa=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)),eEi.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");Dee.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:eEa};function tEa(){eEi.channel.registerMonkeyPatch("bunyan",Dee.bunyan)}a(tEa,"enable");Dee.enable=tEa});var nEi=I(Nee=>{"use strict";p();Object.defineProperty(Nee,"__esModule",{value:!0});Nee.enable=Nee.console=void 0;var qAr=Cp(),rEi=require("stream"),rEa=a(function(t){var e=new rEi.Writable,r=new rEi.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return qAr.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return qAr.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:rEa};function nEa(){qAr.channel.registerMonkeyPatch("console",Nee.console),require("console")}a(nEa,"enable");Nee.enable=nEa});var iEi=I(Mee=>{"use strict";p();Object.defineProperty(Mee,"__esModule",{value:!0});Mee.enable=Mee.mongoCore=void 0;var jAr=Cp(),iEa=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]=jAr.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]=jAr.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");Mee.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:iEa};function oEa(){jAr.channel.registerMonkeyPatch("mongodb-core",Mee.mongoCore)}a(oEa,"enable");Mee.enable=oEa});var oEi=I(Cv=>{"use strict";p();var C0e=Cv&&Cv.__assign||function(){return C0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:sEa};Cv.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:aEa};Cv.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:lEa};function uEa(){NE.channel.registerMonkeyPatch("mongodb",Cv.mongo2),NE.channel.registerMonkeyPatch("mongodb",Cv.mongo3),NE.channel.registerMonkeyPatch("mongodb",Cv.mongo330)}a(uEa,"enable");Cv.enable=uEa});var aEi=I(Oee=>{"use strict";p();Object.defineProperty(Oee,"__esModule",{value:!0});Oee.enable=Oee.mysql=void 0;var Bht=Cp(),sEi=require("path"),dEa=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 E=arguments[A],_={result:null,startTime:null,startDate:null};typeof E=="function"&&(h?(_.startTime=process.hrtime(),_.startDate=new Date,arguments[A]=Bht.channel.bindToContext(h(_,E))):arguments[A]=Bht.channel.bindToContext(E));var v=m.apply(this,arguments);return _.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(sEi.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;Bht.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(sEi.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");Oee.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:dEa};function fEa(){Bht.channel.registerMonkeyPatch("mysql",Oee.mysql)}a(fEa,"enable");Oee.enable=fEa});var lEi=I(Lee=>{"use strict";p();Object.defineProperty(Lee,"__esModule",{value:!0});Lee.enable=Lee.postgresPool1=void 0;var cEi=Cp();function pEa(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=cEi.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(pEa,"postgresPool1PatchFunction");Lee.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:pEa};function hEa(){cEi.channel.registerMonkeyPatch("pg-pool",Lee.postgresPool1)}a(hEa,"enable");Lee.enable=hEa});var dEi=I(I4=>{"use strict";p();Object.defineProperty(I4,"__esModule",{value:!0});I4.enable=I4.postgres=I4.postgres6=void 0;var b0e=Cp(),uEi=require("events"),HAr="postgres";function mEa(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=b0e.channel.bindToContext(function(A,y){var E=process.hrtime(d);if(u.result=y&&{rowCount:y.rowCount,command:y.command},u.error=A,u.duration=Math.ceil(E[0]*1e3+E[1]/1e6),b0e.channel.publish(HAr,u),A){if(m)return m.apply(this,arguments);f&&f instanceof uEi.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(mEa,"postgres6PatchFunction");function gEa(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 b=b0e.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),b0e.channel.publish(HAr,m),T){if(v)return v.apply(this,arguments);g&&g instanceof uEi.EventEmitter&&g.emit("error",T)}else v&&v.apply(this,arguments)});try{return Object.defineProperty(b,n,{value:v}),b}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(b,T){b(v)})}).catch(function(v){return y()(v,void 0),new u._Promise(function(b,T){T(v)})});var E=g.text?g.text:"";if(g.cursor&&(E=(f=g.cursor)===null||f===void 0?void 0:f.text),E){var _={command:E,rowCount:0};y()(void 0,_)}}return g},"query"),t}a(gEa,"postgresLatestPatchFunction");I4.postgres6={versionSpecifier:"6.*",patch:mEa};I4.postgres={versionSpecifier:">=7.* <=8.*",patch:gEa,publisherName:HAr};function AEa(){b0e.channel.registerMonkeyPatch("pg",I4.postgres6),b0e.channel.registerMonkeyPatch("pg",I4.postgres)}a(AEa,"enable");I4.enable=AEa});var fEi=I(Bee=>{"use strict";p();Object.defineProperty(Bee,"__esModule",{value:!0});Bee.enable=Bee.redis=void 0;var GAr=Cp(),yEa=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=GAr.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;GAr.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");Bee.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:yEa};function EEa(){GAr.channel.registerMonkeyPatch("redis",Bee.redis)}a(EEa,"enable");Bee.enable=EEa});var pEi=I(O8=>{"use strict";p();var Fht=O8&&O8.__assign||function(){return Fht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:_Ea};function vEa(){$Ar.channel.registerMonkeyPatch("tedious",O8.tedious)}a(vEa,"enable");O8.enable=vEa});var hEi=I(qb=>{"use strict";p();var CEa=qb&&qb.__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)}})(),bEa=qb&&qb.__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");qb.winston3={versionSpecifier:"3.x",patch:TEa};qb.winston2={versionSpecifier:"2.x",patch:SEa};function IEa(){Uht.channel.registerMonkeyPatch("winston",qb.winston2),Uht.channel.registerMonkeyPatch("winston",qb.winston3)}a(IEa,"enable");qb.enable=IEa});var IEi=I(ku=>{"use strict";p();Object.defineProperty(ku,"__esModule",{value:!0});ku.enable=ku.tedious=ku.pgPool=ku.pg=ku.winston=ku.redis=ku.mysql=ku.mongodb=ku.mongodbCore=ku.console=ku.bunyan=ku.azuresdk=void 0;var mEi=Xyi();ku.azuresdk=mEi;var gEi=tEi();ku.bunyan=gEi;var AEi=nEi();ku.console=AEi;var yEi=iEi();ku.mongodbCore=yEi;var EEi=oEi();ku.mongodb=EEi;var _Ei=aEi();ku.mysql=_Ei;var vEi=lEi();ku.pgPool=vEi;var CEi=dEi();ku.pg=CEi;var bEi=fEi();ku.redis=bEi;var SEi=pEi();ku.tedious=SEi;var TEi=hEi();ku.winston=TEi;function xEa(){gEi.enable(),AEi.enable(),yEi.enable(),EEi.enable(),_Ei.enable(),CEi.enable(),vEi.enable(),bEi.enable(),TEi.enable(),mEi.enable(),SEi.enable()}a(xEa,"enable");ku.enable=xEa});var jht=I(Fee=>{"use strict";p();Object.defineProperty(Fee,"__esModule",{value:!0});Fee.IsInitialized=void 0;Fee.registerContextPreservation=wEa;var VAr=Kl(),wEi=tpt();Fee.IsInitialized=!wEi.JsonConfig.getInstance().noDiagnosticChannel;var WAr="DiagnosticChannel";if(Fee.IsInitialized){nD=IEi(),xEi=wEi.JsonConfig.getInstance().noPatchModules,Qht=xEi.split(","),zAr={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(qht in zAr)Qht.indexOf(qht)===-1&&(zAr[qht].enable(),VAr.info(WAr,"Subscribed to ".concat(qht," events")));Qht.length>0&&VAr.info(WAr,"Some modules will not be patched",Qht)}else VAr.info(WAr,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var nD,xEi,Qht,zAr,qht;function wEa(t){if(Fee.IsInitialized){var e=Cp();e.channel.addContextPreservation(t)}}a(wEa,"registerContextPreservation")});var S0e=I((Cpp,REi)=>{"use strict";p();REi.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 ay=I((JAr,kEi)=>{"use strict";p();var lG=JAr&&JAr.__assign||function(){return lG=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"){Uee.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"){Uee.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+")",Uee.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 ZAr=ay(),DEa=(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"|"+ZAr.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=ZAr.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=ZAr.randomu32(),t})();PEi.exports=DEa});var Hht=I((Rpp,DEi)=>{"use strict";p();var cy=ay(),NEa=Qee(),MEa=(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=cy.w3cTraceId(),this.spanId=cy.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=cy.w3cTraceId(),this.spanId=cy.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=cy.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=cy.w3cTraceId(),this.spanId=cy.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=cy.w3cTraceId(),this.spanId=cy.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=cy.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=cy.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=cy.w3cTraceId().substr(0,16),this.traceId=cy.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=NEa.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=cy.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=cy.w3cTraceId(),this.spanId=cy.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=cy.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();DEi.exports=MEa});var XAr=I((Dpp,NEi)=>{"use strict";p();var OEa=(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 LEa=(function(){function t(){}return a(t,"Domain"),t})();MEi.exports=LEa});var LEi=I((eyr,OEi)=>{"use strict";p();var BEa=eyr&&eyr.__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)}})(),FEa=L8(),UEa=(function(t){BEa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(FEa);OEi.exports=UEa});var tyr=I((Qpp,BEi)=>{"use strict";p();var QEa=(function(){function t(){}return a(t,"Base"),t})();BEi.exports=QEa});var UEi=I((Hpp,FEi)=>{"use strict";p();var qEa=(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})();FEi.exports=qEa});var qEi=I((ryr,QEi)=>{"use strict";p();var jEa=ryr&&ryr.__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)}})(),HEa=tyr(),GEa=(function(t){jEa(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(HEa);QEi.exports=GEa});var iyr=I((zpp,jEi)=>{"use strict";p();var nyr;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(nyr||(nyr={}));jEi.exports=nyr});var GEi=I((Kpp,HEi)=>{"use strict";p();var $Ea=iyr(),VEa=(function(){function t(){this.kind=$Ea.Measurement}return a(t,"DataPoint"),t})();HEi.exports=VEa});var VEi=I((Xpp,$Ei)=>{"use strict";p();var WEa=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();$Ei.exports=WEa});var syr=I((oyr,WEi)=>{"use strict";p();var zEa=oyr&&oyr.__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)}})(),YEa=L8(),KEa=(function(t){zEa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(YEa);WEi.exports=KEa});var YEi=I((ayr,zEi)=>{"use strict";p();var JEa=ayr&&ayr.__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)}})(),ZEa=L8(),XEa=(function(t){JEa(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})(ZEa);zEi.exports=XEa});var JEi=I((shp,KEi)=>{"use strict";p();var e_a=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();KEi.exports=e_a});var XEi=I((cyr,ZEi)=>{"use strict";p();var t_a=cyr&&cyr.__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)}})(),r_a=L8(),n_a=(function(t){t_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(r_a);ZEi.exports=n_a});var t_i=I((lyr,e_i)=>{"use strict";p();var i_a=lyr&&lyr.__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)}})(),o_a=L8(),s_a=(function(t){i_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(o_a);e_i.exports=s_a});var n_i=I((uyr,r_i)=>{"use strict";p();var a_a=uyr&&uyr.__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)}})(),c_a=syr(),l_a=(function(t){a_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(c_a);r_i.exports=l_a});var o_i=I((dyr,i_i)=>{"use strict";p();var u_a=dyr&&dyr.__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)}})(),d_a=L8(),f_a=(function(t){u_a(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})(d_a);i_i.exports=f_a});var a_i=I((fyr,s_i)=>{"use strict";p();var p_a=fyr&&fyr.__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)}})(),h_a=L8(),m_a=(function(t){p_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(h_a);s_i.exports=m_a});var l_i=I((Ehp,c_i)=>{"use strict";p();var pyr;(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"})(pyr||(pyr={}));c_i.exports=pyr});var d_i=I((vhp,u_i)=>{"use strict";p();var g_a=(function(){function t(){}return a(t,"StackFrame"),t})();u_i.exports=g_a});var hyr=I(ym=>{"use strict";p();Object.defineProperty(ym,"__esModule",{value:!0});ym.AvailabilityData=LEi();ym.Base=tyr();ym.ContextTagKeys=UEi();ym.Data=qEi();ym.DataPoint=GEi();ym.DataPointType=iyr();ym.Domain=L8();ym.Envelope=VEi();ym.EventData=syr();ym.ExceptionData=YEi();ym.ExceptionDetails=JEi();ym.MessageData=XEi();ym.MetricData=t_i();ym.PageViewData=n_i();ym.RemoteDependencyData=o_i();ym.RequestData=a_i();ym.SeverityLevel=l_i();ym.StackFrame=d_i()});var f_i=I(sOe=>{"use strict";p();Object.defineProperty(sOe,"__esModule",{value:!0});sOe.RemoteDependencyDataConstants=void 0;sOe.domainSupportsProperties=y_a;var qee=hyr(),A_a=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();sOe.RemoteDependencyDataConstants=A_a;function y_a(t){return"properties"in t||t instanceof qee.EventData||t instanceof qee.ExceptionData||t instanceof qee.MessageData||t instanceof qee.MetricData||t instanceof qee.PageViewData||t instanceof qee.RemoteDependencyData||t instanceof qee.RequestData}a(y_a,"domainSupportsProperties")});var h_i=I(p_i=>{"use strict";p();Object.defineProperty(p_i,"__esModule",{value:!0})});var g_i=I(m_i=>{"use strict";p();Object.defineProperty(m_i,"__esModule",{value:!0})});var y_i=I(A_i=>{"use strict";p();Object.defineProperty(A_i,"__esModule",{value:!0})});var __i=I(E_i=>{"use strict";p();Object.defineProperty(E_i,"__esModule",{value:!0})});var C_i=I(v_i=>{"use strict";p();Object.defineProperty(v_i,"__esModule",{value:!0})});var S_i=I(b_i=>{"use strict";p();Object.defineProperty(b_i,"__esModule",{value:!0})});var I_i=I(T_i=>{"use strict";p();Object.defineProperty(T_i,"__esModule",{value:!0})});var w_i=I(x_i=>{"use strict";p();Object.defineProperty(x_i,"__esModule",{value:!0})});var k_i=I(R_i=>{"use strict";p();Object.defineProperty(R_i,"__esModule",{value:!0})});var D_i=I(P_i=>{"use strict";p();Object.defineProperty(P_i,"__esModule",{value:!0})});var M_i=I(N_i=>{"use strict";p();Object.defineProperty(N_i,"__esModule",{value:!0})});var L_i=I(O_i=>{"use strict";p();Object.defineProperty(O_i,"__esModule",{value:!0})});var B_i=I(uG=>{"use strict";p();Object.defineProperty(uG,"__esModule",{value:!0});uG.TelemetryType=uG.TelemetryTypeString=void 0;uG.telemetryTypeToBaseType=E_a;uG.baseTypeToTelemetryType=__a;function E_a(t){switch(t){case Hg.Event:return"EventData";case Hg.Exception:return"ExceptionData";case Hg.Trace:return"MessageData";case Hg.Metric:return"MetricData";case Hg.Request:return"RequestData";case Hg.Dependency:return"RemoteDependencyData";case Hg.Availability:return"AvailabilityData";case Hg.PageView:return"PageViewData"}}a(E_a,"telemetryTypeToBaseType");function __a(t){switch(t){case"EventData":return Hg.Event;case"ExceptionData":return Hg.Exception;case"MessageData":return Hg.Trace;case"MetricData":return Hg.Metric;case"RequestData":return Hg.Request;case"RemoteDependencyData":return Hg.Dependency;case"AvailabilityData":return Hg.Availability;case"PageViewData":return Hg.PageView}}a(__a,"baseTypeToTelemetryType");uG.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var Hg;(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"})(Hg||(uG.TelemetryType=Hg={}))});var F_i=I(b0=>{"use strict";p();var v_a=b0&&b0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=b0&&b0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v_a(e,t,r)};Object.defineProperty(b0,"__esModule",{value:!0});$T(h_i(),b0);$T(g_i(),b0);$T(y_i(),b0);$T(__i(),b0);$T(C_i(),b0);$T(S_i(),b0);$T(I_i(),b0);$T(w_i(),b0);$T(k_i(),b0);$T(D_i(),b0);$T(M_i(),b0);$T(L_i(),b0);$T(B_i(),b0)});var Q_i=I(U_i=>{"use strict";p();Object.defineProperty(U_i,"__esModule",{value:!0})});var j_i=I(q_i=>{"use strict";p();Object.defineProperty(q_i,"__esModule",{value:!0})});var G_i=I(H_i=>{"use strict";p();Object.defineProperty(H_i,"__esModule",{value:!0})});var V_i=I($_i=>{"use strict";p();Object.defineProperty($_i,"__esModule",{value:!0})});var z_i=I(W_i=>{"use strict";p();Object.defineProperty(W_i,"__esModule",{value:!0})});var K_i=I(Y_i=>{"use strict";p();Object.defineProperty(Y_i,"__esModule",{value:!0})});var Z_i=I(J_i=>{"use strict";p();Object.defineProperty(J_i,"__esModule",{value:!0})});var evi=I(X_i=>{"use strict";p();Object.defineProperty(X_i,"__esModule",{value:!0})});var tvi=I(jb=>{"use strict";p();var C_a=jb&&jb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dG=jb&&jb.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C_a(e,t,r)};Object.defineProperty(jb,"__esModule",{value:!0});dG(Q_i(),jb);dG(j_i(),jb);dG(G_i(),jb);dG(V_i(),jb);dG(z_i(),jb);dG(K_i(),jb);dG(Z_i(),jb);dG(evi(),jb)});var ME=I(x4=>{"use strict";p();var b_a=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]})),Ght=x4&&x4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&b_a(e,t,r)};Object.defineProperty(x4,"__esModule",{value:!0});Ght(f_i(),x4);Ght(hyr(),x4);Ght(F_i(),x4);Ght(tvi(),x4)});var myr=I((xmp,rvi)=>{"use strict";p();var S_a=(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 iD;Object.defineProperty(jr,"__esModule",{value:!0});jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE=jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE=jr.TIME_SINCE_ENQUEUED=jr.ENQUEUED_TIME=jr.MessageBusDestination=jr.MicrosoftEventHub=jr.AzNamespace=jr.AttachTypePrefix=jr.HttpRequestCookieNames=jr.StatsbeatNetworkCategory=jr.StatsbeatFeatureType=jr.StatsbeatInstrumentation=jr.StatsbeatFeature=jr.StatsbeatCounter=jr.StatsbeatAttach=jr.StatsbeatResourceProvider=jr.StatsbeatTelemetryName=jr.HeartBeatMetricName=jr.DependencyTypeName=jr.TelemetryTypeStringToQuickPulseDocumentType=jr.TelemetryTypeStringToQuickPulseType=jr.QuickPulseType=jr.QuickPulseDocumentType=jr.PerformanceToQuickPulseCounter=jr.MetricId=jr.PerformanceCounter=jr.QuickPulseCounter=jr.DEFAULT_LIVEMETRICS_HOST=jr.DEFAULT_LIVEMETRICS_ENDPOINT=jr.DEFAULT_BREEZE_ENDPOINT=jr.APPLICATION_INSIGHTS_SDK_VERSION=void 0;jr.APPLICATION_INSIGHTS_SDK_VERSION="2.9.8";jr.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com";var ly;(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"})(ly||(jr.QuickPulseCounter=ly={}));var aOe;(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"})(aOe||(jr.PerformanceCounter=aOe={}));var nvi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(nvi||(jr.MetricId=nvi={}));jr.PerformanceToQuickPulseCounter=(iD={},iD[aOe.PROCESSOR_TIME]=ly.PROCESSOR_TIME,iD[aOe.REQUEST_RATE]=ly.REQUEST_RATE,iD[aOe.REQUEST_DURATION]=ly.REQUEST_DURATION,iD[ly.COMMITTED_BYTES]=ly.COMMITTED_BYTES,iD[ly.REQUEST_FAILURE_RATE]=ly.REQUEST_FAILURE_RATE,iD[ly.DEPENDENCY_RATE]=ly.DEPENDENCY_RATE,iD[ly.DEPENDENCY_FAILURE_RATE]=ly.DEPENDENCY_FAILURE_RATE,iD[ly.DEPENDENCY_DURATION]=ly.DEPENDENCY_DURATION,iD[ly.EXCEPTION_RATE]=ly.EXCEPTION_RATE,iD);jr.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability",PageView:"PageView"};jr.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument",PageView:"PageViewTelemetryDocument"};jr.TelemetryTypeStringToQuickPulseType={EventData:jr.QuickPulseType.Event,ExceptionData:jr.QuickPulseType.Exception,MessageData:jr.QuickPulseType.Trace,MetricData:jr.QuickPulseType.Metric,RequestData:jr.QuickPulseType.Request,RemoteDependencyData:jr.QuickPulseType.Dependency,AvailabilityData:jr.QuickPulseType.Availability,PageViewData:jr.QuickPulseType.PageView};jr.TelemetryTypeStringToQuickPulseDocumentType={EventData:jr.QuickPulseDocumentType.Event,ExceptionData:jr.QuickPulseDocumentType.Exception,MessageData:jr.QuickPulseDocumentType.Trace,MetricData:jr.QuickPulseDocumentType.Metric,RequestData:jr.QuickPulseDocumentType.Request,RemoteDependencyData:jr.QuickPulseDocumentType.Dependency,AvailabilityData:jr.QuickPulseDocumentType.Availability,PageViewData:jr.QuickPulseDocumentType.PageView};jr.DependencyTypeName={Grpc:"GRPC",Http:"HTTP",InProc:"InProc",Sql:"SQL",QueueMessage:"Queue Message"};jr.HeartBeatMetricName="HeartbeatState";jr.StatsbeatTelemetryName="Statsbeat";jr.StatsbeatResourceProvider={appsvc:"appsvc",aks:"aks",functions:"functions",vm:"vm",unknown:"unknown"};jr.StatsbeatAttach={codeless:"IntegratedAuto",sdk:"Manual"};jr.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 ivi;(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"})(ivi||(jr.StatsbeatFeature=ivi={}));var ovi;(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"})(ovi||(jr.StatsbeatInstrumentation=ovi={}));var svi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(svi||(jr.StatsbeatFeatureType=svi={}));var avi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(avi||(jr.StatsbeatNetworkCategory=avi={}));var cvi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(cvi||(jr.HttpRequestCookieNames=cvi={}));var lvi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(lvi||(jr.AttachTypePrefix=lvi={}));jr.AzNamespace="az.namespace";jr.MicrosoftEventHub="Microsoft.EventHub";jr.MessageBusDestination="message_bus.destination";jr.ENQUEUED_TIME="enqueuedTime";jr.TIME_SINCE_ENQUEUED="timeSinceEnqueued";jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE="https://js.monitor.azure.com/scripts/b/ai";jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE="https://az416426.vo.msecnd.net/scripts/b/ai"});var Eyr=I((yyr,uvi)=>{"use strict";p();var T_a=yyr&&yyr.__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)}})(),$ht=require("url"),I_a=ME(),gyr=ay(),VT=S0e(),x_a=myr(),fG=Qee(),w_a=XAr(),Ayr=Hht(),R_a=Kl(),Vht=md(),k_a=(function(t){T_a(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 $ht.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(Vht.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(Vht.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(Vht.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 $ht.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 $ht.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=$ht.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===Vht.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",R_a.warn("Could not decode the auth cookie with error: ",gyr.dumpObj(s))}var o=e.parseId(gyr.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=gyr.getCorrelationContextTarget(r,VT.requestContextSourceKey),r.headers){var o=r.headers[VT.traceStateHeader]?r.headers[VT.traceStateHeader].toString():null,s=r.headers[VT.traceparentHeader]?r.headers[VT.traceparentHeader].toString():null,c=r.headers[VT.requestIdHeader]?r.headers[VT.requestIdHeader].toString():null,l=r.headers[VT.parentIdHeader]?r.headers[VT.parentIdHeader].toString():null,u=r.headers[VT.rootIdHeader]?r.headers[VT.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[VT.correlationContextHeader]?r.headers[VT.correlationContextHeader].toString():null,fG.w3cEnabled&&(s||o)?(this.traceparent=new Ayr(s?s.toString():null),this.tracestate=s&&o&&new w_a(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?fG.w3cEnabled?(this.traceparent=new Ayr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=fG.generateRequestId(this.parentId),this.operationId=fG.getRootId(this.requestId)):fG.w3cEnabled?(this.traceparent=new Ayr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=fG.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=fG.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=fG.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new I_a.ContextTagKeys,e})(x_a);uvi.exports=k_a});var xvi=I((yo,Ivi)=>{p();yo=Ivi.exports=Ma;var dl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?dl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):dl=a(function(){},"debug");yo.SEMVER_SPEC_VERSION="2.0.0";var cOe=256,Wht=Number.MAX_SAFE_INTEGER||9007199254740991,_yr=16,P_a=cOe-6,lOe=yo.re=[],Pu=yo.safeRe=[],rr=yo.src=[],ma=0,Tyr="[a-zA-Z0-9-]",vyr=[["\\s",1],["\\d",cOe],[Tyr,P_a]];function Xht(t){for(var e=0;e)?=?)";var zht=ma++;rr[zht]=rr[x0e]+"|x|X|\\*";var Yht=ma++;rr[Yht]=rr[I0e]+"|x|X|\\*";var jee=ma++;rr[jee]="[v=\\s]*("+rr[Yht]+")(?:\\.("+rr[Yht]+")(?:\\.("+rr[Yht]+")(?:"+rr[xyr]+")?"+rr[dOe]+"?)?)?";var R0e=ma++;rr[R0e]="[v=\\s]*("+rr[zht]+")(?:\\.("+rr[zht]+")(?:\\.("+rr[zht]+")(?:"+rr[wyr]+")?"+rr[dOe]+"?)?)?";var mvi=ma++;rr[mvi]="^"+rr[D0e]+"\\s*"+rr[jee]+"$";var gvi=ma++;rr[gvi]="^"+rr[D0e]+"\\s*"+rr[R0e]+"$";var Avi=ma++;rr[Avi]="(?:^|[^\\d])(\\d{1,"+_yr+"})(?:\\.(\\d{1,"+_yr+"}))?(?:\\.(\\d{1,"+_yr+"}))?(?:$|[^\\d])";var emt=ma++;rr[emt]="(?:~>?)";var k0e=ma++;rr[k0e]="(\\s*)"+rr[emt]+"\\s+";lOe[k0e]=new RegExp(rr[k0e],"g");Pu[k0e]=new RegExp(Xht(rr[k0e]),"g");var D_a="$1~",yvi=ma++;rr[yvi]="^"+rr[emt]+rr[jee]+"$";var Evi=ma++;rr[Evi]="^"+rr[emt]+rr[R0e]+"$";var tmt=ma++;rr[tmt]="(?:\\^)";var P0e=ma++;rr[P0e]="(\\s*)"+rr[tmt]+"\\s+";lOe[P0e]=new RegExp(rr[P0e],"g");Pu[P0e]=new RegExp(Xht(rr[P0e]),"g");var N_a="$1^",_vi=ma++;rr[_vi]="^"+rr[tmt]+rr[jee]+"$";var vvi=ma++;rr[vvi]="^"+rr[tmt]+rr[R0e]+"$";var Dyr=ma++;rr[Dyr]="^"+rr[D0e]+"\\s*("+kyr+")$|^$";var Nyr=ma++;rr[Nyr]="^"+rr[D0e]+"\\s*("+hvi+")$|^$";var Hee=ma++;rr[Hee]="(\\s*)"+rr[D0e]+"\\s*("+kyr+"|"+rr[jee]+")";lOe[Hee]=new RegExp(rr[Hee],"g");Pu[Hee]=new RegExp(Xht(rr[Hee]),"g");var M_a="$1$2$3",Cvi=ma++;rr[Cvi]="^\\s*("+rr[jee]+")\\s+-\\s+("+rr[jee]+")\\s*$";var bvi=ma++;rr[bvi]="^\\s*("+rr[R0e]+")\\s+-\\s+("+rr[R0e]+")\\s*$";var Svi=ma++;rr[Svi]="(<|>)?=?\\s*\\*";for(w4=0;w4cOe)return null;var r=e.loose?Pu[Pyr]:Pu[Ryr];if(!r.test(t))return null;try{return new Ma(t,e)}catch{return null}}a(Gee,"parse");yo.valid=O_a;function O_a(t,e){var r=Gee(t,e);return r?r.version:null}a(O_a,"valid");yo.clean=L_a;function L_a(t,e){var r=Gee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(L_a,"clean");yo.SemVer=Ma;function Ma(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Ma){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>cOe)throw new TypeError("version is longer than "+cOe+" characters");if(!(this instanceof Ma))return new Ma(t,e);dl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Pu[Pyr]:Pu[Ryr]);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>Wht||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Wht||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Wht||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};yo.inc=B_a;function B_a(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Ma(t,r).inc(e,n).version}catch{return null}}a(B_a,"inc");yo.diff=F_a;function F_a(t,e){if(Myr(t,e))return null;var r=Gee(t),n=Gee(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(F_a,"diff");yo.compareIdentifiers=w0e;var dvi=/^[0-9]+$/;function w0e(t,e){var r=dvi.test(t),n=dvi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(uOe,"gt");yo.lt=Kht;function Kht(t,e,r){return B8(t,e,r)<0}a(Kht,"lt");yo.eq=Myr;function Myr(t,e,r){return B8(t,e,r)===0}a(Myr,"eq");yo.neq=Tvi;function Tvi(t,e,r){return B8(t,e,r)!==0}a(Tvi,"neq");yo.gte=Oyr;function Oyr(t,e,r){return B8(t,e,r)>=0}a(Oyr,"gte");yo.lte=Lyr;function Lyr(t,e,r){return B8(t,e,r)<=0}a(Lyr,"lte");yo.cmp=Jht;function Jht(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 Myr(t,r,n);case"!=":return Tvi(t,r,n);case">":return uOe(t,r,n);case">=":return Oyr(t,r,n);case"<":return Kht(t,r,n);case"<=":return Lyr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(Jht,"cmp");yo.Comparator=mR;function mR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof mR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof mR))return new mR(t,e);t=t.trim().split(/\s+/).join(" "),dl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===fOe?this.value="":this.value=this.operator+this.semver.version,dl("comp",this)}a(mR,"Comparator");var fOe={};mR.prototype.parse=function(t){var e=this.options.loose?Pu[Dyr]:Pu[Nyr],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 Ma(r[2],this.options.loose):this.semver=fOe};mR.prototype.toString=function(){return this.value};mR.prototype.test=function(t){return dl("Comparator.test",t,this.options.loose),this.semver===fOe?!0:(typeof t=="string"&&(t=new Ma(t,this.options)),Jht(t,this.operator,this.semver,this.options))};mR.prototype.intersects=function(t,e){if(!(t instanceof mR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Rf(t.value,e),Zht(this.value,r,e);if(t.operator==="")return r=new Rf(this.value,e),Zht(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=Jht(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=Jht(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};yo.Range=Rf;function Rf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Rf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Rf(t.raw,e);if(t instanceof mR)return new Rf(t.value,e);if(!(this instanceof Rf))return new Rf(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(Rf,"Range");Rf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Rf.prototype.toString=function(){return this.range};Rf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Pu[bvi]:Pu[Cvi];t=t.replace(r,rva),dl("hyphen replace",t),t=t.replace(Pu[Hee],M_a),dl("comparator trim",t,Pu[Hee]),t=t.replace(Pu[k0e],D_a),t=t.replace(Pu[P0e],N_a);var n=e?Pu[Dyr]:Pu[Nyr],o=t.split(" ").map(function(s){return z_a(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 mR(s,this.options)},this),o};Rf.prototype.intersects=function(t,e){if(!(t instanceof Rf))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)})})})})};yo.toComparators=W_a;function W_a(t,e){return new Rf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(W_a,"toComparators");function z_a(t,e){return dl("comp",t,e),t=J_a(t,e),dl("caret",t),t=Y_a(t,e),dl("tildes",t),t=X_a(t,e),dl("xrange",t),t=tva(t,e),dl("stars",t),t}a(z_a,"parseComparator");function bv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(bv,"isX");function Y_a(t,e){return t.trim().split(/\s+/).map(function(r){return K_a(r,e)}).join(" ")}a(Y_a,"replaceTildes");function K_a(t,e){var r=e.loose?Pu[Evi]:Pu[yvi];return t.replace(r,function(n,o,s,c,l){dl("tilde",t,n,o,s,c,l);var u;return bv(o)?u="":bv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":bv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(dl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",dl("tilde return",u),u})}a(K_a,"replaceTilde");function J_a(t,e){return t.trim().split(/\s+/).map(function(r){return Z_a(r,e)}).join(" ")}a(J_a,"replaceCarets");function Z_a(t,e){dl("caret",t,e);var r=e.loose?Pu[vvi]:Pu[_vi];return t.replace(r,function(n,o,s,c,l){dl("caret",t,n,o,s,c,l);var u;return bv(o)?u="":bv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":bv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(dl("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"):(dl("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"),dl("caret return",u),u})}a(Z_a,"replaceCaret");function X_a(t,e){return dl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return eva(r,e)}).join(" ")}a(X_a,"replaceXRanges");function eva(t,e){t=t.trim();var r=e.loose?Pu[gvi]:Pu[mvi];return t.replace(r,function(n,o,s,c,l,u){dl("xRange",t,n,o,s,c,l,u);var d=bv(s),f=d||bv(c),h=f||bv(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"),dl("xRange return",n),n})}a(eva,"replaceXRange");function tva(t,e){return dl("replaceStars",t,e),t.trim().replace(Pu[Svi],"")}a(tva,"replaceStars");function rva(t,e,r,n,o,s,c,l,u,d,f,h,m){return bv(r)?e="":bv(n)?e=">="+r+".0.0":bv(o)?e=">="+r+"."+n+".0":e=">="+e,bv(u)?l="":bv(d)?l="<"+(+u+1)+".0.0":bv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(rva,"hyphenReplace");Rf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Ma(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(nva,"testSet");yo.satisfies=Zht;function Zht(t,e,r){try{e=new Rf(e,r)}catch{return!1}return e.test(t)}a(Zht,"satisfies");yo.maxSatisfying=iva;function iva(t,e,r){var n=null,o=null;try{var s=new Rf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Ma(n,r))}),n}a(iva,"maxSatisfying");yo.minSatisfying=ova;function ova(t,e,r){var n=null,o=null;try{var s=new Rf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Ma(n,r))}),n}a(ova,"minSatisfying");yo.minVersion=sva;function sva(t,e){t=new Rf(t,e);var r=new Ma("0.0.0");if(t.test(r)||(r=new Ma("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||uOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(sva,"minVersion");yo.validRange=ava;function ava(t,e){try{return new Rf(t,e).range||"*"}catch{return null}}a(ava,"validRange");yo.ltr=cva;function cva(t,e,r){return Byr(t,e,"<",r)}a(cva,"ltr");yo.gtr=lva;function lva(t,e,r){return Byr(t,e,">",r)}a(lva,"gtr");yo.outside=Byr;function Byr(t,e,r,n){t=new Ma(t,n),e=new Rf(e,n);var o,s,c,l,u;switch(r){case">":o=uOe,s=Lyr,c=Kht,l=">",u=">=";break;case"<":o=Kht,s=Oyr,c=uOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Zht(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(Byr,"outside");yo.prerelease=uva;function uva(t,e){var r=Gee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(uva,"prerelease");yo.intersects=dva;function dva(t,e,r){return t=new Rf(t,r),e=new Rf(e,r),t.intersects(e)}a(dva,"intersects");yo.coerce=fva;function fva(t){if(t instanceof Ma)return t;if(typeof t!="string")return null;var e=t.match(Pu[Avi]);return e==null?null:Gee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(fva,"coerce")});var imt=I((Lmp,Pvi)=>{"use strict";p();var Rvi=d0e(),N0e=Rvi.wrap,rmt=Rvi.unwrap,F8="wrap@before";function nmt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(nmt,"defineProperty");function pva(t,e){for(var r=e.length,n=0;n0&&pva(t,o)}a(hva,"_findAndProcess");function wvi(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 Pc=require("util"),U8=require("assert"),mva=imt(),gd=require("async_hooks"),pOe="cls@contexts",hOe="error@context",kf=process.env.DEBUG_CLS_HOOKED,kc=-1;Mvi.exports={getNamespace:Dvi,createNamespace:gva,destroyNamespace:Nvi,reset:Ava,ERROR_SYMBOL:hOe};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,kf){let n=" ".repeat(this._indent<0?0:this._indent);zd(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+kc+" active:"+Pc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");gR.prototype.get=a(function(e){if(!this.active){if(kf){let r=gd.currentId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+kc+" active:"+Pc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),zd(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${Pc.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=kc,kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${Pc.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(kf){let n=gd.triggerAsyncId(),o=gd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${Pc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[hOe]=r),n}finally{if(kf){let n=gd.triggerAsyncId(),o=gd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${Pc.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 kf&&zd("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),n.then(o=>(kf&&zd("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[hOe]=r,kf&&zd("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.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[hOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");gR.prototype.enter=a(function(e){if(U8.ok(e,"context must be provided for entering"),kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${Pc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");gR.prototype.exit=a(function(e){if(U8.ok(e,"context must be provided for exiting"),kf){let n=gd.executionAsyncId(),o=gd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${kc} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${Pc.inspect(e)}`)}if(this.active===e){U8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(kf&&zd("??ERROR?? context exiting but not entered - ignoring: "+Pc.inspect(e)),U8.ok(r>=0,`context not currently entered; can't exit. +`+s),t.push(o+"m+"+Wpt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=jsa()+e+" "+t[0]}a(qsa,"formatArgs");function jsa(){return jg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(jsa,"getDate");function Hsa(...t){return process.stderr.write(Vpt.formatWithOptions(jg.inspectOpts,...t)+` +`)}a(Hsa,"log");function Gsa(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(Gsa,"save");function $sa(){return process.env.DEBUG}a($sa,"load");function Vsa(t){t.inspectOpts={};let e=Object.keys(jg.inspectOpts);for(let r=0;re.trim()).join(" ")};Lli.O=function(t){return this.inspectOpts.colors=this.useColors,Vpt.inspect(t,this.inspectOpts)}});var Fli=I((Sap,Fgr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Fgr.exports=Oli():Fgr.exports=Bli()});var Qgr=I((Iap,Uli)=>{"use strict";p();var Ugr=require("path").sep;Uli.exports=function(t){var e=t.split(Ugr),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]+Ugr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+Ugr;return{name:o,basedir:c,path:d}}}});var qgr=I((wap,Qli)=>{"use strict";p();var Wsa=require("os");Qli.exports=Wsa.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 jgr=I((Pap,qli)=>{p();qli.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 jli=I((Nap,VMe)=>{"use strict";p();var zsa=process.platform==="win32",Ysa=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Hgr={};function Ksa(t){return Ysa.exec(t).slice(1)}a(Ksa,"win32SplitPath");Hgr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Ksa(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 Jsa=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Ggr={};function Zsa(t){return Jsa.exec(t).slice(1)}a(Zsa,"posixSplitPath");Ggr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Zsa(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]}};zsa?VMe.exports=Hgr.parse:VMe.exports=Ggr.parse;VMe.exports.posix=Ggr.parse;VMe.exports.win32=Hgr.parse});var $gr=I((Bap,Vli)=>{p();var $li=require("path"),Hli=$li.parse||jli(),Gli=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=Hli(e);s.dir!==o[o.length-1];)o.push(s.dir),s=Hli(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return $li.resolve(n,l,u)}))},[])},"getNodeModulesDirs");Vli.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 Gli(e,o)},r);var s=Gli(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var Vgr=I((Qap,Wli)=>{p();Wli.exports=function(t,e){return e||{}}});var Kli=I((jap,Yli)=>{"use strict";p();var Xsa="Function.prototype.bind called on incompatible ",eaa=Object.prototype.toString,taa=Math.max,raa="[object Function]",zli=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var oaa=Kli();Jli.exports=Function.prototype.bind||oaa});var eui=I((Wap,Xli)=>{"use strict";p();var saa=Function.prototype.call,aaa=Object.prototype.hasOwnProperty,caa=Zli();Xli.exports=caa.call(saa,aaa)});var tui=I((Yap,laa)=>{laa.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 WMe=I((Kap,iui)=>{"use strict";p();var uaa=eui();function daa(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(daa,"specifierIncluded");function rui(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 wee=require("fs"),paa=qgr(),Am=require("path"),haa=jgr(),maa=$gr(),gaa=Vgr(),Aaa=WMe(),yaa=process.platform!=="win32"&&wee.realpath&&typeof wee.realpath.native=="function"?wee.realpath.native:wee.realpath,oui=paa(),Eaa=a(function(){return[Am.join(oui,".node_modules"),Am.join(oui,".node_libraries")]},"defaultPaths"),_aa=a(function(e,r){wee.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"),vaa=a(function(e,r){wee.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),Caa=a(function(e,r){yaa(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),zMe=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),baa=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"),Saa=a(function(e,r,n){for(var o=maa(r,n,e),s=0;s{Taa.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 fui=I((ncp,dui)=>{"use strict";p();var Iaa=WMe(),lui=cui(),uui={};for(zpt in lui)Object.prototype.hasOwnProperty.call(lui,zpt)&&(uui[zpt]=Iaa(zpt));var zpt;dui.exports=uui});var hui=I((ocp,pui)=>{p();var xaa=WMe();pui.exports=a(function(e){return xaa(e)},"isCore")});var Aui=I((ccp,gui)=>{p();var waa=WMe(),Ree=require("fs"),DE=require("path"),Raa=qgr(),kaa=jgr(),Paa=$gr(),Daa=Vgr(),Naa=process.platform!=="win32"&&Ree.realpathSync&&typeof Ree.realpathSync.native=="function"?Ree.realpathSync.native:Ree.realpathSync,mui=Raa(),Maa=a(function(){return[DE.join(mui,".node_modules"),DE.join(mui,".node_libraries")]},"defaultPaths"),Oaa=a(function(e){try{var r=Ree.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"),Laa=a(function(e){try{var r=Ree.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),Baa=a(function(e){try{return Naa(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),YMe=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),Faa=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),Uaa=a(function(e,r,n){for(var o=Paa(r,n,e),s=0;s{p();var Ypt=aui();Ypt.core=fui();Ypt.isCore=hui();Ypt.sync=Aui();yui.exports=Ypt});var Eui=I((pcp,Qaa)=>{Qaa.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 Jgr=I((hcp,Kgr)=>{"use strict";p();var A0e=require("path"),nD=require("module"),dh=Fli()("require-in-the-middle"),qaa=Qgr();Kgr.exports=KMe;Kgr.exports.Hook=KMe;var zgr,g0e;if(nD.isBuiltin)g0e=nD.isBuiltin;else if(nD.builtinModules)g0e=a(t=>t.startsWith("node:")?!0:(zgr===void 0&&(zgr=new Set(nD.builtinModules)),zgr.has(t)),"isCore");else{let t=Wgr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?g0e=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):g0e=a(n=>!!t.core[n],"isCore")}var Kpt;function jaa(t,e){if(!Kpt)if(require.resolve&&require.resolve.paths)Kpt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=Wgr();Kpt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return Kpt(t,e)}a(jaa,"resolve");var Haa=/([/\\]index)?(\.js)?$/,Ygr=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:(dh('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function KMe(t,e,r){if(!(this instanceof KMe))return new KMe(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof nD._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof nD._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,Eui().bugs.url);return}this._cache=new Ygr,this._unhooked=!1,this._origRequire=nD.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);dh("registering require hook"),this._require=nD.prototype.require=function(u){return n._unhooked===!0?(dh("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?(dh("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=g0e(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);g0e(v)&&(m=v)}}else{if(d)return dh("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=nD._resolveFilename(f,this)}catch(v){return dh('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(dh("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return dh("returning already patched cached module: %s",m),n._cache.get(m,h);let y=o.has(m);y===!1&&o.add(m);let E=d?n._origGetBuiltinModule.apply(this,u):n._origRequire.apply(this,u);if(y===!0)return dh("module is in the process of being patched already - ignoring: %s",m),E;if(o.delete(m),h===!0){if(c===!0&&t.includes(m)===!1)return dh("ignoring core module not on whitelist: %s",m),E;g=m}else if(c===!0&&t.includes(m)){let v=A0e.parse(m);g=v.name,A=v.dir}else{let v=qaa(m);if(v===void 0)return dh("could not parse filename: %s",m),E;g=v.name,A=v.basedir;let b=Gaa(v);dh("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",g,f,b,A);let T=!1;if(c){if(!f.startsWith(".")&&t.includes(f)&&(g=f,T=!0),!t.includes(g)&&!t.includes(b))return E;t.includes(b)&&b!==g&&(g=b,T=!0)}if(!T){let w;try{w=jaa(g,A)}catch{return dh("could not resolve module: %s",g),n._cache.set(m,E,h),E}if(w!==m)if(s===!0)g=g+A0e.sep+A0e.relative(A,m),dh("preparing to process require of internal file: %s",g);else return dh("ignoring require of non-main module file: %s",w),n._cache.set(m,E,h),E}}n._cache.set(m,E,h),dh("calling require hook: %s",g);let _=r(E,g,A);return n._cache.set(m,_,h),dh("returning module: %s",g),_}a(l,"patchedRequire")}a(KMe,"Hook");KMe.prototype.unhook=function(){this._unhooked=!0,this._require===nD.prototype.require?(nD.prototype.require=this._origRequire,dh("require unhook successful")):dh("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,dh("process.getBuiltinModule unhook successful")):dh("process.getBuiltinModule unhook unsuccessful"))};function Gaa(t){let e=A0e.sep!=="/"?t.path.split(A0e.sep).join("/"):t.path;return A0e.posix.join(t.name,e).replace(Haa,"")}a(Gaa,"resolveModuleName")});var Jpt,Zpt,_ui=ve(()=>{p();Jpt=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},Zpt=class{static{a(this,"ModuleNameTrie")}_trie=new Jpt;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new Jpt,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 Vaa(t){return Zgr.sep!=="/"?t.split(Zgr.sep).join("/"):t}var Cui,Zgr,$aa,Xpt,bui=ve(()=>{p();Cui=de(Jgr()),Zgr=de(require("path"));_ui();$aa=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),Xpt=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new Zpt;static _instance;constructor(){this._initialize()}_initialize(){new Cui.Hook(null,{internals:!0},(e,r,n)=>{let o=Vaa(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 $aa?new t:this._instance=this._instance??new t}};a(Vaa,"normalizePathSeparators")});var Rui=I(kee=>{p();var Sui=[],Xgr=new WeakMap,Tui=new WeakMap,Iui=new Map,xui=[],Waa={set(t,e,r){return Xgr.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=Tui.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 Xgr.get(t)[e](r.value)}};function zaa(t,e,r,n,o){Iui.set(t,o),Xgr.set(e,r),Tui.set(e,n);let s=new Proxy(e,Waa);Sui.forEach(c=>c(t,s)),xui.push([t,s])}a(zaa,"register");var wui=!1;function Yaa(){return wui}a(Yaa,"getExperimentalPatchInternals");function Kaa(t){wui=t}a(Kaa,"setExperimentalPatchInternals");kee.register=zaa;kee.importHooks=Sui;kee.specifiers=Iui;kee.toHook=xui;kee.getExperimentalPatchInternals=Yaa;kee.setExperimentalPatchInternals=Kaa});var Oui=I((xcp,y0e)=>{p();var kui=require("path"),Jaa=Qgr(),{fileURLToPath:Pui}=require("url"),{MessageChannel:Zaa}=require("worker_threads"),{importHooks:eAr,specifiers:Xaa,toHook:eca,getExperimentalPatchInternals:tca}=Rui();function Nui(t){eAr.push(t),eca.forEach(([e,r])=>t(e,r))}a(Nui,"addHook");function Mui(t){let e=eAr.indexOf(t);e>-1&&eAr.splice(e,1)}a(Mui,"removeHook");function Dui(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(Dui,"callHookFn");var tAr;function rca(){let{port1:t,port2:e}=new Zaa,r=0,n;tAr=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(rca,"createAddHookMessageChannel");function JMe(t,e,r){if(!(this instanceof JMe))return new JMe(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;tAr&&Array.isArray(t)&&tAr(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=Pui(o)}catch{}let d=Jaa(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+kui.sep+kui.relative(u,Pui(c));else if(!tca()&&!u.endsWith(Xaa.get(c)))continue}Dui(r,s,o,u)}}else Dui(r,s,o,u)},Nui(this._iitmHook)}a(JMe,"Hook");JMe.prototype.unhook=function(){Mui(this._iitmHook)};y0e.exports=JMe;y0e.exports.Hook=JMe;y0e.exports.addHook=Nui;y0e.exports.removeHook=Mui;y0e.exports.createAddHookMessageChannel=rca});function Lui(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 Bui(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 eht(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var rAr=ve(()=>{p();a(Lui,"safeExecuteInTheMiddle");a(Bui,"safeExecuteInTheMiddleAsync");a(eht,"isWrapped")});function Fui(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>bli(e,n,{includePrerelease:r}))}var O8,nAr,ZMe,Uui,Qui,qui,E0e,jui=ve(()=>{p();O8=de(require("path")),nAr=require("util");xli();ZMe=de(f0e());Pli();bui();Uui=de(Oui());co();Qui=de(Jgr()),qui=require("fs");rAr();E0e=class extends Hpt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=Xpt.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(eht(e[r])&&this._unwrap(e,r),nAr.types.isProxy(e)){let o=(0,ZMe.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,ZMe.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>nAr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,ZMe.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.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{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.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,qui.readFileSync)(O8.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{Dn.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 Fui(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=O8.normalize(n);return c.filter(d=>d.name===l).filter(d=>Fui(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&&O8.isAbsolute(l)){let d=O8.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=O8.isAbsolute(e.name)?new Qui.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new Uui.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(Fui,"isSupported")});var XMe,Hui=ve(()=>{p();XMe=require("path")});var Gui=ve(()=>{p();jui();Hui()});var iAr=ve(()=>{p();Gui()});var tht,$ui=ve(()=>{p();tht=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 rht,Vui=ve(()=>{p();iAr();rht=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,XMe.normalize)(e)}}});var oAr={};ki(oAr,{InstrumentationBase:()=>E0e,InstrumentationNodeModuleDefinition:()=>tht,InstrumentationNodeModuleFile:()=>rht,isWrapped:()=>eht,registerInstrumentations:()=>gli,safeExecuteInTheMiddle:()=>Lui,safeExecuteInTheMiddleAsync:()=>Bui});var sAr=ve(()=>{p();Ali();iAr();$ui();Vui();rAr()});var zui=I(aAr=>{"use strict";p();Object.defineProperty(aAr,"__esModule",{value:!0});aAr.log=sca;var Wui=(m3(),Ca(oQ)),nca=require("node:os"),ica=Wui.__importDefault(require("node:util")),oca=Wui.__importStar(require("node:process"));function sca(t,...e){oca.stderr.write(`${ica.default.format(t,...e)}${nca.EOL}`)}a(sca,"log")});var Xui=I(fAr=>{"use strict";p();Object.defineProperty(fAr,"__esModule",{value:!0});var aca=zui(),Yui=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Kui,cAr=[],lAr=[],nht=[];Yui&&uAr(Yui);var Jui=Object.assign(t=>Zui(t),{enable:uAr,enabled:dAr,disable:cca,log:aca.log});function uAr(t){Kui=t,cAr=[],lAr=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?lAr.push(new RegExp(`^${n.substr(1)}$`)):cAr.push(new RegExp(`^${n}$`));for(let n of nht)n.enabled=dAr(n.namespace)}a(uAr,"enable");function dAr(t){if(t.endsWith("*"))return!0;for(let e of lAr)if(e.test(t))return!1;for(let e of cAr)if(e.test(t))return!0;return!1}a(dAr,"enabled");function cca(){let t=Kui||"";return uAr(""),t}a(cca,"disable");function Zui(t){let e=Object.assign(r,{enabled:dAr(t),destroy:lca,log:Jui.log,namespace:t,extend:uca});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),nht.push(e),e}a(Zui,"createDebugger");function lca(){let t=nht.indexOf(this);return t>=0?(nht.splice(t,1),!0):!1}a(lca,"destroy");function uca(t){let e=Zui(`${this.namespace}:${t}`);return e.log=this.log,e}a(uca,"extend");fAr.default=Jui});var aht=I(b4=>{"use strict";p();Object.defineProperty(b4,"__esModule",{value:!0});b4.AzureLogger=void 0;b4.setLogLevel=rdi;b4.getLogLevel=fca;b4.createClientLogger=pca;var dca=(m3(),Ca(oQ)),eOe=dca.__importDefault(Xui()),tdi=new Set,iht=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,sht;b4.AzureLogger=(0,eOe.default)("azure");b4.AzureLogger.log=(...t)=>{eOe.default.log(...t)};var pAr=["verbose","info","warning","error"];iht&&(odi(iht)?rdi(iht):console.error(`AZURE_LOG_LEVEL set to unknown log level '${iht}'; logging is not enabled. Acceptable values: ${pAr.join(", ")}.`));function rdi(t){if(t&&!odi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${pAr.join(",")}`);sht=t;let e=[];for(let r of tdi)idi(r)&&e.push(r.namespace);eOe.default.enable(e.join(","))}a(rdi,"setLogLevel");function fca(){return sht}a(fca,"getLogLevel");var edi={verbose:400,info:300,warning:200,error:100};function pca(t){let e=b4.AzureLogger.extend(t);return ndi(b4.AzureLogger,e),{error:oht(e,"error"),warning:oht(e,"warning"),info:oht(e,"info"),verbose:oht(e,"verbose")}}a(pca,"createClientLogger");function ndi(t,e){e.log=(...r)=>{t.log(...r)}}a(ndi,"patchLogMethod");function oht(t,e){let r=Object.assign(t.extend(e),{level:e});if(ndi(t,r),idi(r)){let n=eOe.default.disable();eOe.default.enable(n+","+r.namespace)}return tdi.add(r),r}a(oht,"createLogger");function idi(t){return!!(sht&&edi[t.level]<=edi[sht])}a(idi,"shouldEnable");function odi(t){return pAr.includes(t)}a(odi,"isAzureLogLevel")});var hAr=I(cht=>{"use strict";p();Object.defineProperty(cht,"__esModule",{value:!0});cht.logger=void 0;var hca=aht();cht.logger=(0,hca.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function lht(t){return t.setValue(mAr,!0)}function sdi(t){return t.deleteValue(mAr)}function _0e(t){return t.getValue(mAr)===!0}var mAr,tOe=ve(()=>{p();co();mAr=_b("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(lht,"suppressTracing");a(sdi,"unsuppressTracing");a(_0e,"isTracingSuppressed")});var uht,adi=ve(()=>{p();uht="baggage"});function ldi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function udi(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 gAr(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=Hpe(e.join(";"))),{key:o,value:s,metadata:c}}function ddi(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=gAr(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var AAr=ve(()=>{p();co();a(ldi,"serializeKeyPairs");a(udi,"getKeyPairs");a(gAr,"parsePairKeyValue");a(ddi,"parseKeyPairsIntoRecord")});var fht,fdi=ve(()=>{p();co();tOe();adi();AAr();fht=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=DT.getBaggage(e);if(!o||_0e(e))return;let s=udi(o).filter(l=>l.length<=4096).slice(0,180),c=ldi(s);c.length>0&&n.set(r,uht,c)}extract(e,r,n){let o=n.get(r,uht),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=gAr(u);if(d){let f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0)?e:DT.setBaggage(e,DT.createBaggage(c))}fields(){return[uht]}}});var pht,pdi=ve(()=>{p();pht=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 hdi(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(!Aca(r)){Dn.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!yAr(n)){Dn.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function Aca(t){return typeof t=="string"&&t!==""}function yAr(t){return t==null?!0:Array.isArray(t)?yca(t):mdi(typeof t)}function yca(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(mdi(n)){e=n;continue}return!1}return!1}}return!0}function mdi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var gdi=ve(()=>{p();co();a(hdi,"sanitizeAttributes");a(Aca,"isAttributeKey");a(yAr,"isAttributeValue");a(yca,"isHomogeneousAttributeValueArray");a(mdi,"isValidPrimitiveAttributeValueType")});function hht(){return t=>{Dn.error(Eca(t))}}function Eca(t){return typeof t=="string"?t:JSON.stringify(_ca(t))}function _ca(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 EAr=ve(()=>{p();co();a(hht,"loggingErrorHandler");a(Eca,"stringifyException");a(_ca,"flattenException")});function ydi(t){Adi=t}function Edi(t){try{Adi(t)}catch{}}var Adi,_di=ve(()=>{p();EAr();Adi=hht();a(ydi,"setGlobalErrorHandler");a(Edi,"globalErrorHandler")});function mht(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Dn.warn(`Unknown value ${(0,_Ar.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function rOe(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function ght(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Dn.warn(`Unknown value ${(0,_Ar.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function Aht(t){return rOe(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var _Ar,vdi=ve(()=>{p();co();_Ar=require("util");a(mht,"getNumberFromEnv");a(rOe,"getStringFromEnv");a(ght,"getBooleanFromEnv");a(Aht,"getStringListFromEnv")});var yht,Cdi=ve(()=>{p();yht=typeof globalThis=="object"?globalThis:global});var bdi,aG,Sdi=ve(()=>{p();bdi=require("perf_hooks"),aG=bdi.performance});var Tdi,Idi=ve(()=>{p();Tdi="2.2.0"});function fh(t){let e={},r=t.length;for(let n=0;n{p();a(fh,"createConstMap")});var xdi,wdi,Rdi,kdi,Pdi,Ddi,Ndi,Mdi,Odi,Ldi,Bdi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,efi,tfi,rfi,nfi,ifi,ofi,sfi,afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Lfi,Bfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,npi,ipi,opi,spi,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi,Hpi,Gpi,$pi,Vpi,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,ela,tla,rla,nla,ila,ola,sla,ala,cla,lla,ula,dla,fla,pla,hla,mla,gla,Ala,yla,Ela,_la,vla,Cla,bla,Sla,Tla,Ila,xla,wla,Rla,kla,Pla,Dla,Nla,Mla,Ola,Lla,Bla,Fla,Ula,Qla,qla,jla,Hla,Gla,$la,Vla,Wla,zla,Yla,Kla,Jla,Zla,Xla,eua,tua,rua,nua,iua,oua,sua,aua,cua,lua,uua,dua,fua,pua,hua,mua,gua,Aua,yua,Eua,_ua,vua,Cua,bua,Sua,Tua,Iua,xua,wua,Rua,kua,Pua,Dua,Nua,Mua,Oua,Lua,Bua,Fua,Uua,Qua,qua,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi,Lhi,Bhi,Fhi,Uhi,jua,Hua,Gua,$ua,Vua,Wua,zua,Yua,Kua,Jua,Zua,Xua,eda,tda,rda,nda,ida,oda,sda,ada,cda,lda,uda,dda,fda,pda,hda,mda,gda,Ada,yda,Eda,_da,vda,Cda,bda,Sda,Tda,Ida,xda,wda,Rda,kda,Pda,Dda,Nda,Mda,Oda,Qhi,qhi,jhi,Hhi,Ghi,$hi,Vhi,Whi,zhi,Yhi,Khi,Lda,Bda,Fda,Uda,Qda,qda,jda,Hda,Gda,$da,Vda,Wda,Jhi,Zhi,Xhi,emi,tmi,zda,Yda,Kda,Jda,Zda,Xda,rmi,nmi,imi,efa,tfa,rfa,nfa,omi,smi,ami,cmi,ifa,ofa,sfa,afa,cfa,lmi,umi,dmi,fmi,pmi,hmi,mmi,lfa,ufa,dfa,ffa,pfa,hfa,mfa,gfa,gmi,Ami,ymi,Emi,_mi,Afa,yfa,Efa,_fa,vfa,Cfa,vmi,Cmi,bmi,Smi,Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi,Omi,Lmi,Bmi,Fmi,Umi,Qmi,qmi,bfa,Sfa,Tfa,Ifa,xfa,wfa,Rfa,kfa,Pfa,Dfa,Nfa,Mfa,Ofa,Lfa,Bfa,Ffa,Ufa,Qfa,qfa,jfa,Hfa,Gfa,jmi,Hmi,Gmi,$mi,Vmi,$fa,Vfa,Wfa,zfa,Yfa,Kfa,Wmi,zmi,Jfa,Zfa,Xfa,Ymi,Kmi,epa,tpa,rpa,Jmi,Zmi,Xmi,e0i,t0i,r0i,n0i,i0i,o0i,s0i,a0i,c0i,l0i,u0i,d0i,f0i,p0i,npa,ipa,opa,spa,apa,cpa,lpa,upa,dpa,fpa,ppa,hpa,mpa,gpa,Apa,ypa,Epa,_pa,h0i,m0i,vpa,Cpa,bpa,g0i=ve(()=>{p();vAr();xdi="aws.lambda.invoked_arn",wdi="db.system",Rdi="db.connection_string",kdi="db.user",Pdi="db.jdbc.driver_classname",Ddi="db.name",Ndi="db.statement",Mdi="db.operation",Odi="db.mssql.instance_name",Ldi="db.cassandra.keyspace",Bdi="db.cassandra.page_size",Fdi="db.cassandra.consistency_level",Udi="db.cassandra.table",Qdi="db.cassandra.idempotence",qdi="db.cassandra.speculative_execution_count",jdi="db.cassandra.coordinator.id",Hdi="db.cassandra.coordinator.dc",Gdi="db.hbase.namespace",$di="db.redis.database_index",Vdi="db.mongodb.collection",Wdi="db.sql.table",zdi="exception.type",Ydi="exception.message",Kdi="exception.stacktrace",Jdi="exception.escaped",Zdi="faas.trigger",Xdi="faas.execution",efi="faas.document.collection",tfi="faas.document.operation",rfi="faas.document.time",nfi="faas.document.name",ifi="faas.time",ofi="faas.cron",sfi="faas.coldstart",afi="faas.invoked_name",cfi="faas.invoked_provider",lfi="faas.invoked_region",ufi="net.transport",dfi="net.peer.ip",ffi="net.peer.port",pfi="net.peer.name",hfi="net.host.ip",mfi="net.host.port",gfi="net.host.name",Afi="net.host.connection.type",yfi="net.host.connection.subtype",Efi="net.host.carrier.name",_fi="net.host.carrier.mcc",vfi="net.host.carrier.mnc",Cfi="net.host.carrier.icc",bfi="peer.service",Sfi="enduser.id",Tfi="enduser.role",Ifi="enduser.scope",xfi="thread.id",wfi="thread.name",Rfi="code.function",kfi="code.namespace",Pfi="code.filepath",Dfi="code.lineno",Nfi="http.method",Mfi="http.url",Ofi="http.target",Lfi="http.host",Bfi="http.scheme",Ffi="http.status_code",Ufi="http.flavor",Qfi="http.user_agent",qfi="http.request_content_length",jfi="http.request_content_length_uncompressed",Hfi="http.response_content_length",Gfi="http.response_content_length_uncompressed",$fi="http.server_name",Vfi="http.route",Wfi="http.client_ip",zfi="aws.dynamodb.table_names",Yfi="aws.dynamodb.consumed_capacity",Kfi="aws.dynamodb.item_collection_metrics",Jfi="aws.dynamodb.provisioned_read_capacity",Zfi="aws.dynamodb.provisioned_write_capacity",Xfi="aws.dynamodb.consistent_read",epi="aws.dynamodb.projection",tpi="aws.dynamodb.limit",rpi="aws.dynamodb.attributes_to_get",npi="aws.dynamodb.index_name",ipi="aws.dynamodb.select",opi="aws.dynamodb.global_secondary_indexes",spi="aws.dynamodb.local_secondary_indexes",api="aws.dynamodb.exclusive_start_table",cpi="aws.dynamodb.table_count",lpi="aws.dynamodb.scan_forward",upi="aws.dynamodb.segment",dpi="aws.dynamodb.total_segments",fpi="aws.dynamodb.count",ppi="aws.dynamodb.scanned_count",hpi="aws.dynamodb.attribute_definitions",mpi="aws.dynamodb.global_secondary_index_updates",gpi="messaging.system",Api="messaging.destination",ypi="messaging.destination_kind",Epi="messaging.temp_destination",_pi="messaging.protocol",vpi="messaging.protocol_version",Cpi="messaging.url",bpi="messaging.message_id",Spi="messaging.conversation_id",Tpi="messaging.message_payload_size_bytes",Ipi="messaging.message_payload_compressed_size_bytes",xpi="messaging.operation",wpi="messaging.consumer_id",Rpi="messaging.rabbitmq.routing_key",kpi="messaging.kafka.message_key",Ppi="messaging.kafka.consumer_group",Dpi="messaging.kafka.client_id",Npi="messaging.kafka.partition",Mpi="messaging.kafka.tombstone",Opi="rpc.system",Lpi="rpc.service",Bpi="rpc.method",Fpi="rpc.grpc.status_code",Upi="rpc.jsonrpc.version",Qpi="rpc.jsonrpc.request_id",qpi="rpc.jsonrpc.error_code",jpi="rpc.jsonrpc.error_message",Hpi="message.type",Gpi="message.id",$pi="message.compressed_size",Vpi="message.uncompressed_size",vca=xdi,Cca=wdi,bca=Rdi,Sca=kdi,Tca=Pdi,Ica=Ddi,xca=Ndi,wca=Mdi,Rca=Odi,kca=Ldi,Pca=Bdi,Dca=Fdi,Nca=Udi,Mca=Qdi,Oca=qdi,Lca=jdi,Bca=Hdi,Fca=Gdi,Uca=$di,Qca=Vdi,qca=Wdi,jca=zdi,Hca=Ydi,Gca=Kdi,$ca=Jdi,Vca=Zdi,Wca=Xdi,zca=efi,Yca=tfi,Kca=rfi,Jca=nfi,Zca=ifi,Xca=ofi,ela=sfi,tla=afi,rla=cfi,nla=lfi,ila=ufi,ola=dfi,sla=ffi,ala=pfi,cla=hfi,lla=mfi,ula=gfi,dla=Afi,fla=yfi,pla=Efi,hla=_fi,mla=vfi,gla=Cfi,Ala=bfi,yla=Sfi,Ela=Tfi,_la=Ifi,vla=xfi,Cla=wfi,bla=Rfi,Sla=kfi,Tla=Pfi,Ila=Dfi,xla=Nfi,wla=Mfi,Rla=Ofi,kla=Lfi,Pla=Bfi,Dla=Ffi,Nla=Ufi,Mla=Qfi,Ola=qfi,Lla=jfi,Bla=Hfi,Fla=Gfi,Ula=$fi,Qla=Vfi,qla=Wfi,jla=zfi,Hla=Yfi,Gla=Kfi,$la=Jfi,Vla=Zfi,Wla=Xfi,zla=epi,Yla=tpi,Kla=rpi,Jla=npi,Zla=ipi,Xla=opi,eua=spi,tua=api,rua=cpi,nua=lpi,iua=upi,oua=dpi,sua=fpi,aua=ppi,cua=hpi,lua=mpi,uua=gpi,dua=Api,fua=ypi,pua=Epi,hua=_pi,mua=vpi,gua=Cpi,Aua=bpi,yua=Spi,Eua=Tpi,_ua=Ipi,vua=xpi,Cua=wpi,bua=Rpi,Sua=kpi,Tua=Ppi,Iua=Dpi,xua=Npi,wua=Mpi,Rua=Opi,kua=Lpi,Pua=Bpi,Dua=Fpi,Nua=Upi,Mua=Qpi,Oua=qpi,Lua=jpi,Bua=Hpi,Fua=Gpi,Uua=$pi,Qua=Vpi,qua=fh([xdi,wdi,Rdi,kdi,Pdi,Ddi,Ndi,Mdi,Odi,Ldi,Bdi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,efi,tfi,rfi,nfi,ifi,ofi,sfi,afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Lfi,Bfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,npi,ipi,opi,spi,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi,Hpi,Gpi,$pi,Vpi]),Wpi="other_sql",zpi="mssql",Ypi="mysql",Kpi="oracle",Jpi="db2",Zpi="postgresql",Xpi="redshift",ehi="hive",thi="cloudscape",rhi="hsqldb",nhi="progress",ihi="maxdb",ohi="hanadb",shi="ingres",ahi="firstsql",chi="edb",lhi="cache",uhi="adabas",dhi="firebird",fhi="derby",phi="filemaker",hhi="informix",mhi="instantdb",ghi="interbase",Ahi="mariadb",yhi="netezza",Ehi="pervasive",_hi="pointbase",vhi="sqlite",Chi="sybase",bhi="teradata",Shi="vertica",Thi="h2",Ihi="coldfusion",xhi="cassandra",whi="hbase",Rhi="mongodb",khi="redis",Phi="couchbase",Dhi="couchdb",Nhi="cosmosdb",Mhi="dynamodb",Ohi="neo4j",Lhi="geode",Bhi="elasticsearch",Fhi="memcached",Uhi="cockroachdb",jua=Wpi,Hua=zpi,Gua=Ypi,$ua=Kpi,Vua=Jpi,Wua=Zpi,zua=Xpi,Yua=ehi,Kua=thi,Jua=rhi,Zua=nhi,Xua=ihi,eda=ohi,tda=shi,rda=ahi,nda=chi,ida=lhi,oda=uhi,sda=dhi,ada=fhi,cda=phi,lda=hhi,uda=mhi,dda=ghi,fda=Ahi,pda=yhi,hda=Ehi,mda=_hi,gda=vhi,Ada=Chi,yda=bhi,Eda=Shi,_da=Thi,vda=Ihi,Cda=xhi,bda=whi,Sda=Rhi,Tda=khi,Ida=Phi,xda=Dhi,wda=Nhi,Rda=Mhi,kda=Ohi,Pda=Lhi,Dda=Bhi,Nda=Fhi,Mda=Uhi,Oda=fh([Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi,Lhi,Bhi,Fhi,Uhi]),Qhi="all",qhi="each_quorum",jhi="quorum",Hhi="local_quorum",Ghi="one",$hi="two",Vhi="three",Whi="local_one",zhi="any",Yhi="serial",Khi="local_serial",Lda=Qhi,Bda=qhi,Fda=jhi,Uda=Hhi,Qda=Ghi,qda=$hi,jda=Vhi,Hda=Whi,Gda=zhi,$da=Yhi,Vda=Khi,Wda=fh([Qhi,qhi,jhi,Hhi,Ghi,$hi,Vhi,Whi,zhi,Yhi,Khi]),Jhi="datasource",Zhi="http",Xhi="pubsub",emi="timer",tmi="other",zda=Jhi,Yda=Zhi,Kda=Xhi,Jda=emi,Zda=tmi,Xda=fh([Jhi,Zhi,Xhi,emi,tmi]),rmi="insert",nmi="edit",imi="delete",efa=rmi,tfa=nmi,rfa=imi,nfa=fh([rmi,nmi,imi]),omi="alibaba_cloud",smi="aws",ami="azure",cmi="gcp",ifa=omi,ofa=smi,sfa=ami,afa=cmi,cfa=fh([omi,smi,ami,cmi]),lmi="ip_tcp",umi="ip_udp",dmi="ip",fmi="unix",pmi="pipe",hmi="inproc",mmi="other",lfa=lmi,ufa=umi,dfa=dmi,ffa=fmi,pfa=pmi,hfa=hmi,mfa=mmi,gfa=fh([lmi,umi,dmi,fmi,pmi,hmi,mmi]),gmi="wifi",Ami="wired",ymi="cell",Emi="unavailable",_mi="unknown",Afa=gmi,yfa=Ami,Efa=ymi,_fa=Emi,vfa=_mi,Cfa=fh([gmi,Ami,ymi,Emi,_mi]),vmi="gprs",Cmi="edge",bmi="umts",Smi="cdma",Tmi="evdo_0",Imi="evdo_a",xmi="cdma2000_1xrtt",wmi="hsdpa",Rmi="hsupa",kmi="hspa",Pmi="iden",Dmi="evdo_b",Nmi="lte",Mmi="ehrpd",Omi="hspap",Lmi="gsm",Bmi="td_scdma",Fmi="iwlan",Umi="nr",Qmi="nrnsa",qmi="lte_ca",bfa=vmi,Sfa=Cmi,Tfa=bmi,Ifa=Smi,xfa=Tmi,wfa=Imi,Rfa=xmi,kfa=wmi,Pfa=Rmi,Dfa=kmi,Nfa=Pmi,Mfa=Dmi,Ofa=Nmi,Lfa=Mmi,Bfa=Omi,Ffa=Lmi,Ufa=Bmi,Qfa=Fmi,qfa=Umi,jfa=Qmi,Hfa=qmi,Gfa=fh([vmi,Cmi,bmi,Smi,Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi,Omi,Lmi,Bmi,Fmi,Umi,Qmi,qmi]),jmi="1.0",Hmi="1.1",Gmi="2.0",$mi="SPDY",Vmi="QUIC",$fa=jmi,Vfa=Hmi,Wfa=Gmi,zfa=$mi,Yfa=Vmi,Kfa={HTTP_1_0:jmi,HTTP_1_1:Hmi,HTTP_2_0:Gmi,SPDY:$mi,QUIC:Vmi},Wmi="queue",zmi="topic",Jfa=Wmi,Zfa=zmi,Xfa=fh([Wmi,zmi]),Ymi="receive",Kmi="process",epa=Ymi,tpa=Kmi,rpa=fh([Ymi,Kmi]),Jmi=0,Zmi=1,Xmi=2,e0i=3,t0i=4,r0i=5,n0i=6,i0i=7,o0i=8,s0i=9,a0i=10,c0i=11,l0i=12,u0i=13,d0i=14,f0i=15,p0i=16,npa=Jmi,ipa=Zmi,opa=Xmi,spa=e0i,apa=t0i,cpa=r0i,lpa=n0i,upa=i0i,dpa=o0i,fpa=s0i,ppa=a0i,hpa=c0i,mpa=l0i,gpa=u0i,Apa=d0i,ypa=f0i,Epa=p0i,_pa={OK:Jmi,CANCELLED:Zmi,UNKNOWN:Xmi,INVALID_ARGUMENT:e0i,DEADLINE_EXCEEDED:t0i,NOT_FOUND:r0i,ALREADY_EXISTS:n0i,PERMISSION_DENIED:i0i,RESOURCE_EXHAUSTED:o0i,FAILED_PRECONDITION:s0i,ABORTED:a0i,OUT_OF_RANGE:c0i,UNIMPLEMENTED:l0i,INTERNAL:u0i,UNAVAILABLE:d0i,DATA_LOSS:f0i,UNAUTHENTICATED:p0i},h0i="SENT",m0i="RECEIVED",vpa=h0i,Cpa=m0i,bpa=fh([h0i,m0i])});var A0i=ve(()=>{p();g0i()});var y0i,E0i,_0i,v0i,C0i,b0i,S0i,T0i,I0i,x0i,w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i,U0i,Q0i,q0i,j0i,H0i,G0i,$0i,V0i,W0i,z0i,Y0i,K0i,J0i,Z0i,X0i,egi,tgi,rgi,ngi,igi,ogi,sgi,agi,cgi,lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi,kgi,Pgi,Dgi,Ngi,Mgi,Ogi,Lgi,Bgi,Fgi,Ugi,Qgi,qgi,jgi,Hgi,Ggi,Spa,Tpa,Ipa,xpa,wpa,Rpa,kpa,Ppa,Dpa,Npa,Mpa,Opa,Lpa,Bpa,Fpa,Upa,Qpa,qpa,jpa,Hpa,Gpa,$pa,Vpa,Wpa,zpa,Ypa,Kpa,Jpa,Zpa,Xpa,eha,tha,rha,nha,iha,oha,sha,aha,cha,lha,uha,dha,fha,pha,hha,mha,gha,Aha,yha,Eha,_ha,vha,Cha,bha,Sha,Tha,Iha,xha,wha,Rha,kha,Pha,Dha,Nha,Mha,Oha,Lha,Bha,Fha,Uha,Qha,qha,jha,Hha,Gha,$ha,Vha,Wha,zha,Yha,Kha,Jha,$gi,Vgi,Wgi,zgi,Zha,Xha,ema,tma,rma,Ygi,Kgi,Jgi,Zgi,Xgi,eAi,tAi,rAi,nAi,iAi,oAi,sAi,aAi,cAi,lAi,uAi,dAi,nma,ima,oma,sma,ama,cma,lma,uma,dma,fma,pma,hma,mma,gma,Ama,yma,Ema,_ma,fAi,pAi,vma,Cma,bma,hAi,mAi,gAi,AAi,yAi,EAi,_Ai,Sma,Tma,Ima,xma,wma,Rma,kma,Pma,vAi,CAi,bAi,SAi,TAi,IAi,xAi,wAi,RAi,kAi,PAi,Dma,Nma,Mma,Oma,Lma,Bma,Fma,Uma,Qma,qma,jma,Hma,DAi,NAi,MAi,OAi,LAi,BAi,FAi,UAi,QAi,qAi,Gma,$ma,Vma,Wma,zma,Yma,Kma,Jma,Zma,Xma,e0a,jAi=ve(()=>{p();vAr();y0i="cloud.provider",E0i="cloud.account.id",_0i="cloud.region",v0i="cloud.availability_zone",C0i="cloud.platform",b0i="aws.ecs.container.arn",S0i="aws.ecs.cluster.arn",T0i="aws.ecs.launchtype",I0i="aws.ecs.task.arn",x0i="aws.ecs.task.family",w0i="aws.ecs.task.revision",R0i="aws.eks.cluster.arn",k0i="aws.log.group.names",P0i="aws.log.group.arns",D0i="aws.log.stream.names",N0i="aws.log.stream.arns",M0i="container.name",O0i="container.id",L0i="container.runtime",B0i="container.image.name",F0i="container.image.tag",U0i="deployment.environment",Q0i="device.id",q0i="device.model.identifier",j0i="device.model.name",H0i="faas.name",G0i="faas.id",$0i="faas.version",V0i="faas.instance",W0i="faas.max_memory",z0i="host.id",Y0i="host.name",K0i="host.type",J0i="host.arch",Z0i="host.image.name",X0i="host.image.id",egi="host.image.version",tgi="k8s.cluster.name",rgi="k8s.node.name",ngi="k8s.node.uid",igi="k8s.namespace.name",ogi="k8s.pod.uid",sgi="k8s.pod.name",agi="k8s.container.name",cgi="k8s.replicaset.uid",lgi="k8s.replicaset.name",ugi="k8s.deployment.uid",dgi="k8s.deployment.name",fgi="k8s.statefulset.uid",pgi="k8s.statefulset.name",hgi="k8s.daemonset.uid",mgi="k8s.daemonset.name",ggi="k8s.job.uid",Agi="k8s.job.name",ygi="k8s.cronjob.uid",Egi="k8s.cronjob.name",_gi="os.type",vgi="os.description",Cgi="os.name",bgi="os.version",Sgi="process.pid",Tgi="process.executable.name",Igi="process.executable.path",xgi="process.command",wgi="process.command_line",Rgi="process.command_args",kgi="process.owner",Pgi="process.runtime.name",Dgi="process.runtime.version",Ngi="process.runtime.description",Mgi="service.name",Ogi="service.namespace",Lgi="service.instance.id",Bgi="service.version",Fgi="telemetry.sdk.name",Ugi="telemetry.sdk.language",Qgi="telemetry.sdk.version",qgi="telemetry.auto.version",jgi="webengine.name",Hgi="webengine.version",Ggi="webengine.description",Spa=y0i,Tpa=E0i,Ipa=_0i,xpa=v0i,wpa=C0i,Rpa=b0i,kpa=S0i,Ppa=T0i,Dpa=I0i,Npa=x0i,Mpa=w0i,Opa=R0i,Lpa=k0i,Bpa=P0i,Fpa=D0i,Upa=N0i,Qpa=M0i,qpa=O0i,jpa=L0i,Hpa=B0i,Gpa=F0i,$pa=U0i,Vpa=Q0i,Wpa=q0i,zpa=j0i,Ypa=H0i,Kpa=G0i,Jpa=$0i,Zpa=V0i,Xpa=W0i,eha=z0i,tha=Y0i,rha=K0i,nha=J0i,iha=Z0i,oha=X0i,sha=egi,aha=tgi,cha=rgi,lha=ngi,uha=igi,dha=ogi,fha=sgi,pha=agi,hha=cgi,mha=lgi,gha=ugi,Aha=dgi,yha=fgi,Eha=pgi,_ha=hgi,vha=mgi,Cha=ggi,bha=Agi,Sha=ygi,Tha=Egi,Iha=_gi,xha=vgi,wha=Cgi,Rha=bgi,kha=Sgi,Pha=Tgi,Dha=Igi,Nha=xgi,Mha=wgi,Oha=Rgi,Lha=kgi,Bha=Pgi,Fha=Dgi,Uha=Ngi,Qha=Mgi,qha=Ogi,jha=Lgi,Hha=Bgi,Gha=Fgi,$ha=Ugi,Vha=Qgi,Wha=qgi,zha=jgi,Yha=Hgi,Kha=Ggi,Jha=fh([y0i,E0i,_0i,v0i,C0i,b0i,S0i,T0i,I0i,x0i,w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i,U0i,Q0i,q0i,j0i,H0i,G0i,$0i,V0i,W0i,z0i,Y0i,K0i,J0i,Z0i,X0i,egi,tgi,rgi,ngi,igi,ogi,sgi,agi,cgi,lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi,kgi,Pgi,Dgi,Ngi,Mgi,Ogi,Lgi,Bgi,Fgi,Ugi,Qgi,qgi,jgi,Hgi,Ggi]),$gi="alibaba_cloud",Vgi="aws",Wgi="azure",zgi="gcp",Zha=$gi,Xha=Vgi,ema=Wgi,tma=zgi,rma=fh([$gi,Vgi,Wgi,zgi]),Ygi="alibaba_cloud_ecs",Kgi="alibaba_cloud_fc",Jgi="aws_ec2",Zgi="aws_ecs",Xgi="aws_eks",eAi="aws_lambda",tAi="aws_elastic_beanstalk",rAi="azure_vm",nAi="azure_container_instances",iAi="azure_aks",oAi="azure_functions",sAi="azure_app_service",aAi="gcp_compute_engine",cAi="gcp_cloud_run",lAi="gcp_kubernetes_engine",uAi="gcp_cloud_functions",dAi="gcp_app_engine",nma=Ygi,ima=Kgi,oma=Jgi,sma=Zgi,ama=Xgi,cma=eAi,lma=tAi,uma=rAi,dma=nAi,fma=iAi,pma=oAi,hma=sAi,mma=aAi,gma=cAi,Ama=lAi,yma=uAi,Ema=dAi,_ma=fh([Ygi,Kgi,Jgi,Zgi,Xgi,eAi,tAi,rAi,nAi,iAi,oAi,sAi,aAi,cAi,lAi,uAi,dAi]),fAi="ec2",pAi="fargate",vma=fAi,Cma=pAi,bma=fh([fAi,pAi]),hAi="amd64",mAi="arm32",gAi="arm64",AAi="ia64",yAi="ppc32",EAi="ppc64",_Ai="x86",Sma=hAi,Tma=mAi,Ima=gAi,xma=AAi,wma=yAi,Rma=EAi,kma=_Ai,Pma=fh([hAi,mAi,gAi,AAi,yAi,EAi,_Ai]),vAi="windows",CAi="linux",bAi="darwin",SAi="freebsd",TAi="netbsd",IAi="openbsd",xAi="dragonflybsd",wAi="hpux",RAi="aix",kAi="solaris",PAi="z_os",Dma=vAi,Nma=CAi,Mma=bAi,Oma=SAi,Lma=TAi,Bma=IAi,Fma=xAi,Uma=wAi,Qma=RAi,qma=kAi,jma=PAi,Hma=fh([vAi,CAi,bAi,SAi,TAi,IAi,xAi,wAi,RAi,kAi,PAi]),DAi="cpp",NAi="dotnet",MAi="erlang",OAi="go",LAi="java",BAi="nodejs",FAi="php",UAi="python",QAi="ruby",qAi="webjs",Gma=DAi,$ma=NAi,Vma=MAi,Wma=OAi,zma=LAi,Yma=BAi,Kma=FAi,Jma=UAi,Zma=QAi,Xma=qAi,e0a=fh([DAi,NAi,MAi,OAi,LAi,BAi,FAi,UAi,QAi,qAi])});var HAi=ve(()=>{p();jAi()});var t0a,r0a,n0a,i0a,o0a,s0a,a0a,c0a,l0a,u0a,d0a,f0a,p0a,h0a,m0a,g0a,A0a,y0a,E0a,_0a,v0a,C0a,b0a,S0a,T0a,I0a,x0a,w0a,R0a,k0a,P0a,D0a,N0a,M0a,O0a,L0a,B0a,F0a,U0a,Q0a,q0a,j0a,Tup,Iup,H0a,G0a,$0a,V0a,W0a,z0a,Y0a,K0a,J0a,Z0a,X0a,ega,tga,rga,nga,iga,oga,sga,aga,cga,lga,uga,dga,fga,pga,hga,mga,gga,Aga,yga,Ega,_ga,vga,Cga,bga,Sga,Tga,Iga,xga,wga,Rga,kga,Pga,Dga,Nga,Mga,Oga,Lga,Bga,Fga,Uga,Qga,qga,jga,Hga,Gga,$ga,Vga,Wga,zga,Yga,Kga,Jga,Zga,Xga,eAa,tAa,rAa,nAa,iAa,CAr,oAa,sAa,aAa,cAa,lAa,bAr,uAa,dAa,fAa,pAa,hAa,mAa,SAr,TAr,gAa,AAa,yAa,EAa,_Aa,vAa,GAi=ve(()=>{p();t0a="aspnetcore.diagnostics.exception.result",r0a="aborted",n0a="handled",i0a="skipped",o0a="unhandled",s0a="aspnetcore.diagnostics.handler.type",a0a="aspnetcore.rate_limiting.policy",c0a="aspnetcore.rate_limiting.result",l0a="acquired",u0a="endpoint_limiter",d0a="global_limiter",f0a="request_canceled",p0a="aspnetcore.request.is_unhandled",h0a="aspnetcore.routing.is_fallback",m0a="aspnetcore.routing.match_status",g0a="failure",A0a="success",y0a="aspnetcore.user.is_authenticated",E0a="client.address",_0a="client.port",v0a="code.column.number",C0a="code.file.path",b0a="code.function.name",S0a="code.line.number",T0a="code.stacktrace",I0a="db.collection.name",x0a="db.namespace",w0a="db.operation.batch.size",R0a="db.operation.name",k0a="db.query.summary",P0a="db.query.text",D0a="db.response.status_code",N0a="db.stored_procedure.name",M0a="db.system.name",O0a="mariadb",L0a="microsoft.sql_server",B0a="mysql",F0a="postgresql",U0a="dotnet.gc.heap.generation",Q0a="gen0",q0a="gen1",j0a="gen2",Tup="loh",Iup="poh",H0a="error.type",G0a="_OTHER",$0a="exception.escaped",V0a="exception.message",W0a="exception.stacktrace",z0a="exception.type",Y0a=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),K0a="http.request.method",J0a="_OTHER",Z0a="CONNECT",X0a="DELETE",ega="GET",tga="HEAD",rga="OPTIONS",nga="PATCH",iga="POST",oga="PUT",sga="TRACE",aga="http.request.method_original",cga="http.request.resend_count",lga=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),uga="http.response.status_code",dga="http.route",fga="jvm.gc.action",pga="jvm.gc.name",hga="jvm.memory.pool.name",mga="jvm.memory.type",gga="heap",Aga="non_heap",yga="jvm.thread.daemon",Ega="jvm.thread.state",_ga="blocked",vga="new",Cga="runnable",bga="terminated",Sga="timed_waiting",Tga="waiting",Iga="network.local.address",xga="network.local.port",wga="network.peer.address",Rga="network.peer.port",kga="network.protocol.name",Pga="network.protocol.version",Dga="network.transport",Nga="pipe",Mga="quic",Oga="tcp",Lga="udp",Bga="unix",Fga="network.type",Uga="ipv4",Qga="ipv6",qga="otel.scope.name",jga="otel.scope.version",Hga="otel.status_code",Gga="ERROR",$ga="OK",Vga="otel.status_description",Wga="server.address",zga="server.port",Yga="service.name",Kga="service.version",Jga="signalr.connection.status",Zga="app_shutdown",Xga="normal_closure",eAa="timeout",tAa="signalr.transport",rAa="long_polling",nAa="server_sent_events",iAa="web_sockets",CAr="telemetry.sdk.language",oAa="cpp",sAa="dotnet",aAa="erlang",cAa="go",lAa="java",bAr="nodejs",uAa="php",dAa="python",fAa="ruby",pAa="rust",hAa="swift",mAa="webjs",SAr="telemetry.sdk.name",TAr="telemetry.sdk.version",gAa="url.fragment",AAa="url.full",yAa="url.path",EAa="url.query",_Aa="url.scheme",vAa="user_agent.original"});var 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,$Ai=ve(()=>{p();CAa="aspnetcore.diagnostics.exceptions",bAa="aspnetcore.rate_limiting.active_request_leases",SAa="aspnetcore.rate_limiting.queued_requests",TAa="aspnetcore.rate_limiting.request.time_in_queue",IAa="aspnetcore.rate_limiting.request_lease.duration",xAa="aspnetcore.rate_limiting.requests",wAa="aspnetcore.routing.match_attempts",RAa="db.client.operation.duration",kAa="dotnet.assembly.count",PAa="dotnet.exceptions",DAa="dotnet.gc.collections",NAa="dotnet.gc.heap.total_allocated",MAa="dotnet.gc.last_collection.heap.fragmentation.size",OAa="dotnet.gc.last_collection.heap.size",LAa="dotnet.gc.last_collection.memory.committed_size",BAa="dotnet.gc.pause.time",FAa="dotnet.jit.compilation.time",UAa="dotnet.jit.compiled_il.size",QAa="dotnet.jit.compiled_methods",qAa="dotnet.monitor.lock_contentions",jAa="dotnet.process.cpu.count",HAa="dotnet.process.cpu.time",GAa="dotnet.process.memory.working_set",$Aa="dotnet.thread_pool.queue.length",VAa="dotnet.thread_pool.thread.count",WAa="dotnet.thread_pool.work_item.count",zAa="dotnet.timer.count",YAa="http.client.request.duration",KAa="http.server.request.duration",JAa="jvm.class.count",ZAa="jvm.class.loaded",XAa="jvm.class.unloaded",eya="jvm.cpu.count",tya="jvm.cpu.recent_utilization",rya="jvm.cpu.time",nya="jvm.gc.duration",iya="jvm.memory.committed",oya="jvm.memory.limit",sya="jvm.memory.used",aya="jvm.memory.used_after_last_gc",cya="jvm.thread.count",lya="kestrel.active_connections",uya="kestrel.active_tls_handshakes",dya="kestrel.connection.duration",fya="kestrel.queued_connections",pya="kestrel.queued_requests",hya="kestrel.rejected_connections",mya="kestrel.tls_handshake.duration",gya="kestrel.upgraded_connections",Aya="signalr.server.active_connections",yya="signalr.server.connection.duration"});var Eya,VAi=ve(()=>{p();Eya="exception"});var IAr={};ki(IAr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>r0a,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>n0a,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>i0a,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>o0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>l0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>u0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>d0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>f0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>g0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>A0a,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>t0a,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>s0a,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>a0a,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>c0a,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>p0a,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>h0a,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>m0a,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>y0a,ATTR_CLIENT_ADDRESS:()=>E0a,ATTR_CLIENT_PORT:()=>_0a,ATTR_CODE_COLUMN_NUMBER:()=>v0a,ATTR_CODE_FILE_PATH:()=>C0a,ATTR_CODE_FUNCTION_NAME:()=>b0a,ATTR_CODE_LINE_NUMBER:()=>S0a,ATTR_CODE_STACKTRACE:()=>T0a,ATTR_DB_COLLECTION_NAME:()=>I0a,ATTR_DB_NAMESPACE:()=>x0a,ATTR_DB_OPERATION_BATCH_SIZE:()=>w0a,ATTR_DB_OPERATION_NAME:()=>R0a,ATTR_DB_QUERY_SUMMARY:()=>k0a,ATTR_DB_QUERY_TEXT:()=>P0a,ATTR_DB_RESPONSE_STATUS_CODE:()=>D0a,ATTR_DB_STORED_PROCEDURE_NAME:()=>N0a,ATTR_DB_SYSTEM_NAME:()=>M0a,ATTR_DOTNET_GC_HEAP_GENERATION:()=>U0a,ATTR_ERROR_TYPE:()=>H0a,ATTR_EXCEPTION_ESCAPED:()=>$0a,ATTR_EXCEPTION_MESSAGE:()=>V0a,ATTR_EXCEPTION_STACKTRACE:()=>W0a,ATTR_EXCEPTION_TYPE:()=>z0a,ATTR_HTTP_REQUEST_HEADER:()=>Y0a,ATTR_HTTP_REQUEST_METHOD:()=>K0a,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>aga,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>cga,ATTR_HTTP_RESPONSE_HEADER:()=>lga,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>uga,ATTR_HTTP_ROUTE:()=>dga,ATTR_JVM_GC_ACTION:()=>fga,ATTR_JVM_GC_NAME:()=>pga,ATTR_JVM_MEMORY_POOL_NAME:()=>hga,ATTR_JVM_MEMORY_TYPE:()=>mga,ATTR_JVM_THREAD_DAEMON:()=>yga,ATTR_JVM_THREAD_STATE:()=>Ega,ATTR_NETWORK_LOCAL_ADDRESS:()=>Iga,ATTR_NETWORK_LOCAL_PORT:()=>xga,ATTR_NETWORK_PEER_ADDRESS:()=>wga,ATTR_NETWORK_PEER_PORT:()=>Rga,ATTR_NETWORK_PROTOCOL_NAME:()=>kga,ATTR_NETWORK_PROTOCOL_VERSION:()=>Pga,ATTR_NETWORK_TRANSPORT:()=>Dga,ATTR_NETWORK_TYPE:()=>Fga,ATTR_OTEL_SCOPE_NAME:()=>qga,ATTR_OTEL_SCOPE_VERSION:()=>jga,ATTR_OTEL_STATUS_CODE:()=>Hga,ATTR_OTEL_STATUS_DESCRIPTION:()=>Vga,ATTR_SERVER_ADDRESS:()=>Wga,ATTR_SERVER_PORT:()=>zga,ATTR_SERVICE_NAME:()=>Yga,ATTR_SERVICE_VERSION:()=>Kga,ATTR_SIGNALR_CONNECTION_STATUS:()=>Jga,ATTR_SIGNALR_TRANSPORT:()=>tAa,ATTR_TELEMETRY_SDK_LANGUAGE:()=>CAr,ATTR_TELEMETRY_SDK_NAME:()=>SAr,ATTR_TELEMETRY_SDK_VERSION:()=>TAr,ATTR_URL_FRAGMENT:()=>gAa,ATTR_URL_FULL:()=>AAa,ATTR_URL_PATH:()=>yAa,ATTR_URL_QUERY:()=>EAa,ATTR_URL_SCHEME:()=>_Aa,ATTR_USER_AGENT_ORIGINAL:()=>vAa,AWSECSLAUNCHTYPEVALUES_EC2:()=>vma,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Cma,AwsEcsLaunchtypeValues:()=>bma,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>nma,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>ima,CLOUDPLATFORMVALUES_AWS_EC2:()=>oma,CLOUDPLATFORMVALUES_AWS_ECS:()=>sma,CLOUDPLATFORMVALUES_AWS_EKS:()=>ama,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>lma,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>cma,CLOUDPLATFORMVALUES_AZURE_AKS:()=>fma,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>hma,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>dma,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>pma,CLOUDPLATFORMVALUES_AZURE_VM:()=>uma,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Ema,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>yma,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>gma,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>mma,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Ama,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Zha,CLOUDPROVIDERVALUES_AWS:()=>Xha,CLOUDPROVIDERVALUES_AZURE:()=>ema,CLOUDPROVIDERVALUES_GCP:()=>tma,CloudPlatformValues:()=>_ma,CloudProviderValues:()=>rma,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>Lda,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>Gda,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Bda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Hda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>Uda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Vda,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Qda,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>Fda,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>$da,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>jda,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>qda,DBSYSTEMVALUES_ADABAS:()=>oda,DBSYSTEMVALUES_CACHE:()=>ida,DBSYSTEMVALUES_CASSANDRA:()=>Cda,DBSYSTEMVALUES_CLOUDSCAPE:()=>Kua,DBSYSTEMVALUES_COCKROACHDB:()=>Mda,DBSYSTEMVALUES_COLDFUSION:()=>vda,DBSYSTEMVALUES_COSMOSDB:()=>wda,DBSYSTEMVALUES_COUCHBASE:()=>Ida,DBSYSTEMVALUES_COUCHDB:()=>xda,DBSYSTEMVALUES_DB2:()=>Vua,DBSYSTEMVALUES_DERBY:()=>ada,DBSYSTEMVALUES_DYNAMODB:()=>Rda,DBSYSTEMVALUES_EDB:()=>nda,DBSYSTEMVALUES_ELASTICSEARCH:()=>Dda,DBSYSTEMVALUES_FILEMAKER:()=>cda,DBSYSTEMVALUES_FIREBIRD:()=>sda,DBSYSTEMVALUES_FIRSTSQL:()=>rda,DBSYSTEMVALUES_GEODE:()=>Pda,DBSYSTEMVALUES_H2:()=>_da,DBSYSTEMVALUES_HANADB:()=>eda,DBSYSTEMVALUES_HBASE:()=>bda,DBSYSTEMVALUES_HIVE:()=>Yua,DBSYSTEMVALUES_HSQLDB:()=>Jua,DBSYSTEMVALUES_INFORMIX:()=>lda,DBSYSTEMVALUES_INGRES:()=>tda,DBSYSTEMVALUES_INSTANTDB:()=>uda,DBSYSTEMVALUES_INTERBASE:()=>dda,DBSYSTEMVALUES_MARIADB:()=>fda,DBSYSTEMVALUES_MAXDB:()=>Xua,DBSYSTEMVALUES_MEMCACHED:()=>Nda,DBSYSTEMVALUES_MONGODB:()=>Sda,DBSYSTEMVALUES_MSSQL:()=>Hua,DBSYSTEMVALUES_MYSQL:()=>Gua,DBSYSTEMVALUES_NEO4J:()=>kda,DBSYSTEMVALUES_NETEZZA:()=>pda,DBSYSTEMVALUES_ORACLE:()=>$ua,DBSYSTEMVALUES_OTHER_SQL:()=>jua,DBSYSTEMVALUES_PERVASIVE:()=>hda,DBSYSTEMVALUES_POINTBASE:()=>mda,DBSYSTEMVALUES_POSTGRESQL:()=>Wua,DBSYSTEMVALUES_PROGRESS:()=>Zua,DBSYSTEMVALUES_REDIS:()=>Tda,DBSYSTEMVALUES_REDSHIFT:()=>zua,DBSYSTEMVALUES_SQLITE:()=>gda,DBSYSTEMVALUES_SYBASE:()=>Ada,DBSYSTEMVALUES_TERADATA:()=>yda,DBSYSTEMVALUES_VERTICA:()=>Eda,DB_SYSTEM_NAME_VALUE_MARIADB:()=>O0a,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>L0a,DB_SYSTEM_NAME_VALUE_MYSQL:()=>B0a,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>F0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>Q0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>q0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>j0a,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>Tup,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Iup,DbCassandraConsistencyLevelValues:()=>Wda,DbSystemValues:()=>Oda,ERROR_TYPE_VALUE_OTHER:()=>G0a,EVENT_EXCEPTION:()=>Eya,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>rfa,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>tfa,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>efa,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>ifa,FAASINVOKEDPROVIDERVALUES_AWS:()=>ofa,FAASINVOKEDPROVIDERVALUES_AZURE:()=>sfa,FAASINVOKEDPROVIDERVALUES_GCP:()=>afa,FAASTRIGGERVALUES_DATASOURCE:()=>zda,FAASTRIGGERVALUES_HTTP:()=>Yda,FAASTRIGGERVALUES_OTHER:()=>Zda,FAASTRIGGERVALUES_PUBSUB:()=>Kda,FAASTRIGGERVALUES_TIMER:()=>Jda,FaasDocumentOperationValues:()=>nfa,FaasInvokedProviderValues:()=>cfa,FaasTriggerValues:()=>Xda,HOSTARCHVALUES_AMD64:()=>Sma,HOSTARCHVALUES_ARM32:()=>Tma,HOSTARCHVALUES_ARM64:()=>Ima,HOSTARCHVALUES_IA64:()=>xma,HOSTARCHVALUES_PPC32:()=>wma,HOSTARCHVALUES_PPC64:()=>Rma,HOSTARCHVALUES_X86:()=>kma,HTTPFLAVORVALUES_HTTP_1_0:()=>$fa,HTTPFLAVORVALUES_HTTP_1_1:()=>Vfa,HTTPFLAVORVALUES_HTTP_2_0:()=>Wfa,HTTPFLAVORVALUES_QUIC:()=>Yfa,HTTPFLAVORVALUES_SPDY:()=>zfa,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Z0a,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>X0a,HTTP_REQUEST_METHOD_VALUE_GET:()=>ega,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>tga,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>rga,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>J0a,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>nga,HTTP_REQUEST_METHOD_VALUE_POST:()=>iga,HTTP_REQUEST_METHOD_VALUE_PUT:()=>oga,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>sga,HostArchValues:()=>Pma,HttpFlavorValues:()=>Kfa,JVM_MEMORY_TYPE_VALUE_HEAP:()=>gga,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Aga,JVM_THREAD_STATE_VALUE_BLOCKED:()=>_ga,JVM_THREAD_STATE_VALUE_NEW:()=>vga,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Cga,JVM_THREAD_STATE_VALUE_TERMINATED:()=>bga,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>Sga,JVM_THREAD_STATE_VALUE_WAITING:()=>Tga,MESSAGETYPEVALUES_RECEIVED:()=>Cpa,MESSAGETYPEVALUES_SENT:()=>vpa,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Jfa,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Zfa,MESSAGINGOPERATIONVALUES_PROCESS:()=>tpa,MESSAGINGOPERATIONVALUES_RECEIVE:()=>epa,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>CAa,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>bAa,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>SAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>xAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>IAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>TAa,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>wAa,METRIC_DB_CLIENT_OPERATION_DURATION:()=>RAa,METRIC_DOTNET_ASSEMBLY_COUNT:()=>kAa,METRIC_DOTNET_EXCEPTIONS:()=>PAa,METRIC_DOTNET_GC_COLLECTIONS:()=>DAa,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>NAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>MAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>OAa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>LAa,METRIC_DOTNET_GC_PAUSE_TIME:()=>BAa,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>FAa,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>UAa,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>QAa,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>qAa,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>jAa,METRIC_DOTNET_PROCESS_CPU_TIME:()=>HAa,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>GAa,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>$Aa,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>VAa,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>WAa,METRIC_DOTNET_TIMER_COUNT:()=>zAa,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>YAa,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>KAa,METRIC_JVM_CLASS_COUNT:()=>JAa,METRIC_JVM_CLASS_LOADED:()=>ZAa,METRIC_JVM_CLASS_UNLOADED:()=>XAa,METRIC_JVM_CPU_COUNT:()=>eya,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>tya,METRIC_JVM_CPU_TIME:()=>rya,METRIC_JVM_GC_DURATION:()=>nya,METRIC_JVM_MEMORY_COMMITTED:()=>iya,METRIC_JVM_MEMORY_LIMIT:()=>oya,METRIC_JVM_MEMORY_USED:()=>sya,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>aya,METRIC_JVM_THREAD_COUNT:()=>cya,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>lya,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>uya,METRIC_KESTREL_CONNECTION_DURATION:()=>dya,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>fya,METRIC_KESTREL_QUEUED_REQUESTS:()=>pya,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>hya,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>mya,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>gya,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Aya,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>yya,MessageTypeValues:()=>bpa,MessagingDestinationKindValues:()=>Xfa,MessagingOperationValues:()=>rpa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Ifa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Rfa,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>Sfa,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>Lfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>xfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>wfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Mfa,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>bfa,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>Ffa,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>kfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Dfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Bfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Pfa,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>Nfa,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Qfa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>Ofa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Hfa,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>qfa,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>jfa,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Ufa,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Tfa,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Efa,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>_fa,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>vfa,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>Afa,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>yfa,NETTRANSPORTVALUES_INPROC:()=>hfa,NETTRANSPORTVALUES_IP:()=>dfa,NETTRANSPORTVALUES_IP_TCP:()=>lfa,NETTRANSPORTVALUES_IP_UDP:()=>ufa,NETTRANSPORTVALUES_OTHER:()=>mfa,NETTRANSPORTVALUES_PIPE:()=>pfa,NETTRANSPORTVALUES_UNIX:()=>ffa,NETWORK_TRANSPORT_VALUE_PIPE:()=>Nga,NETWORK_TRANSPORT_VALUE_QUIC:()=>Mga,NETWORK_TRANSPORT_VALUE_TCP:()=>Oga,NETWORK_TRANSPORT_VALUE_UDP:()=>Lga,NETWORK_TRANSPORT_VALUE_UNIX:()=>Bga,NETWORK_TYPE_VALUE_IPV4:()=>Uga,NETWORK_TYPE_VALUE_IPV6:()=>Qga,NetHostConnectionSubtypeValues:()=>Gfa,NetHostConnectionTypeValues:()=>Cfa,NetTransportValues:()=>gfa,OSTYPEVALUES_AIX:()=>Qma,OSTYPEVALUES_DARWIN:()=>Mma,OSTYPEVALUES_DRAGONFLYBSD:()=>Fma,OSTYPEVALUES_FREEBSD:()=>Oma,OSTYPEVALUES_HPUX:()=>Uma,OSTYPEVALUES_LINUX:()=>Nma,OSTYPEVALUES_NETBSD:()=>Lma,OSTYPEVALUES_OPENBSD:()=>Bma,OSTYPEVALUES_SOLARIS:()=>qma,OSTYPEVALUES_WINDOWS:()=>Dma,OSTYPEVALUES_Z_OS:()=>jma,OTEL_STATUS_CODE_VALUE_ERROR:()=>Gga,OTEL_STATUS_CODE_VALUE_OK:()=>$ga,OsTypeValues:()=>Hma,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>ppa,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>lpa,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>ipa,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>ypa,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>apa,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>fpa,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>gpa,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>spa,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>cpa,RPCGRPCSTATUSCODEVALUES_OK:()=>npa,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>hpa,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>upa,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>dpa,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Epa,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Apa,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>mpa,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>opa,RpcGrpcStatusCodeValues:()=>_pa,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>Kla,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>cua,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>Wla,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Hla,SEMATTRS_AWS_DYNAMODB_COUNT:()=>sua,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>tua,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Xla,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>lua,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Jla,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Gla,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Yla,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>eua,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>zla,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>$la,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Vla,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>aua,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>nua,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>iua,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Zla,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>rua,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>jla,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>oua,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>vca,SEMATTRS_CODE_FILEPATH:()=>Tla,SEMATTRS_CODE_FUNCTION:()=>bla,SEMATTRS_CODE_LINENO:()=>Ila,SEMATTRS_CODE_NAMESPACE:()=>Sla,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Dca,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Bca,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>Lca,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Mca,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>kca,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Pca,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Oca,SEMATTRS_DB_CASSANDRA_TABLE:()=>Nca,SEMATTRS_DB_CONNECTION_STRING:()=>bca,SEMATTRS_DB_HBASE_NAMESPACE:()=>Fca,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Tca,SEMATTRS_DB_MONGODB_COLLECTION:()=>Qca,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Rca,SEMATTRS_DB_NAME:()=>Ica,SEMATTRS_DB_OPERATION:()=>wca,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>Uca,SEMATTRS_DB_SQL_TABLE:()=>qca,SEMATTRS_DB_STATEMENT:()=>xca,SEMATTRS_DB_SYSTEM:()=>Cca,SEMATTRS_DB_USER:()=>Sca,SEMATTRS_ENDUSER_ID:()=>yla,SEMATTRS_ENDUSER_ROLE:()=>Ela,SEMATTRS_ENDUSER_SCOPE:()=>_la,SEMATTRS_EXCEPTION_ESCAPED:()=>$ca,SEMATTRS_EXCEPTION_MESSAGE:()=>Hca,SEMATTRS_EXCEPTION_STACKTRACE:()=>Gca,SEMATTRS_EXCEPTION_TYPE:()=>jca,SEMATTRS_FAAS_COLDSTART:()=>ela,SEMATTRS_FAAS_CRON:()=>Xca,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>zca,SEMATTRS_FAAS_DOCUMENT_NAME:()=>Jca,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Yca,SEMATTRS_FAAS_DOCUMENT_TIME:()=>Kca,SEMATTRS_FAAS_EXECUTION:()=>Wca,SEMATTRS_FAAS_INVOKED_NAME:()=>tla,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>rla,SEMATTRS_FAAS_INVOKED_REGION:()=>nla,SEMATTRS_FAAS_TIME:()=>Zca,SEMATTRS_FAAS_TRIGGER:()=>Vca,SEMATTRS_HTTP_CLIENT_IP:()=>qla,SEMATTRS_HTTP_FLAVOR:()=>Nla,SEMATTRS_HTTP_HOST:()=>kla,SEMATTRS_HTTP_METHOD:()=>xla,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Ola,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>Lla,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>Bla,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>Fla,SEMATTRS_HTTP_ROUTE:()=>Qla,SEMATTRS_HTTP_SCHEME:()=>Pla,SEMATTRS_HTTP_SERVER_NAME:()=>Ula,SEMATTRS_HTTP_STATUS_CODE:()=>Dla,SEMATTRS_HTTP_TARGET:()=>Rla,SEMATTRS_HTTP_URL:()=>wla,SEMATTRS_HTTP_USER_AGENT:()=>Mla,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Uua,SEMATTRS_MESSAGE_ID:()=>Fua,SEMATTRS_MESSAGE_TYPE:()=>Bua,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Qua,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Cua,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>yua,SEMATTRS_MESSAGING_DESTINATION:()=>dua,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>fua,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Iua,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Tua,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Sua,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>xua,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>wua,SEMATTRS_MESSAGING_MESSAGE_ID:()=>Aua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>_ua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Eua,SEMATTRS_MESSAGING_OPERATION:()=>vua,SEMATTRS_MESSAGING_PROTOCOL:()=>hua,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>mua,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>bua,SEMATTRS_MESSAGING_SYSTEM:()=>uua,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>pua,SEMATTRS_MESSAGING_URL:()=>gua,SEMATTRS_NET_HOST_CARRIER_ICC:()=>gla,SEMATTRS_NET_HOST_CARRIER_MCC:()=>hla,SEMATTRS_NET_HOST_CARRIER_MNC:()=>mla,SEMATTRS_NET_HOST_CARRIER_NAME:()=>pla,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>fla,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>dla,SEMATTRS_NET_HOST_IP:()=>cla,SEMATTRS_NET_HOST_NAME:()=>ula,SEMATTRS_NET_HOST_PORT:()=>lla,SEMATTRS_NET_PEER_IP:()=>ola,SEMATTRS_NET_PEER_NAME:()=>ala,SEMATTRS_NET_PEER_PORT:()=>sla,SEMATTRS_NET_TRANSPORT:()=>ila,SEMATTRS_PEER_SERVICE:()=>Ala,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>Dua,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Oua,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>Lua,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Mua,SEMATTRS_RPC_JSONRPC_VERSION:()=>Nua,SEMATTRS_RPC_METHOD:()=>Pua,SEMATTRS_RPC_SERVICE:()=>kua,SEMATTRS_RPC_SYSTEM:()=>Rua,SEMATTRS_THREAD_ID:()=>vla,SEMATTRS_THREAD_NAME:()=>Cla,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>kpa,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Rpa,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Ppa,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Dpa,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>Npa,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Mpa,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Opa,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Bpa,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Lpa,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Upa,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>Fpa,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Tpa,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>xpa,SEMRESATTRS_CLOUD_PLATFORM:()=>wpa,SEMRESATTRS_CLOUD_PROVIDER:()=>Spa,SEMRESATTRS_CLOUD_REGION:()=>Ipa,SEMRESATTRS_CONTAINER_ID:()=>qpa,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Hpa,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Gpa,SEMRESATTRS_CONTAINER_NAME:()=>Qpa,SEMRESATTRS_CONTAINER_RUNTIME:()=>jpa,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>$pa,SEMRESATTRS_DEVICE_ID:()=>Vpa,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Wpa,SEMRESATTRS_DEVICE_MODEL_NAME:()=>zpa,SEMRESATTRS_FAAS_ID:()=>Kpa,SEMRESATTRS_FAAS_INSTANCE:()=>Zpa,SEMRESATTRS_FAAS_MAX_MEMORY:()=>Xpa,SEMRESATTRS_FAAS_NAME:()=>Ypa,SEMRESATTRS_FAAS_VERSION:()=>Jpa,SEMRESATTRS_HOST_ARCH:()=>nha,SEMRESATTRS_HOST_ID:()=>eha,SEMRESATTRS_HOST_IMAGE_ID:()=>oha,SEMRESATTRS_HOST_IMAGE_NAME:()=>iha,SEMRESATTRS_HOST_IMAGE_VERSION:()=>sha,SEMRESATTRS_HOST_NAME:()=>tha,SEMRESATTRS_HOST_TYPE:()=>rha,SEMRESATTRS_K8S_CLUSTER_NAME:()=>aha,SEMRESATTRS_K8S_CONTAINER_NAME:()=>pha,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Tha,SEMRESATTRS_K8S_CRONJOB_UID:()=>Sha,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>vha,SEMRESATTRS_K8S_DAEMONSET_UID:()=>_ha,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>Aha,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>gha,SEMRESATTRS_K8S_JOB_NAME:()=>bha,SEMRESATTRS_K8S_JOB_UID:()=>Cha,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>uha,SEMRESATTRS_K8S_NODE_NAME:()=>cha,SEMRESATTRS_K8S_NODE_UID:()=>lha,SEMRESATTRS_K8S_POD_NAME:()=>fha,SEMRESATTRS_K8S_POD_UID:()=>dha,SEMRESATTRS_K8S_REPLICASET_NAME:()=>mha,SEMRESATTRS_K8S_REPLICASET_UID:()=>hha,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Eha,SEMRESATTRS_K8S_STATEFULSET_UID:()=>yha,SEMRESATTRS_OS_DESCRIPTION:()=>xha,SEMRESATTRS_OS_NAME:()=>wha,SEMRESATTRS_OS_TYPE:()=>Iha,SEMRESATTRS_OS_VERSION:()=>Rha,SEMRESATTRS_PROCESS_COMMAND:()=>Nha,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Oha,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Mha,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Pha,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Dha,SEMRESATTRS_PROCESS_OWNER:()=>Lha,SEMRESATTRS_PROCESS_PID:()=>kha,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Uha,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Bha,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>Fha,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>jha,SEMRESATTRS_SERVICE_NAME:()=>Qha,SEMRESATTRS_SERVICE_NAMESPACE:()=>qha,SEMRESATTRS_SERVICE_VERSION:()=>Hha,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Wha,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>$ha,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Gha,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Vha,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Kha,SEMRESATTRS_WEBENGINE_NAME:()=>zha,SEMRESATTRS_WEBENGINE_VERSION:()=>Yha,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Zga,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Xga,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>eAa,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>rAa,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>nAa,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>iAa,SemanticAttributes:()=>qua,SemanticResourceAttributes:()=>Jha,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Gma,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>$ma,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Vma,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Wma,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>zma,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Yma,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Kma,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Jma,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Zma,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Xma,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>oAa,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>sAa,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>aAa,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>cAa,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>lAa,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>bAr,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>uAa,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>dAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>fAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>pAa,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>hAa,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>mAa,TelemetrySdkLanguageValues:()=>e0a});var Eht=ve(()=>{p();A0i();HAi();GAi();$Ai();VAi()});var WAi,zAi=ve(()=>{p();WAi="process.runtime.name"});var _ht,YAi=ve(()=>{p();Idi();Eht();zAi();_ht={[SAr]:"opentelemetry",[WAi]:"node",[CAr]:bAr,[TAr]:Tdi}});var KAi=ve(()=>{p();vdi();Cdi();Sdi();YAi()});var xAr=ve(()=>{p();KAi()});function v0e(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*vya);return[r,n]}function Cht(){let t=aG.timeOrigin;if(typeof t!="number"){let e=aG;t=e.timing&&e.timing.fetchStart}return t}function wAr(t){let e=v0e(Cht()),r=v0e(typeof t=="number"?t:aG.now());return RAr(e,r)}function ZAi(t){if(bht(t))return t;if(typeof t=="number")return t=vht&&(r[1]-=vht,r[0]+=1),r}var JAi,_ya,vya,vht,oyi=ve(()=>{p();xAr();JAi=9,_ya=6,vya=Math.pow(10,_ya),vht=Math.pow(10,JAi);a(v0e,"millisToHrTime");a(Cht,"getTimeOrigin");a(wAr,"hrTime");a(ZAi,"timeInputToHrTime");a(XAi,"hrTimeDuration");a(eyi,"hrTimeToTimeStamp");a(tyi,"hrTimeToNanoseconds");a(ryi,"hrTimeToMilliseconds");a(nyi,"hrTimeToMicroseconds");a(bht,"isTimeInputHrTime");a(iyi,"isTimeInput");a(RAr,"addHrTimes")});function syi(t){typeof t!="number"&&t.unref()}var ayi=ve(()=>{p();a(syi,"unrefTimer")});var Sht,cyi=ve(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Sht||(Sht={}))});var Tht,lyi=ve(()=>{p();co();Tht=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){Dn.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){Dn.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function uyi(t){return Sya.test(t)}function dyi(t){return Tya.test(t)&&!Iya.test(t)}var kAr,Cya,bya,Sya,Tya,Iya,fyi=ve(()=>{p();kAr="[_0-9a-z-*/]",Cya=`[a-z]${kAr}{0,255}`,bya=`[a-z0-9]${kAr}{0,240}@[a-z]${kAr}{0,13}`,Sya=new RegExp(`^(?:${Cya}|${bya})$`),Tya=/^[ -~]{0,255}[!-~]$/,Iya=/,|=/;a(uyi,"validateKey");a(dyi,"validateValue")});var pyi,xya,hyi,myi,C0e,PAr=ve(()=>{p();fyi();pyi=32,xya=512,hyi=",",myi="=",C0e=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+myi+this.get(r)),e),[]).join(hyi)}_parse(e){e.length>xya||(this._internalState=e.split(hyi).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(myi);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);uyi(c)&&dyi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>pyi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,pyi))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function DAr(t){let e=Nya.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var nOe,iOe,wya,Rya,kya,Pya,Dya,Nya,Iht,gyi=ve(()=>{p();co();tOe();PAr();nOe="traceparent",iOe="tracestate",wya="00",Rya="(?!ff)[\\da-f]{2}",kya="(?![0]{32})[\\da-f]{32}",Pya="(?![0]{16})[\\da-f]{16}",Dya="[\\da-f]{2}",Nya=new RegExp(`^\\s?(${Rya})-(${kya})-(${Pya})-(${Dya})(-.*)?\\s?$`);a(DAr,"parseTraceParent");Iht=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=wu.getSpanContext(e);if(!o||_0e(e)||!vb(o))return;let s=`${wya}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||wf.NONE).toString(16)}`;n.set(r,nOe,s),o.traceState&&n.set(r,iOe,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,nOe);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=DAr(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,iOe);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new C0e(typeof u=="string"?u:void 0)}return wu.setSpanContext(e,c)}fields(){return[nOe,iOe]}}});function Ayi(t,e){return t.setValue(NAr,e)}function yyi(t){return t.deleteValue(NAr)}function Eyi(t){return t.getValue(NAr)}var NAr,xht,_yi=ve(()=>{p();co();NAr=_b("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(xht||(xht={}));a(Ayi,"setRPCMetadata");a(yyi,"deleteRPCMetadata");a(Eyi,"getRPCMetadata")});function MAr(t){if(!Qya(t)||qya(t)!==Mya)return!1;let e=Uya(t);if(e===null)return!0;let r=byi.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&vyi.call(r)===Fya}function Qya(t){return t!=null&&typeof t=="object"}function qya(t){return t==null?t===void 0?Lya:Oya:Pee&&Pee in Object(t)?jya(t):Hya(t)}function jya(t){let e=byi.call(t,Pee),r=t[Pee],n=!1;try{t[Pee]=void 0,n=!0}catch{}let o=Syi.call(t);return n&&(e?t[Pee]=r:delete t[Pee]),o}function Hya(t){return Syi.call(t)}var Mya,Oya,Lya,Bya,vyi,Fya,Uya,Cyi,byi,Pee,Syi,Tyi=ve(()=>{p();Mya="[object Object]",Oya="[object Null]",Lya="[object Undefined]",Bya=Function.prototype,vyi=Bya.toString,Fya=vyi.call(Object),Uya=Object.getPrototypeOf,Cyi=Object.prototype,byi=Cyi.hasOwnProperty,Pee=Symbol?Symbol.toStringTag:void 0,Syi=Cyi.toString;a(MAr,"isPlainObject");a(Qya,"isObjectLike");a(qya,"baseGetTag");a(jya,"getRawTag");a(Hya,"objectToString")});function xyi(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=wyi(e,t.shift(),0,r);return e}function OAr(t){return Rht(t)?t.slice():t}function wyi(t,e,r=0,n){let o;if(!(r>Gya)){if(r++,wht(t)||wht(e)||Ryi(e))o=OAr(e);else if(Rht(t)){if(o=t.slice(),Rht(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(Iyi(t,u,n)||Iyi(e,u,n))delete o[u];else{if(oOe(f)&&oOe(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]=wyi(o[u],d,r,n)}}}}else o=e;return o}}function Iyi(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 $ya(t,e){return!(!MAr(t)||!MAr(e))}var Gya,kyi=ve(()=>{p();Tyi();Gya=20;a(xyi,"merge");a(OAr,"takeValue");a(wyi,"mergeTwoObjects");a(Iyi,"wasObjectReferenced");a(Rht,"isArray");a(Ryi,"isFunction");a(oOe,"isObject");a(wht,"isPrimitive");a($ya,"shouldMerge")});function Pyi(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new sOe("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var sOe,Dyi=ve(()=>{p();sOe=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(Pyi,"callWithTimeout")});function LAr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function Nyi(t,e){if(!e)return!1;for(let r of e)if(LAr(t,r))return!0;return!1}var Myi=ve(()=>{p();a(LAr,"urlMatches");a(Nyi,"isUrlIgnored")});var kht,Oyi=ve(()=>{p();kht=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 Pht,Lyi=ve(()=>{p();Oyi();Pht=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new kht;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 Fyi(t){if(t==null)return;let e=Byi[t.toUpperCase()];return e??(Dn.warn(`Unknown log level "${t}", expected one of ${Object.keys(Byi)}, using default`),Pa.INFO)}var Byi,Uyi=ve(()=>{p();co();Byi={ALL:Pa.ALL,VERBOSE:Pa.VERBOSE,DEBUG:Pa.DEBUG,INFO:Pa.INFO,WARN:Pa.WARN,ERROR:Pa.ERROR,NONE:Pa.NONE};a(Fyi,"diagLogLevelFromString")});function Qyi(t,e){return new Promise(r=>{Og.with(lht(Og.active()),()=>{t.export(e,n=>{r(n)})})})}var qyi=ve(()=>{p();co();tOe();a(Qyi,"_export")});var Dht={};ki(Dht,{AnchoredClock:()=>pht,BindOnceFuture:()=>Pht,CompositePropagator:()=>Tht,ExportResultCode:()=>Sht,RPCType:()=>xht,SDK_INFO:()=>_ht,TRACE_PARENT_HEADER:()=>nOe,TRACE_STATE_HEADER:()=>iOe,TimeoutError:()=>sOe,TraceState:()=>C0e,W3CBaggagePropagator:()=>fht,W3CTraceContextPropagator:()=>Iht,_globalThis:()=>yht,addHrTimes:()=>RAr,callWithTimeout:()=>Pyi,deleteRPCMetadata:()=>yyi,diagLogLevelFromString:()=>Fyi,getBooleanFromEnv:()=>ght,getNumberFromEnv:()=>mht,getRPCMetadata:()=>Eyi,getStringFromEnv:()=>rOe,getStringListFromEnv:()=>Aht,getTimeOrigin:()=>Cht,globalErrorHandler:()=>Edi,hrTime:()=>wAr,hrTimeDuration:()=>XAi,hrTimeToMicroseconds:()=>nyi,hrTimeToMilliseconds:()=>ryi,hrTimeToNanoseconds:()=>tyi,hrTimeToTimeStamp:()=>eyi,internal:()=>Vya,isAttributeValue:()=>yAr,isTimeInput:()=>iyi,isTimeInputHrTime:()=>bht,isTracingSuppressed:()=>_0e,isUrlIgnored:()=>Nyi,loggingErrorHandler:()=>hht,merge:()=>xyi,millisToHrTime:()=>v0e,otperformance:()=>aG,parseKeyPairsIntoRecord:()=>ddi,parseTraceParent:()=>DAr,sanitizeAttributes:()=>hdi,setGlobalErrorHandler:()=>ydi,setRPCMetadata:()=>Ayi,suppressTracing:()=>lht,timeInputToHrTime:()=>ZAi,unrefTimer:()=>syi,unsuppressTracing:()=>sdi,urlMatches:()=>LAr});var Vya,Nht=ve(()=>{p();fdi();pdi();gdi();_di();EAr();oyi();ayi();cyi();AAr();xAr();lyi();gyi();_yi();tOe();PAr();kyi();Dyi();Myi();Lyi();Uyi();qyi();Vya={_export:Qyi}});var Gyi=I(Mht=>{"use strict";p();Object.defineProperty(Mht,"__esModule",{value:!0});Mht.OpenTelemetrySpanWrapper=void 0;var jyi=(co(),Ca(V5)),Hyi=(Nht(),Ca(Dht)),Wya=hAr(),BAr=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&zya(e.error)?e.error?(this._span.setStatus({code:jyi.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:jyi.SpanStatusCode.ERROR}):e.status==="success"&&Wya.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,Hyi.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,Hyi.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};Mht.OpenTelemetrySpanWrapper=BAr;function zya(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(zya,"isRecordableError")});var FAr=I(S4=>{"use strict";p();Object.defineProperty(S4,"__esModule",{value:!0});S4.environmentCache=S4.SDK_VERSION=void 0;S4.envVarToBoolean=Yya;S4.SDK_VERSION="1.0.0-beta.9";S4.environmentCache=new Map;function Yya(t){var e;S4.environmentCache.has(t)||Kya(t);let r=((e=S4.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(Yya,"envVarToBoolean");function Kya(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];S4.environmentCache.set(t,r)}}a(Kya,"loadEnvironmentVariable")});var zyi=I(Oht=>{"use strict";p();Object.defineProperty(Oht,"__esModule",{value:!0});Oht.toOpenTelemetrySpanKind=Wyi;Oht.toSpanOptions=Zya;var $yi=(co(),Ca(V5)),Vyi=(Nht(),Ca(Dht));function Wyi(t){let e=(t||"internal").toUpperCase();return $yi.SpanKind[e]}a(Wyi,"toOpenTelemetrySpanKind");function Jya(t=[]){return t.reduce((e,r)=>{let n=$yi.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,Vyi.sanitizeAttributes)(r.attributes)}),e},[])}a(Jya,"toOpenTelemetryLinks");function Zya(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,Vyi.sanitizeAttributes)(e),s=Wyi(n),c=Jya(r);return{attributes:o,kind:s,links:c}}a(Zya,"toSpanOptions")});var Jyi=I(cG=>{"use strict";p();Object.defineProperty(cG,"__esModule",{value:!0});cG.OpenTelemetryInstrumenter=cG.propagator=void 0;var T4=(co(),Ca(V5)),Kyi=(Nht(),Ca(Dht)),Xya=Gyi(),Yyi=FAr(),eEa=zyi();cG.propagator=new Kyi.W3CTraceContextPropagator;var UAr=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||T4.context.active(),o;return(0,Yyi.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=T4.trace.wrapSpanContext(T4.INVALID_SPAN_CONTEXT):(o=T4.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,eEa.toSpanOptions)(r),n),(0,Yyi.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,Kyi.suppressTracing)(n))),{span:new Xya.OpenTelemetrySpanWrapper(o),tracingContext:T4.trace.setSpan(n,o)}}withContext(e,r,...n){return T4.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return cG.propagator.extract(T4.context.active(),{traceparent:e},T4.defaultTextMapGetter)}createRequestHeaders(e){let r={};return cG.propagator.inject(e||T4.context.active(),r,T4.defaultTextMapSetter),r}};cG.OpenTelemetryInstrumenter=UAr});var Xyi=I(aOe=>{"use strict";p();Object.defineProperty(aOe,"__esModule",{value:!0});aOe.AzureSdkInstrumentation=void 0;aOe.createAzureSdkInstrumentation=nEa;var Zyi=(sAr(),Ca(oAr)),tEa=Jyi(),rEa=FAr(),Lht=class extends Zyi.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",rEa.SDK_VERSION,Object.assign({},e))}init(){let e=new Zyi.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new tEa.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};aOe.AzureSdkInstrumentation=Lht;function nEa(t={}){return new Lht(t)}a(nEa,"createAzureSdkInstrumentation")});var tEi=I(Bht=>{"use strict";p();Object.defineProperty(Bht,"__esModule",{value:!0});var eEi=(m3(),Ca(oQ));eEi.__exportStar(hAr(),Bht);eEi.__exportStar(Xyi(),Bht)});var nEi=I(mR=>{"use strict";p();Object.defineProperty(mR,"__esModule",{value:!0});mR.enable=mR.azureCoreTracing=mR.AzureMonitorSymbol=void 0;var QAr=Cp();mR.AzureMonitorSymbol="Azure_Monitor_Tracer";var qAr="azure-coretracing",rEi=!1,iEa=a(function(t){if(rEi)return t;try{var e=(nli(),Ca(rli)),r=(co(),Ca(V5)),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 E=y.apply(this,arguments);return QAr.channel.publish(qAr,A),E},A},d[mR.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[mR.AzureMonitorSymbol]){var A=g.startSpan;g.startSpan=function(y,E,_){var v=A.call(this,y,E,_),b=v.end;return v.end=function(){var T=b.apply(this,arguments);return QAr.channel.publish(qAr,v),T},v},g[mR.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(sAr(),Ca(oAr)),u=tEi();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}rEi=!0}catch{}return t},"azureCoreTracingPatchFunction");mR.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:iEa,publisherName:qAr};function oEa(){QAr.channel.registerMonkeyPatch("@azure/core-tracing",mR.azureCoreTracing)}a(oEa,"enable");mR.enable=oEa});var oEi=I(Dee=>{"use strict";p();Object.defineProperty(Dee,"__esModule",{value:!0});Dee.enable=Dee.bunyan=void 0;var iEi=Cp(),sEa=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)),iEi.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");Dee.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:sEa};function aEa(){iEi.channel.registerMonkeyPatch("bunyan",Dee.bunyan)}a(aEa,"enable");Dee.enable=aEa});var aEi=I(Nee=>{"use strict";p();Object.defineProperty(Nee,"__esModule",{value:!0});Nee.enable=Nee.console=void 0;var jAr=Cp(),sEi=require("stream"),cEa=a(function(t){var e=new sEi.Writable,r=new sEi.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return jAr.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return jAr.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:cEa};function lEa(){jAr.channel.registerMonkeyPatch("console",Nee.console),require("console")}a(lEa,"enable");Nee.enable=lEa});var cEi=I(Mee=>{"use strict";p();Object.defineProperty(Mee,"__esModule",{value:!0});Mee.enable=Mee.mongoCore=void 0;var HAr=Cp(),uEa=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]=HAr.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]=HAr.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");Mee.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:uEa};function dEa(){HAr.channel.registerMonkeyPatch("mongodb-core",Mee.mongoCore)}a(dEa,"enable");Mee.enable=dEa});var lEi=I(bv=>{"use strict";p();var b0e=bv&&bv.__assign||function(){return b0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:fEa};bv.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:pEa};bv.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:mEa};function gEa(){NE.channel.registerMonkeyPatch("mongodb",bv.mongo2),NE.channel.registerMonkeyPatch("mongodb",bv.mongo3),NE.channel.registerMonkeyPatch("mongodb",bv.mongo330)}a(gEa,"enable");bv.enable=gEa});var dEi=I(Oee=>{"use strict";p();Object.defineProperty(Oee,"__esModule",{value:!0});Oee.enable=Oee.mysql=void 0;var Fht=Cp(),uEi=require("path"),AEa=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 E=arguments[A],_={result:null,startTime:null,startDate:null};typeof E=="function"&&(h?(_.startTime=process.hrtime(),_.startDate=new Date,arguments[A]=Fht.channel.bindToContext(h(_,E))):arguments[A]=Fht.channel.bindToContext(E));var v=m.apply(this,arguments);return _.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(uEi.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;Fht.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(uEi.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");Oee.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:AEa};function yEa(){Fht.channel.registerMonkeyPatch("mysql",Oee.mysql)}a(yEa,"enable");Oee.enable=yEa});var pEi=I(Lee=>{"use strict";p();Object.defineProperty(Lee,"__esModule",{value:!0});Lee.enable=Lee.postgresPool1=void 0;var fEi=Cp();function EEa(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=fEi.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(EEa,"postgresPool1PatchFunction");Lee.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:EEa};function _Ea(){fEi.channel.registerMonkeyPatch("pg-pool",Lee.postgresPool1)}a(_Ea,"enable");Lee.enable=_Ea});var mEi=I(I4=>{"use strict";p();Object.defineProperty(I4,"__esModule",{value:!0});I4.enable=I4.postgres=I4.postgres6=void 0;var S0e=Cp(),hEi=require("events"),GAr="postgres";function vEa(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=S0e.channel.bindToContext(function(A,y){var E=process.hrtime(d);if(u.result=y&&{rowCount:y.rowCount,command:y.command},u.error=A,u.duration=Math.ceil(E[0]*1e3+E[1]/1e6),S0e.channel.publish(GAr,u),A){if(m)return m.apply(this,arguments);f&&f instanceof hEi.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(vEa,"postgres6PatchFunction");function CEa(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 b=S0e.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),S0e.channel.publish(GAr,m),T){if(v)return v.apply(this,arguments);g&&g instanceof hEi.EventEmitter&&g.emit("error",T)}else v&&v.apply(this,arguments)});try{return Object.defineProperty(b,n,{value:v}),b}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(b,T){b(v)})}).catch(function(v){return y()(v,void 0),new u._Promise(function(b,T){T(v)})});var E=g.text?g.text:"";if(g.cursor&&(E=(f=g.cursor)===null||f===void 0?void 0:f.text),E){var _={command:E,rowCount:0};y()(void 0,_)}}return g},"query"),t}a(CEa,"postgresLatestPatchFunction");I4.postgres6={versionSpecifier:"6.*",patch:vEa};I4.postgres={versionSpecifier:">=7.* <=8.*",patch:CEa,publisherName:GAr};function bEa(){S0e.channel.registerMonkeyPatch("pg",I4.postgres6),S0e.channel.registerMonkeyPatch("pg",I4.postgres)}a(bEa,"enable");I4.enable=bEa});var gEi=I(Bee=>{"use strict";p();Object.defineProperty(Bee,"__esModule",{value:!0});Bee.enable=Bee.redis=void 0;var $Ar=Cp(),SEa=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=$Ar.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;$Ar.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");Bee.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:SEa};function TEa(){$Ar.channel.registerMonkeyPatch("redis",Bee.redis)}a(TEa,"enable");Bee.enable=TEa});var AEi=I(L8=>{"use strict";p();var Uht=L8&&L8.__assign||function(){return Uht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:IEa};function xEa(){VAr.channel.registerMonkeyPatch("tedious",L8.tedious)}a(xEa,"enable");L8.enable=xEa});var yEi=I(qb=>{"use strict";p();var wEa=qb&&qb.__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)}})(),REa=qb&&qb.__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");qb.winston3={versionSpecifier:"3.x",patch:PEa};qb.winston2={versionSpecifier:"2.x",patch:kEa};function DEa(){Qht.channel.registerMonkeyPatch("winston",qb.winston2),Qht.channel.registerMonkeyPatch("winston",qb.winston3)}a(DEa,"enable");qb.enable=DEa});var kEi=I(ku=>{"use strict";p();Object.defineProperty(ku,"__esModule",{value:!0});ku.enable=ku.tedious=ku.pgPool=ku.pg=ku.winston=ku.redis=ku.mysql=ku.mongodb=ku.mongodbCore=ku.console=ku.bunyan=ku.azuresdk=void 0;var EEi=nEi();ku.azuresdk=EEi;var _Ei=oEi();ku.bunyan=_Ei;var vEi=aEi();ku.console=vEi;var CEi=cEi();ku.mongodbCore=CEi;var bEi=lEi();ku.mongodb=bEi;var SEi=dEi();ku.mysql=SEi;var TEi=pEi();ku.pgPool=TEi;var IEi=mEi();ku.pg=IEi;var xEi=gEi();ku.redis=xEi;var wEi=AEi();ku.tedious=wEi;var REi=yEi();ku.winston=REi;function NEa(){_Ei.enable(),vEi.enable(),CEi.enable(),bEi.enable(),SEi.enable(),IEi.enable(),TEi.enable(),xEi.enable(),REi.enable(),EEi.enable(),wEi.enable()}a(NEa,"enable");ku.enable=NEa});var Hht=I(Fee=>{"use strict";p();Object.defineProperty(Fee,"__esModule",{value:!0});Fee.IsInitialized=void 0;Fee.registerContextPreservation=MEa;var WAr=Kl(),DEi=rpt();Fee.IsInitialized=!DEi.JsonConfig.getInstance().noDiagnosticChannel;var zAr="DiagnosticChannel";if(Fee.IsInitialized){iD=kEi(),PEi=DEi.JsonConfig.getInstance().noPatchModules,qht=PEi.split(","),YAr={bunyan:iD.bunyan,console:iD.console,mongodb:iD.mongodb,mongodbCore:iD.mongodbCore,mysql:iD.mysql,redis:iD.redis,pg:iD.pg,pgPool:iD.pgPool,winston:iD.winston,azuresdk:iD.azuresdk};for(jht in YAr)qht.indexOf(jht)===-1&&(YAr[jht].enable(),WAr.info(zAr,"Subscribed to ".concat(jht," events")));qht.length>0&&WAr.info(zAr,"Some modules will not be patched",qht)}else WAr.info(zAr,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var iD,PEi,qht,YAr,jht;function MEa(t){if(Fee.IsInitialized){var e=Cp();e.channel.addContextPreservation(t)}}a(MEa,"registerContextPreservation")});var T0e=I((Ppp,NEi)=>{"use strict";p();NEi.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 ay=I((ZAr,MEi)=>{"use strict";p();var uG=ZAr&&ZAr.__assign||function(){return uG=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"){Uee.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"){Uee.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+")",Uee.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 XAr=ay(),FEa=(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"|"+XAr.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=XAr.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=XAr.randomu32(),t})();OEi.exports=FEa});var Ght=I((Fpp,LEi)=>{"use strict";p();var cy=ay(),UEa=Qee(),QEa=(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=cy.w3cTraceId(),this.spanId=cy.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=cy.w3cTraceId(),this.spanId=cy.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=cy.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=cy.w3cTraceId(),this.spanId=cy.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=cy.w3cTraceId(),this.spanId=cy.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=cy.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=cy.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=cy.w3cTraceId().substr(0,16),this.traceId=cy.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=UEa.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=cy.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=cy.w3cTraceId(),this.spanId=cy.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=cy.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();LEi.exports=QEa});var eyr=I((qpp,BEi)=>{"use strict";p();var qEa=(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 jEa=(function(){function t(){}return a(t,"Domain"),t})();FEi.exports=jEa});var QEi=I((tyr,UEi)=>{"use strict";p();var HEa=tyr&&tyr.__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)}})(),GEa=B8(),$Ea=(function(t){HEa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(GEa);UEi.exports=$Ea});var ryr=I((Ypp,qEi)=>{"use strict";p();var VEa=(function(){function t(){}return a(t,"Base"),t})();qEi.exports=VEa});var HEi=I((Zpp,jEi)=>{"use strict";p();var WEa=(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})();jEi.exports=WEa});var $Ei=I((nyr,GEi)=>{"use strict";p();var zEa=nyr&&nyr.__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)}})(),YEa=ryr(),KEa=(function(t){zEa(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(YEa);GEi.exports=KEa});var oyr=I((nhp,VEi)=>{"use strict";p();var iyr;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(iyr||(iyr={}));VEi.exports=iyr});var zEi=I((ohp,WEi)=>{"use strict";p();var JEa=oyr(),ZEa=(function(){function t(){this.kind=JEa.Measurement}return a(t,"DataPoint"),t})();WEi.exports=ZEa});var KEi=I((chp,YEi)=>{"use strict";p();var XEa=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();YEi.exports=XEa});var ayr=I((syr,JEi)=>{"use strict";p();var e_a=syr&&syr.__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)}})(),t_a=B8(),r_a=(function(t){e_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(t_a);JEi.exports=r_a});var XEi=I((cyr,ZEi)=>{"use strict";p();var n_a=cyr&&cyr.__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)}})(),i_a=B8(),o_a=(function(t){n_a(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})(i_a);ZEi.exports=o_a});var t_i=I((mhp,e_i)=>{"use strict";p();var s_a=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();e_i.exports=s_a});var n_i=I((lyr,r_i)=>{"use strict";p();var a_a=lyr&&lyr.__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)}})(),c_a=B8(),l_a=(function(t){a_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(c_a);r_i.exports=l_a});var o_i=I((uyr,i_i)=>{"use strict";p();var u_a=uyr&&uyr.__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)}})(),d_a=B8(),f_a=(function(t){u_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(d_a);i_i.exports=f_a});var a_i=I((dyr,s_i)=>{"use strict";p();var p_a=dyr&&dyr.__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)}})(),h_a=ayr(),m_a=(function(t){p_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(h_a);s_i.exports=m_a});var l_i=I((fyr,c_i)=>{"use strict";p();var g_a=fyr&&fyr.__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)}})(),A_a=B8(),y_a=(function(t){g_a(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})(A_a);c_i.exports=y_a});var d_i=I((pyr,u_i)=>{"use strict";p();var E_a=pyr&&pyr.__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)}})(),__a=B8(),v_a=(function(t){E_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(__a);u_i.exports=v_a});var p_i=I((whp,f_i)=>{"use strict";p();var hyr;(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"})(hyr||(hyr={}));f_i.exports=hyr});var m_i=I((khp,h_i)=>{"use strict";p();var C_a=(function(){function t(){}return a(t,"StackFrame"),t})();h_i.exports=C_a});var myr=I(ym=>{"use strict";p();Object.defineProperty(ym,"__esModule",{value:!0});ym.AvailabilityData=QEi();ym.Base=ryr();ym.ContextTagKeys=HEi();ym.Data=$Ei();ym.DataPoint=zEi();ym.DataPointType=oyr();ym.Domain=B8();ym.Envelope=KEi();ym.EventData=ayr();ym.ExceptionData=XEi();ym.ExceptionDetails=t_i();ym.MessageData=n_i();ym.MetricData=o_i();ym.PageViewData=a_i();ym.RemoteDependencyData=l_i();ym.RequestData=d_i();ym.SeverityLevel=p_i();ym.StackFrame=m_i()});var g_i=I(cOe=>{"use strict";p();Object.defineProperty(cOe,"__esModule",{value:!0});cOe.RemoteDependencyDataConstants=void 0;cOe.domainSupportsProperties=S_a;var qee=myr(),b_a=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();cOe.RemoteDependencyDataConstants=b_a;function S_a(t){return"properties"in t||t instanceof qee.EventData||t instanceof qee.ExceptionData||t instanceof qee.MessageData||t instanceof qee.MetricData||t instanceof qee.PageViewData||t instanceof qee.RemoteDependencyData||t instanceof qee.RequestData}a(S_a,"domainSupportsProperties")});var y_i=I(A_i=>{"use strict";p();Object.defineProperty(A_i,"__esModule",{value:!0})});var __i=I(E_i=>{"use strict";p();Object.defineProperty(E_i,"__esModule",{value:!0})});var C_i=I(v_i=>{"use strict";p();Object.defineProperty(v_i,"__esModule",{value:!0})});var S_i=I(b_i=>{"use strict";p();Object.defineProperty(b_i,"__esModule",{value:!0})});var I_i=I(T_i=>{"use strict";p();Object.defineProperty(T_i,"__esModule",{value:!0})});var w_i=I(x_i=>{"use strict";p();Object.defineProperty(x_i,"__esModule",{value:!0})});var k_i=I(R_i=>{"use strict";p();Object.defineProperty(R_i,"__esModule",{value:!0})});var D_i=I(P_i=>{"use strict";p();Object.defineProperty(P_i,"__esModule",{value:!0})});var M_i=I(N_i=>{"use strict";p();Object.defineProperty(N_i,"__esModule",{value:!0})});var L_i=I(O_i=>{"use strict";p();Object.defineProperty(O_i,"__esModule",{value:!0})});var F_i=I(B_i=>{"use strict";p();Object.defineProperty(B_i,"__esModule",{value:!0})});var Q_i=I(U_i=>{"use strict";p();Object.defineProperty(U_i,"__esModule",{value:!0})});var q_i=I(dG=>{"use strict";p();Object.defineProperty(dG,"__esModule",{value:!0});dG.TelemetryType=dG.TelemetryTypeString=void 0;dG.telemetryTypeToBaseType=T_a;dG.baseTypeToTelemetryType=I_a;function T_a(t){switch(t){case Hg.Event:return"EventData";case Hg.Exception:return"ExceptionData";case Hg.Trace:return"MessageData";case Hg.Metric:return"MetricData";case Hg.Request:return"RequestData";case Hg.Dependency:return"RemoteDependencyData";case Hg.Availability:return"AvailabilityData";case Hg.PageView:return"PageViewData"}}a(T_a,"telemetryTypeToBaseType");function I_a(t){switch(t){case"EventData":return Hg.Event;case"ExceptionData":return Hg.Exception;case"MessageData":return Hg.Trace;case"MetricData":return Hg.Metric;case"RequestData":return Hg.Request;case"RemoteDependencyData":return Hg.Dependency;case"AvailabilityData":return Hg.Availability;case"PageViewData":return Hg.PageView}}a(I_a,"baseTypeToTelemetryType");dG.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var Hg;(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"})(Hg||(dG.TelemetryType=Hg={}))});var j_i=I(b0=>{"use strict";p();var x_a=b0&&b0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WT=b0&&b0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&x_a(e,t,r)};Object.defineProperty(b0,"__esModule",{value:!0});WT(y_i(),b0);WT(__i(),b0);WT(C_i(),b0);WT(S_i(),b0);WT(I_i(),b0);WT(w_i(),b0);WT(k_i(),b0);WT(D_i(),b0);WT(M_i(),b0);WT(L_i(),b0);WT(F_i(),b0);WT(Q_i(),b0);WT(q_i(),b0)});var G_i=I(H_i=>{"use strict";p();Object.defineProperty(H_i,"__esModule",{value:!0})});var V_i=I($_i=>{"use strict";p();Object.defineProperty($_i,"__esModule",{value:!0})});var z_i=I(W_i=>{"use strict";p();Object.defineProperty(W_i,"__esModule",{value:!0})});var K_i=I(Y_i=>{"use strict";p();Object.defineProperty(Y_i,"__esModule",{value:!0})});var Z_i=I(J_i=>{"use strict";p();Object.defineProperty(J_i,"__esModule",{value:!0})});var evi=I(X_i=>{"use strict";p();Object.defineProperty(X_i,"__esModule",{value:!0})});var rvi=I(tvi=>{"use strict";p();Object.defineProperty(tvi,"__esModule",{value:!0})});var ivi=I(nvi=>{"use strict";p();Object.defineProperty(nvi,"__esModule",{value:!0})});var ovi=I(jb=>{"use strict";p();var w_a=jb&&jb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fG=jb&&jb.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&w_a(e,t,r)};Object.defineProperty(jb,"__esModule",{value:!0});fG(G_i(),jb);fG(V_i(),jb);fG(z_i(),jb);fG(K_i(),jb);fG(Z_i(),jb);fG(evi(),jb);fG(rvi(),jb);fG(ivi(),jb)});var ME=I(x4=>{"use strict";p();var R_a=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]})),$ht=x4&&x4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&R_a(e,t,r)};Object.defineProperty(x4,"__esModule",{value:!0});$ht(g_i(),x4);$ht(myr(),x4);$ht(j_i(),x4);$ht(ovi(),x4)});var gyr=I((Lmp,svi)=>{"use strict";p();var k_a=(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 oD;Object.defineProperty(jr,"__esModule",{value:!0});jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE=jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE=jr.TIME_SINCE_ENQUEUED=jr.ENQUEUED_TIME=jr.MessageBusDestination=jr.MicrosoftEventHub=jr.AzNamespace=jr.AttachTypePrefix=jr.HttpRequestCookieNames=jr.StatsbeatNetworkCategory=jr.StatsbeatFeatureType=jr.StatsbeatInstrumentation=jr.StatsbeatFeature=jr.StatsbeatCounter=jr.StatsbeatAttach=jr.StatsbeatResourceProvider=jr.StatsbeatTelemetryName=jr.HeartBeatMetricName=jr.DependencyTypeName=jr.TelemetryTypeStringToQuickPulseDocumentType=jr.TelemetryTypeStringToQuickPulseType=jr.QuickPulseType=jr.QuickPulseDocumentType=jr.PerformanceToQuickPulseCounter=jr.MetricId=jr.PerformanceCounter=jr.QuickPulseCounter=jr.DEFAULT_LIVEMETRICS_HOST=jr.DEFAULT_LIVEMETRICS_ENDPOINT=jr.DEFAULT_BREEZE_ENDPOINT=jr.APPLICATION_INSIGHTS_SDK_VERSION=void 0;jr.APPLICATION_INSIGHTS_SDK_VERSION="2.9.8";jr.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com";var ly;(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"})(ly||(jr.QuickPulseCounter=ly={}));var lOe;(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"})(lOe||(jr.PerformanceCounter=lOe={}));var avi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(avi||(jr.MetricId=avi={}));jr.PerformanceToQuickPulseCounter=(oD={},oD[lOe.PROCESSOR_TIME]=ly.PROCESSOR_TIME,oD[lOe.REQUEST_RATE]=ly.REQUEST_RATE,oD[lOe.REQUEST_DURATION]=ly.REQUEST_DURATION,oD[ly.COMMITTED_BYTES]=ly.COMMITTED_BYTES,oD[ly.REQUEST_FAILURE_RATE]=ly.REQUEST_FAILURE_RATE,oD[ly.DEPENDENCY_RATE]=ly.DEPENDENCY_RATE,oD[ly.DEPENDENCY_FAILURE_RATE]=ly.DEPENDENCY_FAILURE_RATE,oD[ly.DEPENDENCY_DURATION]=ly.DEPENDENCY_DURATION,oD[ly.EXCEPTION_RATE]=ly.EXCEPTION_RATE,oD);jr.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability",PageView:"PageView"};jr.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument",PageView:"PageViewTelemetryDocument"};jr.TelemetryTypeStringToQuickPulseType={EventData:jr.QuickPulseType.Event,ExceptionData:jr.QuickPulseType.Exception,MessageData:jr.QuickPulseType.Trace,MetricData:jr.QuickPulseType.Metric,RequestData:jr.QuickPulseType.Request,RemoteDependencyData:jr.QuickPulseType.Dependency,AvailabilityData:jr.QuickPulseType.Availability,PageViewData:jr.QuickPulseType.PageView};jr.TelemetryTypeStringToQuickPulseDocumentType={EventData:jr.QuickPulseDocumentType.Event,ExceptionData:jr.QuickPulseDocumentType.Exception,MessageData:jr.QuickPulseDocumentType.Trace,MetricData:jr.QuickPulseDocumentType.Metric,RequestData:jr.QuickPulseDocumentType.Request,RemoteDependencyData:jr.QuickPulseDocumentType.Dependency,AvailabilityData:jr.QuickPulseDocumentType.Availability,PageViewData:jr.QuickPulseDocumentType.PageView};jr.DependencyTypeName={Grpc:"GRPC",Http:"HTTP",InProc:"InProc",Sql:"SQL",QueueMessage:"Queue Message"};jr.HeartBeatMetricName="HeartbeatState";jr.StatsbeatTelemetryName="Statsbeat";jr.StatsbeatResourceProvider={appsvc:"appsvc",aks:"aks",functions:"functions",vm:"vm",unknown:"unknown"};jr.StatsbeatAttach={codeless:"IntegratedAuto",sdk:"Manual"};jr.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 cvi;(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"})(cvi||(jr.StatsbeatFeature=cvi={}));var lvi;(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"})(lvi||(jr.StatsbeatInstrumentation=lvi={}));var uvi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(uvi||(jr.StatsbeatFeatureType=uvi={}));var dvi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(dvi||(jr.StatsbeatNetworkCategory=dvi={}));var fvi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(fvi||(jr.HttpRequestCookieNames=fvi={}));var pvi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(pvi||(jr.AttachTypePrefix=pvi={}));jr.AzNamespace="az.namespace";jr.MicrosoftEventHub="Microsoft.EventHub";jr.MessageBusDestination="message_bus.destination";jr.ENQUEUED_TIME="enqueuedTime";jr.TIME_SINCE_ENQUEUED="timeSinceEnqueued";jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE="https://js.monitor.azure.com/scripts/b/ai";jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE="https://az416426.vo.msecnd.net/scripts/b/ai"});var _yr=I((Eyr,hvi)=>{"use strict";p();var P_a=Eyr&&Eyr.__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)}})(),Vht=require("url"),D_a=ME(),Ayr=ay(),zT=T0e(),N_a=gyr(),pG=Qee(),M_a=eyr(),yyr=Ght(),O_a=Kl(),Wht=md(),L_a=(function(t){P_a(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 Vht.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(Wht.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(Wht.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(Wht.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 Vht.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 Vht.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=Vht.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===Wht.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",O_a.warn("Could not decode the auth cookie with error: ",Ayr.dumpObj(s))}var o=e.parseId(Ayr.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=Ayr.getCorrelationContextTarget(r,zT.requestContextSourceKey),r.headers){var o=r.headers[zT.traceStateHeader]?r.headers[zT.traceStateHeader].toString():null,s=r.headers[zT.traceparentHeader]?r.headers[zT.traceparentHeader].toString():null,c=r.headers[zT.requestIdHeader]?r.headers[zT.requestIdHeader].toString():null,l=r.headers[zT.parentIdHeader]?r.headers[zT.parentIdHeader].toString():null,u=r.headers[zT.rootIdHeader]?r.headers[zT.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[zT.correlationContextHeader]?r.headers[zT.correlationContextHeader].toString():null,pG.w3cEnabled&&(s||o)?(this.traceparent=new yyr(s?s.toString():null),this.tracestate=s&&o&&new M_a(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?pG.w3cEnabled?(this.traceparent=new yyr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=pG.generateRequestId(this.parentId),this.operationId=pG.getRootId(this.requestId)):pG.w3cEnabled?(this.traceparent=new yyr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=pG.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=pG.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=pG.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new D_a.ContextTagKeys,e})(N_a);hvi.exports=L_a});var Pvi=I((Eo,kvi)=>{p();Eo=kvi.exports=Na;var dl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?dl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):dl=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var uOe=256,zht=Number.MAX_SAFE_INTEGER||9007199254740991,vyr=16,B_a=uOe-6,dOe=Eo.re=[],Pu=Eo.safeRe=[],tr=Eo.src=[],ha=0,Iyr="[a-zA-Z0-9-]",Cyr=[["\\s",1],["\\d",uOe],[Iyr,B_a]];function emt(t){for(var e=0;e)?=?)";var Yht=ha++;tr[Yht]=tr[w0e]+"|x|X|\\*";var Kht=ha++;tr[Kht]=tr[x0e]+"|x|X|\\*";var jee=ha++;tr[jee]="[v=\\s]*("+tr[Kht]+")(?:\\.("+tr[Kht]+")(?:\\.("+tr[Kht]+")(?:"+tr[wyr]+")?"+tr[pOe]+"?)?)?";var k0e=ha++;tr[k0e]="[v=\\s]*("+tr[Yht]+")(?:\\.("+tr[Yht]+")(?:\\.("+tr[Yht]+")(?:"+tr[Ryr]+")?"+tr[pOe]+"?)?)?";var Evi=ha++;tr[Evi]="^"+tr[N0e]+"\\s*"+tr[jee]+"$";var _vi=ha++;tr[_vi]="^"+tr[N0e]+"\\s*"+tr[k0e]+"$";var vvi=ha++;tr[vvi]="(?:^|[^\\d])(\\d{1,"+vyr+"})(?:\\.(\\d{1,"+vyr+"}))?(?:\\.(\\d{1,"+vyr+"}))?(?:$|[^\\d])";var tmt=ha++;tr[tmt]="(?:~>?)";var P0e=ha++;tr[P0e]="(\\s*)"+tr[tmt]+"\\s+";dOe[P0e]=new RegExp(tr[P0e],"g");Pu[P0e]=new RegExp(emt(tr[P0e]),"g");var F_a="$1~",Cvi=ha++;tr[Cvi]="^"+tr[tmt]+tr[jee]+"$";var bvi=ha++;tr[bvi]="^"+tr[tmt]+tr[k0e]+"$";var rmt=ha++;tr[rmt]="(?:\\^)";var D0e=ha++;tr[D0e]="(\\s*)"+tr[rmt]+"\\s+";dOe[D0e]=new RegExp(tr[D0e],"g");Pu[D0e]=new RegExp(emt(tr[D0e]),"g");var U_a="$1^",Svi=ha++;tr[Svi]="^"+tr[rmt]+tr[jee]+"$";var Tvi=ha++;tr[Tvi]="^"+tr[rmt]+tr[k0e]+"$";var Nyr=ha++;tr[Nyr]="^"+tr[N0e]+"\\s*("+Pyr+")$|^$";var Myr=ha++;tr[Myr]="^"+tr[N0e]+"\\s*("+yvi+")$|^$";var Hee=ha++;tr[Hee]="(\\s*)"+tr[N0e]+"\\s*("+Pyr+"|"+tr[jee]+")";dOe[Hee]=new RegExp(tr[Hee],"g");Pu[Hee]=new RegExp(emt(tr[Hee]),"g");var Q_a="$1$2$3",Ivi=ha++;tr[Ivi]="^\\s*("+tr[jee]+")\\s+-\\s+("+tr[jee]+")\\s*$";var xvi=ha++;tr[xvi]="^\\s*("+tr[k0e]+")\\s+-\\s+("+tr[k0e]+")\\s*$";var wvi=ha++;tr[wvi]="(<|>)?=?\\s*\\*";for(w4=0;w4uOe)return null;var r=e.loose?Pu[Dyr]:Pu[kyr];if(!r.test(t))return null;try{return new Na(t,e)}catch{return null}}a(Gee,"parse");Eo.valid=q_a;function q_a(t,e){var r=Gee(t,e);return r?r.version:null}a(q_a,"valid");Eo.clean=j_a;function j_a(t,e){var r=Gee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(j_a,"clean");Eo.SemVer=Na;function Na(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Na){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>uOe)throw new TypeError("version is longer than "+uOe+" characters");if(!(this instanceof Na))return new Na(t,e);dl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Pu[Dyr]:Pu[kyr]);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>zht||this.major<0)throw new TypeError("Invalid major version");if(this.minor>zht||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>zht||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=H_a;function H_a(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Na(t,r).inc(e,n).version}catch{return null}}a(H_a,"inc");Eo.diff=G_a;function G_a(t,e){if(Oyr(t,e))return null;var r=Gee(t),n=Gee(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(G_a,"diff");Eo.compareIdentifiers=R0e;var mvi=/^[0-9]+$/;function R0e(t,e){var r=mvi.test(t),n=mvi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(fOe,"gt");Eo.lt=Jht;function Jht(t,e,r){return F8(t,e,r)<0}a(Jht,"lt");Eo.eq=Oyr;function Oyr(t,e,r){return F8(t,e,r)===0}a(Oyr,"eq");Eo.neq=Rvi;function Rvi(t,e,r){return F8(t,e,r)!==0}a(Rvi,"neq");Eo.gte=Lyr;function Lyr(t,e,r){return F8(t,e,r)>=0}a(Lyr,"gte");Eo.lte=Byr;function Byr(t,e,r){return F8(t,e,r)<=0}a(Byr,"lte");Eo.cmp=Zht;function Zht(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 Oyr(t,r,n);case"!=":return Rvi(t,r,n);case">":return fOe(t,r,n);case">=":return Lyr(t,r,n);case"<":return Jht(t,r,n);case"<=":return Byr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(Zht,"cmp");Eo.Comparator=gR;function gR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof gR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof gR))return new gR(t,e);t=t.trim().split(/\s+/).join(" "),dl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===hOe?this.value="":this.value=this.operator+this.semver.version,dl("comp",this)}a(gR,"Comparator");var hOe={};gR.prototype.parse=function(t){var e=this.options.loose?Pu[Nyr]:Pu[Myr],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 Na(r[2],this.options.loose):this.semver=hOe};gR.prototype.toString=function(){return this.value};gR.prototype.test=function(t){return dl("Comparator.test",t,this.options.loose),this.semver===hOe?!0:(typeof t=="string"&&(t=new Na(t,this.options)),Zht(t,this.operator,this.semver,this.options))};gR.prototype.intersects=function(t,e){if(!(t instanceof gR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Rf(t.value,e),Xht(this.value,r,e);if(t.operator==="")return r=new Rf(this.value,e),Xht(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=Zht(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=Zht(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=Rf;function Rf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Rf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Rf(t.raw,e);if(t instanceof gR)return new Rf(t.value,e);if(!(this instanceof Rf))return new Rf(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(Rf,"Range");Rf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Rf.prototype.toString=function(){return this.range};Rf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Pu[xvi]:Pu[Ivi];t=t.replace(r,cva),dl("hyphen replace",t),t=t.replace(Pu[Hee],Q_a),dl("comparator trim",t,Pu[Hee]),t=t.replace(Pu[P0e],F_a),t=t.replace(Pu[D0e],U_a);var n=e?Pu[Nyr]:Pu[Myr],o=t.split(" ").map(function(s){return eva(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 gR(s,this.options)},this),o};Rf.prototype.intersects=function(t,e){if(!(t instanceof Rf))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=X_a;function X_a(t,e){return new Rf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(X_a,"toComparators");function eva(t,e){return dl("comp",t,e),t=nva(t,e),dl("caret",t),t=tva(t,e),dl("tildes",t),t=ova(t,e),dl("xrange",t),t=ava(t,e),dl("stars",t),t}a(eva,"parseComparator");function Sv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(Sv,"isX");function tva(t,e){return t.trim().split(/\s+/).map(function(r){return rva(r,e)}).join(" ")}a(tva,"replaceTildes");function rva(t,e){var r=e.loose?Pu[bvi]:Pu[Cvi];return t.replace(r,function(n,o,s,c,l){dl("tilde",t,n,o,s,c,l);var u;return Sv(o)?u="":Sv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Sv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(dl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",dl("tilde return",u),u})}a(rva,"replaceTilde");function nva(t,e){return t.trim().split(/\s+/).map(function(r){return iva(r,e)}).join(" ")}a(nva,"replaceCarets");function iva(t,e){dl("caret",t,e);var r=e.loose?Pu[Tvi]:Pu[Svi];return t.replace(r,function(n,o,s,c,l){dl("caret",t,n,o,s,c,l);var u;return Sv(o)?u="":Sv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Sv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(dl("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"):(dl("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"),dl("caret return",u),u})}a(iva,"replaceCaret");function ova(t,e){return dl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return sva(r,e)}).join(" ")}a(ova,"replaceXRanges");function sva(t,e){t=t.trim();var r=e.loose?Pu[_vi]:Pu[Evi];return t.replace(r,function(n,o,s,c,l,u){dl("xRange",t,n,o,s,c,l,u);var d=Sv(s),f=d||Sv(c),h=f||Sv(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"),dl("xRange return",n),n})}a(sva,"replaceXRange");function ava(t,e){return dl("replaceStars",t,e),t.trim().replace(Pu[wvi],"")}a(ava,"replaceStars");function cva(t,e,r,n,o,s,c,l,u,d,f,h,m){return Sv(r)?e="":Sv(n)?e=">="+r+".0.0":Sv(o)?e=">="+r+"."+n+".0":e=">="+e,Sv(u)?l="":Sv(d)?l="<"+(+u+1)+".0.0":Sv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(cva,"hyphenReplace");Rf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Na(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(lva,"testSet");Eo.satisfies=Xht;function Xht(t,e,r){try{e=new Rf(e,r)}catch{return!1}return e.test(t)}a(Xht,"satisfies");Eo.maxSatisfying=uva;function uva(t,e,r){var n=null,o=null;try{var s=new Rf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Na(n,r))}),n}a(uva,"maxSatisfying");Eo.minSatisfying=dva;function dva(t,e,r){var n=null,o=null;try{var s=new Rf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Na(n,r))}),n}a(dva,"minSatisfying");Eo.minVersion=fva;function fva(t,e){t=new Rf(t,e);var r=new Na("0.0.0");if(t.test(r)||(r=new Na("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||fOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(fva,"minVersion");Eo.validRange=pva;function pva(t,e){try{return new Rf(t,e).range||"*"}catch{return null}}a(pva,"validRange");Eo.ltr=hva;function hva(t,e,r){return Fyr(t,e,"<",r)}a(hva,"ltr");Eo.gtr=mva;function mva(t,e,r){return Fyr(t,e,">",r)}a(mva,"gtr");Eo.outside=Fyr;function Fyr(t,e,r,n){t=new Na(t,n),e=new Rf(e,n);var o,s,c,l,u;switch(r){case">":o=fOe,s=Byr,c=Jht,l=">",u=">=";break;case"<":o=Jht,s=Lyr,c=fOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Xht(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(Fyr,"outside");Eo.prerelease=gva;function gva(t,e){var r=Gee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(gva,"prerelease");Eo.intersects=Ava;function Ava(t,e,r){return t=new Rf(t,r),e=new Rf(e,r),t.intersects(e)}a(Ava,"intersects");Eo.coerce=yva;function yva(t){if(t instanceof Na)return t;if(typeof t!="string")return null;var e=t.match(Pu[vvi]);return e==null?null:Gee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(yva,"coerce")});var omt=I(($mp,Ovi)=>{"use strict";p();var Nvi=f0e(),M0e=Nvi.wrap,nmt=Nvi.unwrap,U8="wrap@before";function imt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(imt,"defineProperty");function Eva(t,e){for(var r=e.length,n=0;n0&&Eva(t,o)}a(_va,"_findAndProcess");function Dvi(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 Pc=require("util"),Q8=require("assert"),vva=omt(),gd=require("async_hooks"),mOe="cls@contexts",gOe="error@context",kf=process.env.DEBUG_CLS_HOOKED,kc=-1;Fvi.exports={getNamespace:Lvi,createNamespace:Cva,destroyNamespace:Bvi,reset:bva,ERROR_SYMBOL:gOe};function AR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(AR,"Namespace");AR.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,kf){let n=" ".repeat(this._indent<0?0:this._indent);zd(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+kc+" active:"+Pc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");AR.prototype.get=a(function(e){if(!this.active){if(kf){let r=gd.currentId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+kc+" active:"+Pc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),zd(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${Pc.inspect(this.active)}`)}return this.active[e]},"get");AR.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=kc,kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${Pc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");AR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(kf){let n=gd.triggerAsyncId(),o=gd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${Pc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[gOe]=r),n}finally{if(kf){let n=gd.triggerAsyncId(),o=gd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${Pc.inspect(r)}`)}this.exit(r)}},"run");AR.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");AR.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 kf&&zd("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),n.then(o=>(kf&&zd("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[gOe]=r,kf&&zd("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),this.exit(r),o})},"runPromise");AR.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[gOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");AR.prototype.enter=a(function(e){if(Q8.ok(e,"context must be provided for entering"),kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${Pc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");AR.prototype.exit=a(function(e){if(Q8.ok(e,"context must be provided for exiting"),kf){let n=gd.executionAsyncId(),o=gd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${kc} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${Pc.inspect(e)}`)}if(this.active===e){Q8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(kf&&zd("??ERROR?? context exiting but not entered - ignoring: "+Pc.inspect(e)),Q8.ok(r>=0,`context not currently entered; can't exit. `+Pc.inspect(this)+` -`+Pc.inspect(e))):(U8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");gR.prototype.bindEmitter=a(function(e){U8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[pOe]||(c[pOe]=Object.create(null)),c[pOe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[pOe]))return c;let l=c,u=c[pOe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),mva(e,o,s)},"bindEmitter");gR.prototype.fromException=a(function(e){return e[hOe]},"fromException");function Dvi(t){return process.namespaces[t]}a(Dvi,"getNamespace");function gva(t){U8.ok(t,"namespace must be given a name."),kf&&zd(`NS-CREATING NAMESPACE (${t})`);let e=new gR(t);return e.id=kc,gd.createHook({init(n,o,s,c){if(kc=gd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),kf){let l=" ".repeat(e._indent<0?0:e._indent);zd(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(kc===0){let l=gd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),kf){let d=" ".repeat(e._indent<0?0:e._indent);zd(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${l} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(kf){let d=" ".repeat(e._indent<0?0:e._indent);zd(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${l} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(kf&&o==="PROMISE"){zd(Pc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);zd(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){kc=gd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(kc),o){if(kf){let s=gd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}BEFORE (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(kf){let s=gd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${Pc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){kc=gd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(kc),o){if(kf){let s=gd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}AFTER (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`)}e.exit(o)}else if(kf){let s=gd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`)}},destroy(n){if(kc=gd.executionAsyncId(),kf){let o=gd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);zd(`${s}DESTROY (${t}) currentUid:${kc} asyncId:${n} triggerId:${o} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(e._contexts.get(kc))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(gva,"createNamespace");function Nvi(t){let e=Dvi(t);U8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),U8.ok(e.id,"don't assign to process.namespaces directly! "+Pc.inspect(e)),process.namespaces[t]=null}a(Nvi,"destroyNamespace");function Ava(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){Nvi(t)}),process.namespaces=Object.create(null)}a(Ava,"reset");process.namespaces={};function zd(...t){kf&&process._rawDebug(`${Pc.format(...t)}`)}a(zd,"debug2")});var Bvi=I((jmp,Lvi)=>{"use strict";p();function yva(){}a(yva,"NextTickWrap");Lvi.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 Uvi=I(($mp,Fvi)=>{"use strict";p();function Eva(){}a(Eva,"PromiseWrap");Fvi.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 Eva,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 qvi=I((zmp,Qvi)=>{"use strict";p();var WT=require("timers");function _va(){}a(_va,"TimeoutWrap");function vva(){}a(vva,"IntervalWrap");function Cva(){}a(Cva,"ImmediateWrap");var bva=new Map,Sva=new Map,Tva=new Map,Fyr=null,Uyr=!1;Qvi.exports=a(function(){Qyr(this._hooks,this._state,"setTimeout","clearTimeout",_va,bva,!0),Qyr(this._hooks,this._state,"setInterval","clearInterval",vva,Sva,!1),Qyr(this._hooks,this._state,"setImmediate","clearImmediate",Cva,Tva,!0),global.setTimeout=WT.setTimeout,global.setInterval=WT.setInterval,global.setImmediate=WT.setImmediate,global.clearTimeout=WT.clearTimeout,global.clearInterval=WT.clearInterval,global.clearImmediate=WT.clearImmediate},"patch");function Qyr(t,e,r,n,o,s,c){let l=WT[r],u=WT[n];WT[r]=function(){if(!e.enabled)return l.apply(WT,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),Fyr=null,(c||Uyr)&&(Uyr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(WT,d),s.set(g,m),g},WT[n]=function(d){if(Fyr===d&&d!==null)Uyr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(WT,arguments)}}a(Qyr,"patchTimer")});var qyr=I((Jmp,Iva)=>{Iva.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 Gvi=I((Zmp,Hvi)=>{"use strict";p();var gOe=process.binding("async_wrap"),xva=gOe.Providers.TIMERWRAP,jvi={nextTick:Bvi(),promise:Uvi(),timers:qvi()},mOe=new Set;function wva(){this.enabled=!1,this.counter=0}a(wva,"State");function jyr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===xva){mOe.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!mOe.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!mOe.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(mOe.has(o)){mOe.delete(o);return}for(let s of n)s(o)}}a(jyr,"Hooks");jyr.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 omt(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(omt,"removeElement");jyr.prototype.remove=function(t){t.init&&omt(this.initFns,t.init),t.pre&&omt(this.preFns,t.pre),t.post&&omt(this.postFns,t.post),t.destroy&&omt(this.destroyFns,t.destroy)};function AOe(){this._state=new wva,this._hooks=new jyr,this.version=qyr().version,this.providers=gOe.Providers;for(let t of Object.keys(jvi))jvi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),gOe.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(AOe,"AsyncHook");Hvi.exports=AOe;AOe.prototype.addHooks=function(t){this._hooks.add(t)};AOe.prototype.removeHooks=function(t){this._hooks.remove(t)};AOe.prototype.enable=function(){this._state.enabled=!0,gOe.enable()};AOe.prototype.disable=function(){this._state.enabled=!1,gOe.disable()}});var Hyr=I((t0p,Rva)=>{Rva.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 Vvi=I((r0p,$vi)=>{p();function kva(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(kva,"FormatErrorString");$vi.exports=a(function(e,r){var n=[];n.push(kva(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` -`)},"FormatStackTrace")});var Kvi=I((o0p,Yvi)=>{p();var smt=Vvi();function zvi(){this.extend=new yOe,this.filter=new yOe,this.format=new EOe,this.version=Hyr().version}a(zvi,"stackChain");var $yr=!1;zvi.prototype.callSite=a(function t(e){e||(e={}),$yr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return $yr=!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 pG=new zvi;function yOe(){this._modifiers=[]}a(yOe,"TraceModifier");yOe.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===Hyr().version)Vyr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else Vyr.exports=global._stackChain=Kvi()});var Jvi=I((u0p,zyr)=>{"use strict";p();var Dva=Gvi();if(global._asyncHook)if(global._asyncHook.version===qyr().version)zyr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else Wyr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),zyr.exports=global._asyncHook=new Dva});var nCi=I((f0p,rCi)=>{"use strict";p();var hh=require("util"),Q8=require("assert"),Nva=imt(),M0e=Jvi(),_Oe="cls@contexts",vOe="error@context",Xvi=[];for(let t in M0e.providers)Xvi[M0e.providers[t]]=t;var bp=process.env.DEBUG_CLS_HOOKED,Em=-1;rCi.exports={getNamespace:eCi,createNamespace:Mva,destroyNamespace:tCi,reset:Ova,ERROR_SYMBOL:vOe};function AR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a(AR,"Namespace");AR.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 bp&&ph(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0)),this.active[e]=r,r},"set");AR.prototype.get=a(function(e){if(!this.active){bp&&ph(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0));return}return bp&&ph(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0)),this.active[e]},"get");AR.prototype.createContext=a(function(){bp&&ph(" CREATING Context: "+this.name+" uid:"+Em+" len:"+this._set.length+" active:"+hh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=Em,bp&&ph(" CREATED Context: "+this.name+" uid:"+Em+" len:"+this._set.length+" context:"+hh.inspect(e,!0,2,!0)),e},"createContext");AR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return bp&&ph(" BEFORE RUN: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),e(r),r}catch(n){throw n&&(n[vOe]=r),n}finally{bp&&ph(" AFTER RUN: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r)}},"run");AR.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");AR.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 bp&&ph(" BEFORE runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),n.then(o=>(bp&&ph(" AFTER runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[vOe]=r,bp&&ph(" AFTER runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r),o})},"runPromise");AR.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[vOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");AR.prototype.enter=a(function(e){Q8.ok(e,"context must be provided for entering"),bp&&ph(" ENTER "+this.name+" uid:"+Em+" len:"+this._set.length+" context: "+hh.inspect(e)),this._set.push(this.active),this.active=e},"enter");AR.prototype.exit=a(function(e){if(Q8.ok(e,"context must be provided for exiting"),bp&&ph(" EXIT "+this.name+" uid:"+Em+" len:"+this._set.length+" context: "+hh.inspect(e)),this.active===e){Q8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(bp&&ph("??ERROR?? context exiting but not entered - ignoring: "+hh.inspect(e)),Q8.ok(r>=0,`context not currently entered; can't exit. +`+Pc.inspect(e))):(Q8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");AR.prototype.bindEmitter=a(function(e){Q8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[mOe]||(c[mOe]=Object.create(null)),c[mOe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[mOe]))return c;let l=c,u=c[mOe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),vva(e,o,s)},"bindEmitter");AR.prototype.fromException=a(function(e){return e[gOe]},"fromException");function Lvi(t){return process.namespaces[t]}a(Lvi,"getNamespace");function Cva(t){Q8.ok(t,"namespace must be given a name."),kf&&zd(`NS-CREATING NAMESPACE (${t})`);let e=new AR(t);return e.id=kc,gd.createHook({init(n,o,s,c){if(kc=gd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),kf){let l=" ".repeat(e._indent<0?0:e._indent);zd(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(kc===0){let l=gd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),kf){let d=" ".repeat(e._indent<0?0:e._indent);zd(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${l} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(kf){let d=" ".repeat(e._indent<0?0:e._indent);zd(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${l} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(kf&&o==="PROMISE"){zd(Pc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);zd(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){kc=gd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(kc),o){if(kf){let s=gd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}BEFORE (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(kf){let s=gd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${Pc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){kc=gd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(kc),o){if(kf){let s=gd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}AFTER (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`)}e.exit(o)}else if(kf){let s=gd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`)}},destroy(n){if(kc=gd.executionAsyncId(),kf){let o=gd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);zd(`${s}DESTROY (${t}) currentUid:${kc} asyncId:${n} triggerId:${o} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(e._contexts.get(kc))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(Cva,"createNamespace");function Bvi(t){let e=Lvi(t);Q8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),Q8.ok(e.id,"don't assign to process.namespaces directly! "+Pc.inspect(e)),process.namespaces[t]=null}a(Bvi,"destroyNamespace");function bva(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){Bvi(t)}),process.namespaces=Object.create(null)}a(bva,"reset");process.namespaces={};function zd(...t){kf&&process._rawDebug(`${Pc.format(...t)}`)}a(zd,"debug2")});var qvi=I((Jmp,Qvi)=>{"use strict";p();function Sva(){}a(Sva,"NextTickWrap");Qvi.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 Hvi=I((e0p,jvi)=>{"use strict";p();function Tva(){}a(Tva,"PromiseWrap");jvi.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 Tva,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 $vi=I((n0p,Gvi)=>{"use strict";p();var YT=require("timers");function Iva(){}a(Iva,"TimeoutWrap");function xva(){}a(xva,"IntervalWrap");function wva(){}a(wva,"ImmediateWrap");var Rva=new Map,kva=new Map,Pva=new Map,Uyr=null,Qyr=!1;Gvi.exports=a(function(){qyr(this._hooks,this._state,"setTimeout","clearTimeout",Iva,Rva,!0),qyr(this._hooks,this._state,"setInterval","clearInterval",xva,kva,!1),qyr(this._hooks,this._state,"setImmediate","clearImmediate",wva,Pva,!0),global.setTimeout=YT.setTimeout,global.setInterval=YT.setInterval,global.setImmediate=YT.setImmediate,global.clearTimeout=YT.clearTimeout,global.clearInterval=YT.clearInterval,global.clearImmediate=YT.clearImmediate},"patch");function qyr(t,e,r,n,o,s,c){let l=YT[r],u=YT[n];YT[r]=function(){if(!e.enabled)return l.apply(YT,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),Uyr=null,(c||Qyr)&&(Qyr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(YT,d),s.set(g,m),g},YT[n]=function(d){if(Uyr===d&&d!==null)Qyr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(YT,arguments)}}a(qyr,"patchTimer")});var jyr=I((s0p,Dva)=>{Dva.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 zvi=I((a0p,Wvi)=>{"use strict";p();var yOe=process.binding("async_wrap"),Nva=yOe.Providers.TIMERWRAP,Vvi={nextTick:qvi(),promise:Hvi(),timers:$vi()},AOe=new Set;function Mva(){this.enabled=!1,this.counter=0}a(Mva,"State");function Hyr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===Nva){AOe.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!AOe.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!AOe.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(AOe.has(o)){AOe.delete(o);return}for(let s of n)s(o)}}a(Hyr,"Hooks");Hyr.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 smt(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(smt,"removeElement");Hyr.prototype.remove=function(t){t.init&&smt(this.initFns,t.init),t.pre&&smt(this.preFns,t.pre),t.post&&smt(this.postFns,t.post),t.destroy&&smt(this.destroyFns,t.destroy)};function EOe(){this._state=new Mva,this._hooks=new Hyr,this.version=jyr().version,this.providers=yOe.Providers;for(let t of Object.keys(Vvi))Vvi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),yOe.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(EOe,"AsyncHook");Wvi.exports=EOe;EOe.prototype.addHooks=function(t){this._hooks.add(t)};EOe.prototype.removeHooks=function(t){this._hooks.remove(t)};EOe.prototype.enable=function(){this._state.enabled=!0,yOe.enable()};EOe.prototype.disable=function(){this._state.enabled=!1,yOe.disable()}});var Gyr=I((u0p,Ova)=>{Ova.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 Kvi=I((d0p,Yvi)=>{p();function Lva(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(Lva,"FormatErrorString");Yvi.exports=a(function(e,r){var n=[];n.push(Lva(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` +`)},"FormatStackTrace")});var eCi=I((h0p,Xvi)=>{p();var amt=Kvi();function Zvi(){this.extend=new _Oe,this.filter=new _Oe,this.format=new vOe,this.version=Gyr().version}a(Zvi,"stackChain");var Vyr=!1;Zvi.prototype.callSite=a(function t(e){e||(e={}),Vyr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return Vyr=!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 hG=new Zvi;function _Oe(){this._modifiers=[]}a(_Oe,"TraceModifier");_Oe.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===Gyr().version)Wyr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else Wyr.exports=global._stackChain=eCi()});var tCi=I((E0p,Yyr)=>{"use strict";p();var Fva=zvi();if(global._asyncHook)if(global._asyncHook.version===jyr().version)Yyr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else zyr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),Yyr.exports=global._asyncHook=new Fva});var aCi=I((v0p,sCi)=>{"use strict";p();var hh=require("util"),q8=require("assert"),Uva=omt(),O0e=tCi(),COe="cls@contexts",bOe="error@context",nCi=[];for(let t in O0e.providers)nCi[O0e.providers[t]]=t;var bp=process.env.DEBUG_CLS_HOOKED,Em=-1;sCi.exports={getNamespace:iCi,createNamespace:Qva,destroyNamespace:oCi,reset:qva,ERROR_SYMBOL:bOe};function yR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a(yR,"Namespace");yR.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 bp&&ph(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0)),this.active[e]=r,r},"set");yR.prototype.get=a(function(e){if(!this.active){bp&&ph(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0));return}return bp&&ph(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0)),this.active[e]},"get");yR.prototype.createContext=a(function(){bp&&ph(" CREATING Context: "+this.name+" uid:"+Em+" len:"+this._set.length+" active:"+hh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=Em,bp&&ph(" CREATED Context: "+this.name+" uid:"+Em+" len:"+this._set.length+" context:"+hh.inspect(e,!0,2,!0)),e},"createContext");yR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return bp&&ph(" BEFORE RUN: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),e(r),r}catch(n){throw n&&(n[bOe]=r),n}finally{bp&&ph(" AFTER RUN: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r)}},"run");yR.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");yR.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 bp&&ph(" BEFORE runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),n.then(o=>(bp&&ph(" AFTER runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[bOe]=r,bp&&ph(" AFTER runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r),o})},"runPromise");yR.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[bOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");yR.prototype.enter=a(function(e){q8.ok(e,"context must be provided for entering"),bp&&ph(" ENTER "+this.name+" uid:"+Em+" len:"+this._set.length+" context: "+hh.inspect(e)),this._set.push(this.active),this.active=e},"enter");yR.prototype.exit=a(function(e){if(q8.ok(e,"context must be provided for exiting"),bp&&ph(" EXIT "+this.name+" uid:"+Em+" len:"+this._set.length+" context: "+hh.inspect(e)),this.active===e){q8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(bp&&ph("??ERROR?? context exiting but not entered - ignoring: "+hh.inspect(e)),q8.ok(r>=0,`context not currently entered; can't exit. `+hh.inspect(this)+` -`+hh.inspect(e))):(Q8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");AR.prototype.bindEmitter=a(function(e){Q8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[_Oe]||(c[_Oe]=Object.create(null)),c[_Oe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[_Oe]))return c;let l=c,u=c[_Oe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),Nva(e,o,s)},"bindEmitter");AR.prototype.fromException=a(function(e){return e[vOe]},"fromException");function eCi(t){return process.namespaces[t]}a(eCi,"getNamespace");function Mva(t){Q8.ok(t,"namespace must be given a name."),bp&&ph("CREATING NAMESPACE "+t);let e=new AR(t);return e.id=Em,M0e.addHooks({init(r,n,o,s,c){Em=r,s?(e._contexts.set(r,e._contexts.get(s)),bp&&ph("PARENTID: "+t+" uid:"+r+" parent:"+s+" provider:"+o)):e._contexts.set(Em,e.active),bp&&ph("INIT "+t+" uid:"+r+" parent:"+s+" provider:"+Xvi[o]+" active:"+hh.inspect(e.active,!0))},pre(r,n){Em=r;let o=e._contexts.get(r);o?(bp&&ph(" PRE "+t+" uid:"+r+" handle:"+amt(n)+" context:"+hh.inspect(o)),e.enter(o)):bp&&ph(" PRE MISSING CONTEXT "+t+" uid:"+r+" handle:"+amt(n))},post(r,n){Em=r;let o=e._contexts.get(r);o?(bp&&ph(" POST "+t+" uid:"+r+" handle:"+amt(n)+" context:"+hh.inspect(o)),e.exit(o)):bp&&ph(" POST MISSING CONTEXT "+t+" uid:"+r+" handle:"+amt(n))},destroy(r){Em=r,bp&&ph("DESTROY "+t+" uid:"+r+" context:"+hh.inspect(e._contexts.get(Em))+" active:"+hh.inspect(e.active,!0)),e._contexts.delete(r)}}),process.namespaces[t]=e,e}a(Mva,"createNamespace");function tCi(t){let e=eCi(t);Q8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),Q8.ok(e.id,"don't assign to process.namespaces directly! "+hh.inspect(e)),process.namespaces[t]=null}a(tCi,"destroyNamespace");function Ova(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){tCi(t)}),process.namespaces=Object.create(null)}a(Ova,"reset");process.namespaces={};M0e._state&&!M0e._state.enabled&&M0e.enable();function ph(t){process.env.DEBUG&&process._rawDebug(t)}a(ph,"debug2");function amt(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(amt,"getFunctionName");if(bp){Yyr=Wyr();for(Zvi in Yyr.filter._modifiers)Yyr.filter.deattach(Zvi)}var Yyr,Zvi});var iCi=I((m0p,Kyr)=>{"use strict";p();var Lva=xvi();process&&Lva.gte(process.versions.node,"8.0.0")?Kyr.exports=Ovi():Kyr.exports=nCi()});var vCi=I((Eo,_Ci)=>{p();Eo=_Ci.exports=Oa;var fl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?fl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):fl=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var COe=256,cmt=Number.MAX_SAFE_INTEGER||9007199254740991,Jyr=16,Bva=COe-6,bOe=Eo.re=[],Du=Eo.safeRe=[],nr=Eo.src=[],ga=0,rEr="[a-zA-Z0-9-]",Zyr=[["\\s",1],["\\d",COe],[rEr,Bva]];function hmt(t){for(var e=0;e)?=?)";var lmt=ga++;nr[lmt]=nr[L0e]+"|x|X|\\*";var umt=ga++;nr[umt]=nr[O0e]+"|x|X|\\*";var $ee=ga++;nr[$ee]="[v=\\s]*("+nr[umt]+")(?:\\.("+nr[umt]+")(?:\\.("+nr[umt]+")(?:"+nr[iEr]+")?"+nr[TOe]+"?)?)?";var F0e=ga++;nr[F0e]="[v=\\s]*("+nr[lmt]+")(?:\\.("+nr[lmt]+")(?:\\.("+nr[lmt]+")(?:"+nr[oEr]+")?"+nr[TOe]+"?)?)?";var lCi=ga++;nr[lCi]="^"+nr[q0e]+"\\s*"+nr[$ee]+"$";var uCi=ga++;nr[uCi]="^"+nr[q0e]+"\\s*"+nr[F0e]+"$";var dCi=ga++;nr[dCi]="(?:^|[^\\d])(\\d{1,"+Jyr+"})(?:\\.(\\d{1,"+Jyr+"}))?(?:\\.(\\d{1,"+Jyr+"}))?(?:$|[^\\d])";var mmt=ga++;nr[mmt]="(?:~>?)";var U0e=ga++;nr[U0e]="(\\s*)"+nr[mmt]+"\\s+";bOe[U0e]=new RegExp(nr[U0e],"g");Du[U0e]=new RegExp(hmt(nr[U0e]),"g");var Fva="$1~",fCi=ga++;nr[fCi]="^"+nr[mmt]+nr[$ee]+"$";var pCi=ga++;nr[pCi]="^"+nr[mmt]+nr[F0e]+"$";var gmt=ga++;nr[gmt]="(?:\\^)";var Q0e=ga++;nr[Q0e]="(\\s*)"+nr[gmt]+"\\s+";bOe[Q0e]=new RegExp(nr[Q0e],"g");Du[Q0e]=new RegExp(hmt(nr[Q0e]),"g");var Uva="$1^",hCi=ga++;nr[hCi]="^"+nr[gmt]+nr[$ee]+"$";var mCi=ga++;nr[mCi]="^"+nr[gmt]+nr[F0e]+"$";var lEr=ga++;nr[lEr]="^"+nr[q0e]+"\\s*("+aEr+")$|^$";var uEr=ga++;nr[uEr]="^"+nr[q0e]+"\\s*("+cCi+")$|^$";var Vee=ga++;nr[Vee]="(\\s*)"+nr[q0e]+"\\s*("+aEr+"|"+nr[$ee]+")";bOe[Vee]=new RegExp(nr[Vee],"g");Du[Vee]=new RegExp(hmt(nr[Vee]),"g");var Qva="$1$2$3",gCi=ga++;nr[gCi]="^\\s*("+nr[$ee]+")\\s+-\\s+("+nr[$ee]+")\\s*$";var ACi=ga++;nr[ACi]="^\\s*("+nr[F0e]+")\\s+-\\s+("+nr[F0e]+")\\s*$";var yCi=ga++;nr[yCi]="(<|>)?=?\\s*\\*";for(R4=0;R4COe)return null;var r=e.loose?Du[cEr]:Du[sEr];if(!r.test(t))return null;try{return new Oa(t,e)}catch{return null}}a(Wee,"parse");Eo.valid=qva;function qva(t,e){var r=Wee(t,e);return r?r.version:null}a(qva,"valid");Eo.clean=jva;function jva(t,e){var r=Wee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(jva,"clean");Eo.SemVer=Oa;function Oa(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Oa){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>COe)throw new TypeError("version is longer than "+COe+" characters");if(!(this instanceof Oa))return new Oa(t,e);fl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Du[cEr]:Du[sEr]);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>cmt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>cmt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>cmt||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=Hva;function Hva(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Oa(t,r).inc(e,n).version}catch{return null}}a(Hva,"inc");Eo.diff=Gva;function Gva(t,e){if(dEr(t,e))return null;var r=Wee(t),n=Wee(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(Gva,"diff");Eo.compareIdentifiers=B0e;var oCi=/^[0-9]+$/;function B0e(t,e){var r=oCi.test(t),n=oCi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(SOe,"gt");Eo.lt=dmt;function dmt(t,e,r){return q8(t,e,r)<0}a(dmt,"lt");Eo.eq=dEr;function dEr(t,e,r){return q8(t,e,r)===0}a(dEr,"eq");Eo.neq=ECi;function ECi(t,e,r){return q8(t,e,r)!==0}a(ECi,"neq");Eo.gte=fEr;function fEr(t,e,r){return q8(t,e,r)>=0}a(fEr,"gte");Eo.lte=pEr;function pEr(t,e,r){return q8(t,e,r)<=0}a(pEr,"lte");Eo.cmp=fmt;function fmt(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 dEr(t,r,n);case"!=":return ECi(t,r,n);case">":return SOe(t,r,n);case">=":return fEr(t,r,n);case"<":return dmt(t,r,n);case"<=":return pEr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(fmt,"cmp");Eo.Comparator=yR;function yR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof yR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof yR))return new yR(t,e);t=t.trim().split(/\s+/).join(" "),fl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===IOe?this.value="":this.value=this.operator+this.semver.version,fl("comp",this)}a(yR,"Comparator");var IOe={};yR.prototype.parse=function(t){var e=this.options.loose?Du[lEr]:Du[uEr],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 Oa(r[2],this.options.loose):this.semver=IOe};yR.prototype.toString=function(){return this.value};yR.prototype.test=function(t){return fl("Comparator.test",t,this.options.loose),this.semver===IOe?!0:(typeof t=="string"&&(t=new Oa(t,this.options)),fmt(t,this.operator,this.semver,this.options))};yR.prototype.intersects=function(t,e){if(!(t instanceof yR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Pf(t.value,e),pmt(this.value,r,e);if(t.operator==="")return r=new Pf(this.value,e),pmt(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=fmt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=fmt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=Pf;function Pf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Pf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Pf(t.raw,e);if(t instanceof yR)return new Pf(t.value,e);if(!(this instanceof Pf))return new Pf(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(Pf,"Range");Pf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Pf.prototype.toString=function(){return this.range};Pf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Du[ACi]:Du[gCi];t=t.replace(r,cCa),fl("hyphen replace",t),t=t.replace(Du[Vee],Qva),fl("comparator trim",t,Du[Vee]),t=t.replace(Du[U0e],Fva),t=t.replace(Du[Q0e],Uva);var n=e?Du[lEr]:Du[uEr],o=t.split(" ").map(function(s){return eCa(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 yR(s,this.options)},this),o};Pf.prototype.intersects=function(t,e){if(!(t instanceof Pf))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=Xva;function Xva(t,e){return new Pf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(Xva,"toComparators");function eCa(t,e){return fl("comp",t,e),t=nCa(t,e),fl("caret",t),t=tCa(t,e),fl("tildes",t),t=oCa(t,e),fl("xrange",t),t=aCa(t,e),fl("stars",t),t}a(eCa,"parseComparator");function Sv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(Sv,"isX");function tCa(t,e){return t.trim().split(/\s+/).map(function(r){return rCa(r,e)}).join(" ")}a(tCa,"replaceTildes");function rCa(t,e){var r=e.loose?Du[pCi]:Du[fCi];return t.replace(r,function(n,o,s,c,l){fl("tilde",t,n,o,s,c,l);var u;return Sv(o)?u="":Sv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Sv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(fl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",fl("tilde return",u),u})}a(rCa,"replaceTilde");function nCa(t,e){return t.trim().split(/\s+/).map(function(r){return iCa(r,e)}).join(" ")}a(nCa,"replaceCarets");function iCa(t,e){fl("caret",t,e);var r=e.loose?Du[mCi]:Du[hCi];return t.replace(r,function(n,o,s,c,l){fl("caret",t,n,o,s,c,l);var u;return Sv(o)?u="":Sv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Sv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(fl("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"):(fl("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"),fl("caret return",u),u})}a(iCa,"replaceCaret");function oCa(t,e){return fl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return sCa(r,e)}).join(" ")}a(oCa,"replaceXRanges");function sCa(t,e){t=t.trim();var r=e.loose?Du[uCi]:Du[lCi];return t.replace(r,function(n,o,s,c,l,u){fl("xRange",t,n,o,s,c,l,u);var d=Sv(s),f=d||Sv(c),h=f||Sv(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"),fl("xRange return",n),n})}a(sCa,"replaceXRange");function aCa(t,e){return fl("replaceStars",t,e),t.trim().replace(Du[yCi],"")}a(aCa,"replaceStars");function cCa(t,e,r,n,o,s,c,l,u,d,f,h,m){return Sv(r)?e="":Sv(n)?e=">="+r+".0.0":Sv(o)?e=">="+r+"."+n+".0":e=">="+e,Sv(u)?l="":Sv(d)?l="<"+(+u+1)+".0.0":Sv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(cCa,"hyphenReplace");Pf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Oa(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(lCa,"testSet");Eo.satisfies=pmt;function pmt(t,e,r){try{e=new Pf(e,r)}catch{return!1}return e.test(t)}a(pmt,"satisfies");Eo.maxSatisfying=uCa;function uCa(t,e,r){var n=null,o=null;try{var s=new Pf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Oa(n,r))}),n}a(uCa,"maxSatisfying");Eo.minSatisfying=dCa;function dCa(t,e,r){var n=null,o=null;try{var s=new Pf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Oa(n,r))}),n}a(dCa,"minSatisfying");Eo.minVersion=fCa;function fCa(t,e){t=new Pf(t,e);var r=new Oa("0.0.0");if(t.test(r)||(r=new Oa("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||SOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(fCa,"minVersion");Eo.validRange=pCa;function pCa(t,e){try{return new Pf(t,e).range||"*"}catch{return null}}a(pCa,"validRange");Eo.ltr=hCa;function hCa(t,e,r){return hEr(t,e,"<",r)}a(hCa,"ltr");Eo.gtr=mCa;function mCa(t,e,r){return hEr(t,e,">",r)}a(mCa,"gtr");Eo.outside=hEr;function hEr(t,e,r,n){t=new Oa(t,n),e=new Pf(e,n);var o,s,c,l,u;switch(r){case">":o=SOe,s=pEr,c=dmt,l=">",u=">=";break;case"<":o=dmt,s=fEr,c=SOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(pmt(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(hEr,"outside");Eo.prerelease=gCa;function gCa(t,e){var r=Wee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(gCa,"prerelease");Eo.intersects=ACa;function ACa(t,e,r){return t=new Pf(t,r),e=new Pf(e,r),t.intersects(e)}a(ACa,"intersects");Eo.coerce=yCa;function yCa(t){if(t instanceof Oa)return t;if(typeof t!="string")return null;var e=t.match(Du[dCi]);return e==null?null:Wee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(yCa,"coerce")});var SCi=I((E0p,bCi)=>{p();var ECa=d0e().wrap,gEr=1,AEr=2,yEr=4,ymt=8,Jl=[],_Ca=0,OE=!1,hG=[],j0e,EEr;function _Er(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(Jl=hG.pop()),H0e=void 0,n&&!OE},"asyncCatcher"),EEr=a(function(e,r,n){var o=[];OE=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);OE=!1;var d=e.apply(this,arguments);for(OE=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return OE=!1,Jl=hG.pop(),H0e=void 0,d}},"asyncWrap"),ECa(process,"_fatalException",function(t){return a(function(r){return j0e(r)||t(r)},"_asyncFatalException")})):(mEr=!1,j0e=a(function(e){if(mEr)throw e;for(var r=!1,n=Jl.length,o=0;o0&&r[f].before(this,o[r[f].uid]);OE=!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]);OE=!1}Jl=hG.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",j0e));var Amt,H0e,mEr;function vCa(t,e,r){OE=!0;for(var n=0;n0)return EEr(t,r,e);return vCa(t,r,e)}a(CCa,"wrapCallback");function k4(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=gEr),typeof t.before=="function"&&(this.before=t.before,this.flags|=AEr),typeof t.after=="function"&&(this.after=t.after,this.flags|=yEr),typeof t.error=="function"&&(this.error=t.error,this.flags|=ymt),this.uid=++_Ca,this.data=e===void 0?null:e}a(k4,"AsyncListener");k4.prototype.create=void 0;k4.prototype.before=void 0;k4.prototype.after=void 0;k4.prototype.error=void 0;k4.prototype.data=void 0;k4.prototype.uid=0;k4.prototype.flags=0;function CCi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof k4?t:new k4(t,e)}a(CCi,"createAsyncListener");function bCa(t,e){var r;t instanceof k4?r=t:r=CCi(t,e);for(var n=!1,o=0;o{"use strict";p();TCi.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 NCi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var kCi=d0e(),_mt=vCi(),Hb=kCi.wrap,mG=kCi.massWrap,Df=SCi(),TCa=require("util"),ICa=_mt.gte(process.version,"6.0.0"),bEr=_mt.gte(process.version,"7.0.0"),xCa=_mt.gte(process.version,"8.0.0"),wCa=_mt.gte(process.version,"11.0.0"),P4=require("net");bEr&&!P4._normalizeArgs?P4._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:NCa(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]}:!bEr&&!P4._normalizeConnectArgs&&(P4._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 P4.Server.prototype?Hb(P4.Server.prototype,"_setUpListenHandle",xCi):Hb(P4.Server.prototype,"_listen2",xCi);function xCi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=Df(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=Df(this._handle.onconnection))}}}a(xCi,"wrapSetUpListenHandle");function PCi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=Df(e._originalOnread)}}a(PCi,"patchOnRead");Hb(P4.Socket.prototype,"connect",function(t){return function(){var e;xCa&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=bEr?P4._normalizeArgs(arguments):P4._normalizeConnectArgs(arguments),e[1]&&(e[1]=Df(e[1]));var r=t.apply(this,e);return PCi(this),r}});var RCa=require("http");Hb(RCa.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=Df(function(n){return PCi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var vEr=require("child_process");function wCi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=Df(e._handle.onread),Hb(e._handle,"close",vmt))}),t._handle&&(t._handle.onexit=Df(t._handle.onexit))}a(wCi,"wrapChildProcess");vEr.ChildProcess?Hb(vEr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return wCi(this),e}}):mG(vEr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return wCi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var IEr=[];process._nextDomainTick&&IEr.push("_nextDomainTick");process._tickDomainCallback&&IEr.push("_tickDomainCallback");mG(process,IEr,D4);Hb(process,"nextTick",vmt);var xEr=["setTimeout","setInterval"];global.setImmediate&&xEr.push("setImmediate");var DCi=require("timers"),kCa=global.setTimeout===DCi.setTimeout;mG(DCi,xEr,vmt);kCa&&mG(global,xEr,vmt);var SEr=require("dns");mG(SEr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],D4);SEr.resolveNaptr&&Hb(SEr,"resolveNaptr",D4);var Yee=require("fs");mG(Yee,["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"],D4);Yee.lchown&&Hb(Yee,"lchown",D4);Yee.lchmod&&Hb(Yee,"lchmod",D4);Yee.ftruncate&&Hb(Yee,"ftruncate",D4);var xOe;try{xOe=require("zlib")}catch{}xOe&&xOe.Deflate&&xOe.Deflate.prototype&&(zee=Object.getPrototypeOf(xOe.Deflate.prototype),zee._transform?Hb(zee,"_transform",D4):zee.write&&zee.flush&&zee.end&&mG(zee,["write","flush","end"],D4));var zee,TEr;try{TEr=require("crypto")}catch{}TEr&&(CEr=["pbkdf2","randomBytes"],wCa||CEr.push("pseudoRandomBytes"),mG(TEr,CEr,D4));var CEr,Emt=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";Emt&&(RCi=process.addAsyncListener({create:a(function(){Emt=!1},"create")}),global.Promise.resolve(!0).then(a(function(){Emt=!1},"notSync")),process.removeAsyncListener(RCi));var RCi;Emt&&PCa();function PCa(){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"),TCa.inherits(e,t),Hb(t.prototype,"then",s),t.prototype.chain&&Hb(t.prototype,"chain",s),ICa)global.Promise=ICi()(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=Df(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:Df(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(PCa,"wrapPromise");function D4(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(DCa,"toNumber");function NCa(t){return typeof t=="string"&&DCa(t)===!1}a(NCa,"isPipeName")});var FCi=I((k0p,BCi)=>{"use strict";p();var j8=require("assert"),MCa=imt(),wOe="cls@contexts",wEr="error@context";process.addAsyncListener||NCi();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[wEr]=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[wEr]=e),n}finally{r.exit(e)}}};oD.prototype.enter=function(t){j8.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};oD.prototype.exit=function(t){if(j8.ok(t,"context must be provided for exiting"),this.active===t){j8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);j8.ok(e>=0,"context not currently entered; can't exit"),j8.ok(e,"can't remove top context"),this._set.splice(e,1)};oD.prototype.bindEmitter=function(t){j8.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[wOe]||(s[wOe]=Object.create(null)),s[wOe][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[wOe]))return s;var c=s,l=s[wOe];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),MCa(t,n,o)};oD.prototype.fromException=function(t){return t[wEr]};function MCi(t){return process.namespaces[t]}a(MCi,"get");function OCa(t){j8.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(OCa,"create");function OCi(t){var e=MCi(t);j8.ok(e,"can't delete nonexistent namespace!"),j8.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(OCi,"destroy");function LCi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){OCi(t)}),process.namespaces=Object.create(null)}a(LCi,"reset");process.namespaces||LCi();BCi.exports={getNamespace:MCi,createNamespace:OCa,destroyNamespace:OCi,reset:LCi}});var AG=I(N4=>{"use strict";p();var LCa=N4&&N4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BCa=N4&&N4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FCa=N4&&N4.__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)&&LCa(e,t,r);return BCa(e,t),e};Object.defineProperty(N4,"__esModule",{value:!0});N4.CorrelationContextManager=void 0;var gG=Kl(),UCa=FCa(jht()),Kee=Hht(),REr=XAr(),UCi=Eyr(),G0e=ay(),QCa=(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 qCa(o)}:null},t.spanToContextObject=function(e,r,n){var o=new Kee;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=Kee.formatOpenTelemetryTraceFlags(e.traceFlags)||Kee.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){gG.warn("Error binding to session context",G0e.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){gG.warn("Error binding to session context",G0e.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){gG.warn("Error binding to session context",G0e.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=iCi():this.cls=FCi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){gG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",G0e.dumpObj(r)),this.enabled=!1;return}UCa.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){gG.warn("Error binding to session context",G0e.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 Kee(f.headers.traceparent):f.headers["request-id"]&&(u=new Kee(null,f.headers["request-id"])),f.headers.tracestate&&(d=new REr(f.headers.tracestate)))}u||(u=new Kee(n.traceParent||n.traceparent)),d||(d=new REr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new UCi(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 Kee(c.traceparent?c.traceparent.toString():null),d=new REr(c.tracestate?c.tracestate.toString():null),m=new UCi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return gG.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){gG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",G0e.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})();N4.CorrelationContextManager=QCa;var qCa=(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");Do.insertSnippetByIndex=Uba;var Qba=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");Do.isContentTypeHeaderHtml=Qba});var LEr=I((Agp,obi)=>{"use strict";p();var ibi=md(),qba=(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||ibi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||ibi.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})();obi.exports=qba});var sbi={};ki(sbi,{webSnippet:()=>jba});var jba,abi=ve(()=>{p();jba=`!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 jva=Pvi();process&&jva.gte(process.versions.node,"8.0.0")?Jyr.exports=Uvi():Jyr.exports=aCi()});var TCi=I((_o,SCi)=>{p();_o=SCi.exports=Ma;var fl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?fl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):fl=a(function(){},"debug");_o.SEMVER_SPEC_VERSION="2.0.0";var SOe=256,lmt=Number.MAX_SAFE_INTEGER||9007199254740991,Zyr=16,Hva=SOe-6,TOe=_o.re=[],Du=_o.safeRe=[],rr=_o.src=[],ma=0,nEr="[a-zA-Z0-9-]",Xyr=[["\\s",1],["\\d",SOe],[nEr,Hva]];function mmt(t){for(var e=0;e)?=?)";var umt=ma++;rr[umt]=rr[B0e]+"|x|X|\\*";var dmt=ma++;rr[dmt]=rr[L0e]+"|x|X|\\*";var $ee=ma++;rr[$ee]="[v=\\s]*("+rr[dmt]+")(?:\\.("+rr[dmt]+")(?:\\.("+rr[dmt]+")(?:"+rr[oEr]+")?"+rr[xOe]+"?)?)?";var U0e=ma++;rr[U0e]="[v=\\s]*("+rr[umt]+")(?:\\.("+rr[umt]+")(?:\\.("+rr[umt]+")(?:"+rr[sEr]+")?"+rr[xOe]+"?)?)?";var pCi=ma++;rr[pCi]="^"+rr[j0e]+"\\s*"+rr[$ee]+"$";var hCi=ma++;rr[hCi]="^"+rr[j0e]+"\\s*"+rr[U0e]+"$";var mCi=ma++;rr[mCi]="(?:^|[^\\d])(\\d{1,"+Zyr+"})(?:\\.(\\d{1,"+Zyr+"}))?(?:\\.(\\d{1,"+Zyr+"}))?(?:$|[^\\d])";var gmt=ma++;rr[gmt]="(?:~>?)";var Q0e=ma++;rr[Q0e]="(\\s*)"+rr[gmt]+"\\s+";TOe[Q0e]=new RegExp(rr[Q0e],"g");Du[Q0e]=new RegExp(mmt(rr[Q0e]),"g");var Gva="$1~",gCi=ma++;rr[gCi]="^"+rr[gmt]+rr[$ee]+"$";var ACi=ma++;rr[ACi]="^"+rr[gmt]+rr[U0e]+"$";var Amt=ma++;rr[Amt]="(?:\\^)";var q0e=ma++;rr[q0e]="(\\s*)"+rr[Amt]+"\\s+";TOe[q0e]=new RegExp(rr[q0e],"g");Du[q0e]=new RegExp(mmt(rr[q0e]),"g");var $va="$1^",yCi=ma++;rr[yCi]="^"+rr[Amt]+rr[$ee]+"$";var ECi=ma++;rr[ECi]="^"+rr[Amt]+rr[U0e]+"$";var uEr=ma++;rr[uEr]="^"+rr[j0e]+"\\s*("+cEr+")$|^$";var dEr=ma++;rr[dEr]="^"+rr[j0e]+"\\s*("+fCi+")$|^$";var Vee=ma++;rr[Vee]="(\\s*)"+rr[j0e]+"\\s*("+cEr+"|"+rr[$ee]+")";TOe[Vee]=new RegExp(rr[Vee],"g");Du[Vee]=new RegExp(mmt(rr[Vee]),"g");var Vva="$1$2$3",_Ci=ma++;rr[_Ci]="^\\s*("+rr[$ee]+")\\s+-\\s+("+rr[$ee]+")\\s*$";var vCi=ma++;rr[vCi]="^\\s*("+rr[U0e]+")\\s+-\\s+("+rr[U0e]+")\\s*$";var CCi=ma++;rr[CCi]="(<|>)?=?\\s*\\*";for(R4=0;R4SOe)return null;var r=e.loose?Du[lEr]:Du[aEr];if(!r.test(t))return null;try{return new Ma(t,e)}catch{return null}}a(Wee,"parse");_o.valid=Wva;function Wva(t,e){var r=Wee(t,e);return r?r.version:null}a(Wva,"valid");_o.clean=zva;function zva(t,e){var r=Wee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(zva,"clean");_o.SemVer=Ma;function Ma(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Ma){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>SOe)throw new TypeError("version is longer than "+SOe+" characters");if(!(this instanceof Ma))return new Ma(t,e);fl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Du[lEr]:Du[aEr]);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>lmt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>lmt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>lmt||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};_o.inc=Yva;function Yva(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Ma(t,r).inc(e,n).version}catch{return null}}a(Yva,"inc");_o.diff=Kva;function Kva(t,e){if(fEr(t,e))return null;var r=Wee(t),n=Wee(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(Kva,"diff");_o.compareIdentifiers=F0e;var lCi=/^[0-9]+$/;function F0e(t,e){var r=lCi.test(t),n=lCi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(IOe,"gt");_o.lt=fmt;function fmt(t,e,r){return j8(t,e,r)<0}a(fmt,"lt");_o.eq=fEr;function fEr(t,e,r){return j8(t,e,r)===0}a(fEr,"eq");_o.neq=bCi;function bCi(t,e,r){return j8(t,e,r)!==0}a(bCi,"neq");_o.gte=pEr;function pEr(t,e,r){return j8(t,e,r)>=0}a(pEr,"gte");_o.lte=hEr;function hEr(t,e,r){return j8(t,e,r)<=0}a(hEr,"lte");_o.cmp=pmt;function pmt(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 fEr(t,r,n);case"!=":return bCi(t,r,n);case">":return IOe(t,r,n);case">=":return pEr(t,r,n);case"<":return fmt(t,r,n);case"<=":return hEr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(pmt,"cmp");_o.Comparator=ER;function ER(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof ER){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof ER))return new ER(t,e);t=t.trim().split(/\s+/).join(" "),fl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===wOe?this.value="":this.value=this.operator+this.semver.version,fl("comp",this)}a(ER,"Comparator");var wOe={};ER.prototype.parse=function(t){var e=this.options.loose?Du[uEr]:Du[dEr],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 Ma(r[2],this.options.loose):this.semver=wOe};ER.prototype.toString=function(){return this.value};ER.prototype.test=function(t){return fl("Comparator.test",t,this.options.loose),this.semver===wOe?!0:(typeof t=="string"&&(t=new Ma(t,this.options)),pmt(t,this.operator,this.semver,this.options))};ER.prototype.intersects=function(t,e){if(!(t instanceof ER))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Pf(t.value,e),hmt(this.value,r,e);if(t.operator==="")return r=new Pf(this.value,e),hmt(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=pmt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=pmt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};_o.Range=Pf;function Pf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Pf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Pf(t.raw,e);if(t instanceof ER)return new Pf(t.value,e);if(!(this instanceof Pf))return new Pf(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(Pf,"Range");Pf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Pf.prototype.toString=function(){return this.range};Pf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Du[vCi]:Du[_Ci];t=t.replace(r,hCa),fl("hyphen replace",t),t=t.replace(Du[Vee],Vva),fl("comparator trim",t,Du[Vee]),t=t.replace(Du[Q0e],Gva),t=t.replace(Du[q0e],$va);var n=e?Du[uEr]:Du[dEr],o=t.split(" ").map(function(s){return sCa(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 ER(s,this.options)},this),o};Pf.prototype.intersects=function(t,e){if(!(t instanceof Pf))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)})})})})};_o.toComparators=oCa;function oCa(t,e){return new Pf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(oCa,"toComparators");function sCa(t,e){return fl("comp",t,e),t=lCa(t,e),fl("caret",t),t=aCa(t,e),fl("tildes",t),t=dCa(t,e),fl("xrange",t),t=pCa(t,e),fl("stars",t),t}a(sCa,"parseComparator");function Tv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(Tv,"isX");function aCa(t,e){return t.trim().split(/\s+/).map(function(r){return cCa(r,e)}).join(" ")}a(aCa,"replaceTildes");function cCa(t,e){var r=e.loose?Du[ACi]:Du[gCi];return t.replace(r,function(n,o,s,c,l){fl("tilde",t,n,o,s,c,l);var u;return Tv(o)?u="":Tv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Tv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(fl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",fl("tilde return",u),u})}a(cCa,"replaceTilde");function lCa(t,e){return t.trim().split(/\s+/).map(function(r){return uCa(r,e)}).join(" ")}a(lCa,"replaceCarets");function uCa(t,e){fl("caret",t,e);var r=e.loose?Du[ECi]:Du[yCi];return t.replace(r,function(n,o,s,c,l){fl("caret",t,n,o,s,c,l);var u;return Tv(o)?u="":Tv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Tv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(fl("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"):(fl("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"),fl("caret return",u),u})}a(uCa,"replaceCaret");function dCa(t,e){return fl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return fCa(r,e)}).join(" ")}a(dCa,"replaceXRanges");function fCa(t,e){t=t.trim();var r=e.loose?Du[hCi]:Du[pCi];return t.replace(r,function(n,o,s,c,l,u){fl("xRange",t,n,o,s,c,l,u);var d=Tv(s),f=d||Tv(c),h=f||Tv(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"),fl("xRange return",n),n})}a(fCa,"replaceXRange");function pCa(t,e){return fl("replaceStars",t,e),t.trim().replace(Du[CCi],"")}a(pCa,"replaceStars");function hCa(t,e,r,n,o,s,c,l,u,d,f,h,m){return Tv(r)?e="":Tv(n)?e=">="+r+".0.0":Tv(o)?e=">="+r+"."+n+".0":e=">="+e,Tv(u)?l="":Tv(d)?l="<"+(+u+1)+".0.0":Tv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(hCa,"hyphenReplace");Pf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Ma(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(mCa,"testSet");_o.satisfies=hmt;function hmt(t,e,r){try{e=new Pf(e,r)}catch{return!1}return e.test(t)}a(hmt,"satisfies");_o.maxSatisfying=gCa;function gCa(t,e,r){var n=null,o=null;try{var s=new Pf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Ma(n,r))}),n}a(gCa,"maxSatisfying");_o.minSatisfying=ACa;function ACa(t,e,r){var n=null,o=null;try{var s=new Pf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Ma(n,r))}),n}a(ACa,"minSatisfying");_o.minVersion=yCa;function yCa(t,e){t=new Pf(t,e);var r=new Ma("0.0.0");if(t.test(r)||(r=new Ma("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||IOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(yCa,"minVersion");_o.validRange=ECa;function ECa(t,e){try{return new Pf(t,e).range||"*"}catch{return null}}a(ECa,"validRange");_o.ltr=_Ca;function _Ca(t,e,r){return mEr(t,e,"<",r)}a(_Ca,"ltr");_o.gtr=vCa;function vCa(t,e,r){return mEr(t,e,">",r)}a(vCa,"gtr");_o.outside=mEr;function mEr(t,e,r,n){t=new Ma(t,n),e=new Pf(e,n);var o,s,c,l,u;switch(r){case">":o=IOe,s=hEr,c=fmt,l=">",u=">=";break;case"<":o=fmt,s=pEr,c=IOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(hmt(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(mEr,"outside");_o.prerelease=CCa;function CCa(t,e){var r=Wee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(CCa,"prerelease");_o.intersects=bCa;function bCa(t,e,r){return t=new Pf(t,r),e=new Pf(e,r),t.intersects(e)}a(bCa,"intersects");_o.coerce=SCa;function SCa(t){if(t instanceof Ma)return t;if(typeof t!="string")return null;var e=t.match(Du[mCi]);return e==null?null:Wee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(SCa,"coerce")});var wCi=I((w0p,xCi)=>{p();var TCa=f0e().wrap,AEr=1,yEr=2,EEr=4,Emt=8,Jl=[],ICa=0,OE=!1,mG=[],H0e,_Er;function vEr(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(Jl=mG.pop()),G0e=void 0,n&&!OE},"asyncCatcher"),_Er=a(function(e,r,n){var o=[];OE=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);OE=!1;var d=e.apply(this,arguments);for(OE=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return OE=!1,Jl=mG.pop(),G0e=void 0,d}},"asyncWrap"),TCa(process,"_fatalException",function(t){return a(function(r){return H0e(r)||t(r)},"_asyncFatalException")})):(gEr=!1,H0e=a(function(e){if(gEr)throw e;for(var r=!1,n=Jl.length,o=0;o0&&r[f].before(this,o[r[f].uid]);OE=!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]);OE=!1}Jl=mG.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",H0e));var ymt,G0e,gEr;function xCa(t,e,r){OE=!0;for(var n=0;n0)return _Er(t,r,e);return xCa(t,r,e)}a(wCa,"wrapCallback");function k4(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=AEr),typeof t.before=="function"&&(this.before=t.before,this.flags|=yEr),typeof t.after=="function"&&(this.after=t.after,this.flags|=EEr),typeof t.error=="function"&&(this.error=t.error,this.flags|=Emt),this.uid=++ICa,this.data=e===void 0?null:e}a(k4,"AsyncListener");k4.prototype.create=void 0;k4.prototype.before=void 0;k4.prototype.after=void 0;k4.prototype.error=void 0;k4.prototype.data=void 0;k4.prototype.uid=0;k4.prototype.flags=0;function ICi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof k4?t:new k4(t,e)}a(ICi,"createAsyncListener");function RCa(t,e){var r;t instanceof k4?r=t:r=ICi(t,e);for(var n=!1,o=0;o{"use strict";p();RCi.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 BCi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var MCi=f0e(),vmt=TCi(),Hb=MCi.wrap,gG=MCi.massWrap,Df=wCi(),PCa=require("util"),DCa=vmt.gte(process.version,"6.0.0"),SEr=vmt.gte(process.version,"7.0.0"),NCa=vmt.gte(process.version,"8.0.0"),MCa=vmt.gte(process.version,"11.0.0"),P4=require("net");SEr&&!P4._normalizeArgs?P4._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:UCa(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]}:!SEr&&!P4._normalizeConnectArgs&&(P4._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 P4.Server.prototype?Hb(P4.Server.prototype,"_setUpListenHandle",PCi):Hb(P4.Server.prototype,"_listen2",PCi);function PCi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=Df(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=Df(this._handle.onconnection))}}}a(PCi,"wrapSetUpListenHandle");function OCi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=Df(e._originalOnread)}}a(OCi,"patchOnRead");Hb(P4.Socket.prototype,"connect",function(t){return function(){var e;NCa&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=SEr?P4._normalizeArgs(arguments):P4._normalizeConnectArgs(arguments),e[1]&&(e[1]=Df(e[1]));var r=t.apply(this,e);return OCi(this),r}});var OCa=require("http");Hb(OCa.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=Df(function(n){return OCi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var CEr=require("child_process");function DCi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=Df(e._handle.onread),Hb(e._handle,"close",Cmt))}),t._handle&&(t._handle.onexit=Df(t._handle.onexit))}a(DCi,"wrapChildProcess");CEr.ChildProcess?Hb(CEr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return DCi(this),e}}):gG(CEr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return DCi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var xEr=[];process._nextDomainTick&&xEr.push("_nextDomainTick");process._tickDomainCallback&&xEr.push("_tickDomainCallback");gG(process,xEr,D4);Hb(process,"nextTick",Cmt);var wEr=["setTimeout","setInterval"];global.setImmediate&&wEr.push("setImmediate");var LCi=require("timers"),LCa=global.setTimeout===LCi.setTimeout;gG(LCi,wEr,Cmt);LCa&&gG(global,wEr,Cmt);var TEr=require("dns");gG(TEr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],D4);TEr.resolveNaptr&&Hb(TEr,"resolveNaptr",D4);var Yee=require("fs");gG(Yee,["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"],D4);Yee.lchown&&Hb(Yee,"lchown",D4);Yee.lchmod&&Hb(Yee,"lchmod",D4);Yee.ftruncate&&Hb(Yee,"ftruncate",D4);var ROe;try{ROe=require("zlib")}catch{}ROe&&ROe.Deflate&&ROe.Deflate.prototype&&(zee=Object.getPrototypeOf(ROe.Deflate.prototype),zee._transform?Hb(zee,"_transform",D4):zee.write&&zee.flush&&zee.end&&gG(zee,["write","flush","end"],D4));var zee,IEr;try{IEr=require("crypto")}catch{}IEr&&(bEr=["pbkdf2","randomBytes"],MCa||bEr.push("pseudoRandomBytes"),gG(IEr,bEr,D4));var bEr,_mt=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";_mt&&(NCi=process.addAsyncListener({create:a(function(){_mt=!1},"create")}),global.Promise.resolve(!0).then(a(function(){_mt=!1},"notSync")),process.removeAsyncListener(NCi));var NCi;_mt&&BCa();function BCa(){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"),PCa.inherits(e,t),Hb(t.prototype,"then",s),t.prototype.chain&&Hb(t.prototype,"chain",s),DCa)global.Promise=kCi()(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=Df(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:Df(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(BCa,"wrapPromise");function D4(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(FCa,"toNumber");function UCa(t){return typeof t=="string"&&FCa(t)===!1}a(UCa,"isPipeName")});var jCi=I((U0p,qCi)=>{"use strict";p();var H8=require("assert"),QCa=omt(),kOe="cls@contexts",REr="error@context";process.addAsyncListener||BCi();function sD(t){this.name=t,this.active=null,this._set=[],this.id=null}a(sD,"Namespace");sD.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};sD.prototype.get=function(t){if(this.active)return this.active[t]};sD.prototype.createContext=function(){return Object.create(this.active)};sD.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[REr]=e),r}finally{this.exit(e)}};sD.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};sD.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[REr]=e),n}finally{r.exit(e)}}};sD.prototype.enter=function(t){H8.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};sD.prototype.exit=function(t){if(H8.ok(t,"context must be provided for exiting"),this.active===t){H8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);H8.ok(e>=0,"context not currently entered; can't exit"),H8.ok(e,"can't remove top context"),this._set.splice(e,1)};sD.prototype.bindEmitter=function(t){H8.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[kOe]||(s[kOe]=Object.create(null)),s[kOe][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[kOe]))return s;var c=s,l=s[kOe];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),QCa(t,n,o)};sD.prototype.fromException=function(t){return t[REr]};function FCi(t){return process.namespaces[t]}a(FCi,"get");function qCa(t){H8.ok(t,"namespace must be given a name!");var e=new sD(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(qCa,"create");function UCi(t){var e=FCi(t);H8.ok(e,"can't delete nonexistent namespace!"),H8.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(UCi,"destroy");function QCi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){UCi(t)}),process.namespaces=Object.create(null)}a(QCi,"reset");process.namespaces||QCi();qCi.exports={getNamespace:FCi,createNamespace:qCa,destroyNamespace:UCi,reset:QCi}});var yG=I(N4=>{"use strict";p();var jCa=N4&&N4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HCa=N4&&N4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),GCa=N4&&N4.__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)&&jCa(e,t,r);return HCa(e,t),e};Object.defineProperty(N4,"__esModule",{value:!0});N4.CorrelationContextManager=void 0;var AG=Kl(),$Ca=GCa(Hht()),Kee=Ght(),kEr=eyr(),HCi=_yr(),$0e=ay(),VCa=(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 WCa(o)}:null},t.spanToContextObject=function(e,r,n){var o=new Kee;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=Kee.formatOpenTelemetryTraceFlags(e.traceFlags)||Kee.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){AG.warn("Error binding to session context",$0e.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){AG.warn("Error binding to session context",$0e.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){AG.warn("Error binding to session context",$0e.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=cCi():this.cls=jCi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){AG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",$0e.dumpObj(r)),this.enabled=!1;return}$Ca.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){AG.warn("Error binding to session context",$0e.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 Kee(f.headers.traceparent):f.headers["request-id"]&&(u=new Kee(null,f.headers["request-id"])),f.headers.tracestate&&(d=new kEr(f.headers.tracestate)))}u||(u=new Kee(n.traceParent||n.traceparent)),d||(d=new kEr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new HCi(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 Kee(c.traceparent?c.traceparent.toString():null),d=new kEr(c.tracestate?c.tracestate.toString():null),m=new HCi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return AG.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){AG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",$0e.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})();N4.CorrelationContextManager=VCa;var WCa=(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");No.insertSnippetByIndex=$ba;var Vba=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");No.isContentTypeHeaderHtml=Vba});var BEr=I((Igp,lbi)=>{"use strict";p();var cbi=md(),Wba=(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||cbi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||cbi.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})();lbi.exports=Wba});var ubi={};ki(ubi,{webSnippet:()=>zba});var zba,dbi=ve(()=>{p();zba=`!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 cbi=require("http"),lbi=require("https"),z0e=require("zlib"),M4=Kl(),_R=nbi(),ubi=OEr(),kOe=md(),dbi=LEr(),Hba=(abi(),ba(sbi)),Gba=(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=kOe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=kOe.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(kOe.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(kOe.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=dbi.parse(e),o=n.instrumentationkey||"";dbi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,M4.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){M4.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=ubi.getOsPrefix(),n=ubi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r +}});`});var Abi=I((kgp,gbi)=>{"use strict";p();var fbi=require("http"),pbi=require("https"),Y0e=require("zlib"),M4=Kl(),vR=abi(),hbi=LEr(),DOe=md(),mbi=BEr(),Yba=(dbi(),Ca(ubi)),Kba=(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=DOe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=DOe.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(DOe.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(DOe.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=mbi.parse(e),o=n.instrumentationkey||"";mbi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,M4.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){M4.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=hbi.getOsPrefix(),n=hbi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r `).concat(e,` disableIkeyDeprecationMessage: true,\r - sdkExtension: "`).concat(n).concat(r,"d_n_"),s=Hba.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(kOe.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=Yba.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(DOe.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,M4.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=cbi.createServer,r=lbi.createServer,n=this._isEnabled;cbi.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=_R.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){M4.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=_R.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){M4.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},lbi.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 E=_R.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=this.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){M4.warn("Inject snippet error: "+b)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var E=_R.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){M4.warn("Inject snippet error: "+b)}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=_R.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){M4.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=_R.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=_R.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){M4.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 _R.contentEncodingMethod.GZIP:var o=z0e.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=z0e.gzipSync(s)}break;case _R.contentEncodingMethod.DEFLATE:var c=z0e.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=z0e.deflateSync(l)}break;case _R.contentEncodingMethod.BR:var u=_R.getBrotliDecompressSync(z0e),d=_R.getBrotliCompressSync(z0e);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){M4.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();fbi.exports=Gba});var mbi=I((FEr,hbi)=>{"use strict";p();var $ba=FEr&&FEr.__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)}})(),vR=require("url"),BEr=ME(),Vba=ay(),Wba=S0e(),zba=myr(),Yba=Qee(),Kba=(function(t){$ba(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=Vba.getCorrelationContextTarget(r,Wba.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=BEr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new vR.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=BEr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==Yba.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=BEr.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 vR.URL(r)}catch{}else try{var o=new vR.URL("http://"+r);o.port==="443"?r=new vR.URL("https://"+r):r=new vR.URL("http://"+r)}catch{}else{if(r&&typeof vR.URL=="function"&&r instanceof vR.URL)return vR.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 vR.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 vR.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 vR.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",vR.format(r)},e})(zba);hbi.exports=Kba});var gbi=I(Y0e=>{"use strict";p();var Lmt=Y0e&&Y0e.__assign||function(){return Lmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var t1a=$8&&$8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),r1a=$8&&$8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),n1a=$8&&$8.__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)&&t1a(e,t,r);return r1a(e,t),e};Object.defineProperty($8,"__esModule",{value:!0});$8.spanToTelemetryContract=u1a;var Abi=require("url"),sD=(co(),ba(V5)),_s=(yht(),ba(TAr)),G8=n1a(md()),i1a=gbi(),o1a=ay();function s1a(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=o1a.stringify(s)),e}a(s1a,"createPropertiesFromSpan");function a1a(t){return t===_s.DbSystemValues.DB2||t===_s.DbSystemValues.DERBY||t===_s.DbSystemValues.MARIADB||t===_s.DbSystemValues.MSSQL||t===_s.DbSystemValues.ORACLE||t===_s.DbSystemValues.SQLITE||t===_s.DbSystemValues.OTHER_SQL||t===_s.DbSystemValues.HSQLDB||t===_s.DbSystemValues.H2}a(a1a,"isSqlDB");function ybi(t){var e=t.attributes[_s.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[_s.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[_s.SemanticAttributes.HTTP_SCHEME],o=t.attributes[_s.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[_s.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[_s.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[_s.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[_s.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(ybi,"getUrl");function QEr(t){var e=t.attributes[_s.SemanticAttributes.PEER_SERVICE],r=t.attributes[_s.SemanticAttributes.HTTP_HOST],n=t.attributes[_s.SemanticAttributes.HTTP_URL],o=t.attributes[_s.SemanticAttributes.NET_PEER_NAME],s=t.attributes[_s.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(QEr,"getDependencyTarget");function c1a(t){var e={name:t.name,success:t.status.code!=sD.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===sD.SpanKind.PRODUCER&&(e.dependencyTypeName=G8.DependencyTypeName.QueueMessage),t.kind===sD.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=G8.DependencyTypeName.InProc);var r=t.attributes[_s.SemanticAttributes.HTTP_METHOD],n=t.attributes[_s.SemanticAttributes.DB_SYSTEM],o=t.attributes[_s.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=G8.DependencyTypeName.Http;var s=t.attributes[_s.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new Abi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=ybi(t);var u=t.attributes[_s.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=QEr(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)===_s.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===_s.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===_s.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===_s.DbSystemValues.REDIS?e.dependencyTypeName="redis":a1a(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[_s.SemanticAttributes.DB_STATEMENT],y=t.attributes[_s.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=QEr(t),E=t.attributes[_s.SemanticAttributes.DB_NAME];d?e.target=E?"".concat(d,"|").concat(E):"".concat(d):e.target=E?"".concat(E):"".concat(n)}else if(o){e.dependencyTypeName=G8.DependencyTypeName.Grpc;var _=t.attributes[_s.SemanticAttributes.RPC_GRPC_STATUS_CODE];_&&(e.resultCode=String(_));var d=QEr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(c1a,"createDependencyData");function l1a(t){var e={name:t.name,success:t.status.code!=sD.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[_s.SemanticAttributes.HTTP_METHOD],n=t.attributes[_s.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==sD.SpanKind.SERVER){var o=t.attributes[_s.SemanticAttributes.HTTP_ROUTE],s=t.attributes[_s.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new Abi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=ybi(t);var l=t.attributes[_s.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(l1a,"createRequestData");function u1a(t){var e;switch(t.kind){case sD.SpanKind.CLIENT:case sD.SpanKind.PRODUCER:case sD.SpanKind.INTERNAL:e=c1a(t);break;case sD.SpanKind.SERVER:case sD.SpanKind.CONSUMER:e=l1a(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=s1a(t),t.attributes[G8.AzNamespace]&&(t.kind===sD.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(G8.DependencyTypeName.InProc," | ").concat(t.attributes[G8.AzNamespace])),t.attributes[G8.AzNamespace]===G8.MicrosoftEventHub&&(0,i1a.parseEventHubSpan)(t,e)),e}a(u1a,"spanToTelemetryContract")});var vbi=I(CG=>{"use strict";p();var K0e=CG&&CG.__assign||function(){return K0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var f1a=zT&&zT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),p1a=zT&&zT.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),h1a=zT&&zT.__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)&&f1a(e,t,r);return p1a(e,t),e};Object.defineProperty(zT,"__esModule",{value:!0});zT.subscriber=void 0;zT.enable=E1a;var DOe=(co(),ba(V5)),m1a=md(),qEr=Cp(),g1a=h1a(Ebi()),A1a=vbi(),Xee=[],y1a=a(function(t){try{var e=t.data,r=g1a.spanToTelemetryContract(e);A1a.AsyncScopeManager.with(e,function(){Xee.forEach(function(n){e.kind===DOe.SpanKind.SERVER||e.kind===DOe.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===DOe.SpanKind.CLIENT||e.kind===DOe.SpanKind.INTERNAL||e.kind===DOe.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");zT.subscriber=y1a;function E1a(t,e){if(t){var r=Xee.find(function(n){return n==e});if(r)return;Xee.length===0&&qEr.channel.subscribe("azure-coretracing",zT.subscriber,qEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(m1a.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),Xee.push(e)}else Xee=Xee.filter(function(n){return n!=e}),Xee.length===0&&qEr.channel.unsubscribe("azure-coretracing",zT.subscriber)}a(E1a,"enable")});var bbi=I(tte=>{"use strict";p();Object.defineProperty(tte,"__esModule",{value:!0});tte.subscriber=void 0;tte.enable=C1a;var _1a=md(),jEr=Cp(),ete=[],v1a=a(function(t){t.data.event.commandName!=="ismaster"&&ete.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");tte.subscriber=v1a;function C1a(t,e){if(t){var r=ete.find(function(n){return n==e});if(r)return;ete.length===0&&jEr.channel.subscribe("mongodb",tte.subscriber,jEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(_1a.StatsbeatInstrumentation.MONGODB)}),ete.push(e)}else ete=ete.filter(function(n){return n!=e}),ete.length===0&&jEr.channel.unsubscribe("mongodb",tte.subscriber)}a(C1a,"enable")});var Sbi=I(nte=>{"use strict";p();Object.defineProperty(nte,"__esModule",{value:!0});nte.subscriber=void 0;nte.enable=T1a;var b1a=md(),HEr=Cp(),rte=[],S1a=a(function(t){rte.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");nte.subscriber=S1a;function T1a(t,e){if(t){var r=rte.find(function(n){return n==e});if(r)return;rte.length===0&&HEr.channel.subscribe("mysql",nte.subscriber,HEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(b1a.StatsbeatInstrumentation.MYSQL)}),rte.push(e)}else rte=rte.filter(function(n){return n!=e}),rte.length===0&&HEr.channel.unsubscribe("mysql",nte.subscriber)}a(T1a,"enable")});var Tbi=I(ote=>{"use strict";p();Object.defineProperty(ote,"__esModule",{value:!0});ote.subscriber=void 0;ote.enable=w1a;var I1a=md(),GEr=Cp(),ite=[],x1a=a(function(t){ite.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");ote.subscriber=x1a;function w1a(t,e){if(t){var r=ite.find(function(n){return n==e});if(r)return;ite.length===0&&GEr.channel.subscribe("redis",ote.subscriber,GEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(I1a.StatsbeatInstrumentation.REDIS)}),ite.push(e)}else ite=ite.filter(function(n){return n!=e}),ite.length===0&&GEr.channel.unsubscribe("redis",ote.subscriber)}a(w1a,"enable")});var Ibi=I(ate=>{"use strict";p();Object.defineProperty(ate,"__esModule",{value:!0});ate.subscriber=void 0;ate.enable=P1a;var R1a=md(),$Er=Cp(),ste=[],k1a=a(function(t){ste.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");ate.subscriber=k1a;function P1a(t,e){if(t){var r=ste.find(function(n){return n==e});if(r)return;ste.length===0&&$Er.channel.subscribe("postgres",ate.subscriber,$Er.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(R1a.StatsbeatInstrumentation.POSTGRES)}),ste.push(e)}else ste=ste.filter(function(n){return n!=e}),ste.length===0&&$Er.channel.unsubscribe("postgres",ate.subscriber)}a(P1a,"enable")});var X0e=I((V8,xbi)=>{"use strict";p();var D1a=V8&&V8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N1a=V8&&V8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),M1a=V8&&V8.__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)&&D1a(e,t,r);return N1a(e,t),e},Bmt=V8&&V8.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var wbi=require("http"),Rbi=require("https"),kbi=Kl(),Pbi=ay(),F1a=S0e(),WEr=Eyr(),W8=AG(),U1a=kmt(),Q1a=(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||U1a.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?W8.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&W8.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 W8.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 WEr(e),c=this._generateCorrelationContext(s);W8.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){W8.CorrelationContextManager.wrapEmitter(c),W8.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=wbi.createServer;wbi.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=Rbi.createServer;Rbi.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){kbi.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=W8.CorrelationContextManager.getCurrentContext(),o=new WEr(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){kbi.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=W8.CorrelationContextManager.getCurrentContext(),s=n||new WEr(r.request,o&&o.operation.parentId);Pbi.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(F1a.requestContextHeader);Pbi.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,W8.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();Dbi.exports=Q1a});var Obi=I((KEr,Mbi)=>{"use strict";p();var CR=KEr&&KEr.__assign||function(){return CR=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:H1a,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 cte.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case cte.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case cte.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case cte.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case cte.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=CR(CR({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=CR(CR({},r),{Message:e.data.baseData.message,SeverityLevel:cte.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=CR(CR({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=CR(CR({},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=CR(CR({},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=Nbi.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=Nbi.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):j1a.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 cte.ContextTagKeys,t})();Mbi.exports=G1a});var Bbi=I((nAp,Lbi)=>{"use strict";p();var $1a=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");Lbi.exports={getTransmissionTime:$1a}});var qbi=I((OOe,Qbi)=>{"use strict";p();var Fbi=OOe&&OOe.__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())})},Ubi=OOe&&OOe.__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=bR.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[bR.time]=z1a.getTransmissionTime(),g["Content-Type"]="application/json",g["Content-Length"]=Buffer.byteLength(c),g),m),s&&s.length>0&&s.forEach(function(E){return l.headers[E.name]=E.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:",JEr.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=ZEr.tlsRestrictedAgent,h=V1a.request(l,function(E){if(E.statusCode==200){var _=E.headers[bR.subscribed]==="true",v=null;try{v=E.headers[bR.endpointRedirect]?new Y1a.URL(E.headers[bR.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+ZEr.dumpObj(T))}var b=E.headers[bR.pollingIntervalHint]?parseInt(E.headers[bR.pollingIntervalHint].toString()):null;A._consecutiveErrors=0,n(_,E,v,b)}else A._onError("StatusCode:"+E.statusCode+" StatusMessage:"+E.statusMessage),n()}),h.on("error",function(E){A._onError(E),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:"),JEr.warn(t.TAG,r,e)):JEr.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();Qbi.exports=K1a});var Wbi=I((LOe,Vbi)=>{"use strict";p();var jbi=LOe&&LOe.__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())})},Hbi=LOe&&LOe.__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 jbi(this,void 0,void 0,function(){return Hbi(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&&(Gbi.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,Gbi.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})();Vbi.exports=X1a});var Ybi=I(ege=>{"use strict";p();var Qmt=ege&&ege.__assign||function(){return Qmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var Kbi=SG&&SG.__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())})},Jbi=SG&&SG.__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 oSa=Qee(),Xbi=LEr(),sSa=Kl(),e1i=md(),aSa=require("url"),cSa=tpt(),lSa=(function(){function t(e){this._endpointBase=e1i.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=Xbi.parse(e),o=Xbi.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]||e1i.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new aSa.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=oSa.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)||sSa.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=cSa.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})();t1i.exports=lSa});var i_r=I(n_r=>{"use strict";p();Object.defineProperty(n_r,"__esModule",{value:!0});n_r.createEmptyPipeline=uSa;var r1i=new Set(["Deserialize","Serialize","Retry","Sign"]),r_r=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&&!r1i.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!r1i.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,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);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 E of y.dependants)E.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 uSa(){return r_r.create()}a(uSa,"createEmptyPipeline")});var lte=I(jmt=>{"use strict";p();Object.defineProperty(jmt,"__esModule",{value:!0});jmt.logger=void 0;var dSa=sht();jmt.logger=(0,dSa.createClientLogger)("core-rest-pipeline")});var s_r=I(o_r=>{"use strict";p();Object.defineProperty(o_r,"__esModule",{value:!0});o_r.getRandomIntegerInclusive=fSa;function fSa(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(fSa,"getRandomIntegerInclusive")});var n1i=I(a_r=>{"use strict";p();Object.defineProperty(a_r,"__esModule",{value:!0});a_r.calculateRetryDelay=hSa;var pSa=s_r();function hSa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,pSa.getRandomIntegerInclusive)(0,n/2)}}a(hSa,"calculateRetryDelay")});var Hmt=I(c_r=>{"use strict";p();Object.defineProperty(c_r,"__esModule",{value:!0});c_r.isObject=mSa;function mSa(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(mSa,"isObject")});var i1i=I(l_r=>{"use strict";p();Object.defineProperty(l_r,"__esModule",{value:!0});l_r.isError=ASa;var gSa=Hmt();function ASa(t){if((0,gSa.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(ASa,"isError")});var s1i=I(Gmt=>{"use strict";p();Object.defineProperty(Gmt,"__esModule",{value:!0});Gmt.computeSha256Hmac=ySa;Gmt.computeSha256Hash=ESa;var o1i=require("node:crypto");async function ySa(t,e,r){let n=Buffer.from(t,"base64");return(0,o1i.createHmac)("sha256",n).update(e).digest(r)}a(ySa,"computeSha256Hmac");async function ESa(t,e){return(0,o1i.createHash)("sha256").update(t).digest(e)}a(ESa,"computeSha256Hash")});var a1i=I(d_r=>{"use strict";p();var u_r;Object.defineProperty(d_r,"__esModule",{value:!0});d_r.randomUUID=CSa;var _Sa=require("node:crypto"),vSa=typeof((u_r=globalThis?.crypto)===null||u_r===void 0?void 0:u_r.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):_Sa.randomUUID;function CSa(){return vSa()}a(CSa,"randomUUID")});var c1i=I(S0=>{"use strict";p();var f_r,p_r,h_r,m_r;Object.defineProperty(S0,"__esModule",{value:!0});S0.isReactNative=S0.isNodeRuntime=S0.isNodeLike=S0.isBun=S0.isDeno=S0.isWebWorker=S0.isBrowser=void 0;S0.isBrowser=typeof window<"u"&&typeof window.document<"u";S0.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((f_r=self.constructor)===null||f_r===void 0?void 0:f_r.name)==="DedicatedWorkerGlobalScope"||((p_r=self.constructor)===null||p_r===void 0?void 0:p_r.name)==="ServiceWorkerGlobalScope"||((h_r=self.constructor)===null||h_r===void 0?void 0:h_r.name)==="SharedWorkerGlobalScope");S0.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";S0.isBun=typeof Bun<"u"&&typeof Bun.version<"u";S0.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((m_r=globalThis.process.versions)===null||m_r===void 0)&&m_r.node);S0.isNodeRuntime=S0.isNodeLike&&!S0.isBun&&!S0.isDeno;S0.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var l1i=I($mt=>{"use strict";p();Object.defineProperty($mt,"__esModule",{value:!0});$mt.uint8ArrayToString=bSa;$mt.stringToUint8Array=SSa;function bSa(t,e){return Buffer.from(t).toString(e)}a(bSa,"uint8ArrayToString");function SSa(t,e){return Buffer.from(t,e)}a(SSa,"stringToUint8Array")});var u1i=I(Vmt=>{"use strict";p();Object.defineProperty(Vmt,"__esModule",{value:!0});Vmt.Sanitizer=void 0;var TSa=Hmt(),g_r="REDACTED",ISa=["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"],xSa=["api-version"],A_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=ISa.concat(e),r=xSa.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,TSa.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,g_r);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]=g_r;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]=g_r;return r}};Vmt.Sanitizer=A_r});var Wmt=I(Aa=>{"use strict";p();Object.defineProperty(Aa,"__esModule",{value:!0});Aa.Sanitizer=Aa.uint8ArrayToString=Aa.stringToUint8Array=Aa.isWebWorker=Aa.isReactNative=Aa.isDeno=Aa.isNodeRuntime=Aa.isNodeLike=Aa.isBun=Aa.isBrowser=Aa.randomUUID=Aa.computeSha256Hmac=Aa.computeSha256Hash=Aa.isError=Aa.isObject=Aa.getRandomIntegerInclusive=Aa.calculateRetryDelay=void 0;var wSa=n1i();Object.defineProperty(Aa,"calculateRetryDelay",{enumerable:!0,get:a(function(){return wSa.calculateRetryDelay},"get")});var RSa=s_r();Object.defineProperty(Aa,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return RSa.getRandomIntegerInclusive},"get")});var kSa=Hmt();Object.defineProperty(Aa,"isObject",{enumerable:!0,get:a(function(){return kSa.isObject},"get")});var PSa=i1i();Object.defineProperty(Aa,"isError",{enumerable:!0,get:a(function(){return PSa.isError},"get")});var d1i=s1i();Object.defineProperty(Aa,"computeSha256Hash",{enumerable:!0,get:a(function(){return d1i.computeSha256Hash},"get")});Object.defineProperty(Aa,"computeSha256Hmac",{enumerable:!0,get:a(function(){return d1i.computeSha256Hmac},"get")});var DSa=a1i();Object.defineProperty(Aa,"randomUUID",{enumerable:!0,get:a(function(){return DSa.randomUUID},"get")});var ute=c1i();Object.defineProperty(Aa,"isBrowser",{enumerable:!0,get:a(function(){return ute.isBrowser},"get")});Object.defineProperty(Aa,"isBun",{enumerable:!0,get:a(function(){return ute.isBun},"get")});Object.defineProperty(Aa,"isNodeLike",{enumerable:!0,get:a(function(){return ute.isNodeLike},"get")});Object.defineProperty(Aa,"isNodeRuntime",{enumerable:!0,get:a(function(){return ute.isNodeRuntime},"get")});Object.defineProperty(Aa,"isDeno",{enumerable:!0,get:a(function(){return ute.isDeno},"get")});Object.defineProperty(Aa,"isReactNative",{enumerable:!0,get:a(function(){return ute.isReactNative},"get")});Object.defineProperty(Aa,"isWebWorker",{enumerable:!0,get:a(function(){return ute.isWebWorker},"get")});var f1i=l1i();Object.defineProperty(Aa,"stringToUint8Array",{enumerable:!0,get:a(function(){return f1i.stringToUint8Array},"get")});Object.defineProperty(Aa,"uint8ArrayToString",{enumerable:!0,get:a(function(){return f1i.uint8ArrayToString},"get")});var NSa=u1i();Object.defineProperty(Aa,"Sanitizer",{enumerable:!0,get:a(function(){return NSa.Sanitizer},"get")})});var p1i=I(y_r=>{"use strict";p();Object.defineProperty(y_r,"__esModule",{value:!0});y_r.cancelablePromiseRace=MSa;async function MSa(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(MSa,"cancelablePromiseRace")});var h1i=I(zmt=>{"use strict";p();Object.defineProperty(zmt,"__esModule",{value:!0});zmt.AbortError=void 0;var E_r=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};zmt.AbortError=E_r});var FOe=I(Ymt=>{"use strict";p();Object.defineProperty(Ymt,"__esModule",{value:!0});Ymt.AbortError=void 0;var OSa=h1i();Object.defineProperty(Ymt,"AbortError",{enumerable:!0,get:a(function(){return OSa.AbortError},"get")})});var v_r=I(__r=>{"use strict";p();Object.defineProperty(__r,"__esModule",{value:!0});__r.createAbortablePromise=BSa;var LSa=FOe();function BSa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new LSa.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(BSa,"createAbortablePromise")});var m1i=I(Kmt=>{"use strict";p();Object.defineProperty(Kmt,"__esModule",{value:!0});Kmt.delay=qSa;Kmt.calculateRetryDelay=jSa;var FSa=v_r(),USa=Wmt(),QSa="The delay was aborted.";function qSa(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,FSa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??QSa})}a(qSa,"delay");function jSa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,USa.getRandomIntegerInclusive)(0,n/2)}}a(jSa,"calculateRetryDelay")});var g1i=I(C_r=>{"use strict";p();Object.defineProperty(C_r,"__esModule",{value:!0});C_r.getErrorMessage=GSa;var HSa=Wmt();function GSa(t){if((0,HSa.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(GSa,"getErrorMessage")});var y1i=I(UOe=>{"use strict";p();Object.defineProperty(UOe,"__esModule",{value:!0});UOe.isDefined=b_r;UOe.isObjectWithProperties=$Sa;UOe.objectHasProperty=A1i;function b_r(t){return typeof t<"u"&&t!==null}a(b_r,"isDefined");function $Sa(t,e){if(!b_r(t)||typeof t!="object")return!1;for(let r of e)if(!A1i(t,r))return!1;return!0}a($Sa,"isObjectWithProperties");function A1i(t,e){return b_r(t)&&typeof t=="object"&&e in t}a(A1i,"objectHasProperty")});var O4=I(ls=>{"use strict";p();Object.defineProperty(ls,"__esModule",{value:!0});ls.isWebWorker=ls.isReactNative=ls.isNodeRuntime=ls.isNodeLike=ls.isNode=ls.isDeno=ls.isBun=ls.isBrowser=ls.objectHasProperty=ls.isObjectWithProperties=ls.isDefined=ls.getErrorMessage=ls.delay=ls.createAbortablePromise=ls.cancelablePromiseRace=void 0;ls.calculateRetryDelay=JSa;ls.computeSha256Hash=ZSa;ls.computeSha256Hmac=XSa;ls.getRandomIntegerInclusive=eTa;ls.isError=tTa;ls.isObject=rTa;ls.randomUUID=nTa;ls.uint8ArrayToString=iTa;ls.stringToUint8Array=oTa;var VSa=(m3(),ba(iQ)),dy=VSa.__importStar(Wmt()),WSa=p1i();Object.defineProperty(ls,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return WSa.cancelablePromiseRace},"get")});var zSa=v_r();Object.defineProperty(ls,"createAbortablePromise",{enumerable:!0,get:a(function(){return zSa.createAbortablePromise},"get")});var YSa=m1i();Object.defineProperty(ls,"delay",{enumerable:!0,get:a(function(){return YSa.delay},"get")});var KSa=g1i();Object.defineProperty(ls,"getErrorMessage",{enumerable:!0,get:a(function(){return KSa.getErrorMessage},"get")});var S_r=y1i();Object.defineProperty(ls,"isDefined",{enumerable:!0,get:a(function(){return S_r.isDefined},"get")});Object.defineProperty(ls,"isObjectWithProperties",{enumerable:!0,get:a(function(){return S_r.isObjectWithProperties},"get")});Object.defineProperty(ls,"objectHasProperty",{enumerable:!0,get:a(function(){return S_r.objectHasProperty},"get")});function JSa(t,e){return dy.calculateRetryDelay(t,e)}a(JSa,"calculateRetryDelay");function ZSa(t,e){return dy.computeSha256Hash(t,e)}a(ZSa,"computeSha256Hash");function XSa(t,e,r){return dy.computeSha256Hmac(t,e,r)}a(XSa,"computeSha256Hmac");function eTa(t,e){return dy.getRandomIntegerInclusive(t,e)}a(eTa,"getRandomIntegerInclusive");function tTa(t){return dy.isError(t)}a(tTa,"isError");function rTa(t){return dy.isObject(t)}a(rTa,"isObject");function nTa(){return dy.randomUUID()}a(nTa,"randomUUID");ls.isBrowser=dy.isBrowser;ls.isBun=dy.isBun;ls.isDeno=dy.isDeno;ls.isNode=dy.isNodeLike;ls.isNodeLike=dy.isNodeLike;ls.isNodeRuntime=dy.isNodeRuntime;ls.isReactNative=dy.isReactNative;ls.isWebWorker=dy.isWebWorker;function iTa(t,e){return dy.uint8ArrayToString(t,e)}a(iTa,"uint8ArrayToString");function oTa(t,e){return dy.stringToUint8Array(t,e)}a(oTa,"stringToUint8Array")});var Zmt=I(Jmt=>{"use strict";p();Object.defineProperty(Jmt,"__esModule",{value:!0});Jmt.Sanitizer=void 0;var sTa=O4(),T_r="REDACTED",aTa=["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"],cTa=["api-version"],I_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=aTa.concat(e),r=cTa.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,sTa.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,T_r);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]=T_r;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]=T_r;return r}};Jmt.Sanitizer=I_r});var x_r=I(tge=>{"use strict";p();Object.defineProperty(tge,"__esModule",{value:!0});tge.logPolicyName=void 0;tge.logPolicy=dTa;var lTa=lte(),uTa=Zmt();tge.logPolicyName="logPolicy";function dTa(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:lTa.logger.info,n=new uTa.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:tge.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(dTa,"logPolicy")});var w_r=I(rge=>{"use strict";p();Object.defineProperty(rge,"__esModule",{value:!0});rge.redirectPolicyName=void 0;rge.redirectPolicy=fTa;rge.redirectPolicyName="redirectPolicy";var E1i=["GET","HEAD"];function fTa(t={}){let{maxRetries:e=20}=t;return{name:rge.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return _1i(n,o,e)}}}a(fTa,"redirectPolicy");async function _1i(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&E1i.includes(o.method)||s===302&&E1i.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(Xmt,"__esModule",{value:!0});Xmt.getHeaderName=pTa;Xmt.setPlatformSpecificData=hTa;var v1i=(m3(),ba(iQ)),R_r=v1i.__importStar(require("node:os")),k_r=v1i.__importStar(require("node:process"));function pTa(){return"User-Agent"}a(pTa,"getHeaderName");async function hTa(t){if(k_r&&k_r.versions){let e=k_r.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",`(${R_r.arch()}-${R_r.type()}-${R_r.release()})`)}a(hTa,"setPlatformSpecificData")});var TG=I(nge=>{"use strict";p();Object.defineProperty(nge,"__esModule",{value:!0});nge.DEFAULT_RETRY_POLICY_COUNT=nge.SDK_VERSION=void 0;nge.SDK_VERSION="1.16.3";nge.DEFAULT_RETRY_POLICY_COUNT=3});var P_r=I(e0t=>{"use strict";p();Object.defineProperty(e0t,"__esModule",{value:!0});e0t.getUserAgentHeaderName=ATa;e0t.getUserAgentValue=yTa;var b1i=C1i(),mTa=TG();function gTa(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(gTa,"getUserAgentString");function ATa(){return(0,b1i.getHeaderName)()}a(ATa,"getUserAgentHeaderName");async function yTa(t){let e=new Map;e.set("core-rest-pipeline",mTa.SDK_VERSION),await(0,b1i.setPlatformSpecificData)(e);let r=gTa(e);return t?`${t} ${r}`:r}a(yTa,"getUserAgentValue")});var D_r=I(ige=>{"use strict";p();Object.defineProperty(ige,"__esModule",{value:!0});ige.userAgentPolicyName=void 0;ige.userAgentPolicy=ETa;var T1i=P_r(),S1i=(0,T1i.getUserAgentHeaderName)();ige.userAgentPolicyName="userAgentPolicy";function ETa(t={}){let e=(0,T1i.getUserAgentValue)(t.userAgentPrefix);return{name:ige.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(S1i)||r.headers.set(S1i,await e),n(r)}}}a(ETa,"userAgentPolicy")});var t0t=I(oge=>{"use strict";p();Object.defineProperty(oge,"__esModule",{value:!0});oge.isNodeReadableStream=I1i;oge.isWebReadableStream=x1i;oge.isReadableStream=_Ta;oge.isBlob=vTa;function I1i(t){return!!(t&&typeof t.pipe=="function")}a(I1i,"isNodeReadableStream");function x1i(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(x1i,"isWebReadableStream");function _Ta(t){return I1i(t)||x1i(t)}a(_Ta,"isReadableStream");function vTa(t){return typeof t.stream=="function"}a(vTa,"isBlob")});var N_r=I(QOe=>{"use strict";p();Object.defineProperty(QOe,"__esModule",{value:!0});QOe.getRawContent=TTa;QOe.createFileFromStream=ITa;QOe.createFile=xTa;var CTa=O4(),bTa=t0t(),w1i={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},r0t=Symbol("rawContent");function STa(t){return typeof t[r0t]=="function"}a(STa,"hasRawContent");function TTa(t){return STa(t)?t[r0t]():t.stream()}a(TTa,"getRawContent");function ITa(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},w1i),{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,bTa.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[r0t]:t})}a(ITa,"createFileFromStream");function xTa(t,e,r={}){var n,o,s;return CTa.isNodeLike?Object.assign(Object.assign({},w1i),{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"),[r0t]:()=>t}):new File([t],e,r)}a(xTa,"createFile")});var P1i=I(O_r=>{"use strict";p();Object.defineProperty(O_r,"__esModule",{value:!0});O_r.concat=DTa;var z8=(m3(),ba(iQ)),M_r=require("node:stream"),wTa=t0t(),RTa=N_r();function R1i(){return z8.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield z8.__await(e.read());if(r)return yield z8.__await(void 0);yield yield z8.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(R1i,"streamAsyncIterator");function kTa(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=R1i.bind(t)),t.values||(t.values=R1i.bind(t))}a(kTa,"makeAsyncIterable");function PTa(t){return t instanceof ReadableStream?(kTa(t),M_r.Readable.fromWeb(t)):t}a(PTa,"ensureNodeStream");function k1i(t){return t instanceof Uint8Array?M_r.Readable.from(Buffer.from(t)):(0,wTa.isBlob)(t)?k1i((0,RTa.getRawContent)(t)):PTa(t)}a(k1i,"toStream");async function DTa(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(k1i);return M_r.Readable.from((function(){return z8.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,z8.__asyncValues(d)),u;u=yield z8.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield z8.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield z8.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(DTa,"concat")});var L_r=I(sge=>{"use strict";p();Object.defineProperty(sge,"__esModule",{value:!0});sge.multipartPolicyName=void 0;sge.multipartPolicy=HTa;var dte=O4(),NTa=P1i(),MTa=t0t();function OTa(){return`----AzSDKFormBoundary${(0,dte.randomUUID)()}`}a(OTa,"generateBoundary");function LTa(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(LTa,"encodeHeaders");function BTa(t){return t instanceof Uint8Array?t.byteLength:(0,MTa.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(BTa,"getLength");function FTa(t){let e=0;for(let r of t){let n=BTa(r);if(n===void 0)return;e+=n}return e}a(FTa,"getTotalLength");async function UTa(t,e,r){let n=[(0,dte.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,dte.stringToUint8Array)(`\r -`,"utf-8"),(0,dte.stringToUint8Array)(LTa(s.headers),"utf-8"),(0,dte.stringToUint8Array)(`\r +`),r+=c;break}}})}catch{this._isEnabled=!1,M4.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=fbi.createServer,r=pbi.createServer,n=this._isEnabled;fbi.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=vR.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){M4.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=vR.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){M4.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},pbi.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 E=vR.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=this.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){M4.warn("Inject snippet error: "+b)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var E=vR.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){M4.warn("Inject snippet error: "+b)}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=vR.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){M4.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=vR.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=vR.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){M4.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 vR.contentEncodingMethod.GZIP:var o=Y0e.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=Y0e.gzipSync(s)}break;case vR.contentEncodingMethod.DEFLATE:var c=Y0e.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=Y0e.deflateSync(l)}break;case vR.contentEncodingMethod.BR:var u=vR.getBrotliDecompressSync(Y0e),d=vR.getBrotliCompressSync(Y0e);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){M4.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();gbi.exports=Kba});var Ebi=I((UEr,ybi)=>{"use strict";p();var Jba=UEr&&UEr.__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)}})(),CR=require("url"),FEr=ME(),Zba=ay(),Xba=T0e(),e1a=gyr(),t1a=Qee(),r1a=(function(t){Jba(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=Zba.getCorrelationContextTarget(r,Xba.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=FEr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new CR.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=FEr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==t1a.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=FEr.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 CR.URL(r)}catch{}else try{var o=new CR.URL("http://"+r);o.port==="443"?r=new CR.URL("https://"+r):r=new CR.URL("http://"+r)}catch{}else{if(r&&typeof CR.URL=="function"&&r instanceof CR.URL)return CR.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 CR.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 CR.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 CR.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",CR.format(r)},e})(e1a);ybi.exports=r1a});var _bi=I(K0e=>{"use strict";p();var Bmt=K0e&&K0e.__assign||function(){return Bmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var a1a=V8&&V8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c1a=V8&&V8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),l1a=V8&&V8.__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)&&a1a(e,t,r);return c1a(e,t),e};Object.defineProperty(V8,"__esModule",{value:!0});V8.spanToTelemetryContract=g1a;var vbi=require("url"),aD=(co(),Ca(V5)),_s=(Eht(),Ca(IAr)),$8=l1a(md()),u1a=_bi(),d1a=ay();function f1a(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=d1a.stringify(s)),e}a(f1a,"createPropertiesFromSpan");function p1a(t){return t===_s.DbSystemValues.DB2||t===_s.DbSystemValues.DERBY||t===_s.DbSystemValues.MARIADB||t===_s.DbSystemValues.MSSQL||t===_s.DbSystemValues.ORACLE||t===_s.DbSystemValues.SQLITE||t===_s.DbSystemValues.OTHER_SQL||t===_s.DbSystemValues.HSQLDB||t===_s.DbSystemValues.H2}a(p1a,"isSqlDB");function Cbi(t){var e=t.attributes[_s.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[_s.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[_s.SemanticAttributes.HTTP_SCHEME],o=t.attributes[_s.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[_s.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[_s.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[_s.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[_s.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(Cbi,"getUrl");function qEr(t){var e=t.attributes[_s.SemanticAttributes.PEER_SERVICE],r=t.attributes[_s.SemanticAttributes.HTTP_HOST],n=t.attributes[_s.SemanticAttributes.HTTP_URL],o=t.attributes[_s.SemanticAttributes.NET_PEER_NAME],s=t.attributes[_s.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(qEr,"getDependencyTarget");function h1a(t){var e={name:t.name,success:t.status.code!=aD.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===aD.SpanKind.PRODUCER&&(e.dependencyTypeName=$8.DependencyTypeName.QueueMessage),t.kind===aD.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=$8.DependencyTypeName.InProc);var r=t.attributes[_s.SemanticAttributes.HTTP_METHOD],n=t.attributes[_s.SemanticAttributes.DB_SYSTEM],o=t.attributes[_s.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=$8.DependencyTypeName.Http;var s=t.attributes[_s.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new vbi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=Cbi(t);var u=t.attributes[_s.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=qEr(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)===_s.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===_s.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===_s.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===_s.DbSystemValues.REDIS?e.dependencyTypeName="redis":p1a(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[_s.SemanticAttributes.DB_STATEMENT],y=t.attributes[_s.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=qEr(t),E=t.attributes[_s.SemanticAttributes.DB_NAME];d?e.target=E?"".concat(d,"|").concat(E):"".concat(d):e.target=E?"".concat(E):"".concat(n)}else if(o){e.dependencyTypeName=$8.DependencyTypeName.Grpc;var _=t.attributes[_s.SemanticAttributes.RPC_GRPC_STATUS_CODE];_&&(e.resultCode=String(_));var d=qEr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(h1a,"createDependencyData");function m1a(t){var e={name:t.name,success:t.status.code!=aD.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[_s.SemanticAttributes.HTTP_METHOD],n=t.attributes[_s.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==aD.SpanKind.SERVER){var o=t.attributes[_s.SemanticAttributes.HTTP_ROUTE],s=t.attributes[_s.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new vbi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=Cbi(t);var l=t.attributes[_s.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(m1a,"createRequestData");function g1a(t){var e;switch(t.kind){case aD.SpanKind.CLIENT:case aD.SpanKind.PRODUCER:case aD.SpanKind.INTERNAL:e=h1a(t);break;case aD.SpanKind.SERVER:case aD.SpanKind.CONSUMER:e=m1a(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=f1a(t),t.attributes[$8.AzNamespace]&&(t.kind===aD.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat($8.DependencyTypeName.InProc," | ").concat(t.attributes[$8.AzNamespace])),t.attributes[$8.AzNamespace]===$8.MicrosoftEventHub&&(0,u1a.parseEventHubSpan)(t,e)),e}a(g1a,"spanToTelemetryContract")});var Tbi=I(bG=>{"use strict";p();var J0e=bG&&bG.__assign||function(){return J0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var y1a=KT&&KT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),E1a=KT&&KT.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_1a=KT&&KT.__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)&&y1a(e,t,r);return E1a(e,t),e};Object.defineProperty(KT,"__esModule",{value:!0});KT.subscriber=void 0;KT.enable=T1a;var MOe=(co(),Ca(V5)),v1a=md(),jEr=Cp(),C1a=_1a(bbi()),b1a=Tbi(),Xee=[],S1a=a(function(t){try{var e=t.data,r=C1a.spanToTelemetryContract(e);b1a.AsyncScopeManager.with(e,function(){Xee.forEach(function(n){e.kind===MOe.SpanKind.SERVER||e.kind===MOe.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===MOe.SpanKind.CLIENT||e.kind===MOe.SpanKind.INTERNAL||e.kind===MOe.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");KT.subscriber=S1a;function T1a(t,e){if(t){var r=Xee.find(function(n){return n==e});if(r)return;Xee.length===0&&jEr.channel.subscribe("azure-coretracing",KT.subscriber,jEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(v1a.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),Xee.push(e)}else Xee=Xee.filter(function(n){return n!=e}),Xee.length===0&&jEr.channel.unsubscribe("azure-coretracing",KT.subscriber)}a(T1a,"enable")});var xbi=I(tte=>{"use strict";p();Object.defineProperty(tte,"__esModule",{value:!0});tte.subscriber=void 0;tte.enable=w1a;var I1a=md(),HEr=Cp(),ete=[],x1a=a(function(t){t.data.event.commandName!=="ismaster"&&ete.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");tte.subscriber=x1a;function w1a(t,e){if(t){var r=ete.find(function(n){return n==e});if(r)return;ete.length===0&&HEr.channel.subscribe("mongodb",tte.subscriber,HEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(I1a.StatsbeatInstrumentation.MONGODB)}),ete.push(e)}else ete=ete.filter(function(n){return n!=e}),ete.length===0&&HEr.channel.unsubscribe("mongodb",tte.subscriber)}a(w1a,"enable")});var wbi=I(nte=>{"use strict";p();Object.defineProperty(nte,"__esModule",{value:!0});nte.subscriber=void 0;nte.enable=P1a;var R1a=md(),GEr=Cp(),rte=[],k1a=a(function(t){rte.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");nte.subscriber=k1a;function P1a(t,e){if(t){var r=rte.find(function(n){return n==e});if(r)return;rte.length===0&&GEr.channel.subscribe("mysql",nte.subscriber,GEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(R1a.StatsbeatInstrumentation.MYSQL)}),rte.push(e)}else rte=rte.filter(function(n){return n!=e}),rte.length===0&&GEr.channel.unsubscribe("mysql",nte.subscriber)}a(P1a,"enable")});var Rbi=I(ote=>{"use strict";p();Object.defineProperty(ote,"__esModule",{value:!0});ote.subscriber=void 0;ote.enable=M1a;var D1a=md(),$Er=Cp(),ite=[],N1a=a(function(t){ite.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");ote.subscriber=N1a;function M1a(t,e){if(t){var r=ite.find(function(n){return n==e});if(r)return;ite.length===0&&$Er.channel.subscribe("redis",ote.subscriber,$Er.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(D1a.StatsbeatInstrumentation.REDIS)}),ite.push(e)}else ite=ite.filter(function(n){return n!=e}),ite.length===0&&$Er.channel.unsubscribe("redis",ote.subscriber)}a(M1a,"enable")});var kbi=I(ate=>{"use strict";p();Object.defineProperty(ate,"__esModule",{value:!0});ate.subscriber=void 0;ate.enable=B1a;var O1a=md(),VEr=Cp(),ste=[],L1a=a(function(t){ste.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");ate.subscriber=L1a;function B1a(t,e){if(t){var r=ste.find(function(n){return n==e});if(r)return;ste.length===0&&VEr.channel.subscribe("postgres",ate.subscriber,VEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(O1a.StatsbeatInstrumentation.POSTGRES)}),ste.push(e)}else ste=ste.filter(function(n){return n!=e}),ste.length===0&&VEr.channel.unsubscribe("postgres",ate.subscriber)}a(B1a,"enable")});var ege=I((W8,Pbi)=>{"use strict";p();var F1a=W8&&W8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),U1a=W8&&W8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Q1a=W8&&W8.__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)&&F1a(e,t,r);return U1a(e,t),e},Fmt=W8&&W8.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var Dbi=require("http"),Nbi=require("https"),Mbi=Kl(),Obi=ay(),G1a=T0e(),zEr=_yr(),z8=yG(),$1a=Pmt(),V1a=(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||$1a.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?z8.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&z8.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 z8.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 zEr(e),c=this._generateCorrelationContext(s);z8.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){z8.CorrelationContextManager.wrapEmitter(c),z8.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=Dbi.createServer;Dbi.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=Nbi.createServer;Nbi.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){Mbi.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=z8.CorrelationContextManager.getCurrentContext(),o=new zEr(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){Mbi.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=z8.CorrelationContextManager.getCurrentContext(),s=n||new zEr(r.request,o&&o.operation.parentId);Obi.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(G1a.requestContextHeader);Obi.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,z8.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();Lbi.exports=V1a});var Ubi=I((JEr,Fbi)=>{"use strict";p();var bR=JEr&&JEr.__assign||function(){return bR=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:Y1a,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 cte.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case cte.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case cte.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case cte.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case cte.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=bR(bR({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=bR(bR({},r),{Message:e.data.baseData.message,SeverityLevel:cte.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=bR(bR({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=bR(bR({},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=bR(bR({},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=Bbi.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=Bbi.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):z1a.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 cte.ContextTagKeys,t})();Fbi.exports=K1a});var qbi=I((fAp,Qbi)=>{"use strict";p();var J1a=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");Qbi.exports={getTransmissionTime:J1a}});var $bi=I((BOe,Gbi)=>{"use strict";p();var jbi=BOe&&BOe.__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())})},Hbi=BOe&&BOe.__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=SR.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[SR.time]=eSa.getTransmissionTime(),g["Content-Type"]="application/json",g["Content-Length"]=Buffer.byteLength(c),g),m),s&&s.length>0&&s.forEach(function(E){return l.headers[E.name]=E.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:",ZEr.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=XEr.tlsRestrictedAgent,h=Z1a.request(l,function(E){if(E.statusCode==200){var _=E.headers[SR.subscribed]==="true",v=null;try{v=E.headers[SR.endpointRedirect]?new tSa.URL(E.headers[SR.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+XEr.dumpObj(T))}var b=E.headers[SR.pollingIntervalHint]?parseInt(E.headers[SR.pollingIntervalHint].toString()):null;A._consecutiveErrors=0,n(_,E,v,b)}else A._onError("StatusCode:"+E.statusCode+" StatusMessage:"+E.statusMessage),n()}),h.on("error",function(E){A._onError(E),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:"),ZEr.warn(t.TAG,r,e)):ZEr.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();Gbi.exports=rSa});var Jbi=I((FOe,Kbi)=>{"use strict";p();var Vbi=FOe&&FOe.__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())})},Wbi=FOe&&FOe.__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 Vbi(this,void 0,void 0,function(){return Wbi(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&&(zbi.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,zbi.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})();Kbi.exports=oSa});var Xbi=I(tge=>{"use strict";p();var qmt=tge&&tge.__assign||function(){return qmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var e1i=TG&&TG.__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())})},t1i=TG&&TG.__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 dSa=Qee(),n1i=BEr(),fSa=Kl(),i1i=md(),pSa=require("url"),hSa=rpt(),mSa=(function(){function t(e){this._endpointBase=i1i.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=n1i.parse(e),o=n1i.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]||i1i.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new pSa.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=dSa.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)||fSa.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=hSa.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})();o1i.exports=mSa});var o_r=I(i_r=>{"use strict";p();Object.defineProperty(i_r,"__esModule",{value:!0});i_r.createEmptyPipeline=gSa;var s1i=new Set(["Deserialize","Serialize","Retry","Sign"]),n_r=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&&!s1i.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!s1i.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,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);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 E of y.dependants)E.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 gSa(){return n_r.create()}a(gSa,"createEmptyPipeline")});var lte=I(Hmt=>{"use strict";p();Object.defineProperty(Hmt,"__esModule",{value:!0});Hmt.logger=void 0;var ASa=aht();Hmt.logger=(0,ASa.createClientLogger)("core-rest-pipeline")});var a_r=I(s_r=>{"use strict";p();Object.defineProperty(s_r,"__esModule",{value:!0});s_r.getRandomIntegerInclusive=ySa;function ySa(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(ySa,"getRandomIntegerInclusive")});var a1i=I(c_r=>{"use strict";p();Object.defineProperty(c_r,"__esModule",{value:!0});c_r.calculateRetryDelay=_Sa;var ESa=a_r();function _Sa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,ESa.getRandomIntegerInclusive)(0,n/2)}}a(_Sa,"calculateRetryDelay")});var Gmt=I(l_r=>{"use strict";p();Object.defineProperty(l_r,"__esModule",{value:!0});l_r.isObject=vSa;function vSa(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(vSa,"isObject")});var c1i=I(u_r=>{"use strict";p();Object.defineProperty(u_r,"__esModule",{value:!0});u_r.isError=bSa;var CSa=Gmt();function bSa(t){if((0,CSa.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(bSa,"isError")});var u1i=I($mt=>{"use strict";p();Object.defineProperty($mt,"__esModule",{value:!0});$mt.computeSha256Hmac=SSa;$mt.computeSha256Hash=TSa;var l1i=require("node:crypto");async function SSa(t,e,r){let n=Buffer.from(t,"base64");return(0,l1i.createHmac)("sha256",n).update(e).digest(r)}a(SSa,"computeSha256Hmac");async function TSa(t,e){return(0,l1i.createHash)("sha256").update(t).digest(e)}a(TSa,"computeSha256Hash")});var d1i=I(f_r=>{"use strict";p();var d_r;Object.defineProperty(f_r,"__esModule",{value:!0});f_r.randomUUID=wSa;var ISa=require("node:crypto"),xSa=typeof((d_r=globalThis?.crypto)===null||d_r===void 0?void 0:d_r.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):ISa.randomUUID;function wSa(){return xSa()}a(wSa,"randomUUID")});var f1i=I(S0=>{"use strict";p();var p_r,h_r,m_r,g_r;Object.defineProperty(S0,"__esModule",{value:!0});S0.isReactNative=S0.isNodeRuntime=S0.isNodeLike=S0.isBun=S0.isDeno=S0.isWebWorker=S0.isBrowser=void 0;S0.isBrowser=typeof window<"u"&&typeof window.document<"u";S0.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((p_r=self.constructor)===null||p_r===void 0?void 0:p_r.name)==="DedicatedWorkerGlobalScope"||((h_r=self.constructor)===null||h_r===void 0?void 0:h_r.name)==="ServiceWorkerGlobalScope"||((m_r=self.constructor)===null||m_r===void 0?void 0:m_r.name)==="SharedWorkerGlobalScope");S0.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";S0.isBun=typeof Bun<"u"&&typeof Bun.version<"u";S0.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((g_r=globalThis.process.versions)===null||g_r===void 0)&&g_r.node);S0.isNodeRuntime=S0.isNodeLike&&!S0.isBun&&!S0.isDeno;S0.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var p1i=I(Vmt=>{"use strict";p();Object.defineProperty(Vmt,"__esModule",{value:!0});Vmt.uint8ArrayToString=RSa;Vmt.stringToUint8Array=kSa;function RSa(t,e){return Buffer.from(t).toString(e)}a(RSa,"uint8ArrayToString");function kSa(t,e){return Buffer.from(t,e)}a(kSa,"stringToUint8Array")});var h1i=I(Wmt=>{"use strict";p();Object.defineProperty(Wmt,"__esModule",{value:!0});Wmt.Sanitizer=void 0;var PSa=Gmt(),A_r="REDACTED",DSa=["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"],NSa=["api-version"],y_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=DSa.concat(e),r=NSa.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,PSa.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,A_r);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]=A_r;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]=A_r;return r}};Wmt.Sanitizer=y_r});var zmt=I(ga=>{"use strict";p();Object.defineProperty(ga,"__esModule",{value:!0});ga.Sanitizer=ga.uint8ArrayToString=ga.stringToUint8Array=ga.isWebWorker=ga.isReactNative=ga.isDeno=ga.isNodeRuntime=ga.isNodeLike=ga.isBun=ga.isBrowser=ga.randomUUID=ga.computeSha256Hmac=ga.computeSha256Hash=ga.isError=ga.isObject=ga.getRandomIntegerInclusive=ga.calculateRetryDelay=void 0;var MSa=a1i();Object.defineProperty(ga,"calculateRetryDelay",{enumerable:!0,get:a(function(){return MSa.calculateRetryDelay},"get")});var OSa=a_r();Object.defineProperty(ga,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return OSa.getRandomIntegerInclusive},"get")});var LSa=Gmt();Object.defineProperty(ga,"isObject",{enumerable:!0,get:a(function(){return LSa.isObject},"get")});var BSa=c1i();Object.defineProperty(ga,"isError",{enumerable:!0,get:a(function(){return BSa.isError},"get")});var m1i=u1i();Object.defineProperty(ga,"computeSha256Hash",{enumerable:!0,get:a(function(){return m1i.computeSha256Hash},"get")});Object.defineProperty(ga,"computeSha256Hmac",{enumerable:!0,get:a(function(){return m1i.computeSha256Hmac},"get")});var FSa=d1i();Object.defineProperty(ga,"randomUUID",{enumerable:!0,get:a(function(){return FSa.randomUUID},"get")});var ute=f1i();Object.defineProperty(ga,"isBrowser",{enumerable:!0,get:a(function(){return ute.isBrowser},"get")});Object.defineProperty(ga,"isBun",{enumerable:!0,get:a(function(){return ute.isBun},"get")});Object.defineProperty(ga,"isNodeLike",{enumerable:!0,get:a(function(){return ute.isNodeLike},"get")});Object.defineProperty(ga,"isNodeRuntime",{enumerable:!0,get:a(function(){return ute.isNodeRuntime},"get")});Object.defineProperty(ga,"isDeno",{enumerable:!0,get:a(function(){return ute.isDeno},"get")});Object.defineProperty(ga,"isReactNative",{enumerable:!0,get:a(function(){return ute.isReactNative},"get")});Object.defineProperty(ga,"isWebWorker",{enumerable:!0,get:a(function(){return ute.isWebWorker},"get")});var g1i=p1i();Object.defineProperty(ga,"stringToUint8Array",{enumerable:!0,get:a(function(){return g1i.stringToUint8Array},"get")});Object.defineProperty(ga,"uint8ArrayToString",{enumerable:!0,get:a(function(){return g1i.uint8ArrayToString},"get")});var USa=h1i();Object.defineProperty(ga,"Sanitizer",{enumerable:!0,get:a(function(){return USa.Sanitizer},"get")})});var A1i=I(E_r=>{"use strict";p();Object.defineProperty(E_r,"__esModule",{value:!0});E_r.cancelablePromiseRace=QSa;async function QSa(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(QSa,"cancelablePromiseRace")});var y1i=I(Ymt=>{"use strict";p();Object.defineProperty(Ymt,"__esModule",{value:!0});Ymt.AbortError=void 0;var __r=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};Ymt.AbortError=__r});var QOe=I(Kmt=>{"use strict";p();Object.defineProperty(Kmt,"__esModule",{value:!0});Kmt.AbortError=void 0;var qSa=y1i();Object.defineProperty(Kmt,"AbortError",{enumerable:!0,get:a(function(){return qSa.AbortError},"get")})});var C_r=I(v_r=>{"use strict";p();Object.defineProperty(v_r,"__esModule",{value:!0});v_r.createAbortablePromise=HSa;var jSa=QOe();function HSa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new jSa.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(HSa,"createAbortablePromise")});var E1i=I(Jmt=>{"use strict";p();Object.defineProperty(Jmt,"__esModule",{value:!0});Jmt.delay=WSa;Jmt.calculateRetryDelay=zSa;var GSa=C_r(),$Sa=zmt(),VSa="The delay was aborted.";function WSa(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,GSa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??VSa})}a(WSa,"delay");function zSa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,$Sa.getRandomIntegerInclusive)(0,n/2)}}a(zSa,"calculateRetryDelay")});var _1i=I(b_r=>{"use strict";p();Object.defineProperty(b_r,"__esModule",{value:!0});b_r.getErrorMessage=KSa;var YSa=zmt();function KSa(t){if((0,YSa.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(KSa,"getErrorMessage")});var C1i=I(qOe=>{"use strict";p();Object.defineProperty(qOe,"__esModule",{value:!0});qOe.isDefined=S_r;qOe.isObjectWithProperties=JSa;qOe.objectHasProperty=v1i;function S_r(t){return typeof t<"u"&&t!==null}a(S_r,"isDefined");function JSa(t,e){if(!S_r(t)||typeof t!="object")return!1;for(let r of e)if(!v1i(t,r))return!1;return!0}a(JSa,"isObjectWithProperties");function v1i(t,e){return S_r(t)&&typeof t=="object"&&e in t}a(v1i,"objectHasProperty")});var O4=I(ls=>{"use strict";p();Object.defineProperty(ls,"__esModule",{value:!0});ls.isWebWorker=ls.isReactNative=ls.isNodeRuntime=ls.isNodeLike=ls.isNode=ls.isDeno=ls.isBun=ls.isBrowser=ls.objectHasProperty=ls.isObjectWithProperties=ls.isDefined=ls.getErrorMessage=ls.delay=ls.createAbortablePromise=ls.cancelablePromiseRace=void 0;ls.calculateRetryDelay=nTa;ls.computeSha256Hash=iTa;ls.computeSha256Hmac=oTa;ls.getRandomIntegerInclusive=sTa;ls.isError=aTa;ls.isObject=cTa;ls.randomUUID=lTa;ls.uint8ArrayToString=uTa;ls.stringToUint8Array=dTa;var ZSa=(m3(),Ca(oQ)),dy=ZSa.__importStar(zmt()),XSa=A1i();Object.defineProperty(ls,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return XSa.cancelablePromiseRace},"get")});var eTa=C_r();Object.defineProperty(ls,"createAbortablePromise",{enumerable:!0,get:a(function(){return eTa.createAbortablePromise},"get")});var tTa=E1i();Object.defineProperty(ls,"delay",{enumerable:!0,get:a(function(){return tTa.delay},"get")});var rTa=_1i();Object.defineProperty(ls,"getErrorMessage",{enumerable:!0,get:a(function(){return rTa.getErrorMessage},"get")});var T_r=C1i();Object.defineProperty(ls,"isDefined",{enumerable:!0,get:a(function(){return T_r.isDefined},"get")});Object.defineProperty(ls,"isObjectWithProperties",{enumerable:!0,get:a(function(){return T_r.isObjectWithProperties},"get")});Object.defineProperty(ls,"objectHasProperty",{enumerable:!0,get:a(function(){return T_r.objectHasProperty},"get")});function nTa(t,e){return dy.calculateRetryDelay(t,e)}a(nTa,"calculateRetryDelay");function iTa(t,e){return dy.computeSha256Hash(t,e)}a(iTa,"computeSha256Hash");function oTa(t,e,r){return dy.computeSha256Hmac(t,e,r)}a(oTa,"computeSha256Hmac");function sTa(t,e){return dy.getRandomIntegerInclusive(t,e)}a(sTa,"getRandomIntegerInclusive");function aTa(t){return dy.isError(t)}a(aTa,"isError");function cTa(t){return dy.isObject(t)}a(cTa,"isObject");function lTa(){return dy.randomUUID()}a(lTa,"randomUUID");ls.isBrowser=dy.isBrowser;ls.isBun=dy.isBun;ls.isDeno=dy.isDeno;ls.isNode=dy.isNodeLike;ls.isNodeLike=dy.isNodeLike;ls.isNodeRuntime=dy.isNodeRuntime;ls.isReactNative=dy.isReactNative;ls.isWebWorker=dy.isWebWorker;function uTa(t,e){return dy.uint8ArrayToString(t,e)}a(uTa,"uint8ArrayToString");function dTa(t,e){return dy.stringToUint8Array(t,e)}a(dTa,"stringToUint8Array")});var Xmt=I(Zmt=>{"use strict";p();Object.defineProperty(Zmt,"__esModule",{value:!0});Zmt.Sanitizer=void 0;var fTa=O4(),I_r="REDACTED",pTa=["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"],hTa=["api-version"],x_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=pTa.concat(e),r=hTa.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,fTa.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,I_r);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]=I_r;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]=I_r;return r}};Zmt.Sanitizer=x_r});var w_r=I(rge=>{"use strict";p();Object.defineProperty(rge,"__esModule",{value:!0});rge.logPolicyName=void 0;rge.logPolicy=ATa;var mTa=lte(),gTa=Xmt();rge.logPolicyName="logPolicy";function ATa(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:mTa.logger.info,n=new gTa.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:rge.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(ATa,"logPolicy")});var R_r=I(nge=>{"use strict";p();Object.defineProperty(nge,"__esModule",{value:!0});nge.redirectPolicyName=void 0;nge.redirectPolicy=yTa;nge.redirectPolicyName="redirectPolicy";var b1i=["GET","HEAD"];function yTa(t={}){let{maxRetries:e=20}=t;return{name:nge.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return S1i(n,o,e)}}}a(yTa,"redirectPolicy");async function S1i(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&b1i.includes(o.method)||s===302&&b1i.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(e0t,"__esModule",{value:!0});e0t.getHeaderName=ETa;e0t.setPlatformSpecificData=_Ta;var T1i=(m3(),Ca(oQ)),k_r=T1i.__importStar(require("node:os")),P_r=T1i.__importStar(require("node:process"));function ETa(){return"User-Agent"}a(ETa,"getHeaderName");async function _Ta(t){if(P_r&&P_r.versions){let e=P_r.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",`(${k_r.arch()}-${k_r.type()}-${k_r.release()})`)}a(_Ta,"setPlatformSpecificData")});var IG=I(ige=>{"use strict";p();Object.defineProperty(ige,"__esModule",{value:!0});ige.DEFAULT_RETRY_POLICY_COUNT=ige.SDK_VERSION=void 0;ige.SDK_VERSION="1.16.3";ige.DEFAULT_RETRY_POLICY_COUNT=3});var D_r=I(t0t=>{"use strict";p();Object.defineProperty(t0t,"__esModule",{value:!0});t0t.getUserAgentHeaderName=bTa;t0t.getUserAgentValue=STa;var x1i=I1i(),vTa=IG();function CTa(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(CTa,"getUserAgentString");function bTa(){return(0,x1i.getHeaderName)()}a(bTa,"getUserAgentHeaderName");async function STa(t){let e=new Map;e.set("core-rest-pipeline",vTa.SDK_VERSION),await(0,x1i.setPlatformSpecificData)(e);let r=CTa(e);return t?`${t} ${r}`:r}a(STa,"getUserAgentValue")});var N_r=I(oge=>{"use strict";p();Object.defineProperty(oge,"__esModule",{value:!0});oge.userAgentPolicyName=void 0;oge.userAgentPolicy=TTa;var R1i=D_r(),w1i=(0,R1i.getUserAgentHeaderName)();oge.userAgentPolicyName="userAgentPolicy";function TTa(t={}){let e=(0,R1i.getUserAgentValue)(t.userAgentPrefix);return{name:oge.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(w1i)||r.headers.set(w1i,await e),n(r)}}}a(TTa,"userAgentPolicy")});var r0t=I(sge=>{"use strict";p();Object.defineProperty(sge,"__esModule",{value:!0});sge.isNodeReadableStream=k1i;sge.isWebReadableStream=P1i;sge.isReadableStream=ITa;sge.isBlob=xTa;function k1i(t){return!!(t&&typeof t.pipe=="function")}a(k1i,"isNodeReadableStream");function P1i(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(P1i,"isWebReadableStream");function ITa(t){return k1i(t)||P1i(t)}a(ITa,"isReadableStream");function xTa(t){return typeof t.stream=="function"}a(xTa,"isBlob")});var M_r=I(jOe=>{"use strict";p();Object.defineProperty(jOe,"__esModule",{value:!0});jOe.getRawContent=PTa;jOe.createFileFromStream=DTa;jOe.createFile=NTa;var wTa=O4(),RTa=r0t(),D1i={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},n0t=Symbol("rawContent");function kTa(t){return typeof t[n0t]=="function"}a(kTa,"hasRawContent");function PTa(t){return kTa(t)?t[n0t]():t.stream()}a(PTa,"getRawContent");function DTa(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},D1i),{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,RTa.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[n0t]:t})}a(DTa,"createFileFromStream");function NTa(t,e,r={}){var n,o,s;return wTa.isNodeLike?Object.assign(Object.assign({},D1i),{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"),[n0t]:()=>t}):new File([t],e,r)}a(NTa,"createFile")});var O1i=I(L_r=>{"use strict";p();Object.defineProperty(L_r,"__esModule",{value:!0});L_r.concat=FTa;var Y8=(m3(),Ca(oQ)),O_r=require("node:stream"),MTa=r0t(),OTa=M_r();function N1i(){return Y8.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield Y8.__await(e.read());if(r)return yield Y8.__await(void 0);yield yield Y8.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(N1i,"streamAsyncIterator");function LTa(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=N1i.bind(t)),t.values||(t.values=N1i.bind(t))}a(LTa,"makeAsyncIterable");function BTa(t){return t instanceof ReadableStream?(LTa(t),O_r.Readable.fromWeb(t)):t}a(BTa,"ensureNodeStream");function M1i(t){return t instanceof Uint8Array?O_r.Readable.from(Buffer.from(t)):(0,MTa.isBlob)(t)?M1i((0,OTa.getRawContent)(t)):BTa(t)}a(M1i,"toStream");async function FTa(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(M1i);return O_r.Readable.from((function(){return Y8.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,Y8.__asyncValues(d)),u;u=yield Y8.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield Y8.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield Y8.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(FTa,"concat")});var B_r=I(age=>{"use strict";p();Object.defineProperty(age,"__esModule",{value:!0});age.multipartPolicyName=void 0;age.multipartPolicy=YTa;var dte=O4(),UTa=O1i(),QTa=r0t();function qTa(){return`----AzSDKFormBoundary${(0,dte.randomUUID)()}`}a(qTa,"generateBoundary");function jTa(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(jTa,"encodeHeaders");function HTa(t){return t instanceof Uint8Array?t.byteLength:(0,QTa.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(HTa,"getLength");function GTa(t){let e=0;for(let r of t){let n=HTa(r);if(n===void 0)return;e+=n}return e}a(GTa,"getTotalLength");async function $Ta(t,e,r){let n=[(0,dte.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,dte.stringToUint8Array)(`\r +`,"utf-8"),(0,dte.stringToUint8Array)(jTa(s.headers),"utf-8"),(0,dte.stringToUint8Array)(`\r `,"utf-8"),s.body,(0,dte.stringToUint8Array)(`\r --${r}`,"utf-8")]),(0,dte.stringToUint8Array)(`--\r \r -`,"utf-8")],o=FTa(n);o&&t.headers.set("Content-Length",o),t.body=await(0,NTa.concat)(n)}a(UTa,"buildRequestBody");sge.multipartPolicyName="multipartPolicy";var QTa=70,qTa=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function jTa(t){if(t.length>QTa)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!qTa.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(jTa,"assertValidBoundary");function HTa(){return{name:sge.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?jTa(n):n=OTa(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await UTa(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(HTa,"multipartPolicy")});var B_r=I(age=>{"use strict";p();Object.defineProperty(age,"__esModule",{value:!0});age.decompressResponsePolicyName=void 0;age.decompressResponsePolicy=GTa;age.decompressResponsePolicyName="decompressResponsePolicy";function GTa(){return{name:age.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(GTa,"decompressResponsePolicy")});var i0t=I(n0t=>{"use strict";p();Object.defineProperty(n0t,"__esModule",{value:!0});n0t.delay=WTa;n0t.parseHeaderValueAsNumber=zTa;var $Ta=FOe(),VTa="The operation was aborted.";function WTa(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new $Ta.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:VTa)),"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(WTa,"delay");function zTa(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(zTa,"parseHeaderValueAsNumber")});var s0t=I(o0t=>{"use strict";p();Object.defineProperty(o0t,"__esModule",{value:!0});o0t.isThrottlingRetryResponse=JTa;o0t.throttlingRetryStrategy=ZTa;var YTa=i0t(),F_r="Retry-After",KTa=["retry-after-ms","x-ms-retry-after-ms",F_r];function D1i(t){if(t&&[429,503].includes(t.status))try{for(let o of KTa){let s=(0,YTa.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===F_r?1e3:1)}let e=t.headers.get(F_r);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(D1i,"getRetryAfterInMs");function JTa(t){return Number.isFinite(D1i(t))}a(JTa,"isThrottlingRetryResponse");function ZTa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=D1i(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(ZTa,"throttlingRetryStrategy")});var a0t=I(qOe=>{"use strict";p();Object.defineProperty(qOe,"__esModule",{value:!0});qOe.exponentialRetryStrategy=nIa;qOe.isExponentialRetryResponse=N1i;qOe.isSystemError=M1i;var XTa=O4(),eIa=s0t(),tIa=1e3,rIa=1e3*64;function nIa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:tIa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:rIa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=M1i(u),f=d&&t.ignoreSystemErrors,h=N1i(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,eIa.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,XTa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(nIa,"exponentialRetryStrategy");function N1i(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(N1i,"isExponentialRetryResponse");function M1i(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(M1i,"isSystemError")});var cge=I(U_r=>{"use strict";p();Object.defineProperty(U_r,"__esModule",{value:!0});U_r.retryPolicy=cIa;var iIa=i0t(),oIa=sht(),sIa=FOe(),O1i=TG(),L1i=(0,oIa.createClientLogger)("core-rest-pipeline retryPolicy"),aIa="retryPolicy";function cIa(t,e={maxRetries:O1i.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||L1i;return{name:aIa,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 sIa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:O1i.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||L1i;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,iIa.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(cIa,"retryPolicy")});var Q_r=I(lge=>{"use strict";p();Object.defineProperty(lge,"__esModule",{value:!0});lge.defaultRetryPolicyName=void 0;lge.defaultRetryPolicy=pIa;var lIa=a0t(),uIa=s0t(),dIa=cge(),fIa=TG();lge.defaultRetryPolicyName="defaultRetryPolicy";function pIa(t={}){var e;return{name:lge.defaultRetryPolicyName,sendRequest:(0,dIa.retryPolicy)([(0,uIa.throttlingRetryStrategy)(),(0,lIa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:fIa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(pIa,"defaultRetryPolicy")});var jOe=I(j_r=>{"use strict";p();Object.defineProperty(j_r,"__esModule",{value:!0});j_r.createHttpHeaders=mIa;function c0t(t){return t.toLowerCase()}a(c0t,"normalizeName");function*hIa(t){for(let e of t.values())yield[e.name,e.value]}a(hIa,"headerIterator");var q_r=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(c0t(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(c0t(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(c0t(e))}delete(e){this._headersMap.delete(c0t(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 hIa(this._headersMap)}};function mIa(t){return new q_r(t)}a(mIa,"createHttpHeaders")});var H_r=I(uge=>{"use strict";p();Object.defineProperty(uge,"__esModule",{value:!0});uge.formDataPolicyName=void 0;uge.formDataPolicy=AIa;var F1i=O4(),B1i=jOe();uge.formDataPolicyName="formDataPolicy";function gIa(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(gIa,"formDataToFormDataMap");function AIa(){return{name:uge.formDataPolicyName,async sendRequest(t,e){if(F1i.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=gIa(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=yIa(t.formData):await EIa(t.formData,t),t.formData=void 0}return e(t)}}}a(AIa,"formDataPolicy");function yIa(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(yIa,"wwwFormUrlEncode");async function EIa(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,B1i.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,F1i.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,B1i.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(EIa,"prepareFormData")});var G_r=I(SR=>{"use strict";p();Object.defineProperty(SR,"__esModule",{value:!0});SR.globalNoProxyList=SR.proxyPolicyName=void 0;SR.loadNoProxy=H1i;SR.getDefaultProxySettings=RIa;SR.proxyPolicy=PIa;var _Ia=W3t(),vIa=z3t(),CIa=lte(),bIa="HTTPS_PROXY",SIa="HTTP_PROXY",TIa="ALL_PROXY",IIa="NO_PROXY";SR.proxyPolicyName="proxyPolicy";SR.globalNoProxyList=[];var q1i=!1,xIa=new Map;function l0t(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(l0t,"getEnvironmentValue");function j1i(){if(!process)return;let t=l0t(bIa),e=l0t(TIa),r=l0t(SIa);return t||e||r}a(j1i,"loadEnvironmentProxyValue");function wIa(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(wIa,"isBypassed");function H1i(){let t=l0t(IIa);return q1i=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(H1i,"loadNoProxy");function RIa(t){if(!t&&(t=j1i(),!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(RIa,"getDefaultProxySettings");function kIa(){let t=j1i();return t?new URL(t):void 0}a(kIa,"getDefaultProxySettingsInternal");function U1i(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(U1i,"getUrlFromProxySettings");function Q1i(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&CIa.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 vIa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new _Ia.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(Q1i,"setProxyAgentOnRequest");function PIa(t,e){q1i||SR.globalNoProxyList.push(...H1i());let r=t?U1i(t):kIa(),n={};return{name:SR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!wIa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:SR.globalNoProxyList,e?.customNoProxyList?void 0:xIa)?Q1i(o,n,r):o.proxySettings&&Q1i(o,n,U1i(o.proxySettings)),s(o)}}}a(PIa,"proxyPolicy")});var $_r=I(dge=>{"use strict";p();Object.defineProperty(dge,"__esModule",{value:!0});dge.setClientRequestIdPolicyName=void 0;dge.setClientRequestIdPolicy=DIa;dge.setClientRequestIdPolicyName="setClientRequestIdPolicy";function DIa(t="x-ms-client-request-id"){return{name:dge.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(DIa,"setClientRequestIdPolicy")});var V_r=I(fge=>{"use strict";p();Object.defineProperty(fge,"__esModule",{value:!0});fge.tlsPolicyName=void 0;fge.tlsPolicy=NIa;fge.tlsPolicyName="tlsPolicy";function NIa(t){return{name:fge.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(NIa,"tlsPolicy")});var W_r=I(Y8=>{"use strict";p();Object.defineProperty(Y8,"__esModule",{value:!0});Y8.TracingContextImpl=Y8.knownContextKeys=void 0;Y8.createTracingContext=MIa;Y8.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function MIa(t={}){let e=new u0t(t.parentContext);return t.span&&(e=e.setValue(Y8.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(Y8.knownContextKeys.namespace,t.namespace)),e}a(MIa,"createTracingContext");var u0t=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}};Y8.TracingContextImpl=u0t});var z_r=I(pge=>{"use strict";p();Object.defineProperty(pge,"__esModule",{value:!0});pge.createDefaultTracingSpan=G1i;pge.createDefaultInstrumenter=$1i;pge.useInstrumenter=LIa;pge.getInstrumenter=BIa;var OIa=W_r(),d0t=q5t();function G1i(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(G1i,"createDefaultTracingSpan");function $1i(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:G1i(),tracingContext:(0,OIa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a($1i,"createDefaultInstrumenter");function LIa(t){d0t.state.instrumenterImplementation=t}a(LIa,"useInstrumenter");function BIa(){return d0t.state.instrumenterImplementation||(d0t.state.instrumenterImplementation=$1i()),d0t.state.instrumenterImplementation}a(BIa,"getInstrumenter")});var V1i=I(K_r=>{"use strict";p();Object.defineProperty(K_r,"__esModule",{value:!0});K_r.createTracingClient=FIa;var f0t=z_r(),Y_r=W_r();function FIa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,f0t.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(Y_r.knownContextKeys.namespace)||(A=A.setValue(Y_r.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(Y_r.knownContextKeys.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}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,f0t.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,f0t.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,f0t.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(FIa,"createTracingClient")});var W1i=I(hge=>{"use strict";p();Object.defineProperty(hge,"__esModule",{value:!0});hge.createTracingClient=hge.useInstrumenter=void 0;var UIa=z_r();Object.defineProperty(hge,"useInstrumenter",{enumerable:!0,get:a(function(){return UIa.useInstrumenter},"get")});var QIa=V1i();Object.defineProperty(hge,"createTracingClient",{enumerable:!0,get:a(function(){return QIa.createTracingClient},"get")})});var z1i=I(p0t=>{"use strict";p();Object.defineProperty(p0t,"__esModule",{value:!0});p0t.custom=void 0;var qIa=require("node:util");p0t.custom=qIa.inspect.custom});var h0t=I(HOe=>{"use strict";p();Object.defineProperty(HOe,"__esModule",{value:!0});HOe.RestError=void 0;HOe.isRestError=VIa;var jIa=O4(),HIa=z1i(),GIa=Zmt(),$Ia=new GIa.Sanitizer,mge=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)}[HIa.custom](){return`RestError: ${this.message} - ${$Ia.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};HOe.RestError=mge;mge.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";mge.PARSE_ERROR="PARSE_ERROR";function VIa(t){return t instanceof mge?!0:(0,jIa.isError)(t)&&t.name==="RestError"}a(VIa,"isRestError")});var J_r=I(gge=>{"use strict";p();Object.defineProperty(gge,"__esModule",{value:!0});gge.tracingPolicyName=void 0;gge.tracingPolicy=ZIa;var WIa=W1i(),zIa=TG(),YIa=P_r(),m0t=lte(),GOe=O4(),KIa=h0t(),JIa=Zmt();gge.tracingPolicyName="tracingPolicy";function ZIa(t={}){let e=(0,YIa.getUserAgentValue)(t.userAgentPrefix),r=new JIa.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=XIa();return{name:gge.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=exa(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return rxa(f,m),m}catch(m){throw txa(f,m),m}}}}a(ZIa,"tracingPolicy");function XIa(){try{return(0,WIa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:zIa.SDK_VERSION})}catch(t){m0t.logger.warning(`Error when creating the TracingClient: ${(0,GOe.getErrorMessage)(t)}`);return}}a(XIa,"tryCreateTracingClient");function exa(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){m0t.logger.warning(`Skipping creating a tracing span due to an error: ${(0,GOe.getErrorMessage)(n)}`);return}}a(exa,"tryCreateSpan");function txa(t,e){try{t.setStatus({status:"error",error:(0,GOe.isError)(e)?e:void 0}),(0,KIa.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){m0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,GOe.getErrorMessage)(r)}`)}}a(txa,"tryProcessError");function rxa(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){m0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,GOe.getErrorMessage)(r)}`)}}a(rxa,"tryProcessResponse")});var J1i=I(Z_r=>{"use strict";p();Object.defineProperty(Z_r,"__esModule",{value:!0});Z_r.createPipelineFromOptions=hxa;var nxa=x_r(),ixa=i_r(),oxa=w_r(),sxa=D_r(),Y1i=L_r(),axa=B_r(),cxa=Q_r(),lxa=H_r(),K1i=O4(),uxa=G_r(),dxa=$_r(),fxa=V_r(),pxa=J_r();function hxa(t){var e;let r=(0,ixa.createEmptyPipeline)();return K1i.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,fxa.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,uxa.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,axa.decompressResponsePolicy)())),r.addPolicy((0,lxa.formDataPolicy)(),{beforePolicies:[Y1i.multipartPolicyName]}),r.addPolicy((0,sxa.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,dxa.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,Y1i.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,cxa.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,pxa.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),K1i.isNodeLike&&r.addPolicy((0,oxa.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,nxa.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(hxa,"createPipelineFromOptions")});var nSi=I(A0t=>{"use strict";p();Object.defineProperty(A0t,"__esModule",{value:!0});A0t.getBodyLength=rSi;A0t.createNodeHttpClient=vxa;var rvr=(m3(),ba(iQ)),X_r=rvr.__importStar(require("node:http")),evr=rvr.__importStar(require("node:https")),Z1i=rvr.__importStar(require("node:zlib")),mxa=require("node:stream"),X1i=FOe(),gxa=jOe(),WOe=h0t(),$Oe=lte(),Axa={};function VOe(t){return t&&typeof t.pipe=="function"}a(VOe,"isReadableStream");function eSi(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(eSi,"isStreamComplete");function tSi(t){return t&&typeof t.byteLength=="number"}a(tSi,"isArrayBuffer");var g0t=class extends mxa.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}},tvr=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 X1i.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=rSi(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let E=e.onUploadProgress,_=new g0t(E);_.on("error",v=>{$Oe.logger.error("Error in upload progress",v)}),VOe(d)?d.pipe(_):_.end(d),d=_}let h=await this.makeRequest(e,s,d),m=yxa(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?Exa(h,m):h;let y=e.onDownloadProgress;if(y){let E=new g0t(y);E.on("error",_=>{$Oe.logger.error("Error in download progress",_)}),f.pipe(E),f=E}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 _xa(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();VOe(d)&&(h=eSi(d));let m=Promise.resolve();VOe(f)&&(m=eSi(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{$Oe.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?X_r.request(u,d):evr.request(u,d);h.once("error",m=>{var g;f(new WOe.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:WOe.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new X1i.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&VOe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):tSi(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):($Oe.logger.error("Unrecognized body type",n),f(new WOe.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?X_r.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new X_r.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return evr.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:Axa,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||($Oe.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new evr.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function yxa(t){let e=(0,gxa.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(yxa,"getResponseHeaders");function Exa(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=Z1i.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=Z1i.createInflate();return t.pipe(n),n}return t}a(Exa,"getDecodedResponseStream");function _xa(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 WOe.RestError(`Error reading response as text: ${o.message}`,{code:WOe.RestError.PARSE_ERROR}))})})}a(_xa,"streamToText");function rSi(t){return t?Buffer.isBuffer(t)?t.length:VOe(t)?null:tSi(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(rSi,"getBodyLength");function vxa(){return new tvr}a(vxa,"createNodeHttpClient")});var iSi=I(nvr=>{"use strict";p();Object.defineProperty(nvr,"__esModule",{value:!0});nvr.createDefaultHttpClient=bxa;var Cxa=nSi();function bxa(){return(0,Cxa.createNodeHttpClient)()}a(bxa,"createDefaultHttpClient")});var oSi=I(ovr=>{"use strict";p();Object.defineProperty(ovr,"__esModule",{value:!0});ovr.createPipelineRequest=Ixa;var Sxa=jOe(),Txa=O4(),ivr=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,Sxa.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,Txa.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function Ixa(t){return new ivr(t)}a(Ixa,"createPipelineRequest")});var sSi=I(zOe=>{"use strict";p();Object.defineProperty(zOe,"__esModule",{value:!0});zOe.exponentialRetryPolicyName=void 0;zOe.exponentialRetryPolicy=kxa;var xxa=a0t(),wxa=cge(),Rxa=TG();zOe.exponentialRetryPolicyName="exponentialRetryPolicy";function kxa(t={}){var e;return(0,wxa.retryPolicy)([(0,xxa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Rxa.DEFAULT_RETRY_POLICY_COUNT})}a(kxa,"exponentialRetryPolicy")});var aSi=I(Age=>{"use strict";p();Object.defineProperty(Age,"__esModule",{value:!0});Age.systemErrorRetryPolicyName=void 0;Age.systemErrorRetryPolicy=Mxa;var Pxa=a0t(),Dxa=cge(),Nxa=TG();Age.systemErrorRetryPolicyName="systemErrorRetryPolicy";function Mxa(t={}){var e;return{name:Age.systemErrorRetryPolicyName,sendRequest:(0,Dxa.retryPolicy)([(0,Pxa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Nxa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Mxa,"systemErrorRetryPolicy")});var cSi=I(yge=>{"use strict";p();Object.defineProperty(yge,"__esModule",{value:!0});yge.throttlingRetryPolicyName=void 0;yge.throttlingRetryPolicy=Fxa;var Oxa=s0t(),Lxa=cge(),Bxa=TG();yge.throttlingRetryPolicyName="throttlingRetryPolicy";function Fxa(t={}){var e;return{name:yge.throttlingRetryPolicyName,sendRequest:(0,Lxa.retryPolicy)([(0,Oxa.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Bxa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Fxa,"throttlingRetryPolicy")});var svr=I(Ege=>{"use strict";p();Object.defineProperty(Ege,"__esModule",{value:!0});Ege.DEFAULT_CYCLER_OPTIONS=void 0;Ege.createTokenCycler=qxa;var Uxa=i0t();Ege.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Qxa(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(qxa,"createTokenCycler")});var lSi=I(_ge=>{"use strict";p();Object.defineProperty(_ge,"__esModule",{value:!0});_ge.bearerTokenAuthenticationPolicyName=void 0;_ge.bearerTokenAuthenticationPolicy=Vxa;var jxa=svr(),Hxa=lte();_ge.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function Gxa(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(Gxa,"defaultAuthorizeRequest");function $xa(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a($xa,"getChallenge");function Vxa(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||Hxa.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:Gxa,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,jxa.createTokenCycler)(r):()=>Promise.resolve(null);return{name:_ge.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&&$xa(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(Vxa,"bearerTokenAuthenticationPolicy")});var uSi=I(vge=>{"use strict";p();Object.defineProperty(vge,"__esModule",{value:!0});vge.ndJsonPolicyName=void 0;vge.ndJsonPolicy=Wxa;vge.ndJsonPolicyName="ndJsonPolicy";function Wxa(){return{name:vge.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(Wxa,"ndJsonPolicy")});var fSi=I(fte=>{"use strict";p();Object.defineProperty(fte,"__esModule",{value:!0});fte.auxiliaryAuthenticationHeaderPolicyName=void 0;fte.auxiliaryAuthenticationHeaderPolicy=Jxa;var zxa=svr(),Yxa=lte();fte.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var dSi="x-ms-authorization-auxiliary";async function Kxa(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(Kxa,"sendAuthorizeRequest");function Jxa(t){let{credentials:e,scopes:r}=t,n=t.logger||Yxa.logger,o=new WeakMap;return{name:fte.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(`${fte.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,zxa.createTokenCycler)(d),o.set(d,f)),l.push(Kxa({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. ${dSi} header will not be set.`),c(s)):(s.headers.set(dSi,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(Jxa,"auxiliaryAuthenticationHeaderPolicy")});var kSi=I(vr=>{"use strict";p();Object.defineProperty(vr,"__esModule",{value:!0});vr.createFileFromStream=vr.createFile=vr.auxiliaryAuthenticationHeaderPolicyName=vr.auxiliaryAuthenticationHeaderPolicy=vr.ndJsonPolicyName=vr.ndJsonPolicy=vr.bearerTokenAuthenticationPolicyName=vr.bearerTokenAuthenticationPolicy=vr.formDataPolicyName=vr.formDataPolicy=vr.tlsPolicyName=vr.tlsPolicy=vr.userAgentPolicyName=vr.userAgentPolicy=vr.defaultRetryPolicy=vr.tracingPolicyName=vr.tracingPolicy=vr.retryPolicy=vr.throttlingRetryPolicyName=vr.throttlingRetryPolicy=vr.systemErrorRetryPolicyName=vr.systemErrorRetryPolicy=vr.redirectPolicyName=vr.redirectPolicy=vr.getDefaultProxySettings=vr.proxyPolicyName=vr.proxyPolicy=vr.multipartPolicyName=vr.multipartPolicy=vr.logPolicyName=vr.logPolicy=vr.setClientRequestIdPolicyName=vr.setClientRequestIdPolicy=vr.exponentialRetryPolicyName=vr.exponentialRetryPolicy=vr.decompressResponsePolicyName=vr.decompressResponsePolicy=vr.isRestError=vr.RestError=vr.createPipelineRequest=vr.createHttpHeaders=vr.createDefaultHttpClient=vr.createPipelineFromOptions=vr.createEmptyPipeline=void 0;var Zxa=i_r();Object.defineProperty(vr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return Zxa.createEmptyPipeline},"get")});var Xxa=J1i();Object.defineProperty(vr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return Xxa.createPipelineFromOptions},"get")});var ewa=iSi();Object.defineProperty(vr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return ewa.createDefaultHttpClient},"get")});var twa=jOe();Object.defineProperty(vr,"createHttpHeaders",{enumerable:!0,get:a(function(){return twa.createHttpHeaders},"get")});var rwa=oSi();Object.defineProperty(vr,"createPipelineRequest",{enumerable:!0,get:a(function(){return rwa.createPipelineRequest},"get")});var pSi=h0t();Object.defineProperty(vr,"RestError",{enumerable:!0,get:a(function(){return pSi.RestError},"get")});Object.defineProperty(vr,"isRestError",{enumerable:!0,get:a(function(){return pSi.isRestError},"get")});var hSi=B_r();Object.defineProperty(vr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return hSi.decompressResponsePolicy},"get")});Object.defineProperty(vr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return hSi.decompressResponsePolicyName},"get")});var mSi=sSi();Object.defineProperty(vr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return mSi.exponentialRetryPolicy},"get")});Object.defineProperty(vr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return mSi.exponentialRetryPolicyName},"get")});var gSi=$_r();Object.defineProperty(vr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return gSi.setClientRequestIdPolicy},"get")});Object.defineProperty(vr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return gSi.setClientRequestIdPolicyName},"get")});var ASi=x_r();Object.defineProperty(vr,"logPolicy",{enumerable:!0,get:a(function(){return ASi.logPolicy},"get")});Object.defineProperty(vr,"logPolicyName",{enumerable:!0,get:a(function(){return ASi.logPolicyName},"get")});var ySi=L_r();Object.defineProperty(vr,"multipartPolicy",{enumerable:!0,get:a(function(){return ySi.multipartPolicy},"get")});Object.defineProperty(vr,"multipartPolicyName",{enumerable:!0,get:a(function(){return ySi.multipartPolicyName},"get")});var avr=G_r();Object.defineProperty(vr,"proxyPolicy",{enumerable:!0,get:a(function(){return avr.proxyPolicy},"get")});Object.defineProperty(vr,"proxyPolicyName",{enumerable:!0,get:a(function(){return avr.proxyPolicyName},"get")});Object.defineProperty(vr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return avr.getDefaultProxySettings},"get")});var ESi=w_r();Object.defineProperty(vr,"redirectPolicy",{enumerable:!0,get:a(function(){return ESi.redirectPolicy},"get")});Object.defineProperty(vr,"redirectPolicyName",{enumerable:!0,get:a(function(){return ESi.redirectPolicyName},"get")});var _Si=aSi();Object.defineProperty(vr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return _Si.systemErrorRetryPolicy},"get")});Object.defineProperty(vr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return _Si.systemErrorRetryPolicyName},"get")});var vSi=cSi();Object.defineProperty(vr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return vSi.throttlingRetryPolicy},"get")});Object.defineProperty(vr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return vSi.throttlingRetryPolicyName},"get")});var nwa=cge();Object.defineProperty(vr,"retryPolicy",{enumerable:!0,get:a(function(){return nwa.retryPolicy},"get")});var CSi=J_r();Object.defineProperty(vr,"tracingPolicy",{enumerable:!0,get:a(function(){return CSi.tracingPolicy},"get")});Object.defineProperty(vr,"tracingPolicyName",{enumerable:!0,get:a(function(){return CSi.tracingPolicyName},"get")});var iwa=Q_r();Object.defineProperty(vr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return iwa.defaultRetryPolicy},"get")});var bSi=D_r();Object.defineProperty(vr,"userAgentPolicy",{enumerable:!0,get:a(function(){return bSi.userAgentPolicy},"get")});Object.defineProperty(vr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return bSi.userAgentPolicyName},"get")});var SSi=V_r();Object.defineProperty(vr,"tlsPolicy",{enumerable:!0,get:a(function(){return SSi.tlsPolicy},"get")});Object.defineProperty(vr,"tlsPolicyName",{enumerable:!0,get:a(function(){return SSi.tlsPolicyName},"get")});var TSi=H_r();Object.defineProperty(vr,"formDataPolicy",{enumerable:!0,get:a(function(){return TSi.formDataPolicy},"get")});Object.defineProperty(vr,"formDataPolicyName",{enumerable:!0,get:a(function(){return TSi.formDataPolicyName},"get")});var ISi=lSi();Object.defineProperty(vr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return ISi.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(vr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return ISi.bearerTokenAuthenticationPolicyName},"get")});var xSi=uSi();Object.defineProperty(vr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return xSi.ndJsonPolicy},"get")});Object.defineProperty(vr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return xSi.ndJsonPolicyName},"get")});var wSi=fSi();Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return wSi.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return wSi.auxiliaryAuthenticationHeaderPolicyName},"get")});var RSi=N_r();Object.defineProperty(vr,"createFile",{enumerable:!0,get:a(function(){return RSi.createFile},"get")});Object.defineProperty(vr,"createFileFromStream",{enumerable:!0,get:a(function(){return RSi.createFileFromStream},"get")})});var DSi=I((KOe,PSi)=>{"use strict";p();var owa=KOe&&KOe.__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())})},swa=KOe&&KOe.__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 dwa=Kl(),fwa=ay(),pwa=(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){dwa.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||fwa.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})();NSi.exports=pwa});var OSi=I(cvr=>{"use strict";p();Object.defineProperty(cvr,"__esModule",{value:!0});cvr.azureRoleEnvironmentTelemetryProcessor=hwa;function hwa(t,e){}a(hwa,"azureRoleEnvironmentTelemetryProcessor")});var FSi=I(y0t=>{"use strict";p();Object.defineProperty(y0t,"__esModule",{value:!0});y0t.samplingTelemetryProcessor=mwa;y0t.getSamplingHashCode=BSi;var LSi=ME();function mwa(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&LSi.TelemetryType.Metric===LSi.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=BSi(e.correlationContext.operation.id){"use strict";p();var gwa=K8&&K8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Awa=K8&&K8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ywa=K8&&K8.__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)&&gwa(e,t,r);return Awa(e,t),e};Object.defineProperty(K8,"__esModule",{value:!0});K8.performanceMetricsTelemetryProcessor=Ewa;var lvr=kmt(),uvr=ywa(ME());function Ewa(t,e){switch(e&&e.addDocument(t),t.data.baseType){case uvr.TelemetryTypeString.Exception:lvr.countException();break;case uvr.TelemetryTypeString.Request:var r=t.data.baseData;lvr.countRequest(r.duration,r.success);break;case uvr.TelemetryTypeString.Dependency:var n=t.data.baseData;lvr.countDependency(n.duration,n.success);break}return!0}a(Ewa,"performanceMetricsTelemetryProcessor")});var QSi=I(aD=>{"use strict";p();var L4=aD&&aD.__assign||function(){return L4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var Twa=B4&&B4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_0t=B4&&B4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Twa(e,t,r)};Object.defineProperty(B4,"__esModule",{value:!0});_0t(OSi(),B4);_0t(FSi(),B4);_0t(USi(),B4);_0t(QSi(),B4)});var dvr=I((rvp,GSi)=>{"use strict";p();var Zi=ME(),Gb=ay(),jSi=AG(),Iwa=Kl(),xwa=(function(){function t(){}return a(t,"EnvelopeFactory"),t.createEnvelope=function(e,r,n,o,s){var c=null;switch(r){case Zi.TelemetryType.Trace:c=t.createTraceData(e);break;case Zi.TelemetryType.Dependency:c=t.createDependencyData(e);break;case Zi.TelemetryType.Event:c=t.createEventData(e);break;case Zi.TelemetryType.Exception:c=t.createExceptionData(e);break;case Zi.TelemetryType.Request:c=t.createRequestData(e);break;case Zi.TelemetryType.Metric:c=t.createMetricData(e);break;case Zi.TelemetryType.Availability:c=t.createAvailabilityData(e);break;case Zi.TelemetryType.PageView:c=t.createPageViewData(e);break}if(c&&c.baseData&&Zi.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=Gb.validateStringMap(c.baseData.properties))}var u=s&&s.instrumentationKey||"",d=new Zi.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===Zi.TelemetryType.Metric&&(d.sampleRate=100),d},t.addAzureFunctionsCorrelationProperties=function(e){var r=jSi.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 Zi.Data;return l.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Exception),l.baseData=o,l},t.createRequestData=function(e){var r,n,o,s,c=new Zi.RequestData;e.id?c.id=e.id:c.id=Gb.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=Gb.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 Zi.Data;return l.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Request),l.baseData=c,l},t.createMetricData=function(e){var r,n=new Zi.MetricData;n.metrics=[];var o=new Zi.DataPoint;o.count=isNaN(e.count)?1:e.count,o.kind=Zi.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 Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Metric),s.baseData=n,s},t.createAvailabilityData=function(e){var r,n,o=new Zi.AvailabilityData;e.id?o.id=e.id:o.id=Gb.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Gb.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 Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Availability),s.baseData=o,s},t.createPageViewData=function(e){var r,n,o=new Zi.PageViewData;o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Gb.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 Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.PageView),s.baseData=o,s},t.getTags=function(e,r){var n=jSi.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(HSi.regex.test(l)){var u=new HSi(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 _=A-g+1;r.splice(g,_);break}g=f,A=h,f++,h--}}return r},t})(),HSi=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=Gb.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=Gb.trim(n[2])||this.method,this.fileName=Gb.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})();GSi.exports=xwa});var $Si=I(IG=>{"use strict";p();var wwa=IG&&IG.__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())})},Rwa=IG&&IG.__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 v0t=XOe&&XOe.__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())})},C0t=XOe&&XOe.__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&&!ZOe.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(xG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(xG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return v0t(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return C0t(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 Bwa.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(xG.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=$b.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),Owa.gzip(f,function(g,A){var y=A;g?(h._logWarn($b.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($b.dumpObj(s)),s[Lwa.disableCollectionRequestOption]=!0;var E=+new Date,_=a(function(b){b.setEncoding("utf-8");var T="";b.on("data",function(w){T+=w}),b.on("end",function(){var w,R=+new Date,x=R-E;if(h._numConsecutiveFailures=0,T.includes(qwa)&&b.statusCode===400&&(pvr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(Qwa.includes(b.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(b.statusCode==Uwa||b.statusCode==Fwa?h._statsbeat.countThrottle(xG.StatsbeatNetworkCategory.Breeze,o,b.statusCode):h._statsbeat.countRequest(xG.StatsbeatNetworkCategory.Breeze,o,x,b.statusCode===200,b.statusCode)),h._enableDiskRetryMode){if(b.statusCode===200)h._resendTimer||(h._resendTimer=setTimeout(function(){h._resendTimer=null,h._sendFirstFileOnDisk()},h._resendInterval),h._resendTimer.unref());else if(h._isRetriable(b.statusCode))try{h._statsbeat&&h._statsbeat.countRetry(xG.StatsbeatNetworkCategory.Breeze,o,b.statusCode);var P=JSON.parse(T),D=[];P.errors&&(P.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(b.statusCode===307||b.statusCode===308)if(h._numConsecutiveRedirects++,h._numConsecutiveRedirects<10){var N=b.headers.location?b.headers.location.toString():null;N&&(h._redirectedHost=N,h.send(e,r))}else{var L={name:"Circular Redirect",message:"Error sending telemetry because of circular redirects."};h._statsbeat&&h._statsbeat.countException(xG.StatsbeatNetworkCategory.Breeze,o,L),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=$b.makeRequest(h._config,n,s,_);v.setTimeout(t.HTTP_TIMEOUT,function(){h._requestTimedOut=!0,v.abort()}),v.on("error",function(b){if(h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&h._statsbeatFailedToIngest(),h._numConsecutiveFailures++,h._statsbeat&&h._statsbeat.countException(xG.StatsbeatNetworkCategory.Breeze,o,b),!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,$b.dumpObj(b))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,$b.dumpObj(b))}h._onErrorHelper(b),typeof r=="function"&&(b?(h._requestTimedOut&&(b.name="telemetry timeout",b.message="telemetry request timed out"),r($b.dumpObj(b))):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($b.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 v0t(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return C0t(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,J8.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: "+$b.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,ZOe.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: "+$b.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,J8.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: "+$b.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=pte.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,J8.writeFileAsync(l,$b.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: "+$b.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),fvr.existsSync(this._tempDir)||fvr.mkdirSync(this._tempDir),ZOe.FileAccessControl.applyACLRulesSync(this._tempDir);var r=J8.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=pte.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),fvr.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+$b.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return v0t(this,void 0,void 0,function(){var e,r,n,o,s,c;return C0t(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,J8.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return pte.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=pte.join(this._tempDir,r),[4,J8.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,J8.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 v0t(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return C0t(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,J8.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return pte.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=pte.join(this._tempDir,e[r]),[4,J8.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})();VSi.exports=jwa});var zSi=I(b0t=>{"use strict";p();Object.defineProperty(b0t,"__esModule",{value:!0});b0t.AzureVirtualMachine=void 0;var WSi=Kl(),Hwa=ay(),Gwa=X0e(),$wa="http://169.254.169.254/metadata/instance/compute",Vwa="api-version=2017-12-01",Wwa="format=json",zwa="UNREACH",Ywa=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat($wa,"?").concat(Vwa,"&").concat(Wwa),l=(n={method:"GET"},n[Gwa.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=Hwa.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){WSi.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(zwa)>-1?s.isVM=!1:WSi.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();b0t.AzureVirtualMachine=Ywa});var YSi=I(S0t=>{"use strict";p();Object.defineProperty(S0t,"__esModule",{value:!0});S0t.NetworkStatsbeat=void 0;var Kwa=(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})();S0t.NetworkStatsbeat=Kwa});var eTi=I((hte,XSi)=>{"use strict";p();var F4=hte&&hte.__assign||function(){return F4=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:Ad.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:Ad.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(F4(F4({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:Ad.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})();XSi.exports=oRa});var nTi=I((yvp,rTi)=>{"use strict";p();var sRa=require("url"),aRa=t_r(),cRa=DSi(),lRa=V0e(),Z8=ME(),uRa=MSi(),Avr=qSi(),tTi=AG(),dRa=eTi(),fRa=hvr(),yvr=ay(),T0t=Kl(),pRa=dvr(),hRa=(function(){function t(e){this._telemetryProcessors=[];var r=new aRa(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 lRa,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new dRa(this.config,this.context),this._statsbeat.enable(!0));var n=new fRa(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new uRa(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,Z8.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,Z8.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,Z8.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,Z8.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!yvr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,Z8.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,Z8.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,Z8.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new sRa.URL(e.data).host}catch(r){e.target=null,T0t.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,Z8.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&&Z8.telemetryTypeToBaseType(r)){var n=pRa.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&&Avr.samplingTelemetryProcessor(n,{correlationContext:tTi.CorrelationContextManager.getCurrentContext()}),Avr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(Avr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else T0t.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||(T0t.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new cRa(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=tTi.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var mRa=Evr&&Evr.__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)}})(),gRa=nTi(),iTi=zEr(),ARa=X0e(),I0t=Kl(),yRa=(function(t){mRa(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?iTi.trackRequestSync(this,r):I0t.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&I0t.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?iTi.trackRequest(this,r):I0t.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?ARa.trackRequest(this,r):I0t.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(gRa);oTi.exports=yRa});var cTi=I(aTi=>{"use strict";p();Object.defineProperty(aTi,"__esModule",{value:!0})});var fTi=I(yt=>{"use strict";p();Object.defineProperty(yt,"__esModule",{value:!0});yt.Configuration=yt.liveMetricsClient=yt.defaultClient=yt.DistributedTracingModes=void 0;yt.setup=xRa;yt.start=dTi;yt.getCorrelationContext=RRa;yt.startOperation=kRa;yt.wrapWithCorrelationContext=PRa;yt.dispose=DRa;var vvr=AG(),ERa=GCi(),_Ra=VCi(),Cvr=kmt(),vRa=MEr(),CRa=rbi(),bRa=pbi(),SRa=X0e(),TRa=zEr(),lTi=Qee(),e5e=Kl(),uTi=Wbi(),bvr=Ybi(),IRa=Zbi();yt.TelemetryClient=sTi();yt.Contracts=ME();yt.azureFunctionsTypes=cTi();var _vr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(_vr||(yt.DistributedTracingModes=_vr={}));var t5e,r5e,n5e,i5e,o5e,bge,Sge,mte,s5e,a5e,YT=!1,x0t;function xRa(t){return yt.defaultClient?e5e.info("The default client is already setup"):(yt.defaultClient=new yt.TelemetryClient(t),t5e=new ERa(yt.defaultClient),r5e=new _Ra(yt.defaultClient),n5e=new Cvr(yt.defaultClient),i5e=new vRa(yt.defaultClient),o5e=new CRa(yt.defaultClient),bge=new bRa(yt.defaultClient),mte=new TRa(yt.defaultClient),s5e=new SRa(yt.defaultClient),Sge||(Sge=new bvr.AutoCollectNativePerformance(yt.defaultClient)),a5e=new IRa.AzureFunctionsHook(yt.defaultClient)),Svr}a(xRa,"setup");function wRa(){yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExternalLoggers==null&&(yt.defaultClient.config.enableAutoCollectExternalLoggers=!0),yt.defaultClient.config.enableAutoCollectConsole==null&&(yt.defaultClient.config.enableAutoCollectConsole=!1),yt.defaultClient.config.enableAutoCollectExceptions==null&&(yt.defaultClient.config.enableAutoCollectExceptions=!0),yt.defaultClient.config.enableAutoCollectPerformance==null&&(yt.defaultClient.config.enableAutoCollectPerformance=!0),yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),yt.defaultClient.config.enableAutoCollectHeartbeat==null&&(yt.defaultClient.config.enableAutoCollectHeartbeat=!0),yt.defaultClient.config.enableAutoCollectRequests==null&&(yt.defaultClient.config.enableAutoCollectRequests=!0),yt.defaultClient.config.enableAutoCollectDependencies==null&&(yt.defaultClient.config.enableAutoCollectDependencies=!0),yt.defaultClient.config.enableUseDiskRetryCaching==null&&(yt.defaultClient.config.enableUseDiskRetryCaching=!0),yt.defaultClient.config.enableAutoDependencyCorrelation==null&&(yt.defaultClient.config.enableAutoDependencyCorrelation=!0),yt.defaultClient.config.enableSendLiveMetrics==null&&(yt.defaultClient.config.enableSendLiveMetrics=!1),yt.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(yt.defaultClient.config.enableAutoCollectExtendedMetrics=!0),yt.defaultClient.config.enableWebInstrumentation==null&&(yt.defaultClient.config.enableWebInstrumentation=!1),yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(wRa,"_setDefaultConfig");function dTi(){if(yt.defaultClient){YT=!0,wRa(),t5e.enable(yt.defaultClient.config.enableAutoCollectExternalLoggers,yt.defaultClient.config.enableAutoCollectConsole),r5e.enable(yt.defaultClient.config.enableAutoCollectExceptions),n5e.enable(yt.defaultClient.config.enableAutoCollectPerformance),i5e.enable(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics),o5e.enable(yt.defaultClient.config.enableAutoCollectHeartbeat),mte.useAutoCorrelation(yt.defaultClient.config.enableAutoDependencyCorrelation,yt.defaultClient.config.enableUseAsyncHooks),mte.enable(yt.defaultClient.config.enableAutoCollectRequests),s5e.enable(yt.defaultClient.config.enableAutoCollectDependencies),bge.enable(yt.defaultClient.config.enableWebInstrumentation,yt.defaultClient.config.webInstrumentationConnectionString),yt.defaultClient.config.enableSendLiveMetrics&&(yt.liveMetricsClient||(yt.liveMetricsClient=new uTi(yt.defaultClient.config,yt.defaultClient.context,yt.defaultClient.getAuthorizationHandler,yt.defaultClient),x0t=new Cvr(yt.liveMetricsClient,1e3,!0),yt.liveMetricsClient.addCollector(x0t),yt.defaultClient.quickPulseClient=yt.liveMetricsClient),yt.liveMetricsClient.enable(yt.defaultClient.config.enableSendLiveMetrics)),a5e.enable(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=bvr.AutoCollectNativePerformance.parseEnabled(yt.defaultClient.config.enableAutoCollectExtendedMetrics,yt.defaultClient.config);Sge.enable(yt.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),yt.defaultClient&&yt.defaultClient.channel&&yt.defaultClient.channel.setUseDiskRetryCaching(yt.defaultClient.config.enableUseDiskRetryCaching,yt.defaultClient.config.enableResendInterval,yt.defaultClient.config.enableMaxBytesOnDisk)}else e5e.warn("Start cannot be called before setup");return Svr}a(dTi,"start");function RRa(){return vvr.CorrelationContextManager.getCurrentContext()}a(RRa,"getCorrelationContext");function kRa(t,e){return vvr.CorrelationContextManager.startOperation(t,e)}a(kRa,"startOperation");function PRa(t,e){return vvr.CorrelationContextManager.wrapCallback(t,e)}a(PRa,"wrapWithCorrelationContext");var Svr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return lTi.w3cEnabled=e===_vr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExternalLoggers=e,yt.defaultClient.config.enableAutoCollectConsole=r,YT&&t5e.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExceptions=e,YT&&r5e.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),yt.defaultClient){yt.defaultClient.config.enableAutoCollectPerformance=e;var n=bvr.AutoCollectNativePerformance.parseEnabled(r,yt.defaultClient.config);yt.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,YT&&(n5e.enable(e),Sge.enable(yt.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,YT&&i5e.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectHeartbeat=e,YT&&o5e.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableWebInstrumentation=e,yt.defaultClient.config.webInstrumentationConnectionString=r,YT&&bge.enable(yt.defaultClient.config.enableAutoWebSnippetInjection,yt.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableWebInstrumentation=e,yt.defaultClient.config.webInstrumentationConnectionString=r,YT&&bge.enable(yt.defaultClient.config.enableWebInstrumentation,yt.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectRequests=e,YT&&mte.enable(e)),t},t.setAutoCollectDependencies=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectDependencies=e,YT&&s5e.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableAutoDependencyCorrelation=e,yt.defaultClient.config.enableUseAsyncHooks=r,YT&&mte.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return yt.defaultClient&&(yt.defaultClient.config.enableUseDiskRetryCaching=e,yt.defaultClient.config.enableResendInterval=r,yt.defaultClient.config.enableMaxBytesOnDisk=n,yt.defaultClient.channel&&yt.defaultClient.channel.setUseDiskRetryCaching(yt.defaultClient.config.enableUseDiskRetryCaching,yt.defaultClient.config.enableResendInterval,yt.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),e5e.enableDebug=e,e5e.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,YT&&a5e.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),yt.defaultClient?(!yt.liveMetricsClient&&e?(yt.liveMetricsClient=new uTi(yt.defaultClient.config,yt.defaultClient.context,yt.defaultClient.getAuthorizationHandler,yt.defaultClient),x0t=new Cvr(yt.liveMetricsClient,1e3,!0),yt.liveMetricsClient.addCollector(x0t),yt.defaultClient.quickPulseClient=yt.liveMetricsClient):yt.liveMetricsClient&&yt.liveMetricsClient.enable(e),yt.defaultClient.config.enableSendLiveMetrics=e,t):(e5e.warn("Live metrics client cannot be setup without the default client"),t)},t.start=dTi,t})();yt.Configuration=Svr;function DRa(){lTi.w3cEnabled=!0,yt.defaultClient=null,YT=!1,t5e&&t5e.dispose(),r5e&&r5e.dispose(),n5e&&n5e.dispose(),i5e&&i5e.dispose(),o5e&&o5e.dispose(),bge&&bge.dispose(),Sge&&Sge.dispose(),mte&&mte.dispose(),s5e&&s5e.dispose(),yt.liveMetricsClient&&(yt.liveMetricsClient.enable(!1),yt.liveMetricsClient=void 0),a5e&&a5e.dispose()}a(DRa,"dispose")});var Ivr=I(TR=>{"use strict";p();var NRa=TR&&TR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MRa=TR&&TR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pTi=TR&&TR.__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 FRa(e)?hTi(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};TR.AzureInsightReporter=Tvr;function URa(t,e,r){let n=new ORa.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,mTi(t,e,n),n}a(URa,"createAppInsightsClient");function mTi(t,e,r){r.commonProperties=QRa(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(mTi,"configureReporter");function QRa(t,e){return t=t||{},t.common_os=w0t.platform(),t.common_platformversion=w0t.release(),t.common_arch=w0t.arch(),t.common_cpu=Array.from(new Set(w0t.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(QRa,"decorateWithCommonProperties")});var gTi=I((Pvp,qRa)=>{qRa.exports={name:"copilot-chat",displayName:"GitHub Copilot Chat",description:"AI chat features powered by Copilot",version:"0.54.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.126.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=GTa(n);o&&t.headers.set("Content-Length",o),t.body=await(0,UTa.concat)(n)}a($Ta,"buildRequestBody");age.multipartPolicyName="multipartPolicy";var VTa=70,WTa=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function zTa(t){if(t.length>VTa)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!WTa.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(zTa,"assertValidBoundary");function YTa(){return{name:age.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?zTa(n):n=qTa(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await $Ta(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(YTa,"multipartPolicy")});var F_r=I(cge=>{"use strict";p();Object.defineProperty(cge,"__esModule",{value:!0});cge.decompressResponsePolicyName=void 0;cge.decompressResponsePolicy=KTa;cge.decompressResponsePolicyName="decompressResponsePolicy";function KTa(){return{name:cge.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(KTa,"decompressResponsePolicy")});var o0t=I(i0t=>{"use strict";p();Object.defineProperty(i0t,"__esModule",{value:!0});i0t.delay=XTa;i0t.parseHeaderValueAsNumber=eIa;var JTa=QOe(),ZTa="The operation was aborted.";function XTa(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new JTa.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:ZTa)),"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(XTa,"delay");function eIa(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(eIa,"parseHeaderValueAsNumber")});var a0t=I(s0t=>{"use strict";p();Object.defineProperty(s0t,"__esModule",{value:!0});s0t.isThrottlingRetryResponse=nIa;s0t.throttlingRetryStrategy=iIa;var tIa=o0t(),U_r="Retry-After",rIa=["retry-after-ms","x-ms-retry-after-ms",U_r];function L1i(t){if(t&&[429,503].includes(t.status))try{for(let o of rIa){let s=(0,tIa.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===U_r?1e3:1)}let e=t.headers.get(U_r);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(L1i,"getRetryAfterInMs");function nIa(t){return Number.isFinite(L1i(t))}a(nIa,"isThrottlingRetryResponse");function iIa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=L1i(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(iIa,"throttlingRetryStrategy")});var c0t=I(HOe=>{"use strict";p();Object.defineProperty(HOe,"__esModule",{value:!0});HOe.exponentialRetryStrategy=lIa;HOe.isExponentialRetryResponse=B1i;HOe.isSystemError=F1i;var oIa=O4(),sIa=a0t(),aIa=1e3,cIa=1e3*64;function lIa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:aIa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:cIa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=F1i(u),f=d&&t.ignoreSystemErrors,h=B1i(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,sIa.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,oIa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(lIa,"exponentialRetryStrategy");function B1i(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(B1i,"isExponentialRetryResponse");function F1i(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(F1i,"isSystemError")});var lge=I(Q_r=>{"use strict";p();Object.defineProperty(Q_r,"__esModule",{value:!0});Q_r.retryPolicy=hIa;var uIa=o0t(),dIa=aht(),fIa=QOe(),U1i=IG(),Q1i=(0,dIa.createClientLogger)("core-rest-pipeline retryPolicy"),pIa="retryPolicy";function hIa(t,e={maxRetries:U1i.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||Q1i;return{name:pIa,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 fIa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:U1i.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||Q1i;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,uIa.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(hIa,"retryPolicy")});var q_r=I(uge=>{"use strict";p();Object.defineProperty(uge,"__esModule",{value:!0});uge.defaultRetryPolicyName=void 0;uge.defaultRetryPolicy=EIa;var mIa=c0t(),gIa=a0t(),AIa=lge(),yIa=IG();uge.defaultRetryPolicyName="defaultRetryPolicy";function EIa(t={}){var e;return{name:uge.defaultRetryPolicyName,sendRequest:(0,AIa.retryPolicy)([(0,gIa.throttlingRetryStrategy)(),(0,mIa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:yIa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(EIa,"defaultRetryPolicy")});var GOe=I(H_r=>{"use strict";p();Object.defineProperty(H_r,"__esModule",{value:!0});H_r.createHttpHeaders=vIa;function l0t(t){return t.toLowerCase()}a(l0t,"normalizeName");function*_Ia(t){for(let e of t.values())yield[e.name,e.value]}a(_Ia,"headerIterator");var j_r=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(l0t(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(l0t(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(l0t(e))}delete(e){this._headersMap.delete(l0t(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 _Ia(this._headersMap)}};function vIa(t){return new j_r(t)}a(vIa,"createHttpHeaders")});var G_r=I(dge=>{"use strict";p();Object.defineProperty(dge,"__esModule",{value:!0});dge.formDataPolicyName=void 0;dge.formDataPolicy=bIa;var j1i=O4(),q1i=GOe();dge.formDataPolicyName="formDataPolicy";function CIa(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(CIa,"formDataToFormDataMap");function bIa(){return{name:dge.formDataPolicyName,async sendRequest(t,e){if(j1i.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=CIa(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=SIa(t.formData):await TIa(t.formData,t),t.formData=void 0}return e(t)}}}a(bIa,"formDataPolicy");function SIa(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(SIa,"wwwFormUrlEncode");async function TIa(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,q1i.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,j1i.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,q1i.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(TIa,"prepareFormData")});var $_r=I(TR=>{"use strict";p();Object.defineProperty(TR,"__esModule",{value:!0});TR.globalNoProxyList=TR.proxyPolicyName=void 0;TR.loadNoProxy=W1i;TR.getDefaultProxySettings=OIa;TR.proxyPolicy=BIa;var IIa=z3t(),xIa=Y3t(),wIa=lte(),RIa="HTTPS_PROXY",kIa="HTTP_PROXY",PIa="ALL_PROXY",DIa="NO_PROXY";TR.proxyPolicyName="proxyPolicy";TR.globalNoProxyList=[];var $1i=!1,NIa=new Map;function u0t(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(u0t,"getEnvironmentValue");function V1i(){if(!process)return;let t=u0t(RIa),e=u0t(PIa),r=u0t(kIa);return t||e||r}a(V1i,"loadEnvironmentProxyValue");function MIa(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(MIa,"isBypassed");function W1i(){let t=u0t(DIa);return $1i=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(W1i,"loadNoProxy");function OIa(t){if(!t&&(t=V1i(),!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(OIa,"getDefaultProxySettings");function LIa(){let t=V1i();return t?new URL(t):void 0}a(LIa,"getDefaultProxySettingsInternal");function H1i(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(H1i,"getUrlFromProxySettings");function G1i(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&wIa.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 xIa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new IIa.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(G1i,"setProxyAgentOnRequest");function BIa(t,e){$1i||TR.globalNoProxyList.push(...W1i());let r=t?H1i(t):LIa(),n={};return{name:TR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!MIa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:TR.globalNoProxyList,e?.customNoProxyList?void 0:NIa)?G1i(o,n,r):o.proxySettings&&G1i(o,n,H1i(o.proxySettings)),s(o)}}}a(BIa,"proxyPolicy")});var V_r=I(fge=>{"use strict";p();Object.defineProperty(fge,"__esModule",{value:!0});fge.setClientRequestIdPolicyName=void 0;fge.setClientRequestIdPolicy=FIa;fge.setClientRequestIdPolicyName="setClientRequestIdPolicy";function FIa(t="x-ms-client-request-id"){return{name:fge.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(FIa,"setClientRequestIdPolicy")});var W_r=I(pge=>{"use strict";p();Object.defineProperty(pge,"__esModule",{value:!0});pge.tlsPolicyName=void 0;pge.tlsPolicy=UIa;pge.tlsPolicyName="tlsPolicy";function UIa(t){return{name:pge.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(UIa,"tlsPolicy")});var z_r=I(K8=>{"use strict";p();Object.defineProperty(K8,"__esModule",{value:!0});K8.TracingContextImpl=K8.knownContextKeys=void 0;K8.createTracingContext=QIa;K8.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function QIa(t={}){let e=new d0t(t.parentContext);return t.span&&(e=e.setValue(K8.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(K8.knownContextKeys.namespace,t.namespace)),e}a(QIa,"createTracingContext");var d0t=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}};K8.TracingContextImpl=d0t});var Y_r=I(hge=>{"use strict";p();Object.defineProperty(hge,"__esModule",{value:!0});hge.createDefaultTracingSpan=z1i;hge.createDefaultInstrumenter=Y1i;hge.useInstrumenter=jIa;hge.getInstrumenter=HIa;var qIa=z_r(),f0t=j5t();function z1i(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(z1i,"createDefaultTracingSpan");function Y1i(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:z1i(),tracingContext:(0,qIa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(Y1i,"createDefaultInstrumenter");function jIa(t){f0t.state.instrumenterImplementation=t}a(jIa,"useInstrumenter");function HIa(){return f0t.state.instrumenterImplementation||(f0t.state.instrumenterImplementation=Y1i()),f0t.state.instrumenterImplementation}a(HIa,"getInstrumenter")});var K1i=I(J_r=>{"use strict";p();Object.defineProperty(J_r,"__esModule",{value:!0});J_r.createTracingClient=GIa;var p0t=Y_r(),K_r=z_r();function GIa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,p0t.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(K_r.knownContextKeys.namespace)||(A=A.setValue(K_r.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(K_r.knownContextKeys.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}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,p0t.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,p0t.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,p0t.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(GIa,"createTracingClient")});var J1i=I(mge=>{"use strict";p();Object.defineProperty(mge,"__esModule",{value:!0});mge.createTracingClient=mge.useInstrumenter=void 0;var $Ia=Y_r();Object.defineProperty(mge,"useInstrumenter",{enumerable:!0,get:a(function(){return $Ia.useInstrumenter},"get")});var VIa=K1i();Object.defineProperty(mge,"createTracingClient",{enumerable:!0,get:a(function(){return VIa.createTracingClient},"get")})});var Z1i=I(h0t=>{"use strict";p();Object.defineProperty(h0t,"__esModule",{value:!0});h0t.custom=void 0;var WIa=require("node:util");h0t.custom=WIa.inspect.custom});var m0t=I($Oe=>{"use strict";p();Object.defineProperty($Oe,"__esModule",{value:!0});$Oe.RestError=void 0;$Oe.isRestError=ZIa;var zIa=O4(),YIa=Z1i(),KIa=Xmt(),JIa=new KIa.Sanitizer,gge=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)}[YIa.custom](){return`RestError: ${this.message} + ${JIa.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};$Oe.RestError=gge;gge.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";gge.PARSE_ERROR="PARSE_ERROR";function ZIa(t){return t instanceof gge?!0:(0,zIa.isError)(t)&&t.name==="RestError"}a(ZIa,"isRestError")});var Z_r=I(Age=>{"use strict";p();Object.defineProperty(Age,"__esModule",{value:!0});Age.tracingPolicyName=void 0;Age.tracingPolicy=ixa;var XIa=J1i(),exa=IG(),txa=D_r(),g0t=lte(),VOe=O4(),rxa=m0t(),nxa=Xmt();Age.tracingPolicyName="tracingPolicy";function ixa(t={}){let e=(0,txa.getUserAgentValue)(t.userAgentPrefix),r=new nxa.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=oxa();return{name:Age.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=sxa(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return cxa(f,m),m}catch(m){throw axa(f,m),m}}}}a(ixa,"tracingPolicy");function oxa(){try{return(0,XIa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:exa.SDK_VERSION})}catch(t){g0t.logger.warning(`Error when creating the TracingClient: ${(0,VOe.getErrorMessage)(t)}`);return}}a(oxa,"tryCreateTracingClient");function sxa(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){g0t.logger.warning(`Skipping creating a tracing span due to an error: ${(0,VOe.getErrorMessage)(n)}`);return}}a(sxa,"tryCreateSpan");function axa(t,e){try{t.setStatus({status:"error",error:(0,VOe.isError)(e)?e:void 0}),(0,rxa.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){g0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,VOe.getErrorMessage)(r)}`)}}a(axa,"tryProcessError");function cxa(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){g0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,VOe.getErrorMessage)(r)}`)}}a(cxa,"tryProcessResponse")});var tSi=I(X_r=>{"use strict";p();Object.defineProperty(X_r,"__esModule",{value:!0});X_r.createPipelineFromOptions=_xa;var lxa=w_r(),uxa=o_r(),dxa=R_r(),fxa=N_r(),X1i=B_r(),pxa=F_r(),hxa=q_r(),mxa=G_r(),eSi=O4(),gxa=$_r(),Axa=V_r(),yxa=W_r(),Exa=Z_r();function _xa(t){var e;let r=(0,uxa.createEmptyPipeline)();return eSi.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,yxa.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,gxa.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,pxa.decompressResponsePolicy)())),r.addPolicy((0,mxa.formDataPolicy)(),{beforePolicies:[X1i.multipartPolicyName]}),r.addPolicy((0,fxa.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,Axa.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,X1i.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,hxa.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,Exa.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),eSi.isNodeLike&&r.addPolicy((0,dxa.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,lxa.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(_xa,"createPipelineFromOptions")});var aSi=I(y0t=>{"use strict";p();Object.defineProperty(y0t,"__esModule",{value:!0});y0t.getBodyLength=sSi;y0t.createNodeHttpClient=xxa;var nvr=(m3(),Ca(oQ)),evr=nvr.__importStar(require("node:http")),tvr=nvr.__importStar(require("node:https")),rSi=nvr.__importStar(require("node:zlib")),vxa=require("node:stream"),nSi=QOe(),Cxa=GOe(),YOe=m0t(),WOe=lte(),bxa={};function zOe(t){return t&&typeof t.pipe=="function"}a(zOe,"isReadableStream");function iSi(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(iSi,"isStreamComplete");function oSi(t){return t&&typeof t.byteLength=="number"}a(oSi,"isArrayBuffer");var A0t=class extends vxa.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}},rvr=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 nSi.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=sSi(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let E=e.onUploadProgress,_=new A0t(E);_.on("error",v=>{WOe.logger.error("Error in upload progress",v)}),zOe(d)?d.pipe(_):_.end(d),d=_}let h=await this.makeRequest(e,s,d),m=Sxa(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?Txa(h,m):h;let y=e.onDownloadProgress;if(y){let E=new A0t(y);E.on("error",_=>{WOe.logger.error("Error in download progress",_)}),f.pipe(E),f=E}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 Ixa(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();zOe(d)&&(h=iSi(d));let m=Promise.resolve();zOe(f)&&(m=iSi(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{WOe.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?evr.request(u,d):tvr.request(u,d);h.once("error",m=>{var g;f(new YOe.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:YOe.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new nSi.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&zOe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):oSi(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(WOe.logger.error("Unrecognized body type",n),f(new YOe.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?evr.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new evr.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return tvr.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:bxa,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(WOe.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new tvr.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function Sxa(t){let e=(0,Cxa.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(Sxa,"getResponseHeaders");function Txa(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=rSi.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=rSi.createInflate();return t.pipe(n),n}return t}a(Txa,"getDecodedResponseStream");function Ixa(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 YOe.RestError(`Error reading response as text: ${o.message}`,{code:YOe.RestError.PARSE_ERROR}))})})}a(Ixa,"streamToText");function sSi(t){return t?Buffer.isBuffer(t)?t.length:zOe(t)?null:oSi(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(sSi,"getBodyLength");function xxa(){return new rvr}a(xxa,"createNodeHttpClient")});var cSi=I(ivr=>{"use strict";p();Object.defineProperty(ivr,"__esModule",{value:!0});ivr.createDefaultHttpClient=Rxa;var wxa=aSi();function Rxa(){return(0,wxa.createNodeHttpClient)()}a(Rxa,"createDefaultHttpClient")});var lSi=I(svr=>{"use strict";p();Object.defineProperty(svr,"__esModule",{value:!0});svr.createPipelineRequest=Dxa;var kxa=GOe(),Pxa=O4(),ovr=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,kxa.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,Pxa.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function Dxa(t){return new ovr(t)}a(Dxa,"createPipelineRequest")});var uSi=I(KOe=>{"use strict";p();Object.defineProperty(KOe,"__esModule",{value:!0});KOe.exponentialRetryPolicyName=void 0;KOe.exponentialRetryPolicy=Lxa;var Nxa=c0t(),Mxa=lge(),Oxa=IG();KOe.exponentialRetryPolicyName="exponentialRetryPolicy";function Lxa(t={}){var e;return(0,Mxa.retryPolicy)([(0,Nxa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Oxa.DEFAULT_RETRY_POLICY_COUNT})}a(Lxa,"exponentialRetryPolicy")});var dSi=I(yge=>{"use strict";p();Object.defineProperty(yge,"__esModule",{value:!0});yge.systemErrorRetryPolicyName=void 0;yge.systemErrorRetryPolicy=Qxa;var Bxa=c0t(),Fxa=lge(),Uxa=IG();yge.systemErrorRetryPolicyName="systemErrorRetryPolicy";function Qxa(t={}){var e;return{name:yge.systemErrorRetryPolicyName,sendRequest:(0,Fxa.retryPolicy)([(0,Bxa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Uxa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Qxa,"systemErrorRetryPolicy")});var fSi=I(Ege=>{"use strict";p();Object.defineProperty(Ege,"__esModule",{value:!0});Ege.throttlingRetryPolicyName=void 0;Ege.throttlingRetryPolicy=Gxa;var qxa=a0t(),jxa=lge(),Hxa=IG();Ege.throttlingRetryPolicyName="throttlingRetryPolicy";function Gxa(t={}){var e;return{name:Ege.throttlingRetryPolicyName,sendRequest:(0,jxa.retryPolicy)([(0,qxa.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Hxa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Gxa,"throttlingRetryPolicy")});var avr=I(_ge=>{"use strict";p();Object.defineProperty(_ge,"__esModule",{value:!0});_ge.DEFAULT_CYCLER_OPTIONS=void 0;_ge.createTokenCycler=Wxa;var $xa=o0t();_ge.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Vxa(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(Wxa,"createTokenCycler")});var pSi=I(vge=>{"use strict";p();Object.defineProperty(vge,"__esModule",{value:!0});vge.bearerTokenAuthenticationPolicyName=void 0;vge.bearerTokenAuthenticationPolicy=Zxa;var zxa=avr(),Yxa=lte();vge.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function Kxa(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(Kxa,"defaultAuthorizeRequest");function Jxa(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a(Jxa,"getChallenge");function Zxa(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||Yxa.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:Kxa,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,zxa.createTokenCycler)(r):()=>Promise.resolve(null);return{name:vge.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&&Jxa(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(Zxa,"bearerTokenAuthenticationPolicy")});var hSi=I(Cge=>{"use strict";p();Object.defineProperty(Cge,"__esModule",{value:!0});Cge.ndJsonPolicyName=void 0;Cge.ndJsonPolicy=Xxa;Cge.ndJsonPolicyName="ndJsonPolicy";function Xxa(){return{name:Cge.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(Xxa,"ndJsonPolicy")});var gSi=I(fte=>{"use strict";p();Object.defineProperty(fte,"__esModule",{value:!0});fte.auxiliaryAuthenticationHeaderPolicyName=void 0;fte.auxiliaryAuthenticationHeaderPolicy=nwa;var ewa=avr(),twa=lte();fte.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var mSi="x-ms-authorization-auxiliary";async function rwa(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(rwa,"sendAuthorizeRequest");function nwa(t){let{credentials:e,scopes:r}=t,n=t.logger||twa.logger,o=new WeakMap;return{name:fte.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(`${fte.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,ewa.createTokenCycler)(d),o.set(d,f)),l.push(rwa({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. ${mSi} header will not be set.`),c(s)):(s.headers.set(mSi,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(nwa,"auxiliaryAuthenticationHeaderPolicy")});var MSi=I(vr=>{"use strict";p();Object.defineProperty(vr,"__esModule",{value:!0});vr.createFileFromStream=vr.createFile=vr.auxiliaryAuthenticationHeaderPolicyName=vr.auxiliaryAuthenticationHeaderPolicy=vr.ndJsonPolicyName=vr.ndJsonPolicy=vr.bearerTokenAuthenticationPolicyName=vr.bearerTokenAuthenticationPolicy=vr.formDataPolicyName=vr.formDataPolicy=vr.tlsPolicyName=vr.tlsPolicy=vr.userAgentPolicyName=vr.userAgentPolicy=vr.defaultRetryPolicy=vr.tracingPolicyName=vr.tracingPolicy=vr.retryPolicy=vr.throttlingRetryPolicyName=vr.throttlingRetryPolicy=vr.systemErrorRetryPolicyName=vr.systemErrorRetryPolicy=vr.redirectPolicyName=vr.redirectPolicy=vr.getDefaultProxySettings=vr.proxyPolicyName=vr.proxyPolicy=vr.multipartPolicyName=vr.multipartPolicy=vr.logPolicyName=vr.logPolicy=vr.setClientRequestIdPolicyName=vr.setClientRequestIdPolicy=vr.exponentialRetryPolicyName=vr.exponentialRetryPolicy=vr.decompressResponsePolicyName=vr.decompressResponsePolicy=vr.isRestError=vr.RestError=vr.createPipelineRequest=vr.createHttpHeaders=vr.createDefaultHttpClient=vr.createPipelineFromOptions=vr.createEmptyPipeline=void 0;var iwa=o_r();Object.defineProperty(vr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return iwa.createEmptyPipeline},"get")});var owa=tSi();Object.defineProperty(vr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return owa.createPipelineFromOptions},"get")});var swa=cSi();Object.defineProperty(vr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return swa.createDefaultHttpClient},"get")});var awa=GOe();Object.defineProperty(vr,"createHttpHeaders",{enumerable:!0,get:a(function(){return awa.createHttpHeaders},"get")});var cwa=lSi();Object.defineProperty(vr,"createPipelineRequest",{enumerable:!0,get:a(function(){return cwa.createPipelineRequest},"get")});var ASi=m0t();Object.defineProperty(vr,"RestError",{enumerable:!0,get:a(function(){return ASi.RestError},"get")});Object.defineProperty(vr,"isRestError",{enumerable:!0,get:a(function(){return ASi.isRestError},"get")});var ySi=F_r();Object.defineProperty(vr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return ySi.decompressResponsePolicy},"get")});Object.defineProperty(vr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return ySi.decompressResponsePolicyName},"get")});var ESi=uSi();Object.defineProperty(vr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return ESi.exponentialRetryPolicy},"get")});Object.defineProperty(vr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return ESi.exponentialRetryPolicyName},"get")});var _Si=V_r();Object.defineProperty(vr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return _Si.setClientRequestIdPolicy},"get")});Object.defineProperty(vr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return _Si.setClientRequestIdPolicyName},"get")});var vSi=w_r();Object.defineProperty(vr,"logPolicy",{enumerable:!0,get:a(function(){return vSi.logPolicy},"get")});Object.defineProperty(vr,"logPolicyName",{enumerable:!0,get:a(function(){return vSi.logPolicyName},"get")});var CSi=B_r();Object.defineProperty(vr,"multipartPolicy",{enumerable:!0,get:a(function(){return CSi.multipartPolicy},"get")});Object.defineProperty(vr,"multipartPolicyName",{enumerable:!0,get:a(function(){return CSi.multipartPolicyName},"get")});var cvr=$_r();Object.defineProperty(vr,"proxyPolicy",{enumerable:!0,get:a(function(){return cvr.proxyPolicy},"get")});Object.defineProperty(vr,"proxyPolicyName",{enumerable:!0,get:a(function(){return cvr.proxyPolicyName},"get")});Object.defineProperty(vr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return cvr.getDefaultProxySettings},"get")});var bSi=R_r();Object.defineProperty(vr,"redirectPolicy",{enumerable:!0,get:a(function(){return bSi.redirectPolicy},"get")});Object.defineProperty(vr,"redirectPolicyName",{enumerable:!0,get:a(function(){return bSi.redirectPolicyName},"get")});var SSi=dSi();Object.defineProperty(vr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return SSi.systemErrorRetryPolicy},"get")});Object.defineProperty(vr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return SSi.systemErrorRetryPolicyName},"get")});var TSi=fSi();Object.defineProperty(vr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return TSi.throttlingRetryPolicy},"get")});Object.defineProperty(vr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return TSi.throttlingRetryPolicyName},"get")});var lwa=lge();Object.defineProperty(vr,"retryPolicy",{enumerable:!0,get:a(function(){return lwa.retryPolicy},"get")});var ISi=Z_r();Object.defineProperty(vr,"tracingPolicy",{enumerable:!0,get:a(function(){return ISi.tracingPolicy},"get")});Object.defineProperty(vr,"tracingPolicyName",{enumerable:!0,get:a(function(){return ISi.tracingPolicyName},"get")});var uwa=q_r();Object.defineProperty(vr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return uwa.defaultRetryPolicy},"get")});var xSi=N_r();Object.defineProperty(vr,"userAgentPolicy",{enumerable:!0,get:a(function(){return xSi.userAgentPolicy},"get")});Object.defineProperty(vr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return xSi.userAgentPolicyName},"get")});var wSi=W_r();Object.defineProperty(vr,"tlsPolicy",{enumerable:!0,get:a(function(){return wSi.tlsPolicy},"get")});Object.defineProperty(vr,"tlsPolicyName",{enumerable:!0,get:a(function(){return wSi.tlsPolicyName},"get")});var RSi=G_r();Object.defineProperty(vr,"formDataPolicy",{enumerable:!0,get:a(function(){return RSi.formDataPolicy},"get")});Object.defineProperty(vr,"formDataPolicyName",{enumerable:!0,get:a(function(){return RSi.formDataPolicyName},"get")});var kSi=pSi();Object.defineProperty(vr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return kSi.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(vr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return kSi.bearerTokenAuthenticationPolicyName},"get")});var PSi=hSi();Object.defineProperty(vr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return PSi.ndJsonPolicy},"get")});Object.defineProperty(vr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return PSi.ndJsonPolicyName},"get")});var DSi=gSi();Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return DSi.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return DSi.auxiliaryAuthenticationHeaderPolicyName},"get")});var NSi=M_r();Object.defineProperty(vr,"createFile",{enumerable:!0,get:a(function(){return NSi.createFile},"get")});Object.defineProperty(vr,"createFileFromStream",{enumerable:!0,get:a(function(){return NSi.createFileFromStream},"get")})});var LSi=I((ZOe,OSi)=>{"use strict";p();var dwa=ZOe&&ZOe.__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())})},fwa=ZOe&&ZOe.__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 Awa=Kl(),ywa=ay(),Ewa=(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){Awa.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||ywa.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})();BSi.exports=Ewa});var USi=I(lvr=>{"use strict";p();Object.defineProperty(lvr,"__esModule",{value:!0});lvr.azureRoleEnvironmentTelemetryProcessor=_wa;function _wa(t,e){}a(_wa,"azureRoleEnvironmentTelemetryProcessor")});var jSi=I(E0t=>{"use strict";p();Object.defineProperty(E0t,"__esModule",{value:!0});E0t.samplingTelemetryProcessor=vwa;E0t.getSamplingHashCode=qSi;var QSi=ME();function vwa(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&QSi.TelemetryType.Metric===QSi.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=qSi(e.correlationContext.operation.id){"use strict";p();var Cwa=J8&&J8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bwa=J8&&J8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Swa=J8&&J8.__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)&&Cwa(e,t,r);return bwa(e,t),e};Object.defineProperty(J8,"__esModule",{value:!0});J8.performanceMetricsTelemetryProcessor=Twa;var uvr=Pmt(),dvr=Swa(ME());function Twa(t,e){switch(e&&e.addDocument(t),t.data.baseType){case dvr.TelemetryTypeString.Exception:uvr.countException();break;case dvr.TelemetryTypeString.Request:var r=t.data.baseData;uvr.countRequest(r.duration,r.success);break;case dvr.TelemetryTypeString.Dependency:var n=t.data.baseData;uvr.countDependency(n.duration,n.success);break}return!0}a(Twa,"performanceMetricsTelemetryProcessor")});var GSi=I(cD=>{"use strict";p();var L4=cD&&cD.__assign||function(){return L4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var Pwa=B4&&B4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),v0t=B4&&B4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Pwa(e,t,r)};Object.defineProperty(B4,"__esModule",{value:!0});v0t(USi(),B4);v0t(jSi(),B4);v0t(HSi(),B4);v0t(GSi(),B4)});var fvr=I((dvp,zSi)=>{"use strict";p();var Zi=ME(),Gb=ay(),VSi=yG(),Dwa=Kl(),Nwa=(function(){function t(){}return a(t,"EnvelopeFactory"),t.createEnvelope=function(e,r,n,o,s){var c=null;switch(r){case Zi.TelemetryType.Trace:c=t.createTraceData(e);break;case Zi.TelemetryType.Dependency:c=t.createDependencyData(e);break;case Zi.TelemetryType.Event:c=t.createEventData(e);break;case Zi.TelemetryType.Exception:c=t.createExceptionData(e);break;case Zi.TelemetryType.Request:c=t.createRequestData(e);break;case Zi.TelemetryType.Metric:c=t.createMetricData(e);break;case Zi.TelemetryType.Availability:c=t.createAvailabilityData(e);break;case Zi.TelemetryType.PageView:c=t.createPageViewData(e);break}if(c&&c.baseData&&Zi.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=Gb.validateStringMap(c.baseData.properties))}var u=s&&s.instrumentationKey||"",d=new Zi.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===Zi.TelemetryType.Metric&&(d.sampleRate=100),d},t.addAzureFunctionsCorrelationProperties=function(e){var r=VSi.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 Zi.Data;return l.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Exception),l.baseData=o,l},t.createRequestData=function(e){var r,n,o,s,c=new Zi.RequestData;e.id?c.id=e.id:c.id=Gb.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=Gb.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 Zi.Data;return l.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Request),l.baseData=c,l},t.createMetricData=function(e){var r,n=new Zi.MetricData;n.metrics=[];var o=new Zi.DataPoint;o.count=isNaN(e.count)?1:e.count,o.kind=Zi.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 Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Metric),s.baseData=n,s},t.createAvailabilityData=function(e){var r,n,o=new Zi.AvailabilityData;e.id?o.id=e.id:o.id=Gb.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Gb.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 Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Availability),s.baseData=o,s},t.createPageViewData=function(e){var r,n,o=new Zi.PageViewData;o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Gb.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 Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.PageView),s.baseData=o,s},t.getTags=function(e,r){var n=VSi.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(WSi.regex.test(l)){var u=new WSi(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 _=A-g+1;r.splice(g,_);break}g=f,A=h,f++,h--}}return r},t})(),WSi=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=Gb.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=Gb.trim(n[2])||this.method,this.fileName=Gb.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})();zSi.exports=Nwa});var YSi=I(xG=>{"use strict";p();var Mwa=xG&&xG.__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())})},Owa=xG&&xG.__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 C0t=t5e&&t5e.__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())})},b0t=t5e&&t5e.__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&&!e5e.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(wG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(wG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return C0t(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return b0t(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 Hwa.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(wG.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=$b.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),qwa.gzip(f,function(g,A){var y=A;g?(h._logWarn($b.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($b.dumpObj(s)),s[jwa.disableCollectionRequestOption]=!0;var E=+new Date,_=a(function(b){b.setEncoding("utf-8");var T="";b.on("data",function(w){T+=w}),b.on("end",function(){var w,R=+new Date,x=R-E;if(h._numConsecutiveFailures=0,T.includes(Wwa)&&b.statusCode===400&&(hvr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(Vwa.includes(b.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(b.statusCode==$wa||b.statusCode==Gwa?h._statsbeat.countThrottle(wG.StatsbeatNetworkCategory.Breeze,o,b.statusCode):h._statsbeat.countRequest(wG.StatsbeatNetworkCategory.Breeze,o,x,b.statusCode===200,b.statusCode)),h._enableDiskRetryMode){if(b.statusCode===200)h._resendTimer||(h._resendTimer=setTimeout(function(){h._resendTimer=null,h._sendFirstFileOnDisk()},h._resendInterval),h._resendTimer.unref());else if(h._isRetriable(b.statusCode))try{h._statsbeat&&h._statsbeat.countRetry(wG.StatsbeatNetworkCategory.Breeze,o,b.statusCode);var P=JSON.parse(T),D=[];P.errors&&(P.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(b.statusCode===307||b.statusCode===308)if(h._numConsecutiveRedirects++,h._numConsecutiveRedirects<10){var N=b.headers.location?b.headers.location.toString():null;N&&(h._redirectedHost=N,h.send(e,r))}else{var L={name:"Circular Redirect",message:"Error sending telemetry because of circular redirects."};h._statsbeat&&h._statsbeat.countException(wG.StatsbeatNetworkCategory.Breeze,o,L),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=$b.makeRequest(h._config,n,s,_);v.setTimeout(t.HTTP_TIMEOUT,function(){h._requestTimedOut=!0,v.abort()}),v.on("error",function(b){if(h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&h._statsbeatFailedToIngest(),h._numConsecutiveFailures++,h._statsbeat&&h._statsbeat.countException(wG.StatsbeatNetworkCategory.Breeze,o,b),!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,$b.dumpObj(b))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,$b.dumpObj(b))}h._onErrorHelper(b),typeof r=="function"&&(b?(h._requestTimedOut&&(b.name="telemetry timeout",b.message="telemetry request timed out"),r($b.dumpObj(b))):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($b.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 C0t(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return b0t(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,Z8.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: "+$b.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,e5e.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: "+$b.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,Z8.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: "+$b.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=pte.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,Z8.writeFileAsync(l,$b.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: "+$b.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),pvr.existsSync(this._tempDir)||pvr.mkdirSync(this._tempDir),e5e.FileAccessControl.applyACLRulesSync(this._tempDir);var r=Z8.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=pte.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),pvr.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+$b.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return C0t(this,void 0,void 0,function(){var e,r,n,o,s,c;return b0t(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,Z8.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return pte.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=pte.join(this._tempDir,r),[4,Z8.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,Z8.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 C0t(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return b0t(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,Z8.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return pte.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=pte.join(this._tempDir,e[r]),[4,Z8.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})();KSi.exports=zwa});var ZSi=I(S0t=>{"use strict";p();Object.defineProperty(S0t,"__esModule",{value:!0});S0t.AzureVirtualMachine=void 0;var JSi=Kl(),Ywa=ay(),Kwa=ege(),Jwa="http://169.254.169.254/metadata/instance/compute",Zwa="api-version=2017-12-01",Xwa="format=json",eRa="UNREACH",tRa=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat(Jwa,"?").concat(Zwa,"&").concat(Xwa),l=(n={method:"GET"},n[Kwa.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=Ywa.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){JSi.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(eRa)>-1?s.isVM=!1:JSi.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();S0t.AzureVirtualMachine=tRa});var XSi=I(T0t=>{"use strict";p();Object.defineProperty(T0t,"__esModule",{value:!0});T0t.NetworkStatsbeat=void 0;var rRa=(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})();T0t.NetworkStatsbeat=rRa});var iTi=I((hte,nTi)=>{"use strict";p();var F4=hte&&hte.__assign||function(){return F4=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:Ad.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:Ad.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(F4(F4({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:Ad.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})();nTi.exports=dRa});var aTi=I((xvp,sTi)=>{"use strict";p();var fRa=require("url"),pRa=r_r(),hRa=LSi(),mRa=W0e(),X8=ME(),gRa=FSi(),yvr=$Si(),oTi=yG(),ARa=iTi(),yRa=mvr(),Evr=ay(),I0t=Kl(),ERa=fvr(),_Ra=(function(){function t(e){this._telemetryProcessors=[];var r=new pRa(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 mRa,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new ARa(this.config,this.context),this._statsbeat.enable(!0));var n=new yRa(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new gRa(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,X8.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,X8.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,X8.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,X8.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!Evr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,X8.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,X8.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,X8.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new fRa.URL(e.data).host}catch(r){e.target=null,I0t.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,X8.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&&X8.telemetryTypeToBaseType(r)){var n=ERa.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&&yvr.samplingTelemetryProcessor(n,{correlationContext:oTi.CorrelationContextManager.getCurrentContext()}),yvr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(yvr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else I0t.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||(I0t.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new hRa(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=oTi.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var vRa=_vr&&_vr.__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)}})(),CRa=aTi(),cTi=YEr(),bRa=ege(),x0t=Kl(),SRa=(function(t){vRa(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?cTi.trackRequestSync(this,r):x0t.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&x0t.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?cTi.trackRequest(this,r):x0t.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?bRa.trackRequest(this,r):x0t.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(CRa);lTi.exports=SRa});var fTi=I(dTi=>{"use strict";p();Object.defineProperty(dTi,"__esModule",{value:!0})});var gTi=I(yt=>{"use strict";p();Object.defineProperty(yt,"__esModule",{value:!0});yt.Configuration=yt.liveMetricsClient=yt.defaultClient=yt.DistributedTracingModes=void 0;yt.setup=NRa;yt.start=mTi;yt.getCorrelationContext=ORa;yt.startOperation=LRa;yt.wrapWithCorrelationContext=BRa;yt.dispose=FRa;var Cvr=yG(),TRa=zCi(),IRa=KCi(),bvr=Pmt(),xRa=OEr(),wRa=sbi(),RRa=Abi(),kRa=ege(),PRa=YEr(),pTi=Qee(),r5e=Kl(),hTi=Jbi(),Svr=Xbi(),DRa=r1i();yt.TelemetryClient=uTi();yt.Contracts=ME();yt.azureFunctionsTypes=fTi();var vvr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(vvr||(yt.DistributedTracingModes=vvr={}));var n5e,i5e,o5e,s5e,a5e,Sge,Tge,mte,c5e,l5e,JT=!1,w0t;function NRa(t){return yt.defaultClient?r5e.info("The default client is already setup"):(yt.defaultClient=new yt.TelemetryClient(t),n5e=new TRa(yt.defaultClient),i5e=new IRa(yt.defaultClient),o5e=new bvr(yt.defaultClient),s5e=new xRa(yt.defaultClient),a5e=new wRa(yt.defaultClient),Sge=new RRa(yt.defaultClient),mte=new PRa(yt.defaultClient),c5e=new kRa(yt.defaultClient),Tge||(Tge=new Svr.AutoCollectNativePerformance(yt.defaultClient)),l5e=new DRa.AzureFunctionsHook(yt.defaultClient)),Tvr}a(NRa,"setup");function MRa(){yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExternalLoggers==null&&(yt.defaultClient.config.enableAutoCollectExternalLoggers=!0),yt.defaultClient.config.enableAutoCollectConsole==null&&(yt.defaultClient.config.enableAutoCollectConsole=!1),yt.defaultClient.config.enableAutoCollectExceptions==null&&(yt.defaultClient.config.enableAutoCollectExceptions=!0),yt.defaultClient.config.enableAutoCollectPerformance==null&&(yt.defaultClient.config.enableAutoCollectPerformance=!0),yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),yt.defaultClient.config.enableAutoCollectHeartbeat==null&&(yt.defaultClient.config.enableAutoCollectHeartbeat=!0),yt.defaultClient.config.enableAutoCollectRequests==null&&(yt.defaultClient.config.enableAutoCollectRequests=!0),yt.defaultClient.config.enableAutoCollectDependencies==null&&(yt.defaultClient.config.enableAutoCollectDependencies=!0),yt.defaultClient.config.enableUseDiskRetryCaching==null&&(yt.defaultClient.config.enableUseDiskRetryCaching=!0),yt.defaultClient.config.enableAutoDependencyCorrelation==null&&(yt.defaultClient.config.enableAutoDependencyCorrelation=!0),yt.defaultClient.config.enableSendLiveMetrics==null&&(yt.defaultClient.config.enableSendLiveMetrics=!1),yt.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(yt.defaultClient.config.enableAutoCollectExtendedMetrics=!0),yt.defaultClient.config.enableWebInstrumentation==null&&(yt.defaultClient.config.enableWebInstrumentation=!1),yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(MRa,"_setDefaultConfig");function mTi(){if(yt.defaultClient){JT=!0,MRa(),n5e.enable(yt.defaultClient.config.enableAutoCollectExternalLoggers,yt.defaultClient.config.enableAutoCollectConsole),i5e.enable(yt.defaultClient.config.enableAutoCollectExceptions),o5e.enable(yt.defaultClient.config.enableAutoCollectPerformance),s5e.enable(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics),a5e.enable(yt.defaultClient.config.enableAutoCollectHeartbeat),mte.useAutoCorrelation(yt.defaultClient.config.enableAutoDependencyCorrelation,yt.defaultClient.config.enableUseAsyncHooks),mte.enable(yt.defaultClient.config.enableAutoCollectRequests),c5e.enable(yt.defaultClient.config.enableAutoCollectDependencies),Sge.enable(yt.defaultClient.config.enableWebInstrumentation,yt.defaultClient.config.webInstrumentationConnectionString),yt.defaultClient.config.enableSendLiveMetrics&&(yt.liveMetricsClient||(yt.liveMetricsClient=new hTi(yt.defaultClient.config,yt.defaultClient.context,yt.defaultClient.getAuthorizationHandler,yt.defaultClient),w0t=new bvr(yt.liveMetricsClient,1e3,!0),yt.liveMetricsClient.addCollector(w0t),yt.defaultClient.quickPulseClient=yt.liveMetricsClient),yt.liveMetricsClient.enable(yt.defaultClient.config.enableSendLiveMetrics)),l5e.enable(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=Svr.AutoCollectNativePerformance.parseEnabled(yt.defaultClient.config.enableAutoCollectExtendedMetrics,yt.defaultClient.config);Tge.enable(yt.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),yt.defaultClient&&yt.defaultClient.channel&&yt.defaultClient.channel.setUseDiskRetryCaching(yt.defaultClient.config.enableUseDiskRetryCaching,yt.defaultClient.config.enableResendInterval,yt.defaultClient.config.enableMaxBytesOnDisk)}else r5e.warn("Start cannot be called before setup");return Tvr}a(mTi,"start");function ORa(){return Cvr.CorrelationContextManager.getCurrentContext()}a(ORa,"getCorrelationContext");function LRa(t,e){return Cvr.CorrelationContextManager.startOperation(t,e)}a(LRa,"startOperation");function BRa(t,e){return Cvr.CorrelationContextManager.wrapCallback(t,e)}a(BRa,"wrapWithCorrelationContext");var Tvr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return pTi.w3cEnabled=e===vvr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExternalLoggers=e,yt.defaultClient.config.enableAutoCollectConsole=r,JT&&n5e.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExceptions=e,JT&&i5e.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),yt.defaultClient){yt.defaultClient.config.enableAutoCollectPerformance=e;var n=Svr.AutoCollectNativePerformance.parseEnabled(r,yt.defaultClient.config);yt.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,JT&&(o5e.enable(e),Tge.enable(yt.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,JT&&s5e.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectHeartbeat=e,JT&&a5e.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableWebInstrumentation=e,yt.defaultClient.config.webInstrumentationConnectionString=r,JT&&Sge.enable(yt.defaultClient.config.enableAutoWebSnippetInjection,yt.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableWebInstrumentation=e,yt.defaultClient.config.webInstrumentationConnectionString=r,JT&&Sge.enable(yt.defaultClient.config.enableWebInstrumentation,yt.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectRequests=e,JT&&mte.enable(e)),t},t.setAutoCollectDependencies=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectDependencies=e,JT&&c5e.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableAutoDependencyCorrelation=e,yt.defaultClient.config.enableUseAsyncHooks=r,JT&&mte.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return yt.defaultClient&&(yt.defaultClient.config.enableUseDiskRetryCaching=e,yt.defaultClient.config.enableResendInterval=r,yt.defaultClient.config.enableMaxBytesOnDisk=n,yt.defaultClient.channel&&yt.defaultClient.channel.setUseDiskRetryCaching(yt.defaultClient.config.enableUseDiskRetryCaching,yt.defaultClient.config.enableResendInterval,yt.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),r5e.enableDebug=e,r5e.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,JT&&l5e.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),yt.defaultClient?(!yt.liveMetricsClient&&e?(yt.liveMetricsClient=new hTi(yt.defaultClient.config,yt.defaultClient.context,yt.defaultClient.getAuthorizationHandler,yt.defaultClient),w0t=new bvr(yt.liveMetricsClient,1e3,!0),yt.liveMetricsClient.addCollector(w0t),yt.defaultClient.quickPulseClient=yt.liveMetricsClient):yt.liveMetricsClient&&yt.liveMetricsClient.enable(e),yt.defaultClient.config.enableSendLiveMetrics=e,t):(r5e.warn("Live metrics client cannot be setup without the default client"),t)},t.start=mTi,t})();yt.Configuration=Tvr;function FRa(){pTi.w3cEnabled=!0,yt.defaultClient=null,JT=!1,n5e&&n5e.dispose(),i5e&&i5e.dispose(),o5e&&o5e.dispose(),s5e&&s5e.dispose(),a5e&&a5e.dispose(),Sge&&Sge.dispose(),Tge&&Tge.dispose(),mte&&mte.dispose(),c5e&&c5e.dispose(),yt.liveMetricsClient&&(yt.liveMetricsClient.enable(!1),yt.liveMetricsClient=void 0),l5e&&l5e.dispose()}a(FRa,"dispose")});var xvr=I(IR=>{"use strict";p();var URa=IR&&IR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QRa=IR&&IR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ATi=IR&&IR.__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 GRa(e)?yTi(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};IR.AzureInsightReporter=Ivr;function $Ra(t,e,r){let n=new qRa.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,ETi(t,e,n),n}a($Ra,"createAppInsightsClient");function ETi(t,e,r){r.commonProperties=VRa(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(ETi,"configureReporter");function VRa(t,e){return t=t||{},t.common_os=R0t.platform(),t.common_platformversion=R0t.release(),t.common_arch=R0t.arch(),t.common_cpu=Array.from(new Set(R0t.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(VRa,"decorateWithCommonProperties")});var _Ti=I((Qvp,WRa)=>{WRa.exports={name:"copilot-chat",displayName:"GitHub Copilot Chat",description:"AI chat features powered by Copilot",version:"0.54.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.126.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. @@ -760,51 +760,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",markdownDescription:"Enable OpenTelemetry trace/metric/log emission for Copilot Chat operations. Configurable in user settings only. Env var `COPILOT_OTEL_ENABLED` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.exporterType":{type:"string",enum:["otlp-grpc","otlp-http","console","file"],default:"otlp-http",scope:"application",markdownDescription:"OTel exporter type for Copilot Chat telemetry. Configurable in user settings only. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.otlpEndpoint":{type:"string",default:"http://localhost:4318",scope:"application",markdownDescription:"OTLP collector endpoint URL for Copilot Chat OTel data. Configurable in user settings only. Env var `OTEL_EXPORTER_OTLP_ENDPOINT` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.captureContent":{type:"boolean",default:!1,scope:"application",markdownDescription:"Capture input/output messages, system instructions, and tool definitions in OTel telemetry. **Contains potentially sensitive data.** Configurable in user settings only. Env var `COPILOT_OTEL_CAPTURE_CONTENT` takes precedence. 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",markdownDescription:"File path for file-based OTel exporter output (JSON-lines). When set, overrides exporter type to `file`. Configurable in user settings only. 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:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == workspace && !sessions.hasGitRepository && !sessions.isAgentHostSession",group:"0_init@1"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",when:"chatSessionType == 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:"chatSessionType == 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:"chatSessionType == 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:"chatSessionType == 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:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@1"},{command:"github.copilot.sessions.commitAndSync",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@2"},{command:"github.copilot.sessions.sync",when:"chatSessionType == 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:"chatSessionType == claude-code && isSessionsWindow && !sessions.hasGitRepository",group:"init@1"},{command:"github.copilot.claude.sessions.commit",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges",group:"commit@1"},{command:"github.copilot.claude.sessions.commitAndSync",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && sessions.hasUpstream",group:"commit@2"},{command:"github.copilot.claude.sessions.sync",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && !sessions.hasUncommittedChanges && sessions.hasUpstream",group:"sync@1"}],"agents/change/inline":[{command:"github.copilot.sessions.discardChanges",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && !isActiveSessionArchived && !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:"chatSessionType == claude-code && chatSessionProviderId == default-copilot",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli && chatSessionProviderId == 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:"chatSessionType == 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,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,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,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.80","@vscode/vsce":"3.6.0",copyfiles:"^2.4.1","csv-parse":"^6.0.0",dotenv:"^17.2.0",electron:"^39.8.5",esbuild:"0.28.1",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.1.1",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.58.2",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.64-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.214.0","@opentelemetry/exporter-logs-otlp-http":"^0.214.0","@opentelemetry/exporter-metrics-otlp-grpc":"^0.214.0","@opentelemetry/exporter-metrics-otlp-http":"^0.214.0","@opentelemetry/exporter-trace-otlp-grpc":"^0.214.0","@opentelemetry/exporter-trace-otlp-http":"^0.214.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.1.1",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",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"}}});var c5e=I(Vb=>{"use strict";p();Object.defineProperty(Vb,"__esModule",{value:!0});Vb.vscodeEngineVersion=Vb.isPreRelease=Vb.isProduction=Vb.packageJson=void 0;Vb.packageJson=gTi();Vb.isProduction=Vb.packageJson.buildType!=="dev";Vb.isPreRelease=Vb.packageJson.isPreRelease||!Vb.isProduction;Vb.vscodeEngineVersion=Vb.packageJson.engines.vscode});var U4=I(Wb=>{"use strict";p();Object.defineProperty(Wb,"__esModule",{value:!0});Wb.isScenarioAutomation=Wb.AbstractEnvService=Wb.INativeEnvService=Wb.IEnvService=Wb.NameAndVersion=Wb.OperatingSystem=void 0;var yTi=nn(),ETi=owe(),Tge=c5e(),ATi;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(ATi||(Wb.OperatingSystem=ATi={}));var xvr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};Wb.NameAndVersion=xvr;Wb.IEnvService=(0,yTi.createServiceIdentifier)("IEnvService");Wb.INativeEnvService=(0,yTi.createServiceIdentifier)("INativeEnvService");var wvr=class{static{a(this,"AbstractEnvService")}isProduction(){return Tge.isProduction}isPreRelease(){return Tge.isPreRelease}isSimulation(){return ETi.env.SIMULATION==="1"}getBuildType(){return Tge.packageJson.buildType}getVersion(){return Tge.packageJson.version}getBuild(){return Tge.packageJson.build}getName(){return Tge.packageJson.name}getEditorVersionHeaders(){return{"Editor-Version":this.getEditorInfo().format(),"Editor-Plugin-Version":this.getEditorPluginInfo().format()}}};Wb.AbstractEnvService=wvr;Wb.isScenarioAutomation=ETi.env.IS_SCENARIO_AUTOMATION==="1"});var T0=I(gte=>{"use strict";p();Object.defineProperty(gte,"__esModule",{value:!0});gte.generateUuid=void 0;gte.isUUID=HRa;gte.prefixedUuid=GRa;var jRa=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function HRa(t){return jRa.test(t)}a(HRa,"isUUID");gte.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 GRa(t){return`${t}-${(0,gte.generateUuid)()}`}a(GRa,"prefixedUuid")});var _Ti=I(R0t=>{"use strict";p();Object.defineProperty(R0t,"__esModule",{value:!0});R0t.CopilotConfigPrefix=void 0;R0t.CopilotConfigPrefix="github.copilot"});var kvr=I(cD=>{"use strict";p();var $Ra=cD&&cD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VRa=cD&&cD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),WRa=cD&&cD.__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(YRa,"transformEvent")});var LE=I(hn=>{"use strict";p();Object.defineProperty(hn,"__esModule",{value:!0});hn.apiVersion=hn.ICompletionsEditorAndPluginInfo=hn.BuildInfo=hn.InMemoryConfigProvider=hn.DefaultsOnlyConfigProvider=hn.ConfigProvider=hn.ICompletionsConfigProvider=hn.BuildType=hn.BlockMode=hn.ConfigKey=hn.packageJson=void 0;hn.shouldDoServerTrimming=ZRa;hn.getConfigKeyRecursively=XRa;hn.getConfigDefaultForKey=CTi;hn.getOptionalConfigDefaultForKey=bTi;hn.getConfig=eka;hn.dumpForTelemetry=tka;hn.formatNameAndVersion=Mvr;hn.editorVersionHeaders=rka;var k0t=c5e();Object.defineProperty(hn,"packageJson",{enumerable:!0,get:a(function(){return k0t.packageJson},"get")});var vTi=nn(),KRa=_Ti(),JRa=kvr();hn.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"};var P0t;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(P0t||(hn.BlockMode=P0t={}));function ZRa(t){return[P0t.Server,P0t.ParsingAndServer].includes(t)}a(ZRa,"shouldDoServerTrimming");var Ate;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(Ate||(hn.BuildType=Ate={}));hn.ICompletionsConfigProvider=(0,vTi.createServiceIdentifier)("ICompletionsConfigProvider");var l5e=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};hn.ConfigProvider=l5e;var Pvr=class extends l5e{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return CTi(e)}getOptionalConfig(e){return bTi(e)}dumpForTelemetry(){return{}}};hn.DefaultsOnlyConfigProvider=Pvr;var Dvr=class extends l5e{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new JRa.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[hn.ConfigKey.ShowEditorCompletions,hn.ConfigKey.EnableAutoCompletions,hn.ConfigKey.DelayCompletions,hn.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};hn.InMemoryConfigProvider=Dvr;function XRa(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(XRa,"getConfigKeyRecursively");function CTi(t){if(Nvr.has(t))return Nvr.get(t);throw new Error(`Missing config default value: ${KRa.CopilotConfigPrefix}.${t}`)}a(CTi,"getConfigDefaultForKey");function bTi(t){return Nvr.get(t)}a(bTi,"getOptionalConfigDefaultForKey");var Nvr=new Map([[hn.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[hn.ConfigKey.RelatedFilesVSCodeCSharp,!1],[hn.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[hn.ConfigKey.RelatedFilesVSCode,!1],[hn.ConfigKey.IncludeNeighboringFiles,!1],[hn.ConfigKey.ExcludeRelatedFiles,!1],[hn.ConfigKey.ContextProviders,[]],[hn.ConfigKey.DebugSnippyOverrideUrl,""],[hn.ConfigKey.UseSubsetMatching,null],[hn.ConfigKey.ContextProviderTimeBudget,void 0],[hn.ConfigKey.DebugOverrideCapiUrl,""],[hn.ConfigKey.DebugTestOverrideCapiUrl,""],[hn.ConfigKey.DebugOverrideProxyUrl,""],[hn.ConfigKey.DebugTestOverrideProxyUrl,""],[hn.ConfigKey.DebugOverrideEngine,""],[hn.ConfigKey.AlwaysRequestMultiline,void 0],[hn.ConfigKey.CompletionsDebounce,void 0],[hn.ConfigKey.CompletionsDelay,void 0],[hn.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[hn.ConfigKey.UseWorkspaceContextCoordinator,void 0],[hn.ConfigKey.ShowEditorCompletions,void 0],[hn.ConfigKey.EnableAutoCompletions,void 0],[hn.ConfigKey.DelayCompletions,void 0],[hn.ConfigKey.FilterCompletions,void 0],[hn.ConfigKey.UseSplitContextPrompt,!0],[hn.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[hn.ConfigKey.UserSelectedCompletionModel,""],[hn.ConfigKey.DebugOverrideEngineLegacy,""],[hn.ConfigKey.DebugOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugFilterLogCategories,[]]]);function eka(t,e){return t.get(hn.ICompletionsConfigProvider).getConfig(e)}a(eka,"getConfig");function tka(t){try{return t.get(hn.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(tka,"dumpForTelemetry");var D0t=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===Ate.NIGHTLY}static isProduction(){return this.getBuildType()!==Ate.DEV}static getBuildType(){return k0t.packageJson.buildType==="prod"?t.getVersion().length===15?Ate.NIGHTLY:Ate.PROD:Ate.DEV}static getVersion(){return k0t.packageJson.version}static getBuild(){return k0t.packageJson.build}};hn.BuildInfo=D0t;function Mvr({name:t,version:e}){return`${t}/${e}`}a(Mvr,"formatNameAndVersion");hn.ICompletionsEditorAndPluginInfo=(0,vTi.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");hn.apiVersion="2025-05-01";function rka(t){let e=t.get(hn.ICompletionsEditorAndPluginInfo);return{"Editor-Version":Mvr(e.getEditorInfo()),"Editor-Plugin-Version":Mvr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":D0t.getVersion()}}a(rka,"editorVersionHeaders")});var Ovr=I(N0t=>{"use strict";p();Object.defineProperty(N0t,"__esModule",{value:!0});N0t.ExpServiceTelemetryNames=void 0;var STi;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(STi||(N0t.ExpServiceTelemetryNames=STi={}))});var M0t=I(Ige=>{"use strict";p();Object.defineProperty(Ige,"__esModule",{value:!0});Ige.ExpConfig=Ige.ExpTreatmentVariables=void 0;var nka=$g(),ika=Ovr(),TTi;(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"})(TTi||(Ige.ExpTreatmentVariables=TTi={}));var Lvr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,nka.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[ika.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};Ige.ExpConfig=Lvr});var fy=I(O0t=>{"use strict";p();Object.defineProperty(O0t,"__esModule",{value:!0});O0t.ICompletionsFeaturesService=void 0;var oka=nn();O0t.ICompletionsFeaturesService=(0,oka.createServiceIdentifier)("ICompletionsFeaturesService")});var L0t=I(wG=>{"use strict";p();Object.defineProperty(wG,"__esModule",{value:!0});wG.FilterSettings=wG.Release=wG.Filter=void 0;var yte;(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"})(yte||(wG.Filter=yte={}));var ITi;(function(t){t.Stable="stable",t.Nightly="nightly"})(ITi||(wG.Release=ITi={}));var ska={[yte.CopilotClientTimeBucket]:"timeBucket",[yte.CopilotOverrideEngine]:"engine",[yte.CopilotRepository]:"repo",[yte.CopilotFileType]:"fileType",[yte.CopilotUserKind]:"userKind"},Bvr=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=ska[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};wG.FilterSettings=Bvr});var RTi=I(xge=>{"use strict";p();Object.defineProperty(xge,"__esModule",{value:!0});xge.JointCompletionsProviderTriggerChangeStrategy=xge.JointCompletionsProviderStrategy=void 0;var xTi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(xTi||(xge.JointCompletionsProviderStrategy=xTi={}));var wTi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(wTi||(xge.JointCompletionsProviderTriggerChangeStrategy=wTi={}))});var RG=I(I0=>{"use strict";p();Object.defineProperty(I0,"__esModule",{value:!0});I0.vString=cka;I0.vNumber=uka;I0.vBoolean=fka;I0.vObjAny=hka;I0.vUndefined=gka;I0.vNull=Aka;I0.vNullable=yka;I0.vUnchecked=PTi;I0.vUnknown=Eka;I0.vRequired=_ka;I0.vObj=vka;I0.vArray=Cka;I0.vTuple=bka;I0.vUnion=DTi;I0.vEnum=Ska;I0.vLiteral=Tka;I0.vLazy=Ika;var Ete=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}}},aka=new Ete("string");function cka(){return aka}a(cka,"vString");var lka=new Ete("number");function uka(){return lka}a(uka,"vNumber");var dka=new Ete("boolean");function fka(){return dka}a(fka,"vBoolean");var pka=new Ete("object");function hka(){return pka}a(hka,"vObjAny");var mka=new Ete("undefined");function gka(){return mka}a(gka,"vUndefined");var Fvr=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"}}},kTi=new Fvr;function Aka(){return kTi}a(Aka,"vNull");function yka(t){return DTi(t,kTi)}a(yka,"vNullable");function PTi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(PTi,"vUnchecked");function Eka(){return PTi()}a(Eka,"vUnknown");function _ka(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(_ka,"vRequired");function vka(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(vka,"vObj");function Cka(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(bka,"vTuple");function DTi(...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(DTi,"vUnion");function Ska(...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(Ska,"vEnum");function Tka(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(Tka,"vLiteral");function Ika(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(Ika,"vLazy")});var NTi=I(u5e=>{"use strict";p();Object.defineProperty(u5e,"__esModule",{value:!0});u5e.DocumentSwitchTriggerStrategy=void 0;var xka=RG(),B0t;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(B0t||(u5e.DocumentSwitchTriggerStrategy=B0t={}));(function(t){t.VALIDATOR=(0,xka.vEnum)(t.Always,t.AfterAcceptance)})(B0t||(u5e.DocumentSwitchTriggerStrategy=B0t={}))});var Uvr=I(d5e=>{"use strict";p();Object.defineProperty(d5e,"__esModule",{value:!0});d5e.DiffHistoryMergeStrategy=void 0;var wka=RG(),F0t;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(F0t||(d5e.DiffHistoryMergeStrategy=F0t={}));(function(t){t.VALIDATOR=(0,wka.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(F0t||(d5e.DiffHistoryMergeStrategy=F0t={}))});var Q0t=I(f5e=>{"use strict";p();Object.defineProperty(f5e,"__esModule",{value:!0});f5e.ImportChanges=void 0;var Rka=RG(),U0t;(function(t){t.All="all",t.None="none"})(U0t||(f5e.ImportChanges=U0t={}));(function(t){t.VALIDATOR=(0,Rka.vEnum)(t.All,t.None)})(U0t||(f5e.ImportChanges=U0t={}))});var py=I(mn=>{"use strict";p();Object.defineProperty(mn,"__esModule",{value:!0});mn.PatchModelPrediction=mn.SpeculativeRequestsAutoExpandEditWindowLines=mn.SpeculativeRequestsCursorPlacement=mn.DuplicateAdditionsMode=mn.SpeculativeRequestsEnablement=mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=mn.MODEL_CONFIGURATION_VALIDATOR=mn.LINT_OPTIONS_VALIDATOR=mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=mn.DEFAULT_OPTIONS=mn.ResponseFormat=mn.PromptingStrategy=mn.EditIntent=mn.EarlyDivergenceCancellationMode=mn.AggressivenessLevel=mn.AggressivenessSetting=mn.LintOptionShowCode=mn.LintOptionWarning=mn.CurrentFileOptions=mn.GlobalBudgetOptions=mn.NeighborFilesOptions=mn.RecentlyViewedDocumentsOptions=mn.RecentFileClippingStrategy=mn.IncludeLineNumbersOption=void 0;mn.isPromptingStrategy=kka;mn.isAggressivenessStrategy=Pka;mn.applyStrategyConfig=Nka;mn.parseLintOptionString=Mka;mn.parseUserHappinessScoreConfigurationString=Oka;var BTi=rd(),pn=RG(),Qvr=Q0t(),zb;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(zb||(mn.IncludeLineNumbersOption=zb={}));var _te;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(_te||(mn.RecentFileClippingStrategy=_te={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.AroundEditRange,t.Proportional)})(_te||(mn.RecentFileClippingStrategy=_te={}));var qvr;(function(t){t.VALIDATOR=(0,pn.vObj)({nDocuments:(0,pn.vNumber)(),maxTokens:(0,pn.vNumber)(),includeViewedFiles:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(zb.WithSpaceAfter,zb.WithoutSpace,zb.None),clippingStrategy:(0,pn.vEnum)(_te.AroundEditRange,_te.Proportional),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})(qvr||(mn.RecentlyViewedDocumentsOptions=qvr={}));var MTi;(function(t){t.VALIDATOR=(0,pn.vObj)({enabled:(0,pn.vBoolean)(),maxTokens:(0,pn.vNumber)()})})(MTi||(mn.NeighborFilesOptions=MTi={}));var OTi;(function(t){t.DEFAULT_ORDER=["languageContext","recentlyViewedDocuments","neighborFiles","diffHistory"],t.DEFAULT_SHARES={recentlyViewedDocuments:2/6,languageContext:2/6,neighborFiles:1/6,diffHistory:1/6},t.DEFAULT_TOTAL_TOKENS=6e3})(OTi||(mn.GlobalBudgetOptions=OTi={}));var jvr;(function(t){t.VALIDATOR=(0,pn.vObj)({maxTokens:(0,pn.vNumber)(),includeTags:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(zb.WithSpaceAfter,zb.WithoutSpace,zb.None),includeCursorTag:(0,pn.vBoolean)(),prioritizeAboveCursor:(0,pn.vBoolean)(),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})(jvr||(mn.CurrentFileOptions=jvr={}));var wge;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(wge||(mn.LintOptionWarning=wge={}));var Rge;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(Rge||(mn.LintOptionShowCode=Rge={}));var q0t;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(q0t||(mn.AggressivenessSetting=q0t={}));var kG;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(kG||(mn.AggressivenessLevel=kG={}));var j0t;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(j0t||(mn.EarlyDivergenceCancellationMode=j0t={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Cursor,t.EditWindow,t.Off)})(j0t||(mn.EarlyDivergenceCancellationMode=j0t={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return kG.Low;case t.Medium:return kG.Medium;case t.High:return kG.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(q0t||(mn.AggressivenessSetting=q0t={}));var H0t;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(H0t||(mn.EditIntent=H0t={}));(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===kG.Medium||s===kG.High;case t.Low:return s===kG.High;default:(0,BTi.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(H0t||(mn.EditIntent=H0t={}));var kl;(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"})(kl||(mn.PromptingStrategy=kl={}));function kka(t){return Object.values(kl).includes(t)}a(kka,"isPromptingStrategy");function Pka(t){return t===kl.XtabAggressiveness||t===kl.Xtab275Aggressiveness||t===kl.Xtab275AggressivenessHighLow||t===kl.Xtab275EditIntent||t===kl.Xtab275EditIntentShort}a(Pka,"isAggressivenessStrategy");var G0t;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})(G0t||(mn.ResponseFormat=G0t={}));(function(t){function e(r){switch(r){case kl.UnifiedModel:case kl.Codexv21NesUnified:case kl.Nes41Miniv3:return t.UnifiedWithXml;case kl.Xtab275:case kl.XtabAggressiveness:case kl.Xtab275Aggressiveness:case kl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case kl.PatchBased:case kl.PatchBased01:case kl.PatchBased02:case kl.PatchBased02WithRecentLineNumbers:case kl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case kl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case kl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case kl.SimplifiedSystemPrompt:case kl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,BTi.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})(G0t||(mn.ResponseFormat=G0t={}));mn.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:1500,includeTags:!0,includeLineNumbers:zb.None,includeCursorTag:!1,prioritizeAboveCursor:!1,useLeftoverBudgetFromAbove:!0},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:zb.None,clippingStrategy:_te.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};mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:Rge.YES_WITH_SURROUNDING,tagName:"linter",warnings:wge.YES_IF_NO_ERRORS,nRecentFiles:0};mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var Dka={[kl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[kl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:zb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:zb.WithoutSpace},supportsNextCursorLinePrediction:!1,allowImportChanges:Qvr.ImportChanges.All},[kl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:zb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:zb.None},supportsNextCursorLinePrediction:!1,allowImportChanges:Qvr.ImportChanges.All}};function Nka(t){let e=t.promptingStrategy===void 0?void 0:Dka[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(Nka,"applyStrategyConfig");mn.LINT_OPTIONS_VALIDATOR=(0,pn.vObj)({tagName:(0,pn.vString)(),warnings:(0,pn.vEnum)(wge.YES,wge.NO,wge.YES_IF_NO_ERRORS),showCode:(0,pn.vEnum)(Rge.NO,Rge.YES,Rge.YES_WITH_SURROUNDING),maxLints:(0,pn.vNumber)(),maxLineDistance:(0,pn.vNumber)(),nRecentFiles:(0,pn.vNumber)()});mn.MODEL_CONFIGURATION_VALIDATOR=(0,pn.vObj)({modelName:(0,pn.vRequired)((0,pn.vString)()),promptingStrategy:(0,pn.vUnion)((0,pn.vEnum)(...Object.values(kl)),(0,pn.vUndefined)()),includeTagsInCurrentFile:(0,pn.vRequired)((0,pn.vBoolean)()),includePostScript:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),currentFile:(0,pn.vUnion)(jvr.VALIDATOR,(0,pn.vUndefined)()),recentlyViewedDocuments:(0,pn.vUnion)(qvr.VALIDATOR,(0,pn.vUndefined)()),lintOptions:(0,pn.vUnion)(mn.LINT_OPTIONS_VALIDATOR,(0,pn.vUndefined)()),supportsNextCursorLinePrediction:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),allowImportChanges:(0,pn.vUnion)(Qvr.ImportChanges.VALIDATOR,(0,pn.vUndefined)())});function Mka(t,e){try{let r=JSON.parse(t),n=mn.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(Mka,"parseLintOptionString");mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var LTi=(0,pn.vObj)({acceptedScore:(0,pn.vRequired)((0,pn.vNumber)()),rejectedScore:(0,pn.vRequired)((0,pn.vNumber)()),ignoredScore:(0,pn.vRequired)((0,pn.vNumber)()),highThreshold:(0,pn.vRequired)((0,pn.vNumber)()),mediumThreshold:(0,pn.vRequired)((0,pn.vNumber)()),includeIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),ignoredLimit:(0,pn.vRequired)((0,pn.vNumber)()),limitConsecutiveIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),limitTotalIgnored:(0,pn.vRequired)((0,pn.vBoolean)())});function p5e(t,e,r){return t>=e&&t<=r}a(p5e,"isInRange");mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=LTi.validate(t);if(e.error)return e;let r=e.content;return p5e(r.acceptedScore,0,1)?p5e(r.rejectedScore,0,1)?p5e(r.ignoredScore,0,1)?p5e(r.highThreshold,0,1)?p5e(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(kge,"__esModule",{value:!0});kge.TextReplacement=kge.TextEdit=void 0;var FTi=Sl(),UTi=rd(),Z0t=Rs(),K0t=em(),PG=q_(),_m=eh(),X0t=Tme(),QTi=qT(),egt=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>Tv.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new Tv(e,r)])}static delete(e){return new t([new Tv(e,"")])}static insert(e,r){return new t([new Tv(_m.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,FTi.compareBy)(n=>n.range,_m.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,UTi.assertFn)(()=>(0,UTi.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 Tv(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=X0t.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new PG.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return J0t(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 PG.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof PG.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof PG.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return J0t(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 PG.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=J0t(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=J0t(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new QTi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new Tv(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=X0t.TextLength.ofText(s.text),l=PG.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 Z0t.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,E=!1,_=1,v=1;function b(){if(!y)if(sr.toString()).join(` -`):typeof e=="string"?this.toString(new QTi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=_m.Range.fromPositions(new PG.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=_m.Range.fromPositions(r.range.getEndPosition(),new PG.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(` -`)}};kge.TextEdit=egt;var Tv=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Z0t.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 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:"chatSessionType == claude-code && chatSessionProviderId == default-copilot",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli && chatSessionProviderId == 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:"chatSessionType == 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,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,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,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.80","@vscode/vsce":"3.6.0",copyfiles:"^2.4.1","csv-parse":"^6.0.0",dotenv:"^17.2.0",electron:"^39.8.5",esbuild:"0.28.1",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.1.1",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.58.2",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.64-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.214.0","@opentelemetry/exporter-logs-otlp-http":"^0.214.0","@opentelemetry/exporter-metrics-otlp-grpc":"^0.214.0","@opentelemetry/exporter-metrics-otlp-http":"^0.214.0","@opentelemetry/exporter-trace-otlp-grpc":"^0.214.0","@opentelemetry/exporter-trace-otlp-http":"^0.214.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.1.1",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",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"}}});var u5e=I(Vb=>{"use strict";p();Object.defineProperty(Vb,"__esModule",{value:!0});Vb.vscodeEngineVersion=Vb.isPreRelease=Vb.isProduction=Vb.packageJson=void 0;Vb.packageJson=_Ti();Vb.isProduction=Vb.packageJson.buildType!=="dev";Vb.isPreRelease=Vb.packageJson.isPreRelease||!Vb.isProduction;Vb.vscodeEngineVersion=Vb.packageJson.engines.vscode});var U4=I(Wb=>{"use strict";p();Object.defineProperty(Wb,"__esModule",{value:!0});Wb.isScenarioAutomation=Wb.AbstractEnvService=Wb.INativeEnvService=Wb.IEnvService=Wb.NameAndVersion=Wb.OperatingSystem=void 0;var CTi=nn(),bTi=owe(),Ige=u5e(),vTi;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(vTi||(Wb.OperatingSystem=vTi={}));var wvr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};Wb.NameAndVersion=wvr;Wb.IEnvService=(0,CTi.createServiceIdentifier)("IEnvService");Wb.INativeEnvService=(0,CTi.createServiceIdentifier)("INativeEnvService");var Rvr=class{static{a(this,"AbstractEnvService")}isProduction(){return Ige.isProduction}isPreRelease(){return Ige.isPreRelease}isSimulation(){return bTi.env.SIMULATION==="1"}getBuildType(){return Ige.packageJson.buildType}getVersion(){return Ige.packageJson.version}getBuild(){return Ige.packageJson.build}getName(){return Ige.packageJson.name}getEditorVersionHeaders(){return{"Editor-Version":this.getEditorInfo().format(),"Editor-Plugin-Version":this.getEditorPluginInfo().format()}}};Wb.AbstractEnvService=Rvr;Wb.isScenarioAutomation=bTi.env.IS_SCENARIO_AUTOMATION==="1"});var T0=I(gte=>{"use strict";p();Object.defineProperty(gte,"__esModule",{value:!0});gte.generateUuid=void 0;gte.isUUID=YRa;gte.prefixedUuid=KRa;var zRa=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function YRa(t){return zRa.test(t)}a(YRa,"isUUID");gte.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 KRa(t){return`${t}-${(0,gte.generateUuid)()}`}a(KRa,"prefixedUuid")});var STi=I(k0t=>{"use strict";p();Object.defineProperty(k0t,"__esModule",{value:!0});k0t.CopilotConfigPrefix=void 0;k0t.CopilotConfigPrefix="github.copilot"});var Pvr=I(lD=>{"use strict";p();var JRa=lD&&lD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZRa=lD&&lD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),XRa=lD&&lD.__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(tka,"transformEvent")});var LE=I(hn=>{"use strict";p();Object.defineProperty(hn,"__esModule",{value:!0});hn.apiVersion=hn.ICompletionsEditorAndPluginInfo=hn.BuildInfo=hn.InMemoryConfigProvider=hn.DefaultsOnlyConfigProvider=hn.ConfigProvider=hn.ICompletionsConfigProvider=hn.BuildType=hn.BlockMode=hn.ConfigKey=hn.packageJson=void 0;hn.shouldDoServerTrimming=ika;hn.getConfigKeyRecursively=oka;hn.getConfigDefaultForKey=ITi;hn.getOptionalConfigDefaultForKey=xTi;hn.getConfig=ska;hn.dumpForTelemetry=aka;hn.formatNameAndVersion=Ovr;hn.editorVersionHeaders=cka;var P0t=u5e();Object.defineProperty(hn,"packageJson",{enumerable:!0,get:a(function(){return P0t.packageJson},"get")});var TTi=nn(),rka=STi(),nka=Pvr();hn.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"};var D0t;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(D0t||(hn.BlockMode=D0t={}));function ika(t){return[D0t.Server,D0t.ParsingAndServer].includes(t)}a(ika,"shouldDoServerTrimming");var Ate;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(Ate||(hn.BuildType=Ate={}));hn.ICompletionsConfigProvider=(0,TTi.createServiceIdentifier)("ICompletionsConfigProvider");var d5e=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};hn.ConfigProvider=d5e;var Dvr=class extends d5e{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return ITi(e)}getOptionalConfig(e){return xTi(e)}dumpForTelemetry(){return{}}};hn.DefaultsOnlyConfigProvider=Dvr;var Nvr=class extends d5e{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new nka.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[hn.ConfigKey.ShowEditorCompletions,hn.ConfigKey.EnableAutoCompletions,hn.ConfigKey.DelayCompletions,hn.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};hn.InMemoryConfigProvider=Nvr;function oka(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(oka,"getConfigKeyRecursively");function ITi(t){if(Mvr.has(t))return Mvr.get(t);throw new Error(`Missing config default value: ${rka.CopilotConfigPrefix}.${t}`)}a(ITi,"getConfigDefaultForKey");function xTi(t){return Mvr.get(t)}a(xTi,"getOptionalConfigDefaultForKey");var Mvr=new Map([[hn.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[hn.ConfigKey.RelatedFilesVSCodeCSharp,!1],[hn.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[hn.ConfigKey.RelatedFilesVSCode,!1],[hn.ConfigKey.IncludeNeighboringFiles,!1],[hn.ConfigKey.ExcludeRelatedFiles,!1],[hn.ConfigKey.ContextProviders,[]],[hn.ConfigKey.DebugSnippyOverrideUrl,""],[hn.ConfigKey.UseSubsetMatching,null],[hn.ConfigKey.ContextProviderTimeBudget,void 0],[hn.ConfigKey.DebugOverrideCapiUrl,""],[hn.ConfigKey.DebugTestOverrideCapiUrl,""],[hn.ConfigKey.DebugOverrideProxyUrl,""],[hn.ConfigKey.DebugTestOverrideProxyUrl,""],[hn.ConfigKey.DebugOverrideEngine,""],[hn.ConfigKey.AlwaysRequestMultiline,void 0],[hn.ConfigKey.CompletionsDebounce,void 0],[hn.ConfigKey.CompletionsDelay,void 0],[hn.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[hn.ConfigKey.UseWorkspaceContextCoordinator,void 0],[hn.ConfigKey.ShowEditorCompletions,void 0],[hn.ConfigKey.EnableAutoCompletions,void 0],[hn.ConfigKey.DelayCompletions,void 0],[hn.ConfigKey.FilterCompletions,void 0],[hn.ConfigKey.UseSplitContextPrompt,!0],[hn.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[hn.ConfigKey.UserSelectedCompletionModel,""],[hn.ConfigKey.DebugOverrideEngineLegacy,""],[hn.ConfigKey.DebugOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugFilterLogCategories,[]]]);function ska(t,e){return t.get(hn.ICompletionsConfigProvider).getConfig(e)}a(ska,"getConfig");function aka(t){try{return t.get(hn.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(aka,"dumpForTelemetry");var N0t=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===Ate.NIGHTLY}static isProduction(){return this.getBuildType()!==Ate.DEV}static getBuildType(){return P0t.packageJson.buildType==="prod"?t.getVersion().length===15?Ate.NIGHTLY:Ate.PROD:Ate.DEV}static getVersion(){return P0t.packageJson.version}static getBuild(){return P0t.packageJson.build}};hn.BuildInfo=N0t;function Ovr({name:t,version:e}){return`${t}/${e}`}a(Ovr,"formatNameAndVersion");hn.ICompletionsEditorAndPluginInfo=(0,TTi.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");hn.apiVersion="2025-05-01";function cka(t){let e=t.get(hn.ICompletionsEditorAndPluginInfo);return{"Editor-Version":Ovr(e.getEditorInfo()),"Editor-Plugin-Version":Ovr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":N0t.getVersion()}}a(cka,"editorVersionHeaders")});var Lvr=I(M0t=>{"use strict";p();Object.defineProperty(M0t,"__esModule",{value:!0});M0t.ExpServiceTelemetryNames=void 0;var wTi;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(wTi||(M0t.ExpServiceTelemetryNames=wTi={}))});var O0t=I(xge=>{"use strict";p();Object.defineProperty(xge,"__esModule",{value:!0});xge.ExpConfig=xge.ExpTreatmentVariables=void 0;var lka=$g(),uka=Lvr(),RTi;(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"})(RTi||(xge.ExpTreatmentVariables=RTi={}));var Bvr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,lka.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[uka.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};xge.ExpConfig=Bvr});var fy=I(L0t=>{"use strict";p();Object.defineProperty(L0t,"__esModule",{value:!0});L0t.ICompletionsFeaturesService=void 0;var dka=nn();L0t.ICompletionsFeaturesService=(0,dka.createServiceIdentifier)("ICompletionsFeaturesService")});var B0t=I(RG=>{"use strict";p();Object.defineProperty(RG,"__esModule",{value:!0});RG.FilterSettings=RG.Release=RG.Filter=void 0;var yte;(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"})(yte||(RG.Filter=yte={}));var kTi;(function(t){t.Stable="stable",t.Nightly="nightly"})(kTi||(RG.Release=kTi={}));var fka={[yte.CopilotClientTimeBucket]:"timeBucket",[yte.CopilotOverrideEngine]:"engine",[yte.CopilotRepository]:"repo",[yte.CopilotFileType]:"fileType",[yte.CopilotUserKind]:"userKind"},Fvr=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=fka[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};RG.FilterSettings=Fvr});var NTi=I(wge=>{"use strict";p();Object.defineProperty(wge,"__esModule",{value:!0});wge.JointCompletionsProviderTriggerChangeStrategy=wge.JointCompletionsProviderStrategy=void 0;var PTi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(PTi||(wge.JointCompletionsProviderStrategy=PTi={}));var DTi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(DTi||(wge.JointCompletionsProviderTriggerChangeStrategy=DTi={}))});var kG=I(I0=>{"use strict";p();Object.defineProperty(I0,"__esModule",{value:!0});I0.vString=hka;I0.vNumber=gka;I0.vBoolean=yka;I0.vObjAny=_ka;I0.vUndefined=Cka;I0.vNull=bka;I0.vNullable=Ska;I0.vUnchecked=OTi;I0.vUnknown=Tka;I0.vRequired=Ika;I0.vObj=xka;I0.vArray=wka;I0.vTuple=Rka;I0.vUnion=LTi;I0.vEnum=kka;I0.vLiteral=Pka;I0.vLazy=Dka;var Ete=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}}},pka=new Ete("string");function hka(){return pka}a(hka,"vString");var mka=new Ete("number");function gka(){return mka}a(gka,"vNumber");var Aka=new Ete("boolean");function yka(){return Aka}a(yka,"vBoolean");var Eka=new Ete("object");function _ka(){return Eka}a(_ka,"vObjAny");var vka=new Ete("undefined");function Cka(){return vka}a(Cka,"vUndefined");var Uvr=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"}}},MTi=new Uvr;function bka(){return MTi}a(bka,"vNull");function Ska(t){return LTi(t,MTi)}a(Ska,"vNullable");function OTi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(OTi,"vUnchecked");function Tka(){return OTi()}a(Tka,"vUnknown");function Ika(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(Ika,"vRequired");function xka(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(xka,"vObj");function wka(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(Rka,"vTuple");function LTi(...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(LTi,"vUnion");function kka(...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(kka,"vEnum");function Pka(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(Pka,"vLiteral");function Dka(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(Dka,"vLazy")});var BTi=I(f5e=>{"use strict";p();Object.defineProperty(f5e,"__esModule",{value:!0});f5e.DocumentSwitchTriggerStrategy=void 0;var Nka=kG(),F0t;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(F0t||(f5e.DocumentSwitchTriggerStrategy=F0t={}));(function(t){t.VALIDATOR=(0,Nka.vEnum)(t.Always,t.AfterAcceptance)})(F0t||(f5e.DocumentSwitchTriggerStrategy=F0t={}))});var Qvr=I(p5e=>{"use strict";p();Object.defineProperty(p5e,"__esModule",{value:!0});p5e.DiffHistoryMergeStrategy=void 0;var Mka=kG(),U0t;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(U0t||(p5e.DiffHistoryMergeStrategy=U0t={}));(function(t){t.VALIDATOR=(0,Mka.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(U0t||(p5e.DiffHistoryMergeStrategy=U0t={}))});var q0t=I(h5e=>{"use strict";p();Object.defineProperty(h5e,"__esModule",{value:!0});h5e.ImportChanges=void 0;var Oka=kG(),Q0t;(function(t){t.All="all",t.None="none"})(Q0t||(h5e.ImportChanges=Q0t={}));(function(t){t.VALIDATOR=(0,Oka.vEnum)(t.All,t.None)})(Q0t||(h5e.ImportChanges=Q0t={}))});var py=I(mn=>{"use strict";p();Object.defineProperty(mn,"__esModule",{value:!0});mn.PatchModelPrediction=mn.SpeculativeRequestsAutoExpandEditWindowLines=mn.SpeculativeRequestsCursorPlacement=mn.DuplicateAdditionsMode=mn.SpeculativeRequestsEnablement=mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=mn.MODEL_CONFIGURATION_VALIDATOR=mn.LINT_OPTIONS_VALIDATOR=mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=mn.DEFAULT_OPTIONS=mn.ResponseFormat=mn.PromptingStrategy=mn.EditIntent=mn.EarlyDivergenceCancellationMode=mn.AggressivenessLevel=mn.AggressivenessSetting=mn.LintOptionShowCode=mn.LintOptionWarning=mn.CurrentFileOptions=mn.GlobalBudgetOptions=mn.NeighborFilesOptions=mn.RecentlyViewedDocumentsOptions=mn.RecentFileClippingStrategy=mn.IncludeLineNumbersOption=void 0;mn.isPromptingStrategy=Lka;mn.isAggressivenessStrategy=Bka;mn.applyStrategyConfig=Uka;mn.parseLintOptionString=Qka;mn.parseUserHappinessScoreConfigurationString=qka;var qTi=rd(),pn=kG(),qvr=q0t(),zb;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(zb||(mn.IncludeLineNumbersOption=zb={}));var _te;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(_te||(mn.RecentFileClippingStrategy=_te={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.AroundEditRange,t.Proportional)})(_te||(mn.RecentFileClippingStrategy=_te={}));var jvr;(function(t){t.VALIDATOR=(0,pn.vObj)({nDocuments:(0,pn.vNumber)(),maxTokens:(0,pn.vNumber)(),includeViewedFiles:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(zb.WithSpaceAfter,zb.WithoutSpace,zb.None),clippingStrategy:(0,pn.vEnum)(_te.AroundEditRange,_te.Proportional),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})(jvr||(mn.RecentlyViewedDocumentsOptions=jvr={}));var FTi;(function(t){t.VALIDATOR=(0,pn.vObj)({enabled:(0,pn.vBoolean)(),maxTokens:(0,pn.vNumber)()})})(FTi||(mn.NeighborFilesOptions=FTi={}));var UTi;(function(t){t.DEFAULT_ORDER=["languageContext","recentlyViewedDocuments","neighborFiles","diffHistory"],t.DEFAULT_SHARES={recentlyViewedDocuments:2/6,languageContext:2/6,neighborFiles:1/6,diffHistory:1/6},t.DEFAULT_TOTAL_TOKENS=6e3})(UTi||(mn.GlobalBudgetOptions=UTi={}));var Hvr;(function(t){t.VALIDATOR=(0,pn.vObj)({maxTokens:(0,pn.vNumber)(),includeTags:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(zb.WithSpaceAfter,zb.WithoutSpace,zb.None),includeCursorTag:(0,pn.vBoolean)(),prioritizeAboveCursor:(0,pn.vBoolean)(),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})(Hvr||(mn.CurrentFileOptions=Hvr={}));var Rge;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(Rge||(mn.LintOptionWarning=Rge={}));var kge;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(kge||(mn.LintOptionShowCode=kge={}));var j0t;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(j0t||(mn.AggressivenessSetting=j0t={}));var PG;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(PG||(mn.AggressivenessLevel=PG={}));var H0t;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(H0t||(mn.EarlyDivergenceCancellationMode=H0t={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Cursor,t.EditWindow,t.Off)})(H0t||(mn.EarlyDivergenceCancellationMode=H0t={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return PG.Low;case t.Medium:return PG.Medium;case t.High:return PG.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(j0t||(mn.AggressivenessSetting=j0t={}));var G0t;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(G0t||(mn.EditIntent=G0t={}));(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===PG.Medium||s===PG.High;case t.Low:return s===PG.High;default:(0,qTi.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(G0t||(mn.EditIntent=G0t={}));var kl;(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"})(kl||(mn.PromptingStrategy=kl={}));function Lka(t){return Object.values(kl).includes(t)}a(Lka,"isPromptingStrategy");function Bka(t){return t===kl.XtabAggressiveness||t===kl.Xtab275Aggressiveness||t===kl.Xtab275AggressivenessHighLow||t===kl.Xtab275EditIntent||t===kl.Xtab275EditIntentShort}a(Bka,"isAggressivenessStrategy");var $0t;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})($0t||(mn.ResponseFormat=$0t={}));(function(t){function e(r){switch(r){case kl.UnifiedModel:case kl.Codexv21NesUnified:case kl.Nes41Miniv3:return t.UnifiedWithXml;case kl.Xtab275:case kl.XtabAggressiveness:case kl.Xtab275Aggressiveness:case kl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case kl.PatchBased:case kl.PatchBased01:case kl.PatchBased02:case kl.PatchBased02WithRecentLineNumbers:case kl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case kl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case kl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case kl.SimplifiedSystemPrompt:case kl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,qTi.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})($0t||(mn.ResponseFormat=$0t={}));mn.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:1500,includeTags:!0,includeLineNumbers:zb.None,includeCursorTag:!1,prioritizeAboveCursor:!1,useLeftoverBudgetFromAbove:!0},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:zb.None,clippingStrategy:_te.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};mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:kge.YES_WITH_SURROUNDING,tagName:"linter",warnings:Rge.YES_IF_NO_ERRORS,nRecentFiles:0};mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var Fka={[kl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[kl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:zb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:zb.WithoutSpace},supportsNextCursorLinePrediction:!1,allowImportChanges:qvr.ImportChanges.All},[kl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:zb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:zb.None},supportsNextCursorLinePrediction:!1,allowImportChanges:qvr.ImportChanges.All}};function Uka(t){let e=t.promptingStrategy===void 0?void 0:Fka[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(Uka,"applyStrategyConfig");mn.LINT_OPTIONS_VALIDATOR=(0,pn.vObj)({tagName:(0,pn.vString)(),warnings:(0,pn.vEnum)(Rge.YES,Rge.NO,Rge.YES_IF_NO_ERRORS),showCode:(0,pn.vEnum)(kge.NO,kge.YES,kge.YES_WITH_SURROUNDING),maxLints:(0,pn.vNumber)(),maxLineDistance:(0,pn.vNumber)(),nRecentFiles:(0,pn.vNumber)()});mn.MODEL_CONFIGURATION_VALIDATOR=(0,pn.vObj)({modelName:(0,pn.vRequired)((0,pn.vString)()),promptingStrategy:(0,pn.vUnion)((0,pn.vEnum)(...Object.values(kl)),(0,pn.vUndefined)()),includeTagsInCurrentFile:(0,pn.vRequired)((0,pn.vBoolean)()),includePostScript:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),currentFile:(0,pn.vUnion)(Hvr.VALIDATOR,(0,pn.vUndefined)()),recentlyViewedDocuments:(0,pn.vUnion)(jvr.VALIDATOR,(0,pn.vUndefined)()),lintOptions:(0,pn.vUnion)(mn.LINT_OPTIONS_VALIDATOR,(0,pn.vUndefined)()),supportsNextCursorLinePrediction:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),allowImportChanges:(0,pn.vUnion)(qvr.ImportChanges.VALIDATOR,(0,pn.vUndefined)())});function Qka(t,e){try{let r=JSON.parse(t),n=mn.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(Qka,"parseLintOptionString");mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var QTi=(0,pn.vObj)({acceptedScore:(0,pn.vRequired)((0,pn.vNumber)()),rejectedScore:(0,pn.vRequired)((0,pn.vNumber)()),ignoredScore:(0,pn.vRequired)((0,pn.vNumber)()),highThreshold:(0,pn.vRequired)((0,pn.vNumber)()),mediumThreshold:(0,pn.vRequired)((0,pn.vNumber)()),includeIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),ignoredLimit:(0,pn.vRequired)((0,pn.vNumber)()),limitConsecutiveIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),limitTotalIgnored:(0,pn.vRequired)((0,pn.vBoolean)())});function m5e(t,e,r){return t>=e&&t<=r}a(m5e,"isInRange");mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=QTi.validate(t);if(e.error)return e;let r=e.content;return m5e(r.acceptedScore,0,1)?m5e(r.rejectedScore,0,1)?m5e(r.ignoredScore,0,1)?m5e(r.highThreshold,0,1)?m5e(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(Pge,"__esModule",{value:!0});Pge.TextReplacement=Pge.TextEdit=void 0;var jTi=Sl(),HTi=rd(),X0t=Rs(),J0t=em(),DG=q_(),_m=eh(),egt=Ime(),GTi=HT(),tgt=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>Iv.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new Iv(e,r)])}static delete(e){return new t([new Iv(e,"")])}static insert(e,r){return new t([new Iv(_m.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,jTi.compareBy)(n=>n.range,_m.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,HTi.assertFn)(()=>(0,HTi.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 Iv(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=egt.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new DG.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return Z0t(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 DG.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof DG.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof DG.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return Z0t(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 DG.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=Z0t(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=Z0t(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new GTi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new Iv(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=egt.TextLength.ofText(s.text),l=DG.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 X0t.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,E=!1,_=1,v=1;function b(){if(!y)if(sr.toString()).join(` +`):typeof e=="string"?this.toString(new GTi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=_m.Range.fromPositions(new DG.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=_m.Range.fromPositions(r.range.getEndPosition(),new DG.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(` +`)}};Pge.TextEdit=tgt;var Iv=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new X0t.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}"`}};kge.TextReplacement=Tv;function J0t(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return _m.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Z0t.BugIndicatingError("start must be before end");return new _m.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(J0t,"rangeFromPositions")});var NG=I(DG=>{"use strict";p();Object.defineProperty(DG,"__esModule",{value:!0});DG.SerializedLineReplacement=DG.LineReplacement=DG.LineEdit=void 0;var Hvr=Sl(),qTi=rd(),Lka=em(),m5e=$2(),HTi=kE(),Pge=q_(),Dge=eh(),Nge=h5e(),tgt=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>vte.deserialize(r)))}static fromStringEdit(e,r){let n=Nge.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,Hvr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,qTi.assert)((0,qTi.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 HTi.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(m5e.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 m5e.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 vte(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,Hvr.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 vte(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};DG.LineEdit=tgt;var vte=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(m5e.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,Lka.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Dge.Range.fromPositions(new Pge.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(Dge.Range.fromPositions(e.range.getEndPosition(),new Pge.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 Pge.Position(s,c)}else n=new Pge.Position(1,1);let o=r.addToPosition(new Pge.Position(1,1));return new Nge.TextReplacement(Dge.Range.fromPositions(n,o),"")}else return new Nge.TextReplacement(new Dge.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,J0t.commonPrefixLength)(r,n);r=r.substring(o),n=n.substring(o);let s=(0,J0t.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}"`}};Pge.TextReplacement=Iv;function Z0t(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return _m.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new X0t.BugIndicatingError("start must be before end");return new _m.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(Z0t,"rangeFromPositions")});var MG=I(NG=>{"use strict";p();Object.defineProperty(NG,"__esModule",{value:!0});NG.SerializedLineReplacement=NG.LineReplacement=NG.LineEdit=void 0;var Gvr=Sl(),$Ti=rd(),jka=em(),A5e=V2(),WTi=kE(),Dge=q_(),Nge=eh(),Mge=g5e(),rgt=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>vte.deserialize(r)))}static fromStringEdit(e,r){let n=Mge.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,Gvr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,$Ti.assert)((0,$Ti.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 WTi.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(A5e.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 A5e.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 vte(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,Gvr.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 vte(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};NG.LineEdit=rgt;var vte=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(A5e.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,jka.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Nge.Range.fromPositions(new Dge.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(Nge.Range.fromPositions(e.range.getEndPosition(),new Dge.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 Dge.Position(s,c)}else n=new Dge.Position(1,1);let o=r.addToPosition(new Dge.Position(1,1));return new Mge.TextReplacement(Nge.Range.fromPositions(n,o),"")}else return new Mge.TextReplacement(new Nge.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 Nge.TextReplacement(Dge.Range.fromPositions(new Pge.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Dge.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new Nge.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new HTi.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})(jTi||(DG.SerializedLineReplacement=jTi={}))});var ogt=I(Mge=>{"use strict";p();Object.defineProperty(Mge,"__esModule",{value:!0});Mge.ArrayMap=Mge.ResponseProcessor=void 0;var Bka=Rs(),rgt=NG(),ngt=$2(),GTi;(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 igt;for(let[y,E]of l.entries())h.add(E,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 E=c(l,d,h,A,m,f);E&&(yield E.singleLineEdit,m=E.convergenceEndIdx,A={k:"aligned"})}switch(A.k){case"diverged":{let y=new ngt.LineRange(A.startLineIdx+1,l.length+1);yield new rgt.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&&(_="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])&&++E,E===m.nSignificantLinesToConverge&&(_="found_significant_matches",v=A[0]),y===m.nLinesToConverge){_="found_matches",v=A[0];break}if(!_)return;let b=v[1],T=v[0],w=T-b+1,R=b-f.startLineIdx,x=f.newLines.slice(0,f.newLines.length-w),P=x.length;if(R-P>1&&P>0)return;let D=[f.startLineIdx,b],N=new ngt.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new rgt.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(GTi||(Mge.ResponseProcessor=GTi={}));var igt=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)||[]}};Mge.ArrayMap=igt});var VTi=I(sgt=>{"use strict";p();Object.defineProperty(sgt,"__esModule",{value:!0});sgt.AlternativeNotebookFormat=void 0;var $Ti;(function(t){t.json="json",t.xml="xml",t.text="text"})($Ti||(sgt.AlternativeNotebookFormat=$Ti={}))});var Pl=I(Ho=>{"use strict";p();var Fka=Ho&&Ho.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Ho&&Ho.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A5e=Ho&&Ho.__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):WTi.isObject(r)&&WTi.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 Ho.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,Hka.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){}};Ho.AbstractConfigurationService=$vr;var agt;function Vka(){if(!agt){agt=new Map;let e=Gka.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)agt.set(n,r[n].default)}return agt}a(Vka,"getPackageJsonDefaults");function ZTi(t,e,r){let n=`${Ho.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Ho.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=Vka(),c=s.has(n),l=s.get(n);if(c&&!jka.equals(e,l))throw new Gvr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new Gvr.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(ZTi,"toBaseConfig");var Vvr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Ho.globalConfigRegistry=new Vvr;var Wvr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new XTi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Ho.ConfigurationMigrationRegistry=new Wvr;function lt(t,e,r,n,o,s){if(e===1){let l={...ZTi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new Gvr.BugIndicatingError("Shared settings cannot be experiment based");return Ho.globalConfigRegistry.registerConfig(l),l}let c={...ZTi(t,r,o),configType:0,validator:n};return Ho.globalConfigRegistry.registerConfig(c),c}a(lt,"defineSetting");function Pt(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?lt(t,e,r,n,o):lt(t,e,r,n,o,s)}a(Pt,"defineTeamInternalSetting");function Jvr(t,e){Ho.ConfigurationMigrationRegistry.registerConfigurationMigrations([{key:`${Ho.CopilotConfigPrefix}.${e}`,migrateFn:a(async r=>[[`${Ho.CopilotConfigPrefix}.${t}`,{value:r}],[`${Ho.CopilotConfigPrefix}.${e}`,{value:void 0}]],"migrateFn")}])}a(Jvr,"migrateSetting");function Vg(t,e,r,n){return Jvr(e,t),lt(e,0,r,void 0,{...n,oldKey:t})}a(Vg,"defineAndMigrateSetting");function w0(t,e,r,n,o){return Jvr(e,t),lt(e,1,r,void 0,{...n,oldKey:t},o)}a(w0,"defineAndMigrateExpSetting");Ho.HARD_TOOL_LIMIT=128;var zvr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(zvr||(Ho.AuthProviderId=zvr={}));var Yvr;(function(t){t.Default="default",t.Minimal="minimal"})(Yvr||(Ho.AuthPermissionMode=Yvr={}));var g5e;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(g5e||(Ho.AzureAuthMode=g5e={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(g5e||(Ho.AzureAuthMode=g5e={}));Ho.XTabProviderId="XtabProvider";var Kvr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=lt("advanced.debug.overrideProxyUrl",0,void 0),s.DebugOverrideAuthType=lt("advanced.debug.overrideAuthType",0,"hmac"),s.DebugOverrideCAPIUrl=lt("advanced.debug.overrideCapiUrl",0,void 0),s.DebugUseNodeFetchFetcher=lt("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=lt("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=lt("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=lt("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=lt("advanced.authProvider",0,zvr.GitHub),s.AuthPermissions=lt("advanced.authPermissions",0,Yvr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=lt("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=lt("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=Vg("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=Vg("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=Vg("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=Vg("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=Vg("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=Vg("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=Vg("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=Vg("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=Vg("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=Vg("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=Vg("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=Vg("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=Vg("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=Vg("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=Vg("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=lt("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=lt("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=lt("chat.cli.autoModel.enabled",0,!0),s.CLIModelDetailsEnabled=lt("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=lt("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=lt("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=lt("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=lt("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=Vg("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLISandboxEnabled=lt("chat.cli.sandbox.enabled",1,"off"),s.CLIBranchSupport=lt("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=lt("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=lt("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=lt("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=lt("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=lt("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=lt("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=lt("chat.cli.terminalLinks.enabled",0,!0),s.CLISessionEventLoggingEnabled=lt("chat.cli.sessionEventLogging.enabled",0,!1),s.RequestLoggerMaxEntries=Vg("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=w0("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=w0("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=w0("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=w0("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=w0("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=lt("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=w0("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=w0("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",$ka.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=w0("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=lt("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=lt("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=w0("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=w0("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=w0("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=w0("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=w0("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=lt("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=lt("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=lt("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=lt("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=lt("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=lt("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=lt("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=lt("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=lt("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=lt("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=lt("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=lt("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=w0("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=w0("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=w0("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=lt("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=lt("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=lt("nextEditSuggestions.eagerness",1,$c.AggressivenessSetting.Default,$c.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=w0("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=lt("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=lt("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=lt("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=lt("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=lt("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=lt("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=lt("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=lt("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=w0("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=w0("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=Vg("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=lt("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=lt("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=lt("chat.otel.enabled",0,!1),s.OTelExporterType=lt("chat.otel.exporterType",0,"otlp-http"),s.OTelOtlpEndpoint=lt("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=lt("chat.otel.captureContent",0,!1),s.OTelMaxAttributeSizeChars=lt("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=lt("chat.otel.outfile",0,""),s.OTelDbSpanExporter=lt("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=lt("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=lt("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=lt("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=lt("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=lt("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=lt("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return Jvr(l,c),lt(l,0,null,$c.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=Pt("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=Pt("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=Pt("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=Pt("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,x0.vBoolean)()),s.InlineEditsModelPickerEnabled=Pt("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,x0.vBoolean)()),s.InlineEditsUseSlashModels=Pt("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=Pt("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=Pt("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,x0.vBoolean)()),s.InlineEditsLogCancelledRequests=Pt("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,x0.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=Pt("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,x0.vString)()),s.InlineEditsNextCursorPredictionApiKey=Pt("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,x0.vString)()),s.InlineEditsXtabProviderUrl=Pt("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,x0.vString)()),s.InlineEditsXtabProviderApiKey=Pt("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,x0.vString)()),s.InlineEditsNextCursorPredictionLintOptions=Pt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,$c.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=Pt("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,x0.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=Pt("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,x0.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=Pt("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,x0.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=Pt("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,x0.vBoolean)()),s.InlineEditsXtabProviderPatchModelPredictionKind=Pt("chat.advanced.inlineEdits.xtabProvider.patchModelPredictionKind",1,$c.PatchModelPrediction.FilePath,$c.PatchModelPrediction.VALIDATOR),s.InlineEditsXtabProviderPatchFastYieldLineWithCursor=Pt("chat.advanced.inlineEdits.xtabProvider.patchFastYieldLineWithCursor",1,!0,(0,x0.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,lD.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=Pt("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=Pt("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=Pt("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=Pt("chat.advanced.promptRenderer.trace",0,!1),s.DebugCollectFetcherTelemetry=Pt("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=Pt("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=Pt("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=Pt("chat.advanced.modelProviderPreference",0,void 0,(0,x0.vString)()),s.UseVSCodeTelemetryLibForGH=Pt("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=Pt("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=Pt("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=Pt("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=Pt("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsDebounceUseCoreRequestTime=Pt("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=Pt("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=Pt("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=Pt("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=Pt("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=Pt("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=Pt("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=Pt("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=Pt("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=Pt("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=Pt("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=Pt("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=Pt("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=Pt("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,1,(0,x0.vNumber)()),s.InlineEditsBackoffDebounceEnabled=Pt("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=Pt("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=Pt("chat.advanced.inlineEdits.speculativeRequests",1,lD.SpeculativeRequestsEnablement.Off,lD.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=Pt("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,lD.SpeculativeRequestsCursorPlacement.AfterEditApplied,lD.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=Pt("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,lD.SpeculativeRequestsAutoExpandEditWindowLines.Off,lD.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=Pt("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=Pt("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=Pt("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,YTi.DocumentSwitchTriggerStrategy.AfterAcceptance,YTi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=Pt("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=Pt("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=Pt("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=Pt("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,x0.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=Pt("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=Pt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=Pt("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=Pt("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=Pt("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=Pt("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=Pt("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=Pt("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=Pt("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=Pt("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,$c.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=Pt("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,$c.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,$c.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,KTi.DiffHistoryMergeStrategy.SameStartLine,KTi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,x0.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,x0.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=Pt("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=Pt("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,$c.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.useLeftoverBudgetFromAbove",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.useLeftoverBudgetFromAbove),s.InlineEditsXtabPageSize=Pt("chat.advanced.inlineEdits.xtabProvider.pageSize",1,$c.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,$c.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=Pt("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,$c.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove=Pt("chat.advanced.inlineEdits.xtabProvider.currentFile.useLeftoverBudgetFromAbove",1,$c.DEFAULT_OPTIONS.currentFile.useLeftoverBudgetFromAbove),s.InlineEditsXtabDiffOnlyForDocsInPrompt=Pt("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,$c.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=Pt("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,$c.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=Pt("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,JTi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=Pt("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,JTi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=Pt("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,lD.EarlyDivergenceCancellationMode.Off,lD.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,$c.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,$c.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=Pt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,$c.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,$c.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudgetEnabled=Pt("chat.advanced.inlineEdits.xtabProvider.globalBudget.enabled",1,!1),s.InlineEditsXtabGlobalBudgetTotalTokens=Pt("chat.advanced.inlineEdits.xtabProvider.globalBudget.totalTokens",1,$c.GlobalBudgetOptions.DEFAULT_TOTAL_TOKENS),s.InlineEditsXtabMaxMergeConflictLines=Pt("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=Pt("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=Pt("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,lD.DuplicateAdditionsMode.Off,lD.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabAggressivenessLevel=Pt("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=Pt("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=Pt("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=Pt("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=Pt("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=Pt("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=Pt("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsIgnoreWhenSuggestVisible=Pt("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,zTi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,zTi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=Pt("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=Pt("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.UseAutoModeRouting=Pt("chat.advanced.useAutoModeRouter",1,!1),s.AutoModeRoutingMethod=Pt("chat.advanced.autoModeRoutingMethod",1,"",void 0,void 0,{experimentName:"copilotchat.autoModeRoutingMethod"}),s.InlineCompletionsDefaultDiagnosticsOptions=Pt("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=Pt("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=Pt("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=Pt("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=lt("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=lt("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=lt("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=lt("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=lt("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=Pt("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=Pt("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=Pt("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=Pt("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=Pt("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=lt("chat.planAgent.model",0,""),s.OllamaEndpoint=lt("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=lt("chat.azureModels",0,{}),s.CustomOAIModels=lt("chat.customOAIModels",0,{}),s.AzureAuthType=lt("chat.azureAuthType",0,g5e.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=lt("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=lt("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=lt("chat.rateLimitAutoSwitchToAuto",0,!1,(0,x0.vBoolean)()),t.ConversationUsePrismCompaction=lt("chat.conversationCompaction.usePrismCompaction",1,!1),t.ConversationCompactionModel=lt("chat.conversationCompaction.model",1,""),t.ConversationPrismCompactionModelFilter=lt("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=lt("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=lt("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiReasoningSummary=lt("chat.responsesApiReasoningSummary",1,"detailed"),t.ResponsesApiContextManagementEnabled=lt("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=lt("chat.responsesApi.promptCacheKey.enabled",1,!1),t.ResponsesApiPersistentCoTEnabled=lt("chat.responsesApi.persistentCoT.enabled",1,!1),t.Updated53CodexPromptEnabled=lt("chat.updated53CodexPrompt.enabled",1,!0),t.Claude47OpusPromptEnabled=lt("chat.claude47OpusPrompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=lt("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=lt("chat.gemini3GetChangedFilesTool.enabled",1,!0),t.EnableGemini3LowReasoningEffort=lt("chat.gemini3LowReasoningEffort.enabled",1,!1),t.EnableGpt55ReadFileTool=lt("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableChatImageUpload=lt("chat.imageUpload.enabled",1,!0),t.AnthropicWebSearchToolEnabled=lt("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=lt("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=lt("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=lt("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=lt("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=lt("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=lt("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=lt("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=lt("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=lt("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=lt("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=lt("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=lt("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=lt("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=lt("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=lt("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=lt("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=lt("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=lt("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=lt("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=lt("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=lt("chat.scopeSelection",0,!1),t.EnableCodeActions=lt("editor.enableCodeActions",0,!0),t.LocaleOverride=lt("chat.localeOverride",0,"auto"),t.TerminalChatLocation=lt("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=lt("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=lt("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=lt("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=lt("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=lt("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=lt("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=lt("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=lt("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=lt("nextEditSuggestions.enabled",1,!0),t.CompletionsInChatEnabled=lt("completions.chat.enabled",0,!1),t.InlineEditsEnableDiagnosticsProvider=lt("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=lt("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=lt("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=lt("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=lt("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=lt("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=lt("chat.virtualTools.threshold",1,Ho.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=lt("chat.agent.currentEditorContext.enabled",0,!0),t.AutoFixDiagnostics=lt("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=lt("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=lt("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=lt("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=lt("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=lt("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableGemini35FlashReducedToolUsePrompt=lt("chat.gemini35FlashReducedToolUsePrompt.enabled",1,!1),t.EnableOrganizationCustomAgents=lt("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=lt("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=lt("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=lt("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=lt("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=lt("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=lt("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=lt("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=lt("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=lt("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=lt("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=lt("chat.cloudAgentBackend.version",1,"v1"),t.AdditionalReadAccessPaths=lt("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=lt("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=lt("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=lt("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=lt("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=lt("chat.askAgent.model",0,""),t.ExploreAgentEnabled=lt("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=lt("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=lt("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=lt("chat.localIndex.enabled",1,!1),t.GrepSearchOutputFormat=lt("chat.tools.grepSearch.outputFormat",1,"tag")})(Kvr||(Ho.ConfigKey=Kvr={}));function Wka(){return Object.values(Kvr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(Wka,"getAllConfigKeys");var zka=[];function Yka(t){return zka.push(t),t}a(Yka,"registerNextEditProviderId")});var Sp=I(hy=>{"use strict";p();Object.defineProperty(hy,"__esModule",{value:!0});hy.LogMemory=hy.LogServiceImpl=hy.ConsoleLog=hy.LogTarget=hy.LogLevel=hy.ILogService=void 0;hy.collectErrorMessages=tIi;hy.collectSingleLineErrorMessage=Zka;hy.sanitizeNetworkErrorForTelemetry=Xka;var Kka=nn(),Jka=Ro();hy.ILogService=(0,Kka.createServiceIdentifier)("ILogService");var BE;(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"})(BE||(hy.LogLevel=BE={}));var eIi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(eIi||(hy.LogTarget=eIi={}));var Zvr=class{static{a(this,"ConsoleLog")}constructor(e,r=BE.Warning){this.prefix=e,this.minLogLevel=r}logIt(e,r,...n){this.prefix&&(r=`${this.prefix}${r}`),e===BE.Error?console.error(r,...n):e===BE.Warning?console.warn(r,...n):e>=this.minLogLevel&&console.log(r,...n)}};hy.ConsoleLog=Zvr;var Xvr=class extends Jka.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new eCr(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)}};hy.LogServiceImpl=Xvr;var eCr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){lgt.addLog(BE[e],r),this._logTargets.forEach(n=>n.logIt(e,r))}trace(e){this._logIt(BE.Trace,e)}debug(e){this._logIt(BE.Debug,e)}info(e){this._logIt(BE.Info,e)}warn(e){this._logIt(BE.Warning,e)}error(e,r){this._logIt(BE.Error,tIi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new tCr(this,e)}withExtraTarget(e){return new cgt(this,[e])}},tCr=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 cgt(this,[e],this._prefix)}},cgt=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(BE.Trace,e),this._parent.trace(e)}debug(e){this._notifyExtraTargets(BE.Debug,e),this._parent.debug(e)}info(e){this._notifyExtraTargets(BE.Info,e),this._parent.info(e)}warn(e){this._notifyExtraTargets(BE.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(BE.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 tIi(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(` +`).join("")),new Mge.TextReplacement(Nge.Range.fromPositions(new Dge.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Nge.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` +`);return new Mge.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new WTi.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})(VTi||(NG.SerializedLineReplacement=VTi={}))});var sgt=I(Oge=>{"use strict";p();Object.defineProperty(Oge,"__esModule",{value:!0});Oge.ArrayMap=Oge.ResponseProcessor=void 0;var Hka=Rs(),ngt=MG(),igt=V2(),zTi;(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 ogt;for(let[y,E]of l.entries())h.add(E,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 E=c(l,d,h,A,m,f);E&&(yield E.singleLineEdit,m=E.convergenceEndIdx,A={k:"aligned"})}switch(A.k){case"diverged":{let y=new igt.LineRange(A.startLineIdx+1,l.length+1);yield new ngt.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&&(_="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])&&++E,E===m.nSignificantLinesToConverge&&(_="found_significant_matches",v=A[0]),y===m.nLinesToConverge){_="found_matches",v=A[0];break}if(!_)return;let b=v[1],T=v[0],w=T-b+1,R=b-f.startLineIdx,x=f.newLines.slice(0,f.newLines.length-w),P=x.length;if(R-P>1&&P>0)return;let D=[f.startLineIdx,b],N=new igt.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new ngt.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(zTi||(Oge.ResponseProcessor=zTi={}));var ogt=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)||[]}};Oge.ArrayMap=ogt});var KTi=I(agt=>{"use strict";p();Object.defineProperty(agt,"__esModule",{value:!0});agt.AlternativeNotebookFormat=void 0;var YTi;(function(t){t.json="json",t.xml="xml",t.text="text"})(YTi||(agt.AlternativeNotebookFormat=YTi={}))});var Pl=I(Go=>{"use strict";p();var Gka=Go&&Go.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$ka=Go&&Go.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E5e=Go&&Go.__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):JTi.isObject(r)&&JTi.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 Go.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,Yka.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){}};Go.AbstractConfigurationService=Vvr;var cgt;function Zka(){if(!cgt){cgt=new Map;let e=Kka.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)cgt.set(n,r[n].default)}return cgt}a(Zka,"getPackageJsonDefaults");function rIi(t,e,r){let n=`${Go.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Go.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=Zka(),c=s.has(n),l=s.get(n);if(c&&!zka.equals(e,l))throw new $vr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new $vr.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(rIi,"toBaseConfig");var Wvr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Go.globalConfigRegistry=new Wvr;var zvr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new nIi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Go.ConfigurationMigrationRegistry=new zvr;function lt(t,e,r,n,o,s){if(e===1){let l={...rIi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new $vr.BugIndicatingError("Shared settings cannot be experiment based");return Go.globalConfigRegistry.registerConfig(l),l}let c={...rIi(t,r,o),configType:0,validator:n};return Go.globalConfigRegistry.registerConfig(c),c}a(lt,"defineSetting");function Pt(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?lt(t,e,r,n,o):lt(t,e,r,n,o,s)}a(Pt,"defineTeamInternalSetting");function Zvr(t,e){Go.ConfigurationMigrationRegistry.registerConfigurationMigrations([{key:`${Go.CopilotConfigPrefix}.${e}`,migrateFn:a(async r=>[[`${Go.CopilotConfigPrefix}.${t}`,{value:r}],[`${Go.CopilotConfigPrefix}.${e}`,{value:void 0}]],"migrateFn")}])}a(Zvr,"migrateSetting");function Vg(t,e,r,n){return Zvr(e,t),lt(e,0,r,void 0,{...n,oldKey:t})}a(Vg,"defineAndMigrateSetting");function w0(t,e,r,n,o){return Zvr(e,t),lt(e,1,r,void 0,{...n,oldKey:t},o)}a(w0,"defineAndMigrateExpSetting");Go.HARD_TOOL_LIMIT=128;var Yvr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(Yvr||(Go.AuthProviderId=Yvr={}));var Kvr;(function(t){t.Default="default",t.Minimal="minimal"})(Kvr||(Go.AuthPermissionMode=Kvr={}));var y5e;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(y5e||(Go.AzureAuthMode=y5e={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(y5e||(Go.AzureAuthMode=y5e={}));Go.XTabProviderId="XtabProvider";var Jvr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=lt("advanced.debug.overrideProxyUrl",0,void 0),s.DebugOverrideAuthType=lt("advanced.debug.overrideAuthType",0,"hmac"),s.DebugOverrideCAPIUrl=lt("advanced.debug.overrideCapiUrl",0,void 0),s.DebugUseNodeFetchFetcher=lt("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=lt("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=lt("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=lt("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=lt("advanced.authProvider",0,Yvr.GitHub),s.AuthPermissions=lt("advanced.authPermissions",0,Kvr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=lt("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=lt("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=Vg("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=Vg("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=Vg("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=Vg("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=Vg("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=Vg("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=Vg("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=Vg("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=Vg("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=Vg("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=Vg("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=Vg("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=Vg("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=Vg("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=Vg("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=lt("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=lt("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=lt("chat.cli.autoModel.enabled",0,!0),s.CLIModelDetailsEnabled=lt("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=lt("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=lt("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=lt("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=lt("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=Vg("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLISandboxEnabled=lt("chat.cli.sandbox.enabled",1,"off"),s.CLIBranchSupport=lt("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=lt("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=lt("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=lt("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=lt("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=lt("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=lt("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=lt("chat.cli.terminalLinks.enabled",0,!0),s.CLISessionEventLoggingEnabled=lt("chat.cli.sessionEventLogging.enabled",0,!1),s.RequestLoggerMaxEntries=Vg("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=w0("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=w0("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=w0("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=w0("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=w0("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=lt("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=w0("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=w0("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",Jka.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=w0("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=lt("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=lt("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=w0("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=w0("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=w0("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=w0("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=w0("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=lt("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=lt("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=lt("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=lt("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=lt("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=lt("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=lt("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=lt("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=lt("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=lt("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=lt("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=lt("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=w0("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=w0("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=w0("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=lt("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=lt("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=lt("nextEditSuggestions.eagerness",1,$c.AggressivenessSetting.Default,$c.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=w0("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=lt("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=lt("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=lt("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=lt("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=lt("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=lt("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=lt("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=lt("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=w0("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=w0("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=Vg("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=lt("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=lt("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=lt("chat.otel.enabled",0,!1),s.OTelExporterType=lt("chat.otel.exporterType",0,"otlp-http"),s.OTelOtlpEndpoint=lt("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=lt("chat.otel.captureContent",0,!1),s.OTelMaxAttributeSizeChars=lt("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=lt("chat.otel.outfile",0,""),s.OTelDbSpanExporter=lt("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=lt("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=lt("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=lt("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=lt("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=lt("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=lt("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return Zvr(l,c),lt(l,0,null,$c.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=Pt("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=Pt("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=Pt("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=Pt("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,x0.vBoolean)()),s.InlineEditsModelPickerEnabled=Pt("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,x0.vBoolean)()),s.InlineEditsUseSlashModels=Pt("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=Pt("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=Pt("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,x0.vBoolean)()),s.InlineEditsLogCancelledRequests=Pt("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,x0.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=Pt("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,x0.vString)()),s.InlineEditsNextCursorPredictionApiKey=Pt("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,x0.vString)()),s.InlineEditsXtabProviderUrl=Pt("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,x0.vString)()),s.InlineEditsXtabProviderApiKey=Pt("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,x0.vString)()),s.InlineEditsNextCursorPredictionLintOptions=Pt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,$c.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=Pt("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,x0.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=Pt("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,x0.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=Pt("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,x0.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=Pt("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,x0.vBoolean)()),s.InlineEditsXtabProviderPatchModelPredictionKind=Pt("chat.advanced.inlineEdits.xtabProvider.patchModelPredictionKind",1,$c.PatchModelPrediction.FilePath,$c.PatchModelPrediction.VALIDATOR),s.InlineEditsXtabProviderPatchFastYieldLineWithCursor=Pt("chat.advanced.inlineEdits.xtabProvider.patchFastYieldLineWithCursor",1,!0,(0,x0.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,uD.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=Pt("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=Pt("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=Pt("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=Pt("chat.advanced.promptRenderer.trace",0,!1),s.DebugCollectFetcherTelemetry=Pt("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=Pt("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=Pt("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=Pt("chat.advanced.modelProviderPreference",0,void 0,(0,x0.vString)()),s.UseVSCodeTelemetryLibForGH=Pt("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=Pt("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=Pt("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=Pt("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=Pt("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsDebounceUseCoreRequestTime=Pt("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=Pt("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=Pt("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=Pt("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=Pt("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=Pt("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=Pt("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=Pt("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=Pt("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=Pt("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=Pt("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=Pt("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=Pt("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=Pt("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,1,(0,x0.vNumber)()),s.InlineEditsBackoffDebounceEnabled=Pt("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=Pt("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=Pt("chat.advanced.inlineEdits.speculativeRequests",1,uD.SpeculativeRequestsEnablement.Off,uD.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=Pt("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,uD.SpeculativeRequestsCursorPlacement.AfterEditApplied,uD.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=Pt("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,uD.SpeculativeRequestsAutoExpandEditWindowLines.Off,uD.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=Pt("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=Pt("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=Pt("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,XTi.DocumentSwitchTriggerStrategy.AfterAcceptance,XTi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=Pt("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=Pt("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=Pt("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=Pt("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,x0.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=Pt("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=Pt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=Pt("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=Pt("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=Pt("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=Pt("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=Pt("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=Pt("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=Pt("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=Pt("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,$c.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=Pt("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,$c.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,$c.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,eIi.DiffHistoryMergeStrategy.SameStartLine,eIi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,x0.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,x0.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=Pt("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=Pt("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,$c.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.useLeftoverBudgetFromAbove",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.useLeftoverBudgetFromAbove),s.InlineEditsXtabPageSize=Pt("chat.advanced.inlineEdits.xtabProvider.pageSize",1,$c.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,$c.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=Pt("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,$c.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove=Pt("chat.advanced.inlineEdits.xtabProvider.currentFile.useLeftoverBudgetFromAbove",1,$c.DEFAULT_OPTIONS.currentFile.useLeftoverBudgetFromAbove),s.InlineEditsXtabDiffOnlyForDocsInPrompt=Pt("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,$c.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=Pt("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,$c.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=Pt("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,tIi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=Pt("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,tIi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=Pt("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,uD.EarlyDivergenceCancellationMode.Off,uD.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,$c.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,$c.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=Pt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,$c.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,$c.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudgetEnabled=Pt("chat.advanced.inlineEdits.xtabProvider.globalBudget.enabled",1,!1),s.InlineEditsXtabGlobalBudgetTotalTokens=Pt("chat.advanced.inlineEdits.xtabProvider.globalBudget.totalTokens",1,$c.GlobalBudgetOptions.DEFAULT_TOTAL_TOKENS),s.InlineEditsXtabMaxMergeConflictLines=Pt("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=Pt("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=Pt("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,uD.DuplicateAdditionsMode.Off,uD.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabAggressivenessLevel=Pt("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=Pt("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=Pt("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=Pt("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=Pt("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=Pt("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=Pt("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsIgnoreWhenSuggestVisible=Pt("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,ZTi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,ZTi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=Pt("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=Pt("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.UseAutoModeRouting=Pt("chat.advanced.useAutoModeRouter",1,!1),s.AutoModeRoutingMethod=Pt("chat.advanced.autoModeRoutingMethod",1,"",void 0,void 0,{experimentName:"copilotchat.autoModeRoutingMethod"}),s.InlineCompletionsDefaultDiagnosticsOptions=Pt("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=Pt("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=Pt("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=Pt("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=lt("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=lt("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=lt("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=lt("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=lt("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=Pt("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=Pt("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=Pt("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=Pt("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=Pt("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=lt("chat.planAgent.model",0,""),s.OllamaEndpoint=lt("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=lt("chat.azureModels",0,{}),s.CustomOAIModels=lt("chat.customOAIModels",0,{}),s.AzureAuthType=lt("chat.azureAuthType",0,y5e.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=lt("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=lt("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=lt("chat.rateLimitAutoSwitchToAuto",0,!1,(0,x0.vBoolean)()),t.ConversationUsePrismCompaction=lt("chat.conversationCompaction.usePrismCompaction",1,!1),t.ConversationCompactionModel=lt("chat.conversationCompaction.model",1,""),t.ConversationPrismCompactionModelFilter=lt("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=lt("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=lt("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiReasoningSummary=lt("chat.responsesApiReasoningSummary",1,"detailed"),t.ResponsesApiContextManagementEnabled=lt("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=lt("chat.responsesApi.promptCacheKey.enabled",1,!1),t.ResponsesApiPersistentCoTEnabled=lt("chat.responsesApi.persistentCoT.enabled",1,!1),t.Updated53CodexPromptEnabled=lt("chat.updated53CodexPrompt.enabled",1,!0),t.Claude47OpusPromptEnabled=lt("chat.claude47OpusPrompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=lt("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=lt("chat.gemini3GetChangedFilesTool.enabled",1,!0),t.EnableGemini3LowReasoningEffort=lt("chat.gemini3LowReasoningEffort.enabled",1,!1),t.EnableGpt55ReadFileTool=lt("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableChatImageUpload=lt("chat.imageUpload.enabled",1,!0),t.AnthropicWebSearchToolEnabled=lt("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=lt("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=lt("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=lt("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=lt("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=lt("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=lt("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=lt("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=lt("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=lt("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=lt("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=lt("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=lt("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=lt("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=lt("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=lt("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=lt("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=lt("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=lt("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=lt("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=lt("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=lt("chat.scopeSelection",0,!1),t.EnableCodeActions=lt("editor.enableCodeActions",0,!0),t.LocaleOverride=lt("chat.localeOverride",0,"auto"),t.TerminalChatLocation=lt("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=lt("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=lt("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=lt("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=lt("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=lt("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=lt("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=lt("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=lt("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=lt("nextEditSuggestions.enabled",1,!0),t.CompletionsInChatEnabled=lt("completions.chat.enabled",0,!1),t.InlineEditsEnableDiagnosticsProvider=lt("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=lt("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=lt("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=lt("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=lt("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=lt("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=lt("chat.virtualTools.threshold",1,Go.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=lt("chat.agent.currentEditorContext.enabled",0,!0),t.AutoFixDiagnostics=lt("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=lt("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=lt("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=lt("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=lt("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=lt("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableGemini35FlashReducedToolUsePrompt=lt("chat.gemini35FlashReducedToolUsePrompt.enabled",1,!1),t.EnableOrganizationCustomAgents=lt("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=lt("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=lt("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=lt("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=lt("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=lt("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=lt("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=lt("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=lt("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=lt("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=lt("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=lt("chat.cloudAgentBackend.version",1,"v1"),t.AdditionalReadAccessPaths=lt("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=lt("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=lt("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=lt("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=lt("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=lt("chat.askAgent.model",0,""),t.ExploreAgentEnabled=lt("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=lt("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=lt("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=lt("chat.localIndex.enabled",1,!1),t.GrepSearchOutputFormat=lt("chat.tools.grepSearch.outputFormat",1,"tag")})(Jvr||(Go.ConfigKey=Jvr={}));function Xka(){return Object.values(Jvr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(Xka,"getAllConfigKeys");var ePa=[];function tPa(t){return ePa.push(t),t}a(tPa,"registerNextEditProviderId")});var Sp=I(hy=>{"use strict";p();Object.defineProperty(hy,"__esModule",{value:!0});hy.LogMemory=hy.LogServiceImpl=hy.ConsoleLog=hy.LogTarget=hy.LogLevel=hy.ILogService=void 0;hy.collectErrorMessages=oIi;hy.collectSingleLineErrorMessage=iPa;hy.sanitizeNetworkErrorForTelemetry=oPa;var rPa=nn(),nPa=ko();hy.ILogService=(0,rPa.createServiceIdentifier)("ILogService");var BE;(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"})(BE||(hy.LogLevel=BE={}));var iIi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(iIi||(hy.LogTarget=iIi={}));var Xvr=class{static{a(this,"ConsoleLog")}constructor(e,r=BE.Warning){this.prefix=e,this.minLogLevel=r}logIt(e,r,...n){this.prefix&&(r=`${this.prefix}${r}`),e===BE.Error?console.error(r,...n):e===BE.Warning?console.warn(r,...n):e>=this.minLogLevel&&console.log(r,...n)}};hy.ConsoleLog=Xvr;var eCr=class extends nPa.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new tCr(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)}};hy.LogServiceImpl=eCr;var tCr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){ugt.addLog(BE[e],r),this._logTargets.forEach(n=>n.logIt(e,r))}trace(e){this._logIt(BE.Trace,e)}debug(e){this._logIt(BE.Debug,e)}info(e){this._logIt(BE.Info,e)}warn(e){this._logIt(BE.Warning,e)}error(e,r){this._logIt(BE.Error,oIi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new rCr(this,e)}withExtraTarget(e){return new lgt(this,[e])}},rCr=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 lgt(this,[e],this._prefix)}},lgt=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(BE.Trace,e),this._parent.trace(e)}debug(e){this._notifyExtraTargets(BE.Debug,e),this._parent.debug(e)}info(e){this._notifyExtraTargets(BE.Info,e),this._parent.info(e)}warn(e){this._notifyExtraTargets(BE.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(BE.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 oIi(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(rIi(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(tIi,"collectErrorMessages");function Zka(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(rIi(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(Zka,"collectSingleLineErrorMessage");function Xka(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(Xka,"sanitizeNetworkErrorForTelemetry");function rIi(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(rIi,"extractChromiumDetails");var lgt=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}};hy.LogMemory=lgt});var E5e=I(y5e=>{"use strict";p();Object.defineProperty(y5e,"__esModule",{value:!0});y5e.ICopilotTokenManager=void 0;y5e.nowSeconds=tPa;var ePa=nn();y5e.ICopilotTokenManager=(0,ePa.createServiceIdentifier)("ICopilotTokenManager");function tPa(){return Math.floor(Date.now()/1e3)}a(tPa,"nowSeconds")});var FE=I(vm=>{"use strict";p();var rPa=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},ugt=vm&&vm.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vm,"__esModule",{value:!0});vm.BaseAuthenticationService=vm.IAuthenticationService=vm.MinimalModeError=vm.GITHUB_SCOPE_ALIGNED=vm.GITHUB_SCOPE_READ_USER=vm.GITHUB_SCOPE_USER_EMAIL=void 0;vm.authProviderId=lPa;var nPa=nn(),dgt=Ic(),iPa=Ro(),oPa=C8(),Cte=Pl(),sPa=Sp(),aPa=E5e(),cPa=XH();vm.GITHUB_SCOPE_USER_EMAIL=["user:email"];vm.GITHUB_SCOPE_READ_USER=["read:user"];vm.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var rCr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};vm.MinimalModeError=rCr;vm.IAuthenticationService=(0,nPa.createServiceIdentifier)("IAuthenticationService");var nCr=class extends iPa.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 dgt.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidCopilotTokenChange=this._register(new dgt.Emitter),this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event,this._onDidAccessTokenChange=this._register(new dgt.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new dgt.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,oPa.derived)(s=>this._configurationService.getConfigObservable(Cte.ConfigKey.Shared.AuthPermissions).read(s)===Cte.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.")}};vm.BaseAuthenticationService=nCr;vm.BaseAuthenticationService=nCr=rPa([ugt(0,sPa.ILogService),ugt(1,cPa.ICopilotTokenStore),ugt(2,aPa.ICopilotTokenManager),ugt(3,Cte.IConfigurationService)],nCr);function lPa(t){return t.getConfig(Cte.ConfigKey.Shared.AuthProvider)===Cte.AuthProviderId.GitHubEnterprise?Cte.AuthProviderId.GitHubEnterprise:Cte.AuthProviderId.GitHub}a(lPa,"authProviderId")});var fgt=I(iCr=>{"use strict";p();Object.defineProperty(iCr,"__esModule",{value:!0});iCr.onCopilotToken=uPa;function uPa(t,e){return t.onDidCopilotTokenChange(()=>{let r=t.copilotToken;r&&e(r)})}a(uPa,"onCopilotToken")});var sCr=I(uD=>{"use strict";p();var dPa=uD&&uD.__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},fPa=uD&&uD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(uD,"__esModule",{value:!0});uD.TelemetryUserConfig=uD.ICompletionsTelemetryUserConfigService=void 0;var pPa=FE(),hPa=nn(),mPa=Ro(),gPa=fgt();function APa(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(APa,"propertiesFromCopilotToken");uD.ICompletionsTelemetryUserConfigService=(0,hPa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var oCr=class extends mPa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,gPa.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=APa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};uD.TelemetryUserConfig=oCr;uD.TelemetryUserConfig=oCr=dPa([fPa(0,pPa.IAuthenticationService)],oCr)});var _5e=I(Oge=>{"use strict";p();Object.defineProperty(Oge,"__esModule",{value:!0});Oge.PromiseQueue=Oge.ICompletionsPromiseQueueService=void 0;var yPa=nn();Oge.ICompletionsPromiseQueueService=(0,yPa.createServiceIdentifier)("completionsPromiseQueueService");var aCr=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)}};Oge.PromiseQueue=aCr});var $g=I(yd=>{"use strict";p();Object.defineProperty(yd,"__esModule",{value:!0});yd.TelemetryReporters=yd.ICompletionsTelemetryReporters=yd.CopilotTelemetryReporter=yd.TelemetryWithExp=yd.TelemetryData=yd.TelemetryStore=void 0;yd.telemetrizePromptLength=kPa;yd.now=Bge;yd.telemetry=gCr;yd.telemetryExpProblem=NPa;yd.telemetryRaw=OPa;yd.telemetryException=oIi;yd.telemetryCatch=LPa;yd.telemetryError=BPa;yd.logEngineCompletion=UPa;yd.logEnginePrompt=QPa;var EPa=U4(),_Pa=nn(),vPa=T0(),dCr=Gs(),pgt=bte(),Q4=LE(),CPa=M0t(),bPa=fy(),SPa=L0t(),TPa=Ovr(),fCr=sCr(),pCr=_5e(),KT;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(KT||(yd.TelemetryStore=KT={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(KT||(yd.TelemetryStore=KT={}));function Lge(t){return t===KT.Enhanced}a(Lge,"isEnhanced");var IPa=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],v5e=8192,xPa=21,q4=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[TPa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Bge())}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=Bge())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(bPa.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(EPa.IEnvService),n=e.get(Q4.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,Q4.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,Q4.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${Q4.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,Q4.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,Q4.dumpForTelemetry)(e);r["copilot.build"]=Q4.BuildInfo.getBuild(),r["copilot.buildType"]=Q4.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(Lge(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>v5e){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+v5e;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(kPa,"telemetrizePromptLength");function Bge(){return performance.now()}a(Bge,"now");function PPa(t){return Math.floor(t/1e3)}a(PPa,"nowSeconds");function mCr(t){return t.get(fCr.ICompletionsTelemetryUserConfigService).optedIn}a(mCr,"shouldSendEnhanced");function nIi(t){return t.get(fCr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(nIi,"shouldSendFinetuningTelemetry");function gCr(t,e,r,n){return t.get(pCr.ICompletionsPromiseQueueService).register(DPa(t,e,Bge(),r?.extendedBy(),n))}a(gCr,"telemetry");async function DPa(t,e,r,n,o=KT.Standard){let s=t.get(pgt.ICompletionsTelemetryService),c=t.get(dCr.IInstantiationService),l=n||q4.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!Lge(o)||c.invokeFunction(mCr))&&hCr(s,o,e,l),Lge(o)&&IPa.includes(e)&&c.invokeFunction(nIi)&&c.invokeFunction(RPa,o,e,l)}a(DPa,"_telemetry");function NPa(t,e){return t.get(pCr.ICompletionsPromiseQueueService).register(MPa(t,e,Bge()))}a(NPa,"telemetryExpProblem");async function MPa(t,e,r){let n=t.get(pgt.ICompletionsTelemetryService),o="expProblem",s=q4.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,KT.Standard,"SkipExp",r),hCr(n,KT.Standard,o,s)}a(MPa,"_telemetryExpProblem");function OPa(t,e,r,n){let o=t.get(pgt.ICompletionsTelemetryService),s={...r,...iIi(t)};hCr(o,KT.Standard,e,{properties:s,measurements:n})}a(OPa,"telemetryRaw");function iIi(t){let e=t.get(Q4.ICompletionsEditorAndPluginInfo),r={unique_id:(0,vPa.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,Q4.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(fCr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(iIi,"createRequiredProperties");function oIi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(oIi,"telemetryException");function LPa(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){oIi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(LPa,"telemetryCatch");function BPa(t,e,r,n){return t.get(pCr.ICompletionsPromiseQueueService).register(FPa(t,e,Bge(),r?.extendedBy(),n))}a(BPa,"telemetryError");async function FPa(t,e,r,n,o=KT.Standard){if(Lge(o)&&!mCr(t))return;let s=t.get(dCr.IInstantiationService),c=n||q4.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(wPa,o,e,c)}a(FPa,"_telemetryError");function UPa(t,e,r,n,o){let s=q4.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),gCr(t,"engine.completion",s,KT.Enhanced)}a(UPa,"logEngineCompletion");function QPa(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 gCr(t,"engine.prompt",o,KT.Enhanced)}a(QPa,"logEnginePrompt");var lCr=class{static{a(this,"CopilotTelemetryReporter")}};yd.CopilotTelemetryReporter=lCr;yd.ICompletionsTelemetryReporters=(0,_Pa.createServiceIdentifier)("ICompletionsTelemetryReporters");var uCr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=KT.Standard){return Lge(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(mCr(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()))}};yd.TelemetryReporters=uCr});var bte=I(dD=>{"use strict";p();var qPa=dD&&dD.__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},jPa=dD&&dD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(dD,"__esModule",{value:!0});dD.CompletionsTelemetryServiceBridge=dD.ICompletionsTelemetryService=void 0;var HPa=gm(),ACr=Ivr(),GPa=nn(),C5e=$g();dD.ICompletionsTelemetryService=(0,GPa.createServiceIdentifier)("completionsTelemetryService");var yCr=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,ACr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??C5e.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,ACr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??C5e.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,ACr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??C5e.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??C5e.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 C5e.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};dD.CompletionsTelemetryServiceBridge=yCr;dD.CompletionsTelemetryServiceBridge=yCr=qPa([jPa(0,HPa.ITelemetryService)],yCr)});var sIi=I(Fge=>{"use strict";p();Object.defineProperty(Fge,"__esModule",{value:!0});Fge.CopilotExtensionStatus=Fge.ICompletionsExtensionStatus=void 0;var $Pa=nn();Fge.ICompletionsExtensionStatus=(0,$Pa.createServiceIdentifier)("ICompletionsExtensionStatus");var ECr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};Fge.CopilotExtensionStatus=ECr});var hgt=I(fD=>{"use strict";p();Object.defineProperty(fD,"__esModule",{value:!0});fD.CopilotToken=void 0;fD.containsInternalOrg=aIi;fD.containsVSCodeOrg=uIi;fD.validateTokenEnvelope=dIi;fD.isTokenEnvelope=JPa;fD.isErrorEnvelope=ZPa;fD.isStandardErrorEnvelope=XPa;fD.createTestExtendedTokenInfo=e2a;var Qn=RG();function aIi(t){return cIi(t)||lIi(t)}a(aIi,"containsInternalOrg");function cIi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(cIi,"containsGitHubOrg");function lIi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(lIi,"containsMicrosoftOrg");function uIi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(uIi,"containsVSCodeOrg");var _Cr=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 aIi(this.organizationList)}get isMicrosoftInternal(){return lIi(this.organizationList)}get isGitHubInternal(){return cIi(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||uIi(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"}};fD.CopilotToken=_Cr;var VPa=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),notification_id:(0,Qn.vRequired)((0,Qn.vString)()),title:(0,Qn.vRequired)((0,Qn.vString)()),url:(0,Qn.vRequired)((0,Qn.vString)())}),WPa=(0,Qn.vObj)({can_signup_for_limited:(0,Qn.vNullable)((0,Qn.vBoolean)()),error_details:(0,Qn.vRequired)(VPa),message:(0,Qn.vRequired)((0,Qn.vString)()),reason:(0,Qn.vString)()}),zPa=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)()),sku:(0,Qn.vString)(),individual:(0,Qn.vBoolean)(),blackbird_clientside_indexing:(0,Qn.vBoolean)(),code_quote_enabled:(0,Qn.vBoolean)(),code_review_enabled:(0,Qn.vBoolean)(),codesearch:(0,Qn.vBoolean)(),copilotignore_enabled:(0,Qn.vBoolean)(),public_suggestions:(0,Qn.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Qn.vEnum)("enabled","disabled"),endpoints:(0,Qn.vObj)({api:(0,Qn.vString)(),"origin-tracker":(0,Qn.vString)(),proxy:(0,Qn.vString)(),telemetry:(0,Qn.vString)()}),enterprise_list:(0,Qn.vNullable)((0,Qn.vArray)((0,Qn.vNumber)())),limited_user_quotas:(0,Qn.vNullable)((0,Qn.vObj)({chat:(0,Qn.vRequired)((0,Qn.vNumber)()),completions:(0,Qn.vRequired)((0,Qn.vNumber)())})),limited_user_reset_date:(0,Qn.vNullable)((0,Qn.vNumber)()),organization_list:(0,Qn.vArray)((0,Qn.vString)())}),YPa=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),documentation_url:(0,Qn.vRequired)((0,Qn.vString)()),status:(0,Qn.vRequired)((0,Qn.vString)())}),KPa=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)())});function dIi(t){let e=zPa.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=KPa.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(dIi,"validateTokenEnvelope");function JPa(t){return dIi(t).valid}a(JPa,"isTokenEnvelope");function ZPa(t){return WPa.validate(t).error===void 0}a(ZPa,"isErrorEnvelope");function XPa(t){return YPa.validate(t).error===void 0}a(XPa,"isStandardErrorEnvelope");function e2a(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(e2a,"createTestExtendedTokenInfo")});var Uge=I(JT=>{"use strict";p();var t2a=JT&&JT.__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},r2a=JT&&JT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(JT,"__esModule",{value:!0});JT.CopilotTokenManagerImpl=JT.ICompletionsCopilotTokenManager=JT.CopilotToken=void 0;var n2a=FE(),i2a=nn(),o2a=nl(),s2a=Ro(),a2a=hgt();Object.defineProperty(JT,"CopilotToken",{enumerable:!0,get:a(function(){return a2a.CopilotToken},"get")});JT.ICompletionsCopilotTokenManager=(0,i2a.createServiceIdentifier)("ICompletionsCopilotTokenManager");var vCr=class extends s2a.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 o2a.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}};JT.CopilotTokenManagerImpl=vCr;JT.CopilotTokenManagerImpl=vCr=t2a([r2a(1,n2a.IAuthenticationService)],vCr)});var mgt=I(Qge=>{"use strict";p();Object.defineProperty(Qge,"__esModule",{value:!0});Qge.NoOpCitationManager=Qge.ICompletionsCitationManager=void 0;var c2a=nn(),l2a=Ro();Qge.ICompletionsCitationManager=(0,c2a.createServiceIdentifier)("ICompletionsCitationManager");var CCr=class{static{a(this,"NoOpCitationManager")}register(){return l2a.Disposable.None}async handleIPCodeCitation(e){}};Qge.NoOpCitationManager=CCr});var Iv=I(Wg=>{"use strict";p();Object.defineProperty(Wg,"__esModule",{value:!0});Wg.HasPropertyKey=u2a;Wg.IsAsyncIterator=d2a;Wg.IsArray=bCr;Wg.IsBigInt=f2a;Wg.IsBoolean=p2a;Wg.IsDate=h2a;Wg.IsFunction=m2a;Wg.IsIterator=g2a;Wg.IsNull=A2a;Wg.IsNumber=y2a;Wg.IsObject=SCr;Wg.IsRegExp=E2a;Wg.IsString=_2a;Wg.IsSymbol=v2a;Wg.IsUint8Array=TCr;Wg.IsUndefined=C2a;function u2a(t,e){return e in t}a(u2a,"HasPropertyKey");function d2a(t){return SCr(t)&&!bCr(t)&&!TCr(t)&&Symbol.asyncIterator in t}a(d2a,"IsAsyncIterator");function bCr(t){return Array.isArray(t)}a(bCr,"IsArray");function f2a(t){return typeof t=="bigint"}a(f2a,"IsBigInt");function p2a(t){return typeof t=="boolean"}a(p2a,"IsBoolean");function h2a(t){return t instanceof globalThis.Date}a(h2a,"IsDate");function m2a(t){return typeof t=="function"}a(m2a,"IsFunction");function g2a(t){return SCr(t)&&!bCr(t)&&!TCr(t)&&Symbol.iterator in t}a(g2a,"IsIterator");function A2a(t){return t===null}a(A2a,"IsNull");function y2a(t){return typeof t=="number"}a(y2a,"IsNumber");function SCr(t){return typeof t=="object"&&t!==null}a(SCr,"IsObject");function E2a(t){return t instanceof globalThis.RegExp}a(E2a,"IsRegExp");function _2a(t){return typeof t=="string"}a(_2a,"IsString");function v2a(t){return typeof t=="symbol"}a(v2a,"IsSymbol");function TCr(t){return t instanceof globalThis.Uint8Array}a(TCr,"IsUint8Array");function C2a(t){return t===void 0}a(C2a,"IsUndefined")});var Yb=I(X8=>{"use strict";p();var b2a=X8&&X8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S2a=X8&&X8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),T2a=X8&&X8.__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;oggt(e))}a(I2a,"ArrayType");function x2a(t){return new Date(t.getTime())}a(x2a,"DateType");function w2a(t){return new Uint8Array(t)}a(w2a,"Uint8ArrayType");function R2a(t){return new RegExp(t.source,t.flags)}a(R2a,"RegExpType");function k2a(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=ggt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=ggt(t[r]);return e}a(k2a,"ObjectType");function ggt(t){return b5e.IsArray(t)?I2a(t):b5e.IsDate(t)?x2a(t):b5e.IsUint8Array(t)?w2a(t):b5e.IsRegExp(t)?R2a(t):b5e.IsObject(t)?k2a(t):t}a(ggt,"Visit");function P2a(t){return ggt(t)}a(P2a,"Clone")});var ygt=I(Agt=>{"use strict";p();Object.defineProperty(Agt,"__esModule",{value:!0});Agt.CloneRest=D2a;Agt.CloneType=pIi;var fIi=Yb();function D2a(t){return t.map(e=>pIi(e))}a(D2a,"CloneRest");function pIi(t,e){return e===void 0?(0,fIi.Clone)(t):(0,fIi.Clone)({...e,...t})}a(pIi,"CloneType")});var ICr=I(MG=>{"use strict";p();var N2a=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]})),hIi=MG&&MG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&N2a(e,t,r)};Object.defineProperty(MG,"__esModule",{value:!0});hIi(ygt(),MG);hIi(Yb(),MG)});var Egt=I(ya=>{"use strict";p();Object.defineProperty(ya,"__esModule",{value:!0});ya.IsAsyncIterator=M2a;ya.IsIterator=O2a;ya.IsStandardObject=L2a;ya.IsInstanceObject=B2a;ya.IsPromise=F2a;ya.IsDate=U2a;ya.IsMap=Q2a;ya.IsSet=q2a;ya.IsRegExp=j2a;ya.IsTypedArray=H2a;ya.IsInt8Array=G2a;ya.IsUint8Array=$2a;ya.IsUint8ClampedArray=V2a;ya.IsInt16Array=W2a;ya.IsUint16Array=z2a;ya.IsInt32Array=Y2a;ya.IsUint32Array=K2a;ya.IsFloat32Array=J2a;ya.IsFloat64Array=Z2a;ya.IsBigInt64Array=X2a;ya.IsBigUint64Array=eDa;ya.HasPropertyKey=tDa;ya.IsObject=S5e;ya.IsArray=mIi;ya.IsUndefined=gIi;ya.IsNull=AIi;ya.IsBoolean=yIi;ya.IsNumber=EIi;ya.IsInteger=rDa;ya.IsBigInt=_Ii;ya.IsString=vIi;ya.IsFunction=CIi;ya.IsSymbol=bIi;ya.IsValueType=nDa;function M2a(t){return S5e(t)&&globalThis.Symbol.asyncIterator in t}a(M2a,"IsAsyncIterator");function O2a(t){return S5e(t)&&globalThis.Symbol.iterator in t}a(O2a,"IsIterator");function L2a(t){return S5e(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(L2a,"IsStandardObject");function B2a(t){return S5e(t)&&!mIi(t)&&CIi(t.constructor)&&t.constructor.name!=="Object"}a(B2a,"IsInstanceObject");function F2a(t){return t instanceof globalThis.Promise}a(F2a,"IsPromise");function U2a(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(U2a,"IsDate");function Q2a(t){return t instanceof globalThis.Map}a(Q2a,"IsMap");function q2a(t){return t instanceof globalThis.Set}a(q2a,"IsSet");function j2a(t){return t instanceof globalThis.RegExp}a(j2a,"IsRegExp");function H2a(t){return globalThis.ArrayBuffer.isView(t)}a(H2a,"IsTypedArray");function G2a(t){return t instanceof globalThis.Int8Array}a(G2a,"IsInt8Array");function $2a(t){return t instanceof globalThis.Uint8Array}a($2a,"IsUint8Array");function V2a(t){return t instanceof globalThis.Uint8ClampedArray}a(V2a,"IsUint8ClampedArray");function W2a(t){return t instanceof globalThis.Int16Array}a(W2a,"IsInt16Array");function z2a(t){return t instanceof globalThis.Uint16Array}a(z2a,"IsUint16Array");function Y2a(t){return t instanceof globalThis.Int32Array}a(Y2a,"IsInt32Array");function K2a(t){return t instanceof globalThis.Uint32Array}a(K2a,"IsUint32Array");function J2a(t){return t instanceof globalThis.Float32Array}a(J2a,"IsFloat32Array");function Z2a(t){return t instanceof globalThis.Float64Array}a(Z2a,"IsFloat64Array");function X2a(t){return t instanceof globalThis.BigInt64Array}a(X2a,"IsBigInt64Array");function eDa(t){return t instanceof globalThis.BigUint64Array}a(eDa,"IsBigUint64Array");function tDa(t,e){return e in t}a(tDa,"HasPropertyKey");function S5e(t){return t!==null&&typeof t=="object"}a(S5e,"IsObject");function mIi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(mIi,"IsArray");function gIi(t){return t===void 0}a(gIi,"IsUndefined");function AIi(t){return t===null}a(AIi,"IsNull");function yIi(t){return typeof t=="boolean"}a(yIi,"IsBoolean");function EIi(t){return typeof t=="number"}a(EIi,"IsNumber");function rDa(t){return globalThis.Number.isInteger(t)}a(rDa,"IsInteger");function _Ii(t){return typeof t=="bigint"}a(_Ii,"IsBigInt");function vIi(t){return typeof t=="string"}a(vIi,"IsString");function CIi(t){return typeof t=="function"}a(CIi,"IsFunction");function bIi(t){return typeof t=="symbol"}a(bIi,"IsSymbol");function nDa(t){return _Ii(t)||yIi(t)||AIi(t)||EIi(t)||vIi(t)||bIi(t)||gIi(t)}a(nDa,"IsValueType")});var R0=I(Ste=>{"use strict";p();var iDa=Ste&&Ste.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oDa=Ste&&Ste.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iDa(e,t,r)};Object.defineProperty(Ste,"__esModule",{value:!0});oDa(Egt(),Ste)});var T5e=I(vgt=>{"use strict";p();Object.defineProperty(vgt,"__esModule",{value:!0});vgt.TypeSystemPolicy=void 0;var _gt=R0(),SIi;(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,_gt.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,_gt.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,_gt.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,_gt.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(SIi||(vgt.TypeSystemPolicy=SIi={}))});var TIi=I(e6=>{"use strict";p();var sDa=e6&&e6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aDa=e6&&e6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cDa=e6&&e6.__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;oCgt(e))}a(lDa,"ImmutableArray");function uDa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Cgt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Cgt(t[r]);return globalThis.Object.freeze(e)}a(uDa,"ImmutableObject");function Cgt(t){return I5e.IsArray(t)?lDa(t):I5e.IsDate(t)?t:I5e.IsUint8Array(t)?t:I5e.IsRegExp(t)?t:I5e.IsObject(t)?uDa(t):t}a(Cgt,"Immutable")});var Ii=I(xCr=>{"use strict";p();Object.defineProperty(xCr,"__esModule",{value:!0});xCr.CreateType=hDa;var dDa=T5e(),fDa=TIi(),pDa=Yb();function hDa(t,e){let r=e!==void 0?{...e,...t}:t;switch(dDa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,fDa.Immutable)(r);case"clone":return(0,pDa.Clone)(r);default:return r}}a(hDa,"CreateType")});var t6=I(Tte=>{"use strict";p();var mDa=Tte&&Tte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gDa=Tte&&Tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mDa(e,t,r)};Object.defineProperty(Tte,"__esModule",{value:!0});gDa(Ii(),Tte)});var RCr=I(bgt=>{"use strict";p();Object.defineProperty(bgt,"__esModule",{value:!0});bgt.TypeBoxError=void 0;var wCr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};bgt.TypeBoxError=wCr});var Nf=I(Ite=>{"use strict";p();var ADa=Ite&&Ite.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yDa=Ite&&Ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ADa(e,t,r)};Object.defineProperty(Ite,"__esModule",{value:!0});yDa(RCr(),Ite)});var x5e=I(IR=>{"use strict";p();Object.defineProperty(IR,"__esModule",{value:!0});IR.Kind=IR.Hint=IR.OptionalKind=IR.ReadonlyKind=IR.TransformKind=void 0;IR.TransformKind=Symbol.for("TypeBox.Transform");IR.ReadonlyKind=Symbol.for("TypeBox.Readonly");IR.OptionalKind=Symbol.for("TypeBox.Optional");IR.Hint=Symbol.for("TypeBox.Hint");IR.Kind=Symbol.for("TypeBox.Kind")});var Sn=I(xte=>{"use strict";p();var EDa=xte&&xte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=xte&&xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EDa(e,t,r)};Object.defineProperty(xte,"__esModule",{value:!0});_Da(x5e(),xte)});var vs=I(ui=>{"use strict";p();var vDa=ui&&ui.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CDa=ui&&ui.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bDa=ui&&ui.__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 ODa=Jn&&Jn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LDa=Jn&&Jn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BDa=Jn&&Jn.__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(PCr,"IsControlCharacterFree");function lxi(t){return DCr(t)||zg(t)}a(lxi,"IsAdditionalProperties");function R5e(t){return si.IsUndefined(t)||si.IsBigInt(t)}a(R5e,"IsOptionalBigInt");function Zl(t){return si.IsUndefined(t)||si.IsNumber(t)}a(Zl,"IsOptionalNumber");function DCr(t){return si.IsUndefined(t)||si.IsBoolean(t)}a(DCr,"IsOptionalBoolean");function pl(t){return si.IsUndefined(t)||si.IsString(t)}a(pl,"IsOptionalString");function QDa(t){return si.IsUndefined(t)||si.IsString(t)&&PCr(t)&&cxi(t)}a(QDa,"IsOptionalPattern");function qDa(t){return si.IsUndefined(t)||si.IsString(t)&&PCr(t)}a(qDa,"IsOptionalFormat");function uxi(t){return si.IsUndefined(t)||zg(t)}a(uxi,"IsOptionalSchema");function jDa(t){return si.IsObject(t)&&t[j4.ReadonlyKind]==="Readonly"}a(jDa,"IsReadonly");function HDa(t){return si.IsObject(t)&&t[j4.OptionalKind]==="Optional"}a(HDa,"IsOptional");function dxi(t){return Vs(t,"Any")&&pl(t.$id)}a(dxi,"IsAny");function fxi(t){return Vs(t,"Argument")&&si.IsNumber(t.index)}a(fxi,"IsArgument");function pxi(t){return Vs(t,"Array")&&t.type==="array"&&pl(t.$id)&&zg(t.items)&&Zl(t.minItems)&&Zl(t.maxItems)&&DCr(t.uniqueItems)&&uxi(t.contains)&&Zl(t.minContains)&&Zl(t.maxContains)}a(pxi,"IsArray");function hxi(t){return Vs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&pl(t.$id)&&zg(t.items)}a(hxi,"IsAsyncIterator");function mxi(t){return Vs(t,"BigInt")&&t.type==="bigint"&&pl(t.$id)&&R5e(t.exclusiveMaximum)&&R5e(t.exclusiveMinimum)&&R5e(t.maximum)&&R5e(t.minimum)&&R5e(t.multipleOf)}a(mxi,"IsBigInt");function gxi(t){return Vs(t,"Boolean")&&t.type==="boolean"&&pl(t.$id)}a(gxi,"IsBoolean");function Axi(t){return Vs(t,"Computed")&&si.IsString(t.target)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))}a(Axi,"IsComputed");function yxi(t){return Vs(t,"Constructor")&&t.type==="Constructor"&&pl(t.$id)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))&&zg(t.returns)}a(yxi,"IsConstructor");function Exi(t){return Vs(t,"Date")&&t.type==="Date"&&pl(t.$id)&&Zl(t.exclusiveMaximumTimestamp)&&Zl(t.exclusiveMinimumTimestamp)&&Zl(t.maximumTimestamp)&&Zl(t.minimumTimestamp)&&Zl(t.multipleOfTimestamp)}a(Exi,"IsDate");function _xi(t){return Vs(t,"Function")&&t.type==="Function"&&pl(t.$id)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))&&zg(t.returns)}a(_xi,"IsFunction");function GDa(t){return Vs(t,"Import")&&si.HasPropertyKey(t,"$defs")&&si.IsObject(t.$defs)&&Sgt(t.$defs)&&si.HasPropertyKey(t,"$ref")&&si.IsString(t.$ref)&&t.$ref in t.$defs}a(GDa,"IsImport");function vxi(t){return Vs(t,"Integer")&&t.type==="integer"&&pl(t.$id)&&Zl(t.exclusiveMaximum)&&Zl(t.exclusiveMinimum)&&Zl(t.maximum)&&Zl(t.minimum)&&Zl(t.multipleOf)}a(vxi,"IsInteger");function Sgt(t){return si.IsObject(t)&&Object.entries(t).every(([e,r])=>PCr(e)&&zg(r))}a(Sgt,"IsProperties");function Cxi(t){return Vs(t,"Intersect")&&!(si.IsString(t.type)&&t.type!=="object")&&si.IsArray(t.allOf)&&t.allOf.every(e=>zg(e)&&!jxi(e))&&pl(t.type)&&(DCr(t.unevaluatedProperties)||uxi(t.unevaluatedProperties))&&pl(t.$id)}a(Cxi,"IsIntersect");function bxi(t){return Vs(t,"Iterator")&&t.type==="Iterator"&&pl(t.$id)&&zg(t.items)}a(bxi,"IsIterator");function Vs(t,e){return si.IsObject(t)&&j4.Kind in t&&t[j4.Kind]===e}a(Vs,"IsKindOf");function Sxi(t){return k5e(t)&&si.IsString(t.const)}a(Sxi,"IsLiteralString");function Txi(t){return k5e(t)&&si.IsNumber(t.const)}a(Txi,"IsLiteralNumber");function $Da(t){return k5e(t)&&si.IsBoolean(t.const)}a($Da,"IsLiteralBoolean");function k5e(t){return Vs(t,"Literal")&&pl(t.$id)&&Ixi(t.const)}a(k5e,"IsLiteral");function Ixi(t){return si.IsBoolean(t)||si.IsNumber(t)||si.IsString(t)}a(Ixi,"IsLiteralValue");function xxi(t){return Vs(t,"MappedKey")&&si.IsArray(t.keys)&&t.keys.every(e=>si.IsNumber(e)||si.IsString(e))}a(xxi,"IsMappedKey");function wxi(t){return Vs(t,"MappedResult")&&Sgt(t.properties)}a(wxi,"IsMappedResult");function Rxi(t){return Vs(t,"Never")&&si.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(Rxi,"IsNever");function kxi(t){return Vs(t,"Not")&&zg(t.not)}a(kxi,"IsNot");function Pxi(t){return Vs(t,"Null")&&t.type==="null"&&pl(t.$id)}a(Pxi,"IsNull");function Dxi(t){return Vs(t,"Number")&&t.type==="number"&&pl(t.$id)&&Zl(t.exclusiveMaximum)&&Zl(t.exclusiveMinimum)&&Zl(t.maximum)&&Zl(t.minimum)&&Zl(t.multipleOf)}a(Dxi,"IsNumber");function Nxi(t){return Vs(t,"Object")&&t.type==="object"&&pl(t.$id)&&Sgt(t.properties)&&lxi(t.additionalProperties)&&Zl(t.minProperties)&&Zl(t.maxProperties)}a(Nxi,"IsObject");function Mxi(t){return Vs(t,"Promise")&&t.type==="Promise"&&pl(t.$id)&&zg(t.item)}a(Mxi,"IsPromise");function Oxi(t){return Vs(t,"Record")&&t.type==="object"&&pl(t.$id)&&lxi(t.additionalProperties)&&si.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&cxi(r[0])&&si.IsObject(e.patternProperties)&&zg(e.patternProperties[r[0]])})(t)}a(Oxi,"IsRecord");function VDa(t){return si.IsObject(t)&&j4.Hint in t&&t[j4.Hint]==="Recursive"}a(VDa,"IsRecursive");function Lxi(t){return Vs(t,"Ref")&&pl(t.$id)&&si.IsString(t.$ref)}a(Lxi,"IsRef");function Bxi(t){return Vs(t,"RegExp")&&pl(t.$id)&&si.IsString(t.source)&&si.IsString(t.flags)&&Zl(t.maxLength)&&Zl(t.minLength)}a(Bxi,"IsRegExp");function Fxi(t){return Vs(t,"String")&&t.type==="string"&&pl(t.$id)&&Zl(t.minLength)&&Zl(t.maxLength)&&QDa(t.pattern)&&qDa(t.format)}a(Fxi,"IsString");function Uxi(t){return Vs(t,"Symbol")&&t.type==="symbol"&&pl(t.$id)}a(Uxi,"IsSymbol");function Qxi(t){return Vs(t,"TemplateLiteral")&&t.type==="string"&&si.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(Qxi,"IsTemplateLiteral");function qxi(t){return Vs(t,"This")&&pl(t.$id)&&si.IsString(t.$ref)}a(qxi,"IsThis");function jxi(t){return si.IsObject(t)&&j4.TransformKind in t}a(jxi,"IsTransform");function Hxi(t){return Vs(t,"Tuple")&&t.type==="array"&&pl(t.$id)&&si.IsNumber(t.minItems)&&si.IsNumber(t.maxItems)&&t.minItems===t.maxItems&&(si.IsUndefined(t.items)&&si.IsUndefined(t.additionalItems)&&t.minItems===0||si.IsArray(t.items)&&t.items.every(e=>zg(e)))}a(Hxi,"IsTuple");function Gxi(t){return Vs(t,"Undefined")&&t.type==="undefined"&&pl(t.$id)}a(Gxi,"IsUndefined");function WDa(t){return NCr(t)&&t.anyOf.every(e=>Sxi(e)||Txi(e))}a(WDa,"IsUnionLiteral");function NCr(t){return Vs(t,"Union")&&pl(t.$id)&&si.IsObject(t)&&si.IsArray(t.anyOf)&&t.anyOf.every(e=>zg(e))}a(NCr,"IsUnion");function $xi(t){return Vs(t,"Uint8Array")&&t.type==="Uint8Array"&&pl(t.$id)&&Zl(t.minByteLength)&&Zl(t.maxByteLength)}a($xi,"IsUint8Array");function Vxi(t){return Vs(t,"Unknown")&&pl(t.$id)}a(Vxi,"IsUnknown");function Wxi(t){return Vs(t,"Unsafe")}a(Wxi,"IsUnsafe");function zxi(t){return Vs(t,"Void")&&t.type==="void"&&pl(t.$id)}a(zxi,"IsVoid");function Yxi(t){return si.IsObject(t)&&j4.Kind in t&&si.IsString(t[j4.Kind])&&!UDa.includes(t[j4.Kind])}a(Yxi,"IsKind");function zg(t){return si.IsObject(t)&&(dxi(t)||fxi(t)||pxi(t)||gxi(t)||mxi(t)||hxi(t)||Axi(t)||yxi(t)||Exi(t)||_xi(t)||vxi(t)||Cxi(t)||bxi(t)||k5e(t)||xxi(t)||wxi(t)||Rxi(t)||kxi(t)||Pxi(t)||Dxi(t)||Nxi(t)||Mxi(t)||Oxi(t)||Lxi(t)||Bxi(t)||Fxi(t)||Uxi(t)||Qxi(t)||qxi(t)||Hxi(t)||Gxi(t)||NCr(t)||$xi(t)||Vxi(t)||Wxi(t)||zxi(t)||Yxi(t))}a(zg,"IsSchema")});var OCr=I(Jb=>{"use strict";p();var zDa=Jb&&Jb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YDa=Jb&&Jb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),MCr=Jb&&Jb.__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(LCr,"__esModule",{value:!0});LCr.Increment=KDa;function KDa(t){return(parseInt(t)+1).toString()}a(KDa,"Increment")});var Zxi=I(wte=>{"use strict";p();var JDa=wte&&wte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZDa=wte&&wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JDa(e,t,r)};Object.defineProperty(wte,"__esModule",{value:!0});ZDa(Jxi(),wte)});var Xxi=I(Tp=>{"use strict";p();Object.defineProperty(Tp,"__esModule",{value:!0});Tp.PatternNeverExact=Tp.PatternStringExact=Tp.PatternNumberExact=Tp.PatternBooleanExact=Tp.PatternNever=Tp.PatternString=Tp.PatternNumber=Tp.PatternBoolean=void 0;Tp.PatternBoolean="(true|false)";Tp.PatternNumber="(0|[1-9][0-9]*)";Tp.PatternString="(.*)";Tp.PatternNever="(?!.*)";Tp.PatternBooleanExact=`^${Tp.PatternBoolean}$`;Tp.PatternNumberExact=`^${Tp.PatternNumber}$`;Tp.PatternStringExact=`^${Tp.PatternString}$`;Tp.PatternNeverExact=`^${Tp.PatternNever}$`});var P5e=I(Rte=>{"use strict";p();var XDa=Rte&&Rte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eNa=Rte&&Rte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XDa(e,t,r)};Object.defineProperty(Rte,"__esModule",{value:!0});eNa(Xxi(),Rte)});var ewi=I(OG=>{"use strict";p();Object.defineProperty(OG,"__esModule",{value:!0});OG.Entries=tNa;OG.Clear=rNa;OG.Delete=nNa;OG.Has=iNa;OG.Set=oNa;OG.Get=sNa;var qge=new Map;function tNa(){return new Map(qge)}a(tNa,"Entries");function rNa(){return qge.clear()}a(rNa,"Clear");function nNa(t){return qge.delete(t)}a(nNa,"Delete");function iNa(t){return qge.has(t)}a(iNa,"Has");function oNa(t,e){qge.set(t,e)}a(oNa,"Set");function sNa(t){return qge.get(t)}a(sNa,"Get")});var twi=I(LG=>{"use strict";p();Object.defineProperty(LG,"__esModule",{value:!0});LG.Entries=aNa;LG.Clear=cNa;LG.Delete=lNa;LG.Has=uNa;LG.Set=dNa;LG.Get=fNa;var jge=new Map;function aNa(){return new Map(jge)}a(aNa,"Entries");function cNa(){return jge.clear()}a(cNa,"Clear");function lNa(t){return jge.delete(t)}a(lNa,"Delete");function uNa(t){return jge.has(t)}a(uNa,"Has");function dNa(t,e){jge.set(t,e)}a(dNa,"Set");function fNa(t){return jge.get(t)}a(fNa,"Get")});var Hge=I(xR=>{"use strict";p();var pNa=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]})),hNa=xR&&xR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rwi=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{"use strict";p();Object.defineProperty(H4,"__esModule",{value:!0});H4.SetIncludes=nwi;H4.SetIsSubset=mNa;H4.SetDistinct=gNa;H4.SetIntersect=iwi;H4.SetUnion=ANa;H4.SetComplement=yNa;H4.SetIntersectMany=_Na;H4.SetUnionMany=vNa;function nwi(t,e){return t.includes(e)}a(nwi,"SetIncludes");function mNa(t,e){return t.every(r=>nwi(e,r))}a(mNa,"SetIsSubset");function gNa(t){return[...new Set(t)]}a(gNa,"SetDistinct");function iwi(t,e){return t.filter(r=>e.includes(r))}a(iwi,"SetIntersect");function ANa(t,e){return[...t,...e]}a(ANa,"SetUnion");function yNa(t,e){return t.filter(r=>!e.includes(r))}a(yNa,"SetComplement");function ENa(t,e){return t.reduce((r,n)=>iwi(r,n),e)}a(ENa,"SetIntersectManyResolve");function _Na(t){return t.length===1?t[0]:t.length>1?ENa(t.slice(1),t[0]):[]}a(_Na,"SetIntersectMany");function vNa(t){let e=[];for(let r of t)e.push(...r);return e}a(vNa,"SetUnionMany")});var D5e=I(kte=>{"use strict";p();var CNa=kte&&kte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bNa=kte&&kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CNa(e,t,r)};Object.defineProperty(kte,"__esModule",{value:!0});bNa(owi(),kte)});var swi=I(BCr=>{"use strict";p();Object.defineProperty(BCr,"__esModule",{value:!0});BCr.Any=INa;var SNa=t6(),TNa=Sn();function INa(t){return(0,SNa.CreateType)({[TNa.Kind]:"Any"},t)}a(INa,"Any")});var Gge=I(Pte=>{"use strict";p();var xNa=Pte&&Pte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wNa=Pte&&Pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xNa(e,t,r)};Object.defineProperty(Pte,"__esModule",{value:!0});wNa(swi(),Pte)});var awi=I(FCr=>{"use strict";p();Object.defineProperty(FCr,"__esModule",{value:!0});FCr.Array=PNa;var RNa=Ii(),kNa=Sn();function PNa(t,e){return(0,RNa.CreateType)({[kNa.Kind]:"Array",type:"array",items:t},e)}a(PNa,"Array")});var $ge=I(Dte=>{"use strict";p();var DNa=Dte&&Dte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NNa=Dte&&Dte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&DNa(e,t,r)};Object.defineProperty(Dte,"__esModule",{value:!0});NNa(awi(),Dte)});var cwi=I(UCr=>{"use strict";p();Object.defineProperty(UCr,"__esModule",{value:!0});UCr.Argument=LNa;var MNa=Ii(),ONa=Sn();function LNa(t){return(0,MNa.CreateType)({[ONa.Kind]:"Argument",index:t})}a(LNa,"Argument")});var Tgt=I(Nte=>{"use strict";p();var BNa=Nte&&Nte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),FNa=Nte&&Nte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&BNa(e,t,r)};Object.defineProperty(Nte,"__esModule",{value:!0});FNa(cwi(),Nte)});var lwi=I(QCr=>{"use strict";p();Object.defineProperty(QCr,"__esModule",{value:!0});QCr.AsyncIterator=qNa;var UNa=Sn(),QNa=Ii();function qNa(t,e){return(0,QNa.CreateType)({[UNa.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(qNa,"AsyncIterator")});var Vge=I(Mte=>{"use strict";p();var jNa=Mte&&Mte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HNa=Mte&&Mte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jNa(e,t,r)};Object.defineProperty(Mte,"__esModule",{value:!0});HNa(lwi(),Mte)});var uwi=I(qCr=>{"use strict";p();Object.defineProperty(qCr,"__esModule",{value:!0});qCr.Computed=VNa;var GNa=t6(),$Na=x5e();function VNa(t,e,r){return(0,GNa.CreateType)({[$Na.Kind]:"Computed",target:t,parameters:e},r)}a(VNa,"Computed")});var BG=I(Ote=>{"use strict";p();var WNa=Ote&&Ote.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zNa=Ote&&Ote.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WNa(e,t,r)};Object.defineProperty(Ote,"__esModule",{value:!0});zNa(uwi(),Ote)});var Igt=I(jCr=>{"use strict";p();Object.defineProperty(jCr,"__esModule",{value:!0});jCr.Discard=KNa;function YNa(t,e){let{[e]:r,...n}=t;return n}a(YNa,"DiscardKey");function KNa(t,e){return e.reduce((r,n)=>YNa(r,n),t)}a(KNa,"Discard")});var n6=I(Lte=>{"use strict";p();var JNa=Lte&&Lte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZNa=Lte&&Lte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JNa(e,t,r)};Object.defineProperty(Lte,"__esModule",{value:!0});ZNa(Igt(),Lte)});var dwi=I(HCr=>{"use strict";p();Object.defineProperty(HCr,"__esModule",{value:!0});HCr.Never=tMa;var XNa=Ii(),eMa=Sn();function tMa(t){return(0,XNa.CreateType)({[eMa.Kind]:"Never",not:{}},t)}a(tMa,"Never")});var Cm=I(Bte=>{"use strict";p();var rMa=Bte&&Bte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nMa=Bte&&Bte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rMa(e,t,r)};Object.defineProperty(Bte,"__esModule",{value:!0});nMa(dwi(),Bte)});var fwi=I(GCr=>{"use strict";p();Object.defineProperty(GCr,"__esModule",{value:!0});GCr.MappedKey=sMa;var iMa=Ii(),oMa=Sn();function sMa(t){return(0,iMa.CreateType)({[oMa.Kind]:"MappedKey",keys:t})}a(sMa,"MappedKey")});var VCr=I($Cr=>{"use strict";p();Object.defineProperty($Cr,"__esModule",{value:!0});$Cr.MappedResult=lMa;var aMa=Ii(),cMa=Sn();function lMa(t){return(0,aMa.CreateType)({[cMa.Kind]:"MappedResult",properties:t})}a(lMa,"MappedResult")});var pwi=I(WCr=>{"use strict";p();Object.defineProperty(WCr,"__esModule",{value:!0});WCr.Constructor=fMa;var uMa=Ii(),dMa=Sn();function fMa(t,e,r){return(0,uMa.CreateType)({[dMa.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(fMa,"Constructor")});var Wge=I(Fte=>{"use strict";p();var pMa=Fte&&Fte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hMa=Fte&&Fte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pMa(e,t,r)};Object.defineProperty(Fte,"__esModule",{value:!0});hMa(pwi(),Fte)});var hwi=I(zCr=>{"use strict";p();Object.defineProperty(zCr,"__esModule",{value:!0});zCr.Function=AMa;var mMa=Ii(),gMa=Sn();function AMa(t,e,r){return(0,mMa.CreateType)({[gMa.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(AMa,"Function")});var FG=I(Ute=>{"use strict";p();var yMa=Ute&&Ute.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EMa=Ute&&Ute.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yMa(e,t,r)};Object.defineProperty(Ute,"__esModule",{value:!0});EMa(hwi(),Ute)});var KCr=I(YCr=>{"use strict";p();Object.defineProperty(YCr,"__esModule",{value:!0});YCr.UnionCreate=CMa;var _Ma=Ii(),vMa=Sn();function CMa(t,e){return(0,_Ma.CreateType)({[vMa.Kind]:"Union",anyOf:t},e)}a(CMa,"UnionCreate")});var ywi=I(JCr=>{"use strict";p();Object.defineProperty(JCr,"__esModule",{value:!0});JCr.UnionEvaluated=PMa;var bMa=Ii(),SMa=Sn(),TMa=n6(),IMa=Cm(),xMa=G4(),mwi=KCr(),Awi=vs();function wMa(t){return t.some(e=>(0,Awi.IsOptional)(e))}a(wMa,"IsUnionOptional");function gwi(t){return t.map(e=>(0,Awi.IsOptional)(e)?RMa(e):e)}a(gwi,"RemoveOptionalFromRest");function RMa(t){return(0,TMa.Discard)(t,[SMa.OptionalKind])}a(RMa,"RemoveOptionalFromType");function kMa(t,e){return wMa(t)?(0,xMa.Optional)((0,mwi.UnionCreate)(gwi(t),e)):(0,mwi.UnionCreate)(gwi(t),e)}a(kMa,"ResolveUnion");function PMa(t,e){return t.length===1?(0,bMa.CreateType)(t[0],e):t.length===0?(0,IMa.Never)(e):kMa(t,e)}a(PMa,"UnionEvaluated")});var _wi=I(Ewi=>{"use strict";p();Object.defineProperty(Ewi,"__esModule",{value:!0});var ZSp=Sn()});var vwi=I(ZCr=>{"use strict";p();Object.defineProperty(ZCr,"__esModule",{value:!0});ZCr.Union=OMa;var DMa=Cm(),NMa=Ii(),MMa=KCr();function OMa(t,e){return t.length===0?(0,DMa.Never)(e):t.length===1?(0,NMa.CreateType)(t[0],e):(0,MMa.UnionCreate)(t,e)}a(OMa,"Union")});var Ip=I(i6=>{"use strict";p();var LMa=i6&&i6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XCr=i6&&i6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LMa(e,t,r)};Object.defineProperty(i6,"__esModule",{value:!0});XCr(ywi(),i6);XCr(_wi(),i6);XCr(vwi(),i6)});var xgt=I(zge=>{"use strict";p();Object.defineProperty(zge,"__esModule",{value:!0});zge.TemplateLiteralParserError=void 0;zge.TemplateLiteralParse=Qte;zge.TemplateLiteralParseExact=$Ma;var BMa=Nf(),N5e=class extends BMa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};zge.TemplateLiteralParserError=N5e;function FMa(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(FMa,"Unescape");function ebr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(ebr,"IsNonEscaped");function o6(t,e){return ebr(t,e,"(")}a(o6,"IsOpenParen");function M5e(t,e){return ebr(t,e,")")}a(M5e,"IsCloseParen");function Cwi(t,e){return ebr(t,e,"|")}a(Cwi,"IsSeparator");function UMa(t){if(!(o6(t,0)&&M5e(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Qte(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Qte(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(HMa,"Or");function GMa(t){function e(o,s){if(!o6(o,s))throw new N5e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Qte(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(GMa,"And");function Qte(t){return UMa(t)?Qte(QMa(t)):qMa(t)?HMa(t):jMa(t)?GMa(t):{type:"const",const:FMa(t)}}a(Qte,"TemplateLiteralParse");function $Ma(t){return Qte(t.slice(1,t.length-1))}a($Ma,"TemplateLiteralParseExact")});var tbr=I(Yge=>{"use strict";p();Object.defineProperty(Yge,"__esModule",{value:!0});Yge.TemplateLiteralFiniteError=void 0;Yge.IsTemplateLiteralExpressionFinite=Rgt;Yge.IsTemplateLiteralFinite=JMa;var VMa=xgt(),WMa=Nf(),wgt=class extends WMa.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};Yge.TemplateLiteralFiniteError=wgt;function zMa(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(zMa,"IsNumberExpression");function YMa(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(YMa,"IsBooleanExpression");function KMa(t){return t.type==="const"&&t.const===".*"}a(KMa,"IsStringExpression");function Rgt(t){return zMa(t)||KMa(t)?!1:YMa(t)?!0:t.type==="and"?t.expr.every(e=>Rgt(e)):t.type==="or"?t.expr.every(e=>Rgt(e)):t.type==="const"?!0:(()=>{throw new wgt("Unknown expression type")})()}a(Rgt,"IsTemplateLiteralExpressionFinite");function JMa(t){let e=(0,VMa.TemplateLiteralParseExact)(t.pattern);return Rgt(e)}a(JMa,"IsTemplateLiteralFinite")});var rbr=I(Kge=>{"use strict";p();Object.defineProperty(Kge,"__esModule",{value:!0});Kge.TemplateLiteralGenerateError=void 0;Kge.TemplateLiteralExpressionGenerate=Pgt;Kge.TemplateLiteralGenerate=iOa;var ZMa=tbr(),XMa=xgt(),eOa=Nf(),kgt=class extends eOa.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};Kge.TemplateLiteralGenerateError=kgt;function*bwi(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of bwi(t.slice(1)))yield`${e}${r}`}a(bwi,"GenerateReduce");function*tOa(t){return yield*bwi(t.expr.map(e=>[...Pgt(e)]))}a(tOa,"GenerateAnd");function*rOa(t){for(let e of t.expr)yield*Pgt(e)}a(rOa,"GenerateOr");function*nOa(t){return yield t.const}a(nOa,"GenerateConst");function*Pgt(t){return t.type==="and"?yield*tOa(t):t.type==="or"?yield*rOa(t):t.type==="const"?yield*nOa(t):(()=>{throw new kgt("Unknown expression")})()}a(Pgt,"TemplateLiteralExpressionGenerate");function iOa(t){let e=(0,XMa.TemplateLiteralParseExact)(t.pattern);return(0,ZMa.IsTemplateLiteralExpressionFinite)(e)?[...Pgt(e)]:[]}a(iOa,"TemplateLiteralGenerate")});var Swi=I(nbr=>{"use strict";p();Object.defineProperty(nbr,"__esModule",{value:!0});nbr.Literal=aOa;var oOa=Ii(),sOa=Sn();function aOa(t,e){return(0,oOa.CreateType)({[sOa.Kind]:"Literal",const:t,type:typeof t},e)}a(aOa,"Literal")});var UE=I(qte=>{"use strict";p();var cOa=qte&&qte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lOa=qte&&qte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cOa(e,t,r)};Object.defineProperty(qte,"__esModule",{value:!0});lOa(Swi(),qte)});var Twi=I(ibr=>{"use strict";p();Object.defineProperty(ibr,"__esModule",{value:!0});ibr.Boolean=fOa;var uOa=Sn(),dOa=t6();function fOa(t){return(0,dOa.CreateType)({[uOa.Kind]:"Boolean",type:"boolean"},t)}a(fOa,"Boolean")});var O5e=I(jte=>{"use strict";p();var pOa=jte&&jte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hOa=jte&&jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pOa(e,t,r)};Object.defineProperty(jte,"__esModule",{value:!0});hOa(Twi(),jte)});var Iwi=I(obr=>{"use strict";p();Object.defineProperty(obr,"__esModule",{value:!0});obr.BigInt=AOa;var mOa=Sn(),gOa=t6();function AOa(t){return(0,gOa.CreateType)({[mOa.Kind]:"BigInt",type:"bigint"},t)}a(AOa,"BigInt")});var Jge=I(Hte=>{"use strict";p();var yOa=Hte&&Hte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EOa=Hte&&Hte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yOa(e,t,r)};Object.defineProperty(Hte,"__esModule",{value:!0});EOa(Iwi(),Hte)});var xwi=I(sbr=>{"use strict";p();Object.defineProperty(sbr,"__esModule",{value:!0});sbr.Number=COa;var _Oa=Ii(),vOa=Sn();function COa(t){return(0,_Oa.CreateType)({[vOa.Kind]:"Number",type:"number"},t)}a(COa,"Number")});var UG=I(Gte=>{"use strict";p();var bOa=Gte&&Gte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SOa=Gte&&Gte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bOa(e,t,r)};Object.defineProperty(Gte,"__esModule",{value:!0});SOa(xwi(),Gte)});var wwi=I(abr=>{"use strict";p();Object.defineProperty(abr,"__esModule",{value:!0});abr.String=xOa;var TOa=Ii(),IOa=Sn();function xOa(t){return(0,TOa.CreateType)({[IOa.Kind]:"String",type:"string"},t)}a(xOa,"String")});var QG=I($te=>{"use strict";p();var wOa=$te&&$te.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ROa=$te&&$te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wOa(e,t,r)};Object.defineProperty($te,"__esModule",{value:!0});ROa(wwi(),$te)});var ubr=I(lbr=>{"use strict";p();Object.defineProperty(lbr,"__esModule",{value:!0});lbr.TemplateLiteralSyntax=FOa;var L5e=UE(),kOa=O5e(),POa=Jge(),DOa=UG(),NOa=QG(),MOa=Ip(),OOa=Cm();function*LOa(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,kOa.Boolean)():e==="number"?yield(0,DOa.Number)():e==="bigint"?yield(0,POa.BigInt)():e==="string"?yield(0,NOa.String)():yield(()=>{let r=e.split("|").map(n=>(0,L5e.Literal)(n.trim()));return r.length===0?(0,OOa.Never)():r.length===1?r[0]:(0,MOa.UnionEvaluated)(r)})()}a(LOa,"FromUnion");function*BOa(t){if(t[1]!=="{"){let e=(0,L5e.Literal)("$"),r=cbr(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(F5e,"__esModule",{value:!0});F5e.TemplateLiteralPatternError=void 0;F5e.TemplateLiteralPattern=jOa;var B5e=P5e(),UOa=Sn(),QOa=Nf(),qG=vs(),Dgt=class extends QOa.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};F5e.TemplateLiteralPatternError=Dgt;function qOa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(qOa,"Escape");function Rwi(t,e){return(0,qG.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,qG.IsUnion)(t)?`(${t.anyOf.map(r=>Rwi(r,e)).join("|")})`:(0,qG.IsNumber)(t)?`${e}${B5e.PatternNumber}`:(0,qG.IsInteger)(t)?`${e}${B5e.PatternNumber}`:(0,qG.IsBigInt)(t)?`${e}${B5e.PatternNumber}`:(0,qG.IsString)(t)?`${e}${B5e.PatternString}`:(0,qG.IsLiteral)(t)?`${e}${qOa(t.const.toString())}`:(0,qG.IsBoolean)(t)?`${e}${B5e.PatternBoolean}`:(()=>{throw new Dgt(`Unexpected Kind '${t[UOa.Kind]}'`)})()}a(Rwi,"Visit");function jOa(t){return`^${t.map(e=>Rwi(e,"")).join("")}$`}a(jOa,"TemplateLiteralPattern")});var kwi=I(fbr=>{"use strict";p();Object.defineProperty(fbr,"__esModule",{value:!0});fbr.TemplateLiteralToUnion=VOa;var HOa=Ip(),GOa=UE(),$Oa=rbr();function VOa(t){let r=(0,$Oa.TemplateLiteralGenerate)(t).map(n=>(0,GOa.Literal)(n));return(0,HOa.UnionEvaluated)(r)}a(VOa,"TemplateLiteralToUnion")});var Dwi=I(pbr=>{"use strict";p();Object.defineProperty(pbr,"__esModule",{value:!0});pbr.TemplateLiteral=JOa;var WOa=Ii(),zOa=ubr(),Pwi=dbr(),YOa=Iv(),KOa=Sn();function JOa(t,e){let r=(0,YOa.IsString)(t)?(0,Pwi.TemplateLiteralPattern)((0,zOa.TemplateLiteralSyntax)(t)):(0,Pwi.TemplateLiteralPattern)(t);return(0,WOa.CreateType)({[KOa.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(JOa,"TemplateLiteral")});var pD=I(ZT=>{"use strict";p();var ZOa=ZT&&ZT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vte=ZT&&ZT.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZOa(e,t,r)};Object.defineProperty(ZT,"__esModule",{value:!0});Vte(tbr(),ZT);Vte(rbr(),ZT);Vte(ubr(),ZT);Vte(xgt(),ZT);Vte(dbr(),ZT);Vte(kwi(),ZT);Vte(Dwi(),ZT)});var Ngt=I(hbr=>{"use strict";p();Object.defineProperty(hbr,"__esModule",{value:!0});hbr.IndexPropertyKeys=Nwi;var XOa=pD(),U5e=vs();function e5a(t){return(0,XOa.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(e5a,"FromTemplateLiteral");function t5a(t){let e=[];for(let r of t)e.push(...Nwi(r));return e}a(t5a,"FromUnion");function r5a(t){return[t.toString()]}a(r5a,"FromLiteral");function Nwi(t){return[...new Set((0,U5e.IsTemplateLiteral)(t)?e5a(t):(0,U5e.IsUnion)(t)?t5a(t.anyOf):(0,U5e.IsLiteral)(t)?r5a(t.const):(0,U5e.IsNumber)(t)?["[number]"]:(0,U5e.IsInteger)(t)?["[number]"]:[])]}a(Nwi,"IndexPropertyKeys")});var gbr=I(mbr=>{"use strict";p();Object.defineProperty(mbr,"__esModule",{value:!0});mbr.IndexFromMappedResult=c5a;var n5a=bm(),i5a=Ngt(),o5a=hD();function s5a(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,o5a.Index)(t,(0,i5a.IndexPropertyKeys)(e[o]),r);return n}a(s5a,"FromProperties");function a5a(t,e,r){return s5a(t,e.properties,r)}a(a5a,"FromMappedResult");function c5a(t,e,r){let n=a5a(t,e,r);return(0,n5a.MappedResult)(n)}a(c5a,"IndexFromMappedResult")});var Ogt=I(Zge=>{"use strict";p();Object.defineProperty(Zge,"__esModule",{value:!0});Zge.IndexFromPropertyKey=ybr;Zge.IndexFromPropertyKeys=Bwi;Zge.IndexFromComputed=C5a;Zge.Index=b5a;var l5a=Ii(),u5a=Nf(),Owi=BG(),Mgt=Cm(),d5a=XT(),Abr=Ip(),f5a=Ngt(),p5a=Ebr(),h5a=gbr(),Zb=vs();function Lwi(t,e){return t.map(r=>ybr(r,e))}a(Lwi,"FromRest");function m5a(t){return t.filter(e=>!(0,Zb.IsNever)(e))}a(m5a,"FromIntersectRest");function g5a(t,e){return(0,d5a.IntersectEvaluated)(m5a(Lwi(t,e)))}a(g5a,"FromIntersect");function A5a(t){return t.some(e=>(0,Zb.IsNever)(e))?[]:t}a(A5a,"FromUnionRest");function y5a(t,e){return(0,Abr.UnionEvaluated)(A5a(Lwi(t,e)))}a(y5a,"FromUnion");function E5a(t,e){return e in t?t[e]:e==="[number]"?(0,Abr.UnionEvaluated)(t):(0,Mgt.Never)()}a(E5a,"FromTuple");function _5a(t,e){return e==="[number]"?t:(0,Mgt.Never)()}a(_5a,"FromArray");function v5a(t,e){return e in t?t[e]:(0,Mgt.Never)()}a(v5a,"FromProperty");function ybr(t,e){return(0,Zb.IsIntersect)(t)?g5a(t.allOf,e):(0,Zb.IsUnion)(t)?y5a(t.anyOf,e):(0,Zb.IsTuple)(t)?E5a(t.items??[],e):(0,Zb.IsArray)(t)?_5a(t.items,e):(0,Zb.IsObject)(t)?v5a(t.properties,e):(0,Mgt.Never)()}a(ybr,"IndexFromPropertyKey");function Bwi(t,e){return e.map(r=>ybr(t,r))}a(Bwi,"IndexFromPropertyKeys");function Mwi(t,e){return(0,Abr.UnionEvaluated)(Bwi(t,e))}a(Mwi,"FromSchema");function C5a(t,e){return(0,Owi.Computed)("Index",[t,e])}a(C5a,"IndexFromComputed");function b5a(t,e,r){if((0,Zb.IsRef)(t)||(0,Zb.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,Zb.IsSchema)(t)||!(0,Zb.IsSchema)(e))throw new u5a.TypeBoxError(n);return(0,Owi.Computed)("Index",[t,e])}return(0,Zb.IsMappedResult)(e)?(0,h5a.IndexFromMappedResult)(t,e,r):(0,Zb.IsMappedKey)(e)?(0,p5a.IndexFromMappedKey)(t,e,r):(0,l5a.CreateType)((0,Zb.IsSchema)(e)?Mwi(t,(0,f5a.IndexPropertyKeys)(e)):Mwi(t,e),r)}a(b5a,"Index")});var Ebr=I(_br=>{"use strict";p();Object.defineProperty(_br,"__esModule",{value:!0});_br.IndexFromMappedKey=k5a;var S5a=Ogt(),T5a=bm(),I5a=Yb();function x5a(t,e,r){return{[e]:(0,S5a.Index)(t,[e],(0,I5a.Clone)(r))}}a(x5a,"MappedIndexPropertyKey");function w5a(t,e,r){return e.reduce((n,o)=>({...n,...x5a(t,o,r)}),{})}a(w5a,"MappedIndexPropertyKeys");function R5a(t,e,r){return w5a(t,e.keys,r)}a(R5a,"MappedIndexProperties");function k5a(t,e,r){let n=R5a(t,e,r);return(0,T5a.MappedResult)(n)}a(k5a,"IndexFromMappedKey")});var hD=I($4=>{"use strict";p();var P5a=$4&&$4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lgt=$4&&$4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P5a(e,t,r)};Object.defineProperty($4,"__esModule",{value:!0});Lgt(Ebr(),$4);Lgt(gbr(),$4);Lgt(Ngt(),$4);Lgt(Ogt(),$4)});var Fwi=I(vbr=>{"use strict";p();Object.defineProperty(vbr,"__esModule",{value:!0});vbr.Iterator=M5a;var D5a=Ii(),N5a=Sn();function M5a(t,e){return(0,D5a.CreateType)({[N5a.Kind]:"Iterator",type:"Iterator",items:t},e)}a(M5a,"Iterator")});var Xge=I(Wte=>{"use strict";p();var O5a=Wte&&Wte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L5a=Wte&&Wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O5a(e,t,r)};Object.defineProperty(Wte,"__esModule",{value:!0});L5a(Fwi(),Wte)});var Qwi=I(Bgt=>{"use strict";p();Object.defineProperty(Bgt,"__esModule",{value:!0});Bgt.Object=void 0;var B5a=Ii(),Uwi=Sn(),F5a=vs();function U5a(t){return globalThis.Object.keys(t).filter(e=>!(0,F5a.IsOptional)(t[e]))}a(U5a,"RequiredArray");function Q5a(t,e){let r=U5a(t),n=r.length>0?{[Uwi.Kind]:"Object",type:"object",required:r,properties:t}:{[Uwi.Kind]:"Object",type:"object",properties:t};return(0,B5a.CreateType)(n,e)}a(Q5a,"_Object");Bgt.Object=Q5a});var xv=I(zte=>{"use strict";p();var q5a=zte&&zte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=zte&&zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&q5a(e,t,r)};Object.defineProperty(zte,"__esModule",{value:!0});j5a(Qwi(),zte)});var qwi=I(Cbr=>{"use strict";p();Object.defineProperty(Cbr,"__esModule",{value:!0});Cbr.Promise=$5a;var H5a=Ii(),G5a=Sn();function $5a(t,e){return(0,H5a.CreateType)({[G5a.Kind]:"Promise",type:"Promise",item:t},e)}a($5a,"Promise")});var Q5e=I(Yte=>{"use strict";p();var V5a=Yte&&Yte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),W5a=Yte&&Yte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V5a(e,t,r)};Object.defineProperty(Yte,"__esModule",{value:!0});W5a(qwi(),Yte)});var Sbr=I(bbr=>{"use strict";p();Object.defineProperty(bbr,"__esModule",{value:!0});bbr.Readonly=e4a;var jwi=Ii(),Hwi=Sn(),z5a=n6(),Y5a=Tbr(),K5a=vs();function J5a(t){return(0,jwi.CreateType)((0,z5a.Discard)(t,[Hwi.ReadonlyKind]))}a(J5a,"RemoveReadonly");function Z5a(t){return(0,jwi.CreateType)({...t,[Hwi.ReadonlyKind]:"Readonly"})}a(Z5a,"AddReadonly");function X5a(t,e){return e===!1?J5a(t):Z5a(t)}a(X5a,"ReadonlyWithFlag");function e4a(t,e){let r=e??!0;return(0,K5a.IsMappedResult)(t)?(0,Y5a.ReadonlyFromMappedResult)(t,r):X5a(t,r)}a(e4a,"Readonly")});var Tbr=I(Ibr=>{"use strict";p();Object.defineProperty(Ibr,"__esModule",{value:!0});Ibr.ReadonlyFromMappedResult=o4a;var t4a=bm(),r4a=Sbr();function n4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,r4a.Readonly)(t[n],e);return r}a(n4a,"FromProperties");function i4a(t,e){return n4a(t.properties,e)}a(i4a,"FromMappedResult");function o4a(t,e){let r=i4a(t,e);return(0,t4a.MappedResult)(r)}a(o4a,"ReadonlyFromMappedResult")});var HG=I(jG=>{"use strict";p();var s4a=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]})),Gwi=jG&&jG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s4a(e,t,r)};Object.defineProperty(jG,"__esModule",{value:!0});Gwi(Tbr(),jG);Gwi(Sbr(),jG)});var Vwi=I(xbr=>{"use strict";p();Object.defineProperty(xbr,"__esModule",{value:!0});xbr.Tuple=c4a;var a4a=Ii(),$wi=Sn();function c4a(t,e){return(0,a4a.CreateType)(t.length>0?{[$wi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[$wi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(c4a,"Tuple")});var s6=I(Kte=>{"use strict";p();var l4a=Kte&&Kte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),u4a=Kte&&Kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&l4a(e,t,r)};Object.defineProperty(Kte,"__esModule",{value:!0});u4a(Vwi(),Kte)});var Zwi=I(Fgt=>{"use strict";p();Object.defineProperty(Fgt,"__esModule",{value:!0});Fgt.MappedFunctionReturnType=Jwi;Fgt.Mapped=k4a;var wbr=Sn(),Wwi=n6(),d4a=$ge(),f4a=Vge(),p4a=Wge(),h4a=FG(),m4a=hD(),g4a=XT(),A4a=Xge(),zwi=UE(),Ywi=xv(),y4a=G4(),E4a=Q5e(),_4a=HG(),v4a=s6(),C4a=Ip(),b4a=D5e(),S4a=VCr(),wv=vs();function Kwi(t,e){return t in e?wR(t,e[t]):(0,S4a.MappedResult)(e)}a(Kwi,"FromMappedResult");function T4a(t){return{[t]:(0,zwi.Literal)(t)}}a(T4a,"MappedKeyToKnownMappedResultProperties");function I4a(t){let e={};for(let r of t)e[r]=(0,zwi.Literal)(r);return e}a(I4a,"MappedKeyToUnknownMappedResultProperties");function x4a(t,e){return(0,b4a.SetIncludes)(e,t)?T4a(t):I4a(e)}a(x4a,"MappedKeyToMappedResultProperties");function w4a(t,e){let r=x4a(t,e);return Kwi(t,r)}a(w4a,"FromMappedKey");function q5e(t,e){return e.map(r=>wR(t,r))}a(q5e,"FromRest");function R4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=wR(t,e[n]);return r}a(R4a,"FromProperties");function wR(t,e){let r={...e};return(0,wv.IsOptional)(e)?(0,y4a.Optional)(wR(t,(0,Wwi.Discard)(e,[wbr.OptionalKind]))):(0,wv.IsReadonly)(e)?(0,_4a.Readonly)(wR(t,(0,Wwi.Discard)(e,[wbr.ReadonlyKind]))):(0,wv.IsMappedResult)(e)?Kwi(t,e.properties):(0,wv.IsMappedKey)(e)?w4a(t,e.keys):(0,wv.IsConstructor)(e)?(0,p4a.Constructor)(q5e(t,e.parameters),wR(t,e.returns),r):(0,wv.IsFunction)(e)?(0,h4a.Function)(q5e(t,e.parameters),wR(t,e.returns),r):(0,wv.IsAsyncIterator)(e)?(0,f4a.AsyncIterator)(wR(t,e.items),r):(0,wv.IsIterator)(e)?(0,A4a.Iterator)(wR(t,e.items),r):(0,wv.IsIntersect)(e)?(0,g4a.Intersect)(q5e(t,e.allOf),r):(0,wv.IsUnion)(e)?(0,C4a.Union)(q5e(t,e.anyOf),r):(0,wv.IsTuple)(e)?(0,v4a.Tuple)(q5e(t,e.items??[]),r):(0,wv.IsObject)(e)?(0,Ywi.Object)(R4a(t,e.properties),r):(0,wv.IsArray)(e)?(0,d4a.Array)(wR(t,e.items),r):(0,wv.IsPromise)(e)?(0,E4a.Promise)(wR(t,e.item),r):e}a(wR,"FromSchemaType");function Jwi(t,e){let r={};for(let n of t)r[n]=wR(n,e);return r}a(Jwi,"MappedFunctionReturnType");function k4a(t,e,r){let n=(0,wv.IsSchema)(t)?(0,m4a.IndexPropertyKeys)(t):t,o=e({[wbr.Kind]:"MappedKey",keys:n}),s=Jwi(n,o);return(0,Ywi.Object)(s,r)}a(k4a,"Mapped")});var bm=I(a6=>{"use strict";p();var P4a=a6&&a6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Rbr=a6&&a6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P4a(e,t,r)};Object.defineProperty(a6,"__esModule",{value:!0});Rbr(fwi(),a6);Rbr(VCr(),a6);Rbr(Zwi(),a6)});var Pbr=I(kbr=>{"use strict";p();Object.defineProperty(kbr,"__esModule",{value:!0});kbr.Optional=F4a;var Xwi=Ii(),eRi=Sn(),D4a=n6(),N4a=Dbr(),M4a=vs();function O4a(t){return(0,Xwi.CreateType)((0,D4a.Discard)(t,[eRi.OptionalKind]))}a(O4a,"RemoveOptional");function L4a(t){return(0,Xwi.CreateType)({...t,[eRi.OptionalKind]:"Optional"})}a(L4a,"AddOptional");function B4a(t,e){return e===!1?O4a(t):L4a(t)}a(B4a,"OptionalWithFlag");function F4a(t,e){let r=e??!0;return(0,M4a.IsMappedResult)(t)?(0,N4a.OptionalFromMappedResult)(t,r):B4a(t,r)}a(F4a,"Optional")});var Dbr=I(Nbr=>{"use strict";p();Object.defineProperty(Nbr,"__esModule",{value:!0});Nbr.OptionalFromMappedResult=H4a;var U4a=bm(),Q4a=Pbr();function q4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,Q4a.Optional)(t[n],e);return r}a(q4a,"FromProperties");function j4a(t,e){return q4a(t.properties,e)}a(j4a,"FromMappedResult");function H4a(t,e){let r=j4a(t,e);return(0,U4a.MappedResult)(r)}a(H4a,"OptionalFromMappedResult")});var G4=I(GG=>{"use strict";p();var G4a=GG&&GG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tRi=GG&&GG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&G4a(e,t,r)};Object.defineProperty(GG,"__esModule",{value:!0});tRi(Dbr(),GG);tRi(Pbr(),GG)});var Lbr=I(Obr=>{"use strict";p();Object.defineProperty(Obr,"__esModule",{value:!0});Obr.IntersectCreate=V4a;var $4a=Ii(),rRi=Sn(),Mbr=vs();function V4a(t,e={}){let r=t.every(o=>(0,Mbr.IsObject)(o)),n=(0,Mbr.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,$4a.CreateType)(e.unevaluatedProperties===!1||(0,Mbr.IsSchema)(e.unevaluatedProperties)||r?{...n,[rRi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[rRi.Kind]:"Intersect",allOf:t},e)}a(V4a,"IntersectCreate")});var oRi=I(Fbr=>{"use strict";p();Object.defineProperty(Fbr,"__esModule",{value:!0});Fbr.IntersectEvaluated=tLa;var W4a=Sn(),z4a=Ii(),Y4a=n6(),K4a=Cm(),J4a=G4(),nRi=Lbr(),Bbr=vs();function Z4a(t){return t.every(e=>(0,Bbr.IsOptional)(e))}a(Z4a,"IsIntersectOptional");function X4a(t){return(0,Y4a.Discard)(t,[W4a.OptionalKind])}a(X4a,"RemoveOptionalFromType");function iRi(t){return t.map(e=>(0,Bbr.IsOptional)(e)?X4a(e):e)}a(iRi,"RemoveOptionalFromRest");function eLa(t,e){return Z4a(t)?(0,J4a.Optional)((0,nRi.IntersectCreate)(iRi(t),e)):(0,nRi.IntersectCreate)(iRi(t),e)}a(eLa,"ResolveIntersect");function tLa(t,e={}){if(t.length===1)return(0,z4a.CreateType)(t[0],e);if(t.length===0)return(0,K4a.Never)(e);if(t.some(r=>(0,Bbr.IsTransform)(r)))throw new Error("Cannot intersect transform types");return eLa(t,e)}a(tLa,"IntersectEvaluated")});var aRi=I(sRi=>{"use strict";p();Object.defineProperty(sRi,"__esModule",{value:!0});var Cxp=Sn()});var cRi=I(Ubr=>{"use strict";p();Object.defineProperty(Ubr,"__esModule",{value:!0});Ubr.Intersect=sLa;var rLa=Ii(),nLa=Cm(),iLa=Lbr(),oLa=vs();function sLa(t,e){if(t.length===1)return(0,rLa.CreateType)(t[0],e);if(t.length===0)return(0,nLa.Never)(e);if(t.some(r=>(0,oLa.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,iLa.IntersectCreate)(t,e)}a(sLa,"Intersect")});var XT=I(c6=>{"use strict";p();var aLa=c6&&c6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qbr=c6&&c6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&aLa(e,t,r)};Object.defineProperty(c6,"__esModule",{value:!0});Qbr(oRi(),c6);Qbr(aRi(),c6);Qbr(cRi(),c6)});var lRi=I(qbr=>{"use strict";p();Object.defineProperty(qbr,"__esModule",{value:!0});qbr.Ref=dLa;var cLa=Nf(),lLa=Ii(),uLa=Sn();function dLa(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new cLa.TypeBoxError("Ref: $ref must be a string");return(0,lLa.CreateType)({[uLa.Kind]:"Ref",$ref:e},r)}a(dLa,"Ref")});var $G=I(Jte=>{"use strict";p();var fLa=Jte&&Jte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pLa=Jte&&Jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fLa(e,t,r)};Object.defineProperty(Jte,"__esModule",{value:!0});pLa(lRi(),Jte)});var dRi=I(Gbr=>{"use strict";p();Object.defineProperty(Gbr,"__esModule",{value:!0});Gbr.Awaited=Hbr;var hLa=Ii(),jbr=BG(),mLa=XT(),gLa=Ip(),ALa=$G(),j5e=vs();function yLa(t,e){return(0,jbr.Computed)("Awaited",[(0,jbr.Computed)(t,e)])}a(yLa,"FromComputed");function ELa(t){return(0,jbr.Computed)("Awaited",[(0,ALa.Ref)(t)])}a(ELa,"FromRef");function _La(t){return(0,mLa.Intersect)(uRi(t))}a(_La,"FromIntersect");function vLa(t){return(0,gLa.Union)(uRi(t))}a(vLa,"FromUnion");function CLa(t){return Hbr(t)}a(CLa,"FromPromise");function uRi(t){return t.map(e=>Hbr(e))}a(uRi,"FromRest");function Hbr(t,e){return(0,hLa.CreateType)((0,j5e.IsComputed)(t)?yLa(t.target,t.parameters):(0,j5e.IsIntersect)(t)?_La(t.allOf):(0,j5e.IsUnion)(t)?vLa(t.anyOf):(0,j5e.IsPromise)(t)?CLa(t.item):(0,j5e.IsRef)(t)?ELa(t.$ref):t,e)}a(Hbr,"Awaited")});var H5e=I(Zte=>{"use strict";p();var bLa=Zte&&Zte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SLa=Zte&&Zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bLa(e,t,r)};Object.defineProperty(Zte,"__esModule",{value:!0});SLa(dRi(),Zte)});var Qgt=I(Ugt=>{"use strict";p();Object.defineProperty(Ugt,"__esModule",{value:!0});Ugt.KeyOfPropertyKeys=Vbr;Ugt.KeyOfPattern=PLa;var fRi=D5e(),eAe=vs();function pRi(t){let e=[];for(let r of t)e.push(Vbr(r));return e}a(pRi,"FromRest");function TLa(t){let e=pRi(t);return(0,fRi.SetUnionMany)(e)}a(TLa,"FromIntersect");function ILa(t){let e=pRi(t);return(0,fRi.SetIntersectMany)(e)}a(ILa,"FromUnion");function xLa(t){return t.map((e,r)=>r.toString())}a(xLa,"FromTuple");function wLa(t){return["[number]"]}a(wLa,"FromArray");function RLa(t){return globalThis.Object.getOwnPropertyNames(t)}a(RLa,"FromProperties");function kLa(t){return $br?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(kLa,"FromPatternProperties");function Vbr(t){return(0,eAe.IsIntersect)(t)?TLa(t.allOf):(0,eAe.IsUnion)(t)?ILa(t.anyOf):(0,eAe.IsTuple)(t)?xLa(t.items??[]):(0,eAe.IsArray)(t)?wLa(t.items):(0,eAe.IsObject)(t)?RLa(t.properties):(0,eAe.IsRecord)(t)?kLa(t.patternProperties):[]}a(Vbr,"KeyOfPropertyKeys");var $br=!1;function PLa(t){$br=!0;let e=Vbr(t);return $br=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(PLa,"KeyOfPattern")});var Ybr=I(qgt=>{"use strict";p();Object.defineProperty(qgt,"__esModule",{value:!0});qgt.KeyOfPropertyKeysToRest=hRi;qgt.KeyOf=jLa;var DLa=Ii(),NLa=UE(),MLa=UG(),zbr=BG(),OLa=$G(),LLa=Qgt(),BLa=Ip(),FLa=Kbr(),Wbr=vs();function ULa(t,e){return(0,zbr.Computed)("KeyOf",[(0,zbr.Computed)(t,e)])}a(ULa,"FromComputed");function QLa(t){return(0,zbr.Computed)("KeyOf",[(0,OLa.Ref)(t)])}a(QLa,"FromRef");function qLa(t,e){let r=(0,LLa.KeyOfPropertyKeys)(t),n=hRi(r),o=(0,BLa.UnionEvaluated)(n);return(0,DLa.CreateType)(o,e)}a(qLa,"KeyOfFromType");function hRi(t){return t.map(e=>e==="[number]"?(0,MLa.Number)():(0,NLa.Literal)(e))}a(hRi,"KeyOfPropertyKeysToRest");function jLa(t,e){return(0,Wbr.IsComputed)(t)?ULa(t.target,t.parameters):(0,Wbr.IsRef)(t)?QLa(t.$ref):(0,Wbr.IsMappedResult)(t)?(0,FLa.KeyOfFromMappedResult)(t,e):qLa(t,e)}a(jLa,"KeyOf")});var Kbr=I(Jbr=>{"use strict";p();Object.defineProperty(Jbr,"__esModule",{value:!0});Jbr.KeyOfFromMappedResult=zLa;var HLa=bm(),GLa=Ybr(),$La=Yb();function VLa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,GLa.KeyOf)(t[n],(0,$La.Clone)(e));return r}a(VLa,"FromProperties");function WLa(t,e){return VLa(t.properties,e)}a(WLa,"FromMappedResult");function zLa(t,e){let r=WLa(t,e);return(0,HLa.MappedResult)(r)}a(zLa,"KeyOfFromMappedResult")});var mRi=I(Zbr=>{"use strict";p();Object.defineProperty(Zbr,"__esModule",{value:!0});Zbr.KeyOfPropertyEntries=JLa;var YLa=Ogt(),KLa=Qgt();function JLa(t){let e=(0,KLa.KeyOfPropertyKeys)(t),r=(0,YLa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(JLa,"KeyOfPropertyEntries")});var mD=I(V4=>{"use strict";p();var ZLa=V4&&V4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jgt=V4&&V4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZLa(e,t,r)};Object.defineProperty(V4,"__esModule",{value:!0});jgt(Kbr(),V4);jgt(mRi(),V4);jgt(Qgt(),V4);jgt(Ybr(),V4)});var gRi=I(Xbr=>{"use strict";p();Object.defineProperty(Xbr,"__esModule",{value:!0});Xbr.Composite=lBa;var XLa=XT(),eBa=hD(),tBa=mD(),rBa=xv(),nBa=D5e(),iBa=vs();function oBa(t){let e=[];for(let r of t)e.push(...(0,tBa.KeyOfPropertyKeys)(r));return(0,nBa.SetDistinct)(e)}a(oBa,"CompositeKeys");function sBa(t){return t.filter(e=>!(0,iBa.IsNever)(e))}a(sBa,"FilterNever");function aBa(t,e){let r=[];for(let n of t)r.push(...(0,eBa.IndexFromPropertyKeys)(n,[e]));return sBa(r)}a(aBa,"CompositeProperty");function cBa(t,e){let r={};for(let n of e)r[n]=(0,XLa.IntersectEvaluated)(aBa(t,n));return r}a(cBa,"CompositeProperties");function lBa(t,e){let r=oBa(t),n=cBa(t,r);return(0,rBa.Object)(n,e)}a(lBa,"Composite")});var Hgt=I(Xte=>{"use strict";p();var uBa=Xte&&Xte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dBa=Xte&&Xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uBa(e,t,r)};Object.defineProperty(Xte,"__esModule",{value:!0});dBa(gRi(),Xte)});var ARi=I(e1r=>{"use strict";p();Object.defineProperty(e1r,"__esModule",{value:!0});e1r.Date=hBa;var fBa=Sn(),pBa=Ii();function hBa(t){return(0,pBa.CreateType)({[fBa.Kind]:"Date",type:"Date"},t)}a(hBa,"Date")});var G5e=I(ere=>{"use strict";p();var mBa=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]})),gBa=ere&&ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mBa(e,t,r)};Object.defineProperty(ere,"__esModule",{value:!0});gBa(ARi(),ere)});var yRi=I(t1r=>{"use strict";p();Object.defineProperty(t1r,"__esModule",{value:!0});t1r.Null=EBa;var ABa=Ii(),yBa=Sn();function EBa(t){return(0,ABa.CreateType)({[yBa.Kind]:"Null",type:"null"},t)}a(EBa,"Null")});var $5e=I(tre=>{"use strict";p();var _Ba=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]})),vBa=tre&&tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Ba(e,t,r)};Object.defineProperty(tre,"__esModule",{value:!0});vBa(yRi(),tre)});var ERi=I(r1r=>{"use strict";p();Object.defineProperty(r1r,"__esModule",{value:!0});r1r.Symbol=SBa;var CBa=Ii(),bBa=Sn();function SBa(t){return(0,CBa.CreateType)({[bBa.Kind]:"Symbol",type:"symbol"},t)}a(SBa,"Symbol")});var V5e=I(rre=>{"use strict";p();var TBa=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]})),IBa=rre&&rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TBa(e,t,r)};Object.defineProperty(rre,"__esModule",{value:!0});IBa(ERi(),rre)});var _Ri=I(n1r=>{"use strict";p();Object.defineProperty(n1r,"__esModule",{value:!0});n1r.Undefined=RBa;var xBa=Ii(),wBa=Sn();function RBa(t){return(0,xBa.CreateType)({[wBa.Kind]:"Undefined",type:"undefined"},t)}a(RBa,"Undefined")});var W5e=I(nre=>{"use strict";p();var kBa=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]})),PBa=nre&&nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kBa(e,t,r)};Object.defineProperty(nre,"__esModule",{value:!0});PBa(_Ri(),nre)});var vRi=I(i1r=>{"use strict";p();Object.defineProperty(i1r,"__esModule",{value:!0});i1r.Uint8Array=MBa;var DBa=Ii(),NBa=Sn();function MBa(t){return(0,DBa.CreateType)({[NBa.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(MBa,"Uint8Array")});var z5e=I(ire=>{"use strict";p();var OBa=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]})),LBa=ire&&ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OBa(e,t,r)};Object.defineProperty(ire,"__esModule",{value:!0});LBa(vRi(),ire)});var CRi=I(o1r=>{"use strict";p();Object.defineProperty(o1r,"__esModule",{value:!0});o1r.Unknown=UBa;var BBa=Ii(),FBa=Sn();function UBa(t){return(0,BBa.CreateType)({[FBa.Kind]:"Unknown"},t)}a(UBa,"Unknown")});var VG=I(ore=>{"use strict";p();var QBa=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]})),qBa=ore&&ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QBa(e,t,r)};Object.defineProperty(ore,"__esModule",{value:!0});qBa(CRi(),ore)});var TRi=I(l1r=>{"use strict";p();Object.defineProperty(l1r,"__esModule",{value:!0});l1r.Const=e3a;var bRi=Gge(),jBa=Jge(),HBa=G5e(),GBa=FG(),s1r=UE(),$Ba=$5e(),SRi=xv(),VBa=V5e(),WBa=s6(),a1r=HG(),zBa=W5e(),YBa=z5e(),KBa=VG(),JBa=t6(),Xb=Iv();function ZBa(t){return t.map(e=>c1r(e,!1))}a(ZBa,"FromArray");function XBa(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,a1r.Readonly)(c1r(t[r],!1));return e}a(XBa,"FromProperties");function Ggt(t,e){return e===!0?t:(0,a1r.Readonly)(t)}a(Ggt,"ConditionalReadonly");function c1r(t,e){return(0,Xb.IsAsyncIterator)(t)||(0,Xb.IsIterator)(t)?Ggt((0,bRi.Any)(),e):(0,Xb.IsArray)(t)?(0,a1r.Readonly)((0,WBa.Tuple)(ZBa(t))):(0,Xb.IsUint8Array)(t)?(0,YBa.Uint8Array)():(0,Xb.IsDate)(t)?(0,HBa.Date)():(0,Xb.IsObject)(t)?Ggt((0,SRi.Object)(XBa(t)),e):(0,Xb.IsFunction)(t)?Ggt((0,GBa.Function)([],(0,KBa.Unknown)()),e):(0,Xb.IsUndefined)(t)?(0,zBa.Undefined)():(0,Xb.IsNull)(t)?(0,$Ba.Null)():(0,Xb.IsSymbol)(t)?(0,VBa.Symbol)():(0,Xb.IsBigInt)(t)?(0,jBa.BigInt)():(0,Xb.IsNumber)(t)||(0,Xb.IsBoolean)(t)||(0,Xb.IsString)(t)?(0,s1r.Literal)(t):(0,SRi.Object)({})}a(c1r,"FromValue");function e3a(t,e){return(0,JBa.CreateType)(c1r(t,!0),e)}a(e3a,"Const")});var $gt=I(sre=>{"use strict";p();var t3a=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]})),r3a=sre&&sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t3a(e,t,r)};Object.defineProperty(sre,"__esModule",{value:!0});r3a(TRi(),sre)});var IRi=I(l6=>{"use strict";p();var n3a=l6&&l6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i3a=l6&&l6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o3a=l6&&l6.__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 u3a=are&&are.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),d3a=are&&are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u3a(e,t,r)};Object.defineProperty(are,"__esModule",{value:!0});d3a(IRi(),are)});var xRi=I(u1r=>{"use strict";p();Object.defineProperty(u1r,"__esModule",{value:!0});u1r.Enum=g3a;var f3a=UE(),p3a=Sn(),h3a=Ip(),m3a=Iv();function g3a(t,e){if((0,m3a.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,f3a.Literal)(s));return(0,h3a.Union)(o,{...e,[p3a.Hint]:"Enum"})}a(g3a,"Enum")});var Wgt=I(cre=>{"use strict";p();var A3a=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]})),y3a=cre&&cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A3a(e,t,r)};Object.defineProperty(cre,"__esModule",{value:!0});y3a(xRi(),cre)});var y1r=I(lre=>{"use strict";p();Object.defineProperty(lre,"__esModule",{value:!0});lre.ExtendsResult=lre.ExtendsResolverError=void 0;lre.ExtendsCheck=aFa;var wRi=Gge(),E3a=FG(),m1r=UG(),f1r=QG(),_3a=VG(),RRi=pD(),tAe=P5e(),MRi=Sn(),v3a=Nf(),tt=OCr(),zgt=class extends v3a.TypeBoxError{static{a(this,"ExtendsResolverError")}};lre.ExtendsResolverError=zgt;var Lt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Lt||(lre.ExtendsResult=Lt={}));function RR(t){return t===Lt.False?t:Lt.True}a(RR,"IntoBooleanResult");function rAe(t){throw new zgt(t)}a(rAe,"Throw");function Sm(t){return tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsIntersect(t)||tt.TypeGuard.IsUnion(t)||tt.TypeGuard.IsUnknown(t)||tt.TypeGuard.IsAny(t)}a(Sm,"IsStructuralRight");function Tm(t,e){return tt.TypeGuard.IsNever(e)?BRi(t,e):tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)?A1r(t,e):tt.TypeGuard.IsUnknown(e)?qRi(t,e):tt.TypeGuard.IsAny(e)?g1r(t,e):rAe("StructuralRight")}a(Tm,"StructuralRight");function g1r(t,e){return Lt.True}a(g1r,"FromAnyRight");function C3a(t,e){return tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>tt.TypeGuard.IsAny(r)||tt.TypeGuard.IsUnknown(r))?Lt.True:tt.TypeGuard.IsUnion(e)?Lt.Union:tt.TypeGuard.IsUnknown(e)||tt.TypeGuard.IsAny(e)?Lt.True:Lt.Union}a(C3a,"FromAny");function b3a(t,e){return tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:tt.TypeGuard.IsNever(t)?Lt.True:Lt.False}a(b3a,"FromArrayRight");function S3a(t,e){return tt.TypeGuard.IsObject(e)&&Kgt(e)?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsArray(e)?RR(hl(t.items,e.items)):Lt.False}a(S3a,"FromArray");function T3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsAsyncIterator(e)?RR(hl(t.items,e.items)):Lt.False}a(T3a,"FromAsyncIterator");function I3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsBigInt(e)?Lt.True:Lt.False}a(I3a,"FromBigInt");function ORi(t,e){return tt.TypeGuard.IsLiteralBoolean(t)||tt.TypeGuard.IsBoolean(t)?Lt.True:Lt.False}a(ORi,"FromBooleanRight");function x3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsBoolean(e)?Lt.True:Lt.False}a(x3a,"FromBoolean");function w3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>RR(hl(e.parameters[n],r))===Lt.True)?RR(hl(t.returns,e.returns)):Lt.False:Lt.False}a(w3a,"FromConstructor");function R3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsDate(e)?Lt.True:Lt.False}a(R3a,"FromDate");function k3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>RR(hl(e.parameters[n],r))===Lt.True)?RR(hl(t.returns,e.returns)):Lt.False:Lt.False}a(k3a,"FromFunction");function LRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsNumber(t.const)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(LRi,"FromIntegerRight");function P3a(t,e){return tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):Lt.False}a(P3a,"FromInteger");function Ygt(t,e){return e.allOf.every(r=>hl(t,r)===Lt.True)?Lt.True:Lt.False}a(Ygt,"FromIntersectRight");function D3a(t,e){return t.allOf.some(r=>hl(r,e)===Lt.True)?Lt.True:Lt.False}a(D3a,"FromIntersect");function N3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsIterator(e)?RR(hl(t.items,e.items)):Lt.False}a(N3a,"FromIterator");function M3a(t,e){return tt.TypeGuard.IsLiteral(e)&&e.const===t.const?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsString(e)?QRi(t,e):tt.TypeGuard.IsNumber(e)?FRi(t,e):tt.TypeGuard.IsInteger(e)?LRi(t,e):tt.TypeGuard.IsBoolean(e)?ORi(t,e):Lt.False}a(M3a,"FromLiteral");function BRi(t,e){return Lt.False}a(BRi,"FromNeverRight");function O3a(t,e){return Lt.True}a(O3a,"FromNever");function kRi(t){let[e,r]=[t,0];for(;tt.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,_3a.Unknown)()}a(kRi,"UnwrapTNot");function L3a(t,e){return tt.TypeGuard.IsNot(t)?hl(kRi(t),e):tt.TypeGuard.IsNot(e)?hl(t,kRi(e)):rAe("Invalid fallthrough for Not")}a(L3a,"FromNot");function B3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsNull(e)?Lt.True:Lt.False}a(B3a,"FromNull");function FRi(t,e){return tt.TypeGuard.IsLiteralNumber(t)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(FRi,"FromNumberRight");function F3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Lt.True:Lt.False}a(F3a,"FromNumber");function e1(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(e1,"IsObjectPropertyCount");function PRi(t){return Kgt(t)}a(PRi,"IsObjectStringLike");function DRi(t){return e1(t,0)||e1(t,1)&&"description"in t.properties&&tt.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(tt.TypeGuard.IsString(t.properties.description.anyOf[0])&&tt.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||tt.TypeGuard.IsString(t.properties.description.anyOf[1])&&tt.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(DRi,"IsObjectSymbolLike");function d1r(t){return e1(t,0)}a(d1r,"IsObjectNumberLike");function NRi(t){return e1(t,0)}a(NRi,"IsObjectBooleanLike");function U3a(t){return e1(t,0)}a(U3a,"IsObjectBigIntLike");function Q3a(t){return e1(t,0)}a(Q3a,"IsObjectDateLike");function q3a(t){return Kgt(t)}a(q3a,"IsObjectUint8ArrayLike");function j3a(t){let e=(0,m1r.Number)();return e1(t,0)||e1(t,1)&&"length"in t.properties&&RR(hl(t.properties.length,e))===Lt.True}a(j3a,"IsObjectFunctionLike");function H3a(t){return e1(t,0)}a(H3a,"IsObjectConstructorLike");function Kgt(t){let e=(0,m1r.Number)();return e1(t,0)||e1(t,1)&&"length"in t.properties&&RR(hl(t.properties.length,e))===Lt.True}a(Kgt,"IsObjectArrayLike");function G3a(t){let e=(0,E3a.Function)([(0,wRi.Any)()],(0,wRi.Any)());return e1(t,0)||e1(t,1)&&"then"in t.properties&&RR(hl(t.properties.then,e))===Lt.True}a(G3a,"IsObjectPromiseLike");function URi(t,e){return hl(t,e)===Lt.False||tt.TypeGuard.IsOptional(t)&&!tt.TypeGuard.IsOptional(e)?Lt.False:Lt.True}a(URi,"Property");function QE(t,e){return tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsLiteralString(t)&&PRi(e)||tt.TypeGuard.IsLiteralNumber(t)&&d1r(e)||tt.TypeGuard.IsLiteralBoolean(t)&&NRi(e)||tt.TypeGuard.IsSymbol(t)&&DRi(e)||tt.TypeGuard.IsBigInt(t)&&U3a(e)||tt.TypeGuard.IsString(t)&&PRi(e)||tt.TypeGuard.IsSymbol(t)&&DRi(e)||tt.TypeGuard.IsNumber(t)&&d1r(e)||tt.TypeGuard.IsInteger(t)&&d1r(e)||tt.TypeGuard.IsBoolean(t)&&NRi(e)||tt.TypeGuard.IsUint8Array(t)&&q3a(e)||tt.TypeGuard.IsDate(t)&&Q3a(e)||tt.TypeGuard.IsConstructor(t)&&H3a(e)||tt.TypeGuard.IsFunction(t)&&j3a(e)?Lt.True:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsString(p1r(t))?e[MRi.Hint]==="Record"?Lt.True:Lt.False:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsNumber(p1r(t))&&e1(e,0)?Lt.True:Lt.False}a(QE,"FromObjectRight");function $3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!tt.TypeGuard.IsOptional(e.properties[r]))return Lt.False;if(tt.TypeGuard.IsOptional(e.properties[r]))return Lt.True;if(URi(t.properties[r],e.properties[r])===Lt.False)return Lt.False}return Lt.True})():Lt.False}a($3a,"FromObject");function V3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)&&G3a(e)?Lt.True:tt.TypeGuard.IsPromise(e)?RR(hl(t.item,e.item)):Lt.False}a(V3a,"FromPromise");function p1r(t){return tAe.PatternNumberExact in t.patternProperties?(0,m1r.Number)():tAe.PatternStringExact in t.patternProperties?(0,f1r.String)():rAe("Unknown record key pattern")}a(p1r,"RecordKey");function h1r(t){return tAe.PatternNumberExact in t.patternProperties?t.patternProperties[tAe.PatternNumberExact]:tAe.PatternStringExact in t.patternProperties?t.patternProperties[tAe.PatternStringExact]:rAe("Unable to get record value schema")}a(h1r,"RecordValue");function kR(t,e){let[r,n]=[p1r(e),h1r(e)];return tt.TypeGuard.IsLiteralString(t)&&tt.TypeGuard.IsNumber(r)&&RR(hl(t,n))===Lt.True?Lt.True:tt.TypeGuard.IsUint8Array(t)&&tt.TypeGuard.IsNumber(r)||tt.TypeGuard.IsString(t)&&tt.TypeGuard.IsNumber(r)||tt.TypeGuard.IsArray(t)&&tt.TypeGuard.IsNumber(r)?hl(t,n):tt.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(URi(n,t.properties[o])===Lt.False)return Lt.False;return Lt.True})():Lt.False}a(kR,"FromRecordRight");function W3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?hl(h1r(t),h1r(e)):Lt.False}a(W3a,"FromRecord");function z3a(t,e){let r=tt.TypeGuard.IsRegExp(t)?(0,f1r.String)():t,n=tt.TypeGuard.IsRegExp(e)?(0,f1r.String)():e;return hl(r,n)}a(z3a,"FromRegExp");function QRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsString(t.const)||tt.TypeGuard.IsString(t)?Lt.True:Lt.False}a(QRi,"FromStringRight");function Y3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsString(e)?Lt.True:Lt.False}a(Y3a,"FromString");function K3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsSymbol(e)?Lt.True:Lt.False}a(K3a,"FromSymbol");function J3a(t,e){return tt.TypeGuard.IsTemplateLiteral(t)?hl((0,RRi.TemplateLiteralToUnion)(t),e):tt.TypeGuard.IsTemplateLiteral(e)?hl(t,(0,RRi.TemplateLiteralToUnion)(e)):rAe("Invalid fallthrough for TemplateLiteral")}a(J3a,"FromTemplateLiteral");function Z3a(t,e){return tt.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>hl(r,e.items)===Lt.True)}a(Z3a,"IsArrayOfTuple");function X3a(t,e){return tt.TypeGuard.IsNever(t)?Lt.True:tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:Lt.False}a(X3a,"FromTupleRight");function eFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)&&Kgt(e)||tt.TypeGuard.IsArray(e)&&Z3a(t,e)?Lt.True:tt.TypeGuard.IsTuple(e)?tt.ValueGuard.IsUndefined(t.items)&&!tt.ValueGuard.IsUndefined(e.items)||!tt.ValueGuard.IsUndefined(t.items)&&tt.ValueGuard.IsUndefined(e.items)?Lt.False:tt.ValueGuard.IsUndefined(t.items)&&!tt.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>hl(r,e.items[n])===Lt.True)?Lt.True:Lt.False:Lt.False}a(eFa,"FromTuple");function tFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsUint8Array(e)?Lt.True:Lt.False}a(tFa,"FromUint8Array");function rFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsVoid(e)?oFa(t,e):tt.TypeGuard.IsUndefined(e)?Lt.True:Lt.False}a(rFa,"FromUndefined");function A1r(t,e){return e.anyOf.some(r=>hl(t,r)===Lt.True)?Lt.True:Lt.False}a(A1r,"FromUnionRight");function nFa(t,e){return t.anyOf.every(r=>hl(r,e)===Lt.True)?Lt.True:Lt.False}a(nFa,"FromUnion");function qRi(t,e){return Lt.True}a(qRi,"FromUnknownRight");function iFa(t,e){return tt.TypeGuard.IsNever(e)?BRi(t,e):tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)?A1r(t,e):tt.TypeGuard.IsAny(e)?g1r(t,e):tt.TypeGuard.IsString(e)?QRi(t,e):tt.TypeGuard.IsNumber(e)?FRi(t,e):tt.TypeGuard.IsInteger(e)?LRi(t,e):tt.TypeGuard.IsBoolean(e)?ORi(t,e):tt.TypeGuard.IsArray(e)?b3a(t,e):tt.TypeGuard.IsTuple(e)?X3a(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsUnknown(e)?Lt.True:Lt.False}a(iFa,"FromUnknown");function oFa(t,e){return tt.TypeGuard.IsUndefined(t)||tt.TypeGuard.IsUndefined(t)?Lt.True:Lt.False}a(oFa,"FromVoidRight");function sFa(t,e){return tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)?A1r(t,e):tt.TypeGuard.IsUnknown(e)?qRi(t,e):tt.TypeGuard.IsAny(e)?g1r(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsVoid(e)?Lt.True:Lt.False}a(sFa,"FromVoid");function hl(t,e){return tt.TypeGuard.IsTemplateLiteral(t)||tt.TypeGuard.IsTemplateLiteral(e)?J3a(t,e):tt.TypeGuard.IsRegExp(t)||tt.TypeGuard.IsRegExp(e)?z3a(t,e):tt.TypeGuard.IsNot(t)||tt.TypeGuard.IsNot(e)?L3a(t,e):tt.TypeGuard.IsAny(t)?C3a(t,e):tt.TypeGuard.IsArray(t)?S3a(t,e):tt.TypeGuard.IsBigInt(t)?I3a(t,e):tt.TypeGuard.IsBoolean(t)?x3a(t,e):tt.TypeGuard.IsAsyncIterator(t)?T3a(t,e):tt.TypeGuard.IsConstructor(t)?w3a(t,e):tt.TypeGuard.IsDate(t)?R3a(t,e):tt.TypeGuard.IsFunction(t)?k3a(t,e):tt.TypeGuard.IsInteger(t)?P3a(t,e):tt.TypeGuard.IsIntersect(t)?D3a(t,e):tt.TypeGuard.IsIterator(t)?N3a(t,e):tt.TypeGuard.IsLiteral(t)?M3a(t,e):tt.TypeGuard.IsNever(t)?O3a(t,e):tt.TypeGuard.IsNull(t)?B3a(t,e):tt.TypeGuard.IsNumber(t)?F3a(t,e):tt.TypeGuard.IsObject(t)?$3a(t,e):tt.TypeGuard.IsRecord(t)?W3a(t,e):tt.TypeGuard.IsString(t)?Y3a(t,e):tt.TypeGuard.IsSymbol(t)?K3a(t,e):tt.TypeGuard.IsTuple(t)?eFa(t,e):tt.TypeGuard.IsPromise(t)?V3a(t,e):tt.TypeGuard.IsUint8Array(t)?tFa(t,e):tt.TypeGuard.IsUndefined(t)?rFa(t,e):tt.TypeGuard.IsUnion(t)?nFa(t,e):tt.TypeGuard.IsUnknown(t)?iFa(t,e):tt.TypeGuard.IsVoid(t)?sFa(t,e):rAe(`Unknown left type operand '${t[MRi.Kind]}'`)}a(hl,"Visit");function aFa(t,e){return hl(t,e)}a(aFa,"ExtendsCheck")});var _1r=I(E1r=>{"use strict";p();Object.defineProperty(E1r,"__esModule",{value:!0});E1r.ExtendsFromMappedResult=pFa;var cFa=bm(),lFa=Jgt(),uFa=Yb();function dFa(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,lFa.Extends)(t[c],e,r,n,(0,uFa.Clone)(o));return s}a(dFa,"FromProperties");function fFa(t,e,r,n,o){return dFa(t.properties,e,r,n,o)}a(fFa,"FromMappedResult");function pFa(t,e,r,n,o){let s=fFa(t,e,r,n,o);return(0,cFa.MappedResult)(s)}a(pFa,"ExtendsFromMappedResult")});var Jgt=I(C1r=>{"use strict";p();Object.defineProperty(C1r,"__esModule",{value:!0});C1r.Extends=yFa;var jRi=Ii(),hFa=Ip(),v1r=y1r(),mFa=b1r(),gFa=_1r(),HRi=vs();function AFa(t,e,r,n){let o=(0,v1r.ExtendsCheck)(t,e);return o===v1r.ExtendsResult.Union?(0,hFa.Union)([r,n]):o===v1r.ExtendsResult.True?r:n}a(AFa,"ExtendsResolve");function yFa(t,e,r,n,o){return(0,HRi.IsMappedResult)(t)?(0,gFa.ExtendsFromMappedResult)(t,e,r,n,o):(0,HRi.IsMappedKey)(t)?(0,jRi.CreateType)((0,mFa.ExtendsFromMappedKey)(t,e,r,n,o)):(0,jRi.CreateType)(AFa(t,e,r,n),o)}a(yFa,"Extends")});var b1r=I(S1r=>{"use strict";p();Object.defineProperty(S1r,"__esModule",{value:!0});S1r.ExtendsFromMappedKey=IFa;var EFa=bm(),_Fa=UE(),vFa=Jgt(),CFa=Yb();function bFa(t,e,r,n,o){return{[t]:(0,vFa.Extends)((0,_Fa.Literal)(t),e,r,n,(0,CFa.Clone)(o))}}a(bFa,"FromPropertyKey");function SFa(t,e,r,n,o){return t.reduce((s,c)=>({...s,...bFa(c,e,r,n,o)}),{})}a(SFa,"FromPropertyKeys");function TFa(t,e,r,n,o){return SFa(t.keys,e,r,n,o)}a(TFa,"FromMappedKey");function IFa(t,e,r,n,o){let s=TFa(t,e,r,n,o);return(0,EFa.MappedResult)(s)}a(IFa,"ExtendsFromMappedKey")});var I1r=I(T1r=>{"use strict";p();Object.defineProperty(T1r,"__esModule",{value:!0});T1r.ExtendsUndefinedCheck=Xgt;var Zgt=Sn();function xFa(t){return t.allOf.every(e=>Xgt(e))}a(xFa,"Intersect");function wFa(t){return t.anyOf.some(e=>Xgt(e))}a(wFa,"Union");function RFa(t){return!Xgt(t.not)}a(RFa,"Not");function Xgt(t){return t[Zgt.Kind]==="Intersect"?xFa(t):t[Zgt.Kind]==="Union"?wFa(t):t[Zgt.Kind]==="Not"?RFa(t):t[Zgt.Kind]==="Undefined"}a(Xgt,"ExtendsUndefinedCheck")});var ure=I(gD=>{"use strict";p();var kFa=gD&&gD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y5e=gD&&gD.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kFa(e,t,r)};Object.defineProperty(gD,"__esModule",{value:!0});Y5e(y1r(),gD);Y5e(b1r(),gD);Y5e(_1r(),gD);Y5e(I1r(),gD);Y5e(Jgt(),gD)});var w1r=I(x1r=>{"use strict";p();Object.defineProperty(x1r,"__esModule",{value:!0});x1r.ExcludeFromTemplateLiteral=NFa;var PFa=eAt(),DFa=pD();function NFa(t,e){return(0,PFa.Exclude)((0,DFa.TemplateLiteralToUnion)(t),e)}a(NFa,"ExcludeFromTemplateLiteral")});var eAt=I(P1r=>{"use strict";p();Object.defineProperty(P1r,"__esModule",{value:!0});P1r.Exclude=UFa;var R1r=Ii(),MFa=Ip(),OFa=Cm(),tAt=ure(),LFa=D1r(),BFa=w1r(),k1r=vs();function FFa(t,e){let r=t.filter(n=>(0,tAt.ExtendsCheck)(n,e)===tAt.ExtendsResult.False);return r.length===1?r[0]:(0,MFa.Union)(r)}a(FFa,"ExcludeRest");function UFa(t,e,r={}){return(0,k1r.IsTemplateLiteral)(t)?(0,R1r.CreateType)((0,BFa.ExcludeFromTemplateLiteral)(t,e),r):(0,k1r.IsMappedResult)(t)?(0,R1r.CreateType)((0,LFa.ExcludeFromMappedResult)(t,e),r):(0,R1r.CreateType)((0,k1r.IsUnion)(t)?FFa(t.anyOf,e):(0,tAt.ExtendsCheck)(t,e)!==tAt.ExtendsResult.False?(0,OFa.Never)():t,r)}a(UFa,"Exclude")});var D1r=I(N1r=>{"use strict";p();Object.defineProperty(N1r,"__esModule",{value:!0});N1r.ExcludeFromMappedResult=GFa;var QFa=bm(),qFa=eAt();function jFa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,qFa.Exclude)(t[n],e);return r}a(jFa,"FromProperties");function HFa(t,e){return jFa(t.properties,e)}a(HFa,"FromMappedResult");function GFa(t,e){let r=HFa(t,e);return(0,QFa.MappedResult)(r)}a(GFa,"ExcludeFromMappedResult")});var rAt=I(u6=>{"use strict";p();var $Fa=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]})),M1r=u6&&u6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Fa(e,t,r)};Object.defineProperty(u6,"__esModule",{value:!0});M1r(D1r(),u6);M1r(w1r(),u6);M1r(eAt(),u6)});var L1r=I(O1r=>{"use strict";p();Object.defineProperty(O1r,"__esModule",{value:!0});O1r.ExtractFromTemplateLiteral=zFa;var VFa=nAt(),WFa=pD();function zFa(t,e){return(0,VFa.Extract)((0,WFa.TemplateLiteralToUnion)(t),e)}a(zFa,"ExtractFromTemplateLiteral")});var nAt=I(U1r=>{"use strict";p();Object.defineProperty(U1r,"__esModule",{value:!0});U1r.Extract=e8a;var B1r=Ii(),YFa=Ip(),KFa=Cm(),iAt=ure(),JFa=Q1r(),ZFa=L1r(),F1r=vs();function XFa(t,e){let r=t.filter(n=>(0,iAt.ExtendsCheck)(n,e)!==iAt.ExtendsResult.False);return r.length===1?r[0]:(0,YFa.Union)(r)}a(XFa,"ExtractRest");function e8a(t,e,r){return(0,F1r.IsTemplateLiteral)(t)?(0,B1r.CreateType)((0,ZFa.ExtractFromTemplateLiteral)(t,e),r):(0,F1r.IsMappedResult)(t)?(0,B1r.CreateType)((0,JFa.ExtractFromMappedResult)(t,e),r):(0,B1r.CreateType)((0,F1r.IsUnion)(t)?XFa(t.anyOf,e):(0,iAt.ExtendsCheck)(t,e)!==iAt.ExtendsResult.False?t:(0,KFa.Never)(),r)}a(e8a,"Extract")});var Q1r=I(q1r=>{"use strict";p();Object.defineProperty(q1r,"__esModule",{value:!0});q1r.ExtractFromMappedResult=o8a;var t8a=bm(),r8a=nAt();function n8a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,r8a.Extract)(t[n],e);return r}a(n8a,"FromProperties");function i8a(t,e){return n8a(t.properties,e)}a(i8a,"FromMappedResult");function o8a(t,e){let r=i8a(t,e);return(0,t8a.MappedResult)(r)}a(o8a,"ExtractFromMappedResult")});var oAt=I(d6=>{"use strict";p();var s8a=d6&&d6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),j1r=d6&&d6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s8a(e,t,r)};Object.defineProperty(d6,"__esModule",{value:!0});j1r(Q1r(),d6);j1r(L1r(),d6);j1r(nAt(),d6)});var GRi=I(f6=>{"use strict";p();var a8a=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]})),c8a=f6&&f6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),l8a=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;o{"use strict";p();var h8a=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]})),m8a=dre&&dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&h8a(e,t,r)};Object.defineProperty(dre,"__esModule",{value:!0});m8a(GRi(),dre)});var $Ri=I(H1r=>{"use strict";p();Object.defineProperty(H1r,"__esModule",{value:!0});H1r.ReadonlyOptional=y8a;var g8a=HG(),A8a=G4();function y8a(t){return(0,g8a.Readonly)((0,A8a.Optional)(t))}a(y8a,"ReadonlyOptional")});var K5e=I(fre=>{"use strict";p();var E8a=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]})),_8a=fre&&fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&E8a(e,t,r)};Object.defineProperty(fre,"__esModule",{value:!0});_8a($Ri(),fre)});var KRi=I(nAe=>{"use strict";p();Object.defineProperty(nAe,"__esModule",{value:!0});nAe.Record=B8a;nAe.RecordPattern=$1r;nAe.RecordKey=F8a;nAe.RecordValue=U8a;var v8a=Ii(),WRi=Sn(),C8a=Cm(),b8a=UG(),zRi=xv(),VRi=QG(),S8a=Ip(),T8a=pD(),pre=P5e(),YRi=hD(),I8a=Iv(),W4=vs();function hre(t,e,r){return(0,v8a.CreateType)({[WRi.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(hre,"RecordCreateFromPattern");function G1r(t,e,r){let n={};for(let o of t)n[o]=e;return(0,zRi.Object)(n,{...r,[WRi.Hint]:"Record"})}a(G1r,"RecordCreateFromKeys");function x8a(t,e,r){return(0,T8a.IsTemplateLiteralFinite)(t)?G1r((0,YRi.IndexPropertyKeys)(t),e,r):hre(t.pattern,e,r)}a(x8a,"FromTemplateLiteralKey");function w8a(t,e,r){return G1r((0,YRi.IndexPropertyKeys)((0,S8a.Union)(t)),e,r)}a(w8a,"FromUnionKey");function R8a(t,e,r){return G1r([t.toString()],e,r)}a(R8a,"FromLiteralKey");function k8a(t,e,r){return hre(t.source,e,r)}a(k8a,"FromRegExpKey");function P8a(t,e,r){let n=(0,I8a.IsUndefined)(t.pattern)?pre.PatternStringExact:t.pattern;return hre(n,e,r)}a(P8a,"FromStringKey");function D8a(t,e,r){return hre(pre.PatternStringExact,e,r)}a(D8a,"FromAnyKey");function N8a(t,e,r){return hre(pre.PatternNeverExact,e,r)}a(N8a,"FromNeverKey");function M8a(t,e,r){return(0,zRi.Object)({true:e,false:e},r)}a(M8a,"FromBooleanKey");function O8a(t,e,r){return hre(pre.PatternNumberExact,e,r)}a(O8a,"FromIntegerKey");function L8a(t,e,r){return hre(pre.PatternNumberExact,e,r)}a(L8a,"FromNumberKey");function B8a(t,e,r={}){return(0,W4.IsUnion)(t)?w8a(t.anyOf,e,r):(0,W4.IsTemplateLiteral)(t)?x8a(t,e,r):(0,W4.IsLiteral)(t)?R8a(t.const,e,r):(0,W4.IsBoolean)(t)?M8a(t,e,r):(0,W4.IsInteger)(t)?O8a(t,e,r):(0,W4.IsNumber)(t)?L8a(t,e,r):(0,W4.IsRegExp)(t)?k8a(t,e,r):(0,W4.IsString)(t)?P8a(t,e,r):(0,W4.IsAny)(t)?D8a(t,e,r):(0,W4.IsNever)(t)?N8a(t,e,r):(0,C8a.Never)(r)}a(B8a,"Record");function $1r(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a($1r,"RecordPattern");function F8a(t){let e=$1r(t);return e===pre.PatternStringExact?(0,VRi.String)():e===pre.PatternNumberExact?(0,b8a.Number)():(0,VRi.String)({pattern:e})}a(F8a,"RecordKey");function U8a(t){return t.patternProperties[$1r(t)]}a(U8a,"RecordValue")});var iAe=I(mre=>{"use strict";p();var Q8a=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]})),q8a=mre&&mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Q8a(e,t,r)};Object.defineProperty(mre,"__esModule",{value:!0});q8a(KRi(),mre)});var ZRi=I(z4=>{"use strict";p();var j8a=z4&&z4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),H8a=z4&&z4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),JRi=z4&&z4.__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]:l6a(t,e[n])}),{})}a(u6a,"FromProperties");function oAe(t,e){return e.map(r=>AD(t,r))}a(oAe,"FromTypes");function AD(t,e){return t1.IsConstructor(e)?J8a(t,e):t1.IsFunction(e)?Z8a(t,e):t1.IsIntersect(e)?X8a(t,e):t1.IsUnion(e)?e6a(t,e):t1.IsTuple(e)?t6a(t,e):t1.IsArray(e)?r6a(t,e):t1.IsAsyncIterator(e)?n6a(t,e):t1.IsIterator(e)?i6a(t,e):t1.IsPromise(e)?o6a(t,e):t1.IsObject(e)?s6a(t,e):t1.IsRecord(e)?a6a(t,e):t1.IsArgument(e)?c6a(t,e):e}a(AD,"FromType");function d6a(t,e){return AD(e,(0,G8a.CloneType)(t))}a(d6a,"Instantiate")});var aAt=I(gre=>{"use strict";p();var f6a=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]})),p6a=gre&&gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f6a(e,t,r)};Object.defineProperty(gre,"__esModule",{value:!0});p6a(ZRi(),gre)});var XRi=I(W1r=>{"use strict";p();Object.defineProperty(W1r,"__esModule",{value:!0});W1r.Integer=g6a;var h6a=Ii(),m6a=Sn();function g6a(t){return(0,h6a.CreateType)({[m6a.Kind]:"Integer",type:"integer"},t)}a(g6a,"Integer")});var cAt=I(Are=>{"use strict";p();var A6a=Are&&Are.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Are&&Are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A6a(e,t,r)};Object.defineProperty(Are,"__esModule",{value:!0});y6a(XRi(),Are)});var Y1r=I(z1r=>{"use strict";p();Object.defineProperty(z1r,"__esModule",{value:!0});z1r.IntrinsicFromMappedKey=I6a;var E6a=bm(),_6a=yre(),v6a=UE(),C6a=Yb();function b6a(t,e,r){return{[t]:(0,_6a.Intrinsic)((0,v6a.Literal)(t),e,(0,C6a.Clone)(r))}}a(b6a,"MappedIntrinsicPropertyKey");function S6a(t,e,r){return t.reduce((o,s)=>({...o,...b6a(s,e,r)}),{})}a(S6a,"MappedIntrinsicPropertyKeys");function T6a(t,e,r){return S6a(t.keys,e,r)}a(T6a,"MappedIntrinsicProperties");function I6a(t,e,r){let n=T6a(t,e,r);return(0,E6a.MappedResult)(n)}a(I6a,"IntrinsicFromMappedKey")});var yre=I(K1r=>{"use strict";p();Object.defineProperty(K1r,"__esModule",{value:!0});K1r.Intrinsic=iki;var x6a=Ii(),lAt=pD(),w6a=Y1r(),eki=UE(),tki=Ip(),uAt=vs();function R6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(R6a,"ApplyUncapitalize");function k6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(k6a,"ApplyCapitalize");function P6a(t){return t.toUpperCase()}a(P6a,"ApplyUppercase");function D6a(t){return t.toLowerCase()}a(D6a,"ApplyLowercase");function N6a(t,e,r){let n=(0,lAt.TemplateLiteralParseExact)(t.pattern);if(!(0,lAt.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:rki(t.pattern,e)};let c=[...(0,lAt.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,eki.Literal)(d)),l=nki(c,e),u=(0,tki.Union)(l);return(0,lAt.TemplateLiteral)([u],r)}a(N6a,"FromTemplateLiteral");function rki(t,e){return typeof t=="string"?e==="Uncapitalize"?R6a(t):e==="Capitalize"?k6a(t):e==="Uppercase"?P6a(t):e==="Lowercase"?D6a(t):t:t.toString()}a(rki,"FromLiteralValue");function nki(t,e){return t.map(r=>iki(r,e))}a(nki,"FromRest");function iki(t,e,r={}){return(0,uAt.IsMappedKey)(t)?(0,w6a.IntrinsicFromMappedKey)(t,e,r):(0,uAt.IsTemplateLiteral)(t)?N6a(t,e,r):(0,uAt.IsUnion)(t)?(0,tki.Union)(nki(t.anyOf,e),r):(0,uAt.IsLiteral)(t)?(0,eki.Literal)(rki(t.const,e),r):(0,x6a.CreateType)(t,r)}a(iki,"Intrinsic")});var oki=I(J1r=>{"use strict";p();Object.defineProperty(J1r,"__esModule",{value:!0});J1r.Capitalize=O6a;var M6a=yre();function O6a(t,e={}){return(0,M6a.Intrinsic)(t,"Capitalize",e)}a(O6a,"Capitalize")});var ski=I(Z1r=>{"use strict";p();Object.defineProperty(Z1r,"__esModule",{value:!0});Z1r.Lowercase=B6a;var L6a=yre();function B6a(t,e={}){return(0,L6a.Intrinsic)(t,"Lowercase",e)}a(B6a,"Lowercase")});var aki=I(X1r=>{"use strict";p();Object.defineProperty(X1r,"__esModule",{value:!0});X1r.Uncapitalize=U6a;var F6a=yre();function U6a(t,e={}){return(0,F6a.Intrinsic)(t,"Uncapitalize",e)}a(U6a,"Uncapitalize")});var cki=I(eSr=>{"use strict";p();Object.defineProperty(eSr,"__esModule",{value:!0});eSr.Uppercase=q6a;var Q6a=yre();function q6a(t,e={}){return(0,Q6a.Intrinsic)(t,"Uppercase",e)}a(q6a,"Uppercase")});var dAt=I(PR=>{"use strict";p();var j6a=PR&&PR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sAe=PR&&PR.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j6a(e,t,r)};Object.defineProperty(PR,"__esModule",{value:!0});sAe(oki(),PR);sAe(Y1r(),PR);sAe(yre(),PR);sAe(ski(),PR);sAe(aki(),PR);sAe(cki(),PR)});var rSr=I(tSr=>{"use strict";p();Object.defineProperty(tSr,"__esModule",{value:!0});tSr.OmitFromMappedResult=z6a;var H6a=bm(),G6a=fAt(),$6a=Yb();function V6a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,G6a.Omit)(t[o],e,(0,$6a.Clone)(r));return n}a(V6a,"FromProperties");function W6a(t,e,r){return V6a(t.properties,e,r)}a(W6a,"FromMappedResult");function z6a(t,e,r){let n=W6a(t,e,r);return(0,H6a.MappedResult)(n)}a(z6a,"OmitFromMappedResult")});var fAt=I(oSr=>{"use strict";p();Object.defineProperty(oSr,"__esModule",{value:!0});oSr.Omit=u9a;var Y6a=Ii(),K6a=Igt(),J6a=x5e(),nSr=BG(),Z6a=UE(),X6a=hD(),e9a=XT(),lki=Ip(),uki=xv(),t9a=sSr(),r9a=rSr(),p6=vs(),n9a=Iv();function i9a(t,e){return t.map(r=>iSr(r,e))}a(i9a,"FromIntersect");function o9a(t,e){return t.map(r=>iSr(r,e))}a(o9a,"FromUnion");function s9a(t,e){let{[e]:r,...n}=t;return n}a(s9a,"FromProperty");function a9a(t,e){return e.reduce((r,n)=>s9a(r,n),t)}a(a9a,"FromProperties");function c9a(t,e,r){let n=(0,K6a.Discard)(t,[J6a.TransformKind,"$id","required","properties"]),o=a9a(r,e);return(0,uki.Object)(o,n)}a(c9a,"FromObject");function l9a(t){let e=t.reduce((r,n)=>(0,p6.IsLiteralValue)(n)?[...r,(0,Z6a.Literal)(n)]:r,[]);return(0,lki.Union)(e)}a(l9a,"UnionFromPropertyKeys");function iSr(t,e){return(0,p6.IsIntersect)(t)?(0,e9a.Intersect)(i9a(t.allOf,e)):(0,p6.IsUnion)(t)?(0,lki.Union)(o9a(t.anyOf,e)):(0,p6.IsObject)(t)?c9a(t,e,t.properties):(0,uki.Object)({})}a(iSr,"OmitResolve");function u9a(t,e,r){let n=(0,n9a.IsArray)(e)?l9a(e):e,o=(0,p6.IsSchema)(e)?(0,X6a.IndexPropertyKeys)(e):e,s=(0,p6.IsRef)(t),c=(0,p6.IsRef)(e);return(0,p6.IsMappedResult)(t)?(0,r9a.OmitFromMappedResult)(t,o,r):(0,p6.IsMappedKey)(e)?(0,t9a.OmitFromMappedKey)(t,e,r):s&&c?(0,nSr.Computed)("Omit",[t,n],r):!s&&c?(0,nSr.Computed)("Omit",[t,n],r):s&&!c?(0,nSr.Computed)("Omit",[t,n],r):(0,Y6a.CreateType)({...iSr(t,o),...r})}a(u9a,"Omit")});var sSr=I(aSr=>{"use strict";p();Object.defineProperty(aSr,"__esModule",{value:!0});aSr.OmitFromMappedKey=A9a;var d9a=bm(),f9a=fAt(),p9a=Yb();function h9a(t,e,r){return{[e]:(0,f9a.Omit)(t,[e],(0,p9a.Clone)(r))}}a(h9a,"FromPropertyKey");function m9a(t,e,r){return e.reduce((n,o)=>({...n,...h9a(t,o,r)}),{})}a(m9a,"FromPropertyKeys");function g9a(t,e,r){return m9a(t,e.keys,r)}a(g9a,"FromMappedKey");function A9a(t,e,r){let n=g9a(t,e,r);return(0,d9a.MappedResult)(n)}a(A9a,"OmitFromMappedKey")});var J5e=I(h6=>{"use strict";p();var y9a=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]})),cSr=h6&&h6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&y9a(e,t,r)};Object.defineProperty(h6,"__esModule",{value:!0});cSr(sSr(),h6);cSr(rSr(),h6);cSr(fAt(),h6)});var uSr=I(lSr=>{"use strict";p();Object.defineProperty(lSr,"__esModule",{value:!0});lSr.PickFromMappedResult=S9a;var E9a=bm(),_9a=pAt(),v9a=Yb();function C9a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,_9a.Pick)(t[o],e,(0,v9a.Clone)(r));return n}a(C9a,"FromProperties");function b9a(t,e,r){return C9a(t.properties,e,r)}a(b9a,"FromMappedResult");function S9a(t,e,r){let n=b9a(t,e,r);return(0,E9a.MappedResult)(n)}a(S9a,"PickFromMappedResult")});var pAt=I(pSr=>{"use strict";p();Object.defineProperty(pSr,"__esModule",{value:!0});pSr.Pick=U9a;var T9a=Ii(),I9a=Igt(),dSr=BG(),x9a=XT(),w9a=UE(),dki=xv(),fki=Ip(),R9a=hD(),k9a=x5e(),m6=vs(),P9a=Iv(),D9a=hSr(),N9a=uSr();function M9a(t,e){return t.map(r=>fSr(r,e))}a(M9a,"FromIntersect");function O9a(t,e){return t.map(r=>fSr(r,e))}a(O9a,"FromUnion");function L9a(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(L9a,"FromProperties");function B9a(t,e,r){let n=(0,I9a.Discard)(t,[k9a.TransformKind,"$id","required","properties"]),o=L9a(r,e);return(0,dki.Object)(o,n)}a(B9a,"FromObject");function F9a(t){let e=t.reduce((r,n)=>(0,m6.IsLiteralValue)(n)?[...r,(0,w9a.Literal)(n)]:r,[]);return(0,fki.Union)(e)}a(F9a,"UnionFromPropertyKeys");function fSr(t,e){return(0,m6.IsIntersect)(t)?(0,x9a.Intersect)(M9a(t.allOf,e)):(0,m6.IsUnion)(t)?(0,fki.Union)(O9a(t.anyOf,e)):(0,m6.IsObject)(t)?B9a(t,e,t.properties):(0,dki.Object)({})}a(fSr,"PickResolve");function U9a(t,e,r){let n=(0,P9a.IsArray)(e)?F9a(e):e,o=(0,m6.IsSchema)(e)?(0,R9a.IndexPropertyKeys)(e):e,s=(0,m6.IsRef)(t),c=(0,m6.IsRef)(e);return(0,m6.IsMappedResult)(t)?(0,N9a.PickFromMappedResult)(t,o,r):(0,m6.IsMappedKey)(e)?(0,D9a.PickFromMappedKey)(t,e,r):s&&c?(0,dSr.Computed)("Pick",[t,n],r):!s&&c?(0,dSr.Computed)("Pick",[t,n],r):s&&!c?(0,dSr.Computed)("Pick",[t,n],r):(0,T9a.CreateType)({...fSr(t,o),...r})}a(U9a,"Pick")});var hSr=I(mSr=>{"use strict";p();Object.defineProperty(mSr,"__esModule",{value:!0});mSr.PickFromMappedKey=V9a;var Q9a=bm(),q9a=pAt(),j9a=Yb();function H9a(t,e,r){return{[e]:(0,q9a.Pick)(t,[e],(0,j9a.Clone)(r))}}a(H9a,"FromPropertyKey");function G9a(t,e,r){return e.reduce((n,o)=>({...n,...H9a(t,o,r)}),{})}a(G9a,"FromPropertyKeys");function $9a(t,e,r){return G9a(t,e.keys,r)}a($9a,"FromMappedKey");function V9a(t,e,r){let n=$9a(t,e,r);return(0,Q9a.MappedResult)(n)}a(V9a,"PickFromMappedKey")});var Z5e=I(g6=>{"use strict";p();var W9a=g6&&g6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gSr=g6&&g6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W9a(e,t,r)};Object.defineProperty(g6,"__esModule",{value:!0});gSr(hSr(),g6);gSr(uSr(),g6);gSr(pAt(),g6)});var ySr=I(A6=>{"use strict";p();var z9a=A6&&A6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y9a=A6&&A6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K9a=A6&&A6.__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;omki(e))}a(pki,"FromRest");function mki(t){return Rv.IsComputed(t)?oUa(t.target,t.parameters):Rv.IsRef(t)?sUa(t.$ref):Rv.IsIntersect(t)?(0,X9a.Intersect)(pki(t.allOf)):Rv.IsUnion(t)?(0,eUa.Union)(pki(t.anyOf)):Rv.IsObject(t)?cUa(t,t.properties):Rv.IsBigInt(t)||Rv.IsBoolean(t)||Rv.IsInteger(t)||Rv.IsLiteral(t)||Rv.IsNull(t)||Rv.IsNumber(t)||Rv.IsString(t)||Rv.IsSymbol(t)||Rv.IsUndefined(t)?t:(0,hki.Object)({})}a(mki,"PartialResolve");function lUa(t,e){return Rv.IsMappedResult(t)?(0,iUa.PartialFromMappedResult)(t,e):(0,J9a.CreateType)({...mki(t),...e})}a(lUa,"Partial")});var ESr=I(_Sr=>{"use strict";p();Object.defineProperty(_Sr,"__esModule",{value:!0});_Sr.PartialFromMappedResult=mUa;var uUa=bm(),dUa=ySr(),fUa=Yb();function pUa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,dUa.Partial)(t[n],(0,fUa.Clone)(e));return r}a(pUa,"FromProperties");function hUa(t,e){return pUa(t.properties,e)}a(hUa,"FromMappedResult");function mUa(t,e){let r=hUa(t,e);return(0,uUa.MappedResult)(r)}a(mUa,"PartialFromMappedResult")});var X5e=I(WG=>{"use strict";p();var gUa=WG&&WG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gki=WG&&WG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gUa(e,t,r)};Object.defineProperty(WG,"__esModule",{value:!0});gki(ESr(),WG);gki(ySr(),WG)});var CSr=I(y6=>{"use strict";p();var AUa=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]})),yUa=y6&&y6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),EUa=y6&&y6.__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;ovki(e))}a(Aki,"FromRest");function vki(t){return kv.IsComputed(t)?TUa(t.target,t.parameters):kv.IsRef(t)?IUa(t.$ref):kv.IsIntersect(t)?(0,vUa.Intersect)(Aki(t.allOf)):kv.IsUnion(t)?(0,CUa.Union)(Aki(t.anyOf)):kv.IsObject(t)?wUa(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,yki.Object)({})}a(vki,"RequiredResolve");function RUa(t,e){return kv.IsMappedResult(t)?(0,SUa.RequiredFromMappedResult)(t,e):(0,_Ua.CreateType)({...vki(t),...e})}a(RUa,"Required")});var bSr=I(SSr=>{"use strict";p();Object.defineProperty(SSr,"__esModule",{value:!0});SSr.RequiredFromMappedResult=MUa;var kUa=bm(),PUa=CSr();function DUa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,PUa.Required)(t[n],e);return r}a(DUa,"FromProperties");function NUa(t,e){return DUa(t.properties,e)}a(NUa,"FromMappedResult");function MUa(t,e){let r=NUa(t,e);return(0,kUa.MappedResult)(r)}a(MUa,"RequiredFromMappedResult")});var e4e=I(zG=>{"use strict";p();var OUa=zG&&zG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Cki=zG&&zG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OUa(e,t,r)};Object.defineProperty(zG,"__esModule",{value:!0});Cki(bSr(),zG);Cki(CSr(),zG)});var Iki=I(yD=>{"use strict";p();var LUa=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]})),BUa=yD&&yD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FUa=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;omy.IsRef(r)?ISr(t,r.$ref):n1(t,r))}a(r7a,"DereferenceParameters");function ISr(t,e){return e in t?my.IsRef(t[e])?ISr(t,t[e].$ref):n1(t,t[e]):(0,TSr.Never)()}a(ISr,"Dereference");function n7a(t){return(0,qUa.Awaited)(t[0])}a(n7a,"FromAwaited");function i7a(t){return(0,GUa.Index)(t[0],t[1])}a(i7a,"FromIndex");function o7a(t){return(0,zUa.KeyOf)(t[0])}a(o7a,"FromKeyOf");function s7a(t){return(0,ZUa.Partial)(t[0])}a(s7a,"FromPartial");function a7a(t){return(0,KUa.Omit)(t[0],t[1])}a(a7a,"FromOmit");function c7a(t){return(0,JUa.Pick)(t[0],t[1])}a(c7a,"FromPick");function l7a(t){return(0,XUa.Required)(t[0])}a(l7a,"FromRequired");function u7a(t,e,r){let n=r7a(t,r);return e==="Awaited"?n7a(n):e==="Index"?i7a(n):e==="KeyOf"?o7a(n):e==="Partial"?s7a(n):e==="Omit"?a7a(n):e==="Pick"?c7a(n):e==="Required"?l7a(n):(0,TSr.Never)()}a(u7a,"FromComputed");function d7a(t,e){return(0,QUa.Array)(n1(t,e))}a(d7a,"FromArray");function f7a(t,e){return(0,jUa.AsyncIterator)(n1(t,e))}a(f7a,"FromAsyncIterator");function p7a(t,e,r){return(0,HUa.Constructor)(t4e(t,e),n1(t,r))}a(p7a,"FromConstructor");function h7a(t,e,r){return(0,$Ua.Function)(t4e(t,e),n1(t,r))}a(h7a,"FromFunction");function m7a(t,e){return(0,VUa.Intersect)(t4e(t,e))}a(m7a,"FromIntersect");function g7a(t,e){return(0,WUa.Iterator)(n1(t,e))}a(g7a,"FromIterator");function A7a(t,e){return(0,YUa.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:n1(t,e[n])}),{}))}a(A7a,"FromObject");function y7a(t,e){let[r,n]=[n1(t,(0,Ski.RecordValue)(e)),(0,Ski.RecordPattern)(e)],o=(0,UUa.CloneType)(e);return o.patternProperties[n]=r,o}a(y7a,"FromRecord");function E7a(t,e){return my.IsRef(e)?{...ISr(t,e.$ref),[hAt.TransformKind]:e[hAt.TransformKind]}:e}a(E7a,"FromTransform");function _7a(t,e){return(0,e7a.Tuple)(t4e(t,e))}a(_7a,"FromTuple");function v7a(t,e){return(0,t7a.Union)(t4e(t,e))}a(v7a,"FromUnion");function t4e(t,e){return e.map(r=>n1(t,r))}a(t4e,"FromTypes");function n1(t,e){return my.IsOptional(e)?(0,r1.CreateType)(n1(t,(0,bki.Discard)(e,[hAt.OptionalKind])),e):my.IsReadonly(e)?(0,r1.CreateType)(n1(t,(0,bki.Discard)(e,[hAt.ReadonlyKind])),e):my.IsTransform(e)?(0,r1.CreateType)(E7a(t,e),e):my.IsArray(e)?(0,r1.CreateType)(d7a(t,e.items),e):my.IsAsyncIterator(e)?(0,r1.CreateType)(f7a(t,e.items),e):my.IsComputed(e)?(0,r1.CreateType)(u7a(t,e.target,e.parameters)):my.IsConstructor(e)?(0,r1.CreateType)(p7a(t,e.parameters,e.returns),e):my.IsFunction(e)?(0,r1.CreateType)(h7a(t,e.parameters,e.returns),e):my.IsIntersect(e)?(0,r1.CreateType)(m7a(t,e.allOf),e):my.IsIterator(e)?(0,r1.CreateType)(g7a(t,e.items),e):my.IsObject(e)?(0,r1.CreateType)(A7a(t,e.properties),e):my.IsRecord(e)?(0,r1.CreateType)(y7a(t,e)):my.IsTuple(e)?(0,r1.CreateType)(_7a(t,e.items||[]),e):my.IsUnion(e)?(0,r1.CreateType)(v7a(t,e.anyOf),e):e}a(n1,"FromType");function Tki(t,e){return e in t?n1(t,t[e]):(0,TSr.Never)()}a(Tki,"ComputeType");function C7a(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:Tki(t,r)}),{})}a(C7a,"ComputeModuleProperties")});var wki=I(r4e=>{"use strict";p();Object.defineProperty(r4e,"__esModule",{value:!0});r4e.TModule=void 0;r4e.Module=T7a;var xki=t6(),b7a=Sn(),S7a=Iki(),mAt=class{static{a(this,"TModule")}constructor(e){let r=(0,S7a.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,xki.CreateType)(this.$defs[e],r)};return(0,xki.CreateType)({[b7a.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};r4e.TModule=mAt;function T7a(t){return new mAt(t)}a(T7a,"Module")});var gAt=I(Ere=>{"use strict";p();var I7a=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]})),x7a=Ere&&Ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I7a(e,t,r)};Object.defineProperty(Ere,"__esModule",{value:!0});x7a(wki(),Ere)});var Rki=I(xSr=>{"use strict";p();Object.defineProperty(xSr,"__esModule",{value:!0});xSr.Not=k7a;var w7a=Ii(),R7a=Sn();function k7a(t,e){return(0,w7a.CreateType)({[R7a.Kind]:"Not",not:t},e)}a(k7a,"Not")});var AAt=I(_re=>{"use strict";p();var P7a=_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]})),D7a=_re&&_re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P7a(e,t,r)};Object.defineProperty(_re,"__esModule",{value:!0});D7a(Rki(),_re)});var kki=I(E6=>{"use strict";p();var N7a=E6&&E6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=E6&&E6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),O7a=E6&&E6.__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 Q7a=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]})),q7a=vre&&vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Q7a(e,t,r)};Object.defineProperty(vre,"__esModule",{value:!0});q7a(kki(),vre)});var Dki=I(wSr=>{"use strict";p();Object.defineProperty(wSr,"__esModule",{value:!0});wSr.Recursive=V7a;var j7a=ygt(),H7a=Ii(),G7a=Iv(),Pki=Sn(),$7a=0;function V7a(t,e={}){(0,G7a.IsUndefined)(e.$id)&&(e.$id=`T${$7a++}`);let r=(0,j7a.CloneType)(t({[Pki.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,H7a.CreateType)({[Pki.Hint]:"Recursive",...r},e)}a(V7a,"Recursive")});var EAt=I(Cre=>{"use strict";p();var W7a=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]})),z7a=Cre&&Cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W7a(e,t,r)};Object.defineProperty(Cre,"__esModule",{value:!0});z7a(Dki(),Cre)});var Nki=I(RSr=>{"use strict";p();Object.defineProperty(RSr,"__esModule",{value:!0});RSr.RegExp=Z7a;var Y7a=Ii(),K7a=Iv(),J7a=Sn();function Z7a(t,e){let r=(0,K7a.IsString)(t)?new globalThis.RegExp(t):t;return(0,Y7a.CreateType)({[J7a.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(Z7a,"RegExp")});var _At=I(bre=>{"use strict";p();var X7a=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]})),eQa=bre&&bre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&X7a(e,t,r)};Object.defineProperty(bre,"__esModule",{value:!0});eQa(Nki(),bre)});var Mki=I(PSr=>{"use strict";p();Object.defineProperty(PSr,"__esModule",{value:!0});PSr.Rest=rQa;var kSr=vs();function tQa(t){return(0,kSr.IsIntersect)(t)?t.allOf:(0,kSr.IsUnion)(t)?t.anyOf:(0,kSr.IsTuple)(t)?t.items??[]:[]}a(tQa,"RestResolve");function rQa(t){return tQa(t)}a(rQa,"Rest")});var vAt=I(Sre=>{"use strict";p();var nQa=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]})),iQa=Sre&&Sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nQa(e,t,r)};Object.defineProperty(Sre,"__esModule",{value:!0});iQa(Mki(),Sre)});var Oki=I(_6=>{"use strict";p();var oQa=_6&&_6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sQa=_6&&_6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aQa=_6&&_6.__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 fQa=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]})),pQa=Tre&&Tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fQa(e,t,r)};Object.defineProperty(Tre,"__esModule",{value:!0});pQa(Oki(),Tre)});var Bki=I(Lki=>{"use strict";p();Object.defineProperty(Lki,"__esModule",{value:!0})});var Uki=I(Fki=>{"use strict";p();Object.defineProperty(Fki,"__esModule",{value:!0});var k2p=Sn()});var qki=I(YG=>{"use strict";p();var hQa=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]})),Qki=YG&&YG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hQa(e,t,r)};Object.defineProperty(YG,"__esModule",{value:!0});Qki(Bki(),YG);Qki(Uki(),YG)});var Hki=I(jki=>{"use strict";p();Object.defineProperty(jki,"__esModule",{value:!0})});var Gki=I(Ire=>{"use strict";p();var mQa=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]})),gQa=Ire&&Ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mQa(e,t,r)};Object.defineProperty(Ire,"__esModule",{value:!0});gQa(Hki(),Ire)});var $ki=I(xre=>{"use strict";p();Object.defineProperty(xre,"__esModule",{value:!0});xre.TransformEncodeBuilder=xre.TransformDecodeBuilder=void 0;xre.Transform=yQa;var bAt=Sn(),AQa=vs(),SAt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new TAt(this.schema,e)}};xre.TransformDecodeBuilder=SAt;var TAt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[bAt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[bAt.TransformKind].Decode(c)),"Decode")};return{...r,[bAt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[bAt.TransformKind]:n}}Encode(e){return(0,AQa.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};xre.TransformEncodeBuilder=TAt;function yQa(t){return new SAt(t)}a(yQa,"Transform")});var IAt=I(wre=>{"use strict";p();var EQa=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]})),_Qa=wre&&wre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EQa(e,t,r)};Object.defineProperty(wre,"__esModule",{value:!0});_Qa($ki(),wre)});var Wki=I(DSr=>{"use strict";p();Object.defineProperty(DSr,"__esModule",{value:!0});DSr.Unsafe=CQa;var vQa=Ii(),Vki=Sn();function CQa(t={}){return(0,vQa.CreateType)({[Vki.Kind]:t[Vki.Kind]??"Unsafe"},t)}a(CQa,"Unsafe")});var n4e=I(Rre=>{"use strict";p();var bQa=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]})),SQa=Rre&&Rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bQa(e,t,r)};Object.defineProperty(Rre,"__esModule",{value:!0});SQa(Wki(),Rre)});var zki=I(NSr=>{"use strict";p();Object.defineProperty(NSr,"__esModule",{value:!0});NSr.Void=xQa;var TQa=Ii(),IQa=Sn();function xQa(t){return(0,TQa.CreateType)({[IQa.Kind]:"Void",type:"void"},t)}a(xQa,"Void")});var xAt=I(kre=>{"use strict";p();var wQa=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]})),RQa=kre&&kre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wQa(e,t,r)};Object.defineProperty(kre,"__esModule",{value:!0});RQa(zki(),kre)});var OSr=I(RAt=>{"use strict";p();Object.defineProperty(RAt,"__esModule",{value:!0});RAt.JsonTypeBuilder=void 0;var kQa=Gge(),PQa=$ge(),DQa=O5e(),NQa=Hgt(),MQa=$gt(),OQa=Wgt(),LQa=rAt(),BQa=ure(),FQa=oAt(),UQa=hD(),QQa=cAt(),qQa=XT(),wAt=dAt(),jQa=mD(),HQa=UE(),GQa=bm(),$Qa=Cm(),VQa=AAt(),WQa=$5e(),zQa=gAt(),YQa=UG(),KQa=xv(),JQa=J5e(),ZQa=G4(),XQa=X5e(),eqa=Z5e(),tqa=HG(),rqa=K5e(),nqa=iAe(),iqa=EAt(),oqa=$G(),sqa=e4e(),aqa=vAt(),cqa=QG(),lqa=pD(),uqa=IAt(),dqa=s6(),fqa=Ip(),pqa=VG(),hqa=n4e(),MSr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,rqa.ReadonlyOptional)(e)}Readonly(e,r){return(0,tqa.Readonly)(e,r??!0)}Optional(e,r){return(0,ZQa.Optional)(e,r??!0)}Any(e){return(0,kQa.Any)(e)}Array(e,r){return(0,PQa.Array)(e,r)}Boolean(e){return(0,DQa.Boolean)(e)}Capitalize(e,r){return(0,wAt.Capitalize)(e,r)}Composite(e,r){return(0,NQa.Composite)(e,r)}Const(e,r){return(0,MQa.Const)(e,r)}Enum(e,r){return(0,OQa.Enum)(e,r)}Exclude(e,r,n){return(0,LQa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,BQa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,FQa.Extract)(e,r,n)}Index(e,r,n){return(0,UQa.Index)(e,r,n)}Integer(e){return(0,QQa.Integer)(e)}Intersect(e,r){return(0,qQa.Intersect)(e,r)}KeyOf(e,r){return(0,jQa.KeyOf)(e,r)}Literal(e,r){return(0,HQa.Literal)(e,r)}Lowercase(e,r){return(0,wAt.Lowercase)(e,r)}Mapped(e,r,n){return(0,GQa.Mapped)(e,r,n)}Module(e){return(0,zQa.Module)(e)}Never(e){return(0,$Qa.Never)(e)}Not(e,r){return(0,VQa.Not)(e,r)}Null(e){return(0,WQa.Null)(e)}Number(e){return(0,YQa.Number)(e)}Object(e,r){return(0,KQa.Object)(e,r)}Omit(e,r,n){return(0,JQa.Omit)(e,r,n)}Partial(e,r){return(0,XQa.Partial)(e,r)}Pick(e,r,n){return(0,eqa.Pick)(e,r,n)}Record(e,r,n){return(0,nqa.Record)(e,r,n)}Recursive(e,r){return(0,iqa.Recursive)(e,r)}Ref(...e){return(0,oqa.Ref)(e[0],e[1])}Required(e,r){return(0,sqa.Required)(e,r)}Rest(e){return(0,aqa.Rest)(e)}String(e){return(0,cqa.String)(e)}TemplateLiteral(e,r){return(0,lqa.TemplateLiteral)(e,r)}Transform(e){return(0,uqa.Transform)(e)}Tuple(e,r){return(0,dqa.Tuple)(e,r)}Uncapitalize(e,r){return(0,wAt.Uncapitalize)(e,r)}Union(e,r){return(0,fqa.Union)(e,r)}Unknown(e){return(0,pqa.Unknown)(e)}Unsafe(e){return(0,hqa.Unsafe)(e)}Uppercase(e,r){return(0,wAt.Uppercase)(e,r)}};RAt.JsonTypeBuilder=MSr});var Yki=I(Ot=>{"use strict";p();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.Rest=Ot.Required=Ot.RegExp=Ot.Ref=Ot.Recursive=Ot.Record=Ot.ReadonlyOptional=Ot.Readonly=Ot.Promise=Ot.Pick=Ot.Partial=Ot.Parameters=Ot.Optional=Ot.Omit=Ot.Object=Ot.Number=Ot.Null=Ot.Not=Ot.Never=Ot.Module=Ot.Mapped=Ot.Literal=Ot.KeyOf=Ot.Iterator=Ot.Uppercase=Ot.Lowercase=Ot.Uncapitalize=Ot.Capitalize=Ot.Intersect=Ot.Integer=Ot.Instantiate=Ot.InstanceType=Ot.Index=Ot.Function=Ot.Extract=Ot.Extends=Ot.Exclude=Ot.Enum=Ot.Date=Ot.ConstructorParameters=Ot.Constructor=Ot.Const=Ot.Composite=Ot.Boolean=Ot.BigInt=Ot.Awaited=Ot.AsyncIterator=Ot.Array=Ot.Argument=Ot.Any=void 0;Ot.Void=Ot.Unsafe=Ot.Unknown=Ot.Union=Ot.Undefined=Ot.Uint8Array=Ot.Tuple=Ot.Transform=Ot.TemplateLiteral=Ot.Symbol=Ot.String=Ot.ReturnType=void 0;var mqa=Gge();Object.defineProperty(Ot,"Any",{enumerable:!0,get:a(function(){return mqa.Any},"get")});var gqa=Tgt();Object.defineProperty(Ot,"Argument",{enumerable:!0,get:a(function(){return gqa.Argument},"get")});var Aqa=$ge();Object.defineProperty(Ot,"Array",{enumerable:!0,get:a(function(){return Aqa.Array},"get")});var yqa=Vge();Object.defineProperty(Ot,"AsyncIterator",{enumerable:!0,get:a(function(){return yqa.AsyncIterator},"get")});var Eqa=H5e();Object.defineProperty(Ot,"Awaited",{enumerable:!0,get:a(function(){return Eqa.Awaited},"get")});var _qa=Jge();Object.defineProperty(Ot,"BigInt",{enumerable:!0,get:a(function(){return _qa.BigInt},"get")});var vqa=O5e();Object.defineProperty(Ot,"Boolean",{enumerable:!0,get:a(function(){return vqa.Boolean},"get")});var Cqa=Hgt();Object.defineProperty(Ot,"Composite",{enumerable:!0,get:a(function(){return Cqa.Composite},"get")});var bqa=$gt();Object.defineProperty(Ot,"Const",{enumerable:!0,get:a(function(){return bqa.Const},"get")});var Sqa=Wge();Object.defineProperty(Ot,"Constructor",{enumerable:!0,get:a(function(){return Sqa.Constructor},"get")});var Tqa=Vgt();Object.defineProperty(Ot,"ConstructorParameters",{enumerable:!0,get:a(function(){return Tqa.ConstructorParameters},"get")});var Iqa=G5e();Object.defineProperty(Ot,"Date",{enumerable:!0,get:a(function(){return Iqa.Date},"get")});var xqa=Wgt();Object.defineProperty(Ot,"Enum",{enumerable:!0,get:a(function(){return xqa.Enum},"get")});var wqa=rAt();Object.defineProperty(Ot,"Exclude",{enumerable:!0,get:a(function(){return wqa.Exclude},"get")});var Rqa=ure();Object.defineProperty(Ot,"Extends",{enumerable:!0,get:a(function(){return Rqa.Extends},"get")});var kqa=oAt();Object.defineProperty(Ot,"Extract",{enumerable:!0,get:a(function(){return kqa.Extract},"get")});var Pqa=FG();Object.defineProperty(Ot,"Function",{enumerable:!0,get:a(function(){return Pqa.Function},"get")});var Dqa=hD();Object.defineProperty(Ot,"Index",{enumerable:!0,get:a(function(){return Dqa.Index},"get")});var Nqa=sAt();Object.defineProperty(Ot,"InstanceType",{enumerable:!0,get:a(function(){return Nqa.InstanceType},"get")});var Mqa=aAt();Object.defineProperty(Ot,"Instantiate",{enumerable:!0,get:a(function(){return Mqa.Instantiate},"get")});var Oqa=cAt();Object.defineProperty(Ot,"Integer",{enumerable:!0,get:a(function(){return Oqa.Integer},"get")});var Lqa=XT();Object.defineProperty(Ot,"Intersect",{enumerable:!0,get:a(function(){return Lqa.Intersect},"get")});var kAt=dAt();Object.defineProperty(Ot,"Capitalize",{enumerable:!0,get:a(function(){return kAt.Capitalize},"get")});Object.defineProperty(Ot,"Uncapitalize",{enumerable:!0,get:a(function(){return kAt.Uncapitalize},"get")});Object.defineProperty(Ot,"Lowercase",{enumerable:!0,get:a(function(){return kAt.Lowercase},"get")});Object.defineProperty(Ot,"Uppercase",{enumerable:!0,get:a(function(){return kAt.Uppercase},"get")});var Bqa=Xge();Object.defineProperty(Ot,"Iterator",{enumerable:!0,get:a(function(){return Bqa.Iterator},"get")});var Fqa=mD();Object.defineProperty(Ot,"KeyOf",{enumerable:!0,get:a(function(){return Fqa.KeyOf},"get")});var Uqa=UE();Object.defineProperty(Ot,"Literal",{enumerable:!0,get:a(function(){return Uqa.Literal},"get")});var Qqa=bm();Object.defineProperty(Ot,"Mapped",{enumerable:!0,get:a(function(){return Qqa.Mapped},"get")});var qqa=gAt();Object.defineProperty(Ot,"Module",{enumerable:!0,get:a(function(){return qqa.Module},"get")});var jqa=Cm();Object.defineProperty(Ot,"Never",{enumerable:!0,get:a(function(){return jqa.Never},"get")});var Hqa=AAt();Object.defineProperty(Ot,"Not",{enumerable:!0,get:a(function(){return Hqa.Not},"get")});var Gqa=$5e();Object.defineProperty(Ot,"Null",{enumerable:!0,get:a(function(){return Gqa.Null},"get")});var $qa=UG();Object.defineProperty(Ot,"Number",{enumerable:!0,get:a(function(){return $qa.Number},"get")});var Vqa=xv();Object.defineProperty(Ot,"Object",{enumerable:!0,get:a(function(){return Vqa.Object},"get")});var Wqa=J5e();Object.defineProperty(Ot,"Omit",{enumerable:!0,get:a(function(){return Wqa.Omit},"get")});var zqa=G4();Object.defineProperty(Ot,"Optional",{enumerable:!0,get:a(function(){return zqa.Optional},"get")});var Yqa=yAt();Object.defineProperty(Ot,"Parameters",{enumerable:!0,get:a(function(){return Yqa.Parameters},"get")});var Kqa=X5e();Object.defineProperty(Ot,"Partial",{enumerable:!0,get:a(function(){return Kqa.Partial},"get")});var Jqa=Z5e();Object.defineProperty(Ot,"Pick",{enumerable:!0,get:a(function(){return Jqa.Pick},"get")});var Zqa=Q5e();Object.defineProperty(Ot,"Promise",{enumerable:!0,get:a(function(){return Zqa.Promise},"get")});var Xqa=HG();Object.defineProperty(Ot,"Readonly",{enumerable:!0,get:a(function(){return Xqa.Readonly},"get")});var eja=K5e();Object.defineProperty(Ot,"ReadonlyOptional",{enumerable:!0,get:a(function(){return eja.ReadonlyOptional},"get")});var tja=iAe();Object.defineProperty(Ot,"Record",{enumerable:!0,get:a(function(){return tja.Record},"get")});var rja=EAt();Object.defineProperty(Ot,"Recursive",{enumerable:!0,get:a(function(){return rja.Recursive},"get")});var nja=$G();Object.defineProperty(Ot,"Ref",{enumerable:!0,get:a(function(){return nja.Ref},"get")});var ija=_At();Object.defineProperty(Ot,"RegExp",{enumerable:!0,get:a(function(){return ija.RegExp},"get")});var oja=e4e();Object.defineProperty(Ot,"Required",{enumerable:!0,get:a(function(){return oja.Required},"get")});var sja=vAt();Object.defineProperty(Ot,"Rest",{enumerable:!0,get:a(function(){return sja.Rest},"get")});var aja=CAt();Object.defineProperty(Ot,"ReturnType",{enumerable:!0,get:a(function(){return aja.ReturnType},"get")});var cja=QG();Object.defineProperty(Ot,"String",{enumerable:!0,get:a(function(){return cja.String},"get")});var lja=V5e();Object.defineProperty(Ot,"Symbol",{enumerable:!0,get:a(function(){return lja.Symbol},"get")});var uja=pD();Object.defineProperty(Ot,"TemplateLiteral",{enumerable:!0,get:a(function(){return uja.TemplateLiteral},"get")});var dja=IAt();Object.defineProperty(Ot,"Transform",{enumerable:!0,get:a(function(){return dja.Transform},"get")});var fja=s6();Object.defineProperty(Ot,"Tuple",{enumerable:!0,get:a(function(){return fja.Tuple},"get")});var pja=z5e();Object.defineProperty(Ot,"Uint8Array",{enumerable:!0,get:a(function(){return pja.Uint8Array},"get")});var hja=W5e();Object.defineProperty(Ot,"Undefined",{enumerable:!0,get:a(function(){return hja.Undefined},"get")});var mja=Ip();Object.defineProperty(Ot,"Union",{enumerable:!0,get:a(function(){return mja.Union},"get")});var gja=VG();Object.defineProperty(Ot,"Unknown",{enumerable:!0,get:a(function(){return gja.Unknown},"get")});var Aja=n4e();Object.defineProperty(Ot,"Unsafe",{enumerable:!0,get:a(function(){return Aja.Unsafe},"get")});var yja=xAt();Object.defineProperty(Ot,"Void",{enumerable:!0,get:a(function(){return yja.Void},"get")})});var Kki=I(PAt=>{"use strict";p();Object.defineProperty(PAt,"__esModule",{value:!0});PAt.JavaScriptTypeBuilder=void 0;var Eja=OSr(),_ja=Tgt(),vja=Vge(),Cja=H5e(),bja=Jge(),Sja=Wge(),Tja=Vgt(),Ija=G5e(),xja=FG(),wja=sAt(),Rja=aAt(),kja=Xge(),Pja=yAt(),Dja=Q5e(),Nja=_At(),Mja=CAt(),Oja=V5e(),Lja=z5e(),Bja=W5e(),Fja=xAt(),LSr=class extends Eja.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,_ja.Argument)(e)}AsyncIterator(e,r){return(0,vja.AsyncIterator)(e,r)}Awaited(e,r){return(0,Cja.Awaited)(e,r)}BigInt(e){return(0,bja.BigInt)(e)}ConstructorParameters(e,r){return(0,Tja.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,Sja.Constructor)(e,r,n)}Date(e={}){return(0,Ija.Date)(e)}Function(e,r,n){return(0,xja.Function)(e,r,n)}InstanceType(e,r){return(0,wja.InstanceType)(e,r)}Instantiate(e,r){return(0,Rja.Instantiate)(e,r)}Iterator(e,r){return(0,kja.Iterator)(e,r)}Parameters(e,r){return(0,Pja.Parameters)(e,r)}Promise(e,r){return(0,Dja.Promise)(e,r)}RegExp(e,r){return(0,Nja.RegExp)(e,r)}ReturnType(e,r){return(0,Mja.ReturnType)(e,r)}Symbol(e){return(0,Oja.Symbol)(e)}Undefined(e){return(0,Bja.Undefined)(e)}Uint8Array(e){return(0,Lja.Uint8Array)(e)}Void(e){return(0,Fja.Void)(e)}};PAt.JavaScriptTypeBuilder=LSr});var Jki=I(i1=>{"use strict";p();var Uja=i1&&i1.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qja=i1&&i1.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qja=i1&&i1.__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 Vja=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]})),yn=en&&en.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vja(e,t,r)};Object.defineProperty(en,"__esModule",{value:!0});yn(ICr(),en);yn(t6(),en);yn(Nf(),en);yn(OCr(),en);yn(Zxi(),en);yn(P5e(),en);yn(Hge(),en);yn(D5e(),en);yn(Sn(),en);yn(Gge(),en);yn($ge(),en);yn(Tgt(),en);yn(Vge(),en);yn(H5e(),en);yn(Jge(),en);yn(O5e(),en);yn(Hgt(),en);yn($gt(),en);yn(Wge(),en);yn(Vgt(),en);yn(G5e(),en);yn(Wgt(),en);yn(rAt(),en);yn(ure(),en);yn(oAt(),en);yn(FG(),en);yn(hD(),en);yn(sAt(),en);yn(aAt(),en);yn(cAt(),en);yn(XT(),en);yn(Xge(),en);yn(dAt(),en);yn(mD(),en);yn(UE(),en);yn(gAt(),en);yn(bm(),en);yn(Cm(),en);yn(AAt(),en);yn($5e(),en);yn(UG(),en);yn(xv(),en);yn(J5e(),en);yn(G4(),en);yn(yAt(),en);yn(X5e(),en);yn(Z5e(),en);yn(Q5e(),en);yn(HG(),en);yn(K5e(),en);yn(iAe(),en);yn(EAt(),en);yn($G(),en);yn(_At(),en);yn(e4e(),en);yn(vAt(),en);yn(CAt(),en);yn(qki(),en);yn(Gki(),en);yn(QG(),en);yn(V5e(),en);yn(pD(),en);yn(IAt(),en);yn(s6(),en);yn(z5e(),en);yn(W5e(),en);yn(Ip(),en);yn(VG(),en);yn(n4e(),en);yn(xAt(),en);yn(Jki(),en)});var Xki=I(DR=>{"use strict";p();var Wja=DR&&DR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zja=DR&&DR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Yja=DR&&DR.__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 Jja=Y4&&Y4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zja=Y4&&Y4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xja=Y4&&Y4.__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(NAt,"__esModule",{value:!0});NAt.ContextItemOrigin=void 0;var rPi;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(rPi||(NAt.ContextItemOrigin=rPi={}))});var oPi=I(Nu=>{"use strict";p();Object.defineProperty(Nu,"__esModule",{value:!0});Nu.RangeSchema=Nu.WorkspaceFolder=Nu.VersionedTextDocumentIdentifier=Nu.TextEdit=Nu.TextDocumentItem=Nu.Range=Nu.Position=Nu.DocumentUri=Nu.Disposable=Nu.Command=Nu.CancellationTokenSource=Nu.CancellationToken=void 0;var MAt=DAt(),ED=ri();Object.defineProperty(Nu,"CancellationToken",{enumerable:!0,get:a(function(){return ED.CancellationToken},"get")});Object.defineProperty(Nu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return ED.CancellationTokenSource},"get")});Object.defineProperty(Nu,"Command",{enumerable:!0,get:a(function(){return ED.Command},"get")});Object.defineProperty(Nu,"Disposable",{enumerable:!0,get:a(function(){return ED.Disposable},"get")});Object.defineProperty(Nu,"DocumentUri",{enumerable:!0,get:a(function(){return ED.DocumentUri},"get")});Object.defineProperty(Nu,"Position",{enumerable:!0,get:a(function(){return ED.Position},"get")});Object.defineProperty(Nu,"Range",{enumerable:!0,get:a(function(){return ED.Range},"get")});Object.defineProperty(Nu,"TextDocumentItem",{enumerable:!0,get:a(function(){return ED.TextDocumentItem},"get")});Object.defineProperty(Nu,"TextEdit",{enumerable:!0,get:a(function(){return ED.TextEdit},"get")});Object.defineProperty(Nu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return ED.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(Nu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return ED.WorkspaceFolder},"get")});var iPi=MAt.Type.Object({line:MAt.Type.Integer({minimum:0}),character:MAt.Type.Integer({minimum:0})});Nu.RangeSchema=MAt.Type.Object({start:iPi,end:iPi})});var aPi=I(sPi=>{"use strict";p();Object.defineProperty(sPi,"__esModule",{value:!0})});var o4e=I(Mf=>{"use strict";p();var tHa=Mf&&Mf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i4e=Mf&&Mf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tHa(e,t,r)};Object.defineProperty(Mf,"__esModule",{value:!0});Mf.TextEdit=Mf.Range=Mf.Position=Mf.Disposable=Mf.CancellationTokenSource=Mf.CancellationToken=void 0;var aAe=ri();Object.defineProperty(Mf,"CancellationToken",{enumerable:!0,get:a(function(){return aAe.CancellationToken},"get")});Object.defineProperty(Mf,"CancellationTokenSource",{enumerable:!0,get:a(function(){return aAe.CancellationTokenSource},"get")});Object.defineProperty(Mf,"Disposable",{enumerable:!0,get:a(function(){return aAe.Disposable},"get")});Object.defineProperty(Mf,"Position",{enumerable:!0,get:a(function(){return aAe.Position},"get")});Object.defineProperty(Mf,"Range",{enumerable:!0,get:a(function(){return aAe.Range},"get")});Object.defineProperty(Mf,"TextEdit",{enumerable:!0,get:a(function(){return aAe.TextEdit},"get")});i4e(Xki(),Mf);i4e(tPi(),Mf);i4e(nPi(),Mf);i4e(oPi(),Mf);i4e(aPi(),Mf)});var FSr=I(eI=>{"use strict";p();var rHa=eI&&eI.__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},cPi=eI&&eI.__param||function(t,e){return function(r,n){e(r,n,t)}},nHa=eI&&eI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eI,"__esModule",{value:!0});eI.CompletionNotifier=eI.ICompletionsNotifierService=void 0;var iHa=nHa(require("events")),oHa=nn(),sHa=bte(),aHa=o4e(),cHa=$g(),lHa=_5e(),OAt="CompletionRequested";eI.ICompletionsNotifierService=(0,oHa.createServiceIdentifier)("ICompletionsNotifierService");var BSr=class{static{a(this,"CompletionNotifier")}#e=new iHa.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(OAt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,cHa.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${OAt}`);return this.#e.on(OAt,r),aHa.Disposable.create(()=>this.#e.off(OAt,r))}};eI.CompletionNotifier=BSr;eI.CompletionNotifier=BSr=rHa([cPi(0,lHa.ICompletionsPromiseQueueService),cPi(1,sHa.ICompletionsTelemetryService)],BSr)});var USr=I(LAt=>{"use strict";p();Object.defineProperty(LAt,"__esModule",{value:!0});LAt.ICompletionsObservableWorkspace=void 0;var uHa=Gs();LAt.ICompletionsObservableWorkspace=(0,uHa.createDecorator)("ICompletionsObservableWorkspace")});var Dl=I(_D=>{"use strict";p();Object.defineProperty(_D,"__esModule",{value:!0});_D.logger=_D.Logger=_D.ICompletionsLogTargetService=_D.LogLevel=void 0;var dHa=nn(),fHa=bte(),pHa=$g(),Pre;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(Pre||(_D.LogLevel=Pre={}));_D.ICompletionsLogTargetService=(0,dHa.createServiceIdentifier)("ICompletionsLogTargetService");var BAt=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,Pre.DEBUG,...r)}info(e,...r){this.log(e,Pre.INFO,...r)}warn(e,...r){this.log(e,Pre.WARN,...r)}error(e,...r){this.log(e,Pre.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,pHa.telemetryException)(e.get(fHa.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(_D.ICompletionsLogTargetService),Pre.ERROR,`${o}:`,s)}};_D.Logger=BAt;_D.logger=new BAt("default")});var uPi=I(KG=>{"use strict";p();Object.defineProperty(KG,"__esModule",{value:!0});KG.INotificationService=KG.NullNotificationService=KG.ProgressLocation=void 0;var hHa=nn(),mHa=YP(),lPi;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(lPi||(KG.ProgressLocation=lPi={}));var QSr=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")},mHa.CancellationToken.None))}};KG.NullNotificationService=QSr;KG.INotificationService=(0,hHa.createServiceIdentifier)("INotificationService")});var jSr=I(vD=>{"use strict";p();var gHa=vD&&vD.__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},AHa=vD&&vD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vD,"__esModule",{value:!0});vD.ExtensionNotificationSender=vD.ICompletionsNotificationSender=void 0;var yHa=uPi(),EHa=nn();vD.ICompletionsNotificationSender=(0,EHa.createServiceIdentifier)("ICompletionsNotificationSender");var qSr=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}}};vD.ExtensionNotificationSender=qSr;vD.ExtensionNotificationSender=qSr=gHa([AHa(0,yHa.INotificationService)],qSr)});var $Sr=I(CD=>{"use strict";p();var _Ha=CD&&CD.__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},HSr=CD&&CD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(CD,"__esModule",{value:!0});CD.UserErrorNotifier=CD.ICompletionsUserErrorNotifierService=void 0;var vHa=U4(),CHa=nn(),bHa=nd(),pPi=Dl(),SHa=jSr(),THa=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],dPi="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.",fPi="https://gh.io/copilot-network-errors";CD.ICompletionsUserErrorNotifierService=(0,CHa.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var GSr=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&&THa.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new pPi.Logger("certificates").error(this._logTarget,`${dPi} Please visit ${fPi} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(dPi,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(bHa.URI.parse(fPi))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};CD.UserErrorNotifier=GSr;CD.UserErrorNotifier=GSr=_Ha([HSr(0,pPi.ICompletionsLogTargetService),HSr(1,SHa.ICompletionsNotificationSender),HSr(2,vHa.IEnvService)],GSr)});var mh=I(cAe=>{"use strict";p();Object.defineProperty(cAe,"__esModule",{value:!0});cAe.NullExperimentationService=cAe.IExperimentationService=void 0;var IHa=nn(),xHa=Ic();cAe.IExperimentationService=(0,IHa.createServiceIdentifier)("IExperimentationService");var VSr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new xHa.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};cAe.NullExperimentationService=VSr});var JG=I(o1=>{"use strict";p();Object.defineProperty(o1,"__esModule",{value:!0});o1.DEFAULT_PROMPT_ALLOCATION_PERCENT=o1.DEFAULT_SUFFIX_MATCH_THRESHOLD=o1.DEFAULT_NUM_SNIPPETS=o1.DEFAULT_MAX_PROMPT_LENGTH=o1.DEFAULT_MAX_COMPLETION_LENGTH=void 0;o1.normalizeLanguageId=RHa;o1.DEFAULT_MAX_COMPLETION_LENGTH=500;o1.DEFAULT_MAX_PROMPT_LENGTH=8192-o1.DEFAULT_MAX_COMPLETION_LENGTH;o1.DEFAULT_NUM_SNIPPETS=4;o1.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;o1.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var wHa={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function RHa(t){return t=t.toLowerCase(),wHa[t]??t}a(RHa,"normalizeLanguageId")});var hPi=I(WSr=>{"use strict";p();Object.defineProperty(WSr,"__esModule",{value:!0});WSr.getUserKind=PHa;function kHa(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(kHa,"findKnownOrg");function PHa(t){let e=t.organizationList??[];return kHa(e)??""}a(PHa,"getUserKind")});var s4e=I(K4=>{"use strict";p();Object.defineProperty(K4,"__esModule",{value:!0});K4.IEndpointProvider=K4.ModelSupportedEndpoint=void 0;K4.isEndpointEditToolName=MHa;K4.isChatModelInformation=OHa;K4.isEmbeddingModelInformation=LHa;K4.isCompletionModelInformation=BHa;var DHa=nn(),NHa=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function MHa(t){return NHa.has(t)}a(MHa,"isEndpointEditToolName");var mPi;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(mPi||(K4.ModelSupportedEndpoint=mPi={}));function OHa(t){return t.capabilities.type==="chat"}a(OHa,"isChatModelInformation");function LHa(t){return t.capabilities.type==="embeddings"}a(LHa,"isEmbeddingModelInformation");function BHa(t){return t.capabilities.type==="completion"}a(BHa,"isCompletionModelInformation");K4.IEndpointProvider=(0,DHa.createServiceIdentifier)("IEndpointProvider")});var APi=I(zSr=>{"use strict";p();Object.defineProperty(zSr,"__esModule",{value:!0});zSr.getUserSelectedModelConfiguration=FHa;var gPi=LE();function FHa(t){let e=(0,gPi.getConfig)(t,gPi.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(FHa,"getUserSelectedModelConfiguration")});var yPi=I(Z4=>{"use strict";p();Object.defineProperty(Z4,"__esModule",{value:!0});Z4.bytePairEncode=Z4.BinaryMap=Z4.binaryMapKey=void 0;var UHa=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");Z4.binaryMapKey=UHa;var YSr=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,Z4.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,Z4.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)}}};Z4.BinaryMap=YSr;var J4=new Int32Array(128),Dv=new Int32Array(128);function QHa(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;J4.length0&&(J4[Dv[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(FAt,"__esModule",{value:!0});FAt.makeTextEncoder=void 0;var KSr=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}},JSr=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 JSr:new KSr,"makeTextEncoder");FAt.makeTextEncoder=qHa});var _Pi=I(UAt=>{"use strict";p();Object.defineProperty(UAt,"__esModule",{value:!0});UAt.LRUCache=void 0;var ZSr=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 XSr(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}};UAt.LRUCache=ZSr;var XSr=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var tTr=I(qAt=>{"use strict";p();Object.defineProperty(qAt,"__esModule",{value:!0});qAt.TikTokenizer=void 0;var QAt=yPi(),jHa=EPi(),HHa=_Pi();function GHa(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(GHa,"loadTikTokenBpe");function $Ha(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a($Ha,"escapeRegExp");var eTr=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,jHa.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new HHa.LRUCache(o);let s=typeof e=="string"?GHa(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new QAt.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=>$Ha(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,QAt.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,QAt.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 E=0;E=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 E=A[0],_=this.cache.get(E);if(_)c+=_.length,l+=E.length,o.push(..._),u.set(c,l);else{let v=this.textEncoder.encode(E),b=this.encoder.get(v);if(b!==void 0)this.cache.set(E,[b]),c++,l+=E.length,o.push(b),u.set(c,l);else{let T=(0,QAt.bytePairEncode)(v,this.encoder,this.textEncoder.length);this.cache.set(E,T),c+=T.length,l+=E.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))}};qAt.TikTokenizer=eTr});var kPi=I(Im=>{"use strict";p();Object.defineProperty(Im,"__esModule",{value:!0});Im.createTokenizer=Im.createByEncoderName=Im.createByModelName=Im.getRegexByModel=Im.getRegexByEncoder=Im.getSpecialTokensByModel=Im.getSpecialTokensByEncoder=Im.MODEL_TO_ENCODING=void 0;var VHa=tTr(),WHa=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);Im.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 jAt="<|endoftext|>",vPi="<|fim_prefix|>",CPi="<|fim_middle|>",bPi="<|fim_suffix|>",SPi="<|endofprompt|>",a4e="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",TPi="(?:'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+",zHa=[`[^\r +`:"",n.chromiumDetails?`${o}${JSON.stringify(sIi(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(oIi,"collectErrorMessages");function iPa(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(sIi(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(iPa,"collectSingleLineErrorMessage");function oPa(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(oPa,"sanitizeNetworkErrorForTelemetry");function sIi(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(sIi,"extractChromiumDetails");var ugt=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}};hy.LogMemory=ugt});var v5e=I(_5e=>{"use strict";p();Object.defineProperty(_5e,"__esModule",{value:!0});_5e.ICopilotTokenManager=void 0;_5e.nowSeconds=aPa;var sPa=nn();_5e.ICopilotTokenManager=(0,sPa.createServiceIdentifier)("ICopilotTokenManager");function aPa(){return Math.floor(Date.now()/1e3)}a(aPa,"nowSeconds")});var FE=I(vm=>{"use strict";p();var cPa=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},dgt=vm&&vm.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vm,"__esModule",{value:!0});vm.BaseAuthenticationService=vm.IAuthenticationService=vm.MinimalModeError=vm.GITHUB_SCOPE_ALIGNED=vm.GITHUB_SCOPE_READ_USER=vm.GITHUB_SCOPE_USER_EMAIL=void 0;vm.authProviderId=mPa;var lPa=nn(),fgt=Ic(),uPa=ko(),dPa=b8(),Cte=Pl(),fPa=Sp(),pPa=v5e(),hPa=eG();vm.GITHUB_SCOPE_USER_EMAIL=["user:email"];vm.GITHUB_SCOPE_READ_USER=["read:user"];vm.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var nCr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};vm.MinimalModeError=nCr;vm.IAuthenticationService=(0,lPa.createServiceIdentifier)("IAuthenticationService");var iCr=class extends uPa.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 fgt.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidCopilotTokenChange=this._register(new fgt.Emitter),this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event,this._onDidAccessTokenChange=this._register(new fgt.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new fgt.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,dPa.derived)(s=>this._configurationService.getConfigObservable(Cte.ConfigKey.Shared.AuthPermissions).read(s)===Cte.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.")}};vm.BaseAuthenticationService=iCr;vm.BaseAuthenticationService=iCr=cPa([dgt(0,fPa.ILogService),dgt(1,hPa.ICopilotTokenStore),dgt(2,pPa.ICopilotTokenManager),dgt(3,Cte.IConfigurationService)],iCr);function mPa(t){return t.getConfig(Cte.ConfigKey.Shared.AuthProvider)===Cte.AuthProviderId.GitHubEnterprise?Cte.AuthProviderId.GitHubEnterprise:Cte.AuthProviderId.GitHub}a(mPa,"authProviderId")});var pgt=I(oCr=>{"use strict";p();Object.defineProperty(oCr,"__esModule",{value:!0});oCr.onCopilotToken=gPa;function gPa(t,e){return t.onDidCopilotTokenChange(()=>{let r=t.copilotToken;r&&e(r)})}a(gPa,"onCopilotToken")});var aCr=I(dD=>{"use strict";p();var APa=dD&&dD.__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},yPa=dD&&dD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(dD,"__esModule",{value:!0});dD.TelemetryUserConfig=dD.ICompletionsTelemetryUserConfigService=void 0;var EPa=FE(),_Pa=nn(),vPa=ko(),CPa=pgt();function bPa(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(bPa,"propertiesFromCopilotToken");dD.ICompletionsTelemetryUserConfigService=(0,_Pa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var sCr=class extends vPa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,CPa.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=bPa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};dD.TelemetryUserConfig=sCr;dD.TelemetryUserConfig=sCr=APa([yPa(0,EPa.IAuthenticationService)],sCr)});var C5e=I(Lge=>{"use strict";p();Object.defineProperty(Lge,"__esModule",{value:!0});Lge.PromiseQueue=Lge.ICompletionsPromiseQueueService=void 0;var SPa=nn();Lge.ICompletionsPromiseQueueService=(0,SPa.createServiceIdentifier)("completionsPromiseQueueService");var cCr=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)}};Lge.PromiseQueue=cCr});var $g=I(yd=>{"use strict";p();Object.defineProperty(yd,"__esModule",{value:!0});yd.TelemetryReporters=yd.ICompletionsTelemetryReporters=yd.CopilotTelemetryReporter=yd.TelemetryWithExp=yd.TelemetryData=yd.TelemetryStore=void 0;yd.telemetrizePromptLength=LPa;yd.now=Fge;yd.telemetry=ACr;yd.telemetryExpProblem=UPa;yd.telemetryRaw=qPa;yd.telemetryException=lIi;yd.telemetryCatch=jPa;yd.telemetryError=HPa;yd.logEngineCompletion=$Pa;yd.logEnginePrompt=VPa;var TPa=U4(),IPa=nn(),xPa=T0(),fCr=Gs(),hgt=bte(),Q4=LE(),wPa=O0t(),RPa=fy(),kPa=B0t(),PPa=Lvr(),pCr=aCr(),hCr=C5e(),ZT;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(ZT||(yd.TelemetryStore=ZT={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(ZT||(yd.TelemetryStore=ZT={}));function Bge(t){return t===ZT.Enhanced}a(Bge,"isEnhanced");var DPa=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],b5e=8192,NPa=21,q4=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[PPa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Fge())}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=Fge())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(RPa.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(TPa.IEnvService),n=e.get(Q4.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,Q4.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,Q4.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${Q4.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,Q4.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,Q4.dumpForTelemetry)(e);r["copilot.build"]=Q4.BuildInfo.getBuild(),r["copilot.buildType"]=Q4.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(Bge(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>b5e){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+b5e;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(LPa,"telemetrizePromptLength");function Fge(){return performance.now()}a(Fge,"now");function BPa(t){return Math.floor(t/1e3)}a(BPa,"nowSeconds");function gCr(t){return t.get(pCr.ICompletionsTelemetryUserConfigService).optedIn}a(gCr,"shouldSendEnhanced");function aIi(t){return t.get(pCr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(aIi,"shouldSendFinetuningTelemetry");function ACr(t,e,r,n){return t.get(hCr.ICompletionsPromiseQueueService).register(FPa(t,e,Fge(),r?.extendedBy(),n))}a(ACr,"telemetry");async function FPa(t,e,r,n,o=ZT.Standard){let s=t.get(hgt.ICompletionsTelemetryService),c=t.get(fCr.IInstantiationService),l=n||q4.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!Bge(o)||c.invokeFunction(gCr))&&mCr(s,o,e,l),Bge(o)&&DPa.includes(e)&&c.invokeFunction(aIi)&&c.invokeFunction(OPa,o,e,l)}a(FPa,"_telemetry");function UPa(t,e){return t.get(hCr.ICompletionsPromiseQueueService).register(QPa(t,e,Fge()))}a(UPa,"telemetryExpProblem");async function QPa(t,e,r){let n=t.get(hgt.ICompletionsTelemetryService),o="expProblem",s=q4.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,ZT.Standard,"SkipExp",r),mCr(n,ZT.Standard,o,s)}a(QPa,"_telemetryExpProblem");function qPa(t,e,r,n){let o=t.get(hgt.ICompletionsTelemetryService),s={...r,...cIi(t)};mCr(o,ZT.Standard,e,{properties:s,measurements:n})}a(qPa,"telemetryRaw");function cIi(t){let e=t.get(Q4.ICompletionsEditorAndPluginInfo),r={unique_id:(0,xPa.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,Q4.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(pCr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(cIi,"createRequiredProperties");function lIi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(lIi,"telemetryException");function jPa(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){lIi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(jPa,"telemetryCatch");function HPa(t,e,r,n){return t.get(hCr.ICompletionsPromiseQueueService).register(GPa(t,e,Fge(),r?.extendedBy(),n))}a(HPa,"telemetryError");async function GPa(t,e,r,n,o=ZT.Standard){if(Bge(o)&&!gCr(t))return;let s=t.get(fCr.IInstantiationService),c=n||q4.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(MPa,o,e,c)}a(GPa,"_telemetryError");function $Pa(t,e,r,n,o){let s=q4.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),ACr(t,"engine.completion",s,ZT.Enhanced)}a($Pa,"logEngineCompletion");function VPa(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 ACr(t,"engine.prompt",o,ZT.Enhanced)}a(VPa,"logEnginePrompt");var uCr=class{static{a(this,"CopilotTelemetryReporter")}};yd.CopilotTelemetryReporter=uCr;yd.ICompletionsTelemetryReporters=(0,IPa.createServiceIdentifier)("ICompletionsTelemetryReporters");var dCr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=ZT.Standard){return Bge(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(gCr(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()))}};yd.TelemetryReporters=dCr});var bte=I(fD=>{"use strict";p();var WPa=fD&&fD.__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},zPa=fD&&fD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(fD,"__esModule",{value:!0});fD.CompletionsTelemetryServiceBridge=fD.ICompletionsTelemetryService=void 0;var YPa=gm(),yCr=xvr(),KPa=nn(),S5e=$g();fD.ICompletionsTelemetryService=(0,KPa.createServiceIdentifier)("completionsTelemetryService");var ECr=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,yCr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??S5e.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,yCr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??S5e.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,yCr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??S5e.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??S5e.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 S5e.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};fD.CompletionsTelemetryServiceBridge=ECr;fD.CompletionsTelemetryServiceBridge=ECr=WPa([zPa(0,YPa.ITelemetryService)],ECr)});var uIi=I(Uge=>{"use strict";p();Object.defineProperty(Uge,"__esModule",{value:!0});Uge.CopilotExtensionStatus=Uge.ICompletionsExtensionStatus=void 0;var JPa=nn();Uge.ICompletionsExtensionStatus=(0,JPa.createServiceIdentifier)("ICompletionsExtensionStatus");var _Cr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};Uge.CopilotExtensionStatus=_Cr});var mgt=I(pD=>{"use strict";p();Object.defineProperty(pD,"__esModule",{value:!0});pD.CopilotToken=void 0;pD.containsInternalOrg=dIi;pD.containsVSCodeOrg=hIi;pD.validateTokenEnvelope=mIi;pD.isTokenEnvelope=n2a;pD.isErrorEnvelope=i2a;pD.isStandardErrorEnvelope=o2a;pD.createTestExtendedTokenInfo=s2a;var Qn=kG();function dIi(t){return fIi(t)||pIi(t)}a(dIi,"containsInternalOrg");function fIi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(fIi,"containsGitHubOrg");function pIi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(pIi,"containsMicrosoftOrg");function hIi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(hIi,"containsVSCodeOrg");var vCr=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 dIi(this.organizationList)}get isMicrosoftInternal(){return pIi(this.organizationList)}get isGitHubInternal(){return fIi(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||hIi(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"}};pD.CopilotToken=vCr;var ZPa=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),notification_id:(0,Qn.vRequired)((0,Qn.vString)()),title:(0,Qn.vRequired)((0,Qn.vString)()),url:(0,Qn.vRequired)((0,Qn.vString)())}),XPa=(0,Qn.vObj)({can_signup_for_limited:(0,Qn.vNullable)((0,Qn.vBoolean)()),error_details:(0,Qn.vRequired)(ZPa),message:(0,Qn.vRequired)((0,Qn.vString)()),reason:(0,Qn.vString)()}),e2a=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)()),sku:(0,Qn.vString)(),individual:(0,Qn.vBoolean)(),blackbird_clientside_indexing:(0,Qn.vBoolean)(),code_quote_enabled:(0,Qn.vBoolean)(),code_review_enabled:(0,Qn.vBoolean)(),codesearch:(0,Qn.vBoolean)(),copilotignore_enabled:(0,Qn.vBoolean)(),public_suggestions:(0,Qn.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Qn.vEnum)("enabled","disabled"),endpoints:(0,Qn.vObj)({api:(0,Qn.vString)(),"origin-tracker":(0,Qn.vString)(),proxy:(0,Qn.vString)(),telemetry:(0,Qn.vString)()}),enterprise_list:(0,Qn.vNullable)((0,Qn.vArray)((0,Qn.vNumber)())),limited_user_quotas:(0,Qn.vNullable)((0,Qn.vObj)({chat:(0,Qn.vRequired)((0,Qn.vNumber)()),completions:(0,Qn.vRequired)((0,Qn.vNumber)())})),limited_user_reset_date:(0,Qn.vNullable)((0,Qn.vNumber)()),organization_list:(0,Qn.vArray)((0,Qn.vString)())}),t2a=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),documentation_url:(0,Qn.vRequired)((0,Qn.vString)()),status:(0,Qn.vRequired)((0,Qn.vString)())}),r2a=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)())});function mIi(t){let e=e2a.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=r2a.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(mIi,"validateTokenEnvelope");function n2a(t){return mIi(t).valid}a(n2a,"isTokenEnvelope");function i2a(t){return XPa.validate(t).error===void 0}a(i2a,"isErrorEnvelope");function o2a(t){return t2a.validate(t).error===void 0}a(o2a,"isStandardErrorEnvelope");function s2a(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(s2a,"createTestExtendedTokenInfo")});var Qge=I(XT=>{"use strict";p();var a2a=XT&&XT.__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},c2a=XT&&XT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(XT,"__esModule",{value:!0});XT.CopilotTokenManagerImpl=XT.ICompletionsCopilotTokenManager=XT.CopilotToken=void 0;var l2a=FE(),u2a=nn(),d2a=nl(),f2a=ko(),p2a=mgt();Object.defineProperty(XT,"CopilotToken",{enumerable:!0,get:a(function(){return p2a.CopilotToken},"get")});XT.ICompletionsCopilotTokenManager=(0,u2a.createServiceIdentifier)("ICompletionsCopilotTokenManager");var CCr=class extends f2a.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 d2a.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}};XT.CopilotTokenManagerImpl=CCr;XT.CopilotTokenManagerImpl=CCr=a2a([c2a(1,l2a.IAuthenticationService)],CCr)});var ggt=I(qge=>{"use strict";p();Object.defineProperty(qge,"__esModule",{value:!0});qge.NoOpCitationManager=qge.ICompletionsCitationManager=void 0;var h2a=nn(),m2a=ko();qge.ICompletionsCitationManager=(0,h2a.createServiceIdentifier)("ICompletionsCitationManager");var bCr=class{static{a(this,"NoOpCitationManager")}register(){return m2a.Disposable.None}async handleIPCodeCitation(e){}};qge.NoOpCitationManager=bCr});var xv=I(Wg=>{"use strict";p();Object.defineProperty(Wg,"__esModule",{value:!0});Wg.HasPropertyKey=g2a;Wg.IsAsyncIterator=A2a;Wg.IsArray=SCr;Wg.IsBigInt=y2a;Wg.IsBoolean=E2a;Wg.IsDate=_2a;Wg.IsFunction=v2a;Wg.IsIterator=C2a;Wg.IsNull=b2a;Wg.IsNumber=S2a;Wg.IsObject=TCr;Wg.IsRegExp=T2a;Wg.IsString=I2a;Wg.IsSymbol=x2a;Wg.IsUint8Array=ICr;Wg.IsUndefined=w2a;function g2a(t,e){return e in t}a(g2a,"HasPropertyKey");function A2a(t){return TCr(t)&&!SCr(t)&&!ICr(t)&&Symbol.asyncIterator in t}a(A2a,"IsAsyncIterator");function SCr(t){return Array.isArray(t)}a(SCr,"IsArray");function y2a(t){return typeof t=="bigint"}a(y2a,"IsBigInt");function E2a(t){return typeof t=="boolean"}a(E2a,"IsBoolean");function _2a(t){return t instanceof globalThis.Date}a(_2a,"IsDate");function v2a(t){return typeof t=="function"}a(v2a,"IsFunction");function C2a(t){return TCr(t)&&!SCr(t)&&!ICr(t)&&Symbol.iterator in t}a(C2a,"IsIterator");function b2a(t){return t===null}a(b2a,"IsNull");function S2a(t){return typeof t=="number"}a(S2a,"IsNumber");function TCr(t){return typeof t=="object"&&t!==null}a(TCr,"IsObject");function T2a(t){return t instanceof globalThis.RegExp}a(T2a,"IsRegExp");function I2a(t){return typeof t=="string"}a(I2a,"IsString");function x2a(t){return typeof t=="symbol"}a(x2a,"IsSymbol");function ICr(t){return t instanceof globalThis.Uint8Array}a(ICr,"IsUint8Array");function w2a(t){return t===void 0}a(w2a,"IsUndefined")});var Yb=I(e6=>{"use strict";p();var R2a=e6&&e6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),k2a=e6&&e6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),P2a=e6&&e6.__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;oAgt(e))}a(D2a,"ArrayType");function N2a(t){return new Date(t.getTime())}a(N2a,"DateType");function M2a(t){return new Uint8Array(t)}a(M2a,"Uint8ArrayType");function O2a(t){return new RegExp(t.source,t.flags)}a(O2a,"RegExpType");function L2a(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Agt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Agt(t[r]);return e}a(L2a,"ObjectType");function Agt(t){return T5e.IsArray(t)?D2a(t):T5e.IsDate(t)?N2a(t):T5e.IsUint8Array(t)?M2a(t):T5e.IsRegExp(t)?O2a(t):T5e.IsObject(t)?L2a(t):t}a(Agt,"Visit");function B2a(t){return Agt(t)}a(B2a,"Clone")});var Egt=I(ygt=>{"use strict";p();Object.defineProperty(ygt,"__esModule",{value:!0});ygt.CloneRest=F2a;ygt.CloneType=AIi;var gIi=Yb();function F2a(t){return t.map(e=>AIi(e))}a(F2a,"CloneRest");function AIi(t,e){return e===void 0?(0,gIi.Clone)(t):(0,gIi.Clone)({...e,...t})}a(AIi,"CloneType")});var xCr=I(OG=>{"use strict";p();var U2a=OG&&OG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yIi=OG&&OG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&U2a(e,t,r)};Object.defineProperty(OG,"__esModule",{value:!0});yIi(Egt(),OG);yIi(Yb(),OG)});var _gt=I(Aa=>{"use strict";p();Object.defineProperty(Aa,"__esModule",{value:!0});Aa.IsAsyncIterator=Q2a;Aa.IsIterator=q2a;Aa.IsStandardObject=j2a;Aa.IsInstanceObject=H2a;Aa.IsPromise=G2a;Aa.IsDate=$2a;Aa.IsMap=V2a;Aa.IsSet=W2a;Aa.IsRegExp=z2a;Aa.IsTypedArray=Y2a;Aa.IsInt8Array=K2a;Aa.IsUint8Array=J2a;Aa.IsUint8ClampedArray=Z2a;Aa.IsInt16Array=X2a;Aa.IsUint16Array=eDa;Aa.IsInt32Array=tDa;Aa.IsUint32Array=rDa;Aa.IsFloat32Array=nDa;Aa.IsFloat64Array=iDa;Aa.IsBigInt64Array=oDa;Aa.IsBigUint64Array=sDa;Aa.HasPropertyKey=aDa;Aa.IsObject=I5e;Aa.IsArray=EIi;Aa.IsUndefined=_Ii;Aa.IsNull=vIi;Aa.IsBoolean=CIi;Aa.IsNumber=bIi;Aa.IsInteger=cDa;Aa.IsBigInt=SIi;Aa.IsString=TIi;Aa.IsFunction=IIi;Aa.IsSymbol=xIi;Aa.IsValueType=lDa;function Q2a(t){return I5e(t)&&globalThis.Symbol.asyncIterator in t}a(Q2a,"IsAsyncIterator");function q2a(t){return I5e(t)&&globalThis.Symbol.iterator in t}a(q2a,"IsIterator");function j2a(t){return I5e(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(j2a,"IsStandardObject");function H2a(t){return I5e(t)&&!EIi(t)&&IIi(t.constructor)&&t.constructor.name!=="Object"}a(H2a,"IsInstanceObject");function G2a(t){return t instanceof globalThis.Promise}a(G2a,"IsPromise");function $2a(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a($2a,"IsDate");function V2a(t){return t instanceof globalThis.Map}a(V2a,"IsMap");function W2a(t){return t instanceof globalThis.Set}a(W2a,"IsSet");function z2a(t){return t instanceof globalThis.RegExp}a(z2a,"IsRegExp");function Y2a(t){return globalThis.ArrayBuffer.isView(t)}a(Y2a,"IsTypedArray");function K2a(t){return t instanceof globalThis.Int8Array}a(K2a,"IsInt8Array");function J2a(t){return t instanceof globalThis.Uint8Array}a(J2a,"IsUint8Array");function Z2a(t){return t instanceof globalThis.Uint8ClampedArray}a(Z2a,"IsUint8ClampedArray");function X2a(t){return t instanceof globalThis.Int16Array}a(X2a,"IsInt16Array");function eDa(t){return t instanceof globalThis.Uint16Array}a(eDa,"IsUint16Array");function tDa(t){return t instanceof globalThis.Int32Array}a(tDa,"IsInt32Array");function rDa(t){return t instanceof globalThis.Uint32Array}a(rDa,"IsUint32Array");function nDa(t){return t instanceof globalThis.Float32Array}a(nDa,"IsFloat32Array");function iDa(t){return t instanceof globalThis.Float64Array}a(iDa,"IsFloat64Array");function oDa(t){return t instanceof globalThis.BigInt64Array}a(oDa,"IsBigInt64Array");function sDa(t){return t instanceof globalThis.BigUint64Array}a(sDa,"IsBigUint64Array");function aDa(t,e){return e in t}a(aDa,"HasPropertyKey");function I5e(t){return t!==null&&typeof t=="object"}a(I5e,"IsObject");function EIi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(EIi,"IsArray");function _Ii(t){return t===void 0}a(_Ii,"IsUndefined");function vIi(t){return t===null}a(vIi,"IsNull");function CIi(t){return typeof t=="boolean"}a(CIi,"IsBoolean");function bIi(t){return typeof t=="number"}a(bIi,"IsNumber");function cDa(t){return globalThis.Number.isInteger(t)}a(cDa,"IsInteger");function SIi(t){return typeof t=="bigint"}a(SIi,"IsBigInt");function TIi(t){return typeof t=="string"}a(TIi,"IsString");function IIi(t){return typeof t=="function"}a(IIi,"IsFunction");function xIi(t){return typeof t=="symbol"}a(xIi,"IsSymbol");function lDa(t){return SIi(t)||CIi(t)||vIi(t)||bIi(t)||TIi(t)||xIi(t)||_Ii(t)}a(lDa,"IsValueType")});var R0=I(Ste=>{"use strict";p();var uDa=Ste&&Ste.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Ste&&Ste.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uDa(e,t,r)};Object.defineProperty(Ste,"__esModule",{value:!0});dDa(_gt(),Ste)});var x5e=I(Cgt=>{"use strict";p();Object.defineProperty(Cgt,"__esModule",{value:!0});Cgt.TypeSystemPolicy=void 0;var vgt=R0(),wIi;(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,vgt.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,vgt.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,vgt.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,vgt.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(wIi||(Cgt.TypeSystemPolicy=wIi={}))});var RIi=I(t6=>{"use strict";p();var fDa=t6&&t6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=t6&&t6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hDa=t6&&t6.__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;obgt(e))}a(mDa,"ImmutableArray");function gDa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=bgt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=bgt(t[r]);return globalThis.Object.freeze(e)}a(gDa,"ImmutableObject");function bgt(t){return w5e.IsArray(t)?mDa(t):w5e.IsDate(t)?t:w5e.IsUint8Array(t)?t:w5e.IsRegExp(t)?t:w5e.IsObject(t)?gDa(t):t}a(bgt,"Immutable")});var Ii=I(wCr=>{"use strict";p();Object.defineProperty(wCr,"__esModule",{value:!0});wCr.CreateType=_Da;var ADa=x5e(),yDa=RIi(),EDa=Yb();function _Da(t,e){let r=e!==void 0?{...e,...t}:t;switch(ADa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,yDa.Immutable)(r);case"clone":return(0,EDa.Clone)(r);default:return r}}a(_Da,"CreateType")});var r6=I(Tte=>{"use strict";p();var vDa=Tte&&Tte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CDa=Tte&&Tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vDa(e,t,r)};Object.defineProperty(Tte,"__esModule",{value:!0});CDa(Ii(),Tte)});var kCr=I(Sgt=>{"use strict";p();Object.defineProperty(Sgt,"__esModule",{value:!0});Sgt.TypeBoxError=void 0;var RCr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};Sgt.TypeBoxError=RCr});var Nf=I(Ite=>{"use strict";p();var bDa=Ite&&Ite.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SDa=Ite&&Ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bDa(e,t,r)};Object.defineProperty(Ite,"__esModule",{value:!0});SDa(kCr(),Ite)});var R5e=I(xR=>{"use strict";p();Object.defineProperty(xR,"__esModule",{value:!0});xR.Kind=xR.Hint=xR.OptionalKind=xR.ReadonlyKind=xR.TransformKind=void 0;xR.TransformKind=Symbol.for("TypeBox.Transform");xR.ReadonlyKind=Symbol.for("TypeBox.Readonly");xR.OptionalKind=Symbol.for("TypeBox.Optional");xR.Hint=Symbol.for("TypeBox.Hint");xR.Kind=Symbol.for("TypeBox.Kind")});var Sn=I(xte=>{"use strict";p();var TDa=xte&&xte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),IDa=xte&&xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TDa(e,t,r)};Object.defineProperty(xte,"__esModule",{value:!0});IDa(R5e(),xte)});var vs=I(ui=>{"use strict";p();var xDa=ui&&ui.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wDa=ui&&ui.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),RDa=ui&&ui.__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 qDa=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]})),jDa=Kn&&Kn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HDa=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;o=7&&r<=13||r===27||r===127)return!1}return!0}a(DCr,"IsControlCharacterFree");function pxi(t){return NCr(t)||zg(t)}a(pxi,"IsAdditionalProperties");function P5e(t){return si.IsUndefined(t)||si.IsBigInt(t)}a(P5e,"IsOptionalBigInt");function Zl(t){return si.IsUndefined(t)||si.IsNumber(t)}a(Zl,"IsOptionalNumber");function NCr(t){return si.IsUndefined(t)||si.IsBoolean(t)}a(NCr,"IsOptionalBoolean");function pl(t){return si.IsUndefined(t)||si.IsString(t)}a(pl,"IsOptionalString");function VDa(t){return si.IsUndefined(t)||si.IsString(t)&&DCr(t)&&fxi(t)}a(VDa,"IsOptionalPattern");function WDa(t){return si.IsUndefined(t)||si.IsString(t)&&DCr(t)}a(WDa,"IsOptionalFormat");function hxi(t){return si.IsUndefined(t)||zg(t)}a(hxi,"IsOptionalSchema");function zDa(t){return si.IsObject(t)&&t[j4.ReadonlyKind]==="Readonly"}a(zDa,"IsReadonly");function YDa(t){return si.IsObject(t)&&t[j4.OptionalKind]==="Optional"}a(YDa,"IsOptional");function mxi(t){return Vs(t,"Any")&&pl(t.$id)}a(mxi,"IsAny");function gxi(t){return Vs(t,"Argument")&&si.IsNumber(t.index)}a(gxi,"IsArgument");function Axi(t){return Vs(t,"Array")&&t.type==="array"&&pl(t.$id)&&zg(t.items)&&Zl(t.minItems)&&Zl(t.maxItems)&&NCr(t.uniqueItems)&&hxi(t.contains)&&Zl(t.minContains)&&Zl(t.maxContains)}a(Axi,"IsArray");function yxi(t){return Vs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&pl(t.$id)&&zg(t.items)}a(yxi,"IsAsyncIterator");function Exi(t){return Vs(t,"BigInt")&&t.type==="bigint"&&pl(t.$id)&&P5e(t.exclusiveMaximum)&&P5e(t.exclusiveMinimum)&&P5e(t.maximum)&&P5e(t.minimum)&&P5e(t.multipleOf)}a(Exi,"IsBigInt");function _xi(t){return Vs(t,"Boolean")&&t.type==="boolean"&&pl(t.$id)}a(_xi,"IsBoolean");function vxi(t){return Vs(t,"Computed")&&si.IsString(t.target)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))}a(vxi,"IsComputed");function Cxi(t){return Vs(t,"Constructor")&&t.type==="Constructor"&&pl(t.$id)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))&&zg(t.returns)}a(Cxi,"IsConstructor");function bxi(t){return Vs(t,"Date")&&t.type==="Date"&&pl(t.$id)&&Zl(t.exclusiveMaximumTimestamp)&&Zl(t.exclusiveMinimumTimestamp)&&Zl(t.maximumTimestamp)&&Zl(t.minimumTimestamp)&&Zl(t.multipleOfTimestamp)}a(bxi,"IsDate");function Sxi(t){return Vs(t,"Function")&&t.type==="Function"&&pl(t.$id)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))&&zg(t.returns)}a(Sxi,"IsFunction");function KDa(t){return Vs(t,"Import")&&si.HasPropertyKey(t,"$defs")&&si.IsObject(t.$defs)&&Tgt(t.$defs)&&si.HasPropertyKey(t,"$ref")&&si.IsString(t.$ref)&&t.$ref in t.$defs}a(KDa,"IsImport");function Txi(t){return Vs(t,"Integer")&&t.type==="integer"&&pl(t.$id)&&Zl(t.exclusiveMaximum)&&Zl(t.exclusiveMinimum)&&Zl(t.maximum)&&Zl(t.minimum)&&Zl(t.multipleOf)}a(Txi,"IsInteger");function Tgt(t){return si.IsObject(t)&&Object.entries(t).every(([e,r])=>DCr(e)&&zg(r))}a(Tgt,"IsProperties");function Ixi(t){return Vs(t,"Intersect")&&!(si.IsString(t.type)&&t.type!=="object")&&si.IsArray(t.allOf)&&t.allOf.every(e=>zg(e)&&!Vxi(e))&&pl(t.type)&&(NCr(t.unevaluatedProperties)||hxi(t.unevaluatedProperties))&&pl(t.$id)}a(Ixi,"IsIntersect");function xxi(t){return Vs(t,"Iterator")&&t.type==="Iterator"&&pl(t.$id)&&zg(t.items)}a(xxi,"IsIterator");function Vs(t,e){return si.IsObject(t)&&j4.Kind in t&&t[j4.Kind]===e}a(Vs,"IsKindOf");function wxi(t){return D5e(t)&&si.IsString(t.const)}a(wxi,"IsLiteralString");function Rxi(t){return D5e(t)&&si.IsNumber(t.const)}a(Rxi,"IsLiteralNumber");function JDa(t){return D5e(t)&&si.IsBoolean(t.const)}a(JDa,"IsLiteralBoolean");function D5e(t){return Vs(t,"Literal")&&pl(t.$id)&&kxi(t.const)}a(D5e,"IsLiteral");function kxi(t){return si.IsBoolean(t)||si.IsNumber(t)||si.IsString(t)}a(kxi,"IsLiteralValue");function Pxi(t){return Vs(t,"MappedKey")&&si.IsArray(t.keys)&&t.keys.every(e=>si.IsNumber(e)||si.IsString(e))}a(Pxi,"IsMappedKey");function Dxi(t){return Vs(t,"MappedResult")&&Tgt(t.properties)}a(Dxi,"IsMappedResult");function Nxi(t){return Vs(t,"Never")&&si.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(Nxi,"IsNever");function Mxi(t){return Vs(t,"Not")&&zg(t.not)}a(Mxi,"IsNot");function Oxi(t){return Vs(t,"Null")&&t.type==="null"&&pl(t.$id)}a(Oxi,"IsNull");function Lxi(t){return Vs(t,"Number")&&t.type==="number"&&pl(t.$id)&&Zl(t.exclusiveMaximum)&&Zl(t.exclusiveMinimum)&&Zl(t.maximum)&&Zl(t.minimum)&&Zl(t.multipleOf)}a(Lxi,"IsNumber");function Bxi(t){return Vs(t,"Object")&&t.type==="object"&&pl(t.$id)&&Tgt(t.properties)&&pxi(t.additionalProperties)&&Zl(t.minProperties)&&Zl(t.maxProperties)}a(Bxi,"IsObject");function Fxi(t){return Vs(t,"Promise")&&t.type==="Promise"&&pl(t.$id)&&zg(t.item)}a(Fxi,"IsPromise");function Uxi(t){return Vs(t,"Record")&&t.type==="object"&&pl(t.$id)&&pxi(t.additionalProperties)&&si.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&fxi(r[0])&&si.IsObject(e.patternProperties)&&zg(e.patternProperties[r[0]])})(t)}a(Uxi,"IsRecord");function ZDa(t){return si.IsObject(t)&&j4.Hint in t&&t[j4.Hint]==="Recursive"}a(ZDa,"IsRecursive");function Qxi(t){return Vs(t,"Ref")&&pl(t.$id)&&si.IsString(t.$ref)}a(Qxi,"IsRef");function qxi(t){return Vs(t,"RegExp")&&pl(t.$id)&&si.IsString(t.source)&&si.IsString(t.flags)&&Zl(t.maxLength)&&Zl(t.minLength)}a(qxi,"IsRegExp");function jxi(t){return Vs(t,"String")&&t.type==="string"&&pl(t.$id)&&Zl(t.minLength)&&Zl(t.maxLength)&&VDa(t.pattern)&&WDa(t.format)}a(jxi,"IsString");function Hxi(t){return Vs(t,"Symbol")&&t.type==="symbol"&&pl(t.$id)}a(Hxi,"IsSymbol");function Gxi(t){return Vs(t,"TemplateLiteral")&&t.type==="string"&&si.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(Gxi,"IsTemplateLiteral");function $xi(t){return Vs(t,"This")&&pl(t.$id)&&si.IsString(t.$ref)}a($xi,"IsThis");function Vxi(t){return si.IsObject(t)&&j4.TransformKind in t}a(Vxi,"IsTransform");function Wxi(t){return Vs(t,"Tuple")&&t.type==="array"&&pl(t.$id)&&si.IsNumber(t.minItems)&&si.IsNumber(t.maxItems)&&t.minItems===t.maxItems&&(si.IsUndefined(t.items)&&si.IsUndefined(t.additionalItems)&&t.minItems===0||si.IsArray(t.items)&&t.items.every(e=>zg(e)))}a(Wxi,"IsTuple");function zxi(t){return Vs(t,"Undefined")&&t.type==="undefined"&&pl(t.$id)}a(zxi,"IsUndefined");function XDa(t){return MCr(t)&&t.anyOf.every(e=>wxi(e)||Rxi(e))}a(XDa,"IsUnionLiteral");function MCr(t){return Vs(t,"Union")&&pl(t.$id)&&si.IsObject(t)&&si.IsArray(t.anyOf)&&t.anyOf.every(e=>zg(e))}a(MCr,"IsUnion");function Yxi(t){return Vs(t,"Uint8Array")&&t.type==="Uint8Array"&&pl(t.$id)&&Zl(t.minByteLength)&&Zl(t.maxByteLength)}a(Yxi,"IsUint8Array");function Kxi(t){return Vs(t,"Unknown")&&pl(t.$id)}a(Kxi,"IsUnknown");function Jxi(t){return Vs(t,"Unsafe")}a(Jxi,"IsUnsafe");function Zxi(t){return Vs(t,"Void")&&t.type==="void"&&pl(t.$id)}a(Zxi,"IsVoid");function Xxi(t){return si.IsObject(t)&&j4.Kind in t&&si.IsString(t[j4.Kind])&&!$Da.includes(t[j4.Kind])}a(Xxi,"IsKind");function zg(t){return si.IsObject(t)&&(mxi(t)||gxi(t)||Axi(t)||_xi(t)||Exi(t)||yxi(t)||vxi(t)||Cxi(t)||bxi(t)||Sxi(t)||Txi(t)||Ixi(t)||xxi(t)||D5e(t)||Pxi(t)||Dxi(t)||Nxi(t)||Mxi(t)||Oxi(t)||Lxi(t)||Bxi(t)||Fxi(t)||Uxi(t)||Qxi(t)||qxi(t)||jxi(t)||Hxi(t)||Gxi(t)||$xi(t)||Wxi(t)||zxi(t)||MCr(t)||Yxi(t)||Kxi(t)||Jxi(t)||Zxi(t)||Xxi(t))}a(zg,"IsSchema")});var LCr=I(Jb=>{"use strict";p();var eNa=Jb&&Jb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tNa=Jb&&Jb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),OCr=Jb&&Jb.__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(BCr,"__esModule",{value:!0});BCr.Increment=rNa;function rNa(t){return(parseInt(t)+1).toString()}a(rNa,"Increment")});var rwi=I(wte=>{"use strict";p();var nNa=wte&&wte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),iNa=wte&&wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nNa(e,t,r)};Object.defineProperty(wte,"__esModule",{value:!0});iNa(twi(),wte)});var nwi=I(Tp=>{"use strict";p();Object.defineProperty(Tp,"__esModule",{value:!0});Tp.PatternNeverExact=Tp.PatternStringExact=Tp.PatternNumberExact=Tp.PatternBooleanExact=Tp.PatternNever=Tp.PatternString=Tp.PatternNumber=Tp.PatternBoolean=void 0;Tp.PatternBoolean="(true|false)";Tp.PatternNumber="(0|[1-9][0-9]*)";Tp.PatternString="(.*)";Tp.PatternNever="(?!.*)";Tp.PatternBooleanExact=`^${Tp.PatternBoolean}$`;Tp.PatternNumberExact=`^${Tp.PatternNumber}$`;Tp.PatternStringExact=`^${Tp.PatternString}$`;Tp.PatternNeverExact=`^${Tp.PatternNever}$`});var N5e=I(Rte=>{"use strict";p();var oNa=Rte&&Rte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sNa=Rte&&Rte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oNa(e,t,r)};Object.defineProperty(Rte,"__esModule",{value:!0});sNa(nwi(),Rte)});var iwi=I(LG=>{"use strict";p();Object.defineProperty(LG,"__esModule",{value:!0});LG.Entries=aNa;LG.Clear=cNa;LG.Delete=lNa;LG.Has=uNa;LG.Set=dNa;LG.Get=fNa;var jge=new Map;function aNa(){return new Map(jge)}a(aNa,"Entries");function cNa(){return jge.clear()}a(cNa,"Clear");function lNa(t){return jge.delete(t)}a(lNa,"Delete");function uNa(t){return jge.has(t)}a(uNa,"Has");function dNa(t,e){jge.set(t,e)}a(dNa,"Set");function fNa(t){return jge.get(t)}a(fNa,"Get")});var owi=I(BG=>{"use strict";p();Object.defineProperty(BG,"__esModule",{value:!0});BG.Entries=pNa;BG.Clear=hNa;BG.Delete=mNa;BG.Has=gNa;BG.Set=ANa;BG.Get=yNa;var Hge=new Map;function pNa(){return new Map(Hge)}a(pNa,"Entries");function hNa(){return Hge.clear()}a(hNa,"Clear");function mNa(t){return Hge.delete(t)}a(mNa,"Delete");function gNa(t){return Hge.has(t)}a(gNa,"Has");function ANa(t,e){Hge.set(t,e)}a(ANa,"Set");function yNa(t){return Hge.get(t)}a(yNa,"Get")});var Gge=I(wR=>{"use strict";p();var ENa=wR&&wR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Na=wR&&wR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),swi=wR&&wR.__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(H4,"__esModule",{value:!0});H4.SetIncludes=awi;H4.SetIsSubset=vNa;H4.SetDistinct=CNa;H4.SetIntersect=cwi;H4.SetUnion=bNa;H4.SetComplement=SNa;H4.SetIntersectMany=INa;H4.SetUnionMany=xNa;function awi(t,e){return t.includes(e)}a(awi,"SetIncludes");function vNa(t,e){return t.every(r=>awi(e,r))}a(vNa,"SetIsSubset");function CNa(t){return[...new Set(t)]}a(CNa,"SetDistinct");function cwi(t,e){return t.filter(r=>e.includes(r))}a(cwi,"SetIntersect");function bNa(t,e){return[...t,...e]}a(bNa,"SetUnion");function SNa(t,e){return t.filter(r=>!e.includes(r))}a(SNa,"SetComplement");function TNa(t,e){return t.reduce((r,n)=>cwi(r,n),e)}a(TNa,"SetIntersectManyResolve");function INa(t){return t.length===1?t[0]:t.length>1?TNa(t.slice(1),t[0]):[]}a(INa,"SetIntersectMany");function xNa(t){let e=[];for(let r of t)e.push(...r);return e}a(xNa,"SetUnionMany")});var M5e=I(kte=>{"use strict";p();var wNa=kte&&kte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RNa=kte&&kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wNa(e,t,r)};Object.defineProperty(kte,"__esModule",{value:!0});RNa(lwi(),kte)});var uwi=I(FCr=>{"use strict";p();Object.defineProperty(FCr,"__esModule",{value:!0});FCr.Any=DNa;var kNa=r6(),PNa=Sn();function DNa(t){return(0,kNa.CreateType)({[PNa.Kind]:"Any"},t)}a(DNa,"Any")});var $ge=I(Pte=>{"use strict";p();var NNa=Pte&&Pte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MNa=Pte&&Pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NNa(e,t,r)};Object.defineProperty(Pte,"__esModule",{value:!0});MNa(uwi(),Pte)});var dwi=I(UCr=>{"use strict";p();Object.defineProperty(UCr,"__esModule",{value:!0});UCr.Array=BNa;var ONa=Ii(),LNa=Sn();function BNa(t,e){return(0,ONa.CreateType)({[LNa.Kind]:"Array",type:"array",items:t},e)}a(BNa,"Array")});var Vge=I(Dte=>{"use strict";p();var FNa=Dte&&Dte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UNa=Dte&&Dte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&FNa(e,t,r)};Object.defineProperty(Dte,"__esModule",{value:!0});UNa(dwi(),Dte)});var fwi=I(QCr=>{"use strict";p();Object.defineProperty(QCr,"__esModule",{value:!0});QCr.Argument=jNa;var QNa=Ii(),qNa=Sn();function jNa(t){return(0,QNa.CreateType)({[qNa.Kind]:"Argument",index:t})}a(jNa,"Argument")});var Igt=I(Nte=>{"use strict";p();var HNa=Nte&&Nte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),GNa=Nte&&Nte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&HNa(e,t,r)};Object.defineProperty(Nte,"__esModule",{value:!0});GNa(fwi(),Nte)});var pwi=I(qCr=>{"use strict";p();Object.defineProperty(qCr,"__esModule",{value:!0});qCr.AsyncIterator=WNa;var $Na=Sn(),VNa=Ii();function WNa(t,e){return(0,VNa.CreateType)({[$Na.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(WNa,"AsyncIterator")});var Wge=I(Mte=>{"use strict";p();var zNa=Mte&&Mte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YNa=Mte&&Mte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zNa(e,t,r)};Object.defineProperty(Mte,"__esModule",{value:!0});YNa(pwi(),Mte)});var hwi=I(jCr=>{"use strict";p();Object.defineProperty(jCr,"__esModule",{value:!0});jCr.Computed=ZNa;var KNa=r6(),JNa=R5e();function ZNa(t,e,r){return(0,KNa.CreateType)({[JNa.Kind]:"Computed",target:t,parameters:e},r)}a(ZNa,"Computed")});var FG=I(Ote=>{"use strict";p();var XNa=Ote&&Ote.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eMa=Ote&&Ote.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XNa(e,t,r)};Object.defineProperty(Ote,"__esModule",{value:!0});eMa(hwi(),Ote)});var xgt=I(HCr=>{"use strict";p();Object.defineProperty(HCr,"__esModule",{value:!0});HCr.Discard=rMa;function tMa(t,e){let{[e]:r,...n}=t;return n}a(tMa,"DiscardKey");function rMa(t,e){return e.reduce((r,n)=>tMa(r,n),t)}a(rMa,"Discard")});var i6=I(Lte=>{"use strict";p();var nMa=Lte&&Lte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),iMa=Lte&&Lte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nMa(e,t,r)};Object.defineProperty(Lte,"__esModule",{value:!0});iMa(xgt(),Lte)});var mwi=I(GCr=>{"use strict";p();Object.defineProperty(GCr,"__esModule",{value:!0});GCr.Never=aMa;var oMa=Ii(),sMa=Sn();function aMa(t){return(0,oMa.CreateType)({[sMa.Kind]:"Never",not:{}},t)}a(aMa,"Never")});var Cm=I(Bte=>{"use strict";p();var cMa=Bte&&Bte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lMa=Bte&&Bte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cMa(e,t,r)};Object.defineProperty(Bte,"__esModule",{value:!0});lMa(mwi(),Bte)});var gwi=I($Cr=>{"use strict";p();Object.defineProperty($Cr,"__esModule",{value:!0});$Cr.MappedKey=fMa;var uMa=Ii(),dMa=Sn();function fMa(t){return(0,uMa.CreateType)({[dMa.Kind]:"MappedKey",keys:t})}a(fMa,"MappedKey")});var WCr=I(VCr=>{"use strict";p();Object.defineProperty(VCr,"__esModule",{value:!0});VCr.MappedResult=mMa;var pMa=Ii(),hMa=Sn();function mMa(t){return(0,pMa.CreateType)({[hMa.Kind]:"MappedResult",properties:t})}a(mMa,"MappedResult")});var Awi=I(zCr=>{"use strict";p();Object.defineProperty(zCr,"__esModule",{value:!0});zCr.Constructor=yMa;var gMa=Ii(),AMa=Sn();function yMa(t,e,r){return(0,gMa.CreateType)({[AMa.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(yMa,"Constructor")});var zge=I(Fte=>{"use strict";p();var EMa=Fte&&Fte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Ma=Fte&&Fte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EMa(e,t,r)};Object.defineProperty(Fte,"__esModule",{value:!0});_Ma(Awi(),Fte)});var ywi=I(YCr=>{"use strict";p();Object.defineProperty(YCr,"__esModule",{value:!0});YCr.Function=bMa;var vMa=Ii(),CMa=Sn();function bMa(t,e,r){return(0,vMa.CreateType)({[CMa.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(bMa,"Function")});var UG=I(Ute=>{"use strict";p();var SMa=Ute&&Ute.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TMa=Ute&&Ute.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&SMa(e,t,r)};Object.defineProperty(Ute,"__esModule",{value:!0});TMa(ywi(),Ute)});var JCr=I(KCr=>{"use strict";p();Object.defineProperty(KCr,"__esModule",{value:!0});KCr.UnionCreate=wMa;var IMa=Ii(),xMa=Sn();function wMa(t,e){return(0,IMa.CreateType)({[xMa.Kind]:"Union",anyOf:t},e)}a(wMa,"UnionCreate")});var Cwi=I(ZCr=>{"use strict";p();Object.defineProperty(ZCr,"__esModule",{value:!0});ZCr.UnionEvaluated=BMa;var RMa=Ii(),kMa=Sn(),PMa=i6(),DMa=Cm(),NMa=G4(),Ewi=JCr(),vwi=vs();function MMa(t){return t.some(e=>(0,vwi.IsOptional)(e))}a(MMa,"IsUnionOptional");function _wi(t){return t.map(e=>(0,vwi.IsOptional)(e)?OMa(e):e)}a(_wi,"RemoveOptionalFromRest");function OMa(t){return(0,PMa.Discard)(t,[kMa.OptionalKind])}a(OMa,"RemoveOptionalFromType");function LMa(t,e){return MMa(t)?(0,NMa.Optional)((0,Ewi.UnionCreate)(_wi(t),e)):(0,Ewi.UnionCreate)(_wi(t),e)}a(LMa,"ResolveUnion");function BMa(t,e){return t.length===1?(0,RMa.CreateType)(t[0],e):t.length===0?(0,DMa.Never)(e):LMa(t,e)}a(BMa,"UnionEvaluated")});var Swi=I(bwi=>{"use strict";p();Object.defineProperty(bwi,"__esModule",{value:!0});var aTp=Sn()});var Twi=I(XCr=>{"use strict";p();Object.defineProperty(XCr,"__esModule",{value:!0});XCr.Union=qMa;var FMa=Cm(),UMa=Ii(),QMa=JCr();function qMa(t,e){return t.length===0?(0,FMa.Never)(e):t.length===1?(0,UMa.CreateType)(t[0],e):(0,QMa.UnionCreate)(t,e)}a(qMa,"Union")});var Ip=I(o6=>{"use strict";p();var jMa=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]})),ebr=o6&&o6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jMa(e,t,r)};Object.defineProperty(o6,"__esModule",{value:!0});ebr(Cwi(),o6);ebr(Swi(),o6);ebr(Twi(),o6)});var wgt=I(Yge=>{"use strict";p();Object.defineProperty(Yge,"__esModule",{value:!0});Yge.TemplateLiteralParserError=void 0;Yge.TemplateLiteralParse=Qte;Yge.TemplateLiteralParseExact=JMa;var HMa=Nf(),O5e=class extends HMa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};Yge.TemplateLiteralParserError=O5e;function GMa(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(GMa,"Unescape");function tbr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(tbr,"IsNonEscaped");function s6(t,e){return tbr(t,e,"(")}a(s6,"IsOpenParen");function L5e(t,e){return tbr(t,e,")")}a(L5e,"IsCloseParen");function Iwi(t,e){return tbr(t,e,"|")}a(Iwi,"IsSeparator");function $Ma(t){if(!(s6(t,0)&&L5e(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Qte(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Qte(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(YMa,"Or");function KMa(t){function e(o,s){if(!s6(o,s))throw new O5e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Qte(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(KMa,"And");function Qte(t){return $Ma(t)?Qte(VMa(t)):WMa(t)?YMa(t):zMa(t)?KMa(t):{type:"const",const:GMa(t)}}a(Qte,"TemplateLiteralParse");function JMa(t){return Qte(t.slice(1,t.length-1))}a(JMa,"TemplateLiteralParseExact")});var rbr=I(Kge=>{"use strict";p();Object.defineProperty(Kge,"__esModule",{value:!0});Kge.TemplateLiteralFiniteError=void 0;Kge.IsTemplateLiteralExpressionFinite=kgt;Kge.IsTemplateLiteralFinite=nOa;var ZMa=wgt(),XMa=Nf(),Rgt=class extends XMa.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};Kge.TemplateLiteralFiniteError=Rgt;function eOa(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(eOa,"IsNumberExpression");function tOa(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(tOa,"IsBooleanExpression");function rOa(t){return t.type==="const"&&t.const===".*"}a(rOa,"IsStringExpression");function kgt(t){return eOa(t)||rOa(t)?!1:tOa(t)?!0:t.type==="and"?t.expr.every(e=>kgt(e)):t.type==="or"?t.expr.every(e=>kgt(e)):t.type==="const"?!0:(()=>{throw new Rgt("Unknown expression type")})()}a(kgt,"IsTemplateLiteralExpressionFinite");function nOa(t){let e=(0,ZMa.TemplateLiteralParseExact)(t.pattern);return kgt(e)}a(nOa,"IsTemplateLiteralFinite")});var nbr=I(Jge=>{"use strict";p();Object.defineProperty(Jge,"__esModule",{value:!0});Jge.TemplateLiteralGenerateError=void 0;Jge.TemplateLiteralExpressionGenerate=Dgt;Jge.TemplateLiteralGenerate=uOa;var iOa=rbr(),oOa=wgt(),sOa=Nf(),Pgt=class extends sOa.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};Jge.TemplateLiteralGenerateError=Pgt;function*xwi(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of xwi(t.slice(1)))yield`${e}${r}`}a(xwi,"GenerateReduce");function*aOa(t){return yield*xwi(t.expr.map(e=>[...Dgt(e)]))}a(aOa,"GenerateAnd");function*cOa(t){for(let e of t.expr)yield*Dgt(e)}a(cOa,"GenerateOr");function*lOa(t){return yield t.const}a(lOa,"GenerateConst");function*Dgt(t){return t.type==="and"?yield*aOa(t):t.type==="or"?yield*cOa(t):t.type==="const"?yield*lOa(t):(()=>{throw new Pgt("Unknown expression")})()}a(Dgt,"TemplateLiteralExpressionGenerate");function uOa(t){let e=(0,oOa.TemplateLiteralParseExact)(t.pattern);return(0,iOa.IsTemplateLiteralExpressionFinite)(e)?[...Dgt(e)]:[]}a(uOa,"TemplateLiteralGenerate")});var wwi=I(ibr=>{"use strict";p();Object.defineProperty(ibr,"__esModule",{value:!0});ibr.Literal=pOa;var dOa=Ii(),fOa=Sn();function pOa(t,e){return(0,dOa.CreateType)({[fOa.Kind]:"Literal",const:t,type:typeof t},e)}a(pOa,"Literal")});var UE=I(qte=>{"use strict";p();var hOa=qte&&qte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=qte&&qte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hOa(e,t,r)};Object.defineProperty(qte,"__esModule",{value:!0});mOa(wwi(),qte)});var Rwi=I(obr=>{"use strict";p();Object.defineProperty(obr,"__esModule",{value:!0});obr.Boolean=yOa;var gOa=Sn(),AOa=r6();function yOa(t){return(0,AOa.CreateType)({[gOa.Kind]:"Boolean",type:"boolean"},t)}a(yOa,"Boolean")});var B5e=I(jte=>{"use strict";p();var EOa=jte&&jte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Oa=jte&&jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EOa(e,t,r)};Object.defineProperty(jte,"__esModule",{value:!0});_Oa(Rwi(),jte)});var kwi=I(sbr=>{"use strict";p();Object.defineProperty(sbr,"__esModule",{value:!0});sbr.BigInt=bOa;var vOa=Sn(),COa=r6();function bOa(t){return(0,COa.CreateType)({[vOa.Kind]:"BigInt",type:"bigint"},t)}a(bOa,"BigInt")});var Zge=I(Hte=>{"use strict";p();var SOa=Hte&&Hte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TOa=Hte&&Hte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&SOa(e,t,r)};Object.defineProperty(Hte,"__esModule",{value:!0});TOa(kwi(),Hte)});var Pwi=I(abr=>{"use strict";p();Object.defineProperty(abr,"__esModule",{value:!0});abr.Number=wOa;var IOa=Ii(),xOa=Sn();function wOa(t){return(0,IOa.CreateType)({[xOa.Kind]:"Number",type:"number"},t)}a(wOa,"Number")});var QG=I(Gte=>{"use strict";p();var ROa=Gte&&Gte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kOa=Gte&&Gte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ROa(e,t,r)};Object.defineProperty(Gte,"__esModule",{value:!0});kOa(Pwi(),Gte)});var Dwi=I(cbr=>{"use strict";p();Object.defineProperty(cbr,"__esModule",{value:!0});cbr.String=NOa;var POa=Ii(),DOa=Sn();function NOa(t){return(0,POa.CreateType)({[DOa.Kind]:"String",type:"string"},t)}a(NOa,"String")});var qG=I($te=>{"use strict";p();var MOa=$te&&$te.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),OOa=$te&&$te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MOa(e,t,r)};Object.defineProperty($te,"__esModule",{value:!0});OOa(Dwi(),$te)});var dbr=I(ubr=>{"use strict";p();Object.defineProperty(ubr,"__esModule",{value:!0});ubr.TemplateLiteralSyntax=GOa;var F5e=UE(),LOa=B5e(),BOa=Zge(),FOa=QG(),UOa=qG(),QOa=Ip(),qOa=Cm();function*jOa(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,LOa.Boolean)():e==="number"?yield(0,FOa.Number)():e==="bigint"?yield(0,BOa.BigInt)():e==="string"?yield(0,UOa.String)():yield(()=>{let r=e.split("|").map(n=>(0,F5e.Literal)(n.trim()));return r.length===0?(0,qOa.Never)():r.length===1?r[0]:(0,QOa.UnionEvaluated)(r)})()}a(jOa,"FromUnion");function*HOa(t){if(t[1]!=="{"){let e=(0,F5e.Literal)("$"),r=lbr(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(Q5e,"__esModule",{value:!0});Q5e.TemplateLiteralPatternError=void 0;Q5e.TemplateLiteralPattern=zOa;var U5e=N5e(),$Oa=Sn(),VOa=Nf(),jG=vs(),Ngt=class extends VOa.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};Q5e.TemplateLiteralPatternError=Ngt;function WOa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(WOa,"Escape");function Nwi(t,e){return(0,jG.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,jG.IsUnion)(t)?`(${t.anyOf.map(r=>Nwi(r,e)).join("|")})`:(0,jG.IsNumber)(t)?`${e}${U5e.PatternNumber}`:(0,jG.IsInteger)(t)?`${e}${U5e.PatternNumber}`:(0,jG.IsBigInt)(t)?`${e}${U5e.PatternNumber}`:(0,jG.IsString)(t)?`${e}${U5e.PatternString}`:(0,jG.IsLiteral)(t)?`${e}${WOa(t.const.toString())}`:(0,jG.IsBoolean)(t)?`${e}${U5e.PatternBoolean}`:(()=>{throw new Ngt(`Unexpected Kind '${t[$Oa.Kind]}'`)})()}a(Nwi,"Visit");function zOa(t){return`^${t.map(e=>Nwi(e,"")).join("")}$`}a(zOa,"TemplateLiteralPattern")});var Mwi=I(pbr=>{"use strict";p();Object.defineProperty(pbr,"__esModule",{value:!0});pbr.TemplateLiteralToUnion=ZOa;var YOa=Ip(),KOa=UE(),JOa=nbr();function ZOa(t){let r=(0,JOa.TemplateLiteralGenerate)(t).map(n=>(0,KOa.Literal)(n));return(0,YOa.UnionEvaluated)(r)}a(ZOa,"TemplateLiteralToUnion")});var Lwi=I(hbr=>{"use strict";p();Object.defineProperty(hbr,"__esModule",{value:!0});hbr.TemplateLiteral=n5a;var XOa=Ii(),e5a=dbr(),Owi=fbr(),t5a=xv(),r5a=Sn();function n5a(t,e){let r=(0,t5a.IsString)(t)?(0,Owi.TemplateLiteralPattern)((0,e5a.TemplateLiteralSyntax)(t)):(0,Owi.TemplateLiteralPattern)(t);return(0,XOa.CreateType)({[r5a.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(n5a,"TemplateLiteral")});var hD=I(eI=>{"use strict";p();var i5a=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]})),Vte=eI&&eI.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&i5a(e,t,r)};Object.defineProperty(eI,"__esModule",{value:!0});Vte(rbr(),eI);Vte(nbr(),eI);Vte(dbr(),eI);Vte(wgt(),eI);Vte(fbr(),eI);Vte(Mwi(),eI);Vte(Lwi(),eI)});var Mgt=I(mbr=>{"use strict";p();Object.defineProperty(mbr,"__esModule",{value:!0});mbr.IndexPropertyKeys=Bwi;var o5a=hD(),q5e=vs();function s5a(t){return(0,o5a.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(s5a,"FromTemplateLiteral");function a5a(t){let e=[];for(let r of t)e.push(...Bwi(r));return e}a(a5a,"FromUnion");function c5a(t){return[t.toString()]}a(c5a,"FromLiteral");function Bwi(t){return[...new Set((0,q5e.IsTemplateLiteral)(t)?s5a(t):(0,q5e.IsUnion)(t)?a5a(t.anyOf):(0,q5e.IsLiteral)(t)?c5a(t.const):(0,q5e.IsNumber)(t)?["[number]"]:(0,q5e.IsInteger)(t)?["[number]"]:[])]}a(Bwi,"IndexPropertyKeys")});var Abr=I(gbr=>{"use strict";p();Object.defineProperty(gbr,"__esModule",{value:!0});gbr.IndexFromMappedResult=h5a;var l5a=bm(),u5a=Mgt(),d5a=mD();function f5a(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,d5a.Index)(t,(0,u5a.IndexPropertyKeys)(e[o]),r);return n}a(f5a,"FromProperties");function p5a(t,e,r){return f5a(t,e.properties,r)}a(p5a,"FromMappedResult");function h5a(t,e,r){let n=p5a(t,e,r);return(0,l5a.MappedResult)(n)}a(h5a,"IndexFromMappedResult")});var Lgt=I(Xge=>{"use strict";p();Object.defineProperty(Xge,"__esModule",{value:!0});Xge.IndexFromPropertyKey=Ebr;Xge.IndexFromPropertyKeys=qwi;Xge.IndexFromComputed=w5a;Xge.Index=R5a;var m5a=Ii(),g5a=Nf(),Uwi=FG(),Ogt=Cm(),A5a=tI(),ybr=Ip(),y5a=Mgt(),E5a=_br(),_5a=Abr(),Zb=vs();function Qwi(t,e){return t.map(r=>Ebr(r,e))}a(Qwi,"FromRest");function v5a(t){return t.filter(e=>!(0,Zb.IsNever)(e))}a(v5a,"FromIntersectRest");function C5a(t,e){return(0,A5a.IntersectEvaluated)(v5a(Qwi(t,e)))}a(C5a,"FromIntersect");function b5a(t){return t.some(e=>(0,Zb.IsNever)(e))?[]:t}a(b5a,"FromUnionRest");function S5a(t,e){return(0,ybr.UnionEvaluated)(b5a(Qwi(t,e)))}a(S5a,"FromUnion");function T5a(t,e){return e in t?t[e]:e==="[number]"?(0,ybr.UnionEvaluated)(t):(0,Ogt.Never)()}a(T5a,"FromTuple");function I5a(t,e){return e==="[number]"?t:(0,Ogt.Never)()}a(I5a,"FromArray");function x5a(t,e){return e in t?t[e]:(0,Ogt.Never)()}a(x5a,"FromProperty");function Ebr(t,e){return(0,Zb.IsIntersect)(t)?C5a(t.allOf,e):(0,Zb.IsUnion)(t)?S5a(t.anyOf,e):(0,Zb.IsTuple)(t)?T5a(t.items??[],e):(0,Zb.IsArray)(t)?I5a(t.items,e):(0,Zb.IsObject)(t)?x5a(t.properties,e):(0,Ogt.Never)()}a(Ebr,"IndexFromPropertyKey");function qwi(t,e){return e.map(r=>Ebr(t,r))}a(qwi,"IndexFromPropertyKeys");function Fwi(t,e){return(0,ybr.UnionEvaluated)(qwi(t,e))}a(Fwi,"FromSchema");function w5a(t,e){return(0,Uwi.Computed)("Index",[t,e])}a(w5a,"IndexFromComputed");function R5a(t,e,r){if((0,Zb.IsRef)(t)||(0,Zb.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,Zb.IsSchema)(t)||!(0,Zb.IsSchema)(e))throw new g5a.TypeBoxError(n);return(0,Uwi.Computed)("Index",[t,e])}return(0,Zb.IsMappedResult)(e)?(0,_5a.IndexFromMappedResult)(t,e,r):(0,Zb.IsMappedKey)(e)?(0,E5a.IndexFromMappedKey)(t,e,r):(0,m5a.CreateType)((0,Zb.IsSchema)(e)?Fwi(t,(0,y5a.IndexPropertyKeys)(e)):Fwi(t,e),r)}a(R5a,"Index")});var _br=I(vbr=>{"use strict";p();Object.defineProperty(vbr,"__esModule",{value:!0});vbr.IndexFromMappedKey=L5a;var k5a=Lgt(),P5a=bm(),D5a=Yb();function N5a(t,e,r){return{[e]:(0,k5a.Index)(t,[e],(0,D5a.Clone)(r))}}a(N5a,"MappedIndexPropertyKey");function M5a(t,e,r){return e.reduce((n,o)=>({...n,...N5a(t,o,r)}),{})}a(M5a,"MappedIndexPropertyKeys");function O5a(t,e,r){return M5a(t,e.keys,r)}a(O5a,"MappedIndexProperties");function L5a(t,e,r){let n=O5a(t,e,r);return(0,P5a.MappedResult)(n)}a(L5a,"IndexFromMappedKey")});var mD=I($4=>{"use strict";p();var B5a=$4&&$4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bgt=$4&&$4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&B5a(e,t,r)};Object.defineProperty($4,"__esModule",{value:!0});Bgt(_br(),$4);Bgt(Abr(),$4);Bgt(Mgt(),$4);Bgt(Lgt(),$4)});var jwi=I(Cbr=>{"use strict";p();Object.defineProperty(Cbr,"__esModule",{value:!0});Cbr.Iterator=Q5a;var F5a=Ii(),U5a=Sn();function Q5a(t,e){return(0,F5a.CreateType)({[U5a.Kind]:"Iterator",type:"Iterator",items:t},e)}a(Q5a,"Iterator")});var eAe=I(Wte=>{"use strict";p();var q5a=Wte&&Wte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Wte&&Wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&q5a(e,t,r)};Object.defineProperty(Wte,"__esModule",{value:!0});j5a(jwi(),Wte)});var Gwi=I(Fgt=>{"use strict";p();Object.defineProperty(Fgt,"__esModule",{value:!0});Fgt.Object=void 0;var H5a=Ii(),Hwi=Sn(),G5a=vs();function $5a(t){return globalThis.Object.keys(t).filter(e=>!(0,G5a.IsOptional)(t[e]))}a($5a,"RequiredArray");function V5a(t,e){let r=$5a(t),n=r.length>0?{[Hwi.Kind]:"Object",type:"object",required:r,properties:t}:{[Hwi.Kind]:"Object",type:"object",properties:t};return(0,H5a.CreateType)(n,e)}a(V5a,"_Object");Fgt.Object=V5a});var wv=I(zte=>{"use strict";p();var W5a=zte&&zte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),z5a=zte&&zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W5a(e,t,r)};Object.defineProperty(zte,"__esModule",{value:!0});z5a(Gwi(),zte)});var $wi=I(bbr=>{"use strict";p();Object.defineProperty(bbr,"__esModule",{value:!0});bbr.Promise=J5a;var Y5a=Ii(),K5a=Sn();function J5a(t,e){return(0,Y5a.CreateType)({[K5a.Kind]:"Promise",type:"Promise",item:t},e)}a(J5a,"Promise")});var j5e=I(Yte=>{"use strict";p();var Z5a=Yte&&Yte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),X5a=Yte&&Yte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Z5a(e,t,r)};Object.defineProperty(Yte,"__esModule",{value:!0});X5a($wi(),Yte)});var Tbr=I(Sbr=>{"use strict";p();Object.defineProperty(Sbr,"__esModule",{value:!0});Sbr.Readonly=s4a;var Vwi=Ii(),Wwi=Sn(),e4a=i6(),t4a=Ibr(),r4a=vs();function n4a(t){return(0,Vwi.CreateType)((0,e4a.Discard)(t,[Wwi.ReadonlyKind]))}a(n4a,"RemoveReadonly");function i4a(t){return(0,Vwi.CreateType)({...t,[Wwi.ReadonlyKind]:"Readonly"})}a(i4a,"AddReadonly");function o4a(t,e){return e===!1?n4a(t):i4a(t)}a(o4a,"ReadonlyWithFlag");function s4a(t,e){let r=e??!0;return(0,r4a.IsMappedResult)(t)?(0,t4a.ReadonlyFromMappedResult)(t,r):o4a(t,r)}a(s4a,"Readonly")});var Ibr=I(xbr=>{"use strict";p();Object.defineProperty(xbr,"__esModule",{value:!0});xbr.ReadonlyFromMappedResult=d4a;var a4a=bm(),c4a=Tbr();function l4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,c4a.Readonly)(t[n],e);return r}a(l4a,"FromProperties");function u4a(t,e){return l4a(t.properties,e)}a(u4a,"FromMappedResult");function d4a(t,e){let r=u4a(t,e);return(0,a4a.MappedResult)(r)}a(d4a,"ReadonlyFromMappedResult")});var GG=I(HG=>{"use strict";p();var f4a=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]})),zwi=HG&&HG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f4a(e,t,r)};Object.defineProperty(HG,"__esModule",{value:!0});zwi(Ibr(),HG);zwi(Tbr(),HG)});var Kwi=I(wbr=>{"use strict";p();Object.defineProperty(wbr,"__esModule",{value:!0});wbr.Tuple=h4a;var p4a=Ii(),Ywi=Sn();function h4a(t,e){return(0,p4a.CreateType)(t.length>0?{[Ywi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[Ywi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(h4a,"Tuple")});var a6=I(Kte=>{"use strict";p();var m4a=Kte&&Kte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),g4a=Kte&&Kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&m4a(e,t,r)};Object.defineProperty(Kte,"__esModule",{value:!0});g4a(Kwi(),Kte)});var rRi=I(Ugt=>{"use strict";p();Object.defineProperty(Ugt,"__esModule",{value:!0});Ugt.MappedFunctionReturnType=tRi;Ugt.Mapped=L4a;var Rbr=Sn(),Jwi=i6(),A4a=Vge(),y4a=Wge(),E4a=zge(),_4a=UG(),v4a=mD(),C4a=tI(),b4a=eAe(),Zwi=UE(),Xwi=wv(),S4a=G4(),T4a=j5e(),I4a=GG(),x4a=a6(),w4a=Ip(),R4a=M5e(),k4a=WCr(),Rv=vs();function eRi(t,e){return t in e?RR(t,e[t]):(0,k4a.MappedResult)(e)}a(eRi,"FromMappedResult");function P4a(t){return{[t]:(0,Zwi.Literal)(t)}}a(P4a,"MappedKeyToKnownMappedResultProperties");function D4a(t){let e={};for(let r of t)e[r]=(0,Zwi.Literal)(r);return e}a(D4a,"MappedKeyToUnknownMappedResultProperties");function N4a(t,e){return(0,R4a.SetIncludes)(e,t)?P4a(t):D4a(e)}a(N4a,"MappedKeyToMappedResultProperties");function M4a(t,e){let r=N4a(t,e);return eRi(t,r)}a(M4a,"FromMappedKey");function H5e(t,e){return e.map(r=>RR(t,r))}a(H5e,"FromRest");function O4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=RR(t,e[n]);return r}a(O4a,"FromProperties");function RR(t,e){let r={...e};return(0,Rv.IsOptional)(e)?(0,S4a.Optional)(RR(t,(0,Jwi.Discard)(e,[Rbr.OptionalKind]))):(0,Rv.IsReadonly)(e)?(0,I4a.Readonly)(RR(t,(0,Jwi.Discard)(e,[Rbr.ReadonlyKind]))):(0,Rv.IsMappedResult)(e)?eRi(t,e.properties):(0,Rv.IsMappedKey)(e)?M4a(t,e.keys):(0,Rv.IsConstructor)(e)?(0,E4a.Constructor)(H5e(t,e.parameters),RR(t,e.returns),r):(0,Rv.IsFunction)(e)?(0,_4a.Function)(H5e(t,e.parameters),RR(t,e.returns),r):(0,Rv.IsAsyncIterator)(e)?(0,y4a.AsyncIterator)(RR(t,e.items),r):(0,Rv.IsIterator)(e)?(0,b4a.Iterator)(RR(t,e.items),r):(0,Rv.IsIntersect)(e)?(0,C4a.Intersect)(H5e(t,e.allOf),r):(0,Rv.IsUnion)(e)?(0,w4a.Union)(H5e(t,e.anyOf),r):(0,Rv.IsTuple)(e)?(0,x4a.Tuple)(H5e(t,e.items??[]),r):(0,Rv.IsObject)(e)?(0,Xwi.Object)(O4a(t,e.properties),r):(0,Rv.IsArray)(e)?(0,A4a.Array)(RR(t,e.items),r):(0,Rv.IsPromise)(e)?(0,T4a.Promise)(RR(t,e.item),r):e}a(RR,"FromSchemaType");function tRi(t,e){let r={};for(let n of t)r[n]=RR(n,e);return r}a(tRi,"MappedFunctionReturnType");function L4a(t,e,r){let n=(0,Rv.IsSchema)(t)?(0,v4a.IndexPropertyKeys)(t):t,o=e({[Rbr.Kind]:"MappedKey",keys:n}),s=tRi(n,o);return(0,Xwi.Object)(s,r)}a(L4a,"Mapped")});var bm=I(c6=>{"use strict";p();var B4a=c6&&c6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kbr=c6&&c6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&B4a(e,t,r)};Object.defineProperty(c6,"__esModule",{value:!0});kbr(gwi(),c6);kbr(WCr(),c6);kbr(rRi(),c6)});var Dbr=I(Pbr=>{"use strict";p();Object.defineProperty(Pbr,"__esModule",{value:!0});Pbr.Optional=G4a;var nRi=Ii(),iRi=Sn(),F4a=i6(),U4a=Nbr(),Q4a=vs();function q4a(t){return(0,nRi.CreateType)((0,F4a.Discard)(t,[iRi.OptionalKind]))}a(q4a,"RemoveOptional");function j4a(t){return(0,nRi.CreateType)({...t,[iRi.OptionalKind]:"Optional"})}a(j4a,"AddOptional");function H4a(t,e){return e===!1?q4a(t):j4a(t)}a(H4a,"OptionalWithFlag");function G4a(t,e){let r=e??!0;return(0,Q4a.IsMappedResult)(t)?(0,U4a.OptionalFromMappedResult)(t,r):H4a(t,r)}a(G4a,"Optional")});var Nbr=I(Mbr=>{"use strict";p();Object.defineProperty(Mbr,"__esModule",{value:!0});Mbr.OptionalFromMappedResult=Y4a;var $4a=bm(),V4a=Dbr();function W4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,V4a.Optional)(t[n],e);return r}a(W4a,"FromProperties");function z4a(t,e){return W4a(t.properties,e)}a(z4a,"FromMappedResult");function Y4a(t,e){let r=z4a(t,e);return(0,$4a.MappedResult)(r)}a(Y4a,"OptionalFromMappedResult")});var G4=I($G=>{"use strict";p();var K4a=$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]})),oRi=$G&&$G.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&K4a(e,t,r)};Object.defineProperty($G,"__esModule",{value:!0});oRi(Nbr(),$G);oRi(Dbr(),$G)});var Bbr=I(Lbr=>{"use strict";p();Object.defineProperty(Lbr,"__esModule",{value:!0});Lbr.IntersectCreate=Z4a;var J4a=Ii(),sRi=Sn(),Obr=vs();function Z4a(t,e={}){let r=t.every(o=>(0,Obr.IsObject)(o)),n=(0,Obr.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,J4a.CreateType)(e.unevaluatedProperties===!1||(0,Obr.IsSchema)(e.unevaluatedProperties)||r?{...n,[sRi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[sRi.Kind]:"Intersect",allOf:t},e)}a(Z4a,"IntersectCreate")});var lRi=I(Ubr=>{"use strict";p();Object.defineProperty(Ubr,"__esModule",{value:!0});Ubr.IntersectEvaluated=aLa;var X4a=Sn(),eLa=Ii(),tLa=i6(),rLa=Cm(),nLa=G4(),aRi=Bbr(),Fbr=vs();function iLa(t){return t.every(e=>(0,Fbr.IsOptional)(e))}a(iLa,"IsIntersectOptional");function oLa(t){return(0,tLa.Discard)(t,[X4a.OptionalKind])}a(oLa,"RemoveOptionalFromType");function cRi(t){return t.map(e=>(0,Fbr.IsOptional)(e)?oLa(e):e)}a(cRi,"RemoveOptionalFromRest");function sLa(t,e){return iLa(t)?(0,nLa.Optional)((0,aRi.IntersectCreate)(cRi(t),e)):(0,aRi.IntersectCreate)(cRi(t),e)}a(sLa,"ResolveIntersect");function aLa(t,e={}){if(t.length===1)return(0,eLa.CreateType)(t[0],e);if(t.length===0)return(0,rLa.Never)(e);if(t.some(r=>(0,Fbr.IsTransform)(r)))throw new Error("Cannot intersect transform types");return sLa(t,e)}a(aLa,"IntersectEvaluated")});var dRi=I(uRi=>{"use strict";p();Object.defineProperty(uRi,"__esModule",{value:!0});var Pxp=Sn()});var fRi=I(Qbr=>{"use strict";p();Object.defineProperty(Qbr,"__esModule",{value:!0});Qbr.Intersect=fLa;var cLa=Ii(),lLa=Cm(),uLa=Bbr(),dLa=vs();function fLa(t,e){if(t.length===1)return(0,cLa.CreateType)(t[0],e);if(t.length===0)return(0,lLa.Never)(e);if(t.some(r=>(0,dLa.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,uLa.IntersectCreate)(t,e)}a(fLa,"Intersect")});var tI=I(l6=>{"use strict";p();var pLa=l6&&l6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qbr=l6&&l6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pLa(e,t,r)};Object.defineProperty(l6,"__esModule",{value:!0});qbr(lRi(),l6);qbr(dRi(),l6);qbr(fRi(),l6)});var pRi=I(jbr=>{"use strict";p();Object.defineProperty(jbr,"__esModule",{value:!0});jbr.Ref=ALa;var hLa=Nf(),mLa=Ii(),gLa=Sn();function ALa(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new hLa.TypeBoxError("Ref: $ref must be a string");return(0,mLa.CreateType)({[gLa.Kind]:"Ref",$ref:e},r)}a(ALa,"Ref")});var VG=I(Jte=>{"use strict";p();var yLa=Jte&&Jte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ELa=Jte&&Jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yLa(e,t,r)};Object.defineProperty(Jte,"__esModule",{value:!0});ELa(pRi(),Jte)});var mRi=I($br=>{"use strict";p();Object.defineProperty($br,"__esModule",{value:!0});$br.Awaited=Gbr;var _La=Ii(),Hbr=FG(),vLa=tI(),CLa=Ip(),bLa=VG(),G5e=vs();function SLa(t,e){return(0,Hbr.Computed)("Awaited",[(0,Hbr.Computed)(t,e)])}a(SLa,"FromComputed");function TLa(t){return(0,Hbr.Computed)("Awaited",[(0,bLa.Ref)(t)])}a(TLa,"FromRef");function ILa(t){return(0,vLa.Intersect)(hRi(t))}a(ILa,"FromIntersect");function xLa(t){return(0,CLa.Union)(hRi(t))}a(xLa,"FromUnion");function wLa(t){return Gbr(t)}a(wLa,"FromPromise");function hRi(t){return t.map(e=>Gbr(e))}a(hRi,"FromRest");function Gbr(t,e){return(0,_La.CreateType)((0,G5e.IsComputed)(t)?SLa(t.target,t.parameters):(0,G5e.IsIntersect)(t)?ILa(t.allOf):(0,G5e.IsUnion)(t)?xLa(t.anyOf):(0,G5e.IsPromise)(t)?wLa(t.item):(0,G5e.IsRef)(t)?TLa(t.$ref):t,e)}a(Gbr,"Awaited")});var $5e=I(Zte=>{"use strict";p();var RLa=Zte&&Zte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kLa=Zte&&Zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&RLa(e,t,r)};Object.defineProperty(Zte,"__esModule",{value:!0});kLa(mRi(),Zte)});var qgt=I(Qgt=>{"use strict";p();Object.defineProperty(Qgt,"__esModule",{value:!0});Qgt.KeyOfPropertyKeys=Wbr;Qgt.KeyOfPattern=BLa;var gRi=M5e(),tAe=vs();function ARi(t){let e=[];for(let r of t)e.push(Wbr(r));return e}a(ARi,"FromRest");function PLa(t){let e=ARi(t);return(0,gRi.SetUnionMany)(e)}a(PLa,"FromIntersect");function DLa(t){let e=ARi(t);return(0,gRi.SetIntersectMany)(e)}a(DLa,"FromUnion");function NLa(t){return t.map((e,r)=>r.toString())}a(NLa,"FromTuple");function MLa(t){return["[number]"]}a(MLa,"FromArray");function OLa(t){return globalThis.Object.getOwnPropertyNames(t)}a(OLa,"FromProperties");function LLa(t){return Vbr?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(LLa,"FromPatternProperties");function Wbr(t){return(0,tAe.IsIntersect)(t)?PLa(t.allOf):(0,tAe.IsUnion)(t)?DLa(t.anyOf):(0,tAe.IsTuple)(t)?NLa(t.items??[]):(0,tAe.IsArray)(t)?MLa(t.items):(0,tAe.IsObject)(t)?OLa(t.properties):(0,tAe.IsRecord)(t)?LLa(t.patternProperties):[]}a(Wbr,"KeyOfPropertyKeys");var Vbr=!1;function BLa(t){Vbr=!0;let e=Wbr(t);return Vbr=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(BLa,"KeyOfPattern")});var Kbr=I(jgt=>{"use strict";p();Object.defineProperty(jgt,"__esModule",{value:!0});jgt.KeyOfPropertyKeysToRest=yRi;jgt.KeyOf=zLa;var FLa=Ii(),ULa=UE(),QLa=QG(),Ybr=FG(),qLa=VG(),jLa=qgt(),HLa=Ip(),GLa=Jbr(),zbr=vs();function $La(t,e){return(0,Ybr.Computed)("KeyOf",[(0,Ybr.Computed)(t,e)])}a($La,"FromComputed");function VLa(t){return(0,Ybr.Computed)("KeyOf",[(0,qLa.Ref)(t)])}a(VLa,"FromRef");function WLa(t,e){let r=(0,jLa.KeyOfPropertyKeys)(t),n=yRi(r),o=(0,HLa.UnionEvaluated)(n);return(0,FLa.CreateType)(o,e)}a(WLa,"KeyOfFromType");function yRi(t){return t.map(e=>e==="[number]"?(0,QLa.Number)():(0,ULa.Literal)(e))}a(yRi,"KeyOfPropertyKeysToRest");function zLa(t,e){return(0,zbr.IsComputed)(t)?$La(t.target,t.parameters):(0,zbr.IsRef)(t)?VLa(t.$ref):(0,zbr.IsMappedResult)(t)?(0,GLa.KeyOfFromMappedResult)(t,e):WLa(t,e)}a(zLa,"KeyOf")});var Jbr=I(Zbr=>{"use strict";p();Object.defineProperty(Zbr,"__esModule",{value:!0});Zbr.KeyOfFromMappedResult=eBa;var YLa=bm(),KLa=Kbr(),JLa=Yb();function ZLa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,KLa.KeyOf)(t[n],(0,JLa.Clone)(e));return r}a(ZLa,"FromProperties");function XLa(t,e){return ZLa(t.properties,e)}a(XLa,"FromMappedResult");function eBa(t,e){let r=XLa(t,e);return(0,YLa.MappedResult)(r)}a(eBa,"KeyOfFromMappedResult")});var ERi=I(Xbr=>{"use strict";p();Object.defineProperty(Xbr,"__esModule",{value:!0});Xbr.KeyOfPropertyEntries=nBa;var tBa=Lgt(),rBa=qgt();function nBa(t){let e=(0,rBa.KeyOfPropertyKeys)(t),r=(0,tBa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(nBa,"KeyOfPropertyEntries")});var gD=I(V4=>{"use strict";p();var iBa=V4&&V4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hgt=V4&&V4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iBa(e,t,r)};Object.defineProperty(V4,"__esModule",{value:!0});Hgt(Jbr(),V4);Hgt(ERi(),V4);Hgt(qgt(),V4);Hgt(Kbr(),V4)});var _Ri=I(e1r=>{"use strict";p();Object.defineProperty(e1r,"__esModule",{value:!0});e1r.Composite=mBa;var oBa=tI(),sBa=mD(),aBa=gD(),cBa=wv(),lBa=M5e(),uBa=vs();function dBa(t){let e=[];for(let r of t)e.push(...(0,aBa.KeyOfPropertyKeys)(r));return(0,lBa.SetDistinct)(e)}a(dBa,"CompositeKeys");function fBa(t){return t.filter(e=>!(0,uBa.IsNever)(e))}a(fBa,"FilterNever");function pBa(t,e){let r=[];for(let n of t)r.push(...(0,sBa.IndexFromPropertyKeys)(n,[e]));return fBa(r)}a(pBa,"CompositeProperty");function hBa(t,e){let r={};for(let n of e)r[n]=(0,oBa.IntersectEvaluated)(pBa(t,n));return r}a(hBa,"CompositeProperties");function mBa(t,e){let r=dBa(t),n=hBa(t,r);return(0,cBa.Object)(n,e)}a(mBa,"Composite")});var Ggt=I(Xte=>{"use strict";p();var gBa=Xte&&Xte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ABa=Xte&&Xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gBa(e,t,r)};Object.defineProperty(Xte,"__esModule",{value:!0});ABa(_Ri(),Xte)});var vRi=I(t1r=>{"use strict";p();Object.defineProperty(t1r,"__esModule",{value:!0});t1r.Date=_Ba;var yBa=Sn(),EBa=Ii();function _Ba(t){return(0,EBa.CreateType)({[yBa.Kind]:"Date",type:"Date"},t)}a(_Ba,"Date")});var V5e=I(ere=>{"use strict";p();var vBa=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]})),CBa=ere&&ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vBa(e,t,r)};Object.defineProperty(ere,"__esModule",{value:!0});CBa(vRi(),ere)});var CRi=I(r1r=>{"use strict";p();Object.defineProperty(r1r,"__esModule",{value:!0});r1r.Null=TBa;var bBa=Ii(),SBa=Sn();function TBa(t){return(0,bBa.CreateType)({[SBa.Kind]:"Null",type:"null"},t)}a(TBa,"Null")});var W5e=I(tre=>{"use strict";p();var IBa=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]})),xBa=tre&&tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IBa(e,t,r)};Object.defineProperty(tre,"__esModule",{value:!0});xBa(CRi(),tre)});var bRi=I(n1r=>{"use strict";p();Object.defineProperty(n1r,"__esModule",{value:!0});n1r.Symbol=kBa;var wBa=Ii(),RBa=Sn();function kBa(t){return(0,wBa.CreateType)({[RBa.Kind]:"Symbol",type:"symbol"},t)}a(kBa,"Symbol")});var z5e=I(rre=>{"use strict";p();var PBa=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]})),DBa=rre&&rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&PBa(e,t,r)};Object.defineProperty(rre,"__esModule",{value:!0});DBa(bRi(),rre)});var SRi=I(i1r=>{"use strict";p();Object.defineProperty(i1r,"__esModule",{value:!0});i1r.Undefined=OBa;var NBa=Ii(),MBa=Sn();function OBa(t){return(0,NBa.CreateType)({[MBa.Kind]:"Undefined",type:"undefined"},t)}a(OBa,"Undefined")});var Y5e=I(nre=>{"use strict";p();var LBa=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]})),BBa=nre&&nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LBa(e,t,r)};Object.defineProperty(nre,"__esModule",{value:!0});BBa(SRi(),nre)});var TRi=I(o1r=>{"use strict";p();Object.defineProperty(o1r,"__esModule",{value:!0});o1r.Uint8Array=QBa;var FBa=Ii(),UBa=Sn();function QBa(t){return(0,FBa.CreateType)({[UBa.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(QBa,"Uint8Array")});var K5e=I(ire=>{"use strict";p();var qBa=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]})),jBa=ire&&ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qBa(e,t,r)};Object.defineProperty(ire,"__esModule",{value:!0});jBa(TRi(),ire)});var IRi=I(s1r=>{"use strict";p();Object.defineProperty(s1r,"__esModule",{value:!0});s1r.Unknown=$Ba;var HBa=Ii(),GBa=Sn();function $Ba(t){return(0,HBa.CreateType)({[GBa.Kind]:"Unknown"},t)}a($Ba,"Unknown")});var WG=I(ore=>{"use strict";p();var VBa=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]})),WBa=ore&&ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&VBa(e,t,r)};Object.defineProperty(ore,"__esModule",{value:!0});WBa(IRi(),ore)});var RRi=I(u1r=>{"use strict";p();Object.defineProperty(u1r,"__esModule",{value:!0});u1r.Const=s3a;var xRi=$ge(),zBa=Zge(),YBa=V5e(),KBa=UG(),a1r=UE(),JBa=W5e(),wRi=wv(),ZBa=z5e(),XBa=a6(),c1r=GG(),e3a=Y5e(),t3a=K5e(),r3a=WG(),n3a=r6(),Xb=xv();function i3a(t){return t.map(e=>l1r(e,!1))}a(i3a,"FromArray");function o3a(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,c1r.Readonly)(l1r(t[r],!1));return e}a(o3a,"FromProperties");function $gt(t,e){return e===!0?t:(0,c1r.Readonly)(t)}a($gt,"ConditionalReadonly");function l1r(t,e){return(0,Xb.IsAsyncIterator)(t)||(0,Xb.IsIterator)(t)?$gt((0,xRi.Any)(),e):(0,Xb.IsArray)(t)?(0,c1r.Readonly)((0,XBa.Tuple)(i3a(t))):(0,Xb.IsUint8Array)(t)?(0,t3a.Uint8Array)():(0,Xb.IsDate)(t)?(0,YBa.Date)():(0,Xb.IsObject)(t)?$gt((0,wRi.Object)(o3a(t)),e):(0,Xb.IsFunction)(t)?$gt((0,KBa.Function)([],(0,r3a.Unknown)()),e):(0,Xb.IsUndefined)(t)?(0,e3a.Undefined)():(0,Xb.IsNull)(t)?(0,JBa.Null)():(0,Xb.IsSymbol)(t)?(0,ZBa.Symbol)():(0,Xb.IsBigInt)(t)?(0,zBa.BigInt)():(0,Xb.IsNumber)(t)||(0,Xb.IsBoolean)(t)||(0,Xb.IsString)(t)?(0,a1r.Literal)(t):(0,wRi.Object)({})}a(l1r,"FromValue");function s3a(t,e){return(0,n3a.CreateType)(l1r(t,!0),e)}a(s3a,"Const")});var Vgt=I(sre=>{"use strict";p();var a3a=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]})),c3a=sre&&sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&a3a(e,t,r)};Object.defineProperty(sre,"__esModule",{value:!0});c3a(RRi(),sre)});var kRi=I(u6=>{"use strict";p();var l3a=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]})),u3a=u6&&u6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),d3a=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;o{"use strict";p();var g3a=are&&are.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),A3a=are&&are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&g3a(e,t,r)};Object.defineProperty(are,"__esModule",{value:!0});A3a(kRi(),are)});var PRi=I(d1r=>{"use strict";p();Object.defineProperty(d1r,"__esModule",{value:!0});d1r.Enum=C3a;var y3a=UE(),E3a=Sn(),_3a=Ip(),v3a=xv();function C3a(t,e){if((0,v3a.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,y3a.Literal)(s));return(0,_3a.Union)(o,{...e,[E3a.Hint]:"Enum"})}a(C3a,"Enum")});var zgt=I(cre=>{"use strict";p();var b3a=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]})),S3a=cre&&cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&b3a(e,t,r)};Object.defineProperty(cre,"__esModule",{value:!0});S3a(PRi(),cre)});var E1r=I(lre=>{"use strict";p();Object.defineProperty(lre,"__esModule",{value:!0});lre.ExtendsResult=lre.ExtendsResolverError=void 0;lre.ExtendsCheck=pFa;var DRi=$ge(),T3a=UG(),g1r=QG(),p1r=qG(),I3a=WG(),NRi=hD(),rAe=N5e(),FRi=Sn(),x3a=Nf(),tt=LCr(),Ygt=class extends x3a.TypeBoxError{static{a(this,"ExtendsResolverError")}};lre.ExtendsResolverError=Ygt;var Lt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Lt||(lre.ExtendsResult=Lt={}));function kR(t){return t===Lt.False?t:Lt.True}a(kR,"IntoBooleanResult");function nAe(t){throw new Ygt(t)}a(nAe,"Throw");function Sm(t){return tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsIntersect(t)||tt.TypeGuard.IsUnion(t)||tt.TypeGuard.IsUnknown(t)||tt.TypeGuard.IsAny(t)}a(Sm,"IsStructuralRight");function Tm(t,e){return tt.TypeGuard.IsNever(e)?qRi(t,e):tt.TypeGuard.IsIntersect(e)?Kgt(t,e):tt.TypeGuard.IsUnion(e)?y1r(t,e):tt.TypeGuard.IsUnknown(e)?$Ri(t,e):tt.TypeGuard.IsAny(e)?A1r(t,e):nAe("StructuralRight")}a(Tm,"StructuralRight");function A1r(t,e){return Lt.True}a(A1r,"FromAnyRight");function w3a(t,e){return tt.TypeGuard.IsIntersect(e)?Kgt(t,e):tt.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>tt.TypeGuard.IsAny(r)||tt.TypeGuard.IsUnknown(r))?Lt.True:tt.TypeGuard.IsUnion(e)?Lt.Union:tt.TypeGuard.IsUnknown(e)||tt.TypeGuard.IsAny(e)?Lt.True:Lt.Union}a(w3a,"FromAny");function R3a(t,e){return tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:tt.TypeGuard.IsNever(t)?Lt.True:Lt.False}a(R3a,"FromArrayRight");function k3a(t,e){return tt.TypeGuard.IsObject(e)&&Jgt(e)?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsArray(e)?kR(hl(t.items,e.items)):Lt.False}a(k3a,"FromArray");function P3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsAsyncIterator(e)?kR(hl(t.items,e.items)):Lt.False}a(P3a,"FromAsyncIterator");function D3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):tt.TypeGuard.IsBigInt(e)?Lt.True:Lt.False}a(D3a,"FromBigInt");function URi(t,e){return tt.TypeGuard.IsLiteralBoolean(t)||tt.TypeGuard.IsBoolean(t)?Lt.True:Lt.False}a(URi,"FromBooleanRight");function N3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):tt.TypeGuard.IsBoolean(e)?Lt.True:Lt.False}a(N3a,"FromBoolean");function M3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>kR(hl(e.parameters[n],r))===Lt.True)?kR(hl(t.returns,e.returns)):Lt.False:Lt.False}a(M3a,"FromConstructor");function O3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):tt.TypeGuard.IsDate(e)?Lt.True:Lt.False}a(O3a,"FromDate");function L3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>kR(hl(e.parameters[n],r))===Lt.True)?kR(hl(t.returns,e.returns)):Lt.False:Lt.False}a(L3a,"FromFunction");function QRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsNumber(t.const)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(QRi,"FromIntegerRight");function B3a(t,e){return tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):Lt.False}a(B3a,"FromInteger");function Kgt(t,e){return e.allOf.every(r=>hl(t,r)===Lt.True)?Lt.True:Lt.False}a(Kgt,"FromIntersectRight");function F3a(t,e){return t.allOf.some(r=>hl(r,e)===Lt.True)?Lt.True:Lt.False}a(F3a,"FromIntersect");function U3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsIterator(e)?kR(hl(t.items,e.items)):Lt.False}a(U3a,"FromIterator");function Q3a(t,e){return tt.TypeGuard.IsLiteral(e)&&e.const===t.const?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):tt.TypeGuard.IsString(e)?GRi(t,e):tt.TypeGuard.IsNumber(e)?jRi(t,e):tt.TypeGuard.IsInteger(e)?QRi(t,e):tt.TypeGuard.IsBoolean(e)?URi(t,e):Lt.False}a(Q3a,"FromLiteral");function qRi(t,e){return Lt.False}a(qRi,"FromNeverRight");function q3a(t,e){return Lt.True}a(q3a,"FromNever");function MRi(t){let[e,r]=[t,0];for(;tt.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,I3a.Unknown)()}a(MRi,"UnwrapTNot");function j3a(t,e){return tt.TypeGuard.IsNot(t)?hl(MRi(t),e):tt.TypeGuard.IsNot(e)?hl(t,MRi(e)):nAe("Invalid fallthrough for Not")}a(j3a,"FromNot");function H3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):tt.TypeGuard.IsNull(e)?Lt.True:Lt.False}a(H3a,"FromNull");function jRi(t,e){return tt.TypeGuard.IsLiteralNumber(t)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(jRi,"FromNumberRight");function G3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Lt.True:Lt.False}a(G3a,"FromNumber");function e1(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(e1,"IsObjectPropertyCount");function ORi(t){return Jgt(t)}a(ORi,"IsObjectStringLike");function LRi(t){return e1(t,0)||e1(t,1)&&"description"in t.properties&&tt.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(tt.TypeGuard.IsString(t.properties.description.anyOf[0])&&tt.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||tt.TypeGuard.IsString(t.properties.description.anyOf[1])&&tt.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(LRi,"IsObjectSymbolLike");function f1r(t){return e1(t,0)}a(f1r,"IsObjectNumberLike");function BRi(t){return e1(t,0)}a(BRi,"IsObjectBooleanLike");function $3a(t){return e1(t,0)}a($3a,"IsObjectBigIntLike");function V3a(t){return e1(t,0)}a(V3a,"IsObjectDateLike");function W3a(t){return Jgt(t)}a(W3a,"IsObjectUint8ArrayLike");function z3a(t){let e=(0,g1r.Number)();return e1(t,0)||e1(t,1)&&"length"in t.properties&&kR(hl(t.properties.length,e))===Lt.True}a(z3a,"IsObjectFunctionLike");function Y3a(t){return e1(t,0)}a(Y3a,"IsObjectConstructorLike");function Jgt(t){let e=(0,g1r.Number)();return e1(t,0)||e1(t,1)&&"length"in t.properties&&kR(hl(t.properties.length,e))===Lt.True}a(Jgt,"IsObjectArrayLike");function K3a(t){let e=(0,T3a.Function)([(0,DRi.Any)()],(0,DRi.Any)());return e1(t,0)||e1(t,1)&&"then"in t.properties&&kR(hl(t.properties.then,e))===Lt.True}a(K3a,"IsObjectPromiseLike");function HRi(t,e){return hl(t,e)===Lt.False||tt.TypeGuard.IsOptional(t)&&!tt.TypeGuard.IsOptional(e)?Lt.False:Lt.True}a(HRi,"Property");function QE(t,e){return tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsLiteralString(t)&&ORi(e)||tt.TypeGuard.IsLiteralNumber(t)&&f1r(e)||tt.TypeGuard.IsLiteralBoolean(t)&&BRi(e)||tt.TypeGuard.IsSymbol(t)&&LRi(e)||tt.TypeGuard.IsBigInt(t)&&$3a(e)||tt.TypeGuard.IsString(t)&&ORi(e)||tt.TypeGuard.IsSymbol(t)&&LRi(e)||tt.TypeGuard.IsNumber(t)&&f1r(e)||tt.TypeGuard.IsInteger(t)&&f1r(e)||tt.TypeGuard.IsBoolean(t)&&BRi(e)||tt.TypeGuard.IsUint8Array(t)&&W3a(e)||tt.TypeGuard.IsDate(t)&&V3a(e)||tt.TypeGuard.IsConstructor(t)&&Y3a(e)||tt.TypeGuard.IsFunction(t)&&z3a(e)?Lt.True:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsString(h1r(t))?e[FRi.Hint]==="Record"?Lt.True:Lt.False:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsNumber(h1r(t))&&e1(e,0)?Lt.True:Lt.False}a(QE,"FromObjectRight");function J3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):tt.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!tt.TypeGuard.IsOptional(e.properties[r]))return Lt.False;if(tt.TypeGuard.IsOptional(e.properties[r]))return Lt.True;if(HRi(t.properties[r],e.properties[r])===Lt.False)return Lt.False}return Lt.True})():Lt.False}a(J3a,"FromObject");function Z3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)&&K3a(e)?Lt.True:tt.TypeGuard.IsPromise(e)?kR(hl(t.item,e.item)):Lt.False}a(Z3a,"FromPromise");function h1r(t){return rAe.PatternNumberExact in t.patternProperties?(0,g1r.Number)():rAe.PatternStringExact in t.patternProperties?(0,p1r.String)():nAe("Unknown record key pattern")}a(h1r,"RecordKey");function m1r(t){return rAe.PatternNumberExact in t.patternProperties?t.patternProperties[rAe.PatternNumberExact]:rAe.PatternStringExact in t.patternProperties?t.patternProperties[rAe.PatternStringExact]:nAe("Unable to get record value schema")}a(m1r,"RecordValue");function PR(t,e){let[r,n]=[h1r(e),m1r(e)];return tt.TypeGuard.IsLiteralString(t)&&tt.TypeGuard.IsNumber(r)&&kR(hl(t,n))===Lt.True?Lt.True:tt.TypeGuard.IsUint8Array(t)&&tt.TypeGuard.IsNumber(r)||tt.TypeGuard.IsString(t)&&tt.TypeGuard.IsNumber(r)||tt.TypeGuard.IsArray(t)&&tt.TypeGuard.IsNumber(r)?hl(t,n):tt.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(HRi(n,t.properties[o])===Lt.False)return Lt.False;return Lt.True})():Lt.False}a(PR,"FromRecordRight");function X3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?hl(m1r(t),m1r(e)):Lt.False}a(X3a,"FromRecord");function eFa(t,e){let r=tt.TypeGuard.IsRegExp(t)?(0,p1r.String)():t,n=tt.TypeGuard.IsRegExp(e)?(0,p1r.String)():e;return hl(r,n)}a(eFa,"FromRegExp");function GRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsString(t.const)||tt.TypeGuard.IsString(t)?Lt.True:Lt.False}a(GRi,"FromStringRight");function tFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):tt.TypeGuard.IsString(e)?Lt.True:Lt.False}a(tFa,"FromString");function rFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):tt.TypeGuard.IsSymbol(e)?Lt.True:Lt.False}a(rFa,"FromSymbol");function nFa(t,e){return tt.TypeGuard.IsTemplateLiteral(t)?hl((0,NRi.TemplateLiteralToUnion)(t),e):tt.TypeGuard.IsTemplateLiteral(e)?hl(t,(0,NRi.TemplateLiteralToUnion)(e)):nAe("Invalid fallthrough for TemplateLiteral")}a(nFa,"FromTemplateLiteral");function iFa(t,e){return tt.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>hl(r,e.items)===Lt.True)}a(iFa,"IsArrayOfTuple");function oFa(t,e){return tt.TypeGuard.IsNever(t)?Lt.True:tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:Lt.False}a(oFa,"FromTupleRight");function sFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)&&Jgt(e)||tt.TypeGuard.IsArray(e)&&iFa(t,e)?Lt.True:tt.TypeGuard.IsTuple(e)?tt.ValueGuard.IsUndefined(t.items)&&!tt.ValueGuard.IsUndefined(e.items)||!tt.ValueGuard.IsUndefined(t.items)&&tt.ValueGuard.IsUndefined(e.items)?Lt.False:tt.ValueGuard.IsUndefined(t.items)&&!tt.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>hl(r,e.items[n])===Lt.True)?Lt.True:Lt.False:Lt.False}a(sFa,"FromTuple");function aFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):tt.TypeGuard.IsUint8Array(e)?Lt.True:Lt.False}a(aFa,"FromUint8Array");function cFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?PR(t,e):tt.TypeGuard.IsVoid(e)?dFa(t,e):tt.TypeGuard.IsUndefined(e)?Lt.True:Lt.False}a(cFa,"FromUndefined");function y1r(t,e){return e.anyOf.some(r=>hl(t,r)===Lt.True)?Lt.True:Lt.False}a(y1r,"FromUnionRight");function lFa(t,e){return t.anyOf.every(r=>hl(r,e)===Lt.True)?Lt.True:Lt.False}a(lFa,"FromUnion");function $Ri(t,e){return Lt.True}a($Ri,"FromUnknownRight");function uFa(t,e){return tt.TypeGuard.IsNever(e)?qRi(t,e):tt.TypeGuard.IsIntersect(e)?Kgt(t,e):tt.TypeGuard.IsUnion(e)?y1r(t,e):tt.TypeGuard.IsAny(e)?A1r(t,e):tt.TypeGuard.IsString(e)?GRi(t,e):tt.TypeGuard.IsNumber(e)?jRi(t,e):tt.TypeGuard.IsInteger(e)?QRi(t,e):tt.TypeGuard.IsBoolean(e)?URi(t,e):tt.TypeGuard.IsArray(e)?R3a(t,e):tt.TypeGuard.IsTuple(e)?oFa(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsUnknown(e)?Lt.True:Lt.False}a(uFa,"FromUnknown");function dFa(t,e){return tt.TypeGuard.IsUndefined(t)||tt.TypeGuard.IsUndefined(t)?Lt.True:Lt.False}a(dFa,"FromVoidRight");function fFa(t,e){return tt.TypeGuard.IsIntersect(e)?Kgt(t,e):tt.TypeGuard.IsUnion(e)?y1r(t,e):tt.TypeGuard.IsUnknown(e)?$Ri(t,e):tt.TypeGuard.IsAny(e)?A1r(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsVoid(e)?Lt.True:Lt.False}a(fFa,"FromVoid");function hl(t,e){return tt.TypeGuard.IsTemplateLiteral(t)||tt.TypeGuard.IsTemplateLiteral(e)?nFa(t,e):tt.TypeGuard.IsRegExp(t)||tt.TypeGuard.IsRegExp(e)?eFa(t,e):tt.TypeGuard.IsNot(t)||tt.TypeGuard.IsNot(e)?j3a(t,e):tt.TypeGuard.IsAny(t)?w3a(t,e):tt.TypeGuard.IsArray(t)?k3a(t,e):tt.TypeGuard.IsBigInt(t)?D3a(t,e):tt.TypeGuard.IsBoolean(t)?N3a(t,e):tt.TypeGuard.IsAsyncIterator(t)?P3a(t,e):tt.TypeGuard.IsConstructor(t)?M3a(t,e):tt.TypeGuard.IsDate(t)?O3a(t,e):tt.TypeGuard.IsFunction(t)?L3a(t,e):tt.TypeGuard.IsInteger(t)?B3a(t,e):tt.TypeGuard.IsIntersect(t)?F3a(t,e):tt.TypeGuard.IsIterator(t)?U3a(t,e):tt.TypeGuard.IsLiteral(t)?Q3a(t,e):tt.TypeGuard.IsNever(t)?q3a(t,e):tt.TypeGuard.IsNull(t)?H3a(t,e):tt.TypeGuard.IsNumber(t)?G3a(t,e):tt.TypeGuard.IsObject(t)?J3a(t,e):tt.TypeGuard.IsRecord(t)?X3a(t,e):tt.TypeGuard.IsString(t)?tFa(t,e):tt.TypeGuard.IsSymbol(t)?rFa(t,e):tt.TypeGuard.IsTuple(t)?sFa(t,e):tt.TypeGuard.IsPromise(t)?Z3a(t,e):tt.TypeGuard.IsUint8Array(t)?aFa(t,e):tt.TypeGuard.IsUndefined(t)?cFa(t,e):tt.TypeGuard.IsUnion(t)?lFa(t,e):tt.TypeGuard.IsUnknown(t)?uFa(t,e):tt.TypeGuard.IsVoid(t)?fFa(t,e):nAe(`Unknown left type operand '${t[FRi.Kind]}'`)}a(hl,"Visit");function pFa(t,e){return hl(t,e)}a(pFa,"ExtendsCheck")});var v1r=I(_1r=>{"use strict";p();Object.defineProperty(_1r,"__esModule",{value:!0});_1r.ExtendsFromMappedResult=EFa;var hFa=bm(),mFa=Zgt(),gFa=Yb();function AFa(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,mFa.Extends)(t[c],e,r,n,(0,gFa.Clone)(o));return s}a(AFa,"FromProperties");function yFa(t,e,r,n,o){return AFa(t.properties,e,r,n,o)}a(yFa,"FromMappedResult");function EFa(t,e,r,n,o){let s=yFa(t,e,r,n,o);return(0,hFa.MappedResult)(s)}a(EFa,"ExtendsFromMappedResult")});var Zgt=I(b1r=>{"use strict";p();Object.defineProperty(b1r,"__esModule",{value:!0});b1r.Extends=SFa;var VRi=Ii(),_Fa=Ip(),C1r=E1r(),vFa=S1r(),CFa=v1r(),WRi=vs();function bFa(t,e,r,n){let o=(0,C1r.ExtendsCheck)(t,e);return o===C1r.ExtendsResult.Union?(0,_Fa.Union)([r,n]):o===C1r.ExtendsResult.True?r:n}a(bFa,"ExtendsResolve");function SFa(t,e,r,n,o){return(0,WRi.IsMappedResult)(t)?(0,CFa.ExtendsFromMappedResult)(t,e,r,n,o):(0,WRi.IsMappedKey)(t)?(0,VRi.CreateType)((0,vFa.ExtendsFromMappedKey)(t,e,r,n,o)):(0,VRi.CreateType)(bFa(t,e,r,n),o)}a(SFa,"Extends")});var S1r=I(T1r=>{"use strict";p();Object.defineProperty(T1r,"__esModule",{value:!0});T1r.ExtendsFromMappedKey=DFa;var TFa=bm(),IFa=UE(),xFa=Zgt(),wFa=Yb();function RFa(t,e,r,n,o){return{[t]:(0,xFa.Extends)((0,IFa.Literal)(t),e,r,n,(0,wFa.Clone)(o))}}a(RFa,"FromPropertyKey");function kFa(t,e,r,n,o){return t.reduce((s,c)=>({...s,...RFa(c,e,r,n,o)}),{})}a(kFa,"FromPropertyKeys");function PFa(t,e,r,n,o){return kFa(t.keys,e,r,n,o)}a(PFa,"FromMappedKey");function DFa(t,e,r,n,o){let s=PFa(t,e,r,n,o);return(0,TFa.MappedResult)(s)}a(DFa,"ExtendsFromMappedKey")});var x1r=I(I1r=>{"use strict";p();Object.defineProperty(I1r,"__esModule",{value:!0});I1r.ExtendsUndefinedCheck=eAt;var Xgt=Sn();function NFa(t){return t.allOf.every(e=>eAt(e))}a(NFa,"Intersect");function MFa(t){return t.anyOf.some(e=>eAt(e))}a(MFa,"Union");function OFa(t){return!eAt(t.not)}a(OFa,"Not");function eAt(t){return t[Xgt.Kind]==="Intersect"?NFa(t):t[Xgt.Kind]==="Union"?MFa(t):t[Xgt.Kind]==="Not"?OFa(t):t[Xgt.Kind]==="Undefined"}a(eAt,"ExtendsUndefinedCheck")});var ure=I(AD=>{"use strict";p();var LFa=AD&&AD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J5e=AD&&AD.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LFa(e,t,r)};Object.defineProperty(AD,"__esModule",{value:!0});J5e(E1r(),AD);J5e(S1r(),AD);J5e(v1r(),AD);J5e(x1r(),AD);J5e(Zgt(),AD)});var R1r=I(w1r=>{"use strict";p();Object.defineProperty(w1r,"__esModule",{value:!0});w1r.ExcludeFromTemplateLiteral=UFa;var BFa=tAt(),FFa=hD();function UFa(t,e){return(0,BFa.Exclude)((0,FFa.TemplateLiteralToUnion)(t),e)}a(UFa,"ExcludeFromTemplateLiteral")});var tAt=I(D1r=>{"use strict";p();Object.defineProperty(D1r,"__esModule",{value:!0});D1r.Exclude=$Fa;var k1r=Ii(),QFa=Ip(),qFa=Cm(),rAt=ure(),jFa=N1r(),HFa=R1r(),P1r=vs();function GFa(t,e){let r=t.filter(n=>(0,rAt.ExtendsCheck)(n,e)===rAt.ExtendsResult.False);return r.length===1?r[0]:(0,QFa.Union)(r)}a(GFa,"ExcludeRest");function $Fa(t,e,r={}){return(0,P1r.IsTemplateLiteral)(t)?(0,k1r.CreateType)((0,HFa.ExcludeFromTemplateLiteral)(t,e),r):(0,P1r.IsMappedResult)(t)?(0,k1r.CreateType)((0,jFa.ExcludeFromMappedResult)(t,e),r):(0,k1r.CreateType)((0,P1r.IsUnion)(t)?GFa(t.anyOf,e):(0,rAt.ExtendsCheck)(t,e)!==rAt.ExtendsResult.False?(0,qFa.Never)():t,r)}a($Fa,"Exclude")});var N1r=I(M1r=>{"use strict";p();Object.defineProperty(M1r,"__esModule",{value:!0});M1r.ExcludeFromMappedResult=KFa;var VFa=bm(),WFa=tAt();function zFa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,WFa.Exclude)(t[n],e);return r}a(zFa,"FromProperties");function YFa(t,e){return zFa(t.properties,e)}a(YFa,"FromMappedResult");function KFa(t,e){let r=YFa(t,e);return(0,VFa.MappedResult)(r)}a(KFa,"ExcludeFromMappedResult")});var nAt=I(d6=>{"use strict";p();var JFa=d6&&d6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),O1r=d6&&d6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JFa(e,t,r)};Object.defineProperty(d6,"__esModule",{value:!0});O1r(N1r(),d6);O1r(R1r(),d6);O1r(tAt(),d6)});var B1r=I(L1r=>{"use strict";p();Object.defineProperty(L1r,"__esModule",{value:!0});L1r.ExtractFromTemplateLiteral=e8a;var ZFa=iAt(),XFa=hD();function e8a(t,e){return(0,ZFa.Extract)((0,XFa.TemplateLiteralToUnion)(t),e)}a(e8a,"ExtractFromTemplateLiteral")});var iAt=I(Q1r=>{"use strict";p();Object.defineProperty(Q1r,"__esModule",{value:!0});Q1r.Extract=s8a;var F1r=Ii(),t8a=Ip(),r8a=Cm(),oAt=ure(),n8a=q1r(),i8a=B1r(),U1r=vs();function o8a(t,e){let r=t.filter(n=>(0,oAt.ExtendsCheck)(n,e)!==oAt.ExtendsResult.False);return r.length===1?r[0]:(0,t8a.Union)(r)}a(o8a,"ExtractRest");function s8a(t,e,r){return(0,U1r.IsTemplateLiteral)(t)?(0,F1r.CreateType)((0,i8a.ExtractFromTemplateLiteral)(t,e),r):(0,U1r.IsMappedResult)(t)?(0,F1r.CreateType)((0,n8a.ExtractFromMappedResult)(t,e),r):(0,F1r.CreateType)((0,U1r.IsUnion)(t)?o8a(t.anyOf,e):(0,oAt.ExtendsCheck)(t,e)!==oAt.ExtendsResult.False?t:(0,r8a.Never)(),r)}a(s8a,"Extract")});var q1r=I(j1r=>{"use strict";p();Object.defineProperty(j1r,"__esModule",{value:!0});j1r.ExtractFromMappedResult=d8a;var a8a=bm(),c8a=iAt();function l8a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,c8a.Extract)(t[n],e);return r}a(l8a,"FromProperties");function u8a(t,e){return l8a(t.properties,e)}a(u8a,"FromMappedResult");function d8a(t,e){let r=u8a(t,e);return(0,a8a.MappedResult)(r)}a(d8a,"ExtractFromMappedResult")});var sAt=I(f6=>{"use strict";p();var f8a=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]})),H1r=f6&&f6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f8a(e,t,r)};Object.defineProperty(f6,"__esModule",{value:!0});H1r(q1r(),f6);H1r(B1r(),f6);H1r(iAt(),f6)});var zRi=I(p6=>{"use strict";p();var p8a=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]})),h8a=p6&&p6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),m8a=p6&&p6.__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 _8a=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]})),v8a=dre&&dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_8a(e,t,r)};Object.defineProperty(dre,"__esModule",{value:!0});v8a(zRi(),dre)});var YRi=I(G1r=>{"use strict";p();Object.defineProperty(G1r,"__esModule",{value:!0});G1r.ReadonlyOptional=S8a;var C8a=GG(),b8a=G4();function S8a(t){return(0,C8a.Readonly)((0,b8a.Optional)(t))}a(S8a,"ReadonlyOptional")});var Z5e=I(fre=>{"use strict";p();var T8a=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]})),I8a=fre&&fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&T8a(e,t,r)};Object.defineProperty(fre,"__esModule",{value:!0});I8a(YRi(),fre)});var eki=I(iAe=>{"use strict";p();Object.defineProperty(iAe,"__esModule",{value:!0});iAe.Record=H8a;iAe.RecordPattern=V1r;iAe.RecordKey=G8a;iAe.RecordValue=$8a;var x8a=Ii(),JRi=Sn(),w8a=Cm(),R8a=QG(),ZRi=wv(),KRi=qG(),k8a=Ip(),P8a=hD(),pre=N5e(),XRi=mD(),D8a=xv(),W4=vs();function hre(t,e,r){return(0,x8a.CreateType)({[JRi.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(hre,"RecordCreateFromPattern");function $1r(t,e,r){let n={};for(let o of t)n[o]=e;return(0,ZRi.Object)(n,{...r,[JRi.Hint]:"Record"})}a($1r,"RecordCreateFromKeys");function N8a(t,e,r){return(0,P8a.IsTemplateLiteralFinite)(t)?$1r((0,XRi.IndexPropertyKeys)(t),e,r):hre(t.pattern,e,r)}a(N8a,"FromTemplateLiteralKey");function M8a(t,e,r){return $1r((0,XRi.IndexPropertyKeys)((0,k8a.Union)(t)),e,r)}a(M8a,"FromUnionKey");function O8a(t,e,r){return $1r([t.toString()],e,r)}a(O8a,"FromLiteralKey");function L8a(t,e,r){return hre(t.source,e,r)}a(L8a,"FromRegExpKey");function B8a(t,e,r){let n=(0,D8a.IsUndefined)(t.pattern)?pre.PatternStringExact:t.pattern;return hre(n,e,r)}a(B8a,"FromStringKey");function F8a(t,e,r){return hre(pre.PatternStringExact,e,r)}a(F8a,"FromAnyKey");function U8a(t,e,r){return hre(pre.PatternNeverExact,e,r)}a(U8a,"FromNeverKey");function Q8a(t,e,r){return(0,ZRi.Object)({true:e,false:e},r)}a(Q8a,"FromBooleanKey");function q8a(t,e,r){return hre(pre.PatternNumberExact,e,r)}a(q8a,"FromIntegerKey");function j8a(t,e,r){return hre(pre.PatternNumberExact,e,r)}a(j8a,"FromNumberKey");function H8a(t,e,r={}){return(0,W4.IsUnion)(t)?M8a(t.anyOf,e,r):(0,W4.IsTemplateLiteral)(t)?N8a(t,e,r):(0,W4.IsLiteral)(t)?O8a(t.const,e,r):(0,W4.IsBoolean)(t)?Q8a(t,e,r):(0,W4.IsInteger)(t)?q8a(t,e,r):(0,W4.IsNumber)(t)?j8a(t,e,r):(0,W4.IsRegExp)(t)?L8a(t,e,r):(0,W4.IsString)(t)?B8a(t,e,r):(0,W4.IsAny)(t)?F8a(t,e,r):(0,W4.IsNever)(t)?U8a(t,e,r):(0,w8a.Never)(r)}a(H8a,"Record");function V1r(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(V1r,"RecordPattern");function G8a(t){let e=V1r(t);return e===pre.PatternStringExact?(0,KRi.String)():e===pre.PatternNumberExact?(0,R8a.Number)():(0,KRi.String)({pattern:e})}a(G8a,"RecordKey");function $8a(t){return t.patternProperties[V1r(t)]}a($8a,"RecordValue")});var oAe=I(mre=>{"use strict";p();var V8a=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]})),W8a=mre&&mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V8a(e,t,r)};Object.defineProperty(mre,"__esModule",{value:!0});W8a(eki(),mre)});var rki=I(z4=>{"use strict";p();var z8a=z4&&z4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=z4&&z4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),tki=z4&&z4.__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]:m6a(t,e[n])}),{})}a(g6a,"FromProperties");function sAe(t,e){return e.map(r=>yD(t,r))}a(sAe,"FromTypes");function yD(t,e){return t1.IsConstructor(e)?n6a(t,e):t1.IsFunction(e)?i6a(t,e):t1.IsIntersect(e)?o6a(t,e):t1.IsUnion(e)?s6a(t,e):t1.IsTuple(e)?a6a(t,e):t1.IsArray(e)?c6a(t,e):t1.IsAsyncIterator(e)?l6a(t,e):t1.IsIterator(e)?u6a(t,e):t1.IsPromise(e)?d6a(t,e):t1.IsObject(e)?f6a(t,e):t1.IsRecord(e)?p6a(t,e):t1.IsArgument(e)?h6a(t,e):e}a(yD,"FromType");function A6a(t,e){return yD(e,(0,K8a.CloneType)(t))}a(A6a,"Instantiate")});var cAt=I(gre=>{"use strict";p();var y6a=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]})),E6a=gre&&gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&y6a(e,t,r)};Object.defineProperty(gre,"__esModule",{value:!0});E6a(rki(),gre)});var nki=I(z1r=>{"use strict";p();Object.defineProperty(z1r,"__esModule",{value:!0});z1r.Integer=C6a;var _6a=Ii(),v6a=Sn();function C6a(t){return(0,_6a.CreateType)({[v6a.Kind]:"Integer",type:"integer"},t)}a(C6a,"Integer")});var lAt=I(Are=>{"use strict";p();var b6a=Are&&Are.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Are&&Are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&b6a(e,t,r)};Object.defineProperty(Are,"__esModule",{value:!0});S6a(nki(),Are)});var K1r=I(Y1r=>{"use strict";p();Object.defineProperty(Y1r,"__esModule",{value:!0});Y1r.IntrinsicFromMappedKey=D6a;var T6a=bm(),I6a=yre(),x6a=UE(),w6a=Yb();function R6a(t,e,r){return{[t]:(0,I6a.Intrinsic)((0,x6a.Literal)(t),e,(0,w6a.Clone)(r))}}a(R6a,"MappedIntrinsicPropertyKey");function k6a(t,e,r){return t.reduce((o,s)=>({...o,...R6a(s,e,r)}),{})}a(k6a,"MappedIntrinsicPropertyKeys");function P6a(t,e,r){return k6a(t.keys,e,r)}a(P6a,"MappedIntrinsicProperties");function D6a(t,e,r){let n=P6a(t,e,r);return(0,T6a.MappedResult)(n)}a(D6a,"IntrinsicFromMappedKey")});var yre=I(J1r=>{"use strict";p();Object.defineProperty(J1r,"__esModule",{value:!0});J1r.Intrinsic=cki;var N6a=Ii(),uAt=hD(),M6a=K1r(),iki=UE(),oki=Ip(),dAt=vs();function O6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(O6a,"ApplyUncapitalize");function L6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(L6a,"ApplyCapitalize");function B6a(t){return t.toUpperCase()}a(B6a,"ApplyUppercase");function F6a(t){return t.toLowerCase()}a(F6a,"ApplyLowercase");function U6a(t,e,r){let n=(0,uAt.TemplateLiteralParseExact)(t.pattern);if(!(0,uAt.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:ski(t.pattern,e)};let c=[...(0,uAt.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,iki.Literal)(d)),l=aki(c,e),u=(0,oki.Union)(l);return(0,uAt.TemplateLiteral)([u],r)}a(U6a,"FromTemplateLiteral");function ski(t,e){return typeof t=="string"?e==="Uncapitalize"?O6a(t):e==="Capitalize"?L6a(t):e==="Uppercase"?B6a(t):e==="Lowercase"?F6a(t):t:t.toString()}a(ski,"FromLiteralValue");function aki(t,e){return t.map(r=>cki(r,e))}a(aki,"FromRest");function cki(t,e,r={}){return(0,dAt.IsMappedKey)(t)?(0,M6a.IntrinsicFromMappedKey)(t,e,r):(0,dAt.IsTemplateLiteral)(t)?U6a(t,e,r):(0,dAt.IsUnion)(t)?(0,oki.Union)(aki(t.anyOf,e),r):(0,dAt.IsLiteral)(t)?(0,iki.Literal)(ski(t.const,e),r):(0,N6a.CreateType)(t,r)}a(cki,"Intrinsic")});var lki=I(Z1r=>{"use strict";p();Object.defineProperty(Z1r,"__esModule",{value:!0});Z1r.Capitalize=q6a;var Q6a=yre();function q6a(t,e={}){return(0,Q6a.Intrinsic)(t,"Capitalize",e)}a(q6a,"Capitalize")});var uki=I(X1r=>{"use strict";p();Object.defineProperty(X1r,"__esModule",{value:!0});X1r.Lowercase=H6a;var j6a=yre();function H6a(t,e={}){return(0,j6a.Intrinsic)(t,"Lowercase",e)}a(H6a,"Lowercase")});var dki=I(eSr=>{"use strict";p();Object.defineProperty(eSr,"__esModule",{value:!0});eSr.Uncapitalize=$6a;var G6a=yre();function $6a(t,e={}){return(0,G6a.Intrinsic)(t,"Uncapitalize",e)}a($6a,"Uncapitalize")});var fki=I(tSr=>{"use strict";p();Object.defineProperty(tSr,"__esModule",{value:!0});tSr.Uppercase=W6a;var V6a=yre();function W6a(t,e={}){return(0,V6a.Intrinsic)(t,"Uppercase",e)}a(W6a,"Uppercase")});var fAt=I(DR=>{"use strict";p();var z6a=DR&&DR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aAe=DR&&DR.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&z6a(e,t,r)};Object.defineProperty(DR,"__esModule",{value:!0});aAe(lki(),DR);aAe(K1r(),DR);aAe(yre(),DR);aAe(uki(),DR);aAe(dki(),DR);aAe(fki(),DR)});var nSr=I(rSr=>{"use strict";p();Object.defineProperty(rSr,"__esModule",{value:!0});rSr.OmitFromMappedResult=e9a;var Y6a=bm(),K6a=pAt(),J6a=Yb();function Z6a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,K6a.Omit)(t[o],e,(0,J6a.Clone)(r));return n}a(Z6a,"FromProperties");function X6a(t,e,r){return Z6a(t.properties,e,r)}a(X6a,"FromMappedResult");function e9a(t,e,r){let n=X6a(t,e,r);return(0,Y6a.MappedResult)(n)}a(e9a,"OmitFromMappedResult")});var pAt=I(sSr=>{"use strict";p();Object.defineProperty(sSr,"__esModule",{value:!0});sSr.Omit=g9a;var t9a=Ii(),r9a=xgt(),n9a=R5e(),iSr=FG(),i9a=UE(),o9a=mD(),s9a=tI(),pki=Ip(),hki=wv(),a9a=aSr(),c9a=nSr(),h6=vs(),l9a=xv();function u9a(t,e){return t.map(r=>oSr(r,e))}a(u9a,"FromIntersect");function d9a(t,e){return t.map(r=>oSr(r,e))}a(d9a,"FromUnion");function f9a(t,e){let{[e]:r,...n}=t;return n}a(f9a,"FromProperty");function p9a(t,e){return e.reduce((r,n)=>f9a(r,n),t)}a(p9a,"FromProperties");function h9a(t,e,r){let n=(0,r9a.Discard)(t,[n9a.TransformKind,"$id","required","properties"]),o=p9a(r,e);return(0,hki.Object)(o,n)}a(h9a,"FromObject");function m9a(t){let e=t.reduce((r,n)=>(0,h6.IsLiteralValue)(n)?[...r,(0,i9a.Literal)(n)]:r,[]);return(0,pki.Union)(e)}a(m9a,"UnionFromPropertyKeys");function oSr(t,e){return(0,h6.IsIntersect)(t)?(0,s9a.Intersect)(u9a(t.allOf,e)):(0,h6.IsUnion)(t)?(0,pki.Union)(d9a(t.anyOf,e)):(0,h6.IsObject)(t)?h9a(t,e,t.properties):(0,hki.Object)({})}a(oSr,"OmitResolve");function g9a(t,e,r){let n=(0,l9a.IsArray)(e)?m9a(e):e,o=(0,h6.IsSchema)(e)?(0,o9a.IndexPropertyKeys)(e):e,s=(0,h6.IsRef)(t),c=(0,h6.IsRef)(e);return(0,h6.IsMappedResult)(t)?(0,c9a.OmitFromMappedResult)(t,o,r):(0,h6.IsMappedKey)(e)?(0,a9a.OmitFromMappedKey)(t,e,r):s&&c?(0,iSr.Computed)("Omit",[t,n],r):!s&&c?(0,iSr.Computed)("Omit",[t,n],r):s&&!c?(0,iSr.Computed)("Omit",[t,n],r):(0,t9a.CreateType)({...oSr(t,o),...r})}a(g9a,"Omit")});var aSr=I(cSr=>{"use strict";p();Object.defineProperty(cSr,"__esModule",{value:!0});cSr.OmitFromMappedKey=b9a;var A9a=bm(),y9a=pAt(),E9a=Yb();function _9a(t,e,r){return{[e]:(0,y9a.Omit)(t,[e],(0,E9a.Clone)(r))}}a(_9a,"FromPropertyKey");function v9a(t,e,r){return e.reduce((n,o)=>({...n,..._9a(t,o,r)}),{})}a(v9a,"FromPropertyKeys");function C9a(t,e,r){return v9a(t,e.keys,r)}a(C9a,"FromMappedKey");function b9a(t,e,r){let n=C9a(t,e,r);return(0,A9a.MappedResult)(n)}a(b9a,"OmitFromMappedKey")});var X5e=I(m6=>{"use strict";p();var S9a=m6&&m6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lSr=m6&&m6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&S9a(e,t,r)};Object.defineProperty(m6,"__esModule",{value:!0});lSr(aSr(),m6);lSr(nSr(),m6);lSr(pAt(),m6)});var dSr=I(uSr=>{"use strict";p();Object.defineProperty(uSr,"__esModule",{value:!0});uSr.PickFromMappedResult=k9a;var T9a=bm(),I9a=hAt(),x9a=Yb();function w9a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,I9a.Pick)(t[o],e,(0,x9a.Clone)(r));return n}a(w9a,"FromProperties");function R9a(t,e,r){return w9a(t.properties,e,r)}a(R9a,"FromMappedResult");function k9a(t,e,r){let n=R9a(t,e,r);return(0,T9a.MappedResult)(n)}a(k9a,"PickFromMappedResult")});var hAt=I(hSr=>{"use strict";p();Object.defineProperty(hSr,"__esModule",{value:!0});hSr.Pick=$9a;var P9a=Ii(),D9a=xgt(),fSr=FG(),N9a=tI(),M9a=UE(),mki=wv(),gki=Ip(),O9a=mD(),L9a=R5e(),g6=vs(),B9a=xv(),F9a=mSr(),U9a=dSr();function Q9a(t,e){return t.map(r=>pSr(r,e))}a(Q9a,"FromIntersect");function q9a(t,e){return t.map(r=>pSr(r,e))}a(q9a,"FromUnion");function j9a(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(j9a,"FromProperties");function H9a(t,e,r){let n=(0,D9a.Discard)(t,[L9a.TransformKind,"$id","required","properties"]),o=j9a(r,e);return(0,mki.Object)(o,n)}a(H9a,"FromObject");function G9a(t){let e=t.reduce((r,n)=>(0,g6.IsLiteralValue)(n)?[...r,(0,M9a.Literal)(n)]:r,[]);return(0,gki.Union)(e)}a(G9a,"UnionFromPropertyKeys");function pSr(t,e){return(0,g6.IsIntersect)(t)?(0,N9a.Intersect)(Q9a(t.allOf,e)):(0,g6.IsUnion)(t)?(0,gki.Union)(q9a(t.anyOf,e)):(0,g6.IsObject)(t)?H9a(t,e,t.properties):(0,mki.Object)({})}a(pSr,"PickResolve");function $9a(t,e,r){let n=(0,B9a.IsArray)(e)?G9a(e):e,o=(0,g6.IsSchema)(e)?(0,O9a.IndexPropertyKeys)(e):e,s=(0,g6.IsRef)(t),c=(0,g6.IsRef)(e);return(0,g6.IsMappedResult)(t)?(0,U9a.PickFromMappedResult)(t,o,r):(0,g6.IsMappedKey)(e)?(0,F9a.PickFromMappedKey)(t,e,r):s&&c?(0,fSr.Computed)("Pick",[t,n],r):!s&&c?(0,fSr.Computed)("Pick",[t,n],r):s&&!c?(0,fSr.Computed)("Pick",[t,n],r):(0,P9a.CreateType)({...pSr(t,o),...r})}a($9a,"Pick")});var mSr=I(gSr=>{"use strict";p();Object.defineProperty(gSr,"__esModule",{value:!0});gSr.PickFromMappedKey=Z9a;var V9a=bm(),W9a=hAt(),z9a=Yb();function Y9a(t,e,r){return{[e]:(0,W9a.Pick)(t,[e],(0,z9a.Clone)(r))}}a(Y9a,"FromPropertyKey");function K9a(t,e,r){return e.reduce((n,o)=>({...n,...Y9a(t,o,r)}),{})}a(K9a,"FromPropertyKeys");function J9a(t,e,r){return K9a(t,e.keys,r)}a(J9a,"FromMappedKey");function Z9a(t,e,r){let n=J9a(t,e,r);return(0,V9a.MappedResult)(n)}a(Z9a,"PickFromMappedKey")});var e4e=I(A6=>{"use strict";p();var X9a=A6&&A6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ASr=A6&&A6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&X9a(e,t,r)};Object.defineProperty(A6,"__esModule",{value:!0});ASr(mSr(),A6);ASr(dSr(),A6);ASr(hAt(),A6)});var ESr=I(y6=>{"use strict";p();var eUa=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]})),tUa=y6&&y6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rUa=y6&&y6.__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;oEki(e))}a(Aki,"FromRest");function Eki(t){return kv.IsComputed(t)?dUa(t.target,t.parameters):kv.IsRef(t)?fUa(t.$ref):kv.IsIntersect(t)?(0,oUa.Intersect)(Aki(t.allOf)):kv.IsUnion(t)?(0,sUa.Union)(Aki(t.anyOf)):kv.IsObject(t)?hUa(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,yki.Object)({})}a(Eki,"PartialResolve");function mUa(t,e){return kv.IsMappedResult(t)?(0,uUa.PartialFromMappedResult)(t,e):(0,nUa.CreateType)({...Eki(t),...e})}a(mUa,"Partial")});var _Sr=I(vSr=>{"use strict";p();Object.defineProperty(vSr,"__esModule",{value:!0});vSr.PartialFromMappedResult=vUa;var gUa=bm(),AUa=ESr(),yUa=Yb();function EUa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,AUa.Partial)(t[n],(0,yUa.Clone)(e));return r}a(EUa,"FromProperties");function _Ua(t,e){return EUa(t.properties,e)}a(_Ua,"FromMappedResult");function vUa(t,e){let r=_Ua(t,e);return(0,gUa.MappedResult)(r)}a(vUa,"PartialFromMappedResult")});var t4e=I(zG=>{"use strict";p();var CUa=zG&&zG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_ki=zG&&zG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CUa(e,t,r)};Object.defineProperty(zG,"__esModule",{value:!0});_ki(_Sr(),zG);_ki(ESr(),zG)});var bSr=I(E6=>{"use strict";p();var bUa=E6&&E6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SUa=E6&&E6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),TUa=E6&&E6.__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;oTki(e))}a(vki,"FromRest");function Tki(t){return Pv.IsComputed(t)?PUa(t.target,t.parameters):Pv.IsRef(t)?DUa(t.$ref):Pv.IsIntersect(t)?(0,xUa.Intersect)(vki(t.allOf)):Pv.IsUnion(t)?(0,wUa.Union)(vki(t.anyOf)):Pv.IsObject(t)?MUa(t,t.properties):Pv.IsBigInt(t)||Pv.IsBoolean(t)||Pv.IsInteger(t)||Pv.IsLiteral(t)||Pv.IsNull(t)||Pv.IsNumber(t)||Pv.IsString(t)||Pv.IsSymbol(t)||Pv.IsUndefined(t)?t:(0,Cki.Object)({})}a(Tki,"RequiredResolve");function OUa(t,e){return Pv.IsMappedResult(t)?(0,kUa.RequiredFromMappedResult)(t,e):(0,IUa.CreateType)({...Tki(t),...e})}a(OUa,"Required")});var SSr=I(TSr=>{"use strict";p();Object.defineProperty(TSr,"__esModule",{value:!0});TSr.RequiredFromMappedResult=QUa;var LUa=bm(),BUa=bSr();function FUa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,BUa.Required)(t[n],e);return r}a(FUa,"FromProperties");function UUa(t,e){return FUa(t.properties,e)}a(UUa,"FromMappedResult");function QUa(t,e){let r=UUa(t,e);return(0,LUa.MappedResult)(r)}a(QUa,"RequiredFromMappedResult")});var r4e=I(YG=>{"use strict";p();var qUa=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]})),Iki=YG&&YG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qUa(e,t,r)};Object.defineProperty(YG,"__esModule",{value:!0});Iki(SSr(),YG);Iki(bSr(),YG)});var kki=I(ED=>{"use strict";p();var jUa=ED&&ED.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HUa=ED&&ED.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),GUa=ED&&ED.__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;omy.IsRef(r)?xSr(t,r.$ref):n1(t,r))}a(c7a,"DereferenceParameters");function xSr(t,e){return e in t?my.IsRef(t[e])?xSr(t,t[e].$ref):n1(t,t[e]):(0,ISr.Never)()}a(xSr,"Dereference");function l7a(t){return(0,WUa.Awaited)(t[0])}a(l7a,"FromAwaited");function u7a(t){return(0,KUa.Index)(t[0],t[1])}a(u7a,"FromIndex");function d7a(t){return(0,e7a.KeyOf)(t[0])}a(d7a,"FromKeyOf");function f7a(t){return(0,i7a.Partial)(t[0])}a(f7a,"FromPartial");function p7a(t){return(0,r7a.Omit)(t[0],t[1])}a(p7a,"FromOmit");function h7a(t){return(0,n7a.Pick)(t[0],t[1])}a(h7a,"FromPick");function m7a(t){return(0,o7a.Required)(t[0])}a(m7a,"FromRequired");function g7a(t,e,r){let n=c7a(t,r);return e==="Awaited"?l7a(n):e==="Index"?u7a(n):e==="KeyOf"?d7a(n):e==="Partial"?f7a(n):e==="Omit"?p7a(n):e==="Pick"?h7a(n):e==="Required"?m7a(n):(0,ISr.Never)()}a(g7a,"FromComputed");function A7a(t,e){return(0,VUa.Array)(n1(t,e))}a(A7a,"FromArray");function y7a(t,e){return(0,zUa.AsyncIterator)(n1(t,e))}a(y7a,"FromAsyncIterator");function E7a(t,e,r){return(0,YUa.Constructor)(n4e(t,e),n1(t,r))}a(E7a,"FromConstructor");function _7a(t,e,r){return(0,JUa.Function)(n4e(t,e),n1(t,r))}a(_7a,"FromFunction");function v7a(t,e){return(0,ZUa.Intersect)(n4e(t,e))}a(v7a,"FromIntersect");function C7a(t,e){return(0,XUa.Iterator)(n1(t,e))}a(C7a,"FromIterator");function b7a(t,e){return(0,t7a.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:n1(t,e[n])}),{}))}a(b7a,"FromObject");function S7a(t,e){let[r,n]=[n1(t,(0,wki.RecordValue)(e)),(0,wki.RecordPattern)(e)],o=(0,$Ua.CloneType)(e);return o.patternProperties[n]=r,o}a(S7a,"FromRecord");function T7a(t,e){return my.IsRef(e)?{...xSr(t,e.$ref),[mAt.TransformKind]:e[mAt.TransformKind]}:e}a(T7a,"FromTransform");function I7a(t,e){return(0,s7a.Tuple)(n4e(t,e))}a(I7a,"FromTuple");function x7a(t,e){return(0,a7a.Union)(n4e(t,e))}a(x7a,"FromUnion");function n4e(t,e){return e.map(r=>n1(t,r))}a(n4e,"FromTypes");function n1(t,e){return my.IsOptional(e)?(0,r1.CreateType)(n1(t,(0,xki.Discard)(e,[mAt.OptionalKind])),e):my.IsReadonly(e)?(0,r1.CreateType)(n1(t,(0,xki.Discard)(e,[mAt.ReadonlyKind])),e):my.IsTransform(e)?(0,r1.CreateType)(T7a(t,e),e):my.IsArray(e)?(0,r1.CreateType)(A7a(t,e.items),e):my.IsAsyncIterator(e)?(0,r1.CreateType)(y7a(t,e.items),e):my.IsComputed(e)?(0,r1.CreateType)(g7a(t,e.target,e.parameters)):my.IsConstructor(e)?(0,r1.CreateType)(E7a(t,e.parameters,e.returns),e):my.IsFunction(e)?(0,r1.CreateType)(_7a(t,e.parameters,e.returns),e):my.IsIntersect(e)?(0,r1.CreateType)(v7a(t,e.allOf),e):my.IsIterator(e)?(0,r1.CreateType)(C7a(t,e.items),e):my.IsObject(e)?(0,r1.CreateType)(b7a(t,e.properties),e):my.IsRecord(e)?(0,r1.CreateType)(S7a(t,e)):my.IsTuple(e)?(0,r1.CreateType)(I7a(t,e.items||[]),e):my.IsUnion(e)?(0,r1.CreateType)(x7a(t,e.anyOf),e):e}a(n1,"FromType");function Rki(t,e){return e in t?n1(t,t[e]):(0,ISr.Never)()}a(Rki,"ComputeType");function w7a(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:Rki(t,r)}),{})}a(w7a,"ComputeModuleProperties")});var Dki=I(i4e=>{"use strict";p();Object.defineProperty(i4e,"__esModule",{value:!0});i4e.TModule=void 0;i4e.Module=P7a;var Pki=r6(),R7a=Sn(),k7a=kki(),gAt=class{static{a(this,"TModule")}constructor(e){let r=(0,k7a.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,Pki.CreateType)(this.$defs[e],r)};return(0,Pki.CreateType)({[R7a.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};i4e.TModule=gAt;function P7a(t){return new gAt(t)}a(P7a,"Module")});var AAt=I(Ere=>{"use strict";p();var D7a=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]})),N7a=Ere&&Ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&D7a(e,t,r)};Object.defineProperty(Ere,"__esModule",{value:!0});N7a(Dki(),Ere)});var Nki=I(wSr=>{"use strict";p();Object.defineProperty(wSr,"__esModule",{value:!0});wSr.Not=L7a;var M7a=Ii(),O7a=Sn();function L7a(t,e){return(0,M7a.CreateType)({[O7a.Kind]:"Not",not:t},e)}a(L7a,"Not")});var yAt=I(_re=>{"use strict";p();var B7a=_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]})),F7a=_re&&_re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&B7a(e,t,r)};Object.defineProperty(_re,"__esModule",{value:!0});F7a(Nki(),_re)});var Mki=I(_6=>{"use strict";p();var U7a=_6&&_6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Q7a=_6&&_6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),q7a=_6&&_6.__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 V7a=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]})),W7a=vre&&vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V7a(e,t,r)};Object.defineProperty(vre,"__esModule",{value:!0});W7a(Mki(),vre)});var Lki=I(RSr=>{"use strict";p();Object.defineProperty(RSr,"__esModule",{value:!0});RSr.Recursive=Z7a;var z7a=Egt(),Y7a=Ii(),K7a=xv(),Oki=Sn(),J7a=0;function Z7a(t,e={}){(0,K7a.IsUndefined)(e.$id)&&(e.$id=`T${J7a++}`);let r=(0,z7a.CloneType)(t({[Oki.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,Y7a.CreateType)({[Oki.Hint]:"Recursive",...r},e)}a(Z7a,"Recursive")});var _At=I(Cre=>{"use strict";p();var X7a=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]})),eQa=Cre&&Cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&X7a(e,t,r)};Object.defineProperty(Cre,"__esModule",{value:!0});eQa(Lki(),Cre)});var Bki=I(kSr=>{"use strict";p();Object.defineProperty(kSr,"__esModule",{value:!0});kSr.RegExp=iQa;var tQa=Ii(),rQa=xv(),nQa=Sn();function iQa(t,e){let r=(0,rQa.IsString)(t)?new globalThis.RegExp(t):t;return(0,tQa.CreateType)({[nQa.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(iQa,"RegExp")});var vAt=I(bre=>{"use strict";p();var oQa=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]})),sQa=bre&&bre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oQa(e,t,r)};Object.defineProperty(bre,"__esModule",{value:!0});sQa(Bki(),bre)});var Fki=I(DSr=>{"use strict";p();Object.defineProperty(DSr,"__esModule",{value:!0});DSr.Rest=cQa;var PSr=vs();function aQa(t){return(0,PSr.IsIntersect)(t)?t.allOf:(0,PSr.IsUnion)(t)?t.anyOf:(0,PSr.IsTuple)(t)?t.items??[]:[]}a(aQa,"RestResolve");function cQa(t){return aQa(t)}a(cQa,"Rest")});var CAt=I(Sre=>{"use strict";p();var lQa=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]})),uQa=Sre&&Sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lQa(e,t,r)};Object.defineProperty(Sre,"__esModule",{value:!0});uQa(Fki(),Sre)});var Uki=I(v6=>{"use strict";p();var dQa=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]})),fQa=v6&&v6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pQa=v6&&v6.__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 yQa=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]})),EQa=Tre&&Tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yQa(e,t,r)};Object.defineProperty(Tre,"__esModule",{value:!0});EQa(Uki(),Tre)});var qki=I(Qki=>{"use strict";p();Object.defineProperty(Qki,"__esModule",{value:!0})});var Hki=I(jki=>{"use strict";p();Object.defineProperty(jki,"__esModule",{value:!0});var U2p=Sn()});var $ki=I(KG=>{"use strict";p();var _Qa=KG&&KG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gki=KG&&KG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Qa(e,t,r)};Object.defineProperty(KG,"__esModule",{value:!0});Gki(qki(),KG);Gki(Hki(),KG)});var Wki=I(Vki=>{"use strict";p();Object.defineProperty(Vki,"__esModule",{value:!0})});var zki=I(Ire=>{"use strict";p();var vQa=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]})),CQa=Ire&&Ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vQa(e,t,r)};Object.defineProperty(Ire,"__esModule",{value:!0});CQa(Wki(),Ire)});var Yki=I(xre=>{"use strict";p();Object.defineProperty(xre,"__esModule",{value:!0});xre.TransformEncodeBuilder=xre.TransformDecodeBuilder=void 0;xre.Transform=SQa;var SAt=Sn(),bQa=vs(),TAt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new IAt(this.schema,e)}};xre.TransformDecodeBuilder=TAt;var IAt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[SAt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[SAt.TransformKind].Decode(c)),"Decode")};return{...r,[SAt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[SAt.TransformKind]:n}}Encode(e){return(0,bQa.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};xre.TransformEncodeBuilder=IAt;function SQa(t){return new TAt(t)}a(SQa,"Transform")});var xAt=I(wre=>{"use strict";p();var TQa=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]})),IQa=wre&&wre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TQa(e,t,r)};Object.defineProperty(wre,"__esModule",{value:!0});IQa(Yki(),wre)});var Jki=I(NSr=>{"use strict";p();Object.defineProperty(NSr,"__esModule",{value:!0});NSr.Unsafe=wQa;var xQa=Ii(),Kki=Sn();function wQa(t={}){return(0,xQa.CreateType)({[Kki.Kind]:t[Kki.Kind]??"Unsafe"},t)}a(wQa,"Unsafe")});var o4e=I(Rre=>{"use strict";p();var RQa=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]})),kQa=Rre&&Rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&RQa(e,t,r)};Object.defineProperty(Rre,"__esModule",{value:!0});kQa(Jki(),Rre)});var Zki=I(MSr=>{"use strict";p();Object.defineProperty(MSr,"__esModule",{value:!0});MSr.Void=NQa;var PQa=Ii(),DQa=Sn();function NQa(t){return(0,PQa.CreateType)({[DQa.Kind]:"Void",type:"void"},t)}a(NQa,"Void")});var wAt=I(kre=>{"use strict";p();var MQa=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]})),OQa=kre&&kre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MQa(e,t,r)};Object.defineProperty(kre,"__esModule",{value:!0});OQa(Zki(),kre)});var LSr=I(kAt=>{"use strict";p();Object.defineProperty(kAt,"__esModule",{value:!0});kAt.JsonTypeBuilder=void 0;var LQa=$ge(),BQa=Vge(),FQa=B5e(),UQa=Ggt(),QQa=Vgt(),qQa=zgt(),jQa=nAt(),HQa=ure(),GQa=sAt(),$Qa=mD(),VQa=lAt(),WQa=tI(),RAt=fAt(),zQa=gD(),YQa=UE(),KQa=bm(),JQa=Cm(),ZQa=yAt(),XQa=W5e(),eqa=AAt(),tqa=QG(),rqa=wv(),nqa=X5e(),iqa=G4(),oqa=t4e(),sqa=e4e(),aqa=GG(),cqa=Z5e(),lqa=oAe(),uqa=_At(),dqa=VG(),fqa=r4e(),pqa=CAt(),hqa=qG(),mqa=hD(),gqa=xAt(),Aqa=a6(),yqa=Ip(),Eqa=WG(),_qa=o4e(),OSr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,cqa.ReadonlyOptional)(e)}Readonly(e,r){return(0,aqa.Readonly)(e,r??!0)}Optional(e,r){return(0,iqa.Optional)(e,r??!0)}Any(e){return(0,LQa.Any)(e)}Array(e,r){return(0,BQa.Array)(e,r)}Boolean(e){return(0,FQa.Boolean)(e)}Capitalize(e,r){return(0,RAt.Capitalize)(e,r)}Composite(e,r){return(0,UQa.Composite)(e,r)}Const(e,r){return(0,QQa.Const)(e,r)}Enum(e,r){return(0,qQa.Enum)(e,r)}Exclude(e,r,n){return(0,jQa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,HQa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,GQa.Extract)(e,r,n)}Index(e,r,n){return(0,$Qa.Index)(e,r,n)}Integer(e){return(0,VQa.Integer)(e)}Intersect(e,r){return(0,WQa.Intersect)(e,r)}KeyOf(e,r){return(0,zQa.KeyOf)(e,r)}Literal(e,r){return(0,YQa.Literal)(e,r)}Lowercase(e,r){return(0,RAt.Lowercase)(e,r)}Mapped(e,r,n){return(0,KQa.Mapped)(e,r,n)}Module(e){return(0,eqa.Module)(e)}Never(e){return(0,JQa.Never)(e)}Not(e,r){return(0,ZQa.Not)(e,r)}Null(e){return(0,XQa.Null)(e)}Number(e){return(0,tqa.Number)(e)}Object(e,r){return(0,rqa.Object)(e,r)}Omit(e,r,n){return(0,nqa.Omit)(e,r,n)}Partial(e,r){return(0,oqa.Partial)(e,r)}Pick(e,r,n){return(0,sqa.Pick)(e,r,n)}Record(e,r,n){return(0,lqa.Record)(e,r,n)}Recursive(e,r){return(0,uqa.Recursive)(e,r)}Ref(...e){return(0,dqa.Ref)(e[0],e[1])}Required(e,r){return(0,fqa.Required)(e,r)}Rest(e){return(0,pqa.Rest)(e)}String(e){return(0,hqa.String)(e)}TemplateLiteral(e,r){return(0,mqa.TemplateLiteral)(e,r)}Transform(e){return(0,gqa.Transform)(e)}Tuple(e,r){return(0,Aqa.Tuple)(e,r)}Uncapitalize(e,r){return(0,RAt.Uncapitalize)(e,r)}Union(e,r){return(0,yqa.Union)(e,r)}Unknown(e){return(0,Eqa.Unknown)(e)}Unsafe(e){return(0,_qa.Unsafe)(e)}Uppercase(e,r){return(0,RAt.Uppercase)(e,r)}};kAt.JsonTypeBuilder=OSr});var Xki=I(Ot=>{"use strict";p();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.Rest=Ot.Required=Ot.RegExp=Ot.Ref=Ot.Recursive=Ot.Record=Ot.ReadonlyOptional=Ot.Readonly=Ot.Promise=Ot.Pick=Ot.Partial=Ot.Parameters=Ot.Optional=Ot.Omit=Ot.Object=Ot.Number=Ot.Null=Ot.Not=Ot.Never=Ot.Module=Ot.Mapped=Ot.Literal=Ot.KeyOf=Ot.Iterator=Ot.Uppercase=Ot.Lowercase=Ot.Uncapitalize=Ot.Capitalize=Ot.Intersect=Ot.Integer=Ot.Instantiate=Ot.InstanceType=Ot.Index=Ot.Function=Ot.Extract=Ot.Extends=Ot.Exclude=Ot.Enum=Ot.Date=Ot.ConstructorParameters=Ot.Constructor=Ot.Const=Ot.Composite=Ot.Boolean=Ot.BigInt=Ot.Awaited=Ot.AsyncIterator=Ot.Array=Ot.Argument=Ot.Any=void 0;Ot.Void=Ot.Unsafe=Ot.Unknown=Ot.Union=Ot.Undefined=Ot.Uint8Array=Ot.Tuple=Ot.Transform=Ot.TemplateLiteral=Ot.Symbol=Ot.String=Ot.ReturnType=void 0;var vqa=$ge();Object.defineProperty(Ot,"Any",{enumerable:!0,get:a(function(){return vqa.Any},"get")});var Cqa=Igt();Object.defineProperty(Ot,"Argument",{enumerable:!0,get:a(function(){return Cqa.Argument},"get")});var bqa=Vge();Object.defineProperty(Ot,"Array",{enumerable:!0,get:a(function(){return bqa.Array},"get")});var Sqa=Wge();Object.defineProperty(Ot,"AsyncIterator",{enumerable:!0,get:a(function(){return Sqa.AsyncIterator},"get")});var Tqa=$5e();Object.defineProperty(Ot,"Awaited",{enumerable:!0,get:a(function(){return Tqa.Awaited},"get")});var Iqa=Zge();Object.defineProperty(Ot,"BigInt",{enumerable:!0,get:a(function(){return Iqa.BigInt},"get")});var xqa=B5e();Object.defineProperty(Ot,"Boolean",{enumerable:!0,get:a(function(){return xqa.Boolean},"get")});var wqa=Ggt();Object.defineProperty(Ot,"Composite",{enumerable:!0,get:a(function(){return wqa.Composite},"get")});var Rqa=Vgt();Object.defineProperty(Ot,"Const",{enumerable:!0,get:a(function(){return Rqa.Const},"get")});var kqa=zge();Object.defineProperty(Ot,"Constructor",{enumerable:!0,get:a(function(){return kqa.Constructor},"get")});var Pqa=Wgt();Object.defineProperty(Ot,"ConstructorParameters",{enumerable:!0,get:a(function(){return Pqa.ConstructorParameters},"get")});var Dqa=V5e();Object.defineProperty(Ot,"Date",{enumerable:!0,get:a(function(){return Dqa.Date},"get")});var Nqa=zgt();Object.defineProperty(Ot,"Enum",{enumerable:!0,get:a(function(){return Nqa.Enum},"get")});var Mqa=nAt();Object.defineProperty(Ot,"Exclude",{enumerable:!0,get:a(function(){return Mqa.Exclude},"get")});var Oqa=ure();Object.defineProperty(Ot,"Extends",{enumerable:!0,get:a(function(){return Oqa.Extends},"get")});var Lqa=sAt();Object.defineProperty(Ot,"Extract",{enumerable:!0,get:a(function(){return Lqa.Extract},"get")});var Bqa=UG();Object.defineProperty(Ot,"Function",{enumerable:!0,get:a(function(){return Bqa.Function},"get")});var Fqa=mD();Object.defineProperty(Ot,"Index",{enumerable:!0,get:a(function(){return Fqa.Index},"get")});var Uqa=aAt();Object.defineProperty(Ot,"InstanceType",{enumerable:!0,get:a(function(){return Uqa.InstanceType},"get")});var Qqa=cAt();Object.defineProperty(Ot,"Instantiate",{enumerable:!0,get:a(function(){return Qqa.Instantiate},"get")});var qqa=lAt();Object.defineProperty(Ot,"Integer",{enumerable:!0,get:a(function(){return qqa.Integer},"get")});var jqa=tI();Object.defineProperty(Ot,"Intersect",{enumerable:!0,get:a(function(){return jqa.Intersect},"get")});var PAt=fAt();Object.defineProperty(Ot,"Capitalize",{enumerable:!0,get:a(function(){return PAt.Capitalize},"get")});Object.defineProperty(Ot,"Uncapitalize",{enumerable:!0,get:a(function(){return PAt.Uncapitalize},"get")});Object.defineProperty(Ot,"Lowercase",{enumerable:!0,get:a(function(){return PAt.Lowercase},"get")});Object.defineProperty(Ot,"Uppercase",{enumerable:!0,get:a(function(){return PAt.Uppercase},"get")});var Hqa=eAe();Object.defineProperty(Ot,"Iterator",{enumerable:!0,get:a(function(){return Hqa.Iterator},"get")});var Gqa=gD();Object.defineProperty(Ot,"KeyOf",{enumerable:!0,get:a(function(){return Gqa.KeyOf},"get")});var $qa=UE();Object.defineProperty(Ot,"Literal",{enumerable:!0,get:a(function(){return $qa.Literal},"get")});var Vqa=bm();Object.defineProperty(Ot,"Mapped",{enumerable:!0,get:a(function(){return Vqa.Mapped},"get")});var Wqa=AAt();Object.defineProperty(Ot,"Module",{enumerable:!0,get:a(function(){return Wqa.Module},"get")});var zqa=Cm();Object.defineProperty(Ot,"Never",{enumerable:!0,get:a(function(){return zqa.Never},"get")});var Yqa=yAt();Object.defineProperty(Ot,"Not",{enumerable:!0,get:a(function(){return Yqa.Not},"get")});var Kqa=W5e();Object.defineProperty(Ot,"Null",{enumerable:!0,get:a(function(){return Kqa.Null},"get")});var Jqa=QG();Object.defineProperty(Ot,"Number",{enumerable:!0,get:a(function(){return Jqa.Number},"get")});var Zqa=wv();Object.defineProperty(Ot,"Object",{enumerable:!0,get:a(function(){return Zqa.Object},"get")});var Xqa=X5e();Object.defineProperty(Ot,"Omit",{enumerable:!0,get:a(function(){return Xqa.Omit},"get")});var eja=G4();Object.defineProperty(Ot,"Optional",{enumerable:!0,get:a(function(){return eja.Optional},"get")});var tja=EAt();Object.defineProperty(Ot,"Parameters",{enumerable:!0,get:a(function(){return tja.Parameters},"get")});var rja=t4e();Object.defineProperty(Ot,"Partial",{enumerable:!0,get:a(function(){return rja.Partial},"get")});var nja=e4e();Object.defineProperty(Ot,"Pick",{enumerable:!0,get:a(function(){return nja.Pick},"get")});var ija=j5e();Object.defineProperty(Ot,"Promise",{enumerable:!0,get:a(function(){return ija.Promise},"get")});var oja=GG();Object.defineProperty(Ot,"Readonly",{enumerable:!0,get:a(function(){return oja.Readonly},"get")});var sja=Z5e();Object.defineProperty(Ot,"ReadonlyOptional",{enumerable:!0,get:a(function(){return sja.ReadonlyOptional},"get")});var aja=oAe();Object.defineProperty(Ot,"Record",{enumerable:!0,get:a(function(){return aja.Record},"get")});var cja=_At();Object.defineProperty(Ot,"Recursive",{enumerable:!0,get:a(function(){return cja.Recursive},"get")});var lja=VG();Object.defineProperty(Ot,"Ref",{enumerable:!0,get:a(function(){return lja.Ref},"get")});var uja=vAt();Object.defineProperty(Ot,"RegExp",{enumerable:!0,get:a(function(){return uja.RegExp},"get")});var dja=r4e();Object.defineProperty(Ot,"Required",{enumerable:!0,get:a(function(){return dja.Required},"get")});var fja=CAt();Object.defineProperty(Ot,"Rest",{enumerable:!0,get:a(function(){return fja.Rest},"get")});var pja=bAt();Object.defineProperty(Ot,"ReturnType",{enumerable:!0,get:a(function(){return pja.ReturnType},"get")});var hja=qG();Object.defineProperty(Ot,"String",{enumerable:!0,get:a(function(){return hja.String},"get")});var mja=z5e();Object.defineProperty(Ot,"Symbol",{enumerable:!0,get:a(function(){return mja.Symbol},"get")});var gja=hD();Object.defineProperty(Ot,"TemplateLiteral",{enumerable:!0,get:a(function(){return gja.TemplateLiteral},"get")});var Aja=xAt();Object.defineProperty(Ot,"Transform",{enumerable:!0,get:a(function(){return Aja.Transform},"get")});var yja=a6();Object.defineProperty(Ot,"Tuple",{enumerable:!0,get:a(function(){return yja.Tuple},"get")});var Eja=K5e();Object.defineProperty(Ot,"Uint8Array",{enumerable:!0,get:a(function(){return Eja.Uint8Array},"get")});var _ja=Y5e();Object.defineProperty(Ot,"Undefined",{enumerable:!0,get:a(function(){return _ja.Undefined},"get")});var vja=Ip();Object.defineProperty(Ot,"Union",{enumerable:!0,get:a(function(){return vja.Union},"get")});var Cja=WG();Object.defineProperty(Ot,"Unknown",{enumerable:!0,get:a(function(){return Cja.Unknown},"get")});var bja=o4e();Object.defineProperty(Ot,"Unsafe",{enumerable:!0,get:a(function(){return bja.Unsafe},"get")});var Sja=wAt();Object.defineProperty(Ot,"Void",{enumerable:!0,get:a(function(){return Sja.Void},"get")})});var ePi=I(DAt=>{"use strict";p();Object.defineProperty(DAt,"__esModule",{value:!0});DAt.JavaScriptTypeBuilder=void 0;var Tja=LSr(),Ija=Igt(),xja=Wge(),wja=$5e(),Rja=Zge(),kja=zge(),Pja=Wgt(),Dja=V5e(),Nja=UG(),Mja=aAt(),Oja=cAt(),Lja=eAe(),Bja=EAt(),Fja=j5e(),Uja=vAt(),Qja=bAt(),qja=z5e(),jja=K5e(),Hja=Y5e(),Gja=wAt(),BSr=class extends Tja.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,Ija.Argument)(e)}AsyncIterator(e,r){return(0,xja.AsyncIterator)(e,r)}Awaited(e,r){return(0,wja.Awaited)(e,r)}BigInt(e){return(0,Rja.BigInt)(e)}ConstructorParameters(e,r){return(0,Pja.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,kja.Constructor)(e,r,n)}Date(e={}){return(0,Dja.Date)(e)}Function(e,r,n){return(0,Nja.Function)(e,r,n)}InstanceType(e,r){return(0,Mja.InstanceType)(e,r)}Instantiate(e,r){return(0,Oja.Instantiate)(e,r)}Iterator(e,r){return(0,Lja.Iterator)(e,r)}Parameters(e,r){return(0,Bja.Parameters)(e,r)}Promise(e,r){return(0,Fja.Promise)(e,r)}RegExp(e,r){return(0,Uja.RegExp)(e,r)}ReturnType(e,r){return(0,Qja.ReturnType)(e,r)}Symbol(e){return(0,qja.Symbol)(e)}Undefined(e){return(0,Hja.Undefined)(e)}Uint8Array(e){return(0,jja.Uint8Array)(e)}Void(e){return(0,Gja.Void)(e)}};DAt.JavaScriptTypeBuilder=BSr});var tPi=I(i1=>{"use strict";p();var $ja=i1&&i1.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=i1&&i1.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Wja=i1&&i1.__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 Zja=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]})),yn=en&&en.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zja(e,t,r)};Object.defineProperty(en,"__esModule",{value:!0});yn(xCr(),en);yn(r6(),en);yn(Nf(),en);yn(LCr(),en);yn(rwi(),en);yn(N5e(),en);yn(Gge(),en);yn(M5e(),en);yn(Sn(),en);yn($ge(),en);yn(Vge(),en);yn(Igt(),en);yn(Wge(),en);yn($5e(),en);yn(Zge(),en);yn(B5e(),en);yn(Ggt(),en);yn(Vgt(),en);yn(zge(),en);yn(Wgt(),en);yn(V5e(),en);yn(zgt(),en);yn(nAt(),en);yn(ure(),en);yn(sAt(),en);yn(UG(),en);yn(mD(),en);yn(aAt(),en);yn(cAt(),en);yn(lAt(),en);yn(tI(),en);yn(eAe(),en);yn(fAt(),en);yn(gD(),en);yn(UE(),en);yn(AAt(),en);yn(bm(),en);yn(Cm(),en);yn(yAt(),en);yn(W5e(),en);yn(QG(),en);yn(wv(),en);yn(X5e(),en);yn(G4(),en);yn(EAt(),en);yn(t4e(),en);yn(e4e(),en);yn(j5e(),en);yn(GG(),en);yn(Z5e(),en);yn(oAe(),en);yn(_At(),en);yn(VG(),en);yn(vAt(),en);yn(r4e(),en);yn(CAt(),en);yn(bAt(),en);yn($ki(),en);yn(zki(),en);yn(qG(),en);yn(z5e(),en);yn(hD(),en);yn(xAt(),en);yn(a6(),en);yn(K5e(),en);yn(Y5e(),en);yn(Ip(),en);yn(WG(),en);yn(o4e(),en);yn(wAt(),en);yn(tPi(),en)});var nPi=I(NR=>{"use strict";p();var Xja=NR&&NR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eHa=NR&&NR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),tHa=NR&&NR.__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 nHa=Y4&&Y4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),iHa=Y4&&Y4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oHa=Y4&&Y4.__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(MAt,"__esModule",{value:!0});MAt.ContextItemOrigin=void 0;var sPi;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(sPi||(MAt.ContextItemOrigin=sPi={}))});var lPi=I(Nu=>{"use strict";p();Object.defineProperty(Nu,"__esModule",{value:!0});Nu.RangeSchema=Nu.WorkspaceFolder=Nu.VersionedTextDocumentIdentifier=Nu.TextEdit=Nu.TextDocumentItem=Nu.Range=Nu.Position=Nu.DocumentUri=Nu.Disposable=Nu.Command=Nu.CancellationTokenSource=Nu.CancellationToken=void 0;var OAt=NAt(),_D=ti();Object.defineProperty(Nu,"CancellationToken",{enumerable:!0,get:a(function(){return _D.CancellationToken},"get")});Object.defineProperty(Nu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return _D.CancellationTokenSource},"get")});Object.defineProperty(Nu,"Command",{enumerable:!0,get:a(function(){return _D.Command},"get")});Object.defineProperty(Nu,"Disposable",{enumerable:!0,get:a(function(){return _D.Disposable},"get")});Object.defineProperty(Nu,"DocumentUri",{enumerable:!0,get:a(function(){return _D.DocumentUri},"get")});Object.defineProperty(Nu,"Position",{enumerable:!0,get:a(function(){return _D.Position},"get")});Object.defineProperty(Nu,"Range",{enumerable:!0,get:a(function(){return _D.Range},"get")});Object.defineProperty(Nu,"TextDocumentItem",{enumerable:!0,get:a(function(){return _D.TextDocumentItem},"get")});Object.defineProperty(Nu,"TextEdit",{enumerable:!0,get:a(function(){return _D.TextEdit},"get")});Object.defineProperty(Nu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return _D.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(Nu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return _D.WorkspaceFolder},"get")});var cPi=OAt.Type.Object({line:OAt.Type.Integer({minimum:0}),character:OAt.Type.Integer({minimum:0})});Nu.RangeSchema=OAt.Type.Object({start:cPi,end:cPi})});var dPi=I(uPi=>{"use strict";p();Object.defineProperty(uPi,"__esModule",{value:!0})});var a4e=I(Mf=>{"use strict";p();var aHa=Mf&&Mf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),s4e=Mf&&Mf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&aHa(e,t,r)};Object.defineProperty(Mf,"__esModule",{value:!0});Mf.TextEdit=Mf.Range=Mf.Position=Mf.Disposable=Mf.CancellationTokenSource=Mf.CancellationToken=void 0;var cAe=ti();Object.defineProperty(Mf,"CancellationToken",{enumerable:!0,get:a(function(){return cAe.CancellationToken},"get")});Object.defineProperty(Mf,"CancellationTokenSource",{enumerable:!0,get:a(function(){return cAe.CancellationTokenSource},"get")});Object.defineProperty(Mf,"Disposable",{enumerable:!0,get:a(function(){return cAe.Disposable},"get")});Object.defineProperty(Mf,"Position",{enumerable:!0,get:a(function(){return cAe.Position},"get")});Object.defineProperty(Mf,"Range",{enumerable:!0,get:a(function(){return cAe.Range},"get")});Object.defineProperty(Mf,"TextEdit",{enumerable:!0,get:a(function(){return cAe.TextEdit},"get")});s4e(nPi(),Mf);s4e(oPi(),Mf);s4e(aPi(),Mf);s4e(lPi(),Mf);s4e(dPi(),Mf)});var USr=I(rI=>{"use strict";p();var cHa=rI&&rI.__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},fPi=rI&&rI.__param||function(t,e){return function(r,n){e(r,n,t)}},lHa=rI&&rI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rI,"__esModule",{value:!0});rI.CompletionNotifier=rI.ICompletionsNotifierService=void 0;var uHa=lHa(require("events")),dHa=nn(),fHa=bte(),pHa=a4e(),hHa=$g(),mHa=C5e(),LAt="CompletionRequested";rI.ICompletionsNotifierService=(0,dHa.createServiceIdentifier)("ICompletionsNotifierService");var FSr=class{static{a(this,"CompletionNotifier")}#e=new uHa.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(LAt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,hHa.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${LAt}`);return this.#e.on(LAt,r),pHa.Disposable.create(()=>this.#e.off(LAt,r))}};rI.CompletionNotifier=FSr;rI.CompletionNotifier=FSr=cHa([fPi(0,mHa.ICompletionsPromiseQueueService),fPi(1,fHa.ICompletionsTelemetryService)],FSr)});var QSr=I(BAt=>{"use strict";p();Object.defineProperty(BAt,"__esModule",{value:!0});BAt.ICompletionsObservableWorkspace=void 0;var gHa=Gs();BAt.ICompletionsObservableWorkspace=(0,gHa.createDecorator)("ICompletionsObservableWorkspace")});var Dl=I(vD=>{"use strict";p();Object.defineProperty(vD,"__esModule",{value:!0});vD.logger=vD.Logger=vD.ICompletionsLogTargetService=vD.LogLevel=void 0;var AHa=nn(),yHa=bte(),EHa=$g(),Pre;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(Pre||(vD.LogLevel=Pre={}));vD.ICompletionsLogTargetService=(0,AHa.createServiceIdentifier)("ICompletionsLogTargetService");var FAt=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,Pre.DEBUG,...r)}info(e,...r){this.log(e,Pre.INFO,...r)}warn(e,...r){this.log(e,Pre.WARN,...r)}error(e,...r){this.log(e,Pre.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,EHa.telemetryException)(e.get(yHa.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(vD.ICompletionsLogTargetService),Pre.ERROR,`${o}:`,s)}};vD.Logger=FAt;vD.logger=new FAt("default")});var hPi=I(JG=>{"use strict";p();Object.defineProperty(JG,"__esModule",{value:!0});JG.INotificationService=JG.NullNotificationService=JG.ProgressLocation=void 0;var _Ha=nn(),vHa=KP(),pPi;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(pPi||(JG.ProgressLocation=pPi={}));var qSr=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")},vHa.CancellationToken.None))}};JG.NullNotificationService=qSr;JG.INotificationService=(0,_Ha.createServiceIdentifier)("INotificationService")});var HSr=I(CD=>{"use strict";p();var CHa=CD&&CD.__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},bHa=CD&&CD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(CD,"__esModule",{value:!0});CD.ExtensionNotificationSender=CD.ICompletionsNotificationSender=void 0;var SHa=hPi(),THa=nn();CD.ICompletionsNotificationSender=(0,THa.createServiceIdentifier)("ICompletionsNotificationSender");var jSr=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}}};CD.ExtensionNotificationSender=jSr;CD.ExtensionNotificationSender=jSr=CHa([bHa(0,SHa.INotificationService)],jSr)});var VSr=I(bD=>{"use strict";p();var IHa=bD&&bD.__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},GSr=bD&&bD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(bD,"__esModule",{value:!0});bD.UserErrorNotifier=bD.ICompletionsUserErrorNotifierService=void 0;var xHa=U4(),wHa=nn(),RHa=nd(),APi=Dl(),kHa=HSr(),PHa=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],mPi="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.",gPi="https://gh.io/copilot-network-errors";bD.ICompletionsUserErrorNotifierService=(0,wHa.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var $Sr=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&&PHa.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new APi.Logger("certificates").error(this._logTarget,`${mPi} Please visit ${gPi} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(mPi,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(RHa.URI.parse(gPi))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};bD.UserErrorNotifier=$Sr;bD.UserErrorNotifier=$Sr=IHa([GSr(0,APi.ICompletionsLogTargetService),GSr(1,kHa.ICompletionsNotificationSender),GSr(2,xHa.IEnvService)],$Sr)});var mh=I(lAe=>{"use strict";p();Object.defineProperty(lAe,"__esModule",{value:!0});lAe.NullExperimentationService=lAe.IExperimentationService=void 0;var DHa=nn(),NHa=Ic();lAe.IExperimentationService=(0,DHa.createServiceIdentifier)("IExperimentationService");var WSr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new NHa.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};lAe.NullExperimentationService=WSr});var ZG=I(o1=>{"use strict";p();Object.defineProperty(o1,"__esModule",{value:!0});o1.DEFAULT_PROMPT_ALLOCATION_PERCENT=o1.DEFAULT_SUFFIX_MATCH_THRESHOLD=o1.DEFAULT_NUM_SNIPPETS=o1.DEFAULT_MAX_PROMPT_LENGTH=o1.DEFAULT_MAX_COMPLETION_LENGTH=void 0;o1.normalizeLanguageId=OHa;o1.DEFAULT_MAX_COMPLETION_LENGTH=500;o1.DEFAULT_MAX_PROMPT_LENGTH=8192-o1.DEFAULT_MAX_COMPLETION_LENGTH;o1.DEFAULT_NUM_SNIPPETS=4;o1.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;o1.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var MHa={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function OHa(t){return t=t.toLowerCase(),MHa[t]??t}a(OHa,"normalizeLanguageId")});var yPi=I(zSr=>{"use strict";p();Object.defineProperty(zSr,"__esModule",{value:!0});zSr.getUserKind=BHa;function LHa(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(LHa,"findKnownOrg");function BHa(t){let e=t.organizationList??[];return LHa(e)??""}a(BHa,"getUserKind")});var c4e=I(K4=>{"use strict";p();Object.defineProperty(K4,"__esModule",{value:!0});K4.IEndpointProvider=K4.ModelSupportedEndpoint=void 0;K4.isEndpointEditToolName=QHa;K4.isChatModelInformation=qHa;K4.isEmbeddingModelInformation=jHa;K4.isCompletionModelInformation=HHa;var FHa=nn(),UHa=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function QHa(t){return UHa.has(t)}a(QHa,"isEndpointEditToolName");var EPi;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(EPi||(K4.ModelSupportedEndpoint=EPi={}));function qHa(t){return t.capabilities.type==="chat"}a(qHa,"isChatModelInformation");function jHa(t){return t.capabilities.type==="embeddings"}a(jHa,"isEmbeddingModelInformation");function HHa(t){return t.capabilities.type==="completion"}a(HHa,"isCompletionModelInformation");K4.IEndpointProvider=(0,FHa.createServiceIdentifier)("IEndpointProvider")});var vPi=I(YSr=>{"use strict";p();Object.defineProperty(YSr,"__esModule",{value:!0});YSr.getUserSelectedModelConfiguration=GHa;var _Pi=LE();function GHa(t){let e=(0,_Pi.getConfig)(t,_Pi.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(GHa,"getUserSelectedModelConfiguration")});var CPi=I(Z4=>{"use strict";p();Object.defineProperty(Z4,"__esModule",{value:!0});Z4.bytePairEncode=Z4.BinaryMap=Z4.binaryMapKey=void 0;var $Ha=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");Z4.binaryMapKey=$Ha;var KSr=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,Z4.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,Z4.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)}}};Z4.BinaryMap=KSr;var J4=new Int32Array(128),Nv=new Int32Array(128);function VHa(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;J4.length0&&(J4[Nv[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(UAt,"__esModule",{value:!0});UAt.makeTextEncoder=void 0;var JSr=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}},ZSr=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 ZSr:new JSr,"makeTextEncoder");UAt.makeTextEncoder=WHa});var SPi=I(QAt=>{"use strict";p();Object.defineProperty(QAt,"__esModule",{value:!0});QAt.LRUCache=void 0;var XSr=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 eTr(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}};QAt.LRUCache=XSr;var eTr=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var rTr=I(jAt=>{"use strict";p();Object.defineProperty(jAt,"__esModule",{value:!0});jAt.TikTokenizer=void 0;var qAt=CPi(),zHa=bPi(),YHa=SPi();function KHa(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(KHa,"loadTikTokenBpe");function JHa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(JHa,"escapeRegExp");var tTr=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,zHa.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new YHa.LRUCache(o);let s=typeof e=="string"?KHa(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new qAt.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=>JHa(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,qAt.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,qAt.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 E=0;E=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 E=A[0],_=this.cache.get(E);if(_)c+=_.length,l+=E.length,o.push(..._),u.set(c,l);else{let v=this.textEncoder.encode(E),b=this.encoder.get(v);if(b!==void 0)this.cache.set(E,[b]),c++,l+=E.length,o.push(b),u.set(c,l);else{let T=(0,qAt.bytePairEncode)(v,this.encoder,this.textEncoder.length);this.cache.set(E,T),c+=T.length,l+=E.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))}};jAt.TikTokenizer=tTr});var MPi=I(Im=>{"use strict";p();Object.defineProperty(Im,"__esModule",{value:!0});Im.createTokenizer=Im.createByEncoderName=Im.createByModelName=Im.getRegexByModel=Im.getRegexByEncoder=Im.getSpecialTokensByModel=Im.getSpecialTokensByEncoder=Im.MODEL_TO_ENCODING=void 0;var ZHa=rTr(),XHa=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);Im.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 HAt="<|endoftext|>",TPi="<|fim_prefix|>",IPi="<|fim_middle|>",xPi="<|fim_suffix|>",wPi="<|endofprompt|>",l4e="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",RPi="(?:'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+",eGa=[`[^\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+"],IPi=zHa.join("|");function rTr(t){let e="";if(Im.MODEL_TO_ENCODING.has(t))e=Im.MODEL_TO_ENCODING.get(t);else for(let[r,n]of WHa)if(t.startsWith(r)){e=n;break}return e}a(rTr,"getEncoderFromModelName");async function YHa(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(YHa,"fetchAndSaveFile");function nTr(t){let e=new Map([[jAt,50256]]);switch(t){case"o200k_base":e=new Map([[jAt,199999],[SPi,200018]]);break;case"cl100k_base":e=new Map([[jAt,100257],[vPi,100258],[CPi,100259],[bPi,100260],[SPi,100276]]);break;case"p50k_edit":e=new Map([[jAt,50256],[vPi,50281],[CPi,50282],[bPi,50283]]);break;default:break}return e}a(nTr,"getSpecialTokensByEncoder");Im.getSpecialTokensByEncoder=nTr;function KHa(t){let e=rTr(t);return nTr(e)}a(KHa,"getSpecialTokensByModel");Im.getSpecialTokensByModel=KHa;function xPi(t){switch(t){case"o200k_base":return IPi;case"cl100k_base":return TPi;default:break}return a4e}a(xPi,"getRegexByEncoder");Im.getRegexByEncoder=xPi;function JHa(t){let e=rTr(t);return xPi(e)}a(JHa,"getRegexByModel");Im.getRegexByModel=JHa;async function ZHa(t,e=null){return wPi(rTr(t),e)}a(ZHa,"createByModelName");Im.createByModelName=ZHa;async function wPi(t,e=null){let r,n,o=nTr(t);switch(t){case"o200k_base":r=IPi,n="https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken";break;case"cl100k_base":r=TPi,n="https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken";break;case"p50k_base":r=a4e,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"p50k_edit":r=a4e,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"r50k_base":r=a4e,n="https://openaipublic.blob.core.windows.net/encodings/r50k_base.tiktoken";break;case"gpt2":r=a4e,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 YHa(n,d),console.log(`Saved file to ${d}`)),RPi(d,o,r)}a(wPi,"createByEncoderName");Im.createByEncoderName=wPi;function RPi(t,e,r,n=8192){return new VHa.TikTokenizer(t,e,r,n)}a(RPi,"createTokenizer");Im.createTokenizer=RPi});var iTr=I(xm=>{"use strict";p();Object.defineProperty(xm,"__esModule",{value:!0});xm.createTokenizer=xm.createByEncoderName=xm.createByModelName=xm.getSpecialTokensByModel=xm.getSpecialTokensByEncoder=xm.getRegexByModel=xm.getRegexByEncoder=xm.MODEL_TO_ENCODING=xm.TikTokenizer=void 0;var XHa=tTr();Object.defineProperty(xm,"TikTokenizer",{enumerable:!0,get:a(function(){return XHa.TikTokenizer},"get")});var ZG=kPi();Object.defineProperty(xm,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return ZG.MODEL_TO_ENCODING},"get")});Object.defineProperty(xm,"getRegexByEncoder",{enumerable:!0,get:a(function(){return ZG.getRegexByEncoder},"get")});Object.defineProperty(xm,"getRegexByModel",{enumerable:!0,get:a(function(){return ZG.getRegexByModel},"get")});Object.defineProperty(xm,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return ZG.getSpecialTokensByEncoder},"get")});Object.defineProperty(xm,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return ZG.getSpecialTokensByModel},"get")});Object.defineProperty(xm,"createByModelName",{enumerable:!0,get:a(function(){return ZG.createByModelName},"get")});Object.defineProperty(xm,"createByEncoderName",{enumerable:!0,get:a(function(){return ZG.createByEncoderName},"get")});Object.defineProperty(xm,"createTokenizer",{enumerable:!0,get:a(function(){return ZG.createTokenizer},"get")})});var DPi=I(gy=>{"use strict";p();Object.defineProperty(gy,"__esModule",{value:!0});gy.isReadable=tGa;gy.isReadableStream=PPi;gy.isReadableBufferedStream=rGa;gy.newWriteableStream=c4e;gy.consumeReadable=nGa;gy.peekReadable=iGa;gy.consumeStream=oGa;gy.listenStream=GAt;gy.peekStream=sGa;gy.toStream=aGa;gy.emptyStream=cGa;gy.toReadable=lGa;gy.transform=uGa;gy.prefixedReadable=dGa;gy.prefixedStream=fGa;var eGa=Rs(),HAt=Ro();function tGa(t){let e=t;return e?typeof e.read=="function":!1}a(tGa,"isReadable");function PPi(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(PPi,"isReadableStream");function rGa(t){let e=t;return e?PPi(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a(rGa,"isReadableBufferedStream");function c4e(t,e){return new oTr(t,e)}a(c4e,"newWriteableStream");var oTr=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,eGa.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 nGa(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(nGa,"consumeReadable");function iGa(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(iGa,"peekReadable");function oGa(t,e){return new Promise((r,n)=>{let o=[];GAt(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(oGa,"consumeStream");function GAt(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(GAt,"listenStream");function sGa(t,e){return new Promise((r,n)=>{let o=new HAt.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,HAt.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,HAt.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,HAt.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(sGa,"peekStream");function aGa(t,e){let r=c4e(e);return r.end(t),r}a(aGa,"toStream");function cGa(){let t=c4e(()=>{throw new Error("not supported")});return t.end(),t}a(cGa,"emptyStream");function lGa(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(lGa,"toReadable");function uGa(t,e,r){let n=c4e(r);return GAt(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(uGa,"transform");function dGa(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(dGa,"prefixedReadable");function fGa(t,e,r){let n=!1,o=c4e(r);return GAt(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(fGa,"prefixedStream")});var e$=I(_c=>{"use strict";p();var pGa=_c&&_c.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=_c&&_c.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mGa=_c&&_c.__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)),sTr,aTr,qE=class t{static{a(this,"VSBuffer")}static alloc(e){return l4e?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return l4e&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&l4e?new t(Buffer.from(e)):(sTr||(sTr=new TextEncoder),new t(sTr.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])}};_c.VSBuffer=qE;function OPi(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=AGa.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(yGa,"readUInt16LE");function EGa(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(EGa,"writeUInt16LE");function LPi(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(LPi,"readUInt32BE");function BPi(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(BPi,"writeUInt32BE");function FPi(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(FPi,"readUInt32LE");function UPi(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(UPi,"writeUInt32LE");function QPi(t,e){return t[e]}a(QPi,"readUInt8");function qPi(t,e,r){t[r]=e}a(qPi,"writeUInt8");function _Ga(t){return XG.consumeReadable(t,e=>qE.concat(e))}a(_Ga,"readableToBuffer");function vGa(t){return XG.toReadable(t)}a(vGa,"bufferToReadable");function jPi(t){return XG.consumeStream(t,e=>qE.concat(e))}a(jPi,"streamToBuffer");async function CGa(t){return t.ended?qE.concat(t.buffer):qE.concat([...t.buffer,await jPi(t.stream)])}a(CGa,"bufferedStreamToBuffer");function bGa(t){return XG.toStream(t,e=>qE.concat(e))}a(bGa,"bufferToStream");function SGa(t){return XG.transform(t,{data:a(e=>typeof e=="string"?qE.fromString(e):qE.wrap(e),"data")},e=>qE.concat(e))}a(SGa,"streamToBufferReadableStream");function TGa(t){return XG.newWriteableStream(e=>qE.concat(e),t)}a(TGa,"newWriteableBufferStream");function IGa(t,e){return XG.prefixedReadable(t,e,r=>qE.concat(r))}a(IGa,"prefixedBufferReadable");function xGa(t,e){return XG.prefixedStream(t,e,r=>qE.concat(r))}a(xGa,"prefixedBufferStream");function wGa(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 qE.wrap(o).slice(0,c)}a(wGa,"decodeBase64");var RGa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kGa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function PGa({buffer:t},e=!0,r=!1){let n=r?kGa:RGa,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(PGa,"encodeBase64");var NPi="0123456789abcdef";function DGa({buffer:t}){let e="";for(let r=0;r>>4],e+=NPi[n&15]}return e}a(DGa,"encodeHex");function NGa(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]=MPi(t,r++)<<4|MPi(t,r++);return qE.wrap(e)}a(NGa,"decodeHex");function MPi(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(MPi,"decodeHexChar")});var HPi=I($At=>{"use strict";p();Object.defineProperty($At,"__esModule",{value:!0});$At.readVariableLengthQuantity=OGa;$At.writeVariableLengthQuantity=LGa;var MGa=e$();function OGa(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 MGa.VSBuffer.fromByteArray(e)}a(LGa,"writeVariableLengthQuantity")});var cTr=I(VAt=>{"use strict";p();Object.defineProperty(VAt,"__esModule",{value:!0});VAt.parseTikTokenBinary=void 0;var BGa=require("fs"),FGa=HPi(),UGa=e$(),QGa=a(t=>{let e=(0,BGa.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(WAt,"__esModule",{value:!0});WAt.CopilotPromptLoadFailure=void 0;var lTr=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};WAt.CopilotPromptLoadFailure=lTr});var dTr=I(NR=>{"use strict";p();var qGa=NR&&NR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jGa=NR&&NR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HGa=NR&&NR.__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(MR,"__esModule",{value:!0});MR.ApproximateTokenizer=MR.TTokenizer=MR.TokenizerName=void 0;MR.setExternalTokenizerProvider=KGa;MR.getTokenizer=JGa;MR.ensureTokenizersLoaded=XGa;MR.resetTokenizersForTest=e$a;var fTr=iTr(),WGa=cTr(),zGa=uTr(),YGa=dTr(),bD;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(bD||(MR.TokenizerName=bD={}));var lAe=new Map,Nre;function KGa(t){Nre||ZAt||(Nre=t)}a(KGa,"setExternalTokenizerProvider");function JGa(t=bD.o200k){if(Nre)try{return Nre.getTokenizer(t)}catch{}let e=lAe.get(t);return e!==void 0||(WPi(),e=lAe.get(bD.o200k),e!==void 0)?e:new JAt}a(JGa,"getTokenizer");var YAt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,fTr.createTokenizer)((0,WGa.parseTikTokenBinary)((0,YGa.locateFile)(`${e}.tiktoken`)),(0,fTr.getSpecialTokensByEncoder)(e),(0,fTr.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new zGa.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(xm,"__esModule",{value:!0});xm.createTokenizer=xm.createByEncoderName=xm.createByModelName=xm.getSpecialTokensByModel=xm.getSpecialTokensByEncoder=xm.getRegexByModel=xm.getRegexByEncoder=xm.MODEL_TO_ENCODING=xm.TikTokenizer=void 0;var oGa=rTr();Object.defineProperty(xm,"TikTokenizer",{enumerable:!0,get:a(function(){return oGa.TikTokenizer},"get")});var XG=MPi();Object.defineProperty(xm,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return XG.MODEL_TO_ENCODING},"get")});Object.defineProperty(xm,"getRegexByEncoder",{enumerable:!0,get:a(function(){return XG.getRegexByEncoder},"get")});Object.defineProperty(xm,"getRegexByModel",{enumerable:!0,get:a(function(){return XG.getRegexByModel},"get")});Object.defineProperty(xm,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return XG.getSpecialTokensByEncoder},"get")});Object.defineProperty(xm,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return XG.getSpecialTokensByModel},"get")});Object.defineProperty(xm,"createByModelName",{enumerable:!0,get:a(function(){return XG.createByModelName},"get")});Object.defineProperty(xm,"createByEncoderName",{enumerable:!0,get:a(function(){return XG.createByEncoderName},"get")});Object.defineProperty(xm,"createTokenizer",{enumerable:!0,get:a(function(){return XG.createTokenizer},"get")})});var LPi=I(gy=>{"use strict";p();Object.defineProperty(gy,"__esModule",{value:!0});gy.isReadable=aGa;gy.isReadableStream=OPi;gy.isReadableBufferedStream=cGa;gy.newWriteableStream=u4e;gy.consumeReadable=lGa;gy.peekReadable=uGa;gy.consumeStream=dGa;gy.listenStream=$At;gy.peekStream=fGa;gy.toStream=pGa;gy.emptyStream=hGa;gy.toReadable=mGa;gy.transform=gGa;gy.prefixedReadable=AGa;gy.prefixedStream=yGa;var sGa=Rs(),GAt=ko();function aGa(t){let e=t;return e?typeof e.read=="function":!1}a(aGa,"isReadable");function OPi(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(OPi,"isReadableStream");function cGa(t){let e=t;return e?OPi(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a(cGa,"isReadableBufferedStream");function u4e(t,e){return new sTr(t,e)}a(u4e,"newWriteableStream");var sTr=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,sGa.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 lGa(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(lGa,"consumeReadable");function uGa(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(uGa,"peekReadable");function dGa(t,e){return new Promise((r,n)=>{let o=[];$At(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(dGa,"consumeStream");function $At(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($At,"listenStream");function fGa(t,e){return new Promise((r,n)=>{let o=new GAt.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,GAt.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,GAt.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,GAt.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(fGa,"peekStream");function pGa(t,e){let r=u4e(e);return r.end(t),r}a(pGa,"toStream");function hGa(){let t=u4e(()=>{throw new Error("not supported")});return t.end(),t}a(hGa,"emptyStream");function mGa(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(mGa,"toReadable");function gGa(t,e,r){let n=u4e(r);return $At(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(gGa,"transform");function AGa(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(AGa,"prefixedReadable");function yGa(t,e,r){let n=!1,o=u4e(r);return $At(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(yGa,"prefixedStream")});var t$=I(_c=>{"use strict";p();var EGa=_c&&_c.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Ga=_c&&_c.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vGa=_c&&_c.__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)),aTr,cTr,qE=class t{static{a(this,"VSBuffer")}static alloc(e){return d4e?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return d4e&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&d4e?new t(Buffer.from(e)):(aTr||(aTr=new TextEncoder),new t(aTr.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])}};_c.VSBuffer=qE;function UPi(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=bGa.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(SGa,"readUInt16LE");function TGa(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(TGa,"writeUInt16LE");function QPi(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(QPi,"readUInt32BE");function qPi(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(qPi,"writeUInt32BE");function jPi(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(jPi,"readUInt32LE");function HPi(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(HPi,"writeUInt32LE");function GPi(t,e){return t[e]}a(GPi,"readUInt8");function $Pi(t,e,r){t[r]=e}a($Pi,"writeUInt8");function IGa(t){return e$.consumeReadable(t,e=>qE.concat(e))}a(IGa,"readableToBuffer");function xGa(t){return e$.toReadable(t)}a(xGa,"bufferToReadable");function VPi(t){return e$.consumeStream(t,e=>qE.concat(e))}a(VPi,"streamToBuffer");async function wGa(t){return t.ended?qE.concat(t.buffer):qE.concat([...t.buffer,await VPi(t.stream)])}a(wGa,"bufferedStreamToBuffer");function RGa(t){return e$.toStream(t,e=>qE.concat(e))}a(RGa,"bufferToStream");function kGa(t){return e$.transform(t,{data:a(e=>typeof e=="string"?qE.fromString(e):qE.wrap(e),"data")},e=>qE.concat(e))}a(kGa,"streamToBufferReadableStream");function PGa(t){return e$.newWriteableStream(e=>qE.concat(e),t)}a(PGa,"newWriteableBufferStream");function DGa(t,e){return e$.prefixedReadable(t,e,r=>qE.concat(r))}a(DGa,"prefixedBufferReadable");function NGa(t,e){return e$.prefixedStream(t,e,r=>qE.concat(r))}a(NGa,"prefixedBufferStream");function MGa(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 qE.wrap(o).slice(0,c)}a(MGa,"decodeBase64");var OGa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",LGa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function BGa({buffer:t},e=!0,r=!1){let n=r?LGa:OGa,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(BGa,"encodeBase64");var BPi="0123456789abcdef";function FGa({buffer:t}){let e="";for(let r=0;r>>4],e+=BPi[n&15]}return e}a(FGa,"encodeHex");function UGa(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]=FPi(t,r++)<<4|FPi(t,r++);return qE.wrap(e)}a(UGa,"decodeHex");function FPi(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(FPi,"decodeHexChar")});var WPi=I(VAt=>{"use strict";p();Object.defineProperty(VAt,"__esModule",{value:!0});VAt.readVariableLengthQuantity=qGa;VAt.writeVariableLengthQuantity=jGa;var QGa=t$();function qGa(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 QGa.VSBuffer.fromByteArray(e)}a(jGa,"writeVariableLengthQuantity")});var lTr=I(WAt=>{"use strict";p();Object.defineProperty(WAt,"__esModule",{value:!0});WAt.parseTikTokenBinary=void 0;var HGa=require("fs"),GGa=WPi(),$Ga=t$(),VGa=a(t=>{let e=(0,HGa.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(zAt,"__esModule",{value:!0});zAt.CopilotPromptLoadFailure=void 0;var uTr=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};zAt.CopilotPromptLoadFailure=uTr});var fTr=I(MR=>{"use strict";p();var WGa=MR&&MR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=MR&&MR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),YGa=MR&&MR.__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(OR,"__esModule",{value:!0});OR.ApproximateTokenizer=OR.TTokenizer=OR.TokenizerName=void 0;OR.setExternalTokenizerProvider=r$a;OR.getTokenizer=n$a;OR.ensureTokenizersLoaded=o$a;OR.resetTokenizersForTest=s$a;var pTr=oTr(),XGa=lTr(),e$a=dTr(),t$a=fTr(),SD;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(SD||(OR.TokenizerName=SD={}));var uAe=new Map,Nre;function r$a(t){Nre||XAt||(Nre=t)}a(r$a,"setExternalTokenizerProvider");function n$a(t=SD.o200k){if(Nre)try{return Nre.getTokenizer(t)}catch{}let e=uAe.get(t);return e!==void 0||(JPi(),e=uAe.get(SD.o200k),e!==void 0)?e:new ZAt}a(n$a,"getTokenizer");var KAt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,pTr.createTokenizer)((0,XGa.parseTikTokenBinary)((0,t$a.locateFile)(`${e}.tiktoken`)),(0,pTr.getSpecialTokensByEncoder)(e),(0,pTr.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new e$a.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)}};OR.TTokenizer=KAt;var JAt=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)}},ZGa={[bD.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},[bD.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}},pTr=4,JAt=class{static{a(this,"ApproximateTokenizer")}constructor(e=bD.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(-pTr),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-pTr)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?ZGa[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)}},i$a={[SD.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},[SD.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}},hTr=4,ZAt=class{static{a(this,"ApproximateTokenizer")}constructor(e=SD.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(-hTr),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-hTr)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?i$a[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)}};MR.ApproximateTokenizer=JAt;async function VPi(t){try{let e=await YAt.create(t);lAe.set(t,e)}catch{}}a(VPi,"setTokenizer");lAe.set(bD.mock,new KAt);var ZAt,zAt;function WPi(){if(Nre){let t=Nre;return zAt??=Promise.resolve().then(()=>t.ensureLoaded()).catch(()=>{zAt=void 0}),zAt}return ZAt??=Promise.all([VPi(bD.cl100k),VPi(bD.o200k)]).then(()=>{}),ZAt}a(WPi,"loadTokenizers");function XGa(){return WPi()}a(XGa,"ensureTokenizersLoaded");function e$a(){Nre=void 0,ZAt=void 0,zAt=void 0,lAe.clear(),lAe.set(bD.mock,new KAt)}a(e$a,"resetTokenizersForTest")});var Ore=I(Mre=>{"use strict";p();var t$a=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]})),r$a=Mre&&Mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t$a(e,t,r)};Object.defineProperty(Mre,"__esModule",{value:!0});r$a(zPi(),Mre)});var mTr=I(SD=>{"use strict";p();var n$a=SD&&SD.__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},u4e=SD&&SD.__param||function(t,e){return function(r,n){e(r,n,t)}},d4e;Object.defineProperty(SD,"__esModule",{value:!0});SD.AvailableModelsManager=SD.ICompletionsModelManagerService=void 0;var i$a=FE(),o$a=s4e(),s$a=nn(),a$a=Ro(),c$a=Gs(),l$a=APi(),u$a=Ore(),d$a=kvr(),f$a=fgt(),XAt=LE(),p$a=fy(),YPi=Dl();SD.ICompletionsModelManagerService=(0,s$a.createServiceIdentifier)("ICompletionsModelManagerService");var h$a="gpt-41-copilot",hTr=d4e=class extends a$a.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 d$a.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,f$a.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=d4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return h$a}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=d4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return d4e.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:u$a.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(l$a.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(YPi.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(XAt.getConfig,XAt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(XAt.getConfig,XAt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new t$(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 t$(s,"exp"):new t$(n,"modelpicker"):s?new t$(s,"exp"):this.customModels.length>0?new t$(this.customModels[0],"custommodel"):new t$(r,"default")}};SD.AvailableModelsManager=hTr;SD.AvailableModelsManager=hTr=d4e=n$a([u4e(1,c$a.IInstantiationService),u4e(2,p$a.ICompletionsFeaturesService),u4e(3,o$a.IEndpointProvider),u4e(4,i$a.IAuthenticationService),u4e(5,YPi.ICompletionsLogTargetService)],hTr);var t$=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var ATr=I(gTr=>{"use strict";p();Object.defineProperty(gTr,"__esModule",{value:!0});gTr.getEngineRequestInfo=g$a;var m$a=mTr();function g$a(t,e=void 0){let r=t.get(m$a.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(g$a,"getEngineRequestInfo")});var XPi=I(eyt=>{"use strict";p();Object.defineProperty(eyt,"__esModule",{value:!0});eyt.setupCompletionsExperimentationService=v$a;eyt.createCompletionsFilters=ZPi;var A$a=FE(),y$a=mh(),E$a=Gs(),KPi=hPi(),r$=LE(),_$a=ATr(),OR=L0t();function v$a(t){let e=t.get(A$a.IAuthenticationService),r=t.get(E$a.IInstantiationService),n=e.onDidCopilotTokenChange(()=>{r.invokeFunction(JPi,e.copilotToken)});return JPi(t,e.copilotToken),n}a(v$a,"setupCompletionsExperimentationService");function C$a(t){return r$.BuildInfo.getBuildType()===r$.BuildType.NIGHTLY?OR.Release.Nightly:OR.Release.Stable}a(C$a,"getPluginRelease");function JPi(t,e){let r=t.get(y$a.IExperimentationService),n=ZPi(t,e);r.setCompletionsFilters(n)}a(JPi,"updateCompletionsFilters");function ZPi(t,e){let r=new Map;if(r.set(OR.Filter.ExtensionRelease,C$a(t)),r.set(OR.Filter.CopilotOverrideEngine,(0,r$.getConfig)(t,r$.ConfigKey.DebugOverrideEngine)||(0,r$.getConfig)(t,r$.ConfigKey.DebugOverrideEngineLegacy)),r.set(OR.Filter.CopilotClientVersion,r$.BuildInfo.isProduction()?r$.BuildInfo.getVersion():"1.999.0"),e){let o=(0,KPi.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(OR.Filter.CopilotUserKind,o),r.set(OR.Filter.CopilotCustomModel,s),r.set(OR.Filter.CopilotOrgs,c),r.set(OR.Filter.CopilotCustomModelNames,l),r.set(OR.Filter.CopilotTrackingId,u),r.set(OR.Filter.CopilotUserKind,(0,KPi.getUserKind)(e))}let n=(0,_$a.getEngineRequestInfo)(t).modelId;return r.set(OR.Filter.CopilotEngine,n),r}a(ZPi,"createCompletionsFilters")});var e2i=I(v6=>{"use strict";p();var b$a=v6&&v6.__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},yTr=v6&&v6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(v6,"__esModule",{value:!0});v6.Features=void 0;var S$a=Sp(),T$a=mh(),I$a=Gs(),uAe=JG(),x$a=Uge(),ETr=$g(),w$a=XPi(),La=M0t(),R$a=L0t(),_Tr=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=ETr.TelemetryData.createAndMarkAsIssued()){if(r instanceof ETr.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 ETr.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(La.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 La.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(w$a.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new R$a.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[La.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SuffixPercent]??uAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SuffixMatchThreshold]??uAe.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[La.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[La.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[La.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(S$a.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[La.ExpTreatmentVariables.MaxPromptCompletionTokens]??uAe.DEFAULT_MAX_PROMPT_LENGTH+uAe.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.StableContextPercent]??uAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.VolatileContextPercent]??uAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};v6.Features=_Tr;v6.Features=_Tr=b$a([yTr(0,I$a.IInstantiationService),yTr(1,T$a.IExperimentationService),yTr(2,x$a.ICompletionsCopilotTokenManager)],_Tr)});var n$=I(dAe=>{"use strict";p();Object.defineProperty(dAe,"__esModule",{value:!0});dAe.ICompletionsFileSystemService=dAe.FileType=void 0;var k$a=nn(),t2i;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(t2i||(dAe.FileType=t2i={}));dAe.ICompletionsFileSystemService=(0,k$a.createServiceIdentifier)("ICompletionsFileSystemService")});var vTr=I(tyt=>{"use strict";p();Object.defineProperty(tyt,"__esModule",{value:!0});tyt.knownLanguages=void 0;tyt.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 n2i=I(i$=>{"use strict";p();Object.defineProperty(i$,"__esModule",{value:!0});i$.knownFileExtensions=i$.templateLanguageLimitations=i$.knownTemplateLanguageExtensions=void 0;var r2i=vTr();i$.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];i$.templateLanguageLimitations={".php":[".blade"]};i$.knownFileExtensions=Object.keys(r2i.knownLanguages).flatMap(t=>r2i.knownLanguages[t].extensions)});var o$=I(TD=>{"use strict";p();Object.defineProperty(TD,"__esModule",{value:!0});TD.makeFsUri=O$a;TD.validateUri=L$a;TD.normalizeUri=B$a;TD.fsPath=a2i;TD.getFsPath=c2i;TD.getFsUri=F$a;TD.joinPath=U$a;TD.basename=j$a;TD.dirname=H$a;var P$a=require("os"),D$a=require("path"),N$a=ZP(),f4e=nd();function o2i(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+o2i(t.substring(3)):t}}a(o2i,"decodeURIComponentGraceful");var i2i=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function M$a(t){return t.match(i2i)?t.replace(i2i,e=>o2i(e)):t}a(M$a,"percentDecode");function O$a(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 f4e.URI.file(t).toString()}a(O$a,"makeFsUri");function p4e(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?f4e.URI.parse(e[1]+e[2],!0):f4e.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(p4e,"parseUri");function L$a(t){return p4e(t),t}a(L$a,"validateUri");function B$a(t){try{return p4e(t).toString()}catch{return t}}a(B$a,"normalizeUri");var s2i=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function a2i(t){let e=p4e(t);if(!s2i.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,P$a.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,D$a.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(a2i,"fsPath");function c2i(t){try{return a2i(t)}catch{return}}a(c2i,"getFsPath");function F$a(t){let e=c2i(t);if(e)return f4e.URI.file(e).toString()}a(F$a,"getFsUri");function U$a(t,...e){let r=f4e.URI.joinPath(p4e(t),...e.map(Q$a)).toString();return typeof t=="string"?r:{uri:r}}a(U$a,"joinPath");function Q$a(t){return q$a(t)?t.replaceAll("\\","/"):t}a(Q$a,"pathToURIPath");function q$a(t){return/^[^/\\]*\\/.test(t)}a(q$a,"isWinPath");function j$a(t){return M$a((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(j$a,"basename");function H$a(t){let e=(0,N$a.dirname)(p4e(t)),r;return s2i.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(H$a,"dirname")});var u2i=I(jE=>{"use strict";p();var G$a=jE&&jE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=jE&&jE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),V$a=jE&&jE.__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&&CTr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=CTr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(fAe.has(e))return{languageId:fAe.get(e)[0],isGuess:!1};let n=bTr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),fAe.has(e))return{languageId:fAe.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},TTr=class extends pAe{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 Lre("cpp",r.isGuess,r.fileExtension):r}},ITr=class extends pAe{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new Lre(e.languageId,!0,""):this.delegate.detectLanguage(e)}};jE.languageDetection=new TTr(new ITr(new STr));function Y$a({uri:t,languageId:e}){let r=jE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(Y$a,"detectLanguage")});var mAe=I(hAe=>{"use strict";p();Object.defineProperty(hAe,"__esModule",{value:!0});hAe.CopilotTextDocument=hAe.LocationFactory=void 0;var K$a=u2i(),J$a=o$(),h4e=(_6t(),ba(epn)),s$=ebe(),xTr=class{static{a(this,"LocationFactory")}static{this.range=s$.Range.create.bind(s$.Range)}static{this.position=s$.Position.create.bind(s$.Position)}};hAe.LocationFactory=xTr;var wTr=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=h4e.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return h4e.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=h4e.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return h4e.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,K$a.detectLanguage)({uri:e,languageId:r})){return new t((0,J$a.normalizeUri)(e),h4e.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=s$.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=s$.Range.create(s$.Position.create(r,0),s$.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};hAe.CopilotTextDocument=wTr});var g4e=I((OMp,h2i)=>{"use strict";p();var RTr=Object.defineProperty,Z$a=Object.getOwnPropertyDescriptor,X$a=Object.getOwnPropertyNames,eVa=Object.prototype.hasOwnProperty,tVa=a((t,e)=>{for(var r in e)RTr(t,r,{get:e[r],enumerable:!0})},"__export"),rVa=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of X$a(e))!eVa.call(t,o)&&o!==r&&RTr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=Z$a(e,o))||n.enumerable});return t},"__copyProps"),nVa=a(t=>rVa(RTr({},"__esModule",{value:!0}),t),"__toCommonJS"),f2i={};tVa(f2i,{config:a(()=>cVa,"config"),t:a(()=>p2i,"t")});h2i.exports=nVa(f2i);var iVa=require("fs"),oVa=require("fs/promises");async function sVa(t){if(t.protocol==="file:")return await(0,oVa.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(sVa,"readFileFromUri");function aVa(t){return(0,iVa.readFileSync)(t,"utf8")}a(aVa,"readFileFromFsPath");var m4e;function cVa(t){if("contents"in t){typeof t.contents=="string"?m4e=JSON.parse(t.contents):m4e=t.contents;return}if("fsPath"in t){let e=aVa(t.fsPath),r=JSON.parse(e);m4e=d2i(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)=>{sVa(e).then(o=>{try{let s=JSON.parse(o);m4e=d2i(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(cVa,"config");function p2i(...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=m4e?.[r];return s?typeof s=="string"?ryt(s,o):s.comment?ryt(s.message,o):ryt(n,o):ryt(n,o)}a(p2i,"t");var lVa=/{([^}]+)}/g;function ryt(t,e){return Object.keys(e).length===0?t:t.replace(lVa,(r,n)=>e[n]??r)}a(ryt,"format");function d2i(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(d2i,"isBuiltinExtension")});var Bre=I(Nv=>{"use strict";p();var uVa=Nv&&Nv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dVa=Nv&&Nv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fVa=Nv&&Nv.__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(()=>{YAt=void 0}),YAt}return XAt??=Promise.all([KPi(SD.cl100k),KPi(SD.o200k)]).then(()=>{}),XAt}a(JPi,"loadTokenizers");function o$a(){return JPi()}a(o$a,"ensureTokenizersLoaded");function s$a(){Nre=void 0,XAt=void 0,YAt=void 0,uAe.clear(),uAe.set(SD.mock,new JAt)}a(s$a,"resetTokenizersForTest")});var Ore=I(Mre=>{"use strict";p();var a$a=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]})),c$a=Mre&&Mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&a$a(e,t,r)};Object.defineProperty(Mre,"__esModule",{value:!0});c$a(ZPi(),Mre)});var gTr=I(TD=>{"use strict";p();var l$a=TD&&TD.__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},f4e=TD&&TD.__param||function(t,e){return function(r,n){e(r,n,t)}},p4e;Object.defineProperty(TD,"__esModule",{value:!0});TD.AvailableModelsManager=TD.ICompletionsModelManagerService=void 0;var u$a=FE(),d$a=c4e(),f$a=nn(),p$a=ko(),h$a=Gs(),m$a=vPi(),g$a=Ore(),A$a=Pvr(),y$a=pgt(),eyt=LE(),E$a=fy(),XPi=Dl();TD.ICompletionsModelManagerService=(0,f$a.createServiceIdentifier)("ICompletionsModelManagerService");var _$a="gpt-41-copilot",mTr=p4e=class extends p$a.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 A$a.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,y$a.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=p4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return _$a}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=p4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return p4e.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:g$a.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(m$a.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(XPi.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(eyt.getConfig,eyt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(eyt.getConfig,eyt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new r$(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 r$(s,"exp"):new r$(n,"modelpicker"):s?new r$(s,"exp"):this.customModels.length>0?new r$(this.customModels[0],"custommodel"):new r$(r,"default")}};TD.AvailableModelsManager=mTr;TD.AvailableModelsManager=mTr=p4e=l$a([f4e(1,h$a.IInstantiationService),f4e(2,E$a.ICompletionsFeaturesService),f4e(3,d$a.IEndpointProvider),f4e(4,u$a.IAuthenticationService),f4e(5,XPi.ICompletionsLogTargetService)],mTr);var r$=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var yTr=I(ATr=>{"use strict";p();Object.defineProperty(ATr,"__esModule",{value:!0});ATr.getEngineRequestInfo=C$a;var v$a=gTr();function C$a(t,e=void 0){let r=t.get(v$a.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(C$a,"getEngineRequestInfo")});var n2i=I(tyt=>{"use strict";p();Object.defineProperty(tyt,"__esModule",{value:!0});tyt.setupCompletionsExperimentationService=x$a;tyt.createCompletionsFilters=r2i;var b$a=FE(),S$a=mh(),T$a=Gs(),e2i=yPi(),n$=LE(),I$a=yTr(),LR=B0t();function x$a(t){let e=t.get(b$a.IAuthenticationService),r=t.get(T$a.IInstantiationService),n=e.onDidCopilotTokenChange(()=>{r.invokeFunction(t2i,e.copilotToken)});return t2i(t,e.copilotToken),n}a(x$a,"setupCompletionsExperimentationService");function w$a(t){return n$.BuildInfo.getBuildType()===n$.BuildType.NIGHTLY?LR.Release.Nightly:LR.Release.Stable}a(w$a,"getPluginRelease");function t2i(t,e){let r=t.get(S$a.IExperimentationService),n=r2i(t,e);r.setCompletionsFilters(n)}a(t2i,"updateCompletionsFilters");function r2i(t,e){let r=new Map;if(r.set(LR.Filter.ExtensionRelease,w$a(t)),r.set(LR.Filter.CopilotOverrideEngine,(0,n$.getConfig)(t,n$.ConfigKey.DebugOverrideEngine)||(0,n$.getConfig)(t,n$.ConfigKey.DebugOverrideEngineLegacy)),r.set(LR.Filter.CopilotClientVersion,n$.BuildInfo.isProduction()?n$.BuildInfo.getVersion():"1.999.0"),e){let o=(0,e2i.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(LR.Filter.CopilotUserKind,o),r.set(LR.Filter.CopilotCustomModel,s),r.set(LR.Filter.CopilotOrgs,c),r.set(LR.Filter.CopilotCustomModelNames,l),r.set(LR.Filter.CopilotTrackingId,u),r.set(LR.Filter.CopilotUserKind,(0,e2i.getUserKind)(e))}let n=(0,I$a.getEngineRequestInfo)(t).modelId;return r.set(LR.Filter.CopilotEngine,n),r}a(r2i,"createCompletionsFilters")});var i2i=I(C6=>{"use strict";p();var R$a=C6&&C6.__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},ETr=C6&&C6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(C6,"__esModule",{value:!0});C6.Features=void 0;var k$a=Sp(),P$a=mh(),D$a=Gs(),dAe=ZG(),N$a=Qge(),_Tr=$g(),M$a=n2i(),Oa=O0t(),O$a=B0t(),vTr=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=_Tr.TelemetryData.createAndMarkAsIssued()){if(r instanceof _Tr.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 _Tr.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(Oa.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 Oa.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(M$a.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new O$a.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[Oa.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.SuffixPercent]??dAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.SuffixMatchThreshold]??dAe.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[Oa.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[Oa.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[Oa.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(k$a.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[Oa.ExpTreatmentVariables.MaxPromptCompletionTokens]??dAe.DEFAULT_MAX_PROMPT_LENGTH+dAe.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.StableContextPercent]??dAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.VolatileContextPercent]??dAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};C6.Features=vTr;C6.Features=vTr=R$a([ETr(0,D$a.IInstantiationService),ETr(1,P$a.IExperimentationService),ETr(2,N$a.ICompletionsCopilotTokenManager)],vTr)});var i$=I(fAe=>{"use strict";p();Object.defineProperty(fAe,"__esModule",{value:!0});fAe.ICompletionsFileSystemService=fAe.FileType=void 0;var L$a=nn(),o2i;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(o2i||(fAe.FileType=o2i={}));fAe.ICompletionsFileSystemService=(0,L$a.createServiceIdentifier)("ICompletionsFileSystemService")});var CTr=I(ryt=>{"use strict";p();Object.defineProperty(ryt,"__esModule",{value:!0});ryt.knownLanguages=void 0;ryt.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 a2i=I(o$=>{"use strict";p();Object.defineProperty(o$,"__esModule",{value:!0});o$.knownFileExtensions=o$.templateLanguageLimitations=o$.knownTemplateLanguageExtensions=void 0;var s2i=CTr();o$.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];o$.templateLanguageLimitations={".php":[".blade"]};o$.knownFileExtensions=Object.keys(s2i.knownLanguages).flatMap(t=>s2i.knownLanguages[t].extensions)});var s$=I(ID=>{"use strict";p();Object.defineProperty(ID,"__esModule",{value:!0});ID.makeFsUri=q$a;ID.validateUri=j$a;ID.normalizeUri=H$a;ID.fsPath=d2i;ID.getFsPath=f2i;ID.getFsUri=G$a;ID.joinPath=$$a;ID.basename=z$a;ID.dirname=Y$a;var B$a=require("os"),F$a=require("path"),U$a=XP(),h4e=nd();function l2i(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+l2i(t.substring(3)):t}}a(l2i,"decodeURIComponentGraceful");var c2i=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Q$a(t){return t.match(c2i)?t.replace(c2i,e=>l2i(e)):t}a(Q$a,"percentDecode");function q$a(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 h4e.URI.file(t).toString()}a(q$a,"makeFsUri");function m4e(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?h4e.URI.parse(e[1]+e[2],!0):h4e.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(m4e,"parseUri");function j$a(t){return m4e(t),t}a(j$a,"validateUri");function H$a(t){try{return m4e(t).toString()}catch{return t}}a(H$a,"normalizeUri");var u2i=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function d2i(t){let e=m4e(t);if(!u2i.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,B$a.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,F$a.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(d2i,"fsPath");function f2i(t){try{return d2i(t)}catch{return}}a(f2i,"getFsPath");function G$a(t){let e=f2i(t);if(e)return h4e.URI.file(e).toString()}a(G$a,"getFsUri");function $$a(t,...e){let r=h4e.URI.joinPath(m4e(t),...e.map(V$a)).toString();return typeof t=="string"?r:{uri:r}}a($$a,"joinPath");function V$a(t){return W$a(t)?t.replaceAll("\\","/"):t}a(V$a,"pathToURIPath");function W$a(t){return/^[^/\\]*\\/.test(t)}a(W$a,"isWinPath");function z$a(t){return Q$a((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(z$a,"basename");function Y$a(t){let e=(0,U$a.dirname)(m4e(t)),r;return u2i.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(Y$a,"dirname")});var h2i=I(jE=>{"use strict";p();var K$a=jE&&jE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=jE&&jE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Z$a=jE&&jE.__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&&bTr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=bTr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(pAe.has(e))return{languageId:pAe.get(e)[0],isGuess:!1};let n=STr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),pAe.has(e))return{languageId:pAe.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},ITr=class extends hAe{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 Lre("cpp",r.isGuess,r.fileExtension):r}},xTr=class extends hAe{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new Lre(e.languageId,!0,""):this.delegate.detectLanguage(e)}};jE.languageDetection=new ITr(new xTr(new TTr));function tVa({uri:t,languageId:e}){let r=jE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(tVa,"detectLanguage")});var gAe=I(mAe=>{"use strict";p();Object.defineProperty(mAe,"__esModule",{value:!0});mAe.CopilotTextDocument=mAe.LocationFactory=void 0;var rVa=h2i(),nVa=s$(),g4e=(v6t(),Ca(tpn)),a$=tbe(),wTr=class{static{a(this,"LocationFactory")}static{this.range=a$.Range.create.bind(a$.Range)}static{this.position=a$.Position.create.bind(a$.Position)}};mAe.LocationFactory=wTr;var RTr=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=g4e.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return g4e.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=g4e.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return g4e.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,rVa.detectLanguage)({uri:e,languageId:r})){return new t((0,nVa.normalizeUri)(e),g4e.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=a$.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=a$.Range.create(a$.Position.create(r,0),a$.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};mAe.CopilotTextDocument=RTr});var y4e=I((GMp,y2i)=>{"use strict";p();var kTr=Object.defineProperty,iVa=Object.getOwnPropertyDescriptor,oVa=Object.getOwnPropertyNames,sVa=Object.prototype.hasOwnProperty,aVa=a((t,e)=>{for(var r in e)kTr(t,r,{get:e[r],enumerable:!0})},"__export"),cVa=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of oVa(e))!sVa.call(t,o)&&o!==r&&kTr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=iVa(e,o))||n.enumerable});return t},"__copyProps"),lVa=a(t=>cVa(kTr({},"__esModule",{value:!0}),t),"__toCommonJS"),g2i={};aVa(g2i,{config:a(()=>hVa,"config"),t:a(()=>A2i,"t")});y2i.exports=lVa(g2i);var uVa=require("fs"),dVa=require("fs/promises");async function fVa(t){if(t.protocol==="file:")return await(0,dVa.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(fVa,"readFileFromUri");function pVa(t){return(0,uVa.readFileSync)(t,"utf8")}a(pVa,"readFileFromFsPath");var A4e;function hVa(t){if("contents"in t){typeof t.contents=="string"?A4e=JSON.parse(t.contents):A4e=t.contents;return}if("fsPath"in t){let e=pVa(t.fsPath),r=JSON.parse(e);A4e=m2i(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)=>{fVa(e).then(o=>{try{let s=JSON.parse(o);A4e=m2i(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(hVa,"config");function A2i(...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=A4e?.[r];return s?typeof s=="string"?nyt(s,o):s.comment?nyt(s.message,o):nyt(n,o):nyt(n,o)}a(A2i,"t");var mVa=/{([^}]+)}/g;function nyt(t,e){return Object.keys(e).length===0?t:t.replace(mVa,(r,n)=>e[n]??r)}a(nyt,"format");function m2i(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(m2i,"isBuiltinExtension")});var Bre=I(Mv=>{"use strict";p();var gVa=Mv&&Mv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),AVa=Mv&&Mv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),yVa=Mv&&Mv.__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(PTr,"__esModule",{value:!0});PTr.isDocumentValid=yVa;var gVa=Bre(),AVa=nd();async function yVa(t,e){return await t.get(gVa.IIgnoreService).isCopilotIgnored(AVa.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(yVa,"isDocumentValid")});var s1=I(ID=>{"use strict";p();var EVa=ID&&ID.__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},m2i=ID&&ID.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ID,"__esModule",{value:!0});ID.TextDocumentManager=ID.ICompletionsTextDocumentManagerService=void 0;var _Va=nn(),vVa=Gs(),CVa=n$(),g2i=DTr(),gAe=o$();ID.ICompletionsTextDocumentManagerService=(0,_Va.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var NTr=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(g2i.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,gAe.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(g2i.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,gAe.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,gAe.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,gAe.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,gAe.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,gAe.basename)(r)}};ID.TextDocumentManager=NTr;ID.TextDocumentManager=NTr=EVa([m2i(0,vVa.IInstantiationService),m2i(1,CVa.ICompletionsFileSystemService)],NTr)});var LTr=I(xD=>{"use strict";p();var bVa=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},MTr=xD&&xD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(xD,"__esModule",{value:!0});xD.FileReader=xD.ICompletionsFileReaderService=void 0;var SVa=nn(),TVa=Gs(),IVa=n$(),xVa=mAe(),wVa=s1(),RVa=DTr(),kVa=o$();xD.ICompletionsFileReaderService=(0,SVa.createServiceIdentifier)("ICompletionsFileReaderService");var OTr=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,kVa.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(RVa.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:xVa.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}};xD.FileReader=OTr;xD.FileReader=OTr=bVa([MTr(0,wVa.ICompletionsTextDocumentManagerService),MTr(1,TVa.IInstantiationService),MTr(2,IVa.ICompletionsFileSystemService)],OTr)});var C6=I(nyt=>{"use strict";p();Object.defineProperty(nyt,"__esModule",{value:!0});nyt.LRUCacheMap=void 0;var BTr=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)}};nyt.LRUCacheMap=BTr});var y4e=I(A4e=>{"use strict";p();Object.defineProperty(A4e,"__esModule",{value:!0});A4e.Deferred=void 0;A4e.delay=PVa;var FTr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};A4e.Deferred=FTr;function PVa(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(PVa,"delay")});var A2i=I(AAe=>{"use strict";p();Object.defineProperty(AAe,"__esModule",{value:!0});AAe.ReplaySubject=AAe.Subject=void 0;var iyt=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?.()}};AAe.Subject=iyt;var UTr=class extends iyt{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)}};AAe.ReplaySubject=UTr});var jTr=I(wD=>{"use strict";p();var DVa=wD&&wD.__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},y2i=wD&&wD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(wD,"__esModule",{value:!0});wD.AsyncCompletionManager=wD.ICompletionsAsyncManagerService=void 0;var NVa=nn(),MVa=fy(),OVa=C6(),E2i=Dl(),LVa=y4e(),BVa=A2i(),Fre;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Fre||(Fre={}));wD.ICompletionsAsyncManagerService=(0,NVa.createServiceIdentifier)("ICompletionsAsyncManagerService");var qTr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new E2i.Logger("AsyncCompletionManager"),this.requests=new OVa.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(QTr(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 BVa.ReplaySubject;return this.requests.set(e,{state:Fre.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:Fre.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 LVa.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(QTr(r,n,f)){if(f.state===Fre.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)QTr(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!==Fre.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};wD.AsyncCompletionManager=qTr;wD.AsyncCompletionManager=qTr=DVa([y2i(0,MVa.ICompletionsFeaturesService),y2i(1,E2i.ICompletionsLogTargetService)],qTr);function QTr(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===Fre.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(QTr,"isCandidate")});var _2i=I(oyt=>{"use strict";p();Object.defineProperty(oyt,"__esModule",{value:!0});oyt.LRURadixTrie=void 0;var HTr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new E4e,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 E4e;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 E4e;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(yAe,"__esModule",{value:!0});yAe.CompletionsCache=yAe.ICompletionsCacheService=void 0;var FVa=nn(),v2i=_2i();yAe.ICompletionsCacheService=(0,FVa.createServiceIdentifier)("ICompletionsCacheService");var GTr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new v2i.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 v2i.LRURadixTrie(100)}};yAe.CompletionsCache=GTr});var C2i=I(EAe=>{"use strict";p();Object.defineProperty(EAe,"__esModule",{value:!0});EAe.BlockMode=void 0;EAe.shouldDoParsingTrimming=UVa;EAe.shouldDoServerTrimming=QVa;var Ure;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Ure||(EAe.BlockMode=Ure={}));function UVa(t){return[Ure.Parsing,Ure.ParsingAndServer,Ure.MoreMultiline].includes(t)}a(UVa,"shouldDoParsingTrimming");function QVa(t){return[Ure.Server,Ure.ParsingAndServer].includes(t)}a(QVa,"shouldDoServerTrimming")});var Qre=I(tI=>{"use strict";p();var qVa=tI&&tI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tI,"__esModule",{value:!0});tI.WASMLanguage=void 0;tI.isSupportedLanguageId=HVa;tI.languageIdToWasmLanguage=YTr;tI.getLanguage=S2i;tI.parseTreeSitter=$Va;tI.parseTreeSitterIncludingVersion=T2i;tI.getBlockCloseToken=VVa;tI.queryPythonIsDocstring=YVa;var VTr=qVa(ale()),jVa=uTr(),b2i=dTr(),Ed;(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"})(Ed||(tI.WASMLanguage=Ed={}));var WTr={python:Ed.Python,javascript:Ed.JavaScript,javascriptreact:Ed.JavaScript,jsx:Ed.JavaScript,typescript:Ed.TypeScript,typescriptreact:Ed.TSX,go:Ed.Go,ruby:Ed.Ruby,csharp:Ed.CSharp,java:Ed.Java,php:Ed.Php,c:Ed.Cpp,cpp:Ed.Cpp};function HVa(t){return t in WTr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(HVa,"isSupportedLanguageId");function YTr(t){if(!(t in WTr))throw new Error(`Unrecognized language: ${t}`);return WTr[t]}a(YTr,"languageIdToWasmLanguage");var $Tr=new Map;async function GVa(t){let e;try{e=await(0,b2i.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new jVa.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return VTr.default.Language.load(e)}a(GVa,"loadWasmLanguage");function S2i(t){let e=YTr(t);if(!$Tr.has(e)){let r=GVa(e);$Tr.set(e,r)}return $Tr.get(e)}a(S2i,"getLanguage");var zTr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function $Va(t,e){return(await T2i(t,e))[0]}a($Va,"parseTreeSitter");async function T2i(t,e){await VTr.default.init({locateFile:a(s=>(0,b2i.locateFile)(s),"locateFile")});let r;try{r=new VTr.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 zTr(`Could not init Parse for language <${t}>`,s):s}let n=await S2i(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(T2i,"parseTreeSitterIncludingVersion");function VVa(t){switch(YTr(t)){case Ed.Python:return null;case Ed.JavaScript:case Ed.TypeScript:case Ed.TSX:case Ed.Go:case Ed.CSharp:case Ed.Java:case Ed.Php:case Ed.Cpp:return"}";case Ed.Ruby:return"end"}}a(VVa,"getBlockCloseToken");function WVa(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(WVa,"innerQuery");var zVa=[`[ +**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.`);Mv.IIgnoreService=(0,_Va.createServiceIdentifier)("IIgnoreService");var PTr=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(){}};Mv.NullIgnoreService=PTr;async function vVa(t,e){let r=[];for(let n of e)await t.isCopilotIgnored(n)||r.push(n);return r}a(vVa,"filterIngoredResources")});var NTr=I(DTr=>{"use strict";p();Object.defineProperty(DTr,"__esModule",{value:!0});DTr.isDocumentValid=SVa;var CVa=Bre(),bVa=nd();async function SVa(t,e){return await t.get(CVa.IIgnoreService).isCopilotIgnored(bVa.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(SVa,"isDocumentValid")});var s1=I(xD=>{"use strict";p();var TVa=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},E2i=xD&&xD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(xD,"__esModule",{value:!0});xD.TextDocumentManager=xD.ICompletionsTextDocumentManagerService=void 0;var IVa=nn(),xVa=Gs(),wVa=i$(),_2i=NTr(),AAe=s$();xD.ICompletionsTextDocumentManagerService=(0,IVa.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var MTr=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(_2i.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,AAe.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(_2i.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,AAe.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,AAe.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,AAe.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,AAe.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,AAe.basename)(r)}};xD.TextDocumentManager=MTr;xD.TextDocumentManager=MTr=TVa([E2i(0,xVa.IInstantiationService),E2i(1,wVa.ICompletionsFileSystemService)],MTr)});var BTr=I(wD=>{"use strict";p();var RVa=wD&&wD.__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},OTr=wD&&wD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(wD,"__esModule",{value:!0});wD.FileReader=wD.ICompletionsFileReaderService=void 0;var kVa=nn(),PVa=Gs(),DVa=i$(),NVa=gAe(),MVa=s1(),OVa=NTr(),LVa=s$();wD.ICompletionsFileReaderService=(0,kVa.createServiceIdentifier)("ICompletionsFileReaderService");var LTr=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,LVa.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(OVa.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:NVa.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}};wD.FileReader=LTr;wD.FileReader=LTr=RVa([OTr(0,MVa.ICompletionsTextDocumentManagerService),OTr(1,PVa.IInstantiationService),OTr(2,DVa.ICompletionsFileSystemService)],LTr)});var b6=I(iyt=>{"use strict";p();Object.defineProperty(iyt,"__esModule",{value:!0});iyt.LRUCacheMap=void 0;var FTr=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)}};iyt.LRUCacheMap=FTr});var _4e=I(E4e=>{"use strict";p();Object.defineProperty(E4e,"__esModule",{value:!0});E4e.Deferred=void 0;E4e.delay=BVa;var UTr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};E4e.Deferred=UTr;function BVa(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(BVa,"delay")});var v2i=I(yAe=>{"use strict";p();Object.defineProperty(yAe,"__esModule",{value:!0});yAe.ReplaySubject=yAe.Subject=void 0;var oyt=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?.()}};yAe.Subject=oyt;var QTr=class extends oyt{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)}};yAe.ReplaySubject=QTr});var HTr=I(RD=>{"use strict";p();var FVa=RD&&RD.__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},C2i=RD&&RD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(RD,"__esModule",{value:!0});RD.AsyncCompletionManager=RD.ICompletionsAsyncManagerService=void 0;var UVa=nn(),QVa=fy(),qVa=b6(),b2i=Dl(),jVa=_4e(),HVa=v2i(),Fre;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Fre||(Fre={}));RD.ICompletionsAsyncManagerService=(0,UVa.createServiceIdentifier)("ICompletionsAsyncManagerService");var jTr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new b2i.Logger("AsyncCompletionManager"),this.requests=new qVa.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(qTr(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 HVa.ReplaySubject;return this.requests.set(e,{state:Fre.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:Fre.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 jVa.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(qTr(r,n,f)){if(f.state===Fre.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)qTr(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!==Fre.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};RD.AsyncCompletionManager=jTr;RD.AsyncCompletionManager=jTr=FVa([C2i(0,QVa.ICompletionsFeaturesService),C2i(1,b2i.ICompletionsLogTargetService)],jTr);function qTr(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===Fre.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(qTr,"isCandidate")});var S2i=I(syt=>{"use strict";p();Object.defineProperty(syt,"__esModule",{value:!0});syt.LRURadixTrie=void 0;var GTr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new v4e,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 v4e;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 v4e;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(EAe,"__esModule",{value:!0});EAe.CompletionsCache=EAe.ICompletionsCacheService=void 0;var GVa=nn(),T2i=S2i();EAe.ICompletionsCacheService=(0,GVa.createServiceIdentifier)("ICompletionsCacheService");var $Tr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new T2i.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 T2i.LRURadixTrie(100)}};EAe.CompletionsCache=$Tr});var I2i=I(_Ae=>{"use strict";p();Object.defineProperty(_Ae,"__esModule",{value:!0});_Ae.BlockMode=void 0;_Ae.shouldDoParsingTrimming=$Va;_Ae.shouldDoServerTrimming=VVa;var Ure;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Ure||(_Ae.BlockMode=Ure={}));function $Va(t){return[Ure.Parsing,Ure.ParsingAndServer,Ure.MoreMultiline].includes(t)}a($Va,"shouldDoParsingTrimming");function VVa(t){return[Ure.Server,Ure.ParsingAndServer].includes(t)}a(VVa,"shouldDoServerTrimming")});var Qre=I(nI=>{"use strict";p();var WVa=nI&&nI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nI,"__esModule",{value:!0});nI.WASMLanguage=void 0;nI.isSupportedLanguageId=YVa;nI.languageIdToWasmLanguage=KTr;nI.getLanguage=w2i;nI.parseTreeSitter=JVa;nI.parseTreeSitterIncludingVersion=R2i;nI.getBlockCloseToken=ZVa;nI.queryPythonIsDocstring=tWa;var WTr=WVa(ale()),zVa=dTr(),x2i=fTr(),Ed;(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"})(Ed||(nI.WASMLanguage=Ed={}));var zTr={python:Ed.Python,javascript:Ed.JavaScript,javascriptreact:Ed.JavaScript,jsx:Ed.JavaScript,typescript:Ed.TypeScript,typescriptreact:Ed.TSX,go:Ed.Go,ruby:Ed.Ruby,csharp:Ed.CSharp,java:Ed.Java,php:Ed.Php,c:Ed.Cpp,cpp:Ed.Cpp};function YVa(t){return t in zTr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(YVa,"isSupportedLanguageId");function KTr(t){if(!(t in zTr))throw new Error(`Unrecognized language: ${t}`);return zTr[t]}a(KTr,"languageIdToWasmLanguage");var VTr=new Map;async function KVa(t){let e;try{e=await(0,x2i.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new zVa.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return WTr.default.Language.load(e)}a(KVa,"loadWasmLanguage");function w2i(t){let e=KTr(t);if(!VTr.has(e)){let r=KVa(e);VTr.set(e,r)}return VTr.get(e)}a(w2i,"getLanguage");var YTr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function JVa(t,e){return(await R2i(t,e))[0]}a(JVa,"parseTreeSitter");async function R2i(t,e){await WTr.default.init({locateFile:a(s=>(0,x2i.locateFile)(s),"locateFile")});let r;try{r=new WTr.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 YTr(`Could not init Parse for language <${t}>`,s):s}let n=await w2i(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(R2i,"parseTreeSitterIncludingVersion");function ZVa(t){switch(KTr(t)){case Ed.Python:return null;case Ed.JavaScript:case Ed.TypeScript:case Ed.TSX:case Ed.Go:case Ed.CSharp:case Ed.Java:case Ed.Php:case Ed.Cpp:return"}";case Ed.Ruby:return"end"}}a(ZVa,"getBlockCloseToken");function XVa(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(XVa,"innerQuery");var eWa=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function YVa(t){return WVa([zVa],t).length===1}a(YVa,"queryPythonIsDocstring")});var nIr=I(bAe=>{"use strict";p();Object.defineProperty(bAe,"__esModule",{value:!0});bAe.StatementTree=bAe.StatementNode=void 0;var KVa=Qre(),RD=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 tWa(t){return XVa([eWa],t).length===1}a(tWa,"queryPythonIsDocstring")});var iIr=I(SAe=>{"use strict";p();Object.defineProperty(SAe,"__esModule",{value:!0});SAe.StatementTree=SAe.StatementNode=void 0;var rWa=Qre(),kD=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}}};bAe.StatementNode=RD;var LR=class{static{a(this,"StatementTree")}static isSupported(e){return _Ae.languageIds.has(e)||vAe.languageIds.has(e)||v4e.languageIds.has(e)||CAe.languageIds.has(e)||C4e.languageIds.has(e)||b4e.languageIds.has(e)||S4e.languageIds.has(e)||T4e.languageIds.has(e)||I4e.languageIds.has(e)}static isTrimmedByDefault(e){return _Ae.languageIds.has(e)||vAe.languageIds.has(e)||CAe.languageIds.has(e)}static create(e,r,n,o){if(_Ae.languageIds.has(e))return new _Ae(e,r,n,o);if(vAe.languageIds.has(e))return new vAe(e,r,n,o);if(v4e.languageIds.has(e))return new v4e(e,r,n,o);if(CAe.languageIds.has(e))return new CAe(e,r,n,o);if(S4e.languageIds.has(e))return new S4e(e,r,n,o);if(C4e.languageIds.has(e))return new C4e(e,r,n,o);if(b4e.languageIds.has(e))return new b4e(e,r,n,o);if(T4e.languageIds.has(e))return new T4e(e,r,n,o);if(I4e.languageIds.has(e))return new I4e(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,KVa.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}}};SAe.StatementNode=kD;var BR=class{static{a(this,"StatementTree")}static isSupported(e){return vAe.languageIds.has(e)||CAe.languageIds.has(e)||b4e.languageIds.has(e)||bAe.languageIds.has(e)||S4e.languageIds.has(e)||T4e.languageIds.has(e)||I4e.languageIds.has(e)||x4e.languageIds.has(e)||w4e.languageIds.has(e)}static isTrimmedByDefault(e){return vAe.languageIds.has(e)||CAe.languageIds.has(e)||bAe.languageIds.has(e)}static create(e,r,n,o){if(vAe.languageIds.has(e))return new vAe(e,r,n,o);if(CAe.languageIds.has(e))return new CAe(e,r,n,o);if(b4e.languageIds.has(e))return new b4e(e,r,n,o);if(bAe.languageIds.has(e))return new bAe(e,r,n,o);if(I4e.languageIds.has(e))return new I4e(e,r,n,o);if(S4e.languageIds.has(e))return new S4e(e,r,n,o);if(T4e.languageIds.has(e))return new T4e(e,r,n,o);if(x4e.languageIds.has(e))return new x4e(e,r,n,o);if(w4e.languageIds.has(e))return new w4e(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,rWa.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(` -`)}};bAe.StatementTree=LR;var syt=class t extends RD{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"}},_Ae=class extends LR{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new syt(e)}getStatementQueryText(){return`[ +`)}};SAe.StatementTree=BR;var ayt=class t extends kD{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"}},vAe=class extends BR{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new ayt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -827,7 +827,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (labeled_statement) (method_definition) (field_definition) - ] @statement`}},vAe=class extends LR{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new syt(e)}getStatementQueryText(){return`[ + ] @statement`}},CAe=class extends BR{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new ayt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -850,7 +850,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},KTr=class t extends RD{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}},v4e=class extends LR{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new KTr(e)}getStatementQueryText(){return`[ + ] @statement`}},JTr=class t extends kD{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}},b4e=class extends BR{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new JTr(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -876,24 +876,24 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (decorated_definition) (match_statement) (block) - ] @statement`}},JTr=class t extends RD{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)}},CAe=class extends LR{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new JTr(e)}getStatementQueryText(){return`[ + ] @statement`}},ZTr=class t extends kD{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)}},bAe=class extends BR{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new ZTr(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},ZTr=class t extends RD{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)}},C4e=class extends LR{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new ZTr(e)}getStatementQueryText(){return`[ + ] @statement`}},XTr=class t extends kD{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)}},S4e=class extends BR{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new XTr(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},XTr=class t extends RD{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)}},b4e=class extends LR{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new XTr(e)}getStatementQueryText(){return`[ + ] @statement`}},eIr=class t extends kD{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)}},T4e=class extends BR{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new eIr(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},eIr=class t extends RD{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"}},S4e=class extends LR{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new eIr(e)}getStatementQueryText(){return`[ + ] @statement`}},tIr=class t extends kD{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"}},I4e=class extends BR{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new tIr(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -906,7 +906,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (block) (static_initializer) (constructor_declaration) - ] @statement`}},tIr=class t extends RD{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"}},T4e=class extends LR{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new tIr(e)}getStatementQueryText(){return`[ + ] @statement`}},rIr=class t extends kD{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"}},x4e=class extends BR{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new rIr(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -918,7 +918,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (declaration) (accessor_declaration) (block) - ] @statement`}},rIr=class t extends RD{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)}},I4e=class extends LR{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new rIr(e)}getStatementQueryText(){return`[ + ] @statement`}},nIr=class t extends kD{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)}},w4e=class extends BR{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new nIr(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -955,30 +955,30 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}}});var SAe=I(kD=>{"use strict";p();Object.defineProperty(kD,"__esModule",{value:!0});kD.BlockPositionType=kD.TerseBlockTrimmer=kD.VerboseBlockTrimmer=kD.BlockTrimmer=void 0;kD.getBlockPositionType=JVa;var ayt=nIr(),x4e=class{static{a(this,"BlockTrimmer")}static isSupported(e){return ayt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return ayt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=ayt.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}};kD.BlockTrimmer=x4e;var iIr=class extends x4e{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}};kD.VerboseBlockTrimmer=iIr;var oIr=class extends x4e{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 ZVa=PD&&PD.__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},I2i=PD&&PD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(PD,"__esModule",{value:!0});PD.ConfigBlockModeConfig=PD.ICompletionsBlockModeConfig=void 0;var XVa=nn(),eWa=Gs(),X4=C2i(),w2i=Qre(),x2i=LE(),tWa=fy(),rWa=SAe(),nWa=nIr();PD.ICompletionsBlockModeConfig=(0,XVa.createServiceIdentifier)("ICompletionsBlockModeConfig");var aIr=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 sIr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(x2i.getConfig,x2i.ConfigKey.AlwaysRequestMultiline)??o)||rWa.BlockTrimmer.isTrimmedByDefault(e)?sIr(X4.BlockMode.MoreMultiline,e):e==="ruby"?X4.BlockMode.Parsing:(0,w2i.isSupportedLanguageId)(e)?X4.BlockMode.ParsingAndServer:X4.BlockMode.Server}};PD.ConfigBlockModeConfig=aIr;PD.ConfigBlockModeConfig=aIr=ZVa([I2i(0,eWa.IInstantiationService),I2i(1,tWa.ICompletionsFeaturesService)],aIr);function iWa(t){return[X4.BlockMode.Parsing,X4.BlockMode.ParsingAndServer,X4.BlockMode.MoreMultiline].includes(t)}a(iWa,"blockModeRequiresTreeSitter");function sIr(t,e){return t===X4.BlockMode.MoreMultiline&&nWa.StatementTree.isSupported(e)?t:iWa(t)&&!(0,w2i.isSupportedLanguageId)(e)?X4.BlockMode.Server:t}a(sIr,"toApplicableBlockMode")});var a$=I(cyt=>{"use strict";p();Object.defineProperty(cyt,"__esModule",{value:!0});cyt.ResultType=void 0;var R2i;(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"})(R2i||(cyt.ResultType=R2i={}))});var uIr=I(TAe=>{"use strict";p();Object.defineProperty(TAe,"__esModule",{value:!0});TAe.CurrentGhostText=TAe.ICompletionsCurrentGhostText=void 0;var oWa=nn(),sWa=a$();TAe.ICompletionsCurrentGhostText=(0,oWa.createServiceIdentifier)("ICompletionsCurrentGhostText");var lIr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==sWa.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&k2i(this.choices[0].completionText,n))return aWa(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)}};TAe.CurrentGhostText=lIr;function aWa(t,e){return t.filter(r=>k2i(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(aWa,"adjustChoicesStart");function k2i(t,e){return t.startsWith(e)&&t.length>e.length}a(k2i,"startsWithAndExceeds")});var P2i=I(S6=>{"use strict";p();var cWa=S6&&S6.__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},lWa=S6&&S6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(S6,"__esModule",{value:!0});S6.ChangeTracker=void 0;var uWa=s1(),dIr=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)}};S6.ChangeTracker=dIr;S6.ChangeTracker=dIr=cWa([lWa(2,uWa.ICompletionsTextDocumentManagerService)],dIr)});var pIr=I(w4e=>{"use strict";p();Object.defineProperty(w4e,"__esModule",{value:!0});w4e.CompletionState=void 0;w4e.createCompletionState=dWa;var fIr=o4e(),lyt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??fIr.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(IAe,"__esModule",{value:!0});IAe.SpeculativeRequestCache=IAe.ICompletionsSpeculativeRequestCache=void 0;var fWa=nn(),pWa=C6();IAe.ICompletionsSpeculativeRequestCache=(0,fWa.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var hIr=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new pWa.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())}};IAe.SpeculativeRequestCache=hIr});var xAe=I(Mv=>{"use strict";p();Object.defineProperty(Mv,"__esModule",{value:!0});Mv.logger=Mv.GHOST_TEXT_CATEGORY=void 0;Mv.telemetryShown=mWa;Mv.telemetryAccepted=gWa;Mv.telemetryRejected=AWa;Mv.mkCanceledResultTelemetry=yWa;Mv.mkBasicResultTelemetry=EWa;Mv.handleGhostTextResultTelemetry=_Wa;Mv.resultTypeToString=mIr;var D2i=Dl(),qre=$g(),R4e=a$(),hWa=uyt();Mv.GHOST_TEXT_CATEGORY="ghostText";Mv.logger=new D2i.Logger("getCompletions");function mWa(t,e){t.get(hWa.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=mIr(e.resultType),(0,qre.telemetry)(t,"ghostText.shown",e.telemetry)}a(mWa,"telemetryShown");function gWa(t,e,r){let n=e+".accepted";(0,qre.telemetry)(t,n,r)}a(gWa,"telemetryAccepted");function AWa(t,e,r){let n=e+".rejected";(0,qre.telemetry)(t,n,r)}a(AWa,"telemetryRejected");function yWa(t,e={}){return{...e,telemetryBlob:t}}a(yWa,"mkCanceledResultTelemetry");function EWa(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(EWa,"mkBasicResultTelemetry");function _Wa(t,e){let r=t.get(D2i.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,qre.now)()-e.telemetryBlob.issuedTime,o=mIr(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 Mv.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,qre.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(Mv.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,qre.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,qre.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(_Wa,"handleGhostTextResultTelemetry");function mIr(t){switch(t){case R4e.ResultType.Network:return"network";case R4e.ResultType.Cache:return"cache";case R4e.ResultType.Cycling:return"cycling";case R4e.ResultType.TypingAsSuggested:return"typingAsSuggested";case R4e.ResultType.Async:return"async"}}a(mIr,"resultTypeToString")});var O2i=I(wAe=>{"use strict";p();Object.defineProperty(wAe,"__esModule",{value:!0});wAe.getBlockParser=pyt;wAe.isEmptyBlockStart=SWa;wAe.isBlockBodyFinished=TWa;wAe.getNodeStart=IWa;var c$=Qre(),dyt=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,c$.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)}},fyt=class extends dyt{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(PD,"__esModule",{value:!0});PD.BlockPositionType=PD.TerseBlockTrimmer=PD.VerboseBlockTrimmer=PD.BlockTrimmer=void 0;PD.getBlockPositionType=nWa;var cyt=iIr(),R4e=class{static{a(this,"BlockTrimmer")}static isSupported(e){return cyt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return cyt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=cyt.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}};PD.BlockTrimmer=R4e;var oIr=class extends R4e{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}};PD.VerboseBlockTrimmer=oIr;var sIr=class extends R4e{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 iWa=DD&&DD.__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},k2i=DD&&DD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(DD,"__esModule",{value:!0});DD.ConfigBlockModeConfig=DD.ICompletionsBlockModeConfig=void 0;var oWa=nn(),sWa=Gs(),X4=I2i(),D2i=Qre(),P2i=LE(),aWa=fy(),cWa=TAe(),lWa=iIr();DD.ICompletionsBlockModeConfig=(0,oWa.createServiceIdentifier)("ICompletionsBlockModeConfig");var cIr=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 aIr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(P2i.getConfig,P2i.ConfigKey.AlwaysRequestMultiline)??o)||cWa.BlockTrimmer.isTrimmedByDefault(e)?aIr(X4.BlockMode.MoreMultiline,e):e==="ruby"?X4.BlockMode.Parsing:(0,D2i.isSupportedLanguageId)(e)?X4.BlockMode.ParsingAndServer:X4.BlockMode.Server}};DD.ConfigBlockModeConfig=cIr;DD.ConfigBlockModeConfig=cIr=iWa([k2i(0,sWa.IInstantiationService),k2i(1,aWa.ICompletionsFeaturesService)],cIr);function uWa(t){return[X4.BlockMode.Parsing,X4.BlockMode.ParsingAndServer,X4.BlockMode.MoreMultiline].includes(t)}a(uWa,"blockModeRequiresTreeSitter");function aIr(t,e){return t===X4.BlockMode.MoreMultiline&&lWa.StatementTree.isSupported(e)?t:uWa(t)&&!(0,D2i.isSupportedLanguageId)(e)?X4.BlockMode.Server:t}a(aIr,"toApplicableBlockMode")});var c$=I(lyt=>{"use strict";p();Object.defineProperty(lyt,"__esModule",{value:!0});lyt.ResultType=void 0;var N2i;(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"})(N2i||(lyt.ResultType=N2i={}))});var dIr=I(IAe=>{"use strict";p();Object.defineProperty(IAe,"__esModule",{value:!0});IAe.CurrentGhostText=IAe.ICompletionsCurrentGhostText=void 0;var dWa=nn(),fWa=c$();IAe.ICompletionsCurrentGhostText=(0,dWa.createServiceIdentifier)("ICompletionsCurrentGhostText");var uIr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==fWa.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&M2i(this.choices[0].completionText,n))return pWa(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)}};IAe.CurrentGhostText=uIr;function pWa(t,e){return t.filter(r=>M2i(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(pWa,"adjustChoicesStart");function M2i(t,e){return t.startsWith(e)&&t.length>e.length}a(M2i,"startsWithAndExceeds")});var O2i=I(T6=>{"use strict";p();var hWa=T6&&T6.__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},mWa=T6&&T6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(T6,"__esModule",{value:!0});T6.ChangeTracker=void 0;var gWa=s1(),fIr=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)}};T6.ChangeTracker=fIr;T6.ChangeTracker=fIr=hWa([mWa(2,gWa.ICompletionsTextDocumentManagerService)],fIr)});var hIr=I(k4e=>{"use strict";p();Object.defineProperty(k4e,"__esModule",{value:!0});k4e.CompletionState=void 0;k4e.createCompletionState=AWa;var pIr=a4e(),uyt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??pIr.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(xAe,"__esModule",{value:!0});xAe.SpeculativeRequestCache=xAe.ICompletionsSpeculativeRequestCache=void 0;var yWa=nn(),EWa=b6();xAe.ICompletionsSpeculativeRequestCache=(0,yWa.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var mIr=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new EWa.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())}};xAe.SpeculativeRequestCache=mIr});var wAe=I(Ov=>{"use strict";p();Object.defineProperty(Ov,"__esModule",{value:!0});Ov.logger=Ov.GHOST_TEXT_CATEGORY=void 0;Ov.telemetryShown=vWa;Ov.telemetryAccepted=CWa;Ov.telemetryRejected=bWa;Ov.mkCanceledResultTelemetry=SWa;Ov.mkBasicResultTelemetry=TWa;Ov.handleGhostTextResultTelemetry=IWa;Ov.resultTypeToString=gIr;var L2i=Dl(),qre=$g(),P4e=c$(),_Wa=dyt();Ov.GHOST_TEXT_CATEGORY="ghostText";Ov.logger=new L2i.Logger("getCompletions");function vWa(t,e){t.get(_Wa.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=gIr(e.resultType),(0,qre.telemetry)(t,"ghostText.shown",e.telemetry)}a(vWa,"telemetryShown");function CWa(t,e,r){let n=e+".accepted";(0,qre.telemetry)(t,n,r)}a(CWa,"telemetryAccepted");function bWa(t,e,r){let n=e+".rejected";(0,qre.telemetry)(t,n,r)}a(bWa,"telemetryRejected");function SWa(t,e={}){return{...e,telemetryBlob:t}}a(SWa,"mkCanceledResultTelemetry");function TWa(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(TWa,"mkBasicResultTelemetry");function IWa(t,e){let r=t.get(L2i.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,qre.now)()-e.telemetryBlob.issuedTime,o=gIr(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 Ov.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,qre.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(Ov.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,qre.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,qre.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(IWa,"handleGhostTextResultTelemetry");function gIr(t){switch(t){case P4e.ResultType.Network:return"network";case P4e.ResultType.Cache:return"cache";case P4e.ResultType.Cycling:return"cycling";case P4e.ResultType.TypingAsSuggested:return"typingAsSuggested";case P4e.ResultType.Async:return"async"}}a(gIr,"resultTypeToString")});var U2i=I(RAe=>{"use strict";p();Object.defineProperty(RAe,"__esModule",{value:!0});RAe.getBlockParser=hyt;RAe.isEmptyBlockStart=kWa;RAe.isBlockBodyFinished=PWa;RAe.getNodeStart=DWa;var l$=Qre(),fyt=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,l$.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)}},pyt=class extends fyt{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(M2i,"rewindToNearestNonWs");function N2i(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(N2i,"indent");function CWa(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=N2i(t,r),o=N2i(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(CWa,"outdented");var eL=class extends dyt{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,c$.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(E=>E.type==="formal_parameters"))return!0}else{let y=c.children;for(let E=0;Ey.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()}}},bWa={python:new eL("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 eL("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 eL("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 eL("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 fyt("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 fyt("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 eL("csharp",{},new Map([]),[],"block",null,!0),java:new eL("java",{},new Map([]),[],"block",null,!0),php:new eL("php",{},new Map([]),[],"block",null,!0),cpp:new eL("cpp",{},new Map([]),[],"block",null,!0)};function pyt(t){if(!(0,c$.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return bWa[(0,c$.languageIdToWasmLanguage)(t)]}a(pyt,"getBlockParser");async function SWa(t,e,r){return(0,c$.isSupportedLanguageId)(t)?pyt(t).isEmptyBlockStart(e,r):!1}a(SWa,"isEmptyBlockStart");async function TWa(t,e,r,n){if((0,c$.isSupportedLanguageId)(t))return pyt(t).isBlockBodyFinished(e,r,n)}a(TWa,"isBlockBodyFinished");async function IWa(t,e,r){if((0,c$.isSupportedLanguageId)(t))return pyt(t).getNodeStart(e,r)}a(IWa,"getNodeStart")});var gyt=I(l$=>{"use strict";p();Object.defineProperty(l$,"__esModule",{value:!0});l$.parsingBlockFinished=xWa;l$.isEmptyBlockStartUtil=wWa;l$.getNodeStartUtil=RWa;l$.contextIndentation=NWa;l$.contextIndentationFromText=L2i;l$.indentationBlockFinished=LWa;var gIr=O2i(),myt=mAe();function xWa(t,e){let r=t.getText(myt.LocationFactory.range(myt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,gIr.isBlockBodyFinished)(o,r,s,n)}a(xWa,"parsingBlockFinished");function wWa(t,e){return(0,gIr.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(wWa,"isEmptyBlockStartUtil");async function RWa(t,e,r){let o=t.getText(myt.LocationFactory.range(myt.LocationFactory.position(0,0),e))+r,s=await(0,gIr.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(RWa,"getNodeStartUtil");var kWa=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),PWa=new RegExp(`^(${kWa.join("|")})`);function DWa(t){return PWa.test(t.trimLeft().toLowerCase())}a(DWa,"isContinuationLine");function hyt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(hyt,"indentationOfLine");function NWa(t,e){let r=t.getText(),n=t.offsetAt(e);return L2i(r,n,t.detectedLanguageId)}a(NWa,"contextIndentation");function L2i(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(xWa,"getLineAtOffset");function F2i(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(F2i,"rewindToNearestNonWs");function B2i(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(B2i,"indent");function wWa(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=B2i(t,r),o=B2i(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(wWa,"outdented");var eL=class extends fyt{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,l$.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(E=>E.type==="formal_parameters"))return!0}else{let y=c.children;for(let E=0;Ey.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()}}},RWa={python:new eL("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 eL("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 eL("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 eL("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 pyt("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 pyt("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 eL("csharp",{},new Map([]),[],"block",null,!0),java:new eL("java",{},new Map([]),[],"block",null,!0),php:new eL("php",{},new Map([]),[],"block",null,!0),cpp:new eL("cpp",{},new Map([]),[],"block",null,!0)};function hyt(t){if(!(0,l$.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return RWa[(0,l$.languageIdToWasmLanguage)(t)]}a(hyt,"getBlockParser");async function kWa(t,e,r){return(0,l$.isSupportedLanguageId)(t)?hyt(t).isEmptyBlockStart(e,r):!1}a(kWa,"isEmptyBlockStart");async function PWa(t,e,r,n){if((0,l$.isSupportedLanguageId)(t))return hyt(t).isBlockBodyFinished(e,r,n)}a(PWa,"isBlockBodyFinished");async function DWa(t,e,r){if((0,l$.isSupportedLanguageId)(t))return hyt(t).getNodeStart(e,r)}a(DWa,"getNodeStart")});var Ayt=I(u$=>{"use strict";p();Object.defineProperty(u$,"__esModule",{value:!0});u$.parsingBlockFinished=NWa;u$.isEmptyBlockStartUtil=MWa;u$.getNodeStartUtil=OWa;u$.contextIndentation=UWa;u$.contextIndentationFromText=Q2i;u$.indentationBlockFinished=jWa;var AIr=U2i(),gyt=gAe();function NWa(t,e){let r=t.getText(gyt.LocationFactory.range(gyt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,AIr.isBlockBodyFinished)(o,r,s,n)}a(NWa,"parsingBlockFinished");function MWa(t,e){return(0,AIr.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(MWa,"isEmptyBlockStartUtil");async function OWa(t,e,r){let o=t.getText(gyt.LocationFactory.range(gyt.LocationFactory.position(0,0),e))+r,s=await(0,AIr.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(OWa,"getNodeStartUtil");var LWa=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),BWa=new RegExp(`^(${LWa.join("|")})`);function FWa(t){return BWa.test(t.trimLeft().toLowerCase())}a(FWa,"isContinuationLine");function myt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(myt,"indentationOfLine");function UWa(t,e){let r=t.getText(),n=t.offsetAt(e);return Q2i(r,n,t.detectedLanguageId)}a(UWa,"contextIndentation");function Q2i(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=hyt(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=hyt(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=myt(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=myt(n[f]);if(h!==void 0&&h{let n=OWa(r,t,e);return n==="continue"?void 0:n}}a(LWa,"indentationBlockFinished")});var k4e=I(Yg=>{"use strict";p();Object.defineProperty(Yg,"__esModule",{value:!0});Yg.languageMarkers=void 0;Yg.mdCodeBlockLangToLanguageId=BWa;Yg.isShebangLine=QWa;Yg.hasLanguageMarker=F2i;Yg.comment=U2i;Yg.commentBlockAsSingles=qWa;Yg.getLanguageMarker=jWa;Yg.getPathMarker=HWa;Yg.newLineEnded=GWa;Yg.getLanguage=$Wa;Yg.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 AIr={};for(let[t,e]of Object.entries(Yg.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)AIr[r]=t;else AIr[t]=t;function BWa(t){return AIr[t]}a(BWa,"mdCodeBlockLangToLanguageId");var FWa={start:"//",end:""},UWa=["php","plaintext"],yIr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function QWa(t){return Object.values(yIr).includes(t.trim())}a(QWa,"isShebangLine");function F2i({source:t}){return t.startsWith("#!")||t.startsWith("{let n=qWa(r,t,e);return n==="continue"?void 0:n}}a(jWa,"indentationBlockFinished")});var D4e=I(Yg=>{"use strict";p();Object.defineProperty(Yg,"__esModule",{value:!0});Yg.languageMarkers=void 0;Yg.mdCodeBlockLangToLanguageId=HWa;Yg.isShebangLine=VWa;Yg.hasLanguageMarker=j2i;Yg.comment=H2i;Yg.commentBlockAsSingles=WWa;Yg.getLanguageMarker=zWa;Yg.getPathMarker=YWa;Yg.newLineEnded=KWa;Yg.getLanguage=JWa;Yg.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 yIr={};for(let[t,e]of Object.entries(Yg.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)yIr[r]=t;else yIr[t]=t;function HWa(t){return yIr[t]}a(HWa,"mdCodeBlockLangToLanguageId");var GWa={start:"//",end:""},$Wa=["php","plaintext"],EIr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function VWa(t){return Object.values(EIr).includes(t.trim())}a(VWa,"isShebangLine");function j2i({source:t}){return t.startsWith("#!")||t.startsWith("U2i(s,e)).join(` +`).map(s=>H2i(s,e)).join(` `);return r?o+` -`:o}a(qWa,"commentBlockAsSingles");function jWa(t){let{languageId:e}=t;return UWa.indexOf(e)===-1&&!F2i(t)?e in yIr?yIr[e]:`Language: ${e}`:""}a(jWa,"getLanguageMarker");function HWa(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(HWa,"getPathMarker");function GWa(t){return t===""||t.endsWith(` +`:o}a(WWa,"commentBlockAsSingles");function zWa(t){let{languageId:e}=t;return $Wa.indexOf(e)===-1&&!j2i(t)?e in EIr?EIr[e]:`Language: ${e}`:""}a(zWa,"getLanguageMarker");function YWa(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(YWa,"getPathMarker");function KWa(t){return t===""||t.endsWith(` `)?t:t+` -`}a(GWa,"newLineEnded");function $Wa(t){return B2i(typeof t=="string"?t:"plaintext")}a($Wa,"getLanguage");function B2i(t){return Yg.languageMarkers[t]!==void 0?{languageId:t,...Yg.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(B2i,"_getLanguage")});var _Ir=I(EIr=>{"use strict";p();Object.defineProperty(EIr,"__esModule",{value:!0});EIr.getCursorContext=zWa;var Q2i=Ore(),VWa={tokenizerName:Q2i.TokenizerName.o200k};function WWa(t){return{...VWa,...t}}a(WWa,"cursorContextOptions");function zWa(t,e={}){let r=WWa(e),n=(0,Q2i.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(KWa,"newLineEnded");function JWa(t){return q2i(typeof t=="string"?t:"plaintext")}a(JWa,"getLanguage");function q2i(t){return Yg.languageMarkers[t]!==void 0?{languageId:t,...Yg.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(q2i,"_getLanguage")});var vIr=I(_Ir=>{"use strict";p();Object.defineProperty(_Ir,"__esModule",{value:!0});_Ir.getCursorContext=eza;var G2i=Ore(),ZWa={tokenizerName:G2i.TokenizerName.o200k};function XWa(t){return{...ZWa,...t}}a(XWa,"cursorContextOptions");function eza(t,e={}){let r=XWa(e),n=(0,G2i.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(zWa,"getCursorContext")});var vIr=I(jre=>{"use strict";p();Object.defineProperty(jre,"__esModule",{value:!0});jre.SnippetSemantics=jre.SnippetProviderType=void 0;jre.announceSnippet=KWa;var q2i;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(q2i||(jre.SnippetProviderType=q2i={}));var a1;(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"})(a1||(jre.SnippetSemantics=a1={}));var YWa={[a1.Function]:"function",[a1.Snippet]:"snippet",[a1.Snippets]:"snippets",[a1.Variable]:"variable",[a1.Parameter]:"parameter",[a1.Method]:"method",[a1.Class]:"class",[a1.Module]:"module",[a1.Alias]:"alias",[a1.Enum]:"enum member",[a1.Interface]:"interface"};function KWa(t){let e=YWa[t.semantics],r=[a1.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(KWa,"announceSnippet")});var TIr=I(Gre=>{"use strict";p();Object.defineProperty(Gre,"__esModule",{value:!0});Gre.WindowedMatcher=Gre.SortOptions=void 0;Gre.splitIntoWords=G2i;var j2i=vIr(),CIr=class{static{a(this,"FifoCache")}constructor(e){this.keys=[],this.cache={},this.size=e}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]}},Hre;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(Hre||(Gre.SortOptions=Hre={}));var bIr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=XWa.get(e.languageId)??ZWa}tokenize(e){return new Set(G2i(e).filter(r=>!this.stopsForLanguage.has(r)))}},H2i=new CIr(20),SIr=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new bIr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=Hre.Descending){return r===Hre.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===Hre.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=Hre.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=H2i.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(E=>A.add(E),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].score{"use strict";p();Object.defineProperty(jre,"__esModule",{value:!0});jre.SnippetSemantics=jre.SnippetProviderType=void 0;jre.announceSnippet=rza;var $2i;(function(t){t.SimilarFiles="similar-files",t.Path="path"})($2i||(jre.SnippetProviderType=$2i={}));var a1;(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"})(a1||(jre.SnippetSemantics=a1={}));var tza={[a1.Function]:"function",[a1.Snippet]:"snippet",[a1.Snippets]:"snippets",[a1.Variable]:"variable",[a1.Parameter]:"parameter",[a1.Method]:"method",[a1.Class]:"class",[a1.Module]:"module",[a1.Alias]:"alias",[a1.Enum]:"enum member",[a1.Interface]:"interface"};function rza(t){let e=tza[t.semantics],r=[a1.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(rza,"announceSnippet")});var IIr=I(Gre=>{"use strict";p();Object.defineProperty(Gre,"__esModule",{value:!0});Gre.WindowedMatcher=Gre.SortOptions=void 0;Gre.splitIntoWords=z2i;var V2i=CIr(),bIr=class{static{a(this,"FifoCache")}constructor(e){this.keys=[],this.cache={},this.size=e}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]}},Hre;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(Hre||(Gre.SortOptions=Hre={}));var SIr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=oza.get(e.languageId)??iza}tokenize(e){return new Set(z2i(e).filter(r=>!this.stopsForLanguage.has(r)))}},W2i=new bIr(20),TIr=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new SIr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=Hre.Descending){return r===Hre.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===Hre.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=Hre.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=W2i.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(E=>A.add(E),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(G2i,"splitIntoWords");var JWa=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"]),ZWa=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",...JWa]),XWa=new Map([])});var IIr=I(BR=>{"use strict";p();Object.defineProperty(BR,"__esModule",{value:!0});BR.virtualNode=eza;BR.lineNode=tza;BR.blankNode=rza;BR.topNode=nza;BR.isBlank=iza;BR.isLine=oza;BR.isVirtual=$2i;BR.isTop=V2i;BR.cutTreeAfterLine=sza;BR.duplicateTree=aza;function eza(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(eza,"virtualNode");function tza(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(tza,"lineNode");function rza(t){return{type:"blank",lineNumber:t,subs:[]}}a(rza,"blankNode");function nza(t){return{type:"top",indentation:-1,subs:t??[]}}a(nza,"topNode");function iza(t){return t.type==="blank"}a(iza,"isBlank");function oza(t){return t.type==="line"}a(oza,"isLine");function $2i(t){return t.type==="virtual"}a($2i,"isVirtual");function V2i(t){return t.type==="top"}a(V2i,"isTop");function sza(t,e){function r(n){if(!$2i(n)&&!V2i(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(tL,"__esModule",{value:!0});tL.clearLabels=cza;tL.clearLabelsIf=lza;tL.mapLabels=wIr;tL.resetLineNumbers=uza;tL.visitTree=P4e;tL.visitTreeConditionally=dza;tL.foldTree=fza;tL.rebuildTree=pza;var xIr=IIr();function cza(t){return P4e(t,e=>{e.label=void 0},"bottomUp"),t}a(cza,"clearLabels");function lza(t,e){return P4e(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(lza,"clearLabelsIf");function wIr(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>wIr(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=>wIr(r,e)),label:t.label?e(t.label):void 0}}}a(wIr,"mapLabels");function uza(t){let e=0;function r(n){!(0,xIr.isVirtual)(n)&&!(0,xIr.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),P4e(t,r,"topDown")}a(uza,"resetLineNumbers");function P4e(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(P4e,"visitTree");function dza(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(dza,"visitTreeConditionally");function fza(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),P4e(t,s,n),o}a(fza,"foldTree");function pza(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,xIr.topNode)()}a(pza,"rebuildTree")});var Z2i=I(DD=>{"use strict";p();Object.defineProperty(DD,"__esModule",{value:!0});DD.parseRaw=W2i;DD.labelLines=z2i;DD.labelVirtualInherited=hza;DD.buildLabelRules=Y2i;DD.combineClosersAndOpeners=K2i;DD.groupBlocks=mza;DD.flattenVirtual=gza;DD.registerLanguageSpecificParser=Eza;DD.parseTree=_za;var Kg=IIr(),RAe=RIr();function W2i(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,Kg.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,RAe.visitTree)(t,r,"bottomUp")}a(z2i,"labelLines");function hza(t){function e(r){if((0,Kg.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,Kg.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,RAe.visitTree)(t,e,"bottomUp")}a(hza,"labelVirtualInherited");function Y2i(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(Y2i,"buildLabelRules");function K2i(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,Kg.isLine)(l)||(0,Kg.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,Kg.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,Kg.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,Kg.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,RAe.rebuildTree)(t,e);return(0,RAe.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(K2i,"combineClosersAndOpeners");function mza(t,e=Kg.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,Kg.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(Ayt,"__esModule",{value:!0});Ayt.getBasicWindowDelineations=Cza;Ayt.getIndentationWindowsDelineations=bza;var X2i=RIr(),vza=Z2i();function Cza(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),E=f(A,y),_=g===A?E:f(g,y);for(r<=E-y&&o.push([y,_]);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(bza,"getIndentationWindowsDelineations")});var tDi=I(D4e=>{"use strict";p();Object.defineProperty(D4e,"__esModule",{value:!0});D4e.FixedWindowSizeJaccardMatcher=void 0;D4e.computeScore=eDi;var Sza=_Ir(),Tza=TIr(),Iza=kIr(),PIr=class t extends Tza.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,Iza.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,Sza.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return eDi(e,r)}};D4e.FixedWindowSizeJaccardMatcher=PIr;function eDi(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(eDi,"computeScore")});var nDi=I(yyt=>{"use strict";p();Object.defineProperty(yyt,"__esModule",{value:!0});yyt.BlockTokenSubsetMatcher=void 0;var xza=Qre(),rDi=_Ir(),wza=TIr(),Rza=kIr(),DIr=class t extends wza.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,Rza.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,rDi.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,rDi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return kza(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,xza.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}}};yyt.BlockTokenSubsetMatcher=DIr;function kza(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(kza,"computeScore")});var Eyt=I(ND=>{"use strict";p();Object.defineProperty(ND,"__esModule",{value:!0});ND.defaultCppSimilarFilesOptions=ND.nullSimilarFilesOptions=ND.conservativeFilesOptions=ND.defaultSimilarFilesOptions=void 0;ND.getSimilarSnippets=Fza;var Pza=tDi(),Dza=nDi(),Nza=0,Mza=60,Oza=4,Lza=1,iDi=20,oDi=1e4;ND.defaultSimilarFilesOptions={snippetLength:Mza,threshold:Nza,maxTopSnippets:Oza,maxCharPerFile:oDi,maxNumberOfFiles:iDi,maxSnippetsPerFile:Lza,useSubsetMatching:!1};ND.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:oDi,maxNumberOfFiles:iDi,maxSnippetsPerFile:1};ND.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};ND.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function Bza(t,e){return(e.useSubsetMatching?Dza.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):Pza.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(Bza,"getMatcher");async function Fza(t,e,r){let n=Bza(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(Fza,"getSimilarSnippets")});var aDi=I(_yt=>{"use strict";p();Object.defineProperty(_yt,"__esModule",{value:!0});_yt.getCppSimilarFilesOptions=Qza;_yt.getCppNumberOfSnippets=qza;var sDi=Eyt(),Uza=vyt();function Qza(t,e){return{...sDi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,Uza.useSubsetMatching)(t,e)}}a(Qza,"getCppSimilarFilesOptions");function qza(t){return sDi.defaultCppSimilarFilesOptions.maxTopSnippets}a(qza,"getCppNumberOfSnippets")});var vyt=I(N4e=>{"use strict";p();Object.defineProperty(N4e,"__esModule",{value:!0});N4e.getSimilarFilesOptions=Vza;N4e.getNumberOfSnippets=zza;N4e.useSubsetMatching=uDi;var jza=JG(),Hza=Eyt(),cDi=LE(),Gza=M0t(),lDi=aDi(),$za=new Map([["cpp",lDi.getCppSimilarFilesOptions]]);function Vza(t,e,r){let n=$za.get(r);return n?n(t,e):{...Hza.defaultSimilarFilesOptions,useSubsetMatching:uDi(t,e)}}a(Vza,"getSimilarFilesOptions");var Wza=new Map([["cpp",lDi.getCppNumberOfSnippets]]);function zza(t,e){let r=Wza.get(e);return r?r(t):jza.DEFAULT_NUM_SNIPPETS}a(zza,"getNumberOfSnippets");function uDi(t,e){return(e.filtersAndExp.exp.variables[Gza.ExpTreatmentVariables.UseSubsetMatching]||(0,cDi.getConfig)(t,cDi.ConfigKey.UseSubsetMatching))??!1}a(uDi,"useSubsetMatching")});var M4e=I($re=>{"use strict";p();Object.defineProperty($re,"__esModule",{value:!0});$re.convertToAPIChoice=Zza;$re.getTemperatureForSamples=tYa;$re.getStops=nYa;$re.getTopP=iYa;$re.getMaxSolutionTokens=oYa;var Yza=T0(),Kza=JG(),dDi=Dl(),Jza=$g();function Zza(t,e,r,n,o,s,c){return(0,Jza.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:Xza(t,r),meanAlternativeLogProb:eYa(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,Yza.generateUuid)(),finishReason:r.finish_reason}}a(Zza,"convertToAPIChoice");function Xza(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){dDi.logger.exception(t,r,"Error calculating mean prob")}}a(Xza,"calculateMeanLogProb");function eYa(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){dDi.logger.exception(t,r,"Error calculating mean prob")}}a(eYa,"calculateMeanAlternativeLogProb");function tYa(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(tYa,"getTemperatureForSamples");var rYa={markdown:[` +`);s.push({snippet:l,semantics:V2i.SnippetSemantics.Snippet,provider:V2i.SnippetProviderType.SimilarFiles,...o[c]})}return s}};Gre.WindowedMatcher=TIr;function z2i(t){return t.split(/[^a-zA-Z0-9]/).filter(e=>e.length>0)}a(z2i,"splitIntoWords");var nza=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"]),iza=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",...nza]),oza=new Map([])});var xIr=I(FR=>{"use strict";p();Object.defineProperty(FR,"__esModule",{value:!0});FR.virtualNode=sza;FR.lineNode=aza;FR.blankNode=cza;FR.topNode=lza;FR.isBlank=uza;FR.isLine=dza;FR.isVirtual=Y2i;FR.isTop=K2i;FR.cutTreeAfterLine=fza;FR.duplicateTree=pza;function sza(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(sza,"virtualNode");function aza(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(aza,"lineNode");function cza(t){return{type:"blank",lineNumber:t,subs:[]}}a(cza,"blankNode");function lza(t){return{type:"top",indentation:-1,subs:t??[]}}a(lza,"topNode");function uza(t){return t.type==="blank"}a(uza,"isBlank");function dza(t){return t.type==="line"}a(dza,"isLine");function Y2i(t){return t.type==="virtual"}a(Y2i,"isVirtual");function K2i(t){return t.type==="top"}a(K2i,"isTop");function fza(t,e){function r(n){if(!Y2i(n)&&!K2i(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(tL,"__esModule",{value:!0});tL.clearLabels=hza;tL.clearLabelsIf=mza;tL.mapLabels=RIr;tL.resetLineNumbers=gza;tL.visitTree=N4e;tL.visitTreeConditionally=Aza;tL.foldTree=yza;tL.rebuildTree=Eza;var wIr=xIr();function hza(t){return N4e(t,e=>{e.label=void 0},"bottomUp"),t}a(hza,"clearLabels");function mza(t,e){return N4e(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(mza,"clearLabelsIf");function RIr(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>RIr(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=>RIr(r,e)),label:t.label?e(t.label):void 0}}}a(RIr,"mapLabels");function gza(t){let e=0;function r(n){!(0,wIr.isVirtual)(n)&&!(0,wIr.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),N4e(t,r,"topDown")}a(gza,"resetLineNumbers");function N4e(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(N4e,"visitTree");function Aza(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(Aza,"visitTreeConditionally");function yza(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),N4e(t,s,n),o}a(yza,"foldTree");function Eza(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,wIr.topNode)()}a(Eza,"rebuildTree")});var rDi=I(ND=>{"use strict";p();Object.defineProperty(ND,"__esModule",{value:!0});ND.parseRaw=J2i;ND.labelLines=Z2i;ND.labelVirtualInherited=_za;ND.buildLabelRules=X2i;ND.combineClosersAndOpeners=eDi;ND.groupBlocks=vza;ND.flattenVirtual=Cza;ND.registerLanguageSpecificParser=Tza;ND.parseTree=Iza;var Kg=xIr(),kAe=kIr();function J2i(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,Kg.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,kAe.visitTree)(t,r,"bottomUp")}a(Z2i,"labelLines");function _za(t){function e(r){if((0,Kg.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,Kg.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,kAe.visitTree)(t,e,"bottomUp")}a(_za,"labelVirtualInherited");function X2i(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(X2i,"buildLabelRules");function eDi(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,Kg.isLine)(l)||(0,Kg.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,Kg.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,Kg.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,Kg.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,kAe.rebuildTree)(t,e);return(0,kAe.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(eDi,"combineClosersAndOpeners");function vza(t,e=Kg.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,Kg.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(yyt,"__esModule",{value:!0});yyt.getBasicWindowDelineations=wza;yyt.getIndentationWindowsDelineations=Rza;var nDi=kIr(),xza=rDi();function wza(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),E=f(A,y),_=g===A?E:f(g,y);for(r<=E-y&&o.push([y,_]);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(Rza,"getIndentationWindowsDelineations")});var oDi=I(M4e=>{"use strict";p();Object.defineProperty(M4e,"__esModule",{value:!0});M4e.FixedWindowSizeJaccardMatcher=void 0;M4e.computeScore=iDi;var kza=vIr(),Pza=IIr(),Dza=PIr(),DIr=class t extends Pza.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,Dza.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,kza.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return iDi(e,r)}};M4e.FixedWindowSizeJaccardMatcher=DIr;function iDi(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(iDi,"computeScore")});var aDi=I(Eyt=>{"use strict";p();Object.defineProperty(Eyt,"__esModule",{value:!0});Eyt.BlockTokenSubsetMatcher=void 0;var Nza=Qre(),sDi=vIr(),Mza=IIr(),Oza=PIr(),NIr=class t extends Mza.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,Oza.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,sDi.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,sDi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return Lza(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,Nza.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}}};Eyt.BlockTokenSubsetMatcher=NIr;function Lza(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(Lza,"computeScore")});var _yt=I(MD=>{"use strict";p();Object.defineProperty(MD,"__esModule",{value:!0});MD.defaultCppSimilarFilesOptions=MD.nullSimilarFilesOptions=MD.conservativeFilesOptions=MD.defaultSimilarFilesOptions=void 0;MD.getSimilarSnippets=Gza;var Bza=oDi(),Fza=aDi(),Uza=0,Qza=60,qza=4,jza=1,cDi=20,lDi=1e4;MD.defaultSimilarFilesOptions={snippetLength:Qza,threshold:Uza,maxTopSnippets:qza,maxCharPerFile:lDi,maxNumberOfFiles:cDi,maxSnippetsPerFile:jza,useSubsetMatching:!1};MD.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:lDi,maxNumberOfFiles:cDi,maxSnippetsPerFile:1};MD.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};MD.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function Hza(t,e){return(e.useSubsetMatching?Fza.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):Bza.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(Hza,"getMatcher");async function Gza(t,e,r){let n=Hza(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(Gza,"getSimilarSnippets")});var dDi=I(vyt=>{"use strict";p();Object.defineProperty(vyt,"__esModule",{value:!0});vyt.getCppSimilarFilesOptions=Vza;vyt.getCppNumberOfSnippets=Wza;var uDi=_yt(),$za=Cyt();function Vza(t,e){return{...uDi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,$za.useSubsetMatching)(t,e)}}a(Vza,"getCppSimilarFilesOptions");function Wza(t){return uDi.defaultCppSimilarFilesOptions.maxTopSnippets}a(Wza,"getCppNumberOfSnippets")});var Cyt=I(O4e=>{"use strict";p();Object.defineProperty(O4e,"__esModule",{value:!0});O4e.getSimilarFilesOptions=Zza;O4e.getNumberOfSnippets=eYa;O4e.useSubsetMatching=hDi;var zza=ZG(),Yza=_yt(),fDi=LE(),Kza=O0t(),pDi=dDi(),Jza=new Map([["cpp",pDi.getCppSimilarFilesOptions]]);function Zza(t,e,r){let n=Jza.get(r);return n?n(t,e):{...Yza.defaultSimilarFilesOptions,useSubsetMatching:hDi(t,e)}}a(Zza,"getSimilarFilesOptions");var Xza=new Map([["cpp",pDi.getCppNumberOfSnippets]]);function eYa(t,e){let r=Xza.get(e);return r?r(t):zza.DEFAULT_NUM_SNIPPETS}a(eYa,"getNumberOfSnippets");function hDi(t,e){return(e.filtersAndExp.exp.variables[Kza.ExpTreatmentVariables.UseSubsetMatching]||(0,fDi.getConfig)(t,fDi.ConfigKey.UseSubsetMatching))??!1}a(hDi,"useSubsetMatching")});var L4e=I($re=>{"use strict";p();Object.defineProperty($re,"__esModule",{value:!0});$re.convertToAPIChoice=iYa;$re.getTemperatureForSamples=aYa;$re.getStops=lYa;$re.getTopP=uYa;$re.getMaxSolutionTokens=dYa;var tYa=T0(),rYa=ZG(),mDi=Dl(),nYa=$g();function iYa(t,e,r,n,o,s,c){return(0,nYa.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:oYa(t,r),meanAlternativeLogProb:sYa(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,tYa.generateUuid)(),finishReason:r.finish_reason}}a(iYa,"convertToAPIChoice");function oYa(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){mDi.logger.exception(t,r,"Error calculating mean prob")}}a(oYa,"calculateMeanLogProb");function sYa(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){mDi.logger.exception(t,r,"Error calculating mean prob")}}a(sYa,"calculateMeanAlternativeLogProb");function aYa(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(aYa,"getTemperatureForSamples");var cYa={markdown:[` `],python:[` @@ -986,31 +986,31 @@ def `,` class `,` if `,` -#`]};function nYa(t){return rYa[t??""]??[` +#`]};function lYa(t){return cYa[t??""]??[` -`,"\n```"]}a(nYa,"getStops");function iYa(){return 1}a(iYa,"getTopP");function oYa(){return Kza.DEFAULT_MAX_COMPLETION_LENGTH}a(oYa,"getMaxSolutionTokens")});var rL=I(O4e=>{"use strict";p();Object.defineProperty(O4e,"__esModule",{value:!0});O4e.Fragment=pDi;O4e.jsx=fDi;O4e.jsxs=fDi;function fDi(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(fDi,"functionComponentFunction");function pDi(t){return{type:"f",children:t}}a(pDi,"fragmentFunction");pDi.isFragmentFunction=!0});var MD=I(NIr=>{"use strict";p();Object.defineProperty(NIr,"__esModule",{value:!0});NIr.es5ClassCompat=sYa;function sYa(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(sYa,"es5ClassCompat")});var kAe=I(Wre=>{"use strict";p();var aYa=Wre&&Wre.__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},Vre;Object.defineProperty(Wre,"__esModule",{value:!0});Wre.Position=void 0;var Cyt=Rs(),cYa=MD(),MIr=Vre=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,Cyt.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 Vre(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,Cyt.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 Vre(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};Wre.Position=MIr;Wre.Position=MIr=Vre=aYa([cYa.es5ClassCompat],MIr)});var nL=I(u$=>{"use strict";p();var lYa=u$&&u$.__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},T6;Object.defineProperty(u$,"__esModule",{value:!0});u$.Range=void 0;u$.getDebugDescriptionOfRange=hDi;var uYa=Rs(),dYa=MD(),Ov=kAe(),OIr=T6=class{static{a(this,"Range")}static isRange(e){return e instanceof T6?!0:!e||typeof e!="object"?!1:Ov.Position.isPosition(e.start)&&Ov.Position.isPosition(e.end)}static of(e){if(e instanceof T6)return e;if(this.isRange(e))return new T6(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 Ov.Position(e,r),c=new Ov.Position(n,o)):Ov.Position.isPosition(e)&&Ov.Position.isPosition(r)&&(s=Ov.Position.of(e),c=Ov.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 T6.isRange(e)?this.contains(e.start)&&this.contains(e.end):Ov.Position.isPosition(e)?!(Ov.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=Ov.Position.Max(e.start,this._start),n=Ov.Position.Min(e.end,this._end);if(!r.isAfter(n))return new T6(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=Ov.Position.Min(e.start,this._start),n=Ov.Position.Max(e.end,this.end);return new T6(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,uYa.illegalArgument)();let n;return e?Ov.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 T6(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return hDi(this)}};u$.Range=OIr;u$.Range=OIr=T6=lYa([dYa.es5ClassCompat],OIr);function hDi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(hDi,"getDebugDescriptionOfRange")});var BIr=I(c1=>{"use strict";p();var ADi=c1&&c1.__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(c1,"__esModule",{value:!0});c1.Diagnostic=c1.DiagnosticRelatedInformation=c1.DiagnosticSeverity=c1.DiagnosticTag=void 0;var mDi=Sl(),fYa=nd(),yDi=MD(),EDi=nL(),gDi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(gDi||(c1.DiagnosticTag=gDi={}));var byt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(byt||(c1.DiagnosticSeverity=byt={}));var Syt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&EDi.Range.isRange(e.location.range)&&fYa.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()}};c1.DiagnosticRelatedInformation=Syt;c1.DiagnosticRelatedInformation=Syt=ADi([yDi.es5ClassCompat],Syt);var LIr=class{static{a(this,"Diagnostic")}constructor(e,r,n=byt.Error){if(!EDi.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:byt[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,mDi.equals)(e.tags,r.tags)&&(0,mDi.equals)(e.relatedInformation,r.relatedInformation,Syt.isEqual)}};c1.Diagnostic=LIr;c1.Diagnostic=LIr=ADi([yDi.es5ClassCompat],LIr)});var QIr=I(zre=>{"use strict";p();var pYa=zre&&zre.__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},FIr;Object.defineProperty(zre,"__esModule",{value:!0});zre.Location=void 0;var hYa=nd(),mYa=MD(),gYa=kAe(),Tyt=nL(),UIr=FIr=class{static{a(this,"Location")}static isLocation(e){return e instanceof FIr?!0:e?Tyt.Range.isRange(e.range)&&hYa.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(Tyt.Range.isRange(r))this.range=Tyt.Range.of(r);else if(gYa.Position.isPosition(r))this.range=new Tyt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};zre.Location=UIr;zre.Location=UIr=FIr=pYa([mYa.es5ClassCompat],UIr)});var _Di=I(GIr=>{"use strict";p();Object.defineProperty(GIr,"__esModule",{value:!0});GIr.getKoreanAltChars=AYa;function AYa(t){let e=yYa(t);if(e&&e.length>0)return new Uint32Array(e)}a(AYa,"getKoreanAltChars");var l1=0,d$=new Uint32Array(10);function yYa(t){if(l1=0,iL(t,qIr,4352),l1>0||(iL(t,jIr,4449),l1>0)||(iL(t,HIr,4520),l1>0)||(iL(t,Yre,12593),l1))return d$.subarray(0,l1);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 d$.subarray(0,l1)}}a(yYa,"disassembleKorean");function iL(t,e,r){t>=r&&t>8&&(d$[l1++]=t>>8&255),t>>16&&(d$[l1++]=t>>16&255))}a(EYa,"addCodesToBuffer");var qIr=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),jIr=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),HIr=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]),Yre=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 bDi=I(PAe=>{"use strict";p();Object.defineProperty(PAe,"__esModule",{value:!0});PAe.tryNormalizeToBase=void 0;PAe.normalizeNFC=vYa;PAe.normalizeNFD=vDi;var $Ir=zP(),_Ya=new $Ir.LRUCache(1e4);function vYa(t){return CDi(t,"NFC",_Ya)}a(vYa,"normalizeNFC");var CYa=new $Ir.LRUCache(1e4);function vDi(t){return CDi(t,"NFD",CYa)}a(vDi,"normalizeNFD");var bYa=/[^\u0000-\u0080]/;function CDi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return bYa.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(CDi,"normalize");PAe.tryNormalizeToBase=(function(){let t=new $Ir.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=vDi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var HDi=I(dc=>{"use strict";p();var SYa=dc&&dc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TYa=dc&&dc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),IYa=dc&&dc.__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(kDi,"_matchesPrefix");function PDi(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(PDi,"matchesContiguousSubString");function RYa(t,e){if(t.length>e.length)return null;t=(0,wyt.tryNormalizeToBase)(t),e=(0,wyt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a(RYa,"matchesBaseContiguousSubString");function DDi(t,e){return t.length>e.length?null:zIr(t.toLowerCase(),e.toLowerCase(),0,0)}a(DDi,"matchesSubString");function zIr(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=zIr(t,e,r+1,n+1))?rxr({start:n,end:n+1},o):null}return zIr(t,e,r,n+1)}a(zIr,"_matchesSubString");function exr(t){return 97<=t&&t<=122}a(exr,"isLower");function F4e(t){return 65<=t&&t<=90}a(F4e,"isUpper");function txr(t){return 48<=t&&t<=57}a(txr,"isNumber");function NDi(t){return t===32||t===9||t===10||t===13}a(NDi,"isWhitespace");var MDi=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>MDi.add(t.charCodeAt(0)));function Ryt(t){return NDi(t)||MDi.has(t)}a(Ryt,"isWordSeparator");function SDi(t,e){return t===e||Ryt(t)&&Ryt(e)}a(SDi,"charactersMatch");var VIr=new Map;function TDi(t){if(VIr.has(t))return VIr.get(t);let e,r=(0,wYa.getKoreanAltChars)(t);return r&&(e=r),VIr.set(t,e),e}a(TDi,"getAlternateCodes");function ODi(t){return exr(t)||F4e(t)||txr(t)}a(ODi,"isAlphanumeric");function rxr(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(rxr,"join");function LDi(t,e){for(let r=e;r0&&!ODi(t.charCodeAt(r-1)))return r}return t.length}a(LDi,"nextAnchor");function YIr(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=YIr(t,e,r+1,n+1);!o&&(s=LDi(e,s)).6}a(PYa,"isUpperCaseWord");function DYa(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(DYa,"isCamelCaseWord");function NYa(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=kYa(e);if(!DYa(r)){if(!PYa(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&Ryt(t.charCodeAt(r-1)))return r;return t.length}a(BDi,"nextWord");var LYa=XIr(dc.matchesPrefix,nxr,PDi),BYa=XIr(dc.matchesPrefix,nxr,DDi),xDi=new xYa.LRUCache(1e4);function FYa(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=xDi.get(t);n||(n=new RegExp(ZIr.convertSimple2RegExpPattern(t),"i"),xDi.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?BYa(t,e):LYa(t,e)}a(FYa,"matchesFuzzy");function UYa(t,e){let r=B4e(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?FDi(r):null}a(UYa,"matchesFuzzy2");function QYa(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(FDi,"createMatches");var p$=128;function ixr(){let t=[],e=[];for(let r=0;r<=p$;r++)e[r]=0;for(let r=0;r<=p$;r++)t.push(e.slice(0));return t}a(ixr,"initTable");function UDi(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(UDi,"initArr");var QDi=UDi(2*p$),JIr=UDi(2*p$),oL=ixr(),f$=ixr(),L4e=ixr(),qYa=!1;function WIr(t,e,r,n,o){function s(l,u,d=" "){for(;l.lengths(l,3)).join("|")} +`,"\n```"]}a(lYa,"getStops");function uYa(){return 1}a(uYa,"getTopP");function dYa(){return rYa.DEFAULT_MAX_COMPLETION_LENGTH}a(dYa,"getMaxSolutionTokens")});var rL=I(B4e=>{"use strict";p();Object.defineProperty(B4e,"__esModule",{value:!0});B4e.Fragment=ADi;B4e.jsx=gDi;B4e.jsxs=gDi;function gDi(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(gDi,"functionComponentFunction");function ADi(t){return{type:"f",children:t}}a(ADi,"fragmentFunction");ADi.isFragmentFunction=!0});var OD=I(MIr=>{"use strict";p();Object.defineProperty(MIr,"__esModule",{value:!0});MIr.es5ClassCompat=fYa;function fYa(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(fYa,"es5ClassCompat")});var PAe=I(Wre=>{"use strict";p();var pYa=Wre&&Wre.__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},Vre;Object.defineProperty(Wre,"__esModule",{value:!0});Wre.Position=void 0;var byt=Rs(),hYa=OD(),OIr=Vre=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,byt.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 Vre(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,byt.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 Vre(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};Wre.Position=OIr;Wre.Position=OIr=Vre=pYa([hYa.es5ClassCompat],OIr)});var nL=I(d$=>{"use strict";p();var mYa=d$&&d$.__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},I6;Object.defineProperty(d$,"__esModule",{value:!0});d$.Range=void 0;d$.getDebugDescriptionOfRange=yDi;var gYa=Rs(),AYa=OD(),Lv=PAe(),LIr=I6=class{static{a(this,"Range")}static isRange(e){return e instanceof I6?!0:!e||typeof e!="object"?!1:Lv.Position.isPosition(e.start)&&Lv.Position.isPosition(e.end)}static of(e){if(e instanceof I6)return e;if(this.isRange(e))return new I6(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 Lv.Position(e,r),c=new Lv.Position(n,o)):Lv.Position.isPosition(e)&&Lv.Position.isPosition(r)&&(s=Lv.Position.of(e),c=Lv.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 I6.isRange(e)?this.contains(e.start)&&this.contains(e.end):Lv.Position.isPosition(e)?!(Lv.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=Lv.Position.Max(e.start,this._start),n=Lv.Position.Min(e.end,this._end);if(!r.isAfter(n))return new I6(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=Lv.Position.Min(e.start,this._start),n=Lv.Position.Max(e.end,this.end);return new I6(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,gYa.illegalArgument)();let n;return e?Lv.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 I6(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return yDi(this)}};d$.Range=LIr;d$.Range=LIr=I6=mYa([AYa.es5ClassCompat],LIr);function yDi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(yDi,"getDebugDescriptionOfRange")});var FIr=I(c1=>{"use strict";p();var vDi=c1&&c1.__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(c1,"__esModule",{value:!0});c1.Diagnostic=c1.DiagnosticRelatedInformation=c1.DiagnosticSeverity=c1.DiagnosticTag=void 0;var EDi=Sl(),yYa=nd(),CDi=OD(),bDi=nL(),_Di;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(_Di||(c1.DiagnosticTag=_Di={}));var Syt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(Syt||(c1.DiagnosticSeverity=Syt={}));var Tyt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&bDi.Range.isRange(e.location.range)&&yYa.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()}};c1.DiagnosticRelatedInformation=Tyt;c1.DiagnosticRelatedInformation=Tyt=vDi([CDi.es5ClassCompat],Tyt);var BIr=class{static{a(this,"Diagnostic")}constructor(e,r,n=Syt.Error){if(!bDi.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:Syt[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,EDi.equals)(e.tags,r.tags)&&(0,EDi.equals)(e.relatedInformation,r.relatedInformation,Tyt.isEqual)}};c1.Diagnostic=BIr;c1.Diagnostic=BIr=vDi([CDi.es5ClassCompat],BIr)});var qIr=I(zre=>{"use strict";p();var EYa=zre&&zre.__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},UIr;Object.defineProperty(zre,"__esModule",{value:!0});zre.Location=void 0;var _Ya=nd(),vYa=OD(),CYa=PAe(),Iyt=nL(),QIr=UIr=class{static{a(this,"Location")}static isLocation(e){return e instanceof UIr?!0:e?Iyt.Range.isRange(e.range)&&_Ya.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(Iyt.Range.isRange(r))this.range=Iyt.Range.of(r);else if(CYa.Position.isPosition(r))this.range=new Iyt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};zre.Location=QIr;zre.Location=QIr=UIr=EYa([vYa.es5ClassCompat],QIr)});var SDi=I($Ir=>{"use strict";p();Object.defineProperty($Ir,"__esModule",{value:!0});$Ir.getKoreanAltChars=bYa;function bYa(t){let e=SYa(t);if(e&&e.length>0)return new Uint32Array(e)}a(bYa,"getKoreanAltChars");var l1=0,f$=new Uint32Array(10);function SYa(t){if(l1=0,iL(t,jIr,4352),l1>0||(iL(t,HIr,4449),l1>0)||(iL(t,GIr,4520),l1>0)||(iL(t,Yre,12593),l1))return f$.subarray(0,l1);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 f$.subarray(0,l1)}}a(SYa,"disassembleKorean");function iL(t,e,r){t>=r&&t>8&&(f$[l1++]=t>>8&255),t>>16&&(f$[l1++]=t>>16&255))}a(TYa,"addCodesToBuffer");var jIr=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),HIr=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),GIr=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]),Yre=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 xDi=I(DAe=>{"use strict";p();Object.defineProperty(DAe,"__esModule",{value:!0});DAe.tryNormalizeToBase=void 0;DAe.normalizeNFC=xYa;DAe.normalizeNFD=TDi;var VIr=YP(),IYa=new VIr.LRUCache(1e4);function xYa(t){return IDi(t,"NFC",IYa)}a(xYa,"normalizeNFC");var wYa=new VIr.LRUCache(1e4);function TDi(t){return IDi(t,"NFD",wYa)}a(TDi,"normalizeNFD");var RYa=/[^\u0000-\u0080]/;function IDi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return RYa.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(IDi,"normalize");DAe.tryNormalizeToBase=(function(){let t=new VIr.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=TDi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var WDi=I(dc=>{"use strict";p();var kYa=dc&&dc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=dc&&dc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),DYa=dc&&dc.__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(MDi,"_matchesPrefix");function ODi(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(ODi,"matchesContiguousSubString");function OYa(t,e){if(t.length>e.length)return null;t=(0,Ryt.tryNormalizeToBase)(t),e=(0,Ryt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a(OYa,"matchesBaseContiguousSubString");function LDi(t,e){return t.length>e.length?null:YIr(t.toLowerCase(),e.toLowerCase(),0,0)}a(LDi,"matchesSubString");function YIr(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=YIr(t,e,r+1,n+1))?nxr({start:n,end:n+1},o):null}return YIr(t,e,r,n+1)}a(YIr,"_matchesSubString");function txr(t){return 97<=t&&t<=122}a(txr,"isLower");function Q4e(t){return 65<=t&&t<=90}a(Q4e,"isUpper");function rxr(t){return 48<=t&&t<=57}a(rxr,"isNumber");function BDi(t){return t===32||t===9||t===10||t===13}a(BDi,"isWhitespace");var FDi=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>FDi.add(t.charCodeAt(0)));function kyt(t){return BDi(t)||FDi.has(t)}a(kyt,"isWordSeparator");function wDi(t,e){return t===e||kyt(t)&&kyt(e)}a(wDi,"charactersMatch");var WIr=new Map;function RDi(t){if(WIr.has(t))return WIr.get(t);let e,r=(0,MYa.getKoreanAltChars)(t);return r&&(e=r),WIr.set(t,e),e}a(RDi,"getAlternateCodes");function UDi(t){return txr(t)||Q4e(t)||rxr(t)}a(UDi,"isAlphanumeric");function nxr(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(nxr,"join");function QDi(t,e){for(let r=e;r0&&!UDi(t.charCodeAt(r-1)))return r}return t.length}a(QDi,"nextAnchor");function KIr(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=KIr(t,e,r+1,n+1);!o&&(s=QDi(e,s)).6}a(BYa,"isUpperCaseWord");function FYa(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(FYa,"isCamelCaseWord");function UYa(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=LYa(e);if(!FYa(r)){if(!BYa(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&kyt(t.charCodeAt(r-1)))return r;return t.length}a(qDi,"nextWord");var jYa=exr(dc.matchesPrefix,ixr,ODi),HYa=exr(dc.matchesPrefix,ixr,LDi),PDi=new NYa.LRUCache(1e4);function GYa(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=PDi.get(t);n||(n=new RegExp(XIr.convertSimple2RegExpPattern(t),"i"),PDi.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?HYa(t,e):jYa(t,e)}a(GYa,"matchesFuzzy");function $Ya(t,e){let r=U4e(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?jDi(r):null}a($Ya,"matchesFuzzy2");function VYa(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(jDi,"createMatches");var h$=128;function oxr(){let t=[],e=[];for(let r=0;r<=h$;r++)e[r]=0;for(let r=0;r<=h$;r++)t.push(e.slice(0));return t}a(oxr,"initTable");function HDi(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(HDi,"initArr");var GDi=HDi(2*h$),ZIr=HDi(2*h$),oL=oxr(),p$=oxr(),F4e=oxr(),WYa=!1;function zIr(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(WIr,"printTable");function jYa(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(WIr(f$,t,t.length,r,r.length)),console.log(WIr(L4e,t,t.length,r,r.length)),console.log(WIr(oL,t,t.length,r,r.length))}a(jYa,"printTables");function Iyt(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!!ZIr.isEmojiImprecise(r)}}a(Iyt,"isSeparatorAtPos");function wDi(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(wDi,"isWhitespaceAtPos");function xyt(t,e,r){return e[t]!==r[t]}a(xyt,"isUpperCaseAtPos");function qDi(t,e,r,n,o,s,c=!1){for(;ep$?p$:t.length,u=n.length>p$?p$:n.length;if(r>=l||s>=u||l-r>u-s||!qDi(e,r,l,o,s,u,!0))return;HYa(l,u,r,s,e,o);let d=1,f=1,h=r,m=s,g=[!1];for(d=1,h=r;hv,D=P?f$[d][f-1]+(oL[d][f-1]>0?-5:0):0,N=m>v+1&&oL[d][f-1]>0,L=N?f$[d][f-2]+(oL[d][f-2]>0?-5:0):0;if(N&&(!P||L>=D)&&(!R||L>=x))f$[d][f]=L,L4e[d][f]=3,oL[d][f]=0;else if(P&&(!R||D>=x))f$[d][f]=D,L4e[d][f]=2,oL[d][f]=0;else if(R)f$[d][f]=x,L4e[d][f]=1,oL[d][f]=oL[d-1][f-1]+1;else throw new Error("not possible")}}if(qYa&&jYa(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[f$[d][f],s],y=0,E=0;for(;d>=1;){let v=f;do{let b=L4e[d][v];if(b===3)v=v-2;else if(b===2)v=v-1;else break}while(v>=1);y>1&&e[r+d-1]===o[s+f-1]&&!xyt(v+s-1,n,o)&&y+1>oL[d][v]&&(v=f),v===f?y++:y=1,E||(E=v),d--,f=v-1,A.push(f)}u-s===l&&c.boostFullMatch&&(A[0]+=2);let _=E-l;return A[0]-=_,A}a(B4e,"fuzzyScore");function HYa(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(JIr[c]=l,c--),l--}a(HYa,"_fillInMaxWordMatchPos");function GYa(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:xyt(c,o,s)&&(c===0||!xyt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):Iyt(s,c)&&(c===0||!Iyt(s,c-1))?h=5:(Iyt(s,c-1)||wDi(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=xyt(c,o,s)||Iyt(s,c-1)||wDi(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(GYa,"_doScore");function $Ya(t,e,r,n,o,s,c){return jDi(t,e,r,n,o,s,!0,c)}a($Ya,"fuzzyScoreGracefulAggressive");function VYa(t,e,r,n,o,s,c){return jDi(t,e,r,n,o,s,!1,c)}a(VYa,"fuzzyScoreGraceful");function jDi(t,e,r,n,o,s,c,l){let u=B4e(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(jDi,"fuzzyScoreWithPermutations");function WYa(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(WYa,"nextTypoPermutation")});var $Di=I(h$=>{"use strict";p();Object.defineProperty(h$,"__esModule",{value:!0});h$.escapeIcons=JYa;h$.markdownEscapeEscapedIcons=XYa;h$.stripIcons=tKa;h$.getCodiconAriaLabel=rKa;h$.parseLabelWithIcons=nKa;h$.matchesFuzzyIconAware=iKa;var GDi=HDi(),zYa=em(),sxr=R0r(),YYa="$(",axr=new RegExp(`\\$\\(${sxr.ThemeIcon.iconNameExpression}(?:${sxr.ThemeIcon.iconModifierExpression})?\\)`,"g"),KYa=new RegExp(`(\\\\)?${axr.source}`,"g");function JYa(t){return t.replace(KYa,(e,r)=>r?e:`\\${e}`)}a(JYa,"escapeIcons");var ZYa=new RegExp(`\\\\${axr.source}`,"g");function XYa(t){return t.replace(ZYa,e=>`\\${e}`)}a(XYa,"markdownEscapeEscapedIcons");var eKa=new RegExp(`(\\s)?(\\\\)?${axr.source}(\\s)?`,"g");function tKa(t){return t.indexOf(YYa)===-1?t:t.replace(eKa,(e,r,n,o)=>n?e:r||o||"")}a(tKa,"stripIcons");function rKa(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(rKa,"getCodiconAriaLabel");var oxr=new RegExp(`\\$\\(${sxr.ThemeIcon.iconNameCharacter}+\\)`,"g");function nKa(t){oxr.lastIndex=0;let e="",r=[],n=0;for(;;){let o=oxr.lastIndex,s=oxr.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(Ay,"__esModule",{value:!0});Ay.MarkdownString=void 0;Ay.isEmptyMarkdownString=VDi;Ay.isMarkdownString=WDi;Ay.markdownStringEqual=uKa;Ay.escapeMarkdownSyntaxTokens=Nyt;Ay.escapeMarkdownLinkLabel=dKa;Ay.appendEscapedMarkdownCodeBlockFence=zDi;Ay.appendEscapedMarkdownInlineCode=fKa;Ay.escapeDoubleQuotes=pKa;Ay.removeMarkdownEscapes=hKa;Ay.parseHrefAndDimensions=mKa;Ay.createMarkdownLink=YDi;Ay.createMarkdownCommandLink=gKa;Ay.createCommandUri=KDi;var oKa=Rs(),sKa=$Di(),aKa=tJ(),cKa=ZP(),lKa=em(),Pyt=nd(),Dyt=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?Pyt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,oKa.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+=Nyt(this.supportThemeIcons?(0,sKa.escapeIcons)(e):e).replace(/([ \t]+)/g,(n,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,r===1?`\\ +`;return c}a(zIr,"printTable");function zYa(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(zIr(p$,t,t.length,r,r.length)),console.log(zIr(F4e,t,t.length,r,r.length)),console.log(zIr(oL,t,t.length,r,r.length))}a(zYa,"printTables");function xyt(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!!XIr.isEmojiImprecise(r)}}a(xyt,"isSeparatorAtPos");function DDi(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(DDi,"isWhitespaceAtPos");function wyt(t,e,r){return e[t]!==r[t]}a(wyt,"isUpperCaseAtPos");function $Di(t,e,r,n,o,s,c=!1){for(;eh$?h$:t.length,u=n.length>h$?h$:n.length;if(r>=l||s>=u||l-r>u-s||!$Di(e,r,l,o,s,u,!0))return;YYa(l,u,r,s,e,o);let d=1,f=1,h=r,m=s,g=[!1];for(d=1,h=r;hv,D=P?p$[d][f-1]+(oL[d][f-1]>0?-5:0):0,N=m>v+1&&oL[d][f-1]>0,L=N?p$[d][f-2]+(oL[d][f-2]>0?-5:0):0;if(N&&(!P||L>=D)&&(!R||L>=x))p$[d][f]=L,F4e[d][f]=3,oL[d][f]=0;else if(P&&(!R||D>=x))p$[d][f]=D,F4e[d][f]=2,oL[d][f]=0;else if(R)p$[d][f]=x,F4e[d][f]=1,oL[d][f]=oL[d-1][f-1]+1;else throw new Error("not possible")}}if(WYa&&zYa(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[p$[d][f],s],y=0,E=0;for(;d>=1;){let v=f;do{let b=F4e[d][v];if(b===3)v=v-2;else if(b===2)v=v-1;else break}while(v>=1);y>1&&e[r+d-1]===o[s+f-1]&&!wyt(v+s-1,n,o)&&y+1>oL[d][v]&&(v=f),v===f?y++:y=1,E||(E=v),d--,f=v-1,A.push(f)}u-s===l&&c.boostFullMatch&&(A[0]+=2);let _=E-l;return A[0]-=_,A}a(U4e,"fuzzyScore");function YYa(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(ZIr[c]=l,c--),l--}a(YYa,"_fillInMaxWordMatchPos");function KYa(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:wyt(c,o,s)&&(c===0||!wyt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):xyt(s,c)&&(c===0||!xyt(s,c-1))?h=5:(xyt(s,c-1)||DDi(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=wyt(c,o,s)||xyt(s,c-1)||DDi(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(KYa,"_doScore");function JYa(t,e,r,n,o,s,c){return VDi(t,e,r,n,o,s,!0,c)}a(JYa,"fuzzyScoreGracefulAggressive");function ZYa(t,e,r,n,o,s,c){return VDi(t,e,r,n,o,s,!1,c)}a(ZYa,"fuzzyScoreGraceful");function VDi(t,e,r,n,o,s,c,l){let u=U4e(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(VDi,"fuzzyScoreWithPermutations");function XYa(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(XYa,"nextTypoPermutation")});var YDi=I(m$=>{"use strict";p();Object.defineProperty(m$,"__esModule",{value:!0});m$.escapeIcons=nKa;m$.markdownEscapeEscapedIcons=oKa;m$.stripIcons=aKa;m$.getCodiconAriaLabel=cKa;m$.parseLabelWithIcons=lKa;m$.matchesFuzzyIconAware=uKa;var zDi=WDi(),eKa=em(),axr=k0r(),tKa="$(",cxr=new RegExp(`\\$\\(${axr.ThemeIcon.iconNameExpression}(?:${axr.ThemeIcon.iconModifierExpression})?\\)`,"g"),rKa=new RegExp(`(\\\\)?${cxr.source}`,"g");function nKa(t){return t.replace(rKa,(e,r)=>r?e:`\\${e}`)}a(nKa,"escapeIcons");var iKa=new RegExp(`\\\\${cxr.source}`,"g");function oKa(t){return t.replace(iKa,e=>`\\${e}`)}a(oKa,"markdownEscapeEscapedIcons");var sKa=new RegExp(`(\\s)?(\\\\)?${cxr.source}(\\s)?`,"g");function aKa(t){return t.indexOf(tKa)===-1?t:t.replace(sKa,(e,r,n,o)=>n?e:r||o||"")}a(aKa,"stripIcons");function cKa(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(cKa,"getCodiconAriaLabel");var sxr=new RegExp(`\\$\\(${axr.ThemeIcon.iconNameCharacter}+\\)`,"g");function lKa(t){sxr.lastIndex=0;let e="",r=[],n=0;for(;;){let o=sxr.lastIndex,s=sxr.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(Ay,"__esModule",{value:!0});Ay.MarkdownString=void 0;Ay.isEmptyMarkdownString=KDi;Ay.isMarkdownString=JDi;Ay.markdownStringEqual=gKa;Ay.escapeMarkdownSyntaxTokens=Myt;Ay.escapeMarkdownLinkLabel=AKa;Ay.appendEscapedMarkdownCodeBlockFence=ZDi;Ay.appendEscapedMarkdownInlineCode=yKa;Ay.escapeDoubleQuotes=EKa;Ay.removeMarkdownEscapes=_Ka;Ay.parseHrefAndDimensions=vKa;Ay.createMarkdownLink=XDi;Ay.createMarkdownCommandLink=CKa;Ay.createCommandUri=eNi;var dKa=Rs(),fKa=YDi(),pKa=tJ(),hKa=XP(),mKa=em(),Dyt=nd(),Nyt=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?Dyt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,dKa.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+=Myt(this.supportThemeIcons?(0,fKa.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+=` -${zDi(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,lKa.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};Ay.MarkdownString=Dyt;function VDi(t){return WDi(t)?!t.value:Array.isArray(t)?t.every(VDi):!0}a(VDi,"isEmptyMarkdownString");function WDi(t){return t instanceof Dyt?!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(WDi,"isMarkdownString");function uKa(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,cKa.isEqual)(Pyt.URI.from(t.baseUri),Pyt.URI.from(e.baseUri)))}a(uKa,"markdownStringEqual");function Nyt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(Nyt,"escapeMarkdownSyntaxTokens");function dKa(t){return t.replace(/[\\\]]/g,"\\$&")}a(dKa,"escapeMarkdownLinkLabel");function zDi(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(zDi,"appendEscapedMarkdownCodeBlockFence");function fKa(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(fKa,"appendEscapedMarkdownInlineCode");function pKa(t){return t.replace(/"/g,""")}a(pKa,"escapeDoubleQuotes");function hKa(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(hKa,"removeMarkdownEscapes");function mKa(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(mKa,"parseHrefAndDimensions");function YDi(t,e,r,n=!0){return`[${n?Nyt(t):t}](${e}${r?` "${Nyt(r)}"`:""})`}a(YDi,"createMarkdownLink");function gKa(t,e=!0){let r=KDi(t.id,...t.arguments||[]).toString();return YDi(t.text,r,t.tooltip,e)}a(gKa,"createMarkdownCommandLink");function KDi(t,...e){return Pyt.URI.from({scheme:aKa.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(KDi,"createCommandUri")});var uxr=I(Kre=>{"use strict";p();var AKa=Kre&&Kre.__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},cxr;Object.defineProperty(Kre,"__esModule",{value:!0});Kre.MarkdownString=void 0;var yKa=JDi(),EKa=MD(),lxr=cxr=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof cxr?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new yKa.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}};Kre.MarkdownString=lxr;Kre.MarkdownString=lxr=cxr=AKa([EKa.es5ClassCompat],lxr)});var eNi=I(I6=>{"use strict";p();Object.defineProperty(I6,"__esModule",{value:!0});I6.Mimes=void 0;I6.getMediaOrTextMime=vKa;I6.getMediaMime=XDi;I6.getExtensionForMimeType=CKa;I6.normalizeMimeType=SKa;I6.isTextStreamMime=TKa;var ZDi=NA();I6.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 _Ka={".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"},dxr={".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 vKa(t){let e=(0,ZDi.extname)(t),r=_Ka[e.toLowerCase()];return r!==void 0?r:XDi(t)}a(vKa,"getMediaOrTextMime");function XDi(t){let e=(0,ZDi.extname)(t),r=dxr[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(XDi,"getMediaMime");function CKa(t){for(let e in dxr){let r=dxr[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(CKa,"getExtensionForMimeType");var bKa=/^(.+)\/(.+?)(;.+)?$/;function SKa(t,e){let r=bKa.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(SKa,"normalizeMimeType");function TKa(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(TKa,"isTextStreamMime")});var nNi=I(k0=>{"use strict";p();var IKa=k0&&k0.__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},m$;Object.defineProperty(k0,"__esModule",{value:!0});k0.NotebookCellOutput=k0.NotebookCellOutputItem=k0.NotebookEdit=k0.NotebookData=k0.NotebookCellData=k0.NotebookRange=k0.NotebookCellKind=void 0;var xKa=MD(),tNi=Rs(),Myt=eNi(),wKa=T0(),rNi;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(rNi||(k0.NotebookCellKind=rNi={}));var Jre=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,tNi.illegalArgument)("start must be positive");if(r<0)throw(0,tNi.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)}};k0.NotebookRange=Jre;var fxr=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)}};k0.NotebookCellData=fxr;var pxr=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};k0.NotebookData=pxr;var hxr=m$=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof m$?!0:e?Jre.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new m$(e,r)}static insertCells(e,r){return new m$(new Jre(e,e),r)}static deleteCells(e){return new m$(e,[])}static updateCellMetadata(e,r){let n=new m$(new Jre(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new m$(new Jre(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};k0.NotebookEdit=hxr;k0.NotebookEdit=hxr=m$=IKa([xKa.es5ClassCompat],hxr);var mxr=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=Myt.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,Myt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};k0.NotebookCellOutputItem=mxr;var gxr=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,wKa.generateUuid)(),this.metadata=r??n)}};k0.NotebookCellOutput=gxr});var oNi=I(A$=>{"use strict";p();var RKa=A$&&A$.__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},Axr;Object.defineProperty(A$,"__esModule",{value:!0});A$.Selection=void 0;A$.getDebugDescriptionOfSelection=iNi;var kKa=MD(),g$=kAe(),yxr=nL(),Exr=Axr=class extends yxr.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof Axr?!0:!e||typeof e!="object"?!1:yxr.Range.isRange(e)&&g$.Position.isPosition(e.anchor)&&g$.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 g$.Position(e,r),c=new g$.Position(n,o)):g$.Position.isPosition(e)&&g$.Position.isPosition(r)&&(s=g$.Position.of(e),c=g$.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 iNi(this)}};A$.Selection=Exr;A$.Selection=Exr=Axr=RKa([kKa.es5ClassCompat],Exr);function iNi(t){let e=(0,yxr.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(iNi,"getDebugDescriptionOfSelection")});var vxr=I(Xre=>{"use strict";p();var PKa=Xre&&Xre.__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},Zre;Object.defineProperty(Xre,"__esModule",{value:!0});Xre.SnippetString=void 0;var DKa=MD(),_xr=Zre=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Zre?!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+=Zre._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 Zre;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Zre._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 Zre;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}};Xre.SnippetString=_xr;Xre.SnippetString=_xr=Zre=PKa([DKa.es5ClassCompat],_xr)});var bxr=I(Oyt=>{"use strict";p();Object.defineProperty(Oyt,"__esModule",{value:!0});Oyt.SnippetTextEdit=void 0;var NKa=vxr(),sNi=nL(),Cxr=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?sNi.Range.isRange(e.range)&&NKa.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new sNi.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};Oyt.SnippetTextEdit=Cxr});var lNi=I(OD=>{"use strict";p();var MKa=OD&&OD.__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},Sxr;Object.defineProperty(OD,"__esModule",{value:!0});OD.SymbolInformation=OD.SymbolTag=OD.SymbolKind=void 0;var OKa=MD(),aNi=QIr(),LKa=nL(),Txr;(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"})(Txr||(OD.SymbolKind=Txr={}));var cNi;(function(t){t[t.Deprecated=1]="Deprecated"})(cNi||(OD.SymbolTag=cNi={}));var Ixr=Sxr=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 aNi.Location?this.location=o:n instanceof LKa.Range&&(this.location=new aNi.Location(o,n)),Sxr.validate(this)}toJSON(){return{name:this.name,kind:Txr[this.kind],location:this.location,containerName:this.containerName}}};OD.SymbolInformation=Ixr;OD.SymbolInformation=Ixr=Sxr=MKa([OKa.es5ClassCompat],Ixr)});var Rxr=I(x6=>{"use strict";p();var BKa=x6&&x6.__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},ene;Object.defineProperty(x6,"__esModule",{value:!0});x6.TextEdit=x6.EndOfLine=void 0;var xxr=Rs(),FKa=MD(),uNi=kAe(),Lyt=nL(),dNi;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(dNi||(x6.EndOfLine=dNi={}));var wxr=ene=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof ene?!0:!e||typeof e!="object"?!1:Lyt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new ene(e,r)}static insert(e,r){return ene.replace(new Lyt.Range(e,e),r)}static delete(e){return ene.replace(e,"")}static setEndOfLine(e){let r=new ene(new Lyt.Range(new uNi.Position(0,0),new uNi.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!Lyt.Range.isRange(e))throw(0,xxr.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,xxr.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,xxr.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}}};x6.TextEdit=wxr;x6.TextEdit=wxr=ene=BKa([FKa.es5ClassCompat],wxr)});var bNi=I(xt=>{"use strict";p();Object.defineProperty(xt,"__esModule",{value:!0});xt.ChatResponseClearToPreviousToolInvocationReason=xt.ChatRequestEditedFileEventKind=xt.ChatInputNotificationSeverity=xt.ChatErrorLevel=xt.AISearchKeyword=xt.TextSearchMatch2=xt.ExcludeSettingOptions=xt.LanguageModelPromptTsxPart=xt.ChatImageMimeType=xt.LanguageModelDataPart2=xt.LanguageModelDataPart=xt.LanguageModelThinkingPart=xt.LanguageModelTextPart2=xt.LanguageModelPartAudience=xt.LanguageModelTextPart=xt.LanguageModelToolResult2=xt.LanguageModelToolResult=xt.ChatReferenceBinaryData=xt.ChatReferenceDiagnostic=xt.ChatRequestNotebookData=xt.ChatRequestEditorData=xt.ChatResponseTurn=xt.ChatRequestTurn2=xt.ChatRequestTurn=xt.ChatResponseQuestionCarouselPart=xt.ChatQuestion=xt.ChatQuestionType=xt.ChatResponseConfirmationPart=xt.ChatResponseWorkspaceEditPart=xt.ChatResponseNotebookEditPart=xt.ChatResponseTextEditPart=xt.ChatResponseMarkdownWithVulnerabilitiesPart=xt.ChatResponseCommandButtonPart=xt.ChatResponseCodeCitationPart=xt.ChatResponsePullRequestPart=xt.ChatResponseExtensionsPart=xt.ChatResponseMovePart=xt.ChatResponseReferencePart2=xt.ChatResponseReferencePart=xt.ChatResponseInfoPart=xt.ChatResponseWarningPart=xt.ChatResponseProgressPart2=xt.ChatResponseExternalEditPart=xt.ChatResponseHookPart=xt.ChatResponseThinkingProgressPart=xt.ChatResponseProgressPart=xt.ChatResponseAnchorPart=xt.ChatResponseFileTreePart=xt.ChatResponseCodeblockUriPart=xt.ChatResponseMarkdownPart=void 0;xt.McpHttpServerDefinition=xt.McpStdioServerDefinition=xt.ChatResource=xt.LanguageModelError=xt.ChatSessionStatus=xt.ChatResponseTurn2=xt.ChatSubagentToolInvocationData=xt.ChatToolInvocationPart=xt.McpToolInvocationContentData=xt.LanguageModelChatMessage=xt.LanguageModelChatToolMode=xt.LanguageModelChatMessageRole=xt.LanguageModelToolResultPart2=xt.LanguageModelToolResultPart=xt.LanguageModelToolCallPart=xt.LanguageModelToolMCPSource=xt.LanguageModelToolExtensionSource=void 0;var fNi=e$(),Qyt=uxr(),kxr=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e}};xt.ChatResponseMarkdownPart=kxr;var Pxr=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};xt.ChatResponseCodeblockUriPart=Pxr;var Dxr=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};xt.ChatResponseFileTreePart=Dxr;var Nxr=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};xt.ChatResponseAnchorPart=Nxr;var Mxr=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};xt.ChatResponseProgressPart=Mxr;var Oxr=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.ChatResponseThinkingProgressPart=Oxr;var Lxr=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};xt.ChatResponseHookPart=Lxr;var Bxr=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};xt.ChatResponseExternalEditPart=Bxr;var Fxr=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};xt.ChatResponseProgressPart2=Fxr;var Uxr=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e}};xt.ChatResponseWarningPart=Uxr;var Qxr=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e}};xt.ChatResponseInfoPart=Qxr;var qxr=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};xt.ChatResponseReferencePart=qxr;var jxr=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};xt.ChatResponseReferencePart2=jxr;var Hxr=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};xt.ChatResponseMovePart=Hxr;var Gxr=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};xt.ChatResponseExtensionsPart=Gxr;var $xr=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}};xt.ChatResponsePullRequestPart=$xr;var Vxr=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};xt.ChatResponseCodeCitationPart=Vxr;var Wxr=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};xt.ChatResponseCommandButtonPart=Wxr;var zxr=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e,this.vulnerabilities=r}};xt.ChatResponseMarkdownWithVulnerabilitiesPart=zxr;var Yxr=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]}};xt.ChatResponseTextEditPart=Yxr;var Kxr=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]}};xt.ChatResponseNotebookEditPart=Kxr;var Jxr=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};xt.ChatResponseWorkspaceEditPart=Jxr;var Zxr=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};xt.ChatResponseConfirmationPart=Zxr;var pNi;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(pNi||(xt.ChatQuestionType=pNi={}));var Xxr=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)}};xt.ChatQuestion=Xxr;var ewr=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};xt.ChatResponseQuestionCarouselPart=ewr;var twr=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}};xt.ChatRequestTurn=twr;var rwr=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}};xt.ChatRequestTurn2=rwr;var nwr=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn=nwr;var iwr=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};xt.ChatRequestEditorData=iwr;var owr=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};xt.ChatRequestNotebookData=owr;var swr=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};xt.ChatReferenceDiagnostic=swr;var awr=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};xt.ChatReferenceBinaryData=awr;var cwr=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};xt.LanguageModelToolResult=cwr;var lwr=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};xt.LanguageModelToolResult2=lwr;var Byt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};xt.LanguageModelTextPart=Byt;var hNi;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(hNi||(xt.LanguageModelPartAudience=hNi={}));var uwr=class extends Byt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};xt.LanguageModelTextPart2=uwr;var dwr=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.LanguageModelThinkingPart=dwr;var Fyt=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(fNi.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(fNi.VSBuffer.fromString(e).buffer,"text/plain")}};xt.LanguageModelDataPart=Fyt;var fwr=class extends Fyt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};xt.LanguageModelDataPart2=fwr;var mNi;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(mNi||(xt.ChatImageMimeType=mNi={}));var pwr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};xt.LanguageModelPromptTsxPart=pwr;var gNi;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(gNi||(xt.ExcludeSettingOptions=gNi={}));var hwr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};xt.TextSearchMatch2=hwr;var mwr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};xt.AISearchKeyword=mwr;var ANi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(ANi||(xt.ChatErrorLevel=ANi={}));var yNi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(yNi||(xt.ChatInputNotificationSeverity=yNi={}));var ENi;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(ENi||(xt.ChatRequestEditedFileEventKind=ENi={}));var _Ni;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(_Ni||(xt.ChatResponseClearToPreviousToolInvocationReason=_Ni={}));var gwr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};xt.LanguageModelToolExtensionSource=gwr;var Awr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};xt.LanguageModelToolMCPSource=Awr;var ywr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};xt.LanguageModelToolCallPart=ywr;var Ewr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart=Ewr;var _wr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart2=_wr;var Uyt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(Uyt||(xt.LanguageModelChatMessageRole=Uyt={}));var vNi;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(vNi||(xt.LanguageModelChatToolMode=vNi={}));var vwr=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(Uyt.User,e,r)}static Assistant(e,r){return new t(Uyt.Assistant,e,r)}};xt.LanguageModelChatMessage=vwr;var Cwr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};xt.McpToolInvocationContentData=Cwr;var bwr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};xt.ChatToolInvocationPart=bwr;var Swr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};xt.ChatSubagentToolInvocationData=Swr;var Twr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn2=Twr;var CNi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(CNi||(xt.ChatSessionStatus=CNi={}));var Iwr=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??""}};xt.LanguageModelError=Iwr;var xwr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};xt.ChatResource=xwr;var wwr=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}};xt.McpStdioServerDefinition=wwr;var Rwr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};xt.McpHttpServerDefinition=Rwr});var INi=I(y$=>{"use strict";p();Object.defineProperty(y$,"__esModule",{value:!0});y$.TextDocumentChangeReason=y$.TextEditorSelectionChangeKind=y$.WorkspaceEdit=void 0;var UKa=Sl(),QKa=zP(),qKa=nL(),jKa=bxr(),HKa=Rxr(),kwr=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 HKa.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new qKa.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,jKa.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(xp,"__esModule",{value:!0});xp.FileType=xp.ChatSessionStatus=xp.ChatLocation=xp.ChatVariableLevel=xp.ExtensionMode=xp.DiagnosticSeverity=xp.TextEditorRevealType=xp.TextEditorLineNumbersStyle=xp.TextEditorCursorStyle=xp.InteractiveEditorResponseFeedbackKind=void 0;var xNi;(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"})(xNi||(xp.InteractiveEditorResponseFeedbackKind=xNi={}));var wNi;(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"})(wNi||(xp.TextEditorCursorStyle=wNi={}));var RNi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(RNi||(xp.TextEditorLineNumbersStyle=RNi={}));var kNi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(kNi||(xp.TextEditorRevealType=kNi={}));var PNi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(PNi||(xp.DiagnosticSeverity=PNi={}));var DNi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(DNi||(xp.ExtensionMode=DNi={}));var NNi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(NNi||(xp.ChatVariableLevel=NNi={}));var MNi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(MNi||(xp.ChatLocation=MNi={}));var ONi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(ONi||(xp.ChatSessionStatus=ONi={}));var LNi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(LNi||(xp.FileType=LNi={}))});var UNi=I(Pwr=>{"use strict";p();Object.defineProperty(Pwr,"__esModule",{value:!0});Pwr.t=GKa;function GKa(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return FNi({message:e,args:r})}return FNi(t[0])}a(GKa,"t");function FNi(t){let{message:e,args:r}=t;return VKa(e,r??{})}a(FNi,"getMessage");var $Ka=/{([^}]+)}/g;function VKa(t,e){return t.replace($Ka,(r,n)=>e[n]??r)}a(VKa,"format2")});var jNi=I(E$=>{"use strict";p();Object.defineProperty(E$,"__esModule",{value:!0});E$.NewSymbolName=E$.NewSymbolNameTriggerKind=E$.NewSymbolNameTag=void 0;var QNi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(QNi||(E$.NewSymbolNameTag=QNi={}));var qNi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(qNi||(E$.NewSymbolNameTriggerKind=qNi={}));var Dwr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};E$.NewSymbolName=Dwr});var GNi=I(qyt=>{"use strict";p();Object.defineProperty(qyt,"__esModule",{value:!0});qyt.TerminalShellExecutionCommandLineConfidence=void 0;var HNi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(HNi||(qyt.TerminalShellExecutionCommandLineConfidence=HNi={}))});var $Ni=I(DAe=>{"use strict";p();Object.defineProperty(DAe,"__esModule",{value:!0});DAe.ThemeColor=DAe.ThemeIcon=void 0;var Nwr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};DAe.ThemeIcon=Nwr;var Mwr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};DAe.ThemeColor=Mwr});var P0=I((SLp,YNi)=>{"use strict";p();var WKa=YP(),zKa=Ic(),YKa=nd(),VNi=BIr(),KKa=QIr(),JKa=uxr(),U4e=nNi(),ZKa=kAe(),XKa=nL(),eJa=oNi(),tJa=vxr(),rJa=bxr(),WNi=lNi(),zNi=Rxr(),On=bNi(),Owr=INi(),_$=BNi(),nJa=UNi(),Lwr=jNi(),iJa=GNi(),oJa=$Ni(),sJa={Position:ZKa.Position,Range:XKa.Range,Selection:eJa.Selection,EventEmitter:zKa.Emitter,CancellationTokenSource:WKa.CancellationTokenSource,Diagnostic:VNi.Diagnostic,Location:KKa.Location,DiagnosticRelatedInformation:VNi.DiagnosticRelatedInformation,TextEdit:zNi.TextEdit,WorkspaceEdit:Owr.WorkspaceEdit,Uri:YKa.URI,MarkdownString:JKa.MarkdownString,DiagnosticSeverity:_$.DiagnosticSeverity,TextEditorCursorStyle:_$.TextEditorCursorStyle,TextEditorLineNumbersStyle:_$.TextEditorLineNumbersStyle,TextEditorRevealType:_$.TextEditorRevealType,EndOfLine:zNi.EndOfLine,l10n:{t:nJa.t},ExtensionMode:_$.ExtensionMode,ChatVariableLevel:_$.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:On.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:On.ChatResponseMarkdownPart,ChatResponseFileTreePart:On.ChatResponseFileTreePart,ChatResponseAnchorPart:On.ChatResponseAnchorPart,ChatResponseMovePart:On.ChatResponseMovePart,ChatResponseExtensionsPart:On.ChatResponseExtensionsPart,ChatResponseProgressPart:On.ChatResponseProgressPart,ChatResponseProgressPart2:On.ChatResponseProgressPart2,ChatResponseWarningPart:On.ChatResponseWarningPart,ChatResponseInfoPart:On.ChatResponseInfoPart,ChatResponseHookPart:On.ChatResponseHookPart,ChatResponseReferencePart:On.ChatResponseReferencePart,ChatResponseReferencePart2:On.ChatResponseReferencePart2,ChatResponseCodeCitationPart:On.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:On.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:On.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:On.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:On.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:On.ChatResponseTextEditPart,ChatResponseNotebookEditPart:On.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:On.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:On.ChatResponseConfirmationPart,ChatQuestion:On.ChatQuestion,ChatQuestionType:On.ChatQuestionType,ChatResponseQuestionCarouselPart:On.ChatResponseQuestionCarouselPart,ChatRequestTurn:On.ChatRequestTurn,ChatResponseTurn:On.ChatResponseTurn,ChatRequestEditorData:On.ChatRequestEditorData,ChatRequestNotebookData:On.ChatRequestNotebookData,NewSymbolName:Lwr.NewSymbolName,NewSymbolNameTag:Lwr.NewSymbolNameTag,NewSymbolNameTriggerKind:Lwr.NewSymbolNameTriggerKind,ChatLocation:_$.ChatLocation,SymbolInformation:WNi.SymbolInformation,LanguageModelToolResult:On.LanguageModelToolResult,ExtendedLanguageModelToolResult:On.LanguageModelToolResult,LanguageModelToolResult2:On.LanguageModelToolResult2,LanguageModelPromptTsxPart:On.LanguageModelPromptTsxPart,LanguageModelTextPart:On.LanguageModelTextPart,LanguageModelDataPart:On.LanguageModelDataPart,LanguageModelToolExtensionSource:On.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:On.LanguageModelToolMCPSource,ChatReferenceBinaryData:On.ChatReferenceBinaryData,ChatReferenceDiagnostic:On.ChatReferenceDiagnostic,TextSearchMatch2:On.TextSearchMatch2,AISearchKeyword:On.AISearchKeyword,ExcludeSettingOptions:On.ExcludeSettingOptions,NotebookCellKind:U4e.NotebookCellKind,NotebookRange:U4e.NotebookRange,NotebookEdit:U4e.NotebookEdit,NotebookCellData:U4e.NotebookCellData,NotebookData:U4e.NotebookData,ChatErrorLevel:On.ChatErrorLevel,ChatInputNotificationSeverity:On.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:iJa.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:On.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:On.ChatResponsePullRequestPart,LanguageModelTextPart2:On.LanguageModelTextPart2,LanguageModelDataPart2:On.LanguageModelDataPart2,LanguageModelThinkingPart:On.LanguageModelThinkingPart,LanguageModelPartAudience:On.LanguageModelPartAudience,ChatResponseThinkingProgressPart:On.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:On.LanguageModelToolCallPart,LanguageModelToolResultPart:On.LanguageModelToolResultPart,LanguageModelToolResultPart2:On.LanguageModelToolResultPart2,LanguageModelChatMessageRole:On.LanguageModelChatMessageRole,LanguageModelChatMessage:On.LanguageModelChatMessage,LanguageModelChatToolMode:On.LanguageModelChatToolMode,TextEditorSelectionChangeKind:Owr.TextEditorSelectionChangeKind,TextDocumentChangeReason:Owr.TextDocumentChangeReason,ChatToolInvocationPart:On.ChatToolInvocationPart,ChatSubagentToolInvocationData:On.ChatSubagentToolInvocationData,McpToolInvocationContentData:On.McpToolInvocationContentData,ChatResponseTurn2:On.ChatResponseTurn2,ChatRequestTurn2:On.ChatRequestTurn2,LanguageModelError:On.LanguageModelError,SymbolKind:WNi.SymbolKind,SnippetString:tJa.SnippetString,SnippetTextEdit:rJa.SnippetTextEdit,FileType:_$.FileType,ChatSessionStatus:On.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:On.McpHttpServerDefinition,McpStdioServerDefinition:On.McpStdioServerDefinition,ThemeIcon:oJa.ThemeIcon};YNi.exports=sJa});var KNi=I(NAe=>{"use strict";p();Object.defineProperty(NAe,"__esModule",{value:!0});NAe.UseData=NAe.UseState=void 0;var Bwr=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}};NAe.UseState=Bwr;var Fwr=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)}}};NAe.UseData=Fwr});var ZNi=I(jyt=>{"use strict";p();Object.defineProperty(jyt,"__esModule",{value:!0});jyt.VirtualPromptReconciler=void 0;var JNi=KNi(),Uwr=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(aJa(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 qwr(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 Qwr([])),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)}};jyt.VirtualPromptReconciler=Uwr;var Qwr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},qwr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new JNi.UseState(e.state),this.dataHook=new JNi.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 aJa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(aJa,"isFragmentFunction")});var XNi=I(Hyt=>{"use strict";p();Object.defineProperty(Hyt,"__esModule",{value:!0});Hyt.VirtualPrompt=void 0;var cJa=ZNi(),jwr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new cJa.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()}};Hyt.VirtualPrompt=jwr});var w6=I(Gyt=>{"use strict";p();Object.defineProperty(Gyt,"__esModule",{value:!0});Gyt.Text=lJa;Gyt.Chunk=uJa;function lJa(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(lJa,"Text");function uJa(t){return t.children}a(uJa,"Chunk")});var v$=I(R6=>{"use strict";p();Object.defineProperty(R6,"__esModule",{value:!0});R6.PerCompletionContextProviderStatistics=R6.ContextProviderStatistics=R6.ICompletionsContextProviderService=void 0;R6.componentStatisticsToPromptMatcher=pJa;var dJa=nn(),fJa=C6();R6.ICompletionsContextProviderService=(0,dJa.createServiceIdentifier)("ICompletionsContextProviderService");var Hwr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new $yt){this.createStatistics=e,this.statistics=new fJa.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)}}};R6.ContextProviderStatistics=Hwr;var $yt=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()}}};R6.PerCompletionContextProviderStatistics=$yt;function pJa(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(pJa,"componentStatisticsToPromptMatcher")});var j4e=I(q4e=>{"use strict";p();Object.defineProperty(q4e,"__esModule",{value:!0});q4e.filterContextItemsByType=AJa;q4e.filterSupportedContextItems=yJa;q4e.addOrValidateContextItemsIDs=_Ja;var hJa=P0(),mJa=nd(),Gwr=T0(),gJa=o4e(),$wr=Dl(),Q4e;(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&&!gJa.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(Q4e||(Q4e={}));var Vwr;(function(t){function e(r){if(!Q4e.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(Vwr||(Vwr={}));var Wwr;(function(t){function e(r){if(!Q4e.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})(Wwr||(Wwr={}));var zwr;(function(t){function e(r){if(!Q4e.is(r))return!1;let n=r;if(!mJa.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof hJa.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(zwr||(zwr={}));var Ywr;(function(t){function e(r){if(Vwr.is(r))return"Trait";if(Wwr.is(r))return"CodeSnippet";if(zwr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(Ywr||(Ywr={}));function AJa(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(AJa,"filterContextItemsByType");function yJa(t){let e=[],r=0;return t.forEach(n=>{let o=Ywr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(yJa,"filterSupportedContextItems");function EJa(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(EJa,"validateContextItemId");function _Ja(t,e){let r=new Set,n=t.get($wr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,Gwr.generateUuid)();if(!EJa(c)){let l=(0,Gwr.generateUuid)();$wr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,Gwr.generateUuid)();$wr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(_Ja,"addOrValidateContextItemsIDs")});var Kwr=I(Vyt=>{"use strict";p();Object.defineProperty(Vyt,"__esModule",{value:!0});Vyt.getCodeSnippetsFromContextItems=TJa;Vyt.addRelativePathToCodeSnippets=IJa;var vJa=s1(),CJa=v$(),bJa=j4e(),SJa="content_excluded";async function TJa(t,e,r,n){let o=(0,bJa.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(CJa.ICompletionsContextProviderService),u=t.get(vJa.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,SJa]]),g}).map(h=>h.data)}a(TJa,"getCodeSnippetsFromContextItems");function IJa(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(IJa,"addRelativePathToCodeSnippets")});var Jwr=I(Yyt=>{"use strict";p();Object.defineProperty(Yyt,"__esModule",{value:!0});Yyt.CodeSnippets=void 0;var Wyt=rL(),zyt=w6(),xJa=k6(),wJa=Kwr(),RJa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(xJa.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,wJa.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,Wyt.jsx)(zyt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,Wyt.jsx)(zyt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.CompletionsContext=eMi;MAe.StableCompletionsContext=tMi;MAe.AdditionalCompletionsContext=rMi;MAe.isContextNode=kJa;function eMi(t){return t.children}a(eMi,"CompletionsContext");function tMi(t){return t.children}a(tMi,"StableCompletionsContext");function rMi(t){return t.children}a(rMi,"AdditionalCompletionsContext");function kJa(t){return t.name===eMi.name||t.name===tMi.name||t.name===rMi.name}a(kJa,"isContextNode")});var Xwr=I(G4e=>{"use strict";p();Object.defineProperty(G4e,"__esModule",{value:!0});G4e.SnapshotWalker=void 0;G4e.defaultTransformers=nMi;var PJa=w6(),Zwr=class{static{a(this,"SnapshotWalker")}constructor(e,r=nMi()){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)}};G4e.SnapshotWalker=Zwr;function nMi(){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===PJa.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(nMi,"defaultTransformers")});var iMi=I(eRr=>{"use strict";p();Object.defineProperty(eRr,"__esModule",{value:!0});eRr.findEditDistanceScore=DJa;function DJa(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(LD,"__esModule",{value:!0});LD.MAX_EDIT_DISTANCE_LENGTH=void 0;LD.CurrentFile=LJa;LD.BeforeCursor=nRr;LD.AfterCursor=iRr;LD.DocumentPrefix=BJa;LD.DocumentSuffix=FJa;var FR=rL(),OAe=w6(),NJa=JG(),MJa=iMi(),OJa=Ore(),tRr=k6();LD.MAX_EDIT_DISTANCE_LENGTH=50;function rRr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(rRr,"approximateMaxCharacters");function LJa(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(tRr.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=rRr(c);return(0,FR.jsxs)(FR.Fragment,{children:[(0,FR.jsx)(nRr,{document:r,position:o,maxCharacters:m}),(0,FR.jsx)(iRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(LJa,"CurrentFile");function nRr(t){if(t.document===void 0||t.position===void 0)return(0,FR.jsx)(OAe.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,FR.jsx)(OAe.Text,{children:e})}a(nRr,"BeforeCursor");function iRr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,FR.jsx)(OAe.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,FR.jsx)(OAe.Text,{});if(r===s)return(0,FR.jsx)(OAe.Text,{children:r});let c=s;if(r!==""){let l=(0,OJa.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,LD.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,LD.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,MJa.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??NJa.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,FR.jsx)(OAe.Text,{children:c})}a(iRr,"AfterCursor");function BJa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(tRr.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=rRr(c);return(0,FR.jsx)(nRr,{document:r,position:o,maxCharacters:u})}a(BJa,"DocumentPrefix");function FJa(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(tRr.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=rRr(c);return(0,FR.jsx)(iRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(FJa,"DocumentSuffix")});var sRr=I(tne=>{"use strict";p();Object.defineProperty(tne,"__esModule",{value:!0});tne.WishlistElision=void 0;tne.makePrompt=UJa;tne.makePrefixPrompt=QJa;tne.makeContextPrompt=qJa;var oRr=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]}};tne.WishlistElision=oRr;function UJa(t){return t.map(e=>e.elidedValue).join("")}a(UJa,"makePrompt");function QJa(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(QJa,"makePrefixPrompt");function qJa(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(qJa,"makeContextPrompt")});var lRr=I(C$=>{"use strict";p();Object.defineProperty(C$,"__esModule",{value:!0});C$.transformers=C$.CompletionsPromptRenderer=void 0;C$.normalizeLineEndings=cRr;var cMi=Xwr(),oMi=k4e(),sMi=Ore(),jJa=H4e(),Kyt=$4e(),aMi=sRr(),HJa=5,aRr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=aMi.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??sMi.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 aMi.WishlistElision,{blocks:[y,...E]}=A.elide(u,h,d,m,(0,sMi.getTokenizer)(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...GJa([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-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-HJa: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 cMi.SnapshotWalker(e,C$.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===Kyt.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:cRr(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,oMi.isShebangLine)(f.value)?y=A:y=(0,oMi.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:cRr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${Kyt.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}}};C$.CompletionsPromptRenderer=aRr;C$.transformers=[...(0,cMi.defaultTransformers)(),(t,e,r)=>(0,jJa.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===Kyt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===Kyt.AfterCursor.name?{...r,type:"suffix"}:r];function GJa(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(GJa,"computeComponentStatistics");function cRr(t){return t.replace(/\r\n?/g,` -`)}a(cRr,"normalizeLineEndings")});var Jyt=I(LAe=>{"use strict";p();Object.defineProperty(LAe,"__esModule",{value:!0});LAe.ILanguageContextProviderService=LAe.ProviderTarget=void 0;var $Ja=nn(),lMi;(function(t){t.NES="nes",t.Completions="completions"})(lMi||(LAe.ProviderTarget=lMi={}));LAe.ILanguageContextProviderService=(0,$Ja.createServiceIdentifier)("ILanguageContextProviderService")});var rne=I(BAe=>{"use strict";p();Object.defineProperty(BAe,"__esModule",{value:!0});BAe.RuntimeMode=BAe.ICompletionsRuntimeModeService=void 0;var VJa=nn();BAe.ICompletionsRuntimeModeService=(0,VJa.createServiceIdentifier)("completionsRuntimeModeService");var uRr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:uMi(r,n),verboseLogging:zJa(r,n),testMode:e,simulation:WJa(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}};BAe.RuntimeMode=uRr;function uMi(t,e){return t.includes("--debug")||dRr(e,"DEBUG")}a(uMi,"determineDebugFlag");function WJa(t){return dRr(t,"SIMULATION")}a(WJa,"determineSimulationFlag");function zJa(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||dRr(e,"VERBOSE")||uMi(t,e)}a(zJa,"determineVerboseLoggingEnabled");function dRr(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(dRr,"determineEnvFlagEnabled")});var hMi=I(V4e=>{"use strict";p();Object.defineProperty(V4e,"__esModule",{value:!0});V4e.eventToPromise=YJa;V4e.isArrayOfT=pMi;V4e.resolveAll=JJa;var dMi=y4e();async function YJa(t){let e=new dMi.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(YJa,"eventToPromise");async function KJa(t){if(t.isCancellationRequested)return;let e=new dMi.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(KJa,"cancellationTokenToPromise");async function fMi(t,e){if(e){let r=KJa(e);await Promise.race([t,r])}else await t}a(fMi,"raceCancellation");function pMi(t){return Array.isArray(t)}a(pMi,"isArrayOfT");async function JJa(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await ZJa(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(JJa,"resolveAll");async function ZJa(t,e){let r;return t instanceof Promise?r=await XJa(t,e):r=await eZa(t,e),r}a(ZJa,"resolve");async function XJa(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:pMi(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await fMi(o,e),n.resolutionTime=performance.now()-r,n}a(XJa,"resolvePromise");async function eZa(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 fMi(o,e),n.resolutionTime=performance.now()-r,n}a(eZa,"resolveIterable")});var mMi=I(pRr=>{"use strict";p();Object.defineProperty(pRr,"__esModule",{value:!0});pRr.fillInCppVSCodeActiveExperiments=iZa;var tZa=fy(),fRr=Dl(),rZa={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},nZa="ms-vscode.cpptools";function iZa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(nZa))&&oZa(t,r,n)}a(iZa,"fillInCppVSCodeActiveExperiments");function oZa(t,e,r){try{let n=t.get(tZa.ICompletionsFeaturesService),o=t.get(fRr.ICompletionsLogTargetService),s=rZa,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){fRr.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){fRr.logger.exception(t,n,"fillInCppActiveExperiments")}}a(oZa,"addActiveExperiments")});var AMi=I(hRr=>{"use strict";p();Object.defineProperty(hRr,"__esModule",{value:!0});hRr.fillInCSharpActiveExperiments=aZa;var sZa=fy(),gMi=Dl();function aZa(t,e,r){let n=t.get(sZa.ICompletionsFeaturesService),o=t.get(gMi.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 gMi.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(aZa,"fillInCSharpActiveExperiments")});var yMi=I(b$=>{"use strict";p();Object.defineProperty(b$,"__esModule",{value:!0});b$.multiLanguageContextProviderParamsDefault=void 0;b$.fillInMultiLanguageActiveExperiments=uZa;b$.getMultiLanguageContextProviderParamsFromActiveExperiments=pZa;var cZa=fy(),mRr=Dl(),lZa="fallbackContextProvider";b$.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function uZa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(lZa))&&dZa(t,r,n)}a(uZa,"fillInMultiLanguageActiveExperiments");function dZa(t,e,r){try{let n=fZa(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){mRr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(dZa,"addActiveExperiments");function fZa(t,e){let r=b$.multiLanguageContextProviderParamsDefault,n=t.get(mRr.ICompletionsLogTargetService),s=t.get(cZa.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){mRr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(fZa,"getMultiLanguageContextProviderParamsFromExp");function pZa(t){let e={...b$.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(pZa,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var _Mi=I(FAe=>{"use strict";p();Object.defineProperty(FAe,"__esModule",{value:!0});FAe.TS_CONTEXT_PROVIDER_ID=void 0;FAe.fillInTsActiveExperiments=mZa;var hZa=fy(),EMi=Dl();FAe.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function mZa(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(FAe.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(EMi.ICompletionsLogTargetService),s=t.get(hZa.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 EMi.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(mZa,"fillInTsActiveExperiments")});var eEt=I(Nl=>{"use strict";p();var _Rr=Nl&&Nl.__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},BD=Nl&&Nl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Nl,"__esModule",{value:!0});Nl.DefaultDiagnosticSettings=Nl.CachedContextProviderRegistry=Nl.MutableContextProviderRegistry=Nl.CoreContextProviderRegistry=Nl.DefaultContextProvidersContainer=Nl.ICompletionsDefaultContextProviders=Nl.ICompletionsContextProviderRegistryService=void 0;Nl.telemetrizeContextItems=SZa;Nl.matchContextItems=TZa;Nl.useContextProviderAPI=xZa;Nl.getDefaultDiagnosticSettings=RZa;var gZa=ri(),vMi=Pl(),vRr=Jyt(),AZa=mh(),SMi=nn(),yZa=Rs(),CRr=Gs(),Zyt=LE(),TMi=fy(),EZa=C6(),P6=Dl(),bRr=rne(),CMi=hMi(),_Za=mMi(),vZa=AMi(),CZa=yMi(),bZa=_Mi(),bMi=j4e(),IMi=v$();Nl.ICompletionsContextProviderRegistryService=(0,SMi.createServiceIdentifier)("ICompletionsContextProviderRegistryService");Nl.ICompletionsDefaultContextProviders=(0,SMi.createServiceIdentifier)("ICompletionsDefaultContextProviders");var gRr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};Nl.DefaultContextProvidersContainer=gRr;var Xyt=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([vRr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return P6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(vZa.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 P6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(_Za.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(CZa.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(bZa.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new gZa.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(wZa,n.languageId,o),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=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);_.set(w.id,x)}let b=this.contextProviderStatistics.getStatisticsForCompletion(e);b.setOpportunityId(r);let T=await(0,CMi.resolveAll)(_,g.token);E&&clearTimeout(E);for(let[w,R]of h){let x=T.get(w.id);if(x){if(x.status==="error")(0,yZa.isCancellationError)(x.reason)||P6.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 P=[...x.value??[]];if((x.status==="none"||x.status==="partial")&&(P6.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,CMi.isArrayOfT)(q)?P.push(...q):q&&P.push(q),P.length>0&&(x.status="partial")}catch(q){P6.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,q)}let[D,N]=(0,bMi.filterSupportedContextItems)(P);N&&P6.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let L=this.instantiationService.invokeFunction(bMi.addOrValidateContextItemsIDs,D),B={providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:L};u.push(B)}b.setLastResolution(w.id,x.status)}else P6.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(xMi,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]}))}};Nl.CoreContextProviderRegistry=Xyt;Nl.CoreContextProviderRegistry=Xyt=_Rr([BD(1,vRr.ILanguageContextProviderService),BD(2,bRr.ICompletionsRuntimeModeService),BD(3,CRr.IInstantiationService),BD(4,P6.ICompletionsLogTargetService),BD(5,IMi.ICompletionsContextProviderService)],Xyt);var ARr=class extends Xyt{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)}};Nl.MutableContextProviderRegistry=ARr;Nl.MutableContextProviderRegistry=ARr=_Rr([BD(1,vRr.ILanguageContextProviderService),BD(2,bRr.ICompletionsRuntimeModeService),BD(3,CRr.IInstantiationService),BD(4,P6.ICompletionsLogTargetService),BD(5,IMi.ICompletionsContextProviderService)],ARr);var yRr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new EZa.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}};Nl.CachedContextProviderRegistry=yRr;Nl.CachedContextProviderRegistry=yRr=_Rr([BD(2,CRr.IInstantiationService)],yRr);function SZa(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(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(SZa,"telemetrizeContextItems");function TZa(t){return t.matchScore>0&&t.resolution!=="error"}a(TZa,"matchContextItems");function xMi(t,e,r){let n=IZa(t,e,r),o=(0,Zyt.getConfig)(t,Zyt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get(Nl.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(xMi,"getActiveContextProviders");function IZa(t,e,r){if(t.get(bRr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(TMi.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(IZa,"getExpContextProviders");function xZa(t,e,r){return xMi(t,e,r).length>0}a(xZa,"useContextProviderAPI");function wZa(t,e,r){let n=(0,Zyt.getConfig)(t,Zyt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(TMi.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(wZa,"getContextProviderTimeBudget");var ERr;(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")})(ERr||(Nl.DefaultDiagnosticSettings=ERr={}));function RZa(t){let e=t.get(vMi.IConfigurationService),r=t.get(AZa.IExperimentationService),n=e.getExperimentBasedConfig(vMi.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return ERr.from(n)}a(RZa,"getDefaultDiagnosticSettings")});var tEt=I(FD=>{"use strict";p();var kZa=FD&&FD.__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},PZa=FD&&FD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(FD,"__esModule",{value:!0});FD.ContextProviderBridge=FD.ICompletionsContextProviderBridgeService=void 0;var DZa=nn(),NZa=C6(),MZa=eEt();FD.ICompletionsContextProviderBridgeService=(0,DZa.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var SRr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new NZa.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:[]}};FD.ContextProviderBridge=SRr;FD.ContextProviderBridge=SRr=kZa([PZa(0,MZa.ICompletionsContextProviderRegistryService)],SRr)});var xRr=I(rEt=>{"use strict";p();Object.defineProperty(rEt,"__esModule",{value:!0});rEt.Diagnostics=void 0;var TRr=rL(),OZa=P0(),IRr=w6(),LZa=JG(),BZa=k6();function FZa(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(FZa,"getCode");function UZa(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(UZa,"getRelativePath");var QZa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(BZa.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,LZa.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,TRr.jsx)(IRr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${UZa(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 E=Math.abs(A.range.start.line-c.line),_=Math.abs(y.range.start.line-c.line);return E-_})),g.forEach(A=>{let y="",E=FZa(A);E!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${E}`);let _=A.range.start;m.push((0,TRr.jsx)(IRr.Text,{children:`${_.line+1}:${_.character+1} - ${OZa.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,TRr.jsx)(IRr.Chunk,{children:m})})},"Diagnostics");rEt.Diagnostics=QZa});var wRr=I(iEt=>{"use strict";p();Object.defineProperty(iEt,"__esModule",{value:!0});iEt.DocumentMarker=void 0;var nEt=rL(),wMi=w6(),RMi=k4e(),qZa=k6(),jZa=a((t,e)=>{let[r,n]=e.useState();if(e.useData(qZa.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,nEt.jsx)(HZa,{docInfo:s}):(0,nEt.jsx)(GZa,{docInfo:s})}},"DocumentMarker");iEt.DocumentMarker=jZa;var HZa=a(t=>(0,nEt.jsx)(wMi.Text,{children:(0,RMi.getPathMarker)(t.docInfo)}),"PathMarker"),GZa=a(t=>(0,nEt.jsx)(wMi.Text,{children:(0,RMi.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var RRr=I(W4e=>{"use strict";p();Object.defineProperty(W4e,"__esModule",{value:!0});W4e.RecentEdits=void 0;W4e.editIsTooCloseToCursor=DMi;var kMi=rL(),PMi=w6(),oEt=k4e(),$Za=k6();function DMi(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(DMi,"editIsTooCloseToCursor");var VZa=a((t,e)=>{let[r,n]=e.useState();return e.useData($Za.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 E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(DMi(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift((0,oEt.newLineEnded)(`File: ${T}`)+(0,oEt.newLineEnded)(b))}}if(f.length===0){n(void 0);return}let h=(0,oEt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,oEt.newLineEnded)("End of recent edits");n(h)}),r?(0,kMi.jsx)(PMi.Chunk,{children:(0,kMi.jsx)(PMi.Text,{children:r})}):void 0},"RecentEdits");W4e.RecentEdits=VZa});var NMi=I(sL=>{"use strict";p();Object.defineProperty(sL,"__esModule",{value:!0});sL.registerDocumentTracker=sL.accessTimes=void 0;sL.sortByAccessTimes=YZa;var WZa=C6(),zZa=s1();sL.accessTimes=new WZa.LRUCacheMap;function YZa(t){return[...t].sort((e,r)=>{let n=sL.accessTimes.get(e.uri)??0;return(sL.accessTimes.get(r.uri)??0)-n})}a(YZa,"sortByAccessTimes");var KZa=a(t=>t.get(zZa.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&sL.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");sL.registerDocumentTracker=KZa});var MMi=I(D6=>{"use strict";p();var JZa=D6&&D6.__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=D6&&D6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(D6,"__esModule",{value:!0});D6.OpenTabFiles=void 0;var XZa=NMi(),eXa=s1(),kRr=UAe(),PRr=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>kRr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,kRr.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,XZa.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(kRr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};D6.OpenTabFiles=PRr;D6.OpenTabFiles=PRr=JZa([ZZa(0,eXa.ICompletionsTextDocumentManagerService)],PRr)});var OMi=I(DRr=>{"use strict";p();Object.defineProperty(DRr,"__esModule",{value:!0});DRr.shortCircuit=tXa;function tXa(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(tXa,"shortCircuit")});var dEt=I(Ml=>{"use strict";p();var rXa=Ml&&Ml.__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},sEt=Ml&&Ml.__param||function(t,e){return function(r,n){e(r,n,t)}},NRr;Object.defineProperty(Ml,"__esModule",{value:!0});Ml.RelatedFilesProvider=Ml.ICompletionsRelatedFilesProviderService=Ml.relatedFilesLogger=Ml.PromiseExpirationCacheMap=Ml.EmptyRelatedFilesResponse=void 0;Ml.getRelatedFilesAndTraits=fXa;var nXa=Bre(),iXa=nn(),oXa=nd(),LRr=Gs(),sXa=n$(),aXa=C6(),uEt=Dl(),cXa=$g(),lXa=OMi();Ml.EmptyRelatedFilesResponse={entries:[],traits:[]};var aEt={entries:new Map,traits:[]},cEt=class extends aXa.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.timestampMl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};Ml.RelatedFilesProvider=MRr;Ml.RelatedFilesProvider=MRr=NRr=rXa([sEt(0,LRr.IInstantiationService),sEt(1,nXa.IIgnoreService),sEt(2,uEt.ICompletionsLogTargetService),sEt(3,sXa.ICompletionsFileSystemService)],MRr);var dXa=3,z4e=new cEt(uXa);async function LMi(t,e,r,n,o){let s=t.get(LRr.IInstantiationService),c=t.get(uEt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>Ml.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(z4e.bumpRetryCount(e.uri)>=dXa?u=aEt:u=void 0);let d=performance.now()-l;if(Ml.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 lEt;return u}a(LMi,"getRelatedFiles");var ORr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(z4e.has(s))return z4e.get(s);let c=LMi(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw z4e.delete(s),l})),z4e.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");ORr=(0,lXa.shortCircuit)(ORr,200,aEt);async function fXa(t,e,r,n,o,s=!1){let c=t.get(LRr.IInstantiationService),l=t.get(uEt.ICompletionsLogTargetService),u=t.get(Ml.ICompletionsRelatedFilesProviderService),d=aEt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(LMi,f,r,n,u):await c.invokeFunction(ORr,f,r,n,u)}catch(f){d=aEt,f instanceof lEt&&c.invokeFunction(cXa.telemetry,"getRelatedFilesList",r)}return Ml.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(fXa,"getRelatedFilesAndTraits")});var UAe=I(S$=>{"use strict";p();Object.defineProperty(S$,"__esModule",{value:!0});S$.NeighborSource=S$.NeighboringFileType=void 0;S$.considerNeighborFile=AXa;S$.isIncludeNeighborFilesActive=yXa;var pXa=Gs(),BMi=JG(),UMi=fy(),hXa=Dl(),mXa=s1(),gXa=MMi(),fEt=dEt(),FMi;(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"})(FMi||(S$.NeighboringFileType=FMi={}));function AXa(t,e){return(0,BMi.normalizeLanguageId)(t)===(0,BMi.normalizeLanguageId)(e)}a(AXa,"considerNeighborFile");var BRr=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(UMi.ICompletionsFeaturesService),d=e.get(hXa.ICompletionsLogTargetService),f=e.get(pXa.IInstantiationService),h=e.get(mXa.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(gXa.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 fEt.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 fEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(fEt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(fEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),m.traits.push(...y.traits),m):(y.entries.forEach((E,_)=>{let v=[];E.forEach((b,T)=>{let w=t.getRelativePath(T,A.uri);if(!w||m.docs.has(T))return;let R={relativePath:w,uri:T,source:b};v.unshift(R),m.docs.set(T,R)}),v.length>0&&m.neighborSource.set(_,v.map(b=>b.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)}};S$.NeighborSource=BRr;function yXa(t,e,r){return t.get(UMi.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(yXa,"isIncludeNeighborFilesActive")});var URr=I(pEt=>{"use strict";p();Object.defineProperty(pEt,"__esModule",{value:!0});pEt.SimilarFiles=void 0;var QAe=rL(),FRr=w6(),EXa=Eyt(),_Xa=vIr(),vXa=vyt(),CXa=k6(),bXa=qAe(),QMi=UAe(),SXa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(CXa.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=QMi.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await QMi.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(bXa.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,_Xa.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(vXa.getSimilarFilesOptions,d,f.detectedLanguageId),y=t.tdms.getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await(0,EXa.getSimilarSnippets)(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,QAe.jsxs)(QAe.Fragment,{children:[...o.map((u,d)=>(0,QAe.jsx)(TXa,{snippet:u}))]})},"SimilarFiles");pEt.SimilarFiles=SXa;var TXa=a((t,e)=>(0,QAe.jsxs)(FRr.Chunk,{children:[(0,QAe.jsx)(FRr.Text,{children:t.snippet.headline}),(0,QAe.jsx)(FRr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var zMi=I(rI=>{"use strict";p();Object.defineProperty(rI,"__esModule",{value:!0});rI.getAllRecentEditsByTimestamp=IXa;rI.findChangeSpan=QRr;rI.getDiff=jMi;rI.unifiedDiff=HMi;rI.findReplaceDiff=GMi;rI.editsOverlap=$Mi;rI.updateEdits=VMi;rI.buildIncomingEdit=qRr;rI.trimOldFilesFromState=WMi;rI.recentEditsReducer=RXa;rI.summarizeEdit=kXa;function IXa(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(IXa,"getAllRecentEditsByTimestamp");function QRr(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(QRr,"findChangeSpan");function jMi(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(jMi,"getDiff");function xXa(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(xXa,"measureDiffSize");function HMi(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(` +${ZDi(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,mKa.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};Ay.MarkdownString=Nyt;function KDi(t){return JDi(t)?!t.value:Array.isArray(t)?t.every(KDi):!0}a(KDi,"isEmptyMarkdownString");function JDi(t){return t instanceof Nyt?!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(JDi,"isMarkdownString");function gKa(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,hKa.isEqual)(Dyt.URI.from(t.baseUri),Dyt.URI.from(e.baseUri)))}a(gKa,"markdownStringEqual");function Myt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(Myt,"escapeMarkdownSyntaxTokens");function AKa(t){return t.replace(/[\\\]]/g,"\\$&")}a(AKa,"escapeMarkdownLinkLabel");function ZDi(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(ZDi,"appendEscapedMarkdownCodeBlockFence");function yKa(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(yKa,"appendEscapedMarkdownInlineCode");function EKa(t){return t.replace(/"/g,""")}a(EKa,"escapeDoubleQuotes");function _Ka(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(_Ka,"removeMarkdownEscapes");function vKa(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(vKa,"parseHrefAndDimensions");function XDi(t,e,r,n=!0){return`[${n?Myt(t):t}](${e}${r?` "${Myt(r)}"`:""})`}a(XDi,"createMarkdownLink");function CKa(t,e=!0){let r=eNi(t.id,...t.arguments||[]).toString();return XDi(t.text,r,t.tooltip,e)}a(CKa,"createMarkdownCommandLink");function eNi(t,...e){return Dyt.URI.from({scheme:pKa.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(eNi,"createCommandUri")});var dxr=I(Kre=>{"use strict";p();var bKa=Kre&&Kre.__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},lxr;Object.defineProperty(Kre,"__esModule",{value:!0});Kre.MarkdownString=void 0;var SKa=tNi(),TKa=OD(),uxr=lxr=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof lxr?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new SKa.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}};Kre.MarkdownString=uxr;Kre.MarkdownString=uxr=lxr=bKa([TKa.es5ClassCompat],uxr)});var iNi=I(x6=>{"use strict";p();Object.defineProperty(x6,"__esModule",{value:!0});x6.Mimes=void 0;x6.getMediaOrTextMime=xKa;x6.getMediaMime=nNi;x6.getExtensionForMimeType=wKa;x6.normalizeMimeType=kKa;x6.isTextStreamMime=PKa;var rNi=NA();x6.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 IKa={".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"},fxr={".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 xKa(t){let e=(0,rNi.extname)(t),r=IKa[e.toLowerCase()];return r!==void 0?r:nNi(t)}a(xKa,"getMediaOrTextMime");function nNi(t){let e=(0,rNi.extname)(t),r=fxr[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(nNi,"getMediaMime");function wKa(t){for(let e in fxr){let r=fxr[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(wKa,"getExtensionForMimeType");var RKa=/^(.+)\/(.+?)(;.+)?$/;function kKa(t,e){let r=RKa.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(kKa,"normalizeMimeType");function PKa(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(PKa,"isTextStreamMime")});var aNi=I(k0=>{"use strict";p();var DKa=k0&&k0.__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},g$;Object.defineProperty(k0,"__esModule",{value:!0});k0.NotebookCellOutput=k0.NotebookCellOutputItem=k0.NotebookEdit=k0.NotebookData=k0.NotebookCellData=k0.NotebookRange=k0.NotebookCellKind=void 0;var NKa=OD(),oNi=Rs(),Oyt=iNi(),MKa=T0(),sNi;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(sNi||(k0.NotebookCellKind=sNi={}));var Jre=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,oNi.illegalArgument)("start must be positive");if(r<0)throw(0,oNi.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)}};k0.NotebookRange=Jre;var pxr=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)}};k0.NotebookCellData=pxr;var hxr=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};k0.NotebookData=hxr;var mxr=g$=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof g$?!0:e?Jre.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new g$(e,r)}static insertCells(e,r){return new g$(new Jre(e,e),r)}static deleteCells(e){return new g$(e,[])}static updateCellMetadata(e,r){let n=new g$(new Jre(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new g$(new Jre(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};k0.NotebookEdit=mxr;k0.NotebookEdit=mxr=g$=DKa([NKa.es5ClassCompat],mxr);var gxr=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=Oyt.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,Oyt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};k0.NotebookCellOutputItem=gxr;var Axr=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,MKa.generateUuid)(),this.metadata=r??n)}};k0.NotebookCellOutput=Axr});var lNi=I(y$=>{"use strict";p();var OKa=y$&&y$.__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},yxr;Object.defineProperty(y$,"__esModule",{value:!0});y$.Selection=void 0;y$.getDebugDescriptionOfSelection=cNi;var LKa=OD(),A$=PAe(),Exr=nL(),_xr=yxr=class extends Exr.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof yxr?!0:!e||typeof e!="object"?!1:Exr.Range.isRange(e)&&A$.Position.isPosition(e.anchor)&&A$.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 A$.Position(e,r),c=new A$.Position(n,o)):A$.Position.isPosition(e)&&A$.Position.isPosition(r)&&(s=A$.Position.of(e),c=A$.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 cNi(this)}};y$.Selection=_xr;y$.Selection=_xr=yxr=OKa([LKa.es5ClassCompat],_xr);function cNi(t){let e=(0,Exr.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(cNi,"getDebugDescriptionOfSelection")});var Cxr=I(Xre=>{"use strict";p();var BKa=Xre&&Xre.__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},Zre;Object.defineProperty(Xre,"__esModule",{value:!0});Xre.SnippetString=void 0;var FKa=OD(),vxr=Zre=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Zre?!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+=Zre._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 Zre;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Zre._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 Zre;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}};Xre.SnippetString=vxr;Xre.SnippetString=vxr=Zre=BKa([FKa.es5ClassCompat],vxr)});var Sxr=I(Lyt=>{"use strict";p();Object.defineProperty(Lyt,"__esModule",{value:!0});Lyt.SnippetTextEdit=void 0;var UKa=Cxr(),uNi=nL(),bxr=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?uNi.Range.isRange(e.range)&&UKa.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new uNi.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};Lyt.SnippetTextEdit=bxr});var pNi=I(LD=>{"use strict";p();var QKa=LD&&LD.__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},Txr;Object.defineProperty(LD,"__esModule",{value:!0});LD.SymbolInformation=LD.SymbolTag=LD.SymbolKind=void 0;var qKa=OD(),dNi=qIr(),jKa=nL(),Ixr;(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"})(Ixr||(LD.SymbolKind=Ixr={}));var fNi;(function(t){t[t.Deprecated=1]="Deprecated"})(fNi||(LD.SymbolTag=fNi={}));var xxr=Txr=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 dNi.Location?this.location=o:n instanceof jKa.Range&&(this.location=new dNi.Location(o,n)),Txr.validate(this)}toJSON(){return{name:this.name,kind:Ixr[this.kind],location:this.location,containerName:this.containerName}}};LD.SymbolInformation=xxr;LD.SymbolInformation=xxr=Txr=QKa([qKa.es5ClassCompat],xxr)});var kxr=I(w6=>{"use strict";p();var HKa=w6&&w6.__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},ene;Object.defineProperty(w6,"__esModule",{value:!0});w6.TextEdit=w6.EndOfLine=void 0;var wxr=Rs(),GKa=OD(),hNi=PAe(),Byt=nL(),mNi;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(mNi||(w6.EndOfLine=mNi={}));var Rxr=ene=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof ene?!0:!e||typeof e!="object"?!1:Byt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new ene(e,r)}static insert(e,r){return ene.replace(new Byt.Range(e,e),r)}static delete(e){return ene.replace(e,"")}static setEndOfLine(e){let r=new ene(new Byt.Range(new hNi.Position(0,0),new hNi.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!Byt.Range.isRange(e))throw(0,wxr.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,wxr.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,wxr.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}}};w6.TextEdit=Rxr;w6.TextEdit=Rxr=ene=HKa([GKa.es5ClassCompat],Rxr)});var xNi=I(xt=>{"use strict";p();Object.defineProperty(xt,"__esModule",{value:!0});xt.ChatResponseClearToPreviousToolInvocationReason=xt.ChatRequestEditedFileEventKind=xt.ChatInputNotificationSeverity=xt.ChatErrorLevel=xt.AISearchKeyword=xt.TextSearchMatch2=xt.ExcludeSettingOptions=xt.LanguageModelPromptTsxPart=xt.ChatImageMimeType=xt.LanguageModelDataPart2=xt.LanguageModelDataPart=xt.LanguageModelThinkingPart=xt.LanguageModelTextPart2=xt.LanguageModelPartAudience=xt.LanguageModelTextPart=xt.LanguageModelToolResult2=xt.LanguageModelToolResult=xt.ChatReferenceBinaryData=xt.ChatReferenceDiagnostic=xt.ChatRequestNotebookData=xt.ChatRequestEditorData=xt.ChatResponseTurn=xt.ChatRequestTurn2=xt.ChatRequestTurn=xt.ChatResponseQuestionCarouselPart=xt.ChatQuestion=xt.ChatQuestionType=xt.ChatResponseConfirmationPart=xt.ChatResponseWorkspaceEditPart=xt.ChatResponseNotebookEditPart=xt.ChatResponseTextEditPart=xt.ChatResponseMarkdownWithVulnerabilitiesPart=xt.ChatResponseCommandButtonPart=xt.ChatResponseCodeCitationPart=xt.ChatResponsePullRequestPart=xt.ChatResponseExtensionsPart=xt.ChatResponseMovePart=xt.ChatResponseReferencePart2=xt.ChatResponseReferencePart=xt.ChatResponseInfoPart=xt.ChatResponseWarningPart=xt.ChatResponseProgressPart2=xt.ChatResponseExternalEditPart=xt.ChatResponseHookPart=xt.ChatResponseThinkingProgressPart=xt.ChatResponseProgressPart=xt.ChatResponseAnchorPart=xt.ChatResponseFileTreePart=xt.ChatResponseCodeblockUriPart=xt.ChatResponseMarkdownPart=void 0;xt.McpHttpServerDefinition=xt.McpStdioServerDefinition=xt.ChatResource=xt.LanguageModelError=xt.ChatSessionStatus=xt.ChatResponseTurn2=xt.ChatSubagentToolInvocationData=xt.ChatToolInvocationPart=xt.McpToolInvocationContentData=xt.LanguageModelChatMessage=xt.LanguageModelChatToolMode=xt.LanguageModelChatMessageRole=xt.LanguageModelToolResultPart2=xt.LanguageModelToolResultPart=xt.LanguageModelToolCallPart=xt.LanguageModelToolMCPSource=xt.LanguageModelToolExtensionSource=void 0;var gNi=t$(),qyt=dxr(),Pxr=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new qyt.MarkdownString(e):e}};xt.ChatResponseMarkdownPart=Pxr;var Dxr=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};xt.ChatResponseCodeblockUriPart=Dxr;var Nxr=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};xt.ChatResponseFileTreePart=Nxr;var Mxr=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};xt.ChatResponseAnchorPart=Mxr;var Oxr=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};xt.ChatResponseProgressPart=Oxr;var Lxr=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.ChatResponseThinkingProgressPart=Lxr;var Bxr=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};xt.ChatResponseHookPart=Bxr;var Fxr=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};xt.ChatResponseExternalEditPart=Fxr;var Uxr=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};xt.ChatResponseProgressPart2=Uxr;var Qxr=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new qyt.MarkdownString(e):e}};xt.ChatResponseWarningPart=Qxr;var qxr=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new qyt.MarkdownString(e):e}};xt.ChatResponseInfoPart=qxr;var jxr=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};xt.ChatResponseReferencePart=jxr;var Hxr=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};xt.ChatResponseReferencePart2=Hxr;var Gxr=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};xt.ChatResponseMovePart=Gxr;var $xr=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};xt.ChatResponseExtensionsPart=$xr;var Vxr=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}};xt.ChatResponsePullRequestPart=Vxr;var Wxr=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};xt.ChatResponseCodeCitationPart=Wxr;var zxr=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};xt.ChatResponseCommandButtonPart=zxr;var Yxr=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new qyt.MarkdownString(e):e,this.vulnerabilities=r}};xt.ChatResponseMarkdownWithVulnerabilitiesPart=Yxr;var Kxr=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]}};xt.ChatResponseTextEditPart=Kxr;var Jxr=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]}};xt.ChatResponseNotebookEditPart=Jxr;var Zxr=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};xt.ChatResponseWorkspaceEditPart=Zxr;var Xxr=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};xt.ChatResponseConfirmationPart=Xxr;var ANi;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(ANi||(xt.ChatQuestionType=ANi={}));var ewr=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)}};xt.ChatQuestion=ewr;var twr=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};xt.ChatResponseQuestionCarouselPart=twr;var rwr=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}};xt.ChatRequestTurn=rwr;var nwr=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}};xt.ChatRequestTurn2=nwr;var iwr=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn=iwr;var owr=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};xt.ChatRequestEditorData=owr;var swr=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};xt.ChatRequestNotebookData=swr;var awr=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};xt.ChatReferenceDiagnostic=awr;var cwr=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};xt.ChatReferenceBinaryData=cwr;var lwr=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};xt.LanguageModelToolResult=lwr;var uwr=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};xt.LanguageModelToolResult2=uwr;var Fyt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};xt.LanguageModelTextPart=Fyt;var yNi;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(yNi||(xt.LanguageModelPartAudience=yNi={}));var dwr=class extends Fyt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};xt.LanguageModelTextPart2=dwr;var fwr=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.LanguageModelThinkingPart=fwr;var Uyt=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(gNi.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(gNi.VSBuffer.fromString(e).buffer,"text/plain")}};xt.LanguageModelDataPart=Uyt;var pwr=class extends Uyt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};xt.LanguageModelDataPart2=pwr;var ENi;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(ENi||(xt.ChatImageMimeType=ENi={}));var hwr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};xt.LanguageModelPromptTsxPart=hwr;var _Ni;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(_Ni||(xt.ExcludeSettingOptions=_Ni={}));var mwr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};xt.TextSearchMatch2=mwr;var gwr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};xt.AISearchKeyword=gwr;var vNi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(vNi||(xt.ChatErrorLevel=vNi={}));var CNi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(CNi||(xt.ChatInputNotificationSeverity=CNi={}));var bNi;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(bNi||(xt.ChatRequestEditedFileEventKind=bNi={}));var SNi;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(SNi||(xt.ChatResponseClearToPreviousToolInvocationReason=SNi={}));var Awr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};xt.LanguageModelToolExtensionSource=Awr;var ywr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};xt.LanguageModelToolMCPSource=ywr;var Ewr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};xt.LanguageModelToolCallPart=Ewr;var _wr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart=_wr;var vwr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart2=vwr;var Qyt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(Qyt||(xt.LanguageModelChatMessageRole=Qyt={}));var TNi;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(TNi||(xt.LanguageModelChatToolMode=TNi={}));var Cwr=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(Qyt.User,e,r)}static Assistant(e,r){return new t(Qyt.Assistant,e,r)}};xt.LanguageModelChatMessage=Cwr;var bwr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};xt.McpToolInvocationContentData=bwr;var Swr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};xt.ChatToolInvocationPart=Swr;var Twr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};xt.ChatSubagentToolInvocationData=Twr;var Iwr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn2=Iwr;var INi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(INi||(xt.ChatSessionStatus=INi={}));var xwr=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??""}};xt.LanguageModelError=xwr;var wwr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};xt.ChatResource=wwr;var Rwr=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}};xt.McpStdioServerDefinition=Rwr;var kwr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};xt.McpHttpServerDefinition=kwr});var kNi=I(E$=>{"use strict";p();Object.defineProperty(E$,"__esModule",{value:!0});E$.TextDocumentChangeReason=E$.TextEditorSelectionChangeKind=E$.WorkspaceEdit=void 0;var $Ka=Sl(),VKa=YP(),WKa=nL(),zKa=Sxr(),YKa=kxr(),Pwr=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 YKa.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new WKa.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,zKa.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(xp,"__esModule",{value:!0});xp.FileType=xp.ChatSessionStatus=xp.ChatLocation=xp.ChatVariableLevel=xp.ExtensionMode=xp.DiagnosticSeverity=xp.TextEditorRevealType=xp.TextEditorLineNumbersStyle=xp.TextEditorCursorStyle=xp.InteractiveEditorResponseFeedbackKind=void 0;var PNi;(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"})(PNi||(xp.InteractiveEditorResponseFeedbackKind=PNi={}));var DNi;(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"})(DNi||(xp.TextEditorCursorStyle=DNi={}));var NNi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(NNi||(xp.TextEditorLineNumbersStyle=NNi={}));var MNi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(MNi||(xp.TextEditorRevealType=MNi={}));var ONi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(ONi||(xp.DiagnosticSeverity=ONi={}));var LNi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(LNi||(xp.ExtensionMode=LNi={}));var BNi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(BNi||(xp.ChatVariableLevel=BNi={}));var FNi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(FNi||(xp.ChatLocation=FNi={}));var UNi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(UNi||(xp.ChatSessionStatus=UNi={}));var QNi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(QNi||(xp.FileType=QNi={}))});var HNi=I(Dwr=>{"use strict";p();Object.defineProperty(Dwr,"__esModule",{value:!0});Dwr.t=KKa;function KKa(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return jNi({message:e,args:r})}return jNi(t[0])}a(KKa,"t");function jNi(t){let{message:e,args:r}=t;return ZKa(e,r??{})}a(jNi,"getMessage");var JKa=/{([^}]+)}/g;function ZKa(t,e){return t.replace(JKa,(r,n)=>e[n]??r)}a(ZKa,"format2")});var VNi=I(_$=>{"use strict";p();Object.defineProperty(_$,"__esModule",{value:!0});_$.NewSymbolName=_$.NewSymbolNameTriggerKind=_$.NewSymbolNameTag=void 0;var GNi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(GNi||(_$.NewSymbolNameTag=GNi={}));var $Ni;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})($Ni||(_$.NewSymbolNameTriggerKind=$Ni={}));var Nwr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};_$.NewSymbolName=Nwr});var zNi=I(jyt=>{"use strict";p();Object.defineProperty(jyt,"__esModule",{value:!0});jyt.TerminalShellExecutionCommandLineConfidence=void 0;var WNi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(WNi||(jyt.TerminalShellExecutionCommandLineConfidence=WNi={}))});var YNi=I(NAe=>{"use strict";p();Object.defineProperty(NAe,"__esModule",{value:!0});NAe.ThemeColor=NAe.ThemeIcon=void 0;var Mwr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};NAe.ThemeIcon=Mwr;var Owr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};NAe.ThemeColor=Owr});var P0=I((NLp,XNi)=>{"use strict";p();var XKa=KP(),eJa=Ic(),tJa=nd(),KNi=FIr(),rJa=qIr(),nJa=dxr(),q4e=aNi(),iJa=PAe(),oJa=nL(),sJa=lNi(),aJa=Cxr(),cJa=Sxr(),JNi=pNi(),ZNi=kxr(),On=xNi(),Lwr=kNi(),v$=qNi(),lJa=HNi(),Bwr=VNi(),uJa=zNi(),dJa=YNi(),fJa={Position:iJa.Position,Range:oJa.Range,Selection:sJa.Selection,EventEmitter:eJa.Emitter,CancellationTokenSource:XKa.CancellationTokenSource,Diagnostic:KNi.Diagnostic,Location:rJa.Location,DiagnosticRelatedInformation:KNi.DiagnosticRelatedInformation,TextEdit:ZNi.TextEdit,WorkspaceEdit:Lwr.WorkspaceEdit,Uri:tJa.URI,MarkdownString:nJa.MarkdownString,DiagnosticSeverity:v$.DiagnosticSeverity,TextEditorCursorStyle:v$.TextEditorCursorStyle,TextEditorLineNumbersStyle:v$.TextEditorLineNumbersStyle,TextEditorRevealType:v$.TextEditorRevealType,EndOfLine:ZNi.EndOfLine,l10n:{t:lJa.t},ExtensionMode:v$.ExtensionMode,ChatVariableLevel:v$.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:On.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:On.ChatResponseMarkdownPart,ChatResponseFileTreePart:On.ChatResponseFileTreePart,ChatResponseAnchorPart:On.ChatResponseAnchorPart,ChatResponseMovePart:On.ChatResponseMovePart,ChatResponseExtensionsPart:On.ChatResponseExtensionsPart,ChatResponseProgressPart:On.ChatResponseProgressPart,ChatResponseProgressPart2:On.ChatResponseProgressPart2,ChatResponseWarningPart:On.ChatResponseWarningPart,ChatResponseInfoPart:On.ChatResponseInfoPart,ChatResponseHookPart:On.ChatResponseHookPart,ChatResponseReferencePart:On.ChatResponseReferencePart,ChatResponseReferencePart2:On.ChatResponseReferencePart2,ChatResponseCodeCitationPart:On.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:On.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:On.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:On.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:On.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:On.ChatResponseTextEditPart,ChatResponseNotebookEditPart:On.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:On.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:On.ChatResponseConfirmationPart,ChatQuestion:On.ChatQuestion,ChatQuestionType:On.ChatQuestionType,ChatResponseQuestionCarouselPart:On.ChatResponseQuestionCarouselPart,ChatRequestTurn:On.ChatRequestTurn,ChatResponseTurn:On.ChatResponseTurn,ChatRequestEditorData:On.ChatRequestEditorData,ChatRequestNotebookData:On.ChatRequestNotebookData,NewSymbolName:Bwr.NewSymbolName,NewSymbolNameTag:Bwr.NewSymbolNameTag,NewSymbolNameTriggerKind:Bwr.NewSymbolNameTriggerKind,ChatLocation:v$.ChatLocation,SymbolInformation:JNi.SymbolInformation,LanguageModelToolResult:On.LanguageModelToolResult,ExtendedLanguageModelToolResult:On.LanguageModelToolResult,LanguageModelToolResult2:On.LanguageModelToolResult2,LanguageModelPromptTsxPart:On.LanguageModelPromptTsxPart,LanguageModelTextPart:On.LanguageModelTextPart,LanguageModelDataPart:On.LanguageModelDataPart,LanguageModelToolExtensionSource:On.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:On.LanguageModelToolMCPSource,ChatReferenceBinaryData:On.ChatReferenceBinaryData,ChatReferenceDiagnostic:On.ChatReferenceDiagnostic,TextSearchMatch2:On.TextSearchMatch2,AISearchKeyword:On.AISearchKeyword,ExcludeSettingOptions:On.ExcludeSettingOptions,NotebookCellKind:q4e.NotebookCellKind,NotebookRange:q4e.NotebookRange,NotebookEdit:q4e.NotebookEdit,NotebookCellData:q4e.NotebookCellData,NotebookData:q4e.NotebookData,ChatErrorLevel:On.ChatErrorLevel,ChatInputNotificationSeverity:On.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:uJa.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:On.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:On.ChatResponsePullRequestPart,LanguageModelTextPart2:On.LanguageModelTextPart2,LanguageModelDataPart2:On.LanguageModelDataPart2,LanguageModelThinkingPart:On.LanguageModelThinkingPart,LanguageModelPartAudience:On.LanguageModelPartAudience,ChatResponseThinkingProgressPart:On.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:On.LanguageModelToolCallPart,LanguageModelToolResultPart:On.LanguageModelToolResultPart,LanguageModelToolResultPart2:On.LanguageModelToolResultPart2,LanguageModelChatMessageRole:On.LanguageModelChatMessageRole,LanguageModelChatMessage:On.LanguageModelChatMessage,LanguageModelChatToolMode:On.LanguageModelChatToolMode,TextEditorSelectionChangeKind:Lwr.TextEditorSelectionChangeKind,TextDocumentChangeReason:Lwr.TextDocumentChangeReason,ChatToolInvocationPart:On.ChatToolInvocationPart,ChatSubagentToolInvocationData:On.ChatSubagentToolInvocationData,McpToolInvocationContentData:On.McpToolInvocationContentData,ChatResponseTurn2:On.ChatResponseTurn2,ChatRequestTurn2:On.ChatRequestTurn2,LanguageModelError:On.LanguageModelError,SymbolKind:JNi.SymbolKind,SnippetString:aJa.SnippetString,SnippetTextEdit:cJa.SnippetTextEdit,FileType:v$.FileType,ChatSessionStatus:On.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:On.McpHttpServerDefinition,McpStdioServerDefinition:On.McpStdioServerDefinition,ThemeIcon:dJa.ThemeIcon};XNi.exports=fJa});var eMi=I(MAe=>{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.UseData=MAe.UseState=void 0;var Fwr=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}};MAe.UseState=Fwr;var Uwr=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)}}};MAe.UseData=Uwr});var rMi=I(Hyt=>{"use strict";p();Object.defineProperty(Hyt,"__esModule",{value:!0});Hyt.VirtualPromptReconciler=void 0;var tMi=eMi(),Qwr=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(pJa(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 jwr(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 qwr([])),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)}};Hyt.VirtualPromptReconciler=Qwr;var qwr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},jwr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new tMi.UseState(e.state),this.dataHook=new tMi.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 pJa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(pJa,"isFragmentFunction")});var nMi=I(Gyt=>{"use strict";p();Object.defineProperty(Gyt,"__esModule",{value:!0});Gyt.VirtualPrompt=void 0;var hJa=rMi(),Hwr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new hJa.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()}};Gyt.VirtualPrompt=Hwr});var R6=I($yt=>{"use strict";p();Object.defineProperty($yt,"__esModule",{value:!0});$yt.Text=mJa;$yt.Chunk=gJa;function mJa(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(mJa,"Text");function gJa(t){return t.children}a(gJa,"Chunk")});var C$=I(k6=>{"use strict";p();Object.defineProperty(k6,"__esModule",{value:!0});k6.PerCompletionContextProviderStatistics=k6.ContextProviderStatistics=k6.ICompletionsContextProviderService=void 0;k6.componentStatisticsToPromptMatcher=EJa;var AJa=nn(),yJa=b6();k6.ICompletionsContextProviderService=(0,AJa.createServiceIdentifier)("ICompletionsContextProviderService");var Gwr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new Vyt){this.createStatistics=e,this.statistics=new yJa.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)}}};k6.ContextProviderStatistics=Gwr;var Vyt=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()}}};k6.PerCompletionContextProviderStatistics=Vyt;function EJa(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(EJa,"componentStatisticsToPromptMatcher")});var G4e=I(H4e=>{"use strict";p();Object.defineProperty(H4e,"__esModule",{value:!0});H4e.filterContextItemsByType=bJa;H4e.filterSupportedContextItems=SJa;H4e.addOrValidateContextItemsIDs=IJa;var _Ja=P0(),vJa=nd(),$wr=T0(),CJa=a4e(),Vwr=Dl(),j4e;(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&&!CJa.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(j4e||(j4e={}));var Wwr;(function(t){function e(r){if(!j4e.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(Wwr||(Wwr={}));var zwr;(function(t){function e(r){if(!j4e.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})(zwr||(zwr={}));var Ywr;(function(t){function e(r){if(!j4e.is(r))return!1;let n=r;if(!vJa.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof _Ja.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(Ywr||(Ywr={}));var Kwr;(function(t){function e(r){if(Wwr.is(r))return"Trait";if(zwr.is(r))return"CodeSnippet";if(Ywr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(Kwr||(Kwr={}));function bJa(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(bJa,"filterContextItemsByType");function SJa(t){let e=[],r=0;return t.forEach(n=>{let o=Kwr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(SJa,"filterSupportedContextItems");function TJa(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(TJa,"validateContextItemId");function IJa(t,e){let r=new Set,n=t.get(Vwr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,$wr.generateUuid)();if(!TJa(c)){let l=(0,$wr.generateUuid)();Vwr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,$wr.generateUuid)();Vwr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(IJa,"addOrValidateContextItemsIDs")});var Jwr=I(Wyt=>{"use strict";p();Object.defineProperty(Wyt,"__esModule",{value:!0});Wyt.getCodeSnippetsFromContextItems=PJa;Wyt.addRelativePathToCodeSnippets=DJa;var xJa=s1(),wJa=C$(),RJa=G4e(),kJa="content_excluded";async function PJa(t,e,r,n){let o=(0,RJa.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(wJa.ICompletionsContextProviderService),u=t.get(xJa.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,kJa]]),g}).map(h=>h.data)}a(PJa,"getCodeSnippetsFromContextItems");function DJa(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(DJa,"addRelativePathToCodeSnippets")});var Zwr=I(Kyt=>{"use strict";p();Object.defineProperty(Kyt,"__esModule",{value:!0});Kyt.CodeSnippets=void 0;var zyt=rL(),Yyt=R6(),NJa=P6(),MJa=Jwr(),OJa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(NJa.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,MJa.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,zyt.jsx)(Yyt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,zyt.jsx)(Yyt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(OAe,"__esModule",{value:!0});OAe.CompletionsContext=iMi;OAe.StableCompletionsContext=oMi;OAe.AdditionalCompletionsContext=sMi;OAe.isContextNode=LJa;function iMi(t){return t.children}a(iMi,"CompletionsContext");function oMi(t){return t.children}a(oMi,"StableCompletionsContext");function sMi(t){return t.children}a(sMi,"AdditionalCompletionsContext");function LJa(t){return t.name===iMi.name||t.name===oMi.name||t.name===sMi.name}a(LJa,"isContextNode")});var eRr=I(V4e=>{"use strict";p();Object.defineProperty(V4e,"__esModule",{value:!0});V4e.SnapshotWalker=void 0;V4e.defaultTransformers=aMi;var BJa=R6(),Xwr=class{static{a(this,"SnapshotWalker")}constructor(e,r=aMi()){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)}};V4e.SnapshotWalker=Xwr;function aMi(){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===BJa.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(aMi,"defaultTransformers")});var cMi=I(tRr=>{"use strict";p();Object.defineProperty(tRr,"__esModule",{value:!0});tRr.findEditDistanceScore=FJa;function FJa(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(BD,"__esModule",{value:!0});BD.MAX_EDIT_DISTANCE_LENGTH=void 0;BD.CurrentFile=jJa;BD.BeforeCursor=iRr;BD.AfterCursor=oRr;BD.DocumentPrefix=HJa;BD.DocumentSuffix=GJa;var UR=rL(),LAe=R6(),UJa=ZG(),QJa=cMi(),qJa=Ore(),rRr=P6();BD.MAX_EDIT_DISTANCE_LENGTH=50;function nRr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(nRr,"approximateMaxCharacters");function jJa(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(rRr.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=nRr(c);return(0,UR.jsxs)(UR.Fragment,{children:[(0,UR.jsx)(iRr,{document:r,position:o,maxCharacters:m}),(0,UR.jsx)(oRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(jJa,"CurrentFile");function iRr(t){if(t.document===void 0||t.position===void 0)return(0,UR.jsx)(LAe.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,UR.jsx)(LAe.Text,{children:e})}a(iRr,"BeforeCursor");function oRr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,UR.jsx)(LAe.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,UR.jsx)(LAe.Text,{});if(r===s)return(0,UR.jsx)(LAe.Text,{children:r});let c=s;if(r!==""){let l=(0,qJa.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,BD.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,BD.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,QJa.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??UJa.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,UR.jsx)(LAe.Text,{children:c})}a(oRr,"AfterCursor");function HJa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(rRr.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=nRr(c);return(0,UR.jsx)(iRr,{document:r,position:o,maxCharacters:u})}a(HJa,"DocumentPrefix");function GJa(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(rRr.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=nRr(c);return(0,UR.jsx)(oRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(GJa,"DocumentSuffix")});var aRr=I(tne=>{"use strict";p();Object.defineProperty(tne,"__esModule",{value:!0});tne.WishlistElision=void 0;tne.makePrompt=$Ja;tne.makePrefixPrompt=VJa;tne.makeContextPrompt=WJa;var sRr=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]}};tne.WishlistElision=sRr;function $Ja(t){return t.map(e=>e.elidedValue).join("")}a($Ja,"makePrompt");function VJa(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(VJa,"makePrefixPrompt");function WJa(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(WJa,"makeContextPrompt")});var uRr=I(b$=>{"use strict";p();Object.defineProperty(b$,"__esModule",{value:!0});b$.transformers=b$.CompletionsPromptRenderer=void 0;b$.normalizeLineEndings=lRr;var fMi=eRr(),lMi=D4e(),uMi=Ore(),zJa=$4e(),Jyt=W4e(),dMi=aRr(),YJa=5,cRr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=dMi.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??uMi.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 dMi.WishlistElision,{blocks:[y,...E]}=A.elide(u,h,d,m,(0,uMi.getTokenizer)(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...KJa([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-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-YJa: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 fMi.SnapshotWalker(e,b$.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===Jyt.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:lRr(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,lMi.isShebangLine)(f.value)?y=A:y=(0,lMi.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:lRr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${Jyt.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}}};b$.CompletionsPromptRenderer=cRr;b$.transformers=[...(0,fMi.defaultTransformers)(),(t,e,r)=>(0,zJa.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===Jyt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===Jyt.AfterCursor.name?{...r,type:"suffix"}:r];function KJa(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(KJa,"computeComponentStatistics");function lRr(t){return t.replace(/\r\n?/g,` +`)}a(lRr,"normalizeLineEndings")});var Zyt=I(BAe=>{"use strict";p();Object.defineProperty(BAe,"__esModule",{value:!0});BAe.ILanguageContextProviderService=BAe.ProviderTarget=void 0;var JJa=nn(),pMi;(function(t){t.NES="nes",t.Completions="completions"})(pMi||(BAe.ProviderTarget=pMi={}));BAe.ILanguageContextProviderService=(0,JJa.createServiceIdentifier)("ILanguageContextProviderService")});var rne=I(FAe=>{"use strict";p();Object.defineProperty(FAe,"__esModule",{value:!0});FAe.RuntimeMode=FAe.ICompletionsRuntimeModeService=void 0;var ZJa=nn();FAe.ICompletionsRuntimeModeService=(0,ZJa.createServiceIdentifier)("completionsRuntimeModeService");var dRr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:hMi(r,n),verboseLogging:eZa(r,n),testMode:e,simulation:XJa(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}};FAe.RuntimeMode=dRr;function hMi(t,e){return t.includes("--debug")||fRr(e,"DEBUG")}a(hMi,"determineDebugFlag");function XJa(t){return fRr(t,"SIMULATION")}a(XJa,"determineSimulationFlag");function eZa(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||fRr(e,"VERBOSE")||hMi(t,e)}a(eZa,"determineVerboseLoggingEnabled");function fRr(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(fRr,"determineEnvFlagEnabled")});var yMi=I(z4e=>{"use strict";p();Object.defineProperty(z4e,"__esModule",{value:!0});z4e.eventToPromise=tZa;z4e.isArrayOfT=AMi;z4e.resolveAll=nZa;var mMi=_4e();async function tZa(t){let e=new mMi.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(tZa,"eventToPromise");async function rZa(t){if(t.isCancellationRequested)return;let e=new mMi.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(rZa,"cancellationTokenToPromise");async function gMi(t,e){if(e){let r=rZa(e);await Promise.race([t,r])}else await t}a(gMi,"raceCancellation");function AMi(t){return Array.isArray(t)}a(AMi,"isArrayOfT");async function nZa(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await iZa(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(nZa,"resolveAll");async function iZa(t,e){let r;return t instanceof Promise?r=await oZa(t,e):r=await sZa(t,e),r}a(iZa,"resolve");async function oZa(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:AMi(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await gMi(o,e),n.resolutionTime=performance.now()-r,n}a(oZa,"resolvePromise");async function sZa(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 gMi(o,e),n.resolutionTime=performance.now()-r,n}a(sZa,"resolveIterable")});var EMi=I(hRr=>{"use strict";p();Object.defineProperty(hRr,"__esModule",{value:!0});hRr.fillInCppVSCodeActiveExperiments=uZa;var aZa=fy(),pRr=Dl(),cZa={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},lZa="ms-vscode.cpptools";function uZa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(lZa))&&dZa(t,r,n)}a(uZa,"fillInCppVSCodeActiveExperiments");function dZa(t,e,r){try{let n=t.get(aZa.ICompletionsFeaturesService),o=t.get(pRr.ICompletionsLogTargetService),s=cZa,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){pRr.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){pRr.logger.exception(t,n,"fillInCppActiveExperiments")}}a(dZa,"addActiveExperiments")});var vMi=I(mRr=>{"use strict";p();Object.defineProperty(mRr,"__esModule",{value:!0});mRr.fillInCSharpActiveExperiments=pZa;var fZa=fy(),_Mi=Dl();function pZa(t,e,r){let n=t.get(fZa.ICompletionsFeaturesService),o=t.get(_Mi.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 _Mi.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(pZa,"fillInCSharpActiveExperiments")});var CMi=I(S$=>{"use strict";p();Object.defineProperty(S$,"__esModule",{value:!0});S$.multiLanguageContextProviderParamsDefault=void 0;S$.fillInMultiLanguageActiveExperiments=gZa;S$.getMultiLanguageContextProviderParamsFromActiveExperiments=EZa;var hZa=fy(),gRr=Dl(),mZa="fallbackContextProvider";S$.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function gZa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(mZa))&&AZa(t,r,n)}a(gZa,"fillInMultiLanguageActiveExperiments");function AZa(t,e,r){try{let n=yZa(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){gRr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(AZa,"addActiveExperiments");function yZa(t,e){let r=S$.multiLanguageContextProviderParamsDefault,n=t.get(gRr.ICompletionsLogTargetService),s=t.get(hZa.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){gRr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(yZa,"getMultiLanguageContextProviderParamsFromExp");function EZa(t){let e={...S$.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(EZa,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var SMi=I(UAe=>{"use strict";p();Object.defineProperty(UAe,"__esModule",{value:!0});UAe.TS_CONTEXT_PROVIDER_ID=void 0;UAe.fillInTsActiveExperiments=vZa;var _Za=fy(),bMi=Dl();UAe.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function vZa(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(UAe.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(bMi.ICompletionsLogTargetService),s=t.get(_Za.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 bMi.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(vZa,"fillInTsActiveExperiments")});var tEt=I(Nl=>{"use strict";p();var vRr=Nl&&Nl.__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},FD=Nl&&Nl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Nl,"__esModule",{value:!0});Nl.DefaultDiagnosticSettings=Nl.CachedContextProviderRegistry=Nl.MutableContextProviderRegistry=Nl.CoreContextProviderRegistry=Nl.DefaultContextProvidersContainer=Nl.ICompletionsDefaultContextProviders=Nl.ICompletionsContextProviderRegistryService=void 0;Nl.telemetrizeContextItems=kZa;Nl.matchContextItems=PZa;Nl.useContextProviderAPI=NZa;Nl.getDefaultDiagnosticSettings=OZa;var CZa=ti(),TMi=Pl(),CRr=Zyt(),bZa=mh(),wMi=nn(),SZa=Rs(),bRr=Gs(),Xyt=LE(),RMi=fy(),TZa=b6(),D6=Dl(),SRr=rne(),IMi=yMi(),IZa=EMi(),xZa=vMi(),wZa=CMi(),RZa=SMi(),xMi=G4e(),kMi=C$();Nl.ICompletionsContextProviderRegistryService=(0,wMi.createServiceIdentifier)("ICompletionsContextProviderRegistryService");Nl.ICompletionsDefaultContextProviders=(0,wMi.createServiceIdentifier)("ICompletionsDefaultContextProviders");var ARr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};Nl.DefaultContextProvidersContainer=ARr;var eEt=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([CRr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return D6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(xZa.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 D6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(IZa.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(wZa.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(RZa.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new CZa.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(MZa,n.languageId,o),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=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);_.set(w.id,x)}let b=this.contextProviderStatistics.getStatisticsForCompletion(e);b.setOpportunityId(r);let T=await(0,IMi.resolveAll)(_,g.token);E&&clearTimeout(E);for(let[w,R]of h){let x=T.get(w.id);if(x){if(x.status==="error")(0,SZa.isCancellationError)(x.reason)||D6.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 P=[...x.value??[]];if((x.status==="none"||x.status==="partial")&&(D6.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,IMi.isArrayOfT)(q)?P.push(...q):q&&P.push(q),P.length>0&&(x.status="partial")}catch(q){D6.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,q)}let[D,N]=(0,xMi.filterSupportedContextItems)(P);N&&D6.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let L=this.instantiationService.invokeFunction(xMi.addOrValidateContextItemsIDs,D),B={providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:L};u.push(B)}b.setLastResolution(w.id,x.status)}else D6.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(PMi,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]}))}};Nl.CoreContextProviderRegistry=eEt;Nl.CoreContextProviderRegistry=eEt=vRr([FD(1,CRr.ILanguageContextProviderService),FD(2,SRr.ICompletionsRuntimeModeService),FD(3,bRr.IInstantiationService),FD(4,D6.ICompletionsLogTargetService),FD(5,kMi.ICompletionsContextProviderService)],eEt);var yRr=class extends eEt{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)}};Nl.MutableContextProviderRegistry=yRr;Nl.MutableContextProviderRegistry=yRr=vRr([FD(1,CRr.ILanguageContextProviderService),FD(2,SRr.ICompletionsRuntimeModeService),FD(3,bRr.IInstantiationService),FD(4,D6.ICompletionsLogTargetService),FD(5,kMi.ICompletionsContextProviderService)],yRr);var ERr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new TZa.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}};Nl.CachedContextProviderRegistry=ERr;Nl.CachedContextProviderRegistry=ERr=vRr([FD(2,bRr.IInstantiationService)],ERr);function kZa(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(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(kZa,"telemetrizeContextItems");function PZa(t){return t.matchScore>0&&t.resolution!=="error"}a(PZa,"matchContextItems");function PMi(t,e,r){let n=DZa(t,e,r),o=(0,Xyt.getConfig)(t,Xyt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get(Nl.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(PMi,"getActiveContextProviders");function DZa(t,e,r){if(t.get(SRr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(RMi.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(DZa,"getExpContextProviders");function NZa(t,e,r){return PMi(t,e,r).length>0}a(NZa,"useContextProviderAPI");function MZa(t,e,r){let n=(0,Xyt.getConfig)(t,Xyt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(RMi.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(MZa,"getContextProviderTimeBudget");var _Rr;(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")})(_Rr||(Nl.DefaultDiagnosticSettings=_Rr={}));function OZa(t){let e=t.get(TMi.IConfigurationService),r=t.get(bZa.IExperimentationService),n=e.getExperimentBasedConfig(TMi.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return _Rr.from(n)}a(OZa,"getDefaultDiagnosticSettings")});var rEt=I(UD=>{"use strict";p();var LZa=UD&&UD.__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},BZa=UD&&UD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(UD,"__esModule",{value:!0});UD.ContextProviderBridge=UD.ICompletionsContextProviderBridgeService=void 0;var FZa=nn(),UZa=b6(),QZa=tEt();UD.ICompletionsContextProviderBridgeService=(0,FZa.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var TRr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new UZa.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:[]}};UD.ContextProviderBridge=TRr;UD.ContextProviderBridge=TRr=LZa([BZa(0,QZa.ICompletionsContextProviderRegistryService)],TRr)});var wRr=I(nEt=>{"use strict";p();Object.defineProperty(nEt,"__esModule",{value:!0});nEt.Diagnostics=void 0;var IRr=rL(),qZa=P0(),xRr=R6(),jZa=ZG(),HZa=P6();function GZa(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(GZa,"getCode");function $Za(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a($Za,"getRelativePath");var VZa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(HZa.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,jZa.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,IRr.jsx)(xRr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${$Za(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 E=Math.abs(A.range.start.line-c.line),_=Math.abs(y.range.start.line-c.line);return E-_})),g.forEach(A=>{let y="",E=GZa(A);E!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${E}`);let _=A.range.start;m.push((0,IRr.jsx)(xRr.Text,{children:`${_.line+1}:${_.character+1} - ${qZa.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,IRr.jsx)(xRr.Chunk,{children:m})})},"Diagnostics");nEt.Diagnostics=VZa});var RRr=I(oEt=>{"use strict";p();Object.defineProperty(oEt,"__esModule",{value:!0});oEt.DocumentMarker=void 0;var iEt=rL(),DMi=R6(),NMi=D4e(),WZa=P6(),zZa=a((t,e)=>{let[r,n]=e.useState();if(e.useData(WZa.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,iEt.jsx)(YZa,{docInfo:s}):(0,iEt.jsx)(KZa,{docInfo:s})}},"DocumentMarker");oEt.DocumentMarker=zZa;var YZa=a(t=>(0,iEt.jsx)(DMi.Text,{children:(0,NMi.getPathMarker)(t.docInfo)}),"PathMarker"),KZa=a(t=>(0,iEt.jsx)(DMi.Text,{children:(0,NMi.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var kRr=I(Y4e=>{"use strict";p();Object.defineProperty(Y4e,"__esModule",{value:!0});Y4e.RecentEdits=void 0;Y4e.editIsTooCloseToCursor=LMi;var MMi=rL(),OMi=R6(),sEt=D4e(),JZa=P6();function LMi(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(LMi,"editIsTooCloseToCursor");var ZZa=a((t,e)=>{let[r,n]=e.useState();return e.useData(JZa.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 E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(LMi(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift((0,sEt.newLineEnded)(`File: ${T}`)+(0,sEt.newLineEnded)(b))}}if(f.length===0){n(void 0);return}let h=(0,sEt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,sEt.newLineEnded)("End of recent edits");n(h)}),r?(0,MMi.jsx)(OMi.Chunk,{children:(0,MMi.jsx)(OMi.Text,{children:r})}):void 0},"RecentEdits");Y4e.RecentEdits=ZZa});var BMi=I(sL=>{"use strict";p();Object.defineProperty(sL,"__esModule",{value:!0});sL.registerDocumentTracker=sL.accessTimes=void 0;sL.sortByAccessTimes=tXa;var XZa=b6(),eXa=s1();sL.accessTimes=new XZa.LRUCacheMap;function tXa(t){return[...t].sort((e,r)=>{let n=sL.accessTimes.get(e.uri)??0;return(sL.accessTimes.get(r.uri)??0)-n})}a(tXa,"sortByAccessTimes");var rXa=a(t=>t.get(eXa.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&sL.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");sL.registerDocumentTracker=rXa});var FMi=I(N6=>{"use strict";p();var nXa=N6&&N6.__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},iXa=N6&&N6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(N6,"__esModule",{value:!0});N6.OpenTabFiles=void 0;var oXa=BMi(),sXa=s1(),PRr=QAe(),DRr=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>PRr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,PRr.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,oXa.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(PRr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};N6.OpenTabFiles=DRr;N6.OpenTabFiles=DRr=nXa([iXa(0,sXa.ICompletionsTextDocumentManagerService)],DRr)});var UMi=I(NRr=>{"use strict";p();Object.defineProperty(NRr,"__esModule",{value:!0});NRr.shortCircuit=aXa;function aXa(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(aXa,"shortCircuit")});var fEt=I(Ml=>{"use strict";p();var cXa=Ml&&Ml.__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},aEt=Ml&&Ml.__param||function(t,e){return function(r,n){e(r,n,t)}},MRr;Object.defineProperty(Ml,"__esModule",{value:!0});Ml.RelatedFilesProvider=Ml.ICompletionsRelatedFilesProviderService=Ml.relatedFilesLogger=Ml.PromiseExpirationCacheMap=Ml.EmptyRelatedFilesResponse=void 0;Ml.getRelatedFilesAndTraits=yXa;var lXa=Bre(),uXa=nn(),dXa=nd(),BRr=Gs(),fXa=i$(),pXa=b6(),dEt=Dl(),hXa=$g(),mXa=UMi();Ml.EmptyRelatedFilesResponse={entries:[],traits:[]};var cEt={entries:new Map,traits:[]},lEt=class extends pXa.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.timestampMl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};Ml.RelatedFilesProvider=ORr;Ml.RelatedFilesProvider=ORr=MRr=cXa([aEt(0,BRr.IInstantiationService),aEt(1,lXa.IIgnoreService),aEt(2,dEt.ICompletionsLogTargetService),aEt(3,fXa.ICompletionsFileSystemService)],ORr);var AXa=3,K4e=new lEt(gXa);async function QMi(t,e,r,n,o){let s=t.get(BRr.IInstantiationService),c=t.get(dEt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>Ml.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(K4e.bumpRetryCount(e.uri)>=AXa?u=cEt:u=void 0);let d=performance.now()-l;if(Ml.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 uEt;return u}a(QMi,"getRelatedFiles");var LRr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(K4e.has(s))return K4e.get(s);let c=QMi(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw K4e.delete(s),l})),K4e.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");LRr=(0,mXa.shortCircuit)(LRr,200,cEt);async function yXa(t,e,r,n,o,s=!1){let c=t.get(BRr.IInstantiationService),l=t.get(dEt.ICompletionsLogTargetService),u=t.get(Ml.ICompletionsRelatedFilesProviderService),d=cEt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(QMi,f,r,n,u):await c.invokeFunction(LRr,f,r,n,u)}catch(f){d=cEt,f instanceof uEt&&c.invokeFunction(hXa.telemetry,"getRelatedFilesList",r)}return Ml.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(yXa,"getRelatedFilesAndTraits")});var QAe=I(T$=>{"use strict";p();Object.defineProperty(T$,"__esModule",{value:!0});T$.NeighborSource=T$.NeighboringFileType=void 0;T$.considerNeighborFile=bXa;T$.isIncludeNeighborFilesActive=SXa;var EXa=Gs(),qMi=ZG(),HMi=fy(),_Xa=Dl(),vXa=s1(),CXa=FMi(),pEt=fEt(),jMi;(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"})(jMi||(T$.NeighboringFileType=jMi={}));function bXa(t,e){return(0,qMi.normalizeLanguageId)(t)===(0,qMi.normalizeLanguageId)(e)}a(bXa,"considerNeighborFile");var FRr=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(HMi.ICompletionsFeaturesService),d=e.get(_Xa.ICompletionsLogTargetService),f=e.get(EXa.IInstantiationService),h=e.get(vXa.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(CXa.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 pEt.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 pEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(pEt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(pEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),m.traits.push(...y.traits),m):(y.entries.forEach((E,_)=>{let v=[];E.forEach((b,T)=>{let w=t.getRelativePath(T,A.uri);if(!w||m.docs.has(T))return;let R={relativePath:w,uri:T,source:b};v.unshift(R),m.docs.set(T,R)}),v.length>0&&m.neighborSource.set(_,v.map(b=>b.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)}};T$.NeighborSource=FRr;function SXa(t,e,r){return t.get(HMi.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(SXa,"isIncludeNeighborFilesActive")});var QRr=I(hEt=>{"use strict";p();Object.defineProperty(hEt,"__esModule",{value:!0});hEt.SimilarFiles=void 0;var qAe=rL(),URr=R6(),TXa=_yt(),IXa=CIr(),xXa=Cyt(),wXa=P6(),RXa=jAe(),GMi=QAe(),kXa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(wXa.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=GMi.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await GMi.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(RXa.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,IXa.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(xXa.getSimilarFilesOptions,d,f.detectedLanguageId),y=t.tdms.getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await(0,TXa.getSimilarSnippets)(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,qAe.jsxs)(qAe.Fragment,{children:[...o.map((u,d)=>(0,qAe.jsx)(PXa,{snippet:u}))]})},"SimilarFiles");hEt.SimilarFiles=kXa;var PXa=a((t,e)=>(0,qAe.jsxs)(URr.Chunk,{children:[(0,qAe.jsx)(URr.Text,{children:t.snippet.headline}),(0,qAe.jsx)(URr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var ZMi=I(iI=>{"use strict";p();Object.defineProperty(iI,"__esModule",{value:!0});iI.getAllRecentEditsByTimestamp=DXa;iI.findChangeSpan=qRr;iI.getDiff=VMi;iI.unifiedDiff=WMi;iI.findReplaceDiff=zMi;iI.editsOverlap=YMi;iI.updateEdits=KMi;iI.buildIncomingEdit=jRr;iI.trimOldFilesFromState=JMi;iI.recentEditsReducer=OXa;iI.summarizeEdit=LXa;function DXa(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(DXa,"getAllRecentEditsByTimestamp");function qRr(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(qRr,"findChangeSpan");function VMi(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(VMi,"getDiff");function NXa(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(NXa,"measureDiffSize");function WMi(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(HMi,"unifiedDiff");function wXa(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(wXa,"aidersDiff");function GMi(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(GMi,"findReplaceDiff");function qMi(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(qMi,"applyEditsToLines");function $Mi(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($Mi,"editsOverlap");function VMi(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if($Mi(r,c,o.editMergeLineDistance)){let u=qMi(t.split(` -`),s.slice(0,-1)),d=QRr(u,n);d&&(r=qRr(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=qMi(t.split(` +`}a(WMi,"unifiedDiff");function MXa(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(MXa,"aidersDiff");function zMi(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(zMi,"findReplaceDiff");function $Mi(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($Mi,"applyEditsToLines");function YMi(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(YMi,"editsOverlap");function KMi(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if(YMi(r,c,o.editMergeLineDistance)){let u=$Mi(t.split(` +`),s.slice(0,-1)),d=qRr(u,n);d&&(r=jRr(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=$Mi(t.split(` `),c).join(` -`)}return{originalContent:t,edits:s}}a(VMi,"updateEdits");function qRr(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=jMi(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(qRr,"buildIncomingEdit");function WMi(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(KMi,"updateEdits");function jRr(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=VMi(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(jRr,"buildIncomingEdit");function JMi(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=QRr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=qRr(e,s,c,l,n);if(xXa(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=VMi(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return WMi(h,n.maxFiles)}a(RXa,"recentEditsReducer");function kXa(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=wXa(t.diff);else if(e.summarizationFormat==="diff")o=HMi(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=GMi(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(kXa,"summarizeEdit")});var hEt=I(UD=>{"use strict";p();var PXa=UD&&UD.__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},DXa=UD&&UD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(UD,"__esModule",{value:!0});UD.FullRecentEditsProvider=UD.ICompletionsRecentEditsProviderService=void 0;var NXa=h4(),MXa=nn(),OXa=Ro(),LXa=C8(),BXa=USr(),jRr=zMi();UD.ICompletionsRecentEditsProviderService=(0,MXa.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var FXa=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}),HRr=class extends OXa.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({},FXa)}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,jRr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,jRr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,jRr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,LXa.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,NXa.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))}};UD.FullRecentEditsProvider=HRr;UD.FullRecentEditsProvider=HRr=PXa([DXa(1,BXa.ICompletionsObservableWorkspace)],HRr)});var GRr=I(gEt=>{"use strict";p();Object.defineProperty(gEt,"__esModule",{value:!0});gEt.Traits=void 0;var mEt=rL(),YMi=w6(),UXa=JG(),QXa=k6(),qXa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(QXa.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,UXa.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,mEt.jsxs)(mEt.Fragment,{children:[(0,mEt.jsx)(YMi.Text,{children:`Consider this related information: -`}),...r.map(c=>(0,mEt.jsx)(YMi.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");gEt.Traits=qXa});var ZMi=I($Rr=>{"use strict";p();Object.defineProperty($Rr,"__esModule",{value:!0});$Rr.splitContextCompletionsPrompt=JXa;var UR=rL(),jXa=Gs(),HXa=s1(),GXa=hEt(),$Xa=Jwr(),KMi=H4e(),JMi=$4e(),VXa=xRr(),WXa=wRr(),zXa=RRr(),YXa=URr(),KXa=GRr();function JXa(t){let e=t.get(jXa.IInstantiationService),r=t.get(HXa.ICompletionsTextDocumentManagerService),n=t.get(GXa.ICompletionsRecentEditsProviderService);return(0,UR.jsxs)(UR.Fragment,{children:[(0,UR.jsxs)(KMi.StableCompletionsContext,{children:[(0,UR.jsx)(WXa.DocumentMarker,{tdms:r,weight:.7}),(0,UR.jsx)(KXa.Traits,{weight:.6}),(0,UR.jsx)(VXa.Diagnostics,{tdms:r,weight:.65}),(0,UR.jsx)($Xa.CodeSnippets,{tdms:r,weight:.9}),(0,UR.jsx)(YXa.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,UR.jsx)(JMi.DocumentSuffix,{weight:1}),(0,UR.jsx)(KMi.AdditionalCompletionsContext,{children:(0,UR.jsx)(zXa.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,UR.jsx)(JMi.DocumentPrefix,{weight:1})]})}a(JXa,"splitContextCompletionsPrompt")});var rOi=I(yEt=>{"use strict";p();Object.defineProperty(yEt,"__esModule",{value:!0});yEt.SplitContextPromptRenderer=void 0;var ZXa=Xwr(),XXa=H4e(),AEt=lRr(),XMi=$4e(),eOi=sRr(),tOi=0;function eec(){tOi=0}a(eec,"resetContextIndex");function tec(){return tOi++}a(tec,"getNextContextIndex");var VRr=class extends AEt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=eOi.makePrefixPrompt,this.formatContext=eOi.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(eec(),new ZXa.SnapshotWalker(e,rec).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===XMi.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,AEt.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,AEt.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 ${XMi.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}}};yEt.SplitContextPromptRenderer=VRr;var rec=[...AEt.transformers,(t,e,r)=>(0,XXa.isContextNode)(t)?{...r,index:tec()}:r]});var T$=I(N6=>{"use strict";p();Object.defineProperty(N6,"__esModule",{value:!0});N6.AbstractLanguageDiagnosticsService=N6.ILanguageDiagnosticsService=void 0;N6.rangeSpanningDiagnostics=oec;N6.isError=sec;N6.getDiagnosticsAtSelection=aec;var nec=nn(),iec=ZP(),WRr=P0();N6.ILanguageDiagnosticsService=(0,nec.createServiceIdentifier)("ILanguageDiagnosticService");var zRr=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,iec.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};N6.AbstractLanguageDiagnosticsService=zRr;function oec(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a(oec,"rangeSpanningDiagnostics");function sec(t){return t.severity===WRr.DiagnosticSeverity.Error}a(sec,"isError");function aec(t,e,r=[WRr.DiagnosticSeverity.Error,WRr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(aec,"getDiagnosticsAtSelection")});var iOi=I(YRr=>{"use strict";p();Object.defineProperty(YRr,"__esModule",{value:!0});YRr.getDiagnosticsFromContextItems=dec;var cec=s1(),nOi=v$(),lec=j4e(),uec="content_excluded";async function dec(t,e,r){let n=(0,lec.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)fec(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(nOi.ICompletionsContextProviderService),l=t.get(cec.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,uec]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(dec,"getDiagnosticsFromContextItems");function fec(t,e,r,n){let o=t.get(nOi.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(fec,"setupExpectationsForDiagnosticBags")});var oOi=I(EEt=>{"use strict";p();Object.defineProperty(EEt,"__esModule",{value:!0});EEt.getTraitsFromContextItems=gec;EEt.ReportTraitsTelemetry=Eec;var pec=$g(),hec=v$(),mec=j4e();function gec(t,e,r){let n=(0,mec.filterContextItemsByType)(r,"Trait");for(let s of n)Aec(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(gec,"getTraitsFromContextItems");function Aec(t,e,r,n){let o=t.get(hec.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(Aec,"setupExpectationsForTraits");var yec=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Eec(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=yec.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,pec.telemetry)(t,e,l)}}a(Eec,"ReportTraitsTelemetry")});var k6=I(d1=>{"use strict";p();var lOi=d1&&d1.__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},u1=d1&&d1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(d1,"__esModule",{value:!0});d1.TestComponentsCompletionsPromptFactory=d1.ComponentsCompletionsPromptFactory=d1.PromptOrdering=void 0;d1.isCompletionRequestData=Fec;var aL=rL(),sOi=P0(),ekr=Dl(),uOi=Bre(),KRr=nd(),tkr=Gs(),dOi=bte(),aOi=XNi(),_ec=$g(),vec=s1(),Cec=Jwr(),bec=H4e(),Sec=lRr(),fOi=tEt(),Tec=$4e(),Iec=xRr(),xec=wRr(),wec=RRr(),Rec=URr(),kec=ZMi(),Pec=rOi(),Dec=GRr(),pOi=T$(),Nec=T0(),Y4e=eEt(),Mec=Kwr(),Oec=iOi(),cOi=oOi(),rkr=v$(),QD=qAe(),Lec=hEt(),Bec=UAe();function Fec(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(Fec,"isCompletionRequestData");var I$;(function(t){t.Default="default",t.SplitContext="splitContext"})(I$||(d1.PromptOrdering=I$={}));var JRr={[I$.Default]:{promptFunction:hOi,renderer:Sec.CompletionsPromptRenderer},[I$.SplitContext]:{promptFunction:kec.splitContextCompletionsPrompt,renderer:Pec.SplitContextPromptRenderer}};function hOi(t){let e=t.get(vec.ICompletionsTextDocumentManagerService),r=t.get(tkr.IInstantiationService),n=t.get(Lec.ICompletionsRecentEditsProviderService);return(0,aL.jsxs)(aL.Fragment,{children:[(0,aL.jsxs)(bec.CompletionsContext,{children:[(0,aL.jsx)(xec.DocumentMarker,{tdms:e,weight:.7}),(0,aL.jsx)(Dec.Traits,{weight:.6}),(0,aL.jsx)(Iec.Diagnostics,{tdms:e,weight:.65}),(0,aL.jsx)(Cec.CodeSnippets,{tdms:e,weight:.9}),(0,aL.jsx)(Rec.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,aL.jsx)(wec.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,aL.jsx)(Tec.CurrentFile,{weight:1})]})}a(hOi,"defaultCompletionsPrompt");var _Et=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??I$.Default,this.virtualPrompt=e??new aOi.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(QD.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?I$.SplitContext:I$.Default;this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,diagnostics:A,turnOffSimilarFiles:y,resolvedContextItems:E}=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 QD._promptCancelled;let _=this.virtualPrompt.snapshot(s),v=_.status;if(v==="cancelled")return QD._promptCancelled;if(v==="error")return this.errorPrompt(_.error);let b=this.renderer.render(_.snapshot,{delimiter:` -`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(b.status==="cancelled")return QD._promptCancelled;if(b.status==="error")return this.errorPrompt(b.error);let[T,w]=(0,QD.trimLastLine)(b.prefix),R={...b,prefix:T},x,P=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(Y4e.useContextProviderAPI,P,n)){let N=(0,rkr.componentStatisticsToPromptMatcher)(b.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,Y4e.telemetrizeContextItems)(this.contextProviderStatistics,e,E),ekr.logger.debug(this.logTarget,`Context providers telemetry: '${JSON.stringify(x)}'`)}let D=performance.now();return this.resetIfEmpty(b),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(Y4e.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(Y4e.matchContextItems);this.instantiationService.invokeFunction(Uec,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(cOi.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(cOi.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(Mec.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(Oec.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(Y4e.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 QD._promptCancelled;if(await this.ignoreService.isCopilotIgnored(KRr.URI.parse(e.uri)))return QD._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,_ec.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),QD._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new aOi.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=JRr[this.promptOrdering]?.promptFunction??hOi;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=JRr[this.promptOrdering]??JRr[I$.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(_=>_.uri.toString()===c.uri))return r;let l=performance.now(),u=this.languageDiagnosticsService.getDiagnostics(KRr.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 _ of u)Math.abs(_.range.start.line-m.line)<=s.maxLineDistance&&(_.severity===sOi.DiagnosticSeverity.Error?d.push(_):_.severity===sOi.DiagnosticSeverity.Warning&&h&&f.push(_));let g=[...d,...s.warnings==="yes"||s.warnings==="yesIfNoErrors"&&d.length===0?f:[]];if(g.length===0)return r;g.sort((_,v)=>{let b=Math.abs(_.range.start.line-m.line),T=Math.abs(v.range.start.line-m.line);return b-T});let A={type:"DiagnosticBag",uri:KRr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,Nec.generateUuid)()},y="copilot.chat.defaultDiagnostics",E=this.contextProviderStatistics.getStatisticsForCompletion(n);return E.addExpectations(y,[[A,"included"]]),e.push({providerId:y,matchScore:10,resolution:"full",resolutionTimeMs:performance.now()-l,data:[A]}),E.setLastResolution(y,"full"),r===void 0?[A]:(r.push(A),r)}};_Et=lOi([u1(2,tkr.IInstantiationService),u1(3,dOi.ICompletionsTelemetryService),u1(4,uOi.IIgnoreService),u1(5,fOi.ICompletionsContextProviderBridgeService),u1(6,ekr.ICompletionsLogTargetService),u1(7,rkr.ICompletionsContextProviderService),u1(8,pOi.ILanguageDiagnosticsService)],_Et);var ZRr=class extends _Et{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};d1.ComponentsCompletionsPromptFactory=ZRr;d1.ComponentsCompletionsPromptFactory=ZRr=lOi([u1(0,tkr.IInstantiationService),u1(1,dOi.ICompletionsTelemetryService),u1(2,uOi.IIgnoreService),u1(3,fOi.ICompletionsContextProviderBridgeService),u1(4,ekr.ICompletionsLogTargetService),u1(5,rkr.ICompletionsContextProviderService),u1(6,pOi.ILanguageDiagnosticsService)],ZRr);var XRr=class extends _Et{static{a(this,"TestComponentsCompletionsPromptFactory")}};d1.TestComponentsCompletionsPromptFactory=XRr;function Uec(t,e,r,n){let o=["cpp","c"];return(0,Bec.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(Uec,"similarFilesEnabled")});var ckr=I(HE=>{"use strict";p();var mOi=HE&&HE.__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},gOi=HE&&HE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(HE,"__esModule",{value:!0});HE.TestCompletionsPromptFactory=HE.CompletionsPromptFactory=HE.DEFAULT_PROMPT_TIMEOUT=HE.ICompletionsPromptFactoryService=void 0;var Qec=ri(),AOi=Gs(),nkr=qAe(),qec=k6(),jec=nn();HE.ICompletionsPromptFactoryService=(0,jec.createServiceIdentifier)("ICompletionsPromptFactoryService");var ikr=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 nkr._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return nkr._promptError}}};HE.DEFAULT_PROMPT_TIMEOUT=1200;var okr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new Qec.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(nkr._promptTimeout)},HE.DEFAULT_PROMPT_TIMEOUT)})])}},vEt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new ikr(new okr(n.createInstance(qec.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};vEt=mOi([gOi(2,AOi.IInstantiationService)],vEt);var skr=class extends vEt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};HE.CompletionsPromptFactory=skr;HE.CompletionsPromptFactory=skr=mOi([gOi(0,AOi.IInstantiationService)],skr);var akr=class extends vEt{static{a(this,"TestCompletionsPromptFactory")}};HE.TestCompletionsPromptFactory=akr});var qAe=I(gh=>{"use strict";p();Object.defineProperty(gh,"__esModule",{value:!0});gh.PromptResponse=gh._promptTimeout=gh._promptCancelled=gh._promptError=gh._copilotContentExclusion=gh._contextTooShort=gh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=gh.MIN_PROMPT_CHARS=void 0;gh.trimLastLine=Yec;gh.extractPrompt=Kec;gh.getPromptOptions=Xec;var Hec=k4e(),Gec=fy(),yOi=vyt(),$ec=M4e(),Vec=s1(),Wec=ckr(),zec=UAe();gh.MIN_PROMPT_CHARS=10;gh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];gh._contextTooShort={type:"contextTooShort"};gh._copilotContentExclusion={type:"copilotContentExclusion"};gh._promptError={type:"promptError"};gh._promptCancelled={type:"promptCancelled"};gh._promptTimeout={type:"promptTimeout"};var EOi;(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=qRr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=jRr(e,s,c,l,n);if(NXa(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=KMi(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return JMi(h,n.maxFiles)}a(OXa,"recentEditsReducer");function LXa(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=MXa(t.diff);else if(e.summarizationFormat==="diff")o=WMi(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=zMi(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(LXa,"summarizeEdit")});var mEt=I(QD=>{"use strict";p();var BXa=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},FXa=QD&&QD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(QD,"__esModule",{value:!0});QD.FullRecentEditsProvider=QD.ICompletionsRecentEditsProviderService=void 0;var UXa=h4(),QXa=nn(),qXa=ko(),jXa=b8(),HXa=QSr(),HRr=ZMi();QD.ICompletionsRecentEditsProviderService=(0,QXa.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var GXa=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}),GRr=class extends qXa.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({},GXa)}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,HRr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,HRr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,HRr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,jXa.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,UXa.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))}};QD.FullRecentEditsProvider=GRr;QD.FullRecentEditsProvider=GRr=BXa([FXa(1,HXa.ICompletionsObservableWorkspace)],GRr)});var $Rr=I(AEt=>{"use strict";p();Object.defineProperty(AEt,"__esModule",{value:!0});AEt.Traits=void 0;var gEt=rL(),XMi=R6(),$Xa=ZG(),VXa=P6(),WXa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(VXa.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,$Xa.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,gEt.jsxs)(gEt.Fragment,{children:[(0,gEt.jsx)(XMi.Text,{children:`Consider this related information: +`}),...r.map(c=>(0,gEt.jsx)(XMi.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");AEt.Traits=WXa});var rOi=I(VRr=>{"use strict";p();Object.defineProperty(VRr,"__esModule",{value:!0});VRr.splitContextCompletionsPrompt=nec;var QR=rL(),zXa=Gs(),YXa=s1(),KXa=mEt(),JXa=Zwr(),eOi=$4e(),tOi=W4e(),ZXa=wRr(),XXa=RRr(),eec=kRr(),tec=QRr(),rec=$Rr();function nec(t){let e=t.get(zXa.IInstantiationService),r=t.get(YXa.ICompletionsTextDocumentManagerService),n=t.get(KXa.ICompletionsRecentEditsProviderService);return(0,QR.jsxs)(QR.Fragment,{children:[(0,QR.jsxs)(eOi.StableCompletionsContext,{children:[(0,QR.jsx)(XXa.DocumentMarker,{tdms:r,weight:.7}),(0,QR.jsx)(rec.Traits,{weight:.6}),(0,QR.jsx)(ZXa.Diagnostics,{tdms:r,weight:.65}),(0,QR.jsx)(JXa.CodeSnippets,{tdms:r,weight:.9}),(0,QR.jsx)(tec.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,QR.jsx)(tOi.DocumentSuffix,{weight:1}),(0,QR.jsx)(eOi.AdditionalCompletionsContext,{children:(0,QR.jsx)(eec.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,QR.jsx)(tOi.DocumentPrefix,{weight:1})]})}a(nec,"splitContextCompletionsPrompt")});var sOi=I(EEt=>{"use strict";p();Object.defineProperty(EEt,"__esModule",{value:!0});EEt.SplitContextPromptRenderer=void 0;var iec=eRr(),oec=$4e(),yEt=uRr(),nOi=W4e(),iOi=aRr(),oOi=0;function sec(){oOi=0}a(sec,"resetContextIndex");function aec(){return oOi++}a(aec,"getNextContextIndex");var WRr=class extends yEt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=iOi.makePrefixPrompt,this.formatContext=iOi.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(sec(),new iec.SnapshotWalker(e,cec).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===nOi.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,yEt.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,yEt.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 ${nOi.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}}};EEt.SplitContextPromptRenderer=WRr;var cec=[...yEt.transformers,(t,e,r)=>(0,oec.isContextNode)(t)?{...r,index:aec()}:r]});var I$=I(M6=>{"use strict";p();Object.defineProperty(M6,"__esModule",{value:!0});M6.AbstractLanguageDiagnosticsService=M6.ILanguageDiagnosticsService=void 0;M6.rangeSpanningDiagnostics=dec;M6.isError=fec;M6.getDiagnosticsAtSelection=pec;var lec=nn(),uec=XP(),zRr=P0();M6.ILanguageDiagnosticsService=(0,lec.createServiceIdentifier)("ILanguageDiagnosticService");var YRr=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,uec.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};M6.AbstractLanguageDiagnosticsService=YRr;function dec(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a(dec,"rangeSpanningDiagnostics");function fec(t){return t.severity===zRr.DiagnosticSeverity.Error}a(fec,"isError");function pec(t,e,r=[zRr.DiagnosticSeverity.Error,zRr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(pec,"getDiagnosticsAtSelection")});var cOi=I(KRr=>{"use strict";p();Object.defineProperty(KRr,"__esModule",{value:!0});KRr.getDiagnosticsFromContextItems=Aec;var hec=s1(),aOi=C$(),mec=G4e(),gec="content_excluded";async function Aec(t,e,r){let n=(0,mec.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)yec(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(aOi.ICompletionsContextProviderService),l=t.get(hec.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,gec]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(Aec,"getDiagnosticsFromContextItems");function yec(t,e,r,n){let o=t.get(aOi.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(yec,"setupExpectationsForDiagnosticBags")});var lOi=I(_Et=>{"use strict";p();Object.defineProperty(_Et,"__esModule",{value:!0});_Et.getTraitsFromContextItems=Cec;_Et.ReportTraitsTelemetry=Tec;var Eec=$g(),_ec=C$(),vec=G4e();function Cec(t,e,r){let n=(0,vec.filterContextItemsByType)(r,"Trait");for(let s of n)bec(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(Cec,"getTraitsFromContextItems");function bec(t,e,r,n){let o=t.get(_ec.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(bec,"setupExpectationsForTraits");var Sec=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Tec(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=Sec.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,Eec.telemetry)(t,e,l)}}a(Tec,"ReportTraitsTelemetry")});var P6=I(d1=>{"use strict";p();var pOi=d1&&d1.__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},u1=d1&&d1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(d1,"__esModule",{value:!0});d1.TestComponentsCompletionsPromptFactory=d1.ComponentsCompletionsPromptFactory=d1.PromptOrdering=void 0;d1.isCompletionRequestData=Gec;var aL=rL(),uOi=P0(),tkr=Dl(),hOi=Bre(),JRr=nd(),rkr=Gs(),mOi=bte(),dOi=nMi(),Iec=$g(),xec=s1(),wec=Zwr(),Rec=$4e(),kec=uRr(),gOi=rEt(),Pec=W4e(),Dec=wRr(),Nec=RRr(),Mec=kRr(),Oec=QRr(),Lec=rOi(),Bec=sOi(),Fec=$Rr(),AOi=I$(),Uec=T0(),J4e=tEt(),Qec=Jwr(),qec=cOi(),fOi=lOi(),nkr=C$(),qD=jAe(),jec=mEt(),Hec=QAe();function Gec(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(Gec,"isCompletionRequestData");var x$;(function(t){t.Default="default",t.SplitContext="splitContext"})(x$||(d1.PromptOrdering=x$={}));var ZRr={[x$.Default]:{promptFunction:yOi,renderer:kec.CompletionsPromptRenderer},[x$.SplitContext]:{promptFunction:Lec.splitContextCompletionsPrompt,renderer:Bec.SplitContextPromptRenderer}};function yOi(t){let e=t.get(xec.ICompletionsTextDocumentManagerService),r=t.get(rkr.IInstantiationService),n=t.get(jec.ICompletionsRecentEditsProviderService);return(0,aL.jsxs)(aL.Fragment,{children:[(0,aL.jsxs)(Rec.CompletionsContext,{children:[(0,aL.jsx)(Nec.DocumentMarker,{tdms:e,weight:.7}),(0,aL.jsx)(Fec.Traits,{weight:.6}),(0,aL.jsx)(Dec.Diagnostics,{tdms:e,weight:.65}),(0,aL.jsx)(wec.CodeSnippets,{tdms:e,weight:.9}),(0,aL.jsx)(Oec.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,aL.jsx)(Mec.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,aL.jsx)(Pec.CurrentFile,{weight:1})]})}a(yOi,"defaultCompletionsPrompt");var vEt=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??x$.Default,this.virtualPrompt=e??new dOi.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(qD.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?x$.SplitContext:x$.Default;this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,diagnostics:A,turnOffSimilarFiles:y,resolvedContextItems:E}=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 qD._promptCancelled;let _=this.virtualPrompt.snapshot(s),v=_.status;if(v==="cancelled")return qD._promptCancelled;if(v==="error")return this.errorPrompt(_.error);let b=this.renderer.render(_.snapshot,{delimiter:` +`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(b.status==="cancelled")return qD._promptCancelled;if(b.status==="error")return this.errorPrompt(b.error);let[T,w]=(0,qD.trimLastLine)(b.prefix),R={...b,prefix:T},x,P=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(J4e.useContextProviderAPI,P,n)){let N=(0,nkr.componentStatisticsToPromptMatcher)(b.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,J4e.telemetrizeContextItems)(this.contextProviderStatistics,e,E),tkr.logger.debug(this.logTarget,`Context providers telemetry: '${JSON.stringify(x)}'`)}let D=performance.now();return this.resetIfEmpty(b),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(J4e.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(J4e.matchContextItems);this.instantiationService.invokeFunction($ec,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(fOi.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(fOi.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(Qec.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(qec.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(J4e.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 qD._promptCancelled;if(await this.ignoreService.isCopilotIgnored(JRr.URI.parse(e.uri)))return qD._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,Iec.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),qD._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new dOi.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=ZRr[this.promptOrdering]?.promptFunction??yOi;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=ZRr[this.promptOrdering]??ZRr[x$.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(_=>_.uri.toString()===c.uri))return r;let l=performance.now(),u=this.languageDiagnosticsService.getDiagnostics(JRr.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 _ of u)Math.abs(_.range.start.line-m.line)<=s.maxLineDistance&&(_.severity===uOi.DiagnosticSeverity.Error?d.push(_):_.severity===uOi.DiagnosticSeverity.Warning&&h&&f.push(_));let g=[...d,...s.warnings==="yes"||s.warnings==="yesIfNoErrors"&&d.length===0?f:[]];if(g.length===0)return r;g.sort((_,v)=>{let b=Math.abs(_.range.start.line-m.line),T=Math.abs(v.range.start.line-m.line);return b-T});let A={type:"DiagnosticBag",uri:JRr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,Uec.generateUuid)()},y="copilot.chat.defaultDiagnostics",E=this.contextProviderStatistics.getStatisticsForCompletion(n);return E.addExpectations(y,[[A,"included"]]),e.push({providerId:y,matchScore:10,resolution:"full",resolutionTimeMs:performance.now()-l,data:[A]}),E.setLastResolution(y,"full"),r===void 0?[A]:(r.push(A),r)}};vEt=pOi([u1(2,rkr.IInstantiationService),u1(3,mOi.ICompletionsTelemetryService),u1(4,hOi.IIgnoreService),u1(5,gOi.ICompletionsContextProviderBridgeService),u1(6,tkr.ICompletionsLogTargetService),u1(7,nkr.ICompletionsContextProviderService),u1(8,AOi.ILanguageDiagnosticsService)],vEt);var XRr=class extends vEt{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};d1.ComponentsCompletionsPromptFactory=XRr;d1.ComponentsCompletionsPromptFactory=XRr=pOi([u1(0,rkr.IInstantiationService),u1(1,mOi.ICompletionsTelemetryService),u1(2,hOi.IIgnoreService),u1(3,gOi.ICompletionsContextProviderBridgeService),u1(4,tkr.ICompletionsLogTargetService),u1(5,nkr.ICompletionsContextProviderService),u1(6,AOi.ILanguageDiagnosticsService)],XRr);var ekr=class extends vEt{static{a(this,"TestComponentsCompletionsPromptFactory")}};d1.TestComponentsCompletionsPromptFactory=ekr;function $ec(t,e,r,n){let o=["cpp","c"];return(0,Hec.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a($ec,"similarFilesEnabled")});var lkr=I(HE=>{"use strict";p();var EOi=HE&&HE.__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=HE&&HE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(HE,"__esModule",{value:!0});HE.TestCompletionsPromptFactory=HE.CompletionsPromptFactory=HE.DEFAULT_PROMPT_TIMEOUT=HE.ICompletionsPromptFactoryService=void 0;var Vec=ti(),vOi=Gs(),ikr=jAe(),Wec=P6(),zec=nn();HE.ICompletionsPromptFactoryService=(0,zec.createServiceIdentifier)("ICompletionsPromptFactoryService");var okr=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 ikr._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return ikr._promptError}}};HE.DEFAULT_PROMPT_TIMEOUT=1200;var skr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new Vec.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(ikr._promptTimeout)},HE.DEFAULT_PROMPT_TIMEOUT)})])}},CEt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new okr(new skr(n.createInstance(Wec.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};CEt=EOi([_Oi(2,vOi.IInstantiationService)],CEt);var akr=class extends CEt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};HE.CompletionsPromptFactory=akr;HE.CompletionsPromptFactory=akr=EOi([_Oi(0,vOi.IInstantiationService)],akr);var ckr=class extends CEt{static{a(this,"TestCompletionsPromptFactory")}};HE.TestCompletionsPromptFactory=ckr});var jAe=I(gh=>{"use strict";p();Object.defineProperty(gh,"__esModule",{value:!0});gh.PromptResponse=gh._promptTimeout=gh._promptCancelled=gh._promptError=gh._copilotContentExclusion=gh._contextTooShort=gh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=gh.MIN_PROMPT_CHARS=void 0;gh.trimLastLine=ttc;gh.extractPrompt=rtc;gh.getPromptOptions=otc;var Yec=D4e(),Kec=fy(),COi=Cyt(),Jec=L4e(),Zec=s1(),Xec=lkr(),etc=QAe();gh.MIN_PROMPT_CHARS=10;gh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];gh._contextTooShort={type:"contextTooShort"};gh._copilotContentExclusion={type:"copilotContentExclusion"};gh._promptError={type:"promptError"};gh._promptCancelled={type:"promptCancelled"};gh._promptTimeout={type:"promptTimeout"};var bOi;(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} @@ -1020,14 +1020,14 @@ ${o.join(", ")}`).join(` --- ${n.content} ---------------`).join(` -`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(EOi||(gh.PromptResponse=EOi={}));function Yec(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(Yec,"trimLastLine");function Kec(t,e,r,n,o,s={}){let l=t.get(Vec.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=Zec(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(Wec.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(Kec,"extractPrompt");function Jec(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,Hec.commentBlockAsSingles)(n,e)}a(Jec,"addNeighboringCellsToPrompt");function Zec(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>Jec(l,r.document.detectedLanguageId)).join(` +`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(bOi||(gh.PromptResponse=bOi={}));function ttc(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(ttc,"trimLastLine");function rtc(t,e,r,n,o,s={}){let l=t.get(Zec.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=itc(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(Xec.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(rtc,"extractPrompt");function ntc(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,Yec.commentBlockAsSingles)(n,e)}a(ntc,"addNeighboringCellsToPrompt");function itc(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>ntc(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(Zec,"applyEditsForNotebook");function Xec(t,e,r){let n=t.get(Gec.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,$ec.getMaxSolutionTokens)(),c=(0,yOi.getNumberOfSnippets)(e,r),l=(0,yOi.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(Xec,"getPromptOptions")});var COi=I(x$=>{"use strict";p();Object.defineProperty(x$,"__esModule",{value:!0});x$.TypeSystem=x$.TypeSystemDuplicateFormat=x$.TypeSystemDuplicateTypeKind=void 0;var CEt=Hge(),etc=n4e(),ttc=Sn(),vOi=Nf(),bEt=class extends vOi.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};x$.TypeSystemDuplicateTypeKind=bEt;var SEt=class extends vOi.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};x$.TypeSystemDuplicateFormat=SEt;var _Oi;(function(t){function e(n,o){if(CEt.TypeRegistry.Has(n))throw new bEt(n);return CEt.TypeRegistry.Set(n,o),(s={})=>(0,etc.Unsafe)({...s,[ttc.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(CEt.FormatRegistry.Has(n))throw new SEt(n);return CEt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(_Oi||(x$.TypeSystem=_Oi={}))});var lkr=I(w$=>{"use strict";p();var rtc=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]})),bOi=w$&&w$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rtc(e,t,r)};Object.defineProperty(w$,"__esModule",{value:!0});bOi(T5e(),w$);bOi(COi(),w$)});var ukr=I(K4e=>{"use strict";p();Object.defineProperty(K4e,"__esModule",{value:!0});K4e.DefaultErrorFunction=SOi;K4e.SetErrorFunction=itc;K4e.GetErrorFunction=otc;var ntc=Sn(),qn=dkr();function SOi(t){switch(t.errorType){case qn.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case qn.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case qn.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case qn.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case qn.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case qn.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case qn.ValueErrorType.Array:return"Expected array";case qn.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case qn.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.BigInt:return"Expected bigint";case qn.ValueErrorType.Boolean:return"Expected boolean";case qn.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case qn.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case qn.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case qn.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case qn.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case qn.ValueErrorType.Date:return"Expected Date";case qn.ValueErrorType.Function:return"Expected function";case qn.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.Integer:return"Expected integer";case qn.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case qn.ValueErrorType.Intersect:return"Expected all values to match";case qn.ValueErrorType.Iterator:return"Expected Iterator";case qn.ValueErrorType.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case qn.ValueErrorType.Never:return"Never";case qn.ValueErrorType.Not:return"Value should not match";case qn.ValueErrorType.Null:return"Expected null";case qn.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.Number:return"Expected number";case qn.ValueErrorType.Object:return"Expected object";case qn.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case qn.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case qn.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case qn.ValueErrorType.ObjectRequiredProperty:return"Expected required property";case qn.ValueErrorType.Promise:return"Expected Promise";case qn.ValueErrorType.RegExp:return"Expected string to match regular expression";case qn.ValueErrorType.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case qn.ValueErrorType.StringFormat:return`Expected string to match '${t.schema.format}' format`;case qn.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case qn.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case qn.ValueErrorType.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case qn.ValueErrorType.String:return"Expected string";case qn.ValueErrorType.Symbol:return"Expected symbol";case qn.ValueErrorType.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case qn.ValueErrorType.Tuple:return"Expected tuple";case qn.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case qn.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case qn.ValueErrorType.Uint8Array:return"Expected Uint8Array";case qn.ValueErrorType.Undefined:return"Expected undefined";case qn.ValueErrorType.Union:return"Expected union value";case qn.ValueErrorType.Void:return"Expected void";case qn.ValueErrorType.Kind:return`Expected kind '${t.schema[ntc.Kind]}'`;default:return"Unknown error type"}}a(SOi,"DefaultErrorFunction");var TOi=SOi;function itc(t){TOi=t}a(itc,"SetErrorFunction");function otc(){return TOi}a(otc,"GetErrorFunction")});var wOi=I(jAe=>{"use strict";p();Object.defineProperty(jAe,"__esModule",{value:!0});jAe.TypeDereferenceError=void 0;jAe.Pushref=ltc;jAe.Deref=xOi;var stc=Nf(),IOi=Sn(),atc=Egt(),TEt=class extends stc.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};jAe.TypeDereferenceError=TEt;function ctc(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new TEt(t);return xOi(r,e)}a(ctc,"Resolve");function ltc(t,e){return!(0,atc.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(ltc,"Pushref");function xOi(t,e){return t[IOi.Kind]==="This"||t[IOi.Kind]==="Ref"?ctc(t,e):t}a(xOi,"Deref")});var qD=I(nne=>{"use strict";p();var utc=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]})),dtc=nne&&nne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&utc(e,t,r)};Object.defineProperty(nne,"__esModule",{value:!0});dtc(wOi(),nne)});var DOi=I(J4e=>{"use strict";p();Object.defineProperty(J4e,"__esModule",{value:!0});J4e.ValueHashError=void 0;J4e.Hash=wtc;var jD=R0(),ftc=Nf(),IEt=class extends ftc.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};J4e.ValueHashError=IEt;var nI;(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"})(nI||(nI={}));var HAe=BigInt("14695981039346656037"),[ptc,htc]=[BigInt("1099511628211"),BigInt("18446744073709551616")],mtc=Array.from({length:256}).map((t,e)=>BigInt(e)),ROi=new Float64Array(1),kOi=new DataView(ROi.buffer),POi=new Uint8Array(ROi.buffer);function*gtc(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(gtc,"NumberToBytes");function Atc(t){GE(nI.Array);for(let e of t)GAe(e)}a(Atc,"ArrayType");function ytc(t){GE(nI.Boolean),GE(t?1:0)}a(ytc,"BooleanType");function Etc(t){GE(nI.BigInt),kOi.setBigInt64(0,t);for(let e of POi)GE(e)}a(Etc,"BigIntType");function _tc(t){GE(nI.Date),GAe(t.getTime())}a(_tc,"DateType");function vtc(t){GE(nI.Null)}a(vtc,"NullType");function Ctc(t){GE(nI.Number),kOi.setFloat64(0,t);for(let e of POi)GE(e)}a(Ctc,"NumberType");function btc(t){GE(nI.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())GAe(e),GAe(t[e])}a(btc,"ObjectType");function Stc(t){GE(nI.String);for(let e=0;e{"use strict";p();var Rtc=ine&&ine.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ktc=ine&&ine.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rtc(e,t,r)};Object.defineProperty(ine,"__esModule",{value:!0});ktc(DOi(),ine)});var pkr=I(tLe=>{"use strict";p();Object.defineProperty(tLe,"__esModule",{value:!0});tLe.ValueCheckUnknownTypeError=void 0;tLe.Check=Arc;var X4e=lkr(),fkr=qD(),Ptc=Z4e(),$Ae=Sn(),NOi=mD(),Dtc=ure(),eLe=Hge(),Ntc=Nf(),Mtc=Cm(),wm=R0(),Otc=vs(),xEt=class extends Ntc.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};tLe.ValueCheckUnknownTypeError=xEt;function Ltc(t){return t[$Ae.Kind]==="Any"||t[$Ae.Kind]==="Unknown"}a(Ltc,"IsAnyOrUnknown");function ia(t){return t!==void 0}a(ia,"IsDefined");function Btc(t,e,r){return!0}a(Btc,"FromAny");function Ftc(t,e,r){return!0}a(Ftc,"FromArgument");function Utc(t,e,r){if(!(0,wm.IsArray)(r)||ia(t.minItems)&&!(r.length>=t.minItems)||ia(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Jg(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,Ptc.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(ia(t.contains)||(0,wm.IsNumber)(t.minContains)||(0,wm.IsNumber)(t.maxContains)))return!0;let n=ia(t.contains)?t.contains:(0,Mtc.Never)(),o=r.reduce((s,c)=>Jg(n,e,c)?s+1:s,0);return!(o===0||(0,wm.IsNumber)(t.minContains)&&ot.maxContains)}a(Utc,"FromArray");function Qtc(t,e,r){return(0,wm.IsAsyncIterator)(r)}a(Qtc,"FromAsyncIterator");function qtc(t,e,r){return!(!(0,wm.IsBigInt)(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(qtc,"FromBigInt");function jtc(t,e,r){return(0,wm.IsBoolean)(r)}a(jtc,"FromBoolean");function Htc(t,e,r){return Jg(t.returns,e,r.prototype)}a(Htc,"FromConstructor");function Gtc(t,e,r){return!(!(0,wm.IsDate)(r)||ia(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||ia(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||ia(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||ia(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(Gtc,"FromDate");function $tc(t,e,r){return(0,wm.IsFunction)(r)}a($tc,"FromFunction");function Vtc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Jg(o,[...e,...n],r)}a(Vtc,"FromImport");function Wtc(t,e,r){return!(!(0,wm.IsInteger)(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.multipleOf)&&r%t.multipleOf!==0)}a(Wtc,"FromInteger");function ztc(t,e,r){let n=t.allOf.every(o=>Jg(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,NOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,Otc.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,NOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Jg(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(ztc,"FromIntersect");function Ytc(t,e,r){return(0,wm.IsIterator)(r)}a(Ytc,"FromIterator");function Ktc(t,e,r){return r===t.const}a(Ktc,"FromLiteral");function Jtc(t,e,r){return!1}a(Jtc,"FromNever");function Ztc(t,e,r){return!Jg(t.not,e,r)}a(Ztc,"FromNot");function Xtc(t,e,r){return(0,wm.IsNull)(r)}a(Xtc,"FromNull");function erc(t,e,r){return!(!X4e.TypeSystemPolicy.IsNumberLike(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.multipleOf)&&r%t.multipleOf!==0)}a(erc,"FromNumber");function trc(t,e,r){if(!X4e.TypeSystemPolicy.IsObjectLike(r)||ia(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ia(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(!Jg(s,e,r[o])||((0,Dtc.ExtendsUndefinedCheck)(s)||Ltc(s))&&!(o in r))return!1}else if(X4e.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!Jg(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)||Jg(t.additionalProperties,e,r[s])):!0}a(trc,"FromObject");function rrc(t,e,r){return(0,wm.IsPromise)(r)}a(rrc,"FromPromise");function nrc(t,e,r){if(!X4e.TypeSystemPolicy.IsRecordLike(r)||ia(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ia(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)?Jg(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Jg(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(nrc,"FromRecord");function irc(t,e,r){return Jg((0,fkr.Deref)(t,e),e,r)}a(irc,"FromRef");function orc(t,e,r){let n=new RegExp(t.source,t.flags);return ia(t.minLength)&&!(r.length>=t.minLength)||ia(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(orc,"FromRegExp");function src(t,e,r){return!(0,wm.IsString)(r)||ia(t.minLength)&&!(r.length>=t.minLength)||ia(t.maxLength)&&!(r.length<=t.maxLength)||ia(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:ia(t.format)?eLe.FormatRegistry.Has(t.format)?eLe.FormatRegistry.Get(t.format)(r):!1:!0}a(src,"FromString");function arc(t,e,r){return(0,wm.IsSymbol)(r)}a(arc,"FromSymbol");function crc(t,e,r){return(0,wm.IsString)(r)&&new RegExp(t.pattern).test(r)}a(crc,"FromTemplateLiteral");function lrc(t,e,r){return Jg((0,fkr.Deref)(t,e),e,r)}a(lrc,"FromThis");function urc(t,e,r){if(!(0,wm.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nJg(n,e,r))}a(frc,"FromUnion");function prc(t,e,r){return!(!(0,wm.IsUint8Array)(r)||ia(t.maxByteLength)&&!(r.length<=t.maxByteLength)||ia(t.minByteLength)&&!(r.length>=t.minByteLength))}a(prc,"FromUint8Array");function hrc(t,e,r){return!0}a(hrc,"FromUnknown");function mrc(t,e,r){return X4e.TypeSystemPolicy.IsVoidLike(r)}a(mrc,"FromVoid");function grc(t,e,r){return eLe.TypeRegistry.Has(t[$Ae.Kind])?eLe.TypeRegistry.Get(t[$Ae.Kind])(t,r):!1}a(grc,"FromKind");function Jg(t,e,r){let n=ia(t.$id)?(0,fkr.Pushref)(t,e):e,o=t;switch(o[$Ae.Kind]){case"Any":return Btc(o,n,r);case"Argument":return Ftc(o,n,r);case"Array":return Utc(o,n,r);case"AsyncIterator":return Qtc(o,n,r);case"BigInt":return qtc(o,n,r);case"Boolean":return jtc(o,n,r);case"Constructor":return Htc(o,n,r);case"Date":return Gtc(o,n,r);case"Function":return $tc(o,n,r);case"Import":return Vtc(o,n,r);case"Integer":return Wtc(o,n,r);case"Intersect":return ztc(o,n,r);case"Iterator":return Ytc(o,n,r);case"Literal":return Ktc(o,n,r);case"Never":return Jtc(o,n,r);case"Not":return Ztc(o,n,r);case"Null":return Xtc(o,n,r);case"Number":return erc(o,n,r);case"Object":return trc(o,n,r);case"Promise":return rrc(o,n,r);case"Record":return nrc(o,n,r);case"Ref":return irc(o,n,r);case"RegExp":return orc(o,n,r);case"String":return src(o,n,r);case"Symbol":return arc(o,n,r);case"TemplateLiteral":return crc(o,n,r);case"This":return lrc(o,n,r);case"Tuple":return urc(o,n,r);case"Undefined":return drc(o,n,r);case"Union":return frc(o,n,r);case"Uint8Array":return prc(o,n,r);case"Unknown":return hrc(o,n,r);case"Void":return mrc(o,n,r);default:if(!eLe.TypeRegistry.Has(o[$Ae.Kind]))throw new xEt(o);return grc(o,n,r)}}a(Jg,"Visit");function Arc(...t){return t.length===3?Jg(t[0],t[1],t[2]):Jg(t[0],[],t[1])}a(Arc,"Check")});var iI=I(one=>{"use strict";p();var yrc=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]})),Erc=one&&one.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yrc(e,t,r)};Object.defineProperty(one,"__esModule",{value:!0});Erc(pkr(),one)});var dkr=I(O6=>{"use strict";p();Object.defineProperty(O6,"__esModule",{value:!0});O6.ValueErrorIterator=O6.ValueErrorsUnknownTypeError=O6.ValueErrorType=void 0;O6.Errors=snc;var rLe=lkr(),MOi=mD(),wEt=Hge(),_rc=I1r(),vrc=ukr(),Crc=Nf(),OOi=qD(),brc=Z4e(),Src=iI(),hkr=Sn(),Trc=Cm(),Ah=R0(),tn;(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"})(tn||(O6.ValueErrorType=tn={}));var REt=class extends Crc.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};O6.ValueErrorsUnknownTypeError=REt;function M6(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(M6,"EscapeKey");function oa(t){return t!==void 0}a(oa,"IsDefined");var nLe=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}};O6.ValueErrorIterator=nLe;function cn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,vrc.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(cn,"Create");function*Irc(t,e,r,n){}a(Irc,"FromAny");function*xrc(t,e,r,n){}a(xrc,"FromArgument");function*wrc(t,e,r,n){if(!(0,Ah.IsArray)(n))return yield cn(tn.Array,t,r,n);oa(t.minItems)&&!(n.length>=t.minItems)&&(yield cn(tn.ArrayMinItems,t,r,n)),oa(t.maxItems)&&!(n.length<=t.maxItems)&&(yield cn(tn.ArrayMaxItems,t,r,n));for(let c=0;cZg(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield cn(tn.ArrayContains,t,r,n)),(0,Ah.IsNumber)(t.minContains)&&st.maxContains&&(yield cn(tn.ArrayMaxContains,t,r,n))}a(wrc,"FromArray");function*Rrc(t,e,r,n){(0,Ah.IsAsyncIterator)(n)||(yield cn(tn.AsyncIterator,t,r,n))}a(Rrc,"FromAsyncIterator");function*krc(t,e,r,n){if(!(0,Ah.IsBigInt)(n))return yield cn(tn.BigInt,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.BigIntExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.BigIntMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.BigIntMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield cn(tn.BigIntMultipleOf,t,r,n))}a(krc,"FromBigInt");function*Prc(t,e,r,n){(0,Ah.IsBoolean)(n)||(yield cn(tn.Boolean,t,r,n))}a(Prc,"FromBoolean");function*Drc(t,e,r,n){yield*Zg(t.returns,e,r,n.prototype)}a(Drc,"FromConstructor");function*Nrc(t,e,r,n){if(!(0,Ah.IsDate)(n))return yield cn(tn.Date,t,r,n);oa(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield cn(tn.DateExclusiveMinimumTimestamp,t,r,n)),oa(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield cn(tn.DateMaximumTimestamp,t,r,n)),oa(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield cn(tn.DateMinimumTimestamp,t,r,n)),oa(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield cn(tn.DateMultipleOfTimestamp,t,r,n))}a(Nrc,"FromDate");function*Mrc(t,e,r,n){(0,Ah.IsFunction)(n)||(yield cn(tn.Function,t,r,n))}a(Mrc,"FromFunction");function*Orc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Zg(s,[...e,...o],r,n)}a(Orc,"FromImport");function*Lrc(t,e,r,n){if(!(0,Ah.IsInteger)(n))return yield cn(tn.Integer,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.IntegerExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.IntegerMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.IntegerMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.IntegerMultipleOf,t,r,n))}a(Lrc,"FromInteger");function*Brc(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Zg(s,e,r,n))o=!0,yield c;if(o)return yield cn(tn.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,MOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield cn(tn.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,MOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Zg(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(Brc,"FromIntersect");function*Frc(t,e,r,n){(0,Ah.IsIterator)(n)||(yield cn(tn.Iterator,t,r,n))}a(Frc,"FromIterator");function*Urc(t,e,r,n){n!==t.const&&(yield cn(tn.Literal,t,r,n))}a(Urc,"FromLiteral");function*Qrc(t,e,r,n){yield cn(tn.Never,t,r,n)}a(Qrc,"FromNever");function*qrc(t,e,r,n){Zg(t.not,e,r,n).next().done===!0&&(yield cn(tn.Not,t,r,n))}a(qrc,"FromNot");function*jrc(t,e,r,n){(0,Ah.IsNull)(n)||(yield cn(tn.Null,t,r,n))}a(jrc,"FromNull");function*Hrc(t,e,r,n){if(!rLe.TypeSystemPolicy.IsNumberLike(n))return yield cn(tn.Number,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.NumberExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.NumberMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.NumberMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.NumberMultipleOf,t,r,n))}a(Hrc,"FromNumber");function*Grc(t,e,r,n){if(!rLe.TypeSystemPolicy.IsObjectLike(n))return yield cn(tn.Object,t,r,n);oa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),oa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.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 cn(tn.ObjectRequiredProperty,t.properties[l],`${r}/${M6(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield cn(tn.ObjectAdditionalProperties,t,`${r}/${M6(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Zg(t.additionalProperties,e,`${r}/${M6(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Zg(u,e,`${r}/${M6(l)}`,n[l]),(0,_rc.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield cn(tn.ObjectRequiredProperty,u,`${r}/${M6(l)}`,void 0))):rLe.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*Zg(u,e,`${r}/${M6(l)}`,n[l]))}}a(Grc,"FromObject");function*$rc(t,e,r,n){(0,Ah.IsPromise)(n)||(yield cn(tn.Promise,t,r,n))}a($rc,"FromPromise");function*Vrc(t,e,r,n){if(!rLe.TypeSystemPolicy.IsRecordLike(n))return yield cn(tn.Object,t,r,n);oa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),oa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.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*Zg(s,e,`${r}/${M6(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Zg(t.additionalProperties,e,`${r}/${M6(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield cn(tn.ObjectAdditionalProperties,t,`${r}/${M6(l)}`,u)}}a(Vrc,"FromRecord");function*Wrc(t,e,r,n){yield*Zg((0,OOi.Deref)(t,e),e,r,n)}a(Wrc,"FromRef");function*zrc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);if(oa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),oa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield cn(tn.RegExp,t,r,n)}a(zrc,"FromRegExp");function*Yrc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);oa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),oa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),(0,Ah.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))),(0,Ah.IsString)(t.format)&&(wEt.FormatRegistry.Has(t.format)?wEt.FormatRegistry.Get(t.format)(n)||(yield cn(tn.StringFormat,t,r,n)):yield cn(tn.StringFormatUnknown,t,r,n))}a(Yrc,"FromString");function*Krc(t,e,r,n){(0,Ah.IsSymbol)(n)||(yield cn(tn.Symbol,t,r,n))}a(Krc,"FromSymbol");function*Jrc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))}a(Jrc,"FromTemplateLiteral");function*Zrc(t,e,r,n){yield*Zg((0,OOi.Deref)(t,e),e,r,n)}a(Zrc,"FromThis");function*Xrc(t,e,r,n){if(!(0,Ah.IsArray)(n))return yield cn(tn.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield cn(tn.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield cn(tn.TupleLength,t,r,n);if(t.items)for(let o=0;onew nLe(Zg(s,e,r,n)));yield cn(tn.Union,t,r,n,o)}a(tnc,"FromUnion");function*rnc(t,e,r,n){if(!(0,Ah.IsUint8Array)(n))return yield cn(tn.Uint8Array,t,r,n);oa(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield cn(tn.Uint8ArrayMaxByteLength,t,r,n)),oa(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield cn(tn.Uint8ArrayMinByteLength,t,r,n))}a(rnc,"FromUint8Array");function*nnc(t,e,r,n){}a(nnc,"FromUnknown");function*inc(t,e,r,n){rLe.TypeSystemPolicy.IsVoidLike(n)||(yield cn(tn.Void,t,r,n))}a(inc,"FromVoid");function*onc(t,e,r,n){wEt.TypeRegistry.Get(t[hkr.Kind])(t,n)||(yield cn(tn.Kind,t,r,n))}a(onc,"FromKind");function*Zg(t,e,r,n){let o=oa(t.$id)?[...e,t]:e,s=t;switch(s[hkr.Kind]){case"Any":return yield*Irc(s,o,r,n);case"Argument":return yield*xrc(s,o,r,n);case"Array":return yield*wrc(s,o,r,n);case"AsyncIterator":return yield*Rrc(s,o,r,n);case"BigInt":return yield*krc(s,o,r,n);case"Boolean":return yield*Prc(s,o,r,n);case"Constructor":return yield*Drc(s,o,r,n);case"Date":return yield*Nrc(s,o,r,n);case"Function":return yield*Mrc(s,o,r,n);case"Import":return yield*Orc(s,o,r,n);case"Integer":return yield*Lrc(s,o,r,n);case"Intersect":return yield*Brc(s,o,r,n);case"Iterator":return yield*Frc(s,o,r,n);case"Literal":return yield*Urc(s,o,r,n);case"Never":return yield*Qrc(s,o,r,n);case"Not":return yield*qrc(s,o,r,n);case"Null":return yield*jrc(s,o,r,n);case"Number":return yield*Hrc(s,o,r,n);case"Object":return yield*Grc(s,o,r,n);case"Promise":return yield*$rc(s,o,r,n);case"Record":return yield*Vrc(s,o,r,n);case"Ref":return yield*Wrc(s,o,r,n);case"RegExp":return yield*zrc(s,o,r,n);case"String":return yield*Yrc(s,o,r,n);case"Symbol":return yield*Krc(s,o,r,n);case"TemplateLiteral":return yield*Jrc(s,o,r,n);case"This":return yield*Zrc(s,o,r,n);case"Tuple":return yield*Xrc(s,o,r,n);case"Undefined":return yield*enc(s,o,r,n);case"Union":return yield*tnc(s,o,r,n);case"Uint8Array":return yield*rnc(s,o,r,n);case"Unknown":return yield*nnc(s,o,r,n);case"Void":return yield*inc(s,o,r,n);default:if(!wEt.TypeRegistry.Has(s[hkr.Kind]))throw new REt(t);return yield*onc(s,o,r,n)}}a(Zg,"Visit");function snc(...t){let e=t.length===3?Zg(t[0],t[1],"",t[2]):Zg(t[0],[],"",t[1]);return new nLe(e)}a(snc,"Errors")});var VAe=I(R$=>{"use strict";p();var anc=R$&&R$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LOi=R$&&R$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&anc(e,t,r)};Object.defineProperty(R$,"__esModule",{value:!0});LOi(dkr(),R$);LOi(ukr(),R$)});var qOi=I(L6=>{"use strict";p();var cnc=L6&&L6.__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},FOi=L6&&L6.__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)},mkr,kEt,UOi;Object.defineProperty(L6,"__esModule",{value:!0});L6.AssertError=void 0;L6.Assert=dnc;var QOi=VAe(),lnc=RCr(),unc=pkr(),PEt=class extends lnc.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),mkr.add(this),kEt.set(this,void 0),cnc(this,kEt,e,"f"),this.error=r}Errors(){return new QOi.ValueErrorIterator(FOi(this,mkr,"m",UOi).call(this))}};L6.AssertError=PEt;kEt=new WeakMap,mkr=new WeakSet,UOi=a(function*(){this.error&&(yield this.error),yield*FOi(this,kEt,"f")},"_AssertError_Iterator");function BOi(t,e,r){if(!(0,unc.Check)(t,e,r))throw new PEt((0,QOi.Errors)(t,e,r))}a(BOi,"AssertValue");function dnc(...t){return t.length===3?BOi(t[0],t[1],t[2]):BOi(t[0],[],t[1])}a(dnc,"Assert")});var DEt=I(sne=>{"use strict";p();var fnc=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]})),pnc=sne&&sne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fnc(e,t,r)};Object.defineProperty(sne,"__esModule",{value:!0});pnc(qOi(),sne)});var jOi=I(gkr=>{"use strict";p();Object.defineProperty(gkr,"__esModule",{value:!0});gkr.Clone=WAe;var ane=R0();function hnc(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=WAe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=WAe(t[r]);return e}a(hnc,"FromObject");function mnc(t){return t.map(e=>WAe(e))}a(mnc,"FromArray");function gnc(t){return t.slice()}a(gnc,"FromTypedArray");function Anc(t){return new Map(WAe([...t.entries()]))}a(Anc,"FromMap");function ync(t){return new Set(WAe([...t.entries()]))}a(ync,"FromSet");function Enc(t){return new Date(t.toISOString())}a(Enc,"FromDate");function WAe(t){if((0,ane.IsArray)(t))return mnc(t);if((0,ane.IsDate)(t))return Enc(t);if((0,ane.IsTypedArray)(t))return gnc(t);if((0,ane.IsMap)(t))return Anc(t);if((0,ane.IsSet)(t))return ync(t);if((0,ane.IsObject)(t))return hnc(t);if((0,ane.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(WAe,"Clone")});var HD=I(cne=>{"use strict";p();var _nc=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]})),vnc=cne&&cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_nc(e,t,r)};Object.defineProperty(cne,"__esModule",{value:!0});vnc(jOi(),cne)});var VOi=I(iLe=>{"use strict";p();Object.defineProperty(iLe,"__esModule",{value:!0});iLe.ValueCreateError=void 0;iLe.Create=cic;var Ba=R0(),Cnc=iI(),bnc=HD(),Akr=qD(),HOi=pD(),Snc=Hge(),GOi=Sn(),Tnc=Nf(),Inc=Egt(),f1=class extends Tnc.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};iLe.ValueCreateError=f1;function Xa(t){return(0,Inc.IsFunction)(t)?t():(0,bnc.Clone)(t)}a(Xa,"FromDefault");function xnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(xnc,"FromAny");function wnc(t,e){return{}}a(wnc,"FromArgument");function Rnc(t,e){if(t.uniqueItems===!0&&!(0,Ba.HasPropertyKey)(t,"default"))throw new f1(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Ba.HasPropertyKey)(t,"default"))throw new f1(t,"Array with the contains constraint requires a default value");return"default"in t?Xa(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>oI(t.items,e)):[]}a(Rnc,"FromArray");function knc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):(async function*(){})()}a(knc,"FromAsyncIterator");function Pnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):BigInt(0)}a(Pnc,"FromBigInt");function Dnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):!1}a(Dnc,"FromBoolean");function Nnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=oI(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(Nnc,"FromConstructor");function Mnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(Mnc,"FromDate");function Onc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):()=>oI(t.returns,e)}a(Onc,"FromFunction");function Lnc(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return oI(n,[...e,...r])}a(Lnc,"FromImport");function Bnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minimum!==void 0?t.minimum:0}a(Bnc,"FromInteger");function Fnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=t.allOf.reduce((n,o)=>{let s=oI(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,Cnc.Check)(t,e,r))throw new f1(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(Fnc,"FromIntersect");function Unc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):(function*(){})()}a(Unc,"FromIterator");function Qnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.const}a(Qnc,"FromLiteral");function qnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"Never types cannot be created. Consider using a default value.")}a(qnc,"FromNever");function jnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"Not types must have a default value")}a(jnc,"FromNot");function Hnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):null}a(Hnc,"FromNull");function Gnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minimum!==void 0?t.minimum:0}a(Gnc,"FromNumber");function $nc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=oI(s,e));return n}}a($nc,"FromObject");function Vnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):Promise.resolve(oI(t.item,e))}a(Vnc,"FromPromise");function Wnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(Wnc,"FromRecord");function znc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):oI((0,Akr.Deref)(t,e),e)}a(znc,"FromRef");function Ync(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"RegExp types cannot be created. Consider using a default value.")}a(Ync,"FromRegExp");function Knc(t,e){if(t.pattern!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"String types with formats must specify a default value")}else return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(Knc,"FromString");function Jnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(Jnc,"FromSymbol");function Znc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);if(!(0,HOi.IsTemplateLiteralFinite)(t))throw new f1(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,HOi.TemplateLiteralGenerate)(t)[0]}a(Znc,"FromTemplateLiteral");function Xnc(t,e){if($Oi++>aic)throw new f1(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):oI((0,Akr.Deref)(t,e),e)}a(Xnc,"FromThis");function eic(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>oI(t.items[n],e))}a(eic,"FromTuple");function tic(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default)}a(tic,"FromUndefined");function ric(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return oI(t.anyOf[0],e)}a(ric,"FromUnion");function nic(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(nic,"FromUint8Array");function iic(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(iic,"FromUnknown");function oic(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default)}a(oic,"FromVoid");function sic(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new Error("User defined types must specify a default value")}a(sic,"FromKind");function oI(t,e){let r=(0,Akr.Pushref)(t,e),n=t;switch(n[GOi.Kind]){case"Any":return xnc(n,r);case"Argument":return wnc(n,r);case"Array":return Rnc(n,r);case"AsyncIterator":return knc(n,r);case"BigInt":return Pnc(n,r);case"Boolean":return Dnc(n,r);case"Constructor":return Nnc(n,r);case"Date":return Mnc(n,r);case"Function":return Onc(n,r);case"Import":return Lnc(n,r);case"Integer":return Bnc(n,r);case"Intersect":return Fnc(n,r);case"Iterator":return Unc(n,r);case"Literal":return Qnc(n,r);case"Never":return qnc(n,r);case"Not":return jnc(n,r);case"Null":return Hnc(n,r);case"Number":return Gnc(n,r);case"Object":return $nc(n,r);case"Promise":return Vnc(n,r);case"Record":return Wnc(n,r);case"Ref":return znc(n,r);case"RegExp":return Ync(n,r);case"String":return Knc(n,r);case"Symbol":return Jnc(n,r);case"TemplateLiteral":return Znc(n,r);case"This":return Xnc(n,r);case"Tuple":return eic(n,r);case"Undefined":return tic(n,r);case"Union":return ric(n,r);case"Uint8Array":return nic(n,r);case"Unknown":return iic(n,r);case"Void":return oic(n,r);default:if(!Snc.TypeRegistry.Has(n[GOi.Kind]))throw new f1(n,"Unknown type");return sic(n,r)}}a(oI,"Visit");var aic=512,$Oi=0;function cic(...t){return $Oi=0,t.length===2?oI(t[0],t[1]):oI(t[0],[])}a(cic,"Create")});var NEt=I(lne=>{"use strict";p();var lic=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]})),uic=lne&&lne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lic(e,t,r)};Object.defineProperty(lne,"__esModule",{value:!0});uic(VOi(),lne)});var KOi=I(aLe=>{"use strict";p();Object.defineProperty(aLe,"__esModule",{value:!0});aLe.ValueCastError=void 0;aLe.Cast=YOi;var QR=R0(),dic=Nf(),MEt=Sn(),k$=NEt(),sI=iI(),une=HD(),sLe=qD(),oLe=class extends dic.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};aLe.ValueCastError=oLe;function WOi(t,e,r){if(t[MEt.Kind]==="Object"&&typeof r=="object"&&!(0,QR.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[MEt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,sI.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[MEt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,sLe.Deref)(s,e)).map(s=>WOi(s,e,r));return Math.max(...o)}else return(0,sI.Check)(t,e,r)?1:0}a(WOi,"ScoreUnion");function fic(t,e,r){let n=t.anyOf.map(c=>(0,sLe.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=WOi(c,e,r);l>s&&(o=c,s=l)}return o}a(fic,"SelectUnion");function pic(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,une.Clone)(t.default);{let n=fic(t,e,r);return YOi(n,e,r)}}a(pic,"CastUnion");function hic(t,e,r){return(0,sI.Check)(t,e,r)?(0,une.Clone)(r):(0,k$.Create)(t,e)}a(hic,"DefaultClone");function mic(t,e,r){return(0,sI.Check)(t,e,r)?r:(0,k$.Create)(t,e)}a(mic,"Default");function gic(t,e,r){if((0,sI.Check)(t,e,r))return(0,une.Clone)(r);let n=(0,QR.IsArray)(r)?(0,une.Clone)(r):(0,k$.Create)(t,e),o=(0,QR.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,QR.IsNumber)(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>GD(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!(0,sI.Check)(t,e,l))throw new oLe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(gic,"FromArray");function Aic(t,e,r){if((0,sI.Check)(t,e,r))return(0,k$.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]=GD(c,e,r.prototype[s]));return o}a(Aic,"FromConstructor");function yic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return GD(o,[...e,...n],r)}a(yic,"FromImport");function zOi(t,e){return(0,QR.IsObject)(t)&&!(0,QR.IsObject)(e)||!(0,QR.IsObject)(t)&&(0,QR.IsObject)(e)?t:!(0,QR.IsObject)(t)||!(0,QR.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?zOi(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(zOi,"IntersectAssign");function Eic(t,e,r){if((0,sI.Check)(t,e,r))return r;let n=(0,k$.Create)(t,e),o=zOi(n,r);return(0,sI.Check)(t,e,o)?o:n}a(Eic,"FromIntersect");function _ic(t,e,r){throw new oLe(t,"Never types cannot be cast")}a(_ic,"FromNever");function vic(t,e,r){if((0,sI.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,k$.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]=GD(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]=GD(t.additionalProperties,e,r[c]))}return o}a(vic,"FromObject");function Cic(t,e,r){if((0,sI.Check)(t,e,r))return(0,une.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,k$.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]=GD(o,e,l);return s}a(Cic,"FromRecord");function bic(t,e,r){return GD((0,sLe.Deref)(t,e),e,r)}a(bic,"FromRef");function Sic(t,e,r){return GD((0,sLe.Deref)(t,e),e,r)}a(Sic,"FromThis");function Tic(t,e,r){return(0,sI.Check)(t,e,r)?(0,une.Clone)(r):(0,QR.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>GD(n,e,r[o])):(0,k$.Create)(t,e)}a(Tic,"FromTuple");function Iic(t,e,r){return(0,sI.Check)(t,e,r)?(0,une.Clone)(r):pic(t,e,r)}a(Iic,"FromUnion");function GD(t,e,r){let n=(0,QR.IsString)(t.$id)?(0,sLe.Pushref)(t,e):e,o=t;switch(t[MEt.Kind]){case"Array":return gic(o,n,r);case"Constructor":return Aic(o,n,r);case"Import":return yic(o,n,r);case"Intersect":return Eic(o,n,r);case"Never":return _ic(o,n,r);case"Object":return vic(o,n,r);case"Record":return Cic(o,n,r);case"Ref":return bic(o,n,r);case"This":return Sic(o,n,r);case"Tuple":return Tic(o,n,r);case"Union":return Iic(o,n,r);case"Date":case"Symbol":case"Uint8Array":return hic(t,e,r);default:return mic(o,n,r)}}a(GD,"Visit");function YOi(...t){return t.length===3?GD(t[0],t[1],t[2]):GD(t[0],[],t[1])}a(YOi,"Cast")});var OEt=I(dne=>{"use strict";p();var xic=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]})),wic=dne&&dne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xic(e,t,r)};Object.defineProperty(dne,"__esModule",{value:!0});wic(KOi(),dne)});var ZOi=I(Ekr=>{"use strict";p();Object.defineProperty(Ekr,"__esModule",{value:!0});Ekr.Clean=qic;var Ric=mD(),LEt=iI(),kic=HD(),ykr=qD(),JOi=Sn(),$D=R0(),BEt=vs();function Pic(t){return(0,BEt.IsKind)(t)&&t[JOi.Kind]!=="Unsafe"}a(Pic,"IsCheckable");function Dic(t,e,r){return(0,$D.IsArray)(r)?r.map(n=>p1(t.items,e,n)):r}a(Dic,"FromArray");function Nic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return p1(o,[...e,...n],r)}a(Nic,"FromImport");function Mic(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>p1(l,e,(0,kic.Clone)(r))).reduce((l,u)=>(0,$D.IsObject)(u)?{...l,...u}:u,{});if(!(0,$D.IsObject)(r)||!(0,$D.IsObject)(s)||!(0,BEt.IsKind)(n))return s;let c=(0,Ric.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,LEt.Check)(n,e,r[l])&&(s[l]=p1(n,e,r[l]));return s}a(Mic,"FromIntersect");function Oic(t,e,r){if(!(0,$D.IsObject)(r)||(0,$D.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,$D.HasPropertyKey)(t.properties,o)){r[o]=p1(t.properties[o],e,r[o]);continue}if((0,BEt.IsKind)(n)&&(0,LEt.Check)(n,e,r[o])){r[o]=p1(n,e,r[o]);continue}delete r[o]}return r}a(Oic,"FromObject");function Lic(t,e,r){if(!(0,$D.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]=p1(c,e,r[u]);continue}if((0,BEt.IsKind)(n)&&(0,LEt.Check)(n,e,r[u])){r[u]=p1(n,e,r[u]);continue}delete r[u]}return r}a(Lic,"FromRecord");function Bic(t,e,r){return p1((0,ykr.Deref)(t,e),e,r)}a(Bic,"FromRef");function Fic(t,e,r){return p1((0,ykr.Deref)(t,e),e,r)}a(Fic,"FromThis");function Uic(t,e,r){if(!(0,$D.IsArray)(r))return r;if((0,$D.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(Uic,"FromTuple");function Qic(t,e,r){for(let n of t.anyOf)if(Pic(n)&&(0,LEt.Check)(n,e,r))return p1(n,e,r);return r}a(Qic,"FromUnion");function p1(t,e,r){let n=(0,$D.IsString)(t.$id)?(0,ykr.Pushref)(t,e):e,o=t;switch(o[JOi.Kind]){case"Array":return Dic(o,n,r);case"Import":return Nic(o,n,r);case"Intersect":return Mic(o,n,r);case"Object":return Oic(o,n,r);case"Record":return Lic(o,n,r);case"Ref":return Bic(o,n,r);case"This":return Fic(o,n,r);case"Tuple":return Uic(o,n,r);case"Union":return Qic(o,n,r);default:return r}}a(p1,"Visit");function qic(...t){return t.length===3?p1(t[0],t[1],t[2]):p1(t[0],[],t[1])}a(qic,"Clean")});var FEt=I(fne=>{"use strict";p();var jic=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]})),Hic=fne&&fne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jic(e,t,r)};Object.defineProperty(fne,"__esModule",{value:!0});Hic(ZOi(),fne)});var n5i=I(vkr=>{"use strict";p();Object.defineProperty(vkr,"__esModule",{value:!0});vkr.Convert=Ioc;var Gic=HD(),XOi=iI(),_kr=qD(),$ic=Sn(),Fa=R0();function UEt(t){return(0,Fa.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(UEt,"IsStringNumeric");function Vic(t){return(0,Fa.IsBigInt)(t)||(0,Fa.IsBoolean)(t)||(0,Fa.IsNumber)(t)}a(Vic,"IsValueToString");function cLe(t){return t===!0||(0,Fa.IsNumber)(t)&&t===1||(0,Fa.IsBigInt)(t)&&t===BigInt("1")||(0,Fa.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(cLe,"IsValueTrue");function lLe(t){return t===!1||(0,Fa.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,Fa.IsBigInt)(t)&&t===BigInt("0")||(0,Fa.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(lLe,"IsValueFalse");function Wic(t){return(0,Fa.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(Wic,"IsTimeStringWithTimeZone");function zic(t){return(0,Fa.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(zic,"IsTimeStringWithoutTimeZone");function Yic(t){return(0,Fa.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(Yic,"IsDateTimeStringWithTimeZone");function Kic(t){return(0,Fa.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(Kic,"IsDateTimeStringWithoutTimeZone");function Jic(t){return(0,Fa.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(Jic,"IsDateString");function Zic(t,e){let r=t5i(t);return r===e?r:t}a(Zic,"TryConvertLiteralString");function Xic(t,e){let r=r5i(t);return r===e?r:t}a(Xic,"TryConvertLiteralNumber");function eoc(t,e){let r=e5i(t);return r===e?r:t}a(eoc,"TryConvertLiteralBoolean");function toc(t,e){return(0,Fa.IsString)(t.const)?Zic(e,t.const):(0,Fa.IsNumber)(t.const)?Xic(e,t.const):(0,Fa.IsBoolean)(t.const)?eoc(e,t.const):e}a(toc,"TryConvertLiteral");function e5i(t){return cLe(t)?!0:lLe(t)?!1:t}a(e5i,"TryConvertBoolean");function roc(t){let e=a(r=>r.split(".")[0],"truncateInteger");return UEt(t)?BigInt(e(t)):(0,Fa.IsNumber)(t)?BigInt(Math.trunc(t)):lLe(t)?BigInt(0):cLe(t)?BigInt(1):t}a(roc,"TryConvertBigInt");function t5i(t){return(0,Fa.IsSymbol)(t)&&t.description!==void 0?t.description.toString():Vic(t)?t.toString():t}a(t5i,"TryConvertString");function r5i(t){return UEt(t)?parseFloat(t):cLe(t)?1:lLe(t)?0:t}a(r5i,"TryConvertNumber");function noc(t){return UEt(t)?parseInt(t):(0,Fa.IsNumber)(t)?Math.trunc(t):cLe(t)?1:lLe(t)?0:t}a(noc,"TryConvertInteger");function ioc(t){return(0,Fa.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(ioc,"TryConvertNull");function ooc(t){return(0,Fa.IsString)(t)&&t==="undefined"?void 0:t}a(ooc,"TryConvertUndefined");function soc(t){return(0,Fa.IsDate)(t)?t:(0,Fa.IsNumber)(t)?new Date(t):cLe(t)?new Date(1):lLe(t)?new Date(0):UEt(t)?new Date(parseInt(t)):zic(t)?new Date(`1970-01-01T${t}.000Z`):Wic(t)?new Date(`1970-01-01T${t}`):Kic(t)?new Date(`${t}.000Z`):Yic(t)?new Date(t):Jic(t)?new Date(`${t}T00:00:00.000Z`):t}a(soc,"TryConvertDate");function aoc(t,e,r){return((0,Fa.IsArray)(r)?r:[r]).map(o=>VD(t.items,e,o))}a(aoc,"FromArray");function coc(t,e,r){return roc(r)}a(coc,"FromBigInt");function loc(t,e,r){return e5i(r)}a(loc,"FromBoolean");function uoc(t,e,r){return soc(r)}a(uoc,"FromDate");function doc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return VD(o,[...e,...n],r)}a(doc,"FromImport");function foc(t,e,r){return noc(r)}a(foc,"FromInteger");function poc(t,e,r){return t.allOf.reduce((n,o)=>VD(o,e,n),r)}a(poc,"FromIntersect");function hoc(t,e,r){return toc(t,r)}a(hoc,"FromLiteral");function moc(t,e,r){return ioc(r)}a(moc,"FromNull");function goc(t,e,r){return r5i(r)}a(goc,"FromNumber");function Aoc(t,e,r){if(!(0,Fa.IsObject)(r)||(0,Fa.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,Fa.HasPropertyKey)(r,n)&&(r[n]=VD(t.properties[n],e,r[n]));return r}a(Aoc,"FromObject");function yoc(t,e,r){if(!((0,Fa.IsObject)(r)&&!(0,Fa.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]=VD(s,e,l);return r}a(yoc,"FromRecord");function Eoc(t,e,r){return VD((0,_kr.Deref)(t,e),e,r)}a(Eoc,"FromRef");function _oc(t,e,r){return t5i(r)}a(_oc,"FromString");function voc(t,e,r){return(0,Fa.IsString)(r)||(0,Fa.IsNumber)(r)?Symbol(r):r}a(voc,"FromSymbol");function Coc(t,e,r){return VD((0,_kr.Deref)(t,e),e,r)}a(Coc,"FromThis");function boc(t,e,r){return(0,Fa.IsArray)(r)&&!(0,Fa.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var xoc=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]})),woc=pne&&pne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xoc(e,t,r)};Object.defineProperty(pne,"__esModule",{value:!0});woc(n5i(),pne)});var a5i=I(hne=>{"use strict";p();Object.defineProperty(hne,"__esModule",{value:!0});hne.TransformDecodeError=hne.TransformDecodeCheckError=void 0;hne.TransformDecode=qoc;var Roc=T5e(),i5i=Sn(),o5i=Nf(),s5i=mD(),bkr=qD(),koc=iI(),B6=R0(),uLe=vs(),Ckr=class extends o5i.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}};hne.TransformDecodeCheckError=Ckr;var qEt=class extends o5i.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}};hne.TransformDecodeError=qEt;function Yd(t,e,r){try{return(0,uLe.IsTransform)(t)?t[i5i.TransformKind].Decode(r):r}catch(n){throw new qEt(t,e,r,n)}}a(Yd,"Default");function Poc(t,e,r,n){return(0,B6.IsArray)(n)?Yd(t,r,n.map((o,s)=>WD(t.items,e,`${r}/${s}`,o))):Yd(t,r,n)}a(Poc,"FromArray");function Doc(t,e,r,n){if(!(0,B6.IsObject)(n)||(0,B6.IsValueType)(n))return Yd(t,r,n);let o=(0,s5i.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=WD(h,e,`${r}/${f}`,c[f]));if(!(0,uLe.IsTransform)(t.unevaluatedProperties))return Yd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Yd(u,`${r}/${f}`,d[f]));return Yd(t,r,d)}a(Doc,"FromIntersect");function Noc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=WD(s,[...e,...o],r,n);return Yd(t,r,c)}a(Noc,"FromImport");function Moc(t,e,r,n){return Yd(t,r,WD(t.not,e,r,n))}a(Moc,"FromNot");function Ooc(t,e,r,n){if(!(0,B6.IsObject)(n))return Yd(t,r,n);let o=(0,s5i.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,B6.HasPropertyKey)(s,d)&&((0,B6.IsUndefined)(s[d])&&(!(0,uLe.IsUndefined)(t.properties[d])||Roc.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=WD(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,uLe.IsSchema)(t.additionalProperties))return Yd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=Yd(l,`${r}/${d}`,u[d]));return Yd(t,r,u)}a(Ooc,"FromObject");function Loc(t,e,r,n){if(!(0,B6.IsObject)(n))return Yd(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]=WD(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,uLe.IsSchema)(t.additionalProperties))return Yd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=Yd(u,`${r}/${f}`,d[f]));return Yd(t,r,d)}a(Loc,"FromRecord");function Boc(t,e,r,n){let o=(0,bkr.Deref)(t,e);return Yd(t,r,WD(o,e,r,n))}a(Boc,"FromRef");function Foc(t,e,r,n){let o=(0,bkr.Deref)(t,e);return Yd(t,r,WD(o,e,r,n))}a(Foc,"FromThis");function Uoc(t,e,r,n){return(0,B6.IsArray)(n)&&(0,B6.IsArray)(t.items)?Yd(t,r,t.items.map((o,s)=>WD(o,e,`${r}/${s}`,n[s]))):Yd(t,r,n)}a(Uoc,"FromTuple");function Qoc(t,e,r,n){for(let o of t.anyOf){if(!(0,koc.Check)(o,e,n))continue;let s=WD(o,e,r,n);return Yd(t,r,s)}return Yd(t,r,n)}a(Qoc,"FromUnion");function WD(t,e,r,n){let o=(0,bkr.Pushref)(t,e),s=t;switch(t[i5i.Kind]){case"Array":return Poc(s,o,r,n);case"Import":return Noc(s,o,r,n);case"Intersect":return Doc(s,o,r,n);case"Not":return Moc(s,o,r,n);case"Object":return Ooc(s,o,r,n);case"Record":return Loc(s,o,r,n);case"Ref":return Boc(s,o,r,n);case"Symbol":return Yd(s,r,n);case"This":return Foc(s,o,r,n);case"Tuple":return Uoc(s,o,r,n);case"Union":return Qoc(s,o,r,n);default:return Yd(s,r,n)}}a(WD,"Visit");function qoc(t,e,r){return WD(t,e,"",r)}a(qoc,"TransformDecode")});var f5i=I(mne=>{"use strict";p();Object.defineProperty(mne,"__esModule",{value:!0});mne.TransformEncodeError=mne.TransformEncodeCheckError=void 0;mne.TransformEncode=Xoc;var joc=T5e(),l5i=Sn(),u5i=Nf(),d5i=mD(),Tkr=qD(),c5i=iI(),P$=R0(),dLe=vs(),Skr=class extends u5i.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}};mne.TransformEncodeCheckError=Skr;var jEt=class extends u5i.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}};mne.TransformEncodeError=jEt;function yy(t,e,r){try{return(0,dLe.IsTransform)(t)?t[l5i.TransformKind].Encode(r):r}catch(n){throw new jEt(t,e,r,n)}}a(yy,"Default");function Hoc(t,e,r,n){let o=yy(t,r,n);return(0,P$.IsArray)(o)?o.map((s,c)=>zD(t.items,e,`${r}/${c}`,s)):o}a(Hoc,"FromArray");function Goc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=yy(t,r,n);return zD(s,[...e,...o],r,c)}a(Goc,"FromImport");function $oc(t,e,r,n){let o=yy(t,r,n);if(!(0,P$.IsObject)(n)||(0,P$.IsValueType)(n))return o;let s=(0,d5i.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=zD(m,e,`${r}/${h}`,l[h]));if(!(0,dLe.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]=yy(d,`${r}/${h}`,f[h]));return f}a($oc,"FromIntersect");function Voc(t,e,r,n){return yy(t.not,r,yy(t,r,n))}a(Voc,"FromNot");function Woc(t,e,r,n){let o=yy(t,r,n);if(!(0,P$.IsObject)(o))return o;let s=(0,d5i.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,P$.HasPropertyKey)(c,f)&&((0,P$.IsUndefined)(c[f])&&(!(0,dLe.IsUndefined)(t.properties[f])||joc.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=zD(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,dLe.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]=yy(u,`${r}/${f}`,d[f]));return d}a(Woc,"FromObject");function zoc(t,e,r,n){let o=yy(t,r,n);if(!(0,P$.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]=zD(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,dLe.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]=yy(d,`${r}/${h}`,f[h]));return f}a(zoc,"FromRecord");function Yoc(t,e,r,n){let o=(0,Tkr.Deref)(t,e),s=zD(o,e,r,n);return yy(t,r,s)}a(Yoc,"FromRef");function Koc(t,e,r,n){let o=(0,Tkr.Deref)(t,e),s=zD(o,e,r,n);return yy(t,r,s)}a(Koc,"FromThis");function Joc(t,e,r,n){let o=yy(t,r,n);return(0,P$.IsArray)(t.items)?t.items.map((s,c)=>zD(s,e,`${r}/${c}`,o[c])):[]}a(Joc,"FromTuple");function Zoc(t,e,r,n){for(let o of t.anyOf){if(!(0,c5i.Check)(o,e,n))continue;let s=zD(o,e,r,n);return yy(t,r,s)}for(let o of t.anyOf){let s=zD(o,e,r,n);if((0,c5i.Check)(t,e,s))return yy(t,r,s)}return yy(t,r,n)}a(Zoc,"FromUnion");function zD(t,e,r,n){let o=(0,Tkr.Pushref)(t,e),s=t;switch(t[l5i.Kind]){case"Array":return Hoc(s,o,r,n);case"Import":return Goc(s,o,r,n);case"Intersect":return $oc(s,o,r,n);case"Not":return Voc(s,o,r,n);case"Object":return Woc(s,o,r,n);case"Record":return zoc(s,o,r,n);case"Ref":return Yoc(s,o,r,n);case"This":return Koc(s,o,r,n);case"Tuple":return Joc(s,o,r,n);case"Union":return Zoc(s,o,r,n);default:return yy(s,r,n)}}a(zD,"Visit");function Xoc(t,e,r){return zD(t,e,"",r)}a(Xoc,"TransformEncode")});var p5i=I(wkr=>{"use strict";p();Object.defineProperty(wkr,"__esModule",{value:!0});wkr.HasTransform=Asc;var xkr=qD(),esc=Sn(),Rm=vs(),tsc=R0();function rsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(rsc,"FromArray");function nsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(nsc,"FromAsyncIterator");function isc(t,e){return(0,Rm.IsTransform)(t)||D0(t.returns,e)||t.parameters.some(r=>D0(r,e))}a(isc,"FromConstructor");function osc(t,e){return(0,Rm.IsTransform)(t)||D0(t.returns,e)||t.parameters.some(r=>D0(r,e))}a(osc,"FromFunction");function ssc(t,e){return(0,Rm.IsTransform)(t)||(0,Rm.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>D0(r,e))}a(ssc,"FromIntersect");function asc(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,Rm.IsTransform)(t)||D0(n,[...r,...e])}a(asc,"FromImport");function csc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(csc,"FromIterator");function lsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.not,e)}a(lsc,"FromNot");function usc(t,e){return(0,Rm.IsTransform)(t)||Object.values(t.properties).some(r=>D0(r,e))||(0,Rm.IsSchema)(t.additionalProperties)&&D0(t.additionalProperties,e)}a(usc,"FromObject");function dsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.item,e)}a(dsc,"FromPromise");function fsc(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,Rm.IsTransform)(t)||D0(n,e)||(0,Rm.IsSchema)(t.additionalProperties)&&(0,Rm.IsTransform)(t.additionalProperties)}a(fsc,"FromRecord");function psc(t,e){return(0,Rm.IsTransform)(t)?!0:D0((0,xkr.Deref)(t,e),e)}a(psc,"FromRef");function hsc(t,e){return(0,Rm.IsTransform)(t)?!0:D0((0,xkr.Deref)(t,e),e)}a(hsc,"FromThis");function msc(t,e){return(0,Rm.IsTransform)(t)||!(0,tsc.IsUndefined)(t.items)&&t.items.some(r=>D0(r,e))}a(msc,"FromTuple");function gsc(t,e){return(0,Rm.IsTransform)(t)||t.anyOf.some(r=>D0(r,e))}a(gsc,"FromUnion");function D0(t,e){let r=(0,xkr.Pushref)(t,e),n=t;if(t.$id&&Ikr.has(t.$id))return!1;switch(t.$id&&Ikr.add(t.$id),t[esc.Kind]){case"Array":return rsc(n,r);case"AsyncIterator":return nsc(n,r);case"Constructor":return isc(n,r);case"Function":return osc(n,r);case"Import":return asc(n,r);case"Intersect":return ssc(n,r);case"Iterator":return csc(n,r);case"Not":return lsc(n,r);case"Object":return usc(n,r);case"Promise":return dsc(n,r);case"Record":return fsc(n,r);case"Ref":return psc(n,r);case"This":return hsc(n,r);case"Tuple":return msc(n,r);case"Union":return gsc(n,r);default:return(0,Rm.IsTransform)(t)}}a(D0,"Visit");var Ikr=new Set;function Asc(t,e){return Ikr.clear(),D0(t,e)}a(Asc,"HasTransform")});var fLe=I(F6=>{"use strict";p();var ysc=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]})),Rkr=F6&&F6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ysc(e,t,r)};Object.defineProperty(F6,"__esModule",{value:!0});Rkr(a5i(),F6);Rkr(f5i(),F6);Rkr(p5i(),F6)});var h5i=I(Pkr=>{"use strict";p();Object.defineProperty(Pkr,"__esModule",{value:!0});Pkr.Decode=vsc;var kkr=fLe(),Esc=iI(),_sc=VAe();function vsc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,Esc.Check)(e,r,n))throw new kkr.TransformDecodeCheckError(e,n,(0,_sc.Errors)(e,r,n).First());return(0,kkr.HasTransform)(e,r)?(0,kkr.TransformDecode)(e,r,n):n}a(vsc,"Decode")});var Dkr=I(gne=>{"use strict";p();var Csc=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]})),bsc=gne&&gne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Csc(e,t,r)};Object.defineProperty(gne,"__esModule",{value:!0});bsc(h5i(),gne)});var g5i=I(Okr=>{"use strict";p();Object.defineProperty(Okr,"__esModule",{value:!0});Okr.Default=Bsc;var Ssc=iI(),m5i=HD(),Mkr=qD(),Tsc=Sn(),h1=R0(),Isc=vs();function U6(t,e){let r=(0,h1.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,h1.IsFunction)(r)?r():(0,m5i.Clone)(r);return(0,h1.IsUndefined)(e)?n:(0,h1.IsObject)(e)&&(0,h1.IsObject)(n)?Object.assign(n,e):e}a(U6,"ValueOrDefault");function Nkr(t){return(0,Isc.IsKind)(t)&&"default"in t}a(Nkr,"HasDefaultProperty");function xsc(t,e,r){if((0,h1.IsArray)(r)){for(let o=0;o{let c=Lv(s,e,n);return(0,h1.IsObject)(c)?{...o,...c}:c},{})}a(ksc,"FromIntersect");function Psc(t,e,r){let n=U6(t,r);if(!(0,h1.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=Lv(t.properties[s],e,n[s]);(0,h1.IsUndefined)(c)||(n[s]=Lv(t.properties[s],e,n[s]))}if(!Nkr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=Lv(t.additionalProperties,e,n[s]));return n}a(Psc,"FromObject");function Dsc(t,e,r){let n=U6(t,r);if(!(0,h1.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)&&Nkr(c)&&(n[u]=Lv(c,e,n[u]));if(!Nkr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=Lv(o,e,n[u]));return n}a(Dsc,"FromRecord");function Nsc(t,e,r){return Lv((0,Mkr.Deref)(t,e),e,U6(t,r))}a(Nsc,"FromRef");function Msc(t,e,r){return Lv((0,Mkr.Deref)(t,e),e,r)}a(Msc,"FromThis");function Osc(t,e,r){let n=U6(t,r);if(!(0,h1.IsArray)(n)||(0,h1.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 Fsc=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]})),Usc=Ane&&Ane.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Fsc(e,t,r)};Object.defineProperty(Ane,"__esModule",{value:!0});Usc(g5i(),Ane)});var E5i=I(YD=>{"use strict";p();Object.defineProperty(YD,"__esModule",{value:!0});YD.ValuePointerRootDeleteError=YD.ValuePointerRootSetError=void 0;YD.Format=pLe;YD.Set=Qsc;YD.Delete=qsc;YD.Has=jsc;YD.Get=Hsc;var y5i=Nf(),GEt=class extends y5i.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};YD.ValuePointerRootSetError=GEt;var $Et=class extends y5i.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};YD.ValuePointerRootDeleteError=$Et;function A5i(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(A5i,"Escape");function*pLe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var Gsc=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]})),$sc=cL&&cL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Vsc=cL&&cL.__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(Lkr,"__esModule",{value:!0});Lkr.Equal=WEt;var Q6=R0();function Wsc(t,e){if(!(0,Q6.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=>WEt(t[o],e[o]))}a(Wsc,"ObjectType");function zsc(t,e){return(0,Q6.IsDate)(e)&&t.getTime()===e.getTime()}a(zsc,"DateType");function Ysc(t,e){return!(0,Q6.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>WEt(r,e[n]))}a(Ysc,"ArrayType");function Ksc(t,e){return!(0,Q6.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>WEt(r,e[n]))}a(Ksc,"TypedArrayType");function Jsc(t,e){return t===e}a(Jsc,"ValueType");function WEt(t,e){if((0,Q6.IsDate)(t))return zsc(t,e);if((0,Q6.IsTypedArray)(t))return Ksc(t,e);if((0,Q6.IsArray)(t))return Ysc(t,e);if((0,Q6.IsObject)(t))return Wsc(t,e);if((0,Q6.IsValueType)(t))return Jsc(t,e);throw new Error("ValueEquals: Unable to compare value")}a(WEt,"Equal")});var S5i=I(Ey=>{"use strict";p();Object.defineProperty(Ey,"__esModule",{value:!0});Ey.ValueDiffError=Ey.Edit=Ey.Delete=Ey.Update=Ey.Insert=void 0;Ey.Diff=oac;Ey.Patch=cac;var lL=R0(),Fkr=VEt(),Ukr=HD(),Zsc=Bkr(),Xsc=Nf(),Qkr=UE(),qkr=xv(),jkr=QG(),v5i=VG(),eac=Ip();Ey.Insert=(0,qkr.Object)({type:(0,Qkr.Literal)("insert"),path:(0,jkr.String)(),value:(0,v5i.Unknown)()});Ey.Update=(0,qkr.Object)({type:(0,Qkr.Literal)("update"),path:(0,jkr.String)(),value:(0,v5i.Unknown)()});Ey.Delete=(0,qkr.Object)({type:(0,Qkr.Literal)("delete"),path:(0,jkr.String)()});Ey.Edit=(0,eac.Union)([Ey.Insert,Ey.Update,Ey.Delete]);var hLe=class extends Xsc.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};Ey.ValueDiffError=hLe;function zEt(t,e){return{type:"update",path:t,value:e}}a(zEt,"CreateUpdate");function C5i(t,e){return{type:"insert",path:t,value:e}}a(C5i,"CreateInsert");function b5i(t){return{type:"delete",path:t}}a(b5i,"CreateDelete");function _5i(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new hLe(t,"Cannot diff objects with symbols")}a(_5i,"AssertDiffable");function*tac(t,e,r){if(_5i(e),_5i(r),!(0,lL.IsStandardObject)(r))return yield zEt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,lL.HasPropertyKey)(e,s)||(yield C5i(`${t}/${s}`,r[s]));for(let s of n)(0,lL.HasPropertyKey)(r,s)&&((0,Zsc.Equal)(e,r)||(yield*YEt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,lL.HasPropertyKey)(r,s)||(yield b5i(`${t}/${s}`))}a(tac,"ObjectType");function*rac(t,e,r){if(!(0,lL.IsArray)(r))return yield zEt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(sac,"IsRootUpdate");function aac(t){return t.length===0}a(aac,"IsIdentity");function cac(t,e){if(sac(e))return(0,Ukr.Clone)(e[0].value);if(aac(e))return(0,Ukr.Clone)(t);let r=(0,Ukr.Clone)(t);for(let n of e)switch(n.type){case"insert":{Fkr.ValuePointer.Set(r,n.path,n.value);break}case"update":{Fkr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{Fkr.ValuePointer.Delete(r,n.path);break}}return r}a(cac,"Patch")});var Hkr=I(yne=>{"use strict";p();var lac=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]})),uac=yne&&yne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lac(e,t,r)};Object.defineProperty(yne,"__esModule",{value:!0});uac(S5i(),yne)});var T5i=I($kr=>{"use strict";p();Object.defineProperty($kr,"__esModule",{value:!0});$kr.Encode=pac;var Gkr=fLe(),dac=iI(),fac=VAe();function pac(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,Gkr.HasTransform)(e,r)?(0,Gkr.TransformEncode)(e,r,n):n;if(!(0,dac.Check)(e,r,o))throw new Gkr.TransformEncodeCheckError(e,o,(0,fac.Errors)(e,r,o).First());return o}a(pac,"Encode")});var Vkr=I(Ene=>{"use strict";p();var hac=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]})),mac=Ene&&Ene.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hac(e,t,r)};Object.defineProperty(Ene,"__esModule",{value:!0});mac(T5i(),Ene)});var Wkr=I(_ne=>{"use strict";p();var gac=_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]})),Aac=_ne&&_ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gac(e,t,r)};Object.defineProperty(_ne,"__esModule",{value:!0});Aac(Bkr(),_ne)});var x5i=I(gLe=>{"use strict";p();Object.defineProperty(gLe,"__esModule",{value:!0});gLe.ValueMutateError=void 0;gLe.Mutate=Sac;var KD=R0(),JEt=VEt(),zkr=HD(),yac=Nf();function KEt(t){return(0,KD.IsObject)(t)&&!(0,KD.IsArray)(t)}a(KEt,"IsStandardObject");var mLe=class extends yac.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};gLe.ValueMutateError=mLe;function Eac(t,e,r,n){if(!KEt(r))JEt.ValuePointer.Set(t,e,(0,zkr.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)Ykr(t,`${e}/${c}`,r[c],n[c])}}a(Eac,"ObjectType");function _ac(t,e,r,n){if(!(0,KD.IsArray)(r))JEt.ValuePointer.Set(t,e,(0,zkr.Clone)(n));else{for(let o=0;o{"use strict";p();var Tac=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]})),Iac=vne&&vne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tac(e,t,r)};Object.defineProperty(vne,"__esModule",{value:!0});Iac(x5i(),vne)});var R5i=I(JD=>{"use strict";p();Object.defineProperty(JD,"__esModule",{value:!0});JD.ParseDefault=JD.ParseRegistry=JD.ParseError=void 0;JD.Parse=Oac;var xac=Nf(),ZEt=fLe(),wac=DEt(),Rac=OEt(),kac=FEt(),Pac=HD(),Dac=QEt(),Nac=HEt(),w5i=R0(),ALe=class extends xac.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};JD.ParseError=ALe;var Jkr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,wac.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,Rac.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,kac.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,Pac.Clone)(l)],["Convert",(s,c,l)=>(0,Dac.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,ZEt.HasTransform)(s,c)?(0,ZEt.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,Nac.Default)(s,c,l)],["Encode",(s,c,l)=>(0,ZEt.HasTransform)(s,c)?(0,ZEt.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})(Jkr||(JD.ParseRegistry=Jkr={}));JD.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function Mac(t,e,r,n){return t.reduce((o,s)=>{let c=Jkr.Get(s);if((0,w5i.IsUndefined)(c))throw new ALe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(Mac,"ParseValue");function Oac(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,w5i.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[JD.ParseDefault,t[0],t[1],t[2]]:t.length===2?[JD.ParseDefault,t[0],[],t[1]]:(()=>{throw new ALe("Invalid Arguments")})();return Mac(e,r,n,o)}a(Oac,"Parse")});var Zkr=I(Cne=>{"use strict";p();var Lac=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]})),Bac=Cne&&Cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lac(e,t,r)};Object.defineProperty(Cne,"__esModule",{value:!0});Bac(R5i(),Cne)});var P5i=I(Cs=>{"use strict";p();Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Parse=Cs.Mutate=Cs.Hash=Cs.Equal=Cs.Encode=Cs.Edit=Cs.Patch=Cs.Diff=Cs.Default=Cs.Decode=Cs.Create=Cs.Convert=Cs.Clone=Cs.Clean=Cs.Check=Cs.Cast=Cs.Assert=Cs.ValueErrorIterator=Cs.Errors=void 0;var k5i=VAe();Object.defineProperty(Cs,"Errors",{enumerable:!0,get:a(function(){return k5i.Errors},"get")});Object.defineProperty(Cs,"ValueErrorIterator",{enumerable:!0,get:a(function(){return k5i.ValueErrorIterator},"get")});var Fac=DEt();Object.defineProperty(Cs,"Assert",{enumerable:!0,get:a(function(){return Fac.Assert},"get")});var Uac=OEt();Object.defineProperty(Cs,"Cast",{enumerable:!0,get:a(function(){return Uac.Cast},"get")});var Qac=iI();Object.defineProperty(Cs,"Check",{enumerable:!0,get:a(function(){return Qac.Check},"get")});var qac=FEt();Object.defineProperty(Cs,"Clean",{enumerable:!0,get:a(function(){return qac.Clean},"get")});var jac=HD();Object.defineProperty(Cs,"Clone",{enumerable:!0,get:a(function(){return jac.Clone},"get")});var Hac=QEt();Object.defineProperty(Cs,"Convert",{enumerable:!0,get:a(function(){return Hac.Convert},"get")});var Gac=NEt();Object.defineProperty(Cs,"Create",{enumerable:!0,get:a(function(){return Gac.Create},"get")});var $ac=Dkr();Object.defineProperty(Cs,"Decode",{enumerable:!0,get:a(function(){return $ac.Decode},"get")});var Vac=HEt();Object.defineProperty(Cs,"Default",{enumerable:!0,get:a(function(){return Vac.Default},"get")});var Xkr=Hkr();Object.defineProperty(Cs,"Diff",{enumerable:!0,get:a(function(){return Xkr.Diff},"get")});Object.defineProperty(Cs,"Patch",{enumerable:!0,get:a(function(){return Xkr.Patch},"get")});Object.defineProperty(Cs,"Edit",{enumerable:!0,get:a(function(){return Xkr.Edit},"get")});var Wac=Vkr();Object.defineProperty(Cs,"Encode",{enumerable:!0,get:a(function(){return Wac.Encode},"get")});var zac=Wkr();Object.defineProperty(Cs,"Equal",{enumerable:!0,get:a(function(){return zac.Equal},"get")});var Yac=Z4e();Object.defineProperty(Cs,"Hash",{enumerable:!0,get:a(function(){return Yac.Hash},"get")});var Kac=Kkr();Object.defineProperty(Cs,"Mutate",{enumerable:!0,get:a(function(){return Kac.Mutate},"get")});var Jac=Zkr();Object.defineProperty(Cs,"Parse",{enumerable:!0,get:a(function(){return Jac.Parse},"get")})});var D5i=I(uL=>{"use strict";p();var Zac=uL&&uL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xac=uL&&uL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ecc=uL&&uL.__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 tcc=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]})),Xg=Vc&&Vc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tcc(e,t,r)};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.Value=Vc.ValueErrorIterator=Vc.ValueErrorType=void 0;var N5i=VAe();Object.defineProperty(Vc,"ValueErrorType",{enumerable:!0,get:a(function(){return N5i.ValueErrorType},"get")});Object.defineProperty(Vc,"ValueErrorIterator",{enumerable:!0,get:a(function(){return N5i.ValueErrorIterator},"get")});Xg(R0(),Vc);Xg(DEt(),Vc);Xg(OEt(),Vc);Xg(iI(),Vc);Xg(FEt(),Vc);Xg(HD(),Vc);Xg(QEt(),Vc);Xg(NEt(),Vc);Xg(Dkr(),Vc);Xg(HEt(),Vc);Xg(Hkr(),Vc);Xg(Vkr(),Vc);Xg(Wkr(),Vc);Xg(Z4e(),Vc);Xg(Kkr(),Vc);Xg(Zkr(),Vc);Xg(VEt(),Vc);Xg(fLe(),Vc);var rcc=D5i();Object.defineProperty(Vc,"Value",{enumerable:!0,get:a(function(){return rcc.Value},"get")})});var O5i=I(XEt=>{"use strict";p();Object.defineProperty(XEt,"__esModule",{value:!0});XEt.assertShape=void 0;var M5i=ePr(),ncc=a((t,e)=>{if(M5i.Value.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...M5i.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");XEt.assertShape=ncc});var bne={};ki(bne,{CAPIClient:()=>lcc,RequestType:()=>B5i});async function acc(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 ccc(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 icc,tPr,yLe,occ,scc,B5i,lcc,Sne=ve(()=>{p();icc=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)}}},tPr=class L5i{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||L5i.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`}};tPr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",tPr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";yLe=tPr,occ=`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(itc,"applyEditsForNotebook");function otc(t,e,r){let n=t.get(Kec.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,Jec.getMaxSolutionTokens)(),c=(0,COi.getNumberOfSnippets)(e,r),l=(0,COi.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(otc,"getPromptOptions")});var IOi=I(w$=>{"use strict";p();Object.defineProperty(w$,"__esModule",{value:!0});w$.TypeSystem=w$.TypeSystemDuplicateFormat=w$.TypeSystemDuplicateTypeKind=void 0;var bEt=Gge(),stc=o4e(),atc=Sn(),TOi=Nf(),SEt=class extends TOi.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};w$.TypeSystemDuplicateTypeKind=SEt;var TEt=class extends TOi.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};w$.TypeSystemDuplicateFormat=TEt;var SOi;(function(t){function e(n,o){if(bEt.TypeRegistry.Has(n))throw new SEt(n);return bEt.TypeRegistry.Set(n,o),(s={})=>(0,stc.Unsafe)({...s,[atc.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(bEt.FormatRegistry.Has(n))throw new TEt(n);return bEt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(SOi||(w$.TypeSystem=SOi={}))});var ukr=I(R$=>{"use strict";p();var ctc=R$&&R$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xOi=R$&&R$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ctc(e,t,r)};Object.defineProperty(R$,"__esModule",{value:!0});xOi(x5e(),R$);xOi(IOi(),R$)});var dkr=I(Z4e=>{"use strict";p();Object.defineProperty(Z4e,"__esModule",{value:!0});Z4e.DefaultErrorFunction=wOi;Z4e.SetErrorFunction=utc;Z4e.GetErrorFunction=dtc;var ltc=Sn(),qn=fkr();function wOi(t){switch(t.errorType){case qn.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case qn.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case qn.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case qn.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case qn.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case qn.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case qn.ValueErrorType.Array:return"Expected array";case qn.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case qn.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.BigInt:return"Expected bigint";case qn.ValueErrorType.Boolean:return"Expected boolean";case qn.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case qn.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case qn.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case qn.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case qn.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case qn.ValueErrorType.Date:return"Expected Date";case qn.ValueErrorType.Function:return"Expected function";case qn.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.Integer:return"Expected integer";case qn.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case qn.ValueErrorType.Intersect:return"Expected all values to match";case qn.ValueErrorType.Iterator:return"Expected Iterator";case qn.ValueErrorType.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case qn.ValueErrorType.Never:return"Never";case qn.ValueErrorType.Not:return"Value should not match";case qn.ValueErrorType.Null:return"Expected null";case qn.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.Number:return"Expected number";case qn.ValueErrorType.Object:return"Expected object";case qn.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case qn.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case qn.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case qn.ValueErrorType.ObjectRequiredProperty:return"Expected required property";case qn.ValueErrorType.Promise:return"Expected Promise";case qn.ValueErrorType.RegExp:return"Expected string to match regular expression";case qn.ValueErrorType.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case qn.ValueErrorType.StringFormat:return`Expected string to match '${t.schema.format}' format`;case qn.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case qn.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case qn.ValueErrorType.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case qn.ValueErrorType.String:return"Expected string";case qn.ValueErrorType.Symbol:return"Expected symbol";case qn.ValueErrorType.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case qn.ValueErrorType.Tuple:return"Expected tuple";case qn.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case qn.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case qn.ValueErrorType.Uint8Array:return"Expected Uint8Array";case qn.ValueErrorType.Undefined:return"Expected undefined";case qn.ValueErrorType.Union:return"Expected union value";case qn.ValueErrorType.Void:return"Expected void";case qn.ValueErrorType.Kind:return`Expected kind '${t.schema[ltc.Kind]}'`;default:return"Unknown error type"}}a(wOi,"DefaultErrorFunction");var ROi=wOi;function utc(t){ROi=t}a(utc,"SetErrorFunction");function dtc(){return ROi}a(dtc,"GetErrorFunction")});var DOi=I(HAe=>{"use strict";p();Object.defineProperty(HAe,"__esModule",{value:!0});HAe.TypeDereferenceError=void 0;HAe.Pushref=mtc;HAe.Deref=POi;var ftc=Nf(),kOi=Sn(),ptc=_gt(),IEt=class extends ftc.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};HAe.TypeDereferenceError=IEt;function htc(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new IEt(t);return POi(r,e)}a(htc,"Resolve");function mtc(t,e){return!(0,ptc.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(mtc,"Pushref");function POi(t,e){return t[kOi.Kind]==="This"||t[kOi.Kind]==="Ref"?htc(t,e):t}a(POi,"Deref")});var jD=I(nne=>{"use strict";p();var gtc=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]})),Atc=nne&&nne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&>c(e,t,r)};Object.defineProperty(nne,"__esModule",{value:!0});Atc(DOi(),nne)});var LOi=I(X4e=>{"use strict";p();Object.defineProperty(X4e,"__esModule",{value:!0});X4e.ValueHashError=void 0;X4e.Hash=Mtc;var HD=R0(),ytc=Nf(),xEt=class extends ytc.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};X4e.ValueHashError=xEt;var oI;(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"})(oI||(oI={}));var GAe=BigInt("14695981039346656037"),[Etc,_tc]=[BigInt("1099511628211"),BigInt("18446744073709551616")],vtc=Array.from({length:256}).map((t,e)=>BigInt(e)),NOi=new Float64Array(1),MOi=new DataView(NOi.buffer),OOi=new Uint8Array(NOi.buffer);function*Ctc(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(Ctc,"NumberToBytes");function btc(t){GE(oI.Array);for(let e of t)$Ae(e)}a(btc,"ArrayType");function Stc(t){GE(oI.Boolean),GE(t?1:0)}a(Stc,"BooleanType");function Ttc(t){GE(oI.BigInt),MOi.setBigInt64(0,t);for(let e of OOi)GE(e)}a(Ttc,"BigIntType");function Itc(t){GE(oI.Date),$Ae(t.getTime())}a(Itc,"DateType");function xtc(t){GE(oI.Null)}a(xtc,"NullType");function wtc(t){GE(oI.Number),MOi.setFloat64(0,t);for(let e of OOi)GE(e)}a(wtc,"NumberType");function Rtc(t){GE(oI.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())$Ae(e),$Ae(t[e])}a(Rtc,"ObjectType");function ktc(t){GE(oI.String);for(let e=0;e{"use strict";p();var Otc=ine&&ine.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ltc=ine&&ine.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Otc(e,t,r)};Object.defineProperty(ine,"__esModule",{value:!0});Ltc(LOi(),ine)});var hkr=I(nLe=>{"use strict";p();Object.defineProperty(nLe,"__esModule",{value:!0});nLe.ValueCheckUnknownTypeError=void 0;nLe.Check=brc;var tLe=ukr(),pkr=jD(),Btc=eLe(),VAe=Sn(),BOi=gD(),Ftc=ure(),rLe=Gge(),Utc=Nf(),Qtc=Cm(),wm=R0(),qtc=vs(),wEt=class extends Utc.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};nLe.ValueCheckUnknownTypeError=wEt;function jtc(t){return t[VAe.Kind]==="Any"||t[VAe.Kind]==="Unknown"}a(jtc,"IsAnyOrUnknown");function ia(t){return t!==void 0}a(ia,"IsDefined");function Htc(t,e,r){return!0}a(Htc,"FromAny");function Gtc(t,e,r){return!0}a(Gtc,"FromArgument");function $tc(t,e,r){if(!(0,wm.IsArray)(r)||ia(t.minItems)&&!(r.length>=t.minItems)||ia(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Jg(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,Btc.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(ia(t.contains)||(0,wm.IsNumber)(t.minContains)||(0,wm.IsNumber)(t.maxContains)))return!0;let n=ia(t.contains)?t.contains:(0,Qtc.Never)(),o=r.reduce((s,c)=>Jg(n,e,c)?s+1:s,0);return!(o===0||(0,wm.IsNumber)(t.minContains)&&ot.maxContains)}a($tc,"FromArray");function Vtc(t,e,r){return(0,wm.IsAsyncIterator)(r)}a(Vtc,"FromAsyncIterator");function Wtc(t,e,r){return!(!(0,wm.IsBigInt)(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(Wtc,"FromBigInt");function ztc(t,e,r){return(0,wm.IsBoolean)(r)}a(ztc,"FromBoolean");function Ytc(t,e,r){return Jg(t.returns,e,r.prototype)}a(Ytc,"FromConstructor");function Ktc(t,e,r){return!(!(0,wm.IsDate)(r)||ia(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||ia(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||ia(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||ia(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(Ktc,"FromDate");function Jtc(t,e,r){return(0,wm.IsFunction)(r)}a(Jtc,"FromFunction");function Ztc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Jg(o,[...e,...n],r)}a(Ztc,"FromImport");function Xtc(t,e,r){return!(!(0,wm.IsInteger)(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.multipleOf)&&r%t.multipleOf!==0)}a(Xtc,"FromInteger");function erc(t,e,r){let n=t.allOf.every(o=>Jg(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,BOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,qtc.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,BOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Jg(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(erc,"FromIntersect");function trc(t,e,r){return(0,wm.IsIterator)(r)}a(trc,"FromIterator");function rrc(t,e,r){return r===t.const}a(rrc,"FromLiteral");function nrc(t,e,r){return!1}a(nrc,"FromNever");function irc(t,e,r){return!Jg(t.not,e,r)}a(irc,"FromNot");function orc(t,e,r){return(0,wm.IsNull)(r)}a(orc,"FromNull");function src(t,e,r){return!(!tLe.TypeSystemPolicy.IsNumberLike(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.multipleOf)&&r%t.multipleOf!==0)}a(src,"FromNumber");function arc(t,e,r){if(!tLe.TypeSystemPolicy.IsObjectLike(r)||ia(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ia(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(!Jg(s,e,r[o])||((0,Ftc.ExtendsUndefinedCheck)(s)||jtc(s))&&!(o in r))return!1}else if(tLe.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!Jg(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)||Jg(t.additionalProperties,e,r[s])):!0}a(arc,"FromObject");function crc(t,e,r){return(0,wm.IsPromise)(r)}a(crc,"FromPromise");function lrc(t,e,r){if(!tLe.TypeSystemPolicy.IsRecordLike(r)||ia(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ia(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)?Jg(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Jg(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(lrc,"FromRecord");function urc(t,e,r){return Jg((0,pkr.Deref)(t,e),e,r)}a(urc,"FromRef");function drc(t,e,r){let n=new RegExp(t.source,t.flags);return ia(t.minLength)&&!(r.length>=t.minLength)||ia(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(drc,"FromRegExp");function frc(t,e,r){return!(0,wm.IsString)(r)||ia(t.minLength)&&!(r.length>=t.minLength)||ia(t.maxLength)&&!(r.length<=t.maxLength)||ia(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:ia(t.format)?rLe.FormatRegistry.Has(t.format)?rLe.FormatRegistry.Get(t.format)(r):!1:!0}a(frc,"FromString");function prc(t,e,r){return(0,wm.IsSymbol)(r)}a(prc,"FromSymbol");function hrc(t,e,r){return(0,wm.IsString)(r)&&new RegExp(t.pattern).test(r)}a(hrc,"FromTemplateLiteral");function mrc(t,e,r){return Jg((0,pkr.Deref)(t,e),e,r)}a(mrc,"FromThis");function grc(t,e,r){if(!(0,wm.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nJg(n,e,r))}a(yrc,"FromUnion");function Erc(t,e,r){return!(!(0,wm.IsUint8Array)(r)||ia(t.maxByteLength)&&!(r.length<=t.maxByteLength)||ia(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Erc,"FromUint8Array");function _rc(t,e,r){return!0}a(_rc,"FromUnknown");function vrc(t,e,r){return tLe.TypeSystemPolicy.IsVoidLike(r)}a(vrc,"FromVoid");function Crc(t,e,r){return rLe.TypeRegistry.Has(t[VAe.Kind])?rLe.TypeRegistry.Get(t[VAe.Kind])(t,r):!1}a(Crc,"FromKind");function Jg(t,e,r){let n=ia(t.$id)?(0,pkr.Pushref)(t,e):e,o=t;switch(o[VAe.Kind]){case"Any":return Htc(o,n,r);case"Argument":return Gtc(o,n,r);case"Array":return $tc(o,n,r);case"AsyncIterator":return Vtc(o,n,r);case"BigInt":return Wtc(o,n,r);case"Boolean":return ztc(o,n,r);case"Constructor":return Ytc(o,n,r);case"Date":return Ktc(o,n,r);case"Function":return Jtc(o,n,r);case"Import":return Ztc(o,n,r);case"Integer":return Xtc(o,n,r);case"Intersect":return erc(o,n,r);case"Iterator":return trc(o,n,r);case"Literal":return rrc(o,n,r);case"Never":return nrc(o,n,r);case"Not":return irc(o,n,r);case"Null":return orc(o,n,r);case"Number":return src(o,n,r);case"Object":return arc(o,n,r);case"Promise":return crc(o,n,r);case"Record":return lrc(o,n,r);case"Ref":return urc(o,n,r);case"RegExp":return drc(o,n,r);case"String":return frc(o,n,r);case"Symbol":return prc(o,n,r);case"TemplateLiteral":return hrc(o,n,r);case"This":return mrc(o,n,r);case"Tuple":return grc(o,n,r);case"Undefined":return Arc(o,n,r);case"Union":return yrc(o,n,r);case"Uint8Array":return Erc(o,n,r);case"Unknown":return _rc(o,n,r);case"Void":return vrc(o,n,r);default:if(!rLe.TypeRegistry.Has(o[VAe.Kind]))throw new wEt(o);return Crc(o,n,r)}}a(Jg,"Visit");function brc(...t){return t.length===3?Jg(t[0],t[1],t[2]):Jg(t[0],[],t[1])}a(brc,"Check")});var sI=I(one=>{"use strict";p();var Src=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]})),Trc=one&&one.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Src(e,t,r)};Object.defineProperty(one,"__esModule",{value:!0});Trc(hkr(),one)});var fkr=I(L6=>{"use strict";p();Object.defineProperty(L6,"__esModule",{value:!0});L6.ValueErrorIterator=L6.ValueErrorsUnknownTypeError=L6.ValueErrorType=void 0;L6.Errors=fnc;var iLe=ukr(),FOi=gD(),REt=Gge(),Irc=x1r(),xrc=dkr(),wrc=Nf(),UOi=jD(),Rrc=eLe(),krc=sI(),mkr=Sn(),Prc=Cm(),Ah=R0(),tn;(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"})(tn||(L6.ValueErrorType=tn={}));var kEt=class extends wrc.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};L6.ValueErrorsUnknownTypeError=kEt;function O6(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(O6,"EscapeKey");function oa(t){return t!==void 0}a(oa,"IsDefined");var oLe=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}};L6.ValueErrorIterator=oLe;function cn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,xrc.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(cn,"Create");function*Drc(t,e,r,n){}a(Drc,"FromAny");function*Nrc(t,e,r,n){}a(Nrc,"FromArgument");function*Mrc(t,e,r,n){if(!(0,Ah.IsArray)(n))return yield cn(tn.Array,t,r,n);oa(t.minItems)&&!(n.length>=t.minItems)&&(yield cn(tn.ArrayMinItems,t,r,n)),oa(t.maxItems)&&!(n.length<=t.maxItems)&&(yield cn(tn.ArrayMaxItems,t,r,n));for(let c=0;cZg(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield cn(tn.ArrayContains,t,r,n)),(0,Ah.IsNumber)(t.minContains)&&st.maxContains&&(yield cn(tn.ArrayMaxContains,t,r,n))}a(Mrc,"FromArray");function*Orc(t,e,r,n){(0,Ah.IsAsyncIterator)(n)||(yield cn(tn.AsyncIterator,t,r,n))}a(Orc,"FromAsyncIterator");function*Lrc(t,e,r,n){if(!(0,Ah.IsBigInt)(n))return yield cn(tn.BigInt,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.BigIntExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.BigIntMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.BigIntMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield cn(tn.BigIntMultipleOf,t,r,n))}a(Lrc,"FromBigInt");function*Brc(t,e,r,n){(0,Ah.IsBoolean)(n)||(yield cn(tn.Boolean,t,r,n))}a(Brc,"FromBoolean");function*Frc(t,e,r,n){yield*Zg(t.returns,e,r,n.prototype)}a(Frc,"FromConstructor");function*Urc(t,e,r,n){if(!(0,Ah.IsDate)(n))return yield cn(tn.Date,t,r,n);oa(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield cn(tn.DateExclusiveMinimumTimestamp,t,r,n)),oa(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield cn(tn.DateMaximumTimestamp,t,r,n)),oa(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield cn(tn.DateMinimumTimestamp,t,r,n)),oa(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield cn(tn.DateMultipleOfTimestamp,t,r,n))}a(Urc,"FromDate");function*Qrc(t,e,r,n){(0,Ah.IsFunction)(n)||(yield cn(tn.Function,t,r,n))}a(Qrc,"FromFunction");function*qrc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Zg(s,[...e,...o],r,n)}a(qrc,"FromImport");function*jrc(t,e,r,n){if(!(0,Ah.IsInteger)(n))return yield cn(tn.Integer,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.IntegerExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.IntegerMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.IntegerMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.IntegerMultipleOf,t,r,n))}a(jrc,"FromInteger");function*Hrc(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Zg(s,e,r,n))o=!0,yield c;if(o)return yield cn(tn.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,FOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield cn(tn.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,FOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Zg(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(Hrc,"FromIntersect");function*Grc(t,e,r,n){(0,Ah.IsIterator)(n)||(yield cn(tn.Iterator,t,r,n))}a(Grc,"FromIterator");function*$rc(t,e,r,n){n!==t.const&&(yield cn(tn.Literal,t,r,n))}a($rc,"FromLiteral");function*Vrc(t,e,r,n){yield cn(tn.Never,t,r,n)}a(Vrc,"FromNever");function*Wrc(t,e,r,n){Zg(t.not,e,r,n).next().done===!0&&(yield cn(tn.Not,t,r,n))}a(Wrc,"FromNot");function*zrc(t,e,r,n){(0,Ah.IsNull)(n)||(yield cn(tn.Null,t,r,n))}a(zrc,"FromNull");function*Yrc(t,e,r,n){if(!iLe.TypeSystemPolicy.IsNumberLike(n))return yield cn(tn.Number,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.NumberExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.NumberMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.NumberMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.NumberMultipleOf,t,r,n))}a(Yrc,"FromNumber");function*Krc(t,e,r,n){if(!iLe.TypeSystemPolicy.IsObjectLike(n))return yield cn(tn.Object,t,r,n);oa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),oa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.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 cn(tn.ObjectRequiredProperty,t.properties[l],`${r}/${O6(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield cn(tn.ObjectAdditionalProperties,t,`${r}/${O6(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Zg(t.additionalProperties,e,`${r}/${O6(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Zg(u,e,`${r}/${O6(l)}`,n[l]),(0,Irc.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield cn(tn.ObjectRequiredProperty,u,`${r}/${O6(l)}`,void 0))):iLe.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*Zg(u,e,`${r}/${O6(l)}`,n[l]))}}a(Krc,"FromObject");function*Jrc(t,e,r,n){(0,Ah.IsPromise)(n)||(yield cn(tn.Promise,t,r,n))}a(Jrc,"FromPromise");function*Zrc(t,e,r,n){if(!iLe.TypeSystemPolicy.IsRecordLike(n))return yield cn(tn.Object,t,r,n);oa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),oa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.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*Zg(s,e,`${r}/${O6(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Zg(t.additionalProperties,e,`${r}/${O6(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield cn(tn.ObjectAdditionalProperties,t,`${r}/${O6(l)}`,u)}}a(Zrc,"FromRecord");function*Xrc(t,e,r,n){yield*Zg((0,UOi.Deref)(t,e),e,r,n)}a(Xrc,"FromRef");function*enc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);if(oa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),oa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield cn(tn.RegExp,t,r,n)}a(enc,"FromRegExp");function*tnc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);oa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),oa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),(0,Ah.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))),(0,Ah.IsString)(t.format)&&(REt.FormatRegistry.Has(t.format)?REt.FormatRegistry.Get(t.format)(n)||(yield cn(tn.StringFormat,t,r,n)):yield cn(tn.StringFormatUnknown,t,r,n))}a(tnc,"FromString");function*rnc(t,e,r,n){(0,Ah.IsSymbol)(n)||(yield cn(tn.Symbol,t,r,n))}a(rnc,"FromSymbol");function*nnc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))}a(nnc,"FromTemplateLiteral");function*inc(t,e,r,n){yield*Zg((0,UOi.Deref)(t,e),e,r,n)}a(inc,"FromThis");function*onc(t,e,r,n){if(!(0,Ah.IsArray)(n))return yield cn(tn.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield cn(tn.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield cn(tn.TupleLength,t,r,n);if(t.items)for(let o=0;onew oLe(Zg(s,e,r,n)));yield cn(tn.Union,t,r,n,o)}a(anc,"FromUnion");function*cnc(t,e,r,n){if(!(0,Ah.IsUint8Array)(n))return yield cn(tn.Uint8Array,t,r,n);oa(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield cn(tn.Uint8ArrayMaxByteLength,t,r,n)),oa(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield cn(tn.Uint8ArrayMinByteLength,t,r,n))}a(cnc,"FromUint8Array");function*lnc(t,e,r,n){}a(lnc,"FromUnknown");function*unc(t,e,r,n){iLe.TypeSystemPolicy.IsVoidLike(n)||(yield cn(tn.Void,t,r,n))}a(unc,"FromVoid");function*dnc(t,e,r,n){REt.TypeRegistry.Get(t[mkr.Kind])(t,n)||(yield cn(tn.Kind,t,r,n))}a(dnc,"FromKind");function*Zg(t,e,r,n){let o=oa(t.$id)?[...e,t]:e,s=t;switch(s[mkr.Kind]){case"Any":return yield*Drc(s,o,r,n);case"Argument":return yield*Nrc(s,o,r,n);case"Array":return yield*Mrc(s,o,r,n);case"AsyncIterator":return yield*Orc(s,o,r,n);case"BigInt":return yield*Lrc(s,o,r,n);case"Boolean":return yield*Brc(s,o,r,n);case"Constructor":return yield*Frc(s,o,r,n);case"Date":return yield*Urc(s,o,r,n);case"Function":return yield*Qrc(s,o,r,n);case"Import":return yield*qrc(s,o,r,n);case"Integer":return yield*jrc(s,o,r,n);case"Intersect":return yield*Hrc(s,o,r,n);case"Iterator":return yield*Grc(s,o,r,n);case"Literal":return yield*$rc(s,o,r,n);case"Never":return yield*Vrc(s,o,r,n);case"Not":return yield*Wrc(s,o,r,n);case"Null":return yield*zrc(s,o,r,n);case"Number":return yield*Yrc(s,o,r,n);case"Object":return yield*Krc(s,o,r,n);case"Promise":return yield*Jrc(s,o,r,n);case"Record":return yield*Zrc(s,o,r,n);case"Ref":return yield*Xrc(s,o,r,n);case"RegExp":return yield*enc(s,o,r,n);case"String":return yield*tnc(s,o,r,n);case"Symbol":return yield*rnc(s,o,r,n);case"TemplateLiteral":return yield*nnc(s,o,r,n);case"This":return yield*inc(s,o,r,n);case"Tuple":return yield*onc(s,o,r,n);case"Undefined":return yield*snc(s,o,r,n);case"Union":return yield*anc(s,o,r,n);case"Uint8Array":return yield*cnc(s,o,r,n);case"Unknown":return yield*lnc(s,o,r,n);case"Void":return yield*unc(s,o,r,n);default:if(!REt.TypeRegistry.Has(s[mkr.Kind]))throw new kEt(t);return yield*dnc(s,o,r,n)}}a(Zg,"Visit");function fnc(...t){let e=t.length===3?Zg(t[0],t[1],"",t[2]):Zg(t[0],[],"",t[1]);return new oLe(e)}a(fnc,"Errors")});var WAe=I(k$=>{"use strict";p();var pnc=k$&&k$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QOi=k$&&k$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pnc(e,t,r)};Object.defineProperty(k$,"__esModule",{value:!0});QOi(fkr(),k$);QOi(dkr(),k$)});var $Oi=I(B6=>{"use strict";p();var hnc=B6&&B6.__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},jOi=B6&&B6.__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)},gkr,PEt,HOi;Object.defineProperty(B6,"__esModule",{value:!0});B6.AssertError=void 0;B6.Assert=Anc;var GOi=WAe(),mnc=kCr(),gnc=hkr(),DEt=class extends mnc.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),gkr.add(this),PEt.set(this,void 0),hnc(this,PEt,e,"f"),this.error=r}Errors(){return new GOi.ValueErrorIterator(jOi(this,gkr,"m",HOi).call(this))}};B6.AssertError=DEt;PEt=new WeakMap,gkr=new WeakSet,HOi=a(function*(){this.error&&(yield this.error),yield*jOi(this,PEt,"f")},"_AssertError_Iterator");function qOi(t,e,r){if(!(0,gnc.Check)(t,e,r))throw new DEt((0,GOi.Errors)(t,e,r))}a(qOi,"AssertValue");function Anc(...t){return t.length===3?qOi(t[0],t[1],t[2]):qOi(t[0],[],t[1])}a(Anc,"Assert")});var NEt=I(sne=>{"use strict";p();var ync=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]})),Enc=sne&&sne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ync(e,t,r)};Object.defineProperty(sne,"__esModule",{value:!0});Enc($Oi(),sne)});var VOi=I(Akr=>{"use strict";p();Object.defineProperty(Akr,"__esModule",{value:!0});Akr.Clone=zAe;var ane=R0();function _nc(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=zAe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=zAe(t[r]);return e}a(_nc,"FromObject");function vnc(t){return t.map(e=>zAe(e))}a(vnc,"FromArray");function Cnc(t){return t.slice()}a(Cnc,"FromTypedArray");function bnc(t){return new Map(zAe([...t.entries()]))}a(bnc,"FromMap");function Snc(t){return new Set(zAe([...t.entries()]))}a(Snc,"FromSet");function Tnc(t){return new Date(t.toISOString())}a(Tnc,"FromDate");function zAe(t){if((0,ane.IsArray)(t))return vnc(t);if((0,ane.IsDate)(t))return Tnc(t);if((0,ane.IsTypedArray)(t))return Cnc(t);if((0,ane.IsMap)(t))return bnc(t);if((0,ane.IsSet)(t))return Snc(t);if((0,ane.IsObject)(t))return _nc(t);if((0,ane.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(zAe,"Clone")});var GD=I(cne=>{"use strict";p();var Inc=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]})),xnc=cne&&cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Inc(e,t,r)};Object.defineProperty(cne,"__esModule",{value:!0});xnc(VOi(),cne)});var KOi=I(sLe=>{"use strict";p();Object.defineProperty(sLe,"__esModule",{value:!0});sLe.ValueCreateError=void 0;sLe.Create=hic;var La=R0(),wnc=sI(),Rnc=GD(),ykr=jD(),WOi=hD(),knc=Gge(),zOi=Sn(),Pnc=Nf(),Dnc=_gt(),f1=class extends Pnc.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};sLe.ValueCreateError=f1;function Xa(t){return(0,Dnc.IsFunction)(t)?t():(0,Rnc.Clone)(t)}a(Xa,"FromDefault");function Nnc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(Nnc,"FromAny");function Mnc(t,e){return{}}a(Mnc,"FromArgument");function Onc(t,e){if(t.uniqueItems===!0&&!(0,La.HasPropertyKey)(t,"default"))throw new f1(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,La.HasPropertyKey)(t,"default"))throw new f1(t,"Array with the contains constraint requires a default value");return"default"in t?Xa(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>aI(t.items,e)):[]}a(Onc,"FromArray");function Lnc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):(async function*(){})()}a(Lnc,"FromAsyncIterator");function Bnc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):BigInt(0)}a(Bnc,"FromBigInt");function Fnc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):!1}a(Fnc,"FromBoolean");function Unc(t,e){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=aI(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(Unc,"FromConstructor");function Qnc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(Qnc,"FromDate");function qnc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):()=>aI(t.returns,e)}a(qnc,"FromFunction");function jnc(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return aI(n,[...e,...r])}a(jnc,"FromImport");function Hnc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):t.minimum!==void 0?t.minimum:0}a(Hnc,"FromInteger");function Gnc(t,e){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=t.allOf.reduce((n,o)=>{let s=aI(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,wnc.Check)(t,e,r))throw new f1(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(Gnc,"FromIntersect");function $nc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):(function*(){})()}a($nc,"FromIterator");function Vnc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):t.const}a(Vnc,"FromLiteral");function Wnc(t,e){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"Never types cannot be created. Consider using a default value.")}a(Wnc,"FromNever");function znc(t,e){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"Not types must have a default value")}a(znc,"FromNot");function Ync(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):null}a(Ync,"FromNull");function Knc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):t.minimum!==void 0?t.minimum:0}a(Knc,"FromNumber");function Jnc(t,e){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=aI(s,e));return n}}a(Jnc,"FromObject");function Znc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):Promise.resolve(aI(t.item,e))}a(Znc,"FromPromise");function Xnc(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(Xnc,"FromRecord");function eic(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):aI((0,ykr.Deref)(t,e),e)}a(eic,"FromRef");function tic(t,e){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"RegExp types cannot be created. Consider using a default value.")}a(tic,"FromRegExp");function ric(t,e){if(t.pattern!==void 0){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"String types with formats must specify a default value")}else return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(ric,"FromString");function nic(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(nic,"FromSymbol");function iic(t,e){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default);if(!(0,WOi.IsTemplateLiteralFinite)(t))throw new f1(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,WOi.TemplateLiteralGenerate)(t)[0]}a(iic,"FromTemplateLiteral");function oic(t,e){if(YOi++>pic)throw new f1(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):aI((0,ykr.Deref)(t,e),e)}a(oic,"FromThis");function sic(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>aI(t.items[n],e))}a(sic,"FromTuple");function aic(t,e){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default)}a(aic,"FromUndefined");function cic(t,e){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return aI(t.anyOf[0],e)}a(cic,"FromUnion");function lic(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(lic,"FromUint8Array");function uic(t,e){return(0,La.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(uic,"FromUnknown");function dic(t,e){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default)}a(dic,"FromVoid");function fic(t,e){if((0,La.HasPropertyKey)(t,"default"))return Xa(t.default);throw new Error("User defined types must specify a default value")}a(fic,"FromKind");function aI(t,e){let r=(0,ykr.Pushref)(t,e),n=t;switch(n[zOi.Kind]){case"Any":return Nnc(n,r);case"Argument":return Mnc(n,r);case"Array":return Onc(n,r);case"AsyncIterator":return Lnc(n,r);case"BigInt":return Bnc(n,r);case"Boolean":return Fnc(n,r);case"Constructor":return Unc(n,r);case"Date":return Qnc(n,r);case"Function":return qnc(n,r);case"Import":return jnc(n,r);case"Integer":return Hnc(n,r);case"Intersect":return Gnc(n,r);case"Iterator":return $nc(n,r);case"Literal":return Vnc(n,r);case"Never":return Wnc(n,r);case"Not":return znc(n,r);case"Null":return Ync(n,r);case"Number":return Knc(n,r);case"Object":return Jnc(n,r);case"Promise":return Znc(n,r);case"Record":return Xnc(n,r);case"Ref":return eic(n,r);case"RegExp":return tic(n,r);case"String":return ric(n,r);case"Symbol":return nic(n,r);case"TemplateLiteral":return iic(n,r);case"This":return oic(n,r);case"Tuple":return sic(n,r);case"Undefined":return aic(n,r);case"Union":return cic(n,r);case"Uint8Array":return lic(n,r);case"Unknown":return uic(n,r);case"Void":return dic(n,r);default:if(!knc.TypeRegistry.Has(n[zOi.Kind]))throw new f1(n,"Unknown type");return fic(n,r)}}a(aI,"Visit");var pic=512,YOi=0;function hic(...t){return YOi=0,t.length===2?aI(t[0],t[1]):aI(t[0],[])}a(hic,"Create")});var MEt=I(lne=>{"use strict";p();var mic=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]})),gic=lne&&lne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mic(e,t,r)};Object.defineProperty(lne,"__esModule",{value:!0});gic(KOi(),lne)});var e5i=I(lLe=>{"use strict";p();Object.defineProperty(lLe,"__esModule",{value:!0});lLe.ValueCastError=void 0;lLe.Cast=XOi;var qR=R0(),Aic=Nf(),OEt=Sn(),P$=MEt(),cI=sI(),une=GD(),cLe=jD(),aLe=class extends Aic.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};lLe.ValueCastError=aLe;function JOi(t,e,r){if(t[OEt.Kind]==="Object"&&typeof r=="object"&&!(0,qR.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[OEt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,cI.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[OEt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,cLe.Deref)(s,e)).map(s=>JOi(s,e,r));return Math.max(...o)}else return(0,cI.Check)(t,e,r)?1:0}a(JOi,"ScoreUnion");function yic(t,e,r){let n=t.anyOf.map(c=>(0,cLe.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=JOi(c,e,r);l>s&&(o=c,s=l)}return o}a(yic,"SelectUnion");function Eic(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,une.Clone)(t.default);{let n=yic(t,e,r);return XOi(n,e,r)}}a(Eic,"CastUnion");function _ic(t,e,r){return(0,cI.Check)(t,e,r)?(0,une.Clone)(r):(0,P$.Create)(t,e)}a(_ic,"DefaultClone");function vic(t,e,r){return(0,cI.Check)(t,e,r)?r:(0,P$.Create)(t,e)}a(vic,"Default");function Cic(t,e,r){if((0,cI.Check)(t,e,r))return(0,une.Clone)(r);let n=(0,qR.IsArray)(r)?(0,une.Clone)(r):(0,P$.Create)(t,e),o=(0,qR.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,qR.IsNumber)(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>$D(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!(0,cI.Check)(t,e,l))throw new aLe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(Cic,"FromArray");function bic(t,e,r){if((0,cI.Check)(t,e,r))return(0,P$.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]=$D(c,e,r.prototype[s]));return o}a(bic,"FromConstructor");function Sic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return $D(o,[...e,...n],r)}a(Sic,"FromImport");function ZOi(t,e){return(0,qR.IsObject)(t)&&!(0,qR.IsObject)(e)||!(0,qR.IsObject)(t)&&(0,qR.IsObject)(e)?t:!(0,qR.IsObject)(t)||!(0,qR.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?ZOi(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(ZOi,"IntersectAssign");function Tic(t,e,r){if((0,cI.Check)(t,e,r))return r;let n=(0,P$.Create)(t,e),o=ZOi(n,r);return(0,cI.Check)(t,e,o)?o:n}a(Tic,"FromIntersect");function Iic(t,e,r){throw new aLe(t,"Never types cannot be cast")}a(Iic,"FromNever");function xic(t,e,r){if((0,cI.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,P$.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]=$D(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]=$D(t.additionalProperties,e,r[c]))}return o}a(xic,"FromObject");function wic(t,e,r){if((0,cI.Check)(t,e,r))return(0,une.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,P$.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]=$D(o,e,l);return s}a(wic,"FromRecord");function Ric(t,e,r){return $D((0,cLe.Deref)(t,e),e,r)}a(Ric,"FromRef");function kic(t,e,r){return $D((0,cLe.Deref)(t,e),e,r)}a(kic,"FromThis");function Pic(t,e,r){return(0,cI.Check)(t,e,r)?(0,une.Clone)(r):(0,qR.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>$D(n,e,r[o])):(0,P$.Create)(t,e)}a(Pic,"FromTuple");function Dic(t,e,r){return(0,cI.Check)(t,e,r)?(0,une.Clone)(r):Eic(t,e,r)}a(Dic,"FromUnion");function $D(t,e,r){let n=(0,qR.IsString)(t.$id)?(0,cLe.Pushref)(t,e):e,o=t;switch(t[OEt.Kind]){case"Array":return Cic(o,n,r);case"Constructor":return bic(o,n,r);case"Import":return Sic(o,n,r);case"Intersect":return Tic(o,n,r);case"Never":return Iic(o,n,r);case"Object":return xic(o,n,r);case"Record":return wic(o,n,r);case"Ref":return Ric(o,n,r);case"This":return kic(o,n,r);case"Tuple":return Pic(o,n,r);case"Union":return Dic(o,n,r);case"Date":case"Symbol":case"Uint8Array":return _ic(t,e,r);default:return vic(o,n,r)}}a($D,"Visit");function XOi(...t){return t.length===3?$D(t[0],t[1],t[2]):$D(t[0],[],t[1])}a(XOi,"Cast")});var LEt=I(dne=>{"use strict";p();var Nic=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]})),Mic=dne&&dne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nic(e,t,r)};Object.defineProperty(dne,"__esModule",{value:!0});Mic(e5i(),dne)});var r5i=I(_kr=>{"use strict";p();Object.defineProperty(_kr,"__esModule",{value:!0});_kr.Clean=Wic;var Oic=gD(),BEt=sI(),Lic=GD(),Ekr=jD(),t5i=Sn(),VD=R0(),FEt=vs();function Bic(t){return(0,FEt.IsKind)(t)&&t[t5i.Kind]!=="Unsafe"}a(Bic,"IsCheckable");function Fic(t,e,r){return(0,VD.IsArray)(r)?r.map(n=>p1(t.items,e,n)):r}a(Fic,"FromArray");function Uic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return p1(o,[...e,...n],r)}a(Uic,"FromImport");function Qic(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>p1(l,e,(0,Lic.Clone)(r))).reduce((l,u)=>(0,VD.IsObject)(u)?{...l,...u}:u,{});if(!(0,VD.IsObject)(r)||!(0,VD.IsObject)(s)||!(0,FEt.IsKind)(n))return s;let c=(0,Oic.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,BEt.Check)(n,e,r[l])&&(s[l]=p1(n,e,r[l]));return s}a(Qic,"FromIntersect");function qic(t,e,r){if(!(0,VD.IsObject)(r)||(0,VD.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,VD.HasPropertyKey)(t.properties,o)){r[o]=p1(t.properties[o],e,r[o]);continue}if((0,FEt.IsKind)(n)&&(0,BEt.Check)(n,e,r[o])){r[o]=p1(n,e,r[o]);continue}delete r[o]}return r}a(qic,"FromObject");function jic(t,e,r){if(!(0,VD.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]=p1(c,e,r[u]);continue}if((0,FEt.IsKind)(n)&&(0,BEt.Check)(n,e,r[u])){r[u]=p1(n,e,r[u]);continue}delete r[u]}return r}a(jic,"FromRecord");function Hic(t,e,r){return p1((0,Ekr.Deref)(t,e),e,r)}a(Hic,"FromRef");function Gic(t,e,r){return p1((0,Ekr.Deref)(t,e),e,r)}a(Gic,"FromThis");function $ic(t,e,r){if(!(0,VD.IsArray)(r))return r;if((0,VD.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a($ic,"FromTuple");function Vic(t,e,r){for(let n of t.anyOf)if(Bic(n)&&(0,BEt.Check)(n,e,r))return p1(n,e,r);return r}a(Vic,"FromUnion");function p1(t,e,r){let n=(0,VD.IsString)(t.$id)?(0,Ekr.Pushref)(t,e):e,o=t;switch(o[t5i.Kind]){case"Array":return Fic(o,n,r);case"Import":return Uic(o,n,r);case"Intersect":return Qic(o,n,r);case"Object":return qic(o,n,r);case"Record":return jic(o,n,r);case"Ref":return Hic(o,n,r);case"This":return Gic(o,n,r);case"Tuple":return $ic(o,n,r);case"Union":return Vic(o,n,r);default:return r}}a(p1,"Visit");function Wic(...t){return t.length===3?p1(t[0],t[1],t[2]):p1(t[0],[],t[1])}a(Wic,"Clean")});var UEt=I(fne=>{"use strict";p();var zic=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]})),Yic=fne&&fne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zic(e,t,r)};Object.defineProperty(fne,"__esModule",{value:!0});Yic(r5i(),fne)});var a5i=I(Ckr=>{"use strict";p();Object.defineProperty(Ckr,"__esModule",{value:!0});Ckr.Convert=Doc;var Kic=GD(),n5i=sI(),vkr=jD(),Jic=Sn(),Ba=R0();function QEt(t){return(0,Ba.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(QEt,"IsStringNumeric");function Zic(t){return(0,Ba.IsBigInt)(t)||(0,Ba.IsBoolean)(t)||(0,Ba.IsNumber)(t)}a(Zic,"IsValueToString");function uLe(t){return t===!0||(0,Ba.IsNumber)(t)&&t===1||(0,Ba.IsBigInt)(t)&&t===BigInt("1")||(0,Ba.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(uLe,"IsValueTrue");function dLe(t){return t===!1||(0,Ba.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,Ba.IsBigInt)(t)&&t===BigInt("0")||(0,Ba.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(dLe,"IsValueFalse");function Xic(t){return(0,Ba.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(Xic,"IsTimeStringWithTimeZone");function eoc(t){return(0,Ba.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(eoc,"IsTimeStringWithoutTimeZone");function toc(t){return(0,Ba.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(toc,"IsDateTimeStringWithTimeZone");function roc(t){return(0,Ba.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(roc,"IsDateTimeStringWithoutTimeZone");function noc(t){return(0,Ba.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(noc,"IsDateString");function ioc(t,e){let r=o5i(t);return r===e?r:t}a(ioc,"TryConvertLiteralString");function ooc(t,e){let r=s5i(t);return r===e?r:t}a(ooc,"TryConvertLiteralNumber");function soc(t,e){let r=i5i(t);return r===e?r:t}a(soc,"TryConvertLiteralBoolean");function aoc(t,e){return(0,Ba.IsString)(t.const)?ioc(e,t.const):(0,Ba.IsNumber)(t.const)?ooc(e,t.const):(0,Ba.IsBoolean)(t.const)?soc(e,t.const):e}a(aoc,"TryConvertLiteral");function i5i(t){return uLe(t)?!0:dLe(t)?!1:t}a(i5i,"TryConvertBoolean");function coc(t){let e=a(r=>r.split(".")[0],"truncateInteger");return QEt(t)?BigInt(e(t)):(0,Ba.IsNumber)(t)?BigInt(Math.trunc(t)):dLe(t)?BigInt(0):uLe(t)?BigInt(1):t}a(coc,"TryConvertBigInt");function o5i(t){return(0,Ba.IsSymbol)(t)&&t.description!==void 0?t.description.toString():Zic(t)?t.toString():t}a(o5i,"TryConvertString");function s5i(t){return QEt(t)?parseFloat(t):uLe(t)?1:dLe(t)?0:t}a(s5i,"TryConvertNumber");function loc(t){return QEt(t)?parseInt(t):(0,Ba.IsNumber)(t)?Math.trunc(t):uLe(t)?1:dLe(t)?0:t}a(loc,"TryConvertInteger");function uoc(t){return(0,Ba.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(uoc,"TryConvertNull");function doc(t){return(0,Ba.IsString)(t)&&t==="undefined"?void 0:t}a(doc,"TryConvertUndefined");function foc(t){return(0,Ba.IsDate)(t)?t:(0,Ba.IsNumber)(t)?new Date(t):uLe(t)?new Date(1):dLe(t)?new Date(0):QEt(t)?new Date(parseInt(t)):eoc(t)?new Date(`1970-01-01T${t}.000Z`):Xic(t)?new Date(`1970-01-01T${t}`):roc(t)?new Date(`${t}.000Z`):toc(t)?new Date(t):noc(t)?new Date(`${t}T00:00:00.000Z`):t}a(foc,"TryConvertDate");function poc(t,e,r){return((0,Ba.IsArray)(r)?r:[r]).map(o=>WD(t.items,e,o))}a(poc,"FromArray");function hoc(t,e,r){return coc(r)}a(hoc,"FromBigInt");function moc(t,e,r){return i5i(r)}a(moc,"FromBoolean");function goc(t,e,r){return foc(r)}a(goc,"FromDate");function Aoc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return WD(o,[...e,...n],r)}a(Aoc,"FromImport");function yoc(t,e,r){return loc(r)}a(yoc,"FromInteger");function Eoc(t,e,r){return t.allOf.reduce((n,o)=>WD(o,e,n),r)}a(Eoc,"FromIntersect");function _oc(t,e,r){return aoc(t,r)}a(_oc,"FromLiteral");function voc(t,e,r){return uoc(r)}a(voc,"FromNull");function Coc(t,e,r){return s5i(r)}a(Coc,"FromNumber");function boc(t,e,r){if(!(0,Ba.IsObject)(r)||(0,Ba.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,Ba.HasPropertyKey)(r,n)&&(r[n]=WD(t.properties[n],e,r[n]));return r}a(boc,"FromObject");function Soc(t,e,r){if(!((0,Ba.IsObject)(r)&&!(0,Ba.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]=WD(s,e,l);return r}a(Soc,"FromRecord");function Toc(t,e,r){return WD((0,vkr.Deref)(t,e),e,r)}a(Toc,"FromRef");function Ioc(t,e,r){return o5i(r)}a(Ioc,"FromString");function xoc(t,e,r){return(0,Ba.IsString)(r)||(0,Ba.IsNumber)(r)?Symbol(r):r}a(xoc,"FromSymbol");function woc(t,e,r){return WD((0,vkr.Deref)(t,e),e,r)}a(woc,"FromThis");function Roc(t,e,r){return(0,Ba.IsArray)(r)&&!(0,Ba.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var Noc=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]})),Moc=pne&&pne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Noc(e,t,r)};Object.defineProperty(pne,"__esModule",{value:!0});Moc(a5i(),pne)});var d5i=I(hne=>{"use strict";p();Object.defineProperty(hne,"__esModule",{value:!0});hne.TransformDecodeError=hne.TransformDecodeCheckError=void 0;hne.TransformDecode=Woc;var Ooc=x5e(),c5i=Sn(),l5i=Nf(),u5i=gD(),Skr=jD(),Loc=sI(),F6=R0(),fLe=vs(),bkr=class extends l5i.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}};hne.TransformDecodeCheckError=bkr;var jEt=class extends l5i.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}};hne.TransformDecodeError=jEt;function Yd(t,e,r){try{return(0,fLe.IsTransform)(t)?t[c5i.TransformKind].Decode(r):r}catch(n){throw new jEt(t,e,r,n)}}a(Yd,"Default");function Boc(t,e,r,n){return(0,F6.IsArray)(n)?Yd(t,r,n.map((o,s)=>zD(t.items,e,`${r}/${s}`,o))):Yd(t,r,n)}a(Boc,"FromArray");function Foc(t,e,r,n){if(!(0,F6.IsObject)(n)||(0,F6.IsValueType)(n))return Yd(t,r,n);let o=(0,u5i.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=zD(h,e,`${r}/${f}`,c[f]));if(!(0,fLe.IsTransform)(t.unevaluatedProperties))return Yd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Yd(u,`${r}/${f}`,d[f]));return Yd(t,r,d)}a(Foc,"FromIntersect");function Uoc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=zD(s,[...e,...o],r,n);return Yd(t,r,c)}a(Uoc,"FromImport");function Qoc(t,e,r,n){return Yd(t,r,zD(t.not,e,r,n))}a(Qoc,"FromNot");function qoc(t,e,r,n){if(!(0,F6.IsObject)(n))return Yd(t,r,n);let o=(0,u5i.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,F6.HasPropertyKey)(s,d)&&((0,F6.IsUndefined)(s[d])&&(!(0,fLe.IsUndefined)(t.properties[d])||Ooc.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=zD(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,fLe.IsSchema)(t.additionalProperties))return Yd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=Yd(l,`${r}/${d}`,u[d]));return Yd(t,r,u)}a(qoc,"FromObject");function joc(t,e,r,n){if(!(0,F6.IsObject)(n))return Yd(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]=zD(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,fLe.IsSchema)(t.additionalProperties))return Yd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=Yd(u,`${r}/${f}`,d[f]));return Yd(t,r,d)}a(joc,"FromRecord");function Hoc(t,e,r,n){let o=(0,Skr.Deref)(t,e);return Yd(t,r,zD(o,e,r,n))}a(Hoc,"FromRef");function Goc(t,e,r,n){let o=(0,Skr.Deref)(t,e);return Yd(t,r,zD(o,e,r,n))}a(Goc,"FromThis");function $oc(t,e,r,n){return(0,F6.IsArray)(n)&&(0,F6.IsArray)(t.items)?Yd(t,r,t.items.map((o,s)=>zD(o,e,`${r}/${s}`,n[s]))):Yd(t,r,n)}a($oc,"FromTuple");function Voc(t,e,r,n){for(let o of t.anyOf){if(!(0,Loc.Check)(o,e,n))continue;let s=zD(o,e,r,n);return Yd(t,r,s)}return Yd(t,r,n)}a(Voc,"FromUnion");function zD(t,e,r,n){let o=(0,Skr.Pushref)(t,e),s=t;switch(t[c5i.Kind]){case"Array":return Boc(s,o,r,n);case"Import":return Uoc(s,o,r,n);case"Intersect":return Foc(s,o,r,n);case"Not":return Qoc(s,o,r,n);case"Object":return qoc(s,o,r,n);case"Record":return joc(s,o,r,n);case"Ref":return Hoc(s,o,r,n);case"Symbol":return Yd(s,r,n);case"This":return Goc(s,o,r,n);case"Tuple":return $oc(s,o,r,n);case"Union":return Voc(s,o,r,n);default:return Yd(s,r,n)}}a(zD,"Visit");function Woc(t,e,r){return zD(t,e,"",r)}a(Woc,"TransformDecode")});var g5i=I(mne=>{"use strict";p();Object.defineProperty(mne,"__esModule",{value:!0});mne.TransformEncodeError=mne.TransformEncodeCheckError=void 0;mne.TransformEncode=osc;var zoc=x5e(),p5i=Sn(),h5i=Nf(),m5i=gD(),Ikr=jD(),f5i=sI(),D$=R0(),pLe=vs(),Tkr=class extends h5i.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}};mne.TransformEncodeCheckError=Tkr;var HEt=class extends h5i.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}};mne.TransformEncodeError=HEt;function yy(t,e,r){try{return(0,pLe.IsTransform)(t)?t[p5i.TransformKind].Encode(r):r}catch(n){throw new HEt(t,e,r,n)}}a(yy,"Default");function Yoc(t,e,r,n){let o=yy(t,r,n);return(0,D$.IsArray)(o)?o.map((s,c)=>YD(t.items,e,`${r}/${c}`,s)):o}a(Yoc,"FromArray");function Koc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=yy(t,r,n);return YD(s,[...e,...o],r,c)}a(Koc,"FromImport");function Joc(t,e,r,n){let o=yy(t,r,n);if(!(0,D$.IsObject)(n)||(0,D$.IsValueType)(n))return o;let s=(0,m5i.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=YD(m,e,`${r}/${h}`,l[h]));if(!(0,pLe.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]=yy(d,`${r}/${h}`,f[h]));return f}a(Joc,"FromIntersect");function Zoc(t,e,r,n){return yy(t.not,r,yy(t,r,n))}a(Zoc,"FromNot");function Xoc(t,e,r,n){let o=yy(t,r,n);if(!(0,D$.IsObject)(o))return o;let s=(0,m5i.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,D$.HasPropertyKey)(c,f)&&((0,D$.IsUndefined)(c[f])&&(!(0,pLe.IsUndefined)(t.properties[f])||zoc.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=YD(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,pLe.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]=yy(u,`${r}/${f}`,d[f]));return d}a(Xoc,"FromObject");function esc(t,e,r,n){let o=yy(t,r,n);if(!(0,D$.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]=YD(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,pLe.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]=yy(d,`${r}/${h}`,f[h]));return f}a(esc,"FromRecord");function tsc(t,e,r,n){let o=(0,Ikr.Deref)(t,e),s=YD(o,e,r,n);return yy(t,r,s)}a(tsc,"FromRef");function rsc(t,e,r,n){let o=(0,Ikr.Deref)(t,e),s=YD(o,e,r,n);return yy(t,r,s)}a(rsc,"FromThis");function nsc(t,e,r,n){let o=yy(t,r,n);return(0,D$.IsArray)(t.items)?t.items.map((s,c)=>YD(s,e,`${r}/${c}`,o[c])):[]}a(nsc,"FromTuple");function isc(t,e,r,n){for(let o of t.anyOf){if(!(0,f5i.Check)(o,e,n))continue;let s=YD(o,e,r,n);return yy(t,r,s)}for(let o of t.anyOf){let s=YD(o,e,r,n);if((0,f5i.Check)(t,e,s))return yy(t,r,s)}return yy(t,r,n)}a(isc,"FromUnion");function YD(t,e,r,n){let o=(0,Ikr.Pushref)(t,e),s=t;switch(t[p5i.Kind]){case"Array":return Yoc(s,o,r,n);case"Import":return Koc(s,o,r,n);case"Intersect":return Joc(s,o,r,n);case"Not":return Zoc(s,o,r,n);case"Object":return Xoc(s,o,r,n);case"Record":return esc(s,o,r,n);case"Ref":return tsc(s,o,r,n);case"This":return rsc(s,o,r,n);case"Tuple":return nsc(s,o,r,n);case"Union":return isc(s,o,r,n);default:return yy(s,r,n)}}a(YD,"Visit");function osc(t,e,r){return YD(t,e,"",r)}a(osc,"TransformEncode")});var A5i=I(Rkr=>{"use strict";p();Object.defineProperty(Rkr,"__esModule",{value:!0});Rkr.HasTransform=bsc;var wkr=jD(),ssc=Sn(),Rm=vs(),asc=R0();function csc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(csc,"FromArray");function lsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(lsc,"FromAsyncIterator");function usc(t,e){return(0,Rm.IsTransform)(t)||D0(t.returns,e)||t.parameters.some(r=>D0(r,e))}a(usc,"FromConstructor");function dsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.returns,e)||t.parameters.some(r=>D0(r,e))}a(dsc,"FromFunction");function fsc(t,e){return(0,Rm.IsTransform)(t)||(0,Rm.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>D0(r,e))}a(fsc,"FromIntersect");function psc(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,Rm.IsTransform)(t)||D0(n,[...r,...e])}a(psc,"FromImport");function hsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(hsc,"FromIterator");function msc(t,e){return(0,Rm.IsTransform)(t)||D0(t.not,e)}a(msc,"FromNot");function gsc(t,e){return(0,Rm.IsTransform)(t)||Object.values(t.properties).some(r=>D0(r,e))||(0,Rm.IsSchema)(t.additionalProperties)&&D0(t.additionalProperties,e)}a(gsc,"FromObject");function Asc(t,e){return(0,Rm.IsTransform)(t)||D0(t.item,e)}a(Asc,"FromPromise");function ysc(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,Rm.IsTransform)(t)||D0(n,e)||(0,Rm.IsSchema)(t.additionalProperties)&&(0,Rm.IsTransform)(t.additionalProperties)}a(ysc,"FromRecord");function Esc(t,e){return(0,Rm.IsTransform)(t)?!0:D0((0,wkr.Deref)(t,e),e)}a(Esc,"FromRef");function _sc(t,e){return(0,Rm.IsTransform)(t)?!0:D0((0,wkr.Deref)(t,e),e)}a(_sc,"FromThis");function vsc(t,e){return(0,Rm.IsTransform)(t)||!(0,asc.IsUndefined)(t.items)&&t.items.some(r=>D0(r,e))}a(vsc,"FromTuple");function Csc(t,e){return(0,Rm.IsTransform)(t)||t.anyOf.some(r=>D0(r,e))}a(Csc,"FromUnion");function D0(t,e){let r=(0,wkr.Pushref)(t,e),n=t;if(t.$id&&xkr.has(t.$id))return!1;switch(t.$id&&xkr.add(t.$id),t[ssc.Kind]){case"Array":return csc(n,r);case"AsyncIterator":return lsc(n,r);case"Constructor":return usc(n,r);case"Function":return dsc(n,r);case"Import":return psc(n,r);case"Intersect":return fsc(n,r);case"Iterator":return hsc(n,r);case"Not":return msc(n,r);case"Object":return gsc(n,r);case"Promise":return Asc(n,r);case"Record":return ysc(n,r);case"Ref":return Esc(n,r);case"This":return _sc(n,r);case"Tuple":return vsc(n,r);case"Union":return Csc(n,r);default:return(0,Rm.IsTransform)(t)}}a(D0,"Visit");var xkr=new Set;function bsc(t,e){return xkr.clear(),D0(t,e)}a(bsc,"HasTransform")});var hLe=I(U6=>{"use strict";p();var Ssc=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]})),kkr=U6&&U6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ssc(e,t,r)};Object.defineProperty(U6,"__esModule",{value:!0});kkr(d5i(),U6);kkr(g5i(),U6);kkr(A5i(),U6)});var y5i=I(Dkr=>{"use strict";p();Object.defineProperty(Dkr,"__esModule",{value:!0});Dkr.Decode=xsc;var Pkr=hLe(),Tsc=sI(),Isc=WAe();function xsc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,Tsc.Check)(e,r,n))throw new Pkr.TransformDecodeCheckError(e,n,(0,Isc.Errors)(e,r,n).First());return(0,Pkr.HasTransform)(e,r)?(0,Pkr.TransformDecode)(e,r,n):n}a(xsc,"Decode")});var Nkr=I(gne=>{"use strict";p();var wsc=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]})),Rsc=gne&&gne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wsc(e,t,r)};Object.defineProperty(gne,"__esModule",{value:!0});Rsc(y5i(),gne)});var _5i=I(Lkr=>{"use strict";p();Object.defineProperty(Lkr,"__esModule",{value:!0});Lkr.Default=Hsc;var ksc=sI(),E5i=GD(),Okr=jD(),Psc=Sn(),h1=R0(),Dsc=vs();function Q6(t,e){let r=(0,h1.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,h1.IsFunction)(r)?r():(0,E5i.Clone)(r);return(0,h1.IsUndefined)(e)?n:(0,h1.IsObject)(e)&&(0,h1.IsObject)(n)?Object.assign(n,e):e}a(Q6,"ValueOrDefault");function Mkr(t){return(0,Dsc.IsKind)(t)&&"default"in t}a(Mkr,"HasDefaultProperty");function Nsc(t,e,r){if((0,h1.IsArray)(r)){for(let o=0;o{let c=Bv(s,e,n);return(0,h1.IsObject)(c)?{...o,...c}:c},{})}a(Lsc,"FromIntersect");function Bsc(t,e,r){let n=Q6(t,r);if(!(0,h1.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=Bv(t.properties[s],e,n[s]);(0,h1.IsUndefined)(c)||(n[s]=Bv(t.properties[s],e,n[s]))}if(!Mkr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=Bv(t.additionalProperties,e,n[s]));return n}a(Bsc,"FromObject");function Fsc(t,e,r){let n=Q6(t,r);if(!(0,h1.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)&&Mkr(c)&&(n[u]=Bv(c,e,n[u]));if(!Mkr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=Bv(o,e,n[u]));return n}a(Fsc,"FromRecord");function Usc(t,e,r){return Bv((0,Okr.Deref)(t,e),e,Q6(t,r))}a(Usc,"FromRef");function Qsc(t,e,r){return Bv((0,Okr.Deref)(t,e),e,r)}a(Qsc,"FromThis");function qsc(t,e,r){let n=Q6(t,r);if(!(0,h1.IsArray)(n)||(0,h1.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 Gsc=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]})),$sc=Ane&&Ane.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gsc(e,t,r)};Object.defineProperty(Ane,"__esModule",{value:!0});$sc(_5i(),Ane)});var b5i=I(KD=>{"use strict";p();Object.defineProperty(KD,"__esModule",{value:!0});KD.ValuePointerRootDeleteError=KD.ValuePointerRootSetError=void 0;KD.Format=mLe;KD.Set=Vsc;KD.Delete=Wsc;KD.Has=zsc;KD.Get=Ysc;var C5i=Nf(),$Et=class extends C5i.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};KD.ValuePointerRootSetError=$Et;var VEt=class extends C5i.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};KD.ValuePointerRootDeleteError=VEt;function v5i(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(v5i,"Escape");function*mLe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var Ksc=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]})),Jsc=cL&&cL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Zsc=cL&&cL.__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(Bkr,"__esModule",{value:!0});Bkr.Equal=zEt;var q6=R0();function Xsc(t,e){if(!(0,q6.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=>zEt(t[o],e[o]))}a(Xsc,"ObjectType");function eac(t,e){return(0,q6.IsDate)(e)&&t.getTime()===e.getTime()}a(eac,"DateType");function tac(t,e){return!(0,q6.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>zEt(r,e[n]))}a(tac,"ArrayType");function rac(t,e){return!(0,q6.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>zEt(r,e[n]))}a(rac,"TypedArrayType");function nac(t,e){return t===e}a(nac,"ValueType");function zEt(t,e){if((0,q6.IsDate)(t))return eac(t,e);if((0,q6.IsTypedArray)(t))return rac(t,e);if((0,q6.IsArray)(t))return tac(t,e);if((0,q6.IsObject)(t))return Xsc(t,e);if((0,q6.IsValueType)(t))return nac(t,e);throw new Error("ValueEquals: Unable to compare value")}a(zEt,"Equal")});var w5i=I(Ey=>{"use strict";p();Object.defineProperty(Ey,"__esModule",{value:!0});Ey.ValueDiffError=Ey.Edit=Ey.Delete=Ey.Update=Ey.Insert=void 0;Ey.Diff=dac;Ey.Patch=hac;var lL=R0(),Ukr=WEt(),Qkr=GD(),iac=Fkr(),oac=Nf(),qkr=UE(),jkr=wv(),Hkr=qG(),T5i=WG(),sac=Ip();Ey.Insert=(0,jkr.Object)({type:(0,qkr.Literal)("insert"),path:(0,Hkr.String)(),value:(0,T5i.Unknown)()});Ey.Update=(0,jkr.Object)({type:(0,qkr.Literal)("update"),path:(0,Hkr.String)(),value:(0,T5i.Unknown)()});Ey.Delete=(0,jkr.Object)({type:(0,qkr.Literal)("delete"),path:(0,Hkr.String)()});Ey.Edit=(0,sac.Union)([Ey.Insert,Ey.Update,Ey.Delete]);var gLe=class extends oac.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};Ey.ValueDiffError=gLe;function YEt(t,e){return{type:"update",path:t,value:e}}a(YEt,"CreateUpdate");function I5i(t,e){return{type:"insert",path:t,value:e}}a(I5i,"CreateInsert");function x5i(t){return{type:"delete",path:t}}a(x5i,"CreateDelete");function S5i(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new gLe(t,"Cannot diff objects with symbols")}a(S5i,"AssertDiffable");function*aac(t,e,r){if(S5i(e),S5i(r),!(0,lL.IsStandardObject)(r))return yield YEt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,lL.HasPropertyKey)(e,s)||(yield I5i(`${t}/${s}`,r[s]));for(let s of n)(0,lL.HasPropertyKey)(r,s)&&((0,iac.Equal)(e,r)||(yield*KEt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,lL.HasPropertyKey)(r,s)||(yield x5i(`${t}/${s}`))}a(aac,"ObjectType");function*cac(t,e,r){if(!(0,lL.IsArray)(r))return yield YEt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(fac,"IsRootUpdate");function pac(t){return t.length===0}a(pac,"IsIdentity");function hac(t,e){if(fac(e))return(0,Qkr.Clone)(e[0].value);if(pac(e))return(0,Qkr.Clone)(t);let r=(0,Qkr.Clone)(t);for(let n of e)switch(n.type){case"insert":{Ukr.ValuePointer.Set(r,n.path,n.value);break}case"update":{Ukr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{Ukr.ValuePointer.Delete(r,n.path);break}}return r}a(hac,"Patch")});var Gkr=I(yne=>{"use strict";p();var mac=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]})),gac=yne&&yne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mac(e,t,r)};Object.defineProperty(yne,"__esModule",{value:!0});gac(w5i(),yne)});var R5i=I(Vkr=>{"use strict";p();Object.defineProperty(Vkr,"__esModule",{value:!0});Vkr.Encode=Eac;var $kr=hLe(),Aac=sI(),yac=WAe();function Eac(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,$kr.HasTransform)(e,r)?(0,$kr.TransformEncode)(e,r,n):n;if(!(0,Aac.Check)(e,r,o))throw new $kr.TransformEncodeCheckError(e,o,(0,yac.Errors)(e,r,o).First());return o}a(Eac,"Encode")});var Wkr=I(Ene=>{"use strict";p();var _ac=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]})),vac=Ene&&Ene.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_ac(e,t,r)};Object.defineProperty(Ene,"__esModule",{value:!0});vac(R5i(),Ene)});var zkr=I(_ne=>{"use strict";p();var Cac=_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]})),bac=_ne&&_ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Cac(e,t,r)};Object.defineProperty(_ne,"__esModule",{value:!0});bac(Fkr(),_ne)});var P5i=I(yLe=>{"use strict";p();Object.defineProperty(yLe,"__esModule",{value:!0});yLe.ValueMutateError=void 0;yLe.Mutate=kac;var JD=R0(),ZEt=WEt(),Ykr=GD(),Sac=Nf();function JEt(t){return(0,JD.IsObject)(t)&&!(0,JD.IsArray)(t)}a(JEt,"IsStandardObject");var ALe=class extends Sac.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};yLe.ValueMutateError=ALe;function Tac(t,e,r,n){if(!JEt(r))ZEt.ValuePointer.Set(t,e,(0,Ykr.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)Kkr(t,`${e}/${c}`,r[c],n[c])}}a(Tac,"ObjectType");function Iac(t,e,r,n){if(!(0,JD.IsArray)(r))ZEt.ValuePointer.Set(t,e,(0,Ykr.Clone)(n));else{for(let o=0;o{"use strict";p();var Pac=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]})),Dac=vne&&vne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Pac(e,t,r)};Object.defineProperty(vne,"__esModule",{value:!0});Dac(P5i(),vne)});var N5i=I(ZD=>{"use strict";p();Object.defineProperty(ZD,"__esModule",{value:!0});ZD.ParseDefault=ZD.ParseRegistry=ZD.ParseError=void 0;ZD.Parse=qac;var Nac=Nf(),XEt=hLe(),Mac=NEt(),Oac=LEt(),Lac=UEt(),Bac=GD(),Fac=qEt(),Uac=GEt(),D5i=R0(),ELe=class extends Nac.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};ZD.ParseError=ELe;var Zkr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,Mac.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,Oac.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,Lac.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,Bac.Clone)(l)],["Convert",(s,c,l)=>(0,Fac.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,XEt.HasTransform)(s,c)?(0,XEt.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,Uac.Default)(s,c,l)],["Encode",(s,c,l)=>(0,XEt.HasTransform)(s,c)?(0,XEt.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})(Zkr||(ZD.ParseRegistry=Zkr={}));ZD.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function Qac(t,e,r,n){return t.reduce((o,s)=>{let c=Zkr.Get(s);if((0,D5i.IsUndefined)(c))throw new ELe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(Qac,"ParseValue");function qac(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,D5i.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[ZD.ParseDefault,t[0],t[1],t[2]]:t.length===2?[ZD.ParseDefault,t[0],[],t[1]]:(()=>{throw new ELe("Invalid Arguments")})();return Qac(e,r,n,o)}a(qac,"Parse")});var Xkr=I(Cne=>{"use strict";p();var jac=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]})),Hac=Cne&&Cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jac(e,t,r)};Object.defineProperty(Cne,"__esModule",{value:!0});Hac(N5i(),Cne)});var O5i=I(Cs=>{"use strict";p();Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Parse=Cs.Mutate=Cs.Hash=Cs.Equal=Cs.Encode=Cs.Edit=Cs.Patch=Cs.Diff=Cs.Default=Cs.Decode=Cs.Create=Cs.Convert=Cs.Clone=Cs.Clean=Cs.Check=Cs.Cast=Cs.Assert=Cs.ValueErrorIterator=Cs.Errors=void 0;var M5i=WAe();Object.defineProperty(Cs,"Errors",{enumerable:!0,get:a(function(){return M5i.Errors},"get")});Object.defineProperty(Cs,"ValueErrorIterator",{enumerable:!0,get:a(function(){return M5i.ValueErrorIterator},"get")});var Gac=NEt();Object.defineProperty(Cs,"Assert",{enumerable:!0,get:a(function(){return Gac.Assert},"get")});var $ac=LEt();Object.defineProperty(Cs,"Cast",{enumerable:!0,get:a(function(){return $ac.Cast},"get")});var Vac=sI();Object.defineProperty(Cs,"Check",{enumerable:!0,get:a(function(){return Vac.Check},"get")});var Wac=UEt();Object.defineProperty(Cs,"Clean",{enumerable:!0,get:a(function(){return Wac.Clean},"get")});var zac=GD();Object.defineProperty(Cs,"Clone",{enumerable:!0,get:a(function(){return zac.Clone},"get")});var Yac=qEt();Object.defineProperty(Cs,"Convert",{enumerable:!0,get:a(function(){return Yac.Convert},"get")});var Kac=MEt();Object.defineProperty(Cs,"Create",{enumerable:!0,get:a(function(){return Kac.Create},"get")});var Jac=Nkr();Object.defineProperty(Cs,"Decode",{enumerable:!0,get:a(function(){return Jac.Decode},"get")});var Zac=GEt();Object.defineProperty(Cs,"Default",{enumerable:!0,get:a(function(){return Zac.Default},"get")});var ePr=Gkr();Object.defineProperty(Cs,"Diff",{enumerable:!0,get:a(function(){return ePr.Diff},"get")});Object.defineProperty(Cs,"Patch",{enumerable:!0,get:a(function(){return ePr.Patch},"get")});Object.defineProperty(Cs,"Edit",{enumerable:!0,get:a(function(){return ePr.Edit},"get")});var Xac=Wkr();Object.defineProperty(Cs,"Encode",{enumerable:!0,get:a(function(){return Xac.Encode},"get")});var ecc=zkr();Object.defineProperty(Cs,"Equal",{enumerable:!0,get:a(function(){return ecc.Equal},"get")});var tcc=eLe();Object.defineProperty(Cs,"Hash",{enumerable:!0,get:a(function(){return tcc.Hash},"get")});var rcc=Jkr();Object.defineProperty(Cs,"Mutate",{enumerable:!0,get:a(function(){return rcc.Mutate},"get")});var ncc=Xkr();Object.defineProperty(Cs,"Parse",{enumerable:!0,get:a(function(){return ncc.Parse},"get")})});var L5i=I(uL=>{"use strict";p();var icc=uL&&uL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),occ=uL&&uL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),scc=uL&&uL.__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 acc=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]})),Xg=Vc&&Vc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&acc(e,t,r)};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.Value=Vc.ValueErrorIterator=Vc.ValueErrorType=void 0;var B5i=WAe();Object.defineProperty(Vc,"ValueErrorType",{enumerable:!0,get:a(function(){return B5i.ValueErrorType},"get")});Object.defineProperty(Vc,"ValueErrorIterator",{enumerable:!0,get:a(function(){return B5i.ValueErrorIterator},"get")});Xg(R0(),Vc);Xg(NEt(),Vc);Xg(LEt(),Vc);Xg(sI(),Vc);Xg(UEt(),Vc);Xg(GD(),Vc);Xg(qEt(),Vc);Xg(MEt(),Vc);Xg(Nkr(),Vc);Xg(GEt(),Vc);Xg(Gkr(),Vc);Xg(Wkr(),Vc);Xg(zkr(),Vc);Xg(eLe(),Vc);Xg(Jkr(),Vc);Xg(Xkr(),Vc);Xg(WEt(),Vc);Xg(hLe(),Vc);var ccc=L5i();Object.defineProperty(Vc,"Value",{enumerable:!0,get:a(function(){return ccc.Value},"get")})});var U5i=I(e_t=>{"use strict";p();Object.defineProperty(e_t,"__esModule",{value:!0});e_t.assertShape=void 0;var F5i=tPr(),lcc=a((t,e)=>{if(F5i.Value.Check(t,e))return e;let r=`Typebox schema validation failed: +${[...F5i.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` +`)}`;throw new Error(r)},"assertShape");e_t.assertShape=lcc});var bne={};ki(bne,{CAPIClient:()=>mcc,RequestType:()=>q5i});async function pcc(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 hcc(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 ucc,rPr,_Le,dcc,fcc,q5i,mcc,Sne=ve(()=>{p();ucc=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)}}},rPr=class Q5i{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||Q5i.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`}};rPr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",rPr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";_Le=rPr,dcc=`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. @@ -1069,52 +1069,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.`,scc=`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.`,fcc=`I have read and agree to the following license terms: -${occ} -`,B5i=(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))(B5i||{});a(acc,"v");a(ccc,"_");lcc=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===scc&&(this._licenseCheckSucceeded=!0),this._domainService=new yLe,this._fetcherService=r??new icc,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(`${yLe.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${yLe.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(`${yLe.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${yLe.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(!ccc(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 acc(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 _y=I(Bv=>{"use strict";p();Object.defineProperty(Bv,"__esModule",{value:!0});Bv.DestroyableStream=Bv.HeadersImpl=Bv.Response=Bv.NO_FETCH_TELEMETRY=Bv.IFetcherService=void 0;Bv.jsonVerboseError=dcc;Bv.isAbortError=F5i;Bv.safeGetHostname=fcc;var ucc=nn();Bv.IFetcherService=(0,ucc.createServiceIdentifier)("IFetcherService");Bv.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var rPr=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&&!F5i(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 e_t(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())}};Bv.Response=rPr;var nPr=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")}}};Bv.HeadersImpl=nPr;var e_t=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()}};Bv.DestroyableStream=e_t;async function dcc(t){let e=await t.text();try{return JSON.parse(e)}catch(r){let n=e.split(` +${dcc} +`,q5i=(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))(q5i||{});a(pcc,"v");a(hcc,"_");mcc=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===fcc&&(this._licenseCheckSucceeded=!0),this._domainService=new _Le,this._fetcherService=r??new ucc,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(`${_Le.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${_Le.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(`${_Le.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${_Le.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(!hcc(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 pcc(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 _y=I(Fv=>{"use strict";p();Object.defineProperty(Fv,"__esModule",{value:!0});Fv.DestroyableStream=Fv.HeadersImpl=Fv.Response=Fv.NO_FETCH_TELEMETRY=Fv.IFetcherService=void 0;Fv.jsonVerboseError=Acc;Fv.isAbortError=j5i;Fv.safeGetHostname=ycc;var gcc=nn();Fv.IFetcherService=(0,gcc.createServiceIdentifier)("IFetcherService");Fv.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var nPr=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&&!j5i(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 t_t(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())}};Fv.Response=nPr;var iPr=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")}}};Fv.HeadersImpl=iPr;var t_t=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()}};Fv.DestroyableStream=t_t;async function Acc(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(dcc,"jsonVerboseError");function F5i(t){return t&&t.name==="AbortError"}a(F5i,"isAbortError");function fcc(t){try{return new URL(t).hostname}catch{return"unknown"}}a(fcc,"safeGetHostname")});var U5i=I(zAe=>{"use strict";p();Object.defineProperty(zAe,"__esModule",{value:!0});zAe.INTEGRATION_ID=zAe.LICENSE_AGREEMENT=void 0;zAe.LICENSE_AGREEMENT=void 0;zAe.INTEGRATION_ID="code-oss"});var $E=I(YAe=>{"use strict";p();Object.defineProperty(YAe,"__esModule",{value:!0});YAe.ICAPIClientService=YAe.BaseCAPIClientService=void 0;var ELe=(Sne(),ba(bne)),pcc=nn(),hcc=_y(),mcc=U5i(),iPr=class extends ELe.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()},mcc.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===ELe.RequestType.Telemetry||r.type===ELe.RequestType.ChatCompletions||r.type===ELe.RequestType.ChatMessages||r.type===ELe.RequestType.ChatResponses)&&(e.callSite=hcc.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};YAe.BaseCAPIClientService=iPr;YAe.ICAPIClientService=(0,pcc.createServiceIdentifier)("ICAPIClientService")});var r_t=I(t_t=>{"use strict";p();Object.defineProperty(t_t,"__esModule",{value:!0});t_t.getEndpointUrl=vcc;t_t.getLastKnownEndpoints=Ccc;var gcc=FE(),Acc=$E(),D$=LE(),ycc=rne(),Ecc=o$();function q5i(t){let e=t.get(Acc.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(q5i,"getDefaultEndpoints");function Q5i(t,e,r){if(r!==void 0&&t.get(ycc.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,D$.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,D$.getConfig)(t,n);if(o)return o}}a(Q5i,"urlConfigOverride");function _cc(t,e){switch(e){case"proxy":return Q5i(t,[D$.ConfigKey.DebugOverrideProxyUrl,D$.ConfigKey.DebugOverrideProxyUrlLegacy],[D$.ConfigKey.DebugTestOverrideProxyUrl,D$.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!D$.BuildInfo.isProduction())return Q5i(t,[D$.ConfigKey.DebugSnippyOverrideUrl])}}a(_cc,"getEndpointOverrideUrl");function vcc(t,e,r,...n){let o=_cc(t,r)??(e.endpoints?e.endpoints[r]:void 0)??q5i(t)[r];return(0,Ecc.joinPath)(o,...n)}a(vcc,"getEndpointUrl");function Ccc(t){return t.get(gcc.IAuthenticationService).copilotToken?.endpoints??q5i(t)}a(Ccc,"getLastKnownEndpoints")});var sPr=I(_Le=>{"use strict";p();Object.defineProperty(_Le,"__esModule",{value:!0});_Le.Response=void 0;_Le.isAbortError=Scc;var bcc=_y();Object.defineProperty(_Le,"Response",{enumerable:!0,get:a(function(){return bcc.Response},"get")});var oPr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Scc(t){return!t||typeof t!="object"?!1:t instanceof oPr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Scc,"isAbortError")});var KAe=I(N0=>{"use strict";p();var Tcc=N0&&N0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Icc=N0&&N0.__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},xcc=N0&&N0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tcc(e,t,r)},aPr=N0&&N0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(N0,"__esModule",{value:!0});N0.Fetcher=N0.CompletionsFetcher=N0.ICompletionsFetcherService=void 0;N0.isInterruptedNetworkError=Pcc;xcc(sPr(),N0);var j5i=Pl(),wcc=_y(),Rcc=mh(),kcc=nn();N0.ICompletionsFetcherService=(0,kcc.createServiceIdentifier)("ICompletionsFetcherService");var cPr=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(j5i.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()}};N0.CompletionsFetcher=cPr;N0.CompletionsFetcher=cPr=Icc([aPr(0,j5i.IConfigurationService),aPr(1,wcc.IFetcherService),aPr(2,Rcc.IExperimentationService)],cPr);var lPr=class{static{a(this,"Fetcher")}getImplementation(){return this}};N0.Fetcher=lPr;function Pcc(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(Pcc,"isInterruptedNetworkError")});var H5i=I(JAe=>{"use strict";p();Object.defineProperty(JAe,"__esModule",{value:!0});JAe.FeatureName=JAe.OutputPaneShowCommand=void 0;JAe.OutputPaneShowCommand="codereferencing.showOutputPane2";JAe.FeatureName="code-referencing"});var vLe=I(n_t=>{"use strict";p();Object.defineProperty(n_t,"__esModule",{value:!0});n_t.codeReferenceLogger=void 0;var Dcc=Dl(),Ncc=H5i();n_t.codeReferenceLogger=new Dcc.Logger(Ncc.FeatureName)});var V5i=I(s_t=>{"use strict";p();Object.defineProperty(s_t,"__esModule",{value:!0});s_t.ConnectionState=void 0;var Mcc=Gs(),Occ=Dl(),Lcc=r_t(),Bcc=KAe(),CLe=vLe(),Fcc=3e3,uPr=2,G5i=256,$5i=Math.log(G5i)/Math.log(uPr)/uPr,ZD={connection:"disabled",maxAttempts:$5i,retryAttempts:0,initialWait:!1},i_t,o_t=[];function Ucc(){if(i_t)return i_t;function t(_){return o_t.push(_),()=>{let v=o_t.indexOf(_);v!==-1&&o_t.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of o_t)_()}a(e,"afterUpdateConnection");function r(_){ZD.connection!==_&&(ZD.connection=_,e())}a(r,"updateConnection");function n(){return ZD.connection==="connected"}a(n,"isConnected");function o(){return ZD.connection==="disconnected"}a(o,"isDisconnected");function s(){return ZD.connection==="retry"}a(s,"isRetrying");function c(){return ZD.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(_){ZD.initialWait!==_&&(ZD.initialWait=_)}a(h,"setInitialWait");function m(_,v=Fcc){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return ZD.initialWait}a(g,"isInitialWait");async function A(_,v){let b=_.get(Occ.ICompletionsLogTargetService),T=_.get(Bcc.ICompletionsFetcherService),w=_.get(Mcc.IInstantiationService);CLe.codeReferenceLogger.info(b,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>G5i){CLe.codeReferenceLogger.info(b,"Max retry time reached, disabling."),f();return}let P=a(async()=>{ZD.retryAttempts=Math.min(ZD.retryAttempts+1,$5i);try{CLe.codeReferenceLogger.info(b,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(Lcc.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{CLe.codeReferenceLogger.info(b,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{P()},x*1e3)}a(R,"succeedOrRetry"),CLe.codeReferenceLogger.info(b,"Attempting to reconnect."),R(uPr)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),i_t={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},i_t}a(Ucc,"registerConnectionState");s_t.ConnectionState=Ucc()});var z5i=I(eA=>{"use strict";p();Object.defineProperty(eA,"__esModule",{value:!0});eA.ErrorMessages=eA.ErrorReasons=void 0;eA.getErrorType=W5i;eA.createErrorResponse=Qcc;eA.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};eA.ErrorMessages={[eA.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[eA.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[eA.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function W5i(t){return t===401?eA.ErrorReasons.Unauthorized:t===400?eA.ErrorReasons.BadArguments:t===404?eA.ErrorReasons.NotFound:t===429?eA.ErrorReasons.RateLimit:t>=500&&t<600?eA.ErrorReasons.InternalError:t>=600?eA.ErrorReasons.ConnectionError:eA.ErrorReasons.Unknown}a(W5i,"getErrorType");function Qcc(t,e,r={}){return{kind:"failure",reason:W5i(Number(t)),code:Number(t),msg:e,meta:r}}a(Qcc,"createErrorResponse")});var mPr=I(dL=>{"use strict";p();Object.defineProperty(dL,"__esModule",{value:!0});dL.NoopTelemetryReporter=dL.snippyTelemetry=dL.matchNotificationTelemetry=dL.copilotOutputLogTelemetry=void 0;var qcc=Dl(),VE=$g(),jcc=vLe(),Hcc=/^[1-6][0-9][0-9]$/,Gcc=/([A-Z][a-z]+)/,$cc="code_referencing",ZAe=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[$cc,this.baseKey,...e].join(".")}},dPr=class extends ZAe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=VE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(VE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=VE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(VE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=VE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(VE.telemetry,n,r)}};dL.copilotOutputLogTelemetry=new dPr;var fPr=class extends ZAe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=VE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(VE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=VE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(VE.telemetry,o,n)}};dL.matchNotificationTelemetry=new fPr;var pPr=class extends ZAe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=VE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(VE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=VE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(VE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(Hcc)){e.invokeFunction(l=>jcc.codeReferenceLogger.debug(l.get(qcc.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(Gcc).filter(l=>!!l).join("_").toLowerCase(),c=VE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(VE.telemetryError,this.buildKey(s,r),c)}};dL.snippyTelemetry=new pPr;var hPr=class extends ZAe{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};dL.NoopTelemetryReporter=hPr});var Y5i=I(gPr=>{"use strict";p();Object.defineProperty(gPr,"__esModule",{value:!0});gPr.call=elc;var Vcc=Gs(),Wcc=Uge(),zcc=LE(),Ycc=Dl(),Kcc=r_t(),Jcc=KAe(),XAe=V5i(),yh=z5i(),Zcc=vLe(),Xcc=mPr();async function elc(t,e,r,n){let o,s=t.get(Ycc.ICompletionsLogTargetService),c=t.get(Vcc.IInstantiationService),l=t.get(Wcc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return XAe.ConnectionState.setDisconnected(),(0,yh.createErrorResponse)(401,yh.ErrorMessages[yh.ErrorReasons.Unauthorized])}if(Zcc.codeReferenceLogger.info(s,`Calling ${e}`),XAe.ConnectionState.isRetrying())return(0,yh.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(XAe.ConnectionState.isDisconnected())return(0,yh.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(_=>_.get(Jcc.ICompletionsFetcherService).fetch((0,Kcc.getEndpointUrl)(_,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,zcc.editorVersionHeaders)(_)},signal:n}))}catch{return c.invokeFunction(XAe.ConnectionState.enableRetry),(0,yh.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(_){let v=_.message;throw Xcc.snippyTelemetry.handleUnexpectedError({instantiationService:c,origin:"snippyNetwork",reason:v}),_}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,yh.getErrorType)(A),E=m||"unknown error";switch(y){case yh.ErrorReasons.Unauthorized:return(0,yh.createErrorResponse)(h,yh.ErrorMessages[yh.ErrorReasons.Unauthorized],g);case yh.ErrorReasons.BadArguments:return(0,yh.createErrorResponse)(h,E,g);case yh.ErrorReasons.RateLimit:return c.invokeFunction(_=>XAe.ConnectionState.enableRetry(_,60*1e3)),(0,yh.createErrorResponse)(h,yh.ErrorMessages.RateLimitError,g);case yh.ErrorReasons.InternalError:return c.invokeFunction(_=>XAe.ConnectionState.enableRetry(_)),(0,yh.createErrorResponse)(h,yh.ErrorMessages[yh.ErrorReasons.InternalError],g);default:return(0,yh.createErrorResponse)(h,E,g)}}a(elc,"call")});var APr=I(m1=>{"use strict";p();Object.defineProperty(m1,"__esModule",{value:!0});m1.FileMatchResponse=m1.FileMatchRequest=m1.MatchResponse=m1.MatchRequest=m1.MatchError=void 0;var Ea=DAt();m1.MatchError=Ea.Type.Object({kind:Ea.Type.Literal("failure"),reason:Ea.Type.String(),code:Ea.Type.Number(),msg:Ea.Type.String(),meta:Ea.Type.Optional(Ea.Type.Any())});var tlc=Ea.Type.Object({matched_source:Ea.Type.String(),occurrences:Ea.Type.String(),capped:Ea.Type.Boolean(),cursor:Ea.Type.String(),github_url:Ea.Type.String()});m1.MatchRequest=Ea.Type.Object({source:Ea.Type.String()});var rlc=Ea.Type.Object({snippets:Ea.Type.Array(tlc)});m1.MatchResponse=Ea.Type.Union([rlc,m1.MatchError]);m1.FileMatchRequest=Ea.Type.Object({cursor:Ea.Type.String()});var nlc=Ea.Type.Object({commit_id:Ea.Type.String(),license:Ea.Type.String(),nwo:Ea.Type.String(),path:Ea.Type.String(),url:Ea.Type.String()}),ilc=Ea.Type.Object({has_next_page:Ea.Type.Boolean(),cursor:Ea.Type.String()}),olc=Ea.Type.Object({count:Ea.Type.Record(Ea.Type.String(),Ea.Type.String())}),slc=Ea.Type.Object({file_matches:Ea.Type.Array(nlc),page_info:ilc,license_stats:olc});m1.FileMatchResponse=Ea.Type.Union([slc,m1.MatchError])});var X5i=I(fL=>{"use strict";p();var alc=fL&&fL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),clc=fL&&fL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K5i=fL&&fL.__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(q6,"__esModule",{value:!0});q6.MinTokenLength=void 0;q6.lexemeLength=e4i;q6.offsetLastLexemes=flc;q6.hasMinLexemeLength=plc;var bLe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");q6.MinTokenLength=65;function e4i(t){let e=0,r;bLe.lastIndex=0;do if(r=bLe.exec(t),r&&(e+=1),e>=q6.MinTokenLength)break;while(r);return e}a(e4i,"lexemeLength");function dlc(t,e){let r=0,n;bLe.lastIndex=0;do if(n=bLe.exec(t),n&&(r+=1,r>=e))return bLe.lastIndex;while(n);return t.length}a(dlc,"offsetFirstLexemes");function flc(t,e){let r=t.split("").reverse().join(""),n=dlc(r,e);return r.length-n}a(flc,"offsetLastLexemes");function plc(t){return e4i(t)>=q6.MinTokenLength}a(plc,"hasMinLexemeLength")});var a4i=I(j6=>{"use strict";p();var hlc=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]})),mlc=j6&&j6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o4i=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;on4i(E,()=>r4i.Match(E,f)));if(!h||i4i(h)||!h.snippets.length){yPr.codeReferenceLogger.info(s,"No match found");return}yPr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async E=>{let _=await o.invokeFunction(T=>n4i(T,()=>r4i.FilesForMatch(T,{cursor:E.cursor})));if(!_||i4i(_))return;let v=_.file_matches,b=_.license_stats;return{match:E,files:v,licenseStats:b}}),y=(await Promise.all(g)).filter(E=>E!==void 0);if(y.length)for(let E of y){let _=new Set(Object.keys(E.licenseStats?.count??{}));_.has("NOASSERTION")&&(_.delete("NOASSERTION"),_.add("unknown"));let v=Array.from(_).sort(),b=n,T=n+E.match.matched_source.length,w=u.positionAt(b),R=u.positionAt(T);await l.handleIPCodeCitation({inDocumentUri:e,offsetStart:b,offsetEnd:T,version:u.version,location:{start:w,end:R},matchingText:f,details:v.map(x=>({license:x,url:E.match.github_url}))})}}a(blc,"fetchCitations")});var p4i=I(N$=>{"use strict";p();Object.defineProperty(N$,"__esModule",{value:!0});N$.editDistance=l4i;N$.emptyLexDictionary=u4i;N$.reverseLexDictionary=d4i;N$.lexGeneratorWords=f4i;N$.lexicalAnalyzer=EPr;N$.lexEditDistance=Slc;function l4i(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(f4i,"lexGeneratorWords");function EPr(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(EPr,"lexicalAnalyzer");function c4i(t){return t!==" "}a(c4i,"notSingleSpace");function Slc(t,e,r=f4i){let[n,o]=EPr(t,u4i(),r,c4i),[s,c]=EPr(e,o,r,c4i);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=d4i(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 b=l[n[_][0]];return v===0&&b.endsWith(d)||v===u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=l4i(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(Slc,"lexEditDistance")});var _Pr=I(Tne=>{"use strict";p();Object.defineProperty(Tne,"__esModule",{value:!0});Tne.PartialAcceptTriggerKind=void 0;Tne.computeCompCharLen=Tlc;Tne.countLines=Ilc;Tne.computeCompletionText=xlc;var h4i;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(h4i||(Tne.PartialAcceptTriggerKind=h4i={}));function Tlc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(Tlc,"computeCompCharLen");function Ilc(t){return t.length===0?0:t.split(` -`).length}a(Ilc,"countLines");function xlc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(xlc,"computeCompletionText")});var S4i=I(d_t=>{"use strict";p();Object.defineProperty(d_t,"__esModule",{value:!0});d_t.postRejectionTasks=Ulc;d_t.postInsertionTasks=Qlc;var u_t=Gs(),A4i=bte(),wlc=Uge(),l_t=P2i(),Rlc=mgt(),klc=pIr(),y4i=LTr(),E4i=xAe(),tye=Dl(),m4i=gyt(),Plc=qAe(),Dlc=a4i(),g4i=p4i(),Nlc=_Pr(),M$=$g(),Mlc=s1(),_4i=_5e(),Olc=rne(),O$=new tye.Logger("postInsertion"),v4i=[{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}],C4i=50,Llc=1500,Blc=.5,Flc=500,vPr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function b4i(t,e,r,n,o){let s=t.get(u_t.IInstantiationService),c=t.get(tye.ICompletionsLogTargetService),l=await t.get(y4i.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return O$.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(Plc.extractPrompt,r.properties.headerRequestId,(0,klc.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,m4i.contextIndentationFromText)(f,n,u.detectedLanguageId),_=(0,m4i.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(_?_*2:Flc)),b=d.substring(n,v);return{prompt:g,capturedCode:b,terminationOffset:_??-1}}}a(b4i,"captureCode");function Ulc(t,e,r,n,o){let s=t.get(tye.ICompletionsLogTargetService),c=t.get(u_t.IInstantiationService),l=t.get(A4i.ICompletionsTelemetryService),u=t.get(_4i.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{O$.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(E4i.telemetryRejected,e,g)});let d=c.createInstance(l_t.ChangeTracker,n,r-1),f=c.createInstance(l_t.ChangeTracker,n,r),h=a(async m=>{O$.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:E}=await c.invokeFunction(b4i,n,g,d.offset+1,f.offset),_={hypotheticalPromptJson:JSON.stringify({prefix:A.prefix,context:A.context}),hypotheticalPromptSuffixJson:JSON.stringify(A.suffix)},v=g.extendedBy({..._,capturedCodeJson:JSON.stringify(y)},{timeout:m.seconds,insertionOffset:r,trackedOffset:d.offset,terminationOffsetInCapturedCode:E});O$.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(M$.telemetry,e+".capturedAfterRejected",v,M$.TelemetryStore.Enhanced)},"checkInCode");v4i.filter(m=>m.captureRejection).map(m=>d.push((0,M$.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(Ulc,"postRejectionTasks");function Qlc(t,e,r,n,o,s,c,l){let u=t.get(tye.ICompletionsLogTargetService),d=t.get(u_t.IInstantiationService),f=t.get(_4i.ICompletionsPromiseQueueService),h=t.get(A4i.ICompletionsTelemetryService),m=t.get(Olc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});O$.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(E4i.telemetryAccepted,e,g);let A=r;r=(0,Nlc.computeCompletionText)(r,c);let y=r.trim(),E=d.createInstance(l_t.ChangeTracker,o,n),_=d.createInstance(l_t.ChangeTracker,o,n+r.length),v=a(async b=>{await d.invokeFunction(Glc,e,y,n,o,b,g,E,_)},"stillInCodeCheck");if(vPr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let b=v({seconds:0,captureCode:vPr.captureCode,captureRejection:vPr.captureRejection});f.register(b)}else v4i.map(b=>E.push((0,M$.telemetryCatch)(h,f,()=>v(b),"postInsertionTasks"),b.seconds*1e3));d.invokeFunction(b=>(0,M$.telemetryCatch)(h,f,qlc,"post insertion citation check")(b,o,A,r,n,l))}a(Qlc,"postInsertionTasks");async function qlc(t,e,r,n,o,s){let c=t.get(tye.ICompletionsLogTargetService),l=t.get(Mlc.ICompletionsTextDocumentManagerService),u=t.get(wlc.ICompletionsCopilotTokenManager),d=t.get(Rlc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,Dlc.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=CPr(f.getText(),n,C4i,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=jlc(r.length,n.length,h.start_offset);if(m===void 0){O$.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+Hlc(r.length,n.length,h.stop_offset),E=f?.positionAt(y),_=A&&E?f?.getText({start:A,end:E}):"";await d.handleIPCodeCitation({inDocumentUri:e,offsetStart:g,offsetEnd:y,version:f?.version,location:A&&E?{start:A,end:E}:void 0,matchingText:_,details:h.details.citations})}}a(qlc,"citationCheck");function jlc(t,e,r){if(!(ee))return r}a(jlc,"computeCitationStart");function Hlc(t,e,r){return e{"use strict";p();Object.defineProperty(vy,"__esModule",{value:!0});vy.LastGhostText=vy.ICompletionsLastGhostText=void 0;vy.rejectLastShown=x4i;vy.setLastShown=zlc;vy.handleGhostTextShown=Ylc;vy.handleGhostTextPostInsert=Jlc;vy.handlePartialGhostTextPostInsert=Zlc;var $lc=nn(),T4i=Dl(),SPr=S4i(),f_t=_Pr(),I4i=a$(),TPr=xAe(),Vlc=new T4i.Logger("ghostText");vy.ICompletionsLastGhostText=(0,$lc.createServiceIdentifier)("ICompletionsLastGhostText");var bPr=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}};vy.LastGhostText=bPr;function Wlc(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(Wlc,"computeRejectedCompletions");function x4i(t,e){let r=t.get(vy.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=Wlc(r);n.length>0&&(0,SPr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(x4i,"rejectLastShown");function zlc(t,e,r,n){let o=t.get(vy.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==I4i.ResultType.TypingAsSuggested&&x4i(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(zlc,"setLastShown");function Ylc(t,e){let r=t.get(T4i.ICompletionsLogTargetService),n=t.get(vy.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!==I4i.ResultType.Network;Vlc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,TPr.telemetryShown)(t,e)}}a(Ylc,"handleGhostTextShown");function Klc(t,e,r){let n=t.get(vy.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,f_t.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,f_t.countLines)(e.displayText));let o=(0,f_t.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(Klc,"handleLineAcceptance");function Jlc(t,e){let r=t.get(vy.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,f_t.countLines)(e.displayText)},r.resetState(),(0,SPr.postInsertionTasks)(t,TPr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(Jlc,"handleGhostTextPostInsert");function Zlc(t,e,r){let n=t.get(vy.ICompletionsLastGhostText);Klc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,SPr.postInsertionTasks)(t,TPr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Zlc,"handlePartialGhostTextPostInsert")});var w4i=I(xPr=>{"use strict";p();Object.defineProperty(xPr,"__esModule",{value:!0});xPr.normalizeIndentCharacter=Xlc;function Xlc(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(Acc,"jsonVerboseError");function j5i(t){return t&&t.name==="AbortError"}a(j5i,"isAbortError");function ycc(t){try{return new URL(t).hostname}catch{return"unknown"}}a(ycc,"safeGetHostname")});var H5i=I(YAe=>{"use strict";p();Object.defineProperty(YAe,"__esModule",{value:!0});YAe.INTEGRATION_ID=YAe.LICENSE_AGREEMENT=void 0;YAe.LICENSE_AGREEMENT=void 0;YAe.INTEGRATION_ID="code-oss"});var $E=I(KAe=>{"use strict";p();Object.defineProperty(KAe,"__esModule",{value:!0});KAe.ICAPIClientService=KAe.BaseCAPIClientService=void 0;var vLe=(Sne(),Ca(bne)),Ecc=nn(),_cc=_y(),vcc=H5i(),oPr=class extends vLe.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()},vcc.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===vLe.RequestType.Telemetry||r.type===vLe.RequestType.ChatCompletions||r.type===vLe.RequestType.ChatMessages||r.type===vLe.RequestType.ChatResponses)&&(e.callSite=_cc.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};KAe.BaseCAPIClientService=oPr;KAe.ICAPIClientService=(0,Ecc.createServiceIdentifier)("ICAPIClientService")});var n_t=I(r_t=>{"use strict";p();Object.defineProperty(r_t,"__esModule",{value:!0});r_t.getEndpointUrl=xcc;r_t.getLastKnownEndpoints=wcc;var Ccc=FE(),bcc=$E(),N$=LE(),Scc=rne(),Tcc=s$();function $5i(t){let e=t.get(bcc.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a($5i,"getDefaultEndpoints");function G5i(t,e,r){if(r!==void 0&&t.get(Scc.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,N$.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,N$.getConfig)(t,n);if(o)return o}}a(G5i,"urlConfigOverride");function Icc(t,e){switch(e){case"proxy":return G5i(t,[N$.ConfigKey.DebugOverrideProxyUrl,N$.ConfigKey.DebugOverrideProxyUrlLegacy],[N$.ConfigKey.DebugTestOverrideProxyUrl,N$.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!N$.BuildInfo.isProduction())return G5i(t,[N$.ConfigKey.DebugSnippyOverrideUrl])}}a(Icc,"getEndpointOverrideUrl");function xcc(t,e,r,...n){let o=Icc(t,r)??(e.endpoints?e.endpoints[r]:void 0)??$5i(t)[r];return(0,Tcc.joinPath)(o,...n)}a(xcc,"getEndpointUrl");function wcc(t){return t.get(Ccc.IAuthenticationService).copilotToken?.endpoints??$5i(t)}a(wcc,"getLastKnownEndpoints")});var aPr=I(CLe=>{"use strict";p();Object.defineProperty(CLe,"__esModule",{value:!0});CLe.Response=void 0;CLe.isAbortError=kcc;var Rcc=_y();Object.defineProperty(CLe,"Response",{enumerable:!0,get:a(function(){return Rcc.Response},"get")});var sPr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function kcc(t){return!t||typeof t!="object"?!1:t instanceof sPr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(kcc,"isAbortError")});var JAe=I(N0=>{"use strict";p();var Pcc=N0&&N0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Dcc=N0&&N0.__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},Ncc=N0&&N0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Pcc(e,t,r)},cPr=N0&&N0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(N0,"__esModule",{value:!0});N0.Fetcher=N0.CompletionsFetcher=N0.ICompletionsFetcherService=void 0;N0.isInterruptedNetworkError=Bcc;Ncc(aPr(),N0);var V5i=Pl(),Mcc=_y(),Occ=mh(),Lcc=nn();N0.ICompletionsFetcherService=(0,Lcc.createServiceIdentifier)("ICompletionsFetcherService");var lPr=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(V5i.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()}};N0.CompletionsFetcher=lPr;N0.CompletionsFetcher=lPr=Dcc([cPr(0,V5i.IConfigurationService),cPr(1,Mcc.IFetcherService),cPr(2,Occ.IExperimentationService)],lPr);var uPr=class{static{a(this,"Fetcher")}getImplementation(){return this}};N0.Fetcher=uPr;function Bcc(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(Bcc,"isInterruptedNetworkError")});var W5i=I(ZAe=>{"use strict";p();Object.defineProperty(ZAe,"__esModule",{value:!0});ZAe.FeatureName=ZAe.OutputPaneShowCommand=void 0;ZAe.OutputPaneShowCommand="codereferencing.showOutputPane2";ZAe.FeatureName="code-referencing"});var bLe=I(i_t=>{"use strict";p();Object.defineProperty(i_t,"__esModule",{value:!0});i_t.codeReferenceLogger=void 0;var Fcc=Dl(),Ucc=W5i();i_t.codeReferenceLogger=new Fcc.Logger(Ucc.FeatureName)});var K5i=I(a_t=>{"use strict";p();Object.defineProperty(a_t,"__esModule",{value:!0});a_t.ConnectionState=void 0;var Qcc=Gs(),qcc=Dl(),jcc=n_t(),Hcc=JAe(),SLe=bLe(),Gcc=3e3,dPr=2,z5i=256,Y5i=Math.log(z5i)/Math.log(dPr)/dPr,XD={connection:"disabled",maxAttempts:Y5i,retryAttempts:0,initialWait:!1},o_t,s_t=[];function $cc(){if(o_t)return o_t;function t(_){return s_t.push(_),()=>{let v=s_t.indexOf(_);v!==-1&&s_t.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of s_t)_()}a(e,"afterUpdateConnection");function r(_){XD.connection!==_&&(XD.connection=_,e())}a(r,"updateConnection");function n(){return XD.connection==="connected"}a(n,"isConnected");function o(){return XD.connection==="disconnected"}a(o,"isDisconnected");function s(){return XD.connection==="retry"}a(s,"isRetrying");function c(){return XD.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(_){XD.initialWait!==_&&(XD.initialWait=_)}a(h,"setInitialWait");function m(_,v=Gcc){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return XD.initialWait}a(g,"isInitialWait");async function A(_,v){let b=_.get(qcc.ICompletionsLogTargetService),T=_.get(Hcc.ICompletionsFetcherService),w=_.get(Qcc.IInstantiationService);SLe.codeReferenceLogger.info(b,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>z5i){SLe.codeReferenceLogger.info(b,"Max retry time reached, disabling."),f();return}let P=a(async()=>{XD.retryAttempts=Math.min(XD.retryAttempts+1,Y5i);try{SLe.codeReferenceLogger.info(b,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(jcc.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{SLe.codeReferenceLogger.info(b,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{P()},x*1e3)}a(R,"succeedOrRetry"),SLe.codeReferenceLogger.info(b,"Attempting to reconnect."),R(dPr)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),o_t={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},o_t}a($cc,"registerConnectionState");a_t.ConnectionState=$cc()});var Z5i=I(eA=>{"use strict";p();Object.defineProperty(eA,"__esModule",{value:!0});eA.ErrorMessages=eA.ErrorReasons=void 0;eA.getErrorType=J5i;eA.createErrorResponse=Vcc;eA.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};eA.ErrorMessages={[eA.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[eA.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[eA.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function J5i(t){return t===401?eA.ErrorReasons.Unauthorized:t===400?eA.ErrorReasons.BadArguments:t===404?eA.ErrorReasons.NotFound:t===429?eA.ErrorReasons.RateLimit:t>=500&&t<600?eA.ErrorReasons.InternalError:t>=600?eA.ErrorReasons.ConnectionError:eA.ErrorReasons.Unknown}a(J5i,"getErrorType");function Vcc(t,e,r={}){return{kind:"failure",reason:J5i(Number(t)),code:Number(t),msg:e,meta:r}}a(Vcc,"createErrorResponse")});var gPr=I(dL=>{"use strict";p();Object.defineProperty(dL,"__esModule",{value:!0});dL.NoopTelemetryReporter=dL.snippyTelemetry=dL.matchNotificationTelemetry=dL.copilotOutputLogTelemetry=void 0;var Wcc=Dl(),VE=$g(),zcc=bLe(),Ycc=/^[1-6][0-9][0-9]$/,Kcc=/([A-Z][a-z]+)/,Jcc="code_referencing",XAe=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[Jcc,this.baseKey,...e].join(".")}},fPr=class extends XAe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=VE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(VE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=VE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(VE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=VE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(VE.telemetry,n,r)}};dL.copilotOutputLogTelemetry=new fPr;var pPr=class extends XAe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=VE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(VE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=VE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(VE.telemetry,o,n)}};dL.matchNotificationTelemetry=new pPr;var hPr=class extends XAe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=VE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(VE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=VE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(VE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(Ycc)){e.invokeFunction(l=>zcc.codeReferenceLogger.debug(l.get(Wcc.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(Kcc).filter(l=>!!l).join("_").toLowerCase(),c=VE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(VE.telemetryError,this.buildKey(s,r),c)}};dL.snippyTelemetry=new hPr;var mPr=class extends XAe{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};dL.NoopTelemetryReporter=mPr});var X5i=I(APr=>{"use strict";p();Object.defineProperty(APr,"__esModule",{value:!0});APr.call=slc;var Zcc=Gs(),Xcc=Qge(),elc=LE(),tlc=Dl(),rlc=n_t(),nlc=JAe(),eye=K5i(),yh=Z5i(),ilc=bLe(),olc=gPr();async function slc(t,e,r,n){let o,s=t.get(tlc.ICompletionsLogTargetService),c=t.get(Zcc.IInstantiationService),l=t.get(Xcc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return eye.ConnectionState.setDisconnected(),(0,yh.createErrorResponse)(401,yh.ErrorMessages[yh.ErrorReasons.Unauthorized])}if(ilc.codeReferenceLogger.info(s,`Calling ${e}`),eye.ConnectionState.isRetrying())return(0,yh.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(eye.ConnectionState.isDisconnected())return(0,yh.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(_=>_.get(nlc.ICompletionsFetcherService).fetch((0,rlc.getEndpointUrl)(_,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,elc.editorVersionHeaders)(_)},signal:n}))}catch{return c.invokeFunction(eye.ConnectionState.enableRetry),(0,yh.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(_){let v=_.message;throw olc.snippyTelemetry.handleUnexpectedError({instantiationService:c,origin:"snippyNetwork",reason:v}),_}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,yh.getErrorType)(A),E=m||"unknown error";switch(y){case yh.ErrorReasons.Unauthorized:return(0,yh.createErrorResponse)(h,yh.ErrorMessages[yh.ErrorReasons.Unauthorized],g);case yh.ErrorReasons.BadArguments:return(0,yh.createErrorResponse)(h,E,g);case yh.ErrorReasons.RateLimit:return c.invokeFunction(_=>eye.ConnectionState.enableRetry(_,60*1e3)),(0,yh.createErrorResponse)(h,yh.ErrorMessages.RateLimitError,g);case yh.ErrorReasons.InternalError:return c.invokeFunction(_=>eye.ConnectionState.enableRetry(_)),(0,yh.createErrorResponse)(h,yh.ErrorMessages[yh.ErrorReasons.InternalError],g);default:return(0,yh.createErrorResponse)(h,E,g)}}a(slc,"call")});var yPr=I(m1=>{"use strict";p();Object.defineProperty(m1,"__esModule",{value:!0});m1.FileMatchResponse=m1.FileMatchRequest=m1.MatchResponse=m1.MatchRequest=m1.MatchError=void 0;var ya=NAt();m1.MatchError=ya.Type.Object({kind:ya.Type.Literal("failure"),reason:ya.Type.String(),code:ya.Type.Number(),msg:ya.Type.String(),meta:ya.Type.Optional(ya.Type.Any())});var alc=ya.Type.Object({matched_source:ya.Type.String(),occurrences:ya.Type.String(),capped:ya.Type.Boolean(),cursor:ya.Type.String(),github_url:ya.Type.String()});m1.MatchRequest=ya.Type.Object({source:ya.Type.String()});var clc=ya.Type.Object({snippets:ya.Type.Array(alc)});m1.MatchResponse=ya.Type.Union([clc,m1.MatchError]);m1.FileMatchRequest=ya.Type.Object({cursor:ya.Type.String()});var llc=ya.Type.Object({commit_id:ya.Type.String(),license:ya.Type.String(),nwo:ya.Type.String(),path:ya.Type.String(),url:ya.Type.String()}),ulc=ya.Type.Object({has_next_page:ya.Type.Boolean(),cursor:ya.Type.String()}),dlc=ya.Type.Object({count:ya.Type.Record(ya.Type.String(),ya.Type.String())}),flc=ya.Type.Object({file_matches:ya.Type.Array(llc),page_info:ulc,license_stats:dlc});m1.FileMatchResponse=ya.Type.Union([flc,m1.MatchError])});var n4i=I(fL=>{"use strict";p();var plc=fL&&fL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hlc=fL&&fL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),e4i=fL&&fL.__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(j6,"__esModule",{value:!0});j6.MinTokenLength=void 0;j6.lexemeLength=i4i;j6.offsetLastLexemes=ylc;j6.hasMinLexemeLength=Elc;var TLe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");j6.MinTokenLength=65;function i4i(t){let e=0,r;TLe.lastIndex=0;do if(r=TLe.exec(t),r&&(e+=1),e>=j6.MinTokenLength)break;while(r);return e}a(i4i,"lexemeLength");function Alc(t,e){let r=0,n;TLe.lastIndex=0;do if(n=TLe.exec(t),n&&(r+=1,r>=e))return TLe.lastIndex;while(n);return t.length}a(Alc,"offsetFirstLexemes");function ylc(t,e){let r=t.split("").reverse().join(""),n=Alc(r,e);return r.length-n}a(ylc,"offsetLastLexemes");function Elc(t){return i4i(t)>=j6.MinTokenLength}a(Elc,"hasMinLexemeLength")});var d4i=I(H6=>{"use strict";p();var _lc=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]})),vlc=H6&&H6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),l4i=H6&&H6.__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;oa4i(E,()=>s4i.Match(E,f)));if(!h||c4i(h)||!h.snippets.length){EPr.codeReferenceLogger.info(s,"No match found");return}EPr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async E=>{let _=await o.invokeFunction(T=>a4i(T,()=>s4i.FilesForMatch(T,{cursor:E.cursor})));if(!_||c4i(_))return;let v=_.file_matches,b=_.license_stats;return{match:E,files:v,licenseStats:b}}),y=(await Promise.all(g)).filter(E=>E!==void 0);if(y.length)for(let E of y){let _=new Set(Object.keys(E.licenseStats?.count??{}));_.has("NOASSERTION")&&(_.delete("NOASSERTION"),_.add("unknown"));let v=Array.from(_).sort(),b=n,T=n+E.match.matched_source.length,w=u.positionAt(b),R=u.positionAt(T);await l.handleIPCodeCitation({inDocumentUri:e,offsetStart:b,offsetEnd:T,version:u.version,location:{start:w,end:R},matchingText:f,details:v.map(x=>({license:x,url:E.match.github_url}))})}}a(Rlc,"fetchCitations")});var A4i=I(M$=>{"use strict";p();Object.defineProperty(M$,"__esModule",{value:!0});M$.editDistance=p4i;M$.emptyLexDictionary=h4i;M$.reverseLexDictionary=m4i;M$.lexGeneratorWords=g4i;M$.lexicalAnalyzer=_Pr;M$.lexEditDistance=klc;function p4i(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(g4i,"lexGeneratorWords");function _Pr(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(_Pr,"lexicalAnalyzer");function f4i(t){return t!==" "}a(f4i,"notSingleSpace");function klc(t,e,r=g4i){let[n,o]=_Pr(t,h4i(),r,f4i),[s,c]=_Pr(e,o,r,f4i);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=m4i(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 b=l[n[_][0]];return v===0&&b.endsWith(d)||v===u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=p4i(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(klc,"lexEditDistance")});var vPr=I(Tne=>{"use strict";p();Object.defineProperty(Tne,"__esModule",{value:!0});Tne.PartialAcceptTriggerKind=void 0;Tne.computeCompCharLen=Plc;Tne.countLines=Dlc;Tne.computeCompletionText=Nlc;var y4i;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(y4i||(Tne.PartialAcceptTriggerKind=y4i={}));function Plc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(Plc,"computeCompCharLen");function Dlc(t){return t.length===0?0:t.split(` +`).length}a(Dlc,"countLines");function Nlc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(Nlc,"computeCompletionText")});var w4i=I(f_t=>{"use strict";p();Object.defineProperty(f_t,"__esModule",{value:!0});f_t.postRejectionTasks=$lc;f_t.postInsertionTasks=Vlc;var d_t=Gs(),v4i=bte(),Mlc=Qge(),u_t=O2i(),Olc=ggt(),Llc=hIr(),C4i=BTr(),b4i=wAe(),rye=Dl(),E4i=Ayt(),Blc=jAe(),Flc=d4i(),_4i=A4i(),Ulc=vPr(),O$=$g(),Qlc=s1(),S4i=C5e(),qlc=rne(),L$=new rye.Logger("postInsertion"),T4i=[{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}],I4i=50,jlc=1500,Hlc=.5,Glc=500,CPr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function x4i(t,e,r,n,o){let s=t.get(d_t.IInstantiationService),c=t.get(rye.ICompletionsLogTargetService),l=await t.get(C4i.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return L$.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(Blc.extractPrompt,r.properties.headerRequestId,(0,Llc.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,E4i.contextIndentationFromText)(f,n,u.detectedLanguageId),_=(0,E4i.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(_?_*2:Glc)),b=d.substring(n,v);return{prompt:g,capturedCode:b,terminationOffset:_??-1}}}a(x4i,"captureCode");function $lc(t,e,r,n,o){let s=t.get(rye.ICompletionsLogTargetService),c=t.get(d_t.IInstantiationService),l=t.get(v4i.ICompletionsTelemetryService),u=t.get(S4i.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{L$.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(b4i.telemetryRejected,e,g)});let d=c.createInstance(u_t.ChangeTracker,n,r-1),f=c.createInstance(u_t.ChangeTracker,n,r),h=a(async m=>{L$.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:E}=await c.invokeFunction(x4i,n,g,d.offset+1,f.offset),_={hypotheticalPromptJson:JSON.stringify({prefix:A.prefix,context:A.context}),hypotheticalPromptSuffixJson:JSON.stringify(A.suffix)},v=g.extendedBy({..._,capturedCodeJson:JSON.stringify(y)},{timeout:m.seconds,insertionOffset:r,trackedOffset:d.offset,terminationOffsetInCapturedCode:E});L$.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(O$.telemetry,e+".capturedAfterRejected",v,O$.TelemetryStore.Enhanced)},"checkInCode");T4i.filter(m=>m.captureRejection).map(m=>d.push((0,O$.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a($lc,"postRejectionTasks");function Vlc(t,e,r,n,o,s,c,l){let u=t.get(rye.ICompletionsLogTargetService),d=t.get(d_t.IInstantiationService),f=t.get(S4i.ICompletionsPromiseQueueService),h=t.get(v4i.ICompletionsTelemetryService),m=t.get(qlc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});L$.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(b4i.telemetryAccepted,e,g);let A=r;r=(0,Ulc.computeCompletionText)(r,c);let y=r.trim(),E=d.createInstance(u_t.ChangeTracker,o,n),_=d.createInstance(u_t.ChangeTracker,o,n+r.length),v=a(async b=>{await d.invokeFunction(Klc,e,y,n,o,b,g,E,_)},"stillInCodeCheck");if(CPr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let b=v({seconds:0,captureCode:CPr.captureCode,captureRejection:CPr.captureRejection});f.register(b)}else T4i.map(b=>E.push((0,O$.telemetryCatch)(h,f,()=>v(b),"postInsertionTasks"),b.seconds*1e3));d.invokeFunction(b=>(0,O$.telemetryCatch)(h,f,Wlc,"post insertion citation check")(b,o,A,r,n,l))}a(Vlc,"postInsertionTasks");async function Wlc(t,e,r,n,o,s){let c=t.get(rye.ICompletionsLogTargetService),l=t.get(Qlc.ICompletionsTextDocumentManagerService),u=t.get(Mlc.ICompletionsCopilotTokenManager),d=t.get(Olc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,Flc.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=bPr(f.getText(),n,I4i,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=zlc(r.length,n.length,h.start_offset);if(m===void 0){L$.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+Ylc(r.length,n.length,h.stop_offset),E=f?.positionAt(y),_=A&&E?f?.getText({start:A,end:E}):"";await d.handleIPCodeCitation({inDocumentUri:e,offsetStart:g,offsetEnd:y,version:f?.version,location:A&&E?{start:A,end:E}:void 0,matchingText:_,details:h.details.citations})}}a(Wlc,"citationCheck");function zlc(t,e,r){if(!(ee))return r}a(zlc,"computeCitationStart");function Ylc(t,e,r){return e{"use strict";p();Object.defineProperty(vy,"__esModule",{value:!0});vy.LastGhostText=vy.ICompletionsLastGhostText=void 0;vy.rejectLastShown=P4i;vy.setLastShown=euc;vy.handleGhostTextShown=tuc;vy.handleGhostTextPostInsert=nuc;vy.handlePartialGhostTextPostInsert=iuc;var Jlc=nn(),R4i=Dl(),TPr=w4i(),p_t=vPr(),k4i=c$(),IPr=wAe(),Zlc=new R4i.Logger("ghostText");vy.ICompletionsLastGhostText=(0,Jlc.createServiceIdentifier)("ICompletionsLastGhostText");var SPr=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}};vy.LastGhostText=SPr;function Xlc(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(Xlc,"computeRejectedCompletions");function P4i(t,e){let r=t.get(vy.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=Xlc(r);n.length>0&&(0,TPr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(P4i,"rejectLastShown");function euc(t,e,r,n){let o=t.get(vy.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==k4i.ResultType.TypingAsSuggested&&P4i(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(euc,"setLastShown");function tuc(t,e){let r=t.get(R4i.ICompletionsLogTargetService),n=t.get(vy.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!==k4i.ResultType.Network;Zlc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,IPr.telemetryShown)(t,e)}}a(tuc,"handleGhostTextShown");function ruc(t,e,r){let n=t.get(vy.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,p_t.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,p_t.countLines)(e.displayText));let o=(0,p_t.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(ruc,"handleLineAcceptance");function nuc(t,e){let r=t.get(vy.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,p_t.countLines)(e.displayText)},r.resetState(),(0,TPr.postInsertionTasks)(t,IPr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(nuc,"handleGhostTextPostInsert");function iuc(t,e,r){let n=t.get(vy.ICompletionsLastGhostText);ruc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,TPr.postInsertionTasks)(t,IPr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(iuc,"handlePartialGhostTextPostInsert")});var D4i=I(wPr=>{"use strict";p();Object.defineProperty(wPr,"__esModule",{value:!0});wPr.normalizeIndentCharacter=ouc;function ouc(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(Xlc,"normalizeIndentCharacter")});var R4i=I(wPr=>{"use strict";p();Object.defineProperty(wPr,"__esModule",{value:!0});wPr.completionsFromGhostTextResults=nuc;var euc=T0(),p_t=mAe(),tuc=w4i(),ruc=a$();function nuc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=p_t.LocationFactory.range(p_t.LocationFactory.position(n.line,0),p_t.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,tuc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=p_t.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,euc.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===ruc.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(nuc,"completionsFromGhostTextResults")});var PPr=I(XD=>{"use strict";p();var iuc=XD&&XD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ouc=XD&&XD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),suc=XD&&XD.__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(auc,"createRequestHMAC");async function cuc(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(cuc,"createSha256Hash");var RPr=new Map;function luc(t){if(RPr.has(t))return RPr.get(t);let e=uuc(t);return RPr.set(t,e),e}a(luc,"getCachedSha256Hash");function uuc(t){let e=new kPr;return e.update(t),e.digest()}a(uuc,"createSha256HashSyncInsecure");function L$(t,e=32){return t instanceof ArrayBuffer?(0,k4i.encodeHex)(k4i.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(L$,"toHexString");function pL(t,e){return(t>>>e|t<<32-e)>>>0}a(pL,"rightRotate");var kPr=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(h_t.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()),L$(this._h0)+L$(this._h1)+L$(this._h2)+L$(this._h3)+L$(this._h4)+L$(this._h5)+L$(this._h6)+L$(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),E=pL(A,7)^pL(A,18)^A>>>3,_=pL(y,17)^pL(y,19)^y>>>10,v=e.getUint32((m-16)*4,!1),b=e.getUint32((m-7)*4,!1);e.setUint32(g,v+E+b+_>>>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=pL(u,6)^pL(u,11)^pL(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,E=pL(o,2)^pL(o,13)^pL(o,22),_=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 DPr=I(m_t=>{"use strict";p();Object.defineProperty(m_t,"__esModule",{value:!0});m_t.isInlineSuggestionFromTextAfterCursor=P4i;m_t.determineIsInlineSuggestionPosition=duc;function P4i(t){let e=fuc(t),r=puc(t);if(!(e&&!r))return e&&r}a(P4i,"isInlineSuggestionFromTextAfterCursor");function duc(t){let e=t.textAfterCursor();return P4i(e)}a(duc,"determineIsInlineSuggestionPosition");function fuc(t){return t.trim().length!==0}a(fuc,"isMiddleOfTheLineFromTextAfterCursor");function puc(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(puc,"isValidMiddleOfTheLineFromTextAfterCursor")});var A_t=I(B$=>{"use strict";p();Object.defineProperty(B$,"__esModule",{value:!0});B$.NoOpStatusReporter=B$.StatusReporter=B$.ICompletionsStatusReporter=void 0;var huc=nn();B$.ICompletionsStatusReporter=(0,huc.createServiceIdentifier)("ICompletionsStatusReporter");var g_t=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)}};B$.StatusReporter=g_t;var NPr=class extends g_t{static{a(this,"NoOpStatusReporter")}didChange(){}};B$.NoOpStatusReporter=NPr});var FPr=I(Cy=>{"use strict";p();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.AdoRepoId=Cy.GithubRepoId=Cy.IGitService=void 0;Cy.getGitHubRepoInfoFromContext=Auc;Cy.getOrderedRepoInfosFromContext=yuc;Cy.getOrderedRemoteUrlsFromContext=OPr;Cy.parseRemoteUrl=LPr;Cy.toGithubNwo=D4i;Cy.toGithubWebUrl=Euc;Cy.getGithubRepoIdFromFetchUrl=BPr;Cy.getAdoRepoIdFromFetchUrl=N4i;Cy.normalizeFetchUrl=_uc;var muc=nn(),MPr=em(),guc=nd();Cy.IGitService=(0,muc.createServiceIdentifier)("IGitService");function Auc(t){for(let e of OPr(t))if(e){let r=BPr(e);if(r)return{id:r,remoteUrl:e}}}a(Auc,"getGitHubRepoInfoFromContext");function*yuc(t){for(let e of OPr(t)){let r=BPr(e)??N4i(e);r&&(yield{repoId:r,fetchUrl:e})}}a(yuc,"getOrderedRepoInfosFromContext");function OPr(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(OPr,"getOrderedRemoteUrlsFromContext");function LPr(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=guc.URI.parse(t),r=e.authority,n=e.path;if(!((0,MPr.equalsIgnoreCase)(e.scheme,"ssh")||(0,MPr.equalsIgnoreCase)(e.scheme,"https")||(0,MPr.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(LPr,"parseRemoteUrl");var y_t=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 D4i(this)}};Cy.GithubRepoId=y_t;function D4i(t){return`${t.org}/${t.repo}`.toLowerCase()}a(D4i,"toGithubNwo");function Euc(t){return`https://${t.host}/${t.org}/${t.repo}`}a(Euc,"toGithubWebUrl");function BPr(t){let e=LPr(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 y_t(s[1],s[2],o):void 0}a(BPr,"getGithubRepoIdFromFetchUrl");var rye=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()}};Cy.AdoRepoId=rye;function N4i(t){let e=LPr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new rye(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 rye(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 rye(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(N4i,"getAdoRepoIdFromFetchUrl");function _uc(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(_uc,"normalizeFetchUrl")});var qPr=I(Ine=>{"use strict";p();Object.defineProperty(Ine,"__esModule",{value:!0});Ine.ComputationStatus=void 0;Ine.tryGetGitHubNWO=buc;Ine.extractRepoInfoInBackground=Suc;Ine.extractRepoInfo=M4i;var UPr=FPr(),vuc=n$(),Cuc=C6(),SLe=o$();function buc(t){if(t!==void 0&&t!==TLe.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(buc,"tryGetGitHubNWO");function Suc(t,e){let r=(0,SLe.dirname)(e);return Tuc(t,r)}a(Suc,"extractRepoInfoInBackground");var Tuc=Ruc(M4i,1e4);async function M4i(t,e){let r=t.get(vuc.ICompletionsFileSystemService),n=(0,SLe.getFsUri)(e);if(!n)return;let o=await xuc(r,n);if(!o)return;let s=(0,SLe.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=wuc(c)??"",u=Iuc(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(M4i,"extractRepoInfo");function Iuc(t){let e=(0,UPr.parseRemoteUrl)(t);if(!e)return;let r=(0,UPr.getGithubRepoIdFromFetchUrl)(t)??(0,UPr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(Iuc,"parseRepoUrl");async function xuc(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 TLe.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new QPr(d)),n.delete(c)}),TLe.PENDING}}a(Ruc,"computeInBackgroundAndMemoize")});var L4i=I(jPr=>{"use strict";p();Object.defineProperty(jPr,"__esModule",{value:!0});jPr.isRepetitive=Puc;var kuc=[{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 Puc(t){let e=t.slice();return e.reverse(),O4i(e)||O4i(e.filter(r=>r.trim().length>0))}a(Puc,"isRepetitive");function O4i(t){let e=Duc(t);for(let r of kuc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(Duc,"kmp_prefix_function")});var F4i=I(ILe=>{"use strict";p();Object.defineProperty(ILe,"__esModule",{value:!0});ILe.maybeSnipCompletionImpl=B4i;ILe.postProcessChoiceInContext=Fuc;ILe.checkSuffix=Uuc;var Nuc=Qre(),xne=$g(),Muc=L4i();function Ouc(t,e,r,n){let o="}";try{o=(0,Nuc.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return B4i({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(Ouc,"maybeSnipCompletion");function B4i(t,e,r,n){let o=Luc(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(B4i,"maybeSnipCompletionImpl");function Luc(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(ouc,"normalizeIndentCharacter")});var N4i=I(RPr=>{"use strict";p();Object.defineProperty(RPr,"__esModule",{value:!0});RPr.completionsFromGhostTextResults=luc;var suc=T0(),h_t=gAe(),auc=D4i(),cuc=c$();function luc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=h_t.LocationFactory.range(h_t.LocationFactory.position(n.line,0),h_t.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,auc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=h_t.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,suc.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===cuc.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(luc,"completionsFromGhostTextResults")});var DPr=I(eN=>{"use strict";p();var uuc=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]})),duc=eN&&eN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fuc=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;ou.toString(16).padStart(2,"0")).join("");return`${r}.${l}`}a(puc,"createRequestHMAC");async function huc(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(huc,"createSha256Hash");var kPr=new Map;function muc(t){if(kPr.has(t))return kPr.get(t);let e=guc(t);return kPr.set(t,e),e}a(muc,"getCachedSha256Hash");function guc(t){let e=new PPr;return e.update(t),e.digest()}a(guc,"createSha256HashSyncInsecure");function B$(t,e=32){return t instanceof ArrayBuffer?(0,M4i.encodeHex)(M4i.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(B$,"toHexString");function pL(t,e){return(t>>>e|t<<32-e)>>>0}a(pL,"rightRotate");var PPr=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(m_t.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()),B$(this._h0)+B$(this._h1)+B$(this._h2)+B$(this._h3)+B$(this._h4)+B$(this._h5)+B$(this._h6)+B$(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),E=pL(A,7)^pL(A,18)^A>>>3,_=pL(y,17)^pL(y,19)^y>>>10,v=e.getUint32((m-16)*4,!1),b=e.getUint32((m-7)*4,!1);e.setUint32(g,v+E+b+_>>>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=pL(u,6)^pL(u,11)^pL(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,E=pL(o,2)^pL(o,13)^pL(o,22),_=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 NPr=I(g_t=>{"use strict";p();Object.defineProperty(g_t,"__esModule",{value:!0});g_t.isInlineSuggestionFromTextAfterCursor=O4i;g_t.determineIsInlineSuggestionPosition=Auc;function O4i(t){let e=yuc(t),r=Euc(t);if(!(e&&!r))return e&&r}a(O4i,"isInlineSuggestionFromTextAfterCursor");function Auc(t){let e=t.textAfterCursor();return O4i(e)}a(Auc,"determineIsInlineSuggestionPosition");function yuc(t){return t.trim().length!==0}a(yuc,"isMiddleOfTheLineFromTextAfterCursor");function Euc(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(Euc,"isValidMiddleOfTheLineFromTextAfterCursor")});var y_t=I(F$=>{"use strict";p();Object.defineProperty(F$,"__esModule",{value:!0});F$.NoOpStatusReporter=F$.StatusReporter=F$.ICompletionsStatusReporter=void 0;var _uc=nn();F$.ICompletionsStatusReporter=(0,_uc.createServiceIdentifier)("ICompletionsStatusReporter");var A_t=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)}};F$.StatusReporter=A_t;var MPr=class extends A_t{static{a(this,"NoOpStatusReporter")}didChange(){}};F$.NoOpStatusReporter=MPr});var UPr=I(Cy=>{"use strict";p();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.AdoRepoId=Cy.GithubRepoId=Cy.IGitService=void 0;Cy.getGitHubRepoInfoFromContext=buc;Cy.getOrderedRepoInfosFromContext=Suc;Cy.getOrderedRemoteUrlsFromContext=LPr;Cy.parseRemoteUrl=BPr;Cy.toGithubNwo=L4i;Cy.toGithubWebUrl=Tuc;Cy.getGithubRepoIdFromFetchUrl=FPr;Cy.getAdoRepoIdFromFetchUrl=B4i;Cy.normalizeFetchUrl=Iuc;var vuc=nn(),OPr=em(),Cuc=nd();Cy.IGitService=(0,vuc.createServiceIdentifier)("IGitService");function buc(t){for(let e of LPr(t))if(e){let r=FPr(e);if(r)return{id:r,remoteUrl:e}}}a(buc,"getGitHubRepoInfoFromContext");function*Suc(t){for(let e of LPr(t)){let r=FPr(e)??B4i(e);r&&(yield{repoId:r,fetchUrl:e})}}a(Suc,"getOrderedRepoInfosFromContext");function LPr(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(LPr,"getOrderedRemoteUrlsFromContext");function BPr(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=Cuc.URI.parse(t),r=e.authority,n=e.path;if(!((0,OPr.equalsIgnoreCase)(e.scheme,"ssh")||(0,OPr.equalsIgnoreCase)(e.scheme,"https")||(0,OPr.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(BPr,"parseRemoteUrl");var E_t=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 L4i(this)}};Cy.GithubRepoId=E_t;function L4i(t){return`${t.org}/${t.repo}`.toLowerCase()}a(L4i,"toGithubNwo");function Tuc(t){return`https://${t.host}/${t.org}/${t.repo}`}a(Tuc,"toGithubWebUrl");function FPr(t){let e=BPr(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 E_t(s[1],s[2],o):void 0}a(FPr,"getGithubRepoIdFromFetchUrl");var nye=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()}};Cy.AdoRepoId=nye;function B4i(t){let e=BPr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new nye(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 nye(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 nye(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(B4i,"getAdoRepoIdFromFetchUrl");function Iuc(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(Iuc,"normalizeFetchUrl")});var jPr=I(Ine=>{"use strict";p();Object.defineProperty(Ine,"__esModule",{value:!0});Ine.ComputationStatus=void 0;Ine.tryGetGitHubNWO=Ruc;Ine.extractRepoInfoInBackground=kuc;Ine.extractRepoInfo=F4i;var QPr=UPr(),xuc=i$(),wuc=b6(),ILe=s$();function Ruc(t){if(t!==void 0&&t!==xLe.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(Ruc,"tryGetGitHubNWO");function kuc(t,e){let r=(0,ILe.dirname)(e);return Puc(t,r)}a(kuc,"extractRepoInfoInBackground");var Puc=Ouc(F4i,1e4);async function F4i(t,e){let r=t.get(xuc.ICompletionsFileSystemService),n=(0,ILe.getFsUri)(e);if(!n)return;let o=await Nuc(r,n);if(!o)return;let s=(0,ILe.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=Muc(c)??"",u=Duc(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(F4i,"extractRepoInfo");function Duc(t){let e=(0,QPr.parseRemoteUrl)(t);if(!e)return;let r=(0,QPr.getGithubRepoIdFromFetchUrl)(t)??(0,QPr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(Duc,"parseRepoUrl");async function Nuc(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 xLe.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new qPr(d)),n.delete(c)}),xLe.PENDING}}a(Ouc,"computeInBackgroundAndMemoize")});var Q4i=I(HPr=>{"use strict";p();Object.defineProperty(HPr,"__esModule",{value:!0});HPr.isRepetitive=Buc;var Luc=[{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 Buc(t){let e=t.slice();return e.reverse(),U4i(e)||U4i(e.filter(r=>r.trim().length>0))}a(Buc,"isRepetitive");function U4i(t){let e=Fuc(t);for(let r of Luc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(Fuc,"kmp_prefix_function")});var j4i=I(wLe=>{"use strict";p();Object.defineProperty(wLe,"__esModule",{value:!0});wLe.maybeSnipCompletionImpl=q4i;wLe.postProcessChoiceInContext=Guc;wLe.checkSuffix=$uc;var Uuc=Qre(),xne=$g(),Quc=Q4i();function quc(t,e,r,n){let o="}";try{o=(0,Uuc.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return q4i({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(quc,"maybeSnipCompletion");function q4i(t,e,r,n){let o=juc(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(q4i,"maybeSnipCompletionImpl");function juc(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(Luc,"splitByNewLine");function Buc(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(Uuc,"checkSuffix")});var j4i=I(F$=>{"use strict";p();Object.defineProperty(F$,"__esModule",{value:!0});F$.DocumentLogEntry=void 0;F$.serializeOffsetRange=Quc;F$.deserializeOffsetRange=quc;F$.serializeEdit=juc;F$.deserializeEdit=Huc;var U4i=kE(),q4i=hd(),Q4i;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(Q4i||(F$.DocumentLogEntry=Q4i={}));function Quc(t){return[t.start,t.endExclusive]}a(Quc,"serializeOffsetRange");function quc(t){return new q4i.OffsetRange(t[0],t[1])}a(quc,"deserializeOffsetRange");function juc(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(juc,"serializeEdit");function Huc(t){return U4i.StringEdit.create(t.map(e=>U4i.StringReplacement.replace(new q4i.OffsetRange(e[0],e[1]),e[2])))}a(Huc,"deserializeEdit")});var nye=I(km=>{"use strict";p();Object.defineProperty(km,"__esModule",{value:!0});km.StatelessNextEditTelemetryBuilder=km.StatelessNextEditResult=km.NoNextEditReason=km.FilteredOutReason=km.StatelessNextEditDocument=km.StatelessNextEditRequest=km.RequestEditWindowWithCursorJump=km.RequestEditWindow=km.WithStatelessProviderTelemetry=void 0;var H4i=uw(),HPr=rd(),Guc=nl(),$uc=YP(),Vuc=kE(),Wuc=qT(),zuc=j4i(),Yuc=b0r(),GPr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};km.WithStatelessProviderTelemetry=GPr;var $Pr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};km.RequestEditWindow=$Pr;var VPr=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)}};km.RequestEditWindowWithCursorJump=VPr;var WPr=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 $uc.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=Vuc.StringEdit.empty,this._result=new Guc.DeferredPromise,(0,HPr.assert)(o.length>0),(0,HPr.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(juc,"splitByNewLine");function Huc(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($uc,"checkSuffix")});var V4i=I(U$=>{"use strict";p();Object.defineProperty(U$,"__esModule",{value:!0});U$.DocumentLogEntry=void 0;U$.serializeOffsetRange=Vuc;U$.deserializeOffsetRange=Wuc;U$.serializeEdit=zuc;U$.deserializeEdit=Yuc;var H4i=kE(),$4i=hd(),G4i;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(G4i||(U$.DocumentLogEntry=G4i={}));function Vuc(t){return[t.start,t.endExclusive]}a(Vuc,"serializeOffsetRange");function Wuc(t){return new $4i.OffsetRange(t[0],t[1])}a(Wuc,"deserializeOffsetRange");function zuc(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(zuc,"serializeEdit");function Yuc(t){return H4i.StringEdit.create(t.map(e=>H4i.StringReplacement.replace(new $4i.OffsetRange(e[0],e[1]),e[2])))}a(Yuc,"deserializeEdit")});var iye=I(km=>{"use strict";p();Object.defineProperty(km,"__esModule",{value:!0});km.StatelessNextEditTelemetryBuilder=km.StatelessNextEditResult=km.NoNextEditReason=km.FilteredOutReason=km.StatelessNextEditDocument=km.StatelessNextEditRequest=km.RequestEditWindowWithCursorJump=km.RequestEditWindow=km.WithStatelessProviderTelemetry=void 0;var W4i=dw(),GPr=rd(),Kuc=nl(),Juc=KP(),Zuc=kE(),Xuc=HT(),edc=V4i(),tdc=S0r(),$Pr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};km.WithStatelessProviderTelemetry=$Pr;var VPr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};km.RequestEditWindow=VPr;var WPr=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)}};km.RequestEditWindowWithCursorJump=WPr;var zPr=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 Juc.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=Zuc.StringEdit.empty,this._result=new Kuc.DeferredPromise,(0,GPr.assert)(o.length>0),(0,GPr.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(` -`)}`}};km.StatelessNextEditRequest=WPr;var zPr=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 Wuc.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,zuc.serializeOffsetRange)(this.lastSelectionInAfterEdit)}}toString(){return this.toMarkdown()}toMarkdown(){let e=[];return e.push(`StatelessNextEditDocument: **${this.id.uri}** +`)}`}};km.StatelessNextEditRequest=zPr;var YPr=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 Xuc.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,edc.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(` -`)}};km.StatelessNextEditDocument=zPr;var G4i;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(G4i||(km.FilteredOutReason=G4i={}));var hL;(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})(hL||(km.NoNextEditReason=hL={}));var YPr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=H4i.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=H4i.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};km.StatelessNextEditResult=YPr;var KPr=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,Yuc.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 hL.ActiveDocumentHasNoEdits||e.err instanceof hL.NoSuggestions||(e.err instanceof hL.GotCancelled||e.err instanceof hL.FilteredOut||e.err instanceof hL.PromptTooLarge?d=e.err.message:e.err instanceof hL.FetchFailure||e.err instanceof hL.Uncategorized||e.err instanceof hL.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,HPr.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,diffTokensInPrompt:this._diffTokensInPrompt,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}setDiffTokensInPrompt(e){return this._diffTokensInPrompt=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}};km.StatelessNextEditTelemetryBuilder=KPr});var $4i=I(E_t=>{"use strict";p();Object.defineProperty(E_t,"__esModule",{value:!0});E_t.StreamCopilotAnnotations=void 0;var JPr=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]??[]}};E_t.StreamCopilotAnnotations=JPr});var __t=I(U$=>{"use strict";p();Object.defineProperty(U$,"__esModule",{value:!0});U$.ICompletionsFetchService=U$.CompletionsFetchError=U$.Completions=void 0;var Kuc=nn(),V4i;(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})(V4i||(U$.Completions=V4i={}));var ZPr=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};U$.CompletionsFetchError=ZPr;U$.ICompletionsFetchService=(0,Kuc.createServiceIdentifier)("ICompletionsFetchService")});var xLe=I(iye=>{"use strict";p();Object.defineProperty(iye,"__esModule",{value:!0});iye.CacheType=iye.CustomDataPartMimeTypes=void 0;var W4i;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(W4i||(iye.CustomDataPartMimeTypes=W4i={}));iye.CacheType="ephemeral"});var e2r=I(wLe=>{"use strict";p();Object.defineProperty(wLe,"__esModule",{value:!0});wLe.ThinkingDataContainer=void 0;wLe.rawPartAsThinkingData=Zuc;var Juc=Io(),z4i=xLe(),XPr=class extends Juc.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:z4i.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};wLe.ThinkingDataContainer=XPr;function Zuc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===z4i.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(Zuc,"rawPartAsThinkingData")});var H6=I(WE=>{"use strict";p();Object.defineProperty(WE,"__esModule",{value:!0});WE.FilterReason=WE.FinishedCompletionReason=WE.ChatRole=WE.modelsWithoutResponsesContextManagement=WE.openAIContextManagementCompactionType=void 0;WE.isApiUsage=tdc;WE.nanoAiuToCredits=rdc;WE.getCAPITextPart=Z4i;WE.rawMessageToCAPI=X4i;var v_t=Io(),Xuc=lxe(),edc=e2r();function tdc(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(tdc,"isApiUsage");function rdc(t){return typeof t=="number"&&t>=0?t/1e9:void 0}a(rdc,"nanoAiuToCredits");WE.openAIContextManagementCompactionType="compaction";WE.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var Y4i;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(Y4i||(WE.ChatRole=Y4i={}));function Z4i(t){return Array.isArray(t)?t.map(e=>Z4i(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(Z4i,"getCAPITextPart");function X4i(t,e){if(Array.isArray(t))return t.map(n=>X4i(n,e));let r=(0,v_t.toMode)(v_t.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===Xuc.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===v_t.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,edc.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(X4i,"rawMessageToCAPI");var K4i;(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"})(K4i||(WE.FinishedCompletionReason=K4i={}));var J4i;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(J4i||(WE.FilterReason=J4i={}))});var $6=I(G6=>{"use strict";p();Object.defineProperty(G6,"__esModule",{value:!0});G6.getRequestId=idc;G6.isCopilotAnnotation=odc;G6.isCodeCitationAnnotation=sdc;G6.isCopilotWebReference=adc;G6.isOpenAIContextManagementResponse=cdc;G6.isAnthropicContextManagementResponse=ldc;G6.isOpenAiFunctionTool=udc;var ndc=H6();function idc(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(idc,"getRequestId");function odc(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(odc,"isCopilotAnnotation");function sdc(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(sdc,"isCodeCitationAnnotation");function adc(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(adc,"isCopilotWebReference");function cdc(t){return"type"in t&&t.type===ndc.openAIContextManagementCompactionType}a(cdc,"isOpenAIContextManagementResponse");function ldc(t){return"applied_edits"in t}a(ldc,"isAnthropicContextManagementResponse");function udc(t){return t.function!==void 0}a(udc,"isOpenAiFunctionTool")});var eLi=I(eN=>{"use strict";p();Object.defineProperty(eN,"__esModule",{value:!0});eN.asyncIterableMap=ddc;eN.asyncIterableFilter=fdc;eN.asyncIterableMapFilter=pdc;eN.asyncIterableFromArray=hdc;eN.asyncIterableToArray=mdc;eN.asyncIterableConcat=gdc;eN.asyncIterableCount=Adc;eN.iterableMap=ydc;eN.iterableMapFilter=Edc;async function*ddc(t,e){for await(let r of t)yield e(r)}a(ddc,"asyncIterableMap");async function*fdc(t,e){for await(let r of t)await e(r)&&(yield r)}a(fdc,"asyncIterableFilter");async function*pdc(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(pdc,"asyncIterableMapFilter");async function*hdc(t){for(let e of t)yield Promise.resolve(e)}a(hdc,"asyncIterableFromArray");async function mdc(t){let e=[];for await(let r of t)e.push(r);return e}a(mdc,"asyncIterableToArray");async function*gdc(...t){for(let e of t)yield*e}a(gdc,"asyncIterableConcat");async function Adc(t){let e=0;for await(let r of t)e++;return e}a(Adc,"asyncIterableCount");function*ydc(t,e){for(let r of t)yield e(r)}a(ydc,"iterableMap");function*Edc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(Edc,"iterableMapFilter")});var tLi=I(t2r=>{"use strict";p();Object.defineProperty(t2r,"__esModule",{value:!0});t2r.getKey=vdc;function _dc(t,e){return t!==null&&typeof t=="object"&&e in t}a(_dc,"hasKey");function vdc(t,e){return _dc(t,e)?t[e]:void 0}a(vdc,"getKey")});var o2r=I(Pm=>{"use strict";p();var Cdc=Pm&&Pm.__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},Q$=Pm&&Pm.__param||function(t,e){return function(r,n){e(r,n,t)}},r2r;Object.defineProperty(Pm,"__esModule",{value:!0});Pm.LiveOpenAIFetcher=Pm.CMDQuotaExceeded=Pm.OpenAIFetcher=Pm.ICompletionsOpenAIFetcherService=Pm.CopilotUiKind=void 0;Pm.sanitizeRequestOptionTelemetry=aLi;Pm.postProcessChoices=cLi;var bdc=FE(),Sdc=$4i(),Tdc=U4(),kLe=__t(),Idc=$6(),rLi=gm(),xdc=nn(),wdc=rd(),Rdc=YP(),kdc=FO(),Pdc=T0(),Ddc=Gs(),Ndc=Uge(),Mdc=fgt(),nLi=LE(),Odc=eLi(),sLi=Dl(),Ldc=r_t(),iLi=KAe(),Bdc=A_t(),Fdc=qPr(),aI=$g(),Udc=y4e(),Qdc=rne(),RLe=tLi(),C_t=M4e(),tA=new sLi.Logger("fetchCompletions"),b_t;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(b_t||(Pm.CopilotUiKind=b_t={}));function qdc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(qdc,"getProcessingTime");function jdc(t){switch(t){case b_t.GhostText:return"copilot-ghost";case b_t.Panel:return"copilot-panel"}}a(jdc,"uiKindToIntent");Pm.ICompletionsOpenAIFetcherService=(0,xdc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var S_t=class{static{a(this,"OpenAIFetcher")}};Pm.OpenAIFetcher=S_t;function Hdc(t,e,r,n){return(0,Ldc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(Hdc,"getProxyEngineUrl");function aLi(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(aLi,"sanitizeRequestOptionTelemetry");function cLi(t){return(0,Odc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(cLi,"postProcessChoices");Pm.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var n2r=r2r=class extends S_t{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,C_t.getMaxSolutionTokens)(),temperature:(0,C_t.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,C_t.getTopP)(),n:e.count,stop:(0,C_t.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,Fdc.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,Udc.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(Hdc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,aI.telemetrizePromptLength)(u));aLi(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(aI.telemetry,"request.sent",y);let E=jdc(m),_;_={...g,...this.instantiationService.invokeFunction(nLi.editorVersionHeaders)},_["Openai-Organization"]="github-copilot",_["X-Request-Id"]=f,_["VScode-SessionId"]=this.envService.sessionId,_["VScode-MachineId"]=this.envService.machineId,_["X-GitHub-Api-Version"]=nLi.apiVersion,E&&(_["OpenAI-Intent"]=E);let v=new kdc.StopWatch,b=o??Rdc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,b,_).then(w=>w.isError()&&w.err instanceof kLe.Completions.Unexpected&&(0,iLi.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(aI.telemetry,"networking.disconnectAll"),this.fetchService.disconnectAll().then(()=>this.fetchService.fetch(A,c.token,l,f,b,_))):w);try{if(T.isError()){let x=T.err;if(x instanceof kLe.Completions.RequestCancelled)return this.instantiationService.invokeFunction(aI.telemetry,"networking.cancelRequest",aI.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(aI.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof kLe.Completions.UnsuccessfulResponse){let P=(0,Idc.getRequestId)(x.headers);y.extendWithRequestId(P),P.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(rLi.ITelemetryService).setSharedProperty("capi.assignmentcontext",P.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),tA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),tA.debug(this.logTargetService,"request.response properties",y.properties),tA.debug(this.logTargetService,"request.response measurements",y.measurements),tA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(aI.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof kLe.Completions.Unexpected){let P=x.error;if((0,iLi.isAbortError)(P))throw this.instantiationService.invokeFunction(aI.telemetry,"request.cancel",y),P;this.statusReporter.setWarning((0,RLe.getKey)(P,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(aI.telemetry,"request.shownWarning",D),y.properties.message=String((0,RLe.getKey)(P,"name")??""),y.properties.code=String((0,RLe.getKey)(P,"code")??""),y.properties.errno=String((0,RLe.getKey)(P,"errno")??""),y.properties.type=String((0,RLe.getKey)(P,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,tA.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(P)} after ${N}ms`),tA.debug(this.logTargetService,"request.error properties",y.properties),tA.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(aI.telemetry,"request.error",y),P}else(0,wdc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(rLi.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let P=v.elapsed();y.measurements.totalTimeMs=P;let D=200;tA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${P}ms`),y.properties.status=String(D),tA.debug(this.logTargetService,"request.response properties",y.properties),tA.debug(this.logTargetService,"request.response measurements",y.measurements),tA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(aI.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(P=>tA.exception(P,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=r2r.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:cLi(R),getProcessingTime:a(()=>qdc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(aI.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,Pdc.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 E=m||typeof y=="number"||y!==void 0&&!y.continueStreaming;f.isFinished=E;let _=l.choices[u].finish_reason;_&&(f.accumulator.finishReason=_);let v=typeof y=="number"?y:y&&y.finishOffset!==void 0?y.finishOffset:void 0,b=v===void 0?f.accumulator.responseSoFar:f.accumulator.responseSoFar.slice(0,v);if(f.yielded||(f.yielded=!0,yield s(d,b,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:Pm.CMDQuotaExceeded,title:"Learn More"});let l=(0,Mdc.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),tA.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(oLi(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`;tA.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else oLi(n)?(tA.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(aI.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",tA.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(tA.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(tA.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};Pm.LiveOpenAIFetcher=n2r;Pm.LiveOpenAIFetcher=n2r=r2r=Cdc([Q$(0,Ddc.IInstantiationService),Q$(1,Qdc.ICompletionsRuntimeModeService),Q$(2,sLi.ICompletionsLogTargetService),Q$(3,Ndc.ICompletionsCopilotTokenManager),Q$(4,Bdc.ICompletionsStatusReporter),Q$(5,bdc.IAuthenticationService),Q$(6,kLe.ICompletionsFetchService),Q$(7,Tdc.IEnvService)],n2r);function oLi(t){return t.status>=400&&t.status<500}a(oLi,"isClientError");var i2r=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new Sdc.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 a2r=I(s2r=>{"use strict";p();Object.defineProperty(s2r,"__esModule",{value:!0});s2r.appendToCache=Gdc;function Gdc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(Gdc,"appendToCache")});var pLi=I(Kd=>{"use strict";p();var $dc=Kd&&Kd.__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=Kd&&Kd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Kd,"__esModule",{value:!0});Kd.CompletionsFromNetwork=Kd.logger=void 0;Kd.postProcessChoices=T_t;Kd.makeGhostAPIChoice=fLi;Kd.telemetryPerformance=d2r;var PLe=nye(),Vdc=X_(),DLe=uw(),Wdc=rd(),zdc=qT(),Ydc=Gs(),lLi=LE(),Kdc=$Sr(),Jdc=fy(),dLi=Dl(),Zdc=sPr(),l2r=o2r(),Xdc=M4e(),efc=$g(),tfc=rne(),rfc=SAe(),c2r=a2r(),nfc=_4e(),uLi=a$(),tN=xAe();Kd.logger=new dLi.Logger("ghostText");var u2r=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 Kd.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,tN.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return Kd.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,tN.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return Kd.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,tN.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(d2r,"performance",h,c,l),Kd.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=T_t(h);m&&((0,c2r.appendToCache)(this.completionsCacheService,e,m),Kd.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;Kd.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let E=T_t(y,A);E&&(A.push(E),(0,c2r.appendToCache)(this.completionsCacheService,e,E))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[fLi(m,{forceSingleLine:!1}),g],telemetryData:(0,tN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:uLi.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,tN.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 Kd.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,tN.mkCanceledResultTelemetry)(r)};let h=T_t(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,c2r.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(d2r,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,tN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:uLi.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new PLe.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=DLe.Result.ok(void 0);break;case"canceled":f=DLe.Result.error(new PLe.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=DLe.Result.error(new PLe.NoNextEditReason.NoSuggestions(new zdc.StringText(""),void 0));break;case"failed":f=DLe.Result.error(new PLe.NoNextEditReason.Uncategorized(Vdc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=DLe.Result.error(new PLe.NoNextEditReason.GotCancelled(d.reason));break;default:(0,Wdc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){Kd.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,Xdc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,lLi.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===lLi.BlockMode.MoreMultiline&&rfc.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:l2r.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 E={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:u,uiKind:l2r.CopilotUiKind.GhostText,postOptions:h,headers:e.headers,extra:f},_=await this.fetcherService.fetchAndStreamCompletions(E,r,o,n);return _.type==="failed"?{type:"failed",reason:_.reason,telemetryData:(0,tN.mkBasicResultTelemetry)(r)}:_.type==="canceled"?(Kd.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:(0,tN.mkCanceledResultTelemetry)(r)}):l(A,_.getProcessingTime(),_.choices)}catch(E){if((0,Zdc.isAbortError)(E))return{type:"canceled",reason:"network request aborted",telemetryData:(0,tN.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(_=>Kd.logger.exception(_,E,"Error on ghost text request")),this.userErrorNotifier.notifyUser(E),this.runtimeMode.shouldFailForDebugPurposes())throw E;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,tN.mkBasicResultTelemetry)(r)}}}};Kd.CompletionsFromNetwork=u2r;Kd.CompletionsFromNetwork=u2r=$dc([wne(0,Ydc.IInstantiationService),wne(1,l2r.ICompletionsOpenAIFetcherService),wne(2,Jdc.ICompletionsFeaturesService),wne(3,tfc.ICompletionsRuntimeModeService),wne(4,dLi.ICompletionsLogTargetService),wne(5,nfc.ICompletionsCacheService),wne(6,Kdc.ICompletionsUserErrorNotifierService)],u2r);function T_t(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(T_t,"postProcessChoices");function fLi(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` +`)}};km.StatelessNextEditDocument=YPr;var z4i;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(z4i||(km.FilteredOutReason=z4i={}));var hL;(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})(hL||(km.NoNextEditReason=hL={}));var KPr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=W4i.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=W4i.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};km.StatelessNextEditResult=KPr;var JPr=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,tdc.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 hL.ActiveDocumentHasNoEdits||e.err instanceof hL.NoSuggestions||(e.err instanceof hL.GotCancelled||e.err instanceof hL.FilteredOut||e.err instanceof hL.PromptTooLarge?d=e.err.message:e.err instanceof hL.FetchFailure||e.err instanceof hL.Uncategorized||e.err instanceof hL.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,GPr.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,diffTokensInPrompt:this._diffTokensInPrompt,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}setDiffTokensInPrompt(e){return this._diffTokensInPrompt=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}};km.StatelessNextEditTelemetryBuilder=JPr});var Y4i=I(__t=>{"use strict";p();Object.defineProperty(__t,"__esModule",{value:!0});__t.StreamCopilotAnnotations=void 0;var ZPr=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]??[]}};__t.StreamCopilotAnnotations=ZPr});var v_t=I(Q$=>{"use strict";p();Object.defineProperty(Q$,"__esModule",{value:!0});Q$.ICompletionsFetchService=Q$.CompletionsFetchError=Q$.Completions=void 0;var rdc=nn(),K4i;(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})(K4i||(Q$.Completions=K4i={}));var XPr=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};Q$.CompletionsFetchError=XPr;Q$.ICompletionsFetchService=(0,rdc.createServiceIdentifier)("ICompletionsFetchService")});var RLe=I(oye=>{"use strict";p();Object.defineProperty(oye,"__esModule",{value:!0});oye.CacheType=oye.CustomDataPartMimeTypes=void 0;var J4i;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(J4i||(oye.CustomDataPartMimeTypes=J4i={}));oye.CacheType="ephemeral"});var t2r=I(kLe=>{"use strict";p();Object.defineProperty(kLe,"__esModule",{value:!0});kLe.ThinkingDataContainer=void 0;kLe.rawPartAsThinkingData=idc;var ndc=xo(),Z4i=RLe(),e2r=class extends ndc.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:Z4i.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};kLe.ThinkingDataContainer=e2r;function idc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Z4i.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(idc,"rawPartAsThinkingData")});var G6=I(WE=>{"use strict";p();Object.defineProperty(WE,"__esModule",{value:!0});WE.FilterReason=WE.FinishedCompletionReason=WE.ChatRole=WE.modelsWithoutResponsesContextManagement=WE.openAIContextManagementCompactionType=void 0;WE.isApiUsage=adc;WE.nanoAiuToCredits=cdc;WE.getCAPITextPart=rLi;WE.rawMessageToCAPI=nLi;var C_t=xo(),odc=lxe(),sdc=t2r();function adc(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(adc,"isApiUsage");function cdc(t){return typeof t=="number"&&t>=0?t/1e9:void 0}a(cdc,"nanoAiuToCredits");WE.openAIContextManagementCompactionType="compaction";WE.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var X4i;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(X4i||(WE.ChatRole=X4i={}));function rLi(t){return Array.isArray(t)?t.map(e=>rLi(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(rLi,"getCAPITextPart");function nLi(t,e){if(Array.isArray(t))return t.map(n=>nLi(n,e));let r=(0,C_t.toMode)(C_t.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===odc.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===C_t.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,sdc.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(nLi,"rawMessageToCAPI");var eLi;(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"})(eLi||(WE.FinishedCompletionReason=eLi={}));var tLi;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(tLi||(WE.FilterReason=tLi={}))});var V6=I($6=>{"use strict";p();Object.defineProperty($6,"__esModule",{value:!0});$6.getRequestId=udc;$6.isCopilotAnnotation=ddc;$6.isCodeCitationAnnotation=fdc;$6.isCopilotWebReference=pdc;$6.isOpenAIContextManagementResponse=hdc;$6.isAnthropicContextManagementResponse=mdc;$6.isOpenAiFunctionTool=gdc;var ldc=G6();function udc(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(udc,"getRequestId");function ddc(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(ddc,"isCopilotAnnotation");function fdc(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(fdc,"isCodeCitationAnnotation");function pdc(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(pdc,"isCopilotWebReference");function hdc(t){return"type"in t&&t.type===ldc.openAIContextManagementCompactionType}a(hdc,"isOpenAIContextManagementResponse");function mdc(t){return"applied_edits"in t}a(mdc,"isAnthropicContextManagementResponse");function gdc(t){return t.function!==void 0}a(gdc,"isOpenAiFunctionTool")});var iLi=I(tN=>{"use strict";p();Object.defineProperty(tN,"__esModule",{value:!0});tN.asyncIterableMap=Adc;tN.asyncIterableFilter=ydc;tN.asyncIterableMapFilter=Edc;tN.asyncIterableFromArray=_dc;tN.asyncIterableToArray=vdc;tN.asyncIterableConcat=Cdc;tN.asyncIterableCount=bdc;tN.iterableMap=Sdc;tN.iterableMapFilter=Tdc;async function*Adc(t,e){for await(let r of t)yield e(r)}a(Adc,"asyncIterableMap");async function*ydc(t,e){for await(let r of t)await e(r)&&(yield r)}a(ydc,"asyncIterableFilter");async function*Edc(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(Edc,"asyncIterableMapFilter");async function*_dc(t){for(let e of t)yield Promise.resolve(e)}a(_dc,"asyncIterableFromArray");async function vdc(t){let e=[];for await(let r of t)e.push(r);return e}a(vdc,"asyncIterableToArray");async function*Cdc(...t){for(let e of t)yield*e}a(Cdc,"asyncIterableConcat");async function bdc(t){let e=0;for await(let r of t)e++;return e}a(bdc,"asyncIterableCount");function*Sdc(t,e){for(let r of t)yield e(r)}a(Sdc,"iterableMap");function*Tdc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(Tdc,"iterableMapFilter")});var oLi=I(r2r=>{"use strict";p();Object.defineProperty(r2r,"__esModule",{value:!0});r2r.getKey=xdc;function Idc(t,e){return t!==null&&typeof t=="object"&&e in t}a(Idc,"hasKey");function xdc(t,e){return Idc(t,e)?t[e]:void 0}a(xdc,"getKey")});var s2r=I(Pm=>{"use strict";p();var wdc=Pm&&Pm.__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},q$=Pm&&Pm.__param||function(t,e){return function(r,n){e(r,n,t)}},n2r;Object.defineProperty(Pm,"__esModule",{value:!0});Pm.LiveOpenAIFetcher=Pm.CMDQuotaExceeded=Pm.OpenAIFetcher=Pm.ICompletionsOpenAIFetcherService=Pm.CopilotUiKind=void 0;Pm.sanitizeRequestOptionTelemetry=dLi;Pm.postProcessChoices=fLi;var Rdc=FE(),kdc=Y4i(),Pdc=U4(),DLe=v_t(),Ddc=V6(),sLi=gm(),Ndc=nn(),Mdc=rd(),Odc=KP(),Ldc=FO(),Bdc=T0(),Fdc=Gs(),Udc=Qge(),Qdc=pgt(),aLi=LE(),qdc=iLi(),uLi=Dl(),jdc=n_t(),cLi=JAe(),Hdc=y_t(),Gdc=jPr(),lI=$g(),$dc=_4e(),Vdc=rne(),PLe=oLi(),b_t=L4e(),tA=new uLi.Logger("fetchCompletions"),S_t;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(S_t||(Pm.CopilotUiKind=S_t={}));function Wdc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(Wdc,"getProcessingTime");function zdc(t){switch(t){case S_t.GhostText:return"copilot-ghost";case S_t.Panel:return"copilot-panel"}}a(zdc,"uiKindToIntent");Pm.ICompletionsOpenAIFetcherService=(0,Ndc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var T_t=class{static{a(this,"OpenAIFetcher")}};Pm.OpenAIFetcher=T_t;function Ydc(t,e,r,n){return(0,jdc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(Ydc,"getProxyEngineUrl");function dLi(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(dLi,"sanitizeRequestOptionTelemetry");function fLi(t){return(0,qdc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(fLi,"postProcessChoices");Pm.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var i2r=n2r=class extends T_t{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,b_t.getMaxSolutionTokens)(),temperature:(0,b_t.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,b_t.getTopP)(),n:e.count,stop:(0,b_t.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,Gdc.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,$dc.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(Ydc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,lI.telemetrizePromptLength)(u));dLi(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(lI.telemetry,"request.sent",y);let E=zdc(m),_;_={...g,...this.instantiationService.invokeFunction(aLi.editorVersionHeaders)},_["Openai-Organization"]="github-copilot",_["X-Request-Id"]=f,_["VScode-SessionId"]=this.envService.sessionId,_["VScode-MachineId"]=this.envService.machineId,_["X-GitHub-Api-Version"]=aLi.apiVersion,E&&(_["OpenAI-Intent"]=E);let v=new Ldc.StopWatch,b=o??Odc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,b,_).then(w=>w.isError()&&w.err instanceof DLe.Completions.Unexpected&&(0,cLi.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(lI.telemetry,"networking.disconnectAll"),this.fetchService.disconnectAll().then(()=>this.fetchService.fetch(A,c.token,l,f,b,_))):w);try{if(T.isError()){let x=T.err;if(x instanceof DLe.Completions.RequestCancelled)return this.instantiationService.invokeFunction(lI.telemetry,"networking.cancelRequest",lI.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(lI.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof DLe.Completions.UnsuccessfulResponse){let P=(0,Ddc.getRequestId)(x.headers);y.extendWithRequestId(P),P.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(sLi.ITelemetryService).setSharedProperty("capi.assignmentcontext",P.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),tA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),tA.debug(this.logTargetService,"request.response properties",y.properties),tA.debug(this.logTargetService,"request.response measurements",y.measurements),tA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(lI.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof DLe.Completions.Unexpected){let P=x.error;if((0,cLi.isAbortError)(P))throw this.instantiationService.invokeFunction(lI.telemetry,"request.cancel",y),P;this.statusReporter.setWarning((0,PLe.getKey)(P,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(lI.telemetry,"request.shownWarning",D),y.properties.message=String((0,PLe.getKey)(P,"name")??""),y.properties.code=String((0,PLe.getKey)(P,"code")??""),y.properties.errno=String((0,PLe.getKey)(P,"errno")??""),y.properties.type=String((0,PLe.getKey)(P,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,tA.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(P)} after ${N}ms`),tA.debug(this.logTargetService,"request.error properties",y.properties),tA.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(lI.telemetry,"request.error",y),P}else(0,Mdc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(sLi.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let P=v.elapsed();y.measurements.totalTimeMs=P;let D=200;tA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${P}ms`),y.properties.status=String(D),tA.debug(this.logTargetService,"request.response properties",y.properties),tA.debug(this.logTargetService,"request.response measurements",y.measurements),tA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(lI.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(P=>tA.exception(P,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=n2r.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:fLi(R),getProcessingTime:a(()=>Wdc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(lI.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,Bdc.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 E=m||typeof y=="number"||y!==void 0&&!y.continueStreaming;f.isFinished=E;let _=l.choices[u].finish_reason;_&&(f.accumulator.finishReason=_);let v=typeof y=="number"?y:y&&y.finishOffset!==void 0?y.finishOffset:void 0,b=v===void 0?f.accumulator.responseSoFar:f.accumulator.responseSoFar.slice(0,v);if(f.yielded||(f.yielded=!0,yield s(d,b,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:Pm.CMDQuotaExceeded,title:"Learn More"});let l=(0,Qdc.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),tA.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(lLi(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`;tA.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else lLi(n)?(tA.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(lI.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",tA.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(tA.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(tA.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};Pm.LiveOpenAIFetcher=i2r;Pm.LiveOpenAIFetcher=i2r=n2r=wdc([q$(0,Fdc.IInstantiationService),q$(1,Vdc.ICompletionsRuntimeModeService),q$(2,uLi.ICompletionsLogTargetService),q$(3,Udc.ICompletionsCopilotTokenManager),q$(4,Hdc.ICompletionsStatusReporter),q$(5,Rdc.IAuthenticationService),q$(6,DLe.ICompletionsFetchService),q$(7,Pdc.IEnvService)],i2r);function lLi(t){return t.status>=400&&t.status<500}a(lLi,"isClientError");var o2r=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new kdc.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 c2r=I(a2r=>{"use strict";p();Object.defineProperty(a2r,"__esModule",{value:!0});a2r.appendToCache=Kdc;function Kdc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(Kdc,"appendToCache")});var ALi=I(Kd=>{"use strict";p();var Jdc=Kd&&Kd.__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=Kd&&Kd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Kd,"__esModule",{value:!0});Kd.CompletionsFromNetwork=Kd.logger=void 0;Kd.postProcessChoices=I_t;Kd.makeGhostAPIChoice=gLi;Kd.telemetryPerformance=f2r;var NLe=iye(),Zdc=ev(),MLe=dw(),Xdc=rd(),efc=HT(),tfc=Gs(),pLi=LE(),rfc=VSr(),nfc=fy(),mLi=Dl(),ifc=aPr(),u2r=s2r(),ofc=L4e(),sfc=$g(),afc=rne(),cfc=TAe(),l2r=c2r(),lfc=C4e(),hLi=c$(),rN=wAe();Kd.logger=new mLi.Logger("ghostText");var d2r=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 Kd.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,rN.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return Kd.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,rN.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return Kd.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,rN.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(f2r,"performance",h,c,l),Kd.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=I_t(h);m&&((0,l2r.appendToCache)(this.completionsCacheService,e,m),Kd.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;Kd.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let E=I_t(y,A);E&&(A.push(E),(0,l2r.appendToCache)(this.completionsCacheService,e,E))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[gLi(m,{forceSingleLine:!1}),g],telemetryData:(0,rN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:hLi.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,rN.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 Kd.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,rN.mkCanceledResultTelemetry)(r)};let h=I_t(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,l2r.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(f2r,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,rN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:hLi.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new NLe.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=MLe.Result.ok(void 0);break;case"canceled":f=MLe.Result.error(new NLe.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=MLe.Result.error(new NLe.NoNextEditReason.NoSuggestions(new efc.StringText(""),void 0));break;case"failed":f=MLe.Result.error(new NLe.NoNextEditReason.Uncategorized(Zdc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=MLe.Result.error(new NLe.NoNextEditReason.GotCancelled(d.reason));break;default:(0,Xdc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){Kd.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,ofc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,pLi.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===pLi.BlockMode.MoreMultiline&&cfc.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:u2r.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 E={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:u,uiKind:u2r.CopilotUiKind.GhostText,postOptions:h,headers:e.headers,extra:f},_=await this.fetcherService.fetchAndStreamCompletions(E,r,o,n);return _.type==="failed"?{type:"failed",reason:_.reason,telemetryData:(0,rN.mkBasicResultTelemetry)(r)}:_.type==="canceled"?(Kd.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:(0,rN.mkCanceledResultTelemetry)(r)}):l(A,_.getProcessingTime(),_.choices)}catch(E){if((0,ifc.isAbortError)(E))return{type:"canceled",reason:"network request aborted",telemetryData:(0,rN.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(_=>Kd.logger.exception(_,E,"Error on ghost text request")),this.userErrorNotifier.notifyUser(E),this.runtimeMode.shouldFailForDebugPurposes())throw E;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,rN.mkBasicResultTelemetry)(r)}}}};Kd.CompletionsFromNetwork=d2r;Kd.CompletionsFromNetwork=d2r=Jdc([wne(0,tfc.IInstantiationService),wne(1,u2r.ICompletionsOpenAIFetcherService),wne(2,nfc.ICompletionsFeaturesService),wne(3,afc.ICompletionsRuntimeModeService),wne(4,mLi.ICompletionsLogTargetService),wne(5,lfc.ICompletionsCacheService),wne(6,rfc.ICompletionsUserErrorNotifierService)],d2r);function I_t(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(I_t,"postProcessChoices");function gLi(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(fLi,"makeGhostAPIChoice");function d2r(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,efc.telemetry)(t,`ghostText.${e}`,l)}a(d2r,"telemetryPerformance")});var hLi=I(I_t=>{"use strict";p();Object.defineProperty(I_t,"__esModule",{value:!0});I_t.contextualFilterCharacterMap=void 0;I_t.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 mLi=I(f2r=>{"use strict";p();Object.defineProperty(f2r,"__esModule",{value:!0});f2r.multilineModelPredict=ifc;function ifc(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 E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.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 b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.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 P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.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 L;t[308]>1e-35?L=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?L=.023223358334607133:L=-.04383410185346742:L=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?L=.023406489302867494:L=-.085521220804058:L=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?L=.028120059780969632:L=-.04211009474298743:t[294]>1e-35?L=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?L=-.0993035220737934:L=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?L=.029770210551187937:L=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?L=.06421359317599738:L=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?L=.024368404612215164:L=-.04045232374803373:t[131]>1e-35?L=.017372701982485795:t[120]>1e-35?L=.08812710275150198:t[18]>1e-35?t[90]>1e-35?L=.18451364351180236:t[7]>33.50000000000001?L=-.03850813130183531:t[195]>1e-35?L=.06966114053446336:t[3]>16.500000000000004?L=-.0012869181693341211:t[0]>4242.500000000001?L=-.054625548611291035:L=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?L=.006302103427145562:L=.13967622319898698:t[121]>1e-35?L=-.038798585213145644:t[5]>4544.500000000001?L=-.08050498033009466:L=-.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 O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let j;t[0]>384.50000000000006?t[84]>1e-35?j=-.06088131453064195:t[147]>1e-35?j=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?j=.04219361472548491:j=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?j=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?j=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?j=-.11431764534511478:j=.013549717238356157:j=-.020987333767091276:t[6]>2.5000000000000004?j=-.02914877855133127:j=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?j=-.10087072787978416:t[37]>1e-35?j=-.030467397753331196:t[229]>1e-35?j=-.1017559811057469:t[4]>20.500000000000004?j=-.00413177742240167:t[20]>1e-35?j=.05213315982685969:j=.0037921635866823133:t[8]>51.50000000000001?j=.07327913092421544:t[6]>49.50000000000001?j=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?j=.02744420891894289:j=.11288946357194463:j=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?j=-.012329314369909049:j=.026816658655600168:j=-.0872405354618811:j=.007872673500247845:t[1]>42.50000000000001?j=-.04309044198258254:t[145]>1e-35?j=.07572529147860785:t[7]>5.500000000000001?j=-.013837187093264945:t[1]>17.500000000000004?j=.04208698439539668:j=-.06284346769019863;let Q;t[294]>1e-35?Q=-.0384794324818203:t[266]>1e-35?Q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?Q=.07432960094940501:Q=-.035248735855751855:t[134]>1e-35?Q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?Q=-.01706896375068821:Q=.08212247914968074:t[2]>59.50000000000001?Q=-.09546478958824225:t[6]>53.50000000000001?Q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?Q=.02816463285971267:Q=.15449139016588445:Q=-.10199787406123524:Q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?Q=-.13924786681478077:Q=-.0072772442570213335:t[39]>1e-35?Q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?Q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?Q=-.11174465335620831:Q=.00013144040097180107:Q=-.08493919336681105:t[42]>1e-35?Q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?Q=-.015540659878839153:Q=-.14442609417300142:t[21]>1e-35?Q=-.025251979447574083:Q=.0023698372645272847:t[18]>1e-35?Q=.07269739695712212:t[8]>2592.5000000000005?Q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?Q=-.01835130329646532:t[9]>45.50000000000001?Q=.02023047454629885:Q=.16469378262221102:Q=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.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?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.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 ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Ue;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Ue=.009769895322846493:Ue=-.10620052926943656:t[9]>19.500000000000004?Ue=.03781202525403449:t[9]>14.500000000000002?Ue=-.11485785321365344:t[9]>6.500000000000001?Ue=.07677177833073881:t[0]>4342.500000000001?Ue=-.07079285609687631:t[49]>1e-35?Ue=.06156814809246001:Ue=-.014788509042554625:Ue=-.032659201618470655:t[5]>5207.500000000001?Ue=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Ue=-.03094160322187924:t[1]>29.500000000000004?Ue=.09474646043921069:Ue=.023445783928231618:Ue=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Ue=-.07164443768784848:t[1]>29.500000000000004?Ue=.089473622509272:t[8]>597.5000000000001?Ue=-.08155349903101317:Ue=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Ue=-.004003900679358653:t[190]>1e-35?Ue=-.09236113461485262:t[8]>3198.5000000000005?Ue=-.0124130160451179:Ue=.018453070064009328:t[15]>1e-35?Ue=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Ue=-.0009580759587680961:Ue=-.03227283036698222:Ue=.01369287669536875:t[1]>50.50000000000001?Ue=-.04213060332500437:t[35]>1e-35?Ue=-.11508095777767471:t[190]>1e-35?Ue=-.08611884672400155:t[297]>1e-35?Ue=.05723551879433584:Ue=-.004829340082311461;let ke;t[183]>1e-35?ke=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?ke=-.11753465135886734:ke=-.007515490299047085:ke=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?ke=-.12371142493530439:t[1]>36.50000000000001?ke=.032189417575190435:ke=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?ke=-.0784518658439288:t[2]>54.50000000000001?ke=.12477882322370665:ke=.000313468482399738:ke=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?ke=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?ke=.0353146070135579:ke=-.06327619611098285:ke=.02813577701641991:ke=-.12354390728506215:t[34]>1e-35?ke=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?ke=-.01245803535276381:ke=-.07169472553475001:t[1]>11.500000000000002?ke=.12989984824561698:ke=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?ke=.010390226893521422:t[10]>14.500000000000002?ke=.16790888126487719:ke=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?ke=-.043398307129729134:ke=.09963544907820426:t[9]>30.500000000000004?ke=-.13540713124984502:t[9]>17.500000000000004?ke=.0509435850590757:ke=-.04761897852404613:t[4]>78.50000000000001?ke=.09197086656470652:ke=.0006771050176682337;let X;t[122]>1e-35?t[6]>36.50000000000001?X=.05686884451670743:X=-.05334759543084309:t[266]>1e-35?X=-.08603579519816038:t[157]>1e-35?X=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?X=-.0499592651503952:t[0]>725.5000000000001?X=.11780353905132664:X=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?X=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?X=-.03190157229022304:X=.07985197845805492:X=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?X=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?X=-.027174047777029083:X=.057117284879796476:t[3]>43.50000000000001?X=-.0016147040913107311:X=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?X=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?X=-.01466076988151239:X=.13375695925484857:X=-.04885873081899647:t[0]>5566.500000000001?X=.11086813028591343:t[8]>992.5000000000001?X=-.07622304217072383:X=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?X=.03285858361708423:X=-.12354858211764992:X=.0672788301823281:t[15]>1e-35?X=.08658836986585006:X=-.02741484278509758:t[290]>1e-35?X=-.08161310335133287:t[135]>1e-35?X=-.04824156054814152:X=.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 Z;t[179]>1e-35?Z=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?Z=.1470294450403005:Z=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?Z=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?Z=.07965955447707423:t[10]>10.500000000000002?Z=-.09236156404262426:Z=.03396273196231458:Z=-.13246465021467432:Z=.07092822261735353:Z=-.08753829085942:Z=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?Z=.004705878789890202:Z=.13775378964952867:Z=-.04770928980587811:t[10]>29.500000000000004?Z=.011221519891071544:t[0]>3853.5000000000005?Z=.06365381191628273:Z=.15506252245336827:t[1]>37.50000000000001?Z=-.07254777021042061:Z=.026514587757252385:t[308]>1e-35?Z=.04115804816617256:t[10]>26.500000000000004?Z=.02077721353011946:t[5]>3548.5000000000005?Z=-.1280907116663952:Z=-.021974774274438:t[306]>1e-35?Z=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?Z=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?Z=-.005710865560475598:t[94]>1e-35?Z=-.06751507982853555:Z=.027250040757588703:t[9]>52.50000000000001?Z=.07060357924595577:Z=-.030297760713011795:Z=-.0006005400085266517;let ue;t[113]>1e-35?ue=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ue=-.06996356565314456:ue=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ue=-.08317707559926495:t[21]>1e-35?ue=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ue=-.010538203005984922:ue=.08454819465349446:t[9]>124.50000000000001?ue=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ue=-.08542251249346582:t[9]>50.50000000000001?ue=-.023428882537657472:ue=.010042500833979073:ue=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ue=.03006025206979096:t[9]>108.50000000000001?ue=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ue=.04222035773042132:ue=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ue=-.07209095448054853:ue=.028065954981903313:ue=.08714651929917122:ue=-.006678820669279169:t[10]>40.50000000000001?ue=.006982396294941626:ue=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ue=-.09351114982645548:t[4]>3.5000000000000004?ue=-.004837550129223451:ue=-.08324141237464677:t[303]>1e-35?ue=.10703037493990825:t[9]>156.50000000000003?ue=-.10803018621648303:t[116]>1e-35?ue=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ue=.10261721665006701:ue=.018994509090668264:ue=.0011244262442038839;let qe;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?qe=-.08404263465005328:t[0]>3682.5000000000005?qe=.041259223920298876:t[1]>29.500000000000004?qe=-.09541257493441671:qe=.001482192721625409:qe=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?qe=-.08268996098437432:t[230]>1e-35?qe=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?qe=-913218977737457e-19:t[4]>10.500000000000002?qe=-.056334165674005156:t[127]>1e-35?qe=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?qe=-.04231200150318989:t[10]>42.50000000000001?qe=.10182973257894812:qe=.015934763950068445:qe=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?qe=-.041117068322885315:qe=.1167767830037126:qe=.13611206992387337:t[10]>41.50000000000001?qe=-.07120286010564107:qe=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?qe=-.07702290997669524:t[198]>1e-35?qe=.08776558554437136:qe=-.008290740324975692:t[2]>32.50000000000001?qe=.07198457624219955:qe=.005463113714361629:qe=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?qe=.03295785445437507:qe=.15140250150674536:qe=-.035613213948910254:t[186]>1e-35?qe=.06849425535860769:t[96]>1e-35?qe=.06028225812727254:qe=-.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 ce;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ce=-.01386103677247845:ce=.11386694333005128:t[4]>27.500000000000004?ce=-.021862617610091336:t[2]>31.500000000000004?ce=.0828858469030438:ce=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ce=.11303635767048735:ce=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ce=-.04238798044549342:ce=.022091190130494303:t[5]>5082.500000000001?ce=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ce=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ce=-.04291104140431434:t[17]>1e-35?ce=.11256797532342613:ce=-.017206916368289193:ce=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ce=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ce=.03581712466863222:ce=.14770264307668884:t[8]>73.50000000000001?ce=-.13093289429740068:ce=.042461737442702936:t[52]>1e-35?ce=.0501831919044939:ce=-.010450249720465756:ce=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ce=.0005381332165438493:ce=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ce=.04849637311285226:ce=-.036671377119808564:t[0]>421.50000000000006?ce=.00020968499911058945:ce=.11636422423182405:ce=-.12687837788222575:ce=.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 we;t[294]>1e-35?t[10]>50.50000000000001?we=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?we=-.06063239096209816:we=.03317022411417386:we=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?we=-.013608609329298802:we=.09078000157330264:t[99]>1e-35?we=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?we=-.07536137260189814:we=.006253266595455118:t[10]>28.500000000000004?we=-.006106041147592768:t[9]>156.50000000000003?we=-.11828932797811101:t[94]>1e-35?we=-.02566078479505714:t[303]>1e-35?we=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?we=-.08401252789168523:t[5]>4244.500000000001?we=.026372887658499107:t[1]>16.500000000000004?we=-.027836756345634026:we=.09205362097909099:we=.00934612788718244:t[203]>1e-35?we=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?we=-.09580979052540028:t[1]>50.50000000000001?we=-.06402211827281554:we=.08342858760095972:t[2]>36.50000000000001?we=.008114897658204584:t[92]>1e-35?we=.09541587072672864:we=-.022342147210555434:we=-.01660492519175128:we=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?we=.15846731118501817:we=.039498507912023195:t[245]>1e-35?we=.07008718676813333:we=.0019806389728814727;let Be;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Be=-.01192072916082109:Be=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Be=.06874032717466054:t[4]>40.50000000000001?Be=-.07752510020707537:t[1]>76.50000000000001?Be=-.09944032260703917:t[8]>1381.5000000000002?Be=-.054466635810800745:t[1]>32.50000000000001?Be=.05974084520839573:Be=-.0384718740755954:Be=-.11374190719134032:t[0]>2151.5000000000005?Be=-.13703645155803298:Be=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Be=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Be=.013539805885738608:Be=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Be=.09941880179344399:Be=-.01608127391210995:Be=.08025226531247417:t[9]>67.50000000000001?Be=.13525448212444113:t[6]>61.50000000000001?Be=-.05511099182158894:t[94]>1e-35?Be=-.06821509831783572:t[128]>1e-35?Be=.11361314817714643:Be=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Be=-.09954181329804547:t[197]>1e-35?Be=.10102833149755386:t[188]>1e-35?Be=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Be=-.03781554214742005:Be=.09927933385592314:Be=-.020006000056720083:Be=-.10520473615957895:Be=-.12006990846253787:Be=-.00026111570975317574;let rt;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?rt=-.019188245509744628:rt=-.13354864350075848:t[0]>2461.5000000000005?rt=.051885477468354396:rt=-.0833581968852119:rt=.08233441701532287:rt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?rt=.09926337893072812:rt=-.027753610497327715:t[0]>1972.5000000000002?rt=-.09780045823152517:rt=.032380915168504935:rt=.11502632261226381:t[17]>1e-35?rt=-.06094965899579662:t[10]>40.50000000000001?rt=-.07500475582440802:rt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?rt=-.09584538995220808:rt=-.00908705814304442:rt=.03203281520813893:t[10]>49.50000000000001?rt=-.03146271513986384:t[2]>63.50000000000001?rt=.13172001315536286:t[224]>1e-35?rt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?rt=.09521549382082259:rt=-.04414925613522197:t[0]>1847.5000000000002?rt=-.09118580379557353:rt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?rt=.03525144509943896:rt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?rt=-.04766112322938157:t[2]>10.500000000000002?rt=.0728516504357201:rt=-.05049625965272536:rt=-.10868663055825774:rt=.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 _t;t[115]>1e-35?_t=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?_t=-.10131179514695865:t[8]>938.5000000000001?_t=.10203729808015481:_t=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?_t=.03574015165562999:_t=-.07763042506449493:_t=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?_t=.0665706259130275:_t=-.06586817559309924:_t=.11925564412287476:_t=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?_t=.046017146627455346:_t=-.08623321630086885:t[8]>1765.5000000000002?_t=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?_t=.11143827902215087:_t=-.01817808730473413:_t=.16980985030210127:_t=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?_t=.010168994879727824:_t=-.09099594488792513:t[9]>1.5000000000000002?_t=.0533459678147928:_t=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?_t=-.062346959148773695:t[1]>47.50000000000001?_t=-.0021578343835599316:t[2]>27.500000000000004?_t=.19567373210166172:_t=.07851555379116423:t[18]>1e-35?_t=.03711549097804649:t[8]>359.50000000000006?_t=.012492346746905587:t[4]>20.500000000000004?_t=.047511695735697544:_t=-.07999269063948773:_t=6802045404471004e-20;let Dt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Dt=.0011484728213539738:Dt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Dt=-.09828874964938798:t[8]>1586.5000000000002?Dt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Dt=.011938269926919522:Dt=.17541983715953954:t[19]>1e-35?Dt=.023002786011088672:Dt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Dt=.06508934844183291:Dt=-.10168553534835639:Dt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Dt=.021140806225203937:Dt=-.1167833342453639:t[2]>33.50000000000001?Dt=.13163585734056618:Dt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Dt=.06314479201263888:Dt=-.09639088327091713:t[10]>29.500000000000004?Dt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Dt=40577156464836036e-21:Dt=.12322387121810757:Dt=-.03697224045046014:t[1]>22.500000000000004?Dt=.016474835887320276:Dt=.16919298733903063:Dt=.07633203630214054:Dt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Dt=.14150493354700563:Dt=-.01831155354975749:t[1]>28.500000000000004?Dt=-.07952557178685365:t[10]>28.500000000000004?Dt=.0665695554984927:Dt=-.053640139319277094:Dt=.0004754840665898665;let $t;t[76]>1e-35?$t=-.06814884255939921:t[179]>1e-35?$t=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?$t=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?$t=.004193658608848433:$t=-.1066968975983452:t[8]>302.50000000000006?$t=.05476730110440451:$t=-.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?$t=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?$t=.013555772109446666:$t=-.09856116699770784:$t=.0284329611813383:t[2]>52.50000000000001?$t=.04008708444763762:t[9]>29.500000000000004?$t=-.1289599546008197:$t=-.018566534248335896:t[8]>747.5000000000001?$t=.02236484980076122:$t=.1148871655157582:t[8]>3084.0000000000005?$t=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?$t=.03164751204281298:$t=.11752140436184891:t[9]>42.50000000000001?$t=-.07180559595410106:t[22]>1e-35?$t=.09325040416256854:$t=-.016041122807939914:$t=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?$t=-.010718250133458515:$t=.09818827994853763:$t=.010180038981174032:$t=-.039472162599295535:t[9]>170.50000000000003?$t=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?$t=-.08674788057474031:$t=.02077653508548371:$t=-.0003536561382007414;let Gt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?Gt=.018337297491457794:Gt=-.05926206443180149:Gt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?Gt=.10747078482128616:t[126]>1e-35?Gt=-.10550625192391357:t[7]>71.50000000000001?Gt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?Gt=.1317396472229434:Gt=-.025035791351328947:Gt=-.0728334305864372:t[8]>963.5000000000001?Gt=.023642201723096064:Gt=.183010326734258:t[128]>1e-35?Gt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?Gt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?Gt=-.1088876900335281:Gt=.02758317023002635:Gt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?Gt=-.01928020117446408:Gt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?Gt=.07893723375925096:Gt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?Gt=-.10301657587280551:Gt=.005787463140224318:Gt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?Gt=-.019296977889522397:Gt=-.07274529751752634:t[1]>30.500000000000004?Gt=-.050368901143148286:Gt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?Gt=.0015332402792773946:Gt=.09930153676749967:Gt=-.06370844564357069:Gt=.00042272155209927616;let Ie;t[71]>1e-35?t[4]>17.500000000000004?Ie=.12586844370423247:Ie=-.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?Ie=-.08474891624263797:t[8]>125.50000000000001?Ie=.08125086980439704:Ie=-.04082085238068532:t[0]>3863.5000000000005?Ie=.020481535807469208:Ie=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ie=-.019110200161573936:Ie=-.12387719685855114:t[0]>1102.5000000000002?Ie=.08376595701957407:Ie=-.031821919580524834:t[9]>4.500000000000001?Ie=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ie=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ie=.1349841206807871:Ie=.011864053595560297:t[1]>41.50000000000001?Ie=-.08203662486612544:t[2]>18.500000000000004?Ie=-.009541865642346947:Ie=.08345043168501759:t[2]>10.500000000000002?Ie=-.09585031818030947:Ie=.019432330487099865:Ie=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ie=.11951517733981365:Ie=-.016651014735738538:t[1]>28.500000000000004?Ie=-.07410922545030711:t[10]>28.500000000000004?Ie=.05886430683844788:Ie=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ie=.04802269879144705:Ie=-.026208212831796737:t[4]>45.50000000000001?Ie=-.03227476944664786:Ie=.05124575625622705:Ie=.00020506696916003137;let F;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?F=-.03042091758483443:t[10]>14.500000000000002?F=.09816619204768777:F=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?F=-.02381165060401718:F=-.10950361804974783:F=.03538211665111128:t[212]>1e-35?t[19]>1e-35?F=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?F=-.06371052144380579:F=.0835500621252692:F=-.10408255929333915:t[1]>74.50000000000001?F=.13208968122712403:t[1]>64.50000000000001?F=-.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?F=.09922816902423433:F=.016366955328796718:F=.1592412560903584:t[1]>39.50000000000001?F=.05409467990258923:F=-.08260633210459611:F=-.06307205775247567:t[9]>36.50000000000001?F=.040253940015648144:F=.14202568969471283:F=-.028761848341594044:F=.08994073058773508:t[0]>807.5000000000001?F=-.043427848826323195:F=.04573516446846493:t[20]>1e-35?t[188]>1e-35?F=-.0758877731600639:t[23]>1e-35?F=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?F=.08124700978741987:F=.013296063087086852:t[7]>5.500000000000001?F=-.01640196088612987:F=-.12685498840146067:F=-.0004940792382459551;let be;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?be=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?be=.08513773825688947:be=-.1184664832315282:be=.05676963535893477:be=.14263843210340613:be=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?be=-.10669720555606924:be=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?be=.0664744575868955:be=-.08469256188890871:be=-.026746678040592144:t[281]>1e-35?be=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?be=.012131807587207655:be=-.12776015795398743:be=.04320472481083551:be=.08390980661550446:t[10]>227.50000000000003?be=-.09771783809101153:t[10]>130.50000000000003?be=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?be=-.07610698254064358:t[8]>902.5000000000001?be=-.03136381213599649:t[131]>1e-35?be=.0704821739127936:t[224]>1e-35?be=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?be=.10431473040024908:t[8]>841.5000000000001?be=.07304745320500514:be=-.038011541882439825:be=-.01679746695007364:t[0]>3129.5000000000005?be=.05589952587431965:t[210]>1e-35?be=.06227198085800842:be=-.0011341890997947812:t[8]>740.5000000000001?be=.04817300084412584:be=-.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 pe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.07554189644995735:pe=-.052089349455904946:pe=-.10148206848169845:t[113]>1e-35?pe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?pe=.07172653627995676:pe=-.07602959317610998:pe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?pe=-.0399322883690891:pe=.06523495517476098:pe=-.10358715295743802:t[193]>1e-35?pe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?pe=.015928764772252406:pe=.1341513061552287:pe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?pe=-.033592997607280156:pe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?pe=-.08402551858097379:pe=.017401984506038796:t[1]>25.500000000000004?pe=.13337205393591278:pe=-.01160208350090984:pe=.06708317942315471:t[8]>227.50000000000003?pe=-.08486943882418681:pe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?pe=-.10496268177586783:pe=-.020921489532370493:pe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?pe=.11639296062157028:pe=-.004275784356569115:t[32]>1e-35?pe=-.07297384970166025:pe=.006026841626381599:pe=.002034611134960428;let Se;t[248]>1e-35?Se=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Se=-.06455513326540585:t[1]>29.500000000000004?Se=.07718474591552532:t[4]>7.500000000000001?Se=.040139336931404826:Se=-.09685734690563386:Se=.00015327283570347363:t[9]>88.50000000000001?Se=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Se=-.04077257804338707:Se=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Se=.03778141591008941:Se=-.06459919920634845:Se=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Se=.14063930759326346:t[0]>179.50000000000003?Se=.07287482250668585:t[8]>1180.5000000000002?Se=-.14419393112726253:t[10]>28.500000000000004?Se=-.07993142770099469:t[17]>1e-35?Se=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Se=.05527969663610186:Se=-.10824385941441346:t[3]>11.500000000000002?Se=.12358502961047915:Se=-.017509147119622873:t[0]>74.50000000000001?Se=-.014907705458730486:t[8]>95.50000000000001?Se=-.02225118168342062:Se=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Se=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Se=.04962819555610421:Se=-.07213577821855309:Se=.09139529824708481:t[19]>1e-35?Se=.013439401088345224:Se=-.049274647207292056:Se=.10531673719686951;let Fe;t[40]>1e-35?t[0]>1937.5000000000002?Fe=-.06421671152073961:Fe=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Fe=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Fe=-.03520420769287065:t[8]>1085.5000000000002?Fe=-.019817352506127633:Fe=.11444439424520964:Fe=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Fe=-.010490117519863269:Fe=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Fe=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Fe=.06619344145920268:t[0]>4091.5000000000005?Fe=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Fe=.10016091391222309:Fe=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Fe=-.019511460451434884:Fe=-.11643672465055221:t[2]>18.500000000000004?Fe=.07848228087333317:t[8]>55.50000000000001?Fe=.032583027899956235:Fe=-.11209832692153521:t[11]>1e-35?Fe=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Fe=-.09996887746328006:t[9]>2.5000000000000004?Fe=.02157682011863397:Fe=-.05247727848991843:Fe=.07409150201483244:t[1]>38.50000000000001?Fe=-.11378466075449625:t[224]>1e-35?Fe=-.10741749127732923:t[1]>26.500000000000004?Fe=.07343136534146562:Fe=-.07013573628594773:t[25]>1e-35?Fe=-.04626669734164317:Fe=.05518333197956482:Fe=.00032434010867555516;let te;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?te=.026313251010808853:te=-.08997339150292381:te=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?te=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?te=.0905155504503746:t[8]>1049.5000000000002?te=-.062312558183394054:t[8]>719.5000000000001?te=.09583836191410239:t[0]>3719.5000000000005?te=-.0778097309430818:te=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?te=-.12920865648544927:t[0]>2699.5000000000005?te=-.07086587879041864:te=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?te=-.11377786322600797:te=-.009486325820117998:t[1]>55.50000000000001?te=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?te=-.07938291201004219:t[2]>36.50000000000001?te=.01520046732530246:te=.13649854049662832:te=-.07145015938528873:t[8]>407.50000000000006?te=-.00350257360822279:te=.11332047082193297:te=-.10060624458629897:te=.05429496612497562:t[8]>1446.5000000000002?te=.006073419197482838:te=-.08718676350883998:te=-.11532497988252638:te=.10766270463068293:t[34]>1e-35?te=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?te=-.0004109812623829506:te=.021601073497455662:te=-7343540098965853e-20;let Te;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?Te=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?Te=.05995640200798119:t[0]>3443.5000000000005?Te=-.14698883458733583:Te=-.030039164579240187:t[189]>1e-35?Te=-.06086763220538141:t[1]>86.50000000000001?Te=-.05096727866142538:t[4]>64.50000000000001?Te=.11240554253834577:t[4]>45.50000000000001?Te=-.030279760168394117:t[6]>45.50000000000001?Te=.10161088917815142:t[10]>77.50000000000001?Te=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?Te=-.06672020005240323:Te=.08831457502630258:t[8]>2592.5000000000005?Te=-.052617701047376654:t[10]>29.500000000000004?Te=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?Te=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?Te=-.064099222705728:Te=.044332487521538365:t[0]>2882.5000000000005?Te=.031099546885005065:Te=.12938467051623853:t[0]>4221.500000000001?Te=-.0928676413498701:t[9]>30.500000000000004?Te=-.05781824812803708:Te=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?Te=-.06648105454098469:Te=.05985487552383097:Te=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?Te=.05282385499619401:t[1]>66.50000000000001?Te=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?Te=.027885690791379255:Te=-.08407126408362446:Te=.014432924125571093:Te=-9903435845205118e-20;let Ge;t[76]>1e-35?Ge=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?Ge=.013633653464240465:Ge=-.10164319411983509:Ge=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?Ge=.00632864847804078:Ge=-.08393000368134668:Ge=.07870508617440916:t[284]>1e-35?Ge=.1092302727710421:Ge=-.0025505047582483234:t[248]>1e-35?Ge=.07101822393621864:t[274]>1e-35?Ge=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?Ge=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?Ge=.025081789181021243:Ge=-.014813325803582618:t[9]>33.50000000000001?Ge=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?Ge=.11926990418060353:Ge=.01852125513565268:Ge=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?Ge=-.1178464984373743:t[283]>1e-35?Ge=.043370859226927405:t[5]>4320.500000000001?Ge=-.01103141226366587:t[8]>1104.5000000000002?Ge=-.023053423988095886:Ge=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?Ge=.000579145585864887:Ge=.03389152834202143:t[128]>1e-35?Ge=-.14527722052568462:t[210]>1e-35?Ge=-.08915971541902741:t[7]>9.500000000000002?Ge=-.03307314577076116:t[18]>1e-35?Ge=-.05521712302023565:Ge=.009315605032770029:Ge=.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 se;t[3]>7.500000000000001?t[157]>1e-35?se=-.07514182877923786:se=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?se=.028692053800951845:se=.14081686716133598:se=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?se=.0037139292567243084:se=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?se=.01202688580305612:se=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?se=.043935495082738626:se=-.05639305759669704:t[247]>1e-35?se=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?se=.10331836202616368:se=.0006926658459781341:t[96]>1e-35?se=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?se=-.0741403257305367:se=.022900127535540854:t[7]>3.5000000000000004?se=.038110741403836294:se=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?se=-.09552842289807008:t[1]>27.500000000000004?se=.012505935885798007:se=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?se=-.1046104767723845:se=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?se=.023466328488582572:se=.11730925774586994:se=-.04771965631104874:se=.17059689880751394:se=-.08181850955999449:t[26]>1e-35?se=-.12727482696678769:se=-.014343123272734182;let me;t[147]>1e-35?t[1]>53.50000000000001?me=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?me=-.02763546051134888:me=.06423344777499343:me=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?me=.049825139823021586:t[7]>22.500000000000004?me=-.01131680751379858:t[0]>2579.5000000000005?me=-.10673674485369694:me=-.015387212937189957:me=.04347325151148724:t[179]>1e-35?me=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.0650355590939066:me=-.0473332870892226:me=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?me=.11139543329789044:t[126]>1e-35?me=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?me=.06370903833231022:t[10]>29.500000000000004?me=.03415223859607161:t[10]>3.5000000000000004?me=-.07415518117873297:me=-.0014119203473324082:me=.12617652343819508:t[9]>41.50000000000001?me=-.10311145857176976:t[8]>2757.5000000000005?me=-.08106484219011428:t[7]>71.50000000000001?me=-.09783384432091176:t[1]>88.50000000000001?me=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?me=-.008884084501608536:me=.061339437777743616:me=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?me=.01526664064166223:me=.13534828515415498:me=-.06985484465894776:me=.0005758961943178744;let Ce;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Ce=-.029152732370514342:Ce=.07173628916139178:t[1]>36.50000000000001?Ce=-.08859111297255318:Ce=.0018030071815630785:Ce=.13652461563759322:Ce=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Ce=-.07145140450454163:t[21]>1e-35?Ce=-.07422841663493233:Ce=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Ce=.11864240653986852:t[3]>33.50000000000001?Ce=-.08821209591953476:Ce=.05706392280054726:Ce=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Ce=.01953613016837112:Ce=-.059781039130025006:t[148]>1e-35?Ce=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Ce=.07207826841738371:t[202]>1e-35?Ce=.08163917539410503:Ce=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Ce=-.06858280496900336:Ce=-.1781828899516648:Ce=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Ce=.018232649414147116:Ce=-.04419781124222661:Ce=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Ce=.11452368095776105:Ce=-.036496437259924026:Ce=-.040445338739465486:Ce=.0816572651001145:Ce=-.08968914517368663:Ce=.0002826343082585516;let He;t[189]>1e-35?t[0]>5269.500000000001?He=-.08839493050459957:t[10]>85.50000000000001?He=.10046908365702462:t[8]>2592.5000000000005?He=-.09632233975926387:t[8]>2000.5000000000002?He=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?He=.035504970430426296:t[1]>31.500000000000004?He=-.1133764813142531:He=-.01138280942244812:t[8]>1125.5000000000002?He=.09800530246229806:He=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?He=.07316772160107896:He=-.059095014819051765:He=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?He=-.09150209066166894:t[8]>3084.0000000000005?He=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?He=-.04449234460408263:He=.05568837973347338:He=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?He=.12741077850267066:He=.007372371864985329:t[2]>39.50000000000001?He=.02295917234617787:He=.14966532083907075:t[1]>39.50000000000001?He=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?He=-.02511861881285652:t[1]>27.500000000000004?He=.08683660011672288:He=.02956214835267301:t[9]>15.500000000000002?He=-.016538805462996232:He=.04352738094981517:He=-.05561856645643868:t[9]>170.50000000000003?He=-.07996752635874248:t[179]>1e-35?He=-.09065975936933919:He=-.00042817975060427177;let $e;t[39]>1e-35?t[4]>25.500000000000004?$e=.03443173196222934:$e=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?$e=-.0013415395759330318:$e=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?$e=.002297618040307216:$e=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?$e=-.015297257305397608:$e=.09651828834062742:$e=-.06636003334371929:t[10]>11.500000000000002?$e=.17631616138309397:t[0]>1639.5000000000002?$e=3804386478092585e-20:$e=-.09099296398683193:$e=-.06874415876172972:t[0]>2151.5000000000005?$e=-.1311264883406766:$e=.00809052010141122:t[253]>1e-35?$e=-.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?$e=.045038497754638605:$e=-.07770167665661752:$e=-.08596294280650517:$e=.08538655727027213:$e=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?$e=.054627956617973275:t[1]>61.50000000000001?$e=-.11994465088415499:t[4]>8.500000000000002?$e=.06676200239406452:$e=-.027503148069376867:t[8]>676.5000000000001?$e=-.10363964928357075:t[4]>8.500000000000002?$e=-.07589816227175682:$e=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?$e=.009093153189012338:$e=-.06119765876605404:$e=.0004668642103528348;let et;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?et=-.10100794502567233:et=.08000205636470442:et=-.11945419826856896:t[113]>1e-35?et=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?et=.1224302423880318:et=-.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?et=.0019277012166729114:t[1]>28.500000000000004?et=-.054445821715687494:et=.045645722976713245:t[30]>1e-35?et=.13402660155331655:et=.008921176001777645:et=-.058547426505451076:et=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?et=-.13526418192218206:et=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?et=.0007263224246135398:et=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?et=-.11575657261278308:et=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?et=-.01995960178292952:et=.11216586049153021:et=-.10050961087149474:et=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?et=.10303451081526649:et=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?et=-.043799548968209395:et=-.12451444314954115:t[4]>12.500000000000002?et=-.03838117361958468:et=.06504990789767144:t[57]>1e-35?et=.06890006938293915:et=.0003914274695562949;let ct;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?ct=.004271749009686975:ct=-.10523878297127605:ct=.04633982158107851:ct=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?ct=-.08655730561951676:t[8]>919.5000000000001?ct=-.0676453705610183:t[7]>18.500000000000004?ct=-.027787974193650575:ct=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?ct=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?ct=-.03473877164537313:t[8]>719.5000000000001?ct=.10471053866934404:ct=.008236107678382981:t[4]>57.50000000000001?ct=.09412219478825269:t[10]>66.50000000000001?ct=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?ct=-.040681323751002293:ct=.06374650297561021:ct=.12884615227401788:t[10]>5.500000000000001?ct=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?ct=-.05474068967150784:ct=.03744700650806603:ct=-.07846396348680855:t[1]>42.50000000000001?ct=.018972315810821302:ct=.10953621007604744:t[5]>4439.500000000001?ct=.010999776705494586:t[1]>40.50000000000001?ct=-.12394200059775967:t[10]>2.5000000000000004?ct=.013528093962849453:ct=-.09222088417048682:ct=-.12662967149701485:ct=.09327296405849603:t[3]>99.50000000000001?ct=-.013581954439986752:ct=.0005526498251862075;let bt;t[187]>1e-35?t[243]>1e-35?bt=-.08392792551692502:t[10]>68.50000000000001?bt=.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?bt=-.0825306209711224:bt=.049559996084532945:bt=-.1064938580886302:bt=.03353240732240275:bt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?bt=.16966001471529374:t[1]>57.50000000000001?bt=-.005772777673676247:bt=.09383677041525058:t[8]>747.5000000000001?bt=.054068175469351235:bt=-.049968216310277036:t[8]>753.5000000000001?bt=-.0679383555784074:t[4]>8.500000000000002?bt=-.059757341189735386:bt=.05701083682780414:bt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?bt=.05820296128730006:bt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?bt=.15340611616954566:bt=.04385036188666874:t[0]>4449.500000000001?bt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?bt=.004840354641006495:bt=.09967827580276283:bt=.11605363537391578:t[9]>19.500000000000004?bt=-.0735831692725717:bt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?bt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?bt=-.02442182361342386:bt=.10334853004243093:bt=-.030431948680167104:bt=-956078595250818e-19;let ht;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?ht=-.040232505718244854:t[0]>3030.5000000000005?ht=.0634109586813073:ht=-.04043617034245621:ht=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?ht=-.007859096946435131:ht=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?ht=.05515771679628051:ht=-.04214471312668263:ht=-.09589322222261765:t[193]>1e-35?ht=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?ht=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?ht=-.08152604001147906:t[11]>1e-35?ht=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?ht=.13100930780107503:t[10]>25.500000000000004?ht=.05921074710011526:ht=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?ht=.0009447118243153454:ht=-.09820565036865991:ht=.057146909749745546:t[0]>2115.5000000000005?ht=-.12331216726611678:ht=.007281983677694285:t[2]>56.50000000000001?ht=.012310154675612615:ht=-.08873665774670461:t[6]>25.500000000000004?ht=.134708740821879:t[9]>5.500000000000001?ht=-.0805901581148979:t[224]>1e-35?ht=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?ht=.10842593386554122:t[2]>13.500000000000002?ht=.06466798320378395:ht=-.08578130788886655:ht=-.03590892078300114:ht=.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 ae;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ae=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ae=.020637047900190317:ae=-.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?ae=-.04632587527094407:ae=.08603684785510396:ae=-.05101401015448496:ae=.025466432054358498:ae=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ae=.020385355430046367:ae=.12032592051335252:ae=-.012387370292173013:t[2]>23.500000000000004?ae=-.12568545484492677:ae=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ae=.043528764484784536:ae=.14352071657196003:ae=-.009332833816977268:ae=.11186782227735846:ae=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ae=-.05649104643152564:ae=.03884200719305747:t[42]>1e-35?ae=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ae=-.04103416502526736:ae=.04881823954656287:t[4]>15.500000000000002?ae=.009342724662897898:t[0]>3969.5000000000005?ae=-.025637309961309498:ae=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ae=-.08185697075265091:t[0]>2215.5000000000005?ae=.030063975892297354:t[0]>807.5000000000001?ae=-.03924325550733229:ae=.0415330999189793:ae=-.00024374664461674863;let Re;t[3]>7.500000000000001?Re=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Re=.025798416259686565:Re=.13251610353146012:Re=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Re=-.11098564237775424:Re=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Re=.15347826616466054:t[3]>4.500000000000001?Re=.10379320730958941:Re=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Re=.03159791088468647:Re=-.10612873364104258:Re=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Re=-.02335760775001469:Re=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Re=-.011164334474672973:Re=-.06594044410501655:t[207]>1e-35?Re=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Re=-.01725821503981916:Re=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Re=-.04226531631656534:Re=-.14409800530171432:Re=-.03245576341206398:t[8]>4214.500000000001?Re=.0895409165534886:t[247]>1e-35?Re=-.06506383629143335:t[118]>1e-35?Re=-.07214270121257443:t[8]>546.5000000000001?Re=-.004385020865473831:Re=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Re=.046278501133958524:Re=-.030835570926968044:t[0]>493.50000000000006?Re=-.12794504651610425:Re=.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 ze;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?ze=.029186512383291244:t[7]>1.5000000000000002?ze=-.14984127276725573:t[1]>40.50000000000001?ze=.032757060730648144:ze=-.07675575422749602:t[6]>8.500000000000002?ze=.10599766037117893:ze=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?ze=-.051394622947855385:ze=.03237141302699347:ze=.12526173027943244:ze=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?ze=-.07383912482657777:t[0]>5147.500000000001?ze=.07008813937042091:t[10]>38.50000000000001?ze=-.06779203808365307:ze=-.013782769999524498:ze=.0880038869117715:ze=-.12846294176070952:t[281]>1e-35?ze=-.06810806903850834:t[10]>227.50000000000003?ze=-.08937977001661111:t[10]>130.50000000000003?ze=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?ze=.011036530162093841:ze=-.11500797478569702:ze=.03702229366129399:ze=.07242026683784307:t[189]>1e-35?ze=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?ze=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?ze=-.02608892716555304:ze=.09609599320761308:t[9]>105.50000000000001?ze=-.06848127135991534:ze=.0023675721254089715:t[86]>1e-35?ze=-.11049635625500497:ze=-.004847764219432233;let at;t[125]>1e-35?t[0]>3969.5000000000005?at=-.09462233499115416:at=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?at=-.030700661288166148:at=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?at=.03149547314036763:at=-.08166208257451366:t[0]>5850.500000000001?at=-.10228136324773157:t[102]>1e-35?at=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?at=.01782894842128785:t[13]>1e-35?at=.002680190260979968:at=.1773965720476949:t[2]>72.50000000000001?at=.09090831938627947:t[1]>59.50000000000001?at=-.12297206702816128:t[0]>4977.500000000001?at=.09899015653118268:at=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?at=-.0675900954187773:at=.012336403425364092:at=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?at=-.02671721777458802:at=-.09242452991958029:t[284]>1e-35?at=-.08585691288582491:at=.013332890564324447:t[4]>14.500000000000002?at=-.005245022074799553:t[23]>1e-35?at=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?at=-.09289852307936758:t[116]>1e-35?at=-.09686573010015055:t[8]>804.5000000000001?at=.03812547148215318:at=.005162744968176633:t[9]>43.50000000000001?at=-.059246106396159376:at=.050370113808135275:at=.000794041852811028;let Vt;t[3]>7.500000000000001?Vt=.0004981426543104341:t[9]>114.50000000000001?Vt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Vt=-.019061766497948867:Vt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Vt=-.006044199577160493:Vt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Vt=.11486607015912494:t[9]>16.500000000000004?Vt=-.08686820858087294:Vt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Vt=-.022230207980026437:Vt=.1056683690528792:Vt=-.05859530800943035:Vt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Vt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Vt=-.05177544573528314:Vt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Vt=.15159657923771555:Vt=-.0060542654587671055:t[9]>5.500000000000001?Vt=-.042808028205051786:t[1]>48.50000000000001?Vt=-.010449538258110742:Vt=.10026907521968294:Vt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Vt=-.02272452389409874:Vt=-.11202691218244319:t[5]>1809.5000000000002?Vt=-.04460413584255906:Vt=.08196329474205256:t[10]>69.50000000000001?Vt=.10221481166238167:Vt=.0004063052701699382:t[243]>1e-35?Vt=-.07563941678849846:t[18]>1e-35?Vt=.02563513231103432:Vt=-.004740081147303786;let gr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?gr=.057446442918106:gr=-.04404018270156349:gr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?gr=-.05930486238817954:t[1]>29.500000000000004?gr=.06955866121256543:t[8]>597.5000000000001?gr=-.06538593556505168:gr=.06212512595497445:gr=.00021102929959182257:t[9]>90.50000000000001?gr=.0958061289119631:t[102]>1e-35?gr=.07172059675638813:t[1]>47.50000000000001?gr=-.03879798603977766:t[297]>1e-35?gr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?gr=.003805910996312012:gr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?gr=.11252376801858695:t[288]>1e-35?gr=-.10293901912180432:gr=.014669268837893872:t[1]>42.50000000000001?gr=-.05988274123836837:t[145]>1e-35?gr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?gr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?gr=-.03366718308159971:gr=.11936550608549797:t[1]>31.500000000000004?gr=-.07454716789539667:gr=.027859650621164217:t[10]>10.500000000000002?gr=-.11806374092321247:gr=-.03506042229223101:gr=-.0007080765837654515:t[10]>6.500000000000001?gr=-.028077713664996503:t[2]>7.500000000000001?gr=.15803724124216814:gr=.0351381284833169:gr=-.07877953381054767;let cr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?cr=.14144941521975005:cr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?cr=.10514088112381886:t[7]>18.500000000000004?cr=-.10370643555956745:cr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?cr=-.0508129468802936:t[224]>1e-35?cr=-.037816066368733595:t[10]>43.50000000000001?cr=.07793408602607932:cr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?cr=.036972453794202324:cr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?cr=.09475302525132188:cr=-.03580104945898193:cr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?cr=-.1282448778804823:cr=-.014395808269207212:cr=-.008940927190750592:cr=-.1459118815453748:t[0]>4897.500000000001?cr=-.09733068457286576:t[1]>57.50000000000001?cr=.06575271409540207:cr=-.019556422817450115:cr=-.10623959222984136:t[18]>1e-35?cr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?cr=.008125645893104896:cr=-.11084368630465868:cr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?cr=-.05854904579626861:t[4]>5.500000000000001?cr=.02985784951394175:cr=-.03247600140149334:cr=-.11152899295304973:cr=-.00035424577714215764;let Mr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Mr=-.06563670567578264:Mr=.067656954313663:Mr=-.10388217548685377:t[8]>2302.5000000000005?Mr=.07190621943790435:t[4]>67.50000000000001?Mr=.060020507643618604:t[4]>38.50000000000001?Mr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Mr=-.06568134366461277:t[8]>1075.5000000000002?Mr=-.004768057709758692:Mr=.11785959165999467:Mr=-.05080221682879267:Mr=.14814206127494542:Mr=-.07241946332311736:t[253]>1e-35?Mr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Mr=-.02471195342450034:Mr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Mr=-.10741850739482771:Mr=.010051635824944:Mr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Mr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Mr=-.08992396138178163:Mr=.010944365997007212:Mr=.06221307021813793:Mr=.1286024087559141:t[127]>1e-35?Mr=.06568148624531012:t[10]>40.50000000000001?Mr=-.07567979134643352:t[5]>5647.500000000001?Mr=.07594672895572069:Mr=-.018158016446439187:t[6]>55.50000000000001?Mr=.009293422430111872:t[4]>45.50000000000001?Mr=-.017749818406964022:t[2]>46.50000000000001?Mr=.01714136511113982:Mr=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let Yt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?Yt=.05517359070460923:Yt=-.04758751221404857:Yt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?Yt=.1040436595565776:t[9]>21.500000000000004?Yt=.04032250517675179:t[107]>1e-35?Yt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?Yt=.1192453009230486:t[1]>51.50000000000001?Yt=.0443376336292195:Yt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?Yt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?Yt=-.08999822408398037:Yt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?Yt=-.061850439226075:Yt=.08849196353361093:Yt=.10536348167793089:t[92]>1e-35?Yt=.04894947712119185:t[9]>16.500000000000004?Yt=.05900227903883853:t[9]>5.500000000000001?Yt=-.11946594348916476:Yt=-.03652096348071964:t[1]>41.50000000000001?Yt=-.07411603110840567:Yt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?Yt=.08493634342741495:t[11]>1e-35?Yt=-.10899097825564363:Yt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?Yt=.08356655906359918:t[7]>25.500000000000004?Yt=-.09475076526194888:t[10]>5.500000000000001?Yt=-.01999406228763778:Yt=.06696212545889428:t[6]>20.500000000000004?Yt=.14713592661393468:Yt=.0459917279002218:Yt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let $0=ofc(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+L+B+q+M+O+j+Q+U+Y+W+V+z+ie+H+re+le+Le+ge+Ue+ke+X+ee+K+he+Z+ue+qe+ne+ce+Ne+we+Be+rt+st+_t+Dt+$t+Gt+Ie+F+be+Qe+pe+Se+Fe+te+Te+Ge+J+se+me+Ce+He+$e+et+ct+bt+ht+We+ae+Re+Me+ye+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-$0,$0]}a(ifc,"multilineModelPredict");function ofc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(ofc,"sigmoid")});var ALi=I(j$=>{"use strict";p();Object.defineProperty(j$,"__esModule",{value:!0});j$.MultilineModelFeatures=j$.PromptFeatures=void 0;j$.hasComment=p2r;j$.requestMultilineScore=lfc;var q$=hLi(),sfc=mLi(),afc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},gLi={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function p2r(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(afc[r]??[]).some(l=>s.includes(l))}a(p2r,"hasComment");var NLe=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=p2r(e,-2,r),this.rstripSecondToLastLineHasComment=p2r(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`)[0]}return r}a(gLi,"makeGhostAPIChoice");function f2r(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,sfc.telemetry)(t,`ghostText.${e}`,l)}a(f2r,"telemetryPerformance")});var yLi=I(x_t=>{"use strict";p();Object.defineProperty(x_t,"__esModule",{value:!0});x_t.contextualFilterCharacterMap=void 0;x_t.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 ELi=I(p2r=>{"use strict";p();Object.defineProperty(p2r,"__esModule",{value:!0});p2r.multilineModelPredict=ufc;function ufc(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 E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.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 b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.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 P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.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 L;t[308]>1e-35?L=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?L=.023223358334607133:L=-.04383410185346742:L=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?L=.023406489302867494:L=-.085521220804058:L=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?L=.028120059780969632:L=-.04211009474298743:t[294]>1e-35?L=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?L=-.0993035220737934:L=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?L=.029770210551187937:L=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?L=.06421359317599738:L=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?L=.024368404612215164:L=-.04045232374803373:t[131]>1e-35?L=.017372701982485795:t[120]>1e-35?L=.08812710275150198:t[18]>1e-35?t[90]>1e-35?L=.18451364351180236:t[7]>33.50000000000001?L=-.03850813130183531:t[195]>1e-35?L=.06966114053446336:t[3]>16.500000000000004?L=-.0012869181693341211:t[0]>4242.500000000001?L=-.054625548611291035:L=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?L=.006302103427145562:L=.13967622319898698:t[121]>1e-35?L=-.038798585213145644:t[5]>4544.500000000001?L=-.08050498033009466:L=-.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 O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let j;t[0]>384.50000000000006?t[84]>1e-35?j=-.06088131453064195:t[147]>1e-35?j=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?j=.04219361472548491:j=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?j=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?j=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?j=-.11431764534511478:j=.013549717238356157:j=-.020987333767091276:t[6]>2.5000000000000004?j=-.02914877855133127:j=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?j=-.10087072787978416:t[37]>1e-35?j=-.030467397753331196:t[229]>1e-35?j=-.1017559811057469:t[4]>20.500000000000004?j=-.00413177742240167:t[20]>1e-35?j=.05213315982685969:j=.0037921635866823133:t[8]>51.50000000000001?j=.07327913092421544:t[6]>49.50000000000001?j=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?j=.02744420891894289:j=.11288946357194463:j=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?j=-.012329314369909049:j=.026816658655600168:j=-.0872405354618811:j=.007872673500247845:t[1]>42.50000000000001?j=-.04309044198258254:t[145]>1e-35?j=.07572529147860785:t[7]>5.500000000000001?j=-.013837187093264945:t[1]>17.500000000000004?j=.04208698439539668:j=-.06284346769019863;let Q;t[294]>1e-35?Q=-.0384794324818203:t[266]>1e-35?Q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?Q=.07432960094940501:Q=-.035248735855751855:t[134]>1e-35?Q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?Q=-.01706896375068821:Q=.08212247914968074:t[2]>59.50000000000001?Q=-.09546478958824225:t[6]>53.50000000000001?Q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?Q=.02816463285971267:Q=.15449139016588445:Q=-.10199787406123524:Q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?Q=-.13924786681478077:Q=-.0072772442570213335:t[39]>1e-35?Q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?Q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?Q=-.11174465335620831:Q=.00013144040097180107:Q=-.08493919336681105:t[42]>1e-35?Q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?Q=-.015540659878839153:Q=-.14442609417300142:t[21]>1e-35?Q=-.025251979447574083:Q=.0023698372645272847:t[18]>1e-35?Q=.07269739695712212:t[8]>2592.5000000000005?Q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?Q=-.01835130329646532:t[9]>45.50000000000001?Q=.02023047454629885:Q=.16469378262221102:Q=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.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?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.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 ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Ue;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Ue=.009769895322846493:Ue=-.10620052926943656:t[9]>19.500000000000004?Ue=.03781202525403449:t[9]>14.500000000000002?Ue=-.11485785321365344:t[9]>6.500000000000001?Ue=.07677177833073881:t[0]>4342.500000000001?Ue=-.07079285609687631:t[49]>1e-35?Ue=.06156814809246001:Ue=-.014788509042554625:Ue=-.032659201618470655:t[5]>5207.500000000001?Ue=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Ue=-.03094160322187924:t[1]>29.500000000000004?Ue=.09474646043921069:Ue=.023445783928231618:Ue=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Ue=-.07164443768784848:t[1]>29.500000000000004?Ue=.089473622509272:t[8]>597.5000000000001?Ue=-.08155349903101317:Ue=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Ue=-.004003900679358653:t[190]>1e-35?Ue=-.09236113461485262:t[8]>3198.5000000000005?Ue=-.0124130160451179:Ue=.018453070064009328:t[15]>1e-35?Ue=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Ue=-.0009580759587680961:Ue=-.03227283036698222:Ue=.01369287669536875:t[1]>50.50000000000001?Ue=-.04213060332500437:t[35]>1e-35?Ue=-.11508095777767471:t[190]>1e-35?Ue=-.08611884672400155:t[297]>1e-35?Ue=.05723551879433584:Ue=-.004829340082311461;let ke;t[183]>1e-35?ke=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?ke=-.11753465135886734:ke=-.007515490299047085:ke=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?ke=-.12371142493530439:t[1]>36.50000000000001?ke=.032189417575190435:ke=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?ke=-.0784518658439288:t[2]>54.50000000000001?ke=.12477882322370665:ke=.000313468482399738:ke=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?ke=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?ke=.0353146070135579:ke=-.06327619611098285:ke=.02813577701641991:ke=-.12354390728506215:t[34]>1e-35?ke=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?ke=-.01245803535276381:ke=-.07169472553475001:t[1]>11.500000000000002?ke=.12989984824561698:ke=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?ke=.010390226893521422:t[10]>14.500000000000002?ke=.16790888126487719:ke=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?ke=-.043398307129729134:ke=.09963544907820426:t[9]>30.500000000000004?ke=-.13540713124984502:t[9]>17.500000000000004?ke=.0509435850590757:ke=-.04761897852404613:t[4]>78.50000000000001?ke=.09197086656470652:ke=.0006771050176682337;let X;t[122]>1e-35?t[6]>36.50000000000001?X=.05686884451670743:X=-.05334759543084309:t[266]>1e-35?X=-.08603579519816038:t[157]>1e-35?X=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?X=-.0499592651503952:t[0]>725.5000000000001?X=.11780353905132664:X=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?X=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?X=-.03190157229022304:X=.07985197845805492:X=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?X=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?X=-.027174047777029083:X=.057117284879796476:t[3]>43.50000000000001?X=-.0016147040913107311:X=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?X=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?X=-.01466076988151239:X=.13375695925484857:X=-.04885873081899647:t[0]>5566.500000000001?X=.11086813028591343:t[8]>992.5000000000001?X=-.07622304217072383:X=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?X=.03285858361708423:X=-.12354858211764992:X=.0672788301823281:t[15]>1e-35?X=.08658836986585006:X=-.02741484278509758:t[290]>1e-35?X=-.08161310335133287:t[135]>1e-35?X=-.04824156054814152:X=.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 Z;t[179]>1e-35?Z=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?Z=.1470294450403005:Z=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?Z=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?Z=.07965955447707423:t[10]>10.500000000000002?Z=-.09236156404262426:Z=.03396273196231458:Z=-.13246465021467432:Z=.07092822261735353:Z=-.08753829085942:Z=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?Z=.004705878789890202:Z=.13775378964952867:Z=-.04770928980587811:t[10]>29.500000000000004?Z=.011221519891071544:t[0]>3853.5000000000005?Z=.06365381191628273:Z=.15506252245336827:t[1]>37.50000000000001?Z=-.07254777021042061:Z=.026514587757252385:t[308]>1e-35?Z=.04115804816617256:t[10]>26.500000000000004?Z=.02077721353011946:t[5]>3548.5000000000005?Z=-.1280907116663952:Z=-.021974774274438:t[306]>1e-35?Z=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?Z=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?Z=-.005710865560475598:t[94]>1e-35?Z=-.06751507982853555:Z=.027250040757588703:t[9]>52.50000000000001?Z=.07060357924595577:Z=-.030297760713011795:Z=-.0006005400085266517;let ue;t[113]>1e-35?ue=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ue=-.06996356565314456:ue=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ue=-.08317707559926495:t[21]>1e-35?ue=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ue=-.010538203005984922:ue=.08454819465349446:t[9]>124.50000000000001?ue=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ue=-.08542251249346582:t[9]>50.50000000000001?ue=-.023428882537657472:ue=.010042500833979073:ue=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ue=.03006025206979096:t[9]>108.50000000000001?ue=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ue=.04222035773042132:ue=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ue=-.07209095448054853:ue=.028065954981903313:ue=.08714651929917122:ue=-.006678820669279169:t[10]>40.50000000000001?ue=.006982396294941626:ue=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ue=-.09351114982645548:t[4]>3.5000000000000004?ue=-.004837550129223451:ue=-.08324141237464677:t[303]>1e-35?ue=.10703037493990825:t[9]>156.50000000000003?ue=-.10803018621648303:t[116]>1e-35?ue=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ue=.10261721665006701:ue=.018994509090668264:ue=.0011244262442038839;let qe;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?qe=-.08404263465005328:t[0]>3682.5000000000005?qe=.041259223920298876:t[1]>29.500000000000004?qe=-.09541257493441671:qe=.001482192721625409:qe=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?qe=-.08268996098437432:t[230]>1e-35?qe=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?qe=-913218977737457e-19:t[4]>10.500000000000002?qe=-.056334165674005156:t[127]>1e-35?qe=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?qe=-.04231200150318989:t[10]>42.50000000000001?qe=.10182973257894812:qe=.015934763950068445:qe=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?qe=-.041117068322885315:qe=.1167767830037126:qe=.13611206992387337:t[10]>41.50000000000001?qe=-.07120286010564107:qe=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?qe=-.07702290997669524:t[198]>1e-35?qe=.08776558554437136:qe=-.008290740324975692:t[2]>32.50000000000001?qe=.07198457624219955:qe=.005463113714361629:qe=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?qe=.03295785445437507:qe=.15140250150674536:qe=-.035613213948910254:t[186]>1e-35?qe=.06849425535860769:t[96]>1e-35?qe=.06028225812727254:qe=-.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 ce;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ce=-.01386103677247845:ce=.11386694333005128:t[4]>27.500000000000004?ce=-.021862617610091336:t[2]>31.500000000000004?ce=.0828858469030438:ce=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ce=.11303635767048735:ce=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ce=-.04238798044549342:ce=.022091190130494303:t[5]>5082.500000000001?ce=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ce=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ce=-.04291104140431434:t[17]>1e-35?ce=.11256797532342613:ce=-.017206916368289193:ce=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ce=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ce=.03581712466863222:ce=.14770264307668884:t[8]>73.50000000000001?ce=-.13093289429740068:ce=.042461737442702936:t[52]>1e-35?ce=.0501831919044939:ce=-.010450249720465756:ce=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ce=.0005381332165438493:ce=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ce=.04849637311285226:ce=-.036671377119808564:t[0]>421.50000000000006?ce=.00020968499911058945:ce=.11636422423182405:ce=-.12687837788222575:ce=.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 we;t[294]>1e-35?t[10]>50.50000000000001?we=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?we=-.06063239096209816:we=.03317022411417386:we=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?we=-.013608609329298802:we=.09078000157330264:t[99]>1e-35?we=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?we=-.07536137260189814:we=.006253266595455118:t[10]>28.500000000000004?we=-.006106041147592768:t[9]>156.50000000000003?we=-.11828932797811101:t[94]>1e-35?we=-.02566078479505714:t[303]>1e-35?we=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?we=-.08401252789168523:t[5]>4244.500000000001?we=.026372887658499107:t[1]>16.500000000000004?we=-.027836756345634026:we=.09205362097909099:we=.00934612788718244:t[203]>1e-35?we=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?we=-.09580979052540028:t[1]>50.50000000000001?we=-.06402211827281554:we=.08342858760095972:t[2]>36.50000000000001?we=.008114897658204584:t[92]>1e-35?we=.09541587072672864:we=-.022342147210555434:we=-.01660492519175128:we=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?we=.15846731118501817:we=.039498507912023195:t[245]>1e-35?we=.07008718676813333:we=.0019806389728814727;let Be;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Be=-.01192072916082109:Be=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Be=.06874032717466054:t[4]>40.50000000000001?Be=-.07752510020707537:t[1]>76.50000000000001?Be=-.09944032260703917:t[8]>1381.5000000000002?Be=-.054466635810800745:t[1]>32.50000000000001?Be=.05974084520839573:Be=-.0384718740755954:Be=-.11374190719134032:t[0]>2151.5000000000005?Be=-.13703645155803298:Be=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Be=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Be=.013539805885738608:Be=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Be=.09941880179344399:Be=-.01608127391210995:Be=.08025226531247417:t[9]>67.50000000000001?Be=.13525448212444113:t[6]>61.50000000000001?Be=-.05511099182158894:t[94]>1e-35?Be=-.06821509831783572:t[128]>1e-35?Be=.11361314817714643:Be=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Be=-.09954181329804547:t[197]>1e-35?Be=.10102833149755386:t[188]>1e-35?Be=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Be=-.03781554214742005:Be=.09927933385592314:Be=-.020006000056720083:Be=-.10520473615957895:Be=-.12006990846253787:Be=-.00026111570975317574;let rt;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?rt=-.019188245509744628:rt=-.13354864350075848:t[0]>2461.5000000000005?rt=.051885477468354396:rt=-.0833581968852119:rt=.08233441701532287:rt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?rt=.09926337893072812:rt=-.027753610497327715:t[0]>1972.5000000000002?rt=-.09780045823152517:rt=.032380915168504935:rt=.11502632261226381:t[17]>1e-35?rt=-.06094965899579662:t[10]>40.50000000000001?rt=-.07500475582440802:rt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?rt=-.09584538995220808:rt=-.00908705814304442:rt=.03203281520813893:t[10]>49.50000000000001?rt=-.03146271513986384:t[2]>63.50000000000001?rt=.13172001315536286:t[224]>1e-35?rt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?rt=.09521549382082259:rt=-.04414925613522197:t[0]>1847.5000000000002?rt=-.09118580379557353:rt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?rt=.03525144509943896:rt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?rt=-.04766112322938157:t[2]>10.500000000000002?rt=.0728516504357201:rt=-.05049625965272536:rt=-.10868663055825774:rt=.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 _t;t[115]>1e-35?_t=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?_t=-.10131179514695865:t[8]>938.5000000000001?_t=.10203729808015481:_t=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?_t=.03574015165562999:_t=-.07763042506449493:_t=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?_t=.0665706259130275:_t=-.06586817559309924:_t=.11925564412287476:_t=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?_t=.046017146627455346:_t=-.08623321630086885:t[8]>1765.5000000000002?_t=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?_t=.11143827902215087:_t=-.01817808730473413:_t=.16980985030210127:_t=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?_t=.010168994879727824:_t=-.09099594488792513:t[9]>1.5000000000000002?_t=.0533459678147928:_t=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?_t=-.062346959148773695:t[1]>47.50000000000001?_t=-.0021578343835599316:t[2]>27.500000000000004?_t=.19567373210166172:_t=.07851555379116423:t[18]>1e-35?_t=.03711549097804649:t[8]>359.50000000000006?_t=.012492346746905587:t[4]>20.500000000000004?_t=.047511695735697544:_t=-.07999269063948773:_t=6802045404471004e-20;let Dt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Dt=.0011484728213539738:Dt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Dt=-.09828874964938798:t[8]>1586.5000000000002?Dt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Dt=.011938269926919522:Dt=.17541983715953954:t[19]>1e-35?Dt=.023002786011088672:Dt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Dt=.06508934844183291:Dt=-.10168553534835639:Dt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Dt=.021140806225203937:Dt=-.1167833342453639:t[2]>33.50000000000001?Dt=.13163585734056618:Dt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Dt=.06314479201263888:Dt=-.09639088327091713:t[10]>29.500000000000004?Dt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Dt=40577156464836036e-21:Dt=.12322387121810757:Dt=-.03697224045046014:t[1]>22.500000000000004?Dt=.016474835887320276:Dt=.16919298733903063:Dt=.07633203630214054:Dt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Dt=.14150493354700563:Dt=-.01831155354975749:t[1]>28.500000000000004?Dt=-.07952557178685365:t[10]>28.500000000000004?Dt=.0665695554984927:Dt=-.053640139319277094:Dt=.0004754840665898665;let $t;t[76]>1e-35?$t=-.06814884255939921:t[179]>1e-35?$t=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?$t=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?$t=.004193658608848433:$t=-.1066968975983452:t[8]>302.50000000000006?$t=.05476730110440451:$t=-.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?$t=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?$t=.013555772109446666:$t=-.09856116699770784:$t=.0284329611813383:t[2]>52.50000000000001?$t=.04008708444763762:t[9]>29.500000000000004?$t=-.1289599546008197:$t=-.018566534248335896:t[8]>747.5000000000001?$t=.02236484980076122:$t=.1148871655157582:t[8]>3084.0000000000005?$t=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?$t=.03164751204281298:$t=.11752140436184891:t[9]>42.50000000000001?$t=-.07180559595410106:t[22]>1e-35?$t=.09325040416256854:$t=-.016041122807939914:$t=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?$t=-.010718250133458515:$t=.09818827994853763:$t=.010180038981174032:$t=-.039472162599295535:t[9]>170.50000000000003?$t=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?$t=-.08674788057474031:$t=.02077653508548371:$t=-.0003536561382007414;let Gt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?Gt=.018337297491457794:Gt=-.05926206443180149:Gt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?Gt=.10747078482128616:t[126]>1e-35?Gt=-.10550625192391357:t[7]>71.50000000000001?Gt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?Gt=.1317396472229434:Gt=-.025035791351328947:Gt=-.0728334305864372:t[8]>963.5000000000001?Gt=.023642201723096064:Gt=.183010326734258:t[128]>1e-35?Gt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?Gt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?Gt=-.1088876900335281:Gt=.02758317023002635:Gt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?Gt=-.01928020117446408:Gt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?Gt=.07893723375925096:Gt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?Gt=-.10301657587280551:Gt=.005787463140224318:Gt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?Gt=-.019296977889522397:Gt=-.07274529751752634:t[1]>30.500000000000004?Gt=-.050368901143148286:Gt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?Gt=.0015332402792773946:Gt=.09930153676749967:Gt=-.06370844564357069:Gt=.00042272155209927616;let Ie;t[71]>1e-35?t[4]>17.500000000000004?Ie=.12586844370423247:Ie=-.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?Ie=-.08474891624263797:t[8]>125.50000000000001?Ie=.08125086980439704:Ie=-.04082085238068532:t[0]>3863.5000000000005?Ie=.020481535807469208:Ie=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ie=-.019110200161573936:Ie=-.12387719685855114:t[0]>1102.5000000000002?Ie=.08376595701957407:Ie=-.031821919580524834:t[9]>4.500000000000001?Ie=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ie=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ie=.1349841206807871:Ie=.011864053595560297:t[1]>41.50000000000001?Ie=-.08203662486612544:t[2]>18.500000000000004?Ie=-.009541865642346947:Ie=.08345043168501759:t[2]>10.500000000000002?Ie=-.09585031818030947:Ie=.019432330487099865:Ie=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ie=.11951517733981365:Ie=-.016651014735738538:t[1]>28.500000000000004?Ie=-.07410922545030711:t[10]>28.500000000000004?Ie=.05886430683844788:Ie=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ie=.04802269879144705:Ie=-.026208212831796737:t[4]>45.50000000000001?Ie=-.03227476944664786:Ie=.05124575625622705:Ie=.00020506696916003137;let F;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?F=-.03042091758483443:t[10]>14.500000000000002?F=.09816619204768777:F=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?F=-.02381165060401718:F=-.10950361804974783:F=.03538211665111128:t[212]>1e-35?t[19]>1e-35?F=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?F=-.06371052144380579:F=.0835500621252692:F=-.10408255929333915:t[1]>74.50000000000001?F=.13208968122712403:t[1]>64.50000000000001?F=-.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?F=.09922816902423433:F=.016366955328796718:F=.1592412560903584:t[1]>39.50000000000001?F=.05409467990258923:F=-.08260633210459611:F=-.06307205775247567:t[9]>36.50000000000001?F=.040253940015648144:F=.14202568969471283:F=-.028761848341594044:F=.08994073058773508:t[0]>807.5000000000001?F=-.043427848826323195:F=.04573516446846493:t[20]>1e-35?t[188]>1e-35?F=-.0758877731600639:t[23]>1e-35?F=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?F=.08124700978741987:F=.013296063087086852:t[7]>5.500000000000001?F=-.01640196088612987:F=-.12685498840146067:F=-.0004940792382459551;let be;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?be=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?be=.08513773825688947:be=-.1184664832315282:be=.05676963535893477:be=.14263843210340613:be=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?be=-.10669720555606924:be=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?be=.0664744575868955:be=-.08469256188890871:be=-.026746678040592144:t[281]>1e-35?be=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?be=.012131807587207655:be=-.12776015795398743:be=.04320472481083551:be=.08390980661550446:t[10]>227.50000000000003?be=-.09771783809101153:t[10]>130.50000000000003?be=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?be=-.07610698254064358:t[8]>902.5000000000001?be=-.03136381213599649:t[131]>1e-35?be=.0704821739127936:t[224]>1e-35?be=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?be=.10431473040024908:t[8]>841.5000000000001?be=.07304745320500514:be=-.038011541882439825:be=-.01679746695007364:t[0]>3129.5000000000005?be=.05589952587431965:t[210]>1e-35?be=.06227198085800842:be=-.0011341890997947812:t[8]>740.5000000000001?be=.04817300084412584:be=-.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 pe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.07554189644995735:pe=-.052089349455904946:pe=-.10148206848169845:t[113]>1e-35?pe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?pe=.07172653627995676:pe=-.07602959317610998:pe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?pe=-.0399322883690891:pe=.06523495517476098:pe=-.10358715295743802:t[193]>1e-35?pe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?pe=.015928764772252406:pe=.1341513061552287:pe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?pe=-.033592997607280156:pe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?pe=-.08402551858097379:pe=.017401984506038796:t[1]>25.500000000000004?pe=.13337205393591278:pe=-.01160208350090984:pe=.06708317942315471:t[8]>227.50000000000003?pe=-.08486943882418681:pe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?pe=-.10496268177586783:pe=-.020921489532370493:pe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?pe=.11639296062157028:pe=-.004275784356569115:t[32]>1e-35?pe=-.07297384970166025:pe=.006026841626381599:pe=.002034611134960428;let Se;t[248]>1e-35?Se=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Se=-.06455513326540585:t[1]>29.500000000000004?Se=.07718474591552532:t[4]>7.500000000000001?Se=.040139336931404826:Se=-.09685734690563386:Se=.00015327283570347363:t[9]>88.50000000000001?Se=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Se=-.04077257804338707:Se=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Se=.03778141591008941:Se=-.06459919920634845:Se=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Se=.14063930759326346:t[0]>179.50000000000003?Se=.07287482250668585:t[8]>1180.5000000000002?Se=-.14419393112726253:t[10]>28.500000000000004?Se=-.07993142770099469:t[17]>1e-35?Se=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Se=.05527969663610186:Se=-.10824385941441346:t[3]>11.500000000000002?Se=.12358502961047915:Se=-.017509147119622873:t[0]>74.50000000000001?Se=-.014907705458730486:t[8]>95.50000000000001?Se=-.02225118168342062:Se=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Se=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Se=.04962819555610421:Se=-.07213577821855309:Se=.09139529824708481:t[19]>1e-35?Se=.013439401088345224:Se=-.049274647207292056:Se=.10531673719686951;let Fe;t[40]>1e-35?t[0]>1937.5000000000002?Fe=-.06421671152073961:Fe=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Fe=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Fe=-.03520420769287065:t[8]>1085.5000000000002?Fe=-.019817352506127633:Fe=.11444439424520964:Fe=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Fe=-.010490117519863269:Fe=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Fe=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Fe=.06619344145920268:t[0]>4091.5000000000005?Fe=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Fe=.10016091391222309:Fe=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Fe=-.019511460451434884:Fe=-.11643672465055221:t[2]>18.500000000000004?Fe=.07848228087333317:t[8]>55.50000000000001?Fe=.032583027899956235:Fe=-.11209832692153521:t[11]>1e-35?Fe=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Fe=-.09996887746328006:t[9]>2.5000000000000004?Fe=.02157682011863397:Fe=-.05247727848991843:Fe=.07409150201483244:t[1]>38.50000000000001?Fe=-.11378466075449625:t[224]>1e-35?Fe=-.10741749127732923:t[1]>26.500000000000004?Fe=.07343136534146562:Fe=-.07013573628594773:t[25]>1e-35?Fe=-.04626669734164317:Fe=.05518333197956482:Fe=.00032434010867555516;let te;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?te=.026313251010808853:te=-.08997339150292381:te=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?te=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?te=.0905155504503746:t[8]>1049.5000000000002?te=-.062312558183394054:t[8]>719.5000000000001?te=.09583836191410239:t[0]>3719.5000000000005?te=-.0778097309430818:te=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?te=-.12920865648544927:t[0]>2699.5000000000005?te=-.07086587879041864:te=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?te=-.11377786322600797:te=-.009486325820117998:t[1]>55.50000000000001?te=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?te=-.07938291201004219:t[2]>36.50000000000001?te=.01520046732530246:te=.13649854049662832:te=-.07145015938528873:t[8]>407.50000000000006?te=-.00350257360822279:te=.11332047082193297:te=-.10060624458629897:te=.05429496612497562:t[8]>1446.5000000000002?te=.006073419197482838:te=-.08718676350883998:te=-.11532497988252638:te=.10766270463068293:t[34]>1e-35?te=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?te=-.0004109812623829506:te=.021601073497455662:te=-7343540098965853e-20;let Te;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?Te=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?Te=.05995640200798119:t[0]>3443.5000000000005?Te=-.14698883458733583:Te=-.030039164579240187:t[189]>1e-35?Te=-.06086763220538141:t[1]>86.50000000000001?Te=-.05096727866142538:t[4]>64.50000000000001?Te=.11240554253834577:t[4]>45.50000000000001?Te=-.030279760168394117:t[6]>45.50000000000001?Te=.10161088917815142:t[10]>77.50000000000001?Te=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?Te=-.06672020005240323:Te=.08831457502630258:t[8]>2592.5000000000005?Te=-.052617701047376654:t[10]>29.500000000000004?Te=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?Te=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?Te=-.064099222705728:Te=.044332487521538365:t[0]>2882.5000000000005?Te=.031099546885005065:Te=.12938467051623853:t[0]>4221.500000000001?Te=-.0928676413498701:t[9]>30.500000000000004?Te=-.05781824812803708:Te=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?Te=-.06648105454098469:Te=.05985487552383097:Te=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?Te=.05282385499619401:t[1]>66.50000000000001?Te=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?Te=.027885690791379255:Te=-.08407126408362446:Te=.014432924125571093:Te=-9903435845205118e-20;let Ge;t[76]>1e-35?Ge=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?Ge=.013633653464240465:Ge=-.10164319411983509:Ge=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?Ge=.00632864847804078:Ge=-.08393000368134668:Ge=.07870508617440916:t[284]>1e-35?Ge=.1092302727710421:Ge=-.0025505047582483234:t[248]>1e-35?Ge=.07101822393621864:t[274]>1e-35?Ge=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?Ge=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?Ge=.025081789181021243:Ge=-.014813325803582618:t[9]>33.50000000000001?Ge=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?Ge=.11926990418060353:Ge=.01852125513565268:Ge=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?Ge=-.1178464984373743:t[283]>1e-35?Ge=.043370859226927405:t[5]>4320.500000000001?Ge=-.01103141226366587:t[8]>1104.5000000000002?Ge=-.023053423988095886:Ge=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?Ge=.000579145585864887:Ge=.03389152834202143:t[128]>1e-35?Ge=-.14527722052568462:t[210]>1e-35?Ge=-.08915971541902741:t[7]>9.500000000000002?Ge=-.03307314577076116:t[18]>1e-35?Ge=-.05521712302023565:Ge=.009315605032770029:Ge=.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 se;t[3]>7.500000000000001?t[157]>1e-35?se=-.07514182877923786:se=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?se=.028692053800951845:se=.14081686716133598:se=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?se=.0037139292567243084:se=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?se=.01202688580305612:se=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?se=.043935495082738626:se=-.05639305759669704:t[247]>1e-35?se=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?se=.10331836202616368:se=.0006926658459781341:t[96]>1e-35?se=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?se=-.0741403257305367:se=.022900127535540854:t[7]>3.5000000000000004?se=.038110741403836294:se=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?se=-.09552842289807008:t[1]>27.500000000000004?se=.012505935885798007:se=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?se=-.1046104767723845:se=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?se=.023466328488582572:se=.11730925774586994:se=-.04771965631104874:se=.17059689880751394:se=-.08181850955999449:t[26]>1e-35?se=-.12727482696678769:se=-.014343123272734182;let me;t[147]>1e-35?t[1]>53.50000000000001?me=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?me=-.02763546051134888:me=.06423344777499343:me=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?me=.049825139823021586:t[7]>22.500000000000004?me=-.01131680751379858:t[0]>2579.5000000000005?me=-.10673674485369694:me=-.015387212937189957:me=.04347325151148724:t[179]>1e-35?me=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.0650355590939066:me=-.0473332870892226:me=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?me=.11139543329789044:t[126]>1e-35?me=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?me=.06370903833231022:t[10]>29.500000000000004?me=.03415223859607161:t[10]>3.5000000000000004?me=-.07415518117873297:me=-.0014119203473324082:me=.12617652343819508:t[9]>41.50000000000001?me=-.10311145857176976:t[8]>2757.5000000000005?me=-.08106484219011428:t[7]>71.50000000000001?me=-.09783384432091176:t[1]>88.50000000000001?me=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?me=-.008884084501608536:me=.061339437777743616:me=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?me=.01526664064166223:me=.13534828515415498:me=-.06985484465894776:me=.0005758961943178744;let Ce;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Ce=-.029152732370514342:Ce=.07173628916139178:t[1]>36.50000000000001?Ce=-.08859111297255318:Ce=.0018030071815630785:Ce=.13652461563759322:Ce=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Ce=-.07145140450454163:t[21]>1e-35?Ce=-.07422841663493233:Ce=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Ce=.11864240653986852:t[3]>33.50000000000001?Ce=-.08821209591953476:Ce=.05706392280054726:Ce=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Ce=.01953613016837112:Ce=-.059781039130025006:t[148]>1e-35?Ce=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Ce=.07207826841738371:t[202]>1e-35?Ce=.08163917539410503:Ce=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Ce=-.06858280496900336:Ce=-.1781828899516648:Ce=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Ce=.018232649414147116:Ce=-.04419781124222661:Ce=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Ce=.11452368095776105:Ce=-.036496437259924026:Ce=-.040445338739465486:Ce=.0816572651001145:Ce=-.08968914517368663:Ce=.0002826343082585516;let He;t[189]>1e-35?t[0]>5269.500000000001?He=-.08839493050459957:t[10]>85.50000000000001?He=.10046908365702462:t[8]>2592.5000000000005?He=-.09632233975926387:t[8]>2000.5000000000002?He=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?He=.035504970430426296:t[1]>31.500000000000004?He=-.1133764813142531:He=-.01138280942244812:t[8]>1125.5000000000002?He=.09800530246229806:He=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?He=.07316772160107896:He=-.059095014819051765:He=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?He=-.09150209066166894:t[8]>3084.0000000000005?He=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?He=-.04449234460408263:He=.05568837973347338:He=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?He=.12741077850267066:He=.007372371864985329:t[2]>39.50000000000001?He=.02295917234617787:He=.14966532083907075:t[1]>39.50000000000001?He=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?He=-.02511861881285652:t[1]>27.500000000000004?He=.08683660011672288:He=.02956214835267301:t[9]>15.500000000000002?He=-.016538805462996232:He=.04352738094981517:He=-.05561856645643868:t[9]>170.50000000000003?He=-.07996752635874248:t[179]>1e-35?He=-.09065975936933919:He=-.00042817975060427177;let $e;t[39]>1e-35?t[4]>25.500000000000004?$e=.03443173196222934:$e=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?$e=-.0013415395759330318:$e=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?$e=.002297618040307216:$e=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?$e=-.015297257305397608:$e=.09651828834062742:$e=-.06636003334371929:t[10]>11.500000000000002?$e=.17631616138309397:t[0]>1639.5000000000002?$e=3804386478092585e-20:$e=-.09099296398683193:$e=-.06874415876172972:t[0]>2151.5000000000005?$e=-.1311264883406766:$e=.00809052010141122:t[253]>1e-35?$e=-.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?$e=.045038497754638605:$e=-.07770167665661752:$e=-.08596294280650517:$e=.08538655727027213:$e=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?$e=.054627956617973275:t[1]>61.50000000000001?$e=-.11994465088415499:t[4]>8.500000000000002?$e=.06676200239406452:$e=-.027503148069376867:t[8]>676.5000000000001?$e=-.10363964928357075:t[4]>8.500000000000002?$e=-.07589816227175682:$e=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?$e=.009093153189012338:$e=-.06119765876605404:$e=.0004668642103528348;let et;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?et=-.10100794502567233:et=.08000205636470442:et=-.11945419826856896:t[113]>1e-35?et=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?et=.1224302423880318:et=-.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?et=.0019277012166729114:t[1]>28.500000000000004?et=-.054445821715687494:et=.045645722976713245:t[30]>1e-35?et=.13402660155331655:et=.008921176001777645:et=-.058547426505451076:et=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?et=-.13526418192218206:et=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?et=.0007263224246135398:et=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?et=-.11575657261278308:et=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?et=-.01995960178292952:et=.11216586049153021:et=-.10050961087149474:et=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?et=.10303451081526649:et=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?et=-.043799548968209395:et=-.12451444314954115:t[4]>12.500000000000002?et=-.03838117361958468:et=.06504990789767144:t[57]>1e-35?et=.06890006938293915:et=.0003914274695562949;let ct;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?ct=.004271749009686975:ct=-.10523878297127605:ct=.04633982158107851:ct=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?ct=-.08655730561951676:t[8]>919.5000000000001?ct=-.0676453705610183:t[7]>18.500000000000004?ct=-.027787974193650575:ct=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?ct=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?ct=-.03473877164537313:t[8]>719.5000000000001?ct=.10471053866934404:ct=.008236107678382981:t[4]>57.50000000000001?ct=.09412219478825269:t[10]>66.50000000000001?ct=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?ct=-.040681323751002293:ct=.06374650297561021:ct=.12884615227401788:t[10]>5.500000000000001?ct=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?ct=-.05474068967150784:ct=.03744700650806603:ct=-.07846396348680855:t[1]>42.50000000000001?ct=.018972315810821302:ct=.10953621007604744:t[5]>4439.500000000001?ct=.010999776705494586:t[1]>40.50000000000001?ct=-.12394200059775967:t[10]>2.5000000000000004?ct=.013528093962849453:ct=-.09222088417048682:ct=-.12662967149701485:ct=.09327296405849603:t[3]>99.50000000000001?ct=-.013581954439986752:ct=.0005526498251862075;let bt;t[187]>1e-35?t[243]>1e-35?bt=-.08392792551692502:t[10]>68.50000000000001?bt=.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?bt=-.0825306209711224:bt=.049559996084532945:bt=-.1064938580886302:bt=.03353240732240275:bt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?bt=.16966001471529374:t[1]>57.50000000000001?bt=-.005772777673676247:bt=.09383677041525058:t[8]>747.5000000000001?bt=.054068175469351235:bt=-.049968216310277036:t[8]>753.5000000000001?bt=-.0679383555784074:t[4]>8.500000000000002?bt=-.059757341189735386:bt=.05701083682780414:bt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?bt=.05820296128730006:bt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?bt=.15340611616954566:bt=.04385036188666874:t[0]>4449.500000000001?bt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?bt=.004840354641006495:bt=.09967827580276283:bt=.11605363537391578:t[9]>19.500000000000004?bt=-.0735831692725717:bt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?bt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?bt=-.02442182361342386:bt=.10334853004243093:bt=-.030431948680167104:bt=-956078595250818e-19;let ht;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?ht=-.040232505718244854:t[0]>3030.5000000000005?ht=.0634109586813073:ht=-.04043617034245621:ht=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?ht=-.007859096946435131:ht=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?ht=.05515771679628051:ht=-.04214471312668263:ht=-.09589322222261765:t[193]>1e-35?ht=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?ht=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?ht=-.08152604001147906:t[11]>1e-35?ht=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?ht=.13100930780107503:t[10]>25.500000000000004?ht=.05921074710011526:ht=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?ht=.0009447118243153454:ht=-.09820565036865991:ht=.057146909749745546:t[0]>2115.5000000000005?ht=-.12331216726611678:ht=.007281983677694285:t[2]>56.50000000000001?ht=.012310154675612615:ht=-.08873665774670461:t[6]>25.500000000000004?ht=.134708740821879:t[9]>5.500000000000001?ht=-.0805901581148979:t[224]>1e-35?ht=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?ht=.10842593386554122:t[2]>13.500000000000002?ht=.06466798320378395:ht=-.08578130788886655:ht=-.03590892078300114:ht=.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 ae;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ae=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ae=.020637047900190317:ae=-.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?ae=-.04632587527094407:ae=.08603684785510396:ae=-.05101401015448496:ae=.025466432054358498:ae=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ae=.020385355430046367:ae=.12032592051335252:ae=-.012387370292173013:t[2]>23.500000000000004?ae=-.12568545484492677:ae=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ae=.043528764484784536:ae=.14352071657196003:ae=-.009332833816977268:ae=.11186782227735846:ae=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ae=-.05649104643152564:ae=.03884200719305747:t[42]>1e-35?ae=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ae=-.04103416502526736:ae=.04881823954656287:t[4]>15.500000000000002?ae=.009342724662897898:t[0]>3969.5000000000005?ae=-.025637309961309498:ae=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ae=-.08185697075265091:t[0]>2215.5000000000005?ae=.030063975892297354:t[0]>807.5000000000001?ae=-.03924325550733229:ae=.0415330999189793:ae=-.00024374664461674863;let Re;t[3]>7.500000000000001?Re=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Re=.025798416259686565:Re=.13251610353146012:Re=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Re=-.11098564237775424:Re=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Re=.15347826616466054:t[3]>4.500000000000001?Re=.10379320730958941:Re=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Re=.03159791088468647:Re=-.10612873364104258:Re=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Re=-.02335760775001469:Re=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Re=-.011164334474672973:Re=-.06594044410501655:t[207]>1e-35?Re=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Re=-.01725821503981916:Re=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Re=-.04226531631656534:Re=-.14409800530171432:Re=-.03245576341206398:t[8]>4214.500000000001?Re=.0895409165534886:t[247]>1e-35?Re=-.06506383629143335:t[118]>1e-35?Re=-.07214270121257443:t[8]>546.5000000000001?Re=-.004385020865473831:Re=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Re=.046278501133958524:Re=-.030835570926968044:t[0]>493.50000000000006?Re=-.12794504651610425:Re=.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 ze;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?ze=.029186512383291244:t[7]>1.5000000000000002?ze=-.14984127276725573:t[1]>40.50000000000001?ze=.032757060730648144:ze=-.07675575422749602:t[6]>8.500000000000002?ze=.10599766037117893:ze=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?ze=-.051394622947855385:ze=.03237141302699347:ze=.12526173027943244:ze=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?ze=-.07383912482657777:t[0]>5147.500000000001?ze=.07008813937042091:t[10]>38.50000000000001?ze=-.06779203808365307:ze=-.013782769999524498:ze=.0880038869117715:ze=-.12846294176070952:t[281]>1e-35?ze=-.06810806903850834:t[10]>227.50000000000003?ze=-.08937977001661111:t[10]>130.50000000000003?ze=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?ze=.011036530162093841:ze=-.11500797478569702:ze=.03702229366129399:ze=.07242026683784307:t[189]>1e-35?ze=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?ze=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?ze=-.02608892716555304:ze=.09609599320761308:t[9]>105.50000000000001?ze=-.06848127135991534:ze=.0023675721254089715:t[86]>1e-35?ze=-.11049635625500497:ze=-.004847764219432233;let at;t[125]>1e-35?t[0]>3969.5000000000005?at=-.09462233499115416:at=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?at=-.030700661288166148:at=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?at=.03149547314036763:at=-.08166208257451366:t[0]>5850.500000000001?at=-.10228136324773157:t[102]>1e-35?at=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?at=.01782894842128785:t[13]>1e-35?at=.002680190260979968:at=.1773965720476949:t[2]>72.50000000000001?at=.09090831938627947:t[1]>59.50000000000001?at=-.12297206702816128:t[0]>4977.500000000001?at=.09899015653118268:at=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?at=-.0675900954187773:at=.012336403425364092:at=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?at=-.02671721777458802:at=-.09242452991958029:t[284]>1e-35?at=-.08585691288582491:at=.013332890564324447:t[4]>14.500000000000002?at=-.005245022074799553:t[23]>1e-35?at=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?at=-.09289852307936758:t[116]>1e-35?at=-.09686573010015055:t[8]>804.5000000000001?at=.03812547148215318:at=.005162744968176633:t[9]>43.50000000000001?at=-.059246106396159376:at=.050370113808135275:at=.000794041852811028;let Vt;t[3]>7.500000000000001?Vt=.0004981426543104341:t[9]>114.50000000000001?Vt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Vt=-.019061766497948867:Vt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Vt=-.006044199577160493:Vt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Vt=.11486607015912494:t[9]>16.500000000000004?Vt=-.08686820858087294:Vt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Vt=-.022230207980026437:Vt=.1056683690528792:Vt=-.05859530800943035:Vt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Vt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Vt=-.05177544573528314:Vt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Vt=.15159657923771555:Vt=-.0060542654587671055:t[9]>5.500000000000001?Vt=-.042808028205051786:t[1]>48.50000000000001?Vt=-.010449538258110742:Vt=.10026907521968294:Vt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Vt=-.02272452389409874:Vt=-.11202691218244319:t[5]>1809.5000000000002?Vt=-.04460413584255906:Vt=.08196329474205256:t[10]>69.50000000000001?Vt=.10221481166238167:Vt=.0004063052701699382:t[243]>1e-35?Vt=-.07563941678849846:t[18]>1e-35?Vt=.02563513231103432:Vt=-.004740081147303786;let gr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?gr=.057446442918106:gr=-.04404018270156349:gr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?gr=-.05930486238817954:t[1]>29.500000000000004?gr=.06955866121256543:t[8]>597.5000000000001?gr=-.06538593556505168:gr=.06212512595497445:gr=.00021102929959182257:t[9]>90.50000000000001?gr=.0958061289119631:t[102]>1e-35?gr=.07172059675638813:t[1]>47.50000000000001?gr=-.03879798603977766:t[297]>1e-35?gr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?gr=.003805910996312012:gr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?gr=.11252376801858695:t[288]>1e-35?gr=-.10293901912180432:gr=.014669268837893872:t[1]>42.50000000000001?gr=-.05988274123836837:t[145]>1e-35?gr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?gr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?gr=-.03366718308159971:gr=.11936550608549797:t[1]>31.500000000000004?gr=-.07454716789539667:gr=.027859650621164217:t[10]>10.500000000000002?gr=-.11806374092321247:gr=-.03506042229223101:gr=-.0007080765837654515:t[10]>6.500000000000001?gr=-.028077713664996503:t[2]>7.500000000000001?gr=.15803724124216814:gr=.0351381284833169:gr=-.07877953381054767;let cr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?cr=.14144941521975005:cr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?cr=.10514088112381886:t[7]>18.500000000000004?cr=-.10370643555956745:cr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?cr=-.0508129468802936:t[224]>1e-35?cr=-.037816066368733595:t[10]>43.50000000000001?cr=.07793408602607932:cr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?cr=.036972453794202324:cr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?cr=.09475302525132188:cr=-.03580104945898193:cr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?cr=-.1282448778804823:cr=-.014395808269207212:cr=-.008940927190750592:cr=-.1459118815453748:t[0]>4897.500000000001?cr=-.09733068457286576:t[1]>57.50000000000001?cr=.06575271409540207:cr=-.019556422817450115:cr=-.10623959222984136:t[18]>1e-35?cr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?cr=.008125645893104896:cr=-.11084368630465868:cr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?cr=-.05854904579626861:t[4]>5.500000000000001?cr=.02985784951394175:cr=-.03247600140149334:cr=-.11152899295304973:cr=-.00035424577714215764;let Mr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Mr=-.06563670567578264:Mr=.067656954313663:Mr=-.10388217548685377:t[8]>2302.5000000000005?Mr=.07190621943790435:t[4]>67.50000000000001?Mr=.060020507643618604:t[4]>38.50000000000001?Mr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Mr=-.06568134366461277:t[8]>1075.5000000000002?Mr=-.004768057709758692:Mr=.11785959165999467:Mr=-.05080221682879267:Mr=.14814206127494542:Mr=-.07241946332311736:t[253]>1e-35?Mr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Mr=-.02471195342450034:Mr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Mr=-.10741850739482771:Mr=.010051635824944:Mr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Mr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Mr=-.08992396138178163:Mr=.010944365997007212:Mr=.06221307021813793:Mr=.1286024087559141:t[127]>1e-35?Mr=.06568148624531012:t[10]>40.50000000000001?Mr=-.07567979134643352:t[5]>5647.500000000001?Mr=.07594672895572069:Mr=-.018158016446439187:t[6]>55.50000000000001?Mr=.009293422430111872:t[4]>45.50000000000001?Mr=-.017749818406964022:t[2]>46.50000000000001?Mr=.01714136511113982:Mr=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let Yt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?Yt=.05517359070460923:Yt=-.04758751221404857:Yt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?Yt=.1040436595565776:t[9]>21.500000000000004?Yt=.04032250517675179:t[107]>1e-35?Yt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?Yt=.1192453009230486:t[1]>51.50000000000001?Yt=.0443376336292195:Yt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?Yt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?Yt=-.08999822408398037:Yt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?Yt=-.061850439226075:Yt=.08849196353361093:Yt=.10536348167793089:t[92]>1e-35?Yt=.04894947712119185:t[9]>16.500000000000004?Yt=.05900227903883853:t[9]>5.500000000000001?Yt=-.11946594348916476:Yt=-.03652096348071964:t[1]>41.50000000000001?Yt=-.07411603110840567:Yt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?Yt=.08493634342741495:t[11]>1e-35?Yt=-.10899097825564363:Yt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?Yt=.08356655906359918:t[7]>25.500000000000004?Yt=-.09475076526194888:t[10]>5.500000000000001?Yt=-.01999406228763778:Yt=.06696212545889428:t[6]>20.500000000000004?Yt=.14713592661393468:Yt=.0459917279002218:Yt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let $0=dfc(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+L+B+q+M+O+j+Q+U+Y+W+V+z+ie+H+re+le+Le+ge+Ue+ke+X+ee+K+he+Z+ue+qe+ne+ce+Ne+we+Be+rt+st+_t+Dt+$t+Gt+Ie+F+be+Qe+pe+Se+Fe+te+Te+Ge+J+se+me+Ce+He+$e+et+ct+bt+ht+We+ae+Re+Me+ye+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-$0,$0]}a(ufc,"multilineModelPredict");function dfc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(dfc,"sigmoid")});var vLi=I(H$=>{"use strict";p();Object.defineProperty(H$,"__esModule",{value:!0});H$.MultilineModelFeatures=H$.PromptFeatures=void 0;H$.hasComment=h2r;H$.requestMultilineScore=mfc;var j$=yLi(),ffc=ELi(),pfc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},_Li={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function h2r(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(pfc[r]??[]).some(l=>s.includes(l))}a(h2r,"hasComment");var OLe=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=h2r(e,-2,r),this.rstripSecondToLastLineHasComment=h2r(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]}};j$.PromptFeatures=NLe;var x_t=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new NLe(e,n),this.suffixFeatures=new NLe(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(gLi).length+1).fill(0);r[gLi[this.language]??0]=1;let n=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);n[q$.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);o[q$.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);s[q$.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);return c[q$.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};j$.MultilineModelFeatures=x_t;function cfc(t,e){return new x_t(t.prefix,t.suffix,e)}a(cfc,"constructMultilineFeatures");function lfc(t,e){let r=cfc(t,e).constructFeatures();return(0,sfc.multilineModelPredict)(r)[1]}a(lfc,"requestMultilineScore")});var yLi=I(V6=>{"use strict";p();var ufc=V6&&V6.__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},dfc=V6&&V6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(V6,"__esModule",{value:!0});V6.StreamedCompletionSplitter=void 0;var ffc=Gs(),pfc=M4e(),hfc=SAe(),h2r=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}},m2r=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 h2r(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 hfc.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(pfc.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}};V6.StreamedCompletionSplitter=m2r;V6.StreamedCompletionSplitter=m2r=ufc([dfc(5,ffc.IInstantiationService)],m2r)});var ILi=I(g2r=>{"use strict";p();Object.defineProperty(g2r,"__esModule",{value:!0});g2r.getGhostTextStrategy=vfc;var SLi=Gs(),ELi=Qre(),rN=LE(),TLi=fy(),w_t=gyt(),_Li=$g(),mfc=mAe(),MLe=SAe(),gfc=a2r(),Afc=_4e(),yfc=cIr(),Efc=ALi(),_fc=yLi(),vLi=20;function CLi(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]}};H$.PromptFeatures=OLe;var w_t=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new OLe(e,n),this.suffixFeatures=new OLe(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(_Li).length+1).fill(0);r[_Li[this.language]??0]=1;let n=new Array(Object.keys(j$.contextualFilterCharacterMap).length+1).fill(0);n[j$.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(j$.contextualFilterCharacterMap).length+1).fill(0);o[j$.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(j$.contextualFilterCharacterMap).length+1).fill(0);s[j$.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(j$.contextualFilterCharacterMap).length+1).fill(0);return c[j$.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};H$.MultilineModelFeatures=w_t;function hfc(t,e){return new w_t(t.prefix,t.suffix,e)}a(hfc,"constructMultilineFeatures");function mfc(t,e){let r=hfc(t,e).constructFeatures();return(0,ffc.multilineModelPredict)(r)[1]}a(mfc,"requestMultilineScore")});var CLi=I(W6=>{"use strict";p();var gfc=W6&&W6.__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},Afc=W6&&W6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(W6,"__esModule",{value:!0});W6.StreamedCompletionSplitter=void 0;var yfc=Gs(),Efc=L4e(),_fc=TAe(),m2r=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}},g2r=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 m2r(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 _fc.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(Efc.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}};W6.StreamedCompletionSplitter=g2r;W6.StreamedCompletionSplitter=g2r=gfc([Afc(5,yfc.IInstantiationService)],g2r)});var kLi=I(A2r=>{"use strict";p();Object.defineProperty(A2r,"__esModule",{value:!0});A2r.getGhostTextStrategy=xfc;var wLi=Gs(),bLi=Qre(),nN=LE(),RLi=fy(),R_t=Ayt(),SLi=$g(),vfc=gAe(),LLe=TAe(),Cfc=c2r(),bfc=C4e(),Sfc=lIr(),Tfc=vLi(),Ifc=CLi(),TLi=20;function ILi(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(CLi,"takeNLines");async function vfc(t,e,r,n,o,s,c){let l=t.get(SLi.IInstantiationService),u=t.get(TLi.ICompletionsFeaturesService),d=t.get(yfc.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case rN.BlockMode.Server:return s?{blockMode:rN.BlockMode.Parsing,requestMultiline:!0,finishedCb:CLi(f),stop:[` +`).length}}a(ILi,"takeNLines");async function xfc(t,e,r,n,o,s,c){let l=t.get(wLi.IInstantiationService),u=t.get(RLi.ICompletionsFeaturesService),d=t.get(Sfc.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:ILi(f),stop:[` -`],maxTokens:vLi*f}:{blockMode:rN.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case rN.BlockMode.Parsing:case rN.BlockMode.ParsingAndServer:case rN.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(Cfc,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=mfc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(bLi,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:rN.BlockMode.Parsing,requestMultiline:!0,finishedCb:CLi(f),stop:[` +`],maxTokens:TLi*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(wfc,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=vfc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(xLi,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:nN.BlockMode.Parsing,requestMultiline:!0,finishedCb:ILi(f),stop:[` -`],maxTokens:vLi*f};return h===rN.BlockMode.MoreMultiline&&(g.blockMode=rN.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(bLi,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(vfc,"getGhostTextStrategy");function bLi(t,e,r,n,o,s,c,l,u){let d=t.get(TLi.ICompletionsFeaturesService),f=t.get(SLi.IInstantiationService);if(c&&e===rN.BlockMode.MoreMultiline&&MLe.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===MLe.BlockPositionType.EmptyBlock||o===MLe.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(Afc.ICompletionsCacheService);return{finishedCb:f.createInstance(_fc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let E={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,gfc.appendToCache)(m,E,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,w_t.parsingBlockFinished)(r,n):h=>{}}}a(bLi,"buildFinishedCallback");async function Cfc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,_Li.telemetry)(t,"ghostText.longFileMultilineSkip",_Li.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===rN.BlockMode.MoreMultiline&&MLe.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,MLe.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&bfc(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,ELi.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,w_t.isEmptyBlockStartUtil)(r,n):o&&(0,ELi.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,w_t.isEmptyBlockStartUtil)(r,n)||await(0,w_t.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,Efc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(Cfc,"shouldRequestMultiline");function bfc(t,e){return e.lineAt(t).text.trim().length===0}a(bfc,"isNewLine")});var DLi=I(qR=>{"use strict";p();var Sfc=qR&&qR.__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},nN=qR&&qR.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(qR,"__esModule",{value:!0});qR.ForceMultiLine=qR.GhostTextComputer=void 0;qR.getGhostText=$fc;var wLi=Sp(),Tfc=gm(),Ifc=PPr(),xfc=T0(),RLi=Gs(),wfc=DPr(),Rfc=Ore(),kfc=o4e(),Pfc=FSr(),LLe=LE(),C2r=fy(),Dfc=Dl(),Nfc=KAe(),Mfc=ATr(),Ofc=A_t(),Lfc=tEt(),Bfc=v$(),Ffc=gyt(),A2r=qAe(),E2r=qPr(),y2r=F4i(),oye=$g(),R_t=mAe(),xLi=y4e(),Ufc=jTr(),Qfc=SAe(),qfc=_4e(),_2r=pLi(),kLi=uIr(),jfc=ILi(),H$=a$(),Eh=xAe(),Hfc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function Gfc(t,e,r){let n=t.get(C2r.ICompletionsFeaturesService),o=(0,LLe.getConfig)(t,LLe.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,oye.now)()-r.issuedTime;return Math.max(0,o-s)}a(Gfc,"getRemainingDebounceMs");function OLe(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(OLe,"isCompletionRequestCancelled");var k_t=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,xfc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(Kfc,e.textDocument,l,n);await(0,Rfc.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,Nfc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,Eh.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 b=(0,oye.now)();h.push([v,b-f]),f=b}if(a(m,"recordPerformance"),m("telemetry"),OLe(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};let g=Wfc(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,Eh.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(Mfc.getEngineRequestInfo,n),y={...Hfc,...s,tokenizer:A.tokenizer},E=await this.instantiationService.invokeFunction(A2r.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(A2r.PromptResponse.toString(E)),E.type==="copilotContentExclusion")return d.debug("Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(y.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:E};if(E.type==="promptCancelled")return d.debug("Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.prompt.prefix.length===0&&E.prompt.suffix.length===0)return d.debug("Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};let _=this.instantiationService.invokeFunction(Gfc,y,n);return _>0&&(d.debug(`Debouncing ghost text request for ${_}ms`),await(0,xLi.delay)(_),OLe(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,A2r.trimLastLine)(e.textDocument.getText(R_t.LocationFactory.range(R_t.LocationFactory.position(0,0),e.position)));d.trace(`Starting ghost text computation, prefix length: ${v.length}`);let b=this.currentGhostText.hasAcceptedCurrentCompletion(v,E.prompt.suffix);d.trace(`hasAcceptedCurrentCompletion: ${b}`);let T=E.prompt,w=await this.instantiationService.invokeFunction(jfc.getGhostTextStrategy,e,v,E,g,b,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(Vfc,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(E2r.extractRepoInfoInBackground,e.textDocument.uri),P={blockMode:w.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:x,engineModelId:A.modelId,ourRequestId:r,prefix:v,prompt:E.prompt,multiline:w.requestMultiline,indentation:(0,Ffc.contextIndentation)(e.textDocument,e.position),isCycling:y.isCycling,headers:A.headers,stop:w.stop,maxTokens:w.maxTokens,afterAccept:b};P.headers={...P.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":y.isSpeculative?"true":"false"};let D=this.instantiationService.invokeFunction(Zfc,e.textDocument,P,e.position,E,n,A,y);if(R===void 0&&!y.isCycling&&this.asyncCompletionManager.shouldWaitForAsyncCompletions(v,E.prompt)){d.trace("No cached choices, waiting for async completions from in-flight request");let U=await this.asyncCompletionManager.getFirstMatchingRequestWithTimeout(r,v,E.prompt,y.isSpeculative,D);if(m("asyncWait"),U){d.trace("Received choice from async completion");let Y=!w.requestMultiline;R=[[(0,_2r.makeGhostAPIChoice)(U[0],{forceSingleLine:Y})],H$.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(OLe(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===LLe.BlockMode.MoreMultiline&&Qfc.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(U=>this.instantiationService.invokeFunction(y2r.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0)),R&&(R[1]===H$.ResultType.Cache||R[1]===H$.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,Eh.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,Eh.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let U=this.instantiationService.createInstance(_2r.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let Y=await U.getAllCompletionsFromNetwork(P,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,H$.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 kfc.CancellationTokenSource,V=U.getCompletionsFromNetwork(P,D,W.token,Y,l);this.asyncCompletionManager.queueCompletionRequest(r,v,E.prompt,W,V);let z=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,E.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,Eh.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[z[0]],H$.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)};let[L,B]=R;d.trace(`Final choices: ${L.length} from ${(0,Eh.resultTypeToString)(B)}`);let q=L.map(U=>this.instantiationService.invokeFunction(y2r.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0);d.trace(`Post-processed to ${q.length} choices`);let M=this.instantiationService.invokeFunction(LLe.getConfig,LLe.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),O=(0,oye.now)()-n.issuedTime,j=Math.max(M-O,0);if(B!==H$.ResultType.TypingAsSuggested&&!y.isCycling&&j>0&&(d.debug(`Waiting ${j}ms before returning completion`),await(0,xLi.delay)(j),OLe(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,Eh.mkCanceledResultTelemetry)(D)};let Q=[];for(let U of q){let Y=Jfc(e.textDocument,P,U,D),W=g?(0,y2r.checkSuffix)(e.textDocument,e.position,U):0,z={completion:zfc(U.choiceIndex,U.completionText,E.trailingWs),telemetry:Y,isMiddleOfTheLine:g,suffixCoverage:W,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};Q.push(z)}return D.properties.clientCompletionId=Q[0]?.clientCompletionId,D.measurements.foundOffset=Q?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${Q.length} results from ${(0,Eh.resultTypeToString)(B)} at ${D.measurements.foundOffset} offset`),OLe(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,Eh.mkCanceledResultTelemetry)(D)}:(y.isSpeculative||(d.trace("Updating current ghost text as request is not speculative"),this.currentGhostText.setGhostText(v,E.prompt.suffix,q,B)),l.setHeaderRequestId(q[0]?.requestId.headerRequestId??r),m("complete"),d.trace(`Ghost text computation complete, returning ${Q.length} results`),{type:"success",value:[Q,B],telemetryData:(0,Eh.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:B,performanceMetrics:h})})}};qR.GhostTextComputer=k_t;qR.GhostTextComputer=k_t=Sfc([nN(0,RLi.IInstantiationService),nN(1,Tfc.ITelemetryService),nN(2,Pfc.ICompletionsNotifierService),nN(3,Lfc.ICompletionsContextProviderBridgeService),nN(4,kLi.ICompletionsCurrentGhostText),nN(5,Bfc.ICompletionsContextProviderService),nN(6,Ufc.ICompletionsAsyncManagerService),nN(7,C2r.ICompletionsFeaturesService),nN(8,Dfc.ICompletionsLogTargetService),nN(9,Ofc.ICompletionsStatusReporter),nN(10,wLi.ILogService)],k_t);async function $fc(t,e,r,n,o,s,c){return t.get(RLi.IInstantiationService).createInstance(k_t).getGhostText(e,r,n,o,s,c)}a($fc,"getGhostText");function Vfc(t,e,r,n){let s=t.get(kLi.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=Yfc(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),H$.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,H$.ResultType.Cache]}a(Vfc,"getLocalInlineSuggestion");function Wfc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,wfc.isInlineSuggestionFromTextAfterCursor)(n)}a(Wfc,"isInlineSuggestion");var v2r=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};qR.ForceMultiLine=v2r;function zfc(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(zfc,"adjustLeadingWhitespace");function Yfc(t,e,r,n){let o=t.get(wLi.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(qfc.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,_2r.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(Yfc,"getCompletionsFromCache");async function Kfc(t,e,r,n){let o=t.get(C2r.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=oye.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(Kfc,"createTelemetryWithExp");function Jfc(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,PLi(l,t),l.extendWithRequestId(o),l}a(Jfc,"telemetryWithAddData");function Zfc(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);PLi(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===E2r.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==E2r.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(R_t.LocationFactory.range(h.range.start,n)),g=e.getText(R_t.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Ifc.createSha256Hash)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...(0,oye.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 _=d.extendedBy(y,E);return(0,oye.telemetry)(t,"ghostText.issued",_),d}a(Zfc,"telemetryIssued");function PLi(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(PLi,"addDocumentTelemetry")});var LLi=I(W6=>{"use strict";p();var Xfc=W6&&W6.__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},b2r=W6&&W6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(W6,"__esModule",{value:!0});W6.GhostText=void 0;var NLi=ri(),epc=Gs(),tpc=pIr(),rpc=R4i(),MLi=DLi(),npc=IPr(),ipc=a$(),opc=uyt(),OLi=xAe(),spc=Dl(),S2r=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){apc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,tpc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(OLi.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(MLi.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(npc.setLastShown,e.textDocument,e.position,f),m=(0,rpc.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!==ipc.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(MLi.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:E}=A.range,_=NLi.Range.create(y,NLi.Position.create(E.line,E.character-l));return{...A,range:_}});return{...u,value:g}}};W6.GhostText=S2r;W6.GhostText=S2r=Xfc([b2r(0,epc.IInstantiationService),b2r(1,spc.ICompletionsLogTargetService),b2r(2,opc.ICompletionsSpeculativeRequestCache)],S2r);function apc(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}});OLi.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(apc,"logCompletionLocation")});var BLi=I(N_t=>{"use strict";p();Object.defineProperty(N_t,"__esModule",{value:!0});N_t.LocalFileSystem=void 0;var P_t=require("fs"),cpc=require("path"),D_t=n$(),T2r=o$(),I2r=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await P_t.promises.readFile((0,T2r.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,T2r.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,T2r.fsPath)(e),n=await P_t.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,cpc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await P_t.promises.lstat(e);if(r.isSymbolicLink())try{let n=await P_t.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=D_t.FileType.Unknown;return e.isFile()&&(o=D_t.FileType.File),e.isDirectory()&&(o=D_t.FileType.Directory),r.isSymbolicLink()&&n&&(o|=D_t.FileType.SymbolicLink),o}};N_t.LocalFileSystem=I2r});var qLi=I(z6=>{"use strict";p();var lpc=z6&&z6.__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},BLe=z6&&z6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(z6,"__esModule",{value:!0});z6.CompositeRelatedFilesProvider=void 0;var upc=Bre(),dpc=Gs(),sye=LE(),fpc=fy(),ppc=n$(),hpc=Dl(),FLe=UAe(),Rne=dEt(),FLi=["cpp","c","cuda-cpp"],ULi=["typescript","javascript","typescriptreact","javascriptreact"],QLi=["csharp"],mpc=new Map([...FLi.map(t=>[t,FLe.NeighboringFileType.RelatedCpp]),...ULi.map(t=>[t,FLe.NeighboringFileType.RelatedTypeScript]),...QLi.map(t=>[t,FLe.NeighboringFileType.RelatedCSharpRoslyn])]);function gpc(t){return mpc.get(t)??FLe.NeighboringFileType.RelatedOther}a(gpc,"getNeighboringFileType");var x2r=class extends Rne.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(gpc(s)===FLe.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),Rne.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),Rne.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return Rne.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),Rne.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return Rne.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)Rne.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 QLi.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(sye.getConfig,sye.ConfigKey.RelatedFilesVSCodeCSharp):ULi.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(sye.getConfig,sye.ConfigKey.RelatedFilesVSCodeTypeScript):FLi.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(sye.getConfig,sye.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};z6.CompositeRelatedFilesProvider=x2r;z6.CompositeRelatedFilesProvider=x2r=lpc([BLe(0,dpc.IInstantiationService),BLe(1,upc.IIgnoreService),BLe(2,fpc.ICompletionsFeaturesService),BLe(3,hpc.ICompletionsLogTargetService),BLe(4,ppc.ICompletionsFileSystemService)],x2r)});var M_t=I(kne=>{"use strict";p();Object.defineProperty(kne,"__esModule",{value:!0});kne.PositionOffsetTransformer=kne.PositionOffsetTransformerBase=void 0;kne.ensureDependenciesAreSet=Epc;var jLi=kE(),HLi=h5e(),Apc=Yut(),ypc=Tme(),GLi=Yut();Object.defineProperty(kne,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return GLi.PositionOffsetTransformerBase},"get")});Object.defineProperty(kne,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return GLi.PositionOffsetTransformer},"get")});(0,Apc._setPositionOffsetTransformerDependencies)({StringEdit:jLi.StringEdit,StringReplacement:jLi.StringReplacement,TextReplacement:HLi.TextReplacement,TextEdit:HLi.TextEdit,TextLength:ypc.TextLength});function Epc(){}a(Epc,"ensureDependenciesAreSet")});var L_t=I(O_t=>{"use strict";p();Object.defineProperty(O_t,"__esModule",{value:!0});O_t.RootedLineEdit=void 0;var $Li=NG(),_pc=M_t(),vpc=iN();(0,_pc.ensureDependenciesAreSet)();var w2r=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=$Li.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 vpc.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 $Li.LineEdit(r))}};O_t.RootedLineEdit=w2r});var iN=I(G$=>{"use strict";p();Object.defineProperty(G$,"__esModule",{value:!0});G$.Edits=G$.SingleEdits=G$.RootedEdit=void 0;var VLi=rd(),Cpc=NG(),aye=kE(),WLi=k2r(),bpc=L_t(),ULe=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return Cpc.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,VLi.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,VLi.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return bpc.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)}};G$.RootedEdit=ULe;var R2r=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return aye.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new B_t(aye.StringEdit,this.edits.map(e=>e.toEdit()))}};G$.SingleEdits=R2r;var B_t=class t{static{a(this,"Edits")}static single(e){return new t(aye.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=aye.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(aye.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,WLi.serializeStringEdit)(e))}static deserialize(e){return new t(aye.StringEdit,e.map(r=>(0,WLi.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=ULe.toLineEdit(new ULe(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` +`],maxTokens:TLi*f};return h===nN.BlockMode.MoreMultiline&&(g.blockMode=nN.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(xLi,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(xfc,"getGhostTextStrategy");function xLi(t,e,r,n,o,s,c,l,u){let d=t.get(RLi.ICompletionsFeaturesService),f=t.get(wLi.IInstantiationService);if(c&&e===nN.BlockMode.MoreMultiline&&LLe.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===LLe.BlockPositionType.EmptyBlock||o===LLe.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(bfc.ICompletionsCacheService);return{finishedCb:f.createInstance(Ifc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let E={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,Cfc.appendToCache)(m,E,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,R_t.parsingBlockFinished)(r,n):h=>{}}}a(xLi,"buildFinishedCallback");async function wfc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,SLi.telemetry)(t,"ghostText.longFileMultilineSkip",SLi.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===nN.BlockMode.MoreMultiline&&LLe.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,LLe.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&Rfc(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,bLi.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,R_t.isEmptyBlockStartUtil)(r,n):o&&(0,bLi.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,R_t.isEmptyBlockStartUtil)(r,n)||await(0,R_t.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,Tfc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(wfc,"shouldRequestMultiline");function Rfc(t,e){return e.lineAt(t).text.trim().length===0}a(Rfc,"isNewLine")});var LLi=I(jR=>{"use strict";p();var kfc=jR&&jR.__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},iN=jR&&jR.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jR,"__esModule",{value:!0});jR.ForceMultiLine=jR.GhostTextComputer=void 0;jR.getGhostText=Jfc;var DLi=Sp(),Pfc=gm(),Dfc=DPr(),Nfc=T0(),NLi=Gs(),Mfc=NPr(),Ofc=Ore(),Lfc=a4e(),Bfc=USr(),FLe=LE(),b2r=fy(),Ffc=Dl(),Ufc=JAe(),Qfc=yTr(),qfc=y_t(),jfc=rEt(),Hfc=C$(),Gfc=Ayt(),y2r=jAe(),_2r=jPr(),E2r=j4i(),sye=$g(),k_t=gAe(),PLi=_4e(),$fc=HTr(),Vfc=TAe(),Wfc=C4e(),v2r=ALi(),MLi=dIr(),zfc=kLi(),G$=c$(),Eh=wAe(),Yfc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function Kfc(t,e,r){let n=t.get(b2r.ICompletionsFeaturesService),o=(0,FLe.getConfig)(t,FLe.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,sye.now)()-r.issuedTime;return Math.max(0,o-s)}a(Kfc,"getRemainingDebounceMs");function BLe(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(BLe,"isCompletionRequestCancelled");var P_t=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,Nfc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(rpc,e.textDocument,l,n);await(0,Ofc.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,Ufc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,Eh.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 b=(0,sye.now)();h.push([v,b-f]),f=b}if(a(m,"recordPerformance"),m("telemetry"),BLe(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};let g=Xfc(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,Eh.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(Qfc.getEngineRequestInfo,n),y={...Yfc,...s,tokenizer:A.tokenizer},E=await this.instantiationService.invokeFunction(y2r.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(y2r.PromptResponse.toString(E)),E.type==="copilotContentExclusion")return d.debug("Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(y.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:E};if(E.type==="promptCancelled")return d.debug("Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.prompt.prefix.length===0&&E.prompt.suffix.length===0)return d.debug("Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};let _=this.instantiationService.invokeFunction(Kfc,y,n);return _>0&&(d.debug(`Debouncing ghost text request for ${_}ms`),await(0,PLi.delay)(_),BLe(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,y2r.trimLastLine)(e.textDocument.getText(k_t.LocationFactory.range(k_t.LocationFactory.position(0,0),e.position)));d.trace(`Starting ghost text computation, prefix length: ${v.length}`);let b=this.currentGhostText.hasAcceptedCurrentCompletion(v,E.prompt.suffix);d.trace(`hasAcceptedCurrentCompletion: ${b}`);let T=E.prompt,w=await this.instantiationService.invokeFunction(zfc.getGhostTextStrategy,e,v,E,g,b,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(Zfc,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(_2r.extractRepoInfoInBackground,e.textDocument.uri),P={blockMode:w.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:x,engineModelId:A.modelId,ourRequestId:r,prefix:v,prompt:E.prompt,multiline:w.requestMultiline,indentation:(0,Gfc.contextIndentation)(e.textDocument,e.position),isCycling:y.isCycling,headers:A.headers,stop:w.stop,maxTokens:w.maxTokens,afterAccept:b};P.headers={...P.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":y.isSpeculative?"true":"false"};let D=this.instantiationService.invokeFunction(ipc,e.textDocument,P,e.position,E,n,A,y);if(R===void 0&&!y.isCycling&&this.asyncCompletionManager.shouldWaitForAsyncCompletions(v,E.prompt)){d.trace("No cached choices, waiting for async completions from in-flight request");let U=await this.asyncCompletionManager.getFirstMatchingRequestWithTimeout(r,v,E.prompt,y.isSpeculative,D);if(m("asyncWait"),U){d.trace("Received choice from async completion");let Y=!w.requestMultiline;R=[[(0,v2r.makeGhostAPIChoice)(U[0],{forceSingleLine:Y})],G$.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(BLe(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===FLe.BlockMode.MoreMultiline&&Vfc.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(U=>this.instantiationService.invokeFunction(E2r.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0)),R&&(R[1]===G$.ResultType.Cache||R[1]===G$.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,Eh.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,Eh.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let U=this.instantiationService.createInstance(v2r.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let Y=await U.getAllCompletionsFromNetwork(P,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,G$.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 Lfc.CancellationTokenSource,V=U.getCompletionsFromNetwork(P,D,W.token,Y,l);this.asyncCompletionManager.queueCompletionRequest(r,v,E.prompt,W,V);let z=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,E.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,Eh.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[z[0]],G$.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)};let[L,B]=R;d.trace(`Final choices: ${L.length} from ${(0,Eh.resultTypeToString)(B)}`);let q=L.map(U=>this.instantiationService.invokeFunction(E2r.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0);d.trace(`Post-processed to ${q.length} choices`);let M=this.instantiationService.invokeFunction(FLe.getConfig,FLe.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),O=(0,sye.now)()-n.issuedTime,j=Math.max(M-O,0);if(B!==G$.ResultType.TypingAsSuggested&&!y.isCycling&&j>0&&(d.debug(`Waiting ${j}ms before returning completion`),await(0,PLi.delay)(j),BLe(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,Eh.mkCanceledResultTelemetry)(D)};let Q=[];for(let U of q){let Y=npc(e.textDocument,P,U,D),W=g?(0,E2r.checkSuffix)(e.textDocument,e.position,U):0,z={completion:epc(U.choiceIndex,U.completionText,E.trailingWs),telemetry:Y,isMiddleOfTheLine:g,suffixCoverage:W,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};Q.push(z)}return D.properties.clientCompletionId=Q[0]?.clientCompletionId,D.measurements.foundOffset=Q?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${Q.length} results from ${(0,Eh.resultTypeToString)(B)} at ${D.measurements.foundOffset} offset`),BLe(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,Eh.mkCanceledResultTelemetry)(D)}:(y.isSpeculative||(d.trace("Updating current ghost text as request is not speculative"),this.currentGhostText.setGhostText(v,E.prompt.suffix,q,B)),l.setHeaderRequestId(q[0]?.requestId.headerRequestId??r),m("complete"),d.trace(`Ghost text computation complete, returning ${Q.length} results`),{type:"success",value:[Q,B],telemetryData:(0,Eh.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:B,performanceMetrics:h})})}};jR.GhostTextComputer=P_t;jR.GhostTextComputer=P_t=kfc([iN(0,NLi.IInstantiationService),iN(1,Pfc.ITelemetryService),iN(2,Bfc.ICompletionsNotifierService),iN(3,jfc.ICompletionsContextProviderBridgeService),iN(4,MLi.ICompletionsCurrentGhostText),iN(5,Hfc.ICompletionsContextProviderService),iN(6,$fc.ICompletionsAsyncManagerService),iN(7,b2r.ICompletionsFeaturesService),iN(8,Ffc.ICompletionsLogTargetService),iN(9,qfc.ICompletionsStatusReporter),iN(10,DLi.ILogService)],P_t);async function Jfc(t,e,r,n,o,s,c){return t.get(NLi.IInstantiationService).createInstance(P_t).getGhostText(e,r,n,o,s,c)}a(Jfc,"getGhostText");function Zfc(t,e,r,n){let s=t.get(MLi.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=tpc(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),G$.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,G$.ResultType.Cache]}a(Zfc,"getLocalInlineSuggestion");function Xfc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,Mfc.isInlineSuggestionFromTextAfterCursor)(n)}a(Xfc,"isInlineSuggestion");var C2r=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};jR.ForceMultiLine=C2r;function epc(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(epc,"adjustLeadingWhitespace");function tpc(t,e,r,n){let o=t.get(DLi.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(Wfc.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,v2r.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(tpc,"getCompletionsFromCache");async function rpc(t,e,r,n){let o=t.get(b2r.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=sye.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(rpc,"createTelemetryWithExp");function npc(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,OLi(l,t),l.extendWithRequestId(o),l}a(npc,"telemetryWithAddData");function ipc(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);OLi(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===_2r.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==_2r.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(k_t.LocationFactory.range(h.range.start,n)),g=e.getText(k_t.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Dfc.createSha256Hash)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...(0,sye.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 _=d.extendedBy(y,E);return(0,sye.telemetry)(t,"ghostText.issued",_),d}a(ipc,"telemetryIssued");function OLi(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(OLi,"addDocumentTelemetry")});var QLi=I(z6=>{"use strict";p();var opc=z6&&z6.__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},S2r=z6&&z6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(z6,"__esModule",{value:!0});z6.GhostText=void 0;var BLi=ti(),spc=Gs(),apc=hIr(),cpc=N4i(),FLi=LLi(),lpc=xPr(),upc=c$(),dpc=dyt(),ULi=wAe(),fpc=Dl(),T2r=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){ppc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,apc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(ULi.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(FLi.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(lpc.setLastShown,e.textDocument,e.position,f),m=(0,cpc.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!==upc.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(FLi.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:E}=A.range,_=BLi.Range.create(y,BLi.Position.create(E.line,E.character-l));return{...A,range:_}});return{...u,value:g}}};z6.GhostText=T2r;z6.GhostText=T2r=opc([S2r(0,spc.IInstantiationService),S2r(1,fpc.ICompletionsLogTargetService),S2r(2,dpc.ICompletionsSpeculativeRequestCache)],T2r);function ppc(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}});ULi.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(ppc,"logCompletionLocation")});var qLi=I(M_t=>{"use strict";p();Object.defineProperty(M_t,"__esModule",{value:!0});M_t.LocalFileSystem=void 0;var D_t=require("fs"),hpc=require("path"),N_t=i$(),I2r=s$(),x2r=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await D_t.promises.readFile((0,I2r.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,I2r.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,I2r.fsPath)(e),n=await D_t.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,hpc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await D_t.promises.lstat(e);if(r.isSymbolicLink())try{let n=await D_t.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=N_t.FileType.Unknown;return e.isFile()&&(o=N_t.FileType.File),e.isDirectory()&&(o=N_t.FileType.Directory),r.isSymbolicLink()&&n&&(o|=N_t.FileType.SymbolicLink),o}};M_t.LocalFileSystem=x2r});var $Li=I(Y6=>{"use strict";p();var mpc=Y6&&Y6.__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},ULe=Y6&&Y6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Y6,"__esModule",{value:!0});Y6.CompositeRelatedFilesProvider=void 0;var gpc=Bre(),Apc=Gs(),aye=LE(),ypc=fy(),Epc=i$(),_pc=Dl(),QLe=QAe(),Rne=fEt(),jLi=["cpp","c","cuda-cpp"],HLi=["typescript","javascript","typescriptreact","javascriptreact"],GLi=["csharp"],vpc=new Map([...jLi.map(t=>[t,QLe.NeighboringFileType.RelatedCpp]),...HLi.map(t=>[t,QLe.NeighboringFileType.RelatedTypeScript]),...GLi.map(t=>[t,QLe.NeighboringFileType.RelatedCSharpRoslyn])]);function Cpc(t){return vpc.get(t)??QLe.NeighboringFileType.RelatedOther}a(Cpc,"getNeighboringFileType");var w2r=class extends Rne.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(Cpc(s)===QLe.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),Rne.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),Rne.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return Rne.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),Rne.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return Rne.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)Rne.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 GLi.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(aye.getConfig,aye.ConfigKey.RelatedFilesVSCodeCSharp):HLi.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(aye.getConfig,aye.ConfigKey.RelatedFilesVSCodeTypeScript):jLi.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(aye.getConfig,aye.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};Y6.CompositeRelatedFilesProvider=w2r;Y6.CompositeRelatedFilesProvider=w2r=mpc([ULe(0,Apc.IInstantiationService),ULe(1,gpc.IIgnoreService),ULe(2,ypc.ICompletionsFeaturesService),ULe(3,_pc.ICompletionsLogTargetService),ULe(4,Epc.ICompletionsFileSystemService)],w2r)});var O_t=I(kne=>{"use strict";p();Object.defineProperty(kne,"__esModule",{value:!0});kne.PositionOffsetTransformer=kne.PositionOffsetTransformerBase=void 0;kne.ensureDependenciesAreSet=Tpc;var VLi=kE(),WLi=g5e(),bpc=Kut(),Spc=Ime(),zLi=Kut();Object.defineProperty(kne,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return zLi.PositionOffsetTransformerBase},"get")});Object.defineProperty(kne,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return zLi.PositionOffsetTransformer},"get")});(0,bpc._setPositionOffsetTransformerDependencies)({StringEdit:VLi.StringEdit,StringReplacement:VLi.StringReplacement,TextReplacement:WLi.TextReplacement,TextEdit:WLi.TextEdit,TextLength:Spc.TextLength});function Tpc(){}a(Tpc,"ensureDependenciesAreSet")});var B_t=I(L_t=>{"use strict";p();Object.defineProperty(L_t,"__esModule",{value:!0});L_t.RootedLineEdit=void 0;var YLi=MG(),Ipc=O_t(),xpc=oN();(0,Ipc.ensureDependenciesAreSet)();var R2r=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=YLi.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 xpc.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 YLi.LineEdit(r))}};L_t.RootedLineEdit=R2r});var oN=I($$=>{"use strict";p();Object.defineProperty($$,"__esModule",{value:!0});$$.Edits=$$.SingleEdits=$$.RootedEdit=void 0;var KLi=rd(),wpc=MG(),cye=kE(),JLi=P2r(),Rpc=B_t(),qLe=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return wpc.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,KLi.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,KLi.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return Rpc.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)}};$$.RootedEdit=qLe;var k2r=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return cye.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new F_t(cye.StringEdit,this.edits.map(e=>e.toEdit()))}};$$.SingleEdits=k2r;var F_t=class t{static{a(this,"Edits")}static single(e){return new t(cye.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=cye.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(cye.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,JLi.serializeStringEdit)(e))}static deserialize(e){return new t(cye.StringEdit,e.map(r=>(0,JLi.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=qLe.toLineEdit(new qLe(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` --- -`)}};G$.Edits=B_t});var k2r=I(cye=>{"use strict";p();Object.defineProperty(cye,"__esModule",{value:!0});cye.serializeStringEdit=Ipc;cye.serializeSingleEdit=KLi;cye.deserializeStringEdit=xpc;cye.decomposeStringEdit=Rpc;var Spc=Rs(),YLi=kE(),Tpc=hd(),zLi=iN();function Ipc(t){return t.replacements.map(e=>KLi(e))}a(Ipc,"serializeStringEdit");function KLi(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(KLi,"serializeSingleEdit");function xpc(t){return new YLi.StringEdit(t.map(e=>wpc(e)))}a(xpc,"deserializeStringEdit");function wpc(t){return new YLi.StringReplacement(new Tpc.OffsetRange(t[0],t[1]),t[2])}a(wpc,"deserializeSingleEdit");function Rpc(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 zLi.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,Spc.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(F_t,"__esModule",{value:!0});F_t.DebugRecorderBookmark=void 0;var P2r=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};F_t.DebugRecorderBookmark=P2r});var tBi=I(Q_t=>{"use strict";p();Object.defineProperty(Q_t,"__esModule",{value:!0});Q_t.DebugRecorder=void 0;var ZLi=k2r(),kpc=JLi(),Ppc=h4(),Dpc=vMe(),U_t=Sl(),XLi=Ro(),Npc=tJ(),Mpc=C8(),Opc=NA(),eBi=T0(),Lpc=qT(),D2r=class extends XLi.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=Dpc.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,Mpc.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 N2r(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,Ppc.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,XLi.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,eBi.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,U_t.compareBy)(n=>n.sortTime,U_t.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,eBi.generateUuid)()},sortTime:0});for(let o of this._documentHistories.values())n.push(...o.getDocumentLogInRange(e,r));return n.sort((0,U_t.compareBy)(o=>o.sortTime,U_t.numberComparator)),n.map(o=>o.entry)}createBookmark(){return new kpc.DebugRecorderBookmark(this.getNow())}};Q_t.DebugRecorder=D2r;var N2r=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,Opc.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===Npc.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new Lpc.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,ZLi.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,ZLi.serializeStringEdit)(u.edit),time:u.instant},sortTime:u.instant});return c}}});var rBi=I(q_t=>{"use strict";p();Object.defineProperty(q_t,"__esModule",{value:!0});q_t.CapturingToken=void 0;var M2r=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}};q_t.CapturingToken=M2r});var nBi=I(O2r=>{"use strict";p();Object.defineProperty(O2r,"__esModule",{value:!0});O2r.secondsToHumanReadableTime=Bpc;function Bpc(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(Bpc,"secondsToHumanReadableTime")});var jR=I(Jd=>{"use strict";p();var Fpc=Jd&&Jd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Upc=Jd&&Jd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Qpc=Jd&&Jd.__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(lye,"__esModule",{value:!0});lye.serializeStringEdit=Dpc;lye.serializeSingleEdit=eBi;lye.deserializeStringEdit=Npc;lye.decomposeStringEdit=Opc;var kpc=Rs(),XLi=kE(),Ppc=hd(),ZLi=oN();function Dpc(t){return t.replacements.map(e=>eBi(e))}a(Dpc,"serializeStringEdit");function eBi(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(eBi,"serializeSingleEdit");function Npc(t){return new XLi.StringEdit(t.map(e=>Mpc(e)))}a(Npc,"deserializeStringEdit");function Mpc(t){return new XLi.StringReplacement(new Ppc.OffsetRange(t[0],t[1]),t[2])}a(Mpc,"deserializeSingleEdit");function Opc(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 ZLi.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,kpc.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(U_t,"__esModule",{value:!0});U_t.DebugRecorderBookmark=void 0;var D2r=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};U_t.DebugRecorderBookmark=D2r});var oBi=I(q_t=>{"use strict";p();Object.defineProperty(q_t,"__esModule",{value:!0});q_t.DebugRecorder=void 0;var rBi=P2r(),Lpc=tBi(),Bpc=h4(),Fpc=bMe(),Q_t=Sl(),nBi=ko(),Upc=tJ(),Qpc=b8(),qpc=NA(),iBi=T0(),jpc=HT(),N2r=class extends nBi.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=Fpc.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,Qpc.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 M2r(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,Bpc.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,nBi.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,iBi.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,Q_t.compareBy)(n=>n.sortTime,Q_t.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,iBi.generateUuid)()},sortTime:0});for(let o of this._documentHistories.values())n.push(...o.getDocumentLogInRange(e,r));return n.sort((0,Q_t.compareBy)(o=>o.sortTime,Q_t.numberComparator)),n.map(o=>o.entry)}createBookmark(){return new Lpc.DebugRecorderBookmark(this.getNow())}};q_t.DebugRecorder=N2r;var M2r=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,qpc.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===Upc.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new jpc.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,rBi.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,rBi.serializeStringEdit)(u.edit),time:u.instant},sortTime:u.instant});return c}}});var sBi=I(j_t=>{"use strict";p();Object.defineProperty(j_t,"__esModule",{value:!0});j_t.CapturingToken=void 0;var O2r=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}};j_t.CapturingToken=O2r});var aBi=I(L2r=>{"use strict";p();Object.defineProperty(L2r,"__esModule",{value:!0});L2r.secondsToHumanReadableTime=Hpc;function Hpc(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(Hpc,"secondsToHumanReadableTime")});var HR=I(Jd=>{"use strict";p();var Gpc=Jd&&Jd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Jd&&Jd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Vpc=Jd&&Jd.__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(mL,"__esModule",{value:!0});mL.PendingLoggedChatRequest=mL.IRequestLogger=mL.ChatRequestScheme=void 0;mL.resolveMarkdownContent=zpc;mL.resolveMarkdownIcon=Ypc;var cBi=jR(),Vpc=nn(),Wpc=hd(),L2r=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 Wpc.OffsetRange(n.index,n.index+o.length)}})}};mL.ChatRequestScheme=L2r;mL.IRequestLogger=(0,Vpc.createServiceIdentifier)("IRequestLogger");function zpc(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(zpc,"resolveMarkdownContent");function Ypc(t){return typeof t.icon=="function"?t.icon():t.icon}a(Ypc,"resolveMarkdownIcon");var B2r=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})}},F2r=class extends B2r{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===cBi.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===cBi.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})}};mL.PendingLoggedChatRequest=F2r});var Q2r=I(uye=>{"use strict";p();Object.defineProperty(uye,"__esModule",{value:!0});uye.NullSnippyService=uye.ISnippyService=void 0;var Kpc=nn();uye.ISnippyService=(0,Kpc.createServiceIdentifier)("ISnippyService");var U2r=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};uye.NullSnippyService=U2r});var H2r=I(dye=>{"use strict";p();Object.defineProperty(dye,"__esModule",{value:!0});dye.MovedText=dye.LinesDiff=void 0;var q2r=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};dye.LinesDiff=q2r;var j2r=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()))}};dye.MovedText=j2r});var G_t=I(sN=>{"use strict";p();Object.defineProperty(sN,"__esModule",{value:!0});sN.RangeMapping=sN.DetailedLineRangeMapping=sN.LineRangeMapping=void 0;sN.lineRangeMappingFromRangeMappings=Zpc;sN.getLineRangeMapping=fBi;sN.lineRangeMappingFromChange=Xpc;var Jpc=Sl(),lBi=rd(),H_t=Rs(),g1=$2(),oN=q_(),gL=eh(),dBi=h5e(),QLe=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 g1.LineRange(s,u.original.startLineNumber),new g1.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new g1.LineRange(s,r+1),new g1.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 Y6(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new H_t.BugIndicatingError("not a valid diff");return new Y6(new gL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new gL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Y6(new gL.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new gL.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(uBi(this.original.endLineNumberExclusive,e)&&uBi(this.modified.endLineNumberExclusive,r))return new Y6(new gL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new gL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new Y6(gL.Range.fromPositions(new oN.Position(this.original.startLineNumber,1),fye(new oN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),gL.Range.fromPositions(new oN.Position(this.modified.startLineNumber,1),fye(new oN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Y6(gL.Range.fromPositions(fye(new oN.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),fye(new oN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),gL.Range.fromPositions(fye(new oN.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),fye(new oN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new H_t.BugIndicatingError}};sN.LineRangeMapping=QLe;function fye(t,e){if(t.lineNumber<1)return new oN.Position(1,1);if(t.lineNumber>e.length)return new oN.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new oN.Position(t.lineNumber,r.length+1):t}a(fye,"normalizePosition");function uBi(t,e){return t>=1&&t<=e.length}a(uBi,"isValidLineNumber");var qLe=class t extends QLe{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 dBi.TextEdit(n)}static fromRangeMappings(e){let r=g1.LineRange.join(e.map(o=>g1.LineRange.fromRangeInclusive(o.originalRange))),n=g1.LineRange.join(e.map(o=>g1.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()])}};sN.DetailedLineRangeMapping=qLe;var Y6=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 H_t.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 dBi.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};sN.RangeMapping=Y6;function Zpc(t,e,r,n=!1){let o=[];for(let s of(0,Jpc.groupAdjacentBy)(t.map(c=>fBi(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 qLe(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,lBi.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,lBi.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 g1.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new g1.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new qLe(s,c,[t])}a(fBi,"getLineRangeMapping");function Xpc(t){let e;t.originalEndLineNumber===0?e=new g1.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new g1.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new g1.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new g1.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new QLe(e,r)}a(Xpc,"lineRangeMappingFromChange")});var hye=I(HR=>{"use strict";p();Object.defineProperty(HR,"__esModule",{value:!0});HR.DateTimeout=HR.InfiniteTimeout=HR.OffsetPair=HR.SequenceDiff=HR.DiffAlgorithmResult=void 0;var ehc=Sl(),pBi=Rs(),pye=hd(),G2r=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new jLe(pye.OffsetRange.ofLength(e.length),pye.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new jLe(pye.OffsetRange.ofLength(e.length),pye.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};HR.DiffAlgorithmResult=G2r;var jLe=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,ehc.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():Pne.zero,s?s.getStarts():new Pne(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new pye.OffsetRange(e.offset1,r.offset1),new pye.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 pBi.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 Pne(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Pne(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};HR.SequenceDiff=jLe;var Pne=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}};HR.OffsetPair=Pne;var $2r=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};HR.InfiniteTimeout=$2r;var V2r=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new pBi.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};HR.DateTimeout=V2r});var $_t=I(Dne=>{"use strict";p();Object.defineProperty(Dne,"__esModule",{value:!0});Dne.LineRangeFragment=Dne.Array2D=void 0;Dne.isSpace=thc;var W2r=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}};Dne.Array2D=W2r;function thc(t){return t===32||t===9}a(thc,"isSpace");var z2r=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(V_t,"__esModule",{value:!0});V_t.DynamicProgrammingDiffing=void 0;var hBi=hd(),HLe=hye(),Y2r=$_t(),K2r=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=HLe.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return HLe.DiffAlgorithmResult.trivial(e,r);let s=new Y2r.Array2D(e.length,r.length),c=new Y2r.Array2D(e.length,r.length),l=new Y2r.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 b=Math.max(E,_,v);if(b===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 b===E?(l.set(A,y,0),c.set(A,y,1)):b===_&&(l.set(A,y,0),c.set(A,y,2));s.set(A,y,b)}let u=[],d=e.length,f=r.length;function h(A,y){(A+1!==d||y+1!==f)&&u.push(new HLe.SequenceDiff(new hBi.OffsetRange(A+1,d),new hBi.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 HLe.DiffAlgorithmResult(u,!1)}};V_t.DynamicProgrammingDiffing=K2r});var eDr=I(z_t=>{"use strict";p();Object.defineProperty(z_t,"__esModule",{value:!0});z_t.MyersDiffAlgorithm=void 0;var gBi=hd(),GLe=hye(),J2r=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=GLe.InfiniteTimeout.instance){if(e.length===0||r.length===0)return GLe.DiffAlgorithmResult.trivial(e,r);let o=e,s=r;function c(y,E){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 W_t(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,E=h?h.y+h.length:0;if((y!==g||E!==A)&&m.push(new GLe.SequenceDiff(new gBi.OffsetRange(y,g),new gBi.OffsetRange(E,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new GLe.DiffAlgorithmResult(m,!1)}};z_t.MyersDiffAlgorithm=J2r;var W_t=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},Z2r=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}}},X2r=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 nDr=I(K_t=>{"use strict";p();Object.defineProperty(K_t,"__esModule",{value:!0});K_t.LinesSliceCharSequence=void 0;var tDr=xq(),Y_t=hd(),rhc=q_(),ABi=eh(),nhc=$_t(),rDr=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=_Bi(e>0?this.elements[e-1]:-1),n=_Bi(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new rhc.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)?ABi.Range.fromPositions(n,n):ABi.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!mye(this.elements[e]))return;let r=e;for(;r>0&&mye(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!mye(this.elements[e]))return;let r=e;for(;r>0&&mye(this.elements[r-1])&&!yBi(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,tDr.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new Y_t.OffsetRange(r,n)}};K_t.LinesSliceCharSequence=rDr;function mye(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(mye,"isWordChar");function yBi(t){return t>=65&&t<=90}a(yBi,"isUpperCase");var ihc={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function EBi(t){return ihc[t]}a(EBi,"getCategoryBoundaryScore");function _Bi(t){return t===10?8:t===13?7:(0,nhc.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(_Bi,"getCategory")});var SBi=I(iDr=>{"use strict";p();Object.defineProperty(iDr,"__esModule",{value:!0});iDr.computeMovedLines=chc;var ohc=hye(),J_t=G_t(),AL=Sl(),$Le=xq(),shc=zP(),A1=$2(),vBi=nDr(),Z_t=$_t(),ahc=eDr(),CBi=eh();function chc(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=uhc(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=dhc(u,n,o,e,r,s);return(0,AL.pushMany)(c,d),c=fhc(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` -`).length>=15&&lhc(h,g=>g.length>=2)>=2}),c=phc(t,c),c}a(chc,"computeMovedLines");function lhc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(lhc,"countWhere");function uhc(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new Z_t.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new Z_t.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 J_t.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(uhc,"computeMovesFromSimpleDeletionsToSimpleInsertions");function dhc(t,e,r,n,o,s){let c=[],l=new shc.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,AL.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===E.endLineNumberExclusive){T.originalLineRange=new A1.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new A1.LineRange(T.modifiedLineRange.startLineNumber,E.endLineNumberExclusive),_.push(T);return}let b={modifiedLineRange:E,originalLineRange:v};u.push(b),_.push(b)}),g=_}if(!s.isValid())return[]}u.sort((0,AL.reverseOrder)((0,AL.compareBy)(m=>m.modifiedLineRange.length,AL.numberComparator)));let d=new A1.LineRangeSet,f=new A1.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),E=A.getIntersection(y);for(let _ of E.ranges){if(_.length<3)continue;let v=_,b=_.delta(-g);c.push(new J_t.LineRangeMapping(b,v)),d.addRange(v),f.addRange(b)}}c.sort((0,AL.compareBy)(m=>m.original.startLineNumber,AL.numberComparator));let h=new $Le.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,$Le.findLastMonotonous)(t,R=>R.modified.startLineNumber<=g.modified.startLineNumber),E=Math.max(g.original.startLineNumber-A.original.startLineNumber,g.modified.startLineNumber-y.modified.startLineNumber),_=h.findLastMonotonous(R=>R.original.startLineNumberR.modified.startLineNumbern.length||x>o.length||d.contains(x)||f.contains(R)||!bBi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new A1.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new A1.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!bBi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new A1.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new A1.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new J_t.LineRangeMapping(new A1.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new A1.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(dhc,"computeUnchangedMoves");function bBi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new ahc.MyersDiffAlgorithm().compute(new vBi.LinesSliceCharSequence([t],new CBi.Range(1,1,1,t.length),!1),new vBi.LinesSliceCharSequence([e],new CBi.Range(1,1,1,e.length),!1),r),s=0,c=ohc.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,Z_t.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(bBi,"areLinesSimilar");function fhc(t){if(t.length===0)return t;t.sort((0,AL.compareBy)(r=>r.original.startLineNumber,AL.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(fhc,"joinCloseConsecutiveMoves");function phc(t,e){let r=new $Le.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(Nne,"__esModule",{value:!0});Nne.optimizeSequenceDiffs=mhc;Nne.removeShortMatches=Ahc;Nne.extendDiffsToEntireWordIfAppropriate=yhc;Nne.removeVeryShortMatchingLinesBetweenDiffs=_hc;Nne.removeVeryShortMatchingTextBetweenLongDiffs=vhc;var hhc=Sl(),yL=hd(),EL=hye();function mhc(t,e,r){let n=r;return n=TBi(t,e,n),n=TBi(t,e,n),n=ghc(t,e,n),n}a(mhc,"optimizeSequenceDiffs");function TBi(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(TBi,"joinSequenceDiffsByShifting");function ghc(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(IBi,"shiftDiffToBetterPosition");function Ahc(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 EL.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(Ahc,"removeShortMatches");function yhc(t,e,r,n,o=!1){let s=EL.SequenceDiff.invert(r,t.length),c=[],l=new EL.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 EL.SequenceDiff(T,w),x=R.intersect(v);if(E+=x.seq1Range.length,_+=x.seq2Range.length,A=A.join(R),A.seq1Range.endExclusive>=v.seq1Range.endExclusive)s.shift();else break}(o&&E+_0;){let f=s.shift();f.seq1Range.isEmpty||(u(f.getStarts(),f),u(f.getEndExclusives().delta(-1),f))}return Ehc(r,c)}a(yhc,"extendDiffsToEntireWordIfAppropriate");function Ehc(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(Ehc,"mergeSequenceDiffs");function _hc(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(_hc,"removeVeryShortMatchingLinesBetweenDiffs");function vhc(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 _=t.getText(y).trim();if(_.length>20||_.split(/\r\n|\r|\n/).length>1)return!1;let v=t.countLinesIn(g.seq1Range),b=g.seq1Range.length,T=e.countLinesIn(g.seq2Range),w=g.seq2Range.length,R=t.countLinesIn(A.seq1Range),x=A.seq1Range.length,P=e.countLinesIn(A.seq2Range),D=A.seq2Range.length,N=130;function L(B){return Math.min(B,N)}return a(L,"cap"),Math.pow(Math.pow(L(v*40+b),1.5)+Math.pow(L(T*40+w),1.5),1.5)+Math.pow(Math.pow(L(R*40+x),1.5)+Math.pow(L(P*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,hhc.forEachWithNeighbors)(n,(l,u,d)=>{let f=u;function h(_){return _.length>0&&_.trim().length<=3&&u.seq1Range.length+u.seq2Range.length>100}a(h,"shouldMarkAsChanged");let m=t.extendToFullLines(u.seq1Range),g=t.getText(new yL.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new yL.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=EL.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():EL.OffsetPair.zero,d?d.getStarts():EL.OffsetPair.max),E=f.intersect(y);c.length>0&&E.getStarts().equals(c[c.length-1].getEndExclusives())?c[c.length-1]=c[c.length-1].join(E):c.push(E)}),c}a(vhc,"removeVeryShortMatchingTextBetweenLongDiffs")});var RBi=I(X_t=>{"use strict";p();Object.defineProperty(X_t,"__esModule",{value:!0});X_t.LineSequence=void 0;var oDr=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:wBi(this.lines[e-1]),n=e===this.lines.length?0:wBi(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]}};X_t.LineSequence=oDr;function wBi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(nvt,"__esModule",{value:!0});nvt.DefaultLinesDiffComputer=void 0;var Chc=Sl(),kBi=rd(),rvt=$2(),PBi=hd(),DBi=eh(),evt=qT(),tvt=H2r(),One=G_t(),_L=hye(),bhc=mBi(),Shc=eDr(),Thc=SBi(),Mne=xBi(),NBi=RBi(),MBi=nDr(),sDr=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new bhc.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new Shc.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,Chc.equals)(e,r,(x,P)=>x===P))return new tvt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new tvt.LinesDiff([new One.DetailedLineRangeMapping(new rvt.LineRange(1,e.length+1),new rvt.LineRange(1,r.length+1),[new One.RangeMapping(new DBi.Range(1,1,e.length,e[e.length-1].length+1),new DBi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?_L.InfiniteTimeout.instance:new _L.DateTimeout(n.maxComputationTimeMs),s=!n.ignoreTrimWhitespace,c=new Map;function l(x){let P=c.get(x);return P===void 0&&(P=c.size,c.set(x,P)),P}a(l,"getOrCreateHash");let u=e.map(x=>l(x.trim())),d=r.map(x=>l(x.trim())),f=new NBi.LineSequence(u,e),h=new NBi.LineSequence(d,r),m=f.length+h.length<1700?this.dynamicProgrammingDiffing.compute(f,h,o,(x,P)=>e[x]===r[P]?r[P].length===0?.1:1+Math.log(1+r[P].length):.99):this.myersDiffingAlgorithm.compute(f,h,o),g=m.diffs,A=m.hitTimeout;g=(0,Mne.optimizeSequenceDiffs)(f,h,g),g=(0,Mne.removeVeryShortMatchingLinesBetweenDiffs)(f,h,g);let y=[],E=a(x=>{if(s)for(let P=0;Px.seq1Range.start-_===x.seq2Range.start-v);let P=x.seq1Range.start-_;E(P),_=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(e.length-_);let b=new evt.ArrayText(e),T=new evt.ArrayText(r),w=(0,One.lineRangeMappingFromRangeMappings)(y,b,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,kBi.assertFn)(()=>{function x(D,N){if(D.lineNumber<1||D.lineNumber>N.length)return!1;let L=N[D.lineNumber-1];return!(D.column<1||D.column>L.length+1)}a(x,"validatePosition");function P(D,N){return!(D.startLineNumber<1||D.startLineNumber>N.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>N.length+1)}a(P,"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(!P(D.modified,r)||!P(D.original,e))return!1}return!0}),new tvt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,Thc.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new _L.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,One.lineRangeMappingFromRangeMappings)(m.mappings,new evt.ArrayText(r),new evt.ArrayText(n),!0);return new tvt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=Ihc(n).toRangeMapping2(e,r),d=new MBi.LinesSliceCharSequence(e,u.originalRange,s),f=new MBi.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&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.optimizeSequenceDiffs)(d,f,g),m&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findWordContaining(E)),m&&_L.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,Mne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findSubWordContaining(E),!0),m&&_L.SequenceDiff.assertSorted(g)),g=(0,Mne.removeShortMatches)(d,f,g),m&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&_L.SequenceDiff.assertSorted(g);let A=g.map(y=>new One.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&One.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};nvt.DefaultLinesDiffComputer=sDr;function Ihc(t){return new One.LineRangeMapping(new rvt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new rvt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(Ihc,"toLineRangeMapping")});var cDr=I(Fv=>{"use strict";p();Object.defineProperty(Fv,"__esModule",{value:!0});Fv.EditDataWithIndex=Fv.maxImperfectAgreementLength=Fv.maxAgreementOffset=void 0;Fv.tryRebase=Phc;Fv.checkEditConsistency=LBi;Fv.tryRebaseStringEdits=Nhc;var xhc=iN(),whc=X_(),zE=kE(),gye=hd(),OBi=qT(),Rhc=aDr(),khc=!1;Fv.maxAgreementOffset=10;Fv.maxImperfectAgreementLength=5;var ivt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};Fv.EditDataWithIndex=ivt;function Phc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:Fv.maxImperfectAgreementLength}){let f=Date.now();try{return Dhc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${whc.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(Phc,"tryRebase");function Dhc(t,e,r,n,o,s,c,l,u,d){if(!LBi(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.lengthzE.AnnotatedStringEdit.create(E))),g=BBi(t,m,f,l,d);if(!g)return"rebaseFailed";let A=g.replacements.reduce((E,_)=>((E[_.data.index]||=[]).push(_),E),[]),y=[];for(let E=0;ER>0?s.substring(x[R-1].replaceRange.endExclusive,w.replaceRange.start)+w.newText:w.newText).join(""),T=zE.StringReplacement.replace(v,b);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:E})}return l==="strict"&&y.length>0&&new xhc.SingleEdits(r).apply(t)!==zE.StringEdit.create(y.map(E=>E.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(Dhc,"_tryRebase");function LBi(t,e,r,n,o=khc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(LBi,"checkEditConsistency");function Nhc(t,e,r,n,o={maxImperfectAgreementLength:Fv.maxImperfectAgreementLength}){return BBi(t,e.mapData(s=>new zE.VoidEditData),r,n,o)?.toStringEdit()}a(Nhc,"tryRebaseStringEdits");function BBi(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 zE.AnnotatedStringReplacement(gye.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,E;for(;y&&m.replaceRange.containsRange(y.replaceRange);){if(A=Bhc(t,m,y,E,A,n,o),A===-1)return;g+=y.newText.length-y.replaceRange.length,E=y,y=s.replacements[++l]}c.push(new zE.AnnotatedStringReplacement(new gye.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(;uFv.maxAgreementOffset||b-g>0&&v.length>o.maxImperfectAgreementLength);if(b!==-1&&!T){g=b+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-_.length),x=y.newText.substring(R);x.length>0&&c.push(new zE.AnnotatedStringReplacement(gye.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(E))return}l++,d+=f.newText.length-f.replaceRange.length}else return;else if(h.replaceRange.start",'""',"''","``"]);function Lhc(t){return Ohc.has(t)}a(Lhc,"isAutoClosePair");function Bhc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uFv.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&Lhc(l)&&Mhc(l,e.newText.substring(o))?o:-1}a(Bhc,"agreementIndexOf");function Fhc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new Rhc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new OBi.StringText(t),f=new OBi.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 zE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(Fhc,"computeDiff")});var UBi=I(ovt=>{"use strict";p();Object.defineProperty(ovt,"__esModule",{value:!0});ovt.RejectionCollector=void 0;var Uhc=h4(),FBi=Ro(),Qhc=W2(),lDr=class extends FBi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new fDr(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,Qhc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new uDr(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,Uhc.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,FBi.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()}};ovt.RejectionCollector=lDr;var uDr=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 dDr(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}},dDr=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()}},fDr=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 hDr=I(Aye=>{"use strict";p();Object.defineProperty(Aye,"__esModule",{value:!0});Aye.DisposablesLRUCache=Aye.LRUCache=void 0;var VLe=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},svt=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 VLe("",null),this._tail=new VLe("",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 VLe(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}};Aye.LRUCache=svt;var pDr=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new svt(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()}};Aye.DisposablesLRUCache=pDr});var QBi=I(cvt=>{"use strict";p();Object.defineProperty(cvt,"__esModule",{value:!0});cvt.RebaseFailureInfo=void 0;var qhc=kE(),mDr=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 qhc.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 = ${avt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${avt(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}), ${avt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${avt(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(` -`)}};cvt.RebaseFailureInfo=mDr;function avt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(avt,"toBacktickLiteral")});var jBi=I(uvt=>{"use strict";p();Object.defineProperty(uvt,"__esModule",{value:!0});uvt.NextEditCache=void 0;var WLe=Pl(),jhc=h4(),Hhc=hDr(),qBi=Ro(),Ghc=C8(),lvt=cDr(),$hc=QBi(),gDr=class extends qBi.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 Hhc.LRUCache(50),(0,Ghc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new ADr(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,jhc.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(WLe.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,qBi.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){let s=this._documentCaches.get(e);s&&s.setNoNextEdit(r,n,o)}_getNesRebaseConfigs(){let e=this._configService.getExperimentBasedConfig(WLe.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(WLe.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(WLe.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(WLe.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()}};uvt.NextEditCache=gDr;var ADr=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,lvt.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,edit:n,edits:o,detailedEdits:[],userEditSince:s,subsequentN:c,source:l,documentBeforeEdit:e,editWindow:r,originalEditWindow:u.originalEditWindow,cacheTime:Date.now(),isFromCursorJump:u.isFromCursorJump,cursorOffsetAtCacheTime:u.cursorOffset};s&&((0,lvt.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){let o=this._getKey(e.value),s={docId:this.docId,edit:void 0,edits:[],detailedEdits:[],source:n,documentBeforeEdit:e,editWindow:r,cacheTime:Date.now(),isFromCursorJump:!1},c=this._sharedCache.get(o);c&&this.evictedCachedEdit(c);let l=this._sharedCache.put(o,s);l&&this._nextEditCache.evictedCachedEdit(l[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.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,lvt.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 $hc.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,lvt.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 HBi=I(dvt=>{"use strict";p();Object.defineProperty(dvt,"__esModule",{value:!0});dvt.NextEditResult=void 0;var yDr=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};dvt.NextEditResult=yDr});var GBi=I(fvt=>{"use strict";p();Object.defineProperty(fvt,"__esModule",{value:!0});fvt.SpeculativeRequestManager=void 0;var Vhc=Ro(),EDr=class extends Vhc.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 Whc=cI&&cI.__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=cI&&cI.__param||function(t,e){return function(r,n){e(r,n,t)}},_Dr;Object.defineProperty(cI,"__esModule",{value:!0});cI.NextEditFetchRequest=cI.NextEditProvider=cI.NesOutcome=void 0;var zhc=require("path"),y1=Pl(),yye=iN(),JLe=L_t(),YLe=py(),Yhc=Zft(),wp=nye(),Khc=h4(),vDr=Sp(),Jhc=rBi(),Zhc=lye(),Xhc=Q2r(),emc=mh(),KLe=X_(),YE=uw(),$Bi=rd(),pvt=nl(),tmc=WJe(),SDr=Rs(),hvt=Ro(),VBi=W2(),WBi=FO(),rmc=KS(),ZBi=T0(),zBi=NG(),Lne=kE(),nmc=q_(),CDr=hd(),YBi=qT(),imc=cDr(),omc=UBi(),smc=jBi(),mvt=HBi(),amc=GBi();function cmc(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 CDr.OffsetRange(Math.min(u,c),Math.max(f,l))}a(cmc,"computeReducedWindow");function KBi(t,e){let n=new JLe.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r +${c}`}}return s}a(Jpc,"getErrorDetailsFromChatFetchErrorInner");function dBi(t,e=!0){switch(t){case lBi.FilterReason.Copyright:return e?xi.t({message:"Sorry, the response matched public code so it was blocked. Please rephrase your prompt. [Learn more](https://aka.ms/copilot-chat-filtered-docs).",comment:["{Locked='](https://aka.ms/copilot-chat-filtered-docs)'}"]}):xi.t("Sorry, the response matched public code so it was blocked. Please rephrase your prompt.");case lBi.FilterReason.Prompt:return e?xi.t({message:"Sorry, your prompt was filtered by the Responsible AI Service. Please rephrase your prompt and try again. [Learn more](https://aka.ms/copilot-chat-filtered-docs).",comment:["{Locked='](https://aka.ms/copilot-chat-filtered-docs)'}"]}):xi.t("Sorry, your prompt was filtered by the Responsible AI Service. Please rephrase your prompt and try again.");default:return e?xi.t({message:"Sorry, the response was filtered by the Responsible AI Service. Please rephrase your prompt and try again. [Learn more](https://aka.ms/copilot-chat-filtered-docs).",comment:["{Locked='](https://aka.ms/copilot-chat-filtered-docs)'}"]}):xi.t("Sorry, the response was filtered by the Responsible AI Service. Please rephrase your prompt and try again.")}}a(dBi,"getFilteredMessage");Jd.CanceledMessage={message:"Canceled"};Jd.CanceledResult={errorDetails:Jd.CanceledMessage}});var uye=I(mL=>{"use strict";p();Object.defineProperty(mL,"__esModule",{value:!0});mL.PendingLoggedChatRequest=mL.IRequestLogger=mL.ChatRequestScheme=void 0;mL.resolveMarkdownContent=ehc;mL.resolveMarkdownIcon=thc;var fBi=HR(),Zpc=nn(),Xpc=hd(),B2r=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 Xpc.OffsetRange(n.index,n.index+o.length)}})}};mL.ChatRequestScheme=B2r;mL.IRequestLogger=(0,Zpc.createServiceIdentifier)("IRequestLogger");function ehc(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(ehc,"resolveMarkdownContent");function thc(t){return typeof t.icon=="function"?t.icon():t.icon}a(thc,"resolveMarkdownIcon");var F2r=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})}},U2r=class extends F2r{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===fBi.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===fBi.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})}};mL.PendingLoggedChatRequest=U2r});var q2r=I(dye=>{"use strict";p();Object.defineProperty(dye,"__esModule",{value:!0});dye.NullSnippyService=dye.ISnippyService=void 0;var rhc=nn();dye.ISnippyService=(0,rhc.createServiceIdentifier)("ISnippyService");var Q2r=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};dye.NullSnippyService=Q2r});var G2r=I(fye=>{"use strict";p();Object.defineProperty(fye,"__esModule",{value:!0});fye.MovedText=fye.LinesDiff=void 0;var j2r=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};fye.LinesDiff=j2r;var H2r=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()))}};fye.MovedText=H2r});var $_t=I(aN=>{"use strict";p();Object.defineProperty(aN,"__esModule",{value:!0});aN.RangeMapping=aN.DetailedLineRangeMapping=aN.LineRangeMapping=void 0;aN.lineRangeMappingFromRangeMappings=ihc;aN.getLineRangeMapping=gBi;aN.lineRangeMappingFromChange=ohc;var nhc=Sl(),pBi=rd(),G_t=Rs(),g1=V2(),sN=q_(),gL=eh(),mBi=g5e(),jLe=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 g1.LineRange(s,u.original.startLineNumber),new g1.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new g1.LineRange(s,r+1),new g1.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 K6(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new G_t.BugIndicatingError("not a valid diff");return new K6(new gL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new gL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new K6(new gL.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new gL.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(hBi(this.original.endLineNumberExclusive,e)&&hBi(this.modified.endLineNumberExclusive,r))return new K6(new gL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new gL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new K6(gL.Range.fromPositions(new sN.Position(this.original.startLineNumber,1),pye(new sN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),gL.Range.fromPositions(new sN.Position(this.modified.startLineNumber,1),pye(new sN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new K6(gL.Range.fromPositions(pye(new sN.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),pye(new sN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),gL.Range.fromPositions(pye(new sN.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),pye(new sN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new G_t.BugIndicatingError}};aN.LineRangeMapping=jLe;function pye(t,e){if(t.lineNumber<1)return new sN.Position(1,1);if(t.lineNumber>e.length)return new sN.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new sN.Position(t.lineNumber,r.length+1):t}a(pye,"normalizePosition");function hBi(t,e){return t>=1&&t<=e.length}a(hBi,"isValidLineNumber");var HLe=class t extends jLe{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 mBi.TextEdit(n)}static fromRangeMappings(e){let r=g1.LineRange.join(e.map(o=>g1.LineRange.fromRangeInclusive(o.originalRange))),n=g1.LineRange.join(e.map(o=>g1.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()])}};aN.DetailedLineRangeMapping=HLe;var K6=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 G_t.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 mBi.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};aN.RangeMapping=K6;function ihc(t,e,r,n=!1){let o=[];for(let s of(0,nhc.groupAdjacentBy)(t.map(c=>gBi(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 HLe(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,pBi.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,pBi.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 g1.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new g1.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new HLe(s,c,[t])}a(gBi,"getLineRangeMapping");function ohc(t){let e;t.originalEndLineNumber===0?e=new g1.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new g1.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new g1.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new g1.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new jLe(e,r)}a(ohc,"lineRangeMappingFromChange")});var mye=I(GR=>{"use strict";p();Object.defineProperty(GR,"__esModule",{value:!0});GR.DateTimeout=GR.InfiniteTimeout=GR.OffsetPair=GR.SequenceDiff=GR.DiffAlgorithmResult=void 0;var shc=Sl(),ABi=Rs(),hye=hd(),$2r=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new GLe(hye.OffsetRange.ofLength(e.length),hye.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new GLe(hye.OffsetRange.ofLength(e.length),hye.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};GR.DiffAlgorithmResult=$2r;var GLe=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,shc.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():Pne.zero,s?s.getStarts():new Pne(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new hye.OffsetRange(e.offset1,r.offset1),new hye.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 ABi.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 Pne(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Pne(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};GR.SequenceDiff=GLe;var Pne=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}};GR.OffsetPair=Pne;var V2r=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};GR.InfiniteTimeout=V2r;var W2r=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new ABi.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};GR.DateTimeout=W2r});var V_t=I(Dne=>{"use strict";p();Object.defineProperty(Dne,"__esModule",{value:!0});Dne.LineRangeFragment=Dne.Array2D=void 0;Dne.isSpace=ahc;var z2r=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}};Dne.Array2D=z2r;function ahc(t){return t===32||t===9}a(ahc,"isSpace");var Y2r=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(W_t,"__esModule",{value:!0});W_t.DynamicProgrammingDiffing=void 0;var yBi=hd(),$Le=mye(),K2r=V_t(),J2r=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=$Le.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return $Le.DiffAlgorithmResult.trivial(e,r);let s=new K2r.Array2D(e.length,r.length),c=new K2r.Array2D(e.length,r.length),l=new K2r.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 b=Math.max(E,_,v);if(b===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 b===E?(l.set(A,y,0),c.set(A,y,1)):b===_&&(l.set(A,y,0),c.set(A,y,2));s.set(A,y,b)}let u=[],d=e.length,f=r.length;function h(A,y){(A+1!==d||y+1!==f)&&u.push(new $Le.SequenceDiff(new yBi.OffsetRange(A+1,d),new yBi.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 $Le.DiffAlgorithmResult(u,!1)}};W_t.DynamicProgrammingDiffing=J2r});var tDr=I(Y_t=>{"use strict";p();Object.defineProperty(Y_t,"__esModule",{value:!0});Y_t.MyersDiffAlgorithm=void 0;var _Bi=hd(),VLe=mye(),Z2r=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=VLe.InfiniteTimeout.instance){if(e.length===0||r.length===0)return VLe.DiffAlgorithmResult.trivial(e,r);let o=e,s=r;function c(y,E){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 z_t(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,E=h?h.y+h.length:0;if((y!==g||E!==A)&&m.push(new VLe.SequenceDiff(new _Bi.OffsetRange(y,g),new _Bi.OffsetRange(E,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new VLe.DiffAlgorithmResult(m,!1)}};Y_t.MyersDiffAlgorithm=Z2r;var z_t=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},X2r=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}}},eDr=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 iDr=I(J_t=>{"use strict";p();Object.defineProperty(J_t,"__esModule",{value:!0});J_t.LinesSliceCharSequence=void 0;var rDr=wq(),K_t=hd(),chc=q_(),vBi=eh(),lhc=V_t(),nDr=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=SBi(e>0?this.elements[e-1]:-1),n=SBi(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new chc.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)?vBi.Range.fromPositions(n,n):vBi.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!gye(this.elements[e]))return;let r=e;for(;r>0&&gye(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!gye(this.elements[e]))return;let r=e;for(;r>0&&gye(this.elements[r-1])&&!CBi(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,rDr.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new K_t.OffsetRange(r,n)}};J_t.LinesSliceCharSequence=nDr;function gye(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(gye,"isWordChar");function CBi(t){return t>=65&&t<=90}a(CBi,"isUpperCase");var uhc={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function bBi(t){return uhc[t]}a(bBi,"getCategoryBoundaryScore");function SBi(t){return t===10?8:t===13?7:(0,lhc.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(SBi,"getCategory")});var wBi=I(oDr=>{"use strict";p();Object.defineProperty(oDr,"__esModule",{value:!0});oDr.computeMovedLines=hhc;var dhc=mye(),Z_t=$_t(),AL=Sl(),WLe=wq(),fhc=YP(),A1=V2(),TBi=iDr(),X_t=V_t(),phc=tDr(),IBi=eh();function hhc(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=ghc(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=Ahc(u,n,o,e,r,s);return(0,AL.pushMany)(c,d),c=yhc(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` +`).length>=15&&mhc(h,g=>g.length>=2)>=2}),c=Ehc(t,c),c}a(hhc,"computeMovedLines");function mhc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(mhc,"countWhere");function ghc(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new X_t.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new X_t.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 Z_t.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(ghc,"computeMovesFromSimpleDeletionsToSimpleInsertions");function Ahc(t,e,r,n,o,s){let c=[],l=new fhc.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,AL.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===E.endLineNumberExclusive){T.originalLineRange=new A1.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new A1.LineRange(T.modifiedLineRange.startLineNumber,E.endLineNumberExclusive),_.push(T);return}let b={modifiedLineRange:E,originalLineRange:v};u.push(b),_.push(b)}),g=_}if(!s.isValid())return[]}u.sort((0,AL.reverseOrder)((0,AL.compareBy)(m=>m.modifiedLineRange.length,AL.numberComparator)));let d=new A1.LineRangeSet,f=new A1.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),E=A.getIntersection(y);for(let _ of E.ranges){if(_.length<3)continue;let v=_,b=_.delta(-g);c.push(new Z_t.LineRangeMapping(b,v)),d.addRange(v),f.addRange(b)}}c.sort((0,AL.compareBy)(m=>m.original.startLineNumber,AL.numberComparator));let h=new WLe.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,WLe.findLastMonotonous)(t,R=>R.modified.startLineNumber<=g.modified.startLineNumber),E=Math.max(g.original.startLineNumber-A.original.startLineNumber,g.modified.startLineNumber-y.modified.startLineNumber),_=h.findLastMonotonous(R=>R.original.startLineNumberR.modified.startLineNumbern.length||x>o.length||d.contains(x)||f.contains(R)||!xBi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new A1.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new A1.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!xBi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new A1.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new A1.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new Z_t.LineRangeMapping(new A1.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new A1.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(Ahc,"computeUnchangedMoves");function xBi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new phc.MyersDiffAlgorithm().compute(new TBi.LinesSliceCharSequence([t],new IBi.Range(1,1,1,t.length),!1),new TBi.LinesSliceCharSequence([e],new IBi.Range(1,1,1,e.length),!1),r),s=0,c=dhc.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,X_t.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(xBi,"areLinesSimilar");function yhc(t){if(t.length===0)return t;t.sort((0,AL.compareBy)(r=>r.original.startLineNumber,AL.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(yhc,"joinCloseConsecutiveMoves");function Ehc(t,e){let r=new WLe.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(Nne,"__esModule",{value:!0});Nne.optimizeSequenceDiffs=vhc;Nne.removeShortMatches=bhc;Nne.extendDiffsToEntireWordIfAppropriate=Shc;Nne.removeVeryShortMatchingLinesBetweenDiffs=Ihc;Nne.removeVeryShortMatchingTextBetweenLongDiffs=xhc;var _hc=Sl(),yL=hd(),EL=mye();function vhc(t,e,r){let n=r;return n=RBi(t,e,n),n=RBi(t,e,n),n=Chc(t,e,n),n}a(vhc,"optimizeSequenceDiffs");function RBi(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(RBi,"joinSequenceDiffsByShifting");function Chc(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(kBi,"shiftDiffToBetterPosition");function bhc(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 EL.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(bhc,"removeShortMatches");function Shc(t,e,r,n,o=!1){let s=EL.SequenceDiff.invert(r,t.length),c=[],l=new EL.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 EL.SequenceDiff(T,w),x=R.intersect(v);if(E+=x.seq1Range.length,_+=x.seq2Range.length,A=A.join(R),A.seq1Range.endExclusive>=v.seq1Range.endExclusive)s.shift();else break}(o&&E+_0;){let f=s.shift();f.seq1Range.isEmpty||(u(f.getStarts(),f),u(f.getEndExclusives().delta(-1),f))}return Thc(r,c)}a(Shc,"extendDiffsToEntireWordIfAppropriate");function Thc(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(Thc,"mergeSequenceDiffs");function Ihc(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(Ihc,"removeVeryShortMatchingLinesBetweenDiffs");function xhc(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 _=t.getText(y).trim();if(_.length>20||_.split(/\r\n|\r|\n/).length>1)return!1;let v=t.countLinesIn(g.seq1Range),b=g.seq1Range.length,T=e.countLinesIn(g.seq2Range),w=g.seq2Range.length,R=t.countLinesIn(A.seq1Range),x=A.seq1Range.length,P=e.countLinesIn(A.seq2Range),D=A.seq2Range.length,N=130;function L(B){return Math.min(B,N)}return a(L,"cap"),Math.pow(Math.pow(L(v*40+b),1.5)+Math.pow(L(T*40+w),1.5),1.5)+Math.pow(Math.pow(L(R*40+x),1.5)+Math.pow(L(P*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,_hc.forEachWithNeighbors)(n,(l,u,d)=>{let f=u;function h(_){return _.length>0&&_.trim().length<=3&&u.seq1Range.length+u.seq2Range.length>100}a(h,"shouldMarkAsChanged");let m=t.extendToFullLines(u.seq1Range),g=t.getText(new yL.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new yL.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=EL.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():EL.OffsetPair.zero,d?d.getStarts():EL.OffsetPair.max),E=f.intersect(y);c.length>0&&E.getStarts().equals(c[c.length-1].getEndExclusives())?c[c.length-1]=c[c.length-1].join(E):c.push(E)}),c}a(xhc,"removeVeryShortMatchingTextBetweenLongDiffs")});var NBi=I(evt=>{"use strict";p();Object.defineProperty(evt,"__esModule",{value:!0});evt.LineSequence=void 0;var sDr=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:DBi(this.lines[e-1]),n=e===this.lines.length?0:DBi(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]}};evt.LineSequence=sDr;function DBi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(ivt,"__esModule",{value:!0});ivt.DefaultLinesDiffComputer=void 0;var whc=Sl(),MBi=rd(),nvt=V2(),OBi=hd(),LBi=eh(),tvt=HT(),rvt=G2r(),One=$_t(),_L=mye(),Rhc=EBi(),khc=tDr(),Phc=wBi(),Mne=PBi(),BBi=NBi(),FBi=iDr(),aDr=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new Rhc.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new khc.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,whc.equals)(e,r,(x,P)=>x===P))return new rvt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new rvt.LinesDiff([new One.DetailedLineRangeMapping(new nvt.LineRange(1,e.length+1),new nvt.LineRange(1,r.length+1),[new One.RangeMapping(new LBi.Range(1,1,e.length,e[e.length-1].length+1),new LBi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?_L.InfiniteTimeout.instance:new _L.DateTimeout(n.maxComputationTimeMs),s=!n.ignoreTrimWhitespace,c=new Map;function l(x){let P=c.get(x);return P===void 0&&(P=c.size,c.set(x,P)),P}a(l,"getOrCreateHash");let u=e.map(x=>l(x.trim())),d=r.map(x=>l(x.trim())),f=new BBi.LineSequence(u,e),h=new BBi.LineSequence(d,r),m=f.length+h.length<1700?this.dynamicProgrammingDiffing.compute(f,h,o,(x,P)=>e[x]===r[P]?r[P].length===0?.1:1+Math.log(1+r[P].length):.99):this.myersDiffingAlgorithm.compute(f,h,o),g=m.diffs,A=m.hitTimeout;g=(0,Mne.optimizeSequenceDiffs)(f,h,g),g=(0,Mne.removeVeryShortMatchingLinesBetweenDiffs)(f,h,g);let y=[],E=a(x=>{if(s)for(let P=0;Px.seq1Range.start-_===x.seq2Range.start-v);let P=x.seq1Range.start-_;E(P),_=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(e.length-_);let b=new tvt.ArrayText(e),T=new tvt.ArrayText(r),w=(0,One.lineRangeMappingFromRangeMappings)(y,b,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,MBi.assertFn)(()=>{function x(D,N){if(D.lineNumber<1||D.lineNumber>N.length)return!1;let L=N[D.lineNumber-1];return!(D.column<1||D.column>L.length+1)}a(x,"validatePosition");function P(D,N){return!(D.startLineNumber<1||D.startLineNumber>N.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>N.length+1)}a(P,"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(!P(D.modified,r)||!P(D.original,e))return!1}return!0}),new rvt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,Phc.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new _L.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,One.lineRangeMappingFromRangeMappings)(m.mappings,new tvt.ArrayText(r),new tvt.ArrayText(n),!0);return new rvt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=Dhc(n).toRangeMapping2(e,r),d=new FBi.LinesSliceCharSequence(e,u.originalRange,s),f=new FBi.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&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.optimizeSequenceDiffs)(d,f,g),m&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findWordContaining(E)),m&&_L.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,Mne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findSubWordContaining(E),!0),m&&_L.SequenceDiff.assertSorted(g)),g=(0,Mne.removeShortMatches)(d,f,g),m&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&_L.SequenceDiff.assertSorted(g);let A=g.map(y=>new One.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&One.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};ivt.DefaultLinesDiffComputer=aDr;function Dhc(t){return new One.LineRangeMapping(new nvt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new nvt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(Dhc,"toLineRangeMapping")});var lDr=I(Uv=>{"use strict";p();Object.defineProperty(Uv,"__esModule",{value:!0});Uv.EditDataWithIndex=Uv.maxImperfectAgreementLength=Uv.maxAgreementOffset=void 0;Uv.tryRebase=Bhc;Uv.checkEditConsistency=QBi;Uv.tryRebaseStringEdits=Uhc;var Nhc=oN(),Mhc=ev(),zE=kE(),Aye=hd(),UBi=HT(),Ohc=cDr(),Lhc=!1;Uv.maxAgreementOffset=10;Uv.maxImperfectAgreementLength=5;var ovt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};Uv.EditDataWithIndex=ovt;function Bhc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:Uv.maxImperfectAgreementLength}){let f=Date.now();try{return Fhc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${Mhc.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(Bhc,"tryRebase");function Fhc(t,e,r,n,o,s,c,l,u,d){if(!QBi(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.lengthzE.AnnotatedStringEdit.create(E))),g=qBi(t,m,f,l,d);if(!g)return"rebaseFailed";let A=g.replacements.reduce((E,_)=>((E[_.data.index]||=[]).push(_),E),[]),y=[];for(let E=0;ER>0?s.substring(x[R-1].replaceRange.endExclusive,w.replaceRange.start)+w.newText:w.newText).join(""),T=zE.StringReplacement.replace(v,b);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:E})}return l==="strict"&&y.length>0&&new Nhc.SingleEdits(r).apply(t)!==zE.StringEdit.create(y.map(E=>E.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(Fhc,"_tryRebase");function QBi(t,e,r,n,o=Lhc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(QBi,"checkEditConsistency");function Uhc(t,e,r,n,o={maxImperfectAgreementLength:Uv.maxImperfectAgreementLength}){return qBi(t,e.mapData(s=>new zE.VoidEditData),r,n,o)?.toStringEdit()}a(Uhc,"tryRebaseStringEdits");function qBi(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 zE.AnnotatedStringReplacement(Aye.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,E;for(;y&&m.replaceRange.containsRange(y.replaceRange);){if(A=Hhc(t,m,y,E,A,n,o),A===-1)return;g+=y.newText.length-y.replaceRange.length,E=y,y=s.replacements[++l]}c.push(new zE.AnnotatedStringReplacement(new Aye.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(;uUv.maxAgreementOffset||b-g>0&&v.length>o.maxImperfectAgreementLength);if(b!==-1&&!T){g=b+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-_.length),x=y.newText.substring(R);x.length>0&&c.push(new zE.AnnotatedStringReplacement(Aye.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(E))return}l++,d+=f.newText.length-f.replaceRange.length}else return;else if(h.replaceRange.start",'""',"''","``"]);function jhc(t){return qhc.has(t)}a(jhc,"isAutoClosePair");function Hhc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uUv.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&jhc(l)&&Qhc(l,e.newText.substring(o))?o:-1}a(Hhc,"agreementIndexOf");function Ghc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new Ohc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new UBi.StringText(t),f=new UBi.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 zE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(Ghc,"computeDiff")});var HBi=I(svt=>{"use strict";p();Object.defineProperty(svt,"__esModule",{value:!0});svt.RejectionCollector=void 0;var $hc=h4(),jBi=ko(),Vhc=z2(),uDr=class extends jBi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new pDr(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,Vhc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new dDr(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,$hc.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,jBi.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()}};svt.RejectionCollector=uDr;var dDr=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 fDr(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}},fDr=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()}},pDr=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 mDr=I(yye=>{"use strict";p();Object.defineProperty(yye,"__esModule",{value:!0});yye.DisposablesLRUCache=yye.LRUCache=void 0;var zLe=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},avt=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 zLe("",null),this._tail=new zLe("",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 zLe(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}};yye.LRUCache=avt;var hDr=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new avt(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()}};yye.DisposablesLRUCache=hDr});var GBi=I(lvt=>{"use strict";p();Object.defineProperty(lvt,"__esModule",{value:!0});lvt.RebaseFailureInfo=void 0;var Whc=kE(),gDr=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 Whc.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 = ${cvt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${cvt(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}), ${cvt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${cvt(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(` +`)}};lvt.RebaseFailureInfo=gDr;function cvt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(cvt,"toBacktickLiteral")});var VBi=I(dvt=>{"use strict";p();Object.defineProperty(dvt,"__esModule",{value:!0});dvt.NextEditCache=void 0;var YLe=Pl(),zhc=h4(),Yhc=mDr(),$Bi=ko(),Khc=b8(),uvt=lDr(),Jhc=GBi(),ADr=class extends $Bi.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 Yhc.LRUCache(50),(0,Khc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new yDr(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,zhc.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(YLe.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,$Bi.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){let s=this._documentCaches.get(e);s&&s.setNoNextEdit(r,n,o)}_getNesRebaseConfigs(){let e=this._configService.getExperimentBasedConfig(YLe.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(YLe.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(YLe.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(YLe.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()}};dvt.NextEditCache=ADr;var yDr=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,uvt.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,edit:n,edits:o,detailedEdits:[],userEditSince:s,subsequentN:c,source:l,documentBeforeEdit:e,editWindow:r,originalEditWindow:u.originalEditWindow,cacheTime:Date.now(),isFromCursorJump:u.isFromCursorJump,cursorOffsetAtCacheTime:u.cursorOffset};s&&((0,uvt.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){let o=this._getKey(e.value),s={docId:this.docId,edit:void 0,edits:[],detailedEdits:[],source:n,documentBeforeEdit:e,editWindow:r,cacheTime:Date.now(),isFromCursorJump:!1},c=this._sharedCache.get(o);c&&this.evictedCachedEdit(c);let l=this._sharedCache.put(o,s);l&&this._nextEditCache.evictedCachedEdit(l[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.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,uvt.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 Jhc.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,uvt.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 WBi=I(fvt=>{"use strict";p();Object.defineProperty(fvt,"__esModule",{value:!0});fvt.NextEditResult=void 0;var EDr=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};fvt.NextEditResult=EDr});var zBi=I(pvt=>{"use strict";p();Object.defineProperty(pvt,"__esModule",{value:!0});pvt.SpeculativeRequestManager=void 0;var Zhc=ko(),_Dr=class extends Zhc.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 Xhc=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},KLe=uI&&uI.__param||function(t,e){return function(r,n){e(r,n,t)}},vDr;Object.defineProperty(uI,"__esModule",{value:!0});uI.NextEditFetchRequest=uI.NextEditProvider=uI.NesOutcome=void 0;var emc=require("path"),y1=Pl(),Eye=oN(),XLe=B_t(),JLe=py(),tmc=Xft(),wp=iye(),rmc=h4(),CDr=Sp(),nmc=sBi(),imc=uye(),omc=q2r(),smc=mh(),ZLe=ev(),YE=dw(),YBi=rd(),hvt=nl(),amc=KJe(),TDr=Rs(),mvt=ko(),KBi=z2(),JBi=FO(),cmc=ZS(),r3i=T0(),ZBi=MG(),Lne=kE(),lmc=q_(),bDr=hd(),XBi=HT(),umc=lDr(),dmc=HBi(),fmc=VBi(),gvt=WBi(),pmc=zBi();function hmc(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 bDr.OffsetRange(Math.min(u,c),Math.max(f,l))}a(hmc,"computeReducedWindow");function e3i(t,e){let n=new XLe.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r `)?new Lne.StringEdit(n.replacements.map(o=>new Lne.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r -`)))):n}a(KBi,"convertLineEditToEdit");function JBi(t,e){return new tmc.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:Lne.StringEdit.empty,nextEdits:[],docId:n}}}throw new SDr.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:Lne.StringEdit.empty,nextEdits:[],docId:n}})}a(JBi,"createDocStateLookupMap");var ZLe;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(ZLe||(cI.NesOutcome=ZLe={}));var bDr=_Dr=class extends hvt.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 omc.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 smc.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new amc.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,VBi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,VBi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,hvt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(y1.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 WBi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(vDr.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(KLe.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 SDr.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 L=A.rebasedEdit??A.edit;return L&&this._rejectionCollector.reject(e,L),new mvt.NextEditResult(c.requestId,A.source,void 0)}let y,E,_,v,b=e,T=!1,w=!1,R=!1,x;if(A){d.trace("using cached edit");let L=A.rebasedEdit||A.edit;L&&(y={actualEdit:L,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),E=h,u.setHeaderRequestId(v.headerRequestId),u.setIsFromCache(),u.setSubsequentEditOrder(A.rebasedEditIndex??A.subsequentN),c.recordingBookmark=v.log.recordingBookmark,x=A.baseCacheEntry??A}else{d.trace(`fetching next edit with shouldExpandEditWindow=${o}`);let L=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new XLe(r.requestUuid,c,L,!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}`),_=q.err;else if(b=q.val.docId??b,E=(b?this._workspace.getDocument(b):f).value.get(),b===f.id&&B.value!==E.value)d.trace("document changed while fetching next edit"),u.setStatus("docChanged"),c.setIsSkipped();else{let Q=q.val.rebasedEdit||q.val.edit;Q?(d.trace("fetch succeeded"),c.setResponseResults([Q]),y={actualEdit:Q,isFromCursorJump:q.val.isFromCursorJump},R=q.val.isFromSpeculativeRequest??!1,x=q.val.baseCacheEntry??q.val):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(_ instanceof wp.NoNextEditReason.FetchFailure||_ instanceof wp.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${_.error}`),_.error;if(_ instanceof wp.NoNextEditReason.NoSuggestions)if(_.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new mvt.NextEditResult(c.requestId,v,{jumpToPosition:_.nextCursorPosition,targetDocumentId:_.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else _ instanceof wp.NoNextEditReason.GotCancelled&&c.setIsSkipped();let P=new mvt.NextEditResult(c.requestId,v,void 0);if(!y)return d.trace("had no edit"),P;if(l.isCancellationRequested)return d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),P;if(this._rejectionCollector.isRejected(b,y.actualEdit)||E&&this._nextEditCache.isRejectedNextEdit(b,E,y.actualEdit))return d.trace("edit was previously rejected"),u.setStatus("previouslyRejected"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected(),P;c.setResult(JLe.RootedLineEdit.fromEdit(new yye.RootedEdit(h,new Lne.StringEdit([y.actualEdit])))),(0,$Bi.assert)(E!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new mvt.NextEditResult(c.requestId,v,{edit:y.actualEdit,isFromCursorJump:y.isFromCursorJump,documentBeforeEdits:E,targetDocumentId:b,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,pvt.timeout)(N),l.isCancellationRequested)?(d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),P):(d.trace("returning next edit result"),D)}determineNesConfigs(e,r){let n={isAsyncCompletions:this._configService.getExperimentBasedConfig(y1.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=JLe.RootedLineEdit.fromEdit(new yye.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new wp.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 YE.Result.error(new wp.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"),E=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value,_=!this._pendingStatelessNextEditRequest||y(this._pendingStatelessNextEditRequest),v=(E||n.isAsyncCompletions)&&_&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0,b=this._specManager.pending,T=b?.docId===u&&b?.postEditContent===h.value&&!b.request.cancellationTokenSource.token.isCancellationRequested&&y(b.request),w=T?b?.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:E,L=w?"speculative":"async";if(N){let B=await this._joinNextEditRequest(R,L,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,L,c,g,l),q=await R.firstEdit.p;if(q.isOk()&&q.val.edit){let j=this._nextEditCache.tryRebaseCacheEntry(q.val,h,m);if(j.edit)return c.setStatelessNextEditTelemetry(B.telemetry),YE.Result.ok(j.edit);this._logRebaseFailure(j.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(B.telemetry),YE.Result.error(new wp.NoNextEditReason.GotCancelled("afterFailedRebase"));let O=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0;if(O){d.trace("reusing 2nd existing next edit request after rebase failed");let j=await this._joinNextEditRequest(O,"async",c,g,l);return c.setStatelessNextEditTelemetry(j.telemetry),j.nextEdit.isError()?j.nextEdit:O.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),P=x.nextEditRequest,D=x.nextEditResult;return c.setStatelessNextEditTelemetry(D.telemetry),D.nextEdit.isError()?D.nextEdit:P.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)}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 B=this._debugRecorder.createBookmark();h.recordingBookmark=B,l.setRequestBookmark(B)}let m=lmc(n.getDocumentAndIdx(d)),g=r.selection.get()[0],A=this._debugRecorder?.getRecentLog(),y=n.documents.map(B=>this._processDoc(B)),E=this._xtabHistoryTracker.getHistory(),_=new pvt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,b=new wp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(B=>B.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,b.documentBeforeEdits.value,"superseded"),this._pendingStatelessNextEditRequest=b;let w=a(()=>{this._pendingStatelessNextEditRequest===b&&(this._pendingStatelessNextEditRequest=null)},"removeFromPending");l.setRequest(b),l.setStatus("requested"),h.setRequestInput(b);let R=this._hookupCancellation(b,u,o.isAsyncCompletions?(0,Khc.autorunWithChanges)(this,{value:r.value},B=>{B.value.changes.forEach(q=>{b.intermediateUserEdit&&!q.isEmpty()&&(b.intermediateUserEdit=b.intermediateUserEdit.compose(q),(0,imc.checkEditConsistency)(b.documentBeforeEdits.value,b.intermediateUserEdit,B.value.value.value,f)||(b.intermediateUserEdit=void 0))})}):void 0),x=JBi(y,E),P=this._statelessNextEditProvider.provideNextEdit(b,f,h,b.cancellationTokenSource.token),D=-1,N=a((B,q)=>{++D;let M=f.createSubLogger("processEdit");M.trace(`processing edit #${D} (starts at 0)`),M.trace("resetting shouldExpandEditWindow to false due to receiving an edit"),this._shouldExpandEditWindow=!1;let O=x.get(B.targetDocument??d),j=B.edit,Q=new zBi.LineEdit([j]),Y=KBi(Q,O.baseDocState).tryRebase(O.editsSoFar);if(Y===void 0){M.trace(`edit ${D} is undefined after rebasing`),_.isSettled||_.complete(YE.Result.error(new wp.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}O.editsSoFar=O.editsSoFar.compose(Y);let W;if(Y.replacements.length===0)M.trace(`WARNING: ${D} has no edits`);else if(Y.replacements.length>1)M.trace(`WARNING: ${D} has ${Y.replacements.length} edits, but expected only 1`);else{let V=Y.replacements[0];O.nextEdits.push(V),W=this._nextEditCache.setKthNextEdit(O.docId,O.docContents,D===0?B.window:void 0,V,D,D===0?O.nextEdits:void 0,D===0?b.intermediateUserEdit:void 0,e,{isFromCursorJump:B.isFromCursorJump,originalEditWindow:B.originalWindow,cursorOffset:O.docId===d?g?.start:void 0}),M.trace(`populated cache for ${D}`)}return _.isSettled||(M.trace("resolving firstEdit promise"),h.setResult(new JLe.RootedLineEdit(O.docContents,Q)),_.complete(W?YE.Result.ok(W):YE.Result.error(new wp.NoNextEditReason.Unexpected(new Error("No cached edit"))))),O.docContents=Y.applyOnText(O.docContents),W},"processEdit"),L=a((B,q)=>{let M=f.createSubLogger("streamEnd");if(D===-1&&B instanceof wp.NoNextEditReason.NoSuggestions&&(M.trace("resetting shouldExpandEditWindow to false due to NoSuggestions"),this._shouldExpandEditWindow=!1),x.get(d).nextEdits.length)M.trace(`${x.get(d).nextEdits.length} edits returned`);else if(M.trace(`no edit, reason: ${B.kind}`),B instanceof wp.NoNextEditReason.NoSuggestions){let{documentBeforeEdits:Y,window:W}=B,V=W?cmc(W,g,Y):void 0;this._nextEditCache.setNoNextEdit(d,Y,V,e)}_.isSettled||_.complete(YE.Result.error(B));let j=x.get(d).nextEdits.length>0?YE.Result.ok(void 0):YE.Result.error(B),Q=new wp.StatelessNextEditResult(j,q);b.setResult(Q),R.dispose(),w();let U=this._specManager.consumeScheduled(b.headerRequestId);return U&&this._triggerSpeculativeRequest(U.suggestion),Q},"handleStreamEnd");try{let B=await P.next();if(B.done){let q=B.value.v;T=L(q,B.value.telemetryBuilder)}else{let q=B.value.v,M=B.value.telemetryBuilder;N(q,M),(async()=>{try{for(B=await P.next();!B.done;){let j=B.value.v;N(j,B.value.telemetryBuilder),this._specManager.consumeScheduled(b.headerRequestId),B=await P.next()}let O=B.value.v;L(O,B.value.telemetryBuilder)}catch(O){f.trace(`Error while streaming further edits: ${KLe.ErrorUtils.toString(O)}`);let j=new wp.NoNextEditReason.Unexpected(KLe.ErrorUtils.fromUnknown(O));L(j,M)}})(),T=new wp.StatelessNextEditResult(YE.Result.ok(void 0),M)}}catch(B){throw b.setResultError(B),B}return{nextEditRequest:b,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new hvt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new pvt.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,hvt.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(y1.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(y1.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(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===YLe.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 Yhc.InlineEditRequestLogContext(n.uri,0,void 0),s=new WBi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(vDr.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 CDr.OffsetRange(d,d),h=[f],m=new yye.RootedEdit(r.documentBeforeEdits,new Lne.StringEdit([r.edit])),g=new YBi.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(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===YLe.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=_Dr.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 E=this._specManager.pending;if(E?.docId===n&&E?.postEditContent===l){c.trace("already have speculative request for post-edit state");return}let _=this._workspace.getDocument(n);if(!_){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 b=new XLe(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,ZBi.generateUuid)()}`);c.trace(`triggering speculative request for post-edit state (opportunityId=${b.opportunityId}, headerRequestId=${b.headerRequestId})`);try{let T=await this._createSpeculativeRequest(b,_,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),P=u.newText;this._specManager.setPending({request:T,docId:n,postEditContent:l,trajectoryPrefix:R,trajectorySuffix:x,trajectoryNewText:P})}}catch(T){c.trace(`speculative request failed: ${KLe.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 E=new YBi.StringText(s),_=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let L=this._workspace.getWorkspaceRoot(h),B=new Lne.StringEdit([l]),q=JLe.RootedLineEdit.fromEdit(new yye.RootedEdit(r.value.get(),B)).removeCommonSuffixPrefixLines().edit,M=new wp.StatelessNextEditDocument(h,L,N.languageId,r.value.get().getLines(),q,r.value.get(),yye.Edits.single(B),n);return{recentEdit:new yye.RootedEdit(r.value.get(),B),nextEditDoc:M,documentAfterEdits:E}}}),v=this._xtabHistoryTracker.getHistory(),b={kind:"edit",docId:h,edit:c};v.push(b);let T=new pvt.DeferredPromise,w=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case YLe.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case YLe.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case YLe.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,$Bi.assertNever)(w)}let x=new wp.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 P=`NES | spec | ${(0,zhc.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new Jhc.CapturingToken(P,void 0);return this._requestLogger.captureInvocation(D,async()=>{this._addLiveLogContextEntry(g,P);try{await this._runSpeculativeProviderCall(x,_,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=JBi(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(YE.Result.error(g.value.v)),e.setResult(new wp.StatelessNextEditResult(YE.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=d.get(A.targetDocument??n),E=A.edit,_=new zBi.LineEdit([E]),b=KBi(_,y.baseDocState).tryRebase(y.editsSoFar);if(b===void 0){l.trace(`speculative edit ${m} rebasing failed`),g=await h.next();continue}if(y.editsSoFar=y.editsSoFar.compose(b),b.replacements.length===1){let T=b.replacements[0];y.nextEdits.push(T);let w=this._nextEditCache.setKthNextEdit(y.docId,y.docContents,m===0?A.window:void 0,T,m,m===0?y.nextEdits:void 0,void 0,o,{isFromCursorJump:A.isFromCursorJump,originalEditWindow:A.originalWindow,cursorOffset:y.docId===n?s:void 0});!e.firstEdit.isSettled&&w&&(e.firstEdit.complete(YE.Result.ok(w)),e.setResult(new wp.StatelessNextEditResult(YE.Result.ok(void 0),g.value.telemetryBuilder)),f.setResponseResults([T])),l.trace(`cached speculative edit ${m}`)}y.docContents=b.applyOnText(y.docContents),g=await h.next()}})().finally(()=>{e.firstEdit.isSettled||(e.firstEdit.complete(YE.Result.error(new wp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new wp.StatelessNextEditResult(YE.Result.error(new wp.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: ${KLe.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=ZLe.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=ZLe.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")}};cI.NextEditProvider=bDr;cI.NextEditProvider=bDr=_Dr=Whc([zLe(5,y1.IConfigurationService),zLe(6,Xhc.ISnippyService),zLe(7,vDr.ILogService),zLe(8,emc.IExperimentationService),zLe(9,Zhc.IRequestLogger)],bDr);function lmc(t){if(!t)throw new SDr.BugIndicatingError("expected value to be defined, but it was not");return t}a(lmc,"assertDefined");var XLe=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,ZBi.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};cI.NextEditFetchRequest=XLe});var e3i=I(eBe=>{"use strict";p();Object.defineProperty(eBe,"__esModule",{value:!0});eBe.parseGitRemotes=umc;eBe.toGitUri=dmc;eBe.getUpstreamRemote=fmc;var TDr=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 umc(t){let e=[];for(let r of TDr.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(umc,"parseGitRemotes");function dmc(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(dmc,"toGitUri");function fmc(t){let e=t.state.HEAD?.upstream?.remote;if(e)return t.state.remotes.find(r=>r.name===e)}a(fmc,"getUpstreamRemote")});var l3i=I(_h=>{"use strict";p();Object.defineProperty(_h,"__esModule",{value:!0});_h.GLOB_SPLIT=_h.GLOBSTAR=void 0;_h.getEmptyExpression=Amc;_h.splitGlobAware=wDr;_h.isEmptyPattern=Tmc;_h.match=kmc;_h.parse=s3i;_h.isRelativePattern=a3i;_h.getBasenameTerms=Pmc;_h.getPathTerms=Dmc;_h.patternsEquals=Omc;var pmc=Sl(),xDr=nl(),hmc=tHt(),mmc=zP(),$$=NA(),gmc=Rq(),tBe=em();function Amc(){return Object.create(null)}a(Amc,"getEmptyExpression");_h.GLOBSTAR="**";_h.GLOB_SPLIT="/";var gvt="[/\\\\]",Avt="[^/\\\\]",ymc=/\//g;function t3i(t,e){switch(t){case 0:return"";case 1:return`${Avt}*?`;default:return`(?:${gvt}|${Avt}+${gvt}${e?`|${gvt}${Avt}+`:""})*?`}}a(t3i,"starsToRegExp");function wDr(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(wDr,"splitGlobAware");function o3i(t){if(!t)return"";let e="",r=wDr(t,_h.GLOB_SPLIT);if(r.every(n=>n===_h.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===_h.GLOBSTAR){if(n)return;e+=t3i(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===_h.GLOB_SPLIT?h="":h=(0,tBe.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${wDr(l,",").map(g=>o3i(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=Avt;continue;case"*":e+=t3i(1);continue;default:e+=(0,tBe.escapeRegExpCharacters)(f)}}su===d,endsWith:n?tBe.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,hmc.isEqualOrParent)(u,d,e.ignoreCase??!gmc.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=r3i.get(s);if(c)return n3i(c,t,o);let l;return Emc.test(r)?c=Imc(r.substring(4),r,o):(l=_mc.exec(IDr(r,o)))?c=xmc(l[1],r,o):(e.trimForExclusions?Cmc:vmc).test(r)?c=wmc(r,o):(l=bmc.exec(IDr(r,o)))?c=i3i(l[1].substring(1),r,!0,o):(l=Smc.exec(IDr(r,o)))?c=i3i(l[1],r,!1,o):c=Rmc(r,o),r3i.set(s,c),n3i(c,t,o)}a(kDr,"parsePattern");function n3i(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,tBe.ltrim)(o.substring(e.base.length),$$.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(n3i,"wrapRelativePattern");function IDr(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(IDr,"trimForExclusions");function Imc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(Imc,"trivia1");function xmc(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(xmc,"trivia2");function wmc(t,e){let r=c3i(t.slice(1,-1).split(",").map(l=>kDr(l,e)).filter(l=>l!==aN),t),n=r.length;if(!n)return aN;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(wmc,"trivia3");function i3i(t,e,r,n){let o=$$.sep===$$.posix.sep,s=o?t:t.replace(ymc,$$.sep),c=$$.sep+s,l=$$.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(i3i,"trivia4and5");function Rmc(t,e){try{let r=new RegExp(`^${o3i(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return aN}}a(Rmc,"toRegExp");function kmc(t,e,r){return!t||typeof e!="string"?!1:s3i(t,r)(e)}a(kmc,"match");function s3i(t,e={}){if(!t)return RDr;if(typeof t=="string"||a3i(t)){let r=kDr(t,e);if(r===aN)return RDr;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 Nmc(t,e)}a(s3i,"parse");function a3i(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(a3i,"isRelativePattern");function Pmc(t){return t.allBasenames||[]}a(Pmc,"getBasenameTerms");function Dmc(t){return t.allPaths||[]}a(Dmc,"getPathTerms");function Nmc(t,e){let r=c3i(Object.getOwnPropertyNames(t).map(l=>Mmc(l,t[l],e)).filter(l=>l!==aN)),n=r.length;if(!n)return aN;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(Nmc,"parsedExpression");function Mmc(t,e,r){if(e===!1)return aN;let n=kDr(t,r);if(n===aN)return aN;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,xDr.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Mmc,"parseExpressionPattern");function c3i(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(c3i,"aggregateBasenameMatches");function Omc(t,e){return(0,pmc.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(Omc,"patternsEquals")});var Evt=I(Ol=>{"use strict";p();var Lmc=Ol&&Ol.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bmc=Ol&&Ol.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Fmc=Ol&&Ol.__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,u3i.isEqual)(r.uri,t)||r.uri.path===t.path||DDr(t,r))}a(PDr,"findNotebook");function DDr(t,e){if(t.scheme===rBe.Schemas.vscodeNotebookCell||t.scheme===rBe.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,u3i.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(DDr,"findCell");function Umc(t,e){if(t.scheme!==rBe.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=d3i(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(Umc,"getNotebookCellOutput");function d3i(t,e){let r=PDr(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=DDr(t,r);return n===void 0?[r,void 0]:[r,n]}a(d3i,"getNotebookAndCellFromUri");function Qmc(t){return t.scheme===rBe.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(Qmc,"isNotebookCellOrNotebookChatInput");function qmc(t){return t.scheme===rBe.Schemas.vscodeNotebookCell}a(qmc,"isNotebookCell");function jmc(t){return t.path.endsWith(".ipynb")}a(jmc,"isJupyterNotebookUri");function Hmc(t){return t.notebookType==="jupyter-notebook"}a(Hmc,"isJupyterNotebook");function Gmc(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(Gmc,"serializeNotebookDocument");function $mc(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($mc,"extractNotebookOutline");function f3i(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||h3i(e.include))}a(f3i,"isDocumentExcludePattern");function p3i(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(p3i,"isFilenamePattern");function h3i(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(h3i,"isRelativePattern");function Vmc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(Vmc,"isNotebookEditorContribution");function Wmc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(Wmc,"extractEditorAssociation");function m3i(t,e){if(typeof e=="string"&&Eye.match(e.toLowerCase(),(0,_ye.basename)(t.fsPath).toLowerCase()))return!0;if(f3i(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(Eye.match(r,(0,_ye.basename)(t.fsPath).toLowerCase()))return!(n&&Eye.match(n,(0,_ye.basename)(t.fsPath).toLowerCase()))}return p3i(e)&&Eye.match(e.filenamePattern,(0,_ye.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&Eye.match(e.excludeFileNamePattern,(0,_ye.basename)(t.fsPath).toLowerCase())):!1}a(m3i,"notebookSelectorMatches");function g3i(t,e){let r=[];for(let n of e)n.filenamePattern&&Eye.match(n.filenamePattern.toLowerCase(),(0,_ye.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(g3i,"getNotebookEditorAssociations");function zmc(t,e,r,n){if(PDr(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>m3i(t,l)));if(o.length===0)return!1;let s=g3i(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??yvt.default)===yvt.default)}a(zmc,"_hasSupportedNotebooks")});var C3i=I(M0=>{"use strict";p();var Ymc=M0&&M0.__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},Kmc=M0&&M0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M0,"__esModule",{value:!0});M0.TelemetrySender=M0.NextEditProviderTelemetryBuilder=M0.DiagnosticsTelemetryBuilder=M0.LlmNESTelemetryBuilder=M0.NES_GH_TELEMETRY_EVENT_NAME=void 0;var A3i=jR(),y3i=e3i(),Jmc=h4(),v3i=gm(),Zmc=Evt(),Xmc=nl(),_vt=Ro(),e0c=tJ(),E3i=C8(),_3i=P0();M0.NES_GH_TELEMETRY_EVENT_NAME="copilot-nes/provideInlineEdit";var vvt=class extends _vt.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,E)=>y+E.recentEdits.edits.length,0),o=g.recentEdits.edits.length,s=g.languageId,c=g.documentAfterEditsLines.length,l=g.id.toUri().scheme===e0c.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,Zmc.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(_3i.Uri.parse(g.id.uri));if(y){let v=(0,y3i.getUpstreamRemote)(y);v?.fetchUrl&&(d=v.pushUrl||v.fetchUrl)}let E=new Set,_=[...new Set(this._request.documents.map(v=>A.getRepository(_3i.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of _){let b=v?(0,y3i.getUpstreamRemote)(v):void 0;b?.fetchUrl&&E.add(b.fetchUrl),b?.pushUrl&&E.add(b.pushUrl)}f=[...E]}}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(),E=JSON.stringify(y)?.length||0;A={entries:E>200*1024?void 0:y,entriesSize:E,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(E=>({time:y.time.toISOString(),start:E.replaceRange.start,endExclusive:E.replaceRange.endExclusive,newText:E.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,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,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,Jmc.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}setReusedRequest(e){return this._reusedRequest=e,this}setSubsequentEditOrder(e){return this._subsequentEditOrder=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}};M0.LlmNESTelemetryBuilder=vvt;var Cvt=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}};M0.DiagnosticsTelemetryBuilder=Cvt;var NDr=class t extends _vt.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,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 vvt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new Cvt}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}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}};M0.NextEditProviderTelemetryBuilder=NDr;var MDr=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new _vt.DisposableStore,this._disposalTracker=new _vt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new Xmc.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,E3i.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,E3i.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()}},ODr=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 MDr(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,activeDocumentLanguageId:g,activeDocumentOriginalLineCount:A,nLinesOfCurrentFileInPrompt:y,wasPreviouslyRejected:E,isShown:_,isNotebook:v,notebookType:b,isNESForAnotherDoc:T,isActiveDocument:w,isEolDifferent:R,isMultilineEdit:x,isNextEditorRangeVisible:P,isNextEditorVisible:D,acceptance:N,disposalReason:L,logProbThreshold:B,documentsCount:q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:j,promptCharCount:Q,hadLowLogProbSuggestion:U,nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:V,isInlineSuggestion:z,debounceTime:ie,artificialDelay:H,hasNextEdit:re,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,notebookId:ge,notebookCellLines:Ue,nextEditLogprob:ke,supersededByOpportunityId:X,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchStartedAfterMs:he,response:Z,configIsDiagnosticsNESEnabled:ue,isNaturalLanguageDominated:qe,diagnosticType:ne,diagnosticDroppedReasons:ce,diagnosticHasExistingSameFileImport:Ne,diagnosticIsLocalImport:we,diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:rt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:_t,hadDiagnosticsNES:Dt,hadLlmNES:$t,pickedNES:Gt,xtabAggressivenessLevel:Ie,xtabUserHappinessScore:F,userAggressivenessSetting:be,modelConfig:Qe}=e,pe,Se,Fe,te;if(Z!==void 0){let{response:Te,ttft:Ge,fetchResult:J,fetchTime:se}=await Z;Te.type===A3i.ChatFetchResponseType.Success&&(pe=Te.usage),Se=Ge,Fe=J,te=se}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:g,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:N,disposalReason:L,supersededByOpportunityId:X,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchResult:Fe,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:ne,diagnosticDroppedReasons:ce,pickedNES:Gt,notebookType:b,notebookId:ge,notebookCellLines:Ue,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:Ie,userAggressivenessSetting:be,modelConfig:Qe,neighborSnippetIndicesInPrompt:e.neighborSnippetIndicesInPrompt},{requestN:o,hadStatelessNextEditProviderCall:this._boolToNum(l),statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:this._boolToNum(f),subsequentEditOrder:m,activeDocumentOriginalLineCount:A,activeDocumentNLinesInPrompt:y,wasPreviouslyRejected:this._boolToNum(E),isShown:this._boolToNum(_),isNotebook:this._boolToNum(v),isNESForAnotherDoc:this._boolToNum(T),isActiveDocument:this._boolToNum(w),isEolDifferent:this._boolToNum(R),isMultilineEdit:this._boolToNum(x),isNextEditorRangeVisible:this._boolToNum(P),isNextEditorVisible:this._boolToNum(D),hasNotebookCellMarker:le>0?1:0,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,logProbThreshold:B,documentsCount:q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:j,promptCharCount:Q,hadLowLogProbSuggestion:this._boolToNum(U),nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:this._boolToNum(V),isInlineSuggestion:this._boolToNum(z),debounceTime:ie,artificialDelay:H,fetchStartedAfterMs:he,ttft:Se,fetchTime:te,promptTokens:pe?.prompt_tokens,responseTokens:pe?.completion_tokens,cachedTokens:pe?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:pe?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:pe?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(re),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:ke,hadDiagnosticsNES:this._boolToNum(Dt),hadLlmNES:this._boolToNum($t),configIsDiagnosticsNESEnabled:this._boolToNum(ue),isNaturalLanguageDominated:this._boolToNum(qe),diagnosticHasExistingSameFileImport:this._boolToNum(Ne),diagnosticIsLocalImport:this._boolToNum(we),diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:rt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:this._boolToNum(_t),nextCursorLineDistance:e.nextCursorPrediction?.nextCursorLineDistance,xtabUserHappinessScore:F,nDiffsInPrompt:e.nDiffsInPrompt,diffTokensInPrompt:e.diffTokensInPrompt,nNeighborSnippetsComputed:e.nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:e.nNeighborSnippetsInPrompt})}_sendTelemetryToBoth(e,r){this._telemetryService.sendMSFTTelemetryEvent("provideInlineEdit",e,r),this._telemetryService.sendGHTelemetryEvent(M0.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:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:T,modelConfig:w,isFromCache:R}=e,x=f===void 0?f:await f,P=await T?.catch(()=>{}),D=x?.fetchResult;this._telemetryService.sendEnhancedGHTelemetryEvent(M0.NES_GH_TELEMETRY_EVENT_NAME,(0,v3i.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==A3i.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:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:P,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)}};M0.TelemetrySender=ODr;M0.TelemetrySender=ODr=Ymc([Kmc(1,v3i.ITelemetryService)],ODr)});var BDr=I(vye=>{"use strict";p();Object.defineProperty(vye,"__esModule",{value:!0});vye.NullPowerService=vye.IPowerService=void 0;var b3i=Ic(),t0c=Gs();vye.IPowerService=(0,t0c.createDecorator)("IPowerService");var LDr=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=b3i.Event.None,this.onDidResume=b3i.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};vye.NullPowerService=LDr});var K6=I(V$=>{"use strict";p();Object.defineProperty(V$,"__esModule",{value:!0});V$.FetchStreamRecorder=V$.FetchStreamSource=V$.IChatMLFetcher=void 0;var r0c=nn(),n0c=nl();V$.IChatMLFetcher=(0,r0c.createServiceIdentifier)("IChatMLFetcher");var FDr=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new n0c.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)}};V$.FetchStreamSource=FDr;var UDr=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}}};V$.FetchStreamRecorder=UDr});var QDr=I(bvt=>{"use strict";p();Object.defineProperty(bvt,"__esModule",{value:!0});bvt.IChatQuotaService=void 0;var i0c=nn();bvt.IChatQuotaService=(0,i0c.createServiceIdentifier)("IChatQuotaService")});var qDr=I(Svt=>{"use strict";p();Object.defineProperty(Svt,"__esModule",{value:!0});Svt.IConversationOptions=void 0;var o0c=nn();Svt.IConversationOptions=(0,o0c.createServiceIdentifier)("ConversationOptions")});var nBe=I(Cye=>{"use strict";p();Object.defineProperty(Cye,"__esModule",{value:!0});Cye.getTextPart=a0c;Cye.toTextPart=S3i;Cye.toTextParts=c0c;Cye.roleToString=l0c;var Bne=Io(),s0c=rd();function a0c(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Bne.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Bne.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a(a0c,"getTextPart");function S3i(t){return{type:Bne.Raw.ChatCompletionContentPartKind.Text,text:t}}a(S3i,"toTextPart");function c0c(t){return[S3i(t)]}a(c0c,"toTextParts");function l0c(t){switch(t){case Bne.Raw.ChatRole.System:return"system";case Bne.Raw.ChatRole.User:return"user";case Bne.Raw.ChatRole.Assistant:return"assistant";case Bne.Raw.ChatRole.Tool:return"tool";default:(0,s0c.assertNever)(t,`unknown role (${t})`)}}a(l0c,"roleToString")});var HDr=I(bye=>{"use strict";p();Object.defineProperty(bye,"__esModule",{value:!0});bye.InteractionService=bye.IInteractionService=void 0;var u0c=nn(),T3i=T0();bye.IInteractionService=(0,u0c.createServiceIdentifier)("IInteractionService");var jDr=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,T3i.generateUuid)()}startInteraction(){this._interactionId=(0,T3i.generateUuid)()}get interactionId(){return this._interactionId}};bye.InteractionService=jDr});var $Dr=I(Tvt=>{"use strict";p();Object.defineProperty(Tvt,"__esModule",{value:!0});Tvt.SSEParser=void 0;var GDr=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{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:Lne.StringEdit.empty,nextEdits:[],docId:n}}}throw new TDr.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:Lne.StringEdit.empty,nextEdits:[],docId:n}})}a(t3i,"createDocStateLookupMap");var eBe;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(eBe||(uI.NesOutcome=eBe={}));var SDr=vDr=class extends mvt.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 dmc.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 fmc.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new pmc.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,KBi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,KBi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,mvt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(y1.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 JBi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(CDr.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(ZLe.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 TDr.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 L=A.rebasedEdit??A.edit;return L&&this._rejectionCollector.reject(e,L),new gvt.NextEditResult(c.requestId,A.source,void 0)}let y,E,_,v,b=e,T=!1,w=!1,R=!1,x;if(A){d.trace("using cached edit");let L=A.rebasedEdit||A.edit;L&&(y={actualEdit:L,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),E=h,u.setHeaderRequestId(v.headerRequestId),u.setIsFromCache(),u.setSubsequentEditOrder(A.rebasedEditIndex??A.subsequentN),c.recordingBookmark=v.log.recordingBookmark,x=A.baseCacheEntry??A}else{d.trace(`fetching next edit with shouldExpandEditWindow=${o}`);let L=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new tBe(r.requestUuid,c,L,!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}`),_=q.err;else if(b=q.val.docId??b,E=(b?this._workspace.getDocument(b):f).value.get(),b===f.id&&B.value!==E.value)d.trace("document changed while fetching next edit"),u.setStatus("docChanged"),c.setIsSkipped();else{let Q=q.val.rebasedEdit||q.val.edit;Q?(d.trace("fetch succeeded"),c.setResponseResults([Q]),y={actualEdit:Q,isFromCursorJump:q.val.isFromCursorJump},R=q.val.isFromSpeculativeRequest??!1,x=q.val.baseCacheEntry??q.val):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(_ instanceof wp.NoNextEditReason.FetchFailure||_ instanceof wp.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${_.error}`),_.error;if(_ instanceof wp.NoNextEditReason.NoSuggestions)if(_.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new gvt.NextEditResult(c.requestId,v,{jumpToPosition:_.nextCursorPosition,targetDocumentId:_.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else _ instanceof wp.NoNextEditReason.GotCancelled&&c.setIsSkipped();let P=new gvt.NextEditResult(c.requestId,v,void 0);if(!y)return d.trace("had no edit"),P;if(l.isCancellationRequested)return d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),P;if(this._rejectionCollector.isRejected(b,y.actualEdit)||E&&this._nextEditCache.isRejectedNextEdit(b,E,y.actualEdit))return d.trace("edit was previously rejected"),u.setStatus("previouslyRejected"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected(),P;c.setResult(XLe.RootedLineEdit.fromEdit(new Eye.RootedEdit(h,new Lne.StringEdit([y.actualEdit])))),(0,YBi.assert)(E!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new gvt.NextEditResult(c.requestId,v,{edit:y.actualEdit,isFromCursorJump:y.isFromCursorJump,documentBeforeEdits:E,targetDocumentId:b,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,hvt.timeout)(N),l.isCancellationRequested)?(d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),P):(d.trace("returning next edit result"),D)}determineNesConfigs(e,r){let n={isAsyncCompletions:this._configService.getExperimentBasedConfig(y1.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=XLe.RootedLineEdit.fromEdit(new Eye.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new wp.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 YE.Result.error(new wp.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"),E=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value,_=!this._pendingStatelessNextEditRequest||y(this._pendingStatelessNextEditRequest),v=(E||n.isAsyncCompletions)&&_&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0,b=this._specManager.pending,T=b?.docId===u&&b?.postEditContent===h.value&&!b.request.cancellationTokenSource.token.isCancellationRequested&&y(b.request),w=T?b?.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:E,L=w?"speculative":"async";if(N){let B=await this._joinNextEditRequest(R,L,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,L,c,g,l),q=await R.firstEdit.p;if(q.isOk()&&q.val.edit){let j=this._nextEditCache.tryRebaseCacheEntry(q.val,h,m);if(j.edit)return c.setStatelessNextEditTelemetry(B.telemetry),YE.Result.ok(j.edit);this._logRebaseFailure(j.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(B.telemetry),YE.Result.error(new wp.NoNextEditReason.GotCancelled("afterFailedRebase"));let O=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0;if(O){d.trace("reusing 2nd existing next edit request after rebase failed");let j=await this._joinNextEditRequest(O,"async",c,g,l);return c.setStatelessNextEditTelemetry(j.telemetry),j.nextEdit.isError()?j.nextEdit:O.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),P=x.nextEditRequest,D=x.nextEditResult;return c.setStatelessNextEditTelemetry(D.telemetry),D.nextEdit.isError()?D.nextEdit:P.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)}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 B=this._debugRecorder.createBookmark();h.recordingBookmark=B,l.setRequestBookmark(B)}let m=mmc(n.getDocumentAndIdx(d)),g=r.selection.get()[0],A=this._debugRecorder?.getRecentLog(),y=n.documents.map(B=>this._processDoc(B)),E=this._xtabHistoryTracker.getHistory(),_=new hvt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,b=new wp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(B=>B.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,b.documentBeforeEdits.value,"superseded"),this._pendingStatelessNextEditRequest=b;let w=a(()=>{this._pendingStatelessNextEditRequest===b&&(this._pendingStatelessNextEditRequest=null)},"removeFromPending");l.setRequest(b),l.setStatus("requested"),h.setRequestInput(b);let R=this._hookupCancellation(b,u,o.isAsyncCompletions?(0,rmc.autorunWithChanges)(this,{value:r.value},B=>{B.value.changes.forEach(q=>{b.intermediateUserEdit&&!q.isEmpty()&&(b.intermediateUserEdit=b.intermediateUserEdit.compose(q),(0,umc.checkEditConsistency)(b.documentBeforeEdits.value,b.intermediateUserEdit,B.value.value.value,f)||(b.intermediateUserEdit=void 0))})}):void 0),x=t3i(y,E),P=this._statelessNextEditProvider.provideNextEdit(b,f,h,b.cancellationTokenSource.token),D=-1,N=a((B,q)=>{++D;let M=f.createSubLogger("processEdit");M.trace(`processing edit #${D} (starts at 0)`),M.trace("resetting shouldExpandEditWindow to false due to receiving an edit"),this._shouldExpandEditWindow=!1;let O=x.get(B.targetDocument??d),j=B.edit,Q=new ZBi.LineEdit([j]),Y=e3i(Q,O.baseDocState).tryRebase(O.editsSoFar);if(Y===void 0){M.trace(`edit ${D} is undefined after rebasing`),_.isSettled||_.complete(YE.Result.error(new wp.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}O.editsSoFar=O.editsSoFar.compose(Y);let W;if(Y.replacements.length===0)M.trace(`WARNING: ${D} has no edits`);else if(Y.replacements.length>1)M.trace(`WARNING: ${D} has ${Y.replacements.length} edits, but expected only 1`);else{let V=Y.replacements[0];O.nextEdits.push(V),W=this._nextEditCache.setKthNextEdit(O.docId,O.docContents,D===0?B.window:void 0,V,D,D===0?O.nextEdits:void 0,D===0?b.intermediateUserEdit:void 0,e,{isFromCursorJump:B.isFromCursorJump,originalEditWindow:B.originalWindow,cursorOffset:O.docId===d?g?.start:void 0}),M.trace(`populated cache for ${D}`)}return _.isSettled||(M.trace("resolving firstEdit promise"),h.setResult(new XLe.RootedLineEdit(O.docContents,Q)),_.complete(W?YE.Result.ok(W):YE.Result.error(new wp.NoNextEditReason.Unexpected(new Error("No cached edit"))))),O.docContents=Y.applyOnText(O.docContents),W},"processEdit"),L=a((B,q)=>{let M=f.createSubLogger("streamEnd");if(D===-1&&B instanceof wp.NoNextEditReason.NoSuggestions&&(M.trace("resetting shouldExpandEditWindow to false due to NoSuggestions"),this._shouldExpandEditWindow=!1),x.get(d).nextEdits.length)M.trace(`${x.get(d).nextEdits.length} edits returned`);else if(M.trace(`no edit, reason: ${B.kind}`),B instanceof wp.NoNextEditReason.NoSuggestions){let{documentBeforeEdits:Y,window:W}=B,V=W?hmc(W,g,Y):void 0;this._nextEditCache.setNoNextEdit(d,Y,V,e)}_.isSettled||_.complete(YE.Result.error(B));let j=x.get(d).nextEdits.length>0?YE.Result.ok(void 0):YE.Result.error(B),Q=new wp.StatelessNextEditResult(j,q);b.setResult(Q),R.dispose(),w();let U=this._specManager.consumeScheduled(b.headerRequestId);return U&&this._triggerSpeculativeRequest(U.suggestion),Q},"handleStreamEnd");try{let B=await P.next();if(B.done){let q=B.value.v;T=L(q,B.value.telemetryBuilder)}else{let q=B.value.v,M=B.value.telemetryBuilder;N(q,M),(async()=>{try{for(B=await P.next();!B.done;){let j=B.value.v;N(j,B.value.telemetryBuilder),this._specManager.consumeScheduled(b.headerRequestId),B=await P.next()}let O=B.value.v;L(O,B.value.telemetryBuilder)}catch(O){f.trace(`Error while streaming further edits: ${ZLe.ErrorUtils.toString(O)}`);let j=new wp.NoNextEditReason.Unexpected(ZLe.ErrorUtils.fromUnknown(O));L(j,M)}})(),T=new wp.StatelessNextEditResult(YE.Result.ok(void 0),M)}}catch(B){throw b.setResultError(B),B}return{nextEditRequest:b,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new mvt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new hvt.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,mvt.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(y1.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(y1.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(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===JLe.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 tmc.InlineEditRequestLogContext(n.uri,0,void 0),s=new JBi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(CDr.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 bDr.OffsetRange(d,d),h=[f],m=new Eye.RootedEdit(r.documentBeforeEdits,new Lne.StringEdit([r.edit])),g=new XBi.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(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===JLe.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=vDr.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 E=this._specManager.pending;if(E?.docId===n&&E?.postEditContent===l){c.trace("already have speculative request for post-edit state");return}let _=this._workspace.getDocument(n);if(!_){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 b=new tBe(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,r3i.generateUuid)()}`);c.trace(`triggering speculative request for post-edit state (opportunityId=${b.opportunityId}, headerRequestId=${b.headerRequestId})`);try{let T=await this._createSpeculativeRequest(b,_,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),P=u.newText;this._specManager.setPending({request:T,docId:n,postEditContent:l,trajectoryPrefix:R,trajectorySuffix:x,trajectoryNewText:P})}}catch(T){c.trace(`speculative request failed: ${ZLe.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 E=new XBi.StringText(s),_=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let L=this._workspace.getWorkspaceRoot(h),B=new Lne.StringEdit([l]),q=XLe.RootedLineEdit.fromEdit(new Eye.RootedEdit(r.value.get(),B)).removeCommonSuffixPrefixLines().edit,M=new wp.StatelessNextEditDocument(h,L,N.languageId,r.value.get().getLines(),q,r.value.get(),Eye.Edits.single(B),n);return{recentEdit:new Eye.RootedEdit(r.value.get(),B),nextEditDoc:M,documentAfterEdits:E}}}),v=this._xtabHistoryTracker.getHistory(),b={kind:"edit",docId:h,edit:c};v.push(b);let T=new hvt.DeferredPromise,w=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case JLe.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case JLe.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case JLe.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,YBi.assertNever)(w)}let x=new wp.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 P=`NES | spec | ${(0,emc.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new nmc.CapturingToken(P,void 0);return this._requestLogger.captureInvocation(D,async()=>{this._addLiveLogContextEntry(g,P);try{await this._runSpeculativeProviderCall(x,_,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=t3i(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(YE.Result.error(g.value.v)),e.setResult(new wp.StatelessNextEditResult(YE.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=d.get(A.targetDocument??n),E=A.edit,_=new ZBi.LineEdit([E]),b=e3i(_,y.baseDocState).tryRebase(y.editsSoFar);if(b===void 0){l.trace(`speculative edit ${m} rebasing failed`),g=await h.next();continue}if(y.editsSoFar=y.editsSoFar.compose(b),b.replacements.length===1){let T=b.replacements[0];y.nextEdits.push(T);let w=this._nextEditCache.setKthNextEdit(y.docId,y.docContents,m===0?A.window:void 0,T,m,m===0?y.nextEdits:void 0,void 0,o,{isFromCursorJump:A.isFromCursorJump,originalEditWindow:A.originalWindow,cursorOffset:y.docId===n?s:void 0});!e.firstEdit.isSettled&&w&&(e.firstEdit.complete(YE.Result.ok(w)),e.setResult(new wp.StatelessNextEditResult(YE.Result.ok(void 0),g.value.telemetryBuilder)),f.setResponseResults([T])),l.trace(`cached speculative edit ${m}`)}y.docContents=b.applyOnText(y.docContents),g=await h.next()}})().finally(()=>{e.firstEdit.isSettled||(e.firstEdit.complete(YE.Result.error(new wp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new wp.StatelessNextEditResult(YE.Result.error(new wp.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: ${ZLe.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=eBe.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=eBe.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")}};uI.NextEditProvider=SDr;uI.NextEditProvider=SDr=vDr=Xhc([KLe(5,y1.IConfigurationService),KLe(6,omc.ISnippyService),KLe(7,CDr.ILogService),KLe(8,smc.IExperimentationService),KLe(9,imc.IRequestLogger)],SDr);function mmc(t){if(!t)throw new TDr.BugIndicatingError("expected value to be defined, but it was not");return t}a(mmc,"assertDefined");var tBe=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,r3i.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};uI.NextEditFetchRequest=tBe});var i3i=I(rBe=>{"use strict";p();Object.defineProperty(rBe,"__esModule",{value:!0});rBe.parseGitRemotes=gmc;rBe.toGitUri=Amc;rBe.getUpstreamRemote=ymc;var IDr=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 gmc(t){let e=[];for(let r of IDr.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(gmc,"parseGitRemotes");function Amc(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(Amc,"toGitUri");function ymc(t){let e=t.state.HEAD?.upstream?.remote;if(e)return t.state.remotes.find(r=>r.name===e)}a(ymc,"getUpstreamRemote")});var p3i=I(_h=>{"use strict";p();Object.defineProperty(_h,"__esModule",{value:!0});_h.GLOB_SPLIT=_h.GLOBSTAR=void 0;_h.getEmptyExpression=bmc;_h.splitGlobAware=RDr;_h.isEmptyPattern=Pmc;_h.match=Lmc;_h.parse=u3i;_h.isRelativePattern=d3i;_h.getBasenameTerms=Bmc;_h.getPathTerms=Fmc;_h.patternsEquals=qmc;var Emc=Sl(),wDr=nl(),_mc=rHt(),vmc=YP(),V$=NA(),Cmc=kq(),nBe=em();function bmc(){return Object.create(null)}a(bmc,"getEmptyExpression");_h.GLOBSTAR="**";_h.GLOB_SPLIT="/";var Avt="[/\\\\]",yvt="[^/\\\\]",Smc=/\//g;function o3i(t,e){switch(t){case 0:return"";case 1:return`${yvt}*?`;default:return`(?:${Avt}|${yvt}+${Avt}${e?`|${Avt}${yvt}+`:""})*?`}}a(o3i,"starsToRegExp");function RDr(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(RDr,"splitGlobAware");function l3i(t){if(!t)return"";let e="",r=RDr(t,_h.GLOB_SPLIT);if(r.every(n=>n===_h.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===_h.GLOBSTAR){if(n)return;e+=o3i(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===_h.GLOB_SPLIT?h="":h=(0,nBe.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${RDr(l,",").map(g=>l3i(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=yvt;continue;case"*":e+=o3i(1);continue;default:e+=(0,nBe.escapeRegExpCharacters)(f)}}su===d,endsWith:n?nBe.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,_mc.isEqualOrParent)(u,d,e.ignoreCase??!Cmc.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=s3i.get(s);if(c)return a3i(c,t,o);let l;return Tmc.test(r)?c=Dmc(r.substring(4),r,o):(l=Imc.exec(xDr(r,o)))?c=Nmc(l[1],r,o):(e.trimForExclusions?wmc:xmc).test(r)?c=Mmc(r,o):(l=Rmc.exec(xDr(r,o)))?c=c3i(l[1].substring(1),r,!0,o):(l=kmc.exec(xDr(r,o)))?c=c3i(l[1],r,!1,o):c=Omc(r,o),s3i.set(s,c),a3i(c,t,o)}a(PDr,"parsePattern");function a3i(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,nBe.ltrim)(o.substring(e.base.length),V$.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(a3i,"wrapRelativePattern");function xDr(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(xDr,"trimForExclusions");function Dmc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(Dmc,"trivia1");function Nmc(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(Nmc,"trivia2");function Mmc(t,e){let r=f3i(t.slice(1,-1).split(",").map(l=>PDr(l,e)).filter(l=>l!==cN),t),n=r.length;if(!n)return cN;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(Mmc,"trivia3");function c3i(t,e,r,n){let o=V$.sep===V$.posix.sep,s=o?t:t.replace(Smc,V$.sep),c=V$.sep+s,l=V$.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(c3i,"trivia4and5");function Omc(t,e){try{let r=new RegExp(`^${l3i(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return cN}}a(Omc,"toRegExp");function Lmc(t,e,r){return!t||typeof e!="string"?!1:u3i(t,r)(e)}a(Lmc,"match");function u3i(t,e={}){if(!t)return kDr;if(typeof t=="string"||d3i(t)){let r=PDr(t,e);if(r===cN)return kDr;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 Umc(t,e)}a(u3i,"parse");function d3i(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(d3i,"isRelativePattern");function Bmc(t){return t.allBasenames||[]}a(Bmc,"getBasenameTerms");function Fmc(t){return t.allPaths||[]}a(Fmc,"getPathTerms");function Umc(t,e){let r=f3i(Object.getOwnPropertyNames(t).map(l=>Qmc(l,t[l],e)).filter(l=>l!==cN)),n=r.length;if(!n)return cN;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(Umc,"parsedExpression");function Qmc(t,e,r){if(e===!1)return cN;let n=PDr(t,r);if(n===cN)return cN;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,wDr.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Qmc,"parseExpressionPattern");function f3i(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(f3i,"aggregateBasenameMatches");function qmc(t,e){return(0,Emc.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(qmc,"patternsEquals")});var _vt=I(Ol=>{"use strict";p();var jmc=Ol&&Ol.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hmc=Ol&&Ol.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Gmc=Ol&&Ol.__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,h3i.isEqual)(r.uri,t)||r.uri.path===t.path||NDr(t,r))}a(DDr,"findNotebook");function NDr(t,e){if(t.scheme===iBe.Schemas.vscodeNotebookCell||t.scheme===iBe.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,h3i.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(NDr,"findCell");function $mc(t,e){if(t.scheme!==iBe.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=m3i(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($mc,"getNotebookCellOutput");function m3i(t,e){let r=DDr(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=NDr(t,r);return n===void 0?[r,void 0]:[r,n]}a(m3i,"getNotebookAndCellFromUri");function Vmc(t){return t.scheme===iBe.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(Vmc,"isNotebookCellOrNotebookChatInput");function Wmc(t){return t.scheme===iBe.Schemas.vscodeNotebookCell}a(Wmc,"isNotebookCell");function zmc(t){return t.path.endsWith(".ipynb")}a(zmc,"isJupyterNotebookUri");function Ymc(t){return t.notebookType==="jupyter-notebook"}a(Ymc,"isJupyterNotebook");function Kmc(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(Kmc,"serializeNotebookDocument");function Jmc(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(Jmc,"extractNotebookOutline");function g3i(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||y3i(e.include))}a(g3i,"isDocumentExcludePattern");function A3i(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(A3i,"isFilenamePattern");function y3i(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(y3i,"isRelativePattern");function Zmc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(Zmc,"isNotebookEditorContribution");function Xmc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(Xmc,"extractEditorAssociation");function E3i(t,e){if(typeof e=="string"&&_ye.match(e.toLowerCase(),(0,vye.basename)(t.fsPath).toLowerCase()))return!0;if(g3i(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(_ye.match(r,(0,vye.basename)(t.fsPath).toLowerCase()))return!(n&&_ye.match(n,(0,vye.basename)(t.fsPath).toLowerCase()))}return A3i(e)&&_ye.match(e.filenamePattern,(0,vye.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&_ye.match(e.excludeFileNamePattern,(0,vye.basename)(t.fsPath).toLowerCase())):!1}a(E3i,"notebookSelectorMatches");function _3i(t,e){let r=[];for(let n of e)n.filenamePattern&&_ye.match(n.filenamePattern.toLowerCase(),(0,vye.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(_3i,"getNotebookEditorAssociations");function e0c(t,e,r,n){if(DDr(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>E3i(t,l)));if(o.length===0)return!1;let s=_3i(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??Evt.default)===Evt.default)}a(e0c,"_hasSupportedNotebooks")});var I3i=I(M0=>{"use strict";p();var t0c=M0&&M0.__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},r0c=M0&&M0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M0,"__esModule",{value:!0});M0.TelemetrySender=M0.NextEditProviderTelemetryBuilder=M0.DiagnosticsTelemetryBuilder=M0.LlmNESTelemetryBuilder=M0.NES_GH_TELEMETRY_EVENT_NAME=void 0;var v3i=HR(),C3i=i3i(),n0c=h4(),T3i=gm(),i0c=_vt(),o0c=nl(),vvt=ko(),s0c=tJ(),b3i=b8(),S3i=P0();M0.NES_GH_TELEMETRY_EVENT_NAME="copilot-nes/provideInlineEdit";var Cvt=class extends vvt.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,E)=>y+E.recentEdits.edits.length,0),o=g.recentEdits.edits.length,s=g.languageId,c=g.documentAfterEditsLines.length,l=g.id.toUri().scheme===s0c.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,i0c.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(S3i.Uri.parse(g.id.uri));if(y){let v=(0,C3i.getUpstreamRemote)(y);v?.fetchUrl&&(d=v.pushUrl||v.fetchUrl)}let E=new Set,_=[...new Set(this._request.documents.map(v=>A.getRepository(S3i.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of _){let b=v?(0,C3i.getUpstreamRemote)(v):void 0;b?.fetchUrl&&E.add(b.fetchUrl),b?.pushUrl&&E.add(b.pushUrl)}f=[...E]}}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(),E=JSON.stringify(y)?.length||0;A={entries:E>200*1024?void 0:y,entriesSize:E,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(E=>({time:y.time.toISOString(),start:E.replaceRange.start,endExclusive:E.replaceRange.endExclusive,newText:E.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,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,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,n0c.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}setReusedRequest(e){return this._reusedRequest=e,this}setSubsequentEditOrder(e){return this._subsequentEditOrder=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}};M0.LlmNESTelemetryBuilder=Cvt;var bvt=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}};M0.DiagnosticsTelemetryBuilder=bvt;var MDr=class t extends vvt.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,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 Cvt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new bvt}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}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}};M0.NextEditProviderTelemetryBuilder=MDr;var ODr=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new vvt.DisposableStore,this._disposalTracker=new vvt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new o0c.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,b3i.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,b3i.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()}},LDr=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 ODr(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,activeDocumentLanguageId:g,activeDocumentOriginalLineCount:A,nLinesOfCurrentFileInPrompt:y,wasPreviouslyRejected:E,isShown:_,isNotebook:v,notebookType:b,isNESForAnotherDoc:T,isActiveDocument:w,isEolDifferent:R,isMultilineEdit:x,isNextEditorRangeVisible:P,isNextEditorVisible:D,acceptance:N,disposalReason:L,logProbThreshold:B,documentsCount:q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:j,promptCharCount:Q,hadLowLogProbSuggestion:U,nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:V,isInlineSuggestion:z,debounceTime:ie,artificialDelay:H,hasNextEdit:re,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,notebookId:ge,notebookCellLines:Ue,nextEditLogprob:ke,supersededByOpportunityId:X,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchStartedAfterMs:he,response:Z,configIsDiagnosticsNESEnabled:ue,isNaturalLanguageDominated:qe,diagnosticType:ne,diagnosticDroppedReasons:ce,diagnosticHasExistingSameFileImport:Ne,diagnosticIsLocalImport:we,diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:rt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:_t,hadDiagnosticsNES:Dt,hadLlmNES:$t,pickedNES:Gt,xtabAggressivenessLevel:Ie,xtabUserHappinessScore:F,userAggressivenessSetting:be,modelConfig:Qe}=e,pe,Se,Fe,te;if(Z!==void 0){let{response:Te,ttft:Ge,fetchResult:J,fetchTime:se}=await Z;Te.type===v3i.ChatFetchResponseType.Success&&(pe=Te.usage),Se=Ge,Fe=J,te=se}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:g,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:N,disposalReason:L,supersededByOpportunityId:X,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchResult:Fe,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:ne,diagnosticDroppedReasons:ce,pickedNES:Gt,notebookType:b,notebookId:ge,notebookCellLines:Ue,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:Ie,userAggressivenessSetting:be,modelConfig:Qe,neighborSnippetIndicesInPrompt:e.neighborSnippetIndicesInPrompt},{requestN:o,hadStatelessNextEditProviderCall:this._boolToNum(l),statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:this._boolToNum(f),subsequentEditOrder:m,activeDocumentOriginalLineCount:A,activeDocumentNLinesInPrompt:y,wasPreviouslyRejected:this._boolToNum(E),isShown:this._boolToNum(_),isNotebook:this._boolToNum(v),isNESForAnotherDoc:this._boolToNum(T),isActiveDocument:this._boolToNum(w),isEolDifferent:this._boolToNum(R),isMultilineEdit:this._boolToNum(x),isNextEditorRangeVisible:this._boolToNum(P),isNextEditorVisible:this._boolToNum(D),hasNotebookCellMarker:le>0?1:0,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,logProbThreshold:B,documentsCount:q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:j,promptCharCount:Q,hadLowLogProbSuggestion:this._boolToNum(U),nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:this._boolToNum(V),isInlineSuggestion:this._boolToNum(z),debounceTime:ie,artificialDelay:H,fetchStartedAfterMs:he,ttft:Se,fetchTime:te,promptTokens:pe?.prompt_tokens,responseTokens:pe?.completion_tokens,cachedTokens:pe?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:pe?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:pe?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(re),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:ke,hadDiagnosticsNES:this._boolToNum(Dt),hadLlmNES:this._boolToNum($t),configIsDiagnosticsNESEnabled:this._boolToNum(ue),isNaturalLanguageDominated:this._boolToNum(qe),diagnosticHasExistingSameFileImport:this._boolToNum(Ne),diagnosticIsLocalImport:this._boolToNum(we),diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:rt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:this._boolToNum(_t),nextCursorLineDistance:e.nextCursorPrediction?.nextCursorLineDistance,xtabUserHappinessScore:F,nDiffsInPrompt:e.nDiffsInPrompt,diffTokensInPrompt:e.diffTokensInPrompt,nNeighborSnippetsComputed:e.nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:e.nNeighborSnippetsInPrompt})}_sendTelemetryToBoth(e,r){this._telemetryService.sendMSFTTelemetryEvent("provideInlineEdit",e,r),this._telemetryService.sendGHTelemetryEvent(M0.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:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:T,modelConfig:w,isFromCache:R}=e,x=f===void 0?f:await f,P=await T?.catch(()=>{}),D=x?.fetchResult;this._telemetryService.sendEnhancedGHTelemetryEvent(M0.NES_GH_TELEMETRY_EVENT_NAME,(0,T3i.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==v3i.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:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:P,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)}};M0.TelemetrySender=LDr;M0.TelemetrySender=LDr=t0c([r0c(1,T3i.ITelemetryService)],LDr)});var FDr=I(Cye=>{"use strict";p();Object.defineProperty(Cye,"__esModule",{value:!0});Cye.NullPowerService=Cye.IPowerService=void 0;var x3i=Ic(),a0c=Gs();Cye.IPowerService=(0,a0c.createDecorator)("IPowerService");var BDr=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=x3i.Event.None,this.onDidResume=x3i.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};Cye.NullPowerService=BDr});var J6=I(W$=>{"use strict";p();Object.defineProperty(W$,"__esModule",{value:!0});W$.FetchStreamRecorder=W$.FetchStreamSource=W$.IChatMLFetcher=void 0;var c0c=nn(),l0c=nl();W$.IChatMLFetcher=(0,c0c.createServiceIdentifier)("IChatMLFetcher");var UDr=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new l0c.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)}};W$.FetchStreamSource=UDr;var QDr=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}}};W$.FetchStreamRecorder=QDr});var qDr=I(Svt=>{"use strict";p();Object.defineProperty(Svt,"__esModule",{value:!0});Svt.IChatQuotaService=void 0;var u0c=nn();Svt.IChatQuotaService=(0,u0c.createServiceIdentifier)("IChatQuotaService")});var jDr=I(Tvt=>{"use strict";p();Object.defineProperty(Tvt,"__esModule",{value:!0});Tvt.IConversationOptions=void 0;var d0c=nn();Tvt.IConversationOptions=(0,d0c.createServiceIdentifier)("ConversationOptions")});var oBe=I(bye=>{"use strict";p();Object.defineProperty(bye,"__esModule",{value:!0});bye.getTextPart=p0c;bye.toTextPart=w3i;bye.toTextParts=h0c;bye.roleToString=m0c;var Bne=xo(),f0c=rd();function p0c(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Bne.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Bne.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a(p0c,"getTextPart");function w3i(t){return{type:Bne.Raw.ChatCompletionContentPartKind.Text,text:t}}a(w3i,"toTextPart");function h0c(t){return[w3i(t)]}a(h0c,"toTextParts");function m0c(t){switch(t){case Bne.Raw.ChatRole.System:return"system";case Bne.Raw.ChatRole.User:return"user";case Bne.Raw.ChatRole.Assistant:return"assistant";case Bne.Raw.ChatRole.Tool:return"tool";default:(0,f0c.assertNever)(t,`unknown role (${t})`)}}a(m0c,"roleToString")});var GDr=I(Sye=>{"use strict";p();Object.defineProperty(Sye,"__esModule",{value:!0});Sye.InteractionService=Sye.IInteractionService=void 0;var g0c=nn(),R3i=T0();Sye.IInteractionService=(0,g0c.createServiceIdentifier)("IInteractionService");var HDr=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,R3i.generateUuid)()}startInteraction(){this._interactionId=(0,R3i.generateUuid)()}get interactionId(){return this._interactionId}};Sye.InteractionService=HDr});var VDr=I(Ivt=>{"use strict";p();Object.defineProperty(Ivt,"__esModule",{value:!0});Ivt.SSEParser=void 0;var $Dr=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(ho,"__esModule",{value:!0});ho.getModelCapabilityOverride=y0c;ho.getModelId=W$;ho.isHiddenModelA=E0c;ho.isHiddenModelB=VDr;ho.isHiddenModelE=Ivt;ho.isHiddenModelF=xvt;ho.isHiddenFamilyH=wvt;ho.isHiddenModelK=_0c;ho.isGpt54=WDr;ho.isGpt55=v0c;ho.isHiddenModelM=iBe;ho.isGpt53Codex=zDr;ho.isVSCModelA=Rvt;ho.isVSCModelB=kvt;ho.isVSCModelReplaceStringSet=oBe;ho.isVSCModelC=C0c;ho.isVSCModelD=b0c;ho.isGpt52CodexFamily=YDr;ho.isGpt52Family=KDr;ho.modelPrefersInstructionsInUserMessage=S0c;ho.modelPrefersInstructionsAfterHistory=T0c;ho.modelSupportsApplyPatch=I0c;ho.modelPrefersJsonNotebookRepresentation=x0c;ho.modelSupportsReplaceString=w0c;ho.modelSupportsMultiReplaceString=N3i;ho.modelCanUseReplaceStringExclusively=R0c;ho.modelShouldUseReplaceStringHealing=k0c;ho.modelCanUseMcpResultImageURL=P0c;ho.modelCanUseImageURL=D0c;ho.modelSupportsPDFDocuments=N0c;ho.modelCanUseApplyPatchExclusively=M0c;ho.modelNeedsStrongReplaceStringHint=O0c;ho.modelSupportsSimplifiedApplyPatchInstructions=L0c;ho.isAnthropicFamily=sBe;ho.isGeminiFamily=JDr;ho.isMinimaxFamily=Pvt;ho.isGpt5PlusFamily=Dvt;ho.isGptCodexFamily=B0c;ho.isGpt5Family=F0c;ho.isGptFamily=U0c;ho.isGpt51Family=Q0c;ho.getVerbosityForModelSync=q0c;ho.modelSupportsToolSearch=j0c;ho.modelSupportsContextEditing=H0c;var Nm=PPr(),d0c=Pl(),f0c=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],P3i=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],I3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],x3i=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],w3i=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],R3i=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],k3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],p0c=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],h0c=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],m0c=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],D3i="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",g0c=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"],A0c=["0902565c0c0fe145633a1f246ae551acc0f621249ef050428eba357fbd4655ee"];function y0c(t,e){return e.getConfig(d0c.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(y0c,"getModelCapabilityOverride");function W$(t){return"id"in t?t.id:t.model}a(W$,"getModelId");function E0c(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return f0c.includes(e)}a(E0c,"isHiddenModelA");function VDr(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return P3i.includes(e)}a(VDr,"isHiddenModelB");function Ivt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return p0c.includes(e)}a(Ivt,"isHiddenModelE");function xvt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return h0c.includes(e)}a(xvt,"isHiddenModelF");function wvt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return g0c.includes(e)}a(wvt,"isHiddenFamilyH");function _0c(t){return(0,Nm.getCachedSha256Hash)(t.family)===D3i}a(_0c,"isHiddenModelK");function WDr(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||m0c.includes(e)}a(WDr,"isGpt54");function v0c(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||P3i.includes(e)}a(v0c,"isGpt55");function iBe(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return A0c.includes(e)}a(iBe,"isHiddenModelM");function zDr(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(zDr,"isGpt53Codex");function Rvt(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return I3i.includes(e)||I3i.includes(r)}a(Rvt,"isVSCModelA");function kvt(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return x3i.includes(e)||x3i.includes(r)}a(kvt,"isVSCModelB");function oBe(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return k3i.includes(e)||k3i.includes(r)}a(oBe,"isVSCModelReplaceStringSet");function C0c(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return w3i.includes(e)||w3i.includes(r)}a(C0c,"isVSCModelC");function b0c(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return R3i.includes(e)||R3i.includes(r)}a(b0c,"isVSCModelD");function YDr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(YDr,"isGpt52CodexFamily");function KDr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(KDr,"isGpt52Family");function S0c(t){return t.includes("claude-3.5-sonnet")}a(S0c,"modelPrefersInstructionsInUserMessage");function T0c(t){return t.includes("claude-3.5-sonnet")}a(T0c,"modelPrefersInstructionsAfterHistory");function I0c(t){return oBe(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||YDr(t.family)||zDr(t.family)||Rvt(t)||kvt(t)||KDr(t.family)||WDr(t)||VDr(t)||iBe(t)}a(I0c,"modelSupportsApplyPatch");function x0c(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||YDr(t.family)||zDr(t.family)||KDr(t.family)||WDr(t)||VDr(t)||iBe(t)}a(x0c,"modelPrefersJsonNotebookRepresentation");function w0c(t){return JDr(t)||t.family.includes("grok-code")||N3i(t)||xvt(t)||Pvt(t)||wvt(t)}a(w0c,"modelSupportsReplaceString");function N3i(t){return sBe(t)||Ivt(t)||oBe(t)||Pvt(t)||wvt(t)}a(N3i,"modelSupportsMultiReplaceString");function R0c(t){return sBe(t)||t.family.includes("grok-code")||Ivt(t)||t.family.toLowerCase().includes("gemini-3")||oBe(t)||xvt(t)||Pvt(t)||wvt(t)}a(R0c,"modelCanUseReplaceStringExclusively");function k0c(t){return t.family.includes("gemini-2")}a(k0c,"modelShouldUseReplaceStringHealing");function P0c(t){return!sBe(t)&&!Ivt(t)}a(P0c,"modelCanUseMcpResultImageURL");function D0c(t){return!0}a(D0c,"modelCanUseImageURL");function N0c(t){return sBe(t)||Dvt(t)||iBe(t)}a(N0c,"modelSupportsPDFDocuments");function M0c(t){return oBe(t)?!1:Dvt(t)||Rvt(t)||kvt(t)}a(M0c,"modelCanUseApplyPatchExclusively");function O0c(t){return JDr(t)||xvt(t)}a(O0c,"modelNeedsStrongReplaceStringHint");function L0c(t){return Dvt(t)||Rvt(t)||kvt(t)}a(L0c,"modelSupportsSimplifiedApplyPatchInstructions");function sBe(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(sBe,"isAnthropicFamily");function JDr(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,Nm.getCachedSha256Hash)(e)===D3i}a(JDr,"isGeminiFamily");function Pvt(t){return t.family.toLowerCase().includes("minimax")}a(Pvt,"isMinimaxFamily");function Dvt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(Dvt,"isGpt5PlusFamily");function B0c(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(B0c,"isGptCodexFamily");function F0c(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(F0c,"isGpt5Family");function U0c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(U0c,"isGptFamily");function Q0c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(Q0c,"isGpt51Family");function q0c(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(q0c,"getVerbosityForModelSync");function j0c(t){let e=typeof t=="string"?t:W$(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s==="gpt-5-4"||s==="gpt-5-5"?!0:!s.startsWith("claude")||s.startsWith("claude-haiku")?!1:!(s.startsWith("claude-1")||s.startsWith("claude-2")||s.startsWith("claude-3")||s.startsWith("claude-instant")||s==="claude-sonnet-4"||s.startsWith("claude-sonnet-4-2")||s==="claude-opus-4"||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4-2"))},"matches");return n(e)||n(r)||iBe(r)}a(j0c,"modelSupportsToolSearch");function H0c(t){let e=typeof t=="string"?t:W$(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(H0c,"modelSupportsContextEditing")});var Ovt=I(GR=>{"use strict";p();Object.defineProperty(GR,"__esModule",{value:!0});GR.CUSTOM_TOOL_SEARCH_NAME=void 0;GR.modelSupportsInterleavedThinking=$0c;GR.modelSupportsMemory=V0c;GR.isAnthropicContextEditingEnabled=W0c;GR.modelSupportsExtendedCacheTtl=M3i;GR.isExtendedCacheTtlEnabled=z0c;GR.isExtendedCacheTtlMessagesEnabled=Y0c;GR.buildContextManagement=O3i;GR.getContextManagementFromConfig=K0c;var Mvt=Pl(),Nvt=aBe(),G0c=jR();GR.CUSTOM_TOOL_SEARCH_NAME="tool_search";function $0c(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($0c,"modelSupportsInterleavedThinking");function V0c(t){let e=typeof t=="string"?t:(0,Nvt.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(V0c,"modelSupportsMemory");function W0c(t,e,r){return(typeof t=="string"?(0,Nvt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,Nvt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(Mvt.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(W0c,"isAnthropicContextEditingEnabled");function M3i(t){let e=typeof t=="string"?t:(0,Nvt.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(M3i,"modelSupportsExtendedCacheTtl");function z0c(t,e,r,n,o){return!M3i(t)||n!==G0c.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(Mvt.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(z0c,"isExtendedCacheTtlEnabled");function Y0c(t,e,r){return t?e.getExperimentBasedConfig(Mvt.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(Y0c,"isExtendedCacheTtlMessagesEnabled");function O3i(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(O3i,"buildContextManagement");function K0c(t,e,r){let n=t.getExperimentBasedConfig(Mvt.ConfigKey.AnthropicContextEditingMode,e);return O3i(n,r)}a(K0c,"getContextManagementFromConfig")});var ZDr=I(Lvt=>{"use strict";p();Object.defineProperty(Lvt,"__esModule",{value:!0});Lvt.IToolDeferralService=void 0;var J0c=nn();Lvt.IToolDeferralService=(0,J0c.createServiceIdentifier)("IToolDeferralService")});var rNr=I(KE=>{"use strict";p();var Z0c=KE&&KE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),X0c=KE&&KE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),egc=KE&&KE.__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;oUvt(n,r),e)}a(ngc,"arrayHash");function igc(t,e){return e=vL(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=tNr(n,r),Uvt(t[n],r)),e)}a(igc,"objectHash");var ogc=a(t=>{if(typeof t=="string"&&t.length<250){let r=new Fvt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof eNr.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(Sye)},"hashAsync");KE.hashAsync=ogc;function XDr(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(XDr,"leftRotate");function Sye(t,e=32){return t instanceof ArrayBuffer?(0,eNr.encodeHex)(eNr.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(Sye,"toHexString");var Fvt=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(Bvt.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()),Sye(this._h0)+Sye(this._h1)+Sye(this._h2)+Sye(this._h3)+Sye(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,XDr(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=XDr(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=XDr(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}};KE.StringSHA1=Fvt});var Tye=I(cBe=>{"use strict";p();Object.defineProperty(cBe,"__esModule",{value:!0});cBe.TelemetryData=void 0;cBe.eventPropertiesToSimpleObject=agc;var sgc=T0(),nNr=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];cgc(r,this.properties)}};cBe.TelemetryData=nNr;function agc(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(agc,"eventPropertiesToSimpleObject");function cgc(t,e){e.unique_id=(0,sgc.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(cgc,"addRequiredProperties")});var L3i=I(iNr=>{"use strict";p();Object.defineProperty(iNr,"__esModule",{value:!0});iNr.extractThinkingDeltaFromChoice=dgc;function lgc(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(lgc,"getThinkingDeltaText");function ugc(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(ugc,"getThinkingDeltaId");function dgc(t){let e=t.message||t.delta;if(!e)return;let r=ugc(e),n=lgc(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(dgc,"extractThinkingDeltaFromChoice")});var jvt=I(Fne=>{"use strict";p();Object.defineProperty(Fne,"__esModule",{value:!0});Fne.SSEProcessor=void 0;Fne.splitChunk=F3i;Fne.convertToAPIJsonData=hgc;Fne.sendCommunicationErrorTelemetry=Iye;var Qvt=Sp(),B3i=Tye(),fgc=L3i(),qvt=$6(),Mm=H6(),lBe=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}}},oNr=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}},sNr=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 oNr,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function F3i(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!==""),r]}a(F3i,"splitChunk");var aNr=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,qvt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new sNr,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,Mm.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,Mm.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]=F3i(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}`),Iye(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&&pgc(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}`),Iye(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new lBe(h.model||""),reason:Mm.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),Iye(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,qvt.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,qvt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every(qvt.isCodeCitationAnnotation))&&(T.ipCodeCitations=void 0),E=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}),E!==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 _({beginToolCalls:[{name:x,id:R?.id}]})))continue}let w=this.toolCalls.update(g);if(w.length&&await _({toolCallStreamUpdates:w}))continue}else if(g.delta?.copilot_annotations?.CodeVulnerability||g.delta?.copilot_annotations?.IPCodeCitations){if(await _()||!n&&(y.append(g),await _({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 _({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 lBe(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===Mm.FinishedCompletionReason.FunctionCall||g.finish_reason===Mm.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 _({functionCalls:[w]}))continue}catch(R){this.logService.error(R)}if(this.functionCalls[this.functionCallName]=null,this.functionCallName=void 0,g.finish_reason===Mm.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===Mm.FinishedCompletionReason.ToolCalls||g.finish_reason===Mm.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 _({toolCalls:T,thinking:w&&s?{metadata:{toolId:w}}:void 0}))continue}catch(R){this.logService.error(R)}}if(!(!v&&(y.append(g),await _())||!(g.finish_reason||E!==void 0))){if(yield{solution:y,finishOffset:E,reason:g.finish_reason??Mm.FinishedCompletionReason.ClientTrimmed,filterReason:mgc(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:Mm.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}`),Iye(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),Iye(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"?Mm.FinishedCompletionReason.FunctionCall:Mm.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:Mm.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)}`)}};Fne.SSEProcessor=aNr;function pgc(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(pgc,"isCopilotConfirmation");function hgc(t){return{text:t.text.join(""),tokens:t.text}}a(hgc,"convertToAPIJsonData");function mgc(t){if(t.finish_reason===Mm.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return Mm.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return Mm.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return Mm.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return Mm.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return Mm.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return Mm.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(mgc,"choiceToFilterReason");function Iye(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=B3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:Qvt.LogLevel[Qvt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=B3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:Qvt.LogLevel[Qvt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(Iye,"sendCommunicationErrorTelemetry")});var fBe=I(xye=>{"use strict";p();Object.defineProperty(xye,"__esModule",{value:!0});xye.sendEngineMessagesLengthTelemetry=H3i;xye.sendEngineMessagesTelemetry=G3i;xye.sendResponsesApiCompactionTelemetry=xgc;xye.prepareChatCompletionForReturn=wgc;var ggc=Io(),q3i=rNr(),Gvt=zP(),j3i=T0(),Agc=nBe(),lNr=gm(),dBe=Tye(),ygc=H6(),Egc=jvt();function H3i(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=dBe.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,lNr.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,lNr.multiplexProperties)(d.properties),d.measurements)}a(H3i,"sendEngineMessagesLengthTelemetry");var U3i=new Gvt.LRUCache(1e3),Q3i=new Gvt.LRUCache(500),uBe=new Gvt.LRUCache(1e3),Hvt={headerRequestId:null},cNr=new Gvt.LRUCache(100);function _gc(t){let e=uBe.get(t);if(e!==void 0){let r=e+1;return uBe.set(t,r),r}else return uBe.set(t,1),1}a(_gc,"updateHeaderRequestIdTracker");function vgc(t){let e=cNr.get(t);if(e!==void 0){let r=e+1;return cNr.set(t,r),r}else return cNr.set(t,1),1}a(vgc,"updateConversationTracker");function Cgc(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,q3i.hash)(n).toString(),l=Q3i.get(c);if(!l)l=(0,j3i.generateUuid)(),Q3i.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(pBe,"__esModule",{value:!0});pBe.CompactionDataContainer=void 0;pBe.rawPartAsCompactionData=kgc;var Rgc=Io(),$3i=xLe(),uNr=class extends Rgc.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:$3i.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};pBe.CompactionDataContainer=uNr;function kgc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===$3i.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(kgc,"rawPartAsCompactionData")});var z3i=I(hBe=>{"use strict";p();Object.defineProperty(hBe,"__esModule",{value:!0});hBe.PhaseDataContainer=void 0;hBe.rawPartAsPhaseData=Dgc;var Pgc=Io(),W3i=xLe(),dNr=class extends Pgc.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:W3i.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};hBe.PhaseDataContainer=dNr;function Dgc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===W3i.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(Dgc,"rawPartAsPhaseData")});var J3i=I(CL=>{"use strict";p();Object.defineProperty(CL,"__esModule",{value:!0});CL.StatefulMarkerContainer=void 0;CL.rawPartAsStatefulMarker=K3i;CL.encodeStatefulMarker=Ngc;CL.decodeStatefulMarker=Mgc;CL.getAllStatefulMarkersAndIndicies=hNr;CL.getStatefulMarkerAndIndex=Ogc;CL.getIndexOfStatefulMarker=Lgc;var fNr=Io(),Y3i=xLe(),pNr=class extends fNr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:Y3i.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};CL.StatefulMarkerContainer=pNr;function K3i(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Y3i.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(K3i,"rawPartAsStatefulMarker");function Ngc(t,e){return new TextEncoder().encode(t+"\\"+e)}a(Ngc,"encodeStatefulMarker");function Mgc(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(Mgc,"decodeStatefulMarker");function*hNr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===fNr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===fNr.Raw.ChatCompletionContentPartKind.Opaque){let o=K3i(n);o&&(yield{statefulMarker:o,index:e})}}}}a(hNr,"getAllStatefulMarkersAndIndicies");function Ogc(t,e){for(let r of hNr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(Ogc,"getStatefulMarkerAndIndex");function Lgc(t,e){for(let r of hNr(e))if(r.statefulMarker.marker===t)return r.index}a(Lgc,"getIndexOfStatefulMarker")});var eFi=I(J6=>{"use strict";p();var Bgc=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]})),Fgc=J6&&J6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),X3i=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();Object.defineProperty(mo,"__esModule",{value:!0});mo.getModelCapabilityOverride=S0c;mo.getModelId=z$;mo.isHiddenModelA=T0c;mo.isHiddenModelB=WDr;mo.isHiddenModelE=xvt;mo.isHiddenModelF=wvt;mo.isHiddenFamilyH=Rvt;mo.isHiddenModelK=I0c;mo.isGpt54=zDr;mo.isGpt55=x0c;mo.isHiddenModelM=sBe;mo.isGpt53Codex=YDr;mo.isVSCModelA=kvt;mo.isVSCModelB=Pvt;mo.isVSCModelReplaceStringSet=aBe;mo.isVSCModelC=w0c;mo.isVSCModelD=R0c;mo.isGpt52CodexFamily=KDr;mo.isGpt52Family=JDr;mo.modelPrefersInstructionsInUserMessage=k0c;mo.modelPrefersInstructionsAfterHistory=P0c;mo.modelSupportsApplyPatch=D0c;mo.modelPrefersJsonNotebookRepresentation=N0c;mo.modelSupportsReplaceString=M0c;mo.modelSupportsMultiReplaceString=B3i;mo.modelCanUseReplaceStringExclusively=O0c;mo.modelShouldUseReplaceStringHealing=L0c;mo.modelCanUseMcpResultImageURL=B0c;mo.modelCanUseImageURL=F0c;mo.modelSupportsPDFDocuments=U0c;mo.modelCanUseApplyPatchExclusively=Q0c;mo.modelNeedsStrongReplaceStringHint=q0c;mo.modelSupportsSimplifiedApplyPatchInstructions=j0c;mo.isAnthropicFamily=cBe;mo.isGeminiFamily=ZDr;mo.isMinimaxFamily=Dvt;mo.isGpt5PlusFamily=Nvt;mo.isGptCodexFamily=H0c;mo.isGpt5Family=G0c;mo.isGptFamily=$0c;mo.isGpt51Family=V0c;mo.getVerbosityForModelSync=W0c;mo.modelSupportsToolSearch=z0c;mo.modelSupportsContextEditing=Y0c;var Nm=DPr(),A0c=Pl(),y0c=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],O3i=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],k3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],P3i=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],D3i=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],N3i=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],M3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],E0c=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],_0c=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],v0c=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],L3i="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",C0c=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"],b0c=["0902565c0c0fe145633a1f246ae551acc0f621249ef050428eba357fbd4655ee"];function S0c(t,e){return e.getConfig(A0c.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(S0c,"getModelCapabilityOverride");function z$(t){return"id"in t?t.id:t.model}a(z$,"getModelId");function T0c(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return y0c.includes(e)}a(T0c,"isHiddenModelA");function WDr(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return O3i.includes(e)}a(WDr,"isHiddenModelB");function xvt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return E0c.includes(e)}a(xvt,"isHiddenModelE");function wvt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return _0c.includes(e)}a(wvt,"isHiddenModelF");function Rvt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return C0c.includes(e)}a(Rvt,"isHiddenFamilyH");function I0c(t){return(0,Nm.getCachedSha256Hash)(t.family)===L3i}a(I0c,"isHiddenModelK");function zDr(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||v0c.includes(e)}a(zDr,"isGpt54");function x0c(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||O3i.includes(e)}a(x0c,"isGpt55");function sBe(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return b0c.includes(e)}a(sBe,"isHiddenModelM");function YDr(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(YDr,"isGpt53Codex");function kvt(t){let e=(0,Nm.getCachedSha256Hash)(z$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return k3i.includes(e)||k3i.includes(r)}a(kvt,"isVSCModelA");function Pvt(t){let e=(0,Nm.getCachedSha256Hash)(z$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return P3i.includes(e)||P3i.includes(r)}a(Pvt,"isVSCModelB");function aBe(t){let e=(0,Nm.getCachedSha256Hash)(z$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return M3i.includes(e)||M3i.includes(r)}a(aBe,"isVSCModelReplaceStringSet");function w0c(t){let e=(0,Nm.getCachedSha256Hash)(z$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return D3i.includes(e)||D3i.includes(r)}a(w0c,"isVSCModelC");function R0c(t){let e=(0,Nm.getCachedSha256Hash)(z$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return N3i.includes(e)||N3i.includes(r)}a(R0c,"isVSCModelD");function KDr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(KDr,"isGpt52CodexFamily");function JDr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(JDr,"isGpt52Family");function k0c(t){return t.includes("claude-3.5-sonnet")}a(k0c,"modelPrefersInstructionsInUserMessage");function P0c(t){return t.includes("claude-3.5-sonnet")}a(P0c,"modelPrefersInstructionsAfterHistory");function D0c(t){return aBe(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||KDr(t.family)||YDr(t.family)||kvt(t)||Pvt(t)||JDr(t.family)||zDr(t)||WDr(t)||sBe(t)}a(D0c,"modelSupportsApplyPatch");function N0c(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||KDr(t.family)||YDr(t.family)||JDr(t.family)||zDr(t)||WDr(t)||sBe(t)}a(N0c,"modelPrefersJsonNotebookRepresentation");function M0c(t){return ZDr(t)||t.family.includes("grok-code")||B3i(t)||wvt(t)||Dvt(t)||Rvt(t)}a(M0c,"modelSupportsReplaceString");function B3i(t){return cBe(t)||xvt(t)||aBe(t)||Dvt(t)||Rvt(t)}a(B3i,"modelSupportsMultiReplaceString");function O0c(t){return cBe(t)||t.family.includes("grok-code")||xvt(t)||t.family.toLowerCase().includes("gemini-3")||aBe(t)||wvt(t)||Dvt(t)||Rvt(t)}a(O0c,"modelCanUseReplaceStringExclusively");function L0c(t){return t.family.includes("gemini-2")}a(L0c,"modelShouldUseReplaceStringHealing");function B0c(t){return!cBe(t)&&!xvt(t)}a(B0c,"modelCanUseMcpResultImageURL");function F0c(t){return!0}a(F0c,"modelCanUseImageURL");function U0c(t){return cBe(t)||Nvt(t)||sBe(t)}a(U0c,"modelSupportsPDFDocuments");function Q0c(t){return aBe(t)?!1:Nvt(t)||kvt(t)||Pvt(t)}a(Q0c,"modelCanUseApplyPatchExclusively");function q0c(t){return ZDr(t)||wvt(t)}a(q0c,"modelNeedsStrongReplaceStringHint");function j0c(t){return Nvt(t)||kvt(t)||Pvt(t)}a(j0c,"modelSupportsSimplifiedApplyPatchInstructions");function cBe(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(cBe,"isAnthropicFamily");function ZDr(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,Nm.getCachedSha256Hash)(e)===L3i}a(ZDr,"isGeminiFamily");function Dvt(t){return t.family.toLowerCase().includes("minimax")}a(Dvt,"isMinimaxFamily");function Nvt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(Nvt,"isGpt5PlusFamily");function H0c(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(H0c,"isGptCodexFamily");function G0c(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(G0c,"isGpt5Family");function $0c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a($0c,"isGptFamily");function V0c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(V0c,"isGpt51Family");function W0c(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(W0c,"getVerbosityForModelSync");function z0c(t){let e=typeof t=="string"?t:z$(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s==="gpt-5-4"||s==="gpt-5-5"?!0:!s.startsWith("claude")||s.startsWith("claude-haiku")?!1:!(s.startsWith("claude-1")||s.startsWith("claude-2")||s.startsWith("claude-3")||s.startsWith("claude-instant")||s==="claude-sonnet-4"||s.startsWith("claude-sonnet-4-2")||s==="claude-opus-4"||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4-2"))},"matches");return n(e)||n(r)||sBe(r)}a(z0c,"modelSupportsToolSearch");function Y0c(t){let e=typeof t=="string"?t:z$(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(Y0c,"modelSupportsContextEditing")});var Lvt=I($R=>{"use strict";p();Object.defineProperty($R,"__esModule",{value:!0});$R.CUSTOM_TOOL_SEARCH_NAME=void 0;$R.modelSupportsInterleavedThinking=J0c;$R.modelSupportsMemory=Z0c;$R.isAnthropicContextEditingEnabled=X0c;$R.modelSupportsExtendedCacheTtl=F3i;$R.isExtendedCacheTtlEnabled=egc;$R.isExtendedCacheTtlMessagesEnabled=tgc;$R.buildContextManagement=U3i;$R.getContextManagementFromConfig=rgc;var Ovt=Pl(),Mvt=lBe(),K0c=HR();$R.CUSTOM_TOOL_SEARCH_NAME="tool_search";function J0c(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(J0c,"modelSupportsInterleavedThinking");function Z0c(t){let e=typeof t=="string"?t:(0,Mvt.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(Z0c,"modelSupportsMemory");function X0c(t,e,r){return(typeof t=="string"?(0,Mvt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,Mvt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(Ovt.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(X0c,"isAnthropicContextEditingEnabled");function F3i(t){let e=typeof t=="string"?t:(0,Mvt.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(F3i,"modelSupportsExtendedCacheTtl");function egc(t,e,r,n,o){return!F3i(t)||n!==K0c.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(Ovt.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(egc,"isExtendedCacheTtlEnabled");function tgc(t,e,r){return t?e.getExperimentBasedConfig(Ovt.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(tgc,"isExtendedCacheTtlMessagesEnabled");function U3i(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(U3i,"buildContextManagement");function rgc(t,e,r){let n=t.getExperimentBasedConfig(Ovt.ConfigKey.AnthropicContextEditingMode,e);return U3i(n,r)}a(rgc,"getContextManagementFromConfig")});var XDr=I(Bvt=>{"use strict";p();Object.defineProperty(Bvt,"__esModule",{value:!0});Bvt.IToolDeferralService=void 0;var ngc=nn();Bvt.IToolDeferralService=(0,ngc.createServiceIdentifier)("IToolDeferralService")});var nNr=I(KE=>{"use strict";p();var igc=KE&&KE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ogc=KE&&KE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),sgc=KE&&KE.__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;oQvt(n,r),e)}a(lgc,"arrayHash");function ugc(t,e){return e=vL(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=rNr(n,r),Qvt(t[n],r)),e)}a(ugc,"objectHash");var dgc=a(t=>{if(typeof t=="string"&&t.length<250){let r=new Uvt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof tNr.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(Tye)},"hashAsync");KE.hashAsync=dgc;function eNr(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(eNr,"leftRotate");function Tye(t,e=32){return t instanceof ArrayBuffer?(0,tNr.encodeHex)(tNr.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(Tye,"toHexString");var Uvt=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(Fvt.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()),Tye(this._h0)+Tye(this._h1)+Tye(this._h2)+Tye(this._h3)+Tye(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,eNr(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=eNr(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=eNr(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}};KE.StringSHA1=Uvt});var Iye=I(uBe=>{"use strict";p();Object.defineProperty(uBe,"__esModule",{value:!0});uBe.TelemetryData=void 0;uBe.eventPropertiesToSimpleObject=pgc;var fgc=T0(),iNr=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];hgc(r,this.properties)}};uBe.TelemetryData=iNr;function pgc(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(pgc,"eventPropertiesToSimpleObject");function hgc(t,e){e.unique_id=(0,fgc.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(hgc,"addRequiredProperties")});var Q3i=I(oNr=>{"use strict";p();Object.defineProperty(oNr,"__esModule",{value:!0});oNr.extractThinkingDeltaFromChoice=Agc;function mgc(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(mgc,"getThinkingDeltaText");function ggc(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(ggc,"getThinkingDeltaId");function Agc(t){let e=t.message||t.delta;if(!e)return;let r=ggc(e),n=mgc(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(Agc,"extractThinkingDeltaFromChoice")});var Hvt=I(Fne=>{"use strict";p();Object.defineProperty(Fne,"__esModule",{value:!0});Fne.SSEProcessor=void 0;Fne.splitChunk=j3i;Fne.convertToAPIJsonData=_gc;Fne.sendCommunicationErrorTelemetry=xye;var qvt=Sp(),q3i=Iye(),ygc=Q3i(),jvt=V6(),Mm=G6(),dBe=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}}},sNr=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}},aNr=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 sNr,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function j3i(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!==""),r]}a(j3i,"splitChunk");var cNr=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,jvt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new aNr,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,Mm.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,Mm.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]=j3i(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}`),xye(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&&Egc(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}`),xye(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new dBe(h.model||""),reason:Mm.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),xye(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,jvt.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,jvt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every(jvt.isCodeCitationAnnotation))&&(T.ipCodeCitations=void 0),E=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}),E!==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 _({beginToolCalls:[{name:x,id:R?.id}]})))continue}let w=this.toolCalls.update(g);if(w.length&&await _({toolCallStreamUpdates:w}))continue}else if(g.delta?.copilot_annotations?.CodeVulnerability||g.delta?.copilot_annotations?.IPCodeCitations){if(await _()||!n&&(y.append(g),await _({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 _({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 dBe(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===Mm.FinishedCompletionReason.FunctionCall||g.finish_reason===Mm.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 _({functionCalls:[w]}))continue}catch(R){this.logService.error(R)}if(this.functionCalls[this.functionCallName]=null,this.functionCallName=void 0,g.finish_reason===Mm.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===Mm.FinishedCompletionReason.ToolCalls||g.finish_reason===Mm.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 _({toolCalls:T,thinking:w&&s?{metadata:{toolId:w}}:void 0}))continue}catch(R){this.logService.error(R)}}if(!(!v&&(y.append(g),await _())||!(g.finish_reason||E!==void 0))){if(yield{solution:y,finishOffset:E,reason:g.finish_reason??Mm.FinishedCompletionReason.ClientTrimmed,filterReason:vgc(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:Mm.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}`),xye(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),xye(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"?Mm.FinishedCompletionReason.FunctionCall:Mm.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:Mm.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)}`)}};Fne.SSEProcessor=cNr;function Egc(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(Egc,"isCopilotConfirmation");function _gc(t){return{text:t.text.join(""),tokens:t.text}}a(_gc,"convertToAPIJsonData");function vgc(t){if(t.finish_reason===Mm.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return Mm.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return Mm.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return Mm.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return Mm.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return Mm.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return Mm.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(vgc,"choiceToFilterReason");function xye(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=q3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:qvt.LogLevel[qvt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=q3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:qvt.LogLevel[qvt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(xye,"sendCommunicationErrorTelemetry")});var hBe=I(wye=>{"use strict";p();Object.defineProperty(wye,"__esModule",{value:!0});wye.sendEngineMessagesLengthTelemetry=W3i;wye.sendEngineMessagesTelemetry=z3i;wye.sendResponsesApiCompactionTelemetry=Ngc;wye.prepareChatCompletionForReturn=Mgc;var Cgc=xo(),$3i=nNr(),$vt=YP(),V3i=T0(),bgc=oBe(),uNr=gm(),pBe=Iye(),Sgc=G6(),Tgc=Hvt();function W3i(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=pBe.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,uNr.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,uNr.multiplexProperties)(d.properties),d.measurements)}a(W3i,"sendEngineMessagesLengthTelemetry");var H3i=new $vt.LRUCache(1e3),G3i=new $vt.LRUCache(500),fBe=new $vt.LRUCache(1e3),Gvt={headerRequestId:null},lNr=new $vt.LRUCache(100);function Igc(t){let e=fBe.get(t);if(e!==void 0){let r=e+1;return fBe.set(t,r),r}else return fBe.set(t,1),1}a(Igc,"updateHeaderRequestIdTracker");function xgc(t){let e=lNr.get(t);if(e!==void 0){let r=e+1;return lNr.set(t,r),r}else return lNr.set(t,1),1}a(xgc,"updateConversationTracker");function wgc(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,$3i.hash)(n).toString(),l=G3i.get(c);if(!l)l=(0,V3i.generateUuid)(),G3i.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(mBe,"__esModule",{value:!0});mBe.CompactionDataContainer=void 0;mBe.rawPartAsCompactionData=Lgc;var Ogc=xo(),Y3i=RLe(),dNr=class extends Ogc.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:Y3i.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};mBe.CompactionDataContainer=dNr;function Lgc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Y3i.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(Lgc,"rawPartAsCompactionData")});var Z3i=I(gBe=>{"use strict";p();Object.defineProperty(gBe,"__esModule",{value:!0});gBe.PhaseDataContainer=void 0;gBe.rawPartAsPhaseData=Fgc;var Bgc=xo(),J3i=RLe(),fNr=class extends Bgc.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:J3i.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};gBe.PhaseDataContainer=fNr;function Fgc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===J3i.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(Fgc,"rawPartAsPhaseData")});var tFi=I(CL=>{"use strict";p();Object.defineProperty(CL,"__esModule",{value:!0});CL.StatefulMarkerContainer=void 0;CL.rawPartAsStatefulMarker=eFi;CL.encodeStatefulMarker=Ugc;CL.decodeStatefulMarker=Qgc;CL.getAllStatefulMarkersAndIndicies=mNr;CL.getStatefulMarkerAndIndex=qgc;CL.getIndexOfStatefulMarker=jgc;var pNr=xo(),X3i=RLe(),hNr=class extends pNr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:X3i.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};CL.StatefulMarkerContainer=hNr;function eFi(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===X3i.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(eFi,"rawPartAsStatefulMarker");function Ugc(t,e){return new TextEncoder().encode(t+"\\"+e)}a(Ugc,"encodeStatefulMarker");function Qgc(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(Qgc,"decodeStatefulMarker");function*mNr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===pNr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===pNr.Raw.ChatCompletionContentPartKind.Opaque){let o=eFi(n);o&&(yield{statefulMarker:o,index:e})}}}}a(mNr,"getAllStatefulMarkersAndIndicies");function qgc(t,e){for(let r of mNr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(qgc,"getStatefulMarkerAndIndex");function jgc(t,e){for(let r of mNr(e))if(r.statefulMarker.marker===t)return r.index}a(jgc,"getIndexOfStatefulMarker")});var iFi=I(Z6=>{"use strict";p();var Hgc=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]})),Ggc=Z6&&Z6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),nFi=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 qgc=Uv&&Uv.__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},jgc=Uv&&Uv.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Uv,"__esModule",{value:!0});Uv.OpenAIResponsesProcessor=void 0;Uv.getResponsesApiCompactionThreshold=aFi;Uv.createResponsesRequestBody=rAc;Uv.getResponsesApiCompactionThresholdFromBody=nAc;Uv.responseApiInputToRawMessagesForLogging=pAc;Uv.processResponseFromChatEndpoint=CAc;Uv.sendCompletionOutputTelemetry=uFi;var Xi=Io(),CNr=Sl(),Hgc=nl(),Ggc=e$(),$gc=eF(),Vgc=$Dr(),bL=KS(),Wgc=T0(),tFi=jR(),Une=Pl(),zgc=Sp(),Z6=Ovt(),Ygc=$6(),Of=H6(),Kgc=ZDr(),ENr=fBe(),Jgc=X6(),Zgc=mh(),$vt=aBe(),bNr=V3i(),Xgc=z3i(),rFi=J3i(),eAc=e2r(),tAc=eFi();function aFi(t,e,r){if(t.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!Of.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(aFi,"getResponsesApiCompactionThreshold");function rAc(t,e,r,n){let o=t.get(Une.IConfigurationService),s=t.get(Zgc.IExperimentationService),c=(0,$vt.getVerbosityForModelSync)(n),l=aFi(o,s,n),u=iAc(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(q=>q.function.name===Z6.CUSTOM_TOOL_SEARCH_NAME),m=e.location===tFi.ChatLocation.Agent||e.location===tFi.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(Kgc.IToolDeferralService):void 0,E=[];if(e.requestOptions?.tools)for(let q of e.requestOptions.tools)!q.function.name||q.function.name.length===0||q.function.name===Z6.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(q.function.name)||E.push({...q.function,type:"function",strict:!1,parameters:q.function.parameters||{}});let _=[...E];A&&_.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(q=>[q.function.name,q])):void 0,b=A?q=>!y.isNonDeferredTool(q):void 0,T={model:r,...oAc(r,e.messages,d,u,{toolsMap:v,shouldLoadToolFromToolSearch:b,modeChanged:f}),stream:!0,tools:_.length>0?_: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&&(T.context_management=[{type:Of.openAIContextManagementCompactionType,compact_threshold:l}]),T.truncation=o.getConfig(Une.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let w=e.modelCapabilities?.enableThinking===!1,R=o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiReasoningSummary,s),x=n.family==="gpt-5.3-codex-spark-preview"||w,P=o.getConfig(Une.ConfigKey.Advanced.ReasoningEffortOverride),D=n.supportsReasoningEffort?.length?P||e.modelCapabilities?.reasoningEffort||"medium":void 0,N=R==="off"||x?void 0:R,L=o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiPersistentCoTEnabled,s)&&((0,$vt.isGpt54)(n)||(0,$vt.isGpt55)(n)||(0,$vt.isHiddenModelM)(n));return(D||N||L)&&(T.reasoning={...D?{effort:D}:{},...N?{summary:N}:{},...L?{context:"all_turns"}:{}}),T.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(T.prompt_cache_key=`${e.conversationId}:${n.family}`),T}a(rAc,"createResponsesRequestBody");function nAc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===Of.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(nAc,"getResponsesApiCompactionThresholdFromBody");function iAc(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(Jgc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(iAc,"resolveWebSocketStatefulMarker");function oAc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1}=o,u=aAc(e),d=u!==void 0?sAc(e[u]):void 0,f,h;if(n)h=(0,rFi.getIndexOfStatefulMarker)(n,e),h!==void 0&&(f=n);else if(!r){let E=(0,rFi.getStatefulMarkerAndIndex)(t,e);E&&(f=E.statefulMarker,h=E.index)}l&&(f=void 0,h=void 0);let m=new Set,g=new Set;if(h!==void 0||u!==void 0){for(let E of e)if(E.role===Xi.Raw.ChatRole.Assistant&&E.toolCalls)for(let _ of E.toolCalls)_.function.name===Z6.CUSTOM_TOOL_SEARCH_NAME&&m.add(_.id);else if(E.role===Xi.Raw.ChatRole.Tool&&E.toolCallId&&m.has(E.toolCallId)&&s){let _=E.content.filter(v=>v.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(v=>v.text).join("");for(let v of nFi(_,s,c))g.add(v.name)}}h!==void 0?(e=e.slice(h+1),u!==void 0&&(u>h?e=e.slice(u-(h+1)):d&&(e=[d,...e]))):u!==void 0&&(e=e.slice(u));let y=[];for(let E of e)switch(E.role){case Xi.Raw.ChatRole.Assistant:if(E.content.length){y.push(...fAc(E.content)),y.push(...uAc(E.content));let _=E.content.map(cAc).filter(bL.isDefined);if(_.length){let v={role:"assistant",content:_,type:"message",phase:dAc(E.content)};y.push(v)}}if(E.toolCalls)for(let _ of E.toolCalls)if(_.function.name===Z6.CUSTOM_TOOL_SEARCH_NAME){m.add(_.id);let v={};try{v=JSON.parse(_.function.arguments||"{}")}catch{}y.push({type:"tool_search_call",execution:"client",call_id:_.id,status:"completed",arguments:v})}else{let v=g.has(_.function.name)?_.function.name:void 0;y.push({type:"function_call",name:_.function.name,arguments:_.function.arguments,call_id:_.id,...v?{namespace:v}:{}})}break;case Xi.Raw.ChatRole.Tool:if(E.toolCallId)if(m.has(E.toolCallId)){let _=E.content.filter(b=>b.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(b=>b.text).join(""),v=s?nFi(_,s,c):[];for(let b of v)g.add(b.name);y.push({type:"tool_search_output",execution:"client",call_id:E.toolCallId,status:"completed",tools:v})}else{let _=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(T=>T.text).join(""),v=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Image).map(T=>({type:"input_image",detail:T.imageUrl.detail||"auto",image_url:T.imageUrl.url})),b=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Document).map(cFi).filter(bL.isDefined);y.push({type:"function_call_output",call_id:E.toolCallId,output:_}),v.length&&y.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...v]}),b.length&&y.push({role:"user",content:[{type:"input_text",text:"PDF associated with the above tool call:"},...b]})}break;case Xi.Raw.ChatRole.User:y.push({role:"user",content:E.content.map(iFi).filter(bL.isDefined)});break;case Xi.Raw.ChatRole.System:y.push({role:"system",content:E.content.map(iFi).filter(bL.isDefined)});break}return{input:y,previous_response_id:f}}a(oAc,"rawMessagesToResponseAPI");function nFi(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==Z6.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(nFi,"buildToolSearchOutputTools");function sAc(t){if(t.role!==Xi.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===Xi.Raw.ChatCompletionContentPartKind.Opaque&&(0,bNr.rawPartAsCompactionData)(r));if(e.length)return{role:Xi.Raw.ChatRole.Assistant,content:e}}a(sAc,"createCompactionRoundTripMessage");function aAc(t){for(let e=t.length-1;e>=0;e--){let r=t[e];for(let n of r.content)if(n.type===Xi.Raw.ChatCompletionContentPartKind.Opaque&&(0,bNr.rawPartAsCompactionData)(n))return e}}a(aAc,"getLatestCompactionMessageIndex");function cFi(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(cFi,"rawDocumentToResponsesInputFile");function iFi(t){switch(t.type){case Xi.Raw.ChatCompletionContentPartKind.Text:return{type:"input_text",text:t.text};case Xi.Raw.ChatCompletionContentPartKind.Image:return{type:"input_image",detail:t.imageUrl.detail||"auto",image_url:t.imageUrl.url};case Xi.Raw.ChatCompletionContentPartKind.Document:return cFi(t);case Xi.Raw.ChatCompletionContentPartKind.Opaque:{let e=t.value;if(e.type==="input_text"||e.type==="input_image"||e.type==="input_file")return e}}}a(iFi,"rawContentToResponsesContent");function cAc(t){switch(t.type){case Xi.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(cAc,"rawContentToResponsesAssistantContent");function lAc(t){return typeof t=="string"&&t.startsWith("rs")}a(lAc,"isResponsesReasoningId");function uAc(t){return(0,CNr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,eAc.rawPartAsThinkingData)(e);if(r&&r.encrypted&&lAc(r.id))return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(uAc,"extractThinkingData");function dAc(t){for(let e of t)if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,Xgc.rawPartAsPhaseData)(e);if(r)return r}}a(dAc,"extractPhaseData");function fAc(t){return(0,CNr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,bNr.rawPartAsCompactionData)(e);if(r)return{type:Of.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(fAc,"extractCompactionData");function pAc(t){let e=[],r=[],n=a(()=>{r.length>0&&e.push({role:Xi.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)})},"flushPendingFunctionCalls");t.instructions&&e.push({role:Xi.Raw.ChatRole.System,content:[{type:Xi.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:Xi.Raw.ChatRole.User,content:yNr(s.content).map(Vvt).filter(bL.isDefined)});break;case"system":case"developer":n(),e.push({role:Xi.Raw.ChatRole.System,content:yNr(s.content).map(Vvt).filter(bL.isDefined)});break;case"assistant":n(),hAc(s)?e.push({role:Xi.Raw.ChatRole.Assistant,content:s.content.map(gAc).filter(bL.isDefined)}):mAc(s)&&e.push({role:Xi.Raw.ChatRole.Assistant,content:yNr(s.content).map(Vvt).filter(bL.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=AAc(s.output);e.push({role:Xi.Raw.ChatRole.Tool,content:c,toolCallId:s.call_id});break}case"reasoning":n(),e.push({role:Xi.Raw.ChatRole.Assistant,content:[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:`Reasoning summary: ${s.summary.map(c=>c.text).join(` +`),e.info(`[responsesAPI] Dumping SSE stream to ${s}`),new yNr(s)}catch{return rFi}}a(Vgc,"createResponsesStreamDumper")});var Yvt=I(Qv=>{"use strict";p();var Wgc=Qv&&Qv.__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},zgc=Qv&&Qv.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Qv,"__esModule",{value:!0});Qv.OpenAIResponsesProcessor=void 0;Qv.getResponsesApiCompactionThreshold=dFi;Qv.createResponsesRequestBody=cAc;Qv.getResponsesApiCompactionThresholdFromBody=lAc;Qv.responseApiInputToRawMessagesForLogging=EAc;Qv.processResponseFromChatEndpoint=wAc;Qv.sendCompletionOutputTelemetry=hFi;var Xi=xo(),bNr=Sl(),Ygc=nl(),Kgc=t$(),Jgc=tF(),Zgc=VDr(),bL=ZS(),Xgc=T0(),oFi=HR(),Une=Pl(),eAc=Sp(),X6=Lvt(),tAc=V6(),Of=G6(),rAc=XDr(),_Nr=hBe(),nAc=e9(),iAc=mh(),Vvt=lBe(),SNr=K3i(),oAc=Z3i(),sFi=tFi(),sAc=t2r(),aAc=iFi();function dFi(t,e,r){if(t.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!Of.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(dFi,"getResponsesApiCompactionThreshold");function cAc(t,e,r,n){let o=t.get(Une.IConfigurationService),s=t.get(iAc.IExperimentationService),c=(0,Vvt.getVerbosityForModelSync)(n),l=dFi(o,s,n),u=uAc(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(q=>q.function.name===X6.CUSTOM_TOOL_SEARCH_NAME),m=e.location===oFi.ChatLocation.Agent||e.location===oFi.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(rAc.IToolDeferralService):void 0,E=[];if(e.requestOptions?.tools)for(let q of e.requestOptions.tools)!q.function.name||q.function.name.length===0||q.function.name===X6.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(q.function.name)||E.push({...q.function,type:"function",strict:!1,parameters:q.function.parameters||{}});let _=[...E];A&&_.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(q=>[q.function.name,q])):void 0,b=A?q=>!y.isNonDeferredTool(q):void 0,T={model:r,...dAc(r,e.messages,d,u,{toolsMap:v,shouldLoadToolFromToolSearch:b,modeChanged:f}),stream:!0,tools:_.length>0?_: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&&(T.context_management=[{type:Of.openAIContextManagementCompactionType,compact_threshold:l}]),T.truncation=o.getConfig(Une.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let w=e.modelCapabilities?.enableThinking===!1,R=o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiReasoningSummary,s),x=n.family==="gpt-5.3-codex-spark-preview"||w,P=o.getConfig(Une.ConfigKey.Advanced.ReasoningEffortOverride),D=n.supportsReasoningEffort?.length?P||e.modelCapabilities?.reasoningEffort||"medium":void 0,N=R==="off"||x?void 0:R,L=o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiPersistentCoTEnabled,s)&&((0,Vvt.isGpt54)(n)||(0,Vvt.isGpt55)(n)||(0,Vvt.isHiddenModelM)(n));return(D||N||L)&&(T.reasoning={...D?{effort:D}:{},...N?{summary:N}:{},...L?{context:"all_turns"}:{}}),T.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(T.prompt_cache_key=`${e.conversationId}:${n.family}`),T}a(cAc,"createResponsesRequestBody");function lAc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===Of.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(lAc,"getResponsesApiCompactionThresholdFromBody");function uAc(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(nAc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(uAc,"resolveWebSocketStatefulMarker");function dAc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1}=o,u=pAc(e),d=u!==void 0?fAc(e[u]):void 0,f,h;if(n)h=(0,sFi.getIndexOfStatefulMarker)(n,e),h!==void 0&&(f=n);else if(!r){let E=(0,sFi.getStatefulMarkerAndIndex)(t,e);E&&(f=E.statefulMarker,h=E.index)}l&&(f=void 0,h=void 0);let m=new Set,g=new Set;if(h!==void 0||u!==void 0){for(let E of e)if(E.role===Xi.Raw.ChatRole.Assistant&&E.toolCalls)for(let _ of E.toolCalls)_.function.name===X6.CUSTOM_TOOL_SEARCH_NAME&&m.add(_.id);else if(E.role===Xi.Raw.ChatRole.Tool&&E.toolCallId&&m.has(E.toolCallId)&&s){let _=E.content.filter(v=>v.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(v=>v.text).join("");for(let v of aFi(_,s,c))g.add(v.name)}}h!==void 0?(e=e.slice(h+1),u!==void 0&&(u>h?e=e.slice(u-(h+1)):d&&(e=[d,...e]))):u!==void 0&&(e=e.slice(u));let y=[];for(let E of e)switch(E.role){case Xi.Raw.ChatRole.Assistant:if(E.content.length){y.push(...yAc(E.content)),y.push(...gAc(E.content));let _=E.content.map(hAc).filter(bL.isDefined);if(_.length){let v={role:"assistant",content:_,type:"message",phase:AAc(E.content)};y.push(v)}}if(E.toolCalls)for(let _ of E.toolCalls)if(_.function.name===X6.CUSTOM_TOOL_SEARCH_NAME){m.add(_.id);let v={};try{v=JSON.parse(_.function.arguments||"{}")}catch{}y.push({type:"tool_search_call",execution:"client",call_id:_.id,status:"completed",arguments:v})}else{let v=g.has(_.function.name)?_.function.name:void 0;y.push({type:"function_call",name:_.function.name,arguments:_.function.arguments,call_id:_.id,...v?{namespace:v}:{}})}break;case Xi.Raw.ChatRole.Tool:if(E.toolCallId)if(m.has(E.toolCallId)){let _=E.content.filter(b=>b.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(b=>b.text).join(""),v=s?aFi(_,s,c):[];for(let b of v)g.add(b.name);y.push({type:"tool_search_output",execution:"client",call_id:E.toolCallId,status:"completed",tools:v})}else{let _=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(T=>T.text).join(""),v=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Image).map(T=>({type:"input_image",detail:T.imageUrl.detail||"auto",image_url:T.imageUrl.url})),b=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Document).map(fFi).filter(bL.isDefined);y.push({type:"function_call_output",call_id:E.toolCallId,output:_}),v.length&&y.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...v]}),b.length&&y.push({role:"user",content:[{type:"input_text",text:"PDF associated with the above tool call:"},...b]})}break;case Xi.Raw.ChatRole.User:y.push({role:"user",content:E.content.map(cFi).filter(bL.isDefined)});break;case Xi.Raw.ChatRole.System:y.push({role:"system",content:E.content.map(cFi).filter(bL.isDefined)});break}return{input:y,previous_response_id:f}}a(dAc,"rawMessagesToResponseAPI");function aFi(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==X6.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(aFi,"buildToolSearchOutputTools");function fAc(t){if(t.role!==Xi.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===Xi.Raw.ChatCompletionContentPartKind.Opaque&&(0,SNr.rawPartAsCompactionData)(r));if(e.length)return{role:Xi.Raw.ChatRole.Assistant,content:e}}a(fAc,"createCompactionRoundTripMessage");function pAc(t){for(let e=t.length-1;e>=0;e--){let r=t[e];for(let n of r.content)if(n.type===Xi.Raw.ChatCompletionContentPartKind.Opaque&&(0,SNr.rawPartAsCompactionData)(n))return e}}a(pAc,"getLatestCompactionMessageIndex");function fFi(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(fFi,"rawDocumentToResponsesInputFile");function cFi(t){switch(t.type){case Xi.Raw.ChatCompletionContentPartKind.Text:return{type:"input_text",text:t.text};case Xi.Raw.ChatCompletionContentPartKind.Image:return{type:"input_image",detail:t.imageUrl.detail||"auto",image_url:t.imageUrl.url};case Xi.Raw.ChatCompletionContentPartKind.Document:return fFi(t);case Xi.Raw.ChatCompletionContentPartKind.Opaque:{let e=t.value;if(e.type==="input_text"||e.type==="input_image"||e.type==="input_file")return e}}}a(cFi,"rawContentToResponsesContent");function hAc(t){switch(t.type){case Xi.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(hAc,"rawContentToResponsesAssistantContent");function mAc(t){return typeof t=="string"&&t.startsWith("rs")}a(mAc,"isResponsesReasoningId");function gAc(t){return(0,bNr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,sAc.rawPartAsThinkingData)(e);if(r&&r.encrypted&&mAc(r.id))return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(gAc,"extractThinkingData");function AAc(t){for(let e of t)if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,oAc.rawPartAsPhaseData)(e);if(r)return r}}a(AAc,"extractPhaseData");function yAc(t){return(0,bNr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,SNr.rawPartAsCompactionData)(e);if(r)return{type:Of.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(yAc,"extractCompactionData");function EAc(t){let e=[],r=[],n=a(()=>{r.length>0&&e.push({role:Xi.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)})},"flushPendingFunctionCalls");t.instructions&&e.push({role:Xi.Raw.ChatRole.System,content:[{type:Xi.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:Xi.Raw.ChatRole.User,content:ENr(s.content).map(Wvt).filter(bL.isDefined)});break;case"system":case"developer":n(),e.push({role:Xi.Raw.ChatRole.System,content:ENr(s.content).map(Wvt).filter(bL.isDefined)});break;case"assistant":n(),_Ac(s)?e.push({role:Xi.Raw.ChatRole.Assistant,content:s.content.map(CAc).filter(bL.isDefined)}):vAc(s)&&e.push({role:Xi.Raw.ChatRole.Assistant,content:ENr(s.content).map(Wvt).filter(bL.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=bAc(s.output);e.push({role:Xi.Raw.ChatRole.Tool,content:c,toolCallId:s.call_id});break}case"reasoning":n(),e.push({role:Xi.Raw.ChatRole.Assistant,content:[{type:Xi.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:Z6.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:Xi.Raw.ChatRole.Tool,content:[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:JSON.stringify(l)}],toolCallId:c.call_id})}break}}return r.length>0&&e.push({role:Xi.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)}),e}a(pAc,"responseApiInputToRawMessagesForLogging");function hAc(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(hAc,"isResponseOutputMessage");function mAc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(mAc,"isResponseInputItemMessage");function yNr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(yNr,"ensureContentArray");function Vvt(t){switch(t.type){case"input_text":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"input_image":return{type:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:t.image_url||"",detail:t.detail==="auto"?void 0:t.detail??void 0}};case"input_file":return{type:Xi.Raw.ChatCompletionContentPartKind.Opaque,value:`[File Input - Filename: ${t.filename||"unknown"}]`}}}a(Vvt,"responseContentToRawContent");function gAc(t){switch(t.type){case"output_text":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"refusal":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:`[Refusal: ${t.refusal}]`}}}a(gAc,"responseOutputToRawContent");function AAc(t){return typeof t=="string"?[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,CNr.coalesce)(t.map(Vvt))}a(AAc,"responseFunctionOutputToRawContents");function _Nr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===Of.openAIContextManagementCompactionType}a(_Nr,"isCompactionItem");function yAc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(yAc,"hasOutputItem");function EAc(t){return"response"in t&&Array.isArray(t.response.output)}a(EAc,"hasResponseOutput");function _Ac(t){return t.output_index}a(_Ac,"getOutputItemIndex");function vNr(t){return _Nr(t)}a(vNr,"isCompactionOutputItem");function lFi(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(vNr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&vNr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(lFi,"getLatestCompactionOutput");function vAc(t,e){let r=lFi(t,e);return r?t.filter((n,o)=>!vNr(n)||o===r.outputIndex):t}a(vAc,"keepLatestCompactionOutput");async function CAc(t,e,r,n,o,s,c,l){return new Hgc.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,Wgc.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,Ygc.getRequestId)(n.headers),m=t.createInstance(Wvt,c,e,d,f,h,l),g=(0,tAc.createResponsesStreamDumper)(d,r),A=new Vgc.SSEParser(y=>{try{if(r.trace(`SSE: ${y.data}`),y.data==="[DONE]")return;let E=JSON.parse(y.data),_={type:y.type,...E};g.logEvent(_);let v=m.push(_,s);v&&(uFi(e,r,v,c),u.emitOne(v))}catch(E){u.reject(E)}});for await(let y of n.body)A.feed(y)},async()=>{await n.body.destroy()})}a(CAc,"processResponseFromChatEndpoint");function uFi(t,e,r,n){let o=(0,Of.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,ENr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(uFi,"sendCompletionOutputTelemetry");function bAc(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 Of.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return Of.FilterReason.SelfHarm;if(o.includes("sexual"))return Of.FilterReason.Sexual;if(o.includes("violence"))return Of.FilterReason.Violence;if(o.includes("hate"))return Of.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return Of.FilterReason.Hate;if(s.self_harm?.filtered)return Of.FilterReason.SelfHarm;if(s.sexual?.filtered)return Of.FilterReason.Sexual;if(s.violence?.filtered)return Of.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return Of.FilterReason.Copyright;if(r.source_type==="prompt")return Of.FilterReason.Prompt}a(bAc,"extractFilterReasonFromContentFilters");function oFi(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(oFi,"mapResponsesApiError");var Wvt=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(yAc(e)&&_Nr(e.item)){let n=_Ac(e);r.push({item:e.item,outputIndex:n})}if(EAc(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}]});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:X6.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:Xi.Raw.ChatRole.Tool,content:[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:JSON.stringify(l)}],toolCallId:c.call_id})}break}}return r.length>0&&e.push({role:Xi.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)}),e}a(EAc,"responseApiInputToRawMessagesForLogging");function _Ac(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(_Ac,"isResponseOutputMessage");function vAc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(vAc,"isResponseInputItemMessage");function ENr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(ENr,"ensureContentArray");function Wvt(t){switch(t.type){case"input_text":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"input_image":return{type:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:t.image_url||"",detail:t.detail==="auto"?void 0:t.detail??void 0}};case"input_file":return{type:Xi.Raw.ChatCompletionContentPartKind.Opaque,value:`[File Input - Filename: ${t.filename||"unknown"}]`}}}a(Wvt,"responseContentToRawContent");function CAc(t){switch(t.type){case"output_text":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"refusal":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:`[Refusal: ${t.refusal}]`}}}a(CAc,"responseOutputToRawContent");function bAc(t){return typeof t=="string"?[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,bNr.coalesce)(t.map(Wvt))}a(bAc,"responseFunctionOutputToRawContents");function vNr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===Of.openAIContextManagementCompactionType}a(vNr,"isCompactionItem");function SAc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(SAc,"hasOutputItem");function TAc(t){return"response"in t&&Array.isArray(t.response.output)}a(TAc,"hasResponseOutput");function IAc(t){return t.output_index}a(IAc,"getOutputItemIndex");function CNr(t){return vNr(t)}a(CNr,"isCompactionOutputItem");function pFi(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(CNr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&CNr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(pFi,"getLatestCompactionOutput");function xAc(t,e){let r=pFi(t,e);return r?t.filter((n,o)=>!CNr(n)||o===r.outputIndex):t}a(xAc,"keepLatestCompactionOutput");async function wAc(t,e,r,n,o,s,c,l){return new Ygc.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,Xgc.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,tAc.getRequestId)(n.headers),m=t.createInstance(zvt,c,e,d,f,h,l),g=(0,aAc.createResponsesStreamDumper)(d,r),A=new Zgc.SSEParser(y=>{try{if(r.trace(`SSE: ${y.data}`),y.data==="[DONE]")return;let E=JSON.parse(y.data),_={type:y.type,...E};g.logEvent(_);let v=m.push(_,s);v&&(hFi(e,r,v,c),u.emitOne(v))}catch(E){u.reject(E)}});for await(let y of n.body)A.feed(y)},async()=>{await n.body.destroy()})}a(wAc,"processResponseFromChatEndpoint");function hFi(t,e,r,n){let o=(0,Of.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,_Nr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(hFi,"sendCompletionOutputTelemetry");function RAc(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 Of.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return Of.FilterReason.SelfHarm;if(o.includes("sexual"))return Of.FilterReason.Sexual;if(o.includes("violence"))return Of.FilterReason.Violence;if(o.includes("hate"))return Of.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return Of.FilterReason.Hate;if(s.self_harm?.filtered)return Of.FilterReason.SelfHarm;if(s.sexual?.filtered)return Of.FilterReason.Sexual;if(s.violence?.filtered)return Of.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return Of.FilterReason.Copyright;if(r.source_type==="prompt")return Of.FilterReason.Prompt}a(RAc,"extractFilterReasonFromContentFilters");function lFi(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(lFi,"mapResponsesApiError");var zvt=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(SAc(e)&&vNr(e.item)){let n=IAc(e);r.push({item:e.item,outputIndex:n})}if(TAc(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}]});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 $gc.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...sFi(c,l),top_logprobs:l.top_logprobs?.map(u=>sFi(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:Z6.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:Z6.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:Z6.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=vAc(s.response.output,this.latestCompactionOutputIndex),l=lFi(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,ENr.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,ENr.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:Of.FinishedCompletionReason.Stop,message:{role:Xi.Raw.ChatRole.Assistant,content:c.map(h=>{if(h.type==="message")return{type:Xi.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:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:h.result}}}).filter(bL.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=Of.FinishedCompletionReason.Length:c==="content_filter"?(l=Of.FinishedCompletionReason.ContentFilter,u=bAc(s.content_filters)):l=Of.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:oFi(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,Of.FinishedCompletionReason.ServerError,{error:oFi(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:Xi.Raw.ChatRole.Assistant,content:o.map(s=>{if(s.type==="message")return{type:Xi.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:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:s.result}}}).filter(bL.isDefined)}}}};Uv.OpenAIResponsesProcessor=Wvt;Uv.OpenAIResponsesProcessor=Wvt=qgc([jgc(6,zgc.ILogService)],Wvt);function sFi(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,Ggc.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(sFi,"mapLogProp")});var dFi=I(Yvt=>{"use strict";p();Object.defineProperty(Yvt,"__esModule",{value:!0});Yvt.ChatWebSocketTelemetrySender=void 0;var SNr=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})}};Yvt.ChatWebSocketTelemetrySender=SNr});var X6=I(E1=>{"use strict";p();var SAc=E1&&E1.__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},Kvt=E1&&E1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(E1,"__esModule",{value:!0});E1.ChatWebSocketManager=E1.NullChatWebSocketManager=E1.IChatWebSocketManager=void 0;E1.isCAPIWebSocketError=RNr;var TAc=nn(),IAc=Rs(),Jvt=Ic(),fFi=Ro(),pFi=Pl(),xAc=$E(),wye=Sp(),wAc=gm(),RAc=_y(),kAc=zvt(),z$=dFi();E1.IChatWebSocketManager=(0,TAc.createServiceIdentifier)("IChatWebSocketManager");var TNr=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(){}};E1.NullChatWebSocketManager=TNr;function RNr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(RNr,"isCAPIWebSocketError");var PAc={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function DAc(t){return PAc[t.type]}a(DAc,"getStreamTerminatingOutcome");var INr=class extends fFi.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 xNr(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()}};E1.ChatWebSocketManager=INr;E1.ChatWebSocketManager=INr=SAc([Kvt(0,wye.ILogService),Kvt(1,xAc.ICAPIClientService),Kvt(2,wAc.ITelemetryService),Kvt(3,pFi.IConfigurationService)],INr);function Zvt(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(Zvt,"wsCloseCodeToString");var xNr=class extends fFi.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 Jvt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new RAc.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}`),z$.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,wye.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,wye.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})`:""}`),z$.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=Zvt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),z$.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,wye.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),z$.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}!RNr(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=Zvt(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})`),z$.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,wye.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}`),z$.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(O=>O?.type==="compaction")??!1,l=r.summarizedAtRoundId!==void 0,u=r.summarizedAtRoundId===this._summarizedAtRoundId,d=(0,kAc.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,E=Date.now(),_=this._totalSentMessageCount,v=this._totalReceivedMessageCount,b=this._totalSentCharacters,T=this._totalReceivedCharacters,w=r.countTokens(),R=-1;w.then(O=>{R=O},()=>{R=-2});let x=new wNr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:O,closeCode:j,closeReason:Q,serverErrorMessage:U,serverErrorCode:Y})=>{this._activeRequest===x&&(this._activeRequest=void 0);let W=Date.now()-(this._connectedTime??Date.now()),V=Date.now()-E,z=this._totalSentMessageCount-_,ie=this._totalReceivedMessageCount-v,H=this._totalSentCharacters-b,re=this._totalReceivedCharacters-T;z$.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:O,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:j,closeReason:Q,serverErrorMessage:U,serverErrorCode:Y})}),this._activeRequest=x;let P=n.onCancellationRequested(()=>{this._activeRequest===x&&(x.handleCancellation(),this._activeRequest=void 0)});x.done.finally(()=>P.dispose()).catch(()=>{});let{stream:D,...N}=e,L={type:"response.create",...N,initiator:r.userInitiated?"user":"agent"},B=JSON.stringify(L),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})`),z$.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()}},wNr=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 Jvt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new Jvt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new Jvt.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(pFi.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,wye.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),RNr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=DAc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${Zvt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${Zvt(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 IAc.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 PNr=I(SL=>{"use strict";p();Object.defineProperty(SL,"__esModule",{value:!0});SL.getImageDimensions=NAc;SL.getImageDimensionsFromBytes=MAc;SL.getPngDimensions=hFi;SL.getGifDimensions=mFi;SL.getJpegDimensions=gFi;SL.getWebPDimensions=_Fi;SL.getMimeType=bFi;SL.extractImageAttributes=BAc;function NAc(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(bFi(e)){case"image/png":return hFi(e);case"image/gif":return mFi(e);case"image/jpeg":case"image/jpg":return gFi(e);case"image/webp":return _Fi(e);default:throw new Error("Unsupported image format")}}a(NAc,"getImageDimensions");function MAc(t,e){switch(OAc(e)){case"image/png":return AFi(t);case"image/gif":return yFi(t);case"image/jpeg":case"image/jpg":return EFi(t);case"image/webp":return vFi(t);default:throw new Error("Unsupported image format")}}a(MAc,"getImageDimensionsFromBytes");function hFi(t){return AFi(Xvt(t.slice(0,50)))}a(hFi,"getPngDimensions");function mFi(t){return yFi(Xvt(t.slice(0,50)))}a(mFi,"getGifDimensions");function gFi(t){return EFi(Xvt(t))}a(gFi,"getJpegDimensions");function AFi(t){if(!CFi(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(AFi,"getPngDimensionsFromBytes");function yFi(t){if(!kNr(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(yFi,"getGifDimensionsFromBytes");function EFi(t){if(!CFi(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(EFi,"getJpegDimensionsFromBytes");function _Fi(t){return vFi(Xvt(t))}a(_Fi,"getWebPDimensions");function vFi(t){if(!kNr(t,0,"RIFF")||!kNr(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=LAc(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(vFi,"getWebPDimensionsFromBytes");function OAc(t){return t?.toLowerCase().split(";")[0].trim()}a(OAc,"normalizeMimeType");function Xvt(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(Xvt,"base64ToBytes");function CFi(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(eCt,"__esModule",{value:!0});eCt.TokenizerType=void 0;var SFi;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(SFi||(eCt.TokenizerType=SFi={}))});var NNr=I(qne=>{"use strict";p();Object.defineProperty(qne,"__esModule",{value:!0});qne.WorkerWithRpcProxy=qne.RcpResponseHandler=void 0;qne.createRpcProxy=TFi;var FAc=require("worker_threads"),tCt=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()}};qne.RcpResponseHandler=tCt;function TFi(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(TFi,"createRpcProxy");var DNr=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new tCt,this.worker=new FAc.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=TFi((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)}};qne.WorkerWithRpcProxy=DNr});var IFi=I($R=>{"use strict";p();Object.defineProperty($R,"__esModule",{value:!0});$R.SlidingWindowAverage=$R.MovingAverage=$R.Counter=void 0;$R.clamp=QAc;$R.rot=qAc;$R.isPointWithinTriangle=jAc;$R.randomChance=HAc;var UAc=rd();function QAc(t,e,r){return Math.min(Math.max(t,e),r)}a(QAc,"clamp");function qAc(t,e){return(e+t%e)%e}a(qAc,"rot");var MNr=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};$R.Counter=MNr;var ONr=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}};$R.MovingAverage=ONr;var LNr=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(jAc,"isPointWithinTriangle");function HAc(t){return(0,UAc.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(nCt,"__esModule",{value:!0});nCt.TikTokenImpl=void 0;var BNr=iTr(),rCt=IFi(),GAc=FO(),$Ac=cTr(),FNr=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new rCt.MovingAverage,textLength:new rCt.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?$Ac.parseTikTokenBinary:c=>c;return this._values.push((0,BNr.createTokenizer)(s(e),(0,BNr.getSpecialTokensByEncoder)(r),(0,BNr.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=GAc.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 rCt.MovingAverage,this._stats.textLength=new rCt.MovingAverage,this._stats.callCount=0,r}};nCt.TikTokenImpl=FNr});var K$=I(Rp=>{"use strict";p();var kFi=Rp&&Rp.__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},PFi=Rp&&Rp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.TokenizerProvider=Rp.BaseTokensPerName=Rp.BaseTokensPerMessage=Rp.BaseTokensPerCompletion=Rp.ITokenizerProvider=void 0;Rp.calculateImageTokenCost=jNr;Rp.estimateDocumentTokenCost=NFi;var Y$=Io(),VAc=hDr(),WAc=PNr(),zAc=nn(),wFi=Qne(),YAc=NNr(),KAc=rd(),RFi=eF(),UNr=Ro(),iCt=NA(),DFi=gm(),QNr=xFi();Rp.ITokenizerProvider=(0,zAc.createServiceIdentifier)("ITokenizerProvider");Rp.BaseTokensPerCompletion=3;Rp.BaseTokensPerMessage=3;Rp.BaseTokensPerName=1;var qNr=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new RFi.Lazy(()=>new oCt(e,(0,iCt.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new RFi.Lazy(()=>new oCt(e,(0,iCt.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case wFi.TokenizerType.CL100K:return this._cl100kTokenizer.value;case wFi.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};Rp.TokenizerProvider=qNr;Rp.TokenizerProvider=qNr=kFi([PFi(1,DFi.ITelemetryService)],qNr);var oCt=class extends UNr.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 VAc.LRUCache(5e3),this.baseTokensPerMessage=Rp.BaseTokensPerMessage,this.baseTokensPerName=Rp.BaseTokensPerName,this.mode=Y$.OutputMode.Raw}async countMessagesTokens(e){let r=Rp.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 Y$.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case Y$.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case Y$.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return jNr(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case Y$.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case Y$.Raw.ChatCompletionContentPartKind.Document:return NFi(e.documentData.data);default:(0,KAc.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,Y$.toMode)(Y$.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+=jNr(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,iCt.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,iCt.join)(__dirname,"tikTokenizerWorker.js"),n=new YAc.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,UNr.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=QNr.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,UNr.toDisposable)(()=>{QNr.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>QNr.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};oCt=kFi([PFi(3,DFi.ITelemetryService)],oCt);function jNr(t,e){let{width:r,height:n}=(0,WAc.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(jNr,"calculateImageTokenCost");function NFi(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(NFi,"estimateDocumentTokenCost")});var J$=I(sCt=>{"use strict";p();Object.defineProperty(sCt,"__esModule",{value:!0});sCt.IDomainService=void 0;var JAc=nn();sCt.IDomainService=(0,JAc.createServiceIdentifier)("IDomainService")});var aCt=I(Qv=>{"use strict";p();Object.defineProperty(Qv,"__esModule",{value:!0});Qv.HeaderContributors=Qv.IHeaderContributors=Qv.userAgentLibraryHeader=void 0;Qv.stringifyUrlOrRequestMetadata=syc;Qv.isCAPIRequestMetadata=GNr;Qv.isCAPIEndpoint=ayc;Qv.createCapiRequestBody=cyc;Qv.canRetryOnceNetworkError=OFi;Qv.postRequest=lyc;Qv.getRequest=uyc;var ZAc=nn(),XAc=Qne(),eyc=Rs(),tyc=$E(),ryc=gm(),nyc=_y(),iyc=H6();Qv.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var oyc=30*1e3;function syc(t){return typeof t=="string"?t:JSON.stringify(t)}a(syc,"stringifyUrlOrRequestMetadata");function GNr(t){return typeof t!="string"}a(GNr,"isCAPIRequestMetadata");function ayc(t){return GNr(t.urlOrRequestMetadata)}a(ayc,"isCAPIEndpoint");function cyc(t,e,r){let n={messages:(0,iyc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a(cyc,"createCapiRequestBody");function MFi(t,e){let r=t.get(nyc.IFetcherService),n=t.get(ryc.ITelemetryService),o=t.get(tyc.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,E=typeof c=="string"||"type"in c?{modelMaxPromptTokens:0,urlOrRequestMetadata:c,family:"",tokenizer:XAc.TokenizerType.O200K,acquireTokenizer:a(()=>{throw new Error("Method not implemented.")},"acquireTokenizer"),name:"",version:""}:c,_=e.interactionTypeOverride??u,v={...l?{Authorization:`Bearer ${l}`}:{},"X-Request-Id":d,"OpenAI-Intent":u,"X-GitHub-Api-Version":"2026-01-09",...h,...E.getExtraHeaders?E.getExtraHeaders(y,e.interactionTypeOverride):{}};v["X-Interaction-Type"]=_,v["X-Agent-Task-Id"]=d,E.interceptBody&&E.interceptBody(f);let b=E.getEndpointFetchOptions?.(),T={callSite:`network-request-${u}`,method:s,headers:v,json:f,timeout:oyc,useFetcher:g,suppressIntegrationId:b?.suppressIntegrationId};if(m){let w=r.makeAbortController();m.onCancellationRequested(()=>{n.sendGHTelemetryEvent("networking.cancelRequest",{headerRequestId:d}),w.abort()}),T.signal=w.signal}return GNr(E.urlOrRequestMetadata)?o.makeRequest(T,E.urlOrRequestMetadata):r.fetch(E.urlOrRequestMetadata,T).catch(R=>{if(A&&OFi(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(E.urlOrRequestMetadata,T));throw r.isAbortError(R)?new eyc.CancellationError:R})}a(MFi,"networkRequest");function OFi(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(OFi,"canRetryOnceNetworkError");function lyc(t,e){return MFi(t,{...e,requestType:"POST"})}a(lyc,"postRequest");function uyc(t,e){return MFi(t,{...e,requestType:"GET"})}a(uyc,"getRequest");Qv.IHeaderContributors=(0,ZAc.createServiceIdentifier)("headerContributors");var HNr=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}};Qv.HeaderContributors=HNr});var qFi=I(JE=>{"use strict";p();var dyc=JE&&JE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fyc=JE&&JE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pyc=JE&&JE.__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(gyc,"formatTokenCount");function Ayc(t){return ml.t("In: {0} \xB7 Out: {1} AICs/1M tokens",LFi(t.default.inputPrice),LFi(t.default.outputPrice))}a(Ayc,"formatPricingLabel");var BFi=1e6;function yyc(t){if(!t)return;let e=t.batch_size??BFi,r=BFi/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}}}a(yyc,"normalizeTokenPrices")});var r8i=I(by=>{"use strict";p();var Eyc=by&&by.__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},jFi=by&&by.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(by,"__esModule",{value:!0});by.AnthropicMessagesProcessor=void 0;by.buildToolInputSchema=YFi;by.createMessagesRequestBody=Syc;by.rawMessagesToMessagesAPI=KFi;by.clearAllCacheControl=JFi;by.addToolsAndSystemCacheControl=ZFi;by.addMessagesApiCacheControl=XFi;by.processResponseFromMessagesEndpoint=xyc;by.processNonStreamingResponseFromMessagesEndpoint=t8i;var cN=Io(),GFi=nl(),_yc=$Dr(),$Nr=T0(),vyc=jR(),HFi=Pl(),$Fi=Sp(),Rye=Ovt(),VFi=$6(),mBe=H6(),Cyc=ZDr(),WFi=fBe(),byc=mh(),zFi=gm();function YFi(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(YFi,"buildToolInputSchema");function Syc(t,e,r,n){let o=t.get(HFi.IConfigurationService),s=t.get(byc.IExperimentationService),c=t.get(Cyc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===Rye.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 L=e.modelCapabilities?.enableToolSearch&&l&&!c.isNonDeferredTool(N.function.name),B={name:N.function.name,description:N.function.description||"",input_schema:YFi(N.function.parameters),...L?{defer_loading:!0}:{}};(L?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 L=e.postOptions.max_tokens??1024,B=n.minThinkingBudget??1024,q=16e30&&(!N||N.includes(q))&&(A=q)}}let y=e.modelCapabilities?.enableContextEditing&&(0,Rye.isAnthropicContextEditingEnabled)(n,o,s)?(0,Rye.getContextManagementFromConfig)(o,s,g):void 0,E=t.get($Fi.ILogService),_=t.get(zFi.ITelemetryService),v=f.length>0?new Set(f.map(N=>N.name)):void 0,b=KFi(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,Rye.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,P=(0,Rye.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;JFi(b),XFi(b,P),ZFi(f,b,R);let D=b.messages.at(-1);return D&&D.role==="assistant"&&(E.warn(`[messagesAPI] Trailing assistant message detected \u2014 appending synthetic user message to prevent prefill error. Total messages: ${b.messages.length}`),_.sendMSFTTelemetryEvent("messagesApi.trailingAssistantGuard",{model:r,location:vyc.ChatLocation.toString(e.location)},{messageCount:b.messages.length}),b.messages.push({role:"user",content:[{type:"text",text:"Please continue."}]})),{model:r,...b,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(Syc,"createMessagesRequestBody");function KFi(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case cN.Raw.ChatRole.System:{n.push(...cCt(c.content).filter(l=>l.type==="text"));break}case cN.Raw.ChatRole.User:{let l=cCt(c.content);l.length>0&&r.push({role:"user",content:l});break}case cN.Raw.ChatRole.Assistant:{let l=cCt(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 cN.Raw.ChatRole.Tool:{if(c.toolCallId){let l=cCt(c.content),u=!1;for(let g of l)gBe(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===Rye.CUSTOM_TOOL_SEARCH_NAME?Tyc(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(KFi,"rawMessagesToMessagesAPI");function Tyc(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(Tyc,"tryParseToolReferences");function cCt(t){let e=[],r=!1;for(let n of t){switch(n.type){case cN.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case cN.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 cN.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&gBe(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case cN.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 cN.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);gBe(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(cCt,"rawContentToAnthropicContent");function gBe(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(gBe,"contentBlockSupportsCacheControl");function JFi(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(JFi,"clearAllCacheControl");function ZFi(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(ZFi,"addToolsAndSystemCacheControl");function XFi(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"&&gBe(c))&&(Iyc(s,e),n++)}}a(XFi,"addMessagesApiCacheControl");function Iyc(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"&&gBe(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(Iyc,"markLastCacheableBlock");async function xyc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new GFi.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,$Nr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,VFi.getRequestId)(n.headers),h=t.createInstance(lCt,s,u,d,f),m=new _yc.SSEParser(g=>{try{r.trace(`[messagesAPI]SSE: ${g.data}`);let A=g.data?.trim();if(!A||A==="[DONE]")return;let y=JSON.parse(A),E=y.type??g.type;if(!E)return;let _=h.push({...y,type:E},o);if(_){r.info(`[messagesAPI] message ${_.choiceIndex} returned. finish reason: [${_.finishReason}]`);let v=s.extendedBy({completionChoiceFinishReason:_.finishReason,headerRequestId:_.requestId.headerRequestId});e.sendGHTelemetryEvent("completion.finishReason",v.properties,v.measurements);let b=(0,mBe.rawMessageToCAPI)(_.message),T=s;_.usage&&(T=s.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,WFi.sendEngineMessagesTelemetry)(e,[b],T,!0,r),l.emitOne(_)}}catch(A){l.reject(A)}});for await(let g of n.body)m.feed(g)},async()=>{await n.body.destroy()}):t8i(e,r,n,o,s)}a(xyc,"processResponseFromMessagesEndpoint");function wyc(t){switch(t){case"refusal":return mBe.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return mBe.FinishedCompletionReason.Length;default:return mBe.FinishedCompletionReason.Stop}}a(wyc,"mapStopReason");function e8i(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(e8i,"buildAnthropicCompletion");async function t8i(t,e,r,n,o){return new GFi.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,VFi.getRequestId)(r.headers),u=c||(0,$Nr.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,E=e8i({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: [${E.finishReason}]`);let _=o.extendedBy({completionChoiceFinishReason:E.finishReason,headerRequestId:E.requestId.headerRequestId});t.sendGHTelemetryEvent("completion.finishReason",_.properties,_.measurements);let v=(0,mBe.rawMessageToCAPI)(E.message),b=o;E.usage&&(b=o.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,WFi.sendEngineMessagesTelemetry)(t,[v],b,!0,e),s.emitOne(E)},async()=>{await r.body.destroy()})}a(t8i,"processNonStreamingResponseFromMessagesEndpoint");var lCt=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,$Nr.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 e8i({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}]})}}}};by.AnthropicMessagesProcessor=lCt;by.AnthropicMessagesProcessor=lCt=Eyc([jFi(4,$Fi.ILogService),jFi(5,zFi.ITelemetryService)],lCt)});var n8i=I(e9=>{"use strict";p();var Ryc=e9&&e9.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kyc=e9&&e9.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Pyc=e9&&e9.__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===jne.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(Dyc.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===jne.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===jne.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==jne.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:jne.Raw.ChatCompletionContentPartKind.Text,text:Nyc})})}a(Myc,"filterHistoryImages")});var Gne=I(_1=>{"use strict";p();var c8i=_1&&_1.__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},Om=_1&&_1.__param||function(t,e){return function(r,n){e(r,n,t)}},zNr;Object.defineProperty(_1,"__esModule",{value:!0});_1.RemoteAgentChatEndpoint=_1.ChatEndpoint=void 0;_1.defaultChatResponseProcessor=KNr;_1.defaultNonStreamChatResponseProcessor=A8i;var VNr=(Sne(),ba(bne)),i8i=Io(),Oyc=Qne(),l8i=nl(),o8i=zZe(),Lyc=T0(),u8i=Gs(),Byc=FE(),d8i=K6(),Fyc=jR(),Uyc=nBe(),Hne=Pl(),f8i=Sp(),s8i=Ovt(),Qyc=$6(),qyc=_y(),jyc=aCt(),Hyc=fBe(),p8i=X6(),Gyc=jvt(),h8i=mh(),$yc=gm(),m8i=K$(),Vyc=$E(),ABe=aBe(),g8i=J$(),yBe=s4e(),Wyc=qFi(),a8i=r8i(),WNr=zvt(),zyc=n8i();async function KNr(t,e,r,n,o,s,c){let u=(await Gyc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return l8i.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,Hyc.prepareChatCompletionForReturn)(t,e,f,s)})}a(KNr,"defaultChatResponseProcessor");async function A8i(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,Uyc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,Lyc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,Qyc.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 l8i.AsyncIterableObject.fromArray(s)}a(A8i,"defaultNonStreamChatResponseProcessor");var uCt=zNr=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,ABe.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer??Oyc.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,Wyc.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,ABe.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,ABe.modelSupportsContextEditing)(this),this._supportsStreaming=!!e.capabilities.supports.streaming,this.customModel=e.custom_model,this.maxPromptImages=e.capabilities.limits?.vision?.max_prompt_images}getExtraHeaders(e,r){let n={...this.modelMetadata.requestHeaders};if(this.useMessagesApi){let o=this._configurationService.getConfig(Hne.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,s8i.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,s8i.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:VNr.RequestType.ChatResponses}:this.useMessagesApi?{type:VNr.RequestType.ChatMessages}:{type:VNr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(yBe.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(yBe.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(yBe.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(yBe.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(Hne.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(yBe.ModelSupportedEndpoint.Messages))}get degradationReason(){return this.modelMetadata.warning_messages?.at(0)?.message??this.modelMetadata.info_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===i8i.OpenAI.ChatRole.System?{role:i8i.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(WNr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(a8i.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,jyc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,ABe.isAnthropicFamily)(this))return 20;if((0,ABe.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,zyc.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(Hne.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(Hne.ConfigKey.EnableGemini3LowReasoningEffort,this._expService)&&(e.reasoning_effort="low"),e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,WNr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,WNr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,a8i.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?KNr(e,r,n,o,s,c,l):A8i(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(Hne.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===Fyc.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(zNr,(0,o8i.mixin)((0,o8i.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};_1.ChatEndpoint=uCt;_1.ChatEndpoint=uCt=zNr=c8i([Om(1,g8i.IDomainService),Om(2,d8i.IChatMLFetcher),Om(3,m8i.ITokenizerProvider),Om(4,u8i.IInstantiationService),Om(5,Hne.IConfigurationService),Om(6,h8i.IExperimentationService),Om(7,p8i.IChatWebSocketManager),Om(8,f8i.ILogService)],uCt);var YNr=class extends uCt{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 KNr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};_1.RemoteAgentChatEndpoint=YNr;_1.RemoteAgentChatEndpoint=YNr=c8i([Om(2,g8i.IDomainService),Om(3,Vyc.ICAPIClientService),Om(4,qyc.IFetcherService),Om(5,$yc.ITelemetryService),Om(6,Byc.IAuthenticationService),Om(7,d8i.IChatMLFetcher),Om(8,m8i.ITokenizerProvider),Om(9,u8i.IInstantiationService),Om(10,Hne.IConfigurationService),Om(11,h8i.IExperimentationService),Om(12,p8i.IChatWebSocketManager),Om(13,f8i.ILogService)],YNr)});var y8i=I(uI=>{"use strict";p();var Yyc=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},lI=uI&&uI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(uI,"__esModule",{value:!0});uI.CopilotUtilityChatEndpoint=uI.CopilotUtilitySmallChatEndpoint=uI.CopilotChatEndpoint=void 0;var Kyc=Gs(),Jyc=FE(),Zyc=K6(),Xyc=Pl(),eEc=U4(),tEc=Sp(),rEc=_y(),nEc=X6(),iEc=mh(),oEc=gm(),sEc=K$(),aEc=$E(),cEc=J$(),lEc=Gne(),EBe=class extends lEc.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)}}};uI.CopilotChatEndpoint=EBe;uI.CopilotChatEndpoint=EBe=Yyc([lI(1,cEc.IDomainService),lI(2,aEc.ICAPIClientService),lI(3,rEc.IFetcherService),lI(4,eEc.IEnvService),lI(5,oEc.ITelemetryService),lI(6,Jyc.IAuthenticationService),lI(7,Zyc.IChatMLFetcher),lI(8,sEc.ITokenizerProvider),lI(9,Kyc.IInstantiationService),lI(10,Xyc.IConfigurationService),lI(11,iEc.IExperimentationService),lI(12,nEc.IChatWebSocketManager),lI(13,tEc.ILogService)],EBe);var JNr=class t{static{a(this,"CopilotUtilitySmallChatEndpoint")}static{this.capiFamily="gpt-4o-mini"}static async resolve(e,r){let n=await e.getChatModelFromCapiFamily(t.capiFamily);return r.createInstance(EBe,n)}};uI.CopilotUtilitySmallChatEndpoint=JNr;var ZNr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(EBe,n)}};uI.CopilotUtilityChatEndpoint=ZNr});var XNr=I(TL=>{"use strict";p();var uEc=TL&&TL.__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},dI=TL&&TL.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(TL,"__esModule",{value:!0});TL.AutoChatEndpoint=void 0;TL.isAutoModel=xEc;var dEc=Gs(),fEc=FE(),pEc=K6(),hEc=Pl(),mEc=U4(),gEc=Sp(),AEc=_y(),yEc=X6(),EEc=mh(),_Ec=gm(),vEc=K$(),CEc=$E(),bEc=J$(),SEc=Gne(),TEc=y8i(),_Be=class extends TEc.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(IEc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,E,_),this.discountRange=o}};TL.AutoChatEndpoint=_Be;TL.AutoChatEndpoint=_Be=uEc([dI(4,bEc.IDomainService),dI(5,CEc.ICAPIClientService),dI(6,AEc.IFetcherService),dI(7,mEc.IEnvService),dI(8,_Ec.ITelemetryService),dI(9,fEc.IAuthenticationService),dI(10,pEc.IChatMLFetcher),dI(11,vEc.ITokenizerProvider),dI(12,dEc.IInstantiationService),dI(13,hEc.IConfigurationService),dI(14,EEc.IExperimentationService),dI(15,yEc.IChatWebSocketManager),dI(16,gEc.ILogService)],_Be);function IEc(t,e,r){let n;t instanceof SEc.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(IEc,"calculateAutoModelInfo");function xEc(t){return t&&(t.model===_Be.pseudoModelId||t instanceof _Be)?1:-1}a(xEc,"isAutoModel")});var tMr=I(vBe=>{"use strict";p();Object.defineProperty(vBe,"__esModule",{value:!0});vBe.getImageTelemetryEventMeasurements=wEc;vBe.getImageTelemetryMeasurementsFromMessages=REc;vBe.getImageTelemetryMeasurementsFromReferences=kEc;var b8i=PNr(),E8i="screenshot-focused-window";function S8i(){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(S8i,"createEmptyImageTelemetryMeasurements");function wEc(t){return t.imageCount>0?t:{}}a(wEc,"getImageTelemetryEventMeasurements");function REc(t){let e=S8i();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=UEc(n,"imageUrl"),s=eMr(o,"url");if(!s)continue;let c=PEc(s,eMr(o,"mediaType"));c&&T8i(e,c)}return e}a(REc,"getImageTelemetryMeasurementsFromMessages");function kEc(t){let e=S8i();for(let r of t??[]){let n=kye(r.value);if(!n)continue;let o=eMr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=v8i(n.data)??v8i(n.value);T8i(e,{mimeType:o,byteLength:s?.byteLength??C8i(n.data)??C8i(n.value),dimensions:MEc(s,o),source:OEc(r,n)})}return e}a(kEc,"getImageTelemetryMeasurementsFromReferences");function T8i(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),DEc(t,e.dimensions),I8i(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(T8i,"addImageTelemetryInput");function PEc(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:LEc(r[2]),dimensions:NEc(t),source:"unknown"}}a(PEc,"getImageTelemetryInputFromUrl");function DEc(t,e){if(!e||!_8i(e.width)||!_8i(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(DEc,"addImageDimensions");function _8i(t){return Number.isFinite(t)&&t>0}a(_8i,"isValidDimension");function NEc(t){try{return(0,b8i.getImageDimensions)(t)}catch{return}}a(NEc,"getImageDimensionsFromDataUrl");function MEc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||I8i(r)==="unknown"))try{return(0,b8i.getImageDimensionsFromBytes)(t,r)}catch{return}}a(MEc,"getImageDimensionsFromBytes");function I8i(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(I8i,"normalizeMimeType");function OEc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===E8i||e.id===E8i?"screenshot":e.isURL===!1?"file":"unknown"}a(OEc,"getImageSourceFromReference");function LEc(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(LEc,"getBase64ByteLength");function v8i(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=kye(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(BEc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(FEc))return new Uint8Array(o)}a(v8i,"getByteData");function BEc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(BEc,"isArrayIndexKey");function FEc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(FEc,"isByteValue");function C8i(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=kye(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(C8i,"getByteLength");function UEc(t,e){return kye(kye(t)?.[e])}a(UEc,"getObjectProperty");function eMr(t,e){let r=kye(t)?.[e];return typeof r=="string"?r:void 0}a(eMr,"getStringProperty");function kye(t){return typeof t=="object"&&t!==null?t:void 0}a(kye,"asRecord")});var R8i=I(Pye=>{"use strict";p();Object.defineProperty(Pye,"__esModule",{value:!0});Pye.ChatFailKind=Pye.FetchResponseKind=void 0;var x8i;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(x8i||(Pye.FetchResponseKind=x8i={}));var w8i;(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"})(w8i||(Pye.ChatFailKind=w8i={}))});var CBe=I(Mu=>{"use strict";p();Object.defineProperty(Mu,"__esModule",{value:!0});Mu.FILE_TOOL_NAMES=Mu.SHELL_TOOL_NAMES=Mu.TOOL_PARAM_COMMAND_MAX_LEN=Mu.GitHubCopilotAttr=Mu.CopilotCliSdkAttr=Mu.StdAttr=Mu.CopilotChatAttr=Mu.GenAiAttr=Mu.GenAiToolType=Mu.GenAiTokenType=Mu.GenAiProviderName=Mu.GenAiOperationName=void 0;Mu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};Mu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};Mu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};Mu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};Mu.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"};Mu.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"};Mu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};Mu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};Mu.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"};Mu.TOOL_PARAM_COMMAND_MAX_LEN=256;Mu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);Mu.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 nMr=I(VR=>{"use strict";p();Object.defineProperty(VR,"__esModule",{value:!0});VR.truncateForOTel=QEc;VR.toInputMessages=qEc;VR.toOutputMessages=jEc;VR.toSystemInstructions=HEc;VR.extractTextFromContent=rMr;VR.collectSystemTextsFromRequestBody=GEc;VR.normalizeProviderMessages=$Ec;VR.toToolDefinitions=D8i;VR.stringifyToolDefinitionsForOTel=ZEc;VR.stringifyToolsRawForTelemetry=XEc;function QEc(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(QEc,"truncateForOTel");function qEc(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(qEc,"toInputMessages");function jEc(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(jEc,"toOutputMessages");function HEc(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(HEc,"toSystemInstructions");function rMr(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(rMr,"extractTextFromContent");function GEc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=rMr(n.content);o&&e.push(o)}}if(e.length===0){let n=rMr(t.system??t.instructions);n&&e.push(n)}return e}a(GEc,"collectSystemTextsFromRequestBody");function $Ec(t){return t.map(e=>{switch(e.type){case"function_call":return VEc(e);case"function_call_output":return WEc(e);case"tool_search_output":return zEc(e);case"reasoning":return YEc(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($Ec,"normalizeProviderMessages");function VEc(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(VEc,"normalizeResponsesFunctionCall");function WEc(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(WEc,"normalizeResponsesFunctionCallOutput");function zEc(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(zEc,"normalizeResponsesToolSearchOutput");function YEc(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(YEc,"normalizeResponsesReasoning");function D8i(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(D8i,"toToolDefinitions");var k8i=new WeakMap,P8i=new WeakMap,dCt,fCt;function KEc(t){return dCt!==void 0&&dCt===t?dCt:(dCt=t,t)}a(KEc,"internToolDefsString");function JEc(t){return fCt!==void 0&&fCt===t?fCt:(fCt=t,t)}a(JEc,"internToolsRawString");function ZEc(t){if(!t||t.length===0)return;let e=k8i.get(t);if(e!==void 0)return e;let r=D8i(t);if(!r)return;let n=KEc(JSON.stringify(r));return k8i.set(t,n),n}a(ZEc,"stringifyToolDefinitionsForOTel");function XEc(t){if(!t)return;let e=P8i.get(t);if(e!==void 0)return e;let r=JEc(JSON.stringify(t));return P8i.set(t,r),r}a(XEc,"stringifyToolsRawForTelemetry")});var iMr=I(pCt=>{"use strict";p();Object.defineProperty(pCt,"__esModule",{value:!0});pCt.resolveWorkspaceOTelMetadata=e_c;pCt.workspaceMetadataToOTelAttributes=r_c;var N8i=ZP(),M8i=FPr(),Z$=CBe();function e_c(t,e){let r=t.activeRepository?.get();return r?t_c(r,e):{}}a(e_c,"resolveWorkspaceOTelMetadata");function t_c(t,e){let r,n=Array.from((0,M8i.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,M8i.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,N8i.isEqualOrParent)(e,t.rootUri)&&(o=(0,N8i.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(t_c,"buildWorkspaceMetadata");function r_c(t){if(!t)return{};let e={};if(t.headBranchName&&(e[Z$.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[Z$.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[Z$.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[Z$.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[Z$.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[Z$.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=n_c(t.remoteUrl);r&&(e[Z$.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[Z$.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(r_c,"workspaceMetadataToOTelAttributes");function n_c(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(n_c,"extractGitHubOrg")});var O8i=I(WR=>{"use strict";p();Object.defineProperty(WR,"__esModule",{value:!0});WR.emitInferenceDetailsEvent=i_c;WR.emitSessionStartEvent=o_c;WR.emitToolCallEvent=s_c;WR.emitAgentTurnEvent=a_c;WR.emitEditFeedbackEvent=c_c;WR.emitEditHunkActionEvent=l_c;WR.emitInlineDoneEvent=u_c;WR.emitEditSurvivalEvent=d_c;WR.emitUserFeedbackEvent=f_c;WR.emitCloudSessionInvokeEvent=p_c;var Lm=CBe(),Dye=nMr(),hCt=iMr();function i_c(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[Lm.GenAiAttr.OPERATION_NAME]:Lm.GenAiOperationName.CHAT,[Lm.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[Lm.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[Lm.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[Lm.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[Lm.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[Lm.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[Lm.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[Lm.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[Lm.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[Lm.GenAiAttr.INPUT_MESSAGES]=(0,Dye.truncateForOTel)(JSON.stringify(c?(0,Dye.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,Dye.toSystemInstructions)(c);l!==void 0&&(o[Lm.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,Dye.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,Dye.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[Lm.GenAiAttr.TOOL_DEFINITIONS]=(0,Dye.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(i_c,"emitInferenceDetailsEvent");function o_c(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[Lm.GenAiAttr.REQUEST_MODEL]:r,[Lm.GenAiAttr.AGENT_NAME]:n})}a(o_c,"emitSessionStartEvent");function s_c(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[Lm.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[Lm.StdAttr.ERROR_TYPE]:o}:{}})}a(s_c,"emitToolCallEvent");function a_c(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[Lm.GenAiAttr.USAGE_INPUT_TOKENS]:r,[Lm.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(a_c,"emitAgentTurnEvent");function c_c(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,hCt.workspaceMetadataToOTelAttributes)(u)})}a(c_c,"emitEditFeedbackEvent");function l_c(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,hCt.workspaceMetadataToOTelAttributes)(l)})}a(l_c,"emitEditHunkActionEvent");function u_c(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,hCt.workspaceMetadataToOTelAttributes)(l)})}a(u_c,"emitInlineDoneEvent");function d_c(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,hCt.workspaceMetadataToOTelAttributes)(l)})}a(d_c,"emitEditSurvivalEvent");function f_c(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(f_c,"emitUserFeedbackEvent");function p_c(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(p_c,"emitCloudSessionInvokeEvent")});var L8i=I(mCt=>{"use strict";p();Object.defineProperty(mCt,"__esModule",{value:!0});mCt.GenAiMetrics=void 0;var No=CBe(),oMr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[No.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[No.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[No.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[No.GenAiAttr.OPERATION_NAME]:o.operationName,[No.GenAiAttr.PROVIDER_NAME]:o.providerName,[No.GenAiAttr.TOKEN_TYPE]:n,[No.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[No.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[No.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[No.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[No.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[No.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[No.GenAiAttr.REQUEST_MODEL]:r})}static recordTimeToFirstChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_to_first_chunk",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static recordTimePerOutputChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_per_output_chunk",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.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,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[No.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[No.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[No.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[No.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?{[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n}:{}})}static incrementCloudPrReadyCount(e,r){e.incrementCounter("copilot_chat.cloud.pr_ready.count",1,r?{[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:r}:void 0)}static recordCloudOperation(e,r,n,o,s){e.incrementCounter("copilot_chat.cloud.operation.count",1,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,success:o}),s!==void 0&&e.recordMetric("copilot_chat.cloud.operation.duration",s,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n})}static incrementCloudError(e,r,n,o){e.incrementCounter("copilot_chat.cloud.error.count",1,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,[No.StdAttr.ERROR_TYPE]:o})}};mCt.GenAiMetrics=oMr});var aMr=I(gCt=>{"use strict";p();Object.defineProperty(gCt,"__esModule",{value:!0});gCt.NoopOTelService=void 0;var B8i=Ic(),F8i={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},sMr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=B8i.Event.None,this.onDidEmitSpanEvent=B8i.Event.None,this.config=e}startSpan(e,r){return F8i}startActiveSpan(e,r,n){return n(F8i)}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){}};gCt.NoopOTelService=sMr});var cMr=I($ne=>{"use strict";p();Object.defineProperty($ne,"__esModule",{value:!0});$ne.DEFAULT_OTLP_ENDPOINT=void 0;$ne.resolveOTelConfig=g_c;$ne.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function h_c(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(h_c,"parseResourceAttributes");function m_c(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(m_c,"parseOtlpEndpoint");function g_c(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return U8i(t);let r=t.settingDbSpanExporter??!1,n=(bBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)||r,o=(bBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)===!0;if(!n)return U8i(t);let s;bBe(e.COPILOT_OTEL_ENABLED)===!0?s="envVar":t.settingEnabled===!0?s="setting":e.OTEL_EXPORTER_OTLP_ENDPOINT?s="otlpEndpointEnvVar":s="dbSpanExporterOnly";let l=(e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL)==="grpc"?"grpc":"http",u=e.COPILOT_OTEL_ENDPOINT??e.OTEL_EXPORTER_OTLP_ENDPOINT??t.settingOtlpEndpoint??$ne.DEFAULT_OTLP_ENDPOINT,d=m_c(u,l)??$ne.DEFAULT_OTLP_ENDPOINT,f=e.COPILOT_OTEL_FILE_EXPORTER_PATH??t.settingOutfile,h;f?h="file":t.settingExporterType?h=t.settingExporterType:h=l==="grpc"?"otlp-grpc":"otlp-http";let m=bBe(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,g=A_c(e.COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS)??t.settingMaxAttributeSizeChars??0,A=new Set(["trace","debug","info","warn","error"]),y=e.COPILOT_OTEL_LOG_LEVEL,E=y&&A.has(y)?y:"info",_=bBe(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,v=e.OTEL_SERVICE_NAME??"copilot-chat",b=h_c(e.OTEL_RESOURCE_ATTRIBUTES);return Object.freeze({enabled:!0,enabledExplicitly:o,enabledVia:s,exporterType:h,otlpEndpoint:d,otlpProtocol:l,captureContent:m,maxAttributeSizeChars:g<0?0:g,fileExporterPath:f,dbSpanExporter:r,logLevel:E,httpInstrumentation:_,serviceName:v,serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:b})}a(g_c,"resolveOTelConfig");function U8i(t){return Object.freeze({enabled:!1,enabledExplicitly:!1,enabledVia:"disabled",exporterType:"otlp-http",otlpEndpoint:"",otlpProtocol:"http",captureContent:!1,maxAttributeSizeChars:0,dbSpanExporter:!1,logLevel:"info",httpInstrumentation:!1,serviceName:"copilot-chat",serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:{}})}a(U8i,"createDisabledConfig");function bBe(t){if(t!==void 0)return t==="true"||t==="1"}a(bBe,"envBool");function A_c(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(A_c,"parseMaxAttributeSizeChars")});var yCt=I(ACt=>{"use strict";p();Object.defineProperty(ACt,"__esModule",{value:!0});ACt.IOTelService=void 0;var y_c=nn();ACt.IOTelService=(0,y_c.createServiceIdentifier)("IOTelService")});var Q8i=I(lMr=>{"use strict";p();Object.defineProperty(lMr,"__esModule",{value:!0});lMr.normalizeResponseModel=E_c;function E_c(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(E_c,"normalizeResponseModel")});var H8i=I(Br=>{"use strict";p();Object.defineProperty(Br,"__esModule",{value:!0});Br.workspaceMetadataToOTelAttributes=Br.resolveWorkspaceOTelMetadata=Br.normalizeResponseModel=Br.IOTelService=Br.DEFAULT_OTLP_ENDPOINT=Br.resolveOTelConfig=Br.NoopOTelService=Br.truncateForOTel=Br.toToolDefinitions=Br.toSystemInstructions=Br.toOutputMessages=Br.toInputMessages=Br.stringifyToolsRawForTelemetry=Br.stringifyToolDefinitionsForOTel=Br.normalizeProviderMessages=Br.extractTextFromContent=Br.collectSystemTextsFromRequestBody=Br.GenAiMetrics=Br.emitUserFeedbackEvent=Br.emitToolCallEvent=Br.emitSessionStartEvent=Br.emitInlineDoneEvent=Br.emitInferenceDetailsEvent=Br.emitEditSurvivalEvent=Br.emitEditHunkActionEvent=Br.emitEditFeedbackEvent=Br.emitCloudSessionInvokeEvent=Br.emitAgentTurnEvent=Br.TOOL_PARAM_COMMAND_MAX_LEN=Br.StdAttr=Br.SHELL_TOOL_NAMES=Br.GitHubCopilotAttr=Br.GenAiToolType=Br.GenAiTokenType=Br.GenAiProviderName=Br.GenAiOperationName=Br.GenAiAttr=Br.FILE_TOOL_NAMES=Br.CopilotCliSdkAttr=Br.CopilotChatAttr=void 0;var zR=CBe();Object.defineProperty(Br,"CopilotChatAttr",{enumerable:!0,get:a(function(){return zR.CopilotChatAttr},"get")});Object.defineProperty(Br,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return zR.CopilotCliSdkAttr},"get")});Object.defineProperty(Br,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return zR.FILE_TOOL_NAMES},"get")});Object.defineProperty(Br,"GenAiAttr",{enumerable:!0,get:a(function(){return zR.GenAiAttr},"get")});Object.defineProperty(Br,"GenAiOperationName",{enumerable:!0,get:a(function(){return zR.GenAiOperationName},"get")});Object.defineProperty(Br,"GenAiProviderName",{enumerable:!0,get:a(function(){return zR.GenAiProviderName},"get")});Object.defineProperty(Br,"GenAiTokenType",{enumerable:!0,get:a(function(){return zR.GenAiTokenType},"get")});Object.defineProperty(Br,"GenAiToolType",{enumerable:!0,get:a(function(){return zR.GenAiToolType},"get")});Object.defineProperty(Br,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return zR.GitHubCopilotAttr},"get")});Object.defineProperty(Br,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return zR.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Br,"StdAttr",{enumerable:!0,get:a(function(){return zR.StdAttr},"get")});Object.defineProperty(Br,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return zR.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var IL=O8i();Object.defineProperty(Br,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return IL.emitAgentTurnEvent},"get")});Object.defineProperty(Br,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return IL.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Br,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return IL.emitEditFeedbackEvent},"get")});Object.defineProperty(Br,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return IL.emitEditHunkActionEvent},"get")});Object.defineProperty(Br,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return IL.emitEditSurvivalEvent},"get")});Object.defineProperty(Br,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return IL.emitInferenceDetailsEvent},"get")});Object.defineProperty(Br,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return IL.emitInlineDoneEvent},"get")});Object.defineProperty(Br,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return IL.emitSessionStartEvent},"get")});Object.defineProperty(Br,"emitToolCallEvent",{enumerable:!0,get:a(function(){return IL.emitToolCallEvent},"get")});Object.defineProperty(Br,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return IL.emitUserFeedbackEvent},"get")});var __c=L8i();Object.defineProperty(Br,"GenAiMetrics",{enumerable:!0,get:a(function(){return __c.GenAiMetrics},"get")});var xL=nMr();Object.defineProperty(Br,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return xL.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Br,"extractTextFromContent",{enumerable:!0,get:a(function(){return xL.extractTextFromContent},"get")});Object.defineProperty(Br,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return xL.normalizeProviderMessages},"get")});Object.defineProperty(Br,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return xL.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Br,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return xL.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Br,"toInputMessages",{enumerable:!0,get:a(function(){return xL.toInputMessages},"get")});Object.defineProperty(Br,"toOutputMessages",{enumerable:!0,get:a(function(){return xL.toOutputMessages},"get")});Object.defineProperty(Br,"toSystemInstructions",{enumerable:!0,get:a(function(){return xL.toSystemInstructions},"get")});Object.defineProperty(Br,"toToolDefinitions",{enumerable:!0,get:a(function(){return xL.toToolDefinitions},"get")});Object.defineProperty(Br,"truncateForOTel",{enumerable:!0,get:a(function(){return xL.truncateForOTel},"get")});var v_c=aMr();Object.defineProperty(Br,"NoopOTelService",{enumerable:!0,get:a(function(){return v_c.NoopOTelService},"get")});var q8i=cMr();Object.defineProperty(Br,"resolveOTelConfig",{enumerable:!0,get:a(function(){return q8i.resolveOTelConfig},"get")});Object.defineProperty(Br,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return q8i.DEFAULT_OTLP_ENDPOINT},"get")});var C_c=yCt();Object.defineProperty(Br,"IOTelService",{enumerable:!0,get:a(function(){return C_c.IOTelService},"get")});var b_c=Q8i();Object.defineProperty(Br,"normalizeResponseModel",{enumerable:!0,get:a(function(){return b_c.normalizeResponseModel},"get")});var j8i=iMr();Object.defineProperty(Br,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return j8i.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Br,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return j8i.workspaceMetadataToOTelAttributes},"get")})});var fMr=I(X$=>{"use strict";p();Object.defineProperty(X$,"__esModule",{value:!0});X$.AbstractRequestLogger=void 0;X$.getCurrentCapturingToken=x_c;X$.storeCapturingTokenForCorrelation=w_c;X$.retrieveCapturingTokenByCorrelation=R_c;X$.runWithCapturingToken=k_c;var S_c=require("async_hooks"),T_c=lye(),I_c=Ro(),SBe=new S_c.AsyncLocalStorage,uMr=new Map;function x_c(){return SBe.getStore()}a(x_c,"getCurrentCapturingToken");function w_c(t){let e=SBe.getStore();e&&uMr.set(t,e)}a(w_c,"storeCapturingTokenForCorrelation");function R_c(t){let e=uMr.get(t);return e&&uMr.delete(t),e}a(R_c,"retrieveCapturingTokenByCorrelation");function k_c(t,e){return SBe.run(t,e)}a(k_c,"runWithCapturingToken");var dMr=class extends I_c.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return SBe.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new T_c.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return SBe.getStore()}};X$.AbstractRequestLogger=dMr});var G8i=I(pMr=>{"use strict";p();Object.defineProperty(pMr,"__esModule",{value:!0});pMr.isEncryptedThinkingDelta=P_c;function P_c(t){return t.encrypted!==void 0}a(P_c,"isEncryptedThinkingDelta")});var V8i=I(ECt=>{"use strict";p();Object.defineProperty(ECt,"__esModule",{value:!0});ECt.calculateLineRepetitionStats=N_c;ECt.isRepetitive=M_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},{max_token_sequence_length:60,last_tokens_to_consider:120}];function N_c(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(N_c,"calculateLineRepetitionStats");function M_c(t){let e=t.slice();return e.reverse(),$8i(e)||$8i(e.filter(r=>r.trim().length>0))}a(M_c,"isRepetitive");function $8i(t){let e=O_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(O_c,"kmp_prefix_function")});var hMr=I(wL=>{"use strict";p();var L_c=wL&&wL.__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},eV=wL&&wL.__param||function(t,e){return function(r,n){e(r,n,t)}},YR;Object.defineProperty(wL,"__esModule",{value:!0});wL.OpenAIEndpoint=void 0;wL.isBYOKModel=z_c;var B_c=K6(),W8i=jR(),z8i=Pl(),F_c=J$(),U_c=Gne(),Q_c=Sp(),q_c=$6(),j_c=aCt(),H_c=X6(),G_c=mh(),$_c=K$(),V_c=Gs();function W_c(t){return t.type===W8i.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===W8i.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 Jgc.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...uFi(c,l),top_logprobs:l.top_logprobs?.map(u=>uFi(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:X6.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:X6.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:X6.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=xAc(s.response.output,this.latestCompactionOutputIndex),l=pFi(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,_Nr.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,_Nr.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:Of.FinishedCompletionReason.Stop,message:{role:Xi.Raw.ChatRole.Assistant,content:c.map(h=>{if(h.type==="message")return{type:Xi.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:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:h.result}}}).filter(bL.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=Of.FinishedCompletionReason.Length:c==="content_filter"?(l=Of.FinishedCompletionReason.ContentFilter,u=RAc(s.content_filters)):l=Of.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:lFi(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,Of.FinishedCompletionReason.ServerError,{error:lFi(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:Xi.Raw.ChatRole.Assistant,content:o.map(s=>{if(s.type==="message")return{type:Xi.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:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:s.result}}}).filter(bL.isDefined)}}}};Qv.OpenAIResponsesProcessor=zvt;Qv.OpenAIResponsesProcessor=zvt=Wgc([zgc(6,eAc.ILogService)],zvt);function uFi(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,Kgc.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(uFi,"mapLogProp")});var mFi=I(Kvt=>{"use strict";p();Object.defineProperty(Kvt,"__esModule",{value:!0});Kvt.ChatWebSocketTelemetrySender=void 0;var TNr=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})}};Kvt.ChatWebSocketTelemetrySender=TNr});var e9=I(E1=>{"use strict";p();var kAc=E1&&E1.__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},Jvt=E1&&E1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(E1,"__esModule",{value:!0});E1.ChatWebSocketManager=E1.NullChatWebSocketManager=E1.IChatWebSocketManager=void 0;E1.isCAPIWebSocketError=kNr;var PAc=nn(),DAc=Rs(),Zvt=Ic(),gFi=ko(),AFi=Pl(),NAc=$E(),Rye=Sp(),MAc=gm(),OAc=_y(),LAc=Yvt(),Y$=mFi();E1.IChatWebSocketManager=(0,PAc.createServiceIdentifier)("IChatWebSocketManager");var INr=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(){}};E1.NullChatWebSocketManager=INr;function kNr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(kNr,"isCAPIWebSocketError");var BAc={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function FAc(t){return BAc[t.type]}a(FAc,"getStreamTerminatingOutcome");var xNr=class extends gFi.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 wNr(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()}};E1.ChatWebSocketManager=xNr;E1.ChatWebSocketManager=xNr=kAc([Jvt(0,Rye.ILogService),Jvt(1,NAc.ICAPIClientService),Jvt(2,MAc.ITelemetryService),Jvt(3,AFi.IConfigurationService)],xNr);function Xvt(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(Xvt,"wsCloseCodeToString");var wNr=class extends gFi.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 Zvt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new OAc.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}`),Y$.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,Rye.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,Rye.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})`:""}`),Y$.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=Xvt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),Y$.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,Rye.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),Y$.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}!kNr(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=Xvt(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})`),Y$.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,Rye.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}`),Y$.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(O=>O?.type==="compaction")??!1,l=r.summarizedAtRoundId!==void 0,u=r.summarizedAtRoundId===this._summarizedAtRoundId,d=(0,LAc.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,E=Date.now(),_=this._totalSentMessageCount,v=this._totalReceivedMessageCount,b=this._totalSentCharacters,T=this._totalReceivedCharacters,w=r.countTokens(),R=-1;w.then(O=>{R=O},()=>{R=-2});let x=new RNr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:O,closeCode:j,closeReason:Q,serverErrorMessage:U,serverErrorCode:Y})=>{this._activeRequest===x&&(this._activeRequest=void 0);let W=Date.now()-(this._connectedTime??Date.now()),V=Date.now()-E,z=this._totalSentMessageCount-_,ie=this._totalReceivedMessageCount-v,H=this._totalSentCharacters-b,re=this._totalReceivedCharacters-T;Y$.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:O,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:j,closeReason:Q,serverErrorMessage:U,serverErrorCode:Y})}),this._activeRequest=x;let P=n.onCancellationRequested(()=>{this._activeRequest===x&&(x.handleCancellation(),this._activeRequest=void 0)});x.done.finally(()=>P.dispose()).catch(()=>{});let{stream:D,...N}=e,L={type:"response.create",...N,initiator:r.userInitiated?"user":"agent"},B=JSON.stringify(L),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})`),Y$.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()}},RNr=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 Zvt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new Zvt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new Zvt.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(AFi.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,Rye.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),kNr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=FAc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${Xvt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${Xvt(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 DAc.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 DNr=I(SL=>{"use strict";p();Object.defineProperty(SL,"__esModule",{value:!0});SL.getImageDimensions=UAc;SL.getImageDimensionsFromBytes=QAc;SL.getPngDimensions=yFi;SL.getGifDimensions=EFi;SL.getJpegDimensions=_Fi;SL.getWebPDimensions=SFi;SL.getMimeType=xFi;SL.extractImageAttributes=HAc;function UAc(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(xFi(e)){case"image/png":return yFi(e);case"image/gif":return EFi(e);case"image/jpeg":case"image/jpg":return _Fi(e);case"image/webp":return SFi(e);default:throw new Error("Unsupported image format")}}a(UAc,"getImageDimensions");function QAc(t,e){switch(qAc(e)){case"image/png":return vFi(t);case"image/gif":return CFi(t);case"image/jpeg":case"image/jpg":return bFi(t);case"image/webp":return TFi(t);default:throw new Error("Unsupported image format")}}a(QAc,"getImageDimensionsFromBytes");function yFi(t){return vFi(eCt(t.slice(0,50)))}a(yFi,"getPngDimensions");function EFi(t){return CFi(eCt(t.slice(0,50)))}a(EFi,"getGifDimensions");function _Fi(t){return bFi(eCt(t))}a(_Fi,"getJpegDimensions");function vFi(t){if(!IFi(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(vFi,"getPngDimensionsFromBytes");function CFi(t){if(!PNr(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(CFi,"getGifDimensionsFromBytes");function bFi(t){if(!IFi(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(bFi,"getJpegDimensionsFromBytes");function SFi(t){return TFi(eCt(t))}a(SFi,"getWebPDimensions");function TFi(t){if(!PNr(t,0,"RIFF")||!PNr(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=jAc(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(TFi,"getWebPDimensionsFromBytes");function qAc(t){return t?.toLowerCase().split(";")[0].trim()}a(qAc,"normalizeMimeType");function eCt(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(eCt,"base64ToBytes");function IFi(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(tCt,"__esModule",{value:!0});tCt.TokenizerType=void 0;var wFi;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(wFi||(tCt.TokenizerType=wFi={}))});var MNr=I(qne=>{"use strict";p();Object.defineProperty(qne,"__esModule",{value:!0});qne.WorkerWithRpcProxy=qne.RcpResponseHandler=void 0;qne.createRpcProxy=RFi;var GAc=require("worker_threads"),rCt=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()}};qne.RcpResponseHandler=rCt;function RFi(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(RFi,"createRpcProxy");var NNr=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new rCt,this.worker=new GAc.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=RFi((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)}};qne.WorkerWithRpcProxy=NNr});var kFi=I(VR=>{"use strict";p();Object.defineProperty(VR,"__esModule",{value:!0});VR.SlidingWindowAverage=VR.MovingAverage=VR.Counter=void 0;VR.clamp=VAc;VR.rot=WAc;VR.isPointWithinTriangle=zAc;VR.randomChance=YAc;var $Ac=rd();function VAc(t,e,r){return Math.min(Math.max(t,e),r)}a(VAc,"clamp");function WAc(t,e){return(e+t%e)%e}a(WAc,"rot");var ONr=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};VR.Counter=ONr;var LNr=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}};VR.MovingAverage=LNr;var BNr=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(zAc,"isPointWithinTriangle");function YAc(t){return(0,$Ac.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(iCt,"__esModule",{value:!0});iCt.TikTokenImpl=void 0;var FNr=oTr(),nCt=kFi(),KAc=FO(),JAc=lTr(),UNr=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new nCt.MovingAverage,textLength:new nCt.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?JAc.parseTikTokenBinary:c=>c;return this._values.push((0,FNr.createTokenizer)(s(e),(0,FNr.getSpecialTokensByEncoder)(r),(0,FNr.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=KAc.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 nCt.MovingAverage,this._stats.textLength=new nCt.MovingAverage,this._stats.callCount=0,r}};iCt.TikTokenImpl=UNr});var J$=I(Rp=>{"use strict";p();var MFi=Rp&&Rp.__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},OFi=Rp&&Rp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.TokenizerProvider=Rp.BaseTokensPerName=Rp.BaseTokensPerMessage=Rp.BaseTokensPerCompletion=Rp.ITokenizerProvider=void 0;Rp.calculateImageTokenCost=HNr;Rp.estimateDocumentTokenCost=BFi;var K$=xo(),ZAc=mDr(),XAc=DNr(),eyc=nn(),DFi=Qne(),tyc=MNr(),ryc=rd(),NFi=tF(),QNr=ko(),oCt=NA(),LFi=gm(),qNr=PFi();Rp.ITokenizerProvider=(0,eyc.createServiceIdentifier)("ITokenizerProvider");Rp.BaseTokensPerCompletion=3;Rp.BaseTokensPerMessage=3;Rp.BaseTokensPerName=1;var jNr=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new NFi.Lazy(()=>new sCt(e,(0,oCt.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new NFi.Lazy(()=>new sCt(e,(0,oCt.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case DFi.TokenizerType.CL100K:return this._cl100kTokenizer.value;case DFi.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};Rp.TokenizerProvider=jNr;Rp.TokenizerProvider=jNr=MFi([OFi(1,LFi.ITelemetryService)],jNr);var sCt=class extends QNr.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 ZAc.LRUCache(5e3),this.baseTokensPerMessage=Rp.BaseTokensPerMessage,this.baseTokensPerName=Rp.BaseTokensPerName,this.mode=K$.OutputMode.Raw}async countMessagesTokens(e){let r=Rp.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 K$.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case K$.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case K$.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return HNr(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case K$.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case K$.Raw.ChatCompletionContentPartKind.Document:return BFi(e.documentData.data);default:(0,ryc.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,K$.toMode)(K$.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+=HNr(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,oCt.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,oCt.join)(__dirname,"tikTokenizerWorker.js"),n=new tyc.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,QNr.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=qNr.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,QNr.toDisposable)(()=>{qNr.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>qNr.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};sCt=MFi([OFi(3,LFi.ITelemetryService)],sCt);function HNr(t,e){let{width:r,height:n}=(0,XAc.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(HNr,"calculateImageTokenCost");function BFi(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(BFi,"estimateDocumentTokenCost")});var Z$=I(aCt=>{"use strict";p();Object.defineProperty(aCt,"__esModule",{value:!0});aCt.IDomainService=void 0;var nyc=nn();aCt.IDomainService=(0,nyc.createServiceIdentifier)("IDomainService")});var cCt=I(qv=>{"use strict";p();Object.defineProperty(qv,"__esModule",{value:!0});qv.HeaderContributors=qv.IHeaderContributors=qv.userAgentLibraryHeader=void 0;qv.stringifyUrlOrRequestMetadata=fyc;qv.isCAPIRequestMetadata=$Nr;qv.isCAPIEndpoint=pyc;qv.createCapiRequestBody=hyc;qv.canRetryOnceNetworkError=UFi;qv.postRequest=myc;qv.getRequest=gyc;var iyc=nn(),oyc=Qne(),syc=Rs(),ayc=$E(),cyc=gm(),lyc=_y(),uyc=G6();qv.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var dyc=30*1e3;function fyc(t){return typeof t=="string"?t:JSON.stringify(t)}a(fyc,"stringifyUrlOrRequestMetadata");function $Nr(t){return typeof t!="string"}a($Nr,"isCAPIRequestMetadata");function pyc(t){return $Nr(t.urlOrRequestMetadata)}a(pyc,"isCAPIEndpoint");function hyc(t,e,r){let n={messages:(0,uyc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a(hyc,"createCapiRequestBody");function FFi(t,e){let r=t.get(lyc.IFetcherService),n=t.get(cyc.ITelemetryService),o=t.get(ayc.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,E=typeof c=="string"||"type"in c?{modelMaxPromptTokens:0,urlOrRequestMetadata:c,family:"",tokenizer:oyc.TokenizerType.O200K,acquireTokenizer:a(()=>{throw new Error("Method not implemented.")},"acquireTokenizer"),name:"",version:""}:c,_=e.interactionTypeOverride??u,v={...l?{Authorization:`Bearer ${l}`}:{},"X-Request-Id":d,"OpenAI-Intent":u,"X-GitHub-Api-Version":"2026-01-09",...h,...E.getExtraHeaders?E.getExtraHeaders(y,e.interactionTypeOverride):{}};v["X-Interaction-Type"]=_,v["X-Agent-Task-Id"]=d,E.interceptBody&&E.interceptBody(f);let b=E.getEndpointFetchOptions?.(),T={callSite:`network-request-${u}`,method:s,headers:v,json:f,timeout:dyc,useFetcher:g,suppressIntegrationId:b?.suppressIntegrationId};if(m){let w=r.makeAbortController();m.onCancellationRequested(()=>{n.sendGHTelemetryEvent("networking.cancelRequest",{headerRequestId:d}),w.abort()}),T.signal=w.signal}return $Nr(E.urlOrRequestMetadata)?o.makeRequest(T,E.urlOrRequestMetadata):r.fetch(E.urlOrRequestMetadata,T).catch(R=>{if(A&&UFi(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(E.urlOrRequestMetadata,T));throw r.isAbortError(R)?new syc.CancellationError:R})}a(FFi,"networkRequest");function UFi(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(UFi,"canRetryOnceNetworkError");function myc(t,e){return FFi(t,{...e,requestType:"POST"})}a(myc,"postRequest");function gyc(t,e){return FFi(t,{...e,requestType:"GET"})}a(gyc,"getRequest");qv.IHeaderContributors=(0,iyc.createServiceIdentifier)("headerContributors");var GNr=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}};qv.HeaderContributors=GNr});var $Fi=I(JE=>{"use strict";p();var Ayc=JE&&JE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yyc=JE&&JE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Eyc=JE&&JE.__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(Cyc,"formatTokenCount");function byc(t){return ml.t("In: {0} \xB7 Out: {1} AICs/1M tokens",QFi(t.default.inputPrice),QFi(t.default.outputPrice))}a(byc,"formatPricingLabel");var qFi=1e6;function Syc(t){if(!t)return;let e=t.batch_size??qFi,r=qFi/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}}}a(Syc,"normalizeTokenPrices")});var s8i=I(by=>{"use strict";p();var Tyc=by&&by.__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},VFi=by&&by.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(by,"__esModule",{value:!0});by.AnthropicMessagesProcessor=void 0;by.buildToolInputSchema=XFi;by.createMessagesRequestBody=kyc;by.rawMessagesToMessagesAPI=e8i;by.clearAllCacheControl=t8i;by.addToolsAndSystemCacheControl=r8i;by.addMessagesApiCacheControl=n8i;by.processResponseFromMessagesEndpoint=Nyc;by.processNonStreamingResponseFromMessagesEndpoint=o8i;var lN=xo(),zFi=nl(),Iyc=VDr(),VNr=T0(),xyc=HR(),WFi=Pl(),YFi=Sp(),kye=Lvt(),KFi=V6(),ABe=G6(),wyc=XDr(),JFi=hBe(),Ryc=mh(),ZFi=gm();function XFi(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(XFi,"buildToolInputSchema");function kyc(t,e,r,n){let o=t.get(WFi.IConfigurationService),s=t.get(Ryc.IExperimentationService),c=t.get(wyc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===kye.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 L=e.modelCapabilities?.enableToolSearch&&l&&!c.isNonDeferredTool(N.function.name),B={name:N.function.name,description:N.function.description||"",input_schema:XFi(N.function.parameters),...L?{defer_loading:!0}:{}};(L?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 L=e.postOptions.max_tokens??1024,B=n.minThinkingBudget??1024,q=16e30&&(!N||N.includes(q))&&(A=q)}}let y=e.modelCapabilities?.enableContextEditing&&(0,kye.isAnthropicContextEditingEnabled)(n,o,s)?(0,kye.getContextManagementFromConfig)(o,s,g):void 0,E=t.get(YFi.ILogService),_=t.get(ZFi.ITelemetryService),v=f.length>0?new Set(f.map(N=>N.name)):void 0,b=e8i(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,kye.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,P=(0,kye.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;t8i(b),n8i(b,P),r8i(f,b,R);let D=b.messages.at(-1);return D&&D.role==="assistant"&&(E.warn(`[messagesAPI] Trailing assistant message detected \u2014 appending synthetic user message to prevent prefill error. Total messages: ${b.messages.length}`),_.sendMSFTTelemetryEvent("messagesApi.trailingAssistantGuard",{model:r,location:xyc.ChatLocation.toString(e.location)},{messageCount:b.messages.length}),b.messages.push({role:"user",content:[{type:"text",text:"Please continue."}]})),{model:r,...b,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(kyc,"createMessagesRequestBody");function e8i(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case lN.Raw.ChatRole.System:{n.push(...lCt(c.content).filter(l=>l.type==="text"));break}case lN.Raw.ChatRole.User:{let l=lCt(c.content);l.length>0&&r.push({role:"user",content:l});break}case lN.Raw.ChatRole.Assistant:{let l=lCt(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 lN.Raw.ChatRole.Tool:{if(c.toolCallId){let l=lCt(c.content),u=!1;for(let g of l)yBe(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===kye.CUSTOM_TOOL_SEARCH_NAME?Pyc(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(e8i,"rawMessagesToMessagesAPI");function Pyc(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(Pyc,"tryParseToolReferences");function lCt(t){let e=[],r=!1;for(let n of t){switch(n.type){case lN.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case lN.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 lN.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&yBe(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case lN.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 lN.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);yBe(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(lCt,"rawContentToAnthropicContent");function yBe(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(yBe,"contentBlockSupportsCacheControl");function t8i(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(t8i,"clearAllCacheControl");function r8i(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(r8i,"addToolsAndSystemCacheControl");function n8i(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"&&yBe(c))&&(Dyc(s,e),n++)}}a(n8i,"addMessagesApiCacheControl");function Dyc(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"&&yBe(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(Dyc,"markLastCacheableBlock");async function Nyc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new zFi.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,VNr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,KFi.getRequestId)(n.headers),h=t.createInstance(uCt,s,u,d,f),m=new Iyc.SSEParser(g=>{try{r.trace(`[messagesAPI]SSE: ${g.data}`);let A=g.data?.trim();if(!A||A==="[DONE]")return;let y=JSON.parse(A),E=y.type??g.type;if(!E)return;let _=h.push({...y,type:E},o);if(_){r.info(`[messagesAPI] message ${_.choiceIndex} returned. finish reason: [${_.finishReason}]`);let v=s.extendedBy({completionChoiceFinishReason:_.finishReason,headerRequestId:_.requestId.headerRequestId});e.sendGHTelemetryEvent("completion.finishReason",v.properties,v.measurements);let b=(0,ABe.rawMessageToCAPI)(_.message),T=s;_.usage&&(T=s.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,JFi.sendEngineMessagesTelemetry)(e,[b],T,!0,r),l.emitOne(_)}}catch(A){l.reject(A)}});for await(let g of n.body)m.feed(g)},async()=>{await n.body.destroy()}):o8i(e,r,n,o,s)}a(Nyc,"processResponseFromMessagesEndpoint");function Myc(t){switch(t){case"refusal":return ABe.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return ABe.FinishedCompletionReason.Length;default:return ABe.FinishedCompletionReason.Stop}}a(Myc,"mapStopReason");function i8i(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(i8i,"buildAnthropicCompletion");async function o8i(t,e,r,n,o){return new zFi.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,KFi.getRequestId)(r.headers),u=c||(0,VNr.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,E=i8i({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: [${E.finishReason}]`);let _=o.extendedBy({completionChoiceFinishReason:E.finishReason,headerRequestId:E.requestId.headerRequestId});t.sendGHTelemetryEvent("completion.finishReason",_.properties,_.measurements);let v=(0,ABe.rawMessageToCAPI)(E.message),b=o;E.usage&&(b=o.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,JFi.sendEngineMessagesTelemetry)(t,[v],b,!0,e),s.emitOne(E)},async()=>{await r.body.destroy()})}a(o8i,"processNonStreamingResponseFromMessagesEndpoint");var uCt=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,VNr.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 i8i({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}]})}}}};by.AnthropicMessagesProcessor=uCt;by.AnthropicMessagesProcessor=uCt=Tyc([VFi(4,YFi.ILogService),VFi(5,ZFi.ITelemetryService)],uCt)});var a8i=I(t9=>{"use strict";p();var Oyc=t9&&t9.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lyc=t9&&t9.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Byc=t9&&t9.__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===jne.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(Fyc.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===jne.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===jne.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==jne.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:jne.Raw.ChatCompletionContentPartKind.Text,text:Uyc})})}a(Qyc,"filterHistoryImages")});var Gne=I(_1=>{"use strict";p();var f8i=_1&&_1.__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},Om=_1&&_1.__param||function(t,e){return function(r,n){e(r,n,t)}},YNr;Object.defineProperty(_1,"__esModule",{value:!0});_1.RemoteAgentChatEndpoint=_1.ChatEndpoint=void 0;_1.defaultChatResponseProcessor=JNr;_1.defaultNonStreamChatResponseProcessor=v8i;var WNr=(Sne(),Ca(bne)),c8i=xo(),qyc=Qne(),p8i=nl(),l8i=JZe(),jyc=T0(),h8i=Gs(),Hyc=FE(),m8i=J6(),Gyc=HR(),$yc=oBe(),Hne=Pl(),g8i=Sp(),u8i=Lvt(),Vyc=V6(),Wyc=_y(),zyc=cCt(),Yyc=hBe(),A8i=e9(),Kyc=Hvt(),y8i=mh(),Jyc=gm(),E8i=J$(),Zyc=$E(),EBe=lBe(),_8i=Z$(),_Be=c4e(),Xyc=$Fi(),d8i=s8i(),zNr=Yvt(),eEc=a8i();async function JNr(t,e,r,n,o,s,c){let u=(await Kyc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return p8i.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,Yyc.prepareChatCompletionForReturn)(t,e,f,s)})}a(JNr,"defaultChatResponseProcessor");async function v8i(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,$yc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,jyc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,Vyc.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 p8i.AsyncIterableObject.fromArray(s)}a(v8i,"defaultNonStreamChatResponseProcessor");var dCt=YNr=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,EBe.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer??qyc.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,Xyc.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,EBe.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,EBe.modelSupportsContextEditing)(this),this._supportsStreaming=!!e.capabilities.supports.streaming,this.customModel=e.custom_model,this.maxPromptImages=e.capabilities.limits?.vision?.max_prompt_images}getExtraHeaders(e,r){let n={...this.modelMetadata.requestHeaders};if(this.useMessagesApi){let o=this._configurationService.getConfig(Hne.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,u8i.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,u8i.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:WNr.RequestType.ChatResponses}:this.useMessagesApi?{type:WNr.RequestType.ChatMessages}:{type:WNr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(_Be.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(_Be.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(_Be.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(_Be.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(Hne.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(_Be.ModelSupportedEndpoint.Messages))}get degradationReason(){return this.modelMetadata.warning_messages?.at(0)?.message??this.modelMetadata.info_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===c8i.OpenAI.ChatRole.System?{role:c8i.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(zNr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(d8i.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,zyc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,EBe.isAnthropicFamily)(this))return 20;if((0,EBe.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,eEc.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(Hne.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(Hne.ConfigKey.EnableGemini3LowReasoningEffort,this._expService)&&(e.reasoning_effort="low"),e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,zNr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,zNr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,d8i.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?JNr(e,r,n,o,s,c,l):v8i(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(Hne.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===Gyc.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(YNr,(0,l8i.mixin)((0,l8i.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};_1.ChatEndpoint=dCt;_1.ChatEndpoint=dCt=YNr=f8i([Om(1,_8i.IDomainService),Om(2,m8i.IChatMLFetcher),Om(3,E8i.ITokenizerProvider),Om(4,h8i.IInstantiationService),Om(5,Hne.IConfigurationService),Om(6,y8i.IExperimentationService),Om(7,A8i.IChatWebSocketManager),Om(8,g8i.ILogService)],dCt);var KNr=class extends dCt{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 JNr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};_1.RemoteAgentChatEndpoint=KNr;_1.RemoteAgentChatEndpoint=KNr=f8i([Om(2,_8i.IDomainService),Om(3,Zyc.ICAPIClientService),Om(4,Wyc.IFetcherService),Om(5,Jyc.ITelemetryService),Om(6,Hyc.IAuthenticationService),Om(7,m8i.IChatMLFetcher),Om(8,E8i.ITokenizerProvider),Om(9,h8i.IInstantiationService),Om(10,Hne.IConfigurationService),Om(11,y8i.IExperimentationService),Om(12,A8i.IChatWebSocketManager),Om(13,g8i.ILogService)],KNr)});var C8i=I(fI=>{"use strict";p();var tEc=fI&&fI.__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},dI=fI&&fI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(fI,"__esModule",{value:!0});fI.CopilotUtilityChatEndpoint=fI.CopilotUtilitySmallChatEndpoint=fI.CopilotChatEndpoint=void 0;var rEc=Gs(),nEc=FE(),iEc=J6(),oEc=Pl(),sEc=U4(),aEc=Sp(),cEc=_y(),lEc=e9(),uEc=mh(),dEc=gm(),fEc=J$(),pEc=$E(),hEc=Z$(),mEc=Gne(),vBe=class extends mEc.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)}}};fI.CopilotChatEndpoint=vBe;fI.CopilotChatEndpoint=vBe=tEc([dI(1,hEc.IDomainService),dI(2,pEc.ICAPIClientService),dI(3,cEc.IFetcherService),dI(4,sEc.IEnvService),dI(5,dEc.ITelemetryService),dI(6,nEc.IAuthenticationService),dI(7,iEc.IChatMLFetcher),dI(8,fEc.ITokenizerProvider),dI(9,rEc.IInstantiationService),dI(10,oEc.IConfigurationService),dI(11,uEc.IExperimentationService),dI(12,lEc.IChatWebSocketManager),dI(13,aEc.ILogService)],vBe);var ZNr=class t{static{a(this,"CopilotUtilitySmallChatEndpoint")}static{this.capiFamily="gpt-4o-mini"}static async resolve(e,r){let n=await e.getChatModelFromCapiFamily(t.capiFamily);return r.createInstance(vBe,n)}};fI.CopilotUtilitySmallChatEndpoint=ZNr;var XNr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(vBe,n)}};fI.CopilotUtilityChatEndpoint=XNr});var eMr=I(TL=>{"use strict";p();var gEc=TL&&TL.__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},pI=TL&&TL.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(TL,"__esModule",{value:!0});TL.AutoChatEndpoint=void 0;TL.isAutoModel=NEc;var AEc=Gs(),yEc=FE(),EEc=J6(),_Ec=Pl(),vEc=U4(),CEc=Sp(),bEc=_y(),SEc=e9(),TEc=mh(),IEc=gm(),xEc=J$(),wEc=$E(),REc=Z$(),kEc=Gne(),PEc=C8i(),CBe=class extends PEc.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(DEc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,E,_),this.discountRange=o}};TL.AutoChatEndpoint=CBe;TL.AutoChatEndpoint=CBe=gEc([pI(4,REc.IDomainService),pI(5,wEc.ICAPIClientService),pI(6,bEc.IFetcherService),pI(7,vEc.IEnvService),pI(8,IEc.ITelemetryService),pI(9,yEc.IAuthenticationService),pI(10,EEc.IChatMLFetcher),pI(11,xEc.ITokenizerProvider),pI(12,AEc.IInstantiationService),pI(13,_Ec.IConfigurationService),pI(14,TEc.IExperimentationService),pI(15,SEc.IChatWebSocketManager),pI(16,CEc.ILogService)],CBe);function DEc(t,e,r){let n;t instanceof kEc.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(DEc,"calculateAutoModelInfo");function NEc(t){return t&&(t.model===CBe.pseudoModelId||t instanceof CBe)?1:-1}a(NEc,"isAutoModel")});var rMr=I(bBe=>{"use strict";p();Object.defineProperty(bBe,"__esModule",{value:!0});bBe.getImageTelemetryEventMeasurements=MEc;bBe.getImageTelemetryMeasurementsFromMessages=OEc;bBe.getImageTelemetryMeasurementsFromReferences=LEc;var x8i=DNr(),b8i="screenshot-focused-window";function w8i(){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(w8i,"createEmptyImageTelemetryMeasurements");function MEc(t){return t.imageCount>0?t:{}}a(MEc,"getImageTelemetryEventMeasurements");function OEc(t){let e=w8i();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=$Ec(n,"imageUrl"),s=tMr(o,"url");if(!s)continue;let c=BEc(s,tMr(o,"mediaType"));c&&R8i(e,c)}return e}a(OEc,"getImageTelemetryMeasurementsFromMessages");function LEc(t){let e=w8i();for(let r of t??[]){let n=Pye(r.value);if(!n)continue;let o=tMr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=T8i(n.data)??T8i(n.value);R8i(e,{mimeType:o,byteLength:s?.byteLength??I8i(n.data)??I8i(n.value),dimensions:QEc(s,o),source:qEc(r,n)})}return e}a(LEc,"getImageTelemetryMeasurementsFromReferences");function R8i(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),FEc(t,e.dimensions),k8i(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(R8i,"addImageTelemetryInput");function BEc(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:jEc(r[2]),dimensions:UEc(t),source:"unknown"}}a(BEc,"getImageTelemetryInputFromUrl");function FEc(t,e){if(!e||!S8i(e.width)||!S8i(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(FEc,"addImageDimensions");function S8i(t){return Number.isFinite(t)&&t>0}a(S8i,"isValidDimension");function UEc(t){try{return(0,x8i.getImageDimensions)(t)}catch{return}}a(UEc,"getImageDimensionsFromDataUrl");function QEc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||k8i(r)==="unknown"))try{return(0,x8i.getImageDimensionsFromBytes)(t,r)}catch{return}}a(QEc,"getImageDimensionsFromBytes");function k8i(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(k8i,"normalizeMimeType");function qEc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===b8i||e.id===b8i?"screenshot":e.isURL===!1?"file":"unknown"}a(qEc,"getImageSourceFromReference");function jEc(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(jEc,"getBase64ByteLength");function T8i(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=Pye(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(HEc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(GEc))return new Uint8Array(o)}a(T8i,"getByteData");function HEc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(HEc,"isArrayIndexKey");function GEc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(GEc,"isByteValue");function I8i(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=Pye(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(I8i,"getByteLength");function $Ec(t,e){return Pye(Pye(t)?.[e])}a($Ec,"getObjectProperty");function tMr(t,e){let r=Pye(t)?.[e];return typeof r=="string"?r:void 0}a(tMr,"getStringProperty");function Pye(t){return typeof t=="object"&&t!==null?t:void 0}a(Pye,"asRecord")});var N8i=I(Dye=>{"use strict";p();Object.defineProperty(Dye,"__esModule",{value:!0});Dye.ChatFailKind=Dye.FetchResponseKind=void 0;var P8i;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(P8i||(Dye.FetchResponseKind=P8i={}));var D8i;(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"})(D8i||(Dye.ChatFailKind=D8i={}))});var SBe=I(Mu=>{"use strict";p();Object.defineProperty(Mu,"__esModule",{value:!0});Mu.FILE_TOOL_NAMES=Mu.SHELL_TOOL_NAMES=Mu.TOOL_PARAM_COMMAND_MAX_LEN=Mu.GitHubCopilotAttr=Mu.CopilotCliSdkAttr=Mu.StdAttr=Mu.CopilotChatAttr=Mu.GenAiAttr=Mu.GenAiToolType=Mu.GenAiTokenType=Mu.GenAiProviderName=Mu.GenAiOperationName=void 0;Mu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};Mu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};Mu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};Mu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};Mu.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"};Mu.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"};Mu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};Mu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};Mu.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"};Mu.TOOL_PARAM_COMMAND_MAX_LEN=256;Mu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);Mu.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 iMr=I(WR=>{"use strict";p();Object.defineProperty(WR,"__esModule",{value:!0});WR.truncateForOTel=VEc;WR.toInputMessages=WEc;WR.toOutputMessages=zEc;WR.toSystemInstructions=YEc;WR.extractTextFromContent=nMr;WR.collectSystemTextsFromRequestBody=KEc;WR.normalizeProviderMessages=JEc;WR.toToolDefinitions=L8i;WR.stringifyToolDefinitionsForOTel=i_c;WR.stringifyToolsRawForTelemetry=o_c;function VEc(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(VEc,"truncateForOTel");function WEc(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(WEc,"toInputMessages");function zEc(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(zEc,"toOutputMessages");function YEc(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(YEc,"toSystemInstructions");function nMr(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(nMr,"extractTextFromContent");function KEc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=nMr(n.content);o&&e.push(o)}}if(e.length===0){let n=nMr(t.system??t.instructions);n&&e.push(n)}return e}a(KEc,"collectSystemTextsFromRequestBody");function JEc(t){return t.map(e=>{switch(e.type){case"function_call":return ZEc(e);case"function_call_output":return XEc(e);case"tool_search_output":return e_c(e);case"reasoning":return t_c(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(JEc,"normalizeProviderMessages");function ZEc(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(ZEc,"normalizeResponsesFunctionCall");function XEc(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(XEc,"normalizeResponsesFunctionCallOutput");function e_c(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(e_c,"normalizeResponsesToolSearchOutput");function t_c(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(t_c,"normalizeResponsesReasoning");function L8i(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(L8i,"toToolDefinitions");var M8i=new WeakMap,O8i=new WeakMap,fCt,pCt;function r_c(t){return fCt!==void 0&&fCt===t?fCt:(fCt=t,t)}a(r_c,"internToolDefsString");function n_c(t){return pCt!==void 0&&pCt===t?pCt:(pCt=t,t)}a(n_c,"internToolsRawString");function i_c(t){if(!t||t.length===0)return;let e=M8i.get(t);if(e!==void 0)return e;let r=L8i(t);if(!r)return;let n=r_c(JSON.stringify(r));return M8i.set(t,n),n}a(i_c,"stringifyToolDefinitionsForOTel");function o_c(t){if(!t)return;let e=O8i.get(t);if(e!==void 0)return e;let r=n_c(JSON.stringify(t));return O8i.set(t,r),r}a(o_c,"stringifyToolsRawForTelemetry")});var oMr=I(hCt=>{"use strict";p();Object.defineProperty(hCt,"__esModule",{value:!0});hCt.resolveWorkspaceOTelMetadata=s_c;hCt.workspaceMetadataToOTelAttributes=c_c;var B8i=XP(),F8i=UPr(),X$=SBe();function s_c(t,e){let r=t.activeRepository?.get();return r?a_c(r,e):{}}a(s_c,"resolveWorkspaceOTelMetadata");function a_c(t,e){let r,n=Array.from((0,F8i.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,F8i.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,B8i.isEqualOrParent)(e,t.rootUri)&&(o=(0,B8i.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(a_c,"buildWorkspaceMetadata");function c_c(t){if(!t)return{};let e={};if(t.headBranchName&&(e[X$.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[X$.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[X$.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[X$.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[X$.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[X$.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=l_c(t.remoteUrl);r&&(e[X$.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[X$.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(c_c,"workspaceMetadataToOTelAttributes");function l_c(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(l_c,"extractGitHubOrg")});var U8i=I(zR=>{"use strict";p();Object.defineProperty(zR,"__esModule",{value:!0});zR.emitInferenceDetailsEvent=u_c;zR.emitSessionStartEvent=d_c;zR.emitToolCallEvent=f_c;zR.emitAgentTurnEvent=p_c;zR.emitEditFeedbackEvent=h_c;zR.emitEditHunkActionEvent=m_c;zR.emitInlineDoneEvent=g_c;zR.emitEditSurvivalEvent=A_c;zR.emitUserFeedbackEvent=y_c;zR.emitCloudSessionInvokeEvent=E_c;var Lm=SBe(),Nye=iMr(),mCt=oMr();function u_c(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[Lm.GenAiAttr.OPERATION_NAME]:Lm.GenAiOperationName.CHAT,[Lm.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[Lm.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[Lm.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[Lm.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[Lm.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[Lm.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[Lm.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[Lm.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[Lm.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[Lm.GenAiAttr.INPUT_MESSAGES]=(0,Nye.truncateForOTel)(JSON.stringify(c?(0,Nye.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,Nye.toSystemInstructions)(c);l!==void 0&&(o[Lm.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,Nye.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,Nye.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[Lm.GenAiAttr.TOOL_DEFINITIONS]=(0,Nye.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(u_c,"emitInferenceDetailsEvent");function d_c(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[Lm.GenAiAttr.REQUEST_MODEL]:r,[Lm.GenAiAttr.AGENT_NAME]:n})}a(d_c,"emitSessionStartEvent");function f_c(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[Lm.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[Lm.StdAttr.ERROR_TYPE]:o}:{}})}a(f_c,"emitToolCallEvent");function p_c(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[Lm.GenAiAttr.USAGE_INPUT_TOKENS]:r,[Lm.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(p_c,"emitAgentTurnEvent");function h_c(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,mCt.workspaceMetadataToOTelAttributes)(u)})}a(h_c,"emitEditFeedbackEvent");function m_c(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,mCt.workspaceMetadataToOTelAttributes)(l)})}a(m_c,"emitEditHunkActionEvent");function g_c(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,mCt.workspaceMetadataToOTelAttributes)(l)})}a(g_c,"emitInlineDoneEvent");function A_c(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,mCt.workspaceMetadataToOTelAttributes)(l)})}a(A_c,"emitEditSurvivalEvent");function y_c(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(y_c,"emitUserFeedbackEvent");function E_c(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(E_c,"emitCloudSessionInvokeEvent")});var Q8i=I(gCt=>{"use strict";p();Object.defineProperty(gCt,"__esModule",{value:!0});gCt.GenAiMetrics=void 0;var Mo=SBe(),sMr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[Mo.GenAiAttr.OPERATION_NAME]:n.operationName,[Mo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Mo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Mo.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[Mo.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[Mo.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[Mo.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[Mo.GenAiAttr.OPERATION_NAME]:o.operationName,[Mo.GenAiAttr.PROVIDER_NAME]:o.providerName,[Mo.GenAiAttr.TOKEN_TYPE]:n,[Mo.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[Mo.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[Mo.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[Mo.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[Mo.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[Mo.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[Mo.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[Mo.GenAiAttr.REQUEST_MODEL]:r})}static recordTimeToFirstChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_to_first_chunk",r,{[Mo.GenAiAttr.OPERATION_NAME]:n.operationName,[Mo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Mo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Mo.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static recordTimePerOutputChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_per_output_chunk",r,{[Mo.GenAiAttr.OPERATION_NAME]:n.operationName,[Mo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Mo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Mo.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,{[Mo.CopilotChatAttr.EDIT_SOURCE]:r,[Mo.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Mo.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[Mo.CopilotChatAttr.EDIT_SOURCE]:r,[Mo.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Mo.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[Mo.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[Mo.CopilotChatAttr.EDIT_SOURCE]:r,[Mo.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[Mo.CopilotChatAttr.EDIT_SOURCE]:r,[Mo.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[Mo.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?{[Mo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n}:{}})}static incrementCloudPrReadyCount(e,r){e.incrementCounter("copilot_chat.cloud.pr_ready.count",1,r?{[Mo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:r}:void 0)}static recordCloudOperation(e,r,n,o,s){e.incrementCounter("copilot_chat.cloud.operation.count",1,{operation:r,[Mo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,success:o}),s!==void 0&&e.recordMetric("copilot_chat.cloud.operation.duration",s,{operation:r,[Mo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n})}static incrementCloudError(e,r,n,o){e.incrementCounter("copilot_chat.cloud.error.count",1,{operation:r,[Mo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,[Mo.StdAttr.ERROR_TYPE]:o})}};gCt.GenAiMetrics=sMr});var cMr=I(ACt=>{"use strict";p();Object.defineProperty(ACt,"__esModule",{value:!0});ACt.NoopOTelService=void 0;var q8i=Ic(),j8i={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},aMr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=q8i.Event.None,this.onDidEmitSpanEvent=q8i.Event.None,this.config=e}startSpan(e,r){return j8i}startActiveSpan(e,r,n){return n(j8i)}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){}};ACt.NoopOTelService=aMr});var lMr=I($ne=>{"use strict";p();Object.defineProperty($ne,"__esModule",{value:!0});$ne.DEFAULT_OTLP_ENDPOINT=void 0;$ne.resolveOTelConfig=C_c;$ne.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function __c(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(__c,"parseResourceAttributes");function v_c(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(v_c,"parseOtlpEndpoint");function C_c(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return H8i(t);let r=t.settingDbSpanExporter??!1,n=(TBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)||r,o=(TBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)===!0;if(!n)return H8i(t);let s;TBe(e.COPILOT_OTEL_ENABLED)===!0?s="envVar":t.settingEnabled===!0?s="setting":e.OTEL_EXPORTER_OTLP_ENDPOINT?s="otlpEndpointEnvVar":s="dbSpanExporterOnly";let l=(e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL)==="grpc"?"grpc":"http",u=e.COPILOT_OTEL_ENDPOINT??e.OTEL_EXPORTER_OTLP_ENDPOINT??t.settingOtlpEndpoint??$ne.DEFAULT_OTLP_ENDPOINT,d=v_c(u,l)??$ne.DEFAULT_OTLP_ENDPOINT,f=e.COPILOT_OTEL_FILE_EXPORTER_PATH??t.settingOutfile,h;f?h="file":t.settingExporterType?h=t.settingExporterType:h=l==="grpc"?"otlp-grpc":"otlp-http";let m=TBe(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,g=b_c(e.COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS)??t.settingMaxAttributeSizeChars??0,A=new Set(["trace","debug","info","warn","error"]),y=e.COPILOT_OTEL_LOG_LEVEL,E=y&&A.has(y)?y:"info",_=TBe(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,v=e.OTEL_SERVICE_NAME??"copilot-chat",b=__c(e.OTEL_RESOURCE_ATTRIBUTES);return Object.freeze({enabled:!0,enabledExplicitly:o,enabledVia:s,exporterType:h,otlpEndpoint:d,otlpProtocol:l,captureContent:m,maxAttributeSizeChars:g<0?0:g,fileExporterPath:f,dbSpanExporter:r,logLevel:E,httpInstrumentation:_,serviceName:v,serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:b})}a(C_c,"resolveOTelConfig");function H8i(t){return Object.freeze({enabled:!1,enabledExplicitly:!1,enabledVia:"disabled",exporterType:"otlp-http",otlpEndpoint:"",otlpProtocol:"http",captureContent:!1,maxAttributeSizeChars:0,dbSpanExporter:!1,logLevel:"info",httpInstrumentation:!1,serviceName:"copilot-chat",serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:{}})}a(H8i,"createDisabledConfig");function TBe(t){if(t!==void 0)return t==="true"||t==="1"}a(TBe,"envBool");function b_c(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(b_c,"parseMaxAttributeSizeChars")});var ECt=I(yCt=>{"use strict";p();Object.defineProperty(yCt,"__esModule",{value:!0});yCt.IOTelService=void 0;var S_c=nn();yCt.IOTelService=(0,S_c.createServiceIdentifier)("IOTelService")});var G8i=I(uMr=>{"use strict";p();Object.defineProperty(uMr,"__esModule",{value:!0});uMr.normalizeResponseModel=T_c;function T_c(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(T_c,"normalizeResponseModel")});var W8i=I(Br=>{"use strict";p();Object.defineProperty(Br,"__esModule",{value:!0});Br.workspaceMetadataToOTelAttributes=Br.resolveWorkspaceOTelMetadata=Br.normalizeResponseModel=Br.IOTelService=Br.DEFAULT_OTLP_ENDPOINT=Br.resolveOTelConfig=Br.NoopOTelService=Br.truncateForOTel=Br.toToolDefinitions=Br.toSystemInstructions=Br.toOutputMessages=Br.toInputMessages=Br.stringifyToolsRawForTelemetry=Br.stringifyToolDefinitionsForOTel=Br.normalizeProviderMessages=Br.extractTextFromContent=Br.collectSystemTextsFromRequestBody=Br.GenAiMetrics=Br.emitUserFeedbackEvent=Br.emitToolCallEvent=Br.emitSessionStartEvent=Br.emitInlineDoneEvent=Br.emitInferenceDetailsEvent=Br.emitEditSurvivalEvent=Br.emitEditHunkActionEvent=Br.emitEditFeedbackEvent=Br.emitCloudSessionInvokeEvent=Br.emitAgentTurnEvent=Br.TOOL_PARAM_COMMAND_MAX_LEN=Br.StdAttr=Br.SHELL_TOOL_NAMES=Br.GitHubCopilotAttr=Br.GenAiToolType=Br.GenAiTokenType=Br.GenAiProviderName=Br.GenAiOperationName=Br.GenAiAttr=Br.FILE_TOOL_NAMES=Br.CopilotCliSdkAttr=Br.CopilotChatAttr=void 0;var YR=SBe();Object.defineProperty(Br,"CopilotChatAttr",{enumerable:!0,get:a(function(){return YR.CopilotChatAttr},"get")});Object.defineProperty(Br,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return YR.CopilotCliSdkAttr},"get")});Object.defineProperty(Br,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return YR.FILE_TOOL_NAMES},"get")});Object.defineProperty(Br,"GenAiAttr",{enumerable:!0,get:a(function(){return YR.GenAiAttr},"get")});Object.defineProperty(Br,"GenAiOperationName",{enumerable:!0,get:a(function(){return YR.GenAiOperationName},"get")});Object.defineProperty(Br,"GenAiProviderName",{enumerable:!0,get:a(function(){return YR.GenAiProviderName},"get")});Object.defineProperty(Br,"GenAiTokenType",{enumerable:!0,get:a(function(){return YR.GenAiTokenType},"get")});Object.defineProperty(Br,"GenAiToolType",{enumerable:!0,get:a(function(){return YR.GenAiToolType},"get")});Object.defineProperty(Br,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return YR.GitHubCopilotAttr},"get")});Object.defineProperty(Br,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return YR.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Br,"StdAttr",{enumerable:!0,get:a(function(){return YR.StdAttr},"get")});Object.defineProperty(Br,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return YR.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var IL=U8i();Object.defineProperty(Br,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return IL.emitAgentTurnEvent},"get")});Object.defineProperty(Br,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return IL.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Br,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return IL.emitEditFeedbackEvent},"get")});Object.defineProperty(Br,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return IL.emitEditHunkActionEvent},"get")});Object.defineProperty(Br,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return IL.emitEditSurvivalEvent},"get")});Object.defineProperty(Br,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return IL.emitInferenceDetailsEvent},"get")});Object.defineProperty(Br,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return IL.emitInlineDoneEvent},"get")});Object.defineProperty(Br,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return IL.emitSessionStartEvent},"get")});Object.defineProperty(Br,"emitToolCallEvent",{enumerable:!0,get:a(function(){return IL.emitToolCallEvent},"get")});Object.defineProperty(Br,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return IL.emitUserFeedbackEvent},"get")});var I_c=Q8i();Object.defineProperty(Br,"GenAiMetrics",{enumerable:!0,get:a(function(){return I_c.GenAiMetrics},"get")});var xL=iMr();Object.defineProperty(Br,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return xL.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Br,"extractTextFromContent",{enumerable:!0,get:a(function(){return xL.extractTextFromContent},"get")});Object.defineProperty(Br,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return xL.normalizeProviderMessages},"get")});Object.defineProperty(Br,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return xL.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Br,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return xL.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Br,"toInputMessages",{enumerable:!0,get:a(function(){return xL.toInputMessages},"get")});Object.defineProperty(Br,"toOutputMessages",{enumerable:!0,get:a(function(){return xL.toOutputMessages},"get")});Object.defineProperty(Br,"toSystemInstructions",{enumerable:!0,get:a(function(){return xL.toSystemInstructions},"get")});Object.defineProperty(Br,"toToolDefinitions",{enumerable:!0,get:a(function(){return xL.toToolDefinitions},"get")});Object.defineProperty(Br,"truncateForOTel",{enumerable:!0,get:a(function(){return xL.truncateForOTel},"get")});var x_c=cMr();Object.defineProperty(Br,"NoopOTelService",{enumerable:!0,get:a(function(){return x_c.NoopOTelService},"get")});var $8i=lMr();Object.defineProperty(Br,"resolveOTelConfig",{enumerable:!0,get:a(function(){return $8i.resolveOTelConfig},"get")});Object.defineProperty(Br,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return $8i.DEFAULT_OTLP_ENDPOINT},"get")});var w_c=ECt();Object.defineProperty(Br,"IOTelService",{enumerable:!0,get:a(function(){return w_c.IOTelService},"get")});var R_c=G8i();Object.defineProperty(Br,"normalizeResponseModel",{enumerable:!0,get:a(function(){return R_c.normalizeResponseModel},"get")});var V8i=oMr();Object.defineProperty(Br,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return V8i.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Br,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return V8i.workspaceMetadataToOTelAttributes},"get")})});var pMr=I(eV=>{"use strict";p();Object.defineProperty(eV,"__esModule",{value:!0});eV.AbstractRequestLogger=void 0;eV.getCurrentCapturingToken=N_c;eV.storeCapturingTokenForCorrelation=M_c;eV.retrieveCapturingTokenByCorrelation=O_c;eV.runWithCapturingToken=L_c;var k_c=require("async_hooks"),P_c=uye(),D_c=ko(),IBe=new k_c.AsyncLocalStorage,dMr=new Map;function N_c(){return IBe.getStore()}a(N_c,"getCurrentCapturingToken");function M_c(t){let e=IBe.getStore();e&&dMr.set(t,e)}a(M_c,"storeCapturingTokenForCorrelation");function O_c(t){let e=dMr.get(t);return e&&dMr.delete(t),e}a(O_c,"retrieveCapturingTokenByCorrelation");function L_c(t,e){return IBe.run(t,e)}a(L_c,"runWithCapturingToken");var fMr=class extends D_c.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return IBe.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new P_c.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return IBe.getStore()}};eV.AbstractRequestLogger=fMr});var z8i=I(hMr=>{"use strict";p();Object.defineProperty(hMr,"__esModule",{value:!0});hMr.isEncryptedThinkingDelta=B_c;function B_c(t){return t.encrypted!==void 0}a(B_c,"isEncryptedThinkingDelta")});var K8i=I(_Ct=>{"use strict";p();Object.defineProperty(_Ct,"__esModule",{value:!0});_Ct.calculateLineRepetitionStats=U_c;_Ct.isRepetitive=Q_c;var F_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},{max_token_sequence_length:60,last_tokens_to_consider:120}];function U_c(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(U_c,"calculateLineRepetitionStats");function Q_c(t){let e=t.slice();return e.reverse(),Y8i(e)||Y8i(e.filter(r=>r.trim().length>0))}a(Q_c,"isRepetitive");function Y8i(t){let e=q_c(t);for(let r of F_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(q_c,"kmp_prefix_function")});var mMr=I(wL=>{"use strict";p();var j_c=wL&&wL.__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},tV=wL&&wL.__param||function(t,e){return function(r,n){e(r,n,t)}},KR;Object.defineProperty(wL,"__esModule",{value:!0});wL.OpenAIEndpoint=void 0;wL.isBYOKModel=evc;var H_c=J6(),J8i=HR(),Z8i=Pl(),G_c=Z$(),$_c=Gne(),V_c=Sp(),W_c=V6(),z_c=cCt(),Y_c=e9(),K_c=mh(),J_c=J$(),Z_c=Gs();function X_c(t){return t.type===J8i.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===J8i.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(W_c,"hydrateBYOKErrorMessages");function z_c(t){return t?t instanceof _Ct||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(z_c,"isBYOKModel");var _Ct=class extends U_c.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{YR=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 YR._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>YR._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${YR._maxCustomHeaderCount}. Only first ${YR._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=YR._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>YR._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${YR._maxHeaderNameLength} characters, skipping.`);continue}if(!YR._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>YR._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),n}else{if(this.useMessagesApi)return super.createRequestBody(e);{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,j_c.createCapiRequestBody)(e,this.model,n);return this._applyReasoningEffort(o,e),o}}}_applyReasoningEffort(e,r){let n=this.supportsReasoningEffort;if(!n?.length)return;let o=this.modelMetadata.reasoningEffortFormat??(this.useResponsesApi?"responses":"chat-completions"),c=this._configurationService.getConfig(z8i.ConfigKey.Advanced.ReasoningEffortOverride)||r.modelCapabilities?.reasoningEffort||e.reasoning?.effort||e.reasoning_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}e.reasoning_effort=void 0,l&&(o==="responses"?e.reasoning={...e.reasoning,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,q_c.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(YR,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return W_c(o)}};wL.OpenAIEndpoint=_Ct;wL.OpenAIEndpoint=_Ct=YR=L_c([eV(3,F_c.IDomainService),eV(4,B_c.IChatMLFetcher),eV(5,$_c.ITokenizerProvider),eV(6,V_c.IInstantiationService),eV(7,z8i.IConfigurationService),eV(8,G_c.IExperimentationService),eV(9,H_c.IChatWebSocketManager),eV(10,Q_c.ILogService)],_Ct)});var Y8i=I(lN=>{"use strict";p();Object.defineProperty(lN,"__esModule",{value:!0});lN.EXTENSION_ID=lN.agentsToCommands=lN.GITHUB_PLATFORM_AGENT=void 0;lN.getAgentForIntent=K_c;var Y_c=jR();lN.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";lN.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 K_c(t,e){if(Object.keys(lN.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(lN.agentsToCommands))if(!(e===Y_c.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(K_c,"getAgentForIntent");lN.EXTENSION_ID="GitHub.copilot-chat"});var Z8i=I(vCt=>{"use strict";p();Object.defineProperty(vCt,"__esModule",{value:!0});vCt.ChatMLFetcherTelemetrySender=void 0;var K8i=XNr(),mMr=tMr(),J8i=hMr();function J_c(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(J_c,"getTurnFromBaseTelemetry");function gMr(t,e,r,n,o){t.sendTelemetryEvent(e,{github:!0,microsoft:!0},r,n),o.imageCount>0&&t.sendEnhancedGHTelemetryEvent(e,r,n)}a(gMr,"sendResponseTelemetryEvent");var AMr=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:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}){gMr(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:b,...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:J_c(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,mMr.getImageTelemetryEventMeasurements)(g),isBYOK:(0,J8i.isBYOKModel)(c),isAuto:(0,K8i.isAutoModel)(c),bytesReceived:E,suspendEventSeen:_?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:E,suspendEventSeen:_,resumeEventSeen:v},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,isVisionRequest:D,isBYOK:N,isAuto:L,bytesReceived:B,issuedTime:q,imageTelemetryMeasurements:M}){gMr(e,"response.cancelled",{apiType:s,source:r,requestId:n,model:o,requestKind:l,conversationId:u,associatedRequestId:d,parentRequestId:f,...E?{fetcher:E}:{},transport:c,...h?{retryAfterError:h}:{},...m?{retryAfterErrorGitHubRequestId:m}:{},...g?{connectivityTestError:g}:{},...A?{connectivityTestErrorGitHubRequestId:A}:{},...y?{retryAfterFilterCategory:y}:{}},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,timeToComplete:P,issuedTime:q,isVisionRequest:D,...(0,mMr.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:L,bytesReceived:B,suspendEventSeen:_?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:E,suspendEventSeen:_,resumeEventSeen:v}){gMr(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,mMr.getImageTelemetryEventMeasurements)(f),isBYOK:(0,J8i.isBYOKModel)(o),isAuto:(0,K8i.isAutoModel)(o),wasRetried:E?1:0,bytesReceived:A,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},f)}};vCt.ChatMLFetcherTelemetrySender=AMr});var s6i=I(pI=>{"use strict";p();var Z_c=pI&&pI.__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},qv=pI&&pI.__param||function(t,e){return function(r,n){e(r,n,t)}},CMr;Object.defineProperty(pI,"__esModule",{value:!0});pI.ChatMLFetcherImpl=pI.AbstractChatMLFetcher=void 0;pI.createTelemetryData=o6i;pI.locationToIntent=TCt;var X_c=Io(),evc=FE(),tvc=K6(),rvc=QDr(),zn=jR(),nvc=qDr(),TBe=nBe(),ivc=HDr(),tV=Pl(),ovc=$E(),CCt=XNr(),IBe=zvt(),svc=tMr(),bMr=Sp(),yMr=$6(),avc=_y(),bCt=aCt(),fI=H6(),X8i=fBe(),i6i=X6(),e6i=jvt(),gn=R8i(),on=H8i(),cvc=yCt(),lvc=lye(),EMr=fMr(),uvc=mh(),SMr=gm(),Mye=Tye(),dvc=G8i(),SCt=V8i(),fvc=X_(),t6i=nl(),r6i=Rs(),pvc=Ic(),hvc=Ro(),mvc=em(),_Mr=T0(),gvc=Gs(),n6i=hMr(),Avc=Y8i(),yvc=BDr(),Nye=Z8i(),ICt=class extends hvc.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new pvc.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===zn.ChatFetchResponseType.Success?{...n,value:n.value[0]}:n}};pI.AbstractChatMLFetcher=ICt;var TMr=class extends ICt{static{a(this,"ChatMLFetcherImpl")}static{CMr=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:E,ignoreStatefulMarker:_}=e,v=m??TCt(c);E&&this._consecutiveWebSocketRetryFallbacks>=CMr._maxConsecutiveWebSocketFallbacks&&(this._logService.debug(`[ChatWebSocketManager] Disabling WebSocket for request due to ${this._consecutiveWebSocketRetryFallbacks} consecutive WebSocket failures with successful HTTP fallback.`),E=!1,_=!0),f||(f={}),f.messageSource||(f.messageSource=n);let b=E?"websocket":"http",T=f.requestId??f.messageId??(0,_Mr.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:_,requestId:T,postOptions:R}),P=(0,svc.getImageTelemetryMeasurementsFromMessages)(l),D=Mye.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:zn.ChatLocation.toString(c)}),N=this._requestLogger.logChatRequest(n,o,{messages:e.messages,model:o.model,ourRequestId:T,location:e.location,body:x,ignoreStatefulMarker:_,isConversationRequest:e.isConversationRequest,customMetadata:e.customMetadata}),L=-1,B=new tvc.FetchStreamRecorder(s),q=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),O,j,Q,U,Y,W,V,z;try{let ie,H=Evc(e.messages,R,o,this._configurationService,this._experimentationService);if(!H.isValid)ie={type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.ChatFailKind.ValidationFailed,reason:H.reason};else{let ge,Ue=a(()=>ge??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),ke;try{ke=await this._authenticationService.getCopilotToken()}catch{}O=ke?.username??this._authenticationService.copilotToken?.username;let X=await this._fetchAndStreamChat(o,x,D,B.callback,u.secretKey,ke,e.location,T,R.n,r,Ue,h,E,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(ie=X.result,j=X.fetcher,Q=X.bytesReceived,U=X.statusCode,Y=X.suspendEventSeen,W=X.resumeEventSeen,V=X.modelCallId,z=X.otelSpan,z?.setAttribute(on.GenAiAttr.AGENT_NAME,n),z){let he=(x.messages??x.input)?.filter(ne=>ne.role==="user"),Z=he?.[he.length-1];if(Z?.content){let ne=typeof Z.content=="string"?Z.content:JSON.stringify(Z.content);z.setAttribute(on.CopilotChatAttr.USER_REQUEST,(0,on.truncateForOTel)(ne,this._otelService.config.maxAttributeSizeChars))}let ue=(0,on.collectSystemTextsFromRequestBody)(x),qe=(0,on.toSystemInstructions)(ue);qe&&z.setAttribute(on.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,on.truncateForOTel)(JSON.stringify(qe),this._otelService.config.maxAttributeSizeChars))}if(z){let K=x.messages??x.input;if(K){let qe=K.filter(ne=>ne.role!=="system");z.setAttribute(on.GenAiAttr.INPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify((0,on.normalizeProviderMessages)(qe)),this._otelService.config.maxAttributeSizeChars))}let he=(0,on.stringifyToolDefinitionsForOTel)(x.tools);he&&z.setAttribute(on.GenAiAttr.TOOL_DEFINITIONS,(0,on.truncateForOTel)(he,this._otelService.config.maxAttributeSizeChars));let Z=_vc(x);Z&&z.setAttribute(on.CopilotChatAttr.REQUEST_OPTIONS,(0,on.truncateForOTel)(JSON.stringify(Z),this._otelService.config.maxAttributeSizeChars));let ue=vvc(x);ue&&z.setAttribute(on.CopilotChatAttr.REQUEST_SHAPE,(0,on.truncateForOTel)(JSON.stringify(ue),this._otelService.config.maxAttributeSizeChars))}L=await Ue();let ee=d?.extensionId??Avc.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:ee},tokenCount:L})}let re=Date.now()-D.issuedTime;N?.markTimeToFirstToken(re);let le,Le;switch(ie.type){case gn.FetchResponseKind.Success:{let ge=await this.processSuccessfulResponse(ie,l,P,x,T,w,L,re,B,D,o,h,v,b,j,Q,Y,W,V);if(ge.type===zn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){B.callback("",0,{text:"",retryReason:ge.category});let Ue=ge.value[0];if(Ue){let ke=ge.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: ${Ue} +`+JSON.stringify(t.capiError):"Rate limit exceeded",rateLimitKey:"",retryAfter:void 0,isAuto:!1,capiError:t.capiError}:t}a(X_c,"hydrateBYOKErrorMessages");function evc(t){return t?t instanceof vCt||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(evc,"isBYOKModel");var vCt=class extends $_c.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{KR=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 KR._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>KR._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${KR._maxCustomHeaderCount}. Only first ${KR._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=KR._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>KR._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${KR._maxHeaderNameLength} characters, skipping.`);continue}if(!KR._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>KR._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),n}else{if(this.useMessagesApi)return super.createRequestBody(e);{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,z_c.createCapiRequestBody)(e,this.model,n);return this._applyReasoningEffort(o,e),o}}}_applyReasoningEffort(e,r){let n=this.supportsReasoningEffort;if(!n?.length)return;let o=this.modelMetadata.reasoningEffortFormat??(this.useResponsesApi?"responses":"chat-completions"),c=this._configurationService.getConfig(Z8i.ConfigKey.Advanced.ReasoningEffortOverride)||r.modelCapabilities?.reasoningEffort||e.reasoning?.effort||e.reasoning_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}e.reasoning_effort=void 0,l&&(o==="responses"?e.reasoning={...e.reasoning,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,W_c.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(KR,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return X_c(o)}};wL.OpenAIEndpoint=vCt;wL.OpenAIEndpoint=vCt=KR=j_c([tV(3,G_c.IDomainService),tV(4,H_c.IChatMLFetcher),tV(5,J_c.ITokenizerProvider),tV(6,Z_c.IInstantiationService),tV(7,Z8i.IConfigurationService),tV(8,K_c.IExperimentationService),tV(9,Y_c.IChatWebSocketManager),tV(10,V_c.ILogService)],vCt)});var X8i=I(uN=>{"use strict";p();Object.defineProperty(uN,"__esModule",{value:!0});uN.EXTENSION_ID=uN.agentsToCommands=uN.GITHUB_PLATFORM_AGENT=void 0;uN.getAgentForIntent=rvc;var tvc=HR();uN.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";uN.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 rvc(t,e){if(Object.keys(uN.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(uN.agentsToCommands))if(!(e===tvc.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(rvc,"getAgentForIntent");uN.EXTENSION_ID="GitHub.copilot-chat"});var r6i=I(CCt=>{"use strict";p();Object.defineProperty(CCt,"__esModule",{value:!0});CCt.ChatMLFetcherTelemetrySender=void 0;var e6i=eMr(),gMr=rMr(),t6i=mMr();function nvc(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(nvc,"getTurnFromBaseTelemetry");function AMr(t,e,r,n,o){t.sendTelemetryEvent(e,{github:!0,microsoft:!0},r,n),o.imageCount>0&&t.sendEnhancedGHTelemetryEvent(e,r,n)}a(AMr,"sendResponseTelemetryEvent");var yMr=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:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}){AMr(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:b,...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:nvc(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,gMr.getImageTelemetryEventMeasurements)(g),isBYOK:(0,t6i.isBYOKModel)(c),isAuto:(0,e6i.isAutoModel)(c),bytesReceived:E,suspendEventSeen:_?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:E,suspendEventSeen:_,resumeEventSeen:v},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,isVisionRequest:D,isBYOK:N,isAuto:L,bytesReceived:B,issuedTime:q,imageTelemetryMeasurements:M}){AMr(e,"response.cancelled",{apiType:s,source:r,requestId:n,model:o,requestKind:l,conversationId:u,associatedRequestId:d,parentRequestId:f,...E?{fetcher:E}:{},transport:c,...h?{retryAfterError:h}:{},...m?{retryAfterErrorGitHubRequestId:m}:{},...g?{connectivityTestError:g}:{},...A?{connectivityTestErrorGitHubRequestId:A}:{},...y?{retryAfterFilterCategory:y}:{}},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,timeToComplete:P,issuedTime:q,isVisionRequest:D,...(0,gMr.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:L,bytesReceived:B,suspendEventSeen:_?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:E,suspendEventSeen:_,resumeEventSeen:v}){AMr(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,gMr.getImageTelemetryEventMeasurements)(f),isBYOK:(0,t6i.isBYOKModel)(o),isAuto:(0,e6i.isAutoModel)(o),wasRetried:E?1:0,bytesReceived:A,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},f)}};CCt.ChatMLFetcherTelemetrySender=yMr});var u6i=I(mI=>{"use strict";p();var ivc=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},jv=mI&&mI.__param||function(t,e){return function(r,n){e(r,n,t)}},bMr;Object.defineProperty(mI,"__esModule",{value:!0});mI.ChatMLFetcherImpl=mI.AbstractChatMLFetcher=void 0;mI.createTelemetryData=l6i;mI.locationToIntent=ICt;var ovc=xo(),svc=FE(),avc=J6(),cvc=qDr(),zn=HR(),lvc=jDr(),xBe=oBe(),uvc=GDr(),rV=Pl(),dvc=$E(),bCt=eMr(),wBe=Yvt(),fvc=rMr(),SMr=Sp(),EMr=V6(),pvc=_y(),SCt=cCt(),hI=G6(),n6i=hBe(),c6i=e9(),i6i=Hvt(),gn=N8i(),on=W8i(),hvc=ECt(),mvc=uye(),_Mr=pMr(),gvc=mh(),TMr=gm(),Oye=Iye(),Avc=z8i(),TCt=K8i(),yvc=ev(),o6i=nl(),s6i=Rs(),Evc=Ic(),_vc=ko(),vvc=em(),vMr=T0(),Cvc=Gs(),a6i=mMr(),bvc=X8i(),Svc=FDr(),Mye=r6i(),xCt=class extends _vc.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new Evc.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===zn.ChatFetchResponseType.Success?{...n,value:n.value[0]}:n}};mI.AbstractChatMLFetcher=xCt;var IMr=class extends xCt{static{a(this,"ChatMLFetcherImpl")}static{bMr=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:E,ignoreStatefulMarker:_}=e,v=m??ICt(c);E&&this._consecutiveWebSocketRetryFallbacks>=bMr._maxConsecutiveWebSocketFallbacks&&(this._logService.debug(`[ChatWebSocketManager] Disabling WebSocket for request due to ${this._consecutiveWebSocketRetryFallbacks} consecutive WebSocket failures with successful HTTP fallback.`),E=!1,_=!0),f||(f={}),f.messageSource||(f.messageSource=n);let b=E?"websocket":"http",T=f.requestId??f.messageId??(0,vMr.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:_,requestId:T,postOptions:R}),P=(0,fvc.getImageTelemetryMeasurementsFromMessages)(l),D=Oye.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:zn.ChatLocation.toString(c)}),N=this._requestLogger.logChatRequest(n,o,{messages:e.messages,model:o.model,ourRequestId:T,location:e.location,body:x,ignoreStatefulMarker:_,isConversationRequest:e.isConversationRequest,customMetadata:e.customMetadata}),L=-1,B=new avc.FetchStreamRecorder(s),q=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),O,j,Q,U,Y,W,V,z;try{let ie,H=Tvc(e.messages,R,o,this._configurationService,this._experimentationService);if(!H.isValid)ie={type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.ChatFailKind.ValidationFailed,reason:H.reason};else{let ge,Ue=a(()=>ge??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),ke;try{ke=await this._authenticationService.getCopilotToken()}catch{}O=ke?.username??this._authenticationService.copilotToken?.username;let X=await this._fetchAndStreamChat(o,x,D,B.callback,u.secretKey,ke,e.location,T,R.n,r,Ue,h,E,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(ie=X.result,j=X.fetcher,Q=X.bytesReceived,U=X.statusCode,Y=X.suspendEventSeen,W=X.resumeEventSeen,V=X.modelCallId,z=X.otelSpan,z?.setAttribute(on.GenAiAttr.AGENT_NAME,n),z){let he=(x.messages??x.input)?.filter(ne=>ne.role==="user"),Z=he?.[he.length-1];if(Z?.content){let ne=typeof Z.content=="string"?Z.content:JSON.stringify(Z.content);z.setAttribute(on.CopilotChatAttr.USER_REQUEST,(0,on.truncateForOTel)(ne,this._otelService.config.maxAttributeSizeChars))}let ue=(0,on.collectSystemTextsFromRequestBody)(x),qe=(0,on.toSystemInstructions)(ue);qe&&z.setAttribute(on.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,on.truncateForOTel)(JSON.stringify(qe),this._otelService.config.maxAttributeSizeChars))}if(z){let K=x.messages??x.input;if(K){let qe=K.filter(ne=>ne.role!=="system");z.setAttribute(on.GenAiAttr.INPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify((0,on.normalizeProviderMessages)(qe)),this._otelService.config.maxAttributeSizeChars))}let he=(0,on.stringifyToolDefinitionsForOTel)(x.tools);he&&z.setAttribute(on.GenAiAttr.TOOL_DEFINITIONS,(0,on.truncateForOTel)(he,this._otelService.config.maxAttributeSizeChars));let Z=Ivc(x);Z&&z.setAttribute(on.CopilotChatAttr.REQUEST_OPTIONS,(0,on.truncateForOTel)(JSON.stringify(Z),this._otelService.config.maxAttributeSizeChars));let ue=xvc(x);ue&&z.setAttribute(on.CopilotChatAttr.REQUEST_SHAPE,(0,on.truncateForOTel)(JSON.stringify(ue),this._otelService.config.maxAttributeSizeChars))}L=await Ue();let ee=d?.extensionId??bvc.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:ee},tokenCount:L})}let re=Date.now()-D.issuedTime;N?.markTimeToFirstToken(re);let le,Le;switch(ie.type){case gn.FetchResponseKind.Success:{let ge=await this.processSuccessfulResponse(ie,l,P,x,T,w,L,re,B,D,o,h,v,b,j,Q,Y,W,V);if(ge.type===zn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){B.callback("",0,{text:"",retryReason:ge.category});let Ue=ge.value[0];if(Ue){let ke=ge.category===hI.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: ${Ue} `:`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: ${Ue} -`,X=[...l,{role:X_c.Raw.ChatRole.User,content:(0,TBe.toTextParts)(ke)}],ee=await this.fetchMany({...e,debugName:"retry-"+n,messages:X,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:ge.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:q},r);if(N?.resolve(ee,B.deltas),ee.type===zn.ChatFetchResponseType.Success)return ee}}return{type:zn.ChatFetchResponseType.Filtered,category:ge.category,reason:"Response got filtered.",requestId:ge.requestId,serverRequestId:ge.serverRequestId}}if(N?.resolve(ge,B.deltas),B.firstTokenEmittedTime!==void 0&&(Le=B.firstTokenEmittedTime-D.issuedTime),ge.type===zn.ChatFetchResponseType.Success&&ge.usage){typeof ge.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(ge.usage.copilot_usage.total_nano_aiu,y??A),le=(0,on.normalizeResponseModel)(o.model,ge.resolvedModel);let Ue={operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le};ge.usage.prompt_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.prompt_tokens,"input",Ue),ge.usage.completion_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.completion_tokens,"output",Ue),z?.setAttributes({[on.GenAiAttr.USAGE_INPUT_TOKENS]:ge.usage.prompt_tokens??0,[on.GenAiAttr.USAGE_OUTPUT_TOKENS]:ge.usage.completion_tokens??0,[on.GenAiAttr.RESPONSE_MODEL]:le??o.model,[on.GenAiAttr.RESPONSE_ID]:ge.requestId,[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...ge.usage.prompt_tokens_details?.cached_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cached_tokens}:{},...ge.usage.prompt_tokens_details?.cache_creation_input_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[on.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:re,[on.GenAiAttr.REQUEST_STREAM]:!0,...Le!==void 0&&Le>0?{[on.GenAiAttr.RESPONSE_TIME_TO_FIRST_CHUNK]:Le/1e3}:{},...ge.serverRequestId?{[on.CopilotChatAttr.SERVER_REQUEST_ID]:ge.serverRequestId}:{},...ge.usage.completion_tokens_details?.reasoning_tokens?{[on.GenAiAttr.USAGE_REASONING_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens,[on.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens}:{},...typeof ge.usage.copilot_usage?.total_nano_aiu=="number"?{[on.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:ge.usage.copilot_usage.total_nano_aiu}:{}})}if(z&&ge.type===zn.ChatFetchResponseType.Success){let Ue=B.deltas.map(K=>K.text).join(""),ke=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}))),X=[];if(Ue&&X.push({type:"text",content:Ue}),X.push(...ke),X.length>0&&z.setAttribute(on.GenAiAttr.OUTPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify([{role:"assistant",parts:X}]),this._otelService.config.maxAttributeSizeChars)),B.deltas.some(K=>K.thinking)){let he=B.deltas.filter(Z=>Z.thinking&&!(0,dvc.isEncryptedThinkingDelta)(Z.thinking)&&Z.thinking.text).map(Z=>{let ue=Z.thinking;return"encrypted"in ue?"":Array.isArray(ue.text)?ue.text.join(""):ue.text??""}).join("");z.setAttribute(on.CopilotChatAttr.REASONING_CONTENT,(0,on.truncateForOTel)(he||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}(0,on.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},ge.type===zn.ChatFetchResponseType.Success?{id:ge.requestId,model:(0,on.normalizeResponseModel)(o.model,ge.resolvedModel),finishReasons:["stop"],inputTokens:ge.usage?.prompt_tokens,outputTokens:ge.usage?.completion_tokens}:void 0),z?.end(),z=void 0,re>0&&on.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,re/1e3),Le!==void 0&&Le>0&&on.GenAiMetrics.recordTimeToFirstChunk(this._otelService,Le/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});for(let Ue of B.outputChunkGapsMs)on.GenAiMetrics.recordTimePerOutputChunk(this._otelService,Ue/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});return E&&ge.type===zn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),ge}case gn.FetchResponseKind.Canceled:return Nye.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,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:j,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,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,n6i.isBYOKModel)(o),isAuto:(0,CCt.isAutoModel)(o),bytesReceived:Q,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}),N?.resolveWithCancelation(),z?.setAttributes({[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[on.CopilotChatAttr.CANCELED]:!0}),z?.end(),z=void 0,this.processCanceledResponse(ie,T,B,f);case gn.FetchResponseKind.Failed:{let ge=this.processFailedResponse(ie,T,(0,CCt.isAutoModel)(o)===1),ke=this._configurationService.getExperimentBasedConfig(tV.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(K=>parseInt(K.trim(),10)),X=q&&U!==void 0&&ke.includes(U),ee=q&&E&&(ie.failKind===gn.ChatFailKind.ServerError||ie.failKind===gn.ChatFailKind.Unknown);if(X||ee){let{retryResult:K}=await this._retryAfterError({opts:e,processed:ge,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:re,transport:b,actualFetcher:j,bytesReceived:Q,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(K)return K}return Nye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:ge,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:re,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:j,bytesReceived:Q,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(ge),ge}}}catch(ie){z&&(z.setStatus(2,ie instanceof Error?ie.message:String(ie)),z.setAttribute(on.StdAttr.ERROR_TYPE,ie instanceof Error?ie.constructor.name:"Error"),z.setAttribute(on.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),z.recordException(ie),z.end());let H=Date.now()-D.issuedTime;ie.fetcherId&&(j=ie.fetcherId),ie.suspendEventSeen&&(Y=!0),ie.resumeEventSeen&&(W=!0);let re=this.processError(ie,T,ie.gitHubRequestId,O,(0,CCt.isAutoModel)(o)===1),le=q&&re.type===zn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(tV.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),Le=q&&E&&(re.type===zn.ChatFetchResponseType.NetworkError||re.type===zn.ChatFetchResponseType.Failed);if(le||Le){let{retryResult:ge,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:ke}=await this._retryAfterError({opts:e,processed:re,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:H,transport:b,actualFetcher:j,bytesReceived:ie.bytesReceived,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(ge)return ge;f={...f,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:ke}}return re.type===zn.ChatFetchResponseType.Canceled?Nye.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,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:j,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:H,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,n6i.isBYOKModel)(o),isAuto:(0,CCt.isAutoModel)(o),bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}):Nye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:re,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:H,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:j,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,bMr.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:E,pendingLoggedChatRequest:_,token:v,usernameToScrub:b,suspendEventSeen:T,resumeEventSeen:w,interactionType:R}=e,x=["darwin","linux"].includes(process.platform)&&n.reason.indexOf("net::ERR_NETWORK_CHANGED")!==-1,P=this._configurationService.getExperimentBasedConfig(tV.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===zn.ChatFetchResponseType.NetworkError&&n.isNetworkProcessCrash===!0&&P,N=x||D?"node-fetch":r.useFetcher;this._logService.info(`Retrying chat request with ${N||"default"} fetcher after: ${n.reasonDetail||n.reason}`);let L=await this._checkNetworkConnectivity(N),B=L.connectivityTestError?this.scrubErrorDetail(L.connectivityTestError,b):void 0,q=L.connectivityTestErrorGitHubRequestId;if(!L.retryRequest)return this._logService.info("Not retrying chat request as network connectivity could not be re-established."),{connectivityTestError:B,connectivityTestErrorGitHubRequestId:q};Nye.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:E+r.debugName,userInitiatedRequest:!1,telemetryProperties:{...o,retryAfterError:n.reasonDetail||n.reason,retryAfterErrorGitHubRequestId:n.serverRequestId,connectivityTestError:B,connectivityTestErrorGitHubRequestId:q},enableRetryOnError:!1,useFetcher:N},v);return _?.resolve(M,g.deltas),r.useWebSocket&&M.type===zn.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,b,T,w){let x=this._configurationService.getExperimentBasedConfig(tV.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==zn.ChatLocation.Other?this._powerService.acquirePowerSaveBlocker():void 0,P=!1,D=!1,N=this._powerService.onDidSuspend(()=>{P=!0,this._logService.info(`System suspended during streaming request ${u} (${zn.ChatLocation.toString(l)})`)}),L=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${zn.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,b,T,w),suspendEventSeen:P||void 0,resumeEventSeen:D||void 0}}catch(B){throw P&&(B.suspendEventSeen=!0),D&&(B.resumeEventSeen=!0),B}finally{N.dispose(),L.dispose(),x?.dispose()}}async _doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){if(f.isCancellationRequested)return{result:{type:gn.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,EMr.getCurrentCapturingToken)()?.chatSessionId,P=(0,EMr.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,EMr.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[on.GenAiAttr.OPERATION_NAME]:on.GenAiOperationName.CHAT,[on.GenAiAttr.PROVIDER_NAME]:on.GenAiProviderName.GITHUB,[on.GenAiAttr.REQUEST_MODEL]:e.model,[on.GenAiAttr.CONVERSATION_ID]:E?.requestId??u,[on.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[on.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[on.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[on.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[on.StdAttr.SERVER_ADDRESS]:R}:{},...y?{[on.CopilotChatAttr.SESSION_ID]:y}:{},...x?{[on.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...P?{[on.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:P}:{},...D?{[on.CopilotChatAttr.DEBUG_LOG_LABEL]:D}:{}}}),L=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,bCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${q} due to missing key`),(0,e6i.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${q} due to missing key`),{result:{type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.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,E,b,T,w),otelSpan:N}:{...await this._doFetchViaHttp(e,r,n,o,s,l,u,d,f,m,E,_,v,b),otelSpan:N}}catch(B){throw N.setStatus(2,B instanceof Error?B.message:String(B)),N.setAttribute(on.StdAttr.ERROR_TYPE,B instanceof Error?B.constructor.name:"Error"),N.recordException(B),B}finally{let B=(Date.now()-L)/1e3;on.GenAiMetrics.recordOperationDuration(this._otelService,B,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=TCt(c),v=A??_,b={...s?{Authorization:`Bearer ${s}`}:{},"X-Request-Id":l,"OpenAI-Intent":_,"X-GitHub-Api-Version":"2025-05-01","X-Interaction-Id":this._interactionService.interactionId,...e.getExtraHeaders?e.getExtraHeaders(c,A):{}};b["X-Interaction-Type"]=v,b["X-Agent-Task-Id"]=l,r.messages?.some(M=>Array.isArray(M.content)?M.content.some(O=>"image_url"in O):!1)&&e.supportsVision&&(b["Copilot-Vision-Request"]="true");let T=this._webSocketManager.getOrCreateConnection(d,b,l);try{await T.connect()}catch(M){throw M.gitHubRequestId=T.gitHubRequestId,M}let w=(0,_Mr.generateUuid)(),R=Mye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,yMr.getRequestId)(T.responseHeaders);x.headerRequestId=l,R.extendWithRequestId(x),x.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",x.serverExperiments);for(let[M,O]of Object.entries(r))if(!(M==="messages"||M==="input")){if(M==="tools"){R.properties[`request.option.${M}`]=(0,on.stringifyToolsRawForTelemetry)(O)??"undefined";continue}R.properties[`request.option.${M}`]=JSON.stringify(O)??"undefined"}this._telemetryService.sendGHTelemetryEvent("request.sent",R.properties,R.measurements),r.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,SMr.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,on.stringifyToolsRawForTelemetry)(r.tools)}),R.measurements);let P=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:E},f),N=n.extendedBy({modelCallId:w}),L=this._instantiationService.createInstance(IBe.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,IBe.getResponsesApiCompactionThresholdFromBody)(r)),B=new t6i.AsyncIterableObject(async M=>{try{await new Promise((j,Q)=>{D.onEvent(U=>{let Y=L.push(U,o);if(Y&&((0,IBe.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,Y,N),M.emitOne(Y)),U.type==="response.completed"){let W=U.copilot_quota_snapshots;W&&typeof W=="object"&&this._chatQuotaService.processQuotaSnapshots(W)}}),D.onCAPIError(U=>{let Y=new Error(`${U.error.message} (${U.error.code})`);Y.gitHubRequestId=x.gitHubRequestId,Y.capiWebSocketError=U,Q(Y)}),D.onError(U=>{if(U.gitHubRequestId=x.gitHubRequestId,(0,r6i.isCancellationError)(U)){Q(U);return}let Y=R.extendedBy({error:U.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",Y.properties,Y.measurements);let W=Date.now()-P;R.measurements.totalTimeMs=W,R.properties.error=U.message,this._logService.debug(`request.error: [websocket], took ${W} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),Q(U)}),D.done.then(j,Q)});let O=Date.now()-P;R.measurements.totalTimeMs=O,this._logService.debug(`request.response: [websocket], took ${O} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",R.properties,R.measurements)}finally{let O=r.messages;if((!O||O.length===0)&&r.input)try{let j=(0,IBe.responseApiInputToRawMessagesForLogging)(r);O=(0,fI.rawMessageToCAPI)(j)}catch(j){this._logService.error("Failed to convert Response API input to messages for telemetry:",j),O=[]}(0,X8i.sendEngineMessagesTelemetry)(this._telemetryService,O??[],R,!1,this._logService)}}),q=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:gn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,i6i.isCAPIWebSocketError)(q)){let M=Date.now()-P;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:gn.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,_Mr.generateUuid)(),E=await this._fetchWithInstrumentation(e,l,r,s,c,d,f,{...h,modelCallId:y},m,g,A);if(d.isCancellationRequested){try{await E.body.destroy()}catch(T){this._logService.error(T,"Error destroying stream"),this._telemetryService.sendGHTelemetryException(T,"Error destroying stream")}return{result:{type:gn.FetchResponseKind.Canceled,reason:"after fetch request"},fetcher:E.fetcher,bytesReceived:E.bytesReceived}}if(E.status===200&&this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),E.status!==200){let T=o6i(e,c,l);return this._logService.info("Request ID for failed request: "+l),{result:await this._handleError(T,E,l),fetcher:E.fetcher,bytesReceived:E.bytesReceived,statusCode:E.status}}let _=n.extendedBy({modelCallId:y}),v,b=E.headers.get("x-github-request-id")??"";try{let T=await e.processResponseFromChatEndpoint(this._telemetryService,this._logService,E,u??1,o,_,d,c);v=new t6i.AsyncIterableObject(async w=>{try{for await(let R of T)w.emitOne(R)}catch(R){throw R.fetcherId=E.fetcher,R.gitHubRequestId=b,R.bytesReceived=E.bytesReceived,R}})}catch(T){throw T.fetcherId=E.fetcher,T.gitHubRequestId=b,T.bytesReceived=E.bytesReceived,T}return E.headers.get("Copilot-Edits-Session")&&(this._authenticationService.speculativeDecodingEndpointToken=E.headers.get("Copilot-Edits-Session")??void 0),this._chatQuotaService.processQuotaHeaders(E.headers),{result:{type:gn.FetchResponseKind.Success,chatCompletions:v},fetcher:E.fetcher,bytesReceived:E.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(E=>Array.isArray(E.content)?E.content.some(_=>"image_url"in _):!1)&&e.supportsVision&&(m["Copilot-Vision-Request"]="true");let g=Mye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.ChatLocation.toString(s),transport:"http",...u},{maxTokenWindow:e.modelMaxPromptTokens});for(let[E,_]of Object.entries(n))if(!(E==="messages"||E==="input")){if(E==="tools"){g.properties[`request.option.${E}`]=(0,on.stringifyToolsRawForTelemetry)(_)??"undefined";continue}g.properties[`request.option.${E}`]=JSON.stringify(_)??"undefined"}g.properties.headerRequestId=r,this._telemetryService.sendGHTelemetryEvent("request.sent",g.properties,g.measurements),n.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,SMr.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,on.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=TCt(s);return this._instantiationService.invokeFunction(bCt.postRequest,{endpointOrUrl:e,secretKey:o,intent:y,requestId:r,body:n,additionalHeaders:m,cancelToken:c,useFetcher:d,canRetryOnce:f,location:s,interactionTypeOverride:h}).then(E=>{let _=E.headers.get("apim-request-id");_&&this._logService.debug(`APIM request id: ${_}`);let v=E.headers.get("x-github-request-id");v&&this._logService.debug(`GH request id: ${v}`);let b=(0,yMr.getRequestId)(E.headers);b.headerRequestId=b.headerRequestId||r,g.extendWithRequestId(b),b.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",b.serverExperiments);let T=Date.now()-A;return g.measurements.totalTimeMs=T,this._logService.debug(`request.response: [${(0,bCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}], took ${T} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",g.properties,g.measurements),E}).catch(E=>{if(this._fetcherService.isAbortError(E))throw E;let _=g.extendedBy({error:"Network exception"});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",_.properties,_.measurements),g.properties.code=String(E.code??""),g.properties.errno=String(E.errno??""),g.properties.message=String(E.message??""),g.properties.type=String(E.type??"");let v=Date.now()-A;throw g.measurements.totalTimeMs=v,this._logService.debug(`request.response: [${(0,bCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}] took ${v} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",g.properties,g.measurements),E}).finally(()=>{let E=n.messages;if((!E||E.length===0)&&n.input)try{let _=(0,IBe.responseApiInputToRawMessagesForLogging)(n);E=(0,fI.rawMessageToCAPI)(_)}catch(_){this._logService.error("Failed to convert Response API input to messages for telemetry:",_),E=[]}(0,X8i.sendEngineMessagesTelemetry)(this._telemetryService,E??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,yMr.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service +`,X=[...l,{role:ovc.Raw.ChatRole.User,content:(0,xBe.toTextParts)(ke)}],ee=await this.fetchMany({...e,debugName:"retry-"+n,messages:X,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:ge.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:q},r);if(N?.resolve(ee,B.deltas),ee.type===zn.ChatFetchResponseType.Success)return ee}}return{type:zn.ChatFetchResponseType.Filtered,category:ge.category,reason:"Response got filtered.",requestId:ge.requestId,serverRequestId:ge.serverRequestId}}if(N?.resolve(ge,B.deltas),B.firstTokenEmittedTime!==void 0&&(Le=B.firstTokenEmittedTime-D.issuedTime),ge.type===zn.ChatFetchResponseType.Success&&ge.usage){typeof ge.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(ge.usage.copilot_usage.total_nano_aiu,y??A),le=(0,on.normalizeResponseModel)(o.model,ge.resolvedModel);let Ue={operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le};ge.usage.prompt_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.prompt_tokens,"input",Ue),ge.usage.completion_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.completion_tokens,"output",Ue),z?.setAttributes({[on.GenAiAttr.USAGE_INPUT_TOKENS]:ge.usage.prompt_tokens??0,[on.GenAiAttr.USAGE_OUTPUT_TOKENS]:ge.usage.completion_tokens??0,[on.GenAiAttr.RESPONSE_MODEL]:le??o.model,[on.GenAiAttr.RESPONSE_ID]:ge.requestId,[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...ge.usage.prompt_tokens_details?.cached_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cached_tokens}:{},...ge.usage.prompt_tokens_details?.cache_creation_input_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[on.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:re,[on.GenAiAttr.REQUEST_STREAM]:!0,...Le!==void 0&&Le>0?{[on.GenAiAttr.RESPONSE_TIME_TO_FIRST_CHUNK]:Le/1e3}:{},...ge.serverRequestId?{[on.CopilotChatAttr.SERVER_REQUEST_ID]:ge.serverRequestId}:{},...ge.usage.completion_tokens_details?.reasoning_tokens?{[on.GenAiAttr.USAGE_REASONING_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens,[on.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens}:{},...typeof ge.usage.copilot_usage?.total_nano_aiu=="number"?{[on.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:ge.usage.copilot_usage.total_nano_aiu}:{}})}if(z&&ge.type===zn.ChatFetchResponseType.Success){let Ue=B.deltas.map(K=>K.text).join(""),ke=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}))),X=[];if(Ue&&X.push({type:"text",content:Ue}),X.push(...ke),X.length>0&&z.setAttribute(on.GenAiAttr.OUTPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify([{role:"assistant",parts:X}]),this._otelService.config.maxAttributeSizeChars)),B.deltas.some(K=>K.thinking)){let he=B.deltas.filter(Z=>Z.thinking&&!(0,Avc.isEncryptedThinkingDelta)(Z.thinking)&&Z.thinking.text).map(Z=>{let ue=Z.thinking;return"encrypted"in ue?"":Array.isArray(ue.text)?ue.text.join(""):ue.text??""}).join("");z.setAttribute(on.CopilotChatAttr.REASONING_CONTENT,(0,on.truncateForOTel)(he||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}(0,on.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},ge.type===zn.ChatFetchResponseType.Success?{id:ge.requestId,model:(0,on.normalizeResponseModel)(o.model,ge.resolvedModel),finishReasons:["stop"],inputTokens:ge.usage?.prompt_tokens,outputTokens:ge.usage?.completion_tokens}:void 0),z?.end(),z=void 0,re>0&&on.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,re/1e3),Le!==void 0&&Le>0&&on.GenAiMetrics.recordTimeToFirstChunk(this._otelService,Le/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});for(let Ue of B.outputChunkGapsMs)on.GenAiMetrics.recordTimePerOutputChunk(this._otelService,Ue/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});return E&&ge.type===zn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),ge}case gn.FetchResponseKind.Canceled:return Mye.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,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:j,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,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,a6i.isBYOKModel)(o),isAuto:(0,bCt.isAutoModel)(o),bytesReceived:Q,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}),N?.resolveWithCancelation(),z?.setAttributes({[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[on.CopilotChatAttr.CANCELED]:!0}),z?.end(),z=void 0,this.processCanceledResponse(ie,T,B,f);case gn.FetchResponseKind.Failed:{let ge=this.processFailedResponse(ie,T,(0,bCt.isAutoModel)(o)===1),ke=this._configurationService.getExperimentBasedConfig(rV.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(K=>parseInt(K.trim(),10)),X=q&&U!==void 0&&ke.includes(U),ee=q&&E&&(ie.failKind===gn.ChatFailKind.ServerError||ie.failKind===gn.ChatFailKind.Unknown);if(X||ee){let{retryResult:K}=await this._retryAfterError({opts:e,processed:ge,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:re,transport:b,actualFetcher:j,bytesReceived:Q,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(K)return K}return Mye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:ge,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:re,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:j,bytesReceived:Q,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(ge),ge}}}catch(ie){z&&(z.setStatus(2,ie instanceof Error?ie.message:String(ie)),z.setAttribute(on.StdAttr.ERROR_TYPE,ie instanceof Error?ie.constructor.name:"Error"),z.setAttribute(on.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),z.recordException(ie),z.end());let H=Date.now()-D.issuedTime;ie.fetcherId&&(j=ie.fetcherId),ie.suspendEventSeen&&(Y=!0),ie.resumeEventSeen&&(W=!0);let re=this.processError(ie,T,ie.gitHubRequestId,O,(0,bCt.isAutoModel)(o)===1),le=q&&re.type===zn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(rV.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),Le=q&&E&&(re.type===zn.ChatFetchResponseType.NetworkError||re.type===zn.ChatFetchResponseType.Failed);if(le||Le){let{retryResult:ge,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:ke}=await this._retryAfterError({opts:e,processed:re,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:H,transport:b,actualFetcher:j,bytesReceived:ie.bytesReceived,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(ge)return ge;f={...f,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:ke}}return re.type===zn.ChatFetchResponseType.Canceled?Mye.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,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:j,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:H,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,a6i.isBYOKModel)(o),isAuto:(0,bCt.isAutoModel)(o),bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}):Mye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:re,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:H,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:j,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,SMr.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:E,pendingLoggedChatRequest:_,token:v,usernameToScrub:b,suspendEventSeen:T,resumeEventSeen:w,interactionType:R}=e,x=["darwin","linux"].includes(process.platform)&&n.reason.indexOf("net::ERR_NETWORK_CHANGED")!==-1,P=this._configurationService.getExperimentBasedConfig(rV.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===zn.ChatFetchResponseType.NetworkError&&n.isNetworkProcessCrash===!0&&P,N=x||D?"node-fetch":r.useFetcher;this._logService.info(`Retrying chat request with ${N||"default"} fetcher after: ${n.reasonDetail||n.reason}`);let L=await this._checkNetworkConnectivity(N),B=L.connectivityTestError?this.scrubErrorDetail(L.connectivityTestError,b):void 0,q=L.connectivityTestErrorGitHubRequestId;if(!L.retryRequest)return this._logService.info("Not retrying chat request as network connectivity could not be re-established."),{connectivityTestError:B,connectivityTestErrorGitHubRequestId:q};Mye.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:E+r.debugName,userInitiatedRequest:!1,telemetryProperties:{...o,retryAfterError:n.reasonDetail||n.reason,retryAfterErrorGitHubRequestId:n.serverRequestId,connectivityTestError:B,connectivityTestErrorGitHubRequestId:q},enableRetryOnError:!1,useFetcher:N},v);return _?.resolve(M,g.deltas),r.useWebSocket&&M.type===zn.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,b,T,w){let x=this._configurationService.getExperimentBasedConfig(rV.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==zn.ChatLocation.Other?this._powerService.acquirePowerSaveBlocker():void 0,P=!1,D=!1,N=this._powerService.onDidSuspend(()=>{P=!0,this._logService.info(`System suspended during streaming request ${u} (${zn.ChatLocation.toString(l)})`)}),L=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${zn.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,b,T,w),suspendEventSeen:P||void 0,resumeEventSeen:D||void 0}}catch(B){throw P&&(B.suspendEventSeen=!0),D&&(B.resumeEventSeen=!0),B}finally{N.dispose(),L.dispose(),x?.dispose()}}async _doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){if(f.isCancellationRequested)return{result:{type:gn.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,_Mr.getCurrentCapturingToken)()?.chatSessionId,P=(0,_Mr.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,_Mr.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[on.GenAiAttr.OPERATION_NAME]:on.GenAiOperationName.CHAT,[on.GenAiAttr.PROVIDER_NAME]:on.GenAiProviderName.GITHUB,[on.GenAiAttr.REQUEST_MODEL]:e.model,[on.GenAiAttr.CONVERSATION_ID]:E?.requestId??u,[on.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[on.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[on.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[on.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[on.StdAttr.SERVER_ADDRESS]:R}:{},...y?{[on.CopilotChatAttr.SESSION_ID]:y}:{},...x?{[on.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...P?{[on.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:P}:{},...D?{[on.CopilotChatAttr.DEBUG_LOG_LABEL]:D}:{}}}),L=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,SCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${q} due to missing key`),(0,i6i.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${q} due to missing key`),{result:{type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.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,E,b,T,w),otelSpan:N}:{...await this._doFetchViaHttp(e,r,n,o,s,l,u,d,f,m,E,_,v,b),otelSpan:N}}catch(B){throw N.setStatus(2,B instanceof Error?B.message:String(B)),N.setAttribute(on.StdAttr.ERROR_TYPE,B instanceof Error?B.constructor.name:"Error"),N.recordException(B),B}finally{let B=(Date.now()-L)/1e3;on.GenAiMetrics.recordOperationDuration(this._otelService,B,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=ICt(c),v=A??_,b={...s?{Authorization:`Bearer ${s}`}:{},"X-Request-Id":l,"OpenAI-Intent":_,"X-GitHub-Api-Version":"2025-05-01","X-Interaction-Id":this._interactionService.interactionId,...e.getExtraHeaders?e.getExtraHeaders(c,A):{}};b["X-Interaction-Type"]=v,b["X-Agent-Task-Id"]=l,r.messages?.some(M=>Array.isArray(M.content)?M.content.some(O=>"image_url"in O):!1)&&e.supportsVision&&(b["Copilot-Vision-Request"]="true");let T=this._webSocketManager.getOrCreateConnection(d,b,l);try{await T.connect()}catch(M){throw M.gitHubRequestId=T.gitHubRequestId,M}let w=(0,vMr.generateUuid)(),R=Oye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,EMr.getRequestId)(T.responseHeaders);x.headerRequestId=l,R.extendWithRequestId(x),x.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",x.serverExperiments);for(let[M,O]of Object.entries(r))if(!(M==="messages"||M==="input")){if(M==="tools"){R.properties[`request.option.${M}`]=(0,on.stringifyToolsRawForTelemetry)(O)??"undefined";continue}R.properties[`request.option.${M}`]=JSON.stringify(O)??"undefined"}this._telemetryService.sendGHTelemetryEvent("request.sent",R.properties,R.measurements),r.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,TMr.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,on.stringifyToolsRawForTelemetry)(r.tools)}),R.measurements);let P=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:E},f),N=n.extendedBy({modelCallId:w}),L=this._instantiationService.createInstance(wBe.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,wBe.getResponsesApiCompactionThresholdFromBody)(r)),B=new o6i.AsyncIterableObject(async M=>{try{await new Promise((j,Q)=>{D.onEvent(U=>{let Y=L.push(U,o);if(Y&&((0,wBe.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,Y,N),M.emitOne(Y)),U.type==="response.completed"){let W=U.copilot_quota_snapshots;W&&typeof W=="object"&&this._chatQuotaService.processQuotaSnapshots(W)}}),D.onCAPIError(U=>{let Y=new Error(`${U.error.message} (${U.error.code})`);Y.gitHubRequestId=x.gitHubRequestId,Y.capiWebSocketError=U,Q(Y)}),D.onError(U=>{if(U.gitHubRequestId=x.gitHubRequestId,(0,s6i.isCancellationError)(U)){Q(U);return}let Y=R.extendedBy({error:U.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",Y.properties,Y.measurements);let W=Date.now()-P;R.measurements.totalTimeMs=W,R.properties.error=U.message,this._logService.debug(`request.error: [websocket], took ${W} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),Q(U)}),D.done.then(j,Q)});let O=Date.now()-P;R.measurements.totalTimeMs=O,this._logService.debug(`request.response: [websocket], took ${O} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",R.properties,R.measurements)}finally{let O=r.messages;if((!O||O.length===0)&&r.input)try{let j=(0,wBe.responseApiInputToRawMessagesForLogging)(r);O=(0,hI.rawMessageToCAPI)(j)}catch(j){this._logService.error("Failed to convert Response API input to messages for telemetry:",j),O=[]}(0,n6i.sendEngineMessagesTelemetry)(this._telemetryService,O??[],R,!1,this._logService)}}),q=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:gn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,c6i.isCAPIWebSocketError)(q)){let M=Date.now()-P;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:gn.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,vMr.generateUuid)(),E=await this._fetchWithInstrumentation(e,l,r,s,c,d,f,{...h,modelCallId:y},m,g,A);if(d.isCancellationRequested){try{await E.body.destroy()}catch(T){this._logService.error(T,"Error destroying stream"),this._telemetryService.sendGHTelemetryException(T,"Error destroying stream")}return{result:{type:gn.FetchResponseKind.Canceled,reason:"after fetch request"},fetcher:E.fetcher,bytesReceived:E.bytesReceived}}if(E.status===200&&this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),E.status!==200){let T=l6i(e,c,l);return this._logService.info("Request ID for failed request: "+l),{result:await this._handleError(T,E,l),fetcher:E.fetcher,bytesReceived:E.bytesReceived,statusCode:E.status}}let _=n.extendedBy({modelCallId:y}),v,b=E.headers.get("x-github-request-id")??"";try{let T=await e.processResponseFromChatEndpoint(this._telemetryService,this._logService,E,u??1,o,_,d,c);v=new o6i.AsyncIterableObject(async w=>{try{for await(let R of T)w.emitOne(R)}catch(R){throw R.fetcherId=E.fetcher,R.gitHubRequestId=b,R.bytesReceived=E.bytesReceived,R}})}catch(T){throw T.fetcherId=E.fetcher,T.gitHubRequestId=b,T.bytesReceived=E.bytesReceived,T}return E.headers.get("Copilot-Edits-Session")&&(this._authenticationService.speculativeDecodingEndpointToken=E.headers.get("Copilot-Edits-Session")??void 0),this._chatQuotaService.processQuotaHeaders(E.headers),{result:{type:gn.FetchResponseKind.Success,chatCompletions:v},fetcher:E.fetcher,bytesReceived:E.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(E=>Array.isArray(E.content)?E.content.some(_=>"image_url"in _):!1)&&e.supportsVision&&(m["Copilot-Vision-Request"]="true");let g=Oye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.ChatLocation.toString(s),transport:"http",...u},{maxTokenWindow:e.modelMaxPromptTokens});for(let[E,_]of Object.entries(n))if(!(E==="messages"||E==="input")){if(E==="tools"){g.properties[`request.option.${E}`]=(0,on.stringifyToolsRawForTelemetry)(_)??"undefined";continue}g.properties[`request.option.${E}`]=JSON.stringify(_)??"undefined"}g.properties.headerRequestId=r,this._telemetryService.sendGHTelemetryEvent("request.sent",g.properties,g.measurements),n.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,TMr.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,on.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=ICt(s);return this._instantiationService.invokeFunction(SCt.postRequest,{endpointOrUrl:e,secretKey:o,intent:y,requestId:r,body:n,additionalHeaders:m,cancelToken:c,useFetcher:d,canRetryOnce:f,location:s,interactionTypeOverride:h}).then(E=>{let _=E.headers.get("apim-request-id");_&&this._logService.debug(`APIM request id: ${_}`);let v=E.headers.get("x-github-request-id");v&&this._logService.debug(`GH request id: ${v}`);let b=(0,EMr.getRequestId)(E.headers);b.headerRequestId=b.headerRequestId||r,g.extendWithRequestId(b),b.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",b.serverExperiments);let T=Date.now()-A;return g.measurements.totalTimeMs=T,this._logService.debug(`request.response: [${(0,SCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}], took ${T} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",g.properties,g.measurements),E}).catch(E=>{if(this._fetcherService.isAbortError(E))throw E;let _=g.extendedBy({error:"Network exception"});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",_.properties,_.measurements),g.properties.code=String(E.code??""),g.properties.errno=String(E.errno??""),g.properties.message=String(E.message??""),g.properties.type=String(E.type??"");let v=Date.now()-A;throw g.measurements.totalTimeMs=v,this._logService.debug(`request.response: [${(0,SCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}] took ${v} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",g.properties,g.measurements),E}).finally(()=>{let E=n.messages;if((!E||E.length===0)&&n.input)try{let _=(0,wBe.responseApiInputToRawMessagesForLogging)(n);E=(0,hI.rawMessageToCAPI)(_)}catch(_){this._logService.error("Failed to convert Response API input to messages for telemetry:",_),E=[]}(0,n6i.sendEngineMessagesTelemetry)(this._telemetryService,E??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,EMr.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service -`+s};if(r.status===424)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,e6i.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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,b){let T=[];for await(let P of e.chatCompletions)Nye.ChatMLFetcherTelemetrySender.sendSuccessTelemetry(this._telemetryService,{chatCompletion:P,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:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}),this.isRepetitive(P,f?.properties)||T.push(P);let w=new Set([fI.FinishedCompletionReason.Stop,fI.FinishedCompletionReason.ClientTrimmed,fI.FinishedCompletionReason.FunctionCall,fI.FinishedCompletionReason.ToolCalls]),R=T.filter(P=>w.has(P.finishReason));if(R.length>=1)return{type:zn.ChatFetchResponseType.Success,resolvedModel:R[0].model,usage:R.length===1?R[0].usage:void 0,value:R.map(P=>(0,TBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:b};let x=T.at(0);switch(x?.finishReason){case fI.FinishedCompletionReason.ContentFilter:return{type:zn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??fI.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(P=>(0,TBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case fI.FinishedCompletionReason.Length:return{type:zn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,TBe.getTextPart)(x.message.content)};case fI.FinishedCompletionReason.ServerError:return{type:zn.ChatFetchResponseType.Failed,reason:"Server error. Stream terminated",requestId:s,serverRequestId:x.requestId.headerRequestId,streamError:x.error}}return{type:zn.ChatFetchResponseType.Unknown,reason:zn.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,SCt.calculateLineRepetitionStats)((0,TBe.getTextPart)(e.message.content)),o=(0,SCt.isRepetitive)(e.tokens);if(o){let s=Mye.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,SCt.calculateLineRepetitionStats)(o);if((0,SCt.isRepetitive)(s)){let d=Mye.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:zn.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===gn.ChatFailKind.RateLimited)return{type:zn.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===gn.ChatFailKind.QuotaExceeded)return{type:zn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===gn.ChatFailKind.OffTopic)return{type:zn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===gn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:zn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ServerError)return{type:zn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ContentFilter)return{type:zn.ChatFetchResponseType.PromptFiltered,reason:s,category:fI.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentUnauthorized)return{type:zn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentFailedDependency)return{type:zn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:zn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===gn.ChatFailKind.NotFound?{type:zn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===gn.ChatFailKind.InvalidPreviousResponseId?{type:zn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:zn.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:zn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,r6i.isCancellationError)(e))return{type:zn.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:zn.ChatFetchResponseType.Canceled,reason:"Stream closed prematurely",requestId:r,serverRequestId:n};this._logService.error(fvc.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,bMr.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:zn.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:zn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:zn.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:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.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:zn.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:zn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:zn.ChatFetchResponseType.PromptFiltered,reason:c,category:fI.FilterReason.Prompt,requestId:r,serverRequestId:n}:s==="not_found"?{type:zn.ChatFetchResponseType.NotFound,reason:c,requestId:r,serverRequestId:n}:s==="bad_request"?{type:zn.ChatFetchResponseType.BadRequest,reason:c,requestId:r,serverRequestId:n}:{type:zn.ChatFetchResponseType.Failed,reason:`Request Failed: ${s} ${c||"WebSocket server error"}`,requestId:r,serverRequestId:n}}scrubErrorDetail(e,r){if(r){let n=new RegExp((0,mvc.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};pI.ChatMLFetcherImpl=TMr;pI.ChatMLFetcherImpl=TMr=CMr=Z_c([qv(0,avc.IFetcherService),qv(1,SMr.ITelemetryService),qv(2,lvc.IRequestLogger),qv(3,bMr.ILogService),qv(4,evc.IAuthenticationService),qv(5,ivc.IInteractionService),qv(6,rvc.IChatQuotaService),qv(7,ovc.ICAPIClientService),qv(8,nvc.IConversationOptions),qv(9,tV.IConfigurationService),qv(10,uvc.IExperimentationService),qv(11,yvc.IPowerService),qv(12,gvc.IInstantiationService),qv(13,i6i.IChatWebSocketManager),qv(14,cvc.IOTelService)],TMr);function Evc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:vMr("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:vMr("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:vMr("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>tV.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${tV.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-tV.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(Evc,"isValidChatPayload");function vMr(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(vMr,"asUnexpected");function o6i(t,e,r){return Mye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.ChatLocation.toString(e),headerRequestId:r})}a(o6i,"createTelemetryData");function TCt(t){switch(t){case zn.ChatLocation.Panel:return"conversation-panel";case zn.ChatLocation.Editor:return"conversation-inline";case zn.ChatLocation.EditingSession:return"conversation-edits";case zn.ChatLocation.Notebook:return"conversation-notebook";case zn.ChatLocation.Terminal:return"conversation-terminal";case zn.ChatLocation.Other:return"conversation-other";case zn.ChatLocation.Agent:return"conversation-agent";case zn.ChatLocation.ResponsesProxy:return"responses-proxy";case zn.ChatLocation.MessagesProxy:return"messages-proxy"}}a(TCt,"locationToIntent");function _vc(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(_vc,"pickCacheRelevantRequestOptions");function vvc(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(vvc,"pickRequestShapeMetadata")});var xMr=I(Oye=>{"use strict";p();Object.defineProperty(Oye,"__esModule",{value:!0});Oye.NullSimilarFilesContextService=Oye.ISimilarFilesContextService=void 0;var Cvc=nn();Oye.ISimilarFilesContextService=(0,Cvc.createServiceIdentifier)("ISimilarFilesContextService");var IMr=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};Oye.NullSimilarFilesContextService=IMr});var wMr=I(xCt=>{"use strict";p();Object.defineProperty(xCt,"__esModule",{value:!0});xCt.IDiffService=void 0;var bvc=nn();xCt.IDiffService=(0,bvc.createServiceIdentifier)("IDiffService")});var a6i=I(RMr=>{"use strict";p();Object.defineProperty(RMr,"__esModule",{value:!0});RMr.createProxyXtabEndpoint=xvc;var Svc=(Sne(),ba(bne)),Tvc=Qne(),Ivc=Gne();function xvc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:Svc.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:Tvc.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(Ivc.ChatEndpoint,r)}a(xvc,"createProxyXtabEndpoint")});var Vne=I(wCt=>{"use strict";p();Object.defineProperty(wCt,"__esModule",{value:!0});wCt.DocumentId=void 0;var wvc=WJe(),c6i=NA(),Rvc=nd(),kMr=class t{static{a(this,"DocumentId")}static{this._cache=new wvc.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=Rvc.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,c6i.basename)(this.uri)}get extension(){return(0,c6i.extname)(this.uri)}toUri(){return this._uri}};wCt.DocumentId=kMr});var PMr=I(RCt=>{"use strict";p();Object.defineProperty(RCt,"__esModule",{value:!0});RCt.NextCursorLinePrediction=void 0;var l6i;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(l6i||(RCt.NextCursorLinePrediction=l6i={}))});var kCt=I(rV=>{"use strict";p();Object.defineProperty(rV,"__esModule",{value:!0});rV.NullUndesiredModelsManager=rV.IUndesiredModelsManager=rV.IInlineEditsModelService=void 0;var u6i=nn(),kvc=Ic();rV.IInlineEditsModelService=(0,u6i.createServiceIdentifier)("IInlineEditsModelService");rV.IUndesiredModelsManager=(0,u6i.createServiceIdentifier)("IUndesiredModelsManager");var DMr=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=kvc.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};rV.NullUndesiredModelsManager=DMr});var d6i=I(t9=>{"use strict";p();Object.defineProperty(t9,"__esModule",{value:!0});t9.IgnoreWhitespaceOnlyChanges=t9.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;t9.editWouldDeleteWhatWasJustInserted=Pvc;t9.editIsDeletion=OMr;t9.editWouldDeleteWhatWasJustInserted2=Dvc;var NMr=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}};t9.IgnoreWhitespaceOnlyChanges=MMr;function Pvc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!OMr(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(Pvc,"editWouldDeleteWhatWasJustInserted");function OMr(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(OMr,"editIsDeletion");function Dvc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!OMr(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(Dvc,"editWouldDeleteWhatWasJustInserted2")});var BMr=I(Lye=>{"use strict";p();Object.defineProperty(Lye,"__esModule",{value:!0});Lye.NulSimulationTestContext=Lye.ISimulationTestContext=void 0;var Nvc=nn();Lye.ISimulationTestContext=(0,Nvc.createServiceIdentifier)("ISimulationTestContext");var LMr=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};Lye.NulSimulationTestContext=LMr});var DCt=I(PCt=>{"use strict";p();Object.defineProperty(PCt,"__esModule",{value:!0});PCt.BaseAlternativeNotebookContentProvider=void 0;var FMr=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};PCt.BaseAlternativeNotebookContentProvider=FMr});var QMr=I(uN=>{"use strict";p();Object.defineProperty(uN,"__esModule",{value:!0});uN.DEFAULT_WORD_REGEXP=uN.USUAL_WORD_SEPARATORS=void 0;uN.ensureValidWordDefinition=f6i;uN.setDefaultGetWordAtTextConfig=Fvc;uN.getWordAtText=p6i;var Mvc=fjt(),Ovc=Ro(),Lvc=vue();uN.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Bvc(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of uN.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(Bvc,"createWordRegExp");uN.DEFAULT_WORD_REGEXP=Bvc();function f6i(t){let e=uN.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(f6i,"ensureValidWordDefinition");var UMr=new Lvc.LinkedList;UMr.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Fvc(t){let e=UMr.unshift(t);return(0,Ovc.toDisposable)(e)}a(Fvc,"setDefaultGetWordAtTextConfig");function p6i(t,e,r,n,o){if(e=f6i(e),o||(o=Mvc.Iterable.first(UMr)),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),p6i(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=Uvc(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(p6i,"getWordAtText");function Uvc(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(Uvc,"_findRegexMatchEnclosingPosition")});var h6i=I(NCt=>{"use strict";p();Object.defineProperty(NCt,"__esModule",{value:!0});NCt.toUint8=Qvc;NCt.toUint32=qvc;function Qvc(t){return t<0?0:t>255?255:t|0}a(Qvc,"toUint8");function qvc(t){return t<0?0:t>4294967295?4294967295:t|0}a(qvc,"toUint32")});var m6i=I(nV=>{"use strict";p();Object.defineProperty(nV,"__esModule",{value:!0});nV.PrefixSumIndexOfResult=nV.ConstantTimePrefixSumComputer=nV.PrefixSumComputer=void 0;var jvc=Sl(),Bye=h6i(),qMr=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,Bye.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,Bye.toUint32)(e),r=(0,Bye.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,Bye.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 Fye(o,e-c)}};nV.PrefixSumComputer=qMr;var jMr=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 Fye(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new Fye(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,jvc.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))}};nV.ConstantTimePrefixSumComputer=jMr;var Fye=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};nV.PrefixSumIndexOfResult=Fye});var GMr=I(MCt=>{"use strict";p();Object.defineProperty(MCt,"__esModule",{value:!0});MCt.PositionOffsetTransformer=void 0;var g6i=em(),A6i=kE(),Hvc=hd(),Gvc=m6i(),Wne=P0(),HMr=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,g6i.splitLines)(e),this._eol=e.charAt(this._lines[0].length)==="\r"?`\r +`+s};if(r.status===424)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,i6i.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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,b){let T=[];for await(let P of e.chatCompletions)Mye.ChatMLFetcherTelemetrySender.sendSuccessTelemetry(this._telemetryService,{chatCompletion:P,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:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}),this.isRepetitive(P,f?.properties)||T.push(P);let w=new Set([hI.FinishedCompletionReason.Stop,hI.FinishedCompletionReason.ClientTrimmed,hI.FinishedCompletionReason.FunctionCall,hI.FinishedCompletionReason.ToolCalls]),R=T.filter(P=>w.has(P.finishReason));if(R.length>=1)return{type:zn.ChatFetchResponseType.Success,resolvedModel:R[0].model,usage:R.length===1?R[0].usage:void 0,value:R.map(P=>(0,xBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:b};let x=T.at(0);switch(x?.finishReason){case hI.FinishedCompletionReason.ContentFilter:return{type:zn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??hI.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(P=>(0,xBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case hI.FinishedCompletionReason.Length:return{type:zn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,xBe.getTextPart)(x.message.content)};case hI.FinishedCompletionReason.ServerError:return{type:zn.ChatFetchResponseType.Failed,reason:"Server error. Stream terminated",requestId:s,serverRequestId:x.requestId.headerRequestId,streamError:x.error}}return{type:zn.ChatFetchResponseType.Unknown,reason:zn.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,TCt.calculateLineRepetitionStats)((0,xBe.getTextPart)(e.message.content)),o=(0,TCt.isRepetitive)(e.tokens);if(o){let s=Oye.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,TCt.calculateLineRepetitionStats)(o);if((0,TCt.isRepetitive)(s)){let d=Oye.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:zn.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===gn.ChatFailKind.RateLimited)return{type:zn.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===gn.ChatFailKind.QuotaExceeded)return{type:zn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===gn.ChatFailKind.OffTopic)return{type:zn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===gn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:zn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ServerError)return{type:zn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ContentFilter)return{type:zn.ChatFetchResponseType.PromptFiltered,reason:s,category:hI.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentUnauthorized)return{type:zn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentFailedDependency)return{type:zn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:zn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===gn.ChatFailKind.NotFound?{type:zn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===gn.ChatFailKind.InvalidPreviousResponseId?{type:zn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:zn.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:zn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,s6i.isCancellationError)(e))return{type:zn.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:zn.ChatFetchResponseType.Canceled,reason:"Stream closed prematurely",requestId:r,serverRequestId:n};this._logService.error(yvc.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,SMr.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:zn.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:zn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:zn.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:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.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:zn.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:zn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:zn.ChatFetchResponseType.PromptFiltered,reason:c,category:hI.FilterReason.Prompt,requestId:r,serverRequestId:n}:s==="not_found"?{type:zn.ChatFetchResponseType.NotFound,reason:c,requestId:r,serverRequestId:n}:s==="bad_request"?{type:zn.ChatFetchResponseType.BadRequest,reason:c,requestId:r,serverRequestId:n}:{type:zn.ChatFetchResponseType.Failed,reason:`Request Failed: ${s} ${c||"WebSocket server error"}`,requestId:r,serverRequestId:n}}scrubErrorDetail(e,r){if(r){let n=new RegExp((0,vvc.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};mI.ChatMLFetcherImpl=IMr;mI.ChatMLFetcherImpl=IMr=bMr=ivc([jv(0,pvc.IFetcherService),jv(1,TMr.ITelemetryService),jv(2,mvc.IRequestLogger),jv(3,SMr.ILogService),jv(4,svc.IAuthenticationService),jv(5,uvc.IInteractionService),jv(6,cvc.IChatQuotaService),jv(7,dvc.ICAPIClientService),jv(8,lvc.IConversationOptions),jv(9,rV.IConfigurationService),jv(10,gvc.IExperimentationService),jv(11,Svc.IPowerService),jv(12,Cvc.IInstantiationService),jv(13,c6i.IChatWebSocketManager),jv(14,hvc.IOTelService)],IMr);function Tvc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:CMr("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:CMr("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:CMr("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>rV.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${rV.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-rV.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(Tvc,"isValidChatPayload");function CMr(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(CMr,"asUnexpected");function l6i(t,e,r){return Oye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.ChatLocation.toString(e),headerRequestId:r})}a(l6i,"createTelemetryData");function ICt(t){switch(t){case zn.ChatLocation.Panel:return"conversation-panel";case zn.ChatLocation.Editor:return"conversation-inline";case zn.ChatLocation.EditingSession:return"conversation-edits";case zn.ChatLocation.Notebook:return"conversation-notebook";case zn.ChatLocation.Terminal:return"conversation-terminal";case zn.ChatLocation.Other:return"conversation-other";case zn.ChatLocation.Agent:return"conversation-agent";case zn.ChatLocation.ResponsesProxy:return"responses-proxy";case zn.ChatLocation.MessagesProxy:return"messages-proxy"}}a(ICt,"locationToIntent");function Ivc(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(Ivc,"pickCacheRelevantRequestOptions");function xvc(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(xvc,"pickRequestShapeMetadata")});var wMr=I(Lye=>{"use strict";p();Object.defineProperty(Lye,"__esModule",{value:!0});Lye.NullSimilarFilesContextService=Lye.ISimilarFilesContextService=void 0;var wvc=nn();Lye.ISimilarFilesContextService=(0,wvc.createServiceIdentifier)("ISimilarFilesContextService");var xMr=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};Lye.NullSimilarFilesContextService=xMr});var RMr=I(wCt=>{"use strict";p();Object.defineProperty(wCt,"__esModule",{value:!0});wCt.IDiffService=void 0;var Rvc=nn();wCt.IDiffService=(0,Rvc.createServiceIdentifier)("IDiffService")});var d6i=I(kMr=>{"use strict";p();Object.defineProperty(kMr,"__esModule",{value:!0});kMr.createProxyXtabEndpoint=Nvc;var kvc=(Sne(),Ca(bne)),Pvc=Qne(),Dvc=Gne();function Nvc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:kvc.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:Pvc.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(Dvc.ChatEndpoint,r)}a(Nvc,"createProxyXtabEndpoint")});var Vne=I(RCt=>{"use strict";p();Object.defineProperty(RCt,"__esModule",{value:!0});RCt.DocumentId=void 0;var Mvc=KJe(),f6i=NA(),Ovc=nd(),PMr=class t{static{a(this,"DocumentId")}static{this._cache=new Mvc.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=Ovc.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,f6i.basename)(this.uri)}get extension(){return(0,f6i.extname)(this.uri)}toUri(){return this._uri}};RCt.DocumentId=PMr});var DMr=I(kCt=>{"use strict";p();Object.defineProperty(kCt,"__esModule",{value:!0});kCt.NextCursorLinePrediction=void 0;var p6i;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(p6i||(kCt.NextCursorLinePrediction=p6i={}))});var PCt=I(nV=>{"use strict";p();Object.defineProperty(nV,"__esModule",{value:!0});nV.NullUndesiredModelsManager=nV.IUndesiredModelsManager=nV.IInlineEditsModelService=void 0;var h6i=nn(),Lvc=Ic();nV.IInlineEditsModelService=(0,h6i.createServiceIdentifier)("IInlineEditsModelService");nV.IUndesiredModelsManager=(0,h6i.createServiceIdentifier)("IUndesiredModelsManager");var NMr=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=Lvc.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};nV.NullUndesiredModelsManager=NMr});var m6i=I(r9=>{"use strict";p();Object.defineProperty(r9,"__esModule",{value:!0});r9.IgnoreWhitespaceOnlyChanges=r9.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;r9.editWouldDeleteWhatWasJustInserted=Bvc;r9.editIsDeletion=LMr;r9.editWouldDeleteWhatWasJustInserted2=Fvc;var MMr=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}};r9.IgnoreWhitespaceOnlyChanges=OMr;function Bvc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!LMr(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(Bvc,"editWouldDeleteWhatWasJustInserted");function LMr(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(LMr,"editIsDeletion");function Fvc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!LMr(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(Fvc,"editWouldDeleteWhatWasJustInserted2")});var FMr=I(Bye=>{"use strict";p();Object.defineProperty(Bye,"__esModule",{value:!0});Bye.NulSimulationTestContext=Bye.ISimulationTestContext=void 0;var Uvc=nn();Bye.ISimulationTestContext=(0,Uvc.createServiceIdentifier)("ISimulationTestContext");var BMr=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};Bye.NulSimulationTestContext=BMr});var NCt=I(DCt=>{"use strict";p();Object.defineProperty(DCt,"__esModule",{value:!0});DCt.BaseAlternativeNotebookContentProvider=void 0;var UMr=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};DCt.BaseAlternativeNotebookContentProvider=UMr});var qMr=I(dN=>{"use strict";p();Object.defineProperty(dN,"__esModule",{value:!0});dN.DEFAULT_WORD_REGEXP=dN.USUAL_WORD_SEPARATORS=void 0;dN.ensureValidWordDefinition=g6i;dN.setDefaultGetWordAtTextConfig=Gvc;dN.getWordAtText=A6i;var Qvc=pjt(),qvc=ko(),jvc=vue();dN.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Hvc(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of dN.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(Hvc,"createWordRegExp");dN.DEFAULT_WORD_REGEXP=Hvc();function g6i(t){let e=dN.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(g6i,"ensureValidWordDefinition");var QMr=new jvc.LinkedList;QMr.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Gvc(t){let e=QMr.unshift(t);return(0,qvc.toDisposable)(e)}a(Gvc,"setDefaultGetWordAtTextConfig");function A6i(t,e,r,n,o){if(e=g6i(e),o||(o=Qvc.Iterable.first(QMr)),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),A6i(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=$vc(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(A6i,"getWordAtText");function $vc(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($vc,"_findRegexMatchEnclosingPosition")});var y6i=I(MCt=>{"use strict";p();Object.defineProperty(MCt,"__esModule",{value:!0});MCt.toUint8=Vvc;MCt.toUint32=Wvc;function Vvc(t){return t<0?0:t>255?255:t|0}a(Vvc,"toUint8");function Wvc(t){return t<0?0:t>4294967295?4294967295:t|0}a(Wvc,"toUint32")});var E6i=I(iV=>{"use strict";p();Object.defineProperty(iV,"__esModule",{value:!0});iV.PrefixSumIndexOfResult=iV.ConstantTimePrefixSumComputer=iV.PrefixSumComputer=void 0;var zvc=Sl(),Fye=y6i(),jMr=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,Fye.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,Fye.toUint32)(e),r=(0,Fye.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,Fye.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 Uye(o,e-c)}};iV.PrefixSumComputer=jMr;var HMr=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 Uye(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new Uye(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,zvc.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))}};iV.ConstantTimePrefixSumComputer=HMr;var Uye=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};iV.PrefixSumIndexOfResult=Uye});var $Mr=I(OCt=>{"use strict";p();Object.defineProperty(OCt,"__esModule",{value:!0});OCt.PositionOffsetTransformer=void 0;var _6i=em(),v6i=kE(),Yvc=hd(),Kvc=E6i(),Wne=P0(),GMr=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,_6i.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,g6i.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 Wne.TextEdit(this.validateRange(n.range),n.newText));return new A6i.StringEdit(r.map(n=>new A6i.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new Wne.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof Wne.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 Wne.Position(r,n):e}validateRange(e){return new Wne.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};MCt.PositionOffsetTransformer=HMr});var VMr=I(zne=>{"use strict";p();Object.defineProperty(zne,"__esModule",{value:!0});zne.SnapshotDocumentLine=zne.TextDocumentSnapshot=void 0;zne.isTextDocumentSnapshotJSON=Vvc;var OCt=KS(),E6i=nd(),y6i=QMr(),Uye=P0(),$vc=GMr();function Vvc(t){return!t||typeof t!="object"?!1:(0,E6i.isUriComponents)(t.uri)&&(0,OCt.isString)(t._text)&&(0,OCt.isString)(t.languageId)&&(0,OCt.isNumber)(t.version)&&(0,OCt.isNumber)(t.eol)}a(Vvc,"isTextDocumentSnapshotJSON");var $Mr=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,E6i.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new $vc.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 Uye.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 LCt(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,y6i.getWordAtText)(r.character+1,y6i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new Uye.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 Uye.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 Uye.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};zne.TextDocumentSnapshot=$Mr;var LCt=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 Uye.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Uye.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}};zne.SnapshotDocumentLine=LCt});var UCt=I(FCt=>{"use strict";p();Object.defineProperty(FCt,"__esModule",{value:!0});FCt.AlternativeNotebookDocument=void 0;var _6i=QMr(),BCt=P0(),Wvc=GMr(),zvc=VMr(),WMr=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new Wvc.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,_6i.getWordAtText)(r.character+1,_6i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new BCt.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 BCt.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 zvc.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 BCt.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 BCt.Position(r,n):e}};FCt.AlternativeNotebookDocument=WMr});var QCt=I(Qye=>{"use strict";p();Object.defineProperty(Qye,"__esModule",{value:!0});Qye.isUri=Kvc;Qye.isLocation=zMr;Qye.toLocation=Jvc;Qye.isSymbolInformation=Zvc;var xBe=P0(),Yvc=nd();function Kvc(t){return Yvc.URI.isUri(t)}a(Kvc,"isUri");function zMr(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(zMr,"isLocation");function Jvc(t){if(zMr(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new xBe.Location(t.uri,new xBe.Range(new xBe.Position(e.line,e.character),new xBe.Position(r.line,r.character)))}else if(zMr(t)&&t.range instanceof xBe.Range)return t}a(Jvc,"toLocation");function Zvc(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(Zvc,"isSymbolInformation")});var kBe=I(Sy=>{"use strict";p();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.CellIdPatternRe=Sy.EOL=Sy.LineOfText=void 0;Sy.summarize=eCc;Sy.notebookCellToCellData=tCc;Sy.getCellIdMap=rCc;Sy.normalizeCellId=nCc;Sy.getNotebookId=iCc;Sy.getCellId=JMr;Sy.getDefaultLanguage=sCc;Sy.requestHasNotebookRefs=cCc;Sy.parseAndCleanStack=lCc;var v6i=QCt(),T6i=rNr(),Xvc=em(),C6i=nd(),KMr=P0(),YMr=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};Sy.LineOfText=YMr;Sy.EOL=` -`;function eCc(t){let e=t.kind===KMr.NotebookCellKind.Code?"code":"markdown",r=JMr(t),n=oCc(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(eCc,"summarize");function tCc(t){let e=new KMr.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(tCc,"notebookCellToCellData");function rCc(t){let e=new Map;return t.getCells().forEach(r=>{e.set(JMr(r),r)}),e}a(rCc,"getCellIdMap");var b6i=new WeakMap,RBe=8,wBe="#VSC-";Sy.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${RBe}})\\b`,"gi");function nCc(t){return t.startsWith(wBe)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===RBe+3?`${wBe}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===RBe+7?`${wBe}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===RBe?`${wBe}${t}`:t}a(nCc,"normalizeCellId");var S6i=new WeakMap;function iCc(t){let e=S6i.get(t);if(e)return e;let r=new T6i.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),S6i.set(t,e),e}a(iCc,"getNotebookId");function JMr(t){let e=b6i.get(t);if(e)return e;let r=new T6i.StringSHA1;return r.update(t.document.uri.toString()),e=`${wBe}${r.digest().substring(0,RBe)}`,b6i.set(t,e),e}a(JMr,"getCellId");function oCc(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(oCc,"getCellCode");function sCc(t){let e=t.getCells().find(r=>r.kind===KMr.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(sCc,"getDefaultLanguage");var aCc=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function cCc(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&aCc.some(o=>n.includes(o))?!0:t.references.some(o=>(0,v6i.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,C6i.isUriComponents)(o.value)?e.hasSupportedNotebooks(C6i.URI.revive(o.value)):(0,v6i.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(cCc,"requestHasNotebookRefs");function lCc(t){try{let e=JSON.parse(t);return(0,Xvc.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(lCc,"parseAndCleanStack")});var w6i=I(PBe=>{"use strict";p();Object.defineProperty(PBe,"__esModule",{value:!0});PBe.AlternativeJsonNotebookContentProvider=void 0;PBe.isJsonContent=hCc;var uCc=(zdr(),ba(RJn)),dCc=nl(),I6i=nd(),dN=P0(),fCc=DCt(),pCc=UCt(),qye=kBe(),x6i=4;function hCc(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(hCc,"isJsonContent");var qCt=class extends pCc.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,qye.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 dN.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new dN.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},ZMr=class extends fCc.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 qCt(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==dN.NotebookCellKind.Markup:!0).map(c=>{let l=(0,qye.summarize)(c),u=mCc(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,x6i);return new qCt(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,qye.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,x6i).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(qye.EOL)}parseAlternateContentImpl(e,r,n){return new dCc.AsyncIterableObject(async o=>{let s=I6i.URI.isUri(e)?new Map:(0,qye.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:dN.NotebookCellKind.Code,source:[]},f=I6i.URI.isUri(e)?"python":(0,qye.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"?dN.NotebookCellKind.Markup:dN.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,uCc.visit)(l,{onObjectEnd(y,E,_,v){m=y},onLiteralValue:a((y,E,_,v,b,T)=>{if(u>=E)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=E,d.index!==-1&&d.index!==R&&(h(E),d.startOffset=E,d.id=void 0,d.kind=dN.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?dN.NotebookCellKind.Code:dN.NotebookCellKind.Markup,d.kind===dN.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=dN.NotebookCellKind.Markup);else if(x==="source"&&w.length&&typeof w[0]=="number"){w[0]===0&&(d.startOffset=E);let P=typeof y=="string"?y:`${y||""}`;P.endsWith(` -`)&&(P=P.substr(0,P.length-1)),d.source.push(P)}},"onLiteralValue")})}d.index!==-1&&h(m)})}};PBe.AlternativeJsonNotebookContentProvider=ZMr;function mCc(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(mCc,"getCellCode")});var eOr=I(iV=>{"use strict";p();Object.defineProperty(iV,"__esModule",{value:!0});iV.wellKnownLanguages=void 0;iV.getLanguage=R6i;iV.getLanguageForResource=yCc;var gCc=ZP(),ACc=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"]}});iV.wellKnownLanguages=new Map(Object.entries(ACc).map(([t,e])=>[t,{languageId:t,...e}]));function R6i(t){return XMr(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(R6i,"getLanguage");function XMr(t){return iV.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(XMr,"_getLanguage");function yCc(t){let e=(0,gCc.extname)(t).toLowerCase();for(let r of iV.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return R6i("plaintext")}a(yCc,"getLanguageForResource")});var D6i=I(oV=>{"use strict";p();Object.defineProperty(oV,"__esModule",{value:!0});oV.AlternativeTextNotebookContentProvider=void 0;oV.generateCellTextMarker=nOr;oV.lineMightHaveCellMarker=iOr;oV.getBlockComment=Hye;oV.getLineCommentStart=Gye;var rOr=eOr(),ECc=QCt(),_Cc=xq(),jye=P0(),vCc=DCt(),CCc=UCt(),Bm=kBe();function nOr(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(nOr,"generateCellTextMarker");function iOr(t){return t.toLowerCase().includes("vscode.cell")}a(iOr,"lineMightHaveCellMarker");var jCt=class extends CCc.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,Bm.summarize)(e),o=Gye(this.notebook),s=nOr(n,o),c=e.document.eol===jye.EndOfLine.LF?1:2,l=Hye(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===jye.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,_Cc.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}}},tOr=class extends vCc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(Bm.EOL);return r.length&&iOr(r[0])?(r.shift(),r.join(Bm.EOL)):e}getSummaryOfStructure(e,r,n){let o=Hye(e),s=Gye(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,Bm.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(k6i(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(Bm.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,ECc.isUri)(e),s=o?(0,Bm.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=Gye(o?e:void 0),m=Hye(o?e:void 0),g=o?(0,rOr.getLanguage)((0,Bm.getDefaultLanguage)(e)).languageId:void 0,A=new Set;for await(let y of r){if(n.isCancellationRequested)break;let E=y.value,_=E.startsWith(`${h}%% [`)&&E.trimEnd().endsWith("]"),v=E.startsWith(`${h}%% vscode.cell`),b=v||_?P6i(E,g):void 0;if((v||_)&&b?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:jye.NotebookCellKind.Code,emitted:!1,type:"start"};T.index=f+=1,T.emitted=!1,b.id&&s.get(b.id)?.document.languageId===b.language?A.has(b.id)?b.id="":A.add(b.id):b.id="";let w=s.get(b.id);T.id=b.id,T.language=b.language,T.uri=w?.document.uri,T.kind=w?.kind||(T.language==="markdown"?jye.NotebookCellKind.Markup:jye.NotebookCellKind.Code),c=T.language==="markdown",l=!1,d&&(yield{index:f-1,type:"end"}),d=!0,yield T;continue}d&&(c?l?E===m[1]?(l=!1,u=!0):yield{index:f,line:E,type:"line"}:E===m[0]?l=!0:yield{index:f,line:E,type:"line"}:yield{index:f,line:E,type:"line"})}d&&(yield{index:f,type:"end"})}getAlternativeDocumentFromText(e,r){let n=Hye(r),o=Gye(r),s=(0,Bm.getCellIdMap)(r),c=[],l=e.split(Bm.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(E=>E.cell===y));if(A){let y=u,E=Bm.EOL.length,_=g.language==="markdown",v=y+f.length+E+(_?n[0].length+E:0);c.push({offset:y,sourceOffset:v,cell:A})}}}u+=f.length+Bm.EOL.length}return new jCt(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==jye.NotebookCellKind.Markup:!0).map(d=>(0,Bm.summarize)(d)),o=Hye(e),s=Gye(e),c=n.map(d=>({...k6i(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(Bm.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 jCt(l,u,e)}};oV.AlternativeTextNotebookContentProvider=tOr;function k6i(t,e,r){let n=nOr(t,e),o=t.source.join(Bm.EOL),s=t.language==="markdown"?`${n}${Bm.EOL}${r[0]}${Bm.EOL}`:`${n}${Bm.EOL}`;return{content:t.language==="markdown"?`${s}${o}${Bm.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(k6i,"generateAlternativeCellTextContent");function Hye(t){return t?(0,rOr.getLanguage)((0,Bm.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(Hye,"getBlockComment");function Gye(t){return t&&(0,rOr.getLanguage)((0,Bm.getDefaultLanguage)(t)).lineComment.start||"#"}a(Gye,"getLineCommentStart");function P6i(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:iOr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(P6i,"extractCellParts")});var O6i=I(MBe=>{"use strict";p();Object.defineProperty(MBe,"__esModule",{value:!0});MBe.AlternativeXmlNotebookContentProvider=void 0;MBe.isXmlContent=M6i;var bCc=eOr(),SCc=QCt(),TCc=xq(),DBe=P0(),ICc=DCt(),xCc=UCt(),ZE=kBe(),NBe="`}a(oOr,"generateCellMarker");function M6i(t){return t.includes(NBe)||t.includes(sV)||t.includes(HCt)}a(M6i,"isXmlContent");var GCt=class extends xCc.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,ZE.summarize)(e),o=oOr(n),s=e.document.eol===DBe.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,TCc.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}}},sOr=class extends ICc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(ZE.EOL);return r.length&&(r[0].startsWith(NBe)||r[0].startsWith(HCt))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(sV)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(sV))),r.join(ZE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,ZE.summarize)(c);o.push(oOr(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(sV)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(ZE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,SCc.isUri)(e),s=o?(0,ZE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,bCc.getLanguage)((0,ZE.getDefaultLanguage)(e)).languageId:void 0;for await(let m of r){if(n.isCancellationRequested)break;let g=m.value;if((g.startsWith(NBe)||g.startsWith(HCt))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(sV)),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:DBe.NotebookCellKind.Code},y=N6i(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 E=s.get(y.id)?.document.languageId===y.language?s.get(y.id):void 0;A.id=y.id,A.language=y.language,A.uri=E?.document.uri,A.kind=E?.kind||(A.language==="markdown"?DBe.NotebookCellKind.Markup:DBe.NotebookCellKind.Code),yield A}else g.startsWith(sV)?(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(sV),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,ZE.getCellIdMap)(r),o=[],s=e.split(ZE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=ZE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+ZE.EOL.length}return new GCt(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==DBe.NotebookCellKind.Markup:!0).map(l=>(0,ZE.summarize)(l)).map(l=>{let d=`${oOr(l)}${ZE.EOL}`;return{content:`${d}${l.source.join(ZE.EOL)}${ZE.EOL}${sV}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(ZE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new GCt(s,c,e)}};MBe.AlternativeXmlNotebookContentProvider=sOr;function N6i(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(M6i(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(N6i,"extractCellParts")});var Q6i=I(v1=>{"use strict";p();var RCc=v1&&v1.__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},L6i=v1&&v1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(v1,"__esModule",{value:!0});v1.AlternativeNotebookContentService=v1.IAlternativeNotebookContentService=void 0;v1.getAlternativeNotebookDocumentProvider=cOr;v1.inferAlternativeNotebookContentFormat=LCc;v1.getAltNotebookRange=BCc;var kCc=Evt(),PCc=nn(),DCc=P0(),B6i=Pl(),NCc=aBe(),MCc=mh(),F6i=w6i(),OCc=D6i(),U6i=O6i();function cOr(t){switch(t){case"xml":return new U6i.AlternativeXmlNotebookContentProvider;case"text":return new OCc.AlternativeTextNotebookContentProvider;case"json":return new F6i.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(cOr,"getAlternativeNotebookDocumentProvider");function LCc(t){return(0,U6i.isXmlContent)(t)?"xml":(0,F6i.isJsonContent)(t)?"json":"text"}a(LCc,"inferAlternativeNotebookContentFormat");v1.IAlternativeNotebookContentService=(0,PCc.createServiceIdentifier)("IAlternativeNotebookContentService");var aOr=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,NCc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(B6i.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return cOr(e)}};v1.AlternativeNotebookContentService=aOr;v1.AlternativeNotebookContentService=aOr=RCc([L6i(0,B6i.IConfigurationService),L6i(1,MCc.IExperimentationService)],aOr);function BCc(t,e,r,n){let o=(0,kCc.findCell)(e,r);if(!o)return;let s=cOr(n).getAlternativeDocument(r);return new DCc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(BCc,"getAltNotebookRange")});var j6i=I(OBe=>{"use strict";p();Object.defineProperty(OBe,"__esModule",{value:!0});OBe.NotebookDocumentSnapshot=void 0;OBe.isNotebookDocumentSnapshotJSON=QCc;var $Ct=KS(),FCc=nd(),lOr=P0(),q6i=Q6i(),UCc=kBe();function QCc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,FCc.isUriComponents)(t.uri)&&(0,$Ct.isString)(t._text)&&(0,$Ct.isString)(t.languageId)&&(0,$Ct.isNumber)(t.version)&&(0,$Ct.isString)(t.alternativeFormat)}a(QCc,"isNotebookDocumentSnapshotJSON");var uOr=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,q6i.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,q6i.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,UCc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new lOr.Selection(0,0,this.lineCount,0)}getWholeRange(){return new lOr.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 lOr.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}}};OBe.NotebookDocumentSnapshot=uOr});var fOr=I(jv=>{"use strict";p();var qCc=jv&&jv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jCc=jv&&jv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HCc=jv&&jv.__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,H6i.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return KCc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,GCc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return YCc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>H6i.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};jv.AbstractWorkspaceService=VCt;function JCc(t,e){let r=t.getWorkspaceFolder(e);return r?WCc.posix.relative(r.path,e.path):e.path}a(JCc,"getWorkspaceFileDisplayPath");var dOr=class extends VCt{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new VCc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new aV.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new aV.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new aV.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new aV.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new aV.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new aV.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new aV.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new aV.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)}};jv.NullWorkspaceService=dOr});var gOr=I(Yne=>{"use strict";p();Object.defineProperty(Yne,"__esModule",{value:!0});Yne.BatchedProcessor=Yne.TaskQueue=void 0;Yne.raceFilter=ZCc;var pOr=nl(),G6i=Rs(),hOr=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new pOr.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new pOr.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 G6i.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 G6i.CancellationError)}};Yne.TaskQueue=hOr;var mOr=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 pOr.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)}};Yne.BatchedProcessor=mOr;function ZCc(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(ZCc,"raceFilter")});var AOr=I($ye=>{"use strict";p();Object.defineProperty($ye,"__esModule",{value:!0});$ye.AsyncIterUtilsExt=$ye.AsyncIterUtils=void 0;var $6i;(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})($6i||($ye.AsyncIterUtils=$6i={}));var V6i;(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})(V6i||($ye.AsyncIterUtilsExt=V6i={}))});var EOr=I(yOr=>{"use strict";p();Object.defineProperty(yOr,"__esModule",{value:!0});yOr.backwardCompatSetting=XCc;function XCc(t,e){return e(t)}a(XCc,"backwardCompatSetting")});var z6i=I(hI=>{"use strict";p();Object.defineProperty(hI,"__esModule",{value:!0});hI.LineWithTokens=hI.Token=void 0;hI.getOrDeduceSelectionFromLastEdit=tbc;hI.clipTokensToRange=W6i;hI.clipTokensToRangeAndAdjustOffsets=nbc;hI.removeTokensInRangeAndAdjustOffsets=ibc;hI.getTokensFromLogProbs=obc;hI.getTokensFromLinesWithTokens=sbc;hI.mergeOffsetRangesAtDistance=abc;var ebc=Rs(),Vye=hd();function tbc(t){let e=new Vye.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):rbc(t)}a(tbc,"getOrDeduceSelectionFromLastEdit");function rbc(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 Vye.OffsetRange(c,c))}a(rbc,"deduceSelectionFromLastEdit");var WCt=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 Vye.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)}};hI.Token=WCt;function W6i(t,e){return t.filter(r=>e.intersects(r.range))}a(W6i,"clipTokensToRange");function nbc(t,e){return W6i(t,e).map(r=>r.deltaOffset(-e.start))}a(nbc,"clipTokensToRangeAndAdjustOffsets");function ibc(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(ibc,"removeTokensInRangeAndAdjustOffsets");function obc(t,e){let r=e;return t.content.map(n=>{let o=new WCt(n.token,n.logprob,r);return r+=o.range.length,o})}a(obc,"getTokensFromLogProbs");var _Or=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,_6i.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 Wne.TextEdit(this.validateRange(n.range),n.newText));return new v6i.StringEdit(r.map(n=>new v6i.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new Wne.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof Wne.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 Wne.Position(r,n):e}validateRange(e){return new Wne.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};OCt.PositionOffsetTransformer=GMr});var WMr=I(zne=>{"use strict";p();Object.defineProperty(zne,"__esModule",{value:!0});zne.SnapshotDocumentLine=zne.TextDocumentSnapshot=void 0;zne.isTextDocumentSnapshotJSON=Zvc;var LCt=ZS(),b6i=nd(),C6i=qMr(),Qye=P0(),Jvc=$Mr();function Zvc(t){return!t||typeof t!="object"?!1:(0,b6i.isUriComponents)(t.uri)&&(0,LCt.isString)(t._text)&&(0,LCt.isString)(t.languageId)&&(0,LCt.isNumber)(t.version)&&(0,LCt.isNumber)(t.eol)}a(Zvc,"isTextDocumentSnapshotJSON");var VMr=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,b6i.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new Jvc.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 Qye.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 BCt(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,C6i.getWordAtText)(r.character+1,C6i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new Qye.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 Qye.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 Qye.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};zne.TextDocumentSnapshot=VMr;var BCt=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 Qye.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Qye.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}};zne.SnapshotDocumentLine=BCt});var QCt=I(UCt=>{"use strict";p();Object.defineProperty(UCt,"__esModule",{value:!0});UCt.AlternativeNotebookDocument=void 0;var S6i=qMr(),FCt=P0(),Xvc=$Mr(),eCc=WMr(),zMr=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new Xvc.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,S6i.getWordAtText)(r.character+1,S6i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new FCt.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 FCt.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 eCc.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 FCt.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 FCt.Position(r,n):e}};UCt.AlternativeNotebookDocument=zMr});var qCt=I(qye=>{"use strict";p();Object.defineProperty(qye,"__esModule",{value:!0});qye.isUri=rCc;qye.isLocation=YMr;qye.toLocation=nCc;qye.isSymbolInformation=iCc;var RBe=P0(),tCc=nd();function rCc(t){return tCc.URI.isUri(t)}a(rCc,"isUri");function YMr(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(YMr,"isLocation");function nCc(t){if(YMr(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new RBe.Location(t.uri,new RBe.Range(new RBe.Position(e.line,e.character),new RBe.Position(r.line,r.character)))}else if(YMr(t)&&t.range instanceof RBe.Range)return t}a(nCc,"toLocation");function iCc(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(iCc,"isSymbolInformation")});var DBe=I(Sy=>{"use strict";p();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.CellIdPatternRe=Sy.EOL=Sy.LineOfText=void 0;Sy.summarize=sCc;Sy.notebookCellToCellData=aCc;Sy.getCellIdMap=cCc;Sy.normalizeCellId=lCc;Sy.getNotebookId=uCc;Sy.getCellId=ZMr;Sy.getDefaultLanguage=fCc;Sy.requestHasNotebookRefs=hCc;Sy.parseAndCleanStack=mCc;var T6i=qCt(),R6i=nNr(),oCc=em(),I6i=nd(),JMr=P0(),KMr=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};Sy.LineOfText=KMr;Sy.EOL=` +`;function sCc(t){let e=t.kind===JMr.NotebookCellKind.Code?"code":"markdown",r=ZMr(t),n=dCc(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(sCc,"summarize");function aCc(t){let e=new JMr.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(aCc,"notebookCellToCellData");function cCc(t){let e=new Map;return t.getCells().forEach(r=>{e.set(ZMr(r),r)}),e}a(cCc,"getCellIdMap");var x6i=new WeakMap,PBe=8,kBe="#VSC-";Sy.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${PBe}})\\b`,"gi");function lCc(t){return t.startsWith(kBe)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===PBe+3?`${kBe}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===PBe+7?`${kBe}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===PBe?`${kBe}${t}`:t}a(lCc,"normalizeCellId");var w6i=new WeakMap;function uCc(t){let e=w6i.get(t);if(e)return e;let r=new R6i.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),w6i.set(t,e),e}a(uCc,"getNotebookId");function ZMr(t){let e=x6i.get(t);if(e)return e;let r=new R6i.StringSHA1;return r.update(t.document.uri.toString()),e=`${kBe}${r.digest().substring(0,PBe)}`,x6i.set(t,e),e}a(ZMr,"getCellId");function dCc(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(dCc,"getCellCode");function fCc(t){let e=t.getCells().find(r=>r.kind===JMr.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(fCc,"getDefaultLanguage");var pCc=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function hCc(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&pCc.some(o=>n.includes(o))?!0:t.references.some(o=>(0,T6i.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,I6i.isUriComponents)(o.value)?e.hasSupportedNotebooks(I6i.URI.revive(o.value)):(0,T6i.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(hCc,"requestHasNotebookRefs");function mCc(t){try{let e=JSON.parse(t);return(0,oCc.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(mCc,"parseAndCleanStack")});var D6i=I(NBe=>{"use strict";p();Object.defineProperty(NBe,"__esModule",{value:!0});NBe.AlternativeJsonNotebookContentProvider=void 0;NBe.isJsonContent=_Cc;var gCc=(Ydr(),Ca(kJn)),ACc=nl(),k6i=nd(),fN=P0(),yCc=NCt(),ECc=QCt(),jye=DBe(),P6i=4;function _Cc(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(_Cc,"isJsonContent");var jCt=class extends ECc.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,jye.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 fN.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new fN.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},XMr=class extends yCc.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 jCt(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==fN.NotebookCellKind.Markup:!0).map(c=>{let l=(0,jye.summarize)(c),u=vCc(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,P6i);return new jCt(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,jye.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,P6i).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(jye.EOL)}parseAlternateContentImpl(e,r,n){return new ACc.AsyncIterableObject(async o=>{let s=k6i.URI.isUri(e)?new Map:(0,jye.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:fN.NotebookCellKind.Code,source:[]},f=k6i.URI.isUri(e)?"python":(0,jye.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"?fN.NotebookCellKind.Markup:fN.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,gCc.visit)(l,{onObjectEnd(y,E,_,v){m=y},onLiteralValue:a((y,E,_,v,b,T)=>{if(u>=E)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=E,d.index!==-1&&d.index!==R&&(h(E),d.startOffset=E,d.id=void 0,d.kind=fN.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?fN.NotebookCellKind.Code:fN.NotebookCellKind.Markup,d.kind===fN.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=fN.NotebookCellKind.Markup);else if(x==="source"&&w.length&&typeof w[0]=="number"){w[0]===0&&(d.startOffset=E);let P=typeof y=="string"?y:`${y||""}`;P.endsWith(` +`)&&(P=P.substr(0,P.length-1)),d.source.push(P)}},"onLiteralValue")})}d.index!==-1&&h(m)})}};NBe.AlternativeJsonNotebookContentProvider=XMr;function vCc(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(vCc,"getCellCode")});var tOr=I(oV=>{"use strict";p();Object.defineProperty(oV,"__esModule",{value:!0});oV.wellKnownLanguages=void 0;oV.getLanguage=N6i;oV.getLanguageForResource=SCc;var CCc=XP(),bCc=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"]}});oV.wellKnownLanguages=new Map(Object.entries(bCc).map(([t,e])=>[t,{languageId:t,...e}]));function N6i(t){return eOr(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(N6i,"getLanguage");function eOr(t){return oV.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(eOr,"_getLanguage");function SCc(t){let e=(0,CCc.extname)(t).toLowerCase();for(let r of oV.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return N6i("plaintext")}a(SCc,"getLanguageForResource")});var L6i=I(sV=>{"use strict";p();Object.defineProperty(sV,"__esModule",{value:!0});sV.AlternativeTextNotebookContentProvider=void 0;sV.generateCellTextMarker=iOr;sV.lineMightHaveCellMarker=oOr;sV.getBlockComment=Gye;sV.getLineCommentStart=$ye;var nOr=tOr(),TCc=qCt(),ICc=wq(),Hye=P0(),xCc=NCt(),wCc=QCt(),Bm=DBe();function iOr(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(iOr,"generateCellTextMarker");function oOr(t){return t.toLowerCase().includes("vscode.cell")}a(oOr,"lineMightHaveCellMarker");var HCt=class extends wCc.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,Bm.summarize)(e),o=$ye(this.notebook),s=iOr(n,o),c=e.document.eol===Hye.EndOfLine.LF?1:2,l=Gye(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===Hye.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,ICc.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}}},rOr=class extends xCc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(Bm.EOL);return r.length&&oOr(r[0])?(r.shift(),r.join(Bm.EOL)):e}getSummaryOfStructure(e,r,n){let o=Gye(e),s=$ye(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,Bm.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(M6i(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(Bm.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,TCc.isUri)(e),s=o?(0,Bm.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=$ye(o?e:void 0),m=Gye(o?e:void 0),g=o?(0,nOr.getLanguage)((0,Bm.getDefaultLanguage)(e)).languageId:void 0,A=new Set;for await(let y of r){if(n.isCancellationRequested)break;let E=y.value,_=E.startsWith(`${h}%% [`)&&E.trimEnd().endsWith("]"),v=E.startsWith(`${h}%% vscode.cell`),b=v||_?O6i(E,g):void 0;if((v||_)&&b?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:Hye.NotebookCellKind.Code,emitted:!1,type:"start"};T.index=f+=1,T.emitted=!1,b.id&&s.get(b.id)?.document.languageId===b.language?A.has(b.id)?b.id="":A.add(b.id):b.id="";let w=s.get(b.id);T.id=b.id,T.language=b.language,T.uri=w?.document.uri,T.kind=w?.kind||(T.language==="markdown"?Hye.NotebookCellKind.Markup:Hye.NotebookCellKind.Code),c=T.language==="markdown",l=!1,d&&(yield{index:f-1,type:"end"}),d=!0,yield T;continue}d&&(c?l?E===m[1]?(l=!1,u=!0):yield{index:f,line:E,type:"line"}:E===m[0]?l=!0:yield{index:f,line:E,type:"line"}:yield{index:f,line:E,type:"line"})}d&&(yield{index:f,type:"end"})}getAlternativeDocumentFromText(e,r){let n=Gye(r),o=$ye(r),s=(0,Bm.getCellIdMap)(r),c=[],l=e.split(Bm.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(E=>E.cell===y));if(A){let y=u,E=Bm.EOL.length,_=g.language==="markdown",v=y+f.length+E+(_?n[0].length+E:0);c.push({offset:y,sourceOffset:v,cell:A})}}}u+=f.length+Bm.EOL.length}return new HCt(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==Hye.NotebookCellKind.Markup:!0).map(d=>(0,Bm.summarize)(d)),o=Gye(e),s=$ye(e),c=n.map(d=>({...M6i(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(Bm.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 HCt(l,u,e)}};sV.AlternativeTextNotebookContentProvider=rOr;function M6i(t,e,r){let n=iOr(t,e),o=t.source.join(Bm.EOL),s=t.language==="markdown"?`${n}${Bm.EOL}${r[0]}${Bm.EOL}`:`${n}${Bm.EOL}`;return{content:t.language==="markdown"?`${s}${o}${Bm.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(M6i,"generateAlternativeCellTextContent");function Gye(t){return t?(0,nOr.getLanguage)((0,Bm.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(Gye,"getBlockComment");function $ye(t){return t&&(0,nOr.getLanguage)((0,Bm.getDefaultLanguage)(t)).lineComment.start||"#"}a($ye,"getLineCommentStart");function O6i(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:oOr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(O6i,"extractCellParts")});var U6i=I(LBe=>{"use strict";p();Object.defineProperty(LBe,"__esModule",{value:!0});LBe.AlternativeXmlNotebookContentProvider=void 0;LBe.isXmlContent=F6i;var RCc=tOr(),kCc=qCt(),PCc=wq(),MBe=P0(),DCc=NCt(),NCc=QCt(),ZE=DBe(),OBe="`}a(sOr,"generateCellMarker");function F6i(t){return t.includes(OBe)||t.includes(aV)||t.includes(GCt)}a(F6i,"isXmlContent");var $Ct=class extends NCc.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,ZE.summarize)(e),o=sOr(n),s=e.document.eol===MBe.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,PCc.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}}},aOr=class extends DCc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(ZE.EOL);return r.length&&(r[0].startsWith(OBe)||r[0].startsWith(GCt))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(aV)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(aV))),r.join(ZE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,ZE.summarize)(c);o.push(sOr(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(aV)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(ZE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,kCc.isUri)(e),s=o?(0,ZE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,RCc.getLanguage)((0,ZE.getDefaultLanguage)(e)).languageId:void 0;for await(let m of r){if(n.isCancellationRequested)break;let g=m.value;if((g.startsWith(OBe)||g.startsWith(GCt))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(aV)),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:MBe.NotebookCellKind.Code},y=B6i(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 E=s.get(y.id)?.document.languageId===y.language?s.get(y.id):void 0;A.id=y.id,A.language=y.language,A.uri=E?.document.uri,A.kind=E?.kind||(A.language==="markdown"?MBe.NotebookCellKind.Markup:MBe.NotebookCellKind.Code),yield A}else g.startsWith(aV)?(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(aV),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,ZE.getCellIdMap)(r),o=[],s=e.split(ZE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=ZE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+ZE.EOL.length}return new $Ct(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==MBe.NotebookCellKind.Markup:!0).map(l=>(0,ZE.summarize)(l)).map(l=>{let d=`${sOr(l)}${ZE.EOL}`;return{content:`${d}${l.source.join(ZE.EOL)}${ZE.EOL}${aV}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(ZE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new $Ct(s,c,e)}};LBe.AlternativeXmlNotebookContentProvider=aOr;function B6i(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(F6i(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(B6i,"extractCellParts")});var G6i=I(v1=>{"use strict";p();var OCc=v1&&v1.__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},Q6i=v1&&v1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(v1,"__esModule",{value:!0});v1.AlternativeNotebookContentService=v1.IAlternativeNotebookContentService=void 0;v1.getAlternativeNotebookDocumentProvider=lOr;v1.inferAlternativeNotebookContentFormat=jCc;v1.getAltNotebookRange=HCc;var LCc=_vt(),BCc=nn(),FCc=P0(),q6i=Pl(),UCc=lBe(),QCc=mh(),j6i=D6i(),qCc=L6i(),H6i=U6i();function lOr(t){switch(t){case"xml":return new H6i.AlternativeXmlNotebookContentProvider;case"text":return new qCc.AlternativeTextNotebookContentProvider;case"json":return new j6i.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(lOr,"getAlternativeNotebookDocumentProvider");function jCc(t){return(0,H6i.isXmlContent)(t)?"xml":(0,j6i.isJsonContent)(t)?"json":"text"}a(jCc,"inferAlternativeNotebookContentFormat");v1.IAlternativeNotebookContentService=(0,BCc.createServiceIdentifier)("IAlternativeNotebookContentService");var cOr=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,UCc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(q6i.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return lOr(e)}};v1.AlternativeNotebookContentService=cOr;v1.AlternativeNotebookContentService=cOr=OCc([Q6i(0,q6i.IConfigurationService),Q6i(1,QCc.IExperimentationService)],cOr);function HCc(t,e,r,n){let o=(0,LCc.findCell)(e,r);if(!o)return;let s=lOr(n).getAlternativeDocument(r);return new FCc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(HCc,"getAltNotebookRange")});var V6i=I(BBe=>{"use strict";p();Object.defineProperty(BBe,"__esModule",{value:!0});BBe.NotebookDocumentSnapshot=void 0;BBe.isNotebookDocumentSnapshotJSON=VCc;var VCt=ZS(),GCc=nd(),uOr=P0(),$6i=G6i(),$Cc=DBe();function VCc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,GCc.isUriComponents)(t.uri)&&(0,VCt.isString)(t._text)&&(0,VCt.isString)(t.languageId)&&(0,VCt.isNumber)(t.version)&&(0,VCt.isString)(t.alternativeFormat)}a(VCc,"isNotebookDocumentSnapshotJSON");var dOr=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,$6i.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,$6i.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,$Cc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new uOr.Selection(0,0,this.lineCount,0)}getWholeRange(){return new uOr.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 uOr.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}}};BBe.NotebookDocumentSnapshot=dOr});var pOr=I(Hv=>{"use strict";p();var WCc=Hv&&Hv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zCc=Hv&&Hv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),YCc=Hv&&Hv.__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,W6i.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return rbc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,KCc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return tbc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>W6i.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};Hv.AbstractWorkspaceService=WCt;function nbc(t,e){let r=t.getWorkspaceFolder(e);return r?XCc.posix.relative(r.path,e.path):e.path}a(nbc,"getWorkspaceFileDisplayPath");var fOr=class extends WCt{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new ZCc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new cV.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new cV.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new cV.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new cV.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new cV.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new cV.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new cV.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new cV.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)}};Hv.NullWorkspaceService=fOr});var AOr=I(Yne=>{"use strict";p();Object.defineProperty(Yne,"__esModule",{value:!0});Yne.BatchedProcessor=Yne.TaskQueue=void 0;Yne.raceFilter=ibc;var hOr=nl(),z6i=Rs(),mOr=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new hOr.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new hOr.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 z6i.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 z6i.CancellationError)}};Yne.TaskQueue=mOr;var gOr=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 hOr.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)}};Yne.BatchedProcessor=gOr;function ibc(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(ibc,"raceFilter")});var yOr=I(Vye=>{"use strict";p();Object.defineProperty(Vye,"__esModule",{value:!0});Vye.AsyncIterUtilsExt=Vye.AsyncIterUtils=void 0;var Y6i;(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})(Y6i||(Vye.AsyncIterUtils=Y6i={}));var K6i;(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})(K6i||(Vye.AsyncIterUtilsExt=K6i={}))});var _Or=I(EOr=>{"use strict";p();Object.defineProperty(EOr,"__esModule",{value:!0});EOr.backwardCompatSetting=obc;function obc(t,e){return e(t)}a(obc,"backwardCompatSetting")});var Z6i=I(gI=>{"use strict";p();Object.defineProperty(gI,"__esModule",{value:!0});gI.LineWithTokens=gI.Token=void 0;gI.getOrDeduceSelectionFromLastEdit=abc;gI.clipTokensToRange=J6i;gI.clipTokensToRangeAndAdjustOffsets=lbc;gI.removeTokensInRangeAndAdjustOffsets=ubc;gI.getTokensFromLogProbs=dbc;gI.getTokensFromLinesWithTokens=fbc;gI.mergeOffsetRangesAtDistance=pbc;var sbc=Rs(),Wye=hd();function abc(t){let e=new Wye.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):cbc(t)}a(abc,"getOrDeduceSelectionFromLastEdit");function cbc(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 Wye.OffsetRange(c,c))}a(cbc,"deduceSelectionFromLastEdit");var zCt=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 Wye.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)}};gI.Token=zCt;function J6i(t,e){return t.filter(r=>e.intersects(r.range))}a(J6i,"clipTokensToRange");function lbc(t,e){return J6i(t,e).map(r=>r.deltaOffset(-e.start))}a(lbc,"clipTokensToRangeAndAdjustOffsets");function ubc(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(ubc,"removeTokensInRangeAndAdjustOffsets");function dbc(t,e){let r=e;return t.content.map(n=>{let o=new zCt(n.token,n.logprob,r);return r+=o.range.length,o})}a(dbc,"getTokensFromLogProbs");var vOr=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)}};hI.LineWithTokens=_Or;function sbc(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(sbc,"getTokensFromLinesWithTokens");function abc(t,e){if(e<0)throw new ebc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new Vye.OffsetRange(o.start-e,o.endExclusive+e)),n=new Vye.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new Vye.OffsetRange(o.start+e,o.endExclusive-e))}a(abc,"mergeOffsetRangesAtDistance")});var Y6i=I(zCt=>{"use strict";p();Object.defineProperty(zCt,"__esModule",{value:!0});zCt.DelaySession=void 0;var vOr=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)}};zCt.DelaySession=vOr});var X6i=I(kp=>{"use strict";p();var cbc=kp&&kp.__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},YCt=kp&&kp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(kp,"__esModule",{value:!0});kp.UserInteractionMonitor=kp.MAX_INTERACTIONS_STORED=kp.MAX_INTERACTIONS_CONSIDERED=kp.ActionKind=void 0;kp.getWindowWithIgnoredLimit=J6i;kp.getUserHappinessScore=Z6i;var Wye=Pl(),Kne=py(),lbc=Sp(),ubc=mh(),dbc=gm(),K6i=X_(),fbc=Y6i(),mI;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(mI||(kp.ActionKind=mI={}));kp.MAX_INTERACTIONS_CONSIDERED=10;kp.MAX_INTERACTIONS_STORED=30;function J6i(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-kp.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(J6i,"getWindowWithIgnoredLimit");function Z6i(t,e){if(t.length===0)return .5;let r=J6i(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/kp.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(Z6i,"getUserHappinessScore");var COr=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(mI.Accepted)}handleRejection(){this._recordUserAction(mI.Rejected)}handleIgnored(){this._recordUserAction(mI.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===mI.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-kp.MAX_INTERACTIONS_STORED),e!==mI.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-kp.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(Wye.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(Wye.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new fbc.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===mI.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(Wye.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=Kne.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(Wye.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=Kne.AggressivenessLevel.High:c>=s.mediumThreshold?o=Kne.AggressivenessLevel.Medium:o=Kne.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=Wye.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return Kne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,Kne.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:K6i.ErrorUtils.toString(K6i.ErrorUtils.fromUnknown(n)),configValue:r}),Kne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return Z6i(this._recentUserActionsForAggressiveness,e)}};kp.UserInteractionMonitor=COr;kp.UserInteractionMonitor=COr=cbc([YCt(0,Wye.IConfigurationService),YCt(1,ubc.IExperimentationService),YCt(2,lbc.ILogService),YCt(3,dbc.ITelemetryService)],COr)});var e9i=I(bOr=>{"use strict";p();Object.defineProperty(bOr,"__esModule",{value:!0});bOr.isImportStatement=pbc;function pbc(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(pbc,"isImportStatement")});var n9i=I(KCt=>{"use strict";p();Object.defineProperty(KCt,"__esModule",{value:!0});KCt.IgnoreImportChangesAspect=void 0;var t9i=Q0t(),hbc=Sl(),r9i=e9i(),SOr=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,r9i.isImportStatement)(o,r))||mbc(e,n).some(o=>(0,r9i.isImportStatement)(o,r))}static filterEdit(e,r,n=t9i.ImportChanges.None){if(n===t9i.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};KCt.IgnoreImportChangesAspect=SOr;function mbc(t,e){return(0,hbc.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(mbc,"getOldLines")});var IOr=I(JCt=>{"use strict";p();Object.defineProperty(JCt,"__esModule",{value:!0});JCt.FetchStreamError=void 0;var TOr=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};JCt.FetchStreamError=TOr});var i9i=I(ZCt=>{"use strict";p();Object.defineProperty(ZCt,"__esModule",{value:!0});ZCt.DiagnosticData=void 0;var gbc=ZP(),xOr=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,gbc.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}};ZCt.DiagnosticData=xOr});var cV=I(zye=>{"use strict";p();Object.defineProperty(zye,"__esModule",{value:!0});zye.ResponseTags=zye.PromptTags=void 0;var o9i;(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})(o9i||(zye.PromptTags=o9i={}));var s9i;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(s9i||(zye.ResponseTags=s9i={}))});var DOr=I(r9=>{"use strict";p();var Abc=r9&&r9.__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},ybc=r9&&r9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(r9,"__esModule",{value:!0});r9.LintErrors=void 0;var Ebc=i9i(),KR=py(),_bc=T$(),vbc=Rs(),wOr=ZP(),Cbc=eh(),c9i=hd(),bbc=P0(),Sbc=cV(),kOr=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 Cbc.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,wOr.isEqual)(n,s)?ebt.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new POr(s,l.message,l.severity===bbc.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=wbc(n,e.maxLineDistance),n=a9i(n),n=ROr(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,wOr.isEqual)(l.documentUri,o)?e:{...e,showCode:KR.LintOptionShowCode.NO};return XCt(l,this._document.lines,d)}).join(` -`),c=Sbc.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)}};gI.LineWithTokens=vOr;function fbc(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(fbc,"getTokensFromLinesWithTokens");function pbc(t,e){if(e<0)throw new sbc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new Wye.OffsetRange(o.start-e,o.endExclusive+e)),n=new Wye.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new Wye.OffsetRange(o.start+e,o.endExclusive-e))}a(pbc,"mergeOffsetRangesAtDistance")});var X6i=I(YCt=>{"use strict";p();Object.defineProperty(YCt,"__esModule",{value:!0});YCt.DelaySession=void 0;var COr=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)}};YCt.DelaySession=COr});var n9i=I(kp=>{"use strict";p();var hbc=kp&&kp.__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},KCt=kp&&kp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(kp,"__esModule",{value:!0});kp.UserInteractionMonitor=kp.MAX_INTERACTIONS_STORED=kp.MAX_INTERACTIONS_CONSIDERED=kp.ActionKind=void 0;kp.getWindowWithIgnoredLimit=t9i;kp.getUserHappinessScore=r9i;var zye=Pl(),Kne=py(),mbc=Sp(),gbc=mh(),Abc=gm(),e9i=ev(),ybc=X6i(),AI;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(AI||(kp.ActionKind=AI={}));kp.MAX_INTERACTIONS_CONSIDERED=10;kp.MAX_INTERACTIONS_STORED=30;function t9i(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-kp.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(t9i,"getWindowWithIgnoredLimit");function r9i(t,e){if(t.length===0)return .5;let r=t9i(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/kp.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(r9i,"getUserHappinessScore");var bOr=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(AI.Accepted)}handleRejection(){this._recordUserAction(AI.Rejected)}handleIgnored(){this._recordUserAction(AI.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===AI.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-kp.MAX_INTERACTIONS_STORED),e!==AI.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-kp.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(zye.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(zye.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new ybc.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===AI.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(zye.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=Kne.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(zye.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=Kne.AggressivenessLevel.High:c>=s.mediumThreshold?o=Kne.AggressivenessLevel.Medium:o=Kne.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=zye.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return Kne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,Kne.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:e9i.ErrorUtils.toString(e9i.ErrorUtils.fromUnknown(n)),configValue:r}),Kne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return r9i(this._recentUserActionsForAggressiveness,e)}};kp.UserInteractionMonitor=bOr;kp.UserInteractionMonitor=bOr=hbc([KCt(0,zye.IConfigurationService),KCt(1,gbc.IExperimentationService),KCt(2,mbc.ILogService),KCt(3,Abc.ITelemetryService)],bOr)});var i9i=I(SOr=>{"use strict";p();Object.defineProperty(SOr,"__esModule",{value:!0});SOr.isImportStatement=Ebc;function Ebc(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(Ebc,"isImportStatement")});var a9i=I(JCt=>{"use strict";p();Object.defineProperty(JCt,"__esModule",{value:!0});JCt.IgnoreImportChangesAspect=void 0;var o9i=q0t(),_bc=Sl(),s9i=i9i(),TOr=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,s9i.isImportStatement)(o,r))||vbc(e,n).some(o=>(0,s9i.isImportStatement)(o,r))}static filterEdit(e,r,n=o9i.ImportChanges.None){if(n===o9i.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};JCt.IgnoreImportChangesAspect=TOr;function vbc(t,e){return(0,_bc.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(vbc,"getOldLines")});var xOr=I(ZCt=>{"use strict";p();Object.defineProperty(ZCt,"__esModule",{value:!0});ZCt.FetchStreamError=void 0;var IOr=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};ZCt.FetchStreamError=IOr});var c9i=I(XCt=>{"use strict";p();Object.defineProperty(XCt,"__esModule",{value:!0});XCt.DiagnosticData=void 0;var Cbc=XP(),wOr=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,Cbc.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}};XCt.DiagnosticData=wOr});var lV=I(Yye=>{"use strict";p();Object.defineProperty(Yye,"__esModule",{value:!0});Yye.ResponseTags=Yye.PromptTags=void 0;var l9i;(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})(l9i||(Yye.PromptTags=l9i={}));var u9i;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(u9i||(Yye.ResponseTags=u9i={}))});var NOr=I(n9=>{"use strict";p();var bbc=n9&&n9.__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},Sbc=n9&&n9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(n9,"__esModule",{value:!0});n9.LintErrors=void 0;var Tbc=c9i(),JR=py(),Ibc=I$(),xbc=Rs(),ROr=XP(),wbc=eh(),f9i=hd(),Rbc=P0(),kbc=lV(),POr=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 wbc.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,ROr.isEqual)(n,s)?tbt.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new DOr(s,l.message,l.severity===Rbc.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=Mbc(n,e.maxLineDistance),n=d9i(n),n=kOr(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,ROr.isEqual)(l.documentUri,o)?e:{...e,showCode:JR.LintOptionShowCode.NO};return ebt(l,this._document.lines,d)}).join(` +`),c=kbc.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=ROr(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 vbc.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,wOr.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===KR.LintOptionShowCode.NO)continue;if(l9i(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:KR.LintOptionWarning.YES,showCode:KR.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=ROr(r,KR.LintOptionWarning.YES),r=a9i(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:XCt(o,this._document.lines,e),formattedCode:XCt(o,this._document.lines,{...e,showCode:KR.LintOptionShowCode.YES}),formattedCodeWithSurrounding:XCt(o,this._document.lines,{...e,showCode:KR.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};r9.LintErrors=kOr;r9.LintErrors=kOr=Abc([ybc(2,_bc.ILanguageDiagnosticsService)],kOr);function XCt(t,e,r){let n=Tbc(t,t.documentRange);if(r.showCode===KR.LintOptionShowCode.NO)return n;let o=Ibc(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=kOr(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 xbc.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,ROr.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===JR.LintOptionShowCode.NO)continue;if(p9i(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:JR.LintOptionWarning.YES,showCode:JR.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=kOr(r,JR.LintOptionWarning.YES),r=d9i(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:ebt(o,this._document.lines,e),formattedCode:ebt(o,this._document.lines,{...e,showCode:JR.LintOptionShowCode.YES}),formattedCodeWithSurrounding:ebt(o,this._document.lines,{...e,showCode:JR.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};n9.LintErrors=POr;n9.LintErrors=POr=bbc([Sbc(2,Ibc.ILanguageDiagnosticsService)],POr);function ebt(t,e,r){let n=Pbc(t,t.documentRange);if(r.showCode===JR.LintOptionShowCode.NO)return n;let o=Dbc(t.documentRange,r,e);return n+` `+o.join(` -`)}a(XCt,"formatSingleDiagnostic");function Tbc(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(Tbc,"formatDiagnosticMessage");function Ibc(t,e,r){let o=l9i(t,e).intersect(new c9i.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(wbc,"filterDiagnosticsByDistance");function a9i(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:ebt.compareFn(e.distance,r.distance))}a(a9i,"sortDiagnosticsByDistance");function ROr(t,e){switch(e){case KR.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case KR.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case KR.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(ROr,"filterDiagnosticsBySeverity");var ebt=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}},POr=class extends Ebc.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 Yye=I(tbt=>{"use strict";p();Object.defineProperty(tbt,"__esModule",{value:!0});tbt.toUniquePath=kbc;tbt.countTokensForLines=Pbc;var Rbc=tJ();function kbc(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===Rbc.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(kbc,"toUniquePath");function Pbc(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(Pbc,"countTokensForLines")});var u9i=I(NOr=>{"use strict";p();Object.defineProperty(NOr,"__esModule",{value:!0});NOr.getEditDiffHistory=Mbc;var Dbc=iN(),lV=Sl(),Nbc=Yye();function Mbc(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 E=Obc(y,u);if(E===null)continue;let _=n(E);if(f-=_,f<0)break;h+=_,m.push(E)}let g=m.reverse(),A=g.join(` +`)}a(ebt,"formatSingleDiagnostic");function Pbc(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(Pbc,"formatDiagnosticMessage");function Dbc(t,e,r){let o=p9i(t,e).intersect(new f9i.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(Mbc,"filterDiagnosticsByDistance");function d9i(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:tbt.compareFn(e.distance,r.distance))}a(d9i,"sortDiagnosticsByDistance");function kOr(t,e){switch(e){case JR.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case JR.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case JR.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(kOr,"filterDiagnosticsBySeverity");var tbt=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}},DOr=class extends Tbc.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 Kye=I(rbt=>{"use strict";p();Object.defineProperty(rbt,"__esModule",{value:!0});rbt.toUniquePath=Lbc;rbt.countTokensForLines=Bbc;var Obc=tJ();function Lbc(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===Obc.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(Lbc,"toUniquePath");function Bbc(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(Bbc,"countTokensForLines")});var h9i=I(MOr=>{"use strict";p();Object.defineProperty(MOr,"__esModule",{value:!0});MOr.getEditDiffHistory=Qbc;var Fbc=oN(),uV=Sl(),Ubc=Kye();function Qbc(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 E=qbc(y,u);if(E===null)continue;let _=n(E);if(f-=_,f<0)break;h+=_,m.push(E)}let g=m.reverse(),A=g.join(` `);return g.length>0&&(A+=` -`),{promptPiece:A,nDiffs:m.length,totalTokens:h}}a(Mbc,"getEditDiffHistory");function Obc(t,e){let r=[],n=Dbc.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,lV.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,lV.pushMany)(r,d.map(g=>`-${g}`)),(0,lV.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,Nbc.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,lV.pushMany)(c,r),c.join(` -`)}a(Obc,"generateDocDiff")});var MOr=I(uV=>{"use strict";p();Object.defineProperty(uV,"__esModule",{value:!0});uV.count=Lbc;uV.findInsertionIndexInSortedArray=Bbc;uV.max=Fbc;uV.filterMap=Ubc;uV.min=Qbc;uV.batchArrayElements=qbc;function Lbc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(Lbc,"count");function Bbc(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(Bbc,"findInsertionIndexInSortedArray");function Fbc(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(Fbc,"max");function Ubc(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(Ubc,"filterMap");function Qbc(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var jbc=XE&&XE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hbc=XE&&XE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Gbc=XE&&XE.__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;oQOr(A.entries)):d=p9i(e,t.id,c,l).map(A=>m9i(A));let{snippets:f,docsInPrompt:h}=v9i(d,n,o);r&&g9i(r,f,o.languageContext.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers);let m;return o.neighborFiles.enabled&&s&&s.length>0&&(m=A9i(s,f,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:f.join(` +`),{promptPiece:A,nDiffs:m.length,totalTokens:h}}a(Qbc,"getEditDiffHistory");function qbc(t,e){let r=[],n=Fbc.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,uV.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,uV.pushMany)(r,d.map(g=>`-${g}`)),(0,uV.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,Ubc.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,uV.pushMany)(c,r),c.join(` +`)}a(qbc,"generateDocDiff")});var OOr=I(dV=>{"use strict";p();Object.defineProperty(dV,"__esModule",{value:!0});dV.count=jbc;dV.findInsertionIndexInSortedArray=Hbc;dV.max=Gbc;dV.filterMap=$bc;dV.min=Vbc;dV.batchArrayElements=Wbc;function jbc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(jbc,"count");function Hbc(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(Hbc,"findInsertionIndexInSortedArray");function Gbc(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(Gbc,"max");function $bc(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a($bc,"filterMap");function Vbc(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var zbc=XE&&XE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ybc=XE&&XE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Kbc=XE&&XE.__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;oqOr(A.entries)):d=A9i(e,t.id,c,l).map(A=>E9i(A));let{snippets:f,docsInPrompt:h}=T9i(d,n,o);r&&_9i(r,f,o.languageContext.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers);let m;return o.neighborFiles.enabled&&s&&s.length>0&&(m=v9i(s,f,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:f.join(` -`),documents:h,neighborSnippetsResult:m}}a(Kbc,"getRecentCodeSnippets");function Jbc(t,e,r){switch(e){case OOr.IncludeLineNumbersOption.WithSpaceAfter:return t.map((n,o)=>`${r+o}| ${n}`);case OOr.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case OOr.IncludeLineNumbersOption.None:return t;default:(0,Vbc.assertNever)(e)}}a(Jbc,"formatLinesWithLineNumbers");function rbt(t,e,r){let n=(0,FOr.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=Jbc(e,r.includeLineNumbers,r.startLineOffset).join(` -`);return[d9i.PromptTags.RECENT_FILE.start,o,c,d9i.PromptTags.RECENT_FILE.end].join(` -`)}a(rbt,"formatCodeSnippet");function p9i(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(p9i,"collectRecentDocuments");function h9i(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(h9i,"collectRecentDocumentsGrouped");function Zbc(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===BOr.RecentFileClippingStrategy.Proportional?h9i(e,t.id,n,o).map(u=>QOr(u.entries)):p9i(e,t.id,n,o).map(l=>m9i(l))}a(Zbc,"prepareRecentCodeSnippets");function UOr(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(UOr,"selectFocalRangesWithinSpanCap");function m9i(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(m9i,"historyEntryToCodeSnippet");function QOr(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(QOr,"historyEntriesToCodeSnippet");function g9i(t,e,r,n,o){let s=r;for(let c of t.items){if(c.onTimeout)continue;let l=c.context;if(l.kind===$bc.ContextKind.Snippet){let u=l.value,d=r-n(u);if(d<0)break;let f=LOr.DocumentId.create(l.uri.toString());e.push(rbt(f,u.split(/\r?\n/),{truncated:!1,includeLineNumbers:o,startLineOffset:0})),r=d}}return s-r}a(g9i,"appendLanguageContextSnippets");function A9i(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=LOr.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(rbt(LOr.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(A9i,"appendNeighborFileSnippets");function y9i(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,FOr.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(rbt(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(y9i,"clipFullDocument");function E9i(t,e,r,n){let o=t.getTransformer(),s=r*3,c=UOr(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 E=y*r,_=Math.min(E+r,h.length);A+=(0,FOr.countTokensForLines)(h.slice(E,_),n)}return A}a(E9i,"computeFocalPageCost");function _9i(t,e,r,n,o,s,c,l){if(n<=0)return;let u=t.content.getTransformer(),d=e*3,f=UOr(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:E,budgetLeft:_}=(0,Ybc.expandRangeToPageRange)(t.content.getLines(),new zbc.OffsetRange(g.lineNumber-1,A.lineNumber),e,n,o,!1,c);if(_===n||_<0)return;let v=y*e,b=t.content.getLines().slice(v,(E+1)*e);return l.docsInPrompt.add(t.id),l.snippets.push(rbt(t.id,b,{truncated:b.lengthE.focalRanges!==void 0&&E.focalRanges.length>0?E9i(E.content,E.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(E=>E.editEntryCount??1),g=m.reduce((E,_)=>E+_,0),A=m.map(E=>Math.floor(h*(E/g))),y=0;for(let E=0;E0)y=_9i(_,n,v.length,b,e,c,l,o)??b;else{let T=(0,f9i.batchArrayElements)(v,n);y=y9i(_,T,v.length,b,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-y}}a(e1c,"buildCodeSnippetsWithProportionalBudget")});var nbt=I(Zd=>{"use strict";p();var t1c=Zd&&Zd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),r1c=Zd&&Zd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),n1c=Zd&&Zd.__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 LOr.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case LOr.IncludeLineNumbersOption.None:return t;default:(0,Zbc.assertNever)(e)}}a(n1c,"formatLinesWithLineNumbers");function nbt(t,e,r){let n=(0,UOr.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=n1c(e,r.includeLineNumbers,r.startLineOffset).join(` +`);return[m9i.PromptTags.RECENT_FILE.start,o,c,m9i.PromptTags.RECENT_FILE.end].join(` +`)}a(nbt,"formatCodeSnippet");function A9i(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(A9i,"collectRecentDocuments");function y9i(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(y9i,"collectRecentDocumentsGrouped");function i1c(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===FOr.RecentFileClippingStrategy.Proportional?y9i(e,t.id,n,o).map(u=>qOr(u.entries)):A9i(e,t.id,n,o).map(l=>E9i(l))}a(i1c,"prepareRecentCodeSnippets");function QOr(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(QOr,"selectFocalRangesWithinSpanCap");function E9i(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(E9i,"historyEntryToCodeSnippet");function qOr(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(qOr,"historyEntriesToCodeSnippet");function _9i(t,e,r,n,o){let s=r;for(let c of t.items){if(c.onTimeout)continue;let l=c.context;if(l.kind===Jbc.ContextKind.Snippet){let u=l.value,d=r-n(u);if(d<0)break;let f=BOr.DocumentId.create(l.uri.toString());e.push(nbt(f,u.split(/\r?\n/),{truncated:!1,includeLineNumbers:o,startLineOffset:0})),r=d}}return s-r}a(_9i,"appendLanguageContextSnippets");function v9i(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=BOr.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(nbt(BOr.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(v9i,"appendNeighborFileSnippets");function C9i(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,UOr.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(nbt(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(C9i,"clipFullDocument");function b9i(t,e,r,n){let o=t.getTransformer(),s=r*3,c=QOr(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 E=y*r,_=Math.min(E+r,h.length);A+=(0,UOr.countTokensForLines)(h.slice(E,_),n)}return A}a(b9i,"computeFocalPageCost");function S9i(t,e,r,n,o,s,c,l){if(n<=0)return;let u=t.content.getTransformer(),d=e*3,f=QOr(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:E,budgetLeft:_}=(0,t1c.expandRangeToPageRange)(t.content.getLines(),new e1c.OffsetRange(g.lineNumber-1,A.lineNumber),e,n,o,!1,c);if(_===n||_<0)return;let v=y*e,b=t.content.getLines().slice(v,(E+1)*e);return l.docsInPrompt.add(t.id),l.snippets.push(nbt(t.id,b,{truncated:b.lengthE.focalRanges!==void 0&&E.focalRanges.length>0?b9i(E.content,E.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(E=>E.editEntryCount??1),g=m.reduce((E,_)=>E+_,0),A=m.map(E=>Math.floor(h*(E/g))),y=0;for(let E=0;E0)y=S9i(_,n,v.length,b,e,c,l,o)??b;else{let T=(0,g9i.batchArrayElements)(v,n);y=C9i(_,T,v.length,b,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-y}}a(s1c,"buildCodeSnippetsWithProportionalBudget")});var ibt=I(Zd=>{"use strict";p();var a1c=Zd&&Zd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c1c=Zd&&Zd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),l1c=Zd&&Zd.__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(P)),w=x.tokensConsumed;break}case"languageContext":{r&&(w=(0,LBe.appendLanguageContextSnippets)(r,u,T,n,o.recentlyViewedDocuments.includeLineNumbers));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,LBe.appendNeighborFileSnippets)(s,d,f,T,n,o.recentlyViewedDocuments.includeLineNumbers),w=h.tokensConsumed);break}case"diffHistory":{let R={...o.diffHistory,maxTokens:T},x=(0,I9i.getEditDiffHistory)(t,e,f,n,R);m=x.promptPiece,g=x.nDiffs,A=x.totalTokens,w=x.totalTokens;break}default:(0,obt.assertNever)(v)}E=Math.max(0,T-w)}return{codeSnippets:[...l,...u,...d].join(` +${o}`;break}let D=d.promptingStrategy!==Xl.PromptingStrategy.Nes41Miniv3&&d.promptingStrategy!==Xl.PromptingStrategy.Codexv21NesUnified&&d.promptingStrategy!==Xl.PromptingStrategy.PatchBased01&&d.promptingStrategy!==Xl.PromptingStrategy.PatchBased02&&d.promptingStrategy!==Xl.PromptingStrategy.PatchBased02WithRecentLineNumbers&&d.promptingStrategy!==Xl.PromptingStrategy.PatchBased02WithoutRecentLineNumbers?m1c(x):x;return{prompt:(g1c(v,D,d.languageContext.traitPosition)+T).trim(),nDiffsInPrompt:E,diffTokensInPrompt:_,neighborSnippetsResult:A}}a(f1c,"getUserPrompt");function p1c(t,e,r,n,o,s,c){h1c(c);let l=[],u=[],d=[],f=new Set;f.add(t.id);let h,m="",g=0,A=0,y=(0,FBe.prepareRecentCodeSnippets)(t,e,o),E=0;for(let v of c.order){let b=c.shares[v]??0,T=Math.max(0,Math.floor(E+c.totalTokens*b)),w=0;switch(v){case"recentlyViewedDocuments":{let R={...o,recentlyViewedDocuments:{...o.recentlyViewedDocuments,maxTokens:T}},x=(0,FBe.buildCodeSnippetsUsingPagedClipping)(y,n,R);l.push(...x.snippets),x.docsInPrompt.forEach(P=>f.add(P)),w=x.tokensConsumed;break}case"languageContext":{r&&(w=(0,FBe.appendLanguageContextSnippets)(r,u,T,n,o.recentlyViewedDocuments.includeLineNumbers));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,FBe.appendNeighborFileSnippets)(s,d,f,T,n,o.recentlyViewedDocuments.includeLineNumbers),w=h.tokensConsumed);break}case"diffHistory":{let R={...o.diffHistory,maxTokens:T},x=(0,k9i.getEditDiffHistory)(t,e,f,n,R);m=x.promptPiece,g=x.nDiffs,A=x.totalTokens,w=x.totalTokens;break}default:(0,sbt.assertNever)(v)}E=Math.max(0,T-w)}return{codeSnippets:[...l,...u,...d].join(` -`),documents:f,neighborSnippetsResult:h,editDiffHistory:m,nDiffsInPrompt:g,diffTokensInPrompt:A}}a(a1c,"runGlobalBudgetCascade");function c1c(t){let e=new Set;for(let c of t.order){if(e.has(c))throw new Error(`globalBudget.order contains duplicate part '${c}'`);if(e.add(c),typeof t.shares[c]!="number")throw new Error(`globalBudget.shares is missing entry for '${c}'`)}let r=t.order.indexOf("recentlyViewedDocuments"),n=t.order.indexOf("neighborFiles");if(r!==-1&&n!==-1&&nc+t.shares[l],0);if(Math.abs(o-1)>.001)throw new Error(`globalBudget.shares across order must sum to ~1, got ${o}`)}a(c1c,"validateGlobalBudget");function l1c(t){return`\`\`\` +`),documents:f,neighborSnippetsResult:h,editDiffHistory:m,nDiffsInPrompt:g,diffTokensInPrompt:A}}a(p1c,"runGlobalBudgetCascade");function h1c(t){let e=new Set;for(let c of t.order){if(e.has(c))throw new Error(`globalBudget.order contains duplicate part '${c}'`);if(e.add(c),typeof t.shares[c]!="number")throw new Error(`globalBudget.shares is missing entry for '${c}'`)}let r=t.order.indexOf("recentlyViewedDocuments"),n=t.order.indexOf("neighborFiles");if(r!==-1&&n!==-1&&nc+t.shares[l],0);if(Math.abs(o-1)>.001)throw new Error(`globalBudget.shares across order must sum to ~1, got ${o}`)}a(h1c,"validateGlobalBudget");function m1c(t){return`\`\`\` ${t} -\`\`\``}a(l1c,"wrapInBackticks");function u1c(t,e,r){return r==="before"?S9i(t,e,2):S9i(e,t,2)}a(u1c,"addRelatedInformation");function S9i(t,e,r){let n=0;for(let s=t.length-1;s>=0&&t[s]===` +\`\`\``}a(m1c,"wrapInBackticks");function g1c(t,e,r){return r==="before"?w9i(t,e,2):w9i(e,t,2)}a(g1c,"addRelatedInformation");function w9i(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 Xl.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 Xl.PromptingStrategy.Xtab275EditIntentShort:case Xl.PromptingStrategy.Xtab275EditIntent:case Xl.PromptingStrategy.Xtab275:o=n;break;case Xl.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case Xl.PromptingStrategy.Xtab275Aggressiveness:o=`${n} +`.repeat(o)+e).trim()}a(w9i,"appendWithNewLineIfNeeded");function A1c(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 \`${vh.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 \`${vh.PromptTags.EDIT_WINDOW.start}\` and \`${vh.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 Xl.PromptingStrategy.PatchBased01:case Xl.PromptingStrategy.Codexv21NesUnified:break;case Xl.PromptingStrategy.PatchBased02:case Xl.PromptingStrategy.PatchBased02WithRecentLineNumbers:case Xl.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 Xl.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 \`${vh.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 Xl.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 Xl.PromptingStrategy.Xtab275EditIntentShort:case Xl.PromptingStrategy.Xtab275EditIntent:case Xl.PromptingStrategy.Xtab275:o=n;break;case Xl.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case Xl.PromptingStrategy.Xtab275Aggressiveness:o=`${n} <|aggressive|>${r}<|/aggressive|>`;break;case Xl.PromptingStrategy.Xtab275AggressivenessHighLow:o=r===Xl.AggressivenessLevel.Medium?n:`${n} <|aggressive|>${r}<|/aggressive|>`;break;case Xl.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 Xl.PromptingStrategy.SimplifiedSystemPrompt:case Xl.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 \`${vh.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 \`${vh.PromptTags.EDIT_WINDOW.start}\` and \`${vh.PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves. \`\`\` // Your revised code goes here -\`\`\``;break;default:(0,obt.assertNever)(t)}return o===void 0?"":` +\`\`\``;break;default:(0,sbt.assertNever)(t)}return o===void 0?"":` -${o}`}a(d1c,"getPostScript");function f1c(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===i1c.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(A1c,"getPostScript");function y1c(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===u1c.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(f1c,"getRelatedInformation");function p1c(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(p1c,"truncateCode");Zd.N_LINES_ABOVE=2;Zd.N_LINES_BELOW=5;Zd.N_LINES_AS_CONTEXT=15;function x9i(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),E=t.slice(A,y);return(0,GOr.countTokensForLines)(E,o)}a(u,"computeTokensForPage");let d=Math.floor(e.start/r),f=Math.floor((e.endExclusive-1)/r),h=n-(0,o1c.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 E=u(y),_=m-E;if(_<0)break;d=y,m=_}m=g+(c?m:0);for(let y=f+1;y0;++y){let E=u(y),_=m-E;if(_<0)break;f=y,m=_}}return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:m}}a(x9i,"expandRangeToPageRange");function w9i(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,GOr.countTokensForLines)(s,r);if(c<0)return jOr.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=x9i(t,e,n,c,r,o.prioritizeAboveCursor,o.useLeftoverBudgetFromAbove),d=l*n,f=(u+1)*n;return jOr.Result.ok(new T9i.OffsetRange(d,f))}a(w9i,"clipPreservingRange");var ibt=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};Zd.ClippedDocument=ibt;function R9i(t,e,r,n,o,s){let c=w9i(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 T9i.OffsetRange(l.start,l.start+u.length);return jOr.Result.ok(new ibt(u,d))}a(R9i,"createTaggedCurrentFileContentUsingPagedClipping");function qOr(t,e){switch(e){case Kye.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case Kye.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case Kye.IncludeLineNumbersOption.None:return[...t];default:(0,obt.assertNever)(e)}}a(qOr,"addLineNumbers");function h1c(t,e,r,n,o,s){let c=b9i.StringEdit.single(b9i.StringReplacement.insert(t.cursorOffset,vh.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=qOr(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[vh.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),vh.PromptTags.EDIT_WINDOW.start,...u,vh.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),vh.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=qOr(f,s.includeLineNumbers.currentFileContent),m=qOr(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 R9i(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` -`)}))}a(h1c,"constructTaggedFile")});var k9i=I(JR=>{"use strict";p();Object.defineProperty(JR,"__esModule",{value:!0});JR.xtab275SystemPrompt=JR.simplifiedPrompt=JR.nes41Miniv3SystemPrompt=JR.unifiedModelSystemPrompt=JR.systemPromptTemplate=void 0;var dV=cV();JR.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 ${dV.PromptTags.EDIT_WINDOW.start} and ${dV.PromptTags.EDIT_WINDOW.end} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +`)}`}a(y1c,"getRelatedInformation");function E1c(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(E1c,"truncateCode");Zd.N_LINES_ABOVE=2;Zd.N_LINES_BELOW=5;Zd.N_LINES_AS_CONTEXT=15;function P9i(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),E=t.slice(A,y);return(0,$Or.countTokensForLines)(E,o)}a(u,"computeTokensForPage");let d=Math.floor(e.start/r),f=Math.floor((e.endExclusive-1)/r),h=n-(0,d1c.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 E=u(y),_=m-E;if(_<0)break;d=y,m=_}m=g+(c?m:0);for(let y=f+1;y0;++y){let E=u(y),_=m-E;if(_<0)break;f=y,m=_}}return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:m}}a(P9i,"expandRangeToPageRange");function D9i(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,$Or.countTokensForLines)(s,r);if(c<0)return HOr.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=P9i(t,e,n,c,r,o.prioritizeAboveCursor,o.useLeftoverBudgetFromAbove),d=l*n,f=(u+1)*n;return HOr.Result.ok(new R9i.OffsetRange(d,f))}a(D9i,"clipPreservingRange");var obt=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};Zd.ClippedDocument=obt;function N9i(t,e,r,n,o,s){let c=D9i(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 R9i.OffsetRange(l.start,l.start+u.length);return HOr.Result.ok(new obt(u,d))}a(N9i,"createTaggedCurrentFileContentUsingPagedClipping");function jOr(t,e){switch(e){case Jye.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case Jye.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case Jye.IncludeLineNumbersOption.None:return[...t];default:(0,sbt.assertNever)(e)}}a(jOr,"addLineNumbers");function _1c(t,e,r,n,o,s){let c=x9i.StringEdit.single(x9i.StringReplacement.insert(t.cursorOffset,vh.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=jOr(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[vh.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),vh.PromptTags.EDIT_WINDOW.start,...u,vh.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),vh.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=jOr(f,s.includeLineNumbers.currentFileContent),m=jOr(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 N9i(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` +`)}))}a(_1c,"constructTaggedFile")});var M9i=I(ZR=>{"use strict";p();Object.defineProperty(ZR,"__esModule",{value:!0});ZR.xtab275SystemPrompt=ZR.simplifiedPrompt=ZR.nes41Miniv3SystemPrompt=ZR.unifiedModelSystemPrompt=ZR.systemPromptTemplate=void 0;var fV=lV();ZR.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 ${fV.PromptTags.EDIT_WINDOW.start} and ${fV.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: @@ -1225,9 +1225,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 ${dV.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 ${fV.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 ${dV.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 ${fV.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 @@ -1238,9 +1238,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 ${dV.PromptTags.EDIT_WINDOW.start} and ${dV.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 ${fV.PromptTags.EDIT_WINDOW.start} and ${fV.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 ${dV.PromptTags.EDIT_WINDOW.start} or ${dV.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 ${fV.PromptTags.EDIT_WINDOW.start} or ${fV.PromptTags.EDIT_WINDOW.end} tags. \`\`\` // Your revised code goes here @@ -1250,7 +1250,7 @@ Your task is to predict and complete the changes the developer would have made n - 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. -- Don't include the line numbers of the form #| in your response.`;JR.unifiedModelSystemPrompt=`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 <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +- Don't include the line numbers of the form #| in your response.`;ZR.unifiedModelSystemPrompt=`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 <|code_to_edit|> and <|/code_to_edit|> 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: @@ -1279,7 +1279,7 @@ 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.`;JR.nes41Miniv3SystemPrompt=`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 <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;ZR.nes41Miniv3SystemPrompt=`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 <|code_to_edit|> and <|/code_to_edit|> 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: @@ -1307,18 +1307,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.`;JR.simplifiedPrompt="Predict next code edit based on the context given by the user.";JR.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 abt=I(fV=>{"use strict";p();Object.defineProperty(fV,"__esModule",{value:!0});fV.NullTerminalService=fV.ITerminalService=void 0;fV.isTerminalService=A1c;fV.isNullTerminalService=y1c;var m1c=nn(),sbt=Ic(),g1c=Ro();fV.ITerminalService=(0,m1c.createServiceIdentifier)("ITerminalService");var $Or=class t extends g1c.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new sbt.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new sbt.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new sbt.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new sbt.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){}};fV.NullTerminalService=$Or;function A1c(t){return t&&typeof t.createTerminal=="function"}a(A1c,"isTerminalService");function y1c(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(y1c,"isNullTerminalService")});var P9i=I(n9=>{"use strict";p();var E1c=n9&&n9.__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},_1c=n9&&n9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(n9,"__esModule",{value:!0});n9.TerminalMonitor=void 0;var v1c=abt(),C1c=Ro(),BBe=2e3,VOr=class extends C1c.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:b1c(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,BBe*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<=BBe?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,BBe/2),contentEnd:n.slice(-BBe/2),length:n.length,truncatedChars:n.length-BBe},terminalCount:r};return JSON.stringify(s)}};n9.TerminalMonitor=VOr;n9.TerminalMonitor=VOr=E1c([_1c(0,v1c.ITerminalService)],VOr);function b1c(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(b1c,"formatCwd")});var D9i=I(cbt=>{"use strict";p();Object.defineProperty(cbt,"__esModule",{value:!0});cbt.CurrentDocument=void 0;var S1c=Rs(),WOr=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 S1c.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}};cbt.CurrentDocument=WOr});var L9i=I(lbt=>{"use strict";p();Object.defineProperty(lbt,"__esModule",{value:!0});lbt.getCurrentLine=I1c;lbt.isModelLineCompatible=x1c;var N9i=q_(),T1c=M_t();function I1c(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new N9i.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?R1c(n,o,e,r):!1}a(x1c,"isModelLineCompatible");var w1c=new Set(["()","[]","{}","<>",'""',"''","``"]);function R1c(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&&O9i(t.inserted,e.inserted):O9i(t.inserted,e.inserted)}a(R1c,"isUserEditCompatibleWithModelEdit");function O9i(t,e){return e.startsWith(t)?!0:w1c.has(t)?k1c(t,e):!1}a(O9i,"isUserTypingCompatibleWithModelText");function k1c(t,e){let r=0;for(let n=0;n{"use strict";p();var P1c=fN&&fN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D1c=fN&&fN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),N1c=fN&&fN.__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(O1c,"parseEditIntentFromStreamShortName");async function L1c(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=ubt.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=ubt.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 E=await c.next();for(;!E.done;)yield E.value,E=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(L1c,"parseEditIntentFromStreamTags")});var fbt=I(Jye=>{"use strict";p();Object.defineProperty(Jye,"__esModule",{value:!0});Jye.linesWithBackticksRemoved=F1c;Jye.constructMessages=U1c;Jye.charCount=Q1c;Jye.findMergeConflictMarkersRange=q1c;var YOr=Io(),B9i=nBe(),B1c=hd();async function*F1c(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(F1c,"linesWithBackticksRemoved");function U1c({systemMsg:t,userMsg:e}){return[{role:YOr.Raw.ChatRole.System,content:(0,B9i.toTextParts)(t)},{role:YOr.Raw.ChatRole.User,content:(0,B9i.toTextParts)(e)}]}a(U1c,"constructMessages");function Q1c(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===YOr.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(Q1c,"charCount");function q1c(t,e,r){for(let n=e.start;n>>>>>>"))return new B1c.OffsetRange(n,o+1)}}a(q1c,"findMergeConflictMarkersRange")});var Q9i=I(pV=>{"use strict";p();Object.defineProperty(pV,"__esModule",{value:!0});pV.ResponseParseResult=void 0;pV.handleEditWindowOnly=G1c;pV.handleCodeBlock=$1c;pV.handleEditWindowWithEditIntent=V1c;pV.handleUnifiedWithXml=W1c;var FBe=nye(),F9i=NG(),U9i=$2(),Zye=cV(),j1c=zOr(),H1c=fbt(),RL;(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})(RL||(pV.ResponseParseResult=RL={}));function G1c(t){return new RL.EditWindowLines(t)}a(G1c,"handleEditWindowOnly");function $1c(t){return new RL.EditWindowLines((0,H1c.linesWithBackticksRemoved)(t))}a($1c,"handleCodeBlock");async function V1c(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,j1c.parseEditIntentFromStream)(t,e,r);return new RL.EditWindowLines(o,{intent:n,parseError:s})}a(V1c,"handleEditWindowWithEditIntent");async function W1c(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new RL.Done(new FBe.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===Zye.ResponseTags.NO_CHANGE.start)return new RL.Done(new FBe.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===Zye.ResponseTags.INSERT.start)return new RL.DirectEdits(z1c(o,e,r));if(c===Zye.ResponseTags.EDIT.start){let l=Y1c(o);return new RL.EditWindowLines(l)}return new RL.Done(new FBe.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(W1c,"handleUnifiedWithXml");async function*z1c(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(Zye.ResponseTags.INSERT.end))return new FBe.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new F9i.LineReplacement(new U9i.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(Zye.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let E=o.start+s+2;return yield{edit:new F9i.LineReplacement(new U9i.LineRange(E,E),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new FBe.NoNextEditReason.NoSuggestions(r,l)}a(z1c,"generateInsertEdits");async function*Y1c(t){let e=await t.next();for(;!e.done;){if(e.value.includes(Zye.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(Y1c,"generateEditLines")});var q9i=I(i9=>{"use strict";p();var K1c=i9&&i9.__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},ZR=i9&&i9.__param||function(t,e){return function(r,n){e(r,n,t)}},pbt;Object.defineProperty(i9,"__esModule",{value:!0});i9.XtabEndpoint=void 0;var J1c=FE(),Z1c=K6(),KOr=Pl(),X1c=$E(),eSc=J$(),tSc=Gne(),rSc=Sp(),nSc=_y(),iSc=X6(),oSc=mh(),sSc=gm(),aSc=K$(),cSc=Qne(),lSc=Gs(),JOr=class extends tSc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{pbt=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:cSc.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 E=n?{...pbt.chatModelInfo,id:n}:pbt.chatModelInfo;super(E,s,f,h,m,o,g,A,y),this._url=e,this._apiKey=r,this._configService=o}get urlOrRequestMetadata(){return this._configService.getConfig(KOr.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(KOr.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}}};i9.XtabEndpoint=JOr;i9.XtabEndpoint=JOr=pbt=K1c([ZR(3,KOr.IConfigurationService),ZR(4,eSc.IDomainService),ZR(5,nSc.IFetcherService),ZR(6,X1c.ICAPIClientService),ZR(7,sSc.ITelemetryService),ZR(8,J1c.IAuthenticationService),ZR(9,Z1c.IChatMLFetcher),ZR(10,aSc.ITokenizerProvider),ZR(11,lSc.IInstantiationService),ZR(12,oSc.IExperimentationService),ZR(13,iSc.IChatWebSocketManager),ZR(14,rSc.ILogService)],JOr)});var hbt=I(Xye=>{"use strict";p();Object.defineProperty(Xye,"__esModule",{value:!0});Xye.NullProxyModelsService=Xye.IProxyModelsService=void 0;var uSc=nn(),dSc=Ic();Xye.IProxyModelsService=(0,uSc.createServiceIdentifier)("IProxyModelsService");var ZOr=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=dSc.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};Xye.NullProxyModelsService=ZOr});var j9i=I(rA=>{"use strict";p();var fSc=rA&&rA.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pSc=rA&&rA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hSc=rA&&rA.__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},mSc=rA&&rA.__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?gbt.IncludeLineNumbersOption.WithSpaceAfter:gbt.IncludeLineNumbersOption.None:g),f=new e5r.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,e5r.getUserPrompt)(f),m=(0,wSc.constructMessages)({systemMsg:r,userMsg:h});return gI.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}`),gI.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 gI.Result.fromString("endpointNotResolved");let{endpoint:f,usesResponsesApi:h}=d,m=this.configService.getConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),g=this.configService.getExperimentBasedConfig(pN.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:XOr.ChatLocation.Other,requestOptions:A},n);if(y.type!==XOr.ChatFetchResponseType.Success)return y.type===XOr.ChatFetchResponseType.NotFound&&(o.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),gI.Result.fromString(`fetchError:${y.type}`);try{r.telemetry.setCursorJumpResponse(y.value);let E=y.value.trim();return this.parseResponse(E,l)}catch(E){return o.trace(`Failed to parse predicted line number from response '${y.value}': ${E}`),gI.Result.fromString(`failedToParseLine:"${y.value}". Error ${bSc.ErrorUtils.fromUnknown(E).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(pN.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(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(ySc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:gSc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:SSc.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(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??RSc}determineLintOptions(){let e=this.configService.getConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...Abt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,Abt.parseLintOptionString)(r,Abt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):Abt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=kSc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return gI.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?gI.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?gI.Result.fromString("crossFileEmptyFilePath"):gI.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?gI.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(kSc,"stripThinkTags")});var Y9i=I(QBe=>{"use strict";p();Object.defineProperty(QBe,"__esModule",{value:!0});QBe.XtabPatchResponseHandler=void 0;QBe.tryRemoveDuplicateAdditions=z9i;var H9i=Vne(),UBe=py(),PSc=ogt(),G9i=nye(),DSc=X_(),NSc=Sl(),MSc=NA(),$9i=nd(),W9i=NG(),OSc=$2(),LSc=IOr(),BSc=Yye(),FSc=cV(),tEe=class t{static{a(this,"Patch")}constructor(e,r){this.filePath=e,this.lineNumZeroBased=r,this.removedLines=[],this.addedLines=[]}static ofLine(e){let r=e.match(/^(.+):(\d+)$/);if(!r)return null;let[,n,o]=r;return new t(n,parseInt(o,10))}static insertion(e,r){return new t(e,r)}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 r5r(t){return t.trim().length>1}a(r5r,"isMeaningfulLine");function z9i(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,NSc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&r5r(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&r5r(c[0])&&r5r(c[1])){let l=c[0],u=c[1];for(let d=1;d=1&&c.lineNumZeroBased===l&&c.filePath===u&&PSc.ResponseProcessor.isAdditiveEdit(c.removedLines[0],c.addedLines[0])}a(o,"isGhostTextPatch"),t.isGhostTextPatch=o;async function*s(c,l,u){let d=null,f=!0,h=!1;for await(let m of c){if(m.trim()===FSc.ResponseTags.NO_EDIT)break;if(d===null){d=tEe.ofLine(m);continue}if(d.addLine(m)){if(f&&!h&&l!==void 0&&u!==void 0&&d.addedLines.length===1&&d.removedLines.length>=1){if(o(d,l,u)){let g=tEe.insertion(d.filePath,d.lineNumZeroBased);g.removedLines=[...d.removedLines],g.addedLines=[...d.addedLines],yield g,d=tEe.insertion(d.filePath,d.lineNumZeroBased+1)}h=!0}continue}(d.removedLines.length>0||d.addedLines.length>0)&&(yield d),d=tEe.ofLine(m),f=!1}d&&(d.removedLines.length>0||d.addedLines.length>0)&&(yield d)}a(s,"extractEdits"),t.extractEdits=s})(V9i||(QBe.XtabPatchResponseHandler=V9i={}))});var pUi=I(Pp=>{"use strict";p();var QSc=Pp&&Pp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qSc=Pp&&Pp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jSc=Pp&&Pp.__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},HSc=Pp&&Pp.__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){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.ID=o9.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(pTc.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(yTc.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(vTc.XtabNextCursorPredictor,o9.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new Ds.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new Ds.NoNextEditReason.ActiveDocumentHasNoEdits;return new Ds.WithStatelessProviderTelemetry(h,s.build(_bt.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,AV.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new Ds.WithStatelessProviderTelemetry(d.value,s.build(_bt.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof Ds.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new Ds.WithStatelessProviderTelemetry(f,s.build(_bt.Result.error(f)))}catch(c){let l=mV.ErrorUtils.fromUnknown(c),u=new Ds.NoNextEditReason.Unexpected(l);return new Ds.WithStatelessProviderTelemetry(u,s.build(_bt.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,fTc.getOrDeduceSelectionFromLastEdit)(e.getActiveDocument()),r,n,o,s)}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 Ds.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 n5r.Position(r.endLineNumber,r.endColumn),E=new ETc.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,E,m,f,n,u);let _=lUi(E),v=this.computeEditWindowLinesRange(E,e,u,f),b=Math.max(0,E.cursorLineOffset-v.start),T=E.transformer.getLineLength(v.endExclusive),w=E.transformer.getOffsetRange(new Cbt.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new Ds.RequestEditWindowWithCursorJump(w,l):new Ds.RequestEditWindow(w);let R=E.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,aUi.countTokensForLines)(R,o9.computeTokens)>x)return new Ds.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(ke=>ke.includes(nUi.PromptTags.CURSOR)),N=(0,gV.constructTaggedFile)(E,v,_,m,o9.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:Go.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}});if(N.isError())return new Ds.NoNextEditReason.PromptTooLarge("currentFile");let{clippedTaggedCurrentDoc:L,areaAroundCodeToEdit:B}=N.val;f.setNLinesOfCurrentFileInPrompt(L.lines.length);let{aggressivenessLevel:q,userHappinessScore:M}=this.userInteractionMonitor.getAggressivenessLevel(),O=this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(O),f.setXtabAggressivenessLevel(q),M!==void 0&&f.setXtabUserHappinessScore(M);let j=await this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterLanguageContextAwait");let Q=m.neighborFiles.enabled?await(0,hV.raceCancellation)((0,hV.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset),n.getDebounceTime()),s):void 0;if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait");let U=new gTc.LintErrors(h.id,E,this.langDiagService,e.xtabEditHistory),Y=new gV.PromptPieces(E,v,_,h,e.xtabEditHistory,L.lines,B,j,q,U,o9.computeTokens,m,Q),{prompt:W,nDiffsInPrompt:V,diffTokensInPrompt:z,neighborSnippetsResult:ie}=(0,gV.getUserPrompt)(Y);f.setNDiffsInPrompt(V),f.setDiffTokensInPrompt(z),ie&&(f.setNNeighborSnippetsComputed(ie.nComputed),f.setNNeighborSnippetsInPrompt(ie.nIncluded),f.setNeighborSnippetIndicesInPrompt(ie.includedIndices));let H=Go.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),re=this.getPredictedOutput(h,E.cursorLineOffset,R,b,H),le=(0,i5r.constructMessages)({systemMsg:uUi(m.promptingStrategy),userMsg:W});d.setPrompt(le),f.setPrompt(le);let Le=3e4*4;if((0,i5r.charCount)(le)>Le)return new Ds.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let ke=U.getData();f.setLintErrors(ke),d.setDiagnosticsData(ke);let X=this.terminalMonitor.getData();f.setTerminalOutput(X),d.setTerminalData(X)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset)),e.fetchIssued=!0;let Ue={endpoint:A,modelServiceConfig:g,messages:le,clippedTaggedCurrentDoc:L,editWindowInfo:{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:b,editWindowLineRange:v},promptPieces:Y,prediction:re,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,Ue,{shouldRemoveCursorTagFromResponse:D,responseFormat:H},{aggressivenessLevel:q,userHappinessScore:M},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,mTc.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(di.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(di.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,Hv.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[Hv.AggressivenessSetting.Low]:{minResponseConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[Hv.AggressivenessSetting.Medium]:{minResponseConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[Hv.AggressivenessSetting.High]:{debounceConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[Hv.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(di.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,sUi.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new dTc.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 b=[v.uri,...v.additionalUris??[]];return!!await(0,nTc.raceFilter)(b.map(w=>this.ignoreService.isCopilotIgnored(w)),w=>w)},"isSnippetIgnored"),g=[],A=a(async()=>{let v=this.langCtxService.getContextItems(l,h,c);for await(let b of v)b.kind===J9i.ContextKind.Snippet&&await m(b)||g.push({context:b,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,hV.raceCancellation)((0,hV.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let E=Date.now(),_=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of _)v.kind===J9i.ContextKind.Snippet&&await m(v)||g.push({context:v,timeStamp:E,onTimeout:!0});return{start:y,end:E,items:g}}catch(l){s.logContext.setError(mV.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,E]=this.filterEdit(e.getActiveDocument(),[A],r.modelServiceConfig.allowImportChanges??KSc.ImportChanges.None);y.length===0?d.trace(`Filtered out an edit: ${A.toString()} using ${E.join(", ")} filter(s)`):(d.trace(`Yielding an edit: ${A.toString()}`),yield g.value,m++),g=await h.next()}return m===0&&g.value instanceof Ds.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 oTc.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(di.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new GSc.FetchStreamSource,E=new sTc.StopWatch,_="",v,b=new hV.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:o9.ID,messages:r,finishedCb:a(async(P,D,N)=>{b.isSettled||b.complete(),v===void 0&&P!==""&&(v=E.elapsed(),m.addLog(`TTFT ${v} ms`)),y.update(P,N),_=P,m.setResponse(_)},"finishedCb"),location:Lf.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(P=>({response:P,ttft:v}))),m.setFullResponse(T.then(P=>P.type===Lf.ChatFetchResponseType.Success?P.value:void 0)),T.then(P=>{P.type!==Lf.ChatFetchResponseType.Success?y.reject(new rUi.FetchStreamError(c5r(P))):y.resolve()}).catch(P=>{m.setError(mV.ErrorUtils.fromUnknown(P)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(mV.ErrorUtils.fromUnknown(P))}).finally(()=>{m.setFetchEndTime(),b.isSettled||b.complete(),m.setResponse(_)});let w=await Promise.race([b.p,T]);if(w&&w.type!==Lf.ChatFetchResponseType.Success)return w.type===Lf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,yV.ModelNotFound.INSTANCE):w.type===Lf.ChatFetchResponseType.Unknown&&w.reason===Lf.RESPONSE_CONTAINED_NO_CHOICES?new yV.FetchFailure(new Ds.NoNextEditReason.NoSuggestions(u,l)):new yV.FetchFailure(c5r(w));let R=Z9i.AsyncIterUtilsExt.splitLines(Z9i.AsyncIterUtils.map(y.stream,P=>P.delta.text)),x=(async function*(){let P=0;for await(let D of R){let N=`Line ${P++} emitted with latency ${E.elapsed()} ms`;h.trace(N),yield c?D.replaceAll(nUi.PromptTags.CURSOR,""):D}})();return new yV.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:E,editWindowInfo:_,promptPieces:v,prediction:b,originalEditWindow:T}=r,{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:x,editWindowLineRange:P}=_,D=e.getActiveDocument().id,N=await this._performFetch(A,y,b,e.headerRequestId,o,n.shouldRemoveCursorTagFromResponse,w,e.documentBeforeEdits,f,l);if(N instanceof yV.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof yV.FetchFailure)return N.reason;let{linesStream:L,getResponseSoFar:B,fetchRequestStopWatch:q}=N,M=s instanceof AV.Retrying&&s.reason==="cursorJump",O;try{switch(n.responseFormat){case Go.ResponseFormat.EditWindowOnly:{O=(0,Jne.handleEditWindowOnly)(L);break}case Go.ResponseFormat.CodeBlock:{O=(0,Jne.handleCodeBlock)(L);break}case Go.ResponseFormat.EditWindowWithEditIntent:case Go.ResponseFormat.EditWindowWithEditIntentShort:{let ie=n.responseFormat===Go.ResponseFormat.EditWindowWithEditIntentShort?oUi.EditIntentParseMode.ShortName:oUi.EditIntentParseMode.Tags;O=await(0,Jne.handleEditWindowWithEditIntent)(L,h,ie);break}case Go.ResponseFormat.CustomDiffPatch:{let ie=e.getActiveDocument(),H=v.currentDocument,le=H.lines[E.keptRange.endExclusive-1].length,Le=H.transformer.getOffsetRange(new Cbt.Range(E.keptRange.start+1,1,E.keptRange.endExclusive,le+1)),ge=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService),Ue=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchFastYieldLineWithCursor,this.expService);O=new Jne.ResponseParseResult.DirectEdits(CTc.XtabPatchResponseHandler.handleResponse(L,H,ie.id,ie.workspaceRoot,Le,h,ge,Ue));break}case Go.ResponseFormat.UnifiedWithXml:{O=await(0,Jne.handleUnifiedWithXml)(L,{editWindowLines:R,editWindowLineRange:P,cursorLineInEditWindowOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,Zne.assertNever)(n.responseFormat)}if(O instanceof Jne.ResponseParseResult.Done)return O.reason;if(O instanceof Jne.ResponseParseResult.DirectEdits)return yield*O.stream;if(O.editIntentMetadata){let{intent:ie,parseError:H}=O.editIntentMetadata;if(g.setEditIntent(ie),H&&g.setEditIntentParseError(H),!Go.EditIntent.shouldShowEdit(ie,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${ie}" with aggressiveness "${v.aggressivenessLevel}"`),new Ds.NoNextEditReason.FilteredOut(`editIntent:${ie} aggressivenessLevel:${v.aggressivenessLevel}`)}let j=O.lines,Q={emitFastCursorLineChange:K9i.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${q.elapsed()} ms`);let U=(0,iTc.backwardCompatSetting)(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),ie=>{switch(ie){case!1:case void 0:return Hv.EarlyDivergenceCancellationMode.Off;case!0:return Hv.EarlyDivergenceCancellationMode.Cursor;case Hv.EarlyDivergenceCancellationMode.Off:case Hv.EarlyDivergenceCancellationMode.Cursor:case Hv.EarlyDivergenceCancellationMode.EditWindow:return ie;default:return Hv.EarlyDivergenceCancellationMode.Off}}),Y=!1,W=U===Hv.EarlyDivergenceCancellationMode.Off?j:TTc(j,x,e,P,R,d,l,ie=>{Y=ie},U),V=0,z=!1;for await(let ie of K9i.ResponseProcessor.diff(R,W,x,Q)){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 vbt.LineReplacement(new tUi.LineRange(ie.lineRange.startLineNumber+P.start,ie.lineRange.endLineNumberExclusive+P.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.`;ZR.simplifiedPrompt="Predict next code edit based on the context given by the user.";ZR.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 cbt=I(pV=>{"use strict";p();Object.defineProperty(pV,"__esModule",{value:!0});pV.NullTerminalService=pV.ITerminalService=void 0;pV.isTerminalService=b1c;pV.isNullTerminalService=S1c;var v1c=nn(),abt=Ic(),C1c=ko();pV.ITerminalService=(0,v1c.createServiceIdentifier)("ITerminalService");var VOr=class t extends C1c.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new abt.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new abt.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new abt.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new abt.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){}};pV.NullTerminalService=VOr;function b1c(t){return t&&typeof t.createTerminal=="function"}a(b1c,"isTerminalService");function S1c(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(S1c,"isNullTerminalService")});var O9i=I(i9=>{"use strict";p();var T1c=i9&&i9.__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},I1c=i9&&i9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(i9,"__esModule",{value:!0});i9.TerminalMonitor=void 0;var x1c=cbt(),w1c=ko(),UBe=2e3,WOr=class extends w1c.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:R1c(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,UBe*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<=UBe?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,UBe/2),contentEnd:n.slice(-UBe/2),length:n.length,truncatedChars:n.length-UBe},terminalCount:r};return JSON.stringify(s)}};i9.TerminalMonitor=WOr;i9.TerminalMonitor=WOr=T1c([I1c(0,x1c.ITerminalService)],WOr);function R1c(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(R1c,"formatCwd")});var L9i=I(lbt=>{"use strict";p();Object.defineProperty(lbt,"__esModule",{value:!0});lbt.CurrentDocument=void 0;var k1c=Rs(),zOr=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 k1c.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}};lbt.CurrentDocument=zOr});var Q9i=I(ubt=>{"use strict";p();Object.defineProperty(ubt,"__esModule",{value:!0});ubt.getCurrentLine=D1c;ubt.isModelLineCompatible=N1c;var B9i=q_(),P1c=O_t();function D1c(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new B9i.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?O1c(n,o,e,r):!1}a(N1c,"isModelLineCompatible");var M1c=new Set(["()","[]","{}","<>",'""',"''","``"]);function O1c(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&&U9i(t.inserted,e.inserted):U9i(t.inserted,e.inserted)}a(O1c,"isUserEditCompatibleWithModelEdit");function U9i(t,e){return e.startsWith(t)?!0:M1c.has(t)?L1c(t,e):!1}a(U9i,"isUserTypingCompatibleWithModelText");function L1c(t,e){let r=0;for(let n=0;n{"use strict";p();var B1c=pN&&pN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F1c=pN&&pN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),U1c=pN&&pN.__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(q1c,"parseEditIntentFromStreamShortName");async function j1c(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=dbt.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=dbt.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 E=await c.next();for(;!E.done;)yield E.value,E=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(j1c,"parseEditIntentFromStreamTags")});var pbt=I(Zye=>{"use strict";p();Object.defineProperty(Zye,"__esModule",{value:!0});Zye.linesWithBackticksRemoved=G1c;Zye.constructMessages=$1c;Zye.charCount=V1c;Zye.findMergeConflictMarkersRange=W1c;var KOr=xo(),q9i=oBe(),H1c=hd();async function*G1c(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(G1c,"linesWithBackticksRemoved");function $1c({systemMsg:t,userMsg:e}){return[{role:KOr.Raw.ChatRole.System,content:(0,q9i.toTextParts)(t)},{role:KOr.Raw.ChatRole.User,content:(0,q9i.toTextParts)(e)}]}a($1c,"constructMessages");function V1c(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===KOr.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(V1c,"charCount");function W1c(t,e,r){for(let n=e.start;n>>>>>>"))return new H1c.OffsetRange(n,o+1)}}a(W1c,"findMergeConflictMarkersRange")});var G9i=I(hV=>{"use strict";p();Object.defineProperty(hV,"__esModule",{value:!0});hV.ResponseParseResult=void 0;hV.handleEditWindowOnly=K1c;hV.handleCodeBlock=J1c;hV.handleEditWindowWithEditIntent=Z1c;hV.handleUnifiedWithXml=X1c;var QBe=iye(),j9i=MG(),H9i=V2(),Xye=lV(),z1c=YOr(),Y1c=pbt(),RL;(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})(RL||(hV.ResponseParseResult=RL={}));function K1c(t){return new RL.EditWindowLines(t)}a(K1c,"handleEditWindowOnly");function J1c(t){return new RL.EditWindowLines((0,Y1c.linesWithBackticksRemoved)(t))}a(J1c,"handleCodeBlock");async function Z1c(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,z1c.parseEditIntentFromStream)(t,e,r);return new RL.EditWindowLines(o,{intent:n,parseError:s})}a(Z1c,"handleEditWindowWithEditIntent");async function X1c(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new RL.Done(new QBe.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===Xye.ResponseTags.NO_CHANGE.start)return new RL.Done(new QBe.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===Xye.ResponseTags.INSERT.start)return new RL.DirectEdits(eSc(o,e,r));if(c===Xye.ResponseTags.EDIT.start){let l=tSc(o);return new RL.EditWindowLines(l)}return new RL.Done(new QBe.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(X1c,"handleUnifiedWithXml");async function*eSc(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(Xye.ResponseTags.INSERT.end))return new QBe.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new j9i.LineReplacement(new H9i.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(Xye.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let E=o.start+s+2;return yield{edit:new j9i.LineReplacement(new H9i.LineRange(E,E),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new QBe.NoNextEditReason.NoSuggestions(r,l)}a(eSc,"generateInsertEdits");async function*tSc(t){let e=await t.next();for(;!e.done;){if(e.value.includes(Xye.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(tSc,"generateEditLines")});var $9i=I(o9=>{"use strict";p();var rSc=o9&&o9.__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},XR=o9&&o9.__param||function(t,e){return function(r,n){e(r,n,t)}},hbt;Object.defineProperty(o9,"__esModule",{value:!0});o9.XtabEndpoint=void 0;var nSc=FE(),iSc=J6(),JOr=Pl(),oSc=$E(),sSc=Z$(),aSc=Gne(),cSc=Sp(),lSc=_y(),uSc=e9(),dSc=mh(),fSc=gm(),pSc=J$(),hSc=Qne(),mSc=Gs(),ZOr=class extends aSc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{hbt=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:hSc.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 E=n?{...hbt.chatModelInfo,id:n}:hbt.chatModelInfo;super(E,s,f,h,m,o,g,A,y),this._url=e,this._apiKey=r,this._configService=o}get urlOrRequestMetadata(){return this._configService.getConfig(JOr.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(JOr.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}}};o9.XtabEndpoint=ZOr;o9.XtabEndpoint=ZOr=hbt=rSc([XR(3,JOr.IConfigurationService),XR(4,sSc.IDomainService),XR(5,lSc.IFetcherService),XR(6,oSc.ICAPIClientService),XR(7,fSc.ITelemetryService),XR(8,nSc.IAuthenticationService),XR(9,iSc.IChatMLFetcher),XR(10,pSc.ITokenizerProvider),XR(11,mSc.IInstantiationService),XR(12,dSc.IExperimentationService),XR(13,uSc.IChatWebSocketManager),XR(14,cSc.ILogService)],ZOr)});var mbt=I(eEe=>{"use strict";p();Object.defineProperty(eEe,"__esModule",{value:!0});eEe.NullProxyModelsService=eEe.IProxyModelsService=void 0;var gSc=nn(),ASc=Ic();eEe.IProxyModelsService=(0,gSc.createServiceIdentifier)("IProxyModelsService");var XOr=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=ASc.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};eEe.NullProxyModelsService=XOr});var V9i=I(rA=>{"use strict";p();var ySc=rA&&rA.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=rA&&rA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_Sc=rA&&rA.__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},vSc=rA&&rA.__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?Abt.IncludeLineNumbersOption.WithSpaceAfter:Abt.IncludeLineNumbersOption.None:g),f=new t5r.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,t5r.getUserPrompt)(f),m=(0,MSc.constructMessages)({systemMsg:r,userMsg:h});return yI.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}`),yI.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 yI.Result.fromString("endpointNotResolved");let{endpoint:f,usesResponsesApi:h}=d,m=this.configService.getConfig(hN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),g=this.configService.getExperimentBasedConfig(hN.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:e5r.ChatLocation.Other,requestOptions:A},n);if(y.type!==e5r.ChatFetchResponseType.Success)return y.type===e5r.ChatFetchResponseType.NotFound&&(o.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),yI.Result.fromString(`fetchError:${y.type}`);try{r.telemetry.setCursorJumpResponse(y.value);let E=y.value.trim();return this.parseResponse(E,l)}catch(E){return o.trace(`Failed to parse predicted line number from response '${y.value}': ${E}`),yI.Result.fromString(`failedToParseLine:"${y.value}". Error ${RSc.ErrorUtils.fromUnknown(E).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(hN.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(hN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(SSc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:CSc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:kSc.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(hN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??OSc}determineLintOptions(){let e=this.configService.getConfig(hN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...ybt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(hN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,ybt.parseLintOptionString)(r,ybt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):ybt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=LSc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return yI.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?yI.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?yI.Result.fromString("crossFileEmptyFilePath"):yI.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?yI.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(LSc,"stripThinkTags")});var X9i=I(jBe=>{"use strict";p();Object.defineProperty(jBe,"__esModule",{value:!0});jBe.XtabPatchResponseHandler=void 0;jBe.tryRemoveDuplicateAdditions=Z9i;var W9i=Vne(),qBe=py(),BSc=sgt(),z9i=iye(),FSc=ev(),USc=Sl(),QSc=NA(),Y9i=nd(),J9i=MG(),qSc=V2(),jSc=xOr(),HSc=Kye(),GSc=lV(),rEe=class t{static{a(this,"Patch")}constructor(e,r){this.filePath=e,this.lineNumZeroBased=r,this.removedLines=[],this.addedLines=[]}static ofLine(e){let r=e.match(/^(.+):(\d+)$/);if(!r)return null;let[,n,o]=r;return new t(n,parseInt(o,10))}static insertion(e,r){return new t(e,r)}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 n5r(t){return t.trim().length>1}a(n5r,"isMeaningfulLine");function Z9i(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,USc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&n5r(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&n5r(c[0])&&n5r(c[1])){let l=c[0],u=c[1];for(let d=1;d=1&&c.lineNumZeroBased===l&&c.filePath===u&&BSc.ResponseProcessor.isAdditiveEdit(c.removedLines[0],c.addedLines[0])}a(o,"isGhostTextPatch"),t.isGhostTextPatch=o;async function*s(c,l,u){let d=null,f=!0,h=!1;for await(let m of c){if(m.trim()===GSc.ResponseTags.NO_EDIT)break;if(d===null){d=rEe.ofLine(m);continue}if(d.addLine(m)){if(f&&!h&&l!==void 0&&u!==void 0&&d.addedLines.length===1&&d.removedLines.length>=1){if(o(d,l,u)){let g=rEe.insertion(d.filePath,d.lineNumZeroBased);g.removedLines=[...d.removedLines],g.addedLines=[...d.addedLines],yield g,d=rEe.insertion(d.filePath,d.lineNumZeroBased+1)}h=!0}continue}(d.removedLines.length>0||d.addedLines.length>0)&&(yield d),d=rEe.ofLine(m),f=!1}d&&(d.removedLines.length>0||d.addedLines.length>0)&&(yield d)}a(s,"extractEdits"),t.extractEdits=s})(K9i||(jBe.XtabPatchResponseHandler=K9i={}))});var AUi=I(Pp=>{"use strict";p();var VSc=Pp&&Pp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WSc=Pp&&Pp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zSc=Pp&&Pp.__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},YSc=Pp&&Pp.__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){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.ID=s9.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(ETc.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(STc.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(xTc.XtabNextCursorPredictor,s9.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new Ds.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new Ds.NoNextEditReason.ActiveDocumentHasNoEdits;return new Ds.WithStatelessProviderTelemetry(h,s.build(vbt.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,yV.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new Ds.WithStatelessProviderTelemetry(d.value,s.build(vbt.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof Ds.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new Ds.WithStatelessProviderTelemetry(f,s.build(vbt.Result.error(f)))}catch(c){let l=gV.ErrorUtils.fromUnknown(c),u=new Ds.NoNextEditReason.Unexpected(l);return new Ds.WithStatelessProviderTelemetry(u,s.build(vbt.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,yTc.getOrDeduceSelectionFromLastEdit)(e.getActiveDocument()),r,n,o,s)}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 Ds.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 i5r.Position(r.endLineNumber,r.endColumn),E=new TTc.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,E,m,f,n,u);let _=pUi(E),v=this.computeEditWindowLinesRange(E,e,u,f),b=Math.max(0,E.cursorLineOffset-v.start),T=E.transformer.getLineLength(v.endExclusive),w=E.transformer.getOffsetRange(new bbt.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new Ds.RequestEditWindowWithCursorJump(w,l):new Ds.RequestEditWindow(w);let R=E.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,dUi.countTokensForLines)(R,s9.computeTokens)>x)return new Ds.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(ke=>ke.includes(aUi.PromptTags.CURSOR)),N=(0,AV.constructTaggedFile)(E,v,_,m,s9.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:$o.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}});if(N.isError())return new Ds.NoNextEditReason.PromptTooLarge("currentFile");let{clippedTaggedCurrentDoc:L,areaAroundCodeToEdit:B}=N.val;f.setNLinesOfCurrentFileInPrompt(L.lines.length);let{aggressivenessLevel:q,userHappinessScore:M}=this.userInteractionMonitor.getAggressivenessLevel(),O=this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(O),f.setXtabAggressivenessLevel(q),M!==void 0&&f.setXtabUserHappinessScore(M);let j=await this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterLanguageContextAwait");let Q=m.neighborFiles.enabled?await(0,mV.raceCancellation)((0,mV.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset),n.getDebounceTime()),s):void 0;if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait");let U=new CTc.LintErrors(h.id,E,this.langDiagService,e.xtabEditHistory),Y=new AV.PromptPieces(E,v,_,h,e.xtabEditHistory,L.lines,B,j,q,U,s9.computeTokens,m,Q),{prompt:W,nDiffsInPrompt:V,diffTokensInPrompt:z,neighborSnippetsResult:ie}=(0,AV.getUserPrompt)(Y);f.setNDiffsInPrompt(V),f.setDiffTokensInPrompt(z),ie&&(f.setNNeighborSnippetsComputed(ie.nComputed),f.setNNeighborSnippetsInPrompt(ie.nIncluded),f.setNeighborSnippetIndicesInPrompt(ie.includedIndices));let H=$o.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),re=this.getPredictedOutput(h,E.cursorLineOffset,R,b,H),le=(0,o5r.constructMessages)({systemMsg:hUi(m.promptingStrategy),userMsg:W});d.setPrompt(le),f.setPrompt(le);let Le=3e4*4;if((0,o5r.charCount)(le)>Le)return new Ds.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let ke=U.getData();f.setLintErrors(ke),d.setDiagnosticsData(ke);let X=this.terminalMonitor.getData();f.setTerminalOutput(X),d.setTerminalData(X)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset)),e.fetchIssued=!0;let Ue={endpoint:A,modelServiceConfig:g,messages:le,clippedTaggedCurrentDoc:L,editWindowInfo:{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:b,editWindowLineRange:v},promptPieces:Y,prediction:re,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,Ue,{shouldRemoveCursorTagFromResponse:D,responseFormat:H},{aggressivenessLevel:q,userHappinessScore:M},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,vTc.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(di.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(di.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,Gv.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[Gv.AggressivenessSetting.Low]:{minResponseConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[Gv.AggressivenessSetting.Medium]:{minResponseConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[Gv.AggressivenessSetting.High]:{debounceConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[Gv.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(di.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,uUi.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new ATc.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 b=[v.uri,...v.additionalUris??[]];return!!await(0,lTc.raceFilter)(b.map(w=>this.ignoreService.isCopilotIgnored(w)),w=>w)},"isSnippetIgnored"),g=[],A=a(async()=>{let v=this.langCtxService.getContextItems(l,h,c);for await(let b of v)b.kind===tUi.ContextKind.Snippet&&await m(b)||g.push({context:b,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,mV.raceCancellation)((0,mV.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let E=Date.now(),_=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of _)v.kind===tUi.ContextKind.Snippet&&await m(v)||g.push({context:v,timeStamp:E,onTimeout:!0});return{start:y,end:E,items:g}}catch(l){s.logContext.setError(gV.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,E]=this.filterEdit(e.getActiveDocument(),[A],r.modelServiceConfig.allowImportChanges??rTc.ImportChanges.None);y.length===0?d.trace(`Filtered out an edit: ${A.toString()} using ${E.join(", ")} filter(s)`):(d.trace(`Yielding an edit: ${A.toString()}`),yield g.value,m++),g=await h.next()}return m===0&&g.value instanceof Ds.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 dTc.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(di.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new KSc.FetchStreamSource,E=new fTc.StopWatch,_="",v,b=new mV.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:s9.ID,messages:r,finishedCb:a(async(P,D,N)=>{b.isSettled||b.complete(),v===void 0&&P!==""&&(v=E.elapsed(),m.addLog(`TTFT ${v} ms`)),y.update(P,N),_=P,m.setResponse(_)},"finishedCb"),location:Lf.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(P=>({response:P,ttft:v}))),m.setFullResponse(T.then(P=>P.type===Lf.ChatFetchResponseType.Success?P.value:void 0)),T.then(P=>{P.type!==Lf.ChatFetchResponseType.Success?y.reject(new sUi.FetchStreamError(l5r(P))):y.resolve()}).catch(P=>{m.setError(gV.ErrorUtils.fromUnknown(P)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(gV.ErrorUtils.fromUnknown(P))}).finally(()=>{m.setFetchEndTime(),b.isSettled||b.complete(),m.setResponse(_)});let w=await Promise.race([b.p,T]);if(w&&w.type!==Lf.ChatFetchResponseType.Success)return w.type===Lf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,EV.ModelNotFound.INSTANCE):w.type===Lf.ChatFetchResponseType.Unknown&&w.reason===Lf.RESPONSE_CONTAINED_NO_CHOICES?new EV.FetchFailure(new Ds.NoNextEditReason.NoSuggestions(u,l)):new EV.FetchFailure(l5r(w));let R=rUi.AsyncIterUtilsExt.splitLines(rUi.AsyncIterUtils.map(y.stream,P=>P.delta.text)),x=(async function*(){let P=0;for await(let D of R){let N=`Line ${P++} emitted with latency ${E.elapsed()} ms`;h.trace(N),yield c?D.replaceAll(aUi.PromptTags.CURSOR,""):D}})();return new EV.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:E,editWindowInfo:_,promptPieces:v,prediction:b,originalEditWindow:T}=r,{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:x,editWindowLineRange:P}=_,D=e.getActiveDocument().id,N=await this._performFetch(A,y,b,e.headerRequestId,o,n.shouldRemoveCursorTagFromResponse,w,e.documentBeforeEdits,f,l);if(N instanceof EV.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof EV.FetchFailure)return N.reason;let{linesStream:L,getResponseSoFar:B,fetchRequestStopWatch:q}=N,M=s instanceof yV.Retrying&&s.reason==="cursorJump",O;try{switch(n.responseFormat){case $o.ResponseFormat.EditWindowOnly:{O=(0,Jne.handleEditWindowOnly)(L);break}case $o.ResponseFormat.CodeBlock:{O=(0,Jne.handleCodeBlock)(L);break}case $o.ResponseFormat.EditWindowWithEditIntent:case $o.ResponseFormat.EditWindowWithEditIntentShort:{let ie=n.responseFormat===$o.ResponseFormat.EditWindowWithEditIntentShort?lUi.EditIntentParseMode.ShortName:lUi.EditIntentParseMode.Tags;O=await(0,Jne.handleEditWindowWithEditIntent)(L,h,ie);break}case $o.ResponseFormat.CustomDiffPatch:{let ie=e.getActiveDocument(),H=v.currentDocument,le=H.lines[E.keptRange.endExclusive-1].length,Le=H.transformer.getOffsetRange(new bbt.Range(E.keptRange.start+1,1,E.keptRange.endExclusive,le+1)),ge=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService),Ue=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchFastYieldLineWithCursor,this.expService);O=new Jne.ResponseParseResult.DirectEdits(wTc.XtabPatchResponseHandler.handleResponse(L,H,ie.id,ie.workspaceRoot,Le,h,ge,Ue));break}case $o.ResponseFormat.UnifiedWithXml:{O=await(0,Jne.handleUnifiedWithXml)(L,{editWindowLines:R,editWindowLineRange:P,cursorLineInEditWindowOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,Zne.assertNever)(n.responseFormat)}if(O instanceof Jne.ResponseParseResult.Done)return O.reason;if(O instanceof Jne.ResponseParseResult.DirectEdits)return yield*O.stream;if(O.editIntentMetadata){let{intent:ie,parseError:H}=O.editIntentMetadata;if(g.setEditIntent(ie),H&&g.setEditIntentParseError(H),!$o.EditIntent.shouldShowEdit(ie,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${ie}" with aggressiveness "${v.aggressivenessLevel}"`),new Ds.NoNextEditReason.FilteredOut(`editIntent:${ie} aggressivenessLevel:${v.aggressivenessLevel}`)}let j=O.lines,Q={emitFastCursorLineChange:eUi.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${q.elapsed()} ms`);let U=(0,uTc.backwardCompatSetting)(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),ie=>{switch(ie){case!1:case void 0:return Gv.EarlyDivergenceCancellationMode.Off;case!0:return Gv.EarlyDivergenceCancellationMode.Cursor;case Gv.EarlyDivergenceCancellationMode.Off:case Gv.EarlyDivergenceCancellationMode.Cursor:case Gv.EarlyDivergenceCancellationMode.EditWindow:return ie;default:return Gv.EarlyDivergenceCancellationMode.Off}}),Y=!1,W=U===Gv.EarlyDivergenceCancellationMode.Off?j:PTc(j,x,e,P,R,d,l,ie=>{Y=ie},U),V=0,z=!1;for await(let ie of eUi.ResponseProcessor.diff(R,W,x,Q)){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 Cbt.LineReplacement(new oUi.LineRange(ie.lineRange.startLineNumber+P.start,ie.lineRange.endLineNumberExclusive+P.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=P.start+ie.lineRange.startLineNumber;for(let ge of le.changes){let Ue=new vbt.LineReplacement(new tUi.LineRange(Le+ge.original.startLineNumber-1,Le+ge.original.endLineNumberExclusive-1),ie.newLines.slice(ge.modified.startLineNumber-1,ge.modified.endLineNumberExclusive-1));H.push(Ue)}}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,hV.timeout)(le),h.trace(`Artificial delay of ${le} ms completed`),u.isCancellationRequested))return new Ds.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:re,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},V++}}return Y?new Ds.NoNextEditReason.GotCancelled(U===Hv.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(j){return j instanceof rUi.FetchStreamError?j.reason:(m.setError(j),new Ds.NoNextEditReason.Unexpected(mV.ErrorUtils.fromUnknown(j)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof AV.Retrying)return m;if(o5r(e))return l.trace("Skipping cursor prediction: user typed during request"),new Ds.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,o,s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(o5r(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new Ds.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 E=y.lineNumber,_=E-h.currentDocument.cursorLineOffset;if(u.setNextCursorLineDistance(_),u.setNextCursorIsCrossFile(!1),l.trace(`Predicted next cursor line: ${E}`),E>=h.currentDocument.lines.length)return l.trace("Predicted next cursor line error: exceedsDocumentLines"),u.setNextCursorLineError("exceedsDocumentLines"),m;if(h.editWindowLinesRange.contains(E))return l.trace("Predicted next cursor line error: withinEditWindow"),u.setNextCursorLineError("withinEditWindow"),m;let v=E+1,b=h.activeDoc.documentAfterEditsLines.at(E),T=o9.getNextCursorColumn(b);switch(g){case ybt.NextCursorLinePrediction.Jump:{let w=new n5r.Position(v,T);return new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case ybt.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new Cbt.Range(v,T,v,T),n,o,s,new AV.Retrying("cursorJump"),d);default:(0,Zne.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,X9i.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,X9i.isAbsolute)(e.filePath)?eUi.URI.file(e.filePath):eUi.URI.joinPath(m,e.filePath),A=zSc.DocumentId.create(g.toString()),y=e.lineNumber+1,E=new n5r.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case ybt.NextCursorLinePrediction.Jump:return new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A);case ybt.NextCursorLinePrediction.OnlyWithEdit:{let _;try{_=await this.workspaceService.openTextDocument(g)}catch(w){return u.trace(`Failed to open target file for cross-file edit: ${mV.ErrorUtils.fromUnknown(w).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A)}if(l.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(o5r(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new cTc.StringText(_.getText()),b=new Ds.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,JSc.LanguageId.create(_.languageId),v.getLines(),vbt.LineEdit.empty,v,new YSc.Edits(aTc.StringEdit,[])),T=new Ds.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[b],0,n.xtabEditHistory,new hV.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(T,new Cbt.Range(y,1,y,1),s,c,l,new AV.Retrying("cursorJump"),f)}default:(0,Zne.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(di.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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??gV.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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${gV.N_LINES_BELOW}`),u=gV.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new s5r.OffsetRange(d,f),g=(0,i5r.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(di.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 s5r.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...Go.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:l5r(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove,this.expService)},languageContext:dUi(e.languageId,{enabled:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetEnabled,this.expService)?{totalTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetTotalTokens,this.expService),order:Go.GlobalBudgetOptions.DEFAULT_ORDER,shares:Go.GlobalBudgetOptions.DEFAULT_SHARES}:void 0},n=this.modelService.selectedModelConfiguration(),o=Go.applyStrategyConfig(n);return{promptOptions:l5r(r,o),modelServiceConfig:o}}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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(_Tc.XtabEndpoint,r,n,e):(0,VSc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n,o,s){if(!this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService))return;let l=s===Go.ResponseFormat.CustomDiffPatch?this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchModelPredictionKind,this.expService):Go.PatchModelPrediction.FilePath;return{type:"content",content:fUi(e,r,n,o,s,l)}}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof AV.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,hV.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:hTc.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:Ebt.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(di.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:Ebt.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=Ebt.editWouldDeleteWhatWasJustInserted;break;case"v2":l=Ebt.editWouldDeleteWhatWasJustInserted2;break;default:(0,Zne.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new vbt.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(di.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:cUi(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}};Pp.XtabProvider=a5r;Pp.XtabProvider=a5r=o9=jSc([hN(0,ZSc.IInlineEditsModelService),hN(1,eTc.ISimulationTestContext),hN(2,uTc.IInstantiationService),hN(3,rTc.IWorkspaceService),hN(4,$Sc.IDiffService),hN(5,di.IConfigurationService),hN(6,tTc.IExperimentationService),hN(7,sUi.ILanguageContextProviderService),hN(8,XSc.ILanguageDiagnosticsService),hN(9,WSc.IIgnoreService),hN(10,ATc.ISimilarFilesContextService)],a5r);function cUi(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(cUi,"filterOutEditsWithSubstrings");function lUi(t){let e=t.cursorLineOffset,r=Math.max(0,e-gV.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+gV.N_LINES_AS_CONTEXT+1);return new s5r.OffsetRange(r,n)}a(lUi,"computeAreaAroundEditWindowLinesRange");function c5r(t){switch(t.type){case Lf.ChatFetchResponseType.Canceled:return new Ds.NoNextEditReason.GotCancelled("afterFetchCall");case Lf.ChatFetchResponseType.OffTopic:case Lf.ChatFetchResponseType.Filtered:case Lf.ChatFetchResponseType.PromptFiltered:case Lf.ChatFetchResponseType.Length:case Lf.ChatFetchResponseType.RateLimited:case Lf.ChatFetchResponseType.QuotaExceeded:case Lf.ChatFetchResponseType.ExtensionBlocked:case Lf.ChatFetchResponseType.AgentUnauthorized:case Lf.ChatFetchResponseType.AgentFailedDependency:case Lf.ChatFetchResponseType.InvalidStatefulMarker:return new Ds.NoNextEditReason.Uncategorized(mV.ErrorUtils.fromUnknown(t));case Lf.ChatFetchResponseType.BadRequest:case Lf.ChatFetchResponseType.NotFound:case Lf.ChatFetchResponseType.Failed:case Lf.ChatFetchResponseType.NetworkError:case Lf.ChatFetchResponseType.Unknown:return new Ds.NoNextEditReason.FetchFailure(mV.ErrorUtils.fromUnknown(t))}}a(c5r,"mapChatFetcherErrorToNoNextEditReason");function l5r(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?STc(t.lintOptions,e.lintOptions):t.lintOptions}}a(l5r,"overrideModelConfig");var bTc={...Go.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function STc(t,e){return{...t??bTc,...e}}a(STc,"mergeLintOptions");function uUi(t){switch(t){case Go.PromptingStrategy.UnifiedModel:return qBe.unifiedModelSystemPrompt;case Go.PromptingStrategy.Codexv21NesUnified:case Go.PromptingStrategy.SimplifiedSystemPrompt:return qBe.simplifiedPrompt;case Go.PromptingStrategy.PatchBased:case Go.PromptingStrategy.PatchBased01:case Go.PromptingStrategy.PatchBased02:case Go.PromptingStrategy.PatchBased02WithRecentLineNumbers:case Go.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case Go.PromptingStrategy.Xtab275:case Go.PromptingStrategy.XtabAggressiveness:case Go.PromptingStrategy.Xtab275Aggressiveness:case Go.PromptingStrategy.Xtab275AggressivenessHighLow:case Go.PromptingStrategy.Xtab275EditIntent:case Go.PromptingStrategy.Xtab275EditIntentShort:return qBe.xtab275SystemPrompt;case Go.PromptingStrategy.Nes41Miniv3:return qBe.nes41Miniv3SystemPrompt;case Go.PromptingStrategy.CopilotNesXtab:case void 0:return qBe.systemPromptTemplate;default:(0,Zne.assertNever)(t)}}a(uUi,"pickSystemPrompt");function dUi(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(dUi,"determineLanguageContextOptions");function fUi(t,e,r,n,o,s){if(o===Go.ResponseFormat.UnifiedWithXml)return["",...r,""].join(` -`);if(o===Go.ResponseFormat.EditWindowOnly)return r.join(` -`);if(o===Go.ResponseFormat.EditWindowWithEditIntent)return["<|edit_intent|>high<|/edit_intent|>",...r].join(` -`);if(o===Go.ResponseFormat.EditWindowWithEditIntentShort)return["H",...r].join(` -`);if(o===Go.ResponseFormat.CodeBlock)return["```",...r,"```"].join(` -`);if(o===Go.ResponseFormat.CustomDiffPatch){let c=t.workspaceRoot?.path,l=(0,aUi.toUniquePath)(t.id,c);if(s===Go.PatchModelPrediction.FilePath)return`${l}:`;let u=r[n];if(u===void 0)return`${l}:`;let d=`${l}:${e}`;switch(s){case Go.PatchModelPrediction.CurrentLine:return[d,`-${u}`].join(` -`);case Go.PatchModelPrediction.CurrentLineReplaced:return[d,`-${u}`,"+"].join(` -`);case Go.PatchModelPrediction.CurrentLineCompleted:return[d,`-${u}`,`+${u}`].join(` -`);default:(0,Zne.assertNever)(s)}}else(0,Zne.assertNever)(o)}a(fUi,"getPredictionContents");async function*TTc(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 lTc.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(E=>{if(E>=o.length)return!1;switch(u){case Hv.EarlyDivergenceCancellationMode.Cursor:return E===e;case Hv.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let E of t){if(A(y)){let _=n.start+y,v=(0,iUi.getCurrentLine)(f,_,d,g);if(v!==void 0){let b=o[y];if(v!==b&&!(0,iUi.isModelLineCompatible)(b,v,E)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${E}" current="${v}"`),s.cancel();return}}}yield E,y++}}a(TTc,"linesWithIntermediateEditDivergenceCheck")});var hUi=I(kL=>{"use strict";p();var ITc=kL&&kL.__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},bbt=kL&&kL.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(kL,"__esModule",{value:!0});kL.StaticGitHubAuthenticationService=void 0;kL.setCopilotToken=PTc;var xTc=Pl(),wTc=Sp(),Sbt=FE(),RTc=E5e(),kTc=XH(),Tbt=class extends Sbt.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:Sbt.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:Sbt.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 Sbt.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)}};kL.StaticGitHubAuthenticationService=Tbt;kL.StaticGitHubAuthenticationService=Tbt=ITc([bbt(1,wTc.ILogService),bbt(2,kTc.ICopilotTokenStore),bbt(3,RTc.ICopilotTokenManager),bbt(4,xTc.IConfigurationService)],Tbt);function PTc(t,e){if(!(t instanceof Tbt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(PTc,"setCopilotToken")});var EUi=I(Gv=>{"use strict";p();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.GraphQLErrorType=void 0;Gv.getErrorCode=AUi;Gv.derivePullRequestState=DTc;Gv.makeGitHubAPIRequest=yUi;Gv.makeGitHubGraphQLRequest=rEe;Gv.makeSearchGraphQLRequest=NTc;Gv.getPullRequestFromGlobalId=MTc;Gv.addPullRequestCommentGraphQLRequest=OTc;Gv.closePullRequest=LTc;Gv.makeGitHubAPIRequestWithPagination=BTc;Gv.getAssignableActorsWithSuggestedActors=FTc;Gv.getAssignableActorsWithAssignableUsers=UTc;function mUi(t){return typeof t=="object"&&t!==null}a(mUi,"isObject");var gUi;(function(t){t.Unprocessable="UNPROCESSABLE"})(gUi||(Gv.GraphQLErrorType=gUi={}));function AUi(t){if(!mUi(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(mUi(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(AUi,"getErrorCode");function DTc(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(DTc,"derivePullRequestState");async function yUi(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:E="github-api-rest"}=l??{},_={Accept:m??"application/vnd.github+json",...g};c&&(_.Authorization=`Bearer ${c}`),d&&(_["X-GitHub-Api-Version"]=d),h&&(_["User-Agent"]=h);let v=await t.fetch(`${n}/${o}`,{method:s,headers:_,body:u?JSON.stringify(u):void 0,callSite:E});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 b=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),b}catch{return}}a(yUi,"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 NTc(t,e,r,n,o,s,c=20){let l=` +`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${V} with latency ${q.elapsed()} ms`);let Le=P.start+ie.lineRange.startLineNumber;for(let ge of le.changes){let Ue=new Cbt.LineReplacement(new oUi.LineRange(Le+ge.original.startLineNumber-1,Le+ge.original.endLineNumberExclusive-1),ie.newLines.slice(ge.modified.startLineNumber-1,ge.modified.endLineNumberExclusive-1));H.push(Ue)}}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,mV.timeout)(le),h.trace(`Artificial delay of ${le} ms completed`),u.isCancellationRequested))return new Ds.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:re,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},V++}}return Y?new Ds.NoNextEditReason.GotCancelled(U===Gv.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(j){return j instanceof sUi.FetchStreamError?j.reason:(m.setError(j),new Ds.NoNextEditReason.Unexpected(gV.ErrorUtils.fromUnknown(j)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof yV.Retrying)return m;if(s5r(e))return l.trace("Skipping cursor prediction: user typed during request"),new Ds.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,o,s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(s5r(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new Ds.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 E=y.lineNumber,_=E-h.currentDocument.cursorLineOffset;if(u.setNextCursorLineDistance(_),u.setNextCursorIsCrossFile(!1),l.trace(`Predicted next cursor line: ${E}`),E>=h.currentDocument.lines.length)return l.trace("Predicted next cursor line error: exceedsDocumentLines"),u.setNextCursorLineError("exceedsDocumentLines"),m;if(h.editWindowLinesRange.contains(E))return l.trace("Predicted next cursor line error: withinEditWindow"),u.setNextCursorLineError("withinEditWindow"),m;let v=E+1,b=h.activeDoc.documentAfterEditsLines.at(E),T=s9.getNextCursorColumn(b);switch(g){case Ebt.NextCursorLinePrediction.Jump:{let w=new i5r.Position(v,T);return new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case Ebt.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new bbt.Range(v,T,v,T),n,o,s,new yV.Retrying("cursorJump"),d);default:(0,Zne.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,nUi.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,nUi.isAbsolute)(e.filePath)?iUi.URI.file(e.filePath):iUi.URI.joinPath(m,e.filePath),A=eTc.DocumentId.create(g.toString()),y=e.lineNumber+1,E=new i5r.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case Ebt.NextCursorLinePrediction.Jump:return new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A);case Ebt.NextCursorLinePrediction.OnlyWithEdit:{let _;try{_=await this.workspaceService.openTextDocument(g)}catch(w){return u.trace(`Failed to open target file for cross-file edit: ${gV.ErrorUtils.fromUnknown(w).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A)}if(l.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(s5r(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new hTc.StringText(_.getText()),b=new Ds.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,nTc.LanguageId.create(_.languageId),v.getLines(),Cbt.LineEdit.empty,v,new tTc.Edits(pTc.StringEdit,[])),T=new Ds.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[b],0,n.xtabEditHistory,new mV.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(T,new bbt.Range(y,1,y,1),s,c,l,new yV.Retrying("cursorJump"),f)}default:(0,Zne.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(di.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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??AV.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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${AV.N_LINES_BELOW}`),u=AV.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new a5r.OffsetRange(d,f),g=(0,o5r.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(di.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 a5r.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...$o.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:u5r(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove,this.expService)},languageContext:mUi(e.languageId,{enabled:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetEnabled,this.expService)?{totalTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetTotalTokens,this.expService),order:$o.GlobalBudgetOptions.DEFAULT_ORDER,shares:$o.GlobalBudgetOptions.DEFAULT_SHARES}:void 0},n=this.modelService.selectedModelConfiguration(),o=$o.applyStrategyConfig(n);return{promptOptions:u5r(r,o),modelServiceConfig:o}}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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(ITc.XtabEndpoint,r,n,e):(0,ZSc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n,o,s){if(!this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService))return;let l=s===$o.ResponseFormat.CustomDiffPatch?this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchModelPredictionKind,this.expService):$o.PatchModelPrediction.FilePath;return{type:"content",content:gUi(e,r,n,o,s,l)}}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof yV.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,mV.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:_Tc.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:_bt.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(di.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:_bt.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=_bt.editWouldDeleteWhatWasJustInserted;break;case"v2":l=_bt.editWouldDeleteWhatWasJustInserted2;break;default:(0,Zne.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new Cbt.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(di.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:fUi(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}};Pp.XtabProvider=c5r;Pp.XtabProvider=c5r=s9=zSc([mN(0,iTc.IInlineEditsModelService),mN(1,sTc.ISimulationTestContext),mN(2,gTc.IInstantiationService),mN(3,cTc.IWorkspaceService),mN(4,JSc.IDiffService),mN(5,di.IConfigurationService),mN(6,aTc.IExperimentationService),mN(7,uUi.ILanguageContextProviderService),mN(8,oTc.ILanguageDiagnosticsService),mN(9,XSc.IIgnoreService),mN(10,bTc.ISimilarFilesContextService)],c5r);function fUi(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(fUi,"filterOutEditsWithSubstrings");function pUi(t){let e=t.cursorLineOffset,r=Math.max(0,e-AV.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+AV.N_LINES_AS_CONTEXT+1);return new a5r.OffsetRange(r,n)}a(pUi,"computeAreaAroundEditWindowLinesRange");function l5r(t){switch(t.type){case Lf.ChatFetchResponseType.Canceled:return new Ds.NoNextEditReason.GotCancelled("afterFetchCall");case Lf.ChatFetchResponseType.OffTopic:case Lf.ChatFetchResponseType.Filtered:case Lf.ChatFetchResponseType.PromptFiltered:case Lf.ChatFetchResponseType.Length:case Lf.ChatFetchResponseType.RateLimited:case Lf.ChatFetchResponseType.QuotaExceeded:case Lf.ChatFetchResponseType.ExtensionBlocked:case Lf.ChatFetchResponseType.AgentUnauthorized:case Lf.ChatFetchResponseType.AgentFailedDependency:case Lf.ChatFetchResponseType.InvalidStatefulMarker:return new Ds.NoNextEditReason.Uncategorized(gV.ErrorUtils.fromUnknown(t));case Lf.ChatFetchResponseType.BadRequest:case Lf.ChatFetchResponseType.NotFound:case Lf.ChatFetchResponseType.Failed:case Lf.ChatFetchResponseType.NetworkError:case Lf.ChatFetchResponseType.Unknown:return new Ds.NoNextEditReason.FetchFailure(gV.ErrorUtils.fromUnknown(t))}}a(l5r,"mapChatFetcherErrorToNoNextEditReason");function u5r(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?kTc(t.lintOptions,e.lintOptions):t.lintOptions}}a(u5r,"overrideModelConfig");var RTc={...$o.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function kTc(t,e){return{...t??RTc,...e}}a(kTc,"mergeLintOptions");function hUi(t){switch(t){case $o.PromptingStrategy.UnifiedModel:return HBe.unifiedModelSystemPrompt;case $o.PromptingStrategy.Codexv21NesUnified:case $o.PromptingStrategy.SimplifiedSystemPrompt:return HBe.simplifiedPrompt;case $o.PromptingStrategy.PatchBased:case $o.PromptingStrategy.PatchBased01:case $o.PromptingStrategy.PatchBased02:case $o.PromptingStrategy.PatchBased02WithRecentLineNumbers:case $o.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case $o.PromptingStrategy.Xtab275:case $o.PromptingStrategy.XtabAggressiveness:case $o.PromptingStrategy.Xtab275Aggressiveness:case $o.PromptingStrategy.Xtab275AggressivenessHighLow:case $o.PromptingStrategy.Xtab275EditIntent:case $o.PromptingStrategy.Xtab275EditIntentShort:return HBe.xtab275SystemPrompt;case $o.PromptingStrategy.Nes41Miniv3:return HBe.nes41Miniv3SystemPrompt;case $o.PromptingStrategy.CopilotNesXtab:case void 0:return HBe.systemPromptTemplate;default:(0,Zne.assertNever)(t)}}a(hUi,"pickSystemPrompt");function mUi(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(mUi,"determineLanguageContextOptions");function gUi(t,e,r,n,o,s){if(o===$o.ResponseFormat.UnifiedWithXml)return["",...r,""].join(` +`);if(o===$o.ResponseFormat.EditWindowOnly)return r.join(` +`);if(o===$o.ResponseFormat.EditWindowWithEditIntent)return["<|edit_intent|>high<|/edit_intent|>",...r].join(` +`);if(o===$o.ResponseFormat.EditWindowWithEditIntentShort)return["H",...r].join(` +`);if(o===$o.ResponseFormat.CodeBlock)return["```",...r,"```"].join(` +`);if(o===$o.ResponseFormat.CustomDiffPatch){let c=t.workspaceRoot?.path,l=(0,dUi.toUniquePath)(t.id,c);if(s===$o.PatchModelPrediction.FilePath)return`${l}:`;let u=r[n];if(u===void 0)return`${l}:`;let d=`${l}:${e}`;switch(s){case $o.PatchModelPrediction.CurrentLine:return[d,`-${u}`].join(` +`);case $o.PatchModelPrediction.CurrentLineReplaced:return[d,`-${u}`,"+"].join(` +`);case $o.PatchModelPrediction.CurrentLineCompleted:return[d,`-${u}`,`+${u}`].join(` +`);default:(0,Zne.assertNever)(s)}}else(0,Zne.assertNever)(o)}a(gUi,"getPredictionContents");async function*PTc(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 mTc.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(E=>{if(E>=o.length)return!1;switch(u){case Gv.EarlyDivergenceCancellationMode.Cursor:return E===e;case Gv.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let E of t){if(A(y)){let _=n.start+y,v=(0,cUi.getCurrentLine)(f,_,d,g);if(v!==void 0){let b=o[y];if(v!==b&&!(0,cUi.isModelLineCompatible)(b,v,E)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${E}" current="${v}"`),s.cancel();return}}}yield E,y++}}a(PTc,"linesWithIntermediateEditDivergenceCheck")});var yUi=I(kL=>{"use strict";p();var DTc=kL&&kL.__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},Sbt=kL&&kL.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(kL,"__esModule",{value:!0});kL.StaticGitHubAuthenticationService=void 0;kL.setCopilotToken=BTc;var NTc=Pl(),MTc=Sp(),Tbt=FE(),OTc=v5e(),LTc=eG(),Ibt=class extends Tbt.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:Tbt.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:Tbt.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 Tbt.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)}};kL.StaticGitHubAuthenticationService=Ibt;kL.StaticGitHubAuthenticationService=Ibt=DTc([Sbt(1,MTc.ILogService),Sbt(2,LTc.ICopilotTokenStore),Sbt(3,OTc.ICopilotTokenManager),Sbt(4,NTc.IConfigurationService)],Ibt);function BTc(t,e){if(!(t instanceof Ibt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(BTc,"setCopilotToken")});var bUi=I($v=>{"use strict";p();Object.defineProperty($v,"__esModule",{value:!0});$v.GraphQLErrorType=void 0;$v.getErrorCode=vUi;$v.derivePullRequestState=FTc;$v.makeGitHubAPIRequest=CUi;$v.makeGitHubGraphQLRequest=nEe;$v.makeSearchGraphQLRequest=UTc;$v.getPullRequestFromGlobalId=QTc;$v.addPullRequestCommentGraphQLRequest=qTc;$v.closePullRequest=jTc;$v.makeGitHubAPIRequestWithPagination=HTc;$v.getAssignableActorsWithSuggestedActors=GTc;$v.getAssignableActorsWithAssignableUsers=$Tc;function EUi(t){return typeof t=="object"&&t!==null}a(EUi,"isObject");var _Ui;(function(t){t.Unprocessable="UNPROCESSABLE"})(_Ui||($v.GraphQLErrorType=_Ui={}));function vUi(t){if(!EUi(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(EUi(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(vUi,"getErrorCode");function FTc(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(FTc,"derivePullRequestState");async function CUi(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:E="github-api-rest"}=l??{},_={Accept:m??"application/vnd.github+json",...g};c&&(_.Authorization=`Bearer ${c}`),d&&(_["X-GitHub-Api-Version"]=d),h&&(_["User-Agent"]=h);let v=await t.fetch(`${n}/${o}`,{method:s,headers:_,body:u?JSON.stringify(u):void 0,callSite:E});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 b=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),b}catch{return}}a(CUi,"makeGitHubAPIRequest");async function nEe(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(nEe,"makeGitHubGraphQLRequest");async function UTc(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 { @@ -1360,7 +1360,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(NTc,"makeSearchGraphQLRequest");async function MTc(t,e,r,n,o,s){let c=` + `;e.debug(`[FolderRepositoryManager+0] Fetch pull request category ${s}`);let d=await nEe(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(UTc,"makeSearchGraphQLRequest");async function QTc(t,e,r,n,o,s){let c=` query GetPullRequestGlobal($globalId: ID!) { node(id: $globalId) { ... on PullRequest { @@ -1395,7 +1395,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=AUi(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(MTc,"getPullRequestFromGlobalId");async function OTc(t,e,r,n,o,s,c){let l=` + `;e.debug(`[GitHubAPI] Fetch pull request by global ID ${s}`);let u=await nEe(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=vUi(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(QTc,"getPullRequestFromGlobalId");async function qTc(t,e,r,n,o,s,c){let l=` mutation AddPullRequestComment($pullRequestId: ID!, $body: String!) { addComment(input: {subjectId: $pullRequestId, body: $body}) { commentEdge { @@ -1411,7 +1411,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(OTc,"addPullRequestCommentGraphQLRequest");async function LTc(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await yUi(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(LTc,"closePullRequest");async function BTc(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(BTc,"makeGitHubAPIRequestWithPagination");async function FTc(t,e,r,n,o,s,c){let l=` + `;return e.debug(`[GitHubAPI] Adding comment to pull request ${s}`),(await nEe(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(qTc,"addPullRequestCommentGraphQLRequest");async function jTc(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await CUi(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(jTc,"closePullRequest");async function HTc(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(HTc,"makeGitHubAPIRequestWithPagination");async function GTc(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( @@ -1432,7 +1432,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(FTc,"getAssignableActorsWithSuggestedActors");async function UTc(t,e,r,n,o,s,c){let l=` + `,u=[],d=null,f=!0;for(;f;){let m=await nEe(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(GTc,"getAssignableActorsWithSuggestedActors");async function $Tc(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) { @@ -1449,27 +1449,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(UTc,"getAssignableActorsWithAssignableUsers")});var CUi=I(XR=>{"use strict";p();Object.defineProperty(XR,"__esModule",{value:!0});XR.BaseOctoKitService=XR.PermissiveAuthRequiredError=XR.VSCodeTeamId=XR.IOctoKitService=XR.IGithubRepositoryService=void 0;var vUi=nn(),_Ui=e$(),mN=EUi();XR.IGithubRepositoryService=(0,vUi.createServiceIdentifier)("IGithubRepositoryService");XR.IOctoKitService=(0,vUi.createServiceIdentifier)("IOctoKitService");XR.VSCodeTeamId=1682102;var u5r=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};XR.PermissiveAuthRequiredError=u5r;var d5r=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,mN.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,mN.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,mN.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,mN.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,mN.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,mN.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,mN.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,_Ui.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(Ibt,"__esModule",{value:!0});Ibt.NullBaseOctoKitService=void 0;var QTc=CUi(),f5r=class extends QTc.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){}};Ibt.NullBaseOctoKitService=f5r});var xUi=I(Ll=>{"use strict";p();var Nbt=Ll&&Ll.__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},Ou=Ll&&Ll.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Ll,"__esModule",{value:!0});Ll.CopilotTokenManagerFromGitHubToken=Ll.CopilotTokenManagerFromDeviceId=Ll.RefreshableCopilotTokenManager=Ll.StaticExtendedTokenInfoCopilotTokenManager=Ll.FixedCopilotTokenManager=Ll.BaseCopilotTokenManager=Ll.tokenErrorString=void 0;Ll.createStaticGitHubTokenProvider=jTc;Ll.getOrCreateTestingCopilotTokenManager=HTc;var p5r=(Sne(),ba(bne)),qTc=Ic(),SUi=Ro(),xbt=Hft(),IUi=Pl(),Mbt=$E(),Obt=J$(),iEe=U4(),Lbt=bUi(),Bbt=Sp(),HBe=_y(),Fbt=gm(),TUi=Tye(),s9=hgt(),wbt=E5e();Ll.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 jTc(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(iEe.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Ll.tokenErrorString)}}a(jTc,"createStaticGitHubTokenProvider");function HTc(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new xbt.SyncDescriptor(kbt,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new xbt.SyncDescriptor(Dbt,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new xbt.SyncDescriptor(Rbt,[process.env.GITHUB_PAT]);if(iEe.isScenarioAutomation)return new xbt.SyncDescriptor(Pbt,[t]);throw new Error(Ll.tokenErrorString)}a(HTc,"getOrCreateTestingCopilotTokenManager");var nEe=class extends SUi.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 qTc.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,SUi.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=TUi.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,wbt.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,s9.containsVSCodeOrg)(s.organization_list??[])},d=TUi.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,wbt.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:p5r.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:p5r.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,HBe.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,s9.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,s9.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,s9.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:p5r.RequestType.CopilotUserInfo})).json()}};Ll.BaseCopilotTokenManager=nEe;var Rbt=class extends nEe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new Lbt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,s9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,s9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new s9.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Ll.FixedCopilotTokenManager=Rbt;Ll.FixedCopilotTokenManager=Rbt=Nbt([Ou(1,Bbt.ILogService),Ou(2,Fbt.ITelemetryService),Ou(3,Mbt.ICAPIClientService),Ou(4,Obt.IDomainService),Ou(5,HBe.IFetcherService),Ou(6,iEe.IEnvService)],Rbt);var kbt=class extends nEe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new Lbt.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 s9.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Ll.StaticExtendedTokenInfoCopilotTokenManager=kbt;Ll.StaticExtendedTokenInfoCopilotTokenManager=kbt=Nbt([Ou(1,Bbt.ILogService),Ou(2,Fbt.ITelemetryService),Ou(3,Mbt.ICAPIClientService),Ou(4,Obt.IDomainService),Ou(5,HBe.IFetcherService),Ou(6,iEe.IEnvService)],kbt);var jBe=class extends nEe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,wbt.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 s9.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,wbt.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Ll.RefreshableCopilotTokenManager=jBe;var Pbt=class extends jBe{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new Lbt.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Ll.CopilotTokenManagerFromDeviceId=Pbt;Ll.CopilotTokenManagerFromDeviceId=Pbt=Nbt([Ou(1,Bbt.ILogService),Ou(2,Fbt.ITelemetryService),Ou(3,Obt.IDomainService),Ou(4,Mbt.ICAPIClientService),Ou(5,HBe.IFetcherService),Ou(6,iEe.IEnvService),Ou(7,IUi.IConfigurationService)],Pbt);var Dbt=class extends jBe{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new Lbt.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)}};Ll.CopilotTokenManagerFromGitHubToken=Dbt;Ll.CopilotTokenManagerFromGitHubToken=Dbt=Nbt([Ou(2,Bbt.ILogService),Ou(3,Fbt.ITelemetryService),Ou(4,Obt.IDomainService),Ou(5,Mbt.ICAPIClientService),Ou(6,HBe.IFetcherService),Ou(7,iEe.IEnvService),Ou(8,IUi.IConfigurationService)],Dbt)});var wUi=I(a9=>{"use strict";p();var GTc=a9&&a9.__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},h5r=a9&&a9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(a9,"__esModule",{value:!0});a9.ChatQuotaService=void 0;var $Tc=(Sne(),ba(bne)),VTc=Ic(),WTc=Ro(),zTc=FE(),YTc=$E(),KTc=Sp(),m5r=class extends WTc.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 VTc.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:$Tc.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()}};a9.ChatQuotaService=m5r;a9.ChatQuotaService=m5r=GTc([h5r(0,zTc.IAuthenticationService),h5r(1,KTc.ILogService),h5r(2,YTc.ICAPIClientService)],m5r)});var kUi=I(Ubt=>{"use strict";p();Object.defineProperty(Ubt,"__esModule",{value:!0});Ubt.DefaultsOnlyConfigurationService=void 0;var RUi=Pl(),g5r=class extends RUi.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=RUi.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};Ubt.DefaultsOnlyConfigurationService=g5r});var DUi=I(Qbt=>{"use strict";p();Object.defineProperty(Qbt,"__esModule",{value:!0});Qbt.computeDiff=ZTc;Qbt.computeDiffSync=PUi;var JTc=aDr();async function ZTc(t,e,r){return PUi(t,e,r)}a(ZTc,"computeDiff");function PUi(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new JTc.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(PUi,"computeDiffSync")});var LUi=I(gN=>{"use strict";p();var XTc=gN&&gN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eIc=gN&&gN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),OUi=gN&&gN.__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=sIc([NUi.join(__dirname,"diffWorker.js"),NUi.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new tIc.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 oIc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:E5r(o.changes),moves:o.moves.map(c=>new iIc.MovedText(new A5r.LineRangeMapping(new qbt.LineRange(c[0],c[1]),new qbt.LineRange(c[2],c[3])),E5r(c[4])))}}};gN.DiffServiceImpl=y5r;function E5r(t){return t.map(e=>new A5r.DetailedLineRangeMapping(new qbt.LineRange(e[0],e[1]),new qbt.LineRange(e[2],e[3]),e[4]?.map(r=>new A5r.RangeMapping(new MUi.Range(r[0],r[1],r[2],r[3]),new MUi.Range(r[4],r[5],r[6],r[7])))))}a(E5r,"toLineRangeMappings");function sIc(t){for(let e of t)if((0,nIc.existsSync)(e))return e}a(sIc,"firstExistingPath")});var FUi=I(c9=>{"use strict";p();var aIc=c9&&c9.__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},BUi=c9&&c9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(c9,"__esModule",{value:!0});c9.CAPIClientImpl=void 0;var cIc=U4(),lIc=_y(),uIc=$E(),_5r=class extends uIc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};c9.CAPIClientImpl=_5r;c9.CAPIClientImpl=_5r=aIc([BUi(0,lIc.IFetcherService),BUi(1,cIc.IEnvService)],_5r)});var QUi=I(l9=>{"use strict";p();var dIc=l9&&l9.__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},v5r=l9&&l9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(l9,"__esModule",{value:!0});l9.DomainService=void 0;var fIc=Ic(),pIc=Ro(),hIc=XH(),oEe=Pl(),mIc=$E(),UUi="github-enterprise.uri",C5r=class extends pIc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new fIc.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(`${oEe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(UUi))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(oEe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(oEe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(oEe.ConfigKey.Shared.AuthProvider)===oEe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(UUi):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)}};l9.DomainService=C5r;l9.DomainService=C5r=dIc([v5r(0,oEe.IConfigurationService),v5r(1,hIc.ICopilotTokenStore),v5r(2,mIc.ICAPIClientService)],C5r)});var qUi=I(sEe=>{"use strict";p();Object.defineProperty(sEe,"__esModule",{value:!0});sEe.NullNativeEnvService=sEe.NullEnvService=void 0;var gIc=Ic(),AIc=nd(),jbt=U4(),yIc=c5e(),Hbt=class t extends jbt.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 gIc.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 jbt.OperatingSystem.Linux}getEditorInfo(){return new jbt.NameAndVersion("simulation-tests-editor",yIc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new jbt.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};sEe.NullEnvService=Hbt;var b5r=class extends Hbt{static{a(this,"NullNativeEnvService")}get userHome(){return AIc.URI.file("/home/testuser")}};sEe.NullNativeEnvService=b5r});var S5r=I(Gbt=>{"use strict";p();Object.defineProperty(Gbt,"__esModule",{value:!0});Gbt.IGitExtensionService=void 0;var EIc=nn();Gbt.IGitExtensionService=(0,EIc.createServiceIdentifier)("IGitExtensionService")});var jUi=I($bt=>{"use strict";p();Object.defineProperty($bt,"__esModule",{value:!0});$bt.NullGitExtensionService=void 0;var _Ic=Ic(),T5r=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=_Ic.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};$bt.NullGitExtensionService=T5r});var HUi=I(u9=>{"use strict";p();var vIc=u9&&u9.__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},CIc=u9&&u9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(u9,"__esModule",{value:!0});u9.ObservableGit=void 0;var bIc=Ro(),EV=W2(),SIc=S5r(),I5r=class extends bIc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,EV.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,EV.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,EV.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,EV.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,EV.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,EV.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,EV.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,EV.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};u9.ObservableGit=I5r;u9.ObservableGit=I5r=vIc([CIc(0,SIc.IGitExtensionService)],I5r)});var Wbt=I(Bl=>{"use strict";p();Object.defineProperty(Bl,"__esModule",{value:!0});Bl.lengthZero=void 0;Bl.lengthDiff=xIc;Bl.lengthIsZero=wIc;Bl.toLength=Xne;Bl.lengthToObj=RIc;Bl.lengthGetLineCount=kIc;Bl.lengthGetColumnCountIfZeroLineCount=PIc;Bl.lengthAdd=$Ui;Bl.sumLengths=DIc;Bl.lengthEquals=NIc;Bl.lengthDiffNonNegative=MIc;Bl.lengthLessThan=OIc;Bl.lengthLessThanEqual=LIc;Bl.lengthGreaterThanEqual=BIc;Bl.lengthToPosition=FIc;Bl.positionToLength=UIc;Bl.lengthsToRange=QIc;Bl.lengthOfRange=qIc;Bl.lengthCompare=jIc;Bl.lengthOfString=HIc;Bl.lengthOfStringObj=GIc;Bl.lengthHash=$Ic;Bl.lengthMax=VIc;var GUi=em(),TIc=q_(),IIc=eh(),Vbt=Tme();function xIc(t,e,r,n){return t!==r?Xne(r-t,n):Xne(0,n-e)}a(xIc,"lengthDiff");Bl.lengthZero=0;function wIc(t){return t===0}a(wIc,"lengthIsZero");var e_=2**26;function Xne(t,e){return t*e_+e}a(Xne,"toLength");function RIc(t){let e=t,r=Math.floor(e/e_),n=e-r*e_;return new Vbt.TextLength(r,n)}a(RIc,"lengthToObj");function kIc(t){return Math.floor(t/e_)}a(kIc,"lengthGetLineCount");function PIc(t){return t}a(PIc,"lengthGetColumnCountIfZeroLineCount");function $Ui(t,e){let r=t+e;return e>=e_&&(r=r-t%e_),r}a($Ui,"lengthAdd");function DIc(t,e){return t.reduce((r,n)=>$Ui(r,e(n)),Bl.lengthZero)}a(DIc,"sumLengths");function NIc(t,e){return t===e}a(NIc,"lengthEquals");function MIc(t,e){let r=t,n=e;if(n-r<=0)return Bl.lengthZero;let s=Math.floor(r/e_),c=Math.floor(n/e_),l=n-c*e_;if(s===c){let u=r-s*e_;return Xne(0,l-u)}else return Xne(c-s,l)}a(MIc,"lengthDiffNonNegative");function OIc(t,e){return t=e}a(BIc,"lengthGreaterThanEqual");function FIc(t){let e=t,r=Math.floor(e/e_),n=e-r*e_;return new TIc.Position(r+1,n+1)}a(FIc,"lengthToPosition");function UIc(t){return Xne(t.lineNumber-1,t.column-1)}a(UIc,"positionToLength");function QIc(t,e){let r=t,n=Math.floor(r/e_),o=r-n*e_,s=e,c=Math.floor(s/e_),l=s-c*e_;return new IIc.Range(n+1,o+1,c+1,l+1)}a(QIc,"lengthsToRange");function qIc(t){return t.startLineNumber===t.endLineNumber?new Vbt.TextLength(0,t.endColumn-t.startColumn):new Vbt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(qIc,"lengthOfRange");function jIc(t,e){return t-e}a(jIc,"lengthCompare");function HIc(t){let e=(0,GUi.splitLines)(t);return Xne(e.length-1,e[e.length-1].length)}a(HIc,"lengthOfString");function GIc(t){let e=(0,GUi.splitLines)(t);return new Vbt.TextLength(e.length-1,e[e.length-1].length)}a(GIc,"lengthOfStringObj");function $Ic(t){return t}a($Ic,"lengthHash");function VIc(t,e){return t>e?t:e}a(VIc,"lengthMax")});var R5r=I(zbt=>{"use strict";p();Object.defineProperty(zbt,"__esModule",{value:!0});zbt.TextEditInfo=void 0;var x5r=Wbt(),w5r=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,x5r.lengthToObj)(this.startOffset)}...${(0,x5r.lengthToObj)(this.endOffset)}) -> ${(0,x5r.lengthToObj)(this.newLength)}`}};zbt.TextEditInfo=w5r});var WUi=I(k5r=>{"use strict";p();Object.defineProperty(k5r,"__esModule",{value:!0});k5r.combineTextEditInfos=YIc;var WIc=Sl(),O0=Wbt(),zIc=R5r();function YIc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new WIc.ArrayQueue(VUi(t)),n=VUi(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,O0.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,O0.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,O0.lengthIsZero)(d)||f.push(new GBe(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,O0.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new zIc.TextEditInfo(m.startOffset,f,(0,O0.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=O0.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,O0.sumLengths)(f,g=>g.lengthBefore),m=(0,O0.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,O0.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(YIc,"combineTextEditInfos");var GBe=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,O0.lengthDiffNonNegative)(e,this.lengthAfter);return(0,O0.lengthEquals)(r,O0.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,O0.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,O0.lengthToObj)(this.lengthBefore)} -> ${(0,O0.lengthToObj)(this.lengthAfter)}`}};function VUi(t){let e=[],r=O0.lengthZero;for(let n of t){let o=(0,O0.lengthDiffNonNegative)(r,n.startOffset);(0,O0.lengthIsZero)(o)||e.push(new GBe(!1,o,o));let s=(0,O0.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new GBe(!0,s,n.newLength)),r=n.endOffset}return e}a(VUi,"toLengthMapping")});var YUi=I(aEe=>{"use strict";p();Object.defineProperty(aEe,"__esModule",{value:!0});aEe.SingleTextEditLength=aEe.TextLengthEdit=void 0;var KIc=eh(),zUi=Tme(),JIc=WUi(),$Be=Wbt(),ZIc=R5r(),P5r=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new VBe(n.range,zUi.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,$Be.lengthToObj)(n.newLength);return new VBe((0,$Be.lengthsToRange)(n.startOffset,n.endOffset),new zUi.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new ZIc.TextEditInfo((0,$Be.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,$Be.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,$Be.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,JIc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return KIc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};aEe.TextLengthEdit=P5r;var VBe=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};aEe.SingleTextEditLength=VBe});var KUi=I(cEe=>{"use strict";p();Object.defineProperty(cEe,"__esModule",{value:!0});cEe.DocumentHistory=cEe.HistoryContext=void 0;var XIc=rd(),exc=iN(),D5r=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,XIc.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}}};cEe.HistoryContext=D5r;var N5r=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 exc.RootedEdit(this.base,this.lastEdits.compose())}};cEe.DocumentHistory=N5r});var r7i=I(lEe=>{"use strict";p();Object.defineProperty(lEe,"__esModule",{value:!0});lEe.NesHistoryContextProvider=void 0;lEe.sum=zBe;lEe.editExtends=t7i;var JUi=Ro(),ZUi=W2(),txc=KS(),WBe=kE(),rxc=h5e(),nxc=qT(),Ybt=iN(),ixc=L_t(),XUi=YUi(),oxc=h4(),YBe=vMe(),e7i=KUi(),M5r=class extends JUi.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new L5r(50),this._register((0,ZUi.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,YBe.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,ZUi.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new O5r(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,oxc.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,JUi.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 e7i.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,YBe.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};lEe.NesHistoryContextProvider=M5r;var O5r=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 nxc.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=rxc.TextEdit.fromStringEdit(e,this._currentValue),o=XUi.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return zBe(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&t7i(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,YBe.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,YBe.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new Ybt.Edits(WBe.StringEdit,this._edits.map(o=>o.edit));return{history:new e7i.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=WBe.StringEdit.empty,o=XUi.TextLengthEdit.empty,s,c=0,l=WBe.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,YBe.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,txc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=zBe(u.textLengthEdit.edits,b=>b.range.endLineNumber-b.range.startLineNumber+b.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||zBe(u.edit.replacements,b=>b.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||zBe(u.edit.replacements,b=>b.replaceRange.length)>t.MAX_EDITED_CHARS_PER_EDIT)break;if(s===this._edits.length-1)l=u.edit;else{let b=WBe.StringEdit.trySwap(u.edit,l);if(b)l=b.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),E=Ybt.RootedEdit.toLineEdit(new Ybt.RootedEdit(r,y)),v=new ixc.RootedLineEdit(r,E).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 Ybt.Edits(WBe.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function zBe(t,e){let r=0;for(let n of t)r+=e(n);return r}a(zBe,"sum");function t7i(t,e){let r=e.getNewRanges();return t.replacements.every(n=>sxc(n.replaceRange,r))}a(t7i,"editExtends");function sxc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(sxc,"doesTouch");var L5r=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 o7i=I(AN=>{"use strict";p();var axc=AN&&AN.__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},n7i=AN&&AN.__param||function(t,e){return function(r,n){e(r,n,t)}},F5r;Object.defineProperty(AN,"__esModule",{value:!0});AN.NesXtabHistoryTracker=AN.XtabEditMergeStrategy=void 0;var U5r=rd(),cxc=Ro(),lxc=vue(),uxc=W2(),dxc=C8(),Jbt=Pl(),fxc=mh(),Kbt=iN(),d9=Uvr(),pxc=h4(),B5r=vMe(),Q5r;(function(t){t.sameStartLine={kind:d9.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:d9.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:d9.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case d9.DiffHistoryMergeStrategy.Proximity:return e(s);case d9.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case d9.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,U5r.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(Q5r||(AN.XtabEditMergeStrategy=Q5r={}));function i7i(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(i7i,"areLineEditsWithinProximity");var q5r=class extends cxc.Disposable{static{a(this,"NesXtabHistoryTracker")}static{F5r=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 lxc.LinkedList,this.maxHistorySize=r??F5r.MAX_HISTORY_SIZE,this.mergeStrategy=(0,dxc.derived)(s=>Q5r.fromConfig(this._configurationService.getExperimentBasedConfigObservable(Jbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(Jbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(Jbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,uxc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,pxc.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,B5r.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case d9.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case d9.DiffHistoryMergeStrategy.Proximity:return i7i(r,e,o.lineGap);case d9.DiffHistoryMergeStrategy.Hybrid:return(0,B5r.now)()-n<=o.splitAfterMs&&i7i(r,e,o.lineGap)}}handleEdits(e,r){(0,U5r.assert)(r.previous!==void 0,"Document has previous version"),(0,U5r.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 Kbt.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=Kbt.RootedEdit.toLineEdit(l),d=Kbt.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new Kbt.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,B5r.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)}}}};AN.NesXtabHistoryTracker=q5r;AN.NesXtabHistoryTracker=q5r=F5r=axc([n7i(2,Jbt.IConfigurationService),n7i(3,fxc.IExperimentationService)],q5r)});var s7i=I(Zbt=>{"use strict";p();Object.defineProperty(Zbt,"__esModule",{value:!0});Zbt.IVSCodeExtensionContext=void 0;var hxc=nn();Zbt.IVSCodeExtensionContext=(0,hxc.createServiceIdentifier)("IVSCodeExtensionContext")});var h7i=I(EN=>{"use strict";p();var u7i=EN&&EN.__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},_V=EN&&EN.__param||function(t,e){return function(r,n){e(r,n,t)}},JBe;Object.defineProperty(EN,"__esModule",{value:!0});EN.UndesiredModels=EN.InlineEditsModelService=void 0;var mxc=MOr(),d7i=gOr(),a7i=X_(),gxc=Sl(),c7i=rd(),f7i=Ic(),p7i=Ro(),uEe=W2(),Axc=XH(),yN=Pl(),yxc=s7i(),Exc=Sp(),_xc=hbt(),vxc=mh(),Cxc=gm(),KBe=py(),bxc=kCt(),H5r=class extends p7i.Disposable{static{a(this,"InlineEditsModelService")}static{JBe=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:KBe.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:KBe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:KBe.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,uEe.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,uEe.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,uEe.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new d7i.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,uEe.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,uEe.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,uEe.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=f7i.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,mxc.filterMap)(r,f=>{if((0,KBe.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,gxc.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 j5r(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 j5r(r[0])}return j5r(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,c7i.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()?JBe.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?JBe.COPILOT_NES_CALLISTO:JBe.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,c7i.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=KBe.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=a7i.ErrorUtils.toString(a7i.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};EN.InlineEditsModelService=H5r;EN.InlineEditsModelService=H5r=JBe=u7i([_V(0,Axc.ICopilotTokenStore),_V(1,_xc.IProxyModelsService),_V(2,bxc.IUndesiredModelsManager),_V(3,yN.IConfigurationService),_V(4,vxc.IExperimentationService),_V(5,Cxc.ITelemetryService),_V(6,Exc.ILogService)],H5r);function j5r(t){let{source:e,...r}=t;return r}a(j5r,"toModelConfiguration");var l7i;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends p7i.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new f7i.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new d7i.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=u7i([_V(0,yxc.IVSCodeExtensionContext)],r),t.Manager=r})(l7i||(EN.UndesiredModels=l7i={}))});var m7i=I(Xbt=>{"use strict";p();Object.defineProperty(Xbt,"__esModule",{value:!0});Xbt.NullLanguageContextProviderService=void 0;var Sxc=Ro(),G5r=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return Sxc.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};Xbt.NullLanguageContextProviderService=G5r});var g7i=I(e1t=>{"use strict";p();Object.defineProperty(e1t,"__esModule",{value:!0});e1t.TestLanguageDiagnosticsService=void 0;var Txc=Ic(),Ixc=zP(),xxc=T$(),$5r=class extends xxc.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new Ixc.ResourceMap,this._onDidChangeDiagnostics=new Txc.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())}};e1t.TestLanguageDiagnosticsService=$5r});var A7i=I(r1t=>{"use strict";p();Object.defineProperty(r1t,"__esModule",{value:!0});r1t.ResponseStream=void 0;var wxc=X_(),t1t=uw(),Rxc=nl(),kxc=KS(),V5r=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new Rxc.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return t1t.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return t1t.Result.error(l)}}),this.stream=Pxc(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,kxc.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}}};r1t.ResponseStream=V5r;async function*Pxc(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=wxc.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?t1t.Result.error(n):t1t.Result.ok(r))}}a(Pxc,"streamWithAggregation")});var y7i=I(W5r=>{"use strict";p();Object.defineProperty(W5r,"__esModule",{value:!0});W5r.jsonlStreamToCompletions=Dxc;async function*Dxc(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(Dxc,"jsonlStreamToCompletions")});var _7i=I(f9=>{"use strict";p();var Nxc=f9&&f9.__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},z5r=f9&&f9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(f9,"__esModule",{value:!0});f9.CompletionsFetchService=void 0;var Mxc=AOr(),E7i=X_(),eie=uw(),Oxc=I0r(),Lxc=FE(),Bxc=$6(),Fxc=_y(),Uxc=lye(),vV=__t(),Qxc=A7i(),qxc=y7i(),Y5r=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=eie.Result.error(new vV.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=Mxc.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,qxc.jsonlStreamToCompletions)(f),m=new Qxc.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=eie.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new vV.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>Hxc(d.val.body).catch(()=>"")),h=eie.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())),eie.Result.error(new vV.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=jxc(u,s);return eie.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,Bxc.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return eie.Result.error(new vV.Completions.RequestCancelled);let l=E7i.ErrorUtils.fromUnknown(c);return eie.Result.error(new vV.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 vV.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof vV.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof vV.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:Oxc.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}}};f9.CompletionsFetchService=Y5r;f9.CompletionsFetchService=Y5r=Nxc([z5r(0,Lxc.IAuthenticationService),z5r(1,Fxc.IFetcherService),z5r(2,Uxc.IRequestLogger)],Y5r);async function*jxc(t,e){try{for await(let r of t)yield r}catch(r){throw E7i.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(jxc,"streamWithCleanup");async function Hxc(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(Hxc,"collectAsyncIterableToString")});var C7i=I(n1t=>{"use strict";p();Object.defineProperty(n1t,"__esModule",{value:!0});n1t.WireTypes=void 0;var CV=RG(),v7i;(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,CV.vObj)({promptStrategy:(0,CV.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,CV.vObj)({serviceType:(0,CV.vString)(),name:(0,CV.vString)(),provider:(0,CV.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,CV.vObj)({models:(0,CV.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={}))})(v7i||(n1t.WireTypes=v7i={}))});var S7i=I(p9=>{"use strict";p();var Gxc=p9&&p9.__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},i1t=p9&&p9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(p9,"__esModule",{value:!0});p9.ProxyModelsService=void 0;var $xc=require("util"),K5r=X_(),Vxc=YP(),Wxc=Ic(),zxc=Ro(),b7i=W2(),Yxc=XH(),Kxc=$E(),Jxc=C7i(),Zxc=Sp(),Xxc=_y(),J5r=class extends zxc.Disposable{static{a(this,"ProxyModelsService")}constructor(e,r,n,o){super(),this._tokenStore=e,this._capiClient=r,this._fetchService=n,this._logService=o,this._onModelListUpdated=this._register(new Wxc.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let s=(0,b7i.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,b7i.autorun)(c=>{let l=s.read(c),u=new Vxc.CancellationTokenSource;this._fetchLatestModels(l,u.token).then(d=>{d!==void 0&&(u.token.isCancellationRequested||(0,$xc.isDeepStrictEqual)(this._models,d)||(this._models=d,this._onModelListUpdated.fire()))}).catch(d=>{let f=K5r.ErrorUtils.fromUnknown(d);this._logService.error(f,"Failed to fetch models in autorun")}),c.store.add({dispose:a(()=>u.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}`},method:"GET",timeout:1e4,callSite:"proxy-models",signal:o.signal})}catch(l){let u=K5r.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=Jxc.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=K5r.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};p9.ProxyModelsService=J5r;p9.ProxyModelsService=J5r=Gxc([i1t(0,Yxc.ICopilotTokenStore),i1t(1,Kxc.ICAPIClientService),i1t(2,Xxc.IFetcherService),i1t(3,Zxc.ILogService)],J5r)});var T7i=I(o1t=>{"use strict";p();Object.defineProperty(o1t,"__esModule",{value:!0});o1t.NullRequestLogger=void 0;var ewc=fMr(),twc=Ic(),Z5r=class extends ewc.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=twc.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};o1t.NullRequestLogger=Z5r});var u1t=I(eu=>{"use strict";p();var a4r=eu&&eu.__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},_N=eu&&eu.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(eu,"__esModule",{value:!0});eu.SimpleExperimentationService=eu.LogLevel=eu.TokenizerName=eu.ILanguageContextProviderService=eu.IIgnoreService=eu.IExperimentationService=eu.IEndpointProvider=eu.ICAPIClientService=eu.IAuthenticationService=void 0;eu.createNESProvider=zwc;eu.createInlineCompletionsProvider=Kwc;var rwc=Asi(),I7i=bte(),x7i=sIi(),w7i=Uge(),nwc=mgt(),R7i=FSr(),iwc=USr(),$v=LE(),k7i=$Sr(),owc=e2i(),swc=fy(),P7i=LTr(),awc=n$(),D7i=jTr(),N7i=_4e(),M7i=cIr(),O7i=uIr(),L7i=IPr(),e4r=uyt(),cwc=LLi(),lwc=BLi(),ZBe=Dl(),uwc=KAe(),dwc=jSr(),B7i=o2r(),F7i=mTr(),U7i=A_t(),Q7i=ckr(),q7i=tEt(),XBe=eEt(),j7i=v$(),H7i=hEt(),fwc=qLi(),pwc=dEt(),G7i=sCr(),$7i=s1(),V7i=_5e(),W7i=rne(),iQi=Ore();Object.defineProperty(eu,"TokenizerName",{enumerable:!0,get:a(function(){return iQi.TokenizerName},"get")});var hwc=tBi(),mwc=XBi(),t4r=C3i(),z7i=BDr(),gwc=s6i(),Y7i=xMr(),Awc=pUi(),c4r=FE();Object.defineProperty(eu,"IAuthenticationService",{enumerable:!0,get:a(function(){return c4r.IAuthenticationService},"get")});var ywc=E5e(),K7i=XH(),Ewc=hUi(),_wc=xUi(),vwc=K6(),Cwc=QDr(),bwc=wUi(),Swc=qDr(),J7i=HDr(),PL=Pl(),Twc=kUi(),Iwc=wMr(),xwc=LUi(),l4r=$E();Object.defineProperty(eu,"ICAPIClientService",{enumerable:!0,get:a(function(){return l4r.ICAPIClientService},"get")});var wwc=J$(),u4r=s4e();Object.defineProperty(eu,"IEndpointProvider",{enumerable:!0,get:a(function(){return u4r.IEndpointProvider},"get")});var oQi=FUi(),Rwc=QUi(),tie=U4(),kwc=qUi(),Pwc=S5r(),sQi=jUi(),e3e=Bre();Object.defineProperty(eu,"IIgnoreService",{enumerable:!0,get:a(function(){return e3e.IIgnoreService},"get")});var Dwc=Vne(),Nwc=Zft(),X5r=kCt(),Mwc=HUi(),Owc=r7i(),Lwc=o7i(),Bwc=h7i(),d4r=Jyt();Object.defineProperty(eu,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return d4r.ILanguageContextProviderService},"get")});var aQi=m7i(),cQi=T$(),lQi=g7i(),vN=Sp(),Fwc=__t(),Uwc=_7i(),f4r=_y(),Z7i=X6(),Qwc=aMr(),qwc=cMr(),jwc=yCt(),Hwc=hbt(),Gwc=S7i(),uQi=lye(),dQi=T7i(),X7i=BMr(),eQi=Q2r(),r3e=mh();Object.defineProperty(eu,"IExperimentationService",{enumerable:!0,get:a(function(){return r3e.IExperimentationService},"get")});var fQi=gm(),tQi=Tye(),$wc=Ivr(),rQi=abt(),nQi=K$(),r4r=fOr(),pQi=nn(),Vwc=YP(),t3e=Ic(),l1t=Ro(),Wwc=T0(),gi=Hft(),hQi=Gs(),rie;(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"})(rie||(eu.LogLevel=rie={}));function zwc(t){return Ywc(t).createInstance(n4r,t)}a(zwc,"createNESProvider");var n4r=class extends l1t.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(Awc.XtabProvider),l=r.createInstance(Mwc.ObservableGit),u=new Owc.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(PL.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new Lwc.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new hwc.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(mwc.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(t4r.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=Dwc.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,Wwc.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new Nwc.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new t4r.NextEditProviderTelemetryBuilder(new sQi.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 nie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=PL.globalConfigRegistry.configs.get(`${PL.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};n4r=a4r([_N(1,hQi.IInstantiationService),_N(2,r3e.IExperimentationService),_N(3,PL.IConfigurationService),_N(4,r4r.IWorkspaceService)],n4r);function Ywc(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o}=t,s=new pQi.InstantiationServiceBuilder;s.define(PL.IConfigurationService,new gi.SyncDescriptor(s1t,[t.configOverrides??new Map])),s.define(r3e.IExperimentationService,new gi.SyncDescriptor(nie,[t.waitForTreatmentVariables])),s.define(X7i.ISimulationTestContext,new gi.SyncDescriptor(X7i.NulSimulationTestContext)),s.define(r4r.IWorkspaceService,new gi.SyncDescriptor(r4r.NullWorkspaceService)),s.define(Iwc.IDiffService,new gi.SyncDescriptor(xwc.DiffServiceImpl,[!1])),s.define(vN.ILogService,new gi.SyncDescriptor(vN.LogServiceImpl,[[o||new vN.ConsoleLog(void 0,vN.LogLevel.Trace)]])),s.define(Pwc.IGitExtensionService,new gi.SyncDescriptor(sQi.NullGitExtensionService)),s.define(d4r.ILanguageContextProviderService,new gi.SyncDescriptor(aQi.NullLanguageContextProviderService)),s.define(cQi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(lQi.TestLanguageDiagnosticsService)),s.define(e3e.IIgnoreService,new gi.SyncDescriptor(e3e.NullIgnoreService)),s.define(eQi.ISnippyService,new gi.SyncDescriptor(eQi.NullSnippyService)),s.define(wwc.IDomainService,new gi.SyncDescriptor(Rwc.DomainService)),s.define(l4r.ICAPIClientService,new gi.SyncDescriptor(oQi.CAPIClientImpl)),s.define(K7i.ICopilotTokenStore,new gi.SyncDescriptor(K7i.CopilotTokenStore)),s.define(tie.IEnvService,new gi.SyncDescriptor(kwc.NullEnvService)),s.define(f4r.IFetcherService,new gi.SyncDescriptor(a1t,[e])),s.define(fQi.ITelemetryService,new gi.SyncDescriptor(c1t,[n])),s.define(c4r.IAuthenticationService,new gi.SyncDescriptor(Ewc.StaticGitHubAuthenticationService,[(0,_wc.createStaticGitHubTokenProvider)()])),s.define(ywc.ICopilotTokenManager,r),s.define(z7i.IPowerService,new gi.SyncDescriptor(z7i.NullPowerService)),s.define(vwc.IChatMLFetcher,new gi.SyncDescriptor(gwc.ChatMLFetcherImpl)),s.define(Z7i.IChatWebSocketManager,new gi.SyncDescriptor(Z7i.NullChatWebSocketManager)),s.define(jwc.IOTelService,new Qwc.NoopOTelService((0,qwc.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),s.define(Cwc.IChatQuotaService,new gi.SyncDescriptor(bwc.ChatQuotaService)),s.define(J7i.IInteractionService,new gi.SyncDescriptor(J7i.InteractionService)),s.define(uQi.IRequestLogger,new gi.SyncDescriptor(dQi.NullRequestLogger)),s.define(nQi.ITokenizerProvider,t.tokenizerProvider??new gi.SyncDescriptor(nQi.TokenizerProvider,[!1])),s.define(Swc.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),s.define(Hwc.IProxyModelsService,new gi.SyncDescriptor(Gwc.ProxyModelsService)),s.define(X5r.IInlineEditsModelService,new gi.SyncDescriptor(Bwc.InlineEditsModelService)),s.define(X5r.IUndesiredModelsManager,t.undesiredModelsManager||new gi.SyncDescriptor(X5r.NullUndesiredModelsManager)),s.define(rQi.ITerminalService,t.terminalService||new gi.SyncDescriptor(rQi.NullTerminalService)),s.define(Y7i.ISimilarFilesContextService,new gi.SyncDescriptor(Y7i.NullSimilarFilesContextService)),s.define(u4r.IEndpointProvider,new i4r);let c=new $v.InMemoryConfigProvider(new $v.DefaultsOnlyConfigProvider);return t.configOverrides&&c.setOverrides(t.configOverrides),s.define($v.ICompletionsConfigProvider,c),s.seal()}a(Ywc,"setupServices");var s1t=class extends Twc.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)}},i4r=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=t3e.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},nie=class extends l1t.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new t3e.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()}};eu.SimpleExperimentationService=nie;eu.SimpleExperimentationService=nie=a4r([_N(1,PL.IConfigurationService)],nie);var a1t=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=t3e.Event.None,this.onDidCompleteFetch=t3e.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 f4r.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)}},c1t=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,tQi.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,tQi.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function Kwc(t){return t.tokenizerProvider&&(0,iQi.setExternalTokenizerProvider)(t.tokenizerProvider),Jwc(t).createInstance(o4r)}a(Kwc,"createInlineCompletionsProvider");var o4r=class extends l1t.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(cwc.GhostText)}updateTreatmentVariables(e){this._expService instanceof nie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=PL.globalConfigRegistry.configs.get(`${PL.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof $v.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new t4r.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??Vwc.CancellationToken.None,o,new rwc.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};o4r=a4r([_N(0,hQi.IInstantiationService),_N(1,r3e.IExperimentationService),_N(2,e4r.ICompletionsSpeculativeRequestCache),_N(3,vN.ILogService),_N(4,PL.IConfigurationService),_N(5,$v.ICompletionsConfigProvider)],o4r);var s4r=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,$wc.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function Jwc(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new vN.ConsoleLog(void 0,vN.LogLevel.Trace),f=new pQi.InstantiationServiceBuilder;f.define(ZBe.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case ZBe.LogLevel.DEBUG:return rie.Debug;case ZBe.LogLevel.INFO:return rie.Info;case ZBe.LogLevel.WARN:return rie.Warning;case ZBe.LogLevel.ERROR:return rie.Error;default:return rie.Info}}}),f.define(c4r.IAuthenticationService,r),f.define(vN.ILogService,new gi.SyncDescriptor(vN.LogServiceImpl,[[d||new vN.ConsoleLog(void 0,vN.LogLevel.Trace)]])),f.define(e3e.IIgnoreService,t.ignoreService||new e3e.NullIgnoreService),f.define(fQi.ITelemetryService,new gi.SyncDescriptor(c1t,[new s4r(c)])),f.define(PL.IConfigurationService,new gi.SyncDescriptor(s1t,[t.configOverrides??new Map])),f.define(r3e.IExperimentationService,new gi.SyncDescriptor(nie,[t.waitForTreatmentVariables])),f.define(u4r.IEndpointProvider,t.endpointProvider),f.define(l4r.ICAPIClientService,t.capiClientService||new gi.SyncDescriptor(oQi.CAPIClientImpl)),f.define(f4r.IFetcherService,new gi.SyncDescriptor(a1t,[e])),f.define(I7i.ICompletionsTelemetryService,new gi.SyncDescriptor(I7i.CompletionsTelemetryServiceBridge)),f.define(W7i.ICompletionsRuntimeModeService,W7i.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(N7i.ICompletionsCacheService,new N7i.CompletionsCache);let h=new $v.InMemoryConfigProvider(new $v.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define($v.ICompletionsConfigProvider,h),f.define(L7i.ICompletionsLastGhostText,new L7i.LastGhostText),f.define(O7i.ICompletionsCurrentGhostText,new O7i.CurrentGhostText),f.define(e4r.ICompletionsSpeculativeRequestCache,new e4r.SpeculativeRequestCache),f.define(dwc.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define($v.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(x7i.ICompletionsExtensionStatus,new x7i.CopilotExtensionStatus),f.define(swc.ICompletionsFeaturesService,new gi.SyncDescriptor(owc.Features)),f.define(iwc.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(U7i.ICompletionsStatusReporter,new class extends U7i.StatusReporter{didChange(m){n.didChange(m)}}),f.define(w7i.ICompletionsCopilotTokenManager,new gi.SyncDescriptor(w7i.CopilotTokenManagerImpl,[!1])),f.define($7i.ICompletionsTextDocumentManagerService,new gi.SyncDescriptor(class extends $7i.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(P7i.ICompletionsFileReaderService,new gi.SyncDescriptor(P7i.FileReader)),f.define(M7i.ICompletionsBlockModeConfig,new gi.SyncDescriptor(M7i.ConfigBlockModeConfig)),f.define(G7i.ICompletionsTelemetryUserConfigService,new gi.SyncDescriptor(G7i.TelemetryUserConfig)),f.define(H7i.ICompletionsRecentEditsProviderService,new gi.SyncDescriptor(H7i.FullRecentEditsProvider,[void 0])),f.define(R7i.ICompletionsNotifierService,new gi.SyncDescriptor(R7i.CompletionNotifier)),f.define(B7i.ICompletionsOpenAIFetcherService,new gi.SyncDescriptor(B7i.LiveOpenAIFetcher)),f.define(Fwc.ICompletionsFetchService,new gi.SyncDescriptor(Uwc.CompletionsFetchService)),f.define(F7i.ICompletionsModelManagerService,new gi.SyncDescriptor(F7i.AvailableModelsManager,[!0])),f.define(D7i.ICompletionsAsyncManagerService,new gi.SyncDescriptor(D7i.AsyncCompletionManager)),f.define(q7i.ICompletionsContextProviderBridgeService,new gi.SyncDescriptor(q7i.ContextProviderBridge)),f.define(k7i.ICompletionsUserErrorNotifierService,new gi.SyncDescriptor(k7i.UserErrorNotifier)),f.define(pwc.ICompletionsRelatedFilesProviderService,new gi.SyncDescriptor(fwc.CompositeRelatedFilesProvider)),f.define(awc.ICompletionsFileSystemService,new lwc.LocalFileSystem),f.define(XBe.ICompletionsContextProviderRegistryService,new gi.SyncDescriptor(XBe.CachedContextProviderRegistry,[XBe.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(V7i.ICompletionsPromiseQueueService,new V7i.PromiseQueue),f.define(nwc.ICompletionsCitationManager,new class{register(){return l1t.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(j7i.ICompletionsContextProviderService,new j7i.ContextProviderStatistics),f.define(Q7i.ICompletionsPromptFactoryService,new gi.SyncDescriptor(Q7i.CompletionsPromptFactory)),f.define(uwc.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(XBe.ICompletionsDefaultContextProviders,new XBe.DefaultContextProvidersContainer),f.define(tie.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=t3e.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?tie.OperatingSystem.Macintosh:process.platform==="win32"?tie.OperatingSystem.Windows:tie.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return $v.BuildInfo.isProduction()}isPreRelease(){return $v.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return $v.BuildInfo.getBuildType()===$v.BuildType.DEV?"dev":"prod"}getVersion(){return $v.BuildInfo.getVersion()}getBuild(){return $v.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new tie.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new tie.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(d4r.ILanguageContextProviderService,t.languageContextProvider??new aQi.NullLanguageContextProviderService),f.define(cQi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(lQi.TestLanguageDiagnosticsService)),f.define(uQi.IRequestLogger,new gi.SyncDescriptor(dQi.NullRequestLogger)),f.seal()}a(Jwc,"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 xe(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 C1=ve(()=>{p();a(qt,"__classPrivateFieldSet");a(xe,"__classPrivateFieldGet")});var vEe,D1t=ve(()=>{p();vEe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return vEe=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 v9(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var u3e,CEe=ve(()=>{p();a(v9,"isAbortError");u3e=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 fr,Ch,Ty,TV,bEe,SEe,TEe,IEe,xEe,wEe,REe,kEe,PEe,Bf=ve(()=>{p();CEe();fr=class extends Error{static{a(this,"AnthropicError")}},Ch=class t extends fr{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 TV({message:n,cause:u3e(r)});let s=r,c=s?.error?.type;return e===400?new SEe(e,s,n,o,c):e===401?new TEe(e,s,n,o,c):e===403?new IEe(e,s,n,o,c):e===404?new xEe(e,s,n,o,c):e===409?new wEe(e,s,n,o,c):e===422?new REe(e,s,n,o,c):e===429?new kEe(e,s,n,o,c):e>=500?new PEe(e,s,n,o,c):new t(e,s,n,o,c)}},Ty=class extends Ch{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},TV=class extends Ch{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},bEe=class extends TV{static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},SEe=class extends Ch{static{a(this,"BadRequestError")}},TEe=class extends Ch{static{a(this,"AuthenticationError")}},IEe=class extends Ch{static{a(this,"PermissionDeniedError")}},xEe=class extends Ch{static{a(this,"NotFoundError")}},wEe=class extends Ch{static{a(this,"ConflictError")}},REe=class extends Ch{static{a(this,"UnprocessableEntityError")}},kEe=class extends Ch{static{a(this,"RateLimitError")}},PEe=class extends Ch{static{a(this,"InternalServerError")}}});function N1t(t){return typeof t!="object"?{}:t??{}}function X4r(t){if(!t)return!0;for(let e in t)return!1;return!0}function zqi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var WPc,Wqi,t_,Z4r,Yqi,M1t,NL=ve(()=>{p();Bf();WPc=/^[a-z][a-z0-9+.-]*:/i,Wqi=a(t=>WPc.test(t),"isAbsoluteURL"),t_=a(t=>(t_=Array.isArray,t_(t)),"isArray"),Z4r=t_;a(N1t,"maybeObj");a(X4r,"isEmptyObj");a(zqi,"hasOwn");Yqi=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new fr(`${t} must be an integer`);if(e<0)throw new fr(`${t} must be a positive integer`);return e},"validatePositiveInteger"),M1t=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var TN,DEe=ve(()=>{p();TN=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 ek,d3e=ve(()=>{p();ek="0.98.0"});function zPc(){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 KPc(){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 Xqi,YPc,Kqi,Jqi,Zqi,f3e,O1t=ve(()=>{p();d3e();Xqi=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(zPc,"getDetectedPlatform");YPc=a(()=>{let t=zPc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ek,"X-Stainless-OS":Jqi(Deno.build.os),"X-Stainless-Arch":Kqi(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":ek,"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":ek,"X-Stainless-OS":Jqi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Kqi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=KPc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ek,"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":ek,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(KPc,"getBrowserInfo");Kqi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),Jqi=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"),f3e=a(()=>Zqi??(Zqi=YPc()),"getPlatformHeaders")});function eji(){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 eLr(...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 L1t(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return eLr({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function p3e(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 tji(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 NEe=ve(()=>{p();a(eji,"getDefaultFetch");a(eLr,"makeReadableStream");a(L1t,"ReadableStreamFrom");a(p3e,"ReadableStreamToAsyncIterable");a(tji,"CancelReadableStream")});var rji,nji=ve(()=>{p();rji=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var tLr,rLr,nLr,iji,iLr=ve(()=>{p();tLr="RFC3986",rLr=a(t=>String(t),"default_formatter"),nLr={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:rLr},iji="RFC1738"});function sji(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function sLr(t,e){if(t_(t)){let r=[];for(let n=0;n{p();iLr();NL();B1t=a((t,e)=>(B1t=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),B1t(t,e)),"has"),ML=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),oLr=1024,oji=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=oLr?s.slice(l,l+oLr):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===iji&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=ML[h];continue}if(h<2048){d[d.length]=ML[192|h>>6]+ML[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=ML[224|h>>12]+ML[128|h>>6&63]+ML[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=ML[240|h>>18]+ML[128|h>>12&63]+ML[128|h>>6&63]+ML[128|h&63]}c+=d.join("")}return c},"encode");a(sji,"is_buffer");a(sLr,"maybe_map")});function XPc(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function dji(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=t,b=_,T=0,w=!1;for(;(b=b.get(aLr))!==void 0&&!w;){let N=b.get(t);if(T+=1,typeof N<"u"){if(N===T)throw new RangeError("Cyclic object value");w=!0}typeof b.get(aLr)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&t_(v)&&(v=sLr(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,L0.encoder,E,"key",g):e;v=""}if(XPc(v)||sji(v)){if(u){let N=y?e:u(e,L0.encoder,E,"key",g);return[A?.(N)+"="+A?.(u(v,L0.encoder,E,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&t_(v))y&&u&&(v=sLr(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(t_(d))x=d;else{let N=Object.keys(v);x=f?N.sort(f):N}let P=l?String(e).replace(/\./g,"%2E"):String(e),D=n&&t_(v)&&v.length===1?P+"[]":P;if(o&&t_(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:L0.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:L0.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:L0.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:L0.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?L0.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:L0.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:L0.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:L0.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:L0.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:L0.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:L0.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:L0.strictNullHandling}}function fji(t,e={}){let r=t,n=e2c(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):t_(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=lji[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 lji,uji,cji,L0,aLr,pji=ve(()=>{p();aji();iLr();NL();lji={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},uji=a(function(t,e){Array.prototype.push.apply(t,t_(e)?e:[e])},"push_to_array"),L0={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:oji,encodeValuesOnly:!1,format:tLr,formatter:rLr,indices:!1,serializeDate(t){return(cji??(cji=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(XPc,"is_non_nullish_primitive");aLr={};a(dji,"inner_stringify");a(e2c,"normalize_stringify_options");a(fji,"stringify")});function hji(t){return fji(t,{arrayFormat:"brackets"})}var cLr=ve(()=>{p();pji();a(hji,"stringifyQuery")});function U1t(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new Wc(`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 Wc(`Refusing to send credential over non-https token endpoint "${t}"`)}async function Q1t(t,e){let r=await n2c(t),n;try{n=JSON.parse(r)}catch{throw new Wc(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,b1(r),e)}if(!n.access_token)throw new Wc(`Token endpoint response missing access_token: ${JSON.stringify(b1(n))}`,t.status,b1(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Wc(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,b1(n),e);return n}function b1(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=lLr?t:t.slice(0,lLr)+`... <${t.length-lLr} more chars>`}return JSON.stringify(b1(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))r2c.has(r)&&(e[r]=n);return e}return null}async function q1t(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 Wc(`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 Wc(`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 j1t(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 n2c(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>mji){let l=mji-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 gji,Aji,F1t,lie,yji,Eji,MEe,_ji,mji,lLr,r2c,Wc,OEe=ve(()=>{p();Bf();gji="urn:ietf:params:oauth:grant-type:jwt-bearer",Aji="refresh_token",F1t="/v1/oauth/token",lie="oauth-2025-04-20",yji="oidc-federation-2026-04-01",Eji=120,MEe=30,_ji=5,mji=1<<20;a(U1t,"requireSecureTokenEndpoint");a(Q1t,"parseTokenResponse");lLr=2e3,r2c=new Set(["error","error_description","error_uri"]);a(b1,"redactSensitive");a(q1t,"checkCredentialsFileSafety");a(j1t,"writeCredentialsFileAtomic");a(n2c,"readLimitedText");Wc=class extends fr{static{a(this,"WorkloadIdentityError")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}}});function IN(){return Math.floor(Date.now()/1e3)}var h3e=ve(()=>{p();a(IN,"nowAsSeconds")});var H1t,vji=ve(()=>{p();OEe();h3e();H1t=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-IN();return n>Eji?r.token:n>MEe?(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||IN()-this.lastAdvisoryError<_ji||this.doRefresh().catch(e=>{this.lastAdvisoryError=IN(),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 _a,m3e=ve(()=>{p();_a=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 Sji(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 LEe(t){let e;return(Cji??(e=new globalThis.TextEncoder,Cji=e.encode.bind(e)))(t)}function uLr(t){let e;return(bji??(e=new globalThis.TextDecoder,bji=e.decode.bind(e)))(t)}var Cji,bji,G1t=ve(()=>{p();a(Sji,"concatBytes");a(LEe,"encodeUTF8");a(uLr,"decodeUTF8")});var Tji=ve(()=>{p();Bf();G1t()});function g3e(){}function $1t(t,e,r){return!e||V1t[t]>V1t[r]?g3e:e[t].bind(e)}function gl(t){let e=t.logger,r=t.logLevel??"off";if(!e)return i2c;let n=Iji.get(e);if(n&&n[0]===r)return n[1];let o={error:$1t("error",e,r),warn:$1t("warn",e,r),info:$1t("info",e,r),debug:$1t("debug",e,r)};return Iji.set(e,[r,o]),o}var V1t,dLr,i2c,Iji,C9,b9=ve(()=>{p();NL();V1t={off:0,error:200,warn:300,info:400,debug:500},dLr=a((t,e,r)=>{if(t){if(zqi(V1t,t))return t;gl(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(V1t))}`)}},"parseLogLevel");a(g3e,"noop");a($1t,"makeLogFn");i2c={error:g3e,warn:g3e,info:g3e,debug:g3e},Iji=new WeakMap;a(gl,"loggerFor");C9=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 fLr=ve(()=>{p();NL();Tji();m3e();b9();D1t();DEe();cLr()});function xji(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(!o2c.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var W1t,o2c,wji,Rji,pLr,s2c,kji,hLr=ve(()=>{p();O1t();fLr();W1t="1.0",o2c=/^[A-Za-z0-9_.-]+$/;a(xji,"validateProfileName");wji=a(async t=>{var e,r;let n=await pLr();if(n===null)return null;let o=t??await kji();if(o===null)return null;xji(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=_a("ANTHROPIC_ORGANIZATION_ID"),m=_a("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=_a("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:_a("ANTHROPIC_WORKSPACE_ID"),base_url:_a("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:_a("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:_a("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=_a("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=_a("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=_a("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=_a("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=_a("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=_a("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=_a("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),Rji=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await pLr();if(!r)return null;let n=e??await kji();return n?(xji(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),pLr=a(async()=>{if(!s2c())return null;let t=await import("node:path"),e=_a("ANTHROPIC_CONFIG_DIR");if(e)return e;if(f3e()["X-Stainless-OS"]==="Windows"){let s=_a("APPDATA");if(s)return t.join(s,"Anthropic");let c=_a("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=_a("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=_a("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),s2c=a(()=>{let t=f3e()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),kji=a(async()=>{let t=await pLr();if(!t)return null;let e=_a("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 mLr(t){if(!t)throw new fr("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 fr(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new fr(`Identity token file at ${t} is empty`);return n}}function Pji(t){if(!t)throw new fr("Identity token value is empty");return()=>t}var Dji=ve(()=>{p();Bf();a(mLr,"identityTokenFromFile");a(Pji,"identityTokenFromValue")});function Nji(t){return async()=>{U1t(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new Wc(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:gji,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}${F1t}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${lie},${yji}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${ek} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new Wc(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=b1(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 Wc(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await Q1t(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new Wc(`Token endpoint response missing required fields: ${JSON.stringify(b1(c))}`,o.status,b1(c),s);return{token:c.access_token,expiresAt:IN()+l}}}var Mji=ve(()=>{p();OEe();h3e();d3e();a(Nji,"oidcFederationProvider")});function Oji(t){return async e=>{let r=await import("node:fs");await q1t(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new Wc(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new Wc(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new Wc(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||IN()"");throw new Wc(`User OAuth refresh failed (HTTP ${f.status}): ${b1(E)}`,f.status,b1(E),h)}let m=await Q1t(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Wc(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(b1(m))}`,f.status,b1(m),h);let A=IN()+g,y=m.refresh_token||l;return await j1t(t.credentialsPath,{...o,version:W1t,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var Lji=ve(()=>{p();hLr();OEe();h3e();d3e();a(Oji,"userOAuthProvider")});function gLr(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=a2c(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 Bji(t,e){let r=await wji(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 Rji(n,e)??void 0}};return gLr(s,t)}function a2c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=c2c(o);if(!s)throw new Wc("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 Wc("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 Wc("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=Nji({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?l2c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new Wc("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return Oji({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 Wc(`authentication.type "${o}" is not a known authentication type`)}}}function c2c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Wc(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Wc('identity_token.source "file" requires a non-empty path');return mLr(t.identity_token.path)}let e=_a("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return mLr(e);let r=_a("ANTHROPIC_IDENTITY_TOKEN");return r?Pji(r):null}function l2c(t,e,r,n){return async o=>{let s=await import("node:fs");await q1t(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||IN(){p();m3e();hLr();OEe();h3e();Dji();Mji();Lji();a(gLr,"resolveCredentialsFromConfig");a(Bji,"defaultCredentials");a(a2c,"buildProvider");a(c2c,"resolveIdentityTokenProvider");a(l2c,"cachedExchangeProvider")});function u2c(t,e){for(let o=e??0;o{p();C1();G1t();S9=class{static{a(this,"LineDecoder")}constructor(){yI.set(this,void 0),EI.set(this,void 0),qt(this,yI,new Uint8Array,"f"),qt(this,EI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?LEe(e):e;qt(this,yI,Sji([xe(this,yI,"f"),r]),"f");let n=[],o;for(;(o=u2c(xe(this,yI,"f"),xe(this,EI,"f")))!=null;){if(o.carriage&&xe(this,EI,"f")==null){qt(this,EI,o.index,"f");continue}if(xe(this,EI,"f")!=null&&(o.index!==xe(this,EI,"f")+1||o.carriage)){n.push(uLr(xe(this,yI,"f").subarray(0,xe(this,EI,"f")-1))),qt(this,yI,xe(this,yI,"f").subarray(xe(this,EI,"f")),"f"),qt(this,EI,null,"f");continue}let s=xe(this,EI,"f")!==null?o.preceding-1:o.preceding,c=uLr(xe(this,yI,"f").subarray(0,s));n.push(c),qt(this,yI,xe(this,yI,"f").subarray(o.index),"f"),qt(this,EI,null,"f")}return n}flush(){return xe(this,yI,"f").length?this.decode(` -`):[]}};yI=new WeakMap,EI=new WeakMap;S9.NEWLINE_CHARS=new Set([` -`,"\r"]);S9.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(u2c,"findNewlineIndex");a(Uji,"findDoubleNewlineIndex")});async function*d2c(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new fr("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 fr("Attempted to iterate over a response with no body");let r=new yLr,n=new S9,o=p3e(t.body);for await(let s of f2c(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*f2c(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"?LEe(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=Uji(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function p2c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var A3e,OL,yLr,ELr=ve(()=>{p();C1();Bf();NEe();ALr();NEe();CEe();NL();G1t();b9();Bf();OL=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,A3e.set(this,void 0),this.controller=r,qt(this,A3e,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?gl(n):console;async function*c(){if(o)throw new fr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of d2c(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=M1t(u.data)??u.data,f=d?.error?.type;throw new Ch(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(v9(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 S9,u=p3e(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 fr("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(v9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(A3e=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,xe(this,A3e,"f")),new t(()=>o(r),this.controller,xe(this,A3e,"f"))]}toReadableStream(){let e=this,r;return eLr({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=LEe(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(d2c,"_iterSSEMessages");a(f2c,"iterSSEChunks");yLr=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]=p2c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(p2c,"partition")});async function z1t(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return gl(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):OL.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 _Lr(m,r)}return await r.text()})();return gl(t).debug(`[${n}] response parsed`,C9({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function _Lr(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 vLr=ve(()=>{p();ELr();b9();a(z1t,"defaultParseResponse");a(_Lr,"addRequestID")});var y3e,uie,Y1t=ve(()=>{p();C1();vLr();uie=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=z1t){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,y3e.set(this,void 0),qt(this,y3e,e,"f")}_thenUnwrap(e){return new t(xe(this,y3e,"f"),this.responsePromise,async(r,n)=>_Lr(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(xe(this,y3e,"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)}};y3e=new WeakMap});var K1t,J1t,E3e,tk,va,_d=ve(()=>{p();C1();Bf();vLr();Y1t();NL();J1t=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){K1t.set(this,void 0),qt(this,K1t,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 fr("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await xe(this,K1t,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(K1t=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},E3e=class extends uie{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await z1t(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},tk=class extends J1t{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:{...N1t(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...N1t(this.options.query),after_id:e}}:null}},va=class extends J1t{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:{...N1t(this.options.query),page:e}}:null}}});function die(t,e,r){return bLr(),new File(t,e??"unknown_file",r)}function _3e(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 m2c(t){let e=typeof t=="function"?t:t.fetch,r=Qji.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 Qji.set(e,n),n}var bLr,SLr,BEe,Qji,g2c,A2c,CLr,FEe=ve(()=>{p();NEe();bLr=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(die,"makeFile");a(_3e,"getName");SLr=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),BEe=a(async(t,e,r=!0)=>({...t,body:await g2c(t.body,e,r)}),"multipartFormRequestOptions"),Qji=new WeakMap;a(m2c,"supportsFormData");g2c=a(async(t,e,r=!0)=>{if(!await m2c(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])=>CLr(n,o,s,r))),n},"createForm"),A2c=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),CLr=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,die([await r.blob()],_3e(r,n),o))}else if(SLr(r))t.append(e,die([await new Response(L1t(r)).blob()],_3e(r,n)));else if(A2c(r))t.append(e,die([r],_3e(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>CLr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>CLr(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 Z1t(t,e,r){if(bLr(),t=await t,e||(e=_3e(t,!0)),y2c(t))return t instanceof File&&e==null&&r==null?t:die([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(E2c(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),die(await TLr(o),e,r)}let n=await TLr(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 die(n,e,r)}async function TLr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(qji(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(SLr(t))for await(let r of t)e.push(...await TLr(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${_2c(t)}`)}return e}function _2c(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var qji,y2c,E2c,jji=ve(()=>{p();FEe();FEe();qji=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"),y2c=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&qji(t),"isFileLike"),E2c=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(Z1t,"toFile");a(TLr,"getBytes");a(_2c,"propsForError")});var ILr=ve(()=>{p();jji()});var Hji=ve(()=>{p()});var Ai,Ul=ve(()=>{p();Ai=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*C2c(t){if(!t)return;if(Gji 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():Z4r(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=Z4r(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 Gji,vt,vc=ve(()=>{p();NL();Gji=Symbol.for("brand.privateNullableHeaders");a(C2c,"iterateHeaders");vt=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of C2c(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{[Gji]:!0,values:e,nulls:r}},"buildHeaders")});function X1t(t){return typeof t=="object"&&t!==null&&v3e in t}function xLr(t,e){let r=new Set;if(t)for(let n of t)X1t(n)&&r.add(n[v3e]);if(e){for(let n of e)if(X1t(n)&&r.add(n[v3e]),Array.isArray(n.content))for(let o of n.content)X1t(o)&&r.add(o[v3e])}return Array.from(r)}function eSt(t,e){let r=xLr(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function $ji(t){return X1t(t)?{"x-stainless-helper":t[v3e]}:{}}var v3e,C3e=ve(()=>{p();v3e=Symbol("anthropic.sdk.stainlessHelper");a(X1t,"wasCreatedByStainlessHelper");a(xLr,"collectStainlessHelpers");a(eSt,"stainlessHelperHeader");a($ji,"stainlessHelperHeaderFromFile")});function Wji(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Vji,b2c,or,Ff=ve(()=>{p();Bf();a(Wji,"encodeURIPath");Vji=Object.freeze(Object.create(null)),b2c=a((t=Wji)=>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??Vji)??Vji)?.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 fr(`Path parameters result in path with invalid segments: + `,u=[],d=null,f=!0;for(;f;){let m=await nEe(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($Tc,"getAssignableActorsWithAssignableUsers")});var IUi=I(ek=>{"use strict";p();Object.defineProperty(ek,"__esModule",{value:!0});ek.BaseOctoKitService=ek.PermissiveAuthRequiredError=ek.VSCodeTeamId=ek.IOctoKitService=ek.IGithubRepositoryService=void 0;var TUi=nn(),SUi=t$(),gN=bUi();ek.IGithubRepositoryService=(0,TUi.createServiceIdentifier)("IGithubRepositoryService");ek.IOctoKitService=(0,TUi.createServiceIdentifier)("IOctoKitService");ek.VSCodeTeamId=1682102;var d5r=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};ek.PermissiveAuthRequiredError=d5r;var f5r=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,gN.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,gN.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,gN.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,gN.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,gN.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,gN.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,gN.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,SUi.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(xbt,"__esModule",{value:!0});xbt.NullBaseOctoKitService=void 0;var VTc=IUi(),p5r=class extends VTc.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){}};xbt.NullBaseOctoKitService=p5r});var PUi=I(Ll=>{"use strict";p();var Mbt=Ll&&Ll.__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},Ou=Ll&&Ll.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Ll,"__esModule",{value:!0});Ll.CopilotTokenManagerFromGitHubToken=Ll.CopilotTokenManagerFromDeviceId=Ll.RefreshableCopilotTokenManager=Ll.StaticExtendedTokenInfoCopilotTokenManager=Ll.FixedCopilotTokenManager=Ll.BaseCopilotTokenManager=Ll.tokenErrorString=void 0;Ll.createStaticGitHubTokenProvider=zTc;Ll.getOrCreateTestingCopilotTokenManager=YTc;var h5r=(Sne(),Ca(bne)),WTc=Ic(),wUi=ko(),wbt=Gft(),kUi=Pl(),Obt=$E(),Lbt=Z$(),oEe=U4(),Bbt=xUi(),Fbt=Sp(),$Be=_y(),Ubt=gm(),RUi=Iye(),a9=mgt(),Rbt=v5e();Ll.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 zTc(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(oEe.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Ll.tokenErrorString)}}a(zTc,"createStaticGitHubTokenProvider");function YTc(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new wbt.SyncDescriptor(Pbt,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new wbt.SyncDescriptor(Nbt,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new wbt.SyncDescriptor(kbt,[process.env.GITHUB_PAT]);if(oEe.isScenarioAutomation)return new wbt.SyncDescriptor(Dbt,[t]);throw new Error(Ll.tokenErrorString)}a(YTc,"getOrCreateTestingCopilotTokenManager");var iEe=class extends wUi.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 WTc.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,wUi.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=RUi.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,Rbt.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,a9.containsVSCodeOrg)(s.organization_list??[])},d=RUi.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,Rbt.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:h5r.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:h5r.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,$Be.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,a9.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,a9.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,a9.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:h5r.RequestType.CopilotUserInfo})).json()}};Ll.BaseCopilotTokenManager=iEe;var kbt=class extends iEe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new Bbt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,a9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,a9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new a9.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Ll.FixedCopilotTokenManager=kbt;Ll.FixedCopilotTokenManager=kbt=Mbt([Ou(1,Fbt.ILogService),Ou(2,Ubt.ITelemetryService),Ou(3,Obt.ICAPIClientService),Ou(4,Lbt.IDomainService),Ou(5,$Be.IFetcherService),Ou(6,oEe.IEnvService)],kbt);var Pbt=class extends iEe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new Bbt.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 a9.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Ll.StaticExtendedTokenInfoCopilotTokenManager=Pbt;Ll.StaticExtendedTokenInfoCopilotTokenManager=Pbt=Mbt([Ou(1,Fbt.ILogService),Ou(2,Ubt.ITelemetryService),Ou(3,Obt.ICAPIClientService),Ou(4,Lbt.IDomainService),Ou(5,$Be.IFetcherService),Ou(6,oEe.IEnvService)],Pbt);var GBe=class extends iEe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,Rbt.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 a9.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,Rbt.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Ll.RefreshableCopilotTokenManager=GBe;var Dbt=class extends GBe{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new Bbt.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Ll.CopilotTokenManagerFromDeviceId=Dbt;Ll.CopilotTokenManagerFromDeviceId=Dbt=Mbt([Ou(1,Fbt.ILogService),Ou(2,Ubt.ITelemetryService),Ou(3,Lbt.IDomainService),Ou(4,Obt.ICAPIClientService),Ou(5,$Be.IFetcherService),Ou(6,oEe.IEnvService),Ou(7,kUi.IConfigurationService)],Dbt);var Nbt=class extends GBe{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new Bbt.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)}};Ll.CopilotTokenManagerFromGitHubToken=Nbt;Ll.CopilotTokenManagerFromGitHubToken=Nbt=Mbt([Ou(2,Fbt.ILogService),Ou(3,Ubt.ITelemetryService),Ou(4,Lbt.IDomainService),Ou(5,Obt.ICAPIClientService),Ou(6,$Be.IFetcherService),Ou(7,oEe.IEnvService),Ou(8,kUi.IConfigurationService)],Nbt)});var DUi=I(c9=>{"use strict";p();var KTc=c9&&c9.__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},m5r=c9&&c9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(c9,"__esModule",{value:!0});c9.ChatQuotaService=void 0;var JTc=(Sne(),Ca(bne)),ZTc=Ic(),XTc=ko(),eIc=FE(),tIc=$E(),rIc=Sp(),g5r=class extends XTc.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 ZTc.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:JTc.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()}};c9.ChatQuotaService=g5r;c9.ChatQuotaService=g5r=KTc([m5r(0,eIc.IAuthenticationService),m5r(1,rIc.ILogService),m5r(2,tIc.ICAPIClientService)],g5r)});var MUi=I(Qbt=>{"use strict";p();Object.defineProperty(Qbt,"__esModule",{value:!0});Qbt.DefaultsOnlyConfigurationService=void 0;var NUi=Pl(),A5r=class extends NUi.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=NUi.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};Qbt.DefaultsOnlyConfigurationService=A5r});var LUi=I(qbt=>{"use strict";p();Object.defineProperty(qbt,"__esModule",{value:!0});qbt.computeDiff=iIc;qbt.computeDiffSync=OUi;var nIc=cDr();async function iIc(t,e,r){return OUi(t,e,r)}a(iIc,"computeDiff");function OUi(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new nIc.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(OUi,"computeDiffSync")});var QUi=I(AN=>{"use strict";p();var oIc=AN&&AN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sIc=AN&&AN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),UUi=AN&&AN.__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=fIc([BUi.join(__dirname,"diffWorker.js"),BUi.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new aIc.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 dIc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:_5r(o.changes),moves:o.moves.map(c=>new uIc.MovedText(new y5r.LineRangeMapping(new jbt.LineRange(c[0],c[1]),new jbt.LineRange(c[2],c[3])),_5r(c[4])))}}};AN.DiffServiceImpl=E5r;function _5r(t){return t.map(e=>new y5r.DetailedLineRangeMapping(new jbt.LineRange(e[0],e[1]),new jbt.LineRange(e[2],e[3]),e[4]?.map(r=>new y5r.RangeMapping(new FUi.Range(r[0],r[1],r[2],r[3]),new FUi.Range(r[4],r[5],r[6],r[7])))))}a(_5r,"toLineRangeMappings");function fIc(t){for(let e of t)if((0,lIc.existsSync)(e))return e}a(fIc,"firstExistingPath")});var jUi=I(l9=>{"use strict";p();var pIc=l9&&l9.__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},qUi=l9&&l9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(l9,"__esModule",{value:!0});l9.CAPIClientImpl=void 0;var hIc=U4(),mIc=_y(),gIc=$E(),v5r=class extends gIc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};l9.CAPIClientImpl=v5r;l9.CAPIClientImpl=v5r=pIc([qUi(0,mIc.IFetcherService),qUi(1,hIc.IEnvService)],v5r)});var GUi=I(u9=>{"use strict";p();var AIc=u9&&u9.__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},C5r=u9&&u9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(u9,"__esModule",{value:!0});u9.DomainService=void 0;var yIc=Ic(),EIc=ko(),_Ic=eG(),sEe=Pl(),vIc=$E(),HUi="github-enterprise.uri",b5r=class extends EIc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new yIc.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(`${sEe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(HUi))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(sEe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(sEe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(sEe.ConfigKey.Shared.AuthProvider)===sEe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(HUi):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)}};u9.DomainService=b5r;u9.DomainService=b5r=AIc([C5r(0,sEe.IConfigurationService),C5r(1,_Ic.ICopilotTokenStore),C5r(2,vIc.ICAPIClientService)],b5r)});var $Ui=I(aEe=>{"use strict";p();Object.defineProperty(aEe,"__esModule",{value:!0});aEe.NullNativeEnvService=aEe.NullEnvService=void 0;var CIc=Ic(),bIc=nd(),Hbt=U4(),SIc=u5e(),Gbt=class t extends Hbt.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 CIc.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 Hbt.OperatingSystem.Linux}getEditorInfo(){return new Hbt.NameAndVersion("simulation-tests-editor",SIc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new Hbt.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};aEe.NullEnvService=Gbt;var S5r=class extends Gbt{static{a(this,"NullNativeEnvService")}get userHome(){return bIc.URI.file("/home/testuser")}};aEe.NullNativeEnvService=S5r});var T5r=I($bt=>{"use strict";p();Object.defineProperty($bt,"__esModule",{value:!0});$bt.IGitExtensionService=void 0;var TIc=nn();$bt.IGitExtensionService=(0,TIc.createServiceIdentifier)("IGitExtensionService")});var VUi=I(Vbt=>{"use strict";p();Object.defineProperty(Vbt,"__esModule",{value:!0});Vbt.NullGitExtensionService=void 0;var IIc=Ic(),I5r=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=IIc.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};Vbt.NullGitExtensionService=I5r});var WUi=I(d9=>{"use strict";p();var xIc=d9&&d9.__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},wIc=d9&&d9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(d9,"__esModule",{value:!0});d9.ObservableGit=void 0;var RIc=ko(),_V=z2(),kIc=T5r(),x5r=class extends RIc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,_V.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,_V.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,_V.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,_V.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,_V.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,_V.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,_V.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,_V.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};d9.ObservableGit=x5r;d9.ObservableGit=x5r=xIc([wIc(0,kIc.IGitExtensionService)],x5r)});var zbt=I(Bl=>{"use strict";p();Object.defineProperty(Bl,"__esModule",{value:!0});Bl.lengthZero=void 0;Bl.lengthDiff=NIc;Bl.lengthIsZero=MIc;Bl.toLength=Xne;Bl.lengthToObj=OIc;Bl.lengthGetLineCount=LIc;Bl.lengthGetColumnCountIfZeroLineCount=BIc;Bl.lengthAdd=YUi;Bl.sumLengths=FIc;Bl.lengthEquals=UIc;Bl.lengthDiffNonNegative=QIc;Bl.lengthLessThan=qIc;Bl.lengthLessThanEqual=jIc;Bl.lengthGreaterThanEqual=HIc;Bl.lengthToPosition=GIc;Bl.positionToLength=$Ic;Bl.lengthsToRange=VIc;Bl.lengthOfRange=WIc;Bl.lengthCompare=zIc;Bl.lengthOfString=YIc;Bl.lengthOfStringObj=KIc;Bl.lengthHash=JIc;Bl.lengthMax=ZIc;var zUi=em(),PIc=q_(),DIc=eh(),Wbt=Ime();function NIc(t,e,r,n){return t!==r?Xne(r-t,n):Xne(0,n-e)}a(NIc,"lengthDiff");Bl.lengthZero=0;function MIc(t){return t===0}a(MIc,"lengthIsZero");var e_=2**26;function Xne(t,e){return t*e_+e}a(Xne,"toLength");function OIc(t){let e=t,r=Math.floor(e/e_),n=e-r*e_;return new Wbt.TextLength(r,n)}a(OIc,"lengthToObj");function LIc(t){return Math.floor(t/e_)}a(LIc,"lengthGetLineCount");function BIc(t){return t}a(BIc,"lengthGetColumnCountIfZeroLineCount");function YUi(t,e){let r=t+e;return e>=e_&&(r=r-t%e_),r}a(YUi,"lengthAdd");function FIc(t,e){return t.reduce((r,n)=>YUi(r,e(n)),Bl.lengthZero)}a(FIc,"sumLengths");function UIc(t,e){return t===e}a(UIc,"lengthEquals");function QIc(t,e){let r=t,n=e;if(n-r<=0)return Bl.lengthZero;let s=Math.floor(r/e_),c=Math.floor(n/e_),l=n-c*e_;if(s===c){let u=r-s*e_;return Xne(0,l-u)}else return Xne(c-s,l)}a(QIc,"lengthDiffNonNegative");function qIc(t,e){return t=e}a(HIc,"lengthGreaterThanEqual");function GIc(t){let e=t,r=Math.floor(e/e_),n=e-r*e_;return new PIc.Position(r+1,n+1)}a(GIc,"lengthToPosition");function $Ic(t){return Xne(t.lineNumber-1,t.column-1)}a($Ic,"positionToLength");function VIc(t,e){let r=t,n=Math.floor(r/e_),o=r-n*e_,s=e,c=Math.floor(s/e_),l=s-c*e_;return new DIc.Range(n+1,o+1,c+1,l+1)}a(VIc,"lengthsToRange");function WIc(t){return t.startLineNumber===t.endLineNumber?new Wbt.TextLength(0,t.endColumn-t.startColumn):new Wbt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(WIc,"lengthOfRange");function zIc(t,e){return t-e}a(zIc,"lengthCompare");function YIc(t){let e=(0,zUi.splitLines)(t);return Xne(e.length-1,e[e.length-1].length)}a(YIc,"lengthOfString");function KIc(t){let e=(0,zUi.splitLines)(t);return new Wbt.TextLength(e.length-1,e[e.length-1].length)}a(KIc,"lengthOfStringObj");function JIc(t){return t}a(JIc,"lengthHash");function ZIc(t,e){return t>e?t:e}a(ZIc,"lengthMax")});var k5r=I(Ybt=>{"use strict";p();Object.defineProperty(Ybt,"__esModule",{value:!0});Ybt.TextEditInfo=void 0;var w5r=zbt(),R5r=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,w5r.lengthToObj)(this.startOffset)}...${(0,w5r.lengthToObj)(this.endOffset)}) -> ${(0,w5r.lengthToObj)(this.newLength)}`}};Ybt.TextEditInfo=R5r});var JUi=I(P5r=>{"use strict";p();Object.defineProperty(P5r,"__esModule",{value:!0});P5r.combineTextEditInfos=txc;var XIc=Sl(),O0=zbt(),exc=k5r();function txc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new XIc.ArrayQueue(KUi(t)),n=KUi(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,O0.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,O0.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,O0.lengthIsZero)(d)||f.push(new VBe(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,O0.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new exc.TextEditInfo(m.startOffset,f,(0,O0.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=O0.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,O0.sumLengths)(f,g=>g.lengthBefore),m=(0,O0.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,O0.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(txc,"combineTextEditInfos");var VBe=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,O0.lengthDiffNonNegative)(e,this.lengthAfter);return(0,O0.lengthEquals)(r,O0.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,O0.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,O0.lengthToObj)(this.lengthBefore)} -> ${(0,O0.lengthToObj)(this.lengthAfter)}`}};function KUi(t){let e=[],r=O0.lengthZero;for(let n of t){let o=(0,O0.lengthDiffNonNegative)(r,n.startOffset);(0,O0.lengthIsZero)(o)||e.push(new VBe(!1,o,o));let s=(0,O0.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new VBe(!0,s,n.newLength)),r=n.endOffset}return e}a(KUi,"toLengthMapping")});var XUi=I(cEe=>{"use strict";p();Object.defineProperty(cEe,"__esModule",{value:!0});cEe.SingleTextEditLength=cEe.TextLengthEdit=void 0;var rxc=eh(),ZUi=Ime(),nxc=JUi(),WBe=zbt(),ixc=k5r(),D5r=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new zBe(n.range,ZUi.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,WBe.lengthToObj)(n.newLength);return new zBe((0,WBe.lengthsToRange)(n.startOffset,n.endOffset),new ZUi.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new ixc.TextEditInfo((0,WBe.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,WBe.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,WBe.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,nxc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return rxc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};cEe.TextLengthEdit=D5r;var zBe=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};cEe.SingleTextEditLength=zBe});var e7i=I(lEe=>{"use strict";p();Object.defineProperty(lEe,"__esModule",{value:!0});lEe.DocumentHistory=lEe.HistoryContext=void 0;var oxc=rd(),sxc=oN(),N5r=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,oxc.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}}};lEe.HistoryContext=N5r;var M5r=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 sxc.RootedEdit(this.base,this.lastEdits.compose())}};lEe.DocumentHistory=M5r});var s7i=I(uEe=>{"use strict";p();Object.defineProperty(uEe,"__esModule",{value:!0});uEe.NesHistoryContextProvider=void 0;uEe.sum=KBe;uEe.editExtends=o7i;var t7i=ko(),r7i=z2(),axc=ZS(),YBe=kE(),cxc=g5e(),lxc=HT(),Kbt=oN(),uxc=B_t(),n7i=XUi(),dxc=h4(),JBe=bMe(),i7i=e7i(),O5r=class extends t7i.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new B5r(50),this._register((0,r7i.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,JBe.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,r7i.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new L5r(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,dxc.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,t7i.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 i7i.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,JBe.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};uEe.NesHistoryContextProvider=O5r;var L5r=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 lxc.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=cxc.TextEdit.fromStringEdit(e,this._currentValue),o=n7i.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return KBe(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&o7i(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,JBe.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,JBe.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new Kbt.Edits(YBe.StringEdit,this._edits.map(o=>o.edit));return{history:new i7i.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=YBe.StringEdit.empty,o=n7i.TextLengthEdit.empty,s,c=0,l=YBe.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,JBe.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,axc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=KBe(u.textLengthEdit.edits,b=>b.range.endLineNumber-b.range.startLineNumber+b.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||KBe(u.edit.replacements,b=>b.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||KBe(u.edit.replacements,b=>b.replaceRange.length)>t.MAX_EDITED_CHARS_PER_EDIT)break;if(s===this._edits.length-1)l=u.edit;else{let b=YBe.StringEdit.trySwap(u.edit,l);if(b)l=b.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),E=Kbt.RootedEdit.toLineEdit(new Kbt.RootedEdit(r,y)),v=new uxc.RootedLineEdit(r,E).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 Kbt.Edits(YBe.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function KBe(t,e){let r=0;for(let n of t)r+=e(n);return r}a(KBe,"sum");function o7i(t,e){let r=e.getNewRanges();return t.replacements.every(n=>fxc(n.replaceRange,r))}a(o7i,"editExtends");function fxc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(fxc,"doesTouch");var B5r=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 l7i=I(yN=>{"use strict";p();var pxc=yN&&yN.__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},a7i=yN&&yN.__param||function(t,e){return function(r,n){e(r,n,t)}},U5r;Object.defineProperty(yN,"__esModule",{value:!0});yN.NesXtabHistoryTracker=yN.XtabEditMergeStrategy=void 0;var Q5r=rd(),hxc=ko(),mxc=vue(),gxc=z2(),Axc=b8(),Zbt=Pl(),yxc=mh(),Jbt=oN(),f9=Qvr(),Exc=h4(),F5r=bMe(),q5r;(function(t){t.sameStartLine={kind:f9.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:f9.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:f9.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case f9.DiffHistoryMergeStrategy.Proximity:return e(s);case f9.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case f9.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,Q5r.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(q5r||(yN.XtabEditMergeStrategy=q5r={}));function c7i(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(c7i,"areLineEditsWithinProximity");var j5r=class extends hxc.Disposable{static{a(this,"NesXtabHistoryTracker")}static{U5r=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 mxc.LinkedList,this.maxHistorySize=r??U5r.MAX_HISTORY_SIZE,this.mergeStrategy=(0,Axc.derived)(s=>q5r.fromConfig(this._configurationService.getExperimentBasedConfigObservable(Zbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(Zbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(Zbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,gxc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,Exc.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,F5r.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case f9.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case f9.DiffHistoryMergeStrategy.Proximity:return c7i(r,e,o.lineGap);case f9.DiffHistoryMergeStrategy.Hybrid:return(0,F5r.now)()-n<=o.splitAfterMs&&c7i(r,e,o.lineGap)}}handleEdits(e,r){(0,Q5r.assert)(r.previous!==void 0,"Document has previous version"),(0,Q5r.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 Jbt.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=Jbt.RootedEdit.toLineEdit(l),d=Jbt.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new Jbt.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,F5r.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)}}}};yN.NesXtabHistoryTracker=j5r;yN.NesXtabHistoryTracker=j5r=U5r=pxc([a7i(2,Zbt.IConfigurationService),a7i(3,yxc.IExperimentationService)],j5r)});var u7i=I(Xbt=>{"use strict";p();Object.defineProperty(Xbt,"__esModule",{value:!0});Xbt.IVSCodeExtensionContext=void 0;var _xc=nn();Xbt.IVSCodeExtensionContext=(0,_xc.createServiceIdentifier)("IVSCodeExtensionContext")});var y7i=I(_N=>{"use strict";p();var h7i=_N&&_N.__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},vV=_N&&_N.__param||function(t,e){return function(r,n){e(r,n,t)}},XBe;Object.defineProperty(_N,"__esModule",{value:!0});_N.UndesiredModels=_N.InlineEditsModelService=void 0;var vxc=OOr(),m7i=AOr(),d7i=ev(),Cxc=Sl(),f7i=rd(),g7i=Ic(),A7i=ko(),dEe=z2(),bxc=eG(),EN=Pl(),Sxc=u7i(),Txc=Sp(),Ixc=mbt(),xxc=mh(),wxc=gm(),ZBe=py(),Rxc=PCt(),G5r=class extends A7i.Disposable{static{a(this,"InlineEditsModelService")}static{XBe=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:ZBe.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:ZBe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:ZBe.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,dEe.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,dEe.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(EN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(EN.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(EN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(EN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(EN.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,dEe.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new m7i.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,dEe.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,dEe.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,dEe.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=g7i.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(EN.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(EN.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(EN.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,EN.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,vxc.filterMap)(r,f=>{if((0,ZBe.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,Cxc.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 H5r(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 H5r(r[0])}return H5r(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,f7i.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,EN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?XBe.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?XBe.COPILOT_NES_CALLISTO:XBe.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,f7i.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=ZBe.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=d7i.ErrorUtils.toString(d7i.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};_N.InlineEditsModelService=G5r;_N.InlineEditsModelService=G5r=XBe=h7i([vV(0,bxc.ICopilotTokenStore),vV(1,Ixc.IProxyModelsService),vV(2,Rxc.IUndesiredModelsManager),vV(3,EN.IConfigurationService),vV(4,xxc.IExperimentationService),vV(5,wxc.ITelemetryService),vV(6,Txc.ILogService)],G5r);function H5r(t){let{source:e,...r}=t;return r}a(H5r,"toModelConfiguration");var p7i;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends A7i.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new g7i.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new m7i.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=h7i([vV(0,Sxc.IVSCodeExtensionContext)],r),t.Manager=r})(p7i||(_N.UndesiredModels=p7i={}))});var E7i=I(e1t=>{"use strict";p();Object.defineProperty(e1t,"__esModule",{value:!0});e1t.NullLanguageContextProviderService=void 0;var kxc=ko(),$5r=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return kxc.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};e1t.NullLanguageContextProviderService=$5r});var _7i=I(t1t=>{"use strict";p();Object.defineProperty(t1t,"__esModule",{value:!0});t1t.TestLanguageDiagnosticsService=void 0;var Pxc=Ic(),Dxc=YP(),Nxc=I$(),V5r=class extends Nxc.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new Dxc.ResourceMap,this._onDidChangeDiagnostics=new Pxc.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())}};t1t.TestLanguageDiagnosticsService=V5r});var v7i=I(n1t=>{"use strict";p();Object.defineProperty(n1t,"__esModule",{value:!0});n1t.ResponseStream=void 0;var Mxc=ev(),r1t=dw(),Oxc=nl(),Lxc=ZS(),W5r=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new Oxc.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return r1t.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return r1t.Result.error(l)}}),this.stream=Bxc(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,Lxc.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}}};n1t.ResponseStream=W5r;async function*Bxc(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=Mxc.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?r1t.Result.error(n):r1t.Result.ok(r))}}a(Bxc,"streamWithAggregation")});var C7i=I(z5r=>{"use strict";p();Object.defineProperty(z5r,"__esModule",{value:!0});z5r.jsonlStreamToCompletions=Fxc;async function*Fxc(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(Fxc,"jsonlStreamToCompletions")});var S7i=I(p9=>{"use strict";p();var Uxc=p9&&p9.__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},Y5r=p9&&p9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(p9,"__esModule",{value:!0});p9.CompletionsFetchService=void 0;var Qxc=yOr(),b7i=ev(),eie=dw(),qxc=x0r(),jxc=FE(),Hxc=V6(),Gxc=_y(),$xc=uye(),CV=v_t(),Vxc=v7i(),Wxc=C7i(),K5r=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=eie.Result.error(new CV.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=Qxc.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,Wxc.jsonlStreamToCompletions)(f),m=new Vxc.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=eie.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new CV.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>Yxc(d.val.body).catch(()=>"")),h=eie.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())),eie.Result.error(new CV.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=zxc(u,s);return eie.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,Hxc.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return eie.Result.error(new CV.Completions.RequestCancelled);let l=b7i.ErrorUtils.fromUnknown(c);return eie.Result.error(new CV.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 CV.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof CV.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof CV.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:qxc.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}}};p9.CompletionsFetchService=K5r;p9.CompletionsFetchService=K5r=Uxc([Y5r(0,jxc.IAuthenticationService),Y5r(1,Gxc.IFetcherService),Y5r(2,$xc.IRequestLogger)],K5r);async function*zxc(t,e){try{for await(let r of t)yield r}catch(r){throw b7i.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(zxc,"streamWithCleanup");async function Yxc(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(Yxc,"collectAsyncIterableToString")});var I7i=I(i1t=>{"use strict";p();Object.defineProperty(i1t,"__esModule",{value:!0});i1t.WireTypes=void 0;var bV=kG(),T7i;(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,bV.vObj)({promptStrategy:(0,bV.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,bV.vObj)({serviceType:(0,bV.vString)(),name:(0,bV.vString)(),provider:(0,bV.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,bV.vObj)({models:(0,bV.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={}))})(T7i||(i1t.WireTypes=T7i={}))});var w7i=I(h9=>{"use strict";p();var Kxc=h9&&h9.__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},o1t=h9&&h9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(h9,"__esModule",{value:!0});h9.ProxyModelsService=void 0;var Jxc=require("util"),J5r=ev(),Zxc=KP(),Xxc=Ic(),ewc=ko(),x7i=z2(),twc=eG(),rwc=$E(),nwc=I7i(),iwc=Sp(),owc=_y(),Z5r=class extends ewc.Disposable{static{a(this,"ProxyModelsService")}constructor(e,r,n,o){super(),this._tokenStore=e,this._capiClient=r,this._fetchService=n,this._logService=o,this._onModelListUpdated=this._register(new Xxc.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let s=(0,x7i.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,x7i.autorun)(c=>{let l=s.read(c),u=new Zxc.CancellationTokenSource;this._fetchLatestModels(l,u.token).then(d=>{d!==void 0&&(u.token.isCancellationRequested||(0,Jxc.isDeepStrictEqual)(this._models,d)||(this._models=d,this._onModelListUpdated.fire()))}).catch(d=>{let f=J5r.ErrorUtils.fromUnknown(d);this._logService.error(f,"Failed to fetch models in autorun")}),c.store.add({dispose:a(()=>u.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}`},method:"GET",timeout:1e4,callSite:"proxy-models",signal:o.signal})}catch(l){let u=J5r.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=nwc.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=J5r.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};h9.ProxyModelsService=Z5r;h9.ProxyModelsService=Z5r=Kxc([o1t(0,twc.ICopilotTokenStore),o1t(1,rwc.ICAPIClientService),o1t(2,owc.IFetcherService),o1t(3,iwc.ILogService)],Z5r)});var R7i=I(s1t=>{"use strict";p();Object.defineProperty(s1t,"__esModule",{value:!0});s1t.NullRequestLogger=void 0;var swc=pMr(),awc=Ic(),X5r=class extends swc.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=awc.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};s1t.NullRequestLogger=X5r});var d1t=I(eu=>{"use strict";p();var c4r=eu&&eu.__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},vN=eu&&eu.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(eu,"__esModule",{value:!0});eu.SimpleExperimentationService=eu.LogLevel=eu.TokenizerName=eu.ILanguageContextProviderService=eu.IIgnoreService=eu.IExperimentationService=eu.IEndpointProvider=eu.ICAPIClientService=eu.IAuthenticationService=void 0;eu.createNESProvider=eRc;eu.createInlineCompletionsProvider=rRc;var cwc=vsi(),k7i=bte(),P7i=uIi(),D7i=Qge(),lwc=ggt(),N7i=USr(),uwc=QSr(),Vv=LE(),M7i=VSr(),dwc=i2i(),fwc=fy(),O7i=BTr(),pwc=i$(),L7i=HTr(),B7i=C4e(),F7i=lIr(),U7i=dIr(),Q7i=xPr(),t4r=dyt(),hwc=QLi(),mwc=qLi(),e3e=Dl(),gwc=JAe(),Awc=HSr(),q7i=s2r(),j7i=gTr(),H7i=y_t(),G7i=lkr(),$7i=rEt(),t3e=tEt(),V7i=C$(),W7i=mEt(),ywc=$Li(),Ewc=fEt(),z7i=aCr(),Y7i=s1(),K7i=C5e(),J7i=rne(),cQi=Ore();Object.defineProperty(eu,"TokenizerName",{enumerable:!0,get:a(function(){return cQi.TokenizerName},"get")});var _wc=oBi(),vwc=n3i(),r4r=I3i(),Z7i=FDr(),Cwc=u6i(),X7i=wMr(),bwc=AUi(),l4r=FE();Object.defineProperty(eu,"IAuthenticationService",{enumerable:!0,get:a(function(){return l4r.IAuthenticationService},"get")});var Swc=v5e(),eQi=eG(),Twc=yUi(),Iwc=PUi(),xwc=J6(),wwc=qDr(),Rwc=DUi(),kwc=jDr(),tQi=GDr(),PL=Pl(),Pwc=MUi(),Dwc=RMr(),Nwc=QUi(),u4r=$E();Object.defineProperty(eu,"ICAPIClientService",{enumerable:!0,get:a(function(){return u4r.ICAPIClientService},"get")});var Mwc=Z$(),d4r=c4e();Object.defineProperty(eu,"IEndpointProvider",{enumerable:!0,get:a(function(){return d4r.IEndpointProvider},"get")});var lQi=jUi(),Owc=GUi(),tie=U4(),Lwc=$Ui(),Bwc=T5r(),uQi=VUi(),r3e=Bre();Object.defineProperty(eu,"IIgnoreService",{enumerable:!0,get:a(function(){return r3e.IIgnoreService},"get")});var Fwc=Vne(),Uwc=Xft(),e4r=PCt(),Qwc=WUi(),qwc=s7i(),jwc=l7i(),Hwc=y7i(),f4r=Zyt();Object.defineProperty(eu,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return f4r.ILanguageContextProviderService},"get")});var dQi=E7i(),fQi=I$(),pQi=_7i(),CN=Sp(),Gwc=v_t(),$wc=S7i(),p4r=_y(),rQi=e9(),Vwc=cMr(),Wwc=lMr(),zwc=ECt(),Ywc=mbt(),Kwc=w7i(),hQi=uye(),mQi=R7i(),nQi=FMr(),iQi=q2r(),i3e=mh();Object.defineProperty(eu,"IExperimentationService",{enumerable:!0,get:a(function(){return i3e.IExperimentationService},"get")});var gQi=gm(),oQi=Iye(),Jwc=xvr(),sQi=cbt(),aQi=J$(),n4r=pOr(),AQi=nn(),Zwc=KP(),n3e=Ic(),u1t=ko(),Xwc=T0(),gi=Gft(),yQi=Gs(),rie;(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"})(rie||(eu.LogLevel=rie={}));function eRc(t){return tRc(t).createInstance(i4r,t)}a(eRc,"createNESProvider");var i4r=class extends u1t.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(bwc.XtabProvider),l=r.createInstance(Qwc.ObservableGit),u=new qwc.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(PL.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new jwc.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new _wc.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(vwc.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(r4r.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=Fwc.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,Xwc.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new Uwc.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new r4r.NextEditProviderTelemetryBuilder(new uQi.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 nie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=PL.globalConfigRegistry.configs.get(`${PL.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};i4r=c4r([vN(1,yQi.IInstantiationService),vN(2,i3e.IExperimentationService),vN(3,PL.IConfigurationService),vN(4,n4r.IWorkspaceService)],i4r);function tRc(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o}=t,s=new AQi.InstantiationServiceBuilder;s.define(PL.IConfigurationService,new gi.SyncDescriptor(a1t,[t.configOverrides??new Map])),s.define(i3e.IExperimentationService,new gi.SyncDescriptor(nie,[t.waitForTreatmentVariables])),s.define(nQi.ISimulationTestContext,new gi.SyncDescriptor(nQi.NulSimulationTestContext)),s.define(n4r.IWorkspaceService,new gi.SyncDescriptor(n4r.NullWorkspaceService)),s.define(Dwc.IDiffService,new gi.SyncDescriptor(Nwc.DiffServiceImpl,[!1])),s.define(CN.ILogService,new gi.SyncDescriptor(CN.LogServiceImpl,[[o||new CN.ConsoleLog(void 0,CN.LogLevel.Trace)]])),s.define(Bwc.IGitExtensionService,new gi.SyncDescriptor(uQi.NullGitExtensionService)),s.define(f4r.ILanguageContextProviderService,new gi.SyncDescriptor(dQi.NullLanguageContextProviderService)),s.define(fQi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(pQi.TestLanguageDiagnosticsService)),s.define(r3e.IIgnoreService,new gi.SyncDescriptor(r3e.NullIgnoreService)),s.define(iQi.ISnippyService,new gi.SyncDescriptor(iQi.NullSnippyService)),s.define(Mwc.IDomainService,new gi.SyncDescriptor(Owc.DomainService)),s.define(u4r.ICAPIClientService,new gi.SyncDescriptor(lQi.CAPIClientImpl)),s.define(eQi.ICopilotTokenStore,new gi.SyncDescriptor(eQi.CopilotTokenStore)),s.define(tie.IEnvService,new gi.SyncDescriptor(Lwc.NullEnvService)),s.define(p4r.IFetcherService,new gi.SyncDescriptor(c1t,[e])),s.define(gQi.ITelemetryService,new gi.SyncDescriptor(l1t,[n])),s.define(l4r.IAuthenticationService,new gi.SyncDescriptor(Twc.StaticGitHubAuthenticationService,[(0,Iwc.createStaticGitHubTokenProvider)()])),s.define(Swc.ICopilotTokenManager,r),s.define(Z7i.IPowerService,new gi.SyncDescriptor(Z7i.NullPowerService)),s.define(xwc.IChatMLFetcher,new gi.SyncDescriptor(Cwc.ChatMLFetcherImpl)),s.define(rQi.IChatWebSocketManager,new gi.SyncDescriptor(rQi.NullChatWebSocketManager)),s.define(zwc.IOTelService,new Vwc.NoopOTelService((0,Wwc.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),s.define(wwc.IChatQuotaService,new gi.SyncDescriptor(Rwc.ChatQuotaService)),s.define(tQi.IInteractionService,new gi.SyncDescriptor(tQi.InteractionService)),s.define(hQi.IRequestLogger,new gi.SyncDescriptor(mQi.NullRequestLogger)),s.define(aQi.ITokenizerProvider,t.tokenizerProvider??new gi.SyncDescriptor(aQi.TokenizerProvider,[!1])),s.define(kwc.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),s.define(Ywc.IProxyModelsService,new gi.SyncDescriptor(Kwc.ProxyModelsService)),s.define(e4r.IInlineEditsModelService,new gi.SyncDescriptor(Hwc.InlineEditsModelService)),s.define(e4r.IUndesiredModelsManager,t.undesiredModelsManager||new gi.SyncDescriptor(e4r.NullUndesiredModelsManager)),s.define(sQi.ITerminalService,t.terminalService||new gi.SyncDescriptor(sQi.NullTerminalService)),s.define(X7i.ISimilarFilesContextService,new gi.SyncDescriptor(X7i.NullSimilarFilesContextService)),s.define(d4r.IEndpointProvider,new o4r);let c=new Vv.InMemoryConfigProvider(new Vv.DefaultsOnlyConfigProvider);return t.configOverrides&&c.setOverrides(t.configOverrides),s.define(Vv.ICompletionsConfigProvider,c),s.seal()}a(tRc,"setupServices");var a1t=class extends Pwc.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)}},o4r=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=n3e.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},nie=class extends u1t.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new n3e.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()}};eu.SimpleExperimentationService=nie;eu.SimpleExperimentationService=nie=c4r([vN(1,PL.IConfigurationService)],nie);var c1t=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=n3e.Event.None,this.onDidCompleteFetch=n3e.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 p4r.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)}},l1t=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,oQi.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,oQi.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function rRc(t){return t.tokenizerProvider&&(0,cQi.setExternalTokenizerProvider)(t.tokenizerProvider),nRc(t).createInstance(s4r)}a(rRc,"createInlineCompletionsProvider");var s4r=class extends u1t.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(hwc.GhostText)}updateTreatmentVariables(e){this._expService instanceof nie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=PL.globalConfigRegistry.configs.get(`${PL.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof Vv.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new r4r.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??Zwc.CancellationToken.None,o,new cwc.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};s4r=c4r([vN(0,yQi.IInstantiationService),vN(1,i3e.IExperimentationService),vN(2,t4r.ICompletionsSpeculativeRequestCache),vN(3,CN.ILogService),vN(4,PL.IConfigurationService),vN(5,Vv.ICompletionsConfigProvider)],s4r);var a4r=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,Jwc.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function nRc(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new CN.ConsoleLog(void 0,CN.LogLevel.Trace),f=new AQi.InstantiationServiceBuilder;f.define(e3e.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case e3e.LogLevel.DEBUG:return rie.Debug;case e3e.LogLevel.INFO:return rie.Info;case e3e.LogLevel.WARN:return rie.Warning;case e3e.LogLevel.ERROR:return rie.Error;default:return rie.Info}}}),f.define(l4r.IAuthenticationService,r),f.define(CN.ILogService,new gi.SyncDescriptor(CN.LogServiceImpl,[[d||new CN.ConsoleLog(void 0,CN.LogLevel.Trace)]])),f.define(r3e.IIgnoreService,t.ignoreService||new r3e.NullIgnoreService),f.define(gQi.ITelemetryService,new gi.SyncDescriptor(l1t,[new a4r(c)])),f.define(PL.IConfigurationService,new gi.SyncDescriptor(a1t,[t.configOverrides??new Map])),f.define(i3e.IExperimentationService,new gi.SyncDescriptor(nie,[t.waitForTreatmentVariables])),f.define(d4r.IEndpointProvider,t.endpointProvider),f.define(u4r.ICAPIClientService,t.capiClientService||new gi.SyncDescriptor(lQi.CAPIClientImpl)),f.define(p4r.IFetcherService,new gi.SyncDescriptor(c1t,[e])),f.define(k7i.ICompletionsTelemetryService,new gi.SyncDescriptor(k7i.CompletionsTelemetryServiceBridge)),f.define(J7i.ICompletionsRuntimeModeService,J7i.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(B7i.ICompletionsCacheService,new B7i.CompletionsCache);let h=new Vv.InMemoryConfigProvider(new Vv.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define(Vv.ICompletionsConfigProvider,h),f.define(Q7i.ICompletionsLastGhostText,new Q7i.LastGhostText),f.define(U7i.ICompletionsCurrentGhostText,new U7i.CurrentGhostText),f.define(t4r.ICompletionsSpeculativeRequestCache,new t4r.SpeculativeRequestCache),f.define(Awc.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define(Vv.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(P7i.ICompletionsExtensionStatus,new P7i.CopilotExtensionStatus),f.define(fwc.ICompletionsFeaturesService,new gi.SyncDescriptor(dwc.Features)),f.define(uwc.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(H7i.ICompletionsStatusReporter,new class extends H7i.StatusReporter{didChange(m){n.didChange(m)}}),f.define(D7i.ICompletionsCopilotTokenManager,new gi.SyncDescriptor(D7i.CopilotTokenManagerImpl,[!1])),f.define(Y7i.ICompletionsTextDocumentManagerService,new gi.SyncDescriptor(class extends Y7i.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(O7i.ICompletionsFileReaderService,new gi.SyncDescriptor(O7i.FileReader)),f.define(F7i.ICompletionsBlockModeConfig,new gi.SyncDescriptor(F7i.ConfigBlockModeConfig)),f.define(z7i.ICompletionsTelemetryUserConfigService,new gi.SyncDescriptor(z7i.TelemetryUserConfig)),f.define(W7i.ICompletionsRecentEditsProviderService,new gi.SyncDescriptor(W7i.FullRecentEditsProvider,[void 0])),f.define(N7i.ICompletionsNotifierService,new gi.SyncDescriptor(N7i.CompletionNotifier)),f.define(q7i.ICompletionsOpenAIFetcherService,new gi.SyncDescriptor(q7i.LiveOpenAIFetcher)),f.define(Gwc.ICompletionsFetchService,new gi.SyncDescriptor($wc.CompletionsFetchService)),f.define(j7i.ICompletionsModelManagerService,new gi.SyncDescriptor(j7i.AvailableModelsManager,[!0])),f.define(L7i.ICompletionsAsyncManagerService,new gi.SyncDescriptor(L7i.AsyncCompletionManager)),f.define($7i.ICompletionsContextProviderBridgeService,new gi.SyncDescriptor($7i.ContextProviderBridge)),f.define(M7i.ICompletionsUserErrorNotifierService,new gi.SyncDescriptor(M7i.UserErrorNotifier)),f.define(Ewc.ICompletionsRelatedFilesProviderService,new gi.SyncDescriptor(ywc.CompositeRelatedFilesProvider)),f.define(pwc.ICompletionsFileSystemService,new mwc.LocalFileSystem),f.define(t3e.ICompletionsContextProviderRegistryService,new gi.SyncDescriptor(t3e.CachedContextProviderRegistry,[t3e.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(K7i.ICompletionsPromiseQueueService,new K7i.PromiseQueue),f.define(lwc.ICompletionsCitationManager,new class{register(){return u1t.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(V7i.ICompletionsContextProviderService,new V7i.ContextProviderStatistics),f.define(G7i.ICompletionsPromptFactoryService,new gi.SyncDescriptor(G7i.CompletionsPromptFactory)),f.define(gwc.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(t3e.ICompletionsDefaultContextProviders,new t3e.DefaultContextProvidersContainer),f.define(tie.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=n3e.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?tie.OperatingSystem.Macintosh:process.platform==="win32"?tie.OperatingSystem.Windows:tie.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return Vv.BuildInfo.isProduction()}isPreRelease(){return Vv.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return Vv.BuildInfo.getBuildType()===Vv.BuildType.DEV?"dev":"prod"}getVersion(){return Vv.BuildInfo.getVersion()}getBuild(){return Vv.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new tie.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new tie.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(f4r.ILanguageContextProviderService,t.languageContextProvider??new dQi.NullLanguageContextProviderService),f.define(fQi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(pQi.TestLanguageDiagnosticsService)),f.define(hQi.IRequestLogger,new gi.SyncDescriptor(mQi.NullRequestLogger)),f.seal()}a(nRc,"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 xe(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 C1=ve(()=>{p();a(qt,"__classPrivateFieldSet");a(xe,"__classPrivateFieldGet")});var CEe,N1t=ve(()=>{p();CEe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return CEe=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 C9(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var f3e,bEe=ve(()=>{p();a(C9,"isAbortError");f3e=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 fr,Ch,Ty,IV,SEe,TEe,IEe,xEe,wEe,REe,kEe,PEe,DEe,Bf=ve(()=>{p();bEe();fr=class extends Error{static{a(this,"AnthropicError")}},Ch=class t extends fr{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 IV({message:n,cause:f3e(r)});let s=r,c=s?.error?.type;return e===400?new TEe(e,s,n,o,c):e===401?new IEe(e,s,n,o,c):e===403?new xEe(e,s,n,o,c):e===404?new wEe(e,s,n,o,c):e===409?new REe(e,s,n,o,c):e===422?new kEe(e,s,n,o,c):e===429?new PEe(e,s,n,o,c):e>=500?new DEe(e,s,n,o,c):new t(e,s,n,o,c)}},Ty=class extends Ch{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},IV=class extends Ch{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},SEe=class extends IV{static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},TEe=class extends Ch{static{a(this,"BadRequestError")}},IEe=class extends Ch{static{a(this,"AuthenticationError")}},xEe=class extends Ch{static{a(this,"PermissionDeniedError")}},wEe=class extends Ch{static{a(this,"NotFoundError")}},REe=class extends Ch{static{a(this,"ConflictError")}},kEe=class extends Ch{static{a(this,"UnprocessableEntityError")}},PEe=class extends Ch{static{a(this,"RateLimitError")}},DEe=class extends Ch{static{a(this,"InternalServerError")}}});function M1t(t){return typeof t!="object"?{}:t??{}}function eLr(t){if(!t)return!0;for(let e in t)return!1;return!0}function Zqi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var XPc,Jqi,t_,X4r,Xqi,O1t,NL=ve(()=>{p();Bf();XPc=/^[a-z][a-z0-9+.-]*:/i,Jqi=a(t=>XPc.test(t),"isAbsoluteURL"),t_=a(t=>(t_=Array.isArray,t_(t)),"isArray"),X4r=t_;a(M1t,"maybeObj");a(eLr,"isEmptyObj");a(Zqi,"hasOwn");Xqi=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new fr(`${t} must be an integer`);if(e<0)throw new fr(`${t} must be a positive integer`);return e},"validatePositiveInteger"),O1t=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var IN,NEe=ve(()=>{p();IN=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 tk,p3e=ve(()=>{p();tk="0.98.0"});function e2c(){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 r2c(){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 nji,t2c,eji,tji,rji,h3e,L1t=ve(()=>{p();p3e();nji=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(e2c,"getDetectedPlatform");t2c=a(()=>{let t=e2c();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":tk,"X-Stainless-OS":tji(Deno.build.os),"X-Stainless-Arch":eji(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":tk,"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":tk,"X-Stainless-OS":tji(globalThis.process.platform??"unknown"),"X-Stainless-Arch":eji(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=r2c();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":tk,"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":tk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(r2c,"getBrowserInfo");eji=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),tji=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"),h3e=a(()=>rji??(rji=t2c()),"getPlatformHeaders")});function iji(){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 tLr(...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 B1t(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return tLr({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function m3e(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 oji(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 MEe=ve(()=>{p();a(iji,"getDefaultFetch");a(tLr,"makeReadableStream");a(B1t,"ReadableStreamFrom");a(m3e,"ReadableStreamToAsyncIterable");a(oji,"CancelReadableStream")});var sji,aji=ve(()=>{p();sji=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var rLr,nLr,iLr,cji,oLr=ve(()=>{p();rLr="RFC3986",nLr=a(t=>String(t),"default_formatter"),iLr={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:nLr},cji="RFC1738"});function uji(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function aLr(t,e){if(t_(t)){let r=[];for(let n=0;n{p();oLr();NL();F1t=a((t,e)=>(F1t=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),F1t(t,e)),"has"),ML=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),sLr=1024,lji=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=sLr?s.slice(l,l+sLr):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===cji&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=ML[h];continue}if(h<2048){d[d.length]=ML[192|h>>6]+ML[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=ML[224|h>>12]+ML[128|h>>6&63]+ML[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=ML[240|h>>18]+ML[128|h>>12&63]+ML[128|h>>6&63]+ML[128|h&63]}c+=d.join("")}return c},"encode");a(uji,"is_buffer");a(aLr,"maybe_map")});function o2c(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function mji(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=t,b=_,T=0,w=!1;for(;(b=b.get(cLr))!==void 0&&!w;){let N=b.get(t);if(T+=1,typeof N<"u"){if(N===T)throw new RangeError("Cyclic object value");w=!0}typeof b.get(cLr)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&t_(v)&&(v=aLr(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,L0.encoder,E,"key",g):e;v=""}if(o2c(v)||uji(v)){if(u){let N=y?e:u(e,L0.encoder,E,"key",g);return[A?.(N)+"="+A?.(u(v,L0.encoder,E,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&t_(v))y&&u&&(v=aLr(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(t_(d))x=d;else{let N=Object.keys(v);x=f?N.sort(f):N}let P=l?String(e).replace(/\./g,"%2E"):String(e),D=n&&t_(v)&&v.length===1?P+"[]":P;if(o&&t_(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:L0.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:L0.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:L0.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:L0.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?L0.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:L0.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:L0.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:L0.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:L0.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:L0.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:L0.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:L0.strictNullHandling}}function gji(t,e={}){let r=t,n=s2c(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):t_(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=pji[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 pji,hji,fji,L0,cLr,Aji=ve(()=>{p();dji();oLr();NL();pji={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},hji=a(function(t,e){Array.prototype.push.apply(t,t_(e)?e:[e])},"push_to_array"),L0={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:lji,encodeValuesOnly:!1,format:rLr,formatter:nLr,indices:!1,serializeDate(t){return(fji??(fji=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(o2c,"is_non_nullish_primitive");cLr={};a(mji,"inner_stringify");a(s2c,"normalize_stringify_options");a(gji,"stringify")});function yji(t){return gji(t,{arrayFormat:"brackets"})}var lLr=ve(()=>{p();Aji();a(yji,"stringifyQuery")});function Q1t(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new Wc(`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 Wc(`Refusing to send credential over non-https token endpoint "${t}"`)}async function q1t(t,e){let r=await l2c(t),n;try{n=JSON.parse(r)}catch{throw new Wc(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,b1(r),e)}if(!n.access_token)throw new Wc(`Token endpoint response missing access_token: ${JSON.stringify(b1(n))}`,t.status,b1(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Wc(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,b1(n),e);return n}function b1(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=uLr?t:t.slice(0,uLr)+`... <${t.length-uLr} more chars>`}return JSON.stringify(b1(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))c2c.has(r)&&(e[r]=n);return e}return null}async function j1t(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 Wc(`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 Wc(`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 H1t(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 l2c(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>Eji){let l=Eji-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 _ji,vji,U1t,lie,Cji,bji,OEe,Sji,Eji,uLr,c2c,Wc,LEe=ve(()=>{p();Bf();_ji="urn:ietf:params:oauth:grant-type:jwt-bearer",vji="refresh_token",U1t="/v1/oauth/token",lie="oauth-2025-04-20",Cji="oidc-federation-2026-04-01",bji=120,OEe=30,Sji=5,Eji=1<<20;a(Q1t,"requireSecureTokenEndpoint");a(q1t,"parseTokenResponse");uLr=2e3,c2c=new Set(["error","error_description","error_uri"]);a(b1,"redactSensitive");a(j1t,"checkCredentialsFileSafety");a(H1t,"writeCredentialsFileAtomic");a(l2c,"readLimitedText");Wc=class extends fr{static{a(this,"WorkloadIdentityError")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}}});function xN(){return Math.floor(Date.now()/1e3)}var g3e=ve(()=>{p();a(xN,"nowAsSeconds")});var G1t,Tji=ve(()=>{p();LEe();g3e();G1t=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-xN();return n>bji?r.token:n>OEe?(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||xN()-this.lastAdvisoryError{this.lastAdvisoryError=xN(),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 Ea,A3e=ve(()=>{p();Ea=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 wji(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 BEe(t){let e;return(Iji??(e=new globalThis.TextEncoder,Iji=e.encode.bind(e)))(t)}function dLr(t){let e;return(xji??(e=new globalThis.TextDecoder,xji=e.decode.bind(e)))(t)}var Iji,xji,$1t=ve(()=>{p();a(wji,"concatBytes");a(BEe,"encodeUTF8");a(dLr,"decodeUTF8")});var Rji=ve(()=>{p();Bf();$1t()});function y3e(){}function V1t(t,e,r){return!e||W1t[t]>W1t[r]?y3e:e[t].bind(e)}function gl(t){let e=t.logger,r=t.logLevel??"off";if(!e)return u2c;let n=kji.get(e);if(n&&n[0]===r)return n[1];let o={error:V1t("error",e,r),warn:V1t("warn",e,r),info:V1t("info",e,r),debug:V1t("debug",e,r)};return kji.set(e,[r,o]),o}var W1t,fLr,u2c,kji,b9,S9=ve(()=>{p();NL();W1t={off:0,error:200,warn:300,info:400,debug:500},fLr=a((t,e,r)=>{if(t){if(Zqi(W1t,t))return t;gl(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(W1t))}`)}},"parseLogLevel");a(y3e,"noop");a(V1t,"makeLogFn");u2c={error:y3e,warn:y3e,info:y3e,debug:y3e},kji=new WeakMap;a(gl,"loggerFor");b9=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 pLr=ve(()=>{p();NL();Rji();A3e();S9();N1t();NEe();lLr()});function Pji(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(!d2c.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var z1t,d2c,Dji,Nji,hLr,f2c,Mji,mLr=ve(()=>{p();L1t();pLr();z1t="1.0",d2c=/^[A-Za-z0-9_.-]+$/;a(Pji,"validateProfileName");Dji=a(async t=>{var e,r;let n=await hLr();if(n===null)return null;let o=t??await Mji();if(o===null)return null;Pji(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=Ea("ANTHROPIC_ORGANIZATION_ID"),m=Ea("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=Ea("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:Ea("ANTHROPIC_WORKSPACE_ID"),base_url:Ea("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:Ea("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:Ea("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=Ea("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=Ea("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=Ea("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=Ea("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=Ea("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=Ea("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=Ea("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),Nji=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await hLr();if(!r)return null;let n=e??await Mji();return n?(Pji(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),hLr=a(async()=>{if(!f2c())return null;let t=await import("node:path"),e=Ea("ANTHROPIC_CONFIG_DIR");if(e)return e;if(h3e()["X-Stainless-OS"]==="Windows"){let s=Ea("APPDATA");if(s)return t.join(s,"Anthropic");let c=Ea("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=Ea("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=Ea("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),f2c=a(()=>{let t=h3e()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),Mji=a(async()=>{let t=await hLr();if(!t)return null;let e=Ea("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 gLr(t){if(!t)throw new fr("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 fr(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new fr(`Identity token file at ${t} is empty`);return n}}function Oji(t){if(!t)throw new fr("Identity token value is empty");return()=>t}var Lji=ve(()=>{p();Bf();a(gLr,"identityTokenFromFile");a(Oji,"identityTokenFromValue")});function Bji(t){return async()=>{Q1t(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new Wc(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:_ji,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}${U1t}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${lie},${Cji}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${tk} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new Wc(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=b1(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 Wc(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await q1t(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new Wc(`Token endpoint response missing required fields: ${JSON.stringify(b1(c))}`,o.status,b1(c),s);return{token:c.access_token,expiresAt:xN()+l}}}var Fji=ve(()=>{p();LEe();g3e();p3e();a(Bji,"oidcFederationProvider")});function Uji(t){return async e=>{let r=await import("node:fs");await j1t(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new Wc(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new Wc(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new Wc(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||xN()"");throw new Wc(`User OAuth refresh failed (HTTP ${f.status}): ${b1(E)}`,f.status,b1(E),h)}let m=await q1t(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Wc(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(b1(m))}`,f.status,b1(m),h);let A=xN()+g,y=m.refresh_token||l;return await H1t(t.credentialsPath,{...o,version:z1t,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var Qji=ve(()=>{p();mLr();LEe();g3e();p3e();a(Uji,"userOAuthProvider")});function ALr(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=p2c(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 qji(t,e){let r=await Dji(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 Nji(n,e)??void 0}};return ALr(s,t)}function p2c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=h2c(o);if(!s)throw new Wc("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 Wc("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 Wc("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=Bji({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?m2c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new Wc("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return Uji({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 Wc(`authentication.type "${o}" is not a known authentication type`)}}}function h2c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Wc(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Wc('identity_token.source "file" requires a non-empty path');return gLr(t.identity_token.path)}let e=Ea("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return gLr(e);let r=Ea("ANTHROPIC_IDENTITY_TOKEN");return r?Oji(r):null}function m2c(t,e,r,n){return async o=>{let s=await import("node:fs");await j1t(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||xN(){p();A3e();mLr();LEe();g3e();Lji();Fji();Qji();a(ALr,"resolveCredentialsFromConfig");a(qji,"defaultCredentials");a(p2c,"buildProvider");a(h2c,"resolveIdentityTokenProvider");a(m2c,"cachedExchangeProvider")});function g2c(t,e){for(let o=e??0;o{p();C1();$1t();T9=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"?BEe(e):e;qt(this,_I,wji([xe(this,_I,"f"),r]),"f");let n=[],o;for(;(o=g2c(xe(this,_I,"f"),xe(this,vI,"f")))!=null;){if(o.carriage&&xe(this,vI,"f")==null){qt(this,vI,o.index,"f");continue}if(xe(this,vI,"f")!=null&&(o.index!==xe(this,vI,"f")+1||o.carriage)){n.push(dLr(xe(this,_I,"f").subarray(0,xe(this,vI,"f")-1))),qt(this,_I,xe(this,_I,"f").subarray(xe(this,vI,"f")),"f"),qt(this,vI,null,"f");continue}let s=xe(this,vI,"f")!==null?o.preceding-1:o.preceding,c=dLr(xe(this,_I,"f").subarray(0,s));n.push(c),qt(this,_I,xe(this,_I,"f").subarray(o.index),"f"),qt(this,vI,null,"f")}return n}flush(){return xe(this,_I,"f").length?this.decode(` +`):[]}};_I=new WeakMap,vI=new WeakMap;T9.NEWLINE_CHARS=new Set([` +`,"\r"]);T9.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(g2c,"findNewlineIndex");a(Hji,"findDoubleNewlineIndex")});async function*A2c(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new fr("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 fr("Attempted to iterate over a response with no body");let r=new ELr,n=new T9,o=m3e(t.body);for await(let s of y2c(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*y2c(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"?BEe(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=Hji(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function E2c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var E3e,OL,ELr,_Lr=ve(()=>{p();C1();Bf();MEe();yLr();MEe();bEe();NL();$1t();S9();Bf();OL=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,E3e.set(this,void 0),this.controller=r,qt(this,E3e,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?gl(n):console;async function*c(){if(o)throw new fr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of A2c(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=O1t(u.data)??u.data,f=d?.error?.type;throw new Ch(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(C9(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 T9,u=m3e(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 fr("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(C9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(E3e=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,xe(this,E3e,"f")),new t(()=>o(r),this.controller,xe(this,E3e,"f"))]}toReadableStream(){let e=this,r;return tLr({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=BEe(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(A2c,"_iterSSEMessages");a(y2c,"iterSSEChunks");ELr=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]=E2c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(E2c,"partition")});async function Y1t(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return gl(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):OL.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 vLr(m,r)}return await r.text()})();return gl(t).debug(`[${n}] response parsed`,b9({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function vLr(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 CLr=ve(()=>{p();_Lr();S9();a(Y1t,"defaultParseResponse");a(vLr,"addRequestID")});var _3e,uie,K1t=ve(()=>{p();C1();CLr();uie=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=Y1t){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,_3e.set(this,void 0),qt(this,_3e,e,"f")}_thenUnwrap(e){return new t(xe(this,_3e,"f"),this.responsePromise,async(r,n)=>vLr(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(xe(this,_3e,"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)}};_3e=new WeakMap});var J1t,Z1t,v3e,rk,_a,_d=ve(()=>{p();C1();Bf();CLr();K1t();NL();Z1t=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){J1t.set(this,void 0),qt(this,J1t,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 fr("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await xe(this,J1t,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(J1t=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},v3e=class extends uie{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await Y1t(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},rk=class extends Z1t{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:{...M1t(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...M1t(this.options.query),after_id:e}}:null}},_a=class extends Z1t{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:{...M1t(this.options.query),page:e}}:null}}});function die(t,e,r){return SLr(),new File(t,e??"unknown_file",r)}function C3e(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 v2c(t){let e=typeof t=="function"?t:t.fetch,r=Gji.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 Gji.set(e,n),n}var SLr,TLr,FEe,Gji,C2c,b2c,bLr,UEe=ve(()=>{p();MEe();SLr=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(die,"makeFile");a(C3e,"getName");TLr=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),FEe=a(async(t,e,r=!0)=>({...t,body:await C2c(t.body,e,r)}),"multipartFormRequestOptions"),Gji=new WeakMap;a(v2c,"supportsFormData");C2c=a(async(t,e,r=!0)=>{if(!await v2c(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])=>bLr(n,o,s,r))),n},"createForm"),b2c=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),bLr=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,die([await r.blob()],C3e(r,n),o))}else if(TLr(r))t.append(e,die([await new Response(B1t(r)).blob()],C3e(r,n)));else if(b2c(r))t.append(e,die([r],C3e(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>bLr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>bLr(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 X1t(t,e,r){if(SLr(),t=await t,e||(e=C3e(t,!0)),S2c(t))return t instanceof File&&e==null&&r==null?t:die([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(T2c(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),die(await ILr(o),e,r)}let n=await ILr(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 die(n,e,r)}async function ILr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if($ji(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(TLr(t))for await(let r of t)e.push(...await ILr(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${I2c(t)}`)}return e}function I2c(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var $ji,S2c,T2c,Vji=ve(()=>{p();UEe();UEe();$ji=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"),S2c=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&$ji(t),"isFileLike"),T2c=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(X1t,"toFile");a(ILr,"getBytes");a(I2c,"propsForError")});var xLr=ve(()=>{p();Vji()});var Wji=ve(()=>{p()});var Ai,Ul=ve(()=>{p();Ai=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*w2c(t){if(!t)return;if(zji 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():X4r(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=X4r(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 zji,vt,vc=ve(()=>{p();NL();zji=Symbol.for("brand.privateNullableHeaders");a(w2c,"iterateHeaders");vt=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of w2c(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{[zji]:!0,values:e,nulls:r}},"buildHeaders")});function eSt(t){return typeof t=="object"&&t!==null&&b3e in t}function wLr(t,e){let r=new Set;if(t)for(let n of t)eSt(n)&&r.add(n[b3e]);if(e){for(let n of e)if(eSt(n)&&r.add(n[b3e]),Array.isArray(n.content))for(let o of n.content)eSt(o)&&r.add(o[b3e])}return Array.from(r)}function tSt(t,e){let r=wLr(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function Yji(t){return eSt(t)?{"x-stainless-helper":t[b3e]}:{}}var b3e,S3e=ve(()=>{p();b3e=Symbol("anthropic.sdk.stainlessHelper");a(eSt,"wasCreatedByStainlessHelper");a(wLr,"collectStainlessHelpers");a(tSt,"stainlessHelperHeader");a(Yji,"stainlessHelperHeaderFromFile")});function Jji(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Kji,R2c,or,Ff=ve(()=>{p();Bf();a(Jji,"encodeURIPath");Kji=Object.freeze(Object.create(null)),R2c=a((t=Jji)=>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??Kji)??Kji)?.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 fr(`Path parameters result in path with invalid segments: ${s.map(m=>m.error).join(` `)} ${c} -${h}`)}return c},"path"),"createPathTagFunction"),or=b2c(Wji)});var UEe,wLr=ve(()=>{p();Ul();_d();vc();C3e();FEe();Ff();UEe=class extends Ai{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",tk,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/files/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/files/${e}/content?beta=true`,{...n,headers:vt([{"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(or`/v1/files/${e}?beta=true`,{...n,headers:vt([{"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",BEe({body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},$ji(o.file),r?.headers])},this._client))}}});var QEe,RLr=ve(()=>{p();Ul();_d();vc();Ff();QEe=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/models/${e}?beta=true`,{...n,headers:vt([{...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",tk,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var qEe,kLr=ve(()=>{p();Ul();_d();vc();Ff();qEe=class extends Ai{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:vt([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/user_profiles/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:vt([{"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",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var Yji=I(tSt=>{"use strict";p();Object.defineProperty(tSt,"__esModule",{value:!0});tSt.timingSafeEqual=void 0;function zji(t,e=""){if(!t)throw new Error(e)}a(zji,"assert");function x2c(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)),zji(t instanceof DataView),zji(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var w2c=_I&&_I.__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(_I,"__esModule",{value:!0});var Um=256,PLr=(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&Um,l|=d&Um,l|=f&Um,l|=h&Um;if(c>>4,l|=u&Um,l|=d&Um),c>>2,l|=f&Um),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=Um;return r+=(42-e&e-44)>>>8&-Um+e-43+62,r+=(46-e&e-48)>>>8&-Um+e-47+63,r+=(47-e&e-58)>>>8&-Um+e-48+52,r+=(64-e&e-91)>>>8&-Um+e-65+0,r+=(96-e&e-123)>>>8&-Um+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})();_I.Coder=PLr;var b3e=new PLr;function R2c(t){return b3e.encode(t)}a(R2c,"encode");_I.encode=R2c;function k2c(t){return b3e.decode(t)}a(k2c,"decode");_I.decode=k2c;var Kji=(function(t){w2c(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=Um;return n+=(44-r&r-46)>>>8&-Um+r-45+62,n+=(94-r&r-96)>>>8&-Um+r-95+63,n+=(47-r&r-58)>>>8&-Um+r-48+52,n+=(64-r&r-91)>>>8&-Um+r-65+0,n+=(96-r&r-123)>>>8&-Um+r-97+26,n},e})(PLr);_I.URLSafeCoder=Kji;var Jji=new Kji;function P2c(t){return Jji.encode(t)}a(P2c,"encodeURLSafe");_I.encodeURLSafe=P2c;function D2c(t){return Jji.decode(t)}a(D2c,"decodeURLSafe");_I.decodeURLSafe=D2c;_I.encodedLength=function(t){return b3e.encodedLength(t)};_I.maxDecodedLength=function(t){return b3e.maxDecodedLength(t)};_I.decodedLength=function(t){return b3e.decodedLength(t)}});var eHi=I((Xji,rSt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof rSt=="object"&&typeof rSt.exports=="object"?rSt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(Xji,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,b,T,w,R,x,P,D,N,L,B;y>=64;){for(E=m[0],_=m[1],v=m[2],b=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++)P=h[D-2],L=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=h[D-15],B=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>3,h[D]=(L+h[D-7]|0)+(B+h[D-16]|0);for(D=0;D<64;D++)L=(((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=((E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10))+(E&_^E&v^_&v)|0,x=R,R=w,w=T,T=b+L|0,b=v,v=_,_=E,E=L+B|0;m[0]+=E,m[1]+=_,m[2]+=v,m[3]+=b,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,E=g<<3,_=g%64<56?64:128;this.buffer[A]=128;for(var v=A+1;v<_-8;v++)this.buffer[v]=0;this.buffer[_-8]=y>>>24&255,this.buffer[_-7]=y>>>16&255,this.buffer[_-6]=y>>>8&255,this.buffer[_-5]=y>>>0&255,this.buffer[_-4]=E>>>24&255,this.buffer[_-3]=E>>>16&255,this.buffer[_-2]=E>>>8&255,this.buffer[_-1]=E>>>0&255,r(this.temp,this.state,this.buffer,0,_),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]),E=c(m,h),_=new o(E),v=new Uint8Array(_.digestLength),b=v.length,T=new Uint8Array(A),w=0;w>>24&255,_[1]=R>>>16&255,_[2]=R>>>8&255,_[3]=R>>>0&255,y.reset(),y.update(m),y.update(_),y.finish(b);for(var x=0;x{"use strict";p();Object.defineProperty(jEe,"__esModule",{value:!0});jEe.Webhook=jEe.WebhookVerificationError=void 0;var N2c=Yji(),tHi=Zji(),M2c=eHi(),rHi=300,DLr=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}},IV=class t extends DLr{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};jEe.WebhookVerificationError=IV;var nSt=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=tHi.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 IV("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,N2c.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new IV("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,${tHi.encode(M2c.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new IV("Invalid Signature Headers");if(r-n>rHi)throw new IV("Message timestamp too old");if(n>r+rHi)throw new IV("Message timestamp too new");return new Date(n*1e3)}};jEe.Webhook=nSt;nSt.prefix="whsec_"});var iHi,HEe,NLr=ve(()=>{p();Ul();iHi=de(nHi(),1),HEe=class extends Ai{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 iHi.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var GEe,MLr=ve(()=>{p();Ul();_d();vc();Ff();GEe=class extends Ai{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/agents/${e}/versions?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var fie,OLr=ve(()=>{p();Ul();MLr();MLr();_d();vc();Ff();fie=class extends Ai{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new GEe(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(or`/v1/agents/${e}?beta=true`,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/agents/${e}?beta=true`,{body:s,...n,headers:vt([{"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",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/agents/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};fie.Versions=GEe});function pie(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 iSt=ve(()=>{p();a(pie,"linkAbort")});function xV(t,e){return t instanceof Ch&&t.status===e}function oHi(t){return t instanceof Ch&&typeof t.status=="number"&&t.status>=400&&t.status<500}function wV(t){return oHi(t)&&!xV(t,408)&&!xV(t,409)&&!xV(t,429)}function sHi(t,e,r){return Math.min(e*2**t,r)}function LLr(t,e){return t+Math.random()*(e-t)}function aHi(t){return t*(1-Math.random()*.25)}var S3e=ve(()=>{p();Bf();a(xV,"isStatus");a(oHi,"is4xx");a(wV,"isFatal4xx");a(sHi,"backoff");a(LLr,"jitter");a(aHi,"applyJitter")});function oSt(t,{authToken:e,helper:r}){if(!e)throw new fr(`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=vt([c,o,{"x-stainless-helper":r}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:l})}var BLr=ve(()=>{p();Bf();vc();a(oSt,"copyClientForHelper")});function q2c(t){return sHi(t,U2c,Q2c)}function j2c(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${vEe()}`:vEe()}var $Ee,sSt,rk,aSt,cSt,lSt,T3e,I3e,VEe,F2c,U2c,Q2c,RV,uSt=ve(()=>{p();C1();Bf();b9();DEe();D1t();iSt();vc();S3e();BLr();S3e();F2c=999,U2c=1e3,Q2c=6e4,RV=class{static{a(this,"WorkPoller")}constructor(e){$Ee.set(this,void 0),sSt.set(this,!1),rk.set(this,void 0),aSt.set(this,void 0),cSt.set(this,void 0),lSt.set(this,void 0),T3e.set(this,void 0),I3e.set(this,void 0),VEe.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??j2c(),qt(this,$Ee,oSt(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),qt(this,cSt,e.autoStop??!0,"f"),qt(this,lSt,e.drain??!1,"f"),qt(this,T3e,e.blockMs===void 0?F2c:e.blockMs,"f"),qt(this,I3e,e.reclaimOlderThanMs??null,"f"),qt(this,VEe,e.requestOptions,"f"),qt(this,rk,new AbortController,"f"),qt(this,aSt,pie(e.signal,xe(this,rk,"f")),"f")}get signal(){return xe(this,rk,"f").signal}abort(){xe(this,rk,"f").abort()}async*[($Ee=new WeakMap,sSt=new WeakMap,rk=new WeakMap,aSt=new WeakMap,cSt=new WeakMap,lSt=new WeakMap,T3e=new WeakMap,I3e=new WeakMap,VEe=new WeakMap,Symbol.asyncIterator)](){if(xe(this,sSt,"f"))throw new fr("Cannot iterate over a consumed WorkPoller");qt(this,sSt,!0,"f");let e=gl(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!xe(this,rk,"f").signal.aborted;){let n;try{n=await xe(this,$Ee,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...xe(this,T3e,"f")!==null?{block_ms:xe(this,T3e,"f")}:{},...xe(this,I3e,"f")!==null?{reclaim_older_than_ms:xe(this,I3e,"f")}:{}},{headers:vt([xe(this,VEe,"f")?.headers]),signal:xe(this,rk,"f").signal})}catch(o){if(xe(this,rk,"f").signal.aborted)return;if(wV(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=aHi(q2c(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await TN(s,xe(this,rk,"f").signal);continue}if(r=0,n==null){if(xe(this,lSt,"f"))return;await TN(LLr(1e3,3e3),xe(this,rk,"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 xe(this,$Ee,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,VEe,"f")?.headers]),signal:xe(this,rk,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(xe(this,cSt,"f"))try{await xe(this,$Ee,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,VEe,"f")?.headers])})}catch(o){xV(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{xe(this,aSt,"f").call(this)}}};a(q2c,"backoff");a(j2c,"defaultWorkerId")});var WEe,kV,zEe,dSt,cHi=ve(()=>{p();C1();dSt=class{static{a(this,"AsyncQueue")}constructor(){WEe.set(this,[]),kV.set(this,[]),zEe.set(this,!1)}push(e){if(xe(this,zEe,"f"))return!1;let r=xe(this,kV,"f").shift();return r?r({done:!1,value:e}):xe(this,WEe,"f").push(e),!0}close(){if(!xe(this,zEe,"f"))for(qt(this,zEe,!0,"f");xe(this,kV,"f").length>0;)xe(this,kV,"f").shift()({done:!0,value:void 0})}next(e){return xe(this,WEe,"f").length>0?Promise.resolve({done:!1,value:xe(this,WEe,"f").shift()}):xe(this,zEe,"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=xe(this,kV,"f").indexOf(n);s>=0&&xe(this,kV,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");xe(this,kV,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return xe(this,WEe,"f").shift()}};WEe=new WeakMap,kV=new WeakMap,zEe=new WeakMap});var _o,hie=ve(()=>{p();_o=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 FLr(t){return"name"in t?t.name:t.mcp_server_name}function H2c(t){return t instanceof _o?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function lHi(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:H2c(n),isError:!0}}}var uHi=ve(()=>{p();hie();a(FLr,"toolName");a(H2c,"toolErrorContent");a(lHi,"runRunnableTool")});function AHi(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function Y2c(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 K2c(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 B0,fSt,Iy,pSt,w3e,mSt,r_,YEe,LL,mie,T9,R3e,KEe,hSt,yHi,dHi,fHi,pHi,ULr,x3e,QLr,hHi,EHi,G2c,mHi,$2c,V2c,W2c,gHi,z2c,PV,gSt=ve(()=>{p();C1();Bf();b9();DEe();S3e();iSt();cHi();vc();uHi();G2c="SessionToolRunner",mHi=500,$2c=1e4,V2c=12e4,W2c=3e4,gHi=3,z2c=6e4;a(AHi,"isEndTurnIdle");PV=class{static{a(this,"SessionToolRunner")}constructor(e,r){B0.add(this),fSt.set(this,!1),Iy.set(this,void 0),pSt.set(this,void 0),w3e.set(this,void 0),mSt.set(this,void 0),r_.set(this,void 0),YEe.set(this,new Set),LL.set(this,new Set),mie.set(this,new dSt),T9.set(this,0),R3e.set(this,null),KEe.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??z2c,qt(this,r_,gl(r.client),"f"),qt(this,mSt,new Map(r.tools.map(n=>[FLr(n),n])),"f"),qt(this,Iy,new AbortController,"f"),qt(this,pSt,pie(r.signal,xe(this,Iy,"f")),"f"),qt(this,w3e,r.requestOptions,"f")}get signal(){return xe(this,Iy,"f").signal}abort(){xe(this,Iy,"f").abort()}async*[(fSt=new WeakMap,Iy=new WeakMap,pSt=new WeakMap,w3e=new WeakMap,mSt=new WeakMap,r_=new WeakMap,YEe=new WeakMap,LL=new WeakMap,mie=new WeakMap,T9=new WeakMap,R3e=new WeakMap,KEe=new WeakMap,B0=new WeakSet,Symbol.asyncIterator)](){if(xe(this,fSt,"f"))throw new fr("Cannot iterate over a consumed SessionToolRunner");qt(this,fSt,!0,"f"),xe(this,r_,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=xe(this,B0,"m",yHi).call(this).catch(r=>{xe(this,Iy,"f").signal.aborted||xe(this,r_,"f").error("stream loop failed",{error:String(r)}),xe(this,Iy,"f").abort()});try{for(;;){let n=await xe(this,mie,"f").next(xe(this,Iy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=xe(this,mie,"f").tryShift())!==void 0;)yield r}finally{xe(this,Iy,"f").abort(),xe(this,B0,"m",x3e).call(this),await e;try{await xe(this,B0,"m",EHi).call(this)}catch(r){xe(this,r_,"f").warn("drain failed",{error:String(r)})}xe(this,mie,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){xe(this,r_,"f").warn("tool.close failed",{tool:FLr(r),error:String(n)})}xe(this,pSt,"f").call(this)}}};hSt=a(function(){return{...xe(this,w3e,"f"),headers:vt([{"x-stainless-helper":G2c},xe(this,w3e,"f")?.headers]),signal:xe(this,Iy,"f").signal}},"_SessionToolRunner_requestOptions"),yHi=a(async function(){let e=xe(this,Iy,"f"),r=mHi;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},xe(this,B0,"m",hSt).call(this));await xe(this,B0,"m",dHi).call(this);for await(let o of n)if(r=mHi,await xe(this,B0,"m",pHi).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),wV(n))throw xe(this,r_,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;xe(this,r_,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await TN(r,e.signal),r=Math.min(r*2,$2c)}},"_SessionToolRunner_streamLoop"),dHi=a(async function(){let e=xe(this,Iy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},xe(this,B0,"m",hSt).call(this)))xe(this,B0,"m",fHi).call(this,s,r),n=AHi(s)}catch(s){e.signal.throwIfAborted(),xe(this,r_,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)xe(this,YEe,"f").delete(c.id);return}let o=r.filter(s=>!xe(this,LL,"f").has(s.id));n&&o.length===0?xe(this,B0,"m",ULr).call(this):xe(this,B0,"m",x3e).call(this);for(let s of o)await xe(this,B0,"m",QLr).call(this,s)},"_SessionToolRunner_reconcile"),fHi=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(xe(this,YEe,"f").add(e.id),xe(this,LL,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?xe(this,LL,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&xe(this,LL,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),pHi=a(async function(e){switch(AHi(e)?xe(this,B0,"m",ULr).call(this):xe(this,B0,"m",x3e).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return xe(this,YEe,"f").has(e.id)||(xe(this,YEe,"f").add(e.id),await xe(this,B0,"m",QLr).call(this,e)),!1;case"user.tool_result":return xe(this,LL,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return xe(this,LL,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return xe(this,r_,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),xe(this,Iy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),ULr=a(function(){xe(this,B0,"m",x3e).call(this),!(this.maxIdleMs<=0)&&qt(this,KEe,setTimeout(()=>{xe(this,r_,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),xe(this,Iy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),x3e=a(function(){xe(this,KEe,"f")!==void 0&&(clearTimeout(xe(this,KEe,"f")),qt(this,KEe,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),QLr=a(async function(e){var r,n;if(!xe(this,LL,"f").has(e.id)){xe(this,r_,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),qt(this,T9,(r=xe(this,T9,"f"),r++,r),"f");try{let o=xe(this,mSt,"f").get(e.name);if(!o){xe(this,r_,"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}),xe(this,mie,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=pie(xe(this,Iy,"f").signal,l),d=setTimeout(()=>l.abort(),V2c);try{let m=await lHi(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=Y2c(e,c,K2c(s)),h=await xe(this,B0,"m",hHi).call(this,f,e.id);xe(this,mie,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{qt(this,T9,(n=xe(this,T9,"f"),n--,n),"f"),xe(this,T9,"f")===0&&xe(this,R3e,"f")?.call(this)}}},"_SessionToolRunner_execute"),hHi=a(async function(e,r){let n=xe(this,Iy,"f"),o;for(let s=0;sqt(this,R3e,e,"f")),TN(W2c)]),qt(this,R3e,null,"f"),xe(this,T9,"f")>0&&xe(this,r_,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(Y2c,"buildResultEvent");a(K2c,"toSessionContent")});var _Hi=ve(()=>{p();fLr()});function gie(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 vHi=ve(()=>{p();qLr();_Hi();a(gie,"betaTool")});function JEe(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var jLr=ve(()=>{p();a(JEe,"promiseWithResolvers")});async function Z2c(t){try{return await vI.realpath(t)}catch{return t}}async function X2c(t){let e=[],r=t;for(;;){let n;try{n=await vI.realpath(r)}catch{let o=!1;try{o=(await vI.lstat(r)).isSymbolicLink()}catch{}if(o){r=F0.resolve(F0.dirname(r),await vI.readlink(r));continue}let s=F0.dirname(r);if(s===r)return t;e.push(F0.basename(r)),r=s;continue}return e.length?F0.join(n,...e.reverse()):n}}async function bHi(t,e,r){let n=r?.allowOutside??!1;if(F0.isAbsolute(e)){if(!n)throw new _o(`absolute path ${JSON.stringify(e)} not permitted`);return F0.resolve(e)}let o=await Z2c(F0.resolve(t)),s=F0.resolve(o,e);if(n)return s;let c=await X2c(s),l=o.endsWith(F0.sep)?o:o+F0.sep;if(c!==o&&!c.startsWith(l))throw new _o(`path ${JSON.stringify(e)} escapes workdir`);return c}async function HLr(t,e){let r=F0.dirname(t),n=F0.join(r,`.tmp-${process.pid}-${(0,CHi.randomUUID)()}`),o;try{o=await vI.open(n,"wx",J2c),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await vI.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await vI.unlink(n).catch(()=>{}),s}}function P3e(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 vI,F0,CHi,k3e,J2c,GLr=ve(()=>{p();vI=de(require("node:fs/promises"),1),F0=de(require("node:path"),1),CHi=require("node:crypto");hie();k3e=493,J2c=420;a(Z2c,"realpathOrSelf");a(X2c,"canonicalize");a(bHi,"confineToRoot");a(HLr,"atomicWriteFile");a(P3e,"fsErrorMessage")});async function RHi(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=gl(e),o=await e.beta.sessions.retrieve(r),s=xy.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await VLr(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=xy.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=xy.resolve(s,f);if(h!==s&&!h.startsWith(s+xy.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 S1.rm(h,{recursive:!0,force:!0}),await S1.mkdir(h,{recursive:!0,mode:k3e}),c.push(h),await WLr(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 S1.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 VLr(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 fr(`skill ${JSON.stringify(e)} has no concrete version to resolve ${JSON.stringify(r)} against`);return n}function tDc(t){for(let e of t.split(` -`)){let r=e.trim();if(r&&(xy.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new fr(`refusing to extract unsafe archive member: ${r}`)}}function rDc(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 fr("refusing to extract archive with symlink/hardlink/device member")}}async function $Lr(t,e){try{let{stdout:r}=await eDc(t,e);return r}catch(r){throw r!=null&&typeof r=="object"&&r.code==="ENOENT"?new fr(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):r}}function nDc(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 WLr(t,e){let r=xy.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new fr("skill download response had no body");await(0,wHi.pipeline)(xHi.Readable.fromWeb(t.body),SHi.createWriteStream(r));let n=xy.join(xy.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await iDc(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await $Lr(c,s?["-Z1",r]:["-tf",r]);tDc(l),rDc(await $Lr(c,s?["-Z",r]:["-tvf",r]));let u=nDc(l);await S1.mkdir(n,{recursive:!0,mode:k3e}),await $Lr(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?xy.join(n,u):n;for(let f of await S1.readdir(d))await S1.rename(xy.join(d,f),xy.join(e,f))}finally{await S1.rm(r,{force:!0}),await S1.rm(n,{recursive:!0,force:!0})}}async function iDc(t,e){let r=await S1.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 S1,SHi,xy,THi,IHi,xHi,wHi,eDc,kHi=ve(()=>{p();S1=de(require("node:fs/promises"),1),SHi=de(require("node:fs"),1),xy=de(require("node:path"),1),THi=require("node:child_process"),IHi=require("node:util"),xHi=require("node:stream"),wHi=require("node:stream/promises");Bf();b9();GLr();eDc=(0,IHi.promisify)(THi.execFile);a(RHi,"setupSkills");a(VLr,"resolveSkillVersion");a(tDc,"assertSafeMemberNames");a(rDc,"assertNoSpecialMembers");a($Lr,"runArchiveTool");a(nDc,"archiveTopDir");a(WLr,"extractSkillArchive");a(iDc,"readHead")});var HHi={};ki(HHi,{BashSession:()=>ySt,betaAgentToolset20260401:()=>lDc,betaBashTool:()=>BHi,betaEditTool:()=>QHi,betaGlobTool:()=>qHi,betaGrepTool:()=>jHi,betaReadTool:()=>FHi,betaWriteTool:()=>UHi,extractSkillArchive:()=>WLr,resolvePath:()=>ZEe,resolveSkillVersion:()=>VLr,setupSkills:()=>RHi});function lDc(t){return[BHi(t),FHi(t),UHi(t),QHi(t),qHi(t),jHi(t)]}function ZEe(t,e){return bHi(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function uDc(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function BHi(t){let e,r=Promise.resolve();return gie({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=JEe();r=u.promise;try{await l}catch{}try{if(o&&(e?.close(),e=void 0),!n){if(o)return"bash session restarted";throw new _o("bash: command is required")}e??(e=new ySt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??LHi,signal:c?.signal});if(f!==0)throw new _o(d||`exit ${f}`);return d}catch(d){throw d instanceof _o?d:(e.close(),e=void 0,new _o(`bash: ${d instanceof Error?d.message:String(d)}`))}}finally{u.resolve()}},"run"),close:a(()=>{e?.close(),e=void 0},"close")})}function FHi(t){return gie({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 _o("read: file_path is required");let n=await ZEe(t,e),o;try{let f=await n_.stat(n);if(!f.isFile())throw new _o(`read: ${e} is not a regular file`);if(f.size>YLr)throw new _o(`read: ${e} is ${f.size} bytes, exceeds ${YLr}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await n_.readFile(n,"utf8")}catch(f){throw f instanceof _o?f:new _o(`read: ${P3e(f,e)}`)}if(!r)return o;if(r.length!==2)throw new _o("read: view_range must be [start_line, end_line]");let[s,c]=r,l=o.split(` +${h}`)}return c},"path"),"createPathTagFunction"),or=R2c(Jji)});var QEe,RLr=ve(()=>{p();Ul();_d();vc();S3e();UEe();Ff();QEe=class extends Ai{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",rk,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/files/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/files/${e}/content?beta=true`,{...n,headers:vt([{"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(or`/v1/files/${e}?beta=true`,{...n,headers:vt([{"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",FEe({body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},Yji(o.file),r?.headers])},this._client))}}});var qEe,kLr=ve(()=>{p();Ul();_d();vc();Ff();qEe=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/models/${e}?beta=true`,{...n,headers:vt([{...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",rk,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var jEe,PLr=ve(()=>{p();Ul();_d();vc();Ff();jEe=class extends Ai{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:vt([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/user_profiles/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:vt([{"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",_a,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var Xji=I(rSt=>{"use strict";p();Object.defineProperty(rSt,"__esModule",{value:!0});rSt.timingSafeEqual=void 0;function Zji(t,e=""){if(!t)throw new Error(e)}a(Zji,"assert");function N2c(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)),Zji(t instanceof DataView),Zji(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var M2c=CI&&CI.__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(CI,"__esModule",{value:!0});var Um=256,DLr=(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&Um,l|=d&Um,l|=f&Um,l|=h&Um;if(c>>4,l|=u&Um,l|=d&Um),c>>2,l|=f&Um),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=Um;return r+=(42-e&e-44)>>>8&-Um+e-43+62,r+=(46-e&e-48)>>>8&-Um+e-47+63,r+=(47-e&e-58)>>>8&-Um+e-48+52,r+=(64-e&e-91)>>>8&-Um+e-65+0,r+=(96-e&e-123)>>>8&-Um+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})();CI.Coder=DLr;var T3e=new DLr;function O2c(t){return T3e.encode(t)}a(O2c,"encode");CI.encode=O2c;function L2c(t){return T3e.decode(t)}a(L2c,"decode");CI.decode=L2c;var eHi=(function(t){M2c(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=Um;return n+=(44-r&r-46)>>>8&-Um+r-45+62,n+=(94-r&r-96)>>>8&-Um+r-95+63,n+=(47-r&r-58)>>>8&-Um+r-48+52,n+=(64-r&r-91)>>>8&-Um+r-65+0,n+=(96-r&r-123)>>>8&-Um+r-97+26,n},e})(DLr);CI.URLSafeCoder=eHi;var tHi=new eHi;function B2c(t){return tHi.encode(t)}a(B2c,"encodeURLSafe");CI.encodeURLSafe=B2c;function F2c(t){return tHi.decode(t)}a(F2c,"decodeURLSafe");CI.decodeURLSafe=F2c;CI.encodedLength=function(t){return T3e.encodedLength(t)};CI.maxDecodedLength=function(t){return T3e.maxDecodedLength(t)};CI.decodedLength=function(t){return T3e.decodedLength(t)}});var iHi=I((nHi,nSt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof nSt=="object"&&typeof nSt.exports=="object"?nSt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(nHi,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,b,T,w,R,x,P,D,N,L,B;y>=64;){for(E=m[0],_=m[1],v=m[2],b=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++)P=h[D-2],L=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=h[D-15],B=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>3,h[D]=(L+h[D-7]|0)+(B+h[D-16]|0);for(D=0;D<64;D++)L=(((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=((E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10))+(E&_^E&v^_&v)|0,x=R,R=w,w=T,T=b+L|0,b=v,v=_,_=E,E=L+B|0;m[0]+=E,m[1]+=_,m[2]+=v,m[3]+=b,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,E=g<<3,_=g%64<56?64:128;this.buffer[A]=128;for(var v=A+1;v<_-8;v++)this.buffer[v]=0;this.buffer[_-8]=y>>>24&255,this.buffer[_-7]=y>>>16&255,this.buffer[_-6]=y>>>8&255,this.buffer[_-5]=y>>>0&255,this.buffer[_-4]=E>>>24&255,this.buffer[_-3]=E>>>16&255,this.buffer[_-2]=E>>>8&255,this.buffer[_-1]=E>>>0&255,r(this.temp,this.state,this.buffer,0,_),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]),E=c(m,h),_=new o(E),v=new Uint8Array(_.digestLength),b=v.length,T=new Uint8Array(A),w=0;w>>24&255,_[1]=R>>>16&255,_[2]=R>>>8&255,_[3]=R>>>0&255,y.reset(),y.update(m),y.update(_),y.finish(b);for(var x=0;x{"use strict";p();Object.defineProperty(HEe,"__esModule",{value:!0});HEe.Webhook=HEe.WebhookVerificationError=void 0;var U2c=Xji(),oHi=rHi(),Q2c=iHi(),sHi=300,NLr=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}},xV=class t extends NLr{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};HEe.WebhookVerificationError=xV;var iSt=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=oHi.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 xV("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,U2c.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new xV("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,${oHi.encode(Q2c.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new xV("Invalid Signature Headers");if(r-n>sHi)throw new xV("Message timestamp too old");if(n>r+sHi)throw new xV("Message timestamp too new");return new Date(n*1e3)}};HEe.Webhook=iSt;iSt.prefix="whsec_"});var cHi,GEe,MLr=ve(()=>{p();Ul();cHi=de(aHi(),1),GEe=class extends Ai{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 cHi.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var $Ee,OLr=ve(()=>{p();Ul();_d();vc();Ff();$Ee=class extends Ai{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/agents/${e}/versions?beta=true`,_a,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var fie,LLr=ve(()=>{p();Ul();OLr();OLr();_d();vc();Ff();fie=class extends Ai{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new $Ee(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(or`/v1/agents/${e}?beta=true`,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/agents/${e}?beta=true`,{body:s,...n,headers:vt([{"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",_a,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/agents/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};fie.Versions=$Ee});function pie(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 oSt=ve(()=>{p();a(pie,"linkAbort")});function wV(t,e){return t instanceof Ch&&t.status===e}function lHi(t){return t instanceof Ch&&typeof t.status=="number"&&t.status>=400&&t.status<500}function RV(t){return lHi(t)&&!wV(t,408)&&!wV(t,409)&&!wV(t,429)}function uHi(t,e,r){return Math.min(e*2**t,r)}function BLr(t,e){return t+Math.random()*(e-t)}function dHi(t){return t*(1-Math.random()*.25)}var I3e=ve(()=>{p();Bf();a(wV,"isStatus");a(lHi,"is4xx");a(RV,"isFatal4xx");a(uHi,"backoff");a(BLr,"jitter");a(dHi,"applyJitter")});function sSt(t,{authToken:e,helper:r}){if(!e)throw new fr(`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=vt([c,o,{"x-stainless-helper":r}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:l})}var FLr=ve(()=>{p();Bf();vc();a(sSt,"copyClientForHelper")});function W2c(t){return uHi(t,$2c,V2c)}function z2c(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${CEe()}`:CEe()}var VEe,aSt,nk,cSt,lSt,uSt,x3e,w3e,WEe,G2c,$2c,V2c,kV,dSt=ve(()=>{p();C1();Bf();S9();NEe();N1t();oSt();vc();I3e();FLr();I3e();G2c=999,$2c=1e3,V2c=6e4,kV=class{static{a(this,"WorkPoller")}constructor(e){VEe.set(this,void 0),aSt.set(this,!1),nk.set(this,void 0),cSt.set(this,void 0),lSt.set(this,void 0),uSt.set(this,void 0),x3e.set(this,void 0),w3e.set(this,void 0),WEe.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??z2c(),qt(this,VEe,sSt(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),qt(this,lSt,e.autoStop??!0,"f"),qt(this,uSt,e.drain??!1,"f"),qt(this,x3e,e.blockMs===void 0?G2c:e.blockMs,"f"),qt(this,w3e,e.reclaimOlderThanMs??null,"f"),qt(this,WEe,e.requestOptions,"f"),qt(this,nk,new AbortController,"f"),qt(this,cSt,pie(e.signal,xe(this,nk,"f")),"f")}get signal(){return xe(this,nk,"f").signal}abort(){xe(this,nk,"f").abort()}async*[(VEe=new WeakMap,aSt=new WeakMap,nk=new WeakMap,cSt=new WeakMap,lSt=new WeakMap,uSt=new WeakMap,x3e=new WeakMap,w3e=new WeakMap,WEe=new WeakMap,Symbol.asyncIterator)](){if(xe(this,aSt,"f"))throw new fr("Cannot iterate over a consumed WorkPoller");qt(this,aSt,!0,"f");let e=gl(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!xe(this,nk,"f").signal.aborted;){let n;try{n=await xe(this,VEe,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...xe(this,x3e,"f")!==null?{block_ms:xe(this,x3e,"f")}:{},...xe(this,w3e,"f")!==null?{reclaim_older_than_ms:xe(this,w3e,"f")}:{}},{headers:vt([xe(this,WEe,"f")?.headers]),signal:xe(this,nk,"f").signal})}catch(o){if(xe(this,nk,"f").signal.aborted)return;if(RV(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=dHi(W2c(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await IN(s,xe(this,nk,"f").signal);continue}if(r=0,n==null){if(xe(this,uSt,"f"))return;await IN(BLr(1e3,3e3),xe(this,nk,"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 xe(this,VEe,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,WEe,"f")?.headers]),signal:xe(this,nk,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(xe(this,lSt,"f"))try{await xe(this,VEe,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,WEe,"f")?.headers])})}catch(o){wV(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{xe(this,cSt,"f").call(this)}}};a(W2c,"backoff");a(z2c,"defaultWorkerId")});var zEe,PV,YEe,fSt,fHi=ve(()=>{p();C1();fSt=class{static{a(this,"AsyncQueue")}constructor(){zEe.set(this,[]),PV.set(this,[]),YEe.set(this,!1)}push(e){if(xe(this,YEe,"f"))return!1;let r=xe(this,PV,"f").shift();return r?r({done:!1,value:e}):xe(this,zEe,"f").push(e),!0}close(){if(!xe(this,YEe,"f"))for(qt(this,YEe,!0,"f");xe(this,PV,"f").length>0;)xe(this,PV,"f").shift()({done:!0,value:void 0})}next(e){return xe(this,zEe,"f").length>0?Promise.resolve({done:!1,value:xe(this,zEe,"f").shift()}):xe(this,YEe,"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=xe(this,PV,"f").indexOf(n);s>=0&&xe(this,PV,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");xe(this,PV,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return xe(this,zEe,"f").shift()}};zEe=new WeakMap,PV=new WeakMap,YEe=new WeakMap});var vo,hie=ve(()=>{p();vo=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 ULr(t){return"name"in t?t.name:t.mcp_server_name}function Y2c(t){return t instanceof vo?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function pHi(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:Y2c(n),isError:!0}}}var hHi=ve(()=>{p();hie();a(ULr,"toolName");a(Y2c,"toolErrorContent");a(pHi,"runRunnableTool")});function vHi(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function tDc(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 rDc(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 B0,pSt,Iy,hSt,k3e,gSt,r_,KEe,LL,mie,I9,P3e,JEe,mSt,CHi,mHi,gHi,AHi,QLr,R3e,qLr,yHi,bHi,K2c,EHi,J2c,Z2c,X2c,_Hi,eDc,DV,ASt=ve(()=>{p();C1();Bf();S9();NEe();I3e();oSt();fHi();vc();hHi();K2c="SessionToolRunner",EHi=500,J2c=1e4,Z2c=12e4,X2c=3e4,_Hi=3,eDc=6e4;a(vHi,"isEndTurnIdle");DV=class{static{a(this,"SessionToolRunner")}constructor(e,r){B0.add(this),pSt.set(this,!1),Iy.set(this,void 0),hSt.set(this,void 0),k3e.set(this,void 0),gSt.set(this,void 0),r_.set(this,void 0),KEe.set(this,new Set),LL.set(this,new Set),mie.set(this,new fSt),I9.set(this,0),P3e.set(this,null),JEe.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??eDc,qt(this,r_,gl(r.client),"f"),qt(this,gSt,new Map(r.tools.map(n=>[ULr(n),n])),"f"),qt(this,Iy,new AbortController,"f"),qt(this,hSt,pie(r.signal,xe(this,Iy,"f")),"f"),qt(this,k3e,r.requestOptions,"f")}get signal(){return xe(this,Iy,"f").signal}abort(){xe(this,Iy,"f").abort()}async*[(pSt=new WeakMap,Iy=new WeakMap,hSt=new WeakMap,k3e=new WeakMap,gSt=new WeakMap,r_=new WeakMap,KEe=new WeakMap,LL=new WeakMap,mie=new WeakMap,I9=new WeakMap,P3e=new WeakMap,JEe=new WeakMap,B0=new WeakSet,Symbol.asyncIterator)](){if(xe(this,pSt,"f"))throw new fr("Cannot iterate over a consumed SessionToolRunner");qt(this,pSt,!0,"f"),xe(this,r_,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=xe(this,B0,"m",CHi).call(this).catch(r=>{xe(this,Iy,"f").signal.aborted||xe(this,r_,"f").error("stream loop failed",{error:String(r)}),xe(this,Iy,"f").abort()});try{for(;;){let n=await xe(this,mie,"f").next(xe(this,Iy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=xe(this,mie,"f").tryShift())!==void 0;)yield r}finally{xe(this,Iy,"f").abort(),xe(this,B0,"m",R3e).call(this),await e;try{await xe(this,B0,"m",bHi).call(this)}catch(r){xe(this,r_,"f").warn("drain failed",{error:String(r)})}xe(this,mie,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){xe(this,r_,"f").warn("tool.close failed",{tool:ULr(r),error:String(n)})}xe(this,hSt,"f").call(this)}}};mSt=a(function(){return{...xe(this,k3e,"f"),headers:vt([{"x-stainless-helper":K2c},xe(this,k3e,"f")?.headers]),signal:xe(this,Iy,"f").signal}},"_SessionToolRunner_requestOptions"),CHi=a(async function(){let e=xe(this,Iy,"f"),r=EHi;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},xe(this,B0,"m",mSt).call(this));await xe(this,B0,"m",mHi).call(this);for await(let o of n)if(r=EHi,await xe(this,B0,"m",AHi).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),RV(n))throw xe(this,r_,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;xe(this,r_,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await IN(r,e.signal),r=Math.min(r*2,J2c)}},"_SessionToolRunner_streamLoop"),mHi=a(async function(){let e=xe(this,Iy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},xe(this,B0,"m",mSt).call(this)))xe(this,B0,"m",gHi).call(this,s,r),n=vHi(s)}catch(s){e.signal.throwIfAborted(),xe(this,r_,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)xe(this,KEe,"f").delete(c.id);return}let o=r.filter(s=>!xe(this,LL,"f").has(s.id));n&&o.length===0?xe(this,B0,"m",QLr).call(this):xe(this,B0,"m",R3e).call(this);for(let s of o)await xe(this,B0,"m",qLr).call(this,s)},"_SessionToolRunner_reconcile"),gHi=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(xe(this,KEe,"f").add(e.id),xe(this,LL,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?xe(this,LL,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&xe(this,LL,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),AHi=a(async function(e){switch(vHi(e)?xe(this,B0,"m",QLr).call(this):xe(this,B0,"m",R3e).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return xe(this,KEe,"f").has(e.id)||(xe(this,KEe,"f").add(e.id),await xe(this,B0,"m",qLr).call(this,e)),!1;case"user.tool_result":return xe(this,LL,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return xe(this,LL,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return xe(this,r_,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),xe(this,Iy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),QLr=a(function(){xe(this,B0,"m",R3e).call(this),!(this.maxIdleMs<=0)&&qt(this,JEe,setTimeout(()=>{xe(this,r_,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),xe(this,Iy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),R3e=a(function(){xe(this,JEe,"f")!==void 0&&(clearTimeout(xe(this,JEe,"f")),qt(this,JEe,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),qLr=a(async function(e){var r,n;if(!xe(this,LL,"f").has(e.id)){xe(this,r_,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),qt(this,I9,(r=xe(this,I9,"f"),r++,r),"f");try{let o=xe(this,gSt,"f").get(e.name);if(!o){xe(this,r_,"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}),xe(this,mie,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=pie(xe(this,Iy,"f").signal,l),d=setTimeout(()=>l.abort(),Z2c);try{let m=await pHi(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=tDc(e,c,rDc(s)),h=await xe(this,B0,"m",yHi).call(this,f,e.id);xe(this,mie,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{qt(this,I9,(n=xe(this,I9,"f"),n--,n),"f"),xe(this,I9,"f")===0&&xe(this,P3e,"f")?.call(this)}}},"_SessionToolRunner_execute"),yHi=a(async function(e,r){let n=xe(this,Iy,"f"),o;for(let s=0;s<_Hi;s++){n.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[e]},xe(this,B0,"m",mSt).call(this)),xe(this,LL,"f").add(r),!0}catch(c){if(o=c,RV(c))break;s<_Hi-1&&await IN((s+1)*1e3,n.signal)}}return xe(this,r_,"f").error("failed to send tool result",{tool_use_id:r,error:String(o)}),!1},"_SessionToolRunner_sendResult"),bHi=a(async function(){xe(this,I9,"f")!==0&&(await Promise.race([new Promise(e=>qt(this,P3e,e,"f")),IN(X2c)]),qt(this,P3e,null,"f"),xe(this,I9,"f")>0&&xe(this,r_,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(tDc,"buildResultEvent");a(rDc,"toSessionContent")});var SHi=ve(()=>{p();pLr()});function gie(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 THi=ve(()=>{p();jLr();SHi();a(gie,"betaTool")});function ZEe(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var HLr=ve(()=>{p();a(ZEe,"promiseWithResolvers")});async function iDc(t){try{return await bI.realpath(t)}catch{return t}}async function oDc(t){let e=[],r=t;for(;;){let n;try{n=await bI.realpath(r)}catch{let o=!1;try{o=(await bI.lstat(r)).isSymbolicLink()}catch{}if(o){r=F0.resolve(F0.dirname(r),await bI.readlink(r));continue}let s=F0.dirname(r);if(s===r)return t;e.push(F0.basename(r)),r=s;continue}return e.length?F0.join(n,...e.reverse()):n}}async function xHi(t,e,r){let n=r?.allowOutside??!1;if(F0.isAbsolute(e)){if(!n)throw new vo(`absolute path ${JSON.stringify(e)} not permitted`);return F0.resolve(e)}let o=await iDc(F0.resolve(t)),s=F0.resolve(o,e);if(n)return s;let c=await oDc(s),l=o.endsWith(F0.sep)?o:o+F0.sep;if(c!==o&&!c.startsWith(l))throw new vo(`path ${JSON.stringify(e)} escapes workdir`);return c}async function GLr(t,e){let r=F0.dirname(t),n=F0.join(r,`.tmp-${process.pid}-${(0,IHi.randomUUID)()}`),o;try{o=await bI.open(n,"wx",nDc),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await bI.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await bI.unlink(n).catch(()=>{}),s}}function N3e(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 bI,F0,IHi,D3e,nDc,$Lr=ve(()=>{p();bI=de(require("node:fs/promises"),1),F0=de(require("node:path"),1),IHi=require("node:crypto");hie();D3e=493,nDc=420;a(iDc,"realpathOrSelf");a(oDc,"canonicalize");a(xHi,"confineToRoot");a(GLr,"atomicWriteFile");a(N3e,"fsErrorMessage")});async function NHi(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=gl(e),o=await e.beta.sessions.retrieve(r),s=xy.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await WLr(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=xy.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=xy.resolve(s,f);if(h!==s&&!h.startsWith(s+xy.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 S1.rm(h,{recursive:!0,force:!0}),await S1.mkdir(h,{recursive:!0,mode:D3e}),c.push(h),await zLr(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 S1.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 WLr(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 fr(`skill ${JSON.stringify(e)} has no concrete version to resolve ${JSON.stringify(r)} against`);return n}function aDc(t){for(let e of t.split(` +`)){let r=e.trim();if(r&&(xy.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new fr(`refusing to extract unsafe archive member: ${r}`)}}function cDc(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 fr("refusing to extract archive with symlink/hardlink/device member")}}async function VLr(t,e){try{let{stdout:r}=await sDc(t,e);return r}catch(r){throw r!=null&&typeof r=="object"&&r.code==="ENOENT"?new fr(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):r}}function lDc(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 zLr(t,e){let r=xy.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new fr("skill download response had no body");await(0,DHi.pipeline)(PHi.Readable.fromWeb(t.body),wHi.createWriteStream(r));let n=xy.join(xy.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await uDc(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await VLr(c,s?["-Z1",r]:["-tf",r]);aDc(l),cDc(await VLr(c,s?["-Z",r]:["-tvf",r]));let u=lDc(l);await S1.mkdir(n,{recursive:!0,mode:D3e}),await VLr(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?xy.join(n,u):n;for(let f of await S1.readdir(d))await S1.rename(xy.join(d,f),xy.join(e,f))}finally{await S1.rm(r,{force:!0}),await S1.rm(n,{recursive:!0,force:!0})}}async function uDc(t,e){let r=await S1.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 S1,wHi,xy,RHi,kHi,PHi,DHi,sDc,MHi=ve(()=>{p();S1=de(require("node:fs/promises"),1),wHi=de(require("node:fs"),1),xy=de(require("node:path"),1),RHi=require("node:child_process"),kHi=require("node:util"),PHi=require("node:stream"),DHi=require("node:stream/promises");Bf();S9();$Lr();sDc=(0,kHi.promisify)(RHi.execFile);a(NHi,"setupSkills");a(WLr,"resolveSkillVersion");a(aDc,"assertSafeMemberNames");a(cDc,"assertNoSpecialMembers");a(VLr,"runArchiveTool");a(lDc,"archiveTopDir");a(zLr,"extractSkillArchive");a(uDc,"readHead")});var WHi={};ki(WHi,{BashSession:()=>ESt,betaAgentToolset20260401:()=>mDc,betaBashTool:()=>qHi,betaEditTool:()=>GHi,betaGlobTool:()=>$Hi,betaGrepTool:()=>VHi,betaReadTool:()=>jHi,betaWriteTool:()=>HHi,extractSkillArchive:()=>zLr,resolvePath:()=>XEe,resolveSkillVersion:()=>WLr,setupSkills:()=>NHi});function mDc(t){return[qHi(t),jHi(t),HHi(t),GHi(t),$Hi(t),VHi(t)]}function XEe(t,e){return xHi(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function gDc(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function qHi(t){let e,r=Promise.resolve();return gie({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=ZEe();r=u.promise;try{await l}catch{}try{if(o&&(e?.close(),e=void 0),!n){if(o)return"bash session restarted";throw new vo("bash: command is required")}e??(e=new ESt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??QHi,signal:c?.signal});if(f!==0)throw new vo(d||`exit ${f}`);return d}catch(d){throw d instanceof vo?d:(e.close(),e=void 0,new vo(`bash: ${d instanceof Error?d.message:String(d)}`))}}finally{u.resolve()}},"run"),close:a(()=>{e?.close(),e=void 0},"close")})}function jHi(t){return gie({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 vo("read: file_path is required");let n=await XEe(t,e),o;try{let f=await n_.stat(n);if(!f.isFile())throw new vo(`read: ${e} is not a regular file`);if(f.size>KLr)throw new vo(`read: ${e} is ${f.size} bytes, exceeds ${KLr}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await n_.readFile(n,"utf8")}catch(f){throw f instanceof vo?f:new vo(`read: ${N3e(f,e)}`)}if(!r)return o;if(r.length!==2)throw new vo("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 UHi(t){return gie({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 _o("write: file_path is required");let n=await ZEe(t,e);try{await n_.mkdir(Uf.dirname(n),{recursive:!0,mode:k3e}),await HLr(n,r??"")}catch(o){throw new _o(`write: ${P3e(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function QHi(t){return gie({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 _o("edit: file_path is required");if(!r)throw new _o("edit: old_string is required");let s=await ZEe(t,e),c;try{let d=await n_.stat(s);if(!d.isFile())throw new _o(`edit: ${e} is not a regular file`);if(d.size>DHi)throw new _o(`edit: ${e} is ${d.size} bytes, exceeds ${DHi}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await n_.readFile(s,"utf8")}catch(d){throw d instanceof _o?d:new _o(`edit: ${P3e(d,e)}`)}let l=c.split(r).length-1;if(l===0)throw new _o(`edit: old_string not found in ${e}`);let u;if(o)u=c.split(r).join(n);else{if(l>1)throw new _o(`edit: old_string appears ${l} times in ${e} (must be unique)`);u=c.replace(r,()=>n)}try{await HLr(s,u)}catch(d){throw new _o(`edit: write: ${P3e(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function qHi(t){return gie({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 _o("glob: pattern is required");let n=Uf.resolve(t.workdir),o=e;if(Uf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new _o("glob: absolute pattern not permitted");n=Uf.parse(e).root,o=Uf.relative(n,e)}else r&&(n=await ZEe(t,r));if(!t.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new _o('glob: ".." is not permitted in the pattern');let s=[];try{for await(let c of cDc(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=Uf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!pDc(n,l))continue;let u=0;try{u=(await n_.stat(l)).mtimeMs}catch{}s.push({path:l,mtime:u})}}catch(c){throw new _o(`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,sDc).map(c=>c.path).join(` -`))},"run")})}function jHi(t){return gie({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 _o("grep: pattern is required");let o=Uf.resolve(t.workdir);r&&(o=await ZEe(t,r));let s=await ADc();return s?dDc(s,e,o,n?.signal):fDc(e,o,n?.signal)},"run")})}function dDc(t,e,r,n){return new Promise((o,s)=>{let c=KLr.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>N3e&&(d=!0,l=l.slice(0,N3e),c.kill("SIGKILL")))}),c.stderr.on("data",f=>u+=f),c.on("close",f=>{if(n?.aborted)return s(new _o("grep: aborted"));if(d)return o(l+` -[output truncated at ${N3e} bytes]`);if(f===0)return o(l);if(f===1)return o("no matches");s(new _o(`grep: rg failed: ${u||`exit ${f}`}`))}),c.on("error",f=>{if(n?.aborted)return s(new _o("grep: aborted"));s(new _o(`grep: rg failed: ${f.message}`))})})}async function fDc(t,e,r){let n;try{n=new RegExp(t)}catch(u){throw new _o(`grep: invalid regex: ${u instanceof Error?u.message:String(u)}`)}let o=[],s=N3e,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${N3e} bytes]`),!1):(o.push(u),!0)),"push");if((await n_.stat(e).catch(()=>null))?.isFile()?await NHi(e,n,c):await gDc(e,"",u=>NHi(Uf.join(e,u),n,c),r),r?.aborted)throw new _o("grep: aborted");return o.length===0?"no matches":o.join(` -`)}async function NHi(t,e,r){let n=ESt.createReadStream(t,{encoding:"utf8"}),o=OHi.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>oDc)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function pDc(t,e){let r=Uf.relative(t,e);return r===""||!r.startsWith(".."+Uf.sep)&&r!==".."&&!Uf.isAbsolute(r)}async function gDc(t,e,r,n){let o=mDc;async function s(c,l){if(l>hDc)return!0;if(n?.aborted)return!1;let u;try{u=await n_.readdir(Uf.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?Uf.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 ADc(){let t=(process.env.PATH??"").split(Uf.delimiter);for(let e of t){let r=Uf.join(e,"rg");try{return await n_.access(r,ESt.constants.X_OK),r}catch{}}return null}var n_,ESt,Uf,KLr,MHi,OHi,ASt,Wv,T1,D3e,Aie,nk,zLr,PHi,LHi,YLr,DHi,N3e,oDc,sDc,aDc,cDc,ySt,hDc,mDc,GHi=ve(()=>{p();C1();n_=de(require("node:fs/promises"),1),ESt=de(require("node:fs"),1),Uf=de(require("node:path"),1),KLr=de(require("node:child_process"),1),MHi=de(require("node:crypto"),1),OHi=de(require("node:readline"),1);Bf();hie();vHi();jLr();GLr();kHi();PHi=100*1024,LHi=12e4,YLr=256*1024,DHi=YLr,N3e=100*1024,oDc=2e3,sDc=200,aDc=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,cDc=n_.glob;a(lDc,"betaAgentToolset20260401");a(ZEe,"resolvePath");a(uDc,"scrubbedShellEnv");ySt=class{static{a(this,"BashSession")}constructor(e,r=uDc()){ASt.add(this),Wv.set(this,void 0),T1.set(this,""),D3e.set(this,!1),Aie.set(this,!1),nk.set(this,null),qt(this,Wv,KLr.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),xe(this,Wv,"f").stdout.setEncoding("utf8"),xe(this,Wv,"f").stderr.setEncoding("utf8"),xe(this,Wv,"f").stdout.on("data",n=>xe(this,ASt,"m",zLr).call(this,n)),xe(this,Wv,"f").stderr.on("data",n=>xe(this,ASt,"m",zLr).call(this,n)),xe(this,Wv,"f").once("close",()=>{qt(this,Aie,!0,"f");let n=xe(this,nk,"f");qt(this,nk,null,"f"),n?.resolve()})}get closed(){return xe(this,Aie,"f")}async exec(e,r={}){if(xe(this,Aie,"f"))throw new fr("bash session terminated");let n=r.timeoutMs??LHi,o=r.signal;if(o?.aborted)throw new fr("bash command aborted");qt(this,T1,"","f"),qt(this,D3e,!1,"f");let s=`__ANT_CMD_${MHi.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} +`)},"run")})}function HHi(t){return gie({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 vo("write: file_path is required");let n=await XEe(t,e);try{await n_.mkdir(Uf.dirname(n),{recursive:!0,mode:D3e}),await GLr(n,r??"")}catch(o){throw new vo(`write: ${N3e(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function GHi(t){return gie({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 vo("edit: file_path is required");if(!r)throw new vo("edit: old_string is required");let s=await XEe(t,e),c;try{let d=await n_.stat(s);if(!d.isFile())throw new vo(`edit: ${e} is not a regular file`);if(d.size>LHi)throw new vo(`edit: ${e} is ${d.size} bytes, exceeds ${LHi}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await n_.readFile(s,"utf8")}catch(d){throw d instanceof vo?d:new vo(`edit: ${N3e(d,e)}`)}let l=c.split(r).length-1;if(l===0)throw new vo(`edit: old_string not found in ${e}`);let u;if(o)u=c.split(r).join(n);else{if(l>1)throw new vo(`edit: old_string appears ${l} times in ${e} (must be unique)`);u=c.replace(r,()=>n)}try{await GLr(s,u)}catch(d){throw new vo(`edit: write: ${N3e(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function $Hi(t){return gie({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 vo("glob: pattern is required");let n=Uf.resolve(t.workdir),o=e;if(Uf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new vo("glob: absolute pattern not permitted");n=Uf.parse(e).root,o=Uf.relative(n,e)}else r&&(n=await XEe(t,r));if(!t.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new vo('glob: ".." is not permitted in the pattern');let s=[];try{for await(let c of hDc(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=Uf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!EDc(n,l))continue;let u=0;try{u=(await n_.stat(l)).mtimeMs}catch{}s.push({path:l,mtime:u})}}catch(c){throw new vo(`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,fDc).map(c=>c.path).join(` +`))},"run")})}function VHi(t){return gie({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 vo("grep: pattern is required");let o=Uf.resolve(t.workdir);r&&(o=await XEe(t,r));let s=await bDc();return s?ADc(s,e,o,n?.signal):yDc(e,o,n?.signal)},"run")})}function ADc(t,e,r,n){return new Promise((o,s)=>{let c=JLr.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>O3e&&(d=!0,l=l.slice(0,O3e),c.kill("SIGKILL")))}),c.stderr.on("data",f=>u+=f),c.on("close",f=>{if(n?.aborted)return s(new vo("grep: aborted"));if(d)return o(l+` +[output truncated at ${O3e} bytes]`);if(f===0)return o(l);if(f===1)return o("no matches");s(new vo(`grep: rg failed: ${u||`exit ${f}`}`))}),c.on("error",f=>{if(n?.aborted)return s(new vo("grep: aborted"));s(new vo(`grep: rg failed: ${f.message}`))})})}async function yDc(t,e,r){let n;try{n=new RegExp(t)}catch(u){throw new vo(`grep: invalid regex: ${u instanceof Error?u.message:String(u)}`)}let o=[],s=O3e,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${O3e} bytes]`),!1):(o.push(u),!0)),"push");if((await n_.stat(e).catch(()=>null))?.isFile()?await BHi(e,n,c):await CDc(e,"",u=>BHi(Uf.join(e,u),n,c),r),r?.aborted)throw new vo("grep: aborted");return o.length===0?"no matches":o.join(` +`)}async function BHi(t,e,r){let n=_St.createReadStream(t,{encoding:"utf8"}),o=UHi.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>dDc)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function EDc(t,e){let r=Uf.relative(t,e);return r===""||!r.startsWith(".."+Uf.sep)&&r!==".."&&!Uf.isAbsolute(r)}async function CDc(t,e,r,n){let o=vDc;async function s(c,l){if(l>_Dc)return!0;if(n?.aborted)return!1;let u;try{u=await n_.readdir(Uf.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?Uf.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 bDc(){let t=(process.env.PATH??"").split(Uf.delimiter);for(let e of t){let r=Uf.join(e,"rg");try{return await n_.access(r,_St.constants.X_OK),r}catch{}}return null}var n_,_St,Uf,JLr,FHi,UHi,ySt,zv,T1,M3e,Aie,ik,YLr,OHi,QHi,KLr,LHi,O3e,dDc,fDc,pDc,hDc,ESt,_Dc,vDc,zHi=ve(()=>{p();C1();n_=de(require("node:fs/promises"),1),_St=de(require("node:fs"),1),Uf=de(require("node:path"),1),JLr=de(require("node:child_process"),1),FHi=de(require("node:crypto"),1),UHi=de(require("node:readline"),1);Bf();hie();THi();HLr();$Lr();MHi();OHi=100*1024,QHi=12e4,KLr=256*1024,LHi=KLr,O3e=100*1024,dDc=2e3,fDc=200,pDc=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,hDc=n_.glob;a(mDc,"betaAgentToolset20260401");a(XEe,"resolvePath");a(gDc,"scrubbedShellEnv");ESt=class{static{a(this,"BashSession")}constructor(e,r=gDc()){ySt.add(this),zv.set(this,void 0),T1.set(this,""),M3e.set(this,!1),Aie.set(this,!1),ik.set(this,null),qt(this,zv,JLr.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),xe(this,zv,"f").stdout.setEncoding("utf8"),xe(this,zv,"f").stderr.setEncoding("utf8"),xe(this,zv,"f").stdout.on("data",n=>xe(this,ySt,"m",YLr).call(this,n)),xe(this,zv,"f").stderr.on("data",n=>xe(this,ySt,"m",YLr).call(this,n)),xe(this,zv,"f").once("close",()=>{qt(this,Aie,!0,"f");let n=xe(this,ik,"f");qt(this,ik,null,"f"),n?.resolve()})}get closed(){return xe(this,Aie,"f")}async exec(e,r={}){if(xe(this,Aie,"f"))throw new fr("bash session terminated");let n=r.timeoutMs??QHi,o=r.signal;if(o?.aborted)throw new fr("bash command aborted");qt(this,T1,"","f"),qt(this,M3e,!1,"f");let s=`__ANT_CMD_${FHi.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} } &1; printf '\\n${c}%d\\n' $? -`;if(xe(this,Wv,"f").stdin.write(l),xe(this,T1,"f").indexOf(s)<0){let{promise:g,resolve:A}=JEe();qt(this,nk,{sentinel:s,resolve:A},"f");let y,E;try{await Promise.race([g,new Promise((_,v)=>{y=setTimeout(()=>v(new fr(`bash command timed out after ${n}ms`)),n)}),new Promise((_,v)=>{o&&(E=a(()=>v(new fr("bash command aborted")),"onAbort"),o.addEventListener("abort",E,{once:!0}))})])}finally{y&&clearTimeout(y),E&&o&&o.removeEventListener("abort",E),qt(this,nk,null,"f")}}let u=xe(this,T1,"f").indexOf(s);if(u<0)throw new fr("bash session terminated");let f=xe(this,T1,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=xe(this,T1,"f").slice(0,u).replace(aDc,"").replace(/\n+$/,"");return xe(this,D3e,"f")&&(m=`[output truncated] -${m}`),{output:m,exitCode:h}}close(){if(xe(this,Aie,"f"))return;qt(this,Aie,!0,"f");let e=xe(this,nk,"f");qt(this,nk,null,"f"),e?.resolve(),xe(this,Wv,"f").stdout.destroy(),xe(this,Wv,"f").stderr.destroy(),xe(this,Wv,"f").stdin.destroy();try{process.kill(-xe(this,Wv,"f").pid,"SIGKILL")}catch{xe(this,Wv,"f").kill("SIGKILL")}xe(this,Wv,"f").unref()}};Wv=new WeakMap,T1=new WeakMap,D3e=new WeakMap,Aie=new WeakMap,nk=new WeakMap,ASt=new WeakSet,zLr=a(function(e){if(qt(this,T1,xe(this,T1,"f")+e,"f"),xe(this,T1,"f").length>PHi&&(qt(this,T1,xe(this,T1,"f").slice(xe(this,T1,"f").length-PHi),"f"),qt(this,D3e,!0,"f")),xe(this,nk,"f")&&xe(this,T1,"f").indexOf(xe(this,nk,"f").sentinel)>=0){let r=xe(this,nk,"f");qt(this,nk,null,"f"),r.resolve()}},"_BashSession_append");a(BHi,"betaBashTool");a(FHi,"betaReadTool");a(UHi,"betaWriteTool");a(QHi,"betaEditTool");a(qHi,"betaGlobTool");a(jHi,"betaGrepTool");a(dDc,"runRipgrep");a(fDc,"runWalkGrep");a(NHi,"grepFile");a(pDc,"isWithin");hDc=40,mDc=5e4;a(gDc,"walk");a(ADc,"findRg")});async function EDc(t,e,r,n){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...n,headers:vt([n?.headers])})}catch(o){xV(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function _Dc(t,e,r,n,o){let s=$Hi,c=yDc,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:vt([o?.headers]),signal:r.signal});c=u.last_heartbeat,u.ttl_seconds>0&&(s=Math.max(1e3,Math.min(u.ttl_seconds*1e3/2,$Hi))),(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(),wV(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 TN(s,r.signal),r.signal.throwIfAborted(),await l()}var _St,M3e,JLr,$Hi,yDc,XEe,ZLr=ve(()=>{p();C1();Bf();b9();m3e();DEe();S3e();iSt();vc();gSt();uSt();BLr();$Hi=3e4,yDc="NO_HEARTBEAT",XEe=class{static{a(this,"EnvironmentWorker")}constructor(e){_St.add(this),M3e.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,M3e,e.signal,"f")}async run(e){let{environmentId:r,environmentKey:n}=this;if(r===void 0||n===void 0)throw new fr("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=e??xe(this,M3e,"f"),s=new RV({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 xe(this,_St,"m",JLr).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??_a("ANTHROPIC_WORK_ID"),n=e?.environmentId??_a("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??_a("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??_a("ANTHROPIC_ENVIRONMENT_KEY");if(!r)throw new fr("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!n)throw new fr("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new fr("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s)throw new fr("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 xe(this,_St,"m",JLr).call(this,c,s,e?.signal??xe(this,M3e,"f"))}};M3e=new WeakMap,_St=new WeakSet,JLr=a(async function(e,r,n){let o=gl(this.client),s=oSt(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(()=>(GHi(),HHi)),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=pie(n,h),g=_Dc(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 PV(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 EDc(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(EDc,"forceStop");a(_Dc,"heartbeatLoop")});var DV,XLr=ve(()=>{p();Ul();_d();vc();Ff();uSt();ZLr();uSt();ZLr();DV=class extends Ai{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(or`/v1/environments/${o}/work/${e}?beta=true`,{...n,headers:vt([{"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(or`/v1/environments/${o}/work/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/environments/${e}/work?beta=true`,va,{query:s,...n,headers:vt([{"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(or`/v1/environments/${o}/work/${e}/ack?beta=true`,{...n,headers:vt([{"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(or`/v1/environments/${o}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:c},...n,headers:vt([{"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(or`/v1/environments/${e}/work/poll?beta=true`,{query:c,...n,headers:vt([{"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(or`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:vt([{"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(or`/v1/environments/${o}/work/${e}/stop?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new RV({...e,client:this._client})}worker(e){return new XEe({...e,client:this._client})}};DV.WorkPoller=RV;DV.EnvironmentWorker=XEe});var yie,eBr=ve(()=>{p();Ul();XLr();XLr();_d();vc();Ff();yie=class extends Ai{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new DV(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/environments/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/environments/${e}?beta=true`,{body:s,...n,headers:vt([{"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",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/environments/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/environments/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};yie.Work=DV});var e_e,tBr=ve(()=>{p();Ul();_d();vc();Ff();e_e=class extends Ai{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(or`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:vt([{"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(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:vt([{"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(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:vt([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/memory_stores/${e}/memories?beta=true`,va,{query:s,...n,headers:vt([{"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(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:vt([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var t_e,rBr=ve(()=>{p();Ul();_d();vc();Ff();t_e=class extends Ai{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(or`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/memory_stores/${e}/memory_versions?beta=true`,va,{query:s,...n,headers:vt([{"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(or`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var NV,nBr=ve(()=>{p();Ul();tBr();tBr();rBr();rBr();_d();vc();Ff();NV=class extends Ai{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new e_e(this._client),this.memoryVersions=new t_e(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/memory_stores/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:vt([{"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",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/memory_stores/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};NV.Memories=e_e;NV.MemoryVersions=t_e});var r_e=ve(()=>{p();Bf()});var n_e,iBr=ve(()=>{p();Bf();NEe();ALr();n_e=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new S9;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 fr("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 fr("Attempted to iterate over a response with no body");return new t(p3e(e.body),r)}}});var i_e,oBr=ve(()=>{p();Ul();_d();vc();iBr();r_e();Ff();i_e=class extends Ai{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:vt([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/messages/batches/${e}?beta=true`,{...n,headers:vt([{"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",tk,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/messages/batches/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:vt([{"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 fr(`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:vt([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>n_e.fromResponse(l.response,l.controller))}}});var vSt,sBr=ve(()=>{p();vSt={"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 VHi(t){return t?.output_format??t?.output_config?.format}function aBr(t,e,r){let n=VHi(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}:cBr(t,e,r)}function cBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=xDc(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 xDc(t,e){let r=VHi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new fr(`Failed to parse structured output: ${n}`)}}var lBr=ve(()=>{p();Bf();a(VHi,"getOutputFormat");a(aBr,"maybeParseBetaMessage");a(cBr,"parseBetaMessage");a(xDc,"parseBetaOutputFormat")});var wDc,o_e,RDc,kDc,CSt,uBr=ve(()=>{p();wDc=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),o_e(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),o_e(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),o_e(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),o_e(t);break;case"delimiter":return t=t.slice(0,t.length-1),o_e(t);break}return t},"strip"),RDc=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"),kDc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),CSt=a(t=>JSON.parse(kDc(RDc(o_e(wDc(t))))),"partialParse")});var dBr=ve(()=>{p();ELr()});function KHi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var ik,MV,s_e,O3e,bSt,L3e,B3e,SSt,F3e,I9,U3e,TSt,ISt,Eie,xSt,wSt,Q3e,fBr,WHi,RSt,pBr,hBr,mBr,zHi,YHi,kSt,JHi=ve(()=>{p();C1();uBr();r_e();CEe();dBr();lBr();YHi="__json_buf";a(KHi,"tracksToolInput");kSt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){ik.add(this),this.messages=[],this.receivedMessages=[],MV.set(this,void 0),s_e.set(this,null),this.controller=new AbortController,O3e.set(this,void 0),bSt.set(this,()=>{}),L3e.set(this,()=>{}),B3e.set(this,void 0),SSt.set(this,()=>{}),F3e.set(this,()=>{}),I9.set(this,{}),U3e.set(this,!1),TSt.set(this,!1),ISt.set(this,!1),Eie.set(this,!1),xSt.set(this,void 0),wSt.set(this,void 0),Q3e.set(this,void 0),RSt.set(this,n=>{if(qt(this,TSt,!0,"f"),v9(n)&&(n=new Ty),n instanceof Ty)return qt(this,ISt,!0,"f"),this._emit("abort",n);if(n instanceof fr)return this._emit("error",n);if(n instanceof Error){let o=new fr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new fr(String(n)))}),qt(this,O3e,new Promise((n,o)=>{qt(this,bSt,n,"f"),qt(this,L3e,o,"f")}),"f"),qt(this,B3e,new Promise((n,o)=>{qt(this,SSt,n,"f"),qt(this,F3e,o,"f")}),"f"),xe(this,O3e,"f").catch(()=>{}),xe(this,B3e,"f").catch(()=>{}),qt(this,s_e,e,"f"),qt(this,Q3e,r?.logger??console,"f")}get response(){return xe(this,xSt,"f")}get request_id(){return xe(this,wSt,"f")}async withResponse(){qt(this,Eie,!0,"f");let e=await xe(this,O3e,"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,s_e,{...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")},xe(this,RSt,"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{xe(this,ik,"m",pBr).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)xe(this,ik,"m",hBr).call(this,u);if(l.controller.signal?.aborted)throw new Ty;xe(this,ik,"m",mBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,xSt,e,"f"),qt(this,wSt,e?.headers.get("request-id"),"f"),xe(this,bSt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,U3e,"f")}get errored(){return xe(this,TSt,"f")}get aborted(){return xe(this,ISt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,I9,"f")[e]||(xe(this,I9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,I9,"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(xe(this,I9,"f")[e]||(xe(this,I9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,Eie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,Eie,!0,"f"),await xe(this,B3e,"f")}get currentMessage(){return xe(this,MV,"f")}async finalMessage(){return await this.done(),xe(this,ik,"m",fBr).call(this)}async finalText(){return await this.done(),xe(this,ik,"m",WHi).call(this)}_emit(e,...r){if(xe(this,U3e,"f"))return;e==="end"&&(qt(this,U3e,!0,"f"),xe(this,SSt,"f").call(this));let n=xe(this,I9,"f")[e];if(n&&(xe(this,I9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,Eie,"f")&&!n?.length&&Promise.reject(o),xe(this,L3e,"f").call(this,o),xe(this,F3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,Eie,"f")&&!n?.length&&Promise.reject(o),xe(this,L3e,"f").call(this,o),xe(this,F3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,ik,"m",fBr).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{xe(this,ik,"m",pBr).call(this),this._connected(null);let s=OL.fromReadableStream(e,this.controller);for await(let c of s)xe(this,ik,"m",hBr).call(this,c);if(s.controller.signal?.aborted)throw new Ty;xe(this,ik,"m",mBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(MV=new WeakMap,s_e=new WeakMap,O3e=new WeakMap,bSt=new WeakMap,L3e=new WeakMap,B3e=new WeakMap,SSt=new WeakMap,F3e=new WeakMap,I9=new WeakMap,U3e=new WeakMap,TSt=new WeakMap,ISt=new WeakMap,Eie=new WeakMap,xSt=new WeakMap,wSt=new WeakMap,Q3e=new WeakMap,RSt=new WeakMap,ik=new WeakSet,fBr=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_BetaMessageStream_getFinalMessage"),WHi=a(function(){if(this.receivedMessages.length===0)throw new fr("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 fr("stream ended without producing a content block with type=text");return r.join(" ")},"_BetaMessageStream_getFinalText"),pBr=a(function(){this.ended||qt(this,MV,void 0,"f")},"_BetaMessageStream_beginRequest"),hBr=a(function(r){if(this.ended)return;let n=xe(this,ik,"m",zHi).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":{KHi(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(aBr(n,xe(this,s_e,"f"),{logger:xe(this,Q3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,MV,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),mBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,MV,"f");if(!r)throw new fr("request ended without sending any chunks");return qt(this,MV,void 0,"f"),aBr(r,xe(this,s_e,"f"),{logger:xe(this,Q3e,"f")})},"_BetaMessageStream_endRequest"),zHi=a(function(r){let n=xe(this,MV,"f");if(r.type==="message_start"){if(n)throw new fr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new fr(`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&&KHi(o)){let s=o[YHi]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,YHi,{value:s,enumerable:!1,writable:!0}),s)try{c.input=CSt(s)}catch(l){let u=new fr(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${l}. JSON: ${s}`);xe(this,RSt,"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 OL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var ZHi,XHi=ve(()=>{p();ZHi=`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(xe(this,zv,"f").stdin.write(l),xe(this,T1,"f").indexOf(s)<0){let{promise:g,resolve:A}=ZEe();qt(this,ik,{sentinel:s,resolve:A},"f");let y,E;try{await Promise.race([g,new Promise((_,v)=>{y=setTimeout(()=>v(new fr(`bash command timed out after ${n}ms`)),n)}),new Promise((_,v)=>{o&&(E=a(()=>v(new fr("bash command aborted")),"onAbort"),o.addEventListener("abort",E,{once:!0}))})])}finally{y&&clearTimeout(y),E&&o&&o.removeEventListener("abort",E),qt(this,ik,null,"f")}}let u=xe(this,T1,"f").indexOf(s);if(u<0)throw new fr("bash session terminated");let f=xe(this,T1,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=xe(this,T1,"f").slice(0,u).replace(pDc,"").replace(/\n+$/,"");return xe(this,M3e,"f")&&(m=`[output truncated] +${m}`),{output:m,exitCode:h}}close(){if(xe(this,Aie,"f"))return;qt(this,Aie,!0,"f");let e=xe(this,ik,"f");qt(this,ik,null,"f"),e?.resolve(),xe(this,zv,"f").stdout.destroy(),xe(this,zv,"f").stderr.destroy(),xe(this,zv,"f").stdin.destroy();try{process.kill(-xe(this,zv,"f").pid,"SIGKILL")}catch{xe(this,zv,"f").kill("SIGKILL")}xe(this,zv,"f").unref()}};zv=new WeakMap,T1=new WeakMap,M3e=new WeakMap,Aie=new WeakMap,ik=new WeakMap,ySt=new WeakSet,YLr=a(function(e){if(qt(this,T1,xe(this,T1,"f")+e,"f"),xe(this,T1,"f").length>OHi&&(qt(this,T1,xe(this,T1,"f").slice(xe(this,T1,"f").length-OHi),"f"),qt(this,M3e,!0,"f")),xe(this,ik,"f")&&xe(this,T1,"f").indexOf(xe(this,ik,"f").sentinel)>=0){let r=xe(this,ik,"f");qt(this,ik,null,"f"),r.resolve()}},"_BashSession_append");a(qHi,"betaBashTool");a(jHi,"betaReadTool");a(HHi,"betaWriteTool");a(GHi,"betaEditTool");a($Hi,"betaGlobTool");a(VHi,"betaGrepTool");a(ADc,"runRipgrep");a(yDc,"runWalkGrep");a(BHi,"grepFile");a(EDc,"isWithin");_Dc=40,vDc=5e4;a(CDc,"walk");a(bDc,"findRg")});async function TDc(t,e,r,n){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...n,headers:vt([n?.headers])})}catch(o){wV(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function IDc(t,e,r,n,o){let s=YHi,c=SDc,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:vt([o?.headers]),signal:r.signal});c=u.last_heartbeat,u.ttl_seconds>0&&(s=Math.max(1e3,Math.min(u.ttl_seconds*1e3/2,YHi))),(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(),RV(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 IN(s,r.signal),r.signal.throwIfAborted(),await l()}var vSt,L3e,ZLr,YHi,SDc,e_e,XLr=ve(()=>{p();C1();Bf();S9();A3e();NEe();I3e();oSt();vc();ASt();dSt();FLr();YHi=3e4,SDc="NO_HEARTBEAT",e_e=class{static{a(this,"EnvironmentWorker")}constructor(e){vSt.add(this),L3e.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,L3e,e.signal,"f")}async run(e){let{environmentId:r,environmentKey:n}=this;if(r===void 0||n===void 0)throw new fr("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=e??xe(this,L3e,"f"),s=new kV({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 xe(this,vSt,"m",ZLr).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??Ea("ANTHROPIC_WORK_ID"),n=e?.environmentId??Ea("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??Ea("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??Ea("ANTHROPIC_ENVIRONMENT_KEY");if(!r)throw new fr("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!n)throw new fr("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new fr("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s)throw new fr("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 xe(this,vSt,"m",ZLr).call(this,c,s,e?.signal??xe(this,L3e,"f"))}};L3e=new WeakMap,vSt=new WeakSet,ZLr=a(async function(e,r,n){let o=gl(this.client),s=sSt(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(()=>(zHi(),WHi)),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=pie(n,h),g=IDc(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 DV(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 TDc(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(TDc,"forceStop");a(IDc,"heartbeatLoop")});var NV,eBr=ve(()=>{p();Ul();_d();vc();Ff();dSt();XLr();dSt();XLr();NV=class extends Ai{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(or`/v1/environments/${o}/work/${e}?beta=true`,{...n,headers:vt([{"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(or`/v1/environments/${o}/work/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/environments/${e}/work?beta=true`,_a,{query:s,...n,headers:vt([{"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(or`/v1/environments/${o}/work/${e}/ack?beta=true`,{...n,headers:vt([{"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(or`/v1/environments/${o}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:c},...n,headers:vt([{"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(or`/v1/environments/${e}/work/poll?beta=true`,{query:c,...n,headers:vt([{"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(or`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:vt([{"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(or`/v1/environments/${o}/work/${e}/stop?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new kV({...e,client:this._client})}worker(e){return new e_e({...e,client:this._client})}};NV.WorkPoller=kV;NV.EnvironmentWorker=e_e});var yie,tBr=ve(()=>{p();Ul();eBr();eBr();_d();vc();Ff();yie=class extends Ai{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new NV(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/environments/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/environments/${e}?beta=true`,{body:s,...n,headers:vt([{"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",_a,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/environments/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/environments/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};yie.Work=NV});var t_e,rBr=ve(()=>{p();Ul();_d();vc();Ff();t_e=class extends Ai{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(or`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:vt([{"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(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:vt([{"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(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:vt([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/memory_stores/${e}/memories?beta=true`,_a,{query:s,...n,headers:vt([{"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(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:vt([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var r_e,nBr=ve(()=>{p();Ul();_d();vc();Ff();r_e=class extends Ai{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(or`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/memory_stores/${e}/memory_versions?beta=true`,_a,{query:s,...n,headers:vt([{"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(or`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var MV,iBr=ve(()=>{p();Ul();rBr();rBr();nBr();nBr();_d();vc();Ff();MV=class extends Ai{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new t_e(this._client),this.memoryVersions=new r_e(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/memory_stores/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:vt([{"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",_a,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/memory_stores/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};MV.Memories=t_e;MV.MemoryVersions=r_e});var n_e=ve(()=>{p();Bf()});var i_e,oBr=ve(()=>{p();Bf();MEe();yLr();i_e=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new T9;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 fr("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 fr("Attempted to iterate over a response with no body");return new t(m3e(e.body),r)}}});var o_e,sBr=ve(()=>{p();Ul();_d();vc();oBr();n_e();Ff();o_e=class extends Ai{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:vt([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/messages/batches/${e}?beta=true`,{...n,headers:vt([{"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",rk,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/messages/batches/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:vt([{"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 fr(`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:vt([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>i_e.fromResponse(l.response,l.controller))}}});var CSt,aBr=ve(()=>{p();CSt={"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 KHi(t){return t?.output_format??t?.output_config?.format}function cBr(t,e,r){let n=KHi(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}:lBr(t,e,r)}function lBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=NDc(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 NDc(t,e){let r=KHi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new fr(`Failed to parse structured output: ${n}`)}}var uBr=ve(()=>{p();Bf();a(KHi,"getOutputFormat");a(cBr,"maybeParseBetaMessage");a(lBr,"parseBetaMessage");a(NDc,"parseBetaOutputFormat")});var MDc,s_e,ODc,LDc,bSt,dBr=ve(()=>{p();MDc=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),s_e(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),s_e(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),s_e(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),s_e(t);break;case"delimiter":return t=t.slice(0,t.length-1),s_e(t);break}return t},"strip"),ODc=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"),LDc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),bSt=a(t=>JSON.parse(LDc(ODc(s_e(MDc(t))))),"partialParse")});var fBr=ve(()=>{p();_Lr()});function eGi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var ok,OV,a_e,B3e,SSt,F3e,U3e,TSt,Q3e,x9,q3e,ISt,xSt,Eie,wSt,RSt,j3e,pBr,JHi,kSt,hBr,mBr,gBr,ZHi,XHi,PSt,tGi=ve(()=>{p();C1();dBr();n_e();bEe();fBr();uBr();XHi="__json_buf";a(eGi,"tracksToolInput");PSt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){ok.add(this),this.messages=[],this.receivedMessages=[],OV.set(this,void 0),a_e.set(this,null),this.controller=new AbortController,B3e.set(this,void 0),SSt.set(this,()=>{}),F3e.set(this,()=>{}),U3e.set(this,void 0),TSt.set(this,()=>{}),Q3e.set(this,()=>{}),x9.set(this,{}),q3e.set(this,!1),ISt.set(this,!1),xSt.set(this,!1),Eie.set(this,!1),wSt.set(this,void 0),RSt.set(this,void 0),j3e.set(this,void 0),kSt.set(this,n=>{if(qt(this,ISt,!0,"f"),C9(n)&&(n=new Ty),n instanceof Ty)return qt(this,xSt,!0,"f"),this._emit("abort",n);if(n instanceof fr)return this._emit("error",n);if(n instanceof Error){let o=new fr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new fr(String(n)))}),qt(this,B3e,new Promise((n,o)=>{qt(this,SSt,n,"f"),qt(this,F3e,o,"f")}),"f"),qt(this,U3e,new Promise((n,o)=>{qt(this,TSt,n,"f"),qt(this,Q3e,o,"f")}),"f"),xe(this,B3e,"f").catch(()=>{}),xe(this,U3e,"f").catch(()=>{}),qt(this,a_e,e,"f"),qt(this,j3e,r?.logger??console,"f")}get response(){return xe(this,wSt,"f")}get request_id(){return xe(this,RSt,"f")}async withResponse(){qt(this,Eie,!0,"f");let e=await xe(this,B3e,"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,a_e,{...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")},xe(this,kSt,"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{xe(this,ok,"m",hBr).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)xe(this,ok,"m",mBr).call(this,u);if(l.controller.signal?.aborted)throw new Ty;xe(this,ok,"m",gBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,wSt,e,"f"),qt(this,RSt,e?.headers.get("request-id"),"f"),xe(this,SSt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,q3e,"f")}get errored(){return xe(this,ISt,"f")}get aborted(){return xe(this,xSt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,x9,"f")[e]||(xe(this,x9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,x9,"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(xe(this,x9,"f")[e]||(xe(this,x9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,Eie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,Eie,!0,"f"),await xe(this,U3e,"f")}get currentMessage(){return xe(this,OV,"f")}async finalMessage(){return await this.done(),xe(this,ok,"m",pBr).call(this)}async finalText(){return await this.done(),xe(this,ok,"m",JHi).call(this)}_emit(e,...r){if(xe(this,q3e,"f"))return;e==="end"&&(qt(this,q3e,!0,"f"),xe(this,TSt,"f").call(this));let n=xe(this,x9,"f")[e];if(n&&(xe(this,x9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,Eie,"f")&&!n?.length&&Promise.reject(o),xe(this,F3e,"f").call(this,o),xe(this,Q3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,Eie,"f")&&!n?.length&&Promise.reject(o),xe(this,F3e,"f").call(this,o),xe(this,Q3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,ok,"m",pBr).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{xe(this,ok,"m",hBr).call(this),this._connected(null);let s=OL.fromReadableStream(e,this.controller);for await(let c of s)xe(this,ok,"m",mBr).call(this,c);if(s.controller.signal?.aborted)throw new Ty;xe(this,ok,"m",gBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(OV=new WeakMap,a_e=new WeakMap,B3e=new WeakMap,SSt=new WeakMap,F3e=new WeakMap,U3e=new WeakMap,TSt=new WeakMap,Q3e=new WeakMap,x9=new WeakMap,q3e=new WeakMap,ISt=new WeakMap,xSt=new WeakMap,Eie=new WeakMap,wSt=new WeakMap,RSt=new WeakMap,j3e=new WeakMap,kSt=new WeakMap,ok=new WeakSet,pBr=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_BetaMessageStream_getFinalMessage"),JHi=a(function(){if(this.receivedMessages.length===0)throw new fr("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 fr("stream ended without producing a content block with type=text");return r.join(" ")},"_BetaMessageStream_getFinalText"),hBr=a(function(){this.ended||qt(this,OV,void 0,"f")},"_BetaMessageStream_beginRequest"),mBr=a(function(r){if(this.ended)return;let n=xe(this,ok,"m",ZHi).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":{eGi(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(cBr(n,xe(this,a_e,"f"),{logger:xe(this,j3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,OV,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),gBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,OV,"f");if(!r)throw new fr("request ended without sending any chunks");return qt(this,OV,void 0,"f"),cBr(r,xe(this,a_e,"f"),{logger:xe(this,j3e,"f")})},"_BetaMessageStream_endRequest"),ZHi=a(function(r){let n=xe(this,OV,"f");if(r.type==="message_start"){if(n)throw new fr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new fr(`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&&eGi(o)){let s=o[XHi]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,XHi,{value:s,enumerable:!1,writable:!0}),s)try{c.input=bSt(s)}catch(l){let u=new fr(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${l}. JSON: ${s}`);xe(this,kSt,"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 OL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var rGi,nGi=ve(()=>{p();rGi=`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 @@ -1491,65 +1491,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 DDc(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 _o?l.content:`Error: ${l instanceof Error?l.message:String(l)}`,is_error:!0}}}))}}var q3e,a_e,_ie,U0,I1,CI,x9,OV,j3e,eGi,gBr,c_e,ABr=ve(()=>{p();C1();hie();Bf();vc();jLr();XHi();C3e();c_e=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){q3e.add(this),this.client=e,a_e.set(this,!1),_ie.set(this,!1),U0.set(this,void 0),I1.set(this,void 0),CI.set(this,void 0),x9.set(this,void 0),OV.set(this,void 0),j3e.set(this,0),qt(this,U0,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...xLr(r.tools,r.messages)].join(", ");qt(this,I1,{...n,headers:vt([{"x-stainless-helper":s},n?.headers])},"f"),qt(this,OV,JEe(),"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*[(a_e=new WeakMap,_ie=new WeakMap,U0=new WeakMap,I1=new WeakMap,CI=new WeakMap,x9=new WeakMap,OV=new WeakMap,j3e=new WeakMap,q3e=new WeakSet,eGi=a(async function(){let r=xe(this,U0,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(xe(this,CI,"f")!==void 0)try{let d=await xe(this,CI,"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:xe(this,U0,"f").params.max_tokens},{signal:xe(this,I1,"f").signal,headers:vt([xe(this,I1,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new fr("Expected text response for compaction");return xe(this,U0,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(xe(this,a_e,"f"))throw new fr("Cannot iterate over a consumed stream");qt(this,a_e,!0,"f"),qt(this,_ie,!0,"f"),qt(this,x9,void 0,"f");try{for(;;){let r;try{if(xe(this,U0,"f").params.max_iterations&&xe(this,j3e,"f")>=xe(this,U0,"f").params.max_iterations)break;qt(this,_ie,!1,"f"),qt(this,x9,void 0,"f"),qt(this,j3e,(e=xe(this,j3e,"f"),e++,e),"f"),qt(this,CI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=xe(this,U0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},xe(this,I1,"f")),qt(this,CI,r.finalMessage(),"f"),xe(this,CI,"f").catch(()=>{}),yield r):(qt(this,CI,this.client.beta.messages.create({...s,stream:!1},xe(this,I1,"f")),"f"),yield xe(this,CI,"f")),!await xe(this,q3e,"m",eGi).call(this)){if(!xe(this,_ie,"f")){let{role:u,content:d}=await xe(this,CI,"f");xe(this,U0,"f").params.messages.push({role:u,content:d})}let l=await xe(this,q3e,"m",gBr).call(this,xe(this,U0,"f").params.messages.at(-1));if(l)xe(this,U0,"f").params.messages.push(l);else if(!xe(this,_ie,"f"))break}}finally{r&&r.abort()}}if(!xe(this,CI,"f"))throw new fr("ToolRunner concluded without a message from the server");xe(this,OV,"f").resolve(await xe(this,CI,"f"))}catch(r){throw qt(this,a_e,!1,"f"),xe(this,OV,"f").promise.catch(()=>{}),xe(this,OV,"f").reject(r),qt(this,OV,JEe(),"f"),r}}setMessagesParams(e){typeof e=="function"?xe(this,U0,"f").params=e(xe(this,U0,"f").params):xe(this,U0,"f").params=e,qt(this,_ie,!0,"f"),qt(this,x9,void 0,"f")}setRequestOptions(e){typeof e=="function"?qt(this,I1,e(xe(this,I1,"f")),"f"):qt(this,I1,{...xe(this,I1,"f"),...e},"f")}async generateToolResponse(e=xe(this,I1,"f").signal){let r=await xe(this,CI,"f")??this.params.messages.at(-1);return r?xe(this,q3e,"m",gBr).call(this,r,e):null}done(){return xe(this,OV,"f").promise}async runUntilDone(){if(!xe(this,a_e,"f"))for await(let e of this);return this.done()}get params(){return xe(this,U0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};gBr=a(async function(e,r=xe(this,I1,"f").signal){return xe(this,x9,"f")!==void 0?xe(this,x9,"f"):(qt(this,x9,DDc(xe(this,U0,"f").params,e,{...xe(this,I1,"f"),signal:r}),"f"),xe(this,x9,"f"))},"_BetaToolRunner_generateToolResponse");a(DDc,"generateToolResponse")});function rGi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new fr("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 tGi,NDc,w9,yBr=ve(()=>{p();r_e();oBr();Ul();sBr();vc();C3e();lBr();JHi();ABr();hie();oBr();ABr();hie();tGi={"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"},NDc=["claude-mythos-preview","claude-opus-4-6"],w9=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new i_e(this._client)}create(e,r){let n=rGi(e),{betas:o,...s}=n;s.model in tGi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${tGi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),NDc.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=vSt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=eSt(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:vt([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:vt([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>cBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return kSt.createMessage(this,e,r)}countTokens(e,r){let n=rGi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:vt([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new c_e(this._client,e,r)}};a(rGi,"transformOutputFormat");w9.Batches=i_e;w9.BetaToolRunner=c_e;w9.ToolError=_o});var vie,EBr=ve(()=>{p();Ul();_d();vc();Ff();gSt();gSt();vie=class extends Ai{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/events?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,r){return new PV(e,{...r,client:this._client})}};vie.SessionToolRunner=PV});var l_e,_Br=ve(()=>{p();Ul();_d();vc();Ff();l_e=class extends Ai{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:vt([{"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(or`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/resources?beta=true`,va,{query:s,...n,headers:vt([{"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(or`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var u_e,vBr=ve(()=>{p();Ul();_d();vc();Ff();u_e=class extends Ai{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(or`/v1/sessions/${o}/threads/${e}/events?beta=true`,va,{query:c,...n,headers:vt([{"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(or`/v1/sessions/${o}/threads/${e}/stream?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var Cie,CBr=ve(()=>{p();Ul();vBr();vBr();_d();vc();Ff();Cie=class extends Ai{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new u_e(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/threads/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/threads?beta=true`,va,{query:s,...n,headers:vt([{"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(or`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Cie.Events=u_e});var R9,bBr=ve(()=>{p();Ul();EBr();EBr();_Br();_Br();CBr();CBr();_d();vc();Ff();R9=class extends Ai{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new vie(this._client),this.resources=new l_e(this._client),this.threads=new Cie(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/sessions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:vt([{"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",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/sessions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/sessions/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};R9.Events=vie;R9.Resources=l_e;R9.Threads=Cie});var d_e,SBr=ve(()=>{p();Ul();_d();vc();FEe();Ff();d_e=class extends Ai{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(or`/v1/skills/${e}/versions?beta=true`,BEe({body:s,...n,headers:vt([{"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(or`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/skills/${e}/versions?beta=true`,va,{query:s,...n,headers:vt([{"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(or`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:vt([{"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(or`/v1/skills/${o}/versions/${e}/content?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var bie,TBr=ve(()=>{p();Ul();SBr();SBr();_d();vc();FEe();Ff();bie=class extends Ai{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new d_e(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",BEe({body:o,...r,headers:vt([{"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(or`/v1/skills/${e}?beta=true`,{...n,headers:vt([{"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",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/skills/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};bie.Versions=d_e});var f_e,IBr=ve(()=>{p();Ul();_d();vc();Ff();f_e=class extends Ai{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:vt([{"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(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:vt([{"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(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/vaults/${e}/credentials?beta=true`,va,{query:s,...n,headers:vt([{"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(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:vt([{"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(or`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:vt([{"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(or`/v1/vaults/${o}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Sie,xBr=ve(()=>{p();Ul();IBr();IBr();_d();vc();Ff();Sie=class extends Ai{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new f_e(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/vaults/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:vt([{"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",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/vaults/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/vaults/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Sie.Credentials=f_e});var iA,wBr=ve(()=>{p();Ul();wLr();wLr();RLr();RLr();kLr();kLr();NLr();NLr();OLr();OLr();eBr();eBr();nBr();nBr();yBr();yBr();bBr();bBr();TBr();TBr();xBr();xBr();iA=class extends Ai{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new QEe(this._client),this.messages=new w9(this._client),this.agents=new fie(this._client),this.environments=new yie(this._client),this.sessions=new R9(this._client),this.vaults=new Sie(this._client),this.memoryStores=new NV(this._client),this.files=new UEe(this._client),this.skills=new bie(this._client),this.webhooks=new HEe(this._client),this.userProfiles=new qEe(this._client)}};iA.Models=QEe;iA.Messages=w9;iA.Agents=fie;iA.Environments=yie;iA.Sessions=R9;iA.Vaults=Sie;iA.MemoryStores=NV;iA.Files=UEe;iA.Skills=bie;iA.Webhooks=HEe;iA.UserProfiles=qEe});var Tie,RBr=ve(()=>{p();Ul();vc();Tie=class extends Ai{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:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}}});function nGi(t){return t?.output_config?.format}function kBr(t,e,r){let n=nGi(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}:PBr(t,e,r)}function PBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=GDc(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 GDc(t,e){let r=nGi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new fr(`Failed to parse structured output: ${n}`)}}var DBr=ve(()=>{p();Bf();a(nGi,"getOutputFormat");a(kBr,"maybeParseMessage");a(PBr,"parseMessage");a(GDc,"parseOutputFormat")});function aGi(t){return t.type==="tool_use"||t.type==="server_tool_use"}var ok,LV,p_e,H3e,PSt,G3e,$3e,DSt,V3e,k9,W3e,NSt,MSt,Iie,OSt,LSt,z3e,NBr,iGi,MBr,OBr,LBr,BBr,oGi,sGi,BSt,cGi=ve(()=>{p();C1();CEe();r_e();dBr();uBr();DBr();sGi="__json_buf";a(aGi,"tracksToolInput");BSt=class t{static{a(this,"MessageStream")}constructor(e,r){ok.add(this),this.messages=[],this.receivedMessages=[],LV.set(this,void 0),p_e.set(this,null),this.controller=new AbortController,H3e.set(this,void 0),PSt.set(this,()=>{}),G3e.set(this,()=>{}),$3e.set(this,void 0),DSt.set(this,()=>{}),V3e.set(this,()=>{}),k9.set(this,{}),W3e.set(this,!1),NSt.set(this,!1),MSt.set(this,!1),Iie.set(this,!1),OSt.set(this,void 0),LSt.set(this,void 0),z3e.set(this,void 0),MBr.set(this,n=>{if(qt(this,NSt,!0,"f"),v9(n)&&(n=new Ty),n instanceof Ty)return qt(this,MSt,!0,"f"),this._emit("abort",n);if(n instanceof fr)return this._emit("error",n);if(n instanceof Error){let o=new fr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new fr(String(n)))}),qt(this,H3e,new Promise((n,o)=>{qt(this,PSt,n,"f"),qt(this,G3e,o,"f")}),"f"),qt(this,$3e,new Promise((n,o)=>{qt(this,DSt,n,"f"),qt(this,V3e,o,"f")}),"f"),xe(this,H3e,"f").catch(()=>{}),xe(this,$3e,"f").catch(()=>{}),qt(this,p_e,e,"f"),qt(this,z3e,r?.logger??console,"f")}get response(){return xe(this,OSt,"f")}get request_id(){return xe(this,LSt,"f")}async withResponse(){qt(this,Iie,!0,"f");let e=await xe(this,H3e,"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,p_e,{...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")},xe(this,MBr,"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{xe(this,ok,"m",OBr).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)xe(this,ok,"m",LBr).call(this,u);if(l.controller.signal?.aborted)throw new Ty;xe(this,ok,"m",BBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,OSt,e,"f"),qt(this,LSt,e?.headers.get("request-id"),"f"),xe(this,PSt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,W3e,"f")}get errored(){return xe(this,NSt,"f")}get aborted(){return xe(this,MSt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,k9,"f")[e]||(xe(this,k9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,k9,"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(xe(this,k9,"f")[e]||(xe(this,k9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,Iie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,Iie,!0,"f"),await xe(this,$3e,"f")}get currentMessage(){return xe(this,LV,"f")}async finalMessage(){return await this.done(),xe(this,ok,"m",NBr).call(this)}async finalText(){return await this.done(),xe(this,ok,"m",iGi).call(this)}_emit(e,...r){if(xe(this,W3e,"f"))return;e==="end"&&(qt(this,W3e,!0,"f"),xe(this,DSt,"f").call(this));let n=xe(this,k9,"f")[e];if(n&&(xe(this,k9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,Iie,"f")&&!n?.length&&Promise.reject(o),xe(this,G3e,"f").call(this,o),xe(this,V3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,Iie,"f")&&!n?.length&&Promise.reject(o),xe(this,G3e,"f").call(this,o),xe(this,V3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,ok,"m",NBr).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{xe(this,ok,"m",OBr).call(this),this._connected(null);let s=OL.fromReadableStream(e,this.controller);for await(let c of s)xe(this,ok,"m",LBr).call(this,c);if(s.controller.signal?.aborted)throw new Ty;xe(this,ok,"m",BBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(LV=new WeakMap,p_e=new WeakMap,H3e=new WeakMap,PSt=new WeakMap,G3e=new WeakMap,$3e=new WeakMap,DSt=new WeakMap,V3e=new WeakMap,k9=new WeakMap,W3e=new WeakMap,NSt=new WeakMap,MSt=new WeakMap,Iie=new WeakMap,OSt=new WeakMap,LSt=new WeakMap,z3e=new WeakMap,MBr=new WeakMap,ok=new WeakSet,NBr=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_MessageStream_getFinalMessage"),iGi=a(function(){if(this.receivedMessages.length===0)throw new fr("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 fr("stream ended without producing a content block with type=text");return r.join(" ")},"_MessageStream_getFinalText"),OBr=a(function(){this.ended||qt(this,LV,void 0,"f")},"_MessageStream_beginRequest"),LBr=a(function(r){if(this.ended)return;let n=xe(this,ok,"m",oGi).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":{aGi(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(kBr(n,xe(this,p_e,"f"),{logger:xe(this,z3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,LV,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),BBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,LV,"f");if(!r)throw new fr("request ended without sending any chunks");return qt(this,LV,void 0,"f"),kBr(r,xe(this,p_e,"f"),{logger:xe(this,z3e,"f")})},"_MessageStream_endRequest"),oGi=a(function(r){let n=xe(this,LV,"f");if(r.type==="message_start"){if(n)throw new fr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new fr(`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&&aGi(o)){let s=o[sGi]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,sGi,{value:s,enumerable:!1,writable:!0}),s&&(c.input=CSt(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 OL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var h_e,FBr=ve(()=>{p();Ul();_d();vc();iBr();r_e();Ff();h_e=class extends Ai{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(or`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",tk,{query:e,...r})}delete(e,r){return this._client.delete(or`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(or`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new fr(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:vt([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>n_e.fromResponse(s.response,s.controller))}}});var BV,lGi,VDc,UBr=ve(()=>{p();Ul();vc();C3e();cGi();DBr();FBr();FBr();sBr();BV=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new h_e(this._client)}create(e,r){e.model in lGi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${lGi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),VDc.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=vSt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=eSt(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:vt([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>PBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return BSt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},lGi={"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"},VDc=["claude-mythos-preview","claude-opus-4-6"];BV.Batches=h_e});var xie,QBr=ve(()=>{p();Ul();_d();vc();Ff();xie=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/models/${e}`,{...n,headers:vt([{...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",tk,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var uGi=ve(()=>{p();Hji();wBr();RBr();UBr();QBr()});var qBr,jBr,FSt,dGi,fGi,pGi,Qf,BL,HBr=ve(()=>{p();C1();D1t();NL();DEe();CEe();O1t();NEe();nji();cLr();d3e();Bf();OEe();vji();Fji();_d();ILr();uGi();Y1t();RBr();QBr();wBr();UBr();O1t();vc();m3e();b9();NL();fGi="\\n\\nHuman:",pGi="\\n\\nAssistant:",Qf=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=_a("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=_a("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(qBr.add(this),this._requestAuthFlags=new WeakMap,FSt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:_a("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:_a("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&&Xqi())throw new fr(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`});async function FDc(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 vo?l.content:`Error: ${l instanceof Error?l.message:String(l)}`,is_error:!0}}}))}}var H3e,c_e,_ie,U0,I1,SI,w9,LV,G3e,iGi,ABr,l_e,yBr=ve(()=>{p();C1();hie();Bf();vc();HLr();nGi();S3e();l_e=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){H3e.add(this),this.client=e,c_e.set(this,!1),_ie.set(this,!1),U0.set(this,void 0),I1.set(this,void 0),SI.set(this,void 0),w9.set(this,void 0),LV.set(this,void 0),G3e.set(this,0),qt(this,U0,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...wLr(r.tools,r.messages)].join(", ");qt(this,I1,{...n,headers:vt([{"x-stainless-helper":s},n?.headers])},"f"),qt(this,LV,ZEe(),"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*[(c_e=new WeakMap,_ie=new WeakMap,U0=new WeakMap,I1=new WeakMap,SI=new WeakMap,w9=new WeakMap,LV=new WeakMap,G3e=new WeakMap,H3e=new WeakSet,iGi=a(async function(){let r=xe(this,U0,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(xe(this,SI,"f")!==void 0)try{let d=await xe(this,SI,"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:xe(this,U0,"f").params.max_tokens},{signal:xe(this,I1,"f").signal,headers:vt([xe(this,I1,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new fr("Expected text response for compaction");return xe(this,U0,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(xe(this,c_e,"f"))throw new fr("Cannot iterate over a consumed stream");qt(this,c_e,!0,"f"),qt(this,_ie,!0,"f"),qt(this,w9,void 0,"f");try{for(;;){let r;try{if(xe(this,U0,"f").params.max_iterations&&xe(this,G3e,"f")>=xe(this,U0,"f").params.max_iterations)break;qt(this,_ie,!1,"f"),qt(this,w9,void 0,"f"),qt(this,G3e,(e=xe(this,G3e,"f"),e++,e),"f"),qt(this,SI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=xe(this,U0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},xe(this,I1,"f")),qt(this,SI,r.finalMessage(),"f"),xe(this,SI,"f").catch(()=>{}),yield r):(qt(this,SI,this.client.beta.messages.create({...s,stream:!1},xe(this,I1,"f")),"f"),yield xe(this,SI,"f")),!await xe(this,H3e,"m",iGi).call(this)){if(!xe(this,_ie,"f")){let{role:u,content:d}=await xe(this,SI,"f");xe(this,U0,"f").params.messages.push({role:u,content:d})}let l=await xe(this,H3e,"m",ABr).call(this,xe(this,U0,"f").params.messages.at(-1));if(l)xe(this,U0,"f").params.messages.push(l);else if(!xe(this,_ie,"f"))break}}finally{r&&r.abort()}}if(!xe(this,SI,"f"))throw new fr("ToolRunner concluded without a message from the server");xe(this,LV,"f").resolve(await xe(this,SI,"f"))}catch(r){throw qt(this,c_e,!1,"f"),xe(this,LV,"f").promise.catch(()=>{}),xe(this,LV,"f").reject(r),qt(this,LV,ZEe(),"f"),r}}setMessagesParams(e){typeof e=="function"?xe(this,U0,"f").params=e(xe(this,U0,"f").params):xe(this,U0,"f").params=e,qt(this,_ie,!0,"f"),qt(this,w9,void 0,"f")}setRequestOptions(e){typeof e=="function"?qt(this,I1,e(xe(this,I1,"f")),"f"):qt(this,I1,{...xe(this,I1,"f"),...e},"f")}async generateToolResponse(e=xe(this,I1,"f").signal){let r=await xe(this,SI,"f")??this.params.messages.at(-1);return r?xe(this,H3e,"m",ABr).call(this,r,e):null}done(){return xe(this,LV,"f").promise}async runUntilDone(){if(!xe(this,c_e,"f"))for await(let e of this);return this.done()}get params(){return xe(this,U0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};ABr=a(async function(e,r=xe(this,I1,"f").signal){return xe(this,w9,"f")!==void 0?xe(this,w9,"f"):(qt(this,w9,FDc(xe(this,U0,"f").params,e,{...xe(this,I1,"f"),signal:r}),"f"),xe(this,w9,"f"))},"_BetaToolRunner_generateToolResponse");a(FDc,"generateToolResponse")});function sGi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new fr("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 oGi,UDc,R9,EBr=ve(()=>{p();n_e();sBr();Ul();aBr();vc();S3e();uBr();tGi();yBr();hie();sBr();yBr();hie();oGi={"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"},UDc=["claude-mythos-preview","claude-opus-4-6"],R9=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new o_e(this._client)}create(e,r){let n=sGi(e),{betas:o,...s}=n;s.model in oGi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${oGi[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),UDc.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=CSt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=tSt(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:vt([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:vt([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>lBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return PSt.createMessage(this,e,r)}countTokens(e,r){let n=sGi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:vt([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new l_e(this._client,e,r)}};a(sGi,"transformOutputFormat");R9.Batches=o_e;R9.BetaToolRunner=l_e;R9.ToolError=vo});var vie,_Br=ve(()=>{p();Ul();_d();vc();Ff();ASt();ASt();vie=class extends Ai{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/events?beta=true`,_a,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,r){return new DV(e,{...r,client:this._client})}};vie.SessionToolRunner=DV});var u_e,vBr=ve(()=>{p();Ul();_d();vc();Ff();u_e=class extends Ai{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:vt([{"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(or`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/resources?beta=true`,_a,{query:s,...n,headers:vt([{"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(or`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var d_e,CBr=ve(()=>{p();Ul();_d();vc();Ff();d_e=class extends Ai{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(or`/v1/sessions/${o}/threads/${e}/events?beta=true`,_a,{query:c,...n,headers:vt([{"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(or`/v1/sessions/${o}/threads/${e}/stream?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var Cie,bBr=ve(()=>{p();Ul();CBr();CBr();_d();vc();Ff();Cie=class extends Ai{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new d_e(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/threads/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/threads?beta=true`,_a,{query:s,...n,headers:vt([{"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(or`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Cie.Events=d_e});var k9,SBr=ve(()=>{p();Ul();_Br();_Br();vBr();vBr();bBr();bBr();_d();vc();Ff();k9=class extends Ai{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new vie(this._client),this.resources=new u_e(this._client),this.threads=new Cie(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/sessions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:vt([{"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",_a,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/sessions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/sessions/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};k9.Events=vie;k9.Resources=u_e;k9.Threads=Cie});var f_e,TBr=ve(()=>{p();Ul();_d();vc();UEe();Ff();f_e=class extends Ai{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(or`/v1/skills/${e}/versions?beta=true`,FEe({body:s,...n,headers:vt([{"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(or`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/skills/${e}/versions?beta=true`,_a,{query:s,...n,headers:vt([{"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(or`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:vt([{"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(or`/v1/skills/${o}/versions/${e}/content?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var bie,IBr=ve(()=>{p();Ul();TBr();TBr();_d();vc();UEe();Ff();bie=class extends Ai{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new f_e(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",FEe({body:o,...r,headers:vt([{"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(or`/v1/skills/${e}?beta=true`,{...n,headers:vt([{"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",_a,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/skills/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};bie.Versions=f_e});var p_e,xBr=ve(()=>{p();Ul();_d();vc();Ff();p_e=class extends Ai{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:vt([{"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(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:vt([{"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(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/vaults/${e}/credentials?beta=true`,_a,{query:s,...n,headers:vt([{"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(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:vt([{"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(or`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:vt([{"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(or`/v1/vaults/${o}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Sie,wBr=ve(()=>{p();Ul();xBr();xBr();_d();vc();Ff();Sie=class extends Ai{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new p_e(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/vaults/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:vt([{"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",_a,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/vaults/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/vaults/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Sie.Credentials=p_e});var iA,RBr=ve(()=>{p();Ul();RLr();RLr();kLr();kLr();PLr();PLr();MLr();MLr();LLr();LLr();tBr();tBr();iBr();iBr();EBr();EBr();SBr();SBr();IBr();IBr();wBr();wBr();iA=class extends Ai{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new qEe(this._client),this.messages=new R9(this._client),this.agents=new fie(this._client),this.environments=new yie(this._client),this.sessions=new k9(this._client),this.vaults=new Sie(this._client),this.memoryStores=new MV(this._client),this.files=new QEe(this._client),this.skills=new bie(this._client),this.webhooks=new GEe(this._client),this.userProfiles=new jEe(this._client)}};iA.Models=qEe;iA.Messages=R9;iA.Agents=fie;iA.Environments=yie;iA.Sessions=k9;iA.Vaults=Sie;iA.MemoryStores=MV;iA.Files=QEe;iA.Skills=bie;iA.Webhooks=GEe;iA.UserProfiles=jEe});var Tie,kBr=ve(()=>{p();Ul();vc();Tie=class extends Ai{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:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}}});function aGi(t){return t?.output_config?.format}function PBr(t,e,r){let n=aGi(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}:DBr(t,e,r)}function DBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=KDc(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 KDc(t,e){let r=aGi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new fr(`Failed to parse structured output: ${n}`)}}var NBr=ve(()=>{p();Bf();a(aGi,"getOutputFormat");a(PBr,"maybeParseMessage");a(DBr,"parseMessage");a(KDc,"parseOutputFormat")});function dGi(t){return t.type==="tool_use"||t.type==="server_tool_use"}var sk,BV,h_e,$3e,DSt,V3e,W3e,NSt,z3e,P9,Y3e,MSt,OSt,Iie,LSt,BSt,K3e,MBr,cGi,OBr,LBr,BBr,FBr,lGi,uGi,FSt,fGi=ve(()=>{p();C1();bEe();n_e();fBr();dBr();NBr();uGi="__json_buf";a(dGi,"tracksToolInput");FSt=class t{static{a(this,"MessageStream")}constructor(e,r){sk.add(this),this.messages=[],this.receivedMessages=[],BV.set(this,void 0),h_e.set(this,null),this.controller=new AbortController,$3e.set(this,void 0),DSt.set(this,()=>{}),V3e.set(this,()=>{}),W3e.set(this,void 0),NSt.set(this,()=>{}),z3e.set(this,()=>{}),P9.set(this,{}),Y3e.set(this,!1),MSt.set(this,!1),OSt.set(this,!1),Iie.set(this,!1),LSt.set(this,void 0),BSt.set(this,void 0),K3e.set(this,void 0),OBr.set(this,n=>{if(qt(this,MSt,!0,"f"),C9(n)&&(n=new Ty),n instanceof Ty)return qt(this,OSt,!0,"f"),this._emit("abort",n);if(n instanceof fr)return this._emit("error",n);if(n instanceof Error){let o=new fr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new fr(String(n)))}),qt(this,$3e,new Promise((n,o)=>{qt(this,DSt,n,"f"),qt(this,V3e,o,"f")}),"f"),qt(this,W3e,new Promise((n,o)=>{qt(this,NSt,n,"f"),qt(this,z3e,o,"f")}),"f"),xe(this,$3e,"f").catch(()=>{}),xe(this,W3e,"f").catch(()=>{}),qt(this,h_e,e,"f"),qt(this,K3e,r?.logger??console,"f")}get response(){return xe(this,LSt,"f")}get request_id(){return xe(this,BSt,"f")}async withResponse(){qt(this,Iie,!0,"f");let e=await xe(this,$3e,"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,h_e,{...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")},xe(this,OBr,"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{xe(this,sk,"m",LBr).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)xe(this,sk,"m",BBr).call(this,u);if(l.controller.signal?.aborted)throw new Ty;xe(this,sk,"m",FBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,LSt,e,"f"),qt(this,BSt,e?.headers.get("request-id"),"f"),xe(this,DSt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,Y3e,"f")}get errored(){return xe(this,MSt,"f")}get aborted(){return xe(this,OSt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,P9,"f")[e]||(xe(this,P9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,P9,"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(xe(this,P9,"f")[e]||(xe(this,P9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,Iie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,Iie,!0,"f"),await xe(this,W3e,"f")}get currentMessage(){return xe(this,BV,"f")}async finalMessage(){return await this.done(),xe(this,sk,"m",MBr).call(this)}async finalText(){return await this.done(),xe(this,sk,"m",cGi).call(this)}_emit(e,...r){if(xe(this,Y3e,"f"))return;e==="end"&&(qt(this,Y3e,!0,"f"),xe(this,NSt,"f").call(this));let n=xe(this,P9,"f")[e];if(n&&(xe(this,P9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,Iie,"f")&&!n?.length&&Promise.reject(o),xe(this,V3e,"f").call(this,o),xe(this,z3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,Iie,"f")&&!n?.length&&Promise.reject(o),xe(this,V3e,"f").call(this,o),xe(this,z3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,sk,"m",MBr).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{xe(this,sk,"m",LBr).call(this),this._connected(null);let s=OL.fromReadableStream(e,this.controller);for await(let c of s)xe(this,sk,"m",BBr).call(this,c);if(s.controller.signal?.aborted)throw new Ty;xe(this,sk,"m",FBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(BV=new WeakMap,h_e=new WeakMap,$3e=new WeakMap,DSt=new WeakMap,V3e=new WeakMap,W3e=new WeakMap,NSt=new WeakMap,z3e=new WeakMap,P9=new WeakMap,Y3e=new WeakMap,MSt=new WeakMap,OSt=new WeakMap,Iie=new WeakMap,LSt=new WeakMap,BSt=new WeakMap,K3e=new WeakMap,OBr=new WeakMap,sk=new WeakSet,MBr=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_MessageStream_getFinalMessage"),cGi=a(function(){if(this.receivedMessages.length===0)throw new fr("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 fr("stream ended without producing a content block with type=text");return r.join(" ")},"_MessageStream_getFinalText"),LBr=a(function(){this.ended||qt(this,BV,void 0,"f")},"_MessageStream_beginRequest"),BBr=a(function(r){if(this.ended)return;let n=xe(this,sk,"m",lGi).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":{dGi(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(PBr(n,xe(this,h_e,"f"),{logger:xe(this,K3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,BV,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),FBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,BV,"f");if(!r)throw new fr("request ended without sending any chunks");return qt(this,BV,void 0,"f"),PBr(r,xe(this,h_e,"f"),{logger:xe(this,K3e,"f")})},"_MessageStream_endRequest"),lGi=a(function(r){let n=xe(this,BV,"f");if(r.type==="message_start"){if(n)throw new fr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new fr(`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&&dGi(o)){let s=o[uGi]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,uGi,{value:s,enumerable:!1,writable:!0}),s&&(c.input=bSt(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 OL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var m_e,UBr=ve(()=>{p();Ul();_d();vc();oBr();n_e();Ff();m_e=class extends Ai{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(or`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",rk,{query:e,...r})}delete(e,r){return this._client.delete(or`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(or`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new fr(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:vt([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>i_e.fromResponse(s.response,s.controller))}}});var FV,pGi,ZDc,QBr=ve(()=>{p();Ul();vc();S3e();fGi();NBr();UBr();UBr();aBr();FV=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new m_e(this._client)}create(e,r){e.model in pGi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${pGi[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),ZDc.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=CSt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=tSt(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:vt([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>DBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return FSt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},pGi={"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"},ZDc=["claude-mythos-preview","claude-opus-4-6"];FV.Batches=m_e});var xie,qBr=ve(()=>{p();Ul();_d();vc();Ff();xie=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/models/${e}`,{...n,headers:vt([{...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",rk,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var hGi=ve(()=>{p();Wji();RBr();kBr();QBr();qBr()});var jBr,HBr,USt,mGi,gGi,AGi,Qf,BL,GBr=ve(()=>{p();C1();N1t();NL();NEe();bEe();L1t();MEe();aji();lLr();p3e();Bf();LEe();Tji();jji();_d();xLr();hGi();K1t();kBr();qBr();RBr();QBr();L1t();vc();A3e();S9();NL();gGi="\\n\\nHuman:",AGi="\\n\\nAssistant:",Qf=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=Ea("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=Ea("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(jBr.add(this),this._requestAuthFlags=new WeakMap,USt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:Ea("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:Ea("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&&nji())throw new fr(`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??jBr.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=dLr(c.logLevel,"ClientOptions.logLevel",this)??dLr(_a("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??eji(),qt(this,FSt,rji,"f");let u=_a("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=gLr(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=>{gl(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{gl(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new H1t(e,r=>{gl(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 Bji(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 fr(`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,vt([{Authorization:`Bearer ${r}`}])}return vt([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return vt([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return vt([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return hji(e)}getUserAgent(){return`${this.constructor.name}/JS ${ek}`}defaultIdempotencyKey(){return`stainless-node-retry-${vEe()}`}makeStatusError(e,r,n,o){return Ch.generate(e,r,n,o)}buildURL(e,r,n){let o=!xe(this,qBr,"m",dGi).call(this)&&n||this.baseURL,s=Wqi(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!X4r(c)||!X4r(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 fr("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(lie)||o.append("anthropic-beta",lie),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 uie(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(gl(this).debug(`[${d}] sending request`,C9({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new Ty;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(u3e),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new Ty;let v=v9(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return gl(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),gl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,C9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw gl(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),gl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,C9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new bEe:new TV({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let x=`retrying, ${r} attempts remaining`;return await tji(g.body),gl(this).info(`${E} - ${x}`),gl(this).debug(`[${d}] response error (${x})`,C9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";gl(this).info(`${E} - ${v}`);let b=await g.text().catch(x=>u3e(x).message),T=M1t(b),w=T?void 0:b;throw gl(this).debug(`[${d}] response error (${v})`,C9({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 gl(this).info(E),gl(this).debug(`[${d}] response start`,C9({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 E3e(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 TN(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 fr("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&&Yqi("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=vt([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))}:{},...f3e(),...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=vt([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:L1t(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)}:xe(this,FSt,"f").call(this,{body:e,headers:n})}};jBr=Qf,FSt=new WeakMap,qBr=new WeakSet,dGi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");Qf.Anthropic=jBr;Qf.HUMAN_PROMPT=fGi;Qf.AI_PROMPT=pGi;Qf.DEFAULT_TIMEOUT=6e5;Qf.AnthropicError=fr;Qf.APIError=Ch;Qf.APIConnectionError=TV;Qf.APIConnectionTimeoutError=bEe;Qf.APIUserAbortError=Ty;Qf.NotFoundError=xEe;Qf.ConflictError=wEe;Qf.RateLimitError=kEe;Qf.BadRequestError=SEe;Qf.AuthenticationError=TEe;Qf.InternalServerError=PEe;Qf.PermissionDeniedError=IEe;Qf.UnprocessableEntityError=REe;Qf.toFile=Z1t;BL=class extends Qf{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new Tie(this),this.messages=new BV(this),this.models=new xie(this),this.beta=new iA(this)}};BL.Completions=Tie;BL.Messages=BV;BL.Models=xie;BL.Beta=iA});var qLr=ve(()=>{p();HBr();ILr();Y1t();HBr();_d();Bf()});var b3r=I((pFh,AWi)=>{p();var dFe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,xLc=typeof AbortController=="function",RTt=xLc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new hWi}abort(){this.signal.dispatchEvent("abort")}},wLc=typeof AbortSignal=="function",RLc=typeof RTt.AbortSignal=="function",hWi=wLc?AbortSignal:RLc?RTt.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))}},v3r=new Set,y3r=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;kTt(r)&&C3r(r,`${t} option`,`options.${e}`,D_e)},"deprecatedOption"),E3r=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(kTt(r)){let{prototype:n}=D_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);C3r(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),kLc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(kTt(r)){let{prototype:n}=D_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);C3r(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),mWi=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),kTt=a(t=>!v3r.has(t),"shouldWarn"),C3r=a((t,e,r,n)=>{v3r.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;mWi(o,"DeprecationWarning",t,n)},"warn"),Die=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),gWi=a(t=>Die(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?P_e:null:null,"getUintArray"),P_e=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},_3r=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=gWi(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},D_e=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:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v}=e,{length:b,maxAge:T,stale:w}=e instanceof t?{}:e;if(r!==0&&!Die(r))throw new TypeError("max option must be a nonnegative integer");let R=r?gWi(r):Array;if(!R)throw new Error("invalid max value: "+r);if(this.max=r,this.maxSize=g,this.sizeCalculation=A||b,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=E,!this.fetchMethod&&E!==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 _3r(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=!!_,this.maxSize!==0){if(!Die(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=Die(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!Die(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";kTt(x)&&(v3r.add(x),mWi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&y3r("stale","allowStale"),T&&y3r("maxAge","ttl"),b&&y3r("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new P_e(this.max),this.starts=new P_e(this.max),this.setItemTTL=(n,o,s=dFe.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?dFe.now():0};let e=0,r=a(()=>{let n=dFe.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 P_e(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!Die(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!Die(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 E3r("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=dFe.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=dFe.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 RTt,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 E=this.backgroundFetch(e,A,g,h);return r&&E.__staleWhileFetching!==void 0?E.__staleWhileFetching:E.__returned=E}}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 E3r("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 E3r("reset","clear"),this.clear}get length(){return kLc("length","size"),this.size}static get AbortController(){return RTt}static get AbortSignal(){return hWi}};AWi.exports=D_e});var I3r=I((gFh,yWi)=>{"use strict";p();var fFe=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}},S3r=class extends fFe{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)}},T3r=class extends fFe{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};yWi.exports={FetchBaseError:fFe,FetchError:S3r,AbortError:T3r}});var N9=I((EFh,_Wi)=>{"use strict";p();var{constants:{MAX_LENGTH:PLc}}=require("buffer"),{pipeline:PTt,PassThrough:DLc}=require("stream"),{promisify:NLc}=require("util"),{createGunzip:MLc,createInflate:OLc,createBrotliDecompress:LLc,constants:{Z_SYNC_FLUSH:EWi}}=require("zlib"),BLc=EP()("helix-fetch:utils"),FLc=NLc(PTt),ULc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),QLc=a((t,e,r,n)=>{if(!ULc(t,e))return r;let o=a(s=>{s&&(BLc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return PTt(r,MLc({flush:EWi,finishFlush:EWi}),o);case"deflate":case"x-deflate":return PTt(r,OLc(),o);case"br":return PTt(r,LLc(),o);default:return r}},"decodeStream"),qLc=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"),DTt=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)?jLc(t,e):HLc(t,e);default:return 0}},"calcSize"),jLc=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:DTt(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),HLc=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+=DTt(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=DTt(t[o],e)}),r},"calcObjectSize"),GLc=a(t=>DTt(t,new WeakSet),"sizeof"),$Lc=a(async t=>{let e=new DLc,r=0,n=[];return e.on("data",o=>{if(r+o.length>PLc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await FLc(t,e),Buffer.concat(n,r)},"streamToBuffer");_Wi.exports={decodeStream:QLc,isPlainObject:qLc,sizeof:GLc,streamToBuffer:$Lc}});var MTt=I((CFh,SWi)=>{"use strict";p();var{PassThrough:vWi,Readable:M9}=require("stream"),{types:{isAnyArrayBuffer:bWi}}=require("util"),{FetchError:VLc,FetchBaseError:WLc}=I3r(),{streamToBuffer:zLc}=N9(),YLc=Buffer.alloc(0),lk=Symbol("Body internals"),KLc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),CWi=a(async t=>{if(t[lk].disturbed)throw new TypeError("Already read");if(t[lk].error)throw new TypeError(`Stream had error: ${t[lk].error.message}`);t[lk].disturbed=!0;let{stream:e}=t[lk];return e===null?YLc:zLc(e)},"consume"),NTt=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=M9.from(e.toString()):e instanceof M9?r=e:Buffer.isBuffer(e)?r=M9.from(e):bWi(e)?r=M9.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=M9.from(e):r=M9.from(String(e)),this[lk]={stream:r,disturbed:!1,error:null},e instanceof M9&&r.on("error",n=>{let o=n instanceof WLc?n:new VLc(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[lk].error=o})}get body(){return this[lk].stream}get bodyUsed(){return this[lk].disturbed}async buffer(){return CWi(this)}async arrayBuffer(){return KLc(await this.buffer())}async text(){return(await CWi(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(NTt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var JLc=a(t=>{if(t[lk].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[lk],r=e;if(e instanceof M9){r=new vWi;let n=new vWi;e.pipe(r),e.pipe(n),t[lk].stream=n}return r},"cloneStream"),ZLc=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)||bWi(t)||t instanceof M9?null:"text/plain; charset=utf-8","guessContentType");SWi.exports={Body:NTt,cloneStream:JLc,guessContentType:ZLc}});var N_e=I((TFh,wWi)=>{"use strict";p();var{validateHeaderName:TWi,validateHeaderValue:IWi}=require("http"),{isPlainObject:XLc}=N9(),O9=Symbol("Headers internals"),pFe=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof TWi=="function")TWi(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"),xWi=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof IWi=="function")IWi(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"),OTt=class t{static{a(this,"Headers")}constructor(e={}){if(this[O9]={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(XLc(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[O9].map.set(pFe(e),xWi(r,e))}has(e){return this[O9].map.has(pFe(e))}get(e){let r=this[O9].map.get(pFe(e));return r===void 0?null:r}append(e,r){let n=pFe(e),o=xWi(r,e),s=this[O9].map.get(n);this[O9].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[O9].map.delete(pFe(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[O9].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[O9].map)}};Object.defineProperties(OTt.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));wWi.exports={Headers:OTt}});var x3r=I((wFh,RWi)=>{"use strict";p();var{EventEmitter:eBc}=require("events"),NN=Symbol("AbortSignal internals"),M_e=class{static{a(this,"AbortSignal")}constructor(){this[NN]={eventEmitter:new eBc,onabort:null,aborted:!1}}get aborted(){return this[NN].aborted}get onabort(){return this[NN].onabort}set onabort(e){this[NN].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,r){this[NN].eventEmitter.removeListener(e,r)}addEventListener(e,r){this[NN].eventEmitter.on(e,r)}dispatchEvent(e){let r={type:e,target:this},n=`on${e}`;typeof this[NN][n]=="function"&&this[n](r),this[NN].eventEmitter.emit(e,r)}fire(){this[NN].aborted=!0,this.dispatchEvent("abort")}};Object.defineProperties(M_e.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var BTt=class extends M_e{static{a(this,"TimeoutSignal")}constructor(e){if(!Number.isInteger(e))throw new TypeError(`Expected an integer, got ${typeof e}`);super(),this[NN].timerId=setTimeout(()=>{this.fire()},e)}clear(){clearTimeout(this[NN].timerId)}};Object.defineProperties(BTt.prototype,{clear:{enumerable:!0}});var LTt=Symbol("AbortController internals"),FTt=class{static{a(this,"AbortController")}constructor(){this[LTt]={signal:new M_e}}get signal(){return this[LTt].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[LTt].signal.aborted||this[LTt].signal.fire()}};Object.defineProperties(FTt.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});RWi.exports={AbortController:FTt,AbortSignal:M_e,TimeoutSignal:BTt}});var hFe=I((PFh,DWi)=>{"use strict";p();var{randomBytes:tBc}=require("crypto"),{Readable:rBc}=require("stream"),R3r=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"),nBc=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"),kWi=a(t=>`--${t}--\r +`);this.baseURL=c.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!e,this.timeout=c.timeout??HBr.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=fLr(c.logLevel,"ClientOptions.logLevel",this)??fLr(Ea("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??iji(),qt(this,USt,sji,"f");let u=Ea("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=ALr(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=>{gl(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{gl(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new G1t(e,r=>{gl(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 qji(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 fr(`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,vt([{Authorization:`Bearer ${r}`}])}return vt([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return vt([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return vt([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return yji(e)}getUserAgent(){return`${this.constructor.name}/JS ${tk}`}defaultIdempotencyKey(){return`stainless-node-retry-${CEe()}`}makeStatusError(e,r,n,o){return Ch.generate(e,r,n,o)}buildURL(e,r,n){let o=!xe(this,jBr,"m",mGi).call(this)&&n||this.baseURL,s=Jqi(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!eLr(c)||!eLr(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 fr("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(lie)||o.append("anthropic-beta",lie),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 uie(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(gl(this).debug(`[${d}] sending request`,b9({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new Ty;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(f3e),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new Ty;let v=C9(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return gl(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),gl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,b9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw gl(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),gl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,b9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new SEe:new IV({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let x=`retrying, ${r} attempts remaining`;return await oji(g.body),gl(this).info(`${E} - ${x}`),gl(this).debug(`[${d}] response error (${x})`,b9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";gl(this).info(`${E} - ${v}`);let b=await g.text().catch(x=>f3e(x).message),T=O1t(b),w=T?void 0:b;throw gl(this).debug(`[${d}] response error (${v})`,b9({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 gl(this).info(E),gl(this).debug(`[${d}] response start`,b9({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 v3e(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 IN(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 fr("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&&Xqi("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=vt([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))}:{},...h3e(),...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=vt([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:B1t(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)}:xe(this,USt,"f").call(this,{body:e,headers:n})}};HBr=Qf,USt=new WeakMap,jBr=new WeakSet,mGi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");Qf.Anthropic=HBr;Qf.HUMAN_PROMPT=gGi;Qf.AI_PROMPT=AGi;Qf.DEFAULT_TIMEOUT=6e5;Qf.AnthropicError=fr;Qf.APIError=Ch;Qf.APIConnectionError=IV;Qf.APIConnectionTimeoutError=SEe;Qf.APIUserAbortError=Ty;Qf.NotFoundError=wEe;Qf.ConflictError=REe;Qf.RateLimitError=PEe;Qf.BadRequestError=TEe;Qf.AuthenticationError=IEe;Qf.InternalServerError=DEe;Qf.PermissionDeniedError=xEe;Qf.UnprocessableEntityError=kEe;Qf.toFile=X1t;BL=class extends Qf{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new Tie(this),this.messages=new FV(this),this.models=new xie(this),this.beta=new iA(this)}};BL.Completions=Tie;BL.Messages=FV;BL.Models=xie;BL.Beta=iA});var jLr=ve(()=>{p();GBr();xLr();K1t();GBr();_d();Bf()});var S3r=I((_Fh,vWi)=>{p();var pFe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,NLc=typeof AbortController=="function",kTt=NLc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new yWi}abort(){this.signal.dispatchEvent("abort")}},MLc=typeof AbortSignal=="function",OLc=typeof kTt.AbortSignal=="function",yWi=MLc?AbortSignal:OLc?kTt.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))}},C3r=new Set,E3r=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;PTt(r)&&b3r(r,`${t} option`,`options.${e}`,N_e)},"deprecatedOption"),_3r=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(PTt(r)){let{prototype:n}=N_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);b3r(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),LLc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(PTt(r)){let{prototype:n}=N_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);b3r(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),EWi=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),PTt=a(t=>!C3r.has(t),"shouldWarn"),b3r=a((t,e,r,n)=>{C3r.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;EWi(o,"DeprecationWarning",t,n)},"warn"),Die=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),_Wi=a(t=>Die(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?D_e:null:null,"getUintArray"),D_e=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},v3r=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=_Wi(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},N_e=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:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v}=e,{length:b,maxAge:T,stale:w}=e instanceof t?{}:e;if(r!==0&&!Die(r))throw new TypeError("max option must be a nonnegative integer");let R=r?_Wi(r):Array;if(!R)throw new Error("invalid max value: "+r);if(this.max=r,this.maxSize=g,this.sizeCalculation=A||b,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=E,!this.fetchMethod&&E!==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 v3r(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=!!_,this.maxSize!==0){if(!Die(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=Die(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!Die(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";PTt(x)&&(C3r.add(x),EWi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&E3r("stale","allowStale"),T&&E3r("maxAge","ttl"),b&&E3r("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new D_e(this.max),this.starts=new D_e(this.max),this.setItemTTL=(n,o,s=pFe.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?pFe.now():0};let e=0,r=a(()=>{let n=pFe.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 D_e(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!Die(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!Die(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 _3r("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=pFe.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=pFe.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 kTt,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 E=this.backgroundFetch(e,A,g,h);return r&&E.__staleWhileFetching!==void 0?E.__staleWhileFetching:E.__returned=E}}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 _3r("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 _3r("reset","clear"),this.clear}get length(){return LLc("length","size"),this.size}static get AbortController(){return kTt}static get AbortSignal(){return yWi}};vWi.exports=N_e});var x3r=I((bFh,CWi)=>{"use strict";p();var hFe=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}},T3r=class extends hFe{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)}},I3r=class extends hFe{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};CWi.exports={FetchBaseError:hFe,FetchError:T3r,AbortError:I3r}});var M9=I((IFh,SWi)=>{"use strict";p();var{constants:{MAX_LENGTH:BLc}}=require("buffer"),{pipeline:DTt,PassThrough:FLc}=require("stream"),{promisify:ULc}=require("util"),{createGunzip:QLc,createInflate:qLc,createBrotliDecompress:jLc,constants:{Z_SYNC_FLUSH:bWi}}=require("zlib"),HLc=_P()("helix-fetch:utils"),GLc=ULc(DTt),$Lc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),VLc=a((t,e,r,n)=>{if(!$Lc(t,e))return r;let o=a(s=>{s&&(HLc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return DTt(r,QLc({flush:bWi,finishFlush:bWi}),o);case"deflate":case"x-deflate":return DTt(r,qLc(),o);case"br":return DTt(r,jLc(),o);default:return r}},"decodeStream"),WLc=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"),NTt=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)?zLc(t,e):YLc(t,e);default:return 0}},"calcSize"),zLc=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:NTt(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),YLc=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+=NTt(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=NTt(t[o],e)}),r},"calcObjectSize"),KLc=a(t=>NTt(t,new WeakSet),"sizeof"),JLc=a(async t=>{let e=new FLc,r=0,n=[];return e.on("data",o=>{if(r+o.length>BLc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await GLc(t,e),Buffer.concat(n,r)},"streamToBuffer");SWi.exports={decodeStream:VLc,isPlainObject:WLc,sizeof:KLc,streamToBuffer:JLc}});var OTt=I((RFh,wWi)=>{"use strict";p();var{PassThrough:TWi,Readable:O9}=require("stream"),{types:{isAnyArrayBuffer:xWi}}=require("util"),{FetchError:ZLc,FetchBaseError:XLc}=x3r(),{streamToBuffer:eBc}=M9(),tBc=Buffer.alloc(0),uk=Symbol("Body internals"),rBc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),IWi=a(async t=>{if(t[uk].disturbed)throw new TypeError("Already read");if(t[uk].error)throw new TypeError(`Stream had error: ${t[uk].error.message}`);t[uk].disturbed=!0;let{stream:e}=t[uk];return e===null?tBc:eBc(e)},"consume"),MTt=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=O9.from(e.toString()):e instanceof O9?r=e:Buffer.isBuffer(e)?r=O9.from(e):xWi(e)?r=O9.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=O9.from(e):r=O9.from(String(e)),this[uk]={stream:r,disturbed:!1,error:null},e instanceof O9&&r.on("error",n=>{let o=n instanceof XLc?n:new ZLc(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[uk].error=o})}get body(){return this[uk].stream}get bodyUsed(){return this[uk].disturbed}async buffer(){return IWi(this)}async arrayBuffer(){return rBc(await this.buffer())}async text(){return(await IWi(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(MTt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var nBc=a(t=>{if(t[uk].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[uk],r=e;if(e instanceof O9){r=new TWi;let n=new TWi;e.pipe(r),e.pipe(n),t[uk].stream=n}return r},"cloneStream"),iBc=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)||xWi(t)||t instanceof O9?null:"text/plain; charset=utf-8","guessContentType");wWi.exports={Body:MTt,cloneStream:nBc,guessContentType:iBc}});var M_e=I((DFh,DWi)=>{"use strict";p();var{validateHeaderName:RWi,validateHeaderValue:kWi}=require("http"),{isPlainObject:oBc}=M9(),L9=Symbol("Headers internals"),mFe=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof RWi=="function")RWi(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"),PWi=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof kWi=="function")kWi(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"),LTt=class t{static{a(this,"Headers")}constructor(e={}){if(this[L9]={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(oBc(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[L9].map.set(mFe(e),PWi(r,e))}has(e){return this[L9].map.has(mFe(e))}get(e){let r=this[L9].map.get(mFe(e));return r===void 0?null:r}append(e,r){let n=mFe(e),o=PWi(r,e),s=this[L9].map.get(n);this[L9].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[L9].map.delete(mFe(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[L9].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[L9].map)}};Object.defineProperties(LTt.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));DWi.exports={Headers:LTt}});var w3r=I((OFh,NWi)=>{"use strict";p();var{EventEmitter:sBc}=require("events"),MN=Symbol("AbortSignal internals"),O_e=class{static{a(this,"AbortSignal")}constructor(){this[MN]={eventEmitter:new sBc,onabort:null,aborted:!1}}get aborted(){return this[MN].aborted}get onabort(){return this[MN].onabort}set onabort(e){this[MN].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,r){this[MN].eventEmitter.removeListener(e,r)}addEventListener(e,r){this[MN].eventEmitter.on(e,r)}dispatchEvent(e){let r={type:e,target:this},n=`on${e}`;typeof this[MN][n]=="function"&&this[n](r),this[MN].eventEmitter.emit(e,r)}fire(){this[MN].aborted=!0,this.dispatchEvent("abort")}};Object.defineProperties(O_e.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var FTt=class extends O_e{static{a(this,"TimeoutSignal")}constructor(e){if(!Number.isInteger(e))throw new TypeError(`Expected an integer, got ${typeof e}`);super(),this[MN].timerId=setTimeout(()=>{this.fire()},e)}clear(){clearTimeout(this[MN].timerId)}};Object.defineProperties(FTt.prototype,{clear:{enumerable:!0}});var BTt=Symbol("AbortController internals"),UTt=class{static{a(this,"AbortController")}constructor(){this[BTt]={signal:new O_e}}get signal(){return this[BTt].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[BTt].signal.aborted||this[BTt].signal.fire()}};Object.defineProperties(UTt.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});NWi.exports={AbortController:UTt,AbortSignal:O_e,TimeoutSignal:FTt}});var gFe=I((FFh,LWi)=>{"use strict";p();var{randomBytes:aBc}=require("crypto"),{Readable:cBc}=require("stream"),k3r=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"),lBc=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"),MWi=a(t=>`--${t}--\r \r -`,"getFooter"),PWi=a((t,e,r)=>{let n="";return n+=`--${t}\r -`,n+=`Content-Disposition: form-data; name="${e}"`,R3r(r)&&(n+=`; filename="${r.name}"\r +`,"getFooter"),OWi=a((t,e,r)=>{let n="";return n+=`--${t}\r +`,n+=`Content-Disposition: form-data; name="${e}"`,k3r(r)&&(n+=`; filename="${r.name}"\r `,n+=`Content-Type: ${r.type||"application/octet-stream"}`),`${n}\r \r -`},"getHeader");async function*iBc(t,e){for(let[r,n]of t)yield PWi(e,r,n),R3r(n)?yield*n.stream():yield n,yield`\r -`;yield kWi(e)}a(iBc,"formDataIterator");var oBc=a((t,e)=>{let r=0;for(let[n,o]of t)r+=Buffer.byteLength(PWi(e,n,o)),r+=R3r(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r -`);return r+=Buffer.byteLength(kWi(e)),r},"getFormDataLength"),w3r=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=tBc(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=oBc(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return rBc.from(iBc(this.fd,this.boundary))}};DWi.exports={isFormData:nBc,FormDataSerializer:w3r}});var MWi=I((OFh,NWi)=>{"use strict";p();var{AbortSignal:MFh}=x3r(),{Body:sBc,cloneStream:aBc,guessContentType:cBc}=MTt(),{Headers:lBc}=N_e(),{isPlainObject:uBc}=N9(),{isFormData:dBc,FormDataSerializer:fBc}=hFe(),pBc=20,HV=Symbol("Request internals"),UTt=class t extends sBc{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?aBc(n):null),l=new lBc(r.headers||n&&n.headers||{});if(dBc(c)&&!l.has("content-type")){let h=new fBc(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(uBc(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=cBc(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[HV]={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=pBc: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[HV].method}get url(){return this[HV].parsedURL.toString()}get headers(){return this[HV].headers}get redirect(){return this[HV].redirect}get cache(){return this[HV].cache}get signal(){return this[HV].signal}clone(){return new t(this)}get init(){return this[HV].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(UTt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});NWi.exports={Request:UTt}});var k3r=I((FFh,OWi)=>{"use strict";p();var{Body:hBc,cloneStream:mBc,guessContentType:gBc}=MTt(),{Headers:ABc}=N_e(),{isPlainObject:yBc}=N9(),{isFormData:EBc,FormDataSerializer:_Bc}=hFe(),MN=Symbol("Response internals"),QTt=class t extends hBc{static{a(this,"Response")}constructor(e=null,r={}){let n=new ABc(r.headers),o=e;if(EBc(o)&&!n.has("content-type")){let s=new _Bc(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(yBc(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=gBc(o);s&&n.set("content-type",s)}super(o),this[MN]={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[MN].url||""}get status(){return this[MN].status}get statusText(){return this[MN].statusText}get ok(){return this[MN].status>=200&&this[MN].status<300}get redirected(){return this[MN].counter>0}get headers(){return this[MN].headers}get httpVersion(){return this[MN].httpVersion}get decoded(){return this[MN].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(mBc(this),{...this[MN]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(QTt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});OWi.exports={Response:QTt}});var BWi=I((jFh,LWi)=>{"use strict";p();var vBc=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),CBc=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),bBc=new Set([500,502,503,504]),SBc={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},TBc={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function Nie(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(Nie,"toNumberOrZero");function IBc(t){return t?bBc.has(t.status):!0}a(IBc,"isErrorResponse");function P3r(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(P3r,"parseCacheControl");function xBc(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(xBc,"formatCacheControl");LWi.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=P3r(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=P3r(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":xBc(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())&&CBc.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||vBc.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=P3r(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)SBc[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 Nie(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 Nie(this._rescc["s-maxage"])}if(this._rescc["max-age"])return Nie(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+Nie(this._rescc["stale-if-error"]),n=e+Nie(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+Nie(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+Nie(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()&&IBc(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&&!TBc[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 qWi=I(($Fh,QWi)=>{"use strict";p();var wBc=BWi(),{Headers:RBc}=N_e(),FWi=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),UWi=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),D3r=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new wBc(FWi(e),UWi(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(FWi(e))}responseHeaders(e){return new RBc(this.policy.responseHeaders(UWi(e)))}timeToLive(){return this.policy.timeToLive()}};QWi.exports=D3r});var GWi=I((zFh,HWi)=>{"use strict";p();var{Readable:kBc}=require("stream"),{Headers:jWi}=N_e(),{Response:PBc}=k3r(),GV=Symbol("CacheableResponse internals"),DBc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),N3r=class t extends PBc{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new jWi(r.headers);this[GV]={headers:n,bufferedBody:e}}get headers(){return this[GV].headers}set headers(e){if(e instanceof jWi)this[GV].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return kBc.from(this[GV].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[GV].bufferedBody}async arrayBuffer(){return DBc(this[GV].bufferedBody)}async text(){return this[GV].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[GV].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},NBc=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 N3r(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");HWi.exports={cacheableResponse:NBc}});var qTt=I((JFh,$Wi)=>{"use strict";p();var M3r=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};$Wi.exports={RequestAbortedError:M3r}});var KWi=I((e8h,YWi)=>{"use strict";p();var WWi=require("http"),zWi=require("https"),{Readable:MBc}=require("stream"),L9=EP()("helix-fetch:h1"),{RequestAbortedError:VWi}=qTt(),{decodeStream:OBc}=N9(),LBc=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 zWi.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new WWi.Agent(n),r.httpAgent):void 0},"getAgent"),BBc=a(t=>{t.h1={}},"setupContext"),FBc=a(async({h1:t})=>{t.httpAgent&&(L9("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(L9("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),UBc=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?OBc(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"),QBc=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?zWi:WWi,o=LBc(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)=>{L9(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{L9(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{L9(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(L9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new VWi),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new VWi);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(L9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(UBc(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(L9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(L9(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof MBc?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");YWi.exports={request:QBc,setupContext:BBc,resetContext:FBc}});var ezi=I((n8h,XWi)=>{"use strict";p();var{connect:qBc,constants:jBc}=require("http2"),{Readable:HBc}=require("stream"),vd=EP()("helix-fetch:h2"),{RequestAbortedError:JWi}=qTt(),{decodeStream:GBc}=N9(),{NGHTTP2_CANCEL:mFe}=jBc,$Bc=300*1e3,VBc=5e3,WBc=a(t=>{t.h2={sessionCache:{}}},"setupContext"),zBc=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),vd(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),ZWi=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?GBc(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"),YBc=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=VBc}}}=t,d=o[":path"],f=`${e}${d}`;vd(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(mFe)},"rejectPush")),n.on("push",(h,m)=>{vd(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{vd(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(mFe)}),l&&l(f,o,ZWi(h,n,r))}),n.on("aborted",()=>{vd(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{vd(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{vd(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),KBc=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=$Bc,pushPromiseHandler:h,pushHandler:m}=u,g={...r},{method:A,headers:y,socket:E,body:_,decode:v}=g;return E&&delete g.socket,y.host&&(y[":authority"]=y.host,delete y.host),new Promise((b,T)=>{let w=d[n];if(!w||w.closed||w.destroyed){let N=!(t.options.rejectUnauthorized===!1||u.rejectUnauthorized===!1),L={...u,rejectUnauthorized:N};E&&!E.inUse&&(L.createConnection=()=>(vd(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E)),w=qBc(n,{...L,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{vd(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{vd(`session ${n} established`),vd(`caching session ${n}`),d[n]=w}),w.on("localSettings",q=>{vd(`session ${n} localSettings: ${JSON.stringify(q)}`)}),w.on("remoteSettings",q=>{vd(`session ${n} remoteSettings: ${JSON.stringify(q)}`)}),w.once("close",()=>{vd(`session ${n} closed`),d[n]===w&&(vd(`discarding cached session ${n}`),delete d[n])}),w.once("error",q=>{vd(`session ${n} encountered error: ${q}`),d[n]===w&&(vd(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(q,M,O)=>{vd(`session ${n} encountered frameError: type: ${q}, code: ${M}, id: ${O}`)}),w.once("goaway",(q,M,O)=>{vd(`session ${n} received GOAWAY frame: errorCode: ${q}, lastStreamID: ${M}, opaqueData: ${O?O.toString():void 0}`)}),w.on("stream",(q,M,O)=>{YBc(t,n,v,q,M,O)})}else E&&E.id!==w.socket.id&&!E.inUse&&(vd(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());vd(`${A} ${e.host}${l}`);let R,{signal:x}=g,P=a(()=>{x.removeEventListener("abort",P),T(new JWi),R&&R.close(mFe)},"onAbortSignal");if(x){if(x.aborted){T(new JWi);return}x.addEventListener("abort",P)}let D=a(N=>{vd(`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",P),b(ZWi(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),R.rstCode!==mFe&&(vd(`${g.method} ${e.href} failed with: ${N.message}`),R.close(mFe),T(N))}),R.once("frameError",(N,L,B)=>{w.off("error",D),vd(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${L}, id: ${B}`)}),R.on("push",(N,L)=>{vd(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${L}`)}),_ instanceof HBc?_.pipe(R):(_&&R.write(_),R.end())})},"request");XWi.exports={request:KBc,setupContext:WBc,resetContext:zBc}});var rzi=I((s8h,tzi)=>{"use strict";p();var{EventEmitter:JBc}=require("events"),ZBc=a(()=>{let t={},e=new JBc;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");tzi.exports=ZBc});var nzi=I((l8h,XBc)=>{XBc.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 czi=I((u8h,azi)=>{"use strict";p();var{Readable:e3c}=require("stream"),t3c=require("tls"),{types:{isAnyArrayBuffer:r3c}}=require("util"),n3c=b3r(),O3r=EP()("helix-fetch:core"),{RequestAbortedError:jTt}=qTt(),L3r=KWi(),HTt=ezi(),i3c=rzi(),{isPlainObject:o3c}=N9(),{isFormData:s3c,FormDataSerializer:a3c}=hFe(),{version:c3c}=nzi(),B3r="h2",F3r="h2c",U3r="http/1.0",Mie="http/1.1",l3c=100,u3c=3600*1e3,d3c=[B3r,Mie,U3r],f3c=`helix-fetch/${c3c}`,p3c={method:"GET",compress:!0,decode:!0},izi=0,ozi=i3c(),szi=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new jTt;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new jTt);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof jTt||(O3r(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=t3c.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),izi+=1,s.id=izi,s.secureConnecting=!1,O3r(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),h3c=a(async(t,e)=>{let r=await ozi.acquire(t.origin);try{return r||(r=await szi(t,e)),r}finally{ozi.release(t.origin,r)}},"connect"),m3c=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=Mie,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=F3r,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 h3c(e,d);return o=f.alpnProtocol,o||(o=Mie),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),g3c=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),A3c=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 szi(e,d);return{protocol:f.alpnProtocol||Mie,socket:f}}return{protocol:l.alpnProtocol||Mie,socket:l}},"getProtocolAndSocketFromFactory"),y3c=a(async(t,e,r)=>{let n=new URL(e),o={...p3c,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=g3c(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(s3c(o.body)){let d=new a3c(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":o3c(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):r3c(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 e3c||(!(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 A3c(t.socketFactory,n,o,t.alpnProtocols):await m3c(t,n,c);switch(O3r(`${n.host} -> ${l}`),l){case B3r:try{return await HTt.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 F3r:return HTt.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case U3r:case Mie:return L3r.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),E3c=a(async t=>(t.alpnCache.clear(),Promise.all([L3r.resetContext(t),HTt.resetContext(t)])),"resetContext"),_3c=a(t=>{let{options:{alpnProtocols:e=d3c,alpnCacheTTL:r=u3c,alpnCacheSize:n=l3c,userAgent:o=f3c,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new n3c({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,L3r.setupContext(t),HTt.setupContext(t)},"setupContext");azi.exports={request:y3c,setupContext:_3c,resetContext:E3c,RequestAbortedError:jTt,ALPN_HTTP2:B3r,ALPN_HTTP2C:F3r,ALPN_HTTP1_1:Mie,ALPN_HTTP1_0:U3r}});var uzi=I((p8h,lzi)=>{"use strict";p();var v3c=EP()("helix-fetch:core"),{request:C3c,setupContext:b3c,resetContext:S3c,RequestAbortedError:T3c,ALPN_HTTP2:I3c,ALPN_HTTP2C:x3c,ALPN_HTTP1_1:w3c,ALPN_HTTP1_0:R3c}=czi(),Q3r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},b3c(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:T3c,ALPN_HTTP2:I3c,ALPN_HTTP2C:x3c,ALPN_HTTP1_1:w3c,ALPN_HTTP1_0:R3c}}async request(e,r){return C3c(this,e,r)}setCA(e){this.options.ca=e}async reset(){return v3c("resetting context"),S3c(this)}};lzi.exports=new Q3r().api()});var mzi=I((g8h,hzi)=>{"use strict";p();var{EventEmitter:k3c}=require("events"),{Readable:gFe}=require("stream"),q3r=EP()("helix-fetch"),P3c=b3r(),{Body:D3c}=MTt(),{Headers:$3r}=N_e(),{Request:Oie}=MWi(),{Response:H3r}=k3r(),{FetchBaseError:N3c,FetchError:AFe,AbortError:GTt}=I3r(),{AbortController:M3c,AbortSignal:O3c,TimeoutSignal:L3c}=x3r(),B3c=qWi(),{cacheableResponse:F3c}=GWi(),{sizeof:U3c}=N9(),{isFormData:Q3c}=hFe(),{context:q3c,RequestAbortedError:j3c}=uzi(),dzi=["GET","HEAD"],H3c=500,G3c=100*1024*1024,j3r="push",fzi=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof Oie&&typeof r>"u"?e:new Oie(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 GTt("The operation was aborted.");throw o.init.body instanceof gFe&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof gFe)&&!Q3c(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof gFe&&m.destroy(w),w instanceof TypeError?w:w instanceof j3c?new GTt("The operation was aborted."):new AFe(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new GTt("The operation was aborted.");o.init.body instanceof gFe&&o.init.body.destroy(w),g.readable.emit("error",w)},"abortHandler");l&&l.addEventListener("abort",A);let{statusCode:y,statusText:E,httpVersion:_,headers:v,readable:b,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 AFe(`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 AFe(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new $3r(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 gFe)throw l&&l.removeEventListener("abort",A),new AFe("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),fzi(t,new Oie(R,x))}default:}}return l&&(b.once("end",()=>{l.removeEventListener("abort",A)}),b.once("error",()=>{l.removeEventListener("abort",A)})),new H3r(b,{url:o.url,status:y,statusText:E,headers:v,httpVersion:_,decoded:T,counter:o.counter})},"fetch"),pzi=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!dzi.includes(e.method))return r;let n=new B3c(e,r,{shared:!1});if(n.storable()){let o=await F3c(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),$3c=a(async(t,e,r)=>{let n=new Oie(e,r);if(t.options.maxCacheSize!==0&&dzi.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 $3r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await fzi(t,n);return n.cache!=="no-store"?pzi(t,n,s):s},"cachingFetch"),V3c=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"),W3c=a(t=>new L3c(t),"timeoutSignal"),G3r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:G3c,o=H3c;n===0&&(n=1,o=1);let s=a(({response:l},u)=>U3c(l),"sizeCalculation");this.cache=new P3c({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new k3c,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(_=>_.startsWith(":")).forEach(_=>delete f[_]);let{statusCode:h,statusText:m,httpVersion:g,headers:A,readable:y,decoded:E}=d;this.pushHandler(l,f,new H3r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:E}))}),this.context=q3c(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:D3c,Headers:$3r,Request:Oie,Response:H3r,AbortController:M3c,AbortSignal:O3c,FetchBaseError:N3c,FetchError:AFe,AbortError:GTt,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:V3c,timeoutSignal:W3c,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 $3c(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(j3r,e)}offPush(e){return this.eventEmitter.off(j3r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){q3r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new Oie(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(q3r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){q3r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await pzi(this,new Oie(e,{headers:r}),n);this.eventEmitter.emit(j3r,e,o)}};hzi.exports=new G3r().api()});var Azi=I((E8h,gzi)=>{"use strict";p();gzi.exports=mzi()});var Uzi=I((CUh,Fzi)=>{"use strict";p();function Bzi(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(Bzi,"validateParameter");function _Fc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(_Fc,"hasOwnProperty");function vFc(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(vFc,"defineOperation");Fzi.exports={defineOperation:vFc,validateParameter:Bzi}});var J3r=I((TUh,jzi)=>{"use strict";p();var Q_e=W6e()("kerberos"),U_e=Q_e.KerberosClient,Qzi=Q_e.KerberosServer,VV=Uzi().defineOperation,CFc=1,bFc=2,SFc=4,TFc=8,IFc=16,xFc=32,wFc=64,RFc=128,kFc=256,qzi=0,PFc=9,DFc=6;U_e.prototype.step=VV(U_e.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);U_e.prototype.wrap=VV(U_e.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);U_e.prototype.unwrap=VV(U_e.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);Qzi.prototype.step=VV(Qzi.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var NFc=VV(Q_e.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}]),MFc=VV(Q_e.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),OFc=VV(Q_e.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:qzi}},{name:"callback",type:"function",required:!1}]),LFc=VV(Q_e.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);jzi.exports={initializeClient:OFc,initializeServer:LFc,principalDetails:MFc,checkPassword:NFc,GSS_C_DELEG_FLAG:CFc,GSS_C_MUTUAL_FLAG:bFc,GSS_C_REPLAY_FLAG:SFc,GSS_C_SEQUENCE_FLAG:TFc,GSS_C_CONF_FLAG:IFc,GSS_C_INTEG_FLAG:xFc,GSS_C_ANON_FLAG:wFc,GSS_C_PROT_READY_FLAG:RFc,GSS_C_TRANS_FLAG:kFc,GSS_C_NO_OID:qzi,GSS_MECH_OID_KRB5:PFc,GSS_MECH_OID_SPNEGO:DFc}});var Hzi=I((xUh,BFc)=>{BFc.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 $zi=I((wUh,Gzi)=>{"use strict";p();var FFc=require("dns"),UFc=J3r(),Z3r=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=QFc(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();FFc.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}`;UFc.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 QFc(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=qFc(t),r(null,o)})}}a(QFc,"firstTransition");function qFc(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=jFc(t),r(null,o||"")})}}a(qFc,"secondTransition");function jFc(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=HFc(t),r(null,c)})})}}a(jFc,"thirdTransition");function HFc(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(HFc,"fourthTransition");Gzi.exports={MongoAuthProcess:Z3r}});var Wzi=I((PUh,_Fe)=>{"use strict";p();var Vzi=J3r();_Fe.exports=Vzi;_Fe.exports.Kerberos=Vzi;_Fe.exports.version=Hzi().version;_Fe.exports.processes={MongoAuthProcess:$zi().MongoAuthProcess}});var _oo={};ki(_oo,{AbortError:()=>R1,DirectConnectError:()=>mk,DirectConnectTransport:()=>t6r,EXIT_REASONS:()=>C9c,HOOK_EVENTS:()=>ywt,InMemorySessionStore:()=>r8r,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>b9c,createSdkMcpServer:()=>tZc,deleteSession:()=>trl,filterEscalatingDefaultMode:()=>Qtl,foldSessionSummary:()=>pZi,forkSession:()=>rrl,getSessionInfo:()=>Ztl,getSessionMessages:()=>Ktl,getSubagentMessages:()=>srl,importSessionToStore:()=>nrl,listSessions:()=>Jtl,listSubagents:()=>orl,parseDirectConnectUrl:()=>iZc,query:()=>ztl,renameSession:()=>Xtl,resolveSettings:()=>jtl,startup:()=>Ytl,tagSession:()=>erl,tool:()=>eZc});function q8c(t){return this[t]}function $8c(t,e){this[t]=G8c.bind(null,e)}function t8r(t=_9c){let e=new AbortController;return(0,cZi.setMaxListeners)(t,e.signal),e}function lZi(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 v9c(t,e){t(Error(e))}function Vie(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(v9c,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function T6r(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=T9c.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(!S9c.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function pZi(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=R9c(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)}k9c(c,l);for(let[d,f]of Object.entries(I9c)){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 x9c(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=YV(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=YV(r.customTitle)||YV(r.aiTitle)||void 0,s=o||YV(r.lastPrompt)||YV(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:YV(r.gitBranch)||void 0,cwd:YV(r.cwd)||e||void 0,tag:YV(r.tag)||void 0,createdAt:w9c(r.createdAt)}:null}function YV(t){return typeof t=="string"?t:void 0}function w9c(t){return typeof t=="number"?t:void 0}function R9c(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function k9c(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=T6r(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function hZi(){return process.versions.bun!==void 0}function s_(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 D8e(){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 B9c(t){var e=O9c.call(t,bFe),r=t[bFe];try{t[bFe]=void 0;var n=!0}catch{}var o=L9c.call(t);return n&&(e?t[bFe]=r:delete t[bFe]),o}function q9c(t){return Q9c.call(t)}function $9c(t){return t==null?t===void 0?G9c:H9c:MYi&&MYi in Object(t)?F9c(t):j9c(t)}function V9c(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function J9c(t){if(!z9(t))return!1;var e=N8e(t);return e==z9c||e==Y9c||e==W9c||e==K9c}function X9c(t){return!!OYi&&OYi in t}function nUc(t){if(t!=null){try{return rUc.call(t)}catch{}try{return t+""}catch{}}return""}function fUc(t){if(!z9(t)||eUc(t))return!1;var e=I6r(t)?dUc:sUc;return e.test(iUc(t))}function hUc(t,e){return t?.[e]}function gUc(t,e){var r=mUc(t,e);return pUc(r)?r:void 0}function yUc(){this.__data__=n8e?n8e(null):{},this.size=0}function _Uc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function TUc(t){var e=this.__data__;if(n8e){var r=e[t];return r===CUc?void 0:r}return SUc.call(e,t)?e[t]:void 0}function RUc(t){var e=this.__data__;return n8e?e[t]!==void 0:wUc.call(e,t)}function DUc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n8e&&e===void 0?PUc:e,this}function Ove(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function VUc(t,e){var r=this.__data__,n=_wt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Lve(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 y7c(){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 CZi(...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 bZi(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return CZi({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function P6r(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 E7c(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 v7c(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 Ri(`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 TZi(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new nu(`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 nu(`Refusing to send credential over non-https token endpoint "${t}"`)}async function IZi(t,e){let r=await w7c(t),n;try{n=JSON.parse(r)}catch{throw new nu(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,gk(r),e)}if(!n.access_token)throw new nu(`Token endpoint response missing access_token: ${JSON.stringify(gk(n))}`,t.status,gk(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new nu(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,gk(n),e);return n}function gk(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=bFr?t:t.slice(0,bFr)+`... <${t.length-bFr} more chars>`}return JSON.stringify(gk(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))x7c.has(r)&&(e[r]=n);return e}return null}async function xZi(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 nu(`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 nu(`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 wZi(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 w7c(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>jYi){let l=jYi-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 Wie(){return Math.floor(Date.now()/1e3)}function R7c(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 N6r(t){let e;return(HYi??(e=new globalThis.TextEncoder,HYi=e.encode.bind(e)))(t)}function $Yi(t){let e;return(GYi??(e=new globalThis.TextDecoder,GYi=e.decode.bind(e)))(t)}function GFe(){}function _It(t,e,r){return!e||rxt[t]>rxt[r]?GFe:e[t].bind(e)}function oA(t){let e=t.logger,r=t.logLevel??"off";if(!e)return k7c;let n=WYi.get(e);if(n&&n[0]===r)return n[1];let o={error:_It("error",e,r),warn:_It("warn",e,r),info:_It("info",e,r),debug:_It("debug",e,r)};return WYi.set(e,[r,o]),o}function kZi(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(!P7c.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function zYi(t){if(!t)throw new Ri("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 Ri(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new Ri(`Identity token file at ${t} is empty`);return n}}function O7c(t){if(!t)throw new Ri("Identity token value is empty");return()=>t}function L7c(t){return async()=>{TZi(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new nu(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:C7c,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}${SZi}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${txt},${S7c}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${nW} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new nu(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=gk(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 nu(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await IZi(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new nu(`Token endpoint response missing required fields: ${JSON.stringify(gk(c))}`,o.status,gk(c),s);return{token:c.access_token,expiresAt:Wie()+l}}}function B7c(t){return async e=>{let r=await import("node:fs");await xZi(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new nu(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new nu(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new nu(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||Wie()"");throw new nu(`User OAuth refresh failed (HTTP ${f.status}): ${gk(E)}`,f.status,gk(E),h)}let m=await IZi(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new nu(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(gk(m))}`,f.status,gk(m),h);let A=Wie()+g,y=m.refresh_token||l;return await wZi(t.credentialsPath,{...o,version:RZi,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function DZi(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=U7c(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 F7c(t,e){let r=await D7c(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 N7c(n,e)??void 0}};return DZi(s,t)}function U7c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=Q7c(o);if(!s)throw new nu("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 nu("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 nu("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=L7c({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?q7c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new nu("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return B7c({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 nu(`authentication.type "${o}" is not a known authentication type`)}}}function Q7c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new nu(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new nu('identity_token.source "file" requires a non-empty path');return zYi(t.identity_token.path)}let e=tu("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return zYi(e);let r=tu("ANTHROPIC_IDENTITY_TOKEN");return r?O7c(r):null}function q7c(t,e,r,n){return async o=>{let s=await import("node:fs");await xZi(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||Wie()0&&(yield e)}function V7c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function NZi(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return oA(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):Xie.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 MZi(u,r)}return await r.text()})();return oA(t).debug(`[${n}] response parsed`,Gie({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function MZi(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 sve(t,e,r){return OZi(),new File(t,e??"unknown_file",r)}function QIt(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 W7c(t){let e=typeof t=="function"?t:t.fetch,r=YYi.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 YYi.set(e,n),n}async function Z7c(t,e,r){if(OZi(),t=await t,e||(e=QIt(t,!0)),K7c(t))return t instanceof File&&e==null&&r==null?t:sve([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(J7c(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),sve(await u8r(o),e,r)}let n=await u8r(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 sve(n,e,r)}async function u8r(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(BZi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(LZi(t))for await(let r of t)e.push(...await u8r(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${X7c(t)}`)}return e}function X7c(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*eQc(t){if(!t)return;if(FZi 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():BYi(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=BYi(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 UZi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function qIt(t){return typeof t=="object"&&t!==null&&XFe in t}function QZi(t,e){let r=new Set;if(t)for(let n of t)qIt(n)&&r.add(n[XFe]);if(e){for(let n of e)if(qIt(n)&&r.add(n[XFe]),Array.isArray(n.content))for(let o of n.content)qIt(o)&&r.add(o[XFe])}return Array.from(r)}function qZi(t,e){let r=QZi(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function rQc(t){return qIt(t)?{"x-stainless-helper":t[XFe]}:{}}function HZi(t){return t?.output_format??t?.output_config?.format}function JYi(t,e,r){let n=HZi(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}:GZi(t,e,r)}function GZi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=nQc(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 nQc(t,e){let r=HZi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ri(`Failed to parse structured output: ${n}`)}}function tKi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function nKi(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function lQc(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 hxt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function oKi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new Ri("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 VZi(t){return t?.output_config?.format}function sKi(t,e,r){let n=VZi(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}:WZi(t,e,r)}function WZi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=dQc(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 dQc(t,e){let r=VZi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ri(`Failed to parse structured output: ${n}`)}}function uKi(t){return t.type==="tool_use"||t.type==="server_tool_use"}function M8e(t){return t instanceof Error?t:Error(String(t))}function HIt(t){return t instanceof Error?t.message:String(t)}function PI(t){if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}function O8e(t){return PI(t)==="ENOENT"}function YZi(t){return PI(t)==="EISDIR"}function mQc(t){let e=PI(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function yQc(t,e,r){let n=`${t}.tmp.${(0,ZZi.randomBytes)(4).toString("hex")}`;try{await(0,jL.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,jL.rename)(n,t)}catch(o){let s=PI(o);if(s!==void 0&&gQc.has(s)){try{await(0,jL.copyFile)(n,t)}catch(c){throw AQc.has(PI(c)??"")&&await(0,jL.unlink)(t).catch(()=>{}),c}await(0,jL.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,jL.unlink)(n).catch(()=>{}),o}}function bxt(){return EQc.getStore()??new g8r}function XZi(){if(K_e)return K_e;if(!s_(process.env.DEBUG_CLAUDE_AGENT_SDK))return zie=null,K_e=Promise.resolve(),K_e;let t=(0,m8r.join)(Fve(),"debug");return zie=(0,m8r.join)(t,`sdk-${(0,KZi.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${zie} -`),K_e=bxt().mkdir(t).catch(()=>{}),K_e}function _Qc(){return XZi(),zie??null}function pk(t){if(zie===null)return;let e=`${new Date().toISOString()} ${t} -`;XZi().then(()=>{zie&&bxt().append(zie,e).catch(()=>{})})}function vQc(){this.__data__=new vwt,this.size=0}function bQc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function TQc(t){return this.__data__.get(t)}function xQc(t){return this.__data__.has(t)}function kQc(t,e){var r=this.__data__;if(r instanceof vwt){var n=r.__data__;if(!AZi||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=nqc}function Rqc(t){return Qve(t)&&U6r(t.length)&&!!Cd[N8e(t)]}function Pqc(t){return function(e){return t(e)}}function Fqc(t,e){var r=lW(t),n=!r&&l8e(t),o=!r&&!n&&F6r(t),s=!r&&!n&&!o&&iXi(t),c=r||n||o||s,l=c?qQc(t.length,String):[],u=l.length;for(var d in t)(e||Bqc.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||bwt(d,u)))&&l.push(d);return l}function qqc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Qqc;return t===r}function jqc(t,e){return function(r){return t(e(r))}}function Gqc(t){return t!=null&&U6r(t.length)&&!I6r(t)}function $qc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function Yqc(t){if(!z9(t))return Vqc(t);var e=oXi(t),r=[];for(var n in t)n=="constructor"&&(e||!zqc.call(t,n))||r.push(n);return r}function Jqc(t){return Q6r(t)?Uqc(t,!0):Kqc(t)}function Xqc(t,e){if(e)return t.slice();var r=t.length,n=yKi?yKi(r):new t.constructor(r);return t.copy(n),n}function ejc(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 dHc(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function pHc(t){return fHc.register(t)}function mHc(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 gHc(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 AHc(t,e){if(!e)return!0;let r=mHc(t);return gHc(r,e)}function yHc(t){return/^[\\/]{2}/.test(t)}function EHc(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function bKi(t){try{return EHc(hXi.realpathSync.native(t))}catch{return null}}function _Hc(t,e){let r=(0,HL.resolve)(e).toLowerCase(),n=(0,HL.resolve)(t).toLowerCase();if((0,HL.dirname)(n)===r||n.startsWith(r+HL.sep))return!0;let o=bKi(e)?.toLowerCase();if(o==null)return!1;let s=bKi((0,HL.dirname)((0,HL.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+HL.sep)}function mXi(t,e){if(yHc(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 DI(){return CHc}function bHc(t,e){t.destroyed||t.write(e)}function SHc(t){bHc(process.stderr,t)}function THc(t){return t.charAt(0).toUpperCase()+t.slice(1)}function IHc(t,e,r=e+"s"){return t===1?e:r}function xHc(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function PHc(t){return kHc.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function DHc(t){IKi??=PHc(!0);for(let e of IKi)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 Twt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function LHc(t){if(!v8r()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=OHc();return AHc(t,e)}async function yXi(t,e,r=FHc){if(UFe<0?UFe=await(0,l_.stat)(t).then(n=>n.size).catch(()=>0):UFe+=e,!(UFe<=r||OFr)){OFr=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,l_.rename)(t,n)}catch(o){O8e(o)||(await(0,l_.unlink)(n).catch(()=>{}),await(0,l_.rename)(t,n).catch(()=>(0,l_.unlink)(t).catch(()=>{})))}UFe=0}finally{OFr=!1}}}function EXi(t){return C8r=(0,soe.join)(t,`${pXi()}.txt`),C8r}async function UHc(t,e,r,n){t&&await(0,l_.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,l_.appendFile)(r,n)}catch(s){if(!YZi(s))throw s;o=EXi(r),await(0,l_.appendFile)(o,n)}await yXi(o,Buffer.byteLength(n)).catch(b8r),vXi()}function b8r(){}function QHc(){if(!OIt){let t=null;OIt=uHc({writeFn:a(e=>{let r=_Xi(),n=(0,soe.dirname)(r),o=t!==n;if(t=n,v8r()){if(o)try{DI().mkdirSync(n)}catch{}let s=r;try{DI().appendFileSync(r,e)}catch(c){if(!YZi(c))throw c;s=EXi(r),DI().appendFileSync(s,e)}yXi(s,Buffer.byteLength(e)).catch(b8r),vXi();return}MFr=MFr.then(UHc.bind(null,o,n,r,e)).catch(b8r)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:v8r()}),pHc(async()=>{OIt?.dispose(),await MFr})}return OIt}function ru(t,{level:e}={level:"debug"}){if(_8r[e]<_8r[NHc()]||!LHc(t))return;BHc&&t.includes(` -`)&&(t=Qm(t));let r=`${new Date().toISOString()} [${e.toUpperCase()}] ${DHc(t.trim())} -`;if(gXi()){SHc(r);return}QHc().write(r)}function _Xi(){return AXi()??C8r??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??(0,soe.join)(Fve(),"debug",`${pXi()}.txt`)}function jHc(){return qHc}function Qm(t,e,r){let n=[];try{let c=ef(n,rf`JSON.stringify(${t})`,0);return JSON.stringify(t,e,r)}catch(c){var o=c,s=1}finally{tf(n,o,s)}}function HHc(t){return JSON.parse(t)}function uW(t,e){let r=[];try{let s=ef(r,rf`structuredClone(${t})`,0);return structuredClone(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}}function GHc(t){let e=t.trim();return e.startsWith("{")&&e.endsWith("}")}function $Hc(t,e){let r={...t};if(e){let n=e.enabled===!0&&e.failIfUnavailable===void 0?{...e,failIfUnavailable:!0}:e,o=r.settings;if(o&&!GHc(o))throw Error("Cannot use both a settings file path and the sandbox option. Include the sandbox configuration in your settings file instead.");let s={sandbox:n};if(o)try{s={...GN(o),sandbox:n}}catch{}r.settings=Qm(s)}return r}function WHc(){for(let t of xxt)if(!t.killed)if(process.platform==="win32")try{t.stdin.end()}catch{}else t.kill("SIGTERM")}function zHc(t){xxt.add(t),!xKi&&(xKi=!0,process.on("exit",WHc))}function YHc(t){return![".js",".mjs",".tsx",".ts",".jsx"].some(e=>t.endsWith(e))}function KHc(t,e){return(0,dZi.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 JHc(){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 ZHc(t,e=process.platform,r=process.arch,n=CXi.existsSync,o=JHc()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${J_e}-linux-${r}-android`]:e==="linux"?o?[`${J_e}-linux-${r}-musl`,`${J_e}-linux-${r}`]:[`${J_e}-linux-${r}`,`${J_e}-linux-${r}-musl`]:[`${J_e}-${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 XHc(){return{eventQueue:[],sink:null}}function V6r(t,e){let r=eGc;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function bXi(t){V6r("tengu_feature_ok",{feature_name:t})}function SXi(t,e,r){V6r("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function tGc(t,e,r){V6r("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function q9(t,e,r){try{let n=await e();return bXi(t),n}catch(n){throw SXi(t,r?.(n)??"error"),n}}function nGc(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 t8e(t){if(typeof t=="string")return nGc(t);if(Array.isArray(t))return t.map(t8e);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[t8e(r)]=t8e(n);return e}return t}function iGc(){return process.platform==="win32"}function sGc(t){let e=LFr.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,kXi.join)(r,"System32","where.exe");try{let o=(0,RXi.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:oGc,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!_Hc(c,s))return LFr.set(t,c),c;return null}catch(o){return aGc(o)&&LFr.set(t,null),null}}function aGc(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 cGc(t){return!iGc()||t.includes("/")||t.includes("\\")?t:sGc(t)}async function L8e(t){let e=cGc("git");if(e===null)return[];try{let{stdout:r}=await lGc(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 uGc(t){let e=0;for(let r=0;ro&&(n=PXi(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function R8r(t,e){let r=(0,IXi.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` -`)||await(0,w8r.once)(r,"drain");r.end(),await(0,w8r.once)(r,"finish")}catch(n){throw r.destroy(),n}}function DXi(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=T6r(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function fGc(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=T6r(r,e);if(n!==void 0)return n}return e.commandFallback}async function NXi(t){try{let e=await(0,UN.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe($9),o=await e.read(n,0,$9,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-$9),l=s;if(c>0){let u=await e.read(n,0,$9,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 pGc(t){return Math.abs(uGc(t)).toString(36)}function B8e(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=u8e?e:`${e.slice(0,u8e)}-${pGc(t)}`}function hW(){return(0,mve.join)(Fve(),"projects")}function hGc(t){return(0,mve.join)(hW(),B8e(t))}async function F8e(t){try{return(await(0,UN.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function BN(t){let e=hGc(t),r=[];try{await(0,UN.readdir)(e),r.push(e)}catch{}let n=B8e(t);if(n.length<=u8e)return r;let o=n.slice(0,u8e)+"-",s=hW();try{for(let c of await(0,UN.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,mve.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function Iwt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,mve.join)(c,r);try{let d=await(0,UN.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await F8e(e);for(let u of await BN(c)){let d=await n(u,c);if(d)return d}let l;try{l=await L8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await BN(u)){let f=await n(d,u);if(f)return f}return}let o=hW(),s;try{s=await(0,UN.readdir)(o)}catch{return}for(let c of s){let l=await n((0,mve.join)(o,c),void 0);if(l)return l}}function yGc(){return AGc??=Buffer.from('"compact_boundary"')}function MXi(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 Yie(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 Rxt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function CGc(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(d8e);if(o===-1||o>=r)return 0;let s=o+1;if(Rxt(n,kxt,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 TGc(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 IGc(t){if(t.carryLen>0){let e=t.carryBuf;Rxt(e,kxt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):Yie(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==d8e&&Yie(t.out,_Gc,0,1),Yie(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function xGc(t,e){let r=yGc(),n=mGc,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,UN.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=bGc(o,f,r);SGc(o,f,s,h.lastSnapStart,h.lastSnapEnd),TGc(o,f,h.trailStart),o.bufFileOff+=h.trailStart}IGc(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function wGc(t,e){try{return e>gGc&&!s_(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await xGc(t,e)).postBoundaryBuf:await(0,TXi.readFile)(t)}catch{return null}}function RGc(t){let e=[];try{let o=ef(e,rf`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=HHc(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{tf(e,r,n)}}function kGc(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 b=e.get(v);e.set(v,{...b,parentUuid:y}),y=v}let E=g.uuids[0],_=g.uuids.at(-1);for(let[v,b]of e)b.parentUuid===g.anchorUuid&&v!==E&&e.set(v,{...b,parentUuid:_})}else if(A){let y=e.get(A.headUuid);y&&e.set(A.headUuid,{...y,parentUuid:A.anchorUuid});for(let[E,_]of e)_.parentUuid===A.anchorUuid&&E!==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(),DGc(e,d,f)}function FFr(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 PGc(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 DGc(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=FFr(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=FFr(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(PGc(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=FFr(h);if(!m||l.has(m))continue;l.add(m);let g=s.get(m)??[h],A=g.filter(b=>!r.has(b.uuid)),y=[];for(let b of g){let T=c.get(b.uuid);if(T)for(let w of T)r.has(w.uuid)||y.push(w)}if(A.length===0&&y.length===0)continue;let E=a((b,T)=>(b.timestamp??"").localeCompare(T.timestamp??""),"D");A.sort(E),y.sort(E);let _=o.get(m),v=[...A,...y];for(let b of v)r.add(b.uuid);d+=v.length,u.set(_.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 NGc(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function OXi(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 LXi(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 MGc(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 BXi(r,e)}function BXi(t,e){let r=kGc(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>NGc(s,n)).map(s=>OXi(s));return LXi(o,e)}async function OGc(t,e){if(!bh(t))return[];let r=await Iwt(t,e?.dir);if(!r)return[];let n=await wGc(r.filePath,r.fileSize);return n?BXi(RGc(n),e):[]}function xwt(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=DXi(n)||void 0,h=BFr(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")||BFr(n,"gitBranch")||void 0,y=BFr(n,"cwd")||r||void 0,E=o.split(` -`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),_=E&&hk(E,"tag")||void 0;return{sessionId:t,summary:g,lastModified:s,fileSize:c,customTitle:d,firstPrompt:f,gitBranch:A,cwd:y,tag:_,createdAt:m}}async function YFe(t,e,r){let n;try{n=await(0,qve.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=bh(o.slice(0,-6));if(!s)return null;let c=(0,jve.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,qve.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function FXi(t){let e=await NXi(t.filePath);if(!e)return null;let r=xwt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function BGc(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function FGc(t,e,r){t.sort(BGc);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 QGc(t,e,r){let n=await F8e(t),o;if(e)try{o=await L8e(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await BN(n))h.push(...await YFe(m,r,n));return h}let s=hW(),c=process.platform==="win32",l=o.map(h=>{let m=B8e(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,qve.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await BN(n))h.push(...await YFe(m,r,n));return h}let d=[],f=new Set;for(let h of await BN(n)){let m=(0,jve.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await YFe(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>=u8e&&m.startsWith(A+"-")){f.add(m),d.push(...await YFe((0,jve.join)(s,h.name),r,g));break}}}return d}async function qGc(t){let e=hW(),r;try{r=await(0,qve.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>YFe((0,jve.join)(e,n.name),t)))).flat()}async function jGc(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 QGc(e,o??!0,c):await qGc(c);return c?FGc(l,r,s):UGc(l)}async function HGc(t,e={}){let r=bh(t);if(!r)return;let n=await Iwt(r,e.dir);if(!n)return;let o=await NXi(n.filePath);if(o)return xwt(r,o,n.projectPath)??void 0}async function GGc(t,e,r={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=Qm({type:"custom-title",customTitle:e.trim(),sessionId:t})+` -`;await UXi(t,n,r)}async function $Gc(t,e,r={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=t8e(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=Qm({type:"tag",tag:e??"",sessionId:t})+` -`;await UXi(t,n,r)}async function VGc(t,e={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await WGc(e)){let n=(0,Kie.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,GL.stat)(n))}catch(s){let c=PI(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,GL.rm)(n,{force:!0}),await(0,GL.rm)((0,Kie.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 WGc(t){if(t.dir){let r=await F8e(t.dir),n=await BN(r),o;try{o=await L8e(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await BN(s));return n}let e=hW();try{return(await(0,GL.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,Kie.join)(e,r.name))}catch{return[]}}async function UXi(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await F8e(r.dir);for(let u of await BN(c))if(await UFr((0,Kie.join)(u,n),e))return;let l;try{l=await L8e(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await BN(u))if(await UFr((0,Kie.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=hW(),s;try{s=await(0,GL.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await UFr((0,Kie.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function UFr(t,e){let r;try{r=await(0,GL.open)(t,k8r.constants.O_WRONLY|k8r.constants.O_APPEND)}catch(n){let o=PI(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 zGc(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await bxt().readBytes((0,Pxt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await F8e(e);for(let u of await BN(c)){let d=await n(u);if(d)return d}let l;try{l=await L8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await BN(u)){let f=await n(d);if(f)return f}return null}let o=hW(),s;try{s=await bxt().list(o)}catch{return null}for(let c of s){let l=await n((0,Pxt.join)(o,c));if(l)return l}return null}function KGc(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{QXi(GN(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function JGc(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||QXi(o,e,r,n);return{transcript:r,contentReplacements:n}}function QXi(t,e,r,n){YGc.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 ZGc(t,e={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!bh(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await zGc(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}=XGc(r.buf,t,e);return await R8r((0,Pxt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function XGc(t,e,r){let n=KGc(t,e);return qXi(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,$9)),c=t.toString("utf-8",Math.max(0,o-$9));return hk(c,"customTitle")||hk(s,"customTitle")||hk(c,"aiTitle")||hk(s,"aiTitle")||DXi(s)})}function e$c(t,e,r){let n=JGc(t,e);return qXi(n,e,r,()=>t$c(t))}function t$c(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||fGc(t)||void 0}function qXi(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,KFe.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,KFe.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,KFe.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,KFe.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function jXi(t,e){let r=await Iwt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,Dxt.join)(n,"subagents")}async function HXi(t){let e=[];async function r(n){let o;try{o=await(0,f8e.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,Dxt.join)(n,s.name)})}else s.isDirectory()&&await r((0,Dxt.join)(n,s.name))}return a(r,"J"),await r(t),e}function r$c(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=GN(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function n$c(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 i$c(t,e){if(!bh(t))return[];let r=await jXi(t,e?.dir);return r?(await HXi(r)).map(n=>n.agentId):[]}async function o$c(t,e,r){if(!bh(t))return[];if(!e)return[];let n=await jXi(t,r?.dir);if(!n)return[];let o=(await HXi(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,f8e.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=GN(await(0,f8e.readFile)(l,"utf-8")).toolUseId}catch{}return GXi(s,r,c)}function GXi(t,e,r){if(t.length===0)return[];let n=r$c(t),o=n$c(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>OXi(s,r));return LXi(o,e)}function WXi(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function zXi(t){return[...new Set(t)]}function s$c(){return"prod"}function f$c(){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 h$c(){let t=(()=>{switch(s$c()){case"local":return f$c();case"staging":return d$c??RKi;case"prod":return RKi}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!p$c.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 g$c(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"):Fve(),o=r?"":`-${(0,$Xi.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${h$c().OAUTH_FILE_SUFFIX}${t}${o}`}function y$c(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,VXi.userInfo)().username}catch{t="claude-code-user"}return A$c.test(t)?t:"claude-code-user"}function P8r(){return _$c}function ln(t,e){let r=P8r(),n=D8r({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===p8e?void 0:p8e].filter(o=>!!o)});t.common.issues.push(n)}function Zo(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 JXi(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 B$c(t){return new RegExp(`^${JXi(t)}$`)}function F$c(t){let e=`${KXi}T${JXi(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 U$c(t,e){return!!((e==="v4"||!e)&&k$c.test(t)||(e==="v6"||!e)&&D$c.test(t))}function Q$c(t,e){if(!I$c.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 q$c(t,e){return!!((e==="v4"||!e)&&P$c.test(t)||(e==="v6"||!e)&&N$c.test(t))}function j$c(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 tve(t){if(t instanceof NI){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Ek.create(tve(n))}return new NI({...t._def,shape:a(()=>e,"shape")})}else return t instanceof dW?new dW({...t._def,type:tve(t.element)}):t instanceof Ek?Ek.create(tve(t.unwrap())):t instanceof K9?K9.create(tve(t.unwrap())):t instanceof Y9?Y9.create(t.items.map(e=>tve(e))):t}function M8r(t,e){let r=tW(t),n=tW(e);if(t===e)return{valid:!0,data:t};if(r===kn.object&&n===kn.object){let o=hc.objectKeys(e),s=hc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=M8r(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===kn.array&&n===kn.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 Xv(t){return t&&Object.assign(Lxt,t),Lxt}function G$c(t){return t}function $$c(t){return t}function V$c(t){}function W$c(t){throw Error()}function z$c(t){}function Y6r(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 Vr(t,e="|"){return t.map(r=>us(r)).join(e)}function reo(t,e){return typeof e=="bigint"?e.toString():e}function wwt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function aoe(t){return t==null}function Rwt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function neo(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 zc(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 K6r(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Y$c(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function K$c(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 eVc(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 us(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function seo(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function tVc(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 $N(t,{...t._zod.def,shape:r,checks:[]})}function rVc(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 $N(t,{...t._zod.def,shape:r,checks:[]})}function nVc(t,e){if(!T8e(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 K6r(this,"shape",n),n},checks:[]};return $N(t,r)}function iVc(t,e){return $N(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return K6r(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function oVc(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 $N(e,{...e._zod.def,shape:o,checks:[]})}function sVc(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 $N(e,{...e._zod.def,shape:o,checks:[]})}function ave(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function ZFe(t){return typeof t=="string"?t:t?.message}function qN(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=ZFe(t.inst?._zod.def?.error?.(t))??ZFe(e?.error?.(t))??ZFe(r.customError?.(t))??ZFe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function kwt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Pwt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function leo(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function aVc(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function X6r(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 e9r(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 ${feo(n.path)}`);return e.join(` -`)}function beo(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function Neo(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 Meo(t){return new RegExp(`^${Neo(t)}$`)}function Oeo(t){let e=Neo({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(`^${Peo}T(?:${n})$`)}function MKi(t,e,r){t.issues.length&&e.issues.push(...Ak(r,t.issues))}function l9r(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Pto(t){if(!s9r.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return l9r(r)}function Mto(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 OKi(t,e,r){t.issues.length&&e.issues.push(...Ak(r,t.issues)),e.value[r]=t.value}function LIt(t,e,r){t.issues.length&&e.issues.push(...Ak(r,t.issues)),e.value[r]=t.value}function LKi(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(...Ak(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function BKi(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=>qN(s,n,Xv())))}),e}function F8r(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(T8e(t)&&T8e(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=F8r(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;nqN(l,c,Xv()))})),e.issues.length&&(Bxt.has(typeof n)?r.issues.push(...Ak(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>qN(l,c,Xv()))})),r.value.set(t.value,e.value)}function QKi(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function qKi(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function jKi(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 HKi(t,e,r){return ave(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function GKi(t){return t.value=Object.freeze(t.value),t}function $Ki(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(leo(o))}}function EVc(){return{localeError:yVc()}}function vVc(){return{localeError:_Vc()}}function VKi(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 bVc(){return{localeError:CVc()}}function TVc(){return{localeError:SVc()}}function xVc(){return{localeError:IVc()}}function RVc(){return{localeError:wVc()}}function pro(){return{localeError:PVc()}}function MVc(){return{localeError:NVc()}}function LVc(){return{localeError:OVc()}}function FVc(){return{localeError:BVc()}}function QVc(){return{localeError:UVc()}}function jVc(){return{localeError:qVc()}}function GVc(){return{localeError:HVc()}}function VVc(){return{localeError:$Vc()}}function zVc(){return{localeError:WVc()}}function KVc(){return{localeError:YVc()}}function ZVc(){return{localeError:JVc()}}function eWc(){return{localeError:XVc()}}function rWc(){return{localeError:tWc()}}function iWc(){return{localeError:nWc()}}function sWc(){return{localeError:oWc()}}function cWc(){return{localeError:aWc()}}function uWc(){return{localeError:lWc()}}function fWc(){return{localeError:dWc()}}function hWc(){return{localeError:pWc()}}function gWc(){return{localeError:mWc()}}function yWc(){return{localeError:AWc()}}function _Wc(){return{localeError:EWc()}}function WKi(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 CWc(){return{localeError:vWc()}}function SWc(){return{localeError:bWc()}}function IWc(){return{localeError:TWc()}}function wWc(){return{localeError:xWc()}}function kWc(){return{localeError:RWc()}}function NWc(){return{localeError:DWc()}}function OWc(){return{localeError:MWc()}}function BWc(){return{localeError:LWc()}}function UWc(){return{localeError:FWc()}}function qWc(){return{localeError:QWc()}}function HWc(){return{localeError:jWc()}}function E9r(){return new I8e}function gro(t,e){return new t({type:"string",...xr(e)})}function Aro(t,e){return new t({type:"string",coerce:!0,...xr(e)})}function _9r(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...xr(e)})}function jxt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...xr(e)})}function v9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...xr(e)})}function C9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xr(e)})}function b9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xr(e)})}function S9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xr(e)})}function T9r(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...xr(e)})}function I9r(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...xr(e)})}function x9r(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...xr(e)})}function w9r(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...xr(e)})}function R9r(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...xr(e)})}function k9r(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...xr(e)})}function P9r(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...xr(e)})}function D9r(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...xr(e)})}function N9r(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...xr(e)})}function M9r(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...xr(e)})}function O9r(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xr(e)})}function L9r(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xr(e)})}function B9r(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...xr(e)})}function F9r(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...xr(e)})}function U9r(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...xr(e)})}function Q9r(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...xr(e)})}function Ero(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xr(e)})}function _ro(t,e){return new t({type:"string",format:"date",check:"string_format",...xr(e)})}function vro(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...xr(e)})}function Cro(t,e){return new t({type:"string",format:"duration",check:"string_format",...xr(e)})}function bro(t,e){return new t({type:"number",checks:[],...xr(e)})}function Sro(t,e){return new t({type:"number",coerce:!0,checks:[],...xr(e)})}function Tro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...xr(e)})}function Iro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...xr(e)})}function xro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...xr(e)})}function wro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...xr(e)})}function Rro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...xr(e)})}function kro(t,e){return new t({type:"boolean",...xr(e)})}function Pro(t,e){return new t({type:"boolean",coerce:!0,...xr(e)})}function Dro(t,e){return new t({type:"bigint",...xr(e)})}function Nro(t,e){return new t({type:"bigint",coerce:!0,...xr(e)})}function Mro(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...xr(e)})}function Oro(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...xr(e)})}function Lro(t,e){return new t({type:"symbol",...xr(e)})}function Bro(t,e){return new t({type:"undefined",...xr(e)})}function Fro(t,e){return new t({type:"null",...xr(e)})}function Uro(t){return new t({type:"any"})}function Hxt(t){return new t({type:"unknown"})}function Qro(t,e){return new t({type:"never",...xr(e)})}function qro(t,e){return new t({type:"void",...xr(e)})}function jro(t,e){return new t({type:"date",...xr(e)})}function Hro(t,e){return new t({type:"date",coerce:!0,...xr(e)})}function Gro(t,e){return new t({type:"nan",...xr(e)})}function noe(t,e){return new a9r({check:"less_than",...xr(e),value:t,inclusive:!1})}function FN(t,e){return new a9r({check:"less_than",...xr(e),value:t,inclusive:!0})}function ioe(t,e){return new c9r({check:"greater_than",...xr(e),value:t,inclusive:!1})}function RI(t,e){return new c9r({check:"greater_than",...xr(e),value:t,inclusive:!0})}function $ro(t){return ioe(0,t)}function Vro(t){return noe(0,t)}function Wro(t){return FN(0,t)}function zro(t){return RI(0,t)}function x8e(t,e){return new Veo({check:"multiple_of",...xr(e),value:t})}function Owt(t,e){return new Yeo({check:"max_size",...xr(e),maximum:t})}function w8e(t,e){return new Keo({check:"min_size",...xr(e),minimum:t})}function q9r(t,e){return new Jeo({check:"size_equals",...xr(e),size:t})}function Lwt(t,e){return new Zeo({check:"max_length",...xr(e),maximum:t})}function kve(t,e){return new Xeo({check:"min_length",...xr(e),minimum:t})}function Bwt(t,e){return new eto({check:"length_equals",...xr(e),length:t})}function j9r(t,e){return new tto({check:"string_format",format:"regex",...xr(e),pattern:t})}function H9r(t){return new rto({check:"string_format",format:"lowercase",...xr(t)})}function G9r(t){return new nto({check:"string_format",format:"uppercase",...xr(t)})}function $9r(t,e){return new ito({check:"string_format",format:"includes",...xr(e),includes:t})}function V9r(t,e){return new oto({check:"string_format",format:"starts_with",...xr(e),prefix:t})}function W9r(t,e){return new sto({check:"string_format",format:"ends_with",...xr(e),suffix:t})}function Yro(t,e,r){return new ato({check:"property",property:t,schema:e,...xr(r)})}function z9r(t,e){return new cto({check:"mime_type",mime:t,...xr(e)})}function loe(t){return new lto({check:"overwrite",tx:t})}function Y9r(t){return loe(e=>e.normalize(t))}function K9r(){return loe(t=>t.trim())}function J9r(){return loe(t=>t.toLowerCase())}function Z9r(){return loe(t=>t.toUpperCase())}function X9r(t,e,r){return new t({type:"array",element:e,...xr(r)})}function GWc(t,e,r){return new t({type:"union",options:e,...xr(r)})}function $Wc(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...xr(n)})}function VWc(t,e,r){return new t({type:"intersection",left:e,right:r})}function Kro(t,e,r,n){let o=r instanceof Co;return new t({type:"tuple",items:e,rest:o?r:null,...xr(o?n:r)})}function WWc(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...xr(n)})}function zWc(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...xr(n)})}function YWc(t,e,r){return new t({type:"set",valueType:e,...xr(r)})}function KWc(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...xr(r)})}function JWc(t,e,r){return new t({type:"enum",entries:e,...xr(r)})}function ZWc(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...xr(r)})}function Jro(t,e){return new t({type:"file",...xr(e)})}function XWc(t,e){return new t({type:"transform",transform:e})}function ezc(t,e){return new t({type:"optional",innerType:e})}function tzc(t,e){return new t({type:"nullable",innerType:e})}function rzc(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function nzc(t,e,r){return new t({type:"nonoptional",innerType:e,...xr(r)})}function izc(t,e){return new t({type:"success",innerType:e})}function ozc(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function szc(t,e,r){return new t({type:"pipe",in:e,out:r})}function azc(t,e){return new t({type:"readonly",innerType:e})}function czc(t,e,r){return new t({type:"template_literal",parts:e,...xr(r)})}function lzc(t,e){return new t({type:"lazy",getter:e})}function uzc(t,e){return new t({type:"promise",innerType:e})}function Zro(t,e,r){let n=xr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function Xro(t,e,r){return new t({type:"custom",check:"custom",fn:e,...xr(r)})}function eno(t,e){let r=xr(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??A9r,u=t.Boolean??d9r,d=t.String??q8e,f=new(t.Transform??g9r)({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 tno(t,e,r,n={}){let o=xr(n),s={...xr(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 rno(t){return new Gxt({type:"function",input:Array.isArray(t?.input)?Kro(Mwt,t?.input):t?.input??X9r(p9r,Hxt(qxt)),output:t?.output??Hxt(qxt)})}function eUr(t,e){if(t instanceof I8e){let n=new R8e(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 R8e(e);return r.process(t),r.emit(t,e)}function q0(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 q0(n.element,r);case"object":{for(let o in n.shape)if(q0(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(q0(o,r))return!0;return!1}case"intersection":return q0(n.left,r)||q0(n.right,r);case"tuple":{for(let o of n.items)if(q0(o,r))return!0;return!!(n.rest&&q0(n.rest,r))}case"record":return q0(n.keyType,r)||q0(n.valueType,r);case"map":return q0(n.keyType,r)||q0(n.valueType,r);case"set":return q0(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return q0(n.innerType,r);case"lazy":return q0(n.getter(),r);case"default":return q0(n.innerType,r);case"prefault":return q0(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return q0(n.in,r)||q0(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function zKi(t,e){let r={type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},...Ws.normalizeParams(e)};return new pzc(r)}function VL(t){return!!t._zod}function nve(t){let e=Object.values(t);if(e.length===0)return zKi({});let r=e.every(VL),n=e.every(o=>!VL(o));if(r)return zKi(t);if(n)return H$c(t);throw Error("Mixed Zod versions detected in object shape.")}function r8e(t,e){return VL(t)?Dwt(t,e):t.safeParse(e)}async function qFr(t,e){return VL(t)?await Nwt(t,e):await t.safeParseAsync(e)}function j8e(t){if(!t)return;let e;if(VL(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function QFe(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 nve(t)}}if(VL(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 jFr(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 hzc(t){return t.description}function mzc(t){if(VL(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function nno(t){if(VL(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 ino(t){return Ero(rUr,t)}function ono(t){return _ro(nUr,t)}function sno(t){return vro(iUr,t)}function ano(t){return Cro(oUr,t)}function It(t){return gro(Fwt,t)}function Azc(t){return _9r(aUr,t)}function yzc(t){return jxt($xt,t)}function Ezc(t){return v9r(W9,t)}function _zc(t){return C9r(W9,t)}function vzc(t){return b9r(W9,t)}function Czc(t){return S9r(W9,t)}function bzc(t){return T9r(cUr,t)}function Szc(t){return I9r(lUr,t)}function Tzc(t){return x9r(uUr,t)}function Izc(t){return w9r(dUr,t)}function xzc(t){return R9r(fUr,t)}function wzc(t){return k9r(pUr,t)}function Rzc(t){return P9r(hUr,t)}function kzc(t){return D9r(mUr,t)}function Pzc(t){return N9r(gUr,t)}function Dzc(t){return M9r(AUr,t)}function Nzc(t){return O9r(yUr,t)}function Mzc(t){return L9r(EUr,t)}function Ozc(t){return B9r(_Ur,t)}function Lzc(t){return F9r(vUr,t)}function Bzc(t){return U9r(CUr,t)}function Fzc(t){return Q9r(bUr,t)}function Uzc(t,e,r={}){return tno(pno,t,e,r)}function Nc(t){return bro(Uwt,t)}function U8r(t){return Tro(Hve,t)}function Qzc(t){return Iro(Hve,t)}function qzc(t){return xro(Hve,t)}function jzc(t){return wro(Hve,t)}function Hzc(t){return Rro(Hve,t)}function j0(t){return kro(Qwt,t)}function Gzc(t){return Dro(qwt,t)}function $zc(t){return Mro(SUr,t)}function Vzc(t){return Oro(SUr,t)}function Wzc(t){return Lro(hno,t)}function zzc(t){return Bro(mno,t)}function TUr(t){return Fro(gno,t)}function Yzc(){return Uro(Ano)}function of(){return Hxt(yno)}function jwt(t){return Qro(Eno,t)}function Kzc(t){return qro(_no,t)}function Jzc(t){return jro(IUr,t)}function Ca(t,e){return X9r(vno,t,e)}function Zzc(t){let e=t._zod.def.shape;return ti(Object.keys(e))}function Tn(t,e){let r={type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},...Ws.normalizeParams(e)};return new Hwt(r)}function Xzc(t,e){return new Hwt({type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},catchall:jwt(),...Ws.normalizeParams(e)})}function Kv(t,e){return new Hwt({type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},catchall:of(),...Ws.normalizeParams(e)})}function ou(t,e){return new xUr({type:"union",options:t,...Ws.normalizeParams(e)})}function wUr(t,e,r){return new Cno({type:"union",options:e,discriminator:t,...Ws.normalizeParams(r)})}function Gwt(t,e){return new bno({type:"intersection",left:t,right:e})}function eYc(t,e,r){let n=e instanceof Co,o=n?r:e;return new Sno({type:"tuple",items:t,rest:n?e:null,...Ws.normalizeParams(o)})}function iu(t,e,r){return new RUr({type:"record",keyType:t,valueType:e,...Ws.normalizeParams(r)})}function tYc(t,e,r){return new RUr({type:"record",keyType:ou([t,jwt()]),valueType:e,...Ws.normalizeParams(r)})}function rYc(t,e,r){return new Tno({type:"map",keyType:t,valueType:e,...Ws.normalizeParams(r)})}function nYc(t,e){return new Ino({type:"set",valueType:t,...Ws.normalizeParams(e)})}function N1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new k8e({type:"enum",entries:r,...Ws.normalizeParams(e)})}function iYc(t,e){return new k8e({type:"enum",entries:t,...Ws.normalizeParams(e)})}function ti(t,e){return new xno({type:"literal",values:Array.isArray(t)?t:[t],...Ws.normalizeParams(e)})}function oYc(t){return Jro(wno,t)}function PUr(t){return new kUr({type:"transform",transform:t})}function bd(t){return new DUr({type:"optional",innerType:t})}function Vxt(t){return new Rno({type:"nullable",innerType:t})}function sYc(t){return bd(Vxt(t))}function Pno(t,e){return new kno({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Nno(t,e){return new Dno({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Mno(t,e){return new NUr({type:"nonoptional",innerType:t,...Ws.normalizeParams(e)})}function aYc(t){return new Ono({type:"success",innerType:t})}function Bno(t,e){return new Lno({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function cYc(t){return Gro(Fno,t)}function Wxt(t,e){return new MUr({type:"pipe",in:t,out:e})}function Qno(t){return new Uno({type:"readonly",innerType:t})}function lYc(t,e){return new qno({type:"template_literal",parts:t,...Ws.normalizeParams(e)})}function Hno(t){return new jno({type:"lazy",getter:t})}function uYc(t){return new Gno({type:"promise",innerType:t})}function $no(t,e){let r=new Sh({check:"custom",...Ws.normalizeParams(e)});return r._zod.check=t,r}function Vno(t,e){return Zro($wt,t??(()=>!0),e)}function Wno(t,e={}){return Xro($wt,t,e)}function zno(t,e){let r=$no(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Ws.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(Ws.issue(s))}},t(n.value,n)),e);return r}function dYc(t,e={error:`Input not instance of ${t.name}`}){let r=new $wt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Ws.normalizeParams(e)});return r._zod.bag.Class=t,r}function pYc(t){let e=Hno(()=>ou([It(t),Nc(),j0(),TUr(),Ca(e),iu(It(),e)]));return e}function OUr(t,e){return Wxt(PUr(t),e)}function mYc(t){Xv({customError:t})}function gYc(){return Xv().customError}function AYc(t){return Aro(Fwt,t)}function yYc(t){return Sro(Uwt,t)}function EYc(t){return Pro(Qwt,t)}function _Yc(t){return Nro(qwt,t)}function vYc(t){return Hro(IUr,t)}function KKc(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function JKc(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Hie(t){return t==="completed"||t==="failed"||t==="cancelled"}function pio(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function Al(t,e,r,n,o){t[e]=r,pio(t,e,n,o)}function D1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?hio(e,t.currentPath):e.join("/")}}function oJc(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==Cr.ZodAny&&(r.items=Dc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&Al(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Al(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Al(r,"minItems",t.exactLength.value,t.exactLength.message,e),Al(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function sJc(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?Al(r,"minimum",n.value,n.message,e):Al(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Al(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Al(r,"maximum",n.value,n.message,e):Al(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Al(r,"maximum",n.value,n.message,e));break;case"multipleOf":Al(r,"multipleOf",n.value,n.message,e);break}return r}function aJc(){return{type:"boolean"}}function mio(t,e){return Dc(t.type._def,e)}function gio(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>gio(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 lJc(t,e)}}function uJc(t,e){return{...Dc(t.innerType._def,e),default:t.defaultValue()}}function dJc(t,e){return e.effectStrategy==="input"?Dc(t.schema._def,e):D1(e)}function fJc(t){return{type:"string",enum:Array.from(t.values)}}function hJc(t,e){let r=[Dc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Dc(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(pJc(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 mJc(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 Aio(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":Al(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":Al(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":LN(r,"email",n.message,e);break;case"format:idn-email":LN(r,"idn-email",n.message,e);break;case"pattern:zod":Yv(r,ON.email,n.message,e);break}break;case"url":LN(r,"uri",n.message,e);break;case"uuid":LN(r,"uuid",n.message,e);break;case"regex":Yv(r,n.regex,n.message,e);break;case"cuid":Yv(r,ON.cuid,n.message,e);break;case"cuid2":Yv(r,ON.cuid2,n.message,e);break;case"startsWith":Yv(r,RegExp(`^${GFr(n.value,e)}`),n.message,e);break;case"endsWith":Yv(r,RegExp(`${GFr(n.value,e)}$`),n.message,e);break;case"datetime":LN(r,"date-time",n.message,e);break;case"date":LN(r,"date",n.message,e);break;case"time":LN(r,"time",n.message,e);break;case"duration":LN(r,"duration",n.message,e);break;case"length":Al(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),Al(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Yv(r,RegExp(GFr(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&LN(r,"ipv4",n.message,e),n.version!=="v4"&&LN(r,"ipv6",n.message,e);break}case"base64url":Yv(r,ON.base64url,n.message,e);break;case"jwt":Yv(r,ON.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Yv(r,ON.ipv4Cidr,n.message,e),n.version!=="v4"&&Yv(r,ON.ipv6Cidr,n.message,e);break}case"emoji":Yv(r,ON.emoji(),n.message,e);break;case"ulid":{Yv(r,ON.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{LN(r,"binary",n.message,e);break}case"contentEncoding:base64":{Al(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Yv(r,ON.base64,n.message,e);break}}break}case"nanoid":Yv(r,ON.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function GFr(t,e){return e.patternStrategy==="escape"?AJc(t):t}function AJc(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}}})):Al(t,"format",e,r,n)}function Yv(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:JKi(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):Al(t,"pattern",JKi(e,n),r,n)}function JKi(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(OWi(e,n,o)),r+=k3r(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r +`);return r+=Buffer.byteLength(MWi(e)),r},"getFormDataLength"),R3r=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=aBc(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=dBc(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return cBc.from(uBc(this.fd,this.boundary))}};LWi.exports={isFormData:lBc,FormDataSerializer:R3r}});var FWi=I((jFh,BWi)=>{"use strict";p();var{AbortSignal:qFh}=w3r(),{Body:fBc,cloneStream:pBc,guessContentType:hBc}=OTt(),{Headers:mBc}=M_e(),{isPlainObject:gBc}=M9(),{isFormData:ABc,FormDataSerializer:yBc}=gFe(),EBc=20,GV=Symbol("Request internals"),QTt=class t extends fBc{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?pBc(n):null),l=new mBc(r.headers||n&&n.headers||{});if(ABc(c)&&!l.has("content-type")){let h=new yBc(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(gBc(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=hBc(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[GV]={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=EBc: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[GV].method}get url(){return this[GV].parsedURL.toString()}get headers(){return this[GV].headers}get redirect(){return this[GV].redirect}get cache(){return this[GV].cache}get signal(){return this[GV].signal}clone(){return new t(this)}get init(){return this[GV].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(QTt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});BWi.exports={Request:QTt}});var P3r=I(($Fh,UWi)=>{"use strict";p();var{Body:_Bc,cloneStream:vBc,guessContentType:CBc}=OTt(),{Headers:bBc}=M_e(),{isPlainObject:SBc}=M9(),{isFormData:TBc,FormDataSerializer:IBc}=gFe(),ON=Symbol("Response internals"),qTt=class t extends _Bc{static{a(this,"Response")}constructor(e=null,r={}){let n=new bBc(r.headers),o=e;if(TBc(o)&&!n.has("content-type")){let s=new IBc(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(SBc(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=CBc(o);s&&n.set("content-type",s)}super(o),this[ON]={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[ON].url||""}get status(){return this[ON].status}get statusText(){return this[ON].statusText}get ok(){return this[ON].status>=200&&this[ON].status<300}get redirected(){return this[ON].counter>0}get headers(){return this[ON].headers}get httpVersion(){return this[ON].httpVersion}get decoded(){return this[ON].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(vBc(this),{...this[ON]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(qTt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});UWi.exports={Response:qTt}});var qWi=I((YFh,QWi)=>{"use strict";p();var xBc=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),wBc=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),RBc=new Set([500,502,503,504]),kBc={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},PBc={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function Nie(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(Nie,"toNumberOrZero");function DBc(t){return t?RBc.has(t.status):!0}a(DBc,"isErrorResponse");function D3r(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(D3r,"parseCacheControl");function NBc(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(NBc,"formatCacheControl");QWi.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=D3r(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=D3r(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":NBc(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())&&wBc.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||xBc.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=D3r(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)kBc[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 Nie(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 Nie(this._rescc["s-maxage"])}if(this._rescc["max-age"])return Nie(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+Nie(this._rescc["stale-if-error"]),n=e+Nie(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+Nie(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+Nie(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()&&DBc(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&&!PBc[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 $Wi=I((ZFh,GWi)=>{"use strict";p();var MBc=qWi(),{Headers:OBc}=M_e(),jWi=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),HWi=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),N3r=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new MBc(jWi(e),HWi(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(jWi(e))}responseHeaders(e){return new OBc(this.policy.responseHeaders(HWi(e)))}timeToLive(){return this.policy.timeToLive()}};GWi.exports=N3r});var zWi=I((t8h,WWi)=>{"use strict";p();var{Readable:LBc}=require("stream"),{Headers:VWi}=M_e(),{Response:BBc}=P3r(),$V=Symbol("CacheableResponse internals"),FBc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),M3r=class t extends BBc{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new VWi(r.headers);this[$V]={headers:n,bufferedBody:e}}get headers(){return this[$V].headers}set headers(e){if(e instanceof VWi)this[$V].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return LBc.from(this[$V].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[$V].bufferedBody}async arrayBuffer(){return FBc(this[$V].bufferedBody)}async text(){return this[$V].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[$V].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},UBc=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 M3r(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");WWi.exports={cacheableResponse:UBc}});var jTt=I((i8h,YWi)=>{"use strict";p();var O3r=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};YWi.exports={RequestAbortedError:O3r}});var ezi=I((a8h,XWi)=>{"use strict";p();var JWi=require("http"),ZWi=require("https"),{Readable:QBc}=require("stream"),B9=_P()("helix-fetch:h1"),{RequestAbortedError:KWi}=jTt(),{decodeStream:qBc}=M9(),jBc=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 ZWi.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new JWi.Agent(n),r.httpAgent):void 0},"getAgent"),HBc=a(t=>{t.h1={}},"setupContext"),GBc=a(async({h1:t})=>{t.httpAgent&&(B9("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(B9("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),$Bc=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?qBc(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"),VBc=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?ZWi:JWi,o=jBc(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)=>{B9(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{B9(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{B9(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(B9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new KWi),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new KWi);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(B9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u($Bc(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(B9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(B9(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof QBc?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");XWi.exports={request:VBc,setupContext:HBc,resetContext:GBc}});var izi=I((u8h,nzi)=>{"use strict";p();var{connect:WBc,constants:zBc}=require("http2"),{Readable:YBc}=require("stream"),vd=_P()("helix-fetch:h2"),{RequestAbortedError:tzi}=jTt(),{decodeStream:KBc}=M9(),{NGHTTP2_CANCEL:AFe}=zBc,JBc=300*1e3,ZBc=5e3,XBc=a(t=>{t.h2={sessionCache:{}}},"setupContext"),e3c=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),vd(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),rzi=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?KBc(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"),t3c=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=ZBc}}}=t,d=o[":path"],f=`${e}${d}`;vd(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(AFe)},"rejectPush")),n.on("push",(h,m)=>{vd(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{vd(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(AFe)}),l&&l(f,o,rzi(h,n,r))}),n.on("aborted",()=>{vd(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{vd(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{vd(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),r3c=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=JBc,pushPromiseHandler:h,pushHandler:m}=u,g={...r},{method:A,headers:y,socket:E,body:_,decode:v}=g;return E&&delete g.socket,y.host&&(y[":authority"]=y.host,delete y.host),new Promise((b,T)=>{let w=d[n];if(!w||w.closed||w.destroyed){let N=!(t.options.rejectUnauthorized===!1||u.rejectUnauthorized===!1),L={...u,rejectUnauthorized:N};E&&!E.inUse&&(L.createConnection=()=>(vd(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E)),w=WBc(n,{...L,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{vd(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{vd(`session ${n} established`),vd(`caching session ${n}`),d[n]=w}),w.on("localSettings",q=>{vd(`session ${n} localSettings: ${JSON.stringify(q)}`)}),w.on("remoteSettings",q=>{vd(`session ${n} remoteSettings: ${JSON.stringify(q)}`)}),w.once("close",()=>{vd(`session ${n} closed`),d[n]===w&&(vd(`discarding cached session ${n}`),delete d[n])}),w.once("error",q=>{vd(`session ${n} encountered error: ${q}`),d[n]===w&&(vd(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(q,M,O)=>{vd(`session ${n} encountered frameError: type: ${q}, code: ${M}, id: ${O}`)}),w.once("goaway",(q,M,O)=>{vd(`session ${n} received GOAWAY frame: errorCode: ${q}, lastStreamID: ${M}, opaqueData: ${O?O.toString():void 0}`)}),w.on("stream",(q,M,O)=>{t3c(t,n,v,q,M,O)})}else E&&E.id!==w.socket.id&&!E.inUse&&(vd(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());vd(`${A} ${e.host}${l}`);let R,{signal:x}=g,P=a(()=>{x.removeEventListener("abort",P),T(new tzi),R&&R.close(AFe)},"onAbortSignal");if(x){if(x.aborted){T(new tzi);return}x.addEventListener("abort",P)}let D=a(N=>{vd(`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",P),b(rzi(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),R.rstCode!==AFe&&(vd(`${g.method} ${e.href} failed with: ${N.message}`),R.close(AFe),T(N))}),R.once("frameError",(N,L,B)=>{w.off("error",D),vd(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${L}, id: ${B}`)}),R.on("push",(N,L)=>{vd(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${L}`)}),_ instanceof YBc?_.pipe(R):(_&&R.write(_),R.end())})},"request");nzi.exports={request:r3c,setupContext:XBc,resetContext:e3c}});var szi=I((p8h,ozi)=>{"use strict";p();var{EventEmitter:n3c}=require("events"),i3c=a(()=>{let t={},e=new n3c;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");ozi.exports=i3c});var azi=I((g8h,o3c)=>{o3c.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 fzi=I((A8h,dzi)=>{"use strict";p();var{Readable:s3c}=require("stream"),a3c=require("tls"),{types:{isAnyArrayBuffer:c3c}}=require("util"),l3c=S3r(),L3r=_P()("helix-fetch:core"),{RequestAbortedError:HTt}=jTt(),B3r=ezi(),GTt=izi(),u3c=szi(),{isPlainObject:d3c}=M9(),{isFormData:f3c,FormDataSerializer:p3c}=gFe(),{version:h3c}=azi(),F3r="h2",U3r="h2c",Q3r="http/1.0",Mie="http/1.1",m3c=100,g3c=3600*1e3,A3c=[F3r,Mie,Q3r],y3c=`helix-fetch/${h3c}`,E3c={method:"GET",compress:!0,decode:!0},czi=0,lzi=u3c(),uzi=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new HTt;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new HTt);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof HTt||(L3r(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=a3c.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),czi+=1,s.id=czi,s.secureConnecting=!1,L3r(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),_3c=a(async(t,e)=>{let r=await lzi.acquire(t.origin);try{return r||(r=await uzi(t,e)),r}finally{lzi.release(t.origin,r)}},"connect"),v3c=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=Mie,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=U3r,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 _3c(e,d);return o=f.alpnProtocol,o||(o=Mie),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),C3c=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),b3c=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 uzi(e,d);return{protocol:f.alpnProtocol||Mie,socket:f}}return{protocol:l.alpnProtocol||Mie,socket:l}},"getProtocolAndSocketFromFactory"),S3c=a(async(t,e,r)=>{let n=new URL(e),o={...E3c,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=C3c(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(f3c(o.body)){let d=new p3c(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":d3c(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):c3c(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 s3c||(!(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 b3c(t.socketFactory,n,o,t.alpnProtocols):await v3c(t,n,c);switch(L3r(`${n.host} -> ${l}`),l){case F3r:try{return await GTt.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 U3r:return GTt.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case Q3r:case Mie:return B3r.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),T3c=a(async t=>(t.alpnCache.clear(),Promise.all([B3r.resetContext(t),GTt.resetContext(t)])),"resetContext"),I3c=a(t=>{let{options:{alpnProtocols:e=A3c,alpnCacheTTL:r=g3c,alpnCacheSize:n=m3c,userAgent:o=y3c,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new l3c({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,B3r.setupContext(t),GTt.setupContext(t)},"setupContext");dzi.exports={request:S3c,setupContext:I3c,resetContext:T3c,RequestAbortedError:HTt,ALPN_HTTP2:F3r,ALPN_HTTP2C:U3r,ALPN_HTTP1_1:Mie,ALPN_HTTP1_0:Q3r}});var hzi=I((_8h,pzi)=>{"use strict";p();var x3c=_P()("helix-fetch:core"),{request:w3c,setupContext:R3c,resetContext:k3c,RequestAbortedError:P3c,ALPN_HTTP2:D3c,ALPN_HTTP2C:N3c,ALPN_HTTP1_1:M3c,ALPN_HTTP1_0:O3c}=fzi(),q3r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},R3c(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:P3c,ALPN_HTTP2:D3c,ALPN_HTTP2C:N3c,ALPN_HTTP1_1:M3c,ALPN_HTTP1_0:O3c}}async request(e,r){return w3c(this,e,r)}setCA(e){this.options.ca=e}async reset(){return x3c("resetting context"),k3c(this)}};pzi.exports=new q3r().api()});var Ezi=I((b8h,yzi)=>{"use strict";p();var{EventEmitter:L3c}=require("events"),{Readable:yFe}=require("stream"),j3r=_P()("helix-fetch"),B3c=S3r(),{Body:F3c}=OTt(),{Headers:V3r}=M_e(),{Request:Oie}=FWi(),{Response:G3r}=P3r(),{FetchBaseError:U3c,FetchError:EFe,AbortError:$Tt}=x3r(),{AbortController:Q3c,AbortSignal:q3c,TimeoutSignal:j3c}=w3r(),H3c=$Wi(),{cacheableResponse:G3c}=zWi(),{sizeof:$3c}=M9(),{isFormData:V3c}=gFe(),{context:W3c,RequestAbortedError:z3c}=hzi(),mzi=["GET","HEAD"],Y3c=500,K3c=100*1024*1024,H3r="push",gzi=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof Oie&&typeof r>"u"?e:new Oie(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 $Tt("The operation was aborted.");throw o.init.body instanceof yFe&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof yFe)&&!V3c(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof yFe&&m.destroy(w),w instanceof TypeError?w:w instanceof z3c?new $Tt("The operation was aborted."):new EFe(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new $Tt("The operation was aborted.");o.init.body instanceof yFe&&o.init.body.destroy(w),g.readable.emit("error",w)},"abortHandler");l&&l.addEventListener("abort",A);let{statusCode:y,statusText:E,httpVersion:_,headers:v,readable:b,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 EFe(`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 EFe(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new V3r(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 yFe)throw l&&l.removeEventListener("abort",A),new EFe("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),gzi(t,new Oie(R,x))}default:}}return l&&(b.once("end",()=>{l.removeEventListener("abort",A)}),b.once("error",()=>{l.removeEventListener("abort",A)})),new G3r(b,{url:o.url,status:y,statusText:E,headers:v,httpVersion:_,decoded:T,counter:o.counter})},"fetch"),Azi=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!mzi.includes(e.method))return r;let n=new H3c(e,r,{shared:!1});if(n.storable()){let o=await G3c(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),J3c=a(async(t,e,r)=>{let n=new Oie(e,r);if(t.options.maxCacheSize!==0&&mzi.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 V3r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await gzi(t,n);return n.cache!=="no-store"?Azi(t,n,s):s},"cachingFetch"),Z3c=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"),X3c=a(t=>new j3c(t),"timeoutSignal"),$3r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:K3c,o=Y3c;n===0&&(n=1,o=1);let s=a(({response:l},u)=>$3c(l),"sizeCalculation");this.cache=new B3c({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new L3c,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(_=>_.startsWith(":")).forEach(_=>delete f[_]);let{statusCode:h,statusText:m,httpVersion:g,headers:A,readable:y,decoded:E}=d;this.pushHandler(l,f,new G3r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:E}))}),this.context=W3c(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:F3c,Headers:V3r,Request:Oie,Response:G3r,AbortController:Q3c,AbortSignal:q3c,FetchBaseError:U3c,FetchError:EFe,AbortError:$Tt,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:Z3c,timeoutSignal:X3c,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 J3c(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(H3r,e)}offPush(e){return this.eventEmitter.off(H3r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){j3r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new Oie(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(j3r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){j3r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await Azi(this,new Oie(e,{headers:r}),n);this.eventEmitter.emit(H3r,e,o)}};yzi.exports=new $3r().api()});var vzi=I((I8h,_zi)=>{"use strict";p();_zi.exports=Ezi()});var Hzi=I((RUh,jzi)=>{"use strict";p();function qzi(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(qzi,"validateParameter");function IFc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(IFc,"hasOwnProperty");function xFc(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(xFc,"defineOperation");jzi.exports={defineOperation:xFc,validateParameter:qzi}});var Z3r=I((DUh,Vzi)=>{"use strict";p();var q_e=Y6e()("kerberos"),Q_e=q_e.KerberosClient,Gzi=q_e.KerberosServer,WV=Hzi().defineOperation,wFc=1,RFc=2,kFc=4,PFc=8,DFc=16,NFc=32,MFc=64,OFc=128,LFc=256,$zi=0,BFc=9,FFc=6;Q_e.prototype.step=WV(Q_e.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);Q_e.prototype.wrap=WV(Q_e.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);Q_e.prototype.unwrap=WV(Q_e.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);Gzi.prototype.step=WV(Gzi.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var UFc=WV(q_e.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}]),QFc=WV(q_e.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),qFc=WV(q_e.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:$zi}},{name:"callback",type:"function",required:!1}]),jFc=WV(q_e.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);Vzi.exports={initializeClient:qFc,initializeServer:jFc,principalDetails:QFc,checkPassword:UFc,GSS_C_DELEG_FLAG:wFc,GSS_C_MUTUAL_FLAG:RFc,GSS_C_REPLAY_FLAG:kFc,GSS_C_SEQUENCE_FLAG:PFc,GSS_C_CONF_FLAG:DFc,GSS_C_INTEG_FLAG:NFc,GSS_C_ANON_FLAG:MFc,GSS_C_PROT_READY_FLAG:OFc,GSS_C_TRANS_FLAG:LFc,GSS_C_NO_OID:$zi,GSS_MECH_OID_KRB5:BFc,GSS_MECH_OID_SPNEGO:FFc}});var Wzi=I((MUh,HFc)=>{HFc.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 Yzi=I((OUh,zzi)=>{"use strict";p();var GFc=require("dns"),$Fc=Z3r(),X3r=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=VFc(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();GFc.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}`;$Fc.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 VFc(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=WFc(t),r(null,o)})}}a(VFc,"firstTransition");function WFc(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=zFc(t),r(null,o||"")})}}a(WFc,"secondTransition");function zFc(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=YFc(t),r(null,c)})})}}a(zFc,"thirdTransition");function YFc(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(YFc,"fourthTransition");zzi.exports={MongoAuthProcess:X3r}});var Jzi=I((FUh,CFe)=>{"use strict";p();var Kzi=Z3r();CFe.exports=Kzi;CFe.exports.Kerberos=Kzi;CFe.exports.version=Wzi().version;CFe.exports.processes={MongoAuthProcess:Yzi().MongoAuthProcess}});var Soo={};ki(Soo,{AbortError:()=>R1,DirectConnectError:()=>gk,DirectConnectTransport:()=>r6r,EXIT_REASONS:()=>w9c,HOOK_EVENTS:()=>Ewt,InMemorySessionStore:()=>n8r,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>R9c,createSdkMcpServer:()=>aZc,deleteSession:()=>arl,filterEscalatingDefaultMode:()=>Vtl,foldSessionSummary:()=>AZi,forkSession:()=>crl,getSessionInfo:()=>irl,getSessionMessages:()=>rrl,getSubagentMessages:()=>frl,importSessionToStore:()=>lrl,listSessions:()=>nrl,listSubagents:()=>drl,parseDirectConnectUrl:()=>uZc,query:()=>erl,renameSession:()=>orl,resolveSettings:()=>ztl,startup:()=>trl,tagSession:()=>srl,tool:()=>sZc});function W8c(t){return this[t]}function J8c(t,e){this[t]=K8c.bind(null,e)}function r8r(t=I9c){let e=new AbortController;return(0,fZi.setMaxListeners)(t,e.signal),e}function pZi(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 x9c(t,e){t(Error(e))}function Vie(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(x9c,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function I6r(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=P9c.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(!k9c.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function AZi(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=O9c(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)}L9c(c,l);for(let[d,f]of Object.entries(D9c)){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 N9c(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=KV(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=KV(r.customTitle)||KV(r.aiTitle)||void 0,s=o||KV(r.lastPrompt)||KV(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:KV(r.gitBranch)||void 0,cwd:KV(r.cwd)||e||void 0,tag:KV(r.tag)||void 0,createdAt:M9c(r.createdAt)}:null}function KV(t){return typeof t=="string"?t:void 0}function M9c(t){return typeof t=="number"?t:void 0}function O9c(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function L9c(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=I6r(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function yZi(){return process.versions.bun!==void 0}function s_(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 M8e(){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 H9c(t){var e=q9c.call(t,TFe),r=t[TFe];try{t[TFe]=void 0;var n=!0}catch{}var o=j9c.call(t);return n&&(e?t[TFe]=r:delete t[TFe]),o}function W9c(t){return V9c.call(t)}function J9c(t){return t==null?t===void 0?K9c:Y9c:FYi&&FYi in Object(t)?G9c(t):z9c(t)}function Z9c(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function nUc(t){if(!Y9(t))return!1;var e=O8e(t);return e==eUc||e==tUc||e==X9c||e==rUc}function oUc(t){return!!UYi&&UYi in t}function lUc(t){if(t!=null){try{return cUc.call(t)}catch{}try{return t+""}catch{}}return""}function yUc(t){if(!Y9(t)||sUc(t))return!1;var e=x6r(t)?AUc:fUc;return e.test(uUc(t))}function _Uc(t,e){return t?.[e]}function CUc(t,e){var r=vUc(t,e);return EUc(r)?r:void 0}function SUc(){this.__data__=o8e?o8e(null):{},this.size=0}function IUc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function PUc(t){var e=this.__data__;if(o8e){var r=e[t];return r===wUc?void 0:r}return kUc.call(e,t)?e[t]:void 0}function OUc(t){var e=this.__data__;return o8e?e[t]!==void 0:MUc.call(e,t)}function FUc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=o8e&&e===void 0?BUc:e,this}function Lve(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function ZUc(t,e){var r=this.__data__,n=vwt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Bve(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 S7c(){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 IZi(...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 xZi(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return IZi({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function D6r(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 T7c(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 x7c(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 Ri(`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 RZi(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new nu(`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 nu(`Refusing to send credential over non-https token endpoint "${t}"`)}async function kZi(t,e){let r=await M7c(t),n;try{n=JSON.parse(r)}catch{throw new nu(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,Ak(r),e)}if(!n.access_token)throw new nu(`Token endpoint response missing access_token: ${JSON.stringify(Ak(n))}`,t.status,Ak(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new nu(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,Ak(n),e);return n}function Ak(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=SFr?t:t.slice(0,SFr)+`... <${t.length-SFr} more chars>`}return JSON.stringify(Ak(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))N7c.has(r)&&(e[r]=n);return e}return null}async function PZi(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 nu(`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 nu(`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 DZi(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 M7c(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>VYi){let l=VYi-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 Wie(){return Math.floor(Date.now()/1e3)}function O7c(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 M6r(t){let e;return(WYi??(e=new globalThis.TextEncoder,WYi=e.encode.bind(e)))(t)}function YYi(t){let e;return(zYi??(e=new globalThis.TextDecoder,zYi=e.decode.bind(e)))(t)}function VFe(){}function vIt(t,e,r){return!e||nxt[t]>nxt[r]?VFe:e[t].bind(e)}function oA(t){let e=t.logger,r=t.logLevel??"off";if(!e)return L7c;let n=JYi.get(e);if(n&&n[0]===r)return n[1];let o={error:vIt("error",e,r),warn:vIt("warn",e,r),info:vIt("info",e,r),debug:vIt("debug",e,r)};return JYi.set(e,[r,o]),o}function MZi(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(!B7c.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function ZYi(t){if(!t)throw new Ri("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 Ri(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new Ri(`Identity token file at ${t} is empty`);return n}}function q7c(t){if(!t)throw new Ri("Identity token value is empty");return()=>t}function j7c(t){return async()=>{RZi(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new nu(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:w7c,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}${wZi}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${rxt},${k7c}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${iW} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new nu(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=Ak(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 nu(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await kZi(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new nu(`Token endpoint response missing required fields: ${JSON.stringify(Ak(c))}`,o.status,Ak(c),s);return{token:c.access_token,expiresAt:Wie()+l}}}function H7c(t){return async e=>{let r=await import("node:fs");await PZi(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new nu(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new nu(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new nu(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||Wie()"");throw new nu(`User OAuth refresh failed (HTTP ${f.status}): ${Ak(E)}`,f.status,Ak(E),h)}let m=await kZi(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new nu(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Ak(m))}`,f.status,Ak(m),h);let A=Wie()+g,y=m.refresh_token||l;return await DZi(t.credentialsPath,{...o,version:NZi,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function LZi(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=$7c(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 G7c(t,e){let r=await F7c(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 U7c(n,e)??void 0}};return LZi(s,t)}function $7c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=V7c(o);if(!s)throw new nu("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 nu("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 nu("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=j7c({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?W7c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new nu("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return H7c({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 nu(`authentication.type "${o}" is not a known authentication type`)}}}function V7c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new nu(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new nu('identity_token.source "file" requires a non-empty path');return ZYi(t.identity_token.path)}let e=tu("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return ZYi(e);let r=tu("ANTHROPIC_IDENTITY_TOKEN");return r?q7c(r):null}function W7c(t,e,r,n){return async o=>{let s=await import("node:fs");await PZi(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||Wie()0&&(yield e)}function Z7c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function BZi(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return oA(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):Xie.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 FZi(u,r)}return await r.text()})();return oA(t).debug(`[${n}] response parsed`,Gie({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function FZi(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 ave(t,e,r){return UZi(),new File(t,e??"unknown_file",r)}function qIt(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 X7c(t){let e=typeof t=="function"?t:t.fetch,r=XYi.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 XYi.set(e,n),n}async function iQc(t,e,r){if(UZi(),t=await t,e||(e=qIt(t,!0)),rQc(t))return t instanceof File&&e==null&&r==null?t:ave([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(nQc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),ave(await d8r(o),e,r)}let n=await d8r(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 ave(n,e,r)}async function d8r(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(qZi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(QZi(t))for await(let r of t)e.push(...await d8r(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${oQc(t)}`)}return e}function oQc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*sQc(t){if(!t)return;if(jZi 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():qYi(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=qYi(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 HZi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function jIt(t){return typeof t=="object"&&t!==null&&t8e in t}function GZi(t,e){let r=new Set;if(t)for(let n of t)jIt(n)&&r.add(n[t8e]);if(e){for(let n of e)if(jIt(n)&&r.add(n[t8e]),Array.isArray(n.content))for(let o of n.content)jIt(o)&&r.add(o[t8e])}return Array.from(r)}function $Zi(t,e){let r=GZi(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function cQc(t){return jIt(t)?{"x-stainless-helper":t[t8e]}:{}}function WZi(t){return t?.output_format??t?.output_config?.format}function tKi(t,e,r){let n=WZi(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}:zZi(t,e,r)}function zZi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=lQc(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 lQc(t,e){let r=WZi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ri(`Failed to parse structured output: ${n}`)}}function oKi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function aKi(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function mQc(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 mxt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function lKi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new Ri("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 KZi(t){return t?.output_config?.format}function uKi(t,e,r){let n=KZi(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}:JZi(t,e,r)}function JZi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=AQc(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 AQc(t,e){let r=KZi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ri(`Failed to parse structured output: ${n}`)}}function hKi(t){return t.type==="tool_use"||t.type==="server_tool_use"}function L8e(t){return t instanceof Error?t:Error(String(t))}function GIt(t){return t instanceof Error?t.message:String(t)}function NI(t){if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}function B8e(t){return NI(t)==="ENOENT"}function XZi(t){return NI(t)==="EISDIR"}function vQc(t){let e=NI(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function SQc(t,e,r){let n=`${t}.tmp.${(0,rXi.randomBytes)(4).toString("hex")}`;try{await(0,jL.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,jL.rename)(n,t)}catch(o){let s=NI(o);if(s!==void 0&&CQc.has(s)){try{await(0,jL.copyFile)(n,t)}catch(c){throw bQc.has(NI(c)??"")&&await(0,jL.unlink)(t).catch(()=>{}),c}await(0,jL.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,jL.unlink)(n).catch(()=>{}),o}}function Sxt(){return TQc.getStore()??new A8r}function nXi(){if(J_e)return J_e;if(!s_(process.env.DEBUG_CLAUDE_AGENT_SDK))return zie=null,J_e=Promise.resolve(),J_e;let t=(0,g8r.join)(Uve(),"debug");return zie=(0,g8r.join)(t,`sdk-${(0,eXi.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${zie} +`),J_e=Sxt().mkdir(t).catch(()=>{}),J_e}function IQc(){return nXi(),zie??null}function hk(t){if(zie===null)return;let e=`${new Date().toISOString()} ${t} +`;nXi().then(()=>{zie&&Sxt().append(zie,e).catch(()=>{})})}function xQc(){this.__data__=new Cwt,this.size=0}function RQc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function PQc(t){return this.__data__.get(t)}function NQc(t){return this.__data__.has(t)}function LQc(t,e){var r=this.__data__;if(r instanceof Cwt){var n=r.__data__;if(!vZi||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=lqc}function Oqc(t){return qve(t)&&Q6r(t.length)&&!!Cd[O8e(t)]}function Bqc(t){return function(e){return t(e)}}function Gqc(t,e){var r=uW(t),n=!r&&d8e(t),o=!r&&!n&&U6r(t),s=!r&&!n&&!o&&cXi(t),c=r||n||o||s,l=c?WQc(t.length,String):[],u=l.length;for(var d in t)(e||Hqc.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Swt(d,u)))&&l.push(d);return l}function Wqc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Vqc;return t===r}function zqc(t,e){return function(r){return t(e(r))}}function Kqc(t){return t!=null&&Q6r(t.length)&&!x6r(t)}function Jqc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function tjc(t){if(!Y9(t))return Zqc(t);var e=lXi(t),r=[];for(var n in t)n=="constructor"&&(e||!ejc.call(t,n))||r.push(n);return r}function njc(t){return q6r(t)?$qc(t,!0):rjc(t)}function ojc(t,e){if(e)return t.slice();var r=t.length,n=CKi?CKi(r):new t.constructor(r);return t.copy(n),n}function sjc(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 AHc(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function EHc(t){return yHc.register(t)}function vHc(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 CHc(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 bHc(t,e){if(!e)return!0;let r=vHc(t);return CHc(r,e)}function SHc(t){return/^[\\/]{2}/.test(t)}function THc(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function xKi(t){try{return THc(yXi.realpathSync.native(t))}catch{return null}}function IHc(t,e){let r=(0,HL.resolve)(e).toLowerCase(),n=(0,HL.resolve)(t).toLowerCase();if((0,HL.dirname)(n)===r||n.startsWith(r+HL.sep))return!0;let o=xKi(e)?.toLowerCase();if(o==null)return!1;let s=xKi((0,HL.dirname)((0,HL.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+HL.sep)}function EXi(t,e){if(SHc(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 MI(){return wHc}function RHc(t,e){t.destroyed||t.write(e)}function kHc(t){RHc(process.stderr,t)}function PHc(t){return t.charAt(0).toUpperCase()+t.slice(1)}function DHc(t,e,r=e+"s"){return t===1?e:r}function NHc(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function BHc(t){return LHc.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function FHc(t){kKi??=BHc(!0);for(let e of kKi)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 Iwt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function jHc(t){if(!C8r()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=qHc();return bHc(t,e)}async function CXi(t,e,r=GHc){if(qFe<0?qFe=await(0,l_.stat)(t).then(n=>n.size).catch(()=>0):qFe+=e,!(qFe<=r||LFr)){LFr=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,l_.rename)(t,n)}catch(o){B8e(o)||(await(0,l_.unlink)(n).catch(()=>{}),await(0,l_.rename)(t,n).catch(()=>(0,l_.unlink)(t).catch(()=>{})))}qFe=0}finally{LFr=!1}}}function bXi(t){return b8r=(0,soe.join)(t,`${AXi()}.txt`),b8r}async function $Hc(t,e,r,n){t&&await(0,l_.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,l_.appendFile)(r,n)}catch(s){if(!XZi(s))throw s;o=bXi(r),await(0,l_.appendFile)(o,n)}await CXi(o,Buffer.byteLength(n)).catch(S8r),TXi()}function S8r(){}function VHc(){if(!LIt){let t=null;LIt=gHc({writeFn:a(e=>{let r=SXi(),n=(0,soe.dirname)(r),o=t!==n;if(t=n,C8r()){if(o)try{MI().mkdirSync(n)}catch{}let s=r;try{MI().appendFileSync(r,e)}catch(c){if(!XZi(c))throw c;s=bXi(r),MI().appendFileSync(s,e)}CXi(s,Buffer.byteLength(e)).catch(S8r),TXi();return}OFr=OFr.then($Hc.bind(null,o,n,r,e)).catch(S8r)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:C8r()}),EHc(async()=>{LIt?.dispose(),await OFr})}return LIt}function ru(t,{level:e}={level:"debug"}){if(v8r[e]t.endsWith(e))}function rGc(t,e){return(0,mZi.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 nGc(){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 iGc(t,e=process.platform,r=process.arch,n=IXi.existsSync,o=nGc()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${Z_e}-linux-${r}-android`]:e==="linux"?o?[`${Z_e}-linux-${r}-musl`,`${Z_e}-linux-${r}`]:[`${Z_e}-linux-${r}`,`${Z_e}-linux-${r}-musl`]:[`${Z_e}-${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 oGc(){return{eventQueue:[],sink:null}}function W6r(t,e){let r=sGc;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function xXi(t){W6r("tengu_feature_ok",{feature_name:t})}function wXi(t,e,r){W6r("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function aGc(t,e,r){W6r("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function j9(t,e,r){try{let n=await e();return xXi(t),n}catch(n){throw wXi(t,r?.(n)??"error"),n}}function lGc(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 n8e(t){if(typeof t=="string")return lGc(t);if(Array.isArray(t))return t.map(n8e);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[n8e(r)]=n8e(n);return e}return t}function uGc(){return process.platform==="win32"}function fGc(t){let e=BFr.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,MXi.join)(r,"System32","where.exe");try{let o=(0,NXi.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:dGc,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!IHc(c,s))return BFr.set(t,c),c;return null}catch(o){return pGc(o)&&BFr.set(t,null),null}}function pGc(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 hGc(t){return!uGc()||t.includes("/")||t.includes("\\")?t:fGc(t)}async function F8e(t){let e=hGc("git");if(e===null)return[];try{let{stdout:r}=await mGc(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 gGc(t){let e=0;for(let r=0;ro&&(n=OXi(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function k8r(t,e){let r=(0,kXi.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` +`)||await(0,R8r.once)(r,"drain");r.end(),await(0,R8r.once)(r,"finish")}catch(n){throw r.destroy(),n}}function LXi(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=I6r(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function yGc(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=I6r(r,e);if(n!==void 0)return n}return e.commandFallback}async function BXi(t){try{let e=await(0,QN.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe(V9),o=await e.read(n,0,V9,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-V9),l=s;if(c>0){let u=await e.read(n,0,V9,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 EGc(t){return Math.abs(gGc(t)).toString(36)}function U8e(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=f8e?e:`${e.slice(0,f8e)}-${EGc(t)}`}function mW(){return(0,gve.join)(Uve(),"projects")}function _Gc(t){return(0,gve.join)(mW(),U8e(t))}async function Q8e(t){try{return(await(0,QN.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function FN(t){let e=_Gc(t),r=[];try{await(0,QN.readdir)(e),r.push(e)}catch{}let n=U8e(t);if(n.length<=f8e)return r;let o=n.slice(0,f8e)+"-",s=mW();try{for(let c of await(0,QN.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,gve.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function xwt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,gve.join)(c,r);try{let d=await(0,QN.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await Q8e(e);for(let u of await FN(c)){let d=await n(u,c);if(d)return d}let l;try{l=await F8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await FN(u)){let f=await n(d,u);if(f)return f}return}let o=mW(),s;try{s=await(0,QN.readdir)(o)}catch{return}for(let c of s){let l=await n((0,gve.join)(o,c),void 0);if(l)return l}}function SGc(){return bGc??=Buffer.from('"compact_boundary"')}function FXi(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 Yie(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 kxt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function wGc(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(p8e);if(o===-1||o>=r)return 0;let s=o+1;if(kxt(n,Pxt,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 PGc(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 DGc(t){if(t.carryLen>0){let e=t.carryBuf;kxt(e,Pxt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):Yie(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==p8e&&Yie(t.out,IGc,0,1),Yie(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function NGc(t,e){let r=SGc(),n=vGc,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,QN.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=RGc(o,f,r);kGc(o,f,s,h.lastSnapStart,h.lastSnapEnd),PGc(o,f,h.trailStart),o.bufFileOff+=h.trailStart}DGc(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function MGc(t,e){try{return e>CGc&&!s_(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await NGc(t,e)).postBoundaryBuf:await(0,RXi.readFile)(t)}catch{return null}}function OGc(t){let e=[];try{let o=ef(e,rf`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=YHc(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{tf(e,r,n)}}function LGc(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 b=e.get(v);e.set(v,{...b,parentUuid:y}),y=v}let E=g.uuids[0],_=g.uuids.at(-1);for(let[v,b]of e)b.parentUuid===g.anchorUuid&&v!==E&&e.set(v,{...b,parentUuid:_})}else if(A){let y=e.get(A.headUuid);y&&e.set(A.headUuid,{...y,parentUuid:A.anchorUuid});for(let[E,_]of e)_.parentUuid===A.anchorUuid&&E!==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(),FGc(e,d,f)}function UFr(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 BGc(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 FGc(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=UFr(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=UFr(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(BGc(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=UFr(h);if(!m||l.has(m))continue;l.add(m);let g=s.get(m)??[h],A=g.filter(b=>!r.has(b.uuid)),y=[];for(let b of g){let T=c.get(b.uuid);if(T)for(let w of T)r.has(w.uuid)||y.push(w)}if(A.length===0&&y.length===0)continue;let E=a((b,T)=>(b.timestamp??"").localeCompare(T.timestamp??""),"D");A.sort(E),y.sort(E);let _=o.get(m),v=[...A,...y];for(let b of v)r.add(b.uuid);d+=v.length,u.set(_.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 UGc(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function UXi(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 QXi(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 QGc(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 qXi(r,e)}function qXi(t,e){let r=LGc(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>UGc(s,n)).map(s=>UXi(s));return QXi(o,e)}async function qGc(t,e){if(!bh(t))return[];let r=await xwt(t,e?.dir);if(!r)return[];let n=await MGc(r.filePath,r.fileSize);return n?qXi(OGc(n),e):[]}function wwt(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=mk(o,"customTitle")||mk(n,"customTitle")||mk(o,"aiTitle")||mk(n,"aiTitle")||void 0,f=LXi(n)||void 0,h=FFr(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||mk(o,"lastPrompt")||mk(o,"summary")||f;if(!g)return null;let A=mk(o,"gitBranch")||FFr(n,"gitBranch")||void 0,y=FFr(n,"cwd")||r||void 0,E=o.split(` +`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),_=E&&mk(E,"tag")||void 0;return{sessionId:t,summary:g,lastModified:s,fileSize:c,customTitle:d,firstPrompt:f,gitBranch:A,cwd:y,tag:_,createdAt:m}}async function JFe(t,e,r){let n;try{n=await(0,jve.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=bh(o.slice(0,-6));if(!s)return null;let c=(0,Hve.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,jve.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function jXi(t){let e=await BXi(t.filePath);if(!e)return null;let r=wwt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function HGc(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function GGc(t,e,r){t.sort(HGc);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 VGc(t,e,r){let n=await Q8e(t),o;if(e)try{o=await F8e(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await FN(n))h.push(...await JFe(m,r,n));return h}let s=mW(),c=process.platform==="win32",l=o.map(h=>{let m=U8e(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,jve.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await FN(n))h.push(...await JFe(m,r,n));return h}let d=[],f=new Set;for(let h of await FN(n)){let m=(0,Hve.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await JFe(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>=f8e&&m.startsWith(A+"-")){f.add(m),d.push(...await JFe((0,Hve.join)(s,h.name),r,g));break}}}return d}async function WGc(t){let e=mW(),r;try{r=await(0,jve.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>JFe((0,Hve.join)(e,n.name),t)))).flat()}async function zGc(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 VGc(e,o??!0,c):await WGc(c);return c?GGc(l,r,s):$Gc(l)}async function YGc(t,e={}){let r=bh(t);if(!r)return;let n=await xwt(r,e.dir);if(!n)return;let o=await BXi(n.filePath);if(o)return wwt(r,o,n.projectPath)??void 0}async function KGc(t,e,r={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=Qm({type:"custom-title",customTitle:e.trim(),sessionId:t})+` +`;await HXi(t,n,r)}async function JGc(t,e,r={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=n8e(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=Qm({type:"tag",tag:e??"",sessionId:t})+` +`;await HXi(t,n,r)}async function ZGc(t,e={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await XGc(e)){let n=(0,Kie.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,GL.stat)(n))}catch(s){let c=NI(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,GL.rm)(n,{force:!0}),await(0,GL.rm)((0,Kie.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 XGc(t){if(t.dir){let r=await Q8e(t.dir),n=await FN(r),o;try{o=await F8e(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await FN(s));return n}let e=mW();try{return(await(0,GL.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,Kie.join)(e,r.name))}catch{return[]}}async function HXi(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await Q8e(r.dir);for(let u of await FN(c))if(await QFr((0,Kie.join)(u,n),e))return;let l;try{l=await F8e(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await FN(u))if(await QFr((0,Kie.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=mW(),s;try{s=await(0,GL.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await QFr((0,Kie.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function QFr(t,e){let r;try{r=await(0,GL.open)(t,P8r.constants.O_WRONLY|P8r.constants.O_APPEND)}catch(n){let o=NI(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 e$c(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await Sxt().readBytes((0,Dxt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await Q8e(e);for(let u of await FN(c)){let d=await n(u);if(d)return d}let l;try{l=await F8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await FN(u)){let f=await n(d);if(f)return f}return null}let o=mW(),s;try{s=await Sxt().list(o)}catch{return null}for(let c of s){let l=await n((0,Dxt.join)(o,c));if(l)return l}return null}function r$c(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{GXi($N(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function n$c(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||GXi(o,e,r,n);return{transcript:r,contentReplacements:n}}function GXi(t,e,r,n){t$c.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 i$c(t,e={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!bh(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await e$c(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}=o$c(r.buf,t,e);return await k8r((0,Dxt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function o$c(t,e,r){let n=r$c(t,e);return $Xi(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,V9)),c=t.toString("utf-8",Math.max(0,o-V9));return mk(c,"customTitle")||mk(s,"customTitle")||mk(c,"aiTitle")||mk(s,"aiTitle")||LXi(s)})}function s$c(t,e,r){let n=n$c(t,e);return $Xi(n,e,r,()=>a$c(t))}function a$c(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||yGc(t)||void 0}function $Xi(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,ZFe.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,ZFe.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,ZFe.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,ZFe.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function VXi(t,e){let r=await xwt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,Nxt.join)(n,"subagents")}async function WXi(t){let e=[];async function r(n){let o;try{o=await(0,h8e.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,Nxt.join)(n,s.name)})}else s.isDirectory()&&await r((0,Nxt.join)(n,s.name))}return a(r,"J"),await r(t),e}function c$c(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=$N(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function l$c(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 u$c(t,e){if(!bh(t))return[];let r=await VXi(t,e?.dir);return r?(await WXi(r)).map(n=>n.agentId):[]}async function d$c(t,e,r){if(!bh(t))return[];if(!e)return[];let n=await VXi(t,r?.dir);if(!n)return[];let o=(await WXi(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,h8e.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=$N(await(0,h8e.readFile)(l,"utf-8")).toolUseId}catch{}return zXi(s,r,c)}function zXi(t,e,r){if(t.length===0)return[];let n=c$c(t),o=l$c(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>UXi(s,r));return QXi(o,e)}function JXi(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function ZXi(t){return[...new Set(t)]}function f$c(){return"prod"}function y$c(){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 _$c(){let t=(()=>{switch(f$c()){case"local":return y$c();case"staging":return A$c??NKi;case"prod":return NKi}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!E$c.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 C$c(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"):Uve(),o=r?"":`-${(0,YXi.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${_$c().OAUTH_FILE_SUFFIX}${t}${o}`}function S$c(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,KXi.userInfo)().username}catch{t="claude-code-user"}return b$c.test(t)?t:"claude-code-user"}function D8r(){return I$c}function ln(t,e){let r=D8r(),n=N8r({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===m8e?void 0:m8e].filter(o=>!!o)});t.common.issues.push(n)}function Zo(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 teo(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 H$c(t){return new RegExp(`^${teo(t)}$`)}function G$c(t){let e=`${eeo}T${teo(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 $$c(t,e){return!!((e==="v4"||!e)&&L$c.test(t)||(e==="v6"||!e)&&F$c.test(t))}function V$c(t,e){if(!D$c.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 W$c(t,e){return!!((e==="v4"||!e)&&B$c.test(t)||(e==="v6"||!e)&&U$c.test(t))}function z$c(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 rve(t){if(t instanceof OI){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=_k.create(rve(n))}return new OI({...t._def,shape:a(()=>e,"shape")})}else return t instanceof fW?new fW({...t._def,type:rve(t.element)}):t instanceof _k?_k.create(rve(t.unwrap())):t instanceof J9?J9.create(rve(t.unwrap())):t instanceof K9?K9.create(t.items.map(e=>rve(e))):t}function O8r(t,e){let r=rW(t),n=rW(e);if(t===e)return{valid:!0,data:t};if(r===kn.object&&n===kn.object){let o=hc.objectKeys(e),s=hc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=O8r(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===kn.array&&n===kn.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 eC(t){return t&&Object.assign(Bxt,t),Bxt}function K$c(t){return t}function J$c(t){return t}function Z$c(t){}function X$c(t){throw Error()}function eVc(t){}function K6r(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 Vr(t,e="|"){return t.map(r=>us(r)).join(e)}function seo(t,e){return typeof e=="bigint"?e.toString():e}function Rwt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function aoe(t){return t==null}function kwt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function aeo(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 zc(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 J6r(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function tVc(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function rVc(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 sVc(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 us(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function ueo(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function aVc(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 VN(t,{...t._zod.def,shape:r,checks:[]})}function cVc(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 VN(t,{...t._zod.def,shape:r,checks:[]})}function lVc(t,e){if(!x8e(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 J6r(this,"shape",n),n},checks:[]};return VN(t,r)}function uVc(t,e){return VN(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return J6r(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function dVc(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 VN(e,{...e._zod.def,shape:o,checks:[]})}function fVc(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 VN(e,{...e._zod.def,shape:o,checks:[]})}function cve(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function e8e(t){return typeof t=="string"?t:t?.message}function jN(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=e8e(t.inst?._zod.def?.error?.(t))??e8e(e?.error?.(t))??e8e(r.customError?.(t))??e8e(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function Pwt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Dwt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function peo(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function pVc(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function e9r(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 t9r(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 ${geo(n.path)}`);return e.join(` +`)}function xeo(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function Beo(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 Feo(t){return new RegExp(`^${Beo(t)}$`)}function Ueo(t){let e=Beo({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(`^${Oeo}T(?:${n})$`)}function FKi(t,e,r){t.issues.length&&e.issues.push(...yk(r,t.issues))}function u9r(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Oto(t){if(!a9r.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return u9r(r)}function Fto(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 UKi(t,e,r){t.issues.length&&e.issues.push(...yk(r,t.issues)),e.value[r]=t.value}function BIt(t,e,r){t.issues.length&&e.issues.push(...yk(r,t.issues)),e.value[r]=t.value}function QKi(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(...yk(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function qKi(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=>jN(s,n,eC())))}),e}function U8r(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(x8e(t)&&x8e(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=U8r(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;njN(l,c,eC()))})),e.issues.length&&(Fxt.has(typeof n)?r.issues.push(...yk(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>jN(l,c,eC()))})),r.value.set(t.value,e.value)}function GKi(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function $Ki(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function VKi(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 WKi(t,e,r){return cve(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function zKi(t){return t.value=Object.freeze(t.value),t}function YKi(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(peo(o))}}function TVc(){return{localeError:SVc()}}function xVc(){return{localeError:IVc()}}function KKi(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 RVc(){return{localeError:wVc()}}function PVc(){return{localeError:kVc()}}function NVc(){return{localeError:DVc()}}function OVc(){return{localeError:MVc()}}function Aro(){return{localeError:BVc()}}function QVc(){return{localeError:UVc()}}function jVc(){return{localeError:qVc()}}function GVc(){return{localeError:HVc()}}function VVc(){return{localeError:$Vc()}}function zVc(){return{localeError:WVc()}}function KVc(){return{localeError:YVc()}}function ZVc(){return{localeError:JVc()}}function eWc(){return{localeError:XVc()}}function rWc(){return{localeError:tWc()}}function iWc(){return{localeError:nWc()}}function sWc(){return{localeError:oWc()}}function cWc(){return{localeError:aWc()}}function uWc(){return{localeError:lWc()}}function fWc(){return{localeError:dWc()}}function hWc(){return{localeError:pWc()}}function gWc(){return{localeError:mWc()}}function yWc(){return{localeError:AWc()}}function _Wc(){return{localeError:EWc()}}function CWc(){return{localeError:vWc()}}function SWc(){return{localeError:bWc()}}function IWc(){return{localeError:TWc()}}function JKi(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 wWc(){return{localeError:xWc()}}function kWc(){return{localeError:RWc()}}function DWc(){return{localeError:PWc()}}function MWc(){return{localeError:NWc()}}function LWc(){return{localeError:OWc()}}function UWc(){return{localeError:FWc()}}function qWc(){return{localeError:QWc()}}function HWc(){return{localeError:jWc()}}function $Wc(){return{localeError:GWc()}}function WWc(){return{localeError:VWc()}}function YWc(){return{localeError:zWc()}}function _9r(){return new w8e}function _ro(t,e){return new t({type:"string",...xr(e)})}function vro(t,e){return new t({type:"string",coerce:!0,...xr(e)})}function v9r(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...xr(e)})}function Hxt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...xr(e)})}function C9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...xr(e)})}function b9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xr(e)})}function S9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xr(e)})}function T9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xr(e)})}function I9r(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...xr(e)})}function x9r(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...xr(e)})}function w9r(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...xr(e)})}function R9r(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...xr(e)})}function k9r(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...xr(e)})}function P9r(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...xr(e)})}function D9r(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...xr(e)})}function N9r(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...xr(e)})}function M9r(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...xr(e)})}function O9r(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...xr(e)})}function L9r(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xr(e)})}function B9r(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xr(e)})}function F9r(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...xr(e)})}function U9r(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...xr(e)})}function Q9r(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...xr(e)})}function q9r(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...xr(e)})}function bro(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xr(e)})}function Sro(t,e){return new t({type:"string",format:"date",check:"string_format",...xr(e)})}function Tro(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...xr(e)})}function Iro(t,e){return new t({type:"string",format:"duration",check:"string_format",...xr(e)})}function xro(t,e){return new t({type:"number",checks:[],...xr(e)})}function wro(t,e){return new t({type:"number",coerce:!0,checks:[],...xr(e)})}function Rro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...xr(e)})}function kro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...xr(e)})}function Pro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...xr(e)})}function Dro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...xr(e)})}function Nro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...xr(e)})}function Mro(t,e){return new t({type:"boolean",...xr(e)})}function Oro(t,e){return new t({type:"boolean",coerce:!0,...xr(e)})}function Lro(t,e){return new t({type:"bigint",...xr(e)})}function Bro(t,e){return new t({type:"bigint",coerce:!0,...xr(e)})}function Fro(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...xr(e)})}function Uro(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...xr(e)})}function Qro(t,e){return new t({type:"symbol",...xr(e)})}function qro(t,e){return new t({type:"undefined",...xr(e)})}function jro(t,e){return new t({type:"null",...xr(e)})}function Hro(t){return new t({type:"any"})}function Gxt(t){return new t({type:"unknown"})}function Gro(t,e){return new t({type:"never",...xr(e)})}function $ro(t,e){return new t({type:"void",...xr(e)})}function Vro(t,e){return new t({type:"date",...xr(e)})}function Wro(t,e){return new t({type:"date",coerce:!0,...xr(e)})}function zro(t,e){return new t({type:"nan",...xr(e)})}function noe(t,e){return new c9r({check:"less_than",...xr(e),value:t,inclusive:!1})}function UN(t,e){return new c9r({check:"less_than",...xr(e),value:t,inclusive:!0})}function ioe(t,e){return new l9r({check:"greater_than",...xr(e),value:t,inclusive:!1})}function PI(t,e){return new l9r({check:"greater_than",...xr(e),value:t,inclusive:!0})}function Yro(t){return ioe(0,t)}function Kro(t){return noe(0,t)}function Jro(t){return UN(0,t)}function Zro(t){return PI(0,t)}function R8e(t,e){return new Keo({check:"multiple_of",...xr(e),value:t})}function Lwt(t,e){return new Xeo({check:"max_size",...xr(e),maximum:t})}function k8e(t,e){return new eto({check:"min_size",...xr(e),minimum:t})}function j9r(t,e){return new tto({check:"size_equals",...xr(e),size:t})}function Bwt(t,e){return new rto({check:"max_length",...xr(e),maximum:t})}function Pve(t,e){return new nto({check:"min_length",...xr(e),minimum:t})}function Fwt(t,e){return new ito({check:"length_equals",...xr(e),length:t})}function H9r(t,e){return new oto({check:"string_format",format:"regex",...xr(e),pattern:t})}function G9r(t){return new sto({check:"string_format",format:"lowercase",...xr(t)})}function $9r(t){return new ato({check:"string_format",format:"uppercase",...xr(t)})}function V9r(t,e){return new cto({check:"string_format",format:"includes",...xr(e),includes:t})}function W9r(t,e){return new lto({check:"string_format",format:"starts_with",...xr(e),prefix:t})}function z9r(t,e){return new uto({check:"string_format",format:"ends_with",...xr(e),suffix:t})}function Xro(t,e,r){return new dto({check:"property",property:t,schema:e,...xr(r)})}function Y9r(t,e){return new fto({check:"mime_type",mime:t,...xr(e)})}function loe(t){return new pto({check:"overwrite",tx:t})}function K9r(t){return loe(e=>e.normalize(t))}function J9r(){return loe(t=>t.trim())}function Z9r(){return loe(t=>t.toLowerCase())}function X9r(){return loe(t=>t.toUpperCase())}function eUr(t,e,r){return new t({type:"array",element:e,...xr(r)})}function KWc(t,e,r){return new t({type:"union",options:e,...xr(r)})}function JWc(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...xr(n)})}function ZWc(t,e,r){return new t({type:"intersection",left:e,right:r})}function eno(t,e,r,n){let o=r instanceof bo;return new t({type:"tuple",items:e,rest:o?r:null,...xr(o?n:r)})}function XWc(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...xr(n)})}function ezc(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...xr(n)})}function tzc(t,e,r){return new t({type:"set",valueType:e,...xr(r)})}function rzc(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...xr(r)})}function nzc(t,e,r){return new t({type:"enum",entries:e,...xr(r)})}function izc(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...xr(r)})}function tno(t,e){return new t({type:"file",...xr(e)})}function ozc(t,e){return new t({type:"transform",transform:e})}function szc(t,e){return new t({type:"optional",innerType:e})}function azc(t,e){return new t({type:"nullable",innerType:e})}function czc(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function lzc(t,e,r){return new t({type:"nonoptional",innerType:e,...xr(r)})}function uzc(t,e){return new t({type:"success",innerType:e})}function dzc(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function fzc(t,e,r){return new t({type:"pipe",in:e,out:r})}function pzc(t,e){return new t({type:"readonly",innerType:e})}function hzc(t,e,r){return new t({type:"template_literal",parts:e,...xr(r)})}function mzc(t,e){return new t({type:"lazy",getter:e})}function gzc(t,e){return new t({type:"promise",innerType:e})}function rno(t,e,r){let n=xr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function nno(t,e,r){return new t({type:"custom",check:"custom",fn:e,...xr(r)})}function ino(t,e){let r=xr(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??y9r,u=t.Boolean??f9r,d=t.String??H8e,f=new(t.Transform??A9r)({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 ono(t,e,r,n={}){let o=xr(n),s={...xr(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 sno(t){return new $xt({type:"function",input:Array.isArray(t?.input)?eno(Owt,t?.input):t?.input??eUr(h9r,Gxt(jxt)),output:t?.output??Gxt(jxt)})}function tUr(t,e){if(t instanceof w8e){let n=new P8e(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 P8e(e);return r.process(t),r.emit(t,e)}function q0(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 q0(n.element,r);case"object":{for(let o in n.shape)if(q0(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(q0(o,r))return!0;return!1}case"intersection":return q0(n.left,r)||q0(n.right,r);case"tuple":{for(let o of n.items)if(q0(o,r))return!0;return!!(n.rest&&q0(n.rest,r))}case"record":return q0(n.keyType,r)||q0(n.valueType,r);case"map":return q0(n.keyType,r)||q0(n.valueType,r);case"set":return q0(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return q0(n.innerType,r);case"lazy":return q0(n.getter(),r);case"default":return q0(n.innerType,r);case"prefault":return q0(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return q0(n.in,r)||q0(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function ZKi(t,e){let r={type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},...Ws.normalizeParams(e)};return new Ezc(r)}function VL(t){return!!t._zod}function ive(t){let e=Object.values(t);if(e.length===0)return ZKi({});let r=e.every(VL),n=e.every(o=>!VL(o));if(r)return ZKi(t);if(n)return Y$c(t);throw Error("Mixed Zod versions detected in object shape.")}function i8e(t,e){return VL(t)?Nwt(t,e):t.safeParse(e)}async function jFr(t,e){return VL(t)?await Mwt(t,e):await t.safeParseAsync(e)}function G8e(t){if(!t)return;let e;if(VL(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function jFe(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 ive(t)}}if(VL(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 HFr(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 _zc(t){return t.description}function vzc(t){if(VL(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function ano(t){if(VL(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 cno(t){return bro(nUr,t)}function lno(t){return Sro(iUr,t)}function uno(t){return Tro(oUr,t)}function dno(t){return Iro(sUr,t)}function It(t){return _ro(Uwt,t)}function bzc(t){return v9r(cUr,t)}function Szc(t){return Hxt(Vxt,t)}function Tzc(t){return C9r(z9,t)}function Izc(t){return b9r(z9,t)}function xzc(t){return S9r(z9,t)}function wzc(t){return T9r(z9,t)}function Rzc(t){return I9r(lUr,t)}function kzc(t){return x9r(uUr,t)}function Pzc(t){return w9r(dUr,t)}function Dzc(t){return R9r(fUr,t)}function Nzc(t){return k9r(pUr,t)}function Mzc(t){return P9r(hUr,t)}function Ozc(t){return D9r(mUr,t)}function Lzc(t){return N9r(gUr,t)}function Bzc(t){return M9r(AUr,t)}function Fzc(t){return O9r(yUr,t)}function Uzc(t){return L9r(EUr,t)}function Qzc(t){return B9r(_Ur,t)}function qzc(t){return F9r(vUr,t)}function jzc(t){return U9r(CUr,t)}function Hzc(t){return Q9r(bUr,t)}function Gzc(t){return q9r(SUr,t)}function $zc(t,e,r={}){return ono(Ano,t,e,r)}function Nc(t){return xro(Qwt,t)}function Q8r(t){return Rro(Gve,t)}function Vzc(t){return kro(Gve,t)}function Wzc(t){return Pro(Gve,t)}function zzc(t){return Dro(Gve,t)}function Yzc(t){return Nro(Gve,t)}function j0(t){return Mro(qwt,t)}function Kzc(t){return Lro(jwt,t)}function Jzc(t){return Fro(TUr,t)}function Zzc(t){return Uro(TUr,t)}function Xzc(t){return Qro(yno,t)}function eYc(t){return qro(Eno,t)}function IUr(t){return jro(_no,t)}function tYc(){return Hro(vno)}function of(){return Gxt(Cno)}function Hwt(t){return Gro(bno,t)}function rYc(t){return $ro(Sno,t)}function nYc(t){return Vro(xUr,t)}function va(t,e){return eUr(Tno,t,e)}function iYc(t){let e=t._zod.def.shape;return ei(Object.keys(e))}function Tn(t,e){let r={type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},...Ws.normalizeParams(e)};return new Gwt(r)}function oYc(t,e){return new Gwt({type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},catchall:Hwt(),...Ws.normalizeParams(e)})}function Jv(t,e){return new Gwt({type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},catchall:of(),...Ws.normalizeParams(e)})}function ou(t,e){return new wUr({type:"union",options:t,...Ws.normalizeParams(e)})}function RUr(t,e,r){return new Ino({type:"union",options:e,discriminator:t,...Ws.normalizeParams(r)})}function $wt(t,e){return new xno({type:"intersection",left:t,right:e})}function sYc(t,e,r){let n=e instanceof bo,o=n?r:e;return new wno({type:"tuple",items:t,rest:n?e:null,...Ws.normalizeParams(o)})}function iu(t,e,r){return new kUr({type:"record",keyType:t,valueType:e,...Ws.normalizeParams(r)})}function aYc(t,e,r){return new kUr({type:"record",keyType:ou([t,Hwt()]),valueType:e,...Ws.normalizeParams(r)})}function cYc(t,e,r){return new Rno({type:"map",keyType:t,valueType:e,...Ws.normalizeParams(r)})}function lYc(t,e){return new kno({type:"set",valueType:t,...Ws.normalizeParams(e)})}function N1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new D8e({type:"enum",entries:r,...Ws.normalizeParams(e)})}function uYc(t,e){return new D8e({type:"enum",entries:t,...Ws.normalizeParams(e)})}function ei(t,e){return new Pno({type:"literal",values:Array.isArray(t)?t:[t],...Ws.normalizeParams(e)})}function dYc(t){return tno(Dno,t)}function DUr(t){return new PUr({type:"transform",transform:t})}function bd(t){return new NUr({type:"optional",innerType:t})}function Wxt(t){return new Nno({type:"nullable",innerType:t})}function fYc(t){return bd(Wxt(t))}function Ono(t,e){return new Mno({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Bno(t,e){return new Lno({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Fno(t,e){return new MUr({type:"nonoptional",innerType:t,...Ws.normalizeParams(e)})}function pYc(t){return new Uno({type:"success",innerType:t})}function qno(t,e){return new Qno({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function hYc(t){return zro(jno,t)}function zxt(t,e){return new OUr({type:"pipe",in:t,out:e})}function Gno(t){return new Hno({type:"readonly",innerType:t})}function mYc(t,e){return new $no({type:"template_literal",parts:t,...Ws.normalizeParams(e)})}function Wno(t){return new Vno({type:"lazy",getter:t})}function gYc(t){return new zno({type:"promise",innerType:t})}function Yno(t,e){let r=new Sh({check:"custom",...Ws.normalizeParams(e)});return r._zod.check=t,r}function Kno(t,e){return rno(Vwt,t??(()=>!0),e)}function Jno(t,e={}){return nno(Vwt,t,e)}function Zno(t,e){let r=Yno(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Ws.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(Ws.issue(s))}},t(n.value,n)),e);return r}function AYc(t,e={error:`Input not instance of ${t.name}`}){let r=new Vwt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Ws.normalizeParams(e)});return r._zod.bag.Class=t,r}function EYc(t){let e=Wno(()=>ou([It(t),Nc(),j0(),IUr(),va(e),iu(It(),e)]));return e}function LUr(t,e){return zxt(DUr(t),e)}function vYc(t){eC({customError:t})}function CYc(){return eC().customError}function bYc(t){return vro(Uwt,t)}function SYc(t){return wro(Qwt,t)}function TYc(t){return Oro(qwt,t)}function IYc(t){return Bro(jwt,t)}function xYc(t){return Wro(xUr,t)}function rJc(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function nJc(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Hie(t){return t==="completed"||t==="failed"||t==="cancelled"}function Aio(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function Al(t,e,r,n,o){t[e]=r,Aio(t,e,n,o)}function D1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?yio(e,t.currentPath):e.join("/")}}function dJc(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==Cr.ZodAny&&(r.items=Dc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&Al(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Al(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Al(r,"minItems",t.exactLength.value,t.exactLength.message,e),Al(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function fJc(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?Al(r,"minimum",n.value,n.message,e):Al(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Al(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Al(r,"maximum",n.value,n.message,e):Al(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Al(r,"maximum",n.value,n.message,e));break;case"multipleOf":Al(r,"multipleOf",n.value,n.message,e);break}return r}function pJc(){return{type:"boolean"}}function Eio(t,e){return Dc(t.type._def,e)}function _io(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>_io(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 mJc(t,e)}}function gJc(t,e){return{...Dc(t.innerType._def,e),default:t.defaultValue()}}function AJc(t,e){return e.effectStrategy==="input"?Dc(t.schema._def,e):D1(e)}function yJc(t){return{type:"string",enum:Array.from(t.values)}}function _Jc(t,e){let r=[Dc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Dc(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(EJc(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 vJc(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 vio(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":Al(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":Al(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":BN(r,"email",n.message,e);break;case"format:idn-email":BN(r,"idn-email",n.message,e);break;case"pattern:zod":Kv(r,LN.email,n.message,e);break}break;case"url":BN(r,"uri",n.message,e);break;case"uuid":BN(r,"uuid",n.message,e);break;case"regex":Kv(r,n.regex,n.message,e);break;case"cuid":Kv(r,LN.cuid,n.message,e);break;case"cuid2":Kv(r,LN.cuid2,n.message,e);break;case"startsWith":Kv(r,RegExp(`^${$Fr(n.value,e)}`),n.message,e);break;case"endsWith":Kv(r,RegExp(`${$Fr(n.value,e)}$`),n.message,e);break;case"datetime":BN(r,"date-time",n.message,e);break;case"date":BN(r,"date",n.message,e);break;case"time":BN(r,"time",n.message,e);break;case"duration":BN(r,"duration",n.message,e);break;case"length":Al(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),Al(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Kv(r,RegExp($Fr(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&BN(r,"ipv4",n.message,e),n.version!=="v4"&&BN(r,"ipv6",n.message,e);break}case"base64url":Kv(r,LN.base64url,n.message,e);break;case"jwt":Kv(r,LN.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Kv(r,LN.ipv4Cidr,n.message,e),n.version!=="v4"&&Kv(r,LN.ipv6Cidr,n.message,e);break}case"emoji":Kv(r,LN.emoji(),n.message,e);break;case"ulid":{Kv(r,LN.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{BN(r,"binary",n.message,e);break}case"contentEncoding:base64":{Al(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Kv(r,LN.base64,n.message,e);break}}break}case"nanoid":Kv(r,LN.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function $Fr(t,e){return e.patternStrategy==="escape"?bJc(t):t}function bJc(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}}})):Al(t,"format",e,r,n)}function Kv(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:tJi(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):Al(t,"pattern",tJi(e,n),r,n)}function tJi(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]:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??D1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===Cr.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=Aio(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===Cr.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===Cr.ZodBranded&&t.keyType._def.type._def.typeName===Cr.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=mio(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function yJc(t,e){if(e.mapStrategy==="record")return yio(t,e);let r=Dc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||D1(e),n=Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||D1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function EJc(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 _Jc(t){return t.target==="openAi"?void 0:{not:D1({...t,currentPath:[...t.currentPath,"not"]})}}function vJc(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function CJc(t,e){if(e.target==="openApi3")return ZKi(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Xxt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=Xxt[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 ZKi(t,e)}function bJc(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:Xxt[t.innerType._def.typeName],nullable:!0}:{type:[Xxt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function SJc(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",pio(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?Al(r,"minimum",n.value,n.message,e):Al(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Al(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Al(r,"maximum",n.value,n.message,e):Al(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Al(r,"maximum",n.value,n.message,e));break;case"multipleOf":Al(r,"multipleOf",n.value,n.message,e);break}return r}function TJc(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=xJc(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Dc(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=IJc(t,e);return c!==void 0&&(n.additionalProperties=c),n}function IJc(t,e){if(t.catchall._def.typeName!=="ZodNever")return Dc(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 xJc(t){try{return t.isOptional()}catch{return!0}}function kJc(t,e){return Dc(t.type._def,e)}function PJc(t,e){let r={type:"array",uniqueItems:!0,items:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&Al(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Al(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function DJc(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Dc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Dc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Dc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function NJc(t){return{not:D1(t)}}function MJc(t){return D1(t)}function Dc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==rJc)return l}if(n&&!r){let l=BJc(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=LJc(t,t.typeName,e),c=typeof s=="function"?Dc(s(),e):s;if(c&&FJc(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function QJc(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function XKi(t,e){return VL(t)?eUr(t,{target:QJc(e?.target),io:e?.pipeStrategy??"input"}):UJc(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function eJi(t){let e=j8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=nno(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function tJi(t,e){let r=r8e(t,e);if(!r.success)throw r.error;return r.data}function rJi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function jJc(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];rJi(c)&&rJi(s)?r[o]={...c,...s}:r[o]=s}return r}function $Jc(){let t=new HJc.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return GJc.default(t),t}function VJc(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 WJc(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 nJi(t){return!!t&&typeof t=="object"&&Eio in t}function zJc(t){return t[Eio]?.complete}function KJc(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"),!YJc.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 JJc(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 oJi(t){let e=KJc(t);return JJc(t,e.warnings),e.isValid}function _io(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function vio(t){return"_def"in t||"_zod"in t||_io(t)}function e6r(t){return typeof t!="object"||t===null||vio(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(_io)}function sJi(t){if(t){if(e6r(t))return nve(t);if(!vio(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function XJc(t){let e=j8e(t);return e?Object.entries(e).map(([r,n])=>{let o=hzc(n),s=mzc(n);return{name:r,description:o,required:!s}}):[]}function XV(t){let e=j8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=nno(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function aJi(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function eZc(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 tZc(t){let e=new X8r({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(!rZc(n))continue;let o=n.description;o&&!V9.has(n)&&V9.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 rZc(t){return typeof t=="object"&&t!==null&&"_zod"in t}function wr(t){let e;return()=>e??=t()}function iZc(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 mk("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 oZc(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:Qm(r)})}catch(s){throw new mk(`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 mk(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=nZc().safeParse(await n.json());if(!o.success)throw new mk(`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 lJi(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function r6r(t,e,r){let n=sZc();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=DI(),c=Qm(o)+` -`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,bio.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function sZc(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function aZc(t){let{buffer:e,bytesRead:r}=DI().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 cZc(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function lZc(t){let e=DI(),{resolvedPath:r,isSymlink:n}=mXi(e,t);n&&ru(`Reading through symlink: ${t} -> ${r}`);let o=aZc(r),s=e.readFileSync(r,{encoding:o}),c=cZc(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 Cio(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===Cr.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,o)=>({...n,[o]:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??D1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===Cr.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=vio(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===Cr.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===Cr.ZodBranded&&t.keyType._def.type._def.typeName===Cr.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=Eio(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function SJc(t,e){if(e.mapStrategy==="record")return Cio(t,e);let r=Dc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||D1(e),n=Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||D1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function TJc(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 IJc(t){return t.target==="openAi"?void 0:{not:D1({...t,currentPath:[...t.currentPath,"not"]})}}function xJc(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function wJc(t,e){if(e.target==="openApi3")return rJi(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in ewt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=ewt[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 rJi(t,e)}function RJc(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:ewt[t.innerType._def.typeName],nullable:!0}:{type:[ewt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function kJc(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",Aio(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?Al(r,"minimum",n.value,n.message,e):Al(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Al(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Al(r,"maximum",n.value,n.message,e):Al(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Al(r,"maximum",n.value,n.message,e));break;case"multipleOf":Al(r,"multipleOf",n.value,n.message,e);break}return r}function PJc(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=NJc(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Dc(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=DJc(t,e);return c!==void 0&&(n.additionalProperties=c),n}function DJc(t,e){if(t.catchall._def.typeName!=="ZodNever")return Dc(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 NJc(t){try{return t.isOptional()}catch{return!0}}function LJc(t,e){return Dc(t.type._def,e)}function BJc(t,e){let r={type:"array",uniqueItems:!0,items:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&Al(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Al(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function FJc(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Dc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Dc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Dc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function UJc(t){return{not:D1(t)}}function QJc(t){return D1(t)}function Dc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==cJc)return l}if(n&&!r){let l=HJc(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=jJc(t,t.typeName,e),c=typeof s=="function"?Dc(s(),e):s;if(c&&GJc(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function VJc(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function nJi(t,e){return VL(t)?tUr(t,{target:VJc(e?.target),io:e?.pipeStrategy??"input"}):$Jc(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function iJi(t){let e=G8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=ano(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function oJi(t,e){let r=i8e(t,e);if(!r.success)throw r.error;return r.data}function sJi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function zJc(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];sJi(c)&&sJi(s)?r[o]={...c,...s}:r[o]=s}return r}function JJc(){let t=new YJc.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return KJc.default(t),t}function ZJc(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 XJc(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 aJi(t){return!!t&&typeof t=="object"&&bio in t}function eZc(t){return t[bio]?.complete}function rZc(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"),!tZc.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 nZc(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 lJi(t){let e=rZc(t);return nZc(t,e.warnings),e.isValid}function Sio(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function Tio(t){return"_def"in t||"_zod"in t||Sio(t)}function t6r(t){return typeof t!="object"||t===null||Tio(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(Sio)}function uJi(t){if(t){if(t6r(t))return ive(t);if(!Tio(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function oZc(t){let e=G8e(t);return e?Object.entries(e).map(([r,n])=>{let o=_zc(n),s=vzc(n);return{name:r,description:o,required:!s}}):[]}function eW(t){let e=G8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=ano(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function dJi(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function sZc(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 aZc(t){let e=new e6r({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(!cZc(n))continue;let o=n.description;o&&!W9.has(n)&&W9.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 cZc(t){return typeof t=="object"&&t!==null&&"_zod"in t}function wr(t){let e;return()=>e??=t()}function uZc(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 dZc(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:Qm(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=lZc().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 pJi(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function n6r(t,e,r){let n=fZc();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=MI(),c=Qm(o)+` +`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,xio.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function fZc(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function pZc(t){let{buffer:e,bytesRead:r}=MI().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 hZc(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function mZc(t){let e=MI(),{resolvedPath:r,isSymlink:n}=EXi(e,t);n&&ru(`Reading through symlink: ${t} -> ${r}`);let o=pZc(r),s=e.readFileSync(r,{encoding:o}),c=hZc(s.slice(0,4096));return{content:s.replaceAll(`\r `,` -`),encoding:o,lineEndings:c}}function Ywt(t){return lZc(t).content}function Sio(t){return t.startsWith("\uFEFF")?t.slice(1):t}function pZc(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),ewt.default.platform==="darwin"?uZc(t):ewt.default.platform==="win32"?dZc(t):fZc(t)}function hZc(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||s_(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function mZc(){return hZc()==="essential-traffic"}function AZc(t){$Fr.length>=gZc&&$Fr.shift(),$Fr.push(t)}function Tio(t){let e=M8e(t);try{if(s_(process.env.CLAUDE_CODE_USE_BEDROCK)||s_(process.env.CLAUDE_CODE_USE_VERTEX)||s_(process.env.CLAUDE_CODE_USE_FOUNDRY)||s_(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||s_(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||mZc())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(AZc(r),mJi===null){yZc.push({type:"error",error:e});return}mJi.logError(e)}catch{}}function _Zc(t,e,r=100){let n=new o6r({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 Rio(t,e){try{return{ok:!0,value:JSON.parse(Sio(t))}}catch(r){return e&&Tio(r),{ok:!1}}}function NZc(){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:jFe(),shell:G.enum(DZc).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:jFe(),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:jFe(),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:jFe(),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:jFe(),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 zZc(t){return Nio.has(t.toLowerCase())?!1:WZc.test(t)?!0:VZc.test(t)}function AXc(t){let e=mXc();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=gXc().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(ru(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(ru(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function jio(){return wXc.filter(t=>Zwt[t].buildGate())}function RXc(t){let e={};for(let r of t)e={...e,...Zwt[r].shape()};return e}function kXc(t){let e={};for(let r of t)e={...e,...Zwt[r].permissionsShape?.()};return e}function PXc(t){let e=[];for(let r of t)e.push(...Zwt[r].permissionModes?.()??[]);return e}function DXc(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 X_e(t){return Object.hasOwn(vJi,t)?vJi[t]:t}function NXc(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function MXc(t){let e=OXc(t,"(");if(e===-1)return{toolName:X_e(t)};let r=LXc(t,")");if(r===-1||r<=e)return{toolName:X_e(t)};if(r!==t.length-1)return{toolName:X_e(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:X_e(t)};if(o===""||o==="*")return{toolName:X_e(n)};let s=NXc(o);return{toolName:X_e(n),ruleContent:s}}function OXc(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function LXc(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 BXc(t){return iwt.filePatternTools.includes(t)}function FXc(t){return iwt.bashPrefixTools.includes(t)}function UXc(t){return Object.hasOwn(iwt.customValidation,t)?iwt.customValidation[t]:void 0}function Gio(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function WFr(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 "${THc(String(n.toolName))}"`};let s=UXc(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(FXc(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(BXc(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 Vio(t){return G.object({allow:G.array(zFr()).optional().describe("List of permission rules for allowed operations"),deny:G.array(zFr()).optional().describe("List of permission rules for denied operations"),ask:G.array(zFr()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum([...s7r,...PXc(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...kXc(t),additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function GXc(t){return G.object({$schema:G.literal(xXc).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:HXc().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...s_(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:qXc().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:Vio(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(Wio()).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(zio()).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:rwt().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=>CJi.includes(r)):e,G.union([G.boolean(),G.array(G.enum(CJi))])).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(),jXc()).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(nwt()).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(nwt()).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:SZc().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(RZc),G.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:G.enum(IZc).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(TZc).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(xZc).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"),...RXc(t)}).passthrough()}function WXc(t){let e=$Xc.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=VXc[xHc(t.path,".")]),r}function bJi(t){return t.code==="invalid_type"}function SJi(t){return t.code==="invalid_value"}function zXc(t){return t.code==="unrecognized_keys"}function TJi(t){return t.code==="too_small"}function lve(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function IJi(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function K8e(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(SJi(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(bJi(r)){l=r.expected;let h=IJi(r.message);u=h??lve(r.input),d=h??lve(r.input)}else TJi(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=WXc({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(SJi(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(bJi(r)){let h=IJi(r.message)??lve(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(zXc(r)){let h=r.keys.join(", ");o=`Unrecognized ${IHc(r.keys.length,"field")}: ${h}`}else TJi(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 YXc(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=$io(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 JXc(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=lve(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(!KXc.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${ywt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=lve(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 XXc(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of ZXc){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 ${lve(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,Jio.execFile)(t,e,{encoding:"utf-8",timeout:rel},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function oel(){return(async()=>{if(process.platform==="darwin"){let t=nel(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,Zio.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await HFe(eel,[...tel,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([HFe(t,["query",u6r,"/v",ove]),HFe(t,["query",d6r,"/v",ove])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(Kio()){let[t,e]=await Promise.all([HFe(wJi,["query",u6r,"/v",ove]),HFe(wJi,["query",d6r,"/v",ove])]);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 sel(){return iel}function ael(){swt||(swt=(async()=>{let t=Date.now(),e=sel()??oel(),{mdm:r,hkcu:n,wslInherits:o}=fel(await e);Xio=r,eoo=n,too=o;let s=Date.now()-t;if(ru(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){ru(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{r6r("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function cel(){swt||ael(),await swt}function lel(){return Xio??rW}function uel(){return eoo??rW}function del(){return too}function YFr(t,e){let r=uW(Kwt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=Wve(r,e),o=Vve().safeParse(r);if(!o.success){let s=K8e(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function RJi(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 fel(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=YFr(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:rW,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=RJi(t.hklmStdout);c&&(r=YFr(c,`Registry: ${u6r}\\${ove}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:rW,o=Kio(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||hel(),!s))return{mdm:n,hkcu:rW,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:rW,wslInherits:s}}if(pel(s))return{mdm:n,hkcu:rW,wslInherits:s};if(t.hkcuStdout){let c=RJi(t.hkcuStdout);if(c){let l=YFr(c,`Registry: ${d6r}\\${ove}`);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:rW,wslInherits:s}}function pel(t){return t&&PJi(owt)?!0:PJi(P8e())}function kJi(t){let e=uW(Kwt(Ywt(t),!1));if(!e||typeof e!="object")return!1;Wve(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function hel(){function t(e){try{let r=Kwt(Ywt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,Jie.join)(owt,"managed-settings.json")))return!0;try{let e=(0,Jie.join)(owt,"managed-settings.d");for(let r of DI().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,Jie.join)(e,r.name)))return!0}catch{}return!1}function PJi(t){try{if(kJi((0,Jie.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,Jie.join)(t,"managed-settings.d"),r=DI().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(kJi((0,Jie.join)(e,n.name)))return!0}catch{}}catch{}return!1}function mel(t,e,r){(r!==void 0&&!Ewt(t[e],r)||r===void 0&&!(e in t))&&B6r(t,e,r)}function gel(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 _el(t){return Qve(t)&&Q6r(t)}function xel(t){if(!Qve(t)||N8e(t)!=Cel)return!1;var e=lXi(t);if(e===null)return!0;var r=Tel.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&roo.call(r)==Iel}function Rel(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function kel(t){return UQc(t,sXi(t))}function Del(t,e,r,n,o,s,c){var l=p6r(t,r),u=p6r(e,r),d=c.get(u);if(d){f6r(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=lW(u),g=!m&&F6r(u),A=!m&&!g&&iXi(u);f=u,m||g||A?lW(l)?f=l:vel(l)?f=tjc(l):g?(h=!1,f=cXi(u,!0)):A?(h=!1,f=ljc(u,!0)):f=[]:wel(u)||l8e(u)?(f=l,l8e(l)?f=Pel(l):(!z9(l)||I6r(l))&&(f=pjc(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),f6r(t,r,f)}function noo(t,e,r,n,o){t!==e&&Eel(e,function(s,c){if(o||(o=new DQc),z9(s))Nel(t,e,c,r,noo,n,o);else{var l=n?n(p6r(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),f6r(t,c,l)}},sXi)}function Oel(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 Bel(t,e,r){return e=DJi(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=DJi(n.length-e,0),c=Array(s);++o0){if(++e>=jel)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function zel(t,e){return ooo(ioo(t,e,dXi),t+"")}function Kel(t,e,r){if(!z9(r))return!1;var n=typeof e;return(n=="number"?Q6r(r)&&bwt(e,r.length):n=="string"&&e in r)?Ewt(r[e],t):!1}function Zel(t){return Yel(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&&Jel(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?soo(l,e-1,r,n,o):njc(o,l):n||(o[o.length]=l)}return o}function utl(t){var e=t==null?0:t.length;return e?ltl(t,1):[]}function ftl(t){return ooo(ioo(t,void 0,dtl),t+"")}function Atl(){return void 0??(0,aoo.join)(Fve(),mtl)}function ytl(){try{let t=Ywt(Atl()),e=GN(Sio(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function Etl(){if(!void 0&>l!==!0)return null;if(JFr)return JFr;let t=ytl();return t?(JFr=t,$6r(),t):null}function c7r(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),IXc.filter(r=>e.has(r))}function _tl(){return(0,ky.join)(P8e(),"managed-settings.json")}function coo(t){if(Jwt()==="wsl"&&t.wslInherits?.()){let e=ZFr(owt);if(e.settings)return e;let r=ZFr(P8e());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return ZFr(P8e())}function ZFr(t){let e=[],r={},n=!1,{settings:o,errors:s}=awt((0,ky.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=oW(r,o,sW),n=!0);let c=(0,ky.join)(t,"managed-settings.d");try{let d=DI().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}=awt((0,ky.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=oW(r,h,sW),n=!0)}}catch(d){let f=PI(d);f!=="ENOENT"&&f!=="ENOTDIR"&&ru(`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 vtl(t,e){O8e(t)?ru(`Broken symlink or missing file encountered for settings.json at path: ${e}`):ru(`settings file read failed at ${e}: ${t}`,{level:"error"})}function awt(t,e){let r=Kjc(t);if(r)return{settings:r.settings?uW(r.settings):null,errors:r.errors};let n=Ctl(t,e);return Jjc(t,n),{settings:n.settings?uW(n.settings):null,errors:n.errors}}function loo(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 uoo(t){let e=t?.remote?t.remote():Etl();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=uW(e),n=Wve(r,"remote managed settings"),o=Vve().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...K8e(o.error,"remote managed settings")]}}function doo(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=uW(e),n=Wve(r,"parent managed settings"),o=Vve().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...K8e(o.error,"parent managed settings")]}}function foo(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=uW(e),n=Wve(r,"SDK inline settings"),o=Vve().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...K8e(o.error,"SDK inline settings")]}}function Ctl(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=mXi(DI(),t);r=Ywt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=uW(Kwt(r,!1)),o=Wve(n,t),s=Vve().safeParse(n);if(!s.success){let c=K8e(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return vtl(r,t),{settings:null,errors:[]}}}function MJi(t,e){switch(t){case"userSettings":return(0,ky.resolve)(Fve());case"policySettings":case"projectSettings":case"localSettings":return(0,ky.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,ky.dirname)((0,ky.resolve)(e.flagPath)):(0,ky.resolve)(e.cwd)}}function btl(t){return t.coworkPlugins||s_(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function cwt(t,e){switch(t){case"userSettings":return(0,ky.join)(MJi(t,e),btl(e));case"projectSettings":case"localSettings":return(0,ky.join)(MJi(t,e),Stl(t));case"policySettings":return _tl();case"flagSettings":return e.flagPath}}function Stl(t){switch(t){case"projectSettings":return(0,ky.join)(".claude","settings.json");case"localSettings":return(0,ky.join)(".claude","settings.local.json")}}function poo(t,e){let r=Wjc(t);if(r!==void 0)return r;let n=Rtl(t,e);return zjc(t,n),n}function Ttl(t){return!t||t.parentSettingsBehavior==="merge"}function Itl(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=KFr(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=KFr(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=KFr(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 xtl(t){if(t.helper?.())return"helper";if(uoo(t).settings)return"remote";if(loo(t).settings)return Jwt()==="macos"?"plist":"hklm";if((t.file?.()??coo(t)).settings)return"file";if(doo(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function wtl(t){let e=[],{settings:r,errors:n}=uoo(t);e.push(...n);let{settings:o,errors:s}=loo(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??coo(t);e.push(...l);let{settings:u,errors:d}=doo(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&&Ttl(h)?Itl(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function hoo(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=wtl(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:oW({},n??{},r??{},sW),errors:o}}function Rtl(t,e){if(t==="policySettings")return hoo(e).settings;let r=cwt(t,e),{settings:n}=r?awt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=foo(e);if(o)return oW(n||{},o,sW)}return n}function ktl(t,e){return zXi([...t,...e])}function sW(t,e){if(Array.isArray(t)&&Array.isArray(e))return ktl(t,e)}function Ptl(t){if(XFr)return{settings:{},errors:[]};let e=Date.now();r6r("info","settings_load_started"),XFr=!0;try{let r=Xjc(),n={};r&&(n=oW(n,r,sW));let o=[],s=new Set,c=new Set;for(let l of c7r(t)){if(l==="policySettings"){let{settings:d,errors:f}=hoo(t);d&&(n=oW(n,d,sW));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=cwt(l,t);if(u){let d=(0,ky.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=awt(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=oW(n,f,sW))}}if(l==="flagSettings"){let{settings:d,errors:f}=foo(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=oW(n,d,sW))}}return r6r("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{XFr=!1}}function Dtl(t){let e=$jc();if(e!==null)return e;let r=Ptl(t);return Vjc(r),r}function Ntl(t){let{settings:e}=Dtl(t);return e||{}}function Mtl(t){$6r();let e=[];for(let r of c7r(t)){let n=poo(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:Ntl(t),sources:e}}function Otl(t,e){let r=c7r(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(poo(o,e)?.[t]!==void 0)return o}return null}function Qtl(t){let e=t.effective.permissions?.defaultMode;if(!e||!Ftl.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(Utl.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function qtl(t={}){await cel();let e={cwd:(0,Cio.resolve)(t.cwd??DI().cwd()),allowedSources:(t.settingSources??Btl).map(r=>Ltl[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:lel,hkcu:uel,wslInherits:del,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=Mtl(e),o=xtl(e)??void 0,s=n.map(({source:l,settings:u})=>({source:OJi[l],settings:u,path:l==="policySettings"?void 0:cwt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=Otl(l,e);u&&(c[l]={source:OJi[u],path:u==="policySettings"?void 0:cwt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{$6r()}}async function jtl(t){return qtl(t)}async function Htl(t,e){try{await(0,a_.copyFile)(t,e)}catch(r){if(!O8e(r))throw r}}async function Gtl(t,e){if(!t)return;let r=t;try{let n=GN(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=Qm(n))}catch{}await(0,a_.writeFile)(e,r,{mode:384})}function $tl(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=g$c(m$c);return new Promise(e=>{(0,iZi.execFile)("security",["find-generic-password","-a",y$c(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function moo(t,e,r,n,o=6e4){if(!bh(e))return;let s=bk(r),c=await Vie(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,pc.join)((0,uve.tmpdir)(),`claude-resume-${(0,gwt.randomUUID)()}`);try{let u=(0,pc.join)(l,"projects",s);await(0,a_.mkdir)(u,{recursive:!0});let d=(0,pc.join)(u,`${e}.jsonl`);await R8r(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,pc.join)((0,uve.homedir)(),".claude"),m;try{m=await(0,a_.readFile)((0,pc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!O8e(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await $tl()??m),await Gtl(m,(0,pc.join)(l,".credentials.json")),await Htl((0,pc.join)(f??(0,uve.homedir)(),".claude.json"),(0,pc.join)(l,".claude.json")),t.listSubkeys){let g=(0,pc.join)(u,e),A=await Vie(t.listSubkeys({projectKey:s,sessionId:e}),o,`SessionStore.listSubkeys() timed out after ${o}ms for session ${e}`);for(let y of A){let E=(0,pc.resolve)(g,y+".jsonl");if(!y||(0,pc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!E.startsWith(g+pc.sep)){ru(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let _=await Vie(t.load({projectKey:s,sessionId:e,subpath:y}),o,`SessionStore.load() timed out after ${o}ms for session ${e} subpath ${y}`);if(!_||_.length===0)continue;let v=[],b=[];for(let T of _)g6r(T)?v.push(T):b.push(T);if(b.length>0&&(await(0,a_.mkdir)((0,pc.dirname)(E),{recursive:!0}),await R8r(E,b)),v.length>0){let T=v.at(-1),w=(0,pc.resolve)(g,y+".meta.json");await(0,a_.mkdir)((0,pc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,a_.writeFile)(w,Qm(x),{mode:384})}}}return l}catch(u){throw await lwt(l),u}}function h6r(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=t8r(),additionalDirectories:A=[],agent:y,agents:E,allowedTools:_=[],betas:v,canUseTool:b,continue:T,cwd:w,debug:R,debugFile:x,disallowedTools:P=[],tools:D,env:N,executable:L=hZi()?"bun":"node",executableArgs:B=[],extraArgs:q={},fallbackModel:M,enableFileCheckpointing:O,toolConfig:j,forkSession:Q,hooks:U,includeHookEvents:Y,includePartialMessages:W,forwardSubagentText:V,onElicitation:z,persistSession:ie,sessionStore:H,sessionStoreFlush:re,thinking:le,effort:Le,maxThinkingTokens:ge,maxTurns:Ue,maxBudgetUsd:ke,taskBudget:X,mcpServers:ee,model:K,outputFormat:he,permissionMode:Z="default",allowDangerouslySkipPermissions:ue=!1,permissionPromptToolName:qe,plugins:ne,getOAuthToken:ce,getHostAuthToken:Ne,workload:we,resume:Be,resumeSessionAt:rt,sessionId:st,skills:_t,stderr:Dt,strictMcpConfig:$t}=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&&!Be&&!H.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(H&&O)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&&ru("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 Gt=d.pathToClaudeCodeExecutable;if(!Gt){let Ge=(0,aZi.fileURLToPath)(importMetaUrlShim),J=(0,oZi.createRequire)(Ge),se=ZHc(me=>J.resolve(me));if(!se)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.`);Gt=se}let Ie=he?.type==="json_schema"?he.schema:void 0,F=N?{...N}:{...process.env};F.CLAUDE_CODE_ENTRYPOINT||(F.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),F.CLAUDE_AGENT_SDK_VERSION||(F.CLAUDE_AGENT_SDK_VERSION="0.3.159"),O&&(F.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true"),ce&&(F.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ne&&(F.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),j?.askUserQuestion?.previewFormat&&(F.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=j.askUserQuestion.previewFormat);let be={};if(wKi.propagation.inject(wKi.context.active(),be),"traceparent"in be)for(let Ge of["TRACEPARENT","TRACESTATE"])Ge in(N??{})||delete F[Ge];for(let[Ge,J]of Object.entries(be)){let se=Ge.toUpperCase();se in(N??{})||(F[se]=J)}let Qe={},pe=new Map;if(ee)for(let[Ge,J]of Object.entries(ee))J.type==="sdk"&&J.instance?pe.set(Ge,J.instance):Qe[Ge]=J;let Se;if(le)switch(le.type){case"adaptive":Se={type:"adaptive",display:le.display};break;case"enabled":Se={type:"enabled",budgetTokens:le.budgetTokens,display:le.display};break;case"disabled":Se={type:"disabled"};break}else ge!==void 0&&(Se=ge===0?{type:"disabled"}:{type:"enabled",budgetTokens:ge});r&&(F.CLAUDE_CONFIG_DIR=r,process.platform==="win32"&&(F.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 Fe=new S8r({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:L,executableArgs:B,extraArgs:we?{...q,workload:we}:q,pathToClaudeCodeExecutable:Gt,env:F,forkSession:Q,stderr:Dt,thinkingConfig:Se,effort:Le,maxTurns:Ue,maxBudgetUsd:ke,taskBudget:X,model:K,fallbackModel:M,jsonSchema:Ie,permissionMode:Z,allowDangerouslySkipPermissions:ue,permissionPromptToolName:qe,continueConversation:H?void 0:T,resume:Be,resumeSessionAt:rt,sessionId:st,settings:typeof s=="object"?Qm(s):s,managedSettings:c?Qm(c):void 0,settingSources:l,skills:_t,allowedTools:_,disallowedTools:P,tools:D,mcpServers:Qe,strictMcpConfig:$t,canUseTool:!!b,hooks:!!U,includeHookEvents:Y,includePartialMessages:W,persistSession:ie,sessionMirror:!!H,plugins:ne,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:n}),te={systemPrompt:f,appendSystemPrompt:h,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:m,agents:E,title:d.title,skills:_t,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:V},Te=new I8r(Fe,e,b,U,g,pe,Ie,te,z,ce,Ne);if(H){let Ge=a(()=>(0,pc.join)(F.CLAUDE_CONFIG_DIR??(0,pc.join)((0,uve.homedir)(),".claude"),"projects"),"S6"),J=re==="eager",se=new x8r(async(me,Ce)=>{let He=UJi(me,Ge());He?await H.append(He,Ce):ru(`[SessionStore] dropping mirror frame: filePath ${me} is not under ${Ge()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(me,Ce)=>{let He=UJi(me,Ge());He&&Te.reportMirrorError(He,Ce.message)},J?0:W6r,J?0:z6r);Te.setTranscriptMirrorBatcher(se)}return{queryInstance:Te,transport:Fe,abortController:g,processEnv:F}}function m6r(t,e,r,n){typeof r=="string"?e.write(Qm({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 lwt(t){for(let e=0;;e++)try{return await(0,a_.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!Vtl.has(PI(r)??""))return;await lZi((e+1)*100)}}function Wtl(t,e){t.waitForExit().catch(()=>{}).finally(()=>lwt(e))}function ztl({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=h6r({...e},typeof t=="string",void 0,!0),d=(0,pc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await Vie(f.listSessions(bk(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return moo(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(()=>Wtl(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=M8e(g);c.spawnAbort(A),s.setError(A)}),m6r(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=h6r(e,typeof t=="string");return m6r(r,n,t,o),r}async function Ytl({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,pc.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 Vie(t.sessionStore.listSessions(bk(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await moo(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=h6r(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(()=>lwt(g))})}await Vie(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{m6r(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(()=>lwt(r))}throw await c,l}}async function Ktl(t,e){return e?.sessionStore?lrl(e.sessionStore,t,e):OGc(t,e)}async function Jtl(t){return t?.sessionStore?arl(t.sessionStore,t):jGc(t)}async function Ztl(t,e){return e?.sessionStore?url(e.sessionStore,t,e):HGc(t,e)}async function Xtl(t,e,r){return r?.sessionStore?drl(r.sessionStore,t,e,r.dir):GGc(t,e,r)}async function erl(t,e,r){return r?.sessionStore?frl(r.sessionStore,t,e,r.dir):$Gc(t,e,r)}async function trl(t,e){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=bk(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return VGc(t,e)}async function rrl(t,e){return e?.sessionStore?prl(e.sessionStore,t,e):ZGc(t,e)}async function nrl(t,e,r){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);let n=await Iwt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=bk(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:W6r;if(await LJi(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,pc.join)(c,"subagents");for(let u of await irl(l)){let d=(0,pc.relative)(c,u).split(pc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await LJi(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=GN(await(0,a_.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!O8e(m))throw m}}}async function LJi(t,e,r,n){let o=(0,sZi.createInterface)({input:(0,Awt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(GN(l)),c+=l.length,(s.length>=n||c>=z6r)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function irl(t){let e=[];async function r(n){let o;try{o=await(0,a_.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,pc.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 orl(t,e){return e?.sessionStore?hrl(e.sessionStore,t,e.dir):i$c(t,e)}async function srl(t,e,r){return r?.sessionStore?mrl(r.sessionStore,t,e,r):o$c(t,e,r)}function goo(t){let e=(0,pc.resolve)(t??"."),r;try{r=(0,Awt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function bk(t){return B8e(goo(t))}function Aoo(t){return t.map(e=>Qm(e)).join(` +`),encoding:o,lineEndings:c}}function Kwt(t){return mZc(t).content}function wio(t){return t.startsWith("\uFEFF")?t.slice(1):t}function EZc(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),twt.default.platform==="darwin"?gZc(t):twt.default.platform==="win32"?AZc(t):yZc(t)}function _Zc(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||s_(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function vZc(){return _Zc()==="essential-traffic"}function bZc(t){VFr.length>=CZc&&VFr.shift(),VFr.push(t)}function Rio(t){let e=L8e(t);try{if(s_(process.env.CLAUDE_CODE_USE_BEDROCK)||s_(process.env.CLAUDE_CODE_USE_VERTEX)||s_(process.env.CLAUDE_CODE_USE_FOUNDRY)||s_(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||s_(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||vZc())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(bZc(r),EJi===null){SZc.push({type:"error",error:e});return}EJi.logError(e)}catch{}}function IZc(t,e,r=100){let n=new s6r({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 Nio(t,e){try{return{ok:!0,value:JSON.parse(wio(t))}}catch(r){return e&&Rio(r),{ok:!1}}}function UZc(){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:GFe(),shell:G.enum(FZc).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:GFe(),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:GFe(),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:GFe(),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:GFe(),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 eXc(t){return Bio.has(t.toLowerCase())?!1:XZc.test(t)?!0:ZZc.test(t)}function bXc(t){let e=vXc();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=CXc().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(ru(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(ru(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function Vio(){return MXc.filter(t=>Xwt[t].buildGate())}function OXc(t){let e={};for(let r of t)e={...e,...Xwt[r].shape()};return e}function LXc(t){let e={};for(let r of t)e={...e,...Xwt[r].permissionsShape?.()};return e}function BXc(t){let e=[];for(let r of t)e.push(...Xwt[r].permissionModes?.()??[]);return e}function FXc(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 eve(t){return Object.hasOwn(TJi,t)?TJi[t]:t}function UXc(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function QXc(t){let e=qXc(t,"(");if(e===-1)return{toolName:eve(t)};let r=jXc(t,")");if(r===-1||r<=e)return{toolName:eve(t)};if(r!==t.length-1)return{toolName:eve(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:eve(t)};if(o===""||o==="*")return{toolName:eve(n)};let s=UXc(o);return{toolName:eve(n),ruleContent:s}}function qXc(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function jXc(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 HXc(t){return owt.filePatternTools.includes(t)}function GXc(t){return owt.bashPrefixTools.includes(t)}function $Xc(t){return Object.hasOwn(owt.customValidation,t)?owt.customValidation[t]:void 0}function zio(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function zFr(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 "${PHc(String(n.toolName))}"`};let s=$Xc(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(GXc(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(HXc(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 Kio(t){return G.object({allow:G.array(YFr()).optional().describe("List of permission rules for allowed operations"),deny:G.array(YFr()).optional().describe("List of permission rules for denied operations"),ask:G.array(YFr()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum([...a7r,...BXc(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...LXc(t),additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function KXc(t){return G.object({$schema:G.literal(NXc).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:YXc().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...s_(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:WXc().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:Kio(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(Jio()).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(Zio()).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:nwt().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=>IJi.includes(r)):e,G.union([G.boolean(),G.array(G.enum(IJi))])).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(),zXc()).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(iwt()).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(iwt()).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:kZc().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(OZc),G.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:G.enum(DZc).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(PZc).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(NZc).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"),...OXc(t)}).passthrough()}function XXc(t){let e=JXc.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=ZXc[NHc(t.path,".")]),r}function xJi(t){return t.code==="invalid_type"}function wJi(t){return t.code==="invalid_value"}function eel(t){return t.code==="unrecognized_keys"}function RJi(t){return t.code==="too_small"}function uve(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function kJi(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function Z8e(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(wJi(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(xJi(r)){l=r.expected;let h=kJi(r.message);u=h??uve(r.input),d=h??uve(r.input)}else RJi(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=XXc({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(wJi(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(xJi(r)){let h=kJi(r.message)??uve(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(eel(r)){let h=r.keys.join(", ");o=`Unrecognized ${DHc(r.keys.length,"field")}: ${h}`}else RJi(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 tel(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=Yio(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 nel(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=uve(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(!rel.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${Ewt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=uve(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 oel(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of iel){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 ${uve(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,too.execFile)(t,e,{encoding:"utf-8",timeout:cel},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function del(){return(async()=>{if(process.platform==="darwin"){let t=lel(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,roo.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await $Fe(sel,[...ael,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([$Fe(t,["query",d6r,"/v",sve]),$Fe(t,["query",f6r,"/v",sve])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(eoo()){let[t,e]=await Promise.all([$Fe(DJi,["query",d6r,"/v",sve]),$Fe(DJi,["query",f6r,"/v",sve])]);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 fel(){return uel}function pel(){awt||(awt=(async()=>{let t=Date.now(),e=fel()??del(),{mdm:r,hkcu:n,wslInherits:o}=yel(await e);noo=r,ioo=n,ooo=o;let s=Date.now()-t;if(ru(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){ru(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{n6r("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function hel(){awt||pel(),await awt}function mel(){return noo??nW}function gel(){return ioo??nW}function Ael(){return ooo}function KFr(t,e){let r=dW(Jwt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=zve(r,e),o=Wve().safeParse(r);if(!o.success){let s=Z8e(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function NJi(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 yel(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=KFr(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:nW,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=NJi(t.hklmStdout);c&&(r=KFr(c,`Registry: ${d6r}\\${sve}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:nW,o=eoo(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||_el(),!s))return{mdm:n,hkcu:nW,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:nW,wslInherits:s}}if(Eel(s))return{mdm:n,hkcu:nW,wslInherits:s};if(t.hkcuStdout){let c=NJi(t.hkcuStdout);if(c){let l=KFr(c,`Registry: ${f6r}\\${sve}`);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:nW,wslInherits:s}}function Eel(t){return t&&OJi(swt)?!0:OJi(N8e())}function MJi(t){let e=dW(Jwt(Kwt(t),!1));if(!e||typeof e!="object")return!1;zve(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function _el(){function t(e){try{let r=Jwt(Kwt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,Jie.join)(swt,"managed-settings.json")))return!0;try{let e=(0,Jie.join)(swt,"managed-settings.d");for(let r of MI().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,Jie.join)(e,r.name)))return!0}catch{}return!1}function OJi(t){try{if(MJi((0,Jie.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,Jie.join)(t,"managed-settings.d"),r=MI().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(MJi((0,Jie.join)(e,n.name)))return!0}catch{}}catch{}return!1}function vel(t,e,r){(r!==void 0&&!_wt(t[e],r)||r===void 0&&!(e in t))&&F6r(t,e,r)}function Cel(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 Iel(t){return qve(t)&&q6r(t)}function Nel(t){if(!qve(t)||O8e(t)!=wel)return!1;var e=pXi(t);if(e===null)return!0;var r=Pel.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&soo.call(r)==Del}function Oel(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Lel(t){return $Qc(t,uXi(t))}function Fel(t,e,r,n,o,s,c){var l=h6r(t,r),u=h6r(e,r),d=c.get(u);if(d){p6r(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=uW(u),g=!m&&U6r(u),A=!m&&!g&&cXi(u);f=u,m||g||A?uW(l)?f=l:xel(l)?f=ajc(l):g?(h=!1,f=fXi(u,!0)):A?(h=!1,f=mjc(u,!0)):f=[]:Mel(u)||d8e(u)?(f=l,d8e(l)?f=Bel(l):(!Y9(l)||x6r(l))&&(f=Ejc(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),p6r(t,r,f)}function aoo(t,e,r,n,o){t!==e&&Tel(e,function(s,c){if(o||(o=new FQc),Y9(s))Uel(t,e,c,r,aoo,n,o);else{var l=n?n(h6r(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),p6r(t,c,l)}},uXi)}function qel(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 Hel(t,e,r){return e=LJi(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=LJi(n.length-e,0),c=Array(s);++o0){if(++e>=zel)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function etl(t,e){return loo(coo(t,e,mXi),t+"")}function rtl(t,e,r){if(!Y9(r))return!1;var n=typeof e;return(n=="number"?q6r(r)&&Swt(e,r.length):n=="string"&&e in r)?_wt(r[e],t):!1}function itl(t){return ttl(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&&ntl(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?uoo(l,e-1,r,n,o):ljc(o,l):n||(o[o.length]=l)}return o}function gtl(t){var e=t==null?0:t.length;return e?mtl(t,1):[]}function ytl(t){return loo(coo(t,void 0,Atl),t+"")}function btl(){return void 0??(0,doo.join)(Uve(),vtl)}function Stl(){try{let t=Kwt(btl()),e=$N(wio(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function Ttl(){if(!void 0&&Ctl!==!0)return null;if(ZFr)return ZFr;let t=Stl();return t?(ZFr=t,V6r(),t):null}function l7r(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),DXc.filter(r=>e.has(r))}function Itl(){return(0,ky.join)(N8e(),"managed-settings.json")}function foo(t){if(Zwt()==="wsl"&&t.wslInherits?.()){let e=XFr(swt);if(e.settings)return e;let r=XFr(N8e());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return XFr(N8e())}function XFr(t){let e=[],r={},n=!1,{settings:o,errors:s}=cwt((0,ky.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=sW(r,o,aW),n=!0);let c=(0,ky.join)(t,"managed-settings.d");try{let d=MI().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}=cwt((0,ky.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=sW(r,h,aW),n=!0)}}catch(d){let f=NI(d);f!=="ENOENT"&&f!=="ENOTDIR"&&ru(`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 xtl(t,e){B8e(t)?ru(`Broken symlink or missing file encountered for settings.json at path: ${e}`):ru(`settings file read failed at ${e}: ${t}`,{level:"error"})}function cwt(t,e){let r=rHc(t);if(r)return{settings:r.settings?dW(r.settings):null,errors:r.errors};let n=wtl(t,e);return nHc(t,n),{settings:n.settings?dW(n.settings):null,errors:n.errors}}function poo(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 hoo(t){let e=t?.remote?t.remote():Ttl();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=dW(e),n=zve(r,"remote managed settings"),o=Wve().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...Z8e(o.error,"remote managed settings")]}}function moo(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=dW(e),n=zve(r,"parent managed settings"),o=Wve().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...Z8e(o.error,"parent managed settings")]}}function goo(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=dW(e),n=zve(r,"SDK inline settings"),o=Wve().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...Z8e(o.error,"SDK inline settings")]}}function wtl(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=EXi(MI(),t);r=Kwt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=dW(Jwt(r,!1)),o=zve(n,t),s=Wve().safeParse(n);if(!s.success){let c=Z8e(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return xtl(r,t),{settings:null,errors:[]}}}function FJi(t,e){switch(t){case"userSettings":return(0,ky.resolve)(Uve());case"policySettings":case"projectSettings":case"localSettings":return(0,ky.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,ky.dirname)((0,ky.resolve)(e.flagPath)):(0,ky.resolve)(e.cwd)}}function Rtl(t){return t.coworkPlugins||s_(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function lwt(t,e){switch(t){case"userSettings":return(0,ky.join)(FJi(t,e),Rtl(e));case"projectSettings":case"localSettings":return(0,ky.join)(FJi(t,e),ktl(t));case"policySettings":return Itl();case"flagSettings":return e.flagPath}}function ktl(t){switch(t){case"projectSettings":return(0,ky.join)(".claude","settings.json");case"localSettings":return(0,ky.join)(".claude","settings.local.json")}}function Aoo(t,e){let r=Xjc(t);if(r!==void 0)return r;let n=Otl(t,e);return eHc(t,n),n}function Ptl(t){return!t||t.parentSettingsBehavior==="merge"}function Dtl(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=JFr(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=JFr(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=JFr(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 Ntl(t){if(t.helper?.())return"helper";if(hoo(t).settings)return"remote";if(poo(t).settings)return Zwt()==="macos"?"plist":"hklm";if((t.file?.()??foo(t)).settings)return"file";if(moo(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function Mtl(t){let e=[],{settings:r,errors:n}=hoo(t);e.push(...n);let{settings:o,errors:s}=poo(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??foo(t);e.push(...l);let{settings:u,errors:d}=moo(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&&Ptl(h)?Dtl(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function yoo(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=Mtl(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:sW({},n??{},r??{},aW),errors:o}}function Otl(t,e){if(t==="policySettings")return yoo(e).settings;let r=lwt(t,e),{settings:n}=r?cwt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=goo(e);if(o)return sW(n||{},o,aW)}return n}function Ltl(t,e){return ZXi([...t,...e])}function aW(t,e){if(Array.isArray(t)&&Array.isArray(e))return Ltl(t,e)}function Btl(t){if(e8r)return{settings:{},errors:[]};let e=Date.now();n6r("info","settings_load_started"),e8r=!0;try{let r=oHc(),n={};r&&(n=sW(n,r,aW));let o=[],s=new Set,c=new Set;for(let l of l7r(t)){if(l==="policySettings"){let{settings:d,errors:f}=yoo(t);d&&(n=sW(n,d,aW));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=lwt(l,t);if(u){let d=(0,ky.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=cwt(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=sW(n,f,aW))}}if(l==="flagSettings"){let{settings:d,errors:f}=goo(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=sW(n,d,aW))}}return n6r("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{e8r=!1}}function Ftl(t){let e=Jjc();if(e!==null)return e;let r=Btl(t);return Zjc(r),r}function Utl(t){let{settings:e}=Ftl(t);return e||{}}function Qtl(t){V6r();let e=[];for(let r of l7r(t)){let n=Aoo(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:Utl(t),sources:e}}function qtl(t,e){let r=l7r(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(Aoo(o,e)?.[t]!==void 0)return o}return null}function Vtl(t){let e=t.effective.permissions?.defaultMode;if(!e||!Gtl.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($tl.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function Wtl(t={}){await hel();let e={cwd:(0,Iio.resolve)(t.cwd??MI().cwd()),allowedSources:(t.settingSources??Htl).map(r=>jtl[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:mel,hkcu:gel,wslInherits:Ael,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=Qtl(e),o=Ntl(e)??void 0,s=n.map(({source:l,settings:u})=>({source:UJi[l],settings:u,path:l==="policySettings"?void 0:lwt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=qtl(l,e);u&&(c[l]={source:UJi[u],path:u==="policySettings"?void 0:lwt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{V6r()}}async function ztl(t){return Wtl(t)}async function Ytl(t,e){try{await(0,a_.copyFile)(t,e)}catch(r){if(!B8e(r))throw r}}async function Ktl(t,e){if(!t)return;let r=t;try{let n=$N(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=Qm(n))}catch{}await(0,a_.writeFile)(e,r,{mode:384})}function Jtl(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=C$c(v$c);return new Promise(e=>{(0,cZi.execFile)("security",["find-generic-password","-a",S$c(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function Eoo(t,e,r,n,o=6e4){if(!bh(e))return;let s=Sk(r),c=await Vie(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,pc.join)((0,dve.tmpdir)(),`claude-resume-${(0,Awt.randomUUID)()}`);try{let u=(0,pc.join)(l,"projects",s);await(0,a_.mkdir)(u,{recursive:!0});let d=(0,pc.join)(u,`${e}.jsonl`);await k8r(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,pc.join)((0,dve.homedir)(),".claude"),m;try{m=await(0,a_.readFile)((0,pc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!B8e(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await Jtl()??m),await Ktl(m,(0,pc.join)(l,".credentials.json")),await Ytl((0,pc.join)(f??(0,dve.homedir)(),".claude.json"),(0,pc.join)(l,".claude.json")),t.listSubkeys){let g=(0,pc.join)(u,e),A=await Vie(t.listSubkeys({projectKey:s,sessionId:e}),o,`SessionStore.listSubkeys() timed out after ${o}ms for session ${e}`);for(let y of A){let E=(0,pc.resolve)(g,y+".jsonl");if(!y||(0,pc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!E.startsWith(g+pc.sep)){ru(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let _=await Vie(t.load({projectKey:s,sessionId:e,subpath:y}),o,`SessionStore.load() timed out after ${o}ms for session ${e} subpath ${y}`);if(!_||_.length===0)continue;let v=[],b=[];for(let T of _)A6r(T)?v.push(T):b.push(T);if(b.length>0&&(await(0,a_.mkdir)((0,pc.dirname)(E),{recursive:!0}),await k8r(E,b)),v.length>0){let T=v.at(-1),w=(0,pc.resolve)(g,y+".meta.json");await(0,a_.mkdir)((0,pc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,a_.writeFile)(w,Qm(x),{mode:384})}}}return l}catch(u){throw await uwt(l),u}}function m6r(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=r8r(),additionalDirectories:A=[],agent:y,agents:E,allowedTools:_=[],betas:v,canUseTool:b,continue:T,cwd:w,debug:R,debugFile:x,disallowedTools:P=[],tools:D,env:N,executable:L=yZi()?"bun":"node",executableArgs:B=[],extraArgs:q={},fallbackModel:M,enableFileCheckpointing:O,toolConfig:j,forkSession:Q,hooks:U,includeHookEvents:Y,includePartialMessages:W,forwardSubagentText:V,onElicitation:z,persistSession:ie,sessionStore:H,sessionStoreFlush:re,thinking:le,effort:Le,maxThinkingTokens:ge,maxTurns:Ue,maxBudgetUsd:ke,taskBudget:X,mcpServers:ee,model:K,outputFormat:he,permissionMode:Z="default",allowDangerouslySkipPermissions:ue=!1,permissionPromptToolName:qe,plugins:ne,getOAuthToken:ce,getHostAuthToken:Ne,workload:we,resume:Be,resumeSessionAt:rt,sessionId:st,skills:_t,stderr:Dt,strictMcpConfig:$t}=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&&!Be&&!H.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(H&&O)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&&ru("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 Gt=d.pathToClaudeCodeExecutable;if(!Gt){let Ge=(0,dZi.fileURLToPath)(importMetaUrlShim),J=(0,lZi.createRequire)(Ge),se=iGc(me=>J.resolve(me));if(!se)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.`);Gt=se}let Ie=he?.type==="json_schema"?he.schema:void 0,F=N?{...N}:{...process.env};F.CLAUDE_CODE_ENTRYPOINT||(F.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),F.CLAUDE_AGENT_SDK_VERSION||(F.CLAUDE_AGENT_SDK_VERSION="0.3.159"),O&&(F.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true"),ce&&(F.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ne&&(F.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),j?.askUserQuestion?.previewFormat&&(F.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=j.askUserQuestion.previewFormat);let be={};if(DKi.propagation.inject(DKi.context.active(),be),"traceparent"in be)for(let Ge of["TRACEPARENT","TRACESTATE"])Ge in(N??{})||delete F[Ge];for(let[Ge,J]of Object.entries(be)){let se=Ge.toUpperCase();se in(N??{})||(F[se]=J)}let Qe={},pe=new Map;if(ee)for(let[Ge,J]of Object.entries(ee))J.type==="sdk"&&J.instance?pe.set(Ge,J.instance):Qe[Ge]=J;let Se;if(le)switch(le.type){case"adaptive":Se={type:"adaptive",display:le.display};break;case"enabled":Se={type:"enabled",budgetTokens:le.budgetTokens,display:le.display};break;case"disabled":Se={type:"disabled"};break}else ge!==void 0&&(Se=ge===0?{type:"disabled"}:{type:"enabled",budgetTokens:ge});r&&(F.CLAUDE_CONFIG_DIR=r,process.platform==="win32"&&(F.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 Fe=new T8r({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:L,executableArgs:B,extraArgs:we?{...q,workload:we}:q,pathToClaudeCodeExecutable:Gt,env:F,forkSession:Q,stderr:Dt,thinkingConfig:Se,effort:Le,maxTurns:Ue,maxBudgetUsd:ke,taskBudget:X,model:K,fallbackModel:M,jsonSchema:Ie,permissionMode:Z,allowDangerouslySkipPermissions:ue,permissionPromptToolName:qe,continueConversation:H?void 0:T,resume:Be,resumeSessionAt:rt,sessionId:st,settings:typeof s=="object"?Qm(s):s,managedSettings:c?Qm(c):void 0,settingSources:l,skills:_t,allowedTools:_,disallowedTools:P,tools:D,mcpServers:Qe,strictMcpConfig:$t,canUseTool:!!b,hooks:!!U,includeHookEvents:Y,includePartialMessages:W,persistSession:ie,sessionMirror:!!H,plugins:ne,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:n}),te={systemPrompt:f,appendSystemPrompt:h,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:m,agents:E,title:d.title,skills:_t,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:V},Te=new x8r(Fe,e,b,U,g,pe,Ie,te,z,ce,Ne);if(H){let Ge=a(()=>(0,pc.join)(F.CLAUDE_CONFIG_DIR??(0,pc.join)((0,dve.homedir)(),".claude"),"projects"),"S6"),J=re==="eager",se=new w8r(async(me,Ce)=>{let He=HJi(me,Ge());He?await H.append(He,Ce):ru(`[SessionStore] dropping mirror frame: filePath ${me} is not under ${Ge()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(me,Ce)=>{let He=HJi(me,Ge());He&&Te.reportMirrorError(He,Ce.message)},J?0:z6r,J?0:Y6r);Te.setTranscriptMirrorBatcher(se)}return{queryInstance:Te,transport:Fe,abortController:g,processEnv:F}}function g6r(t,e,r,n){typeof r=="string"?e.write(Qm({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 uwt(t){for(let e=0;;e++)try{return await(0,a_.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!Ztl.has(NI(r)??""))return;await pZi((e+1)*100)}}function Xtl(t,e){t.waitForExit().catch(()=>{}).finally(()=>uwt(e))}function erl({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=m6r({...e},typeof t=="string",void 0,!0),d=(0,pc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await Vie(f.listSessions(Sk(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return Eoo(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(()=>Xtl(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=L8e(g);c.spawnAbort(A),s.setError(A)}),g6r(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=m6r(e,typeof t=="string");return g6r(r,n,t,o),r}async function trl({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,pc.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 Vie(t.sessionStore.listSessions(Sk(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await Eoo(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=m6r(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(()=>uwt(g))})}await Vie(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{g6r(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(()=>uwt(r))}throw await c,l}}async function rrl(t,e){return e?.sessionStore?mrl(e.sessionStore,t,e):qGc(t,e)}async function nrl(t){return t?.sessionStore?prl(t.sessionStore,t):zGc(t)}async function irl(t,e){return e?.sessionStore?grl(e.sessionStore,t,e):YGc(t,e)}async function orl(t,e,r){return r?.sessionStore?Arl(r.sessionStore,t,e,r.dir):KGc(t,e,r)}async function srl(t,e,r){return r?.sessionStore?yrl(r.sessionStore,t,e,r.dir):JGc(t,e,r)}async function arl(t,e){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=Sk(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return ZGc(t,e)}async function crl(t,e){return e?.sessionStore?Erl(e.sessionStore,t,e):i$c(t,e)}async function lrl(t,e,r){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);let n=await xwt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=Sk(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:z6r;if(await QJi(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,pc.join)(c,"subagents");for(let u of await url(l)){let d=(0,pc.relative)(c,u).split(pc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await QJi(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=$N(await(0,a_.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!B8e(m))throw m}}}async function QJi(t,e,r,n){let o=(0,uZi.createInterface)({input:(0,ywt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push($N(l)),c+=l.length,(s.length>=n||c>=Y6r)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function url(t){let e=[];async function r(n){let o;try{o=await(0,a_.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,pc.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 drl(t,e){return e?.sessionStore?_rl(e.sessionStore,t,e.dir):u$c(t,e)}async function frl(t,e,r){return r?.sessionStore?vrl(r.sessionStore,t,e,r):d$c(t,e,r)}function _oo(t){let e=(0,pc.resolve)(t??"."),r;try{r=(0,ywt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function Sk(t){return U8e(_oo(t))}function voo(t){return t.map(e=>Qm(e)).join(` `)+` -`}function BJi(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function g6r(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function arl(t,e){let r=goo(e.dir),n=B8e(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 ru("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=BJi(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await FJi(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=BJi(c,s,o);return FJi(t,l,e.dir,r)}async function FJi(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await Eoo(t,o.sessionId,r);if(!s)return null;let c=xwt(o.sessionId,yoo(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 yoo(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,$9).toString("utf-8"),s=n>$9?r.subarray(n-$9).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function crl(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` -`)+1);try{let n=GN(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 Eoo(t,e,r){let n=bk(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:Aoo(o)}async function lrl(t,e,r){if(!bh(e))return[];let n=bk(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:MGc(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function url(t,e,r){if(!bh(e))return;let n=await Eoo(t,e,r.dir);if(!n)return;let o=yoo(n,crl(n));return xwt(e,o)??void 0}async function drl(t,e,r,n){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=bk(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,gwt.randomUUID)(),timestamp:new Date().toISOString()}])}async function frl(t,e,r,n){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=t8e(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=bk(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,gwt.randomUUID)(),timestamp:new Date().toISOString()}])}async function prl(t,e,r){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!bh(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=bk(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}=e$c(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function hrl(t,e,r){if(!bh(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=bk(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 mrl(t,e,r,n){if(!bh(e))return[];if(!r)return[];let o=bk(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(g6r),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!g6r(f));return d.length===0?[]:GXi(Buffer.from(Aoo(d)),{limit:n.limit,offset:n.offset},u)}function UJi(t,e){let r=(0,pc.relative)(e,t),n=r.split(pc.sep);if(n[0]===".."||(0,pc.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 QJi,iZi,gwt,Awt,a_,oZi,uve,pc,sZi,aZi,cZi,uZi,dZi,fZi,yZi,EZi,KZi,m8r,JZi,sA,ZZi,jL,y8r,fXi,Txt,l_,soe,vo,G0,hXi,HL,CXi,TXi,w8r,IXi,UN,mve,xXi,wXi,RXi,kXi,qve,jve,k8r,GL,Kie,KFe,Pxt,f8e,Dxt,$Xi,VXi,Cio,Jie,bio,nf,n7r,ewt,kio,Pio,o7r,s6r,Yio,Jio,Zio,ky,aoo,B8c,F8c,e8r,U8c,Q8c,j8c,H8c,A6r,Ht,G8c,WL,V8c,W8c,z8c,ef,tf,Y8c,K8c,J8c,qJi,Z8c,Dve,X8c,y6r,e6c,Nve,t6c,r6c,jJi,uwt,n6c,HJi,i6c,GJi,o6c,dwt,$Ji,E6r,_6r,VJi,v6r,WJi,zJi,s6c,YJi,a6c,c6c,l6c,u6c,d6c,f6c,p6c,h6c,m6c,g6c,A6c,y6c,E6c,_6c,v6c,C6c,b6c,S6c,GIt,NYi,Ns,mc,pW,fwt,T6c,KJi,JJi,$It,I6c,HN,x6c,w6c,ZJi,R6c,pwt,hwt,C6r,mwt,b6r,k6c,XJi,P6c,D6c,N6c,M6c,O6c,L6c,B6c,F6c,U6c,Q6c,q6c,j6c,H6c,G6c,$6c,S6r,V6c,W6c,z6c,Y6c,eZi,tZi,K6c,J6c,Z6c,X6c,e9c,rZi,t9c,r9c,n9c,i9c,o9c,s9c,a9c,c9c,l9c,u9c,d9c,f9c,p9c,h9c,m9c,g9c,nZi,A9c,y9c,E9c,_9c,ywt,C9c,b9c,S9c,T9c,I9c,r8r,R1,P9c,mZi,D9c,N9c,Mve,M9c,cW,gZi,O9c,L9c,bFe,F9c,U9c,Q9c,j9c,H9c,G9c,MYi,N8e,z9,W9c,z9c,Y9c,K9c,I6r,Z9c,CFr,OYi,eUc,tUc,rUc,iUc,oUc,sUc,aUc,cUc,lUc,uUc,dUc,pUc,mUc,x6r,AUc,n8e,EUc,vUc,CUc,bUc,SUc,IUc,xUc,wUc,kUc,PUc,NUc,LYi,OUc,Ewt,_wt,FUc,UUc,qUc,HUc,$Uc,WUc,vwt,zUc,AZi,KUc,ZUc,Cwt,t7c,n7c,o7c,a7c,w6r,c7c,Py,Fve,AKh,_Zi,n8r,Ri,Jv,kI,dve,VIt,WIt,zIt,YIt,KIt,JIt,ZIt,XIt,ext,l7c,u7c,i8r,BYi,f7c,vZi,p7c,nW,h7c,g7c,UYi,QYi,qYi,k6r,_7c,C7c,b7c,SZi,txt,S7c,T7c,D6r,I7c,jYi,bFr,x7c,nu,s8r,tu,HYi,GYi,rxt,VYi,k7c,WYi,Gie,RZi,P7c,D7c,N7c,M6r,M7c,PZi,xI,wI,Zie,SFe,Xie,a8r,$Fe,nxt,vIt,ixt,c8r,eoe,c_,OZi,LZi,O6r,YYi,z7c,Y7c,l8r,BZi,K7c,J7c,Sd,FZi,mr,KYi,tQc,$n,oxt,XFe,sxt,axt,cxt,lxt,o8e,uxt,dxt,fve,fxt,pxt,jZi,iQc,eve,oQc,sQc,$Zi,dk,KV,W_e,TFe,CIt,IFe,xFe,bIt,wFe,U9,RFe,SIt,TIt,Qie,IIt,xIt,kFe,SFr,ZYi,wIt,TFr,IFr,xFr,XYi,eKi,d8r,hxt,aQc,cQc,PFe,z_e,qie,Q0,w1,II,G9,JV,DFe,rKi,f8r,mxt,iKi,uQc,toe,gxt,Axt,pve,yxt,s8e,Ext,a8e,k1,_xt,fk,ZV,Y_e,NFe,RIt,MFe,OFe,kIt,LFe,Q9,BFe,PIt,DIt,jie,NIt,MIt,FFe,wFr,aKi,RFr,kFr,PFr,DFr,cKi,lKi,p8r,vxt,c8e,dKi,fQc,Cxt,h8r,L6r,jIt,zZi,pQc,hQc,Mp,hve,gQc,AQc,g8r,EQc,zie,K_e,CQc,SQc,IQc,wQc,RQc,PQc,DQc,NQc,Sxt,B6r,OQc,LQc,eXi,UQc,qQc,Qve,HQc,fKi,tXi,$Qc,VQc,WQc,l8e,zQc,lW,VFe,KQc,rXi,pKi,JQc,hKi,ZQc,XQc,F6r,eqc,tqc,bwt,nqc,U6r,oqc,sqc,aqc,cqc,lqc,uqc,dqc,fqc,pqc,hqc,mqc,gqc,Aqc,yqc,Eqc,_qc,vqc,Cqc,bqc,Sqc,Tqc,Iqc,xqc,wqc,Cd,kqc,Dqc,WFe,nXi,e8e,Nqc,NFr,Mqc,A8r,mKi,Oqc,iXi,Lqc,Bqc,Uqc,Qqc,oXi,Hqc,Q6r,Vqc,Wqc,zqc,Kqc,sXi,zFe,aXi,gKi,Zqc,AKi,yKi,cXi,tjc,njc,ijc,lXi,ojc,EKi,ajc,ljc,_Ki,ujc,djc,pjc,hjc,q6r,gjc,Ajc,Ejc,_jc,Cjc,bjc,Sjc,Tjc,Ijc,wjc,Rjc,vKi,CKi,kjc,Djc,Swt,Mjc,j6r,Bjc,Ujc,qjc,Hjc,dXi,H6r,Ixt,Yjc,G6r,Zjc,tHc,nHc,iHc,oHc,yKh,sHc,EKh,aHc,_Kh,cHc,vKh,lHc,CKh,E8r,fHc,hHc,vHc,CHc,bKh,SKh,wHc,SKi,TKi,RHc,kHc,IKi,_8r,NHc,MHc,v8r,OHc,gXi,AXi,BHc,FHc,OIt,MFr,UFe,OFr,C8r,vXi,TKh,qHc,rf,GN,VHc,xxt,xKi,S8r,J_e,wxt,eGc,T8r,I8r,W6r,z6r,rGc,x8r,wKi,LFr,oGc,lGc,$9,dGc,u8e,mGc,gGc,AGc,kxt,EGc,d8e,_Gc,vGc,LGc,YGc,a$c,YXi,c$c,l$c,u$c,xKh,RKi,d$c,p$c,m$c,A$c,hc,kKi,kn,tW,hr,yk,E$c,p8e,_$c,D8r,Zv,eo,JFe,P1,PKi,DKi,gve,Nxt,Zn,_k,NKi,Ms,v$c,C$c,b$c,S$c,T$c,I$c,x$c,w$c,R$c,QFr,k$c,P$c,D$c,N$c,M$c,O$c,KXi,L$c,Ave,h8e,m8e,g8e,A8e,y8e,yve,Eve,E8e,aW,$L,_8e,dW,NI,_ve,j9,N8r,vve,Y9,O8r,v8e,C8e,L8r,Cve,bve,Sve,Tve,roe,QN,Ek,K9,Ive,xve,b8e,Mxt,Oxt,wve,wKh,Cr,RKh,kKh,PKh,DKh,NKh,MKh,OKh,LKh,BKh,FKh,UKh,QKh,qKh,jKh,H$c,HKh,GKh,$Kh,VKh,WKh,zKh,YKh,KKh,JKh,ZKh,XKh,eJh,tJh,rJh,nJh,iJh,oJh,sJh,aJh,XXi,eeo,teo,fW,Lxt,Ws,J6r,ieo,X$c,Bxt,oeo,aeo,ceo,B8r,ueo,Z6r,U8e,t9r,Fxt,r9r,Uxt,n9r,Dwt,i9r,Nwt,o9r,heo,meo,geo,Aeo,yeo,Eeo,_eo,cVc,veo,Rve,lVc,uVc,dVc,Ceo,fVc,pVc,hVc,mVc,gVc,Seo,Teo,Ieo,xeo,weo,s9r,Reo,AVc,keo,Peo,Deo,Leo,Beo,Feo,Ueo,Qeo,qeo,jeo,Heo,Geo,Sh,$eo,a9r,c9r,Veo,Weo,zeo,Yeo,Keo,Jeo,Zeo,Xeo,eto,Q8e,tto,rto,nto,ito,oto,sto,ato,cto,lto,Qxt,uto,Co,q8e,Lu,dto,fto,pto,hto,mto,gto,Ato,yto,Eto,_to,vto,Cto,bto,Sto,Tto,Ito,xto,wto,Rto,kto,Dto,Nto,Oto,Lto,u9r,Bto,d9r,f9r,Fto,Uto,Qto,qto,jto,qxt,Hto,Gto,$to,p9r,h9r,m9r,Vto,Wto,Mwt,zto,Yto,Kto,Jto,Zto,Xto,g9r,ero,tro,rro,nro,iro,oro,sro,aro,A9r,cro,lro,uro,dro,fro,y9r,yVc,_Vc,CVc,SVc,IVc,wVc,kVc,PVc,DVc,NVc,OVc,BVc,UVc,qVc,HVc,$Vc,WVc,YVc,JVc,XVc,tWc,nWc,oWc,aWc,lWc,dWc,pWc,mWc,AWc,EWc,vWc,bWc,TWc,xWc,RWc,PWc,DWc,MWc,LWc,FWc,QWc,jWc,hro,mro,I8e,V9,yro,Gxt,R8e,dzc,fzc,pzc,G,tUr,rUr,nUr,iUr,oUr,cno,gzc,H8e,lno,uno,dno,fno,Os,sUr,Fwt,Td,aUr,$xt,W9,cUr,lUr,uUr,dUr,fUr,pUr,hUr,mUr,gUr,AUr,yUr,EUr,_Ur,vUr,CUr,bUr,pno,Uwt,Hve,Qwt,qwt,SUr,hno,mno,gno,Ano,yno,Eno,_no,IUr,vno,Hwt,xUr,Cno,bno,Sno,RUr,Tno,Ino,k8e,xno,wno,kUr,DUr,Rno,kno,Dno,NUr,Ono,Lno,Fno,MUr,Uno,qno,jno,Gno,$wt,fYc,hYc,Yno,CYc,Kno,Jno,bYc,$ie,Vwt,H0,Zno,Xno,cJh,SYc,TYc,LUr,MI,G8e,IYc,Dy,vk,Ck,Ny,Wwt,eio,YKi,tio,xYc,BUr,FIt,Bi,FUr,wYc,lJh,uJh,UUr,RYc,QUr,kYc,$8e,Pve,rio,PYc,DYc,NYc,MYc,OYc,LYc,nio,BYc,FYc,iio,qUr,UYc,QYc,jUr,qYc,V8e,W8e,jYc,z8e,zwt,HYc,zxt,HUr,GUr,$Ur,dJh,VUr,WUr,zUr,GYc,oio,sio,YUr,aio,Y8e,Gve,cio,$Yc,Q8r,VYc,q8r,WYc,KUr,zYc,j8r,YYc,KYc,JYc,ZYc,XYc,eKc,tKc,rKc,nKc,iKc,H8r,oKc,sKc,G8r,JUr,ZUr,XUr,aKc,cKc,lKc,e7r,uKc,dKc,fKc,pKc,hKc,lio,$8r,mKc,t7r,fJh,gKc,Yxt,AKc,pJh,Kxt,yKc,uio,EKc,_Kc,vKc,CKc,bKc,SKc,TKc,Jxt,IKc,xKc,wKc,r7r,dio,RKc,kKc,PKc,DKc,NKc,MKc,OKc,LKc,BKc,FKc,UKc,QKc,qKc,jKc,HKc,GKc,$Kc,VKc,Zxt,WKc,zKc,YKc,V8r,ZKc,XKc,eJc,fio,tJc,hJh,mJh,gJh,AJh,yJh,EJh,fi,W8r,rJc,KKi,nJc,iJc,hio,cJc,lJc,pJc,HFr,ON,gJc,Xxt,ZKi,wJc,RJc,OJc,LJc,BJc,FJc,UJc,qJc,z8r,HJc,GJc,Y8r,K8r,J8r,Eio,iJi,YJc,Z8r,X8r,ZJc,qFe,cJi,nZc,mk,t6r,uJi,_Jh,vJh,dJi,fJi,pJi,hJi,iW,i7r,ive,uZc,dZc,fZc,CJh,gZc,$Fr,yZc,mJi,bJh,Z_e,Iio,n6r,xio,twt,gJi,EZc,eW,wio,cve,i6r,o6r,vZc,AJi,Kwt,Jwt,TJh,IJh,xJh,P8e,wJh,CZc,bZc,SZc,TZc,IZc,xZc,wZc,RZc,RJh,s7r,kZc,PZc,kJh,PJh,DZc,jFe,MZc,OZc,rwt,DJh,NJh,$ve,mW,LZc,BZc,Dio,FZc,UZc,QZc,qZc,jZc,HZc,GZc,$Zc,a6r,MJh,Nio,VZc,WZc,jN,ooe,yJi,c6r,l6r,Mio,a7r,YZc,OJh,KZc,JZc,ZZc,XZc,eXc,Oio,Lio,tXc,EJi,rXc,nXc,Bio,iXc,oXc,_Ji,sXc,aXc,Fio,cXc,Uio,lXc,uXc,dXc,nwt,VFr,Qio,fXc,pXc,hXc,mXc,gXc,LJh,qio,yXc,EXc,_Xc,vXc,CXc,bXc,SXc,BJh,TXc,FJh,IXc,xXc,wXc,UIt,Zwt,vJi,Hio,UJh,QJh,iwt,zFr,qXc,qJh,jXc,Wio,zio,HXc,CJi,Vve,H9,$Xc,VXc,jJh,KXc,ZXc,xJi,u6r,d6r,ove,eel,tel,rel,wJi,owt,iel,rW,Xio,eoo,too,swt,f6r,Ael,yel,Eel,vel,Cel,bel,Sel,roo,Tel,Iel,wel,p6r,Pel,Nel,Mel,Lel,DJi,ioo,Uel,Qel,qel,jel,Hel,Gel,Vel,Wel,ooo,Yel,Jel,Xel,etl,oW,rtl,itl,stl,NJi,ctl,ltl,dtl,ptl,htl,KFr,mtl,JFr,gtl,XFr,Ltl,OJi,Btl,Ftl,Utl,Vtl,voo=ve(()=>{p();QJi=require("node:module"),iZi=require("child_process"),gwt=require("crypto"),Awt=require("fs"),a_=require("fs/promises"),oZi=require("module"),uve=require("os"),pc=require("path"),sZi=require("readline"),aZi=require("url"),cZi=require("events"),uZi=require("child_process"),dZi=require("fs"),fZi=require("readline"),yZi=require("os"),EZi=require("path"),KZi=require("crypto"),m8r=require("path"),JZi=require("async_hooks"),sA=require("fs/promises"),ZZi=require("crypto"),jL=require("fs/promises"),y8r=require("fs"),fXi=require("process"),Txt=require("crypto"),l_=require("fs/promises"),soe=require("path"),vo=de(require("fs"),1),G0=require("fs/promises"),hXi=require("fs"),HL=require("path"),CXi=require("fs"),TXi=require("fs/promises"),w8r=require("events"),IXi=require("fs"),UN=require("fs/promises"),mve=require("path"),xXi=require("child_process"),wXi=require("util"),RXi=require("child_process"),kXi=require("path"),qve=require("fs/promises"),jve=require("path"),k8r=require("fs"),GL=require("fs/promises"),Kie=require("path"),KFe=require("crypto"),Pxt=require("path"),f8e=require("fs/promises"),Dxt=require("path"),$Xi=require("crypto"),VXi=require("os"),Cio=require("path"),Jie=require("path"),bio=require("path"),nf=de(require("node:path"),1),n7r=de(require("node:os"),1),ewt=de(require("node:process"),1),kio=require("path"),Pio=require("fs/promises"),o7r=require("os"),s6r=require("path"),Yio=require("os"),Jio=require("child_process"),Zio=require("fs"),ky=require("path"),aoo=require("path"),B8c=Object.create,{getPrototypeOf:F8c,defineProperty:e8r,getOwnPropertyNames:U8c}=Object,Q8c=Object.prototype.hasOwnProperty;a(q8c,"a_");A6r=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?j8c??=new WeakMap:H8c??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?B8c(F8c(t)):{};let c=e||!t||!t.__esModule?e8r(r,"default",{value:t,enumerable:!0}):r;for(let l of U8c(t))Q8c.call(c,l)||e8r(c,l,{get:q8c.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),Ht=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),G8c=a(t=>t,"$k");a($8c,"Qk");WL=a((t,e)=>{for(var r in e)e8r(t,r,{get:e[r],enumerable:!0,configurable:!0,set:$8c.bind(e,r)})},"M4"),V8c=(0,QJi.createRequire)(importMetaUrlShim),W8c=Symbol.dispose||Symbol.for("Symbol.dispose"),z8c=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),ef=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[z8c]),n===void 0&&(n=e[W8c]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),tf=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$"),Y8c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),K8c=Ht(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(Y8c(),t)}),J8c=Ht(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(K8c(),t)}),qJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),Z8c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=qJi(),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)}),Dve=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=J8c(),r=qJi(),n=Z8c(),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 E=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${f}`);return m.error(E.stack||E.message),!1}if(y.version!==r.VERSION){let E=Error(`@opentelemetry/api: Registration of version v${y.version} for ${f} does not match previously registered API v${r.VERSION}`);return m.error(E.stack||E.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}),X8c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=Dve();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")}),y6r=Ht(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={}))}),e6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=y6r();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}),Nve=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=X8c(),r=e6c(),n=y6r(),o=Dve(),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 E=(0,o.getGlobal)("diag"),_=(0,r.createLogLevelDiagLogger)((A=m.logLevel)!==null&&A!==void 0?A:n.DiagLogLevel.INFO,h);if(E&&!m.suppressOverrideMessage){let v=(y=Error().stack)!==null&&y!==void 0?y:"";E.warn(`Current logger will be overwritten from ${v}`),_.warn(`Current logger will overwrite one already registered from ${v}`)}return(0,o.registerGlobal)("diag",_,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}),t6c=Ht(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}),r6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),jJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=Nve(),r=t6c(),n=r6c(),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}),uwt=Ht(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}),n6c=Ht(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}),i6c=Ht(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={}))}),GJi=Ht(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)}}}),o6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=uwt();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}),dwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=o6c(),r=Dve(),n=Nve(),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}),$Ji=Ht(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={}))}),E6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=$Ji();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),_6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=E6r();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}),VJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=uwt(),r=_6r(),n=dwt(),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}),v6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=E6r(),r=_6r(),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}),WJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=dwt(),r=VJi(),n=_6r(),o=v6r(),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 E=A??s.active(),_=this.startSpan(d,g,E),v=(0,r.setSpan)(E,_);return s.with(v,y,void 0,_)}}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")}),zJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=WJi(),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}),s6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=WJi();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),YJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=zJi(),r=s6c(),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}),a6c=Ht(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={}))}),c6c=Ht(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={}))}),l6c=Ht(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={}))}),u6c=Ht(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}),d6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=u6c(),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}),f6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=d6c();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),p6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=dwt();t.context=e.ContextAPI.getInstance()}),h6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=Nve();t.diag=e.DiagAPI.instance()}),m6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=HJi();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),g6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=m6c(),r=Dve(),n=Nve(),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}),A6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=g6c();t.metrics=e.MetricsAPI.getInstance()}),y6c=Ht(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}),E6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=dwt(),r=uwt(),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}),_6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=Dve(),r=y6c(),n=GJi(),o=E6c(),s=jJi(),c=Nve(),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}),v6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=_6c();t.propagation=e.PropagationAPI.getInstance()}),C6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=Dve(),r=YJi(),n=v6r(),o=VJi(),s=Nve(),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}),b6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=C6c();t.trace=e.TraceAPI.getInstance()}),S6c=Ht(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=jJi();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=uwt();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=n6c();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=y6r();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=HJi();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=i6c();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=GJi();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=zJi();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=YJi();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=a6c();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=c6c();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=l6c();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=$Ji();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=f6c();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=v6r();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 E=E6r();Object.defineProperty(t,"INVALID_SPANID",{enumerable:!0,get:a(function(){return E.INVALID_SPANID},"get")}),Object.defineProperty(t,"INVALID_TRACEID",{enumerable:!0,get:a(function(){return E.INVALID_TRACEID},"get")}),Object.defineProperty(t,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:a(function(){return E.INVALID_SPAN_CONTEXT},"get")});var _=p6c();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return _.context},"get")});var v=h6c();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var b=A6c();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return b.metrics},"get")});var T=v6c();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=b6c();Object.defineProperty(t,"trace",{enumerable:!0,get:a(function(){return w.trace},"get")}),t.default={context:_.context,diag:v.diag,metrics:b.metrics,propagation:T.propagation,trace:w.trace}}),GIt=Ht(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((b,T)=>`${b}${T}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((b,T)=>(T instanceof r&&(b[T.str]=(b[T.str]||0)+1),b),{})}}t._Code=n,t.nil=new n("");function o(_,...v){let b=[_[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=GIt();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 E=this._scope[g]||(this._scope[g]=[]),_=E.length;return E[_]=f.ref,m.setValue(f,{property:g,itemIndex:_}),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 E=h[A]=h[A]||new Map;y.forEach(_=>{if(E.has(_))return;E.set(_,n.Started);let v=f(_);if(v){let b=this.opts.es5?t.varKinds.var:t.varKinds.const;g=e._`${g}${b} ${_} = ${v};${this.opts._n}`}else if(v=m?.(_))g=e._`${g}${v}${this.opts._n}`;else throw new r(_);E.set(_,n.Completed)})}return g}}t.ValueScope=l}),Ns=Ht(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=GIt(),r=NYi(),n=GIt();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=NYi();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 ge=le[Le];ge.optimizeNames(H,re)||(O(H,ge.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 E extends A{static{a(this,"RJ")}}E.kind="else";class _ 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 E(le):le}if(re)return H===!1?re instanceof _?re:re.nodes:this.nodes.length?this:new _(j(H),re instanceof _?[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}}_.kind="if";class v extends A{static{a(this,"q9")}}v.kind="for";class b 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:ge}=this;return`for(${re} ${le}=${Le}; ${le}<${ge}; ${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 P 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 L{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 ge=this._scope.toName(re);return le!==void 0&&Le&&(this._constants[ge.str]=le),this._leafNode(new c(H,ge,le)),ge}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 _(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 _(H))}else(){return this._elseNode(new E)}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 b(H),re)}forRange(H,re,le,Le,ge=this.opts.es5?r.varKinds.var:r.varKinds.let){let Ue=this._scope.toName(H);return this._for(new T(ge,Ue,re,le),()=>Le(Ue))}forOf(H,re,le,Le=r.varKinds.const){let ge=this._scope.toName(H);if(this.opts.es5){let Ue=re instanceof e.Name?re:this.var("_arr",re);return this.forRange("_i",0,e._`${Ue}.length`,ke=>{this.var(ge,e._`${Ue}[${ke}]`),le(ge)})}return this._for(new w("of",Le,ge,re),()=>le(ge))}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 ge=this._scope.toName(H);return this._for(new w("in",Le,ge,re),()=>le(ge))}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 P;if(this._blockNode(Le),this.code(H),re){let ge=this.name("e");this._currNode=Le.catch=new D(ge),re(ge)}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 _))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=L;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((ge,Ue)=>(Ue instanceof e.Name&&(Ue=le(Ue)),Ue instanceof e._Code?ge.push(...Ue._items):ge.push(Ue),ge),[]));function le(ge){let Ue=re[ge.str];return Ue===void 0||H[ge.str]!==1?ge:(delete H[ge.str],Ue)}function Le(ge){return ge instanceof e._Code&&ge._items.some(Ue=>Ue instanceof e.Name&&H[Ue.str]===1&&re[Ue.str]!==void 0)}}a(M,"V9");function O(ie,H){for(let re in H)ie[re]=(ie[re]||0)-(H[re]||0)}a(O,"dp");function j(ie){return typeof ie=="boolean"||typeof ie=="number"||ie===null?!ie:e._`!${z(ie)}`}a(j,"vj"),t.not=j;var Q=V(t.operators.AND);function U(...ie){return ie.reduce(Q)}a(U,"np"),t.and=U;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")}),mc=Ht(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=Ns(),r=GIt();function n(R){let x={};for(let P of R)x[P]=!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:P,self:D}=R;if(!P.strictSchema||typeof x=="boolean")return;let N=D.RULES.keywords;for(let L in x)N[L]||w(R,`unknown keyword: "${L}"`)}a(s,"fj"),t.checkUnknownRules=s;function c(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(x[P])return!0;return!1}a(c,"gj"),t.schemaHasRules=c;function l(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(P!=="$ref"&&x.all[P])return!0;return!1}a(l,"Jd"),t.schemaHasRulesButRef=l;function u({topSchemaRef:R,schemaPath:x},P,D,N){if(!N){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return e._`${P}`}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 P of R)x(P);else x(R)}a(g,"Gd"),t.eachItem=g;function A({mergeNames:R,mergeToName:x,mergeValues:P,resultToName:D}){return(N,L,B,q)=>{let M=B===void 0?L:B instanceof e.Name?(L instanceof e.Name?R(N,L,B):x(N,L,B),B):L instanceof e.Name?(x(N,B,L),L):P(L,B);return q===e.Name&&!(M instanceof e.Name)?D(N,M):M}}a(A,"xj"),t.mergeEvaluated={props:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>{R.if(e._`${x} === true`,()=>R.assign(P,!0),()=>R.assign(P,e._`${P} || {}`).code(e._`Object.assign(${P}, ${x})`))}),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>{x===!0?R.assign(P,!0):(R.assign(P,e._`${P} || {}`),E(R,P,x))}),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:{...R,...x},"mergeValues"),resultToName:y}),items:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>R.assign(P,e._`${x} === true ? true : ${P} > ${x} ? ${P} : ${x}`)),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>R.assign(P,x===!0?!0:e._`${P} > ${x} ? ${P} : ${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 P=R.var("props",e._`{}`);return x!==void 0&&E(R,P,x),P}a(y,"uj"),t.evaluatedPropsToName=y;function E(R,x,P){Object.keys(P).forEach(D=>R.assign(e._`${x}${(0,e.getProperty)(D)}`,!0))}a(E,"DB"),t.setEvaluated=E;var _={};function v(R,x){return R.scopeValue("func",{ref:x,code:_[x.code]||(_[x.code]=new r._Code(x.code))})}a(v,"Ud"),t.useFunc=v;var b;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(b||(t.Type=b={}));function T(R,x,P){if(R instanceof e.Name){let D=x===b.Num;return P?D?e._`"[" + ${R} + "]"`:e._`"['" + ${R} + "']"`:D?e._`"/" + ${R}`:e._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(R).toString():"/"+h(R)}a(T,"Hd"),t.getErrorPath=T;function w(R,x,P=R.opts.strictSchema){if(P){if(x=`strict mode: ${x}`,P===!0)throw Error(x);R.self.logger.warn(x)}}a(w,"mj"),t.checkStrictMode=w}),pW=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),fwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Ns(),r=mc(),n=pW();t.keywordError={message:a(({keyword:E})=>e.str`must pass "${E}" keyword validation`,"message")},t.keyword$DataError={message:a(({keyword:E,schemaType:_})=>_?e.str`"${E}" keyword must be ${_} ($data)`:e.str`"${E}" keyword is invalid ($data)`,"message")};function o(E,_=t.keywordError,v,b){let{it:T}=E,{gen:w,compositeRule:R,allErrors:x}=T,P=h(E,_,v);b??(R||x)?u(w,P):d(T,e._`[${P}]`)}a(o,"bd"),t.reportError=o;function s(E,_=t.keywordError,v){let{it:b}=E,{gen:T,compositeRule:w,allErrors:R}=b,x=h(E,_,v);u(T,x),!(w||R)&&d(b,n.default.vErrors)}a(s,"_d"),t.reportExtraError=s;function c(E,_){E.assign(n.default.errors,_),E.if(e._`${n.default.vErrors} !== null`,()=>E.if(_,()=>E.assign(e._`${n.default.vErrors}.length`,_),()=>E.assign(n.default.vErrors,null)))}a(c,"kd"),t.resetErrorsCount=c;function l({gen:E,keyword:_,schemaValue:v,data:b,errsCount:T,it:w}){if(T===void 0)throw Error("ajv implementation error");let R=E.name("err");E.forRange("i",T,n.default.errors,x=>{E.const(R,e._`${n.default.vErrors}[${x}]`),E.if(e._`${R}.instancePath === undefined`,()=>E.assign(e._`${R}.instancePath`,(0,e.strConcat)(n.default.instancePath,w.errorPath))),E.assign(e._`${R}.schemaPath`,e.str`${w.errSchemaPath}/${_}`),w.opts.verbose&&(E.assign(e._`${R}.schema`,v),E.assign(e._`${R}.data`,b))})}a(l,"Sd"),t.extendErrors=l;function u(E,_){let v=E.const("err",_);E.if(e._`${n.default.vErrors} === null`,()=>E.assign(n.default.vErrors,e._`[${v}]`),e._`${n.default.vErrors}.push(${v})`),E.code(e._`${n.default.errors}++`)}a(u,"dj");function d(E,_){let{gen:v,validateName:b,schemaEnv:T}=E;T.$async?v.throw(e._`new ${E.ValidationError}(${_})`):(v.assign(e._`${b}.errors`,_),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:b}=E.it;return b===!1?e._`{}`:m(E,_,v)}a(h,"nj");function m(E,_,v={}){let{gen:b,it:T}=E,w=[g(T,v),A(E,v)];return y(E,_,w),b.object(...w)}a(m,"vd");function g({errorPath:E},{instancePath:_}){let v=_?e.str`${E}${(0,r.getErrorPath)(_,r.Type.Str)}`:E;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,v)]}a(g,"Cd");function A({keyword:E,it:{errSchemaPath:_}},{schemaPath:v,parentSchema:b}){let T=b?_:e.str`${_}/${E}`;return v&&(T=e.str`${T}${(0,r.getErrorPath)(v,r.Type.Str)}`),[f.schemaPath,T]}a(A,"Td");function y(E,{params:_,message:v},b){let{keyword:T,data:w,schemaValue:R,it:x}=E,{opts:P,propertyName:D,topSchemaRef:N,schemaPath:L}=x;b.push([f.keyword,T],[f.params,typeof _=="function"?_(E):_||e._`{}`]),P.messages&&b.push([f.message,typeof v=="function"?v(E):v]),P.verbose&&b.push([f.schema,R],[f.parentSchema,e._`${N}${L}`],[n.default.data,w]),D&&b.push([f.propertyName,D])}a(y,"xd")}),T6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=fwt(),r=Ns(),n=pW(),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")}),KJi=Ht(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}),JJi=Ht(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}),$It=Ht(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=KJi(),r=JJi(),n=fwt(),o=Ns(),s=mc(),c;(function(b){b[b.Correct=0]="Correct",b[b.Wrong=1]="Wrong"})(c||(t.DataType=c={}));function l(b){let T=u(b.type);if(T.includes("null")){if(b.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!T.length&&b.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');b.nullable===!0&&T.push("null")}return T}a(l,"Yi"),t.getSchemaTypes=l;function u(b){let T=Array.isArray(b)?b:b?[b]:[];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(b,T){let{gen:w,data:R,opts:x}=b,P=h(T,x.coerceTypes),D=T.length>0&&!(P.length===0&&T.length===1&&(0,r.schemaHasRulesForType)(b,T[0]));if(D){let N=y(T,R,x.strictNumbers,c.Wrong);w.if(N,()=>{P.length?m(b,T,P):_(b)})}return D}a(d,"Wi"),t.coerceAndCheckDataType=d;var f=new Set(["string","number","integer","boolean","null"]);function h(b,T){return T?b.filter(w=>f.has(w)||T==="array"&&w==="array"):[]}a(h,"Gi");function m(b,T,w){let{gen:R,data:x,opts:P}=b,D=R.let("dataType",o._`typeof ${x}`),N=R.let("coerced",o._`undefined`);P.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,P.strictNumbers),()=>R.assign(N,x))),R.if(o._`${N} !== undefined`);for(let B of w)(f.has(B)||B==="array"&&P.coerceTypes==="array")&&L(B);R.else(),_(b),R.endIf(),R.if(o._`${N} !== undefined`,()=>{R.assign(x,N),g(b,N)});function L(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 qJi(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function A6r(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function prl(t,e){let r=_oo(e.dir),n=U8e(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 ru("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=qJi(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await jJi(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=qJi(c,s,o);return jJi(t,l,e.dir,r)}async function jJi(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await boo(t,o.sessionId,r);if(!s)return null;let c=wwt(o.sessionId,Coo(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 Coo(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,V9).toString("utf-8"),s=n>V9?r.subarray(n-V9).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function hrl(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` +`)+1);try{let n=$N(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 boo(t,e,r){let n=Sk(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:voo(o)}async function mrl(t,e,r){if(!bh(e))return[];let n=Sk(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:QGc(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function grl(t,e,r){if(!bh(e))return;let n=await boo(t,e,r.dir);if(!n)return;let o=Coo(n,hrl(n));return wwt(e,o)??void 0}async function Arl(t,e,r,n){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=Sk(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,Awt.randomUUID)(),timestamp:new Date().toISOString()}])}async function yrl(t,e,r,n){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=n8e(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=Sk(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,Awt.randomUUID)(),timestamp:new Date().toISOString()}])}async function Erl(t,e,r){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!bh(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=Sk(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}=s$c(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function _rl(t,e,r){if(!bh(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=Sk(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 vrl(t,e,r,n){if(!bh(e))return[];if(!r)return[];let o=Sk(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(A6r),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!A6r(f));return d.length===0?[]:zXi(Buffer.from(voo(d)),{limit:n.limit,offset:n.offset},u)}function HJi(t,e){let r=(0,pc.relative)(e,t),n=r.split(pc.sep);if(n[0]===".."||(0,pc.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 GJi,cZi,Awt,ywt,a_,lZi,dve,pc,uZi,dZi,fZi,hZi,mZi,gZi,CZi,bZi,eXi,g8r,tXi,sA,rXi,jL,E8r,gXi,Ixt,l_,soe,Co,G0,yXi,HL,IXi,RXi,R8r,kXi,QN,gve,PXi,DXi,NXi,MXi,jve,Hve,P8r,GL,Kie,ZFe,Dxt,h8e,Nxt,YXi,KXi,Iio,Jie,xio,nf,i7r,twt,Mio,Oio,s7r,a6r,Xio,too,roo,ky,doo,H8c,G8c,t8r,$8c,V8c,z8c,Y8c,y6r,Ht,K8c,WL,Z8c,X8c,e6c,ef,tf,t6c,r6c,n6c,$Ji,i6c,Nve,o6c,E6r,s6c,Mve,a6c,c6c,VJi,dwt,l6c,WJi,u6c,zJi,d6c,fwt,YJi,_6r,v6r,KJi,C6r,JJi,ZJi,f6c,XJi,p6c,h6c,m6c,g6c,A6c,y6c,E6c,_6c,v6c,C6c,b6c,S6c,T6c,I6c,x6c,w6c,R6c,k6c,$It,BYi,Ns,mc,hW,pwt,P6c,eZi,tZi,VIt,D6c,GN,N6c,M6c,rZi,O6c,hwt,mwt,b6r,gwt,S6r,L6c,nZi,B6c,F6c,U6c,Q6c,q6c,j6c,H6c,G6c,$6c,V6c,W6c,z6c,Y6c,K6c,J6c,T6r,Z6c,X6c,e9c,t9c,iZi,oZi,r9c,n9c,i9c,o9c,s9c,sZi,a9c,c9c,l9c,u9c,d9c,f9c,p9c,h9c,m9c,g9c,A9c,y9c,E9c,_9c,v9c,C9c,aZi,b9c,S9c,T9c,I9c,Ewt,w9c,R9c,k9c,P9c,D9c,n8r,R1,B9c,EZi,F9c,U9c,Ove,Q9c,lW,_Zi,q9c,j9c,TFe,G9c,$9c,V9c,z9c,Y9c,K9c,FYi,O8e,Y9,X9c,eUc,tUc,rUc,x6r,iUc,bFr,UYi,sUc,aUc,cUc,uUc,dUc,fUc,pUc,hUc,mUc,gUc,AUc,EUc,vUc,w6r,bUc,o8e,TUc,xUc,wUc,RUc,kUc,DUc,NUc,MUc,LUc,BUc,UUc,QYi,qUc,_wt,vwt,GUc,$Uc,WUc,YUc,JUc,XUc,Cwt,e7c,vZi,r7c,i7c,bwt,a7c,l7c,d7c,p7c,R6r,h7c,Py,Uve,SKh,SZi,i8r,Ri,Zv,DI,fve,WIt,zIt,YIt,KIt,JIt,ZIt,XIt,ext,txt,m7c,g7c,o8r,qYi,y7c,TZi,E7c,iW,_7c,C7c,HYi,GYi,$Yi,P6r,I7c,w7c,R7c,wZi,rxt,k7c,P7c,N6r,D7c,VYi,SFr,N7c,nu,a8r,tu,WYi,zYi,nxt,KYi,L7c,JYi,Gie,NZi,B7c,F7c,U7c,O6r,Q7c,OZi,RI,kI,Zie,IFe,Xie,c8r,WFe,ixt,CIt,oxt,l8r,eoe,c_,UZi,QZi,L6r,XYi,eQc,tQc,u8r,qZi,rQc,nQc,Sd,jZi,mr,eKi,aQc,$n,sxt,t8e,axt,cxt,lxt,uxt,a8e,dxt,fxt,pve,pxt,hxt,VZi,uQc,tve,dQc,fQc,YZi,fk,JV,z_e,xFe,bIt,wFe,RFe,SIt,kFe,Q9,PFe,TIt,IIt,Qie,xIt,wIt,DFe,TFr,rKi,RIt,IFr,xFr,wFr,nKi,iKi,f8r,mxt,pQc,hQc,NFe,Y_e,qie,Q0,w1,wI,$9,ZV,MFe,sKi,p8r,gxt,cKi,gQc,toe,Axt,yxt,hve,Ext,c8e,_xt,l8e,k1,vxt,pk,XV,K_e,OFe,kIt,LFe,BFe,PIt,FFe,q9,UFe,DIt,NIt,jie,MIt,OIt,QFe,RFr,dKi,kFr,PFr,DFr,NFr,fKi,pKi,h8r,Cxt,u8e,mKi,yQc,bxt,m8r,B6r,HIt,ZZi,EQc,_Qc,Mp,mve,CQc,bQc,A8r,TQc,zie,J_e,wQc,kQc,DQc,MQc,OQc,BQc,FQc,UQc,Txt,F6r,qQc,jQc,iXi,$Qc,WQc,qve,YQc,gKi,oXi,JQc,ZQc,XQc,d8e,eqc,uW,zFe,rqc,sXi,AKi,nqc,yKi,iqc,oqc,U6r,sqc,aqc,Swt,lqc,Q6r,dqc,fqc,pqc,hqc,mqc,gqc,Aqc,yqc,Eqc,_qc,vqc,Cqc,bqc,Sqc,Tqc,Iqc,xqc,wqc,Rqc,kqc,Pqc,Dqc,Nqc,Mqc,Cd,Lqc,Fqc,YFe,aXi,r8e,Uqc,MFr,Qqc,y8r,EKi,qqc,cXi,jqc,Hqc,$qc,Vqc,lXi,Yqc,q6r,Zqc,Xqc,ejc,rjc,uXi,KFe,dXi,_Ki,ijc,vKi,CKi,fXi,ajc,ljc,ujc,pXi,djc,bKi,pjc,mjc,SKi,gjc,Ajc,Ejc,_jc,j6r,Cjc,bjc,Tjc,Ijc,wjc,Rjc,kjc,Pjc,Djc,Mjc,Ojc,TKi,IKi,Ljc,Fjc,Twt,Qjc,H6r,Hjc,$jc,Wjc,Yjc,mXi,G6r,xxt,tHc,$6r,iHc,aHc,lHc,uHc,dHc,TKh,fHc,IKh,pHc,xKh,hHc,wKh,mHc,RKh,_8r,yHc,_Hc,xHc,wHc,kKh,PKh,MHc,wKi,RKi,OHc,LHc,kKi,v8r,UHc,QHc,C8r,qHc,_Xi,vXi,HHc,GHc,LIt,OFr,qFe,LFr,b8r,TXi,DKh,WHc,rf,$N,ZHc,wxt,PKi,T8r,Z_e,Rxt,sGc,I8r,x8r,z6r,Y6r,cGc,w8r,DKi,BFr,dGc,mGc,V9,AGc,f8e,vGc,CGc,bGc,Pxt,TGc,p8e,IGc,xGc,jGc,t$c,p$c,XXi,h$c,m$c,g$c,MKh,NKi,A$c,E$c,v$c,b$c,hc,MKi,kn,rW,hr,Ek,T$c,m8e,I$c,N8r,Xv,eo,XFe,P1,OKi,LKi,Ave,Mxt,Jn,vk,BKi,Ms,x$c,w$c,R$c,k$c,P$c,D$c,N$c,M$c,O$c,qFr,L$c,B$c,F$c,U$c,Q$c,q$c,eeo,j$c,yve,g8e,A8e,y8e,E8e,_8e,Eve,_ve,v8e,cW,$L,C8e,fW,OI,vve,H9,M8r,Cve,K9,L8r,b8e,S8e,B8r,bve,Sve,Tve,Ive,roe,qN,_k,J9,xve,wve,T8e,Oxt,Lxt,Rve,OKh,Cr,LKh,BKh,FKh,UKh,QKh,qKh,jKh,HKh,GKh,$Kh,VKh,WKh,zKh,YKh,Y$c,KKh,JKh,ZKh,XKh,eJh,tJh,rJh,nJh,iJh,oJh,sJh,aJh,cJh,lJh,uJh,dJh,fJh,pJh,hJh,neo,ieo,oeo,pW,Bxt,Ws,Z6r,ceo,oVc,Fxt,leo,deo,feo,F8r,heo,X6r,q8e,r9r,Uxt,n9r,Qxt,i9r,Nwt,o9r,Mwt,s9r,yeo,Eeo,_eo,veo,Ceo,beo,Seo,hVc,Teo,kve,mVc,gVc,AVc,Ieo,yVc,EVc,_Vc,vVc,CVc,weo,Reo,keo,Peo,Deo,a9r,Neo,bVc,Meo,Oeo,Leo,Qeo,qeo,jeo,Heo,Geo,$eo,Veo,Weo,zeo,Sh,Yeo,c9r,l9r,Keo,Jeo,Zeo,Xeo,eto,tto,rto,nto,ito,j8e,oto,sto,ato,cto,lto,uto,dto,fto,pto,qxt,hto,bo,H8e,Lu,mto,gto,Ato,yto,Eto,_to,vto,Cto,bto,Sto,Tto,Ito,xto,wto,Rto,kto,Pto,Dto,Nto,Mto,Lto,Bto,Uto,Qto,d9r,qto,f9r,p9r,jto,Hto,Gto,$to,Vto,jxt,Wto,zto,Yto,h9r,m9r,g9r,Kto,Jto,Owt,Zto,Xto,ero,tro,rro,nro,A9r,iro,oro,sro,aro,cro,lro,uro,dro,y9r,fro,pro,hro,mro,gro,E9r,SVc,IVc,wVc,kVc,DVc,MVc,LVc,BVc,FVc,UVc,qVc,HVc,$Vc,WVc,YVc,JVc,XVc,tWc,nWc,oWc,aWc,lWc,dWc,pWc,mWc,AWc,EWc,vWc,bWc,TWc,xWc,RWc,PWc,NWc,OWc,BWc,FWc,QWc,jWc,GWc,VWc,zWc,yro,Ero,w8e,W9,Cro,$xt,P8e,Azc,yzc,Ezc,G,rUr,nUr,iUr,oUr,sUr,fno,Czc,$8e,pno,hno,mno,gno,Os,aUr,Uwt,Td,cUr,Vxt,z9,lUr,uUr,dUr,fUr,pUr,hUr,mUr,gUr,AUr,yUr,EUr,_Ur,vUr,CUr,bUr,SUr,Ano,Qwt,Gve,qwt,jwt,TUr,yno,Eno,_no,vno,Cno,bno,Sno,xUr,Tno,Gwt,wUr,Ino,xno,wno,kUr,Rno,kno,D8e,Pno,Dno,PUr,NUr,Nno,Mno,Lno,MUr,Uno,Qno,jno,OUr,Hno,$no,Vno,zno,Vwt,yYc,_Yc,Xno,wYc,eio,tio,RYc,$ie,Wwt,H0,rio,nio,mJh,kYc,PYc,BUr,LI,V8e,DYc,Dy,Ck,bk,Ny,zwt,iio,XKi,oio,NYc,FUr,UIt,Bi,UUr,MYc,gJh,AJh,QUr,OYc,qUr,LYc,W8e,Dve,sio,BYc,FYc,UYc,QYc,qYc,jYc,aio,HYc,GYc,cio,jUr,$Yc,VYc,HUr,WYc,z8e,Y8e,zYc,K8e,Ywt,YYc,Yxt,GUr,$Ur,VUr,yJh,WUr,zUr,YUr,KYc,lio,uio,KUr,dio,J8e,$ve,fio,JYc,q8r,ZYc,j8r,XYc,JUr,eKc,H8r,tKc,rKc,nKc,iKc,oKc,sKc,aKc,cKc,lKc,uKc,G8r,dKc,fKc,$8r,ZUr,XUr,e7r,pKc,hKc,mKc,t7r,gKc,AKc,yKc,EKc,_Kc,pio,V8r,vKc,r7r,EJh,CKc,Kxt,bKc,_Jh,Jxt,SKc,hio,TKc,IKc,xKc,wKc,RKc,kKc,PKc,Zxt,DKc,NKc,MKc,n7r,mio,OKc,LKc,BKc,FKc,UKc,QKc,qKc,jKc,HKc,GKc,$Kc,VKc,WKc,zKc,YKc,KKc,JKc,ZKc,Xxt,XKc,eJc,tJc,W8r,iJc,oJc,sJc,gio,aJc,vJh,CJh,bJh,SJh,TJh,IJh,fi,z8r,cJc,eJi,lJc,uJc,yio,hJc,mJc,EJc,GFr,LN,CJc,ewt,rJi,MJc,OJc,qJc,jJc,HJc,GJc,$Jc,WJc,Y8r,YJc,KJc,K8r,J8r,Z8r,bio,cJi,tZc,X8r,e6r,iZc,HFe,fJi,lZc,gk,r6r,hJi,xJh,wJh,mJi,gJi,AJi,yJi,oW,o7r,ove,gZc,AZc,yZc,RJh,CZc,VFr,SZc,EJi,kJh,X_e,kio,i6r,Pio,rwt,_Ji,TZc,tW,Dio,lve,o6r,s6r,xZc,vJi,Jwt,Zwt,DJh,NJh,MJh,N8e,OJh,wZc,RZc,kZc,PZc,DZc,NZc,MZc,OZc,LJh,a7r,LZc,BZc,BJh,FJh,FZc,GFe,QZc,qZc,nwt,UJh,QJh,Vve,gW,jZc,HZc,Lio,GZc,$Zc,VZc,WZc,zZc,YZc,KZc,JZc,c6r,qJh,Bio,ZZc,XZc,HN,ooe,CJi,l6r,u6r,Fio,c7r,tXc,jJh,rXc,nXc,iXc,oXc,sXc,Uio,Qio,aXc,bJi,cXc,lXc,qio,uXc,dXc,SJi,fXc,pXc,jio,hXc,Hio,mXc,gXc,AXc,iwt,WFr,Gio,yXc,EXc,_Xc,vXc,CXc,HJh,$io,SXc,TXc,IXc,xXc,wXc,RXc,kXc,GJh,PXc,$Jh,DXc,NXc,MXc,QIt,Xwt,TJi,Wio,VJh,WJh,owt,YFr,WXc,zJh,zXc,Jio,Zio,YXc,IJi,Wve,G9,JXc,ZXc,YJh,rel,iel,PJi,d6r,f6r,sve,sel,ael,cel,DJi,swt,uel,nW,noo,ioo,ooo,awt,p6r,bel,Sel,Tel,xel,wel,Rel,kel,soo,Pel,Del,Mel,h6r,Bel,Uel,Qel,jel,LJi,coo,$el,Vel,Wel,zel,Yel,Kel,Zel,Xel,loo,ttl,ntl,otl,stl,sW,ctl,utl,ftl,BJi,htl,mtl,Atl,Etl,_tl,JFr,vtl,ZFr,Ctl,e8r,jtl,UJi,Htl,Gtl,$tl,Ztl,Too=ve(()=>{p();GJi=require("node:module"),cZi=require("child_process"),Awt=require("crypto"),ywt=require("fs"),a_=require("fs/promises"),lZi=require("module"),dve=require("os"),pc=require("path"),uZi=require("readline"),dZi=require("url"),fZi=require("events"),hZi=require("child_process"),mZi=require("fs"),gZi=require("readline"),CZi=require("os"),bZi=require("path"),eXi=require("crypto"),g8r=require("path"),tXi=require("async_hooks"),sA=require("fs/promises"),rXi=require("crypto"),jL=require("fs/promises"),E8r=require("fs"),gXi=require("process"),Ixt=require("crypto"),l_=require("fs/promises"),soe=require("path"),Co=de(require("fs"),1),G0=require("fs/promises"),yXi=require("fs"),HL=require("path"),IXi=require("fs"),RXi=require("fs/promises"),R8r=require("events"),kXi=require("fs"),QN=require("fs/promises"),gve=require("path"),PXi=require("child_process"),DXi=require("util"),NXi=require("child_process"),MXi=require("path"),jve=require("fs/promises"),Hve=require("path"),P8r=require("fs"),GL=require("fs/promises"),Kie=require("path"),ZFe=require("crypto"),Dxt=require("path"),h8e=require("fs/promises"),Nxt=require("path"),YXi=require("crypto"),KXi=require("os"),Iio=require("path"),Jie=require("path"),xio=require("path"),nf=de(require("node:path"),1),i7r=de(require("node:os"),1),twt=de(require("node:process"),1),Mio=require("path"),Oio=require("fs/promises"),s7r=require("os"),a6r=require("path"),Xio=require("os"),too=require("child_process"),roo=require("fs"),ky=require("path"),doo=require("path"),H8c=Object.create,{getPrototypeOf:G8c,defineProperty:t8r,getOwnPropertyNames:$8c}=Object,V8c=Object.prototype.hasOwnProperty;a(W8c,"a_");y6r=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?z8c??=new WeakMap:Y8c??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?H8c(G8c(t)):{};let c=e||!t||!t.__esModule?t8r(r,"default",{value:t,enumerable:!0}):r;for(let l of $8c(t))V8c.call(c,l)||t8r(c,l,{get:W8c.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),Ht=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),K8c=a(t=>t,"$k");a(J8c,"Qk");WL=a((t,e)=>{for(var r in e)t8r(t,r,{get:e[r],enumerable:!0,configurable:!0,set:J8c.bind(e,r)})},"M4"),Z8c=(0,GJi.createRequire)(importMetaUrlShim),X8c=Symbol.dispose||Symbol.for("Symbol.dispose"),e6c=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),ef=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[e6c]),n===void 0&&(n=e[X8c]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),tf=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$"),t6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),r6c=Ht(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(t6c(),t)}),n6c=Ht(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(r6c(),t)}),$Ji=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),i6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=$Ji(),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)}),Nve=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=n6c(),r=$Ji(),n=i6c(),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 E=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${f}`);return m.error(E.stack||E.message),!1}if(y.version!==r.VERSION){let E=Error(`@opentelemetry/api: Registration of version v${y.version} for ${f} does not match previously registered API v${r.VERSION}`);return m.error(E.stack||E.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}),o6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=Nve();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")}),E6r=Ht(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={}))}),s6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=E6r();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}),Mve=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=o6c(),r=s6c(),n=E6r(),o=Nve(),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 E=(0,o.getGlobal)("diag"),_=(0,r.createLogLevelDiagLogger)((A=m.logLevel)!==null&&A!==void 0?A:n.DiagLogLevel.INFO,h);if(E&&!m.suppressOverrideMessage){let v=(y=Error().stack)!==null&&y!==void 0?y:"";E.warn(`Current logger will be overwritten from ${v}`),_.warn(`Current logger will overwrite one already registered from ${v}`)}return(0,o.registerGlobal)("diag",_,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}),a6c=Ht(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}),c6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),VJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=Mve(),r=a6c(),n=c6c(),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}),dwt=Ht(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}),l6c=Ht(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}),u6c=Ht(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={}))}),zJi=Ht(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)}}}),d6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=dwt();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}),fwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=d6c(),r=Nve(),n=Mve(),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}),YJi=Ht(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={}))}),_6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=YJi();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),v6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=_6r();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}),KJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=dwt(),r=v6r(),n=fwt(),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}),C6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=_6r(),r=v6r(),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}),JJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=fwt(),r=KJi(),n=v6r(),o=C6r(),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 E=A??s.active(),_=this.startSpan(d,g,E),v=(0,r.setSpan)(E,_);return s.with(v,y,void 0,_)}}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")}),ZJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=JJi(),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}),f6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=JJi();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),XJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=ZJi(),r=f6c(),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}),p6c=Ht(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={}))}),h6c=Ht(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={}))}),m6c=Ht(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={}))}),g6c=Ht(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}),A6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=g6c(),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}),y6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=A6c();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),E6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=fwt();t.context=e.ContextAPI.getInstance()}),_6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=Mve();t.diag=e.DiagAPI.instance()}),v6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=WJi();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),C6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=v6c(),r=Nve(),n=Mve(),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}),b6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=C6c();t.metrics=e.MetricsAPI.getInstance()}),S6c=Ht(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}),T6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=fwt(),r=dwt(),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}),I6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=Nve(),r=S6c(),n=zJi(),o=T6c(),s=VJi(),c=Mve(),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}),x6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=I6c();t.propagation=e.PropagationAPI.getInstance()}),w6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=Nve(),r=XJi(),n=C6r(),o=KJi(),s=Mve(),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}),R6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=w6c();t.trace=e.TraceAPI.getInstance()}),k6c=Ht(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=VJi();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=dwt();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=l6c();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=E6r();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=WJi();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=u6c();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=zJi();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=ZJi();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=XJi();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=p6c();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=h6c();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=m6c();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=YJi();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=y6c();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=C6r();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 E=_6r();Object.defineProperty(t,"INVALID_SPANID",{enumerable:!0,get:a(function(){return E.INVALID_SPANID},"get")}),Object.defineProperty(t,"INVALID_TRACEID",{enumerable:!0,get:a(function(){return E.INVALID_TRACEID},"get")}),Object.defineProperty(t,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:a(function(){return E.INVALID_SPAN_CONTEXT},"get")});var _=E6c();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return _.context},"get")});var v=_6c();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var b=b6c();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return b.metrics},"get")});var T=x6c();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=R6c();Object.defineProperty(t,"trace",{enumerable:!0,get:a(function(){return w.trace},"get")}),t.default={context:_.context,diag:v.diag,metrics:b.metrics,propagation:T.propagation,trace:w.trace}}),$It=Ht(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((b,T)=>`${b}${T}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((b,T)=>(T instanceof r&&(b[T.str]=(b[T.str]||0)+1),b),{})}}t._Code=n,t.nil=new n("");function o(_,...v){let b=[_[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=$It();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 E=this._scope[g]||(this._scope[g]=[]),_=E.length;return E[_]=f.ref,m.setValue(f,{property:g,itemIndex:_}),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 E=h[A]=h[A]||new Map;y.forEach(_=>{if(E.has(_))return;E.set(_,n.Started);let v=f(_);if(v){let b=this.opts.es5?t.varKinds.var:t.varKinds.const;g=e._`${g}${b} ${_} = ${v};${this.opts._n}`}else if(v=m?.(_))g=e._`${g}${v}${this.opts._n}`;else throw new r(_);E.set(_,n.Completed)})}return g}}t.ValueScope=l}),Ns=Ht(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=$It(),r=BYi(),n=$It();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=BYi();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 ge=le[Le];ge.optimizeNames(H,re)||(O(H,ge.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 E extends A{static{a(this,"RJ")}}E.kind="else";class _ 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 E(le):le}if(re)return H===!1?re instanceof _?re:re.nodes:this.nodes.length?this:new _(j(H),re instanceof _?[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}}_.kind="if";class v extends A{static{a(this,"q9")}}v.kind="for";class b 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:ge}=this;return`for(${re} ${le}=${Le}; ${le}<${ge}; ${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 P 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 L{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 ge=this._scope.toName(re);return le!==void 0&&Le&&(this._constants[ge.str]=le),this._leafNode(new c(H,ge,le)),ge}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 _(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 _(H))}else(){return this._elseNode(new E)}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 b(H),re)}forRange(H,re,le,Le,ge=this.opts.es5?r.varKinds.var:r.varKinds.let){let Ue=this._scope.toName(H);return this._for(new T(ge,Ue,re,le),()=>Le(Ue))}forOf(H,re,le,Le=r.varKinds.const){let ge=this._scope.toName(H);if(this.opts.es5){let Ue=re instanceof e.Name?re:this.var("_arr",re);return this.forRange("_i",0,e._`${Ue}.length`,ke=>{this.var(ge,e._`${Ue}[${ke}]`),le(ge)})}return this._for(new w("of",Le,ge,re),()=>le(ge))}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 ge=this._scope.toName(H);return this._for(new w("in",Le,ge,re),()=>le(ge))}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 P;if(this._blockNode(Le),this.code(H),re){let ge=this.name("e");this._currNode=Le.catch=new D(ge),re(ge)}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 _))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=L;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((ge,Ue)=>(Ue instanceof e.Name&&(Ue=le(Ue)),Ue instanceof e._Code?ge.push(...Ue._items):ge.push(Ue),ge),[]));function le(ge){let Ue=re[ge.str];return Ue===void 0||H[ge.str]!==1?ge:(delete H[ge.str],Ue)}function Le(ge){return ge instanceof e._Code&&ge._items.some(Ue=>Ue instanceof e.Name&&H[Ue.str]===1&&re[Ue.str]!==void 0)}}a(M,"V9");function O(ie,H){for(let re in H)ie[re]=(ie[re]||0)-(H[re]||0)}a(O,"dp");function j(ie){return typeof ie=="boolean"||typeof ie=="number"||ie===null?!ie:e._`!${z(ie)}`}a(j,"vj"),t.not=j;var Q=V(t.operators.AND);function U(...ie){return ie.reduce(Q)}a(U,"np"),t.and=U;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")}),mc=Ht(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=Ns(),r=$It();function n(R){let x={};for(let P of R)x[P]=!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:P,self:D}=R;if(!P.strictSchema||typeof x=="boolean")return;let N=D.RULES.keywords;for(let L in x)N[L]||w(R,`unknown keyword: "${L}"`)}a(s,"fj"),t.checkUnknownRules=s;function c(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(x[P])return!0;return!1}a(c,"gj"),t.schemaHasRules=c;function l(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(P!=="$ref"&&x.all[P])return!0;return!1}a(l,"Jd"),t.schemaHasRulesButRef=l;function u({topSchemaRef:R,schemaPath:x},P,D,N){if(!N){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return e._`${P}`}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 P of R)x(P);else x(R)}a(g,"Gd"),t.eachItem=g;function A({mergeNames:R,mergeToName:x,mergeValues:P,resultToName:D}){return(N,L,B,q)=>{let M=B===void 0?L:B instanceof e.Name?(L instanceof e.Name?R(N,L,B):x(N,L,B),B):L instanceof e.Name?(x(N,B,L),L):P(L,B);return q===e.Name&&!(M instanceof e.Name)?D(N,M):M}}a(A,"xj"),t.mergeEvaluated={props:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>{R.if(e._`${x} === true`,()=>R.assign(P,!0),()=>R.assign(P,e._`${P} || {}`).code(e._`Object.assign(${P}, ${x})`))}),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>{x===!0?R.assign(P,!0):(R.assign(P,e._`${P} || {}`),E(R,P,x))}),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:{...R,...x},"mergeValues"),resultToName:y}),items:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>R.assign(P,e._`${x} === true ? true : ${P} > ${x} ? ${P} : ${x}`)),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>R.assign(P,x===!0?!0:e._`${P} > ${x} ? ${P} : ${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 P=R.var("props",e._`{}`);return x!==void 0&&E(R,P,x),P}a(y,"uj"),t.evaluatedPropsToName=y;function E(R,x,P){Object.keys(P).forEach(D=>R.assign(e._`${x}${(0,e.getProperty)(D)}`,!0))}a(E,"DB"),t.setEvaluated=E;var _={};function v(R,x){return R.scopeValue("func",{ref:x,code:_[x.code]||(_[x.code]=new r._Code(x.code))})}a(v,"Ud"),t.useFunc=v;var b;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(b||(t.Type=b={}));function T(R,x,P){if(R instanceof e.Name){let D=x===b.Num;return P?D?e._`"[" + ${R} + "]"`:e._`"['" + ${R} + "']"`:D?e._`"/" + ${R}`:e._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(R).toString():"/"+h(R)}a(T,"Hd"),t.getErrorPath=T;function w(R,x,P=R.opts.strictSchema){if(P){if(x=`strict mode: ${x}`,P===!0)throw Error(x);R.self.logger.warn(x)}}a(w,"mj"),t.checkStrictMode=w}),hW=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),pwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Ns(),r=mc(),n=hW();t.keywordError={message:a(({keyword:E})=>e.str`must pass "${E}" keyword validation`,"message")},t.keyword$DataError={message:a(({keyword:E,schemaType:_})=>_?e.str`"${E}" keyword must be ${_} ($data)`:e.str`"${E}" keyword is invalid ($data)`,"message")};function o(E,_=t.keywordError,v,b){let{it:T}=E,{gen:w,compositeRule:R,allErrors:x}=T,P=h(E,_,v);b??(R||x)?u(w,P):d(T,e._`[${P}]`)}a(o,"bd"),t.reportError=o;function s(E,_=t.keywordError,v){let{it:b}=E,{gen:T,compositeRule:w,allErrors:R}=b,x=h(E,_,v);u(T,x),!(w||R)&&d(b,n.default.vErrors)}a(s,"_d"),t.reportExtraError=s;function c(E,_){E.assign(n.default.errors,_),E.if(e._`${n.default.vErrors} !== null`,()=>E.if(_,()=>E.assign(e._`${n.default.vErrors}.length`,_),()=>E.assign(n.default.vErrors,null)))}a(c,"kd"),t.resetErrorsCount=c;function l({gen:E,keyword:_,schemaValue:v,data:b,errsCount:T,it:w}){if(T===void 0)throw Error("ajv implementation error");let R=E.name("err");E.forRange("i",T,n.default.errors,x=>{E.const(R,e._`${n.default.vErrors}[${x}]`),E.if(e._`${R}.instancePath === undefined`,()=>E.assign(e._`${R}.instancePath`,(0,e.strConcat)(n.default.instancePath,w.errorPath))),E.assign(e._`${R}.schemaPath`,e.str`${w.errSchemaPath}/${_}`),w.opts.verbose&&(E.assign(e._`${R}.schema`,v),E.assign(e._`${R}.data`,b))})}a(l,"Sd"),t.extendErrors=l;function u(E,_){let v=E.const("err",_);E.if(e._`${n.default.vErrors} === null`,()=>E.assign(n.default.vErrors,e._`[${v}]`),e._`${n.default.vErrors}.push(${v})`),E.code(e._`${n.default.errors}++`)}a(u,"dj");function d(E,_){let{gen:v,validateName:b,schemaEnv:T}=E;T.$async?v.throw(e._`new ${E.ValidationError}(${_})`):(v.assign(e._`${b}.errors`,_),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:b}=E.it;return b===!1?e._`{}`:m(E,_,v)}a(h,"nj");function m(E,_,v={}){let{gen:b,it:T}=E,w=[g(T,v),A(E,v)];return y(E,_,w),b.object(...w)}a(m,"vd");function g({errorPath:E},{instancePath:_}){let v=_?e.str`${E}${(0,r.getErrorPath)(_,r.Type.Str)}`:E;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,v)]}a(g,"Cd");function A({keyword:E,it:{errSchemaPath:_}},{schemaPath:v,parentSchema:b}){let T=b?_:e.str`${_}/${E}`;return v&&(T=e.str`${T}${(0,r.getErrorPath)(v,r.Type.Str)}`),[f.schemaPath,T]}a(A,"Td");function y(E,{params:_,message:v},b){let{keyword:T,data:w,schemaValue:R,it:x}=E,{opts:P,propertyName:D,topSchemaRef:N,schemaPath:L}=x;b.push([f.keyword,T],[f.params,typeof _=="function"?_(E):_||e._`{}`]),P.messages&&b.push([f.message,typeof v=="function"?v(E):v]),P.verbose&&b.push([f.schema,R],[f.parentSchema,e._`${N}${L}`],[n.default.data,w]),D&&b.push([f.propertyName,D])}a(y,"xd")}),P6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=pwt(),r=Ns(),n=hW(),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")}),eZi=Ht(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}),tZi=Ht(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}),VIt=Ht(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=eZi(),r=tZi(),n=pwt(),o=Ns(),s=mc(),c;(function(b){b[b.Correct=0]="Correct",b[b.Wrong=1]="Wrong"})(c||(t.DataType=c={}));function l(b){let T=u(b.type);if(T.includes("null")){if(b.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!T.length&&b.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');b.nullable===!0&&T.push("null")}return T}a(l,"Yi"),t.getSchemaTypes=l;function u(b){let T=Array.isArray(b)?b:b?[b]:[];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(b,T){let{gen:w,data:R,opts:x}=b,P=h(T,x.coerceTypes),D=T.length>0&&!(P.length===0&&T.length===1&&(0,r.schemaHasRulesForType)(b,T[0]));if(D){let N=y(T,R,x.strictNumbers,c.Wrong);w.if(N,()=>{P.length?m(b,T,P):_(b)})}return D}a(d,"Wi"),t.coerceAndCheckDataType=d;var f=new Set(["string","number","integer","boolean","null"]);function h(b,T){return T?b.filter(w=>f.has(w)||T==="array"&&w==="array"):[]}a(h,"Gi");function m(b,T,w){let{gen:R,data:x,opts:P}=b,D=R.let("dataType",o._`typeof ${x}`),N=R.let("coerced",o._`undefined`);P.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,P.strictNumbers),()=>R.assign(N,x))),R.if(o._`${N} !== undefined`);for(let B of w)(f.has(B)||B==="array"&&P.coerceTypes==="array")&&L(B);R.else(),_(b),R.endIf(),R.if(o._`${N} !== undefined`,()=>{R.assign(x,N),g(b,N)});function L(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(L,"H")}a(m,"Ui");function g({gen:b,parentData:T,parentDataProperty:w},R){b.if(o._`${T} !== undefined`,()=>b.assign(o._`${T}[${w}]`,R))}a(g,"Hi");function A(b,T,w,R=c.Correct){let x=R===c.Correct?o.operators.EQ:o.operators.NEQ,P;switch(b){case"null":return o._`${T} ${x} null`;case"array":P=o._`Array.isArray(${T})`;break;case"object":P=o._`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":P=D(o._`!(${T} % 1) && !isNaN(${T})`);break;case"number":P=D();break;default:return o._`typeof ${T} ${x} ${b}`}return R===c.Correct?P:(0,o.not)(P);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(b,T,w,R){if(b.length===1)return A(b[0],T,w,R);let x,P=(0,s.toHash)(b);if(P.array&&P.object){let D=o._`typeof ${T} != "object"`;x=P.null?D:o._`!${T} || ${D}`,delete P.null,delete P.array,delete P.object}else x=o.nil;P.number&&delete P.integer;for(let D in P)x=(0,o.and)(x,A(D,T,w,R));return x}a(y,"jB"),t.checkDataTypes=y;var E={message:a(({schema:b})=>`must be ${b}`,"message"),params:a(({schema:b,schemaValue:T})=>typeof b=="string"?o._`{type: ${b}}`:o._`{type: ${T}}`,"params")};function _(b){let T=v(b);(0,n.reportError)(T,E)}a(_,"AB"),t.reportTypeError=_;function v(b){let{gen:T,data:w,schema:R}=b,x=(0,s.schemaRefOrVal)(b,R,"type");return{gen:T,keyword:"type",data:w,schema:R.type,schemaCode:x,schemaValue:x,parentSchema:R,params:{},it:b}}a(v,"qi")}),I6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Ns(),r=mc();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")}),HN=Ht(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=Ns(),r=mc(),n=pW(),o=mc();function s(b,T){let{gen:w,data:R,it:x}=b;w.if(h(w,R,T,x.opts.ownProperties),()=>{b.setParams({missingProperty:e._`${T}`},!0),b.error()})}a(s,"Mi"),t.checkReportMissingProp=s;function c({gen:b,data:T,it:{opts:w}},R,x){return(0,e.or)(...R.map(P=>(0,e.and)(h(b,T,P,w.ownProperties),e._`${x} = ${P}`)))}a(c,"Li"),t.checkMissingProp=c;function l(b,T){b.setParams({missingProperty:T},!0),b.error()}a(l,"ji"),t.reportMissingProp=l;function u(b){return b.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}a(u,"wA"),t.hasPropFunc=u;function d(b,T,w){return e._`${u(b)}.call(${T}, ${w})`}a(d,"RB"),t.isOwnProperty=d;function f(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} !== undefined`;return R?e._`${x} && ${d(b,T,w)}`:x}a(f,"Ai"),t.propertyInData=f;function h(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} === undefined`;return R?(0,e.or)(x,(0,e.not)(d(b,T,w))):x}a(h,"PB"),t.noPropertyInData=h;function m(b){return b?Object.keys(b).filter(T=>T!=="__proto__"):[]}a(m,"OA"),t.allSchemaProperties=m;function g(b,T){return m(T).filter(w=>!(0,r.alwaysValidSchema)(b,T[w]))}a(g,"Ii"),t.schemaProperties=g;function A({schemaCode:b,data:T,it:{gen:w,topSchemaRef:R,schemaPath:x,errorPath:P},it:D},N,L,B){let q=B?e._`${b}, ${T}, ${R}${x}`:T,M=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,P)],[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 O=e._`${q}, ${w.object(...M)}`;return L!==e.nil?e._`${N}.call(${L}, ${O})`:e._`${N}(${O})`}a(A,"Ri"),t.callValidateCode=A;var y=e._`new RegExp`;function E({gen:b,it:{opts:T}},w){let R=T.unicodeRegExp?"u":"",{regExp:x}=T.code,P=x(w,R);return b.scopeValue("pattern",{key:P.toString(),ref:P,code:e._`${x.code==="new RegExp"?y:(0,o.useFunc)(b,x)}(${w}, ${R})`})}a(E,"Ei"),t.usePattern=E;function _(b){let{gen:T,data:w,keyword:R,it:x}=b,P=T.name("valid");if(x.allErrors){let N=T.let("valid",!0);return D(()=>T.assign(N,!1)),N}return T.var(P,!0),D(()=>T.break()),P;function D(N){let L=T.const("len",e._`${w}.length`);T.forRange("i",0,L,B=>{b.subschema({keyword:R,dataProp:B,dataPropType:r.Type.Num},P),T.if((0,e.not)(P),N)})}}a(_,"bi"),t.validateArray=_;function v(b){let{gen:T,schema:w,keyword:R,it:x}=b;if(!Array.isArray(w))throw Error("ajv implementation error");if(w.some(N=>(0,r.alwaysValidSchema)(x,N))&&!x.opts.unevaluated)return;let P=T.let("valid",!1),D=T.name("_valid");T.block(()=>w.forEach((N,L)=>{let B=b.subschema({keyword:R,schemaProp:L,compositeRule:!0},D);T.assign(P,e._`${P} || ${D}`),!b.mergeValidEvaluated(B,D)&&T.if((0,e.not)(P))})),b.result(P,()=>b.reset(),()=>b.error(!0))}a(v,"_i"),t.validateUnion=v}),x6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Ns(),r=pW(),n=HN(),o=fwt();function s(g,A){let{gen:y,keyword:E,schema:_,parentSchema:v,it:b}=g,T=A.macro.call(b.self,_,v,b),w=f(y,E,T);b.opts.validateSchema!==!1&&b.self.validateSchema(T,!0);let R=y.name("valid");g.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${b.errSchemaPath}/${E}`,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:E,keyword:_,schema:v,parentSchema:b,$data:T,it:w}=g;d(w,A);let R=!T&&A.compile?A.compile.call(w.self,v,b,w):A.validate,x=f(E,_,R),P=E.let("valid");g.block$data(P,D),g.ok((y=A.valid)!==null&&y!==void 0?y:P);function D(){if(A.errors===!1)B(),A.modifying&&l(g),q(()=>g.error());else{let M=A.async?N():L();A.modifying&&l(g),q(()=>u(g,M))}}a(D,"z");function N(){let M=E.let("ruleErrs",null);return E.try(()=>B(e._`await `),O=>E.assign(P,!1).if(e._`${O} instanceof ${w.ValidationError}`,()=>E.assign(M,e._`${O}.errors`),()=>E.throw(O))),M}a(N,"N");function L(){let M=e._`${x}.errors`;return E.assign(M,null),B(e.nil),M}a(L,"w");function B(M=A.async?e._`await `:e.nil){let O=w.opts.passContext?r.default.this:r.default.self,j=!("compile"in A&&!T||A.schema===!1);E.assign(P,e._`${M}${(0,n.callValidateCode)(g,x,O,j)}`,A.modifying)}a(B,"O");function q(M){var O;E.if((0,e.not)((O=A.valid)!==null&&O!==void 0?O:P),M)}a(q,"D")}a(c,"di"),t.funcKeywordCode=c;function l(g){let{gen:A,data:y,it:E}=g;A.if(E.parentData,()=>A.assign(y,e._`${E.parentData}[${E.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(E=>E==="array"?Array.isArray(g):E==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==E||y&&typeof g>"u")}a(h,"ri"),t.validSchemaType=h;function m({schema:g,opts:A,self:y,errSchemaPath:E},_,v){if(Array.isArray(_.keyword)?!_.keyword.includes(v):_.keyword!==v)throw Error("ajv implementation error");let b=_.dependencies;if(b?.some(T=>!Object.prototype.hasOwnProperty.call(g,T)))throw Error(`parent schema must have dependencies of ${v}: ${b.join(",")}`);if(_.validateSchema&&!_.validateSchema(g[v])){let T=`keyword "${v}" value is invalid at path "${E}": `+y.errorsText(_.validateSchema.errors);if(A.validateSchema==="log")y.logger.error(T);else throw Error(T)}}a(m,"oi"),t.validateKeywordUsage=m}),w6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Ns(),r=mc();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:E,opts:_}=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,_.jsPropertySyntax)}`,c.parentDataProperty=e._`${u}`,c.dataPathArr=[...E,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}),ZJi=Ht((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},"$")}),R6c=Ht((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 E=u[y];if(Array.isArray(E)){if(y in r.arrayKeywords)for(var _=0;_{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;var e=mc(),r=ZJi(),n=R6c(),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 E=="boolean"?!0:_===!0?!l(E):_?u(E)<=_:!1}a(s,"Kn"),t.inlineRef=s;var c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(E){for(let _ in E){if(c.has(_))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(E){let _=0;for(let v in E){if(v==="$ref")return 1/0;if(_++,!o.has(v)&&(typeof E[v]=="object"&&(0,e.eachItem)(E[v],b=>_+=u(b)),_===1/0))return 1/0}return _}a(u,"SA");function d(E,_="",v){v!==!1&&(_=m(_));let b=E.parse(_);return f(E,b)}a(d,"vA"),t.getFullPath=d;function f(E,_){return E.serialize(_).split("#")[0]+"#"}a(f,"CA"),t._getFullPath=f;var h=/#\/?$/;function m(E){return E?E.replace(h,""):""}a(m,"N9"),t.normalizeId=m;function g(E,_,v){return v=m(v),E.resolve(_,v)}a(g,"Bn"),t.resolveUrl=g;var A=/^[a-z_][-a-z0-9._]*$/i;function y(E,_){if(typeof E=="boolean")return{};let{schemaId:v,uriResolver:b}=this.opts,T=m(E[v]||_),w={"":T},R=d(b,T,!1),x={},P=new Set;return n(E,{allKeys:!0},(L,B,q,M)=>{if(M===void 0)return;let O=R+B,j=w[M];typeof L[v]=="string"&&(j=Q.call(this,L[v])),U.call(this,L.$anchor),U.call(this,L.$dynamicAnchor),w[B]=j;function Q(Y){let W=this.opts.uriResolver.resolve;if(Y=m(j?W(j,Y):Y),P.has(Y))throw N(Y);P.add(Y);let V=this.refs[Y];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?D(L,V.schema,Y):Y!==m(O)&&(Y[0]==="#"?(D(L,x[Y],Y),x[Y]=L):this.refs[Y]=O),Y}a(Q,"M");function U(Y){if(typeof Y=="string"){if(!A.test(Y))throw Error(`invalid anchor "${Y}"`);Q.call(this,`#${Y}`)}}a(U,"j")}),x;function D(L,B,q){if(B!==void 0&&!r(L,B))throw N(q)}function N(L){return Error(`reference "${L}" resolves to more than one schema`)}}a(y,"Nn"),t.getSchemaRefs=y}),hwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=T6c(),r=$It(),n=JJi(),o=$It(),s=I6c(),c=x6c(),l=w6c(),u=Ns(),d=pW(),f=pwt(),h=mc(),m=fwt();function g(ee){if(R(ee)&&(P(ee),w(ee))){_(ee);return}A(ee,()=>(0,e.topBoolOrEmptySchema)(ee))}a(g,"jn"),t.validateFunctionCode=g;function A({gen:ee,validateName:K,schema:he,schemaEnv:Z,opts:ue},qe){ue.code.es5?ee.func(K,u._`${d.default.data}, ${d.default.valCxt}`,Z.$async,()=>{ee.code(u._`"use strict"; ${b(he,ue)}`),E(ee,ue),ee.code(qe)}):ee.func(K,u._`${d.default.data}, ${y(ue)}`,Z.$async,()=>ee.code(b(he,ue)).code(qe))}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 E(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(E,"In");function _(ee){let{schema:K,opts:he,gen:Z}=ee;A(ee,()=>{he.$comment&&K.$comment&&M(ee),L(ee),Z.let(d.default.vErrors,null),Z.let(d.default.errors,0),he.unevaluated&&v(ee),D(ee),O(ee)})}a(_,"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 b(ee,K){let he=typeof ee=="object"&&ee[K.schemaId];return he&&(K.code.source||K.code.process)?u._`/*# sourceURL=${he} */`:u.nil}a(b,"fA");function T(ee,K){if(R(ee)&&(P(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:Z,opts:ue}=ee;ue.$comment&&he.$comment&&M(ee),B(ee),q(ee);let qe=Z.const("_errs",d.default.errors);D(ee,qe),Z.var(K,u._`${qe} === ${d.default.errors}`)}a(x,"bn");function P(ee){(0,h.checkUnknownRules)(ee),N(ee)}a(P,"pA");function D(ee,K){if(ee.opts.jtd)return Q(ee,[],!1,K);let he=(0,r.getSchemaTypes)(ee.schema),Z=(0,r.coerceAndCheckDataType)(ee,he);Q(ee,he,!Z,K)}a(D,"dA");function N(ee){let{schema:K,errSchemaPath:he,opts:Z,self:ue}=ee;K.$ref&&Z.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(K,ue.RULES)&&ue.logger.warn(`$ref: keywords ignored in schema at path "${he}"`)}a(N,"_n");function L(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(L,"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:Z,opts:ue}){let qe=he.$comment;if(ue.$comment===!0)ee.code(u._`${d.default.self}.logger.log(${qe})`);else if(typeof ue.$comment=="function"){let ne=u.str`${Z}/$comment`,ce=ee.scopeValue("root",{ref:K.root});ee.code(u._`${d.default.self}.opts.$comment(${qe}, ${ne}, ${ce}.schema)`)}}a(M,"iA");function O(ee){let{gen:K,schemaEnv:he,validateName:Z,ValidationError:ue,opts:qe}=ee;he.$async?K.if(u._`${d.default.errors} === 0`,()=>K.return(d.default.data),()=>K.throw(u._`new ${ue}(${d.default.vErrors})`)):(K.assign(u._`${Z}.errors`,d.default.vErrors),qe.unevaluated&&j(ee),K.return(u._`${d.default.errors} === 0`))}a(O,"Cn");function j({gen:ee,evaluated:K,props:he,items:Z}){he instanceof u.Name&&ee.assign(u._`${K}.props`,he),Z instanceof u.Name&&ee.assign(u._`${K}.items`,Z)}a(j,"Tn");function Q(ee,K,he,Z){let{gen:ue,schema:qe,data:ne,allErrors:ce,opts:Ne,self:we}=ee,{RULES:Be}=we;if(qe.$ref&&(Ne.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(qe,Be))){ue.block(()=>ge(ee,"$ref",Be.all.$ref.definition));return}Ne.jtd||Y(ee,K),ue.block(()=>{for(let st of Be.rules)rt(st);rt(Be.post)});function rt(st){(0,n.shouldUseGroup)(qe,st)&&(st.type?(ue.if((0,o.checkDataType)(st.type,ne,Ne.strictNumbers)),U(ee,st),K.length===1&&K[0]===st.type&&he&&(ue.else(),(0,o.reportTypeError)(ee)),ue.endIf()):U(ee,st),ce||ue.if(u._`${d.default.errors} === ${Z||0}`))}a(rt,"B")}a(Q,"gA");function U(ee,K){let{gen:he,schema:Z,opts:{useDefaults:ue}}=ee;ue&&(0,s.assignDefaults)(ee,K.type),he.block(()=>{for(let qe of K.rules)(0,n.shouldUseRule)(Z,qe)&&ge(ee,qe.keyword,qe.definition,K.type)})}a(U,"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 Z in he){let ue=he[Z];if(typeof ue=="object"&&(0,n.shouldUseRule)(ee.schema,ue)){let{type:qe}=ue.definition;qe.length&&!qe.some(ne=>ie(K,ne))&&le(ee,`missing type "${qe.join(",")}" for keyword "${Z}"`)}}}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 Z of ee.dataTypes)H(K,Z)?he.push(Z):K.includes("integer")&&Z==="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,Z){if((0,c.validateKeywordUsage)(K,he,Z),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=Z,this.data=K.data,this.schema=K.schema[Z],this.$data=he.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(K,this.schema,Z,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",X(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,he.schemaType,he.allowUndefined))throw Error(`${Z} 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,Z){this.failResult((0,u.not)(K),he,Z)}failResult(K,he,Z){this.gen.if(K),Z?Z():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,Z){if(he){this.setParams(he),this._error(K,Z),this.setParams({});return}this._error(K,Z)}_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,Z=u.nil){this.gen.block(()=>{this.check$data(K,Z),he()})}check$data(K=u.nil,he=u.nil){if(!this.$data)return;let{gen:Z,schemaCode:ue,schemaType:qe,def:ne}=this;Z.if((0,u.or)(u._`${ue} === undefined`,he)),K!==u.nil&&Z.assign(K,!0),(qe.length||ne.validateSchema)&&(Z.elseIf(this.invalid$data()),this.$dataError(),K!==u.nil&&Z.assign(K,!1)),Z.else()}invalid$data(){let{gen:K,schemaCode:he,schemaType:Z,def:ue,it:qe}=this;return(0,u.or)(ne(),ce());function ne(){if(Z.length){if(!(he instanceof u.Name))throw Error("ajv implementation error");let Ne=Array.isArray(Z)?Z:[Z];return u._`${(0,o.checkDataTypes)(Ne,he,qe.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function ce(){if(ue.validateSchema){let Ne=K.scopeValue("validate$data",{ref:ue.validateSchema});return u._`!${Ne}(${he})`}return u.nil}}subschema(K,he){let Z=(0,l.getSubschema)(this.it,K);(0,l.extendSubschemaData)(Z,this.it,K),(0,l.extendSubschemaMode)(Z,K);let ue={...this.it,...Z,items:void 0,props:void 0};return T(ue,he),ue}mergeEvaluated(K,he){let{it:Z,gen:ue}=this;Z.opts.unevaluated&&(Z.props!==!0&&K.props!==void 0&&(Z.props=h.mergeEvaluated.props(ue,K.props,Z.props,he)),Z.items!==!0&&K.items!==void 0&&(Z.items=h.mergeEvaluated.items(ue,K.items,Z.items,he)))}mergeValidEvaluated(K,he){let{it:Z,gen:ue}=this;if(Z.opts.unevaluated&&(Z.props!==!0||Z.items!==!0))return ue.if(he,()=>this.mergeEvaluated(K,u.Name)),!0}}t.KeywordCxt=Le;function ge(ee,K,he,Z){let ue=new Le(ee,he,K);"code"in he?he.code(ue,Z):ue.$data&&he.validate?(0,c.funcKeywordCode)(ue,he):"macro"in he?(0,c.macroKeywordCode)(ue,he):(he.compile||he.validate)&&(0,c.funcKeywordCode)(ue,he)}a(ge,"rA");var Ue=/^\/(?:[^~]|~0|~1)*$/,ke=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function X(ee,{dataLevel:K,dataNames:he,dataPathArr:Z}){let ue,qe;if(ee==="")return d.default.rootData;if(ee[0]==="/"){if(!Ue.test(ee))throw Error(`Invalid JSON-pointer: ${ee}`);ue=ee,qe=d.default.rootData}else{let we=ke.exec(ee);if(!we)throw Error(`Invalid JSON-pointer: ${ee}`);let Be=+we[1];if(ue=we[2],ue==="#"){if(Be>=K)throw Error(Ne("property/index",Be));return Z[K-Be]}if(Be>K)throw Error(Ne("data",Be));if(qe=he[K-Be],!ue)return qe}let ne=qe,ce=ue.split("/");for(let we of ce)we&&(qe=u._`${qe}${(0,u.getProperty)((0,h.unescapeJsonPointer)(we))}`,ne=u._`${ne} && ${qe}`);return ne;function Ne(we,Be){return`Cannot access ${we} ${Be} levels up, current level is ${K}`}}a(X,"oA"),t.getData=X}),C6r=Ht(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}),mwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pwt();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}),b6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Ns(),r=C6r(),n=pW(),o=pwt(),s=mc(),c=hwt();class l{static{a(this,"CJ")}constructor(v){var b;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=(b=v.baseId)!==null&&b!==void 0?b:(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(_){let v=h.call(this,_);if(v)return v;let b=(0,o.getFullPath)(this.opts.uriResolver,_.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}),P;_.$async&&(P=x.scopeValue("Error",{ref:r.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));let D=x.scopeName("validate");_.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:_.schema,code:(0,e.stringify)(_.schema)}:{ref:_.schema}),validateName:D,ValidationError:P,schema:_.schema,schemaEnv:_,rootId:b,baseId:_.baseId||b,schemaPath:e.nil,errSchemaPath:_.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this},L;try{this._compilations.add(_),(0,c.validateFunctionCode)(N),x.optimize(this.opts.code.optimize);let B=x.toString();L=`${x.scopeRefs(n.default.scope)}return ${B}`,this.opts.code.process&&(L=this.opts.code.process(L,_));let q=Function(`${n.default.self}`,`${n.default.scope}`,L)(this,this.scope.get());if(this.scope.value(D,{ref:q}),q.errors=null,q.schema=_.schema,q.schemaEnv=_,_.$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:O}=N;q.evaluated={props:M instanceof e.Name?void 0:M,items:O instanceof e.Name?void 0:O,dynamicProps:M instanceof e.Name,dynamicItems:O instanceof e.Name},q.source&&(q.source.evaluated=(0,e.stringify)(q.evaluated))}return _.validate=q,_}catch(B){throw delete _.validate,delete _.validateName,L&&this.logger.error("Error compiling schema, function code:",L),B}finally{this._compilations.delete(_)}}a(u,"xB"),t.compileSchema=u;function d(_,v,b){var T;b=(0,o.resolveUrl)(this.opts.uriResolver,v,b);let w=_.refs[b];if(w)return w;let R=g.call(this,_,b);if(R===void 0){let x=(T=_.localRefs)===null||T===void 0?void 0:T[b],{schemaId:P}=this.opts;x&&(R=new l({schema:x,schemaId:P,root:_,baseId:v}))}if(R!==void 0)return _.refs[b]=f.call(this,R)}a(d,"tn"),t.resolveRef=d;function f(_){return(0,o.inlineRef)(_.schema,this.opts.inlineRefs)?_.schema:_.validate?_:u.call(this,_)}a(f,"an");function h(_){for(let v of this._compilations)if(m(v,_))return v}a(h,"XI"),t.getCompilingSchema=h;function m(_,v){return _.schema===v.schema&&_.root===v.root&&_.baseId===v.baseId}a(m,"sn");function g(_,v){let b;for(;typeof(b=this.refs[v])=="string";)v=b;return b||this.schemas[v]||A.call(this,_,v)}a(g,"en");function A(_,v){let b=this.opts.uriResolver.parse(v),T=(0,o._getFullPath)(this.opts.uriResolver,b),w=(0,o.getFullPath)(this.opts.uriResolver,_.baseId,void 0);if(Object.keys(_.schema).length>0&&T===w)return E.call(this,b,_);let R=(0,o.normalizeId)(T),x=this.refs[R]||this.schemas[R];if(typeof x=="string"){let P=A.call(this,_,x);return typeof P?.schema!="object"?void 0:E.call(this,b,P)}if(typeof x?.schema=="object"){if(x.validate||u.call(this,x),R===(0,o.normalizeId)(v)){let{schema:P}=x,{schemaId:D}=this.opts,N=P[D];return N&&(w=(0,o.resolveUrl)(this.opts.uriResolver,w,N)),new l({schema:P,schemaId:D,root:_,baseId:w})}return E.call(this,b,x)}}a(A,"EW"),t.resolveSchema=A;var y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function E(_,{baseId:v,schema:b,root:T}){var w;if(((w=_.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let P of _.fragment.slice(1).split("/")){if(typeof b=="boolean")return;let D=b[(0,s.unescapeFragment)(P)];if(D===void 0)return;b=D;let N=typeof b=="object"&&b[this.opts.schemaId];!y.has(P)&&N&&(v=(0,o.resolveUrl)(this.opts.uriResolver,v,N))}let R;if(typeof b!="boolean"&&b.$ref&&!(0,s.schemaHasRulesButRef)(b,this.RULES)){let P=(0,o.resolveUrl)(this.opts.uriResolver,v,b.$ref);R=A.call(this,T,P)}let{schemaId:x}=this.opts;if(R=R||new l({schema:b,schemaId:x,root:T,baseId:v}),R.schema!==R.root.schema)return R}a(E,"TB")}),k6c=Ht((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}}),XJi=Ht((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 P="",D=0,N=0;for(N=0;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N];break}for(N+=1;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N]}return P}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,P,D){if(x.length){let N=l(x);if(N!=="")P.push(N);else return D.error=!0,!1;x.length=0}return!0}a(f,"Kr");function h(x){let P=0,D={error:!1,address:"",zone:""},N=[],L=[],B=!1,q=!1,M=f;for(let O=0;O7){D.error=!0;break}O>0&&x[O-1]===":"&&(B=!0),N.push(":");continue}else if(j==="%"){if(!M(L,N,D))break;M=d}else{L.push(j);continue}}return L.length&&(M===d?D.zone=L.join(""):q?N.push(L.join("")):N.push(l(L))),D.address=N.join(""),D}a(h,"qr");function m(x){if(g(x,":")<2)return{host:x,isIPV6:!1};let P=h(x);if(P.error)return{host:x,isIPV6:!1};{let{address:D,address:N}=P;return P.zone&&(D+="%"+P.zone,N+="%25"+P.zone),{host:D,isIPV6:!0,escapedHost:N}}}a(m,"qI");function g(x,P){let D=0;for(let N=0;Ny[N])}a(v,"VI");function b(x,P=!1){if(x.indexOf("%")===-1)return x;let D="";for(let N=0;N{var{isUUID:r}=XJi(),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 P=String(x.scheme).toLowerCase()==="https";return(x.port===(P?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[P,D]=x.resourceName.split("?");x.path=P&&P!=="/"?P:void 0,x.query=D,x.resourceName=void 0}return x.fragment=void 0,x}a(f,"Rr");function h(x,P){if(!x.path)return x.error="URN can not be parsed",x;let D=x.path.match(n);if(D){let N=P.scheme||x.scheme||"urn";x.nid=D[1].toLowerCase(),x.nss=D[2];let L=`${N}:${P.nid||x.nid}`,B=R(L);x.path=void 0,B&&(x=B.parse(x,P))}else x.error=x.error||"URN can not be parsed.";return x}a(h,"Pr");function m(x,P){if(x.nid===void 0)throw Error("URN without nid cannot be serialized");let D=P.scheme||x.scheme||"urn",N=x.nid.toLowerCase(),L=`${D}:${P.nid||N}`,B=R(L);B&&(x=B.serialize(x,P));let q=x,M=x.nss;return q.path=`${N||P.nid}:${M}`,P.skipEscape=!0,q}a(m,"Er");function g(x,P){let D=x;return D.uuid=D.nss,D.nss=void 0,!P.tolerant&&(!D.uuid||!r(D.uuid))&&(D.error=D.error||"UUID is not valid."),D}a(g,"br");function A(x){let P=x;return P.nss=(x.uuid||"").toLowerCase(),P}a(A,"_r");var y={scheme:"http",domainHost:!0,parse:l,serialize:u},E={scheme:"https",domainHost:y.domainHost,parse:l,serialize:u},_={scheme:"ws",domainHost:!0,parse:d,serialize:f},v={scheme:"wss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},b={scheme:"urn",parse:h,serialize:m,skipNormalize:!0},T={scheme:"urn:uuid",parse:g,serialize:A,skipNormalize:!0},w={http:y,https:E,ws:_,wss:v,urn:b,"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}}),D6c=Ht((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=XJi(),{SCHEMES:h,getSchemeHandler:m}=P6c();function g(N,L){return typeof N=="string"?N=R(N,L):typeof N=="object"&&(N=w(_(N,L),L)),N}a(g,"cr");function A(N,L,B){let q=B?Object.assign({scheme:"null"},B):{scheme:"null"},M=y(w(N,q),w(L,q),q,!0);return q.skipEscape=!0,_(M,q)}a(A,"pr");function y(N,L,B,q){let M={};return q||(N=w(_(N,B),B),L=w(_(L,B),B)),B=B||{},!B.tolerant&&L.scheme?(M.scheme=L.scheme,M.userinfo=L.userinfo,M.host=L.host,M.port=L.port,M.path=n(L.path||""),M.query=L.query):(L.userinfo!==void 0||L.host!==void 0||L.port!==void 0?(M.userinfo=L.userinfo,M.host=L.host,M.port=L.port,M.path=n(L.path||""),M.query=L.query):(L.path?(L.path[0]==="/"?M.path=n(L.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?M.path="/"+L.path:N.path?M.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+L.path:M.path=L.path,M.path=n(M.path)),M.query=L.query):(M.path=N.path,L.query!==void 0?M.query=L.query:M.query=N.query),M.userinfo=N.userinfo,M.host=N.host,M.port=N.port),M.scheme=N.scheme),M.fragment=L.fragment,M}a(y,"MI");function E(N,L,B){let q=P(N,B),M=P(L,B);return q!==void 0&&M!==void 0&&q.toLowerCase()===M.toLowerCase()}a(E,"dr");function _(N,L){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({},L),M=[],O=m(q.scheme||B.scheme);O&&O.serialize&&O.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 j=o(B);if(j!==void 0&&(q.reference!=="suffix"&&M.push("//"),M.push(j),B.path&&B.path[0]!=="/"&&M.push("/")),B.path!==void 0){let Q=B.path;!q.absolutePath&&(!O||!O.absolutePath)&&(Q=n(Q)),j===void 0&&Q[0]==="/"&&Q[1]==="/"&&(Q="/%2F"+Q.slice(2)),M.push(Q)}return B.query!==void 0&&M.push("?",B.query),B.fragment!==void 0&&M.push("#",B.fragment),M.join("")}a(_,"y0");var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(N,L){if(L[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(b,"nr");function T(N,L){let B=Object.assign({},L),q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},M=!1,O=!1;B.reference==="suffix"&&(B.scheme?N=B.scheme+":"+N:N="//"+N);let j=N.match(v);if(j){q.scheme=j[1],q.userinfo=j[3],q.host=j[4],q.port=parseInt(j[5],10),q.path=j[6]||"",q.query=j[7],q.fragment=j[8],isNaN(q.port)&&(q.port=j[5]);let Q=b(q,j);if(Q!==void 0&&(q.error=q.error||Q,M=!0),q.host)if(d(q.host)===!1){let Y=r(q.host);q.host=Y.host.toLowerCase(),O=Y.isIPV6}else O=!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 U=m(B.scheme||q.scheme);if(!B.unicodeSupport&&(!U||!U.unicodeSupport)&&q.host&&(B.domainHost||U&&U.domainHost)&&O===!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((!U||U&&!U.skipNormalize)&&(N.indexOf("%")!==-1&&(q.scheme!==void 0&&(q.scheme=unescape(q.scheme)),q.host!==void 0&&(q.host=u(unescape(q.host),O))),q.path&&(q.path=c(q.path)),q.fragment))try{q.fragment=encodeURI(decodeURIComponent(q.fragment))}catch{q.error=q.error||"URI malformed"}U&&U.parse&&U.parse(q,B)}else q.error=q.error||"URI can not be parsed.";return{parsed:q,malformedAuthorityOrPort:M}}a(T,"LI");function w(N,L){return T(N,L).parsed}a(w,"w9");function R(N,L){return x(N,L).normalized}a(R,"rr");function x(N,L){let{parsed:B,malformedAuthorityOrPort:q}=T(N,L);return{normalized:q?N:_(B,L),malformedAuthorityOrPort:q}}a(x,"jI");function P(N,L){if(typeof N=="string"){let{normalized:B,malformedAuthorityOrPort:q}=x(N,L);return q?void 0:B}if(typeof N=="object")return _(N,L)}a(P,"FI");var D={SCHEMES:h,normalize:g,resolve:A,resolveComponent:y,equal:E,serialize:_,parse:w};e.exports=D,e.exports.default=D,e.exports.fastUri=D}),N6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=D6c();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),M6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=hwt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Ns();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=C6r(),o=mwt(),s=KJi(),c=b6r(),l=Ns(),u=pwt(),d=$It(),f=mc(),h=k6c(),m=N6c(),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"]),E={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."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function b(W){var V,z,ie,H,re,le,Le,ge,Ue,ke,X,ee,K,he,Z,ue,qe,ne,ce,Ne,we,Be,rt,st,_t;let Dt=W.strict,$t=(V=W.code)===null||V===void 0?void 0:V.optimize,Gt=$t===!0||$t===void 0?1:$t||0,Ie=(ie=(z=W.code)===null||z===void 0?void 0:z.regExp)!==null&&ie!==void 0?ie:g,F=(H=W.uriResolver)!==null&&H!==void 0?H:m.default;return{strictSchema:(le=(re=W.strictSchema)!==null&&re!==void 0?re:Dt)!==null&&le!==void 0?le:!0,strictNumbers:(ge=(Le=W.strictNumbers)!==null&&Le!==void 0?Le:Dt)!==null&&ge!==void 0?ge:!0,strictTypes:(ke=(Ue=W.strictTypes)!==null&&Ue!==void 0?Ue:Dt)!==null&&ke!==void 0?ke:"log",strictTuples:(ee=(X=W.strictTuples)!==null&&X!==void 0?X:Dt)!==null&&ee!==void 0?ee:"log",strictRequired:(he=(K=W.strictRequired)!==null&&K!==void 0?K:Dt)!==null&&he!==void 0?he:!1,code:W.code?{...W.code,optimize:Gt,regExp:Ie}:{optimize:Gt,regExp:Ie},loopRequired:(Z=W.loopRequired)!==null&&Z!==void 0?Z:v,loopEnum:(ue=W.loopEnum)!==null&&ue!==void 0?ue:v,meta:(qe=W.meta)!==null&&qe!==void 0?qe:!0,messages:(ne=W.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(ce=W.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(Ne=W.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(we=W.addUsedSchema)!==null&&we!==void 0?we:!0,validateSchema:(Be=W.validateSchema)!==null&&Be!==void 0?Be:!0,validateFormats:(rt=W.validateFormats)!==null&&rt!==void 0?rt:!0,unicodeRegExp:(st=W.unicodeRegExp)!==null&&st!==void 0?st:!0,int32range:(_t=W.int32range)!==null&&_t!==void 0?_t:!0,uriResolver:F}}a(b,"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,...b(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,E,V,"NOT SUPPORTED"),w.call(this,_,V,"DEPRECATED","warn"),this._metaOpts=N.call(this),V.formats&&P.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(ke,X){await re.call(this,ke.$schema);let ee=this._addSchema(ke,X);return ee.validate||le.call(this,ee)}async function re(ke){ke&&!this.getSchema(ke)&&await H.call(this,{$ref:ke},!0)}async function le(ke){try{return this._compileSchemaEnv(ke)}catch(X){if(!(X instanceof o.default))throw X;return Le.call(this,X),await ge.call(this,X.missingSchema),le.call(this,ke)}}function Le({missingSchema:ke,missingRef:X}){if(this.refs[ke])throw Error(`AnySchema ${ke} is loaded but ${X} cannot be resolved`)}async function ge(ke){let X=await Ue.call(this,ke);this.refs[ke]||await re.call(this,X.$schema),this.refs[ke]||this.addSchema(X,ke,z)}async function Ue(ke){let X=this._loading[ke];if(X)return X;try{return await(this._loading[ke]=ie(ke))}finally{delete this._loading[ke]}}}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=>O.call(this,re)),this;Q.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=>O.call(this,re,H):re=>H.type.forEach(le=>O.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 ge=ie[Le];if(typeof ge!="object")continue;let{$data:Ue}=ge.definition,ke=le[Le];Ue&&ke&&(le[Le]=Y(ke))}}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 ge=this._cache.get(V);if(ge!==void 0)return ge;ie=(0,u.normalizeId)(le||ie);let Ue=u.getSchemaRefs.call(this,V,ie);return ge=new c.SchemaEnv({schema:V,schemaId:Le,meta:z,baseId:ie,localRefs:Ue}),this._cache.set(ge.schema,ge),re&&!ie.startsWith("#")&&(ie&&this._checkUnique(ie),this.refs[ie]=ge),H&&this.validateSchema(V,!0),ge}_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 P(){for(let W in this.opts.formats){let V=this.opts.formats[W];V&&this.addFormat(W,V)}}a(P,"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 L={log(){},warn(){},error(){}};function B(W){if(W===!1)return L;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 O(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:ge})=>ge===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?j.call(this,le,Le,V.before):le.rules.push(Le),re.all[W]=Le,(ie=V.implements)===null||ie===void 0||ie.forEach(ge=>this.addKeyword(ge))}a(O,"lB");function j(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(j,"No");function Q(W){let{metaSchema:V}=W;V!==void 0&&(W.$data&&this.opts.$data&&(V=Y(V)),W.validateSchema=this.compile(V,!0))}a(Q,"wo");var U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Y(W){return{anyOf:[W,U]}}a(Y,"CI")}),O6c=Ht(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}),L6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=mwt(),r=HN(),n=Ns(),o=pW(),s=b6r(),c=mc(),l={keyword:"$ref",schemaType:"string",code(f){let{gen:h,schema:m,it:g}=f,{baseId:A,schemaEnv:y,validateName:E,opts:_,self:v}=g,{root:b}=y;if((m==="#"||m==="#/")&&A===b.baseId)return w();let T=s.resolveRef.call(v,b,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===b)return d(f,E,y,y.$async);let P=h.scopeValue("root",{ref:b});return d(f,n._`${P}.validate`,b,b.$async)}function R(P){let D=u(f,P);d(f,D,P,P.$async)}function x(P){let D=h.scopeValue("schema",_.code.source===!0?{ref:P,code:(0,n.stringify)(P)}:{ref:P}),N=h.name("valid"),L=f.subschema({schema:P,dataTypes:[],schemaPath:n.nil,topSchemaRef:D,errSchemaPath:m},N);f.mergeEvaluated(L),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:E,schemaEnv:_,opts:v}=y,b=v.passContext?o.default.this:n.nil;g?T():w();function T(){if(!_.$async)throw Error("async schema referenced by sync schema");let P=A.let("valid");A.try(()=>{A.code(n._`await ${(0,r.callValidateCode)(f,h,b)}`),x(h),!E&&A.assign(P,!0)},D=>{A.if(n._`!(${D} instanceof ${y.ValidationError})`,()=>A.throw(D)),R(D),!E&&A.assign(P,!1)}),f.ok(P)}a(T,"V");function w(){f.result((0,r.callValidateCode)(f,h,b),()=>x(h),()=>R(h))}a(w,"B");function R(P){let D=n._`${P}.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(P){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 L=A.var("props",n._`${P}.evaluated.props`);y.props=c.mergeEvaluated.props(A,L,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 L=A.var("items",n._`${P}.evaluated.items`);y.items=c.mergeEvaluated.items(A,L,y.items,n.Name)}}a(x,"N")}a(d,"xW"),t.callRef=d,t.default=l}),B6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=O6c(),r=L6c(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),F6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),U6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),Q6c=Ht(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=Ns(),r=mc(),n=Q6c(),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}),j6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=mc(),n=Ns(),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),E=l.let("valid");l.try(()=>l.assign(E,n._`${y}(${h}, ${g}).test(${u})`),()=>l.assign(E,!1)),c.fail$data(n._`!${E}`)}else{let A=(0,e.usePattern)(c,f);c.fail$data(n._`!${A}.test(${u})`)}}};t.default=s}),H6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),G6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=Ns(),n=mc(),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():E(),g.strictRequired){let b=c.parentSchema.properties,{definedProperties:T}=c.it;for(let w of u)if(b?.[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,_);else for(let b of u)(0,e.checkReportMissingProp)(c,b)}a(y,"q");function E(){let b=l.let("missing");if(A||h){let T=l.let("valid",!0);c.block$data(T,()=>v(b,T)),c.ok(T)}else l.if((0,e.checkMissingProp)(c,u,b)),(0,e.reportMissingProp)(c,b),l.else()}a(E,"V");function _(){l.forOf("prop",d,b=>{c.setParams({missingProperty:b}),l.if((0,e.noPropertyInData)(l,f,b,g.ownProperties),()=>c.error())})}a(_,"B");function v(b,T){c.setParams({missingProperty:b}),l.forOf(b,d,()=>{l.assign(T,(0,e.propertyInData)(l,f,b,g.ownProperties)),l.if((0,r.not)(T),()=>{c.error(),l.break()})},r.nil)}a(v,"z")}};t.default=s}),$6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),S6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ZJi();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),V6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=$It(),r=Ns(),n=mc(),o=S6r(),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"),E=m.items?(0,e.getSchemaTypes)(m.items):[];l.block$data(y,_,r._`${g} === false`),l.ok(y);function _(){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()?b:T)(w,R))}a(_,"V");function v(){return E.length>0&&!E.some(w=>w==="object"||w==="array")}a(v,"B");function b(w,R){let x=u.name("item"),P=(0,e.checkDataTypes)(E,x,A.opts.strictNumbers,e.DataType.Wrong),D=u.const("indices",r._`{}`);u.for(r._`;${w}--;`,()=>{u.let(x,r._`${d}[${w}]`),u.if(P,r._`continue`),E.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(b,"z");function T(w,R){let x=(0,n.useFunc)(u,o.default),P=u.name("outer");u.label(P).for(r._`;${w}--;`,()=>u.for(r._`${R} = ${w}; ${R}--;`,()=>u.if(r._`${x}(${d}[${w}], ${d}[${R}])`,()=>{l.error(),u.assign(y,!1).break(P)})))}a(T,"N")}};t.default=c}),W6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=S6r(),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}),z6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=S6r(),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"),E;if(g||d)E=l.let("valid"),c.block$data(E,_);else{if(!Array.isArray(f))throw Error("ajv implementation error");let b=l.const("vSchema",h);E=(0,e.or)(...f.map((T,w)=>v(b,w)))}c.pass(E);function _(){l.assign(E,!1),l.forOf("v",h,b=>l.if(e._`${y()}(${u}, ${b})`,()=>l.assign(E,!0).break()))}a(_,"B");function v(b,T){let w=f[T];return typeof w=="object"&&w!==null?e._`${y()}(${u}, ${b}[${T}])`:e._`${u} === ${w}`}a(v,"z")}};t.default=s}),Y6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=F6c(),r=U6c(),n=q6c(),o=j6c(),s=H6c(),c=G6c(),l=$6c(),u=V6c(),d=W6c(),f=z6c(),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}),eZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Ns(),r=mc(),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,E=>{c.subschema({keyword:h,dataProp:E,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}),tZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Ns(),r=mc(),n=HN(),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;E(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((_,v)=>{(0,r.alwaysValidSchema)(g,_)||(d.if(e._`${y} > ${v}`,()=>c.subschema({keyword:m,schemaProp:v,dataProp:v},A)),c.ok(A))});function E(_){let{opts:v,errSchemaPath:b}=g,T=u.length,w=T===_.minItems&&(T===_.maxItems||_[l]===!1);if(v.strictTuples&&!w){let R=`"${m}" is ${T}-tuple, but minItems or maxItems/${l} are not specified or different at path "${b}"`;(0,r.checkStrictMode)(g,R,v.strictTuples)}}a(E,"V")}a(s,"jR"),t.validateTuple=s,t.default=o}),K6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=tZi(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),J6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=HN(),o=eZi(),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}),Z6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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 E=c.name("valid");m===void 0&&h===1?v(E,()=>c.if(E,()=>c.break())):h===0?(c.let(E,!0),m!==void 0&&c.if(e._`${d}.length > 0`,_)):(c.let(E,!1),_()),s.result(E,()=>s.reset());function _(){let T=c.name("_valid"),w=c.let("count",0);v(T,()=>c.if(T,()=>b(w)))}a(_,"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 b(T){c.code(e._`${T}++`),m===void 0?c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0).break()):(c.if(e._`${T} > ${m}`,()=>c.assign(E,!1).break()),h===1?c.assign(E,!0):c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0)))}a(b,"w")}};t.default=o}),X6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Ns(),r=mc(),n=HN();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(L,"H")}a(m,"Ui");function g({gen:b,parentData:T,parentDataProperty:w},R){b.if(o._`${T} !== undefined`,()=>b.assign(o._`${T}[${w}]`,R))}a(g,"Hi");function A(b,T,w,R=c.Correct){let x=R===c.Correct?o.operators.EQ:o.operators.NEQ,P;switch(b){case"null":return o._`${T} ${x} null`;case"array":P=o._`Array.isArray(${T})`;break;case"object":P=o._`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":P=D(o._`!(${T} % 1) && !isNaN(${T})`);break;case"number":P=D();break;default:return o._`typeof ${T} ${x} ${b}`}return R===c.Correct?P:(0,o.not)(P);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(b,T,w,R){if(b.length===1)return A(b[0],T,w,R);let x,P=(0,s.toHash)(b);if(P.array&&P.object){let D=o._`typeof ${T} != "object"`;x=P.null?D:o._`!${T} || ${D}`,delete P.null,delete P.array,delete P.object}else x=o.nil;P.number&&delete P.integer;for(let D in P)x=(0,o.and)(x,A(D,T,w,R));return x}a(y,"jB"),t.checkDataTypes=y;var E={message:a(({schema:b})=>`must be ${b}`,"message"),params:a(({schema:b,schemaValue:T})=>typeof b=="string"?o._`{type: ${b}}`:o._`{type: ${T}}`,"params")};function _(b){let T=v(b);(0,n.reportError)(T,E)}a(_,"AB"),t.reportTypeError=_;function v(b){let{gen:T,data:w,schema:R}=b,x=(0,s.schemaRefOrVal)(b,R,"type");return{gen:T,keyword:"type",data:w,schema:R.type,schemaCode:x,schemaValue:x,parentSchema:R,params:{},it:b}}a(v,"qi")}),D6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Ns(),r=mc();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")}),GN=Ht(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=Ns(),r=mc(),n=hW(),o=mc();function s(b,T){let{gen:w,data:R,it:x}=b;w.if(h(w,R,T,x.opts.ownProperties),()=>{b.setParams({missingProperty:e._`${T}`},!0),b.error()})}a(s,"Mi"),t.checkReportMissingProp=s;function c({gen:b,data:T,it:{opts:w}},R,x){return(0,e.or)(...R.map(P=>(0,e.and)(h(b,T,P,w.ownProperties),e._`${x} = ${P}`)))}a(c,"Li"),t.checkMissingProp=c;function l(b,T){b.setParams({missingProperty:T},!0),b.error()}a(l,"ji"),t.reportMissingProp=l;function u(b){return b.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}a(u,"wA"),t.hasPropFunc=u;function d(b,T,w){return e._`${u(b)}.call(${T}, ${w})`}a(d,"RB"),t.isOwnProperty=d;function f(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} !== undefined`;return R?e._`${x} && ${d(b,T,w)}`:x}a(f,"Ai"),t.propertyInData=f;function h(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} === undefined`;return R?(0,e.or)(x,(0,e.not)(d(b,T,w))):x}a(h,"PB"),t.noPropertyInData=h;function m(b){return b?Object.keys(b).filter(T=>T!=="__proto__"):[]}a(m,"OA"),t.allSchemaProperties=m;function g(b,T){return m(T).filter(w=>!(0,r.alwaysValidSchema)(b,T[w]))}a(g,"Ii"),t.schemaProperties=g;function A({schemaCode:b,data:T,it:{gen:w,topSchemaRef:R,schemaPath:x,errorPath:P},it:D},N,L,B){let q=B?e._`${b}, ${T}, ${R}${x}`:T,M=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,P)],[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 O=e._`${q}, ${w.object(...M)}`;return L!==e.nil?e._`${N}.call(${L}, ${O})`:e._`${N}(${O})`}a(A,"Ri"),t.callValidateCode=A;var y=e._`new RegExp`;function E({gen:b,it:{opts:T}},w){let R=T.unicodeRegExp?"u":"",{regExp:x}=T.code,P=x(w,R);return b.scopeValue("pattern",{key:P.toString(),ref:P,code:e._`${x.code==="new RegExp"?y:(0,o.useFunc)(b,x)}(${w}, ${R})`})}a(E,"Ei"),t.usePattern=E;function _(b){let{gen:T,data:w,keyword:R,it:x}=b,P=T.name("valid");if(x.allErrors){let N=T.let("valid",!0);return D(()=>T.assign(N,!1)),N}return T.var(P,!0),D(()=>T.break()),P;function D(N){let L=T.const("len",e._`${w}.length`);T.forRange("i",0,L,B=>{b.subschema({keyword:R,dataProp:B,dataPropType:r.Type.Num},P),T.if((0,e.not)(P),N)})}}a(_,"bi"),t.validateArray=_;function v(b){let{gen:T,schema:w,keyword:R,it:x}=b;if(!Array.isArray(w))throw Error("ajv implementation error");if(w.some(N=>(0,r.alwaysValidSchema)(x,N))&&!x.opts.unevaluated)return;let P=T.let("valid",!1),D=T.name("_valid");T.block(()=>w.forEach((N,L)=>{let B=b.subschema({keyword:R,schemaProp:L,compositeRule:!0},D);T.assign(P,e._`${P} || ${D}`),!b.mergeValidEvaluated(B,D)&&T.if((0,e.not)(P))})),b.result(P,()=>b.reset(),()=>b.error(!0))}a(v,"_i"),t.validateUnion=v}),N6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Ns(),r=hW(),n=GN(),o=pwt();function s(g,A){let{gen:y,keyword:E,schema:_,parentSchema:v,it:b}=g,T=A.macro.call(b.self,_,v,b),w=f(y,E,T);b.opts.validateSchema!==!1&&b.self.validateSchema(T,!0);let R=y.name("valid");g.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${b.errSchemaPath}/${E}`,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:E,keyword:_,schema:v,parentSchema:b,$data:T,it:w}=g;d(w,A);let R=!T&&A.compile?A.compile.call(w.self,v,b,w):A.validate,x=f(E,_,R),P=E.let("valid");g.block$data(P,D),g.ok((y=A.valid)!==null&&y!==void 0?y:P);function D(){if(A.errors===!1)B(),A.modifying&&l(g),q(()=>g.error());else{let M=A.async?N():L();A.modifying&&l(g),q(()=>u(g,M))}}a(D,"z");function N(){let M=E.let("ruleErrs",null);return E.try(()=>B(e._`await `),O=>E.assign(P,!1).if(e._`${O} instanceof ${w.ValidationError}`,()=>E.assign(M,e._`${O}.errors`),()=>E.throw(O))),M}a(N,"N");function L(){let M=e._`${x}.errors`;return E.assign(M,null),B(e.nil),M}a(L,"w");function B(M=A.async?e._`await `:e.nil){let O=w.opts.passContext?r.default.this:r.default.self,j=!("compile"in A&&!T||A.schema===!1);E.assign(P,e._`${M}${(0,n.callValidateCode)(g,x,O,j)}`,A.modifying)}a(B,"O");function q(M){var O;E.if((0,e.not)((O=A.valid)!==null&&O!==void 0?O:P),M)}a(q,"D")}a(c,"di"),t.funcKeywordCode=c;function l(g){let{gen:A,data:y,it:E}=g;A.if(E.parentData,()=>A.assign(y,e._`${E.parentData}[${E.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(E=>E==="array"?Array.isArray(g):E==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==E||y&&typeof g>"u")}a(h,"ri"),t.validSchemaType=h;function m({schema:g,opts:A,self:y,errSchemaPath:E},_,v){if(Array.isArray(_.keyword)?!_.keyword.includes(v):_.keyword!==v)throw Error("ajv implementation error");let b=_.dependencies;if(b?.some(T=>!Object.prototype.hasOwnProperty.call(g,T)))throw Error(`parent schema must have dependencies of ${v}: ${b.join(",")}`);if(_.validateSchema&&!_.validateSchema(g[v])){let T=`keyword "${v}" value is invalid at path "${E}": `+y.errorsText(_.validateSchema.errors);if(A.validateSchema==="log")y.logger.error(T);else throw Error(T)}}a(m,"oi"),t.validateKeywordUsage=m}),M6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Ns(),r=mc();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:E,opts:_}=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,_.jsPropertySyntax)}`,c.parentDataProperty=e._`${u}`,c.dataPathArr=[...E,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}),rZi=Ht((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},"$")}),O6c=Ht((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 E=u[y];if(Array.isArray(E)){if(y in r.arrayKeywords)for(var _=0;_{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;var e=mc(),r=rZi(),n=O6c(),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 E=="boolean"?!0:_===!0?!l(E):_?u(E)<=_:!1}a(s,"Kn"),t.inlineRef=s;var c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(E){for(let _ in E){if(c.has(_))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(E){let _=0;for(let v in E){if(v==="$ref")return 1/0;if(_++,!o.has(v)&&(typeof E[v]=="object"&&(0,e.eachItem)(E[v],b=>_+=u(b)),_===1/0))return 1/0}return _}a(u,"SA");function d(E,_="",v){v!==!1&&(_=m(_));let b=E.parse(_);return f(E,b)}a(d,"vA"),t.getFullPath=d;function f(E,_){return E.serialize(_).split("#")[0]+"#"}a(f,"CA"),t._getFullPath=f;var h=/#\/?$/;function m(E){return E?E.replace(h,""):""}a(m,"N9"),t.normalizeId=m;function g(E,_,v){return v=m(v),E.resolve(_,v)}a(g,"Bn"),t.resolveUrl=g;var A=/^[a-z_][-a-z0-9._]*$/i;function y(E,_){if(typeof E=="boolean")return{};let{schemaId:v,uriResolver:b}=this.opts,T=m(E[v]||_),w={"":T},R=d(b,T,!1),x={},P=new Set;return n(E,{allKeys:!0},(L,B,q,M)=>{if(M===void 0)return;let O=R+B,j=w[M];typeof L[v]=="string"&&(j=Q.call(this,L[v])),U.call(this,L.$anchor),U.call(this,L.$dynamicAnchor),w[B]=j;function Q(Y){let W=this.opts.uriResolver.resolve;if(Y=m(j?W(j,Y):Y),P.has(Y))throw N(Y);P.add(Y);let V=this.refs[Y];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?D(L,V.schema,Y):Y!==m(O)&&(Y[0]==="#"?(D(L,x[Y],Y),x[Y]=L):this.refs[Y]=O),Y}a(Q,"M");function U(Y){if(typeof Y=="string"){if(!A.test(Y))throw Error(`invalid anchor "${Y}"`);Q.call(this,`#${Y}`)}}a(U,"j")}),x;function D(L,B,q){if(B!==void 0&&!r(L,B))throw N(q)}function N(L){return Error(`reference "${L}" resolves to more than one schema`)}}a(y,"Nn"),t.getSchemaRefs=y}),mwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=P6c(),r=VIt(),n=tZi(),o=VIt(),s=D6c(),c=N6c(),l=M6c(),u=Ns(),d=hW(),f=hwt(),h=mc(),m=pwt();function g(ee){if(R(ee)&&(P(ee),w(ee))){_(ee);return}A(ee,()=>(0,e.topBoolOrEmptySchema)(ee))}a(g,"jn"),t.validateFunctionCode=g;function A({gen:ee,validateName:K,schema:he,schemaEnv:Z,opts:ue},qe){ue.code.es5?ee.func(K,u._`${d.default.data}, ${d.default.valCxt}`,Z.$async,()=>{ee.code(u._`"use strict"; ${b(he,ue)}`),E(ee,ue),ee.code(qe)}):ee.func(K,u._`${d.default.data}, ${y(ue)}`,Z.$async,()=>ee.code(b(he,ue)).code(qe))}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 E(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(E,"In");function _(ee){let{schema:K,opts:he,gen:Z}=ee;A(ee,()=>{he.$comment&&K.$comment&&M(ee),L(ee),Z.let(d.default.vErrors,null),Z.let(d.default.errors,0),he.unevaluated&&v(ee),D(ee),O(ee)})}a(_,"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 b(ee,K){let he=typeof ee=="object"&&ee[K.schemaId];return he&&(K.code.source||K.code.process)?u._`/*# sourceURL=${he} */`:u.nil}a(b,"fA");function T(ee,K){if(R(ee)&&(P(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:Z,opts:ue}=ee;ue.$comment&&he.$comment&&M(ee),B(ee),q(ee);let qe=Z.const("_errs",d.default.errors);D(ee,qe),Z.var(K,u._`${qe} === ${d.default.errors}`)}a(x,"bn");function P(ee){(0,h.checkUnknownRules)(ee),N(ee)}a(P,"pA");function D(ee,K){if(ee.opts.jtd)return Q(ee,[],!1,K);let he=(0,r.getSchemaTypes)(ee.schema),Z=(0,r.coerceAndCheckDataType)(ee,he);Q(ee,he,!Z,K)}a(D,"dA");function N(ee){let{schema:K,errSchemaPath:he,opts:Z,self:ue}=ee;K.$ref&&Z.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(K,ue.RULES)&&ue.logger.warn(`$ref: keywords ignored in schema at path "${he}"`)}a(N,"_n");function L(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(L,"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:Z,opts:ue}){let qe=he.$comment;if(ue.$comment===!0)ee.code(u._`${d.default.self}.logger.log(${qe})`);else if(typeof ue.$comment=="function"){let ne=u.str`${Z}/$comment`,ce=ee.scopeValue("root",{ref:K.root});ee.code(u._`${d.default.self}.opts.$comment(${qe}, ${ne}, ${ce}.schema)`)}}a(M,"iA");function O(ee){let{gen:K,schemaEnv:he,validateName:Z,ValidationError:ue,opts:qe}=ee;he.$async?K.if(u._`${d.default.errors} === 0`,()=>K.return(d.default.data),()=>K.throw(u._`new ${ue}(${d.default.vErrors})`)):(K.assign(u._`${Z}.errors`,d.default.vErrors),qe.unevaluated&&j(ee),K.return(u._`${d.default.errors} === 0`))}a(O,"Cn");function j({gen:ee,evaluated:K,props:he,items:Z}){he instanceof u.Name&&ee.assign(u._`${K}.props`,he),Z instanceof u.Name&&ee.assign(u._`${K}.items`,Z)}a(j,"Tn");function Q(ee,K,he,Z){let{gen:ue,schema:qe,data:ne,allErrors:ce,opts:Ne,self:we}=ee,{RULES:Be}=we;if(qe.$ref&&(Ne.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(qe,Be))){ue.block(()=>ge(ee,"$ref",Be.all.$ref.definition));return}Ne.jtd||Y(ee,K),ue.block(()=>{for(let st of Be.rules)rt(st);rt(Be.post)});function rt(st){(0,n.shouldUseGroup)(qe,st)&&(st.type?(ue.if((0,o.checkDataType)(st.type,ne,Ne.strictNumbers)),U(ee,st),K.length===1&&K[0]===st.type&&he&&(ue.else(),(0,o.reportTypeError)(ee)),ue.endIf()):U(ee,st),ce||ue.if(u._`${d.default.errors} === ${Z||0}`))}a(rt,"B")}a(Q,"gA");function U(ee,K){let{gen:he,schema:Z,opts:{useDefaults:ue}}=ee;ue&&(0,s.assignDefaults)(ee,K.type),he.block(()=>{for(let qe of K.rules)(0,n.shouldUseRule)(Z,qe)&&ge(ee,qe.keyword,qe.definition,K.type)})}a(U,"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 Z in he){let ue=he[Z];if(typeof ue=="object"&&(0,n.shouldUseRule)(ee.schema,ue)){let{type:qe}=ue.definition;qe.length&&!qe.some(ne=>ie(K,ne))&&le(ee,`missing type "${qe.join(",")}" for keyword "${Z}"`)}}}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 Z of ee.dataTypes)H(K,Z)?he.push(Z):K.includes("integer")&&Z==="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,Z){if((0,c.validateKeywordUsage)(K,he,Z),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=Z,this.data=K.data,this.schema=K.schema[Z],this.$data=he.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(K,this.schema,Z,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",X(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,he.schemaType,he.allowUndefined))throw Error(`${Z} 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,Z){this.failResult((0,u.not)(K),he,Z)}failResult(K,he,Z){this.gen.if(K),Z?Z():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,Z){if(he){this.setParams(he),this._error(K,Z),this.setParams({});return}this._error(K,Z)}_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,Z=u.nil){this.gen.block(()=>{this.check$data(K,Z),he()})}check$data(K=u.nil,he=u.nil){if(!this.$data)return;let{gen:Z,schemaCode:ue,schemaType:qe,def:ne}=this;Z.if((0,u.or)(u._`${ue} === undefined`,he)),K!==u.nil&&Z.assign(K,!0),(qe.length||ne.validateSchema)&&(Z.elseIf(this.invalid$data()),this.$dataError(),K!==u.nil&&Z.assign(K,!1)),Z.else()}invalid$data(){let{gen:K,schemaCode:he,schemaType:Z,def:ue,it:qe}=this;return(0,u.or)(ne(),ce());function ne(){if(Z.length){if(!(he instanceof u.Name))throw Error("ajv implementation error");let Ne=Array.isArray(Z)?Z:[Z];return u._`${(0,o.checkDataTypes)(Ne,he,qe.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function ce(){if(ue.validateSchema){let Ne=K.scopeValue("validate$data",{ref:ue.validateSchema});return u._`!${Ne}(${he})`}return u.nil}}subschema(K,he){let Z=(0,l.getSubschema)(this.it,K);(0,l.extendSubschemaData)(Z,this.it,K),(0,l.extendSubschemaMode)(Z,K);let ue={...this.it,...Z,items:void 0,props:void 0};return T(ue,he),ue}mergeEvaluated(K,he){let{it:Z,gen:ue}=this;Z.opts.unevaluated&&(Z.props!==!0&&K.props!==void 0&&(Z.props=h.mergeEvaluated.props(ue,K.props,Z.props,he)),Z.items!==!0&&K.items!==void 0&&(Z.items=h.mergeEvaluated.items(ue,K.items,Z.items,he)))}mergeValidEvaluated(K,he){let{it:Z,gen:ue}=this;if(Z.opts.unevaluated&&(Z.props!==!0||Z.items!==!0))return ue.if(he,()=>this.mergeEvaluated(K,u.Name)),!0}}t.KeywordCxt=Le;function ge(ee,K,he,Z){let ue=new Le(ee,he,K);"code"in he?he.code(ue,Z):ue.$data&&he.validate?(0,c.funcKeywordCode)(ue,he):"macro"in he?(0,c.macroKeywordCode)(ue,he):(he.compile||he.validate)&&(0,c.funcKeywordCode)(ue,he)}a(ge,"rA");var Ue=/^\/(?:[^~]|~0|~1)*$/,ke=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function X(ee,{dataLevel:K,dataNames:he,dataPathArr:Z}){let ue,qe;if(ee==="")return d.default.rootData;if(ee[0]==="/"){if(!Ue.test(ee))throw Error(`Invalid JSON-pointer: ${ee}`);ue=ee,qe=d.default.rootData}else{let we=ke.exec(ee);if(!we)throw Error(`Invalid JSON-pointer: ${ee}`);let Be=+we[1];if(ue=we[2],ue==="#"){if(Be>=K)throw Error(Ne("property/index",Be));return Z[K-Be]}if(Be>K)throw Error(Ne("data",Be));if(qe=he[K-Be],!ue)return qe}let ne=qe,ce=ue.split("/");for(let we of ce)we&&(qe=u._`${qe}${(0,u.getProperty)((0,h.unescapeJsonPointer)(we))}`,ne=u._`${ne} && ${qe}`);return ne;function Ne(we,Be){return`Cannot access ${we} ${Be} levels up, current level is ${K}`}}a(X,"oA"),t.getData=X}),b6r=Ht(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}),gwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=hwt();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}),S6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Ns(),r=b6r(),n=hW(),o=hwt(),s=mc(),c=mwt();class l{static{a(this,"CJ")}constructor(v){var b;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=(b=v.baseId)!==null&&b!==void 0?b:(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(_){let v=h.call(this,_);if(v)return v;let b=(0,o.getFullPath)(this.opts.uriResolver,_.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}),P;_.$async&&(P=x.scopeValue("Error",{ref:r.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));let D=x.scopeName("validate");_.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:_.schema,code:(0,e.stringify)(_.schema)}:{ref:_.schema}),validateName:D,ValidationError:P,schema:_.schema,schemaEnv:_,rootId:b,baseId:_.baseId||b,schemaPath:e.nil,errSchemaPath:_.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this},L;try{this._compilations.add(_),(0,c.validateFunctionCode)(N),x.optimize(this.opts.code.optimize);let B=x.toString();L=`${x.scopeRefs(n.default.scope)}return ${B}`,this.opts.code.process&&(L=this.opts.code.process(L,_));let q=Function(`${n.default.self}`,`${n.default.scope}`,L)(this,this.scope.get());if(this.scope.value(D,{ref:q}),q.errors=null,q.schema=_.schema,q.schemaEnv=_,_.$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:O}=N;q.evaluated={props:M instanceof e.Name?void 0:M,items:O instanceof e.Name?void 0:O,dynamicProps:M instanceof e.Name,dynamicItems:O instanceof e.Name},q.source&&(q.source.evaluated=(0,e.stringify)(q.evaluated))}return _.validate=q,_}catch(B){throw delete _.validate,delete _.validateName,L&&this.logger.error("Error compiling schema, function code:",L),B}finally{this._compilations.delete(_)}}a(u,"xB"),t.compileSchema=u;function d(_,v,b){var T;b=(0,o.resolveUrl)(this.opts.uriResolver,v,b);let w=_.refs[b];if(w)return w;let R=g.call(this,_,b);if(R===void 0){let x=(T=_.localRefs)===null||T===void 0?void 0:T[b],{schemaId:P}=this.opts;x&&(R=new l({schema:x,schemaId:P,root:_,baseId:v}))}if(R!==void 0)return _.refs[b]=f.call(this,R)}a(d,"tn"),t.resolveRef=d;function f(_){return(0,o.inlineRef)(_.schema,this.opts.inlineRefs)?_.schema:_.validate?_:u.call(this,_)}a(f,"an");function h(_){for(let v of this._compilations)if(m(v,_))return v}a(h,"XI"),t.getCompilingSchema=h;function m(_,v){return _.schema===v.schema&&_.root===v.root&&_.baseId===v.baseId}a(m,"sn");function g(_,v){let b;for(;typeof(b=this.refs[v])=="string";)v=b;return b||this.schemas[v]||A.call(this,_,v)}a(g,"en");function A(_,v){let b=this.opts.uriResolver.parse(v),T=(0,o._getFullPath)(this.opts.uriResolver,b),w=(0,o.getFullPath)(this.opts.uriResolver,_.baseId,void 0);if(Object.keys(_.schema).length>0&&T===w)return E.call(this,b,_);let R=(0,o.normalizeId)(T),x=this.refs[R]||this.schemas[R];if(typeof x=="string"){let P=A.call(this,_,x);return typeof P?.schema!="object"?void 0:E.call(this,b,P)}if(typeof x?.schema=="object"){if(x.validate||u.call(this,x),R===(0,o.normalizeId)(v)){let{schema:P}=x,{schemaId:D}=this.opts,N=P[D];return N&&(w=(0,o.resolveUrl)(this.opts.uriResolver,w,N)),new l({schema:P,schemaId:D,root:_,baseId:w})}return E.call(this,b,x)}}a(A,"EW"),t.resolveSchema=A;var y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function E(_,{baseId:v,schema:b,root:T}){var w;if(((w=_.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let P of _.fragment.slice(1).split("/")){if(typeof b=="boolean")return;let D=b[(0,s.unescapeFragment)(P)];if(D===void 0)return;b=D;let N=typeof b=="object"&&b[this.opts.schemaId];!y.has(P)&&N&&(v=(0,o.resolveUrl)(this.opts.uriResolver,v,N))}let R;if(typeof b!="boolean"&&b.$ref&&!(0,s.schemaHasRulesButRef)(b,this.RULES)){let P=(0,o.resolveUrl)(this.opts.uriResolver,v,b.$ref);R=A.call(this,T,P)}let{schemaId:x}=this.opts;if(R=R||new l({schema:b,schemaId:x,root:T,baseId:v}),R.schema!==R.root.schema)return R}a(E,"TB")}),L6c=Ht((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}}),nZi=Ht((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 P="",D=0,N=0;for(N=0;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N];break}for(N+=1;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N]}return P}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,P,D){if(x.length){let N=l(x);if(N!=="")P.push(N);else return D.error=!0,!1;x.length=0}return!0}a(f,"Kr");function h(x){let P=0,D={error:!1,address:"",zone:""},N=[],L=[],B=!1,q=!1,M=f;for(let O=0;O7){D.error=!0;break}O>0&&x[O-1]===":"&&(B=!0),N.push(":");continue}else if(j==="%"){if(!M(L,N,D))break;M=d}else{L.push(j);continue}}return L.length&&(M===d?D.zone=L.join(""):q?N.push(L.join("")):N.push(l(L))),D.address=N.join(""),D}a(h,"qr");function m(x){if(g(x,":")<2)return{host:x,isIPV6:!1};let P=h(x);if(P.error)return{host:x,isIPV6:!1};{let{address:D,address:N}=P;return P.zone&&(D+="%"+P.zone,N+="%25"+P.zone),{host:D,isIPV6:!0,escapedHost:N}}}a(m,"qI");function g(x,P){let D=0;for(let N=0;Ny[N])}a(v,"VI");function b(x,P=!1){if(x.indexOf("%")===-1)return x;let D="";for(let N=0;N{var{isUUID:r}=nZi(),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 P=String(x.scheme).toLowerCase()==="https";return(x.port===(P?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[P,D]=x.resourceName.split("?");x.path=P&&P!=="/"?P:void 0,x.query=D,x.resourceName=void 0}return x.fragment=void 0,x}a(f,"Rr");function h(x,P){if(!x.path)return x.error="URN can not be parsed",x;let D=x.path.match(n);if(D){let N=P.scheme||x.scheme||"urn";x.nid=D[1].toLowerCase(),x.nss=D[2];let L=`${N}:${P.nid||x.nid}`,B=R(L);x.path=void 0,B&&(x=B.parse(x,P))}else x.error=x.error||"URN can not be parsed.";return x}a(h,"Pr");function m(x,P){if(x.nid===void 0)throw Error("URN without nid cannot be serialized");let D=P.scheme||x.scheme||"urn",N=x.nid.toLowerCase(),L=`${D}:${P.nid||N}`,B=R(L);B&&(x=B.serialize(x,P));let q=x,M=x.nss;return q.path=`${N||P.nid}:${M}`,P.skipEscape=!0,q}a(m,"Er");function g(x,P){let D=x;return D.uuid=D.nss,D.nss=void 0,!P.tolerant&&(!D.uuid||!r(D.uuid))&&(D.error=D.error||"UUID is not valid."),D}a(g,"br");function A(x){let P=x;return P.nss=(x.uuid||"").toLowerCase(),P}a(A,"_r");var y={scheme:"http",domainHost:!0,parse:l,serialize:u},E={scheme:"https",domainHost:y.domainHost,parse:l,serialize:u},_={scheme:"ws",domainHost:!0,parse:d,serialize:f},v={scheme:"wss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},b={scheme:"urn",parse:h,serialize:m,skipNormalize:!0},T={scheme:"urn:uuid",parse:g,serialize:A,skipNormalize:!0},w={http:y,https:E,ws:_,wss:v,urn:b,"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}}),F6c=Ht((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=nZi(),{SCHEMES:h,getSchemeHandler:m}=B6c();function g(N,L){return typeof N=="string"?N=R(N,L):typeof N=="object"&&(N=w(_(N,L),L)),N}a(g,"cr");function A(N,L,B){let q=B?Object.assign({scheme:"null"},B):{scheme:"null"},M=y(w(N,q),w(L,q),q,!0);return q.skipEscape=!0,_(M,q)}a(A,"pr");function y(N,L,B,q){let M={};return q||(N=w(_(N,B),B),L=w(_(L,B),B)),B=B||{},!B.tolerant&&L.scheme?(M.scheme=L.scheme,M.userinfo=L.userinfo,M.host=L.host,M.port=L.port,M.path=n(L.path||""),M.query=L.query):(L.userinfo!==void 0||L.host!==void 0||L.port!==void 0?(M.userinfo=L.userinfo,M.host=L.host,M.port=L.port,M.path=n(L.path||""),M.query=L.query):(L.path?(L.path[0]==="/"?M.path=n(L.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?M.path="/"+L.path:N.path?M.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+L.path:M.path=L.path,M.path=n(M.path)),M.query=L.query):(M.path=N.path,L.query!==void 0?M.query=L.query:M.query=N.query),M.userinfo=N.userinfo,M.host=N.host,M.port=N.port),M.scheme=N.scheme),M.fragment=L.fragment,M}a(y,"MI");function E(N,L,B){let q=P(N,B),M=P(L,B);return q!==void 0&&M!==void 0&&q.toLowerCase()===M.toLowerCase()}a(E,"dr");function _(N,L){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({},L),M=[],O=m(q.scheme||B.scheme);O&&O.serialize&&O.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 j=o(B);if(j!==void 0&&(q.reference!=="suffix"&&M.push("//"),M.push(j),B.path&&B.path[0]!=="/"&&M.push("/")),B.path!==void 0){let Q=B.path;!q.absolutePath&&(!O||!O.absolutePath)&&(Q=n(Q)),j===void 0&&Q[0]==="/"&&Q[1]==="/"&&(Q="/%2F"+Q.slice(2)),M.push(Q)}return B.query!==void 0&&M.push("?",B.query),B.fragment!==void 0&&M.push("#",B.fragment),M.join("")}a(_,"y0");var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(N,L){if(L[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(b,"nr");function T(N,L){let B=Object.assign({},L),q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},M=!1,O=!1;B.reference==="suffix"&&(B.scheme?N=B.scheme+":"+N:N="//"+N);let j=N.match(v);if(j){q.scheme=j[1],q.userinfo=j[3],q.host=j[4],q.port=parseInt(j[5],10),q.path=j[6]||"",q.query=j[7],q.fragment=j[8],isNaN(q.port)&&(q.port=j[5]);let Q=b(q,j);if(Q!==void 0&&(q.error=q.error||Q,M=!0),q.host)if(d(q.host)===!1){let Y=r(q.host);q.host=Y.host.toLowerCase(),O=Y.isIPV6}else O=!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 U=m(B.scheme||q.scheme);if(!B.unicodeSupport&&(!U||!U.unicodeSupport)&&q.host&&(B.domainHost||U&&U.domainHost)&&O===!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((!U||U&&!U.skipNormalize)&&(N.indexOf("%")!==-1&&(q.scheme!==void 0&&(q.scheme=unescape(q.scheme)),q.host!==void 0&&(q.host=u(unescape(q.host),O))),q.path&&(q.path=c(q.path)),q.fragment))try{q.fragment=encodeURI(decodeURIComponent(q.fragment))}catch{q.error=q.error||"URI malformed"}U&&U.parse&&U.parse(q,B)}else q.error=q.error||"URI can not be parsed.";return{parsed:q,malformedAuthorityOrPort:M}}a(T,"LI");function w(N,L){return T(N,L).parsed}a(w,"w9");function R(N,L){return x(N,L).normalized}a(R,"rr");function x(N,L){let{parsed:B,malformedAuthorityOrPort:q}=T(N,L);return{normalized:q?N:_(B,L),malformedAuthorityOrPort:q}}a(x,"jI");function P(N,L){if(typeof N=="string"){let{normalized:B,malformedAuthorityOrPort:q}=x(N,L);return q?void 0:B}if(typeof N=="object")return _(N,L)}a(P,"FI");var D={SCHEMES:h,normalize:g,resolve:A,resolveComponent:y,equal:E,serialize:_,parse:w};e.exports=D,e.exports.default=D,e.exports.fastUri=D}),U6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=F6c();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),Q6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=mwt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Ns();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=b6r(),o=gwt(),s=eZi(),c=S6r(),l=Ns(),u=hwt(),d=VIt(),f=mc(),h=L6c(),m=U6c(),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"]),E={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."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function b(W){var V,z,ie,H,re,le,Le,ge,Ue,ke,X,ee,K,he,Z,ue,qe,ne,ce,Ne,we,Be,rt,st,_t;let Dt=W.strict,$t=(V=W.code)===null||V===void 0?void 0:V.optimize,Gt=$t===!0||$t===void 0?1:$t||0,Ie=(ie=(z=W.code)===null||z===void 0?void 0:z.regExp)!==null&&ie!==void 0?ie:g,F=(H=W.uriResolver)!==null&&H!==void 0?H:m.default;return{strictSchema:(le=(re=W.strictSchema)!==null&&re!==void 0?re:Dt)!==null&&le!==void 0?le:!0,strictNumbers:(ge=(Le=W.strictNumbers)!==null&&Le!==void 0?Le:Dt)!==null&&ge!==void 0?ge:!0,strictTypes:(ke=(Ue=W.strictTypes)!==null&&Ue!==void 0?Ue:Dt)!==null&&ke!==void 0?ke:"log",strictTuples:(ee=(X=W.strictTuples)!==null&&X!==void 0?X:Dt)!==null&&ee!==void 0?ee:"log",strictRequired:(he=(K=W.strictRequired)!==null&&K!==void 0?K:Dt)!==null&&he!==void 0?he:!1,code:W.code?{...W.code,optimize:Gt,regExp:Ie}:{optimize:Gt,regExp:Ie},loopRequired:(Z=W.loopRequired)!==null&&Z!==void 0?Z:v,loopEnum:(ue=W.loopEnum)!==null&&ue!==void 0?ue:v,meta:(qe=W.meta)!==null&&qe!==void 0?qe:!0,messages:(ne=W.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(ce=W.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(Ne=W.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(we=W.addUsedSchema)!==null&&we!==void 0?we:!0,validateSchema:(Be=W.validateSchema)!==null&&Be!==void 0?Be:!0,validateFormats:(rt=W.validateFormats)!==null&&rt!==void 0?rt:!0,unicodeRegExp:(st=W.unicodeRegExp)!==null&&st!==void 0?st:!0,int32range:(_t=W.int32range)!==null&&_t!==void 0?_t:!0,uriResolver:F}}a(b,"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,...b(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,E,V,"NOT SUPPORTED"),w.call(this,_,V,"DEPRECATED","warn"),this._metaOpts=N.call(this),V.formats&&P.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(ke,X){await re.call(this,ke.$schema);let ee=this._addSchema(ke,X);return ee.validate||le.call(this,ee)}async function re(ke){ke&&!this.getSchema(ke)&&await H.call(this,{$ref:ke},!0)}async function le(ke){try{return this._compileSchemaEnv(ke)}catch(X){if(!(X instanceof o.default))throw X;return Le.call(this,X),await ge.call(this,X.missingSchema),le.call(this,ke)}}function Le({missingSchema:ke,missingRef:X}){if(this.refs[ke])throw Error(`AnySchema ${ke} is loaded but ${X} cannot be resolved`)}async function ge(ke){let X=await Ue.call(this,ke);this.refs[ke]||await re.call(this,X.$schema),this.refs[ke]||this.addSchema(X,ke,z)}async function Ue(ke){let X=this._loading[ke];if(X)return X;try{return await(this._loading[ke]=ie(ke))}finally{delete this._loading[ke]}}}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=>O.call(this,re)),this;Q.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=>O.call(this,re,H):re=>H.type.forEach(le=>O.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 ge=ie[Le];if(typeof ge!="object")continue;let{$data:Ue}=ge.definition,ke=le[Le];Ue&&ke&&(le[Le]=Y(ke))}}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 ge=this._cache.get(V);if(ge!==void 0)return ge;ie=(0,u.normalizeId)(le||ie);let Ue=u.getSchemaRefs.call(this,V,ie);return ge=new c.SchemaEnv({schema:V,schemaId:Le,meta:z,baseId:ie,localRefs:Ue}),this._cache.set(ge.schema,ge),re&&!ie.startsWith("#")&&(ie&&this._checkUnique(ie),this.refs[ie]=ge),H&&this.validateSchema(V,!0),ge}_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 P(){for(let W in this.opts.formats){let V=this.opts.formats[W];V&&this.addFormat(W,V)}}a(P,"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 L={log(){},warn(){},error(){}};function B(W){if(W===!1)return L;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 O(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:ge})=>ge===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?j.call(this,le,Le,V.before):le.rules.push(Le),re.all[W]=Le,(ie=V.implements)===null||ie===void 0||ie.forEach(ge=>this.addKeyword(ge))}a(O,"lB");function j(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(j,"No");function Q(W){let{metaSchema:V}=W;V!==void 0&&(W.$data&&this.opts.$data&&(V=Y(V)),W.validateSchema=this.compile(V,!0))}a(Q,"wo");var U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Y(W){return{anyOf:[W,U]}}a(Y,"CI")}),q6c=Ht(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}),j6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=gwt(),r=GN(),n=Ns(),o=hW(),s=S6r(),c=mc(),l={keyword:"$ref",schemaType:"string",code(f){let{gen:h,schema:m,it:g}=f,{baseId:A,schemaEnv:y,validateName:E,opts:_,self:v}=g,{root:b}=y;if((m==="#"||m==="#/")&&A===b.baseId)return w();let T=s.resolveRef.call(v,b,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===b)return d(f,E,y,y.$async);let P=h.scopeValue("root",{ref:b});return d(f,n._`${P}.validate`,b,b.$async)}function R(P){let D=u(f,P);d(f,D,P,P.$async)}function x(P){let D=h.scopeValue("schema",_.code.source===!0?{ref:P,code:(0,n.stringify)(P)}:{ref:P}),N=h.name("valid"),L=f.subschema({schema:P,dataTypes:[],schemaPath:n.nil,topSchemaRef:D,errSchemaPath:m},N);f.mergeEvaluated(L),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:E,schemaEnv:_,opts:v}=y,b=v.passContext?o.default.this:n.nil;g?T():w();function T(){if(!_.$async)throw Error("async schema referenced by sync schema");let P=A.let("valid");A.try(()=>{A.code(n._`await ${(0,r.callValidateCode)(f,h,b)}`),x(h),!E&&A.assign(P,!0)},D=>{A.if(n._`!(${D} instanceof ${y.ValidationError})`,()=>A.throw(D)),R(D),!E&&A.assign(P,!1)}),f.ok(P)}a(T,"V");function w(){f.result((0,r.callValidateCode)(f,h,b),()=>x(h),()=>R(h))}a(w,"B");function R(P){let D=n._`${P}.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(P){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 L=A.var("props",n._`${P}.evaluated.props`);y.props=c.mergeEvaluated.props(A,L,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 L=A.var("items",n._`${P}.evaluated.items`);y.items=c.mergeEvaluated.items(A,L,y.items,n.Name)}}a(x,"N")}a(d,"xW"),t.callRef=d,t.default=l}),H6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=q6c(),r=j6c(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),G6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),$6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),V6c=Ht(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=Ns(),r=mc(),n=V6c(),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}),z6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=GN(),r=mc(),n=Ns(),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),E=l.let("valid");l.try(()=>l.assign(E,n._`${y}(${h}, ${g}).test(${u})`),()=>l.assign(E,!1)),c.fail$data(n._`!${E}`)}else{let A=(0,e.usePattern)(c,f);c.fail$data(n._`!${A}.test(${u})`)}}};t.default=s}),Y6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),K6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=GN(),r=Ns(),n=mc(),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():E(),g.strictRequired){let b=c.parentSchema.properties,{definedProperties:T}=c.it;for(let w of u)if(b?.[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,_);else for(let b of u)(0,e.checkReportMissingProp)(c,b)}a(y,"q");function E(){let b=l.let("missing");if(A||h){let T=l.let("valid",!0);c.block$data(T,()=>v(b,T)),c.ok(T)}else l.if((0,e.checkMissingProp)(c,u,b)),(0,e.reportMissingProp)(c,b),l.else()}a(E,"V");function _(){l.forOf("prop",d,b=>{c.setParams({missingProperty:b}),l.if((0,e.noPropertyInData)(l,f,b,g.ownProperties),()=>c.error())})}a(_,"B");function v(b,T){c.setParams({missingProperty:b}),l.forOf(b,d,()=>{l.assign(T,(0,e.propertyInData)(l,f,b,g.ownProperties)),l.if((0,r.not)(T),()=>{c.error(),l.break()})},r.nil)}a(v,"z")}};t.default=s}),J6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),T6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=rZi();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),Z6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=VIt(),r=Ns(),n=mc(),o=T6r(),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"),E=m.items?(0,e.getSchemaTypes)(m.items):[];l.block$data(y,_,r._`${g} === false`),l.ok(y);function _(){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()?b:T)(w,R))}a(_,"V");function v(){return E.length>0&&!E.some(w=>w==="object"||w==="array")}a(v,"B");function b(w,R){let x=u.name("item"),P=(0,e.checkDataTypes)(E,x,A.opts.strictNumbers,e.DataType.Wrong),D=u.const("indices",r._`{}`);u.for(r._`;${w}--;`,()=>{u.let(x,r._`${d}[${w}]`),u.if(P,r._`continue`),E.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(b,"z");function T(w,R){let x=(0,n.useFunc)(u,o.default),P=u.name("outer");u.label(P).for(r._`;${w}--;`,()=>u.for(r._`${R} = ${w}; ${R}--;`,()=>u.if(r._`${x}(${d}[${w}], ${d}[${R}])`,()=>{l.error(),u.assign(y,!1).break(P)})))}a(T,"N")}};t.default=c}),X6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=T6r(),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}),e9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=T6r(),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"),E;if(g||d)E=l.let("valid"),c.block$data(E,_);else{if(!Array.isArray(f))throw Error("ajv implementation error");let b=l.const("vSchema",h);E=(0,e.or)(...f.map((T,w)=>v(b,w)))}c.pass(E);function _(){l.assign(E,!1),l.forOf("v",h,b=>l.if(e._`${y()}(${u}, ${b})`,()=>l.assign(E,!0).break()))}a(_,"B");function v(b,T){let w=f[T];return typeof w=="object"&&w!==null?e._`${y()}(${u}, ${b}[${T}])`:e._`${u} === ${w}`}a(v,"z")}};t.default=s}),t9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=G6c(),r=$6c(),n=W6c(),o=z6c(),s=Y6c(),c=K6c(),l=J6c(),u=Z6c(),d=X6c(),f=e9c(),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}),iZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Ns(),r=mc(),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,E=>{c.subschema({keyword:h,dataProp:E,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}),oZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Ns(),r=mc(),n=GN(),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;E(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((_,v)=>{(0,r.alwaysValidSchema)(g,_)||(d.if(e._`${y} > ${v}`,()=>c.subschema({keyword:m,schemaProp:v,dataProp:v},A)),c.ok(A))});function E(_){let{opts:v,errSchemaPath:b}=g,T=u.length,w=T===_.minItems&&(T===_.maxItems||_[l]===!1);if(v.strictTuples&&!w){let R=`"${m}" is ${T}-tuple, but minItems or maxItems/${l} are not specified or different at path "${b}"`;(0,r.checkStrictMode)(g,R,v.strictTuples)}}a(E,"V")}a(s,"jR"),t.validateTuple=s,t.default=o}),r9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=oZi(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),n9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=GN(),o=iZi(),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}),i9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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 E=c.name("valid");m===void 0&&h===1?v(E,()=>c.if(E,()=>c.break())):h===0?(c.let(E,!0),m!==void 0&&c.if(e._`${d}.length > 0`,_)):(c.let(E,!1),_()),s.result(E,()=>s.reset());function _(){let T=c.name("_valid"),w=c.let("count",0);v(T,()=>c.if(T,()=>b(w)))}a(_,"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 b(T){c.code(e._`${T}++`),m===void 0?c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0).break()):(c.if(e._`${T} > ${m}`,()=>c.assign(E,!1).break()),h===1?c.assign(E,!0):c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0)))}a(b,"w")}};t.default=o}),o9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Ns(),r=mc(),n=GN();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 E=(0,n.propertyInData)(f,h,A,m.opts.ownProperties);u.setParams({property:A,depsCount:y.length,deps:y.join(", ")}),m.allErrors?f.if(E,()=>{for(let _ of y)(0,n.checkReportMissingProp)(u,_)}):(f.if(e._`${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 E=u.subschema({keyword:m,schemaProp:y},A);u.mergeValidEvaluated(E,A)},()=>f.var(A,!0)),u.ok(A))}a(l,"CR"),t.validateSchemaDeps=l,t.default=o}),e9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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}),rZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=Ns(),n=pW(),o=mc(),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 E=(0,e.allSchemaProperties)(f.properties),_=(0,e.allSchemaProperties)(f.patternProperties);v(),l.ok(r._`${m} === ${n.default.errors}`);function v(){u.forIn("key",h,x=>{!E.length&&!_.length?w(x):u.if(b(x),()=>w(x))})}a(v,"B");function b(x){let P;if(E.length>8){let D=(0,o.schemaRefOrVal)(g,f.properties,"properties");P=(0,e.isOwnProperty)(u,D,x)}else E.length?P=(0,r.or)(...E.map(D=>r._`${x} === ${D}`)):P=r.nil;return _.length&&(P=(0,r.or)(P,..._.map(D=>r._`${(0,e.usePattern)(l,D)}.test(${x})`))),(0,r.not)(P)}a(b,"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 P=u.name("valid");y.removeAdditional==="failing"?(R(x,P,!1),u.if((0,r.not)(P),()=>{l.reset(),T(x)})):(R(x,P),!A&&u.if((0,r.not)(P),()=>u.break()))}}a(w,"w");function R(x,P,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,P)}a(R,"O")}};t.default=c}),t9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=hwt(),r=HN(),n=mc(),o=rZi(),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 _ of m)h.definedProperties.add(_);h.opts.unevaluated&&m.length&&h.props!==!0&&(h.props=n.mergeEvaluated.props(l,(0,n.toHash)(m),h.props));let g=m.filter(_=>!(0,n.alwaysValidSchema)(h,u[_]));if(g.length===0)return;let A=l.name("valid");for(let _ of g)y(_)?E(_):(l.if((0,r.propertyInData)(l,f,_,h.opts.ownProperties)),E(_),!h.allErrors&&l.else().var(A,!0),l.endIf()),c.it.definedProperties.add(_),c.ok(A);function y(_){return h.opts.useDefaults&&!h.compositeRule&&u[_].default!==void 0}a(y,"q");function E(_){c.subschema({keyword:"properties",schemaProp:_,dataProp:_},A)}a(E,"V")}};t.default=s}),r9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=Ns(),n=mc(),o=mc(),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,E=l.name("valid");h.props!==!0&&!(h.props instanceof r.Name)&&(h.props=(0,o.evaluatedPropsToName)(l,h.props));let{props:_}=h;v();function v(){for(let w of g)y&&b(w),h.allErrors?T(w):(l.var(E,!0),T(w),l.if(E))}a(v,"z");function b(w){for(let R in y)new RegExp(w).test(R)&&(0,n.checkStrictMode)(h,`property ${R} matches pattern ${w} (use allowMatchingProperties)`)}a(b,"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},E),h.opts.unevaluated&&_!==!0?l.assign(r._`${_}[${R}]`,!0):!x&&!h.allErrors&&l.if((0,r.not)(E),()=>l.break())})})}a(T,"w")}};t.default=s}),n9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),i9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),o9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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,E)=>{let _;(0,r.alwaysValidSchema)(d,y)?c.var(g,!0):_=s.subschema({keyword:"oneOf",schemaProp:E,compositeRule:!0},g),E>0&&c.if(e._`${g} && ${h}`).assign(h,!1).assign(m,e._`[${m}, ${E}]`).else(),c.if(g,()=>{c.assign(h,!0),c.assign(m,E),_&&s.mergeEvaluated(_,e.Name)})})}a(A,"q")}};t.default=o}),s9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),a9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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 E=l.let("ifClause");c.setParams({ifClause:E}),l.if(g,y("then",E),y("else",E))}else f?l.if(g,y("then")):l.if((0,e.not)(g),y("else"));c.pass(m,()=>c.error(!0));function A(){let E=c.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);c.mergeEvaluated(E)}a(A,"H");function y(E,_){return()=>{let v=c.subschema({keyword:E},g);l.assign(m,g),c.mergeValidEvaluated(v,m),_?l.assign(_,e._`${E}`):c.setParams({ifClause:E})}}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}),c9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),l9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=eZi(),r=K6c(),n=tZi(),o=J6c(),s=Z6c(),c=X6c(),l=e9c(),u=rZi(),d=t9c(),f=r9c(),h=n9c(),m=i9c(),g=o9c(),A=s9c(),y=a9c(),E=c9c();function _(v=!1){let b=[h.default,m.default,g.default,A.default,y.default,E.default,l.default,u.default,c.default,d.default,f.default];return v?b.push(r.default,o.default):b.push(e.default,n.default),b.push(s.default),b}a(_,"ra"),t.default=_}),u9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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 E(){let v=c.scopeValue("formats",{ref:y.formats,code:m.code.formats}),b=c.const("fDef",e._`${v}[${f}]`),T=c.let("fType"),w=c.let("format");c.if(e._`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>c.assign(T,e._`${b}.type || "string"`).assign(w,e._`${b}.validate`),()=>c.assign(T,e._`"string"`).assign(w,b)),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 P=A.$async?e._`(${b}.async ? await ${w}(${l}) : ${w}(${l}))`:e._`${w}(${l})`,D=e._`(typeof ${w} == "function" ? ${P} : ${w}.test(${l}))`;return e._`${w} && ${w} !== true && ${T} === ${s} && !${D}`}a(x,"A")}a(E,"z");function _(){let v=y.formats[d];if(!v){R();return}if(v===!0)return;let[b,T,w]=x(v);b===s&&o.pass(P());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,L=c.scopeValue("formats",{key:d,ref:D,code:N});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,e._`${L}.validate`]:["string",D,L]}a(x,"A");function P(){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(P,"S")}a(_,"N")}};t.default=n}),d9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=u9c(),r=[e.default];t.default=r}),f9c=Ht(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"]}),p9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=B6c(),r=Y6c(),n=l9c(),o=d9c(),s=f9c(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),h9c=Ht(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={}))}),m9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=h9c(),n=b6r(),o=mwt(),s=mc(),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 E=d.let("valid",!1),_=d.const("tag",e._`${f}${(0,e.getProperty)(y)}`);d.if(e._`typeof ${_} == "string"`,()=>v(),()=>u.error(!1,{discrError:r.DiscrError.Tag,tag:_,tagName:y})),u.ok(E);function v(){let w=T();d.if(!1);for(let R in w)d.elseIf(e._`${_} === ${R}`),d.assign(E,b(w[R]));d.else(),u.error(!1,{discrError:r.DiscrError.Mapping,tag:_,tagName:y}),d.endIf()}a(v,"V");function b(w){let R=d.name("valid"),x=u.subschema({keyword:"oneOf",schemaProp:w},R);return u.mergeEvaluated(x,e.Name),R}a(b,"B");function T(){var w;let R={},x=D(m),P=!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}}),nZi=Ht((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=M6c(),n=p9c(),o=m9c(),s=g9c(),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=hwt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Ns();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=C6r();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=mwt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),A9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(L,B){return{validate:L,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:_,"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:b,int32:{type:"number",validate:R},int64:{type:"number",validate:x},float:{type:"number",validate:P},double:{type:"number",validate:P},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(L){return L%4===0&&(L%100!==0||L%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(L){let B=n.exec(L);if(!B)return!1;let q=+B[1],M=+B[2],O=+B[3];return M>=1&&M<=12&&O>=1&&O<=(M===2&&r(q)?29:o[M])}a(s,"xP");function c(L,B){if(L&&B)return L>B?1:L23||W>59||L&&!Q)return!1;if(M<=23&&O<=59&&j<60)return!0;let V=O-W*U,z=M-Y*U-(V<0?1:0);return(z===23||z===-1)&&(V===59||V===-1)&&j<61}}a(u,"Jz");function d(L,B){if(!(L&&B))return;let q=new Date("2020-01-01T"+L).valueOf(),M=new Date("2020-01-01T"+B).valueOf();if(q&&M)return q-M}a(d,"Wz");function f(L,B){if(!(L&&B))return;let q=l.exec(L),M=l.exec(B);if(q&&M)return L=q[1]+q[2]+q[3],B=M[1]+M[2]+M[3],L>B?1:L=T}a(R,"Cs");function x(L){return Number.isInteger(L)}a(x,"Ts");function P(){return!0}a(P,"TP");var D=/[^\\]\\Z/;function N(L){if(D.test(L))return!1;try{return new RegExp(L),!0}catch{return!1}}a(N,"ys")}),y9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=nZi(),r=Ns(),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 E(){let b=u.scopeValue("formats",{ref:A.formats,code:g.code.formats}),T=u.const("fmt",r._`${b}[${y.schemaCode}]`);l.fail$data((0,r.or)(r._`typeof ${T} != "object"`,r._`${T} instanceof RegExp`,r._`typeof ${T}.compare != "function"`,v(T)))}a(E,"q");function _(){let b=y.schema,T=A.formats[b];if(!T||T===!0)return;if(typeof T!="object"||T instanceof RegExp||typeof T.compare!="function")throw Error(`"${h}": format "${b}" does not define "compare" function`);let w=u.scopeValue("formats",{key:b,ref:T,code:g.code.formats?r._`${g.code.formats}${(0,r.getProperty)(b)}`:void 0});l.fail$data(v(w))}a(_,"V");function v(b){return r._`${b}.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}),E9c=Ht((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=A9c(),n=y9c(),o=Ns(),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}),_9c=50;a(t8r,"g9");a(lZi,"K5");a(v9c,"Uk");a(Vie,"v4");ywt=["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"],C9c=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],b9c="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",S9c=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,T9c=/(.*?)<\/command-name>/;a(T6r,"h9");I9c={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(pZi,"q5");a(x9c,"JN");a(YV,"G1");a(w9c,"zk");a(R9c,"Nk");a(k9c,"wk");r8r=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=pZi(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()}},R1=class extends Error{static{a(this,"W6")}};a(hZi,"V5");a(s_,"R$");a(D8e,"U1");P9c=typeof global=="object"&&global&&global.Object===Object&&global,mZi=P9c,D9c=typeof self=="object"&&self&&self.Object===Object&&self,N9c=mZi||D9c||Function("return this")(),Mve=N9c,M9c=Mve.Symbol,cW=M9c,gZi=Object.prototype,O9c=gZi.hasOwnProperty,L9c=gZi.toString,bFe=cW?cW.toStringTag:void 0;a(B9c,"Ak");F9c=B9c,U9c=Object.prototype,Q9c=U9c.toString;a(q9c,"Pk");j9c=q9c,H9c="[object Null]",G9c="[object Undefined]",MYi=cW?cW.toStringTag:void 0;a($9c,"_k");N8e=$9c;a(V9c,"kk");z9=V9c,W9c="[object AsyncFunction]",z9c="[object Function]",Y9c="[object GeneratorFunction]",K9c="[object Proxy]";a(J9c,"xk");I6r=J9c,Z9c=Mve["__core-js_shared__"],CFr=Z9c,OYi=(function(){var t=/[^.]+$/.exec(CFr&&CFr.keys&&CFr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(X9c,"fk");eUc=X9c,tUc=Function.prototype,rUc=tUc.toString;a(nUc,"uk");iUc=nUc,oUc=/[\\^$.*+?()[\]{}|]/g,sUc=/^\[object .+?Constructor\]$/,aUc=Function.prototype,cUc=Object.prototype,lUc=aUc.toString,uUc=cUc.hasOwnProperty,dUc=RegExp("^"+lUc.call(uUc).replace(oUc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(fUc,"rk");pUc=fUc;a(hUc,"ok");mUc=hUc;a(gUc,"tk");x6r=gUc,AUc=x6r(Object,"create"),n8e=AUc;a(yUc,"sk");EUc=yUc;a(_Uc,"ek");vUc=_Uc,CUc="__lodash_hash_undefined__",bUc=Object.prototype,SUc=bUc.hasOwnProperty;a(TUc,"XS");IUc=TUc,xUc=Object.prototype,wUc=xUc.hasOwnProperty;a(RUc,"GS");kUc=RUc,PUc="__lodash_hash_undefined__";a(DUc,"HS");NUc=DUc;a(Ove,"a0");Ove.prototype.clear=EUc;Ove.prototype.delete=vUc;Ove.prototype.get=IUc;Ove.prototype.has=kUc;Ove.prototype.set=NUc;LYi=Ove;a(MUc,"KS");OUc=MUc;a(LUc,"qS");Ewt=LUc;a(BUc,"VS");_wt=BUc,FUc=Array.prototype,UUc=FUc.splice;a(QUc,"NS");qUc=QUc;a(jUc,"wS");HUc=jUc;a(GUc,"OS");$Uc=GUc;a(VUc,"DS");WUc=VUc;a(Lve,"s0");Lve.prototype.clear=OUc;Lve.prototype.delete=qUc;Lve.prototype.get=HUc;Lve.prototype.has=$Uc;Lve.prototype.set=WUc;vwt=Lve,zUc=x6r(Mve,"Map"),AZi=zUc;a(YUc,"ZS");KUc=YUc;a(JUc,"MS");ZUc=JUc;a(XUc,"LS");Cwt=XUc;a(e7c,"jS");t7c=e7c;a(r7c,"AS");n7c=r7c;a(i7c,"IS");o7c=i7c;a(s7c,"RS");a7c=s7c;a(Bve,"e0");Bve.prototype.clear=KUc;Bve.prototype.delete=t7c;Bve.prototype.get=n7c;Bve.prototype.has=o7c;Bve.prototype.set=a7c;w6r=Bve,c7c="Expected a function";a(R6r,"MG");R6r.Cache=w6r;Py=R6r,Fve=Py(()=>(process.env.CLAUDE_CONFIG_DIR??(0,EZi.join)((0,yZi.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),AKh=Py(()=>s_(process.env.CLAUDE_CODE_SUPERVISED));a(En,"y");a(gt,"Z");_Zi=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return _Zi=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(i8e,"T4");n8r=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"),Ri=class extends Error{static{a(this,"g")}},Jv=class t extends Ri{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 dve({message:n,cause:n8r(r)});let s=r,c=s?.error?.type;return e===400?new WIt(e,s,n,o,c):e===401?new zIt(e,s,n,o,c):e===403?new YIt(e,s,n,o,c):e===404?new KIt(e,s,n,o,c):e===409?new JIt(e,s,n,o,c):e===422?new ZIt(e,s,n,o,c):e===429?new XIt(e,s,n,o,c):e>=500?new ext(e,s,n,o,c):new t(e,s,n,o,c)}},kI=class extends Jv{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},dve=class extends Jv{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},VIt=class extends dve{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},WIt=class extends Jv{static{a(this,"p9")}},zIt=class extends Jv{static{a(this,"d9")}},YIt=class extends Jv{static{a(this,"i9")}},KIt=class extends Jv{static{a(this,"n9")}},JIt=class extends Jv{static{a(this,"r9")}},ZIt=class extends Jv{static{a(this,"o9")}},XIt=class extends Jv{static{a(this,"t9")}},ext=class extends Jv{static{a(this,"a9")}},l7c=/^[a-z][a-z0-9+.-]*:/i,u7c=a(t=>l7c.test(t),"bN"),i8r=a(t=>(i8r=Array.isArray,i8r(t)),"jG"),BYi=i8r;a(o8r,"w5");a(FYi,"IG");a(d7c,"_N");f7c=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Ri(`${t} must be an integer`);if(e<0)throw new Ri(`${t} must be a positive integer`);return e},"kN"),vZi=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),p7c=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),nW="0.94.0",h7c=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(m7c,"SS");g7c=a(()=>{let t=m7c();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":nW,"X-Stainless-OS":QYi(Deno.build.os),"X-Stainless-Arch":UYi(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":nW,"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":nW,"X-Stainless-OS":QYi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":UYi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=A7c();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":nW,"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":nW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(A7c,"CS");UYi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),QYi=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"),k6r=a(()=>qYi??(qYi=g7c()),"s9");a(y7c,"yN");a(CZi,"RG");a(bZi,"D5");a(P6r,"e9");a(E7c,"fN");_7c=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(v7c,"hN");C7c="urn:ietf:params:oauth:grant-type:jwt-bearer",b7c="refresh_token",SZi="/v1/oauth/token",txt="oauth-2025-04-20",S7c="oidc-federation-2026-04-01",T7c=120,D6r=30,I7c=5,jYi=1048576;a(TZi,"Z5");a(IZi,"M5");bFr=2e3,x7c=new Set(["error","error_description","error_uri"]);a(gk,"Z6");a(xZi,"L5");a(wZi,"j5");a(w7c,"fS");nu=class extends Ri{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(Wie,"Y4");s8r=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-Wie();return n>T7c?r.token:n>D6r?(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||Wie()-this.lastAdvisoryError{this.lastAdvisoryError=Wie(),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}},tu=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(R7c,"rN");a(N6r,"Q8");a($Yi,"bG");rxt={off:0,error:200,warn:300,info:400,debug:500},VYi=a((t,e,r)=>{if(t){if(d7c(rxt,t))return t;oA(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(rxt))}`)}},"_G");a(GFe,"$Q");a(_It,"A5");k7c={error:GFe,warn:GFe,info:GFe,debug:GFe},WYi=new WeakMap;a(oA,"m$");Gie=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"),RZi="1.0",P7c=/^[A-Za-z0-9_.-]+$/;a(kZi,"tN");D7c=a(async t=>{var e,r;let n=await M6r();if(n===null)return null;let o=t??await PZi();if(o===null)return null;kZi(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=tu("ANTHROPIC_ORGANIZATION_ID"),h=tu("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=tu("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:tu("ANTHROPIC_WORKSPACE_ID"),base_url:tu("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:tu("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:tu("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=tu("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=tu("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=tu("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=tu("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=tu("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=tu("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=tu("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),N7c=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await M6r();if(!r)return null;let n=e??await PZi();return n?(kZi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),M6r=a(async()=>{if(!M7c())return null;let t=await import("node:path"),e=tu("ANTHROPIC_CONFIG_DIR");if(e)return e;if(k6r()["X-Stainless-OS"]==="Windows"){let o=tu("APPDATA");if(o)return t.join(o,"Anthropic");let s=tu("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=tu("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=tu("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),M7c=a(()=>{let t=k6r()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),PZi=a(async()=>{let t=await M6r();if(!t)return null;let e=tu("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(zYi,"SG");a(O7c,"$w");a(L7c,"Qw");a(B7c,"Jw");a(DZi,"vG");a(F7c,"Xw");a(U7c,"mS");a(Q7c,"lS");a(q7c,"cS");Zie=class{static{a(this,"B1")}constructor(){xI.set(this,void 0),wI.set(this,void 0),En(this,xI,new Uint8Array,"f"),En(this,wI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?N6r(e):e;En(this,xI,R7c([gt(this,xI,"f"),r]),"f");let n=[],o;for(;(o=j7c(gt(this,xI,"f"),gt(this,wI,"f")))!=null;){if(o.carriage&>(this,wI,"f")==null){En(this,wI,o.index,"f");continue}if(gt(this,wI,"f")!=null&&(o.index!==gt(this,wI,"f")+1||o.carriage)){n.push($Yi(gt(this,xI,"f").subarray(0,gt(this,wI,"f")-1))),En(this,xI,gt(this,xI,"f").subarray(gt(this,wI,"f")),"f"),En(this,wI,null,"f");continue}let s=gt(this,wI,"f")!==null?o.preceding-1:o.preceding,c=$Yi(gt(this,xI,"f").subarray(0,s));n.push(c),En(this,xI,gt(this,xI,"f").subarray(o.index),"f"),En(this,wI,null,"f")}return n}flush(){return gt(this,xI,"f").length?this.decode(` -`):[]}};xI=new WeakMap,wI=new WeakMap;Zie.NEWLINE_CHARS=new Set([` -`,"\r"]);Zie.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(j7c,"pS");a(H7c,"Yw");Xie=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,SFe.set(this,void 0),this.controller=r,En(this,SFe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?oA(n):console;async function*c(){if(o)throw new Ri("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of G7c(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=vZi(u.data)??u.data,f=d?.error?.type;throw new Jv(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(i8e(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 Zie,u=P6r(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 Ri("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(i8e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(SFe=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,SFe,"f")),new t(()=>o(r),this.controller,gt(this,SFe,"f"))]}toReadableStream(){let e=this,r;return CZi({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=N6r(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(G7c,"dS");a($7c,"iS");a8r=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]=V7c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(V7c,"nS");a(NZi,"P5");a(MZi,"CG");nxt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=NZi){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,$Fe.set(this,void 0),En(this,$Fe,e,"f")}_thenUnwrap(e){return new t(gt(this,$Fe,"f"),this.responsePromise,async(r,n)=>MZi(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,$Fe,"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)}};$Fe=new WeakMap;ixt=class{static{a(this,"TG")}constructor(e,r,n,o){vIt.set(this,void 0),En(this,vIt,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 Ri("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await gt(this,vIt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(vIt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},c8r=class extends nxt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await NZi(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},eoe=class extends ixt{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:{...o8r(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...o8r(this.options.query),after_id:e}}:null}},c_=class extends ixt{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:{...o8r(this.options.query),page:e}}:null}},OZi=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(sve,"J0");a(QIt,"XQ");LZi=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),O6r=a(async(t,e,r=!0)=>({...t,body:await z7c(t.body,e,r)}),"J8"),YYi=new WeakMap;a(W7c,"oS");z7c=a(async(t,e,r=!0)=>{if(!await W7c(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])=>l8r(n,o,s,r))),n},"tS"),Y7c=a(t=>t instanceof Blob&&"name"in t,"aS"),l8r=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,sve([await r.blob()],QIt(r,n),o))}else if(LZi(r))t.append(e,sve([await new Response(bZi(r)).blob()],QIt(r,n)));else if(Y7c(r))t.append(e,sve([r],QIt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>l8r(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>l8r(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"),BZi=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"),K7c=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&BZi(t),"sS"),J7c=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(Z7c,"_5");a(u8r,"gG");a(X7c,"$v");Sd=class{static{a(this,"t")}constructor(e){this._client=e}},FZi=Symbol.for("brand.privateNullableHeaders");a(eQc,"Jv");mr=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of eQc(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{[FZi]:!0,values:e,nulls:r}},"R");a(UZi,"qw");KYi=Object.freeze(Object.create(null)),tQc=a((t=UZi)=>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??KYi)??KYi)?.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 Ri(`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 E=(0,n.propertyInData)(f,h,A,m.opts.ownProperties);u.setParams({property:A,depsCount:y.length,deps:y.join(", ")}),m.allErrors?f.if(E,()=>{for(let _ of y)(0,n.checkReportMissingProp)(u,_)}):(f.if(e._`${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 E=u.subschema({keyword:m,schemaProp:y},A);u.mergeValidEvaluated(E,A)},()=>f.var(A,!0)),u.ok(A))}a(l,"CR"),t.validateSchemaDeps=l,t.default=o}),s9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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}),sZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=GN(),r=Ns(),n=hW(),o=mc(),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 E=(0,e.allSchemaProperties)(f.properties),_=(0,e.allSchemaProperties)(f.patternProperties);v(),l.ok(r._`${m} === ${n.default.errors}`);function v(){u.forIn("key",h,x=>{!E.length&&!_.length?w(x):u.if(b(x),()=>w(x))})}a(v,"B");function b(x){let P;if(E.length>8){let D=(0,o.schemaRefOrVal)(g,f.properties,"properties");P=(0,e.isOwnProperty)(u,D,x)}else E.length?P=(0,r.or)(...E.map(D=>r._`${x} === ${D}`)):P=r.nil;return _.length&&(P=(0,r.or)(P,..._.map(D=>r._`${(0,e.usePattern)(l,D)}.test(${x})`))),(0,r.not)(P)}a(b,"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 P=u.name("valid");y.removeAdditional==="failing"?(R(x,P,!1),u.if((0,r.not)(P),()=>{l.reset(),T(x)})):(R(x,P),!A&&u.if((0,r.not)(P),()=>u.break()))}}a(w,"w");function R(x,P,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,P)}a(R,"O")}};t.default=c}),a9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mwt(),r=GN(),n=mc(),o=sZi(),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 _ of m)h.definedProperties.add(_);h.opts.unevaluated&&m.length&&h.props!==!0&&(h.props=n.mergeEvaluated.props(l,(0,n.toHash)(m),h.props));let g=m.filter(_=>!(0,n.alwaysValidSchema)(h,u[_]));if(g.length===0)return;let A=l.name("valid");for(let _ of g)y(_)?E(_):(l.if((0,r.propertyInData)(l,f,_,h.opts.ownProperties)),E(_),!h.allErrors&&l.else().var(A,!0),l.endIf()),c.it.definedProperties.add(_),c.ok(A);function y(_){return h.opts.useDefaults&&!h.compositeRule&&u[_].default!==void 0}a(y,"q");function E(_){c.subschema({keyword:"properties",schemaProp:_,dataProp:_},A)}a(E,"V")}};t.default=s}),c9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=GN(),r=Ns(),n=mc(),o=mc(),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,E=l.name("valid");h.props!==!0&&!(h.props instanceof r.Name)&&(h.props=(0,o.evaluatedPropsToName)(l,h.props));let{props:_}=h;v();function v(){for(let w of g)y&&b(w),h.allErrors?T(w):(l.var(E,!0),T(w),l.if(E))}a(v,"z");function b(w){for(let R in y)new RegExp(w).test(R)&&(0,n.checkStrictMode)(h,`property ${R} matches pattern ${w} (use allowMatchingProperties)`)}a(b,"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},E),h.opts.unevaluated&&_!==!0?l.assign(r._`${_}[${R}]`,!0):!x&&!h.allErrors&&l.if((0,r.not)(E),()=>l.break())})})}a(T,"w")}};t.default=s}),l9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),u9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=GN(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),d9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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,E)=>{let _;(0,r.alwaysValidSchema)(d,y)?c.var(g,!0):_=s.subschema({keyword:"oneOf",schemaProp:E,compositeRule:!0},g),E>0&&c.if(e._`${g} && ${h}`).assign(h,!1).assign(m,e._`[${m}, ${E}]`).else(),c.if(g,()=>{c.assign(h,!0),c.assign(m,E),_&&s.mergeEvaluated(_,e.Name)})})}a(A,"q")}};t.default=o}),f9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),p9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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 E=l.let("ifClause");c.setParams({ifClause:E}),l.if(g,y("then",E),y("else",E))}else f?l.if(g,y("then")):l.if((0,e.not)(g),y("else"));c.pass(m,()=>c.error(!0));function A(){let E=c.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);c.mergeEvaluated(E)}a(A,"H");function y(E,_){return()=>{let v=c.subschema({keyword:E},g);l.assign(m,g),c.mergeValidEvaluated(v,m),_?l.assign(_,e._`${E}`):c.setParams({ifClause:E})}}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}),h9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),m9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=iZi(),r=r9c(),n=oZi(),o=n9c(),s=i9c(),c=o9c(),l=s9c(),u=sZi(),d=a9c(),f=c9c(),h=l9c(),m=u9c(),g=d9c(),A=f9c(),y=p9c(),E=h9c();function _(v=!1){let b=[h.default,m.default,g.default,A.default,y.default,E.default,l.default,u.default,c.default,d.default,f.default];return v?b.push(r.default,o.default):b.push(e.default,n.default),b.push(s.default),b}a(_,"ra"),t.default=_}),g9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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 E(){let v=c.scopeValue("formats",{ref:y.formats,code:m.code.formats}),b=c.const("fDef",e._`${v}[${f}]`),T=c.let("fType"),w=c.let("format");c.if(e._`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>c.assign(T,e._`${b}.type || "string"`).assign(w,e._`${b}.validate`),()=>c.assign(T,e._`"string"`).assign(w,b)),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 P=A.$async?e._`(${b}.async ? await ${w}(${l}) : ${w}(${l}))`:e._`${w}(${l})`,D=e._`(typeof ${w} == "function" ? ${P} : ${w}.test(${l}))`;return e._`${w} && ${w} !== true && ${T} === ${s} && !${D}`}a(x,"A")}a(E,"z");function _(){let v=y.formats[d];if(!v){R();return}if(v===!0)return;let[b,T,w]=x(v);b===s&&o.pass(P());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,L=c.scopeValue("formats",{key:d,ref:D,code:N});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,e._`${L}.validate`]:["string",D,L]}a(x,"A");function P(){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(P,"S")}a(_,"N")}};t.default=n}),A9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=g9c(),r=[e.default];t.default=r}),y9c=Ht(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"]}),E9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=H6c(),r=t9c(),n=m9c(),o=A9c(),s=y9c(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),_9c=Ht(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={}))}),v9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=_9c(),n=S6r(),o=gwt(),s=mc(),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 E=d.let("valid",!1),_=d.const("tag",e._`${f}${(0,e.getProperty)(y)}`);d.if(e._`typeof ${_} == "string"`,()=>v(),()=>u.error(!1,{discrError:r.DiscrError.Tag,tag:_,tagName:y})),u.ok(E);function v(){let w=T();d.if(!1);for(let R in w)d.elseIf(e._`${_} === ${R}`),d.assign(E,b(w[R]));d.else(),u.error(!1,{discrError:r.DiscrError.Mapping,tag:_,tagName:y}),d.endIf()}a(v,"V");function b(w){let R=d.name("valid"),x=u.subschema({keyword:"oneOf",schemaProp:w},R);return u.mergeEvaluated(x,e.Name),R}a(b,"B");function T(){var w;let R={},x=D(m),P=!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}}),aZi=Ht((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=Q6c(),n=E9c(),o=v9c(),s=C9c(),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=mwt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Ns();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=b6r();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=gwt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),b9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(L,B){return{validate:L,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:_,"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:b,int32:{type:"number",validate:R},int64:{type:"number",validate:x},float:{type:"number",validate:P},double:{type:"number",validate:P},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(L){return L%4===0&&(L%100!==0||L%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(L){let B=n.exec(L);if(!B)return!1;let q=+B[1],M=+B[2],O=+B[3];return M>=1&&M<=12&&O>=1&&O<=(M===2&&r(q)?29:o[M])}a(s,"xP");function c(L,B){if(L&&B)return L>B?1:L23||W>59||L&&!Q)return!1;if(M<=23&&O<=59&&j<60)return!0;let V=O-W*U,z=M-Y*U-(V<0?1:0);return(z===23||z===-1)&&(V===59||V===-1)&&j<61}}a(u,"Jz");function d(L,B){if(!(L&&B))return;let q=new Date("2020-01-01T"+L).valueOf(),M=new Date("2020-01-01T"+B).valueOf();if(q&&M)return q-M}a(d,"Wz");function f(L,B){if(!(L&&B))return;let q=l.exec(L),M=l.exec(B);if(q&&M)return L=q[1]+q[2]+q[3],B=M[1]+M[2]+M[3],L>B?1:L=T}a(R,"Cs");function x(L){return Number.isInteger(L)}a(x,"Ts");function P(){return!0}a(P,"TP");var D=/[^\\]\\Z/;function N(L){if(D.test(L))return!1;try{return new RegExp(L),!0}catch{return!1}}a(N,"ys")}),S9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=aZi(),r=Ns(),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 E(){let b=u.scopeValue("formats",{ref:A.formats,code:g.code.formats}),T=u.const("fmt",r._`${b}[${y.schemaCode}]`);l.fail$data((0,r.or)(r._`typeof ${T} != "object"`,r._`${T} instanceof RegExp`,r._`typeof ${T}.compare != "function"`,v(T)))}a(E,"q");function _(){let b=y.schema,T=A.formats[b];if(!T||T===!0)return;if(typeof T!="object"||T instanceof RegExp||typeof T.compare!="function")throw Error(`"${h}": format "${b}" does not define "compare" function`);let w=u.scopeValue("formats",{key:b,ref:T,code:g.code.formats?r._`${g.code.formats}${(0,r.getProperty)(b)}`:void 0});l.fail$data(v(w))}a(_,"V");function v(b){return r._`${b}.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}),T9c=Ht((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=b9c(),n=S9c(),o=Ns(),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}),I9c=50;a(r8r,"g9");a(pZi,"K5");a(x9c,"Uk");a(Vie,"v4");Ewt=["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"],w9c=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],R9c="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",k9c=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,P9c=/(.*?)<\/command-name>/;a(I6r,"h9");D9c={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(AZi,"q5");a(N9c,"JN");a(KV,"G1");a(M9c,"zk");a(O9c,"Nk");a(L9c,"wk");n8r=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=AZi(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()}},R1=class extends Error{static{a(this,"W6")}};a(yZi,"V5");a(s_,"R$");a(M8e,"U1");B9c=typeof global=="object"&&global&&global.Object===Object&&global,EZi=B9c,F9c=typeof self=="object"&&self&&self.Object===Object&&self,U9c=EZi||F9c||Function("return this")(),Ove=U9c,Q9c=Ove.Symbol,lW=Q9c,_Zi=Object.prototype,q9c=_Zi.hasOwnProperty,j9c=_Zi.toString,TFe=lW?lW.toStringTag:void 0;a(H9c,"Ak");G9c=H9c,$9c=Object.prototype,V9c=$9c.toString;a(W9c,"Pk");z9c=W9c,Y9c="[object Null]",K9c="[object Undefined]",FYi=lW?lW.toStringTag:void 0;a(J9c,"_k");O8e=J9c;a(Z9c,"kk");Y9=Z9c,X9c="[object AsyncFunction]",eUc="[object Function]",tUc="[object GeneratorFunction]",rUc="[object Proxy]";a(nUc,"xk");x6r=nUc,iUc=Ove["__core-js_shared__"],bFr=iUc,UYi=(function(){var t=/[^.]+$/.exec(bFr&&bFr.keys&&bFr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(oUc,"fk");sUc=oUc,aUc=Function.prototype,cUc=aUc.toString;a(lUc,"uk");uUc=lUc,dUc=/[\\^$.*+?()[\]{}|]/g,fUc=/^\[object .+?Constructor\]$/,pUc=Function.prototype,hUc=Object.prototype,mUc=pUc.toString,gUc=hUc.hasOwnProperty,AUc=RegExp("^"+mUc.call(gUc).replace(dUc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(yUc,"rk");EUc=yUc;a(_Uc,"ok");vUc=_Uc;a(CUc,"tk");w6r=CUc,bUc=w6r(Object,"create"),o8e=bUc;a(SUc,"sk");TUc=SUc;a(IUc,"ek");xUc=IUc,wUc="__lodash_hash_undefined__",RUc=Object.prototype,kUc=RUc.hasOwnProperty;a(PUc,"XS");DUc=PUc,NUc=Object.prototype,MUc=NUc.hasOwnProperty;a(OUc,"GS");LUc=OUc,BUc="__lodash_hash_undefined__";a(FUc,"HS");UUc=FUc;a(Lve,"a0");Lve.prototype.clear=TUc;Lve.prototype.delete=xUc;Lve.prototype.get=DUc;Lve.prototype.has=LUc;Lve.prototype.set=UUc;QYi=Lve;a(QUc,"KS");qUc=QUc;a(jUc,"qS");_wt=jUc;a(HUc,"VS");vwt=HUc,GUc=Array.prototype,$Uc=GUc.splice;a(VUc,"NS");WUc=VUc;a(zUc,"wS");YUc=zUc;a(KUc,"OS");JUc=KUc;a(ZUc,"DS");XUc=ZUc;a(Bve,"s0");Bve.prototype.clear=qUc;Bve.prototype.delete=WUc;Bve.prototype.get=YUc;Bve.prototype.has=JUc;Bve.prototype.set=XUc;Cwt=Bve,e7c=w6r(Ove,"Map"),vZi=e7c;a(t7c,"ZS");r7c=t7c;a(n7c,"MS");i7c=n7c;a(o7c,"LS");bwt=o7c;a(s7c,"jS");a7c=s7c;a(c7c,"AS");l7c=c7c;a(u7c,"IS");d7c=u7c;a(f7c,"RS");p7c=f7c;a(Fve,"e0");Fve.prototype.clear=r7c;Fve.prototype.delete=a7c;Fve.prototype.get=l7c;Fve.prototype.has=d7c;Fve.prototype.set=p7c;R6r=Fve,h7c="Expected a function";a(k6r,"MG");k6r.Cache=R6r;Py=k6r,Uve=Py(()=>(process.env.CLAUDE_CONFIG_DIR??(0,bZi.join)((0,CZi.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),SKh=Py(()=>s_(process.env.CLAUDE_CODE_SUPERVISED));a(En,"y");a(gt,"Z");SZi=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return SZi=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(s8e,"T4");i8r=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"),Ri=class extends Error{static{a(this,"g")}},Zv=class t extends Ri{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 fve({message:n,cause:i8r(r)});let s=r,c=s?.error?.type;return e===400?new zIt(e,s,n,o,c):e===401?new YIt(e,s,n,o,c):e===403?new KIt(e,s,n,o,c):e===404?new JIt(e,s,n,o,c):e===409?new ZIt(e,s,n,o,c):e===422?new XIt(e,s,n,o,c):e===429?new ext(e,s,n,o,c):e>=500?new txt(e,s,n,o,c):new t(e,s,n,o,c)}},DI=class extends Zv{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},fve=class extends Zv{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},WIt=class extends fve{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},zIt=class extends Zv{static{a(this,"p9")}},YIt=class extends Zv{static{a(this,"d9")}},KIt=class extends Zv{static{a(this,"i9")}},JIt=class extends Zv{static{a(this,"n9")}},ZIt=class extends Zv{static{a(this,"r9")}},XIt=class extends Zv{static{a(this,"o9")}},ext=class extends Zv{static{a(this,"t9")}},txt=class extends Zv{static{a(this,"a9")}},m7c=/^[a-z][a-z0-9+.-]*:/i,g7c=a(t=>m7c.test(t),"bN"),o8r=a(t=>(o8r=Array.isArray,o8r(t)),"jG"),qYi=o8r;a(s8r,"w5");a(jYi,"IG");a(A7c,"_N");y7c=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Ri(`${t} must be an integer`);if(e<0)throw new Ri(`${t} must be a positive integer`);return e},"kN"),TZi=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),E7c=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),iW="0.94.0",_7c=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(v7c,"SS");C7c=a(()=>{let t=v7c();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":iW,"X-Stainless-OS":GYi(Deno.build.os),"X-Stainless-Arch":HYi(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":iW,"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":iW,"X-Stainless-OS":GYi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":HYi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=b7c();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":iW,"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":iW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(b7c,"CS");HYi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),GYi=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"),P6r=a(()=>$Yi??($Yi=C7c()),"s9");a(S7c,"yN");a(IZi,"RG");a(xZi,"D5");a(D6r,"e9");a(T7c,"fN");I7c=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(x7c,"hN");w7c="urn:ietf:params:oauth:grant-type:jwt-bearer",R7c="refresh_token",wZi="/v1/oauth/token",rxt="oauth-2025-04-20",k7c="oidc-federation-2026-04-01",P7c=120,N6r=30,D7c=5,VYi=1048576;a(RZi,"Z5");a(kZi,"M5");SFr=2e3,N7c=new Set(["error","error_description","error_uri"]);a(Ak,"Z6");a(PZi,"L5");a(DZi,"j5");a(M7c,"fS");nu=class extends Ri{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(Wie,"Y4");a8r=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-Wie();return n>P7c?r.token:n>N6r?(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||Wie()-this.lastAdvisoryError{this.lastAdvisoryError=Wie(),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}},tu=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(O7c,"rN");a(M6r,"Q8");a(YYi,"bG");nxt={off:0,error:200,warn:300,info:400,debug:500},KYi=a((t,e,r)=>{if(t){if(A7c(nxt,t))return t;oA(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(nxt))}`)}},"_G");a(VFe,"$Q");a(vIt,"A5");L7c={error:VFe,warn:VFe,info:VFe,debug:VFe},JYi=new WeakMap;a(oA,"m$");Gie=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"),NZi="1.0",B7c=/^[A-Za-z0-9_.-]+$/;a(MZi,"tN");F7c=a(async t=>{var e,r;let n=await O6r();if(n===null)return null;let o=t??await OZi();if(o===null)return null;MZi(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=tu("ANTHROPIC_ORGANIZATION_ID"),h=tu("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=tu("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:tu("ANTHROPIC_WORKSPACE_ID"),base_url:tu("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:tu("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:tu("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=tu("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=tu("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=tu("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=tu("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=tu("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=tu("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=tu("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),U7c=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await O6r();if(!r)return null;let n=e??await OZi();return n?(MZi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),O6r=a(async()=>{if(!Q7c())return null;let t=await import("node:path"),e=tu("ANTHROPIC_CONFIG_DIR");if(e)return e;if(P6r()["X-Stainless-OS"]==="Windows"){let o=tu("APPDATA");if(o)return t.join(o,"Anthropic");let s=tu("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=tu("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=tu("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),Q7c=a(()=>{let t=P6r()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),OZi=a(async()=>{let t=await O6r();if(!t)return null;let e=tu("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(ZYi,"SG");a(q7c,"$w");a(j7c,"Qw");a(H7c,"Jw");a(LZi,"vG");a(G7c,"Xw");a($7c,"mS");a(V7c,"lS");a(W7c,"cS");Zie=class{static{a(this,"B1")}constructor(){RI.set(this,void 0),kI.set(this,void 0),En(this,RI,new Uint8Array,"f"),En(this,kI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?M6r(e):e;En(this,RI,O7c([gt(this,RI,"f"),r]),"f");let n=[],o;for(;(o=z7c(gt(this,RI,"f"),gt(this,kI,"f")))!=null;){if(o.carriage&>(this,kI,"f")==null){En(this,kI,o.index,"f");continue}if(gt(this,kI,"f")!=null&&(o.index!==gt(this,kI,"f")+1||o.carriage)){n.push(YYi(gt(this,RI,"f").subarray(0,gt(this,kI,"f")-1))),En(this,RI,gt(this,RI,"f").subarray(gt(this,kI,"f")),"f"),En(this,kI,null,"f");continue}let s=gt(this,kI,"f")!==null?o.preceding-1:o.preceding,c=YYi(gt(this,RI,"f").subarray(0,s));n.push(c),En(this,RI,gt(this,RI,"f").subarray(o.index),"f"),En(this,kI,null,"f")}return n}flush(){return gt(this,RI,"f").length?this.decode(` +`):[]}};RI=new WeakMap,kI=new WeakMap;Zie.NEWLINE_CHARS=new Set([` +`,"\r"]);Zie.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(z7c,"pS");a(Y7c,"Yw");Xie=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,IFe.set(this,void 0),this.controller=r,En(this,IFe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?oA(n):console;async function*c(){if(o)throw new Ri("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of K7c(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=TZi(u.data)??u.data,f=d?.error?.type;throw new Zv(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(s8e(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 Zie,u=D6r(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 Ri("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(s8e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(IFe=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,IFe,"f")),new t(()=>o(r),this.controller,gt(this,IFe,"f"))]}toReadableStream(){let e=this,r;return IZi({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=M6r(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(K7c,"dS");a(J7c,"iS");c8r=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]=Z7c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(Z7c,"nS");a(BZi,"P5");a(FZi,"CG");ixt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=BZi){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,WFe.set(this,void 0),En(this,WFe,e,"f")}_thenUnwrap(e){return new t(gt(this,WFe,"f"),this.responsePromise,async(r,n)=>FZi(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,WFe,"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)}};WFe=new WeakMap;oxt=class{static{a(this,"TG")}constructor(e,r,n,o){CIt.set(this,void 0),En(this,CIt,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 Ri("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await gt(this,CIt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(CIt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},l8r=class extends ixt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await BZi(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},eoe=class extends oxt{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:{...s8r(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...s8r(this.options.query),after_id:e}}:null}},c_=class extends oxt{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:{...s8r(this.options.query),page:e}}:null}},UZi=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(ave,"J0");a(qIt,"XQ");QZi=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),L6r=a(async(t,e,r=!0)=>({...t,body:await eQc(t.body,e,r)}),"J8"),XYi=new WeakMap;a(X7c,"oS");eQc=a(async(t,e,r=!0)=>{if(!await X7c(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])=>u8r(n,o,s,r))),n},"tS"),tQc=a(t=>t instanceof Blob&&"name"in t,"aS"),u8r=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,ave([await r.blob()],qIt(r,n),o))}else if(QZi(r))t.append(e,ave([await new Response(xZi(r)).blob()],qIt(r,n)));else if(tQc(r))t.append(e,ave([r],qIt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>u8r(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>u8r(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"),qZi=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"),rQc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&qZi(t),"sS"),nQc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(iQc,"_5");a(d8r,"gG");a(oQc,"$v");Sd=class{static{a(this,"t")}constructor(e){this._client=e}},jZi=Symbol.for("brand.privateNullableHeaders");a(sQc,"Jv");mr=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of sQc(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{[jZi]:!0,values:e,nulls:r}},"R");a(HZi,"qw");eKi=Object.freeze(Object.create(null)),aQc=a((t=HZi)=>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??eKi)??eKi)?.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 Ri(`Path parameters result in path with invalid segments: ${o.map(h=>h.error).join(` `)} ${s} -${f}`)}return s},"Xv"),$n=tQc(UZi),oxt=class extends Sd{static{a(this,"YQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/environments/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/environments/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/environments/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/environments/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},XFe=Symbol("anthropic.sdk.stainlessHelper");a(qIt,"k5");a(QZi,"hG");a(qZi,"S5");a(rQc,"Vw");sxt=class extends Sd{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",eoe,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/files/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/files/${e}/content?beta=true`,{...n,headers:mr([{"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($n`/v1/files/${e}?beta=true`,{...n,headers:mr([{"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",O6r({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},rQc(o.file),r?.headers])},this._client))}},axt=class extends Sd{static{a(this,"UQ")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/models/${e}?beta=true`,{...n,headers:mr([{...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",eoe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},cxt=class extends Sd{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:mr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/user_profiles/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}},lxt=class extends Sd{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/agents/${e}/versions?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},o8e=class extends Sd{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new lxt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get($n`/v1/agents/${e}?beta=true`,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/agents/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/agents/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};o8e.Versions=lxt;uxt=class extends Sd{static{a(this,"qQ")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post($n`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:mr([{"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($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:mr([{"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($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:mr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/memory_stores/${e}/memories?beta=true`,c_,{query:s,...n,headers:mr([{"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($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:mr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},dxt=class extends Sd{static{a(this,"VQ")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get($n`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/memory_stores/${e}/memory_versions?beta=true`,c_,{query:s,...n,headers:mr([{"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($n`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},fve=class extends Sd{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new uxt(this._client),this.memoryVersions=new dxt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/memory_stores/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/memory_stores/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};fve.Memories=uxt;fve.MemoryVersions=dxt;fxt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new Zie;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 Ri("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 Ri("Attempted to iterate over a response with no body");return new t(P6r(e.body),r)}},pxt=class extends Sd{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:mr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/messages/batches/${e}?beta=true`,{...n,headers:mr([{"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",eoe,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/messages/batches/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:mr([{"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 Ri(`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:mr([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>fxt.fromResponse(l.response,l.controller))}},jZi={"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(HZi,"Bw");a(JYi,"uG");a(GZi,"mG");a(nQc,"Nv");iQc=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),eve(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),eve(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),eve(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),eve(t);break;case"delimiter":return t=t.slice(0,t.length-1),eve(t)}return t},"W8"),oQc=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"),sQc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),$Zi=a(t=>JSON.parse(sQc(oQc(eve(iQc(t))))),"C5"),eKi="__json_buf";a(tKi,"Ow");d8r=class t{static{a(this,"ZQ")}constructor(e,r){dk.add(this),this.messages=[],this.receivedMessages=[],KV.set(this,void 0),W_e.set(this,null),this.controller=new AbortController,TFe.set(this,void 0),CIt.set(this,()=>{}),IFe.set(this,()=>{}),xFe.set(this,void 0),bIt.set(this,()=>{}),wFe.set(this,()=>{}),U9.set(this,{}),RFe.set(this,!1),SIt.set(this,!1),TIt.set(this,!1),Qie.set(this,!1),IIt.set(this,void 0),xIt.set(this,void 0),kFe.set(this,void 0),wIt.set(this,n=>{if(En(this,SIt,!0,"f"),i8e(n)&&(n=new kI),n instanceof kI)return En(this,TIt,!0,"f"),this._emit("abort",n);if(n instanceof Ri)return this._emit("error",n);if(n instanceof Error){let o=new Ri(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ri(String(n)))}),En(this,TFe,new Promise((n,o)=>{En(this,CIt,n,"f"),En(this,IFe,o,"f")}),"f"),En(this,xFe,new Promise((n,o)=>{En(this,bIt,n,"f"),En(this,wFe,o,"f")}),"f"),gt(this,TFe,"f").catch(()=>{}),gt(this,xFe,"f").catch(()=>{}),En(this,W_e,e,"f"),En(this,kFe,r?.logger??console,"f")}get response(){return gt(this,IIt,"f")}get request_id(){return gt(this,xIt,"f")}async withResponse(){En(this,Qie,!0,"f");let e=await gt(this,TFe,"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 En(s,W_e,{...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,wIt,"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,dk,"m",TFr).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,dk,"m",IFr).call(this,u);if(l.controller.signal?.aborted)throw new kI;gt(this,dk,"m",xFr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,IIt,e,"f"),En(this,xIt,e?.headers.get("request-id"),"f"),gt(this,CIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,RFe,"f")}get errored(){return gt(this,SIt,"f")}get aborted(){return gt(this,TIt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,U9,"f")[e]||(gt(this,U9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,U9,"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,U9,"f")[e]||(gt(this,U9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,Qie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,Qie,!0,"f"),await gt(this,xFe,"f")}get currentMessage(){return gt(this,KV,"f")}async finalMessage(){return await this.done(),gt(this,dk,"m",SFr).call(this)}async finalText(){return await this.done(),gt(this,dk,"m",ZYi).call(this)}_emit(e,...r){if(gt(this,RFe,"f"))return;e==="end"&&(En(this,RFe,!0,"f"),gt(this,bIt,"f").call(this));let n=gt(this,U9,"f")[e];if(n&&(gt(this,U9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Qie,"f")&&!n?.length&&Promise.reject(o),gt(this,IFe,"f").call(this,o),gt(this,wFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Qie,"f")&&!n?.length&&Promise.reject(o),gt(this,IFe,"f").call(this,o),gt(this,wFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,dk,"m",SFr).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,dk,"m",TFr).call(this),this._connected(null);let s=Xie.fromReadableStream(e,this.controller);for await(let c of s)gt(this,dk,"m",IFr).call(this,c);if(s.controller.signal?.aborted)throw new kI;gt(this,dk,"m",xFr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(KV=new WeakMap,W_e=new WeakMap,TFe=new WeakMap,CIt=new WeakMap,IFe=new WeakMap,xFe=new WeakMap,bIt=new WeakMap,wFe=new WeakMap,U9=new WeakMap,RFe=new WeakMap,SIt=new WeakMap,TIt=new WeakMap,Qie=new WeakMap,IIt=new WeakMap,xIt=new WeakMap,kFe=new WeakMap,wIt=new WeakMap,dk=new WeakSet,SFr=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),ZYi=a(function(){if(this.receivedMessages.length===0)throw new Ri("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 Ri("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),TFr=a(function(){this.ended||En(this,KV,void 0,"f")},"cG"),IFr=a(function(e){if(this.ended)return;let r=gt(this,dk,"m",XYi).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":{tKi(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(JYi(r,gt(this,W_e,"f"),{logger:gt(this,kFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,KV,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),xFr=a(function(){if(this.ended)throw new Ri("stream has ended, this shouldn't happen");let e=gt(this,KV,"f");if(!e)throw new Ri("request ended without sending any chunks");return En(this,KV,void 0,"f"),JYi(e,gt(this,W_e,"f"),{logger:gt(this,kFe,"f")})},"dG"),XYi=a(function(e){let r=gt(this,KV,"f");if(e.type==="message_start"){if(r)throw new Ri(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ri(`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&&tKi(n)){let o=n[eKi]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,eKi,{value:o,enumerable:!1,writable:!0}),o)try{s.input=$Zi(o)}catch(c){let l=new Ri(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);gt(this,wIt,"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 Xie(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},hxt=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}},aQc=1e5,cQc=`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"),$n=aQc(HZi),sxt=class extends Sd{static{a(this,"YQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/environments/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/environments/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/environments/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/environments/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},t8e=Symbol("anthropic.sdk.stainlessHelper");a(jIt,"k5");a(GZi,"hG");a($Zi,"S5");a(cQc,"Vw");axt=class extends Sd{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",eoe,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/files/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/files/${e}/content?beta=true`,{...n,headers:mr([{"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($n`/v1/files/${e}?beta=true`,{...n,headers:mr([{"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",L6r({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},cQc(o.file),r?.headers])},this._client))}},cxt=class extends Sd{static{a(this,"UQ")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/models/${e}?beta=true`,{...n,headers:mr([{...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",eoe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},lxt=class extends Sd{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:mr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/user_profiles/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}},uxt=class extends Sd{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/agents/${e}/versions?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},a8e=class extends Sd{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new uxt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get($n`/v1/agents/${e}?beta=true`,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/agents/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/agents/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};a8e.Versions=uxt;dxt=class extends Sd{static{a(this,"qQ")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post($n`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:mr([{"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($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:mr([{"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($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:mr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/memory_stores/${e}/memories?beta=true`,c_,{query:s,...n,headers:mr([{"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($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:mr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},fxt=class extends Sd{static{a(this,"VQ")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get($n`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/memory_stores/${e}/memory_versions?beta=true`,c_,{query:s,...n,headers:mr([{"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($n`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},pve=class extends Sd{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new dxt(this._client),this.memoryVersions=new fxt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/memory_stores/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/memory_stores/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};pve.Memories=dxt;pve.MemoryVersions=fxt;pxt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new Zie;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 Ri("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 Ri("Attempted to iterate over a response with no body");return new t(D6r(e.body),r)}},hxt=class extends Sd{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:mr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/messages/batches/${e}?beta=true`,{...n,headers:mr([{"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",eoe,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/messages/batches/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:mr([{"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 Ri(`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:mr([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>pxt.fromResponse(l.response,l.controller))}},VZi={"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(WZi,"Bw");a(tKi,"uG");a(zZi,"mG");a(lQc,"Nv");uQc=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),tve(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),tve(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),tve(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),tve(t);break;case"delimiter":return t=t.slice(0,t.length-1),tve(t)}return t},"W8"),dQc=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"),fQc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),YZi=a(t=>JSON.parse(fQc(dQc(tve(uQc(t))))),"C5"),iKi="__json_buf";a(oKi,"Ow");f8r=class t{static{a(this,"ZQ")}constructor(e,r){fk.add(this),this.messages=[],this.receivedMessages=[],JV.set(this,void 0),z_e.set(this,null),this.controller=new AbortController,xFe.set(this,void 0),bIt.set(this,()=>{}),wFe.set(this,()=>{}),RFe.set(this,void 0),SIt.set(this,()=>{}),kFe.set(this,()=>{}),Q9.set(this,{}),PFe.set(this,!1),TIt.set(this,!1),IIt.set(this,!1),Qie.set(this,!1),xIt.set(this,void 0),wIt.set(this,void 0),DFe.set(this,void 0),RIt.set(this,n=>{if(En(this,TIt,!0,"f"),s8e(n)&&(n=new DI),n instanceof DI)return En(this,IIt,!0,"f"),this._emit("abort",n);if(n instanceof Ri)return this._emit("error",n);if(n instanceof Error){let o=new Ri(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ri(String(n)))}),En(this,xFe,new Promise((n,o)=>{En(this,bIt,n,"f"),En(this,wFe,o,"f")}),"f"),En(this,RFe,new Promise((n,o)=>{En(this,SIt,n,"f"),En(this,kFe,o,"f")}),"f"),gt(this,xFe,"f").catch(()=>{}),gt(this,RFe,"f").catch(()=>{}),En(this,z_e,e,"f"),En(this,DFe,r?.logger??console,"f")}get response(){return gt(this,xIt,"f")}get request_id(){return gt(this,wIt,"f")}async withResponse(){En(this,Qie,!0,"f");let e=await gt(this,xFe,"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 En(s,z_e,{...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,RIt,"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,fk,"m",IFr).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,fk,"m",xFr).call(this,u);if(l.controller.signal?.aborted)throw new DI;gt(this,fk,"m",wFr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,xIt,e,"f"),En(this,wIt,e?.headers.get("request-id"),"f"),gt(this,bIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,PFe,"f")}get errored(){return gt(this,TIt,"f")}get aborted(){return gt(this,IIt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,Q9,"f")[e]||(gt(this,Q9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,Q9,"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,Q9,"f")[e]||(gt(this,Q9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,Qie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,Qie,!0,"f"),await gt(this,RFe,"f")}get currentMessage(){return gt(this,JV,"f")}async finalMessage(){return await this.done(),gt(this,fk,"m",TFr).call(this)}async finalText(){return await this.done(),gt(this,fk,"m",rKi).call(this)}_emit(e,...r){if(gt(this,PFe,"f"))return;e==="end"&&(En(this,PFe,!0,"f"),gt(this,SIt,"f").call(this));let n=gt(this,Q9,"f")[e];if(n&&(gt(this,Q9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Qie,"f")&&!n?.length&&Promise.reject(o),gt(this,wFe,"f").call(this,o),gt(this,kFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Qie,"f")&&!n?.length&&Promise.reject(o),gt(this,wFe,"f").call(this,o),gt(this,kFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,fk,"m",TFr).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,fk,"m",IFr).call(this),this._connected(null);let s=Xie.fromReadableStream(e,this.controller);for await(let c of s)gt(this,fk,"m",xFr).call(this,c);if(s.controller.signal?.aborted)throw new DI;gt(this,fk,"m",wFr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(JV=new WeakMap,z_e=new WeakMap,xFe=new WeakMap,bIt=new WeakMap,wFe=new WeakMap,RFe=new WeakMap,SIt=new WeakMap,kFe=new WeakMap,Q9=new WeakMap,PFe=new WeakMap,TIt=new WeakMap,IIt=new WeakMap,Qie=new WeakMap,xIt=new WeakMap,wIt=new WeakMap,DFe=new WeakMap,RIt=new WeakMap,fk=new WeakSet,TFr=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),rKi=a(function(){if(this.receivedMessages.length===0)throw new Ri("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 Ri("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),IFr=a(function(){this.ended||En(this,JV,void 0,"f")},"cG"),xFr=a(function(e){if(this.ended)return;let r=gt(this,fk,"m",nKi).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":{oKi(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(tKi(r,gt(this,z_e,"f"),{logger:gt(this,DFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,JV,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),wFr=a(function(){if(this.ended)throw new Ri("stream has ended, this shouldn't happen");let e=gt(this,JV,"f");if(!e)throw new Ri("request ended without sending any chunks");return En(this,JV,void 0,"f"),tKi(e,gt(this,z_e,"f"),{logger:gt(this,DFe,"f")})},"dG"),nKi=a(function(e){let r=gt(this,JV,"f");if(e.type==="message_start"){if(r)throw new Ri(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ri(`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&&oKi(n)){let o=n[iKi]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,iKi,{value:o,enumerable:!1,writable:!0}),o)try{s.input=YZi(o)}catch(c){let l=new Ri(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);gt(this,RIt,"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 Xie(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},mxt=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}},pQc=1e5,hQc=`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 @@ -1571,24 +1571,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(nKi,"Lw");mxt=class{static{a(this,"jQ")}constructor(e,r,n){PFe.add(this),this.client=e,z_e.set(this,!1),qie.set(this,!1),Q0.set(this,void 0),w1.set(this,void 0),II.set(this,void 0),G9.set(this,void 0),JV.set(this,void 0),DFe.set(this,0),En(this,Q0,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...QZi(r.tools,r.messages)].join(", ");En(this,w1,{...n,headers:mr([{"x-stainless-helper":o},n?.headers])},"f"),En(this,JV,nKi(),"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*[(z_e=new WeakMap,qie=new WeakMap,Q0=new WeakMap,w1=new WeakMap,II=new WeakMap,G9=new WeakMap,JV=new WeakMap,DFe=new WeakMap,PFe=new WeakSet,rKi=a(async function(){let e=gt(this,Q0,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(gt(this,II,"f")!==void 0)try{let u=await gt(this,II,"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??aQc;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,Q0,"f").params.max_tokens},{signal:gt(this,w1,"f").signal,headers:mr([gt(this,w1,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new Ri("Expected text response for compaction");return gt(this,Q0,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(gt(this,z_e,"f"))throw new Ri("Cannot iterate over a consumed stream");En(this,z_e,!0,"f"),En(this,qie,!0,"f"),En(this,G9,void 0,"f");try{for(;;){let r;try{if(gt(this,Q0,"f").params.max_iterations&>(this,DFe,"f")>=gt(this,Q0,"f").params.max_iterations)break;En(this,qie,!1,"f"),En(this,G9,void 0,"f"),En(this,DFe,(e=gt(this,DFe,"f"),e++,e),"f"),En(this,II,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=gt(this,Q0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},gt(this,w1,"f")),En(this,II,r.finalMessage(),"f"),gt(this,II,"f").catch(()=>{}),yield r):(En(this,II,this.client.beta.messages.create({...s,stream:!1},gt(this,w1,"f")),"f"),yield gt(this,II,"f")),!await gt(this,PFe,"m",rKi).call(this)){if(!gt(this,qie,"f")){let{role:l,content:u}=await gt(this,II,"f");gt(this,Q0,"f").params.messages.push({role:l,content:u})}let c=await gt(this,PFe,"m",f8r).call(this,gt(this,Q0,"f").params.messages.at(-1));if(c)gt(this,Q0,"f").params.messages.push(c);else if(!gt(this,qie,"f"))break}}finally{r&&r.abort()}}if(!gt(this,II,"f"))throw new Ri("ToolRunner concluded without a message from the server");gt(this,JV,"f").resolve(await gt(this,II,"f"))}catch(r){throw En(this,z_e,!1,"f"),gt(this,JV,"f").promise.catch(()=>{}),gt(this,JV,"f").reject(r),En(this,JV,nKi(),"f"),r}}setMessagesParams(e){typeof e=="function"?gt(this,Q0,"f").params=e(gt(this,Q0,"f").params):gt(this,Q0,"f").params=e,En(this,qie,!0,"f"),En(this,G9,void 0,"f")}setRequestOptions(e){typeof e=="function"?En(this,w1,e(gt(this,w1,"f")),"f"):En(this,w1,{...gt(this,w1,"f"),...e},"f")}async generateToolResponse(e=gt(this,w1,"f").signal){let r=await gt(this,II,"f")??this.params.messages.at(-1);return r?gt(this,PFe,"m",f8r).call(this,r,e):null}done(){return gt(this,JV,"f").promise}async runUntilDone(){if(!gt(this,z_e,"f"))for await(let e of this);return this.done()}get params(){return gt(this,Q0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};f8r=a(async function(t,e=gt(this,w1,"f").signal){return gt(this,G9,"f")!==void 0?gt(this,G9,"f"):(En(this,G9,lQc(gt(this,Q0,"f").params,t,{...gt(this,w1,"f"),signal:e}),"f"),gt(this,G9,"f"))},"iG");a(lQc,"Fv");iKi={"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"},uQc=["claude-mythos-preview","claude-opus-4-6"],toe=class extends Sd{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new pxt(this._client)}create(e,r){let n=oKi(e),{betas:o,...s}=n;s.model in iKi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${iKi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),uQc.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=jZi[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=qZi(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:mr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:mr([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>GZi(n,e,{logger:this._client.logger??console}))}stream(e,r){return d8r.createMessage(this,e,r)}countTokens(e,r){let n=oKi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:mr([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new mxt(this._client,e,r)}};a(oKi,"Aw");toe.Batches=pxt;toe.BetaToolRunner=mxt;toe.ToolError=hxt;gxt=class extends Sd{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/events?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}},Axt=class extends Sd{static{a(this,"IQ")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get($n`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:mr([{"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($n`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/resources?beta=true`,c_,{query:s,...n,headers:mr([{"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($n`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},pve=class extends Sd{static{a(this,"G0")}constructor(){super(...arguments),this.events=new gxt(this._client),this.resources=new Axt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/sessions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/sessions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/sessions/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};pve.Events=gxt;pve.Resources=Axt;yxt=class extends Sd{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post($n`/v1/skills/${e}/versions?beta=true`,O6r({body:s,...n,headers:mr([{"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($n`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/skills/${e}/versions?beta=true`,c_,{query:s,...n,headers:mr([{"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($n`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}},s8e=class extends Sd{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new yxt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",O6r({body:o,...r,headers:mr([{"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($n`/v1/skills/${e}?beta=true`,{...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/skills/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};s8e.Versions=yxt;Ext=class extends Sd{static{a(this,"PQ")}create(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:mr([{"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($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:mr([{"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($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/vaults/${e}/credentials?beta=true`,c_,{query:s,...n,headers:mr([{"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($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:mr([{"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($n`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},a8e=class extends Sd{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new Ext(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/vaults/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/vaults/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/vaults/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};a8e.Credentials=Ext;k1=class extends Sd{static{a(this,"G6")}constructor(){super(...arguments),this.models=new axt(this._client),this.messages=new toe(this._client),this.agents=new o8e(this._client),this.environments=new oxt(this._client),this.sessions=new pve(this._client),this.vaults=new a8e(this._client),this.memoryStores=new fve(this._client),this.files=new sxt(this._client),this.skills=new s8e(this._client),this.userProfiles=new cxt(this._client)}};k1.Models=axt;k1.Messages=toe;k1.Agents=o8e;k1.Environments=oxt;k1.Sessions=pve;k1.Vaults=a8e;k1.MemoryStores=fve;k1.Files=sxt;k1.Skills=s8e;k1.UserProfiles=cxt;_xt=class extends Sd{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:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}};a(VZi,"Iw");a(sKi,"nG");a(WZi,"rG");a(dQc,"bv");lKi="__json_buf";a(uKi,"bw");p8r=class t{static{a(this,"CQ")}constructor(e,r){fk.add(this),this.messages=[],this.receivedMessages=[],ZV.set(this,void 0),Y_e.set(this,null),this.controller=new AbortController,NFe.set(this,void 0),RIt.set(this,()=>{}),MFe.set(this,()=>{}),OFe.set(this,void 0),kIt.set(this,()=>{}),LFe.set(this,()=>{}),Q9.set(this,{}),BFe.set(this,!1),PIt.set(this,!1),DIt.set(this,!1),jie.set(this,!1),NIt.set(this,void 0),MIt.set(this,void 0),FFe.set(this,void 0),RFr.set(this,n=>{if(En(this,PIt,!0,"f"),i8e(n)&&(n=new kI),n instanceof kI)return En(this,DIt,!0,"f"),this._emit("abort",n);if(n instanceof Ri)return this._emit("error",n);if(n instanceof Error){let o=new Ri(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ri(String(n)))}),En(this,NFe,new Promise((n,o)=>{En(this,RIt,n,"f"),En(this,MFe,o,"f")}),"f"),En(this,OFe,new Promise((n,o)=>{En(this,kIt,n,"f"),En(this,LFe,o,"f")}),"f"),gt(this,NFe,"f").catch(()=>{}),gt(this,OFe,"f").catch(()=>{}),En(this,Y_e,e,"f"),En(this,FFe,r?.logger??console,"f")}get response(){return gt(this,NIt,"f")}get request_id(){return gt(this,MIt,"f")}async withResponse(){En(this,jie,!0,"f");let e=await gt(this,NFe,"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 En(s,Y_e,{...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,RFr,"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,fk,"m",kFr).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,fk,"m",PFr).call(this,u);if(l.controller.signal?.aborted)throw new kI;gt(this,fk,"m",DFr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,NIt,e,"f"),En(this,MIt,e?.headers.get("request-id"),"f"),gt(this,RIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,BFe,"f")}get errored(){return gt(this,PIt,"f")}get aborted(){return gt(this,DIt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,Q9,"f")[e]||(gt(this,Q9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,Q9,"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,Q9,"f")[e]||(gt(this,Q9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,jie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,jie,!0,"f"),await gt(this,OFe,"f")}get currentMessage(){return gt(this,ZV,"f")}async finalMessage(){return await this.done(),gt(this,fk,"m",wFr).call(this)}async finalText(){return await this.done(),gt(this,fk,"m",aKi).call(this)}_emit(e,...r){if(gt(this,BFe,"f"))return;e==="end"&&(En(this,BFe,!0,"f"),gt(this,kIt,"f").call(this));let n=gt(this,Q9,"f")[e];if(n&&(gt(this,Q9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,jie,"f")&&!n?.length&&Promise.reject(o),gt(this,MFe,"f").call(this,o),gt(this,LFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,jie,"f")&&!n?.length&&Promise.reject(o),gt(this,MFe,"f").call(this,o),gt(this,LFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,fk,"m",wFr).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,fk,"m",kFr).call(this),this._connected(null);let s=Xie.fromReadableStream(e,this.controller);for await(let c of s)gt(this,fk,"m",PFr).call(this,c);if(s.controller.signal?.aborted)throw new kI;gt(this,fk,"m",DFr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(ZV=new WeakMap,Y_e=new WeakMap,NFe=new WeakMap,RIt=new WeakMap,MFe=new WeakMap,OFe=new WeakMap,kIt=new WeakMap,LFe=new WeakMap,Q9=new WeakMap,BFe=new WeakMap,PIt=new WeakMap,DIt=new WeakMap,jie=new WeakMap,NIt=new WeakMap,MIt=new WeakMap,FFe=new WeakMap,RFr=new WeakMap,fk=new WeakSet,wFr=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),aKi=a(function(){if(this.receivedMessages.length===0)throw new Ri("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 Ri("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),kFr=a(function(){this.ended||En(this,ZV,void 0,"f")},"aG"),PFr=a(function(e){if(this.ended)return;let r=gt(this,fk,"m",cKi).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":{uKi(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(sKi(r,gt(this,Y_e,"f"),{logger:gt(this,FFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,ZV,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),DFr=a(function(){if(this.ended)throw new Ri("stream has ended, this shouldn't happen");let e=gt(this,ZV,"f");if(!e)throw new Ri("request ended without sending any chunks");return En(this,ZV,void 0,"f"),sKi(e,gt(this,Y_e,"f"),{logger:gt(this,FFe,"f")})},"eG"),cKi=a(function(e){let r=gt(this,ZV,"f");if(e.type==="message_start"){if(r)throw new Ri(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ri(`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&&uKi(n)){let o=n[lKi]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,lKi,{value:o,enumerable:!1,writable:!0}),o&&(s.input=$Zi(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 Xie(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},vxt=class extends Sd{static{a(this,"TQ")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get($n`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",eoe,{query:e,...r})}delete(e,r){return this._client.delete($n`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post($n`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new Ri(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:mr([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>fxt.fromResponse(s.response,s.controller))}},c8e=class extends Sd{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new vxt(this._client)}create(e,r){e.model in dKi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${dKi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),fQc.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=jZi[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=qZi(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:mr([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>WZi(n,e,{logger:this._client.logger??console}))}stream(e,r){return p8r.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},dKi={"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"},fQc=["claude-mythos-preview","claude-opus-4-6"];c8e.Batches=vxt;Cxt=class extends Sd{static{a(this,"z8")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/models/${e}`,{...n,headers:mr([{...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",eoe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},pQc="\\n\\nHuman:",hQc="\\n\\nAssistant:",Mp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=tu("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(h8r.add(this),this._requestAuthFlags=new WeakMap,jIt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:tu("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:tu("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&&h7c())throw new Ri(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`;a(aKi,"Lw");gxt=class{static{a(this,"jQ")}constructor(e,r,n){NFe.add(this),this.client=e,Y_e.set(this,!1),qie.set(this,!1),Q0.set(this,void 0),w1.set(this,void 0),wI.set(this,void 0),$9.set(this,void 0),ZV.set(this,void 0),MFe.set(this,0),En(this,Q0,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...GZi(r.tools,r.messages)].join(", ");En(this,w1,{...n,headers:mr([{"x-stainless-helper":o},n?.headers])},"f"),En(this,ZV,aKi(),"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*[(Y_e=new WeakMap,qie=new WeakMap,Q0=new WeakMap,w1=new WeakMap,wI=new WeakMap,$9=new WeakMap,ZV=new WeakMap,MFe=new WeakMap,NFe=new WeakSet,sKi=a(async function(){let e=gt(this,Q0,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(gt(this,wI,"f")!==void 0)try{let u=await gt(this,wI,"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??pQc;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,Q0,"f").params.max_tokens},{signal:gt(this,w1,"f").signal,headers:mr([gt(this,w1,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new Ri("Expected text response for compaction");return gt(this,Q0,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(gt(this,Y_e,"f"))throw new Ri("Cannot iterate over a consumed stream");En(this,Y_e,!0,"f"),En(this,qie,!0,"f"),En(this,$9,void 0,"f");try{for(;;){let r;try{if(gt(this,Q0,"f").params.max_iterations&>(this,MFe,"f")>=gt(this,Q0,"f").params.max_iterations)break;En(this,qie,!1,"f"),En(this,$9,void 0,"f"),En(this,MFe,(e=gt(this,MFe,"f"),e++,e),"f"),En(this,wI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=gt(this,Q0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},gt(this,w1,"f")),En(this,wI,r.finalMessage(),"f"),gt(this,wI,"f").catch(()=>{}),yield r):(En(this,wI,this.client.beta.messages.create({...s,stream:!1},gt(this,w1,"f")),"f"),yield gt(this,wI,"f")),!await gt(this,NFe,"m",sKi).call(this)){if(!gt(this,qie,"f")){let{role:l,content:u}=await gt(this,wI,"f");gt(this,Q0,"f").params.messages.push({role:l,content:u})}let c=await gt(this,NFe,"m",p8r).call(this,gt(this,Q0,"f").params.messages.at(-1));if(c)gt(this,Q0,"f").params.messages.push(c);else if(!gt(this,qie,"f"))break}}finally{r&&r.abort()}}if(!gt(this,wI,"f"))throw new Ri("ToolRunner concluded without a message from the server");gt(this,ZV,"f").resolve(await gt(this,wI,"f"))}catch(r){throw En(this,Y_e,!1,"f"),gt(this,ZV,"f").promise.catch(()=>{}),gt(this,ZV,"f").reject(r),En(this,ZV,aKi(),"f"),r}}setMessagesParams(e){typeof e=="function"?gt(this,Q0,"f").params=e(gt(this,Q0,"f").params):gt(this,Q0,"f").params=e,En(this,qie,!0,"f"),En(this,$9,void 0,"f")}setRequestOptions(e){typeof e=="function"?En(this,w1,e(gt(this,w1,"f")),"f"):En(this,w1,{...gt(this,w1,"f"),...e},"f")}async generateToolResponse(e=gt(this,w1,"f").signal){let r=await gt(this,wI,"f")??this.params.messages.at(-1);return r?gt(this,NFe,"m",p8r).call(this,r,e):null}done(){return gt(this,ZV,"f").promise}async runUntilDone(){if(!gt(this,Y_e,"f"))for await(let e of this);return this.done()}get params(){return gt(this,Q0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};p8r=a(async function(t,e=gt(this,w1,"f").signal){return gt(this,$9,"f")!==void 0?gt(this,$9,"f"):(En(this,$9,mQc(gt(this,Q0,"f").params,t,{...gt(this,w1,"f"),signal:e}),"f"),gt(this,$9,"f"))},"iG");a(mQc,"Fv");cKi={"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"},gQc=["claude-mythos-preview","claude-opus-4-6"],toe=class extends Sd{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new hxt(this._client)}create(e,r){let n=lKi(e),{betas:o,...s}=n;s.model in cKi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${cKi[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),gQc.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=VZi[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=$Zi(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:mr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:mr([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>zZi(n,e,{logger:this._client.logger??console}))}stream(e,r){return f8r.createMessage(this,e,r)}countTokens(e,r){let n=lKi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:mr([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new gxt(this._client,e,r)}};a(lKi,"Aw");toe.Batches=hxt;toe.BetaToolRunner=gxt;toe.ToolError=mxt;Axt=class extends Sd{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/events?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}},yxt=class extends Sd{static{a(this,"IQ")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get($n`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:mr([{"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($n`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/resources?beta=true`,c_,{query:s,...n,headers:mr([{"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($n`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},hve=class extends Sd{static{a(this,"G0")}constructor(){super(...arguments),this.events=new Axt(this._client),this.resources=new yxt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/sessions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/sessions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/sessions/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};hve.Events=Axt;hve.Resources=yxt;Ext=class extends Sd{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post($n`/v1/skills/${e}/versions?beta=true`,L6r({body:s,...n,headers:mr([{"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($n`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/skills/${e}/versions?beta=true`,c_,{query:s,...n,headers:mr([{"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($n`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}},c8e=class extends Sd{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new Ext(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",L6r({body:o,...r,headers:mr([{"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($n`/v1/skills/${e}?beta=true`,{...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/skills/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};c8e.Versions=Ext;_xt=class extends Sd{static{a(this,"PQ")}create(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:mr([{"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($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:mr([{"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($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/vaults/${e}/credentials?beta=true`,c_,{query:s,...n,headers:mr([{"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($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:mr([{"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($n`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},l8e=class extends Sd{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new _xt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/vaults/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:mr([{"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",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/vaults/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/vaults/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};l8e.Credentials=_xt;k1=class extends Sd{static{a(this,"G6")}constructor(){super(...arguments),this.models=new cxt(this._client),this.messages=new toe(this._client),this.agents=new a8e(this._client),this.environments=new sxt(this._client),this.sessions=new hve(this._client),this.vaults=new l8e(this._client),this.memoryStores=new pve(this._client),this.files=new axt(this._client),this.skills=new c8e(this._client),this.userProfiles=new lxt(this._client)}};k1.Models=cxt;k1.Messages=toe;k1.Agents=a8e;k1.Environments=sxt;k1.Sessions=hve;k1.Vaults=l8e;k1.MemoryStores=pve;k1.Files=axt;k1.Skills=c8e;k1.UserProfiles=lxt;vxt=class extends Sd{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:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}};a(KZi,"Iw");a(uKi,"nG");a(JZi,"rG");a(AQc,"bv");pKi="__json_buf";a(hKi,"bw");h8r=class t{static{a(this,"CQ")}constructor(e,r){pk.add(this),this.messages=[],this.receivedMessages=[],XV.set(this,void 0),K_e.set(this,null),this.controller=new AbortController,OFe.set(this,void 0),kIt.set(this,()=>{}),LFe.set(this,()=>{}),BFe.set(this,void 0),PIt.set(this,()=>{}),FFe.set(this,()=>{}),q9.set(this,{}),UFe.set(this,!1),DIt.set(this,!1),NIt.set(this,!1),jie.set(this,!1),MIt.set(this,void 0),OIt.set(this,void 0),QFe.set(this,void 0),kFr.set(this,n=>{if(En(this,DIt,!0,"f"),s8e(n)&&(n=new DI),n instanceof DI)return En(this,NIt,!0,"f"),this._emit("abort",n);if(n instanceof Ri)return this._emit("error",n);if(n instanceof Error){let o=new Ri(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ri(String(n)))}),En(this,OFe,new Promise((n,o)=>{En(this,kIt,n,"f"),En(this,LFe,o,"f")}),"f"),En(this,BFe,new Promise((n,o)=>{En(this,PIt,n,"f"),En(this,FFe,o,"f")}),"f"),gt(this,OFe,"f").catch(()=>{}),gt(this,BFe,"f").catch(()=>{}),En(this,K_e,e,"f"),En(this,QFe,r?.logger??console,"f")}get response(){return gt(this,MIt,"f")}get request_id(){return gt(this,OIt,"f")}async withResponse(){En(this,jie,!0,"f");let e=await gt(this,OFe,"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 En(s,K_e,{...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,kFr,"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,pk,"m",PFr).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,pk,"m",DFr).call(this,u);if(l.controller.signal?.aborted)throw new DI;gt(this,pk,"m",NFr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,MIt,e,"f"),En(this,OIt,e?.headers.get("request-id"),"f"),gt(this,kIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,UFe,"f")}get errored(){return gt(this,DIt,"f")}get aborted(){return gt(this,NIt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,q9,"f")[e]||(gt(this,q9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,q9,"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,q9,"f")[e]||(gt(this,q9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,jie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,jie,!0,"f"),await gt(this,BFe,"f")}get currentMessage(){return gt(this,XV,"f")}async finalMessage(){return await this.done(),gt(this,pk,"m",RFr).call(this)}async finalText(){return await this.done(),gt(this,pk,"m",dKi).call(this)}_emit(e,...r){if(gt(this,UFe,"f"))return;e==="end"&&(En(this,UFe,!0,"f"),gt(this,PIt,"f").call(this));let n=gt(this,q9,"f")[e];if(n&&(gt(this,q9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,jie,"f")&&!n?.length&&Promise.reject(o),gt(this,LFe,"f").call(this,o),gt(this,FFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,jie,"f")&&!n?.length&&Promise.reject(o),gt(this,LFe,"f").call(this,o),gt(this,FFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,pk,"m",RFr).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,pk,"m",PFr).call(this),this._connected(null);let s=Xie.fromReadableStream(e,this.controller);for await(let c of s)gt(this,pk,"m",DFr).call(this,c);if(s.controller.signal?.aborted)throw new DI;gt(this,pk,"m",NFr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(XV=new WeakMap,K_e=new WeakMap,OFe=new WeakMap,kIt=new WeakMap,LFe=new WeakMap,BFe=new WeakMap,PIt=new WeakMap,FFe=new WeakMap,q9=new WeakMap,UFe=new WeakMap,DIt=new WeakMap,NIt=new WeakMap,jie=new WeakMap,MIt=new WeakMap,OIt=new WeakMap,QFe=new WeakMap,kFr=new WeakMap,pk=new WeakSet,RFr=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),dKi=a(function(){if(this.receivedMessages.length===0)throw new Ri("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 Ri("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),PFr=a(function(){this.ended||En(this,XV,void 0,"f")},"aG"),DFr=a(function(e){if(this.ended)return;let r=gt(this,pk,"m",fKi).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":{hKi(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(uKi(r,gt(this,K_e,"f"),{logger:gt(this,QFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,XV,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),NFr=a(function(){if(this.ended)throw new Ri("stream has ended, this shouldn't happen");let e=gt(this,XV,"f");if(!e)throw new Ri("request ended without sending any chunks");return En(this,XV,void 0,"f"),uKi(e,gt(this,K_e,"f"),{logger:gt(this,QFe,"f")})},"eG"),fKi=a(function(e){let r=gt(this,XV,"f");if(e.type==="message_start"){if(r)throw new Ri(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ri(`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&&hKi(n)){let o=n[pKi]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,pKi,{value:o,enumerable:!1,writable:!0}),o&&(s.input=YZi(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 Xie(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},Cxt=class extends Sd{static{a(this,"TQ")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get($n`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",eoe,{query:e,...r})}delete(e,r){return this._client.delete($n`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post($n`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new Ri(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:mr([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>pxt.fromResponse(s.response,s.controller))}},u8e=class extends Sd{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new Cxt(this._client)}create(e,r){e.model in mKi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${mKi[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),yQc.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=VZi[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=$Zi(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:mr([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>JZi(n,e,{logger:this._client.logger??console}))}stream(e,r){return h8r.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},mKi={"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"},yQc=["claude-mythos-preview","claude-opus-4-6"];u8e.Batches=Cxt;bxt=class extends Sd{static{a(this,"z8")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/models/${e}`,{...n,headers:mr([{...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",eoe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},EQc="\\n\\nHuman:",_Qc="\\n\\nAssistant:",Mp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=tu("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(m8r.add(this),this._requestAuthFlags=new WeakMap,HIt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:tu("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:tu("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&&_7c())throw new Ri(`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??L6r.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=VYi(s.logLevel,"ClientOptions.logLevel",this)??VYi(tu("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??y7c(),En(this,jIt,_7c,"f");let l=tu("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=DZi(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=>{oA(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{oA(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new s8r(e,r=>{oA(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 F7c(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 Ri(`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,mr([{Authorization:`Bearer ${r}`}])}return mr([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return mr([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return mr([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return v7c(e)}getUserAgent(){return`${this.constructor.name}/JS ${nW}`}defaultIdempotencyKey(){return`stainless-node-retry-${_Zi()}`}makeStatusError(e,r,n,o){return Jv.generate(e,r,n,o)}buildURL(e,r,n){let o=!gt(this,h8r,"m",zZi).call(this)&&n||this.baseURL,s=u7c(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!FYi(c)||!FYi(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 Ri("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(txt)||o.append("anthropic-beta",txt),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 nxt(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(oA(this).debug(`[${d}] sending request`,Gie({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new kI;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(n8r),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new kI;let v=i8e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return oA(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),oA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,Gie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw oA(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),oA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,Gie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new VIt:new dve({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let R=`retrying, ${r} attempts remaining`;return await E7c(g.body),oA(this).info(`${E} - ${R}`),oA(this).debug(`[${d}] response error (${R})`,Gie({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";oA(this).info(`${E} - ${v}`);let b=await g.text().catch(R=>n8r(R).message),T=vZi(b),w=T?void 0:b;throw oA(this).debug(`[${d}] response error (${v})`,Gie({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 oA(this).info(E),oA(this).debug(`[${d}] response start`,Gie({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 c8r(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 p7c(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 Ri("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&&f7c("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=mr([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))}:{},...k6r(),...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=mr([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:bZi(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,jIt,"f").call(this,{body:e,headers:n})}};L6r=Mp,jIt=new WeakMap,h8r=new WeakSet,zZi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");Mp.Anthropic=L6r;Mp.HUMAN_PROMPT=pQc;Mp.AI_PROMPT=hQc;Mp.DEFAULT_TIMEOUT=6e5;Mp.AnthropicError=Ri;Mp.APIError=Jv;Mp.APIConnectionError=dve;Mp.APIConnectionTimeoutError=VIt;Mp.APIUserAbortError=kI;Mp.NotFoundError=KIt;Mp.ConflictError=JIt;Mp.RateLimitError=XIt;Mp.BadRequestError=WIt;Mp.AuthenticationError=zIt;Mp.InternalServerError=ext;Mp.PermissionDeniedError=YIt;Mp.UnprocessableEntityError=ZIt;Mp.toFile=Z7c;hve=class extends Mp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new _xt(this),this.messages=new c8e(this),this.models=new Cxt(this),this.beta=new k1(this)}};hve.Completions=_xt;hve.Messages=c8e;hve.Models=Cxt;hve.Beta=k1;a(M8e,"j4");a(HIt,"N8");a(PI,"o$");a(O8e,"D1");a(YZi,"JU");a(mQc,"Tw");gQc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),AQc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(yQc,"xw");g8r=class{static{a(this,"gw")}read(e){return(0,sA.readFile)(e,"utf8")}readBytes(e){return(0,sA.readFile)(e)}write(e,r,n){return(0,sA.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,sA.mkdir)(e,{recursive:!0})}catch(r){if(PI(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return yQc(e,r,n)}delete(e){return(0,sA.unlink)(e)}list(e){return(0,sA.readdir)(e)}append(e,r,n){return(0,sA.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,sA.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,sA.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,sA.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,sA.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},EQc=new JZi.AsyncLocalStorage;a(bxt,"w8");K_e=null;a(XZi,"uw");a(_Qc,"mw");a(pk,"L6");a(vQc,"dv");CQc=vQc;a(bQc,"iv");SQc=bQc;a(TQc,"nv");IQc=TQc;a(xQc,"rv");wQc=xQc,RQc=200;a(kQc,"tv");PQc=kQc;a(Uve,"D8");Uve.prototype.clear=CQc;Uve.prototype.delete=SQc;Uve.prototype.get=IQc;Uve.prototype.has=wQc;Uve.prototype.set=PQc;DQc=Uve,NQc=(function(){try{var t=x6r(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Sxt=NQc;a(MQc,"sv");B6r=MQc,OQc=Object.prototype,LQc=OQc.hasOwnProperty;a(BQc,"QC");eXi=BQc;a(FQc,"JC");UQc=FQc;a(QQc,"XC");qQc=QQc;a(jQc,"YC");Qve=jQc,HQc="[object Arguments]";a(GQc,"GC");fKi=GQc,tXi=Object.prototype,$Qc=tXi.hasOwnProperty,VQc=tXi.propertyIsEnumerable,WQc=fKi((function(){return arguments})())?fKi:function(t){return Qve(t)&&$Qc.call(t,"callee")&&!VQc.call(t,"callee")},l8e=WQc,zQc=Array.isArray,lW=zQc,VFe={};WL(VFe,{default:a(()=>F6r,"default")});a(YQc,"VC");KQc=YQc,rXi=typeof VFe=="object"&&VFe&&!VFe.nodeType&&VFe,pKi=rXi&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,JQc=pKi&&pKi.exports===rXi,hKi=JQc?Mve.Buffer:void 0,ZQc=hKi?hKi.isBuffer:void 0,XQc=ZQc||KQc,F6r=XQc,eqc=9007199254740991,tqc=/^(?:0|[1-9]\d*)$/;a(rqc,"DC");bwt=rqc,nqc=9007199254740991;a(iqc,"ZC");U6r=iqc,oqc="[object Arguments]",sqc="[object Array]",aqc="[object Boolean]",cqc="[object Date]",lqc="[object Error]",uqc="[object Function]",dqc="[object Map]",fqc="[object Number]",pqc="[object Object]",hqc="[object RegExp]",mqc="[object Set]",gqc="[object String]",Aqc="[object WeakMap]",yqc="[object ArrayBuffer]",Eqc="[object DataView]",_qc="[object Float32Array]",vqc="[object Float64Array]",Cqc="[object Int8Array]",bqc="[object Int16Array]",Sqc="[object Int32Array]",Tqc="[object Uint8Array]",Iqc="[object Uint8ClampedArray]",xqc="[object Uint16Array]",wqc="[object Uint32Array]",Cd={};Cd[_qc]=Cd[vqc]=Cd[Cqc]=Cd[bqc]=Cd[Sqc]=Cd[Tqc]=Cd[Iqc]=Cd[xqc]=Cd[wqc]=!0;Cd[oqc]=Cd[sqc]=Cd[yqc]=Cd[aqc]=Cd[Eqc]=Cd[cqc]=Cd[lqc]=Cd[uqc]=Cd[dqc]=Cd[fqc]=Cd[pqc]=Cd[hqc]=Cd[mqc]=Cd[gqc]=Cd[Aqc]=!1;a(Rqc,"pC");kqc=Rqc;a(Pqc,"dC");Dqc=Pqc,WFe={};WL(WFe,{default:a(()=>A8r,"default")});nXi=typeof WFe=="object"&&WFe&&!WFe.nodeType&&WFe,e8e=nXi&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,Nqc=e8e&&e8e.exports===nXi,NFr=Nqc&&mZi.process,Mqc=(function(){try{var t=e8e&&e8e.require&&e8e.require("util").types;return t||NFr&&NFr.binding&&NFr.binding("util")}catch{}})(),A8r=Mqc,mKi=A8r&&A8r.isTypedArray,Oqc=mKi?Dqc(mKi):kqc,iXi=Oqc,Lqc=Object.prototype,Bqc=Lqc.hasOwnProperty;a(Fqc,"aC");Uqc=Fqc,Qqc=Object.prototype;a(qqc,"eC");oXi=qqc;a(jqc,"$T");Hqc=jqc;a(Gqc,"QT");Q6r=Gqc;a($qc,"JT");Vqc=$qc,Wqc=Object.prototype,zqc=Wqc.hasOwnProperty;a(Yqc,"WT");Kqc=Yqc;a(Jqc,"GT");sXi=Jqc,zFe={};WL(zFe,{default:a(()=>cXi,"default")});aXi=typeof zFe=="object"&&zFe&&!zFe.nodeType&&zFe,gKi=aXi&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,Zqc=gKi&&gKi.exports===aXi,AKi=Zqc?Mve.Buffer:void 0,yKi=AKi?AKi.allocUnsafe:void 0;a(Xqc,"HT");cXi=Xqc;a(ejc,"KT");tjc=ejc;a(rjc,"qT");njc=rjc,ijc=Hqc(Object.getPrototypeOf,Object),lXi=ijc,ojc=Mve.Uint8Array,EKi=ojc;a(sjc,"zT");ajc=sjc;a(cjc,"NT");ljc=cjc,_Ki=Object.create,ujc=(function(){function t(){}return a(t,"$"),function(e){if(!z9(e))return{};if(_Ki)return _Ki(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),djc=ujc;a(fjc,"OT");pjc=fjc,hjc="[object Symbol]";a(mjc,"FT");q6r=mjc,gjc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ajc=/^\w*$/;a(yjc,"LT");Ejc=yjc,_jc=500;a(vjc,"AT");Cjc=vjc,bjc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sjc=/\\(\\)?/g,Tjc=Cjc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(bjc,function(r,n,o,s){e.push(o?s.replace(Sjc,"$1"):n||r)}),e}),Ijc=Tjc;a(xjc,"ET");wjc=xjc,Rjc=1/0,vKi=cW?cW.prototype:void 0,CKi=vKi?vKi.toString:void 0;a(uXi,"PO");kjc=uXi;a(Pjc,"_T");Djc=Pjc;a(Njc,"kT");Swt=Njc,Mjc=1/0;a(Ojc,"vT");j6r=Ojc;a(Ljc,"CT");Bjc=Ljc;a(Fjc,"TT");Ujc=Fjc;a(Qjc,"xT");qjc=Qjc;a(jjc,"yT");Hjc=jjc;a(Gjc,"fT");dXi=Gjc,H6r=null;a($jc,"CO");a(Vjc,"TO");Ixt=new Map;a(Wjc,"xO");a(zjc,"yO");G6r=new Map;a(Kjc,"fO");a(Jjc,"gO");a($6r,"V0");a(Xjc,"hO");a(eHc,"uO");tHc={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(rHc,"lT");nHc=rHc(),iHc=a(()=>{},"pT");a(pXi,"VU");oHc=D8e(),yKh=oHc.subscribe,sHc=D8e(),EKh=sHc.subscribe,aHc=D8e(),_Kh=aHc.subscribe,cHc=D8e(),vKh=cHc.subscribe,lHc=D8e(),CKh=lHc.subscribe;a(uHc,"lO");a(dHc,"tT");E8r=class{static{a(this,"cO")}#e=new Set;register(e){let r=dHc(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}},fHc=new E8r;a(pHc,"pO");hHc=Py(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(mHc,"sT");a(gHc,"eT");a(AHc,"iO");a(yHc,"tO");a(EHc,"Qx");a(bKi,"oO");a(_Hc,"aO");a(mXi,"HX");vHc={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=ef(e,rf`fs.existsSync(${t})`,0);return vo.existsSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},async stat(t){return(0,G0.stat)(t)},async readdir(t){return(0,G0.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,G0.unlink)(t)},async rmdir(t){return(0,G0.rmdir)(t)},async rm(t,e){return(0,G0.rm)(t,e)},async mkdir(t,e){try{await(0,G0.mkdir)(t,{recursive:!0,...e})}catch(r){if(PI(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,G0.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,G0.rename)(t,e)},statSync(t){let e=[];try{let o=ef(e,rf`fs.statSync(${t})`,0);return vo.statSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},lstatSync(t){let e=[];try{let o=ef(e,rf`fs.lstatSync(${t})`,0);return vo.lstatSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readFileSync(t,e){let r=[];try{let s=ef(r,rf`fs.readFileSync(${t})`,0);return vo.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{tf(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=ef(e,rf`fs.readFileBytesSync(${t})`,0);return vo.readFileSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readSync(t,e){let r=[];try{let s=ef(r,rf`fs.readSync(${t}, ${e.length} bytes)`,0),c;try{c=vo.openSync(t,"r");let l=Buffer.alloc(e.length),u=vo.readSync(c,l,0,e.length,0);return{buffer:l,bytesRead:u}}finally{c&&vo.closeSync(c)}}catch(s){var n=s,o=1}finally{tf(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=ef(n,rf`fs.appendFileSync(${t}, ${e.length} chars)`,0);if(r?.mode!==void 0)try{let l=vo.openSync(t,"ax",r.mode);try{vo.appendFileSync(l,e)}finally{vo.closeSync(l)}return}catch(l){if(PI(l)!=="EEXIST")throw l}vo.appendFileSync(t,e)}catch(c){var o=c,s=1}finally{tf(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=ef(r,rf`fs.copyFileSync(${t} → ${e})`,0);vo.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},unlinkSync(t){let e=[];try{let o=ef(e,rf`fs.unlinkSync(${t})`,0);vo.unlinkSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},renameSync(t,e){let r=[];try{let s=ef(r,rf`fs.renameSync(${t} → ${e})`,0);vo.renameSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},linkSync(t,e){let r=[];try{let s=ef(r,rf`fs.linkSync(${t} → ${e})`,0);vo.linkSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=ef(n,rf`fs.symlinkSync(${t} → ${e})`,0);vo.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{tf(n,o,s)}},readlinkSync(t){let e=[];try{let o=ef(e,rf`fs.readlinkSync(${t})`,0);return vo.readlinkSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},realpathSync(t){let e=[];try{let o=ef(e,rf`fs.realpathSync(${t})`,0);return vo.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{tf(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=ef(r,rf`fs.mkdirSync(${t})`,0),c={recursive:!0};e?.mode!==void 0&&(c.mode=e.mode);try{vo.mkdirSync(t,c)}catch(l){if(PI(l)!=="EEXIST")throw l}}catch(s){var n=s,o=1}finally{tf(r,n,o)}},readdirSync(t){let e=[];try{let o=ef(e,rf`fs.readdirSync(${t})`,0);return vo.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readdirStringSync(t){let e=[];try{let o=ef(e,rf`fs.readdirStringSync(${t})`,0);return vo.readdirSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=ef(e,rf`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{tf(e,r,n)}},rmdirSync(t){let e=[];try{let o=ef(e,rf`fs.rmdirSync(${t})`,0);vo.rmdirSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},rmSync(t,e){let r=[];try{let s=ef(r,rf`fs.rmSync(${t})`,0);vo.rmSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},createWriteStream(t){return vo.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,G0.readFile)(t);let r=await(0,G0.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(${RHc}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"}],IKi=null;a(PHc,"Ox");a(DHc,"W2");_8r={verbose:0,debug:1,info:2,warn:3,error:4},NHc=Py(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(_8r,t)?t:"debug"}),MHc=!1;a(Twt,"qX");v8r=Py(()=>{let t=Twt();return MHc||s_(process.env.DEBUG)||s_(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||gXi()||t.some(e=>e.startsWith("--debug="))||AXi()!==null}),OHc=Py(()=>{let t=Twt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return hHc(e)}),gXi=Py(()=>{let t=Twt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),AXi=Py(()=>{let t=Twt();for(let e=0;e{try{let t=_Xi(),e=(0,soe.dirname)(t),r=(0,soe.join)(e,"latest");await(0,l_.unlink)(r).catch(()=>{}),await(0,l_.symlink)(t,r)}catch{}}),TKh=(()=>{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})(),qHc={[Symbol.dispose](){}};a(jHc,"_x");rf=jHc;a(Qm,"B$");GN=a((t,e)=>{let r=[];try{let s=ef(r,rf`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},"d$");a(HHc,"w2");a(uW,"A4");a(GHc,"kx");a($Hc,"O2");VHc=2e3,xxt=new Set,xKi=!1;a(WHc,"xx");a(zHc,"yx");S8r=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=t8r();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||t8r(),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(M8e(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 hZi()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=s_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,uZi.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(s_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();pk(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:E,permissionMode:_,allowDangerouslySkipPermissions:v,permissionPromptToolName:b,continueConversation:T,resume:w,settingSources:R,skills:x,disallowedTools:P=[],tools:D,mcpServers:N,strictMcpConfig:L,canUseTool:B,includePartialMessages:q,plugins:M,sandbox:O}=this.options,{allowedTools:j=[]}=this.options;if(x!==void 0){let H=x==="all"?["Skill"]:x.map(le=>`Skill(${le})`),re=new Set(j);j=[...j,...H.filter(le=>!re.has(le))]}let Q=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(f){switch(f.type){case"enabled":f.budgetTokens===void 0?Q.push("--thinking","adaptive"):Q.push("--max-thinking-tokens",f.budgetTokens.toString());break;case"disabled":Q.push("--thinking","disabled");break;case"adaptive":Q.push("--thinking","adaptive");break}f.type!=="disabled"&&f.display&&Q.push("--thinking-display",f.display)}if(this.options.effort&&Q.push("--effort",this.options.effort),h&&Q.push("--max-turns",h.toString()),m!==void 0&&Q.push("--max-budget-usd",m.toString()),g&&Q.push("--task-budget",g.total.toString()),A&&Q.push("--model",A),r&&Q.push("--agent",r),n&&n.length>0&&Q.push("--betas",n.join(",")),E&&Q.push("--json-schema",Qm(E)),this.options.debugFile?Q.push("--debug-file",this.options.debugFile):this.options.debug&&Q.push("--debug"),!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let H=_Qc();H&&Q.push("--debug-file",H)}if(B){if(b)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");Q.push("--permission-prompt-tool","stdio")}else b&&Q.push("--permission-prompt-tool",b);if(T&&Q.push("--continue"),w&&Q.push("--resume",w),this.options.assistant&&Q.push("--assistant"),this.options.channels&&this.options.channels.length>0&&Q.push("--channels",...this.options.channels),j.length>0&&Q.push("--allowedTools",j.join(",")),P.length>0&&Q.push("--disallowedTools",P.join(",")),D!==void 0&&(Array.isArray(D)?D.length===0?Q.push("--tools",""):Q.push("--tools",D.join(",")):Q.push("--tools","default")),N&&Object.keys(N).length>0&&Q.push("--mcp-config",Qm({mcpServers:N})),R!==void 0&&Q.push(`--setting-sources=${R.join(",")}`),L&&Q.push("--strict-mcp-config"),_&&Q.push("--permission-mode",_),v&&Q.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.");Q.push("--fallback-model",y)}this.options.includeHookEvents&&Q.push("--include-hook-events"),q&&Q.push("--include-partial-messages"),this.options.sessionMirror&&Q.push("--session-mirror");for(let H of e)Q.push("--add-dir",H);if(M&&M.length>0)for(let H of M)if(H.type==="local")Q.push("--plugin-dir",H.path);else throw Error(`Unsupported plugin type: ${H.type}`);this.options.forkSession&&Q.push("--fork-session"),this.options.resumeSessionAt&&Q.push("--resume-session-at",this.options.resumeSessionAt),this.options.sessionId&&Q.push("--session-id",this.options.sessionId),this.options.persistSession===!1&&Q.push("--no-session-persistence"),this.options.managedSettings&&Q.push("--managed-settings",this.options.managedSettings);let U={...l??{}};this.options.settings&&(U.settings=this.options.settings);let Y=$Hc(U,O);for(let[H,re]of Object.entries(Y))re===null?Q.push(`--${H}`):Q.push(`--${H}`,re);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,s_(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let W=YHc(u),V=W?u:s,z=W?[...c,...Q]:[...c,u,...Q],ie={command:V,args:z,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(pk(`Spawning Claude Code (custom): ${V} ${z.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(ie)):(pk(`Spawning Claude Code: ${V} ${z.join(" ")}`),this.process=this.spawnLocalProcess(ie)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,zHc(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 R1("Claude Code process aborted by user");else if(mQc(H)){let re=KHc(u,W);this.exitError=ReferenceError(re),pk(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${H.message}`),pk(this.exitError.message)}),this.process.on("exit",(H,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new R1("Claude Code process aborted by user");else{let le=this.getProcessExitError(H,re);le&&(this.exitError=le,pk(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 R1("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){pk("[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}`);pk(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||pk("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${HIt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new R1("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()},VHc,r,e).unref(),r.once("exit",()=>xxt.delete(r))):r&&(xxt.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,fZi.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=GN(n)}catch{pk(`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 R1("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(YHc,"fx");a(KHc,"gx");J_e="@anthropic-ai/claude-agent-sdk";a(JHc,"ux");a(ZHc,"F2");wxt=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(XHc,"mx");eGc=XHc();a(V6r,"BX");a(bXi,"AU");a(SXi,"IU");a(tGc,"Z2");a(q9,"I4");T8r=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?.())}},I8r=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new wxt;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,Txt.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&&(ru("[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 R1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);ru(`[Query.readMessages] Replacing exit error with result text. Original: ${HIt(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(Qm(o)+` -`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:HIt(n)}};try{await Promise.resolve(this.transport.write(Qm(o)+` -`))}catch(s){ru(`[Query.handleControlRequest] Error-response write failed: ${HIt(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 q9("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 q9("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 q9("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 q9("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return q9("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(Qm(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 q9("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return q9("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 q9("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return q9("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){ru("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,ru(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(Qm(n)+` -`))}ru(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(ru("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),ru("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof R1))throw r}}waitForFirstResult(){return this.firstResultReceived?(ru("[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 T8r(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),ru(`[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,Txt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(Qm(n)+` -`)).catch(o=>{ru(`[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}})}},W6r=500,z6r=1048576,rGc=[200,800],x8r=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=W6r,s=z6r,c=rGc){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=Qm(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 Vie(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=M8e(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await lZi(f)}if(l){ru(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){ru(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},wKi=A6r(S6c(),1);a(nGc,"Ug");a(t8e,"O0");a(iGc,"qg");LFr=new Map,oGc=5e3;a(sGc,"Bg");a(aGc,"zg");a(cGc,"OZ");lGc=(0,wXi.promisify)(xXi.execFile);a(L8e,"m4");a(uGc,"jH");$9=65536,dGc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(bh,"L$");a(PXi,"ZZ");a(BFr,"IX");a(hk,"A6");a(R8r,"rQ");a(DXi,"RX");a(fGc,"MZ");a(NXi,"PX");u8e=200;a(pGc,"Lg");a(B8e,"F0");a(hW,"U4");a(hGc,"jg");a(F8e,"M1");a(BN,"j6");a(Iwt,"L1");mGc=1048576,gGc=5242880;a(yGc,"Rg");a(MXi,"jZ");a(Yie,"D0");a(Rxt,"jX");kxt=Buffer.from('{"type":"attribution-snapshot"'),EGc=Buffer.from('{"type":"system"'),d8e=10,_Gc=Buffer.from([d8e]),vGc=256;a(CGc,"_g");a(bGc,"kg");a(SGc,"Sg");a(TGc,"vg");a(IGc,"Cg");a(xGc,"AZ");a(wGc,"xg");a(RGc,"yg");a(kGc,"fg");a(FFr,"IH");a(PGc,"gg");a(DGc,"hg");a(NGc,"ug");a(OXi,"RH");a(LXi,"PH");a(MGc,"IZ");a(BXi,"RZ");a(OGc,"PZ");a(xwt,"k8");a(YFe,"oQ");a(FXi,"EZ");LGc=32;a(BGc,"pg");a(FGc,"dg");a(UGc,"ig");a(QGc,"ng");a(qGc,"rg");a(jGc,"bZ");a(HGc,"_Z");a(GGc,"CZ");a($Gc,"TZ");a(VGc,"xZ");a(WGc,"ag");a(UXi,"yZ");a(UFr,"_H");a(zGc,"sg");YGc=new Set(["user","assistant","attachment","system","progress"]);a(KGc,"$h");a(JGc,"Qh");a(QXi,"fZ");a(ZGc,"gZ");a(XGc,"Jh");a(e$c,"hZ");a(t$c,"Xh");a(qXi,"uZ");a(jXi,"lZ");a(HXi,"cZ");a(r$c,"Wh");a(n$c,"Gh");a(i$c,"pZ");a(o$c,"dZ");a(GXi,"vH");a(WXi,"CH");a(zXi,"bX");a(s$c,"Uh");a$c="user:inference",YXi="user:profile",c$c="org:create_api_key",l$c=[c$c,YXi],u$c=[YXi,a$c,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],xKh=zXi([...l$c,...u$c]),RKi={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}"},d$c=void 0;a(f$c,"zh");p$c=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(h$c,"rZ");m$c="-credentials";a(g$c,"tZ");A$c=/^[a-zA-Z0-9._-]+$/;a(y$c,"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})(hc||(hc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(kKi||(kKi={}));kn=hc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tW=a(t=>{switch(typeof t){case"undefined":return kn.undefined;case"string":return kn.string;case"number":return Number.isNaN(t)?kn.nan:kn.number;case"boolean":return kn.boolean;case"function":return kn.function;case"bigint":return kn.bigint;case"symbol":return kn.symbol;case"object":return Array.isArray(t)?kn.array:t===null?kn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?kn.promise:typeof Map<"u"&&t instanceof Map?kn.map:typeof Set<"u"&&t instanceof Set?kn.set:typeof Date<"u"&&t instanceof Date?kn.date:kn.object;default:return kn.unknown}},"l4"),hr=hc.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"]),yk=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()}};yk.create=t=>new yk(t);E$c=a((t,e)=>{let r;switch(t.code){case hr.invalid_type:t.received===kn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case hr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,hc.jsonStringifyReplacer)}`;break;case hr.unrecognized_keys:r=`Unrecognized key(s) in object: ${hc.joinValues(t.keys,", ")}`;break;case hr.invalid_union:r="Invalid input";break;case hr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${hc.joinValues(t.options)}`;break;case hr.invalid_enum_value:r=`Invalid enum value. Expected ${hc.joinValues(t.options)}, received '${t.received}'`;break;case hr.invalid_arguments:r="Invalid function arguments";break;case hr.invalid_return_type:r="Invalid function return type";break;case hr.invalid_date:r="Invalid date";break;case hr.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}"`:hc.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case hr.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 hr.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 hr.custom:r="Invalid input";break;case hr.invalid_intersection_types:r="Intersection results could not be merged";break;case hr.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case hr.not_finite:r="Number must be finite";break;default:r=e.defaultError,hc.assertNever(t)}return{message:r}},"Fh"),p8e=E$c,_$c=p8e;a(P8r,"tQ");D8r=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(ln,"f");Zv=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 eo;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 eo;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}}},eo=Object.freeze({status:"aborted"}),JFe=a(t=>({status:"dirty",value:t}),"v8"),P1=a(t=>({status:"valid",value:t}),"z6"),PKi=a(t=>t.status==="aborted","TH"),DKi=a(t=>t.status==="dirty","xH"),gve=a(t=>t.status==="valid","Z0"),Nxt=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})(Zn||(Zn={}));_k=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}},NKi=a((t,e)=>{if(gve(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 yk(t.common.issues);return this._error=r,this._error}}},"eZ");a(Zo,"e");Ms=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return tW(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:tW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Zv,ctx:{common:e.parent.common,data:e.data,parsedType:tW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Nxt(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:tW(e)},o=this._parseSync({data:e,path:n.path,parent:n});return NKi(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tW(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return gve(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=>gve(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:tW(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Nxt(o)?o:Promise.resolve(o));return NKi(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:hr.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 QN({schema:this,typeName:Cr.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 Ek.create(this,this._def)}nullable(){return K9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dW.create(this)}promise(){return roe.create(this,this._def)}or(e){return _ve.create([this,e],this._def)}and(e){return vve.create(this,e,this._def)}transform(e){return new QN({...Zo(this._def),schema:this,typeName:Cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ive({...Zo(this._def),innerType:this,defaultValue:r,typeName:Cr.ZodDefault})}brand(){return new Mxt({typeName:Cr.ZodBranded,type:this,...Zo(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new xve({...Zo(this._def),innerType:this,catchValue:r,typeName:Cr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Oxt.create(this,e)}readonly(){return wve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},v$c=/^c[^\s-]{8,}$/i,C$c=/^[0-9a-z]+$/,b$c=/^[0-9A-HJKMNP-TV-Z]{26}$/i,S$c=/^[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,T$c=/^[a-z0-9_-]{21}$/i,I$c=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,x$c=/^[-+]?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)?)??$/,w$c=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,R$c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",k$c=/^(?:(?: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])$/,P$c=/^(?:(?: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])$/,D$c=/^(([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]))$/,N$c=/^(([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])$/,M$c=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,O$c=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,KXi="((\\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])))",L$c=new RegExp(`^${KXi}$`);a(JXi,"QM");a(B$c,"yh");a(F$c,"fh");a(U$c,"gh");a(Q$c,"hh");a(q$c,"uh");Ave=class t extends Ms{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==kn.string){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.string,received:o.parsedType}),eo}let r=new Zv,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:hr.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:hr.invalid_string,...Zn.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Zn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Zn.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Zn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Zn.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Zn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Zn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Zn.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Zn.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Zn.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Zn.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Zn.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Zn.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Zn.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,...Zn.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,...Zn.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Zn.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Zn.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Zn.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Zn.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Zn.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Zn.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Zn.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Zn.errToObj(r)})}nonempty(e){return this.min(1,Zn.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 Ave({checks:[],typeName:Cr.ZodString,coerce:t?.coerce??!1,...Zo(t)});a(j$c,"mh");h8e=class t extends Ms{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)!==kn.number){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.number,received:o.parsedType}),eo}let r,n=new Zv;for(let o of this._def.checks)o.kind==="int"?hc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.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),ln(r,{code:hr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?j$c(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.not_finite,message:o.message}),n.dirty()):hc.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Zn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Zn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Zn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Zn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Zn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Zn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Zn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Zn.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Zn.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Zn.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Zn.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"&&hc.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 h8e({checks:[],typeName:Cr.ZodNumber,coerce:t?.coerce||!1,...Zo(t)});m8e=class t extends Ms{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)!==kn.bigint)return this._getInvalidInput(e);let r,n=new Zv;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.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),ln(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):hc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.bigint,received:r.parsedType}),eo}gte(e,r){return this.setLimit("min",e,!0,Zn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Zn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Zn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Zn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Zn.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:Zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Zn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Zn.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 m8e({checks:[],typeName:Cr.ZodBigInt,coerce:t?.coerce??!1,...Zo(t)});g8e=class extends Ms{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==kn.boolean){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.boolean,received:r.parsedType}),eo}return P1(e.data)}};g8e.create=t=>new g8e({typeName:Cr.ZodBoolean,coerce:t?.coerce||!1,...Zo(t)});A8e=class t extends Ms{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==kn.date){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.date,received:o.parsedType}),eo}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_date}),eo}let r=new Zv,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:hr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):hc.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:Zn.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Zn.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 A8e({checks:[],coerce:t?.coerce||!1,typeName:Cr.ZodDate,...Zo(t)});y8e=class extends Ms{static{a(this,"SX")}_parse(e){if(this._getType(e)!==kn.symbol){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.symbol,received:r.parsedType}),eo}return P1(e.data)}};y8e.create=t=>new y8e({typeName:Cr.ZodSymbol,...Zo(t)});yve=class extends Ms{static{a(this,"$7")}_parse(e){if(this._getType(e)!==kn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.undefined,received:r.parsedType}),eo}return P1(e.data)}};yve.create=t=>new yve({typeName:Cr.ZodUndefined,...Zo(t)});Eve=class extends Ms{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==kn.null){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.null,received:r.parsedType}),eo}return P1(e.data)}};Eve.create=t=>new Eve({typeName:Cr.ZodNull,...Zo(t)});E8e=class extends Ms{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return P1(e.data)}};E8e.create=t=>new E8e({typeName:Cr.ZodAny,...Zo(t)});aW=class extends Ms{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return P1(e.data)}};aW.create=t=>new aW({typeName:Cr.ZodUnknown,...Zo(t)});$L=class extends Ms{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.never,received:r.parsedType}),eo}};$L.create=t=>new $L({typeName:Cr.ZodNever,...Zo(t)});_8e=class extends Ms{static{a(this,"CX")}_parse(e){if(this._getType(e)!==kn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.void,received:r.parsedType}),eo}return P1(e.data)}};_8e.create=t=>new _8e({typeName:Cr.ZodVoid,...Zo(t)});dW=class t extends Ms{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==kn.array)return ln(r,{code:hr.invalid_type,expected:kn.array,received:r.parsedType}),eo;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(ln(r,{code:hr.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 _k(r,c,r.path,l)))).then(c=>Zv.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new _k(r,c,r.path,l)));return Zv.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Zn.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Zn.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Zn.toString(r)}})}nonempty(e){return this.min(1,e)}};dW.create=(t,e)=>new dW({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Cr.ZodArray,...Zo(e)});a(tve,"C8");NI=class t extends Ms{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=hc.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==kn.object){let u=this._getOrReturnCtx(e);return ln(u,{code:hr.invalid_type,expected:kn.object,received:u.parsedType}),eo}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof $L&&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 _k(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof $L){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&&(ln(n,{code:hr.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 _k(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=>Zv.mergeObjectSync(r,u)):Zv.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Zn.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:Zn.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:Cr.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 hc.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 hc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return tve(this)}partial(e){let r={};for(let n of hc.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 hc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Ek;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return ZXi(hc.objectKeys(this.shape))}};NI.create=(t,e)=>new NI({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});NI.strictCreate=(t,e)=>new NI({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});NI.lazycreate=(t,e)=>new NI({shape:t,unknownKeys:"strip",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});_ve=class extends Ms{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 yk(l.ctx.common.issues));return ln(r,{code:hr.invalid_union,unionErrors:c}),eo}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 yk(u));return ln(r,{code:hr.invalid_union,unionErrors:l}),eo}}get options(){return this._def.options}};_ve.create=(t,e)=>new _ve({options:t,typeName:Cr.ZodUnion,...Zo(e)});j9=a(t=>t instanceof Cve?j9(t.schema):t instanceof QN?j9(t.innerType()):t instanceof bve?[t.value]:t instanceof Sve?t.options:t instanceof Tve?hc.objectValues(t.enum):t instanceof Ive?j9(t._def.innerType):t instanceof yve?[void 0]:t instanceof Eve?[null]:t instanceof Ek?[void 0,...j9(t.unwrap())]:t instanceof K9?[null,...j9(t.unwrap())]:t instanceof Mxt||t instanceof wve?j9(t.unwrap()):t instanceof xve?j9(t._def.innerType):[],"c4"),N8r=class t extends Ms{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.object)return ln(r,{code:hr.invalid_type,expected:kn.object,received:r.parsedType}),eo;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}):(ln(r,{code:hr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),eo)}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=j9(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:Cr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...Zo(n)})}};a(M8r,"fH");vve=class extends Ms{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(PKi(s)||PKi(c))return eo;let l=M8r(s.value,c.value);return l.valid?((DKi(s)||DKi(c))&&r.dirty(),{status:r.value,value:l.data}):(ln(n,{code:hr.invalid_intersection_types}),eo)},"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}))}};vve.create=(t,e,r)=>new vve({left:t,right:e,typeName:Cr.ZodIntersection,...Zo(r)});Y9=class t extends Ms{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.array)return ln(n,{code:hr.invalid_type,expected:kn.array,received:n.parsedType}),eo;if(n.data.lengththis._def.items.length&&(ln(n,{code:hr.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 _k(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Zv.mergeArray(r,s)):Zv.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Y9.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Y9({items:t,typeName:Cr.ZodTuple,rest:null,...Zo(e)})};O8r=class t extends Ms{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!==kn.object)return ln(n,{code:hr.invalid_type,expected:kn.object,received:n.parsedType}),eo;let o=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)o.push({key:s._parse(new _k(n,l,n.path,l)),value:c._parse(new _k(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?Zv.mergeObjectAsync(r,o):Zv.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Ms?new t({keyType:e,valueType:r,typeName:Cr.ZodRecord,...Zo(n)}):new t({keyType:Ave.create(),valueType:e,typeName:Cr.ZodRecord,...Zo(r)})}},v8e=class extends Ms{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!==kn.map)return ln(n,{code:hr.invalid_type,expected:kn.map,received:n.parsedType}),eo;let o=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,u],d)=>({key:o._parse(new _k(n,l,n.path,[d,"key"])),value:s._parse(new _k(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 eo;(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 eo;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}}}};v8e.create=(t,e,r)=>new v8e({valueType:e,keyType:t,typeName:Cr.ZodMap,...Zo(r)});C8e=class t extends Ms{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.set)return ln(n,{code:hr.invalid_type,expected:kn.set,received:n.parsedType}),eo;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(ln(n,{code:hr.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 eo;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 _k(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:Zn.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Zn.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};C8e.create=(t,e)=>new C8e({valueType:t,minSize:null,maxSize:null,typeName:Cr.ZodSet,...Zo(e)});L8r=class t extends Ms{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.function)return ln(r,{code:hr.invalid_type,expected:kn.function,received:r.parsedType}),eo;function n(l,u){return D8r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,P8r(),p8e].filter(d=>!!d),issueData:{code:hr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return D8r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,P8r(),p8e].filter(d=>!!d),issueData:{code:hr.invalid_return_type,returnTypeError:u}})}a(o,"Y");let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof roe){let l=this;return P1(async function(...u){let d=new yk([]),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 P1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new yk([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new yk([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:Y9.create(e).rest(aW.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||Y9.create([]).rest(aW.create()),returns:r||aW.create(),typeName:Cr.ZodFunction,...Zo(n)})}},Cve=class extends Ms{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})}};Cve.create=(t,e)=>new Cve({getter:t,typeName:Cr.ZodLazy,...Zo(e)});bve=class extends Ms{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ln(r,{received:r.data,code:hr.invalid_literal,expected:this._def.value}),eo}return{status:"valid",value:e.data}}get value(){return this._def.value}};bve.create=(t,e)=>new bve({value:t,typeName:Cr.ZodLiteral,...Zo(e)});a(ZXi,"JM");Sve=class t extends Ms{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ln(r,{expected:hc.joinValues(n),received:r.parsedType,code:hr.invalid_type}),eo}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 ln(r,{received:r.data,code:hr.invalid_enum_value,options:n}),eo}return P1(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})}};Sve.create=ZXi;Tve=class extends Ms{static{a(this,"G7")}_parse(e){let r=hc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==kn.string&&n.parsedType!==kn.number){let o=hc.objectValues(r);return ln(n,{expected:hc.joinValues(o),received:n.parsedType,code:hr.invalid_type}),eo}if(this._cache||(this._cache=new Set(hc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=hc.objectValues(r);return ln(n,{received:n.data,code:hr.invalid_enum_value,options:o}),eo}return P1(e.data)}get enum(){return this._def.values}};Tve.create=(t,e)=>new Tve({values:t,typeName:Cr.ZodNativeEnum,...Zo(e)});roe=class extends Ms{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.promise&&r.common.async===!1)return ln(r,{code:hr.invalid_type,expected:kn.promise,received:r.parsedType}),eo;let n=r.parsedType===kn.promise?r.data:Promise.resolve(r.data);return P1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};roe.create=(t,e)=>new roe({type:t,typeName:Cr.ZodPromise,...Zo(e)});QN=class extends Ms{static{a(this,"P4")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Cr.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=>{ln(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 eo;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?eo:u.status==="dirty"||r.value==="dirty"?JFe(u.value):u});{if(r.value==="aborted")return eo;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?eo:l.status==="dirty"||r.value==="dirty"?JFe(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"?eo:(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"?eo:(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(!gve(c))return eo;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=>gve(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):eo);hc.assertNever(o)}};QN.create=(t,e,r)=>new QN({schema:t,typeName:Cr.ZodEffects,effect:e,...Zo(r)});QN.createWithPreprocess=(t,e,r)=>new QN({schema:e,effect:{type:"preprocess",transform:t},typeName:Cr.ZodEffects,...Zo(r)});Ek=class extends Ms{static{a(this,"o6")}_parse(e){return this._getType(e)===kn.undefined?P1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ek.create=(t,e)=>new Ek({innerType:t,typeName:Cr.ZodOptional,...Zo(e)});K9=class extends Ms{static{a(this,"A1")}_parse(e){return this._getType(e)===kn.null?P1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};K9.create=(t,e)=>new K9({innerType:t,typeName:Cr.ZodNullable,...Zo(e)});Ive=class extends Ms{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===kn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ive.create=(t,e)=>new Ive({innerType:t,typeName:Cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Zo(e)});xve=class extends Ms{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 Nxt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new yk(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new yk(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};xve.create=(t,e)=>new xve({innerType:t,typeName:Cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Zo(e)});b8e=class extends Ms{static{a(this,"yX")}_parse(e){if(this._getType(e)!==kn.nan){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.nan,received:r.parsedType}),eo}return{status:"valid",value:e.data}}};b8e.create=t=>new b8e({typeName:Cr.ZodNaN,...Zo(t)});Mxt=class extends Ms{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}},Oxt=class t extends Ms{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"?eo:o.status==="dirty"?(r.dirty(),JFe(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"?eo: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:Cr.ZodPipeline})}},wve=class extends Ms{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(gve(o)&&(o.value=Object.freeze(o.value)),o),"J");return Nxt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};wve.create=(t,e)=>new wve({innerType:t,typeName:Cr.ZodReadonly,...Zo(e)});wKh={object:NI.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"})(Cr||(Cr={}));RKh=Ave.create,kKh=h8e.create,PKh=b8e.create,DKh=m8e.create,NKh=g8e.create,MKh=A8e.create,OKh=y8e.create,LKh=yve.create,BKh=Eve.create,FKh=E8e.create,UKh=aW.create,QKh=$L.create,qKh=_8e.create,jKh=dW.create,H$c=NI.create,HKh=NI.strictCreate,GKh=_ve.create,$Kh=N8r.create,VKh=vve.create,WKh=Y9.create,zKh=O8r.create,YKh=v8e.create,KKh=C8e.create,JKh=L8r.create,ZKh=Cve.create,XKh=bve.create,eJh=Sve.create,tJh=Tve.create,rJh=roe.create,nJh=QN.create,iJh=Ek.create,oJh=K9.create,sJh=QN.createWithPreprocess,aJh=Oxt.create,XXi={};WL(XXi,{version:a(()=>uto,"version"),util:a(()=>Ws,"util"),treeifyError:a(()=>deo,"treeifyError"),toJSONSchema:a(()=>eUr,"toJSONSchema"),toDotPath:a(()=>feo,"toDotPath"),safeParseAsync:a(()=>Nwt,"safeParseAsync"),safeParse:a(()=>Dwt,"safeParse"),registry:a(()=>E9r,"registry"),regexes:a(()=>o9r,"regexes"),prettifyError:a(()=>peo,"prettifyError"),parseAsync:a(()=>Uxt,"parseAsync"),parse:a(()=>Fxt,"parse"),locales:a(()=>y9r,"locales"),isValidJWT:a(()=>Mto,"isValidJWT"),isValidBase64URL:a(()=>Pto,"isValidBase64URL"),isValidBase64:a(()=>l9r,"isValidBase64"),globalRegistry:a(()=>V9,"globalRegistry"),globalConfig:a(()=>Lxt,"globalConfig"),function:a(()=>rno,"function"),formatError:a(()=>e9r,"formatError"),flattenError:a(()=>X6r,"flattenError"),config:a(()=>Xv,"config"),clone:a(()=>$N,"clone"),_xid:a(()=>P9r,"_xid"),_void:a(()=>qro,"_void"),_uuidv7:a(()=>S9r,"_uuidv7"),_uuidv6:a(()=>b9r,"_uuidv6"),_uuidv4:a(()=>C9r,"_uuidv4"),_uuid:a(()=>v9r,"_uuid"),_url:a(()=>T9r,"_url"),_uppercase:a(()=>G9r,"_uppercase"),_unknown:a(()=>Hxt,"_unknown"),_union:a(()=>GWc,"_union"),_undefined:a(()=>Bro,"_undefined"),_ulid:a(()=>k9r,"_ulid"),_uint64:a(()=>Oro,"_uint64"),_uint32:a(()=>Rro,"_uint32"),_tuple:a(()=>Kro,"_tuple"),_trim:a(()=>K9r,"_trim"),_transform:a(()=>XWc,"_transform"),_toUpperCase:a(()=>Z9r,"_toUpperCase"),_toLowerCase:a(()=>J9r,"_toLowerCase"),_templateLiteral:a(()=>czc,"_templateLiteral"),_symbol:a(()=>Lro,"_symbol"),_success:a(()=>izc,"_success"),_stringbool:a(()=>eno,"_stringbool"),_stringFormat:a(()=>tno,"_stringFormat"),_string:a(()=>gro,"_string"),_startsWith:a(()=>V9r,"_startsWith"),_size:a(()=>q9r,"_size"),_set:a(()=>YWc,"_set"),_safeParseAsync:a(()=>i9r,"_safeParseAsync"),_safeParse:a(()=>n9r,"_safeParse"),_regex:a(()=>j9r,"_regex"),_refine:a(()=>Xro,"_refine"),_record:a(()=>WWc,"_record"),_readonly:a(()=>azc,"_readonly"),_property:a(()=>Yro,"_property"),_promise:a(()=>uzc,"_promise"),_positive:a(()=>$ro,"_positive"),_pipe:a(()=>szc,"_pipe"),_parseAsync:a(()=>r9r,"_parseAsync"),_parse:a(()=>t9r,"_parse"),_overwrite:a(()=>loe,"_overwrite"),_optional:a(()=>ezc,"_optional"),_number:a(()=>bro,"_number"),_nullable:a(()=>tzc,"_nullable"),_null:a(()=>Fro,"_null"),_normalize:a(()=>Y9r,"_normalize"),_nonpositive:a(()=>Wro,"_nonpositive"),_nonoptional:a(()=>nzc,"_nonoptional"),_nonnegative:a(()=>zro,"_nonnegative"),_never:a(()=>Qro,"_never"),_negative:a(()=>Vro,"_negative"),_nativeEnum:a(()=>JWc,"_nativeEnum"),_nanoid:a(()=>x9r,"_nanoid"),_nan:a(()=>Gro,"_nan"),_multipleOf:a(()=>x8e,"_multipleOf"),_minSize:a(()=>w8e,"_minSize"),_minLength:a(()=>kve,"_minLength"),_min:a(()=>RI,"_min"),_mime:a(()=>z9r,"_mime"),_maxSize:a(()=>Owt,"_maxSize"),_maxLength:a(()=>Lwt,"_maxLength"),_max:a(()=>FN,"_max"),_map:a(()=>zWc,"_map"),_lte:a(()=>FN,"_lte"),_lt:a(()=>noe,"_lt"),_lowercase:a(()=>H9r,"_lowercase"),_literal:a(()=>ZWc,"_literal"),_length:a(()=>Bwt,"_length"),_lazy:a(()=>lzc,"_lazy"),_ksuid:a(()=>D9r,"_ksuid"),_jwt:a(()=>Q9r,"_jwt"),_isoTime:a(()=>vro,"_isoTime"),_isoDuration:a(()=>Cro,"_isoDuration"),_isoDateTime:a(()=>Ero,"_isoDateTime"),_isoDate:a(()=>_ro,"_isoDate"),_ipv6:a(()=>M9r,"_ipv6"),_ipv4:a(()=>N9r,"_ipv4"),_intersection:a(()=>VWc,"_intersection"),_int64:a(()=>Mro,"_int64"),_int32:a(()=>wro,"_int32"),_int:a(()=>Tro,"_int"),_includes:a(()=>$9r,"_includes"),_guid:a(()=>jxt,"_guid"),_gte:a(()=>RI,"_gte"),_gt:a(()=>ioe,"_gt"),_float64:a(()=>xro,"_float64"),_float32:a(()=>Iro,"_float32"),_file:a(()=>Jro,"_file"),_enum:a(()=>KWc,"_enum"),_endsWith:a(()=>W9r,"_endsWith"),_emoji:a(()=>I9r,"_emoji"),_email:a(()=>_9r,"_email"),_e164:a(()=>U9r,"_e164"),_discriminatedUnion:a(()=>$Wc,"_discriminatedUnion"),_default:a(()=>rzc,"_default"),_date:a(()=>jro,"_date"),_custom:a(()=>Zro,"_custom"),_cuid2:a(()=>R9r,"_cuid2"),_cuid:a(()=>w9r,"_cuid"),_coercedString:a(()=>Aro,"_coercedString"),_coercedNumber:a(()=>Sro,"_coercedNumber"),_coercedDate:a(()=>Hro,"_coercedDate"),_coercedBoolean:a(()=>Pro,"_coercedBoolean"),_coercedBigint:a(()=>Nro,"_coercedBigint"),_cidrv6:a(()=>L9r,"_cidrv6"),_cidrv4:a(()=>O9r,"_cidrv4"),_catch:a(()=>ozc,"_catch"),_boolean:a(()=>kro,"_boolean"),_bigint:a(()=>Dro,"_bigint"),_base64url:a(()=>F9r,"_base64url"),_base64:a(()=>B9r,"_base64"),_array:a(()=>X9r,"_array"),_any:a(()=>Uro,"_any"),TimePrecision:a(()=>yro,"TimePrecision"),NEVER:a(()=>eeo,"NEVER"),JSONSchemaGenerator:a(()=>R8e,"JSONSchemaGenerator"),JSONSchema:a(()=>dzc,"JSONSchema"),Doc:a(()=>Qxt,"Doc"),$output:a(()=>hro,"$output"),$input:a(()=>mro,"$input"),$constructor:a(()=>ft,"$constructor"),$brand:a(()=>teo,"$brand"),$ZodXID:a(()=>_to,"$ZodXID"),$ZodVoid:a(()=>Gto,"$ZodVoid"),$ZodUnknown:a(()=>qxt,"$ZodUnknown"),$ZodUnion:a(()=>m9r,"$ZodUnion"),$ZodUndefined:a(()=>Qto,"$ZodUndefined"),$ZodUUID:a(()=>fto,"$ZodUUID"),$ZodURL:a(()=>hto,"$ZodURL"),$ZodULID:a(()=>Eto,"$ZodULID"),$ZodType:a(()=>Co,"$ZodType"),$ZodTuple:a(()=>Mwt,"$ZodTuple"),$ZodTransform:a(()=>g9r,"$ZodTransform"),$ZodTemplateLiteral:a(()=>lro,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>Uto,"$ZodSymbol"),$ZodSuccess:a(()=>oro,"$ZodSuccess"),$ZodStringFormat:a(()=>Lu,"$ZodStringFormat"),$ZodString:a(()=>q8e,"$ZodString"),$ZodSet:a(()=>Kto,"$ZodSet"),$ZodRegistry:a(()=>I8e,"$ZodRegistry"),$ZodRecord:a(()=>zto,"$ZodRecord"),$ZodRealError:a(()=>U8e,"$ZodRealError"),$ZodReadonly:a(()=>cro,"$ZodReadonly"),$ZodPromise:a(()=>uro,"$ZodPromise"),$ZodPrefault:a(()=>nro,"$ZodPrefault"),$ZodPipe:a(()=>A9r,"$ZodPipe"),$ZodOptional:a(()=>ero,"$ZodOptional"),$ZodObject:a(()=>h9r,"$ZodObject"),$ZodNumberFormat:a(()=>Bto,"$ZodNumberFormat"),$ZodNumber:a(()=>u9r,"$ZodNumber"),$ZodNullable:a(()=>tro,"$ZodNullable"),$ZodNull:a(()=>qto,"$ZodNull"),$ZodNonOptional:a(()=>iro,"$ZodNonOptional"),$ZodNever:a(()=>Hto,"$ZodNever"),$ZodNanoID:a(()=>gto,"$ZodNanoID"),$ZodNaN:a(()=>aro,"$ZodNaN"),$ZodMap:a(()=>Yto,"$ZodMap"),$ZodLiteral:a(()=>Zto,"$ZodLiteral"),$ZodLazy:a(()=>dro,"$ZodLazy"),$ZodKSUID:a(()=>vto,"$ZodKSUID"),$ZodJWT:a(()=>Oto,"$ZodJWT"),$ZodIntersection:a(()=>Wto,"$ZodIntersection"),$ZodISOTime:a(()=>Sto,"$ZodISOTime"),$ZodISODuration:a(()=>Tto,"$ZodISODuration"),$ZodISODateTime:a(()=>Cto,"$ZodISODateTime"),$ZodISODate:a(()=>bto,"$ZodISODate"),$ZodIPv6:a(()=>xto,"$ZodIPv6"),$ZodIPv4:a(()=>Ito,"$ZodIPv4"),$ZodGUID:a(()=>dto,"$ZodGUID"),$ZodFunction:a(()=>Gxt,"$ZodFunction"),$ZodFile:a(()=>Xto,"$ZodFile"),$ZodError:a(()=>Z6r,"$ZodError"),$ZodEnum:a(()=>Jto,"$ZodEnum"),$ZodEmoji:a(()=>mto,"$ZodEmoji"),$ZodEmail:a(()=>pto,"$ZodEmail"),$ZodE164:a(()=>Nto,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>Vto,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>rro,"$ZodDefault"),$ZodDate:a(()=>$to,"$ZodDate"),$ZodCustomStringFormat:a(()=>Lto,"$ZodCustomStringFormat"),$ZodCustom:a(()=>fro,"$ZodCustom"),$ZodCheckUpperCase:a(()=>nto,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>Q8e,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>oto,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>Jeo,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>tto,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>ato,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>lto,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>Weo,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>Veo,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>Keo,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>Xeo,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>cto,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>Yeo,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>Zeo,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>rto,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>a9r,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>eto,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>ito,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>c9r,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>sto,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>zeo,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>Sh,"$ZodCheck"),$ZodCatch:a(()=>sro,"$ZodCatch"),$ZodCUID2:a(()=>yto,"$ZodCUID2"),$ZodCUID:a(()=>Ato,"$ZodCUID"),$ZodCIDRv6:a(()=>Rto,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>wto,"$ZodCIDRv4"),$ZodBoolean:a(()=>d9r,"$ZodBoolean"),$ZodBigIntFormat:a(()=>Fto,"$ZodBigIntFormat"),$ZodBigInt:a(()=>f9r,"$ZodBigInt"),$ZodBase64URL:a(()=>Dto,"$ZodBase64URL"),$ZodBase64:a(()=>kto,"$ZodBase64"),$ZodAsyncError:a(()=>fW,"$ZodAsyncError"),$ZodArray:a(()=>p9r,"$ZodArray"),$ZodAny:a(()=>jto,"$ZodAny")});eeo=Object.freeze({status:"aborted"});a(ft,"F");teo=Symbol("zod_brand"),fW=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Lxt={};a(Xv,"c$");Ws={};WL(Ws,{unwrapMessage:a(()=>ZFe,"unwrapMessage"),stringifyPrimitive:a(()=>us,"stringifyPrimitive"),required:a(()=>sVc,"required"),randomString:a(()=>J$c,"randomString"),propertyKeyTypes:a(()=>Bxt,"propertyKeyTypes"),promiseAllObject:a(()=>K$c,"promiseAllObject"),primitiveTypes:a(()=>oeo,"primitiveTypes"),prefixIssues:a(()=>Ak,"prefixIssues"),pick:a(()=>tVc,"pick"),partial:a(()=>oVc,"partial"),optionalKeys:a(()=>seo,"optionalKeys"),omit:a(()=>rVc,"omit"),numKeys:a(()=>Z$c,"numKeys"),nullish:a(()=>aoe,"nullish"),normalizeParams:a(()=>xr,"normalizeParams"),merge:a(()=>iVc,"merge"),jsonStringifyReplacer:a(()=>reo,"jsonStringifyReplacer"),joinValues:a(()=>Vr,"joinValues"),issue:a(()=>leo,"issue"),isPlainObject:a(()=>T8e,"isPlainObject"),isObject:a(()=>S8e,"isObject"),getSizableOrigin:a(()=>kwt,"getSizableOrigin"),getParsedType:a(()=>X$c,"getParsedType"),getLengthableOrigin:a(()=>Pwt,"getLengthableOrigin"),getEnumValues:a(()=>Y6r,"getEnumValues"),getElementAtPath:a(()=>Y$c,"getElementAtPath"),floatSafeRemainder:a(()=>neo,"floatSafeRemainder"),finalizeIssue:a(()=>qN,"finalizeIssue"),extend:a(()=>nVc,"extend"),escapeRegex:a(()=>coe,"escapeRegex"),esc:a(()=>rve,"esc"),defineLazy:a(()=>zc,"defineLazy"),createTransparentProxy:a(()=>eVc,"createTransparentProxy"),clone:a(()=>$N,"clone"),cleanRegex:a(()=>Rwt,"cleanRegex"),cleanEnum:a(()=>aVc,"cleanEnum"),captureStackTrace:a(()=>J6r,"captureStackTrace"),cached:a(()=>wwt,"cached"),assignProp:a(()=>K6r,"assignProp"),assertNotEqual:a(()=>$$c,"assertNotEqual"),assertNever:a(()=>W$c,"assertNever"),assertIs:a(()=>V$c,"assertIs"),assertEqual:a(()=>G$c,"assertEqual"),assert:a(()=>z$c,"assert"),allowsEval:a(()=>ieo,"allowsEval"),aborted:a(()=>ave,"aborted"),NUMBER_FORMAT_RANGES:a(()=>aeo,"NUMBER_FORMAT_RANGES"),Class:a(()=>B8r,"Class"),BIGINT_FORMAT_RANGES:a(()=>ceo,"BIGINT_FORMAT_RANGES")});a(G$c,"lh");a($$c,"ch");a(V$c,"ph");a(W$c,"dh");a(z$c,"ih");a(Y6r,"B7");a(Vr,"P");a(reo,"mH");a(wwt,"z7");a(aoe,"I1");a(Rwt,"N7");a(neo,"lH");a(zc,"N$");a(K6r,"cH");a(Y$c,"nh");a(K$c,"rh");a(J$c,"oh");a(rve,"j0");J6r=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(S8e,"g8");ieo=wwt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(T8e,"h8");a(Z$c,"th");X$c=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"),Bxt=new Set(["string","number","symbol"]),oeo=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(coe,"r4");a($N,"H6");a(xr,"k");a(eVc,"sh");a(us,"x");a(seo,"iH");aeo={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]},ceo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(tVc,"eh");a(rVc,"$u");a(nVc,"Qu");a(iVc,"Ju");a(oVc,"Xu");a(sVc,"Yu");a(ave,"A0");a(Ak,"I6");a(ZFe,"V7");a(qN,"g6");a(kwt,"O7");a(Pwt,"D7");a(leo,"oH");a(aVc,"Wu");B8r=class{static{a(this,"YM")}constructor(...e){}},ueo=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,reo,2)},enumerable:!0})},"WM"),Z6r=ft("$ZodError",ueo),U8e=ft("$ZodError",ueo,{Parent:Error});a(X6r,"m8");a(e9r,"l8");a(deo,"mX");a(feo,"GM");a(peo,"lX");t9r=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 fW;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>qN(u,s,Xv())));throw J6r(l,o?.callee),l}return c.value},"cX"),Fxt=t9r(U8e),r9r=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=>qN(u,s,Xv())));throw J6r(l,o?.callee),l}return c.value},"pX"),Uxt=r9r(U8e),n9r=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 fW;return s.issues.length?{success:!1,error:new(t??Z6r)(s.issues.map(c=>qN(c,o,Xv())))}:{success:!0,data:s.value}},"dX"),Dwt=n9r(U8e),i9r=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=>qN(c,o,Xv())))}:{success:!0,data:s.value}},"iX"),Nwt=i9r(U8e),o9r={};WL(o9r,{xid:a(()=>Aeo,"xid"),uuid7:a(()=>dVc,"uuid7"),uuid6:a(()=>uVc,"uuid6"),uuid4:a(()=>lVc,"uuid4"),uuid:a(()=>Rve,"uuid"),uppercase:a(()=>Geo,"uppercase"),unicodeEmail:a(()=>hVc,"unicodeEmail"),undefined:a(()=>jeo,"undefined"),ulid:a(()=>geo,"ulid"),time:a(()=>Meo,"time"),string:a(()=>Leo,"string"),rfc5322Email:a(()=>pVc,"rfc5322Email"),number:a(()=>Ueo,"number"),null:a(()=>qeo,"null"),nanoid:a(()=>Eeo,"nanoid"),lowercase:a(()=>Heo,"lowercase"),ksuid:a(()=>yeo,"ksuid"),ipv6:a(()=>Teo,"ipv6"),ipv4:a(()=>Seo,"ipv4"),integer:a(()=>Feo,"integer"),html5Email:a(()=>fVc,"html5Email"),hostname:a(()=>Reo,"hostname"),guid:a(()=>veo,"guid"),extendedDuration:a(()=>cVc,"extendedDuration"),emoji:a(()=>beo,"emoji"),email:a(()=>Ceo,"email"),e164:a(()=>keo,"e164"),duration:a(()=>_eo,"duration"),domain:a(()=>AVc,"domain"),datetime:a(()=>Oeo,"datetime"),date:a(()=>Deo,"date"),cuid2:a(()=>meo,"cuid2"),cuid:a(()=>heo,"cuid"),cidrv6:a(()=>xeo,"cidrv6"),cidrv4:a(()=>Ieo,"cidrv4"),browserEmail:a(()=>mVc,"browserEmail"),boolean:a(()=>Qeo,"boolean"),bigint:a(()=>Beo,"bigint"),base64url:a(()=>s9r,"base64url"),base64:a(()=>weo,"base64"),_emoji:a(()=>gVc,"_emoji")});heo=/^[cC][^\s-]{8,}$/,meo=/^[0-9a-z]+$/,geo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Aeo=/^[0-9a-vA-V]{20}$/,yeo=/^[A-Za-z0-9]{27}$/,Eeo=/^[a-zA-Z0-9_-]{21}$/,_eo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cVc=/^[-+]?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)?)??$/,veo=/^([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})$/,Rve=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"),lVc=Rve(4),uVc=Rve(6),dVc=Rve(7),Ceo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fVc=/^[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])?)*$/,pVc=/^(([^<>()\[\]\\.,;:\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,}))$/,hVc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,mVc=/^[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])?)*$/,gVc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(beo,"WK");Seo=/^(?:(?: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])$/,Teo=/^(([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})$/,Ieo=/^((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])$/,xeo=/^(([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])$/,weo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,s9r=/^[A-Za-z0-9_-]*$/,Reo=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,AVc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,keo=/^\+(?:[0-9]){6,14}[0-9]$/,Peo="(?:(?:\\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])))",Deo=new RegExp(`^${Peo}$`);a(Neo,"HM");a(Meo,"NK");a(Oeo,"wK");Leo=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),Beo=/^\d+n?$/,Feo=/^\d+$/,Ueo=/^-?\d+(?:\.\d+)?/i,Qeo=/true|false/i,qeo=/null/i,jeo=/undefined/i,Heo=/^[^A-Z]*$/,Geo=/^[^a-z]*$/,Sh=ft("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),$eo={number:"number",bigint:"bigint",object:"date"},a9r=ft("$ZodCheckLessThan",(t,e)=>{Sh.init(t,e);let r=$eo[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{Sh.init(t,e);let r=$eo[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})}}),Veo=ft("$ZodCheckMultipleOf",(t,e)=>{Sh.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):neo(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})}}),Weo=ft("$ZodCheckNumberFormat",(t,e)=>{Sh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=aeo[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=Feo)}),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})}}),zeo=ft("$ZodCheckBigIntFormat",(t,e)=>{Sh.init(t,e);let[r,n]=ceo[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})}}),Yeo=ft("$ZodCheckMaxSize",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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:kwt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),Keo=ft("$ZodCheckMinSize",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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:kwt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),Jeo=ft("$ZodCheckSizeEquals",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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:kwt(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})}}),Zeo=ft("$ZodCheckMaxLength",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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=Pwt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Xeo=ft("$ZodCheckMinLength",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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=Pwt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),eto=ft("$ZodCheckLengthEquals",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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=Pwt(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})}}),Q8e=ft("$ZodCheckStringFormat",(t,e)=>{var r,n;Sh.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=()=>{})}),tto=ft("$ZodCheckRegex",(t,e)=>{Q8e.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})}}),rto=ft("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Heo),Q8e.init(t,e)}),nto=ft("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Geo),Q8e.init(t,e)}),ito=ft("$ZodCheckIncludes",(t,e)=>{Sh.init(t,e);let r=coe(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})}}),oto=ft("$ZodCheckStartsWith",(t,e)=>{Sh.init(t,e);let r=new RegExp(`^${coe(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})}}),sto=ft("$ZodCheckEndsWith",(t,e)=>{Sh.init(t,e);let r=new RegExp(`.*${coe(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(MKi,"KM");ato=ft("$ZodCheckProperty",(t,e)=>{Sh.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=>MKi(o,r,e.property));MKi(n,r,e.property)}}),cto=ft("$ZodCheckMimeType",(t,e)=>{Sh.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})}}),lto=ft("$ZodCheckOverwrite",(t,e)=>{Sh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),Qxt=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??B6r.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=KYi(s.logLevel,"ClientOptions.logLevel",this)??KYi(tu("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??S7c(),En(this,HIt,I7c,"f");let l=tu("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=LZi(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=>{oA(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{oA(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new a8r(e,r=>{oA(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 G7c(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 Ri(`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,mr([{Authorization:`Bearer ${r}`}])}return mr([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return mr([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return mr([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return x7c(e)}getUserAgent(){return`${this.constructor.name}/JS ${iW}`}defaultIdempotencyKey(){return`stainless-node-retry-${SZi()}`}makeStatusError(e,r,n,o){return Zv.generate(e,r,n,o)}buildURL(e,r,n){let o=!gt(this,m8r,"m",ZZi).call(this)&&n||this.baseURL,s=g7c(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!jYi(c)||!jYi(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 Ri("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(rxt)||o.append("anthropic-beta",rxt),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 ixt(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(oA(this).debug(`[${d}] sending request`,Gie({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new DI;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(i8r),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new DI;let v=s8e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return oA(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),oA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,Gie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw oA(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),oA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,Gie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new WIt:new fve({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let R=`retrying, ${r} attempts remaining`;return await T7c(g.body),oA(this).info(`${E} - ${R}`),oA(this).debug(`[${d}] response error (${R})`,Gie({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";oA(this).info(`${E} - ${v}`);let b=await g.text().catch(R=>i8r(R).message),T=TZi(b),w=T?void 0:b;throw oA(this).debug(`[${d}] response error (${v})`,Gie({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 oA(this).info(E),oA(this).debug(`[${d}] response start`,Gie({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 l8r(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 E7c(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 Ri("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&&y7c("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=mr([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))}:{},...P6r(),...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=mr([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:xZi(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,HIt,"f").call(this,{body:e,headers:n})}};B6r=Mp,HIt=new WeakMap,m8r=new WeakSet,ZZi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");Mp.Anthropic=B6r;Mp.HUMAN_PROMPT=EQc;Mp.AI_PROMPT=_Qc;Mp.DEFAULT_TIMEOUT=6e5;Mp.AnthropicError=Ri;Mp.APIError=Zv;Mp.APIConnectionError=fve;Mp.APIConnectionTimeoutError=WIt;Mp.APIUserAbortError=DI;Mp.NotFoundError=JIt;Mp.ConflictError=ZIt;Mp.RateLimitError=ext;Mp.BadRequestError=zIt;Mp.AuthenticationError=YIt;Mp.InternalServerError=txt;Mp.PermissionDeniedError=KIt;Mp.UnprocessableEntityError=XIt;Mp.toFile=iQc;mve=class extends Mp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new vxt(this),this.messages=new u8e(this),this.models=new bxt(this),this.beta=new k1(this)}};mve.Completions=vxt;mve.Messages=u8e;mve.Models=bxt;mve.Beta=k1;a(L8e,"j4");a(GIt,"N8");a(NI,"o$");a(B8e,"D1");a(XZi,"JU");a(vQc,"Tw");CQc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),bQc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(SQc,"xw");A8r=class{static{a(this,"gw")}read(e){return(0,sA.readFile)(e,"utf8")}readBytes(e){return(0,sA.readFile)(e)}write(e,r,n){return(0,sA.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,sA.mkdir)(e,{recursive:!0})}catch(r){if(NI(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return SQc(e,r,n)}delete(e){return(0,sA.unlink)(e)}list(e){return(0,sA.readdir)(e)}append(e,r,n){return(0,sA.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,sA.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,sA.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,sA.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,sA.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},TQc=new tXi.AsyncLocalStorage;a(Sxt,"w8");J_e=null;a(nXi,"uw");a(IQc,"mw");a(hk,"L6");a(xQc,"dv");wQc=xQc;a(RQc,"iv");kQc=RQc;a(PQc,"nv");DQc=PQc;a(NQc,"rv");MQc=NQc,OQc=200;a(LQc,"tv");BQc=LQc;a(Qve,"D8");Qve.prototype.clear=wQc;Qve.prototype.delete=kQc;Qve.prototype.get=DQc;Qve.prototype.has=MQc;Qve.prototype.set=BQc;FQc=Qve,UQc=(function(){try{var t=w6r(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Txt=UQc;a(QQc,"sv");F6r=QQc,qQc=Object.prototype,jQc=qQc.hasOwnProperty;a(HQc,"QC");iXi=HQc;a(GQc,"JC");$Qc=GQc;a(VQc,"XC");WQc=VQc;a(zQc,"YC");qve=zQc,YQc="[object Arguments]";a(KQc,"GC");gKi=KQc,oXi=Object.prototype,JQc=oXi.hasOwnProperty,ZQc=oXi.propertyIsEnumerable,XQc=gKi((function(){return arguments})())?gKi:function(t){return qve(t)&&JQc.call(t,"callee")&&!ZQc.call(t,"callee")},d8e=XQc,eqc=Array.isArray,uW=eqc,zFe={};WL(zFe,{default:a(()=>U6r,"default")});a(tqc,"VC");rqc=tqc,sXi=typeof zFe=="object"&&zFe&&!zFe.nodeType&&zFe,AKi=sXi&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,nqc=AKi&&AKi.exports===sXi,yKi=nqc?Ove.Buffer:void 0,iqc=yKi?yKi.isBuffer:void 0,oqc=iqc||rqc,U6r=oqc,sqc=9007199254740991,aqc=/^(?:0|[1-9]\d*)$/;a(cqc,"DC");Swt=cqc,lqc=9007199254740991;a(uqc,"ZC");Q6r=uqc,dqc="[object Arguments]",fqc="[object Array]",pqc="[object Boolean]",hqc="[object Date]",mqc="[object Error]",gqc="[object Function]",Aqc="[object Map]",yqc="[object Number]",Eqc="[object Object]",_qc="[object RegExp]",vqc="[object Set]",Cqc="[object String]",bqc="[object WeakMap]",Sqc="[object ArrayBuffer]",Tqc="[object DataView]",Iqc="[object Float32Array]",xqc="[object Float64Array]",wqc="[object Int8Array]",Rqc="[object Int16Array]",kqc="[object Int32Array]",Pqc="[object Uint8Array]",Dqc="[object Uint8ClampedArray]",Nqc="[object Uint16Array]",Mqc="[object Uint32Array]",Cd={};Cd[Iqc]=Cd[xqc]=Cd[wqc]=Cd[Rqc]=Cd[kqc]=Cd[Pqc]=Cd[Dqc]=Cd[Nqc]=Cd[Mqc]=!0;Cd[dqc]=Cd[fqc]=Cd[Sqc]=Cd[pqc]=Cd[Tqc]=Cd[hqc]=Cd[mqc]=Cd[gqc]=Cd[Aqc]=Cd[yqc]=Cd[Eqc]=Cd[_qc]=Cd[vqc]=Cd[Cqc]=Cd[bqc]=!1;a(Oqc,"pC");Lqc=Oqc;a(Bqc,"dC");Fqc=Bqc,YFe={};WL(YFe,{default:a(()=>y8r,"default")});aXi=typeof YFe=="object"&&YFe&&!YFe.nodeType&&YFe,r8e=aXi&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,Uqc=r8e&&r8e.exports===aXi,MFr=Uqc&&EZi.process,Qqc=(function(){try{var t=r8e&&r8e.require&&r8e.require("util").types;return t||MFr&&MFr.binding&&MFr.binding("util")}catch{}})(),y8r=Qqc,EKi=y8r&&y8r.isTypedArray,qqc=EKi?Fqc(EKi):Lqc,cXi=qqc,jqc=Object.prototype,Hqc=jqc.hasOwnProperty;a(Gqc,"aC");$qc=Gqc,Vqc=Object.prototype;a(Wqc,"eC");lXi=Wqc;a(zqc,"$T");Yqc=zqc;a(Kqc,"QT");q6r=Kqc;a(Jqc,"JT");Zqc=Jqc,Xqc=Object.prototype,ejc=Xqc.hasOwnProperty;a(tjc,"WT");rjc=tjc;a(njc,"GT");uXi=njc,KFe={};WL(KFe,{default:a(()=>fXi,"default")});dXi=typeof KFe=="object"&&KFe&&!KFe.nodeType&&KFe,_Ki=dXi&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,ijc=_Ki&&_Ki.exports===dXi,vKi=ijc?Ove.Buffer:void 0,CKi=vKi?vKi.allocUnsafe:void 0;a(ojc,"HT");fXi=ojc;a(sjc,"KT");ajc=sjc;a(cjc,"qT");ljc=cjc,ujc=Yqc(Object.getPrototypeOf,Object),pXi=ujc,djc=Ove.Uint8Array,bKi=djc;a(fjc,"zT");pjc=fjc;a(hjc,"NT");mjc=hjc,SKi=Object.create,gjc=(function(){function t(){}return a(t,"$"),function(e){if(!Y9(e))return{};if(SKi)return SKi(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),Ajc=gjc;a(yjc,"OT");Ejc=yjc,_jc="[object Symbol]";a(vjc,"FT");j6r=vjc,Cjc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bjc=/^\w*$/;a(Sjc,"LT");Tjc=Sjc,Ijc=500;a(xjc,"AT");wjc=xjc,Rjc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kjc=/\\(\\)?/g,Pjc=wjc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Rjc,function(r,n,o,s){e.push(o?s.replace(kjc,"$1"):n||r)}),e}),Djc=Pjc;a(Njc,"ET");Mjc=Njc,Ojc=1/0,TKi=lW?lW.prototype:void 0,IKi=TKi?TKi.toString:void 0;a(hXi,"PO");Ljc=hXi;a(Bjc,"_T");Fjc=Bjc;a(Ujc,"kT");Twt=Ujc,Qjc=1/0;a(qjc,"vT");H6r=qjc;a(jjc,"CT");Hjc=jjc;a(Gjc,"TT");$jc=Gjc;a(Vjc,"xT");Wjc=Vjc;a(zjc,"yT");Yjc=zjc;a(Kjc,"fT");mXi=Kjc,G6r=null;a(Jjc,"CO");a(Zjc,"TO");xxt=new Map;a(Xjc,"xO");a(eHc,"yO");$6r=new Map;a(rHc,"fO");a(nHc,"gO");a(V6r,"V0");a(oHc,"hO");a(sHc,"uO");aHc={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(cHc,"lT");lHc=cHc(),uHc=a(()=>{},"pT");a(AXi,"VU");dHc=M8e(),TKh=dHc.subscribe,fHc=M8e(),IKh=fHc.subscribe,pHc=M8e(),xKh=pHc.subscribe,hHc=M8e(),wKh=hHc.subscribe,mHc=M8e(),RKh=mHc.subscribe;a(gHc,"lO");a(AHc,"tT");_8r=class{static{a(this,"cO")}#e=new Set;register(e){let r=AHc(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}},yHc=new _8r;a(EHc,"pO");_Hc=Py(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(vHc,"sT");a(CHc,"eT");a(bHc,"iO");a(SHc,"tO");a(THc,"Qx");a(xKi,"oO");a(IHc,"aO");a(EXi,"HX");xHc={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=ef(e,rf`fs.existsSync(${t})`,0);return Co.existsSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},async stat(t){return(0,G0.stat)(t)},async readdir(t){return(0,G0.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,G0.unlink)(t)},async rmdir(t){return(0,G0.rmdir)(t)},async rm(t,e){return(0,G0.rm)(t,e)},async mkdir(t,e){try{await(0,G0.mkdir)(t,{recursive:!0,...e})}catch(r){if(NI(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,G0.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,G0.rename)(t,e)},statSync(t){let e=[];try{let o=ef(e,rf`fs.statSync(${t})`,0);return Co.statSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},lstatSync(t){let e=[];try{let o=ef(e,rf`fs.lstatSync(${t})`,0);return Co.lstatSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readFileSync(t,e){let r=[];try{let s=ef(r,rf`fs.readFileSync(${t})`,0);return Co.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{tf(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=ef(e,rf`fs.readFileBytesSync(${t})`,0);return Co.readFileSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readSync(t,e){let r=[];try{let s=ef(r,rf`fs.readSync(${t}, ${e.length} bytes)`,0),c;try{c=Co.openSync(t,"r");let l=Buffer.alloc(e.length),u=Co.readSync(c,l,0,e.length,0);return{buffer:l,bytesRead:u}}finally{c&&Co.closeSync(c)}}catch(s){var n=s,o=1}finally{tf(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=ef(n,rf`fs.appendFileSync(${t}, ${e.length} chars)`,0);if(r?.mode!==void 0)try{let l=Co.openSync(t,"ax",r.mode);try{Co.appendFileSync(l,e)}finally{Co.closeSync(l)}return}catch(l){if(NI(l)!=="EEXIST")throw l}Co.appendFileSync(t,e)}catch(c){var o=c,s=1}finally{tf(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=ef(r,rf`fs.copyFileSync(${t} → ${e})`,0);Co.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},unlinkSync(t){let e=[];try{let o=ef(e,rf`fs.unlinkSync(${t})`,0);Co.unlinkSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},renameSync(t,e){let r=[];try{let s=ef(r,rf`fs.renameSync(${t} → ${e})`,0);Co.renameSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},linkSync(t,e){let r=[];try{let s=ef(r,rf`fs.linkSync(${t} → ${e})`,0);Co.linkSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=ef(n,rf`fs.symlinkSync(${t} → ${e})`,0);Co.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{tf(n,o,s)}},readlinkSync(t){let e=[];try{let o=ef(e,rf`fs.readlinkSync(${t})`,0);return Co.readlinkSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},realpathSync(t){let e=[];try{let o=ef(e,rf`fs.realpathSync(${t})`,0);return Co.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{tf(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=ef(r,rf`fs.mkdirSync(${t})`,0),c={recursive:!0};e?.mode!==void 0&&(c.mode=e.mode);try{Co.mkdirSync(t,c)}catch(l){if(NI(l)!=="EEXIST")throw l}}catch(s){var n=s,o=1}finally{tf(r,n,o)}},readdirSync(t){let e=[];try{let o=ef(e,rf`fs.readdirSync(${t})`,0);return Co.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readdirStringSync(t){let e=[];try{let o=ef(e,rf`fs.readdirStringSync(${t})`,0);return Co.readdirSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=ef(e,rf`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{tf(e,r,n)}},rmdirSync(t){let e=[];try{let o=ef(e,rf`fs.rmdirSync(${t})`,0);Co.rmdirSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},rmSync(t,e){let r=[];try{let s=ef(r,rf`fs.rmSync(${t})`,0);Co.rmSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},createWriteStream(t){return Co.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,G0.readFile)(t);let r=await(0,G0.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(${OHc}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"}],kKi=null;a(BHc,"Ox");a(FHc,"W2");v8r={verbose:0,debug:1,info:2,warn:3,error:4},UHc=Py(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(v8r,t)?t:"debug"}),QHc=!1;a(Iwt,"qX");C8r=Py(()=>{let t=Iwt();return QHc||s_(process.env.DEBUG)||s_(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||_Xi()||t.some(e=>e.startsWith("--debug="))||vXi()!==null}),qHc=Py(()=>{let t=Iwt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return _Hc(e)}),_Xi=Py(()=>{let t=Iwt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),vXi=Py(()=>{let t=Iwt();for(let e=0;e{try{let t=SXi(),e=(0,soe.dirname)(t),r=(0,soe.join)(e,"latest");await(0,l_.unlink)(r).catch(()=>{}),await(0,l_.symlink)(t,r)}catch{}}),DKh=(()=>{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})(),WHc={[Symbol.dispose](){}};a(zHc,"_x");rf=zHc;a(Qm,"B$");$N=a((t,e)=>{let r=[];try{let s=ef(r,rf`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},"d$");a(YHc,"w2");a(dW,"A4");a(KHc,"kx");a(JHc,"O2");ZHc=2e3,wxt=new Set,PKi=!1;a(XHc,"xx");a(eGc,"yx");T8r=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=r8r();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||r8r(),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(L8e(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 yZi()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=s_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,hZi.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(s_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();hk(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:E,permissionMode:_,allowDangerouslySkipPermissions:v,permissionPromptToolName:b,continueConversation:T,resume:w,settingSources:R,skills:x,disallowedTools:P=[],tools:D,mcpServers:N,strictMcpConfig:L,canUseTool:B,includePartialMessages:q,plugins:M,sandbox:O}=this.options,{allowedTools:j=[]}=this.options;if(x!==void 0){let H=x==="all"?["Skill"]:x.map(le=>`Skill(${le})`),re=new Set(j);j=[...j,...H.filter(le=>!re.has(le))]}let Q=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(f){switch(f.type){case"enabled":f.budgetTokens===void 0?Q.push("--thinking","adaptive"):Q.push("--max-thinking-tokens",f.budgetTokens.toString());break;case"disabled":Q.push("--thinking","disabled");break;case"adaptive":Q.push("--thinking","adaptive");break}f.type!=="disabled"&&f.display&&Q.push("--thinking-display",f.display)}if(this.options.effort&&Q.push("--effort",this.options.effort),h&&Q.push("--max-turns",h.toString()),m!==void 0&&Q.push("--max-budget-usd",m.toString()),g&&Q.push("--task-budget",g.total.toString()),A&&Q.push("--model",A),r&&Q.push("--agent",r),n&&n.length>0&&Q.push("--betas",n.join(",")),E&&Q.push("--json-schema",Qm(E)),this.options.debugFile?Q.push("--debug-file",this.options.debugFile):this.options.debug&&Q.push("--debug"),!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let H=IQc();H&&Q.push("--debug-file",H)}if(B){if(b)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");Q.push("--permission-prompt-tool","stdio")}else b&&Q.push("--permission-prompt-tool",b);if(T&&Q.push("--continue"),w&&Q.push("--resume",w),this.options.assistant&&Q.push("--assistant"),this.options.channels&&this.options.channels.length>0&&Q.push("--channels",...this.options.channels),j.length>0&&Q.push("--allowedTools",j.join(",")),P.length>0&&Q.push("--disallowedTools",P.join(",")),D!==void 0&&(Array.isArray(D)?D.length===0?Q.push("--tools",""):Q.push("--tools",D.join(",")):Q.push("--tools","default")),N&&Object.keys(N).length>0&&Q.push("--mcp-config",Qm({mcpServers:N})),R!==void 0&&Q.push(`--setting-sources=${R.join(",")}`),L&&Q.push("--strict-mcp-config"),_&&Q.push("--permission-mode",_),v&&Q.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.");Q.push("--fallback-model",y)}this.options.includeHookEvents&&Q.push("--include-hook-events"),q&&Q.push("--include-partial-messages"),this.options.sessionMirror&&Q.push("--session-mirror");for(let H of e)Q.push("--add-dir",H);if(M&&M.length>0)for(let H of M)if(H.type==="local")Q.push("--plugin-dir",H.path);else throw Error(`Unsupported plugin type: ${H.type}`);this.options.forkSession&&Q.push("--fork-session"),this.options.resumeSessionAt&&Q.push("--resume-session-at",this.options.resumeSessionAt),this.options.sessionId&&Q.push("--session-id",this.options.sessionId),this.options.persistSession===!1&&Q.push("--no-session-persistence"),this.options.managedSettings&&Q.push("--managed-settings",this.options.managedSettings);let U={...l??{}};this.options.settings&&(U.settings=this.options.settings);let Y=JHc(U,O);for(let[H,re]of Object.entries(Y))re===null?Q.push(`--${H}`):Q.push(`--${H}`,re);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,s_(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let W=tGc(u),V=W?u:s,z=W?[...c,...Q]:[...c,u,...Q],ie={command:V,args:z,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(hk(`Spawning Claude Code (custom): ${V} ${z.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(ie)):(hk(`Spawning Claude Code: ${V} ${z.join(" ")}`),this.process=this.spawnLocalProcess(ie)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,eGc(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 R1("Claude Code process aborted by user");else if(vQc(H)){let re=rGc(u,W);this.exitError=ReferenceError(re),hk(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${H.message}`),hk(this.exitError.message)}),this.process.on("exit",(H,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new R1("Claude Code process aborted by user");else{let le=this.getProcessExitError(H,re);le&&(this.exitError=le,hk(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 R1("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){hk("[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}`);hk(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||hk("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${GIt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new R1("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()},ZHc,r,e).unref(),r.once("exit",()=>wxt.delete(r))):r&&(wxt.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,gZi.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=$N(n)}catch{hk(`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 R1("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(tGc,"fx");a(rGc,"gx");Z_e="@anthropic-ai/claude-agent-sdk";a(nGc,"ux");a(iGc,"F2");Rxt=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(oGc,"mx");sGc=oGc();a(W6r,"BX");a(xXi,"AU");a(wXi,"IU");a(aGc,"Z2");a(j9,"I4");I8r=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?.())}},x8r=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new Rxt;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,Ixt.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&&(ru("[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 R1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);ru(`[Query.readMessages] Replacing exit error with result text. Original: ${GIt(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(Qm(o)+` +`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:GIt(n)}};try{await Promise.resolve(this.transport.write(Qm(o)+` +`))}catch(s){ru(`[Query.handleControlRequest] Error-response write failed: ${GIt(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 j9("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 j9("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 j9("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 j9("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return j9("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(Qm(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 j9("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return j9("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 j9("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return j9("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){ru("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,ru(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(Qm(n)+` +`))}ru(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(ru("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),ru("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof R1))throw r}}waitForFirstResult(){return this.firstResultReceived?(ru("[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 I8r(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),ru(`[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,Ixt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(Qm(n)+` +`)).catch(o=>{ru(`[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}})}},z6r=500,Y6r=1048576,cGc=[200,800],w8r=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=z6r,s=Y6r,c=cGc){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=Qm(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 Vie(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=L8e(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await pZi(f)}if(l){ru(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){ru(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},DKi=y6r(k6c(),1);a(lGc,"Ug");a(n8e,"O0");a(uGc,"qg");BFr=new Map,dGc=5e3;a(fGc,"Bg");a(pGc,"zg");a(hGc,"OZ");mGc=(0,DXi.promisify)(PXi.execFile);a(F8e,"m4");a(gGc,"jH");V9=65536,AGc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(bh,"L$");a(OXi,"ZZ");a(FFr,"IX");a(mk,"A6");a(k8r,"rQ");a(LXi,"RX");a(yGc,"MZ");a(BXi,"PX");f8e=200;a(EGc,"Lg");a(U8e,"F0");a(mW,"U4");a(_Gc,"jg");a(Q8e,"M1");a(FN,"j6");a(xwt,"L1");vGc=1048576,CGc=5242880;a(SGc,"Rg");a(FXi,"jZ");a(Yie,"D0");a(kxt,"jX");Pxt=Buffer.from('{"type":"attribution-snapshot"'),TGc=Buffer.from('{"type":"system"'),p8e=10,IGc=Buffer.from([p8e]),xGc=256;a(wGc,"_g");a(RGc,"kg");a(kGc,"Sg");a(PGc,"vg");a(DGc,"Cg");a(NGc,"AZ");a(MGc,"xg");a(OGc,"yg");a(LGc,"fg");a(UFr,"IH");a(BGc,"gg");a(FGc,"hg");a(UGc,"ug");a(UXi,"RH");a(QXi,"PH");a(QGc,"IZ");a(qXi,"RZ");a(qGc,"PZ");a(wwt,"k8");a(JFe,"oQ");a(jXi,"EZ");jGc=32;a(HGc,"pg");a(GGc,"dg");a($Gc,"ig");a(VGc,"ng");a(WGc,"rg");a(zGc,"bZ");a(YGc,"_Z");a(KGc,"CZ");a(JGc,"TZ");a(ZGc,"xZ");a(XGc,"ag");a(HXi,"yZ");a(QFr,"_H");a(e$c,"sg");t$c=new Set(["user","assistant","attachment","system","progress"]);a(r$c,"$h");a(n$c,"Qh");a(GXi,"fZ");a(i$c,"gZ");a(o$c,"Jh");a(s$c,"hZ");a(a$c,"Xh");a($Xi,"uZ");a(VXi,"lZ");a(WXi,"cZ");a(c$c,"Wh");a(l$c,"Gh");a(u$c,"pZ");a(d$c,"dZ");a(zXi,"vH");a(JXi,"CH");a(ZXi,"bX");a(f$c,"Uh");p$c="user:inference",XXi="user:profile",h$c="org:create_api_key",m$c=[h$c,XXi],g$c=[XXi,p$c,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],MKh=ZXi([...m$c,...g$c]),NKi={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}"},A$c=void 0;a(y$c,"zh");E$c=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(_$c,"rZ");v$c="-credentials";a(C$c,"tZ");b$c=/^[a-zA-Z0-9._-]+$/;a(S$c,"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})(hc||(hc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(MKi||(MKi={}));kn=hc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rW=a(t=>{switch(typeof t){case"undefined":return kn.undefined;case"string":return kn.string;case"number":return Number.isNaN(t)?kn.nan:kn.number;case"boolean":return kn.boolean;case"function":return kn.function;case"bigint":return kn.bigint;case"symbol":return kn.symbol;case"object":return Array.isArray(t)?kn.array:t===null?kn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?kn.promise:typeof Map<"u"&&t instanceof Map?kn.map:typeof Set<"u"&&t instanceof Set?kn.set:typeof Date<"u"&&t instanceof Date?kn.date:kn.object;default:return kn.unknown}},"l4"),hr=hc.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"]),Ek=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()}};Ek.create=t=>new Ek(t);T$c=a((t,e)=>{let r;switch(t.code){case hr.invalid_type:t.received===kn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case hr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,hc.jsonStringifyReplacer)}`;break;case hr.unrecognized_keys:r=`Unrecognized key(s) in object: ${hc.joinValues(t.keys,", ")}`;break;case hr.invalid_union:r="Invalid input";break;case hr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${hc.joinValues(t.options)}`;break;case hr.invalid_enum_value:r=`Invalid enum value. Expected ${hc.joinValues(t.options)}, received '${t.received}'`;break;case hr.invalid_arguments:r="Invalid function arguments";break;case hr.invalid_return_type:r="Invalid function return type";break;case hr.invalid_date:r="Invalid date";break;case hr.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}"`:hc.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case hr.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 hr.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 hr.custom:r="Invalid input";break;case hr.invalid_intersection_types:r="Intersection results could not be merged";break;case hr.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case hr.not_finite:r="Number must be finite";break;default:r=e.defaultError,hc.assertNever(t)}return{message:r}},"Fh"),m8e=T$c,I$c=m8e;a(D8r,"tQ");N8r=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(ln,"f");Xv=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 eo;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 eo;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}}},eo=Object.freeze({status:"aborted"}),XFe=a(t=>({status:"dirty",value:t}),"v8"),P1=a(t=>({status:"valid",value:t}),"z6"),OKi=a(t=>t.status==="aborted","TH"),LKi=a(t=>t.status==="dirty","xH"),Ave=a(t=>t.status==="valid","Z0"),Mxt=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})(Jn||(Jn={}));vk=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}},BKi=a((t,e)=>{if(Ave(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 Ek(t.common.issues);return this._error=r,this._error}}},"eZ");a(Zo,"e");Ms=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return rW(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:rW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Xv,ctx:{common:e.parent.common,data:e.data,parsedType:rW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Mxt(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:rW(e)},o=this._parseSync({data:e,path:n.path,parent:n});return BKi(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rW(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Ave(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=>Ave(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:rW(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Mxt(o)?o:Promise.resolve(o));return BKi(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:hr.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 qN({schema:this,typeName:Cr.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 _k.create(this,this._def)}nullable(){return J9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fW.create(this)}promise(){return roe.create(this,this._def)}or(e){return vve.create([this,e],this._def)}and(e){return Cve.create(this,e,this._def)}transform(e){return new qN({...Zo(this._def),schema:this,typeName:Cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new xve({...Zo(this._def),innerType:this,defaultValue:r,typeName:Cr.ZodDefault})}brand(){return new Oxt({typeName:Cr.ZodBranded,type:this,...Zo(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new wve({...Zo(this._def),innerType:this,catchValue:r,typeName:Cr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Lxt.create(this,e)}readonly(){return Rve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},x$c=/^c[^\s-]{8,}$/i,w$c=/^[0-9a-z]+$/,R$c=/^[0-9A-HJKMNP-TV-Z]{26}$/i,k$c=/^[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,P$c=/^[a-z0-9_-]{21}$/i,D$c=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,N$c=/^[-+]?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)?)??$/,M$c=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,O$c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",L$c=/^(?:(?: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])$/,B$c=/^(?:(?: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])$/,F$c=/^(([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]))$/,U$c=/^(([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])$/,Q$c=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,q$c=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,eeo="((\\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])))",j$c=new RegExp(`^${eeo}$`);a(teo,"QM");a(H$c,"yh");a(G$c,"fh");a($$c,"gh");a(V$c,"hh");a(W$c,"uh");yve=class t extends Ms{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==kn.string){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.string,received:o.parsedType}),eo}let r=new Xv,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:hr.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:hr.invalid_string,...Jn.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Jn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Jn.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Jn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Jn.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Jn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Jn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Jn.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Jn.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Jn.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Jn.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Jn.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Jn.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Jn.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,...Jn.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,...Jn.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Jn.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Jn.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Jn.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Jn.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Jn.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Jn.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Jn.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Jn.errToObj(r)})}nonempty(e){return this.min(1,Jn.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 yve({checks:[],typeName:Cr.ZodString,coerce:t?.coerce??!1,...Zo(t)});a(z$c,"mh");g8e=class t extends Ms{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)!==kn.number){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.number,received:o.parsedType}),eo}let r,n=new Xv;for(let o of this._def.checks)o.kind==="int"?hc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.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),ln(r,{code:hr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?z$c(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.not_finite,message:o.message}),n.dirty()):hc.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Jn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Jn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Jn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Jn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Jn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Jn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Jn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Jn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Jn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Jn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Jn.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Jn.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Jn.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Jn.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"&&hc.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 g8e({checks:[],typeName:Cr.ZodNumber,coerce:t?.coerce||!1,...Zo(t)});A8e=class t extends Ms{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)!==kn.bigint)return this._getInvalidInput(e);let r,n=new Xv;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.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),ln(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):hc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.bigint,received:r.parsedType}),eo}gte(e,r){return this.setLimit("min",e,!0,Jn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Jn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Jn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Jn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Jn.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:Jn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Jn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Jn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Jn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Jn.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 A8e({checks:[],typeName:Cr.ZodBigInt,coerce:t?.coerce??!1,...Zo(t)});y8e=class extends Ms{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==kn.boolean){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.boolean,received:r.parsedType}),eo}return P1(e.data)}};y8e.create=t=>new y8e({typeName:Cr.ZodBoolean,coerce:t?.coerce||!1,...Zo(t)});E8e=class t extends Ms{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==kn.date){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.date,received:o.parsedType}),eo}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_date}),eo}let r=new Xv,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:hr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):hc.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:Jn.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Jn.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 E8e({checks:[],coerce:t?.coerce||!1,typeName:Cr.ZodDate,...Zo(t)});_8e=class extends Ms{static{a(this,"SX")}_parse(e){if(this._getType(e)!==kn.symbol){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.symbol,received:r.parsedType}),eo}return P1(e.data)}};_8e.create=t=>new _8e({typeName:Cr.ZodSymbol,...Zo(t)});Eve=class extends Ms{static{a(this,"$7")}_parse(e){if(this._getType(e)!==kn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.undefined,received:r.parsedType}),eo}return P1(e.data)}};Eve.create=t=>new Eve({typeName:Cr.ZodUndefined,...Zo(t)});_ve=class extends Ms{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==kn.null){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.null,received:r.parsedType}),eo}return P1(e.data)}};_ve.create=t=>new _ve({typeName:Cr.ZodNull,...Zo(t)});v8e=class extends Ms{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return P1(e.data)}};v8e.create=t=>new v8e({typeName:Cr.ZodAny,...Zo(t)});cW=class extends Ms{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return P1(e.data)}};cW.create=t=>new cW({typeName:Cr.ZodUnknown,...Zo(t)});$L=class extends Ms{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.never,received:r.parsedType}),eo}};$L.create=t=>new $L({typeName:Cr.ZodNever,...Zo(t)});C8e=class extends Ms{static{a(this,"CX")}_parse(e){if(this._getType(e)!==kn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.void,received:r.parsedType}),eo}return P1(e.data)}};C8e.create=t=>new C8e({typeName:Cr.ZodVoid,...Zo(t)});fW=class t extends Ms{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==kn.array)return ln(r,{code:hr.invalid_type,expected:kn.array,received:r.parsedType}),eo;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(ln(r,{code:hr.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 vk(r,c,r.path,l)))).then(c=>Xv.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new vk(r,c,r.path,l)));return Xv.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Jn.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Jn.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Jn.toString(r)}})}nonempty(e){return this.min(1,e)}};fW.create=(t,e)=>new fW({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Cr.ZodArray,...Zo(e)});a(rve,"C8");OI=class t extends Ms{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=hc.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==kn.object){let u=this._getOrReturnCtx(e);return ln(u,{code:hr.invalid_type,expected:kn.object,received:u.parsedType}),eo}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof $L&&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 vk(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof $L){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&&(ln(n,{code:hr.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 vk(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=>Xv.mergeObjectSync(r,u)):Xv.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Jn.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:Jn.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:Cr.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 hc.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 hc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return rve(this)}partial(e){let r={};for(let n of hc.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 hc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof _k;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return reo(hc.objectKeys(this.shape))}};OI.create=(t,e)=>new OI({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});OI.strictCreate=(t,e)=>new OI({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});OI.lazycreate=(t,e)=>new OI({shape:t,unknownKeys:"strip",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});vve=class extends Ms{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 Ek(l.ctx.common.issues));return ln(r,{code:hr.invalid_union,unionErrors:c}),eo}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 Ek(u));return ln(r,{code:hr.invalid_union,unionErrors:l}),eo}}get options(){return this._def.options}};vve.create=(t,e)=>new vve({options:t,typeName:Cr.ZodUnion,...Zo(e)});H9=a(t=>t instanceof bve?H9(t.schema):t instanceof qN?H9(t.innerType()):t instanceof Sve?[t.value]:t instanceof Tve?t.options:t instanceof Ive?hc.objectValues(t.enum):t instanceof xve?H9(t._def.innerType):t instanceof Eve?[void 0]:t instanceof _ve?[null]:t instanceof _k?[void 0,...H9(t.unwrap())]:t instanceof J9?[null,...H9(t.unwrap())]:t instanceof Oxt||t instanceof Rve?H9(t.unwrap()):t instanceof wve?H9(t._def.innerType):[],"c4"),M8r=class t extends Ms{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.object)return ln(r,{code:hr.invalid_type,expected:kn.object,received:r.parsedType}),eo;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}):(ln(r,{code:hr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),eo)}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=H9(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:Cr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...Zo(n)})}};a(O8r,"fH");Cve=class extends Ms{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(OKi(s)||OKi(c))return eo;let l=O8r(s.value,c.value);return l.valid?((LKi(s)||LKi(c))&&r.dirty(),{status:r.value,value:l.data}):(ln(n,{code:hr.invalid_intersection_types}),eo)},"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}))}};Cve.create=(t,e,r)=>new Cve({left:t,right:e,typeName:Cr.ZodIntersection,...Zo(r)});K9=class t extends Ms{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.array)return ln(n,{code:hr.invalid_type,expected:kn.array,received:n.parsedType}),eo;if(n.data.lengththis._def.items.length&&(ln(n,{code:hr.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 vk(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Xv.mergeArray(r,s)):Xv.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};K9.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new K9({items:t,typeName:Cr.ZodTuple,rest:null,...Zo(e)})};L8r=class t extends Ms{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!==kn.object)return ln(n,{code:hr.invalid_type,expected:kn.object,received:n.parsedType}),eo;let o=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)o.push({key:s._parse(new vk(n,l,n.path,l)),value:c._parse(new vk(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?Xv.mergeObjectAsync(r,o):Xv.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Ms?new t({keyType:e,valueType:r,typeName:Cr.ZodRecord,...Zo(n)}):new t({keyType:yve.create(),valueType:e,typeName:Cr.ZodRecord,...Zo(r)})}},b8e=class extends Ms{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!==kn.map)return ln(n,{code:hr.invalid_type,expected:kn.map,received:n.parsedType}),eo;let o=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,u],d)=>({key:o._parse(new vk(n,l,n.path,[d,"key"])),value:s._parse(new vk(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 eo;(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 eo;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}}}};b8e.create=(t,e,r)=>new b8e({valueType:e,keyType:t,typeName:Cr.ZodMap,...Zo(r)});S8e=class t extends Ms{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.set)return ln(n,{code:hr.invalid_type,expected:kn.set,received:n.parsedType}),eo;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(ln(n,{code:hr.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 eo;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 vk(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:Jn.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Jn.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};S8e.create=(t,e)=>new S8e({valueType:t,minSize:null,maxSize:null,typeName:Cr.ZodSet,...Zo(e)});B8r=class t extends Ms{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.function)return ln(r,{code:hr.invalid_type,expected:kn.function,received:r.parsedType}),eo;function n(l,u){return N8r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,D8r(),m8e].filter(d=>!!d),issueData:{code:hr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return N8r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,D8r(),m8e].filter(d=>!!d),issueData:{code:hr.invalid_return_type,returnTypeError:u}})}a(o,"Y");let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof roe){let l=this;return P1(async function(...u){let d=new Ek([]),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 P1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new Ek([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new Ek([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:K9.create(e).rest(cW.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||K9.create([]).rest(cW.create()),returns:r||cW.create(),typeName:Cr.ZodFunction,...Zo(n)})}},bve=class extends Ms{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})}};bve.create=(t,e)=>new bve({getter:t,typeName:Cr.ZodLazy,...Zo(e)});Sve=class extends Ms{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ln(r,{received:r.data,code:hr.invalid_literal,expected:this._def.value}),eo}return{status:"valid",value:e.data}}get value(){return this._def.value}};Sve.create=(t,e)=>new Sve({value:t,typeName:Cr.ZodLiteral,...Zo(e)});a(reo,"JM");Tve=class t extends Ms{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ln(r,{expected:hc.joinValues(n),received:r.parsedType,code:hr.invalid_type}),eo}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 ln(r,{received:r.data,code:hr.invalid_enum_value,options:n}),eo}return P1(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})}};Tve.create=reo;Ive=class extends Ms{static{a(this,"G7")}_parse(e){let r=hc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==kn.string&&n.parsedType!==kn.number){let o=hc.objectValues(r);return ln(n,{expected:hc.joinValues(o),received:n.parsedType,code:hr.invalid_type}),eo}if(this._cache||(this._cache=new Set(hc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=hc.objectValues(r);return ln(n,{received:n.data,code:hr.invalid_enum_value,options:o}),eo}return P1(e.data)}get enum(){return this._def.values}};Ive.create=(t,e)=>new Ive({values:t,typeName:Cr.ZodNativeEnum,...Zo(e)});roe=class extends Ms{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.promise&&r.common.async===!1)return ln(r,{code:hr.invalid_type,expected:kn.promise,received:r.parsedType}),eo;let n=r.parsedType===kn.promise?r.data:Promise.resolve(r.data);return P1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};roe.create=(t,e)=>new roe({type:t,typeName:Cr.ZodPromise,...Zo(e)});qN=class extends Ms{static{a(this,"P4")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Cr.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=>{ln(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 eo;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?eo:u.status==="dirty"||r.value==="dirty"?XFe(u.value):u});{if(r.value==="aborted")return eo;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?eo:l.status==="dirty"||r.value==="dirty"?XFe(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"?eo:(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"?eo:(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(!Ave(c))return eo;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=>Ave(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):eo);hc.assertNever(o)}};qN.create=(t,e,r)=>new qN({schema:t,typeName:Cr.ZodEffects,effect:e,...Zo(r)});qN.createWithPreprocess=(t,e,r)=>new qN({schema:e,effect:{type:"preprocess",transform:t},typeName:Cr.ZodEffects,...Zo(r)});_k=class extends Ms{static{a(this,"o6")}_parse(e){return this._getType(e)===kn.undefined?P1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};_k.create=(t,e)=>new _k({innerType:t,typeName:Cr.ZodOptional,...Zo(e)});J9=class extends Ms{static{a(this,"A1")}_parse(e){return this._getType(e)===kn.null?P1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};J9.create=(t,e)=>new J9({innerType:t,typeName:Cr.ZodNullable,...Zo(e)});xve=class extends Ms{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===kn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};xve.create=(t,e)=>new xve({innerType:t,typeName:Cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Zo(e)});wve=class extends Ms{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 Mxt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ek(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ek(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};wve.create=(t,e)=>new wve({innerType:t,typeName:Cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Zo(e)});T8e=class extends Ms{static{a(this,"yX")}_parse(e){if(this._getType(e)!==kn.nan){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.nan,received:r.parsedType}),eo}return{status:"valid",value:e.data}}};T8e.create=t=>new T8e({typeName:Cr.ZodNaN,...Zo(t)});Oxt=class extends Ms{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}},Lxt=class t extends Ms{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"?eo:o.status==="dirty"?(r.dirty(),XFe(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"?eo: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:Cr.ZodPipeline})}},Rve=class extends Ms{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(Ave(o)&&(o.value=Object.freeze(o.value)),o),"J");return Mxt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Rve.create=(t,e)=>new Rve({innerType:t,typeName:Cr.ZodReadonly,...Zo(e)});OKh={object:OI.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"})(Cr||(Cr={}));LKh=yve.create,BKh=g8e.create,FKh=T8e.create,UKh=A8e.create,QKh=y8e.create,qKh=E8e.create,jKh=_8e.create,HKh=Eve.create,GKh=_ve.create,$Kh=v8e.create,VKh=cW.create,WKh=$L.create,zKh=C8e.create,YKh=fW.create,Y$c=OI.create,KKh=OI.strictCreate,JKh=vve.create,ZKh=M8r.create,XKh=Cve.create,eJh=K9.create,tJh=L8r.create,rJh=b8e.create,nJh=S8e.create,iJh=B8r.create,oJh=bve.create,sJh=Sve.create,aJh=Tve.create,cJh=Ive.create,lJh=roe.create,uJh=qN.create,dJh=_k.create,fJh=J9.create,pJh=qN.createWithPreprocess,hJh=Lxt.create,neo={};WL(neo,{version:a(()=>hto,"version"),util:a(()=>Ws,"util"),treeifyError:a(()=>meo,"treeifyError"),toJSONSchema:a(()=>tUr,"toJSONSchema"),toDotPath:a(()=>geo,"toDotPath"),safeParseAsync:a(()=>Mwt,"safeParseAsync"),safeParse:a(()=>Nwt,"safeParse"),registry:a(()=>_9r,"registry"),regexes:a(()=>s9r,"regexes"),prettifyError:a(()=>Aeo,"prettifyError"),parseAsync:a(()=>Qxt,"parseAsync"),parse:a(()=>Uxt,"parse"),locales:a(()=>E9r,"locales"),isValidJWT:a(()=>Fto,"isValidJWT"),isValidBase64URL:a(()=>Oto,"isValidBase64URL"),isValidBase64:a(()=>u9r,"isValidBase64"),globalRegistry:a(()=>W9,"globalRegistry"),globalConfig:a(()=>Bxt,"globalConfig"),function:a(()=>sno,"function"),formatError:a(()=>t9r,"formatError"),flattenError:a(()=>e9r,"flattenError"),config:a(()=>eC,"config"),clone:a(()=>VN,"clone"),_xid:a(()=>D9r,"_xid"),_void:a(()=>$ro,"_void"),_uuidv7:a(()=>T9r,"_uuidv7"),_uuidv6:a(()=>S9r,"_uuidv6"),_uuidv4:a(()=>b9r,"_uuidv4"),_uuid:a(()=>C9r,"_uuid"),_url:a(()=>I9r,"_url"),_uppercase:a(()=>$9r,"_uppercase"),_unknown:a(()=>Gxt,"_unknown"),_union:a(()=>KWc,"_union"),_undefined:a(()=>qro,"_undefined"),_ulid:a(()=>P9r,"_ulid"),_uint64:a(()=>Uro,"_uint64"),_uint32:a(()=>Nro,"_uint32"),_tuple:a(()=>eno,"_tuple"),_trim:a(()=>J9r,"_trim"),_transform:a(()=>ozc,"_transform"),_toUpperCase:a(()=>X9r,"_toUpperCase"),_toLowerCase:a(()=>Z9r,"_toLowerCase"),_templateLiteral:a(()=>hzc,"_templateLiteral"),_symbol:a(()=>Qro,"_symbol"),_success:a(()=>uzc,"_success"),_stringbool:a(()=>ino,"_stringbool"),_stringFormat:a(()=>ono,"_stringFormat"),_string:a(()=>_ro,"_string"),_startsWith:a(()=>W9r,"_startsWith"),_size:a(()=>j9r,"_size"),_set:a(()=>tzc,"_set"),_safeParseAsync:a(()=>o9r,"_safeParseAsync"),_safeParse:a(()=>i9r,"_safeParse"),_regex:a(()=>H9r,"_regex"),_refine:a(()=>nno,"_refine"),_record:a(()=>XWc,"_record"),_readonly:a(()=>pzc,"_readonly"),_property:a(()=>Xro,"_property"),_promise:a(()=>gzc,"_promise"),_positive:a(()=>Yro,"_positive"),_pipe:a(()=>fzc,"_pipe"),_parseAsync:a(()=>n9r,"_parseAsync"),_parse:a(()=>r9r,"_parse"),_overwrite:a(()=>loe,"_overwrite"),_optional:a(()=>szc,"_optional"),_number:a(()=>xro,"_number"),_nullable:a(()=>azc,"_nullable"),_null:a(()=>jro,"_null"),_normalize:a(()=>K9r,"_normalize"),_nonpositive:a(()=>Jro,"_nonpositive"),_nonoptional:a(()=>lzc,"_nonoptional"),_nonnegative:a(()=>Zro,"_nonnegative"),_never:a(()=>Gro,"_never"),_negative:a(()=>Kro,"_negative"),_nativeEnum:a(()=>nzc,"_nativeEnum"),_nanoid:a(()=>w9r,"_nanoid"),_nan:a(()=>zro,"_nan"),_multipleOf:a(()=>R8e,"_multipleOf"),_minSize:a(()=>k8e,"_minSize"),_minLength:a(()=>Pve,"_minLength"),_min:a(()=>PI,"_min"),_mime:a(()=>Y9r,"_mime"),_maxSize:a(()=>Lwt,"_maxSize"),_maxLength:a(()=>Bwt,"_maxLength"),_max:a(()=>UN,"_max"),_map:a(()=>ezc,"_map"),_lte:a(()=>UN,"_lte"),_lt:a(()=>noe,"_lt"),_lowercase:a(()=>G9r,"_lowercase"),_literal:a(()=>izc,"_literal"),_length:a(()=>Fwt,"_length"),_lazy:a(()=>mzc,"_lazy"),_ksuid:a(()=>N9r,"_ksuid"),_jwt:a(()=>q9r,"_jwt"),_isoTime:a(()=>Tro,"_isoTime"),_isoDuration:a(()=>Iro,"_isoDuration"),_isoDateTime:a(()=>bro,"_isoDateTime"),_isoDate:a(()=>Sro,"_isoDate"),_ipv6:a(()=>O9r,"_ipv6"),_ipv4:a(()=>M9r,"_ipv4"),_intersection:a(()=>ZWc,"_intersection"),_int64:a(()=>Fro,"_int64"),_int32:a(()=>Dro,"_int32"),_int:a(()=>Rro,"_int"),_includes:a(()=>V9r,"_includes"),_guid:a(()=>Hxt,"_guid"),_gte:a(()=>PI,"_gte"),_gt:a(()=>ioe,"_gt"),_float64:a(()=>Pro,"_float64"),_float32:a(()=>kro,"_float32"),_file:a(()=>tno,"_file"),_enum:a(()=>rzc,"_enum"),_endsWith:a(()=>z9r,"_endsWith"),_emoji:a(()=>x9r,"_emoji"),_email:a(()=>v9r,"_email"),_e164:a(()=>Q9r,"_e164"),_discriminatedUnion:a(()=>JWc,"_discriminatedUnion"),_default:a(()=>czc,"_default"),_date:a(()=>Vro,"_date"),_custom:a(()=>rno,"_custom"),_cuid2:a(()=>k9r,"_cuid2"),_cuid:a(()=>R9r,"_cuid"),_coercedString:a(()=>vro,"_coercedString"),_coercedNumber:a(()=>wro,"_coercedNumber"),_coercedDate:a(()=>Wro,"_coercedDate"),_coercedBoolean:a(()=>Oro,"_coercedBoolean"),_coercedBigint:a(()=>Bro,"_coercedBigint"),_cidrv6:a(()=>B9r,"_cidrv6"),_cidrv4:a(()=>L9r,"_cidrv4"),_catch:a(()=>dzc,"_catch"),_boolean:a(()=>Mro,"_boolean"),_bigint:a(()=>Lro,"_bigint"),_base64url:a(()=>U9r,"_base64url"),_base64:a(()=>F9r,"_base64"),_array:a(()=>eUr,"_array"),_any:a(()=>Hro,"_any"),TimePrecision:a(()=>Cro,"TimePrecision"),NEVER:a(()=>ieo,"NEVER"),JSONSchemaGenerator:a(()=>P8e,"JSONSchemaGenerator"),JSONSchema:a(()=>Azc,"JSONSchema"),Doc:a(()=>qxt,"Doc"),$output:a(()=>yro,"$output"),$input:a(()=>Ero,"$input"),$constructor:a(()=>ft,"$constructor"),$brand:a(()=>oeo,"$brand"),$ZodXID:a(()=>Sto,"$ZodXID"),$ZodVoid:a(()=>zto,"$ZodVoid"),$ZodUnknown:a(()=>jxt,"$ZodUnknown"),$ZodUnion:a(()=>g9r,"$ZodUnion"),$ZodUndefined:a(()=>Gto,"$ZodUndefined"),$ZodUUID:a(()=>gto,"$ZodUUID"),$ZodURL:a(()=>yto,"$ZodURL"),$ZodULID:a(()=>bto,"$ZodULID"),$ZodType:a(()=>bo,"$ZodType"),$ZodTuple:a(()=>Owt,"$ZodTuple"),$ZodTransform:a(()=>A9r,"$ZodTransform"),$ZodTemplateLiteral:a(()=>pro,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>Hto,"$ZodSymbol"),$ZodSuccess:a(()=>lro,"$ZodSuccess"),$ZodStringFormat:a(()=>Lu,"$ZodStringFormat"),$ZodString:a(()=>H8e,"$ZodString"),$ZodSet:a(()=>ero,"$ZodSet"),$ZodRegistry:a(()=>w8e,"$ZodRegistry"),$ZodRecord:a(()=>Zto,"$ZodRecord"),$ZodRealError:a(()=>q8e,"$ZodRealError"),$ZodReadonly:a(()=>fro,"$ZodReadonly"),$ZodPromise:a(()=>hro,"$ZodPromise"),$ZodPrefault:a(()=>aro,"$ZodPrefault"),$ZodPipe:a(()=>y9r,"$ZodPipe"),$ZodOptional:a(()=>iro,"$ZodOptional"),$ZodObject:a(()=>m9r,"$ZodObject"),$ZodNumberFormat:a(()=>qto,"$ZodNumberFormat"),$ZodNumber:a(()=>d9r,"$ZodNumber"),$ZodNullable:a(()=>oro,"$ZodNullable"),$ZodNull:a(()=>$to,"$ZodNull"),$ZodNonOptional:a(()=>cro,"$ZodNonOptional"),$ZodNever:a(()=>Wto,"$ZodNever"),$ZodNanoID:a(()=>_to,"$ZodNanoID"),$ZodNaN:a(()=>dro,"$ZodNaN"),$ZodMap:a(()=>Xto,"$ZodMap"),$ZodLiteral:a(()=>rro,"$ZodLiteral"),$ZodLazy:a(()=>mro,"$ZodLazy"),$ZodKSUID:a(()=>Tto,"$ZodKSUID"),$ZodJWT:a(()=>Uto,"$ZodJWT"),$ZodIntersection:a(()=>Jto,"$ZodIntersection"),$ZodISOTime:a(()=>wto,"$ZodISOTime"),$ZodISODuration:a(()=>Rto,"$ZodISODuration"),$ZodISODateTime:a(()=>Ito,"$ZodISODateTime"),$ZodISODate:a(()=>xto,"$ZodISODate"),$ZodIPv6:a(()=>Pto,"$ZodIPv6"),$ZodIPv4:a(()=>kto,"$ZodIPv4"),$ZodGUID:a(()=>mto,"$ZodGUID"),$ZodFunction:a(()=>$xt,"$ZodFunction"),$ZodFile:a(()=>nro,"$ZodFile"),$ZodError:a(()=>X6r,"$ZodError"),$ZodEnum:a(()=>tro,"$ZodEnum"),$ZodEmoji:a(()=>Eto,"$ZodEmoji"),$ZodEmail:a(()=>Ato,"$ZodEmail"),$ZodE164:a(()=>Bto,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>Kto,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>sro,"$ZodDefault"),$ZodDate:a(()=>Yto,"$ZodDate"),$ZodCustomStringFormat:a(()=>Qto,"$ZodCustomStringFormat"),$ZodCustom:a(()=>gro,"$ZodCustom"),$ZodCheckUpperCase:a(()=>ato,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>j8e,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>lto,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>tto,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>oto,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>dto,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>pto,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>Jeo,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>Keo,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>eto,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>nto,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>fto,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>Xeo,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>rto,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>sto,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>c9r,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>ito,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>cto,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>l9r,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>uto,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>Zeo,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>Sh,"$ZodCheck"),$ZodCatch:a(()=>uro,"$ZodCatch"),$ZodCUID2:a(()=>Cto,"$ZodCUID2"),$ZodCUID:a(()=>vto,"$ZodCUID"),$ZodCIDRv6:a(()=>Nto,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>Dto,"$ZodCIDRv4"),$ZodBoolean:a(()=>f9r,"$ZodBoolean"),$ZodBigIntFormat:a(()=>jto,"$ZodBigIntFormat"),$ZodBigInt:a(()=>p9r,"$ZodBigInt"),$ZodBase64URL:a(()=>Lto,"$ZodBase64URL"),$ZodBase64:a(()=>Mto,"$ZodBase64"),$ZodAsyncError:a(()=>pW,"$ZodAsyncError"),$ZodArray:a(()=>h9r,"$ZodArray"),$ZodAny:a(()=>Vto,"$ZodAny")});ieo=Object.freeze({status:"aborted"});a(ft,"F");oeo=Symbol("zod_brand"),pW=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Bxt={};a(eC,"c$");Ws={};WL(Ws,{unwrapMessage:a(()=>e8e,"unwrapMessage"),stringifyPrimitive:a(()=>us,"stringifyPrimitive"),required:a(()=>fVc,"required"),randomString:a(()=>nVc,"randomString"),propertyKeyTypes:a(()=>Fxt,"propertyKeyTypes"),promiseAllObject:a(()=>rVc,"promiseAllObject"),primitiveTypes:a(()=>leo,"primitiveTypes"),prefixIssues:a(()=>yk,"prefixIssues"),pick:a(()=>aVc,"pick"),partial:a(()=>dVc,"partial"),optionalKeys:a(()=>ueo,"optionalKeys"),omit:a(()=>cVc,"omit"),numKeys:a(()=>iVc,"numKeys"),nullish:a(()=>aoe,"nullish"),normalizeParams:a(()=>xr,"normalizeParams"),merge:a(()=>uVc,"merge"),jsonStringifyReplacer:a(()=>seo,"jsonStringifyReplacer"),joinValues:a(()=>Vr,"joinValues"),issue:a(()=>peo,"issue"),isPlainObject:a(()=>x8e,"isPlainObject"),isObject:a(()=>I8e,"isObject"),getSizableOrigin:a(()=>Pwt,"getSizableOrigin"),getParsedType:a(()=>oVc,"getParsedType"),getLengthableOrigin:a(()=>Dwt,"getLengthableOrigin"),getEnumValues:a(()=>K6r,"getEnumValues"),getElementAtPath:a(()=>tVc,"getElementAtPath"),floatSafeRemainder:a(()=>aeo,"floatSafeRemainder"),finalizeIssue:a(()=>jN,"finalizeIssue"),extend:a(()=>lVc,"extend"),escapeRegex:a(()=>coe,"escapeRegex"),esc:a(()=>nve,"esc"),defineLazy:a(()=>zc,"defineLazy"),createTransparentProxy:a(()=>sVc,"createTransparentProxy"),clone:a(()=>VN,"clone"),cleanRegex:a(()=>kwt,"cleanRegex"),cleanEnum:a(()=>pVc,"cleanEnum"),captureStackTrace:a(()=>Z6r,"captureStackTrace"),cached:a(()=>Rwt,"cached"),assignProp:a(()=>J6r,"assignProp"),assertNotEqual:a(()=>J$c,"assertNotEqual"),assertNever:a(()=>X$c,"assertNever"),assertIs:a(()=>Z$c,"assertIs"),assertEqual:a(()=>K$c,"assertEqual"),assert:a(()=>eVc,"assert"),allowsEval:a(()=>ceo,"allowsEval"),aborted:a(()=>cve,"aborted"),NUMBER_FORMAT_RANGES:a(()=>deo,"NUMBER_FORMAT_RANGES"),Class:a(()=>F8r,"Class"),BIGINT_FORMAT_RANGES:a(()=>feo,"BIGINT_FORMAT_RANGES")});a(K$c,"lh");a(J$c,"ch");a(Z$c,"ph");a(X$c,"dh");a(eVc,"ih");a(K6r,"B7");a(Vr,"P");a(seo,"mH");a(Rwt,"z7");a(aoe,"I1");a(kwt,"N7");a(aeo,"lH");a(zc,"N$");a(J6r,"cH");a(tVc,"nh");a(rVc,"rh");a(nVc,"oh");a(nve,"j0");Z6r=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(I8e,"g8");ceo=Rwt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(x8e,"h8");a(iVc,"th");oVc=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"),Fxt=new Set(["string","number","symbol"]),leo=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(coe,"r4");a(VN,"H6");a(xr,"k");a(sVc,"sh");a(us,"x");a(ueo,"iH");deo={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]},feo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(aVc,"eh");a(cVc,"$u");a(lVc,"Qu");a(uVc,"Ju");a(dVc,"Xu");a(fVc,"Yu");a(cve,"A0");a(yk,"I6");a(e8e,"V7");a(jN,"g6");a(Pwt,"O7");a(Dwt,"D7");a(peo,"oH");a(pVc,"Wu");F8r=class{static{a(this,"YM")}constructor(...e){}},heo=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,seo,2)},enumerable:!0})},"WM"),X6r=ft("$ZodError",heo),q8e=ft("$ZodError",heo,{Parent:Error});a(e9r,"m8");a(t9r,"l8");a(meo,"mX");a(geo,"GM");a(Aeo,"lX");r9r=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 pW;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>jN(u,s,eC())));throw Z6r(l,o?.callee),l}return c.value},"cX"),Uxt=r9r(q8e),n9r=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=>jN(u,s,eC())));throw Z6r(l,o?.callee),l}return c.value},"pX"),Qxt=n9r(q8e),i9r=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 pW;return s.issues.length?{success:!1,error:new(t??X6r)(s.issues.map(c=>jN(c,o,eC())))}:{success:!0,data:s.value}},"dX"),Nwt=i9r(q8e),o9r=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=>jN(c,o,eC())))}:{success:!0,data:s.value}},"iX"),Mwt=o9r(q8e),s9r={};WL(s9r,{xid:a(()=>veo,"xid"),uuid7:a(()=>AVc,"uuid7"),uuid6:a(()=>gVc,"uuid6"),uuid4:a(()=>mVc,"uuid4"),uuid:a(()=>kve,"uuid"),uppercase:a(()=>zeo,"uppercase"),unicodeEmail:a(()=>_Vc,"unicodeEmail"),undefined:a(()=>Veo,"undefined"),ulid:a(()=>_eo,"ulid"),time:a(()=>Feo,"time"),string:a(()=>Qeo,"string"),rfc5322Email:a(()=>EVc,"rfc5322Email"),number:a(()=>Heo,"number"),null:a(()=>$eo,"null"),nanoid:a(()=>beo,"nanoid"),lowercase:a(()=>Weo,"lowercase"),ksuid:a(()=>Ceo,"ksuid"),ipv6:a(()=>Reo,"ipv6"),ipv4:a(()=>weo,"ipv4"),integer:a(()=>jeo,"integer"),html5Email:a(()=>yVc,"html5Email"),hostname:a(()=>Neo,"hostname"),guid:a(()=>Teo,"guid"),extendedDuration:a(()=>hVc,"extendedDuration"),emoji:a(()=>xeo,"emoji"),email:a(()=>Ieo,"email"),e164:a(()=>Meo,"e164"),duration:a(()=>Seo,"duration"),domain:a(()=>bVc,"domain"),datetime:a(()=>Ueo,"datetime"),date:a(()=>Leo,"date"),cuid2:a(()=>Eeo,"cuid2"),cuid:a(()=>yeo,"cuid"),cidrv6:a(()=>Peo,"cidrv6"),cidrv4:a(()=>keo,"cidrv4"),browserEmail:a(()=>vVc,"browserEmail"),boolean:a(()=>Geo,"boolean"),bigint:a(()=>qeo,"bigint"),base64url:a(()=>a9r,"base64url"),base64:a(()=>Deo,"base64"),_emoji:a(()=>CVc,"_emoji")});yeo=/^[cC][^\s-]{8,}$/,Eeo=/^[0-9a-z]+$/,_eo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,veo=/^[0-9a-vA-V]{20}$/,Ceo=/^[A-Za-z0-9]{27}$/,beo=/^[a-zA-Z0-9_-]{21}$/,Seo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,hVc=/^[-+]?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)?)??$/,Teo=/^([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})$/,kve=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"),mVc=kve(4),gVc=kve(6),AVc=kve(7),Ieo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yVc=/^[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])?)*$/,EVc=/^(([^<>()\[\]\\.,;:\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,}))$/,_Vc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,vVc=/^[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])?)*$/,CVc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(xeo,"WK");weo=/^(?:(?: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])$/,Reo=/^(([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})$/,keo=/^((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])$/,Peo=/^(([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])$/,Deo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,a9r=/^[A-Za-z0-9_-]*$/,Neo=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,bVc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Meo=/^\+(?:[0-9]){6,14}[0-9]$/,Oeo="(?:(?:\\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])))",Leo=new RegExp(`^${Oeo}$`);a(Beo,"HM");a(Feo,"NK");a(Ueo,"wK");Qeo=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),qeo=/^\d+n?$/,jeo=/^\d+$/,Heo=/^-?\d+(?:\.\d+)?/i,Geo=/true|false/i,$eo=/null/i,Veo=/undefined/i,Weo=/^[^A-Z]*$/,zeo=/^[^a-z]*$/,Sh=ft("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Yeo={number:"number",bigint:"bigint",object:"date"},c9r=ft("$ZodCheckLessThan",(t,e)=>{Sh.init(t,e);let r=Yeo[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{Sh.init(t,e);let r=Yeo[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})}}),Keo=ft("$ZodCheckMultipleOf",(t,e)=>{Sh.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):aeo(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})}}),Jeo=ft("$ZodCheckNumberFormat",(t,e)=>{Sh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=deo[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=jeo)}),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})}}),Zeo=ft("$ZodCheckBigIntFormat",(t,e)=>{Sh.init(t,e);let[r,n]=feo[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})}}),Xeo=ft("$ZodCheckMaxSize",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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:Pwt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),eto=ft("$ZodCheckMinSize",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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:Pwt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),tto=ft("$ZodCheckSizeEquals",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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:Pwt(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})}}),rto=ft("$ZodCheckMaxLength",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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=Dwt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),nto=ft("$ZodCheckMinLength",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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=Dwt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),ito=ft("$ZodCheckLengthEquals",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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=Dwt(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})}}),j8e=ft("$ZodCheckStringFormat",(t,e)=>{var r,n;Sh.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=()=>{})}),oto=ft("$ZodCheckRegex",(t,e)=>{j8e.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})}}),sto=ft("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Weo),j8e.init(t,e)}),ato=ft("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=zeo),j8e.init(t,e)}),cto=ft("$ZodCheckIncludes",(t,e)=>{Sh.init(t,e);let r=coe(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})}}),lto=ft("$ZodCheckStartsWith",(t,e)=>{Sh.init(t,e);let r=new RegExp(`^${coe(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})}}),uto=ft("$ZodCheckEndsWith",(t,e)=>{Sh.init(t,e);let r=new RegExp(`.*${coe(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(FKi,"KM");dto=ft("$ZodCheckProperty",(t,e)=>{Sh.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=>FKi(o,r,e.property));FKi(n,r,e.property)}}),fto=ft("$ZodCheckMimeType",(t,e)=>{Sh.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})}}),pto=ft("$ZodCheckOverwrite",(t,e)=>{Sh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),qxt=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(` -`))}},uto={major:4,minor:0,patch:0},Co=ft("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=uto;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=ave(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 fW;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=ave(s,h)))});else{if(s.issues.length===h)continue;u||(u=ave(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 fW;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Dwt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Nwt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),q8e=ft("$ZodString",(t,e)=>{Co.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Leo(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}}),Lu=ft("$ZodStringFormat",(t,e)=>{Q8e.init(t,e),q8e.init(t,e)}),dto=ft("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=veo),Lu.init(t,e)}),fto=ft("$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=Rve(r))}else e.pattern??(e.pattern=Rve());Lu.init(t,e)}),pto=ft("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Ceo),Lu.init(t,e)}),hto=ft("$ZodURL",(t,e)=>{Lu.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:Reo.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})}}}),mto=ft("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=beo()),Lu.init(t,e)}),gto=ft("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Eeo),Lu.init(t,e)}),Ato=ft("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=heo),Lu.init(t,e)}),yto=ft("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=meo),Lu.init(t,e)}),Eto=ft("$ZodULID",(t,e)=>{e.pattern??(e.pattern=geo),Lu.init(t,e)}),_to=ft("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Aeo),Lu.init(t,e)}),vto=ft("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=yeo),Lu.init(t,e)}),Cto=ft("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Oeo(e)),Lu.init(t,e)}),bto=ft("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Deo),Lu.init(t,e)}),Sto=ft("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Meo(e)),Lu.init(t,e)}),Tto=ft("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=_eo),Lu.init(t,e)}),Ito=ft("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Seo),Lu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),xto=ft("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Teo),Lu.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})}}}),wto=ft("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Ieo),Lu.init(t,e)}),Rto=ft("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=xeo),Lu.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(l9r,"oK");kto=ft("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=weo),Lu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{l9r(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(Pto,"AM");Dto=ft("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=s9r),Lu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{Pto(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Nto=ft("$ZodE164",(t,e)=>{e.pattern??(e.pattern=keo),Lu.init(t,e)});a(Mto,"IM");Oto=ft("$ZodJWT",(t,e)=>{Lu.init(t,e),t._zod.check=r=>{Mto(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Lto=ft("$ZodCustomStringFormat",(t,e)=>{Lu.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})}}),u9r=ft("$ZodNumber",(t,e)=>{Co.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ueo,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}}),Bto=ft("$ZodNumber",(t,e)=>{Weo.init(t,e),u9r.init(t,e)}),d9r=ft("$ZodBoolean",(t,e)=>{Co.init(t,e),t._zod.pattern=Qeo,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}}),f9r=ft("$ZodBigInt",(t,e)=>{Co.init(t,e),t._zod.pattern=Beo,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}}),Fto=ft("$ZodBigInt",(t,e)=>{zeo.init(t,e),f9r.init(t,e)}),Uto=ft("$ZodSymbol",(t,e)=>{Co.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}}),Qto=ft("$ZodUndefined",(t,e)=>{Co.init(t,e),t._zod.pattern=jeo,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}}),qto=ft("$ZodNull",(t,e)=>{Co.init(t,e),t._zod.pattern=qeo,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}}),jto=ft("$ZodAny",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),qxt=ft("$ZodUnknown",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),Hto=ft("$ZodNever",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),Gto=ft("$ZodVoid",(t,e)=>{Co.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}}),$to=ft("$ZodDate",(t,e)=>{Co.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(OKi,"BM");p9r=ft("$ZodArray",(t,e)=>{Co.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;cOKi(d,r,c))):OKi(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(LIt,"aX");a(LKi,"zM");h9r=ft("$ZodObject",(t,e)=>{Co.init(t,e);let r=wwt(()=>{let f=Object.keys(e.shape);for(let m of f)if(!(e.shape[m]instanceof Co))throw Error(`Invalid element at key "${m}": expected a Zod schema`);let h=seo(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});zc(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 Qxt(["shape","payload","ctx"]),m=r.value,g=a(_=>{let v=rve(_);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 _ of m.keys)A[_]=`key_${y++}`;h.write("const newResult = {}");for(let _ of m.keys)if(m.optionalKeys.has(_)){let v=A[_];h.write(`const ${v} = ${g(_)};`);let b=rve(_);h.write(` +`))}},hto={major:4,minor:0,patch:0},bo=ft("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=hto;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=cve(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 pW;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=cve(s,h)))});else{if(s.issues.length===h)continue;u||(u=cve(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 pW;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Nwt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Mwt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),H8e=ft("$ZodString",(t,e)=>{bo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Qeo(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}}),Lu=ft("$ZodStringFormat",(t,e)=>{j8e.init(t,e),H8e.init(t,e)}),mto=ft("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Teo),Lu.init(t,e)}),gto=ft("$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=kve(r))}else e.pattern??(e.pattern=kve());Lu.init(t,e)}),Ato=ft("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Ieo),Lu.init(t,e)}),yto=ft("$ZodURL",(t,e)=>{Lu.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:Neo.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})}}}),Eto=ft("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=xeo()),Lu.init(t,e)}),_to=ft("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=beo),Lu.init(t,e)}),vto=ft("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=yeo),Lu.init(t,e)}),Cto=ft("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Eeo),Lu.init(t,e)}),bto=ft("$ZodULID",(t,e)=>{e.pattern??(e.pattern=_eo),Lu.init(t,e)}),Sto=ft("$ZodXID",(t,e)=>{e.pattern??(e.pattern=veo),Lu.init(t,e)}),Tto=ft("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Ceo),Lu.init(t,e)}),Ito=ft("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Ueo(e)),Lu.init(t,e)}),xto=ft("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Leo),Lu.init(t,e)}),wto=ft("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Feo(e)),Lu.init(t,e)}),Rto=ft("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Seo),Lu.init(t,e)}),kto=ft("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=weo),Lu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Pto=ft("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Reo),Lu.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})}}}),Dto=ft("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=keo),Lu.init(t,e)}),Nto=ft("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Peo),Lu.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(u9r,"oK");Mto=ft("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Deo),Lu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{u9r(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(Oto,"AM");Lto=ft("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=a9r),Lu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{Oto(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Bto=ft("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Meo),Lu.init(t,e)});a(Fto,"IM");Uto=ft("$ZodJWT",(t,e)=>{Lu.init(t,e),t._zod.check=r=>{Fto(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Qto=ft("$ZodCustomStringFormat",(t,e)=>{Lu.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})}}),d9r=ft("$ZodNumber",(t,e)=>{bo.init(t,e),t._zod.pattern=t._zod.bag.pattern??Heo,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}}),qto=ft("$ZodNumber",(t,e)=>{Jeo.init(t,e),d9r.init(t,e)}),f9r=ft("$ZodBoolean",(t,e)=>{bo.init(t,e),t._zod.pattern=Geo,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}}),p9r=ft("$ZodBigInt",(t,e)=>{bo.init(t,e),t._zod.pattern=qeo,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}}),jto=ft("$ZodBigInt",(t,e)=>{Zeo.init(t,e),p9r.init(t,e)}),Hto=ft("$ZodSymbol",(t,e)=>{bo.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}}),Gto=ft("$ZodUndefined",(t,e)=>{bo.init(t,e),t._zod.pattern=Veo,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}}),$to=ft("$ZodNull",(t,e)=>{bo.init(t,e),t._zod.pattern=$eo,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}}),Vto=ft("$ZodAny",(t,e)=>{bo.init(t,e),t._zod.parse=r=>r}),jxt=ft("$ZodUnknown",(t,e)=>{bo.init(t,e),t._zod.parse=r=>r}),Wto=ft("$ZodNever",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),zto=ft("$ZodVoid",(t,e)=>{bo.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}}),Yto=ft("$ZodDate",(t,e)=>{bo.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(UKi,"BM");h9r=ft("$ZodArray",(t,e)=>{bo.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;cUKi(d,r,c))):UKi(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(BIt,"aX");a(QKi,"zM");m9r=ft("$ZodObject",(t,e)=>{bo.init(t,e);let r=Rwt(()=>{let f=Object.keys(e.shape);for(let m of f)if(!(e.shape[m]instanceof bo))throw Error(`Invalid element at key "${m}": expected a Zod schema`);let h=ueo(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});zc(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 qxt(["shape","payload","ctx"]),m=r.value,g=a(_=>{let v=nve(_);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 _ of m.keys)A[_]=`key_${y++}`;h.write("const newResult = {}");for(let _ of m.keys)if(m.optionalKeys.has(_)){let v=A[_];h.write(`const ${v} = ${g(_)};`);let b=nve(_);h.write(` if (${v}.issues.length) { if (input[${b}] === undefined) { if (${b} in input) { @@ -1610,20 +1610,20 @@ new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); `)}else{let v=A[_];h.write(`const ${v} = ${g(_)};`),h.write(` if (${v}.issues.length) payload.issues = payload.issues.concat(${v}.issues.map(iss => ({ ...iss, - path: iss.path ? [${rve(_)}, ...iss.path] : [${rve(_)}] - })));`),h.write(`newResult[${rve(_)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(_,v)=>E(f,_,v)},"Y"),o,s=S8e,c=!Lxt.jitless,l=c&&ieo.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 b of d.keys){let T=v[b],w=T._zod.run({value:m[b],issues:[]},h),R=T._zod.optin==="optional"&&T._zod.optout==="optional";w instanceof Promise?g.push(w.then(x=>R?LKi(x,f,b,m):LIt(x,f,b))):R?LKi(w,f,b,m):LIt(w,f,b)}}if(!u)return g.length?Promise.all(g).then(()=>f):f;let A=[],y=d.keySet,E=u._zod,_=E.def.type;for(let v of Object.keys(m)){if(y.has(v))continue;if(_==="never"){A.push(v);continue}let b=E.run({value:m[v],issues:[]},h);b instanceof Promise?g.push(b.then(T=>LIt(T,f,v))):LIt(b,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(BKi,"NM");m9r=ft("$ZodUnion",(t,e)=>{Co.init(t,e),zc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),zc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),zc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),zc(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=>Rwt(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=>BKi(c,r,t,n)):BKi(s,r,t,n)}}),Vto=ft("$ZodDiscriminatedUnion",(t,e)=>{m9r.init(t,e);let r=t._zod.parse;zc(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=wwt(()=>{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(!S8e(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)}}),Wto=ft("$ZodIntersection",(t,e)=>{Co.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])=>FKi(r,l,u)):FKi(r,s,c)}});a(F8r,"pK");a(FKi,"wM");Mwt=ft("$ZodTuple",(t,e)=>{Co.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=>BIt(h,o,u))):BIt(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=>BIt(m,o,u))):BIt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(BIt,"sX");zto=ft("$ZodRecord",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!T8e(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(...Ak(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...Ak(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=>qN(d,n,Xv())),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(...Ak(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...Ak(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Yto=ft("$ZodMap",(t,e)=>{Co.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])=>{UKi(f,h,r,c,o,t,n)})):UKi(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(UKi,"OM");Kto=ft("$ZodSet",(t,e)=>{Co.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=>QKi(u,r))):QKi(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(QKi,"DM");Jto=ft("$ZodEnum",(t,e)=>{Co.init(t,e);let r=Y6r(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>Bxt.has(typeof n)).map(n=>typeof n=="string"?coe(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}}),Zto=ft("$ZodLiteral",(t,e)=>{Co.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?coe(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}}),Xto=ft("$ZodFile",(t,e)=>{Co.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}}),g9r=ft("$ZodTransform",(t,e)=>{Co.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 fW;return r.value=o,r}}),ero=ft("$ZodOptional",(t,e)=>{Co.init(t,e),t._zod.optin="optional",t._zod.optout="optional",zc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),zc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rwt(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)}),tro=ft("$ZodNullable",(t,e)=>{Co.init(t,e),zc(t._zod,"optin",()=>e.innerType._zod.optin),zc(t._zod,"optout",()=>e.innerType._zod.optout),zc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rwt(r.source)}|null)$`):void 0}),zc(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)}),rro=ft("$ZodDefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",zc(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=>qKi(s,e)):qKi(o,e)}});a(qKi,"FM");nro=ft("$ZodPrefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",zc(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))}),iro=ft("$ZodNonOptional",(t,e)=>{Co.init(t,e),zc(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=>jKi(s,t)):jKi(o,t)}});a(jKi,"ZM");oro=ft("$ZodSuccess",(t,e)=>{Co.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)}}),sro=ft("$ZodCatch",(t,e)=>{Co.init(t,e),t._zod.optin="optional",zc(t._zod,"optout",()=>e.innerType._zod.optout),zc(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=>qN(c,n,Xv()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>qN(s,n,Xv()))},input:r.value}),r.issues=[]),r)}}),aro=ft("$ZodNaN",(t,e)=>{Co.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)}),A9r=ft("$ZodPipe",(t,e)=>{Co.init(t,e),zc(t._zod,"values",()=>e.in._zod.values),zc(t._zod,"optin",()=>e.in._zod.optin),zc(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=>HKi(s,e,n)):HKi(o,e,n)}});a(HKi,"MM");cro=ft("$ZodReadonly",(t,e)=>{Co.init(t,e),zc(t._zod,"propValues",()=>e.innerType._zod.propValues),zc(t._zod,"values",()=>e.innerType._zod.values),zc(t._zod,"optin",()=>e.innerType._zod.optin),zc(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(GKi):GKi(o)}});a(GKi,"LM");lro=ft("$ZodTemplateLiteral",(t,e)=>{Co.init(t,e);let r=[];for(let n of e.parts)if(n instanceof Co){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||oeo.has(typeof n))r.push(coe(`${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)}),uro=ft("$ZodPromise",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),dro=ft("$ZodLazy",(t,e)=>{Co.init(t,e),zc(t._zod,"innerType",()=>e.getter()),zc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),zc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),zc(t._zod,"optin",()=>t._zod.innerType._zod.optin),zc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),fro=ft("$ZodCustom",(t,e)=>{Sh.init(t,e),Co.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=>$Ki(s,r,n,t));$Ki(o,r,n,t)}});a($Ki,"jM");y9r={};WL(y9r,{zhTW:a(()=>HWc,"zhTW"),zhCN:a(()=>qWc,"zhCN"),vi:a(()=>UWc,"vi"),ur:a(()=>BWc,"ur"),ua:a(()=>OWc,"ua"),tr:a(()=>NWc,"tr"),th:a(()=>kWc,"th"),ta:a(()=>wWc,"ta"),sv:a(()=>IWc,"sv"),sl:a(()=>SWc,"sl"),ru:a(()=>CWc,"ru"),pt:a(()=>_Wc,"pt"),ps:a(()=>gWc,"ps"),pl:a(()=>yWc,"pl"),ota:a(()=>hWc,"ota"),no:a(()=>fWc,"no"),nl:a(()=>uWc,"nl"),ms:a(()=>cWc,"ms"),mk:a(()=>sWc,"mk"),ko:a(()=>iWc,"ko"),kh:a(()=>rWc,"kh"),ja:a(()=>eWc,"ja"),it:a(()=>ZVc,"it"),id:a(()=>KVc,"id"),hu:a(()=>zVc,"hu"),he:a(()=>VVc,"he"),frCA:a(()=>GVc,"frCA"),fr:a(()=>jVc,"fr"),fi:a(()=>QVc,"fi"),fa:a(()=>FVc,"fa"),es:a(()=>LVc,"es"),eo:a(()=>MVc,"eo"),en:a(()=>pro,"en"),de:a(()=>RVc,"de"),cs:a(()=>xVc,"cs"),ca:a(()=>TVc,"ca"),be:a(()=>bVc,"be"),az:a(()=>vVc,"az"),ar:a(()=>EVc,"ar")});yVc=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 ${us(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: ${Vr(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":""}: ${Vr(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(EVc,"tK");_Vc=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 ${us(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Vr(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":""}: ${Vr(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(vVc,"aK");a(VKi,"PM");CVc=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 ${us(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 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=VKi(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=VKi(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"}: ${Vr(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(bVc,"sK");SVc=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 ${us(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Vr(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":""}: ${Vr(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(TVc,"eK");IVc=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 ${us(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Vr(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: ${Vr(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(xVc,"$q");wVc=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 ${us(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Vr(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"}: ${Vr(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(RVc,"Qq");kVc=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"),PVc=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 ${kVc(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${us(n.values[0])}`:`Invalid option: expected one of ${Vr(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":""}: ${Vr(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(pro,"A7");DVc=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"),NVc=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 ${DVc(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${us(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Vr(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":""}: ${Vr(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(MVc,"Jq");OVc=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 ${us(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Vr(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":""}: ${Vr(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(LVc,"Xq");BVc=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 ${us(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 ${Vr(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: ${Vr(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(FVc,"Yq");UVc=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 ${us(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Vr(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"}: ${Vr(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(QVc,"Wq");qVc=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 : ${us(o.values[0])} attendu`:`Option invalide : une valeur parmi ${Vr(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":""} : ${Vr(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(jVc,"Gq");HVc=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 ${us(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Vr(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":""} : ${Vr(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(GVc,"Uq");$Vc=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 ${us(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 ${Vr(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"}: ${Vr(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(VVc,"Hq");WVc=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 ${us(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Vr(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":""}: ${Vr(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(zVc,"Kq");YVc=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 ${us(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Vr(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":""}: ${Vr(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(KVc,"qq");JVc=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 ${us(o.values[0])}`:`Opzione non valida: atteso uno tra ${Vr(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"}: ${Vr(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(ZVc,"Vq");XVc=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: ${us(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Vr(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":""}: ${Vr(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(eWc,"Bq");tWc=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 ${us(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 ${Vr(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 ${Vr(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(rWc,"zq");nWc=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 ${us(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Vr(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: ${Vr(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(iWc,"Nq");oWc=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 ${us(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 ${Vr(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"}: ${Vr(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(sWc,"wq");aWc=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 ${us(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Vr(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: ${Vr(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(cWc,"Oq");lWc=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 ${us(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Vr(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":""}: ${Vr(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(uWc,"Dq");dWc=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 ${us(o.values[0])}`:`Ugyldig valg: forventet en av ${Vr(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"}: ${Vr(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(fWc,"Fq");pWc=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 ${us(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Vr(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":""}: ${Vr(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(hWc,"Zq");mWc=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 ${us(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Vr(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"}: ${Vr(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(gWc,"Mq");AWc=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 ${us(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Vr(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":""}: ${Vr(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(yWc,"Lq");EWc=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 ${us(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Vr(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":""}: ${Vr(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(_Wc,"jq");a(WKi,"EM");vWc=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 ${us(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 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=WKi(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=WKi(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":""}: ${Vr(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(CWc,"Aq");bWc=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 ${us(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Vr(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"}: ${Vr(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(SWc,"Iq");TWc=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 ${us(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Vr(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"}: ${Vr(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(IWc,"Rq");xWc=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 ${us(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 ${Vr(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":""}: ${Vr(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(wWc,"Pq");RWc=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 ${us(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 ${Vr(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: ${Vr(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(kWc,"Eq");PWc=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"),DWc=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 ${PWc(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${us(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Vr(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":""}: ${Vr(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(NWc,"bq");MWc=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 ${us(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 ${Vr(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":""}: ${Vr(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(OWc,"_q");LWc=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: ${us(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Vr(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":""}: ${Vr(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(BWc,"kq");FWc=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 ${us(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 ${Vr(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: ${Vr(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(UWc,"Sq");QWc=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 ${us(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Vr(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): ${Vr(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(qWc,"vq");jWc=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 ${us(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Vr(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${Vr(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(HWc,"Cq");hro=Symbol("ZodOutput"),mro=Symbol("ZodInput"),I8e=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(E9r,"R7");V9=E9r();a(gro,"aY");a(Aro,"Tq");a(_9r,"P7");a(jxt,"o8");a(v9r,"E7");a(C9r,"b7");a(b9r,"_7");a(S9r,"k7");a(T9r,"S7");a(I9r,"v7");a(x9r,"C7");a(w9r,"T7");a(R9r,"x7");a(k9r,"y7");a(P9r,"f7");a(D9r,"g7");a(N9r,"h7");a(M9r,"u7");a(O9r,"m7");a(L9r,"l7");a(B9r,"c7");a(F9r,"p7");a(U9r,"d7");a(Q9r,"i7");yro={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(Ero,"xq");a(_ro,"yq");a(vro,"fq");a(Cro,"gq");a(bro,"eY");a(Sro,"hq");a(Tro,"$3");a(Iro,"Q3");a(xro,"J3");a(wro,"X3");a(Rro,"Y3");a(kro,"W3");a(Pro,"uq");a(Dro,"G3");a(Nro,"mq");a(Mro,"U3");a(Oro,"H3");a(Lro,"K3");a(Bro,"q3");a(Fro,"V3");a(Uro,"B3");a(Hxt,"b0");a(Qro,"z3");a(qro,"N3");a(jro,"w3");a(Hro,"lq");a(Gro,"O3");a(noe,"o4");a(FN,"t6");a(ioe,"t4");a(RI,"P6");a($ro,"cq");a(Vro,"pq");a(Wro,"dq");a(zro,"iq");a(x8e,"_0");a(Owt,"t8");a(w8e,"k0");a(q9r,"n7");a(Lwt,"a8");a(kve,"k1");a(Bwt,"s8");a(j9r,"r7");a(H9r,"o7");a(G9r,"t7");a($9r,"a7");a(V9r,"s7");a(W9r,"e7");a(Yro,"nq");a(z9r,"$J");a(loe,"a4");a(Y9r,"QJ");a(K9r,"JJ");a(J9r,"XJ");a(Z9r,"YJ");a(X9r,"WJ");a(GWc,"Wm");a($Wc,"Gm");a(VWc,"Um");a(Kro,"rq");a(WWc,"Hm");a(zWc,"Km");a(YWc,"qm");a(KWc,"Vm");a(JWc,"Bm");a(ZWc,"zm");a(Jro,"D3");a(XWc,"Nm");a(ezc,"wm");a(tzc,"Om");a(rzc,"Dm");a(nzc,"Fm");a(izc,"Zm");a(ozc,"Mm");a(szc,"Lm");a(azc,"jm");a(czc,"Am");a(lzc,"Im");a(uzc,"Rm");a(Zro,"F3");a(Xro,"Z3");a(eno,"M3");a(tno,"L3");Gxt=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?Fxt(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?Fxt(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 Uxt(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?Uxt(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 Mwt({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(rno,"j3");R8e=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??V9,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:E,patterns:_,contentEncoding:v}=e._zod.bag;if(typeof A=="number"&&(g.minLength=A),typeof y=="number"&&(g.maxLength=y),E&&(g.format=s[E]??E,g.format===""&&delete g.format),v&&(g.contentEncoding=v),_&&_.size>0){let b=[..._];b.length===1?g.pattern=b[0].source:b.length>1&&(l.schema.allOf=[...b.map(T=>({...this.target==="draft-7"?{type:"string"}:{},pattern:T.source}))])}break}case"number":{let g=m,{minimum:A,maximum:y,format:E,multipleOf:_,exclusiveMaximum:v,exclusiveMinimum:b}=e._zod.bag;typeof E=="string"&&E.includes("int")?g.type="integer":g.type="number",typeof b=="number"&&(g.exclusiveMinimum=b),typeof A=="number"&&(g.minimum=A,typeof b=="number"&&(b>=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 _=="number"&&(g.multipleOf=_);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 _ in A)g.properties[_]=this.process(A[_],{...f,path:[...f.path,"properties",_]});let y=new Set(Object.keys(A)),E=new Set([...y].filter(_=>{let v=o.shape[_]._zod;return this.io==="input"?v.optin===void 0:v.optout===void 0}));E.size>0&&(g.required=Array.from(E)),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]}),E=a(v=>"allOf"in v&&Object.keys(v).length===1,"D"),_=[...E(A)?A.allOf:[A],...E(y)?y.allOf:[y]];g.allOf=_;break}case"tuple":{let g=m;g.type="array";let A=o.items.map((_,v)=>this.process(_,{...f,path:[...f.path,"prefixItems",v]}));if(this.target==="draft-2020-12"?g.prefixItems=A:g.items=A,o.rest){let _=this.process(o.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?g.items=_:g.additionalItems=_}o.rest&&(g.items=this.process(o.rest,{...f,path:[...f.path,"items"]}));let{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof E=="number"&&(g.maxItems=E);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=Y6r(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:E,mime:_}=e._zod.bag;y!==void 0&&(A.minLength=y),E!==void 0&&(A.maxLength=E),_?_.length===1?(A.contentMediaType=_[0],Object.assign(g,A)):g.anyOf=_.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"&&q0(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("/")}/ + path: iss.path ? [${nve(_)}, ...iss.path] : [${nve(_)}] + })));`),h.write(`newResult[${nve(_)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(_,v)=>E(f,_,v)},"Y"),o,s=I8e,c=!Bxt.jitless,l=c&&ceo.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 b of d.keys){let T=v[b],w=T._zod.run({value:m[b],issues:[]},h),R=T._zod.optin==="optional"&&T._zod.optout==="optional";w instanceof Promise?g.push(w.then(x=>R?QKi(x,f,b,m):BIt(x,f,b))):R?QKi(w,f,b,m):BIt(w,f,b)}}if(!u)return g.length?Promise.all(g).then(()=>f):f;let A=[],y=d.keySet,E=u._zod,_=E.def.type;for(let v of Object.keys(m)){if(y.has(v))continue;if(_==="never"){A.push(v);continue}let b=E.run({value:m[v],issues:[]},h);b instanceof Promise?g.push(b.then(T=>BIt(T,f,v))):BIt(b,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(qKi,"NM");g9r=ft("$ZodUnion",(t,e)=>{bo.init(t,e),zc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),zc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),zc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),zc(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=>kwt(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=>qKi(c,r,t,n)):qKi(s,r,t,n)}}),Kto=ft("$ZodDiscriminatedUnion",(t,e)=>{g9r.init(t,e);let r=t._zod.parse;zc(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=Rwt(()=>{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(!I8e(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)}}),Jto=ft("$ZodIntersection",(t,e)=>{bo.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])=>jKi(r,l,u)):jKi(r,s,c)}});a(U8r,"pK");a(jKi,"wM");Owt=ft("$ZodTuple",(t,e)=>{bo.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=>FIt(h,o,u))):FIt(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=>FIt(m,o,u))):FIt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(FIt,"sX");Zto=ft("$ZodRecord",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!x8e(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(...yk(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...yk(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=>jN(d,n,eC())),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(...yk(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...yk(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Xto=ft("$ZodMap",(t,e)=>{bo.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])=>{HKi(f,h,r,c,o,t,n)})):HKi(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(HKi,"OM");ero=ft("$ZodSet",(t,e)=>{bo.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=>GKi(u,r))):GKi(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(GKi,"DM");tro=ft("$ZodEnum",(t,e)=>{bo.init(t,e);let r=K6r(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>Fxt.has(typeof n)).map(n=>typeof n=="string"?coe(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}}),rro=ft("$ZodLiteral",(t,e)=>{bo.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?coe(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}}),nro=ft("$ZodFile",(t,e)=>{bo.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}}),A9r=ft("$ZodTransform",(t,e)=>{bo.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 pW;return r.value=o,r}}),iro=ft("$ZodOptional",(t,e)=>{bo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",zc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),zc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${kwt(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)}),oro=ft("$ZodNullable",(t,e)=>{bo.init(t,e),zc(t._zod,"optin",()=>e.innerType._zod.optin),zc(t._zod,"optout",()=>e.innerType._zod.optout),zc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${kwt(r.source)}|null)$`):void 0}),zc(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)}),sro=ft("$ZodDefault",(t,e)=>{bo.init(t,e),t._zod.optin="optional",zc(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=>$Ki(s,e)):$Ki(o,e)}});a($Ki,"FM");aro=ft("$ZodPrefault",(t,e)=>{bo.init(t,e),t._zod.optin="optional",zc(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))}),cro=ft("$ZodNonOptional",(t,e)=>{bo.init(t,e),zc(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=>VKi(s,t)):VKi(o,t)}});a(VKi,"ZM");lro=ft("$ZodSuccess",(t,e)=>{bo.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)}}),uro=ft("$ZodCatch",(t,e)=>{bo.init(t,e),t._zod.optin="optional",zc(t._zod,"optout",()=>e.innerType._zod.optout),zc(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=>jN(c,n,eC()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>jN(s,n,eC()))},input:r.value}),r.issues=[]),r)}}),dro=ft("$ZodNaN",(t,e)=>{bo.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)}),y9r=ft("$ZodPipe",(t,e)=>{bo.init(t,e),zc(t._zod,"values",()=>e.in._zod.values),zc(t._zod,"optin",()=>e.in._zod.optin),zc(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=>WKi(s,e,n)):WKi(o,e,n)}});a(WKi,"MM");fro=ft("$ZodReadonly",(t,e)=>{bo.init(t,e),zc(t._zod,"propValues",()=>e.innerType._zod.propValues),zc(t._zod,"values",()=>e.innerType._zod.values),zc(t._zod,"optin",()=>e.innerType._zod.optin),zc(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(zKi):zKi(o)}});a(zKi,"LM");pro=ft("$ZodTemplateLiteral",(t,e)=>{bo.init(t,e);let r=[];for(let n of e.parts)if(n instanceof bo){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||leo.has(typeof n))r.push(coe(`${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)}),hro=ft("$ZodPromise",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),mro=ft("$ZodLazy",(t,e)=>{bo.init(t,e),zc(t._zod,"innerType",()=>e.getter()),zc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),zc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),zc(t._zod,"optin",()=>t._zod.innerType._zod.optin),zc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),gro=ft("$ZodCustom",(t,e)=>{Sh.init(t,e),bo.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=>YKi(s,r,n,t));YKi(o,r,n,t)}});a(YKi,"jM");E9r={};WL(E9r,{zhTW:a(()=>YWc,"zhTW"),zhCN:a(()=>WWc,"zhCN"),vi:a(()=>$Wc,"vi"),ur:a(()=>HWc,"ur"),ua:a(()=>qWc,"ua"),tr:a(()=>UWc,"tr"),th:a(()=>LWc,"th"),ta:a(()=>MWc,"ta"),sv:a(()=>DWc,"sv"),sl:a(()=>kWc,"sl"),ru:a(()=>wWc,"ru"),pt:a(()=>IWc,"pt"),ps:a(()=>CWc,"ps"),pl:a(()=>SWc,"pl"),ota:a(()=>_Wc,"ota"),no:a(()=>yWc,"no"),nl:a(()=>gWc,"nl"),ms:a(()=>hWc,"ms"),mk:a(()=>fWc,"mk"),ko:a(()=>uWc,"ko"),kh:a(()=>cWc,"kh"),ja:a(()=>sWc,"ja"),it:a(()=>iWc,"it"),id:a(()=>rWc,"id"),hu:a(()=>eWc,"hu"),he:a(()=>ZVc,"he"),frCA:a(()=>KVc,"frCA"),fr:a(()=>zVc,"fr"),fi:a(()=>VVc,"fi"),fa:a(()=>GVc,"fa"),es:a(()=>jVc,"es"),eo:a(()=>QVc,"eo"),en:a(()=>Aro,"en"),de:a(()=>OVc,"de"),cs:a(()=>NVc,"cs"),ca:a(()=>PVc,"ca"),be:a(()=>RVc,"be"),az:a(()=>xVc,"az"),ar:a(()=>TVc,"ar")});SVc=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 ${us(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: ${Vr(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":""}: ${Vr(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(TVc,"tK");IVc=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 ${us(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Vr(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":""}: ${Vr(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(xVc,"aK");a(KKi,"PM");wVc=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 ${us(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 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=KKi(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=KKi(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"}: ${Vr(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(RVc,"sK");kVc=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 ${us(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Vr(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":""}: ${Vr(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(PVc,"eK");DVc=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 ${us(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Vr(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: ${Vr(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(NVc,"$q");MVc=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 ${us(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Vr(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"}: ${Vr(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(OVc,"Qq");LVc=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"),BVc=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 ${LVc(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${us(n.values[0])}`:`Invalid option: expected one of ${Vr(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":""}: ${Vr(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(Aro,"A7");FVc=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"),UVc=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 ${FVc(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${us(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Vr(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":""}: ${Vr(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(QVc,"Jq");qVc=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 ${us(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Vr(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":""}: ${Vr(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(jVc,"Xq");HVc=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 ${us(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 ${Vr(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: ${Vr(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(GVc,"Yq");$Vc=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 ${us(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Vr(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"}: ${Vr(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(VVc,"Wq");WVc=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 : ${us(o.values[0])} attendu`:`Option invalide : une valeur parmi ${Vr(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":""} : ${Vr(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(zVc,"Gq");YVc=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 ${us(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Vr(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":""} : ${Vr(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(KVc,"Uq");JVc=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 ${us(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 ${Vr(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"}: ${Vr(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(ZVc,"Hq");XVc=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 ${us(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Vr(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":""}: ${Vr(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(eWc,"Kq");tWc=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 ${us(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Vr(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":""}: ${Vr(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(rWc,"qq");nWc=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 ${us(o.values[0])}`:`Opzione non valida: atteso uno tra ${Vr(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"}: ${Vr(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(iWc,"Vq");oWc=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: ${us(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Vr(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":""}: ${Vr(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(sWc,"Bq");aWc=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 ${us(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 ${Vr(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 ${Vr(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(cWc,"zq");lWc=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 ${us(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Vr(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: ${Vr(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(uWc,"Nq");dWc=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 ${us(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 ${Vr(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"}: ${Vr(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(fWc,"wq");pWc=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 ${us(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Vr(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: ${Vr(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(hWc,"Oq");mWc=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 ${us(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Vr(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":""}: ${Vr(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(gWc,"Dq");AWc=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 ${us(o.values[0])}`:`Ugyldig valg: forventet en av ${Vr(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"}: ${Vr(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(yWc,"Fq");EWc=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 ${us(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Vr(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":""}: ${Vr(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(_Wc,"Zq");vWc=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 ${us(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Vr(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"}: ${Vr(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(CWc,"Mq");bWc=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 ${us(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Vr(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":""}: ${Vr(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(SWc,"Lq");TWc=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 ${us(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Vr(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":""}: ${Vr(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(IWc,"jq");a(JKi,"EM");xWc=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 ${us(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 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=JKi(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=JKi(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":""}: ${Vr(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(wWc,"Aq");RWc=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 ${us(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Vr(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"}: ${Vr(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(kWc,"Iq");PWc=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 ${us(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Vr(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"}: ${Vr(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(DWc,"Rq");NWc=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 ${us(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 ${Vr(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":""}: ${Vr(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(MWc,"Pq");OWc=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 ${us(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 ${Vr(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: ${Vr(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(LWc,"Eq");BWc=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"),FWc=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 ${BWc(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${us(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Vr(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":""}: ${Vr(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(UWc,"bq");QWc=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 ${us(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 ${Vr(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":""}: ${Vr(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(qWc,"_q");jWc=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: ${us(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Vr(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":""}: ${Vr(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(HWc,"kq");GWc=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 ${us(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 ${Vr(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: ${Vr(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($Wc,"Sq");VWc=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 ${us(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Vr(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): ${Vr(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(WWc,"vq");zWc=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 ${us(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Vr(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${Vr(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(YWc,"Cq");yro=Symbol("ZodOutput"),Ero=Symbol("ZodInput"),w8e=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(_9r,"R7");W9=_9r();a(_ro,"aY");a(vro,"Tq");a(v9r,"P7");a(Hxt,"o8");a(C9r,"E7");a(b9r,"b7");a(S9r,"_7");a(T9r,"k7");a(I9r,"S7");a(x9r,"v7");a(w9r,"C7");a(R9r,"T7");a(k9r,"x7");a(P9r,"y7");a(D9r,"f7");a(N9r,"g7");a(M9r,"h7");a(O9r,"u7");a(L9r,"m7");a(B9r,"l7");a(F9r,"c7");a(U9r,"p7");a(Q9r,"d7");a(q9r,"i7");Cro={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(bro,"xq");a(Sro,"yq");a(Tro,"fq");a(Iro,"gq");a(xro,"eY");a(wro,"hq");a(Rro,"$3");a(kro,"Q3");a(Pro,"J3");a(Dro,"X3");a(Nro,"Y3");a(Mro,"W3");a(Oro,"uq");a(Lro,"G3");a(Bro,"mq");a(Fro,"U3");a(Uro,"H3");a(Qro,"K3");a(qro,"q3");a(jro,"V3");a(Hro,"B3");a(Gxt,"b0");a(Gro,"z3");a($ro,"N3");a(Vro,"w3");a(Wro,"lq");a(zro,"O3");a(noe,"o4");a(UN,"t6");a(ioe,"t4");a(PI,"P6");a(Yro,"cq");a(Kro,"pq");a(Jro,"dq");a(Zro,"iq");a(R8e,"_0");a(Lwt,"t8");a(k8e,"k0");a(j9r,"n7");a(Bwt,"a8");a(Pve,"k1");a(Fwt,"s8");a(H9r,"r7");a(G9r,"o7");a($9r,"t7");a(V9r,"a7");a(W9r,"s7");a(z9r,"e7");a(Xro,"nq");a(Y9r,"$J");a(loe,"a4");a(K9r,"QJ");a(J9r,"JJ");a(Z9r,"XJ");a(X9r,"YJ");a(eUr,"WJ");a(KWc,"Wm");a(JWc,"Gm");a(ZWc,"Um");a(eno,"rq");a(XWc,"Hm");a(ezc,"Km");a(tzc,"qm");a(rzc,"Vm");a(nzc,"Bm");a(izc,"zm");a(tno,"D3");a(ozc,"Nm");a(szc,"wm");a(azc,"Om");a(czc,"Dm");a(lzc,"Fm");a(uzc,"Zm");a(dzc,"Mm");a(fzc,"Lm");a(pzc,"jm");a(hzc,"Am");a(mzc,"Im");a(gzc,"Rm");a(rno,"F3");a(nno,"Z3");a(ino,"M3");a(ono,"L3");$xt=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?Uxt(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?Uxt(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 Qxt(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?Qxt(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 Owt({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(sno,"j3");P8e=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??W9,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:E,patterns:_,contentEncoding:v}=e._zod.bag;if(typeof A=="number"&&(g.minLength=A),typeof y=="number"&&(g.maxLength=y),E&&(g.format=s[E]??E,g.format===""&&delete g.format),v&&(g.contentEncoding=v),_&&_.size>0){let b=[..._];b.length===1?g.pattern=b[0].source:b.length>1&&(l.schema.allOf=[...b.map(T=>({...this.target==="draft-7"?{type:"string"}:{},pattern:T.source}))])}break}case"number":{let g=m,{minimum:A,maximum:y,format:E,multipleOf:_,exclusiveMaximum:v,exclusiveMinimum:b}=e._zod.bag;typeof E=="string"&&E.includes("int")?g.type="integer":g.type="number",typeof b=="number"&&(g.exclusiveMinimum=b),typeof A=="number"&&(g.minimum=A,typeof b=="number"&&(b>=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 _=="number"&&(g.multipleOf=_);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 _ in A)g.properties[_]=this.process(A[_],{...f,path:[...f.path,"properties",_]});let y=new Set(Object.keys(A)),E=new Set([...y].filter(_=>{let v=o.shape[_]._zod;return this.io==="input"?v.optin===void 0:v.optout===void 0}));E.size>0&&(g.required=Array.from(E)),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]}),E=a(v=>"allOf"in v&&Object.keys(v).length===1,"D"),_=[...E(A)?A.allOf:[A],...E(y)?y.allOf:[y]];g.allOf=_;break}case"tuple":{let g=m;g.type="array";let A=o.items.map((_,v)=>this.process(_,{...f,path:[...f.path,"prefixItems",v]}));if(this.target==="draft-2020-12"?g.prefixItems=A:g.items=A,o.rest){let _=this.process(o.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?g.items=_:g.additionalItems=_}o.rest&&(g.items=this.process(o.rest,{...f,path:[...f.path,"items"]}));let{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof E=="number"&&(g.maxItems=E);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=K6r(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:E,mime:_}=e._zod.bag;y!==void 0&&(A.minLength=y),E!==void 0&&(A.maxLength=E),_?_.length===1?(A.contentMediaType=_[0],Object.assign(g,A)):g.anyOf=_.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"&&q0(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 E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),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(eUr,"e8");a(q0,"t$");dzc={},fzc=ft("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");Co.init(t,e),t.def=e,t.parse=(r,n)=>Fxt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Dwt(t,r,n),t.parseAsync=async(r,n)=>Uxt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Nwt(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)=>$N(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),pzc=ft("ZodMiniObject",(t,e)=>{h9r.init(t,e),fzc.init(t,e),Ws.defineLazy(t,"shape",()=>e.shape)});a(zKi,"tq");a(VL,"a6");a(nve,"S0");a(r8e,"S1");a(qFr,"I3");a(j8e,"v1");a(QFe,"$9");a(jFr,"R3");a(hzc,"_M");a(mzc,"kM");a(nno,"P3");G={};WL(G,{xid:a(()=>Rzc,"xid"),void:a(()=>Kzc,"void"),uuidv7:a(()=>Czc,"uuidv7"),uuidv6:a(()=>vzc,"uuidv6"),uuidv4:a(()=>_zc,"uuidv4"),uuid:a(()=>Ezc,"uuid"),url:a(()=>bzc,"url"),uppercase:a(()=>G9r,"uppercase"),unknown:a(()=>of,"unknown"),union:a(()=>ou,"union"),undefined:a(()=>zzc,"undefined"),ulid:a(()=>wzc,"ulid"),uint64:a(()=>Vzc,"uint64"),uint32:a(()=>Hzc,"uint32"),tuple:a(()=>eYc,"tuple"),trim:a(()=>K9r,"trim"),treeifyError:a(()=>deo,"treeifyError"),transform:a(()=>PUr,"transform"),toUpperCase:a(()=>Z9r,"toUpperCase"),toLowerCase:a(()=>J9r,"toLowerCase"),toJSONSchema:a(()=>eUr,"toJSONSchema"),templateLiteral:a(()=>lYc,"templateLiteral"),symbol:a(()=>Wzc,"symbol"),superRefine:a(()=>zno,"superRefine"),success:a(()=>aYc,"success"),stringbool:a(()=>fYc,"stringbool"),stringFormat:a(()=>Uzc,"stringFormat"),string:a(()=>It,"string"),strictObject:a(()=>Xzc,"strictObject"),startsWith:a(()=>V9r,"startsWith"),size:a(()=>q9r,"size"),setErrorMap:a(()=>mYc,"setErrorMap"),set:a(()=>nYc,"set"),safeParseAsync:a(()=>fno,"safeParseAsync"),safeParse:a(()=>dno,"safeParse"),registry:a(()=>E9r,"registry"),regexes:a(()=>o9r,"regexes"),regex:a(()=>j9r,"regex"),refine:a(()=>Wno,"refine"),record:a(()=>iu,"record"),readonly:a(()=>Qno,"readonly"),property:a(()=>Yro,"property"),promise:a(()=>uYc,"promise"),prettifyError:a(()=>peo,"prettifyError"),preprocess:a(()=>OUr,"preprocess"),prefault:a(()=>Nno,"prefault"),positive:a(()=>$ro,"positive"),pipe:a(()=>Wxt,"pipe"),partialRecord:a(()=>tYc,"partialRecord"),parseAsync:a(()=>uno,"parseAsync"),parse:a(()=>lno,"parse"),overwrite:a(()=>loe,"overwrite"),optional:a(()=>bd,"optional"),object:a(()=>Tn,"object"),number:a(()=>Nc,"number"),nullish:a(()=>sYc,"nullish"),nullable:a(()=>Vxt,"nullable"),null:a(()=>TUr,"null"),normalize:a(()=>Y9r,"normalize"),nonpositive:a(()=>Wro,"nonpositive"),nonoptional:a(()=>Mno,"nonoptional"),nonnegative:a(()=>zro,"nonnegative"),never:a(()=>jwt,"never"),negative:a(()=>Vro,"negative"),nativeEnum:a(()=>iYc,"nativeEnum"),nanoid:a(()=>Tzc,"nanoid"),nan:a(()=>cYc,"nan"),multipleOf:a(()=>x8e,"multipleOf"),minSize:a(()=>w8e,"minSize"),minLength:a(()=>kve,"minLength"),mime:a(()=>z9r,"mime"),maxSize:a(()=>Owt,"maxSize"),maxLength:a(()=>Lwt,"maxLength"),map:a(()=>rYc,"map"),lte:a(()=>FN,"lte"),lt:a(()=>noe,"lt"),lowercase:a(()=>H9r,"lowercase"),looseObject:a(()=>Kv,"looseObject"),locales:a(()=>y9r,"locales"),literal:a(()=>ti,"literal"),length:a(()=>Bwt,"length"),lazy:a(()=>Hno,"lazy"),ksuid:a(()=>kzc,"ksuid"),keyof:a(()=>Zzc,"keyof"),jwt:a(()=>Fzc,"jwt"),json:a(()=>pYc,"json"),iso:a(()=>tUr,"iso"),ipv6:a(()=>Dzc,"ipv6"),ipv4:a(()=>Pzc,"ipv4"),intersection:a(()=>Gwt,"intersection"),int64:a(()=>$zc,"int64"),int32:a(()=>jzc,"int32"),int:a(()=>U8r,"int"),instanceof:a(()=>dYc,"instanceof"),includes:a(()=>$9r,"includes"),guid:a(()=>yzc,"guid"),gte:a(()=>RI,"gte"),gt:a(()=>ioe,"gt"),globalRegistry:a(()=>V9,"globalRegistry"),getErrorMap:a(()=>gYc,"getErrorMap"),function:a(()=>rno,"function"),formatError:a(()=>e9r,"formatError"),float64:a(()=>qzc,"float64"),float32:a(()=>Qzc,"float32"),flattenError:a(()=>X6r,"flattenError"),file:a(()=>oYc,"file"),enum:a(()=>N1,"enum"),endsWith:a(()=>W9r,"endsWith"),emoji:a(()=>Szc,"emoji"),email:a(()=>Azc,"email"),e164:a(()=>Bzc,"e164"),discriminatedUnion:a(()=>wUr,"discriminatedUnion"),date:a(()=>Jzc,"date"),custom:a(()=>Vno,"custom"),cuid2:a(()=>xzc,"cuid2"),cuid:a(()=>Izc,"cuid"),core:a(()=>XXi,"core"),config:a(()=>Xv,"config"),coerce:a(()=>Yno,"coerce"),clone:a(()=>$N,"clone"),cidrv6:a(()=>Mzc,"cidrv6"),cidrv4:a(()=>Nzc,"cidrv4"),check:a(()=>$no,"check"),catch:a(()=>Bno,"catch"),boolean:a(()=>j0,"boolean"),bigint:a(()=>Gzc,"bigint"),base64url:a(()=>Lzc,"base64url"),base64:a(()=>Ozc,"base64"),array:a(()=>Ca,"array"),any:a(()=>Yzc,"any"),_default:a(()=>Pno,"_default"),_ZodString:a(()=>sUr,"_ZodString"),ZodXID:a(()=>hUr,"ZodXID"),ZodVoid:a(()=>_no,"ZodVoid"),ZodUnknown:a(()=>yno,"ZodUnknown"),ZodUnion:a(()=>xUr,"ZodUnion"),ZodUndefined:a(()=>mno,"ZodUndefined"),ZodUUID:a(()=>W9,"ZodUUID"),ZodURL:a(()=>cUr,"ZodURL"),ZodULID:a(()=>pUr,"ZodULID"),ZodType:a(()=>Os,"ZodType"),ZodTuple:a(()=>Sno,"ZodTuple"),ZodTransform:a(()=>kUr,"ZodTransform"),ZodTemplateLiteral:a(()=>qno,"ZodTemplateLiteral"),ZodSymbol:a(()=>hno,"ZodSymbol"),ZodSuccess:a(()=>Ono,"ZodSuccess"),ZodStringFormat:a(()=>Td,"ZodStringFormat"),ZodString:a(()=>Fwt,"ZodString"),ZodSet:a(()=>Ino,"ZodSet"),ZodRecord:a(()=>RUr,"ZodRecord"),ZodRealError:a(()=>H8e,"ZodRealError"),ZodReadonly:a(()=>Uno,"ZodReadonly"),ZodPromise:a(()=>Gno,"ZodPromise"),ZodPrefault:a(()=>Dno,"ZodPrefault"),ZodPipe:a(()=>MUr,"ZodPipe"),ZodOptional:a(()=>DUr,"ZodOptional"),ZodObject:a(()=>Hwt,"ZodObject"),ZodNumberFormat:a(()=>Hve,"ZodNumberFormat"),ZodNumber:a(()=>Uwt,"ZodNumber"),ZodNullable:a(()=>Rno,"ZodNullable"),ZodNull:a(()=>gno,"ZodNull"),ZodNonOptional:a(()=>NUr,"ZodNonOptional"),ZodNever:a(()=>Eno,"ZodNever"),ZodNanoID:a(()=>uUr,"ZodNanoID"),ZodNaN:a(()=>Fno,"ZodNaN"),ZodMap:a(()=>Tno,"ZodMap"),ZodLiteral:a(()=>xno,"ZodLiteral"),ZodLazy:a(()=>jno,"ZodLazy"),ZodKSUID:a(()=>mUr,"ZodKSUID"),ZodJWT:a(()=>bUr,"ZodJWT"),ZodIssueCode:a(()=>hYc,"ZodIssueCode"),ZodIntersection:a(()=>bno,"ZodIntersection"),ZodISOTime:a(()=>iUr,"ZodISOTime"),ZodISODuration:a(()=>oUr,"ZodISODuration"),ZodISODateTime:a(()=>rUr,"ZodISODateTime"),ZodISODate:a(()=>nUr,"ZodISODate"),ZodIPv6:a(()=>AUr,"ZodIPv6"),ZodIPv4:a(()=>gUr,"ZodIPv4"),ZodGUID:a(()=>$xt,"ZodGUID"),ZodFile:a(()=>wno,"ZodFile"),ZodError:a(()=>gzc,"ZodError"),ZodEnum:a(()=>k8e,"ZodEnum"),ZodEmoji:a(()=>lUr,"ZodEmoji"),ZodEmail:a(()=>aUr,"ZodEmail"),ZodE164:a(()=>CUr,"ZodE164"),ZodDiscriminatedUnion:a(()=>Cno,"ZodDiscriminatedUnion"),ZodDefault:a(()=>kno,"ZodDefault"),ZodDate:a(()=>IUr,"ZodDate"),ZodCustomStringFormat:a(()=>pno,"ZodCustomStringFormat"),ZodCustom:a(()=>$wt,"ZodCustom"),ZodCatch:a(()=>Lno,"ZodCatch"),ZodCUID2:a(()=>fUr,"ZodCUID2"),ZodCUID:a(()=>dUr,"ZodCUID"),ZodCIDRv6:a(()=>EUr,"ZodCIDRv6"),ZodCIDRv4:a(()=>yUr,"ZodCIDRv4"),ZodBoolean:a(()=>Qwt,"ZodBoolean"),ZodBigIntFormat:a(()=>SUr,"ZodBigIntFormat"),ZodBigInt:a(()=>qwt,"ZodBigInt"),ZodBase64URL:a(()=>vUr,"ZodBase64URL"),ZodBase64:a(()=>_Ur,"ZodBase64"),ZodArray:a(()=>vno,"ZodArray"),ZodAny:a(()=>Ano,"ZodAny"),TimePrecision:a(()=>yro,"TimePrecision"),NEVER:a(()=>eeo,"NEVER"),$output:a(()=>hro,"$output"),$input:a(()=>mro,"$input"),$brand:a(()=>teo,"$brand")});tUr={};WL(tUr,{time:a(()=>sno,"time"),duration:a(()=>ano,"duration"),datetime:a(()=>ino,"datetime"),date:a(()=>ono,"date"),ZodISOTime:a(()=>iUr,"ZodISOTime"),ZodISODuration:a(()=>oUr,"ZodISODuration"),ZodISODateTime:a(()=>rUr,"ZodISODateTime"),ZodISODate:a(()=>nUr,"ZodISODate")});rUr=ft("ZodISODateTime",(t,e)=>{Cto.init(t,e),Td.init(t,e)});a(ino,"aq");nUr=ft("ZodISODate",(t,e)=>{bto.init(t,e),Td.init(t,e)});a(ono,"sq");iUr=ft("ZodISOTime",(t,e)=>{Sto.init(t,e),Td.init(t,e)});a(sno,"eq");oUr=ft("ZodISODuration",(t,e)=>{Tto.init(t,e),Td.init(t,e)});a(ano,"$V");cno=a((t,e)=>{Z6r.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>e9r(t,r),"value")},flatten:{value:a(r=>X6r(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"),gzc=ft("ZodError",cno),H8e=ft("ZodError",cno,{Parent:Error}),lno=t9r(H8e),uno=r9r(H8e),dno=n9r(H8e),fno=i9r(H8e),Os=ft("ZodType",(t,e)=>(Co.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)=>$N(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>lno(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>dno(t,r,n),t.parseAsync=async(r,n)=>uno(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>fno(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Wno(r,n)),t.superRefine=r=>t.check(zno(r)),t.overwrite=r=>t.check(loe(r)),t.optional=()=>bd(t),t.nullable=()=>Vxt(t),t.nullish=()=>bd(Vxt(t)),t.nonoptional=r=>Mno(t,r),t.array=()=>Ca(t),t.or=r=>ou([t,r]),t.and=r=>Gwt(t,r),t.transform=r=>Wxt(t,PUr(r)),t.default=r=>Pno(t,r),t.prefault=r=>Nno(t,r),t.catch=r=>Bno(t,r),t.pipe=r=>Wxt(t,r),t.readonly=()=>Qno(t),t.describe=r=>{let n=t.clone();return V9.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return V9.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return V9.get(t);let n=t.clone();return V9.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),sUr=ft("_ZodString",(t,e)=>{q8e.init(t,e),Os.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(j9r(...n)),t.includes=(...n)=>t.check($9r(...n)),t.startsWith=(...n)=>t.check(V9r(...n)),t.endsWith=(...n)=>t.check(W9r(...n)),t.min=(...n)=>t.check(kve(...n)),t.max=(...n)=>t.check(Lwt(...n)),t.length=(...n)=>t.check(Bwt(...n)),t.nonempty=(...n)=>t.check(kve(1,...n)),t.lowercase=n=>t.check(H9r(n)),t.uppercase=n=>t.check(G9r(n)),t.trim=()=>t.check(K9r()),t.normalize=(...n)=>t.check(Y9r(...n)),t.toLowerCase=()=>t.check(J9r()),t.toUpperCase=()=>t.check(Z9r())}),Fwt=ft("ZodString",(t,e)=>{q8e.init(t,e),sUr.init(t,e),t.email=r=>t.check(_9r(aUr,r)),t.url=r=>t.check(T9r(cUr,r)),t.jwt=r=>t.check(Q9r(bUr,r)),t.emoji=r=>t.check(I9r(lUr,r)),t.guid=r=>t.check(jxt($xt,r)),t.uuid=r=>t.check(v9r(W9,r)),t.uuidv4=r=>t.check(C9r(W9,r)),t.uuidv6=r=>t.check(b9r(W9,r)),t.uuidv7=r=>t.check(S9r(W9,r)),t.nanoid=r=>t.check(x9r(uUr,r)),t.guid=r=>t.check(jxt($xt,r)),t.cuid=r=>t.check(w9r(dUr,r)),t.cuid2=r=>t.check(R9r(fUr,r)),t.ulid=r=>t.check(k9r(pUr,r)),t.base64=r=>t.check(B9r(_Ur,r)),t.base64url=r=>t.check(F9r(vUr,r)),t.xid=r=>t.check(P9r(hUr,r)),t.ksuid=r=>t.check(D9r(mUr,r)),t.ipv4=r=>t.check(N9r(gUr,r)),t.ipv6=r=>t.check(M9r(AUr,r)),t.cidrv4=r=>t.check(O9r(yUr,r)),t.cidrv6=r=>t.check(L9r(EUr,r)),t.e164=r=>t.check(U9r(CUr,r)),t.datetime=r=>t.check(ino(r)),t.date=r=>t.check(ono(r)),t.time=r=>t.check(sno(r)),t.duration=r=>t.check(ano(r))});a(It,"L");Td=ft("ZodStringFormat",(t,e)=>{Lu.init(t,e),sUr.init(t,e)}),aUr=ft("ZodEmail",(t,e)=>{pto.init(t,e),Td.init(t,e)});a(Azc,"Cm");$xt=ft("ZodGUID",(t,e)=>{dto.init(t,e),Td.init(t,e)});a(yzc,"Tm");W9=ft("ZodUUID",(t,e)=>{fto.init(t,e),Td.init(t,e)});a(Ezc,"xm");a(_zc,"ym");a(vzc,"fm");a(Czc,"gm");cUr=ft("ZodURL",(t,e)=>{hto.init(t,e),Td.init(t,e)});a(bzc,"hm");lUr=ft("ZodEmoji",(t,e)=>{mto.init(t,e),Td.init(t,e)});a(Szc,"um");uUr=ft("ZodNanoID",(t,e)=>{gto.init(t,e),Td.init(t,e)});a(Tzc,"mm");dUr=ft("ZodCUID",(t,e)=>{Ato.init(t,e),Td.init(t,e)});a(Izc,"lm");fUr=ft("ZodCUID2",(t,e)=>{yto.init(t,e),Td.init(t,e)});a(xzc,"cm");pUr=ft("ZodULID",(t,e)=>{Eto.init(t,e),Td.init(t,e)});a(wzc,"pm");hUr=ft("ZodXID",(t,e)=>{_to.init(t,e),Td.init(t,e)});a(Rzc,"dm");mUr=ft("ZodKSUID",(t,e)=>{vto.init(t,e),Td.init(t,e)});a(kzc,"im");gUr=ft("ZodIPv4",(t,e)=>{Ito.init(t,e),Td.init(t,e)});a(Pzc,"nm");AUr=ft("ZodIPv6",(t,e)=>{xto.init(t,e),Td.init(t,e)});a(Dzc,"rm");yUr=ft("ZodCIDRv4",(t,e)=>{wto.init(t,e),Td.init(t,e)});a(Nzc,"om");EUr=ft("ZodCIDRv6",(t,e)=>{Rto.init(t,e),Td.init(t,e)});a(Mzc,"tm");_Ur=ft("ZodBase64",(t,e)=>{kto.init(t,e),Td.init(t,e)});a(Ozc,"am");vUr=ft("ZodBase64URL",(t,e)=>{Dto.init(t,e),Td.init(t,e)});a(Lzc,"sm");CUr=ft("ZodE164",(t,e)=>{Nto.init(t,e),Td.init(t,e)});a(Bzc,"em");bUr=ft("ZodJWT",(t,e)=>{Oto.init(t,e),Td.init(t,e)});a(Fzc,"$l");pno=ft("ZodCustomStringFormat",(t,e)=>{Lto.init(t,e),Td.init(t,e)});a(Uzc,"Ql");Uwt=ft("ZodNumber",(t,e)=>{u9r.init(t,e),Os.init(t,e),t.gt=(n,o)=>t.check(ioe(n,o)),t.gte=(n,o)=>t.check(RI(n,o)),t.min=(n,o)=>t.check(RI(n,o)),t.lt=(n,o)=>t.check(noe(n,o)),t.lte=(n,o)=>t.check(FN(n,o)),t.max=(n,o)=>t.check(FN(n,o)),t.int=n=>t.check(U8r(n)),t.safe=n=>t.check(U8r(n)),t.positive=n=>t.check(ioe(0,n)),t.nonnegative=n=>t.check(RI(0,n)),t.negative=n=>t.check(noe(0,n)),t.nonpositive=n=>t.check(FN(0,n)),t.multipleOf=(n,o)=>t.check(x8e(n,o)),t.step=(n,o)=>t.check(x8e(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(Nc,"z$");Hve=ft("ZodNumberFormat",(t,e)=>{Bto.init(t,e),Uwt.init(t,e)});a(U8r,"WV");a(Qzc,"Jl");a(qzc,"Xl");a(jzc,"Yl");a(Hzc,"Wl");Qwt=ft("ZodBoolean",(t,e)=>{d9r.init(t,e),Os.init(t,e)});a(j0,"i$");qwt=ft("ZodBigInt",(t,e)=>{f9r.init(t,e),Os.init(t,e),t.gte=(n,o)=>t.check(RI(n,o)),t.min=(n,o)=>t.check(RI(n,o)),t.gt=(n,o)=>t.check(ioe(n,o)),t.gte=(n,o)=>t.check(RI(n,o)),t.min=(n,o)=>t.check(RI(n,o)),t.lt=(n,o)=>t.check(noe(n,o)),t.lte=(n,o)=>t.check(FN(n,o)),t.max=(n,o)=>t.check(FN(n,o)),t.positive=n=>t.check(ioe(BigInt(0),n)),t.negative=n=>t.check(noe(BigInt(0),n)),t.nonpositive=n=>t.check(FN(BigInt(0),n)),t.nonnegative=n=>t.check(RI(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(x8e(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(Gzc,"Gl");SUr=ft("ZodBigIntFormat",(t,e)=>{Fto.init(t,e),qwt.init(t,e)});a($zc,"Ul");a(Vzc,"Hl");hno=ft("ZodSymbol",(t,e)=>{Uto.init(t,e),Os.init(t,e)});a(Wzc,"Kl");mno=ft("ZodUndefined",(t,e)=>{Qto.init(t,e),Os.init(t,e)});a(zzc,"ql");gno=ft("ZodNull",(t,e)=>{qto.init(t,e),Os.init(t,e)});a(TUr,"T3");Ano=ft("ZodAny",(t,e)=>{jto.init(t,e),Os.init(t,e)});a(Yzc,"Vl");yno=ft("ZodUnknown",(t,e)=>{qxt.init(t,e),Os.init(t,e)});a(of,"S$");Eno=ft("ZodNever",(t,e)=>{Hto.init(t,e),Os.init(t,e)});a(jwt,"x3");_no=ft("ZodVoid",(t,e)=>{Gto.init(t,e),Os.init(t,e)});a(Kzc,"Bl");IUr=ft("ZodDate",(t,e)=>{$to.init(t,e),Os.init(t,e),t.min=(n,o)=>t.check(RI(n,o)),t.max=(n,o)=>t.check(FN(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(Jzc,"zl");vno=ft("ZodArray",(t,e)=>{p9r.init(t,e),Os.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(kve(r,n)),t.nonempty=r=>t.check(kve(1,r)),t.max=(r,n)=>t.check(Lwt(r,n)),t.length=(r,n)=>t.check(Bwt(r,n)),t.unwrap=()=>t.element});a(Ca,"W$");a(Zzc,"Nl");Hwt=ft("ZodObject",(t,e)=>{h9r.init(t,e),Os.init(t,e),Ws.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>N1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:of()}),t.loose=()=>t.clone({...t._zod.def,catchall:of()}),t.strict=()=>t.clone({...t._zod.def,catchall:jwt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Ws.extend(t,r),t.merge=r=>Ws.merge(t,r),t.pick=r=>Ws.pick(t,r),t.omit=r=>Ws.omit(t,r),t.partial=(...r)=>Ws.partial(DUr,t,r[0]),t.required=(...r)=>Ws.required(NUr,t,r[0])});a(Tn,"h");a(Xzc,"wl");a(Kv,"K6");xUr=ft("ZodUnion",(t,e)=>{m9r.init(t,e),Os.init(t,e),t.options=e.options});a(ou,"A$");Cno=ft("ZodDiscriminatedUnion",(t,e)=>{xUr.init(t,e),Vto.init(t,e)});a(wUr,"g3");bno=ft("ZodIntersection",(t,e)=>{Wto.init(t,e),Os.init(t,e)});a(Gwt,"VJ");Sno=ft("ZodTuple",(t,e)=>{Mwt.init(t,e),Os.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a(eYc,"Ol");RUr=ft("ZodRecord",(t,e)=>{zto.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(iu,"I$");a(tYc,"Dl");Tno=ft("ZodMap",(t,e)=>{Yto.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(rYc,"Fl");Ino=ft("ZodSet",(t,e)=>{Kto.init(t,e),Os.init(t,e),t.min=(...r)=>t.check(w8e(...r)),t.nonempty=r=>t.check(w8e(1,r)),t.max=(...r)=>t.check(Owt(...r)),t.size=(...r)=>t.check(q9r(...r))});a(nYc,"Zl");k8e=ft("ZodEnum",(t,e)=>{Jto.init(t,e),Os.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 k8e({...e,checks:[],...Ws.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 k8e({...e,checks:[],...Ws.normalizeParams(o),entries:s})}});a(N1,"N6");a(iYc,"Ml");xno=ft("ZodLiteral",(t,e)=>{Zto.init(t,e),Os.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(ti,"l");wno=ft("ZodFile",(t,e)=>{Xto.init(t,e),Os.init(t,e),t.min=(r,n)=>t.check(w8e(r,n)),t.max=(r,n)=>t.check(Owt(r,n)),t.mime=(r,n)=>t.check(z9r(Array.isArray(r)?r:[r],n))});a(oYc,"Ll");kUr=ft("ZodTransform",(t,e)=>{g9r.init(t,e),Os.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ws.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(Ws.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(PUr,"bV");DUr=ft("ZodOptional",(t,e)=>{ero.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(bd,"_$");Rno=ft("ZodNullable",(t,e)=>{tro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Vxt,"v3");a(sYc,"jl");kno=ft("ZodDefault",(t,e)=>{rro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(Pno,"aM");Dno=ft("ZodPrefault",(t,e)=>{nro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Nno,"eM");NUr=ft("ZodNonOptional",(t,e)=>{iro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Mno,"$L");Ono=ft("ZodSuccess",(t,e)=>{oro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(aYc,"Al");Lno=ft("ZodCatch",(t,e)=>{sro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(Bno,"XL");Fno=ft("ZodNaN",(t,e)=>{aro.init(t,e),Os.init(t,e)});a(cYc,"Il");MUr=ft("ZodPipe",(t,e)=>{A9r.init(t,e),Os.init(t,e),t.in=e.in,t.out=e.out});a(Wxt,"C3");Uno=ft("ZodReadonly",(t,e)=>{cro.init(t,e),Os.init(t,e)});a(Qno,"GL");qno=ft("ZodTemplateLiteral",(t,e)=>{lro.init(t,e),Os.init(t,e)});a(lYc,"Rl");jno=ft("ZodLazy",(t,e)=>{dro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(Hno,"KL");Gno=ft("ZodPromise",(t,e)=>{uro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(uYc,"Pl");$wt=ft("ZodCustom",(t,e)=>{fro.init(t,e),Os.init(t,e)});a($no,"VL");a(Vno,"vV");a(Wno,"BL");a(zno,"zL");a(dYc,"El");fYc=a((...t)=>eno({Pipe:MUr,Boolean:Qwt,String:Fwt,Transform:kUr},...t),"bl");a(pYc,"_l");a(OUr,"u3");hYc={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(mYc,"Sl");a(gYc,"vl");Yno={};WL(Yno,{string:a(()=>AYc,"string"),number:a(()=>yYc,"number"),date:a(()=>vYc,"date"),boolean:a(()=>EYc,"boolean"),bigint:a(()=>_Yc,"bigint")});a(AYc,"Cl");a(yYc,"Tl");a(EYc,"xl");a(_Yc,"yl");a(vYc,"fl");Xv(pro());CYc=G,Kno=CYc,Jno="2025-11-25",bYc=[Jno,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],$ie="io.modelcontextprotocol/related-task",Vwt="2.0",H0=Vno(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Zno=ou([It(),Nc().int()]),Xno=It(),cJh=Kv({ttl:Nc().optional(),pollInterval:Nc().optional()}),SYc=Tn({ttl:Nc().optional()}),TYc=Tn({taskId:It()}),LUr=Kv({progressToken:Zno.optional(),[$ie]:TYc.optional()}),MI=Tn({_meta:LUr.optional()}),G8e=MI.extend({task:SYc.optional()}),IYc=a(t=>G8e.safeParse(t).success,"FL"),Dy=Tn({method:It(),params:MI.loose().optional()}),vk=Tn({_meta:LUr.optional()}),Ck=Tn({method:It(),params:vk.loose().optional()}),Ny=Kv({_meta:LUr.optional()}),Wwt=ou([It(),Nc().int()]),eio=Tn({jsonrpc:ti(Vwt),id:Wwt,...Dy.shape}).strict(),YKi=a(t=>eio.safeParse(t).success,"fV"),tio=Tn({jsonrpc:ti(Vwt),...Ck.shape}).strict(),xYc=a(t=>tio.safeParse(t).success,"LL"),BUr=Tn({jsonrpc:ti(Vwt),id:Wwt,result:Ny}).strict(),FIt=a(t=>BUr.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"})(Bi||(Bi={}));FUr=Tn({jsonrpc:ti(Vwt),id:Wwt.optional(),error:Tn({code:Nc().int(),message:It(),data:of().optional()})}).strict(),wYc=a(t=>FUr.safeParse(t).success,"jL"),lJh=ou([eio,tio,BUr,FUr]),uJh=ou([BUr,FUr]),UUr=Ny.strict(),RYc=vk.extend({requestId:Wwt.optional(),reason:It().optional()}),QUr=Ck.extend({method:ti("notifications/cancelled"),params:RYc}),kYc=Tn({src:It(),mimeType:It().optional(),sizes:Ca(It()).optional(),theme:N1(["light","dark"]).optional()}),$8e=Tn({icons:Ca(kYc).optional()}),Pve=Tn({name:It(),title:It().optional()}),rio=Pve.extend({...Pve.shape,...$8e.shape,version:It(),websiteUrl:It().optional(),description:It().optional()}),PYc=Gwt(Tn({applyDefaults:j0().optional()}),iu(It(),of())),DYc=OUr(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Gwt(Tn({form:PYc.optional(),url:H0.optional()}),iu(It(),of()).optional())),NYc=Kv({list:H0.optional(),cancel:H0.optional(),requests:Kv({sampling:Kv({createMessage:H0.optional()}).optional(),elicitation:Kv({create:H0.optional()}).optional()}).optional()}),MYc=Kv({list:H0.optional(),cancel:H0.optional(),requests:Kv({tools:Kv({call:H0.optional()}).optional()}).optional()}),OYc=Tn({experimental:iu(It(),H0).optional(),sampling:Tn({context:H0.optional(),tools:H0.optional()}).optional(),elicitation:DYc.optional(),roots:Tn({listChanged:j0().optional()}).optional(),tasks:NYc.optional(),extensions:iu(It(),H0).optional()}),LYc=MI.extend({protocolVersion:It(),capabilities:OYc,clientInfo:rio}),nio=Dy.extend({method:ti("initialize"),params:LYc}),BYc=Tn({experimental:iu(It(),H0).optional(),logging:H0.optional(),completions:H0.optional(),prompts:Tn({listChanged:j0().optional()}).optional(),resources:Tn({subscribe:j0().optional(),listChanged:j0().optional()}).optional(),tools:Tn({listChanged:j0().optional()}).optional(),tasks:MYc.optional(),extensions:iu(It(),H0).optional()}),FYc=Ny.extend({protocolVersion:It(),capabilities:BYc,serverInfo:rio,instructions:It().optional()}),iio=Ck.extend({method:ti("notifications/initialized"),params:vk.optional()}),qUr=Dy.extend({method:ti("ping"),params:MI.optional()}),UYc=Tn({progress:Nc(),total:bd(Nc()),message:bd(It())}),QYc=Tn({...vk.shape,...UYc.shape,progressToken:Zno}),jUr=Ck.extend({method:ti("notifications/progress"),params:QYc}),qYc=MI.extend({cursor:Xno.optional()}),V8e=Dy.extend({params:qYc.optional()}),W8e=Ny.extend({nextCursor:Xno.optional()}),jYc=N1(["working","input_required","completed","failed","cancelled"]),z8e=Tn({taskId:It(),status:jYc,ttl:ou([Nc(),TUr()]),createdAt:It(),lastUpdatedAt:It(),pollInterval:bd(Nc()),statusMessage:bd(It())}),zwt=Ny.extend({task:z8e}),HYc=vk.merge(z8e),zxt=Ck.extend({method:ti("notifications/tasks/status"),params:HYc}),HUr=Dy.extend({method:ti("tasks/get"),params:MI.extend({taskId:It()})}),GUr=Ny.merge(z8e),$Ur=Dy.extend({method:ti("tasks/result"),params:MI.extend({taskId:It()})}),dJh=Ny.loose(),VUr=V8e.extend({method:ti("tasks/list")}),WUr=W8e.extend({tasks:Ca(z8e)}),zUr=Dy.extend({method:ti("tasks/cancel"),params:MI.extend({taskId:It()})}),GYc=Ny.merge(z8e),oio=Tn({uri:It(),mimeType:bd(It()),_meta:iu(It(),of()).optional()}),sio=oio.extend({text:It()}),YUr=It().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),aio=oio.extend({blob:YUr}),Y8e=N1(["user","assistant"]),Gve=Tn({audience:Ca(Y8e).optional(),priority:Nc().min(0).max(1).optional(),lastModified:tUr.datetime({offset:!0}).optional()}),cio=Tn({...Pve.shape,...$8e.shape,uri:It(),description:bd(It()),mimeType:bd(It()),size:bd(Nc()),annotations:Gve.optional(),_meta:bd(Kv({}))}),$Yc=Tn({...Pve.shape,...$8e.shape,uriTemplate:It(),description:bd(It()),mimeType:bd(It()),annotations:Gve.optional(),_meta:bd(Kv({}))}),Q8r=V8e.extend({method:ti("resources/list")}),VYc=W8e.extend({resources:Ca(cio)}),q8r=V8e.extend({method:ti("resources/templates/list")}),WYc=W8e.extend({resourceTemplates:Ca($Yc)}),KUr=MI.extend({uri:It()}),zYc=KUr,j8r=Dy.extend({method:ti("resources/read"),params:zYc}),YYc=Ny.extend({contents:Ca(ou([sio,aio]))}),KYc=Ck.extend({method:ti("notifications/resources/list_changed"),params:vk.optional()}),JYc=KUr,ZYc=Dy.extend({method:ti("resources/subscribe"),params:JYc}),XYc=KUr,eKc=Dy.extend({method:ti("resources/unsubscribe"),params:XYc}),tKc=vk.extend({uri:It()}),rKc=Ck.extend({method:ti("notifications/resources/updated"),params:tKc}),nKc=Tn({name:It(),description:bd(It()),required:bd(j0())}),iKc=Tn({...Pve.shape,...$8e.shape,description:bd(It()),arguments:bd(Ca(nKc)),_meta:bd(Kv({}))}),H8r=V8e.extend({method:ti("prompts/list")}),oKc=W8e.extend({prompts:Ca(iKc)}),sKc=MI.extend({name:It(),arguments:iu(It(),It()).optional()}),G8r=Dy.extend({method:ti("prompts/get"),params:sKc}),JUr=Tn({type:ti("text"),text:It(),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),ZUr=Tn({type:ti("image"),data:YUr,mimeType:It(),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),XUr=Tn({type:ti("audio"),data:YUr,mimeType:It(),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),aKc=Tn({type:ti("tool_use"),name:It(),id:It(),input:iu(It(),of()),_meta:iu(It(),of()).optional()}),cKc=Tn({type:ti("resource"),resource:ou([sio,aio]),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),lKc=cio.extend({type:ti("resource_link")}),e7r=ou([JUr,ZUr,XUr,lKc,cKc]),uKc=Tn({role:Y8e,content:e7r}),dKc=Ny.extend({description:It().optional(),messages:Ca(uKc)}),fKc=Ck.extend({method:ti("notifications/prompts/list_changed"),params:vk.optional()}),pKc=Tn({title:It().optional(),readOnlyHint:j0().optional(),destructiveHint:j0().optional(),idempotentHint:j0().optional(),openWorldHint:j0().optional()}),hKc=Tn({taskSupport:N1(["required","optional","forbidden"]).optional()}),lio=Tn({...Pve.shape,...$8e.shape,description:It().optional(),inputSchema:Tn({type:ti("object"),properties:iu(It(),H0).optional(),required:Ca(It()).optional()}).catchall(of()),outputSchema:Tn({type:ti("object"),properties:iu(It(),H0).optional(),required:Ca(It()).optional()}).catchall(of()).optional(),annotations:pKc.optional(),execution:hKc.optional(),_meta:iu(It(),of()).optional()}),$8r=V8e.extend({method:ti("tools/list")}),mKc=W8e.extend({tools:Ca(lio)}),t7r=Ny.extend({content:Ca(e7r).default([]),structuredContent:iu(It(),of()).optional(),isError:j0().optional()}),fJh=t7r.or(Ny.extend({toolResult:of()})),gKc=G8e.extend({name:It(),arguments:iu(It(),of()).optional()}),Yxt=Dy.extend({method:ti("tools/call"),params:gKc}),AKc=Ck.extend({method:ti("notifications/tools/list_changed"),params:vk.optional()}),pJh=Tn({autoRefresh:j0().default(!0),debounceMs:Nc().int().nonnegative().default(300)}),Kxt=N1(["debug","info","notice","warning","error","critical","alert","emergency"]),yKc=MI.extend({level:Kxt}),uio=Dy.extend({method:ti("logging/setLevel"),params:yKc}),EKc=vk.extend({level:Kxt,logger:It().optional(),data:of()}),_Kc=Ck.extend({method:ti("notifications/message"),params:EKc}),vKc=Tn({name:It().optional()}),CKc=Tn({hints:Ca(vKc).optional(),costPriority:Nc().min(0).max(1).optional(),speedPriority:Nc().min(0).max(1).optional(),intelligencePriority:Nc().min(0).max(1).optional()}),bKc=Tn({mode:N1(["auto","required","none"]).optional()}),SKc=Tn({type:ti("tool_result"),toolUseId:It().describe("The unique identifier for the corresponding tool call."),content:Ca(e7r).default([]),structuredContent:Tn({}).loose().optional(),isError:j0().optional(),_meta:iu(It(),of()).optional()}),TKc=wUr("type",[JUr,ZUr,XUr]),Jxt=wUr("type",[JUr,ZUr,XUr,aKc,SKc]),IKc=Tn({role:Y8e,content:ou([Jxt,Ca(Jxt)]),_meta:iu(It(),of()).optional()}),xKc=G8e.extend({messages:Ca(IKc),modelPreferences:CKc.optional(),systemPrompt:It().optional(),includeContext:N1(["none","thisServer","allServers"]).optional(),temperature:Nc().optional(),maxTokens:Nc().int(),stopSequences:Ca(It()).optional(),metadata:H0.optional(),tools:Ca(lio).optional(),toolChoice:bKc.optional()}),wKc=Dy.extend({method:ti("sampling/createMessage"),params:xKc}),r7r=Ny.extend({model:It(),stopReason:bd(N1(["endTurn","stopSequence","maxTokens"]).or(It())),role:Y8e,content:TKc}),dio=Ny.extend({model:It(),stopReason:bd(N1(["endTurn","stopSequence","maxTokens","toolUse"]).or(It())),role:Y8e,content:ou([Jxt,Ca(Jxt)])}),RKc=Tn({type:ti("boolean"),title:It().optional(),description:It().optional(),default:j0().optional()}),kKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),minLength:Nc().optional(),maxLength:Nc().optional(),format:N1(["email","uri","date","date-time"]).optional(),default:It().optional()}),PKc=Tn({type:N1(["number","integer"]),title:It().optional(),description:It().optional(),minimum:Nc().optional(),maximum:Nc().optional(),default:Nc().optional()}),DKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),enum:Ca(It()),default:It().optional()}),NKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),oneOf:Ca(Tn({const:It(),title:It()})),default:It().optional()}),MKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),enum:Ca(It()),enumNames:Ca(It()).optional(),default:It().optional()}),OKc=ou([DKc,NKc]),LKc=Tn({type:ti("array"),title:It().optional(),description:It().optional(),minItems:Nc().optional(),maxItems:Nc().optional(),items:Tn({type:ti("string"),enum:Ca(It())}),default:Ca(It()).optional()}),BKc=Tn({type:ti("array"),title:It().optional(),description:It().optional(),minItems:Nc().optional(),maxItems:Nc().optional(),items:Tn({anyOf:Ca(Tn({const:It(),title:It()}))}),default:Ca(It()).optional()}),FKc=ou([LKc,BKc]),UKc=ou([MKc,OKc,FKc]),QKc=ou([UKc,RKc,kKc,PKc]),qKc=G8e.extend({mode:ti("form").optional(),message:It(),requestedSchema:Tn({type:ti("object"),properties:iu(It(),QKc),required:Ca(It()).optional()})}),jKc=G8e.extend({mode:ti("url"),message:It(),elicitationId:It(),url:It().url()}),HKc=ou([qKc,jKc]),GKc=Dy.extend({method:ti("elicitation/create"),params:HKc}),$Kc=vk.extend({elicitationId:It()}),VKc=Ck.extend({method:ti("notifications/elicitation/complete"),params:$Kc}),Zxt=Ny.extend({action:N1(["accept","decline","cancel"]),content:OUr(t=>t===null?void 0:t,iu(It(),ou([It(),Nc(),j0(),Ca(It())])).optional())}),WKc=Tn({type:ti("ref/resource"),uri:It()}),zKc=Tn({type:ti("ref/prompt"),name:It()}),YKc=MI.extend({ref:ou([zKc,WKc]),argument:Tn({name:It(),value:It()}),context:Tn({arguments:iu(It(),It()).optional()}).optional()}),V8r=Dy.extend({method:ti("completion/complete"),params:YKc});a(KKc,"kL");a(JKc,"SL");ZKc=Ny.extend({completion:Kv({values:Ca(It()).max(100),total:bd(Nc().int()),hasMore:bd(j0())})}),XKc=Tn({uri:It().startsWith("file://"),name:It().optional(),_meta:iu(It(),of()).optional()}),eJc=Dy.extend({method:ti("roots/list"),params:MI.optional()}),fio=Ny.extend({roots:Ca(XKc)}),tJc=Ck.extend({method:ti("notifications/roots/list_changed"),params:vk.optional()}),hJh=ou([qUr,nio,V8r,uio,G8r,H8r,Q8r,q8r,j8r,ZYc,eKc,Yxt,$8r,HUr,$Ur,VUr,zUr]),mJh=ou([QUr,jUr,iio,tJc,zxt]),gJh=ou([UUr,r7r,dio,Zxt,fio,GUr,WUr,zwt]),AJh=ou([qUr,wKc,GKc,eJc,HUr,$Ur,VUr,zUr]),yJh=ou([QUr,jUr,_Kc,rKc,KYc,AKc,fKc,zxt,VKc]),EJh=ou([UUr,FYc,ZKc,dKc,oKc,VYc,WYc,YYc,t7r,mKc,GUr,WUr,zwt]),fi=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===Bi.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new W8r(o.elicitations,r)}return new t(e,r,n)}},W8r=class extends fi{static{a(this,"vL")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Bi.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};a(Hie,"T1");rJc=Symbol("Let zodToJsonSchema decide on which parser to use"),KKi={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"},nJc=a(t=>typeof t=="string"?{...KKi,name:t}:{...KKi,...t},"xL"),iJc=a(t=>{let e=nJc(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(pio,"aV");a(Al,"H$");hio=a((t,e)=>{let r=0;for(;rDc(t.innerType._def,e),"uL");a(gio,"sV");lJc=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":Al(r,"minimum",n.value,n.message,e);break;case"max":Al(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(uJc,"mL");a(dJc,"lL");a(fJc,"cL");pJc=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(hJc,"pL");a(mJc,"dL");HFr=void 0,ON={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(()=>(HFr===void 0&&(HFr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),HFr),"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(Aio,"qW");a(GFr,"$B");gJc=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(AJc,"Np");a(LN,"V4");a(Yv,"w6");a(JKi,"iL");a(yio,"VW");a(yJc,"nL");a(EJc,"rL");a(_Jc,"oL");a(vJc,"tL");Xxt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(CJc,"sL");ZKi=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Dc(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(bJc,"eL");a(SJc,"$j");a(TJc,"Qj");a(IJc,"wp");a(xJc,"Op");wJc=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Dc(t.innerType._def,e);let r=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:D1(e)},r]}:D1(e)},"Jj"),RJc=a((t,e)=>{if(e.pipeStrategy==="input")return Dc(t.in._def,e);if(e.pipeStrategy==="output")return Dc(t.out._def,e);let r=Dc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Dc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(kJc,"Yj");a(PJc,"Wj");a(DJc,"Gj");a(NJc,"Uj");a(MJc,"Hj");OJc=a((t,e)=>Dc(t.innerType._def,e),"Kj"),LJc=a((t,e,r)=>{switch(e){case Cr.ZodString:return Aio(t,r);case Cr.ZodNumber:return SJc(t,r);case Cr.ZodObject:return TJc(t,r);case Cr.ZodBigInt:return sJc(t,r);case Cr.ZodBoolean:return aJc();case Cr.ZodDate:return gio(t,r);case Cr.ZodUndefined:return NJc(r);case Cr.ZodNull:return vJc(r);case Cr.ZodArray:return oJc(t,r);case Cr.ZodUnion:case Cr.ZodDiscriminatedUnion:return CJc(t,r);case Cr.ZodIntersection:return hJc(t,r);case Cr.ZodTuple:return DJc(t,r);case Cr.ZodRecord:return yio(t,r);case Cr.ZodLiteral:return mJc(t,r);case Cr.ZodEnum:return fJc(t);case Cr.ZodNativeEnum:return EJc(t);case Cr.ZodNullable:return bJc(t,r);case Cr.ZodOptional:return wJc(t,r);case Cr.ZodMap:return yJc(t,r);case Cr.ZodSet:return PJc(t,r);case Cr.ZodLazy:return()=>t.getter()._def;case Cr.ZodPromise:return kJc(t,r);case Cr.ZodNaN:case Cr.ZodNever:return _Jc(r);case Cr.ZodEffects:return dJc(t,r);case Cr.ZodAny:return D1(r);case Cr.ZodUnknown:return MJc(r);case Cr.ZodDefault:return uJc(t,r);case Cr.ZodBranded:return mio(t,r);case Cr.ZodReadonly:return OJc(t,r);case Cr.ZodCatch:return cJc(t,r);case Cr.ZodPipeline:return RJc(t,r);case Cr.ZodFunction:case Cr.ZodVoid:case Cr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Dc,"r");BJc=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:hio(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`),D1(e)):e.$refStrategy==="seen"?D1(e):void 0}},"Dp"),FJc=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),UJc=a((t,e)=>{let r=iJc(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Dc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??D1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Dc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??D1(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(QJc,"Zp");a(XKi,"JB");a(eJi,"XB");a(tJi,"YB");qJc=6e4,z8r=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(QUr,r=>{this._oncancel(r)}),this.setNotificationHandler(jUr,r=>{this._onprogress(r)}),this.setRequestHandler(qUr,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(HUr,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Bi.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler($Ur,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 fi(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 fi(Bi.InvalidParams,`Task not found: ${s}`);if(!Hie(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Hie(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[$ie]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(VUr,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 fi(Bi.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(zUr,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Bi.InvalidParams,`Task not found: ${r.params.taskId}`);if(Hie(o.status))throw new fi(Bi.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 fi(Bi.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof fi?o:new fi(Bi.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),fi.fromError(Bi.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),FIt(s)||wYc(s)?this._onresponse(s):YKi(s)?this._onrequest(s,c):xYc(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=fi.fromError(Bi.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?.[$ie]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Bi.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=IYc(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 fi(Bi.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:Bi.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),FIt(e))n(e);else{let c=new fi(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(FIt(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),FIt(e))o(e);else{let c=fi.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 fi?c:new fi(Bi.InternalError,String(c))}}return}let s;try{let c=await this.request(e,zwt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new fi(Bi.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Hie(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new fi(Bi.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new fi(Bi.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 fi?c:new fi(Bi.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||{},[$ie]: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 b=v instanceof fi?v:new fi(Bi.RequestTimeout,String(v));f(b)},"N");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=r8e(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??qJc,E=a(()=>A(fi.fromError(Bi.RequestTimeout,"Request timed out",{timeout:y})),"O");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(Error(`Response handler missing for side-channeled request ${m}`))},"M");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}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},GUr,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},WUr,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},GYc,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||{},[$ie]: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||{},[$ie]: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||{},[$ie]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=eJi(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=tJi(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=eJi(e);this._notificationHandlers.set(n,o=>{let s=tJi(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"&&YKi(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new fi(Bi.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 fi(Bi.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new fi(Bi.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 fi(Bi.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=zxt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Hie(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 fi(Bi.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Hie(l.status))throw new fi(Bi.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=zxt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Hie(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(rJi,"Vj");a(jJc,"Bj");HJc=A6r(nZi(),1),GJc=A6r(E9c(),1);a($Jc,"ps");Y8r=class{static{a(this,"qz")}constructor(e){this._ajv=e??$Jc()}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)}}},K8r=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},r7r,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},Zxt,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(VJc,"tP");a(WJc,"aP");J8r=class extends z8r{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Kxt.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(iio,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(uio,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=Kxt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new K8r(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=jJc(this._capabilities,e)}setRequestHandler(e,r){let n=j8e(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(VL(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=r8e(Yxt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new fi(Bi.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=r8e(zwt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new fi(Bi.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=r8e(t7r,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new fi(Bi.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){WJc(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&VJc(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:bYc.includes(r)?r:Jno,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"},UUr)}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},dio,r):this.request({method:"sampling/createMessage",params:e},r7r,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},Zxt,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},Zxt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new fi(Bi.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof fi?s:new fi(Bi.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},fio,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"})}},Eio=Symbol.for("mcp.completable");a(nJi,"zz");a(zJc,"$E");(function(t){t.Completable="McpCompletable"})(iJi||(iJi={}));YJc=/^[A-Za-z0-9._-]{1,128}$/;a(KJc,"is");a(JJc,"ns");a(oJi,"Nz");Z8r=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)}},X8r=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 J8r(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new Z8r(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(XV($8r)),this.server.assertCanSetRequestHandler(XV(Yxt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler($8r,()=>({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=QFe(r.inputSchema);return o?XKi(o,{strictUnions:!0,pipeStrategy:"input"}):ZJc})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=QFe(r.outputSchema);o&&(n.outputSchema=XKi(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Yxt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new fi(Bi.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new fi(Bi.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 fi(Bi.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new fi(Bi.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 fi&&n.code===Bi.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=QFe(e.inputSchema)??e.inputSchema,s=await qFr(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=jFr(c);throw new fi(Bi.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 fi(Bi.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=QFe(e.outputSchema),s=await qFr(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=jFr(c);throw new fi(Bi.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 fi(Bi.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(XV(V8r)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(V8r,async e=>{switch(e.params.ref.type){case"ref/prompt":return KKc(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return JKc(e),this.handleResourceCompletion(e,e.params.ref);default:throw new fi(Bi.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new fi(Bi.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new fi(Bi.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return qFe;let o=j8e(n.argsSchema)?.[e.params.argument.name];if(!nJi(o))return qFe;let s=zJc(o);if(!s)return qFe;let c=await s(e.params.argument.value,e.params.context);return aJi(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 qFe;throw new fi(Bi.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return qFe;let s=await o(e.params.argument.value,e.params.context);return aJi(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(XV(Q8r)),this.server.assertCanSetRequestHandler(XV(q8r)),this.server.assertCanSetRequestHandler(XV(j8r)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Q8r,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(q8r,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(j8r,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new fi(Bi.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 fi(Bi.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(XV(H8r)),this.server.assertCanSetRequestHandler(XV(G8r)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(H8r,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?XJc(r.argsSchema):void 0}))})),this.server.setRequestHandler(G8r,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new fi(Bi.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new fi(Bi.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=QFe(n.argsSchema),s=await qFr(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=jFr(u);throw new fi(Bi.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:nve(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=nve(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 Ek?l._def?.innerType:l;return nJi(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){oJi(e);let f={title:r,description:n,inputSchema:sJi(o),outputSchema:sJi(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"&&oJi(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=nve(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=nve(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(e6r(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!e6r(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()}},ZJc={type:"object",properties:{}};a(_io,"XE");a(vio,"YE");a(e6r,"Oz");a(sJi,"QE");a(XJc,"os");a(XV,"l1");a(aJi,"JE");qFe={completion:{values:[],hasMore:!1}};a(eZc,"ts");a(tZc,"as");a(rZc,"ss");a(wr,"b");cJi=15e3,nZc=wr(()=>G.object({session_id:G.string(),ws_url:G.string(),work_dir:G.string().optional(),session_key:G.string().optional()})),mk=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},t6r=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new wxt;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 R1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new R1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await oZc(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=M8e(s);if(!(c instanceof R1)){let l=c instanceof mk&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&lJi(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 mk(`WebSocket connection timeout after ${cJi}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},cJi,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,pk(`[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 E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),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(tUr,"e8");a(q0,"t$");Azc={},yzc=ft("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");bo.init(t,e),t.def=e,t.parse=(r,n)=>Uxt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Nwt(t,r,n),t.parseAsync=async(r,n)=>Qxt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Mwt(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)=>VN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),Ezc=ft("ZodMiniObject",(t,e)=>{m9r.init(t,e),yzc.init(t,e),Ws.defineLazy(t,"shape",()=>e.shape)});a(ZKi,"tq");a(VL,"a6");a(ive,"S0");a(i8e,"S1");a(jFr,"I3");a(G8e,"v1");a(jFe,"$9");a(HFr,"R3");a(_zc,"_M");a(vzc,"kM");a(ano,"P3");G={};WL(G,{xid:a(()=>Ozc,"xid"),void:a(()=>rYc,"void"),uuidv7:a(()=>wzc,"uuidv7"),uuidv6:a(()=>xzc,"uuidv6"),uuidv4:a(()=>Izc,"uuidv4"),uuid:a(()=>Tzc,"uuid"),url:a(()=>Rzc,"url"),uppercase:a(()=>$9r,"uppercase"),unknown:a(()=>of,"unknown"),union:a(()=>ou,"union"),undefined:a(()=>eYc,"undefined"),ulid:a(()=>Mzc,"ulid"),uint64:a(()=>Zzc,"uint64"),uint32:a(()=>Yzc,"uint32"),tuple:a(()=>sYc,"tuple"),trim:a(()=>J9r,"trim"),treeifyError:a(()=>meo,"treeifyError"),transform:a(()=>DUr,"transform"),toUpperCase:a(()=>X9r,"toUpperCase"),toLowerCase:a(()=>Z9r,"toLowerCase"),toJSONSchema:a(()=>tUr,"toJSONSchema"),templateLiteral:a(()=>mYc,"templateLiteral"),symbol:a(()=>Xzc,"symbol"),superRefine:a(()=>Zno,"superRefine"),success:a(()=>pYc,"success"),stringbool:a(()=>yYc,"stringbool"),stringFormat:a(()=>$zc,"stringFormat"),string:a(()=>It,"string"),strictObject:a(()=>oYc,"strictObject"),startsWith:a(()=>W9r,"startsWith"),size:a(()=>j9r,"size"),setErrorMap:a(()=>vYc,"setErrorMap"),set:a(()=>lYc,"set"),safeParseAsync:a(()=>gno,"safeParseAsync"),safeParse:a(()=>mno,"safeParse"),registry:a(()=>_9r,"registry"),regexes:a(()=>s9r,"regexes"),regex:a(()=>H9r,"regex"),refine:a(()=>Jno,"refine"),record:a(()=>iu,"record"),readonly:a(()=>Gno,"readonly"),property:a(()=>Xro,"property"),promise:a(()=>gYc,"promise"),prettifyError:a(()=>Aeo,"prettifyError"),preprocess:a(()=>LUr,"preprocess"),prefault:a(()=>Bno,"prefault"),positive:a(()=>Yro,"positive"),pipe:a(()=>zxt,"pipe"),partialRecord:a(()=>aYc,"partialRecord"),parseAsync:a(()=>hno,"parseAsync"),parse:a(()=>pno,"parse"),overwrite:a(()=>loe,"overwrite"),optional:a(()=>bd,"optional"),object:a(()=>Tn,"object"),number:a(()=>Nc,"number"),nullish:a(()=>fYc,"nullish"),nullable:a(()=>Wxt,"nullable"),null:a(()=>IUr,"null"),normalize:a(()=>K9r,"normalize"),nonpositive:a(()=>Jro,"nonpositive"),nonoptional:a(()=>Fno,"nonoptional"),nonnegative:a(()=>Zro,"nonnegative"),never:a(()=>Hwt,"never"),negative:a(()=>Kro,"negative"),nativeEnum:a(()=>uYc,"nativeEnum"),nanoid:a(()=>Pzc,"nanoid"),nan:a(()=>hYc,"nan"),multipleOf:a(()=>R8e,"multipleOf"),minSize:a(()=>k8e,"minSize"),minLength:a(()=>Pve,"minLength"),mime:a(()=>Y9r,"mime"),maxSize:a(()=>Lwt,"maxSize"),maxLength:a(()=>Bwt,"maxLength"),map:a(()=>cYc,"map"),lte:a(()=>UN,"lte"),lt:a(()=>noe,"lt"),lowercase:a(()=>G9r,"lowercase"),looseObject:a(()=>Jv,"looseObject"),locales:a(()=>E9r,"locales"),literal:a(()=>ei,"literal"),length:a(()=>Fwt,"length"),lazy:a(()=>Wno,"lazy"),ksuid:a(()=>Lzc,"ksuid"),keyof:a(()=>iYc,"keyof"),jwt:a(()=>Gzc,"jwt"),json:a(()=>EYc,"json"),iso:a(()=>rUr,"iso"),ipv6:a(()=>Fzc,"ipv6"),ipv4:a(()=>Bzc,"ipv4"),intersection:a(()=>$wt,"intersection"),int64:a(()=>Jzc,"int64"),int32:a(()=>zzc,"int32"),int:a(()=>Q8r,"int"),instanceof:a(()=>AYc,"instanceof"),includes:a(()=>V9r,"includes"),guid:a(()=>Szc,"guid"),gte:a(()=>PI,"gte"),gt:a(()=>ioe,"gt"),globalRegistry:a(()=>W9,"globalRegistry"),getErrorMap:a(()=>CYc,"getErrorMap"),function:a(()=>sno,"function"),formatError:a(()=>t9r,"formatError"),float64:a(()=>Wzc,"float64"),float32:a(()=>Vzc,"float32"),flattenError:a(()=>e9r,"flattenError"),file:a(()=>dYc,"file"),enum:a(()=>N1,"enum"),endsWith:a(()=>z9r,"endsWith"),emoji:a(()=>kzc,"emoji"),email:a(()=>bzc,"email"),e164:a(()=>Hzc,"e164"),discriminatedUnion:a(()=>RUr,"discriminatedUnion"),date:a(()=>nYc,"date"),custom:a(()=>Kno,"custom"),cuid2:a(()=>Nzc,"cuid2"),cuid:a(()=>Dzc,"cuid"),core:a(()=>neo,"core"),config:a(()=>eC,"config"),coerce:a(()=>Xno,"coerce"),clone:a(()=>VN,"clone"),cidrv6:a(()=>Qzc,"cidrv6"),cidrv4:a(()=>Uzc,"cidrv4"),check:a(()=>Yno,"check"),catch:a(()=>qno,"catch"),boolean:a(()=>j0,"boolean"),bigint:a(()=>Kzc,"bigint"),base64url:a(()=>jzc,"base64url"),base64:a(()=>qzc,"base64"),array:a(()=>va,"array"),any:a(()=>tYc,"any"),_default:a(()=>Ono,"_default"),_ZodString:a(()=>aUr,"_ZodString"),ZodXID:a(()=>mUr,"ZodXID"),ZodVoid:a(()=>Sno,"ZodVoid"),ZodUnknown:a(()=>Cno,"ZodUnknown"),ZodUnion:a(()=>wUr,"ZodUnion"),ZodUndefined:a(()=>Eno,"ZodUndefined"),ZodUUID:a(()=>z9,"ZodUUID"),ZodURL:a(()=>lUr,"ZodURL"),ZodULID:a(()=>hUr,"ZodULID"),ZodType:a(()=>Os,"ZodType"),ZodTuple:a(()=>wno,"ZodTuple"),ZodTransform:a(()=>PUr,"ZodTransform"),ZodTemplateLiteral:a(()=>$no,"ZodTemplateLiteral"),ZodSymbol:a(()=>yno,"ZodSymbol"),ZodSuccess:a(()=>Uno,"ZodSuccess"),ZodStringFormat:a(()=>Td,"ZodStringFormat"),ZodString:a(()=>Uwt,"ZodString"),ZodSet:a(()=>kno,"ZodSet"),ZodRecord:a(()=>kUr,"ZodRecord"),ZodRealError:a(()=>$8e,"ZodRealError"),ZodReadonly:a(()=>Hno,"ZodReadonly"),ZodPromise:a(()=>zno,"ZodPromise"),ZodPrefault:a(()=>Lno,"ZodPrefault"),ZodPipe:a(()=>OUr,"ZodPipe"),ZodOptional:a(()=>NUr,"ZodOptional"),ZodObject:a(()=>Gwt,"ZodObject"),ZodNumberFormat:a(()=>Gve,"ZodNumberFormat"),ZodNumber:a(()=>Qwt,"ZodNumber"),ZodNullable:a(()=>Nno,"ZodNullable"),ZodNull:a(()=>_no,"ZodNull"),ZodNonOptional:a(()=>MUr,"ZodNonOptional"),ZodNever:a(()=>bno,"ZodNever"),ZodNanoID:a(()=>dUr,"ZodNanoID"),ZodNaN:a(()=>jno,"ZodNaN"),ZodMap:a(()=>Rno,"ZodMap"),ZodLiteral:a(()=>Pno,"ZodLiteral"),ZodLazy:a(()=>Vno,"ZodLazy"),ZodKSUID:a(()=>gUr,"ZodKSUID"),ZodJWT:a(()=>SUr,"ZodJWT"),ZodIssueCode:a(()=>_Yc,"ZodIssueCode"),ZodIntersection:a(()=>xno,"ZodIntersection"),ZodISOTime:a(()=>oUr,"ZodISOTime"),ZodISODuration:a(()=>sUr,"ZodISODuration"),ZodISODateTime:a(()=>nUr,"ZodISODateTime"),ZodISODate:a(()=>iUr,"ZodISODate"),ZodIPv6:a(()=>yUr,"ZodIPv6"),ZodIPv4:a(()=>AUr,"ZodIPv4"),ZodGUID:a(()=>Vxt,"ZodGUID"),ZodFile:a(()=>Dno,"ZodFile"),ZodError:a(()=>Czc,"ZodError"),ZodEnum:a(()=>D8e,"ZodEnum"),ZodEmoji:a(()=>uUr,"ZodEmoji"),ZodEmail:a(()=>cUr,"ZodEmail"),ZodE164:a(()=>bUr,"ZodE164"),ZodDiscriminatedUnion:a(()=>Ino,"ZodDiscriminatedUnion"),ZodDefault:a(()=>Mno,"ZodDefault"),ZodDate:a(()=>xUr,"ZodDate"),ZodCustomStringFormat:a(()=>Ano,"ZodCustomStringFormat"),ZodCustom:a(()=>Vwt,"ZodCustom"),ZodCatch:a(()=>Qno,"ZodCatch"),ZodCUID2:a(()=>pUr,"ZodCUID2"),ZodCUID:a(()=>fUr,"ZodCUID"),ZodCIDRv6:a(()=>_Ur,"ZodCIDRv6"),ZodCIDRv4:a(()=>EUr,"ZodCIDRv4"),ZodBoolean:a(()=>qwt,"ZodBoolean"),ZodBigIntFormat:a(()=>TUr,"ZodBigIntFormat"),ZodBigInt:a(()=>jwt,"ZodBigInt"),ZodBase64URL:a(()=>CUr,"ZodBase64URL"),ZodBase64:a(()=>vUr,"ZodBase64"),ZodArray:a(()=>Tno,"ZodArray"),ZodAny:a(()=>vno,"ZodAny"),TimePrecision:a(()=>Cro,"TimePrecision"),NEVER:a(()=>ieo,"NEVER"),$output:a(()=>yro,"$output"),$input:a(()=>Ero,"$input"),$brand:a(()=>oeo,"$brand")});rUr={};WL(rUr,{time:a(()=>uno,"time"),duration:a(()=>dno,"duration"),datetime:a(()=>cno,"datetime"),date:a(()=>lno,"date"),ZodISOTime:a(()=>oUr,"ZodISOTime"),ZodISODuration:a(()=>sUr,"ZodISODuration"),ZodISODateTime:a(()=>nUr,"ZodISODateTime"),ZodISODate:a(()=>iUr,"ZodISODate")});nUr=ft("ZodISODateTime",(t,e)=>{Ito.init(t,e),Td.init(t,e)});a(cno,"aq");iUr=ft("ZodISODate",(t,e)=>{xto.init(t,e),Td.init(t,e)});a(lno,"sq");oUr=ft("ZodISOTime",(t,e)=>{wto.init(t,e),Td.init(t,e)});a(uno,"eq");sUr=ft("ZodISODuration",(t,e)=>{Rto.init(t,e),Td.init(t,e)});a(dno,"$V");fno=a((t,e)=>{X6r.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>t9r(t,r),"value")},flatten:{value:a(r=>e9r(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"),Czc=ft("ZodError",fno),$8e=ft("ZodError",fno,{Parent:Error}),pno=r9r($8e),hno=n9r($8e),mno=i9r($8e),gno=o9r($8e),Os=ft("ZodType",(t,e)=>(bo.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)=>VN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>pno(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>mno(t,r,n),t.parseAsync=async(r,n)=>hno(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>gno(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Jno(r,n)),t.superRefine=r=>t.check(Zno(r)),t.overwrite=r=>t.check(loe(r)),t.optional=()=>bd(t),t.nullable=()=>Wxt(t),t.nullish=()=>bd(Wxt(t)),t.nonoptional=r=>Fno(t,r),t.array=()=>va(t),t.or=r=>ou([t,r]),t.and=r=>$wt(t,r),t.transform=r=>zxt(t,DUr(r)),t.default=r=>Ono(t,r),t.prefault=r=>Bno(t,r),t.catch=r=>qno(t,r),t.pipe=r=>zxt(t,r),t.readonly=()=>Gno(t),t.describe=r=>{let n=t.clone();return W9.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return W9.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return W9.get(t);let n=t.clone();return W9.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),aUr=ft("_ZodString",(t,e)=>{H8e.init(t,e),Os.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(H9r(...n)),t.includes=(...n)=>t.check(V9r(...n)),t.startsWith=(...n)=>t.check(W9r(...n)),t.endsWith=(...n)=>t.check(z9r(...n)),t.min=(...n)=>t.check(Pve(...n)),t.max=(...n)=>t.check(Bwt(...n)),t.length=(...n)=>t.check(Fwt(...n)),t.nonempty=(...n)=>t.check(Pve(1,...n)),t.lowercase=n=>t.check(G9r(n)),t.uppercase=n=>t.check($9r(n)),t.trim=()=>t.check(J9r()),t.normalize=(...n)=>t.check(K9r(...n)),t.toLowerCase=()=>t.check(Z9r()),t.toUpperCase=()=>t.check(X9r())}),Uwt=ft("ZodString",(t,e)=>{H8e.init(t,e),aUr.init(t,e),t.email=r=>t.check(v9r(cUr,r)),t.url=r=>t.check(I9r(lUr,r)),t.jwt=r=>t.check(q9r(SUr,r)),t.emoji=r=>t.check(x9r(uUr,r)),t.guid=r=>t.check(Hxt(Vxt,r)),t.uuid=r=>t.check(C9r(z9,r)),t.uuidv4=r=>t.check(b9r(z9,r)),t.uuidv6=r=>t.check(S9r(z9,r)),t.uuidv7=r=>t.check(T9r(z9,r)),t.nanoid=r=>t.check(w9r(dUr,r)),t.guid=r=>t.check(Hxt(Vxt,r)),t.cuid=r=>t.check(R9r(fUr,r)),t.cuid2=r=>t.check(k9r(pUr,r)),t.ulid=r=>t.check(P9r(hUr,r)),t.base64=r=>t.check(F9r(vUr,r)),t.base64url=r=>t.check(U9r(CUr,r)),t.xid=r=>t.check(D9r(mUr,r)),t.ksuid=r=>t.check(N9r(gUr,r)),t.ipv4=r=>t.check(M9r(AUr,r)),t.ipv6=r=>t.check(O9r(yUr,r)),t.cidrv4=r=>t.check(L9r(EUr,r)),t.cidrv6=r=>t.check(B9r(_Ur,r)),t.e164=r=>t.check(Q9r(bUr,r)),t.datetime=r=>t.check(cno(r)),t.date=r=>t.check(lno(r)),t.time=r=>t.check(uno(r)),t.duration=r=>t.check(dno(r))});a(It,"L");Td=ft("ZodStringFormat",(t,e)=>{Lu.init(t,e),aUr.init(t,e)}),cUr=ft("ZodEmail",(t,e)=>{Ato.init(t,e),Td.init(t,e)});a(bzc,"Cm");Vxt=ft("ZodGUID",(t,e)=>{mto.init(t,e),Td.init(t,e)});a(Szc,"Tm");z9=ft("ZodUUID",(t,e)=>{gto.init(t,e),Td.init(t,e)});a(Tzc,"xm");a(Izc,"ym");a(xzc,"fm");a(wzc,"gm");lUr=ft("ZodURL",(t,e)=>{yto.init(t,e),Td.init(t,e)});a(Rzc,"hm");uUr=ft("ZodEmoji",(t,e)=>{Eto.init(t,e),Td.init(t,e)});a(kzc,"um");dUr=ft("ZodNanoID",(t,e)=>{_to.init(t,e),Td.init(t,e)});a(Pzc,"mm");fUr=ft("ZodCUID",(t,e)=>{vto.init(t,e),Td.init(t,e)});a(Dzc,"lm");pUr=ft("ZodCUID2",(t,e)=>{Cto.init(t,e),Td.init(t,e)});a(Nzc,"cm");hUr=ft("ZodULID",(t,e)=>{bto.init(t,e),Td.init(t,e)});a(Mzc,"pm");mUr=ft("ZodXID",(t,e)=>{Sto.init(t,e),Td.init(t,e)});a(Ozc,"dm");gUr=ft("ZodKSUID",(t,e)=>{Tto.init(t,e),Td.init(t,e)});a(Lzc,"im");AUr=ft("ZodIPv4",(t,e)=>{kto.init(t,e),Td.init(t,e)});a(Bzc,"nm");yUr=ft("ZodIPv6",(t,e)=>{Pto.init(t,e),Td.init(t,e)});a(Fzc,"rm");EUr=ft("ZodCIDRv4",(t,e)=>{Dto.init(t,e),Td.init(t,e)});a(Uzc,"om");_Ur=ft("ZodCIDRv6",(t,e)=>{Nto.init(t,e),Td.init(t,e)});a(Qzc,"tm");vUr=ft("ZodBase64",(t,e)=>{Mto.init(t,e),Td.init(t,e)});a(qzc,"am");CUr=ft("ZodBase64URL",(t,e)=>{Lto.init(t,e),Td.init(t,e)});a(jzc,"sm");bUr=ft("ZodE164",(t,e)=>{Bto.init(t,e),Td.init(t,e)});a(Hzc,"em");SUr=ft("ZodJWT",(t,e)=>{Uto.init(t,e),Td.init(t,e)});a(Gzc,"$l");Ano=ft("ZodCustomStringFormat",(t,e)=>{Qto.init(t,e),Td.init(t,e)});a($zc,"Ql");Qwt=ft("ZodNumber",(t,e)=>{d9r.init(t,e),Os.init(t,e),t.gt=(n,o)=>t.check(ioe(n,o)),t.gte=(n,o)=>t.check(PI(n,o)),t.min=(n,o)=>t.check(PI(n,o)),t.lt=(n,o)=>t.check(noe(n,o)),t.lte=(n,o)=>t.check(UN(n,o)),t.max=(n,o)=>t.check(UN(n,o)),t.int=n=>t.check(Q8r(n)),t.safe=n=>t.check(Q8r(n)),t.positive=n=>t.check(ioe(0,n)),t.nonnegative=n=>t.check(PI(0,n)),t.negative=n=>t.check(noe(0,n)),t.nonpositive=n=>t.check(UN(0,n)),t.multipleOf=(n,o)=>t.check(R8e(n,o)),t.step=(n,o)=>t.check(R8e(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(Nc,"z$");Gve=ft("ZodNumberFormat",(t,e)=>{qto.init(t,e),Qwt.init(t,e)});a(Q8r,"WV");a(Vzc,"Jl");a(Wzc,"Xl");a(zzc,"Yl");a(Yzc,"Wl");qwt=ft("ZodBoolean",(t,e)=>{f9r.init(t,e),Os.init(t,e)});a(j0,"i$");jwt=ft("ZodBigInt",(t,e)=>{p9r.init(t,e),Os.init(t,e),t.gte=(n,o)=>t.check(PI(n,o)),t.min=(n,o)=>t.check(PI(n,o)),t.gt=(n,o)=>t.check(ioe(n,o)),t.gte=(n,o)=>t.check(PI(n,o)),t.min=(n,o)=>t.check(PI(n,o)),t.lt=(n,o)=>t.check(noe(n,o)),t.lte=(n,o)=>t.check(UN(n,o)),t.max=(n,o)=>t.check(UN(n,o)),t.positive=n=>t.check(ioe(BigInt(0),n)),t.negative=n=>t.check(noe(BigInt(0),n)),t.nonpositive=n=>t.check(UN(BigInt(0),n)),t.nonnegative=n=>t.check(PI(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(R8e(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(Kzc,"Gl");TUr=ft("ZodBigIntFormat",(t,e)=>{jto.init(t,e),jwt.init(t,e)});a(Jzc,"Ul");a(Zzc,"Hl");yno=ft("ZodSymbol",(t,e)=>{Hto.init(t,e),Os.init(t,e)});a(Xzc,"Kl");Eno=ft("ZodUndefined",(t,e)=>{Gto.init(t,e),Os.init(t,e)});a(eYc,"ql");_no=ft("ZodNull",(t,e)=>{$to.init(t,e),Os.init(t,e)});a(IUr,"T3");vno=ft("ZodAny",(t,e)=>{Vto.init(t,e),Os.init(t,e)});a(tYc,"Vl");Cno=ft("ZodUnknown",(t,e)=>{jxt.init(t,e),Os.init(t,e)});a(of,"S$");bno=ft("ZodNever",(t,e)=>{Wto.init(t,e),Os.init(t,e)});a(Hwt,"x3");Sno=ft("ZodVoid",(t,e)=>{zto.init(t,e),Os.init(t,e)});a(rYc,"Bl");xUr=ft("ZodDate",(t,e)=>{Yto.init(t,e),Os.init(t,e),t.min=(n,o)=>t.check(PI(n,o)),t.max=(n,o)=>t.check(UN(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(nYc,"zl");Tno=ft("ZodArray",(t,e)=>{h9r.init(t,e),Os.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(Pve(r,n)),t.nonempty=r=>t.check(Pve(1,r)),t.max=(r,n)=>t.check(Bwt(r,n)),t.length=(r,n)=>t.check(Fwt(r,n)),t.unwrap=()=>t.element});a(va,"W$");a(iYc,"Nl");Gwt=ft("ZodObject",(t,e)=>{m9r.init(t,e),Os.init(t,e),Ws.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>N1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:of()}),t.loose=()=>t.clone({...t._zod.def,catchall:of()}),t.strict=()=>t.clone({...t._zod.def,catchall:Hwt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Ws.extend(t,r),t.merge=r=>Ws.merge(t,r),t.pick=r=>Ws.pick(t,r),t.omit=r=>Ws.omit(t,r),t.partial=(...r)=>Ws.partial(NUr,t,r[0]),t.required=(...r)=>Ws.required(MUr,t,r[0])});a(Tn,"h");a(oYc,"wl");a(Jv,"K6");wUr=ft("ZodUnion",(t,e)=>{g9r.init(t,e),Os.init(t,e),t.options=e.options});a(ou,"A$");Ino=ft("ZodDiscriminatedUnion",(t,e)=>{wUr.init(t,e),Kto.init(t,e)});a(RUr,"g3");xno=ft("ZodIntersection",(t,e)=>{Jto.init(t,e),Os.init(t,e)});a($wt,"VJ");wno=ft("ZodTuple",(t,e)=>{Owt.init(t,e),Os.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a(sYc,"Ol");kUr=ft("ZodRecord",(t,e)=>{Zto.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(iu,"I$");a(aYc,"Dl");Rno=ft("ZodMap",(t,e)=>{Xto.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(cYc,"Fl");kno=ft("ZodSet",(t,e)=>{ero.init(t,e),Os.init(t,e),t.min=(...r)=>t.check(k8e(...r)),t.nonempty=r=>t.check(k8e(1,r)),t.max=(...r)=>t.check(Lwt(...r)),t.size=(...r)=>t.check(j9r(...r))});a(lYc,"Zl");D8e=ft("ZodEnum",(t,e)=>{tro.init(t,e),Os.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 D8e({...e,checks:[],...Ws.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 D8e({...e,checks:[],...Ws.normalizeParams(o),entries:s})}});a(N1,"N6");a(uYc,"Ml");Pno=ft("ZodLiteral",(t,e)=>{rro.init(t,e),Os.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(ei,"l");Dno=ft("ZodFile",(t,e)=>{nro.init(t,e),Os.init(t,e),t.min=(r,n)=>t.check(k8e(r,n)),t.max=(r,n)=>t.check(Lwt(r,n)),t.mime=(r,n)=>t.check(Y9r(Array.isArray(r)?r:[r],n))});a(dYc,"Ll");PUr=ft("ZodTransform",(t,e)=>{A9r.init(t,e),Os.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ws.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(Ws.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(DUr,"bV");NUr=ft("ZodOptional",(t,e)=>{iro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(bd,"_$");Nno=ft("ZodNullable",(t,e)=>{oro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Wxt,"v3");a(fYc,"jl");Mno=ft("ZodDefault",(t,e)=>{sro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(Ono,"aM");Lno=ft("ZodPrefault",(t,e)=>{aro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Bno,"eM");MUr=ft("ZodNonOptional",(t,e)=>{cro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Fno,"$L");Uno=ft("ZodSuccess",(t,e)=>{lro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(pYc,"Al");Qno=ft("ZodCatch",(t,e)=>{uro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(qno,"XL");jno=ft("ZodNaN",(t,e)=>{dro.init(t,e),Os.init(t,e)});a(hYc,"Il");OUr=ft("ZodPipe",(t,e)=>{y9r.init(t,e),Os.init(t,e),t.in=e.in,t.out=e.out});a(zxt,"C3");Hno=ft("ZodReadonly",(t,e)=>{fro.init(t,e),Os.init(t,e)});a(Gno,"GL");$no=ft("ZodTemplateLiteral",(t,e)=>{pro.init(t,e),Os.init(t,e)});a(mYc,"Rl");Vno=ft("ZodLazy",(t,e)=>{mro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(Wno,"KL");zno=ft("ZodPromise",(t,e)=>{hro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(gYc,"Pl");Vwt=ft("ZodCustom",(t,e)=>{gro.init(t,e),Os.init(t,e)});a(Yno,"VL");a(Kno,"vV");a(Jno,"BL");a(Zno,"zL");a(AYc,"El");yYc=a((...t)=>ino({Pipe:OUr,Boolean:qwt,String:Uwt,Transform:PUr},...t),"bl");a(EYc,"_l");a(LUr,"u3");_Yc={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(vYc,"Sl");a(CYc,"vl");Xno={};WL(Xno,{string:a(()=>bYc,"string"),number:a(()=>SYc,"number"),date:a(()=>xYc,"date"),boolean:a(()=>TYc,"boolean"),bigint:a(()=>IYc,"bigint")});a(bYc,"Cl");a(SYc,"Tl");a(TYc,"xl");a(IYc,"yl");a(xYc,"fl");eC(Aro());wYc=G,eio=wYc,tio="2025-11-25",RYc=[tio,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],$ie="io.modelcontextprotocol/related-task",Wwt="2.0",H0=Kno(t=>t!==null&&(typeof t=="object"||typeof t=="function")),rio=ou([It(),Nc().int()]),nio=It(),mJh=Jv({ttl:Nc().optional(),pollInterval:Nc().optional()}),kYc=Tn({ttl:Nc().optional()}),PYc=Tn({taskId:It()}),BUr=Jv({progressToken:rio.optional(),[$ie]:PYc.optional()}),LI=Tn({_meta:BUr.optional()}),V8e=LI.extend({task:kYc.optional()}),DYc=a(t=>V8e.safeParse(t).success,"FL"),Dy=Tn({method:It(),params:LI.loose().optional()}),Ck=Tn({_meta:BUr.optional()}),bk=Tn({method:It(),params:Ck.loose().optional()}),Ny=Jv({_meta:BUr.optional()}),zwt=ou([It(),Nc().int()]),iio=Tn({jsonrpc:ei(Wwt),id:zwt,...Dy.shape}).strict(),XKi=a(t=>iio.safeParse(t).success,"fV"),oio=Tn({jsonrpc:ei(Wwt),...bk.shape}).strict(),NYc=a(t=>oio.safeParse(t).success,"LL"),FUr=Tn({jsonrpc:ei(Wwt),id:zwt,result:Ny}).strict(),UIt=a(t=>FUr.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"})(Bi||(Bi={}));UUr=Tn({jsonrpc:ei(Wwt),id:zwt.optional(),error:Tn({code:Nc().int(),message:It(),data:of().optional()})}).strict(),MYc=a(t=>UUr.safeParse(t).success,"jL"),gJh=ou([iio,oio,FUr,UUr]),AJh=ou([FUr,UUr]),QUr=Ny.strict(),OYc=Ck.extend({requestId:zwt.optional(),reason:It().optional()}),qUr=bk.extend({method:ei("notifications/cancelled"),params:OYc}),LYc=Tn({src:It(),mimeType:It().optional(),sizes:va(It()).optional(),theme:N1(["light","dark"]).optional()}),W8e=Tn({icons:va(LYc).optional()}),Dve=Tn({name:It(),title:It().optional()}),sio=Dve.extend({...Dve.shape,...W8e.shape,version:It(),websiteUrl:It().optional(),description:It().optional()}),BYc=$wt(Tn({applyDefaults:j0().optional()}),iu(It(),of())),FYc=LUr(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,$wt(Tn({form:BYc.optional(),url:H0.optional()}),iu(It(),of()).optional())),UYc=Jv({list:H0.optional(),cancel:H0.optional(),requests:Jv({sampling:Jv({createMessage:H0.optional()}).optional(),elicitation:Jv({create:H0.optional()}).optional()}).optional()}),QYc=Jv({list:H0.optional(),cancel:H0.optional(),requests:Jv({tools:Jv({call:H0.optional()}).optional()}).optional()}),qYc=Tn({experimental:iu(It(),H0).optional(),sampling:Tn({context:H0.optional(),tools:H0.optional()}).optional(),elicitation:FYc.optional(),roots:Tn({listChanged:j0().optional()}).optional(),tasks:UYc.optional(),extensions:iu(It(),H0).optional()}),jYc=LI.extend({protocolVersion:It(),capabilities:qYc,clientInfo:sio}),aio=Dy.extend({method:ei("initialize"),params:jYc}),HYc=Tn({experimental:iu(It(),H0).optional(),logging:H0.optional(),completions:H0.optional(),prompts:Tn({listChanged:j0().optional()}).optional(),resources:Tn({subscribe:j0().optional(),listChanged:j0().optional()}).optional(),tools:Tn({listChanged:j0().optional()}).optional(),tasks:QYc.optional(),extensions:iu(It(),H0).optional()}),GYc=Ny.extend({protocolVersion:It(),capabilities:HYc,serverInfo:sio,instructions:It().optional()}),cio=bk.extend({method:ei("notifications/initialized"),params:Ck.optional()}),jUr=Dy.extend({method:ei("ping"),params:LI.optional()}),$Yc=Tn({progress:Nc(),total:bd(Nc()),message:bd(It())}),VYc=Tn({...Ck.shape,...$Yc.shape,progressToken:rio}),HUr=bk.extend({method:ei("notifications/progress"),params:VYc}),WYc=LI.extend({cursor:nio.optional()}),z8e=Dy.extend({params:WYc.optional()}),Y8e=Ny.extend({nextCursor:nio.optional()}),zYc=N1(["working","input_required","completed","failed","cancelled"]),K8e=Tn({taskId:It(),status:zYc,ttl:ou([Nc(),IUr()]),createdAt:It(),lastUpdatedAt:It(),pollInterval:bd(Nc()),statusMessage:bd(It())}),Ywt=Ny.extend({task:K8e}),YYc=Ck.merge(K8e),Yxt=bk.extend({method:ei("notifications/tasks/status"),params:YYc}),GUr=Dy.extend({method:ei("tasks/get"),params:LI.extend({taskId:It()})}),$Ur=Ny.merge(K8e),VUr=Dy.extend({method:ei("tasks/result"),params:LI.extend({taskId:It()})}),yJh=Ny.loose(),WUr=z8e.extend({method:ei("tasks/list")}),zUr=Y8e.extend({tasks:va(K8e)}),YUr=Dy.extend({method:ei("tasks/cancel"),params:LI.extend({taskId:It()})}),KYc=Ny.merge(K8e),lio=Tn({uri:It(),mimeType:bd(It()),_meta:iu(It(),of()).optional()}),uio=lio.extend({text:It()}),KUr=It().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),dio=lio.extend({blob:KUr}),J8e=N1(["user","assistant"]),$ve=Tn({audience:va(J8e).optional(),priority:Nc().min(0).max(1).optional(),lastModified:rUr.datetime({offset:!0}).optional()}),fio=Tn({...Dve.shape,...W8e.shape,uri:It(),description:bd(It()),mimeType:bd(It()),size:bd(Nc()),annotations:$ve.optional(),_meta:bd(Jv({}))}),JYc=Tn({...Dve.shape,...W8e.shape,uriTemplate:It(),description:bd(It()),mimeType:bd(It()),annotations:$ve.optional(),_meta:bd(Jv({}))}),q8r=z8e.extend({method:ei("resources/list")}),ZYc=Y8e.extend({resources:va(fio)}),j8r=z8e.extend({method:ei("resources/templates/list")}),XYc=Y8e.extend({resourceTemplates:va(JYc)}),JUr=LI.extend({uri:It()}),eKc=JUr,H8r=Dy.extend({method:ei("resources/read"),params:eKc}),tKc=Ny.extend({contents:va(ou([uio,dio]))}),rKc=bk.extend({method:ei("notifications/resources/list_changed"),params:Ck.optional()}),nKc=JUr,iKc=Dy.extend({method:ei("resources/subscribe"),params:nKc}),oKc=JUr,sKc=Dy.extend({method:ei("resources/unsubscribe"),params:oKc}),aKc=Ck.extend({uri:It()}),cKc=bk.extend({method:ei("notifications/resources/updated"),params:aKc}),lKc=Tn({name:It(),description:bd(It()),required:bd(j0())}),uKc=Tn({...Dve.shape,...W8e.shape,description:bd(It()),arguments:bd(va(lKc)),_meta:bd(Jv({}))}),G8r=z8e.extend({method:ei("prompts/list")}),dKc=Y8e.extend({prompts:va(uKc)}),fKc=LI.extend({name:It(),arguments:iu(It(),It()).optional()}),$8r=Dy.extend({method:ei("prompts/get"),params:fKc}),ZUr=Tn({type:ei("text"),text:It(),annotations:$ve.optional(),_meta:iu(It(),of()).optional()}),XUr=Tn({type:ei("image"),data:KUr,mimeType:It(),annotations:$ve.optional(),_meta:iu(It(),of()).optional()}),e7r=Tn({type:ei("audio"),data:KUr,mimeType:It(),annotations:$ve.optional(),_meta:iu(It(),of()).optional()}),pKc=Tn({type:ei("tool_use"),name:It(),id:It(),input:iu(It(),of()),_meta:iu(It(),of()).optional()}),hKc=Tn({type:ei("resource"),resource:ou([uio,dio]),annotations:$ve.optional(),_meta:iu(It(),of()).optional()}),mKc=fio.extend({type:ei("resource_link")}),t7r=ou([ZUr,XUr,e7r,mKc,hKc]),gKc=Tn({role:J8e,content:t7r}),AKc=Ny.extend({description:It().optional(),messages:va(gKc)}),yKc=bk.extend({method:ei("notifications/prompts/list_changed"),params:Ck.optional()}),EKc=Tn({title:It().optional(),readOnlyHint:j0().optional(),destructiveHint:j0().optional(),idempotentHint:j0().optional(),openWorldHint:j0().optional()}),_Kc=Tn({taskSupport:N1(["required","optional","forbidden"]).optional()}),pio=Tn({...Dve.shape,...W8e.shape,description:It().optional(),inputSchema:Tn({type:ei("object"),properties:iu(It(),H0).optional(),required:va(It()).optional()}).catchall(of()),outputSchema:Tn({type:ei("object"),properties:iu(It(),H0).optional(),required:va(It()).optional()}).catchall(of()).optional(),annotations:EKc.optional(),execution:_Kc.optional(),_meta:iu(It(),of()).optional()}),V8r=z8e.extend({method:ei("tools/list")}),vKc=Y8e.extend({tools:va(pio)}),r7r=Ny.extend({content:va(t7r).default([]),structuredContent:iu(It(),of()).optional(),isError:j0().optional()}),EJh=r7r.or(Ny.extend({toolResult:of()})),CKc=V8e.extend({name:It(),arguments:iu(It(),of()).optional()}),Kxt=Dy.extend({method:ei("tools/call"),params:CKc}),bKc=bk.extend({method:ei("notifications/tools/list_changed"),params:Ck.optional()}),_Jh=Tn({autoRefresh:j0().default(!0),debounceMs:Nc().int().nonnegative().default(300)}),Jxt=N1(["debug","info","notice","warning","error","critical","alert","emergency"]),SKc=LI.extend({level:Jxt}),hio=Dy.extend({method:ei("logging/setLevel"),params:SKc}),TKc=Ck.extend({level:Jxt,logger:It().optional(),data:of()}),IKc=bk.extend({method:ei("notifications/message"),params:TKc}),xKc=Tn({name:It().optional()}),wKc=Tn({hints:va(xKc).optional(),costPriority:Nc().min(0).max(1).optional(),speedPriority:Nc().min(0).max(1).optional(),intelligencePriority:Nc().min(0).max(1).optional()}),RKc=Tn({mode:N1(["auto","required","none"]).optional()}),kKc=Tn({type:ei("tool_result"),toolUseId:It().describe("The unique identifier for the corresponding tool call."),content:va(t7r).default([]),structuredContent:Tn({}).loose().optional(),isError:j0().optional(),_meta:iu(It(),of()).optional()}),PKc=RUr("type",[ZUr,XUr,e7r]),Zxt=RUr("type",[ZUr,XUr,e7r,pKc,kKc]),DKc=Tn({role:J8e,content:ou([Zxt,va(Zxt)]),_meta:iu(It(),of()).optional()}),NKc=V8e.extend({messages:va(DKc),modelPreferences:wKc.optional(),systemPrompt:It().optional(),includeContext:N1(["none","thisServer","allServers"]).optional(),temperature:Nc().optional(),maxTokens:Nc().int(),stopSequences:va(It()).optional(),metadata:H0.optional(),tools:va(pio).optional(),toolChoice:RKc.optional()}),MKc=Dy.extend({method:ei("sampling/createMessage"),params:NKc}),n7r=Ny.extend({model:It(),stopReason:bd(N1(["endTurn","stopSequence","maxTokens"]).or(It())),role:J8e,content:PKc}),mio=Ny.extend({model:It(),stopReason:bd(N1(["endTurn","stopSequence","maxTokens","toolUse"]).or(It())),role:J8e,content:ou([Zxt,va(Zxt)])}),OKc=Tn({type:ei("boolean"),title:It().optional(),description:It().optional(),default:j0().optional()}),LKc=Tn({type:ei("string"),title:It().optional(),description:It().optional(),minLength:Nc().optional(),maxLength:Nc().optional(),format:N1(["email","uri","date","date-time"]).optional(),default:It().optional()}),BKc=Tn({type:N1(["number","integer"]),title:It().optional(),description:It().optional(),minimum:Nc().optional(),maximum:Nc().optional(),default:Nc().optional()}),FKc=Tn({type:ei("string"),title:It().optional(),description:It().optional(),enum:va(It()),default:It().optional()}),UKc=Tn({type:ei("string"),title:It().optional(),description:It().optional(),oneOf:va(Tn({const:It(),title:It()})),default:It().optional()}),QKc=Tn({type:ei("string"),title:It().optional(),description:It().optional(),enum:va(It()),enumNames:va(It()).optional(),default:It().optional()}),qKc=ou([FKc,UKc]),jKc=Tn({type:ei("array"),title:It().optional(),description:It().optional(),minItems:Nc().optional(),maxItems:Nc().optional(),items:Tn({type:ei("string"),enum:va(It())}),default:va(It()).optional()}),HKc=Tn({type:ei("array"),title:It().optional(),description:It().optional(),minItems:Nc().optional(),maxItems:Nc().optional(),items:Tn({anyOf:va(Tn({const:It(),title:It()}))}),default:va(It()).optional()}),GKc=ou([jKc,HKc]),$Kc=ou([QKc,qKc,GKc]),VKc=ou([$Kc,OKc,LKc,BKc]),WKc=V8e.extend({mode:ei("form").optional(),message:It(),requestedSchema:Tn({type:ei("object"),properties:iu(It(),VKc),required:va(It()).optional()})}),zKc=V8e.extend({mode:ei("url"),message:It(),elicitationId:It(),url:It().url()}),YKc=ou([WKc,zKc]),KKc=Dy.extend({method:ei("elicitation/create"),params:YKc}),JKc=Ck.extend({elicitationId:It()}),ZKc=bk.extend({method:ei("notifications/elicitation/complete"),params:JKc}),Xxt=Ny.extend({action:N1(["accept","decline","cancel"]),content:LUr(t=>t===null?void 0:t,iu(It(),ou([It(),Nc(),j0(),va(It())])).optional())}),XKc=Tn({type:ei("ref/resource"),uri:It()}),eJc=Tn({type:ei("ref/prompt"),name:It()}),tJc=LI.extend({ref:ou([eJc,XKc]),argument:Tn({name:It(),value:It()}),context:Tn({arguments:iu(It(),It()).optional()}).optional()}),W8r=Dy.extend({method:ei("completion/complete"),params:tJc});a(rJc,"kL");a(nJc,"SL");iJc=Ny.extend({completion:Jv({values:va(It()).max(100),total:bd(Nc().int()),hasMore:bd(j0())})}),oJc=Tn({uri:It().startsWith("file://"),name:It().optional(),_meta:iu(It(),of()).optional()}),sJc=Dy.extend({method:ei("roots/list"),params:LI.optional()}),gio=Ny.extend({roots:va(oJc)}),aJc=bk.extend({method:ei("notifications/roots/list_changed"),params:Ck.optional()}),vJh=ou([jUr,aio,W8r,hio,$8r,G8r,q8r,j8r,H8r,iKc,sKc,Kxt,V8r,GUr,VUr,WUr,YUr]),CJh=ou([qUr,HUr,cio,aJc,Yxt]),bJh=ou([QUr,n7r,mio,Xxt,gio,$Ur,zUr,Ywt]),SJh=ou([jUr,MKc,KKc,sJc,GUr,VUr,WUr,YUr]),TJh=ou([qUr,HUr,IKc,cKc,rKc,bKc,yKc,Yxt,ZKc]),IJh=ou([QUr,GYc,iJc,AKc,dKc,ZYc,XYc,tKc,r7r,vKc,$Ur,zUr,Ywt]),fi=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===Bi.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new z8r(o.elicitations,r)}return new t(e,r,n)}},z8r=class extends fi{static{a(this,"vL")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Bi.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};a(Hie,"T1");cJc=Symbol("Let zodToJsonSchema decide on which parser to use"),eJi={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"},lJc=a(t=>typeof t=="string"?{...eJi,name:t}:{...eJi,...t},"xL"),uJc=a(t=>{let e=lJc(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(Aio,"aV");a(Al,"H$");yio=a((t,e)=>{let r=0;for(;rDc(t.innerType._def,e),"uL");a(_io,"sV");mJc=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":Al(r,"minimum",n.value,n.message,e);break;case"max":Al(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(gJc,"mL");a(AJc,"lL");a(yJc,"cL");EJc=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(_Jc,"pL");a(vJc,"dL");GFr=void 0,LN={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(()=>(GFr===void 0&&(GFr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),GFr),"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(vio,"qW");a($Fr,"$B");CJc=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(bJc,"Np");a(BN,"V4");a(Kv,"w6");a(tJi,"iL");a(Cio,"VW");a(SJc,"nL");a(TJc,"rL");a(IJc,"oL");a(xJc,"tL");ewt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(wJc,"sL");rJi=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Dc(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(RJc,"eL");a(kJc,"$j");a(PJc,"Qj");a(DJc,"wp");a(NJc,"Op");MJc=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Dc(t.innerType._def,e);let r=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:D1(e)},r]}:D1(e)},"Jj"),OJc=a((t,e)=>{if(e.pipeStrategy==="input")return Dc(t.in._def,e);if(e.pipeStrategy==="output")return Dc(t.out._def,e);let r=Dc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Dc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(LJc,"Yj");a(BJc,"Wj");a(FJc,"Gj");a(UJc,"Uj");a(QJc,"Hj");qJc=a((t,e)=>Dc(t.innerType._def,e),"Kj"),jJc=a((t,e,r)=>{switch(e){case Cr.ZodString:return vio(t,r);case Cr.ZodNumber:return kJc(t,r);case Cr.ZodObject:return PJc(t,r);case Cr.ZodBigInt:return fJc(t,r);case Cr.ZodBoolean:return pJc();case Cr.ZodDate:return _io(t,r);case Cr.ZodUndefined:return UJc(r);case Cr.ZodNull:return xJc(r);case Cr.ZodArray:return dJc(t,r);case Cr.ZodUnion:case Cr.ZodDiscriminatedUnion:return wJc(t,r);case Cr.ZodIntersection:return _Jc(t,r);case Cr.ZodTuple:return FJc(t,r);case Cr.ZodRecord:return Cio(t,r);case Cr.ZodLiteral:return vJc(t,r);case Cr.ZodEnum:return yJc(t);case Cr.ZodNativeEnum:return TJc(t);case Cr.ZodNullable:return RJc(t,r);case Cr.ZodOptional:return MJc(t,r);case Cr.ZodMap:return SJc(t,r);case Cr.ZodSet:return BJc(t,r);case Cr.ZodLazy:return()=>t.getter()._def;case Cr.ZodPromise:return LJc(t,r);case Cr.ZodNaN:case Cr.ZodNever:return IJc(r);case Cr.ZodEffects:return AJc(t,r);case Cr.ZodAny:return D1(r);case Cr.ZodUnknown:return QJc(r);case Cr.ZodDefault:return gJc(t,r);case Cr.ZodBranded:return Eio(t,r);case Cr.ZodReadonly:return qJc(t,r);case Cr.ZodCatch:return hJc(t,r);case Cr.ZodPipeline:return OJc(t,r);case Cr.ZodFunction:case Cr.ZodVoid:case Cr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Dc,"r");HJc=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:yio(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`),D1(e)):e.$refStrategy==="seen"?D1(e):void 0}},"Dp"),GJc=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),$Jc=a((t,e)=>{let r=uJc(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Dc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??D1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Dc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??D1(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(VJc,"Zp");a(nJi,"JB");a(iJi,"XB");a(oJi,"YB");WJc=6e4,Y8r=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(qUr,r=>{this._oncancel(r)}),this.setNotificationHandler(HUr,r=>{this._onprogress(r)}),this.setRequestHandler(jUr,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(GUr,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Bi.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(VUr,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 fi(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 fi(Bi.InvalidParams,`Task not found: ${s}`);if(!Hie(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Hie(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[$ie]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(WUr,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 fi(Bi.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(YUr,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Bi.InvalidParams,`Task not found: ${r.params.taskId}`);if(Hie(o.status))throw new fi(Bi.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 fi(Bi.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof fi?o:new fi(Bi.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),fi.fromError(Bi.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),UIt(s)||MYc(s)?this._onresponse(s):XKi(s)?this._onrequest(s,c):NYc(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=fi.fromError(Bi.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?.[$ie]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Bi.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=DYc(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 fi(Bi.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:Bi.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),UIt(e))n(e);else{let c=new fi(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(UIt(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),UIt(e))o(e);else{let c=fi.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 fi?c:new fi(Bi.InternalError,String(c))}}return}let s;try{let c=await this.request(e,Ywt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new fi(Bi.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Hie(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new fi(Bi.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new fi(Bi.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 fi?c:new fi(Bi.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||{},[$ie]: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 b=v instanceof fi?v:new fi(Bi.RequestTimeout,String(v));f(b)},"N");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=i8e(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??WJc,E=a(()=>A(fi.fromError(Bi.RequestTimeout,"Request timed out",{timeout:y})),"O");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(Error(`Response handler missing for side-channeled request ${m}`))},"M");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}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},$Ur,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},zUr,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},KYc,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||{},[$ie]: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||{},[$ie]: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||{},[$ie]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=iJi(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=oJi(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=iJi(e);this._notificationHandlers.set(n,o=>{let s=oJi(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"&&XKi(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new fi(Bi.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 fi(Bi.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new fi(Bi.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 fi(Bi.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=Yxt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Hie(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 fi(Bi.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Hie(l.status))throw new fi(Bi.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=Yxt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Hie(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(sJi,"Vj");a(zJc,"Bj");YJc=y6r(aZi(),1),KJc=y6r(T9c(),1);a(JJc,"ps");K8r=class{static{a(this,"qz")}constructor(e){this._ajv=e??JJc()}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)}}},J8r=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},n7r,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},Xxt,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(ZJc,"tP");a(XJc,"aP");Z8r=class extends Y8r{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Jxt.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(cio,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(hio,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=Jxt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new J8r(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=zJc(this._capabilities,e)}setRequestHandler(e,r){let n=G8e(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(VL(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=i8e(Kxt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new fi(Bi.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=i8e(Ywt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new fi(Bi.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=i8e(r7r,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new fi(Bi.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){XJc(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&ZJc(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:RYc.includes(r)?r:tio,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"},QUr)}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},mio,r):this.request({method:"sampling/createMessage",params:e},n7r,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},Xxt,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},Xxt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new fi(Bi.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof fi?s:new fi(Bi.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},gio,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"})}},bio=Symbol.for("mcp.completable");a(aJi,"zz");a(eZc,"$E");(function(t){t.Completable="McpCompletable"})(cJi||(cJi={}));tZc=/^[A-Za-z0-9._-]{1,128}$/;a(rZc,"is");a(nZc,"ns");a(lJi,"Nz");X8r=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)}},e6r=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 Z8r(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new X8r(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(eW(V8r)),this.server.assertCanSetRequestHandler(eW(Kxt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(V8r,()=>({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=jFe(r.inputSchema);return o?nJi(o,{strictUnions:!0,pipeStrategy:"input"}):iZc})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=jFe(r.outputSchema);o&&(n.outputSchema=nJi(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Kxt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new fi(Bi.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new fi(Bi.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 fi(Bi.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new fi(Bi.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 fi&&n.code===Bi.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=jFe(e.inputSchema)??e.inputSchema,s=await jFr(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=HFr(c);throw new fi(Bi.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 fi(Bi.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=jFe(e.outputSchema),s=await jFr(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=HFr(c);throw new fi(Bi.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 fi(Bi.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(eW(W8r)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(W8r,async e=>{switch(e.params.ref.type){case"ref/prompt":return rJc(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return nJc(e),this.handleResourceCompletion(e,e.params.ref);default:throw new fi(Bi.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new fi(Bi.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new fi(Bi.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return HFe;let o=G8e(n.argsSchema)?.[e.params.argument.name];if(!aJi(o))return HFe;let s=eZc(o);if(!s)return HFe;let c=await s(e.params.argument.value,e.params.context);return dJi(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 HFe;throw new fi(Bi.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return HFe;let s=await o(e.params.argument.value,e.params.context);return dJi(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(eW(q8r)),this.server.assertCanSetRequestHandler(eW(j8r)),this.server.assertCanSetRequestHandler(eW(H8r)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(q8r,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(j8r,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(H8r,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new fi(Bi.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 fi(Bi.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(eW(G8r)),this.server.assertCanSetRequestHandler(eW($8r)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(G8r,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?oZc(r.argsSchema):void 0}))})),this.server.setRequestHandler($8r,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new fi(Bi.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new fi(Bi.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=jFe(n.argsSchema),s=await jFr(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=HFr(u);throw new fi(Bi.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:ive(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=ive(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 _k?l._def?.innerType:l;return aJi(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){lJi(e);let f={title:r,description:n,inputSchema:uJi(o),outputSchema:uJi(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"&&lJi(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=ive(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=ive(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(t6r(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!t6r(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()}},iZc={type:"object",properties:{}};a(Sio,"XE");a(Tio,"YE");a(t6r,"Oz");a(uJi,"QE");a(oZc,"os");a(eW,"l1");a(dJi,"JE");HFe={completion:{values:[],hasMore:!1}};a(sZc,"ts");a(aZc,"as");a(cZc,"ss");a(wr,"b");fJi=15e3,lZc=wr(()=>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}},r6r=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new Rxt;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 R1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new R1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await dZc(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=L8e(s);if(!(c instanceof R1)){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&&pJi(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 ${fJi}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},fJi,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,hk(`[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=GN(f)}catch(m){pk(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new mk("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 mk(`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"?bXi("transport_direct_connect"):e==="bad"?SXi("transport_direct_connect",r??"unknown"):tGc("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 R1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new mk("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&&lJi(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(iZc,"$e");a(oZc,"Qe");a(lJi,"GE");a(r6r,"nJ");a(sZc,"Xe");a(aZc,"Ye");a(cZc,"We");a(lZc,"Ge");a(Ywt,"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"})(uJi||(uJi={}));_Jh=Array(20).fill(0).map((t,e)=>" ".repeat(e)),vJh={" ":{"\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=$N(f)}catch(m){hk(`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"?xXi("transport_direct_connect"):e==="bad"?wXi("transport_direct_connect",r??"unknown"):aGc("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 R1("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&&pJi(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(uZc,"$e");a(dZc,"Qe");a(pJi,"GE");a(n6r,"nJ");a(fZc,"Xe");a(pZc,"Ye");a(hZc,"We");a(mZc,"Ge");a(Kwt,"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"})(hJi||(hJi={}));xJh=Array(20).fill(0).map((t,e)=>" ".repeat(e)),wJh={" ":{"\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}})(dJi||(dJi={}));(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"})(fJi||(fJi={}));(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"})(pJi||(pJi={}));(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"})(hJi||(hJi={}));a(Sio,"rW");iW=n7r.default.homedir(),i7r=n7r.default.tmpdir(),{env:ive}=ewt.default,uZc=a(t=>{let e=nf.default.join(iW,"Library");return{data:nf.default.join(e,"Application Support",t),config:nf.default.join(e,"Preferences",t),cache:nf.default.join(e,"Caches",t),log:nf.default.join(e,"Logs",t),temp:nf.default.join(i7r,t)}},"Oe"),dZc=a(t=>{let e=ive.APPDATA||nf.default.join(iW,"AppData","Roaming"),r=ive.LOCALAPPDATA||nf.default.join(iW,"AppData","Local");return{data:nf.default.join(r,t,"Data"),config:nf.default.join(e,t,"Config"),cache:nf.default.join(r,t,"Cache"),log:nf.default.join(r,t,"Log"),temp:nf.default.join(i7r,t)}},"De"),fZc=a(t=>{let e=nf.default.basename(iW);return{data:nf.default.join(ive.XDG_DATA_HOME||nf.default.join(iW,".local","share"),t),config:nf.default.join(ive.XDG_CONFIG_HOME||nf.default.join(iW,".config"),t),cache:nf.default.join(ive.XDG_CACHE_HOME||nf.default.join(iW,".cache"),t),log:nf.default.join(ive.XDG_STATE_HOME||nf.default.join(iW,".local","state"),t),temp:nf.default.join(i7r,e,t)}},"Fe");a(pZc,"Mz");CJh=pZc("claude-cli");a(hZc,"Ze");a(mZc,"wE");gZc=100,$Fr=[];a(AZc,"Le");yZc=[],mJi=null,bJh=Py(()=>process.argv.includes("--hard-fail"));a(Tio,"oW");Z_e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Iio=new Set,n6r=typeof process=="object"&&process?process:{},xio=a((t,e,r,n)=>{typeof n6r.emitWarning=="function"?n6r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),twt=globalThis.AbortController,gJi=globalThis.AbortSignal;if(typeof twt>"u"){gJi=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},twt=class{static{a(this,"tW")}constructor(){e()}signal=new gJi;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=n6r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,xio("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")}EZc=a(t=>!Iio.has(t),"Ae"),eW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),wio=a(t=>eW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?cve:null:null,"ME"),cve=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},i6r=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=wio(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]}},o6r=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;#E;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#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.#_(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:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!eW(r))throw TypeError("max option must be a nonnegative integer");let x=r?wio(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(_!==void 0&&typeof _!="function")throw TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,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=i6r.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&&!eW(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!eW(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=eW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!eW(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&&EZc("LRU_CACHE_UNBOUNDED")&&(Iio.add("LRU_CACHE_UNBOUNDED"),xio("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 cve(this.#e),r=new cve(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=Z_e.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?Z_e.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=Z_e.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.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#E");#d=a(()=>{},"#R");#L=a(()=>{},"#y");#_=a(()=>!1,"#N");#D(){let e=new cve(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(!eW(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!eW(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.#_(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.#_(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.#_(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.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(Z_e.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.#E&&this.#T){c.ttl=this.#E[r];let l=Z_e.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=Z_e.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.#E&&this.#k(),this.#E&&(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.#_(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.#_(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 twt,{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,E=!1)=>{let{aborted:_}=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),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__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:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(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,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),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 twt}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:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={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:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let D=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",D&&(_.returnedStale=!0)),D?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),P=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",P&&R&&(_.returnedStale=!0)),P?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.#_(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.#E&&this.#T&&(this.#E.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(_Zc,"LE");vZc=8192;a(Rio,"AE");AJi=_Zc(Rio,t=>t,50),Kwt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>vZc?Rio(t,e):AJi(t,e);return r.ok?r.value:null},{cache:AJi.cache}),Jwt=Py(()=>{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=DI().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){ru(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return Tio(t),"unknown"}}),TJh=Py(()=>{if(process.platform==="linux")try{let t=DI().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){ru(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),IJh=Py(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,o7r.release)()};try{let e=await(0,Pio.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}),xJh=Py(()=>{if(process.platform!=="darwin")return;let t=(0,o7r.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),P8e=Py(function(){switch(Jwt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),wJh=Py(function(){return(0,kio.join)(P8e(),"managed-settings.d")}),CZc=wr(()=>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()),bZc=wr(()=>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()),SZc=wr(()=>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:CZc(),filesystem:bZc(),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,s6r.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,s6r.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()),TZc=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],IZc=["normal","vim"],xZc=["auto","tmux","in-process"],wZc=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],RZc=["auto",...wZc],RJh=Jwt()==="macos"?"\u23FA":"\u25CF",s7r=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],kZc=[...s7r,"bubble"],PZc=kZc,kJh=wr(()=>Kno.enum(PZc)),PJh=wr(()=>Kno.enum(s7r)),DZc=["bash","powershell"],jFe=wr(()=>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(NZc,"Se");MZc=wr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=NZc();return G.discriminatedUnion("type",[t,e,r,n,o])}),OZc=wr(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(MZc()).describe("List of hooks to execute when the matcher matches")})),rwt=wr(()=>G.partialRecord(G.enum(ywt),G.array(OZc()))),DJh=wr(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),NJh=wr(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),$ve=wr(()=>G.literal("comms").optional().catch(void 0)),mW=wr(()=>G.number().int().positive()),LZc=wr(()=>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:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),BZc=wr(()=>G.boolean()),Dio=wr(()=>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:BZc().optional()})),FZc=wr(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:Dio().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),UZc=wr(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),QZc=wr(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),qZc=wr(()=>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:Dio().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),jZc=wr(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),HZc=wr(()=>G.object({type:G.literal("sdk"),name:G.string(),timeout:mW().optional(),alwaysLoad:G.boolean().optional()})),GZc=wr(()=>G.enum(["allow","ask","blocked"])),$Zc=wr(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),toolPermissions:G.record(G.string(),GZc()).optional()})),a6r=wr(()=>G.union([LZc(),FZc(),UZc(),QZc(),qZc(),jZc(),HZc(),$Zc()])),MJh=wr(()=>G.object({mcpServers:G.record(G.string(),a6r())})),Nio=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"]),VZc=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,WZc=/[^\u0020-\u007E]/;a(zZc,"pe");jN=wr(()=>G.string().startsWith("./")),ooe=wr(()=>jN().endsWith(".json")),yJi=wr(()=>G.union([jN().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")])),c6r=wr(()=>jN().endsWith(".md")),l6r=wr(()=>G.union([c6r(),jN()])),Mio=wr(()=>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=>!zZc(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/'})),a7r=wr(()=>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")})),YZc=wr(()=>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:a7r().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(EXc()).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.`)})),OJh=wr(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>rwt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),KZc=wr(()=>G.object({hooks:G.union([ooe().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(()=>rwt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([ooe().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(()=>rwt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),JZc=wr(()=>G.object({source:l6r().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'})),ZZc=wr(()=>G.object({commands:G.union([l6r().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(l6r().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(),JZc()).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")')])})),XZc=wr(()=>G.object({agents:G.union([c6r().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(c6r().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.")])})),eXc=wr(()=>G.object({skills:G.union([jN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),G.array(jN().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.")])})),Oio=wr(()=>G.object({outputStyles:G.union([jN().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(jN().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.")])})),Lio=wr(()=>G.object({themes:G.union([jN().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(jN().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.")])})),tXc=wr(()=>G.object({})),EJi=wr(()=>G.string().min(1)),rXc=wr(()=>G.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),nXc=wr(()=>G.object({mcpServers:G.union([ooe().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),yJi().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),a6r()).describe("MCP server configurations keyed by server name"),G.array(G.union([ooe().describe("Path to MCP servers configuration file"),yJi().describe("Path or URL to MCPB file"),G.record(G.string(),a6r()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),Bio=wr(()=>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()),iXc=wr(()=>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"),Bio()).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.")})),oXc=wr(()=>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(),Bio()).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.")})),_Ji=wr(()=>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(EJi()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(rXc(),EJi()).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")})),sXc=wr(()=>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).')})),aXc=wr(()=>G.array(sXc()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),Fio=wr(()=>G.object({monitors:G.union([ooe().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),aXc()]).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.")})),cXc=wr(()=>G.object({lspServers:G.union([ooe().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),_Ji()).describe("LSP server configurations keyed by server name"),G.array(G.union([ooe().describe("Path to LSP configuration file"),G.record(G.string(),_Ji()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),Uio=wr(()=>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")),lXc=wr(()=>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.")})),uXc=wr(()=>G.object({experimental:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,G.object({...Lio().partial().shape,...Fio().partial().shape,...Oio().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."))})),dXc=wr(()=>G.object({...YZc().shape,...KZc().partial().shape,...ZZc().partial().shape,...XZc().partial().shape,...eXc().partial().shape,...Oio().partial().shape,...Lio().partial().shape,...tXc().shape,...oXc().partial().shape,...nXc().partial().shape,...cXc().partial().shape,...Fio().partial().shape,...lXc().partial().shape,...iXc().partial().shape,...uXc().partial().shape})),nwt=wr(()=>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:Uio().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:Mio().refine(t=>!Nio.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(fXc()).describe("Plugin entries declared inline in settings.json"),owner:a7r().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).")])),VFr=wr(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),Qio=wr(()=>G.union([jN().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:Uio().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:VFr().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:VFr().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:VFr().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.')])),fXc=wr(()=>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:Qio().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)."})),pXc=wr(()=>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.`)})),hXc=wr(()=>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:pXc().optional().describe("Matchers that determine when the plugin is relevant.")})),mXc=wr(()=>dXc().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:Qio().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,hXc().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.`)})),gXc=wr(()=>G.object({name:G.string().min(1).refine(t=>!t.includes(" "))}));a(AXc,"z$$");LJh=wr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Mio(),version:G.string().optional().describe("Marketplace manifest version"),description:G.string().optional().describe("Human-readable description of this marketplace"),owner:a7r().describe("Marketplace maintainer or curator information"),plugins:G.array(G.unknown()).transform(AXc).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.")})),qio=wr(()=>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")),yXc=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,EXc=wr(()=>G.union([G.string().regex(yXc,"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)])),_Xc=wr(()=>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).")})),vXc=wr(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(qio(),_Xc()).describe("Map of plugin IDs to their installation metadata")})),CXc=wr(()=>G.enum(["managed","user","project","local"])),bXc=wr(()=>G.object({scope:CXc().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.")})),SXc=wr(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(qio(),G.array(bXc())).describe("Map of plugin IDs to arrays of installation entries")})),BJh=wr(()=>G.union([vXc(),SXc()])),TXc=wr(()=>G.object({source:nwt().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")})),FJh=wr(()=>G.record(G.string(),TXc())),IXc=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],xXc="https://json.schemastore.org/claude-code-settings.json",wXc=["autoMode","deepLink","voice","assistant","briefView"],UIt={},Zwt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>UIt,"shape"),permissionsShape:a(()=>UIt,"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(()=>UIt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>UIt,"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(jio,"Ez");a(RXc,"tE");a(kXc,"aE");a(PXc,"sE");a(DXc,"eE");vJi={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(X_e,"E9");Hio="workspace",UJh=`mcp__${Hio}__bash`,QJh=`mcp__${Hio}__web_fetch`;a(NXc,"A$$");a(MXc,"Jb");a(OXc,"I$$");a(LXc,"R$$");iwt={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(BXc,"Xb");a(FXc,"Yb");a(UXc,"Wb");a(Gio,"Gb");a(WFr,"bz");a(QXc,"P$$");a($io,"_z");zFr=wr(()=>G.string().superRefine((t,e)=>{let r=$io(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}})}})),qXc=wr(()=>G.record(G.string(),G.coerce.string()));a(Vio,"Hb");qJh=wr(()=>Vio(jio())),jXc=wr(()=>G.object({source:nwt().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")})),Wio=wr(()=>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=>WXi([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"'})),zio=wr(()=>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=>WXi([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"'})),HXc=wr(()=>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()})),CJi=["skills","agents","hooks","mcp"];a(GXc,"Kb");Vve=wr(()=>GXc(jio())),H9="https://code.claude.com/docs/en",$Xc=[{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:`${H9}/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:`${H9}/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:`${H9}/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:`${H9}/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:`${H9}/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:`${H9}/iam#working-directories`}}],VXc={permissions:`${H9}/iam#configuring-permissions`,env:`${H9}/settings#environment-variables`,hooks:`${H9}/hooks`};a(WXc,"qb");jJh=wr(()=>Vve().strict());a(bJi,"Vb");a(SJi,"Bb");a(zXc,"v$$");a(TJi,"zb");a(lve,"b9");a(IJi,"Nb");a(K8e,"d0");a(YXc,"C$$");KXc=new Set(ywt);a(JXc,"x$$");ZXc=[{key:"allowedMcpServers",schema:Wio},{key:"deniedMcpServers",schema:zio}];a(XXc,"f$$");a(Wve,"i1");xJi="com.anthropic.claudecode",u6r="HKLM\\SOFTWARE\\Policies\\ClaudeCode",d6r="HKCU\\SOFTWARE\\Policies\\ClaudeCode",ove="Settings",eel="/usr/bin/plutil",tel=["-convert","json","-o","-","--"],rel=5e3,wJi="/mnt/c/Windows/System32/reg.exe",owt="/mnt/c/Program Files/ClaudeCode";a(Kio,"XG");a(nel,"Zb");iel=null;a(HFe,"$5");a(oel,"Mb");a(sel,"Lb");rW=Object.freeze({settings:{},errors:[]}),Xio=null,eoo=null,too=!1,swt=null;a(ael,"l$$");a(cel,"bb");a(lel,"_b");a(uel,"kb");a(del,"Sb");a(YFr,"Cz");a(RJi,"jb");a(fel,"c$$");a(pel,"p$$");a(kJi,"Ab");a(hel,"d$$");a(PJi,"Ib");a(mel,"i$$");f6r=mel;a(gel,"n$$");Ael=gel,yel=Ael(),Eel=yel;a(_el,"o$$");vel=_el,Cel="[object Object]",bel=Function.prototype,Sel=Object.prototype,roo=bel.toString,Tel=Sel.hasOwnProperty,Iel=roo.call(Object);a(xel,"Q6$");wel=xel;a(Rel,"J6$");p6r=Rel;a(kel,"X6$");Pel=kel;a(Del,"Y6$");Nel=Del;a(noo,"hb");Mel=noo;a(Oel,"W6$");Lel=Oel,DJi=Math.max;a(Bel,"G6$");ioo=Bel;a(Fel,"U6$");Uel=Fel,Qel=Sxt?function(t,e){return Sxt(t,"toString",{configurable:!0,enumerable:!1,value:Uel(e),writable:!0})}:dXi,qel=Qel,jel=800,Hel=16,Gel=Date.now;a($el,"B6$");Vel=$el,Wel=Vel(qel),ooo=Wel;a(zel,"N6$");Yel=zel;a(Kel,"w6$");Jel=Kel;a(Zel,"O6$");Xel=Zel,etl=Xel(function(t,e,r,n){Mel(t,e,r,n)}),oW=etl;a(ttl,"F6$");rtl=ttl;a(ntl,"Z6$");itl=ntl;a(otl,"M6$");stl=otl,NJi=cW?cW.isConcatSpreadable:void 0;a(atl,"L6$");ctl=atl;a(soo,"$_");ltl=soo;a(utl,"j6$");dtl=utl;a(ftl,"A6$");ptl=ftl,htl=ptl(function(t,e){return t==null?{}:stl(t,e)}),KFr=htl,mtl="remote-settings.json",JFr=null;a(Atl,"b6$");a(ytl,"_6$");a(Etl,"W_");a(c7r,"fz");a(_tl,"S6$");a(coo,"U_");a(ZFr,"xz");a(vtl,"v6$");a(awt,"HG");a(loo,"H_");a(uoo,"K_");a(doo,"q_");a(foo,"V_");a(Ctl,"C6$");a(MJi,"G_");a(btl,"T6$");a(cwt,"Y5");a(Stl,"x6$");a(poo,"B_");a(Ttl,"y6$");a(Itl,"f6$");a(xtl,"z_");a(wtl,"g6$");a(hoo,"N_");a(Rtl,"h6$");a(ktl,"u6$");a(sW,"o1");XFr=!1;a(Ptl,"m6$");a(Dtl,"l6$");a(Ntl,"c6$");a(Mtl,"w_");a(Otl,"O_");Ltl={user:"userSettings",project:"projectSettings",local:"localSettings"},OJi={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},Btl=["user","project","local"],Ftl=new Set(["bypassPermissions","auto","acceptEdits"]),Utl=new Set(["project"]);a(Qtl,"o6$");a(qtl,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(jtl,"LA$");a(Htl,"G4$");a(Gtl,"U4$");a($tl,"H4$");a(moo,"b_");a(h6r,"uz");a(m6r,"mz");Vtl=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(lwt,"KG");a(Wtl,"q4$");a(ztl,"jA$");a(Ytl,"AA$");a(Ktl,"IA$");a(Jtl,"RA$");a(Ztl,"PA$");a(Xtl,"EA$");a(erl,"bA$");a(trl,"_A$");a(rrl,"kA$");a(nrl,"SA$");a(LJi,"M_");a(irl,"V4$");a(orl,"vA$");a(srl,"CA$");a(goo,"__");a(bk,"J4");a(Aoo,"k_");a(BJi,"L_");a(g6r,"lz");a(arl,"B4$");a(FJi,"j_");a(yoo,"S_");a(crl,"z4$");a(Eoo,"v_");a(lrl,"N4$");a(url,"w4$");a(drl,"O4$");a(frl,"D4$");a(prl,"F4$");a(hrl,"Z4$");a(mrl,"M4$");a(UJi,"A_")});var Lso=I((O7r,Oso)=>{p();O7r.createWatcher=W6e()("vscode-policy-watcher");if(require.main===Oso){let t=process.platform;O7r.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var yao=I(H7r=>{p();var Aao="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");H7r.encode=function(t){if(0<=t&&t{p();var Eao=yao(),G7r=5,_ao=1<>1;return e?-r:r}a(eil,"fromVLQSigned");$7r.encode=a(function(e){var r="",n,o=Xnl(e);do n=o&vao,o>>>=G7r,o>0&&(n|=Cao),r+=Eao.encode(n);while(o>0);return r},"base64VLQ_encode");$7r.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=Eao.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&Cao),u&=vao,s=s+(u<{p();function til(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(til,"getArg");p_.getArg=til;var bao=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,ril=/^data:.+\,.+$/;function I6e(t){var e=t.match(bao);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(I6e,"urlParse");p_.urlParse=I6e;function lCe(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(lCe,"urlGenerate");p_.urlGenerate=lCe;function W7r(t){var e=t,r=I6e(t);if(r){if(!r.path)return t;e=r.path}for(var n=p_.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,lCe(r)):e}a(W7r,"normalize");p_.normalize=W7r;function Sao(t,e){t===""&&(t="."),e===""&&(e=".");var r=I6e(e),n=I6e(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),lCe(r);if(r||e.match(ril))return e;if(n&&!n.host&&!n.path)return n.host=e,lCe(n);var o=e.charAt(0)==="/"?e:W7r(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,lCe(n)):o}a(Sao,"join");p_.join=Sao;p_.isAbsolute=function(t){return t.charAt(0)==="/"||bao.test(t)};function nil(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(nil,"relative");p_.relative=nil;var Tao=(function(){var t=Object.create(null);return!("__proto__"in t)})();function Iao(t){return t}a(Iao,"identity");function iil(t){return xao(t)?"$"+t:t}a(iil,"toSetString");p_.toSetString=Tao?Iao:iil;function oil(t){return xao(t)?t.slice(1):t}a(oil,"fromSetString");p_.fromSetString=Tao?Iao:oil;function xao(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(xao,"isProtoString");function sil(t,e,r){var n=uCe(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:uCe(t.name,e.name)}a(sil,"compareByOriginalPositions");p_.compareByOriginalPositions=sil;function ail(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=uCe(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:uCe(t.name,e.name)}a(ail,"compareByGeneratedPositionsDeflated");p_.compareByGeneratedPositionsDeflated=ail;function uCe(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(uCe,"strcmp");function cil(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=uCe(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:uCe(t.name,e.name)}a(cil,"compareByGeneratedPositionsInflated");p_.compareByGeneratedPositionsInflated=cil;function lil(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(lil,"parseSourceMapInput");p_.parseSourceMapInput=lil;function uil(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=I6e(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=Sao(lCe(n),e)}return W7r(e)}a(uil,"computeSourceURL");p_.computeSourceURL=uil});var K7r=I(wao=>{p();var z7r=dCe(),Y7r=Object.prototype.hasOwnProperty,hoe=typeof Map<"u";function eU(){this._array=[],this._set=hoe?new Map:Object.create(null)}a(eU,"ArraySet");eU.fromArray=a(function(e,r){for(var n=new eU,o=0,s=e.length;o=0)return r}else{var n=z7r.toSetString(e);if(Y7r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");eU.prototype.at=a(function(e){if(e>=0&&e{p();var Rao=dCe();function dil(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Rao.compareByGeneratedPositionsInflated(t,e)<=0}a(dil,"generatedPositionAfter");function bkt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(bkt,"MappingList");bkt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");bkt.prototype.add=a(function(e){dil(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");bkt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Rao.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");kao.MappingList=bkt});var J7r=I(Dao=>{p();var x6e=V7r(),qm=dCe(),Skt=K7r().ArraySet,fil=Pao().MappingList;function xk(t){t||(t={}),this._file=qm.getArg(t,"file",null),this._sourceRoot=qm.getArg(t,"sourceRoot",null),this._skipValidation=qm.getArg(t,"skipValidation",!1),this._sources=new Skt,this._names=new Skt,this._mappings=new fil,this._sourcesContents=null}a(xk,"SourceMapGenerator");xk.prototype._version=3;xk.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new xk({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=qm.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=qm.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");xk.prototype.addMapping=a(function(e){var r=qm.getArg(e,"generated"),n=qm.getArg(e,"original",null),o=qm.getArg(e,"source",null),s=qm.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");xk.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=qm.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[qm.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[qm.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");xk.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=qm.relative(s,o));var c=new Skt,l=new Skt;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=qm.join(n,u.source)),s!=null&&(u.source=qm.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=qm.join(n,u)),s!=null&&(u=qm.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");xk.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");xk.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(!qm.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=x6e.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=x6e.encode(h-c),c=h,u+=x6e.encode(d.originalLine-1-o),o=d.originalLine-1,u+=x6e.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=x6e.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");xk.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=qm.relative(r,n));var o=qm.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");xk.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");xk.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");Dao.SourceMapGenerator=xk});var Nao=I(moe=>{p();moe.GREATEST_LOWER_BOUND=1;moe.LEAST_UPPER_BOUND=2;function Z7r(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?Z7r(c,e,r,n,o,s):s==moe.LEAST_UPPER_BOUND?e1?Z7r(t,c,r,n,o,s):s==moe.LEAST_UPPER_BOUND?c:t<0?-1:t}a(Z7r,"recursiveSearch");moe.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=Z7r(-1,r.length,e,r,n,o||moe.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 Oao=I(Mao=>{p();function X7r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a(X7r,"swap");function pil(t,e){return Math.round(t+Math.random()*(e-t))}a(pil,"randomIntInRange");function eQr(t,e,r,n){if(r{p();var jn=dCe(),tQr=Nao(),fCe=K7r().ArraySet,hil=V7r(),w6e=Oao().quickSort;function Id(t,e){var r=t;return typeof t=="string"&&(r=jn.parseSourceMapInput(t)),r.sections!=null?new JN(r,e):new My(r,e)}a(Id,"SourceMapConsumer");Id.fromSourceMap=function(t,e){return My.fromSourceMap(t,e)};Id.prototype._version=3;Id.prototype.__generatedMappings=null;Object.defineProperty(Id.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Id.prototype.__originalMappings=null;Object.defineProperty(Id.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Id.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Id.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Id.GENERATED_ORDER=1;Id.ORIGINAL_ORDER=2;Id.GREATEST_LOWER_BOUND=1;Id.LEAST_UPPER_BOUND=2;Id.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Id.GENERATED_ORDER,c;switch(s){case Id.GENERATED_ORDER:c=this._generatedMappings;break;case Id.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=jn.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");Id.prototype.allGeneratedPositionsFor=a(function(e){var r=jn.getArg(e,"line"),n={source:jn.getArg(e,"source"),originalLine:r,originalColumn:jn.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",jn.compareByOriginalPositions,tQr.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:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");Tkt.SourceMapConsumer=Id;function My(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sources"),s=jn.getArg(r,"names",[]),c=jn.getArg(r,"sourceRoot",null),l=jn.getArg(r,"sourcesContent",null),u=jn.getArg(r,"mappings"),d=jn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=jn.normalize(c)),o=o.map(String).map(jn.normalize).map(function(f){return c&&jn.isAbsolute(c)&&jn.isAbsolute(f)?jn.relative(c,f):f}),this._names=fCe.fromArray(s.map(String),!0),this._sources=fCe.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return jn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(My,"BasicSourceMapConsumer");My.prototype=Object.create(Id.prototype);My.prototype.consumer=Id;My.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=jn.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r1&&(y.source=l+_[1],l+=_[1],y.originalLine=s+_[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=c+_[3],c=y.originalColumn,_.length>4&&(y.name=u+_[4],u+=_[4])),A.push(y),typeof y.originalLine=="number"&&g.push(y)}w6e(A,jn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,w6e(g,jn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");My.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 tQr.search(e,r,s,c)},"SourceMapConsumer_findMapping");My.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=jn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=jn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=jn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:jn.getArg(o,"originalLine",null),column:jn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");My.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");My.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=jn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=jn.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");My.prototype.generatedPositionFor=a(function(e){var r=jn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:jn.getArg(e,"line"),originalColumn:jn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",jn.compareByOriginalPositions,jn.getArg(e,"bias",Id.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:jn.getArg(s,"generatedLine",null),column:jn.getArg(s,"generatedColumn",null),lastColumn:jn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");Tkt.BasicSourceMapConsumer=My;function JN(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new fCe,this._names=new fCe;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=jn.getArg(c,"offset"),u=jn.getArg(l,"line"),d=jn.getArg(l,"column");if(u{p();var mil=J7r().SourceMapGenerator,Ikt=dCe(),gil=/(\r?\n)/,Ail=10,pCe="$$$isSourceNode$$$";function BI(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[pCe]=!0,n!=null&&this.add(n)}a(BI,"SourceNode");BI.fromStringWithSourceMap=a(function(e,r,n){var o=new BI,s=e.split(gil),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[pCe]||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");BI.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();xkt.SourceMapGenerator=J7r().SourceMapGenerator;xkt.SourceMapConsumer=Bao().SourceMapConsumer;xkt.SourceNode=Uao().SourceNode});var jao=I((Wmm,qao)=>{p();var yil=Object.prototype.toString,rQr=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Eil(t){return yil.call(t).slice(8,-1)==="ArrayBuffer"}a(Eil,"isArrayBuffer");function _il(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 rQr?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(_il,"fromArrayBuffer");function vil(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return rQr?Buffer.from(t,e):new Buffer(t,e)}a(vil,"fromString");function Cil(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return Eil(t)?_il(t,e,r):typeof t=="string"?vil(t,e):rQr?Buffer.from(t):new Buffer(t)}a(Cil,"bufferFrom");qao.exports=Cil});var Kao=I((Aoe,sQr)=>{p();var bil=Qao().SourceMapConsumer,nQr=require("path"),JL;try{JL=require("fs"),(!JL.existsSync||!JL.readFileSync)&&(JL=null)}catch{}var Sil=jao();function Hao(t,e){return t.require(e)}a(Hao,"dynamicRequire");var Gao=!1,$ao=!1,iQr=!1,R6e="auto",goe={},k6e={},Til=/^data:application\/json[^,]+base64,/,CW=[],bW=[];function aQr(){return R6e==="browser"?!0:R6e==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(aQr,"isInBrowser");function Iil(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(Iil,"hasGlobalProcessEventEmitter");function xil(){return typeof process=="object"&&process!==null?process.version:""}a(xil,"globalProcessVersion");function wil(){if(typeof process=="object"&&process!==null)return process.stderr}a(wil,"globalProcessStderr");function Ril(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(Ril,"globalProcessExit");function wkt(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(Pil,"CallSiteToString");function Vao(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=Pil,e}a(Vao,"cloneCallSite");function zao(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(xil())?0:62;n===1&&o>c&&!aQr()&&!t.isEval()&&(o-=c);var l=uQr({source:r,line:n,column:o});e.curPosition=l,t=Vao(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=Wao(d),t=Vao(t),t.getEvalOrigin=function(){return d}),t}a(zao,"wrapCallSite");function Dil(t,e){iQr&&(goe={},k6e={});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 `+zao(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(Dil,"prepareStackTrace");function Yao(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=goe[r];if(!s&&JL&&JL.existsSync(r))try{s=JL.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}})(mJi||(mJi={}));(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"})(gJi||(gJi={}));(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"})(AJi||(AJi={}));(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"})(yJi||(yJi={}));a(wio,"rW");oW=i7r.default.homedir(),o7r=i7r.default.tmpdir(),{env:ove}=twt.default,gZc=a(t=>{let e=nf.default.join(oW,"Library");return{data:nf.default.join(e,"Application Support",t),config:nf.default.join(e,"Preferences",t),cache:nf.default.join(e,"Caches",t),log:nf.default.join(e,"Logs",t),temp:nf.default.join(o7r,t)}},"Oe"),AZc=a(t=>{let e=ove.APPDATA||nf.default.join(oW,"AppData","Roaming"),r=ove.LOCALAPPDATA||nf.default.join(oW,"AppData","Local");return{data:nf.default.join(r,t,"Data"),config:nf.default.join(e,t,"Config"),cache:nf.default.join(r,t,"Cache"),log:nf.default.join(r,t,"Log"),temp:nf.default.join(o7r,t)}},"De"),yZc=a(t=>{let e=nf.default.basename(oW);return{data:nf.default.join(ove.XDG_DATA_HOME||nf.default.join(oW,".local","share"),t),config:nf.default.join(ove.XDG_CONFIG_HOME||nf.default.join(oW,".config"),t),cache:nf.default.join(ove.XDG_CACHE_HOME||nf.default.join(oW,".cache"),t),log:nf.default.join(ove.XDG_STATE_HOME||nf.default.join(oW,".local","state"),t),temp:nf.default.join(o7r,e,t)}},"Fe");a(EZc,"Mz");RJh=EZc("claude-cli");a(_Zc,"Ze");a(vZc,"wE");CZc=100,VFr=[];a(bZc,"Le");SZc=[],EJi=null,kJh=Py(()=>process.argv.includes("--hard-fail"));a(Rio,"oW");X_e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,kio=new Set,i6r=typeof process=="object"&&process?process:{},Pio=a((t,e,r,n)=>{typeof i6r.emitWarning=="function"?i6r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),rwt=globalThis.AbortController,_Ji=globalThis.AbortSignal;if(typeof rwt>"u"){_Ji=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},rwt=class{static{a(this,"tW")}constructor(){e()}signal=new _Ji;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=i6r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Pio("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")}TZc=a(t=>!kio.has(t),"Ae"),tW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),Dio=a(t=>tW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?lve:null:null,"ME"),lve=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},o6r=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=Dio(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]}},s6r=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;#E;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#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.#_(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:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!tW(r))throw TypeError("max option must be a nonnegative integer");let x=r?Dio(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(_!==void 0&&typeof _!="function")throw TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,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=o6r.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&&!tW(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!tW(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=tW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!tW(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&&TZc("LRU_CACHE_UNBOUNDED")&&(kio.add("LRU_CACHE_UNBOUNDED"),Pio("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 lve(this.#e),r=new lve(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=X_e.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?X_e.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=X_e.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.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#E");#d=a(()=>{},"#R");#L=a(()=>{},"#y");#_=a(()=>!1,"#N");#D(){let e=new lve(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(!tW(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!tW(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.#_(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.#_(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.#_(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.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(X_e.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.#E&&this.#T){c.ttl=this.#E[r];let l=X_e.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=X_e.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.#E&&this.#k(),this.#E&&(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.#_(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.#_(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 rwt,{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,E=!1)=>{let{aborted:_}=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),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__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:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(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,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),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 rwt}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:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={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:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let D=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",D&&(_.returnedStale=!0)),D?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),P=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",P&&R&&(_.returnedStale=!0)),P?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.#_(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.#E&&this.#T&&(this.#E.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(IZc,"LE");xZc=8192;a(Nio,"AE");vJi=IZc(Nio,t=>t,50),Jwt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>xZc?Nio(t,e):vJi(t,e);return r.ok?r.value:null},{cache:vJi.cache}),Zwt=Py(()=>{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=MI().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){ru(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return Rio(t),"unknown"}}),DJh=Py(()=>{if(process.platform==="linux")try{let t=MI().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){ru(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),NJh=Py(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,s7r.release)()};try{let e=await(0,Oio.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}),MJh=Py(()=>{if(process.platform!=="darwin")return;let t=(0,s7r.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),N8e=Py(function(){switch(Zwt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),OJh=Py(function(){return(0,Mio.join)(N8e(),"managed-settings.d")}),wZc=wr(()=>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()),RZc=wr(()=>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()),kZc=wr(()=>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:wZc(),filesystem:RZc(),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,a6r.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,a6r.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()),PZc=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],DZc=["normal","vim"],NZc=["auto","tmux","in-process"],MZc=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],OZc=["auto",...MZc],LJh=Zwt()==="macos"?"\u23FA":"\u25CF",a7r=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],LZc=[...a7r,"bubble"],BZc=LZc,BJh=wr(()=>eio.enum(BZc)),FJh=wr(()=>eio.enum(a7r)),FZc=["bash","powershell"],GFe=wr(()=>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(UZc,"Se");QZc=wr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=UZc();return G.discriminatedUnion("type",[t,e,r,n,o])}),qZc=wr(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(QZc()).describe("List of hooks to execute when the matcher matches")})),nwt=wr(()=>G.partialRecord(G.enum(Ewt),G.array(qZc()))),UJh=wr(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),QJh=wr(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),Vve=wr(()=>G.literal("comms").optional().catch(void 0)),gW=wr(()=>G.number().int().positive()),jZc=wr(()=>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:gW().optional(),alwaysLoad:G.boolean().optional(),role:Vve()})),HZc=wr(()=>G.boolean()),Lio=wr(()=>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:HZc().optional()})),GZc=wr(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:Lio().optional(),timeout:gW().optional(),alwaysLoad:G.boolean().optional(),role:Vve()})),$Zc=wr(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional(),timeout:gW().optional(),alwaysLoad:G.boolean().optional(),role:Vve()})),VZc=wr(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional(),timeout:gW().optional(),alwaysLoad:G.boolean().optional(),role:Vve()})),WZc=wr(()=>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:Lio().optional(),timeout:gW().optional(),alwaysLoad:G.boolean().optional(),role:Vve()})),zZc=wr(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),timeout:gW().optional(),alwaysLoad:G.boolean().optional(),role:Vve()})),YZc=wr(()=>G.object({type:G.literal("sdk"),name:G.string(),timeout:gW().optional(),alwaysLoad:G.boolean().optional()})),KZc=wr(()=>G.enum(["allow","ask","blocked"])),JZc=wr(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string(),timeout:gW().optional(),alwaysLoad:G.boolean().optional(),toolPermissions:G.record(G.string(),KZc()).optional()})),c6r=wr(()=>G.union([jZc(),GZc(),$Zc(),VZc(),WZc(),zZc(),YZc(),JZc()])),qJh=wr(()=>G.object({mcpServers:G.record(G.string(),c6r())})),Bio=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"]),ZZc=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,XZc=/[^\u0020-\u007E]/;a(eXc,"pe");HN=wr(()=>G.string().startsWith("./")),ooe=wr(()=>HN().endsWith(".json")),CJi=wr(()=>G.union([HN().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")])),l6r=wr(()=>HN().endsWith(".md")),u6r=wr(()=>G.union([l6r(),HN()])),Fio=wr(()=>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=>!eXc(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/'})),c7r=wr(()=>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")})),tXc=wr(()=>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:c7r().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(TXc()).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.`)})),jJh=wr(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>nwt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),rXc=wr(()=>G.object({hooks:G.union([ooe().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(()=>nwt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([ooe().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(()=>nwt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),nXc=wr(()=>G.object({source:u6r().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'})),iXc=wr(()=>G.object({commands:G.union([u6r().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(u6r().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(),nXc()).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")')])})),oXc=wr(()=>G.object({agents:G.union([l6r().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(l6r().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.")])})),sXc=wr(()=>G.object({skills:G.union([HN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),G.array(HN().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.")])})),Uio=wr(()=>G.object({outputStyles:G.union([HN().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(HN().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.")])})),Qio=wr(()=>G.object({themes:G.union([HN().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(HN().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.")])})),aXc=wr(()=>G.object({})),bJi=wr(()=>G.string().min(1)),cXc=wr(()=>G.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),lXc=wr(()=>G.object({mcpServers:G.union([ooe().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),CJi().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),c6r()).describe("MCP server configurations keyed by server name"),G.array(G.union([ooe().describe("Path to MCP servers configuration file"),CJi().describe("Path or URL to MCPB file"),G.record(G.string(),c6r()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),qio=wr(()=>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()),uXc=wr(()=>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"),qio()).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.")})),dXc=wr(()=>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(),qio()).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.")})),SJi=wr(()=>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(bJi()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(cXc(),bJi()).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")})),fXc=wr(()=>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).')})),pXc=wr(()=>G.array(fXc()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),jio=wr(()=>G.object({monitors:G.union([ooe().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),pXc()]).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.")})),hXc=wr(()=>G.object({lspServers:G.union([ooe().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),SJi()).describe("LSP server configurations keyed by server name"),G.array(G.union([ooe().describe("Path to LSP configuration file"),G.record(G.string(),SJi()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),Hio=wr(()=>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")),mXc=wr(()=>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.")})),gXc=wr(()=>G.object({experimental:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,G.object({...Qio().partial().shape,...jio().partial().shape,...Uio().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."))})),AXc=wr(()=>G.object({...tXc().shape,...rXc().partial().shape,...iXc().partial().shape,...oXc().partial().shape,...sXc().partial().shape,...Uio().partial().shape,...Qio().partial().shape,...aXc().shape,...dXc().partial().shape,...lXc().partial().shape,...hXc().partial().shape,...jio().partial().shape,...mXc().partial().shape,...uXc().partial().shape,...gXc().partial().shape})),iwt=wr(()=>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:Hio().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:Fio().refine(t=>!Bio.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(yXc()).describe("Plugin entries declared inline in settings.json"),owner:c7r().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).")])),WFr=wr(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),Gio=wr(()=>G.union([HN().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:Hio().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:WFr().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:WFr().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:WFr().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.')])),yXc=wr(()=>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:Gio().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)."})),EXc=wr(()=>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.`)})),_Xc=wr(()=>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:EXc().optional().describe("Matchers that determine when the plugin is relevant.")})),vXc=wr(()=>AXc().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:Gio().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,_Xc().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.`)})),CXc=wr(()=>G.object({name:G.string().min(1).refine(t=>!t.includes(" "))}));a(bXc,"z$$");HJh=wr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Fio(),version:G.string().optional().describe("Marketplace manifest version"),description:G.string().optional().describe("Human-readable description of this marketplace"),owner:c7r().describe("Marketplace maintainer or curator information"),plugins:G.array(G.unknown()).transform(bXc).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.")})),$io=wr(()=>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")),SXc=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,TXc=wr(()=>G.union([G.string().regex(SXc,"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)])),IXc=wr(()=>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).")})),xXc=wr(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record($io(),IXc()).describe("Map of plugin IDs to their installation metadata")})),wXc=wr(()=>G.enum(["managed","user","project","local"])),RXc=wr(()=>G.object({scope:wXc().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.")})),kXc=wr(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record($io(),G.array(RXc())).describe("Map of plugin IDs to arrays of installation entries")})),GJh=wr(()=>G.union([xXc(),kXc()])),PXc=wr(()=>G.object({source:iwt().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")})),$Jh=wr(()=>G.record(G.string(),PXc())),DXc=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],NXc="https://json.schemastore.org/claude-code-settings.json",MXc=["autoMode","deepLink","voice","assistant","briefView"],QIt={},Xwt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>QIt,"shape"),permissionsShape:a(()=>QIt,"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(()=>QIt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>QIt,"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(Vio,"Ez");a(OXc,"tE");a(LXc,"aE");a(BXc,"sE");a(FXc,"eE");TJi={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(eve,"E9");Wio="workspace",VJh=`mcp__${Wio}__bash`,WJh=`mcp__${Wio}__web_fetch`;a(UXc,"A$$");a(QXc,"Jb");a(qXc,"I$$");a(jXc,"R$$");owt={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(HXc,"Xb");a(GXc,"Yb");a($Xc,"Wb");a(zio,"Gb");a(zFr,"bz");a(VXc,"P$$");a(Yio,"_z");YFr=wr(()=>G.string().superRefine((t,e)=>{let r=Yio(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}})}})),WXc=wr(()=>G.record(G.string(),G.coerce.string()));a(Kio,"Hb");zJh=wr(()=>Kio(Vio())),zXc=wr(()=>G.object({source:iwt().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")})),Jio=wr(()=>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=>JXi([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"'})),Zio=wr(()=>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=>JXi([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"'})),YXc=wr(()=>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()})),IJi=["skills","agents","hooks","mcp"];a(KXc,"Kb");Wve=wr(()=>KXc(Vio())),G9="https://code.claude.com/docs/en",JXc=[{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:`${G9}/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:`${G9}/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:`${G9}/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:`${G9}/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:`${G9}/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:`${G9}/iam#working-directories`}}],ZXc={permissions:`${G9}/iam#configuring-permissions`,env:`${G9}/settings#environment-variables`,hooks:`${G9}/hooks`};a(XXc,"qb");YJh=wr(()=>Wve().strict());a(xJi,"Vb");a(wJi,"Bb");a(eel,"v$$");a(RJi,"zb");a(uve,"b9");a(kJi,"Nb");a(Z8e,"d0");a(tel,"C$$");rel=new Set(Ewt);a(nel,"x$$");iel=[{key:"allowedMcpServers",schema:Jio},{key:"deniedMcpServers",schema:Zio}];a(oel,"f$$");a(zve,"i1");PJi="com.anthropic.claudecode",d6r="HKLM\\SOFTWARE\\Policies\\ClaudeCode",f6r="HKCU\\SOFTWARE\\Policies\\ClaudeCode",sve="Settings",sel="/usr/bin/plutil",ael=["-convert","json","-o","-","--"],cel=5e3,DJi="/mnt/c/Windows/System32/reg.exe",swt="/mnt/c/Program Files/ClaudeCode";a(eoo,"XG");a(lel,"Zb");uel=null;a($Fe,"$5");a(del,"Mb");a(fel,"Lb");nW=Object.freeze({settings:{},errors:[]}),noo=null,ioo=null,ooo=!1,awt=null;a(pel,"l$$");a(hel,"bb");a(mel,"_b");a(gel,"kb");a(Ael,"Sb");a(KFr,"Cz");a(NJi,"jb");a(yel,"c$$");a(Eel,"p$$");a(MJi,"Ab");a(_el,"d$$");a(OJi,"Ib");a(vel,"i$$");p6r=vel;a(Cel,"n$$");bel=Cel,Sel=bel(),Tel=Sel;a(Iel,"o$$");xel=Iel,wel="[object Object]",Rel=Function.prototype,kel=Object.prototype,soo=Rel.toString,Pel=kel.hasOwnProperty,Del=soo.call(Object);a(Nel,"Q6$");Mel=Nel;a(Oel,"J6$");h6r=Oel;a(Lel,"X6$");Bel=Lel;a(Fel,"Y6$");Uel=Fel;a(aoo,"hb");Qel=aoo;a(qel,"W6$");jel=qel,LJi=Math.max;a(Hel,"G6$");coo=Hel;a(Gel,"U6$");$el=Gel,Vel=Txt?function(t,e){return Txt(t,"toString",{configurable:!0,enumerable:!1,value:$el(e),writable:!0})}:mXi,Wel=Vel,zel=800,Yel=16,Kel=Date.now;a(Jel,"B6$");Zel=Jel,Xel=Zel(Wel),loo=Xel;a(etl,"N6$");ttl=etl;a(rtl,"w6$");ntl=rtl;a(itl,"O6$");otl=itl,stl=otl(function(t,e,r,n){Qel(t,e,r,n)}),sW=stl;a(atl,"F6$");ctl=atl;a(ltl,"Z6$");utl=ltl;a(dtl,"M6$");ftl=dtl,BJi=lW?lW.isConcatSpreadable:void 0;a(ptl,"L6$");htl=ptl;a(uoo,"$_");mtl=uoo;a(gtl,"j6$");Atl=gtl;a(ytl,"A6$");Etl=ytl,_tl=Etl(function(t,e){return t==null?{}:ftl(t,e)}),JFr=_tl,vtl="remote-settings.json",ZFr=null;a(btl,"b6$");a(Stl,"_6$");a(Ttl,"W_");a(l7r,"fz");a(Itl,"S6$");a(foo,"U_");a(XFr,"xz");a(xtl,"v6$");a(cwt,"HG");a(poo,"H_");a(hoo,"K_");a(moo,"q_");a(goo,"V_");a(wtl,"C6$");a(FJi,"G_");a(Rtl,"T6$");a(lwt,"Y5");a(ktl,"x6$");a(Aoo,"B_");a(Ptl,"y6$");a(Dtl,"f6$");a(Ntl,"z_");a(Mtl,"g6$");a(yoo,"N_");a(Otl,"h6$");a(Ltl,"u6$");a(aW,"o1");e8r=!1;a(Btl,"m6$");a(Ftl,"l6$");a(Utl,"c6$");a(Qtl,"w_");a(qtl,"O_");jtl={user:"userSettings",project:"projectSettings",local:"localSettings"},UJi={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},Htl=["user","project","local"],Gtl=new Set(["bypassPermissions","auto","acceptEdits"]),$tl=new Set(["project"]);a(Vtl,"o6$");a(Wtl,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(ztl,"LA$");a(Ytl,"G4$");a(Ktl,"U4$");a(Jtl,"H4$");a(Eoo,"b_");a(m6r,"uz");a(g6r,"mz");Ztl=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(uwt,"KG");a(Xtl,"q4$");a(erl,"jA$");a(trl,"AA$");a(rrl,"IA$");a(nrl,"RA$");a(irl,"PA$");a(orl,"EA$");a(srl,"bA$");a(arl,"_A$");a(crl,"kA$");a(lrl,"SA$");a(QJi,"M_");a(url,"V4$");a(drl,"vA$");a(frl,"CA$");a(_oo,"__");a(Sk,"J4");a(voo,"k_");a(qJi,"L_");a(A6r,"lz");a(prl,"B4$");a(jJi,"j_");a(Coo,"S_");a(hrl,"z4$");a(boo,"v_");a(mrl,"N4$");a(grl,"w4$");a(Arl,"O4$");a(yrl,"D4$");a(Erl,"F4$");a(_rl,"Z4$");a(vrl,"M4$");a(HJi,"A_")});var Qso=I((L7r,Uso)=>{p();L7r.createWatcher=Y6e()("vscode-policy-watcher");if(require.main===Uso){let t=process.platform;L7r.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var Cao=I(G7r=>{p();var vao="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");G7r.encode=function(t){if(0<=t&&t{p();var bao=Cao(),$7r=5,Sao=1<<$7r,Tao=Sao-1,Iao=Sao;function oil(t){return t<0?(-t<<1)+1:(t<<1)+0}a(oil,"toVLQSigned");function sil(t){var e=(t&1)===1,r=t>>1;return e?-r:r}a(sil,"fromVLQSigned");V7r.encode=a(function(e){var r="",n,o=oil(e);do n=o&Tao,o>>>=$7r,o>0&&(n|=Iao),r+=bao.encode(n);while(o>0);return r},"base64VLQ_encode");V7r.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=bao.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&Iao),u&=Tao,s=s+(u<{p();function ail(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(ail,"getArg");p_.getArg=ail;var xao=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,cil=/^data:.+\,.+$/;function w6e(t){var e=t.match(xao);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(w6e,"urlParse");p_.urlParse=w6e;function uCe(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(uCe,"urlGenerate");p_.urlGenerate=uCe;function z7r(t){var e=t,r=w6e(t);if(r){if(!r.path)return t;e=r.path}for(var n=p_.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,uCe(r)):e}a(z7r,"normalize");p_.normalize=z7r;function wao(t,e){t===""&&(t="."),e===""&&(e=".");var r=w6e(e),n=w6e(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),uCe(r);if(r||e.match(cil))return e;if(n&&!n.host&&!n.path)return n.host=e,uCe(n);var o=e.charAt(0)==="/"?e:z7r(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,uCe(n)):o}a(wao,"join");p_.join=wao;p_.isAbsolute=function(t){return t.charAt(0)==="/"||xao.test(t)};function lil(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(lil,"relative");p_.relative=lil;var Rao=(function(){var t=Object.create(null);return!("__proto__"in t)})();function kao(t){return t}a(kao,"identity");function uil(t){return Pao(t)?"$"+t:t}a(uil,"toSetString");p_.toSetString=Rao?kao:uil;function dil(t){return Pao(t)?t.slice(1):t}a(dil,"fromSetString");p_.fromSetString=Rao?kao:dil;function Pao(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(Pao,"isProtoString");function fil(t,e,r){var n=dCe(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:dCe(t.name,e.name)}a(fil,"compareByOriginalPositions");p_.compareByOriginalPositions=fil;function pil(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=dCe(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:dCe(t.name,e.name)}a(pil,"compareByGeneratedPositionsDeflated");p_.compareByGeneratedPositionsDeflated=pil;function dCe(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(dCe,"strcmp");function hil(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=dCe(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:dCe(t.name,e.name)}a(hil,"compareByGeneratedPositionsInflated");p_.compareByGeneratedPositionsInflated=hil;function mil(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(mil,"parseSourceMapInput");p_.parseSourceMapInput=mil;function gil(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=w6e(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=wao(uCe(n),e)}return z7r(e)}a(gil,"computeSourceURL");p_.computeSourceURL=gil});var J7r=I(Dao=>{p();var Y7r=fCe(),K7r=Object.prototype.hasOwnProperty,hoe=typeof Map<"u";function tU(){this._array=[],this._set=hoe?new Map:Object.create(null)}a(tU,"ArraySet");tU.fromArray=a(function(e,r){for(var n=new tU,o=0,s=e.length;o=0)return r}else{var n=Y7r.toSetString(e);if(K7r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");tU.prototype.at=a(function(e){if(e>=0&&e{p();var Nao=fCe();function Ail(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Nao.compareByGeneratedPositionsInflated(t,e)<=0}a(Ail,"generatedPositionAfter");function Skt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(Skt,"MappingList");Skt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");Skt.prototype.add=a(function(e){Ail(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");Skt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Nao.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");Mao.MappingList=Skt});var Z7r=I(Lao=>{p();var R6e=W7r(),qm=fCe(),Tkt=J7r().ArraySet,yil=Oao().MappingList;function wk(t){t||(t={}),this._file=qm.getArg(t,"file",null),this._sourceRoot=qm.getArg(t,"sourceRoot",null),this._skipValidation=qm.getArg(t,"skipValidation",!1),this._sources=new Tkt,this._names=new Tkt,this._mappings=new yil,this._sourcesContents=null}a(wk,"SourceMapGenerator");wk.prototype._version=3;wk.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new wk({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=qm.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=qm.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");wk.prototype.addMapping=a(function(e){var r=qm.getArg(e,"generated"),n=qm.getArg(e,"original",null),o=qm.getArg(e,"source",null),s=qm.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");wk.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=qm.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[qm.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[qm.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");wk.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=qm.relative(s,o));var c=new Tkt,l=new Tkt;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=qm.join(n,u.source)),s!=null&&(u.source=qm.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=qm.join(n,u)),s!=null&&(u=qm.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");wk.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");wk.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(!qm.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=R6e.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=R6e.encode(h-c),c=h,u+=R6e.encode(d.originalLine-1-o),o=d.originalLine-1,u+=R6e.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=R6e.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");wk.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=qm.relative(r,n));var o=qm.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");wk.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");wk.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");Lao.SourceMapGenerator=wk});var Bao=I(moe=>{p();moe.GREATEST_LOWER_BOUND=1;moe.LEAST_UPPER_BOUND=2;function X7r(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?X7r(c,e,r,n,o,s):s==moe.LEAST_UPPER_BOUND?e1?X7r(t,c,r,n,o,s):s==moe.LEAST_UPPER_BOUND?c:t<0?-1:t}a(X7r,"recursiveSearch");moe.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=X7r(-1,r.length,e,r,n,o||moe.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 Uao=I(Fao=>{p();function eQr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a(eQr,"swap");function Eil(t,e){return Math.round(t+Math.random()*(e-t))}a(Eil,"randomIntInRange");function tQr(t,e,r,n){if(r{p();var jn=fCe(),rQr=Bao(),pCe=J7r().ArraySet,_il=W7r(),k6e=Uao().quickSort;function Id(t,e){var r=t;return typeof t=="string"&&(r=jn.parseSourceMapInput(t)),r.sections!=null?new ZN(r,e):new My(r,e)}a(Id,"SourceMapConsumer");Id.fromSourceMap=function(t,e){return My.fromSourceMap(t,e)};Id.prototype._version=3;Id.prototype.__generatedMappings=null;Object.defineProperty(Id.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Id.prototype.__originalMappings=null;Object.defineProperty(Id.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Id.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Id.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Id.GENERATED_ORDER=1;Id.ORIGINAL_ORDER=2;Id.GREATEST_LOWER_BOUND=1;Id.LEAST_UPPER_BOUND=2;Id.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Id.GENERATED_ORDER,c;switch(s){case Id.GENERATED_ORDER:c=this._generatedMappings;break;case Id.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=jn.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");Id.prototype.allGeneratedPositionsFor=a(function(e){var r=jn.getArg(e,"line"),n={source:jn.getArg(e,"source"),originalLine:r,originalColumn:jn.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",jn.compareByOriginalPositions,rQr.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:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");Ikt.SourceMapConsumer=Id;function My(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sources"),s=jn.getArg(r,"names",[]),c=jn.getArg(r,"sourceRoot",null),l=jn.getArg(r,"sourcesContent",null),u=jn.getArg(r,"mappings"),d=jn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=jn.normalize(c)),o=o.map(String).map(jn.normalize).map(function(f){return c&&jn.isAbsolute(c)&&jn.isAbsolute(f)?jn.relative(c,f):f}),this._names=pCe.fromArray(s.map(String),!0),this._sources=pCe.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return jn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(My,"BasicSourceMapConsumer");My.prototype=Object.create(Id.prototype);My.prototype.consumer=Id;My.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=jn.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r1&&(y.source=l+_[1],l+=_[1],y.originalLine=s+_[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=c+_[3],c=y.originalColumn,_.length>4&&(y.name=u+_[4],u+=_[4])),A.push(y),typeof y.originalLine=="number"&&g.push(y)}k6e(A,jn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,k6e(g,jn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");My.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 rQr.search(e,r,s,c)},"SourceMapConsumer_findMapping");My.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=jn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=jn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=jn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:jn.getArg(o,"originalLine",null),column:jn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");My.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");My.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=jn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=jn.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");My.prototype.generatedPositionFor=a(function(e){var r=jn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:jn.getArg(e,"line"),originalColumn:jn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",jn.compareByOriginalPositions,jn.getArg(e,"bias",Id.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:jn.getArg(s,"generatedLine",null),column:jn.getArg(s,"generatedColumn",null),lastColumn:jn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");Ikt.BasicSourceMapConsumer=My;function ZN(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new pCe,this._names=new pCe;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=jn.getArg(c,"offset"),u=jn.getArg(l,"line"),d=jn.getArg(l,"column");if(u{p();var vil=Z7r().SourceMapGenerator,xkt=fCe(),Cil=/(\r?\n)/,bil=10,hCe="$$$isSourceNode$$$";function UI(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[hCe]=!0,n!=null&&this.add(n)}a(UI,"SourceNode");UI.fromStringWithSourceMap=a(function(e,r,n){var o=new UI,s=e.split(Cil),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[hCe]||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");UI.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();wkt.SourceMapGenerator=Z7r().SourceMapGenerator;wkt.SourceMapConsumer=qao().SourceMapConsumer;wkt.SourceNode=Hao().SourceNode});var Vao=I((e0m,$ao)=>{p();var Sil=Object.prototype.toString,nQr=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Til(t){return Sil.call(t).slice(8,-1)==="ArrayBuffer"}a(Til,"isArrayBuffer");function Iil(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 nQr?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(Iil,"fromArrayBuffer");function xil(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return nQr?Buffer.from(t,e):new Buffer(t,e)}a(xil,"fromString");function wil(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return Til(t)?Iil(t,e,r):typeof t=="string"?xil(t,e):nQr?Buffer.from(t):new Buffer(t)}a(wil,"bufferFrom");$ao.exports=wil});var eco=I((Aoe,aQr)=>{p();var Ril=Gao().SourceMapConsumer,iQr=require("path"),JL;try{JL=require("fs"),(!JL.existsSync||!JL.readFileSync)&&(JL=null)}catch{}var kil=Vao();function Wao(t,e){return t.require(e)}a(Wao,"dynamicRequire");var zao=!1,Yao=!1,oQr=!1,P6e="auto",goe={},D6e={},Pil=/^data:application\/json[^,]+base64,/,bW=[],SW=[];function cQr(){return P6e==="browser"?!0:P6e==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(cQr,"isInBrowser");function Dil(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(Dil,"hasGlobalProcessEventEmitter");function Nil(){return typeof process=="object"&&process!==null?process.version:""}a(Nil,"globalProcessVersion");function Mil(){if(typeof process=="object"&&process!==null)return process.stderr}a(Mil,"globalProcessStderr");function Oil(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(Oil,"globalProcessExit");function Rkt(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(Bil,"CallSiteToString");function Kao(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=Bil,e}a(Kao,"cloneCallSite");function Zao(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(Nil())?0:62;n===1&&o>c&&!cQr()&&!t.isEval()&&(o-=c);var l=dQr({source:r,line:n,column:o});e.curPosition=l,t=Kao(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=Jao(d),t=Kao(t),t.getEvalOrigin=function(){return d}),t}a(Zao,"wrapCallSite");function Fil(t,e){oQr&&(goe={},D6e={});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 `+Zao(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(Fil,"prepareStackTrace");function Xao(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=goe[r];if(!s&&JL&&JL.existsSync(r))try{s=JL.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(Yao,"getErrorSource");function Nil(t){var e=Yao(t),r=wil();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),Ril(1)}a(Nil,"printErrorAndExit");function Mil(){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 Nil(arguments[1])}return t.apply(this,arguments)}}a(Mil,"shimEmitUncaughtException");var Oil=CW.slice(0),Lil=bW.slice(0);Aoe.wrapCallSite=zao;Aoe.getErrorSource=Yao;Aoe.mapSourcePosition=uQr;Aoe.retrieveSourceMap=lQr;Aoe.install=function(t){if(t=t||{},t.environment&&(R6e=t.environment,["node","browser","auto"].indexOf(R6e)===-1))throw new Error("environment "+R6e+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(CW.length=0),CW.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(bW.length=0),bW.unshift(t.retrieveSourceMap)),t.hookRequire&&!aQr()){var e=Hao(sQr,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return goe[c]=s,k6e[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(iQr||(iQr="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),Gao||(Gao=!0,Error.prepareStackTrace=Dil),!$ao){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=Hao(sQr,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Iil()&&($ao=!0,Mil())}};Aoe.resetRetrieveHandlers=function(){CW.length=0,bW.length=0,CW=Oil.slice(0),bW=Lil.slice(0),lQr=wkt(bW),cQr=wkt(CW)}});var Jao=I(()=>{p();Kao().install()});var Uil={};ki(Uil,{getTokenizer:()=>ws,getTokenizerAsync:()=>hQ,main:()=>Xao});module.exports=ba(Uil);p();p();p();var mQr="auth.db",oco=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],sco=` +`+new Array(o).join(" ")+"^"}}return null}a(Xao,"getErrorSource");function Uil(t){var e=Xao(t),r=Mil();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),Oil(1)}a(Uil,"printErrorAndExit");function Qil(){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 Uil(arguments[1])}return t.apply(this,arguments)}}a(Qil,"shimEmitUncaughtException");var qil=bW.slice(0),jil=SW.slice(0);Aoe.wrapCallSite=Zao;Aoe.getErrorSource=Xao;Aoe.mapSourcePosition=dQr;Aoe.retrieveSourceMap=uQr;Aoe.install=function(t){if(t=t||{},t.environment&&(P6e=t.environment,["node","browser","auto"].indexOf(P6e)===-1))throw new Error("environment "+P6e+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(bW.length=0),bW.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(SW.length=0),SW.unshift(t.retrieveSourceMap)),t.hookRequire&&!cQr()){var e=Wao(aQr,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return goe[c]=s,D6e[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(oQr||(oQr="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),zao||(zao=!0,Error.prepareStackTrace=Fil),!Yao){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=Wao(aQr,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Dil()&&(Yao=!0,Qil())}};Aoe.resetRetrieveHandlers=function(){bW.length=0,SW.length=0,bW=qil.slice(0),SW=jil.slice(0),uQr=Rkt(SW),lQr=Rkt(bW)}});var tco=I(()=>{p();eco().install()});var $il={};ki($il,{getTokenizer:()=>ws,getTokenizerAsync:()=>mQ,main:()=>nco});module.exports=Ca($il);p();p();p();var gQr="auth.db",lco=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],uco=` CREATE TABLE IF NOT EXISTS oauth_tokens ( token_id INTEGER PRIMARY KEY AUTOINCREMENT, auth_authority TEXT NOT NULL, @@ -1638,83 +1638,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) ) -`,aco=` +`,dco=` 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 ) -`,cco=` +`,fco=` CREATE TABLE IF NOT EXISTS editor_signout ( editor_id TEXT PRIMARY KEY, signed_out_at INTEGER NOT NULL ) -`,lco=` +`,pco=` CREATE TABLE IF NOT EXISTS metadata ( key TEXT PRIMARY KEY, value TEXT NOT NULL ) -`,uco=[sco,aco,cco,lco];function Pkt(t){for(let e of oco)t.exec(e);return dco(t),t}a(Pkt,"applyPragmas");function dco(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(dco,"ensureWalMode");function Dkt(t){for(let e of uco)t.exec(e);return t}a(Dkt,"applySchema");function tU(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(tU,"runInWriteTx");p();p();p();var Nkt="github.copilot",gQr="github-enterprise";p();var Ls=a((t,e)=>({editorId:t,displayName:e}),"id"),fco=Ls("unknown","Unknown"),AQr=Ls("eclipse","Eclipse"),yQr=Ls("xcode","Xcode"),rU=Ls("vim","Vim/Neovim"),EQr=Ls("helix","Helix"),pco={"copilot-eclipse":AQr,Copilot4Eclipse:AQr,"copilot-xcode":yQr,"Copilot for Xcode":yQr,"copilot-vs":Ls("visual-studio","Visual Studio"),"copilot.vim":rU,"copilot.lua":rU,"Github Copilot LSP for Neovim":rU,"coc-github-copilot":rU,"nvim-lspconfig":rU,"copilot-lsp-client-neovim":rU,"neovim-copilot-lsp":rU,"sidekick.nvim":rU,"helix-copilot":EQr,"copilot-helix":EQr,"copilot-sublime":Ls("sublime-text","Sublime Text"),"zed-copilot":Ls("zed","Zed"),RStudio:Ls("rstudio","RStudio"),"obsidian-copilot":Ls("obsidian","Obsidian"),marimo:Ls("marimo","marimo"),"Qt Creator Copilot plugin":Ls("qt-creator","Qt Creator"),"godot-copilot":Ls("godot","Godot"),"kakoune-lsp":Ls("kakoune","Kakoune"),"typora-copilot":Ls("typora","Typora"),"Copilot for Nova":Ls("nova","Nova")},hco={IU:Ls("intellij","IntelliJ IDEA"),IC:Ls("intellij","IntelliJ IDEA"),IE:Ls("intellij","IntelliJ IDEA"),PY:Ls("pycharm","PyCharm"),PC:Ls("pycharm","PyCharm"),PE:Ls("pycharm","PyCharm"),WS:Ls("webstorm","WebStorm"),PS:Ls("phpstorm","PhpStorm"),RD:Ls("rider","Rider"),RM:Ls("rubymine","RubyMine"),CL:Ls("clion","CLion"),GO:Ls("goland","GoLand"),RR:Ls("rustrover","RustRover"),DB:Ls("datagrip","DataGrip"),DS:Ls("dataspell","DataSpell"),AI:Ls("android-studio","Android Studio"),QA:Ls("aqua","Aqua"),MPS:Ls("mps","MPS"),JBC:Ls("jetbrains-client","JetBrains Client"),GW:Ls("jetbrains-gateway","JetBrains Gateway")},_Qr="JetBrains-",mco=Ls("jetbrains","JetBrains IDE");function vQr(t){let e=t.plugin.name?.trim();if(!e)return fco;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(_Qr)){let n=hco[r.slice(_Qr.length)];if(n)return n}return mco}return pco[e]??Ls(e,e)}a(vQr,"resolveEditorIdentity");p();p();p();p();var P6e=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 Mkt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(Mkt,"findKnownOrg");function CQr(t){let e=t.organization_list??[];return Mkt(e)??""}a(CQr,"getUserKind");p();var qf=class{static{a(this,"LogTarget")}},ZL=class{static{a(this,"TelemetryLogSender")}},fe=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(qf).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(ZL).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Nr=new fe("default");p();p();p();p();async function Juo(){let{getDeviceId:t}=await Promise.resolve().then(()=>de(eHr()));return t()}a(Juo,"loadDeviceId");var UI=class{constructor(e=Juo){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 kk=class{static{a(this,"InlineCompletionsUnification")}},Zuo={codeUnification:!1,modelUnification:!1,expAssignments:[]},boe=class extends kk{constructor(){super(...arguments);this.inlineCompletionsUnificationState=Zuo;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};var nC=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return K6e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(kk).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 E_="X-Copilot-RelatedPluginVersion-",Soe=(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=E_+"msvscodecpptools",z.CopilotRelatedPluginVersionCMakeTools=E_+"msvscodecmaketools",z.CopilotRelatedPluginVersionMakefileTools=E_+"msvscodemakefiletools",z.CopilotRelatedPluginVersionCSharpDevKit=E_+"msdotnettoolscsdevkit",z.CopilotRelatedPluginVersionPython=E_+"mspythonpython",z.CopilotRelatedPluginVersionPylance=E_+"mspythonvscodepylance",z.CopilotRelatedPluginVersionJavaPack=E_+"vscjavavscodejavapack",z.CopilotRelatedPluginVersionJavaManager=E_+"vscjavavscodejavadependency",z.CopilotRelatedPluginVersionTypescript=E_+"vscodetypescriptlanguagefeatures",z.CopilotRelatedPluginVersionTypescriptNext=E_+"msvscodevscodetypescriptnext",z.CopilotRelatedPluginVersionCSharp=E_+"msdotnettoolscsharp",z.CopilotRelatedPluginVersionGithubCopilotChat=E_+"githubcopilotchat",z.CopilotRelatedPluginVersionGithubCopilot=E_+"githubcopilot",z))(Soe||{});var Xuo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},iB=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=Xuo[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 bs(t,e){let r=z0(t,e,"event.CopilotToken");return t.get(Qt).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(bs,"onCopilotToken");function oPt(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(oPt,"propertiesFromCopilotToken");var Op=class{constructor(e){this.#e={};this.optedIn=!1;bs(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=oPt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1")}};var O9e=de(dU()),L9e=de(require("os"));var edo=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function tdo(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(edo),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(tdo,"buildExceptionDetail");function cPt(t,e){let r=t.get(Ir),n=r.getEditorInfo(),o=t.get(Op),s={"#editor":n.devName??n.name,"#editor_version":M1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":M1(r.getEditorPluginInfo()),"#session_id":t.get(Ua).sessionId,"#machine_id":t.get(Ua).machineId,"#architecture":L9e.arch(),"#os_platform":L9e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(cPt,"buildContext");function cGr(t,e,r){let n=t.get(ds),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:cPt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=tdo(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,O9e.SHA256)(O9e.enc.Utf16.parse(f.join(` -`))).toString()),c}a(cGr,"buildPayload");p();var B9e=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 uGr=de(dU());var Cn=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)}},Pk=class extends Cn{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"}},F9e=class extends Cn{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 dGr=7*86400*1e3,XN=class{constructor(e=5){this.perWeek=e;this.cache=new Cn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-dGr);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(fGr(t.replace(/\\/g,"/")),"gi"):new RegExp(fGr(t),"gi"));function ndo(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(ido,"removePropertiesWithPossibleUserInfo");function odo(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(odo,"redactPaths");function hGr(t,e=rdo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=ido(s);if(c!==s){r[n]=c;continue}s=ndo(s,e);for(let l of e)s=s.replace(l,"");s=odo(s),r[n]=s}return r}a(hGr,"sanitizeTelemetryProperties");function fU(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(fU,"filterTelemetryProperties");p();var QI=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:gGr(r,n),verboseLogging:ado(r,n),testMode:e,simulation:sdo(n)})}};function O1(t){return t.get(QI).flags.testMode}a(O1,"isRunningInTest");function RCe(t){return O1(t)}a(RCe,"shouldFailForDebugPurposes");function kCe(t){return t.get(QI).flags.debug}a(kCe,"isDebugEnabled");function mGr(t){return t.get(QI).flags.verboseLogging}a(mGr,"isVerboseLoggingEnabled");function gGr(t,e){return t.includes("--debug")||uPt(e,"DEBUG")}a(gGr,"determineDebugFlag");function sdo(t){return uPt(t,"SIMULATION")}a(sdo,"determineSimulationFlag");function Q9e(t){return t.get(QI).flags.simulation}a(Q9e,"isRunningInSimulation");function ado(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||uPt(e,"VERBOSE")||gGr(t,e)}a(ado,"determineVerboseLoggingEnabled");function uPt(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(uPt,"determineEnvFlagEnabled");p();var xd=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 EGr=require("os"),_Gr=de(require("path"));function PCe(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(PCe,"redactPaths");var cdo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),ldo=[/^[\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 fPt(t){if(cdo.has(t))return t;for(let e of ldo)if(e.test(t))return t;return PCe(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(fPt,"redactMessage");function Toe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Toe,"escapeForRegExp");var udo=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+Toe((0,EGr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function dPt(t){return t.replace(udo,"~")}a(dPt,"redactHomeDir");var vGr="[\\\\/]?([^:)]*)(?=:\\d)",AGr=new RegExp(Toe(_Gr.sep),"g"),yGr=new RegExp(Toe(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+vGr,"gi");function pPt(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(yGr.test(l))o.stack+=` -${PCe(l.replace(yGr,(u,d)=>"./"+d.replace(AGr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` -${PCe(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(Toe(f.replace(/[\\/]$/,""))+vGr,"gi");if(h.test(l)){o.stack+=` -${PCe(l.replace(h,(m,g)=>d+g.replace(AGr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` -${dPt(l)}`:o.stack+=` - at [redacted]:0:0`}}else r&&s&&(o.stack=dPt(s));return t.cause instanceof Error&&(o.cause=pPt(t.cause,e,r,n)),o}a(pPt,"cloneError");function CGr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(CGr,"errorMessageWithoutPath");function bGr(t,e){return pPt(t,a(function(n){return dPt(CGr(n))},"prepareMessage"),!0,e)}a(bGr,"prepareErrorForRestrictedTelemetry");function SGr(t,e,r=!1){return pPt(t,a(function(o){if(r)return fPt(CGr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=PCe(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(SGr,"redactError");p();p();var Ly={};ki(Ly,{HasPropertyKey:()=>q9e,IsArray:()=>Lp,IsAsyncIterator:()=>hPt,IsBigInt:()=>DCe,IsBoolean:()=>sB,IsDate:()=>xW,IsFunction:()=>mPt,IsIterator:()=>gPt,IsNull:()=>APt,IsNumber:()=>L1,IsObject:()=>Yc,IsRegExp:()=>NCe,IsString:()=>Ql,IsSymbol:()=>yPt,IsUint8Array:()=>aB,IsUndefined:()=>Bp});p();function q9e(t,e){return e in t}a(q9e,"HasPropertyKey");function hPt(t){return Yc(t)&&!Lp(t)&&!aB(t)&&Symbol.asyncIterator in t}a(hPt,"IsAsyncIterator");function Lp(t){return Array.isArray(t)}a(Lp,"IsArray");function DCe(t){return typeof t=="bigint"}a(DCe,"IsBigInt");function sB(t){return typeof t=="boolean"}a(sB,"IsBoolean");function xW(t){return t instanceof globalThis.Date}a(xW,"IsDate");function mPt(t){return typeof t=="function"}a(mPt,"IsFunction");function gPt(t){return Yc(t)&&!Lp(t)&&!aB(t)&&Symbol.iterator in t}a(gPt,"IsIterator");function APt(t){return t===null}a(APt,"IsNull");function L1(t){return typeof t=="number"}a(L1,"IsNumber");function Yc(t){return typeof t=="object"&&t!==null}a(Yc,"IsObject");function NCe(t){return t instanceof globalThis.RegExp}a(NCe,"IsRegExp");function Ql(t){return typeof t=="string"}a(Ql,"IsString");function yPt(t){return typeof t=="symbol"}a(yPt,"IsSymbol");function aB(t){return t instanceof globalThis.Uint8Array}a(aB,"IsUint8Array");function Bp(t){return t===void 0}a(Bp,"IsUndefined");function ddo(t){return t.map(e=>j9e(e))}a(ddo,"ArrayType");function fdo(t){return new Date(t.getTime())}a(fdo,"DateType");function pdo(t){return new Uint8Array(t)}a(pdo,"Uint8ArrayType");function hdo(t){return new RegExp(t.source,t.flags)}a(hdo,"RegExpType");function mdo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=j9e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=j9e(t[r]);return e}a(mdo,"ObjectType");function j9e(t){return Lp(t)?ddo(t):xW(t)?fdo(t):aB(t)?pdo(t):NCe(t)?hdo(t):Yc(t)?mdo(t):t}a(j9e,"Visit");function Bu(t){return j9e(t)}a(Bu,"Clone");function Ioe(t,e){return e===void 0?Bu(t):Bu({...e,...t})}a(Ioe,"CloneType");p();p();p();function H9e(t){return bo(t)&&globalThis.Symbol.asyncIterator in t}a(H9e,"IsAsyncIterator");function G9e(t){return bo(t)&&globalThis.Symbol.iterator in t}a(G9e,"IsIterator");function EPt(t){return bo(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(EPt,"IsStandardObject");function $9e(t){return t instanceof globalThis.Promise}a($9e,"IsPromise");function __(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(__,"IsDate");function TGr(t){return t instanceof globalThis.Map}a(TGr,"IsMap");function IGr(t){return t instanceof globalThis.Set}a(IGr,"IsSet");function qI(t){return globalThis.ArrayBuffer.isView(t)}a(qI,"IsTypedArray");function xoe(t){return t instanceof globalThis.Uint8Array}a(xoe,"IsUint8Array");function Qi(t,e){return e in t}a(Qi,"HasPropertyKey");function bo(t){return t!==null&&typeof t=="object"}a(bo,"IsObject");function Pi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(Pi,"IsArray");function Fu(t){return t===void 0}a(Fu,"IsUndefined");function cB(t){return t===null}a(cB,"IsNull");function eM(t){return typeof t=="boolean"}a(eM,"IsBoolean");function ai(t){return typeof t=="number"}a(ai,"IsNumber");function V9e(t){return globalThis.Number.isInteger(t)}a(V9e,"IsInteger");function pA(t){return typeof t=="bigint"}a(pA,"IsBigInt");function Sa(t){return typeof t=="string"}a(Sa,"IsString");function pU(t){return typeof t=="function"}a(pU,"IsFunction");function lB(t){return typeof t=="symbol"}a(lB,"IsSymbol");function B1(t){return pA(t)||eM(t)||cB(t)||ai(t)||Sa(t)||lB(t)||Fu(t)}a(B1,"IsValueType");var su;(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=bo(c);return t.AllowArrayObject?l:l&&!Pi(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?ai(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=Fu(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(su||(su={}));p();function gdo(t){return globalThis.Object.freeze(t).map(e=>MCe(e))}a(gdo,"ImmutableArray");function Ado(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=MCe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=MCe(t[r]);return globalThis.Object.freeze(e)}a(Ado,"ImmutableObject");function MCe(t){return Lp(t)?gdo(t):xW(t)?t:aB(t)?t:NCe(t)?t:Yc(t)?Ado(t):t}a(MCe,"Immutable");function wt(t,e){let r=e!==void 0?{...e,...t}:t;switch(su.InstanceMode){case"freeze":return MCe(r);case"clone":return Bu(r);default:return r}}a(wt,"CreateType");p();var qi=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};p();p();p();var wd=Symbol.for("TypeBox.Transform"),Dk=Symbol.for("TypeBox.Readonly"),hA=Symbol.for("TypeBox.Optional"),jI=Symbol.for("TypeBox.Hint"),Tt=Symbol.for("TypeBox.Kind");function woe(t){return Yc(t)&&t[Dk]==="Readonly"}a(woe,"IsReadonly");function iC(t){return Yc(t)&&t[hA]==="Optional"}a(iC,"IsOptional");function _Pt(t){return aa(t,"Any")}a(_Pt,"IsAny");function vPt(t){return aa(t,"Argument")}a(vPt,"IsArgument");function Nk(t){return aa(t,"Array")}a(Nk,"IsArray");function wW(t){return aa(t,"AsyncIterator")}a(wW,"IsAsyncIterator");function RW(t){return aa(t,"BigInt")}a(RW,"IsBigInt");function uB(t){return aa(t,"Boolean")}a(uB,"IsBoolean");function Mk(t){return aa(t,"Computed")}a(Mk,"IsComputed");function Ok(t){return aa(t,"Constructor")}a(Ok,"IsConstructor");function ydo(t){return aa(t,"Date")}a(ydo,"IsDate");function Lk(t){return aa(t,"Function")}a(Lk,"IsFunction");function Bk(t){return aa(t,"Integer")}a(Bk,"IsInteger");function af(t){return aa(t,"Intersect")}a(af,"IsIntersect");function kW(t){return aa(t,"Iterator")}a(kW,"IsIterator");function aa(t,e){return Yc(t)&&Tt in t&&t[Tt]===e}a(aa,"IsKindOf");function W9e(t){return sB(t)||L1(t)||Ql(t)}a(W9e,"IsLiteralValue");function F1(t){return aa(t,"Literal")}a(F1,"IsLiteral");function U1(t){return aa(t,"MappedKey")}a(U1,"IsMappedKey");function Uu(t){return aa(t,"MappedResult")}a(Uu,"IsMappedResult");function hU(t){return aa(t,"Never")}a(hU,"IsNever");function Edo(t){return aa(t,"Not")}a(Edo,"IsNot");function OCe(t){return aa(t,"Null")}a(OCe,"IsNull");function Fk(t){return aa(t,"Number")}a(Fk,"IsNumber");function Fp(t){return aa(t,"Object")}a(Fp,"IsObject");function PW(t){return aa(t,"Promise")}a(PW,"IsPromise");function DW(t){return aa(t,"Record")}a(DW,"IsRecord");function jf(t){return aa(t,"Ref")}a(jf,"IsRef");function CPt(t){return aa(t,"RegExp")}a(CPt,"IsRegExp");function dB(t){return aa(t,"String")}a(dB,"IsString");function LCe(t){return aa(t,"Symbol")}a(LCe,"IsSymbol");function Q1(t){return aa(t,"TemplateLiteral")}a(Q1,"IsTemplateLiteral");function _do(t){return aa(t,"This")}a(_do,"IsThis");function ec(t){return Yc(t)&&wd in t}a(ec,"IsTransform");function q1(t){return aa(t,"Tuple")}a(q1,"IsTuple");function fB(t){return aa(t,"Undefined")}a(fB,"IsUndefined");function Ta(t){return aa(t,"Union")}a(Ta,"IsUnion");function vdo(t){return aa(t,"Uint8Array")}a(vdo,"IsUint8Array");function Cdo(t){return aa(t,"Unknown")}a(Cdo,"IsUnknown");function bdo(t){return aa(t,"Unsafe")}a(bdo,"IsUnsafe");function Sdo(t){return aa(t,"Void")}a(Sdo,"IsVoid");function mU(t){return Yc(t)&&Tt in t&&Ql(t[Tt])}a(mU,"IsKind");function Rd(t){return _Pt(t)||vPt(t)||Nk(t)||uB(t)||RW(t)||wW(t)||Mk(t)||Ok(t)||ydo(t)||Lk(t)||Bk(t)||af(t)||kW(t)||F1(t)||U1(t)||Uu(t)||hU(t)||Edo(t)||OCe(t)||Fk(t)||Fp(t)||PW(t)||DW(t)||jf(t)||CPt(t)||dB(t)||LCe(t)||Q1(t)||_do(t)||q1(t)||fB(t)||Ta(t)||vdo(t)||Cdo(t)||bdo(t)||Sdo(t)||mU(t)}a(Rd,"IsSchema");var it={};ki(it,{IsAny:()=>kGr,IsArgument:()=>PGr,IsArray:()=>DGr,IsAsyncIterator:()=>NGr,IsBigInt:()=>MGr,IsBoolean:()=>OGr,IsComputed:()=>LGr,IsConstructor:()=>BGr,IsDate:()=>FGr,IsFunction:()=>UGr,IsImport:()=>kdo,IsInteger:()=>QGr,IsIntersect:()=>qGr,IsIterator:()=>jGr,IsKind:()=>h$r,IsKindOf:()=>Bs,IsLiteral:()=>FCe,IsLiteralBoolean:()=>Pdo,IsLiteralNumber:()=>GGr,IsLiteralString:()=>HGr,IsLiteralValue:()=>$Gr,IsMappedKey:()=>VGr,IsMappedResult:()=>WGr,IsNever:()=>zGr,IsNot:()=>YGr,IsNull:()=>KGr,IsNumber:()=>JGr,IsObject:()=>ZGr,IsOptional:()=>Rdo,IsPromise:()=>XGr,IsProperties:()=>z9e,IsReadonly:()=>wdo,IsRecord:()=>e$r,IsRecursive:()=>Ddo,IsRef:()=>t$r,IsRegExp:()=>r$r,IsSchema:()=>Qu,IsString:()=>n$r,IsSymbol:()=>i$r,IsTemplateLiteral:()=>o$r,IsThis:()=>s$r,IsTransform:()=>a$r,IsTuple:()=>c$r,IsUint8Array:()=>u$r,IsUndefined:()=>l$r,IsUnion:()=>IPt,IsUnionLiteral:()=>Ndo,IsUnknown:()=>d$r,IsUnsafe:()=>f$r,IsVoid:()=>p$r,TypeGuardUnknownTypeError:()=>bPt});p();var bPt=class extends qi{static{a(this,"TypeGuardUnknownTypeError")}},Tdo=["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 xGr(t){try{return new RegExp(t),!0}catch{return!1}}a(xGr,"IsPattern");function SPt(t){if(!Ql(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(SPt,"IsControlCharacterFree");function wGr(t){return TPt(t)||Qu(t)}a(wGr,"IsAdditionalProperties");function BCe(t){return Bp(t)||DCe(t)}a(BCe,"IsOptionalBigInt");function ql(t){return Bp(t)||L1(t)}a(ql,"IsOptionalNumber");function TPt(t){return Bp(t)||sB(t)}a(TPt,"IsOptionalBoolean");function Kc(t){return Bp(t)||Ql(t)}a(Kc,"IsOptionalString");function Ido(t){return Bp(t)||Ql(t)&&SPt(t)&&xGr(t)}a(Ido,"IsOptionalPattern");function xdo(t){return Bp(t)||Ql(t)&&SPt(t)}a(xdo,"IsOptionalFormat");function RGr(t){return Bp(t)||Qu(t)}a(RGr,"IsOptionalSchema");function wdo(t){return Yc(t)&&t[Dk]==="Readonly"}a(wdo,"IsReadonly");function Rdo(t){return Yc(t)&&t[hA]==="Optional"}a(Rdo,"IsOptional");function kGr(t){return Bs(t,"Any")&&Kc(t.$id)}a(kGr,"IsAny");function PGr(t){return Bs(t,"Argument")&&L1(t.index)}a(PGr,"IsArgument");function DGr(t){return Bs(t,"Array")&&t.type==="array"&&Kc(t.$id)&&Qu(t.items)&&ql(t.minItems)&&ql(t.maxItems)&&TPt(t.uniqueItems)&&RGr(t.contains)&&ql(t.minContains)&&ql(t.maxContains)}a(DGr,"IsArray");function NGr(t){return Bs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&Kc(t.$id)&&Qu(t.items)}a(NGr,"IsAsyncIterator");function MGr(t){return Bs(t,"BigInt")&&t.type==="bigint"&&Kc(t.$id)&&BCe(t.exclusiveMaximum)&&BCe(t.exclusiveMinimum)&&BCe(t.maximum)&&BCe(t.minimum)&&BCe(t.multipleOf)}a(MGr,"IsBigInt");function OGr(t){return Bs(t,"Boolean")&&t.type==="boolean"&&Kc(t.$id)}a(OGr,"IsBoolean");function LGr(t){return Bs(t,"Computed")&&Ql(t.target)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))}a(LGr,"IsComputed");function BGr(t){return Bs(t,"Constructor")&&t.type==="Constructor"&&Kc(t.$id)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))&&Qu(t.returns)}a(BGr,"IsConstructor");function FGr(t){return Bs(t,"Date")&&t.type==="Date"&&Kc(t.$id)&&ql(t.exclusiveMaximumTimestamp)&&ql(t.exclusiveMinimumTimestamp)&&ql(t.maximumTimestamp)&&ql(t.minimumTimestamp)&&ql(t.multipleOfTimestamp)}a(FGr,"IsDate");function UGr(t){return Bs(t,"Function")&&t.type==="Function"&&Kc(t.$id)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))&&Qu(t.returns)}a(UGr,"IsFunction");function kdo(t){return Bs(t,"Import")&&q9e(t,"$defs")&&Yc(t.$defs)&&z9e(t.$defs)&&q9e(t,"$ref")&&Ql(t.$ref)&&t.$ref in t.$defs}a(kdo,"IsImport");function QGr(t){return Bs(t,"Integer")&&t.type==="integer"&&Kc(t.$id)&&ql(t.exclusiveMaximum)&&ql(t.exclusiveMinimum)&&ql(t.maximum)&&ql(t.minimum)&&ql(t.multipleOf)}a(QGr,"IsInteger");function z9e(t){return Yc(t)&&Object.entries(t).every(([e,r])=>SPt(e)&&Qu(r))}a(z9e,"IsProperties");function qGr(t){return Bs(t,"Intersect")&&!(Ql(t.type)&&t.type!=="object")&&Lp(t.allOf)&&t.allOf.every(e=>Qu(e)&&!a$r(e))&&Kc(t.type)&&(TPt(t.unevaluatedProperties)||RGr(t.unevaluatedProperties))&&Kc(t.$id)}a(qGr,"IsIntersect");function jGr(t){return Bs(t,"Iterator")&&t.type==="Iterator"&&Kc(t.$id)&&Qu(t.items)}a(jGr,"IsIterator");function Bs(t,e){return Yc(t)&&Tt in t&&t[Tt]===e}a(Bs,"IsKindOf");function HGr(t){return FCe(t)&&Ql(t.const)}a(HGr,"IsLiteralString");function GGr(t){return FCe(t)&&L1(t.const)}a(GGr,"IsLiteralNumber");function Pdo(t){return FCe(t)&&sB(t.const)}a(Pdo,"IsLiteralBoolean");function FCe(t){return Bs(t,"Literal")&&Kc(t.$id)&&$Gr(t.const)}a(FCe,"IsLiteral");function $Gr(t){return sB(t)||L1(t)||Ql(t)}a($Gr,"IsLiteralValue");function VGr(t){return Bs(t,"MappedKey")&&Lp(t.keys)&&t.keys.every(e=>L1(e)||Ql(e))}a(VGr,"IsMappedKey");function WGr(t){return Bs(t,"MappedResult")&&z9e(t.properties)}a(WGr,"IsMappedResult");function zGr(t){return Bs(t,"Never")&&Yc(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(zGr,"IsNever");function YGr(t){return Bs(t,"Not")&&Qu(t.not)}a(YGr,"IsNot");function KGr(t){return Bs(t,"Null")&&t.type==="null"&&Kc(t.$id)}a(KGr,"IsNull");function JGr(t){return Bs(t,"Number")&&t.type==="number"&&Kc(t.$id)&&ql(t.exclusiveMaximum)&&ql(t.exclusiveMinimum)&&ql(t.maximum)&&ql(t.minimum)&&ql(t.multipleOf)}a(JGr,"IsNumber");function ZGr(t){return Bs(t,"Object")&&t.type==="object"&&Kc(t.$id)&&z9e(t.properties)&&wGr(t.additionalProperties)&&ql(t.minProperties)&&ql(t.maxProperties)}a(ZGr,"IsObject");function XGr(t){return Bs(t,"Promise")&&t.type==="Promise"&&Kc(t.$id)&&Qu(t.item)}a(XGr,"IsPromise");function e$r(t){return Bs(t,"Record")&&t.type==="object"&&Kc(t.$id)&&wGr(t.additionalProperties)&&Yc(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&xGr(r[0])&&Yc(e.patternProperties)&&Qu(e.patternProperties[r[0]])})(t)}a(e$r,"IsRecord");function Ddo(t){return Yc(t)&&jI in t&&t[jI]==="Recursive"}a(Ddo,"IsRecursive");function t$r(t){return Bs(t,"Ref")&&Kc(t.$id)&&Ql(t.$ref)}a(t$r,"IsRef");function r$r(t){return Bs(t,"RegExp")&&Kc(t.$id)&&Ql(t.source)&&Ql(t.flags)&&ql(t.maxLength)&&ql(t.minLength)}a(r$r,"IsRegExp");function n$r(t){return Bs(t,"String")&&t.type==="string"&&Kc(t.$id)&&ql(t.minLength)&&ql(t.maxLength)&&Ido(t.pattern)&&xdo(t.format)}a(n$r,"IsString");function i$r(t){return Bs(t,"Symbol")&&t.type==="symbol"&&Kc(t.$id)}a(i$r,"IsSymbol");function o$r(t){return Bs(t,"TemplateLiteral")&&t.type==="string"&&Ql(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(o$r,"IsTemplateLiteral");function s$r(t){return Bs(t,"This")&&Kc(t.$id)&&Ql(t.$ref)}a(s$r,"IsThis");function a$r(t){return Yc(t)&&wd in t}a(a$r,"IsTransform");function c$r(t){return Bs(t,"Tuple")&&t.type==="array"&&Kc(t.$id)&&L1(t.minItems)&&L1(t.maxItems)&&t.minItems===t.maxItems&&(Bp(t.items)&&Bp(t.additionalItems)&&t.minItems===0||Lp(t.items)&&t.items.every(e=>Qu(e)))}a(c$r,"IsTuple");function l$r(t){return Bs(t,"Undefined")&&t.type==="undefined"&&Kc(t.$id)}a(l$r,"IsUndefined");function Ndo(t){return IPt(t)&&t.anyOf.every(e=>HGr(e)||GGr(e))}a(Ndo,"IsUnionLiteral");function IPt(t){return Bs(t,"Union")&&Kc(t.$id)&&Yc(t)&&Lp(t.anyOf)&&t.anyOf.every(e=>Qu(e))}a(IPt,"IsUnion");function u$r(t){return Bs(t,"Uint8Array")&&t.type==="Uint8Array"&&Kc(t.$id)&&ql(t.minByteLength)&&ql(t.maxByteLength)}a(u$r,"IsUint8Array");function d$r(t){return Bs(t,"Unknown")&&Kc(t.$id)}a(d$r,"IsUnknown");function f$r(t){return Bs(t,"Unsafe")}a(f$r,"IsUnsafe");function p$r(t){return Bs(t,"Void")&&t.type==="void"&&Kc(t.$id)}a(p$r,"IsVoid");function h$r(t){return Yc(t)&&Tt in t&&Ql(t[Tt])&&!Tdo.includes(t[Tt])}a(h$r,"IsKind");function Qu(t){return Yc(t)&&(kGr(t)||PGr(t)||DGr(t)||OGr(t)||MGr(t)||NGr(t)||LGr(t)||BGr(t)||FGr(t)||UGr(t)||QGr(t)||qGr(t)||jGr(t)||FCe(t)||VGr(t)||WGr(t)||zGr(t)||YGr(t)||KGr(t)||JGr(t)||ZGr(t)||XGr(t)||e$r(t)||t$r(t)||r$r(t)||n$r(t)||i$r(t)||o$r(t)||s$r(t)||c$r(t)||l$r(t)||IPt(t)||u$r(t)||d$r(t)||f$r(t)||p$r(t)||h$r(t))}a(Qu,"IsSchema");p();var xPt="(true|false)",UCe="(0|[1-9][0-9]*)",wPt="(.*)",Mdo="(?!.*)",Hdl=`^${xPt}$`,gU=`^${UCe}$`,AU=`^${wPt}$`,m$r=`^${Mdo}$`;p();var Uk={};ki(Uk,{Clear:()=>Ldo,Delete:()=>Bdo,Entries:()=>Odo,Get:()=>Qdo,Has:()=>Fdo,Set:()=>Udo});p();var Roe=new Map;function Odo(){return new Map(Roe)}a(Odo,"Entries");function Ldo(){return Roe.clear()}a(Ldo,"Clear");function Bdo(t){return Roe.delete(t)}a(Bdo,"Delete");function Fdo(t){return Roe.has(t)}a(Fdo,"Has");function Udo(t,e){Roe.set(t,e)}a(Udo,"Set");function Qdo(t){return Roe.get(t)}a(Qdo,"Get");var v_={};ki(v_,{Clear:()=>jdo,Delete:()=>Hdo,Entries:()=>qdo,Get:()=>Vdo,Has:()=>Gdo,Set:()=>$do});p();var koe=new Map;function qdo(){return new Map(koe)}a(qdo,"Entries");function jdo(){return koe.clear()}a(jdo,"Clear");function Hdo(t){return koe.delete(t)}a(Hdo,"Delete");function Gdo(t){return koe.has(t)}a(Gdo,"Has");function $do(t,e){koe.set(t,e)}a($do,"Set");function Vdo(t){return koe.get(t)}a(Vdo,"Get");p();function g$r(t,e){return t.includes(e)}a(g$r,"SetIncludes");function A$r(t){return[...new Set(t)]}a(A$r,"SetDistinct");function Wdo(t,e){return t.filter(r=>e.includes(r))}a(Wdo,"SetIntersect");function zdo(t,e){return t.reduce((r,n)=>Wdo(r,n),e)}a(zdo,"SetIntersectManyResolve");function y$r(t){return t.length===1?t[0]:t.length>1?zdo(t.slice(1),t[0]):[]}a(y$r,"SetIntersectMany");function E$r(t){let e=[];for(let r of t)e.push(...r);return e}a(E$r,"SetUnionMany");p();function yU(t){return wt({[Tt]:"Any"},t)}a(yU,"Any");p();function Poe(t,e){return wt({[Tt]:"Array",type:"array",items:t},e)}a(Poe,"Array");p();function _$r(t){return wt({[Tt]:"Argument",index:t})}a(_$r,"Argument");p();function Doe(t,e){return wt({[Tt]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(Doe,"AsyncIterator");p();p();function au(t,e,r){return wt({[Tt]:"Computed",target:t,parameters:e},r)}a(au,"Computed");p();p();function Ydo(t,e){let{[e]:r,...n}=t;return n}a(Ydo,"DiscardKey");function cf(t,e){return e.reduce((r,n)=>Ydo(r,n),t)}a(cf,"Discard");p();function Xo(t){return wt({[Tt]:"Never",not:{}},t)}a(Xo,"Never");p();p();function Qa(t){return wt({[Tt]:"MappedResult",properties:t})}a(Qa,"MappedResult");p();p();function Noe(t,e,r){return wt({[Tt]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(Noe,"Constructor");p();function tM(t,e,r){return wt({[Tt]:"Function",type:"Function",parameters:t,returns:e},r)}a(tM,"Function");p();p();p();p();function QCe(t,e){return wt({[Tt]:"Union",anyOf:t},e)}a(QCe,"UnionCreate");function Kdo(t){return t.some(e=>iC(e))}a(Kdo,"IsUnionOptional");function v$r(t){return t.map(e=>iC(e)?Jdo(e):e)}a(v$r,"RemoveOptionalFromRest");function Jdo(t){return cf(t,[hA])}a(Jdo,"RemoveOptionalFromType");function Zdo(t,e){return Kdo(t)?By(QCe(v$r(t),e)):QCe(v$r(t),e)}a(Zdo,"ResolveUnion");function rM(t,e){return t.length===1?wt(t[0],e):t.length===0?Xo(e):Zdo(t,e)}a(rM,"UnionEvaluated");p();function tc(t,e){return t.length===0?Xo(e):t.length===1?wt(t[0],e):QCe(t,e)}a(tc,"Union");p();p();p();var Y9e=class extends qi{static{a(this,"TemplateLiteralParserError")}};function Xdo(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(Xdo,"Unescape");function RPt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(RPt,"IsNonEscaped");function hB(t,e){return RPt(t,e,"(")}a(hB,"IsOpenParen");function qCe(t,e){return RPt(t,e,")")}a(qCe,"IsCloseParen");function C$r(t,e){return RPt(t,e,"|")}a(C$r,"IsSeparator");function efo(t){if(!(hB(t,0)&&qCe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Moe(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Moe(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(ifo,"Or");function ofo(t){function e(o,s){if(!hB(o,s))throw new Y9e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Moe(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(ofo,"And");function Moe(t){return efo(t)?Moe(tfo(t)):rfo(t)?ifo(t):nfo(t)?ofo(t):{type:"const",const:Xdo(t)}}a(Moe,"TemplateLiteralParse");function Ooe(t){return Moe(t.slice(1,t.length-1))}a(Ooe,"TemplateLiteralParseExact");var kPt=class extends qi{static{a(this,"TemplateLiteralFiniteError")}};function sfo(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(sfo,"IsNumberExpression");function afo(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(afo,"IsBooleanExpression");function cfo(t){return t.type==="const"&&t.const===".*"}a(cfo,"IsStringExpression");function NW(t){return sfo(t)||cfo(t)?!1:afo(t)?!0:t.type==="and"?t.expr.every(e=>NW(e)):t.type==="or"?t.expr.every(e=>NW(e)):t.type==="const"?!0:(()=>{throw new kPt("Unknown expression type")})()}a(NW,"IsTemplateLiteralExpressionFinite");function K9e(t){let e=Ooe(t.pattern);return NW(e)}a(K9e,"IsTemplateLiteralFinite");p();var PPt=class extends qi{static{a(this,"TemplateLiteralGenerateError")}};function*b$r(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of b$r(t.slice(1)))yield`${e}${r}`}a(b$r,"GenerateReduce");function*lfo(t){return yield*b$r(t.expr.map(e=>[...jCe(e)]))}a(lfo,"GenerateAnd");function*ufo(t){for(let e of t.expr)yield*jCe(e)}a(ufo,"GenerateOr");function*dfo(t){return yield t.const}a(dfo,"GenerateConst");function*jCe(t){return t.type==="and"?yield*lfo(t):t.type==="or"?yield*ufo(t):t.type==="const"?yield*dfo(t):(()=>{throw new PPt("Unknown expression")})()}a(jCe,"TemplateLiteralExpressionGenerate");function Loe(t){let e=Ooe(t.pattern);return NW(e)?[...jCe(e)]:[]}a(Loe,"TemplateLiteralGenerate");p();p();function ca(t,e){return wt({[Tt]:"Literal",const:t,type:typeof t},e)}a(ca,"Literal");p();function J9e(t){return wt({[Tt]:"Boolean",type:"boolean"},t)}a(J9e,"Boolean");p();function Boe(t){return wt({[Tt]:"BigInt",type:"bigint"},t)}a(Boe,"BigInt");p();function HI(t){return wt({[Tt]:"Number",type:"number"},t)}a(HI,"Number");p();function C_(t){return wt({[Tt]:"String",type:"string"},t)}a(C_,"String");function*ffo(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield J9e():e==="number"?yield HI():e==="bigint"?yield Boe():e==="string"?yield C_():yield(()=>{let r=e.split("|").map(n=>ca(n.trim()));return r.length===0?Xo():r.length===1?r[0]:rM(r)})()}a(ffo,"FromUnion");function*pfo(t){if(t[1]!=="{"){let e=ca("$"),r=DPt(t.slice(1));return yield*[e,...r]}for(let e=2;eT$r(r,e)).join("|")})`:Fk(t)?`${e}${UCe}`:Bk(t)?`${e}${UCe}`:RW(t)?`${e}${UCe}`:dB(t)?`${e}${wPt}`:F1(t)?`${e}${hfo(t.const.toString())}`:uB(t)?`${e}${xPt}`:(()=>{throw new NPt(`Unexpected Kind '${t[Tt]}'`)})()}a(T$r,"Visit");function MPt(t){return`^${t.map(e=>T$r(e,"")).join("")}$`}a(MPt,"TemplateLiteralPattern");p();function MW(t){let r=Loe(t).map(n=>ca(n));return rM(r)}a(MW,"TemplateLiteralToUnion");p();function Z9e(t,e){let r=Ql(t)?MPt(S$r(t)):MPt(t);return wt({[Tt]:"TemplateLiteral",type:"string",pattern:r},e)}a(Z9e,"TemplateLiteral");function mfo(t){return Loe(t).map(r=>r.toString())}a(mfo,"FromTemplateLiteral");function gfo(t){let e=[];for(let r of t)e.push(...oC(r));return e}a(gfo,"FromUnion");function Afo(t){return[t.toString()]}a(Afo,"FromLiteral");function oC(t){return[...new Set(Q1(t)?mfo(t):Ta(t)?gfo(t.anyOf):F1(t)?Afo(t.const):Fk(t)?["[number]"]:Bk(t)?["[number]"]:[])]}a(oC,"IndexPropertyKeys");p();function yfo(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=EU(t,oC(e[o]),r);return n}a(yfo,"FromProperties");function Efo(t,e,r){return yfo(t,e.properties,r)}a(Efo,"FromMappedResult");function I$r(t,e,r){let n=Efo(t,e,r);return Qa(n)}a(I$r,"IndexFromMappedResult");function w$r(t,e){return t.map(r=>R$r(r,e))}a(w$r,"FromRest");function _fo(t){return t.filter(e=>!hU(e))}a(_fo,"FromIntersectRest");function vfo(t,e){return X9e(_fo(w$r(t,e)))}a(vfo,"FromIntersect");function Cfo(t){return t.some(e=>hU(e))?[]:t}a(Cfo,"FromUnionRest");function bfo(t,e){return rM(Cfo(w$r(t,e)))}a(bfo,"FromUnion");function Sfo(t,e){return e in t?t[e]:e==="[number]"?rM(t):Xo()}a(Sfo,"FromTuple");function Tfo(t,e){return e==="[number]"?t:Xo()}a(Tfo,"FromArray");function Ifo(t,e){return e in t?t[e]:Xo()}a(Ifo,"FromProperty");function R$r(t,e){return af(t)?vfo(t.allOf,e):Ta(t)?bfo(t.anyOf,e):q1(t)?Sfo(t.items??[],e):Nk(t)?Tfo(t.items,e):Fp(t)?Ifo(t.properties,e):Xo()}a(R$r,"IndexFromPropertyKey");function HCe(t,e){return e.map(r=>R$r(t,r))}a(HCe,"IndexFromPropertyKeys");function x$r(t,e){return rM(HCe(t,e))}a(x$r,"FromSchema");function EU(t,e,r){if(jf(t)||jf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!Rd(t)||!Rd(e))throw new qi(n);return au("Index",[t,e])}return Uu(e)?I$r(t,e,r):U1(e)?k$r(t,e,r):wt(Rd(e)?x$r(t,oC(e)):x$r(t,e),r)}a(EU,"Index");function xfo(t,e,r){return{[e]:EU(t,[e],Bu(r))}}a(xfo,"MappedIndexPropertyKey");function wfo(t,e,r){return e.reduce((n,o)=>({...n,...xfo(t,o,r)}),{})}a(wfo,"MappedIndexPropertyKeys");function Rfo(t,e,r){return wfo(t,e.keys,r)}a(Rfo,"MappedIndexProperties");function k$r(t,e,r){let n=Rfo(t,e,r);return Qa(n)}a(k$r,"IndexFromMappedKey");p();function Foe(t,e){return wt({[Tt]:"Iterator",type:"Iterator",items:t},e)}a(Foe,"Iterator");p();function kfo(t){return globalThis.Object.keys(t).filter(e=>!iC(t[e]))}a(kfo,"RequiredArray");function Pfo(t,e){let r=kfo(t),n=r.length>0?{[Tt]:"Object",type:"object",required:r,properties:t}:{[Tt]:"Object",type:"object",properties:t};return wt(n,e)}a(Pfo,"_Object");var rc=Pfo;p();function eUe(t,e){return wt({[Tt]:"Promise",type:"Promise",item:t},e)}a(eUe,"Promise");p();p();function Dfo(t){return wt(cf(t,[Dk]))}a(Dfo,"RemoveReadonly");function Nfo(t){return wt({...t,[Dk]:"Readonly"})}a(Nfo,"AddReadonly");function Mfo(t,e){return e===!1?Dfo(t):Nfo(t)}a(Mfo,"ReadonlyWithFlag");function sC(t,e){let r=e??!0;return Uu(t)?P$r(t,r):Mfo(t,r)}a(sC,"Readonly");function Ofo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=sC(t[n],e);return r}a(Ofo,"FromProperties");function Lfo(t,e){return Ofo(t.properties,e)}a(Lfo,"FromMappedResult");function P$r(t,e){let r=Lfo(t,e);return Qa(r)}a(P$r,"ReadonlyFromMappedResult");p();function GI(t,e){return wt(t.length>0?{[Tt]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[Tt]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(GI,"Tuple");function D$r(t,e){return t in e?$I(t,e[t]):Qa(e)}a(D$r,"FromMappedResult");function Bfo(t){return{[t]:ca(t)}}a(Bfo,"MappedKeyToKnownMappedResultProperties");function Ffo(t){let e={};for(let r of t)e[r]=ca(r);return e}a(Ffo,"MappedKeyToUnknownMappedResultProperties");function Ufo(t,e){return g$r(e,t)?Bfo(t):Ffo(e)}a(Ufo,"MappedKeyToMappedResultProperties");function Qfo(t,e){let r=Ufo(t,e);return D$r(t,r)}a(Qfo,"FromMappedKey");function GCe(t,e){return e.map(r=>$I(t,r))}a(GCe,"FromRest");function qfo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=$I(t,e[n]);return r}a(qfo,"FromProperties");function $I(t,e){let r={...e};return iC(e)?By($I(t,cf(e,[hA]))):woe(e)?sC($I(t,cf(e,[Dk]))):Uu(e)?D$r(t,e.properties):U1(e)?Qfo(t,e.keys):Ok(e)?Noe(GCe(t,e.parameters),$I(t,e.returns),r):Lk(e)?tM(GCe(t,e.parameters),$I(t,e.returns),r):wW(e)?Doe($I(t,e.items),r):kW(e)?Foe($I(t,e.items),r):af(e)?Fy(GCe(t,e.allOf),r):Ta(e)?tc(GCe(t,e.anyOf),r):q1(e)?GI(GCe(t,e.items??[]),r):Fp(e)?rc(qfo(t,e.properties),r):Nk(e)?Poe($I(t,e.items),r):PW(e)?eUe($I(t,e.item),r):e}a($I,"FromSchemaType");function jfo(t,e){let r={};for(let n of t)r[n]=$I(n,e);return r}a(jfo,"MappedFunctionReturnType");function N$r(t,e,r){let n=Rd(t)?oC(t):t,o=e({[Tt]:"MappedKey",keys:n}),s=jfo(n,o);return rc(s,r)}a(N$r,"Mapped");p();function Hfo(t){return wt(cf(t,[hA]))}a(Hfo,"RemoveOptional");function Gfo(t){return wt({...t,[hA]:"Optional"})}a(Gfo,"AddOptional");function $fo(t,e){return e===!1?Hfo(t):Gfo(t)}a($fo,"OptionalWithFlag");function By(t,e){let r=e??!0;return Uu(t)?M$r(t,r):$fo(t,r)}a(By,"Optional");function Vfo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=By(t[n],e);return r}a(Vfo,"FromProperties");function Wfo(t,e){return Vfo(t.properties,e)}a(Wfo,"FromMappedResult");function M$r(t,e){let r=Wfo(t,e);return Qa(r)}a(M$r,"OptionalFromMappedResult");p();function $Ce(t,e={}){let r=t.every(o=>Fp(o)),n=Rd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return wt(e.unevaluatedProperties===!1||Rd(e.unevaluatedProperties)||r?{...n,[Tt]:"Intersect",type:"object",allOf:t}:{...n,[Tt]:"Intersect",allOf:t},e)}a($Ce,"IntersectCreate");function zfo(t){return t.every(e=>iC(e))}a(zfo,"IsIntersectOptional");function Yfo(t){return cf(t,[hA])}a(Yfo,"RemoveOptionalFromType");function O$r(t){return t.map(e=>iC(e)?Yfo(e):e)}a(O$r,"RemoveOptionalFromRest");function Kfo(t,e){return zfo(t)?By($Ce(O$r(t),e)):$Ce(O$r(t),e)}a(Kfo,"ResolveIntersect");function X9e(t,e={}){if(t.length===1)return wt(t[0],e);if(t.length===0)return Xo(e);if(t.some(r=>ec(r)))throw new Error("Cannot intersect transform types");return Kfo(t,e)}a(X9e,"IntersectEvaluated");p();function Fy(t,e){if(t.length===1)return wt(t[0],e);if(t.length===0)return Xo(e);if(t.some(r=>ec(r)))throw new Error("Cannot intersect transform types");return $Ce(t,e)}a(Fy,"Intersect");p();function VI(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new qi("Ref: $ref must be a string");return wt({[Tt]:"Ref",$ref:e},r)}a(VI,"Ref");function Jfo(t,e){return au("Awaited",[au(t,e)])}a(Jfo,"FromComputed");function Zfo(t){return au("Awaited",[VI(t)])}a(Zfo,"FromRef");function Xfo(t){return Fy(L$r(t))}a(Xfo,"FromIntersect");function epo(t){return tc(L$r(t))}a(epo,"FromUnion");function tpo(t){return Uoe(t)}a(tpo,"FromPromise");function L$r(t){return t.map(e=>Uoe(e))}a(L$r,"FromRest");function Uoe(t,e){return wt(Mk(t)?Jfo(t.target,t.parameters):af(t)?Xfo(t.allOf):Ta(t)?epo(t.anyOf):PW(t)?tpo(t.item):jf(t)?Zfo(t.$ref):t,e)}a(Uoe,"Awaited");p();p();p();p();function B$r(t){let e=[];for(let r of t)e.push(aC(r));return e}a(B$r,"FromRest");function rpo(t){let e=B$r(t);return E$r(e)}a(rpo,"FromIntersect");function npo(t){let e=B$r(t);return y$r(e)}a(npo,"FromUnion");function ipo(t){return t.map((e,r)=>r.toString())}a(ipo,"FromTuple");function opo(t){return["[number]"]}a(opo,"FromArray");function spo(t){return globalThis.Object.getOwnPropertyNames(t)}a(spo,"FromProperties");function apo(t){return OPt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(apo,"FromPatternProperties");function aC(t){return af(t)?rpo(t.allOf):Ta(t)?npo(t.anyOf):q1(t)?ipo(t.items??[]):Nk(t)?opo(t.items):Fp(t)?spo(t.properties):DW(t)?apo(t.patternProperties):[]}a(aC,"KeyOfPropertyKeys");var OPt=!1;function mB(t){OPt=!0;let e=aC(t);return OPt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(mB,"KeyOfPattern");function cpo(t,e){return au("KeyOf",[au(t,e)])}a(cpo,"FromComputed");function lpo(t){return au("KeyOf",[VI(t)])}a(lpo,"FromRef");function upo(t,e){let r=aC(t),n=dpo(r),o=rM(n);return wt(o,e)}a(upo,"KeyOfFromType");function dpo(t){return t.map(e=>e==="[number]"?HI():ca(e))}a(dpo,"KeyOfPropertyKeysToRest");function Qoe(t,e){return Mk(t)?cpo(t.target,t.parameters):jf(t)?lpo(t.$ref):Uu(t)?F$r(t,e):upo(t,e)}a(Qoe,"KeyOf");function fpo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Qoe(t[n],Bu(e));return r}a(fpo,"FromProperties");function ppo(t,e){return fpo(t.properties,e)}a(ppo,"FromMappedResult");function F$r(t,e){let r=ppo(t,e);return Qa(r)}a(F$r,"KeyOfFromMappedResult");p();function tUe(t){let e=aC(t),r=HCe(t,e);return e.map((n,o)=>[e[o],r[o]])}a(tUe,"KeyOfPropertyEntries");function hpo(t){let e=[];for(let r of t)e.push(...aC(r));return A$r(e)}a(hpo,"CompositeKeys");function mpo(t){return t.filter(e=>!hU(e))}a(mpo,"FilterNever");function gpo(t,e){let r=[];for(let n of t)r.push(...HCe(n,[e]));return mpo(r)}a(gpo,"CompositeProperty");function Apo(t,e){let r={};for(let n of e)r[n]=X9e(gpo(t,n));return r}a(Apo,"CompositeProperties");function U$r(t,e){let r=hpo(t),n=Apo(t,r);return rc(n,e)}a(U$r,"Composite");p();p();function rUe(t){return wt({[Tt]:"Date",type:"Date"},t)}a(rUe,"Date");p();function nUe(t){return wt({[Tt]:"Null",type:"null"},t)}a(nUe,"Null");p();function iUe(t){return wt({[Tt]:"Symbol",type:"symbol"},t)}a(iUe,"Symbol");p();function oUe(t){return wt({[Tt]:"Undefined",type:"undefined"},t)}a(oUe,"Undefined");p();function sUe(t){return wt({[Tt]:"Uint8Array",type:"Uint8Array"},t)}a(sUe,"Uint8Array");p();function Qk(t){return wt({[Tt]:"Unknown"},t)}a(Qk,"Unknown");function ypo(t){return t.map(e=>LPt(e,!1))}a(ypo,"FromArray");function Epo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=sC(LPt(t[r],!1));return e}a(Epo,"FromProperties");function aUe(t,e){return e===!0?t:sC(t)}a(aUe,"ConditionalReadonly");function LPt(t,e){return hPt(t)?aUe(yU(),e):gPt(t)?aUe(yU(),e):Lp(t)?sC(GI(ypo(t))):aB(t)?sUe():xW(t)?rUe():Yc(t)?aUe(rc(Epo(t)),e):mPt(t)?aUe(tM([],Qk()),e):Bp(t)?oUe():APt(t)?nUe():yPt(t)?iUe():DCe(t)?Boe():L1(t)?ca(t):sB(t)?ca(t):Ql(t)?ca(t):rc({})}a(LPt,"FromValue");function Q$r(t,e){return wt(LPt(t,!0),e)}a(Q$r,"Const");p();function q$r(t,e){return Ok(t)?GI(t.parameters,e):Xo(e)}a(q$r,"ConstructorParameters");p();function j$r(t,e){if(Bp(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=>ca(s));return tc(o,{...e,[jI]:"Enum"})}a(j$r,"Enum");p();p();p();var FPt=class extends qi{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 WI(t){return t===Rt.False?t:Rt.True}a(WI,"IntoBooleanResult");function qoe(t){throw new FPt(t)}a(qoe,"Throw");function Ih(t){return it.IsNever(t)||it.IsIntersect(t)||it.IsUnion(t)||it.IsUnknown(t)||it.IsAny(t)}a(Ih,"IsStructuralRight");function xh(t,e){return it.IsNever(e)?Y$r(t,e):it.IsIntersect(e)?cUe(t,e):it.IsUnion(e)?jPt(t,e):it.IsUnknown(e)?X$r(t,e):it.IsAny(e)?qPt(t,e):qoe("StructuralRight")}a(xh,"StructuralRight");function qPt(t,e){return Rt.True}a(qPt,"FromAnyRight");function _po(t,e){return it.IsIntersect(e)?cUe(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(_po,"FromAny");function vpo(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)?Rt.True:Rt.False}a(vpo,"FromArrayRight");function Cpo(t,e){return it.IsObject(e)&&lUe(e)?Rt.True:Ih(e)?xh(t,e):it.IsArray(e)?WI(Jc(t.items,e.items)):Rt.False}a(Cpo,"FromArray");function bpo(t,e){return Ih(e)?xh(t,e):it.IsAsyncIterator(e)?WI(Jc(t.items,e.items)):Rt.False}a(bpo,"FromAsyncIterator");function Spo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsBigInt(e)?Rt.True:Rt.False}a(Spo,"FromBigInt");function W$r(t,e){return it.IsLiteralBoolean(t)||it.IsBoolean(t)?Rt.True:Rt.False}a(W$r,"FromBooleanRight");function Tpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsBoolean(e)?Rt.True:Rt.False}a(Tpo,"FromBoolean");function Ipo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsConstructor(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>WI(Jc(e.parameters[n],r))===Rt.True)?WI(Jc(t.returns,e.returns)):Rt.False:Rt.False}a(Ipo,"FromConstructor");function xpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsDate(e)?Rt.True:Rt.False}a(xpo,"FromDate");function wpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsFunction(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>WI(Jc(e.parameters[n],r))===Rt.True)?WI(Jc(t.returns,e.returns)):Rt.False:Rt.False}a(wpo,"FromFunction");function z$r(t,e){return it.IsLiteral(t)&&Ly.IsNumber(t.const)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(z$r,"FromIntegerRight");function Rpo(t,e){return it.IsInteger(e)||it.IsNumber(e)?Rt.True:Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):Rt.False}a(Rpo,"FromInteger");function cUe(t,e){return e.allOf.every(r=>Jc(t,r)===Rt.True)?Rt.True:Rt.False}a(cUe,"FromIntersectRight");function kpo(t,e){return t.allOf.some(r=>Jc(r,e)===Rt.True)?Rt.True:Rt.False}a(kpo,"FromIntersect");function Ppo(t,e){return Ih(e)?xh(t,e):it.IsIterator(e)?WI(Jc(t.items,e.items)):Rt.False}a(Ppo,"FromIterator");function Dpo(t,e){return it.IsLiteral(e)&&e.const===t.const?Rt.True:Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsString(e)?Z$r(t,e):it.IsNumber(e)?K$r(t,e):it.IsInteger(e)?z$r(t,e):it.IsBoolean(e)?W$r(t,e):Rt.False}a(Dpo,"FromLiteral");function Y$r(t,e){return Rt.False}a(Y$r,"FromNeverRight");function Npo(t,e){return Rt.True}a(Npo,"FromNever");function H$r(t){let[e,r]=[t,0];for(;it.IsNot(e);)e=e.not,r+=1;return r%2===0?e:Qk()}a(H$r,"UnwrapTNot");function Mpo(t,e){return it.IsNot(t)?Jc(H$r(t),e):it.IsNot(e)?Jc(t,H$r(e)):qoe("Invalid fallthrough for Not")}a(Mpo,"FromNot");function Opo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsNull(e)?Rt.True:Rt.False}a(Opo,"FromNull");function K$r(t,e){return it.IsLiteralNumber(t)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(K$r,"FromNumberRight");function Lpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsInteger(e)||it.IsNumber(e)?Rt.True:Rt.False}a(Lpo,"FromNumber");function cC(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(cC,"IsObjectPropertyCount");function G$r(t){return lUe(t)}a(G$r,"IsObjectStringLike");function $$r(t){return cC(t,0)||cC(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($$r,"IsObjectSymbolLike");function BPt(t){return cC(t,0)}a(BPt,"IsObjectNumberLike");function V$r(t){return cC(t,0)}a(V$r,"IsObjectBooleanLike");function Bpo(t){return cC(t,0)}a(Bpo,"IsObjectBigIntLike");function Fpo(t){return cC(t,0)}a(Fpo,"IsObjectDateLike");function Upo(t){return lUe(t)}a(Upo,"IsObjectUint8ArrayLike");function Qpo(t){let e=HI();return cC(t,0)||cC(t,1)&&"length"in t.properties&&WI(Jc(t.properties.length,e))===Rt.True}a(Qpo,"IsObjectFunctionLike");function qpo(t){return cC(t,0)}a(qpo,"IsObjectConstructorLike");function lUe(t){let e=HI();return cC(t,0)||cC(t,1)&&"length"in t.properties&&WI(Jc(t.properties.length,e))===Rt.True}a(lUe,"IsObjectArrayLike");function jpo(t){let e=tM([yU()],yU());return cC(t,0)||cC(t,1)&&"then"in t.properties&&WI(Jc(t.properties.then,e))===Rt.True}a(jpo,"IsObjectPromiseLike");function J$r(t,e){return Jc(t,e)===Rt.False||it.IsOptional(t)&&!it.IsOptional(e)?Rt.False:Rt.True}a(J$r,"Property");function Uy(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)||it.IsLiteralString(t)&&G$r(e)||it.IsLiteralNumber(t)&&BPt(e)||it.IsLiteralBoolean(t)&&V$r(e)||it.IsSymbol(t)&&$$r(e)||it.IsBigInt(t)&&Bpo(e)||it.IsString(t)&&G$r(e)||it.IsSymbol(t)&&$$r(e)||it.IsNumber(t)&&BPt(e)||it.IsInteger(t)&&BPt(e)||it.IsBoolean(t)&&V$r(e)||it.IsUint8Array(t)&&Upo(e)||it.IsDate(t)&&Fpo(e)||it.IsConstructor(t)&&qpo(e)||it.IsFunction(t)&&Qpo(e)?Rt.True:it.IsRecord(t)&&it.IsString(UPt(t))?e[jI]==="Record"?Rt.True:Rt.False:it.IsRecord(t)&&it.IsNumber(UPt(t))&&cC(e,0)?Rt.True:Rt.False}a(Uy,"FromObjectRight");function Hpo(t,e){return Ih(e)?xh(t,e):it.IsRecord(e)?zI(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(J$r(t.properties[r],e.properties[r])===Rt.False)return Rt.False}return Rt.True})():Rt.False}a(Hpo,"FromObject");function Gpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)&&jpo(e)?Rt.True:it.IsPromise(e)?WI(Jc(t.item,e.item)):Rt.False}a(Gpo,"FromPromise");function UPt(t){return gU in t.patternProperties?HI():AU in t.patternProperties?C_():qoe("Unknown record key pattern")}a(UPt,"RecordKey");function QPt(t){return gU in t.patternProperties?t.patternProperties[gU]:AU in t.patternProperties?t.patternProperties[AU]:qoe("Unable to get record value schema")}a(QPt,"RecordValue");function zI(t,e){let[r,n]=[UPt(e),QPt(e)];return it.IsLiteralString(t)&&it.IsNumber(r)&&WI(Jc(t,n))===Rt.True?Rt.True:it.IsUint8Array(t)&&it.IsNumber(r)||it.IsString(t)&&it.IsNumber(r)||it.IsArray(t)&&it.IsNumber(r)?Jc(t,n):it.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(J$r(n,t.properties[o])===Rt.False)return Rt.False;return Rt.True})():Rt.False}a(zI,"FromRecordRight");function $po(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?Jc(QPt(t),QPt(e)):Rt.False}a($po,"FromRecord");function Vpo(t,e){let r=it.IsRegExp(t)?C_():t,n=it.IsRegExp(e)?C_():e;return Jc(r,n)}a(Vpo,"FromRegExp");function Z$r(t,e){return it.IsLiteral(t)&&Ly.IsString(t.const)||it.IsString(t)?Rt.True:Rt.False}a(Z$r,"FromStringRight");function Wpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsString(e)?Rt.True:Rt.False}a(Wpo,"FromString");function zpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsSymbol(e)?Rt.True:Rt.False}a(zpo,"FromSymbol");function Ypo(t,e){return it.IsTemplateLiteral(t)?Jc(MW(t),e):it.IsTemplateLiteral(e)?Jc(t,MW(e)):qoe("Invalid fallthrough for TemplateLiteral")}a(Ypo,"FromTemplateLiteral");function Kpo(t,e){return it.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Jc(r,e.items)===Rt.True)}a(Kpo,"IsArrayOfTuple");function Jpo(t,e){return it.IsNever(t)?Rt.True:it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:Rt.False}a(Jpo,"FromTupleRight");function Zpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)&&lUe(e)||it.IsArray(e)&&Kpo(t,e)?Rt.True:it.IsTuple(e)?Ly.IsUndefined(t.items)&&!Ly.IsUndefined(e.items)||!Ly.IsUndefined(t.items)&&Ly.IsUndefined(e.items)?Rt.False:Ly.IsUndefined(t.items)&&!Ly.IsUndefined(e.items)||t.items.every((r,n)=>Jc(r,e.items[n])===Rt.True)?Rt.True:Rt.False:Rt.False}a(Zpo,"FromTuple");function Xpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsUint8Array(e)?Rt.True:Rt.False}a(Xpo,"FromUint8Array");function eho(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsVoid(e)?nho(t,e):it.IsUndefined(e)?Rt.True:Rt.False}a(eho,"FromUndefined");function jPt(t,e){return e.anyOf.some(r=>Jc(t,r)===Rt.True)?Rt.True:Rt.False}a(jPt,"FromUnionRight");function tho(t,e){return t.anyOf.every(r=>Jc(r,e)===Rt.True)?Rt.True:Rt.False}a(tho,"FromUnion");function X$r(t,e){return Rt.True}a(X$r,"FromUnknownRight");function rho(t,e){return it.IsNever(e)?Y$r(t,e):it.IsIntersect(e)?cUe(t,e):it.IsUnion(e)?jPt(t,e):it.IsAny(e)?qPt(t,e):it.IsString(e)?Z$r(t,e):it.IsNumber(e)?K$r(t,e):it.IsInteger(e)?z$r(t,e):it.IsBoolean(e)?W$r(t,e):it.IsArray(e)?vpo(t,e):it.IsTuple(e)?Jpo(t,e):it.IsObject(e)?Uy(t,e):it.IsUnknown(e)?Rt.True:Rt.False}a(rho,"FromUnknown");function nho(t,e){return it.IsUndefined(t)||it.IsUndefined(t)?Rt.True:Rt.False}a(nho,"FromVoidRight");function iho(t,e){return it.IsIntersect(e)?cUe(t,e):it.IsUnion(e)?jPt(t,e):it.IsUnknown(e)?X$r(t,e):it.IsAny(e)?qPt(t,e):it.IsObject(e)?Uy(t,e):it.IsVoid(e)?Rt.True:Rt.False}a(iho,"FromVoid");function Jc(t,e){return it.IsTemplateLiteral(t)||it.IsTemplateLiteral(e)?Ypo(t,e):it.IsRegExp(t)||it.IsRegExp(e)?Vpo(t,e):it.IsNot(t)||it.IsNot(e)?Mpo(t,e):it.IsAny(t)?_po(t,e):it.IsArray(t)?Cpo(t,e):it.IsBigInt(t)?Spo(t,e):it.IsBoolean(t)?Tpo(t,e):it.IsAsyncIterator(t)?bpo(t,e):it.IsConstructor(t)?Ipo(t,e):it.IsDate(t)?xpo(t,e):it.IsFunction(t)?wpo(t,e):it.IsInteger(t)?Rpo(t,e):it.IsIntersect(t)?kpo(t,e):it.IsIterator(t)?Ppo(t,e):it.IsLiteral(t)?Dpo(t,e):it.IsNever(t)?Npo(t,e):it.IsNull(t)?Opo(t,e):it.IsNumber(t)?Lpo(t,e):it.IsObject(t)?Hpo(t,e):it.IsRecord(t)?$po(t,e):it.IsString(t)?Wpo(t,e):it.IsSymbol(t)?zpo(t,e):it.IsTuple(t)?Zpo(t,e):it.IsPromise(t)?Gpo(t,e):it.IsUint8Array(t)?Xpo(t,e):it.IsUndefined(t)?eho(t,e):it.IsUnion(t)?tho(t,e):it.IsUnknown(t)?rho(t,e):it.IsVoid(t)?iho(t,e):qoe(`Unknown left type operand '${t[Tt]}'`)}a(Jc,"Visit");function _U(t,e){return Jc(t,e)}a(_U,"ExtendsCheck");p();p();p();function oho(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=joe(t[c],e,r,n,Bu(o));return s}a(oho,"FromProperties");function sho(t,e,r,n,o){return oho(t.properties,e,r,n,o)}a(sho,"FromMappedResult");function eVr(t,e,r,n,o){let s=sho(t,e,r,n,o);return Qa(s)}a(eVr,"ExtendsFromMappedResult");function aho(t,e,r,n){let o=_U(t,e);return o===Rt.Union?tc([r,n]):o===Rt.True?r:n}a(aho,"ExtendsResolve");function joe(t,e,r,n,o){return Uu(t)?eVr(t,e,r,n,o):U1(t)?wt(tVr(t,e,r,n,o)):wt(aho(t,e,r,n),o)}a(joe,"Extends");function cho(t,e,r,n,o){return{[t]:joe(ca(t),e,r,n,Bu(o))}}a(cho,"FromPropertyKey");function lho(t,e,r,n,o){return t.reduce((s,c)=>({...s,...cho(c,e,r,n,o)}),{})}a(lho,"FromPropertyKeys");function uho(t,e,r,n,o){return lho(t.keys,e,r,n,o)}a(uho,"FromMappedKey");function tVr(t,e,r,n,o){let s=uho(t,e,r,n,o);return Qa(s)}a(tVr,"ExtendsFromMappedKey");p();function dho(t){return t.allOf.every(e=>gB(e))}a(dho,"Intersect");function fho(t){return t.anyOf.some(e=>gB(e))}a(fho,"Union");function pho(t){return!gB(t.not)}a(pho,"Not");function gB(t){return t[Tt]==="Intersect"?dho(t):t[Tt]==="Union"?fho(t):t[Tt]==="Not"?pho(t):t[Tt]==="Undefined"}a(gB,"ExtendsUndefinedCheck");p();function rVr(t,e){return Hoe(MW(t),e)}a(rVr,"ExcludeFromTemplateLiteral");function hho(t,e){let r=t.filter(n=>_U(n,e)===Rt.False);return r.length===1?r[0]:tc(r)}a(hho,"ExcludeRest");function Hoe(t,e,r={}){return Q1(t)?wt(rVr(t,e),r):Uu(t)?wt(nVr(t,e),r):wt(Ta(t)?hho(t.anyOf,e):_U(t,e)!==Rt.False?Xo():t,r)}a(Hoe,"Exclude");function mho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Hoe(t[n],e);return r}a(mho,"FromProperties");function gho(t,e){return mho(t.properties,e)}a(gho,"FromMappedResult");function nVr(t,e){let r=gho(t,e);return Qa(r)}a(nVr,"ExcludeFromMappedResult");p();p();p();function iVr(t,e){return Goe(MW(t),e)}a(iVr,"ExtractFromTemplateLiteral");function Aho(t,e){let r=t.filter(n=>_U(n,e)!==Rt.False);return r.length===1?r[0]:tc(r)}a(Aho,"ExtractRest");function Goe(t,e,r){return Q1(t)?wt(iVr(t,e),r):Uu(t)?wt(oVr(t,e),r):wt(Ta(t)?Aho(t.anyOf,e):_U(t,e)!==Rt.False?t:Xo(),r)}a(Goe,"Extract");function yho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Goe(t[n],e);return r}a(yho,"FromProperties");function Eho(t,e){return yho(t.properties,e)}a(Eho,"FromMappedResult");function oVr(t,e){let r=Eho(t,e);return Qa(r)}a(oVr,"ExtractFromMappedResult");p();function sVr(t,e){return Ok(t)?wt(t.returns,e):Xo(e)}a(sVr,"InstanceType");p();p();function uUe(t){return sC(By(t))}a(uUe,"ReadonlyOptional");p();function OW(t,e,r){return wt({[Tt]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(OW,"RecordCreateFromPattern");function HPt(t,e,r){let n={};for(let o of t)n[o]=e;return rc(n,{...r,[jI]:"Record"})}a(HPt,"RecordCreateFromKeys");function _ho(t,e,r){return K9e(t)?HPt(oC(t),e,r):OW(t.pattern,e,r)}a(_ho,"FromTemplateLiteralKey");function vho(t,e,r){return HPt(oC(tc(t)),e,r)}a(vho,"FromUnionKey");function Cho(t,e,r){return HPt([t.toString()],e,r)}a(Cho,"FromLiteralKey");function bho(t,e,r){return OW(t.source,e,r)}a(bho,"FromRegExpKey");function Sho(t,e,r){let n=Bp(t.pattern)?AU:t.pattern;return OW(n,e,r)}a(Sho,"FromStringKey");function Tho(t,e,r){return OW(AU,e,r)}a(Tho,"FromAnyKey");function Iho(t,e,r){return OW(m$r,e,r)}a(Iho,"FromNeverKey");function xho(t,e,r){return rc({true:e,false:e},r)}a(xho,"FromBooleanKey");function who(t,e,r){return OW(gU,e,r)}a(who,"FromIntegerKey");function Rho(t,e,r){return OW(gU,e,r)}a(Rho,"FromNumberKey");function dUe(t,e,r={}){return Ta(t)?vho(t.anyOf,e,r):Q1(t)?_ho(t,e,r):F1(t)?Cho(t.const,e,r):uB(t)?xho(t,e,r):Bk(t)?who(t,e,r):Fk(t)?Rho(t,e,r):CPt(t)?bho(t,e,r):dB(t)?Sho(t,e,r):_Pt(t)?Tho(t,e,r):hU(t)?Iho(t,e,r):Xo(r)}a(dUe,"Record");function fUe(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(fUe,"RecordPattern");function aVr(t){let e=fUe(t);return e===AU?C_():e===gU?HI():C_({pattern:e})}a(aVr,"RecordKey");function pUe(t){return t.patternProperties[fUe(t)]}a(pUe,"RecordValue");function kho(t,e){return e.parameters=VCe(t,e.parameters),e.returns=qk(t,e.returns),e}a(kho,"FromConstructor");function Pho(t,e){return e.parameters=VCe(t,e.parameters),e.returns=qk(t,e.returns),e}a(Pho,"FromFunction");function Dho(t,e){return e.allOf=VCe(t,e.allOf),e}a(Dho,"FromIntersect");function Nho(t,e){return e.anyOf=VCe(t,e.anyOf),e}a(Nho,"FromUnion");function Mho(t,e){return Bp(e.items)||(e.items=VCe(t,e.items)),e}a(Mho,"FromTuple");function Oho(t,e){return e.items=qk(t,e.items),e}a(Oho,"FromArray");function Lho(t,e){return e.items=qk(t,e.items),e}a(Lho,"FromAsyncIterator");function Bho(t,e){return e.items=qk(t,e.items),e}a(Bho,"FromIterator");function Fho(t,e){return e.item=qk(t,e.item),e}a(Fho,"FromPromise");function Uho(t,e){let r=Hho(t,e.properties);return{...e,...rc(r)}}a(Uho,"FromObject");function Qho(t,e){let r=qk(t,aVr(e)),n=qk(t,pUe(e)),o=dUe(r,n);return{...e,...o}}a(Qho,"FromRecord");function qho(t,e){return e.index in t?t[e.index]:Qk()}a(qho,"FromArgument");function jho(t,e){let r=woe(e),n=iC(e),o=qk(t,e);return r&&n?uUe(o):r&&!n?sC(o):!r&&n?By(o):o}a(jho,"FromProperty");function Hho(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:jho(t,e[n])}),{})}a(Hho,"FromProperties");function VCe(t,e){return e.map(r=>qk(t,r))}a(VCe,"FromTypes");function qk(t,e){return Ok(e)?kho(t,e):Lk(e)?Pho(t,e):af(e)?Dho(t,e):Ta(e)?Nho(t,e):q1(e)?Mho(t,e):Nk(e)?Oho(t,e):wW(e)?Lho(t,e):kW(e)?Bho(t,e):PW(e)?Fho(t,e):Fp(e)?Uho(t,e):DW(e)?Qho(t,e):vPt(e)?qho(t,e):e}a(qk,"FromType");function cVr(t,e){return qk(e,Ioe(t))}a(cVr,"Instantiate");p();function lVr(t){return wt({[Tt]:"Integer",type:"integer"},t)}a(lVr,"Integer");p();p();p();function Gho(t,e,r){return{[t]:jk(ca(t),e,Bu(r))}}a(Gho,"MappedIntrinsicPropertyKey");function $ho(t,e,r){return t.reduce((o,s)=>({...o,...Gho(s,e,r)}),{})}a($ho,"MappedIntrinsicPropertyKeys");function Vho(t,e,r){return $ho(t.keys,e,r)}a(Vho,"MappedIntrinsicProperties");function uVr(t,e,r){let n=Vho(t,e,r);return Qa(n)}a(uVr,"IntrinsicFromMappedKey");function Who(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(Who,"ApplyUncapitalize");function zho(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(zho,"ApplyCapitalize");function Yho(t){return t.toUpperCase()}a(Yho,"ApplyUppercase");function Kho(t){return t.toLowerCase()}a(Kho,"ApplyLowercase");function Jho(t,e,r){let n=Ooe(t.pattern);if(!NW(n))return{...t,pattern:dVr(t.pattern,e)};let c=[...jCe(n)].map(d=>ca(d)),l=fVr(c,e),u=tc(l);return Z9e([u],r)}a(Jho,"FromTemplateLiteral");function dVr(t,e){return typeof t=="string"?e==="Uncapitalize"?Who(t):e==="Capitalize"?zho(t):e==="Uppercase"?Yho(t):e==="Lowercase"?Kho(t):t:t.toString()}a(dVr,"FromLiteralValue");function fVr(t,e){return t.map(r=>jk(r,e))}a(fVr,"FromRest");function jk(t,e,r={}){return U1(t)?uVr(t,e,r):Q1(t)?Jho(t,e,r):Ta(t)?tc(fVr(t.anyOf,e),r):F1(t)?ca(dVr(t.const,e),r):wt(t,r)}a(jk,"Intrinsic");function pVr(t,e={}){return jk(t,"Capitalize",e)}a(pVr,"Capitalize");p();function hVr(t,e={}){return jk(t,"Lowercase",e)}a(hVr,"Lowercase");p();function mVr(t,e={}){return jk(t,"Uncapitalize",e)}a(mVr,"Uncapitalize");p();function gVr(t,e={}){return jk(t,"Uppercase",e)}a(gVr,"Uppercase");p();p();p();p();p();function Zho(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=vU(t[o],e,Bu(r));return n}a(Zho,"FromProperties");function Xho(t,e,r){return Zho(t.properties,e,r)}a(Xho,"FromMappedResult");function AVr(t,e,r){let n=Xho(t,e,r);return Qa(n)}a(AVr,"OmitFromMappedResult");function emo(t,e){return t.map(r=>GPt(r,e))}a(emo,"FromIntersect");function tmo(t,e){return t.map(r=>GPt(r,e))}a(tmo,"FromUnion");function rmo(t,e){let{[e]:r,...n}=t;return n}a(rmo,"FromProperty");function nmo(t,e){return e.reduce((r,n)=>rmo(r,n),t)}a(nmo,"FromProperties");function imo(t,e,r){let n=cf(t,[wd,"$id","required","properties"]),o=nmo(r,e);return rc(o,n)}a(imo,"FromObject");function omo(t){let e=t.reduce((r,n)=>W9e(n)?[...r,ca(n)]:r,[]);return tc(e)}a(omo,"UnionFromPropertyKeys");function GPt(t,e){return af(t)?Fy(emo(t.allOf,e)):Ta(t)?tc(tmo(t.anyOf,e)):Fp(t)?imo(t,e,t.properties):rc({})}a(GPt,"OmitResolve");function vU(t,e,r){let n=Lp(e)?omo(e):e,o=Rd(e)?oC(e):e,s=jf(t),c=jf(e);return Uu(t)?AVr(t,o,r):U1(e)?yVr(t,e,r):s&&c?au("Omit",[t,n],r):!s&&c?au("Omit",[t,n],r):s&&!c?au("Omit",[t,n],r):wt({...GPt(t,o),...r})}a(vU,"Omit");function smo(t,e,r){return{[e]:vU(t,[e],Bu(r))}}a(smo,"FromPropertyKey");function amo(t,e,r){return e.reduce((n,o)=>({...n,...smo(t,o,r)}),{})}a(amo,"FromPropertyKeys");function cmo(t,e,r){return amo(t,e.keys,r)}a(cmo,"FromMappedKey");function yVr(t,e,r){let n=cmo(t,e,r);return Qa(n)}a(yVr,"OmitFromMappedKey");p();p();p();function lmo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=CU(t[o],e,Bu(r));return n}a(lmo,"FromProperties");function umo(t,e,r){return lmo(t.properties,e,r)}a(umo,"FromMappedResult");function EVr(t,e,r){let n=umo(t,e,r);return Qa(n)}a(EVr,"PickFromMappedResult");function dmo(t,e){return t.map(r=>$Pt(r,e))}a(dmo,"FromIntersect");function fmo(t,e){return t.map(r=>$Pt(r,e))}a(fmo,"FromUnion");function pmo(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(pmo,"FromProperties");function hmo(t,e,r){let n=cf(t,[wd,"$id","required","properties"]),o=pmo(r,e);return rc(o,n)}a(hmo,"FromObject");function mmo(t){let e=t.reduce((r,n)=>W9e(n)?[...r,ca(n)]:r,[]);return tc(e)}a(mmo,"UnionFromPropertyKeys");function $Pt(t,e){return af(t)?Fy(dmo(t.allOf,e)):Ta(t)?tc(fmo(t.anyOf,e)):Fp(t)?hmo(t,e,t.properties):rc({})}a($Pt,"PickResolve");function CU(t,e,r){let n=Lp(e)?mmo(e):e,o=Rd(e)?oC(e):e,s=jf(t),c=jf(e);return Uu(t)?EVr(t,o,r):U1(e)?_Vr(t,e,r):s&&c?au("Pick",[t,n],r):!s&&c?au("Pick",[t,n],r):s&&!c?au("Pick",[t,n],r):wt({...$Pt(t,o),...r})}a(CU,"Pick");function gmo(t,e,r){return{[e]:CU(t,[e],Bu(r))}}a(gmo,"FromPropertyKey");function Amo(t,e,r){return e.reduce((n,o)=>({...n,...gmo(t,o,r)}),{})}a(Amo,"FromPropertyKeys");function ymo(t,e,r){return Amo(t,e.keys,r)}a(ymo,"FromMappedKey");function _Vr(t,e,r){let n=ymo(t,e,r);return Qa(n)}a(_Vr,"PickFromMappedKey");p();p();function Emo(t,e){return au("Partial",[au(t,e)])}a(Emo,"FromComputed");function _mo(t){return au("Partial",[VI(t)])}a(_mo,"FromRef");function vmo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=By(t[r]);return e}a(vmo,"FromProperties");function Cmo(t,e){let r=cf(t,[wd,"$id","required","properties"]),n=vmo(e);return rc(n,r)}a(Cmo,"FromObject");function vVr(t){return t.map(e=>CVr(e))}a(vVr,"FromRest");function CVr(t){return Mk(t)?Emo(t.target,t.parameters):jf(t)?_mo(t.$ref):af(t)?Fy(vVr(t.allOf)):Ta(t)?tc(vVr(t.anyOf)):Fp(t)?Cmo(t,t.properties):RW(t)||uB(t)||Bk(t)||F1(t)||OCe(t)||Fk(t)||dB(t)||LCe(t)||fB(t)?t:rc({})}a(CVr,"PartialResolve");function $oe(t,e){return Uu(t)?bVr(t,e):wt({...CVr(t),...e})}a($oe,"Partial");function bmo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=$oe(t[n],Bu(e));return r}a(bmo,"FromProperties");function Smo(t,e){return bmo(t.properties,e)}a(Smo,"FromMappedResult");function bVr(t,e){let r=Smo(t,e);return Qa(r)}a(bVr,"PartialFromMappedResult");p();p();function Tmo(t,e){return au("Required",[au(t,e)])}a(Tmo,"FromComputed");function Imo(t){return au("Required",[VI(t)])}a(Imo,"FromRef");function xmo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=cf(t[r],[hA]);return e}a(xmo,"FromProperties");function wmo(t,e){let r=cf(t,[wd,"$id","required","properties"]),n=xmo(e);return rc(n,r)}a(wmo,"FromObject");function SVr(t){return t.map(e=>TVr(e))}a(SVr,"FromRest");function TVr(t){return Mk(t)?Tmo(t.target,t.parameters):jf(t)?Imo(t.$ref):af(t)?Fy(SVr(t.allOf)):Ta(t)?tc(SVr(t.anyOf)):Fp(t)?wmo(t,t.properties):RW(t)||uB(t)||Bk(t)||F1(t)||OCe(t)||Fk(t)||dB(t)||LCe(t)||fB(t)?t:rc({})}a(TVr,"RequiredResolve");function Voe(t,e){return Uu(t)?IVr(t,e):wt({...TVr(t),...e})}a(Voe,"Required");function Rmo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Voe(t[n],e);return r}a(Rmo,"FromProperties");function kmo(t,e){return Rmo(t.properties,e)}a(kmo,"FromMappedResult");function IVr(t,e){let r=kmo(t,e);return Qa(r)}a(IVr,"RequiredFromMappedResult");function Pmo(t,e){return e.map(r=>jf(r)?VPt(t,r.$ref):j1(t,r))}a(Pmo,"DereferenceParameters");function VPt(t,e){return e in t?jf(t[e])?VPt(t,t[e].$ref):j1(t,t[e]):Xo()}a(VPt,"Dereference");function Dmo(t){return Uoe(t[0])}a(Dmo,"FromAwaited");function Nmo(t){return EU(t[0],t[1])}a(Nmo,"FromIndex");function Mmo(t){return Qoe(t[0])}a(Mmo,"FromKeyOf");function Omo(t){return $oe(t[0])}a(Omo,"FromPartial");function Lmo(t){return vU(t[0],t[1])}a(Lmo,"FromOmit");function Bmo(t){return CU(t[0],t[1])}a(Bmo,"FromPick");function Fmo(t){return Voe(t[0])}a(Fmo,"FromRequired");function Umo(t,e,r){let n=Pmo(t,r);return e==="Awaited"?Dmo(n):e==="Index"?Nmo(n):e==="KeyOf"?Mmo(n):e==="Partial"?Omo(n):e==="Omit"?Lmo(n):e==="Pick"?Bmo(n):e==="Required"?Fmo(n):Xo()}a(Umo,"FromComputed");function Qmo(t,e){return Poe(j1(t,e))}a(Qmo,"FromArray");function qmo(t,e){return Doe(j1(t,e))}a(qmo,"FromAsyncIterator");function jmo(t,e,r){return Noe(WCe(t,e),j1(t,r))}a(jmo,"FromConstructor");function Hmo(t,e,r){return tM(WCe(t,e),j1(t,r))}a(Hmo,"FromFunction");function Gmo(t,e){return Fy(WCe(t,e))}a(Gmo,"FromIntersect");function $mo(t,e){return Foe(j1(t,e))}a($mo,"FromIterator");function Vmo(t,e){return rc(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:j1(t,e[n])}),{}))}a(Vmo,"FromObject");function Wmo(t,e){let[r,n]=[j1(t,pUe(e)),fUe(e)],o=Ioe(e);return o.patternProperties[n]=r,o}a(Wmo,"FromRecord");function zmo(t,e){return jf(e)?{...VPt(t,e.$ref),[wd]:e[wd]}:e}a(zmo,"FromTransform");function Ymo(t,e){return GI(WCe(t,e))}a(Ymo,"FromTuple");function Kmo(t,e){return tc(WCe(t,e))}a(Kmo,"FromUnion");function WCe(t,e){return e.map(r=>j1(t,r))}a(WCe,"FromTypes");function j1(t,e){return iC(e)?wt(j1(t,cf(e,[hA])),e):woe(e)?wt(j1(t,cf(e,[Dk])),e):ec(e)?wt(zmo(t,e),e):Nk(e)?wt(Qmo(t,e.items),e):wW(e)?wt(qmo(t,e.items),e):Mk(e)?wt(Umo(t,e.target,e.parameters)):Ok(e)?wt(jmo(t,e.parameters,e.returns),e):Lk(e)?wt(Hmo(t,e.parameters,e.returns),e):af(e)?wt(Gmo(t,e.allOf),e):kW(e)?wt($mo(t,e.items),e):Fp(e)?wt(Vmo(t,e.properties),e):DW(e)?wt(Wmo(t,e)):q1(e)?wt(Ymo(t,e.items||[]),e):Ta(e)?wt(Kmo(t,e.anyOf),e):e}a(j1,"FromType");function Jmo(t,e){return e in t?j1(t,t[e]):Xo()}a(Jmo,"ComputeType");function xVr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:Jmo(t,r)}),{})}a(xVr,"ComputeModuleProperties");var WPt=class{static{a(this,"TModule")}constructor(e){let r=xVr(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:wt(this.$defs[e],r)};return wt({[Tt]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};function wVr(t){return new WPt(t)}a(wVr,"Module");p();function RVr(t,e){return wt({[Tt]:"Not",not:t},e)}a(RVr,"Not");p();function kVr(t,e){return Lk(t)?GI(t.parameters,e):Xo()}a(kVr,"Parameters");p();var Zmo=0;function PVr(t,e={}){Bp(e.$id)&&(e.$id=`T${Zmo++}`);let r=Ioe(t({[Tt]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,wt({[jI]:"Recursive",...r},e)}a(PVr,"Recursive");p();function DVr(t,e){let r=Ql(t)?new globalThis.RegExp(t):t;return wt({[Tt]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(DVr,"RegExp");p();function Xmo(t){return af(t)?t.allOf:Ta(t)?t.anyOf:q1(t)?t.items??[]:[]}a(Xmo,"RestResolve");function NVr(t){return Xmo(t)}a(NVr,"Rest");p();function MVr(t,e){return Lk(t)?wt(t.returns,e):Xo(e)}a(MVr,"ReturnType");p();var zPt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new YPt(this.schema,e)}},YPt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[wd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[wd].Decode(c)),"Decode")};return{...r,[wd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[wd]:n}}Encode(e){return ec(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function OVr(t){return new zPt(t)}a(OVr,"Transform");p();function LVr(t={}){return wt({[Tt]:t[Tt]??"Unsafe"},t)}a(LVr,"Unsafe");p();function BVr(t){return wt({[Tt]:"Void",type:"void"},t)}a(BVr,"Void");p();var KPt={};ki(KPt,{Any:()=>yU,Argument:()=>_$r,Array:()=>Poe,AsyncIterator:()=>Doe,Awaited:()=>Uoe,BigInt:()=>Boe,Boolean:()=>J9e,Capitalize:()=>pVr,Composite:()=>U$r,Const:()=>Q$r,Constructor:()=>Noe,ConstructorParameters:()=>q$r,Date:()=>rUe,Enum:()=>j$r,Exclude:()=>Hoe,Extends:()=>joe,Extract:()=>Goe,Function:()=>tM,Index:()=>EU,InstanceType:()=>sVr,Instantiate:()=>cVr,Integer:()=>lVr,Intersect:()=>Fy,Iterator:()=>Foe,KeyOf:()=>Qoe,Literal:()=>ca,Lowercase:()=>hVr,Mapped:()=>N$r,Module:()=>wVr,Never:()=>Xo,Not:()=>RVr,Null:()=>nUe,Number:()=>HI,Object:()=>rc,Omit:()=>vU,Optional:()=>By,Parameters:()=>kVr,Partial:()=>$oe,Pick:()=>CU,Promise:()=>eUe,Readonly:()=>sC,ReadonlyOptional:()=>uUe,Record:()=>dUe,Recursive:()=>PVr,Ref:()=>VI,RegExp:()=>DVr,Required:()=>Voe,Rest:()=>NVr,ReturnType:()=>MVr,String:()=>C_,Symbol:()=>iUe,TemplateLiteral:()=>Z9e,Transform:()=>OVr,Tuple:()=>GI,Uint8Array:()=>sUe,Uncapitalize:()=>mVr,Undefined:()=>oUe,Union:()=>tc,Unknown:()=>Qk,Unsafe:()=>LVr,Uppercase:()=>gVr,Void:()=>BVr});p();var S=KPt;p();p();function e0o(t){switch(t.errorType){case St.ArrayContains:return"Expected array to contain at least one matching value";case St.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case St.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case St.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case St.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case St.ArrayUniqueItems:return"Expected array elements to be unique";case St.Array:return"Expected array";case St.AsyncIterator:return"Expected AsyncIterator";case St.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case St.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case St.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case St.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case St.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case St.BigInt:return"Expected bigint";case St.Boolean:return"Expected boolean";case St.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case St.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case St.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case St.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case St.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case St.Date:return"Expected Date";case St.Function:return"Expected function";case St.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case St.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case St.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case St.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case St.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case St.Integer:return"Expected integer";case St.IntersectUnevaluatedProperties:return"Unexpected property";case St.Intersect:return"Expected all values to match";case St.Iterator:return"Expected Iterator";case St.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case St.Never:return"Never";case St.Not:return"Value should not match";case St.Null:return"Expected null";case St.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case St.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case St.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case St.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case St.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case St.Number:return"Expected number";case St.Object:return"Expected object";case St.ObjectAdditionalProperties:return"Unexpected property";case St.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case St.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case St.ObjectRequiredProperty:return"Expected required property";case St.Promise:return"Expected Promise";case St.RegExp:return"Expected string to match regular expression";case St.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case St.StringFormat:return`Expected string to match '${t.schema.format}' format`;case St.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case St.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case St.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case St.String:return"Expected string";case St.Symbol:return"Expected symbol";case St.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case St.Tuple:return"Expected tuple";case St.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case St.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case St.Uint8Array:return"Expected Uint8Array";case St.Undefined:return"Expected undefined";case St.Union:return"Expected union value";case St.Void:return"Expected void";case St.Kind:return`Expected kind '${t.schema[Tt]}'`;default:return"Unknown error type"}}a(e0o,"DefaultErrorFunction");var t0o=e0o;function FVr(){return t0o}a(FVr,"GetErrorFunction");p();var JPt=class extends qi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function r0o(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new JPt(t);return Ia(r,e)}a(r0o,"Resolve");function Y0(t,e){return!Sa(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Y0,"Pushref");function Ia(t,e){return t[Tt]==="This"||t[Tt]==="Ref"?r0o(t,e):t}a(Ia,"Deref");p();var ZPt=class extends qi{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 Woe=BigInt("14695981039346656037"),[n0o,i0o]=[BigInt("1099511628211"),BigInt("18446744073709551616")],o0o=Array.from({length:256}).map((t,e)=>BigInt(e)),UVr=new Float64Array(1),QVr=new DataView(UVr.buffer),qVr=new Uint8Array(UVr.buffer);function*s0o(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(s0o,"NumberToBytes");function a0o(t){Qy(H1.Array);for(let e of t)zoe(e)}a(a0o,"ArrayType");function c0o(t){Qy(H1.Boolean),Qy(t?1:0)}a(c0o,"BooleanType");function l0o(t){Qy(H1.BigInt),QVr.setBigInt64(0,t);for(let e of qVr)Qy(e)}a(l0o,"BigIntType");function u0o(t){Qy(H1.Date),zoe(t.getTime())}a(u0o,"DateType");function d0o(t){Qy(H1.Null)}a(d0o,"NullType");function f0o(t){Qy(H1.Number),QVr.setFloat64(0,t);for(let e of qVr)Qy(e)}a(f0o,"NumberType");function p0o(t){Qy(H1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())zoe(e),zoe(t[e])}a(p0o,"ObjectType");function h0o(t){Qy(H1.String);for(let e=0;e=t.minItems)||zs(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!K0(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=bU(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(zs(t.contains)||ai(t.minContains)||ai(t.maxContains)))return!0;let n=zs(t.contains)?t.contains:Xo(),o=r.reduce((s,c)=>K0(n,e,c)?s+1:s,0);return!(o===0||ai(t.minContains)&&ot.maxContains)}a(v0o,"FromArray");function C0o(t,e,r){return H9e(r)}a(C0o,"FromAsyncIterator");function b0o(t,e,r){return!(!pA(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(b0o,"FromBigInt");function S0o(t,e,r){return eM(r)}a(S0o,"FromBoolean");function T0o(t,e,r){return K0(t.returns,e,r.prototype)}a(T0o,"FromConstructor");function I0o(t,e,r){return!(!__(r)||zs(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||zs(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||zs(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||zs(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(I0o,"FromDate");function x0o(t,e,r){return pU(r)}a(x0o,"FromFunction");function w0o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return K0(o,[...e,...n],r)}a(w0o,"FromImport");function R0o(t,e,r){return!(!V9e(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.multipleOf)&&r%t.multipleOf!==0)}a(R0o,"FromInteger");function k0o(t,e,r){let n=t.allOf.every(o=>K0(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(mB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(Rd(t.unevaluatedProperties)){let o=new RegExp(mB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||K0(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(k0o,"FromIntersect");function P0o(t,e,r){return G9e(r)}a(P0o,"FromIterator");function D0o(t,e,r){return r===t.const}a(D0o,"FromLiteral");function N0o(t,e,r){return!1}a(N0o,"FromNever");function M0o(t,e,r){return!K0(t.not,e,r)}a(M0o,"FromNot");function O0o(t,e,r){return cB(r)}a(O0o,"FromNull");function L0o(t,e,r){return!(!su.IsNumberLike(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.multipleOf)&&r%t.multipleOf!==0)}a(L0o,"FromNumber");function B0o(t,e,r){if(!su.IsObjectLike(r)||zs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||zs(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(!K0(s,e,r[o])||(gB(s)||y0o(s))&&!(o in r))return!1}else if(su.IsExactOptionalProperty(r,o)&&!K0(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)||K0(t.additionalProperties,e,r[s])):!0}a(B0o,"FromObject");function F0o(t,e,r){return $9e(r)}a(F0o,"FromPromise");function U0o(t,e,r){if(!su.IsRecordLike(r)||zs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||zs(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)?K0(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:K0(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(U0o,"FromRecord");function Q0o(t,e,r){return K0(Ia(t,e),e,r)}a(Q0o,"FromRef");function q0o(t,e,r){let n=new RegExp(t.source,t.flags);return zs(t.minLength)&&!(r.length>=t.minLength)||zs(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(q0o,"FromRegExp");function j0o(t,e,r){return!Sa(r)||zs(t.minLength)&&!(r.length>=t.minLength)||zs(t.maxLength)&&!(r.length<=t.maxLength)||zs(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:zs(t.format)?Uk.Has(t.format)?Uk.Get(t.format)(r):!1:!0}a(j0o,"FromString");function H0o(t,e,r){return lB(r)}a(H0o,"FromSymbol");function G0o(t,e,r){return Sa(r)&&new RegExp(t.pattern).test(r)}a(G0o,"FromTemplateLiteral");function $0o(t,e,r){return K0(Ia(t,e),e,r)}a($0o,"FromThis");function V0o(t,e,r){if(!Pi(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nK0(n,e,r))}a(z0o,"FromUnion");function Y0o(t,e,r){return!(!xoe(r)||zs(t.maxByteLength)&&!(r.length<=t.maxByteLength)||zs(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Y0o,"FromUint8Array");function K0o(t,e,r){return!0}a(K0o,"FromUnknown");function J0o(t,e,r){return su.IsVoidLike(r)}a(J0o,"FromVoid");function Z0o(t,e,r){return v_.Has(t[Tt])?v_.Get(t[Tt])(t,r):!1}a(Z0o,"FromKind");function K0(t,e,r){let n=zs(t.$id)?Y0(t,e):e,o=t;switch(o[Tt]){case"Any":return E0o(o,n,r);case"Argument":return _0o(o,n,r);case"Array":return v0o(o,n,r);case"AsyncIterator":return C0o(o,n,r);case"BigInt":return b0o(o,n,r);case"Boolean":return S0o(o,n,r);case"Constructor":return T0o(o,n,r);case"Date":return I0o(o,n,r);case"Function":return x0o(o,n,r);case"Import":return w0o(o,n,r);case"Integer":return R0o(o,n,r);case"Intersect":return k0o(o,n,r);case"Iterator":return P0o(o,n,r);case"Literal":return D0o(o,n,r);case"Never":return N0o(o,n,r);case"Not":return M0o(o,n,r);case"Null":return O0o(o,n,r);case"Number":return L0o(o,n,r);case"Object":return B0o(o,n,r);case"Promise":return F0o(o,n,r);case"Record":return U0o(o,n,r);case"Ref":return Q0o(o,n,r);case"RegExp":return q0o(o,n,r);case"String":return j0o(o,n,r);case"Symbol":return H0o(o,n,r);case"TemplateLiteral":return G0o(o,n,r);case"This":return $0o(o,n,r);case"Tuple":return V0o(o,n,r);case"Undefined":return W0o(o,n,r);case"Union":return z0o(o,n,r);case"Uint8Array":return Y0o(o,n,r);case"Unknown":return K0o(o,n,r);case"Void":return J0o(o,n,r);default:if(!v_.Has(o[Tt]))throw new XPt(o);return Z0o(o,n,r)}}a(K0,"Visit");function es(...t){return t.length===3?K0(t[0],t[1],t[2]):K0(t[0],[],t[1])}a(es,"Check");var St;(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"})(St||(St={}));var e2t=class extends qi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function AB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(AB,"EscapeKey");function Ys(t){return t!==void 0}a(Ys,"IsDefined");var SU=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 sn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:FVr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(sn,"Create");function*X0o(t,e,r,n){}a(X0o,"FromAny");function*ego(t,e,r,n){}a(ego,"FromArgument");function*tgo(t,e,r,n){if(!Pi(n))return yield sn(St.Array,t,r,n);Ys(t.minItems)&&!(n.length>=t.minItems)&&(yield sn(St.ArrayMinItems,t,r,n)),Ys(t.maxItems)&&!(n.length<=t.maxItems)&&(yield sn(St.ArrayMaxItems,t,r,n));for(let c=0;cJ0(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield sn(St.ArrayContains,t,r,n)),ai(t.minContains)&&st.maxContains&&(yield sn(St.ArrayMaxContains,t,r,n))}a(tgo,"FromArray");function*rgo(t,e,r,n){H9e(n)||(yield sn(St.AsyncIterator,t,r,n))}a(rgo,"FromAsyncIterator");function*ngo(t,e,r,n){if(!pA(n))return yield sn(St.BigInt,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.BigIntExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.BigIntMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.BigIntMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield sn(St.BigIntMultipleOf,t,r,n))}a(ngo,"FromBigInt");function*igo(t,e,r,n){eM(n)||(yield sn(St.Boolean,t,r,n))}a(igo,"FromBoolean");function*ogo(t,e,r,n){yield*J0(t.returns,e,r,n.prototype)}a(ogo,"FromConstructor");function*sgo(t,e,r,n){if(!__(n))return yield sn(St.Date,t,r,n);Ys(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield sn(St.DateExclusiveMinimumTimestamp,t,r,n)),Ys(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield sn(St.DateMaximumTimestamp,t,r,n)),Ys(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield sn(St.DateMinimumTimestamp,t,r,n)),Ys(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield sn(St.DateMultipleOfTimestamp,t,r,n))}a(sgo,"FromDate");function*ago(t,e,r,n){pU(n)||(yield sn(St.Function,t,r,n))}a(ago,"FromFunction");function*cgo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*J0(s,[...e,...o],r,n)}a(cgo,"FromImport");function*lgo(t,e,r,n){if(!V9e(n))return yield sn(St.Integer,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.IntegerExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.IntegerMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.IntegerMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(St.IntegerMultipleOf,t,r,n))}a(lgo,"FromInteger");function*ugo(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of J0(s,e,r,n))o=!0,yield c;if(o)return yield sn(St.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(mB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield sn(St.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(mB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=J0(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(ugo,"FromIntersect");function*dgo(t,e,r,n){G9e(n)||(yield sn(St.Iterator,t,r,n))}a(dgo,"FromIterator");function*fgo(t,e,r,n){n!==t.const&&(yield sn(St.Literal,t,r,n))}a(fgo,"FromLiteral");function*pgo(t,e,r,n){yield sn(St.Never,t,r,n)}a(pgo,"FromNever");function*hgo(t,e,r,n){J0(t.not,e,r,n).next().done===!0&&(yield sn(St.Not,t,r,n))}a(hgo,"FromNot");function*mgo(t,e,r,n){cB(n)||(yield sn(St.Null,t,r,n))}a(mgo,"FromNull");function*ggo(t,e,r,n){if(!su.IsNumberLike(n))return yield sn(St.Number,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.NumberExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.NumberMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.NumberMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(St.NumberMultipleOf,t,r,n))}a(ggo,"FromNumber");function*Ago(t,e,r,n){if(!su.IsObjectLike(n))return yield sn(St.Object,t,r,n);Ys(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(St.ObjectMinProperties,t,r,n)),Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(St.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 sn(St.ObjectRequiredProperty,t.properties[l],`${r}/${AB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield sn(St.ObjectAdditionalProperties,t,`${r}/${AB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*J0(t.additionalProperties,e,`${r}/${AB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*J0(u,e,`${r}/${AB(l)}`,n[l]),gB(t)&&!(l in n)&&(yield sn(St.ObjectRequiredProperty,u,`${r}/${AB(l)}`,void 0))):su.IsExactOptionalProperty(n,l)&&(yield*J0(u,e,`${r}/${AB(l)}`,n[l]))}}a(Ago,"FromObject");function*ygo(t,e,r,n){$9e(n)||(yield sn(St.Promise,t,r,n))}a(ygo,"FromPromise");function*Ego(t,e,r,n){if(!su.IsRecordLike(n))return yield sn(St.Object,t,r,n);Ys(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(St.ObjectMinProperties,t,r,n)),Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(St.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*J0(s,e,`${r}/${AB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*J0(t.additionalProperties,e,`${r}/${AB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield sn(St.ObjectAdditionalProperties,t,`${r}/${AB(l)}`,u)}}a(Ego,"FromRecord");function*_go(t,e,r,n){yield*J0(Ia(t,e),e,r,n)}a(_go,"FromRef");function*vgo(t,e,r,n){if(!Sa(n))return yield sn(St.String,t,r,n);if(Ys(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(St.StringMinLength,t,r,n)),Ys(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(St.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield sn(St.RegExp,t,r,n)}a(vgo,"FromRegExp");function*Cgo(t,e,r,n){if(!Sa(n))return yield sn(St.String,t,r,n);Ys(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(St.StringMinLength,t,r,n)),Ys(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(St.StringMaxLength,t,r,n)),Sa(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield sn(St.StringPattern,t,r,n))),Sa(t.format)&&(Uk.Has(t.format)?Uk.Get(t.format)(n)||(yield sn(St.StringFormat,t,r,n)):yield sn(St.StringFormatUnknown,t,r,n))}a(Cgo,"FromString");function*bgo(t,e,r,n){lB(n)||(yield sn(St.Symbol,t,r,n))}a(bgo,"FromSymbol");function*Sgo(t,e,r,n){if(!Sa(n))return yield sn(St.String,t,r,n);new RegExp(t.pattern).test(n)||(yield sn(St.StringPattern,t,r,n))}a(Sgo,"FromTemplateLiteral");function*Tgo(t,e,r,n){yield*J0(Ia(t,e),e,r,n)}a(Tgo,"FromThis");function*Igo(t,e,r,n){if(!Pi(n))return yield sn(St.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield sn(St.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield sn(St.TupleLength,t,r,n);if(t.items)for(let o=0;onew SU(J0(s,e,r,n)));yield sn(St.Union,t,r,n,o)}a(wgo,"FromUnion");function*Rgo(t,e,r,n){if(!xoe(n))return yield sn(St.Uint8Array,t,r,n);Ys(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield sn(St.Uint8ArrayMaxByteLength,t,r,n)),Ys(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield sn(St.Uint8ArrayMinByteLength,t,r,n))}a(Rgo,"FromUint8Array");function*kgo(t,e,r,n){}a(kgo,"FromUnknown");function*Pgo(t,e,r,n){su.IsVoidLike(n)||(yield sn(St.Void,t,r,n))}a(Pgo,"FromVoid");function*Dgo(t,e,r,n){v_.Get(t[Tt])(t,n)||(yield sn(St.Kind,t,r,n))}a(Dgo,"FromKind");function*J0(t,e,r,n){let o=Ys(t.$id)?[...e,t]:e,s=t;switch(s[Tt]){case"Any":return yield*X0o(s,o,r,n);case"Argument":return yield*ego(s,o,r,n);case"Array":return yield*tgo(s,o,r,n);case"AsyncIterator":return yield*rgo(s,o,r,n);case"BigInt":return yield*ngo(s,o,r,n);case"Boolean":return yield*igo(s,o,r,n);case"Constructor":return yield*ogo(s,o,r,n);case"Date":return yield*sgo(s,o,r,n);case"Function":return yield*ago(s,o,r,n);case"Import":return yield*cgo(s,o,r,n);case"Integer":return yield*lgo(s,o,r,n);case"Intersect":return yield*ugo(s,o,r,n);case"Iterator":return yield*dgo(s,o,r,n);case"Literal":return yield*fgo(s,o,r,n);case"Never":return yield*pgo(s,o,r,n);case"Not":return yield*hgo(s,o,r,n);case"Null":return yield*mgo(s,o,r,n);case"Number":return yield*ggo(s,o,r,n);case"Object":return yield*Ago(s,o,r,n);case"Promise":return yield*ygo(s,o,r,n);case"Record":return yield*Ego(s,o,r,n);case"Ref":return yield*_go(s,o,r,n);case"RegExp":return yield*vgo(s,o,r,n);case"String":return yield*Cgo(s,o,r,n);case"Symbol":return yield*bgo(s,o,r,n);case"TemplateLiteral":return yield*Sgo(s,o,r,n);case"This":return yield*Tgo(s,o,r,n);case"Tuple":return yield*Igo(s,o,r,n);case"Undefined":return yield*xgo(s,o,r,n);case"Union":return yield*wgo(s,o,r,n);case"Uint8Array":return yield*Rgo(s,o,r,n);case"Unknown":return yield*kgo(s,o,r,n);case"Void":return yield*Pgo(s,o,r,n);default:if(!v_.Has(s[Tt]))throw new e2t(t);return yield*Dgo(s,o,r,n)}}a(J0,"Visit");function nM(...t){let e=t.length===3?J0(t[0],t[1],"",t[2]):J0(t[0],[],"",t[1]);return new SU(e)}a(nM,"Errors");p();p();var Yoe=class extends qi{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}},t2t=class extends qi{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 kd(t,e,r){try{return ec(t)?t[wd].Decode(r):r}catch(n){throw new t2t(t,e,r,n)}}a(kd,"Default");function Ngo(t,e,r,n){return Pi(n)?kd(t,r,n.map((o,s)=>Hk(t.items,e,`${r}/${s}`,o))):kd(t,r,n)}a(Ngo,"FromArray");function Mgo(t,e,r,n){if(!bo(n)||B1(n))return kd(t,r,n);let o=tUe(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=Hk(h,e,`${r}/${f}`,c[f]));if(!ec(t.unevaluatedProperties))return kd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=kd(u,`${r}/${f}`,d[f]));return kd(t,r,d)}a(Mgo,"FromIntersect");function Ogo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Hk(s,[...e,...o],r,n);return kd(t,r,c)}a(Ogo,"FromImport");function Lgo(t,e,r,n){return kd(t,r,Hk(t.not,e,r,n))}a(Lgo,"FromNot");function Bgo(t,e,r,n){if(!bo(n))return kd(t,r,n);let o=aC(t),s={...n};for(let d of o)Qi(s,d)&&(Fu(s[d])&&(!fB(t.properties[d])||su.IsExactOptionalProperty(s,d))||(s[d]=Hk(t.properties[d],e,`${r}/${d}`,s[d])));if(!Rd(t.additionalProperties))return kd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=kd(l,`${r}/${d}`,u[d]));return kd(t,r,u)}a(Bgo,"FromObject");function Fgo(t,e,r,n){if(!bo(n))return kd(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]=Hk(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!Rd(t.additionalProperties))return kd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=kd(u,`${r}/${f}`,d[f]));return kd(t,r,d)}a(Fgo,"FromRecord");function Ugo(t,e,r,n){let o=Ia(t,e);return kd(t,r,Hk(o,e,r,n))}a(Ugo,"FromRef");function Qgo(t,e,r,n){let o=Ia(t,e);return kd(t,r,Hk(o,e,r,n))}a(Qgo,"FromThis");function qgo(t,e,r,n){return Pi(n)&&Pi(t.items)?kd(t,r,t.items.map((o,s)=>Hk(o,e,`${r}/${s}`,n[s]))):kd(t,r,n)}a(qgo,"FromTuple");function jgo(t,e,r,n){for(let o of t.anyOf){if(!es(o,e,n))continue;let s=Hk(o,e,r,n);return kd(t,r,s)}return kd(t,r,n)}a(jgo,"FromUnion");function Hk(t,e,r,n){let o=Y0(t,e),s=t;switch(t[Tt]){case"Array":return Ngo(s,o,r,n);case"Import":return Ogo(s,o,r,n);case"Intersect":return Mgo(s,o,r,n);case"Not":return Lgo(s,o,r,n);case"Object":return Bgo(s,o,r,n);case"Record":return Fgo(s,o,r,n);case"Ref":return Ugo(s,o,r,n);case"Symbol":return kd(s,r,n);case"This":return Qgo(s,o,r,n);case"Tuple":return qgo(s,o,r,n);case"Union":return jgo(s,o,r,n);default:return kd(s,r,n)}}a(Hk,"Visit");function Koe(t,e,r){return Hk(t,e,"",r)}a(Koe,"TransformDecode");p();var Joe=class extends qi{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}},r2t=class extends qi{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 mA(t,e,r){try{return ec(t)?t[wd].Encode(r):r}catch(n){throw new r2t(t,e,r,n)}}a(mA,"Default");function Hgo(t,e,r,n){let o=mA(t,r,n);return Pi(o)?o.map((s,c)=>Gk(t.items,e,`${r}/${c}`,s)):o}a(Hgo,"FromArray");function Ggo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=mA(t,r,n);return Gk(s,[...e,...o],r,c)}a(Ggo,"FromImport");function $go(t,e,r,n){let o=mA(t,r,n);if(!bo(n)||B1(n))return o;let s=tUe(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=Gk(m,e,`${r}/${h}`,l[h]));if(!ec(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=mA(d,`${r}/${h}`,f[h]));return f}a($go,"FromIntersect");function Vgo(t,e,r,n){return mA(t.not,r,mA(t,r,n))}a(Vgo,"FromNot");function Wgo(t,e,r,n){let o=mA(t,r,n);if(!bo(o))return o;let s=aC(t),c={...o};for(let f of s)Qi(c,f)&&(Fu(c[f])&&(!fB(t.properties[f])||su.IsExactOptionalProperty(c,f))||(c[f]=Gk(t.properties[f],e,`${r}/${f}`,c[f])));if(!Rd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=mA(u,`${r}/${f}`,d[f]));return d}a(Wgo,"FromObject");function zgo(t,e,r,n){let o=mA(t,r,n);if(!bo(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]=Gk(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!Rd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=mA(d,`${r}/${h}`,f[h]));return f}a(zgo,"FromRecord");function Ygo(t,e,r,n){let o=Ia(t,e),s=Gk(o,e,r,n);return mA(t,r,s)}a(Ygo,"FromRef");function Kgo(t,e,r,n){let o=Ia(t,e),s=Gk(o,e,r,n);return mA(t,r,s)}a(Kgo,"FromThis");function Jgo(t,e,r,n){let o=mA(t,r,n);return Pi(t.items)?t.items.map((s,c)=>Gk(s,e,`${r}/${c}`,o[c])):[]}a(Jgo,"FromTuple");function Zgo(t,e,r,n){for(let o of t.anyOf){if(!es(o,e,n))continue;let s=Gk(o,e,r,n);return mA(t,r,s)}for(let o of t.anyOf){let s=Gk(o,e,r,n);if(es(t,e,s))return mA(t,r,s)}return mA(t,r,n)}a(Zgo,"FromUnion");function Gk(t,e,r,n){let o=Y0(t,e),s=t;switch(t[Tt]){case"Array":return Hgo(s,o,r,n);case"Import":return Ggo(s,o,r,n);case"Intersect":return $go(s,o,r,n);case"Not":return Vgo(s,o,r,n);case"Object":return Wgo(s,o,r,n);case"Record":return zgo(s,o,r,n);case"Ref":return Ygo(s,o,r,n);case"This":return Kgo(s,o,r,n);case"Tuple":return Jgo(s,o,r,n);case"Union":return Zgo(s,o,r,n);default:return mA(s,r,n)}}a(Gk,"Visit");function Zoe(t,e,r){return Gk(t,e,"",r)}a(Zoe,"TransformEncode");p();function Xgo(t,e){return ec(t)||Hm(t.items,e)}a(Xgo,"FromArray");function eAo(t,e){return ec(t)||Hm(t.items,e)}a(eAo,"FromAsyncIterator");function tAo(t,e){return ec(t)||Hm(t.returns,e)||t.parameters.some(r=>Hm(r,e))}a(tAo,"FromConstructor");function rAo(t,e){return ec(t)||Hm(t.returns,e)||t.parameters.some(r=>Hm(r,e))}a(rAo,"FromFunction");function nAo(t,e){return ec(t)||ec(t.unevaluatedProperties)||t.allOf.some(r=>Hm(r,e))}a(nAo,"FromIntersect");function iAo(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return ec(t)||Hm(n,[...r,...e])}a(iAo,"FromImport");function oAo(t,e){return ec(t)||Hm(t.items,e)}a(oAo,"FromIterator");function sAo(t,e){return ec(t)||Hm(t.not,e)}a(sAo,"FromNot");function aAo(t,e){return ec(t)||Object.values(t.properties).some(r=>Hm(r,e))||Rd(t.additionalProperties)&&Hm(t.additionalProperties,e)}a(aAo,"FromObject");function cAo(t,e){return ec(t)||Hm(t.item,e)}a(cAo,"FromPromise");function lAo(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return ec(t)||Hm(n,e)||Rd(t.additionalProperties)&&ec(t.additionalProperties)}a(lAo,"FromRecord");function uAo(t,e){return ec(t)?!0:Hm(Ia(t,e),e)}a(uAo,"FromRef");function dAo(t,e){return ec(t)?!0:Hm(Ia(t,e),e)}a(dAo,"FromThis");function fAo(t,e){return ec(t)||!Fu(t.items)&&t.items.some(r=>Hm(r,e))}a(fAo,"FromTuple");function pAo(t,e){return ec(t)||t.anyOf.some(r=>Hm(r,e))}a(pAo,"FromUnion");function Hm(t,e){let r=Y0(t,e),n=t;if(t.$id&&n2t.has(t.$id))return!1;switch(t.$id&&n2t.add(t.$id),t[Tt]){case"Array":return Xgo(n,r);case"AsyncIterator":return eAo(n,r);case"Constructor":return tAo(n,r);case"Function":return rAo(n,r);case"Import":return iAo(n,r);case"Intersect":return nAo(n,r);case"Iterator":return oAo(n,r);case"Not":return sAo(n,r);case"Object":return aAo(n,r);case"Promise":return cAo(n,r);case"Record":return lAo(n,r);case"Ref":return uAo(n,r);case"This":return dAo(n,r);case"Tuple":return fAo(n,r);case"Union":return pAo(n,r);default:return ec(t)}}a(Hm,"Visit");var n2t=new Set;function yB(t,e){return n2t.clear(),Hm(t,e)}a(yB,"HasTransform");var i2t=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=yB(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return nM(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new Yoe(this.schema,e,this.Errors(e).First());return this.hasTransform?Koe(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?Zoe(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new Joe(this.schema,e,this.Errors(e).First());return r}},EB;(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})(EB||(EB={}));var hUe;(function(t){function e(s){return s.length===0?!1:EB.IsNumeric(s.charCodeAt(0))}a(e,"IsFirstCharacterNumeric");function r(s){if(e(s))return!1;for(let c=0;c= ${X.minItems}`);let ue=z(X.items,ee,"value");if(yield`((array) => { for(const ${he} of array) if(!(${ue})) { return false }; return true; })(${K})`,Qu(X.contains)||ai(X.minContains)||ai(X.maxContains)){let qe=Qu(X.contains)?X.contains:Xo(),ne=z(qe,ee,"value"),ce=ai(X.minContains)?[`(count >= ${X.minContains})`]:[],Ne=ai(X.maxContains)?[`(count <= ${X.maxContains})`]:[],we=`const count = value.reduce((${Z}, ${he}) => ${ne} ? acc + 1 : acc, 0)`,Be=["(count > 0)",...ce,...Ne].join(" && ");yield`((${he}) => { ${we}; return ${Be}})(${K})`}X.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(X,ee,K){yield`(typeof value === 'object' && Symbol.asyncIterator in ${K})`}a(s,"FromAsyncIterator");function*c(X,ee,K){yield`(typeof ${K} === 'bigint')`,pA(X.exclusiveMaximum)&&(yield`${K} < BigInt(${X.exclusiveMaximum})`),pA(X.exclusiveMinimum)&&(yield`${K} > BigInt(${X.exclusiveMinimum})`),pA(X.maximum)&&(yield`${K} <= BigInt(${X.maximum})`),pA(X.minimum)&&(yield`${K} >= BigInt(${X.minimum})`),pA(X.multipleOf)&&(yield`(${K} % BigInt(${X.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(X,ee,K){yield`(typeof ${K} === 'boolean')`}a(l,"FromBoolean");function*u(X,ee,K){yield*W(X.returns,ee,`${K}.prototype`)}a(u,"FromConstructor");function*d(X,ee,K){yield`(${K} instanceof Date) && Number.isFinite(${K}.getTime())`,ai(X.exclusiveMaximumTimestamp)&&(yield`${K}.getTime() < ${X.exclusiveMaximumTimestamp}`),ai(X.exclusiveMinimumTimestamp)&&(yield`${K}.getTime() > ${X.exclusiveMinimumTimestamp}`),ai(X.maximumTimestamp)&&(yield`${K}.getTime() <= ${X.maximumTimestamp}`),ai(X.minimumTimestamp)&&(yield`${K}.getTime() >= ${X.minimumTimestamp}`),ai(X.multipleOfTimestamp)&&(yield`(${K}.getTime() % ${X.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(X,ee,K){yield`(typeof ${K} === 'function')`}a(f,"FromFunction");function*h(X,ee,K){let he=globalThis.Object.getOwnPropertyNames(X.$defs).reduce((Z,ue)=>[...Z,X.$defs[ue]],[]);yield*W(VI(X.$ref),[...ee,...he],K)}a(h,"FromImport");function*m(X,ee,K){yield`Number.isInteger(${K})`,ai(X.exclusiveMaximum)&&(yield`${K} < ${X.exclusiveMaximum}`),ai(X.exclusiveMinimum)&&(yield`${K} > ${X.exclusiveMinimum}`),ai(X.maximum)&&(yield`${K} <= ${X.maximum}`),ai(X.minimum)&&(yield`${K} >= ${X.minimum}`),ai(X.multipleOf)&&(yield`(${K} % ${X.multipleOf}) === 0`)}a(m,"FromInteger");function*g(X,ee,K){let he=X.allOf.map(Z=>z(Z,ee,K)).join(" && ");if(X.unevaluatedProperties===!1){let Z=H(`${new RegExp(mB(X))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${Z}.test(key))`;yield`(${he} && ${ue})`}else if(Qu(X.unevaluatedProperties)){let Z=H(`${new RegExp(mB(X))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${Z}.test(key) || ${z(X.unevaluatedProperties,ee,`${K}[key]`)})`;yield`(${he} && ${ue})`}else yield`(${he})`}a(g,"FromIntersect");function*A(X,ee,K){yield`(typeof value === 'object' && Symbol.iterator in ${K})`}a(A,"FromIterator");function*y(X,ee,K){typeof X.const=="number"||typeof X.const=="boolean"?yield`(${K} === ${X.const})`:yield`(${K} === '${s2t.Escape(X.const)}')`}a(y,"FromLiteral");function*E(X,ee,K){yield"false"}a(E,"FromNever");function*_(X,ee,K){yield`(!${z(X.not,ee,K)})`}a(_,"FromNot");function*v(X,ee,K){yield`(${K} === null)`}a(v,"FromNull");function*b(X,ee,K){yield LW.IsNumberLike(K),ai(X.exclusiveMaximum)&&(yield`${K} < ${X.exclusiveMaximum}`),ai(X.exclusiveMinimum)&&(yield`${K} > ${X.exclusiveMinimum}`),ai(X.maximum)&&(yield`${K} <= ${X.maximum}`),ai(X.minimum)&&(yield`${K} >= ${X.minimum}`),ai(X.multipleOf)&&(yield`(${K} % ${X.multipleOf}) === 0`)}a(b,"FromNumber");function*T(X,ee,K){yield LW.IsObjectLike(K),ai(X.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${X.minProperties}`),ai(X.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${X.maxProperties}`);let he=Object.getOwnPropertyNames(X.properties);for(let Z of he){let ue=hUe.Encode(K,Z),qe=X.properties[Z];if(X.required&&X.required.includes(Z))yield*W(qe,ee,ue),(gB(qe)||e(qe))&&(yield`('${Z}' in ${K})`);else{let ne=z(qe,ee,ue);yield LW.IsExactOptionalProperty(K,Z,ne)}}if(X.additionalProperties===!1)if(X.required&&X.required.length===he.length)yield`Object.getOwnPropertyNames(${K}).length === ${he.length}`;else{let Z=`[${he.map(ue=>`'${ue}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${K}).every(key => ${Z}.includes(key))`}if(typeof X.additionalProperties=="object"){let Z=z(X.additionalProperties,ee,`${K}[key]`),ue=`[${he.map(qe=>`'${qe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${K}).every(key => ${ue}.includes(key) || ${Z}))`}}a(T,"FromObject");function*w(X,ee,K){yield`${K} instanceof Promise`}a(w,"FromPromise");function*R(X,ee,K){yield LW.IsRecordLike(K),ai(X.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${X.minProperties}`),ai(X.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${X.maxProperties}`);let[he,Z]=Object.entries(X.patternProperties)[0],ue=H(`${new RegExp(he)}`),qe=z(Z,ee,"value"),ne=Qu(X.additionalProperties)?z(X.additionalProperties,ee,K):X.additionalProperties===!1?"false":"true",ce=`(${ue}.test(key) ? ${qe} : ${ne})`;yield`(Object.entries(${K}).every(([key, value]) => ${ce}))`}a(R,"FromRecord");function*x(X,ee,K){let he=Ia(X,ee);if(V.functions.has(X.$ref))return yield`${ie(X.$ref)}(${K})`;yield*W(he,ee,K)}a(x,"FromRef");function*P(X,ee,K){let he=H(`${new RegExp(X.source,X.flags)};`);yield`(typeof ${K} === 'string')`,ai(X.maxLength)&&(yield`${K}.length <= ${X.maxLength}`),ai(X.minLength)&&(yield`${K}.length >= ${X.minLength}`),yield`${he}.test(${K})`}a(P,"FromRegExp");function*D(X,ee,K){yield`(typeof ${K} === 'string')`,ai(X.maxLength)&&(yield`${K}.length <= ${X.maxLength}`),ai(X.minLength)&&(yield`${K}.length >= ${X.minLength}`),X.pattern!==void 0&&(yield`${H(`${new RegExp(X.pattern)};`)}.test(${K})`),X.format!==void 0&&(yield`format('${X.format}', ${K})`)}a(D,"FromString");function*N(X,ee,K){yield`(typeof ${K} === 'symbol')`}a(N,"FromSymbol");function*L(X,ee,K){yield`(typeof ${K} === 'string')`,yield`${H(`${new RegExp(X.pattern)};`)}.test(${K})`}a(L,"FromTemplateLiteral");function*B(X,ee,K){yield`${ie(X.$ref)}(${K})`}a(B,"FromThis");function*q(X,ee,K){if(yield`Array.isArray(${K})`,X.items===void 0)return yield`${K}.length === 0`;yield`(${K}.length === ${X.maxItems})`;for(let he=0;hez(Z,ee,K)).join(" || ")})`}a(O,"FromUnion");function*j(X,ee,K){yield`${K} instanceof Uint8Array`,ai(X.maxByteLength)&&(yield`(${K}.length <= ${X.maxByteLength})`),ai(X.minByteLength)&&(yield`(${K}.length >= ${X.minByteLength})`)}a(j,"FromUint8Array");function*Q(X,ee,K){yield"true"}a(Q,"FromUnknown");function*U(X,ee,K){yield LW.IsVoidLike(K)}a(U,"FromVoid");function*Y(X,ee,K){let he=V.instances.size;V.instances.set(he,X),yield`kind('${X[Tt]}', ${he}, ${K})`}a(Y,"FromKind");function*W(X,ee,K,he=!0){let Z=Sa(X.$id)?[...ee,X]:ee,ue=X;if(he&&Sa(X.$id)){let qe=ie(X.$id);if(V.functions.has(qe))return yield`${qe}(${K})`;{V.functions.set(qe,"");let ne=re(qe,X,ee,"value",!1);return V.functions.set(qe,ne),yield`${qe}(${K})`}}switch(ue[Tt]){case"Any":return yield*r(ue,Z,K);case"Argument":return yield*n(ue,Z,K);case"Array":return yield*o(ue,Z,K);case"AsyncIterator":return yield*s(ue,Z,K);case"BigInt":return yield*c(ue,Z,K);case"Boolean":return yield*l(ue,Z,K);case"Constructor":return yield*u(ue,Z,K);case"Date":return yield*d(ue,Z,K);case"Function":return yield*f(ue,Z,K);case"Import":return yield*h(ue,Z,K);case"Integer":return yield*m(ue,Z,K);case"Intersect":return yield*g(ue,Z,K);case"Iterator":return yield*A(ue,Z,K);case"Literal":return yield*y(ue,Z,K);case"Never":return yield*E(ue,Z,K);case"Not":return yield*_(ue,Z,K);case"Null":return yield*v(ue,Z,K);case"Number":return yield*b(ue,Z,K);case"Object":return yield*T(ue,Z,K);case"Promise":return yield*w(ue,Z,K);case"Record":return yield*R(ue,Z,K);case"Ref":return yield*x(ue,Z,K);case"RegExp":return yield*P(ue,Z,K);case"String":return yield*D(ue,Z,K);case"Symbol":return yield*N(ue,Z,K);case"TemplateLiteral":return yield*L(ue,Z,K);case"This":return yield*B(ue,Z,K);case"Tuple":return yield*q(ue,Z,K);case"Undefined":return yield*M(ue,Z,K);case"Union":return yield*O(ue,Z,K);case"Uint8Array":return yield*j(ue,Z,K);case"Unknown":return yield*Q(ue,Z,K);case"Void":return yield*U(ue,Z,K);default:if(!v_.Has(ue[Tt]))throw new a2t(X);return yield*Y(ue,Z,K)}}a(W,"Visit");let V={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function z(X,ee,K,he=!0){return`(${[...W(X,ee,K,he)].join(" && ")})`}a(z,"CreateExpression");function ie(X){return`check_${o2t.Encode(X)}`}a(ie,"CreateFunctionName");function H(X){let ee=`local_${V.variables.size}`;return V.variables.set(ee,`const ${ee} = ${X}`),ee}a(H,"CreateVariable");function re(X,ee,K,he,Z=!0){let[ue,qe]=[` +`,hco=[uco,dco,fco,pco];function Dkt(t){for(let e of lco)t.exec(e);return mco(t),t}a(Dkt,"applyPragmas");function mco(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(mco,"ensureWalMode");function Nkt(t){for(let e of hco)t.exec(e);return t}a(Nkt,"applySchema");function rU(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(rU,"runInWriteTx");p();p();p();var Mkt="github.copilot",AQr="github-enterprise";p();var Ls=a((t,e)=>({editorId:t,displayName:e}),"id"),gco=Ls("unknown","Unknown"),yQr=Ls("eclipse","Eclipse"),EQr=Ls("xcode","Xcode"),nU=Ls("vim","Vim/Neovim"),_Qr=Ls("helix","Helix"),Aco={"copilot-eclipse":yQr,Copilot4Eclipse:yQr,"copilot-xcode":EQr,"Copilot for Xcode":EQr,"copilot-vs":Ls("visual-studio","Visual Studio"),"copilot.vim":nU,"copilot.lua":nU,"Github Copilot LSP for Neovim":nU,"coc-github-copilot":nU,"nvim-lspconfig":nU,"copilot-lsp-client-neovim":nU,"neovim-copilot-lsp":nU,"sidekick.nvim":nU,"helix-copilot":_Qr,"copilot-helix":_Qr,"copilot-sublime":Ls("sublime-text","Sublime Text"),"zed-copilot":Ls("zed","Zed"),RStudio:Ls("rstudio","RStudio"),"obsidian-copilot":Ls("obsidian","Obsidian"),marimo:Ls("marimo","marimo"),"Qt Creator Copilot plugin":Ls("qt-creator","Qt Creator"),"godot-copilot":Ls("godot","Godot"),"kakoune-lsp":Ls("kakoune","Kakoune"),"typora-copilot":Ls("typora","Typora"),"Copilot for Nova":Ls("nova","Nova")},yco={IU:Ls("intellij","IntelliJ IDEA"),IC:Ls("intellij","IntelliJ IDEA"),IE:Ls("intellij","IntelliJ IDEA"),PY:Ls("pycharm","PyCharm"),PC:Ls("pycharm","PyCharm"),PE:Ls("pycharm","PyCharm"),WS:Ls("webstorm","WebStorm"),PS:Ls("phpstorm","PhpStorm"),RD:Ls("rider","Rider"),RM:Ls("rubymine","RubyMine"),CL:Ls("clion","CLion"),GO:Ls("goland","GoLand"),RR:Ls("rustrover","RustRover"),DB:Ls("datagrip","DataGrip"),DS:Ls("dataspell","DataSpell"),AI:Ls("android-studio","Android Studio"),QA:Ls("aqua","Aqua"),MPS:Ls("mps","MPS"),JBC:Ls("jetbrains-client","JetBrains Client"),GW:Ls("jetbrains-gateway","JetBrains Gateway")},vQr="JetBrains-",Eco=Ls("jetbrains","JetBrains IDE");function CQr(t){let e=t.plugin.name?.trim();if(!e)return gco;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(vQr)){let n=yco[r.slice(vQr.length)];if(n)return n}return Eco}return Aco[e]??Ls(e,e)}a(CQr,"resolveEditorIdentity");p();p();p();p();var N6e=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 Okt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(Okt,"findKnownOrg");function bQr(t){let e=t.organization_list??[];return Okt(e)??""}a(bQr,"getUserKind");p();var qf=class{static{a(this,"LogTarget")}},ZL=class{static{a(this,"TelemetryLogSender")}},fe=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(qf).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(ZL).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Nr=new fe("default");p();p();p();p();async function tdo(){let{getDeviceId:t}=await Promise.resolve().then(()=>de(tHr()));return t()}a(tdo,"loadDeviceId");var qI=class{constructor(e=tdo){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 Pk=class{static{a(this,"InlineCompletionsUnification")}},rdo={codeUnification:!1,modelUnification:!1,expAssignments:[]},boe=class extends Pk{constructor(){super(...arguments);this.inlineCompletionsUnificationState=rdo;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};var iC=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return Z6e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(Pk).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 E_="X-Copilot-RelatedPluginVersion-",Soe=(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=E_+"msvscodecpptools",z.CopilotRelatedPluginVersionCMakeTools=E_+"msvscodecmaketools",z.CopilotRelatedPluginVersionMakefileTools=E_+"msvscodemakefiletools",z.CopilotRelatedPluginVersionCSharpDevKit=E_+"msdotnettoolscsdevkit",z.CopilotRelatedPluginVersionPython=E_+"mspythonpython",z.CopilotRelatedPluginVersionPylance=E_+"mspythonvscodepylance",z.CopilotRelatedPluginVersionJavaPack=E_+"vscjavavscodejavapack",z.CopilotRelatedPluginVersionJavaManager=E_+"vscjavavscodejavadependency",z.CopilotRelatedPluginVersionTypescript=E_+"vscodetypescriptlanguagefeatures",z.CopilotRelatedPluginVersionTypescriptNext=E_+"msvscodevscodetypescriptnext",z.CopilotRelatedPluginVersionCSharp=E_+"msdotnettoolscsharp",z.CopilotRelatedPluginVersionGithubCopilotChat=E_+"githubcopilotchat",z.CopilotRelatedPluginVersionGithubCopilot=E_+"githubcopilot",z))(Soe||{});var ndo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},iB=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=ndo[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 bs(t,e){let r=z0(t,e,"event.CopilotToken");return t.get(Qt).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(bs,"onCopilotToken");function sPt(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(sPt,"propertiesFromCopilotToken");var Op=class{constructor(e){this.#e={};this.optedIn=!1;bs(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=sPt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1")}};var B9e=de(fU()),F9e=de(require("os"));var ido=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function odo(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(ido),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(odo,"buildExceptionDetail");function lPt(t,e){let r=t.get(Ir),n=r.getEditorInfo(),o=t.get(Op),s={"#editor":n.devName??n.name,"#editor_version":M1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":M1(r.getEditorPluginInfo()),"#session_id":t.get(Fa).sessionId,"#machine_id":t.get(Fa).machineId,"#architecture":F9e.arch(),"#os_platform":F9e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(lPt,"buildContext");function lGr(t,e,r){let n=t.get(ds),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:lPt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=odo(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,B9e.SHA256)(B9e.enc.Utf16.parse(f.join(` +`))).toString()),c}a(lGr,"buildPayload");p();var U9e=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 dGr=de(fU());var Cn=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)}},Dk=class extends Cn{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"}},Q9e=class extends Cn{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 fGr=7*86400*1e3,eM=class{constructor(e=5){this.perWeek=e;this.cache=new Cn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-fGr);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(pGr(t.replace(/\\/g,"/")),"gi"):new RegExp(pGr(t),"gi"));function ado(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(cdo,"removePropertiesWithPossibleUserInfo");function ldo(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(ldo,"redactPaths");function mGr(t,e=sdo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=cdo(s);if(c!==s){r[n]=c;continue}s=ado(s,e);for(let l of e)s=s.replace(l,"");s=ldo(s),r[n]=s}return r}a(mGr,"sanitizeTelemetryProperties");function pU(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(pU,"filterTelemetryProperties");p();var jI=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:AGr(r,n),verboseLogging:ddo(r,n),testMode:e,simulation:udo(n)})}};function O1(t){return t.get(jI).flags.testMode}a(O1,"isRunningInTest");function kCe(t){return O1(t)}a(kCe,"shouldFailForDebugPurposes");function PCe(t){return t.get(jI).flags.debug}a(PCe,"isDebugEnabled");function gGr(t){return t.get(jI).flags.verboseLogging}a(gGr,"isVerboseLoggingEnabled");function AGr(t,e){return t.includes("--debug")||dPt(e,"DEBUG")}a(AGr,"determineDebugFlag");function udo(t){return dPt(t,"SIMULATION")}a(udo,"determineSimulationFlag");function j9e(t){return t.get(jI).flags.simulation}a(j9e,"isRunningInSimulation");function ddo(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||dPt(e,"VERBOSE")||AGr(t,e)}a(ddo,"determineVerboseLoggingEnabled");function dPt(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(dPt,"determineEnvFlagEnabled");p();var xd=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 _Gr=require("os"),vGr=de(require("path"));function DCe(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(DCe,"redactPaths");var fdo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),pdo=[/^[\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 pPt(t){if(fdo.has(t))return t;for(let e of pdo)if(e.test(t))return t;return DCe(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(pPt,"redactMessage");function Toe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Toe,"escapeForRegExp");var hdo=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+Toe((0,_Gr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function fPt(t){return t.replace(hdo,"~")}a(fPt,"redactHomeDir");var CGr="[\\\\/]?([^:)]*)(?=:\\d)",yGr=new RegExp(Toe(vGr.sep),"g"),EGr=new RegExp(Toe(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+CGr,"gi");function hPt(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(EGr.test(l))o.stack+=` +${DCe(l.replace(EGr,(u,d)=>"./"+d.replace(yGr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` +${DCe(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(Toe(f.replace(/[\\/]$/,""))+CGr,"gi");if(h.test(l)){o.stack+=` +${DCe(l.replace(h,(m,g)=>d+g.replace(yGr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` +${fPt(l)}`:o.stack+=` + at [redacted]:0:0`}}else r&&s&&(o.stack=fPt(s));return t.cause instanceof Error&&(o.cause=hPt(t.cause,e,r,n)),o}a(hPt,"cloneError");function bGr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(bGr,"errorMessageWithoutPath");function SGr(t,e){return hPt(t,a(function(n){return fPt(bGr(n))},"prepareMessage"),!0,e)}a(SGr,"prepareErrorForRestrictedTelemetry");function TGr(t,e,r=!1){return hPt(t,a(function(o){if(r)return pPt(bGr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=DCe(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(TGr,"redactError");p();p();var Ly={};ki(Ly,{HasPropertyKey:()=>H9e,IsArray:()=>Lp,IsAsyncIterator:()=>mPt,IsBigInt:()=>NCe,IsBoolean:()=>sB,IsDate:()=>wW,IsFunction:()=>gPt,IsIterator:()=>APt,IsNull:()=>yPt,IsNumber:()=>L1,IsObject:()=>Yc,IsRegExp:()=>MCe,IsString:()=>Ql,IsSymbol:()=>EPt,IsUint8Array:()=>aB,IsUndefined:()=>Bp});p();function H9e(t,e){return e in t}a(H9e,"HasPropertyKey");function mPt(t){return Yc(t)&&!Lp(t)&&!aB(t)&&Symbol.asyncIterator in t}a(mPt,"IsAsyncIterator");function Lp(t){return Array.isArray(t)}a(Lp,"IsArray");function NCe(t){return typeof t=="bigint"}a(NCe,"IsBigInt");function sB(t){return typeof t=="boolean"}a(sB,"IsBoolean");function wW(t){return t instanceof globalThis.Date}a(wW,"IsDate");function gPt(t){return typeof t=="function"}a(gPt,"IsFunction");function APt(t){return Yc(t)&&!Lp(t)&&!aB(t)&&Symbol.iterator in t}a(APt,"IsIterator");function yPt(t){return t===null}a(yPt,"IsNull");function L1(t){return typeof t=="number"}a(L1,"IsNumber");function Yc(t){return typeof t=="object"&&t!==null}a(Yc,"IsObject");function MCe(t){return t instanceof globalThis.RegExp}a(MCe,"IsRegExp");function Ql(t){return typeof t=="string"}a(Ql,"IsString");function EPt(t){return typeof t=="symbol"}a(EPt,"IsSymbol");function aB(t){return t instanceof globalThis.Uint8Array}a(aB,"IsUint8Array");function Bp(t){return t===void 0}a(Bp,"IsUndefined");function mdo(t){return t.map(e=>G9e(e))}a(mdo,"ArrayType");function gdo(t){return new Date(t.getTime())}a(gdo,"DateType");function Ado(t){return new Uint8Array(t)}a(Ado,"Uint8ArrayType");function ydo(t){return new RegExp(t.source,t.flags)}a(ydo,"RegExpType");function Edo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=G9e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=G9e(t[r]);return e}a(Edo,"ObjectType");function G9e(t){return Lp(t)?mdo(t):wW(t)?gdo(t):aB(t)?Ado(t):MCe(t)?ydo(t):Yc(t)?Edo(t):t}a(G9e,"Visit");function Bu(t){return G9e(t)}a(Bu,"Clone");function Ioe(t,e){return e===void 0?Bu(t):Bu({...e,...t})}a(Ioe,"CloneType");p();p();p();function $9e(t){return So(t)&&globalThis.Symbol.asyncIterator in t}a($9e,"IsAsyncIterator");function V9e(t){return So(t)&&globalThis.Symbol.iterator in t}a(V9e,"IsIterator");function _Pt(t){return So(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(_Pt,"IsStandardObject");function W9e(t){return t instanceof globalThis.Promise}a(W9e,"IsPromise");function __(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(__,"IsDate");function IGr(t){return t instanceof globalThis.Map}a(IGr,"IsMap");function xGr(t){return t instanceof globalThis.Set}a(xGr,"IsSet");function HI(t){return globalThis.ArrayBuffer.isView(t)}a(HI,"IsTypedArray");function xoe(t){return t instanceof globalThis.Uint8Array}a(xoe,"IsUint8Array");function Qi(t,e){return e in t}a(Qi,"HasPropertyKey");function So(t){return t!==null&&typeof t=="object"}a(So,"IsObject");function Pi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(Pi,"IsArray");function Fu(t){return t===void 0}a(Fu,"IsUndefined");function cB(t){return t===null}a(cB,"IsNull");function tM(t){return typeof t=="boolean"}a(tM,"IsBoolean");function ai(t){return typeof t=="number"}a(ai,"IsNumber");function z9e(t){return globalThis.Number.isInteger(t)}a(z9e,"IsInteger");function pA(t){return typeof t=="bigint"}a(pA,"IsBigInt");function ba(t){return typeof t=="string"}a(ba,"IsString");function hU(t){return typeof t=="function"}a(hU,"IsFunction");function lB(t){return typeof t=="symbol"}a(lB,"IsSymbol");function B1(t){return pA(t)||tM(t)||cB(t)||ai(t)||ba(t)||lB(t)||Fu(t)}a(B1,"IsValueType");var su;(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=So(c);return t.AllowArrayObject?l:l&&!Pi(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?ai(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=Fu(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(su||(su={}));p();function _do(t){return globalThis.Object.freeze(t).map(e=>OCe(e))}a(_do,"ImmutableArray");function vdo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=OCe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=OCe(t[r]);return globalThis.Object.freeze(e)}a(vdo,"ImmutableObject");function OCe(t){return Lp(t)?_do(t):wW(t)?t:aB(t)?t:MCe(t)?t:Yc(t)?vdo(t):t}a(OCe,"Immutable");function wt(t,e){let r=e!==void 0?{...e,...t}:t;switch(su.InstanceMode){case"freeze":return OCe(r);case"clone":return Bu(r);default:return r}}a(wt,"CreateType");p();var qi=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};p();p();p();var wd=Symbol.for("TypeBox.Transform"),Nk=Symbol.for("TypeBox.Readonly"),hA=Symbol.for("TypeBox.Optional"),GI=Symbol.for("TypeBox.Hint"),Tt=Symbol.for("TypeBox.Kind");function woe(t){return Yc(t)&&t[Nk]==="Readonly"}a(woe,"IsReadonly");function oC(t){return Yc(t)&&t[hA]==="Optional"}a(oC,"IsOptional");function vPt(t){return aa(t,"Any")}a(vPt,"IsAny");function CPt(t){return aa(t,"Argument")}a(CPt,"IsArgument");function Mk(t){return aa(t,"Array")}a(Mk,"IsArray");function RW(t){return aa(t,"AsyncIterator")}a(RW,"IsAsyncIterator");function kW(t){return aa(t,"BigInt")}a(kW,"IsBigInt");function uB(t){return aa(t,"Boolean")}a(uB,"IsBoolean");function Ok(t){return aa(t,"Computed")}a(Ok,"IsComputed");function Lk(t){return aa(t,"Constructor")}a(Lk,"IsConstructor");function Cdo(t){return aa(t,"Date")}a(Cdo,"IsDate");function Bk(t){return aa(t,"Function")}a(Bk,"IsFunction");function Fk(t){return aa(t,"Integer")}a(Fk,"IsInteger");function af(t){return aa(t,"Intersect")}a(af,"IsIntersect");function PW(t){return aa(t,"Iterator")}a(PW,"IsIterator");function aa(t,e){return Yc(t)&&Tt in t&&t[Tt]===e}a(aa,"IsKindOf");function Y9e(t){return sB(t)||L1(t)||Ql(t)}a(Y9e,"IsLiteralValue");function F1(t){return aa(t,"Literal")}a(F1,"IsLiteral");function U1(t){return aa(t,"MappedKey")}a(U1,"IsMappedKey");function Uu(t){return aa(t,"MappedResult")}a(Uu,"IsMappedResult");function mU(t){return aa(t,"Never")}a(mU,"IsNever");function bdo(t){return aa(t,"Not")}a(bdo,"IsNot");function LCe(t){return aa(t,"Null")}a(LCe,"IsNull");function Uk(t){return aa(t,"Number")}a(Uk,"IsNumber");function Fp(t){return aa(t,"Object")}a(Fp,"IsObject");function DW(t){return aa(t,"Promise")}a(DW,"IsPromise");function NW(t){return aa(t,"Record")}a(NW,"IsRecord");function jf(t){return aa(t,"Ref")}a(jf,"IsRef");function bPt(t){return aa(t,"RegExp")}a(bPt,"IsRegExp");function dB(t){return aa(t,"String")}a(dB,"IsString");function BCe(t){return aa(t,"Symbol")}a(BCe,"IsSymbol");function Q1(t){return aa(t,"TemplateLiteral")}a(Q1,"IsTemplateLiteral");function Sdo(t){return aa(t,"This")}a(Sdo,"IsThis");function ec(t){return Yc(t)&&wd in t}a(ec,"IsTransform");function q1(t){return aa(t,"Tuple")}a(q1,"IsTuple");function fB(t){return aa(t,"Undefined")}a(fB,"IsUndefined");function Sa(t){return aa(t,"Union")}a(Sa,"IsUnion");function Tdo(t){return aa(t,"Uint8Array")}a(Tdo,"IsUint8Array");function Ido(t){return aa(t,"Unknown")}a(Ido,"IsUnknown");function xdo(t){return aa(t,"Unsafe")}a(xdo,"IsUnsafe");function wdo(t){return aa(t,"Void")}a(wdo,"IsVoid");function gU(t){return Yc(t)&&Tt in t&&Ql(t[Tt])}a(gU,"IsKind");function Rd(t){return vPt(t)||CPt(t)||Mk(t)||uB(t)||kW(t)||RW(t)||Ok(t)||Lk(t)||Cdo(t)||Bk(t)||Fk(t)||af(t)||PW(t)||F1(t)||U1(t)||Uu(t)||mU(t)||bdo(t)||LCe(t)||Uk(t)||Fp(t)||DW(t)||NW(t)||jf(t)||bPt(t)||dB(t)||BCe(t)||Q1(t)||Sdo(t)||q1(t)||fB(t)||Sa(t)||Tdo(t)||Ido(t)||xdo(t)||wdo(t)||gU(t)}a(Rd,"IsSchema");var it={};ki(it,{IsAny:()=>PGr,IsArgument:()=>DGr,IsArray:()=>NGr,IsAsyncIterator:()=>MGr,IsBigInt:()=>OGr,IsBoolean:()=>LGr,IsComputed:()=>BGr,IsConstructor:()=>FGr,IsDate:()=>UGr,IsFunction:()=>QGr,IsImport:()=>Mdo,IsInteger:()=>qGr,IsIntersect:()=>jGr,IsIterator:()=>HGr,IsKind:()=>m$r,IsKindOf:()=>Bs,IsLiteral:()=>UCe,IsLiteralBoolean:()=>Odo,IsLiteralNumber:()=>$Gr,IsLiteralString:()=>GGr,IsLiteralValue:()=>VGr,IsMappedKey:()=>WGr,IsMappedResult:()=>zGr,IsNever:()=>YGr,IsNot:()=>KGr,IsNull:()=>JGr,IsNumber:()=>ZGr,IsObject:()=>XGr,IsOptional:()=>Ndo,IsPromise:()=>e$r,IsProperties:()=>K9e,IsReadonly:()=>Ddo,IsRecord:()=>t$r,IsRecursive:()=>Ldo,IsRef:()=>r$r,IsRegExp:()=>n$r,IsSchema:()=>Qu,IsString:()=>i$r,IsSymbol:()=>o$r,IsTemplateLiteral:()=>s$r,IsThis:()=>a$r,IsTransform:()=>c$r,IsTuple:()=>l$r,IsUint8Array:()=>d$r,IsUndefined:()=>u$r,IsUnion:()=>xPt,IsUnionLiteral:()=>Bdo,IsUnknown:()=>f$r,IsUnsafe:()=>p$r,IsVoid:()=>h$r,TypeGuardUnknownTypeError:()=>SPt});p();var SPt=class extends qi{static{a(this,"TypeGuardUnknownTypeError")}},Rdo=["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 wGr(t){try{return new RegExp(t),!0}catch{return!1}}a(wGr,"IsPattern");function TPt(t){if(!Ql(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(TPt,"IsControlCharacterFree");function RGr(t){return IPt(t)||Qu(t)}a(RGr,"IsAdditionalProperties");function FCe(t){return Bp(t)||NCe(t)}a(FCe,"IsOptionalBigInt");function ql(t){return Bp(t)||L1(t)}a(ql,"IsOptionalNumber");function IPt(t){return Bp(t)||sB(t)}a(IPt,"IsOptionalBoolean");function Kc(t){return Bp(t)||Ql(t)}a(Kc,"IsOptionalString");function kdo(t){return Bp(t)||Ql(t)&&TPt(t)&&wGr(t)}a(kdo,"IsOptionalPattern");function Pdo(t){return Bp(t)||Ql(t)&&TPt(t)}a(Pdo,"IsOptionalFormat");function kGr(t){return Bp(t)||Qu(t)}a(kGr,"IsOptionalSchema");function Ddo(t){return Yc(t)&&t[Nk]==="Readonly"}a(Ddo,"IsReadonly");function Ndo(t){return Yc(t)&&t[hA]==="Optional"}a(Ndo,"IsOptional");function PGr(t){return Bs(t,"Any")&&Kc(t.$id)}a(PGr,"IsAny");function DGr(t){return Bs(t,"Argument")&&L1(t.index)}a(DGr,"IsArgument");function NGr(t){return Bs(t,"Array")&&t.type==="array"&&Kc(t.$id)&&Qu(t.items)&&ql(t.minItems)&&ql(t.maxItems)&&IPt(t.uniqueItems)&&kGr(t.contains)&&ql(t.minContains)&&ql(t.maxContains)}a(NGr,"IsArray");function MGr(t){return Bs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&Kc(t.$id)&&Qu(t.items)}a(MGr,"IsAsyncIterator");function OGr(t){return Bs(t,"BigInt")&&t.type==="bigint"&&Kc(t.$id)&&FCe(t.exclusiveMaximum)&&FCe(t.exclusiveMinimum)&&FCe(t.maximum)&&FCe(t.minimum)&&FCe(t.multipleOf)}a(OGr,"IsBigInt");function LGr(t){return Bs(t,"Boolean")&&t.type==="boolean"&&Kc(t.$id)}a(LGr,"IsBoolean");function BGr(t){return Bs(t,"Computed")&&Ql(t.target)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))}a(BGr,"IsComputed");function FGr(t){return Bs(t,"Constructor")&&t.type==="Constructor"&&Kc(t.$id)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))&&Qu(t.returns)}a(FGr,"IsConstructor");function UGr(t){return Bs(t,"Date")&&t.type==="Date"&&Kc(t.$id)&&ql(t.exclusiveMaximumTimestamp)&&ql(t.exclusiveMinimumTimestamp)&&ql(t.maximumTimestamp)&&ql(t.minimumTimestamp)&&ql(t.multipleOfTimestamp)}a(UGr,"IsDate");function QGr(t){return Bs(t,"Function")&&t.type==="Function"&&Kc(t.$id)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))&&Qu(t.returns)}a(QGr,"IsFunction");function Mdo(t){return Bs(t,"Import")&&H9e(t,"$defs")&&Yc(t.$defs)&&K9e(t.$defs)&&H9e(t,"$ref")&&Ql(t.$ref)&&t.$ref in t.$defs}a(Mdo,"IsImport");function qGr(t){return Bs(t,"Integer")&&t.type==="integer"&&Kc(t.$id)&&ql(t.exclusiveMaximum)&&ql(t.exclusiveMinimum)&&ql(t.maximum)&&ql(t.minimum)&&ql(t.multipleOf)}a(qGr,"IsInteger");function K9e(t){return Yc(t)&&Object.entries(t).every(([e,r])=>TPt(e)&&Qu(r))}a(K9e,"IsProperties");function jGr(t){return Bs(t,"Intersect")&&!(Ql(t.type)&&t.type!=="object")&&Lp(t.allOf)&&t.allOf.every(e=>Qu(e)&&!c$r(e))&&Kc(t.type)&&(IPt(t.unevaluatedProperties)||kGr(t.unevaluatedProperties))&&Kc(t.$id)}a(jGr,"IsIntersect");function HGr(t){return Bs(t,"Iterator")&&t.type==="Iterator"&&Kc(t.$id)&&Qu(t.items)}a(HGr,"IsIterator");function Bs(t,e){return Yc(t)&&Tt in t&&t[Tt]===e}a(Bs,"IsKindOf");function GGr(t){return UCe(t)&&Ql(t.const)}a(GGr,"IsLiteralString");function $Gr(t){return UCe(t)&&L1(t.const)}a($Gr,"IsLiteralNumber");function Odo(t){return UCe(t)&&sB(t.const)}a(Odo,"IsLiteralBoolean");function UCe(t){return Bs(t,"Literal")&&Kc(t.$id)&&VGr(t.const)}a(UCe,"IsLiteral");function VGr(t){return sB(t)||L1(t)||Ql(t)}a(VGr,"IsLiteralValue");function WGr(t){return Bs(t,"MappedKey")&&Lp(t.keys)&&t.keys.every(e=>L1(e)||Ql(e))}a(WGr,"IsMappedKey");function zGr(t){return Bs(t,"MappedResult")&&K9e(t.properties)}a(zGr,"IsMappedResult");function YGr(t){return Bs(t,"Never")&&Yc(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(YGr,"IsNever");function KGr(t){return Bs(t,"Not")&&Qu(t.not)}a(KGr,"IsNot");function JGr(t){return Bs(t,"Null")&&t.type==="null"&&Kc(t.$id)}a(JGr,"IsNull");function ZGr(t){return Bs(t,"Number")&&t.type==="number"&&Kc(t.$id)&&ql(t.exclusiveMaximum)&&ql(t.exclusiveMinimum)&&ql(t.maximum)&&ql(t.minimum)&&ql(t.multipleOf)}a(ZGr,"IsNumber");function XGr(t){return Bs(t,"Object")&&t.type==="object"&&Kc(t.$id)&&K9e(t.properties)&&RGr(t.additionalProperties)&&ql(t.minProperties)&&ql(t.maxProperties)}a(XGr,"IsObject");function e$r(t){return Bs(t,"Promise")&&t.type==="Promise"&&Kc(t.$id)&&Qu(t.item)}a(e$r,"IsPromise");function t$r(t){return Bs(t,"Record")&&t.type==="object"&&Kc(t.$id)&&RGr(t.additionalProperties)&&Yc(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&wGr(r[0])&&Yc(e.patternProperties)&&Qu(e.patternProperties[r[0]])})(t)}a(t$r,"IsRecord");function Ldo(t){return Yc(t)&&GI in t&&t[GI]==="Recursive"}a(Ldo,"IsRecursive");function r$r(t){return Bs(t,"Ref")&&Kc(t.$id)&&Ql(t.$ref)}a(r$r,"IsRef");function n$r(t){return Bs(t,"RegExp")&&Kc(t.$id)&&Ql(t.source)&&Ql(t.flags)&&ql(t.maxLength)&&ql(t.minLength)}a(n$r,"IsRegExp");function i$r(t){return Bs(t,"String")&&t.type==="string"&&Kc(t.$id)&&ql(t.minLength)&&ql(t.maxLength)&&kdo(t.pattern)&&Pdo(t.format)}a(i$r,"IsString");function o$r(t){return Bs(t,"Symbol")&&t.type==="symbol"&&Kc(t.$id)}a(o$r,"IsSymbol");function s$r(t){return Bs(t,"TemplateLiteral")&&t.type==="string"&&Ql(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(s$r,"IsTemplateLiteral");function a$r(t){return Bs(t,"This")&&Kc(t.$id)&&Ql(t.$ref)}a(a$r,"IsThis");function c$r(t){return Yc(t)&&wd in t}a(c$r,"IsTransform");function l$r(t){return Bs(t,"Tuple")&&t.type==="array"&&Kc(t.$id)&&L1(t.minItems)&&L1(t.maxItems)&&t.minItems===t.maxItems&&(Bp(t.items)&&Bp(t.additionalItems)&&t.minItems===0||Lp(t.items)&&t.items.every(e=>Qu(e)))}a(l$r,"IsTuple");function u$r(t){return Bs(t,"Undefined")&&t.type==="undefined"&&Kc(t.$id)}a(u$r,"IsUndefined");function Bdo(t){return xPt(t)&&t.anyOf.every(e=>GGr(e)||$Gr(e))}a(Bdo,"IsUnionLiteral");function xPt(t){return Bs(t,"Union")&&Kc(t.$id)&&Yc(t)&&Lp(t.anyOf)&&t.anyOf.every(e=>Qu(e))}a(xPt,"IsUnion");function d$r(t){return Bs(t,"Uint8Array")&&t.type==="Uint8Array"&&Kc(t.$id)&&ql(t.minByteLength)&&ql(t.maxByteLength)}a(d$r,"IsUint8Array");function f$r(t){return Bs(t,"Unknown")&&Kc(t.$id)}a(f$r,"IsUnknown");function p$r(t){return Bs(t,"Unsafe")}a(p$r,"IsUnsafe");function h$r(t){return Bs(t,"Void")&&t.type==="void"&&Kc(t.$id)}a(h$r,"IsVoid");function m$r(t){return Yc(t)&&Tt in t&&Ql(t[Tt])&&!Rdo.includes(t[Tt])}a(m$r,"IsKind");function Qu(t){return Yc(t)&&(PGr(t)||DGr(t)||NGr(t)||LGr(t)||OGr(t)||MGr(t)||BGr(t)||FGr(t)||UGr(t)||QGr(t)||qGr(t)||jGr(t)||HGr(t)||UCe(t)||WGr(t)||zGr(t)||YGr(t)||KGr(t)||JGr(t)||ZGr(t)||XGr(t)||e$r(t)||t$r(t)||r$r(t)||n$r(t)||i$r(t)||o$r(t)||s$r(t)||a$r(t)||l$r(t)||u$r(t)||xPt(t)||d$r(t)||f$r(t)||p$r(t)||h$r(t)||m$r(t))}a(Qu,"IsSchema");p();var wPt="(true|false)",QCe="(0|[1-9][0-9]*)",RPt="(.*)",Fdo="(?!.*)",Ydl=`^${wPt}$`,AU=`^${QCe}$`,yU=`^${RPt}$`,g$r=`^${Fdo}$`;p();var Qk={};ki(Qk,{Clear:()=>Qdo,Delete:()=>qdo,Entries:()=>Udo,Get:()=>Gdo,Has:()=>jdo,Set:()=>Hdo});p();var Roe=new Map;function Udo(){return new Map(Roe)}a(Udo,"Entries");function Qdo(){return Roe.clear()}a(Qdo,"Clear");function qdo(t){return Roe.delete(t)}a(qdo,"Delete");function jdo(t){return Roe.has(t)}a(jdo,"Has");function Hdo(t,e){Roe.set(t,e)}a(Hdo,"Set");function Gdo(t){return Roe.get(t)}a(Gdo,"Get");var v_={};ki(v_,{Clear:()=>Vdo,Delete:()=>Wdo,Entries:()=>$do,Get:()=>Kdo,Has:()=>zdo,Set:()=>Ydo});p();var koe=new Map;function $do(){return new Map(koe)}a($do,"Entries");function Vdo(){return koe.clear()}a(Vdo,"Clear");function Wdo(t){return koe.delete(t)}a(Wdo,"Delete");function zdo(t){return koe.has(t)}a(zdo,"Has");function Ydo(t,e){koe.set(t,e)}a(Ydo,"Set");function Kdo(t){return koe.get(t)}a(Kdo,"Get");p();function A$r(t,e){return t.includes(e)}a(A$r,"SetIncludes");function y$r(t){return[...new Set(t)]}a(y$r,"SetDistinct");function Jdo(t,e){return t.filter(r=>e.includes(r))}a(Jdo,"SetIntersect");function Zdo(t,e){return t.reduce((r,n)=>Jdo(r,n),e)}a(Zdo,"SetIntersectManyResolve");function E$r(t){return t.length===1?t[0]:t.length>1?Zdo(t.slice(1),t[0]):[]}a(E$r,"SetIntersectMany");function _$r(t){let e=[];for(let r of t)e.push(...r);return e}a(_$r,"SetUnionMany");p();function EU(t){return wt({[Tt]:"Any"},t)}a(EU,"Any");p();function Poe(t,e){return wt({[Tt]:"Array",type:"array",items:t},e)}a(Poe,"Array");p();function v$r(t){return wt({[Tt]:"Argument",index:t})}a(v$r,"Argument");p();function Doe(t,e){return wt({[Tt]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(Doe,"AsyncIterator");p();p();function au(t,e,r){return wt({[Tt]:"Computed",target:t,parameters:e},r)}a(au,"Computed");p();p();function Xdo(t,e){let{[e]:r,...n}=t;return n}a(Xdo,"DiscardKey");function cf(t,e){return e.reduce((r,n)=>Xdo(r,n),t)}a(cf,"Discard");p();function Xo(t){return wt({[Tt]:"Never",not:{}},t)}a(Xo,"Never");p();p();function Ua(t){return wt({[Tt]:"MappedResult",properties:t})}a(Ua,"MappedResult");p();p();function Noe(t,e,r){return wt({[Tt]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(Noe,"Constructor");p();function rM(t,e,r){return wt({[Tt]:"Function",type:"Function",parameters:t,returns:e},r)}a(rM,"Function");p();p();p();p();function qCe(t,e){return wt({[Tt]:"Union",anyOf:t},e)}a(qCe,"UnionCreate");function efo(t){return t.some(e=>oC(e))}a(efo,"IsUnionOptional");function C$r(t){return t.map(e=>oC(e)?tfo(e):e)}a(C$r,"RemoveOptionalFromRest");function tfo(t){return cf(t,[hA])}a(tfo,"RemoveOptionalFromType");function rfo(t,e){return efo(t)?By(qCe(C$r(t),e)):qCe(C$r(t),e)}a(rfo,"ResolveUnion");function nM(t,e){return t.length===1?wt(t[0],e):t.length===0?Xo(e):rfo(t,e)}a(nM,"UnionEvaluated");p();function tc(t,e){return t.length===0?Xo(e):t.length===1?wt(t[0],e):qCe(t,e)}a(tc,"Union");p();p();p();var J9e=class extends qi{static{a(this,"TemplateLiteralParserError")}};function nfo(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(nfo,"Unescape");function kPt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(kPt,"IsNonEscaped");function hB(t,e){return kPt(t,e,"(")}a(hB,"IsOpenParen");function jCe(t,e){return kPt(t,e,")")}a(jCe,"IsCloseParen");function b$r(t,e){return kPt(t,e,"|")}a(b$r,"IsSeparator");function ifo(t){if(!(hB(t,0)&&jCe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Moe(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Moe(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(cfo,"Or");function lfo(t){function e(o,s){if(!hB(o,s))throw new J9e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Moe(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(lfo,"And");function Moe(t){return ifo(t)?Moe(ofo(t)):sfo(t)?cfo(t):afo(t)?lfo(t):{type:"const",const:nfo(t)}}a(Moe,"TemplateLiteralParse");function Ooe(t){return Moe(t.slice(1,t.length-1))}a(Ooe,"TemplateLiteralParseExact");var PPt=class extends qi{static{a(this,"TemplateLiteralFiniteError")}};function ufo(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(ufo,"IsNumberExpression");function dfo(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(dfo,"IsBooleanExpression");function ffo(t){return t.type==="const"&&t.const===".*"}a(ffo,"IsStringExpression");function MW(t){return ufo(t)||ffo(t)?!1:dfo(t)?!0:t.type==="and"?t.expr.every(e=>MW(e)):t.type==="or"?t.expr.every(e=>MW(e)):t.type==="const"?!0:(()=>{throw new PPt("Unknown expression type")})()}a(MW,"IsTemplateLiteralExpressionFinite");function Z9e(t){let e=Ooe(t.pattern);return MW(e)}a(Z9e,"IsTemplateLiteralFinite");p();var DPt=class extends qi{static{a(this,"TemplateLiteralGenerateError")}};function*S$r(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of S$r(t.slice(1)))yield`${e}${r}`}a(S$r,"GenerateReduce");function*pfo(t){return yield*S$r(t.expr.map(e=>[...HCe(e)]))}a(pfo,"GenerateAnd");function*hfo(t){for(let e of t.expr)yield*HCe(e)}a(hfo,"GenerateOr");function*mfo(t){return yield t.const}a(mfo,"GenerateConst");function*HCe(t){return t.type==="and"?yield*pfo(t):t.type==="or"?yield*hfo(t):t.type==="const"?yield*mfo(t):(()=>{throw new DPt("Unknown expression")})()}a(HCe,"TemplateLiteralExpressionGenerate");function Loe(t){let e=Ooe(t.pattern);return MW(e)?[...HCe(e)]:[]}a(Loe,"TemplateLiteralGenerate");p();p();function ca(t,e){return wt({[Tt]:"Literal",const:t,type:typeof t},e)}a(ca,"Literal");p();function X9e(t){return wt({[Tt]:"Boolean",type:"boolean"},t)}a(X9e,"Boolean");p();function Boe(t){return wt({[Tt]:"BigInt",type:"bigint"},t)}a(Boe,"BigInt");p();function $I(t){return wt({[Tt]:"Number",type:"number"},t)}a($I,"Number");p();function C_(t){return wt({[Tt]:"String",type:"string"},t)}a(C_,"String");function*gfo(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield X9e():e==="number"?yield $I():e==="bigint"?yield Boe():e==="string"?yield C_():yield(()=>{let r=e.split("|").map(n=>ca(n.trim()));return r.length===0?Xo():r.length===1?r[0]:nM(r)})()}a(gfo,"FromUnion");function*Afo(t){if(t[1]!=="{"){let e=ca("$"),r=NPt(t.slice(1));return yield*[e,...r]}for(let e=2;eI$r(r,e)).join("|")})`:Uk(t)?`${e}${QCe}`:Fk(t)?`${e}${QCe}`:kW(t)?`${e}${QCe}`:dB(t)?`${e}${RPt}`:F1(t)?`${e}${yfo(t.const.toString())}`:uB(t)?`${e}${wPt}`:(()=>{throw new MPt(`Unexpected Kind '${t[Tt]}'`)})()}a(I$r,"Visit");function OPt(t){return`^${t.map(e=>I$r(e,"")).join("")}$`}a(OPt,"TemplateLiteralPattern");p();function OW(t){let r=Loe(t).map(n=>ca(n));return nM(r)}a(OW,"TemplateLiteralToUnion");p();function eUe(t,e){let r=Ql(t)?OPt(T$r(t)):OPt(t);return wt({[Tt]:"TemplateLiteral",type:"string",pattern:r},e)}a(eUe,"TemplateLiteral");function Efo(t){return Loe(t).map(r=>r.toString())}a(Efo,"FromTemplateLiteral");function _fo(t){let e=[];for(let r of t)e.push(...sC(r));return e}a(_fo,"FromUnion");function vfo(t){return[t.toString()]}a(vfo,"FromLiteral");function sC(t){return[...new Set(Q1(t)?Efo(t):Sa(t)?_fo(t.anyOf):F1(t)?vfo(t.const):Uk(t)?["[number]"]:Fk(t)?["[number]"]:[])]}a(sC,"IndexPropertyKeys");p();function Cfo(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=_U(t,sC(e[o]),r);return n}a(Cfo,"FromProperties");function bfo(t,e,r){return Cfo(t,e.properties,r)}a(bfo,"FromMappedResult");function x$r(t,e,r){let n=bfo(t,e,r);return Ua(n)}a(x$r,"IndexFromMappedResult");function R$r(t,e){return t.map(r=>k$r(r,e))}a(R$r,"FromRest");function Sfo(t){return t.filter(e=>!mU(e))}a(Sfo,"FromIntersectRest");function Tfo(t,e){return tUe(Sfo(R$r(t,e)))}a(Tfo,"FromIntersect");function Ifo(t){return t.some(e=>mU(e))?[]:t}a(Ifo,"FromUnionRest");function xfo(t,e){return nM(Ifo(R$r(t,e)))}a(xfo,"FromUnion");function wfo(t,e){return e in t?t[e]:e==="[number]"?nM(t):Xo()}a(wfo,"FromTuple");function Rfo(t,e){return e==="[number]"?t:Xo()}a(Rfo,"FromArray");function kfo(t,e){return e in t?t[e]:Xo()}a(kfo,"FromProperty");function k$r(t,e){return af(t)?Tfo(t.allOf,e):Sa(t)?xfo(t.anyOf,e):q1(t)?wfo(t.items??[],e):Mk(t)?Rfo(t.items,e):Fp(t)?kfo(t.properties,e):Xo()}a(k$r,"IndexFromPropertyKey");function GCe(t,e){return e.map(r=>k$r(t,r))}a(GCe,"IndexFromPropertyKeys");function w$r(t,e){return nM(GCe(t,e))}a(w$r,"FromSchema");function _U(t,e,r){if(jf(t)||jf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!Rd(t)||!Rd(e))throw new qi(n);return au("Index",[t,e])}return Uu(e)?x$r(t,e,r):U1(e)?P$r(t,e,r):wt(Rd(e)?w$r(t,sC(e)):w$r(t,e),r)}a(_U,"Index");function Pfo(t,e,r){return{[e]:_U(t,[e],Bu(r))}}a(Pfo,"MappedIndexPropertyKey");function Dfo(t,e,r){return e.reduce((n,o)=>({...n,...Pfo(t,o,r)}),{})}a(Dfo,"MappedIndexPropertyKeys");function Nfo(t,e,r){return Dfo(t,e.keys,r)}a(Nfo,"MappedIndexProperties");function P$r(t,e,r){let n=Nfo(t,e,r);return Ua(n)}a(P$r,"IndexFromMappedKey");p();function Foe(t,e){return wt({[Tt]:"Iterator",type:"Iterator",items:t},e)}a(Foe,"Iterator");p();function Mfo(t){return globalThis.Object.keys(t).filter(e=>!oC(t[e]))}a(Mfo,"RequiredArray");function Ofo(t,e){let r=Mfo(t),n=r.length>0?{[Tt]:"Object",type:"object",required:r,properties:t}:{[Tt]:"Object",type:"object",properties:t};return wt(n,e)}a(Ofo,"_Object");var rc=Ofo;p();function rUe(t,e){return wt({[Tt]:"Promise",type:"Promise",item:t},e)}a(rUe,"Promise");p();p();function Lfo(t){return wt(cf(t,[Nk]))}a(Lfo,"RemoveReadonly");function Bfo(t){return wt({...t,[Nk]:"Readonly"})}a(Bfo,"AddReadonly");function Ffo(t,e){return e===!1?Lfo(t):Bfo(t)}a(Ffo,"ReadonlyWithFlag");function aC(t,e){let r=e??!0;return Uu(t)?D$r(t,r):Ffo(t,r)}a(aC,"Readonly");function Ufo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=aC(t[n],e);return r}a(Ufo,"FromProperties");function Qfo(t,e){return Ufo(t.properties,e)}a(Qfo,"FromMappedResult");function D$r(t,e){let r=Qfo(t,e);return Ua(r)}a(D$r,"ReadonlyFromMappedResult");p();function VI(t,e){return wt(t.length>0?{[Tt]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[Tt]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(VI,"Tuple");function N$r(t,e){return t in e?WI(t,e[t]):Ua(e)}a(N$r,"FromMappedResult");function qfo(t){return{[t]:ca(t)}}a(qfo,"MappedKeyToKnownMappedResultProperties");function jfo(t){let e={};for(let r of t)e[r]=ca(r);return e}a(jfo,"MappedKeyToUnknownMappedResultProperties");function Hfo(t,e){return A$r(e,t)?qfo(t):jfo(e)}a(Hfo,"MappedKeyToMappedResultProperties");function Gfo(t,e){let r=Hfo(t,e);return N$r(t,r)}a(Gfo,"FromMappedKey");function $Ce(t,e){return e.map(r=>WI(t,r))}a($Ce,"FromRest");function $fo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=WI(t,e[n]);return r}a($fo,"FromProperties");function WI(t,e){let r={...e};return oC(e)?By(WI(t,cf(e,[hA]))):woe(e)?aC(WI(t,cf(e,[Nk]))):Uu(e)?N$r(t,e.properties):U1(e)?Gfo(t,e.keys):Lk(e)?Noe($Ce(t,e.parameters),WI(t,e.returns),r):Bk(e)?rM($Ce(t,e.parameters),WI(t,e.returns),r):RW(e)?Doe(WI(t,e.items),r):PW(e)?Foe(WI(t,e.items),r):af(e)?Fy($Ce(t,e.allOf),r):Sa(e)?tc($Ce(t,e.anyOf),r):q1(e)?VI($Ce(t,e.items??[]),r):Fp(e)?rc($fo(t,e.properties),r):Mk(e)?Poe(WI(t,e.items),r):DW(e)?rUe(WI(t,e.item),r):e}a(WI,"FromSchemaType");function Vfo(t,e){let r={};for(let n of t)r[n]=WI(n,e);return r}a(Vfo,"MappedFunctionReturnType");function M$r(t,e,r){let n=Rd(t)?sC(t):t,o=e({[Tt]:"MappedKey",keys:n}),s=Vfo(n,o);return rc(s,r)}a(M$r,"Mapped");p();function Wfo(t){return wt(cf(t,[hA]))}a(Wfo,"RemoveOptional");function zfo(t){return wt({...t,[hA]:"Optional"})}a(zfo,"AddOptional");function Yfo(t,e){return e===!1?Wfo(t):zfo(t)}a(Yfo,"OptionalWithFlag");function By(t,e){let r=e??!0;return Uu(t)?O$r(t,r):Yfo(t,r)}a(By,"Optional");function Kfo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=By(t[n],e);return r}a(Kfo,"FromProperties");function Jfo(t,e){return Kfo(t.properties,e)}a(Jfo,"FromMappedResult");function O$r(t,e){let r=Jfo(t,e);return Ua(r)}a(O$r,"OptionalFromMappedResult");p();function VCe(t,e={}){let r=t.every(o=>Fp(o)),n=Rd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return wt(e.unevaluatedProperties===!1||Rd(e.unevaluatedProperties)||r?{...n,[Tt]:"Intersect",type:"object",allOf:t}:{...n,[Tt]:"Intersect",allOf:t},e)}a(VCe,"IntersectCreate");function Zfo(t){return t.every(e=>oC(e))}a(Zfo,"IsIntersectOptional");function Xfo(t){return cf(t,[hA])}a(Xfo,"RemoveOptionalFromType");function L$r(t){return t.map(e=>oC(e)?Xfo(e):e)}a(L$r,"RemoveOptionalFromRest");function epo(t,e){return Zfo(t)?By(VCe(L$r(t),e)):VCe(L$r(t),e)}a(epo,"ResolveIntersect");function tUe(t,e={}){if(t.length===1)return wt(t[0],e);if(t.length===0)return Xo(e);if(t.some(r=>ec(r)))throw new Error("Cannot intersect transform types");return epo(t,e)}a(tUe,"IntersectEvaluated");p();function Fy(t,e){if(t.length===1)return wt(t[0],e);if(t.length===0)return Xo(e);if(t.some(r=>ec(r)))throw new Error("Cannot intersect transform types");return VCe(t,e)}a(Fy,"Intersect");p();function zI(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new qi("Ref: $ref must be a string");return wt({[Tt]:"Ref",$ref:e},r)}a(zI,"Ref");function tpo(t,e){return au("Awaited",[au(t,e)])}a(tpo,"FromComputed");function rpo(t){return au("Awaited",[zI(t)])}a(rpo,"FromRef");function npo(t){return Fy(B$r(t))}a(npo,"FromIntersect");function ipo(t){return tc(B$r(t))}a(ipo,"FromUnion");function opo(t){return Uoe(t)}a(opo,"FromPromise");function B$r(t){return t.map(e=>Uoe(e))}a(B$r,"FromRest");function Uoe(t,e){return wt(Ok(t)?tpo(t.target,t.parameters):af(t)?npo(t.allOf):Sa(t)?ipo(t.anyOf):DW(t)?opo(t.item):jf(t)?rpo(t.$ref):t,e)}a(Uoe,"Awaited");p();p();p();p();function F$r(t){let e=[];for(let r of t)e.push(cC(r));return e}a(F$r,"FromRest");function spo(t){let e=F$r(t);return _$r(e)}a(spo,"FromIntersect");function apo(t){let e=F$r(t);return E$r(e)}a(apo,"FromUnion");function cpo(t){return t.map((e,r)=>r.toString())}a(cpo,"FromTuple");function lpo(t){return["[number]"]}a(lpo,"FromArray");function upo(t){return globalThis.Object.getOwnPropertyNames(t)}a(upo,"FromProperties");function dpo(t){return LPt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(dpo,"FromPatternProperties");function cC(t){return af(t)?spo(t.allOf):Sa(t)?apo(t.anyOf):q1(t)?cpo(t.items??[]):Mk(t)?lpo(t.items):Fp(t)?upo(t.properties):NW(t)?dpo(t.patternProperties):[]}a(cC,"KeyOfPropertyKeys");var LPt=!1;function mB(t){LPt=!0;let e=cC(t);return LPt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(mB,"KeyOfPattern");function fpo(t,e){return au("KeyOf",[au(t,e)])}a(fpo,"FromComputed");function ppo(t){return au("KeyOf",[zI(t)])}a(ppo,"FromRef");function hpo(t,e){let r=cC(t),n=mpo(r),o=nM(n);return wt(o,e)}a(hpo,"KeyOfFromType");function mpo(t){return t.map(e=>e==="[number]"?$I():ca(e))}a(mpo,"KeyOfPropertyKeysToRest");function Qoe(t,e){return Ok(t)?fpo(t.target,t.parameters):jf(t)?ppo(t.$ref):Uu(t)?U$r(t,e):hpo(t,e)}a(Qoe,"KeyOf");function gpo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Qoe(t[n],Bu(e));return r}a(gpo,"FromProperties");function Apo(t,e){return gpo(t.properties,e)}a(Apo,"FromMappedResult");function U$r(t,e){let r=Apo(t,e);return Ua(r)}a(U$r,"KeyOfFromMappedResult");p();function nUe(t){let e=cC(t),r=GCe(t,e);return e.map((n,o)=>[e[o],r[o]])}a(nUe,"KeyOfPropertyEntries");function ypo(t){let e=[];for(let r of t)e.push(...cC(r));return y$r(e)}a(ypo,"CompositeKeys");function Epo(t){return t.filter(e=>!mU(e))}a(Epo,"FilterNever");function _po(t,e){let r=[];for(let n of t)r.push(...GCe(n,[e]));return Epo(r)}a(_po,"CompositeProperty");function vpo(t,e){let r={};for(let n of e)r[n]=tUe(_po(t,n));return r}a(vpo,"CompositeProperties");function Q$r(t,e){let r=ypo(t),n=vpo(t,r);return rc(n,e)}a(Q$r,"Composite");p();p();function iUe(t){return wt({[Tt]:"Date",type:"Date"},t)}a(iUe,"Date");p();function oUe(t){return wt({[Tt]:"Null",type:"null"},t)}a(oUe,"Null");p();function sUe(t){return wt({[Tt]:"Symbol",type:"symbol"},t)}a(sUe,"Symbol");p();function aUe(t){return wt({[Tt]:"Undefined",type:"undefined"},t)}a(aUe,"Undefined");p();function cUe(t){return wt({[Tt]:"Uint8Array",type:"Uint8Array"},t)}a(cUe,"Uint8Array");p();function qk(t){return wt({[Tt]:"Unknown"},t)}a(qk,"Unknown");function Cpo(t){return t.map(e=>BPt(e,!1))}a(Cpo,"FromArray");function bpo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=aC(BPt(t[r],!1));return e}a(bpo,"FromProperties");function lUe(t,e){return e===!0?t:aC(t)}a(lUe,"ConditionalReadonly");function BPt(t,e){return mPt(t)?lUe(EU(),e):APt(t)?lUe(EU(),e):Lp(t)?aC(VI(Cpo(t))):aB(t)?cUe():wW(t)?iUe():Yc(t)?lUe(rc(bpo(t)),e):gPt(t)?lUe(rM([],qk()),e):Bp(t)?aUe():yPt(t)?oUe():EPt(t)?sUe():NCe(t)?Boe():L1(t)?ca(t):sB(t)?ca(t):Ql(t)?ca(t):rc({})}a(BPt,"FromValue");function q$r(t,e){return wt(BPt(t,!0),e)}a(q$r,"Const");p();function j$r(t,e){return Lk(t)?VI(t.parameters,e):Xo(e)}a(j$r,"ConstructorParameters");p();function H$r(t,e){if(Bp(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=>ca(s));return tc(o,{...e,[GI]:"Enum"})}a(H$r,"Enum");p();p();p();var UPt=class extends qi{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 YI(t){return t===Rt.False?t:Rt.True}a(YI,"IntoBooleanResult");function qoe(t){throw new UPt(t)}a(qoe,"Throw");function Ih(t){return it.IsNever(t)||it.IsIntersect(t)||it.IsUnion(t)||it.IsUnknown(t)||it.IsAny(t)}a(Ih,"IsStructuralRight");function xh(t,e){return it.IsNever(e)?K$r(t,e):it.IsIntersect(e)?uUe(t,e):it.IsUnion(e)?HPt(t,e):it.IsUnknown(e)?eVr(t,e):it.IsAny(e)?jPt(t,e):qoe("StructuralRight")}a(xh,"StructuralRight");function jPt(t,e){return Rt.True}a(jPt,"FromAnyRight");function Spo(t,e){return it.IsIntersect(e)?uUe(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(Spo,"FromAny");function Tpo(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)?Rt.True:Rt.False}a(Tpo,"FromArrayRight");function Ipo(t,e){return it.IsObject(e)&&dUe(e)?Rt.True:Ih(e)?xh(t,e):it.IsArray(e)?YI(Jc(t.items,e.items)):Rt.False}a(Ipo,"FromArray");function xpo(t,e){return Ih(e)?xh(t,e):it.IsAsyncIterator(e)?YI(Jc(t.items,e.items)):Rt.False}a(xpo,"FromAsyncIterator");function wpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?KI(t,e):it.IsBigInt(e)?Rt.True:Rt.False}a(wpo,"FromBigInt");function z$r(t,e){return it.IsLiteralBoolean(t)||it.IsBoolean(t)?Rt.True:Rt.False}a(z$r,"FromBooleanRight");function Rpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?KI(t,e):it.IsBoolean(e)?Rt.True:Rt.False}a(Rpo,"FromBoolean");function kpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsConstructor(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>YI(Jc(e.parameters[n],r))===Rt.True)?YI(Jc(t.returns,e.returns)):Rt.False:Rt.False}a(kpo,"FromConstructor");function Ppo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?KI(t,e):it.IsDate(e)?Rt.True:Rt.False}a(Ppo,"FromDate");function Dpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsFunction(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>YI(Jc(e.parameters[n],r))===Rt.True)?YI(Jc(t.returns,e.returns)):Rt.False:Rt.False}a(Dpo,"FromFunction");function Y$r(t,e){return it.IsLiteral(t)&&Ly.IsNumber(t.const)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(Y$r,"FromIntegerRight");function Npo(t,e){return it.IsInteger(e)||it.IsNumber(e)?Rt.True:Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?KI(t,e):Rt.False}a(Npo,"FromInteger");function uUe(t,e){return e.allOf.every(r=>Jc(t,r)===Rt.True)?Rt.True:Rt.False}a(uUe,"FromIntersectRight");function Mpo(t,e){return t.allOf.some(r=>Jc(r,e)===Rt.True)?Rt.True:Rt.False}a(Mpo,"FromIntersect");function Opo(t,e){return Ih(e)?xh(t,e):it.IsIterator(e)?YI(Jc(t.items,e.items)):Rt.False}a(Opo,"FromIterator");function Lpo(t,e){return it.IsLiteral(e)&&e.const===t.const?Rt.True:Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?KI(t,e):it.IsString(e)?X$r(t,e):it.IsNumber(e)?J$r(t,e):it.IsInteger(e)?Y$r(t,e):it.IsBoolean(e)?z$r(t,e):Rt.False}a(Lpo,"FromLiteral");function K$r(t,e){return Rt.False}a(K$r,"FromNeverRight");function Bpo(t,e){return Rt.True}a(Bpo,"FromNever");function G$r(t){let[e,r]=[t,0];for(;it.IsNot(e);)e=e.not,r+=1;return r%2===0?e:qk()}a(G$r,"UnwrapTNot");function Fpo(t,e){return it.IsNot(t)?Jc(G$r(t),e):it.IsNot(e)?Jc(t,G$r(e)):qoe("Invalid fallthrough for Not")}a(Fpo,"FromNot");function Upo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?KI(t,e):it.IsNull(e)?Rt.True:Rt.False}a(Upo,"FromNull");function J$r(t,e){return it.IsLiteralNumber(t)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(J$r,"FromNumberRight");function Qpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?KI(t,e):it.IsInteger(e)||it.IsNumber(e)?Rt.True:Rt.False}a(Qpo,"FromNumber");function lC(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(lC,"IsObjectPropertyCount");function $$r(t){return dUe(t)}a($$r,"IsObjectStringLike");function V$r(t){return lC(t,0)||lC(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(V$r,"IsObjectSymbolLike");function FPt(t){return lC(t,0)}a(FPt,"IsObjectNumberLike");function W$r(t){return lC(t,0)}a(W$r,"IsObjectBooleanLike");function qpo(t){return lC(t,0)}a(qpo,"IsObjectBigIntLike");function jpo(t){return lC(t,0)}a(jpo,"IsObjectDateLike");function Hpo(t){return dUe(t)}a(Hpo,"IsObjectUint8ArrayLike");function Gpo(t){let e=$I();return lC(t,0)||lC(t,1)&&"length"in t.properties&&YI(Jc(t.properties.length,e))===Rt.True}a(Gpo,"IsObjectFunctionLike");function $po(t){return lC(t,0)}a($po,"IsObjectConstructorLike");function dUe(t){let e=$I();return lC(t,0)||lC(t,1)&&"length"in t.properties&&YI(Jc(t.properties.length,e))===Rt.True}a(dUe,"IsObjectArrayLike");function Vpo(t){let e=rM([EU()],EU());return lC(t,0)||lC(t,1)&&"then"in t.properties&&YI(Jc(t.properties.then,e))===Rt.True}a(Vpo,"IsObjectPromiseLike");function Z$r(t,e){return Jc(t,e)===Rt.False||it.IsOptional(t)&&!it.IsOptional(e)?Rt.False:Rt.True}a(Z$r,"Property");function Uy(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)||it.IsLiteralString(t)&&$$r(e)||it.IsLiteralNumber(t)&&FPt(e)||it.IsLiteralBoolean(t)&&W$r(e)||it.IsSymbol(t)&&V$r(e)||it.IsBigInt(t)&&qpo(e)||it.IsString(t)&&$$r(e)||it.IsSymbol(t)&&V$r(e)||it.IsNumber(t)&&FPt(e)||it.IsInteger(t)&&FPt(e)||it.IsBoolean(t)&&W$r(e)||it.IsUint8Array(t)&&Hpo(e)||it.IsDate(t)&&jpo(e)||it.IsConstructor(t)&&$po(e)||it.IsFunction(t)&&Gpo(e)?Rt.True:it.IsRecord(t)&&it.IsString(QPt(t))?e[GI]==="Record"?Rt.True:Rt.False:it.IsRecord(t)&&it.IsNumber(QPt(t))&&lC(e,0)?Rt.True:Rt.False}a(Uy,"FromObjectRight");function Wpo(t,e){return Ih(e)?xh(t,e):it.IsRecord(e)?KI(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(Z$r(t.properties[r],e.properties[r])===Rt.False)return Rt.False}return Rt.True})():Rt.False}a(Wpo,"FromObject");function zpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)&&Vpo(e)?Rt.True:it.IsPromise(e)?YI(Jc(t.item,e.item)):Rt.False}a(zpo,"FromPromise");function QPt(t){return AU in t.patternProperties?$I():yU in t.patternProperties?C_():qoe("Unknown record key pattern")}a(QPt,"RecordKey");function qPt(t){return AU in t.patternProperties?t.patternProperties[AU]:yU in t.patternProperties?t.patternProperties[yU]:qoe("Unable to get record value schema")}a(qPt,"RecordValue");function KI(t,e){let[r,n]=[QPt(e),qPt(e)];return it.IsLiteralString(t)&&it.IsNumber(r)&&YI(Jc(t,n))===Rt.True?Rt.True:it.IsUint8Array(t)&&it.IsNumber(r)||it.IsString(t)&&it.IsNumber(r)||it.IsArray(t)&&it.IsNumber(r)?Jc(t,n):it.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(Z$r(n,t.properties[o])===Rt.False)return Rt.False;return Rt.True})():Rt.False}a(KI,"FromRecordRight");function Ypo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?Jc(qPt(t),qPt(e)):Rt.False}a(Ypo,"FromRecord");function Kpo(t,e){let r=it.IsRegExp(t)?C_():t,n=it.IsRegExp(e)?C_():e;return Jc(r,n)}a(Kpo,"FromRegExp");function X$r(t,e){return it.IsLiteral(t)&&Ly.IsString(t.const)||it.IsString(t)?Rt.True:Rt.False}a(X$r,"FromStringRight");function Jpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?KI(t,e):it.IsString(e)?Rt.True:Rt.False}a(Jpo,"FromString");function Zpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?KI(t,e):it.IsSymbol(e)?Rt.True:Rt.False}a(Zpo,"FromSymbol");function Xpo(t,e){return it.IsTemplateLiteral(t)?Jc(OW(t),e):it.IsTemplateLiteral(e)?Jc(t,OW(e)):qoe("Invalid fallthrough for TemplateLiteral")}a(Xpo,"FromTemplateLiteral");function eho(t,e){return it.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Jc(r,e.items)===Rt.True)}a(eho,"IsArrayOfTuple");function tho(t,e){return it.IsNever(t)?Rt.True:it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:Rt.False}a(tho,"FromTupleRight");function rho(t,e){return Ih(e)?xh(t,e):it.IsObject(e)&&dUe(e)||it.IsArray(e)&&eho(t,e)?Rt.True:it.IsTuple(e)?Ly.IsUndefined(t.items)&&!Ly.IsUndefined(e.items)||!Ly.IsUndefined(t.items)&&Ly.IsUndefined(e.items)?Rt.False:Ly.IsUndefined(t.items)&&!Ly.IsUndefined(e.items)||t.items.every((r,n)=>Jc(r,e.items[n])===Rt.True)?Rt.True:Rt.False:Rt.False}a(rho,"FromTuple");function nho(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?KI(t,e):it.IsUint8Array(e)?Rt.True:Rt.False}a(nho,"FromUint8Array");function iho(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?KI(t,e):it.IsVoid(e)?aho(t,e):it.IsUndefined(e)?Rt.True:Rt.False}a(iho,"FromUndefined");function HPt(t,e){return e.anyOf.some(r=>Jc(t,r)===Rt.True)?Rt.True:Rt.False}a(HPt,"FromUnionRight");function oho(t,e){return t.anyOf.every(r=>Jc(r,e)===Rt.True)?Rt.True:Rt.False}a(oho,"FromUnion");function eVr(t,e){return Rt.True}a(eVr,"FromUnknownRight");function sho(t,e){return it.IsNever(e)?K$r(t,e):it.IsIntersect(e)?uUe(t,e):it.IsUnion(e)?HPt(t,e):it.IsAny(e)?jPt(t,e):it.IsString(e)?X$r(t,e):it.IsNumber(e)?J$r(t,e):it.IsInteger(e)?Y$r(t,e):it.IsBoolean(e)?z$r(t,e):it.IsArray(e)?Tpo(t,e):it.IsTuple(e)?tho(t,e):it.IsObject(e)?Uy(t,e):it.IsUnknown(e)?Rt.True:Rt.False}a(sho,"FromUnknown");function aho(t,e){return it.IsUndefined(t)||it.IsUndefined(t)?Rt.True:Rt.False}a(aho,"FromVoidRight");function cho(t,e){return it.IsIntersect(e)?uUe(t,e):it.IsUnion(e)?HPt(t,e):it.IsUnknown(e)?eVr(t,e):it.IsAny(e)?jPt(t,e):it.IsObject(e)?Uy(t,e):it.IsVoid(e)?Rt.True:Rt.False}a(cho,"FromVoid");function Jc(t,e){return it.IsTemplateLiteral(t)||it.IsTemplateLiteral(e)?Xpo(t,e):it.IsRegExp(t)||it.IsRegExp(e)?Kpo(t,e):it.IsNot(t)||it.IsNot(e)?Fpo(t,e):it.IsAny(t)?Spo(t,e):it.IsArray(t)?Ipo(t,e):it.IsBigInt(t)?wpo(t,e):it.IsBoolean(t)?Rpo(t,e):it.IsAsyncIterator(t)?xpo(t,e):it.IsConstructor(t)?kpo(t,e):it.IsDate(t)?Ppo(t,e):it.IsFunction(t)?Dpo(t,e):it.IsInteger(t)?Npo(t,e):it.IsIntersect(t)?Mpo(t,e):it.IsIterator(t)?Opo(t,e):it.IsLiteral(t)?Lpo(t,e):it.IsNever(t)?Bpo(t,e):it.IsNull(t)?Upo(t,e):it.IsNumber(t)?Qpo(t,e):it.IsObject(t)?Wpo(t,e):it.IsRecord(t)?Ypo(t,e):it.IsString(t)?Jpo(t,e):it.IsSymbol(t)?Zpo(t,e):it.IsTuple(t)?rho(t,e):it.IsPromise(t)?zpo(t,e):it.IsUint8Array(t)?nho(t,e):it.IsUndefined(t)?iho(t,e):it.IsUnion(t)?oho(t,e):it.IsUnknown(t)?sho(t,e):it.IsVoid(t)?cho(t,e):qoe(`Unknown left type operand '${t[Tt]}'`)}a(Jc,"Visit");function vU(t,e){return Jc(t,e)}a(vU,"ExtendsCheck");p();p();p();function lho(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=joe(t[c],e,r,n,Bu(o));return s}a(lho,"FromProperties");function uho(t,e,r,n,o){return lho(t.properties,e,r,n,o)}a(uho,"FromMappedResult");function tVr(t,e,r,n,o){let s=uho(t,e,r,n,o);return Ua(s)}a(tVr,"ExtendsFromMappedResult");function dho(t,e,r,n){let o=vU(t,e);return o===Rt.Union?tc([r,n]):o===Rt.True?r:n}a(dho,"ExtendsResolve");function joe(t,e,r,n,o){return Uu(t)?tVr(t,e,r,n,o):U1(t)?wt(rVr(t,e,r,n,o)):wt(dho(t,e,r,n),o)}a(joe,"Extends");function fho(t,e,r,n,o){return{[t]:joe(ca(t),e,r,n,Bu(o))}}a(fho,"FromPropertyKey");function pho(t,e,r,n,o){return t.reduce((s,c)=>({...s,...fho(c,e,r,n,o)}),{})}a(pho,"FromPropertyKeys");function hho(t,e,r,n,o){return pho(t.keys,e,r,n,o)}a(hho,"FromMappedKey");function rVr(t,e,r,n,o){let s=hho(t,e,r,n,o);return Ua(s)}a(rVr,"ExtendsFromMappedKey");p();function mho(t){return t.allOf.every(e=>gB(e))}a(mho,"Intersect");function gho(t){return t.anyOf.some(e=>gB(e))}a(gho,"Union");function Aho(t){return!gB(t.not)}a(Aho,"Not");function gB(t){return t[Tt]==="Intersect"?mho(t):t[Tt]==="Union"?gho(t):t[Tt]==="Not"?Aho(t):t[Tt]==="Undefined"}a(gB,"ExtendsUndefinedCheck");p();function nVr(t,e){return Hoe(OW(t),e)}a(nVr,"ExcludeFromTemplateLiteral");function yho(t,e){let r=t.filter(n=>vU(n,e)===Rt.False);return r.length===1?r[0]:tc(r)}a(yho,"ExcludeRest");function Hoe(t,e,r={}){return Q1(t)?wt(nVr(t,e),r):Uu(t)?wt(iVr(t,e),r):wt(Sa(t)?yho(t.anyOf,e):vU(t,e)!==Rt.False?Xo():t,r)}a(Hoe,"Exclude");function Eho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Hoe(t[n],e);return r}a(Eho,"FromProperties");function _ho(t,e){return Eho(t.properties,e)}a(_ho,"FromMappedResult");function iVr(t,e){let r=_ho(t,e);return Ua(r)}a(iVr,"ExcludeFromMappedResult");p();p();p();function oVr(t,e){return Goe(OW(t),e)}a(oVr,"ExtractFromTemplateLiteral");function vho(t,e){let r=t.filter(n=>vU(n,e)!==Rt.False);return r.length===1?r[0]:tc(r)}a(vho,"ExtractRest");function Goe(t,e,r){return Q1(t)?wt(oVr(t,e),r):Uu(t)?wt(sVr(t,e),r):wt(Sa(t)?vho(t.anyOf,e):vU(t,e)!==Rt.False?t:Xo(),r)}a(Goe,"Extract");function Cho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Goe(t[n],e);return r}a(Cho,"FromProperties");function bho(t,e){return Cho(t.properties,e)}a(bho,"FromMappedResult");function sVr(t,e){let r=bho(t,e);return Ua(r)}a(sVr,"ExtractFromMappedResult");p();function aVr(t,e){return Lk(t)?wt(t.returns,e):Xo(e)}a(aVr,"InstanceType");p();p();function fUe(t){return aC(By(t))}a(fUe,"ReadonlyOptional");p();function LW(t,e,r){return wt({[Tt]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(LW,"RecordCreateFromPattern");function GPt(t,e,r){let n={};for(let o of t)n[o]=e;return rc(n,{...r,[GI]:"Record"})}a(GPt,"RecordCreateFromKeys");function Sho(t,e,r){return Z9e(t)?GPt(sC(t),e,r):LW(t.pattern,e,r)}a(Sho,"FromTemplateLiteralKey");function Tho(t,e,r){return GPt(sC(tc(t)),e,r)}a(Tho,"FromUnionKey");function Iho(t,e,r){return GPt([t.toString()],e,r)}a(Iho,"FromLiteralKey");function xho(t,e,r){return LW(t.source,e,r)}a(xho,"FromRegExpKey");function who(t,e,r){let n=Bp(t.pattern)?yU:t.pattern;return LW(n,e,r)}a(who,"FromStringKey");function Rho(t,e,r){return LW(yU,e,r)}a(Rho,"FromAnyKey");function kho(t,e,r){return LW(g$r,e,r)}a(kho,"FromNeverKey");function Pho(t,e,r){return rc({true:e,false:e},r)}a(Pho,"FromBooleanKey");function Dho(t,e,r){return LW(AU,e,r)}a(Dho,"FromIntegerKey");function Nho(t,e,r){return LW(AU,e,r)}a(Nho,"FromNumberKey");function pUe(t,e,r={}){return Sa(t)?Tho(t.anyOf,e,r):Q1(t)?Sho(t,e,r):F1(t)?Iho(t.const,e,r):uB(t)?Pho(t,e,r):Fk(t)?Dho(t,e,r):Uk(t)?Nho(t,e,r):bPt(t)?xho(t,e,r):dB(t)?who(t,e,r):vPt(t)?Rho(t,e,r):mU(t)?kho(t,e,r):Xo(r)}a(pUe,"Record");function hUe(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(hUe,"RecordPattern");function cVr(t){let e=hUe(t);return e===yU?C_():e===AU?$I():C_({pattern:e})}a(cVr,"RecordKey");function mUe(t){return t.patternProperties[hUe(t)]}a(mUe,"RecordValue");function Mho(t,e){return e.parameters=WCe(t,e.parameters),e.returns=jk(t,e.returns),e}a(Mho,"FromConstructor");function Oho(t,e){return e.parameters=WCe(t,e.parameters),e.returns=jk(t,e.returns),e}a(Oho,"FromFunction");function Lho(t,e){return e.allOf=WCe(t,e.allOf),e}a(Lho,"FromIntersect");function Bho(t,e){return e.anyOf=WCe(t,e.anyOf),e}a(Bho,"FromUnion");function Fho(t,e){return Bp(e.items)||(e.items=WCe(t,e.items)),e}a(Fho,"FromTuple");function Uho(t,e){return e.items=jk(t,e.items),e}a(Uho,"FromArray");function Qho(t,e){return e.items=jk(t,e.items),e}a(Qho,"FromAsyncIterator");function qho(t,e){return e.items=jk(t,e.items),e}a(qho,"FromIterator");function jho(t,e){return e.item=jk(t,e.item),e}a(jho,"FromPromise");function Hho(t,e){let r=Who(t,e.properties);return{...e,...rc(r)}}a(Hho,"FromObject");function Gho(t,e){let r=jk(t,cVr(e)),n=jk(t,mUe(e)),o=pUe(r,n);return{...e,...o}}a(Gho,"FromRecord");function $ho(t,e){return e.index in t?t[e.index]:qk()}a($ho,"FromArgument");function Vho(t,e){let r=woe(e),n=oC(e),o=jk(t,e);return r&&n?fUe(o):r&&!n?aC(o):!r&&n?By(o):o}a(Vho,"FromProperty");function Who(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:Vho(t,e[n])}),{})}a(Who,"FromProperties");function WCe(t,e){return e.map(r=>jk(t,r))}a(WCe,"FromTypes");function jk(t,e){return Lk(e)?Mho(t,e):Bk(e)?Oho(t,e):af(e)?Lho(t,e):Sa(e)?Bho(t,e):q1(e)?Fho(t,e):Mk(e)?Uho(t,e):RW(e)?Qho(t,e):PW(e)?qho(t,e):DW(e)?jho(t,e):Fp(e)?Hho(t,e):NW(e)?Gho(t,e):CPt(e)?$ho(t,e):e}a(jk,"FromType");function lVr(t,e){return jk(e,Ioe(t))}a(lVr,"Instantiate");p();function uVr(t){return wt({[Tt]:"Integer",type:"integer"},t)}a(uVr,"Integer");p();p();p();function zho(t,e,r){return{[t]:Hk(ca(t),e,Bu(r))}}a(zho,"MappedIntrinsicPropertyKey");function Yho(t,e,r){return t.reduce((o,s)=>({...o,...zho(s,e,r)}),{})}a(Yho,"MappedIntrinsicPropertyKeys");function Kho(t,e,r){return Yho(t.keys,e,r)}a(Kho,"MappedIntrinsicProperties");function dVr(t,e,r){let n=Kho(t,e,r);return Ua(n)}a(dVr,"IntrinsicFromMappedKey");function Jho(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(Jho,"ApplyUncapitalize");function Zho(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(Zho,"ApplyCapitalize");function Xho(t){return t.toUpperCase()}a(Xho,"ApplyUppercase");function emo(t){return t.toLowerCase()}a(emo,"ApplyLowercase");function tmo(t,e,r){let n=Ooe(t.pattern);if(!MW(n))return{...t,pattern:fVr(t.pattern,e)};let c=[...HCe(n)].map(d=>ca(d)),l=pVr(c,e),u=tc(l);return eUe([u],r)}a(tmo,"FromTemplateLiteral");function fVr(t,e){return typeof t=="string"?e==="Uncapitalize"?Jho(t):e==="Capitalize"?Zho(t):e==="Uppercase"?Xho(t):e==="Lowercase"?emo(t):t:t.toString()}a(fVr,"FromLiteralValue");function pVr(t,e){return t.map(r=>Hk(r,e))}a(pVr,"FromRest");function Hk(t,e,r={}){return U1(t)?dVr(t,e,r):Q1(t)?tmo(t,e,r):Sa(t)?tc(pVr(t.anyOf,e),r):F1(t)?ca(fVr(t.const,e),r):wt(t,r)}a(Hk,"Intrinsic");function hVr(t,e={}){return Hk(t,"Capitalize",e)}a(hVr,"Capitalize");p();function mVr(t,e={}){return Hk(t,"Lowercase",e)}a(mVr,"Lowercase");p();function gVr(t,e={}){return Hk(t,"Uncapitalize",e)}a(gVr,"Uncapitalize");p();function AVr(t,e={}){return Hk(t,"Uppercase",e)}a(AVr,"Uppercase");p();p();p();p();p();function rmo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=CU(t[o],e,Bu(r));return n}a(rmo,"FromProperties");function nmo(t,e,r){return rmo(t.properties,e,r)}a(nmo,"FromMappedResult");function yVr(t,e,r){let n=nmo(t,e,r);return Ua(n)}a(yVr,"OmitFromMappedResult");function imo(t,e){return t.map(r=>$Pt(r,e))}a(imo,"FromIntersect");function omo(t,e){return t.map(r=>$Pt(r,e))}a(omo,"FromUnion");function smo(t,e){let{[e]:r,...n}=t;return n}a(smo,"FromProperty");function amo(t,e){return e.reduce((r,n)=>smo(r,n),t)}a(amo,"FromProperties");function cmo(t,e,r){let n=cf(t,[wd,"$id","required","properties"]),o=amo(r,e);return rc(o,n)}a(cmo,"FromObject");function lmo(t){let e=t.reduce((r,n)=>Y9e(n)?[...r,ca(n)]:r,[]);return tc(e)}a(lmo,"UnionFromPropertyKeys");function $Pt(t,e){return af(t)?Fy(imo(t.allOf,e)):Sa(t)?tc(omo(t.anyOf,e)):Fp(t)?cmo(t,e,t.properties):rc({})}a($Pt,"OmitResolve");function CU(t,e,r){let n=Lp(e)?lmo(e):e,o=Rd(e)?sC(e):e,s=jf(t),c=jf(e);return Uu(t)?yVr(t,o,r):U1(e)?EVr(t,e,r):s&&c?au("Omit",[t,n],r):!s&&c?au("Omit",[t,n],r):s&&!c?au("Omit",[t,n],r):wt({...$Pt(t,o),...r})}a(CU,"Omit");function umo(t,e,r){return{[e]:CU(t,[e],Bu(r))}}a(umo,"FromPropertyKey");function dmo(t,e,r){return e.reduce((n,o)=>({...n,...umo(t,o,r)}),{})}a(dmo,"FromPropertyKeys");function fmo(t,e,r){return dmo(t,e.keys,r)}a(fmo,"FromMappedKey");function EVr(t,e,r){let n=fmo(t,e,r);return Ua(n)}a(EVr,"OmitFromMappedKey");p();p();p();function pmo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=bU(t[o],e,Bu(r));return n}a(pmo,"FromProperties");function hmo(t,e,r){return pmo(t.properties,e,r)}a(hmo,"FromMappedResult");function _Vr(t,e,r){let n=hmo(t,e,r);return Ua(n)}a(_Vr,"PickFromMappedResult");function mmo(t,e){return t.map(r=>VPt(r,e))}a(mmo,"FromIntersect");function gmo(t,e){return t.map(r=>VPt(r,e))}a(gmo,"FromUnion");function Amo(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(Amo,"FromProperties");function ymo(t,e,r){let n=cf(t,[wd,"$id","required","properties"]),o=Amo(r,e);return rc(o,n)}a(ymo,"FromObject");function Emo(t){let e=t.reduce((r,n)=>Y9e(n)?[...r,ca(n)]:r,[]);return tc(e)}a(Emo,"UnionFromPropertyKeys");function VPt(t,e){return af(t)?Fy(mmo(t.allOf,e)):Sa(t)?tc(gmo(t.anyOf,e)):Fp(t)?ymo(t,e,t.properties):rc({})}a(VPt,"PickResolve");function bU(t,e,r){let n=Lp(e)?Emo(e):e,o=Rd(e)?sC(e):e,s=jf(t),c=jf(e);return Uu(t)?_Vr(t,o,r):U1(e)?vVr(t,e,r):s&&c?au("Pick",[t,n],r):!s&&c?au("Pick",[t,n],r):s&&!c?au("Pick",[t,n],r):wt({...VPt(t,o),...r})}a(bU,"Pick");function _mo(t,e,r){return{[e]:bU(t,[e],Bu(r))}}a(_mo,"FromPropertyKey");function vmo(t,e,r){return e.reduce((n,o)=>({...n,..._mo(t,o,r)}),{})}a(vmo,"FromPropertyKeys");function Cmo(t,e,r){return vmo(t,e.keys,r)}a(Cmo,"FromMappedKey");function vVr(t,e,r){let n=Cmo(t,e,r);return Ua(n)}a(vVr,"PickFromMappedKey");p();p();function bmo(t,e){return au("Partial",[au(t,e)])}a(bmo,"FromComputed");function Smo(t){return au("Partial",[zI(t)])}a(Smo,"FromRef");function Tmo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=By(t[r]);return e}a(Tmo,"FromProperties");function Imo(t,e){let r=cf(t,[wd,"$id","required","properties"]),n=Tmo(e);return rc(n,r)}a(Imo,"FromObject");function CVr(t){return t.map(e=>bVr(e))}a(CVr,"FromRest");function bVr(t){return Ok(t)?bmo(t.target,t.parameters):jf(t)?Smo(t.$ref):af(t)?Fy(CVr(t.allOf)):Sa(t)?tc(CVr(t.anyOf)):Fp(t)?Imo(t,t.properties):kW(t)||uB(t)||Fk(t)||F1(t)||LCe(t)||Uk(t)||dB(t)||BCe(t)||fB(t)?t:rc({})}a(bVr,"PartialResolve");function $oe(t,e){return Uu(t)?SVr(t,e):wt({...bVr(t),...e})}a($oe,"Partial");function xmo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=$oe(t[n],Bu(e));return r}a(xmo,"FromProperties");function wmo(t,e){return xmo(t.properties,e)}a(wmo,"FromMappedResult");function SVr(t,e){let r=wmo(t,e);return Ua(r)}a(SVr,"PartialFromMappedResult");p();p();function Rmo(t,e){return au("Required",[au(t,e)])}a(Rmo,"FromComputed");function kmo(t){return au("Required",[zI(t)])}a(kmo,"FromRef");function Pmo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=cf(t[r],[hA]);return e}a(Pmo,"FromProperties");function Dmo(t,e){let r=cf(t,[wd,"$id","required","properties"]),n=Pmo(e);return rc(n,r)}a(Dmo,"FromObject");function TVr(t){return t.map(e=>IVr(e))}a(TVr,"FromRest");function IVr(t){return Ok(t)?Rmo(t.target,t.parameters):jf(t)?kmo(t.$ref):af(t)?Fy(TVr(t.allOf)):Sa(t)?tc(TVr(t.anyOf)):Fp(t)?Dmo(t,t.properties):kW(t)||uB(t)||Fk(t)||F1(t)||LCe(t)||Uk(t)||dB(t)||BCe(t)||fB(t)?t:rc({})}a(IVr,"RequiredResolve");function Voe(t,e){return Uu(t)?xVr(t,e):wt({...IVr(t),...e})}a(Voe,"Required");function Nmo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Voe(t[n],e);return r}a(Nmo,"FromProperties");function Mmo(t,e){return Nmo(t.properties,e)}a(Mmo,"FromMappedResult");function xVr(t,e){let r=Mmo(t,e);return Ua(r)}a(xVr,"RequiredFromMappedResult");function Omo(t,e){return e.map(r=>jf(r)?WPt(t,r.$ref):j1(t,r))}a(Omo,"DereferenceParameters");function WPt(t,e){return e in t?jf(t[e])?WPt(t,t[e].$ref):j1(t,t[e]):Xo()}a(WPt,"Dereference");function Lmo(t){return Uoe(t[0])}a(Lmo,"FromAwaited");function Bmo(t){return _U(t[0],t[1])}a(Bmo,"FromIndex");function Fmo(t){return Qoe(t[0])}a(Fmo,"FromKeyOf");function Umo(t){return $oe(t[0])}a(Umo,"FromPartial");function Qmo(t){return CU(t[0],t[1])}a(Qmo,"FromOmit");function qmo(t){return bU(t[0],t[1])}a(qmo,"FromPick");function jmo(t){return Voe(t[0])}a(jmo,"FromRequired");function Hmo(t,e,r){let n=Omo(t,r);return e==="Awaited"?Lmo(n):e==="Index"?Bmo(n):e==="KeyOf"?Fmo(n):e==="Partial"?Umo(n):e==="Omit"?Qmo(n):e==="Pick"?qmo(n):e==="Required"?jmo(n):Xo()}a(Hmo,"FromComputed");function Gmo(t,e){return Poe(j1(t,e))}a(Gmo,"FromArray");function $mo(t,e){return Doe(j1(t,e))}a($mo,"FromAsyncIterator");function Vmo(t,e,r){return Noe(zCe(t,e),j1(t,r))}a(Vmo,"FromConstructor");function Wmo(t,e,r){return rM(zCe(t,e),j1(t,r))}a(Wmo,"FromFunction");function zmo(t,e){return Fy(zCe(t,e))}a(zmo,"FromIntersect");function Ymo(t,e){return Foe(j1(t,e))}a(Ymo,"FromIterator");function Kmo(t,e){return rc(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:j1(t,e[n])}),{}))}a(Kmo,"FromObject");function Jmo(t,e){let[r,n]=[j1(t,mUe(e)),hUe(e)],o=Ioe(e);return o.patternProperties[n]=r,o}a(Jmo,"FromRecord");function Zmo(t,e){return jf(e)?{...WPt(t,e.$ref),[wd]:e[wd]}:e}a(Zmo,"FromTransform");function Xmo(t,e){return VI(zCe(t,e))}a(Xmo,"FromTuple");function e0o(t,e){return tc(zCe(t,e))}a(e0o,"FromUnion");function zCe(t,e){return e.map(r=>j1(t,r))}a(zCe,"FromTypes");function j1(t,e){return oC(e)?wt(j1(t,cf(e,[hA])),e):woe(e)?wt(j1(t,cf(e,[Nk])),e):ec(e)?wt(Zmo(t,e),e):Mk(e)?wt(Gmo(t,e.items),e):RW(e)?wt($mo(t,e.items),e):Ok(e)?wt(Hmo(t,e.target,e.parameters)):Lk(e)?wt(Vmo(t,e.parameters,e.returns),e):Bk(e)?wt(Wmo(t,e.parameters,e.returns),e):af(e)?wt(zmo(t,e.allOf),e):PW(e)?wt(Ymo(t,e.items),e):Fp(e)?wt(Kmo(t,e.properties),e):NW(e)?wt(Jmo(t,e)):q1(e)?wt(Xmo(t,e.items||[]),e):Sa(e)?wt(e0o(t,e.anyOf),e):e}a(j1,"FromType");function t0o(t,e){return e in t?j1(t,t[e]):Xo()}a(t0o,"ComputeType");function wVr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:t0o(t,r)}),{})}a(wVr,"ComputeModuleProperties");var zPt=class{static{a(this,"TModule")}constructor(e){let r=wVr(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:wt(this.$defs[e],r)};return wt({[Tt]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};function RVr(t){return new zPt(t)}a(RVr,"Module");p();function kVr(t,e){return wt({[Tt]:"Not",not:t},e)}a(kVr,"Not");p();function PVr(t,e){return Bk(t)?VI(t.parameters,e):Xo()}a(PVr,"Parameters");p();var r0o=0;function DVr(t,e={}){Bp(e.$id)&&(e.$id=`T${r0o++}`);let r=Ioe(t({[Tt]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,wt({[GI]:"Recursive",...r},e)}a(DVr,"Recursive");p();function NVr(t,e){let r=Ql(t)?new globalThis.RegExp(t):t;return wt({[Tt]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(NVr,"RegExp");p();function n0o(t){return af(t)?t.allOf:Sa(t)?t.anyOf:q1(t)?t.items??[]:[]}a(n0o,"RestResolve");function MVr(t){return n0o(t)}a(MVr,"Rest");p();function OVr(t,e){return Bk(t)?wt(t.returns,e):Xo(e)}a(OVr,"ReturnType");p();var YPt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new KPt(this.schema,e)}},KPt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[wd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[wd].Decode(c)),"Decode")};return{...r,[wd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[wd]:n}}Encode(e){return ec(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function LVr(t){return new YPt(t)}a(LVr,"Transform");p();function BVr(t={}){return wt({[Tt]:t[Tt]??"Unsafe"},t)}a(BVr,"Unsafe");p();function FVr(t){return wt({[Tt]:"Void",type:"void"},t)}a(FVr,"Void");p();var JPt={};ki(JPt,{Any:()=>EU,Argument:()=>v$r,Array:()=>Poe,AsyncIterator:()=>Doe,Awaited:()=>Uoe,BigInt:()=>Boe,Boolean:()=>X9e,Capitalize:()=>hVr,Composite:()=>Q$r,Const:()=>q$r,Constructor:()=>Noe,ConstructorParameters:()=>j$r,Date:()=>iUe,Enum:()=>H$r,Exclude:()=>Hoe,Extends:()=>joe,Extract:()=>Goe,Function:()=>rM,Index:()=>_U,InstanceType:()=>aVr,Instantiate:()=>lVr,Integer:()=>uVr,Intersect:()=>Fy,Iterator:()=>Foe,KeyOf:()=>Qoe,Literal:()=>ca,Lowercase:()=>mVr,Mapped:()=>M$r,Module:()=>RVr,Never:()=>Xo,Not:()=>kVr,Null:()=>oUe,Number:()=>$I,Object:()=>rc,Omit:()=>CU,Optional:()=>By,Parameters:()=>PVr,Partial:()=>$oe,Pick:()=>bU,Promise:()=>rUe,Readonly:()=>aC,ReadonlyOptional:()=>fUe,Record:()=>pUe,Recursive:()=>DVr,Ref:()=>zI,RegExp:()=>NVr,Required:()=>Voe,Rest:()=>MVr,ReturnType:()=>OVr,String:()=>C_,Symbol:()=>sUe,TemplateLiteral:()=>eUe,Transform:()=>LVr,Tuple:()=>VI,Uint8Array:()=>cUe,Uncapitalize:()=>gVr,Undefined:()=>aUe,Union:()=>tc,Unknown:()=>qk,Unsafe:()=>BVr,Uppercase:()=>AVr,Void:()=>FVr});p();var S=JPt;p();p();function i0o(t){switch(t.errorType){case St.ArrayContains:return"Expected array to contain at least one matching value";case St.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case St.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case St.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case St.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case St.ArrayUniqueItems:return"Expected array elements to be unique";case St.Array:return"Expected array";case St.AsyncIterator:return"Expected AsyncIterator";case St.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case St.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case St.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case St.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case St.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case St.BigInt:return"Expected bigint";case St.Boolean:return"Expected boolean";case St.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case St.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case St.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case St.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case St.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case St.Date:return"Expected Date";case St.Function:return"Expected function";case St.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case St.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case St.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case St.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case St.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case St.Integer:return"Expected integer";case St.IntersectUnevaluatedProperties:return"Unexpected property";case St.Intersect:return"Expected all values to match";case St.Iterator:return"Expected Iterator";case St.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case St.Never:return"Never";case St.Not:return"Value should not match";case St.Null:return"Expected null";case St.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case St.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case St.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case St.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case St.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case St.Number:return"Expected number";case St.Object:return"Expected object";case St.ObjectAdditionalProperties:return"Unexpected property";case St.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case St.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case St.ObjectRequiredProperty:return"Expected required property";case St.Promise:return"Expected Promise";case St.RegExp:return"Expected string to match regular expression";case St.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case St.StringFormat:return`Expected string to match '${t.schema.format}' format`;case St.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case St.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case St.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case St.String:return"Expected string";case St.Symbol:return"Expected symbol";case St.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case St.Tuple:return"Expected tuple";case St.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case St.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case St.Uint8Array:return"Expected Uint8Array";case St.Undefined:return"Expected undefined";case St.Union:return"Expected union value";case St.Void:return"Expected void";case St.Kind:return`Expected kind '${t.schema[Tt]}'`;default:return"Unknown error type"}}a(i0o,"DefaultErrorFunction");var o0o=i0o;function UVr(){return o0o}a(UVr,"GetErrorFunction");p();var ZPt=class extends qi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function s0o(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new ZPt(t);return Ta(r,e)}a(s0o,"Resolve");function Y0(t,e){return!ba(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Y0,"Pushref");function Ta(t,e){return t[Tt]==="This"||t[Tt]==="Ref"?s0o(t,e):t}a(Ta,"Deref");p();var XPt=class extends qi{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 Woe=BigInt("14695981039346656037"),[a0o,c0o]=[BigInt("1099511628211"),BigInt("18446744073709551616")],l0o=Array.from({length:256}).map((t,e)=>BigInt(e)),QVr=new Float64Array(1),qVr=new DataView(QVr.buffer),jVr=new Uint8Array(QVr.buffer);function*u0o(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(u0o,"NumberToBytes");function d0o(t){Qy(H1.Array);for(let e of t)zoe(e)}a(d0o,"ArrayType");function f0o(t){Qy(H1.Boolean),Qy(t?1:0)}a(f0o,"BooleanType");function p0o(t){Qy(H1.BigInt),qVr.setBigInt64(0,t);for(let e of jVr)Qy(e)}a(p0o,"BigIntType");function h0o(t){Qy(H1.Date),zoe(t.getTime())}a(h0o,"DateType");function m0o(t){Qy(H1.Null)}a(m0o,"NullType");function g0o(t){Qy(H1.Number),qVr.setFloat64(0,t);for(let e of jVr)Qy(e)}a(g0o,"NumberType");function A0o(t){Qy(H1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())zoe(e),zoe(t[e])}a(A0o,"ObjectType");function y0o(t){Qy(H1.String);for(let e=0;e=t.minItems)||zs(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!K0(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=SU(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(zs(t.contains)||ai(t.minContains)||ai(t.maxContains)))return!0;let n=zs(t.contains)?t.contains:Xo(),o=r.reduce((s,c)=>K0(n,e,c)?s+1:s,0);return!(o===0||ai(t.minContains)&&ot.maxContains)}a(T0o,"FromArray");function I0o(t,e,r){return $9e(r)}a(I0o,"FromAsyncIterator");function x0o(t,e,r){return!(!pA(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(x0o,"FromBigInt");function w0o(t,e,r){return tM(r)}a(w0o,"FromBoolean");function R0o(t,e,r){return K0(t.returns,e,r.prototype)}a(R0o,"FromConstructor");function k0o(t,e,r){return!(!__(r)||zs(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||zs(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||zs(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||zs(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(k0o,"FromDate");function P0o(t,e,r){return hU(r)}a(P0o,"FromFunction");function D0o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return K0(o,[...e,...n],r)}a(D0o,"FromImport");function N0o(t,e,r){return!(!z9e(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.multipleOf)&&r%t.multipleOf!==0)}a(N0o,"FromInteger");function M0o(t,e,r){let n=t.allOf.every(o=>K0(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(mB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(Rd(t.unevaluatedProperties)){let o=new RegExp(mB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||K0(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(M0o,"FromIntersect");function O0o(t,e,r){return V9e(r)}a(O0o,"FromIterator");function L0o(t,e,r){return r===t.const}a(L0o,"FromLiteral");function B0o(t,e,r){return!1}a(B0o,"FromNever");function F0o(t,e,r){return!K0(t.not,e,r)}a(F0o,"FromNot");function U0o(t,e,r){return cB(r)}a(U0o,"FromNull");function Q0o(t,e,r){return!(!su.IsNumberLike(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.multipleOf)&&r%t.multipleOf!==0)}a(Q0o,"FromNumber");function q0o(t,e,r){if(!su.IsObjectLike(r)||zs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||zs(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(!K0(s,e,r[o])||(gB(s)||C0o(s))&&!(o in r))return!1}else if(su.IsExactOptionalProperty(r,o)&&!K0(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)||K0(t.additionalProperties,e,r[s])):!0}a(q0o,"FromObject");function j0o(t,e,r){return W9e(r)}a(j0o,"FromPromise");function H0o(t,e,r){if(!su.IsRecordLike(r)||zs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||zs(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)?K0(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:K0(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(H0o,"FromRecord");function G0o(t,e,r){return K0(Ta(t,e),e,r)}a(G0o,"FromRef");function $0o(t,e,r){let n=new RegExp(t.source,t.flags);return zs(t.minLength)&&!(r.length>=t.minLength)||zs(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a($0o,"FromRegExp");function V0o(t,e,r){return!ba(r)||zs(t.minLength)&&!(r.length>=t.minLength)||zs(t.maxLength)&&!(r.length<=t.maxLength)||zs(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:zs(t.format)?Qk.Has(t.format)?Qk.Get(t.format)(r):!1:!0}a(V0o,"FromString");function W0o(t,e,r){return lB(r)}a(W0o,"FromSymbol");function z0o(t,e,r){return ba(r)&&new RegExp(t.pattern).test(r)}a(z0o,"FromTemplateLiteral");function Y0o(t,e,r){return K0(Ta(t,e),e,r)}a(Y0o,"FromThis");function K0o(t,e,r){if(!Pi(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nK0(n,e,r))}a(Z0o,"FromUnion");function X0o(t,e,r){return!(!xoe(r)||zs(t.maxByteLength)&&!(r.length<=t.maxByteLength)||zs(t.minByteLength)&&!(r.length>=t.minByteLength))}a(X0o,"FromUint8Array");function ego(t,e,r){return!0}a(ego,"FromUnknown");function tgo(t,e,r){return su.IsVoidLike(r)}a(tgo,"FromVoid");function rgo(t,e,r){return v_.Has(t[Tt])?v_.Get(t[Tt])(t,r):!1}a(rgo,"FromKind");function K0(t,e,r){let n=zs(t.$id)?Y0(t,e):e,o=t;switch(o[Tt]){case"Any":return b0o(o,n,r);case"Argument":return S0o(o,n,r);case"Array":return T0o(o,n,r);case"AsyncIterator":return I0o(o,n,r);case"BigInt":return x0o(o,n,r);case"Boolean":return w0o(o,n,r);case"Constructor":return R0o(o,n,r);case"Date":return k0o(o,n,r);case"Function":return P0o(o,n,r);case"Import":return D0o(o,n,r);case"Integer":return N0o(o,n,r);case"Intersect":return M0o(o,n,r);case"Iterator":return O0o(o,n,r);case"Literal":return L0o(o,n,r);case"Never":return B0o(o,n,r);case"Not":return F0o(o,n,r);case"Null":return U0o(o,n,r);case"Number":return Q0o(o,n,r);case"Object":return q0o(o,n,r);case"Promise":return j0o(o,n,r);case"Record":return H0o(o,n,r);case"Ref":return G0o(o,n,r);case"RegExp":return $0o(o,n,r);case"String":return V0o(o,n,r);case"Symbol":return W0o(o,n,r);case"TemplateLiteral":return z0o(o,n,r);case"This":return Y0o(o,n,r);case"Tuple":return K0o(o,n,r);case"Undefined":return J0o(o,n,r);case"Union":return Z0o(o,n,r);case"Uint8Array":return X0o(o,n,r);case"Unknown":return ego(o,n,r);case"Void":return tgo(o,n,r);default:if(!v_.Has(o[Tt]))throw new e2t(o);return rgo(o,n,r)}}a(K0,"Visit");function es(...t){return t.length===3?K0(t[0],t[1],t[2]):K0(t[0],[],t[1])}a(es,"Check");var St;(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"})(St||(St={}));var t2t=class extends qi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function AB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(AB,"EscapeKey");function Ys(t){return t!==void 0}a(Ys,"IsDefined");var TU=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 sn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:UVr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(sn,"Create");function*ngo(t,e,r,n){}a(ngo,"FromAny");function*igo(t,e,r,n){}a(igo,"FromArgument");function*ogo(t,e,r,n){if(!Pi(n))return yield sn(St.Array,t,r,n);Ys(t.minItems)&&!(n.length>=t.minItems)&&(yield sn(St.ArrayMinItems,t,r,n)),Ys(t.maxItems)&&!(n.length<=t.maxItems)&&(yield sn(St.ArrayMaxItems,t,r,n));for(let c=0;cJ0(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield sn(St.ArrayContains,t,r,n)),ai(t.minContains)&&st.maxContains&&(yield sn(St.ArrayMaxContains,t,r,n))}a(ogo,"FromArray");function*sgo(t,e,r,n){$9e(n)||(yield sn(St.AsyncIterator,t,r,n))}a(sgo,"FromAsyncIterator");function*ago(t,e,r,n){if(!pA(n))return yield sn(St.BigInt,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.BigIntExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.BigIntMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.BigIntMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield sn(St.BigIntMultipleOf,t,r,n))}a(ago,"FromBigInt");function*cgo(t,e,r,n){tM(n)||(yield sn(St.Boolean,t,r,n))}a(cgo,"FromBoolean");function*lgo(t,e,r,n){yield*J0(t.returns,e,r,n.prototype)}a(lgo,"FromConstructor");function*ugo(t,e,r,n){if(!__(n))return yield sn(St.Date,t,r,n);Ys(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield sn(St.DateExclusiveMinimumTimestamp,t,r,n)),Ys(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield sn(St.DateMaximumTimestamp,t,r,n)),Ys(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield sn(St.DateMinimumTimestamp,t,r,n)),Ys(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield sn(St.DateMultipleOfTimestamp,t,r,n))}a(ugo,"FromDate");function*dgo(t,e,r,n){hU(n)||(yield sn(St.Function,t,r,n))}a(dgo,"FromFunction");function*fgo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*J0(s,[...e,...o],r,n)}a(fgo,"FromImport");function*pgo(t,e,r,n){if(!z9e(n))return yield sn(St.Integer,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.IntegerExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.IntegerMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.IntegerMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(St.IntegerMultipleOf,t,r,n))}a(pgo,"FromInteger");function*hgo(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of J0(s,e,r,n))o=!0,yield c;if(o)return yield sn(St.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(mB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield sn(St.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(mB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=J0(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(hgo,"FromIntersect");function*mgo(t,e,r,n){V9e(n)||(yield sn(St.Iterator,t,r,n))}a(mgo,"FromIterator");function*ggo(t,e,r,n){n!==t.const&&(yield sn(St.Literal,t,r,n))}a(ggo,"FromLiteral");function*Ago(t,e,r,n){yield sn(St.Never,t,r,n)}a(Ago,"FromNever");function*ygo(t,e,r,n){J0(t.not,e,r,n).next().done===!0&&(yield sn(St.Not,t,r,n))}a(ygo,"FromNot");function*Ego(t,e,r,n){cB(n)||(yield sn(St.Null,t,r,n))}a(Ego,"FromNull");function*_go(t,e,r,n){if(!su.IsNumberLike(n))return yield sn(St.Number,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.NumberExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.NumberMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.NumberMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(St.NumberMultipleOf,t,r,n))}a(_go,"FromNumber");function*vgo(t,e,r,n){if(!su.IsObjectLike(n))return yield sn(St.Object,t,r,n);Ys(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(St.ObjectMinProperties,t,r,n)),Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(St.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 sn(St.ObjectRequiredProperty,t.properties[l],`${r}/${AB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield sn(St.ObjectAdditionalProperties,t,`${r}/${AB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*J0(t.additionalProperties,e,`${r}/${AB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*J0(u,e,`${r}/${AB(l)}`,n[l]),gB(t)&&!(l in n)&&(yield sn(St.ObjectRequiredProperty,u,`${r}/${AB(l)}`,void 0))):su.IsExactOptionalProperty(n,l)&&(yield*J0(u,e,`${r}/${AB(l)}`,n[l]))}}a(vgo,"FromObject");function*Cgo(t,e,r,n){W9e(n)||(yield sn(St.Promise,t,r,n))}a(Cgo,"FromPromise");function*bgo(t,e,r,n){if(!su.IsRecordLike(n))return yield sn(St.Object,t,r,n);Ys(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(St.ObjectMinProperties,t,r,n)),Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(St.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*J0(s,e,`${r}/${AB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*J0(t.additionalProperties,e,`${r}/${AB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield sn(St.ObjectAdditionalProperties,t,`${r}/${AB(l)}`,u)}}a(bgo,"FromRecord");function*Sgo(t,e,r,n){yield*J0(Ta(t,e),e,r,n)}a(Sgo,"FromRef");function*Tgo(t,e,r,n){if(!ba(n))return yield sn(St.String,t,r,n);if(Ys(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(St.StringMinLength,t,r,n)),Ys(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(St.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield sn(St.RegExp,t,r,n)}a(Tgo,"FromRegExp");function*Igo(t,e,r,n){if(!ba(n))return yield sn(St.String,t,r,n);Ys(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(St.StringMinLength,t,r,n)),Ys(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(St.StringMaxLength,t,r,n)),ba(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield sn(St.StringPattern,t,r,n))),ba(t.format)&&(Qk.Has(t.format)?Qk.Get(t.format)(n)||(yield sn(St.StringFormat,t,r,n)):yield sn(St.StringFormatUnknown,t,r,n))}a(Igo,"FromString");function*xgo(t,e,r,n){lB(n)||(yield sn(St.Symbol,t,r,n))}a(xgo,"FromSymbol");function*wgo(t,e,r,n){if(!ba(n))return yield sn(St.String,t,r,n);new RegExp(t.pattern).test(n)||(yield sn(St.StringPattern,t,r,n))}a(wgo,"FromTemplateLiteral");function*Rgo(t,e,r,n){yield*J0(Ta(t,e),e,r,n)}a(Rgo,"FromThis");function*kgo(t,e,r,n){if(!Pi(n))return yield sn(St.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield sn(St.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield sn(St.TupleLength,t,r,n);if(t.items)for(let o=0;onew TU(J0(s,e,r,n)));yield sn(St.Union,t,r,n,o)}a(Dgo,"FromUnion");function*Ngo(t,e,r,n){if(!xoe(n))return yield sn(St.Uint8Array,t,r,n);Ys(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield sn(St.Uint8ArrayMaxByteLength,t,r,n)),Ys(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield sn(St.Uint8ArrayMinByteLength,t,r,n))}a(Ngo,"FromUint8Array");function*Mgo(t,e,r,n){}a(Mgo,"FromUnknown");function*Ogo(t,e,r,n){su.IsVoidLike(n)||(yield sn(St.Void,t,r,n))}a(Ogo,"FromVoid");function*Lgo(t,e,r,n){v_.Get(t[Tt])(t,n)||(yield sn(St.Kind,t,r,n))}a(Lgo,"FromKind");function*J0(t,e,r,n){let o=Ys(t.$id)?[...e,t]:e,s=t;switch(s[Tt]){case"Any":return yield*ngo(s,o,r,n);case"Argument":return yield*igo(s,o,r,n);case"Array":return yield*ogo(s,o,r,n);case"AsyncIterator":return yield*sgo(s,o,r,n);case"BigInt":return yield*ago(s,o,r,n);case"Boolean":return yield*cgo(s,o,r,n);case"Constructor":return yield*lgo(s,o,r,n);case"Date":return yield*ugo(s,o,r,n);case"Function":return yield*dgo(s,o,r,n);case"Import":return yield*fgo(s,o,r,n);case"Integer":return yield*pgo(s,o,r,n);case"Intersect":return yield*hgo(s,o,r,n);case"Iterator":return yield*mgo(s,o,r,n);case"Literal":return yield*ggo(s,o,r,n);case"Never":return yield*Ago(s,o,r,n);case"Not":return yield*ygo(s,o,r,n);case"Null":return yield*Ego(s,o,r,n);case"Number":return yield*_go(s,o,r,n);case"Object":return yield*vgo(s,o,r,n);case"Promise":return yield*Cgo(s,o,r,n);case"Record":return yield*bgo(s,o,r,n);case"Ref":return yield*Sgo(s,o,r,n);case"RegExp":return yield*Tgo(s,o,r,n);case"String":return yield*Igo(s,o,r,n);case"Symbol":return yield*xgo(s,o,r,n);case"TemplateLiteral":return yield*wgo(s,o,r,n);case"This":return yield*Rgo(s,o,r,n);case"Tuple":return yield*kgo(s,o,r,n);case"Undefined":return yield*Pgo(s,o,r,n);case"Union":return yield*Dgo(s,o,r,n);case"Uint8Array":return yield*Ngo(s,o,r,n);case"Unknown":return yield*Mgo(s,o,r,n);case"Void":return yield*Ogo(s,o,r,n);default:if(!v_.Has(s[Tt]))throw new t2t(t);return yield*Lgo(s,o,r,n)}}a(J0,"Visit");function iM(...t){let e=t.length===3?J0(t[0],t[1],"",t[2]):J0(t[0],[],"",t[1]);return new TU(e)}a(iM,"Errors");p();p();var Yoe=class extends qi{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}},r2t=class extends qi{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 kd(t,e,r){try{return ec(t)?t[wd].Decode(r):r}catch(n){throw new r2t(t,e,r,n)}}a(kd,"Default");function Bgo(t,e,r,n){return Pi(n)?kd(t,r,n.map((o,s)=>Gk(t.items,e,`${r}/${s}`,o))):kd(t,r,n)}a(Bgo,"FromArray");function Fgo(t,e,r,n){if(!So(n)||B1(n))return kd(t,r,n);let o=nUe(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=Gk(h,e,`${r}/${f}`,c[f]));if(!ec(t.unevaluatedProperties))return kd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=kd(u,`${r}/${f}`,d[f]));return kd(t,r,d)}a(Fgo,"FromIntersect");function Ugo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Gk(s,[...e,...o],r,n);return kd(t,r,c)}a(Ugo,"FromImport");function Qgo(t,e,r,n){return kd(t,r,Gk(t.not,e,r,n))}a(Qgo,"FromNot");function qgo(t,e,r,n){if(!So(n))return kd(t,r,n);let o=cC(t),s={...n};for(let d of o)Qi(s,d)&&(Fu(s[d])&&(!fB(t.properties[d])||su.IsExactOptionalProperty(s,d))||(s[d]=Gk(t.properties[d],e,`${r}/${d}`,s[d])));if(!Rd(t.additionalProperties))return kd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=kd(l,`${r}/${d}`,u[d]));return kd(t,r,u)}a(qgo,"FromObject");function jgo(t,e,r,n){if(!So(n))return kd(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]=Gk(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!Rd(t.additionalProperties))return kd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=kd(u,`${r}/${f}`,d[f]));return kd(t,r,d)}a(jgo,"FromRecord");function Hgo(t,e,r,n){let o=Ta(t,e);return kd(t,r,Gk(o,e,r,n))}a(Hgo,"FromRef");function Ggo(t,e,r,n){let o=Ta(t,e);return kd(t,r,Gk(o,e,r,n))}a(Ggo,"FromThis");function $go(t,e,r,n){return Pi(n)&&Pi(t.items)?kd(t,r,t.items.map((o,s)=>Gk(o,e,`${r}/${s}`,n[s]))):kd(t,r,n)}a($go,"FromTuple");function Vgo(t,e,r,n){for(let o of t.anyOf){if(!es(o,e,n))continue;let s=Gk(o,e,r,n);return kd(t,r,s)}return kd(t,r,n)}a(Vgo,"FromUnion");function Gk(t,e,r,n){let o=Y0(t,e),s=t;switch(t[Tt]){case"Array":return Bgo(s,o,r,n);case"Import":return Ugo(s,o,r,n);case"Intersect":return Fgo(s,o,r,n);case"Not":return Qgo(s,o,r,n);case"Object":return qgo(s,o,r,n);case"Record":return jgo(s,o,r,n);case"Ref":return Hgo(s,o,r,n);case"Symbol":return kd(s,r,n);case"This":return Ggo(s,o,r,n);case"Tuple":return $go(s,o,r,n);case"Union":return Vgo(s,o,r,n);default:return kd(s,r,n)}}a(Gk,"Visit");function Koe(t,e,r){return Gk(t,e,"",r)}a(Koe,"TransformDecode");p();var Joe=class extends qi{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}},n2t=class extends qi{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 mA(t,e,r){try{return ec(t)?t[wd].Encode(r):r}catch(n){throw new n2t(t,e,r,n)}}a(mA,"Default");function Wgo(t,e,r,n){let o=mA(t,r,n);return Pi(o)?o.map((s,c)=>$k(t.items,e,`${r}/${c}`,s)):o}a(Wgo,"FromArray");function zgo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=mA(t,r,n);return $k(s,[...e,...o],r,c)}a(zgo,"FromImport");function Ygo(t,e,r,n){let o=mA(t,r,n);if(!So(n)||B1(n))return o;let s=nUe(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=$k(m,e,`${r}/${h}`,l[h]));if(!ec(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=mA(d,`${r}/${h}`,f[h]));return f}a(Ygo,"FromIntersect");function Kgo(t,e,r,n){return mA(t.not,r,mA(t,r,n))}a(Kgo,"FromNot");function Jgo(t,e,r,n){let o=mA(t,r,n);if(!So(o))return o;let s=cC(t),c={...o};for(let f of s)Qi(c,f)&&(Fu(c[f])&&(!fB(t.properties[f])||su.IsExactOptionalProperty(c,f))||(c[f]=$k(t.properties[f],e,`${r}/${f}`,c[f])));if(!Rd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=mA(u,`${r}/${f}`,d[f]));return d}a(Jgo,"FromObject");function Zgo(t,e,r,n){let o=mA(t,r,n);if(!So(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]=$k(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!Rd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=mA(d,`${r}/${h}`,f[h]));return f}a(Zgo,"FromRecord");function Xgo(t,e,r,n){let o=Ta(t,e),s=$k(o,e,r,n);return mA(t,r,s)}a(Xgo,"FromRef");function eAo(t,e,r,n){let o=Ta(t,e),s=$k(o,e,r,n);return mA(t,r,s)}a(eAo,"FromThis");function tAo(t,e,r,n){let o=mA(t,r,n);return Pi(t.items)?t.items.map((s,c)=>$k(s,e,`${r}/${c}`,o[c])):[]}a(tAo,"FromTuple");function rAo(t,e,r,n){for(let o of t.anyOf){if(!es(o,e,n))continue;let s=$k(o,e,r,n);return mA(t,r,s)}for(let o of t.anyOf){let s=$k(o,e,r,n);if(es(t,e,s))return mA(t,r,s)}return mA(t,r,n)}a(rAo,"FromUnion");function $k(t,e,r,n){let o=Y0(t,e),s=t;switch(t[Tt]){case"Array":return Wgo(s,o,r,n);case"Import":return zgo(s,o,r,n);case"Intersect":return Ygo(s,o,r,n);case"Not":return Kgo(s,o,r,n);case"Object":return Jgo(s,o,r,n);case"Record":return Zgo(s,o,r,n);case"Ref":return Xgo(s,o,r,n);case"This":return eAo(s,o,r,n);case"Tuple":return tAo(s,o,r,n);case"Union":return rAo(s,o,r,n);default:return mA(s,r,n)}}a($k,"Visit");function Zoe(t,e,r){return $k(t,e,"",r)}a(Zoe,"TransformEncode");p();function nAo(t,e){return ec(t)||Hm(t.items,e)}a(nAo,"FromArray");function iAo(t,e){return ec(t)||Hm(t.items,e)}a(iAo,"FromAsyncIterator");function oAo(t,e){return ec(t)||Hm(t.returns,e)||t.parameters.some(r=>Hm(r,e))}a(oAo,"FromConstructor");function sAo(t,e){return ec(t)||Hm(t.returns,e)||t.parameters.some(r=>Hm(r,e))}a(sAo,"FromFunction");function aAo(t,e){return ec(t)||ec(t.unevaluatedProperties)||t.allOf.some(r=>Hm(r,e))}a(aAo,"FromIntersect");function cAo(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return ec(t)||Hm(n,[...r,...e])}a(cAo,"FromImport");function lAo(t,e){return ec(t)||Hm(t.items,e)}a(lAo,"FromIterator");function uAo(t,e){return ec(t)||Hm(t.not,e)}a(uAo,"FromNot");function dAo(t,e){return ec(t)||Object.values(t.properties).some(r=>Hm(r,e))||Rd(t.additionalProperties)&&Hm(t.additionalProperties,e)}a(dAo,"FromObject");function fAo(t,e){return ec(t)||Hm(t.item,e)}a(fAo,"FromPromise");function pAo(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return ec(t)||Hm(n,e)||Rd(t.additionalProperties)&&ec(t.additionalProperties)}a(pAo,"FromRecord");function hAo(t,e){return ec(t)?!0:Hm(Ta(t,e),e)}a(hAo,"FromRef");function mAo(t,e){return ec(t)?!0:Hm(Ta(t,e),e)}a(mAo,"FromThis");function gAo(t,e){return ec(t)||!Fu(t.items)&&t.items.some(r=>Hm(r,e))}a(gAo,"FromTuple");function AAo(t,e){return ec(t)||t.anyOf.some(r=>Hm(r,e))}a(AAo,"FromUnion");function Hm(t,e){let r=Y0(t,e),n=t;if(t.$id&&i2t.has(t.$id))return!1;switch(t.$id&&i2t.add(t.$id),t[Tt]){case"Array":return nAo(n,r);case"AsyncIterator":return iAo(n,r);case"Constructor":return oAo(n,r);case"Function":return sAo(n,r);case"Import":return cAo(n,r);case"Intersect":return aAo(n,r);case"Iterator":return lAo(n,r);case"Not":return uAo(n,r);case"Object":return dAo(n,r);case"Promise":return fAo(n,r);case"Record":return pAo(n,r);case"Ref":return hAo(n,r);case"This":return mAo(n,r);case"Tuple":return gAo(n,r);case"Union":return AAo(n,r);default:return ec(t)}}a(Hm,"Visit");var i2t=new Set;function yB(t,e){return i2t.clear(),Hm(t,e)}a(yB,"HasTransform");var o2t=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=yB(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return iM(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new Yoe(this.schema,e,this.Errors(e).First());return this.hasTransform?Koe(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?Zoe(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new Joe(this.schema,e,this.Errors(e).First());return r}},EB;(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})(EB||(EB={}));var gUe;(function(t){function e(s){return s.length===0?!1:EB.IsNumeric(s.charCodeAt(0))}a(e,"IsFirstCharacterNumeric");function r(s){if(e(s))return!1;for(let c=0;c= ${X.minItems}`);let ue=z(X.items,ee,"value");if(yield`((array) => { for(const ${he} of array) if(!(${ue})) { return false }; return true; })(${K})`,Qu(X.contains)||ai(X.minContains)||ai(X.maxContains)){let qe=Qu(X.contains)?X.contains:Xo(),ne=z(qe,ee,"value"),ce=ai(X.minContains)?[`(count >= ${X.minContains})`]:[],Ne=ai(X.maxContains)?[`(count <= ${X.maxContains})`]:[],we=`const count = value.reduce((${Z}, ${he}) => ${ne} ? acc + 1 : acc, 0)`,Be=["(count > 0)",...ce,...Ne].join(" && ");yield`((${he}) => { ${we}; return ${Be}})(${K})`}X.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(X,ee,K){yield`(typeof value === 'object' && Symbol.asyncIterator in ${K})`}a(s,"FromAsyncIterator");function*c(X,ee,K){yield`(typeof ${K} === 'bigint')`,pA(X.exclusiveMaximum)&&(yield`${K} < BigInt(${X.exclusiveMaximum})`),pA(X.exclusiveMinimum)&&(yield`${K} > BigInt(${X.exclusiveMinimum})`),pA(X.maximum)&&(yield`${K} <= BigInt(${X.maximum})`),pA(X.minimum)&&(yield`${K} >= BigInt(${X.minimum})`),pA(X.multipleOf)&&(yield`(${K} % BigInt(${X.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(X,ee,K){yield`(typeof ${K} === 'boolean')`}a(l,"FromBoolean");function*u(X,ee,K){yield*W(X.returns,ee,`${K}.prototype`)}a(u,"FromConstructor");function*d(X,ee,K){yield`(${K} instanceof Date) && Number.isFinite(${K}.getTime())`,ai(X.exclusiveMaximumTimestamp)&&(yield`${K}.getTime() < ${X.exclusiveMaximumTimestamp}`),ai(X.exclusiveMinimumTimestamp)&&(yield`${K}.getTime() > ${X.exclusiveMinimumTimestamp}`),ai(X.maximumTimestamp)&&(yield`${K}.getTime() <= ${X.maximumTimestamp}`),ai(X.minimumTimestamp)&&(yield`${K}.getTime() >= ${X.minimumTimestamp}`),ai(X.multipleOfTimestamp)&&(yield`(${K}.getTime() % ${X.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(X,ee,K){yield`(typeof ${K} === 'function')`}a(f,"FromFunction");function*h(X,ee,K){let he=globalThis.Object.getOwnPropertyNames(X.$defs).reduce((Z,ue)=>[...Z,X.$defs[ue]],[]);yield*W(zI(X.$ref),[...ee,...he],K)}a(h,"FromImport");function*m(X,ee,K){yield`Number.isInteger(${K})`,ai(X.exclusiveMaximum)&&(yield`${K} < ${X.exclusiveMaximum}`),ai(X.exclusiveMinimum)&&(yield`${K} > ${X.exclusiveMinimum}`),ai(X.maximum)&&(yield`${K} <= ${X.maximum}`),ai(X.minimum)&&(yield`${K} >= ${X.minimum}`),ai(X.multipleOf)&&(yield`(${K} % ${X.multipleOf}) === 0`)}a(m,"FromInteger");function*g(X,ee,K){let he=X.allOf.map(Z=>z(Z,ee,K)).join(" && ");if(X.unevaluatedProperties===!1){let Z=H(`${new RegExp(mB(X))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${Z}.test(key))`;yield`(${he} && ${ue})`}else if(Qu(X.unevaluatedProperties)){let Z=H(`${new RegExp(mB(X))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${Z}.test(key) || ${z(X.unevaluatedProperties,ee,`${K}[key]`)})`;yield`(${he} && ${ue})`}else yield`(${he})`}a(g,"FromIntersect");function*A(X,ee,K){yield`(typeof value === 'object' && Symbol.iterator in ${K})`}a(A,"FromIterator");function*y(X,ee,K){typeof X.const=="number"||typeof X.const=="boolean"?yield`(${K} === ${X.const})`:yield`(${K} === '${a2t.Escape(X.const)}')`}a(y,"FromLiteral");function*E(X,ee,K){yield"false"}a(E,"FromNever");function*_(X,ee,K){yield`(!${z(X.not,ee,K)})`}a(_,"FromNot");function*v(X,ee,K){yield`(${K} === null)`}a(v,"FromNull");function*b(X,ee,K){yield BW.IsNumberLike(K),ai(X.exclusiveMaximum)&&(yield`${K} < ${X.exclusiveMaximum}`),ai(X.exclusiveMinimum)&&(yield`${K} > ${X.exclusiveMinimum}`),ai(X.maximum)&&(yield`${K} <= ${X.maximum}`),ai(X.minimum)&&(yield`${K} >= ${X.minimum}`),ai(X.multipleOf)&&(yield`(${K} % ${X.multipleOf}) === 0`)}a(b,"FromNumber");function*T(X,ee,K){yield BW.IsObjectLike(K),ai(X.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${X.minProperties}`),ai(X.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${X.maxProperties}`);let he=Object.getOwnPropertyNames(X.properties);for(let Z of he){let ue=gUe.Encode(K,Z),qe=X.properties[Z];if(X.required&&X.required.includes(Z))yield*W(qe,ee,ue),(gB(qe)||e(qe))&&(yield`('${Z}' in ${K})`);else{let ne=z(qe,ee,ue);yield BW.IsExactOptionalProperty(K,Z,ne)}}if(X.additionalProperties===!1)if(X.required&&X.required.length===he.length)yield`Object.getOwnPropertyNames(${K}).length === ${he.length}`;else{let Z=`[${he.map(ue=>`'${ue}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${K}).every(key => ${Z}.includes(key))`}if(typeof X.additionalProperties=="object"){let Z=z(X.additionalProperties,ee,`${K}[key]`),ue=`[${he.map(qe=>`'${qe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${K}).every(key => ${ue}.includes(key) || ${Z}))`}}a(T,"FromObject");function*w(X,ee,K){yield`${K} instanceof Promise`}a(w,"FromPromise");function*R(X,ee,K){yield BW.IsRecordLike(K),ai(X.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${X.minProperties}`),ai(X.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${X.maxProperties}`);let[he,Z]=Object.entries(X.patternProperties)[0],ue=H(`${new RegExp(he)}`),qe=z(Z,ee,"value"),ne=Qu(X.additionalProperties)?z(X.additionalProperties,ee,K):X.additionalProperties===!1?"false":"true",ce=`(${ue}.test(key) ? ${qe} : ${ne})`;yield`(Object.entries(${K}).every(([key, value]) => ${ce}))`}a(R,"FromRecord");function*x(X,ee,K){let he=Ta(X,ee);if(V.functions.has(X.$ref))return yield`${ie(X.$ref)}(${K})`;yield*W(he,ee,K)}a(x,"FromRef");function*P(X,ee,K){let he=H(`${new RegExp(X.source,X.flags)};`);yield`(typeof ${K} === 'string')`,ai(X.maxLength)&&(yield`${K}.length <= ${X.maxLength}`),ai(X.minLength)&&(yield`${K}.length >= ${X.minLength}`),yield`${he}.test(${K})`}a(P,"FromRegExp");function*D(X,ee,K){yield`(typeof ${K} === 'string')`,ai(X.maxLength)&&(yield`${K}.length <= ${X.maxLength}`),ai(X.minLength)&&(yield`${K}.length >= ${X.minLength}`),X.pattern!==void 0&&(yield`${H(`${new RegExp(X.pattern)};`)}.test(${K})`),X.format!==void 0&&(yield`format('${X.format}', ${K})`)}a(D,"FromString");function*N(X,ee,K){yield`(typeof ${K} === 'symbol')`}a(N,"FromSymbol");function*L(X,ee,K){yield`(typeof ${K} === 'string')`,yield`${H(`${new RegExp(X.pattern)};`)}.test(${K})`}a(L,"FromTemplateLiteral");function*B(X,ee,K){yield`${ie(X.$ref)}(${K})`}a(B,"FromThis");function*q(X,ee,K){if(yield`Array.isArray(${K})`,X.items===void 0)return yield`${K}.length === 0`;yield`(${K}.length === ${X.maxItems})`;for(let he=0;hez(Z,ee,K)).join(" || ")})`}a(O,"FromUnion");function*j(X,ee,K){yield`${K} instanceof Uint8Array`,ai(X.maxByteLength)&&(yield`(${K}.length <= ${X.maxByteLength})`),ai(X.minByteLength)&&(yield`(${K}.length >= ${X.minByteLength})`)}a(j,"FromUint8Array");function*Q(X,ee,K){yield"true"}a(Q,"FromUnknown");function*U(X,ee,K){yield BW.IsVoidLike(K)}a(U,"FromVoid");function*Y(X,ee,K){let he=V.instances.size;V.instances.set(he,X),yield`kind('${X[Tt]}', ${he}, ${K})`}a(Y,"FromKind");function*W(X,ee,K,he=!0){let Z=ba(X.$id)?[...ee,X]:ee,ue=X;if(he&&ba(X.$id)){let qe=ie(X.$id);if(V.functions.has(qe))return yield`${qe}(${K})`;{V.functions.set(qe,"");let ne=re(qe,X,ee,"value",!1);return V.functions.set(qe,ne),yield`${qe}(${K})`}}switch(ue[Tt]){case"Any":return yield*r(ue,Z,K);case"Argument":return yield*n(ue,Z,K);case"Array":return yield*o(ue,Z,K);case"AsyncIterator":return yield*s(ue,Z,K);case"BigInt":return yield*c(ue,Z,K);case"Boolean":return yield*l(ue,Z,K);case"Constructor":return yield*u(ue,Z,K);case"Date":return yield*d(ue,Z,K);case"Function":return yield*f(ue,Z,K);case"Import":return yield*h(ue,Z,K);case"Integer":return yield*m(ue,Z,K);case"Intersect":return yield*g(ue,Z,K);case"Iterator":return yield*A(ue,Z,K);case"Literal":return yield*y(ue,Z,K);case"Never":return yield*E(ue,Z,K);case"Not":return yield*_(ue,Z,K);case"Null":return yield*v(ue,Z,K);case"Number":return yield*b(ue,Z,K);case"Object":return yield*T(ue,Z,K);case"Promise":return yield*w(ue,Z,K);case"Record":return yield*R(ue,Z,K);case"Ref":return yield*x(ue,Z,K);case"RegExp":return yield*P(ue,Z,K);case"String":return yield*D(ue,Z,K);case"Symbol":return yield*N(ue,Z,K);case"TemplateLiteral":return yield*L(ue,Z,K);case"This":return yield*B(ue,Z,K);case"Tuple":return yield*q(ue,Z,K);case"Undefined":return yield*M(ue,Z,K);case"Union":return yield*O(ue,Z,K);case"Uint8Array":return yield*j(ue,Z,K);case"Unknown":return yield*Q(ue,Z,K);case"Void":return yield*U(ue,Z,K);default:if(!v_.Has(ue[Tt]))throw new c2t(X);return yield*Y(ue,Z,K)}}a(W,"Visit");let V={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function z(X,ee,K,he=!0){return`(${[...W(X,ee,K,he)].join(" && ")})`}a(z,"CreateExpression");function ie(X){return`check_${s2t.Encode(X)}`}a(ie,"CreateFunctionName");function H(X){let ee=`local_${V.variables.size}`;return V.variables.set(ee,`const ${ee} = ${X}`),ee}a(H,"CreateVariable");function re(X,ee,K,he,Z=!0){let[ue,qe]=[` `,we=>"".padStart(we," ")],ne=le("value","any"),ce=Le("boolean"),Ne=[...W(ee,K,he,Z)].map(we=>`${qe(4)}${we}`).join(` &&${ue}`);return`function ${X}(${ne})${ce} {${ue}${qe(2)}return (${ue}${Ne}${ue}${qe(2)}) -}`}a(re,"CreateFunction");function le(X,ee){let K=V.language==="typescript"?`: ${ee}`:"";return`${X}${K}`}a(le,"CreateParameter");function Le(X){return V.language==="typescript"?`: ${X}`:""}a(Le,"CreateReturns");function ge(X,ee,K){let he=re("check",X,ee,"value"),Z=le("value","any"),ue=Le("boolean"),qe=[...V.functions.values()],ne=[...V.variables.values()],ce=Sa(X.$id)?`return function check(${Z})${ue} { +}`}a(re,"CreateFunction");function le(X,ee){let K=V.language==="typescript"?`: ${ee}`:"";return`${X}${K}`}a(le,"CreateParameter");function Le(X){return V.language==="typescript"?`: ${X}`:""}a(Le,"CreateReturns");function ge(X,ee,K){let he=re("check",X,ee,"value"),Z=le("value","any"),ue=Le("boolean"),qe=[...V.functions.values()],ne=[...V.variables.values()],ce=ba(X.$id)?`return function check(${Z})${ue} { return ${ie(X.$id)}(value) }`:`return ${he}`;return[...ne,...qe,ce].join(` -`)}a(ge,"Build");function Ue(...X){let ee={language:"javascript"},[K,he,Z]=X.length===2&&Pi(X[1])?[X[0],X[1],ee]:X.length===2&&!Pi(X[1])?[X[0],[],X[1]]:X.length===3?[X[0],X[1],X[2]]:X.length===1?[X[0],[],ee]:[null,[],ee];if(V.language=Z.language,V.variables.clear(),V.functions.clear(),V.instances.clear(),!Qu(K))throw new mUe(K);for(let ue of he)if(!Qu(ue))throw new mUe(ue);return ge(K,he,Z)}a(Ue,"Code"),t.Code=Ue;function ke(X,ee=[]){let K=Ue(X,ee,{language:"javascript"}),he=globalThis.Function("kind","format","hash",K),Z=new Map(V.instances);function ue(Ne,we,Be){if(!v_.Has(Ne)||!Z.has(we))return!1;let rt=v_.Get(Ne),st=Z.get(we);return rt(st,Be)}a(ue,"typeRegistryFunction");function qe(Ne,we){return Uk.Has(Ne)?Uk.Get(Ne)(we):!1}a(qe,"formatRegistryFunction");function ne(Ne){return bU(Ne)}a(ne,"hashFunction");let ce=he(ue,qe,ne);return new i2t(X,ee,ce,K)}a(ke,"Compile"),t.Compile=ke})(qu||(qu={}));var t7e=de(dU()),yse=de(require("os"));Mo();var r7e=de(ri());function obe(t){return t===1}a(obe,"isRestricted");var ibe=8192,Ayo=21;var X0=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return obe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(_se(e))return this.reporterRestricted;if(RCe(e))return new B9e}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()))}},yyo=S.Object({},{additionalProperties:S.String()}),Eyo=S.Object({meanLogProb:S.Optional(S.Number()),meanAlternativeLogProb:S.Optional(S.Number())},{additionalProperties:S.Number()}),_yo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function vyo(t){return _yo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(vyo,"isOomError");function Cyo(t){return XI(t)?"network":vyo(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(Cyo,"getErrorType");var Wt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=qu.Compile(yyo)}static{this.validateTelemetryMeasurements=qu.Compile(Eyo)}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||{},yl())}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=yl())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(Zt).getFallbackExpAndFilters();n.addToTelemetry(e,this),r.addToTelemetry(this)}extendWithCoreEditorAgnosticFields(e){this.properties.editor_version=M1(e.get(Ir).getEditorInfo()),this.properties.editor_plugin_version=M1(e.get(Ir).getEditorPluginInfo());let r=e.get(Ua);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${V1(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=M1(r.getEditorInfo());let n=e.get(tr);this.properties.fetcher=n.name;let o=e.get(Lo).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=CKr(e);r["copilot.build"]=bKr(e),r["copilot.buildType"]=MU(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(obe(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>ibe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+ibe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(Ese,"telemetrizePromptLength");function yl(){return performance.now()}a(yl,"now");function Iyo(t){return Math.floor(t/1e3)}a(Iyo,"nowSeconds");function _se(t){return t.get(Op).optedIn}a(_se,"shouldSendRestricted");function Et(t,e,r,n){return t.get(xd).register(xyo(t,e,yl(),r?.extendedBy(),n))}a(Et,"telemetry");function ZI(t,e,r){return t.get(xd).register(i7e(t,e,r?.extendedBy()))}a(ZI,"telemetryMsft");function At(t,e,r,n){let o=Wt.createAndMarkAsIssued(r,n);return t.get(xd).register(i7e(t,e,o))}a(At,"telemetryMs");function n7e(t,e,r,n){let o=(n||Wt.createAndMarkAsIssued()).extendedBy(AKr(r));return t.get(xd).register(i7e(t,e,o))}a(n7e,"telemetryMsftWithError");function Vn(t,e,r,n,o){let s=Wt.createAndMarkAsIssued({...n,...AKr(r)},o);return t.get(xd).register(i7e(t,e,s))}a(Vn,"telemetryMsWithError");function AKr(t){let e={};if(t){let r=kyo(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(AKr,"buildErrorProperties");async function xyo(t,e,r,n,o=0){let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!obe(o)||_se(t))&&sbe(t,o,e,s),byo(t,e,s)}a(xyo,"_telemetry");async function i7e(t,e,r){let n=r||Wt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),Tyo(t,e,n)}a(i7e,"_telemetryMsft");function K6e(t,e){return t.get(xd).register(wyo(t,e,yl()))}a(K6e,"telemetryExpProblem");async function wyo(t,e,r){let n="expProblem",o=Wt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),sbe(t,0,n,o)}a(wyo,"_telemetryExpProblem");function vse(t,e,r,n,o=0){let s={...r,...yKr(t)};sbe(t,o,e,{properties:s,measurements:n})}a(vse,"telemetryRaw");function yKr(t){let e=t.get(Ir),r={unique_id:Mt(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:M1(e.getEditorInfo())};return{...t.get(Op).getProperties(),...r}}a(yKr,"createRequiredProperties");var ODt=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,t7e.SHA256)(t7e.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function qa(t,e,r,n,o){return t.get(xd).register(EKr(t,e,yl(),r,{...n},o))}a(qa,"telemetryException");async function EKr(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||Gm(c)||c instanceof r7e.ConnectionError||c instanceof r7e.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new ODt(e),e&&typeof e=="object"&&e.name==="ExitStatus")return;if(c.stack?.startsWith(`${c} +`)}a(ge,"Build");function Ue(...X){let ee={language:"javascript"},[K,he,Z]=X.length===2&&Pi(X[1])?[X[0],X[1],ee]:X.length===2&&!Pi(X[1])?[X[0],[],X[1]]:X.length===3?[X[0],X[1],X[2]]:X.length===1?[X[0],[],ee]:[null,[],ee];if(V.language=Z.language,V.variables.clear(),V.functions.clear(),V.instances.clear(),!Qu(K))throw new AUe(K);for(let ue of he)if(!Qu(ue))throw new AUe(ue);return ge(K,he,Z)}a(Ue,"Code"),t.Code=Ue;function ke(X,ee=[]){let K=Ue(X,ee,{language:"javascript"}),he=globalThis.Function("kind","format","hash",K),Z=new Map(V.instances);function ue(Ne,we,Be){if(!v_.Has(Ne)||!Z.has(we))return!1;let rt=v_.Get(Ne),st=Z.get(we);return rt(st,Be)}a(ue,"typeRegistryFunction");function qe(Ne,we){return Qk.Has(Ne)?Qk.Get(Ne)(we):!1}a(qe,"formatRegistryFunction");function ne(Ne){return SU(Ne)}a(ne,"hashFunction");let ce=he(ue,qe,ne);return new o2t(X,ee,ce,K)}a(ke,"Compile"),t.Compile=ke})(qu||(qu={}));var n7e=de(fU()),yse=de(require("os"));Oo();var i7e=de(ti());function sbe(t){return t===1}a(sbe,"isRestricted");var obe=8192,vyo=21;var X0=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return sbe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(_se(e))return this.reporterRestricted;if(kCe(e))return new U9e}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()))}},Cyo=S.Object({},{additionalProperties:S.String()}),byo=S.Object({meanLogProb:S.Optional(S.Number()),meanAlternativeLogProb:S.Optional(S.Number())},{additionalProperties:S.Number()}),Syo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function Tyo(t){return Syo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(Tyo,"isOomError");function Iyo(t){return tx(t)?"network":Tyo(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(Iyo,"getErrorType");var Wt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=qu.Compile(Cyo)}static{this.validateTelemetryMeasurements=qu.Compile(byo)}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||{},yl())}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=yl())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(Zt).getFallbackExpAndFilters();n.addToTelemetry(e,this),r.addToTelemetry(this)}extendWithCoreEditorAgnosticFields(e){this.properties.editor_version=M1(e.get(Ir).getEditorInfo()),this.properties.editor_plugin_version=M1(e.get(Ir).getEditorPluginInfo());let r=e.get(Fa);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${V1(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=M1(r.getEditorInfo());let n=e.get(nr);this.properties.fetcher=n.name;let o=e.get(Bo).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=bKr(e);r["copilot.build"]=SKr(e),r["copilot.buildType"]=OU(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(sbe(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>obe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+obe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(Ese,"telemetrizePromptLength");function yl(){return performance.now()}a(yl,"now");function kyo(t){return Math.floor(t/1e3)}a(kyo,"nowSeconds");function _se(t){return t.get(Op).optedIn}a(_se,"shouldSendRestricted");function Et(t,e,r,n){return t.get(xd).register(Pyo(t,e,yl(),r?.extendedBy(),n))}a(Et,"telemetry");function ex(t,e,r){return t.get(xd).register(s7e(t,e,r?.extendedBy()))}a(ex,"telemetryMsft");function At(t,e,r,n){let o=Wt.createAndMarkAsIssued(r,n);return t.get(xd).register(s7e(t,e,o))}a(At,"telemetryMs");function o7e(t,e,r,n){let o=(n||Wt.createAndMarkAsIssued()).extendedBy(yKr(r));return t.get(xd).register(s7e(t,e,o))}a(o7e,"telemetryMsftWithError");function Vn(t,e,r,n,o){let s=Wt.createAndMarkAsIssued({...n,...yKr(r)},o);return t.get(xd).register(s7e(t,e,s))}a(Vn,"telemetryMsWithError");function yKr(t){let e={};if(t){let r=Myo(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(yKr,"buildErrorProperties");async function Pyo(t,e,r,n,o=0){let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!sbe(o)||_se(t))&&abe(t,o,e,s),xyo(t,e,s)}a(Pyo,"_telemetry");async function s7e(t,e,r){let n=r||Wt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),Ryo(t,e,n)}a(s7e,"_telemetryMsft");function Z6e(t,e){return t.get(xd).register(Dyo(t,e,yl()))}a(Z6e,"telemetryExpProblem");async function Dyo(t,e,r){let n="expProblem",o=Wt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),abe(t,0,n,o)}a(Dyo,"_telemetryExpProblem");function vse(t,e,r,n,o=0){let s={...r,...EKr(t)};abe(t,o,e,{properties:s,measurements:n})}a(vse,"telemetryRaw");function EKr(t){let e=t.get(Ir),r={unique_id:Mt(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:M1(e.getEditorInfo())};return{...t.get(Op).getProperties(),...r}}a(EKr,"createRequiredProperties");var LDt=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,n7e.SHA256)(n7e.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function Qa(t,e,r,n,o){return t.get(xd).register(_Kr(t,e,yl(),r,{...n},o))}a(Qa,"telemetryException");async function _Kr(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||Gm(c)||c instanceof i7e.ConnectionError||c instanceof i7e.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new LDt(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=_se(t),f=SGr(c,u,d),h=Cyo(c),m=h==="exception",g=Wt.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=fPt(y.value):y.value="[redacted]");s??=cGr(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(XN).isThrottled(A)){if(d){let y=bGr(c,u),E=Wt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:y.stack||y.toString(),message:y.message,...o});s.rollup_id!=="auto"&&(E.properties.errno=s.rollup_id),await E.makeReadyForSending(t,1,"IncludeExp",r),E.properties.unique_id=g.properties.unique_id,g.properties.restricted_unique_id=E.properties.unique_id,sbe(t,1,`error.${h}`,E)}m&&(g.properties.failbot_payload=JSON.stringify(s)),sbe(t,0,`error.${h}`,g)}}a(EKr,"_telemetryException");function z0(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await EKr(t,c,yl(),r,n)}},"wrapped");return(...s)=>t.get(xd).register(o(...s))}a(z0,"telemetryCatch");function eg(t,e,r,n){return t.get(xd).register(Ryo(t,e,yl(),r?.extendedBy(),n))}a(eg,"telemetryError");async function Ryo(t,e,r,n,o=0){if(obe(o)&&!_se(t))return;let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),Syo(t,o,e,s)}a(Ryo,"_telemetryError");function _Kr(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=Wt.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),Et(t,"engine.completion",u,1)}a(_Kr,"logEngineCompletion");function vKr(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 Et(t,"engine.prompt",o,1)}a(vKr,"logEnginePrompt");function kyo(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(kyo,"buildErrorFromUnknown");p();var jW=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Gm(t){return!t||typeof t!="object"?!1:t instanceof jW||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Gm,"isAbortError");var Cse=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},aM=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}`}},Pyo=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 XI(t,e=!0){return t instanceof Error?e&&"cause"in t&&XI(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof Cse||t instanceof aM||t?.message?.startsWith("net::")||Pyo.has(t.code??""):!1}a(XI,"isNetworkError");var ex=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 Cse(`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 Cse(`Response body truncated: actualLength=${s}`,"Truncated"):new Cse(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function OU(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(OU,"parseRetryAfterSeconds");var tr=class{static{a(this,"Fetcher")}getImplementation(){return this}};function HW(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={...l,...m?{}:{Authorization:`Bearer ${r}`},...Gy(t)};d===void 0&&(g["Openai-Organization"]="github-copilot",g["X-Request-Id"]=o,g["VScode-SessionId"]=t.get(Ua).sessionId,g["VScode-MachineId"]=t.get(Ua).machineId,g["X-GitHub-Api-Version"]="2026-01-09"),n&&(g["OpenAI-Intent"]=n);let A={method:"POST",headers:g,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:g,messages:h,body:s});let y=t.get(tr);if(c){let _=new AbortController;c.onCancellationRequested(()=>{Et(t,"networking.cancelRequest",Wt.createAndMarkAsIssued({headerRequestId:o})),_.abort()}),A.signal=_.signal}return y.fetch(e,A).catch(_=>{if(Dyo(_))return Et(t,"networking.disconnectAll"),y.disconnectAll().then(()=>y.fetch(e,A));throw _})}a(HW,"postRequest");function Dyo(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(Dyo,"isInterruptedNetworkError");p();function o7e(){return typeof process>"u"}a(o7e,"isWeb");function CB(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(CB,"isMsBenchModeEnabled");var LDt=class extends aM{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 Gf(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...o7e()?{}:Gy(t),...n.headers}};let o=await t.get(tr).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new aM(o);if(!o.headers.get("x-github-request-id"))throw new LDt(o);return o}a(Gf,"apiFetch");p();p();var ts=class{constructor(){this.recentNotifications=new Cn(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 la=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 IKr=require("os"),s7e=require("path");p();var SKr;(()=>{"use strict";var t={975:L=>{function B(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}a(B,"e");function q(O,j){for(var Q,U="",Y=0,W=-1,V=0,z=0;z<=O.length;++z){if(z2){var ie=U.lastIndexOf("/");if(ie!==U.length-1){ie===-1?(U="",Y=0):Y=(U=U.slice(0,ie)).length-1-U.lastIndexOf("/"),W=z,V=0;continue}}else if(U.length===2||U.length===1){U="",Y=0,W=z,V=0;continue}}j&&(U.length>0?U+="/..":U="..",Y=2)}else U.length>0?U+="/"+O.slice(W+1,z):U=O.slice(W+1,z),Y=z-W-1;W=z,V=0}else Q===46&&V!==-1?++V:V=-1}return U}a(q,"r");var M={resolve:a(function(){for(var O,j="",Q=!1,U=arguments.length-1;U>=-1&&!Q;U--){var Y;U>=0?Y=arguments[U]:(O===void 0&&(O=process.cwd()),Y=O),B(Y),Y.length!==0&&(j=Y+"/"+j,Q=Y.charCodeAt(0)===47)}return j=q(j,!Q),Q?j.length>0?"/"+j:"/":j.length>0?j:"."},"resolve"),normalize:a(function(O){if(B(O),O.length===0)return".";var j=O.charCodeAt(0)===47,Q=O.charCodeAt(O.length-1)===47;return(O=q(O,!j)).length!==0||j||(O="."),O.length>0&&Q&&(O+="/"),j?"/"+O:O},"normalize"),isAbsolute:a(function(O){return B(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var O,j=0;j0&&(O===void 0?O=Q:O+="/"+Q)}return O===void 0?".":M.normalize(O)},"join"),relative:a(function(O,j){if(B(O),B(j),O===j||(O=M.resolve(O))===(j=M.resolve(j)))return"";for(var Q=1;Qz){if(j.charCodeAt(W+H)===47)return j.slice(W+H+1);if(H===0)return j.slice(W+H)}else Y>z&&(O.charCodeAt(Q+H)===47?ie=H:H===0&&(ie=0));break}var re=O.charCodeAt(Q+H);if(re!==j.charCodeAt(W+H))break;re===47&&(ie=H)}var le="";for(H=Q+ie+1;H<=U;++H)H!==U&&O.charCodeAt(H)!==47||(le.length===0?le+="..":le+="/..");return le.length>0?le+j.slice(W+ie):(W+=ie,j.charCodeAt(W)===47&&++W,j.slice(W))},"relative"),_makeLong:a(function(O){return O},"_makeLong"),dirname:a(function(O){if(B(O),O.length===0)return".";for(var j=O.charCodeAt(0),Q=j===47,U=-1,Y=!0,W=O.length-1;W>=1;--W)if((j=O.charCodeAt(W))===47){if(!Y){U=W;break}}else Y=!1;return U===-1?Q?"/":".":Q&&U===1?"//":O.slice(0,U)},"dirname"),basename:a(function(O,j){if(j!==void 0&&typeof j!="string")throw new TypeError('"ext" argument must be a string');B(O);var Q,U=0,Y=-1,W=!0;if(j!==void 0&&j.length>0&&j.length<=O.length){if(j.length===O.length&&j===O)return"";var V=j.length-1,z=-1;for(Q=O.length-1;Q>=0;--Q){var ie=O.charCodeAt(Q);if(ie===47){if(!W){U=Q+1;break}}else z===-1&&(W=!1,z=Q+1),V>=0&&(ie===j.charCodeAt(V)?--V==-1&&(Y=Q):(V=-1,Y=z))}return U===Y?Y=z:Y===-1&&(Y=O.length),O.slice(U,Y)}for(Q=O.length-1;Q>=0;--Q)if(O.charCodeAt(Q)===47){if(!W){U=Q+1;break}}else Y===-1&&(W=!1,Y=Q+1);return Y===-1?"":O.slice(U,Y)},"basename"),extname:a(function(O){B(O);for(var j=-1,Q=0,U=-1,Y=!0,W=0,V=O.length-1;V>=0;--V){var z=O.charCodeAt(V);if(z!==47)U===-1&&(Y=!1,U=V+1),z===46?j===-1?j=V:W!==1&&(W=1):j!==-1&&(W=-1);else if(!Y){Q=V+1;break}}return j===-1||U===-1||W===0||W===1&&j===U-1&&j===Q+1?"":O.slice(j,U)},"extname"),format:a(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(j,Q){var U=Q.dir||Q.root,Y=Q.base||(Q.name||"")+(Q.ext||"");return U?U===Q.root?U+Y:U+"/"+Y:Y})(0,O)},"format"),parse:a(function(O){B(O);var j={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return j;var Q,U=O.charCodeAt(0),Y=U===47;Y?(j.root="/",Q=1):Q=0;for(var W=-1,V=0,z=-1,ie=!0,H=O.length-1,re=0;H>=Q;--H)if((U=O.charCodeAt(H))!==47)z===-1&&(ie=!1,z=H+1),U===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&&(j.base=j.name=V===0&&Y?O.slice(1,z):O.slice(V,z)):(V===0&&Y?(j.name=O.slice(1,W),j.base=O.slice(1,z)):(j.name=O.slice(V,W),j.base=O.slice(V,z)),j.ext=O.slice(W,z)),V>0?j.dir=O.slice(0,V-1):Y&&(j.dir="/"),j},"parse"),sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,L.exports=M}},e={};function r(L){var B=e[L];if(B!==void 0)return B.exports;var q=e[L]={exports:{}};return t[L](q,q.exports,r),q.exports}a(r,"r"),r.d=(L,B)=>{for(var q in B)r.o(B,q)&&!r.o(L,q)&&Object.defineProperty(L,q,{enumerable:!0,get:B[q]})},r.o=(L,B)=>Object.prototype.hasOwnProperty.call(L,B),r.r=L=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__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(L,B){if(!L.scheme&&B)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${L.authority}", path: "${L.path}", query: "${L.query}", fragment: "${L.fragment}"}`);if(L.scheme&&!s.test(L.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(L.path){if(L.authority){if(!c.test(L.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(L.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,O,j,Q=!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(U,Y){return U||Y?U:"file"})(B,Q),this.authority=q||d,this.path=(function(U,Y){switch(U){case"https":case"http":case"file":Y?Y[0]!==f&&(Y=f+Y):Y=f}return Y})(this.scheme,M||d),this.query=O||d,this.fragment=j||d,u(this,Q))}get fsPath(){return v(this,!1)}with(B){if(!B)return this;let{scheme:q,authority:M,path:O,query:j,fragment:Q}=B;return q===void 0?q=this.scheme:q===null&&(q=d),M===void 0?M=this.authority:M===null&&(M=d),O===void 0?O=this.path:O===null&&(O=d),j===void 0?j=this.query:j===null&&(j=d),Q===void 0?Q=this.fragment:Q===null&&(Q=d),q===this.scheme&&M===this.authority&&O===this.path&&j===this.query&&Q===this.fragment?this:new A(q,M,O,j,Q)}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 b(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?b(this,!0):(this._formatted||(this._formatted=b(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 E(L,B,q){let M,O=-1;for(let j=0;j=97&&Q<=122||Q>=65&&Q<=90||Q>=48&&Q<=57||Q===45||Q===46||Q===95||Q===126||B&&Q===47||q&&Q===91||q&&Q===93||q&&Q===58)O!==-1&&(M+=encodeURIComponent(L.substring(O,j)),O=-1),M!==void 0&&(M+=L.charAt(j));else{M===void 0&&(M=L.substr(0,j));let U=y[Q];U!==void 0?(O!==-1&&(M+=encodeURIComponent(L.substring(O,j)),O=-1),M+=U):O===-1&&(O=j)}}return O!==-1&&(M+=encodeURIComponent(L.substring(O))),M!==void 0?M:L}a(E,"m");function _(L){let B;for(let q=0;q1&&L.scheme==="file"?`//${L.authority}${L.path}`:L.path.charCodeAt(0)===47&&(L.path.charCodeAt(1)>=65&&L.path.charCodeAt(1)<=90||L.path.charCodeAt(1)>=97&&L.path.charCodeAt(1)<=122)&&L.path.charCodeAt(2)===58?B?L.path.substr(1):L.path[1].toLowerCase()+L.path.substr(2):L.path,o&&(q=q.replace(/\//g,"\\")),q}a(v,"v");function b(L,B){let q=B?_:E,M="",{scheme:O,authority:j,path:Q,query:U,fragment:Y}=L;if(O&&(M+=O,M+=":"),(j||O==="file")&&(M+=f,M+=f),j){let W=j.indexOf("@");if(W!==-1){let V=j.substr(0,W);j=j.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+="@"}j=j.toLowerCase(),W=j.lastIndexOf(":"),W===-1?M+=q(j,!1,!0):(M+=q(j.substr(0,W),!1,!0),M+=j.substr(W))}if(Q){if(Q.length>=3&&Q.charCodeAt(0)===47&&Q.charCodeAt(2)===58){let W=Q.charCodeAt(1);W>=65&&W<=90&&(Q=`/${String.fromCharCode(W+32)}:${Q.substr(3)}`)}else if(Q.length>=2&&Q.charCodeAt(1)===58){let W=Q.charCodeAt(0);W>=65&&W<=90&&(Q=`${String.fromCharCode(W+32)}:${Q.substr(2)}`)}M+=q(Q,!0,!1)}return U&&(M+="?",M+=q(U,!1,!1)),Y&&(M+="#",M+=B?Y:E(Y,!1,!1)),M}a(b,"b");function T(L){try{return decodeURIComponent(L)}catch{return L.length>3?L.substr(0,3)+T(L.substr(3)):L}}a(T,"C");let w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function R(L){return L.match(w)?L.replace(w,(B=>T(B))):L}a(R,"w");var x=r(975);let P=x.posix||x,D="/";var N;(function(L){L.joinPath=function(B,...q){return B.with({path:P.join(B.path,...q)})},L.resolvePath=function(B,...q){let M=B.path,O=!1;M[0]!==D&&(M=D+M,O=!0);let j=P.resolve(M,...q);return O&&j[0]===D&&!B.authority&&(j=j.substring(1)),B.with({path:j})},L.dirname=function(B){if(B.path.length===0||B.path===D)return B;let q=P.dirname(B.path);return q.length===1&&q.charCodeAt(0)===46&&(q=""),B.with({path:q})},L.basename=function(B){return P.basename(B.path)},L.extname=function(B){return P.extname(B.path)}})(N||(N={})),SKr=n})();var{URI:LU,Utils:abe}=SKr;function xKr(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+xKr(t.substring(3)):t}}a(xKr,"decodeURIComponentGraceful");var TKr=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function BDt(t){return t.match(TKr)?t.replace(TKr,e=>xKr(e)):t}a(BDt,"percentDecode");function Ks(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 LU.file(t).toString()}a(Ks,"makeFsUri");function to(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?LU.parse(e[1]+e[2],!0):LU.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(to,"parseUri");function a7e(t){return to(t),t}a(a7e,"validateUri");function Fs(t){try{return to(t).toString()}catch{return t}}a(Fs,"normalizeUri");function wKr(t){let e=Fs(t);return e.endsWith("/")?e.slice(0,-1):e}a(wKr,"normalizeUriNoTrailingSlash");var GW=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function un(t){let e=to(t);if(!GW.has(e.scheme)&&!la.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,IKr.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,s7e.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(un,"fsPath");function rs(t){try{return un(t)}catch{return}}a(rs,"getFsPath");function RKr(t){let e=rs(t);if(e)return LU.file(e).toString()}a(RKr,"getFsUri");function $W(t,...e){let r,n=rs(t);return n?r=Ks((0,s7e.resolve)(n,...e)):r=abe.resolvePath(to(t),...e.map(o=>kKr(o))).toString(),typeof t=="string"?r:{uri:r}}a($W,"resolveFilePath");function wa(t,...e){let r=abe.joinPath(to(t),...e.map(kKr)).toString();return typeof t=="string"?r:{uri:r}}a(wa,"joinPath");function kKr(t){return Nyo(t)?t.replaceAll("\\","/"):t}a(kKr,"pathToURIPath");function Nyo(t){return/^[^/\\]*\\/.test(t)}a(Nyo,"isWinPath");function Ji(t){return BDt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(Ji,"basename");function uf(t){let e=abe.dirname(to(t)),r;return GW.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(uf,"dirname");function PKr(t){return abe.extname(to(t))}a(PKr,"extname");var $m=class{static{a(this,"NetworkConfiguration")}};function c7e(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!UDt(t)&&r.protocol==="http:")return r.href}catch{}}a(c7e,"ensurePermittedUrl");var VW={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 FDt(t,e,r){if(r&&O1(t)){for(let n of r){let o=Ft(t,n);if(o)return o}return}for(let n of e){let o=Ft(t,n);if(o)return o}}a(FDt,"urlConfigOverride");function Myo(t,e){switch(e){case"api":return FDt(t,[Ye.DebugOverrideCapiUrl,Ye.DebugOverrideCapiUrlLegacy],[Ye.DebugTestOverrideCapiUrl,Ye.DebugTestOverrideCapiUrlLegacy]);case"proxy":return FDt(t,[Ye.DebugOverrideProxyUrl,Ye.DebugOverrideProxyUrlLegacy],[Ye.DebugTestOverrideProxyUrl,Ye.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!UDt(t))return FDt(t,[Ye.DebugSnippyOverrideUrl])}}a(Myo,"getEndpointOverrideUrl");function tx(t,e,r,...n){let o=Myo(t,r)??e.endpoints[r];return wa(o,...n)}a(tx,"getEndpointUrl");function bB(t){return rx(t)?.endpoints??VW}a(bB,"getLastKnownEndpoints");function l7e(t,e){if(e&&!c7e(t,e)){t.get(ts).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get($m).setConfiguredUrls(t,{serverUrl:e})}a(l7e,"updateServerUrl");p();var Vm=class{static{a(this,"UrlOpener")}};var b_=new fe("auth"),QDt=60,Oyo=300;var Lyo=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],Byo="4535c7beffc844b46bb1ed4aa04d759a";function $y(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($y,"fillGitHubUrls");function BU(){return Math.floor(Date.now()/1e3)}a(BU,"nowSeconds");async function qDt(t,e,r){let n=Wt.createAndMarkAsIssued({},{});Et(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await Gf(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 b_.info(t,`${h}${y}`),eg(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:h}}if(!s.ok||!c.token){b_.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),eg(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"&&Fyo(t,h,e),{failureKind:"NotAuthorized",message:h?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let l=BU()+c.refresh_in+QDt,u=await cbe(t,e),d;u.ok&&(d=await u.json());let f=new WW(c,d,l);return Et(t,"auth.new_token",n.extendedBy({...oPt(f)},{adjusted_expires_at:f.expiresAt,expires_at:c.expires_at,current_time:BU()})),{copilotToken:f}}a(qDt,"authFromGitHubSession");var Rh=class{static{a(this,"CopilotTokenFetcher")}},u7e=class extends Rh{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await qDt(e,r,n)}};async function cbe(t,e){return await Gf(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(cbe,"fetchCopilotUserInfo");function Fyo(t,e,r){e&&t.get(ts).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(Vm).open(l)}e.notification_id&&s&&await Uyo(t,e.notification_id,r)}).catch(n=>{b_.exception(t,n,"copilotToken.notification")})}a(Fyo,"notifyUser");async function Uyo(t,e,r){let n=await Gf(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&b_.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(Uyo,"sendNotificationResultToGitHub");var WW=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 P6e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...VW,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-Oyo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(Byo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var yi=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function d7e(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(d7e,"authEnvVarConflictMessage");var FU=class extends yi{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function DKr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new yi("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new yi("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new yi("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(DKr,"validateGitHubServerUrl");p();p();var nx=class{static{a(this,"AuthRepository")}};p();function NKr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=DKr(r),{apiUrl:o}=$y({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(NKr,"buildAuthServerEndpoint");function UU(t,e){if(e!==void 0)return NKr(e);{let r=t.get($m),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(UU,"resolveAuthServerEndpoint");function jDt(t){if(!t)return!1;try{return NKr(t),!0}catch{return!1}}a(jDt,"isValidAuthServer");p();p();p();p();p();p();p();p();function IB(t,e){return t||e}a(IB,"_pureAssign");function Wm(t,e){return t[e]}a(Wm,"_pureRef");var pC=void 0,kh=null,nNt="",E7e="function",ube="object",SB="prototype",tNt="__proto__",zW="undefined",m7e="constructor",iNt="Symbol",Qyo="_polyfill",YW="length",g7e="name",AA="call",_7e="toString",ix=IB(Object),oNt=Wm(ix,SB),UKr=IB(String),KW=Wm(UKr,SB),dbe=IB(Math),QKr=IB(Array),v7e=Wm(QKr,SB),TB=Wm(v7e,"slice");function $f(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a($f,"safe");function qyo(t,e){var r=$f(t);return r.e?e:r.v}a(qyo,"safeGet");var HDt;function C7e(t){return function(e){return typeof e===t}}a(C7e,"_createIs");function qKr(t){var e="[object "+t+"]";return function(r){return!!(r&&fbe(r)===e)}}a(qKr,"_createObjIs");function fbe(t){return oNt[_7e].call(t)}a(fbe,"objToString");function Nn(t){return typeof t===zW||t===zW}a(Nn,"isUndefined");function jyo(t){return!Tse(t)}a(jyo,"isStrictUndefined");function Xt(t){return t===kh||Nn(t)}a(Xt,"isNullOrUndefined");function Hyo(t){return t===kh||!Tse(t)}a(Hyo,"isStrictNullOrUndefined");function Tse(t){return!!t||t!==pC}a(Tse,"isDefined");function Gyo(t){return!HDt&&(HDt=["string","number","boolean",zW,"symbol","bigint"]),t!==ube&&HDt.indexOf(t)!==-1}a(Gyo,"isPrimitiveType");var Ei=C7e("string"),Or=C7e(E7e);function Gu(t){return!t&&Xt(t)?!1:!!t&&typeof t===ube}a(Gu,"isObject");var ur=Wm(QKr,"isArray"),b7e=qKr("Date"),Dh=C7e("number"),Wk=C7e("boolean");var xB=qKr("Error");function tg(t){return!!(t&&t.then&&Or(t.then))}a(tg,"isPromiseLike");function W1(t){return!(!t||qyo(function(){return!(t&&0+t)},!t))}a(W1,"isTruthy");var Ise=Wm(ix,"getOwnPropertyDescriptor");function rg(t,e){return!!t&&oNt.hasOwnProperty[AA](t,e)}a(rg,"objHasOwnProperty");var yA=IB(Wm(ix,"hasOwn"),$yo);function $yo(t,e){return rg(t,e)||!!Ise(t,e)}a($yo,"polyObjHasOwn");function Yr(t,e,r){if(t&&Gu(t)){for(var n in t)if(yA(t,n)&&e[AA](r||t,n,t[n])===-1)break}}a(Yr,"objForEachKey");var f7e={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function Vyo(t){var e={};if(e[f7e.c]=!0,e[f7e.e]=!0,t.l){e.get=function(){return t.l.v};var r=Ise(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return Yr(t,function(n,o){e[f7e[n]]=jyo(o)?e[f7e[n]]:o}),e}a(Vyo,"_createProp");var S_=Wm(ix,"defineProperty"),jKr=Wm(ix,"defineProperties");function ji(t,e,r){return S_(t,e,Vyo(r))}a(ji,"objDefine");function HKr(t,e,r,n,o){var s={};return Yr(t,function(c,l){A7e(s,c,e?l:c),A7e(s,l,r?l:c)}),n?n(s):s}a(HKr,"_createKeyValueMap");function A7e(t,e,r,n){S_(t,e,{value:r,enumerable:!0,writable:!1})}a(A7e,"_assignMapValue");var Hu=IB(UKr),Wyo="[object Error]";function dr(t,e){var r=nNt,n=oNt[_7e][AA](t);n===Wyo&&(t={stack:Hu(t.stack),message:Hu(t.message),name:Hu(t.name)});try{r=JSON.stringify(t,kh,e?typeof e=="number"?e:4:pC),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):kh)||Hu(t)}catch(o){r=" - "+dr(o,e)}return n+": "+r}a(dr,"dumpObj");function Zc(t){throw new Error(t)}a(Zc,"throwError");function zm(t){throw new TypeError(t)}a(zm,"throwTypeError");var GKr=Wm(ix,"freeze");function zyo(t){return t}a(zyo,"_doNothing");function Yyo(t){return t[tNt]||kh}a(Yyo,"_getProto");var wB=Wm(ix,"assign"),$u=Wm(ix,"keys");function T_(t){return GKr&&Yr(t,function(e,r){(ur(r)||Gu(r))&&T_(r)}),Nh(t)}a(T_,"objDeepFreeze");var Nh=IB(GKr,zyo);var rNt=IB(Wm(ix,"getPrototypeOf"),Yyo);function S7e(t){return HKr(t,1,0,Nh)}a(S7e,"createEnum");function Kyo(t){return HKr(t,0,0,Nh)}a(Kyo,"createEnumKeyMap");function Jyo(t){var e={};return Yr(t,function(r,n){A7e(e,r,n[1]),A7e(e,n[0],n[1])}),Nh(e)}a(Jyo,"createSimpleMap");function sNt(t){return Jyo(t)}a(sNt,"createTypeMap");var $Kr=Kyo({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}),MKr="__tsUtils$gblCfg",GDt;function VKr(){var t;return typeof globalThis!==zW&&(t=globalThis),!t&&typeof self!==zW&&(t=self),!t&&typeof window!==zW&&(t=window),!t&&typeof global!==zW&&(t=global),t}a(VKr,"_getGlobalValue");function WKr(){if(!GDt){var t=$f(VKr).v||{};GDt=t[MKr]=t[MKr]||{}}return GDt}a(WKr,"_getGlobalConfig");var xse=pbe;function pbe(t,e,r){var n=e?e[t]:kh;return function(o){var s=(o?o[t]:kh)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?TB[AA](c,1):c)}zm('"'+Hu(t)+'" not defined for '+dr(o))}}a(pbe,"_unwrapFunctionWithPoly");function Zyo(t){return function(e){return e[t]}}a(Zyo,"_unwrapProp");var QU=Wm(dbe,"min"),zk=Wm(dbe,"max"),OKr=xse("slice",KW),Vf=xse("substring",KW),T7e=pbe("substr",KW,Xyo);function Xyo(t,e,r){return Xt(t)&&zm("Invalid "+dr(t)),r<0?nNt:(e=e||0,e<0&&(e=zk(e+t[YW],0)),Nn(r)?OKr(t,e):OKr(t,e,e+r))}a(Xyo,"polyStrSubstr");function cM(t,e){return Vf(t,0,e)}a(cM,"strLeft");var LKr="_urid",$Dt;function eEo(){if(!$Dt){var t=WKr();$Dt=t.gblSym=t.gblSym||{k:{},s:{}}}return $Dt}a(eEo,"_globalSymbolRegistry");var p7e;function aNt(t){var e={description:Hu(t),toString:a(function(){return iNt+"("+t+")"},"toString")};return e[Qyo]=!0,e}a(aNt,"polyNewSymbol");function tEo(t){var e=eEo();if(!yA(e.k,t)){var r=aNt(t),n=$u(e.s).length;r[LKr]=function(){return n+"_"+r[_7e]()},e.k[t]=r,e.s[r[LKr]()]=Hu(t)}return e.k[t]}a(tEo,"polySymbolFor");function rEo(t){!p7e&&(p7e={});var e,r=$Kr[t];return r&&(e=p7e[r]=p7e[r]||aNt(iNt+"."+r)),e}a(rEo,"polyGetKnownSymbol");var Ph;function qU(){Ph=WKr()}a(qU,"_initTestHooks");function I7e(t){var e={};return!Ph&&qU(),e.b=Ph.lzy,S_(e,"v",{configurable:!0,get:a(function(){var r=t();return Ph.lzy||S_(e,"v",{value:r}),e.b=Ph.lzy,r},"get")}),e}a(I7e,"getLazy");function z1(t){return S_({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(z1,"createCachedValue");var zKr="window",lbe;function x7e(t,e){var r;return function(){return!Ph&&qU(),(!r||Ph.lzy)&&(r=z1($f(t,e).v)),r.v}}a(x7e,"_getGlobalInstFn");function Vy(t){return!Ph&&qU(),(!lbe||t===!1||Ph.lzy)&&(lbe=z1($f(VKr).v||kh)),lbe.v}a(Vy,"getGlobal");function Di(t,e){var r;if(!lbe||e===!1?r=Vy(e):r=lbe.v,r&&r[t])return r[t];if(t===zKr)try{return window}catch{}return kh}a(Di,"getInst");function RB(){return!!df()}a(RB,"hasDocument");var df=x7e(Di,["document"]);function wse(){return!!ff()}a(wse,"hasWindow");var ff=x7e(Di,[zKr]);function JW(){return!!Vu()}a(JW,"hasNavigator");var Vu=x7e(Di,["navigator"]);var YKr=x7e(function(){return!!$f(function(){return process&&(process.versions||{}).node}).v});var Sse,VDt;function w7e(){return Sse=z1($f(Di,[iNt]).v),Sse}a(w7e,"_initSymbol");function nEo(t){var e=(Ph.lzy?0:Sse)||w7e();return e.v?e.v[t]:pC}a(nEo,"_getSymbolKey");function KKr(){return!!iEo()}a(KKr,"hasSymbol");function iEo(){return!Ph&&qU(),((Ph.lzy?0:Sse)||w7e()).v}a(iEo,"getSymbol");function hbe(t,e){var r=$Kr[t];!Ph&&qU();var n=(Ph.lzy?0:Sse)||w7e();return n.v?n.v[r||t]:e?pC:rEo(t)}a(hbe,"getKnownSymbol");function ox(t,e){!Ph&&qU();var r=(Ph.lzy?0:Sse)||w7e();return r.v?r.v(t):e?kh:aNt(t)}a(ox,"newSymbol");function jU(t){return!Ph&&qU(),VDt=(Ph.lzy?0:VDt)||z1($f(nEo,["for"]).v),(VDt.v||tEo)(t)}a(jU,"symbolFor");function y7e(t){return!!t&&Or(t.next)}a(y7e,"isIterator");function cNt(t){return!Hyo(t)&&Or(t[hbe(3)])}a(cNt,"isIterable");var h7e;function R7e(t,e,r){if(t&&(y7e(t)||(!h7e&&(h7e=z1(hbe(3))),t=t[h7e.v]?t[h7e.v]():kh),y7e(t))){var n=pC,o=pC;try{for(var s=0;!(o=t.next()).done&&e[AA](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=kh,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(R7e,"iterForOf");function bse(t,e,r){return t.apply(e,r)}a(bse,"fnApply");function Mh(t,e){return!Nn(e)&&t&&(ur(e)?bse(t.push,t,e):y7e(e)||cNt(e)?R7e(e,function(r){t.push(r)}):t.push(e)),t}a(Mh,"arrAppend");function Ct(t,e,r){if(t)for(var n=t[YW]>>>0,o=0;o0?r:0;return Vf(t,o,o+n[YW])===n}a(EEo,"polyStrStartsWith");var ZDt="ref",XDt="unref",eNt="hasRef",_Eo="enabled";function vEo(t,e,r){var n=!0,o=t?e(kh):kh,s;function c(){return n=!1,o&&o[XDt]&&o[XDt](),s}a(c,"_unref");function l(){o&&r(o),o=kh}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[eNt]=function(){return o&&o[eNt]?o[eNt]():n},s[ZDt]=function(){return n=!0,o&&o[ZDt]&&o[ZDt](),s},s[XDt]=c,s=S_(s,_Eo,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=kh},"dn")}}a(vEo,"_createTimerHandler");function uNt(t,e,r){var n=ur(e),o=n?e.length:0,s=(o>0?e[0]:n?pC:e)||setTimeout,c=(o>1?e[1]:pC)||clearTimeout,l=r[0];r[0]=function(){u.dn(),bse(l,pC,TB[AA](arguments))};var u=vEo(t,function(d){if(d){if(d.refresh)return d.refresh(),d;bse(c,pC,[d])}return bse(s,pC,r)},function(d){bse(c,pC,[d])});return u.h}a(uNt,"_createTimeoutWith");function Up(t,e){return uNt(!0,pC,TB[AA](arguments))}a(Up,"scheduleTimeout");function rJr(t,e,r){return uNt(!0,t,TB[AA](arguments,1))}a(rJr,"scheduleTimeoutWith");function k7e(t,e){return uNt(!1,pC,TB[AA](arguments))}a(k7e,"createTimeout");var Ebe=S7e,dNt=sNt;p();var Yk=Ebe({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Kk="toLowerCase",dn="length",Pse="warnToConsole",DB="throwInternal",uM="watch",GU="apply",Fi="push",sx="splice",Wu="logger",dM="cancel",NB="initialize",fM="identifier",Dse="removeNotificationListener",Nse="addNotificationListener",hC="isInitialized",_be="getNotifyMgr",$U="getPlugin",K1="name",Ym="processNext",P7e="getProcessTelContext",MB="value",VU="enabled",fNt="stopPollingInternalLogs",ax="unload",vbe="onComplete",D7e="version",N7e="loggingLevelConsole",pM="createNew",J1="teardown",Mse="messageId",hM="message",mC="diagLog",WU="_doTeardown",XW="update",Z1="getNext",zU="setNextPlugin",Cbe="userAgent",cx="split",Jk="replace",bbe="substring",Sbe="indexOf",OB="type",pNt="evtName",Zk="status",hNt="getAllResponseHeaders",Tbe="isChildEvt",X1="data",ez="getCtx",Xk="setCtx",mNt="itemsReceived",Ibe="headers",Ose="urlString",tz="timeout";var M7e="traceFlags";var gNt;function nJr(t,e){gNt||(gNt=gbe("AggregationError",function(n,o){o[dn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` -`.concat(o," > ").concat(dr(n))}),new gNt(r,e||[])}a(nJr,"throwAggregationError");p();p();p();var Lse="function",lx="object",eS="undefined",tS="prototype";var YU=Object,xbe=YU[tS];p();var XRl=(Vy()||{}).Symbol,ekl=(Vy()||{}).Reflect;var iJr="hasOwnProperty",bEo=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(wNt,"_hasVisited");function IEo(t,e,r,n){function o(u,d,f){var h=d[f];if(h[_Nt]&&n){var m=u[q7e]||{};m[wbe]!==!1&&(h=(m[d[Bse]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=lM(null);j7e(r,function(u){s[u]=o(e,r,u)});for(var c=nz(t),l=[];c&&!INt(c)&&!wNt(l,c);)j7e(c,function(u){!s[u]&&xNt(c,u,!Rbe)&&(s[u]=o(e,c,u))}),l.push(c),c=nz(c);return s}a(IEo,"_getBaseFuncs");function xEo(t,e,r,n){var o=null;if(t&&rg(r,Bse)){var s=t[q7e]||lM(null);if(o=(s[r[Bse]]||lM(null))[e],o||H7e("Missing ["+e+"] "+Q7e),!o[vNt]&&s[wbe]!==!1){for(var c=!rg(t,e),l=nz(t),u=[];c&&l&&!INt(l)&&!wNt(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=nz(l)}try{c&&(t[e]=o),o[vNt]=1}catch{s[wbe]=!1}}}return o}a(xEo,"_getInstFunc");function wEo(t,e,r){var n=e[t];return n===r&&(n=nz(e)[t]),typeof n!==Q7e&&H7e("["+t+"] is not a "+Q7e),n}a(wEo,"_getProtoFunc");function REo(t,e,r,n,o){function s(u,d){var f=a(function(){var h=xEo(this,d,u,f)||wEo(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[_Nt]=1,f}if(a(s,"_createDynamicPrototype"),!F7e(t)){var c=r[q7e]=r[q7e]||lM(null);if(!F7e(c)){var l=c[e]=c[e]||lM(null);c[wbe]!==!1&&(c[wbe]=!!o),F7e(l)||j7e(r,function(u){xNt(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!rg(t,u)||t[u]&&!t[u][_Nt])&&(t[u]=s(t,u)))})}}}a(REo,"_populatePrototype");function kEo(t,e){if(Rbe){for(var r=[],n=nz(e);n&&!INt(n)&&!wNt(r,n);){if(n===t)return!0;r.push(n),n=nz(n)}return!1}return!0}a(kEo,"_checkPrototype");function ENt(t,e){return rg(t,LB)?t.name||e||oJr:((t||{})[U7e]||{}).name||e||oJr}a(ENt,"_getObjName");function Si(t,e,r,n){rg(t,LB)||H7e("theClass is an invalid class definition.");var o=t[LB];kEo(o,e)||H7e("["+ENt(t)+"] not in hierarchy of ["+ENt(e)+"]");var s=null;rg(o,Bse)?s=o[Bse]:(s=SEo+ENt(t,"_")+"$"+bNt.n,bNt.n++,o[Bse]=s);var c=Si[lJr],l=!!c[B7e];l&&n&&n[B7e]!==void 0&&(l=!!n[B7e]);var u=TEo(e),d=IEo(o,e,u,l);r(e,d);var f=!!Rbe&&!!c[CNt];f&&n&&(f=!!n[CNt]),REo(o,s,e,u,f!==!1)}a(Si,"dynamicProto");Si[lJr]=bNt.o;p();var $7e="Promise";var LNt="rejected";function _l(t,e){return V7e(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:LNt,rejected:!0,reason:r}):r})}a(_l,"doAwaitResponse");function V7e(t,e,r,n){var o=t;try{if(tg(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&&PEo(o,n)}return o}a(V7e,"doAwait");function PEo(t,e){var r=t;return e&&(tg(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(PEo,"doFinally");var RNt,kNt,PNt,uJr=!1;function DEo(t,e,r,n){RNt=RNt||{toString:a(function(){return"[[PromiseState]]"},"toString")},kNt=kNt||{toString:a(function(){return"[[PromiseResult]]"},"toString")},PNt=PNt||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[RNt]={get:e},o[kNt]={get:r},o[PNt]={get:n},jKr(t,o)}a(DEo,"_addDebugState$1");var pJr=["pending","resolving","resolved",LNt],dJr="dispatchEvent",G7e;function NEo(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(NEo,"_hasInitEventFn");function MEo(t,e,r,n){var o=df();!G7e&&(G7e=z1(!!$f(NEo,[o]).v));var s=G7e.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),G7e.v&&s.initEvent(e,!1,!0),s&&t[dJr])t[dJr](s);else{var c=t["on"+e];if(c)c(s);else{var l=Di("console");l&&(l.error||l.log)(e,dr(s))}}}a(MEo,"emitEvent");var hJr="unhandledRejection",OEo=hJr.toLowerCase(),kbe=[],LEo=0,BEo=10;var DNt;function fJr(t){return Or(t)?t.toString():dr(t)}a(fJr,"dumpFnObj");function mJr(t,e,r){var n=HU(arguments,3),o=0,s=!1,c,l=[],u=LEo++,d=kbe.length>0?kbe[kbe.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{kbe.push(u),f=!0,h&&h.cancel(),h=null;var x=t(function(P,D){l.push(function(){try{var N=o===2?w:R,L=Nn(N)?c:Or(N)?N(c):N;tg(L)?L.then(P,D):N?P(L):o===3?D(L):P(L)}catch(B){D(B)}}),s&&_()},n);return x}finally{kbe.pop()}}a(g,"_then");function A(w){return g(void 0,w)}a(A,"_catch");function y(w){var R=w,x=w;return Or(w)&&(R=a(function(P){return w&&w(),P},"thenFinally"),x=a(function(P){throw w&&w(),P},"catchFinally")),g(R,x)}a(y,"_finally");function E(){return pJr[o]}a(E,"_strState");function _(){if(l.length>0){var w=l.slice();l=[],f=!0,h&&h.cancel(),h=null,e(w)}}a(_,"_processQueue");function v(w,R){return function(x){if(o===R){if(w===2&&tg(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,_(),!f&&w===3&&!h&&(h=Up(b,BEo))}}}a(v,"_createSettleIfFn");function b(){if(!f)if(f=!0,YKr())process.emit(hJr,c,m);else{var w=ff()||Vy();!DNt&&(DNt=z1($f(Di,[$7e+"RejectionEvent"]).v)),MEo(w,OEo,function(R){return ji(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!DNt.v)}}a(b,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},S_(m,"state",{get:E}),uJr&&DEo(m,E,function(){return fbe(c)},function(){return f}),KKr()&&(m[hbe(11)]="IPromise");function T(){return"IPromise"+(uJr?"["+u+(Nn(d)?"":":"+d)+"]":"")+" "+E()+(s?" - "+fJr(c):"")}return a(T,"_toString"),m.toString=T,a((function(){Or(r)||zm($7e+": executor is not a function - "+fJr(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(mJr,"_createPromise");function FEo(t){return function(e){var r=HU(arguments,1);return t(function(n,o){try{var s=[],c=1;R7e(e,function(l,u){l&&(c++,V7e(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(FEo,"_createAllPromise");function UEo(t){return z1(function(e){var r=HU(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,_l(u,function(f){f.rejected?s[d]={status:LNt,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{ur(e)?Ct(e,l):cNt(e)?R7e(e,l):zm("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(UEo,"_createAllSettledPromise");function gJr(t){Ct(t,function(e){try{e()}catch{}})}a(gJr,"syncItemProcessor");function QEo(t){var e=Dh(t)?t:0;return function(r){Up(function(){gJr(r)},e)}}a(QEo,"timeoutItemProcessor");function AJr(t,e){return mJr(AJr,QEo(e),t,e)}a(AJr,"createAsyncPromise");var NNt;function qEo(t,e){!NNt&&(NNt=z1($f(Di,[$7e]).v||null));var r=NNt.v;if(!r)return AJr(t);Or(t)||zm($7e+": executor is not a function - "+dr(t));var n=0;function o(){return pJr[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 S_(s,"state",{get:o}),s}a(qEo,"createNativePromise");var MNt;function Pbe(t){return mJr(Pbe,gJr,t)}a(Pbe,"createSyncPromise");function W7e(t,e){return!MNt&&(MNt=UEo(Pbe)),MNt.v(t,e)}a(W7e,"createSyncAllSettledPromise");var ONt;function Dd(t,e){return!ONt&&(ONt=z1(qEo)),ONt.v.call(this,t,e)}a(Dd,"createPromise");var z7e=FEo(Dd);var Nkl=hbe(11);p();p();p();p();var rS=void 0,So="",iz="channels",Wf="core",Y7e="createPerfMgr",Dbe="disabled",BB="extensionConfig",oz="extensions",gC="processTelemetry",sz="priority",Fse="eventsSent",KU="eventsDiscarded",Use="eventsSendRequest",mM="perfEvent",K7e="offlineEventsStored",J7e="offlineBatchSent",Z7e="offlineBatchDrop",Qse="getPerfMgr",X7e="domain",eQe="path",yJr="Not dynamic - ",EJr="REDACTED",BNt=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var jEo="getPrototypeOf",HEo=/-([a-z])/g,GEo=/([^\w\d_$])/g,$Eo=/^(\d+[\w\d_$])/,Hkl=Object[jEo];function JU(t){return!Xt(t)}a(JU,"isNotNullOrUndefined");function Nbe(t){var e=t;return e&&Ei(e)&&(e=e[Jk](HEo,function(r,n){return n.toUpperCase()}),e=e[Jk](GEo,"_"),e=e[Jk]($Eo,function(r,n){return"_"+n})),e}a(Nbe,"normalizeJsName");function Km(t,e){return t&&e?lu(t,e)!==-1:!1}a(Km,"strContains");function ZU(t){return t&&t.toISOString()||""}a(ZU,"toISOString");function Qp(t){return xB(t)?t[K1]:So}a(Qp,"getExceptionName");function gM(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(gM,"setValue");function FNt(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(FNt,"getSetValue");function VEo(t,e){var r=null,n=null;return Or(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][GU](n,o)}}a(VEo,"_createProxyFunction");function az(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=VEo(r,n))}a(az,"proxyFunctionAs");function cz(t,e,r,n){return t&&e&&Gu(t)&&ur(r)&&Ct(r,function(o){Ei(o)&&az(t,o,e,o,n)}),t}a(cz,"proxyFunctions");function UNt(t){return(function(){function e(){var r=this;t&&Yr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(UNt,"createClassFromInterface");function rQe(t){return t&&wB&&(t=YU(wB({},t))),t}a(rQe,"optimizeObject");function nQe(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[dn],d=!1,f=1;for(u>0&&Wk(l)&&(d=l,l=c[f]||{},f++),Gu(l)||(l={});f>>=0),Fbe=xJr+t&uz,Ube=wJr-t&uz,RJr=!0}a(s_o,"_mwcSeed");function a_o(){try{var t=El()&2147483647;s_o((Math.random()*IJr^t)+t)}catch{}}a(a_o,"_autoSeedMwc");function TJr(t){var e=0,r=zNt()||YNt();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&uz),e===0&&Hse()&&(RJr||a_o(),e=c_o()&uz),e===0&&(e=Y1(IJr*Math.random()|0)),t||(e>>>=0),e}a(TJr,"random32");function c_o(t){Ube=36969*(Ube&65535)+(Ube>>16)&uz,Fbe=18e3*(Fbe&65535)+(Fbe>>16)&uz;var e=(Ube<<16)+(Fbe&65535)>>>0&uz|0;return t||(e>>>=0),e}a(c_o,"mwcRandom32");function kJr(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=TJr()>>>0,n=0,o=So;o[dn]>>=6,n===5&&(r=(TJr()<<2&4294967295|r&3)>>>0,n=0);return o}a(kJr,"newId");var PJr="3.3.11",l_o="."+kJr(6),u_o=0;function DJr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(DJr,"_canAcceptData");function d_o(t,e){var r=e[t.id];if(!r){r={};try{DJr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(d_o,"_getCache");function nS(t,e){return e===void 0&&(e=!1),Nbe(t+u_o+++(e?"."+PJr:So)+l_o)}a(nS,"createUniqueNamespace");function sQe(t){var e={id:nS("_aiData-"+(t||So)+"."+PJr),accept:a(function(r){return DJr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[Nbe(n)]:(s&&(c=d_o(e,r),c[Nbe(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(sQe,"createElmNodeData");p();function aQe(t){return t&&Gu(t)&&!ur(t)&&(t.isVal||t.fb||yA(t,"v")||yA(t,"mrg")||yA(t,"ref")||t.set)}a(aQe,"_isConfigDefaults");function NJr(t,e,r){var n,o=r.dfVal||Tse;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&nJr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[dn]>0){c||(c=[]),l||(l=Up(function(){l=null,f()},0));for(var A=0;A0?_l(FB(t[0],e),function(){fQe(HU(t,1),e,r)}):r(),n}a(fQe,"doUnloadAll");p();var FJr=500,tMt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function E_o(t,e,r){return!t&&Xt(t)?e:Wk(t)?t:Hu(t)[Kk]()==="true"}a(E_o,"_stringToBoolOrDefault");function rMt(t){return{mrg:!0,v:t}}a(rMt,"cfgDfMerge");function $se(t,e,r){return{fb:r,isVal:t,v:e}}a($se,"cfgDfValidate");function fx(t,e){return{fb:e,set:E_o,v:!!t}}a(fx,"cfgDfBoolean");p();p();var nMt=[Fse,KU,Use,mM],hQe=null,pQe;function __o(t,e){return function(){var r=arguments,n=iMt(e);if(n){var o=n.listener;o&&o[t]&&o[t][GU](o,r)}}}a(__o,"_listenerProxyFunc");function v_o(){var t=Di("Microsoft");return t&&(hQe=t.ApplicationInsights),hQe}a(v_o,"_getExtensionNamespace");function iMt(t){var e=hQe;return!e&&t.disableDbgExt!==!0&&(e=hQe||v_o()),e?e.ChromeDbgExt:null}a(iMt,"getDebugExt");function UJr(t){if(!pQe){pQe={};for(var e=0;e=A&&(d[T](b[hM]),n[w]=!0)}else o>=A&&d[T](b[hM]);f(A,b)}},d.debugToConsole=function(A){oMt("debug",A),g("warning",A)},d[Pse]=function(A){oMt("warn",A),g("warning",A)},d.errorToConsole=function(A){oMt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[ax]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=S_o+y[Mse];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[Fi](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new $be(23,v,!1);d.queue[Fi](b),A===1?d.errorToConsole(v):d[Pse](v)}}}a(f,"_logInternalMessage");function h(A){return dx(Oh(A,T_o,d).cfg,function(y){var E=y.cfg;o=E[N7e],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=iMt(e||{});E&&E[mC]&&E[mC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function jJr(t){return t||new Wse}a(jJr,"_getLogger");function Wr(t,e,r,n,o,s){s===void 0&&(s=!1),jJr(t)[DB](e,r,n,o,s)}a(Wr,"_throwInternal");function UB(t,e){jJr(t)[Pse](e)}a(UB,"_warnToConsole");var sMt,t7,HJr="toGMTString",GJr="toUTCString",uMt="cookie",aMt="expires",$Jr="isCookieUseDisabled",Vbe="disableCookiesUsage",VJr="_ckMgr",mQe=null,cMt=null,WJr=null,yM,zJr={},YJr={},x_o=(sMt={cookieCfg:rMt((t7={},t7[X7e]={fb:"cookieDomain",dfVal:JU},t7.path={fb:"cookiePath",dfVal:JU},t7.enabled=rS,t7.ignoreCookies=rS,t7.blockedCookies=rS,t7.disableCookieDefer=!1,t7)),cookieDomain:rS,cookiePath:rS},sMt[Vbe]=rS,sMt);function dMt(){!yM&&(yM=I7e(function(){return df()}))}a(dMt,"_getDoc");function gQe(t){return t?t.isEnabled():!0}a(gQe,"_isMgrEnabled");function tZr(t,e){return e&&t&&ur(t.ignoreCookies)?Vo(t.ignoreCookies,e)!==-1:!1}a(tZr,"_isIgnoredCookie");function KJr(t,e){return e&&t&&ur(t.blockedCookies)&&Vo(t.blockedCookies,e)!==-1?!0:tZr(t,e)}a(KJr,"_isBlockedCookie");function JJr(t,e){var r=e[VU];if(Xt(r)){var n=void 0;Nn(t[$Jr])||(n=!t[$Jr]),Nn(t[Vbe])||(n=!t[Vbe]),r=n}return r}a(JJr,"_isCfgEnabled");function rZr(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[eQe]=E||"/",_[aMt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return Hse()||(v["max-age"]="0"),XJr(So,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Ni(E||So),R=lu(w,";");if(R!==-1&&(w=Ni(cM(E,R)),T=nZr(Vf(E,R+1))),gM(T,X7e,v||o,W1,Nn),!Xt(_)){var x=Hse();if(Nn(T[aMt])){var P=El(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),gM(T,aMt,ZJr(N,x?HJr:GJr)||ZJr(N,x?HJr:GJr)||So,W1)}}x||gM(T,"max-age",So+_,null,Nn)}var L=Lbe();return L&&L.protocol==="https:"&&(gM(T,"secure",null,null,Nn),cMt===null&&(cMt=!R_o((Vu()||{})[Cbe])),cMt&&gM(T,"SameSite","None",null,Nn)),gM(T,eQe,b||n,null,Nn),XJr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[dn]-1;_>=0;_--)f[_].n===E&&f[sx](_,1)}a(g,"_removePendingCookie");function A(){lMt(e)&&f&&(Ct(f,function(E){KJr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=Oh(t||YJr,null,e).cfg,s=dx(t,function(E){E.setDf(E.cfg,x_o),r=E.ref(E.cfg,"cookieCfg"),n=r[eQe]||"/",o=r[X7e],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=JJr(t,r)!==!1,l=r.getCookie||w_o,u=r.setCookie||eZr,d=r.delCookie||eZr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=JJr(t,r)!==!1&&c&&lMt(e),_=YJr[VJr];return E&&_&&y!==_&&(E=gQe(_)),E},"isEnabled"),setEnabled:a(function(E){r[VU]=E,Nn(t[Vbe])||(t[Vbe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=KJr(r,E);if(!R){var x=m(_,v,b,T);gQe(y)?(u(E,x),w=!0):f&&(g(E),f[Fi]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=So,v=tZr(r,E);if(!v){if(gQe(y))_=l(E);else if(f)for(var b=f[dn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=lu(w,";");_=R!==-1?Ni(cM(w,R)):Ni(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return gQe(y)?v=y.purge(E,_):f&&(g(E),f[Fi]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return lMt(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[VJr]=y,y}a(rZr,"createCookieMgr");function lMt(t){if(mQe===null){mQe=!1,!yM&&dMt();try{var e=yM.v||{};mQe=e[uMt]!==void 0}catch(r){Wr(t,2,68,"Cannot access document.cookie - "+Qp(r),{exception:dr(r)})}}return mQe}a(lMt,"areCookiesSupported");function nZr(t){var e={};if(t&&t[dn]){var r=Ni(t)[cx](";");Ct(r,function(n){if(n=Ni(n||So),n){var o=lu(n,"=");o===-1?e[n]=null:e[Ni(cM(n,o))]=Ni(Vf(n,o+1))}})}return e}a(nZr,"_extractParts");function ZJr(t,e){return Or(t[e])?t[e]():null}a(ZJr,"_formatDate");function XJr(t,e){var r=t||So;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?So:"="+o)}),r}a(XJr,"_formatCookieValue");function w_o(t){var e=So;if(!yM&&dMt(),yM.v){var r=yM.v[uMt]||So;WJr!==r&&(zJr=nZr(r),WJr=r),e=Ni(zJr[t]||So)}return e}a(w_o,"_getCookieValue");function eZr(t,e){!yM&&dMt(),yM.v&&(yM.v[uMt]=t+"="+e)}a(eZr,"_setCookieValue");function R_o(t){return Ei(t)?!!(Km(t,"CPU iPhone OS 12")||Km(t,"iPad; CPU OS 12")||Km(t,"Macintosh; Intel Mac OS X 10_14")&&Km(t,"Version/")&&Km(t,"Safari")||Km(t,"Macintosh; Intel Mac OS X 10_14")&&PB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||Km(t,"Chrome/5")||Km(t,"Chrome/6")||Km(t,"UnrealEngine")&&!Km(t,"Chrome")||Km(t,"UCBrowser/12")||Km(t,"UCBrowser/11")):!1}a(R_o,"uaDisallowsSameSiteNone");p();var k_o={perfEvtsSendAll:!1};function P_o(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){$f(r.fn,[r.arg])})}a(P_o,"_runScheduledListeners");function r7(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[Fi]({fn:n,arg:o}),r.h=r.h||Up(P_o,0,r)):$f(n,[o]))})}a(r7,"_runListeners");var iZr=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Oh(e,k_o);n=c[uM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){ji(l,"listeners",{g:a(function(){return o},"g")}),l[Nse]=function(u){o[Fi](u)},l[Dse]=function(u){for(var d=Vo(o,u);d>-1;)o[sx](d,1),d=Vo(o,u)},l[Fse]=function(u){r7(o,Fse,s,function(d){d[Fse](u)})},l[KU]=function(u,d,f){r7(o,KU,s,function(h){h[KU](u,d,f)})},l[Use]=function(u,d){r7(o,Use,d?s:null,function(f){f[Use](u,d)})},l[mM]=function(u){u&&(r||!u[Tbe]())&&r7(o,mM,null,function(d){u.isAsync?Up(function(){return d[mM](u)},0):d[mM](u)})},l[K7e]=function(u){u&&u[dn]&&r7(o,K7e,s,function(d){d[K7e](u)})},l[J7e]=function(u){u&&u[X1]&&r7(o,J7e,s,function(d){d[J7e](u)})},l[Z7e]=function(u,d){if(u>0){var f=d||0;r7(o,Z7e,s,function(h){h[Z7e](u,f)})}},l[ax]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[dM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(r7(o,"unload",null,function(h){var m=h[ax](u);m&&(f||(f=[]),f[Fi](m))}),f)return Dd(function(h){return _l(z7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var zse="ctx",pMt="ParentContextKey",Wbe="ChildrenContextKey",D_o=null,AQe=(function(){function t(e,r,n){var o=this;if(o.start=El(),o[K1]=e,o.isAsync=n,o[Tbe]=function(){return!1},Or(r)){var s;ji(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[ez]=function(c){return c?c===t[pMt]||c===t[Wbe]?o[c]:(o[zse]||{})[c]:null},o[Xk]=function(c,l){if(c)if(c===t[pMt])o[c]||(o[Tbe]=function(){return!0}),o[c]=l;else if(c===t[Wbe])o[c]=l;else{var u=o[zse]=o[zse]||{};u[c]=l}},o.complete=function(){var c=0,l=o[ez](t[Wbe]);if(ur(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Wr(r[Wu],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[BB];!_&&A&&(_={}),E[BB]=_,_=e.ref(E,BB),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Yr(A,function(E,_){if(Xt(y[E])){var v=e.cfg[E];(v||!Xt(v))&&(y[E]=v)}Qbe(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 _&&(_[A]||!Xt(_[A]))?E=_[A]:(v[A]||!Xt(v[A]))&&(E=v[A]),E||!Xt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[$U]();y&&g(y)}}return a(m,"_iterateChain"),c}a(AMt,"_createInternalContext");function eP(t,e,r,n){var o=Oh(e),s=AMt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[gC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=n7(d,o.cfg,r,f)),eP(d||c[Z1](),o.cfg,r,f)}return a(u,"_createNew"),c[Ym]=l,c[pM]=u,c}a(eP,"createProcessTelemetryContext");function Yse(t,e,r){var n=Oh(e.config),o=AMt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[ax](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=n7(u,n.cfg,e,d)),Yse(u||s[Z1](),e,d)}return a(l,"_createNew"),s[Ym]=c,s[pM]=l,s}a(Yse,"createProcessTelemetryUnloadContext");function zbe(t,e,r){var n=Oh(e.config),o=AMt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[XW])&&d[XW](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=n7(u,n.cfg,e,d)),zbe(u||s[Z1](),e,d)}return a(l,"_createNew"),s[Ym]=c,s[pM]=l,s}a(zbe,"createProcessTelemetryUpdateContext");function n7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[dn]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[gC])){var u=F_o(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?n7([n],e,r):o}a(n7,"createTelemetryProxyChain");function F_o(t,e,r){var n=null,o=Or(t[gC]),s=Or(t[zU]),c;t?c=t[fM]+"-"+t[sz]+"-"+dZr++:c="Unknown-0-"+dZr++;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&&Or(t[uZr])&&(g=t[uZr]()),g||(g=eP(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[fM]:L_o,T=g[lZr];return T||(T=g[lZr]={}),g.setNext(n),t&&yQe(g[Wf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:So;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Wr(g[mC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=QB(t);return _[J1]||_[Dbe]?!1:(s&&t[zU](n),t[gC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[Ym](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=QB(t),v=t[Wf]||_[Wf];t&&(!v||v===g.core())&&!_[J1]&&(_[Wf]=null,_[J1]=!0,_[hC]=!1,t[J1]&&t[J1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[Ym](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=QB(t),v=t[Wf]||_[Wf];t&&(!v||v===g.core())&&!_[J1]&&t[XW]&&t[XW](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[Ym](A)}return a(m,"_updatePlugin"),Nh(l)}a(F_o,"createTelemetryPluginProxy");var U_o=(function(){function t(e,r,n,o){var s=this,c=eP(e,r,n,o);cz(s,c,$u(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function _Qe(){var t=[];function e(n){n&&t[Fi](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Wr(n[mC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(_Qe,"createUnloadHandlerContainer");p();var vQe,CQe;function bQe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Wr(n,2,73,"Unloading:"+dr(c))}}),vQe&&o[dn]>vQe&&(CQe?CQe("doUnload",o):Wr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Mh(t,n),vQe&&t[dn]>vQe&&(CQe?CQe("Add",t):Wr(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(bQe,"createUnloadHookContainer");var yMt,i7="getPlugin",Q_o=(yMt={},yMt[BB]={isVal:JU,v:{}},yMt),Ybe=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[NB]=function(h,m,g,A){u(h,m,A),r=!0},f[J1]=function(h,m){var g=f[Wf];if(!g||h&&g!==h[Wf]())return;var A,y=!1,E=h||Yse(null,g,o&&o[i7]?o[i7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[mC]()),A===!0&&E[Ym](_),d())}return a(v,"_unloadCallback"),!f[WU]||f[WU](E,_,v)!==!0?v():A=!0,A},f[XW]=function(h,m){var g=f[Wf];if(!g||h&&g!==h[Wf]())return;var A,y=!1,E=h||zbe(null,g,o&&o[i7]?o[i7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[Z1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},az(f,"_addUnloadCb",function(){return s},"add"),az(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[mC]=function(f){return l(f)[mC]()},e[hC]=function(){return r},e.setInitialized=function(f){r=f},e[zU]=function(f){o=f},e[Ym]=function(f,h){h?h[Ym](f):o&&Or(o[gC])&&o[gC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||eP(null,{},e[Wf]);o&&o[i7]?h=m[pM](null,o[i7]):h=m[pM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Oh(f,Q_o,dz(h)),!m&&h&&(m=h[P7e]()[Z1]());var g=o;o&&o[i7]&&(g=o[i7]()),e[Wf]=h,n=eP(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Wf]=null,n=null,o=null,c=bQe(),s=_Qe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function q_o(t,e,r){var n={id:e,fn:r};Mh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[sx](c,1),-1})},"remove")};return o}a(q_o,"_addInitializer");function j_o(t,e,r){for(var n=!1,o=t[dn],s=0;s"},"v")})}a(Z_o,"_createUnloadHook");var vMt=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[hC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[NB]=function(ne,ce,Ne,we){g&&Zc(pZr),U[hC]()&&Zc("Core cannot be initialized more than once"),e=Oh(ne,EMt,Ne||U[Wu],!1),ne=e.cfg,qe(e[uM](function(st){var _t=st.cfg;B=_t.initInMemoMaxSize||$_o,Y(_t);var Dt=st.ref(st.cfg,BB);Yr(Dt,function($t){st.ref(Dt,$t)})})),s=we,b=J_o(e,v,s&&U[_be](),b),K(),U[Wu]=Ne;var Be=ne[oz];if(f=[],f[Fi].apply(f,rz(rz([],ce,!1),Be,!1)),h=ne[iz],Le(null),(!m||m[dn]===0)&&Zc("No "+iz+" available"),h&&h[dn]>1){var rt=U[$U]("TeeChannelController");(!rt||!rt.plugin)&&Wr(n,1,28,"TeeChannel required")}K_o(ne,R,n),R=null,r=!0,N===Yk.ACTIVE&&z()},U.getChannels=function(){var ne=[];return m&&Ct(m,function(ce){ne[Fi](ce)}),Nh(ne)},U.track=function(ne){yQe(U[Qse](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ue(ne),Zc("Invalid telemetry item")),!ne[K1]&&Xt(ne[K1])&&(ue(ne),Zc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||ZU(new Date),ne.ver=ne.ver||"4.0",!g&&U[hC]()&&N===Yk.ACTIVE?le()[Ym](ne):N!==Yk.INACTIVE&&o[dn]<=B&&o[Fi](ne)},function(){return{item:ne}},!ne.sync)},U[P7e]=le,U[_be]=function(){return s||(s=new iZr(e.cfg),U[H_o]=s),s},U[Nse]=function(ne){U.getNotifyMgr()[Nse](ne)},U[Dse]=function(ne){s&&s[Dse](ne)},U.getCookieMgr=function(){return u||(u=rZr(e.cfg,U[Wu])),u},U.setCookieMgr=function(ne){u!==ne&&(FB(u,!1),u=ne)},U[Qse]=function(){return c||l||sZr()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[dn]},U.releaseQueue=function(){if(r&&o[dn]>0){var ne=o;o=[],N===2?Ct(ne,function(ce){ce.iKey=ce.iKey||w,le()[Ym](ce)}):Wr(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,Q=!1,O&&O[dM](),ie(!0)};function Y(ne){var ce=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ce)){w=null,N=Yk.INACTIVE;var we="Please provide instrumentation key";r?(Wr(n,1,100,we),z()):Zc(we);return}var Be=[];tg(ce)?(Be[Fi](ce),w=null):w=ce,tg(Ne)?(Be[Fi](Ne),L=null):L=Ne,Be[dn]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ce){q=!1,N=3;var Ne=JU(ne.initTimeOut)?ne.initTimeOut:V_o,we=W7e(ce);M&&M[dM](),M=Up(function(){M=null,q||V()},Ne),_l(we,function(Be){try{if(q)return;if(!Be.rejected){var rt=Be[MB];if(rt&&rt[dn]){var st=rt[0];if(w=st&&st[MB],rt[dn]>1){var _t=rt[1];L=_t&&_t[MB]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=Yk.INACTIVE,Wr(n,1,112,"ikey can't be resolved from promises")):N=Yk.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[VU])&&!Q){var ce=ne||n&&n.queue[dn]>0;ce&&(j||(j=!0,qe(e[uM](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[VU],O[dM]()),O=k7e(X,we),O.unref(),O[VU]=Be}))),O[VU]=!0)}return O}a(ie,"_startLogPoller"),U[fNt]=function(){Q=!0,O&&O[dM](),X()},cz(U,function(){return A},["addTelemetryInitializer"]),U[ax]=function(ne,ce,Ne){ne===void 0&&(ne=!0),r||Zc(G_o),g&&Zc(pZr);var we={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ce&&(Be=Dd(function(_t){ce=_t}));var rt=Yse(Ue(),U);rt[vbe](function(){v.run(U[Wu]),fQe([u,s,n],ne,function(){re(),ce&&ce(we)})},U);function st(_t){we.flushComplete=_t,g=!0,_.run(rt,we),U[fNt](),rt[Ym](we)}return a(st,"_doUnload"),X(),ee(ne,st,6,Ne)||st(!1),Be},U[$U]=ge,U.addPlugin=function(ne,ce,Ne,we){if(!ne){we&&we(!1),Z(gZr);return}var Be=ge(ne[fM]);if(Be&&!ce){we&&we(!1),Z("Plugin ["+ne[fM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[Fi](ne),rt.added=[ne],Le(rt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var _t=[Be.plugin],Dt={reason:2,isAsync:!!Ne};ke(_t,Dt,function($t){$t?(rt.removed=_t,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ne,ce){ce===void 0&&(ce=!0);var Ne;if(U[hC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Rse({},e.cfg),newConfig:Rse({},ne),merge:ce},ne=Ne.newConfig;var we=e.cfg;ne[oz]=we[oz],ne[iz]=we[iz]}e._block(function(Be){var rt=Be.cfg;_Mt(Be,rt,ne,ce),ce||Yr(rt,function(st){yA(ne,st)||Be.set(rt,st,rS)}),Be.setDf(rt,EMt)},!0),e.notify(),Ne&&he(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ne){return T||(T=cZr()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=qe,az(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var ce;return r?ce=dx(e.cfg,ne,U[Wu]):ce=Y_o(R,ne),Z_o(ce)},U.getWParam=function(){return RB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ce=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[fM]&&we[D7e]&&!ne[we.identifier]){var Be=we[fM]+"="+we[D7e];P[Fi](Be),ne[we.identifier]=we}})},"_addPluginVersions");ce(m),h&&Ct(h,function(Ne){ce(Ne)}),ce(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Oh({},EMt,U[Wu]),e.cfg[N7e]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ce){U.updateCfg(ce,!1)},"s")}),ji(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),ji(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||So},"g")}),ji(U,"logger",{g:a(function(){return n||(n=new Wse(e.cfg),e[Wu]=n),n},"g"),s:a(function(ce){e[Wu]=ce,n!==ce&&(FB(n,!1),n=ce)},"s")}),U[Wu]=new Wse(e.cfg),x=[];var ne=U.config[oz]||[];ne.splice(0,ne[dn]),Mh(ne,x),A=new fZr,o=[],FB(s,!1),s=null,c=null,l=null,FB(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=nS("AIBaseCore",!0),_=_Qe(),T=null,w=null,v=bQe(),R=[],D=null,P=null,Q=!1,O=null,j=!1,N=0,L=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=eP(Ue(),e.cfg,U);return ne[vbe](ie),ne}a(le,"_createTelCtx");function Le(ne){var ce=z_o(U[Wu],FJr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=EQe(Mh(m,ce[iz]));var Ne=Mh(EQe(ce[Wf]),m);x=Nh(Ne);var we=U.config[oz]||[];we.splice(0,we[dn]),Mh(we,x);var Be=le();m&&m[dn]>0&&gMt(Be[pM](m),Ne),gMt(Be,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ce=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[fM]===ne&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[Fi](Be)}),!Ne&&we[dn]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ne),!Ne)return-1}),Ne&&(ce={plugin:Ne,setEnabled:a(function(Be){QB(Ne)[Dbe]=!Be},"setEnabled"),isEnabled:a(function(){var Be=QB(Ne);return!Be[J1]&&!Be[Dbe]},"isEnabled"),remove:a(function(Be,rt){Be===void 0&&(Be=!0);var st=[Ne],_t={reason:1,isAsync:Be};ke(st,_t,function(Dt){Dt&&Le({reason:32,removed:st}),rt&&rt(Dt)})},"remove")}),ce}a(ge,"_getPlugin");function Ue(){if(!d){var ne=(x||[]).slice();Vo(ne,A)===-1&&ne[Fi](A),d=n7(EQe(ne),e.cfg,U)}return d}a(Ue,"_getPluginChain");function ke(ne,ce,Ne){if(ne&&ne[dn]>0){var we=n7(ne,e.cfg,U),Be=Yse(we,U);Be[vbe](function(){var rt=!1,st=[];Ct(f,function(Dt,$t){hZr(Dt,ne)?rt=!0:st[Fi](Dt)}),f=st,D=null,P=null;var _t=[];h&&(Ct(h,function(Dt,$t){var Gt=[];Ct(Dt,function(Ie){hZr(Ie,ne)?rt=!0:Gt[Fi](Ie)}),_t[Fi](Gt)}),h=_t),Ne&&Ne(rt),ie()}),Be[Ym](ce)}else Ne(!1)}a(ke,"_removePlugins");function X(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[dn]=0,Ct(ne,function(ce){var Ne={name:y||"InternalMessageId: "+ce[Mse],iKey:w,time:ZU(new Date),baseType:$be.dataType,baseData:{message:ce[hM]}};U.track(Ne)})}}a(X,"_flushInternalLogs");function ee(ne,ce,Ne,we){var Be=1,rt=!1,st=null;we=we||5e3;function _t(){Be--,rt&&Be===0&&(st&&st[dM](),st=null,ce&&ce(rt),ce=null)}if(a(_t,"doCallback"),m&&m[dn]>0){var Dt=le()[pM](m);Dt.iterate(function($t){if($t.flush){Be++;var Gt=!1;$t.flush(ne,function(){Gt=!0,_t()},Ne)||Gt||(ne&&st==null?st=Up(function(){st=null,_t()},we):_t())}})}return rt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[uM](function(ce){var Ne=ce.cfg.enablePerfMgr;if(Ne){var we=ce.cfg[Y7e];(ne!==we||!ne)&&(we||(we=W_o),FNt(ce.cfg,Y7e,we),ne=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[_be]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ce=zbe(Ue(),U);ce[vbe](ie),(!U._updateHook||U._updateHook(ce,ne)!==!0)&&ce[Ym](ne)}a(he,"_doUpdate");function Z(ne){var ce=U[Wu];ce?(Wr(ce,2,73,ne),ie()):Zc(ne)}a(Z,"_logOrThrowError");function ue(ne){var ce=U[_be]();ce&&ce[KU]([ne],2)}a(ue,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function Kbe(t,e){try{if(t&&t!==""){var r=I_().parse(t);if(r&&r[mNt]&&r[mNt]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[dn])return r}}catch(n){Wr(e,1,43,"Cannot parse the response. "+(n[K1]||dr(n)),{response:t})}return null}a(Kbe,"parseResponse");p();var tP="",X_o="NoResponseBody",AZr="&"+X_o+"=true",CMt="POST",bMt=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;q(),E[NB]=function(M,O){o=O,n&&Wr(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.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 O=Lbe();O&&O.protocol&&O.protocol[Kk]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[dn]?R(M,O):null},E.getFallbackInst=function(){return d},E[WU]=function(M,O){q()},E.preparePayload=function(M,O,j,Q){if(!O||Q||!j[X1]){M(j);return}try{var U=Di("CompressionStream");if(!Or(U)){M(j);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(Ei(j[X1])?new TextEncoder().encode(j[X1]):j[X1]),re.close()},"start")}),W=Y.pipeThrough(new U("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return _l(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[MB];if(!Le.done)return z[Fi](Le[MB]),ie+=Le.value[dn],_l(V.read(),re);for(var ge=new Uint8Array(ie),Ue=0,ke=0,X=z;ke0&&(Ct($u(ge),function(K){H.append(K,ge[K])}),Ue[Ibe]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),j&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(U+=AZr)):le=!0);var ke=new Request(U,Ue);try{ke[tMt]=!0}catch{}if(!j&&r&&(V=Dd(function(K,he){z=K,ie=he})),!U){w(O),z&&z(!1);return}function X(K,he){he?x(O,s?0:he,{},s?tP:K):x(O,s?0:400,{},s?tP:K)}a(X,"_handleError");function ee(K,he,Z){var ue=K[Zk],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,Z||tP,he):x(O,ue,{},Z||tP)}a(ee,"_onFetchComplete");try{_l(fetch(s?U:ke,s?Ue:null),function(K){if(j&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)X(K.reason&&K.reason[hM],499),ie&&ie(K.reason);else{var he=K[MB];try{!s&&!he.ok?(he[Zk]?X(he.statusText,he[Zk]):X(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,tP),z&&z(!0)):_l(he.text(),function(Z){ee(he,M,Z[MB]),z&&z(!0)})}catch(Z){he&&he[Zk]?X(dr(Z),he[Zk]):X(dr(Z),499),ie&&ie(Z)}}})}catch(K){Le||(X(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[tz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[tz]),V}a(L,"_doFetchSender");function B(M,O,j){var Q=ff(),U=new XDomainRequest,Y=M[X1];U.onload=function(){var H=qse(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?tP:Mbe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",V=M[Ose];if(!V){w(O);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.";Wr(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[Jk](/^(https?:)/,"");U.open(CMt,ie),M[tz]&&(U[tz]=M[tz]),U.send(Y),s&&j?y&&y.set(function(){U.send(Y)},0):U.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 SZr="on",yZr="attachEvent",EZr="addEventListener",_Zr="detachEvent",vZr="removeEventListener",SMt="events";var JNl=nS("aiEvtPageHide"),ZNl=nS("aiEvtPageShow"),evo=/\.[\.]+/g,tvo=/[\.]+$/,rvo=1,SQe=sQe("events"),nvo=/^([^.]*)(?:\.(.+)|)/;function CZr(t){return t&&t[Jk]?t[Jk](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,So):t}a(CZr,"_normalizeNamespace");function TMt(t,e){if(e){var r=So;ur(e)?(r=So,Ct(e,function(o){o=CZr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=CZr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||So)+r)}var n=nvo.exec(t||So)||[];return{type:n[1],ns:(n[2]||So).replace(evo,".").replace(tvo,So)[cx](".").sort().join(".")}}a(TMt,"_getEvtNamespace");function TZr(t,e,r){r===void 0&&(r=!0);var n=SQe.get(t,SMt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(TZr,"_getRegisteredEvents");function IZr(t,e,r,n){t&&e&&e[OB]&&(t[vZr]?t[vZr](e[OB],r,n):t[_Zr]&&t[_Zr](SZr+e[OB],r))}a(IZr,"_doDetach");function ivo(t,e,r,n){var o=!1;return t&&e&&e[OB]&&r&&(t[EZr]?(t[EZr](e[OB],r,n),o=!0):t[yZr]&&(t[yZr](SZr+e[OB],r),o=!0)),o}a(ivo,"_doAttach");function bZr(t,e,r,n){for(var o=e[dn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[pNt].ns)&&(!n||n(s))&&(IZr(t,s[pNt],s.handler,s.capture),e[sx](o,1))}}a(bZr,"_doUnregister");function ovo(t,e,r){if(e[OB])bZr(t,TZr(t,e[OB]),e,r);else{var n=SQe.get(t,SMt,{});Yr(n,function(o,s){bZr(t,s,e,r)}),$u(n)[dn]===0&&SQe.kill(t,SMt)}}a(ovo,"_unregisterEvents");function Jbe(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=TMt("xx",r).ns[cx](".")):r=t,r}a(Jbe,"mergeEvtNamespace");function TQe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=TMt(e,n);if(s=ivo(t,c,r,o),s&&SQe.accept(t)){var l={guid:rvo++,evtName:c,handler:r,capture:o};TZr(t,c.type)[Fi](l)}}catch{}return s}a(TQe,"eventOn");function IMt(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=TMt(e,n),c=!1;ovo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||IZr(t,s,r,o)}catch{}}a(IMt,"eventOff");p();var Zbe="sampleRate",Xbe="ProcessLegacy",IQe="http.method",fz="https://dc.services.visualstudio.com",EM="/v2/track",zy="not_specified";p();var xQe=dNt({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 pz="split",mo="length",hz="toLowerCase",s7="ingestionendpoint",a7="toString",xMt="removeItem",Kse="message",NZr="count";var e1e="stringify",t1e="pathname",mz="match";var Yy="name";var EA="properties",Ky="measurements",r1e="sizeInBytes",n1e="typeName",Jse="exceptions",gz="severityLevel",wQe="problemGroup",Az="parsedStack",i1e="hasFullStack",o1e="assembly",_M="fileName",yz="line",Zse="aiDataContract",Ez="duration";function wMt(t,e,r){var n=e[mo],o=MZr(t,e);if(o[mo]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=Vf(o,0,147)+OZr(s);o=c}return o}a(wMt,"dataSanitizeKeyAndAddUniqueness");function MZr(t,e){var r;return e&&(e=Ni(Hu(e)),e[mo]>150&&(r=Vf(e,0,150),Wr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(MZr,"dataSanitizeKey");function uu(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Ni(Hu(e)),e[mo]>r&&(n=Vf(e,0,r),Wr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(uu,"dataSanitizeString");function _z(t,e,r){return Ei(e)&&(e=ZNt(e,r)),PMt(t,e,2048,66)}a(_z,"dataSanitizeUrl");function s1e(t,e){var r;return e&&e[mo]>32768&&(r=Vf(e,0,32768),Wr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(s1e,"dataSanitizeMessage");function RMt(t,e){var r;if(e){var n=""+e;n[mo]>32768&&(r=Vf(n,0,32768),Wr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(RMt,"dataSanitizeException");function x_(t,e){if(e){var r={};Yr(e,function(n,o){if(Gu(o)&&XU())try{o=I_()[e1e](o)}catch(s){Wr(t,2,49,"custom property is not valid",{exception:s},!0)}o=uu(t,o,8192),n=wMt(t,n,r),r[n]=o}),e=r}return e}a(x_,"dataSanitizeProperties");function w_(t,e){if(e){var r={};Yr(e,function(n,o){n=wMt(t,n,r),r[n]=o}),e=r}return e}a(w_,"dataSanitizeMeasurements");function kMt(t,e){return e&&PMt(t,e,128,69)[a7]()}a(kMt,"dataSanitizeId");function PMt(t,e,r,n){var o;return e&&(e=Ni(Hu(e)),e[mo]>r&&(o=Vf(e,0,r),Wr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(PMt,"dataSanitizeInput");function OZr(t){var e="00"+t;return T7e(e,e[mo]-3)}a(OZr,"dsPadNumber");p();var LZr=df()||{},BZr=0,avo=[null,null,null,null,null];function FZr(t){var e=BZr,r=avo,n=r[e];return LZr.createElement?r[e]||(n=r[e]=LZr.createElement("a")):n={host:cvo(t,!0)},n.href=t,e++,e>=r[mo]&&(e=0),BZr=e,n}a(FZr,"urlParseUrl");function cvo(t,e){var r=UZr(t,e)||"";if(r){var n=r[mz](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>3&&Ei(n[2])&&n[2][mo]>0)return n[2]+(n[3]||"")}return r}a(cvo,"urlParseHost");function UZr(t,e){var r=null;if(t){var n=t[mz](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>2&&Ei(n[2])&&n[2][mo]>0&&(r=n[2]||"",e&&n[mo]>2)){var o=(n[1]||"")[hz](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(UZr,"urlParseFullHost");var lvo=[fz+EM,"https://breeze.aimon.applicationinsights.io"+EM,"https://dc-int.services.visualstudio.com"+EM];function RQe(t){return Vo(lvo,t[hz]())!==-1}a(RQe,"isInternalApplicationInsightsEndpoint");function QZr(t,e,r,n){var o,s=n,c=n;if(e&&e[mo]>0){var l=FZr(e);if(o=l.host,!s)if(l[t1e]!=null){var u=l.pathname[mo]===0?"/":l[t1e];u.charAt(0)!=="/"&&(u="/"+u),c=l[t1e],s=uu(t,r?r+" "+u:u)}else s=uu(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(QZr,"AjaxHelperParseDependencyPath");p();p();var kQe=Ebe({LocalStorage:0,SessionStorage:1});var Xse=void 0,qZr="";function jZr(t){try{if(Xt(Vy()))return null;var e=new Date()[a7](),r=Di(t===kQe.LocalStorage?"localStorage":"sessionStorage"),n=qZr+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[xMt](n),!o)return r}catch{}return null}a(jZr,"_getVerifiedStorageObject");function DMt(){return PQe()?jZr(kQe.SessionStorage):null}a(DMt,"_getSessionStorageObject");function NMt(t){qZr=t||""}a(NMt,"utlSetStoragePrefix");function PQe(t){return(t||Xse===void 0)&&(Xse=!!jZr(kQe.SessionStorage)),Xse}a(PQe,"utlCanUseSessionStorage");function MMt(t,e){var r=DMt();if(r!==null)try{return r.getItem(e)}catch(n){Xse=!1,Wr(t,2,2,"Browser failed read of session storage. "+Qp(n),{exception:dr(n)})}return null}a(MMt,"utlGetSessionStorage");function OMt(t,e,r){var n=DMt();if(n!==null)try{return n.setItem(e,r),!0}catch(o){Xse=!1,Wr(t,2,4,"Browser failed write to session storage. "+Qp(o),{exception:dr(o)})}return!1}a(OMt,"utlSetSessionStorage");function LMt(t,e){var r=DMt();if(r!==null)try{return r[xMt](e),!0}catch(n){Xse=!1,Wr(t,2,6,"Browser failed removal of session storage item. "+Qp(n),{exception:dr(n)})}return!1}a(LMt,"utlRemoveSessionStorage");p();var uvo=";",dvo="=";function a1e(t){if(!t)return{};var e=t[pz](uvo),r=mbe(e,function(o,s){var c=s[pz](dvo);if(c[mo]===2){var l=c[0][hz](),u=c[1];o[l]=u}return o},{});if($u(r)[mo]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[s7]=r[s7]||"https://"+n+"dc."+r.endpointsuffix}r[s7]=r[s7]||fz,PB(r[s7],"/")&&(r[s7]=r[s7].slice(0,-1))}return r}a(a1e,"parseConnectionString");p();var BMt=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[Yy]=uu(e,n)||zy,s.data=r,s.time=ZU(new Date),s[Zse]={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 qB=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[Yy]=uu(e,r)||zy,s[EA]=x_(e,n),s[Ky]=w_(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var fvo=58,pvo=/^\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\?]+)?)/,hvo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,mvo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,gvo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,Avo=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,yvo=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,Evo=/([^\(\s\n]+):([0-9]+)$/,HZr="",eae="error",px="stack",UMt="stackDetails",GZr="errorSrc",QMt="message",zZr="description",$Zr=[{re:hvo,len:5,m:1,fn:2,ln:3,col:4},{chk:vvo,pre:_vo,re:mvo,len:4,m:1,fn:2,ln:3},{re:gvo,len:3,m:1,fn:2,hdl:WZr},{re:Avo,len:2,fn:1,hdl:WZr}];function _vo(t){return t.replace(/(\(anonymous\))/,"")}a(_vo,"_scrubAnonymous");function vvo(t){return lu(t,"[native")<0}a(vvo,"_ignoreNative");function qMt(t,e){var r=t;return r&&!Ei(r)&&(JSON&&JSON[e1e]?(r=JSON[e1e](t),e&&(!r||r==="{}")&&(Or(t[a7])?r=t[a7]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(qMt,"_stringify");function YZr(t,e){var r=t;return t&&(r&&!Ei(r)&&(r=t[QMt]||t[zZr]||r),r&&!Ei(r)&&(r=qMt(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&lu(r||"",e)===-1&&(r=e+": "+r),r||""}a(YZr,"_formatMessage");function Cvo(t){try{if(Gu(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(Cvo,"_isExceptionDetailsInternal");function bvo(t){try{if(Gu(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(bvo,"_isExceptionInternal");function VZr(t){return t&&t.src&&Ei(t.src)&&t.obj&&ur(t.obj)}a(VZr,"_isStackDetails");function vz(t){var e=t||"";Ei(e)||(Ei(e[px])?e=e[px]:e=""+e);var r=e[pz](` -`);return{src:e,obj:r}}a(vz,"_convertStackObj");function Svo(t){for(var e=[],r=t[pz](` -`),n=0;n0){e=[];var n=0,o=!1,s=0;Ct(r,function(y){if(o||kvo(y)){var E=Hu(y);o=!0;var _=Pvo(E,n);_&&(s+=_[r1e],e.push(_),n++)}});var c=32*1024;if(s>c)for(var l=0,u=e[mo]-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(Ivo,"_parseStack");function DQe(t){var e="";if(t&&(e=t.typeName||t[Yy]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[a7]());e=n&&n[mo]>1?n[1]:""}catch{}return e}a(DQe,"_getErrorType");function FMt(t){if(t)try{if(!Ei(t)){var e=DQe(t),r=qMt(t,!1);return(!r||r==="{}")&&(t[eae]&&(t=t[eae],e=DQe(t)),r=qMt(t,!0)),lu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(FMt,"_formatErrorCode");var Cz=(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,bvo(r)?(l[Jse]=r[Jse]||[],l[EA]=r[EA],l[Ky]=r[Ky],r[gz]&&(l[gz]=r[gz]),r.id&&(l.id=r.id,r[EA].id=r.id),r[wQe]&&(l[wQe]=r[wQe]),Xt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Jse]=[JZr(e,r,n)],l[EA]=x_(e,n),l[Ky]=w_(e,o),s&&(l[gz]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=DQe(s||c||e);return{message:YZr(e,d),url:r,lineNumber:n,columnNumber:o,error:FMt(s||c||e),evt:FMt(c||e),typeName:d,stackDetails:KZr(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Jse]&&kB(r[Jse],function(l){return Rvo(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&&kB(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[i1e]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=FMt,t})();var xvo=Nh({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function wvo(){var t=this,e=ur(t[Az])&&kB(t[Az],function(n){return Nvo(n)}),r={id:t.id,outerId:t.outerId,typeName:t[n1e],message:t[Kse],hasFullStack:t[i1e],stack:t[px],parsedStack:e||void 0};return r}a(wvo,"_toInterface");function JZr(t,e,r){var n,o,s,c,l,u,d,f;if(Cvo(e))c=e[n1e],l=e[Kse],d=e[px],f=e[Az]||[],u=e[i1e];else{var h=e,m=h&&h.evt;xB(h)||(h=h[eae]||m||h),c=uu(t,DQe(h))||zy,l=s1e(t,YZr(e||h,c))||zy;var g=e[UMt]||KZr(e);f=Ivo(g),ur(f)&&kB(f,function(A){A[o1e]=uu(t,A[o1e]),A[_M]=uu(t,A[_M])}),d=RMt(t,Tvo(g)),u=ur(f)&&f[mo]>0,r&&(r[n1e]=r[n1e]||c)}return n={},n[Zse]=xvo,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[i1e]=u,n.stack=d,n.parsedStack=f,n.toInterface=wvo,n}a(JZr,"_createExceptionDetails");function Rvo(t,e){var r=ur(e[Az])&&kB(e[Az],function(o){return Dvo(o)})||e[Az],n=JZr(t,ux(ux({},e),{parsedStack:r}));return n}a(Rvo,"_createExDetailsFromInterface");function ZZr(t,e){var r=e[mz](yvo);if(r&&r[mo]>=4)t[_M]=r[1],t[yz]=parseInt(r[2]);else{var n=e[mz](Evo);n&&n[mo]>=3?(t[_M]=n[1],t[yz]=parseInt(n[2])):t[_M]=e}}a(ZZr,"_parseFilename");function WZr(t,e,r){var n=t[_M];e.fn&&r&&r[mo]>e.fn&&(e.ln&&r[mo]>e.ln?(n=Ni(r[e.fn]||""),t[yz]=parseInt(Ni(r[e.ln]||""))||0):n=Ni(r[e.fn]||"")),n&&ZZr(t,n)}a(WZr,"_handleFilename");function kvo(t){var e=!1;if(t&&Ei(t)){var r=Ni(t);r&&(e=pvo.test(r))}return e}a(kvo,"_isStackFrame");var XZr=Nh({level:1,method:1,assembly:0,fileName:0,line:0});function Pvo(t,e){var r,n;if(t&&Ei(t)&&Ni(t)){n=(r={},r[Zse]=XZr,r.level=e,r.assembly=Ni(t),r.method=HZr,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o<$Zr[mo];){var s=$Zr[o];if(s.chk&&!s.chk(t))break;s.pre&&(t=s.pre(t));var c=t[mz](s.re);if(c&&c[mo]>=s.len){s.m&&(n.method=Ni(c[s.m]||HZr)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[_M]=Ni(c[s.fn]||""),n[yz]=parseInt(Ni(c[s.ln]||""))||0):ZZr(n,c[s.fn]||""));break}o++}}return eXr(n)}a(Pvo,"_extractStackFrame");function Dvo(t){var e,r=(e={},e[Zse]=XZr,e.level=t.level,e.method=t.method,e.assembly=t[o1e],e.fileName=t[_M],e.line=t[yz],e.sizeInBytes=0,e);return eXr(r)}a(Dvo,"_stackFrameFromInterface");function eXr(t){var e=fvo;return t&&(e+=t.method[mo],e+=t.assembly[mo],e+=t.fileName[mo],e+=t.level.toString()[mo],e+=t.line.toString()[mo],t[r1e]=e),t}a(eXr,"_populateFrameSizeInBytes");function Nvo(t){return{level:t.level,method:t.method,assembly:t[o1e],fileName:t[_M],line:t[yz]}}a(Nvo,"_parsedFrameToInterface");p();p();var tXr=(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 jB=(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 tXr;h[NZr]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[Yy]=uu(e,r)||zy,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[EA]=x_(e,u),f[Ky]=w_(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var c1e="";function NQe(t){(isNaN(t)||t<0)&&(t=0),t=tJr(t);var e=c1e+t%1e3,r=c1e+Y1(t/1e3)%60,n=c1e+Y1(t/(1e3*60))%60,o=c1e+Y1(t/(1e3*60*60))%24,s=Y1(t/(1e3*60*60*24));return e=e[mo]===1?"00"+e:e[mo]===2?"0"+e:e,r=r[mo]<2?"0"+r:r,n=n[mo]<2?"0"+n:n,o=o[mo]<2?"0"+o:o,(s>0?s+".":c1e)+o+":"+n+":"+r+"."+e}a(NQe,"msToTimeSpan");var bz=(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=kMt(e,l),u.url=_z(e,n),u[Yy]=uu(e,r)||zy,isNaN(o)||(u[Ez]=NQe(o)),u[EA]=x_(e,s),u[Ky]=w_(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var Sz=(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[Ez]=NQe(s),g.success=c,g.resultCode=l+"",g.type=uu(e,d);var A=QZr(e,n,u,o);g.data=_z(e,o)||A.data,g.target=uu(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[Yy]=uu(e,A[Yy]),g[EA]=x_(e,h),g[Ky]=w_(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var Tz=(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||zy,c[Kse]=s1e(e,r),c[EA]=x_(e,o),c[Ky]=w_(e,s),n&&(c[gz]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var Iz=(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=_z(e,n),u[Yy]=uu(e,r)||zy,u[EA]=x_(e,s),u[Ky]=w_(e,c),l&&(u.domProcessing=l.domProcessing,u[Ez]=l[Ez],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 HB=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function l7(t){var e="ai."+t+".";return function(r){return e+r}}a(l7,"_aiNameFunc");var l1e=l7("application"),Jm=l7("device"),MQe=l7("location"),tae=l7("operation"),jMt=l7("session"),c7=l7("user"),xz=l7("cloud"),u1e=l7("internal"),d1e=(function(t){Wy(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(UNt({applicationVersion:l1e("ver"),applicationBuild:l1e("build"),applicationTypeId:l1e("typeId"),applicationId:l1e("applicationId"),applicationLayer:l1e("layer"),deviceId:Jm("id"),deviceIp:Jm("ip"),deviceLanguage:Jm("language"),deviceLocale:Jm("locale"),deviceModel:Jm("model"),deviceFriendlyName:Jm("friendlyName"),deviceNetwork:Jm("network"),deviceNetworkName:Jm("networkName"),deviceOEMName:Jm("oemName"),deviceOS:Jm("os"),deviceOSVersion:Jm("osVersion"),deviceRoleInstance:Jm("roleInstance"),deviceRoleName:Jm("roleName"),deviceScreenResolution:Jm("screenResolution"),deviceType:Jm("type"),deviceMachineName:Jm("machineName"),deviceVMName:Jm("vmName"),deviceBrowser:Jm("browser"),deviceBrowserVersion:Jm("browserVersion"),locationIp:MQe("ip"),locationCountry:MQe("country"),locationProvince:MQe("province"),locationCity:MQe("city"),operationId:tae("id"),operationName:tae("name"),operationParentId:tae("parentId"),operationRootId:tae("rootId"),operationSyntheticSource:tae("syntheticSource"),operationCorrelationVector:tae("correlationVector"),sessionId:jMt("id"),sessionIsFirst:jMt("isFirst"),sessionIsNew:jMt("isNew"),userAccountAcquisitionDate:c7("accountAcquisitionDate"),userAccountId:c7("accountId"),userAgent:c7("userAgent"),userId:c7("id"),userStoreRegion:c7("storeRegion"),userAuthUserId:c7("authUserId"),userAnonymousUserAcquisitionDate:c7("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:c7("authUserAcquisitionDate"),cloudName:xz("name"),cloudRole:xz("role"),cloudRoleVer:xz("roleVer"),cloudRoleInstance:xz("roleInstance"),cloudEnvironment:xz("environment"),cloudLocation:xz("location"),cloudDeploymentUnit:xz("deploymentUnit"),internalNodeName:u1e("nodeName"),internalSdkVersion:u1e("sdkVersion"),internalAgentVersion:u1e("agentVersion"),internalSnippet:u1e("snippet"),internalSdkSrc:u1e("sdkSrc")}));p();var Lh=new d1e;p();function rXr(t,e){IMt(t,null,null,e)}a(rXr,"_disableEvents");function HMt(t){var e=df(),r=Vu(),n=!1,o=[],s=1;r&&!Xt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=Jbe(nS("OfflineListener"),t);try{if(f(ff())&&(n=!0),e){var d=e.body||e;d.ononline&&f(d)&&(n=!0)}}catch{n=!1}function f(b){var T=!1;return b&&(T=TQe(b,"online",y,u),T&&TQe(b,"offline",E,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 b=m();l!==b&&(l=b,Ct(o,function(T){var w={isOnline:l,rState:s,uState:c};try{T(w)}catch{}}))}a(g,"listnerNoticeCheck");function A(b){c=b,g()}a(A,"setOnlineState");function y(){s=1,g()}a(y,"_setOnline");function E(){s=2,g()}a(E,"_setOffline");function _(){var b=ff();if(b&&n){if(rXr(b,u),e){var T=e.body||e;Nn(T.ononline)||rXr(T,u)}n=!1}}a(_,"_unload");function v(b){return o.push(b),{rm:a(function(){var T=o.indexOf(b);if(T>-1)return o.splice(T,1)},"rm")}}return a(v,"addListener"),{isOnline:h,isListening:a(function(){return n},"isListening"),unload:_,addListener:v,setOnlineState:A}}a(HMt,"createOfflineListener");var OQe="AppInsightsChannelPlugin";p();p();p();p();p();var u7="duration";p();var Bh="tags",LQe="deviceType",AC="data",vM="name",wz="traceID",Bo="length",d7="stringify",f7="measurements",hx="dataType",p7="envelopeType",GB="toString",$B="enqueue",VB="count",mx="push",f1e="emitLineDelimitedJson",h7="clear",rae="markAsSent",Rz="clearSent",p1e="bufferOverride",nae="BUFFER_KEY",WB="SENT_BUFFER_KEY",m7="concat",iae="MAX_BUFFER_SIZE",oae="triggerSend",_A="diagLog",BQe="initialize",sae="_sender",aae="endpointUrl",cae="instrumentationKey",FQe="customHeaders",GMt="maxBatchSizeInBytes",UQe="onunloadDisableBeacon",QQe="isBeaconApiDisabled",$Mt="alwaysUseXhrOverride",VMt="enableSessionStorageBuffer",rP="_buffer",WMt="onunloadDisableFetch",zMt="disableSendBeaconSplit",h1e="getSenderInst",g7="_onError",qQe="_onPartialSuccess",m1e="_onSuccess",jQe="itemsReceived",HQe="itemsAccepted",GQe="baseType",lae="sampleRate",nXr="getHashCodeScore";var YMt="baseType",Nd="baseData",ng="properties",iXr="true";function qp(t,e,r){return gM(t,e,r,W1)}a(qp,"_setValueIf");function Mvo(t,e,r){var n=r[Bh]=r[Bh]||{},o=e.ext=e.ext||{},s=e[Bh]=e[Bh]||[],c=o.user;c&&(qp(n,Lh.userAuthUserId,c.authId),qp(n,Lh.userId,c.id||c.localId));var l=o.app;l&&qp(n,Lh.sessionId,l.sesId);var u=o.device;u&&(qp(n,Lh.deviceId,u.id||u.localId),qp(n,Lh[LQe],u.deviceClass),qp(n,Lh.deviceIp,u.ip),qp(n,Lh.deviceModel,u.model),qp(n,Lh[LQe],u[LQe]));var d=e.ext.web;if(d){qp(n,Lh.deviceLanguage,d.browserLang),qp(n,Lh.deviceBrowserVersion,d.browserVer),qp(n,Lh.deviceBrowser,d.browser);var f=r[AC]=r[AC]||{},h=f[Nd]=f[Nd]||{},m=h[ng]=h[ng]||{};qp(m,"domain",d.domain),qp(m,"isManual",d.isManual?iXr:null),qp(m,"screenRes",d.screenRes),qp(m,"userConsent",d.userConsent?iXr:null)}var g=o.os;g&&(qp(n,Lh.deviceOS,g[vM]),qp(n,Lh.deviceOSVersion,g.osVer));var A=o.trace;A&&(qp(n,Lh.operationParentId,A.parentID),qp(n,Lh.operationName,uu(t,A[vM])),qp(n,Lh.operationId,A[wz]));for(var y={},E=s[Bo]-1;E>=0;E--){var _=s[E];Yr(_,function(b,T){y[b]=T}),s.splice(E,1)}Yr(s,function(b,T){y[b]=T});var v=ux(ux({},n),y);v[Lh.internalSdkVersion]||(v[Lh.internalSdkVersion]=uu(t,"javascript:".concat(Ovo.Version),64)),r[Bh]=rQe(v)}a(Mvo,"_extractPartAExtensions");function A7(t,e,r){Xt(t)||Yr(t,function(n,o){Dh(o)?r[n]=o:Ei(o)?e[n]=o:XU()&&(e[n]=I_()[d7](o))})}a(A7,"_extractPropsAndMeasurements");function kz(t,e){Xt(t)||Yr(t,function(r,n){t[r]=n||e})}a(kz,"_convertPropsUndefinedToCustomDefinedValue");function Pz(t,e,r,n){var o=new BMt(t,n,e);qp(o,"sampleRate",r[Zbe]),(r[Nd]||{}).startTime&&(o.time=ZU(r[Nd].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[vM]=o[vM].replace("{0}",s),Mvo(t,r,o),r[Bh]=r[Bh]||[],rQe(o)}a(Pz,"_createEnvelope");function Dz(t,e){Xt(e[Nd])&&Wr(t,1,46,"telemetryItem.baseData cannot be null.")}a(Dz,"EnvelopeCreatorInit");var Ovo={Version:"3.3.11"};function oXr(t,e,r){Dz(t,e);var n=e[Nd][f7]||{},o=e[Nd][ng]||{};A7(e[AC],o,n),Xt(r)||kz(o,r);var s=e[Nd];if(Xt(s))return UB(t,"Invalid input for dependency data"),null;var c=s[ng]&&s[ng][IQe]?s[ng][IQe]:"GET",l=new Sz(t,s.id,s.target,s[vM],s[u7],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new HB(Sz[hx],l);return Pz(t,Sz[p7],e,u)}a(oXr,"DependencyEnvelopeCreator");function KMt(t,e,r){Dz(t,e);var n={},o={};e[YMt]!==qB[hx]&&(n.baseTypeSource=e[YMt]),e[YMt]===qB[hx]?(n=e[Nd][ng]||{},o=e[Nd][f7]||{}):e[Nd]&&A7(e[Nd],n,o),A7(e[AC],n,o),Xt(r)||kz(n,r);var s=e[Nd][vM],c=new qB(t,s,n,o),l=new HB(qB[hx],c);return Pz(t,qB[p7],e,l)}a(KMt,"EventEnvelopeCreator");function sXr(t,e,r){Dz(t,e);var n=e[Nd][f7]||{},o=e[Nd][ng]||{};A7(e[AC],o,n),Xt(r)||kz(o,r);var s=e[Nd],c=Cz.CreateFromInterface(t,s,o,n),l=new HB(Cz[hx],c);return Pz(t,Cz[p7],e,l)}a(sXr,"ExceptionEnvelopeCreator");function aXr(t,e,r){Dz(t,e);var n=e[Nd],o=n[ng]||{},s=n[f7]||{};A7(e[AC],o,s),Xt(r)||kz(o,r);var c=new jB(t,n[vM],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new HB(jB[hx],c);return Pz(t,jB[p7],e,l)}a(aXr,"MetricEnvelopeCreator");function cXr(t,e,r){Dz(t,e);var n,o=e[Nd];!Xt(o)&&!Xt(o[ng])&&!Xt(o[ng][u7])?(n=o[ng][u7],delete o[ng][u7]):!Xt(e[AC])&&!Xt(e[AC][u7])&&(n=e[AC][u7],delete e[AC][u7]);var s=e[Nd],c;((e.ext||{}).trace||{})[wz]&&(c=e.ext.trace[wz]);var l=s.id||c,u=s[vM],d=s.uri,f=s[ng]||{},h=s[f7]||{};if(Xt(s.refUri)||(f.refUri=s.refUri),Xt(s.pageType)||(f.pageType=s.pageType),Xt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[GB]()),!Xt(s[ng])){var m=s[ng];Yr(m,function(y,E){f[y]=E})}A7(e[AC],f,h),Xt(r)||kz(f,r);var g=new bz(t,u,d,n,f,h,l),A=new HB(bz[hx],g);return Pz(t,bz[p7],e,A)}a(cXr,"PageViewEnvelopeCreator");function lXr(t,e,r){Dz(t,e);var n=e[Nd],o=n[vM],s=n.uri||n.url,c=n[ng]||{},l=n[f7]||{};A7(e[AC],c,l),Xt(r)||kz(c,r);var u=new Iz(t,o,s,void 0,c,l,n),d=new HB(Iz[hx],u);return Pz(t,Iz[p7],e,d)}a(lXr,"PageViewPerformanceEnvelopeCreator");function uXr(t,e,r){Dz(t,e);var n=e[Nd].message,o=e[Nd].severityLevel,s=e[Nd][ng]||{},c=e[Nd][f7]||{};A7(e[AC],s,c),Xt(r)||kz(s,r);var l=new Tz(t,n,o,s,c),u=new HB(Tz[hx],l);return Pz(t,Tz[p7],e,u)}a(uXr,"TraceEnvelopeCreator");p();var dXr=(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},Si(t,this,function(c){c[$B]=function(l){if(c[VB]()>=r.eventsLimitInMem){o||(Wr(e,2,105,"Maximum in-memory buffer size reached: "+c[VB](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Xt(s)&&l.cnt>s)&&n[mx](l)},c[VB]=function(){return n[Bo]},c.size=function(){for(var l=n[Bo],u=0;u0){var u=[];Ct(l,function(f){u[mx](f.item)});var d=r[f1e]?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 JMt(l,u):new $Qe(l,u);return Ct(f,function(m){h[$B](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),$Qe=(function(t){Wy(e,t);function e(r,n){var o=t.call(this,r,n)||this;return Si(e,o,function(s,c){s[rae]=function(l){c[h7]()},s[Rz]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(dXr);var Lvo=["AI_buffer","AI_sentBuffer"],JMt=(function(t){Wy(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[p1e]||{getItem:MMt,setItem:OMt},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return Si(e,s,function(m,g){var A=T(e[nae]),y=T(e[WB]),E=x(),_=y[m7](E),v=m._set(A[m7](_));v[Bo]>e[iae]&&(v[Bo]=e[iae]),R(e[WB],[]),R(e[nae],v),m[$B]=function(D){if(m[VB]()>=e[iae]){c||(Wr(n,2,67,"Maximum buffer size reached: "+m[VB](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Xt(h)&&D.cnt>h)&&(g[$B](D),R(e[nae],m._get()))},m[h7]=function(){g[h7](),R(e[nae],m._get()),R(e[WB],[]),c=!1},m[rae]=function(D){R(e[nae],m._set(b(D,m._get())));var N=T(e[WB]);N instanceof Array&&D instanceof Array&&(N=N[m7](D),N[Bo]>e[iae]&&(Wr(n,1,67,"Sent buffer reached its maximum size: "+N[Bo],!0),N[Bo]=e[iae]),R(e[WB],N))},m[Rz]=function(D){var N=T(e[WB]);N=b(D,N),R(e[WB],N)},m.createNew=function(D,N,L){L=!!L;var B=m._get().slice(0),q=T(e[WB]).slice(0);D=D||n,N=N||{},m[h7]();var M=L?new e(D,N):new $Qe(D,N);return Ct(B,function(O){M[$B](O)}),L&&M[rae](q),M};function b(D,N){var L=[],B=[];return Ct(D,function(q){B[mx](q.item)}),Ct(N,function(q){!Or(q)&&Vo(B,q.item)===-1&&L[mx](q)}),L}a(b,"_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 L=I_().parse(N);if(Ei(L)&&(L=I_().parse(L)),L&&ur(L))return L}}catch(B){Wr(n,1,42," storage key: "+D+", "+Qp(B),{exception:dr(B)})}return[]}a(w,"_getBufferBase");function R(D,N){var L=D;try{L=l?l+"_"+L:L;var B=JSON[d7](N);f(n,L,B)}catch(q){f(n,L,JSON[d7]([])),Wr(n,2,41," storage key: "+L+", "+Qp(q)+". Buffer cleared",{exception:dr(q)})}}a(R,"_setBuffer");function x(){var D=[];try{return Ct(Lvo,function(N){var L=P(N);if(D=D[m7](L),l){var B=l+"_"+N,q=P(B);D=D[m7](q)}}),D}catch(N){Wr(n,2,41,"Transfer events from previous buffers: "+Qp(N)+". previous Buffer items can not be removed",{exception:dr(N)})}return[]}a(x,"_getPreviousEvents");function P(D){try{var N=w(D),L=[];return Ct(N,function(B){var q={item:B,cnt:0};L[mx](q)}),LMt(n,D),L}catch{}return[]}a(P,"_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})(dXr);p();var fXr=(function(){function t(e){Si(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return I_()[d7](l)}catch(u){Wr(e,1,48,u&&Or(u[GB])?u[GB]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Wr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Wr(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(ur(c))d=o(c,l);else{Wr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{I_()[d7](c),d=c}catch(f){Wr(e,1,48,f&&Or(f[GB])?f[GB]():"Error serializing object",null,!0)}}return d}return c[u]=!0,Yr(c.aiDataContract,function(f,h){var m=Or(h)?h()&1:h&1,g=Or(h)?h()&4:h&4,A=h&2,y=c[f]!==void 0,E=Gu(c[f])&&c[f]!==null;if(m&&!y&&!A)Wr(e,1,24,"Missing required field specification. The field is required but not present on source",{field:f,name:l});else if(!g){var _=void 0;E?A?_=o(c[f],f):_=n(c[f],f):_=c[f],_!==void 0&&(d[f]=_)}}),delete c[u],d}a(n,"_serializeObject");function o(c,l){var u;if(c)if(!ur(c))Wr(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[lae]=e,this.samplingScoreGenerator=new hXr}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[lae],n=!1;return r==null||r>=100||e.baseType===jB[hx]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(Qvo,"_chkSampling");var qvo=(zB={},zB[qB.dataType]=KMt,zB[Tz.dataType]=uXr,zB[bz.dataType]=cXr,zB[Iz.dataType]=lXr,zB[Cz.dataType]=sXr,zB[jB.dataType]=aXr,zB[Sz.dataType]=oXr,zB),ZMt=(function(t){Wy(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=OQe;var n,o,s,c,l,u,d,f,h=0,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q,U,Y,W,V,z,ie;return Si(e,r,function(H,re){Ge(),H.pause=function(){pe(),c=!0},H.resume=function(){c&&(c=!1,o=null,rt(),Qe())},H.flush=function(J,se,me){if(J===void 0&&(J=!0),!c){pe();try{var Ce=H[oae](J,null,me||1);return _l(Ce,function(He){return se?(se(!He.rejected),!0):J?Dd(function($e){$e(!He.rejected)}):Ce})}catch(He){Wr(H[_A](),1,22,"flush failed, telemetry will not be collected: "+Qp(He),{exception:dr(He)})}}},H.onunloadFlush=function(){if(!c)if(v||O)try{return H[oae](!0,Dt,2)}catch(J){Wr(H[_A](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+Qp(J),{exception:dr(J)})}else H.flush(!1)},H.addHeader=function(J,se){f[J]=se},H[BQe]=function(J,se,me,Ce){H.isInitialized()&&Wr(H[_A](),1,28,"Sender is already initialized"),re[BQe](J,se,me,Ce);var He=H.identifier;u=new fXr(se.logger),n=0,o=null,s=0,H[sae]=null,d=0;var $e=H[_A]();A=Jbe(nS("Sender"),se.evtNamespace&&se.evtNamespace()),g=HMt(A),H._addHook(dx(J,function(et){var ct=et.cfg;ct.storagePrefix&&NMt(ct.storagePrefix);var bt=eP(null,ct,se),ht=bt.getExtCfg(He,yXr),We=ht[aae];if(y&&We===y){var ae=ct[aae];ae&&ae!==We&&(ht[aae]=ae)}var Re=Di("CompressionStream");ie=QNt("zipPayload",ct,!1),Or(Re)||(ie=!1);var Me=ht.corsPolicy;Me?(Me==="same-origin"||Me==="same-site"||Me==="cross-origin")&&r.addHeader(EXr,Me):delete f[EXr],tg(ht[cae])&&(ht[cae]=ct[cae]),ji(H,"_senderConfig",{g:a(function(){return ht},"g")}),E!==ht[aae]&&(y=E=ht[aae]),se.activeStatus()===Yk.PENDING?H.pause():se.activeStatus()===Yk.ACTIVE&&H.resume(),w&&w!==ht[FQe]&&Ct(w,function(_r){delete f[_r.header]}),_=ht[GMt],v=(ht[UQe]===!1||ht[QQe]===!1)&&e7(),b=ht[UQe]===!1&&e7(),T=ht[QQe]===!1&&e7(),O=ht[$Mt],j=!!ht.disableXhr,z=ht.retryCodes;var ye=ht[p1e],oe=!!ht[VMt]&&(!!ye||PQe()),ze=ht.namePrefix,at=oe!==L||oe&&q!==ze||oe&&B!==ye;if(H[rP]){if(at)try{H[rP]=H[rP].createNew($e,ht,oe)}catch(_r){Wr(H[_A](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+Qp(_r),{exception:dr(_r)})}rt()}else H[rP]=oe?new JMt($e,ht):new $Qe($e,ht);q=ze,L=oe,B=ye,Q=!ht[WMt]&&Bbe(!0),W=!!ht[zMt],H._sample=new mXr(ht.samplingPercentage,$e),x=ht[cae],!tg(x)&&!Te(x,ct)&&Wr($e,1,100,"Invalid Instrumentation key "+x),w=ht[FQe],Ei(y)&&!RQe(y)&&w&&w[Bo]>0?Ct(w,function(_r){r.addHeader(_r.header,_r.value)}):w=null,M=ht.enableSendPromise;var Vt=Le();V?V.SetConfig(Vt):(V=new bMt,V[BQe](Vt,$e));var gr=ht.httpXHROverride,cr=null,Mr=null,Hr=iQe([3,1,2],ht.transports);cr=V&&V[h1e](Hr,!1);var Gr=V&&V.getFallbackInst();U=a(function(_r,$0){return Ne(Gr,_r,$0)},"_xhrSend"),Y=a(function(_r,$0){return Ne(Gr,_r,$0,!1)},"_fallbackSend"),cr=O?gr:cr||gr||Gr,H[sae]=function(_r,$0){return Ne(cr,_r,$0)},Q&&(m=Ie);var Yt=iQe([3,1],ht.unloadTransports);Q||(Yt=Yt.filter(function(_r){return _r!==2})),Mr=V&&V[h1e](Yt,!0),Mr=O?gr:Mr||gr,(O||ht.unloadTransports||!m)&&Mr&&(m=a(function(_r,$0){return Ne(Mr,_r,$0)},"_syncUnloadSender")),m||(m=U),R=ht.disableTelemetry,P=ht.convertUndefined||nP,D=ht.isRetryDisabled,N=ht.maxBatchInterval}))},H.processTelemetry=function(J,se){se=H._getTelCtx(se);var me=se[_A]();try{var Ce=K(J,me);if(!Ce)return;var He=he(J,me);if(!He)return;var $e=u.serialize(He),et=H[rP];rt($e);var ct={item:$e,cnt:0};et[$B](ct),Qe()}catch(bt){Wr(me,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Qp(bt),{exception:dr(bt)})}H.processNext(J,se)},H.isCompletelyIdle=function(){return!c&&h===0&&H._buffer[VB]()===0},H.getOfflineListener=function(){return g},H._xhrReadyStateChange=function(J,se,me){if(!Gt(se))return ge(J,se,me)},H[oae]=function(J,se,me){J===void 0&&(J=!0);var Ce;if(!c)try{var He=H[rP];if(R)He[h7]();else{if(He[VB]()>0){var $e=He.getItems();te(me||0,J),se?Ce=se.call(H,$e,J):Ce=H[sae]($e,J)}s=+new Date}pe()}catch(ct){var et=KNt();(!et||et>9)&&Wr(H[_A](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+Qp(ct),{exception:dr(ct)})}return Ce},H.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:qe,serialize:Z,batch:ue,shouldProcess:a(function(J){return!!K(J)},"shouldProcess")}},H._doTeardown=function(J,se){H.onunloadFlush(),FB(g,!1),Ge()},H[g7]=function(J,se,me){if(!Gt(J))return Ue(J,se,me)},H[qQe]=function(J,se){if(!Gt(J))return ke(J,se)},H[m1e]=function(J,se){if(!Gt(J))return X(J,se)},H._xdrOnLoad=function(J,se){if(!Gt(se))return le(J,se)};function le(J,se){var me=AXr(J);if(J&&(me+""=="200"||me===""))n=0,H[m1e](se,0);else{var Ce=Kbe(me);Ce&&Ce[jQe]&&Ce[jQe]>Ce[HQe]&&!D?H[qQe](se,Ce):H[g7](se,Mbe(J))}}a(le,"_xdrOnLoad");function Le(){try{var J={xdrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return le(me,$e)},"xdrOnComplete"),fetchOnComplete:a(function(me,Ce,He,$e){var et=ee($e);if(et)return st(me.status,et,me.url,et[Bo],me.statusText,He||"")},"fetchOnComplete"),xhrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return ge(me,$e,$e[Bo])},"xhrOnComplete"),beaconOnRetry:a(function(me,Ce,He){return $t(me,Ce,He)},"beaconOnRetry")},se={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:j,disableBeacon:!T,disableBeaconSync:!b,senderOnCompleteCallBack:J};return se}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(J,se,me){J.readyState===4&&st(J.status,se,J.responseURL,me,lz(J),AXr(J)||J.response)}a(ge,"_xhrReadyStateChange");function Ue(J,se,me){Wr(H[_A](),2,26,"Failed to send telemetry.",{message:se}),H._buffer&&H._buffer[Rz](J)}a(Ue,"_onError");function ke(J,se){for(var me=[],Ce=[],He=se.errors.reverse(),$e=0,et=He;$e0&&H[m1e](J,se[HQe]),me[Bo]>0&&H[g7](me,lz(null,["partial success",se[HQe],"of",se.itemsReceived].join(" "))),Ce[Bo]>0&&(F(Ce),Wr(H[_A](),2,40,"Partial success. Delivered: "+J[Bo]+", Failed: "+me[Bo]+". Will retry to send "+Ce[Bo]+" our of "+se[jQe]+" items"))}a(ke,"_onPartialSuccess");function X(J,se){H._buffer&&H._buffer[Rz](J)}a(X,"_onSuccess");function ee(J){try{if(J){var se=J,me=se.oriPayload;return me&&me[Bo]?me:null}}catch{}return null}a(ee,"_getPayloadArr");function K(J,se){if(R)return!1;if(!J)return se&&Wr(se,1,7,"Cannot send empty telemetry"),!1;if(J.baseData&&!J[GQe])return se&&Wr(se,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(J[GQe]||(J[GQe]="EventData"),!H[sae])return se&&Wr(se,1,28,"Sender was not initialized"),!1;if(ne(J))J[Zbe]=H._sample[lae];else return se&&Wr(se,2,33,"Telemetry item was sampled out and not sent",{SampleRate:H._sample[lae]}),!1;return!0}a(K,"_validate");function he(J,se){var me=J.iKey||x,Ce=e.constructEnvelope(J,me,se,P);if(!Ce){Wr(se,1,47,"Unable to create an AppInsights envelope");return}var He=!1;if(J[Bh]&&J[Bh][Xbe]&&(Ct(J[Bh][Xbe],function($e){try{$e&&$e(Ce)===!1&&(He=!0,UB(se,"Telemetry processor check returns false"))}catch(et){Wr(se,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+Qp(et),{exception:dr(et)},!0)}}),delete J[Bh][Xbe]),!He)return Ce}a(he,"_getEnvelope");function Z(J){var se=gXr,me=H[_A]();try{var Ce=K(J,me),He=null;Ce&&(He=he(J,me)),He&&(se=u.serialize(He))}catch{}return se}a(Z,"_serialize");function ue(J){var se=gXr;return J&&J[Bo]&&(se="["+J.join(",")+"]"),se}a(ue,"_batch");function qe(J){var se=Be();return{urlString:y,data:J,headers:se}}a(qe,"_createPayload");function ne(J){return H._sample.isSampledIn(J)}a(ne,"_isSampledIn");function ce(J,se,me,Ce){se===200&&J?H._onSuccess(J,J[Bo]):Ce&&H[g7](J,Ce)}a(ce,"_getOnComplete");function Ne(J,se,me,Ce){Ce===void 0&&(Ce=!0);var He=a(function(ae,Re,Me){return ce(se,ae,Re,Me)},"onComplete"),$e=we(se),et=J&&J.sendPOST;if(et&&$e){Ce&&H._buffer[rae](se);var ct,bt=!1,ht,We;return V.preparePayload(function(ae){ct=et(ae,He,!me),bt=!0,ht&&V7e(ct,ht,We)},ie,$e,!me),bt?ct:Dd(function(ae,Re){ht=ae,We=Re})}return null}a(Ne,"_doSend");function we(J){if(ur(J)&&J[Bo]>0){var se=H[rP].batchPayloads(J),me=Be(),Ce={data:se,urlString:y,headers:me,disableXhrSync:j,disableFetchKeepAlive:!Q,oriPayload:J};return Ce}return null}a(we,"_getPayload");function Be(){try{var J=f||{};return RQe(y)&&(J[xQe[6]]=xQe[7]),J}catch{}return null}a(Be,"_getHeaders");function rt(J){var se=J?J[Bo]:0;return H[rP].size()+se>_?((!g||g.isOnline())&&H[oae](!0,null,10),!0):!1}a(rt,"_checkMaxSize");function st(J,se,me,Ce,He,$e){var et=null;if(H._appId||(et=Kbe($e),et&&et.appId&&(H._appId=et.appId)),(J<200||J>=300)&&J!==0){if((J===301||J===307||J===308)&&!_t(me)){H[g7](se,He);return}if(g&&!g.isOnline()){if(!D){var ct=10;F(se,ct),Wr(H[_A](),2,40,". Offline - Response Code: ".concat(J,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(se.length," items."))}return}!D&&Se(J)?(F(se),Wr(H[_A](),2,40,". Response code "+J+". Will retry to send "+se[Bo]+" items.")):H[g7](se,He)}else _t(me),J===206?(et||(et=Kbe($e)),et&&!D?H[qQe](se,et):H[g7](se,He)):(n=0,H[m1e](se,Ce))}a(st,"_checkResponsStatus");function _t(J){return d>=10?!1:!Xt(J)&&J!==""&&J!==y?(y=J,++d,!0):!1}a(_t,"_checkAndUpdateEndPointUrl");function Dt(J,se){if(m)m(J,!1);else{var me=V&&V[h1e]([3],!0);return Ne(me,J,se)}}a(Dt,"_doUnloadSend");function $t(J,se,me){var Ce=J,He=Ce&&Ce.oriPayload;if(W)Y&&Y(He,!0),Wr(H[_A](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var $e=[],et=0;et0&&(Y&&Y($e,!0),Wr(H[_A](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a($t,"_onBeaconRetry");function Gt(J){try{if(J&&J[Bo])return Ei(J[0])}catch{}return null}a(Gt,"_isStringArr");function Ie(J,se){var me=null;if(ur(J)){for(var Ce=J[Bo],He=0;He-1}a(Se,"_isRetriable");function Fe(){var J="getNotifyMgr",se,me=H.core;return me&&(me[J]?se=me[J]():se=me._notificationManager),se}a(Fe,"_getNotifyMgr");function te(J,se){var me=Fe();if(me&&me.eventsSendRequest)try{me.eventsSendRequest(J,se)}catch(Ce){Wr(H[_A](),1,74,"send request notification failed: "+Qp(Ce),{exception:dr(Ce)})}}a(te,"_notifySendRequest");function Te(J,se){var me=se.disableInstrumentationKeyValidation,Ce=Xt(me)?!1:me;if(Ce)return!0;var He="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",$e=new RegExp(He);return $e.test(J)}a(Te,"_validateInstrumentationKey");function Ge(){H[sae]=null,H[rP]=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,E=null,_=0,v=!1,w=null,R=!1,x=null,P=nP,D=!1,L=null,q=nP,j=!1,Q=!1,W=!1,U=null,Y=null,V=null,ji(H,"_senderConfig",{g:a(function(){return nQe({},yXr)},"g")})}a(Ge,"_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=qvo[c.baseType]||KMt;return l(o,c,s)},e})(Ybe);p();var Nz="instrumentationKey",g1e="connectionString",uae="endpointUrl",dae="userOverrideEndpointUrl";var Mz,XMt,eOt=void 0,jvo=(Mz={diagnosticLogInterval:$se(Hvo,1e4)},Mz[g1e]=eOt,Mz.endpointUrl=eOt,Mz[Nz]=eOt,Mz.featureOptIn=(XMt={},XMt.zipPayload={mode:1},XMt),Mz.extensionConfig={},Mz);function Hvo(t){return t&&t>0}a(Hvo,"_chkDiagLevel");var _Xr=(function(){function t(e){var r=new vMt,n;(Xt(e)||Xt(e[Nz])&&Xt(e[g1e]))&&Zc("Invalid input configuration"),Si(t,this,function(s){ji(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,cz(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=Oh(e||{},jvo);n=l.cfg,r.addUnloadHook(dx(l,function(){var u=n[g1e];if(tg(u)){var d=Pbe(function(g,A){_l(u,function(y){var E=y.value,_=n[Nz];if(!y.rejected&&E){n[g1e]=E;var v=a1e(E);_=v.instrumentationkey||_}g(_)})}),f=Pbe(function(g,A){_l(u,function(y){var E=y.value,_=n[uae];if(!y.rejected&&E){var v=a1e(E),b=v.ingestionendpoint;_=b?b+EM:_}g(_)})});n[Nz]=d,n[uae]=n[dae]||f}if(Ei(u)){var h=a1e(u),m=h.ingestionendpoint;n[uae]=n[dae]?n[dae]:m+EM,n[Nz]=h.instrumentationkey||n[Nz]}n[uae]=n[dae]?n[dae]:n[uae]})),r.initialize(n,[new ZMt])}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 iS=de(require("os"));var fae=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(tr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new _Xr({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[OQe]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:Gvo(e),this.commonProperties=n?.excludeCommonProperties?{}:$vo(e),this.#e=bs(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 Gvo(t){let e={},r=t.get(Ua);e["ai.session.id"]=r.sessionId;let n=t.get(Op);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${iS.type()} ${iS.release()}`,e["ai.device.osArchitecture"]=iS.arch(),e["ai.device.osPlatform"]=iS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ds).getVersion(),e}a(Gvo,"getTags");function $vo(t){let e={};e.common_os=iS.platform(),e.common_platformversion=iS.release(),e.common_arch=iS.arch(),e.common_cpu=Array.from(new Set(iS.cpus().map(n=>n.model))).join();let r=t.get(Ua);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($vo,"getCommonProperties");p();p();p();p();p();p();var A1e=S7e;var CM=A1e({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var y7=A1e({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Oz="toLowerCase",In="length",pae="warnToConsole",YB="throwInternal",bM="watch",E7="apply",ro="push",gx="splice",zu="logger",SM="cancel",KB="initialize",TM="identifier",hae="removeNotificationListener",mae="addNotificationListener",yC="isInitialized",y1e="getNotifyMgr",_7="getPlugin",iP="name",Zm="processNext",VQe="getProcessTelContext",JB="value",v7="enabled",tOt="stopPollingInternalLogs",Ax="unload",E1e="onComplete",WQe="version",zQe="loggingLevelConsole",IM="createNew",oS="teardown",gae="messageId",xM="message",EC="diagLog",C7="_doTeardown",Lz="update",sS="getNext",b7="setNextPlugin",_1e="userAgent",ZB="split",oP="replace",rOt="substring",YQe="indexOf",XB="type",nOt="evtName",sP="status",iOt="getAllResponseHeaders",v1e="isChildEvt",aS="data",Bz="getCtx",aP="setCtx";var C1e="headers",Aae="urlString",Fz="timeout";var KQe="traceFlags";var oOt;function vXr(t,e){oOt||(oOt=gbe("AggregationError",function(n,o){o[In]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` -`.concat(o," > ").concat(dr(n))}),new oOt(r,e||[])}a(vXr,"throwAggregationError");p();p();p();p();p();var cS=void 0,Ss="",Uz="channels",zf="core",JQe="createPerfMgr",b1e="disabled",e3="extensionConfig",Qz="extensions",_C="processTelemetry",qz="priority",yae="eventsSent",S7="eventsDiscarded",Eae="eventsSendRequest",wM="perfEvent",ZQe="offlineEventsStored",XQe="offlineBatchSent",eqe="offlineBatchDrop",_ae="getPerfMgr",tqe="domain",rqe="path",CXr="Not dynamic - ";var Vvo="getPrototypeOf",Wvo=/-([a-z])/g,zvo=/([^\w\d_$])/g,Yvo=/^(\d+[\w\d_$])/,GBl=Object[Vvo];function T7(t){return!Xt(t)}a(T7,"isNotNullOrUndefined");function vae(t){var e=t;return e&&Ei(e)&&(e=e[oP](Wvo,function(r,n){return n.toUpperCase()}),e=e[oP](zvo,"_"),e=e[oP](Yvo,function(r,n){return"_"+n})),e}a(vae,"normalizeJsName");function ig(t,e){return t&&e?lu(t,e)!==-1:!1}a(ig,"strContains");function Cae(t){return t&&t.toISOString()||""}a(Cae,"toISOString");function bae(t){return xB(t)?t[iP]:Ss}a(bae,"getExceptionName");function t3(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(t3,"setValue");function nqe(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(nqe,"getSetValue");function Kvo(t,e){var r=null,n=null;return Or(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][E7](n,o)}}a(Kvo,"_createProxyFunction");function I7(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=Kvo(r,n))}a(I7,"proxyFunctionAs");function x7(t,e,r,n){return t&&e&&Gu(t)&&ur(r)&&Ct(r,function(o){Ei(o)&&I7(t,o,e,o,n)}),t}a(x7,"proxyFunctions");function RM(t){return t&&wB&&(t=YU(wB({},t))),t}a(RM,"optimizeObject");function iqe(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(iqe,"isFeatureEnabled");function kM(t){try{return t.responseText}catch{}return null}a(kM,"getResponseText");function oqe(t,e){return t?"XDomainRequest,Response:"+kM(t)||"":e}a(oqe,"formatErrorMessageXdr");function T1e(t,e){return t?"XMLHttpRequest,Status:"+t[sP]+",Response:"+kM(t)||t.response||"":e}a(T1e,"formatErrorMessageXhr");function I1e(t,e){return e&&(Dh(e)?t=[e].concat(t):ur(e)&&(t=e.concat(t))),t}a(I1e,"prependTransports");var Jvo="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",bXr="withCredentials",Zvo="timeout";function sOt(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,Jvo,n),r&&c(l,bXr,r),l.open(t,e,!o),r&&c(l,bXr,r),!o&&s&&c(l,Zvo,s),l}a(sOt,"openXhr");function aOt(t){var e={};if(Ei(t)){var r=Ni(t)[ZB](/[\r\n]+/);Ct(r,function(n){if(n){var o=n[YQe](": ");if(o!==-1){var s=Ni(n.substring(0,o))[Oz](),c=Ni(n[rOt](o+1));e[s]=c}else e[Ni(n)]=1}})}return e}a(aOt,"convertAllHeadersToMap");function S1e(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Ni(n))}return t}a(S1e,"_appendHeader");var Xvo="kill-duration",eCo="kill-duration-seconds",tCo="time-delta-millis";function w7(t,e){var r={};return t[iOt]?r=aOt(t[iOt]()):e&&(r=S1e(r,t,tCo),r=S1e(r,t,Xvo),r=S1e(r,t,eCo)),r}a(w7,"_getAllResponseHeaders");p();p();var rCo="location",nCo="console",SXr="JSON",iCo="crypto",oCo="msCrypto",sCo="ReactNative",aCo="msie",cCo="trident/",TXr="XMLHttpRequest",cOt=null,lOt=null,lCo=!1,Sae=null,uOt=null;function IXr(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[tS];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Nn(o[e])}catch{}}return r}a(IXr,"_hasProperty");function Tae(t){if(t&&lCo){var e=Di("__mockLocation");if(e)return e}return typeof location===lx&&location?location:Di(rCo)}a(Tae,"getLocation");function sqe(){return typeof console!==eS?console:Di(nCo)}a(sqe,"getConsole");function x1e(){return!!(typeof JSON===lx&&JSON||Di(SXr)!==null)}a(x1e,"hasJSON");function aqe(){return x1e()?JSON||Di(SXr):null}a(aqe,"getJSON");function cqe(){return Di(iCo)}a(cqe,"getCrypto");function lqe(){return Di(oCo)}a(lqe,"getMsCrypto");function Iae(){var t=Vu();return t&&t.product?t.product===sCo:!1}a(Iae,"isReactNative");function jz(){var t=Vu();if(t&&(t[_1e]!==lOt||cOt===null)){lOt=t[_1e];var e=(lOt||Ss)[Oz]();cOt=ig(e,aCo)||ig(e,cCo)}return cOt}a(jz,"isIE");function xae(t){return(uOt===null||t===!1)&&(uOt=JW()&&!!Vu().sendBeacon),uOt}a(xae,"isBeaconsSupported");function wae(t){var e=!1;try{e=!!Di("fetch");var r=Di("Request");e&&t&&r&&(e=IXr(r,"keepalive"))}catch{}return e}a(wae,"isFetchSupported");function uqe(){return Sae===null&&(Sae=typeof XDomainRequest!==eS,Sae&&w1e()&&(Sae=Sae&&!IXr(Di(TXr),"withCredentials"))),Sae}a(uqe,"useXDomainRequest");function w1e(){var t=!1;try{var e=Di(TXr);t=!!e}catch{}return t}a(w1e,"isXhrSupported");var xXr=4294967296,Hz=4294967295,wXr=123456789,RXr=987654321,kXr=!1,R1e=wXr,k1e=RXr;function uCo(t){t<0&&(t>>>=0),R1e=wXr+t&Hz,k1e=RXr-t&Hz,kXr=!0}a(uCo,"_mwcSeed");function dCo(){try{var t=El()&2147483647;uCo((Math.random()*xXr^t)+t)}catch{}}a(dCo,"_autoSeedMwc");function dOt(t){var e=0,r=cqe()||lqe();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&Hz),e===0&&jz()&&(kXr||dCo(),e=fCo()&Hz),e===0&&(e=Y1(xXr*Math.random()|0)),t||(e>>>=0),e}a(dOt,"random32");function fCo(t){k1e=36969*(k1e&65535)+(k1e>>16)&Hz,R1e=18e3*(R1e&65535)+(R1e>>16)&Hz;var e=(k1e<<16)+(R1e&65535)>>>0&Hz|0;return t||(e>>>=0),e}a(fCo,"mwcRandom32");function fOt(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=dOt()>>>0,n=0,o=Ss;o[In]>>=6,n===5&&(r=(dOt()<<2&4294967295|r&3)>>>0,n=0);return o}a(fOt,"newId");var PXr="3.3.10",pCo="."+fOt(6),hCo=0;function DXr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(DXr,"_canAcceptData");function mCo(t,e){var r=e[t.id];if(!r){r={};try{DXr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(mCo,"_getCache");function yx(t,e){return e===void 0&&(e=!1),vae(t+hCo+++(e?"."+PXr:Ss)+pCo)}a(yx,"createUniqueNamespace");function dqe(t){var e={id:yx("_aiData-"+(t||Ss)+"."+PXr),accept:a(function(r){return DXr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[vae(n)]:(s&&(c=mCo(e,r),c[vae(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(dqe,"createElmNodeData");p();function fqe(t){return t&&Gu(t)&&!ur(t)&&(t.isVal||t.fb||yA(t,"v")||yA(t,"mrg")||yA(t,"ref")||t.set)}a(fqe,"_isConfigDefaults");function NXr(t,e,r){var n,o=r.dfVal||Tse;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&vXr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[In]>0){c||(c=[]),l||(l=Up(function(){l=null,f()},0));for(var A=0;A0?_l(kae(t[0],e),function(){AOt(HU(t,1),e,r)}):r(),n}a(AOt,"doUnloadAll");p();var LXr=500,yOt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function BXr(t){return{mrg:!0,v:t}}a(BXr,"cfgDfMerge");p();p();var EOt=[yae,S7,Eae,wM],yqe=null,Aqe;function bCo(t,e){return function(){var r=arguments,n=_Ot(e);if(n){var o=n.listener;o&&o[t]&&o[t][E7](o,r)}}}a(bCo,"_listenerProxyFunc");function SCo(){var t=Di("Microsoft");return t&&(yqe=t.ApplicationInsights),yqe}a(SCo,"_getExtensionNamespace");function _Ot(t){var e=yqe;return!e&&t.disableDbgExt!==!0&&(e=yqe||SCo()),e?e.ChromeDbgExt:null}a(_Ot,"getDebugExt");function FXr(t){if(!Aqe){Aqe={};for(var e=0;e=A&&(d[T](b[xM]),n[w]=!0)}else o>=A&&d[T](b[xM]);f(A,b)}},d.debugToConsole=function(A){vOt("debug",A),g("warning",A)},d[pae]=function(A){vOt("warn",A),g("warning",A)},d.errorToConsole=function(A){vOt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[Ax]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=xCo+y[gae];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[ro](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new Dae(23,v,!1);d.queue[ro](b),A===1?d.errorToConsole(v):d[pae](v)}}}a(f,"_logInternalMessage");function h(A){return lS(jp(A,wCo,d).cfg,function(y){var E=y.cfg;o=E[zQe],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=_Ot(e||{});E&&E[EC]&&E[EC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function qXr(t){return t||new Gz}a(qXr,"_getLogger");function Ra(t,e,r,n,o,s){s===void 0&&(s=!1),qXr(t)[YB](e,r,n,o,s)}a(Ra,"_throwInternal");function DM(t,e){qXr(t)[pae](e)}a(DM,"_warnToConsole");var COt,R7,jXr="toGMTString",HXr="toUTCString",TOt="cookie",bOt="expires",GXr="isCookieUseDisabled",B1e="disableCookiesUsage",$Xr="_ckMgr",Eqe=null,SOt=null,VXr=null,NM,WXr={},zXr={},kCo=(COt={cookieCfg:BXr((R7={},R7[tqe]={fb:"cookieDomain",dfVal:T7},R7.path={fb:"cookiePath",dfVal:T7},R7.enabled=cS,R7.ignoreCookies=cS,R7.blockedCookies=cS,R7.disableCookieDefer=!1,R7)),cookieDomain:cS,cookiePath:cS},COt[B1e]=cS,COt);function IOt(){!NM&&(NM=I7e(function(){return df()}))}a(IOt,"_getDoc");function _qe(t){return t?t.isEnabled():!0}a(_qe,"_isMgrEnabled");function een(t,e){return e&&t&&ur(t.ignoreCookies)?Vo(t.ignoreCookies,e)!==-1:!1}a(een,"_isIgnoredCookie");function YXr(t,e){return e&&t&&ur(t.blockedCookies)&&Vo(t.blockedCookies,e)!==-1?!0:een(t,e)}a(YXr,"_isBlockedCookie");function KXr(t,e){var r=e[v7];if(Xt(r)){var n=void 0;Nn(t[GXr])||(n=!t[GXr]),Nn(t[B1e])||(n=!t[B1e]),r=n}return r}a(KXr,"_isCfgEnabled");function xOt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[rqe]=E||"/",_[bOt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return jz()||(v["max-age"]="0"),ZXr(Ss,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Ni(E||Ss),R=lu(w,";");if(R!==-1&&(w=Ni(cM(E,R)),T=ten(Vf(E,R+1))),t3(T,tqe,v||o,W1,Nn),!Xt(_)){var x=jz();if(Nn(T[bOt])){var P=El(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),t3(T,bOt,JXr(N,x?jXr:HXr)||JXr(N,x?jXr:HXr)||Ss,W1)}}x||t3(T,"max-age",Ss+_,null,Nn)}var L=Tae();return L&&L.protocol==="https:"&&(t3(T,"secure",null,null,Nn),SOt===null&&(SOt=!ren((Vu()||{})[_1e])),SOt&&t3(T,"SameSite","None",null,Nn)),t3(T,rqe,b||n,null,Nn),ZXr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[In]-1;_>=0;_--)f[_].n===E&&f[gx](_,1)}a(g,"_removePendingCookie");function A(){L1e(e)&&f&&(Ct(f,function(E){YXr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=jp(t||zXr,null,e).cfg,s=lS(t,function(E){E.setDf(E.cfg,kCo),r=E.ref(E.cfg,"cookieCfg"),n=r[rqe]||"/",o=r[tqe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=KXr(t,r)!==!1,l=r.getCookie||PCo,u=r.setCookie||XXr,d=r.delCookie||XXr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=KXr(t,r)!==!1&&c&&L1e(e),_=zXr[$Xr];return E&&_&&y!==_&&(E=_qe(_)),E},"isEnabled"),setEnabled:a(function(E){r[v7]=E,Nn(t[B1e])||(t[B1e]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=YXr(r,E);if(!R){var x=m(_,v,b,T);_qe(y)?(u(E,x),w=!0):f&&(g(E),f[ro]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=Ss,v=een(r,E);if(!v){if(_qe(y))_=l(E);else if(f)for(var b=f[In]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=lu(w,";");_=R!==-1?Ni(cM(w,R)):Ni(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return _qe(y)?v=y.purge(E,_):f&&(g(E),f[ro]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return L1e(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[$Xr]=y,y}a(xOt,"createCookieMgr");function L1e(t){if(Eqe===null){Eqe=!1,!NM&&IOt();try{var e=NM.v||{};Eqe=e[TOt]!==void 0}catch(r){Ra(t,2,68,"Cannot access document.cookie - "+bae(r),{exception:dr(r)})}}return Eqe}a(L1e,"areCookiesSupported");function ten(t){var e={};if(t&&t[In]){var r=Ni(t)[ZB](";");Ct(r,function(n){if(n=Ni(n||Ss),n){var o=lu(n,"=");o===-1?e[n]=null:e[Ni(cM(n,o))]=Ni(Vf(n,o+1))}})}return e}a(ten,"_extractParts");function JXr(t,e){return Or(t[e])?t[e]():null}a(JXr,"_formatDate");function ZXr(t,e){var r=t||Ss;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?Ss:"="+o)}),r}a(ZXr,"_formatCookieValue");function PCo(t){var e=Ss;if(!NM&&IOt(),NM.v){var r=NM.v[TOt]||Ss;VXr!==r&&(WXr=ten(r),VXr=r),e=Ni(WXr[t]||Ss)}return e}a(PCo,"_getCookieValue");function XXr(t,e){!NM&&IOt(),NM.v&&(NM.v[TOt]=t+"="+e)}a(XXr,"_setCookieValue");function ren(t){return Ei(t)?!!(ig(t,"CPU iPhone OS 12")||ig(t,"iPad; CPU OS 12")||ig(t,"Macintosh; Intel Mac OS X 10_14")&&ig(t,"Version/")&&ig(t,"Safari")||ig(t,"Macintosh; Intel Mac OS X 10_14")&&PB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||ig(t,"Chrome/5")||ig(t,"Chrome/6")||ig(t,"UnrealEngine")&&!ig(t,"Chrome")||ig(t,"UCBrowser/12")||ig(t,"UCBrowser/11")):!1}a(ren,"uaDisallowsSameSiteNone");p();var DCo={perfEvtsSendAll:!1};function NCo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){$f(r.fn,[r.arg])})}a(NCo,"_runScheduledListeners");function k7(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[ro]({fn:n,arg:o}),r.h=r.h||Up(NCo,0,r)):$f(n,[o]))})}a(k7,"_runListeners");var wOt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=jp(e,DCo);n=c[bM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){ji(l,"listeners",{g:a(function(){return o},"g")}),l[mae]=function(u){o[ro](u)},l[hae]=function(u){for(var d=Vo(o,u);d>-1;)o[gx](d,1),d=Vo(o,u)},l[yae]=function(u){k7(o,yae,s,function(d){d[yae](u)})},l[S7]=function(u,d){k7(o,S7,s,function(f){f[S7](u,d)})},l[Eae]=function(u,d){k7(o,Eae,d?s:null,function(f){f[Eae](u,d)})},l[wM]=function(u){u&&(r||!u[v1e]())&&k7(o,wM,null,function(d){u.isAsync?Up(function(){return d[wM](u)},0):d[wM](u)})},l[ZQe]=function(u){u&&u[In]&&k7(o,ZQe,s,function(d){d[ZQe](u)})},l[XQe]=function(u){u&&u[aS]&&k7(o,XQe,s,function(d){d[XQe](u)})},l[eqe]=function(u,d){if(u>0){var f=d||0;k7(o,eqe,s,function(h){h[eqe](u,f)})}},l[Ax]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[SM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(k7(o,"unload",null,function(h){var m=h[Ax](u);m&&(f||(f=[]),f[ro](m))}),f)return Dd(function(h){return _l(z7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Mae="ctx",kOt="ParentContextKey",F1e="ChildrenContextKey",MCo=null,Oae=(function(){function t(e,r,n){var o=this;if(o.start=El(),o[iP]=e,o.isAsync=n,o[v1e]=function(){return!1},Or(r)){var s;ji(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[Bz]=function(c){return c?c===t[kOt]||c===t[F1e]?o[c]:(o[Mae]||{})[c]:null},o[aP]=function(c,l){if(c)if(c===t[kOt])o[c]||(o[v1e]=function(){return!0}),o[c]=l;else if(c===t[F1e])o[c]=l;else{var u=o[Mae]=o[Mae]||{};u[c]=l}},o.complete=function(){var c=0,l=o[Bz](t[F1e]);if(ur(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Ra(r[zu],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[e3];!_&&A&&(_={}),E[e3]=_,_=e.ref(E,e3),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Yr(A,function(E,_){if(Xt(y[E])){var v=e.cfg[E];(v||!Xt(v))&&(y[E]=v)}P1e(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 _&&(_[A]||!Xt(_[A]))?E=_[A]:(v[A]||!Xt(v[A]))&&(E=v[A]),E||!Xt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[_7]();y&&g(y)}}return a(m,"_iterateChain"),c}a(OOt,"_createInternalContext");function Ex(t,e,r,n){var o=jp(e),s=OOt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[_C](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=P7(d,o.cfg,r,f)),Ex(d||c[sS](),o.cfg,r,f)}return a(u,"_createNew"),c[Zm]=l,c[IM]=u,c}a(Ex,"createProcessTelemetryContext");function Lae(t,e,r){var n=jp(e.config),o=OOt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[Ax](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=P7(u,n.cfg,e,d)),Lae(u||s[sS](),e,d)}return a(l,"_createNew"),s[Zm]=c,s[IM]=l,s}a(Lae,"createProcessTelemetryUnloadContext");function U1e(t,e,r){var n=jp(e.config),o=OOt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[Lz])&&d[Lz](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=P7(u,n.cfg,e,d)),U1e(u||s[sS](),e,d)}return a(l,"_createNew"),s[Zm]=c,s[IM]=l,s}a(U1e,"createProcessTelemetryUpdateContext");function P7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[In]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[_C])){var u=QCo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?P7([n],e,r):o}a(P7,"createTelemetryProxyChain");function QCo(t,e,r){var n=null,o=Or(t[_C]),s=Or(t[b7]),c;t?c=t[TM]+"-"+t[qz]+"-"+aen++:c="Unknown-0-"+aen++;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&&Or(t[sen])&&(g=t[sen]()),g||(g=Ex(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[TM]:FCo,T=g[oen];return T||(T=g[oen]={}),g.setNext(n),t&&Hp(g[zf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:Ss;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Ra(g[EC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=r3(t);return _[oS]||_[b1e]?!1:(s&&t[b7](n),t[_C](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[Zm](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=r3(t),v=t[zf]||_[zf];t&&(!v||v===g.core())&&!_[oS]&&(_[zf]=null,_[oS]=!0,_[yC]=!1,t[oS]&&t[oS](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[Zm](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=r3(t),v=t[zf]||_[zf];t&&(!v||v===g.core())&&!_[oS]&&t[Lz]&&t[Lz](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[Zm](A)}return a(m,"_updatePlugin"),Nh(l)}a(QCo,"createTelemetryPluginProxy");var cen=(function(){function t(e,r,n,o){var s=this,c=Ex(e,r,n,o);x7(s,c,$u(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function Q1e(){var t=[];function e(n){n&&t[ro](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Ra(n[EC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(Q1e,"createUnloadHandlerContainer");p();var bqe,Sqe;function Tqe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Ra(n,2,73,"Unloading:"+dr(c))}}),bqe&&o[In]>bqe&&(Sqe?Sqe("doUnload",o):Ra(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Mh(t,n),bqe&&t[In]>bqe&&(Sqe?Sqe("Add",t):Ra(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(Tqe,"createUnloadHookContainer");var LOt,D7="getPlugin",qCo=(LOt={},LOt[e3]={isVal:T7,v:{}},LOt),Bae=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[KB]=function(h,m,g,A){u(h,m,A),r=!0},f[oS]=function(h,m){var g=f[zf];if(!g||h&&g!==h[zf]())return;var A,y=!1,E=h||Lae(null,g,o&&o[D7]?o[D7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[EC]()),A===!0&&E[Zm](_),d())}return a(v,"_unloadCallback"),!f[C7]||f[C7](E,_,v)!==!0?v():A=!0,A},f[Lz]=function(h,m){var g=f[zf];if(!g||h&&g!==h[zf]())return;var A,y=!1,E=h||U1e(null,g,o&&o[D7]?o[D7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[sS]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},I7(f,"_addUnloadCb",function(){return s},"add"),I7(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[EC]=function(f){return l(f)[EC]()},e[yC]=function(){return r},e.setInitialized=function(f){r=f},e[b7]=function(f){o=f},e[Zm]=function(f,h){h?h[Zm](f):o&&Or(o[_C])&&o[_C](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||Ex(null,{},e[zf]);o&&o[D7]?h=m[IM](null,o[D7]):h=m[IM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){jp(f,qCo,Nae(h)),!m&&h&&(m=h[VQe]()[sS]());var g=o;o&&o[D7]&&(g=o[D7]()),e[zf]=h,n=Ex(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[zf]=null,n=null,o=null,c=Tqe(),s=Q1e()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function jCo(t,e,r){var n={id:e,fn:r};Mh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[gx](c,1),-1})},"remove")};return o}a(jCo,"_addInitializer");function HCo(t,e,r){for(var n=!1,o=t[In],s=0;s"},"v")})}a(XCo,"_createUnloadHook");var Iqe=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[yC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[KB]=function(ne,ce,Ne,we){g&&Zc(uen),U[yC]()&&Zc("Core cannot be initialized more than once"),e=jp(ne,BOt,Ne||U[zu],!1),ne=e.cfg,qe(e[bM](function(st){var _t=st.cfg;B=_t.initInMemoMaxSize||VCo,Y(_t);var Dt=st.ref(st.cfg,e3);Yr(Dt,function($t){st.ref(Dt,$t)})})),s=we,b=ZCo(e,v,s&&U[y1e](),b),K(),U[zu]=Ne;var Be=ne[Qz];if(f=[],f[ro].apply(f,rz(rz([],ce,!1),Be,!1)),h=ne[Uz],Le(null),(!m||m[In]===0)&&Zc("No "+Uz+" available"),h&&h[In]>1){var rt=U[_7]("TeeChannelController");(!rt||!rt.plugin)&&Ra(n,1,28,"TeeChannel required")}JCo(ne,R,n),R=null,r=!0,N===y7.ACTIVE&&z()},U.getChannels=function(){var ne=[];return m&&Ct(m,function(ce){ne[ro](ce)}),Nh(ne)},U.track=function(ne){Hp(U[_ae](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ue(ne),Zc("Invalid telemetry item")),!ne[iP]&&Xt(ne[iP])&&(ue(ne),Zc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||Cae(new Date),ne.ver=ne.ver||"4.0",!g&&U[yC]()&&N===y7.ACTIVE?le()[Zm](ne):N!==y7.INACTIVE&&o[In]<=B&&o[ro](ne)},function(){return{item:ne}},!ne.sync)},U[VQe]=le,U[y1e]=function(){return s||(s=new wOt(e.cfg),U[GCo]=s),s},U[mae]=function(ne){U.getNotifyMgr()[mae](ne)},U[hae]=function(ne){s&&s[hae](ne)},U.getCookieMgr=function(){return u||(u=xOt(e.cfg,U[zu])),u},U.setCookieMgr=function(ne){u!==ne&&(kae(u,!1),u=ne)},U[_ae]=function(){return c||l||POt()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[In]},U.releaseQueue=function(){if(r&&o[In]>0){var ne=o;o=[],N===2?Ct(ne,function(ce){ce.iKey=ce.iKey||w,le()[Zm](ce)}):Ra(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,Q=!1,O&&O[SM](),ie(!0)};function Y(ne){var ce=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ce)){w=null,N=y7.INACTIVE;var we="Please provide instrumentation key";r?(Ra(n,1,100,we),z()):Zc(we);return}var Be=[];tg(ce)?(Be[ro](ce),w=null):w=ce,tg(Ne)?(Be[ro](Ne),L=null):L=Ne,Be[In]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ce){q=!1,N=3;var Ne=T7(ne.initTimeOut)?ne.initTimeOut:WCo,we=W7e(ce);M&&M[SM](),M=Up(function(){M=null,q||V()},Ne),_l(we,function(Be){try{if(q)return;if(!Be.rejected){var rt=Be[JB];if(rt&&rt[In]){var st=rt[0];if(w=st&&st[JB],rt[In]>1){var _t=rt[1];L=_t&&_t[JB]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=y7.INACTIVE,Ra(n,1,112,"ikey can't be resolved from promises")):N=y7.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[v7])&&!Q){var ce=ne||n&&n.queue[In]>0;ce&&(j||(j=!0,qe(e[bM](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[v7],O[SM]()),O=k7e(X,we),O.unref(),O[v7]=Be}))),O[v7]=!0)}return O}a(ie,"_startLogPoller"),U[tOt]=function(){Q=!0,O&&O[SM](),X()},x7(U,function(){return A},["addTelemetryInitializer"]),U[Ax]=function(ne,ce,Ne){ne===void 0&&(ne=!0),r||Zc($Co),g&&Zc(uen);var we={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ce&&(Be=Dd(function(_t){ce=_t}));var rt=Lae(Ue(),U);rt[E1e](function(){v.run(U[zu]),AOt([u,s,n],ne,function(){re(),ce&&ce(we)})},U);function st(_t){we.flushComplete=_t,g=!0,_.run(rt,we),U[tOt](),rt[Zm](we)}return a(st,"_doUnload"),X(),ee(ne,st,6,Ne)||st(!1),Be},U[_7]=ge,U.addPlugin=function(ne,ce,Ne,we){if(!ne){we&&we(!1),Z(pen);return}var Be=ge(ne[TM]);if(Be&&!ce){we&&we(!1),Z("Plugin ["+ne[TM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[ro](ne),rt.added=[ne],Le(rt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var _t=[Be.plugin],Dt={reason:2,isAsync:!!Ne};ke(_t,Dt,function($t){$t?(rt.removed=_t,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ne,ce){ce===void 0&&(ce=!0);var Ne;if(U[yC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Rse({},e.cfg),newConfig:Rse({},ne),merge:ce},ne=Ne.newConfig;var we=e.cfg;ne[Qz]=we[Qz],ne[Uz]=we[Uz]}e._block(function(Be){var rt=Be.cfg;FOt(Be,rt,ne,ce),ce||Yr(rt,function(st){yA(ne,st)||Be.set(rt,st,cS)}),Be.setDf(rt,BOt)},!0),e.notify(),Ne&&he(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ne){return T||(T=ien()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=qe,I7(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var ce;return r?ce=lS(e.cfg,ne,U[zu]):ce=KCo(R,ne),XCo(ce)},U.getWParam=function(){return RB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ce=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[TM]&&we[WQe]&&!ne[we.identifier]){var Be=we[TM]+"="+we[WQe];P[ro](Be),ne[we.identifier]=we}})},"_addPluginVersions");ce(m),h&&Ct(h,function(Ne){ce(Ne)}),ce(f)}a(H,"_setPluginVersions");function re(){r=!1,e=jp({},BOt,U[zu]),e.cfg[zQe]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ce){U.updateCfg(ce,!1)},"s")}),ji(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),ji(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||Ss},"g")}),ji(U,"logger",{g:a(function(){return n||(n=new Gz(e.cfg),e[zu]=n),n},"g"),s:a(function(ce){e[zu]=ce,n!==ce&&(kae(n,!1),n=ce)},"s")}),U[zu]=new Gz(e.cfg),x=[];var ne=U.config[Qz]||[];ne.splice(0,ne[In]),Mh(ne,x),A=new len,o=[],kae(s,!1),s=null,c=null,l=null,kae(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=yx("AIBaseCore",!0),_=Q1e(),T=null,w=null,v=Tqe(),R=[],D=null,P=null,Q=!1,O=null,j=!1,N=0,L=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=Ex(Ue(),e.cfg,U);return ne[E1e](ie),ne}a(le,"_createTelCtx");function Le(ne){var ce=YCo(U[zu],LXr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=Cqe(Mh(m,ce[Uz]));var Ne=Mh(Cqe(ce[zf]),m);x=Nh(Ne);var we=U.config[Qz]||[];we.splice(0,we[In]),Mh(we,x);var Be=le();m&&m[In]>0&&MOt(Be[IM](m),Ne),MOt(Be,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ce=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[TM]===ne&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[ro](Be)}),!Ne&&we[In]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ne),!Ne)return-1}),Ne&&(ce={plugin:Ne,setEnabled:a(function(Be){r3(Ne)[b1e]=!Be},"setEnabled"),isEnabled:a(function(){var Be=r3(Ne);return!Be[oS]&&!Be[b1e]},"isEnabled"),remove:a(function(Be,rt){Be===void 0&&(Be=!0);var st=[Ne],_t={reason:1,isAsync:Be};ke(st,_t,function(Dt){Dt&&Le({reason:32,removed:st}),rt&&rt(Dt)})},"remove")}),ce}a(ge,"_getPlugin");function Ue(){if(!d){var ne=(x||[]).slice();Vo(ne,A)===-1&&ne[ro](A),d=P7(Cqe(ne),e.cfg,U)}return d}a(Ue,"_getPluginChain");function ke(ne,ce,Ne){if(ne&&ne[In]>0){var we=P7(ne,e.cfg,U),Be=Lae(we,U);Be[E1e](function(){var rt=!1,st=[];Ct(f,function(Dt,$t){den(Dt,ne)?rt=!0:st[ro](Dt)}),f=st,D=null,P=null;var _t=[];h&&(Ct(h,function(Dt,$t){var Gt=[];Ct(Dt,function(Ie){den(Ie,ne)?rt=!0:Gt[ro](Ie)}),_t[ro](Gt)}),h=_t),Ne&&Ne(rt),ie()}),Be[Zm](ce)}else Ne(!1)}a(ke,"_removePlugins");function X(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[In]=0,Ct(ne,function(ce){var Ne={name:y||"InternalMessageId: "+ce[gae],iKey:w,time:Cae(new Date),baseType:Dae.dataType,baseData:{message:ce[xM]}};U.track(Ne)})}}a(X,"_flushInternalLogs");function ee(ne,ce,Ne,we){var Be=1,rt=!1,st=null;we=we||5e3;function _t(){Be--,rt&&Be===0&&(st&&st[SM](),st=null,ce&&ce(rt),ce=null)}if(a(_t,"doCallback"),m&&m[In]>0){var Dt=le()[IM](m);Dt.iterate(function($t){if($t.flush){Be++;var Gt=!1;$t.flush(ne,function(){Gt=!0,_t()},Ne)||Gt||(ne&&st==null?st=Up(function(){st=null,_t()},we):_t())}})}return rt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[bM](function(ce){var Ne=ce.cfg.enablePerfMgr;if(Ne){var we=ce.cfg[JQe];(ne!==we||!ne)&&(we||(we=zCo),nqe(ce.cfg,JQe,we),ne=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[y1e]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ce=U1e(Ue(),U);ce[E1e](ie),(!U._updateHook||U._updateHook(ce,ne)!==!0)&&ce[Zm](ne)}a(he,"_doUpdate");function Z(ne){var ce=U[zu];ce?(Ra(ce,2,73,ne),ie()):Zc(ne)}a(Z,"_logOrThrowError");function ue(ne){var ce=U[y1e]();ce&&ce[S7]([ne],2)}a(ue,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var cP="",ebo="NoResponseBody",hen="&"+ebo+"=true",UOt="POST",xqe=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;q(),E[KB]=function(M,O){o=O,n&&Ra(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.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 O=Tae();O&&O.protocol&&O.protocol[Oz]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[In]?R(M,O):null},E.getFallbackInst=function(){return d},E[C7]=function(M,O){q()},E.preparePayload=function(M,O,j,Q){if(!O||Q||!j[aS]){M(j);return}try{var U=Di("CompressionStream");if(!Or(U)){M(j);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(Ei(j[aS])?new TextEncoder().encode(j[aS]):j[aS]),re.close()},"start")}),W=Y.pipeThrough(new U("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return _l(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[JB];if(!Le.done)return z[ro](Le[JB]),ie+=Le.value[In],_l(V.read(),re);for(var ge=new Uint8Array(ie),Ue=0,ke=0,X=z;ke0&&(Ct($u(ge),function(K){H.append(K,ge[K])}),Ue[C1e]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),j&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(U+=hen)):le=!0);var ke=new Request(U,Ue);try{ke[yOt]=!0}catch{}if(!j&&r&&(V=Dd(function(K,he){z=K,ie=he})),!U){w(O),z&&z(!1);return}function X(K,he){he?x(O,s?0:he,{},s?cP:K):x(O,s?0:400,{},s?cP:K)}a(X,"_handleError");function ee(K,he,Z){var ue=K[sP],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,Z||cP,he):x(O,ue,{},Z||cP)}a(ee,"_onFetchComplete");try{_l(fetch(s?U:ke,s?Ue:null),function(K){if(j&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)X(K.reason&&K.reason[xM],499),ie&&ie(K.reason);else{var he=K[JB];try{!s&&!he.ok?(he[sP]?X(he.statusText,he[sP]):X(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,cP),z&&z(!0)):_l(he.text(),function(Z){ee(he,M,Z[JB]),z&&z(!0)})}catch(Z){he&&he[sP]?X(dr(Z),he[sP]):X(dr(Z),499),ie&&ie(Z)}}})}catch(K){Le||(X(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[Fz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[Fz]),V}a(L,"_doFetchSender");function B(M,O,j){var Q=ff(),U=new XDomainRequest,Y=M[aS];U.onload=function(){var H=kM(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?cP:oqe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",V=M[Aae];if(!V){w(O);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.";Ra(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[oP](/^(https?:)/,"");U.open(UOt,ie),M[Fz]&&(U[Fz]=M[Fz]),U.send(Y),s&&j?y&&y.set(function(){U.send(Y)},0):U.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 ven="on",men="attachEvent",gen="addEventListener",Aen="detachEvent",yen="removeEventListener",QOt="events",H1e="visibilitychange",Rqe="pagehide",Cen="pageshow",ben="unload",Sen="beforeunload",Ten=yx("aiEvtPageHide"),Ien=yx("aiEvtPageShow"),tbo=/\.[\.]+/g,rbo=/[\.]+$/,nbo=1,wqe=dqe("events"),ibo=/^([^.]*)(?:\.(.+)|)/;function Een(t){return t&&t[oP]?t[oP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Ss):t}a(Een,"_normalizeNamespace");function qOt(t,e){if(e){var r=Ss;ur(e)?(r=Ss,Ct(e,function(o){o=Een(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=Een(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Ss)+r)}var n=ibo.exec(t||Ss)||[];return{type:n[1],ns:(n[2]||Ss).replace(tbo,".").replace(rbo,Ss)[ZB](".").sort().join(".")}}a(qOt,"_getEvtNamespace");function xen(t,e,r){r===void 0&&(r=!0);var n=wqe.get(t,QOt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(xen,"_getRegisteredEvents");function wen(t,e,r,n){t&&e&&e[XB]&&(t[yen]?t[yen](e[XB],r,n):t[Aen]&&t[Aen](ven+e[XB],r))}a(wen,"_doDetach");function obo(t,e,r,n){var o=!1;return t&&e&&e[XB]&&r&&(t[gen]?(t[gen](e[XB],r,n),o=!0):t[men]&&(t[men](ven+e[XB],r),o=!0)),o}a(obo,"_doAttach");function _en(t,e,r,n){for(var o=e[In];o--;){var s=e[o];s&&(!r.ns||r.ns===s[nOt].ns)&&(!n||n(s))&&(wen(t,s[nOt],s.handler,s.capture),e[gx](o,1))}}a(_en,"_doUnregister");function sbo(t,e,r){if(e[XB])_en(t,xen(t,e[XB]),e,r);else{var n=wqe.get(t,QOt,{});Yr(n,function(o,s){_en(t,s,e,r)}),$u(n)[In]===0&&wqe.kill(t,QOt)}}a(sbo,"_unregisterEvents");function M7(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=qOt("xx",r).ns[ZB](".")):r=t,r}a(M7,"mergeEvtNamespace");function q1e(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=qOt(e,n);if(s=obo(t,c,r,o),s&&wqe.accept(t)){var l={guid:nbo++,evtName:c,handler:r,capture:o};xen(t,c.type)[ro](l)}}catch{}return s}a(q1e,"eventOn");function j1e(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=qOt(e,n),c=!1;sbo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||wen(t,s,r,o)}catch{}}a(j1e,"eventOff");function jOt(t,e,r){var n=!1,o=ff();o&&(n=q1e(o,t,e,r),n=q1e(o.body,t,e,r)||n);var s=df();return s&&(n=q1e(s,t,e,r)||n),n}a(jOt,"addEventHandler");function HOt(t,e,r){var n=ff();n&&(j1e(n,t,e,r),j1e(n.body,t,e,r));var o=df();o&&j1e(o,t,e,r)}a(HOt,"removeEventHandler");function Fae(t,e,r,n){var o=!1;return e&&t&&t[In]>0&&Ct(t,function(s){s&&(!r||Vo(r,s)===-1)&&(o=jOt(s,e,n)||o)}),o}a(Fae,"_addEventListeners");function GOt(t,e,r,n){var o=!1;return e&&t&&ur(t)&&(o=Fae(t,e,r,n),!o&&r&&r[In]>0&&(o=Fae(t,e,null,n))),o}a(GOt,"addEventListeners");function $z(t,e,r){t&&ur(t)&&Ct(t,function(n){n&&HOt(n,e,r)})}a($z,"removeEventListeners");function kqe(t,e,r){return GOt([Sen,ben,Rqe],t,e,r)}a(kqe,"addPageUnloadEventListener");function Pqe(t,e){$z([Sen,ben,Rqe],t,e)}a(Pqe,"removePageUnloadEventListener");function G1e(t,e,r){function n(c){var l=df();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=M7(Ten,r),s=Fae([Rqe],t,e,o);return(!e||Vo(e,H1e)===-1)&&(s=Fae([H1e],n,e,o)||s),!s&&e&&(s=G1e(t,null,r)),s}a(G1e,"addPageHideEventListener");function Dqe(t,e){var r=M7(Ten,e);$z([Rqe],t,r),$z([H1e],null,r)}a(Dqe,"removePageHideEventListener");function $1e(t,e,r){function n(c){var l=df();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=M7(Ien,r),s=Fae([Cen],t,e,o);return s=Fae([H1e],n,e,o)||s,!s&&e&&(s=$1e(t,null,r)),s}a($1e,"addPageShowEventListener");function Nqe(t,e){var r=M7(Ien,e);$z([Cen],t,r),$z([H1e],null,r)}a(Nqe,"removePageShowEventListener");p();var Uae="",Ren="https://browser.events.data.microsoft.com/OneCollector/1.0/",$Ot="version",Mqe="properties";p();p();var VOt="initialize",WOt="indexOf",MM="timings",zOt="pollInternalLogs",uS="value",Oqe="length",Lqe="processTelemetryStart";var n3,ken="4.3.10",V1e="1DS-Web-JS-"+ken,Pen=xbe.hasOwnProperty;var gbo=(n3={},n3[0]=0,n3[2]=6,n3[1]=1,n3[3]=7,n3[4098]=6,n3[4097]=1,n3[4099]=7,n3);var Abo=RB(),ybo=wse();function _x(t){return!(t===Uae||Xt(t))}a(_x,"isValueAssigned");function YOt(t){if(t){var e=lu(t,"-");if(e>-1)return cM(t,e)}return Uae}a(YOt,"getTenantId");function KOt(t){return!!(t&&Dh(t)&&t>=1&&t<=4)}a(KOt,"isLatency");function JOt(t,e,r){if(!e&&!_x(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||ur(e))e={value:e};else if(n==="object"&&!Pen.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Xt(e[uS])||e[uS]===Uae||!Ei(e[uS])&&!Dh(e[uS])&&!Wk(e[uS])&&!ur(e[uS]))return null;if(ur(e[uS])&&!Nen(e[uS]))return null;if(!Xt(e.kind)){if(ur(e[uS])||!Den(e.kind))return null;e[uS]=e[uS].toString()}return e}a(JOt,"sanitizeProperty");function W1e(t,e,r){var n=-1;if(!Nn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),Ebo(r))n===-1&&(n=0),n|=r;else{var o=gbo[Bqe(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(W1e,"getCommonSchemaMetaData");function Qae(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[Oqe],d=arguments;for(Wk(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(Den,"isValueKind");function Ebo(t){return t>=0&&t<=9}a(Ebo,"isDataType");function Nen(t){return t[Oqe]>0}a(Nen,"isArrayValid");function Fqe(t,e){var r=t;r[MM]=r[MM]||{},r[MM][Lqe]=r[MM][Lqe]||{},r[MM][Lqe][e]=dS()}a(Fqe,"setProcessTelemetryTimings");function Bqe(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===lx&&(e=4,ur(t)?(e=4096,t[Oqe]>0&&(e|=Bqe(t[0]))):Pen.call(t,"value")&&(e=8192|Bqe(t[uS])))}return e}a(Bqe,"getFieldValueType");function ZOt(){return!!Di("chrome")}a(ZOt,"isChromium");function Vz(t){return t>0}a(Vz,"isGreaterThanZero");var _bo=T_({endpointUrl:Ren,propertyStorageOverride:{isVal:vbo}});function vbo(t){return t&&(!t.getProperty||!t.setProperty)&&Zc("Invalid property storage override passed."),!0}a(vbo,"_chkPropOverride");var XOt=(function(t){Wy(e,t);function e(){var r=t.call(this)||this;return Si(e,r,function(n,o){n[VOt]=function(s,c,l,u){Hp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[VOt](jp(s,_bo,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=dr(h);f[WOt]("channels")!==-1&&(f+=` - - Channels must be provided through config.channels only!`),Ra(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){Hp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[MM]=c[MM]||{},c[MM].trackStart=dS(),KOt(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=V1e;var u=c.baseData=c.baseData||{};u[Mqe]=u[Mqe]||{};var d=u[Mqe];d[$Ot]=d[$Ot]||n.pluginVersionString||Uae}o.track(c)},function(){return{item:s}},!s.sync)},n[zOt]=function(s){return o[zOt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(Iqe);p();p();var z1e="REAL_TIME",Men="NEAR_REAL_TIME",Oen="BEST_EFFORT";p();p();p();var lP="";var Uqe="drop",Len="send",e5t="requeue",Ben="rspFail",Fen="oth",t5t="no-cache, no-store",Qqe="application/x-json-stream",Y1e="cache-control",qae="content-type",Uen="kill-tokens",Qen="kill-duration";var qen="time-delta-millis",qqe="client-version",r5t="client-id",jqe="time-delta-to-apply-millis",Hqe="upload-time",Gqe="apikey",K1e="AuthMsaDeviceTicket",n5t="WebAuthToken",i5t="AuthXToken";var jen="NoResponseBody",jae="msfpc",o5t="trace",$qe="user";p();var J1e="allowRequestSending",Vqe="shouldAddClockSkewHeaders",Wqe="getClockSkewHeaderValue",Z1e="setClockSkew",Wo="length",OM="concat",fS="iKey",Yf="count",LM="events",Xm="push",BM="split",zqe="toLowerCase",Wz="hdrs",Yqe="useHdrs",zz="initialize",Kqe="setTimeoutOverride",Jqe="clearTimeoutOverride",Hen="payloadPreprocessor",s5t="overrideEndpointUrl",a5t="avoidOptions",Gen="disableEventTimings",Zqe="enableCompoundKey",c5t="disableXhrSync",l5t="disableFetchKeepAlive",$en="addNoResponse",u5t="useSendBeacon",d5t="fetchCredentials",f5t="alwaysUseXhrOverride",Xqe="serializeOfflineEvt",eje="getOfflineRequestDetails",tje="createPayload",X1e="createOneDSPayload",p5t="payloadBlob",uP="headers",Hae="_thePayload",Jy="batches",vC="sendType",eSe="canSendRequest",Gae="sendQueuedRequests",tSe="setUnloading",Ven="isTenantKilled",rje="sendSynchronousBatch",nje="_transport",$ae="getWParam",h5t="isBeacon",rSe="timings",ije="isTeardown",oje="_sendReason",sje="setKillSwitchTenants",aje="_backOffTransmission",nSe="identifier",Wen="ignoreMc1Ms0CookieProcessing",m5t="autoFlushEventsLimit",zen="disableAutoBatchFlushLimit",Yen="overrideInstrumentationKey",iSe="sendAttempt",O7="latency",Yz="sync";function Jen(t){var e=(t.ext||{}).intweb;return e&&_x(e[jae])?e[jae]:null}a(Jen,"_getEventMsfpc");function Ken(t){for(var e=null,r=0;e===null&&rEl()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var bbo=.8,Sbo=1.2,etn=3e3,Tbo=6e5;function ttn(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(ttn,"retryPolicyShouldRetryForStatus");function cje(t){var e=0,r=etn*bbo,n=etn*Sbo,o=Y1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,QU(e,Tbo)}a(cje,"retryPolicyGetMillisToBackoffForRetry");p();var Ibo=20,xbo=3145728,ntn=65e3,itn=2e6,wbo=QU(itn,ntn),rtn="metadata",lje="f",Rbo=/\./,otn=(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,E=s||W1e,_=kbo(l),v=uje(_.requestLimit,xbo,0),b=uje(_.requestLimit,ntn,1),T=uje(_.recordLimit,itn,0),w=Math.min(uje(_.recordLimit,wbo,1),b);Si(t,this,function(R){R.createPayload=function(D,N,L,B,q,M){return{apiKeys:[],payloadBlob:lP,overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:D,isTeardown:N,isSync:L,isBeacon:B,sendType:M,sendReason:q}},R.appendPayload=function(D,N,L){var B=D&&N&&!D.overflow;return B&&Hp(e,function(){return"Serializer:appendPayload"},function(){for(var q=N.events(),M=D.payloadBlob,O=D.numEvents,j=!1,Q=[],U=[],Y=D.isBeacon,W=Y?b:v,V=Y?w:T,z=0,ie=0;z=L){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>Ibo&&(T7e(M,0,1),ie=0),j=!0,O++}else re?Q.push(H):U.push(H),q.splice(z,1),z--}z++}if(Q.length>0&&D.sizeExceed.push(L7.create(N.iKey(),Q)),U.length>0&&D.failedEvts.push(L7.create(N.iKey(),U)),j){D.batches.push(N),D.payloadBlob=M,D.numEvents=O;var ge=N.iKey();Vo(D.apiKeys,ge)===-1&&D.apiKeys.push(ge)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:L}}),B},R.getEventBlob=function(D){try{return Hp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+YOt(D.iKey);var L={},B;y||(B=a(function(j,Q,U){Pbo(E,L,j,Q,U)},"_addMetadataCallback"));var q=D[f];q&&(N[f]=L,Yr(q,function(j,Q){var U=L[j]={};P(Q,U,"ext."+j,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var O=M[d]={};return P(D.baseData,O,d,!1,[d],B,m),P(D.data,M,u,!1,[],B,m),JSON.stringify(N)},function(){return{item:D}})}catch{return null}};function x(D,N){var L=A[D];return L===void 0&&(D.length>=7&&(L=kse(D,"ext.metadata")||kse(D,"ext.web")),A[D]=L),L}a(x,"_isReservedField");function P(D,N,L,B,q,M,O){Yr(D,function(j,Q){var U=null;if(Q||_x(Q)){var Y=L,W=j,V=q,z=N;if(h&&!B&&Rbo.test(j)){var ie=j.split("."),H=ie.length;if(H>1){V&&(V=V.slice());for(var re=0;re0&&n<=e)return n}return e}a(uje,"_validateSizeLimit");function kbo(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a(kbo,"_getSizeLimtCfg");function Pbo(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[rtn];c||(c=e[rtn]={f:{}});var l=c[lje];if(l||(l=c[lje]={}),r)for(var u=0;u0)for(var o=e[zqe](),s=0;s0&&(n&&A5t[e]?(t[Wz][A5t[e]]=r,t[Yqe]=!0):t.url+="&"+e+"="+r)}a(Wae,"_addRequestDetails");function Obo(t,e,r){for(var n=0;n=0&&Q.splice(Se,1)},"rm")}},H[Xqe]=function(pe){try{if(b)return b.getEventBlob(pe)}catch{}return lP},H[eje]=function(){try{var pe=b&&b[tje](0,!1,!1,!1,1,0);return we(pe,x)}catch{}return null},H[X1e]=function(pe,Se){try{var Fe=[];Ct(pe,function(se){Se&&(se=RM(se));var me=L7.create(se[fS],[se]);Fe[Xm](me)});for(var te=null;Fe[Wo]>0&&b;){var Te=Fe.shift();Te&&Te[Yf]()>0&&(te=te||b[tje](0,!1,!1,!1,1,0),b.appendPayload(te,Te,ie))}var Ge=we(te,x),J={data:te[p5t],urlString:Ge.url,headers:Ge[Wz],timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};return x&&(dje(J[uP],Y1e)||(J[uP][Y1e]=t5t),dje(J[uP],qae)||(J[uP][qae]=Qqe)),J}catch{}return null};function le(pe,Se){try{return V&&V.getSenderInst(pe,Se)}catch{}return null}a(le,"_getSenderInterface"),H._getDbgPlgTargets=function(){return[g[0],c,b,g,Le(),s,ie]};function Le(){try{var pe={xdrOnComplete:ge,fetchOnComplete:ke,xhrOnComplete:X,beaconOnRetry:K},Se={enableSendPromise:!1,isOneDs:!0,disableCredentials:!re,fetchCredentials:z,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:L,timeWrapper:Y,addNoResponse:q,senderOnCompleteCallBack:pe};return Se}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(pe,Se,Fe){var te=kM(pe);ee(Se,200,{},te),F(te)}a(ge,"_xdrOncomplete");function Ue(){var pe;s=null,c=new Xen,l=!1,u=new Zen,d=!1,f=0,h=null,m=null,g=null,A=null,y=!0,E=[],_={},v=[],b=null,T=!1,w=null,R=!1,x=!1,P=pe,N=pe,L=pe,B=pe,q=pe,M=[],O=pe,j=pe,Q=[],U=!1,Y=Vae(),W=!1,V=null,ie=null}a(Ue,"_initDefaults");function ke(pe,Se,Fe,te){var Te=a(function(se,me,Ce){ee(Se,se,me,Ce),F(Ce)},"handleResponse"),Ge={},J=pe[uP];J&&J.forEach(function(se,me){Ge[me]=se}),Te(pe.status,Ge,Fe||lP)}a(ke,"_fetchOnComplete");function X(pe,Se,Fe){var te=kM(pe);ee(Se,pe.status,w7(pe,!0),te),F(te)}a(X,"_xhrOnComplete");function ee(pe,Se,Fe,te){try{pe(Se,Fe,te)}catch(Te){Ra(m,2,518,dr(Te))}}a(ee,"_doOnComplete");function K(pe,Se,Fe){var te=pe,Te=200,Ge=te[Hae],J=pe.urlString+(q?Dbo:lP);try{var se=Vu();if(Ge){var me=!!A.getPlugin("LocalStorage"),Ce=[],He=[];Ct(Ge[Jy],function($e){if(Ce&&$e&&$e[Yf]()>0)for(var et=$e[LM](),ct=0;ct0&&(Ge.sentEvts=He),me||be(Ce,8003,Ge[vC],!0)}else Te=0}catch($e){DM(m,"Failed to send telemetry using sendBeacon API. Ex:"+dr($e)),Te=0}finally{ee(Se,Te,{},lP)}}a(K,"_onBeaconRetry");function he(pe){return pe===2||pe===3}a(he,"_isBeaconPayload");function Z(pe){return R&&he(pe)&&(pe=2),pe}a(Z,"_adjustSendType"),H.addHeader=function(pe,Se){_[pe]=Se},H.removeHeader=function(pe){delete _[pe]},H[eSe]=function(){return ue()&&u[J1e]()},H[Gae]=function(pe,Se){Nn(pe)&&(pe=0),R&&(pe=Z(pe),Se=2),ne(v,pe,0)&&Ne(qe(),0,!1,pe,Se||0)},H.isCompletelyIdle=function(){return!l&&f===0&&v[Wo]===0},H[tSe]=function(pe){R=pe},H.addBatch=function(pe){if(pe&&pe[Yf]()>0){if(c.isTenantKilled(pe[fS]()))return!1;v[Xm](pe)}return!0},H.teardown=function(){v[Wo]>0&&Ne(qe(),0,!0,2,2),Ct(M,function(pe){pe&&pe.rm&&pe.rm()}),M=[]},H.pause=function(){l=!0},H.resume=function(){l=!1,H[Gae](0,4)},H[rje]=function(pe,Se,Fe){pe&&pe[Yf]()>0&&(Xt(Se)&&(Se=1),R&&(Se=Z(Se),Fe=2),Ne([pe],0,!1,Se,Fe||0))};function ue(){return!l&&f0&&!l&&g[Se]&&b&&(te=Se!==0||ue()&&(Fe>0||u[J1e]())),te}a(ne,"_canSendPayload");function ce(pe){var Se={};return pe&&Ct(pe,function(Fe,te){Se[te]={iKey:Fe[fS](),evts:Fe[LM]()}}),Se}a(ce,"_createDebugBatches");function Ne(pe,Se,Fe,te,Te){if(!(!pe||pe[Wo]===0)){if(l){be(pe,1,te);return}te=Z(te);try{var Ge=pe,J=te!==0;Hp(A,function(){return"HttpManager:_sendBatches"},function(se){se&&(pe=pe.slice(0));for(var me=[],Ce=null,He=dS(),$e=g[te]||(J?g[1]:g[0]),et=$e&&$e[nje],ct=B&&(R||he(te)||et===3||$e._isSync&&et===2);ne(pe,te,Se);){var bt=pe.shift();bt&&bt[Yf]()>0&&(c.isTenantKilled(bt[fS]())?me[Xm](bt):(Ce=Ce||b[tje](Se,Fe,J,ct,Te,te),b.appendPayload(Ce,bt,ie)?Ce.overflow!==null&&(pe=[Ce.overflow][OM](pe),Ce.overflow=null,rt(Ce,He,dS(),Te),He=dS(),Ce=null):(rt(Ce,He,dS(),Te),He=dS(),pe=[bt][OM](pe),Ce=null)))}Ce&&rt(Ce,He,dS(),Te),pe[Wo]>0&&(v=pe[OM](v)),be(me,8004,te)},function(){return{batches:ce(Ge),retryCount:Se,isTeardown:Fe,isSynchronous:J,sendReason:Te,useSendBeacon:he(te),sendType:te}},!J)}catch(se){Ra(m,2,48,"Unexpected Exception sending batch: "+dr(se))}}}a(Ne,"_sendBatches");function we(pe,Se){var Fe={url:s,hdrs:{},useHdrs:!1};Se?(Fe[Wz]=Qae(Fe[Wz],_),Fe.useHdrs=$u(Fe.hdrs)[Wo]>0):Yr(_,function(se,me){y5t[se]?Wae(Fe,y5t[se],me,!1):(Fe[Wz][se]=me,Fe[Yqe]=!0)}),Wae(Fe,r5t,"NO_AUTH",Se),Wae(Fe,qqe,V1e,Se);var te=lP;Ct(pe.apiKeys,function(se){te[Wo]>0&&(te+=","),te+=se}),Wae(Fe,Gqe,te,Se),Wae(Fe,Hqe,El().toString(),Se);var Te=Ie(pe);if(_x(Te)&&(Fe.url+="&ext.intweb.msfpc="+Te),u[Vqe]()&&Wae(Fe,jqe,u[Wqe](),Se),A[$ae]){var Ge=A[$ae]();Ge>=0&&(Fe.url+="&w="+Ge)}for(var J=0;J0){var Te=!!O,Ge=g[pe.sendType];!he(pe[vC])&&pe[h5t]&&pe.sendReason===2&&(Ge=g[2]||g[3]||Ge);var J=x;(pe.isBeacon||Ge[nje]===3)&&(J=!1);var se=we(pe,J);J=J||se[Yqe];var me=dS();Hp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Ce=0;Ce0?ct[g5t]++:ct[g5t]=1}be(pe[Jy],1e3+(te||0),pe[vC],!0);var ht={data:pe[p5t],urlString:se.url,headers:se[Wz],_thePayload:pe,_sendReason:te,timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};J&&(dje(ht[uP],Y1e)||(ht[uP][Y1e]=t5t),dje(ht[uP],qae)||(ht[uP][qae]=Qqe));var We=null;Ge&&(We=a(function(ae){u.firstRequestSent();var Re=a(function(ye,oe){_t(ye,oe,pe,te)},"onComplete"),Me=pe[ije]||pe.isSync;V.preparePayload(function(ye){try{Ge.sendPOST(ye,Re,Me),j&&j(ht,ye,Me,pe[h5t])}catch(oe){ee(Re,0,{}),DM(m,"Unexpected exception sending payload. Ex:"+dr(oe))}},D,ae,Me)},"sender")),Hp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(We)if(pe[vC]===0&&f++,Te&&!pe.isBeacon&&Ge[nje]!==3){var ae={data:ht.data,urlString:ht.urlString,headers:Qae({},ht[uP]),timeout:ht.timeout,disableXhrSync:ht[c5t],disableFetchKeepAlive:ht[l5t]},Re=!1;Hp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{O(ae,function(Me){Re=!0,!y&&!Me[Hae]&&(Me[Hae]=Me[Hae]||ht[Hae],Me[oje]=Me[oje]||ht[oje]),We(Me)},pe.isSync||pe[ije])}catch{Re||We(ht)}})}else We(ht)})},function(){return{thePayload:pe,serializationStart:Se,serializationCompleted:Fe,sendReason:te}},pe.isSync)}pe.sizeExceed&&pe.sizeExceed[Wo]>0&&be(pe.sizeExceed,8003,pe[vC]),pe.failedEvts&&pe.failedEvts[Wo]>0&&be(pe.failedEvts,8002,pe[vC])}a(rt,"_doPayloadSend");function st(pe,Se){T&&Ct(pe,function(Fe){var te=Fe[rSe]=Fe[rSe]||{};Be(te,"sendEventCompleted",Se)})}a(st,"_addEventCompletedTimings");function _t(pe,Se,Fe,te){var Te=9e3,Ge=null,J=!1,se=!1;try{var me=!0;if(typeof pe!==eS){if(Se){u[Z1e](Se[qen]);var Ce=Se[Qen]||Se["kill-duration-seconds"];Ct(c[sje](Se[Uen],Ce),function($e){Ct(Fe[Jy],function(et){if(et[fS]()===$e){Ge=Ge||[];var ct=et[BM](0);Fe.numEvents-=ct[Yf](),Ge[Xm](ct)}})})}if(pe==200||pe==204){Te=200;return}(!ttn(pe)||Fe.numEvents<=0)&&(me=!1),Te=9e3+pe%1e3}if(me){Te=100;var He=Fe.retryCnt;Fe[vC]===0&&(He0&&st(Fe[LM](),Se)})}}a($t,"_addCompleteTimings");function Gt(pe,Se,Fe){Se?pe():Y.set(pe,Fe)}a(Gt,"_doAction");function Ie(pe){for(var Se=0;Se0&&o){var Te=o[Qe(Se)];if(Te){var Ge=Fe!==0;Hp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){Gt(function(){try{Te.call(o,pe,Se,Ge,Fe)}catch(J){Ra(m,1,74,"send request notification failed: "+J)}},te||Ge,0)},function(){return{batches:ce(pe),reason:Se,isSync:Ge,sendSync:te,sendType:Fe}},!Ge)}}}a(be,"_sendBatchesNotification");function Qe(pe){var Se=Mbo[pe];return _x(Se)||(Se=Fen,pe>=9e3&&pe<=9999?Se=Ben:pe>=8e3&&pe<=8999?Se=Uqe:pe>=1e3&&pe<=1999&&(Se=Len)),Se}a(Qe,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var Bbo=.25,ltn=500,Fbo=20,utn=6,dtn=2,Ubo=4,atn=2,Qbo=1,E5t=1e4,Zz="eventsDiscarded",ctn="",Fh=void 0,qbo=T_({eventsLimitInMem:{isVal:Vz,v:E5t},immediateEventLimit:{isVal:Vz,v:500},autoFlushEventsLimit:{isVal:Vz,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:jbo,v:Fh},overrideInstrumentationKey:Fh,overrideEndpointUrl:Fh,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:Fh,clearTimeoutOverride:Fh,payloadPreprocessor:Fh,payloadListener:Fh,disableEventTimings:Fh,valueSanitizer:Fh,stringifyObjects:Fh,enableCompoundKey:Fh,disableOptimizeObj:!1,fetchCredentials:Fh,transports:Fh,unloadTransports:Fh,useSendBeacon:Fh,disableFetchKeepAlive:Fh,avoidOptions:!1,xhrTimeout:Fh,disableXhrSync:Fh,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:Dh,v:utn},maxUnloadEventRetryAttempts:{isVal:Dh,v:dtn},addNoResponse:Fh,maxEvtPerBatch:{isVal:Dh,v:ltn},excludeCsMetaData:Fh,requestLimit:{}});function jbo(t){return t&&t.sendPOST}a(jbo,"isOverrideFn");var _5t=(function(t){Wy(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=z1e,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q,U,Y,W;return Si(e,r,function(V,z){he(),V._getDbgPlgTargets=function(){return[v,n]},V[zz]=function(J,se,me){Hp(se,function(){return"PostChannel:initialize"},function(){z[zz](J,se,me),j=se.getNotifyMgr();try{B=M7(yx(V[nSe]),se.evtNamespace&&se.evtNamespace()),V._addHook(lS(J,function(Ce){var He=Ce.cfg,$e=Ex(null,He,se);n=$e.getExtCfg(V[nSe],qbo),q=Vae(n[Kqe],n[Jqe]),P=!n.disableOptimizeObj&&ZOt(),M=n[Wen],H(se),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[m5t],N=n.maxEventRetryAttempts,L=n.maxUnloadEventRetryAttempts,O=n[zen],W=n.maxEvtPerBatch,tg(He.endpointUrl)?V.pause():l&&V.resume(),Ge(),U=n[Yen],Y=!!n.disableTelemetry,Q&&ie();var et=He.disablePageUnloadEvents||[];Q=kqe(Le,et,B),Q=G1e(Le,et,B)||Q,Q=$1e(ge,He.disablePageShowEvents,B)||Q})),v[zz](J,V.core,V)}catch(Ce){throw V.setInitialized(!1),Ce}},function(){return{theConfig:J,core:se,extensions:me}})},V.processTelemetry=function(J,se){Fqe(J,V[nSe]),se=se||V._getTelCtx(se);var me=J;!Y&&!o&&(U&&(me[fS]=U),ke(me,!0),D?qe(2,2):K()),V.processNext(me,se)},V.getOfflineSupport=function(){try{var J=v&&v[eje]();if(v)return{getUrl:a(function(){return J?J.url:null},"getUrl"),serialize:le,batch:re,shouldProcess:a(function(se){return!Y},"shouldProcess"),createPayload:a(function(se){return null},"createPayload"),createOneDSPayload:a(function(se){if(v[X1e])return v[X1e](se,P)},"createOneDSPayload")}}catch{}return null},V._doTeardown=function(J,se){qe(2,2),o=!0,v.teardown(),ie(),he()};function ie(){Pqe(null,B),Dqe(null,B),Nqe(null,B)}a(ie,"_removeUnloadHandlers");function H(J){var se=J[$ae];J[$ae]=function(){var me=0;return M&&(me=me|2),me|se.call(J)}}a(H,"_hookWParam");function re(J){var se=ctn;return J&&J[Wo]&&Ct(J,function(me){se&&(se+=` -`),se+=me}),se}a(re,"_batch");function le(J){var se=ctn;try{Ue(J),se=v[Xqe](J)}catch{}return se}a(le,"_serialize");function Le(J){var se=J||ff().event;se.type!=="beforeunload"&&(D=!0,v[tSe](D)),qe(2,2)}a(Le,"_handleUnloadEvents");function ge(J){D=!1,v[tSe](D)}a(ge,"_handleShowEvents");function Ue(J){J.ext&&J.ext[o5t]&&delete J.ext[o5t],J.ext&&J.ext[$qe]&&J.ext[$qe].id&&delete J.ext[$qe].id,P&&(J.ext=RM(J.ext),J.baseData&&(J.baseData=RM(J.baseData)),J.data&&(J.data=RM(J.data)))}a(Ue,"_cleanEvent");function ke(J,se){if(J[iSe]||(J[iSe]=0),J[O7]||(J[O7]=1),Ue(J),J[Yz]){if(E||l)J[O7]=3,J[Yz]=!1;else if(v){P&&(J=RM(J)),v[rje](L7.create(J[fS],[J]),J[Yz]===!0?1:J[Yz],3);return}}var me=J[O7],Ce=f,He=h;me===4&&(Ce=u,He=d);var $e=!1;if(CeJ;if(!me&&w>0)for(var Ce=1;!me&&Ce<=3;Ce++){var He=b[Ce];He&&He[Jy]&&Ct(He[Jy],function($e){$e&&$e[Yf]()>=w&&(me=!0)})}Ne(!0,me)},V.pause=function(){ue(),l=!0,v&&v.pause()},V.resume=function(){l=!1,v&&v.resume(),K()},V._loadTransmitProfiles=function(J){$t(),Yr(J,function(se,me){var Ce=me[Wo];if(Ce>=2){var He=Ce>2?me[2]:0;if(me.splice(0,Ce-2),me[1]<0&&(me[0]=-1),me[1]>0&&me[0]>0){var $e=me[0]/me[1];me[0]=ZKr($e)*me[1]}He>=0&&me[1]>=0&&He>me[1]&&(He=me[1]),me[Xm](He),m[se]=me}})},V.flush=function(J,se,me){J===void 0&&(J=!0);var Ce;if(!l)if(me=me||1,J)se||(Ce=Dd(function($e){se=$e})),c==null?(ue(),st(1,0,me),c=Z(function(){c=null,_t(se,me)},0)):s[Xm](se);else{var He=ue();X(1,1,me),se&&se(),He&&K()}return Ce},V.setMsaAuthTicket=function(J){v.addHeader(K1e,J)},V.setAuthPluginHeader=function(J){v.addHeader(n5t,J)},V.removeAuthPluginHeader=function(){v.removeHeader(n5t)},V.hasEvents=ee,V._setTransmitProfile=function(J){g!==J&&m[J]!==void 0&&(ue(),g=J,K())},x7(V,function(){return v},["addResponseHandler"]);function X(J,se,me){var Ce=st(J,se,me);return v[Gae](se,me),Ce}a(X,"_sendEventsForLatencyAndAbove");function ee(){return f>0}a(ee,"_hasEvents");function K(){if(R>=0&&st(R,0,x)&&v[Gae](0,x),u>0&&!y&&!l){var J=m[g][2];J>=0&&(y=Z(function(){y=null,X(4,0,1),K()},J))}var se=m[g][1];!A&&!c&&se>=0&&!l&&(ee()?A=Z(function(){A=null,X(_===0?3:1,0,1),_++,_%=2,K()},se):_=0)}a(K,"_scheduleTimer"),V[aje]=function(){E0&&f>T&&(se=!0),se&&c==null&&V.flush(J,function(){},20))}a(Ne,"_performAutoFlush");function we(J,se){P&&(J=RM(J));var me=J[O7],Ce=ce(J[fS],me,!0);return Ce.addEvent(J)?(me!==4?(f++,se&&J[iSe]===0&&Ne(!J.sync,w>0&&Ce[Yf]()>=w)):u++,!0):!1}a(we,"_addEventToProperQueue");function Be(J,se,me,Ce){for(;me<=se;){var He=ce(J,se,!0);if(He&&He[Yf]()>0){var $e=He[BM](0,Ce),et=$e[Yf]();if(et>0)return me===4?u-=et:f-=et,Qe(Zz,[$e],CM.QueueFull),!0}me++}return rt(),!1}a(Be,"_dropEventWithLatencyOrLess");function rt(){for(var J=0,se=0,me=a(function(He){var $e=b[He];$e&&$e[Jy]&&Ct($e[Jy],function(et){He===4?J+=et[Yf]():se+=et[Yf]()})},"_loop_1"),Ce=1;Ce<=4;Ce++)me(Ce);f=se,u=J}a(rt,"_resetQueueCounts");function st(J,se,me){var Ce=!1,He=se===0;return!He||v[eSe]()?Hp(V.core,function(){return"PostChannel._queueBatches"},function(){for(var $e=[],et=4;et>=J;){var ct=b[et];ct&&ct.batches&&ct.batches[Wo]>0&&(Ct(ct[Jy],function(bt){v.addBatch(bt)?Ce=Ce||bt&&bt[Yf]()>0:$e=$e[OM](bt[LM]()),et===4?u-=bt[Yf]():f-=bt[Yf]()}),ct[Jy]=[],ct.iKeyMap={}),et--}$e[Wo]>0&&be(Zz,$e,CM.KillSwitch),Ce&&R>=J&&(R=-1,x=0)},function(){return{latency:J,sendType:se,sendReason:me}},!He):(R=R>=0?QU(R,J):J,x=zk(x,me)),Ce}a(st,"_queueBatches");function _t(J,se){X(1,0,se),rt(),Dt(function(){J&&J(),s[Wo]>0?c=Z(function(){c=null,_t(s.shift(),se)},0):(c=null,K())})}a(_t,"_flushImpl");function Dt(J){v.isCompletelyIdle()?J():c=Z(function(){c=null,Dt(J)},Bbo)}a(Dt,"_waitForIdleManager");function $t(){ue(),Gt(),g=z1e,K()}a($t,"_resetTransmitProfiles");function Gt(){m={},m[z1e]=[2,1,0],m[Men]=[6,3,0],m[Oen]=[18,9,0]}a(Gt,"_initializeProfiles");function Ie(J,se){var me=[],Ce=N;D&&(Ce=L),Ct(J,function(He){He&&He[Yf]()>0&&Ct(He[LM](),function($e){$e&&($e[Yz]&&($e[O7]=4,$e[Yz]=!1),$e[iSe]0&&be(Zz,me,CM.NonRetryableStatus),D&&qe(2,2)}a(Ie,"_requeueEvents");function F(J,se){var me=j||{},Ce=me[J];if(Ce)try{Ce.apply(me,se)}catch(He){Ra(V.diagLog(),1,74,J+" notification failed: "+He)}}a(F,"_callNotification");function be(J,se){for(var me=[],Ce=2;Ce0&&F(J,[se][OM](me))}a(be,"_notifyEvents");function Qe(J,se){for(var me=[],Ce=2;Ce0&&Ct(se,function(He){He&&He[Yf]()>0&&F(J,[He.events()][OM](me))})}a(Qe,"_notifyBatchEvents");function pe(J,se,me){J&&J[Wo]>0&&F("eventsSendRequest",[se>=1e3&&se<=1999?se-1e3:0,me!==!0])}a(pe,"_sendingEvent");function Se(J,se){Qe("eventsSent",J,se),K()}a(Se,"_eventsSentEvent");function Fe(J,se){Qe(Zz,J,se>=8e3&&se<=8999?se-8e3:CM.Unknown)}a(Fe,"_eventsDropped");function te(J){Qe(Zz,J,CM.NonRetryableStatus),K()}a(te,"_eventsResponseFail");function Te(J,se){Qe(Zz,J,CM.Unknown),K()}a(Te,"_otherEvent");function Ge(){O?w=0:w=zk(W*(atn+1),h/6)}a(Ge,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Bae);var pS=de(require("os"));var fje=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=Hbo(e),this.commonProperties=Gbo(e),this.#e=bs(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new XOt,n=new _5t,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){Nr.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){Nr.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(Ur).resolveSession();e?.login?this.commonProperties["common.github_handle"]=e.login:delete this.commonProperties["common.github_handle"]}catch(e){Nr.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(tr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function Hbo(t){let e={},r=t.get(Ua);e["ai.session.id"]=r.sessionId;let n=t.get(Op);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${pS.type()} ${pS.release()}`,e["ai.device.osArchitecture"]=pS.arch(),e["ai.device.osPlatform"]=pS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ds).getVersion(),e}a(Hbo,"getTags");function Gbo(t){let e={};e.common_os=pS.platform(),e.common_platformversion=pS.release(),e.common_arch=pS.arch(),e.common_cpu=Array.from(new Set(pS.cpus().map(n=>n.model))).join();let r=t.get(Ua);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(Gbo,"getCommonProperties");var $bo="7d7048df-6dd0-4048-bb23-b716c1461f8f",Vbo="3fdd7f28-937a-48c8-9a21-ba337db23bd1",Wbo="b73649cf-ca8f-4768-9e0e-b789d8529db5",zbo="5fb6107a-6a29-423f-a824-22e3724fa2a6",Ybo="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function Kbo(t){return MU(t)==="prod"?Wbo:zbo}a(Kbo,"getMsftInstrumentationKey");function ftn(t){return new URL(t).hostname==="github.com"?VW.telemetry:t.replace("://","://copilot-telemetry-service.")}a(ftn,"getEndpointForServerUrl");var pf=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=ftn(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];bs(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(X0);if(o.setReporter(new fae(r,this.namespace,{instrumentationKey:$bo,endpointUrl:n})),o.setRestrictedReporter(new fae(r,this.namespace,{instrumentationKey:Vbo,endpointUrl:n})),o.setMsftReporter(new fae(r,`copilot/${this.namespace}`,{instrumentationKey:Kbo(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new fje(r,"ThirdParty.copilot-chat",Ybo,!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(X0);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(X0).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=ftn(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function Jbo(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await Gf(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(pf).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return b_.exception(t,n,"signUpLimited failed"),!1}}a(Jbo,"apiFetchSignUpLimited");async function C5t(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 Jbo(t,e)?C5t(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(C5t,"getTokenWithSignUpLimited");p();p();var ptn=de(ri());var Wi=class extends ptn.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var Zbo={didChangeFeatureFlags:!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},bn=class{constructor(){this.capabilities={...Zbo};this.emitter=new Wi;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 i3=require("fs"),zae=require("os"),Yae=de(require("path")),B7=require("process");var Yn=class{static{a(this,"PersistenceManager")}},b5t=class extends Yn{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 i3.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=Yae.dirname(s);c!==this.directory&&await i3.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await oSe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await i3.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 oSe.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+` +`)}`}}let l=t.get(Ir).getEditorInfo(),u;l.root&&(u=[{prefix:`${l.name}:`,path:l.root}]);let d=_se(t),f=TGr(c,u,d),h=Iyo(c),m=h==="exception",g=Wt.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=pPt(y.value):y.value="[redacted]");s??=lGr(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(eM).isThrottled(A)){if(d){let y=SGr(c,u),E=Wt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:y.stack||y.toString(),message:y.message,...o});s.rollup_id!=="auto"&&(E.properties.errno=s.rollup_id),await E.makeReadyForSending(t,1,"IncludeExp",r),E.properties.unique_id=g.properties.unique_id,g.properties.restricted_unique_id=E.properties.unique_id,abe(t,1,`error.${h}`,E)}m&&(g.properties.failbot_payload=JSON.stringify(s)),abe(t,0,`error.${h}`,g)}}a(_Kr,"_telemetryException");function z0(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await _Kr(t,c,yl(),r,n)}},"wrapped");return(...s)=>t.get(xd).register(o(...s))}a(z0,"telemetryCatch");function eg(t,e,r,n){return t.get(xd).register(Nyo(t,e,yl(),r?.extendedBy(),n))}a(eg,"telemetryError");async function Nyo(t,e,r,n,o=0){if(sbe(o)&&!_se(t))return;let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),wyo(t,o,e,s)}a(Nyo,"_telemetryError");function vKr(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=Wt.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),Et(t,"engine.completion",u,1)}a(vKr,"logEngineCompletion");function CKr(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 Et(t,"engine.prompt",o,1)}a(CKr,"logEnginePrompt");function Myo(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(Myo,"buildErrorFromUnknown");p();var HW=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Gm(t){return!t||typeof t!="object"?!1:t instanceof HW||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Gm,"isAbortError");var Cse=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},cM=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}`}},Oyo=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 tx(t,e=!0){return t instanceof Error?e&&"cause"in t&&tx(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof Cse||t instanceof cM||t?.message?.startsWith("net::")||Oyo.has(t.code??""):!1}a(tx,"isNetworkError");var rx=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 Cse(`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 Cse(`Response body truncated: actualLength=${s}`,"Truncated"):new Cse(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function LU(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(LU,"parseRetryAfterSeconds");var nr=class{static{a(this,"Fetcher")}getImplementation(){return this}};function GW(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={...l,...m?{}:{Authorization:`Bearer ${r}`},...Gy(t)};d===void 0&&(g["Openai-Organization"]="github-copilot",g["X-Request-Id"]=o,g["VScode-SessionId"]=t.get(Fa).sessionId,g["VScode-MachineId"]=t.get(Fa).machineId,g["X-GitHub-Api-Version"]="2026-01-09"),n&&(g["OpenAI-Intent"]=n);let A={method:"POST",headers:g,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:g,messages:h,body:s});let y=t.get(nr);if(c){let _=new AbortController;c.onCancellationRequested(()=>{Et(t,"networking.cancelRequest",Wt.createAndMarkAsIssued({headerRequestId:o})),_.abort()}),A.signal=_.signal}return y.fetch(e,A).catch(_=>{if(Lyo(_))return Et(t,"networking.disconnectAll"),y.disconnectAll().then(()=>y.fetch(e,A));throw _})}a(GW,"postRequest");function Lyo(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(Lyo,"isInterruptedNetworkError");p();function a7e(){return typeof process>"u"}a(a7e,"isWeb");function CB(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(CB,"isMsBenchModeEnabled");var BDt=class extends cM{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 Gf(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...a7e()?{}:Gy(t),...n.headers}};let o=await t.get(nr).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new cM(o);if(!o.headers.get("x-github-request-id"))throw new BDt(o);return o}a(Gf,"apiFetch");p();p();var ts=class{constructor(){this.recentNotifications=new Cn(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 la=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 xKr=require("os"),c7e=require("path");p();var TKr;(()=>{"use strict";var t={975:L=>{function B(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}a(B,"e");function q(O,j){for(var Q,U="",Y=0,W=-1,V=0,z=0;z<=O.length;++z){if(z2){var ie=U.lastIndexOf("/");if(ie!==U.length-1){ie===-1?(U="",Y=0):Y=(U=U.slice(0,ie)).length-1-U.lastIndexOf("/"),W=z,V=0;continue}}else if(U.length===2||U.length===1){U="",Y=0,W=z,V=0;continue}}j&&(U.length>0?U+="/..":U="..",Y=2)}else U.length>0?U+="/"+O.slice(W+1,z):U=O.slice(W+1,z),Y=z-W-1;W=z,V=0}else Q===46&&V!==-1?++V:V=-1}return U}a(q,"r");var M={resolve:a(function(){for(var O,j="",Q=!1,U=arguments.length-1;U>=-1&&!Q;U--){var Y;U>=0?Y=arguments[U]:(O===void 0&&(O=process.cwd()),Y=O),B(Y),Y.length!==0&&(j=Y+"/"+j,Q=Y.charCodeAt(0)===47)}return j=q(j,!Q),Q?j.length>0?"/"+j:"/":j.length>0?j:"."},"resolve"),normalize:a(function(O){if(B(O),O.length===0)return".";var j=O.charCodeAt(0)===47,Q=O.charCodeAt(O.length-1)===47;return(O=q(O,!j)).length!==0||j||(O="."),O.length>0&&Q&&(O+="/"),j?"/"+O:O},"normalize"),isAbsolute:a(function(O){return B(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var O,j=0;j0&&(O===void 0?O=Q:O+="/"+Q)}return O===void 0?".":M.normalize(O)},"join"),relative:a(function(O,j){if(B(O),B(j),O===j||(O=M.resolve(O))===(j=M.resolve(j)))return"";for(var Q=1;Qz){if(j.charCodeAt(W+H)===47)return j.slice(W+H+1);if(H===0)return j.slice(W+H)}else Y>z&&(O.charCodeAt(Q+H)===47?ie=H:H===0&&(ie=0));break}var re=O.charCodeAt(Q+H);if(re!==j.charCodeAt(W+H))break;re===47&&(ie=H)}var le="";for(H=Q+ie+1;H<=U;++H)H!==U&&O.charCodeAt(H)!==47||(le.length===0?le+="..":le+="/..");return le.length>0?le+j.slice(W+ie):(W+=ie,j.charCodeAt(W)===47&&++W,j.slice(W))},"relative"),_makeLong:a(function(O){return O},"_makeLong"),dirname:a(function(O){if(B(O),O.length===0)return".";for(var j=O.charCodeAt(0),Q=j===47,U=-1,Y=!0,W=O.length-1;W>=1;--W)if((j=O.charCodeAt(W))===47){if(!Y){U=W;break}}else Y=!1;return U===-1?Q?"/":".":Q&&U===1?"//":O.slice(0,U)},"dirname"),basename:a(function(O,j){if(j!==void 0&&typeof j!="string")throw new TypeError('"ext" argument must be a string');B(O);var Q,U=0,Y=-1,W=!0;if(j!==void 0&&j.length>0&&j.length<=O.length){if(j.length===O.length&&j===O)return"";var V=j.length-1,z=-1;for(Q=O.length-1;Q>=0;--Q){var ie=O.charCodeAt(Q);if(ie===47){if(!W){U=Q+1;break}}else z===-1&&(W=!1,z=Q+1),V>=0&&(ie===j.charCodeAt(V)?--V==-1&&(Y=Q):(V=-1,Y=z))}return U===Y?Y=z:Y===-1&&(Y=O.length),O.slice(U,Y)}for(Q=O.length-1;Q>=0;--Q)if(O.charCodeAt(Q)===47){if(!W){U=Q+1;break}}else Y===-1&&(W=!1,Y=Q+1);return Y===-1?"":O.slice(U,Y)},"basename"),extname:a(function(O){B(O);for(var j=-1,Q=0,U=-1,Y=!0,W=0,V=O.length-1;V>=0;--V){var z=O.charCodeAt(V);if(z!==47)U===-1&&(Y=!1,U=V+1),z===46?j===-1?j=V:W!==1&&(W=1):j!==-1&&(W=-1);else if(!Y){Q=V+1;break}}return j===-1||U===-1||W===0||W===1&&j===U-1&&j===Q+1?"":O.slice(j,U)},"extname"),format:a(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(j,Q){var U=Q.dir||Q.root,Y=Q.base||(Q.name||"")+(Q.ext||"");return U?U===Q.root?U+Y:U+"/"+Y:Y})(0,O)},"format"),parse:a(function(O){B(O);var j={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return j;var Q,U=O.charCodeAt(0),Y=U===47;Y?(j.root="/",Q=1):Q=0;for(var W=-1,V=0,z=-1,ie=!0,H=O.length-1,re=0;H>=Q;--H)if((U=O.charCodeAt(H))!==47)z===-1&&(ie=!1,z=H+1),U===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&&(j.base=j.name=V===0&&Y?O.slice(1,z):O.slice(V,z)):(V===0&&Y?(j.name=O.slice(1,W),j.base=O.slice(1,z)):(j.name=O.slice(V,W),j.base=O.slice(V,z)),j.ext=O.slice(W,z)),V>0?j.dir=O.slice(0,V-1):Y&&(j.dir="/"),j},"parse"),sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,L.exports=M}},e={};function r(L){var B=e[L];if(B!==void 0)return B.exports;var q=e[L]={exports:{}};return t[L](q,q.exports,r),q.exports}a(r,"r"),r.d=(L,B)=>{for(var q in B)r.o(B,q)&&!r.o(L,q)&&Object.defineProperty(L,q,{enumerable:!0,get:B[q]})},r.o=(L,B)=>Object.prototype.hasOwnProperty.call(L,B),r.r=L=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__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(L,B){if(!L.scheme&&B)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${L.authority}", path: "${L.path}", query: "${L.query}", fragment: "${L.fragment}"}`);if(L.scheme&&!s.test(L.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(L.path){if(L.authority){if(!c.test(L.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(L.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,O,j,Q=!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(U,Y){return U||Y?U:"file"})(B,Q),this.authority=q||d,this.path=(function(U,Y){switch(U){case"https":case"http":case"file":Y?Y[0]!==f&&(Y=f+Y):Y=f}return Y})(this.scheme,M||d),this.query=O||d,this.fragment=j||d,u(this,Q))}get fsPath(){return v(this,!1)}with(B){if(!B)return this;let{scheme:q,authority:M,path:O,query:j,fragment:Q}=B;return q===void 0?q=this.scheme:q===null&&(q=d),M===void 0?M=this.authority:M===null&&(M=d),O===void 0?O=this.path:O===null&&(O=d),j===void 0?j=this.query:j===null&&(j=d),Q===void 0?Q=this.fragment:Q===null&&(Q=d),q===this.scheme&&M===this.authority&&O===this.path&&j===this.query&&Q===this.fragment?this:new A(q,M,O,j,Q)}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 b(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?b(this,!0):(this._formatted||(this._formatted=b(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 E(L,B,q){let M,O=-1;for(let j=0;j=97&&Q<=122||Q>=65&&Q<=90||Q>=48&&Q<=57||Q===45||Q===46||Q===95||Q===126||B&&Q===47||q&&Q===91||q&&Q===93||q&&Q===58)O!==-1&&(M+=encodeURIComponent(L.substring(O,j)),O=-1),M!==void 0&&(M+=L.charAt(j));else{M===void 0&&(M=L.substr(0,j));let U=y[Q];U!==void 0?(O!==-1&&(M+=encodeURIComponent(L.substring(O,j)),O=-1),M+=U):O===-1&&(O=j)}}return O!==-1&&(M+=encodeURIComponent(L.substring(O))),M!==void 0?M:L}a(E,"m");function _(L){let B;for(let q=0;q1&&L.scheme==="file"?`//${L.authority}${L.path}`:L.path.charCodeAt(0)===47&&(L.path.charCodeAt(1)>=65&&L.path.charCodeAt(1)<=90||L.path.charCodeAt(1)>=97&&L.path.charCodeAt(1)<=122)&&L.path.charCodeAt(2)===58?B?L.path.substr(1):L.path[1].toLowerCase()+L.path.substr(2):L.path,o&&(q=q.replace(/\//g,"\\")),q}a(v,"v");function b(L,B){let q=B?_:E,M="",{scheme:O,authority:j,path:Q,query:U,fragment:Y}=L;if(O&&(M+=O,M+=":"),(j||O==="file")&&(M+=f,M+=f),j){let W=j.indexOf("@");if(W!==-1){let V=j.substr(0,W);j=j.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+="@"}j=j.toLowerCase(),W=j.lastIndexOf(":"),W===-1?M+=q(j,!1,!0):(M+=q(j.substr(0,W),!1,!0),M+=j.substr(W))}if(Q){if(Q.length>=3&&Q.charCodeAt(0)===47&&Q.charCodeAt(2)===58){let W=Q.charCodeAt(1);W>=65&&W<=90&&(Q=`/${String.fromCharCode(W+32)}:${Q.substr(3)}`)}else if(Q.length>=2&&Q.charCodeAt(1)===58){let W=Q.charCodeAt(0);W>=65&&W<=90&&(Q=`${String.fromCharCode(W+32)}:${Q.substr(2)}`)}M+=q(Q,!0,!1)}return U&&(M+="?",M+=q(U,!1,!1)),Y&&(M+="#",M+=B?Y:E(Y,!1,!1)),M}a(b,"b");function T(L){try{return decodeURIComponent(L)}catch{return L.length>3?L.substr(0,3)+T(L.substr(3)):L}}a(T,"C");let w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function R(L){return L.match(w)?L.replace(w,(B=>T(B))):L}a(R,"w");var x=r(975);let P=x.posix||x,D="/";var N;(function(L){L.joinPath=function(B,...q){return B.with({path:P.join(B.path,...q)})},L.resolvePath=function(B,...q){let M=B.path,O=!1;M[0]!==D&&(M=D+M,O=!0);let j=P.resolve(M,...q);return O&&j[0]===D&&!B.authority&&(j=j.substring(1)),B.with({path:j})},L.dirname=function(B){if(B.path.length===0||B.path===D)return B;let q=P.dirname(B.path);return q.length===1&&q.charCodeAt(0)===46&&(q=""),B.with({path:q})},L.basename=function(B){return P.basename(B.path)},L.extname=function(B){return P.extname(B.path)}})(N||(N={})),TKr=n})();var{URI:BU,Utils:cbe}=TKr;function wKr(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+wKr(t.substring(3)):t}}a(wKr,"decodeURIComponentGraceful");var IKr=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function FDt(t){return t.match(IKr)?t.replace(IKr,e=>wKr(e)):t}a(FDt,"percentDecode");function Ks(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 BU.file(t).toString()}a(Ks,"makeFsUri");function to(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?BU.parse(e[1]+e[2],!0):BU.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(to,"parseUri");function l7e(t){return to(t),t}a(l7e,"validateUri");function Fs(t){try{return to(t).toString()}catch{return t}}a(Fs,"normalizeUri");function RKr(t){let e=Fs(t);return e.endsWith("/")?e.slice(0,-1):e}a(RKr,"normalizeUriNoTrailingSlash");var $W=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function un(t){let e=to(t);if(!$W.has(e.scheme)&&!la.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,xKr.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,c7e.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(un,"fsPath");function rs(t){try{return un(t)}catch{return}}a(rs,"getFsPath");function kKr(t){let e=rs(t);if(e)return BU.file(e).toString()}a(kKr,"getFsUri");function VW(t,...e){let r,n=rs(t);return n?r=Ks((0,c7e.resolve)(n,...e)):r=cbe.resolvePath(to(t),...e.map(o=>PKr(o))).toString(),typeof t=="string"?r:{uri:r}}a(VW,"resolveFilePath");function xa(t,...e){let r=cbe.joinPath(to(t),...e.map(PKr)).toString();return typeof t=="string"?r:{uri:r}}a(xa,"joinPath");function PKr(t){return Byo(t)?t.replaceAll("\\","/"):t}a(PKr,"pathToURIPath");function Byo(t){return/^[^/\\]*\\/.test(t)}a(Byo,"isWinPath");function Ji(t){return FDt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(Ji,"basename");function uf(t){let e=cbe.dirname(to(t)),r;return $W.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(uf,"dirname");function DKr(t){return cbe.extname(to(t))}a(DKr,"extname");var $m=class{static{a(this,"NetworkConfiguration")}};function u7e(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!QDt(t)&&r.protocol==="http:")return r.href}catch{}}a(u7e,"ensurePermittedUrl");var WW={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 UDt(t,e,r){if(r&&O1(t)){for(let n of r){let o=Ft(t,n);if(o)return o}return}for(let n of e){let o=Ft(t,n);if(o)return o}}a(UDt,"urlConfigOverride");function Fyo(t,e){switch(e){case"api":return UDt(t,[Ye.DebugOverrideCapiUrl,Ye.DebugOverrideCapiUrlLegacy],[Ye.DebugTestOverrideCapiUrl,Ye.DebugTestOverrideCapiUrlLegacy]);case"proxy":return UDt(t,[Ye.DebugOverrideProxyUrl,Ye.DebugOverrideProxyUrlLegacy],[Ye.DebugTestOverrideProxyUrl,Ye.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!QDt(t))return UDt(t,[Ye.DebugSnippyOverrideUrl])}}a(Fyo,"getEndpointOverrideUrl");function nx(t,e,r,...n){let o=Fyo(t,r)??e.endpoints[r];return xa(o,...n)}a(nx,"getEndpointUrl");function bB(t){return ix(t)?.endpoints??WW}a(bB,"getLastKnownEndpoints");function d7e(t,e){if(e&&!u7e(t,e)){t.get(ts).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get($m).setConfiguredUrls(t,{serverUrl:e})}a(d7e,"updateServerUrl");p();var Vm=class{static{a(this,"UrlOpener")}};var b_=new fe("auth"),qDt=60,Uyo=300;var Qyo=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],qyo="4535c7beffc844b46bb1ed4aa04d759a";function $y(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($y,"fillGitHubUrls");function FU(){return Math.floor(Date.now()/1e3)}a(FU,"nowSeconds");async function jDt(t,e,r){let n=Wt.createAndMarkAsIssued({},{});Et(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await Gf(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 b_.info(t,`${h}${y}`),eg(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:h}}if(!s.ok||!c.token){b_.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),eg(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"&&jyo(t,h,e),{failureKind:"NotAuthorized",message:h?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let l=FU()+c.refresh_in+qDt,u=await lbe(t,e),d;u.ok&&(d=await u.json());let f=new zW(c,d,l);return Et(t,"auth.new_token",n.extendedBy({...sPt(f)},{adjusted_expires_at:f.expiresAt,expires_at:c.expires_at,current_time:FU()})),{copilotToken:f}}a(jDt,"authFromGitHubSession");var Rh=class{static{a(this,"CopilotTokenFetcher")}},f7e=class extends Rh{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await jDt(e,r,n)}};async function lbe(t,e){return await Gf(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(lbe,"fetchCopilotUserInfo");function jyo(t,e,r){e&&t.get(ts).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(Vm).open(l)}e.notification_id&&s&&await Hyo(t,e.notification_id,r)}).catch(n=>{b_.exception(t,n,"copilotToken.notification")})}a(jyo,"notifyUser");async function Hyo(t,e,r){let n=await Gf(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&b_.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(Hyo,"sendNotificationResultToGitHub");var zW=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 N6e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...WW,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-Uyo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(qyo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var yi=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function p7e(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(p7e,"authEnvVarConflictMessage");var UU=class extends yi{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function NKr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new yi("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new yi("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new yi("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(NKr,"validateGitHubServerUrl");p();p();var ox=class{static{a(this,"AuthRepository")}};p();function MKr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=NKr(r),{apiUrl:o}=$y({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(MKr,"buildAuthServerEndpoint");function QU(t,e){if(e!==void 0)return MKr(e);{let r=t.get($m),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(QU,"resolveAuthServerEndpoint");function HDt(t){if(!t)return!1;try{return MKr(t),!0}catch{return!1}}a(HDt,"isValidAuthServer");p();p();p();p();p();p();p();p();function IB(t,e){return t||e}a(IB,"_pureAssign");function Wm(t,e){return t[e]}a(Wm,"_pureRef");var hC=void 0,kh=null,iNt="",v7e="function",dbe="object",SB="prototype",rNt="__proto__",YW="undefined",A7e="constructor",oNt="Symbol",Gyo="_polyfill",KW="length",y7e="name",AA="call",C7e="toString",sx=IB(Object),sNt=Wm(sx,SB),QKr=IB(String),JW=Wm(QKr,SB),fbe=IB(Math),qKr=IB(Array),b7e=Wm(qKr,SB),TB=Wm(b7e,"slice");function $f(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a($f,"safe");function $yo(t,e){var r=$f(t);return r.e?e:r.v}a($yo,"safeGet");var GDt;function S7e(t){return function(e){return typeof e===t}}a(S7e,"_createIs");function jKr(t){var e="[object "+t+"]";return function(r){return!!(r&&pbe(r)===e)}}a(jKr,"_createObjIs");function pbe(t){return sNt[C7e].call(t)}a(pbe,"objToString");function Nn(t){return typeof t===YW||t===YW}a(Nn,"isUndefined");function Vyo(t){return!Tse(t)}a(Vyo,"isStrictUndefined");function Xt(t){return t===kh||Nn(t)}a(Xt,"isNullOrUndefined");function Wyo(t){return t===kh||!Tse(t)}a(Wyo,"isStrictNullOrUndefined");function Tse(t){return!!t||t!==hC}a(Tse,"isDefined");function zyo(t){return!GDt&&(GDt=["string","number","boolean",YW,"symbol","bigint"]),t!==dbe&&GDt.indexOf(t)!==-1}a(zyo,"isPrimitiveType");var Ei=S7e("string"),Or=S7e(v7e);function Gu(t){return!t&&Xt(t)?!1:!!t&&typeof t===dbe}a(Gu,"isObject");var ur=Wm(qKr,"isArray"),T7e=jKr("Date"),Dh=S7e("number"),zk=S7e("boolean");var xB=jKr("Error");function tg(t){return!!(t&&t.then&&Or(t.then))}a(tg,"isPromiseLike");function W1(t){return!(!t||$yo(function(){return!(t&&0+t)},!t))}a(W1,"isTruthy");var Ise=Wm(sx,"getOwnPropertyDescriptor");function rg(t,e){return!!t&&sNt.hasOwnProperty[AA](t,e)}a(rg,"objHasOwnProperty");var yA=IB(Wm(sx,"hasOwn"),Yyo);function Yyo(t,e){return rg(t,e)||!!Ise(t,e)}a(Yyo,"polyObjHasOwn");function Yr(t,e,r){if(t&&Gu(t)){for(var n in t)if(yA(t,n)&&e[AA](r||t,n,t[n])===-1)break}}a(Yr,"objForEachKey");var h7e={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function Kyo(t){var e={};if(e[h7e.c]=!0,e[h7e.e]=!0,t.l){e.get=function(){return t.l.v};var r=Ise(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return Yr(t,function(n,o){e[h7e[n]]=Vyo(o)?e[h7e[n]]:o}),e}a(Kyo,"_createProp");var S_=Wm(sx,"defineProperty"),HKr=Wm(sx,"defineProperties");function ji(t,e,r){return S_(t,e,Kyo(r))}a(ji,"objDefine");function GKr(t,e,r,n,o){var s={};return Yr(t,function(c,l){E7e(s,c,e?l:c),E7e(s,l,r?l:c)}),n?n(s):s}a(GKr,"_createKeyValueMap");function E7e(t,e,r,n){S_(t,e,{value:r,enumerable:!0,writable:!1})}a(E7e,"_assignMapValue");var Hu=IB(QKr),Jyo="[object Error]";function dr(t,e){var r=iNt,n=sNt[C7e][AA](t);n===Jyo&&(t={stack:Hu(t.stack),message:Hu(t.message),name:Hu(t.name)});try{r=JSON.stringify(t,kh,e?typeof e=="number"?e:4:hC),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):kh)||Hu(t)}catch(o){r=" - "+dr(o,e)}return n+": "+r}a(dr,"dumpObj");function Zc(t){throw new Error(t)}a(Zc,"throwError");function zm(t){throw new TypeError(t)}a(zm,"throwTypeError");var $Kr=Wm(sx,"freeze");function Zyo(t){return t}a(Zyo,"_doNothing");function Xyo(t){return t[rNt]||kh}a(Xyo,"_getProto");var wB=Wm(sx,"assign"),$u=Wm(sx,"keys");function T_(t){return $Kr&&Yr(t,function(e,r){(ur(r)||Gu(r))&&T_(r)}),Nh(t)}a(T_,"objDeepFreeze");var Nh=IB($Kr,Zyo);var nNt=IB(Wm(sx,"getPrototypeOf"),Xyo);function I7e(t){return GKr(t,1,0,Nh)}a(I7e,"createEnum");function eEo(t){return GKr(t,0,0,Nh)}a(eEo,"createEnumKeyMap");function tEo(t){var e={};return Yr(t,function(r,n){E7e(e,r,n[1]),E7e(e,n[0],n[1])}),Nh(e)}a(tEo,"createSimpleMap");function aNt(t){return tEo(t)}a(aNt,"createTypeMap");var VKr=eEo({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}),OKr="__tsUtils$gblCfg",$Dt;function WKr(){var t;return typeof globalThis!==YW&&(t=globalThis),!t&&typeof self!==YW&&(t=self),!t&&typeof window!==YW&&(t=window),!t&&typeof global!==YW&&(t=global),t}a(WKr,"_getGlobalValue");function zKr(){if(!$Dt){var t=$f(WKr).v||{};$Dt=t[OKr]=t[OKr]||{}}return $Dt}a(zKr,"_getGlobalConfig");var xse=hbe;function hbe(t,e,r){var n=e?e[t]:kh;return function(o){var s=(o?o[t]:kh)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?TB[AA](c,1):c)}zm('"'+Hu(t)+'" not defined for '+dr(o))}}a(hbe,"_unwrapFunctionWithPoly");function rEo(t){return function(e){return e[t]}}a(rEo,"_unwrapProp");var qU=Wm(fbe,"min"),Yk=Wm(fbe,"max"),LKr=xse("slice",JW),Vf=xse("substring",JW),x7e=hbe("substr",JW,nEo);function nEo(t,e,r){return Xt(t)&&zm("Invalid "+dr(t)),r<0?iNt:(e=e||0,e<0&&(e=Yk(e+t[KW],0)),Nn(r)?LKr(t,e):LKr(t,e,e+r))}a(nEo,"polyStrSubstr");function lM(t,e){return Vf(t,0,e)}a(lM,"strLeft");var BKr="_urid",VDt;function iEo(){if(!VDt){var t=zKr();VDt=t.gblSym=t.gblSym||{k:{},s:{}}}return VDt}a(iEo,"_globalSymbolRegistry");var m7e;function cNt(t){var e={description:Hu(t),toString:a(function(){return oNt+"("+t+")"},"toString")};return e[Gyo]=!0,e}a(cNt,"polyNewSymbol");function oEo(t){var e=iEo();if(!yA(e.k,t)){var r=cNt(t),n=$u(e.s).length;r[BKr]=function(){return n+"_"+r[C7e]()},e.k[t]=r,e.s[r[BKr]()]=Hu(t)}return e.k[t]}a(oEo,"polySymbolFor");function sEo(t){!m7e&&(m7e={});var e,r=VKr[t];return r&&(e=m7e[r]=m7e[r]||cNt(oNt+"."+r)),e}a(sEo,"polyGetKnownSymbol");var Ph;function jU(){Ph=zKr()}a(jU,"_initTestHooks");function w7e(t){var e={};return!Ph&&jU(),e.b=Ph.lzy,S_(e,"v",{configurable:!0,get:a(function(){var r=t();return Ph.lzy||S_(e,"v",{value:r}),e.b=Ph.lzy,r},"get")}),e}a(w7e,"getLazy");function z1(t){return S_({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(z1,"createCachedValue");var YKr="window",ube;function R7e(t,e){var r;return function(){return!Ph&&jU(),(!r||Ph.lzy)&&(r=z1($f(t,e).v)),r.v}}a(R7e,"_getGlobalInstFn");function Vy(t){return!Ph&&jU(),(!ube||t===!1||Ph.lzy)&&(ube=z1($f(WKr).v||kh)),ube.v}a(Vy,"getGlobal");function Di(t,e){var r;if(!ube||e===!1?r=Vy(e):r=ube.v,r&&r[t])return r[t];if(t===YKr)try{return window}catch{}return kh}a(Di,"getInst");function RB(){return!!df()}a(RB,"hasDocument");var df=R7e(Di,["document"]);function wse(){return!!ff()}a(wse,"hasWindow");var ff=R7e(Di,[YKr]);function ZW(){return!!Vu()}a(ZW,"hasNavigator");var Vu=R7e(Di,["navigator"]);var KKr=R7e(function(){return!!$f(function(){return process&&(process.versions||{}).node}).v});var Sse,WDt;function k7e(){return Sse=z1($f(Di,[oNt]).v),Sse}a(k7e,"_initSymbol");function aEo(t){var e=(Ph.lzy?0:Sse)||k7e();return e.v?e.v[t]:hC}a(aEo,"_getSymbolKey");function JKr(){return!!cEo()}a(JKr,"hasSymbol");function cEo(){return!Ph&&jU(),((Ph.lzy?0:Sse)||k7e()).v}a(cEo,"getSymbol");function mbe(t,e){var r=VKr[t];!Ph&&jU();var n=(Ph.lzy?0:Sse)||k7e();return n.v?n.v[r||t]:e?hC:sEo(t)}a(mbe,"getKnownSymbol");function ax(t,e){!Ph&&jU();var r=(Ph.lzy?0:Sse)||k7e();return r.v?r.v(t):e?kh:cNt(t)}a(ax,"newSymbol");function HU(t){return!Ph&&jU(),WDt=(Ph.lzy?0:WDt)||z1($f(aEo,["for"]).v),(WDt.v||oEo)(t)}a(HU,"symbolFor");function _7e(t){return!!t&&Or(t.next)}a(_7e,"isIterator");function lNt(t){return!Wyo(t)&&Or(t[mbe(3)])}a(lNt,"isIterable");var g7e;function P7e(t,e,r){if(t&&(_7e(t)||(!g7e&&(g7e=z1(mbe(3))),t=t[g7e.v]?t[g7e.v]():kh),_7e(t))){var n=hC,o=hC;try{for(var s=0;!(o=t.next()).done&&e[AA](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=kh,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(P7e,"iterForOf");function bse(t,e,r){return t.apply(e,r)}a(bse,"fnApply");function Mh(t,e){return!Nn(e)&&t&&(ur(e)?bse(t.push,t,e):_7e(e)||lNt(e)?P7e(e,function(r){t.push(r)}):t.push(e)),t}a(Mh,"arrAppend");function Ct(t,e,r){if(t)for(var n=t[KW]>>>0,o=0;o0?r:0;return Vf(t,o,o+n[KW])===n}a(bEo,"polyStrStartsWith");var XDt="ref",eNt="unref",tNt="hasRef",SEo="enabled";function TEo(t,e,r){var n=!0,o=t?e(kh):kh,s;function c(){return n=!1,o&&o[eNt]&&o[eNt](),s}a(c,"_unref");function l(){o&&r(o),o=kh}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[tNt]=function(){return o&&o[tNt]?o[tNt]():n},s[XDt]=function(){return n=!0,o&&o[XDt]&&o[XDt](),s},s[eNt]=c,s=S_(s,SEo,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=kh},"dn")}}a(TEo,"_createTimerHandler");function dNt(t,e,r){var n=ur(e),o=n?e.length:0,s=(o>0?e[0]:n?hC:e)||setTimeout,c=(o>1?e[1]:hC)||clearTimeout,l=r[0];r[0]=function(){u.dn(),bse(l,hC,TB[AA](arguments))};var u=TEo(t,function(d){if(d){if(d.refresh)return d.refresh(),d;bse(c,hC,[d])}return bse(s,hC,r)},function(d){bse(c,hC,[d])});return u.h}a(dNt,"_createTimeoutWith");function Up(t,e){return dNt(!0,hC,TB[AA](arguments))}a(Up,"scheduleTimeout");function nJr(t,e,r){return dNt(!0,t,TB[AA](arguments,1))}a(nJr,"scheduleTimeoutWith");function D7e(t,e){return dNt(!1,hC,TB[AA](arguments))}a(D7e,"createTimeout");var _be=I7e,fNt=aNt;p();var Kk=_be({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Jk="toLowerCase",dn="length",Pse="warnToConsole",DB="throwInternal",dM="watch",$U="apply",Fi="push",cx="splice",Wu="logger",fM="cancel",NB="initialize",pM="identifier",Dse="removeNotificationListener",Nse="addNotificationListener",mC="isInitialized",vbe="getNotifyMgr",VU="getPlugin",K1="name",Ym="processNext",N7e="getProcessTelContext",MB="value",WU="enabled",pNt="stopPollingInternalLogs",lx="unload",Cbe="onComplete",M7e="version",O7e="loggingLevelConsole",hM="createNew",J1="teardown",Mse="messageId",mM="message",gC="diagLog",zU="_doTeardown",ez="update",Z1="getNext",YU="setNextPlugin",bbe="userAgent",ux="split",Zk="replace",Sbe="substring",Tbe="indexOf",OB="type",hNt="evtName",Xk="status",mNt="getAllResponseHeaders",Ibe="isChildEvt",X1="data",tz="getCtx",eP="setCtx",gNt="itemsReceived",xbe="headers",Ose="urlString",rz="timeout";var L7e="traceFlags";var ANt;function iJr(t,e){ANt||(ANt=Abe("AggregationError",function(n,o){o[dn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` +`.concat(o," > ").concat(dr(n))}),new ANt(r,e||[])}a(iJr,"throwAggregationError");p();p();p();var Lse="function",dx="object",eS="undefined",tS="prototype";var KU=Object,wbe=KU[tS];p();var okl=(Vy()||{}).Symbol,skl=(Vy()||{}).Reflect;var oJr="hasOwnProperty",xEo=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(RNt,"_hasVisited");function kEo(t,e,r,n){function o(u,d,f){var h=d[f];if(h[vNt]&&n){var m=u[H7e]||{};m[Rbe]!==!1&&(h=(m[d[Bse]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=uM(null);G7e(r,function(u){s[u]=o(e,r,u)});for(var c=iz(t),l=[];c&&!xNt(c)&&!RNt(l,c);)G7e(c,function(u){!s[u]&&wNt(c,u,!kbe)&&(s[u]=o(e,c,u))}),l.push(c),c=iz(c);return s}a(kEo,"_getBaseFuncs");function PEo(t,e,r,n){var o=null;if(t&&rg(r,Bse)){var s=t[H7e]||uM(null);if(o=(s[r[Bse]]||uM(null))[e],o||$7e("Missing ["+e+"] "+j7e),!o[CNt]&&s[Rbe]!==!1){for(var c=!rg(t,e),l=iz(t),u=[];c&&l&&!xNt(l)&&!RNt(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=iz(l)}try{c&&(t[e]=o),o[CNt]=1}catch{s[Rbe]=!1}}}return o}a(PEo,"_getInstFunc");function DEo(t,e,r){var n=e[t];return n===r&&(n=iz(e)[t]),typeof n!==j7e&&$7e("["+t+"] is not a "+j7e),n}a(DEo,"_getProtoFunc");function NEo(t,e,r,n,o){function s(u,d){var f=a(function(){var h=PEo(this,d,u,f)||DEo(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[vNt]=1,f}if(a(s,"_createDynamicPrototype"),!Q7e(t)){var c=r[H7e]=r[H7e]||uM(null);if(!Q7e(c)){var l=c[e]=c[e]||uM(null);c[Rbe]!==!1&&(c[Rbe]=!!o),Q7e(l)||G7e(r,function(u){wNt(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!rg(t,u)||t[u]&&!t[u][vNt])&&(t[u]=s(t,u)))})}}}a(NEo,"_populatePrototype");function MEo(t,e){if(kbe){for(var r=[],n=iz(e);n&&!xNt(n)&&!RNt(r,n);){if(n===t)return!0;r.push(n),n=iz(n)}return!1}return!0}a(MEo,"_checkPrototype");function _Nt(t,e){return rg(t,LB)?t.name||e||sJr:((t||{})[q7e]||{}).name||e||sJr}a(_Nt,"_getObjName");function Si(t,e,r,n){rg(t,LB)||$7e("theClass is an invalid class definition.");var o=t[LB];MEo(o,e)||$7e("["+_Nt(t)+"] not in hierarchy of ["+_Nt(e)+"]");var s=null;rg(o,Bse)?s=o[Bse]:(s=wEo+_Nt(t,"_")+"$"+SNt.n,SNt.n++,o[Bse]=s);var c=Si[uJr],l=!!c[U7e];l&&n&&n[U7e]!==void 0&&(l=!!n[U7e]);var u=REo(e),d=kEo(o,e,u,l);r(e,d);var f=!!kbe&&!!c[bNt];f&&n&&(f=!!n[bNt]),NEo(o,s,e,u,f!==!1)}a(Si,"dynamicProto");Si[uJr]=SNt.o;p();var W7e="Promise";var BNt="rejected";function _l(t,e){return z7e(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:BNt,rejected:!0,reason:r}):r})}a(_l,"doAwaitResponse");function z7e(t,e,r,n){var o=t;try{if(tg(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&&OEo(o,n)}return o}a(z7e,"doAwait");function OEo(t,e){var r=t;return e&&(tg(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(OEo,"doFinally");var kNt,PNt,DNt,dJr=!1;function LEo(t,e,r,n){kNt=kNt||{toString:a(function(){return"[[PromiseState]]"},"toString")},PNt=PNt||{toString:a(function(){return"[[PromiseResult]]"},"toString")},DNt=DNt||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[kNt]={get:e},o[PNt]={get:r},o[DNt]={get:n},HKr(t,o)}a(LEo,"_addDebugState$1");var hJr=["pending","resolving","resolved",BNt],fJr="dispatchEvent",V7e;function BEo(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(BEo,"_hasInitEventFn");function FEo(t,e,r,n){var o=df();!V7e&&(V7e=z1(!!$f(BEo,[o]).v));var s=V7e.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),V7e.v&&s.initEvent(e,!1,!0),s&&t[fJr])t[fJr](s);else{var c=t["on"+e];if(c)c(s);else{var l=Di("console");l&&(l.error||l.log)(e,dr(s))}}}a(FEo,"emitEvent");var mJr="unhandledRejection",UEo=mJr.toLowerCase(),Pbe=[],QEo=0,qEo=10;var NNt;function pJr(t){return Or(t)?t.toString():dr(t)}a(pJr,"dumpFnObj");function gJr(t,e,r){var n=GU(arguments,3),o=0,s=!1,c,l=[],u=QEo++,d=Pbe.length>0?Pbe[Pbe.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{Pbe.push(u),f=!0,h&&h.cancel(),h=null;var x=t(function(P,D){l.push(function(){try{var N=o===2?w:R,L=Nn(N)?c:Or(N)?N(c):N;tg(L)?L.then(P,D):N?P(L):o===3?D(L):P(L)}catch(B){D(B)}}),s&&_()},n);return x}finally{Pbe.pop()}}a(g,"_then");function A(w){return g(void 0,w)}a(A,"_catch");function y(w){var R=w,x=w;return Or(w)&&(R=a(function(P){return w&&w(),P},"thenFinally"),x=a(function(P){throw w&&w(),P},"catchFinally")),g(R,x)}a(y,"_finally");function E(){return hJr[o]}a(E,"_strState");function _(){if(l.length>0){var w=l.slice();l=[],f=!0,h&&h.cancel(),h=null,e(w)}}a(_,"_processQueue");function v(w,R){return function(x){if(o===R){if(w===2&&tg(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,_(),!f&&w===3&&!h&&(h=Up(b,qEo))}}}a(v,"_createSettleIfFn");function b(){if(!f)if(f=!0,KKr())process.emit(mJr,c,m);else{var w=ff()||Vy();!NNt&&(NNt=z1($f(Di,[W7e+"RejectionEvent"]).v)),FEo(w,UEo,function(R){return ji(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!NNt.v)}}a(b,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},S_(m,"state",{get:E}),dJr&&LEo(m,E,function(){return pbe(c)},function(){return f}),JKr()&&(m[mbe(11)]="IPromise");function T(){return"IPromise"+(dJr?"["+u+(Nn(d)?"":":"+d)+"]":"")+" "+E()+(s?" - "+pJr(c):"")}return a(T,"_toString"),m.toString=T,a((function(){Or(r)||zm(W7e+": executor is not a function - "+pJr(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(gJr,"_createPromise");function jEo(t){return function(e){var r=GU(arguments,1);return t(function(n,o){try{var s=[],c=1;P7e(e,function(l,u){l&&(c++,z7e(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(jEo,"_createAllPromise");function HEo(t){return z1(function(e){var r=GU(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,_l(u,function(f){f.rejected?s[d]={status:BNt,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{ur(e)?Ct(e,l):lNt(e)?P7e(e,l):zm("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(HEo,"_createAllSettledPromise");function AJr(t){Ct(t,function(e){try{e()}catch{}})}a(AJr,"syncItemProcessor");function GEo(t){var e=Dh(t)?t:0;return function(r){Up(function(){AJr(r)},e)}}a(GEo,"timeoutItemProcessor");function yJr(t,e){return gJr(yJr,GEo(e),t,e)}a(yJr,"createAsyncPromise");var MNt;function $Eo(t,e){!MNt&&(MNt=z1($f(Di,[W7e]).v||null));var r=MNt.v;if(!r)return yJr(t);Or(t)||zm(W7e+": executor is not a function - "+dr(t));var n=0;function o(){return hJr[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 S_(s,"state",{get:o}),s}a($Eo,"createNativePromise");var ONt;function Dbe(t){return gJr(Dbe,AJr,t)}a(Dbe,"createSyncPromise");function Y7e(t,e){return!ONt&&(ONt=HEo(Dbe)),ONt.v(t,e)}a(Y7e,"createSyncAllSettledPromise");var LNt;function Dd(t,e){return!LNt&&(LNt=z1($Eo)),LNt.v.call(this,t,e)}a(Dd,"createPromise");var K7e=jEo(Dd);var Ukl=mbe(11);p();p();p();p();var rS=void 0,To="",oz="channels",Wf="core",J7e="createPerfMgr",Nbe="disabled",BB="extensionConfig",sz="extensions",AC="processTelemetry",az="priority",Fse="eventsSent",JU="eventsDiscarded",Use="eventsSendRequest",gM="perfEvent",Z7e="offlineEventsStored",X7e="offlineBatchSent",eQe="offlineBatchDrop",Qse="getPerfMgr",tQe="domain",rQe="path",EJr="Not dynamic - ",_Jr="REDACTED",FNt=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var VEo="getPrototypeOf",WEo=/-([a-z])/g,zEo=/([^\w\d_$])/g,YEo=/^(\d+[\w\d_$])/,Ykl=Object[VEo];function ZU(t){return!Xt(t)}a(ZU,"isNotNullOrUndefined");function Mbe(t){var e=t;return e&&Ei(e)&&(e=e[Zk](WEo,function(r,n){return n.toUpperCase()}),e=e[Zk](zEo,"_"),e=e[Zk](YEo,function(r,n){return"_"+n})),e}a(Mbe,"normalizeJsName");function Km(t,e){return t&&e?lu(t,e)!==-1:!1}a(Km,"strContains");function XU(t){return t&&t.toISOString()||""}a(XU,"toISOString");function Qp(t){return xB(t)?t[K1]:To}a(Qp,"getExceptionName");function AM(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(AM,"setValue");function UNt(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(UNt,"getSetValue");function KEo(t,e){var r=null,n=null;return Or(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][$U](n,o)}}a(KEo,"_createProxyFunction");function cz(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=KEo(r,n))}a(cz,"proxyFunctionAs");function lz(t,e,r,n){return t&&e&&Gu(t)&&ur(r)&&Ct(r,function(o){Ei(o)&&cz(t,o,e,o,n)}),t}a(lz,"proxyFunctions");function QNt(t){return(function(){function e(){var r=this;t&&Yr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(QNt,"createClassFromInterface");function iQe(t){return t&&wB&&(t=KU(wB({},t))),t}a(iQe,"optimizeObject");function oQe(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[dn],d=!1,f=1;for(u>0&&zk(l)&&(d=l,l=c[f]||{},f++),Gu(l)||(l={});f>>=0),Ube=wJr+t&dz,Qbe=RJr-t&dz,kJr=!0}a(u_o,"_mwcSeed");function d_o(){try{var t=El()&2147483647;u_o((Math.random()*xJr^t)+t)}catch{}}a(d_o,"_autoSeedMwc");function IJr(t){var e=0,r=YNt()||KNt();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&dz),e===0&&Hse()&&(kJr||d_o(),e=f_o()&dz),e===0&&(e=Y1(xJr*Math.random()|0)),t||(e>>>=0),e}a(IJr,"random32");function f_o(t){Qbe=36969*(Qbe&65535)+(Qbe>>16)&dz,Ube=18e3*(Ube&65535)+(Ube>>16)&dz;var e=(Qbe<<16)+(Ube&65535)>>>0&dz|0;return t||(e>>>=0),e}a(f_o,"mwcRandom32");function PJr(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=IJr()>>>0,n=0,o=To;o[dn]>>=6,n===5&&(r=(IJr()<<2&4294967295|r&3)>>>0,n=0);return o}a(PJr,"newId");var DJr="3.3.11",p_o="."+PJr(6),h_o=0;function NJr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(NJr,"_canAcceptData");function m_o(t,e){var r=e[t.id];if(!r){r={};try{NJr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(m_o,"_getCache");function nS(t,e){return e===void 0&&(e=!1),Mbe(t+h_o+++(e?"."+DJr:To)+p_o)}a(nS,"createUniqueNamespace");function cQe(t){var e={id:nS("_aiData-"+(t||To)+"."+DJr),accept:a(function(r){return NJr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[Mbe(n)]:(s&&(c=m_o(e,r),c[Mbe(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(cQe,"createElmNodeData");p();function lQe(t){return t&&Gu(t)&&!ur(t)&&(t.isVal||t.fb||yA(t,"v")||yA(t,"mrg")||yA(t,"ref")||t.set)}a(lQe,"_isConfigDefaults");function MJr(t,e,r){var n,o=r.dfVal||Tse;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&iJr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[dn]>0){c||(c=[]),l||(l=Up(function(){l=null,f()},0));for(var A=0;A0?_l(FB(t[0],e),function(){hQe(GU(t,1),e,r)}):r(),n}a(hQe,"doUnloadAll");p();var UJr=500,rMt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function b_o(t,e,r){return!t&&Xt(t)?e:zk(t)?t:Hu(t)[Jk]()==="true"}a(b_o,"_stringToBoolOrDefault");function nMt(t){return{mrg:!0,v:t}}a(nMt,"cfgDfMerge");function $se(t,e,r){return{fb:r,isVal:t,v:e}}a($se,"cfgDfValidate");function hx(t,e){return{fb:e,set:b_o,v:!!t}}a(hx,"cfgDfBoolean");p();p();var iMt=[Fse,JU,Use,gM],gQe=null,mQe;function S_o(t,e){return function(){var r=arguments,n=oMt(e);if(n){var o=n.listener;o&&o[t]&&o[t][$U](o,r)}}}a(S_o,"_listenerProxyFunc");function T_o(){var t=Di("Microsoft");return t&&(gQe=t.ApplicationInsights),gQe}a(T_o,"_getExtensionNamespace");function oMt(t){var e=gQe;return!e&&t.disableDbgExt!==!0&&(e=gQe||T_o()),e?e.ChromeDbgExt:null}a(oMt,"getDebugExt");function QJr(t){if(!mQe){mQe={};for(var e=0;e=A&&(d[T](b[mM]),n[w]=!0)}else o>=A&&d[T](b[mM]);f(A,b)}},d.debugToConsole=function(A){sMt("debug",A),g("warning",A)},d[Pse]=function(A){sMt("warn",A),g("warning",A)},d.errorToConsole=function(A){sMt("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 E=!0,_=w_o+y[Mse];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[Fi](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new Vbe(23,v,!1);d.queue[Fi](b),A===1?d.errorToConsole(v):d[Pse](v)}}}a(f,"_logInternalMessage");function h(A){return px(Oh(A,R_o,d).cfg,function(y){var E=y.cfg;o=E[O7e],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=oMt(e||{});E&&E[gC]&&E[gC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function HJr(t){return t||new Wse}a(HJr,"_getLogger");function Wr(t,e,r,n,o,s){s===void 0&&(s=!1),HJr(t)[DB](e,r,n,o,s)}a(Wr,"_throwInternal");function UB(t,e){HJr(t)[Pse](e)}a(UB,"_warnToConsole");var aMt,r7,GJr="toGMTString",$Jr="toUTCString",dMt="cookie",cMt="expires",VJr="isCookieUseDisabled",Wbe="disableCookiesUsage",WJr="_ckMgr",AQe=null,lMt=null,zJr=null,EM,YJr={},KJr={},P_o=(aMt={cookieCfg:nMt((r7={},r7[tQe]={fb:"cookieDomain",dfVal:ZU},r7.path={fb:"cookiePath",dfVal:ZU},r7.enabled=rS,r7.ignoreCookies=rS,r7.blockedCookies=rS,r7.disableCookieDefer=!1,r7)),cookieDomain:rS,cookiePath:rS},aMt[Wbe]=rS,aMt);function fMt(){!EM&&(EM=w7e(function(){return df()}))}a(fMt,"_getDoc");function yQe(t){return t?t.isEnabled():!0}a(yQe,"_isMgrEnabled");function rZr(t,e){return e&&t&&ur(t.ignoreCookies)?Wo(t.ignoreCookies,e)!==-1:!1}a(rZr,"_isIgnoredCookie");function JJr(t,e){return e&&t&&ur(t.blockedCookies)&&Wo(t.blockedCookies,e)!==-1?!0:rZr(t,e)}a(JJr,"_isBlockedCookie");function ZJr(t,e){var r=e[WU];if(Xt(r)){var n=void 0;Nn(t[VJr])||(n=!t[VJr]),Nn(t[Wbe])||(n=!t[Wbe]),r=n}return r}a(ZJr,"_isCfgEnabled");function nZr(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[rQe]=E||"/",_[cMt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return Hse()||(v["max-age"]="0"),eZr(To,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Ni(E||To),R=lu(w,";");if(R!==-1&&(w=Ni(lM(E,R)),T=iZr(Vf(E,R+1))),AM(T,tQe,v||o,W1,Nn),!Xt(_)){var x=Hse();if(Nn(T[cMt])){var P=El(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),AM(T,cMt,XJr(N,x?GJr:$Jr)||XJr(N,x?GJr:$Jr)||To,W1)}}x||AM(T,"max-age",To+_,null,Nn)}var L=Bbe();return L&&L.protocol==="https:"&&(AM(T,"secure",null,null,Nn),lMt===null&&(lMt=!N_o((Vu()||{})[bbe])),lMt&&AM(T,"SameSite","None",null,Nn)),AM(T,rQe,b||n,null,Nn),eZr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[dn]-1;_>=0;_--)f[_].n===E&&f[cx](_,1)}a(g,"_removePendingCookie");function A(){uMt(e)&&f&&(Ct(f,function(E){JJr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=Oh(t||KJr,null,e).cfg,s=px(t,function(E){E.setDf(E.cfg,P_o),r=E.ref(E.cfg,"cookieCfg"),n=r[rQe]||"/",o=r[tQe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=ZJr(t,r)!==!1,l=r.getCookie||D_o,u=r.setCookie||tZr,d=r.delCookie||tZr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=ZJr(t,r)!==!1&&c&&uMt(e),_=KJr[WJr];return E&&_&&y!==_&&(E=yQe(_)),E},"isEnabled"),setEnabled:a(function(E){r[WU]=E,Nn(t[Wbe])||(t[Wbe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=JJr(r,E);if(!R){var x=m(_,v,b,T);yQe(y)?(u(E,x),w=!0):f&&(g(E),f[Fi]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=To,v=rZr(r,E);if(!v){if(yQe(y))_=l(E);else if(f)for(var b=f[dn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=lu(w,";");_=R!==-1?Ni(lM(w,R)):Ni(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return yQe(y)?v=y.purge(E,_):f&&(g(E),f[Fi]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return uMt(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[WJr]=y,y}a(nZr,"createCookieMgr");function uMt(t){if(AQe===null){AQe=!1,!EM&&fMt();try{var e=EM.v||{};AQe=e[dMt]!==void 0}catch(r){Wr(t,2,68,"Cannot access document.cookie - "+Qp(r),{exception:dr(r)})}}return AQe}a(uMt,"areCookiesSupported");function iZr(t){var e={};if(t&&t[dn]){var r=Ni(t)[ux](";");Ct(r,function(n){if(n=Ni(n||To),n){var o=lu(n,"=");o===-1?e[n]=null:e[Ni(lM(n,o))]=Ni(Vf(n,o+1))}})}return e}a(iZr,"_extractParts");function XJr(t,e){return Or(t[e])?t[e]():null}a(XJr,"_formatDate");function eZr(t,e){var r=t||To;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?To:"="+o)}),r}a(eZr,"_formatCookieValue");function D_o(t){var e=To;if(!EM&&fMt(),EM.v){var r=EM.v[dMt]||To;zJr!==r&&(YJr=iZr(r),zJr=r),e=Ni(YJr[t]||To)}return e}a(D_o,"_getCookieValue");function tZr(t,e){!EM&&fMt(),EM.v&&(EM.v[dMt]=t+"="+e)}a(tZr,"_setCookieValue");function N_o(t){return Ei(t)?!!(Km(t,"CPU iPhone OS 12")||Km(t,"iPad; CPU OS 12")||Km(t,"Macintosh; Intel Mac OS X 10_14")&&Km(t,"Version/")&&Km(t,"Safari")||Km(t,"Macintosh; Intel Mac OS X 10_14")&&PB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||Km(t,"Chrome/5")||Km(t,"Chrome/6")||Km(t,"UnrealEngine")&&!Km(t,"Chrome")||Km(t,"UCBrowser/12")||Km(t,"UCBrowser/11")):!1}a(N_o,"uaDisallowsSameSiteNone");p();var M_o={perfEvtsSendAll:!1};function O_o(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){$f(r.fn,[r.arg])})}a(O_o,"_runScheduledListeners");function n7(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[Fi]({fn:n,arg:o}),r.h=r.h||Up(O_o,0,r)):$f(n,[o]))})}a(n7,"_runListeners");var oZr=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Oh(e,M_o);n=c[dM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){ji(l,"listeners",{g:a(function(){return o},"g")}),l[Nse]=function(u){o[Fi](u)},l[Dse]=function(u){for(var d=Wo(o,u);d>-1;)o[cx](d,1),d=Wo(o,u)},l[Fse]=function(u){n7(o,Fse,s,function(d){d[Fse](u)})},l[JU]=function(u,d,f){n7(o,JU,s,function(h){h[JU](u,d,f)})},l[Use]=function(u,d){n7(o,Use,d?s:null,function(f){f[Use](u,d)})},l[gM]=function(u){u&&(r||!u[Ibe]())&&n7(o,gM,null,function(d){u.isAsync?Up(function(){return d[gM](u)},0):d[gM](u)})},l[Z7e]=function(u){u&&u[dn]&&n7(o,Z7e,s,function(d){d[Z7e](u)})},l[X7e]=function(u){u&&u[X1]&&n7(o,X7e,s,function(d){d[X7e](u)})},l[eQe]=function(u,d){if(u>0){var f=d||0;n7(o,eQe,s,function(h){h[eQe](u,f)})}},l[lx]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[fM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(n7(o,"unload",null,function(h){var m=h[lx](u);m&&(f||(f=[]),f[Fi](m))}),f)return Dd(function(h){return _l(K7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var zse="ctx",hMt="ParentContextKey",zbe="ChildrenContextKey",L_o=null,EQe=(function(){function t(e,r,n){var o=this;if(o.start=El(),o[K1]=e,o.isAsync=n,o[Ibe]=function(){return!1},Or(r)){var s;ji(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[tz]=function(c){return c?c===t[hMt]||c===t[zbe]?o[c]:(o[zse]||{})[c]:null},o[eP]=function(c,l){if(c)if(c===t[hMt])o[c]||(o[Ibe]=function(){return!0}),o[c]=l;else if(c===t[zbe])o[c]=l;else{var u=o[zse]=o[zse]||{};u[c]=l}},o.complete=function(){var c=0,l=o[tz](t[zbe]);if(ur(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Wr(r[Wu],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[BB];!_&&A&&(_={}),E[BB]=_,_=e.ref(E,BB),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Yr(A,function(E,_){if(Xt(y[E])){var v=e.cfg[E];(v||!Xt(v))&&(y[E]=v)}qbe(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 _&&(_[A]||!Xt(_[A]))?E=_[A]:(v[A]||!Xt(v[A]))&&(E=v[A]),E||!Xt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[VU]();y&&g(y)}}return a(m,"_iterateChain"),c}a(yMt,"_createInternalContext");function tP(t,e,r,n){var o=Oh(e),s=yMt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[AC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=i7(d,o.cfg,r,f)),tP(d||c[Z1](),o.cfg,r,f)}return a(u,"_createNew"),c[Ym]=l,c[hM]=u,c}a(tP,"createProcessTelemetryContext");function Yse(t,e,r){var n=Oh(e.config),o=yMt(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),ur(u)&&(u=i7(u,n.cfg,e,d)),Yse(u||s[Z1](),e,d)}return a(l,"_createNew"),s[Ym]=c,s[hM]=l,s}a(Yse,"createProcessTelemetryUnloadContext");function Ybe(t,e,r){var n=Oh(e.config),o=yMt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[ez])&&d[ez](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=i7(u,n.cfg,e,d)),Ybe(u||s[Z1](),e,d)}return a(l,"_createNew"),s[Ym]=c,s[hM]=l,s}a(Ybe,"createProcessTelemetryUpdateContext");function i7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[dn]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[AC])){var u=j_o(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?i7([n],e,r):o}a(i7,"createTelemetryProxyChain");function j_o(t,e,r){var n=null,o=Or(t[AC]),s=Or(t[YU]),c;t?c=t[pM]+"-"+t[az]+"-"+fZr++:c="Unknown-0-"+fZr++;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&&Or(t[dZr])&&(g=t[dZr]()),g||(g=tP(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[pM]:Q_o,T=g[uZr];return T||(T=g[uZr]={}),g.setNext(n),t&&_Qe(g[Wf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:To;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Wr(g[gC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=QB(t);return _[J1]||_[Nbe]?!1:(s&&t[YU](n),t[AC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[Ym](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=QB(t),v=t[Wf]||_[Wf];t&&(!v||v===g.core())&&!_[J1]&&(_[Wf]=null,_[J1]=!0,_[mC]=!1,t[J1]&&t[J1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[Ym](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=QB(t),v=t[Wf]||_[Wf];t&&(!v||v===g.core())&&!_[J1]&&t[ez]&&t[ez](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[Ym](A)}return a(m,"_updatePlugin"),Nh(l)}a(j_o,"createTelemetryPluginProxy");var H_o=(function(){function t(e,r,n,o){var s=this,c=tP(e,r,n,o);lz(s,c,$u(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function CQe(){var t=[];function e(n){n&&t[Fi](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Wr(n[gC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(CQe,"createUnloadHandlerContainer");p();var bQe,SQe;function TQe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Wr(n,2,73,"Unloading:"+dr(c))}}),bQe&&o[dn]>bQe&&(SQe?SQe("doUnload",o):Wr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Mh(t,n),bQe&&t[dn]>bQe&&(SQe?SQe("Add",t):Wr(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(TQe,"createUnloadHookContainer");var EMt,o7="getPlugin",G_o=(EMt={},EMt[BB]={isVal:ZU,v:{}},EMt),Kbe=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[NB]=function(h,m,g,A){u(h,m,A),r=!0},f[J1]=function(h,m){var g=f[Wf];if(!g||h&&g!==h[Wf]())return;var A,y=!1,E=h||Yse(null,g,o&&o[o7]?o[o7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[gC]()),A===!0&&E[Ym](_),d())}return a(v,"_unloadCallback"),!f[zU]||f[zU](E,_,v)!==!0?v():A=!0,A},f[ez]=function(h,m){var g=f[Wf];if(!g||h&&g!==h[Wf]())return;var A,y=!1,E=h||Ybe(null,g,o&&o[o7]?o[o7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[Z1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},cz(f,"_addUnloadCb",function(){return s},"add"),cz(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[gC]=function(f){return l(f)[gC]()},e[mC]=function(){return r},e.setInitialized=function(f){r=f},e[YU]=function(f){o=f},e[Ym]=function(f,h){h?h[Ym](f):o&&Or(o[AC])&&o[AC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||tP(null,{},e[Wf]);o&&o[o7]?h=m[hM](null,o[o7]):h=m[hM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Oh(f,G_o,fz(h)),!m&&h&&(m=h[N7e]()[Z1]());var g=o;o&&o[o7]&&(g=o[o7]()),e[Wf]=h,n=tP(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Wf]=null,n=null,o=null,c=TQe(),s=CQe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function $_o(t,e,r){var n={id:e,fn:r};Mh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[cx](c,1),-1})},"remove")};return o}a($_o,"_addInitializer");function V_o(t,e,r){for(var n=!1,o=t[dn],s=0;s"},"v")})}a(rvo,"_createUnloadHook");var CMt=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[mC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[NB]=function(ne,ce,Ne,we){g&&Zc(hZr),U[mC]()&&Zc("Core cannot be initialized more than once"),e=Oh(ne,_Mt,Ne||U[Wu],!1),ne=e.cfg,qe(e[dM](function(st){var _t=st.cfg;B=_t.initInMemoMaxSize||Y_o,Y(_t);var Dt=st.ref(st.cfg,BB);Yr(Dt,function($t){st.ref(Dt,$t)})})),s=we,b=tvo(e,v,s&&U[vbe](),b),K(),U[Wu]=Ne;var Be=ne[sz];if(f=[],f[Fi].apply(f,nz(nz([],ce,!1),Be,!1)),h=ne[oz],Le(null),(!m||m[dn]===0)&&Zc("No "+oz+" available"),h&&h[dn]>1){var rt=U[VU]("TeeChannelController");(!rt||!rt.plugin)&&Wr(n,1,28,"TeeChannel required")}evo(ne,R,n),R=null,r=!0,N===Kk.ACTIVE&&z()},U.getChannels=function(){var ne=[];return m&&Ct(m,function(ce){ne[Fi](ce)}),Nh(ne)},U.track=function(ne){_Qe(U[Qse](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ue(ne),Zc("Invalid telemetry item")),!ne[K1]&&Xt(ne[K1])&&(ue(ne),Zc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||XU(new Date),ne.ver=ne.ver||"4.0",!g&&U[mC]()&&N===Kk.ACTIVE?le()[Ym](ne):N!==Kk.INACTIVE&&o[dn]<=B&&o[Fi](ne)},function(){return{item:ne}},!ne.sync)},U[N7e]=le,U[vbe]=function(){return s||(s=new oZr(e.cfg),U[W_o]=s),s},U[Nse]=function(ne){U.getNotifyMgr()[Nse](ne)},U[Dse]=function(ne){s&&s[Dse](ne)},U.getCookieMgr=function(){return u||(u=nZr(e.cfg,U[Wu])),u},U.setCookieMgr=function(ne){u!==ne&&(FB(u,!1),u=ne)},U[Qse]=function(){return c||l||aZr()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[dn]},U.releaseQueue=function(){if(r&&o[dn]>0){var ne=o;o=[],N===2?Ct(ne,function(ce){ce.iKey=ce.iKey||w,le()[Ym](ce)}):Wr(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,Q=!1,O&&O[fM](),ie(!0)};function Y(ne){var ce=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ce)){w=null,N=Kk.INACTIVE;var we="Please provide instrumentation key";r?(Wr(n,1,100,we),z()):Zc(we);return}var Be=[];tg(ce)?(Be[Fi](ce),w=null):w=ce,tg(Ne)?(Be[Fi](Ne),L=null):L=Ne,Be[dn]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ce){q=!1,N=3;var Ne=ZU(ne.initTimeOut)?ne.initTimeOut:K_o,we=Y7e(ce);M&&M[fM](),M=Up(function(){M=null,q||V()},Ne),_l(we,function(Be){try{if(q)return;if(!Be.rejected){var rt=Be[MB];if(rt&&rt[dn]){var st=rt[0];if(w=st&&st[MB],rt[dn]>1){var _t=rt[1];L=_t&&_t[MB]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=Kk.INACTIVE,Wr(n,1,112,"ikey can't be resolved from promises")):N=Kk.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[WU])&&!Q){var ce=ne||n&&n.queue[dn]>0;ce&&(j||(j=!0,qe(e[dM](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[WU],O[fM]()),O=D7e(X,we),O.unref(),O[WU]=Be}))),O[WU]=!0)}return O}a(ie,"_startLogPoller"),U[pNt]=function(){Q=!0,O&&O[fM](),X()},lz(U,function(){return A},["addTelemetryInitializer"]),U[lx]=function(ne,ce,Ne){ne===void 0&&(ne=!0),r||Zc(z_o),g&&Zc(hZr);var we={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ce&&(Be=Dd(function(_t){ce=_t}));var rt=Yse(Ue(),U);rt[Cbe](function(){v.run(U[Wu]),hQe([u,s,n],ne,function(){re(),ce&&ce(we)})},U);function st(_t){we.flushComplete=_t,g=!0,_.run(rt,we),U[pNt](),rt[Ym](we)}return a(st,"_doUnload"),X(),ee(ne,st,6,Ne)||st(!1),Be},U[VU]=ge,U.addPlugin=function(ne,ce,Ne,we){if(!ne){we&&we(!1),Z(AZr);return}var Be=ge(ne[pM]);if(Be&&!ce){we&&we(!1),Z("Plugin ["+ne[pM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[Fi](ne),rt.added=[ne],Le(rt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var _t=[Be.plugin],Dt={reason:2,isAsync:!!Ne};ke(_t,Dt,function($t){$t?(rt.removed=_t,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ne,ce){ce===void 0&&(ce=!0);var Ne;if(U[mC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Rse({},e.cfg),newConfig:Rse({},ne),merge:ce},ne=Ne.newConfig;var we=e.cfg;ne[sz]=we[sz],ne[oz]=we[oz]}e._block(function(Be){var rt=Be.cfg;vMt(Be,rt,ne,ce),ce||Yr(rt,function(st){yA(ne,st)||Be.set(rt,st,rS)}),Be.setDf(rt,_Mt)},!0),e.notify(),Ne&&he(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ne){return T||(T=lZr()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=qe,cz(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var ce;return r?ce=px(e.cfg,ne,U[Wu]):ce=X_o(R,ne),rvo(ce)},U.getWParam=function(){return RB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ce=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[pM]&&we[M7e]&&!ne[we.identifier]){var Be=we[pM]+"="+we[M7e];P[Fi](Be),ne[we.identifier]=we}})},"_addPluginVersions");ce(m),h&&Ct(h,function(Ne){ce(Ne)}),ce(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Oh({},_Mt,U[Wu]),e.cfg[O7e]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ce){U.updateCfg(ce,!1)},"s")}),ji(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),ji(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||To},"g")}),ji(U,"logger",{g:a(function(){return n||(n=new Wse(e.cfg),e[Wu]=n),n},"g"),s:a(function(ce){e[Wu]=ce,n!==ce&&(FB(n,!1),n=ce)},"s")}),U[Wu]=new Wse(e.cfg),x=[];var ne=U.config[sz]||[];ne.splice(0,ne[dn]),Mh(ne,x),A=new pZr,o=[],FB(s,!1),s=null,c=null,l=null,FB(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=nS("AIBaseCore",!0),_=CQe(),T=null,w=null,v=TQe(),R=[],D=null,P=null,Q=!1,O=null,j=!1,N=0,L=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=tP(Ue(),e.cfg,U);return ne[Cbe](ie),ne}a(le,"_createTelCtx");function Le(ne){var ce=Z_o(U[Wu],UJr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=vQe(Mh(m,ce[oz]));var Ne=Mh(vQe(ce[Wf]),m);x=Nh(Ne);var we=U.config[sz]||[];we.splice(0,we[dn]),Mh(we,x);var Be=le();m&&m[dn]>0&&AMt(Be[hM](m),Ne),AMt(Be,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ce=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[pM]===ne&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[Fi](Be)}),!Ne&&we[dn]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ne),!Ne)return-1}),Ne&&(ce={plugin:Ne,setEnabled:a(function(Be){QB(Ne)[Nbe]=!Be},"setEnabled"),isEnabled:a(function(){var Be=QB(Ne);return!Be[J1]&&!Be[Nbe]},"isEnabled"),remove:a(function(Be,rt){Be===void 0&&(Be=!0);var st=[Ne],_t={reason:1,isAsync:Be};ke(st,_t,function(Dt){Dt&&Le({reason:32,removed:st}),rt&&rt(Dt)})},"remove")}),ce}a(ge,"_getPlugin");function Ue(){if(!d){var ne=(x||[]).slice();Wo(ne,A)===-1&&ne[Fi](A),d=i7(vQe(ne),e.cfg,U)}return d}a(Ue,"_getPluginChain");function ke(ne,ce,Ne){if(ne&&ne[dn]>0){var we=i7(ne,e.cfg,U),Be=Yse(we,U);Be[Cbe](function(){var rt=!1,st=[];Ct(f,function(Dt,$t){mZr(Dt,ne)?rt=!0:st[Fi](Dt)}),f=st,D=null,P=null;var _t=[];h&&(Ct(h,function(Dt,$t){var Gt=[];Ct(Dt,function(Ie){mZr(Ie,ne)?rt=!0:Gt[Fi](Ie)}),_t[Fi](Gt)}),h=_t),Ne&&Ne(rt),ie()}),Be[Ym](ce)}else Ne(!1)}a(ke,"_removePlugins");function X(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[dn]=0,Ct(ne,function(ce){var Ne={name:y||"InternalMessageId: "+ce[Mse],iKey:w,time:XU(new Date),baseType:Vbe.dataType,baseData:{message:ce[mM]}};U.track(Ne)})}}a(X,"_flushInternalLogs");function ee(ne,ce,Ne,we){var Be=1,rt=!1,st=null;we=we||5e3;function _t(){Be--,rt&&Be===0&&(st&&st[fM](),st=null,ce&&ce(rt),ce=null)}if(a(_t,"doCallback"),m&&m[dn]>0){var Dt=le()[hM](m);Dt.iterate(function($t){if($t.flush){Be++;var Gt=!1;$t.flush(ne,function(){Gt=!0,_t()},Ne)||Gt||(ne&&st==null?st=Up(function(){st=null,_t()},we):_t())}})}return rt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[dM](function(ce){var Ne=ce.cfg.enablePerfMgr;if(Ne){var we=ce.cfg[J7e];(ne!==we||!ne)&&(we||(we=J_o),UNt(ce.cfg,J7e,we),ne=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[vbe]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ce=Ybe(Ue(),U);ce[Cbe](ie),(!U._updateHook||U._updateHook(ce,ne)!==!0)&&ce[Ym](ne)}a(he,"_doUpdate");function Z(ne){var ce=U[Wu];ce?(Wr(ce,2,73,ne),ie()):Zc(ne)}a(Z,"_logOrThrowError");function ue(ne){var ce=U[vbe]();ce&&ce[JU]([ne],2)}a(ue,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function Jbe(t,e){try{if(t&&t!==""){var r=I_().parse(t);if(r&&r[gNt]&&r[gNt]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[dn])return r}}catch(n){Wr(e,1,43,"Cannot parse the response. "+(n[K1]||dr(n)),{response:t})}return null}a(Jbe,"parseResponse");p();var rP="",nvo="NoResponseBody",yZr="&"+nvo+"=true",bMt="POST",SMt=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;q(),E[NB]=function(M,O){o=O,n&&Wr(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.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 O=Bbe();O&&O.protocol&&O.protocol[Jk]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[dn]?R(M,O):null},E.getFallbackInst=function(){return d},E[zU]=function(M,O){q()},E.preparePayload=function(M,O,j,Q){if(!O||Q||!j[X1]){M(j);return}try{var U=Di("CompressionStream");if(!Or(U)){M(j);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(Ei(j[X1])?new TextEncoder().encode(j[X1]):j[X1]),re.close()},"start")}),W=Y.pipeThrough(new U("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return _l(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[MB];if(!Le.done)return z[Fi](Le[MB]),ie+=Le.value[dn],_l(V.read(),re);for(var ge=new Uint8Array(ie),Ue=0,ke=0,X=z;ke0&&(Ct($u(ge),function(K){H.append(K,ge[K])}),Ue[xbe]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),j&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(U+=yZr)):le=!0);var ke=new Request(U,Ue);try{ke[rMt]=!0}catch{}if(!j&&r&&(V=Dd(function(K,he){z=K,ie=he})),!U){w(O),z&&z(!1);return}function X(K,he){he?x(O,s?0:he,{},s?rP:K):x(O,s?0:400,{},s?rP:K)}a(X,"_handleError");function ee(K,he,Z){var ue=K[Xk],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,Z||rP,he):x(O,ue,{},Z||rP)}a(ee,"_onFetchComplete");try{_l(fetch(s?U:ke,s?Ue:null),function(K){if(j&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)X(K.reason&&K.reason[mM],499),ie&&ie(K.reason);else{var he=K[MB];try{!s&&!he.ok?(he[Xk]?X(he.statusText,he[Xk]):X(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,rP),z&&z(!0)):_l(he.text(),function(Z){ee(he,M,Z[MB]),z&&z(!0)})}catch(Z){he&&he[Xk]?X(dr(Z),he[Xk]):X(dr(Z),499),ie&&ie(Z)}}})}catch(K){Le||(X(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[rz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[rz]),V}a(L,"_doFetchSender");function B(M,O,j){var Q=ff(),U=new XDomainRequest,Y=M[X1];U.onload=function(){var H=qse(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?rP:Obe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",V=M[Ose];if(!V){w(O);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.";Wr(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[Zk](/^(https?:)/,"");U.open(bMt,ie),M[rz]&&(U[rz]=M[rz]),U.send(Y),s&&j?y&&y.set(function(){U.send(Y)},0):U.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 TZr="on",EZr="attachEvent",_Zr="addEventListener",vZr="detachEvent",CZr="removeEventListener",TMt="events";var nMl=nS("aiEvtPageHide"),iMl=nS("aiEvtPageShow"),ivo=/\.[\.]+/g,ovo=/[\.]+$/,svo=1,IQe=cQe("events"),avo=/^([^.]*)(?:\.(.+)|)/;function bZr(t){return t&&t[Zk]?t[Zk](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,To):t}a(bZr,"_normalizeNamespace");function IMt(t,e){if(e){var r=To;ur(e)?(r=To,Ct(e,function(o){o=bZr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=bZr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||To)+r)}var n=avo.exec(t||To)||[];return{type:n[1],ns:(n[2]||To).replace(ivo,".").replace(ovo,To)[ux](".").sort().join(".")}}a(IMt,"_getEvtNamespace");function IZr(t,e,r){r===void 0&&(r=!0);var n=IQe.get(t,TMt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(IZr,"_getRegisteredEvents");function xZr(t,e,r,n){t&&e&&e[OB]&&(t[CZr]?t[CZr](e[OB],r,n):t[vZr]&&t[vZr](TZr+e[OB],r))}a(xZr,"_doDetach");function cvo(t,e,r,n){var o=!1;return t&&e&&e[OB]&&r&&(t[_Zr]?(t[_Zr](e[OB],r,n),o=!0):t[EZr]&&(t[EZr](TZr+e[OB],r),o=!0)),o}a(cvo,"_doAttach");function SZr(t,e,r,n){for(var o=e[dn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[hNt].ns)&&(!n||n(s))&&(xZr(t,s[hNt],s.handler,s.capture),e[cx](o,1))}}a(SZr,"_doUnregister");function lvo(t,e,r){if(e[OB])SZr(t,IZr(t,e[OB]),e,r);else{var n=IQe.get(t,TMt,{});Yr(n,function(o,s){SZr(t,s,e,r)}),$u(n)[dn]===0&&IQe.kill(t,TMt)}}a(lvo,"_unregisterEvents");function Zbe(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=IMt("xx",r).ns[ux](".")):r=t,r}a(Zbe,"mergeEvtNamespace");function xQe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=IMt(e,n);if(s=cvo(t,c,r,o),s&&IQe.accept(t)){var l={guid:svo++,evtName:c,handler:r,capture:o};IZr(t,c.type)[Fi](l)}}catch{}return s}a(xQe,"eventOn");function xMt(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=IMt(e,n),c=!1;lvo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||xZr(t,s,r,o)}catch{}}a(xMt,"eventOff");p();var Xbe="sampleRate",e1e="ProcessLegacy",wQe="http.method",pz="https://dc.services.visualstudio.com",_M="/v2/track",zy="not_specified";p();var RQe=fNt({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 hz="split",go="length",mz="toLowerCase",a7="ingestionendpoint",c7="toString",wMt="removeItem",Kse="message",MZr="count";var t1e="stringify",r1e="pathname",gz="match";var Yy="name";var EA="properties",Ky="measurements",n1e="sizeInBytes",i1e="typeName",Jse="exceptions",Az="severityLevel",kQe="problemGroup",yz="parsedStack",o1e="hasFullStack",s1e="assembly",vM="fileName",Ez="line",Zse="aiDataContract",_z="duration";function RMt(t,e,r){var n=e[go],o=OZr(t,e);if(o[go]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=Vf(o,0,147)+LZr(s);o=c}return o}a(RMt,"dataSanitizeKeyAndAddUniqueness");function OZr(t,e){var r;return e&&(e=Ni(Hu(e)),e[go]>150&&(r=Vf(e,0,150),Wr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(OZr,"dataSanitizeKey");function uu(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Ni(Hu(e)),e[go]>r&&(n=Vf(e,0,r),Wr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(uu,"dataSanitizeString");function vz(t,e,r){return Ei(e)&&(e=XNt(e,r)),DMt(t,e,2048,66)}a(vz,"dataSanitizeUrl");function a1e(t,e){var r;return e&&e[go]>32768&&(r=Vf(e,0,32768),Wr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(a1e,"dataSanitizeMessage");function kMt(t,e){var r;if(e){var n=""+e;n[go]>32768&&(r=Vf(n,0,32768),Wr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(kMt,"dataSanitizeException");function x_(t,e){if(e){var r={};Yr(e,function(n,o){if(Gu(o)&&e7())try{o=I_()[t1e](o)}catch(s){Wr(t,2,49,"custom property is not valid",{exception:s},!0)}o=uu(t,o,8192),n=RMt(t,n,r),r[n]=o}),e=r}return e}a(x_,"dataSanitizeProperties");function w_(t,e){if(e){var r={};Yr(e,function(n,o){n=RMt(t,n,r),r[n]=o}),e=r}return e}a(w_,"dataSanitizeMeasurements");function PMt(t,e){return e&&DMt(t,e,128,69)[c7]()}a(PMt,"dataSanitizeId");function DMt(t,e,r,n){var o;return e&&(e=Ni(Hu(e)),e[go]>r&&(o=Vf(e,0,r),Wr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(DMt,"dataSanitizeInput");function LZr(t){var e="00"+t;return x7e(e,e[go]-3)}a(LZr,"dsPadNumber");p();var BZr=df()||{},FZr=0,dvo=[null,null,null,null,null];function UZr(t){var e=FZr,r=dvo,n=r[e];return BZr.createElement?r[e]||(n=r[e]=BZr.createElement("a")):n={host:fvo(t,!0)},n.href=t,e++,e>=r[go]&&(e=0),FZr=e,n}a(UZr,"urlParseUrl");function fvo(t,e){var r=QZr(t,e)||"";if(r){var n=r[gz](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[go]>3&&Ei(n[2])&&n[2][go]>0)return n[2]+(n[3]||"")}return r}a(fvo,"urlParseHost");function QZr(t,e){var r=null;if(t){var n=t[gz](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[go]>2&&Ei(n[2])&&n[2][go]>0&&(r=n[2]||"",e&&n[go]>2)){var o=(n[1]||"")[mz](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(QZr,"urlParseFullHost");var pvo=[pz+_M,"https://breeze.aimon.applicationinsights.io"+_M,"https://dc-int.services.visualstudio.com"+_M];function PQe(t){return Wo(pvo,t[mz]())!==-1}a(PQe,"isInternalApplicationInsightsEndpoint");function qZr(t,e,r,n){var o,s=n,c=n;if(e&&e[go]>0){var l=UZr(e);if(o=l.host,!s)if(l[r1e]!=null){var u=l.pathname[go]===0?"/":l[r1e];u.charAt(0)!=="/"&&(u="/"+u),c=l[r1e],s=uu(t,r?r+" "+u:u)}else s=uu(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(qZr,"AjaxHelperParseDependencyPath");p();p();var DQe=_be({LocalStorage:0,SessionStorage:1});var Xse=void 0,jZr="";function HZr(t){try{if(Xt(Vy()))return null;var e=new Date()[c7](),r=Di(t===DQe.LocalStorage?"localStorage":"sessionStorage"),n=jZr+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[wMt](n),!o)return r}catch{}return null}a(HZr,"_getVerifiedStorageObject");function NMt(){return NQe()?HZr(DQe.SessionStorage):null}a(NMt,"_getSessionStorageObject");function MMt(t){jZr=t||""}a(MMt,"utlSetStoragePrefix");function NQe(t){return(t||Xse===void 0)&&(Xse=!!HZr(DQe.SessionStorage)),Xse}a(NQe,"utlCanUseSessionStorage");function OMt(t,e){var r=NMt();if(r!==null)try{return r.getItem(e)}catch(n){Xse=!1,Wr(t,2,2,"Browser failed read of session storage. "+Qp(n),{exception:dr(n)})}return null}a(OMt,"utlGetSessionStorage");function LMt(t,e,r){var n=NMt();if(n!==null)try{return n.setItem(e,r),!0}catch(o){Xse=!1,Wr(t,2,4,"Browser failed write to session storage. "+Qp(o),{exception:dr(o)})}return!1}a(LMt,"utlSetSessionStorage");function BMt(t,e){var r=NMt();if(r!==null)try{return r[wMt](e),!0}catch(n){Xse=!1,Wr(t,2,6,"Browser failed removal of session storage item. "+Qp(n),{exception:dr(n)})}return!1}a(BMt,"utlRemoveSessionStorage");p();var hvo=";",mvo="=";function c1e(t){if(!t)return{};var e=t[hz](hvo),r=gbe(e,function(o,s){var c=s[hz](mvo);if(c[go]===2){var l=c[0][mz](),u=c[1];o[l]=u}return o},{});if($u(r)[go]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[a7]=r[a7]||"https://"+n+"dc."+r.endpointsuffix}r[a7]=r[a7]||pz,PB(r[a7],"/")&&(r[a7]=r[a7].slice(0,-1))}return r}a(c1e,"parseConnectionString");p();var FMt=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[Yy]=uu(e,n)||zy,s.data=r,s.time=XU(new Date),s[Zse]={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 qB=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[Yy]=uu(e,r)||zy,s[EA]=x_(e,n),s[Ky]=w_(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var gvo=58,Avo=/^\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\?]+)?)/,yvo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,Evo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,_vo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,vvo=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,Cvo=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,bvo=/([^\(\s\n]+):([0-9]+)$/,GZr="",eae="error",mx="stack",QMt="stackDetails",$Zr="errorSrc",qMt="message",YZr="description",VZr=[{re:yvo,len:5,m:1,fn:2,ln:3,col:4},{chk:Tvo,pre:Svo,re:Evo,len:4,m:1,fn:2,ln:3},{re:_vo,len:3,m:1,fn:2,hdl:zZr},{re:vvo,len:2,fn:1,hdl:zZr}];function Svo(t){return t.replace(/(\(anonymous\))/,"")}a(Svo,"_scrubAnonymous");function Tvo(t){return lu(t,"[native")<0}a(Tvo,"_ignoreNative");function jMt(t,e){var r=t;return r&&!Ei(r)&&(JSON&&JSON[t1e]?(r=JSON[t1e](t),e&&(!r||r==="{}")&&(Or(t[c7])?r=t[c7]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(jMt,"_stringify");function KZr(t,e){var r=t;return t&&(r&&!Ei(r)&&(r=t[qMt]||t[YZr]||r),r&&!Ei(r)&&(r=jMt(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&lu(r||"",e)===-1&&(r=e+": "+r),r||""}a(KZr,"_formatMessage");function Ivo(t){try{if(Gu(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(Ivo,"_isExceptionDetailsInternal");function xvo(t){try{if(Gu(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(xvo,"_isExceptionInternal");function WZr(t){return t&&t.src&&Ei(t.src)&&t.obj&&ur(t.obj)}a(WZr,"_isStackDetails");function Cz(t){var e=t||"";Ei(e)||(Ei(e[mx])?e=e[mx]:e=""+e);var r=e[hz](` +`);return{src:e,obj:r}}a(Cz,"_convertStackObj");function wvo(t){for(var e=[],r=t[hz](` +`),n=0;n0){e=[];var n=0,o=!1,s=0;Ct(r,function(y){if(o||Mvo(y)){var E=Hu(y);o=!0;var _=Ovo(E,n);_&&(s+=_[n1e],e.push(_),n++)}});var c=32*1024;if(s>c)for(var l=0,u=e[go]-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(kvo,"_parseStack");function MQe(t){var e="";if(t&&(e=t.typeName||t[Yy]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[c7]());e=n&&n[go]>1?n[1]:""}catch{}return e}a(MQe,"_getErrorType");function UMt(t){if(t)try{if(!Ei(t)){var e=MQe(t),r=jMt(t,!1);return(!r||r==="{}")&&(t[eae]&&(t=t[eae],e=MQe(t)),r=jMt(t,!0)),lu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(UMt,"_formatErrorCode");var bz=(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,xvo(r)?(l[Jse]=r[Jse]||[],l[EA]=r[EA],l[Ky]=r[Ky],r[Az]&&(l[Az]=r[Az]),r.id&&(l.id=r.id,r[EA].id=r.id),r[kQe]&&(l[kQe]=r[kQe]),Xt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Jse]=[ZZr(e,r,n)],l[EA]=x_(e,n),l[Ky]=w_(e,o),s&&(l[Az]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=MQe(s||c||e);return{message:KZr(e,d),url:r,lineNumber:n,columnNumber:o,error:UMt(s||c||e),evt:UMt(c||e),typeName:d,stackDetails:JZr(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Jse]&&kB(r[Jse],function(l){return Nvo(e,l)}),c=new t(e,fx(fx({},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&&kB(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=UMt,t})();var Pvo=Nh({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function Dvo(){var t=this,e=ur(t[yz])&&kB(t[yz],function(n){return Bvo(n)}),r={id:t.id,outerId:t.outerId,typeName:t[i1e],message:t[Kse],hasFullStack:t[o1e],stack:t[mx],parsedStack:e||void 0};return r}a(Dvo,"_toInterface");function ZZr(t,e,r){var n,o,s,c,l,u,d,f;if(Ivo(e))c=e[i1e],l=e[Kse],d=e[mx],f=e[yz]||[],u=e[o1e];else{var h=e,m=h&&h.evt;xB(h)||(h=h[eae]||m||h),c=uu(t,MQe(h))||zy,l=a1e(t,KZr(e||h,c))||zy;var g=e[QMt]||JZr(e);f=kvo(g),ur(f)&&kB(f,function(A){A[s1e]=uu(t,A[s1e]),A[vM]=uu(t,A[vM])}),d=kMt(t,Rvo(g)),u=ur(f)&&f[go]>0,r&&(r[i1e]=r[i1e]||c)}return n={},n[Zse]=Pvo,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[o1e]=u,n.stack=d,n.parsedStack=f,n.toInterface=Dvo,n}a(ZZr,"_createExceptionDetails");function Nvo(t,e){var r=ur(e[yz])&&kB(e[yz],function(o){return Lvo(o)})||e[yz],n=ZZr(t,fx(fx({},e),{parsedStack:r}));return n}a(Nvo,"_createExDetailsFromInterface");function XZr(t,e){var r=e[gz](Cvo);if(r&&r[go]>=4)t[vM]=r[1],t[Ez]=parseInt(r[2]);else{var n=e[gz](bvo);n&&n[go]>=3?(t[vM]=n[1],t[Ez]=parseInt(n[2])):t[vM]=e}}a(XZr,"_parseFilename");function zZr(t,e,r){var n=t[vM];e.fn&&r&&r[go]>e.fn&&(e.ln&&r[go]>e.ln?(n=Ni(r[e.fn]||""),t[Ez]=parseInt(Ni(r[e.ln]||""))||0):n=Ni(r[e.fn]||"")),n&&XZr(t,n)}a(zZr,"_handleFilename");function Mvo(t){var e=!1;if(t&&Ei(t)){var r=Ni(t);r&&(e=Avo.test(r))}return e}a(Mvo,"_isStackFrame");var eXr=Nh({level:1,method:1,assembly:0,fileName:0,line:0});function Ovo(t,e){var r,n;if(t&&Ei(t)&&Ni(t)){n=(r={},r[Zse]=eXr,r.level=e,r.assembly=Ni(t),r.method=GZr,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o=s.len){s.m&&(n.method=Ni(c[s.m]||GZr)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[vM]=Ni(c[s.fn]||""),n[Ez]=parseInt(Ni(c[s.ln]||""))||0):XZr(n,c[s.fn]||""));break}o++}}return tXr(n)}a(Ovo,"_extractStackFrame");function Lvo(t){var e,r=(e={},e[Zse]=eXr,e.level=t.level,e.method=t.method,e.assembly=t[s1e],e.fileName=t[vM],e.line=t[Ez],e.sizeInBytes=0,e);return tXr(r)}a(Lvo,"_stackFrameFromInterface");function tXr(t){var e=gvo;return t&&(e+=t.method[go],e+=t.assembly[go],e+=t.fileName[go],e+=t.level.toString()[go],e+=t.line.toString()[go],t[n1e]=e),t}a(tXr,"_populateFrameSizeInBytes");function Bvo(t){return{level:t.level,method:t.method,assembly:t[s1e],fileName:t[vM],line:t[Ez]}}a(Bvo,"_parsedFrameToInterface");p();p();var rXr=(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 jB=(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 rXr;h[MZr]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[Yy]=uu(e,r)||zy,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[EA]=x_(e,u),f[Ky]=w_(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var l1e="";function OQe(t){(isNaN(t)||t<0)&&(t=0),t=rJr(t);var e=l1e+t%1e3,r=l1e+Y1(t/1e3)%60,n=l1e+Y1(t/(1e3*60))%60,o=l1e+Y1(t/(1e3*60*60))%24,s=Y1(t/(1e3*60*60*24));return e=e[go]===1?"00"+e:e[go]===2?"0"+e:e,r=r[go]<2?"0"+r:r,n=n[go]<2?"0"+n:n,o=o[go]<2?"0"+o:o,(s>0?s+".":l1e)+o+":"+n+":"+r+"."+e}a(OQe,"msToTimeSpan");var Sz=(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=PMt(e,l),u.url=vz(e,n),u[Yy]=uu(e,r)||zy,isNaN(o)||(u[_z]=OQe(o)),u[EA]=x_(e,s),u[Ky]=w_(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var Tz=(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[_z]=OQe(s),g.success=c,g.resultCode=l+"",g.type=uu(e,d);var A=qZr(e,n,u,o);g.data=vz(e,o)||A.data,g.target=uu(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[Yy]=uu(e,A[Yy]),g[EA]=x_(e,h),g[Ky]=w_(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var Iz=(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||zy,c[Kse]=a1e(e,r),c[EA]=x_(e,o),c[Ky]=w_(e,s),n&&(c[Az]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var xz=(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=vz(e,n),u[Yy]=uu(e,r)||zy,u[EA]=x_(e,s),u[Ky]=w_(e,c),l&&(u.domProcessing=l.domProcessing,u[_z]=l[_z],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 HB=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function u7(t){var e="ai."+t+".";return function(r){return e+r}}a(u7,"_aiNameFunc");var u1e=u7("application"),Jm=u7("device"),LQe=u7("location"),tae=u7("operation"),HMt=u7("session"),l7=u7("user"),wz=u7("cloud"),d1e=u7("internal"),f1e=(function(t){Wy(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(QNt({applicationVersion:u1e("ver"),applicationBuild:u1e("build"),applicationTypeId:u1e("typeId"),applicationId:u1e("applicationId"),applicationLayer:u1e("layer"),deviceId:Jm("id"),deviceIp:Jm("ip"),deviceLanguage:Jm("language"),deviceLocale:Jm("locale"),deviceModel:Jm("model"),deviceFriendlyName:Jm("friendlyName"),deviceNetwork:Jm("network"),deviceNetworkName:Jm("networkName"),deviceOEMName:Jm("oemName"),deviceOS:Jm("os"),deviceOSVersion:Jm("osVersion"),deviceRoleInstance:Jm("roleInstance"),deviceRoleName:Jm("roleName"),deviceScreenResolution:Jm("screenResolution"),deviceType:Jm("type"),deviceMachineName:Jm("machineName"),deviceVMName:Jm("vmName"),deviceBrowser:Jm("browser"),deviceBrowserVersion:Jm("browserVersion"),locationIp:LQe("ip"),locationCountry:LQe("country"),locationProvince:LQe("province"),locationCity:LQe("city"),operationId:tae("id"),operationName:tae("name"),operationParentId:tae("parentId"),operationRootId:tae("rootId"),operationSyntheticSource:tae("syntheticSource"),operationCorrelationVector:tae("correlationVector"),sessionId:HMt("id"),sessionIsFirst:HMt("isFirst"),sessionIsNew:HMt("isNew"),userAccountAcquisitionDate:l7("accountAcquisitionDate"),userAccountId:l7("accountId"),userAgent:l7("userAgent"),userId:l7("id"),userStoreRegion:l7("storeRegion"),userAuthUserId:l7("authUserId"),userAnonymousUserAcquisitionDate:l7("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:l7("authUserAcquisitionDate"),cloudName:wz("name"),cloudRole:wz("role"),cloudRoleVer:wz("roleVer"),cloudRoleInstance:wz("roleInstance"),cloudEnvironment:wz("environment"),cloudLocation:wz("location"),cloudDeploymentUnit:wz("deploymentUnit"),internalNodeName:d1e("nodeName"),internalSdkVersion:d1e("sdkVersion"),internalAgentVersion:d1e("agentVersion"),internalSnippet:d1e("snippet"),internalSdkSrc:d1e("sdkSrc")}));p();var Lh=new f1e;p();function nXr(t,e){xMt(t,null,null,e)}a(nXr,"_disableEvents");function GMt(t){var e=df(),r=Vu(),n=!1,o=[],s=1;r&&!Xt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=Zbe(nS("OfflineListener"),t);try{if(f(ff())&&(n=!0),e){var d=e.body||e;d.ononline&&f(d)&&(n=!0)}}catch{n=!1}function f(b){var T=!1;return b&&(T=xQe(b,"online",y,u),T&&xQe(b,"offline",E,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 b=m();l!==b&&(l=b,Ct(o,function(T){var w={isOnline:l,rState:s,uState:c};try{T(w)}catch{}}))}a(g,"listnerNoticeCheck");function A(b){c=b,g()}a(A,"setOnlineState");function y(){s=1,g()}a(y,"_setOnline");function E(){s=2,g()}a(E,"_setOffline");function _(){var b=ff();if(b&&n){if(nXr(b,u),e){var T=e.body||e;Nn(T.ononline)||nXr(T,u)}n=!1}}a(_,"_unload");function v(b){return o.push(b),{rm:a(function(){var T=o.indexOf(b);if(T>-1)return o.splice(T,1)},"rm")}}return a(v,"addListener"),{isOnline:h,isListening:a(function(){return n},"isListening"),unload:_,addListener:v,setOnlineState:A}}a(GMt,"createOfflineListener");var BQe="AppInsightsChannelPlugin";p();p();p();p();p();var d7="duration";p();var Bh="tags",FQe="deviceType",yC="data",CM="name",Rz="traceID",Fo="length",f7="stringify",p7="measurements",gx="dataType",h7="envelopeType",GB="toString",$B="enqueue",VB="count",Ax="push",p1e="emitLineDelimitedJson",m7="clear",rae="markAsSent",kz="clearSent",h1e="bufferOverride",nae="BUFFER_KEY",WB="SENT_BUFFER_KEY",g7="concat",iae="MAX_BUFFER_SIZE",oae="triggerSend",_A="diagLog",UQe="initialize",sae="_sender",aae="endpointUrl",cae="instrumentationKey",QQe="customHeaders",$Mt="maxBatchSizeInBytes",qQe="onunloadDisableBeacon",jQe="isBeaconApiDisabled",VMt="alwaysUseXhrOverride",WMt="enableSessionStorageBuffer",nP="_buffer",zMt="onunloadDisableFetch",YMt="disableSendBeaconSplit",m1e="getSenderInst",A7="_onError",HQe="_onPartialSuccess",g1e="_onSuccess",GQe="itemsReceived",$Qe="itemsAccepted",VQe="baseType",lae="sampleRate",iXr="getHashCodeScore";var KMt="baseType",Nd="baseData",ng="properties",oXr="true";function qp(t,e,r){return AM(t,e,r,W1)}a(qp,"_setValueIf");function Fvo(t,e,r){var n=r[Bh]=r[Bh]||{},o=e.ext=e.ext||{},s=e[Bh]=e[Bh]||[],c=o.user;c&&(qp(n,Lh.userAuthUserId,c.authId),qp(n,Lh.userId,c.id||c.localId));var l=o.app;l&&qp(n,Lh.sessionId,l.sesId);var u=o.device;u&&(qp(n,Lh.deviceId,u.id||u.localId),qp(n,Lh[FQe],u.deviceClass),qp(n,Lh.deviceIp,u.ip),qp(n,Lh.deviceModel,u.model),qp(n,Lh[FQe],u[FQe]));var d=e.ext.web;if(d){qp(n,Lh.deviceLanguage,d.browserLang),qp(n,Lh.deviceBrowserVersion,d.browserVer),qp(n,Lh.deviceBrowser,d.browser);var f=r[yC]=r[yC]||{},h=f[Nd]=f[Nd]||{},m=h[ng]=h[ng]||{};qp(m,"domain",d.domain),qp(m,"isManual",d.isManual?oXr:null),qp(m,"screenRes",d.screenRes),qp(m,"userConsent",d.userConsent?oXr:null)}var g=o.os;g&&(qp(n,Lh.deviceOS,g[CM]),qp(n,Lh.deviceOSVersion,g.osVer));var A=o.trace;A&&(qp(n,Lh.operationParentId,A.parentID),qp(n,Lh.operationName,uu(t,A[CM])),qp(n,Lh.operationId,A[Rz]));for(var y={},E=s[Fo]-1;E>=0;E--){var _=s[E];Yr(_,function(b,T){y[b]=T}),s.splice(E,1)}Yr(s,function(b,T){y[b]=T});var v=fx(fx({},n),y);v[Lh.internalSdkVersion]||(v[Lh.internalSdkVersion]=uu(t,"javascript:".concat(Uvo.Version),64)),r[Bh]=iQe(v)}a(Fvo,"_extractPartAExtensions");function y7(t,e,r){Xt(t)||Yr(t,function(n,o){Dh(o)?r[n]=o:Ei(o)?e[n]=o:e7()&&(e[n]=I_()[f7](o))})}a(y7,"_extractPropsAndMeasurements");function Pz(t,e){Xt(t)||Yr(t,function(r,n){t[r]=n||e})}a(Pz,"_convertPropsUndefinedToCustomDefinedValue");function Dz(t,e,r,n){var o=new FMt(t,n,e);qp(o,"sampleRate",r[Xbe]),(r[Nd]||{}).startTime&&(o.time=XU(r[Nd].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[CM]=o[CM].replace("{0}",s),Fvo(t,r,o),r[Bh]=r[Bh]||[],iQe(o)}a(Dz,"_createEnvelope");function Nz(t,e){Xt(e[Nd])&&Wr(t,1,46,"telemetryItem.baseData cannot be null.")}a(Nz,"EnvelopeCreatorInit");var Uvo={Version:"3.3.11"};function sXr(t,e,r){Nz(t,e);var n=e[Nd][p7]||{},o=e[Nd][ng]||{};y7(e[yC],o,n),Xt(r)||Pz(o,r);var s=e[Nd];if(Xt(s))return UB(t,"Invalid input for dependency data"),null;var c=s[ng]&&s[ng][wQe]?s[ng][wQe]:"GET",l=new Tz(t,s.id,s.target,s[CM],s[d7],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new HB(Tz[gx],l);return Dz(t,Tz[h7],e,u)}a(sXr,"DependencyEnvelopeCreator");function JMt(t,e,r){Nz(t,e);var n={},o={};e[KMt]!==qB[gx]&&(n.baseTypeSource=e[KMt]),e[KMt]===qB[gx]?(n=e[Nd][ng]||{},o=e[Nd][p7]||{}):e[Nd]&&y7(e[Nd],n,o),y7(e[yC],n,o),Xt(r)||Pz(n,r);var s=e[Nd][CM],c=new qB(t,s,n,o),l=new HB(qB[gx],c);return Dz(t,qB[h7],e,l)}a(JMt,"EventEnvelopeCreator");function aXr(t,e,r){Nz(t,e);var n=e[Nd][p7]||{},o=e[Nd][ng]||{};y7(e[yC],o,n),Xt(r)||Pz(o,r);var s=e[Nd],c=bz.CreateFromInterface(t,s,o,n),l=new HB(bz[gx],c);return Dz(t,bz[h7],e,l)}a(aXr,"ExceptionEnvelopeCreator");function cXr(t,e,r){Nz(t,e);var n=e[Nd],o=n[ng]||{},s=n[p7]||{};y7(e[yC],o,s),Xt(r)||Pz(o,r);var c=new jB(t,n[CM],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new HB(jB[gx],c);return Dz(t,jB[h7],e,l)}a(cXr,"MetricEnvelopeCreator");function lXr(t,e,r){Nz(t,e);var n,o=e[Nd];!Xt(o)&&!Xt(o[ng])&&!Xt(o[ng][d7])?(n=o[ng][d7],delete o[ng][d7]):!Xt(e[yC])&&!Xt(e[yC][d7])&&(n=e[yC][d7],delete e[yC][d7]);var s=e[Nd],c;((e.ext||{}).trace||{})[Rz]&&(c=e.ext.trace[Rz]);var l=s.id||c,u=s[CM],d=s.uri,f=s[ng]||{},h=s[p7]||{};if(Xt(s.refUri)||(f.refUri=s.refUri),Xt(s.pageType)||(f.pageType=s.pageType),Xt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[GB]()),!Xt(s[ng])){var m=s[ng];Yr(m,function(y,E){f[y]=E})}y7(e[yC],f,h),Xt(r)||Pz(f,r);var g=new Sz(t,u,d,n,f,h,l),A=new HB(Sz[gx],g);return Dz(t,Sz[h7],e,A)}a(lXr,"PageViewEnvelopeCreator");function uXr(t,e,r){Nz(t,e);var n=e[Nd],o=n[CM],s=n.uri||n.url,c=n[ng]||{},l=n[p7]||{};y7(e[yC],c,l),Xt(r)||Pz(c,r);var u=new xz(t,o,s,void 0,c,l,n),d=new HB(xz[gx],u);return Dz(t,xz[h7],e,d)}a(uXr,"PageViewPerformanceEnvelopeCreator");function dXr(t,e,r){Nz(t,e);var n=e[Nd].message,o=e[Nd].severityLevel,s=e[Nd][ng]||{},c=e[Nd][p7]||{};y7(e[yC],s,c),Xt(r)||Pz(s,r);var l=new Iz(t,n,o,s,c),u=new HB(Iz[gx],l);return Dz(t,Iz[h7],e,u)}a(dXr,"TraceEnvelopeCreator");p();var fXr=(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},Si(t,this,function(c){c[$B]=function(l){if(c[VB]()>=r.eventsLimitInMem){o||(Wr(e,2,105,"Maximum in-memory buffer size reached: "+c[VB](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Xt(s)&&l.cnt>s)&&n[Ax](l)},c[VB]=function(){return n[Fo]},c.size=function(){for(var l=n[Fo],u=0;u0){var u=[];Ct(l,function(f){u[Ax](f.item)});var d=r[p1e]?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 ZMt(l,u):new WQe(l,u);return Ct(f,function(m){h[$B](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),WQe=(function(t){Wy(e,t);function e(r,n){var o=t.call(this,r,n)||this;return Si(e,o,function(s,c){s[rae]=function(l){c[m7]()},s[kz]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(fXr);var Qvo=["AI_buffer","AI_sentBuffer"],ZMt=(function(t){Wy(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[h1e]||{getItem:OMt,setItem:LMt},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return Si(e,s,function(m,g){var A=T(e[nae]),y=T(e[WB]),E=x(),_=y[g7](E),v=m._set(A[g7](_));v[Fo]>e[iae]&&(v[Fo]=e[iae]),R(e[WB],[]),R(e[nae],v),m[$B]=function(D){if(m[VB]()>=e[iae]){c||(Wr(n,2,67,"Maximum buffer size reached: "+m[VB](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Xt(h)&&D.cnt>h)&&(g[$B](D),R(e[nae],m._get()))},m[m7]=function(){g[m7](),R(e[nae],m._get()),R(e[WB],[]),c=!1},m[rae]=function(D){R(e[nae],m._set(b(D,m._get())));var N=T(e[WB]);N instanceof Array&&D instanceof Array&&(N=N[g7](D),N[Fo]>e[iae]&&(Wr(n,1,67,"Sent buffer reached its maximum size: "+N[Fo],!0),N[Fo]=e[iae]),R(e[WB],N))},m[kz]=function(D){var N=T(e[WB]);N=b(D,N),R(e[WB],N)},m.createNew=function(D,N,L){L=!!L;var B=m._get().slice(0),q=T(e[WB]).slice(0);D=D||n,N=N||{},m[m7]();var M=L?new e(D,N):new WQe(D,N);return Ct(B,function(O){M[$B](O)}),L&&M[rae](q),M};function b(D,N){var L=[],B=[];return Ct(D,function(q){B[Ax](q.item)}),Ct(N,function(q){!Or(q)&&Wo(B,q.item)===-1&&L[Ax](q)}),L}a(b,"_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 L=I_().parse(N);if(Ei(L)&&(L=I_().parse(L)),L&&ur(L))return L}}catch(B){Wr(n,1,42," storage key: "+D+", "+Qp(B),{exception:dr(B)})}return[]}a(w,"_getBufferBase");function R(D,N){var L=D;try{L=l?l+"_"+L:L;var B=JSON[f7](N);f(n,L,B)}catch(q){f(n,L,JSON[f7]([])),Wr(n,2,41," storage key: "+L+", "+Qp(q)+". Buffer cleared",{exception:dr(q)})}}a(R,"_setBuffer");function x(){var D=[];try{return Ct(Qvo,function(N){var L=P(N);if(D=D[g7](L),l){var B=l+"_"+N,q=P(B);D=D[g7](q)}}),D}catch(N){Wr(n,2,41,"Transfer events from previous buffers: "+Qp(N)+". previous Buffer items can not be removed",{exception:dr(N)})}return[]}a(x,"_getPreviousEvents");function P(D){try{var N=w(D),L=[];return Ct(N,function(B){var q={item:B,cnt:0};L[Ax](q)}),BMt(n,D),L}catch{}return[]}a(P,"_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})(fXr);p();var pXr=(function(){function t(e){Si(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return I_()[f7](l)}catch(u){Wr(e,1,48,u&&Or(u[GB])?u[GB]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Wr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Wr(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(ur(c))d=o(c,l);else{Wr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{I_()[f7](c),d=c}catch(f){Wr(e,1,48,f&&Or(f[GB])?f[GB]():"Error serializing object",null,!0)}}return d}return c[u]=!0,Yr(c.aiDataContract,function(f,h){var m=Or(h)?h()&1:h&1,g=Or(h)?h()&4:h&4,A=h&2,y=c[f]!==void 0,E=Gu(c[f])&&c[f]!==null;if(m&&!y&&!A)Wr(e,1,24,"Missing required field specification. The field is required but not present on source",{field:f,name:l});else if(!g){var _=void 0;E?A?_=o(c[f],f):_=n(c[f],f):_=c[f],_!==void 0&&(d[f]=_)}}),delete c[u],d}a(n,"_serializeObject");function o(c,l){var u;if(c)if(!ur(c))Wr(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[lae]=e,this.samplingScoreGenerator=new mXr}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[lae],n=!1;return r==null||r>=100||e.baseType===jB[gx]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(Gvo,"_chkSampling");var $vo=(zB={},zB[qB.dataType]=JMt,zB[Iz.dataType]=dXr,zB[Sz.dataType]=lXr,zB[xz.dataType]=uXr,zB[bz.dataType]=aXr,zB[jB.dataType]=cXr,zB[Tz.dataType]=sXr,zB),XMt=(function(t){Wy(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=BQe;var n,o,s,c,l,u,d,f,h=0,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q,U,Y,W,V,z,ie;return Si(e,r,function(H,re){Ge(),H.pause=function(){pe(),c=!0},H.resume=function(){c&&(c=!1,o=null,rt(),Qe())},H.flush=function(J,se,me){if(J===void 0&&(J=!0),!c){pe();try{var Ce=H[oae](J,null,me||1);return _l(Ce,function(He){return se?(se(!He.rejected),!0):J?Dd(function($e){$e(!He.rejected)}):Ce})}catch(He){Wr(H[_A](),1,22,"flush failed, telemetry will not be collected: "+Qp(He),{exception:dr(He)})}}},H.onunloadFlush=function(){if(!c)if(v||O)try{return H[oae](!0,Dt,2)}catch(J){Wr(H[_A](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+Qp(J),{exception:dr(J)})}else H.flush(!1)},H.addHeader=function(J,se){f[J]=se},H[UQe]=function(J,se,me,Ce){H.isInitialized()&&Wr(H[_A](),1,28,"Sender is already initialized"),re[UQe](J,se,me,Ce);var He=H.identifier;u=new pXr(se.logger),n=0,o=null,s=0,H[sae]=null,d=0;var $e=H[_A]();A=Zbe(nS("Sender"),se.evtNamespace&&se.evtNamespace()),g=GMt(A),H._addHook(px(J,function(et){var ct=et.cfg;ct.storagePrefix&&MMt(ct.storagePrefix);var bt=tP(null,ct,se),ht=bt.getExtCfg(He,EXr),We=ht[aae];if(y&&We===y){var ae=ct[aae];ae&&ae!==We&&(ht[aae]=ae)}var Re=Di("CompressionStream");ie=qNt("zipPayload",ct,!1),Or(Re)||(ie=!1);var Me=ht.corsPolicy;Me?(Me==="same-origin"||Me==="same-site"||Me==="cross-origin")&&r.addHeader(_Xr,Me):delete f[_Xr],tg(ht[cae])&&(ht[cae]=ct[cae]),ji(H,"_senderConfig",{g:a(function(){return ht},"g")}),E!==ht[aae]&&(y=E=ht[aae]),se.activeStatus()===Kk.PENDING?H.pause():se.activeStatus()===Kk.ACTIVE&&H.resume(),w&&w!==ht[QQe]&&Ct(w,function(_r){delete f[_r.header]}),_=ht[$Mt],v=(ht[qQe]===!1||ht[jQe]===!1)&&t7(),b=ht[qQe]===!1&&t7(),T=ht[jQe]===!1&&t7(),O=ht[VMt],j=!!ht.disableXhr,z=ht.retryCodes;var ye=ht[h1e],oe=!!ht[WMt]&&(!!ye||NQe()),ze=ht.namePrefix,at=oe!==L||oe&&q!==ze||oe&&B!==ye;if(H[nP]){if(at)try{H[nP]=H[nP].createNew($e,ht,oe)}catch(_r){Wr(H[_A](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+Qp(_r),{exception:dr(_r)})}rt()}else H[nP]=oe?new ZMt($e,ht):new WQe($e,ht);q=ze,L=oe,B=ye,Q=!ht[zMt]&&Fbe(!0),W=!!ht[YMt],H._sample=new gXr(ht.samplingPercentage,$e),x=ht[cae],!tg(x)&&!Te(x,ct)&&Wr($e,1,100,"Invalid Instrumentation key "+x),w=ht[QQe],Ei(y)&&!PQe(y)&&w&&w[Fo]>0?Ct(w,function(_r){r.addHeader(_r.header,_r.value)}):w=null,M=ht.enableSendPromise;var Vt=Le();V?V.SetConfig(Vt):(V=new SMt,V[UQe](Vt,$e));var gr=ht.httpXHROverride,cr=null,Mr=null,Hr=sQe([3,1,2],ht.transports);cr=V&&V[m1e](Hr,!1);var Gr=V&&V.getFallbackInst();U=a(function(_r,$0){return Ne(Gr,_r,$0)},"_xhrSend"),Y=a(function(_r,$0){return Ne(Gr,_r,$0,!1)},"_fallbackSend"),cr=O?gr:cr||gr||Gr,H[sae]=function(_r,$0){return Ne(cr,_r,$0)},Q&&(m=Ie);var Yt=sQe([3,1],ht.unloadTransports);Q||(Yt=Yt.filter(function(_r){return _r!==2})),Mr=V&&V[m1e](Yt,!0),Mr=O?gr:Mr||gr,(O||ht.unloadTransports||!m)&&Mr&&(m=a(function(_r,$0){return Ne(Mr,_r,$0)},"_syncUnloadSender")),m||(m=U),R=ht.disableTelemetry,P=ht.convertUndefined||iP,D=ht.isRetryDisabled,N=ht.maxBatchInterval}))},H.processTelemetry=function(J,se){se=H._getTelCtx(se);var me=se[_A]();try{var Ce=K(J,me);if(!Ce)return;var He=he(J,me);if(!He)return;var $e=u.serialize(He),et=H[nP];rt($e);var ct={item:$e,cnt:0};et[$B](ct),Qe()}catch(bt){Wr(me,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Qp(bt),{exception:dr(bt)})}H.processNext(J,se)},H.isCompletelyIdle=function(){return!c&&h===0&&H._buffer[VB]()===0},H.getOfflineListener=function(){return g},H._xhrReadyStateChange=function(J,se,me){if(!Gt(se))return ge(J,se,me)},H[oae]=function(J,se,me){J===void 0&&(J=!0);var Ce;if(!c)try{var He=H[nP];if(R)He[m7]();else{if(He[VB]()>0){var $e=He.getItems();te(me||0,J),se?Ce=se.call(H,$e,J):Ce=H[sae]($e,J)}s=+new Date}pe()}catch(ct){var et=JNt();(!et||et>9)&&Wr(H[_A](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+Qp(ct),{exception:dr(ct)})}return Ce},H.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:qe,serialize:Z,batch:ue,shouldProcess:a(function(J){return!!K(J)},"shouldProcess")}},H._doTeardown=function(J,se){H.onunloadFlush(),FB(g,!1),Ge()},H[A7]=function(J,se,me){if(!Gt(J))return Ue(J,se,me)},H[HQe]=function(J,se){if(!Gt(J))return ke(J,se)},H[g1e]=function(J,se){if(!Gt(J))return X(J,se)},H._xdrOnLoad=function(J,se){if(!Gt(se))return le(J,se)};function le(J,se){var me=yXr(J);if(J&&(me+""=="200"||me===""))n=0,H[g1e](se,0);else{var Ce=Jbe(me);Ce&&Ce[GQe]&&Ce[GQe]>Ce[$Qe]&&!D?H[HQe](se,Ce):H[A7](se,Obe(J))}}a(le,"_xdrOnLoad");function Le(){try{var J={xdrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return le(me,$e)},"xdrOnComplete"),fetchOnComplete:a(function(me,Ce,He,$e){var et=ee($e);if(et)return st(me.status,et,me.url,et[Fo],me.statusText,He||"")},"fetchOnComplete"),xhrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return ge(me,$e,$e[Fo])},"xhrOnComplete"),beaconOnRetry:a(function(me,Ce,He){return $t(me,Ce,He)},"beaconOnRetry")},se={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:j,disableBeacon:!T,disableBeaconSync:!b,senderOnCompleteCallBack:J};return se}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(J,se,me){J.readyState===4&&st(J.status,se,J.responseURL,me,uz(J),yXr(J)||J.response)}a(ge,"_xhrReadyStateChange");function Ue(J,se,me){Wr(H[_A](),2,26,"Failed to send telemetry.",{message:se}),H._buffer&&H._buffer[kz](J)}a(Ue,"_onError");function ke(J,se){for(var me=[],Ce=[],He=se.errors.reverse(),$e=0,et=He;$e0&&H[g1e](J,se[$Qe]),me[Fo]>0&&H[A7](me,uz(null,["partial success",se[$Qe],"of",se.itemsReceived].join(" "))),Ce[Fo]>0&&(F(Ce),Wr(H[_A](),2,40,"Partial success. Delivered: "+J[Fo]+", Failed: "+me[Fo]+". Will retry to send "+Ce[Fo]+" our of "+se[GQe]+" items"))}a(ke,"_onPartialSuccess");function X(J,se){H._buffer&&H._buffer[kz](J)}a(X,"_onSuccess");function ee(J){try{if(J){var se=J,me=se.oriPayload;return me&&me[Fo]?me:null}}catch{}return null}a(ee,"_getPayloadArr");function K(J,se){if(R)return!1;if(!J)return se&&Wr(se,1,7,"Cannot send empty telemetry"),!1;if(J.baseData&&!J[VQe])return se&&Wr(se,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(J[VQe]||(J[VQe]="EventData"),!H[sae])return se&&Wr(se,1,28,"Sender was not initialized"),!1;if(ne(J))J[Xbe]=H._sample[lae];else return se&&Wr(se,2,33,"Telemetry item was sampled out and not sent",{SampleRate:H._sample[lae]}),!1;return!0}a(K,"_validate");function he(J,se){var me=J.iKey||x,Ce=e.constructEnvelope(J,me,se,P);if(!Ce){Wr(se,1,47,"Unable to create an AppInsights envelope");return}var He=!1;if(J[Bh]&&J[Bh][e1e]&&(Ct(J[Bh][e1e],function($e){try{$e&&$e(Ce)===!1&&(He=!0,UB(se,"Telemetry processor check returns false"))}catch(et){Wr(se,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+Qp(et),{exception:dr(et)},!0)}}),delete J[Bh][e1e]),!He)return Ce}a(he,"_getEnvelope");function Z(J){var se=AXr,me=H[_A]();try{var Ce=K(J,me),He=null;Ce&&(He=he(J,me)),He&&(se=u.serialize(He))}catch{}return se}a(Z,"_serialize");function ue(J){var se=AXr;return J&&J[Fo]&&(se="["+J.join(",")+"]"),se}a(ue,"_batch");function qe(J){var se=Be();return{urlString:y,data:J,headers:se}}a(qe,"_createPayload");function ne(J){return H._sample.isSampledIn(J)}a(ne,"_isSampledIn");function ce(J,se,me,Ce){se===200&&J?H._onSuccess(J,J[Fo]):Ce&&H[A7](J,Ce)}a(ce,"_getOnComplete");function Ne(J,se,me,Ce){Ce===void 0&&(Ce=!0);var He=a(function(ae,Re,Me){return ce(se,ae,Re,Me)},"onComplete"),$e=we(se),et=J&&J.sendPOST;if(et&&$e){Ce&&H._buffer[rae](se);var ct,bt=!1,ht,We;return V.preparePayload(function(ae){ct=et(ae,He,!me),bt=!0,ht&&z7e(ct,ht,We)},ie,$e,!me),bt?ct:Dd(function(ae,Re){ht=ae,We=Re})}return null}a(Ne,"_doSend");function we(J){if(ur(J)&&J[Fo]>0){var se=H[nP].batchPayloads(J),me=Be(),Ce={data:se,urlString:y,headers:me,disableXhrSync:j,disableFetchKeepAlive:!Q,oriPayload:J};return Ce}return null}a(we,"_getPayload");function Be(){try{var J=f||{};return PQe(y)&&(J[RQe[6]]=RQe[7]),J}catch{}return null}a(Be,"_getHeaders");function rt(J){var se=J?J[Fo]:0;return H[nP].size()+se>_?((!g||g.isOnline())&&H[oae](!0,null,10),!0):!1}a(rt,"_checkMaxSize");function st(J,se,me,Ce,He,$e){var et=null;if(H._appId||(et=Jbe($e),et&&et.appId&&(H._appId=et.appId)),(J<200||J>=300)&&J!==0){if((J===301||J===307||J===308)&&!_t(me)){H[A7](se,He);return}if(g&&!g.isOnline()){if(!D){var ct=10;F(se,ct),Wr(H[_A](),2,40,". Offline - Response Code: ".concat(J,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(se.length," items."))}return}!D&&Se(J)?(F(se),Wr(H[_A](),2,40,". Response code "+J+". Will retry to send "+se[Fo]+" items.")):H[A7](se,He)}else _t(me),J===206?(et||(et=Jbe($e)),et&&!D?H[HQe](se,et):H[A7](se,He)):(n=0,H[g1e](se,Ce))}a(st,"_checkResponsStatus");function _t(J){return d>=10?!1:!Xt(J)&&J!==""&&J!==y?(y=J,++d,!0):!1}a(_t,"_checkAndUpdateEndPointUrl");function Dt(J,se){if(m)m(J,!1);else{var me=V&&V[m1e]([3],!0);return Ne(me,J,se)}}a(Dt,"_doUnloadSend");function $t(J,se,me){var Ce=J,He=Ce&&Ce.oriPayload;if(W)Y&&Y(He,!0),Wr(H[_A](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var $e=[],et=0;et0&&(Y&&Y($e,!0),Wr(H[_A](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a($t,"_onBeaconRetry");function Gt(J){try{if(J&&J[Fo])return Ei(J[0])}catch{}return null}a(Gt,"_isStringArr");function Ie(J,se){var me=null;if(ur(J)){for(var Ce=J[Fo],He=0;He-1}a(Se,"_isRetriable");function Fe(){var J="getNotifyMgr",se,me=H.core;return me&&(me[J]?se=me[J]():se=me._notificationManager),se}a(Fe,"_getNotifyMgr");function te(J,se){var me=Fe();if(me&&me.eventsSendRequest)try{me.eventsSendRequest(J,se)}catch(Ce){Wr(H[_A](),1,74,"send request notification failed: "+Qp(Ce),{exception:dr(Ce)})}}a(te,"_notifySendRequest");function Te(J,se){var me=se.disableInstrumentationKeyValidation,Ce=Xt(me)?!1:me;if(Ce)return!0;var He="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",$e=new RegExp(He);return $e.test(J)}a(Te,"_validateInstrumentationKey");function Ge(){H[sae]=null,H[nP]=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,E=null,_=0,v=!1,w=null,R=!1,x=null,P=iP,D=!1,L=null,q=iP,j=!1,Q=!1,W=!1,U=null,Y=null,V=null,ji(H,"_senderConfig",{g:a(function(){return oQe({},EXr)},"g")})}a(Ge,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Xt(n)?c=fx(fx({},r),{iKey:n}):c=r;var l=$vo[c.baseType]||JMt;return l(o,c,s)},e})(Kbe);p();var Mz="instrumentationKey",A1e="connectionString",uae="endpointUrl",dae="userOverrideEndpointUrl";var Oz,eOt,tOt=void 0,Vvo=(Oz={diagnosticLogInterval:$se(Wvo,1e4)},Oz[A1e]=tOt,Oz.endpointUrl=tOt,Oz[Mz]=tOt,Oz.featureOptIn=(eOt={},eOt.zipPayload={mode:1},eOt),Oz.extensionConfig={},Oz);function Wvo(t){return t&&t>0}a(Wvo,"_chkDiagLevel");var vXr=(function(){function t(e){var r=new CMt,n;(Xt(e)||Xt(e[Mz])&&Xt(e[A1e]))&&Zc("Invalid input configuration"),Si(t,this,function(s){ji(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,lz(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=Oh(e||{},Vvo);n=l.cfg,r.addUnloadHook(px(l,function(){var u=n[A1e];if(tg(u)){var d=Dbe(function(g,A){_l(u,function(y){var E=y.value,_=n[Mz];if(!y.rejected&&E){n[A1e]=E;var v=c1e(E);_=v.instrumentationkey||_}g(_)})}),f=Dbe(function(g,A){_l(u,function(y){var E=y.value,_=n[uae];if(!y.rejected&&E){var v=c1e(E),b=v.ingestionendpoint;_=b?b+_M:_}g(_)})});n[Mz]=d,n[uae]=n[dae]||f}if(Ei(u)){var h=c1e(u),m=h.ingestionendpoint;n[uae]=n[dae]?n[dae]:m+_M,n[Mz]=h.instrumentationkey||n[Mz]}n[uae]=n[dae]?n[dae]:n[uae]})),r.initialize(n,[new XMt])}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 iS=de(require("os"));var fae=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(nr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new vXr({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[BQe]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:zvo(e),this.commonProperties=n?.excludeCommonProperties?{}:Yvo(e),this.#e=bs(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 zvo(t){let e={},r=t.get(Fa);e["ai.session.id"]=r.sessionId;let n=t.get(Op);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${iS.type()} ${iS.release()}`,e["ai.device.osArchitecture"]=iS.arch(),e["ai.device.osPlatform"]=iS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ds).getVersion(),e}a(zvo,"getTags");function Yvo(t){let e={};e.common_os=iS.platform(),e.common_platformversion=iS.release(),e.common_arch=iS.arch(),e.common_cpu=Array.from(new Set(iS.cpus().map(n=>n.model))).join();let r=t.get(Fa);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(Yvo,"getCommonProperties");p();p();p();p();p();p();var y1e=I7e;var bM=y1e({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var E7=y1e({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Lz="toLowerCase",In="length",pae="warnToConsole",YB="throwInternal",SM="watch",_7="apply",ro="push",yx="splice",zu="logger",TM="cancel",KB="initialize",IM="identifier",hae="removeNotificationListener",mae="addNotificationListener",EC="isInitialized",E1e="getNotifyMgr",v7="getPlugin",oP="name",Zm="processNext",zQe="getProcessTelContext",JB="value",C7="enabled",rOt="stopPollingInternalLogs",Ex="unload",_1e="onComplete",YQe="version",KQe="loggingLevelConsole",xM="createNew",oS="teardown",gae="messageId",wM="message",_C="diagLog",b7="_doTeardown",Bz="update",sS="getNext",S7="setNextPlugin",v1e="userAgent",ZB="split",sP="replace",nOt="substring",JQe="indexOf",XB="type",iOt="evtName",aP="status",oOt="getAllResponseHeaders",C1e="isChildEvt",aS="data",Fz="getCtx",cP="setCtx";var b1e="headers",Aae="urlString",Uz="timeout";var ZQe="traceFlags";var sOt;function CXr(t,e){sOt||(sOt=Abe("AggregationError",function(n,o){o[In]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` +`.concat(o," > ").concat(dr(n))}),new sOt(r,e||[])}a(CXr,"throwAggregationError");p();p();p();p();p();var cS=void 0,Ss="",Qz="channels",zf="core",XQe="createPerfMgr",S1e="disabled",e3="extensionConfig",qz="extensions",vC="processTelemetry",jz="priority",yae="eventsSent",T7="eventsDiscarded",Eae="eventsSendRequest",RM="perfEvent",eqe="offlineEventsStored",tqe="offlineBatchSent",rqe="offlineBatchDrop",_ae="getPerfMgr",nqe="domain",iqe="path",bXr="Not dynamic - ";var Kvo="getPrototypeOf",Jvo=/-([a-z])/g,Zvo=/([^\w\d_$])/g,Xvo=/^(\d+[\w\d_$])/,KBl=Object[Kvo];function I7(t){return!Xt(t)}a(I7,"isNotNullOrUndefined");function vae(t){var e=t;return e&&Ei(e)&&(e=e[sP](Jvo,function(r,n){return n.toUpperCase()}),e=e[sP](Zvo,"_"),e=e[sP](Xvo,function(r,n){return"_"+n})),e}a(vae,"normalizeJsName");function ig(t,e){return t&&e?lu(t,e)!==-1:!1}a(ig,"strContains");function Cae(t){return t&&t.toISOString()||""}a(Cae,"toISOString");function bae(t){return xB(t)?t[oP]:Ss}a(bae,"getExceptionName");function t3(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(t3,"setValue");function oqe(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(oqe,"getSetValue");function eCo(t,e){var r=null,n=null;return Or(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][_7](n,o)}}a(eCo,"_createProxyFunction");function x7(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=eCo(r,n))}a(x7,"proxyFunctionAs");function w7(t,e,r,n){return t&&e&&Gu(t)&&ur(r)&&Ct(r,function(o){Ei(o)&&x7(t,o,e,o,n)}),t}a(w7,"proxyFunctions");function kM(t){return t&&wB&&(t=KU(wB({},t))),t}a(kM,"optimizeObject");function sqe(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(sqe,"isFeatureEnabled");function PM(t){try{return t.responseText}catch{}return null}a(PM,"getResponseText");function aqe(t,e){return t?"XDomainRequest,Response:"+PM(t)||"":e}a(aqe,"formatErrorMessageXdr");function I1e(t,e){return t?"XMLHttpRequest,Status:"+t[aP]+",Response:"+PM(t)||t.response||"":e}a(I1e,"formatErrorMessageXhr");function x1e(t,e){return e&&(Dh(e)?t=[e].concat(t):ur(e)&&(t=e.concat(t))),t}a(x1e,"prependTransports");var tCo="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",SXr="withCredentials",rCo="timeout";function aOt(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,tCo,n),r&&c(l,SXr,r),l.open(t,e,!o),r&&c(l,SXr,r),!o&&s&&c(l,rCo,s),l}a(aOt,"openXhr");function cOt(t){var e={};if(Ei(t)){var r=Ni(t)[ZB](/[\r\n]+/);Ct(r,function(n){if(n){var o=n[JQe](": ");if(o!==-1){var s=Ni(n.substring(0,o))[Lz](),c=Ni(n[nOt](o+1));e[s]=c}else e[Ni(n)]=1}})}return e}a(cOt,"convertAllHeadersToMap");function T1e(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Ni(n))}return t}a(T1e,"_appendHeader");var nCo="kill-duration",iCo="kill-duration-seconds",oCo="time-delta-millis";function R7(t,e){var r={};return t[oOt]?r=cOt(t[oOt]()):e&&(r=T1e(r,t,oCo),r=T1e(r,t,nCo),r=T1e(r,t,iCo)),r}a(R7,"_getAllResponseHeaders");p();p();var sCo="location",aCo="console",TXr="JSON",cCo="crypto",lCo="msCrypto",uCo="ReactNative",dCo="msie",fCo="trident/",IXr="XMLHttpRequest",lOt=null,uOt=null,pCo=!1,Sae=null,dOt=null;function xXr(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[tS];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Nn(o[e])}catch{}}return r}a(xXr,"_hasProperty");function Tae(t){if(t&&pCo){var e=Di("__mockLocation");if(e)return e}return typeof location===dx&&location?location:Di(sCo)}a(Tae,"getLocation");function cqe(){return typeof console!==eS?console:Di(aCo)}a(cqe,"getConsole");function w1e(){return!!(typeof JSON===dx&&JSON||Di(TXr)!==null)}a(w1e,"hasJSON");function lqe(){return w1e()?JSON||Di(TXr):null}a(lqe,"getJSON");function uqe(){return Di(cCo)}a(uqe,"getCrypto");function dqe(){return Di(lCo)}a(dqe,"getMsCrypto");function Iae(){var t=Vu();return t&&t.product?t.product===uCo:!1}a(Iae,"isReactNative");function Hz(){var t=Vu();if(t&&(t[v1e]!==uOt||lOt===null)){uOt=t[v1e];var e=(uOt||Ss)[Lz]();lOt=ig(e,dCo)||ig(e,fCo)}return lOt}a(Hz,"isIE");function xae(t){return(dOt===null||t===!1)&&(dOt=ZW()&&!!Vu().sendBeacon),dOt}a(xae,"isBeaconsSupported");function wae(t){var e=!1;try{e=!!Di("fetch");var r=Di("Request");e&&t&&r&&(e=xXr(r,"keepalive"))}catch{}return e}a(wae,"isFetchSupported");function fqe(){return Sae===null&&(Sae=typeof XDomainRequest!==eS,Sae&&R1e()&&(Sae=Sae&&!xXr(Di(IXr),"withCredentials"))),Sae}a(fqe,"useXDomainRequest");function R1e(){var t=!1;try{var e=Di(IXr);t=!!e}catch{}return t}a(R1e,"isXhrSupported");var wXr=4294967296,Gz=4294967295,RXr=123456789,kXr=987654321,PXr=!1,k1e=RXr,P1e=kXr;function hCo(t){t<0&&(t>>>=0),k1e=RXr+t&Gz,P1e=kXr-t&Gz,PXr=!0}a(hCo,"_mwcSeed");function mCo(){try{var t=El()&2147483647;hCo((Math.random()*wXr^t)+t)}catch{}}a(mCo,"_autoSeedMwc");function fOt(t){var e=0,r=uqe()||dqe();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&Gz),e===0&&Hz()&&(PXr||mCo(),e=gCo()&Gz),e===0&&(e=Y1(wXr*Math.random()|0)),t||(e>>>=0),e}a(fOt,"random32");function gCo(t){P1e=36969*(P1e&65535)+(P1e>>16)&Gz,k1e=18e3*(k1e&65535)+(k1e>>16)&Gz;var e=(P1e<<16)+(k1e&65535)>>>0&Gz|0;return t||(e>>>=0),e}a(gCo,"mwcRandom32");function pOt(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=fOt()>>>0,n=0,o=Ss;o[In]>>=6,n===5&&(r=(fOt()<<2&4294967295|r&3)>>>0,n=0);return o}a(pOt,"newId");var DXr="3.3.10",ACo="."+pOt(6),yCo=0;function NXr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(NXr,"_canAcceptData");function ECo(t,e){var r=e[t.id];if(!r){r={};try{NXr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(ECo,"_getCache");function _x(t,e){return e===void 0&&(e=!1),vae(t+yCo+++(e?"."+DXr:Ss)+ACo)}a(_x,"createUniqueNamespace");function pqe(t){var e={id:_x("_aiData-"+(t||Ss)+"."+DXr),accept:a(function(r){return NXr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[vae(n)]:(s&&(c=ECo(e,r),c[vae(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(pqe,"createElmNodeData");p();function hqe(t){return t&&Gu(t)&&!ur(t)&&(t.isVal||t.fb||yA(t,"v")||yA(t,"mrg")||yA(t,"ref")||t.set)}a(hqe,"_isConfigDefaults");function MXr(t,e,r){var n,o=r.dfVal||Tse;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&CXr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[In]>0){c||(c=[]),l||(l=Up(function(){l=null,f()},0));for(var A=0;A0?_l(kae(t[0],e),function(){yOt(GU(t,1),e,r)}):r(),n}a(yOt,"doUnloadAll");p();var BXr=500,EOt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function FXr(t){return{mrg:!0,v:t}}a(FXr,"cfgDfMerge");p();p();var _Ot=[yae,T7,Eae,RM],_qe=null,Eqe;function xCo(t,e){return function(){var r=arguments,n=vOt(e);if(n){var o=n.listener;o&&o[t]&&o[t][_7](o,r)}}}a(xCo,"_listenerProxyFunc");function wCo(){var t=Di("Microsoft");return t&&(_qe=t.ApplicationInsights),_qe}a(wCo,"_getExtensionNamespace");function vOt(t){var e=_qe;return!e&&t.disableDbgExt!==!0&&(e=_qe||wCo()),e?e.ChromeDbgExt:null}a(vOt,"getDebugExt");function UXr(t){if(!Eqe){Eqe={};for(var e=0;e<_Ot[In];e++)Eqe[_Ot[e]]=xCo(_Ot[e],t)}return Eqe}a(UXr,"getDebugListener");var Pae,qXr="warnToConsole",RCo="AI (Internal): ",kCo="AI: ",PCo="AITR_",DCo={loggingLevelConsole:0,loggingLevelTelemetry:1,maxMessageLimit:25,enableDebug:!1},NCo=(Pae={},Pae[0]=null,Pae[1]="errorToConsole",Pae[2]=qXr,Pae[3]="debugToConsole",Pae);function QXr(t){return t?'"'+t[sP](/\"/g,Ss)+'"':Ss}a(QXr,"_sanitizeDiagnosticText");function COt(t,e){var r=cqe();if(r){var n="log";r[t]&&(n=t),Or(r[n])&&r[n](e)}}a(COt,"_logToConsole");var Dae=(function(){function t(e,r,n,o){n===void 0&&(n=!1);var s=this;s[gae]=e,s[wM]=(n?kCo:RCo)+e;var c=Ss;w1e()&&(c=lqe().stringify(o));var l=(r?" message:"+QXr(r):Ss)+(o?" props:"+QXr(c):Ss);s[wM]+=l}return a(t,"_InternalLogMessage"),t.dataType="MessageData",t})();function Nae(t,e){return(t||{})[zu]||new $z(e)}a(Nae,"safeGetLogger");var $z=(function(){function t(e){this.identifier="DiagnosticLogger",this.queue=[];var r=0,n={},o,s,c,l,u;Si(t,this,function(d){u=h(e||{}),d.consoleLoggingLevel=function(){return o},d[YB]=function(A,y,E,_,v){v===void 0&&(v=!1);var b=new Dae(y,E,v,_);if(l)throw dr(b);var T=NCo[A]||qXr;if(Nn(b[wM]))g("throw"+(A===1?"Critical":"Warning"),b);else{if(v){var w=+b[gae];!n[w]&&o>=A&&(d[T](b[wM]),n[w]=!0)}else o>=A&&d[T](b[wM]);f(A,b)}},d.debugToConsole=function(A){COt("debug",A),g("warning",A)},d[pae]=function(A){COt("warn",A),g("warning",A)},d.errorToConsole=function(A){COt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[Ex]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=PCo+y[gae];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[ro](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new Dae(23,v,!1);d.queue[ro](b),A===1?d.errorToConsole(v):d[pae](v)}}}a(f,"_logInternalMessage");function h(A){return lS(jp(A,DCo,d).cfg,function(y){var E=y.cfg;o=E[KQe],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=vOt(e||{});E&&E[_C]&&E[_C](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function jXr(t){return t||new $z}a(jXr,"_getLogger");function wa(t,e,r,n,o,s){s===void 0&&(s=!1),jXr(t)[YB](e,r,n,o,s)}a(wa,"_throwInternal");function NM(t,e){jXr(t)[pae](e)}a(NM,"_warnToConsole");var bOt,k7,HXr="toGMTString",GXr="toUTCString",IOt="cookie",SOt="expires",$Xr="isCookieUseDisabled",F1e="disableCookiesUsage",VXr="_ckMgr",vqe=null,TOt=null,WXr=null,MM,zXr={},YXr={},MCo=(bOt={cookieCfg:FXr((k7={},k7[nqe]={fb:"cookieDomain",dfVal:I7},k7.path={fb:"cookiePath",dfVal:I7},k7.enabled=cS,k7.ignoreCookies=cS,k7.blockedCookies=cS,k7.disableCookieDefer=!1,k7)),cookieDomain:cS,cookiePath:cS},bOt[F1e]=cS,bOt);function xOt(){!MM&&(MM=w7e(function(){return df()}))}a(xOt,"_getDoc");function Cqe(t){return t?t.isEnabled():!0}a(Cqe,"_isMgrEnabled");function ten(t,e){return e&&t&&ur(t.ignoreCookies)?Wo(t.ignoreCookies,e)!==-1:!1}a(ten,"_isIgnoredCookie");function KXr(t,e){return e&&t&&ur(t.blockedCookies)&&Wo(t.blockedCookies,e)!==-1?!0:ten(t,e)}a(KXr,"_isBlockedCookie");function JXr(t,e){var r=e[C7];if(Xt(r)){var n=void 0;Nn(t[$Xr])||(n=!t[$Xr]),Nn(t[F1e])||(n=!t[F1e]),r=n}return r}a(JXr,"_isCfgEnabled");function wOt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[iqe]=E||"/",_[SOt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return Hz()||(v["max-age"]="0"),XXr(Ss,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Ni(E||Ss),R=lu(w,";");if(R!==-1&&(w=Ni(lM(E,R)),T=ren(Vf(E,R+1))),t3(T,nqe,v||o,W1,Nn),!Xt(_)){var x=Hz();if(Nn(T[SOt])){var P=El(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),t3(T,SOt,ZXr(N,x?HXr:GXr)||ZXr(N,x?HXr:GXr)||Ss,W1)}}x||t3(T,"max-age",Ss+_,null,Nn)}var L=Tae();return L&&L.protocol==="https:"&&(t3(T,"secure",null,null,Nn),TOt===null&&(TOt=!nen((Vu()||{})[v1e])),TOt&&t3(T,"SameSite","None",null,Nn)),t3(T,iqe,b||n,null,Nn),XXr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[In]-1;_>=0;_--)f[_].n===E&&f[yx](_,1)}a(g,"_removePendingCookie");function A(){B1e(e)&&f&&(Ct(f,function(E){KXr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=jp(t||YXr,null,e).cfg,s=lS(t,function(E){E.setDf(E.cfg,MCo),r=E.ref(E.cfg,"cookieCfg"),n=r[iqe]||"/",o=r[nqe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=JXr(t,r)!==!1,l=r.getCookie||OCo,u=r.setCookie||een,d=r.delCookie||een,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=JXr(t,r)!==!1&&c&&B1e(e),_=YXr[VXr];return E&&_&&y!==_&&(E=Cqe(_)),E},"isEnabled"),setEnabled:a(function(E){r[C7]=E,Nn(t[F1e])||(t[F1e]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=KXr(r,E);if(!R){var x=m(_,v,b,T);Cqe(y)?(u(E,x),w=!0):f&&(g(E),f[ro]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=Ss,v=ten(r,E);if(!v){if(Cqe(y))_=l(E);else if(f)for(var b=f[In]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=lu(w,";");_=R!==-1?Ni(lM(w,R)):Ni(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return Cqe(y)?v=y.purge(E,_):f&&(g(E),f[ro]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return B1e(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[VXr]=y,y}a(wOt,"createCookieMgr");function B1e(t){if(vqe===null){vqe=!1,!MM&&xOt();try{var e=MM.v||{};vqe=e[IOt]!==void 0}catch(r){wa(t,2,68,"Cannot access document.cookie - "+bae(r),{exception:dr(r)})}}return vqe}a(B1e,"areCookiesSupported");function ren(t){var e={};if(t&&t[In]){var r=Ni(t)[ZB](";");Ct(r,function(n){if(n=Ni(n||Ss),n){var o=lu(n,"=");o===-1?e[n]=null:e[Ni(lM(n,o))]=Ni(Vf(n,o+1))}})}return e}a(ren,"_extractParts");function ZXr(t,e){return Or(t[e])?t[e]():null}a(ZXr,"_formatDate");function XXr(t,e){var r=t||Ss;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?Ss:"="+o)}),r}a(XXr,"_formatCookieValue");function OCo(t){var e=Ss;if(!MM&&xOt(),MM.v){var r=MM.v[IOt]||Ss;WXr!==r&&(zXr=ren(r),WXr=r),e=Ni(zXr[t]||Ss)}return e}a(OCo,"_getCookieValue");function een(t,e){!MM&&xOt(),MM.v&&(MM.v[IOt]=t+"="+e)}a(een,"_setCookieValue");function nen(t){return Ei(t)?!!(ig(t,"CPU iPhone OS 12")||ig(t,"iPad; CPU OS 12")||ig(t,"Macintosh; Intel Mac OS X 10_14")&&ig(t,"Version/")&&ig(t,"Safari")||ig(t,"Macintosh; Intel Mac OS X 10_14")&&PB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||ig(t,"Chrome/5")||ig(t,"Chrome/6")||ig(t,"UnrealEngine")&&!ig(t,"Chrome")||ig(t,"UCBrowser/12")||ig(t,"UCBrowser/11")):!1}a(nen,"uaDisallowsSameSiteNone");p();var LCo={perfEvtsSendAll:!1};function BCo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){$f(r.fn,[r.arg])})}a(BCo,"_runScheduledListeners");function P7(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[ro]({fn:n,arg:o}),r.h=r.h||Up(BCo,0,r)):$f(n,[o]))})}a(P7,"_runListeners");var ROt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=jp(e,LCo);n=c[SM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){ji(l,"listeners",{g:a(function(){return o},"g")}),l[mae]=function(u){o[ro](u)},l[hae]=function(u){for(var d=Wo(o,u);d>-1;)o[yx](d,1),d=Wo(o,u)},l[yae]=function(u){P7(o,yae,s,function(d){d[yae](u)})},l[T7]=function(u,d){P7(o,T7,s,function(f){f[T7](u,d)})},l[Eae]=function(u,d){P7(o,Eae,d?s:null,function(f){f[Eae](u,d)})},l[RM]=function(u){u&&(r||!u[C1e]())&&P7(o,RM,null,function(d){u.isAsync?Up(function(){return d[RM](u)},0):d[RM](u)})},l[eqe]=function(u){u&&u[In]&&P7(o,eqe,s,function(d){d[eqe](u)})},l[tqe]=function(u){u&&u[aS]&&P7(o,tqe,s,function(d){d[tqe](u)})},l[rqe]=function(u,d){if(u>0){var f=d||0;P7(o,rqe,s,function(h){h[rqe](u,f)})}},l[Ex]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[TM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(P7(o,"unload",null,function(h){var m=h[Ex](u);m&&(f||(f=[]),f[ro](m))}),f)return Dd(function(h){return _l(K7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Mae="ctx",POt="ParentContextKey",U1e="ChildrenContextKey",FCo=null,Oae=(function(){function t(e,r,n){var o=this;if(o.start=El(),o[oP]=e,o.isAsync=n,o[C1e]=function(){return!1},Or(r)){var s;ji(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[Fz]=function(c){return c?c===t[POt]||c===t[U1e]?o[c]:(o[Mae]||{})[c]:null},o[cP]=function(c,l){if(c)if(c===t[POt])o[c]||(o[C1e]=function(){return!0}),o[c]=l;else if(c===t[U1e])o[c]=l;else{var u=o[Mae]=o[Mae]||{};u[c]=l}},o.complete=function(){var c=0,l=o[Fz](t[U1e]);if(ur(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){wa(r[zu],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[e3];!_&&A&&(_={}),E[e3]=_,_=e.ref(E,e3),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Yr(A,function(E,_){if(Xt(y[E])){var v=e.cfg[E];(v||!Xt(v))&&(y[E]=v)}D1e(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 _&&(_[A]||!Xt(_[A]))?E=_[A]:(v[A]||!Xt(v[A]))&&(E=v[A]),E||!Xt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[v7]();y&&g(y)}}return a(m,"_iterateChain"),c}a(LOt,"_createInternalContext");function vx(t,e,r,n){var o=jp(e),s=LOt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[vC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=D7(d,o.cfg,r,f)),vx(d||c[sS](),o.cfg,r,f)}return a(u,"_createNew"),c[Zm]=l,c[xM]=u,c}a(vx,"createProcessTelemetryContext");function Lae(t,e,r){var n=jp(e.config),o=LOt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[Ex](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=D7(u,n.cfg,e,d)),Lae(u||s[sS](),e,d)}return a(l,"_createNew"),s[Zm]=c,s[xM]=l,s}a(Lae,"createProcessTelemetryUnloadContext");function Q1e(t,e,r){var n=jp(e.config),o=LOt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[Bz])&&d[Bz](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=D7(u,n.cfg,e,d)),Q1e(u||s[sS](),e,d)}return a(l,"_createNew"),s[Zm]=c,s[xM]=l,s}a(Q1e,"createProcessTelemetryUpdateContext");function D7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[In]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[vC])){var u=GCo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?D7([n],e,r):o}a(D7,"createTelemetryProxyChain");function GCo(t,e,r){var n=null,o=Or(t[vC]),s=Or(t[S7]),c;t?c=t[IM]+"-"+t[jz]+"-"+cen++:c="Unknown-0-"+cen++;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&&Or(t[aen])&&(g=t[aen]()),g||(g=vx(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[IM]:jCo,T=g[sen];return T||(T=g[sen]={}),g.setNext(n),t&&Hp(g[zf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:Ss;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&wa(g[_C](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=r3(t);return _[oS]||_[S1e]?!1:(s&&t[S7](n),t[vC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[Zm](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=r3(t),v=t[zf]||_[zf];t&&(!v||v===g.core())&&!_[oS]&&(_[zf]=null,_[oS]=!0,_[EC]=!1,t[oS]&&t[oS](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[Zm](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=r3(t),v=t[zf]||_[zf];t&&(!v||v===g.core())&&!_[oS]&&t[Bz]&&t[Bz](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[Zm](A)}return a(m,"_updatePlugin"),Nh(l)}a(GCo,"createTelemetryPluginProxy");var len=(function(){function t(e,r,n,o){var s=this,c=vx(e,r,n,o);w7(s,c,$u(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function q1e(){var t=[];function e(n){n&&t[ro](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){wa(n[_C](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(q1e,"createUnloadHandlerContainer");p();var Tqe,Iqe;function xqe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){wa(n,2,73,"Unloading:"+dr(c))}}),Tqe&&o[In]>Tqe&&(Iqe?Iqe("doUnload",o):wa(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Mh(t,n),Tqe&&t[In]>Tqe&&(Iqe?Iqe("Add",t):wa(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(xqe,"createUnloadHookContainer");var BOt,N7="getPlugin",$Co=(BOt={},BOt[e3]={isVal:I7,v:{}},BOt),Bae=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[KB]=function(h,m,g,A){u(h,m,A),r=!0},f[oS]=function(h,m){var g=f[zf];if(!g||h&&g!==h[zf]())return;var A,y=!1,E=h||Lae(null,g,o&&o[N7]?o[N7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[_C]()),A===!0&&E[Zm](_),d())}return a(v,"_unloadCallback"),!f[b7]||f[b7](E,_,v)!==!0?v():A=!0,A},f[Bz]=function(h,m){var g=f[zf];if(!g||h&&g!==h[zf]())return;var A,y=!1,E=h||Q1e(null,g,o&&o[N7]?o[N7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[sS]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},x7(f,"_addUnloadCb",function(){return s},"add"),x7(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[_C]=function(f){return l(f)[_C]()},e[EC]=function(){return r},e.setInitialized=function(f){r=f},e[S7]=function(f){o=f},e[Zm]=function(f,h){h?h[Zm](f):o&&Or(o[vC])&&o[vC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||vx(null,{},e[zf]);o&&o[N7]?h=m[xM](null,o[N7]):h=m[xM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){jp(f,$Co,Nae(h)),!m&&h&&(m=h[zQe]()[sS]());var g=o;o&&o[N7]&&(g=o[N7]()),e[zf]=h,n=vx(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[zf]=null,n=null,o=null,c=xqe(),s=q1e()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function VCo(t,e,r){var n={id:e,fn:r};Mh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[yx](c,1),-1})},"remove")};return o}a(VCo,"_addInitializer");function WCo(t,e,r){for(var n=!1,o=t[In],s=0;s"},"v")})}a(nbo,"_createUnloadHook");var wqe=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[EC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[KB]=function(ne,ce,Ne,we){g&&Zc(den),U[EC]()&&Zc("Core cannot be initialized more than once"),e=jp(ne,FOt,Ne||U[zu],!1),ne=e.cfg,qe(e[SM](function(st){var _t=st.cfg;B=_t.initInMemoMaxSize||KCo,Y(_t);var Dt=st.ref(st.cfg,e3);Yr(Dt,function($t){st.ref(Dt,$t)})})),s=we,b=rbo(e,v,s&&U[E1e](),b),K(),U[zu]=Ne;var Be=ne[qz];if(f=[],f[ro].apply(f,nz(nz([],ce,!1),Be,!1)),h=ne[Qz],Le(null),(!m||m[In]===0)&&Zc("No "+Qz+" available"),h&&h[In]>1){var rt=U[v7]("TeeChannelController");(!rt||!rt.plugin)&&wa(n,1,28,"TeeChannel required")}tbo(ne,R,n),R=null,r=!0,N===E7.ACTIVE&&z()},U.getChannels=function(){var ne=[];return m&&Ct(m,function(ce){ne[ro](ce)}),Nh(ne)},U.track=function(ne){Hp(U[_ae](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ue(ne),Zc("Invalid telemetry item")),!ne[oP]&&Xt(ne[oP])&&(ue(ne),Zc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||Cae(new Date),ne.ver=ne.ver||"4.0",!g&&U[EC]()&&N===E7.ACTIVE?le()[Zm](ne):N!==E7.INACTIVE&&o[In]<=B&&o[ro](ne)},function(){return{item:ne}},!ne.sync)},U[zQe]=le,U[E1e]=function(){return s||(s=new ROt(e.cfg),U[zCo]=s),s},U[mae]=function(ne){U.getNotifyMgr()[mae](ne)},U[hae]=function(ne){s&&s[hae](ne)},U.getCookieMgr=function(){return u||(u=wOt(e.cfg,U[zu])),u},U.setCookieMgr=function(ne){u!==ne&&(kae(u,!1),u=ne)},U[_ae]=function(){return c||l||DOt()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[In]},U.releaseQueue=function(){if(r&&o[In]>0){var ne=o;o=[],N===2?Ct(ne,function(ce){ce.iKey=ce.iKey||w,le()[Zm](ce)}):wa(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,Q=!1,O&&O[TM](),ie(!0)};function Y(ne){var ce=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ce)){w=null,N=E7.INACTIVE;var we="Please provide instrumentation key";r?(wa(n,1,100,we),z()):Zc(we);return}var Be=[];tg(ce)?(Be[ro](ce),w=null):w=ce,tg(Ne)?(Be[ro](Ne),L=null):L=Ne,Be[In]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ce){q=!1,N=3;var Ne=I7(ne.initTimeOut)?ne.initTimeOut:JCo,we=Y7e(ce);M&&M[TM](),M=Up(function(){M=null,q||V()},Ne),_l(we,function(Be){try{if(q)return;if(!Be.rejected){var rt=Be[JB];if(rt&&rt[In]){var st=rt[0];if(w=st&&st[JB],rt[In]>1){var _t=rt[1];L=_t&&_t[JB]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=E7.INACTIVE,wa(n,1,112,"ikey can't be resolved from promises")):N=E7.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[C7])&&!Q){var ce=ne||n&&n.queue[In]>0;ce&&(j||(j=!0,qe(e[SM](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[C7],O[TM]()),O=D7e(X,we),O.unref(),O[C7]=Be}))),O[C7]=!0)}return O}a(ie,"_startLogPoller"),U[rOt]=function(){Q=!0,O&&O[TM](),X()},w7(U,function(){return A},["addTelemetryInitializer"]),U[Ex]=function(ne,ce,Ne){ne===void 0&&(ne=!0),r||Zc(YCo),g&&Zc(den);var we={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ce&&(Be=Dd(function(_t){ce=_t}));var rt=Lae(Ue(),U);rt[_1e](function(){v.run(U[zu]),yOt([u,s,n],ne,function(){re(),ce&&ce(we)})},U);function st(_t){we.flushComplete=_t,g=!0,_.run(rt,we),U[rOt](),rt[Zm](we)}return a(st,"_doUnload"),X(),ee(ne,st,6,Ne)||st(!1),Be},U[v7]=ge,U.addPlugin=function(ne,ce,Ne,we){if(!ne){we&&we(!1),Z(hen);return}var Be=ge(ne[IM]);if(Be&&!ce){we&&we(!1),Z("Plugin ["+ne[IM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[ro](ne),rt.added=[ne],Le(rt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var _t=[Be.plugin],Dt={reason:2,isAsync:!!Ne};ke(_t,Dt,function($t){$t?(rt.removed=_t,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ne,ce){ce===void 0&&(ce=!0);var Ne;if(U[EC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Rse({},e.cfg),newConfig:Rse({},ne),merge:ce},ne=Ne.newConfig;var we=e.cfg;ne[qz]=we[qz],ne[Qz]=we[Qz]}e._block(function(Be){var rt=Be.cfg;UOt(Be,rt,ne,ce),ce||Yr(rt,function(st){yA(ne,st)||Be.set(rt,st,cS)}),Be.setDf(rt,FOt)},!0),e.notify(),Ne&&he(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ne){return T||(T=oen()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=qe,x7(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var ce;return r?ce=lS(e.cfg,ne,U[zu]):ce=ebo(R,ne),nbo(ce)},U.getWParam=function(){return RB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ce=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[IM]&&we[YQe]&&!ne[we.identifier]){var Be=we[IM]+"="+we[YQe];P[ro](Be),ne[we.identifier]=we}})},"_addPluginVersions");ce(m),h&&Ct(h,function(Ne){ce(Ne)}),ce(f)}a(H,"_setPluginVersions");function re(){r=!1,e=jp({},FOt,U[zu]),e.cfg[KQe]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ce){U.updateCfg(ce,!1)},"s")}),ji(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),ji(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||Ss},"g")}),ji(U,"logger",{g:a(function(){return n||(n=new $z(e.cfg),e[zu]=n),n},"g"),s:a(function(ce){e[zu]=ce,n!==ce&&(kae(n,!1),n=ce)},"s")}),U[zu]=new $z(e.cfg),x=[];var ne=U.config[qz]||[];ne.splice(0,ne[In]),Mh(ne,x),A=new uen,o=[],kae(s,!1),s=null,c=null,l=null,kae(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=_x("AIBaseCore",!0),_=q1e(),T=null,w=null,v=xqe(),R=[],D=null,P=null,Q=!1,O=null,j=!1,N=0,L=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=vx(Ue(),e.cfg,U);return ne[_1e](ie),ne}a(le,"_createTelCtx");function Le(ne){var ce=XCo(U[zu],BXr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=Sqe(Mh(m,ce[Qz]));var Ne=Mh(Sqe(ce[zf]),m);x=Nh(Ne);var we=U.config[qz]||[];we.splice(0,we[In]),Mh(we,x);var Be=le();m&&m[In]>0&&OOt(Be[xM](m),Ne),OOt(Be,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ce=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[IM]===ne&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[ro](Be)}),!Ne&&we[In]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ne),!Ne)return-1}),Ne&&(ce={plugin:Ne,setEnabled:a(function(Be){r3(Ne)[S1e]=!Be},"setEnabled"),isEnabled:a(function(){var Be=r3(Ne);return!Be[oS]&&!Be[S1e]},"isEnabled"),remove:a(function(Be,rt){Be===void 0&&(Be=!0);var st=[Ne],_t={reason:1,isAsync:Be};ke(st,_t,function(Dt){Dt&&Le({reason:32,removed:st}),rt&&rt(Dt)})},"remove")}),ce}a(ge,"_getPlugin");function Ue(){if(!d){var ne=(x||[]).slice();Wo(ne,A)===-1&&ne[ro](A),d=D7(Sqe(ne),e.cfg,U)}return d}a(Ue,"_getPluginChain");function ke(ne,ce,Ne){if(ne&&ne[In]>0){var we=D7(ne,e.cfg,U),Be=Lae(we,U);Be[_1e](function(){var rt=!1,st=[];Ct(f,function(Dt,$t){fen(Dt,ne)?rt=!0:st[ro](Dt)}),f=st,D=null,P=null;var _t=[];h&&(Ct(h,function(Dt,$t){var Gt=[];Ct(Dt,function(Ie){fen(Ie,ne)?rt=!0:Gt[ro](Ie)}),_t[ro](Gt)}),h=_t),Ne&&Ne(rt),ie()}),Be[Zm](ce)}else Ne(!1)}a(ke,"_removePlugins");function X(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[In]=0,Ct(ne,function(ce){var Ne={name:y||"InternalMessageId: "+ce[gae],iKey:w,time:Cae(new Date),baseType:Dae.dataType,baseData:{message:ce[wM]}};U.track(Ne)})}}a(X,"_flushInternalLogs");function ee(ne,ce,Ne,we){var Be=1,rt=!1,st=null;we=we||5e3;function _t(){Be--,rt&&Be===0&&(st&&st[TM](),st=null,ce&&ce(rt),ce=null)}if(a(_t,"doCallback"),m&&m[In]>0){var Dt=le()[xM](m);Dt.iterate(function($t){if($t.flush){Be++;var Gt=!1;$t.flush(ne,function(){Gt=!0,_t()},Ne)||Gt||(ne&&st==null?st=Up(function(){st=null,_t()},we):_t())}})}return rt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[SM](function(ce){var Ne=ce.cfg.enablePerfMgr;if(Ne){var we=ce.cfg[XQe];(ne!==we||!ne)&&(we||(we=ZCo),oqe(ce.cfg,XQe,we),ne=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[E1e]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ce=Q1e(Ue(),U);ce[_1e](ie),(!U._updateHook||U._updateHook(ce,ne)!==!0)&&ce[Zm](ne)}a(he,"_doUpdate");function Z(ne){var ce=U[zu];ce?(wa(ce,2,73,ne),ie()):Zc(ne)}a(Z,"_logOrThrowError");function ue(ne){var ce=U[E1e]();ce&&ce[T7]([ne],2)}a(ue,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var lP="",ibo="NoResponseBody",men="&"+ibo+"=true",QOt="POST",Rqe=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;q(),E[KB]=function(M,O){o=O,n&&wa(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.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 O=Tae();O&&O.protocol&&O.protocol[Lz]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[In]?R(M,O):null},E.getFallbackInst=function(){return d},E[b7]=function(M,O){q()},E.preparePayload=function(M,O,j,Q){if(!O||Q||!j[aS]){M(j);return}try{var U=Di("CompressionStream");if(!Or(U)){M(j);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(Ei(j[aS])?new TextEncoder().encode(j[aS]):j[aS]),re.close()},"start")}),W=Y.pipeThrough(new U("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return _l(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[JB];if(!Le.done)return z[ro](Le[JB]),ie+=Le.value[In],_l(V.read(),re);for(var ge=new Uint8Array(ie),Ue=0,ke=0,X=z;ke0&&(Ct($u(ge),function(K){H.append(K,ge[K])}),Ue[b1e]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),j&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(U+=men)):le=!0);var ke=new Request(U,Ue);try{ke[EOt]=!0}catch{}if(!j&&r&&(V=Dd(function(K,he){z=K,ie=he})),!U){w(O),z&&z(!1);return}function X(K,he){he?x(O,s?0:he,{},s?lP:K):x(O,s?0:400,{},s?lP:K)}a(X,"_handleError");function ee(K,he,Z){var ue=K[aP],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,Z||lP,he):x(O,ue,{},Z||lP)}a(ee,"_onFetchComplete");try{_l(fetch(s?U:ke,s?Ue:null),function(K){if(j&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)X(K.reason&&K.reason[wM],499),ie&&ie(K.reason);else{var he=K[JB];try{!s&&!he.ok?(he[aP]?X(he.statusText,he[aP]):X(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,lP),z&&z(!0)):_l(he.text(),function(Z){ee(he,M,Z[JB]),z&&z(!0)})}catch(Z){he&&he[aP]?X(dr(Z),he[aP]):X(dr(Z),499),ie&&ie(Z)}}})}catch(K){Le||(X(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[Uz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[Uz]),V}a(L,"_doFetchSender");function B(M,O,j){var Q=ff(),U=new XDomainRequest,Y=M[aS];U.onload=function(){var H=PM(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?lP:aqe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",V=M[Aae];if(!V){w(O);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.";wa(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[sP](/^(https?:)/,"");U.open(QOt,ie),M[Uz]&&(U[Uz]=M[Uz]),U.send(Y),s&&j?y&&y.set(function(){U.send(Y)},0):U.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 Cen="on",gen="attachEvent",Aen="addEventListener",yen="detachEvent",Een="removeEventListener",qOt="events",G1e="visibilitychange",Pqe="pagehide",ben="pageshow",Sen="unload",Ten="beforeunload",Ien=_x("aiEvtPageHide"),xen=_x("aiEvtPageShow"),obo=/\.[\.]+/g,sbo=/[\.]+$/,abo=1,kqe=pqe("events"),cbo=/^([^.]*)(?:\.(.+)|)/;function _en(t){return t&&t[sP]?t[sP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Ss):t}a(_en,"_normalizeNamespace");function jOt(t,e){if(e){var r=Ss;ur(e)?(r=Ss,Ct(e,function(o){o=_en(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=_en(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Ss)+r)}var n=cbo.exec(t||Ss)||[];return{type:n[1],ns:(n[2]||Ss).replace(obo,".").replace(sbo,Ss)[ZB](".").sort().join(".")}}a(jOt,"_getEvtNamespace");function wen(t,e,r){r===void 0&&(r=!0);var n=kqe.get(t,qOt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(wen,"_getRegisteredEvents");function Ren(t,e,r,n){t&&e&&e[XB]&&(t[Een]?t[Een](e[XB],r,n):t[yen]&&t[yen](Cen+e[XB],r))}a(Ren,"_doDetach");function lbo(t,e,r,n){var o=!1;return t&&e&&e[XB]&&r&&(t[Aen]?(t[Aen](e[XB],r,n),o=!0):t[gen]&&(t[gen](Cen+e[XB],r),o=!0)),o}a(lbo,"_doAttach");function ven(t,e,r,n){for(var o=e[In];o--;){var s=e[o];s&&(!r.ns||r.ns===s[iOt].ns)&&(!n||n(s))&&(Ren(t,s[iOt],s.handler,s.capture),e[yx](o,1))}}a(ven,"_doUnregister");function ubo(t,e,r){if(e[XB])ven(t,wen(t,e[XB]),e,r);else{var n=kqe.get(t,qOt,{});Yr(n,function(o,s){ven(t,s,e,r)}),$u(n)[In]===0&&kqe.kill(t,qOt)}}a(ubo,"_unregisterEvents");function O7(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=jOt("xx",r).ns[ZB](".")):r=t,r}a(O7,"mergeEvtNamespace");function j1e(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=jOt(e,n);if(s=lbo(t,c,r,o),s&&kqe.accept(t)){var l={guid:abo++,evtName:c,handler:r,capture:o};wen(t,c.type)[ro](l)}}catch{}return s}a(j1e,"eventOn");function H1e(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=jOt(e,n),c=!1;ubo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||Ren(t,s,r,o)}catch{}}a(H1e,"eventOff");function HOt(t,e,r){var n=!1,o=ff();o&&(n=j1e(o,t,e,r),n=j1e(o.body,t,e,r)||n);var s=df();return s&&(n=j1e(s,t,e,r)||n),n}a(HOt,"addEventHandler");function GOt(t,e,r){var n=ff();n&&(H1e(n,t,e,r),H1e(n.body,t,e,r));var o=df();o&&H1e(o,t,e,r)}a(GOt,"removeEventHandler");function Fae(t,e,r,n){var o=!1;return e&&t&&t[In]>0&&Ct(t,function(s){s&&(!r||Wo(r,s)===-1)&&(o=HOt(s,e,n)||o)}),o}a(Fae,"_addEventListeners");function $Ot(t,e,r,n){var o=!1;return e&&t&&ur(t)&&(o=Fae(t,e,r,n),!o&&r&&r[In]>0&&(o=Fae(t,e,null,n))),o}a($Ot,"addEventListeners");function Vz(t,e,r){t&&ur(t)&&Ct(t,function(n){n&&GOt(n,e,r)})}a(Vz,"removeEventListeners");function Dqe(t,e,r){return $Ot([Ten,Sen,Pqe],t,e,r)}a(Dqe,"addPageUnloadEventListener");function Nqe(t,e){Vz([Ten,Sen,Pqe],t,e)}a(Nqe,"removePageUnloadEventListener");function $1e(t,e,r){function n(c){var l=df();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=O7(Ien,r),s=Fae([Pqe],t,e,o);return(!e||Wo(e,G1e)===-1)&&(s=Fae([G1e],n,e,o)||s),!s&&e&&(s=$1e(t,null,r)),s}a($1e,"addPageHideEventListener");function Mqe(t,e){var r=O7(Ien,e);Vz([Pqe],t,r),Vz([G1e],null,r)}a(Mqe,"removePageHideEventListener");function V1e(t,e,r){function n(c){var l=df();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=O7(xen,r),s=Fae([ben],t,e,o);return s=Fae([G1e],n,e,o)||s,!s&&e&&(s=V1e(t,null,r)),s}a(V1e,"addPageShowEventListener");function Oqe(t,e){var r=O7(xen,e);Vz([ben],t,r),Vz([G1e],null,r)}a(Oqe,"removePageShowEventListener");p();var Uae="",ken="https://browser.events.data.microsoft.com/OneCollector/1.0/",VOt="version",Lqe="properties";p();p();var WOt="initialize",zOt="indexOf",OM="timings",YOt="pollInternalLogs",uS="value",Bqe="length",Fqe="processTelemetryStart";var n3,Pen="4.3.10",W1e="1DS-Web-JS-"+Pen,Den=wbe.hasOwnProperty;var _bo=(n3={},n3[0]=0,n3[2]=6,n3[1]=1,n3[3]=7,n3[4098]=6,n3[4097]=1,n3[4099]=7,n3);var vbo=RB(),Cbo=wse();function Cx(t){return!(t===Uae||Xt(t))}a(Cx,"isValueAssigned");function KOt(t){if(t){var e=lu(t,"-");if(e>-1)return lM(t,e)}return Uae}a(KOt,"getTenantId");function JOt(t){return!!(t&&Dh(t)&&t>=1&&t<=4)}a(JOt,"isLatency");function ZOt(t,e,r){if(!e&&!Cx(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||ur(e))e={value:e};else if(n==="object"&&!Den.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Xt(e[uS])||e[uS]===Uae||!Ei(e[uS])&&!Dh(e[uS])&&!zk(e[uS])&&!ur(e[uS]))return null;if(ur(e[uS])&&!Men(e[uS]))return null;if(!Xt(e.kind)){if(ur(e[uS])||!Nen(e.kind))return null;e[uS]=e[uS].toString()}return e}a(ZOt,"sanitizeProperty");function z1e(t,e,r){var n=-1;if(!Nn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),bbo(r))n===-1&&(n=0),n|=r;else{var o=_bo[Uqe(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(z1e,"getCommonSchemaMetaData");function Qae(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[Bqe],d=arguments;for(zk(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(Nen,"isValueKind");function bbo(t){return t>=0&&t<=9}a(bbo,"isDataType");function Men(t){return t[Bqe]>0}a(Men,"isArrayValid");function Qqe(t,e){var r=t;r[OM]=r[OM]||{},r[OM][Fqe]=r[OM][Fqe]||{},r[OM][Fqe][e]=dS()}a(Qqe,"setProcessTelemetryTimings");function Uqe(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===dx&&(e=4,ur(t)?(e=4096,t[Bqe]>0&&(e|=Uqe(t[0]))):Den.call(t,"value")&&(e=8192|Uqe(t[uS])))}return e}a(Uqe,"getFieldValueType");function XOt(){return!!Di("chrome")}a(XOt,"isChromium");function Wz(t){return t>0}a(Wz,"isGreaterThanZero");var Sbo=T_({endpointUrl:ken,propertyStorageOverride:{isVal:Tbo}});function Tbo(t){return t&&(!t.getProperty||!t.setProperty)&&Zc("Invalid property storage override passed."),!0}a(Tbo,"_chkPropOverride");var e5t=(function(t){Wy(e,t);function e(){var r=t.call(this)||this;return Si(e,r,function(n,o){n[WOt]=function(s,c,l,u){Hp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[WOt](jp(s,Sbo,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=dr(h);f[zOt]("channels")!==-1&&(f+=` + - Channels must be provided through config.channels only!`),wa(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){Hp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[OM]=c[OM]||{},c[OM].trackStart=dS(),JOt(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=W1e;var u=c.baseData=c.baseData||{};u[Lqe]=u[Lqe]||{};var d=u[Lqe];d[VOt]=d[VOt]||n.pluginVersionString||Uae}o.track(c)},function(){return{item:s}},!s.sync)},n[YOt]=function(s){return o[YOt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(wqe);p();p();var Y1e="REAL_TIME",Oen="NEAR_REAL_TIME",Len="BEST_EFFORT";p();p();p();var uP="";var qqe="drop",Ben="send",t5t="requeue",Fen="rspFail",Uen="oth",r5t="no-cache, no-store",jqe="application/x-json-stream",K1e="cache-control",qae="content-type",Qen="kill-tokens",qen="kill-duration";var jen="time-delta-millis",Hqe="client-version",n5t="client-id",Gqe="time-delta-to-apply-millis",$qe="upload-time",Vqe="apikey",J1e="AuthMsaDeviceTicket",i5t="WebAuthToken",o5t="AuthXToken";var Hen="NoResponseBody",jae="msfpc",s5t="trace",Wqe="user";p();var Z1e="allowRequestSending",zqe="shouldAddClockSkewHeaders",Yqe="getClockSkewHeaderValue",X1e="setClockSkew",zo="length",LM="concat",fS="iKey",Yf="count",BM="events",Xm="push",FM="split",Kqe="toLowerCase",zz="hdrs",Jqe="useHdrs",Yz="initialize",Zqe="setTimeoutOverride",Xqe="clearTimeoutOverride",Gen="payloadPreprocessor",a5t="overrideEndpointUrl",c5t="avoidOptions",$en="disableEventTimings",eje="enableCompoundKey",l5t="disableXhrSync",u5t="disableFetchKeepAlive",Ven="addNoResponse",d5t="useSendBeacon",f5t="fetchCredentials",p5t="alwaysUseXhrOverride",tje="serializeOfflineEvt",rje="getOfflineRequestDetails",nje="createPayload",eSe="createOneDSPayload",h5t="payloadBlob",dP="headers",Hae="_thePayload",Jy="batches",CC="sendType",tSe="canSendRequest",Gae="sendQueuedRequests",rSe="setUnloading",Wen="isTenantKilled",ije="sendSynchronousBatch",oje="_transport",$ae="getWParam",m5t="isBeacon",nSe="timings",sje="isTeardown",aje="_sendReason",cje="setKillSwitchTenants",lje="_backOffTransmission",iSe="identifier",zen="ignoreMc1Ms0CookieProcessing",g5t="autoFlushEventsLimit",Yen="disableAutoBatchFlushLimit",Ken="overrideInstrumentationKey",oSe="sendAttempt",L7="latency",Kz="sync";function Zen(t){var e=(t.ext||{}).intweb;return e&&Cx(e[jae])?e[jae]:null}a(Zen,"_getEventMsfpc");function Jen(t){for(var e=null,r=0;e===null&&rEl()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var xbo=.8,wbo=1.2,ttn=3e3,Rbo=6e5;function rtn(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(rtn,"retryPolicyShouldRetryForStatus");function uje(t){var e=0,r=ttn*xbo,n=ttn*wbo,o=Y1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,qU(e,Rbo)}a(uje,"retryPolicyGetMillisToBackoffForRetry");p();var kbo=20,Pbo=3145728,itn=65e3,otn=2e6,Dbo=qU(otn,itn),ntn="metadata",dje="f",Nbo=/\./,stn=(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,E=s||z1e,_=Mbo(l),v=fje(_.requestLimit,Pbo,0),b=fje(_.requestLimit,itn,1),T=fje(_.recordLimit,otn,0),w=Math.min(fje(_.recordLimit,Dbo,1),b);Si(t,this,function(R){R.createPayload=function(D,N,L,B,q,M){return{apiKeys:[],payloadBlob:uP,overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:D,isTeardown:N,isSync:L,isBeacon:B,sendType:M,sendReason:q}},R.appendPayload=function(D,N,L){var B=D&&N&&!D.overflow;return B&&Hp(e,function(){return"Serializer:appendPayload"},function(){for(var q=N.events(),M=D.payloadBlob,O=D.numEvents,j=!1,Q=[],U=[],Y=D.isBeacon,W=Y?b:v,V=Y?w:T,z=0,ie=0;z=L){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>kbo&&(x7e(M,0,1),ie=0),j=!0,O++}else re?Q.push(H):U.push(H),q.splice(z,1),z--}z++}if(Q.length>0&&D.sizeExceed.push(B7.create(N.iKey(),Q)),U.length>0&&D.failedEvts.push(B7.create(N.iKey(),U)),j){D.batches.push(N),D.payloadBlob=M,D.numEvents=O;var ge=N.iKey();Wo(D.apiKeys,ge)===-1&&D.apiKeys.push(ge)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:L}}),B},R.getEventBlob=function(D){try{return Hp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+KOt(D.iKey);var L={},B;y||(B=a(function(j,Q,U){Obo(E,L,j,Q,U)},"_addMetadataCallback"));var q=D[f];q&&(N[f]=L,Yr(q,function(j,Q){var U=L[j]={};P(Q,U,"ext."+j,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var O=M[d]={};return P(D.baseData,O,d,!1,[d],B,m),P(D.data,M,u,!1,[],B,m),JSON.stringify(N)},function(){return{item:D}})}catch{return null}};function x(D,N){var L=A[D];return L===void 0&&(D.length>=7&&(L=kse(D,"ext.metadata")||kse(D,"ext.web")),A[D]=L),L}a(x,"_isReservedField");function P(D,N,L,B,q,M,O){Yr(D,function(j,Q){var U=null;if(Q||Cx(Q)){var Y=L,W=j,V=q,z=N;if(h&&!B&&Nbo.test(j)){var ie=j.split("."),H=ie.length;if(H>1){V&&(V=V.slice());for(var re=0;re0&&n<=e)return n}return e}a(fje,"_validateSizeLimit");function Mbo(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a(Mbo,"_getSizeLimtCfg");function Obo(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[ntn];c||(c=e[ntn]={f:{}});var l=c[dje];if(l||(l=c[dje]={}),r)for(var u=0;u0)for(var o=e[Kqe](),s=0;s0&&(n&&y5t[e]?(t[zz][y5t[e]]=r,t[Jqe]=!0):t.url+="&"+e+"="+r)}a(Wae,"_addRequestDetails");function Ubo(t,e,r){for(var n=0;n=0&&Q.splice(Se,1)},"rm")}},H[tje]=function(pe){try{if(b)return b.getEventBlob(pe)}catch{}return uP},H[rje]=function(){try{var pe=b&&b[nje](0,!1,!1,!1,1,0);return we(pe,x)}catch{}return null},H[eSe]=function(pe,Se){try{var Fe=[];Ct(pe,function(se){Se&&(se=kM(se));var me=B7.create(se[fS],[se]);Fe[Xm](me)});for(var te=null;Fe[zo]>0&&b;){var Te=Fe.shift();Te&&Te[Yf]()>0&&(te=te||b[nje](0,!1,!1,!1,1,0),b.appendPayload(te,Te,ie))}var Ge=we(te,x),J={data:te[h5t],urlString:Ge.url,headers:Ge[zz],timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};return x&&(pje(J[dP],K1e)||(J[dP][K1e]=r5t),pje(J[dP],qae)||(J[dP][qae]=jqe)),J}catch{}return null};function le(pe,Se){try{return V&&V.getSenderInst(pe,Se)}catch{}return null}a(le,"_getSenderInterface"),H._getDbgPlgTargets=function(){return[g[0],c,b,g,Le(),s,ie]};function Le(){try{var pe={xdrOnComplete:ge,fetchOnComplete:ke,xhrOnComplete:X,beaconOnRetry:K},Se={enableSendPromise:!1,isOneDs:!0,disableCredentials:!re,fetchCredentials:z,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:L,timeWrapper:Y,addNoResponse:q,senderOnCompleteCallBack:pe};return Se}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(pe,Se,Fe){var te=PM(pe);ee(Se,200,{},te),F(te)}a(ge,"_xdrOncomplete");function Ue(){var pe;s=null,c=new etn,l=!1,u=new Xen,d=!1,f=0,h=null,m=null,g=null,A=null,y=!0,E=[],_={},v=[],b=null,T=!1,w=null,R=!1,x=!1,P=pe,N=pe,L=pe,B=pe,q=pe,M=[],O=pe,j=pe,Q=[],U=!1,Y=Vae(),W=!1,V=null,ie=null}a(Ue,"_initDefaults");function ke(pe,Se,Fe,te){var Te=a(function(se,me,Ce){ee(Se,se,me,Ce),F(Ce)},"handleResponse"),Ge={},J=pe[dP];J&&J.forEach(function(se,me){Ge[me]=se}),Te(pe.status,Ge,Fe||uP)}a(ke,"_fetchOnComplete");function X(pe,Se,Fe){var te=PM(pe);ee(Se,pe.status,R7(pe,!0),te),F(te)}a(X,"_xhrOnComplete");function ee(pe,Se,Fe,te){try{pe(Se,Fe,te)}catch(Te){wa(m,2,518,dr(Te))}}a(ee,"_doOnComplete");function K(pe,Se,Fe){var te=pe,Te=200,Ge=te[Hae],J=pe.urlString+(q?Lbo:uP);try{var se=Vu();if(Ge){var me=!!A.getPlugin("LocalStorage"),Ce=[],He=[];Ct(Ge[Jy],function($e){if(Ce&&$e&&$e[Yf]()>0)for(var et=$e[BM](),ct=0;ct0&&(Ge.sentEvts=He),me||be(Ce,8003,Ge[CC],!0)}else Te=0}catch($e){NM(m,"Failed to send telemetry using sendBeacon API. Ex:"+dr($e)),Te=0}finally{ee(Se,Te,{},uP)}}a(K,"_onBeaconRetry");function he(pe){return pe===2||pe===3}a(he,"_isBeaconPayload");function Z(pe){return R&&he(pe)&&(pe=2),pe}a(Z,"_adjustSendType"),H.addHeader=function(pe,Se){_[pe]=Se},H.removeHeader=function(pe){delete _[pe]},H[tSe]=function(){return ue()&&u[Z1e]()},H[Gae]=function(pe,Se){Nn(pe)&&(pe=0),R&&(pe=Z(pe),Se=2),ne(v,pe,0)&&Ne(qe(),0,!1,pe,Se||0)},H.isCompletelyIdle=function(){return!l&&f===0&&v[zo]===0},H[rSe]=function(pe){R=pe},H.addBatch=function(pe){if(pe&&pe[Yf]()>0){if(c.isTenantKilled(pe[fS]()))return!1;v[Xm](pe)}return!0},H.teardown=function(){v[zo]>0&&Ne(qe(),0,!0,2,2),Ct(M,function(pe){pe&&pe.rm&&pe.rm()}),M=[]},H.pause=function(){l=!0},H.resume=function(){l=!1,H[Gae](0,4)},H[ije]=function(pe,Se,Fe){pe&&pe[Yf]()>0&&(Xt(Se)&&(Se=1),R&&(Se=Z(Se),Fe=2),Ne([pe],0,!1,Se,Fe||0))};function ue(){return!l&&f0&&!l&&g[Se]&&b&&(te=Se!==0||ue()&&(Fe>0||u[Z1e]())),te}a(ne,"_canSendPayload");function ce(pe){var Se={};return pe&&Ct(pe,function(Fe,te){Se[te]={iKey:Fe[fS](),evts:Fe[BM]()}}),Se}a(ce,"_createDebugBatches");function Ne(pe,Se,Fe,te,Te){if(!(!pe||pe[zo]===0)){if(l){be(pe,1,te);return}te=Z(te);try{var Ge=pe,J=te!==0;Hp(A,function(){return"HttpManager:_sendBatches"},function(se){se&&(pe=pe.slice(0));for(var me=[],Ce=null,He=dS(),$e=g[te]||(J?g[1]:g[0]),et=$e&&$e[oje],ct=B&&(R||he(te)||et===3||$e._isSync&&et===2);ne(pe,te,Se);){var bt=pe.shift();bt&&bt[Yf]()>0&&(c.isTenantKilled(bt[fS]())?me[Xm](bt):(Ce=Ce||b[nje](Se,Fe,J,ct,Te,te),b.appendPayload(Ce,bt,ie)?Ce.overflow!==null&&(pe=[Ce.overflow][LM](pe),Ce.overflow=null,rt(Ce,He,dS(),Te),He=dS(),Ce=null):(rt(Ce,He,dS(),Te),He=dS(),pe=[bt][LM](pe),Ce=null)))}Ce&&rt(Ce,He,dS(),Te),pe[zo]>0&&(v=pe[LM](v)),be(me,8004,te)},function(){return{batches:ce(Ge),retryCount:Se,isTeardown:Fe,isSynchronous:J,sendReason:Te,useSendBeacon:he(te),sendType:te}},!J)}catch(se){wa(m,2,48,"Unexpected Exception sending batch: "+dr(se))}}}a(Ne,"_sendBatches");function we(pe,Se){var Fe={url:s,hdrs:{},useHdrs:!1};Se?(Fe[zz]=Qae(Fe[zz],_),Fe.useHdrs=$u(Fe.hdrs)[zo]>0):Yr(_,function(se,me){E5t[se]?Wae(Fe,E5t[se],me,!1):(Fe[zz][se]=me,Fe[Jqe]=!0)}),Wae(Fe,n5t,"NO_AUTH",Se),Wae(Fe,Hqe,W1e,Se);var te=uP;Ct(pe.apiKeys,function(se){te[zo]>0&&(te+=","),te+=se}),Wae(Fe,Vqe,te,Se),Wae(Fe,$qe,El().toString(),Se);var Te=Ie(pe);if(Cx(Te)&&(Fe.url+="&ext.intweb.msfpc="+Te),u[zqe]()&&Wae(Fe,Gqe,u[Yqe](),Se),A[$ae]){var Ge=A[$ae]();Ge>=0&&(Fe.url+="&w="+Ge)}for(var J=0;J0){var Te=!!O,Ge=g[pe.sendType];!he(pe[CC])&&pe[m5t]&&pe.sendReason===2&&(Ge=g[2]||g[3]||Ge);var J=x;(pe.isBeacon||Ge[oje]===3)&&(J=!1);var se=we(pe,J);J=J||se[Jqe];var me=dS();Hp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Ce=0;Ce0?ct[A5t]++:ct[A5t]=1}be(pe[Jy],1e3+(te||0),pe[CC],!0);var ht={data:pe[h5t],urlString:se.url,headers:se[zz],_thePayload:pe,_sendReason:te,timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};J&&(pje(ht[dP],K1e)||(ht[dP][K1e]=r5t),pje(ht[dP],qae)||(ht[dP][qae]=jqe));var We=null;Ge&&(We=a(function(ae){u.firstRequestSent();var Re=a(function(ye,oe){_t(ye,oe,pe,te)},"onComplete"),Me=pe[sje]||pe.isSync;V.preparePayload(function(ye){try{Ge.sendPOST(ye,Re,Me),j&&j(ht,ye,Me,pe[m5t])}catch(oe){ee(Re,0,{}),NM(m,"Unexpected exception sending payload. Ex:"+dr(oe))}},D,ae,Me)},"sender")),Hp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(We)if(pe[CC]===0&&f++,Te&&!pe.isBeacon&&Ge[oje]!==3){var ae={data:ht.data,urlString:ht.urlString,headers:Qae({},ht[dP]),timeout:ht.timeout,disableXhrSync:ht[l5t],disableFetchKeepAlive:ht[u5t]},Re=!1;Hp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{O(ae,function(Me){Re=!0,!y&&!Me[Hae]&&(Me[Hae]=Me[Hae]||ht[Hae],Me[aje]=Me[aje]||ht[aje]),We(Me)},pe.isSync||pe[sje])}catch{Re||We(ht)}})}else We(ht)})},function(){return{thePayload:pe,serializationStart:Se,serializationCompleted:Fe,sendReason:te}},pe.isSync)}pe.sizeExceed&&pe.sizeExceed[zo]>0&&be(pe.sizeExceed,8003,pe[CC]),pe.failedEvts&&pe.failedEvts[zo]>0&&be(pe.failedEvts,8002,pe[CC])}a(rt,"_doPayloadSend");function st(pe,Se){T&&Ct(pe,function(Fe){var te=Fe[nSe]=Fe[nSe]||{};Be(te,"sendEventCompleted",Se)})}a(st,"_addEventCompletedTimings");function _t(pe,Se,Fe,te){var Te=9e3,Ge=null,J=!1,se=!1;try{var me=!0;if(typeof pe!==eS){if(Se){u[X1e](Se[jen]);var Ce=Se[qen]||Se["kill-duration-seconds"];Ct(c[cje](Se[Qen],Ce),function($e){Ct(Fe[Jy],function(et){if(et[fS]()===$e){Ge=Ge||[];var ct=et[FM](0);Fe.numEvents-=ct[Yf](),Ge[Xm](ct)}})})}if(pe==200||pe==204){Te=200;return}(!rtn(pe)||Fe.numEvents<=0)&&(me=!1),Te=9e3+pe%1e3}if(me){Te=100;var He=Fe.retryCnt;Fe[CC]===0&&(He0&&st(Fe[BM](),Se)})}}a($t,"_addCompleteTimings");function Gt(pe,Se,Fe){Se?pe():Y.set(pe,Fe)}a(Gt,"_doAction");function Ie(pe){for(var Se=0;Se0&&o){var Te=o[Qe(Se)];if(Te){var Ge=Fe!==0;Hp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){Gt(function(){try{Te.call(o,pe,Se,Ge,Fe)}catch(J){wa(m,1,74,"send request notification failed: "+J)}},te||Ge,0)},function(){return{batches:ce(pe),reason:Se,isSync:Ge,sendSync:te,sendType:Fe}},!Ge)}}}a(be,"_sendBatchesNotification");function Qe(pe){var Se=Fbo[pe];return Cx(Se)||(Se=Uen,pe>=9e3&&pe<=9999?Se=Fen:pe>=8e3&&pe<=8999?Se=qqe:pe>=1e3&&pe<=1999&&(Se=Ben)),Se}a(Qe,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var qbo=.25,utn=500,jbo=20,dtn=6,ftn=2,Hbo=4,ctn=2,Gbo=1,_5t=1e4,Xz="eventsDiscarded",ltn="",Fh=void 0,$bo=T_({eventsLimitInMem:{isVal:Wz,v:_5t},immediateEventLimit:{isVal:Wz,v:500},autoFlushEventsLimit:{isVal:Wz,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:Vbo,v:Fh},overrideInstrumentationKey:Fh,overrideEndpointUrl:Fh,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:Fh,clearTimeoutOverride:Fh,payloadPreprocessor:Fh,payloadListener:Fh,disableEventTimings:Fh,valueSanitizer:Fh,stringifyObjects:Fh,enableCompoundKey:Fh,disableOptimizeObj:!1,fetchCredentials:Fh,transports:Fh,unloadTransports:Fh,useSendBeacon:Fh,disableFetchKeepAlive:Fh,avoidOptions:!1,xhrTimeout:Fh,disableXhrSync:Fh,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:Dh,v:dtn},maxUnloadEventRetryAttempts:{isVal:Dh,v:ftn},addNoResponse:Fh,maxEvtPerBatch:{isVal:Dh,v:utn},excludeCsMetaData:Fh,requestLimit:{}});function Vbo(t){return t&&t.sendPOST}a(Vbo,"isOverrideFn");var v5t=(function(t){Wy(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=Y1e,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q,U,Y,W;return Si(e,r,function(V,z){he(),V._getDbgPlgTargets=function(){return[v,n]},V[Yz]=function(J,se,me){Hp(se,function(){return"PostChannel:initialize"},function(){z[Yz](J,se,me),j=se.getNotifyMgr();try{B=O7(_x(V[iSe]),se.evtNamespace&&se.evtNamespace()),V._addHook(lS(J,function(Ce){var He=Ce.cfg,$e=vx(null,He,se);n=$e.getExtCfg(V[iSe],$bo),q=Vae(n[Zqe],n[Xqe]),P=!n.disableOptimizeObj&&XOt(),M=n[zen],H(se),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[g5t],N=n.maxEventRetryAttempts,L=n.maxUnloadEventRetryAttempts,O=n[Yen],W=n.maxEvtPerBatch,tg(He.endpointUrl)?V.pause():l&&V.resume(),Ge(),U=n[Ken],Y=!!n.disableTelemetry,Q&&ie();var et=He.disablePageUnloadEvents||[];Q=Dqe(Le,et,B),Q=$1e(Le,et,B)||Q,Q=V1e(ge,He.disablePageShowEvents,B)||Q})),v[Yz](J,V.core,V)}catch(Ce){throw V.setInitialized(!1),Ce}},function(){return{theConfig:J,core:se,extensions:me}})},V.processTelemetry=function(J,se){Qqe(J,V[iSe]),se=se||V._getTelCtx(se);var me=J;!Y&&!o&&(U&&(me[fS]=U),ke(me,!0),D?qe(2,2):K()),V.processNext(me,se)},V.getOfflineSupport=function(){try{var J=v&&v[rje]();if(v)return{getUrl:a(function(){return J?J.url:null},"getUrl"),serialize:le,batch:re,shouldProcess:a(function(se){return!Y},"shouldProcess"),createPayload:a(function(se){return null},"createPayload"),createOneDSPayload:a(function(se){if(v[eSe])return v[eSe](se,P)},"createOneDSPayload")}}catch{}return null},V._doTeardown=function(J,se){qe(2,2),o=!0,v.teardown(),ie(),he()};function ie(){Nqe(null,B),Mqe(null,B),Oqe(null,B)}a(ie,"_removeUnloadHandlers");function H(J){var se=J[$ae];J[$ae]=function(){var me=0;return M&&(me=me|2),me|se.call(J)}}a(H,"_hookWParam");function re(J){var se=ltn;return J&&J[zo]&&Ct(J,function(me){se&&(se+=` +`),se+=me}),se}a(re,"_batch");function le(J){var se=ltn;try{Ue(J),se=v[tje](J)}catch{}return se}a(le,"_serialize");function Le(J){var se=J||ff().event;se.type!=="beforeunload"&&(D=!0,v[rSe](D)),qe(2,2)}a(Le,"_handleUnloadEvents");function ge(J){D=!1,v[rSe](D)}a(ge,"_handleShowEvents");function Ue(J){J.ext&&J.ext[s5t]&&delete J.ext[s5t],J.ext&&J.ext[Wqe]&&J.ext[Wqe].id&&delete J.ext[Wqe].id,P&&(J.ext=kM(J.ext),J.baseData&&(J.baseData=kM(J.baseData)),J.data&&(J.data=kM(J.data)))}a(Ue,"_cleanEvent");function ke(J,se){if(J[oSe]||(J[oSe]=0),J[L7]||(J[L7]=1),Ue(J),J[Kz]){if(E||l)J[L7]=3,J[Kz]=!1;else if(v){P&&(J=kM(J)),v[ije](B7.create(J[fS],[J]),J[Kz]===!0?1:J[Kz],3);return}}var me=J[L7],Ce=f,He=h;me===4&&(Ce=u,He=d);var $e=!1;if(CeJ;if(!me&&w>0)for(var Ce=1;!me&&Ce<=3;Ce++){var He=b[Ce];He&&He[Jy]&&Ct(He[Jy],function($e){$e&&$e[Yf]()>=w&&(me=!0)})}Ne(!0,me)},V.pause=function(){ue(),l=!0,v&&v.pause()},V.resume=function(){l=!1,v&&v.resume(),K()},V._loadTransmitProfiles=function(J){$t(),Yr(J,function(se,me){var Ce=me[zo];if(Ce>=2){var He=Ce>2?me[2]:0;if(me.splice(0,Ce-2),me[1]<0&&(me[0]=-1),me[1]>0&&me[0]>0){var $e=me[0]/me[1];me[0]=XKr($e)*me[1]}He>=0&&me[1]>=0&&He>me[1]&&(He=me[1]),me[Xm](He),m[se]=me}})},V.flush=function(J,se,me){J===void 0&&(J=!0);var Ce;if(!l)if(me=me||1,J)se||(Ce=Dd(function($e){se=$e})),c==null?(ue(),st(1,0,me),c=Z(function(){c=null,_t(se,me)},0)):s[Xm](se);else{var He=ue();X(1,1,me),se&&se(),He&&K()}return Ce},V.setMsaAuthTicket=function(J){v.addHeader(J1e,J)},V.setAuthPluginHeader=function(J){v.addHeader(i5t,J)},V.removeAuthPluginHeader=function(){v.removeHeader(i5t)},V.hasEvents=ee,V._setTransmitProfile=function(J){g!==J&&m[J]!==void 0&&(ue(),g=J,K())},w7(V,function(){return v},["addResponseHandler"]);function X(J,se,me){var Ce=st(J,se,me);return v[Gae](se,me),Ce}a(X,"_sendEventsForLatencyAndAbove");function ee(){return f>0}a(ee,"_hasEvents");function K(){if(R>=0&&st(R,0,x)&&v[Gae](0,x),u>0&&!y&&!l){var J=m[g][2];J>=0&&(y=Z(function(){y=null,X(4,0,1),K()},J))}var se=m[g][1];!A&&!c&&se>=0&&!l&&(ee()?A=Z(function(){A=null,X(_===0?3:1,0,1),_++,_%=2,K()},se):_=0)}a(K,"_scheduleTimer"),V[lje]=function(){E0&&f>T&&(se=!0),se&&c==null&&V.flush(J,function(){},20))}a(Ne,"_performAutoFlush");function we(J,se){P&&(J=kM(J));var me=J[L7],Ce=ce(J[fS],me,!0);return Ce.addEvent(J)?(me!==4?(f++,se&&J[oSe]===0&&Ne(!J.sync,w>0&&Ce[Yf]()>=w)):u++,!0):!1}a(we,"_addEventToProperQueue");function Be(J,se,me,Ce){for(;me<=se;){var He=ce(J,se,!0);if(He&&He[Yf]()>0){var $e=He[FM](0,Ce),et=$e[Yf]();if(et>0)return me===4?u-=et:f-=et,Qe(Xz,[$e],bM.QueueFull),!0}me++}return rt(),!1}a(Be,"_dropEventWithLatencyOrLess");function rt(){for(var J=0,se=0,me=a(function(He){var $e=b[He];$e&&$e[Jy]&&Ct($e[Jy],function(et){He===4?J+=et[Yf]():se+=et[Yf]()})},"_loop_1"),Ce=1;Ce<=4;Ce++)me(Ce);f=se,u=J}a(rt,"_resetQueueCounts");function st(J,se,me){var Ce=!1,He=se===0;return!He||v[tSe]()?Hp(V.core,function(){return"PostChannel._queueBatches"},function(){for(var $e=[],et=4;et>=J;){var ct=b[et];ct&&ct.batches&&ct.batches[zo]>0&&(Ct(ct[Jy],function(bt){v.addBatch(bt)?Ce=Ce||bt&&bt[Yf]()>0:$e=$e[LM](bt[BM]()),et===4?u-=bt[Yf]():f-=bt[Yf]()}),ct[Jy]=[],ct.iKeyMap={}),et--}$e[zo]>0&&be(Xz,$e,bM.KillSwitch),Ce&&R>=J&&(R=-1,x=0)},function(){return{latency:J,sendType:se,sendReason:me}},!He):(R=R>=0?qU(R,J):J,x=Yk(x,me)),Ce}a(st,"_queueBatches");function _t(J,se){X(1,0,se),rt(),Dt(function(){J&&J(),s[zo]>0?c=Z(function(){c=null,_t(s.shift(),se)},0):(c=null,K())})}a(_t,"_flushImpl");function Dt(J){v.isCompletelyIdle()?J():c=Z(function(){c=null,Dt(J)},qbo)}a(Dt,"_waitForIdleManager");function $t(){ue(),Gt(),g=Y1e,K()}a($t,"_resetTransmitProfiles");function Gt(){m={},m[Y1e]=[2,1,0],m[Oen]=[6,3,0],m[Len]=[18,9,0]}a(Gt,"_initializeProfiles");function Ie(J,se){var me=[],Ce=N;D&&(Ce=L),Ct(J,function(He){He&&He[Yf]()>0&&Ct(He[BM](),function($e){$e&&($e[Kz]&&($e[L7]=4,$e[Kz]=!1),$e[oSe]0&&be(Xz,me,bM.NonRetryableStatus),D&&qe(2,2)}a(Ie,"_requeueEvents");function F(J,se){var me=j||{},Ce=me[J];if(Ce)try{Ce.apply(me,se)}catch(He){wa(V.diagLog(),1,74,J+" notification failed: "+He)}}a(F,"_callNotification");function be(J,se){for(var me=[],Ce=2;Ce0&&F(J,[se][LM](me))}a(be,"_notifyEvents");function Qe(J,se){for(var me=[],Ce=2;Ce0&&Ct(se,function(He){He&&He[Yf]()>0&&F(J,[He.events()][LM](me))})}a(Qe,"_notifyBatchEvents");function pe(J,se,me){J&&J[zo]>0&&F("eventsSendRequest",[se>=1e3&&se<=1999?se-1e3:0,me!==!0])}a(pe,"_sendingEvent");function Se(J,se){Qe("eventsSent",J,se),K()}a(Se,"_eventsSentEvent");function Fe(J,se){Qe(Xz,J,se>=8e3&&se<=8999?se-8e3:bM.Unknown)}a(Fe,"_eventsDropped");function te(J){Qe(Xz,J,bM.NonRetryableStatus),K()}a(te,"_eventsResponseFail");function Te(J,se){Qe(Xz,J,bM.Unknown),K()}a(Te,"_otherEvent");function Ge(){O?w=0:w=Yk(W*(ctn+1),h/6)}a(Ge,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Bae);var pS=de(require("os"));var hje=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=Wbo(e),this.commonProperties=zbo(e),this.#e=bs(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new e5t,n=new v5t,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){Nr.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){Nr.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(Ur).resolveSession();e?.login?this.commonProperties["common.github_handle"]=e.login:delete this.commonProperties["common.github_handle"]}catch(e){Nr.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(nr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function Wbo(t){let e={},r=t.get(Fa);e["ai.session.id"]=r.sessionId;let n=t.get(Op);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${pS.type()} ${pS.release()}`,e["ai.device.osArchitecture"]=pS.arch(),e["ai.device.osPlatform"]=pS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ds).getVersion(),e}a(Wbo,"getTags");function zbo(t){let e={};e.common_os=pS.platform(),e.common_platformversion=pS.release(),e.common_arch=pS.arch(),e.common_cpu=Array.from(new Set(pS.cpus().map(n=>n.model))).join();let r=t.get(Fa);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(zbo,"getCommonProperties");var Ybo="7d7048df-6dd0-4048-bb23-b716c1461f8f",Kbo="3fdd7f28-937a-48c8-9a21-ba337db23bd1",Jbo="b73649cf-ca8f-4768-9e0e-b789d8529db5",Zbo="5fb6107a-6a29-423f-a824-22e3724fa2a6",Xbo="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function e1o(t){return OU(t)==="prod"?Jbo:Zbo}a(e1o,"getMsftInstrumentationKey");function ptn(t){return new URL(t).hostname==="github.com"?WW.telemetry:t.replace("://","://copilot-telemetry-service.")}a(ptn,"getEndpointForServerUrl");var pf=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=ptn(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];bs(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(X0);if(o.setReporter(new fae(r,this.namespace,{instrumentationKey:Ybo,endpointUrl:n})),o.setRestrictedReporter(new fae(r,this.namespace,{instrumentationKey:Kbo,endpointUrl:n})),o.setMsftReporter(new fae(r,`copilot/${this.namespace}`,{instrumentationKey:e1o(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new hje(r,"ThirdParty.copilot-chat",Xbo,!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(X0);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(X0).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=ptn(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function t1o(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await Gf(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(pf).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return b_.exception(t,n,"signUpLimited failed"),!1}}a(t1o,"apiFetchSignUpLimited");async function b5t(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 t1o(t,e)?b5t(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(b5t,"getTokenWithSignUpLimited");p();p();var htn=de(ti());var Wi=class extends htn.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var r1o={didChangeFeatureFlags:!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},bn=class{constructor(){this.capabilities={...r1o};this.emitter=new Wi;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 i3=require("fs"),zae=require("os"),Yae=de(require("path")),F7=require("process");var ri=class{static{a(this,"PersistenceManager")}},S5t=class extends ri{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 i3.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=Yae.dirname(s);c!==this.directory&&await i3.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await sSe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await i3.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 sSe.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+` `;l===`{} -`?await i3.promises.rm(o):await i3.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 oSe.acquire(n),await i3.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await i3.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 i3.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},oSe=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 Xbo(){if(B7.env.XDG_CONFIG_HOME&&Yae.isAbsolute(B7.env.XDG_CONFIG_HOME))return B7.env.XDG_CONFIG_HOME+"/github-copilot";if((0,zae.platform)()==="win32"){let e=B7.env.USERPROFILE||S5t.homedir();return e?e+"\\AppData\\Local\\github-copilot":htn()}let t=B7.env.HOME&&B7.env.HOME.length>0?B7.env.HOME:S5t.homedir();return t?t+"/.config/github-copilot":htn()}a(Xbo,"getXdgConfigPath");var S5t={homedir:zae.homedir,tmpdir:zae.tmpdir};function htn(){return Yae.join(S5t.tmpdir(),"github-copilot")}a(htn,"tmpdirConfigPath");function mtn(){return new b5t(Xbo())}a(mtn,"makeXdgPersistenceManager");p();var ps=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){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}}},pje=class extends ps{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var gtn={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function Atn(t,e){At(t,gtn.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(Atn,"telemetryAuthPickerListed");function T5t(t,e){At(t,gtn.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(T5t,"telemetryAuthPickerUsed");p();var F7={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",EncryptionUpgrade:"auth.encryption.upgrade",EncryptionDecryptV1ToV0:"auth.encryption.decryptV1ToV0"};function ytn(t,e){Vn(t,F7.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs})}a(ytn,"telemetryAuthStoreInitialize");function Etn(t,e){Vn(t,F7.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(Etn,"telemetryAuthStoreError");function _tn(t,e){Vn(t,F7.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(_tn,"telemetryAuthStoreMigration");function I5t(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)),At(t,F7.SessionActivated,r,{durationMs:e.durationMs})}a(I5t,"telemetryAuthSessionActivated");function vtn(t,e){At(t,F7.SessionDeactivated,{editorId:e.editorId})}a(vtn,"telemetryAuthSessionDeactivated");function sSe(t,e){At(t,F7.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(sSe,"telemetryAuthTokenRevoked");function hje(t,e){Vn(t,F7.EncryptionInitialize,e.diagnostics.error,{writerKind:e.writerKind,available:String(e.diagnostics.available),errorPhase:e.diagnostics.errorPhase??"",masterKeySource:e.diagnostics.masterKeySource??""})}a(hje,"telemetryAuthEncryptionInitialize");function x5t(t,e){Vn(t,F7.EncryptionDecryptV1ToV0,e.error,{},e.result?{attempted:e.result.attempted,decrypted:e.result.decrypted,purged:e.result.purged,skipped:e.result.skipped}:void 0)}a(x5t,"telemetryAuthEncryptionDecryptV1ToV0");var e1o="apps",Ctn="hosts",Md=new fe("AuthManager"),btn="legacy_files_migration_done",t1o=5,r1o=6e4,Ur=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($m).getConfiguredUrls()}async checkAndUpdateStatus(e){let r=e?.localChecksOnly??!1,n,o;if(e?.githubAppId!==void 0)n=await this.resolvePersistedSession(e);else{let c=await this.resolveSessionWithSource(e?.authAuthority);n=c.session,o=c.sourceEnvVar}if(n===void 0)return this._copilotTokenManager.resetToken("session_not_found"),Md.info(this.ctx,"checkAndUpdateStatus: no session found, priming token"),await this._copilotTokenManager.primeToken(),o?{status:"NotSignedIn",sourceEnvVar:o}:{status:"NotSignedIn"};if(r)return this.ctx.get(ps).forceNormalV2("auth",{result:{status:"MaybeOK",user:n.login}}),o?{status:"MaybeOK",user:n.login,sourceEnvVar:o}:{status:"MaybeOK",user:n.login};e?.forceRefresh&&this._copilotTokenManager.resetToken("force_refresh");let s=await C5t(this.ctx,n,e?.freshSignIn??!1);return o?{status:s,user:n.login,sourceEnvVar:o}:{status:s,user:n.login}}async resolveSession(e){return(await this.resolveSessionWithSource(e)).session}async resolveSessionWithSource(e){await this.ctx.get(Lo).requireReady();let{session:r,sourceEnvVar:n}=R5t(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),Md.info(this.ctx,`resolveSessionWithSource: resolved from env var ${n}`),{session:{...r,...$y(r)},sourceEnvVar:n};let o=await this.transientSession;if(o)return o.accessToken===void 0?(Md.info(this.ctx,"resolveSessionWithSource: transient session is a shadow, no session"),{session:void 0}):(Md.info(this.ctx,"resolveSessionWithSource: resolved from transient session"),{session:{...o,...$y(o)}});let s=await this.resolvePersistedSession({authAuthority:e});return Md.info(this.ctx,`resolveSessionWithSource: persisted store ${s?"resolved a session":"returned no session"}`),{session:s}}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},mje=class extends Ur{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(nx)}async tracked(r,n){try{return await n()}catch(o){throw Md.exception(this.ctx,o,`authStore.${r}`),Etn(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=UU(this.ctx,r.authAuthority)}catch(o){Md.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:i1o(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(btn))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(Yn),h=this.editorId(),[m,g]=await Promise.all([f.readAll(e1o).catch(()=>({})),f.readAll(Ctn).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let E=Stn(y);if(!E){c++;continue}let[_,v]=n1o(A)??["github.com",Kae],b=E.oauth_token||E.access_token,T=E.user||E.login;if(!b||!T){c++;continue}let w=E.authAuthority||_;if(!jDt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:b,authAuthority:w,oauthClientId:E.githubAppId??v,scopes:w5t(E.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let E=Stn(y);if(!E){c++;continue}let _=E.oauth_token||E.access_token,v=E.user||E.login;if(!_||!v){c++;continue}let b=E.authAuthority||A;if(!jDt(b)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:_,authAuthority:b,oauthClientId:E.githubAppId??Kae,scopes:w5t(E.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(btn,String(Date.now())))}catch{}this.ctx.get(Yn).deleteSetting(Ctn).catch(()=>{}),_tn(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),Md.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(t1o);if(Md.debug(this.ctx,`tryAutoAdopt: editorId=${n} candidates=${s.length}`),s.length===0)return;let c=this.ctx.get(Rh);for(let l of s){let u=this.tokenRecordToSession(l.record);if(!u){Md.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{Md.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${l.tokenId}; aborting walk`);return}if(d.copilotToken||d.failureKind==="NotAuthorized"){Md.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){Md.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${l.tokenId} (${f?.message??f}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(l.tokenId),I5t(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:l.sourceEditorId!==n,durationMs:Date.now()-o}),u}if(d.failureKind==="HTTP401"){Md.info(this.ctx,`tryAutoAdopt: skipping invalid tokenId=${l.tokenId} (not revoking); continuing walk`);continue}Md.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${l.tokenId} kind=${d.failureKind}; aborting walk`);return}Md.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new yi("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new yi("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();Md.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:w5t(r.scopes)}));Md.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),I5t(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=UU(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 Md.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),vtn(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){Md.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return Md.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),sSe(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),o}async useExistingToken(r){let n=this.authRepository,o=this.editorId(),s=await n.getTokenById(r);if(!s)return T5t(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 T5t(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 Atn(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(bn).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){Md.info(this.ctx,`resolvePersistedSession: no active session editorId=${o} pickerEnabled=${s} optedOut=${c} autoAdoptAttempted=${u}`);return}let d=UU(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==d.authAuthority){Md.info(this.ctx,`resolvePersistedSession: active session authority mismatch editorId=${o}`);return}if(r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId){Md.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>=r1o&&(this.lastTouchAt=h,n.touchActiveSession(o).catch(()=>{})),f}};function n1o(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(n1o,"splitAppsKey");function i1o(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(i1o,"normalizeScopes");function w5t(t){return t?typeof t=="string"?t:t.join(" "):""}a(w5t,"scopesToString");function Stn(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(Stn,"asLegacyAuthRecord");function R5t(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...$y({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:{...$y({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:{...$y({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(R5t,"getSessionFromEnv");p();var o1o=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],Ttn="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.",Itn="https://gh.io/copilot-network-errors",CC=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&o1o.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new fe("certificates").error(e,`${Ttn} Please visit ${Itn} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(ts).showWarningMessage(Ttn,n).then(o=>{if(o?.title===n.title)return e.get(Vm).open(Itn)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};p();var vA=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 bC(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(bC,"delay");async function vx(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(vx,"mapWithConcurrency");function Jae(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(Jae,"fireAndForget");function xtn(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(xtn,"createLimiter");function o3(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(o3,"withTimeout");function Zae(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(Zae,"safeInit");var k5t=class extends yi{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.refreshTimer=void 0;this.didChangeTokenResult=new Wi;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new Wi;this.onDidResetToken=this.didResetToken.event}static{a(this,"CopilotTokenManager")}async getGitHubSession(){return await this.ctx.get(Ur).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(Rh).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e,this.scheduleProactiveRefresh(e)}scheduleProactiveRefresh(e){if(this.clearRefreshTimer(),ktn(this.ctx).value)return;let r=e.envelope.refresh_in*1e3;r>0&&r<=2147483647&&(this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,!this.tokenPromise&&(wtn(this.ctx,"started",r),this.startTokenRefresh(n=>{wtn(this.ctx,n.copilotToken?"success":"failure",r,n.failureKind??"","exception"in n?n.exception:void 0)}))},r),typeof this.refreshTimer=="object"&&"unref"in this.refreshTimer&&this.refreshTimer.unref())}clearRefreshTimer(){this.refreshTimer!==void 0&&(clearTimeout(this.refreshTimer),this.refreshTimer=void 0)}startTokenRefresh(e){let r,n=this.getGitHubSession().then(async o=>o?(r=o.login,await this.fetchTokenResult(o)):{failureKind:"NotSignedIn"}).catch(o=>{let s=o instanceof Error?o:new Error(String(o));return b_.exception(this.ctx,s,"tokenRefresh"),{failureKind:"Exception",message:String(o),exception:s}}).then(o=>(this.tokenPromise!==n||(this.tokenPromise=void 0,o.copilotToken&&(this.ctx.get(ps).forceNormal("auth",{result:{status:"OK",user:r??""}}),this.setToken(o.copilotToken),this.didChangeTokenResult.fire(o)),e?.(o)),o));this.tokenPromise=n}async getTokenResult(){if(!this.primed){let r=new Error("Token requested before initialization");if(Rtn(this.ctx))throw this.tokenPrimingError=r,r;b_.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(ps);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,result:{status:"NotSignedIn",user:r}}),this.ctx.get(CC).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=BU(),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?Vn(this.ctx,"auth.token_reset_complete",e.exception,s,l):At(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=BU(),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 k5t(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){b_.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}if(r!==void 0?(Et(this.ctx,"auth.reset_token_"+r),b_.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):b_.debug(this.ctx,`Resetting copilot token (caller: ${e})`),!this.activeToken&&!this.tokenPromise)return;let o=BU(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;At(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.clearRefreshTimer(),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire()}getLastToken(){return this.lastToken}};function rx(t){return t.get(Qt).getLastToken()}a(rx,"getLastCopilotToken");function wtn(t,e,r,n,o){let s={status:e,errorCode:n??""},c={delayMs:r};o?Vn(t,"auth.proactive_copilot_token_refresh",o,s,c):At(t,"auth.proactive_copilot_token_refresh",s,c)}a(wtn,"telemetryProactiveCopilotTokenRefresh");p();var Cx=class{static{a(this,"Clock")}now(){return new Date}};p();var dP=class{static{a(this,"ExpConfigMaker")}},aSe=class extends dP{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=r.get(tr),c=Object.keys(o).length===0?this.defaultFilters:o,l=new URL("telemetry",n.telemetry).href,u;try{u=await s.fetch(l,{method:"GET",headers:c,timeout:5e3})}catch(m){return nC.createFallbackConfig(r,`Error fetching ExP config: ${String(m)}`)}if(!u.ok)return nC.createFallbackConfig(r,`ExP responded with ${u.status}`);let d;try{d=await u.json()}catch(m){if(m instanceof SyntaxError)return qa(r,m,"fetchExperiments"),nC.createFallbackConfig(r,"ExP responded with invalid JSON");throw m}let f=d.Configs.find(m=>m.Id==="vscode")??{Id:"vscode",Parameters:{}},h=Object.entries(f.Parameters).map(([m,g])=>m+(g?"":"cf"));return new nC(f.Parameters,d.AssignmentContext,h.join(";"))}},gje=class extends dP{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(nC.createEmptyConfig())}};p();p();var Aje=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},P5t=class extends Aje{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},Ptn=a(t=>new P5t(t),"DEFAULT_GRANULARITY"),yje=class extends Aje{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 Dtn="X-Copilot-ClientTimeBucket",Eje=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=Ptn(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 yje(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(Dtn,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(Dtn,s))}}};p();p();p();p();var D5t=new Map;async function a1o(t){if(D5t.has(t))return D5t.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return D5t.set(t,e),e}a(a1o,"getCachedHmacKey");async function c1o(t){if(t)try{let e=await a1o(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(c1o,"createRequestHMAC");async function Ntn(t,e){let r=await c1o(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(Ntn,"createMsBenchHmacHeaders");p();p();p();p();var vje="4.13.1",Xz="04b07795-8ddb-461a-bbee-02f9e1bf7b46",Mtn="common",_je;(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"})(_je||(_je={}));var cSe=_je.AzurePublicCloud,Otn="login.microsoftonline.com",Ltn=["*"],Btn="cae",Ftn="nocae",Utn="msal.cache";var N5t;var l1o,Cje,qtn;function jtn(){return Cje!==void 0&&qtn!==void 0}a(jtn,"hasVSCodePlugin");function u1o(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(N5t===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||Utn;e.cache.cachePlugin=N5t({name:`${r}.${Ftn}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=N5t({name:`${r}.${Btn}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=f1o(t.isVSCodeCredential||!1)),e}a(u1o,"generatePluginConfiguration");var Qtn={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")},d1o={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return qtn}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return l1o}}};function f1o(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=d1o[t?"vsCode":"native"];if(o===void 0)throw new Error(Qtn.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error(Qtn.unavailable(e,r));return o.broker}a(f1o,"getBrokerPlugin");var Htn={generatePluginConfiguration:u1o};p();p();p();function p1o(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(p1o,"isErrorResponse");var $tn="CredentialUnavailableError",Mn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=$tn}},bje="AuthenticationError",U7=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(p1o(r))o=Gtn(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=Gtn(s)}catch{e===400?o={error:"invalid_request",errorDescription:`The service indicated that the request was invalid. +`?await i3.promises.rm(o):await i3.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 sSe.acquire(n),await i3.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await i3.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 i3.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},sSe=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 n1o(){if(F7.env.XDG_CONFIG_HOME&&Yae.isAbsolute(F7.env.XDG_CONFIG_HOME))return F7.env.XDG_CONFIG_HOME+"/github-copilot";if((0,zae.platform)()==="win32"){let e=F7.env.USERPROFILE||T5t.homedir();return e?e+"\\AppData\\Local\\github-copilot":mtn()}let t=F7.env.HOME&&F7.env.HOME.length>0?F7.env.HOME:T5t.homedir();return t?t+"/.config/github-copilot":mtn()}a(n1o,"getXdgConfigPath");var T5t={homedir:zae.homedir,tmpdir:zae.tmpdir};function mtn(){return Yae.join(T5t.tmpdir(),"github-copilot")}a(mtn,"tmpdirConfigPath");function gtn(){return new S5t(n1o())}a(gtn,"makeXdgPersistenceManager");p();var ps=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){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}}},mje=class extends ps{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var Atn={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function ytn(t,e){At(t,Atn.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(ytn,"telemetryAuthPickerListed");function I5t(t,e){At(t,Atn.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(I5t,"telemetryAuthPickerUsed");p();var U7={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",EncryptionUpgrade:"auth.encryption.upgrade",EncryptionDecryptV1ToV0:"auth.encryption.decryptV1ToV0"};function Etn(t,e){Vn(t,U7.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs})}a(Etn,"telemetryAuthStoreInitialize");function _tn(t,e){Vn(t,U7.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(_tn,"telemetryAuthStoreError");function vtn(t,e){Vn(t,U7.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(vtn,"telemetryAuthStoreMigration");function x5t(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)),At(t,U7.SessionActivated,r,{durationMs:e.durationMs})}a(x5t,"telemetryAuthSessionActivated");function Ctn(t,e){At(t,U7.SessionDeactivated,{editorId:e.editorId})}a(Ctn,"telemetryAuthSessionDeactivated");function aSe(t,e){At(t,U7.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(aSe,"telemetryAuthTokenRevoked");function gje(t,e){Vn(t,U7.EncryptionInitialize,e.diagnostics.error,{writerKind:e.writerKind,available:String(e.diagnostics.available),errorPhase:e.diagnostics.errorPhase??"",masterKeySource:e.diagnostics.masterKeySource??""})}a(gje,"telemetryAuthEncryptionInitialize");function w5t(t,e){Vn(t,U7.EncryptionDecryptV1ToV0,e.error,{},e.result?{attempted:e.result.attempted,decrypted:e.result.decrypted,purged:e.result.purged,skipped:e.result.skipped}:void 0)}a(w5t,"telemetryAuthEncryptionDecryptV1ToV0");var i1o="apps",btn="hosts",Md=new fe("AuthManager"),Stn="legacy_files_migration_done",o1o=5,s1o=6e4,Ur=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($m).getConfiguredUrls()}async checkAndUpdateStatus(e){let r=e?.localChecksOnly??!1,n,o;if(e?.githubAppId!==void 0)n=await this.resolvePersistedSession(e);else{let c=await this.resolveSessionWithSource(e?.authAuthority);n=c.session,o=c.sourceEnvVar}if(n===void 0)return this._copilotTokenManager.resetToken("session_not_found"),Md.info(this.ctx,"checkAndUpdateStatus: no session found, priming token"),await this._copilotTokenManager.primeToken(),o?{status:"NotSignedIn",sourceEnvVar:o}:{status:"NotSignedIn"};if(r)return this.ctx.get(ps).forceNormalV2("auth",{result:{status:"MaybeOK",user:n.login}}),o?{status:"MaybeOK",user:n.login,sourceEnvVar:o}:{status:"MaybeOK",user:n.login};e?.forceRefresh&&this._copilotTokenManager.resetToken("force_refresh");let s=await b5t(this.ctx,n,e?.freshSignIn??!1);return o?{status:s,user:n.login,sourceEnvVar:o}:{status:s,user:n.login}}async resolveSession(e){return(await this.resolveSessionWithSource(e)).session}async resolveSessionWithSource(e){await this.ctx.get(Bo).requireReady();let{session:r,sourceEnvVar:n}=k5t(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),Md.info(this.ctx,`resolveSessionWithSource: resolved from env var ${n}`),{session:{...r,...$y(r)},sourceEnvVar:n};let o=await this.transientSession;if(o)return o.accessToken===void 0?(Md.info(this.ctx,"resolveSessionWithSource: transient session is a shadow, no session"),{session:void 0}):(Md.info(this.ctx,"resolveSessionWithSource: resolved from transient session"),{session:{...o,...$y(o)}});let s=await this.resolvePersistedSession({authAuthority:e});return Md.info(this.ctx,`resolveSessionWithSource: persisted store ${s?"resolved a session":"returned no session"}`),{session:s}}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},Aje=class extends Ur{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(ox)}async tracked(r,n){try{return await n()}catch(o){throw Md.exception(this.ctx,o,`authStore.${r}`),_tn(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=QU(this.ctx,r.authAuthority)}catch(o){Md.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:c1o(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(Stn))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(ri),h=this.editorId(),[m,g]=await Promise.all([f.readAll(i1o).catch(()=>({})),f.readAll(btn).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let E=Ttn(y);if(!E){c++;continue}let[_,v]=a1o(A)??["github.com",Kae],b=E.oauth_token||E.access_token,T=E.user||E.login;if(!b||!T){c++;continue}let w=E.authAuthority||_;if(!HDt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:b,authAuthority:w,oauthClientId:E.githubAppId??v,scopes:R5t(E.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let E=Ttn(y);if(!E){c++;continue}let _=E.oauth_token||E.access_token,v=E.user||E.login;if(!_||!v){c++;continue}let b=E.authAuthority||A;if(!HDt(b)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:_,authAuthority:b,oauthClientId:E.githubAppId??Kae,scopes:R5t(E.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(Stn,String(Date.now())))}catch{}this.ctx.get(ri).deleteSetting(btn).catch(()=>{}),vtn(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),Md.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(o1o);if(Md.debug(this.ctx,`tryAutoAdopt: editorId=${n} candidates=${s.length}`),s.length===0)return;let c=this.ctx.get(Rh);for(let l of s){let u=this.tokenRecordToSession(l.record);if(!u){Md.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{Md.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${l.tokenId}; aborting walk`);return}if(d.copilotToken||d.failureKind==="NotAuthorized"){Md.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){Md.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${l.tokenId} (${f?.message??f}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(l.tokenId),x5t(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:l.sourceEditorId!==n,durationMs:Date.now()-o}),u}if(d.failureKind==="HTTP401"){Md.info(this.ctx,`tryAutoAdopt: skipping invalid tokenId=${l.tokenId} (not revoking); continuing walk`);continue}Md.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${l.tokenId} kind=${d.failureKind}; aborting walk`);return}Md.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new yi("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new yi("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();Md.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:R5t(r.scopes)}));Md.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),x5t(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=QU(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 Md.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),Ctn(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){Md.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return Md.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),aSe(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),o}async useExistingToken(r){let n=this.authRepository,o=this.editorId(),s=await n.getTokenById(r);if(!s)return I5t(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 I5t(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 ytn(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(bn).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){Md.info(this.ctx,`resolvePersistedSession: no active session editorId=${o} pickerEnabled=${s} optedOut=${c} autoAdoptAttempted=${u}`);return}let d=QU(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==d.authAuthority){Md.info(this.ctx,`resolvePersistedSession: active session authority mismatch editorId=${o}`);return}if(r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId){Md.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>=s1o&&(this.lastTouchAt=h,n.touchActiveSession(o).catch(()=>{})),f}};function a1o(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(a1o,"splitAppsKey");function c1o(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(c1o,"normalizeScopes");function R5t(t){return t?typeof t=="string"?t:t.join(" "):""}a(R5t,"scopesToString");function Ttn(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(Ttn,"asLegacyAuthRecord");function k5t(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...$y({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:{...$y({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:{...$y({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(k5t,"getSessionFromEnv");p();var l1o=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],Itn="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.",xtn="https://gh.io/copilot-network-errors",bC=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&l1o.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new fe("certificates").error(e,`${Itn} Please visit ${xtn} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(ts).showWarningMessage(Itn,n).then(o=>{if(o?.title===n.title)return e.get(Vm).open(xtn)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};p();var vA=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 SC(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(SC,"delay");async function hS(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(hS,"mapWithConcurrency");function Jae(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(Jae,"fireAndForget");function wtn(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(wtn,"createLimiter");function o3(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(o3,"withTimeout");function Zae(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(Zae,"safeInit");var P5t=class extends yi{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.refreshTimer=void 0;this.didChangeTokenResult=new Wi;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new Wi;this.onDidResetToken=this.didResetToken.event}static{a(this,"CopilotTokenManager")}async getGitHubSession(){return await this.ctx.get(Ur).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(Rh).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e,this.scheduleProactiveRefresh(e)}scheduleProactiveRefresh(e){if(this.clearRefreshTimer(),Ptn(this.ctx).value)return;let r=e.envelope.refresh_in*1e3;r>0&&r<=2147483647&&(this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,!this.tokenPromise&&(Rtn(this.ctx,"started",r),this.startTokenRefresh(n=>{Rtn(this.ctx,n.copilotToken?"success":"failure",r,n.failureKind??"","exception"in n?n.exception:void 0)}))},r),typeof this.refreshTimer=="object"&&"unref"in this.refreshTimer&&this.refreshTimer.unref())}clearRefreshTimer(){this.refreshTimer!==void 0&&(clearTimeout(this.refreshTimer),this.refreshTimer=void 0)}startTokenRefresh(e){let r,n=this.getGitHubSession().then(async o=>o?(r=o.login,await this.fetchTokenResult(o)):{failureKind:"NotSignedIn"}).catch(o=>{let s=o instanceof Error?o:new Error(String(o));return b_.exception(this.ctx,s,"tokenRefresh"),{failureKind:"Exception",message:String(o),exception:s}}).then(o=>(this.tokenPromise!==n||(this.tokenPromise=void 0,o.copilotToken&&(this.ctx.get(ps).forceNormal("auth",{result:{status:"OK",user:r??""}}),this.setToken(o.copilotToken),this.didChangeTokenResult.fire(o)),e?.(o)),o));this.tokenPromise=n}async getTokenResult(){if(!this.primed){let r=new Error("Token requested before initialization");if(ktn(this.ctx))throw this.tokenPrimingError=r,r;b_.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(ps);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,result:{status:"NotSignedIn",user:r}}),this.ctx.get(bC).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=FU(),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?Vn(this.ctx,"auth.token_reset_complete",e.exception,s,l):At(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=FU(),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 P5t(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){b_.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}if(r!==void 0?(Et(this.ctx,"auth.reset_token_"+r),b_.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):b_.debug(this.ctx,`Resetting copilot token (caller: ${e})`),!this.activeToken&&!this.tokenPromise)return;let o=FU(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;At(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.clearRefreshTimer(),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire()}getLastToken(){return this.lastToken}};function ix(t){return t.get(Qt).getLastToken()}a(ix,"getLastCopilotToken");function Rtn(t,e,r,n,o){let s={status:e,errorCode:n??""},c={delayMs:r};o?Vn(t,"auth.proactive_copilot_token_refresh",o,s,c):At(t,"auth.proactive_copilot_token_refresh",s,c)}a(Rtn,"telemetryProactiveCopilotTokenRefresh");p();var bx=class{static{a(this,"Clock")}now(){return new Date}};p();var fP=class{static{a(this,"ExpConfigMaker")}},cSe=class extends fP{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=r.get(nr),c=Object.keys(o).length===0?this.defaultFilters:o,l=new URL("telemetry",n.telemetry).href,u;try{u=await s.fetch(l,{method:"GET",headers:c,timeout:5e3})}catch(m){return iC.createFallbackConfig(r,`Error fetching ExP config: ${String(m)}`)}if(!u.ok)return iC.createFallbackConfig(r,`ExP responded with ${u.status}`);let d;try{d=await u.json()}catch(m){if(m instanceof SyntaxError)return Qa(r,m,"fetchExperiments"),iC.createFallbackConfig(r,"ExP responded with invalid JSON");throw m}let f=d.Configs.find(m=>m.Id==="vscode")??{Id:"vscode",Parameters:{}},h=Object.entries(f.Parameters).map(([m,g])=>m+(g?"":"cf"));return new iC(f.Parameters,d.AssignmentContext,h.join(";"))}},yje=class extends fP{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(iC.createEmptyConfig())}};p();p();var Eje=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},D5t=class extends Eje{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},Dtn=a(t=>new D5t(t),"DEFAULT_GRANULARITY"),_je=class extends Eje{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 Ntn="X-Copilot-ClientTimeBucket",vje=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=Dtn(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 _je(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(Ntn,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(Ntn,s))}}};p();p();p();p();var N5t=new Map;async function d1o(t){if(N5t.has(t))return N5t.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return N5t.set(t,e),e}a(d1o,"getCachedHmacKey");async function f1o(t){if(t)try{let e=await d1o(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(f1o,"createRequestHMAC");async function Mtn(t,e){let r=await f1o(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(Mtn,"createMsBenchHmacHeaders");p();p();p();p();var bje="4.13.1",eY="04b07795-8ddb-461a-bbee-02f9e1bf7b46",Otn="common",Cje;(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"})(Cje||(Cje={}));var lSe=Cje.AzurePublicCloud,Ltn="login.microsoftonline.com",Btn=["*"],Ftn="cae",Utn="nocae",Qtn="msal.cache";var M5t;var p1o,Sje,jtn;function Htn(){return Sje!==void 0&&jtn!==void 0}a(Htn,"hasVSCodePlugin");function h1o(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(M5t===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||Qtn;e.cache.cachePlugin=M5t({name:`${r}.${Utn}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=M5t({name:`${r}.${Ftn}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=g1o(t.isVSCodeCredential||!1)),e}a(h1o,"generatePluginConfiguration");var qtn={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")},m1o={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return jtn}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return p1o}}};function g1o(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=m1o[t?"vsCode":"native"];if(o===void 0)throw new Error(qtn.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error(qtn.unavailable(e,r));return o.broker}a(g1o,"getBrokerPlugin");var Gtn={generatePluginConfiguration:h1o};p();p();p();function A1o(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(A1o,"isErrorResponse");var Vtn="CredentialUnavailableError",Mn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=Vtn}},Tje="AuthenticationError",Q7=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(A1o(r))o=$tn(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=$tn(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=bje}},Vtn="AggregateAuthenticationError",lSe=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=Tje}},Wtn="AggregateAuthenticationError",uSe=class extends Error{static{a(this,"AggregateAuthenticationError")}errors;constructor(e,r){let n=e.join(` `);super(`${r} -${n}`),this.errors=e,this.name=Vtn}};function Gtn(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(Gtn,"convertOAuthErrorResponseToErrorResponse");var bx=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 Wtn=require("node:os"),ztn=de(require("node:util"),1),Ytn=de(require("node:process"),1);function Ktn(t,...e){Ytn.stderr.write(`${ztn.default.format(t,...e)}${Wtn.EOL}`)}a(Ktn,"log");var Jtn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Ztn,M5t=[],O5t=[],Sje=[];Jtn&&L5t(Jtn);var Xtn=Object.assign(t=>ern(t),{enable:L5t,enabled:B5t,disable:h1o,log:Ktn});function L5t(t){Ztn=t,M5t=[],O5t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?O5t.push(new RegExp(`^${n.substr(1)}$`)):M5t.push(new RegExp(`^${n}$`));for(let n of Sje)n.enabled=B5t(n.namespace)}a(L5t,"enable");function B5t(t){if(t.endsWith("*"))return!0;for(let e of O5t)if(e.test(t))return!1;for(let e of M5t)if(e.test(t))return!0;return!1}a(B5t,"enabled");function h1o(){let t=Ztn||"";return L5t(""),t}a(h1o,"disable");function ern(t){let e=Object.assign(r,{enabled:B5t(t),destroy:m1o,log:Xtn.log,namespace:t,extend:g1o});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),Sje.push(e),e}a(ern,"createDebugger");function m1o(){let t=Sje.indexOf(this);return t>=0?(Sje.splice(t,1),!0):!1}a(m1o,"destroy");function g1o(t){let e=ern(`${this.namespace}:${t}`);return e.log=this.log,e}a(g1o,"extend");var Xae=Xtn;var rrn=new Set,Tje=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,xje,F5t=Xae("azure");F5t.log=(...t)=>{Xae.log(...t)};var U5t=["verbose","info","warning","error"];Tje&&(orn(Tje)?A1o(Tje):console.error(`AZURE_LOG_LEVEL set to unknown log level '${Tje}'; logging is not enabled. Acceptable values: ${U5t.join(", ")}.`));function A1o(t){if(t&&!orn(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${U5t.join(",")}`);xje=t;let e=[];for(let r of rrn)irn(r)&&e.push(r.namespace);Xae.enable(e.join(","))}a(A1o,"setLogLevel");function wje(){return xje}a(wje,"getLogLevel");var trn={verbose:400,info:300,warning:200,error:100};function Q7(t){let e=F5t.extend(t);return nrn(F5t,e),{error:Ije(e,"error"),warning:Ije(e,"warning"),info:Ije(e,"info"),verbose:Ije(e,"verbose")}}a(Q7,"createClientLogger");function nrn(t,e){e.log=(...r)=>{t.log(...r)}}a(nrn,"patchLogMethod");function Ije(t,e){let r=Object.assign(t.extend(e),{level:e});if(nrn(t,r),irn(r)){let n=Xae.disable();Xae.enable(n+","+r.namespace)}return rrn.add(r),r}a(Ije,"createLogger");function irn(t){return!!(xje&&trn[t.level]<=trn[xje])}a(irn,"shouldEnable");function orn(t){return U5t.includes(t)}a(orn,"isAzureLogLevel");var hS=Q7("identity");function Rje(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(Rje,"processEnvVars");function e0(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(e0,"formatSuccess");function Us(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(Us,"formatError");function srn(t,e,r=hS){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(srn,"credentialLoggerInstance");function lo(t,e=hS){let r=srn(t,void 0,e);return{...r,parent:e,getToken:srn("=> getToken()",r,e)}}a(lo,"credentialLogger");p();p();p();p();var ece={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function arn(t={}){let e=new Q5t(t.parentContext);return t.span&&(e=e.setValue(ece.span,t.span)),t.namespace&&(e=e.setValue(ece.namespace,t.namespace)),e}a(arn,"createTracingContext");var Q5t=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 crn=de(q5t(),1),Pje=crn.state;function y1o(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(y1o,"createDefaultTracingSpan");function E1o(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:y1o(),tracingContext:arn({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(E1o,"createDefaultInstrumenter");function uSe(){return Pje.instrumenterImplementation||(Pje.instrumenterImplementation=E1o()),Pje.instrumenterImplementation}a(uSe,"getInstrumenter");p();function dSe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=uSe().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(ece.namespace)||(A=A.setValue(ece.namespace,e)),y.setAttribute("az.namespace",A.getValue(ece.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}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 uSe().withContext(d,f,...h)}a(c,"withContext");function l(d){return uSe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return uSe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(dSe,"createTracingClient");var Mc=dSe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:vje});var j5t=lo("ChainedTokenCredential"),fSe=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 Mc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new lSe(s,"ChainedTokenCredential authentication failed.");throw j5t.getToken.info(Us(e,l)),l}if(j5t.getToken.info(`Result for ${o.constructor.name}: ${e0(e)}`),n===null)throw new Mn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var _S={};ki(_S,{AuthError:()=>Fo,AuthErrorCodes:()=>vce,AzureCloudInstance:()=>l3,ClientAssertion:()=>p3,ClientAuthError:()=>G7,ClientAuthErrorCodes:()=>$p,ClientConfigurationError:()=>cce,ClientConfigurationErrorCodes:()=>uce,ConfidentialClientApplication:()=>Fce,CryptoProvider:()=>jM,DistributedCachePlugin:()=>mGe,InteractionRequiredAuthError:()=>AS,InteractionRequiredAuthErrorCodes:()=>fHe,LogLevel:()=>mf,Logger:()=>r0,ManagedIdentityApplication:()=>Uce,ManagedIdentitySourceNames:()=>no,PromptValue:()=>f2o,ProtocolMode:()=>Xy,PublicClientApplication:()=>Lce,ResponseMode:()=>p2o,ServerError:()=>k_,TokenCache:()=>Sce,TokenCacheContext:()=>mS,internals:()=>mBt,version:()=>ES});p();var mBt={};ki(mBt,{Deserializer:()=>f3,Serializer:()=>q7});p();p();var q7=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 an={};ki(an,{addApplicationTelemetry:()=>ISe,addAuthorizationCode:()=>HLt,addBrokerParameters:()=>c3,addCcsOid:()=>s3,addCcsUpn:()=>$7,addClaims:()=>uY,addCliData:()=>VLt,addClientAssertion:()=>RSe,addClientAssertionType:()=>kSe,addClientCapabilitiesToClaims:()=>prn,addClientId:()=>cY,addClientInfo:()=>fY,addClientSecret:()=>wSe,addCodeChallengeParams:()=>TSo,addCodeVerifier:()=>$Lt,addCorrelationId:()=>dY,addDeviceCode:()=>ISo,addDomainHint:()=>QLt,addEARParameters:()=>PSo,addExtraParameters:()=>a3,addGrantType:()=>PSe,addIdTokenHint:()=>ULt,addInstanceAware:()=>DSe,addLibraryInfo:()=>TSe,addLoginHint:()=>fce,addLogoutHint:()=>WLt,addNativeBroker:()=>SSo,addNonce:()=>jLt,addOboAssertion:()=>xSo,addPassword:()=>kSo,addPopToken:()=>NSe,addPostLogoutRedirectUri:()=>FLt,addPrompt:()=>qLt,addRedirectUri:()=>lY,addRefreshToken:()=>GLt,addRequestTokenUse:()=>wSo,addResource:()=>BSe,addResponseMode:()=>BLt,addResponseType:()=>bSo,addScopes:()=>aY,addServerTelemetry:()=>OSe,addSid:()=>tHe,addSshJwk:()=>MSe,addState:()=>xSe,addThrottling:()=>LSe,addUsername:()=>RSo,instrumentBrokerParams:()=>sY});p();var er={};ki(er,{AADAuthority:()=>fP,AAD_INSTANCE_DISCOVERY_ENDPT:()=>W5t,AAD_TENANT_DOMAIN_SUFFIX:()=>z5t,ADFS:()=>$5t,APP_METADATA:()=>oce,AUTHORITY_METADATA_CACHE_KEY:()=>sce,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>u4t,AUTHORIZATION_PENDING:()=>b1o,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>Z5t,AuthenticationScheme:()=>hf,AuthorityMetadataSource:()=>Zy,CACHE_ACCOUNT_TYPE_ADFS:()=>c4t,CACHE_ACCOUNT_TYPE_GENERIC:()=>Uje,CACHE_ACCOUNT_TYPE_MSAV1:()=>j1o,CACHE_ACCOUNT_TYPE_MSSTS:()=>a4t,CACHE_KEY_SEPARATOR:()=>tY,CIAM_AUTH_URL:()=>Dje,CLIENT_INFO:()=>l4t,CLIENT_INFO_SEPARATOR:()=>ice,CLIENT_MISMATCH_ERROR:()=>_4t,CODE_GRANT_TYPE:()=>v1o,CONSUMER_UTID:()=>_1o,CacheOutcome:()=>pP,CacheType:()=>H1o,ClaimsRequestKeys:()=>nce,CodeChallengeMethodValues:()=>Q1o,CredentialType:()=>t0,DEFAULT_AUTHORITY:()=>lrn,DEFAULT_AUTHORITY_HOST:()=>G5t,DEFAULT_COMMON_TENANT:()=>pSe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>A4t,DEFAULT_THROTTLE_TIME_SECONDS:()=>g4t,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>v4t,DSTS:()=>V5t,EMAIL_SCOPE:()=>frn,EncodingTypes:()=>W1o,FORWARD_SLASH:()=>tce,GrantType:()=>gSe,HTTP_BAD_REQUEST:()=>Bje,HTTP_CLIENT_ERROR:()=>w1o,HTTP_CLIENT_ERROR_RANGE_END:()=>n4t,HTTP_CLIENT_ERROR_RANGE_START:()=>r4t,HTTP_GATEWAY_TIMEOUT:()=>L1o,HTTP_GONE:()=>D1o,HTTP_MULTI_SIDED_ERROR:()=>B1o,HTTP_NOT_FOUND:()=>k1o,HTTP_REDIRECT:()=>x1o,HTTP_REQUEST_TIMEOUT:()=>P1o,HTTP_SERVER_ERROR:()=>M1o,HTTP_SERVER_ERROR_RANGE_END:()=>o4t,HTTP_SERVER_ERROR_RANGE_START:()=>i4t,HTTP_SERVICE_UNAVAILABLE:()=>O1o,HTTP_SUCCESS:()=>Lje,HTTP_SUCCESS_RANGE_END:()=>I1o,HTTP_SUCCESS_RANGE_START:()=>T1o,HTTP_TOO_MANY_REQUESTS:()=>N1o,HTTP_UNAUTHORIZED:()=>R1o,HeaderNames:()=>Gp,HttpMethod:()=>F1o,IMDS_ENDPOINT:()=>Oje,IMDS_TIMEOUT:()=>J5t,IMDS_VERSION:()=>K5t,INVALID_GRANT_ERROR:()=>E4t,INVALID_INSTANCE:()=>t4t,JsonWebTokenTypes:()=>$1o,KNOWN_PUBLIC_CLOUDS:()=>e4t,NOT_APPLICABLE:()=>hSe,NOT_AVAILABLE:()=>eY,OAuthResponseType:()=>q1o,OFFLINE_ACCESS_SCOPE:()=>Mje,OIDC_DEFAULT_SCOPES:()=>rce,OIDC_SCOPES:()=>Fje,ONE_DAY_IN_MS:()=>V1o,OPENID_SCOPE:()=>urn,PROFILE_SCOPE:()=>drn,PasswordGrantConstants:()=>jje,PersistentCacheKeys:()=>U1o,PromptValue:()=>mSe,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>X5t,RESOURCE_DELIM:()=>Nje,RegionDiscoveryOutcomes:()=>ESe,RegionDiscoverySources:()=>H7,ResponseMode:()=>s4t,S256_CODE_CHALLENGE_METHOD:()=>C1o,SERVER_TELEM_CACHE_KEY:()=>ASe,SERVER_TELEM_CATEGORY_SEPARATOR:()=>qje,SERVER_TELEM_MAX_CACHED_ERRORS:()=>f4t,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>G1o,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>d4t,SERVER_TELEM_OVERFLOW_FALSE:()=>h4t,SERVER_TELEM_OVERFLOW_TRUE:()=>p4t,SERVER_TELEM_SCHEMA_VERSION:()=>Qje,SERVER_TELEM_UNKNOWN_ERROR:()=>m4t,SERVER_TELEM_VALUE_SEPARATOR:()=>j7,SHR_NONCE_VALIDITY:()=>S1o,SKU:()=>H5t,THE_FAMILY_ID:()=>rY,THROTTLING_PREFIX:()=>ySe,URL_FORM_CONTENT_TYPE:()=>Y5t,X_MS_LIB_CAPABILITY_VALUE:()=>y4t});p();var H5t="msal.js.common",lrn="https://login.microsoftonline.com/common/",G5t="login.microsoftonline.com",pSe="common",$5t="adfs",V5t="dstsv2",W5t=`${lrn}discovery/instance?api-version=1.1&authorization_endpoint=`,Dje=".ciamlogin.com",z5t=".onmicrosoft.com",Nje="|",_1o="9188040d-6c67-4c5b-b112-36a304b66dad",urn="openid",drn="profile",Mje="offline_access",frn="email",v1o="authorization_code",C1o="S256",Y5t="application/x-www-form-urlencoded;charset=utf-8",b1o="authorization_pending",hSe="N/A",eY="Not Available",tce="/",Oje="http://169.254.169.254/metadata/instance/compute/location",K5t="2020-06-01",J5t=2e3,Z5t="TryAutoDetect",X5t="login.microsoft.com",e4t=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],S1o=240,t4t="invalid_instance",Lje=200,T1o=200,I1o=299,x1o=302,w1o=400,r4t=400,Bje=400,R1o=401,k1o=404,P1o=408,D1o=410,N1o=429,n4t=499,M1o=500,i4t=500,O1o=503,L1o=504,o4t=599,B1o=600,F1o={GET:"GET",POST:"POST"},rce=[urn,drn,Mje],Fje=[...rce,frn],Gp={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"},U1o={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},fP={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},nce={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},mSe={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},Q1o={PLAIN:"plain",S256:"S256"},q1o={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},s4t={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},gSe={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"},a4t="MSSTS",c4t="ADFS",j1o="MSA",Uje="Generic",tY="-",ice=".",t0={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},H1o={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},oce="appmetadata",l4t="client_info",rY="1",sce="authority-metadata",u4t=3600*24,Zy={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},Qje=5,G1o=80,d4t=330,f4t=50,ASe="server-telemetry",qje="|",j7=",",p4t="1",h4t="0",m4t="unknown_error",hf={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},g4t=60,A4t=3600,ySe="throttling",y4t="retry-after, h429",E4t="invalid_grant",_4t="client_mismatch",jje={username:"username",password:"password"},H7={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},ESe={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},pP={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},$1o={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},V1o=864e5,v4t=300,W1o={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var nY={};ki(nY,{ACCESS_TOKEN:()=>K1o,BROKER_CLIENT_ID:()=>_Se,BROKER_REDIRECT_URI:()=>Wje,CCS_HEADER:()=>iSo,CLAIMS:()=>T4t,CLIENT_ASSERTION:()=>Y4t,CLIENT_ASSERTION_TYPE:()=>K4t,CLIENT_ID:()=>FM,CLIENT_INFO:()=>tSo,CLIENT_REQUEST_ID:()=>O4t,CLIENT_SECRET:()=>z4t,CLI_DATA:()=>aLt,CODE:()=>P4t,CODE_CHALLENGE:()=>D4t,CODE_CHALLENGE_METHOD:()=>N4t,CODE_VERIFIER:()=>M4t,DEVICE_CODE:()=>W4t,DOMAIN_HINT:()=>nLt,EAR_JWE_CRYPTO:()=>oLt,EAR_JWK:()=>iLt,ERROR:()=>z1o,ERROR_DESCRIPTION:()=>Y1o,EXPIRES_IN:()=>Z1o,FOCI:()=>nSo,GRANT_TYPE:()=>S4t,ID_TOKEN:()=>J1o,ID_TOKEN_HINT:()=>V4t,INSTANCE_AWARE:()=>ace,LOGIN_HINT:()=>rLt,LOGOUT_HINT:()=>eLt,NATIVE_BROKER:()=>X4t,NONCE:()=>R4t,OBO_ASSERTION:()=>J4t,ON_BEHALF_OF:()=>rSo,POST_LOGOUT_URI:()=>$4t,PROMPT:()=>k4t,REDIRECT_URI:()=>Hje,REFRESH_TOKEN:()=>x4t,REFRESH_TOKEN_EXPIRES_IN:()=>X1o,REQUESTED_TOKEN_USE:()=>Z4t,REQ_CNF:()=>$je,RESOURCE:()=>sLt,RESPONSE_MODE:()=>b4t,RESPONSE_TYPE:()=>C4t,RETURN_SPA_CODE:()=>Vje,SCOPE:()=>I4t,SESSION_STATE:()=>eSo,SID:()=>tLt,STATE:()=>w4t,TOKEN_TYPE:()=>Gje,X_APP_NAME:()=>H4t,X_APP_VER:()=>G4t,X_CLIENT_CPU:()=>U4t,X_CLIENT_CURR_TELEM:()=>Q4t,X_CLIENT_EXTRA_SKU:()=>oSo,X_CLIENT_LAST_TELEM:()=>q4t,X_CLIENT_OS:()=>F4t,X_CLIENT_SKU:()=>L4t,X_CLIENT_VER:()=>B4t,X_MS_LIB_CAPABILITY:()=>j4t});p();var FM="client_id",Hje="redirect_uri",C4t="response_type",b4t="response_mode",S4t="grant_type",T4t="claims",I4t="scope",z1o="error",Y1o="error_description",K1o="access_token",J1o="id_token",x4t="refresh_token",Z1o="expires_in",X1o="refresh_token_expires_in",w4t="state",R4t="nonce",k4t="prompt",eSo="session_state",tSo="client_info",P4t="code",D4t="code_challenge",N4t="code_challenge_method",M4t="code_verifier",O4t="client-request-id",L4t="x-client-SKU",B4t="x-client-VER",F4t="x-client-OS",U4t="x-client-CPU",Q4t="x-client-current-telemetry",q4t="x-client-last-telemetry",j4t="x-ms-lib-capability",H4t="x-app-name",G4t="x-app-ver",$4t="post_logout_redirect_uri",V4t="id_token_hint",W4t="device_code",z4t="client_secret",Y4t="client_assertion",K4t="client_assertion_type",Gje="token_type",$je="req_cnf",J4t="assertion",Z4t="requested_token_use",rSo="on_behalf_of",nSo="foci",iSo="X-AnchorMailbox",Vje="return_spa_code",X4t="nativebroker",eLt="logout_hint",tLt="sid",rLt="login_hint",nLt="domain_hint",oSo="x-client-xtra-sku",_Se="brk_client_id",Wje="brk_redirect_uri",ace="instance_aware",iLt="ear_jwk",oLt="ear_jwe_crypto",sLt="resource",aLt="clidata";p();p();p();function zje(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(zje,"getDefaultErrorMessage");var Fo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?zje(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 iY(t,e){return new Fo(t,e||zje(t))}a(iY,"createAuthError");var cce=class t extends Fo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function vl(t){return new cce(t)}a(vl,"createClientConfigurationError");p();var fu=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 G7=class t extends Fo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function kt(t,e){return new G7(t,e)}a(kt,"createClientAuthError");var uce={};ki(uce,{authorityMismatch:()=>pSo,authorityUriInsecure:()=>lLt,cannotAllowPlatformBroker:()=>fSo,cannotSetOIDCOptions:()=>dSo,claimsRequestParsingError:()=>sSo,emptyInputScopesError:()=>dLt,invalidAuthenticationHeader:()=>uSo,invalidAuthorityMetadata:()=>mLt,invalidClaims:()=>Yje,invalidCloudDiscoveryMetadata:()=>Kje,invalidCodeChallengeMethod:()=>aSo,invalidRequestMethodForEAR:()=>hSo,logoutRequestEmpty:()=>pLt,missingNonceAuthenticationHeader:()=>lSo,missingSshJwk:()=>vSe,missingSshKid:()=>cSo,pkceParamsMissing:()=>hLt,redirectUriEmpty:()=>cLt,tokenRequestEmpty:()=>fLt,untrustedAuthority:()=>gLt,urlEmptyError:()=>uLt,urlParseError:()=>lce});p();var cLt="redirect_uri_empty",sSo="claims_request_parsing_error",lLt="authority_uri_insecure",lce="url_parse_error",uLt="empty_url_error",dLt="empty_input_scopes_error",Yje="invalid_claims",fLt="token_request_empty",pLt="logout_request_empty",aSo="invalid_code_challenge_method",hLt="pkce_params_missing",Kje="invalid_cloud_discovery_metadata",mLt="invalid_authority_metadata",gLt="untrusted_authority",vSe="missing_ssh_jwk",cSo="missing_ssh_kid",lSo="missing_nonce_authentication_header",uSo="invalid_authentication_header",dSo="cannot_set_OIDCOptions",fSo="cannot_allow_platform_broker",pSo="authority_mismatch",hSo="invalid_request_method_for_EAR";var $p={};ki($p,{authTimeNotFound:()=>CSe,authorizationCodeMissingFromServerResponse:()=>DLt,bindingKeyNotRemoved:()=>ySo,cannotAppendScopeSet:()=>wLt,cannotRemoveEmptyScope:()=>xLt,clientInfoDecodingError:()=>Jje,clientInfoEmptyError:()=>ALt,emptyInputScopeSet:()=>eHe,endSessionEndpointNotSupported:()=>NLt,endpointResolutionError:()=>hP,hashNotDeserialized:()=>vLt,invalidCacheEnvironment:()=>SSe,invalidCacheRecord:()=>RLt,invalidState:()=>oY,keyIdMissing:()=>MLt,maxAgeTranspired:()=>SLt,methodNotImplemented:()=>Ts,misplacedResourceParam:()=>LLt,multipleMatchingAppMetadata:()=>TLt,multipleMatchingTokens:()=>mSo,nestedAppAuthBridgeDisabled:()=>vSo,networkError:()=>ELt,noAccountFound:()=>gSo,noAccountInSilentRequest:()=>bSe,noCryptoObject:()=>kLt,noNetworkConnectivity:()=>ESo,nonceMismatch:()=>bLt,nullOrEmptyToken:()=>yLt,openIdConfigError:()=>_Lt,platformBrokerError:()=>CSo,requestCannotBeMade:()=>ILt,resourceParameterRequired:()=>OLt,stateMismatch:()=>CLt,stateNotFound:()=>Xje,tokenClaimsCnfRequiredForSignedJwt:()=>PLt,tokenParsingError:()=>Zje,tokenRefreshRequired:()=>dce,unexpectedCredentialType:()=>ASo,userCanceled:()=>_So});p();var Jje="client_info_decoding_error",ALt="client_info_empty_error",Zje="token_parsing_error",yLt="null_or_empty_token",hP="endpoints_resolution_error",ELt="network_error",_Lt="openid_config_error",vLt="hash_not_deserialized",oY="invalid_state",CLt="state_mismatch",Xje="state_not_found",bLt="nonce_mismatch",CSe="auth_time_not_found",SLt="max_age_transpired",mSo="multiple_matching_tokens",TLt="multiple_matching_appMetadata",ILt="request_cannot_be_made",xLt="cannot_remove_empty_scope",wLt="cannot_append_scopeset",eHe="empty_input_scopeset",bSe="no_account_in_silent_request",RLt="invalid_cache_record",SSe="invalid_cache_environment",gSo="no_account_found",kLt="no_crypto_object",ASo="unexpected_credential_type",dce="token_refresh_required",PLt="token_claims_cnf_required_for_signedjwt",DLt="authorization_code_missing_from_server_response",ySo="binding_key_not_removed",NLt="end_session_endpoint_not_supported",MLt="key_id_missing",ESo="no_network_connectivity",_So="user_canceled",Ts="method_not_implemented",vSo="nested_app_auth_bridge_disabled",CSo="platform_broker_error",OLt="resource_parameter_required",LLt="misplaced_resource_parameter";var Uh=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?fu.trimArrayEntries([...e]):[],n=r?fu.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw vl(dLt);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:[...rce],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(Mje):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 Fje.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 kt(wLt)}}removeScope(e){if(!e)throw kt(xLt);this.scopes.delete(e.trim())}removeOIDCScopes(){Fje.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw kt(eHe);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 kt(eHe);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 sY(t,e,r){if(!e)return;let n=t.get(FM);n&&t.has(_Se)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(Hje)},e)}a(sY,"instrumentBrokerParams");function bSo(t,e){t.set(C4t,e)}a(bSo,"addResponseType");function BLt(t,e){t.set(b4t,e||s4t.QUERY)}a(BLt,"addResponseMode");function SSo(t){t.set(X4t,"1")}a(SSo,"addNativeBroker");function aY(t,e,r=!0,n=rce){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new Uh(o);t.set(I4t,s.printScopes())}a(aY,"addScopes");function cY(t,e){t.set(FM,e)}a(cY,"addClientId");function lY(t,e){t.set(Hje,e)}a(lY,"addRedirectUri");function FLt(t,e){t.set($4t,e)}a(FLt,"addPostLogoutRedirectUri");function ULt(t,e){t.set(V4t,e)}a(ULt,"addIdTokenHint");function QLt(t,e){t.set(nLt,e)}a(QLt,"addDomainHint");function fce(t,e){t.set(rLt,e)}a(fce,"addLoginHint");function $7(t,e){t.set(Gp.CCS_HEADER,`UPN:${e}`)}a($7,"addCcsUpn");function s3(t,e){t.set(Gp.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(s3,"addCcsOid");function tHe(t,e){t.set("sid",e)}a(tHe,"addSid");function uY(t,e,r){let n=prn(e,r);try{JSON.parse(n)}catch{throw vl(Yje)}t.set(T4t,n)}a(uY,"addClaims");function dY(t,e){t.set(O4t,e)}a(dY,"addCorrelationId");function TSe(t,e){t.set(L4t,e.sku),t.set(B4t,e.version),e.os&&t.set(F4t,e.os),e.cpu&&t.set(U4t,e.cpu)}a(TSe,"addLibraryInfo");function ISe(t,e){e?.appName&&t.set(H4t,e.appName),e?.appVersion&&t.set(G4t,e.appVersion)}a(ISe,"addApplicationTelemetry");function qLt(t,e){t.set(k4t,e)}a(qLt,"addPrompt");function xSe(t,e){e&&t.set(w4t,e)}a(xSe,"addState");function jLt(t,e){t.set(R4t,e)}a(jLt,"addNonce");function TSo(t,e,r){if(e&&r)t.set(D4t,e),t.set(N4t,r);else throw vl(hLt)}a(TSo,"addCodeChallengeParams");function HLt(t,e){t.set(P4t,e)}a(HLt,"addAuthorizationCode");function ISo(t,e){t.set(W4t,e)}a(ISo,"addDeviceCode");function GLt(t,e){t.set(x4t,e)}a(GLt,"addRefreshToken");function $Lt(t,e){t.set(M4t,e)}a($Lt,"addCodeVerifier");function wSe(t,e){t.set(z4t,e)}a(wSe,"addClientSecret");function RSe(t,e){e&&t.set(Y4t,e)}a(RSe,"addClientAssertion");function kSe(t,e){e&&t.set(K4t,e)}a(kSe,"addClientAssertionType");function xSo(t,e){t.set(J4t,e)}a(xSo,"addOboAssertion");function wSo(t,e){t.set(Z4t,e)}a(wSo,"addRequestTokenUse");function PSe(t,e){t.set(S4t,e)}a(PSe,"addGrantType");function fY(t){t.set(l4t,"1")}a(fY,"addClientInfo");function VLt(t){t.set(aLt,"1")}a(VLt,"addCliData");function DSe(t){t.has(ace)||t.set(ace,"true")}a(DSe,"addInstanceAware");function a3(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(a3,"addExtraParameters");function prn(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw vl(Yje)}return e&&e.length>0&&(r.hasOwnProperty(nce.ACCESS_TOKEN)||(r[nce.ACCESS_TOKEN]={}),r[nce.ACCESS_TOKEN][nce.XMS_CC]={values:e}),JSON.stringify(r)}a(prn,"addClientCapabilitiesToClaims");function RSo(t,e){t.set(jje.username,e)}a(RSo,"addUsername");function kSo(t,e){t.set(jje.password,e)}a(kSo,"addPassword");function NSe(t,e){e&&(t.set(Gje,hf.POP),t.set($je,e))}a(NSe,"addPopToken");function MSe(t,e){e&&(t.set(Gje,hf.SSH),t.set($je,e))}a(MSe,"addSshJwk");function OSe(t,e){t.set(Q4t,e.generateCurrentRequestHeaderValue()),t.set(q4t,e.generateLastRequestHeaderValue())}a(OSe,"addServerTelemetry");function LSe(t){t.set(j4t,y4t)}a(LSe,"addThrottling");function WLt(t,e){t.set(eLt,e)}a(WLt,"addLogoutHint");function c3(t,e,r){t.has(_Se)||t.set(_Se,e),t.has(Wje)||t.set(Wje,r)}a(c3,"addBrokerParameters");function PSo(t,e){t.set(iLt,encodeURIComponent(e)),t.set(oLt,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(PSo,"addEARParameters");function BSe(t,e){e&&t.set(sLt,e)}a(BSe,"addResource");var CA={};ki(CA,{getDeserializedResponse:()=>DSo,mapToQueryString:()=>UM,normalizeUrlForComparison:()=>NSo,stripLeadingHashOrQuery:()=>mrn});p();function hrn(t){if(!t)return t;let e=t.toLowerCase();return fu.endsWith(e,"?")?e=e.slice(0,-1):fu.endsWith(e,"?/")&&(e=e.slice(0,-2)),fu.endsWith(e,"/")||(e+="/"),e}a(hrn,"canonicalizeUrl");function mrn(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(mrn,"stripLeadingHashOrQuery");function DSo(t){if(!t||t.indexOf("=")<0)return null;try{let e=mrn(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw kt(vLt)}return null}a(DSo,"getDeserializedResponse");function UM(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(UM,"mapToQueryString");function NSo(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return hrn(n)}catch{return hrn(e)}}a(NSo,"normalizeUrlForComparison");p();p();var pce={createNewGuid:a(()=>{throw kt(Ts)},"createNewGuid"),base64Decode:a(()=>{throw kt(Ts)},"base64Decode"),base64Encode:a(()=>{throw kt(Ts)},"base64Encode"),base64UrlEncode:a(()=>{throw kt(Ts)},"base64UrlEncode"),encodeKid:a(()=>{throw kt(Ts)},"encodeKid"),async getPublicKeyThumbprint(){throw kt(Ts)},async removeTokenBindingKey(){throw kt(Ts)},async clearKeystore(){throw kt(Ts)},async signJwt(){throw kt(Ts)},async hashString(){throw kt(Ts)}};p();var mf;(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"})(mf||(mf={}));var MSo=50,OSo=500,pY=new Map;function LSo(t,e){pY.delete(t),pY.set(t,e)}a(LSo,"markAsRecentlyUsed");function BSo(t,e){let r=Date.now(),n=pY.get(t);if(n)LSo(t,n);else if(n={logs:[],firstEventTime:r},pY.set(t,n),pY.size>MSo){let o=pY.keys().next().value;o&&pY.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>OSo&&n.logs.shift()}a(BSo,"addLogToCache");function FSo(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(FSo,"isHashedString");var r0=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=mf.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:mf.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.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(FSo(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};BSo(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${mf[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:mf.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:mf.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:mf.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:mf.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:mf.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:mf.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:mf.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:mf.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:mf.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:mf.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var V7="@azure/msal-common",QM="16.4.1";p();var l3={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 grn(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(grn,"tenantIdMatchesHomeTenant");function hY(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:grn(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:grn(r,t)}}a(hY,"buildTenantProfile");function rHe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=hY(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(rHe,"updateAccountTenantProfileData");var nHe={};ki(nHe,{checkMaxAge:()=>FSe,extractTokenClaims:()=>u3,getJWSPayload:()=>Arn,isKmsi:()=>zLt});p();function u3(t,e){let r=Arn(t);try{let n=e(r);return JSON.parse(n)}catch{throw kt(Zje)}}a(u3,"extractTokenClaims");function zLt(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(zLt,"isKmsi");function Arn(t){if(!t)throw kt(yLt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw kt(Zje);return r[2]}a(Arn,"getJWSPayload");function FSe(t,e){if(e===0||Date.now()-3e5>t+e)throw kt(SLt)}a(FSe,"checkMaxAge");p();p();var Is=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw vl(uLt);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return fu.endsWith(r,"?")?r=r.slice(0,-1):fu.endsWith(r,"?/")&&(r=r.slice(0,-2)),fu.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw vl(lce)}if(!e.HostNameAndPort||!e.PathSegments)throw vl(lce);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw vl(lLt)}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]===fP.COMMON||n[0]===fP.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw vl(lce);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 vl(lce);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===tce){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 USo=[{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 QSo(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(QSo,"buildOpenIdConfig");var qSo=USo.reduce((t,{host:e,issuerHost:r})=>(t[e]=QSo(e,r||e),t),{}),Ern={endpointMetadata:qSo,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"]}]}},YLt=Ern.endpointMetadata,KLt=Ern.instanceDiscoveryMetadata,JLt=new Set;KLt.metadata.forEach(t=>{t.aliases.forEach(e=>{JLt.add(e)})});function _rn(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new Is(o).getUrlComponents().HostNameAndPort;n=yrn(e,r,s,t.cloudDiscoveryMetadata?.metadata,Zy.CONFIG)||yrn(e,r,s,KLt.metadata,Zy.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(_rn,"getAliasesFromStaticSources");function yrn(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=USe(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(yrn,"getAliasesFromMetadata");function vrn(t){return USe(KLt.metadata,t)}a(vrn,"getCloudDiscoveryMetadataFromHardcodedValues");function USe(t,e){for(let r=0;rZLt,createAccountEntityFromAccountInfo:()=>GSo,generateAccountId:()=>jSo,generateHomeAccountId:()=>XLt,getAccountInfo:()=>mce,isAccountEntity:()=>$So,isSingleTenant:()=>HSo});p();p();function hce(t,e){if(!t)throw kt(ALt);try{let r=e(t);return JSON.parse(r)}catch{throw kt(Jje)}}a(hce,"buildClientInfo");function qM(t){if(!t)throw kt(Jje);let e=t.split(ice,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(qM,"buildClientInfoFromHomeAccountId");p();var Sx={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function iHe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(iHe,"getTenantIdFromIdTokenClaims");p();var Xy={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function jSo(t){return[t.homeAccountId,t.environment].join(tY).toLowerCase()}a(jSo,"generateAccountId");function mce(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(hY(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(mce,"getAccountInfo");function HSo(t){return!t.tenantProfiles}a(HSo,"isSingleTenant");function ZLt(t,e,r){let n;e.authorityType===Sx.Adfs?n=c4t:e.protocolMode===Xy.OIDC?n=Uje:n=a4t;let o,s;t.clientInfo&&r&&(o=hce(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw kt(SSe);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||iHe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[hY(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(ZLt,"createAccountEntity");function GSo(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(hY(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||Uje,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(GSo,"createAccountEntityFromAccountInfo");function XLt(t,e,r,n,o,s){if(!(e===Sx.Adfs||e===Sx.Dsts)){if(t)try{let c=hce(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(XLt,"generateHomeAccountId");function $So(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a($So,"isAccountEntity");var W7=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(V7,QM),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?mce(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=u3(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=rHe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=mce(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 kt(RLt);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 Fo?c:Srn(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=Uh.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)&&Uh.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===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===hf.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()===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===hf.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:t0.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=Uh.createSearchScopes(r.scopes),l=r.authenticationScheme||hf.BEARER,u=l&&l.toLowerCase()!==hf.BEARER.toLowerCase()?t0.ACCESS_TOKEN_WITH_AUTH_SCHEME:t0.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?rY:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:t0.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 kt(TLt);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===rY)}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=_rn(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!==t0.ACCESS_TOKEN&&e.credentialType!==t0.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Uh.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(oce)!==-1}isAuthorityMetadata(e){return e.indexOf(sce)!==-1}generateAuthorityMetadataCacheKey(e){return`${sce}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},qSe=class extends W7{static{a(this,"DefaultStorageClass")}async setAccount(){throw kt(Ts)}getAccount(){throw kt(Ts)}async setIdTokenCredential(){throw kt(Ts)}getIdTokenCredential(){throw kt(Ts)}async setAccessTokenCredential(){throw kt(Ts)}getAccessTokenCredential(){throw kt(Ts)}async setRefreshTokenCredential(){throw kt(Ts)}getRefreshTokenCredential(){throw kt(Ts)}setAppMetadata(){throw kt(Ts)}getAppMetadata(){throw kt(Ts)}setServerTelemetry(){throw kt(Ts)}getServerTelemetry(){throw kt(Ts)}setAuthorityMetadata(){throw kt(Ts)}getAuthorityMetadata(){throw kt(Ts)}getAuthorityMetadataKeys(){throw kt(Ts)}setThrottlingCache(){throw kt(Ts)}getThrottlingCache(){throw kt(Ts)}removeItem(){throw kt(Ts)}getKeys(){throw kt(Ts)}getAccountKeys(){throw kt(Ts)}getTokenKeys(){throw kt(Ts)}generateCredentialKey(){throw kt(Ts)}generateAccountKey(){throw kt(Ts)}};p();p();var Trn={NotStarted:0,InProgress:1,Completed:2};var Qh=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:Trn.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 Irn={tokenRenewalOffsetSeconds:v4t,preventCorsPreflight:!1},VSo={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.Info,correlationId:""},WSo={async sendGetRequestAsync(){throw kt(Ts)},async sendPostRequestAsync(){throw kt(Ts)}},zSo={sku:H5t,version:QM,cpu:"",os:""},YSo={clientSecret:"",clientAssertion:void 0},KSo={azureCloudInstance:l3.None,tenant:`${pSe}`},JSo={application:{appName:"",appVersion:""}};function d3({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={...VSo,...r};return{authOptions:ZSo(t),systemOptions:{...Irn,...e},loggerOptions:m,storageInterface:n||new qSe(t.clientId,pce,new r0(m),new Qh),networkInterface:o||WSo,cryptoInterface:s||pce,clientCredentials:c||YSo,libraryInfo:{...zSo,...l},telemetry:{...JSo,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a(d3,"buildClientConfiguration");function ZSo(t){return{clientCapabilities:[],azureCloudOptions:KSo,instanceAware:!1,isMcp:!1,...t}}a(ZSo,"buildAuthOptions");function oHe(t){return t.authOptions.authority.options.protocolMode===Xy.OIDC}a(oHe,"isOidcProtocolMode");p();p();var mS=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 R_={};ki(R_,{createAccessTokenEntity:()=>rBt,createIdTokenEntity:()=>tBt,createRefreshTokenEntity:()=>nBt,generateAppMetadataKey:()=>aTo,generateAuthorityMetadataExpiresAt:()=>aHe,isAccessTokenEntity:()=>rTo,isAppMetadataEntity:()=>cTo,isAuthorityMetadataEntity:()=>lTo,isAuthorityMetadataExpired:()=>cHe,isCredentialEntity:()=>sHe,isIdTokenEntity:()=>nTo,isRefreshTokenEntity:()=>iTo,isServerTelemetryEntity:()=>oTo,isThrottlingEntity:()=>sTo,updateAuthorityEndpointMetadata:()=>Ace,updateCloudDiscoveryMetadata:()=>HSe});p();var Yu={};ki(Yu,{delay:()=>tTo,isCacheExpired:()=>eTo,isTokenExpired:()=>gce,nowSeconds:()=>gS,toDateFromSeconds:()=>jSe,toSecondsFromDate:()=>XSo,wasClockTurnedBack:()=>eBt});p();function gS(){return Math.round(new Date().getTime()/1e3)}a(gS,"nowSeconds");function XSo(t){return t.getTime()/1e3}a(XSo,"toSecondsFromDate");function jSe(t){return t?new Date(Number(t)*1e3):new Date}a(jSe,"toDateFromSeconds");function gce(t,e){let r=Number(t)||0;return gS()+e>r}a(gce,"isTokenExpired");function eTo(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(eTo,"isCacheExpired");function eBt(t){return Number(t)>gS()}a(eBt,"wasClockTurnedBack");function tTo(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(tTo,"delay");function tBt(t,e,r,n,o){return{credentialType:t0.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(tBt,"createIdTokenEntity");function rBt(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:t0.ACCESS_TOKEN,secret:r,cachedAt:gS().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||hf.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==hf.BEARER.toLowerCase())switch(g.credentialType=t0.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case hf.POP:let A=u3(r,u);if(!A?.cnf?.kid)throw kt(PLt);g.keyId=A.cnf.kid;break;case hf.SSH:g.keyId=m}return g}a(rBt,"createAccessTokenEntity");function nBt(t,e,r,n,o,s,c){let l={credentialType:t0.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(nBt,"createRefreshTokenEntity");function sHe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(sHe,"isCredentialEntity");function rTo(t){return t?sHe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===t0.ACCESS_TOKEN||t.credentialType===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(rTo,"isAccessTokenEntity");function nTo(t){return t?sHe(t)&&t.hasOwnProperty("realm")&&t.credentialType===t0.ID_TOKEN:!1}a(nTo,"isIdTokenEntity");function iTo(t){return t?sHe(t)&&t.credentialType===t0.REFRESH_TOKEN:!1}a(iTo,"isRefreshTokenEntity");function oTo(t,e){let r=t.indexOf(ASe)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(oTo,"isServerTelemetryEntity");function sTo(t,e){let r=!1;t&&(r=t.indexOf(ySe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(sTo,"isThrottlingEntity");function aTo({environment:t,clientId:e}){return[oce,t,e].join(tY).toLowerCase()}a(aTo,"generateAppMetadataKey");function cTo(t,e){return e?t.indexOf(oce)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(cTo,"isAppMetadataEntity");function lTo(t,e){return e?t.indexOf(sce)===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(lTo,"isAuthorityMetadataEntity");function aHe(){return gS()+u4t}a(aHe,"generateAuthorityMetadataExpiresAt");function Ace(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(Ace,"updateAuthorityEndpointMetadata");function HSe(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(HSe,"updateCloudDiscoveryMetadata");function cHe(t){return t.expiresAt<=gS()}a(cHe,"isAuthorityMetadataExpired");p();p();var xrn="networkClientSendPostRequestAsync",wrn="refreshTokenClientExecutePostToTokenEndpoint",Rrn="authorizationCodeClientExecutePostToTokenEndpoint",krn="refreshTokenClientExecuteTokenRequest",Prn="refreshTokenClientAcquireToken",lHe="refreshTokenClientAcquireTokenWithCachedRefreshToken",Drn="refreshTokenClientCreateTokenRequestBody",Nrn="silentFlowClientGenerateResultFromCacheRecord";var Mrn="authClientExecuteTokenRequest",Orn="authClientCreateTokenRequestBody",Lrn="updateTokenEndpointAuthority",yce="popTokenGenerateCnf",uHe="handleServerTokenResponse",Brn="authorityResolveEndpointsAsync",Frn="authorityGetCloudDiscoveryMetadataFromNetwork",Urn="authorityUpdateCloudDiscoveryMetadata",Qrn="authorityGetEndpointMetadataFromNetwork",qrn="authorityUpdateEndpointMetadata",iBt="authorityUpdateMetadataWithRegionalInformation",jrn="regionDiscoveryDetectRegion",oBt="regionDiscoveryGetRegionFromIMDS",Hrn="regionDiscoveryGetCurrentVersion",Grn="cacheManagerGetRefreshToken";p();var $rn=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"),Js=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 uTo={SW:"sw"},z7=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await Js(this.generateKid.bind(this),yce,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:uTo.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 Is(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:gS(),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 fHe={};ki(fHe,{badToken:()=>GSe,consentRequired:()=>lBt,interactionRequired:()=>cBt,interruptedUser:()=>dBt,loginRequired:()=>uBt,nativeAccountUnavailable:()=>dTo,noTokensFound:()=>dHe,refreshTokenExpired:()=>sBt,uxNotAllowed:()=>aBt});p();var dHe="no_tokens_found",dTo="native_account_unavailable",sBt="refresh_token_expired",aBt="ux_not_allowed",cBt="interaction_required",lBt="consent_required",uBt="login_required",GSe="bad_token",dBt="interrupted_user";var Vrn=[cBt,lBt,uBt,GSe,aBt,dBt],fTo=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],AS=class t extends Fo{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 pHe(t,e,r){let n=!!t&&Vrn.indexOf(t)>-1,o=!!r&&fTo.indexOf(r)>-1,s=!!e&&Vrn.some(c=>e.indexOf(c)>-1);return n||s||o}a(pHe,"isInteractionRequiredError");function hHe(t,e){return new AS(t,e)}a(hHe,"createInteractionRequiredAuthError");p();var k_=class t extends Fo{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 Wrn(t,e){if(!t)throw kt(kLt);if(!e)throw kt(oY);try{let r=e.split(Nje),n=r[0],o=r.length>1?r.slice(1).join(Nje):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw kt(oY)}}a(Wrn,"parseRequestState");var Vp=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||eY} - Timestamp: ${e.timestamp||eY} - Description: ${e.error_description||eY} - Correlation ID: ${e.correlation_id||eY} - Trace ID: ${e.trace_id||eY}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new k_(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=i4t&&e.status<=o4t){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>=r4t&&e.status<=n4t){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. -${c}`,r);return}throw pHe(e.error,e.error_description,e.suberror)?new AS(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=u3(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw kt(bLt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw kt(CSe);FSe(y,o.maxAge)}}this.homeAccountIdentifier=XLt(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=Wrn(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 mS(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,zLt(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 kt(SSe);let d=iHe(s),f,h;e.id_token&&s&&(f=tBt(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=zrn(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?Uh.fromString(e.scope):new Uh(o.scopes||[]),E=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,_=(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,b=n+E,T=b+_,w=v&&v>0?n+v:void 0;m=rBt(this.homeAccountIdentifier,u,e.access_token,this.clientId,d||r.tenant||"",y.printScopes(),b,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 E=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;y=n+E,this.performanceClient?.addFields({ntwkRtExpiresOnSeconds:y},o.correlationId)}g=nBt(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,E="";if(n.accessToken){if(n.accessToken.tokenType===hf.POP&&!s.popKid){let T=new z7(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw kt(MLt);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=Uh.fromString(n.accessToken.target).asArray(),g=jSe(n.accessToken.expiresOn),A=jSe(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=jSe(n.accessToken.refreshOn))}n.appMetadata&&(E=n.appMetadata.familyId===rY?rY:"");let _=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let b=n.account?rHe(mce(n.account),void 0,l,n.idToken?.secret):null;return{authority:r.canonicalAuthority,uniqueId:_,tenantId:v,scopes:m,account:b,idToken:n?.idToken?.secret||"",idTokenClaims:l||{},accessToken:h,fromCache:o,expiresOn:g,extExpiresOn:A,refreshOn:y,correlationId:s.correlationId,requestId:f||"",familyId:E,tokenType:n.accessToken?.tokenType||"",state:u?u.userRequestState:"",cloudGraphHostName:n.account?.cloudGraphHostName||"",msGraphHost:n.account?.msGraphHost||"",code:d?.spa_code,fromPlatformBroker:!1}}};function zrn(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 E=(A.length===1?A[0]:null)||ZLt({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||E.realm;if(v&&!_.find(b=>b.tenantId===v)){let b=hY(r,E.localAccountId,v,s);_.push(b)}return E.tenantProfiles=_,E}a(zrn,"buildAccountToCache");p();var P_={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};p();async function D_(t,e,r){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:r})}a(D_,"getClientAssertion");p();function Ece(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(Ece,"getRequestThumbprint");var gY={};ki(gY,{createTokenQueryParameters:()=>WSe,createTokenRequestHeaders:()=>VSe,executePostToTokenEndpoint:()=>zSe,sendPostRequest:()=>Yrn});p();p();var $Se=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${ySe}.${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(Gp.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||g4t),n+A4t)*1e3)}static removeThrottle(e,r,n,o){let s=Ece(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var _ce=class t extends Fo{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 fBt(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new _ce(t,e,r)}a(fBt,"createNetworkError");function VSe(t,e,r){let n={};if(n[Gp.CONTENT_TYPE]=Y5t,!e&&r)switch(r.type){case P_.HOME_ACCOUNT_ID:try{let o=qM(r.credential);n[Gp.CCS_HEADER]=`Oid:${o.uid}@${o.utid}`}catch(o){t.verbose(`Could not parse home account ID for CCS Header: '${o}'`,"")}break;case P_.UPN:n[Gp.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(VSe,"createTokenRequestHeaders");function WSe(t,e,r,n){let o=new Map;return t.embeddedClientId&&c3(o,e,r),t.extraQueryParameters&&a3(o,t.extraQueryParameters),dY(o,t.correlationId),sY(o,t.correlationId,n),UM(o)}a(WSe,"createTokenQueryParameters");async function zSe(t,e,r,n,o,s,c,l,u,d){let f=await Yrn(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(zSe,"executePostToTokenEndpoint");async function Yrn(t,e,r,n,o,s,c,l){$Se.preProcess(o,t,n);let u;try{u=await Js(s.sendPostRequestAsync.bind(s),xrn,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[Gp.X_MS_HTTP_VERSION]||"",requestId:d[Gp.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof _ce){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[Gp.X_MS_HTTP_VERSION]||"",requestId:f[Gp.X_MS_REQUEST_ID]||"",contentTypeHeader:f[Gp.CONTENT_TYPE]||void 0,contentLengthHeader:f[Gp.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof Fo?d:kt(ELt)}return $Se.postProcess(o,t,u,n),u}a(Yrn,"sendPostRequest");var gHe={};ki(gHe,{createDiscoveredInstance:()=>hBt});p();p();p();function Krn(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(Krn,"isOpenIdConfigResponse");p();function Jrn(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(Jrn,"isCloudInstanceDiscoveryResponse");p();function Zrn(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(Zrn,"isCloudInstanceDiscoveryErrorResponse");p();var YSe=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=H7.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await Js(this.getRegionFromIMDS.bind(this),oBt,this.logger,this.performanceClient,this.correlationId)(K5t,o);if(s.status===Lje&&(n=s.body,r.region_source=H7.IMDS),s.status===Bje){let c=await Js(this.getCurrentVersion.bind(this),Hrn,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=H7.FAILED_AUTO_DETECTION,null;let l=await Js(this.getRegionFromIMDS.bind(this),oBt,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===Lje&&(n=l.body,r.region_source=H7.IMDS)}}catch{return r.region_source=H7.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=H7.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${Oje}?api-version=${e}&format=text`,r,J5t)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${Oje}?format=json`,e);return r.status===Bje&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};YSe.IMDS_OPTIONS={headers:{Metadata:"true"}};var mP=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 YSe(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(Dje))return Sx.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case $5t:return Sx.Adfs;case V5t:return Sx.Dsts}return Sx.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 Is(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 kt(hP)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw kt(hP)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw kt(hP)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw kt(NLt);return this.replacePath(this.metadata.end_session_endpoint)}else throw kt(hP)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw kt(hP)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw kt(hP)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Sx.Default&&this.protocolMode!==Xy.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new Is(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 Is(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===Sx.Adfs||this.protocolMode===Xy.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 Js(this.updateCloudDiscoveryMetadata.bind(this),Urn,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await Js(this.updateEndpointMetadata.bind(this),qrn,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:aHe(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==Zy.CACHE&&n?.source!==Zy.CACHE&&(e.expiresAt=aHe(),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===Zy.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await Js(this.updateMetadataWithRegionalInformation.bind(this),iBt,this.logger,this.performanceClient,this.correlationId)(r.metadata);Ace(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await Js(this.getEndpointMetadataFromNetwork.bind(this),Qrn,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await Js(this.updateMetadataWithRegionalInformation.bind(this),iBt,this.logger,this.performanceClient,this.correlationId)(n)),Ace(e,n,!0),Zy.NETWORK;throw kt(_Lt,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),Ace(e,r,!1),{source:Zy.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 Ace(e,n,!1),{source:Zy.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=cHe(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:Zy.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new Is(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw vl(mLt)}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 Krn(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 YLt?YLt[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==Z5t)return this.regionDiscoveryMetadata.region_outcome=ESe.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await Js(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),jrn,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=ESe.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=ESe.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await Js(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Frn,this.logger,this.performanceClient,this.correlationId)();if(n)return HSe(e,n,!0),Zy.NETWORK;throw vl(gLt)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||hSe}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||hSe}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||hSe}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),HSe(e,r,!1),Zy.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=vrn(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),HSe(e,n,!1),Zy.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=cHe(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),Zy.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Sx.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=USe(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),vl(Kje)}}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=`${W5t}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(Jrn(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(Zrn(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===t4t)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=USe(c,this.hostnameAndPort)}catch(o){if(o instanceof Fo)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. +${n}`),this.errors=e,this.name=Wtn}};function $tn(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($tn,"convertOAuthErrorResponseToErrorResponse");var Sx=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 ztn=require("node:os"),Ytn=de(require("node:util"),1),Ktn=de(require("node:process"),1);function Jtn(t,...e){Ktn.stderr.write(`${Ytn.default.format(t,...e)}${ztn.EOL}`)}a(Jtn,"log");var Ztn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Xtn,O5t=[],L5t=[],Ije=[];Ztn&&B5t(Ztn);var ern=Object.assign(t=>trn(t),{enable:B5t,enabled:F5t,disable:y1o,log:Jtn});function B5t(t){Xtn=t,O5t=[],L5t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?L5t.push(new RegExp(`^${n.substr(1)}$`)):O5t.push(new RegExp(`^${n}$`));for(let n of Ije)n.enabled=F5t(n.namespace)}a(B5t,"enable");function F5t(t){if(t.endsWith("*"))return!0;for(let e of L5t)if(e.test(t))return!1;for(let e of O5t)if(e.test(t))return!0;return!1}a(F5t,"enabled");function y1o(){let t=Xtn||"";return B5t(""),t}a(y1o,"disable");function trn(t){let e=Object.assign(r,{enabled:F5t(t),destroy:E1o,log:ern.log,namespace:t,extend:_1o});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),Ije.push(e),e}a(trn,"createDebugger");function E1o(){let t=Ije.indexOf(this);return t>=0?(Ije.splice(t,1),!0):!1}a(E1o,"destroy");function _1o(t){let e=trn(`${this.namespace}:${t}`);return e.log=this.log,e}a(_1o,"extend");var Xae=ern;var nrn=new Set,xje=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,Rje,U5t=Xae("azure");U5t.log=(...t)=>{Xae.log(...t)};var Q5t=["verbose","info","warning","error"];xje&&(srn(xje)?v1o(xje):console.error(`AZURE_LOG_LEVEL set to unknown log level '${xje}'; logging is not enabled. Acceptable values: ${Q5t.join(", ")}.`));function v1o(t){if(t&&!srn(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${Q5t.join(",")}`);Rje=t;let e=[];for(let r of nrn)orn(r)&&e.push(r.namespace);Xae.enable(e.join(","))}a(v1o,"setLogLevel");function kje(){return Rje}a(kje,"getLogLevel");var rrn={verbose:400,info:300,warning:200,error:100};function q7(t){let e=U5t.extend(t);return irn(U5t,e),{error:wje(e,"error"),warning:wje(e,"warning"),info:wje(e,"info"),verbose:wje(e,"verbose")}}a(q7,"createClientLogger");function irn(t,e){e.log=(...r)=>{t.log(...r)}}a(irn,"patchLogMethod");function wje(t,e){let r=Object.assign(t.extend(e),{level:e});if(irn(t,r),orn(r)){let n=Xae.disable();Xae.enable(n+","+r.namespace)}return nrn.add(r),r}a(wje,"createLogger");function orn(t){return!!(Rje&&rrn[t.level]<=rrn[Rje])}a(orn,"shouldEnable");function srn(t){return Q5t.includes(t)}a(srn,"isAzureLogLevel");var mS=q7("identity");function Pje(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(Pje,"processEnvVars");function e0(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(e0,"formatSuccess");function Us(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(Us,"formatError");function arn(t,e,r=mS){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(arn,"credentialLoggerInstance");function lo(t,e=mS){let r=arn(t,void 0,e);return{...r,parent:e,getToken:arn("=> getToken()",r,e)}}a(lo,"credentialLogger");p();p();p();p();var ece={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function crn(t={}){let e=new q5t(t.parentContext);return t.span&&(e=e.setValue(ece.span,t.span)),t.namespace&&(e=e.setValue(ece.namespace,t.namespace)),e}a(crn,"createTracingContext");var q5t=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 lrn=de(j5t(),1),Nje=lrn.state;function C1o(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(C1o,"createDefaultTracingSpan");function b1o(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:C1o(),tracingContext:crn({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(b1o,"createDefaultInstrumenter");function dSe(){return Nje.instrumenterImplementation||(Nje.instrumenterImplementation=b1o()),Nje.instrumenterImplementation}a(dSe,"getInstrumenter");p();function fSe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=dSe().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(ece.namespace)||(A=A.setValue(ece.namespace,e)),y.setAttribute("az.namespace",A.getValue(ece.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}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 dSe().withContext(d,f,...h)}a(c,"withContext");function l(d){return dSe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return dSe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(fSe,"createTracingClient");var Mc=fSe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:bje});var H5t=lo("ChainedTokenCredential"),pSe=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 Mc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new uSe(s,"ChainedTokenCredential authentication failed.");throw H5t.getToken.info(Us(e,l)),l}if(H5t.getToken.info(`Result for ${o.constructor.name}: ${e0(e)}`),n===null)throw new Mn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var vS={};ki(vS,{AuthError:()=>Uo,AuthErrorCodes:()=>vce,AzureCloudInstance:()=>l3,ClientAssertion:()=>p3,ClientAuthError:()=>$7,ClientAuthErrorCodes:()=>$p,ClientConfigurationError:()=>cce,ClientConfigurationErrorCodes:()=>uce,ConfidentialClientApplication:()=>Fce,CryptoProvider:()=>HM,DistributedCachePlugin:()=>AGe,InteractionRequiredAuthError:()=>yS,InteractionRequiredAuthErrorCodes:()=>hHe,LogLevel:()=>mf,Logger:()=>r0,ManagedIdentityApplication:()=>Uce,ManagedIdentitySourceNames:()=>no,PromptValue:()=>g2o,ProtocolMode:()=>Xy,PublicClientApplication:()=>Lce,ResponseMode:()=>A2o,ServerError:()=>k_,TokenCache:()=>Sce,TokenCacheContext:()=>gS,internals:()=>gBt,version:()=>_S});p();var gBt={};ki(gBt,{Deserializer:()=>f3,Serializer:()=>j7});p();p();var j7=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 an={};ki(an,{addApplicationTelemetry:()=>xSe,addAuthorizationCode:()=>GLt,addBrokerParameters:()=>c3,addCcsOid:()=>s3,addCcsUpn:()=>V7,addClaims:()=>dY,addCliData:()=>WLt,addClientAssertion:()=>kSe,addClientAssertionType:()=>PSe,addClientCapabilitiesToClaims:()=>hrn,addClientId:()=>lY,addClientInfo:()=>pY,addClientSecret:()=>RSe,addCodeChallengeParams:()=>RSo,addCodeVerifier:()=>VLt,addCorrelationId:()=>fY,addDeviceCode:()=>kSo,addDomainHint:()=>qLt,addEARParameters:()=>OSo,addExtraParameters:()=>a3,addGrantType:()=>DSe,addIdTokenHint:()=>QLt,addInstanceAware:()=>NSe,addLibraryInfo:()=>ISe,addLoginHint:()=>fce,addLogoutHint:()=>zLt,addNativeBroker:()=>wSo,addNonce:()=>HLt,addOboAssertion:()=>PSo,addPassword:()=>MSo,addPopToken:()=>MSe,addPostLogoutRedirectUri:()=>ULt,addPrompt:()=>jLt,addRedirectUri:()=>uY,addRefreshToken:()=>$Lt,addRequestTokenUse:()=>DSo,addResource:()=>FSe,addResponseMode:()=>FLt,addResponseType:()=>xSo,addScopes:()=>cY,addServerTelemetry:()=>LSe,addSid:()=>nHe,addSshJwk:()=>OSe,addState:()=>wSe,addThrottling:()=>BSe,addUsername:()=>NSo,instrumentBrokerParams:()=>aY});p();var er={};ki(er,{AADAuthority:()=>pP,AAD_INSTANCE_DISCOVERY_ENDPT:()=>z5t,AAD_TENANT_DOMAIN_SUFFIX:()=>Y5t,ADFS:()=>V5t,APP_METADATA:()=>oce,AUTHORITY_METADATA_CACHE_KEY:()=>sce,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>d4t,AUTHORIZATION_PENDING:()=>x1o,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>X5t,AuthenticationScheme:()=>hf,AuthorityMetadataSource:()=>Zy,CACHE_ACCOUNT_TYPE_ADFS:()=>l4t,CACHE_ACCOUNT_TYPE_GENERIC:()=>qje,CACHE_ACCOUNT_TYPE_MSAV1:()=>V1o,CACHE_ACCOUNT_TYPE_MSSTS:()=>c4t,CACHE_KEY_SEPARATOR:()=>rY,CIAM_AUTH_URL:()=>Mje,CLIENT_INFO:()=>u4t,CLIENT_INFO_SEPARATOR:()=>ice,CLIENT_MISMATCH_ERROR:()=>v4t,CODE_GRANT_TYPE:()=>T1o,CONSUMER_UTID:()=>S1o,CacheOutcome:()=>hP,CacheType:()=>W1o,ClaimsRequestKeys:()=>nce,CodeChallengeMethodValues:()=>G1o,CredentialType:()=>t0,DEFAULT_AUTHORITY:()=>urn,DEFAULT_AUTHORITY_HOST:()=>$5t,DEFAULT_COMMON_TENANT:()=>hSe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>y4t,DEFAULT_THROTTLE_TIME_SECONDS:()=>A4t,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>C4t,DSTS:()=>W5t,EMAIL_SCOPE:()=>prn,EncodingTypes:()=>J1o,FORWARD_SLASH:()=>tce,GrantType:()=>ASe,HTTP_BAD_REQUEST:()=>Uje,HTTP_CLIENT_ERROR:()=>D1o,HTTP_CLIENT_ERROR_RANGE_END:()=>i4t,HTTP_CLIENT_ERROR_RANGE_START:()=>n4t,HTTP_GATEWAY_TIMEOUT:()=>Q1o,HTTP_GONE:()=>L1o,HTTP_MULTI_SIDED_ERROR:()=>q1o,HTTP_NOT_FOUND:()=>M1o,HTTP_REDIRECT:()=>P1o,HTTP_REQUEST_TIMEOUT:()=>O1o,HTTP_SERVER_ERROR:()=>F1o,HTTP_SERVER_ERROR_RANGE_END:()=>s4t,HTTP_SERVER_ERROR_RANGE_START:()=>o4t,HTTP_SERVICE_UNAVAILABLE:()=>U1o,HTTP_SUCCESS:()=>Fje,HTTP_SUCCESS_RANGE_END:()=>k1o,HTTP_SUCCESS_RANGE_START:()=>R1o,HTTP_TOO_MANY_REQUESTS:()=>B1o,HTTP_UNAUTHORIZED:()=>N1o,HeaderNames:()=>Gp,HttpMethod:()=>j1o,IMDS_ENDPOINT:()=>Bje,IMDS_TIMEOUT:()=>Z5t,IMDS_VERSION:()=>J5t,INVALID_GRANT_ERROR:()=>_4t,INVALID_INSTANCE:()=>r4t,JsonWebTokenTypes:()=>Y1o,KNOWN_PUBLIC_CLOUDS:()=>t4t,NOT_APPLICABLE:()=>mSe,NOT_AVAILABLE:()=>tY,OAuthResponseType:()=>$1o,OFFLINE_ACCESS_SCOPE:()=>Lje,OIDC_DEFAULT_SCOPES:()=>rce,OIDC_SCOPES:()=>Qje,ONE_DAY_IN_MS:()=>K1o,OPENID_SCOPE:()=>drn,PROFILE_SCOPE:()=>frn,PasswordGrantConstants:()=>Gje,PersistentCacheKeys:()=>H1o,PromptValue:()=>gSe,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>e4t,RESOURCE_DELIM:()=>Oje,RegionDiscoveryOutcomes:()=>_Se,RegionDiscoverySources:()=>G7,ResponseMode:()=>a4t,S256_CODE_CHALLENGE_METHOD:()=>I1o,SERVER_TELEM_CACHE_KEY:()=>ySe,SERVER_TELEM_CATEGORY_SEPARATOR:()=>Hje,SERVER_TELEM_MAX_CACHED_ERRORS:()=>p4t,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>z1o,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>f4t,SERVER_TELEM_OVERFLOW_FALSE:()=>m4t,SERVER_TELEM_OVERFLOW_TRUE:()=>h4t,SERVER_TELEM_SCHEMA_VERSION:()=>jje,SERVER_TELEM_UNKNOWN_ERROR:()=>g4t,SERVER_TELEM_VALUE_SEPARATOR:()=>H7,SHR_NONCE_VALIDITY:()=>w1o,SKU:()=>G5t,THE_FAMILY_ID:()=>nY,THROTTLING_PREFIX:()=>ESe,URL_FORM_CONTENT_TYPE:()=>K5t,X_MS_LIB_CAPABILITY_VALUE:()=>E4t});p();var G5t="msal.js.common",urn="https://login.microsoftonline.com/common/",$5t="login.microsoftonline.com",hSe="common",V5t="adfs",W5t="dstsv2",z5t=`${urn}discovery/instance?api-version=1.1&authorization_endpoint=`,Mje=".ciamlogin.com",Y5t=".onmicrosoft.com",Oje="|",S1o="9188040d-6c67-4c5b-b112-36a304b66dad",drn="openid",frn="profile",Lje="offline_access",prn="email",T1o="authorization_code",I1o="S256",K5t="application/x-www-form-urlencoded;charset=utf-8",x1o="authorization_pending",mSe="N/A",tY="Not Available",tce="/",Bje="http://169.254.169.254/metadata/instance/compute/location",J5t="2020-06-01",Z5t=2e3,X5t="TryAutoDetect",e4t="login.microsoft.com",t4t=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],w1o=240,r4t="invalid_instance",Fje=200,R1o=200,k1o=299,P1o=302,D1o=400,n4t=400,Uje=400,N1o=401,M1o=404,O1o=408,L1o=410,B1o=429,i4t=499,F1o=500,o4t=500,U1o=503,Q1o=504,s4t=599,q1o=600,j1o={GET:"GET",POST:"POST"},rce=[drn,frn,Lje],Qje=[...rce,prn],Gp={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"},H1o={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},pP={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},nce={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},gSe={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},G1o={PLAIN:"plain",S256:"S256"},$1o={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},a4t={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},ASe={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"},c4t="MSSTS",l4t="ADFS",V1o="MSA",qje="Generic",rY="-",ice=".",t0={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},W1o={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},oce="appmetadata",u4t="client_info",nY="1",sce="authority-metadata",d4t=3600*24,Zy={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},jje=5,z1o=80,f4t=330,p4t=50,ySe="server-telemetry",Hje="|",H7=",",h4t="1",m4t="0",g4t="unknown_error",hf={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},A4t=60,y4t=3600,ESe="throttling",E4t="retry-after, h429",_4t="invalid_grant",v4t="client_mismatch",Gje={username:"username",password:"password"},G7={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},_Se={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"},Y1o={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},K1o=864e5,C4t=300,J1o={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var iY={};ki(iY,{ACCESS_TOKEN:()=>eSo,BROKER_CLIENT_ID:()=>vSe,BROKER_REDIRECT_URI:()=>Yje,CCS_HEADER:()=>cSo,CLAIMS:()=>I4t,CLIENT_ASSERTION:()=>K4t,CLIENT_ASSERTION_TYPE:()=>J4t,CLIENT_ID:()=>UM,CLIENT_INFO:()=>oSo,CLIENT_REQUEST_ID:()=>L4t,CLIENT_SECRET:()=>Y4t,CLI_DATA:()=>cLt,CODE:()=>D4t,CODE_CHALLENGE:()=>N4t,CODE_CHALLENGE_METHOD:()=>M4t,CODE_VERIFIER:()=>O4t,DEVICE_CODE:()=>z4t,DOMAIN_HINT:()=>iLt,EAR_JWE_CRYPTO:()=>sLt,EAR_JWK:()=>oLt,ERROR:()=>Z1o,ERROR_DESCRIPTION:()=>X1o,EXPIRES_IN:()=>rSo,FOCI:()=>aSo,GRANT_TYPE:()=>T4t,ID_TOKEN:()=>tSo,ID_TOKEN_HINT:()=>W4t,INSTANCE_AWARE:()=>ace,LOGIN_HINT:()=>nLt,LOGOUT_HINT:()=>tLt,NATIVE_BROKER:()=>eLt,NONCE:()=>k4t,OBO_ASSERTION:()=>Z4t,ON_BEHALF_OF:()=>sSo,POST_LOGOUT_URI:()=>V4t,PROMPT:()=>P4t,REDIRECT_URI:()=>$je,REFRESH_TOKEN:()=>w4t,REFRESH_TOKEN_EXPIRES_IN:()=>nSo,REQUESTED_TOKEN_USE:()=>X4t,REQ_CNF:()=>Wje,RESOURCE:()=>aLt,RESPONSE_MODE:()=>S4t,RESPONSE_TYPE:()=>b4t,RETURN_SPA_CODE:()=>zje,SCOPE:()=>x4t,SESSION_STATE:()=>iSo,SID:()=>rLt,STATE:()=>R4t,TOKEN_TYPE:()=>Vje,X_APP_NAME:()=>G4t,X_APP_VER:()=>$4t,X_CLIENT_CPU:()=>Q4t,X_CLIENT_CURR_TELEM:()=>q4t,X_CLIENT_EXTRA_SKU:()=>lSo,X_CLIENT_LAST_TELEM:()=>j4t,X_CLIENT_OS:()=>U4t,X_CLIENT_SKU:()=>B4t,X_CLIENT_VER:()=>F4t,X_MS_LIB_CAPABILITY:()=>H4t});p();var UM="client_id",$je="redirect_uri",b4t="response_type",S4t="response_mode",T4t="grant_type",I4t="claims",x4t="scope",Z1o="error",X1o="error_description",eSo="access_token",tSo="id_token",w4t="refresh_token",rSo="expires_in",nSo="refresh_token_expires_in",R4t="state",k4t="nonce",P4t="prompt",iSo="session_state",oSo="client_info",D4t="code",N4t="code_challenge",M4t="code_challenge_method",O4t="code_verifier",L4t="client-request-id",B4t="x-client-SKU",F4t="x-client-VER",U4t="x-client-OS",Q4t="x-client-CPU",q4t="x-client-current-telemetry",j4t="x-client-last-telemetry",H4t="x-ms-lib-capability",G4t="x-app-name",$4t="x-app-ver",V4t="post_logout_redirect_uri",W4t="id_token_hint",z4t="device_code",Y4t="client_secret",K4t="client_assertion",J4t="client_assertion_type",Vje="token_type",Wje="req_cnf",Z4t="assertion",X4t="requested_token_use",sSo="on_behalf_of",aSo="foci",cSo="X-AnchorMailbox",zje="return_spa_code",eLt="nativebroker",tLt="logout_hint",rLt="sid",nLt="login_hint",iLt="domain_hint",lSo="x-client-xtra-sku",vSe="brk_client_id",Yje="brk_redirect_uri",ace="instance_aware",oLt="ear_jwk",sLt="ear_jwe_crypto",aLt="resource",cLt="clidata";p();p();p();function Kje(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(Kje,"getDefaultErrorMessage");var Uo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?Kje(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 oY(t,e){return new Uo(t,e||Kje(t))}a(oY,"createAuthError");var cce=class t extends Uo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function vl(t){return new cce(t)}a(vl,"createClientConfigurationError");p();var fu=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 $7=class t extends Uo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function kt(t,e){return new $7(t,e)}a(kt,"createClientAuthError");var uce={};ki(uce,{authorityMismatch:()=>ASo,authorityUriInsecure:()=>uLt,cannotAllowPlatformBroker:()=>gSo,cannotSetOIDCOptions:()=>mSo,claimsRequestParsingError:()=>uSo,emptyInputScopesError:()=>fLt,invalidAuthenticationHeader:()=>hSo,invalidAuthorityMetadata:()=>gLt,invalidClaims:()=>Jje,invalidCloudDiscoveryMetadata:()=>Zje,invalidCodeChallengeMethod:()=>dSo,invalidRequestMethodForEAR:()=>ySo,logoutRequestEmpty:()=>hLt,missingNonceAuthenticationHeader:()=>pSo,missingSshJwk:()=>CSe,missingSshKid:()=>fSo,pkceParamsMissing:()=>mLt,redirectUriEmpty:()=>lLt,tokenRequestEmpty:()=>pLt,untrustedAuthority:()=>ALt,urlEmptyError:()=>dLt,urlParseError:()=>lce});p();var lLt="redirect_uri_empty",uSo="claims_request_parsing_error",uLt="authority_uri_insecure",lce="url_parse_error",dLt="empty_url_error",fLt="empty_input_scopes_error",Jje="invalid_claims",pLt="token_request_empty",hLt="logout_request_empty",dSo="invalid_code_challenge_method",mLt="pkce_params_missing",Zje="invalid_cloud_discovery_metadata",gLt="invalid_authority_metadata",ALt="untrusted_authority",CSe="missing_ssh_jwk",fSo="missing_ssh_kid",pSo="missing_nonce_authentication_header",hSo="invalid_authentication_header",mSo="cannot_set_OIDCOptions",gSo="cannot_allow_platform_broker",ASo="authority_mismatch",ySo="invalid_request_method_for_EAR";var $p={};ki($p,{authTimeNotFound:()=>bSe,authorizationCodeMissingFromServerResponse:()=>NLt,bindingKeyNotRemoved:()=>CSo,cannotAppendScopeSet:()=>RLt,cannotRemoveEmptyScope:()=>wLt,clientInfoDecodingError:()=>Xje,clientInfoEmptyError:()=>yLt,emptyInputScopeSet:()=>rHe,endSessionEndpointNotSupported:()=>MLt,endpointResolutionError:()=>mP,hashNotDeserialized:()=>CLt,invalidCacheEnvironment:()=>TSe,invalidCacheRecord:()=>kLt,invalidState:()=>sY,keyIdMissing:()=>OLt,maxAgeTranspired:()=>TLt,methodNotImplemented:()=>Ts,misplacedResourceParam:()=>BLt,multipleMatchingAppMetadata:()=>ILt,multipleMatchingTokens:()=>ESo,nestedAppAuthBridgeDisabled:()=>TSo,networkError:()=>_Lt,noAccountFound:()=>_So,noAccountInSilentRequest:()=>SSe,noCryptoObject:()=>PLt,noNetworkConnectivity:()=>bSo,nonceMismatch:()=>SLt,nullOrEmptyToken:()=>ELt,openIdConfigError:()=>vLt,platformBrokerError:()=>ISo,requestCannotBeMade:()=>xLt,resourceParameterRequired:()=>LLt,stateMismatch:()=>bLt,stateNotFound:()=>tHe,tokenClaimsCnfRequiredForSignedJwt:()=>DLt,tokenParsingError:()=>eHe,tokenRefreshRequired:()=>dce,unexpectedCredentialType:()=>vSo,userCanceled:()=>SSo});p();var Xje="client_info_decoding_error",yLt="client_info_empty_error",eHe="token_parsing_error",ELt="null_or_empty_token",mP="endpoints_resolution_error",_Lt="network_error",vLt="openid_config_error",CLt="hash_not_deserialized",sY="invalid_state",bLt="state_mismatch",tHe="state_not_found",SLt="nonce_mismatch",bSe="auth_time_not_found",TLt="max_age_transpired",ESo="multiple_matching_tokens",ILt="multiple_matching_appMetadata",xLt="request_cannot_be_made",wLt="cannot_remove_empty_scope",RLt="cannot_append_scopeset",rHe="empty_input_scopeset",SSe="no_account_in_silent_request",kLt="invalid_cache_record",TSe="invalid_cache_environment",_So="no_account_found",PLt="no_crypto_object",vSo="unexpected_credential_type",dce="token_refresh_required",DLt="token_claims_cnf_required_for_signedjwt",NLt="authorization_code_missing_from_server_response",CSo="binding_key_not_removed",MLt="end_session_endpoint_not_supported",OLt="key_id_missing",bSo="no_network_connectivity",SSo="user_canceled",Ts="method_not_implemented",TSo="nested_app_auth_bridge_disabled",ISo="platform_broker_error",LLt="resource_parameter_required",BLt="misplaced_resource_parameter";var Uh=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?fu.trimArrayEntries([...e]):[],n=r?fu.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw vl(fLt);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:[...rce],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(Lje):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 Qje.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 kt(RLt)}}removeScope(e){if(!e)throw kt(wLt);this.scopes.delete(e.trim())}removeOIDCScopes(){Qje.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw kt(rHe);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 kt(rHe);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 aY(t,e,r){if(!e)return;let n=t.get(UM);n&&t.has(vSe)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get($je)},e)}a(aY,"instrumentBrokerParams");function xSo(t,e){t.set(b4t,e)}a(xSo,"addResponseType");function FLt(t,e){t.set(S4t,e||a4t.QUERY)}a(FLt,"addResponseMode");function wSo(t){t.set(eLt,"1")}a(wSo,"addNativeBroker");function cY(t,e,r=!0,n=rce){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new Uh(o);t.set(x4t,s.printScopes())}a(cY,"addScopes");function lY(t,e){t.set(UM,e)}a(lY,"addClientId");function uY(t,e){t.set($je,e)}a(uY,"addRedirectUri");function ULt(t,e){t.set(V4t,e)}a(ULt,"addPostLogoutRedirectUri");function QLt(t,e){t.set(W4t,e)}a(QLt,"addIdTokenHint");function qLt(t,e){t.set(iLt,e)}a(qLt,"addDomainHint");function fce(t,e){t.set(nLt,e)}a(fce,"addLoginHint");function V7(t,e){t.set(Gp.CCS_HEADER,`UPN:${e}`)}a(V7,"addCcsUpn");function s3(t,e){t.set(Gp.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(s3,"addCcsOid");function nHe(t,e){t.set("sid",e)}a(nHe,"addSid");function dY(t,e,r){let n=hrn(e,r);try{JSON.parse(n)}catch{throw vl(Jje)}t.set(I4t,n)}a(dY,"addClaims");function fY(t,e){t.set(L4t,e)}a(fY,"addCorrelationId");function ISe(t,e){t.set(B4t,e.sku),t.set(F4t,e.version),e.os&&t.set(U4t,e.os),e.cpu&&t.set(Q4t,e.cpu)}a(ISe,"addLibraryInfo");function xSe(t,e){e?.appName&&t.set(G4t,e.appName),e?.appVersion&&t.set($4t,e.appVersion)}a(xSe,"addApplicationTelemetry");function jLt(t,e){t.set(P4t,e)}a(jLt,"addPrompt");function wSe(t,e){e&&t.set(R4t,e)}a(wSe,"addState");function HLt(t,e){t.set(k4t,e)}a(HLt,"addNonce");function RSo(t,e,r){if(e&&r)t.set(N4t,e),t.set(M4t,r);else throw vl(mLt)}a(RSo,"addCodeChallengeParams");function GLt(t,e){t.set(D4t,e)}a(GLt,"addAuthorizationCode");function kSo(t,e){t.set(z4t,e)}a(kSo,"addDeviceCode");function $Lt(t,e){t.set(w4t,e)}a($Lt,"addRefreshToken");function VLt(t,e){t.set(O4t,e)}a(VLt,"addCodeVerifier");function RSe(t,e){t.set(Y4t,e)}a(RSe,"addClientSecret");function kSe(t,e){e&&t.set(K4t,e)}a(kSe,"addClientAssertion");function PSe(t,e){e&&t.set(J4t,e)}a(PSe,"addClientAssertionType");function PSo(t,e){t.set(Z4t,e)}a(PSo,"addOboAssertion");function DSo(t,e){t.set(X4t,e)}a(DSo,"addRequestTokenUse");function DSe(t,e){t.set(T4t,e)}a(DSe,"addGrantType");function pY(t){t.set(u4t,"1")}a(pY,"addClientInfo");function WLt(t){t.set(cLt,"1")}a(WLt,"addCliData");function NSe(t){t.has(ace)||t.set(ace,"true")}a(NSe,"addInstanceAware");function a3(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(a3,"addExtraParameters");function hrn(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw vl(Jje)}return e&&e.length>0&&(r.hasOwnProperty(nce.ACCESS_TOKEN)||(r[nce.ACCESS_TOKEN]={}),r[nce.ACCESS_TOKEN][nce.XMS_CC]={values:e}),JSON.stringify(r)}a(hrn,"addClientCapabilitiesToClaims");function NSo(t,e){t.set(Gje.username,e)}a(NSo,"addUsername");function MSo(t,e){t.set(Gje.password,e)}a(MSo,"addPassword");function MSe(t,e){e&&(t.set(Vje,hf.POP),t.set(Wje,e))}a(MSe,"addPopToken");function OSe(t,e){e&&(t.set(Vje,hf.SSH),t.set(Wje,e))}a(OSe,"addSshJwk");function LSe(t,e){t.set(q4t,e.generateCurrentRequestHeaderValue()),t.set(j4t,e.generateLastRequestHeaderValue())}a(LSe,"addServerTelemetry");function BSe(t){t.set(H4t,E4t)}a(BSe,"addThrottling");function zLt(t,e){t.set(tLt,e)}a(zLt,"addLogoutHint");function c3(t,e,r){t.has(vSe)||t.set(vSe,e),t.has(Yje)||t.set(Yje,r)}a(c3,"addBrokerParameters");function OSo(t,e){t.set(oLt,encodeURIComponent(e)),t.set(sLt,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(OSo,"addEARParameters");function FSe(t,e){e&&t.set(aLt,e)}a(FSe,"addResource");var CA={};ki(CA,{getDeserializedResponse:()=>LSo,mapToQueryString:()=>QM,normalizeUrlForComparison:()=>BSo,stripLeadingHashOrQuery:()=>grn});p();function mrn(t){if(!t)return t;let e=t.toLowerCase();return fu.endsWith(e,"?")?e=e.slice(0,-1):fu.endsWith(e,"?/")&&(e=e.slice(0,-2)),fu.endsWith(e,"/")||(e+="/"),e}a(mrn,"canonicalizeUrl");function grn(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(grn,"stripLeadingHashOrQuery");function LSo(t){if(!t||t.indexOf("=")<0)return null;try{let e=grn(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw kt(CLt)}return null}a(LSo,"getDeserializedResponse");function QM(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(QM,"mapToQueryString");function BSo(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return mrn(n)}catch{return mrn(e)}}a(BSo,"normalizeUrlForComparison");p();p();var pce={createNewGuid:a(()=>{throw kt(Ts)},"createNewGuid"),base64Decode:a(()=>{throw kt(Ts)},"base64Decode"),base64Encode:a(()=>{throw kt(Ts)},"base64Encode"),base64UrlEncode:a(()=>{throw kt(Ts)},"base64UrlEncode"),encodeKid:a(()=>{throw kt(Ts)},"encodeKid"),async getPublicKeyThumbprint(){throw kt(Ts)},async removeTokenBindingKey(){throw kt(Ts)},async clearKeystore(){throw kt(Ts)},async signJwt(){throw kt(Ts)},async hashString(){throw kt(Ts)}};p();var mf;(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"})(mf||(mf={}));var FSo=50,USo=500,hY=new Map;function QSo(t,e){hY.delete(t),hY.set(t,e)}a(QSo,"markAsRecentlyUsed");function qSo(t,e){let r=Date.now(),n=hY.get(t);if(n)QSo(t,n);else if(n={logs:[],firstEventTime:r},hY.set(t,n),hY.size>FSo){let o=hY.keys().next().value;o&&hY.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>USo&&n.logs.shift()}a(qSo,"addLogToCache");function jSo(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(jSo,"isHashedString");var r0=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=mf.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:mf.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.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(jSo(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};qSo(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${mf[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:mf.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:mf.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:mf.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:mf.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:mf.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:mf.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:mf.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:mf.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:mf.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:mf.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var W7="@azure/msal-common",qM="16.4.1";p();var l3={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 Arn(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(Arn,"tenantIdMatchesHomeTenant");function mY(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:Arn(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:Arn(r,t)}}a(mY,"buildTenantProfile");function iHe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=mY(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(iHe,"updateAccountTenantProfileData");var oHe={};ki(oHe,{checkMaxAge:()=>USe,extractTokenClaims:()=>u3,getJWSPayload:()=>yrn,isKmsi:()=>YLt});p();function u3(t,e){let r=yrn(t);try{let n=e(r);return JSON.parse(n)}catch{throw kt(eHe)}}a(u3,"extractTokenClaims");function YLt(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(YLt,"isKmsi");function yrn(t){if(!t)throw kt(ELt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw kt(eHe);return r[2]}a(yrn,"getJWSPayload");function USe(t,e){if(e===0||Date.now()-3e5>t+e)throw kt(TLt)}a(USe,"checkMaxAge");p();p();var Is=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw vl(dLt);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return fu.endsWith(r,"?")?r=r.slice(0,-1):fu.endsWith(r,"?/")&&(r=r.slice(0,-2)),fu.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw vl(lce)}if(!e.HostNameAndPort||!e.PathSegments)throw vl(lce);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw vl(uLt)}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]===pP.COMMON||n[0]===pP.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw vl(lce);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 vl(lce);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===tce){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 HSo=[{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 GSo(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(GSo,"buildOpenIdConfig");var $So=HSo.reduce((t,{host:e,issuerHost:r})=>(t[e]=GSo(e,r||e),t),{}),_rn={endpointMetadata:$So,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"]}]}},KLt=_rn.endpointMetadata,JLt=_rn.instanceDiscoveryMetadata,ZLt=new Set;JLt.metadata.forEach(t=>{t.aliases.forEach(e=>{ZLt.add(e)})});function vrn(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new Is(o).getUrlComponents().HostNameAndPort;n=Ern(e,r,s,t.cloudDiscoveryMetadata?.metadata,Zy.CONFIG)||Ern(e,r,s,JLt.metadata,Zy.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(vrn,"getAliasesFromStaticSources");function Ern(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=QSe(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(Ern,"getAliasesFromMetadata");function Crn(t){return QSe(JLt.metadata,t)}a(Crn,"getCloudDiscoveryMetadataFromHardcodedValues");function QSe(t,e){for(let r=0;rXLt,createAccountEntityFromAccountInfo:()=>zSo,generateAccountId:()=>VSo,generateHomeAccountId:()=>eBt,getAccountInfo:()=>mce,isAccountEntity:()=>YSo,isSingleTenant:()=>WSo});p();p();function hce(t,e){if(!t)throw kt(yLt);try{let r=e(t);return JSON.parse(r)}catch{throw kt(Xje)}}a(hce,"buildClientInfo");function jM(t){if(!t)throw kt(Xje);let e=t.split(ice,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(jM,"buildClientInfoFromHomeAccountId");p();var Tx={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function sHe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(sHe,"getTenantIdFromIdTokenClaims");p();var Xy={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function VSo(t){return[t.homeAccountId,t.environment].join(rY).toLowerCase()}a(VSo,"generateAccountId");function mce(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(mY(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(mce,"getAccountInfo");function WSo(t){return!t.tenantProfiles}a(WSo,"isSingleTenant");function XLt(t,e,r){let n;e.authorityType===Tx.Adfs?n=l4t:e.protocolMode===Xy.OIDC?n=qje:n=c4t;let o,s;t.clientInfo&&r&&(o=hce(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw kt(TSe);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||sHe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[mY(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(XLt,"createAccountEntity");function zSo(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(mY(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||qje,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(zSo,"createAccountEntityFromAccountInfo");function eBt(t,e,r,n,o,s){if(!(e===Tx.Adfs||e===Tx.Dsts)){if(t)try{let c=hce(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(eBt,"generateHomeAccountId");function YSo(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a(YSo,"isAccountEntity");var z7=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(W7,qM),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?mce(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=u3(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=iHe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=mce(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 kt(kLt);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 Uo?c:Trn(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=Uh.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)&&Uh.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===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===hf.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()===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===hf.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:t0.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=Uh.createSearchScopes(r.scopes),l=r.authenticationScheme||hf.BEARER,u=l&&l.toLowerCase()!==hf.BEARER.toLowerCase()?t0.ACCESS_TOKEN_WITH_AUTH_SCHEME:t0.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?nY:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:t0.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 kt(ILt);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===nY)}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=vrn(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!==t0.ACCESS_TOKEN&&e.credentialType!==t0.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Uh.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(oce)!==-1}isAuthorityMetadata(e){return e.indexOf(sce)!==-1}generateAuthorityMetadataCacheKey(e){return`${sce}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},jSe=class extends z7{static{a(this,"DefaultStorageClass")}async setAccount(){throw kt(Ts)}getAccount(){throw kt(Ts)}async setIdTokenCredential(){throw kt(Ts)}getIdTokenCredential(){throw kt(Ts)}async setAccessTokenCredential(){throw kt(Ts)}getAccessTokenCredential(){throw kt(Ts)}async setRefreshTokenCredential(){throw kt(Ts)}getRefreshTokenCredential(){throw kt(Ts)}setAppMetadata(){throw kt(Ts)}getAppMetadata(){throw kt(Ts)}setServerTelemetry(){throw kt(Ts)}getServerTelemetry(){throw kt(Ts)}setAuthorityMetadata(){throw kt(Ts)}getAuthorityMetadata(){throw kt(Ts)}getAuthorityMetadataKeys(){throw kt(Ts)}setThrottlingCache(){throw kt(Ts)}getThrottlingCache(){throw kt(Ts)}removeItem(){throw kt(Ts)}getKeys(){throw kt(Ts)}getAccountKeys(){throw kt(Ts)}getTokenKeys(){throw kt(Ts)}generateCredentialKey(){throw kt(Ts)}generateAccountKey(){throw kt(Ts)}};p();p();var Irn={NotStarted:0,InProgress:1,Completed:2};var Qh=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:Irn.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 xrn={tokenRenewalOffsetSeconds:C4t,preventCorsPreflight:!1},KSo={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.Info,correlationId:""},JSo={async sendGetRequestAsync(){throw kt(Ts)},async sendPostRequestAsync(){throw kt(Ts)}},ZSo={sku:G5t,version:qM,cpu:"",os:""},XSo={clientSecret:"",clientAssertion:void 0},eTo={azureCloudInstance:l3.None,tenant:`${hSe}`},tTo={application:{appName:"",appVersion:""}};function d3({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={...KSo,...r};return{authOptions:rTo(t),systemOptions:{...xrn,...e},loggerOptions:m,storageInterface:n||new jSe(t.clientId,pce,new r0(m),new Qh),networkInterface:o||JSo,cryptoInterface:s||pce,clientCredentials:c||XSo,libraryInfo:{...ZSo,...l},telemetry:{...tTo,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a(d3,"buildClientConfiguration");function rTo(t){return{clientCapabilities:[],azureCloudOptions:eTo,instanceAware:!1,isMcp:!1,...t}}a(rTo,"buildAuthOptions");function aHe(t){return t.authOptions.authority.options.protocolMode===Xy.OIDC}a(aHe,"isOidcProtocolMode");p();p();var gS=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 R_={};ki(R_,{createAccessTokenEntity:()=>nBt,createIdTokenEntity:()=>rBt,createRefreshTokenEntity:()=>iBt,generateAppMetadataKey:()=>dTo,generateAuthorityMetadataExpiresAt:()=>lHe,isAccessTokenEntity:()=>sTo,isAppMetadataEntity:()=>fTo,isAuthorityMetadataEntity:()=>pTo,isAuthorityMetadataExpired:()=>uHe,isCredentialEntity:()=>cHe,isIdTokenEntity:()=>aTo,isRefreshTokenEntity:()=>cTo,isServerTelemetryEntity:()=>lTo,isThrottlingEntity:()=>uTo,updateAuthorityEndpointMetadata:()=>Ace,updateCloudDiscoveryMetadata:()=>GSe});p();var Yu={};ki(Yu,{delay:()=>oTo,isCacheExpired:()=>iTo,isTokenExpired:()=>gce,nowSeconds:()=>AS,toDateFromSeconds:()=>HSe,toSecondsFromDate:()=>nTo,wasClockTurnedBack:()=>tBt});p();function AS(){return Math.round(new Date().getTime()/1e3)}a(AS,"nowSeconds");function nTo(t){return t.getTime()/1e3}a(nTo,"toSecondsFromDate");function HSe(t){return t?new Date(Number(t)*1e3):new Date}a(HSe,"toDateFromSeconds");function gce(t,e){let r=Number(t)||0;return AS()+e>r}a(gce,"isTokenExpired");function iTo(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(iTo,"isCacheExpired");function tBt(t){return Number(t)>AS()}a(tBt,"wasClockTurnedBack");function oTo(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(oTo,"delay");function rBt(t,e,r,n,o){return{credentialType:t0.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(rBt,"createIdTokenEntity");function nBt(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:t0.ACCESS_TOKEN,secret:r,cachedAt:AS().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||hf.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==hf.BEARER.toLowerCase())switch(g.credentialType=t0.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case hf.POP:let A=u3(r,u);if(!A?.cnf?.kid)throw kt(DLt);g.keyId=A.cnf.kid;break;case hf.SSH:g.keyId=m}return g}a(nBt,"createAccessTokenEntity");function iBt(t,e,r,n,o,s,c){let l={credentialType:t0.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(iBt,"createRefreshTokenEntity");function cHe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(cHe,"isCredentialEntity");function sTo(t){return t?cHe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===t0.ACCESS_TOKEN||t.credentialType===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(sTo,"isAccessTokenEntity");function aTo(t){return t?cHe(t)&&t.hasOwnProperty("realm")&&t.credentialType===t0.ID_TOKEN:!1}a(aTo,"isIdTokenEntity");function cTo(t){return t?cHe(t)&&t.credentialType===t0.REFRESH_TOKEN:!1}a(cTo,"isRefreshTokenEntity");function lTo(t,e){let r=t.indexOf(ySe)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(lTo,"isServerTelemetryEntity");function uTo(t,e){let r=!1;t&&(r=t.indexOf(ESe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(uTo,"isThrottlingEntity");function dTo({environment:t,clientId:e}){return[oce,t,e].join(rY).toLowerCase()}a(dTo,"generateAppMetadataKey");function fTo(t,e){return e?t.indexOf(oce)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(fTo,"isAppMetadataEntity");function pTo(t,e){return e?t.indexOf(sce)===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(pTo,"isAuthorityMetadataEntity");function lHe(){return AS()+d4t}a(lHe,"generateAuthorityMetadataExpiresAt");function Ace(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(Ace,"updateAuthorityEndpointMetadata");function GSe(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(GSe,"updateCloudDiscoveryMetadata");function uHe(t){return t.expiresAt<=AS()}a(uHe,"isAuthorityMetadataExpired");p();p();var wrn="networkClientSendPostRequestAsync",Rrn="refreshTokenClientExecutePostToTokenEndpoint",krn="authorizationCodeClientExecutePostToTokenEndpoint",Prn="refreshTokenClientExecuteTokenRequest",Drn="refreshTokenClientAcquireToken",dHe="refreshTokenClientAcquireTokenWithCachedRefreshToken",Nrn="refreshTokenClientCreateTokenRequestBody",Mrn="silentFlowClientGenerateResultFromCacheRecord";var Orn="authClientExecuteTokenRequest",Lrn="authClientCreateTokenRequestBody",Brn="updateTokenEndpointAuthority",yce="popTokenGenerateCnf",fHe="handleServerTokenResponse",Frn="authorityResolveEndpointsAsync",Urn="authorityGetCloudDiscoveryMetadataFromNetwork",Qrn="authorityUpdateCloudDiscoveryMetadata",qrn="authorityGetEndpointMetadataFromNetwork",jrn="authorityUpdateEndpointMetadata",oBt="authorityUpdateMetadataWithRegionalInformation",Hrn="regionDiscoveryDetectRegion",sBt="regionDiscoveryGetRegionFromIMDS",Grn="regionDiscoveryGetCurrentVersion",$rn="cacheManagerGetRefreshToken";p();var Vrn=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"),Js=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 hTo={SW:"sw"},Y7=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await Js(this.generateKid.bind(this),yce,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:hTo.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 Is(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:AS(),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 hHe={};ki(hHe,{badToken:()=>$Se,consentRequired:()=>uBt,interactionRequired:()=>lBt,interruptedUser:()=>fBt,loginRequired:()=>dBt,nativeAccountUnavailable:()=>mTo,noTokensFound:()=>pHe,refreshTokenExpired:()=>aBt,uxNotAllowed:()=>cBt});p();var pHe="no_tokens_found",mTo="native_account_unavailable",aBt="refresh_token_expired",cBt="ux_not_allowed",lBt="interaction_required",uBt="consent_required",dBt="login_required",$Se="bad_token",fBt="interrupted_user";var Wrn=[lBt,uBt,dBt,$Se,cBt,fBt],gTo=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],yS=class t extends Uo{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 mHe(t,e,r){let n=!!t&&Wrn.indexOf(t)>-1,o=!!r&&gTo.indexOf(r)>-1,s=!!e&&Wrn.some(c=>e.indexOf(c)>-1);return n||s||o}a(mHe,"isInteractionRequiredError");function gHe(t,e){return new yS(t,e)}a(gHe,"createInteractionRequiredAuthError");p();var k_=class t extends Uo{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 zrn(t,e){if(!t)throw kt(PLt);if(!e)throw kt(sY);try{let r=e.split(Oje),n=r[0],o=r.length>1?r.slice(1).join(Oje):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw kt(sY)}}a(zrn,"parseRequestState");var Vp=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||tY} - Timestamp: ${e.timestamp||tY} - Description: ${e.error_description||tY} - Correlation ID: ${e.correlation_id||tY} - Trace ID: ${e.trace_id||tY}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new k_(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=o4t&&e.status<=s4t){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>=n4t&&e.status<=i4t){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. +${c}`,r);return}throw mHe(e.error,e.error_description,e.suberror)?new yS(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=u3(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw kt(SLt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw kt(bSe);USe(y,o.maxAge)}}this.homeAccountIdentifier=eBt(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=zrn(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 gS(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,YLt(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 kt(TSe);let d=sHe(s),f,h;e.id_token&&s&&(f=rBt(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=Yrn(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?Uh.fromString(e.scope):new Uh(o.scopes||[]),E=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,_=(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,b=n+E,T=b+_,w=v&&v>0?n+v:void 0;m=nBt(this.homeAccountIdentifier,u,e.access_token,this.clientId,d||r.tenant||"",y.printScopes(),b,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 E=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;y=n+E,this.performanceClient?.addFields({ntwkRtExpiresOnSeconds:y},o.correlationId)}g=iBt(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,E="";if(n.accessToken){if(n.accessToken.tokenType===hf.POP&&!s.popKid){let T=new Y7(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw kt(OLt);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=Uh.fromString(n.accessToken.target).asArray(),g=HSe(n.accessToken.expiresOn),A=HSe(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=HSe(n.accessToken.refreshOn))}n.appMetadata&&(E=n.appMetadata.familyId===nY?nY:"");let _=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let b=n.account?iHe(mce(n.account),void 0,l,n.idToken?.secret):null;return{authority:r.canonicalAuthority,uniqueId:_,tenantId:v,scopes:m,account:b,idToken:n?.idToken?.secret||"",idTokenClaims:l||{},accessToken:h,fromCache:o,expiresOn:g,extExpiresOn:A,refreshOn:y,correlationId:s.correlationId,requestId:f||"",familyId:E,tokenType:n.accessToken?.tokenType||"",state:u?u.userRequestState:"",cloudGraphHostName:n.account?.cloudGraphHostName||"",msGraphHost:n.account?.msGraphHost||"",code:d?.spa_code,fromPlatformBroker:!1}}};function Yrn(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 E=(A.length===1?A[0]:null)||XLt({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||E.realm;if(v&&!_.find(b=>b.tenantId===v)){let b=mY(r,E.localAccountId,v,s);_.push(b)}return E.tenantProfiles=_,E}a(Yrn,"buildAccountToCache");p();var P_={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};p();async function D_(t,e,r){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:r})}a(D_,"getClientAssertion");p();function Ece(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(Ece,"getRequestThumbprint");var AY={};ki(AY,{createTokenQueryParameters:()=>zSe,createTokenRequestHeaders:()=>WSe,executePostToTokenEndpoint:()=>YSe,sendPostRequest:()=>Krn});p();p();var VSe=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${ESe}.${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(Gp.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||A4t),n+y4t)*1e3)}static removeThrottle(e,r,n,o){let s=Ece(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var _ce=class t extends Uo{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 pBt(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new _ce(t,e,r)}a(pBt,"createNetworkError");function WSe(t,e,r){let n={};if(n[Gp.CONTENT_TYPE]=K5t,!e&&r)switch(r.type){case P_.HOME_ACCOUNT_ID:try{let o=jM(r.credential);n[Gp.CCS_HEADER]=`Oid:${o.uid}@${o.utid}`}catch(o){t.verbose(`Could not parse home account ID for CCS Header: '${o}'`,"")}break;case P_.UPN:n[Gp.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(WSe,"createTokenRequestHeaders");function zSe(t,e,r,n){let o=new Map;return t.embeddedClientId&&c3(o,e,r),t.extraQueryParameters&&a3(o,t.extraQueryParameters),fY(o,t.correlationId),aY(o,t.correlationId,n),QM(o)}a(zSe,"createTokenQueryParameters");async function YSe(t,e,r,n,o,s,c,l,u,d){let f=await Krn(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(YSe,"executePostToTokenEndpoint");async function Krn(t,e,r,n,o,s,c,l){VSe.preProcess(o,t,n);let u;try{u=await Js(s.sendPostRequestAsync.bind(s),wrn,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[Gp.X_MS_HTTP_VERSION]||"",requestId:d[Gp.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof _ce){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[Gp.X_MS_HTTP_VERSION]||"",requestId:f[Gp.X_MS_REQUEST_ID]||"",contentTypeHeader:f[Gp.CONTENT_TYPE]||void 0,contentLengthHeader:f[Gp.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof Uo?d:kt(_Lt)}return VSe.postProcess(o,t,u,n),u}a(Krn,"sendPostRequest");var yHe={};ki(yHe,{createDiscoveredInstance:()=>mBt});p();p();p();function Jrn(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(Jrn,"isOpenIdConfigResponse");p();function Zrn(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(Zrn,"isCloudInstanceDiscoveryResponse");p();function Xrn(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(Xrn,"isCloudInstanceDiscoveryErrorResponse");p();var KSe=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=G7.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await Js(this.getRegionFromIMDS.bind(this),sBt,this.logger,this.performanceClient,this.correlationId)(J5t,o);if(s.status===Fje&&(n=s.body,r.region_source=G7.IMDS),s.status===Uje){let c=await Js(this.getCurrentVersion.bind(this),Grn,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=G7.FAILED_AUTO_DETECTION,null;let l=await Js(this.getRegionFromIMDS.bind(this),sBt,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===Fje&&(n=l.body,r.region_source=G7.IMDS)}}catch{return r.region_source=G7.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=G7.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${Bje}?api-version=${e}&format=text`,r,Z5t)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${Bje}?format=json`,e);return r.status===Uje&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};KSe.IMDS_OPTIONS={headers:{Metadata:"true"}};var gP=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 KSe(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(Mje))return Tx.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case V5t:return Tx.Adfs;case W5t:return Tx.Dsts}return Tx.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 Is(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 kt(mP)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw kt(mP)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw kt(mP)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw kt(MLt);return this.replacePath(this.metadata.end_session_endpoint)}else throw kt(mP)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw kt(mP)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw kt(mP)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Tx.Default&&this.protocolMode!==Xy.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new Is(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 Is(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===Tx.Adfs||this.protocolMode===Xy.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 Js(this.updateCloudDiscoveryMetadata.bind(this),Qrn,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await Js(this.updateEndpointMetadata.bind(this),jrn,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:lHe(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==Zy.CACHE&&n?.source!==Zy.CACHE&&(e.expiresAt=lHe(),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===Zy.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await Js(this.updateMetadataWithRegionalInformation.bind(this),oBt,this.logger,this.performanceClient,this.correlationId)(r.metadata);Ace(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await Js(this.getEndpointMetadataFromNetwork.bind(this),qrn,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await Js(this.updateMetadataWithRegionalInformation.bind(this),oBt,this.logger,this.performanceClient,this.correlationId)(n)),Ace(e,n,!0),Zy.NETWORK;throw kt(vLt,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),Ace(e,r,!1),{source:Zy.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 Ace(e,n,!1),{source:Zy.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=uHe(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:Zy.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new Is(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw vl(gLt)}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 Jrn(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 KLt?KLt[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==X5t)return this.regionDiscoveryMetadata.region_outcome=_Se.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await Js(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),Hrn,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=_Se.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=_Se.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await Js(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Urn,this.logger,this.performanceClient,this.correlationId)();if(n)return GSe(e,n,!0),Zy.NETWORK;throw vl(ALt)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||mSe}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||mSe}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||mSe}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),GSe(e,r,!1),Zy.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=Crn(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),GSe(e,n,!1),Zy.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=uHe(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),Zy.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Tx.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=QSe(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),vl(Zje)}}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=`${z5t}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(Zrn(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(Xrn(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===r4t)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=QSe(c,this.hostnameAndPort)}catch(o){if(o instanceof Uo)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&&Is.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==l3.None){let o=r.tenant?r.tenant:pSe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return G5t;if(this.discoveryComplete())return this.metadata.preferred_cache;throw kt(hP)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return JLt.has(e)}static isPublicCloudAuthority(e){return e4t.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new Is(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${X5t}`);let l=Is.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 Is(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(Dje)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${z5t}`}return r}};mP.reservedTenantDomains=new Set(["{tenant}","{tenantid}",fP.COMMON,fP.CONSUMERS,fP.ORGANIZATIONS]);function Xrn(t){let n=new Is(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case fP.COMMON:case fP.ORGANIZATIONS:case fP.CONSUMERS:return;default:return n}}a(Xrn,"getTenantFromAuthorityString");function mHe(t){return t.endsWith(tce)?t:`${t}${tce}`}a(mHe,"formatAuthorityUri");function pBt(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw vl(Kje)}return{canonicalAuthority:t.authority?mHe(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(pBt,"buildStaticAuthorityOptions");async function hBt(t,e,r,n,o,s,c){let l=mP.transformCIAMAuthority(mHe(t)),u=new mP(l,e,r,n,o,s,c);try{return await Js(u.resolveEndpointsAsync.bind(u),Brn,o,c,s)(),u}catch{throw kt(hP)}}a(hBt,"createDiscoveredInstance");var KSe=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=d3(e),this.logger=new r0(this.config.loggerOptions,V7,QM),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 kt(ILt);n&&n.cloud_instance_host_name&&await Js(this.updateTokenEndpointAuthority.bind(this),Lrn,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=gS(),s=await Js(this.executeTokenRequest.bind(this),Mrn,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[Gp.X_MS_REQUEST_ID],l=new Vp(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),Js(l.handleServerTokenResponse.bind(l),uHe,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 vl(pLt);let r=this.createLogoutUrlQueryString(e);return Is.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=WSe(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=Is.appendQueryString(e.tokenEndpoint,o),c=await Js(this.createTokenRequestBody.bind(this),Orn,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=hce(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${ice}${f.utid}`,type:P_.HOME_ACCOUNT_ID}}catch(f){this.logger.verbose(`Could not parse client info for CCS Header: '${f}'`,r.correlationId)}let u=VSe(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=Ece(this.config.authOptions.clientId,r);return Js(zSe,Rrn,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(cY(r,e.embeddedClientId||e.extraParameters?.[FM]||this.config.authOptions.clientId),this.includeRedirectUri)lY(r,e.redirectUri);else if(!e.redirectUri)throw vl(cLt);if(aY(r,e.scopes,!0,this.oidcDefaultScopes),BSe(r,e.resource),HLt(r,e.code),TSe(r,this.config.libraryInfo),ISe(r,this.config.telemetry.application),LSe(r),this.serverTelemetryManager&&!oHe(this.config)&&OSe(r,this.serverTelemetryManager),e.codeVerifier&&$Lt(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&wSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;RSe(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),kSe(r,o.assertionType)}if(PSe(r,gSe.AUTHORIZATION_CODE_GRANT),fY(r),e.authenticationScheme===hf.POP){let o=new z7(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await Js(o.generateCnf.bind(o),yce,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,NSe(r,s)}else if(e.authenticationScheme===hf.SSH)if(e.sshJwk)MSe(r,e.sshJwk);else throw vl(vSe);(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&uY(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=hce(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${ice}${o.utid}`,type:P_.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 P_.HOME_ACCOUNT_ID:try{let o=qM(n.credential);s3(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case P_.UPN:$7(r,n.credential);break}return e.embeddedClientId&&c3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&a3(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[Vje])&&a3(r,{[Vje]:"1"}),sY(r,e.correlationId,this.performanceClient),UM(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&FLt(r,e.postLogoutRedirectUri),e.correlationId&&dY(r,e.correlationId),e.idTokenHint&&ULt(r,e.idTokenHint),e.state&&xSe(r,e.state),e.logoutHint&&WLt(r,e.logoutHint),e.extraQueryParameters&&a3(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&DSe(r),UM(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await hBt(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var pTo=300,AY=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=d3(e),this.logger=new r0(this.config.loggerOptions,V7,QM),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=gS(),o=await Js(this.executeTokenRequest.bind(this),krn,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[Gp.X_MS_REQUEST_ID],c=new Vp(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),Js(c.handleServerTokenResponse.bind(c),uHe,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 vl(fLt);if(!e.account)throw kt(bSe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Js(this.acquireTokenWithCachedRefreshToken.bind(this),lHe,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof AS&&o.errorCode===dHe,c=o instanceof k_&&o.errorCode===E4t&&o.subError===_4t;if(s||c)return Js(this.acquireTokenWithCachedRefreshToken.bind(this),lHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return Js(this.acquireTokenWithCachedRefreshToken.bind(this),lHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=$rn(this.cacheManager.getRefreshToken.bind(this.cacheManager),Grn,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw hHe(dHe);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||pTo;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),gce(o.expiresOn,c))throw hHe(sBt)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||hf.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:P_.HOME_ACCOUNT_ID}};try{return await Js(this.acquireToken.bind(this),Prn,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof AS&&c.subError===GSe){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=WSe(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=Is.appendQueryString(r.tokenEndpoint,n),s=await Js(this.createTokenRequestBody.bind(this),Drn,this.logger,this.performanceClient,e.correlationId)(e),c=VSe(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=Ece(this.config.authOptions.clientId,e);return Js(zSe,wrn,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(cY(r,e.embeddedClientId||e.extraParameters?.[FM]||this.config.authOptions.clientId),e.redirectUri&&lY(r,e.redirectUri),aY(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),PSe(r,gSe.REFRESH_TOKEN_GRANT),fY(r),TSe(r,this.config.libraryInfo),ISe(r,this.config.telemetry.application),LSe(r),this.serverTelemetryManager&&!oHe(this.config)&&OSe(r,this.serverTelemetryManager),GLt(r,e.refreshToken),this.config.clientCredentials.clientSecret&&wSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;RSe(r,await D_(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),kSe(r,n.assertionType)}if(e.authenticationScheme===hf.POP){let n=new z7(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Js(n.generateCnf.bind(n),yce,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,NSe(r,o)}else if(e.authenticationScheme===hf.SSH)if(e.sshJwk)MSe(r,e.sshJwk);else throw vl(vSe);if((!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&uY(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case P_.HOME_ACCOUNT_ID:try{let n=qM(e.ccsCredential.credential);s3(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case P_.UPN:$7(r,e.ccsCredential.credential);break}return e.embeddedClientId&&c3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&a3(r,{...e.extraParameters}),sY(r,e.correlationId,this.performanceClient),UM(r)}};p();var JSe=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=d3(e),this.logger=new r0(this.config.loggerOptions,V7,QM),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=pP.NOT_APPLICABLE;if(e.forceRefresh||!fu.isEmptyObj(e.claims))throw this.setCacheOutcome(pP.FORCE_REFRESH_OR_CLAIMS,e.correlationId),kt(dce);if(!e.account)throw kt(bSe);let n=e.account.tenantId||Xrn(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(eBt(s.cachedAt)||gce(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(pP.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),kt(dce);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(pP.NO_CACHED_ACCESS_TOKEN,e.correlationId),kt(dce)}else s.refreshOn&&gce(s.refreshOn,0)&&(r=pP.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(pP.NO_CACHED_ACCESS_TOKEN,e.correlationId),kt(dce);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 Js(this.generateResultFromCacheRecord.bind(this),Nrn,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==pP.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=u3(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw kt(CSe);FSe(o,r.maxAge)}return Vp.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var ZSe={};ki(ZSe,{getAuthorizationCodePayload:()=>gTo,getAuthorizeUrl:()=>mTo,getStandardAuthorizeRequestParameters:()=>hTo,validateAuthorizationResponse:()=>enn});p();function hTo(t,e,r,n){let o=e.correlationId,s=new Map;cY(s,e.embeddedClientId||e.extraQueryParameters?.[FM]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(aY(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),BSe(s,e.resource),lY(s,e.redirectUri),dY(s,o),BLt(s,e.responseMode),fY(s),VLt(s),e.prompt&&(qLt(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(QLt(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==mSe.SELECT_ACCOUNT)if(e.sid&&e.prompt===mSe.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),tHe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=yTo(e.account),u=ETo(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),fce(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=qM(e.account.homeAccountId);s3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===mSe.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),tHe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=qM(e.account.homeAccountId);s3(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),fce(s,e.loginHint),$7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),fce(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=qM(e.account.homeAccountId);s3(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),fce(s,e.loginHint),$7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&jLt(s,e.nonce),e.state&&xSe(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&uY(s,e.claims,t.clientCapabilities),e.embeddedClientId&&c3(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(ace))&&DSe(s),s}a(hTo,"getStandardAuthorizeRequestParameters");function mTo(t,e){let r=UM(e);return Is.appendQueryString(t.authorizationEndpoint,r)}a(mTo,"getAuthorizeUrl");function gTo(t,e){if(enn(t,e),!t.code)throw kt(DLt);return t}a(gTo,"getAuthorizationCodePayload");function enn(t,e){if(!t.state||!e)throw t.state?kt(Xje,"Cached State"):kt(Xje,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw kt(oY,t.state)}try{n=decodeURIComponent(e)}catch{throw kt(oY,t.state)}if(r!==n)throw kt(CLt);if(t.error||t.error_description||t.suberror){let o=ATo(t);throw pHe(t.error,t.error_description,t.suberror)?new AS(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new k_(t.error||"",t.error_description,t.suberror,o)}}a(enn,"validateAuthorizationResponse");function ATo(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(ATo,"parseServerErrorNo");function yTo(t){return t.idTokenClaims?.sid||null}a(yTo,"extractAccountSid");function ETo(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(ETo,"extractLoginHint");p();function yY(t,e){if(t){if(e.resource&&(tnn(e.extraParameters)||tnn(e.extraQueryParameters)))throw kt(LLt);if(!e.resource)throw kt(OLt)}}a(yY,"enforceResourceParameter");function tnn(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(tnn,"containsResourceParam");var vce={};ki(vce,{postRequestFailed:()=>vTo,unexpectedError:()=>_To});p();var _To="unexpected_error",vTo="post_request_failed";p();var rnn=",",nnn="|";function CTo(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(rnn),l.length<4)return e}else l=Array.from({length:4},()=>nnn);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&bTo({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(rnn)}a(CTo,"makeExtraSkuString");function bTo(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(nnn))}a(bTo,"setSku");var EY=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=pP.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=ASe+tY+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${j7}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(j7),s=this.getRegionDiscoveryFields(),c=[e,s].join(j7);return[Qje,c,o].join(qje)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(j7),o=e.errors.slice(0,r).join(j7),s=e.errors.length,c=r=f4t&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Fo?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(m4t),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={};W7.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 inn="system_assigned_managed_identity",STo="managed_identity",gBt=`https://login.microsoftonline.com/${STo}/`,SC={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},qh={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"},no={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},gf={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"},Kf={GET:"GET",POST:"POST"},onn="REGION_NAME",snn="MSAL_FORCE_REGION",ann=32,cnn={SHA256:"sha256"},AHe={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},ABt={KEY_SEPARATOR:"-"},Tx={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},Af={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByOBO:772,acquireTokenWithManagedIdentity:773,acquireTokenByCode:871,acquireTokenByRefreshToken:872},Ix={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"},yHe={INTERVAL_MS:100,TIMEOUT_MS:5e3},lnn=4096;p();p();p();var Cce=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,Kf.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,Kf.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:ITo(n),signal:s.signal};r===Kf.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 iY($p.networkError,"Request timeout");let f=iY($p.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw fBt(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:TTo(u.headers),body:await u.json(),status:u.status}}catch(d){throw iY($p.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function TTo(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(TTo,"getHeaderDict");function ITo(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(ITo,"getFetchHeaders");p();p();p();var EHe="invalid_file_extension",_He="invalid_file_path",Y7="invalid_managed_identity_id_type",vHe="invalid_secret",unn="missing_client_id",dnn="network_unavailable",CHe="platform_not_supported",bHe="unable_to_create_azure_arc",SHe="unable_to_create_cloud_shell",THe="unable_to_create_source",XSe="unable_to_read_secret_file",fnn="user_assigned_not_available_at_runtime",IHe="www_authenticate_header_missing",xHe="www_authenticate_header_unsupported_format",_Y={[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 xTo={[EHe]:"The file path in the WWW-Authenticate header does not contain a .key file.",[_He]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[Y7]:"More than one ManagedIdentityIdType was provided.",[vHe]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[CHe]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[unn]:"A ManagedIdentityId id was not provided.",[_Y.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[_Y.IDENTITY_ENDPOINT]:`The Managed Identity's '${zi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[_Y.IMDS_ENDPOINT]:`The Managed Identity's '${zi.IMDS_ENDPOINT}' environment variable is malformed.`,[_Y.MSI_ENDPOINT]:`The Managed Identity's '${zi.MSI_ENDPOINT}' environment variable is malformed.`,[dnn]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[bHe]:"Azure Arc Managed Identities can only be system assigned.",[SHe]:"Cloud Shell Managed Identities can only be system assigned.",[THe]:"Unable to create a Managed Identity source based on environment variables.",[XSe]:"Unable to read the secret file.",[fnn]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[IHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[xHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},yBt=class t extends Fo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,xTo[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function Wp(t){return new yBt(t)}a(Wp,"createManagedIdentityError");var wHe=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 Wp(Y7);this.id=r,this.idType=gf.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw Wp(Y7);this.id=n,this.idType=gf.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw Wp(Y7);this.id=o,this.idType=gf.USER_ASSIGNED_OBJECT_ID}else this.id=inn,this.idType=gf.SYSTEM_ASSIGNED}};p();var jh={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."}},eE=class t extends Fo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(jh.invalidLoopbackAddressType.code,`${jh.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(jh.unableToLoadRedirectUri.code,`${jh.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(jh.noAuthCodeInResponse.code,`${jh.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(jh.noLoopbackServerExists.code,`${jh.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(jh.loopbackServerAlreadyExists.code,`${jh.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(jh.loopbackServerTimeout.code,`${jh.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(jh.stateNotFoundError.code,jh.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(jh.thumbprintMissing.code,jh.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(jh.redirectUriNotSupported.code,jh.redirectUriNotSupported.desc)}};var wTo={clientId:"",authority:er.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:l3.None,tenant:""},isMcp:!1},EBt={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.Info},RTo={loggerOptions:EBt,networkClient:new Cce,disableInternalRetries:!1,protocolMode:Xy.AAD},kTo={application:{appName:"",appVersion:""}};function pnn({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...RTo,networkClient:new Cce,loggerOptions:n?.loggerOptions||EBt,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw eE.createStateNotFoundError();return{auth:{...wTo,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...kTo,...o}}}a(pnn,"buildAppConfiguration");function hnn({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new wHe(e),o=r?.loggerOptions||EBt,s;return r?.networkClient?s=r.networkClient:s=new Cce,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(hnn,"buildManagedIdentityConfiguration");p();p();Mo();var bce=class{static{a(this,"GuidGenerator")}generateGuid(){return Mt()}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 yS=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(er.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,er.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 mnn=de(require("crypto"),1);var K7=class{static{a(this,"HashUtils")}sha256(e){return mnn.default.createHash(cnn.SHA256).update(e).digest()}};var gnn=de(require("crypto"),1);var RHe=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new K7}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%AHe.CV_CHARSET.length;for(;e.length<=ann;){let o=gnn.default.randomBytes(1)[0];if(o>=r)continue;let s=o%AHe.CV_CHARSET.length;e.push(AHe.CV_CHARSET[s])}let n=e.join("");return yS.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return yS.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};var jM=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new RHe,this.guidGenerator=new bce,this.hashUtils=new K7}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return yS.base64Encode(e)}base64Decode(e){return yS.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 yS.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};p();p();function Ann(t){let e=t.credentialType===er.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(ABt.KEY_SEPARATOR).toLowerCase()}a(Ann,"generateCredentialKey");function ynn(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(ABt.KEY_SEPARATOR).toLowerCase()}a(ynn,"generateAccountKey");var J7=class extends W7{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new Qh,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(mY.isAccountEntity(o))r.accounts[n]=o;else if(R_.isIdTokenEntity(o))r.idTokens[n]=o;else if(R_.isAccessTokenEntity(o))r.accessTokens[n]=o;else if(R_.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if(R_.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 Ann(e)}generateAccountKey(e){return ynn(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(mY.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return R_.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return R_.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return R_.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return R_.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=R_.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&R_.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&R_.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&&R_.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 f3.deserializeAllCache(f3.deserializeJSONBlob(e))}static generateJsonCache(e){return q7.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 eTe={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},Sce=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=q7.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=f3.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=J7.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new jM().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new mS(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 mS(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new bce().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 mS(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:{...eTe.Account,...e.Account},IdToken:{...eTe.IdToken,...e.IdToken},AccessToken:{...eTe.AccessToken,...e.AccessToken},RefreshToken:{...eTe.RefreshToken,...e.RefreshToken},AppMetadata:{...eTe.AppMetadata,...e.AppMetadata}}}};p();var ran=de(Ysn(),1);p();var Ksn="missing_tenant_id_error",Jsn="user_timeout_reached",Zsn="invalid_assertion",u3t="invalid_client_credential",Xsn="device_code_polling_cancelled",ean="device_code_expired",tan="device_code_unknown_error";var p3=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 kt(Zsn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=Yu.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?Ix.PSS_256:Ix.RSA_256},l=this.useSha256?Ix.X5T_256:Ix.X5T;Object.assign(c,{[l]:yS.base64EncodeUrl(this.thumbprint,er.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[Ix.X5C]:this.publicCertificate});let u={[Ix.AUDIENCE]:this.jwtAudience,[Ix.EXPIRATION_TIME]:this.expirationTime,[Ix.ISSUER]:this.issuer,[Ix.SUBJECT]:this.issuer,[Ix.NOT_BEFORE]:o,[Ix.JWT_ID]:e.createNewGuid()};return this.jwt=ran.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&an.addCcsUpn(r,e.username),CA.mapToQueryString(r)}};p();function nan(t,e,r,n){let o=ZSe.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return an.addLibraryInfo(o,{sku:Tx.MSAL_SKU,version:ES,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==Xy.OIDC&&an.addApplicationTelemetry(o,t.telemetry.application),an.addResponseType(o,er.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&an.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),an.addExtraParameters(o,r.extraQueryParameters||{}),ZSe.getAuthorizeUrl(e,o)}a(nan,"getAuthCodeRequestUrl");var Oce=class{static{a(this,"ClientApplication")}constructor(e){this.config=pnn(e),this.cryptoProvider=new jM,this.logger=new r0(this.config.system.loggerOptions,Mce,ES),this.storage=new J7(this.logger,this.config.auth.clientId,this.cryptoProvider,pBt(this.config.auth)),this.tokenCache=new Sce(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||er.ResponseMode.QUERY,authenticationScheme:er.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return nan(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:er.AuthenticationScheme.BEARER},o=this.initializeServerTelemetryManager(Af.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 KSe(c,new Qh);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,Af.acquireTokenByCode,r)}catch(s){throw s instanceof Fo&&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:er.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(Af.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 AY(s,new Qh);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,Af.acquireTokenByRefreshToken)}catch(o){throw o instanceof Fo&&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(Af.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 JSe(s,new Qh);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 G7&&l.errorCode===$p.tokenRefreshRequired)return new AY(s,new Qh).acquireTokenByRefreshToken(r,Af.acquireTokenSilent);throw l}}catch(o){throw o instanceof Fo&&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:[...er.OIDC_DEFAULT_SCOPES]});if(s===er.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 AY(n,new Qh);try{await c.acquireTokenByRefreshToken(e,Af.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(Af.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 oGe(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw eE.createStateNotFoundError();if(e!==r)throw kt($p.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:Tx.MSAL_SKU,version:ES,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=p3.fromAssertion(await D_(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:Tx.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===er.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=er.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...er.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 EY(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=mP.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 gHe.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new Qh)}clearCache(){this.storage.clear()}};p();var ian=de(require("http"),1);var sGe=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw eE.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=ian.default.createServer((s,c)=>{let l=s.url;if(l){if(l===er.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(eE.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=CA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(er.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 eE.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),eE.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${Tx.HTTP_PROTOCOL}${Tx.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 aGe=class extends $M{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=Yu.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new Vp(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,Af.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=Is.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&&an.addExtraParameters(r,e.extraQueryParameters),CA.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 an.addScopes(r,e.scopes),an.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&an.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),kt(Xsn);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),kt(Jsn);if(Yu.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}`,""),kt(ean);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=Is.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?Yu.nowSeconds()+e.timeout:void 0,u=Yu.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===er.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await Yu.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),iY(vce.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),kt(tan)}createTokenRequestBody(e,r){let n=new Map;an.addScopes(n,e.scopes),an.addClientId(n,this.config.authOptions.clientId),an.addGrantType(n,er.GrantType.DEVICE_CODE_GRANT),an.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return an.addCorrelationId(n,o),an.addClientInfo(n),an.addLibraryInfo(n,this.config.libraryInfo),an.addApplicationTelemetry(n,this.config.telemetry.application),an.addThrottling(n),this.serverTelemetryManager&&an.addServerTelemetry(n,this.serverTelemetryManager),(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(n)}};var Lce=class extends Oce{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=EY.makeExtraSkuString({libraryName:Tx.MSAL_SKU,libraryVersion:ES})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),yY(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(Af.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 aGe(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),yY(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||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[nY.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 eE.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new sGe,m={},g=null;try{let A=h.listenForAuthCode(o,s).then(T=>{m=T}).catch(T=>{g=T}),y=await this.waitForRedirectUri(h),E={...u,correlationId:r,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:er.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:er.CodeChallengeMethodValues.S256},_=await this.getAuthCodeUrl(E);if(await n(_),await A,g)throw g;if(m.error)throw new k_(m.error,m.error_description,m.suberror);if(!m.code)throw eE.createNoAuthCodeInResponseError();let v=m.client_info,b={code:m.code,codeVerifier:d,clientInfo:v||"",...E};return await this.acquireTokenByCode(b)}finally{h.closeServer()}}async acquireTokenSilent(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();if(this.logger.trace("acquireTokenSilent called",r),yY(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[nY.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 eE.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return yY(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return yY(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(yHe.TIMEOUT_MS/yHe.INTERVAL_MS1)throw kt($p.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=Yu.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:er.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=Is.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=Yu.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new Vp(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,Af.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes,!1),an.addGrantType(r,er.GrantType.CLIENT_CREDENTIALS_GRANT),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}};p();var cGe=class extends $M{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new Uh(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(Yu.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(er.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),kt($p.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(er.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),kt($p.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=nHe.extractTokenClaims(n.secret,yS.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(),Vp.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:er.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||er.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?er.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:er.CredentialType.ACCESS_TOKEN,clientId:e,target:Uh.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 kt($p.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=Is.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=Yu.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new Vp(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,Af.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes),an.addGrantType(r,er.GrantType.JWT_BEARER),an.addClientInfo(r),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),an.addRequestTokenUse(r,nY.ON_BEHALF_OF),an.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}};var Fce=class extends Oce{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 kt(u3t);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?p3.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):p3.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw kt(u3t);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 D_(e.clientAssertion,this.config.auth.clientId),assertionType:Tx.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!er.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new Is(s.authority).getUrlComponents().PathSegments[0];if(Object.values(er.AADAuthority).includes(l))throw kt(Ksn);let u=process.env[snn],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[onn]},h=this.initializeServerTelemetryManager(Af.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 Bce(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof Fo&&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 cGe(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof Fo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function oan(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(oan,"isIso8601");p();var lGe=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===Kf.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[er.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(Kf.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(Kf.POST,e,r)}};var bY={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"},M_=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&&(oan(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-Yu.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[qh.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[qh.XMS_CC]=g}let c=s.headers;c[er.HeaderNames.CONTENT_TYPE]=er.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new lGe(this.networkClient,s.retryPolicy,this.logger),d=Yu.nowSeconds(),f;try{s.httpMethod===Kf.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof Fo?g:kt($p.networkError)}let h=new Vp(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new Qh,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,Af.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case gf.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?bY.MANAGED_IDENTITY_CLIENT_ID_2017:bY.MANAGED_IDENTITY_CLIENT_ID;case gf.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?bY.MANAGED_IDENTITY_RESOURCE_ID_IMDS:bY.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case gf.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),bY.MANAGED_IDENTITY_OBJECT_ID;default:throw Wp(Y7)}}};M_.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new Is(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),Wp(_Y[t])}};p();p();p();var uGe=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 WPo=3,zPo=1e3,YPo=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_TOO_MANY_REQUESTS,er.HTTP_SERVER_ERROR,er.HTTP_SERVICE_UNAVAILABLE,er.HTTP_GATEWAY_TIMEOUT],dGe=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new uGe}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return zPo}async pauseForRetry(e,r,n,o){if(YPo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var TC=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 dGe}computeUri(){let e=new Map;this.queryParameters&&an.addExtraParameters(e,this.queryParameters);let r=CA.mapToQueryString(e);return Is.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&an.addExtraParameters(e,this.bodyParameters),CA.mapToQueryString(e)}};var KPo="2019-08-01",uTe=class t extends M_{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] ${no.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,no.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${no.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new TC(Kf.GET,this.identityEndpoint);return n.headers[SC.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[qh.API_VERSION]=KPo,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var h3=require("fs"),lan=de(require("path"),1);var JPo="2019-11-01",san="http://127.0.0.1:40342/metadata/identity/oauth2/token",aan="N/A: himds executable exists",can={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},ZPo={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},dTe=class t extends M_{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=ZPo[process.platform];try{(0,h3.accessSync)(n,h3.constants.F_OK|h3.constants.R_OK),e=san,r=aan}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] ${no.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${zi.IDENTITY_ENDPOINT}' and '${zi.IMDS_ENDPOINT}' are not defined. ${no.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===aan)e.info(`[Managed Identity] ${no.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${no.AZURE_ARC} endpoint: ${san}. Creating ${no.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,l,no.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(zi.IMDS_ENDPOINT,u,no.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${no.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${no.AZURE_ARC} managed identity.`,"")}if(c.idType!==gf.SYSTEM_ASSIGNED)throw Wp(bHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new TC(Kf.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[SC.METADATA_HEADER_NAME]="true",r.queryParameters[qh.API_VERSION]=JPo,r.queryParameters[qh.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===er.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw Wp(IHe);if(!c.includes("Basic realm="))throw Wp(xHe);let l=c.split("Basic realm=")[1];if(!can.hasOwnProperty(process.platform))throw Wp(CHe);let u=can[process.platform],d=lan.default.basename(l);if(!d.endsWith(".key"))throw Wp(EHe);if(u+d!==l)throw Wp(_He);let f;try{f=await(0,h3.statSync)(l).size}catch{throw Wp(XSe)}if(f>lnn)throw Wp(vHe);let h;try{h=(0,h3.readFileSync)(l,er.EncodingTypes.UTF8)}catch{throw Wp(XSe)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[SC.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof Fo?g:kt($p.networkError)}}return this.getServerTokenResponse(s||e)}};p();var fTe=class t extends M_{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] ${no.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,no.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${no.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${no.CLOUD_SHELL} managed identity.`,""),c.idType!==gf.SYSTEM_ASSIGNED)throw Wp(SHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new TC(Kf.POST,this.msiEndpoint);return r.headers[SC.METADATA_HEADER_NAME]="true",r.bodyParameters[qh.RESOURCE]=e,r}};p();p();p();var fGe=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 XPo=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_GONE,er.HTTP_TOO_MANY_REQUESTS],e2o=3,t2o=7,r2o=1e3,n2o=4e3,i2o=2e3,o2o=10*1e3,pGe=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new fGe(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return r2o}static get MAX_EXPONENTIAL_BACKOFF_MS(){return n2o}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return i2o}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return o2o}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===er.HTTP_GONE?t2o:e2o),(XPo.includes(e)||e>=er.HTTP_SERVER_ERROR_RANGE_START&&e<=er.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var uan="/metadata/identity/oauth2/token",s2o=`http://169.254.169.254${uan}`,a2o="2018-02-01",hGe=class t extends M_{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 ${no.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]}${uan}`,no.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${no.IMDS}, using the default endpoint.`,""),c=s2o),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new TC(Kf.GET,this.identityEndpoint);return n.headers[SC.METADATA_HEADER_NAME]="true",n.queryParameters[qh.API_VERSION]=a2o,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new pGe,n}};p();var c2o="2019-07-01-preview",pTe=class t extends M_{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] ${no.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,no.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${no.SERVICE_FABRIC} managed identity.`,""),c.idType!==gf.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${no.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 TC(Kf.GET,this.identityEndpoint);return n.headers[SC.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[qh.API_VERSION]=c2o,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var l2o="2017-09-01",u2o=`Only client id is supported for user-assigned managed identity in ${no.MACHINE_LEARNING}.`,hTe=class t extends M_{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] ${no.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,no.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${no.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new TC(Kf.GET,this.msiEndpoint);if(n.headers[SC.METADATA_HEADER_NAME]="true",n.headers[SC.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[qh.API_VERSION]=l2o,n.queryParameters[qh.RESOURCE]=e,r.idType===gf.SYSTEM_ASSIGNED)n.queryParameters[bY.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[zi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===gf.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(u2o);return n}};var mTe=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(pTe.getEnvironmentVariables())?no.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(uTe.getEnvironmentVariables())?no.APP_SERVICE:this.allEnvironmentVariablesAreDefined(hTe.getEnvironmentVariables())?no.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(fTe.getEnvironmentVariables())?no.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(dTe.getEnvironmentVariables())?no.AZURE_ARC:no.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=pTe.tryCreate(e,r,n,o,s,c)||uTe.tryCreate(e,r,n,o,s)||hTe.tryCreate(e,r,n,o,s)||fTe.tryCreate(e,r,n,o,s,c)||dTe.tryCreate(e,r,n,o,s,c)||hGe.tryCreate(e,r,n,o,s);if(!l)throw Wp(THe);return l}};var d2o=[no.SERVICE_FABRIC],Uce=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=hnn(e||{}),this.logger=new r0(this.config.system.loggerOptions,Mce,ES);let r={canonicalAuthority:er.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new J7(this.logger,this.config.managedIdentityId.id,pce,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new jM;let n={protocolMode:Xy.AAD,knownAuthorities:[gBt],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new mP(gBt,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new Qh,!0),this.fakeClientCredentialClient=new Bce({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new mTe(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new K7}async acquireToken(e){if(!e.resource)throw vl(uce.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&&d2o.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(er.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===er.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 mTe.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var mGe=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=>mY.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 f2o=er.PromptValue,p2o=er.ResponseMode;p();p();p();p();p();function gTe(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(gTe,"getRandomIntegerInclusive");function ATe(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+gTe(0,n/2)}}a(ATe,"calculateRetryDelay");p();function Qce(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Qce,"isObject");p();function SY(t){if(Qce(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(SY,"isError");p();p();var dan=require("node:crypto");var d3t,h2o=typeof((d3t=globalThis?.crypto)===null||d3t===void 0?void 0:d3t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):dan.randomUUID;function qce(){return h2o()}a(qce,"randomUUID");p();var f3t,p3t,h3t,m3t,fan=typeof window<"u"&&typeof window.document<"u",pan=typeof self=="object"&&typeof self?.importScripts=="function"&&(((f3t=self.constructor)===null||f3t===void 0?void 0:f3t.name)==="DedicatedWorkerGlobalScope"||((p3t=self.constructor)===null||p3t===void 0?void 0:p3t.name)==="ServiceWorkerGlobalScope"||((h3t=self.constructor)===null||h3t===void 0?void 0:h3t.name)==="SharedWorkerGlobalScope"),han=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",man=typeof Bun<"u"&&typeof Bun.version<"u",tQ=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((m3t=globalThis.process.versions)===null||m3t===void 0)&&m3t.node);var gan=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function IC(t,e){return Buffer.from(t,e)}a(IC,"stringToUint8Array");p();var g3t="REDACTED",m2o=["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"],g2o=["api-version"],yP=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=m2o.concat(e),r=g2o.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)||Qce(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,g3t);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]=g3t;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]=g3t;return r}};p();p();p();p();var TY=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function y3t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new TY(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(y3t,"createAbortablePromise");p();var v2o="The delay was aborted.";function E3t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return y3t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??v2o})}a(E3t,"delay");p();function jce(t){if(SY(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(jce,"getErrorMessage");p();function Aan(t,e){return ATe(t,e)}a(Aan,"calculateRetryDelay");function gGe(t){return SY(t)}a(gGe,"isError");var AGe=tQ,Hce=tQ;p();var yTe=lo("IdentityUtils"),yan="1.0";function IY(t,e,r){let n=a(o=>(yTe.getToken.info(o),new bx({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(IY,"ensureValidMsalToken");function _3t(t){let e=t?.authorityHost;return!e&&Hce&&(e=process.env.AZURE_AUTHORITY_HOST),e??cSe}a(_3t,"getAuthorityHost");function v3t(t,e){return e||(e=cSe),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(v3t,"getAuthority");function Ean(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(Ean,"getKnownAuthorities");var yGe=a((t,e=AGe?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case _S.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case _S.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case _S.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case _S.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function EGe(t){switch(t){case"error":return _S.LogLevel.Error;case"info":return _S.LogLevel.Info;case"verbose":return _S.LogLevel.Verbose;case"warning":return _S.LogLevel.Warning;default:return _S.LogLevel.Info}}a(EGe,"getMSALLogLevel");function xY(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return yTe.info(Us(t,e.message)),new Mn(e.message);case"device_code_polling_cancelled":return new TY("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":yTe.info(Us(t,`Authentication returned errorCode ${n.errorCode}`));break;default:yTe.info(Us(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"?(yTe.info(Us(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new bx({scopes:t,getTokenOptions:r,message:e.message})}a(xY,"handleMsalError");function _an(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(_an,"publicToMsal");function van(t,e){return{authority:e.environment??Otn,homeAccountId:e.homeAccountId,tenantId:e.tenantId||Mtn,username:e.username,clientId:t,version:yan}}a(van,"msalToPublic");function C3t(t){let e=JSON.parse(t);if(e.version&&e.version!==yan)throw Error("Unsupported AuthenticationRecord version");return e}a(C3t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function b2o(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(b2o,"isPrimitiveBody");function S2o(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(S2o,"handleNullableResponseAndWrappableBody");function b3t(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 S2o({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:b2o(t.parsedBody,l)})}a(b3t,"flattenResponse");var VM={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 WM=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var Can=require("node:os"),ban=de(require("node:util"),1),San=de(require("node:process"),1);function Tan(t,...e){San.stderr.write(`${ban.default.format(t,...e)}${Can.EOL}`)}a(Tan,"log");var Ian=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,xan,S3t=[],T3t=[],vGe=[];Ian&&I3t(Ian);var wan=Object.assign(t=>Ran(t),{enable:I3t,enabled:x3t,disable:T2o,log:Tan});function I3t(t){xan=t,S3t=[],T3t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?T3t.push(new RegExp(`^${n.substr(1)}$`)):S3t.push(new RegExp(`^${n}$`));for(let n of vGe)n.enabled=x3t(n.namespace)}a(I3t,"enable");function x3t(t){if(t.endsWith("*"))return!0;for(let e of T3t)if(e.test(t))return!1;for(let e of S3t)if(e.test(t))return!0;return!1}a(x3t,"enabled");function T2o(){let t=xan||"";return I3t(""),t}a(T2o,"disable");function Ran(t){let e=Object.assign(r,{enabled:x3t(t),destroy:I2o,log:wan.log,namespace:t,extend:x2o});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),vGe.push(e),e}a(Ran,"createDebugger");function I2o(){let t=vGe.indexOf(this);return t>=0?(vGe.splice(t,1),!0):!1}a(I2o,"destroy");function x2o(t){let e=Ran(`${this.namespace}:${t}`);return e.log=this.log,e}a(x2o,"extend");var Gce=wan;var w3t=["verbose","info","warning","error"],kan={verbose:400,info:300,warning:200,error:100};function Pan(t,e){e.log=(...r)=>{t.log(...r)}}a(Pan,"patchLogMethod");function Dan(t){return w3t.includes(t)}a(Dan,"isTypeSpecRuntimeLogLevel");function w2o(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=Gce(t.namespace);o.log=(...f)=>{Gce.log(...f)};function s(f){if(f&&!Dan(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${w3t.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);Gce.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(Dan(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${w3t.join(", ")}.`));function c(f){return!!(n&&kan[f.level]<=kan[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(Pan(f,m),c(m)){let g=Gce.disable();Gce.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 Pan(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(w2o,"createLoggerContext");var Nan=w2o({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),R2o=Nan.logger;function _Te(t){return Nan.createClientLogger(t)}a(_Te,"createClientLogger");p();function CGe(t){return t.toLowerCase()}a(CGe,"normalizeName");function*k2o(t){for(let e of t.values())yield[e.name,e.value]}a(k2o,"headerIterator");var R3t=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(CGe(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(CGe(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(CGe(e))}delete(e){this._headersMap.delete(CGe(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 k2o(this._headersMap)}};function vS(t){return new R3t(t)}a(vS,"createHttpHeaders");p();p();p();var k3t=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:vS(),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||qce(),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 bGe(t){return new k3t(t)}a(bGe,"createPipelineRequest");p();var Man=new Set(["Deserialize","Serialize","Retry","Sign"]),P3t=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&&!Man.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Man.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,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);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 E of y.dependants)E.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 SGe(){return P3t.create()}a(SGe,"createEmptyPipeline");p();p();var Oan=require("node:util"),Lan=Oan.inspect.custom;var P2o=new yP,TA=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,Lan,{value:a(()=>`RestError: ${this.message} - ${P2o.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};TA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";TA.PARSE_ERROR="PARSE_ERROR";function TGe(t){return t instanceof TA?!0:SY(t)&&t.name==="RestError"}a(TGe,"isRestError");p();p();var $ce=de(require("node:http"),1),Vce=de(require("node:https"),1),xGe=de(require("node:zlib"),1),Fan=require("node:stream");p();var kx=_Te("ts-http-runtime");var D2o={};function vTe(t){return t&&typeof t.pipe=="function"}a(vTe,"isReadableStream");function Ban(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(Ban,"isStreamComplete");function Uan(t){return t&&typeof t.byteLength=="number"}a(Uan,"isArrayBuffer");var IGe=class extends Fan.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}},D3t=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 WM("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 yP;kx.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=L2o(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let _=e.onUploadProgress,v=new IGe(_);v.on("error",b=>{kx.error("Error in upload progress",b)}),vTe(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=N2o(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?M2o(m,g):m;let E=e.onDownloadProgress;if(E){let _=new IGe(E);_.on("error",v=>{kx.error("Error in download progress",v)}),h.pipe(_),h=_}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 O2o(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();vTe(f)&&(m=Ban(f));let g=Promise.resolve();vTe(h)&&(g=Ban(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{kx.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?$ce.request(u,d):Vce.request(u,d);h.once("error",m=>{var g;f(new TA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:TA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new WM("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&vTe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):Uan(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(kx.error("Unrecognized body type",n),f(new TA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?$ce.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new $ce.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Vce.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:D2o,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(kx.info("No cached TLS Agent exist, creating a new Agent"),c=new Vce.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function N2o(t){let e=vS();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(N2o,"getResponseHeaders");function M2o(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=xGe.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=xGe.createInflate();return t.pipe(n),n}return t}a(M2o,"getDecodedResponseStream");function O2o(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 TA(`Error reading response as text: ${o.message}`,{code:TA.PARSE_ERROR}))})})}a(O2o,"streamToText");function L2o(t){return t?Buffer.isBuffer(t)?t.length:vTe(t)?null:Uan(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(L2o,"getBodyLength");function Qan(){return new D3t}a(Qan,"createNodeHttpClient");function wGe(){return Qan()}a(wGe,"createDefaultHttpClient");p();p();p();p();var N3t="logPolicy";function RGe(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:kx.info,n=new yP({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:N3t,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(RGe,"logPolicy");p();var M3t="redirectPolicy",qan=["GET","HEAD"];function kGe(t={}){let{maxRetries:e=20}=t;return{name:M3t,async sendRequest(r,n){let o=await n(r);return jan(n,o,e)}}}a(kGe,"redirectPolicy");async function jan(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&qan.includes(o.method)||s===302&&qan.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new WM(r?.abortErrorMsg?r?.abortErrorMsg:B2o)),"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($an,"delay");function Van(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Van,"parseHeaderValueAsNumber");var L3t="Retry-After",F2o=["retry-after-ms","x-ms-retry-after-ms",L3t];function Wan(t){if(t&&[429,503].includes(t.status))try{for(let o of F2o){let s=Van(t,o);if(s===0||s)return s*(o===L3t?1e3:1)}let e=t.headers.get(L3t);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(Wan,"getRetryAfterInMs");function zan(t){return Number.isFinite(Wan(t))}a(zan,"isThrottlingRetryResponse");function B3t(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=Wan(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(B3t,"throttlingRetryStrategy");var U2o=1e3,Q2o=1e3*64;function DGe(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:U2o,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:Q2o;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=j2o(l),d=u&&t.ignoreSystemErrors,f=q2o(c),h=f&&t.ignoreHttpStatusCodes;return c&&(zan(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:ATe(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(DGe,"exponentialRetryStrategy");function q2o(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(q2o,"isExponentialRetryResponse");function j2o(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(j2o,"isSystemError");p();var H2o=_Te("ts-http-runtime retryPolicy"),G2o="retryPolicy";function rQ(t,e={maxRetries:3}){let r=e.logger||H2o;return{name:G2o,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 WM;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 $an(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(rQ,"retryPolicy");var F3t="defaultRetryPolicy";function NGe(t={}){var e;return{name:F3t,sendRequest:rQ([B3t(),DGe(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(NGe,"defaultRetryPolicy");p();var U3t="formDataPolicy";function $2o(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($2o,"formDataToFormDataMap");function MGe(){return{name:U3t,async sendRequest(t,e){if(tQ&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=$2o(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=V2o(t.formData):await W2o(t.formData,t),t.formData=void 0}return e(t)}}}a(MGe,"formDataPolicy");function V2o(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(V2o,"wwwFormUrlEncode");async function W2o(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:vS({"Content-Disposition":`form-data; name="${o}"`}),body:IC(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=vS();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(W2o,"prepareFormData");p();var Ecn=de(W3t(),1),_cn=de(z3t(),1);var qDo="HTTPS_PROXY",jDo="HTTP_PROXY",HDo="ALL_PROXY",GDo="NO_PROXY",Y3t="proxyPolicy",gcn=[],vcn=!1,$Do=new Map;function jGe(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(jGe,"getEnvironmentValue");function VDo(){if(!process)return;let t=jGe(qDo),e=jGe(HDo),r=jGe(jDo);return t||e||r}a(VDo,"loadEnvironmentProxyValue");function WDo(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(WDo,"isBypassed");function zDo(){let t=jGe(GDo);return vcn=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(zDo,"loadNoProxy");function YDo(){let t=VDo();return t?new URL(t):void 0}a(YDo,"getDefaultProxySettingsInternal");function Acn(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(Acn,"getUrlFromProxySettings");function ycn(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&kx.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 _cn.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new Ecn.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(ycn,"setProxyAgentOnRequest");function HGe(t,e){vcn||gcn.push(...zDo());let r=t?Acn(t):YDo(),n={};return{name:Y3t,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!WDo(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:gcn,e?.customNoProxyList?void 0:$Do)?ycn(o,n,r):o.proxySettings&&ycn(o,n,Acn(o.proxySettings)),s(o)}}}a(HGe,"proxyPolicy");p();var K3t="agentPolicy";function GGe(t){return{name:K3t,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(GGe,"agentPolicy");p();var J3t="tlsPolicy";function $Ge(t){return{name:J3t,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a($Ge,"tlsPolicy");p();p();function VGe(t){return typeof t.stream=="function"}a(VGe,"isBlob");p();m3();var JGe=require("stream");function Wcn(){return bTe(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield SS(e.read());if(r)return yield SS(void 0);yield yield SS(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(Wcn,"streamAsyncIterator");function XDo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=Wcn.bind(t)),t.values||(t.values=Wcn.bind(t))}a(XDo,"makeAsyncIterable");function zcn(t){return t instanceof ReadableStream?(XDo(t),JGe.Readable.fromWeb(t)):t}a(zcn,"ensureNodeStream");function eNo(t){return t instanceof Uint8Array?JGe.Readable.from(Buffer.from(t)):VGe(t)?zcn(t.stream()):zcn(t)}a(eNo,"toStream");async function Ycn(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(eNo);return JGe.Readable.from((function(){return bTe(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,KGe(d)),u;u=yield SS(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield SS(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield SS(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(Ycn,"concat");function tNo(){return`----AzSDKFormBoundary${qce()}`}a(tNo,"generateBoundary");function rNo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(rNo,"encodeHeaders");function nNo(t){return t instanceof Uint8Array?t.byteLength:VGe(t)?t.size===-1?void 0:t.size:void 0}a(nNo,"getLength");function iNo(t){let e=0;for(let r of t){let n=nNo(r);if(n===void 0)return;e+=n}return e}a(iNo,"getTotalLength");async function oNo(t,e,r){let n=[IC(`--${r}`,"utf-8"),...e.flatMap(s=>[IC(`\r -`,"utf-8"),IC(rNo(s.headers),"utf-8"),IC(`\r -`,"utf-8"),s.body,IC(`\r ---${r}`,"utf-8")]),IC(`--\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&&Is.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==l3.None){let o=r.tenant?r.tenant:hSe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return $5t;if(this.discoveryComplete())return this.metadata.preferred_cache;throw kt(mP)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return ZLt.has(e)}static isPublicCloudAuthority(e){return t4t.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new Is(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${e4t}`);let l=Is.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 Is(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(Mje)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${Y5t}`}return r}};gP.reservedTenantDomains=new Set(["{tenant}","{tenantid}",pP.COMMON,pP.CONSUMERS,pP.ORGANIZATIONS]);function enn(t){let n=new Is(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case pP.COMMON:case pP.ORGANIZATIONS:case pP.CONSUMERS:return;default:return n}}a(enn,"getTenantFromAuthorityString");function AHe(t){return t.endsWith(tce)?t:`${t}${tce}`}a(AHe,"formatAuthorityUri");function hBt(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw vl(Zje)}return{canonicalAuthority:t.authority?AHe(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(hBt,"buildStaticAuthorityOptions");async function mBt(t,e,r,n,o,s,c){let l=gP.transformCIAMAuthority(AHe(t)),u=new gP(l,e,r,n,o,s,c);try{return await Js(u.resolveEndpointsAsync.bind(u),Frn,o,c,s)(),u}catch{throw kt(mP)}}a(mBt,"createDiscoveredInstance");var JSe=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=d3(e),this.logger=new r0(this.config.loggerOptions,W7,qM),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 kt(xLt);n&&n.cloud_instance_host_name&&await Js(this.updateTokenEndpointAuthority.bind(this),Brn,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=AS(),s=await Js(this.executeTokenRequest.bind(this),Orn,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[Gp.X_MS_REQUEST_ID],l=new Vp(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),Js(l.handleServerTokenResponse.bind(l),fHe,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 vl(hLt);let r=this.createLogoutUrlQueryString(e);return Is.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=zSe(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=Is.appendQueryString(e.tokenEndpoint,o),c=await Js(this.createTokenRequestBody.bind(this),Lrn,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=hce(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${ice}${f.utid}`,type:P_.HOME_ACCOUNT_ID}}catch(f){this.logger.verbose(`Could not parse client info for CCS Header: '${f}'`,r.correlationId)}let u=WSe(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=Ece(this.config.authOptions.clientId,r);return Js(YSe,krn,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(lY(r,e.embeddedClientId||e.extraParameters?.[UM]||this.config.authOptions.clientId),this.includeRedirectUri)uY(r,e.redirectUri);else if(!e.redirectUri)throw vl(lLt);if(cY(r,e.scopes,!0,this.oidcDefaultScopes),FSe(r,e.resource),GLt(r,e.code),ISe(r,this.config.libraryInfo),xSe(r,this.config.telemetry.application),BSe(r),this.serverTelemetryManager&&!aHe(this.config)&&LSe(r,this.serverTelemetryManager),e.codeVerifier&&VLt(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&RSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;kSe(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),PSe(r,o.assertionType)}if(DSe(r,ASe.AUTHORIZATION_CODE_GRANT),pY(r),e.authenticationScheme===hf.POP){let o=new Y7(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await Js(o.generateCnf.bind(o),yce,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,MSe(r,s)}else if(e.authenticationScheme===hf.SSH)if(e.sshJwk)OSe(r,e.sshJwk);else throw vl(CSe);(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&dY(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=hce(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${ice}${o.utid}`,type:P_.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 P_.HOME_ACCOUNT_ID:try{let o=jM(n.credential);s3(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case P_.UPN:V7(r,n.credential);break}return e.embeddedClientId&&c3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&a3(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[zje])&&a3(r,{[zje]:"1"}),aY(r,e.correlationId,this.performanceClient),QM(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&ULt(r,e.postLogoutRedirectUri),e.correlationId&&fY(r,e.correlationId),e.idTokenHint&&QLt(r,e.idTokenHint),e.state&&wSe(r,e.state),e.logoutHint&&zLt(r,e.logoutHint),e.extraQueryParameters&&a3(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&NSe(r),QM(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await mBt(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var ATo=300,yY=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=d3(e),this.logger=new r0(this.config.loggerOptions,W7,qM),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=AS(),o=await Js(this.executeTokenRequest.bind(this),Prn,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[Gp.X_MS_REQUEST_ID],c=new Vp(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),Js(c.handleServerTokenResponse.bind(c),fHe,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 vl(pLt);if(!e.account)throw kt(SSe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Js(this.acquireTokenWithCachedRefreshToken.bind(this),dHe,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof yS&&o.errorCode===pHe,c=o instanceof k_&&o.errorCode===_4t&&o.subError===v4t;if(s||c)return Js(this.acquireTokenWithCachedRefreshToken.bind(this),dHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return Js(this.acquireTokenWithCachedRefreshToken.bind(this),dHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=Vrn(this.cacheManager.getRefreshToken.bind(this.cacheManager),$rn,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw gHe(pHe);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||ATo;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),gce(o.expiresOn,c))throw gHe(aBt)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||hf.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:P_.HOME_ACCOUNT_ID}};try{return await Js(this.acquireToken.bind(this),Drn,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof yS&&c.subError===$Se){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=zSe(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=Is.appendQueryString(r.tokenEndpoint,n),s=await Js(this.createTokenRequestBody.bind(this),Nrn,this.logger,this.performanceClient,e.correlationId)(e),c=WSe(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=Ece(this.config.authOptions.clientId,e);return Js(YSe,Rrn,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(lY(r,e.embeddedClientId||e.extraParameters?.[UM]||this.config.authOptions.clientId),e.redirectUri&&uY(r,e.redirectUri),cY(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),DSe(r,ASe.REFRESH_TOKEN_GRANT),pY(r),ISe(r,this.config.libraryInfo),xSe(r,this.config.telemetry.application),BSe(r),this.serverTelemetryManager&&!aHe(this.config)&&LSe(r,this.serverTelemetryManager),$Lt(r,e.refreshToken),this.config.clientCredentials.clientSecret&&RSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;kSe(r,await D_(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),PSe(r,n.assertionType)}if(e.authenticationScheme===hf.POP){let n=new Y7(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Js(n.generateCnf.bind(n),yce,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,MSe(r,o)}else if(e.authenticationScheme===hf.SSH)if(e.sshJwk)OSe(r,e.sshJwk);else throw vl(CSe);if((!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&dY(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case P_.HOME_ACCOUNT_ID:try{let n=jM(e.ccsCredential.credential);s3(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case P_.UPN:V7(r,e.ccsCredential.credential);break}return e.embeddedClientId&&c3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&a3(r,{...e.extraParameters}),aY(r,e.correlationId,this.performanceClient),QM(r)}};p();var ZSe=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=d3(e),this.logger=new r0(this.config.loggerOptions,W7,qM),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||!fu.isEmptyObj(e.claims))throw this.setCacheOutcome(hP.FORCE_REFRESH_OR_CLAIMS,e.correlationId),kt(dce);if(!e.account)throw kt(SSe);let n=e.account.tenantId||enn(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(tBt(s.cachedAt)||gce(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(hP.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),kt(dce);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(hP.NO_CACHED_ACCESS_TOKEN,e.correlationId),kt(dce)}else s.refreshOn&&gce(s.refreshOn,0)&&(r=hP.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(hP.NO_CACHED_ACCESS_TOKEN,e.correlationId),kt(dce);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 Js(this.generateResultFromCacheRecord.bind(this),Mrn,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=u3(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw kt(bSe);USe(o,r.maxAge)}return Vp.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var XSe={};ki(XSe,{getAuthorizationCodePayload:()=>_To,getAuthorizeUrl:()=>ETo,getStandardAuthorizeRequestParameters:()=>yTo,validateAuthorizationResponse:()=>tnn});p();function yTo(t,e,r,n){let o=e.correlationId,s=new Map;lY(s,e.embeddedClientId||e.extraQueryParameters?.[UM]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(cY(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),FSe(s,e.resource),uY(s,e.redirectUri),fY(s,o),FLt(s,e.responseMode),pY(s),WLt(s),e.prompt&&(jLt(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(qLt(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==gSe.SELECT_ACCOUNT)if(e.sid&&e.prompt===gSe.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),nHe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=CTo(e.account),u=bTo(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),fce(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=jM(e.account.homeAccountId);s3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===gSe.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),nHe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=jM(e.account.homeAccountId);s3(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),fce(s,e.loginHint),V7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),fce(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=jM(e.account.homeAccountId);s3(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),fce(s,e.loginHint),V7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&HLt(s,e.nonce),e.state&&wSe(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&dY(s,e.claims,t.clientCapabilities),e.embeddedClientId&&c3(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(ace))&&NSe(s),s}a(yTo,"getStandardAuthorizeRequestParameters");function ETo(t,e){let r=QM(e);return Is.appendQueryString(t.authorizationEndpoint,r)}a(ETo,"getAuthorizeUrl");function _To(t,e){if(tnn(t,e),!t.code)throw kt(NLt);return t}a(_To,"getAuthorizationCodePayload");function tnn(t,e){if(!t.state||!e)throw t.state?kt(tHe,"Cached State"):kt(tHe,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw kt(sY,t.state)}try{n=decodeURIComponent(e)}catch{throw kt(sY,t.state)}if(r!==n)throw kt(bLt);if(t.error||t.error_description||t.suberror){let o=vTo(t);throw mHe(t.error,t.error_description,t.suberror)?new yS(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new k_(t.error||"",t.error_description,t.suberror,o)}}a(tnn,"validateAuthorizationResponse");function vTo(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(vTo,"parseServerErrorNo");function CTo(t){return t.idTokenClaims?.sid||null}a(CTo,"extractAccountSid");function bTo(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(bTo,"extractLoginHint");p();function EY(t,e){if(t){if(e.resource&&(rnn(e.extraParameters)||rnn(e.extraQueryParameters)))throw kt(BLt);if(!e.resource)throw kt(LLt)}}a(EY,"enforceResourceParameter");function rnn(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(rnn,"containsResourceParam");var vce={};ki(vce,{postRequestFailed:()=>TTo,unexpectedError:()=>STo});p();var STo="unexpected_error",TTo="post_request_failed";p();var nnn=",",inn="|";function ITo(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(nnn),l.length<4)return e}else l=Array.from({length:4},()=>inn);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&xTo({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(nnn)}a(ITo,"makeExtraSkuString");function xTo(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(inn))}a(xTo,"setSku");var _Y=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=ySe+rY+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${H7}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(H7),s=this.getRegionDiscoveryFields(),c=[e,s].join(H7);return[jje,c,o].join(Hje)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(H7),o=e.errors.slice(0,r).join(H7),s=e.errors.length,c=r=p4t&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Uo?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(g4t),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={};z7.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 onn="system_assigned_managed_identity",wTo="managed_identity",ABt=`https://login.microsoftonline.com/${wTo}/`,TC={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},qh={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"},no={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},gf={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"},Kf={GET:"GET",POST:"POST"},snn="REGION_NAME",ann="MSAL_FORCE_REGION",cnn=32,lnn={SHA256:"sha256"},EHe={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},yBt={KEY_SEPARATOR:"-"},Ix={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},Af={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"},_He={INTERVAL_MS:100,TIMEOUT_MS:5e3},unn=4096;p();p();p();var Cce=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,Kf.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,Kf.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:kTo(n),signal:s.signal};r===Kf.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 oY($p.networkError,"Request timeout");let f=oY($p.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw pBt(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:RTo(u.headers),body:await u.json(),status:u.status}}catch(d){throw oY($p.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function RTo(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(RTo,"getHeaderDict");function kTo(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(kTo,"getFetchHeaders");p();p();p();var vHe="invalid_file_extension",CHe="invalid_file_path",K7="invalid_managed_identity_id_type",bHe="invalid_secret",dnn="missing_client_id",fnn="network_unavailable",SHe="platform_not_supported",THe="unable_to_create_azure_arc",IHe="unable_to_create_cloud_shell",xHe="unable_to_create_source",eTe="unable_to_read_secret_file",pnn="user_assigned_not_available_at_runtime",wHe="www_authenticate_header_missing",RHe="www_authenticate_header_unsupported_format",vY={[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 PTo={[vHe]:"The file path in the WWW-Authenticate header does not contain a .key file.",[CHe]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[K7]:"More than one ManagedIdentityIdType was provided.",[bHe]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[SHe]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[dnn]:"A ManagedIdentityId id was not provided.",[vY.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[vY.IDENTITY_ENDPOINT]:`The Managed Identity's '${zi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[vY.IMDS_ENDPOINT]:`The Managed Identity's '${zi.IMDS_ENDPOINT}' environment variable is malformed.`,[vY.MSI_ENDPOINT]:`The Managed Identity's '${zi.MSI_ENDPOINT}' environment variable is malformed.`,[fnn]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[THe]:"Azure Arc Managed Identities can only be system assigned.",[IHe]:"Cloud Shell Managed Identities can only be system assigned.",[xHe]:"Unable to create a Managed Identity source based on environment variables.",[eTe]:"Unable to read the secret file.",[pnn]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[wHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[RHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},EBt=class t extends Uo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,PTo[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function Wp(t){return new EBt(t)}a(Wp,"createManagedIdentityError");var kHe=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 Wp(K7);this.id=r,this.idType=gf.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw Wp(K7);this.id=n,this.idType=gf.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw Wp(K7);this.id=o,this.idType=gf.USER_ASSIGNED_OBJECT_ID}else this.id=onn,this.idType=gf.SYSTEM_ASSIGNED}};p();var jh={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."}},eE=class t extends Uo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(jh.invalidLoopbackAddressType.code,`${jh.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(jh.unableToLoadRedirectUri.code,`${jh.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(jh.noAuthCodeInResponse.code,`${jh.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(jh.noLoopbackServerExists.code,`${jh.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(jh.loopbackServerAlreadyExists.code,`${jh.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(jh.loopbackServerTimeout.code,`${jh.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(jh.stateNotFoundError.code,jh.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(jh.thumbprintMissing.code,jh.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(jh.redirectUriNotSupported.code,jh.redirectUriNotSupported.desc)}};var DTo={clientId:"",authority:er.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:l3.None,tenant:""},isMcp:!1},_Bt={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.Info},NTo={loggerOptions:_Bt,networkClient:new Cce,disableInternalRetries:!1,protocolMode:Xy.AAD},MTo={application:{appName:"",appVersion:""}};function hnn({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...NTo,networkClient:new Cce,loggerOptions:n?.loggerOptions||_Bt,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw eE.createStateNotFoundError();return{auth:{...DTo,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...MTo,...o}}}a(hnn,"buildAppConfiguration");function mnn({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new kHe(e),o=r?.loggerOptions||_Bt,s;return r?.networkClient?s=r.networkClient:s=new Cce,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(mnn,"buildManagedIdentityConfiguration");p();p();Oo();var bce=class{static{a(this,"GuidGenerator")}generateGuid(){return Mt()}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 ES=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(er.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,er.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 gnn=de(require("crypto"),1);var J7=class{static{a(this,"HashUtils")}sha256(e){return gnn.default.createHash(lnn.SHA256).update(e).digest()}};var Ann=de(require("crypto"),1);var PHe=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new J7}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%EHe.CV_CHARSET.length;for(;e.length<=cnn;){let o=Ann.default.randomBytes(1)[0];if(o>=r)continue;let s=o%EHe.CV_CHARSET.length;e.push(EHe.CV_CHARSET[s])}let n=e.join("");return ES.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return ES.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};var HM=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new PHe,this.guidGenerator=new bce,this.hashUtils=new J7}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return ES.base64Encode(e)}base64Decode(e){return ES.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 ES.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};p();p();function ynn(t){let e=t.credentialType===er.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(yBt.KEY_SEPARATOR).toLowerCase()}a(ynn,"generateCredentialKey");function Enn(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(yBt.KEY_SEPARATOR).toLowerCase()}a(Enn,"generateAccountKey");var Z7=class extends z7{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new Qh,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(gY.isAccountEntity(o))r.accounts[n]=o;else if(R_.isIdTokenEntity(o))r.idTokens[n]=o;else if(R_.isAccessTokenEntity(o))r.accessTokens[n]=o;else if(R_.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if(R_.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 ynn(e)}generateAccountKey(e){return Enn(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(gY.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return R_.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return R_.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return R_.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return R_.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=R_.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&R_.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&R_.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&&R_.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 f3.deserializeAllCache(f3.deserializeJSONBlob(e))}static generateJsonCache(e){return j7.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 tTe={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},Sce=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=j7.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=f3.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=Z7.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new HM().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new gS(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 gS(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new bce().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 gS(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:{...tTe.Account,...e.Account},IdToken:{...tTe.IdToken,...e.IdToken},AccessToken:{...tTe.AccessToken,...e.AccessToken},RefreshToken:{...tTe.RefreshToken,...e.RefreshToken},AppMetadata:{...tTe.AppMetadata,...e.AppMetadata}}}};p();var nan=de(Ksn(),1);p();var Jsn="missing_tenant_id_error",Zsn="user_timeout_reached",Xsn="invalid_assertion",d3t="invalid_client_credential",ean="device_code_polling_cancelled",tan="device_code_expired",ran="device_code_unknown_error";var p3=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 kt(Xsn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=Yu.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]:ES.base64EncodeUrl(this.thumbprint,er.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=nan.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&an.addCcsUpn(r,e.username),CA.mapToQueryString(r)}};p();function ian(t,e,r,n){let o=XSe.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return an.addLibraryInfo(o,{sku:Ix.MSAL_SKU,version:_S,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==Xy.OIDC&&an.addApplicationTelemetry(o,t.telemetry.application),an.addResponseType(o,er.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&an.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),an.addExtraParameters(o,r.extraQueryParameters||{}),XSe.getAuthorizeUrl(e,o)}a(ian,"getAuthCodeRequestUrl");var Oce=class{static{a(this,"ClientApplication")}constructor(e){this.config=hnn(e),this.cryptoProvider=new HM,this.logger=new r0(this.config.system.loggerOptions,Mce,_S),this.storage=new Z7(this.logger,this.config.auth.clientId,this.cryptoProvider,hBt(this.config.auth)),this.tokenCache=new Sce(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||er.ResponseMode.QUERY,authenticationScheme:er.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return ian(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:er.AuthenticationScheme.BEARER},o=this.initializeServerTelemetryManager(Af.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 JSe(c,new Qh);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,Af.acquireTokenByCode,r)}catch(s){throw s instanceof Uo&&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:er.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(Af.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 yY(s,new Qh);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,Af.acquireTokenByRefreshToken)}catch(o){throw o instanceof Uo&&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(Af.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 ZSe(s,new Qh);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 $7&&l.errorCode===$p.tokenRefreshRequired)return new yY(s,new Qh).acquireTokenByRefreshToken(r,Af.acquireTokenSilent);throw l}}catch(o){throw o instanceof Uo&&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:[...er.OIDC_DEFAULT_SCOPES]});if(s===er.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 yY(n,new Qh);try{await c.acquireTokenByRefreshToken(e,Af.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(Af.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 aGe(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Uo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw eE.createStateNotFoundError();if(e!==r)throw kt($p.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:Ix.MSAL_SKU,version:_S,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=p3.fromAssertion(await D_(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:Ix.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===er.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=er.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...er.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 _Y(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=gP.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 yHe.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new Qh)}clearCache(){this.storage.clear()}};p();var oan=de(require("http"),1);var cGe=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw eE.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=oan.default.createServer((s,c)=>{let l=s.url;if(l){if(l===er.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(eE.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=CA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(er.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 eE.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),eE.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${Ix.HTTP_PROTOCOL}${Ix.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 lGe=class extends VM{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=Yu.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new Vp(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,Af.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=Is.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&&an.addExtraParameters(r,e.extraQueryParameters),CA.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 an.addScopes(r,e.scopes),an.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&an.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),kt(ean);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),kt(Zsn);if(Yu.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}`,""),kt(tan);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=Is.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?Yu.nowSeconds()+e.timeout:void 0,u=Yu.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===er.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await Yu.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),oY(vce.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),kt(ran)}createTokenRequestBody(e,r){let n=new Map;an.addScopes(n,e.scopes),an.addClientId(n,this.config.authOptions.clientId),an.addGrantType(n,er.GrantType.DEVICE_CODE_GRANT),an.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return an.addCorrelationId(n,o),an.addClientInfo(n),an.addLibraryInfo(n,this.config.libraryInfo),an.addApplicationTelemetry(n,this.config.telemetry.application),an.addThrottling(n),this.serverTelemetryManager&&an.addServerTelemetry(n,this.serverTelemetryManager),(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(n)}};var Lce=class extends Oce{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=_Y.makeExtraSkuString({libraryName:Ix.MSAL_SKU,libraryVersion:_S})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),EY(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(Af.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 lGe(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Uo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),EY(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||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[iY.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 eE.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new cGe,m={},g=null;try{let A=h.listenForAuthCode(o,s).then(T=>{m=T}).catch(T=>{g=T}),y=await this.waitForRedirectUri(h),E={...u,correlationId:r,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:er.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:er.CodeChallengeMethodValues.S256},_=await this.getAuthCodeUrl(E);if(await n(_),await A,g)throw g;if(m.error)throw new k_(m.error,m.error_description,m.suberror);if(!m.code)throw eE.createNoAuthCodeInResponseError();let v=m.client_info,b={code:m.code,codeVerifier:d,clientInfo:v||"",...E};return await this.acquireTokenByCode(b)}finally{h.closeServer()}}async acquireTokenSilent(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();if(this.logger.trace("acquireTokenSilent called",r),EY(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[iY.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 eE.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return EY(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return EY(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(_He.TIMEOUT_MS/_He.INTERVAL_MS1)throw kt($p.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=Yu.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:er.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=Is.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=Yu.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new Vp(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,Af.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes,!1),an.addGrantType(r,er.GrantType.CLIENT_CREDENTIALS_GRANT),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}};p();var uGe=class extends VM{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new Uh(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(Yu.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(er.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),kt($p.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(er.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),kt($p.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=oHe.extractTokenClaims(n.secret,ES.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(),Vp.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:er.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||er.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?er.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:er.CredentialType.ACCESS_TOKEN,clientId:e,target:Uh.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 kt($p.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=Is.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=Yu.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new Vp(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,Af.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes),an.addGrantType(r,er.GrantType.JWT_BEARER),an.addClientInfo(r),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),an.addRequestTokenUse(r,iY.ON_BEHALF_OF),an.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}};var Fce=class extends Oce{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 kt(d3t);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?p3.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):p3.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw kt(d3t);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 D_(e.clientAssertion,this.config.auth.clientId),assertionType:Ix.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!er.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new Is(s.authority).getUrlComponents().PathSegments[0];if(Object.values(er.AADAuthority).includes(l))throw kt(Jsn);let u=process.env[ann],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[snn]},h=this.initializeServerTelemetryManager(Af.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 Bce(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof Uo&&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 uGe(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof Uo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function san(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(san,"isIso8601");p();var dGe=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===Kf.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[er.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(Kf.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(Kf.POST,e,r)}};var SY={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"},M_=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&&(san(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-Yu.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[qh.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[qh.XMS_CC]=g}let c=s.headers;c[er.HeaderNames.CONTENT_TYPE]=er.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new dGe(this.networkClient,s.retryPolicy,this.logger),d=Yu.nowSeconds(),f;try{s.httpMethod===Kf.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof Uo?g:kt($p.networkError)}let h=new Vp(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new Qh,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,Af.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case gf.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?SY.MANAGED_IDENTITY_CLIENT_ID_2017:SY.MANAGED_IDENTITY_CLIENT_ID;case gf.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?SY.MANAGED_IDENTITY_RESOURCE_ID_IMDS:SY.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case gf.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),SY.MANAGED_IDENTITY_OBJECT_ID;default:throw Wp(K7)}}};M_.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new Is(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),Wp(vY[t])}};p();p();p();var fGe=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 JPo=3,ZPo=1e3,XPo=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_TOO_MANY_REQUESTS,er.HTTP_SERVER_ERROR,er.HTTP_SERVICE_UNAVAILABLE,er.HTTP_GATEWAY_TIMEOUT],pGe=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new fGe}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return ZPo}async pauseForRetry(e,r,n,o){if(XPo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var IC=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 pGe}computeUri(){let e=new Map;this.queryParameters&&an.addExtraParameters(e,this.queryParameters);let r=CA.mapToQueryString(e);return Is.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&an.addExtraParameters(e,this.bodyParameters),CA.mapToQueryString(e)}};var e2o="2019-08-01",dTe=class t extends M_{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] ${no.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,no.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${no.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new IC(Kf.GET,this.identityEndpoint);return n.headers[TC.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[qh.API_VERSION]=e2o,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var h3=require("fs"),uan=de(require("path"),1);var t2o="2019-11-01",aan="http://127.0.0.1:40342/metadata/identity/oauth2/token",can="N/A: himds executable exists",lan={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},r2o={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},fTe=class t extends M_{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=r2o[process.platform];try{(0,h3.accessSync)(n,h3.constants.F_OK|h3.constants.R_OK),e=aan,r=can}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] ${no.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${zi.IDENTITY_ENDPOINT}' and '${zi.IMDS_ENDPOINT}' are not defined. ${no.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===can)e.info(`[Managed Identity] ${no.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${no.AZURE_ARC} endpoint: ${aan}. Creating ${no.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,l,no.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(zi.IMDS_ENDPOINT,u,no.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${no.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${no.AZURE_ARC} managed identity.`,"")}if(c.idType!==gf.SYSTEM_ASSIGNED)throw Wp(THe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new IC(Kf.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[TC.METADATA_HEADER_NAME]="true",r.queryParameters[qh.API_VERSION]=t2o,r.queryParameters[qh.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===er.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw Wp(wHe);if(!c.includes("Basic realm="))throw Wp(RHe);let l=c.split("Basic realm=")[1];if(!lan.hasOwnProperty(process.platform))throw Wp(SHe);let u=lan[process.platform],d=uan.default.basename(l);if(!d.endsWith(".key"))throw Wp(vHe);if(u+d!==l)throw Wp(CHe);let f;try{f=await(0,h3.statSync)(l).size}catch{throw Wp(eTe)}if(f>unn)throw Wp(bHe);let h;try{h=(0,h3.readFileSync)(l,er.EncodingTypes.UTF8)}catch{throw Wp(eTe)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[TC.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof Uo?g:kt($p.networkError)}}return this.getServerTokenResponse(s||e)}};p();var pTe=class t extends M_{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] ${no.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,no.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${no.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${no.CLOUD_SHELL} managed identity.`,""),c.idType!==gf.SYSTEM_ASSIGNED)throw Wp(IHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new IC(Kf.POST,this.msiEndpoint);return r.headers[TC.METADATA_HEADER_NAME]="true",r.bodyParameters[qh.RESOURCE]=e,r}};p();p();p();var hGe=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 n2o=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_GONE,er.HTTP_TOO_MANY_REQUESTS],i2o=3,o2o=7,s2o=1e3,a2o=4e3,c2o=2e3,l2o=10*1e3,mGe=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new hGe(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return s2o}static get MAX_EXPONENTIAL_BACKOFF_MS(){return a2o}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return c2o}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return l2o}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===er.HTTP_GONE?o2o:i2o),(n2o.includes(e)||e>=er.HTTP_SERVER_ERROR_RANGE_START&&e<=er.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var dan="/metadata/identity/oauth2/token",u2o=`http://169.254.169.254${dan}`,d2o="2018-02-01",gGe=class t extends M_{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 ${no.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]}${dan}`,no.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${no.IMDS}, using the default endpoint.`,""),c=u2o),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new IC(Kf.GET,this.identityEndpoint);return n.headers[TC.METADATA_HEADER_NAME]="true",n.queryParameters[qh.API_VERSION]=d2o,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new mGe,n}};p();var f2o="2019-07-01-preview",hTe=class t extends M_{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] ${no.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,no.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${no.SERVICE_FABRIC} managed identity.`,""),c.idType!==gf.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${no.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 IC(Kf.GET,this.identityEndpoint);return n.headers[TC.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[qh.API_VERSION]=f2o,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var p2o="2017-09-01",h2o=`Only client id is supported for user-assigned managed identity in ${no.MACHINE_LEARNING}.`,mTe=class t extends M_{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] ${no.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,no.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${no.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new IC(Kf.GET,this.msiEndpoint);if(n.headers[TC.METADATA_HEADER_NAME]="true",n.headers[TC.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[qh.API_VERSION]=p2o,n.queryParameters[qh.RESOURCE]=e,r.idType===gf.SYSTEM_ASSIGNED)n.queryParameters[SY.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[zi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===gf.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(h2o);return n}};var gTe=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(hTe.getEnvironmentVariables())?no.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(dTe.getEnvironmentVariables())?no.APP_SERVICE:this.allEnvironmentVariablesAreDefined(mTe.getEnvironmentVariables())?no.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(pTe.getEnvironmentVariables())?no.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(fTe.getEnvironmentVariables())?no.AZURE_ARC:no.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=hTe.tryCreate(e,r,n,o,s,c)||dTe.tryCreate(e,r,n,o,s)||mTe.tryCreate(e,r,n,o,s)||pTe.tryCreate(e,r,n,o,s,c)||fTe.tryCreate(e,r,n,o,s,c)||gGe.tryCreate(e,r,n,o,s);if(!l)throw Wp(xHe);return l}};var m2o=[no.SERVICE_FABRIC],Uce=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=mnn(e||{}),this.logger=new r0(this.config.system.loggerOptions,Mce,_S);let r={canonicalAuthority:er.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new Z7(this.logger,this.config.managedIdentityId.id,pce,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new HM;let n={protocolMode:Xy.AAD,knownAuthorities:[ABt],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new gP(ABt,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new Qh,!0),this.fakeClientCredentialClient=new Bce({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new gTe(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new J7}async acquireToken(e){if(!e.resource)throw vl(uce.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&&m2o.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(er.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===er.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 gTe.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var AGe=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=>gY.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 g2o=er.PromptValue,A2o=er.ResponseMode;p();p();p();p();p();function ATe(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(ATe,"getRandomIntegerInclusive");function yTe(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+ATe(0,n/2)}}a(yTe,"calculateRetryDelay");p();function Qce(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Qce,"isObject");p();function TY(t){if(Qce(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(TY,"isError");p();p();var fan=require("node:crypto");var f3t,y2o=typeof((f3t=globalThis?.crypto)===null||f3t===void 0?void 0:f3t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):fan.randomUUID;function qce(){return y2o()}a(qce,"randomUUID");p();var p3t,h3t,m3t,g3t,pan=typeof window<"u"&&typeof window.document<"u",han=typeof self=="object"&&typeof self?.importScripts=="function"&&(((p3t=self.constructor)===null||p3t===void 0?void 0:p3t.name)==="DedicatedWorkerGlobalScope"||((h3t=self.constructor)===null||h3t===void 0?void 0:h3t.name)==="ServiceWorkerGlobalScope"||((m3t=self.constructor)===null||m3t===void 0?void 0:m3t.name)==="SharedWorkerGlobalScope"),man=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",gan=typeof Bun<"u"&&typeof Bun.version<"u",rQ=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((g3t=globalThis.process.versions)===null||g3t===void 0)&&g3t.node);var Aan=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function xC(t,e){return Buffer.from(t,e)}a(xC,"stringToUint8Array");p();var A3t="REDACTED",E2o=["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"],_2o=["api-version"],EP=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=E2o.concat(e),r=_2o.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)||Qce(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,A3t);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]=A3t;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]=A3t;return r}};p();p();p();p();var IY=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function E3t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new IY(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(E3t,"createAbortablePromise");p();var T2o="The delay was aborted.";function _3t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return E3t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??T2o})}a(_3t,"delay");p();function jce(t){if(TY(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(jce,"getErrorMessage");p();function yan(t,e){return yTe(t,e)}a(yan,"calculateRetryDelay");function yGe(t){return TY(t)}a(yGe,"isError");var EGe=rQ,Hce=rQ;p();var ETe=lo("IdentityUtils"),Ean="1.0";function xY(t,e,r){let n=a(o=>(ETe.getToken.info(o),new Sx({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(xY,"ensureValidMsalToken");function v3t(t){let e=t?.authorityHost;return!e&&Hce&&(e=process.env.AZURE_AUTHORITY_HOST),e??lSe}a(v3t,"getAuthorityHost");function C3t(t,e){return e||(e=lSe),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(C3t,"getAuthority");function _an(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(_an,"getKnownAuthorities");var _Ge=a((t,e=EGe?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case vS.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case vS.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case vS.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case vS.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function vGe(t){switch(t){case"error":return vS.LogLevel.Error;case"info":return vS.LogLevel.Info;case"verbose":return vS.LogLevel.Verbose;case"warning":return vS.LogLevel.Warning;default:return vS.LogLevel.Info}}a(vGe,"getMSALLogLevel");function wY(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return ETe.info(Us(t,e.message)),new Mn(e.message);case"device_code_polling_cancelled":return new IY("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":ETe.info(Us(t,`Authentication returned errorCode ${n.errorCode}`));break;default:ETe.info(Us(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"?(ETe.info(Us(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new Sx({scopes:t,getTokenOptions:r,message:e.message})}a(wY,"handleMsalError");function van(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(van,"publicToMsal");function Can(t,e){return{authority:e.environment??Ltn,homeAccountId:e.homeAccountId,tenantId:e.tenantId||Otn,username:e.username,clientId:t,version:Ean}}a(Can,"msalToPublic");function b3t(t){let e=JSON.parse(t);if(e.version&&e.version!==Ean)throw Error("Unsupported AuthenticationRecord version");return e}a(b3t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function x2o(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(x2o,"isPrimitiveBody");function w2o(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(w2o,"handleNullableResponseAndWrappableBody");function S3t(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 w2o({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:x2o(t.parsedBody,l)})}a(S3t,"flattenResponse");var WM={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 zM=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var ban=require("node:os"),San=de(require("node:util"),1),Tan=de(require("node:process"),1);function Ian(t,...e){Tan.stderr.write(`${San.default.format(t,...e)}${ban.EOL}`)}a(Ian,"log");var xan=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,wan,T3t=[],I3t=[],bGe=[];xan&&x3t(xan);var Ran=Object.assign(t=>kan(t),{enable:x3t,enabled:w3t,disable:R2o,log:Ian});function x3t(t){wan=t,T3t=[],I3t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?I3t.push(new RegExp(`^${n.substr(1)}$`)):T3t.push(new RegExp(`^${n}$`));for(let n of bGe)n.enabled=w3t(n.namespace)}a(x3t,"enable");function w3t(t){if(t.endsWith("*"))return!0;for(let e of I3t)if(e.test(t))return!1;for(let e of T3t)if(e.test(t))return!0;return!1}a(w3t,"enabled");function R2o(){let t=wan||"";return x3t(""),t}a(R2o,"disable");function kan(t){let e=Object.assign(r,{enabled:w3t(t),destroy:k2o,log:Ran.log,namespace:t,extend:P2o});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),bGe.push(e),e}a(kan,"createDebugger");function k2o(){let t=bGe.indexOf(this);return t>=0?(bGe.splice(t,1),!0):!1}a(k2o,"destroy");function P2o(t){let e=kan(`${this.namespace}:${t}`);return e.log=this.log,e}a(P2o,"extend");var Gce=Ran;var R3t=["verbose","info","warning","error"],Pan={verbose:400,info:300,warning:200,error:100};function Dan(t,e){e.log=(...r)=>{t.log(...r)}}a(Dan,"patchLogMethod");function Nan(t){return R3t.includes(t)}a(Nan,"isTypeSpecRuntimeLogLevel");function D2o(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=Gce(t.namespace);o.log=(...f)=>{Gce.log(...f)};function s(f){if(f&&!Nan(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${R3t.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);Gce.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(Nan(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${R3t.join(", ")}.`));function c(f){return!!(n&&Pan[f.level]<=Pan[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(Dan(f,m),c(m)){let g=Gce.disable();Gce.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 Dan(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(D2o,"createLoggerContext");var Man=D2o({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),N2o=Man.logger;function vTe(t){return Man.createClientLogger(t)}a(vTe,"createClientLogger");p();function SGe(t){return t.toLowerCase()}a(SGe,"normalizeName");function*M2o(t){for(let e of t.values())yield[e.name,e.value]}a(M2o,"headerIterator");var k3t=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(SGe(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(SGe(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(SGe(e))}delete(e){this._headersMap.delete(SGe(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 M2o(this._headersMap)}};function CS(t){return new k3t(t)}a(CS,"createHttpHeaders");p();p();p();var P3t=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:CS(),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||qce(),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 TGe(t){return new P3t(t)}a(TGe,"createPipelineRequest");p();var Oan=new Set(["Deserialize","Serialize","Retry","Sign"]),D3t=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&&!Oan.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Oan.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,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);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 E of y.dependants)E.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 IGe(){return D3t.create()}a(IGe,"createEmptyPipeline");p();p();var Lan=require("node:util"),Ban=Lan.inspect.custom;var O2o=new EP,TA=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,Ban,{value:a(()=>`RestError: ${this.message} + ${O2o.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};TA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";TA.PARSE_ERROR="PARSE_ERROR";function xGe(t){return t instanceof TA?!0:TY(t)&&t.name==="RestError"}a(xGe,"isRestError");p();p();var $ce=de(require("node:http"),1),Vce=de(require("node:https"),1),RGe=de(require("node:zlib"),1),Uan=require("node:stream");p();var Px=vTe("ts-http-runtime");var L2o={};function CTe(t){return t&&typeof t.pipe=="function"}a(CTe,"isReadableStream");function Fan(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(Fan,"isStreamComplete");function Qan(t){return t&&typeof t.byteLength=="number"}a(Qan,"isArrayBuffer");var wGe=class extends Uan.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}},N3t=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 zM("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 EP;Px.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=Q2o(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let _=e.onUploadProgress,v=new wGe(_);v.on("error",b=>{Px.error("Error in upload progress",b)}),CTe(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=B2o(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?F2o(m,g):m;let E=e.onDownloadProgress;if(E){let _=new wGe(E);_.on("error",v=>{Px.error("Error in download progress",v)}),h.pipe(_),h=_}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 U2o(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();CTe(f)&&(m=Fan(f));let g=Promise.resolve();CTe(h)&&(g=Fan(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{Px.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?$ce.request(u,d):Vce.request(u,d);h.once("error",m=>{var g;f(new TA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:TA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new zM("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&CTe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):Qan(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(Px.error("Unrecognized body type",n),f(new TA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?$ce.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new $ce.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Vce.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:L2o,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(Px.info("No cached TLS Agent exist, creating a new Agent"),c=new Vce.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function B2o(t){let e=CS();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(B2o,"getResponseHeaders");function F2o(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=RGe.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=RGe.createInflate();return t.pipe(n),n}return t}a(F2o,"getDecodedResponseStream");function U2o(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 TA(`Error reading response as text: ${o.message}`,{code:TA.PARSE_ERROR}))})})}a(U2o,"streamToText");function Q2o(t){return t?Buffer.isBuffer(t)?t.length:CTe(t)?null:Qan(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(Q2o,"getBodyLength");function qan(){return new N3t}a(qan,"createNodeHttpClient");function kGe(){return qan()}a(kGe,"createDefaultHttpClient");p();p();p();p();var M3t="logPolicy";function PGe(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:Px.info,n=new EP({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:M3t,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(PGe,"logPolicy");p();var O3t="redirectPolicy",jan=["GET","HEAD"];function DGe(t={}){let{maxRetries:e=20}=t;return{name:O3t,async sendRequest(r,n){let o=await n(r);return Han(n,o,e)}}}a(DGe,"redirectPolicy");async function Han(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&jan.includes(o.method)||s===302&&jan.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new zM(r?.abortErrorMsg?r?.abortErrorMsg:q2o)),"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(Van,"delay");function Wan(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Wan,"parseHeaderValueAsNumber");var B3t="Retry-After",j2o=["retry-after-ms","x-ms-retry-after-ms",B3t];function zan(t){if(t&&[429,503].includes(t.status))try{for(let o of j2o){let s=Wan(t,o);if(s===0||s)return s*(o===B3t?1e3:1)}let e=t.headers.get(B3t);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(zan,"getRetryAfterInMs");function Yan(t){return Number.isFinite(zan(t))}a(Yan,"isThrottlingRetryResponse");function F3t(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=zan(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(F3t,"throttlingRetryStrategy");var H2o=1e3,G2o=1e3*64;function MGe(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:H2o,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:G2o;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=V2o(l),d=u&&t.ignoreSystemErrors,f=$2o(c),h=f&&t.ignoreHttpStatusCodes;return c&&(Yan(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:yTe(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(MGe,"exponentialRetryStrategy");function $2o(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a($2o,"isExponentialRetryResponse");function V2o(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(V2o,"isSystemError");p();var W2o=vTe("ts-http-runtime retryPolicy"),z2o="retryPolicy";function nQ(t,e={maxRetries:3}){let r=e.logger||W2o;return{name:z2o,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 zM;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 Van(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(nQ,"retryPolicy");var U3t="defaultRetryPolicy";function OGe(t={}){var e;return{name:U3t,sendRequest:nQ([F3t(),MGe(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(OGe,"defaultRetryPolicy");p();var Q3t="formDataPolicy";function Y2o(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(Y2o,"formDataToFormDataMap");function LGe(){return{name:Q3t,async sendRequest(t,e){if(rQ&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=Y2o(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=K2o(t.formData):await J2o(t.formData,t),t.formData=void 0}return e(t)}}}a(LGe,"formDataPolicy");function K2o(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(K2o,"wwwFormUrlEncode");async function J2o(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:CS({"Content-Disposition":`form-data; name="${o}"`}),body:xC(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=CS();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(J2o,"prepareFormData");p();var _cn=de(z3t(),1),vcn=de(Y3t(),1);var $Do="HTTPS_PROXY",VDo="HTTP_PROXY",WDo="ALL_PROXY",zDo="NO_PROXY",K3t="proxyPolicy",Acn=[],Ccn=!1,YDo=new Map;function GGe(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(GGe,"getEnvironmentValue");function KDo(){if(!process)return;let t=GGe($Do),e=GGe(WDo),r=GGe(VDo);return t||e||r}a(KDo,"loadEnvironmentProxyValue");function JDo(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(JDo,"isBypassed");function ZDo(){let t=GGe(zDo);return Ccn=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(ZDo,"loadNoProxy");function XDo(){let t=KDo();return t?new URL(t):void 0}a(XDo,"getDefaultProxySettingsInternal");function ycn(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(ycn,"getUrlFromProxySettings");function Ecn(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&Px.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 vcn.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new _cn.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(Ecn,"setProxyAgentOnRequest");function $Ge(t,e){Ccn||Acn.push(...ZDo());let r=t?ycn(t):XDo(),n={};return{name:K3t,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!JDo(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:Acn,e?.customNoProxyList?void 0:YDo)?Ecn(o,n,r):o.proxySettings&&Ecn(o,n,ycn(o.proxySettings)),s(o)}}}a($Ge,"proxyPolicy");p();var J3t="agentPolicy";function VGe(t){return{name:J3t,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(VGe,"agentPolicy");p();var Z3t="tlsPolicy";function WGe(t){return{name:Z3t,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(WGe,"tlsPolicy");p();p();function zGe(t){return typeof t.stream=="function"}a(zGe,"isBlob");p();m3();var XGe=require("stream");function zcn(){return STe(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield TS(e.read());if(r)return yield TS(void 0);yield yield TS(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(zcn,"streamAsyncIterator");function nNo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=zcn.bind(t)),t.values||(t.values=zcn.bind(t))}a(nNo,"makeAsyncIterable");function Ycn(t){return t instanceof ReadableStream?(nNo(t),XGe.Readable.fromWeb(t)):t}a(Ycn,"ensureNodeStream");function iNo(t){return t instanceof Uint8Array?XGe.Readable.from(Buffer.from(t)):zGe(t)?Ycn(t.stream()):Ycn(t)}a(iNo,"toStream");async function Kcn(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(iNo);return XGe.Readable.from((function(){return STe(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,ZGe(d)),u;u=yield TS(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield TS(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield TS(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(Kcn,"concat");function oNo(){return`----AzSDKFormBoundary${qce()}`}a(oNo,"generateBoundary");function sNo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(sNo,"encodeHeaders");function aNo(t){return t instanceof Uint8Array?t.byteLength:zGe(t)?t.size===-1?void 0:t.size:void 0}a(aNo,"getLength");function cNo(t){let e=0;for(let r of t){let n=aNo(r);if(n===void 0)return;e+=n}return e}a(cNo,"getTotalLength");async function lNo(t,e,r){let n=[xC(`--${r}`,"utf-8"),...e.flatMap(s=>[xC(`\r +`,"utf-8"),xC(sNo(s.headers),"utf-8"),xC(`\r +`,"utf-8"),s.body,xC(`\r +--${r}`,"utf-8")]),xC(`--\r \r -`,"utf-8")],o=iNo(n);o&&t.headers.set("Content-Length",o),t.body=await Ycn(n)}a(oNo,"buildRequestBody");var STe="multipartPolicy",sNo=70,aNo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function cNo(t){if(t.length>sNo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!aNo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(cNo,"assertValidBoundary");function ZGe(){return{name:STe,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?cNo(n):n=tNo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await oNo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(ZGe,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function XGe(){return SGe()}a(XGe,"createEmptyPipeline");p();p();p();var YM=Q7("core-rest-pipeline");p();p();p();p();function rFt(t={}){return RGe(Object.assign({logger:YM.info},t))}a(rFt,"logPolicy");p();function nFt(t={}){return kGe(t)}a(nFt,"redirectPolicy");p();p();p();var Yce=de(require("node:os"),1),e$e=de(require("node:process"),1);function Kcn(){return"User-Agent"}a(Kcn,"getHeaderName");async function Jcn(t){if(e$e&&e$e.versions){let e=e$e.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",`(${Yce.arch()}-${Yce.type()}-${Yce.release()})`)}a(Jcn,"setPlatformSpecificData");p();var t$e="1.22.0";function ANo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(ANo,"getUserAgentString");function Zcn(){return Kcn()}a(Zcn,"getUserAgentHeaderName");async function r$e(t){let e=new Map;e.set("core-rest-pipeline",t$e),await Jcn(e);let r=ANo(e);return t?`${t} ${r}`:r}a(r$e,"getUserAgentValue");var Xcn=Zcn(),eln="userAgentPolicy";function iFt(t={}){let e=r$e(t.userAgentPrefix);return{name:eln,async sendRequest(r,n){return r.headers.has(Xcn)||r.headers.set(Xcn,await e),n(r)}}}a(iFt,"userAgentPolicy");p();p();var tln=Symbol("rawContent");function oFt(t){return typeof t[tln]=="function"}a(oFt,"hasRawContent");function rln(t){return oFt(t)?t[tln]():t}a(rln,"getRawContent");var n$e=STe;function sFt(){let t=ZGe();return{name:n$e,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)oFt(n.body)&&(n.body=rln(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(sFt,"multipartPolicy");p();function aFt(){return PGe()}a(aFt,"decompressResponsePolicy");p();function cFt(t={}){return NGe(t)}a(cFt,"defaultRetryPolicy");p();function lFt(){return MGe()}a(lFt,"formDataPolicy");p();function uFt(t,e){return HGe(t,e)}a(uFt,"proxyPolicy");p();var nln="setClientRequestIdPolicy";function dFt(t="x-ms-client-request-id"){return{name:nln,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(dFt,"setClientRequestIdPolicy");p();function fFt(t){return GGe(t)}a(fFt,"agentPolicy");p();function pFt(t){return $Ge(t)}a(pFt,"tlsPolicy");p();p();var Kce=TA;function TTe(t){return TGe(t)}a(TTe,"isRestError");var iln="tracingPolicy";function hFt(t={}){let e=r$e(t.userAgentPrefix),r=new yP({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=yNo();return{name:iln,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=ENo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return vNo(d,h),h}catch(h){throw _No(d,h),h}}}}a(hFt,"tracingPolicy");function yNo(){try{return dSe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:t$e})}catch(t){YM.warning(`Error when creating the TracingClient: ${jce(t)}`);return}}a(yNo,"tryCreateTracingClient");function ENo(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){YM.warning(`Skipping creating a tracing span due to an error: ${jce(n)}`);return}}a(ENo,"tryCreateSpan");function _No(t,e){try{t.setStatus({status:"error",error:gGe(e)?e:void 0}),TTe(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){YM.warning(`Skipping tracing span processing due to an error: ${jce(r)}`)}}a(_No,"tryProcessError");function vNo(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){YM.warning(`Skipping tracing span processing due to an error: ${jce(r)}`)}}a(vNo,"tryProcessResponse");p();p();function i$e(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(i$e,"wrapAbortSignalLike");var CNo="wrapAbortSignalLikePolicy";function oln(){return{name:CNo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=i$e(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(oln,"wrapAbortSignalLikePolicy");function mFt(t){var e;let r=XGe();return Hce&&(t.agent&&r.addPolicy(fFt(t.agent)),t.tlsOptions&&r.addPolicy(pFt(t.tlsOptions)),r.addPolicy(uFt(t.proxyOptions)),r.addPolicy(aFt())),r.addPolicy(oln()),r.addPolicy(lFt(),{beforePolicies:[n$e]}),r.addPolicy(iFt(t.userAgentOptions)),r.addPolicy(dFt((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(sFt(),{afterPhase:"Deserialize"}),r.addPolicy(cFt(t.retryOptions),{phase:"Retry"}),r.addPolicy(hFt(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Hce&&r.addPolicy(nFt(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(rFt(t.loggingOptions),{afterPhase:"Sign"}),r}a(mFt,"createPipelineFromOptions");p();function gFt(){let t=wGe();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?i$e(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a(gFt,"createDefaultHttpClient");p();function oQ(t){return vS(t)}a(oQ,"createHttpHeaders");p();function _P(t){return bGe(t)}a(_P,"createPipelineRequest");p();p();p();p();var SNo=Q7("core-rest-pipeline retryPolicy");function AFt(t,e={maxRetries:3}){return rQ(t,Object.assign({logger:SNo},e))}a(AFt,"retryPolicy");p();p();var TNo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function INo(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(yFt,"createTokenCycler");var lln="bearerTokenAuthenticationPolicy";async function o$e(t,e){try{return[await e(t),void 0]}catch(r){if(TTe(r)&&r.response)return[r.response,r];throw r}}a(o$e,"trySendRequest");async function xNo(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(xNo,"defaultAuthorizeRequest");function sln(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(sln,"isChallengeResponse");async function aln(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(aln,"authorizeRequestOnCaeChallenge");function s$e(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||YM,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:xNo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?yFt(o):()=>Promise.resolve(null);return{name:lln,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 o$e(f,h),sln(m)){let y=cln(m.headers.get("WWW-Authenticate"));if(y){let E;try{E=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 aln({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await o$e(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 o$e(f,h)),sln(m)&&(y=cln(m.headers.get("WWW-Authenticate")),y))){let E;try{E=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 aln({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await o$e(f,h))}}if(g)throw g;return m}}}a(s$e,"bearerTokenAuthenticationPolicy");function wNo(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(wNo,"parseChallenges");function cln(t){var e;return t?(e=wNo(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(cln,"getCaeChallengeClaims");p();p();p();p();p();p();var dln=de(uln(),1),EFt=dln.state;function sQ(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=fln(t,n);!c.propertyFound&&r&&(c=fln(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=sQ(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(sQ,"getOperationArgumentValueFromParameter");function fln(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(MNo,"deserializeResponseBody");function ONo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(ONo,"isOperationSpecEmpty");function LNo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(ONo(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 Kce(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===VM.Sequence){y=[];let E=f.xmlElementName;typeof m=="object"&&E&&(y=m[E])}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(LNo,"handleErrorResponse");async function BNo(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||Kce.PARSE_ERROR;throw new Kce(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(BNo,"parse");p();p();function mln(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===VM.Stream&&e.add(Number(r))}return e}a(mln,"getStreamingResponseStatusCodes");function KM(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(KM,"getPathStringFromParameter");var gln="serializationPolicy";function vFt(t={}){let e=t.stringifyXML;return{name:gln,async sendRequest(r,n){let o=g3(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(FNo(r,c,s),UNo(r,c,s,e)),n(r)}}}a(vFt,"serializationPolicy");function FNo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=sQ(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,KM(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||KM(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(FNo,"serializeHeaders");function UNo(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=sQ(e,r.requestBody);let m=r.requestBody.mapper,{required:g,serializedName:A,xmlName:y,xmlElementName:E,xmlNamespace:_,xmlNamespacePrefix:v,nullable:b}=m,T=m.type.name;try{if(t.body!==void 0&&t.body!==null||b&&t.body===null||g){let w=KM(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===VM.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",P=QNo(_,x,T,t.body,f);T===VM.Sequence?t.body=n(qNo(P,E||y||A,x,_),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(P,{rootName:y||A,xmlCharKey:h}))}else{if(T===VM.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=sQ(e,m);if(g!=null){let A=m.mapper.serializedName||KM(m);t.formData[A]=r.serializer.serialize(m.mapper,g,KM(m),f)}}}}a(UNo,"serializeRequestBody");function QNo(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(QNo,"getXmlValueWithNamespace");function qNo(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(qNo,"prepareXMLRootList");function CFt(t={}){let e=mFt(t??{});return t.credentialOptions&&e.addPolicy(s$e({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(vFt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(_Ft(t.deserializationOptions),{phase:"Deserialize"}),e}a(CFt,"createClientPipeline");p();var bFt;function Aln(){return bFt||(bFt=gFt()),bFt}a(Aln,"getCachedDefaultHttpClient");p();var jNo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function Eln(t,e,r,n){let o=HNo(e,r,n),s=!1,c=yln(t,o);if(e.path){let d=yln(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),GNo(d)?(c=d,s=!0):c=$No(c,d)}let{queryParams:l,sequenceParams:u}=VNo(e,r,n);return c=zNo(c,l,u,s),c}a(Eln,"getRequestUrl");function yln(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(yln,"replaceAll");function HNo(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=sQ(e,s,r),l=KM(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(HNo,"calculateUrlReplacements");function GNo(t){return t.includes("://")}a(GNo,"isAbsoluteUrl");function $No(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($No,"appendPath");function VNo(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=sQ(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,KM(c));let u=c.collectionFormat?jNo[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||KM(c),l)}}return{queryParams:o,sequenceParams:s}}a(VNo,"calculateQueryParameters");function WNo(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(WNo,"simpleParseQueryParams");function zNo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=WNo(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(zNo,"appendQueryParams");p();var SFt=Q7("core-client");var ITe=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&&SFt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||Aln(),this.pipeline=e.pipeline||YNo(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=Eln(n,r,e,this),s=_P({url:o});s.method=r.httpMethod;let c=g3(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=mln(r));try{let d=await this.sendRequest(s),f=b3t(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=b3t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function YNo(t){let e=KNo(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return CFt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(YNo,"createDefaultPipeline");function KNo(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(KNo,"getCredentialScopes");p();p();p();function _ln(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(_ln,"getIdentityTokenEndpointSuffix");p();var vln="/.default",Cln="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 xTe(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(vln)?e.substr(0,e.lastIndexOf(vln)):e}a(xTe,"mapScopesToResource");function bln(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(bln,"parseExpirationTimestamp");function Sln(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(Sln,"parseRefreshTimestamp");var wTe="noCorrelationId";function JNo(t){let e=t?.authorityHost;return AGe&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??cSe}a(JNo,"getIdentityClientAuthorityHost");var aQ=class extends ITe{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${vje}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=JNo(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){hS.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:bln(n),refreshAfterTimestamp:Sln(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return hS.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new U7(r.status,r.bodyAsText);throw hS.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;hS.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 Mc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=_ln(e),h=_P({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:oQ({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return hS.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===bje&&f.errorResponse.error==="interaction_required")return hS.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw hS.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||wTe,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(wTe)||[]];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]||wTe}async sendGetRequestAsync(e,r){let n=_P({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:oQ(r?.headers),abortSignal:this.generateAbortSignal(wTe)}),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=_P({url:e,method:"POST",body:r?.body,headers:oQ(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"));hS.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){hS.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var TFt;(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"})(TFt||(TFt={}));function c$e(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===TFt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(c$e,"calculateRegionalAuthority");p();p();function ZNo(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(ZNo,"createConfigurationErrorMessage");function yf(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=ZNo(o);throw n?.info(s),new Mn(s)}return o}a(yf,"processMultiTenantRequest");function sg(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(Us("",r)),r}}a(sg,"checkTenantId");function Jce(t,e,r){return e?(sg(t,e),e):(r||(r=Xz),r!==Xz?"common":"organizations")}a(Jce,"resolveTenantId");function Jf(t){return!t||t.length===0?[]:t.includes("*")?Ltn:t}a(Jf,"resolveAdditionallyAllowedTenantIds");var O_=lo("MsalClient");function hMo(t,e,r={}){let n=Jce(r.logger??O_,e,t),o=v3t(n,_3t(r)),s=new aQ({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:Ean(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:yGe(r.logger??O_),logLevel:EGe(wje()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(hMo,"generateMsalConfiguration");function tE(t,e,r={}){let n={msalConfig:hMo(t,e,r),cachedAccount:r.authenticationRecord?_an(r.authenticationRecord):null,pluginConfiguration:Htn.generatePluginConfiguration(r),logger:r.logger??O_},o=new Map;async function s(x={}){let P=x.enableCae?"CAE":"default",D=o.get(P);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 Lce({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),o.set(P,D),D}a(s,"getPublicApp");let c=new Map;async function l(x={}){let P=x.enableCae?"CAE":"default",D=c.get(P);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 Fce({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),c.set(P,D),D}a(l,"getConfidentialApp");async function u(x,P,D={}){if(n.cachedAccount===null)throw n.logger.getToken.info("No cached account found in local state."),new bx({scopes:P});D.claims&&(n.cachedClaims=D.claims);let N={account:n.cachedAccount,scopes:P,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(L){throw xY(P,L,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?v3t(x.tenantId,_3t(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,P,D,N){let L=null;try{L=await u(x,P,D)}catch(B){if(B.name!=="AuthenticationRequiredError")throw B;if(D.disableAutomaticAuthentication)throw new bx({scopes:P,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(L===null)try{L=await N()}catch(B){throw xY(P,B,D)}return IY(P,L,D),n.cachedAccount=L?.account??null,n.logger.getToken.info(e0(P)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}a(f,"withSilentAuthentication");async function h(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client secret"),n.msalConfig.auth.clientSecret=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:c$e(),claims:D?.claims});return IY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw xY(x,L,D)}}a(h,"getTokenByClientSecret");async function m(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client assertion"),n.msalConfig.auth.clientAssertion=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:c$e(),claims:D?.claims,clientAssertion:P});return IY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw xY(x,L,D)}}a(m,"getTokenByClientAssertion");async function g(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client certificate"),n.msalConfig.auth.clientCertificate=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:c$e(),claims:D?.claims});return IY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw xY(x,L,D)}}a(g,"getTokenByClientCertificate");async function A(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using device code");let N=await s(D);return f(N,x,D,()=>{let L={scopes:x,cancel:D?.abortSignal?.aborted??!1,deviceCodeCallback:P,authority:d(D),claims:D?.claims},B=N.acquireTokenByDeviceCode(L);return D.abortSignal&&D.abortSignal.addEventListener("abort",()=>{L.cancel=!0}),B})}a(A,"getTokenByDeviceCode");async function y(x,P,D,N={}){n.logger.getToken.info("Attempting to acquire token using username and password");let L=await s(N);return f(L,x,N,()=>{let B={scopes:x,username:P,password:D,authority:d(N),claims:N?.claims};return L.acquireTokenByUsernamePassword(B)})}a(y,"getTokenByUsernamePassword");function E(){if(n.cachedAccount)return van(t,n.cachedAccount)}a(E,"getActiveAccount");async function _(x,P,D,N,L={}){n.logger.getToken.info("Attempting to acquire token using authorization code");let B;return N?(n.msalConfig.auth.clientSecret=N,B=await l(L)):B=await s(L),f(B,x,L,()=>B.acquireTokenByCode({scopes:x,redirectUri:P,code:D,authority:d(L),claims:L?.claims}))}a(_,"getTokenByAuthorizationCode");async function v(x,P,D,N={}){O_.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(O_.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(O_.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(O_.getToken.info("Using client certificate for on behalf of flow"),n.msalConfig.auth.clientCertificate=D);let L=await l(N);try{let B=await L.acquireTokenOnBehalfOf({scopes:x,authority:d(N),claims:N.claims,oboAssertion:P});return IY(x,B,N),O_.getToken.info(e0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw xY(x,B,N)}}a(v,"getTokenOnBehalfOf");function b(x,P){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(p$e(),Xln))).default(D,{newInstance:!0})},"openBrowser"),scopes:x,authority:d(P),claims:P?.claims,loginHint:P?.loginHint,errorTemplate:P?.browserCustomizationOptions?.errorMessage,successTemplate:P?.browserCustomizationOptions?.successMessage,prompt:P?.loginHint?"login":"select_account"}}a(b,"createBaseInteractiveRequest");async function T(x,P,D={}){O_.verbose("Authentication will resume through the broker");let N=await s(D),L=b(x,D);n.pluginConfiguration.broker.parentWindowHandle?L.windowHandle=Buffer.from(n.pluginConfiguration.broker.parentWindowHandle):O_.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle."),n.pluginConfiguration.broker.enableMsaPassthrough&&((L.extraQueryParameters??={}).msal_request_type="consumer_passthrough"),P?(L.prompt="none",O_.verbose("Attempting broker authentication using the default broker account")):O_.verbose("Attempting broker authentication without the default broker account"),D.proofOfPossessionOptions&&(L.shrNonce=D.proofOfPossessionOptions.nonce,L.authenticationScheme="pop",L.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,L.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl);try{return await N.acquireTokenInteractive(L)}catch(B){if(O_.verbose(`Failed to authenticate through the broker: ${B.message}`),D.disableAutomaticAuthentication)throw new bx({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(P)return T(x,!1,D);throw B}}a(T,"getBrokeredTokenInternal");async function w(x,P,D={}){O_.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${P}`);let N=await T(x,P,D);return IY(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(e0(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,P={}){O_.getToken.info("Attempting to acquire token interactively");let D=await s(P);return f(D,x,P,async()=>{let N=b(x,P);return n.pluginConfiguration.broker.isEnabled?T(x,n.pluginConfiguration.broker.useDefaultBrokerAccount??!1,P):(P.proofOfPossessionOptions&&(N.shrNonce=P.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=P.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=P.proofOfPossessionOptions.resourceRequestUrl),D.acquireTokenInteractive(N))})}return a(R,"getTokenByInteractiveRequest"),{getActiveAccount:E,getBrokeredToken:w,getTokenByClientSecret:h,getTokenByClientAssertion:m,getTokenByClientCertificate:g,getTokenByDeviceCode:A,getTokenByUsernamePassword:y,getTokenByAuthorizationCode:_,getTokenOnBehalfOf:v,getTokenByInteractiveRequest:R}}a(tE,"createMsalClient");var NTe=require("node:crypto");var tun=require("node:fs/promises");var DTe="ClientCertificateCredential",eun=lo(DTe),MTe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${DTe}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=Jf(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(`${DTe}: 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(`${DTe}: 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=tE(r,e,{...o,logger:eun,tokenCredentialOptions:o})}async getToken(e,r={}){return Mc.withSpan(`${DTe}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,eun);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await mMo(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,NTe.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 mMo(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,tun.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,NTe.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,NTe.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(mMo,"parseCertificate");p();p();function Mx(t){return Array.isArray(t)?t:[t]}a(Mx,"ensureScopes");function ele(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(Us(t,r)),r}}a(ele,"ensureValidScopeForDevTimeCreds");function h$e(t){return t.replace(/\/.default$/,"")}a(h$e,"getScopeResource");var nun=lo("ClientSecretCredential"),OTe=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Mn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Mn("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=Jf(o?.additionallyAllowedTenants),this.msalClient=tE(r,e,{...o,logger:nun,tokenCredentialOptions:o})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,nun);let o=Mx(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var gMo=lo("UsernamePasswordCredential"),LTe=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Mn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Mn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Mn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Mn("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=e,this.additionallyAllowedTenantIds=Jf(s?.additionallyAllowedTenants),this.username=n,this.password=o,this.msalClient=tE(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,gMo);let o=Mx(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var AMo=["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 yMo(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(yMo,"getAdditionallyAllowedTenants");var m$e="EnvironmentCredential",A3=lo(m$e);function EMo(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return A3.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(EMo,"getSendCertificateChain");var BTe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=Rje(AMo).assigned.join(", ");A3.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=yMo(),l=EMo(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&sg(A3,n),n&&o&&s){A3.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new OTe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){A3.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new MTe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(A3.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),A3.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 LTe(n,o,h,m,u))}async getToken(e,r={}){return Mc.withSpan(`${m$e}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return A3.getToken.info(e0(e)),o}catch(o){let s=new U7(400,{error:`${m$e} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw A3.getToken.info(Us(e,s)),s}throw new Mn(`${m$e} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var _Mo=1e3*64,vMo=3e3;function iun(t){return AFt([{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(vMo,t.startDelayInMs):t.startDelayInMs;return Aan(e,{retryDelayInMs:n,maxRetryDelayInMs:_Mo})},"retry")}],{maxRetries:t.maxRetries})}a(iun,"imdsRetryPolicy");p();var y3="ManagedIdentityCredential - IMDS",RY=lo(y3),CMo="http://169.254.169.254",bMo="/metadata/identity/oauth2/token";function SMo(t){if(!xTe(t))throw new Error(`${y3}: Multiple scopes are not supported.`);let r=new URL(bMo,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??CMo),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:oQ(n)}}a(SMo,"prepareInvalidRequestOptions");var oun={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=xTe(e);if(!o)return RY.info(`${y3}: 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=SMo(o);return Mc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=_P(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{RY.info(`${y3}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return gGe(d)&&RY.verbose(`${y3}: Caught error ${d.name}: ${d.message}`),RY.info(`${y3}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(RY.info(`${y3}: The Azure IMDS endpoint is unavailable`),RY.info(`${y3}: ${u.bodyAsText}`),!1):(RY.info(`${y3}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var sun=lo("ClientAssertionCredential"),tle=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Mn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Mn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=Jf(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=tE(r,e,{...o,logger:sun,tokenCredentialOptions:this.options})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,sun);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var aun=require("node:fs/promises");var kY="WorkloadIdentityCredential",TMo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],FTe=lo(kY),E3=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=Rje(TMo).assigned.join(", ");FTe.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&&sg(FTe,o),!s)throw new Mn(`${kY}: 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 Mn(`${kY}: 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 Mn(`${kY}: 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`);FTe.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new tle(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${kY}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters. +`,"utf-8")],o=cNo(n);o&&t.headers.set("Content-Length",o),t.body=await Kcn(n)}a(lNo,"buildRequestBody");var TTe="multipartPolicy",uNo=70,dNo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function fNo(t){if(t.length>uNo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!dNo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(fNo,"assertValidBoundary");function e$e(){return{name:TTe,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?fNo(n):n=oNo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await lNo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(e$e,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function t$e(){return IGe()}a(t$e,"createEmptyPipeline");p();p();p();var KM=q7("core-rest-pipeline");p();p();p();p();function nFt(t={}){return PGe(Object.assign({logger:KM.info},t))}a(nFt,"logPolicy");p();function iFt(t={}){return DGe(t)}a(iFt,"redirectPolicy");p();p();p();var Yce=de(require("node:os"),1),r$e=de(require("node:process"),1);function Jcn(){return"User-Agent"}a(Jcn,"getHeaderName");async function Zcn(t){if(r$e&&r$e.versions){let e=r$e.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",`(${Yce.arch()}-${Yce.type()}-${Yce.release()})`)}a(Zcn,"setPlatformSpecificData");p();var n$e="1.22.0";function vNo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(vNo,"getUserAgentString");function Xcn(){return Jcn()}a(Xcn,"getUserAgentHeaderName");async function i$e(t){let e=new Map;e.set("core-rest-pipeline",n$e),await Zcn(e);let r=vNo(e);return t?`${t} ${r}`:r}a(i$e,"getUserAgentValue");var eln=Xcn(),tln="userAgentPolicy";function oFt(t={}){let e=i$e(t.userAgentPrefix);return{name:tln,async sendRequest(r,n){return r.headers.has(eln)||r.headers.set(eln,await e),n(r)}}}a(oFt,"userAgentPolicy");p();p();var rln=Symbol("rawContent");function sFt(t){return typeof t[rln]=="function"}a(sFt,"hasRawContent");function nln(t){return sFt(t)?t[rln]():t}a(nln,"getRawContent");var o$e=TTe;function aFt(){let t=e$e();return{name:o$e,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)sFt(n.body)&&(n.body=nln(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(aFt,"multipartPolicy");p();function cFt(){return NGe()}a(cFt,"decompressResponsePolicy");p();function lFt(t={}){return OGe(t)}a(lFt,"defaultRetryPolicy");p();function uFt(){return LGe()}a(uFt,"formDataPolicy");p();function dFt(t,e){return $Ge(t,e)}a(dFt,"proxyPolicy");p();var iln="setClientRequestIdPolicy";function fFt(t="x-ms-client-request-id"){return{name:iln,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(fFt,"setClientRequestIdPolicy");p();function pFt(t){return VGe(t)}a(pFt,"agentPolicy");p();function hFt(t){return WGe(t)}a(hFt,"tlsPolicy");p();p();var Kce=TA;function ITe(t){return xGe(t)}a(ITe,"isRestError");var oln="tracingPolicy";function mFt(t={}){let e=i$e(t.userAgentPrefix),r=new EP({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=CNo();return{name:oln,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=bNo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return TNo(d,h),h}catch(h){throw SNo(d,h),h}}}}a(mFt,"tracingPolicy");function CNo(){try{return fSe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:n$e})}catch(t){KM.warning(`Error when creating the TracingClient: ${jce(t)}`);return}}a(CNo,"tryCreateTracingClient");function bNo(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){KM.warning(`Skipping creating a tracing span due to an error: ${jce(n)}`);return}}a(bNo,"tryCreateSpan");function SNo(t,e){try{t.setStatus({status:"error",error:yGe(e)?e:void 0}),ITe(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){KM.warning(`Skipping tracing span processing due to an error: ${jce(r)}`)}}a(SNo,"tryProcessError");function TNo(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){KM.warning(`Skipping tracing span processing due to an error: ${jce(r)}`)}}a(TNo,"tryProcessResponse");p();p();function s$e(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(s$e,"wrapAbortSignalLike");var INo="wrapAbortSignalLikePolicy";function sln(){return{name:INo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=s$e(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(sln,"wrapAbortSignalLikePolicy");function gFt(t){var e;let r=t$e();return Hce&&(t.agent&&r.addPolicy(pFt(t.agent)),t.tlsOptions&&r.addPolicy(hFt(t.tlsOptions)),r.addPolicy(dFt(t.proxyOptions)),r.addPolicy(cFt())),r.addPolicy(sln()),r.addPolicy(uFt(),{beforePolicies:[o$e]}),r.addPolicy(oFt(t.userAgentOptions)),r.addPolicy(fFt((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(aFt(),{afterPhase:"Deserialize"}),r.addPolicy(lFt(t.retryOptions),{phase:"Retry"}),r.addPolicy(mFt(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Hce&&r.addPolicy(iFt(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(nFt(t.loggingOptions),{afterPhase:"Sign"}),r}a(gFt,"createPipelineFromOptions");p();function AFt(){let t=kGe();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?s$e(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a(AFt,"createDefaultHttpClient");p();function sQ(t){return CS(t)}a(sQ,"createHttpHeaders");p();function vP(t){return TGe(t)}a(vP,"createPipelineRequest");p();p();p();p();var wNo=q7("core-rest-pipeline retryPolicy");function yFt(t,e={maxRetries:3}){return nQ(t,Object.assign({logger:wNo},e))}a(yFt,"retryPolicy");p();p();var RNo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function kNo(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(EFt,"createTokenCycler");var uln="bearerTokenAuthenticationPolicy";async function a$e(t,e){try{return[await e(t),void 0]}catch(r){if(ITe(r)&&r.response)return[r.response,r];throw r}}a(a$e,"trySendRequest");async function PNo(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(PNo,"defaultAuthorizeRequest");function aln(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(aln,"isChallengeResponse");async function cln(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(cln,"authorizeRequestOnCaeChallenge");function c$e(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||KM,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:PNo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?EFt(o):()=>Promise.resolve(null);return{name:uln,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 a$e(f,h),aln(m)){let y=lln(m.headers.get("WWW-Authenticate"));if(y){let E;try{E=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 cln({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await a$e(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 a$e(f,h)),aln(m)&&(y=lln(m.headers.get("WWW-Authenticate")),y))){let E;try{E=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 cln({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await a$e(f,h))}}if(g)throw g;return m}}}a(c$e,"bearerTokenAuthenticationPolicy");function DNo(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(DNo,"parseChallenges");function lln(t){var e;return t?(e=DNo(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(lln,"getCaeChallengeClaims");p();p();p();p();p();p();var fln=de(dln(),1),_Ft=fln.state;function aQ(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=pln(t,n);!c.propertyFound&&r&&(c=pln(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=aQ(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(aQ,"getOperationArgumentValueFromParameter");function pln(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(FNo,"deserializeResponseBody");function UNo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(UNo,"isOperationSpecEmpty");function QNo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(UNo(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 Kce(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===WM.Sequence){y=[];let E=f.xmlElementName;typeof m=="object"&&E&&(y=m[E])}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(QNo,"handleErrorResponse");async function qNo(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||Kce.PARSE_ERROR;throw new Kce(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(qNo,"parse");p();p();function gln(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===WM.Stream&&e.add(Number(r))}return e}a(gln,"getStreamingResponseStatusCodes");function JM(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(JM,"getPathStringFromParameter");var Aln="serializationPolicy";function CFt(t={}){let e=t.stringifyXML;return{name:Aln,async sendRequest(r,n){let o=g3(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(jNo(r,c,s),HNo(r,c,s,e)),n(r)}}}a(CFt,"serializationPolicy");function jNo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=aQ(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,JM(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||JM(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(jNo,"serializeHeaders");function HNo(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=aQ(e,r.requestBody);let m=r.requestBody.mapper,{required:g,serializedName:A,xmlName:y,xmlElementName:E,xmlNamespace:_,xmlNamespacePrefix:v,nullable:b}=m,T=m.type.name;try{if(t.body!==void 0&&t.body!==null||b&&t.body===null||g){let w=JM(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===WM.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",P=GNo(_,x,T,t.body,f);T===WM.Sequence?t.body=n($No(P,E||y||A,x,_),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(P,{rootName:y||A,xmlCharKey:h}))}else{if(T===WM.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=aQ(e,m);if(g!=null){let A=m.mapper.serializedName||JM(m);t.formData[A]=r.serializer.serialize(m.mapper,g,JM(m),f)}}}}a(HNo,"serializeRequestBody");function GNo(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(GNo,"getXmlValueWithNamespace");function $No(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($No,"prepareXMLRootList");function bFt(t={}){let e=gFt(t??{});return t.credentialOptions&&e.addPolicy(c$e({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(CFt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(vFt(t.deserializationOptions),{phase:"Deserialize"}),e}a(bFt,"createClientPipeline");p();var SFt;function yln(){return SFt||(SFt=AFt()),SFt}a(yln,"getCachedDefaultHttpClient");p();var VNo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function _ln(t,e,r,n){let o=WNo(e,r,n),s=!1,c=Eln(t,o);if(e.path){let d=Eln(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),zNo(d)?(c=d,s=!0):c=YNo(c,d)}let{queryParams:l,sequenceParams:u}=KNo(e,r,n);return c=ZNo(c,l,u,s),c}a(_ln,"getRequestUrl");function Eln(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(Eln,"replaceAll");function WNo(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=aQ(e,s,r),l=JM(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(WNo,"calculateUrlReplacements");function zNo(t){return t.includes("://")}a(zNo,"isAbsoluteUrl");function YNo(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(YNo,"appendPath");function KNo(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=aQ(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,JM(c));let u=c.collectionFormat?VNo[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||JM(c),l)}}return{queryParams:o,sequenceParams:s}}a(KNo,"calculateQueryParameters");function JNo(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(JNo,"simpleParseQueryParams");function ZNo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=JNo(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(ZNo,"appendQueryParams");p();var TFt=q7("core-client");var xTe=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&&TFt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||yln(),this.pipeline=e.pipeline||XNo(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=_ln(n,r,e,this),s=vP({url:o});s.method=r.httpMethod;let c=g3(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=gln(r));try{let d=await this.sendRequest(s),f=S3t(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=S3t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function XNo(t){let e=eMo(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return bFt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(XNo,"createDefaultPipeline");function eMo(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(eMo,"getCredentialScopes");p();p();p();function vln(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(vln,"getIdentityTokenEndpointSuffix");p();var Cln="/.default",bln="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 wTe(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(Cln)?e.substr(0,e.lastIndexOf(Cln)):e}a(wTe,"mapScopesToResource");function Sln(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(Sln,"parseExpirationTimestamp");function Tln(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(Tln,"parseRefreshTimestamp");var RTe="noCorrelationId";function tMo(t){let e=t?.authorityHost;return EGe&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??lSe}a(tMo,"getIdentityClientAuthorityHost");var cQ=class extends xTe{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${bje}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=tMo(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){mS.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:Sln(n),refreshAfterTimestamp:Tln(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return mS.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new Q7(r.status,r.bodyAsText);throw mS.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;mS.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 Mc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=vln(e),h=vP({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:sQ({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return mS.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===Tje&&f.errorResponse.error==="interaction_required")return mS.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw mS.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||RTe,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(RTe)||[]];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]||RTe}async sendGetRequestAsync(e,r){let n=vP({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:sQ(r?.headers),abortSignal:this.generateAbortSignal(RTe)}),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=vP({url:e,method:"POST",body:r?.body,headers:sQ(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"));mS.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){mS.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var IFt;(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"})(IFt||(IFt={}));function u$e(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===IFt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(u$e,"calculateRegionalAuthority");p();p();function rMo(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(rMo,"createConfigurationErrorMessage");function yf(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=rMo(o);throw n?.info(s),new Mn(s)}return o}a(yf,"processMultiTenantRequest");function sg(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(Us("",r)),r}}a(sg,"checkTenantId");function Jce(t,e,r){return e?(sg(t,e),e):(r||(r=eY),r!==eY?"common":"organizations")}a(Jce,"resolveTenantId");function Jf(t){return!t||t.length===0?[]:t.includes("*")?Btn:t}a(Jf,"resolveAdditionallyAllowedTenantIds");var O_=lo("MsalClient");function yMo(t,e,r={}){let n=Jce(r.logger??O_,e,t),o=C3t(n,v3t(r)),s=new cQ({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:_an(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:_Ge(r.logger??O_),logLevel:vGe(kje()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(yMo,"generateMsalConfiguration");function tE(t,e,r={}){let n={msalConfig:yMo(t,e,r),cachedAccount:r.authenticationRecord?van(r.authenticationRecord):null,pluginConfiguration:Gtn.generatePluginConfiguration(r),logger:r.logger??O_},o=new Map;async function s(x={}){let P=x.enableCae?"CAE":"default",D=o.get(P);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 Lce({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),o.set(P,D),D}a(s,"getPublicApp");let c=new Map;async function l(x={}){let P=x.enableCae?"CAE":"default",D=c.get(P);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 Fce({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),c.set(P,D),D}a(l,"getConfidentialApp");async function u(x,P,D={}){if(n.cachedAccount===null)throw n.logger.getToken.info("No cached account found in local state."),new Sx({scopes:P});D.claims&&(n.cachedClaims=D.claims);let N={account:n.cachedAccount,scopes:P,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(L){throw wY(P,L,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?C3t(x.tenantId,v3t(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,P,D,N){let L=null;try{L=await u(x,P,D)}catch(B){if(B.name!=="AuthenticationRequiredError")throw B;if(D.disableAutomaticAuthentication)throw new Sx({scopes:P,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(L===null)try{L=await N()}catch(B){throw wY(P,B,D)}return xY(P,L,D),n.cachedAccount=L?.account??null,n.logger.getToken.info(e0(P)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}a(f,"withSilentAuthentication");async function h(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client secret"),n.msalConfig.auth.clientSecret=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:u$e(),claims:D?.claims});return xY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw wY(x,L,D)}}a(h,"getTokenByClientSecret");async function m(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client assertion"),n.msalConfig.auth.clientAssertion=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:u$e(),claims:D?.claims,clientAssertion:P});return xY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw wY(x,L,D)}}a(m,"getTokenByClientAssertion");async function g(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client certificate"),n.msalConfig.auth.clientCertificate=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:u$e(),claims:D?.claims});return xY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw wY(x,L,D)}}a(g,"getTokenByClientCertificate");async function A(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using device code");let N=await s(D);return f(N,x,D,()=>{let L={scopes:x,cancel:D?.abortSignal?.aborted??!1,deviceCodeCallback:P,authority:d(D),claims:D?.claims},B=N.acquireTokenByDeviceCode(L);return D.abortSignal&&D.abortSignal.addEventListener("abort",()=>{L.cancel=!0}),B})}a(A,"getTokenByDeviceCode");async function y(x,P,D,N={}){n.logger.getToken.info("Attempting to acquire token using username and password");let L=await s(N);return f(L,x,N,()=>{let B={scopes:x,username:P,password:D,authority:d(N),claims:N?.claims};return L.acquireTokenByUsernamePassword(B)})}a(y,"getTokenByUsernamePassword");function E(){if(n.cachedAccount)return Can(t,n.cachedAccount)}a(E,"getActiveAccount");async function _(x,P,D,N,L={}){n.logger.getToken.info("Attempting to acquire token using authorization code");let B;return N?(n.msalConfig.auth.clientSecret=N,B=await l(L)):B=await s(L),f(B,x,L,()=>B.acquireTokenByCode({scopes:x,redirectUri:P,code:D,authority:d(L),claims:L?.claims}))}a(_,"getTokenByAuthorizationCode");async function v(x,P,D,N={}){O_.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(O_.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(O_.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(O_.getToken.info("Using client certificate for on behalf of flow"),n.msalConfig.auth.clientCertificate=D);let L=await l(N);try{let B=await L.acquireTokenOnBehalfOf({scopes:x,authority:d(N),claims:N.claims,oboAssertion:P});return xY(x,B,N),O_.getToken.info(e0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw wY(x,B,N)}}a(v,"getTokenOnBehalfOf");function b(x,P){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(m$e(),eun))).default(D,{newInstance:!0})},"openBrowser"),scopes:x,authority:d(P),claims:P?.claims,loginHint:P?.loginHint,errorTemplate:P?.browserCustomizationOptions?.errorMessage,successTemplate:P?.browserCustomizationOptions?.successMessage,prompt:P?.loginHint?"login":"select_account"}}a(b,"createBaseInteractiveRequest");async function T(x,P,D={}){O_.verbose("Authentication will resume through the broker");let N=await s(D),L=b(x,D);n.pluginConfiguration.broker.parentWindowHandle?L.windowHandle=Buffer.from(n.pluginConfiguration.broker.parentWindowHandle):O_.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle."),n.pluginConfiguration.broker.enableMsaPassthrough&&((L.extraQueryParameters??={}).msal_request_type="consumer_passthrough"),P?(L.prompt="none",O_.verbose("Attempting broker authentication using the default broker account")):O_.verbose("Attempting broker authentication without the default broker account"),D.proofOfPossessionOptions&&(L.shrNonce=D.proofOfPossessionOptions.nonce,L.authenticationScheme="pop",L.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,L.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl);try{return await N.acquireTokenInteractive(L)}catch(B){if(O_.verbose(`Failed to authenticate through the broker: ${B.message}`),D.disableAutomaticAuthentication)throw new Sx({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(P)return T(x,!1,D);throw B}}a(T,"getBrokeredTokenInternal");async function w(x,P,D={}){O_.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${P}`);let N=await T(x,P,D);return xY(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(e0(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,P={}){O_.getToken.info("Attempting to acquire token interactively");let D=await s(P);return f(D,x,P,async()=>{let N=b(x,P);return n.pluginConfiguration.broker.isEnabled?T(x,n.pluginConfiguration.broker.useDefaultBrokerAccount??!1,P):(P.proofOfPossessionOptions&&(N.shrNonce=P.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=P.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=P.proofOfPossessionOptions.resourceRequestUrl),D.acquireTokenInteractive(N))})}return a(R,"getTokenByInteractiveRequest"),{getActiveAccount:E,getBrokeredToken:w,getTokenByClientSecret:h,getTokenByClientAssertion:m,getTokenByClientCertificate:g,getTokenByDeviceCode:A,getTokenByUsernamePassword:y,getTokenByAuthorizationCode:_,getTokenOnBehalfOf:v,getTokenByInteractiveRequest:R}}a(tE,"createMsalClient");var MTe=require("node:crypto");var nun=require("node:fs/promises");var NTe="ClientCertificateCredential",tun=lo(NTe),OTe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${NTe}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=Jf(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(`${NTe}: 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(`${NTe}: 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=tE(r,e,{...o,logger:tun,tokenCredentialOptions:o})}async getToken(e,r={}){return Mc.withSpan(`${NTe}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,tun);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await EMo(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,MTe.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 EMo(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,nun.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,MTe.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,MTe.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(EMo,"parseCertificate");p();p();function Ox(t){return Array.isArray(t)?t:[t]}a(Ox,"ensureScopes");function ele(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(Us(t,r)),r}}a(ele,"ensureValidScopeForDevTimeCreds");function g$e(t){return t.replace(/\/.default$/,"")}a(g$e,"getScopeResource");var iun=lo("ClientSecretCredential"),LTe=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Mn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Mn("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=Jf(o?.additionallyAllowedTenants),this.msalClient=tE(r,e,{...o,logger:iun,tokenCredentialOptions:o})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,iun);let o=Ox(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var _Mo=lo("UsernamePasswordCredential"),BTe=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Mn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Mn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Mn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Mn("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=e,this.additionallyAllowedTenantIds=Jf(s?.additionallyAllowedTenants),this.username=n,this.password=o,this.msalClient=tE(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,_Mo);let o=Ox(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var vMo=["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 CMo(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(CMo,"getAdditionallyAllowedTenants");var A$e="EnvironmentCredential",A3=lo(A$e);function bMo(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return A3.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(bMo,"getSendCertificateChain");var FTe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=Pje(vMo).assigned.join(", ");A3.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=CMo(),l=bMo(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&sg(A3,n),n&&o&&s){A3.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new LTe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){A3.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new OTe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(A3.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),A3.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 BTe(n,o,h,m,u))}async getToken(e,r={}){return Mc.withSpan(`${A$e}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return A3.getToken.info(e0(e)),o}catch(o){let s=new Q7(400,{error:`${A$e} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw A3.getToken.info(Us(e,s)),s}throw new Mn(`${A$e} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var SMo=1e3*64,TMo=3e3;function oun(t){return yFt([{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(TMo,t.startDelayInMs):t.startDelayInMs;return yan(e,{retryDelayInMs:n,maxRetryDelayInMs:SMo})},"retry")}],{maxRetries:t.maxRetries})}a(oun,"imdsRetryPolicy");p();var y3="ManagedIdentityCredential - IMDS",kY=lo(y3),IMo="http://169.254.169.254",xMo="/metadata/identity/oauth2/token";function wMo(t){if(!wTe(t))throw new Error(`${y3}: Multiple scopes are not supported.`);let r=new URL(xMo,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??IMo),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:sQ(n)}}a(wMo,"prepareInvalidRequestOptions");var sun={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=wTe(e);if(!o)return kY.info(`${y3}: 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=wMo(o);return Mc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=vP(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{kY.info(`${y3}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return yGe(d)&&kY.verbose(`${y3}: Caught error ${d.name}: ${d.message}`),kY.info(`${y3}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(kY.info(`${y3}: The Azure IMDS endpoint is unavailable`),kY.info(`${y3}: ${u.bodyAsText}`),!1):(kY.info(`${y3}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var aun=lo("ClientAssertionCredential"),tle=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Mn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Mn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=Jf(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=tE(r,e,{...o,logger:aun,tokenCredentialOptions:this.options})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,aun);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var cun=require("node:fs/promises");var PY="WorkloadIdentityCredential",RMo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],UTe=lo(PY),E3=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=Pje(RMo).assigned.join(", ");UTe.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&&sg(UTe,o),!s)throw new Mn(`${PY}: 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 Mn(`${PY}: 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 Mn(`${PY}: 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`);UTe.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new tle(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${PY}: 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 FTe.info(n),new Mn(n)}return FTe.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 Mn(`${kY}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,aun.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Mn(`${kY}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var cun="ManagedIdentityCredential - Token Exchange",IMo=lo(cun),$Ft={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||IMo.info(`${cun}: 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 E3({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var TS=lo("ManagedIdentityCredential"),dQ=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 aQ({...n,additionalPolicies:[{policy:iun(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Uce({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:EGe(wje()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:yGe(TS)}}}),this.isAvailableIdentityClient=new aQ({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw TS.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn("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 TS.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn(`ManagedIdentityCredential: ${Cln}`);if(TS.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];TS.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){TS.getToken.info("Using the MSAL provider for Managed Identity.");let n=xTe(e);if(!n)throw new Mn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Mc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await $Ft.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(TS.getToken.info(`MSAL Identity source: ${s}`),o){TS.getToken.info("Using the token exchange managed identity.");let u=await $Ft.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Mn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(TS.getToken.info("Using the IMDS endpoint to probe for availability."),!await oun.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Mn("Attempted to use the IMDS endpoint, but it is not available.");TS.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),TS.getToken.info(e0(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw TS.getToken.error(Us(e,o)),o.name==="AuthenticationRequiredError"?o:xMo(o)?new Mn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Mn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(TS.getToken.info(s),new bx({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 xMo(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(xMo,"isNetworkError");p();var lun=de(require("child_process"),1);var JM=lo("AzureDeveloperCliCredential"),g$e={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:"},uun={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(JM.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(" ");lun.default.exec(d,{cwd:uun.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},UTe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(sg(JM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=yf(this.tenantId,r,this.additionallyAllowedTenantIds);n&&sg(JM,n);let o;return typeof e=="string"?o=[e]:o=e,JM.getToken.info(`Using the scopes ${e}`),Mc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{ele(d,JM)});let s=await uun.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 Mn(g$e.notInstalled);throw JM.getToken.info(Us(e,d)),d}if(l){let d=new Mn(g$e.login);throw JM.getToken.info(Us(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Mn(`${g$e.claim} ${f}`);throw JM.getToken.info(Us(e,h)),h}try{let d=JSON.parse(s.stdout);return JM.getToken.info(e0(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Mn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Mn(s.message||g$e.unknown);throw JM.getToken.info(Us(e,c)),c}})}};p();var dun=de(require("child_process"),1);p();function VFt(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(Us("",r)),r}}a(VFt,"checkSubscription");var IS=lo("AzureCliCredential"),QTe={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:'},fun={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(IS.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(" ");dun.default.exec(d,{cwd:fun.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},qTe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(sg(IS,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(VFt(IS,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=Jf(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 Mn(`${QTe.claim} ${l}`);throw IS.getToken.info(Us(n,d)),d}let s=yf(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&sg(IS,s),this.subscription&&VFt(IS,this.subscription),IS.getToken.info(`Using the scope ${n}`),Mc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{ele(n,IS);let c=h$e(n),l=await fun.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 Mn(QTe.notInstalled);throw IS.getToken.info(Us(e,h)),h}if(d){let h=new Mn(QTe.login);throw IS.getToken.info(Us(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return IS.getToken.info(e0(e)),m}catch(h){throw l.stderr?new Mn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Mn(c.message||QTe.unknown);throw IS.getToken.info(Us(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 IS.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 Mn(`${QTe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var pun=de(require("node:child_process"),1),hun={execFile(t,e,r){return new Promise((n,o)=>{pun.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 ZM=lo("AzurePowerShellCredential"),gun=process.platform==="win32";function Aun(t){return gun?`${t}.exe`:t}a(Aun,"formatCommand");async function mun(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await hun.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(mun,"runCommands");var yun={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"},A$e={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."},wMo=a(t=>t.message.match(`(.*)${yun.login}(.*)`),"isLoginError"),RMo=a(t=>t.message.match(yun.installed),"isNotInstalledError"),WFt=[Aun("pwsh")];gun&&WFt.push(Aun("powershell"));var jTe=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(sg(ZM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...WFt]){try{await mun([[o,"/?"]],n)}catch{WFt.shift();continue}let c=(await mun([[o,"-NoProfile","-NonInteractive","-Command",` + "AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;throw UTe.info(n),new Mn(n)}return UTe.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 Mn(`${PY}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,cun.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Mn(`${PY}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var lun="ManagedIdentityCredential - Token Exchange",kMo=lo(lun),VFt={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||kMo.info(`${lun}: 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 E3({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var IS=lo("ManagedIdentityCredential"),fQ=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 cQ({...n,additionalPolicies:[{policy:oun(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Uce({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:vGe(kje()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:_Ge(IS)}}}),this.isAvailableIdentityClient=new cQ({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw IS.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn("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 IS.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn(`ManagedIdentityCredential: ${bln}`);if(IS.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];IS.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){IS.getToken.info("Using the MSAL provider for Managed Identity.");let n=wTe(e);if(!n)throw new Mn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Mc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await VFt.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(IS.getToken.info(`MSAL Identity source: ${s}`),o){IS.getToken.info("Using the token exchange managed identity.");let u=await VFt.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Mn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(IS.getToken.info("Using the IMDS endpoint to probe for availability."),!await sun.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Mn("Attempted to use the IMDS endpoint, but it is not available.");IS.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),IS.getToken.info(e0(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw IS.getToken.error(Us(e,o)),o.name==="AuthenticationRequiredError"?o:PMo(o)?new Mn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Mn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(IS.getToken.info(s),new Sx({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 PMo(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(PMo,"isNetworkError");p();var uun=de(require("child_process"),1);var ZM=lo("AzureDeveloperCliCredential"),y$e={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:"},dun={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(ZM.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(" ");uun.default.exec(d,{cwd:dun.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},QTe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(sg(ZM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=yf(this.tenantId,r,this.additionallyAllowedTenantIds);n&&sg(ZM,n);let o;return typeof e=="string"?o=[e]:o=e,ZM.getToken.info(`Using the scopes ${e}`),Mc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{ele(d,ZM)});let s=await dun.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 Mn(y$e.notInstalled);throw ZM.getToken.info(Us(e,d)),d}if(l){let d=new Mn(y$e.login);throw ZM.getToken.info(Us(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Mn(`${y$e.claim} ${f}`);throw ZM.getToken.info(Us(e,h)),h}try{let d=JSON.parse(s.stdout);return ZM.getToken.info(e0(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Mn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Mn(s.message||y$e.unknown);throw ZM.getToken.info(Us(e,c)),c}})}};p();var fun=de(require("child_process"),1);p();function WFt(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(Us("",r)),r}}a(WFt,"checkSubscription");var xS=lo("AzureCliCredential"),qTe={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:'},pun={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(xS.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(" ");fun.default.exec(d,{cwd:pun.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},jTe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(sg(xS,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(WFt(xS,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=Jf(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 Mn(`${qTe.claim} ${l}`);throw xS.getToken.info(Us(n,d)),d}let s=yf(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&sg(xS,s),this.subscription&&WFt(xS,this.subscription),xS.getToken.info(`Using the scope ${n}`),Mc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{ele(n,xS);let c=g$e(n),l=await pun.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 Mn(qTe.notInstalled);throw xS.getToken.info(Us(e,h)),h}if(d){let h=new Mn(qTe.login);throw xS.getToken.info(Us(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return xS.getToken.info(e0(e)),m}catch(h){throw l.stderr?new Mn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Mn(c.message||qTe.unknown);throw xS.getToken.info(Us(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 xS.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 Mn(`${qTe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var hun=de(require("node:child_process"),1),mun={execFile(t,e,r){return new Promise((n,o)=>{hun.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 XM=lo("AzurePowerShellCredential"),Aun=process.platform==="win32";function yun(t){return Aun?`${t}.exe`:t}a(yun,"formatCommand");async function gun(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await mun.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(gun,"runCommands");var Eun={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"},E$e={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."},DMo=a(t=>t.message.match(`(.*)${Eun.login}(.*)`),"isLoginError"),NMo=a(t=>t.message.match(Eun.installed),"isNotInstalledError"),zFt=[yun("pwsh")];Aun&&zFt.push(yun("powershell"));var HTe=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(sg(XM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...zFt]){try{await gun([[o,"/?"]],n)}catch{zFt.shift();continue}let c=(await gun([[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' @@ -1755,26 +1755,26 @@ Error Description: '${s.message}'`,this.correlationId)}return null}return n||(th } Write-Output (ConvertTo-Json $result) - `]]))[0];return kMo(c)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,r={}){return Mc.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 Mn(`${A$e.claim} ${l}`);throw ZM.getToken.info(Us(n,d)),d}let s=yf(this.tenantId,r,this.additionallyAllowedTenantIds);s&&sg(ZM,s);try{ele(n,ZM),ZM.getToken.info(`Using the scope ${n}`);let c=h$e(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return ZM.getToken.info(e0(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(RMo(c)){let u=new Mn(A$e.installed);throw ZM.getToken.info(Us(n,u)),u}else if(wMo(c)){let u=new Mn(A$e.login);throw ZM.getToken.info(Us(n,u)),u}let l=new Mn(`${c}. ${A$e.troubleshoot}`);throw ZM.getToken.info(Us(n,l)),l}})}};async function kMo(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&&ZM.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(kMo,"parseJsonToken");p();var Eun=require("node:fs/promises");var PMo="common",DMo="aebc6443-996d-45c2-90f0-388ff96faa56",zFt=lo("VisualStudioCodeCredential"),NMo={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function MMo(t){let e=NMo[t];if(e)throw new Mn(e)}a(MMo,"checkUnsupportedTenant");var HTe=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(sg(zFt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=PMo,this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),MMo(this.tenantId)}async prepare(e){let r=yf(this.tenantId,this.options,this.additionallyAllowedTenantIds,zFt)||this.tenantId;if(!jtn()||!Cje)throw new Mn("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(Cje,e);this.msalClient=tE(DMo,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=Mx(e);if(await this.prepareOnce(n),!this.msalClient)throw new Mn("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,Eun.readFile)(e,{encoding:"utf8"});return C3t(n)}catch(n){throw zFt.getToken.info(Us(r,n)),new Mn("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 y$e=lo("BrokerCredential"),E$e=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=Jce(y$e,e.tenantId),this.brokerAdditionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:y$e,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=tE(Xz,this.brokerTenantId,r)}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,y$e);let o=Mx(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw y$e.getToken.info(Us(o,s)),new Mn("Failed to acquire token using broker authentication",{cause:s})}})}};function _un(t={}){return new E$e(t)}a(_un,"createDefaultBrokerCredential");function YFt(t={}){return new HTe(t)}a(YFt,"createDefaultVisualStudioCodeCredential");function KFt(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 dQ(c)}if(o&&r){let c={...t,tenantId:s};return new dQ(r,c)}if(e){let c={...t,clientId:e};return new dQ(c)}return new dQ(t)}a(KFt,"createDefaultManagedIdentityCredential");function JFt(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 E3(s)}if(o){let s={...t,tenantId:o};return new E3(s)}return new E3(t)}a(JFt,"createDefaultWorkloadIdentityCredential");function ZFt(t={}){return new UTe(t)}a(ZFt,"createDefaultAzureDeveloperCliCredential");function XFt(t={}){return new qTe(t)}a(XFt,"createDefaultAzureCliCredential");function e8t(t={}){return new jTe(t)}a(e8t,"createDefaultAzurePowershellCredential");function t8t(t={}){return new BTe(t)}a(t8t,"createDefaultEnvironmentCredential");var _$e=lo("DefaultAzureCredential"),r8t=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return _$e.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},rle=class extends fSe{static{a(this,"DefaultAzureCredential")}constructor(e){OMo(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[YFt,XFt,e8t,ZFt,_un],o=[t8t,JFt,KFt],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=[t8t];break;case"workloadidentitycredential":s=[JFt];break;case"managedidentitycredential":s=[()=>KFt({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[YFt];break;case"azureclicredential":s=[XFt];break;case"azurepowershellcredential":s=[e8t];break;case"azuredeveloperclicredential":s=[ZFt];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 _$e.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return _$e.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new r8t(u.name,d.message)}});super(...l)}};function OMo(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 _$e.warning(n),new Error(n)}}}a(OMo,"validateRequiredEnvVars");p();var ICu=lo("InteractiveBrowserCredential");p();var LCu=lo("DeviceCodeCredential");p();var LMo="AzurePipelinesCredential",VCu=lo(LMo);p();var rbu=lo("AuthorizationCodeCredential");p();var BMo="OnBehalfOfCredential",fbu=lo(BMo);p();var v$e=new fe("capiFetchUtilities");function i0(t){let e={...Gy(t),"X-GitHub-Api-Version":"2026-06-01"},r=S$e(t.get(Ir));return r&&(e["Copilot-Integration-Id"]=r),e}a(i0,"getCapiHeaders");function vun(t,e){return v$e.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":VW.api,"Copilot-Integration-Id":"autodev-test"}}a(vun,"addMsBenchCesProxyHeaders");async function Cun(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;v$e.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await Ntn(process.env.HMAC_SECRET,r);return{...e,...n}}a(Cun,"addMsBenchHmacHeaders");function FMo(){return CB()&&!!process.env.HMAC_SECRET}a(FMo,"isMsBenchHmacModeEnabled");function n8t(){return CB()&&!process.env.HMAC_SECRET}a(n8t,"isMsBenchCesProxyModeEnabled");async function C$e(t,e){return process.env.HMAC_SECRET?await Cun(t,e):vun(t,e)}a(C$e,"addMsBenchHeaders");async function nle(t,e,r){let n=r;n8t()&&(n=await UMo());let o={...e,Authorization:`Bearer ${n}`};return{headers:FMo()?await Cun(t,o):n8t()?vun(t,o):o,token:n}}a(nle,"applyMsBenchAuth");function ile(t,e,...r){if(n8t()){v$e.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 tx(t,e,"api",...r)}a(ile,"getCapiUrl");function ole(t,e,r){(e.status===401||e.status===403)&&(v$e.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Qt).resetToken("capi_fetch",e.status))}a(ole,"handleCapiAuthError");async function PY(t,e,r){r??=await t.get(Qt).getToken();let n=ile(t,r,e),{headers:o}=await nle(t,i0(t),r.token),s=await t.get(tr).fetch(new URL(n).href,{method:"GET",headers:o});return ole(t,s,e),s}a(PY,"fetchCapiUrl");async function b$e(t,e,r){let n=await t.get(Qt).getToken(),o=ile(t,n,e),{headers:s}=await nle(t,i0(t),n.token),c=await t.get(tr).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return ole(t,c,e),c}a(b$e,"postCapiUrl");async function UMo(){let e=await new rle().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(UMo,"getMsBenchToken");p();var Sun=600*1e3,Rn={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"},x$e={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},sle=new Set([Rn.O1Ga,Rn.O3Mini,Rn.O1Mini,Rn.Gemini20Pro,Rn.Gemini20Flash]);function w$e(t){return t.startsWith("claude")}a(w$e,"isClaudeFamily");function xS(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[Rn.Gpt4o]:r=[Rn.Gpt4o,Rn.Gpt4turbo,Rn.Gpt4,Rn.O1Mini,Rn.O1Ga,Rn.Claude35Sonnet,Rn.O3Mini,Rn.Gemini20Flash,Rn.Claude37Sonnet,Rn.Claude37SonnetThought,Rn.Gpt45,Rn.Gpt41,Rn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt35turbo,Rn.Gpt41,Rn.CopilotBase];break;case"gitCommit":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt4,Rn.Gpt41,Rn.CopilotBase];break;case"nesStubs":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt41,Rn.CopilotBase];break;case"codeMapper":r=[Rn.Gpt41]}return r}a(xS,"getSupportedModelFamiliesForPrompt");var Tun={textEmbedding3Small:"text-embedding-3-small"},QMo=S.Object({type:S.Union([S.Literal("chat"),S.Literal("embeddings"),S.Literal("completion")]),tokenizer:S.String(),family:S.String(),object:S.String(),supports:S.Optional(S.Object({tool_calls:S.Optional(S.Boolean()),parallel_tool_calls:S.Optional(S.Boolean()),streaming:S.Optional(S.Boolean()),vision:S.Optional(S.Boolean()),adaptive_thinking:S.Optional(S.Boolean()),reasoning_effort:S.Optional(S.Array(S.String()))})),limits:S.Optional(S.Object({max_inputs:S.Optional(S.Number()),max_prompt_tokens:S.Optional(S.Number()),max_output_tokens:S.Optional(S.Number()),max_non_streaming_output_tokens:S.Optional(S.Number()),max_context_window_tokens:S.Optional(S.Number())}))}),bun=S.Object({cache_price:S.Optional(S.Number()),input_price:S.Optional(S.Number()),output_price:S.Optional(S.Number()),context_max:S.Optional(S.Number())}),qMo=S.Object({id:S.String(),vendor:S.Optional(S.String()),name:S.String(),version:S.String(),model_picker_enabled:S.Boolean(),model_picker_category:S.Optional(S.String()),model_picker_price_category:S.Optional(S.String()),is_chat_default:S.Optional(S.Boolean()),is_chat_fallback:S.Optional(S.Boolean()),capabilities:QMo,billing:S.Optional(S.Object({is_premium:S.Optional(S.Boolean()),multiplier:S.Optional(S.Number()),token_prices:S.Optional(S.Object({batch_size:S.Optional(S.Number()),default:S.Optional(bun),long_context:S.Optional(bun)}))})),custom_model:S.Optional(S.Object({key_name:S.Optional(S.String()),owner_name:S.Optional(S.String()),owner_type:S.Optional(S.String()),provider:S.Optional(S.String())})),object:S.String(),preview:S.Optional(S.Boolean()),isExperimental:S.Optional(S.Boolean()),policy:S.Optional(S.Object({state:S.String(),terms:S.String()})),supported_endpoints:S.Optional(S.Array(S.String())),warning_messages:S.Optional(S.Array(S.Object({message:S.String()}))),info_messages:S.Optional(S.Array(S.Object({message:S.String()})))}),Iun=S.Object({data:S.Array(qMo)});function xun(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(xun,"getDegradationReason");var xs=class{static{a(this,"ModelMetadataProvider")}},T$e=class extends xs{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 PY(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){Nr.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Nr.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new aM(r)}await this.processModels(r)}async fetchModel(r){let n=await PY(this.ctx,`/models/${r}`);if(!n.ok){Nr.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 b$e(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){Nr.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>Sun}},I$e=class extends xs{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(Zt),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(wun,"getUserSelectedModelConfiguration");p();p();p();var fQ=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();p();var Run=de(require("node:fs/promises")),R$e=de(require("node:path"));async function k$e(t){return await Run.readFile(GTe(t))}a(k$e,"readFile");function GTe(t){return R$e.default.resolve(R$e.default.extname(__filename)!==".ts"?__dirname:R$e.default.resolve(__dirname,"../../dist"),t)}a(GTe,"locateFile");var i8t=de(require("node:fs")),$Te=de(require("node:path"));function Pun(){let t=$Te.join("compiled",process.platform,process.arch,"copilot-tokenizer.node"),e=[$Te.join(__dirname,t),$Te.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 MMo(c)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,r={}){return Mc.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 Mn(`${E$e.claim} ${l}`);throw XM.getToken.info(Us(n,d)),d}let s=yf(this.tenantId,r,this.additionallyAllowedTenantIds);s&&sg(XM,s);try{ele(n,XM),XM.getToken.info(`Using the scope ${n}`);let c=g$e(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return XM.getToken.info(e0(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(NMo(c)){let u=new Mn(E$e.installed);throw XM.getToken.info(Us(n,u)),u}else if(DMo(c)){let u=new Mn(E$e.login);throw XM.getToken.info(Us(n,u)),u}let l=new Mn(`${c}. ${E$e.troubleshoot}`);throw XM.getToken.info(Us(n,l)),l}})}};async function MMo(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&&XM.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(MMo,"parseJsonToken");p();var _un=require("node:fs/promises");var OMo="common",LMo="aebc6443-996d-45c2-90f0-388ff96faa56",YFt=lo("VisualStudioCodeCredential"),BMo={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function FMo(t){let e=BMo[t];if(e)throw new Mn(e)}a(FMo,"checkUnsupportedTenant");var GTe=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(sg(YFt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=OMo,this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),FMo(this.tenantId)}async prepare(e){let r=yf(this.tenantId,this.options,this.additionallyAllowedTenantIds,YFt)||this.tenantId;if(!Htn()||!Sje)throw new Mn("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(Sje,e);this.msalClient=tE(LMo,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=Ox(e);if(await this.prepareOnce(n),!this.msalClient)throw new Mn("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,_un.readFile)(e,{encoding:"utf8"});return b3t(n)}catch(n){throw YFt.getToken.info(Us(r,n)),new Mn("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 _$e=lo("BrokerCredential"),v$e=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=Jce(_$e,e.tenantId),this.brokerAdditionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:_$e,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=tE(eY,this.brokerTenantId,r)}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,_$e);let o=Ox(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw _$e.getToken.info(Us(o,s)),new Mn("Failed to acquire token using broker authentication",{cause:s})}})}};function vun(t={}){return new v$e(t)}a(vun,"createDefaultBrokerCredential");function KFt(t={}){return new GTe(t)}a(KFt,"createDefaultVisualStudioCodeCredential");function JFt(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 fQ(c)}if(o&&r){let c={...t,tenantId:s};return new fQ(r,c)}if(e){let c={...t,clientId:e};return new fQ(c)}return new fQ(t)}a(JFt,"createDefaultManagedIdentityCredential");function ZFt(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 E3(s)}if(o){let s={...t,tenantId:o};return new E3(s)}return new E3(t)}a(ZFt,"createDefaultWorkloadIdentityCredential");function XFt(t={}){return new QTe(t)}a(XFt,"createDefaultAzureDeveloperCliCredential");function e8t(t={}){return new jTe(t)}a(e8t,"createDefaultAzureCliCredential");function t8t(t={}){return new HTe(t)}a(t8t,"createDefaultAzurePowershellCredential");function r8t(t={}){return new FTe(t)}a(r8t,"createDefaultEnvironmentCredential");var C$e=lo("DefaultAzureCredential"),n8t=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return C$e.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},rle=class extends pSe{static{a(this,"DefaultAzureCredential")}constructor(e){UMo(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[KFt,e8t,t8t,XFt,vun],o=[r8t,ZFt,JFt],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=[r8t];break;case"workloadidentitycredential":s=[ZFt];break;case"managedidentitycredential":s=[()=>JFt({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[KFt];break;case"azureclicredential":s=[e8t];break;case"azurepowershellcredential":s=[t8t];break;case"azuredeveloperclicredential":s=[XFt];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 C$e.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return C$e.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new n8t(u.name,d.message)}});super(...l)}};function UMo(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 C$e.warning(n),new Error(n)}}}a(UMo,"validateRequiredEnvVars");p();var DCu=lo("InteractiveBrowserCredential");p();var jCu=lo("DeviceCodeCredential");p();var QMo="AzurePipelinesCredential",ZCu=lo(QMo);p();var cbu=lo("AuthorizationCodeCredential");p();var qMo="OnBehalfOfCredential",ybu=lo(qMo);p();var b$e=new fe("capiFetchUtilities");function i0(t){let e={...Gy(t),"X-GitHub-Api-Version":"2026-06-01"},r=I$e(t.get(Ir));return r&&(e["Copilot-Integration-Id"]=r),e}a(i0,"getCapiHeaders");function Cun(t,e){return b$e.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":WW.api,"Copilot-Integration-Id":"autodev-test"}}a(Cun,"addMsBenchCesProxyHeaders");async function bun(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;b$e.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await Mtn(process.env.HMAC_SECRET,r);return{...e,...n}}a(bun,"addMsBenchHmacHeaders");function jMo(){return CB()&&!!process.env.HMAC_SECRET}a(jMo,"isMsBenchHmacModeEnabled");function i8t(){return CB()&&!process.env.HMAC_SECRET}a(i8t,"isMsBenchCesProxyModeEnabled");async function S$e(t,e){return process.env.HMAC_SECRET?await bun(t,e):Cun(t,e)}a(S$e,"addMsBenchHeaders");async function nle(t,e,r){let n=r;i8t()&&(n=await HMo());let o={...e,Authorization:`Bearer ${n}`};return{headers:jMo()?await bun(t,o):i8t()?Cun(t,o):o,token:n}}a(nle,"applyMsBenchAuth");function ile(t,e,...r){if(i8t()){b$e.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 nx(t,e,"api",...r)}a(ile,"getCapiUrl");function ole(t,e,r){(e.status===401||e.status===403)&&(b$e.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Qt).resetToken("capi_fetch",e.status))}a(ole,"handleCapiAuthError");async function DY(t,e,r){r??=await t.get(Qt).getToken();let n=ile(t,r,e),{headers:o}=await nle(t,i0(t),r.token),s=await t.get(nr).fetch(new URL(n).href,{method:"GET",headers:o});return ole(t,s,e),s}a(DY,"fetchCapiUrl");async function T$e(t,e,r){let n=await t.get(Qt).getToken(),o=ile(t,n,e),{headers:s}=await nle(t,i0(t),n.token),c=await t.get(nr).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return ole(t,c,e),c}a(T$e,"postCapiUrl");async function HMo(){let e=await new rle().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(HMo,"getMsBenchToken");p();var Tun=600*1e3,Rn={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"},R$e={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},sle=new Set([Rn.O1Ga,Rn.O3Mini,Rn.O1Mini,Rn.Gemini20Pro,Rn.Gemini20Flash]);function k$e(t){return t.startsWith("claude")}a(k$e,"isClaudeFamily");function wS(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[Rn.Gpt4o]:r=[Rn.Gpt4o,Rn.Gpt4turbo,Rn.Gpt4,Rn.O1Mini,Rn.O1Ga,Rn.Claude35Sonnet,Rn.O3Mini,Rn.Gemini20Flash,Rn.Claude37Sonnet,Rn.Claude37SonnetThought,Rn.Gpt45,Rn.Gpt41,Rn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt35turbo,Rn.Gpt41,Rn.CopilotBase];break;case"gitCommit":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt4,Rn.Gpt41,Rn.CopilotBase];break;case"nesStubs":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt41,Rn.CopilotBase];break;case"codeMapper":r=[Rn.Gpt41]}return r}a(wS,"getSupportedModelFamiliesForPrompt");var Iun={textEmbedding3Small:"text-embedding-3-small"},GMo=S.Object({type:S.Union([S.Literal("chat"),S.Literal("embeddings"),S.Literal("completion")]),tokenizer:S.String(),family:S.String(),object:S.String(),supports:S.Optional(S.Object({tool_calls:S.Optional(S.Boolean()),parallel_tool_calls:S.Optional(S.Boolean()),streaming:S.Optional(S.Boolean()),vision:S.Optional(S.Boolean()),adaptive_thinking:S.Optional(S.Boolean()),reasoning_effort:S.Optional(S.Array(S.String()))})),limits:S.Optional(S.Object({max_inputs:S.Optional(S.Number()),max_prompt_tokens:S.Optional(S.Number()),max_output_tokens:S.Optional(S.Number()),max_non_streaming_output_tokens:S.Optional(S.Number()),max_context_window_tokens:S.Optional(S.Number())}))}),Sun=S.Object({cache_price:S.Optional(S.Number()),input_price:S.Optional(S.Number()),output_price:S.Optional(S.Number()),context_max:S.Optional(S.Number())}),$Mo=S.Object({id:S.String(),vendor:S.Optional(S.String()),name:S.String(),version:S.String(),model_picker_enabled:S.Boolean(),model_picker_category:S.Optional(S.String()),model_picker_price_category:S.Optional(S.String()),is_chat_default:S.Optional(S.Boolean()),is_chat_fallback:S.Optional(S.Boolean()),capabilities:GMo,billing:S.Optional(S.Object({is_premium:S.Optional(S.Boolean()),multiplier:S.Optional(S.Number()),token_prices:S.Optional(S.Object({batch_size:S.Optional(S.Number()),default:S.Optional(Sun),long_context:S.Optional(Sun)}))})),custom_model:S.Optional(S.Object({key_name:S.Optional(S.String()),owner_name:S.Optional(S.String()),owner_type:S.Optional(S.String()),provider:S.Optional(S.String())})),object:S.String(),preview:S.Optional(S.Boolean()),isExperimental:S.Optional(S.Boolean()),policy:S.Optional(S.Object({state:S.String(),terms:S.String()})),supported_endpoints:S.Optional(S.Array(S.String())),warning_messages:S.Optional(S.Array(S.Object({message:S.String()}))),info_messages:S.Optional(S.Array(S.Object({message:S.String()})))}),xun=S.Object({data:S.Array($Mo)});function wun(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(wun,"getDegradationReason");var xs=class{static{a(this,"ModelMetadataProvider")}},x$e=class extends xs{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 DY(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){Nr.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Nr.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new cM(r)}await this.processModels(r)}async fetchModel(r){let n=await DY(this.ctx,`/models/${r}`);if(!n.ok){Nr.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 T$e(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){Nr.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>Tun}},w$e=class extends xs{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(Zt),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(Run,"getUserSelectedModelConfiguration");p();p();p();var pQ=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();p();var kun=de(require("node:fs/promises")),P$e=de(require("node:path"));async function D$e(t){return await kun.readFile($Te(t))}a(D$e,"readFile");function $Te(t){return P$e.default.resolve(P$e.default.extname(__filename)!==".ts"?__dirname:P$e.default.resolve(__dirname,"../../dist"),t)}a($Te,"locateFile");var o8t=de(require("node:fs")),VTe=de(require("node:path"));function Dun(){let t=VTe.join("compiled",process.platform,process.arch,"copilot-tokenizer.node"),e=[VTe.join(__dirname,t),VTe.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(Pun,"loadNativeTokenizer");var kun=new Set;function jMo(t){return[GTe(`resources/${t}.tiktoken.noindex`),$Te.join(__dirname,"resources",`${t}.tiktoken.noindex`)]}a(jMo,"vocabularyCandidates");async function Dun(t,e){if(!kun.has(e)){if(!t.tokenEncoderInitialized(e)){let r=await i8t.promises.readFile(await HMo(e));t.tokenInitEncoder(e,r)}kun.add(e)}}a(Dun,"initializeEncoderAsync");async function HMo(t){let e=jMo(t);for(let r of e)try{return await i8t.promises.access(r),r}catch{}throw new Error(`vocabulary for "${t}" not found at ${e.join(" or ")}`)}a(HMo,"firstExistingVocabulary");var D$e=new Map;function ws(t="o200k_base"){c8t(t);let e=D$e.get(t);return e!==void 0?e:GMo(t)}a(ws,"getTokenizer");var Nun=new Map;function GMo(t){let e=Nun.get(t);if(!e){let r=new pQ(t),n=a(()=>D$e.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")},Nun.set(t,e)}return e}a(GMo,"getUpgradingTokenizer");async function hQ(t="o200k_base"){return await c8t(t),ws(t)}a(hQ,"getTokenizerAsync");var P$e=Pun(),s8t=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 fQ("Could not load tokenizer",new Error(`unsupported encoder ${e}`));if(P$e.error)throw new fQ("Could not load tokenizer",P$e.error);try{return await Dun(P$e.binding,e),new t(P$e.binding,e)}catch(r){throw r instanceof Error?new fQ("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.lengthM$e.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")},Mun.set(t,e)}return e}a(zMo,"getUpgradingTokenizer");async function mQ(t="o200k_base"){return await l8t(t),ws(t)}a(mQ,"getTokenizerAsync");var N$e=Dun(),a8t=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 pQ("Could not load tokenizer",new Error(`unsupported encoder ${e}`));if(N$e.error)throw new pQ("Could not load tokenizer",N$e.error);try{return await Nun(N$e.binding,e),new t(N$e.binding,e)}catch(r){throw r instanceof Error?new pQ("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)}},c8t=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)}},$Mo={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}},o8t=4,pQ=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(-o8t),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-o8t)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?$Mo[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)}},YMo={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}},s8t=4,hQ=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(-s8t),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-s8t)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?YMo[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 VMo(t){try{let e=await s8t.create(t);D$e.set(t,e)}catch(e){console.error(`[tokenizer] failed to load ${t}, using approximate token counts: ${String(e)}`)}}a(VMo,"setTokenizer");var Mun=new Map,Oun=!1;function c8t(t="o200k_base"){if(Oun||(Oun=!0,D$e.set("mock",new a8t)),t==="mock")return Promise.resolve();let e=Mun.get(t);return e||(e=VMo(t).catch(()=>{}),Mun.set(t,e)),e}a(c8t,"_ensureLoaded");async function Lun(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"||t===void 0?"o200k_base":void 0;e&&await c8t(e)}a(Lun,"ensureNativeTokenizersLoaded");p();p();var WMo=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},Uun=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)},l8t,N$e,Qun,u8t=class extends qi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),l8t.add(this),N$e.set(this,void 0),WMo(this,N$e,e,"f"),this.error=r}Errors(){return new SU(Uun(this,l8t,"m",Qun).call(this))}};N$e=new WeakMap,l8t=new WeakSet,Qun=a(function*(){this.error&&(yield this.error),yield*Uun(this,N$e,"f")},"_AssertError_Iterator");function Fun(t,e,r){if(!es(t,e,r))throw new u8t(nM(t,e,r))}a(Fun,"AssertValue");function M$e(...t){return t.length===3?Fun(t[0],t[1],t[2]):Fun(t[0],[],t[1])}a(M$e,"Assert");p();p();p();function zMo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=ja(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=ja(t[r]);return e}a(zMo,"FromObject");function YMo(t){return t.map(e=>ja(e))}a(YMo,"FromArray");function KMo(t){return t.slice()}a(KMo,"FromTypedArray");function JMo(t){return new Map(ja([...t.entries()]))}a(JMo,"FromMap");function ZMo(t){return new Set(ja([...t.entries()]))}a(ZMo,"FromSet");function XMo(t){return new Date(t.toISOString())}a(XMo,"FromDate");function ja(t){if(Pi(t))return YMo(t);if(__(t))return XMo(t);if(qI(t))return KMo(t);if(TGr(t))return JMo(t);if(IGr(t))return ZMo(t);if(bo(t))return zMo(t);if(B1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(ja,"Clone");var wS=class extends qi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function Ha(t){return pU(t)?t():ja(t)}a(Ha,"FromDefault");function eOo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(eOo,"FromAny");function tOo(t,e){return{}}a(tOo,"FromArgument");function rOo(t,e){if(t.uniqueItems===!0&&!Qi(t,"default"))throw new wS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Qi(t,"default"))throw new wS(t,"Array with the contains constraint requires a default value");return"default"in t?Ha(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>RS(t.items,e)):[]}a(rOo,"FromArray");function nOo(t,e){return Qi(t,"default")?Ha(t.default):(async function*(){})()}a(nOo,"FromAsyncIterator");function iOo(t,e){return Qi(t,"default")?Ha(t.default):BigInt(0)}a(iOo,"FromBigInt");function oOo(t,e){return Qi(t,"default")?Ha(t.default):!1}a(oOo,"FromBoolean");function sOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=RS(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(sOo,"FromConstructor");function aOo(t,e){return Qi(t,"default")?Ha(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(aOo,"FromDate");function cOo(t,e){return Qi(t,"default")?Ha(t.default):()=>RS(t.returns,e)}a(cOo,"FromFunction");function lOo(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return RS(n,[...e,...r])}a(lOo,"FromImport");function uOo(t,e){return Qi(t,"default")?Ha(t.default):t.minimum!==void 0?t.minimum:0}a(uOo,"FromInteger");function dOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=t.allOf.reduce((n,o)=>{let s=RS(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!es(t,e,r))throw new wS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(dOo,"FromIntersect");function fOo(t,e){return Qi(t,"default")?Ha(t.default):(function*(){})()}a(fOo,"FromIterator");function pOo(t,e){return Qi(t,"default")?Ha(t.default):t.const}a(pOo,"FromLiteral");function hOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"Never types cannot be created. Consider using a default value.")}a(hOo,"FromNever");function mOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"Not types must have a default value")}a(mOo,"FromNot");function gOo(t,e){return Qi(t,"default")?Ha(t.default):null}a(gOo,"FromNull");function AOo(t,e){return Qi(t,"default")?Ha(t.default):t.minimum!==void 0?t.minimum:0}a(AOo,"FromNumber");function yOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=RS(s,e));return n}}a(yOo,"FromObject");function EOo(t,e){return Qi(t,"default")?Ha(t.default):Promise.resolve(RS(t.item,e))}a(EOo,"FromPromise");function _Oo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(_Oo,"FromRecord");function vOo(t,e){return Qi(t,"default")?Ha(t.default):RS(Ia(t,e),e)}a(vOo,"FromRef");function COo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"RegExp types cannot be created. Consider using a default value.")}a(COo,"FromRegExp");function bOo(t,e){if(t.pattern!==void 0){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"String types with formats must specify a default value")}else return Qi(t,"default")?Ha(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(bOo,"FromString");function SOo(t,e){return Qi(t,"default")?Ha(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(SOo,"FromSymbol");function TOo(t,e){if(Qi(t,"default"))return Ha(t.default);if(!K9e(t))throw new wS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return Loe(t)[0]}a(TOo,"FromTemplateLiteral");function IOo(t,e){if(qun++>MOo)throw new wS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Qi(t,"default")?Ha(t.default):RS(Ia(t,e),e)}a(IOo,"FromThis");function xOo(t,e){return Qi(t,"default")?Ha(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>RS(t.items[n],e))}a(xOo,"FromTuple");function wOo(t,e){if(Qi(t,"default"))return Ha(t.default)}a(wOo,"FromUndefined");function ROo(t,e){if(Qi(t,"default"))return Ha(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return RS(t.anyOf[0],e)}a(ROo,"FromUnion");function kOo(t,e){return Qi(t,"default")?Ha(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(kOo,"FromUint8Array");function POo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(POo,"FromUnknown");function DOo(t,e){if(Qi(t,"default"))return Ha(t.default)}a(DOo,"FromVoid");function NOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new Error("User defined types must specify a default value")}a(NOo,"FromKind");function RS(t,e){let r=Y0(t,e),n=t;switch(n[Tt]){case"Any":return eOo(n,r);case"Argument":return tOo(n,r);case"Array":return rOo(n,r);case"AsyncIterator":return nOo(n,r);case"BigInt":return iOo(n,r);case"Boolean":return oOo(n,r);case"Constructor":return sOo(n,r);case"Date":return aOo(n,r);case"Function":return cOo(n,r);case"Import":return lOo(n,r);case"Integer":return uOo(n,r);case"Intersect":return dOo(n,r);case"Iterator":return fOo(n,r);case"Literal":return pOo(n,r);case"Never":return hOo(n,r);case"Not":return mOo(n,r);case"Null":return gOo(n,r);case"Number":return AOo(n,r);case"Object":return yOo(n,r);case"Promise":return EOo(n,r);case"Record":return _Oo(n,r);case"Ref":return vOo(n,r);case"RegExp":return COo(n,r);case"String":return bOo(n,r);case"Symbol":return SOo(n,r);case"TemplateLiteral":return TOo(n,r);case"This":return IOo(n,r);case"Tuple":return xOo(n,r);case"Undefined":return wOo(n,r);case"Union":return ROo(n,r);case"Uint8Array":return kOo(n,r);case"Unknown":return POo(n,r);case"Void":return DOo(n,r);default:if(!v_.Has(n[Tt]))throw new wS(n,"Unknown type");return NOo(n,r)}}a(RS,"Visit");var MOo=512,qun=0;function vP(...t){return qun=0,t.length===2?RS(t[0],t[1]):RS(t[0],[])}a(vP,"Create");var O$e=class extends qi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function jun(t,e,r){if(t[Tt]==="Object"&&typeof r=="object"&&!cB(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[Tt]==="Literal"&&u.const===r[l]?100:0,f=es(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[Tt]==="Union"){let o=t.anyOf.map(s=>Ia(s,e)).map(s=>jun(s,e,r));return Math.max(...o)}else return es(t,e,r)?1:0}a(jun,"ScoreUnion");function OOo(t,e,r){let n=t.anyOf.map(c=>Ia(c,e)),[o,s]=[n[0],0];for(let c of n){let l=jun(c,e,r);l>s&&(o=c,s=l)}return o}a(OOo,"SelectUnion");function LOo(t,e,r){if("default"in t)return typeof r=="function"?t.default:ja(t.default);{let n=OOo(t,e,r);return VTe(n,e,r)}}a(LOo,"CastUnion");function BOo(t,e,r){return es(t,e,r)?ja(r):vP(t,e)}a(BOo,"DefaultClone");function FOo(t,e,r){return es(t,e,r)?r:vP(t,e)}a(FOo,"Default");function UOo(t,e,r){if(es(t,e,r))return ja(r);let n=Pi(r)?ja(r):vP(t,e),o=ai(t.minItems)&&n.lengthnull)]:n,c=(ai(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>CP(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!es(t,e,l))throw new O$e(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(UOo,"FromArray");function QOo(t,e,r){if(es(t,e,r))return vP(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]=CP(c,e,r.prototype[s]));return o}a(QOo,"FromConstructor");function qOo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return CP(o,[...e,...n],r)}a(qOo,"FromImport");function Hun(t,e){return bo(t)&&!bo(e)||!bo(t)&&bo(e)?t:!bo(t)||!bo(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?Hun(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(Hun,"IntersectAssign");function jOo(t,e,r){if(es(t,e,r))return r;let n=vP(t,e),o=Hun(n,r);return es(t,e,o)?o:n}a(jOo,"FromIntersect");function HOo(t,e,r){throw new O$e(t,"Never types cannot be cast")}a(HOo,"FromNever");function GOo(t,e,r){if(es(t,e,r))return r;if(r===null||typeof r!="object")return vP(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]=CP(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]=CP(t.additionalProperties,e,r[c]))}return o}a(GOo,"FromObject");function $Oo(t,e,r){if(es(t,e,r))return ja(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return vP(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=CP(o,e,l);return s}a($Oo,"FromRecord");function VOo(t,e,r){return CP(Ia(t,e),e,r)}a(VOo,"FromRef");function WOo(t,e,r){return CP(Ia(t,e),e,r)}a(WOo,"FromThis");function zOo(t,e,r){return es(t,e,r)?ja(r):Pi(r)?t.items===void 0?[]:t.items.map((n,o)=>CP(n,e,r[o])):vP(t,e)}a(zOo,"FromTuple");function YOo(t,e,r){return es(t,e,r)?ja(r):LOo(t,e,r)}a(YOo,"FromUnion");function CP(t,e,r){let n=Sa(t.$id)?Y0(t,e):e,o=t;switch(t[Tt]){case"Array":return UOo(o,n,r);case"Constructor":return QOo(o,n,r);case"Import":return qOo(o,n,r);case"Intersect":return jOo(o,n,r);case"Never":return HOo(o,n,r);case"Object":return GOo(o,n,r);case"Record":return $Oo(o,n,r);case"Ref":return VOo(o,n,r);case"This":return WOo(o,n,r);case"Tuple":return zOo(o,n,r);case"Union":return YOo(o,n,r);case"Date":case"Symbol":case"Uint8Array":return BOo(t,e,r);default:return FOo(o,n,r)}}a(CP,"Visit");function VTe(...t){return t.length===3?CP(t[0],t[1],t[2]):CP(t[0],[],t[1])}a(VTe,"Cast");p();function KOo(t){return mU(t)&&t[Tt]!=="Unsafe"}a(KOo,"IsCheckable");function JOo(t,e,r){return Pi(r)?r.map(n=>wC(t.items,e,n)):r}a(JOo,"FromArray");function ZOo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return wC(o,[...e,...n],r)}a(ZOo,"FromImport");function XOo(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>wC(l,e,ja(r))).reduce((l,u)=>bo(u)?{...l,...u}:u,{});if(!bo(r)||!bo(s)||!mU(n))return s;let c=aC(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||es(n,e,r[l])&&(s[l]=wC(n,e,r[l]));return s}a(XOo,"FromIntersect");function e5o(t,e,r){if(!bo(r)||Pi(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Qi(t.properties,o)){r[o]=wC(t.properties[o],e,r[o]);continue}if(mU(n)&&es(n,e,r[o])){r[o]=wC(n,e,r[o]);continue}delete r[o]}return r}a(e5o,"FromObject");function t5o(t,e,r){if(!bo(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]=wC(c,e,r[u]);continue}if(mU(n)&&es(n,e,r[u])){r[u]=wC(n,e,r[u]);continue}delete r[u]}return r}a(t5o,"FromRecord");function r5o(t,e,r){return wC(Ia(t,e),e,r)}a(r5o,"FromRef");function n5o(t,e,r){return wC(Ia(t,e),e,r)}a(n5o,"FromThis");function i5o(t,e,r){if(!Pi(r))return r;if(Fu(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(i5o,"FromTuple");function o5o(t,e,r){for(let n of t.anyOf)if(KOo(n)&&es(n,e,r))return wC(n,e,r);return r}a(o5o,"FromUnion");function wC(t,e,r){let n=Sa(t.$id)?Y0(t,e):e,o=t;switch(o[Tt]){case"Array":return JOo(o,n,r);case"Import":return ZOo(o,n,r);case"Intersect":return XOo(o,n,r);case"Object":return e5o(o,n,r);case"Record":return t5o(o,n,r);case"Ref":return r5o(o,n,r);case"This":return n5o(o,n,r);case"Tuple":return i5o(o,n,r);case"Union":return o5o(o,n,r);default:return r}}a(wC,"Visit");function L$e(...t){return t.length===3?wC(t[0],t[1],t[2]):wC(t[0],[],t[1])}a(L$e,"Clean");p();function B$e(t){return Sa(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(B$e,"IsStringNumeric");function s5o(t){return pA(t)||eM(t)||ai(t)}a(s5o,"IsValueToString");function WTe(t){return t===!0||ai(t)&&t===1||pA(t)&&t===BigInt("1")||Sa(t)&&(t.toLowerCase()==="true"||t==="1")}a(WTe,"IsValueTrue");function zTe(t){return t===!1||ai(t)&&(t===0||Object.is(t,-0))||pA(t)&&t===BigInt("0")||Sa(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(zTe,"IsValueFalse");function a5o(t){return Sa(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(a5o,"IsTimeStringWithTimeZone");function c5o(t){return Sa(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(c5o,"IsTimeStringWithoutTimeZone");function l5o(t){return Sa(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(l5o,"IsDateTimeStringWithTimeZone");function u5o(t){return Sa(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(u5o,"IsDateTimeStringWithoutTimeZone");function d5o(t){return Sa(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(d5o,"IsDateString");function f5o(t,e){let r=$un(t);return r===e?r:t}a(f5o,"TryConvertLiteralString");function p5o(t,e){let r=Vun(t);return r===e?r:t}a(p5o,"TryConvertLiteralNumber");function h5o(t,e){let r=Gun(t);return r===e?r:t}a(h5o,"TryConvertLiteralBoolean");function m5o(t,e){return Sa(t.const)?f5o(e,t.const):ai(t.const)?p5o(e,t.const):eM(t.const)?h5o(e,t.const):e}a(m5o,"TryConvertLiteral");function Gun(t){return WTe(t)?!0:zTe(t)?!1:t}a(Gun,"TryConvertBoolean");function g5o(t){let e=a(r=>r.split(".")[0],"truncateInteger");return B$e(t)?BigInt(e(t)):ai(t)?BigInt(Math.trunc(t)):zTe(t)?BigInt(0):WTe(t)?BigInt(1):t}a(g5o,"TryConvertBigInt");function $un(t){return lB(t)&&t.description!==void 0?t.description.toString():s5o(t)?t.toString():t}a($un,"TryConvertString");function Vun(t){return B$e(t)?parseFloat(t):WTe(t)?1:zTe(t)?0:t}a(Vun,"TryConvertNumber");function A5o(t){return B$e(t)?parseInt(t):ai(t)?Math.trunc(t):WTe(t)?1:zTe(t)?0:t}a(A5o,"TryConvertInteger");function y5o(t){return Sa(t)&&t.toLowerCase()==="null"?null:t}a(y5o,"TryConvertNull");function E5o(t){return Sa(t)&&t==="undefined"?void 0:t}a(E5o,"TryConvertUndefined");function _5o(t){return __(t)?t:ai(t)?new Date(t):WTe(t)?new Date(1):zTe(t)?new Date(0):B$e(t)?new Date(parseInt(t)):c5o(t)?new Date(`1970-01-01T${t}.000Z`):a5o(t)?new Date(`1970-01-01T${t}`):u5o(t)?new Date(`${t}.000Z`):l5o(t)?new Date(t):d5o(t)?new Date(`${t}T00:00:00.000Z`):t}a(_5o,"TryConvertDate");function v5o(t,e,r){return(Pi(r)?r:[r]).map(o=>bP(t.items,e,o))}a(v5o,"FromArray");function C5o(t,e,r){return g5o(r)}a(C5o,"FromBigInt");function b5o(t,e,r){return Gun(r)}a(b5o,"FromBoolean");function S5o(t,e,r){return _5o(r)}a(S5o,"FromDate");function T5o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return bP(o,[...e,...n],r)}a(T5o,"FromImport");function I5o(t,e,r){return A5o(r)}a(I5o,"FromInteger");function x5o(t,e,r){return t.allOf.reduce((n,o)=>bP(o,e,n),r)}a(x5o,"FromIntersect");function w5o(t,e,r){return m5o(t,r)}a(w5o,"FromLiteral");function R5o(t,e,r){return y5o(r)}a(R5o,"FromNull");function k5o(t,e,r){return Vun(r)}a(k5o,"FromNumber");function P5o(t,e,r){if(!bo(r)||Pi(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Qi(r,n)&&(r[n]=bP(t.properties[n],e,r[n]));return r}a(P5o,"FromObject");function D5o(t,e,r){if(!(bo(r)&&!Pi(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=bP(s,e,l);return r}a(D5o,"FromRecord");function N5o(t,e,r){return bP(Ia(t,e),e,r)}a(N5o,"FromRef");function M5o(t,e,r){return $un(r)}a(M5o,"FromString");function O5o(t,e,r){return Sa(r)||ai(r)?Symbol(r):r}a(O5o,"FromSymbol");function L5o(t,e,r){return bP(Ia(t,e),e,r)}a(L5o,"FromThis");function B5o(t,e,r){return Pi(r)&&!Fu(t.items)?r.map((o,s)=>s{let c=L_(s,e,n);return bo(c)?{...o,...c}:c},{})}a(H5o,"FromIntersect");function G5o(t,e,r){let n=_3(t,r);if(!bo(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=L_(t.properties[s],e,n[s]);Fu(c)||(n[s]=L_(t.properties[s],e,n[s]))}if(!d8t(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=L_(t.additionalProperties,e,n[s]));return n}a(G5o,"FromObject");function $5o(t,e,r){let n=_3(t,r);if(!bo(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)&&d8t(c)&&(n[u]=L_(c,e,n[u]));if(!d8t(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=L_(o,e,n[u]));return n}a($5o,"FromRecord");function V5o(t,e,r){return L_(Ia(t,e),e,_3(t,r))}a(V5o,"FromRef");function W5o(t,e,r){return L_(Ia(t,e),e,r)}a(W5o,"FromThis");function z5o(t,e,r){let n=_3(t,r);if(!Pi(n)||Fu(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;cJ5o,Format:()=>YTe,Get:()=>X5o,Has:()=>Z5o,Set:()=>K5o,ValuePointerRootDeleteError:()=>q$e,ValuePointerRootSetError:()=>Q$e});p();var Q$e=class extends qi{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}},q$e=class extends qi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function zun(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(zun,"Escape");function*YTe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nDY(t[o],e[o]))}a(e4o,"ObjectType");function t4o(t,e){return __(e)&&t.getTime()===e.getTime()}a(t4o,"DateType");function r4o(t,e){return!Pi(e)||t.length!==e.length?!1:t.every((r,n)=>DY(r,e[n]))}a(r4o,"ArrayType");function n4o(t,e){return!qI(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>DY(r,e[n]))}a(n4o,"TypedArrayType");function i4o(t,e){return t===e}a(i4o,"ValueType");function DY(t,e){if(__(t))return t4o(t,e);if(qI(t))return n4o(t,e);if(Pi(t))return r4o(t,e);if(bo(t))return e4o(t,e);if(B1(t))return i4o(t,e);throw new Error("ValueEquals: Unable to compare value")}a(DY,"Equal");var o4o=rc({type:ca("insert"),path:C_(),value:Qk()}),s4o=rc({type:ca("update"),path:C_(),value:Qk()}),a4o=rc({type:ca("delete"),path:C_()}),Kun=tc([o4o,s4o,a4o]),j$e=class extends qi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function H$e(t,e){return{type:"update",path:t,value:e}}a(H$e,"CreateUpdate");function Jun(t,e){return{type:"insert",path:t,value:e}}a(Jun,"CreateInsert");function Zun(t){return{type:"delete",path:t}}a(Zun,"CreateDelete");function Yun(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new j$e(t,"Cannot diff objects with symbols")}a(Yun,"AssertDiffable");function*c4o(t,e,r){if(Yun(e),Yun(r),!EPt(r))return yield H$e(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Qi(e,s)||(yield Jun(`${t}/${s}`,r[s]));for(let s of n)Qi(r,s)&&(DY(e,r)||(yield*G$e(`${t}/${s}`,e[s],r[s])));for(let s of n)Qi(r,s)||(yield Zun(`${t}/${s}`))}a(c4o,"ObjectType");function*l4o(t,e,r){if(!Pi(r))return yield H$e(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(f4o,"IsRootUpdate");function p4o(t){return t.length===0}a(p4o,"IsIdentity");function edn(t,e){if(f4o(e))return ja(e[0].value);if(p4o(e))return ja(t);let r=ja(t);for(let n of e)switch(n.type){case"insert":{SP.Set(r,n.path,n.value);break}case"update":{SP.Set(r,n.path,n.value);break}case"delete":{SP.Delete(r,n.path);break}}return r}a(edn,"Patch");p();function tdn(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=yB(e,r)?Zoe(e,r,n):n;if(!es(e,r,o))throw new Joe(e,o,nM(e,r,o).First());return o}a(tdn,"Encode");p();function $$e(t){return bo(t)&&!Pi(t)}a($$e,"IsStandardObject");var V$e=class extends qi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function h4o(t,e,r,n){if(!$$e(r))SP.Set(t,e,ja(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)f8t(t,`${e}/${c}`,r[c],n[c])}}a(h4o,"ObjectType");function m4o(t,e,r,n){if(!Pi(r))SP.Set(t,e,ja(n));else{for(let o=0;o(M$e(s,c,l),l)],["Cast",(s,c,l)=>VTe(s,c,l)],["Clean",(s,c,l)=>L$e(s,c,l)],["Clone",(s,c,l)=>ja(l)],["Convert",(s,c,l)=>F$e(s,c,l)],["Decode",(s,c,l)=>yB(s,c)?Koe(s,c,l):l],["Default",(s,c,l)=>U$e(s,c,l)],["Encode",(s,c,l)=>yB(s,c)?Zoe(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})(p8t||(p8t={}));var idn=["Clone","Clean","Default","Convert","Assert","Decode"];function E4o(t,e,r,n){return t.reduce((o,s)=>{let c=p8t.Get(s);if(Fu(c))throw new W$e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(E4o,"ParseValue");function odn(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?Pi(t[0])?[t[0],t[1],[],t[2]]:[idn,t[0],t[1],t[2]]:t.length===2?[idn,t[0],[],t[1]]:(()=>{throw new W$e("Invalid Arguments")})();return E4o(e,r,n,o)}a(odn,"Parse");p();var XM={};ki(XM,{Assert:()=>M$e,Cast:()=>VTe,Check:()=>es,Clean:()=>L$e,Clone:()=>ja,Convert:()=>F$e,Create:()=>vP,Decode:()=>Wun,Default:()=>U$e,Diff:()=>Xun,Edit:()=>Kun,Encode:()=>tdn,Equal:()=>DY,Errors:()=>nM,Hash:()=>bU,Mutate:()=>ndn,Parse:()=>odn,Patch:()=>edn,ValueErrorIterator:()=>SU});p();var _4o="gpt-41-copilot",Ox=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&bs(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 _4o}parseModelsResponse(e){try{return XM.Parse(Iun,e)}catch(r){Nr.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 PY(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Nr.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=wun(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Nr.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=Ft(this._ctx,Ye.DebugOverrideEngine)||Ft(this._ctx,Ye.DebugOverrideEngineLegacy);if(o)return new NY(o,"override");let s=e?this._ctx.get(Zt).customEngine(e):"",c=e?this._ctx.get(Zt).customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new NY(s,"exp"):new NY(n,"modelpicker"):s?new NY(s,"exp"):new NY(r,"default")}},NY=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function mQ(t,e=void 0){let r=t.get(Ox),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(mQ,"getEngineRequestInfo");p();p();var Qo=class{static{a(this,"FileSystem")}};var bdn=de(Cdn());function Sdn(t){return t!==void 0&&t!==0}a(Sdn,"isRepoInfo");function Tdn(t){if(t===void 0||t===0)return"";let e=MY(t);if(e==="github/github")return e;let r=V4o(t)?.toLowerCase();return r!==void 0?r:""}a(Tdn,"getDogFood");function MY(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(MY,"tryGetGitHubNWO");function V4o(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(V4o,"tryGetADONWO");function gQ(t,e){let r=uf(e);return W4o(t,r)}a(gQ,"extractRepoInfoInBackground");var W4o=J4o(z4o,1e4);async function z4o(t,e){let r=RKr(e);if(!r)return;let n=await Y4o(t,r);if(!n)return;let o=t.get(Qo),s=wa(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=K4o(c)??"",u=A8t(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(z4o,"extractRepoInfo");function A8t(t){let e;try{if(e=(0,bdn.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(A8t,"parseRepoUrl");async function Y4o(t,e){let r=e+"_add_to_make_longer",n=t.get(Qo);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 g8t(d)),n.delete(c)}),0}}a(J4o,"computeInBackgroundAndMemoize");p();var KTe=500,Idn=8192-KTe,xdn=4,z$e=10,wdn=1e3*5,Y$e={prefix:35,suffix:15,stableContext:35,volatileContext:15},Z4o={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function JTe(t){return t=t.toLowerCase(),Z4o[t]??t}a(JTe,"normalizeLanguageId");var y8t=class{constructor(e){this.ctx=e;this.cache=new Cn(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 E8t(()=>this.ctx.get(dP).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()}},E8t=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 X4o(t){return"uri"in t}a(X4o,"isCompletionsFiltersInfo");var Zt=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new y8t(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=Wt.createAndMarkAsIssued()){if(n instanceof JI)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&X4o(r)?gQ(this.ctx,r.uri):void 0,s=MY(o)??"",c=Tdn(o)??"",l=r?.languageId??"",u=mQ(this.ctx).modelId,d=CQr(e),f=e.getTokenValue("ol")??"",h=e.getTokenValue("tid")??"",m=e.getTokenValue("fcv1")==="1",g=e.getTokenValue("sn")==="1",y=this.ctx.get(Op).getProperties(),E=e.endpoints,_={"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(),b=this.makeFilterSettings(_),T=v.extendFilters(b),w=await this.getExpConfig(T.newFilterSettings,E);v.update(b,+(w.variables.copilotbycallbuckets??NaN),+(w.variables.copilottimeperiodsizeinh??NaN));let R=v.extendFilters(b),x=R.newFilterSettings,P=await this.getExpConfig(x,E),D=new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs));for(let N of R.otherFilterSettingsToPrefetch)D=D.then(async()=>{await new Promise(L=>setTimeout(L,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(N,E)});return this.prepareForUpcomingFilters(x,E),new JI(n.properties,n.measurements,n.issuedTime,{filters:x,exp:P})}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(Ua).machineId;this.granularityDirectory=new Eje(e,this.ctx.get(Cx))}return this.granularityDirectory}makeFilterSettings(e){return new iB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return nC.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 iB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=bB(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??Y$e.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??z$e}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??Idn+KTe}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??wdn}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??Y$e.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??Y$e.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}ideEnableCopilotNesNonFreeEnabled(e){return e.filtersAndExp.exp.variables.ideenablecopilotnes??!1}};async function K$e(t){let e=Ft(t,Ye.SearchAgent);if(e==="true")return!0;if(e==="false")return!1;let r=t.get(Zt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments();return r.searchAgentEnabled(n)}a(K$e,"isSearchAgentEnabled");function kdn(t,e){let r=Ft(t,Ye.EnableCopilotNesNonFree);return r==="true"?!0:r==="false"?!1:t.get(Zt).ideEnableCopilotNesNonFreeEnabled(e)}a(kdn,"isIdeEnableCopilotNesNonFreeEnabled");p();p();p();var J$e=de(ale());var v8t={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 kS(t){return t in v8t&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(kS,"isSupportedLanguageId");function Z$e(t){if(!(t in v8t))throw new Error(`Unrecognized language: ${t}`);return v8t[t]}a(Z$e,"languageIdToWasmLanguage");var _8t=new Map;async function eLo(t){let e;try{e=await k$e(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new fQ(`Could not load tree-sitter-${t}.wasm`,r):r}return J$e.default.Language.load(e)}a(eLo,"loadWasmLanguage");function b8t(t){let e=Z$e(t);if(!_8t.has(e)){let r=eLo(e);_8t.set(e,r)}return _8t.get(e)}a(b8t,"getLanguage");var C8t=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function AQ(t,e){return(await S8t(t,e))[0]}a(AQ,"parseTreeSitter");async function S8t(t,e){await J$e.default.init({locateFile:a(s=>GTe(s),"locateFile")});let r;try{r=new J$e.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 C8t(`Could not init Parse for language <${t}>`,s):s}let n=await b8t(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(S8t,"parseTreeSitterIncludingVersion");function Pdn(t){switch(Z$e(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(Pdn,"getBlockCloseToken");function tLo(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(tLo,"innerQuery");var rLo=[`[ +`);return n.substring(o+1)}};async function KMo(t){try{let e=await a8t.create(t);M$e.set(t,e)}catch(e){console.error(`[tokenizer] failed to load ${t}, using approximate token counts: ${String(e)}`)}}a(KMo,"setTokenizer");var Oun=new Map,Lun=!1;function l8t(t="o200k_base"){if(Lun||(Lun=!0,M$e.set("mock",new c8t)),t==="mock")return Promise.resolve();let e=Oun.get(t);return e||(e=KMo(t).catch(()=>{}),Oun.set(t,e)),e}a(l8t,"_ensureLoaded");async function Fun(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"||t===void 0?"o200k_base":void 0;e&&await l8t(e)}a(Fun,"ensureNativeTokenizersLoaded");p();p();var JMo=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},Qun=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)},u8t,O$e,qun,d8t=class extends qi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),u8t.add(this),O$e.set(this,void 0),JMo(this,O$e,e,"f"),this.error=r}Errors(){return new TU(Qun(this,u8t,"m",qun).call(this))}};O$e=new WeakMap,u8t=new WeakSet,qun=a(function*(){this.error&&(yield this.error),yield*Qun(this,O$e,"f")},"_AssertError_Iterator");function Uun(t,e,r){if(!es(t,e,r))throw new d8t(iM(t,e,r))}a(Uun,"AssertValue");function L$e(...t){return t.length===3?Uun(t[0],t[1],t[2]):Uun(t[0],[],t[1])}a(L$e,"Assert");p();p();p();function ZMo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=qa(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=qa(t[r]);return e}a(ZMo,"FromObject");function XMo(t){return t.map(e=>qa(e))}a(XMo,"FromArray");function eOo(t){return t.slice()}a(eOo,"FromTypedArray");function tOo(t){return new Map(qa([...t.entries()]))}a(tOo,"FromMap");function rOo(t){return new Set(qa([...t.entries()]))}a(rOo,"FromSet");function nOo(t){return new Date(t.toISOString())}a(nOo,"FromDate");function qa(t){if(Pi(t))return XMo(t);if(__(t))return nOo(t);if(HI(t))return eOo(t);if(IGr(t))return tOo(t);if(xGr(t))return rOo(t);if(So(t))return ZMo(t);if(B1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(qa,"Clone");var RS=class extends qi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function ja(t){return hU(t)?t():qa(t)}a(ja,"FromDefault");function iOo(t,e){return Qi(t,"default")?ja(t.default):{}}a(iOo,"FromAny");function oOo(t,e){return{}}a(oOo,"FromArgument");function sOo(t,e){if(t.uniqueItems===!0&&!Qi(t,"default"))throw new RS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Qi(t,"default"))throw new RS(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=>kS(t.items,e)):[]}a(sOo,"FromArray");function aOo(t,e){return Qi(t,"default")?ja(t.default):(async function*(){})()}a(aOo,"FromAsyncIterator");function cOo(t,e){return Qi(t,"default")?ja(t.default):BigInt(0)}a(cOo,"FromBigInt");function lOo(t,e){return Qi(t,"default")?ja(t.default):!1}a(lOo,"FromBoolean");function uOo(t,e){if(Qi(t,"default"))return ja(t.default);{let r=kS(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(uOo,"FromConstructor");function dOo(t,e){return Qi(t,"default")?ja(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(dOo,"FromDate");function fOo(t,e){return Qi(t,"default")?ja(t.default):()=>kS(t.returns,e)}a(fOo,"FromFunction");function pOo(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return kS(n,[...e,...r])}a(pOo,"FromImport");function hOo(t,e){return Qi(t,"default")?ja(t.default):t.minimum!==void 0?t.minimum:0}a(hOo,"FromInteger");function mOo(t,e){if(Qi(t,"default"))return ja(t.default);{let r=t.allOf.reduce((n,o)=>{let s=kS(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!es(t,e,r))throw new RS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(mOo,"FromIntersect");function gOo(t,e){return Qi(t,"default")?ja(t.default):(function*(){})()}a(gOo,"FromIterator");function AOo(t,e){return Qi(t,"default")?ja(t.default):t.const}a(AOo,"FromLiteral");function yOo(t,e){if(Qi(t,"default"))return ja(t.default);throw new RS(t,"Never types cannot be created. Consider using a default value.")}a(yOo,"FromNever");function EOo(t,e){if(Qi(t,"default"))return ja(t.default);throw new RS(t,"Not types must have a default value")}a(EOo,"FromNot");function _Oo(t,e){return Qi(t,"default")?ja(t.default):null}a(_Oo,"FromNull");function vOo(t,e){return Qi(t,"default")?ja(t.default):t.minimum!==void 0?t.minimum:0}a(vOo,"FromNumber");function COo(t,e){if(Qi(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]=kS(s,e));return n}}a(COo,"FromObject");function bOo(t,e){return Qi(t,"default")?ja(t.default):Promise.resolve(kS(t.item,e))}a(bOo,"FromPromise");function SOo(t,e){return Qi(t,"default")?ja(t.default):{}}a(SOo,"FromRecord");function TOo(t,e){return Qi(t,"default")?ja(t.default):kS(Ta(t,e),e)}a(TOo,"FromRef");function IOo(t,e){if(Qi(t,"default"))return ja(t.default);throw new RS(t,"RegExp types cannot be created. Consider using a default value.")}a(IOo,"FromRegExp");function xOo(t,e){if(t.pattern!==void 0){if(Qi(t,"default"))return ja(t.default);throw new RS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Qi(t,"default"))return ja(t.default);throw new RS(t,"String types with formats must specify a default value")}else return Qi(t,"default")?ja(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(xOo,"FromString");function wOo(t,e){return Qi(t,"default")?ja(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(wOo,"FromSymbol");function ROo(t,e){if(Qi(t,"default"))return ja(t.default);if(!Z9e(t))throw new RS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return Loe(t)[0]}a(ROo,"FromTemplateLiteral");function kOo(t,e){if(jun++>FOo)throw new RS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Qi(t,"default")?ja(t.default):kS(Ta(t,e),e)}a(kOo,"FromThis");function POo(t,e){return Qi(t,"default")?ja(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>kS(t.items[n],e))}a(POo,"FromTuple");function DOo(t,e){if(Qi(t,"default"))return ja(t.default)}a(DOo,"FromUndefined");function NOo(t,e){if(Qi(t,"default"))return ja(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return kS(t.anyOf[0],e)}a(NOo,"FromUnion");function MOo(t,e){return Qi(t,"default")?ja(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(MOo,"FromUint8Array");function OOo(t,e){return Qi(t,"default")?ja(t.default):{}}a(OOo,"FromUnknown");function LOo(t,e){if(Qi(t,"default"))return ja(t.default)}a(LOo,"FromVoid");function BOo(t,e){if(Qi(t,"default"))return ja(t.default);throw new Error("User defined types must specify a default value")}a(BOo,"FromKind");function kS(t,e){let r=Y0(t,e),n=t;switch(n[Tt]){case"Any":return iOo(n,r);case"Argument":return oOo(n,r);case"Array":return sOo(n,r);case"AsyncIterator":return aOo(n,r);case"BigInt":return cOo(n,r);case"Boolean":return lOo(n,r);case"Constructor":return uOo(n,r);case"Date":return dOo(n,r);case"Function":return fOo(n,r);case"Import":return pOo(n,r);case"Integer":return hOo(n,r);case"Intersect":return mOo(n,r);case"Iterator":return gOo(n,r);case"Literal":return AOo(n,r);case"Never":return yOo(n,r);case"Not":return EOo(n,r);case"Null":return _Oo(n,r);case"Number":return vOo(n,r);case"Object":return COo(n,r);case"Promise":return bOo(n,r);case"Record":return SOo(n,r);case"Ref":return TOo(n,r);case"RegExp":return IOo(n,r);case"String":return xOo(n,r);case"Symbol":return wOo(n,r);case"TemplateLiteral":return ROo(n,r);case"This":return kOo(n,r);case"Tuple":return POo(n,r);case"Undefined":return DOo(n,r);case"Union":return NOo(n,r);case"Uint8Array":return MOo(n,r);case"Unknown":return OOo(n,r);case"Void":return LOo(n,r);default:if(!v_.Has(n[Tt]))throw new RS(n,"Unknown type");return BOo(n,r)}}a(kS,"Visit");var FOo=512,jun=0;function CP(...t){return jun=0,t.length===2?kS(t[0],t[1]):kS(t[0],[])}a(CP,"Create");var B$e=class extends qi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function Hun(t,e,r){if(t[Tt]==="Object"&&typeof r=="object"&&!cB(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[Tt]==="Literal"&&u.const===r[l]?100:0,f=es(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[Tt]==="Union"){let o=t.anyOf.map(s=>Ta(s,e)).map(s=>Hun(s,e,r));return Math.max(...o)}else return es(t,e,r)?1:0}a(Hun,"ScoreUnion");function UOo(t,e,r){let n=t.anyOf.map(c=>Ta(c,e)),[o,s]=[n[0],0];for(let c of n){let l=Hun(c,e,r);l>s&&(o=c,s=l)}return o}a(UOo,"SelectUnion");function QOo(t,e,r){if("default"in t)return typeof r=="function"?t.default:qa(t.default);{let n=UOo(t,e,r);return WTe(n,e,r)}}a(QOo,"CastUnion");function qOo(t,e,r){return es(t,e,r)?qa(r):CP(t,e)}a(qOo,"DefaultClone");function jOo(t,e,r){return es(t,e,r)?r:CP(t,e)}a(jOo,"Default");function HOo(t,e,r){if(es(t,e,r))return qa(r);let n=Pi(r)?qa(r):CP(t,e),o=ai(t.minItems)&&n.lengthnull)]:n,c=(ai(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>bP(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!es(t,e,l))throw new B$e(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(HOo,"FromArray");function GOo(t,e,r){if(es(t,e,r))return CP(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]=bP(c,e,r.prototype[s]));return o}a(GOo,"FromConstructor");function $Oo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return bP(o,[...e,...n],r)}a($Oo,"FromImport");function Gun(t,e){return So(t)&&!So(e)||!So(t)&&So(e)?t:!So(t)||!So(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?Gun(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(Gun,"IntersectAssign");function VOo(t,e,r){if(es(t,e,r))return r;let n=CP(t,e),o=Gun(n,r);return es(t,e,o)?o:n}a(VOo,"FromIntersect");function WOo(t,e,r){throw new B$e(t,"Never types cannot be cast")}a(WOo,"FromNever");function zOo(t,e,r){if(es(t,e,r))return r;if(r===null||typeof r!="object")return CP(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]=bP(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]=bP(t.additionalProperties,e,r[c]))}return o}a(zOo,"FromObject");function YOo(t,e,r){if(es(t,e,r))return qa(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return CP(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=bP(o,e,l);return s}a(YOo,"FromRecord");function KOo(t,e,r){return bP(Ta(t,e),e,r)}a(KOo,"FromRef");function JOo(t,e,r){return bP(Ta(t,e),e,r)}a(JOo,"FromThis");function ZOo(t,e,r){return es(t,e,r)?qa(r):Pi(r)?t.items===void 0?[]:t.items.map((n,o)=>bP(n,e,r[o])):CP(t,e)}a(ZOo,"FromTuple");function XOo(t,e,r){return es(t,e,r)?qa(r):QOo(t,e,r)}a(XOo,"FromUnion");function bP(t,e,r){let n=ba(t.$id)?Y0(t,e):e,o=t;switch(t[Tt]){case"Array":return HOo(o,n,r);case"Constructor":return GOo(o,n,r);case"Import":return $Oo(o,n,r);case"Intersect":return VOo(o,n,r);case"Never":return WOo(o,n,r);case"Object":return zOo(o,n,r);case"Record":return YOo(o,n,r);case"Ref":return KOo(o,n,r);case"This":return JOo(o,n,r);case"Tuple":return ZOo(o,n,r);case"Union":return XOo(o,n,r);case"Date":case"Symbol":case"Uint8Array":return qOo(t,e,r);default:return jOo(o,n,r)}}a(bP,"Visit");function WTe(...t){return t.length===3?bP(t[0],t[1],t[2]):bP(t[0],[],t[1])}a(WTe,"Cast");p();function e5o(t){return gU(t)&&t[Tt]!=="Unsafe"}a(e5o,"IsCheckable");function t5o(t,e,r){return Pi(r)?r.map(n=>RC(t.items,e,n)):r}a(t5o,"FromArray");function r5o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return RC(o,[...e,...n],r)}a(r5o,"FromImport");function n5o(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>RC(l,e,qa(r))).reduce((l,u)=>So(u)?{...l,...u}:u,{});if(!So(r)||!So(s)||!gU(n))return s;let c=cC(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||es(n,e,r[l])&&(s[l]=RC(n,e,r[l]));return s}a(n5o,"FromIntersect");function i5o(t,e,r){if(!So(r)||Pi(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Qi(t.properties,o)){r[o]=RC(t.properties[o],e,r[o]);continue}if(gU(n)&&es(n,e,r[o])){r[o]=RC(n,e,r[o]);continue}delete r[o]}return r}a(i5o,"FromObject");function o5o(t,e,r){if(!So(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]=RC(c,e,r[u]);continue}if(gU(n)&&es(n,e,r[u])){r[u]=RC(n,e,r[u]);continue}delete r[u]}return r}a(o5o,"FromRecord");function s5o(t,e,r){return RC(Ta(t,e),e,r)}a(s5o,"FromRef");function a5o(t,e,r){return RC(Ta(t,e),e,r)}a(a5o,"FromThis");function c5o(t,e,r){if(!Pi(r))return r;if(Fu(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(c5o,"FromTuple");function l5o(t,e,r){for(let n of t.anyOf)if(e5o(n)&&es(n,e,r))return RC(n,e,r);return r}a(l5o,"FromUnion");function RC(t,e,r){let n=ba(t.$id)?Y0(t,e):e,o=t;switch(o[Tt]){case"Array":return t5o(o,n,r);case"Import":return r5o(o,n,r);case"Intersect":return n5o(o,n,r);case"Object":return i5o(o,n,r);case"Record":return o5o(o,n,r);case"Ref":return s5o(o,n,r);case"This":return a5o(o,n,r);case"Tuple":return c5o(o,n,r);case"Union":return l5o(o,n,r);default:return r}}a(RC,"Visit");function F$e(...t){return t.length===3?RC(t[0],t[1],t[2]):RC(t[0],[],t[1])}a(F$e,"Clean");p();function U$e(t){return ba(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(U$e,"IsStringNumeric");function u5o(t){return pA(t)||tM(t)||ai(t)}a(u5o,"IsValueToString");function zTe(t){return t===!0||ai(t)&&t===1||pA(t)&&t===BigInt("1")||ba(t)&&(t.toLowerCase()==="true"||t==="1")}a(zTe,"IsValueTrue");function YTe(t){return t===!1||ai(t)&&(t===0||Object.is(t,-0))||pA(t)&&t===BigInt("0")||ba(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(YTe,"IsValueFalse");function d5o(t){return ba(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(d5o,"IsTimeStringWithTimeZone");function f5o(t){return ba(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(f5o,"IsTimeStringWithoutTimeZone");function p5o(t){return ba(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(p5o,"IsDateTimeStringWithTimeZone");function h5o(t){return ba(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(h5o,"IsDateTimeStringWithoutTimeZone");function m5o(t){return ba(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(m5o,"IsDateString");function g5o(t,e){let r=Vun(t);return r===e?r:t}a(g5o,"TryConvertLiteralString");function A5o(t,e){let r=Wun(t);return r===e?r:t}a(A5o,"TryConvertLiteralNumber");function y5o(t,e){let r=$un(t);return r===e?r:t}a(y5o,"TryConvertLiteralBoolean");function E5o(t,e){return ba(t.const)?g5o(e,t.const):ai(t.const)?A5o(e,t.const):tM(t.const)?y5o(e,t.const):e}a(E5o,"TryConvertLiteral");function $un(t){return zTe(t)?!0:YTe(t)?!1:t}a($un,"TryConvertBoolean");function _5o(t){let e=a(r=>r.split(".")[0],"truncateInteger");return U$e(t)?BigInt(e(t)):ai(t)?BigInt(Math.trunc(t)):YTe(t)?BigInt(0):zTe(t)?BigInt(1):t}a(_5o,"TryConvertBigInt");function Vun(t){return lB(t)&&t.description!==void 0?t.description.toString():u5o(t)?t.toString():t}a(Vun,"TryConvertString");function Wun(t){return U$e(t)?parseFloat(t):zTe(t)?1:YTe(t)?0:t}a(Wun,"TryConvertNumber");function v5o(t){return U$e(t)?parseInt(t):ai(t)?Math.trunc(t):zTe(t)?1:YTe(t)?0:t}a(v5o,"TryConvertInteger");function C5o(t){return ba(t)&&t.toLowerCase()==="null"?null:t}a(C5o,"TryConvertNull");function b5o(t){return ba(t)&&t==="undefined"?void 0:t}a(b5o,"TryConvertUndefined");function S5o(t){return __(t)?t:ai(t)?new Date(t):zTe(t)?new Date(1):YTe(t)?new Date(0):U$e(t)?new Date(parseInt(t)):f5o(t)?new Date(`1970-01-01T${t}.000Z`):d5o(t)?new Date(`1970-01-01T${t}`):h5o(t)?new Date(`${t}.000Z`):p5o(t)?new Date(t):m5o(t)?new Date(`${t}T00:00:00.000Z`):t}a(S5o,"TryConvertDate");function T5o(t,e,r){return(Pi(r)?r:[r]).map(o=>SP(t.items,e,o))}a(T5o,"FromArray");function I5o(t,e,r){return _5o(r)}a(I5o,"FromBigInt");function x5o(t,e,r){return $un(r)}a(x5o,"FromBoolean");function w5o(t,e,r){return S5o(r)}a(w5o,"FromDate");function R5o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return SP(o,[...e,...n],r)}a(R5o,"FromImport");function k5o(t,e,r){return v5o(r)}a(k5o,"FromInteger");function P5o(t,e,r){return t.allOf.reduce((n,o)=>SP(o,e,n),r)}a(P5o,"FromIntersect");function D5o(t,e,r){return E5o(t,r)}a(D5o,"FromLiteral");function N5o(t,e,r){return C5o(r)}a(N5o,"FromNull");function M5o(t,e,r){return Wun(r)}a(M5o,"FromNumber");function O5o(t,e,r){if(!So(r)||Pi(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Qi(r,n)&&(r[n]=SP(t.properties[n],e,r[n]));return r}a(O5o,"FromObject");function L5o(t,e,r){if(!(So(r)&&!Pi(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=SP(s,e,l);return r}a(L5o,"FromRecord");function B5o(t,e,r){return SP(Ta(t,e),e,r)}a(B5o,"FromRef");function F5o(t,e,r){return Vun(r)}a(F5o,"FromString");function U5o(t,e,r){return ba(r)||ai(r)?Symbol(r):r}a(U5o,"FromSymbol");function Q5o(t,e,r){return SP(Ta(t,e),e,r)}a(Q5o,"FromThis");function q5o(t,e,r){return Pi(r)&&!Fu(t.items)?r.map((o,s)=>s{let c=L_(s,e,n);return So(c)?{...o,...c}:c},{})}a(W5o,"FromIntersect");function z5o(t,e,r){let n=_3(t,r);if(!So(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=L_(t.properties[s],e,n[s]);Fu(c)||(n[s]=L_(t.properties[s],e,n[s]))}if(!f8t(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=L_(t.additionalProperties,e,n[s]));return n}a(z5o,"FromObject");function Y5o(t,e,r){let n=_3(t,r);if(!So(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)&&f8t(c)&&(n[u]=L_(c,e,n[u]));if(!f8t(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=L_(o,e,n[u]));return n}a(Y5o,"FromRecord");function K5o(t,e,r){return L_(Ta(t,e),e,_3(t,r))}a(K5o,"FromRef");function J5o(t,e,r){return L_(Ta(t,e),e,r)}a(J5o,"FromThis");function Z5o(t,e,r){let n=_3(t,r);if(!Pi(n)||Fu(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;ct4o,Format:()=>KTe,Get:()=>n4o,Has:()=>r4o,Set:()=>e4o,ValuePointerRootDeleteError:()=>H$e,ValuePointerRootSetError:()=>j$e});p();var j$e=class extends qi{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}},H$e=class extends qi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function Yun(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(Yun,"Escape");function*KTe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nNY(t[o],e[o]))}a(i4o,"ObjectType");function o4o(t,e){return __(e)&&t.getTime()===e.getTime()}a(o4o,"DateType");function s4o(t,e){return!Pi(e)||t.length!==e.length?!1:t.every((r,n)=>NY(r,e[n]))}a(s4o,"ArrayType");function a4o(t,e){return!HI(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>NY(r,e[n]))}a(a4o,"TypedArrayType");function c4o(t,e){return t===e}a(c4o,"ValueType");function NY(t,e){if(__(t))return o4o(t,e);if(HI(t))return a4o(t,e);if(Pi(t))return s4o(t,e);if(So(t))return i4o(t,e);if(B1(t))return c4o(t,e);throw new Error("ValueEquals: Unable to compare value")}a(NY,"Equal");var l4o=rc({type:ca("insert"),path:C_(),value:qk()}),u4o=rc({type:ca("update"),path:C_(),value:qk()}),d4o=rc({type:ca("delete"),path:C_()}),Jun=tc([l4o,u4o,d4o]),G$e=class extends qi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function $$e(t,e){return{type:"update",path:t,value:e}}a($$e,"CreateUpdate");function Zun(t,e){return{type:"insert",path:t,value:e}}a(Zun,"CreateInsert");function Xun(t){return{type:"delete",path:t}}a(Xun,"CreateDelete");function Kun(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new G$e(t,"Cannot diff objects with symbols")}a(Kun,"AssertDiffable");function*f4o(t,e,r){if(Kun(e),Kun(r),!_Pt(r))return yield $$e(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Qi(e,s)||(yield Zun(`${t}/${s}`,r[s]));for(let s of n)Qi(r,s)&&(NY(e,r)||(yield*V$e(`${t}/${s}`,e[s],r[s])));for(let s of n)Qi(r,s)||(yield Xun(`${t}/${s}`))}a(f4o,"ObjectType");function*p4o(t,e,r){if(!Pi(r))return yield $$e(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(g4o,"IsRootUpdate");function A4o(t){return t.length===0}a(A4o,"IsIdentity");function tdn(t,e){if(g4o(e))return qa(e[0].value);if(A4o(e))return qa(t);let r=qa(t);for(let n of e)switch(n.type){case"insert":{TP.Set(r,n.path,n.value);break}case"update":{TP.Set(r,n.path,n.value);break}case"delete":{TP.Delete(r,n.path);break}}return r}a(tdn,"Patch");p();function rdn(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=yB(e,r)?Zoe(e,r,n):n;if(!es(e,r,o))throw new Joe(e,o,iM(e,r,o).First());return o}a(rdn,"Encode");p();function W$e(t){return So(t)&&!Pi(t)}a(W$e,"IsStandardObject");var z$e=class extends qi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function y4o(t,e,r,n){if(!W$e(r))TP.Set(t,e,qa(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)p8t(t,`${e}/${c}`,r[c],n[c])}}a(y4o,"ObjectType");function E4o(t,e,r,n){if(!Pi(r))TP.Set(t,e,qa(n));else{for(let o=0;o(L$e(s,c,l),l)],["Cast",(s,c,l)=>WTe(s,c,l)],["Clean",(s,c,l)=>F$e(s,c,l)],["Clone",(s,c,l)=>qa(l)],["Convert",(s,c,l)=>Q$e(s,c,l)],["Decode",(s,c,l)=>yB(s,c)?Koe(s,c,l):l],["Default",(s,c,l)=>q$e(s,c,l)],["Encode",(s,c,l)=>yB(s,c)?Zoe(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})(h8t||(h8t={}));var odn=["Clone","Clean","Default","Convert","Assert","Decode"];function b4o(t,e,r,n){return t.reduce((o,s)=>{let c=h8t.Get(s);if(Fu(c))throw new Y$e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(b4o,"ParseValue");function sdn(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?Pi(t[0])?[t[0],t[1],[],t[2]]:[odn,t[0],t[1],t[2]]:t.length===2?[odn,t[0],[],t[1]]:(()=>{throw new Y$e("Invalid Arguments")})();return b4o(e,r,n,o)}a(sdn,"Parse");p();var eO={};ki(eO,{Assert:()=>L$e,Cast:()=>WTe,Check:()=>es,Clean:()=>F$e,Clone:()=>qa,Convert:()=>Q$e,Create:()=>CP,Decode:()=>zun,Default:()=>q$e,Diff:()=>edn,Edit:()=>Jun,Encode:()=>rdn,Equal:()=>NY,Errors:()=>iM,Hash:()=>SU,Mutate:()=>idn,Parse:()=>sdn,Patch:()=>tdn,ValueErrorIterator:()=>TU});p();var S4o="gpt-41-copilot",Lx=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&bs(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 S4o}parseModelsResponse(e){try{return eO.Parse(xun,e)}catch(r){Nr.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 DY(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Nr.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=Run(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Nr.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=Ft(this._ctx,Ye.DebugOverrideEngine)||Ft(this._ctx,Ye.DebugOverrideEngineLegacy);if(o)return new MY(o,"override");let s=e?this._ctx.get(Zt).customEngine(e):"",c=e?this._ctx.get(Zt).customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new MY(s,"exp"):new MY(n,"modelpicker"):s?new MY(s,"exp"):new MY(r,"default")}},MY=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function gQ(t,e=void 0){let r=t.get(Lx),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(gQ,"getEngineRequestInfo");p();p();var qo=class{static{a(this,"FileSystem")}};var Sdn=de(bdn());function Tdn(t){return t!==void 0&&t!==0}a(Tdn,"isRepoInfo");function Idn(t){if(t===void 0||t===0)return"";let e=OY(t);if(e==="github/github")return e;let r=K4o(t)?.toLowerCase();return r!==void 0?r:""}a(Idn,"getDogFood");function OY(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(OY,"tryGetGitHubNWO");function K4o(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(K4o,"tryGetADONWO");function AQ(t,e){let r=uf(e);return J4o(t,r)}a(AQ,"extractRepoInfoInBackground");var J4o=tLo(Z4o,1e4);async function Z4o(t,e){let r=kKr(e);if(!r)return;let n=await X4o(t,r);if(!n)return;let o=t.get(qo),s=xa(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=eLo(c)??"",u=y8t(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(Z4o,"extractRepoInfo");function y8t(t){let e;try{if(e=(0,Sdn.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(y8t,"parseRepoUrl");async function X4o(t,e){let r=e+"_add_to_make_longer",n=t.get(qo);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 A8t(d)),n.delete(c)}),0}}a(tLo,"computeInBackgroundAndMemoize");p();var JTe=500,xdn=8192-JTe,wdn=4,K$e=10,Rdn=1e3*5,J$e={prefix:35,suffix:15,stableContext:35,volatileContext:15},rLo={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function ZTe(t){return t=t.toLowerCase(),rLo[t]??t}a(ZTe,"normalizeLanguageId");var E8t=class{constructor(e){this.ctx=e;this.cache=new Cn(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 _8t(()=>this.ctx.get(fP).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()}},_8t=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 nLo(t){return"uri"in t}a(nLo,"isCompletionsFiltersInfo");var Zt=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new E8t(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=Wt.createAndMarkAsIssued()){if(n instanceof XI)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&nLo(r)?AQ(this.ctx,r.uri):void 0,s=OY(o)??"",c=Idn(o)??"",l=r?.languageId??"",u=gQ(this.ctx).modelId,d=bQr(e),f=e.getTokenValue("ol")??"",h=e.getTokenValue("tid")??"",m=e.getTokenValue("fcv1")==="1",g=e.getTokenValue("sn")==="1",y=this.ctx.get(Op).getProperties(),E=e.endpoints,_={"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(),b=this.makeFilterSettings(_),T=v.extendFilters(b),w=await this.getExpConfig(T.newFilterSettings,E);v.update(b,+(w.variables.copilotbycallbuckets??NaN),+(w.variables.copilottimeperiodsizeinh??NaN));let R=v.extendFilters(b),x=R.newFilterSettings,P=await this.getExpConfig(x,E),D=new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs));for(let N of R.otherFilterSettingsToPrefetch)D=D.then(async()=>{await new Promise(L=>setTimeout(L,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(N,E)});return this.prepareForUpcomingFilters(x,E),new XI(n.properties,n.measurements,n.issuedTime,{filters:x,exp:P})}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(Fa).machineId;this.granularityDirectory=new vje(e,this.ctx.get(bx))}return this.granularityDirectory}makeFilterSettings(e){return new iB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return iC.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 iB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=bB(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??J$e.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??K$e}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??xdn+JTe}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??Rdn}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??J$e.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??J$e.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}ideEnableCopilotNesNonFreeEnabled(e){return e.filtersAndExp.exp.variables.ideenablecopilotnes??!1}};async function Z$e(t){let e=Ft(t,Ye.SearchAgent);if(e==="true")return!0;if(e==="false")return!1;let r=t.get(Zt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments();return r.searchAgentEnabled(n)}a(Z$e,"isSearchAgentEnabled");function Pdn(t,e){let r=Ft(t,Ye.EnableCopilotNesNonFree);return r==="true"?!0:r==="false"?!1:t.get(Zt).ideEnableCopilotNesNonFreeEnabled(e)}a(Pdn,"isIdeEnableCopilotNesNonFreeEnabled");p();p();p();var X$e=de(ale());var C8t={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 PS(t){return t in C8t&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(PS,"isSupportedLanguageId");function eVe(t){if(!(t in C8t))throw new Error(`Unrecognized language: ${t}`);return C8t[t]}a(eVe,"languageIdToWasmLanguage");var v8t=new Map;async function iLo(t){let e;try{e=await D$e(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new pQ(`Could not load tree-sitter-${t}.wasm`,r):r}return X$e.default.Language.load(e)}a(iLo,"loadWasmLanguage");function S8t(t){let e=eVe(t);if(!v8t.has(e)){let r=iLo(e);v8t.set(e,r)}return v8t.get(e)}a(S8t,"getLanguage");var b8t=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function yQ(t,e){return(await T8t(t,e))[0]}a(yQ,"parseTreeSitter");async function T8t(t,e){await X$e.default.init({locateFile:a(s=>$Te(s),"locateFile")});let r;try{r=new X$e.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 b8t(`Could not init Parse for language <${t}>`,s):s}let n=await S8t(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(T8t,"parseTreeSitterIncludingVersion");function Ddn(t){switch(eVe(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(Ddn,"getBlockCloseToken");function oLo(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(oLo,"innerQuery");var sLo=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function Ddn(t){return tLo([rLo],t).length==1}a(Ddn,"queryPythonIsDocstring");var eO=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 Ndn(t){return oLo([sLo],t).length==1}a(Ndn,"queryPythonIsDocstring");var tO=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}}},ag=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 cle.languageIds.has(e)||lle.languageIds.has(e)||ZTe.languageIds.has(e)||ule.languageIds.has(e)||XTe.languageIds.has(e)||eIe.languageIds.has(e)||tIe.languageIds.has(e)||rIe.languageIds.has(e)||nIe.languageIds.has(e)}static isTrimmedByDefault(e){return cle.languageIds.has(e)||lle.languageIds.has(e)||ule.languageIds.has(e)}static create(e,r,n,o){if(cle.languageIds.has(e))return new cle(e,r,n,o);if(lle.languageIds.has(e))return new lle(e,r,n,o);if(ZTe.languageIds.has(e))return new ZTe(e,r,n,o);if(ule.languageIds.has(e))return new ule(e,r,n,o);if(tIe.languageIds.has(e))return new tIe(e,r,n,o);if(XTe.languageIds.has(e))return new XTe(e,r,n,o);if(eIe.languageIds.has(e))return new eIe(e,r,n,o);if(rIe.languageIds.has(e))return new rIe(e,r,n,o);if(nIe.languageIds.has(e))return new nIe(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 AQ(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}}},ag=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 cle.languageIds.has(e)||lle.languageIds.has(e)||XTe.languageIds.has(e)||ule.languageIds.has(e)||eIe.languageIds.has(e)||tIe.languageIds.has(e)||rIe.languageIds.has(e)||nIe.languageIds.has(e)||iIe.languageIds.has(e)}static isTrimmedByDefault(e){return cle.languageIds.has(e)||lle.languageIds.has(e)||ule.languageIds.has(e)}static create(e,r,n,o){if(cle.languageIds.has(e))return new cle(e,r,n,o);if(lle.languageIds.has(e))return new lle(e,r,n,o);if(XTe.languageIds.has(e))return new XTe(e,r,n,o);if(ule.languageIds.has(e))return new ule(e,r,n,o);if(rIe.languageIds.has(e))return new rIe(e,r,n,o);if(eIe.languageIds.has(e))return new eIe(e,r,n,o);if(tIe.languageIds.has(e))return new tIe(e,r,n,o);if(nIe.languageIds.has(e))return new nIe(e,r,n,o);if(iIe.languageIds.has(e))return new iIe(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 yQ(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(` -`)}},X$e=class t extends eO{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"}},cle=class extends ag{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new X$e(e)}getStatementQueryText(){return`[ +`)}},tVe=class t extends tO{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"}},cle=class extends ag{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new tVe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1797,7 +1797,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (field_definition) - ] @statement`}},lle=class extends ag{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new X$e(e)}getStatementQueryText(){return`[ + ] @statement`}},lle=class extends ag{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new tVe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1820,7 +1820,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},T8t=class t extends eO{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}},ZTe=class extends ag{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new T8t(e)}getStatementQueryText(){return`[ + ] @statement`}},I8t=class t extends tO{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}},XTe=class extends ag{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new I8t(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -1846,24 +1846,24 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (decorated_definition) (match_statement) (block) - ] @statement`}},I8t=class t extends eO{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)}},ule=class extends ag{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new I8t(e)}getStatementQueryText(){return`[ + ] @statement`}},x8t=class t extends tO{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)}},ule=class extends ag{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new x8t(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},x8t=class t extends eO{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)}},XTe=class extends ag{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new x8t(e)}getStatementQueryText(){return`[ + ] @statement`}},w8t=class t extends tO{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)}},eIe=class extends ag{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new w8t(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},w8t=class t extends eO{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)}},eIe=class extends ag{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new w8t(e)}getStatementQueryText(){return`[ + ] @statement`}},R8t=class t extends tO{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)}},tIe=class extends ag{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new R8t(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},R8t=class t extends eO{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"}},tIe=class extends ag{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new R8t(e)}getStatementQueryText(){return`[ + ] @statement`}},k8t=class t extends tO{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"}},rIe=class extends ag{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new k8t(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -1876,7 +1876,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (block) (static_initializer) (constructor_declaration) - ] @statement`}},k8t=class t extends eO{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"}},rIe=class extends ag{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new k8t(e)}getStatementQueryText(){return`[ + ] @statement`}},P8t=class t extends tO{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"}},nIe=class extends ag{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new P8t(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -1888,7 +1888,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (declaration) (accessor_declaration) (block) - ] @statement`}},P8t=class t extends eO{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)}},nIe=class extends ag{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new P8t(e)}getStatementQueryText(){return`[ + ] @statement`}},D8t=class t extends tO{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)}},iIe=class extends ag{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new D8t(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -1925,7 +1925,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}};var tO=class{constructor(e,r,n){this.languageId=e;this.prefix=r;this.completion=n}static{a(this,"BlockTrimmer")}static isSupported(e){return ag.isSupported(e)}static isTrimmedByDefault(e){return ag.isTrimmedByDefault(e)}async withParsedStatementTree(e){var n=[];try{let r=Rkt(n,ag.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{kkt(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 eVe=class extends tO{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.endIndexpLo,build:()=>uLo,buildType:()=>dLo,default:()=>ELo,dependencies:()=>gLo,description:()=>cLo,devDependencies:()=>mLo,displayName:()=>aLo,engines:()=>fLo,name:()=>sLo,overrides:()=>ALo,overridesComments:()=>yLo,scripts:()=>hLo,version:()=>lLo});var sLo="copilot",aLo="GitHub Copilot",cLo="Your AI pair programmer",lLo="1.517.0",uLo="64",dLo="prod",fLo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},pLo={cliPackageVersion:"2.1.159"},hLo={postinstall:"tsx script/copyCopilotSdkFiles.ts",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: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"},mLo={"@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":"^21.0.1","@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.20.0",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^17.4.3",esbuild:"^0.28.1","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.4","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.7.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.45.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.36.0",sinon:"^22.0.0","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.3.0",tsx:"^4.22.4",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},gLo={"@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.63","@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","@modelcontextprotocol/sdk":"^1.29.0","@octokit/graphql":"^9.0.3","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.5.6","@sinclair/typebox":"^0.34.49","@vscode/chat-lib":"^0.54.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.2.0",minimatch:"^10.2.5",open:"^10.2.0",semver:"^7.8.5",shiki:"~1.15.0","source-map-support":"^0.5.21",undici:"^7.28.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.0",yargs:"^18.0.0"},ALo={fsevents:"<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.2",zod:"3.25.76"},yLo={"//":"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.",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.",zod:"Type-resolution hack: pin to 3.25.76 so the v3 API at root 'zod' (used by @github/copilot/sdk's zod-3-authored .d.ts via `import * as z from 'zod'`) and the v4 API at the 'zod/v4' subpath (used by @anthropic-ai/claude-agent-sdk via `import { z } from 'zod/v4'`) resolve from a single zod install. Without this, @anthropic-ai/claude-agent-sdk's strict `\"zod\": \"^4.0.0\"` requirement makes npm install zod 4.x, which causes z.infer in @github/copilot/sdk types to collapse to 'unknown' (TS18046 in lib/src/backgroundAgent/*). zod 3.25+ ships both APIs (root = v3, /v4 subpath = v4) so both consumers work from one install. Mirrors the same workaround used by vscode-copilot-chat. Drop when @github/copilot publishes zod-4-compatible types OR @anthropic-ai/claude-agent-sdk relaxes its zod requirement to '^3.25.0 || ^4.0.0'."},ELo={name:sLo,displayName:aLo,description:cLo,version:lLo,build:uLo,buildType:dLo,engines:fLo,anthropicClaude:pLo,scripts:hLo,devDependencies:mLo,dependencies:gLo,overrides:ALo,overridesComments:yLo};var Ye={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",NESExtendedRange:"nextEditSuggestions.extendedRange",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",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",EnableCopilotNesNonFree:"internal.enableCopilotNesNonFree",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",UseHelixFetcher:"internal.useHelixFetcher",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled",TransparentTokenRefresh:"internal.auth.transparentTokenRefresh",AuthTokenEncryption:"internal.auth.tokenEncryption",DisableWorkspaceIndex:"internal.disableWorkspaceIndex"};function Ldn(t){return["server","parsingandserver"].includes(t)}a(Ldn,"shouldDoServerTrimming");var TP=class{static{a(this,"BlockModeConfig")}},dle=class extends TP{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Zt).overrideBlockMode(n);if(o)return D8t(o,r);let s=e.get(Zt).enableProgressiveReveal(n);return(Ft(e,Ye.AlwaysRequestMultiline)??s)||tO.isTrimmedByDefault(r)?D8t("moremultiline",r):r=="ruby"?"parsing":kS(r)?"parsingandserver":"server"}};function _Lo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(_Lo,"blockModeRequiresTreeSitter");function D8t(t,e){return t==="moremultiline"&&ag.isSupported(e)?t:_Lo(t)&&!kS(e)?"server":t}a(D8t,"toApplicableBlockMode");var Lo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},fle=class extends Lo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return vLo(r)}getOptionalConfig(r){return CLo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},OY=class extends Lo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new Wi;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new Wi;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=iIe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[Ye.ShowEditorCompletions,Ye.EnableAutoCompletions,Ye.DelayCompletions,Ye.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function Bdn(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(Bdn,"getConfigKeyRecursively");function vLo(t){if(tVe.has(t))return tVe.get(t);throw new Error(`Missing config default value: ${Nkt}.${t}`)}a(vLo,"getConfigDefaultForKey");function CLo(t){return tVe.get(t)}a(CLo,"getOptionalConfigDefaultForKey");function ple(t){return t.get(Lo).getExplicitlySetConfigs()}a(ple,"getExplicitlySetConfigs");var bLo={[Ye.DebugOverrideCppHeadersEnableSwitch]:!1,[Ye.RelatedFilesVSCodeCSharp]:!1,[Ye.RelatedFilesVSCodeTypeScript]:!1,[Ye.RelatedFilesVSCode]:!1,[Ye.IncludeNeighboringFiles]:!1,[Ye.ExcludeRelatedFiles]:!1,[Ye.ContextProviders]:[],[Ye.DebugUseEditorFetcher]:null,[Ye.DebugUseElectronFetcher]:null,[Ye.DebugOverrideLogLevels]:{},[Ye.DebugSnippyOverrideUrl]:"",[Ye.AgentDebugLogsDirectory]:void 0,[Ye.ClaudeCliPath]:void 0,[Ye.CodexCliPath]:void 0,[Ye.FetchStrategy]:"auto",[Ye.ToolConfirmAutoApprove]:!1,[Ye.AutoApproveUnmatchedTerminal]:void 0,[Ye.AutoApproveUnmatchedFileOp]:void 0,[Ye.TrustToolAnnotations]:!1,[Ye.AutoApproveYoloMode]:!1,[Ye.EditorHandlesAllConfirmation]:!1,[Ye.MaxToolCallingLoop]:25,[Ye.AutoCompress]:!1,[Ye.AnthropicThinkingBudgetToken]:1024,[Ye.EnableSkills]:!1,[Ye.EnableHooks]:!1,[Ye.EnableSandbox]:!1,[Ye.SandboxAddCurrentWorkingDirectory]:void 0,[Ye.SandboxUserPolicy]:void 0,[Ye.EnablePlugins]:!1,[Ye.EnableCustomAgents]:!0,[Ye.EnableOrgCustomAgents]:!0,[Ye.UseAgentsMd]:!1,[Ye.UseNestedAgentsMd]:!1,[Ye.UseClaudeMd]:!1,[Ye.UseNestedClaudeMd]:!1,[Ye.UseSubsetMatching]:null,[Ye.ContextProviderTimeBudget]:void 0,[Ye.DebugOverrideCapiUrl]:"",[Ye.DebugTestOverrideCapiUrl]:"",[Ye.DebugOverrideProxyUrl]:"",[Ye.DebugTestOverrideProxyUrl]:"",[Ye.DebugOverrideEngine]:"",[Ye.AlwaysRequestMultiline]:void 0,[Ye.ModelAlwaysTerminatesSingleline]:void 0,[Ye.TrimCompletionsAggressively]:void 0,[Ye.CompletionsDebounce]:void 0,[Ye.NESXTab]:void 0,[Ye.UseWorkspaceContextCoordinator]:void 0,[Ye.ShowWorkspaceContextDebugger]:!1,[Ye.CompletionsDelay]:void 0,[Ye.UseSplitContextPrompt]:void 0,[Ye.UseCompletionsComparisonPanel]:void 0,[Ye.ComparisonPanelModelIds]:void 0,[Ye.ComparisonPanelRandomizedMode]:void 0,[Ye.UseFetchFetcher]:void 0,[Ye.UseChatLibCompletions]:void 0,[Ye.TranscriptDirectory]:void 0,[Ye.EnableThinking]:!0,[Ye.ShowEditorCompletions]:void 0,[Ye.EnableAutoCompletions]:void 0,[Ye.DelayCompletions]:void 0,[Ye.FilterCompletions]:void 0,[Ye.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[Ye.UserSelectedCompletionModel]:"",[Ye.DebugFilterLogCategories]:[],[Ye.DebugOverrideEngineLegacy]:"",[Ye.DebugTestOverrideProxyUrlLegacy]:"",[Ye.DebugOverrideProxyUrlLegacy]:"",[Ye.DebugTestOverrideCapiUrlLegacy]:"",[Ye.DebugOverrideCapiUrlLegacy]:"",[Ye.HookErrorOccurredStackTrace]:!1,[Ye.NESUseExplicitRejection]:!1,[Ye.AppendPromptTokenCache]:"",[Ye.PromptPersistBasePath]:void 0,[Ye.AnthropicMessagesEndpoint]:"",[Ye.EnableCopilotNesNonFree]:"",[Ye.UseHelixFetcher]:"",[Ye.EnableMapCodeFallback]:"enabled",[Ye.SearchAgent]:"",[Ye.PerfEnabled]:"",[Ye.NESExtendedRange]:!1,[Ye.TransparentTokenRefresh]:"",[Ye.AuthTokenEncryption]:"",[Ye.DisableWorkspaceIndex]:""},tVe=new Map(Object.entries(bLo));for(let t of Object.values(Ye))if(!tVe.has(t))throw new Error(`Missing config default value ${Nkt}.${t}`);function Ft(t,e){return t.get(Lo).getConfig(e)}a(Ft,"getConfig");function IP(t){return Ft(t,Ye.DisableWorkspaceIndex)==="true"}a(IP,"isWorkspaceIndexDisabled");function CKr(t){return t.get(Lo).dumpForTelemetry()}a(CKr,"dumpForTelemetry");var ds=class{constructor(){this.packageJson=oIe}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 UDt(t){return t.get(ds).isProduction()}a(UDt,"isProduction");function Rtn(t){return t.get(ds).getBuildType()==="dev"}a(Rtn,"isDevBuild");function MU(t){return t.get(ds).getBuildType()}a(MU,"getBuildType");function bKr(t){return t.get(ds).getBuild()}a(bKr,"getBuild");function V1(t){return t.get(ds).getVersion()}a(V1,"getVersion");var Ua=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 M1({name:t,version:e}){return`${t}/${e}`}a(M1,"formatNameAndVersion");var Ir=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return vQr({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function S$e(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(S$e,"getIntegrationId");function Gy(t){let e=t.get(Ir);return{"Editor-Version":M1(e.getEditorInfo()),"Editor-Plugin-Version":M1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":V1(t)}}a(Gy,"editorVersionHeaders");var Fdn="Iv1.b507a08c87ecfe98",SLo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Kae="Ov23liV9UpD7Rnfnskm3",TLo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",ILo={[Fdn]:SLo,[Kae]:TLo},zp=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??Fdn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=ILo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};p();var xLo=new fe("expConfigManager"),wLo=3600*1e3,rO=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(Zt).getFallbackExpAndFilters();this.cached=r,this.fetchedAt=Date.now()}catch(r){xLo.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};function ktn(t){let e=Ft(t,Ye.TransparentTokenRefresh);if(e==="true")return{value:!0,source:"config"};if(e==="false")return{value:!1,source:"config"};let r=t.get(rO).getBoolean("copilottransparenttokenrefresh");return typeof r=="boolean"?{value:r,source:"exp"}:{value:!1,source:"default"}}a(ktn,"resolveTransparentTokenRefresh");function Udn(t){return Ft(t,Ye.AuthTokenEncryption)==="false"}a(Udn,"isAuthTokenEncryptionDisabled");p();var Vdn=de(require("node:crypto"));var N8t=new fe("KeytarMasterKey"),jdn="copilot-language-server",Hdn="oauth-token-key",Gdn=5e3,Wdn=32,M8t;function PLo(t){return M8t??=DLo(t).finally(()=>{M8t=void 0}),M8t}a(PLo,"resolveMasterKey");async function DLo(t){let e;try{e=await L8t.loadKeytar()}catch(n){return N8t.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:O8t("loadModule",n)}}let r;try{r=await MLo(e)}catch(n){return n instanceof rVe?(N8t.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:O8t("corruptExistingEntry",n)}):(N8t.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:O8t("getOrCreateMasterKey",n)})}return{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(DLo,"doResolveMasterKey");function NLo(){return Promise.resolve().then(()=>de(qdn()))}a(NLo,"loadKeytar");var L8t={resolveMasterKey:PLo,loadKeytar:NLo};async function MLo(t){let e=await $dn(t.getPassword(jdn,Hdn),Gdn,"getMasterKey");if(e){let n=OLo(e);if(n)return{key:n,source:"useExisting"};throw new rVe}let r=Vdn.randomBytes(Wdn);return await $dn(t.setPassword(jdn,Hdn,r.toString("base64")),Gdn,"setMasterKey"),{key:r,source:"createNew"}}a(MLo,"getOrCreateMasterKey");function $dn(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($dn,"withTimeout");var rVe=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function O8t(t,e){return{available:!1,errorPhase:t,error:e}}a(O8t,"unavailable");function OLo(t){let e=Buffer.from(t,"base64");return e.length===Wdn?e:void 0}a(OLo,"decodeMasterKey");p();var hle=de(require("node:crypto"));var U8t=0,sVe=1,yQ=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")}},iVe=class{static{a(this,"SecretCodec")}},F8t=class extends iVe{constructor(){super(...arguments);this.schemaVersion=U8t}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},nVe=12,B8t=16,zdn=32,oVe=class extends iVe{constructor(r){super();this.key=r;this.schemaVersion=sVe;if(r.length!==zdn)throw new Error(`AesGcmCodec requires a ${zdn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=hle.randomBytes(nVe),o=hle.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 rVe=class extends rO{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.endIndexALo,build:()=>hLo,buildType:()=>mLo,default:()=>bLo,dependencies:()=>_Lo,description:()=>fLo,devDependencies:()=>ELo,displayName:()=>dLo,engines:()=>gLo,name:()=>uLo,overrides:()=>vLo,overridesComments:()=>CLo,scripts:()=>yLo,version:()=>pLo});var uLo="copilot",dLo="GitHub Copilot",fLo="Your AI pair programmer",pLo="1.519.0",hLo="70",mLo="prod",gLo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},ALo={cliPackageVersion:"2.1.159"},yLo={postinstall:"tsx script/copyCopilotSdkFiles.ts",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: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"},ELo={"@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/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.0.0",esbuild:"^0.28.1","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.4","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.7.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.45.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.36.0",sinon:"^22.0.0","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.3.0",tsx:"^4.23.0",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},_Lo={"@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.63","@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","@modelcontextprotocol/sdk":"^1.29.0","@octokit/graphql":"^9.0.3","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.5.6","@sinclair/typebox":"^0.34.49","@vscode/chat-lib":"^0.54.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.5",open:"^10.2.0",semver:"^7.8.5",shiki:"~1.15.0","source-map-support":"^0.5.21",undici:"^7.28.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.0",yargs:"^18.0.0"},vLo={fsevents:"<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.2",zod:"3.25.76"},CLo={"//":"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.",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.",zod:"Type-resolution hack: pin to 3.25.76 so the v3 API at root 'zod' (used by @github/copilot/sdk's zod-3-authored .d.ts via `import * as z from 'zod'`) and the v4 API at the 'zod/v4' subpath (used by @anthropic-ai/claude-agent-sdk via `import { z } from 'zod/v4'`) resolve from a single zod install. Without this, @anthropic-ai/claude-agent-sdk's strict `\"zod\": \"^4.0.0\"` requirement makes npm install zod 4.x, which causes z.infer in @github/copilot/sdk types to collapse to 'unknown' (TS18046 in lib/src/backgroundAgent/*). zod 3.25+ ships both APIs (root = v3, /v4 subpath = v4) so both consumers work from one install. Mirrors the same workaround used by vscode-copilot-chat. Drop when @github/copilot publishes zod-4-compatible types OR @anthropic-ai/claude-agent-sdk relaxes its zod requirement to '^3.25.0 || ^4.0.0'."},bLo={name:uLo,displayName:dLo,description:fLo,version:pLo,build:hLo,buildType:mLo,engines:gLo,anthropicClaude:ALo,scripts:yLo,devDependencies:ELo,dependencies:_Lo,overrides:vLo,overridesComments:CLo};var Ye={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",NESExtendedRange:"nextEditSuggestions.extendedRange",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",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",EnableCopilotNesNonFree:"internal.enableCopilotNesNonFree",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",UseHelixFetcher:"internal.useHelixFetcher",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled",TransparentTokenRefresh:"internal.auth.transparentTokenRefresh",AuthTokenEncryption:"internal.auth.tokenEncryption",DisableWorkspaceIndex:"internal.disableWorkspaceIndex"};function Bdn(t){return["server","parsingandserver"].includes(t)}a(Bdn,"shouldDoServerTrimming");var IP=class{static{a(this,"BlockModeConfig")}},dle=class extends IP{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Zt).overrideBlockMode(n);if(o)return N8t(o,r);let s=e.get(Zt).enableProgressiveReveal(n);return(Ft(e,Ye.AlwaysRequestMultiline)??s)||rO.isTrimmedByDefault(r)?N8t("moremultiline",r):r=="ruby"?"parsing":PS(r)?"parsingandserver":"server"}};function SLo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(SLo,"blockModeRequiresTreeSitter");function N8t(t,e){return t==="moremultiline"&&ag.isSupported(e)?t:SLo(t)&&!PS(e)?"server":t}a(N8t,"toApplicableBlockMode");var Bo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},fle=class extends Bo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return TLo(r)}getOptionalConfig(r){return ILo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},LY=class extends Bo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new Wi;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new Wi;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=oIe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[Ye.ShowEditorCompletions,Ye.EnableAutoCompletions,Ye.DelayCompletions,Ye.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function Fdn(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(Fdn,"getConfigKeyRecursively");function TLo(t){if(nVe.has(t))return nVe.get(t);throw new Error(`Missing config default value: ${Mkt}.${t}`)}a(TLo,"getConfigDefaultForKey");function ILo(t){return nVe.get(t)}a(ILo,"getOptionalConfigDefaultForKey");function ple(t){return t.get(Bo).getExplicitlySetConfigs()}a(ple,"getExplicitlySetConfigs");var xLo={[Ye.DebugOverrideCppHeadersEnableSwitch]:!1,[Ye.RelatedFilesVSCodeCSharp]:!1,[Ye.RelatedFilesVSCodeTypeScript]:!1,[Ye.RelatedFilesVSCode]:!1,[Ye.IncludeNeighboringFiles]:!1,[Ye.ExcludeRelatedFiles]:!1,[Ye.ContextProviders]:[],[Ye.DebugUseEditorFetcher]:null,[Ye.DebugUseElectronFetcher]:null,[Ye.DebugOverrideLogLevels]:{},[Ye.DebugSnippyOverrideUrl]:"",[Ye.AgentDebugLogsDirectory]:void 0,[Ye.ClaudeCliPath]:void 0,[Ye.CodexCliPath]:void 0,[Ye.FetchStrategy]:"auto",[Ye.ToolConfirmAutoApprove]:!1,[Ye.AutoApproveUnmatchedTerminal]:void 0,[Ye.AutoApproveUnmatchedFileOp]:void 0,[Ye.TrustToolAnnotations]:!1,[Ye.AutoApproveYoloMode]:!1,[Ye.EditorHandlesAllConfirmation]:!1,[Ye.MaxToolCallingLoop]:25,[Ye.AutoCompress]:!1,[Ye.AnthropicThinkingBudgetToken]:1024,[Ye.EnableSkills]:!1,[Ye.EnableHooks]:!1,[Ye.EnableSandbox]:!1,[Ye.SandboxAddCurrentWorkingDirectory]:void 0,[Ye.SandboxUserPolicy]:void 0,[Ye.EnablePlugins]:!1,[Ye.EnableCustomAgents]:!0,[Ye.EnableOrgCustomAgents]:!0,[Ye.UseAgentsMd]:!1,[Ye.UseNestedAgentsMd]:!1,[Ye.UseClaudeMd]:!1,[Ye.UseNestedClaudeMd]:!1,[Ye.UseSubsetMatching]:null,[Ye.ContextProviderTimeBudget]:void 0,[Ye.DebugOverrideCapiUrl]:"",[Ye.DebugTestOverrideCapiUrl]:"",[Ye.DebugOverrideProxyUrl]:"",[Ye.DebugTestOverrideProxyUrl]:"",[Ye.DebugOverrideEngine]:"",[Ye.AlwaysRequestMultiline]:void 0,[Ye.ModelAlwaysTerminatesSingleline]:void 0,[Ye.TrimCompletionsAggressively]:void 0,[Ye.CompletionsDebounce]:void 0,[Ye.NESXTab]:void 0,[Ye.UseWorkspaceContextCoordinator]:void 0,[Ye.ShowWorkspaceContextDebugger]:!1,[Ye.CompletionsDelay]:void 0,[Ye.UseSplitContextPrompt]:void 0,[Ye.UseCompletionsComparisonPanel]:void 0,[Ye.ComparisonPanelModelIds]:void 0,[Ye.ComparisonPanelRandomizedMode]:void 0,[Ye.UseFetchFetcher]:void 0,[Ye.UseChatLibCompletions]:void 0,[Ye.TranscriptDirectory]:void 0,[Ye.EnableThinking]:!0,[Ye.ShowEditorCompletions]:void 0,[Ye.EnableAutoCompletions]:void 0,[Ye.DelayCompletions]:void 0,[Ye.FilterCompletions]:void 0,[Ye.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[Ye.UserSelectedCompletionModel]:"",[Ye.DebugFilterLogCategories]:[],[Ye.DebugOverrideEngineLegacy]:"",[Ye.DebugTestOverrideProxyUrlLegacy]:"",[Ye.DebugOverrideProxyUrlLegacy]:"",[Ye.DebugTestOverrideCapiUrlLegacy]:"",[Ye.DebugOverrideCapiUrlLegacy]:"",[Ye.HookErrorOccurredStackTrace]:!1,[Ye.NESUseExplicitRejection]:!1,[Ye.AppendPromptTokenCache]:"",[Ye.PromptPersistBasePath]:void 0,[Ye.AnthropicMessagesEndpoint]:"",[Ye.EnableCopilotNesNonFree]:"",[Ye.UseHelixFetcher]:"",[Ye.EnableMapCodeFallback]:"enabled",[Ye.SearchAgent]:"",[Ye.PerfEnabled]:"",[Ye.NESExtendedRange]:!1,[Ye.TransparentTokenRefresh]:"",[Ye.AuthTokenEncryption]:"",[Ye.DisableWorkspaceIndex]:""},nVe=new Map(Object.entries(xLo));for(let t of Object.values(Ye))if(!nVe.has(t))throw new Error(`Missing config default value ${Mkt}.${t}`);function Ft(t,e){return t.get(Bo).getConfig(e)}a(Ft,"getConfig");function xP(t){return Ft(t,Ye.DisableWorkspaceIndex)==="true"}a(xP,"isWorkspaceIndexDisabled");function bKr(t){return t.get(Bo).dumpForTelemetry()}a(bKr,"dumpForTelemetry");var ds=class{constructor(){this.packageJson=sIe}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 QDt(t){return t.get(ds).isProduction()}a(QDt,"isProduction");function ktn(t){return t.get(ds).getBuildType()==="dev"}a(ktn,"isDevBuild");function OU(t){return t.get(ds).getBuildType()}a(OU,"getBuildType");function SKr(t){return t.get(ds).getBuild()}a(SKr,"getBuild");function V1(t){return t.get(ds).getVersion()}a(V1,"getVersion");var Fa=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 M1({name:t,version:e}){return`${t}/${e}`}a(M1,"formatNameAndVersion");var Ir=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return CQr({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function I$e(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(I$e,"getIntegrationId");function Gy(t){let e=t.get(Ir);return{"Editor-Version":M1(e.getEditorInfo()),"Editor-Plugin-Version":M1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":V1(t)}}a(Gy,"editorVersionHeaders");var Udn="Iv1.b507a08c87ecfe98",wLo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Kae="Ov23liV9UpD7Rnfnskm3",RLo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",kLo={[Udn]:wLo,[Kae]:RLo},zp=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??Udn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=kLo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};p();var PLo=new fe("expConfigManager"),DLo=3600*1e3,nO=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(Zt).getFallbackExpAndFilters();this.cached=r,this.fetchedAt=Date.now()}catch(r){PLo.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};function Ptn(t){let e=Ft(t,Ye.TransparentTokenRefresh);if(e==="true")return{value:!0,source:"config"};if(e==="false")return{value:!1,source:"config"};let r=t.get(nO).getBoolean("copilottransparenttokenrefresh");return typeof r=="boolean"?{value:r,source:"exp"}:{value:!1,source:"default"}}a(Ptn,"resolveTransparentTokenRefresh");function Qdn(t){return Ft(t,Ye.AuthTokenEncryption)==="false"}a(Qdn,"isAuthTokenEncryptionDisabled");p();var Wdn=de(require("node:crypto"));var M8t=new fe("KeytarMasterKey"),Hdn="copilot-language-server",Gdn="oauth-token-key",$dn=5e3,zdn=32,O8t;function OLo(t){return O8t??=LLo(t).finally(()=>{O8t=void 0}),O8t}a(OLo,"resolveMasterKey");async function LLo(t){let e;try{e=await B8t.loadKeytar()}catch(n){return M8t.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:L8t("loadModule",n)}}let r;try{r=await FLo(e)}catch(n){return n instanceof iVe?(M8t.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:L8t("corruptExistingEntry",n)}):(M8t.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:L8t("getOrCreateMasterKey",n)})}return{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(LLo,"doResolveMasterKey");function BLo(){return Promise.resolve().then(()=>de(jdn()))}a(BLo,"loadKeytar");var B8t={resolveMasterKey:OLo,loadKeytar:BLo};async function FLo(t){let e=await Vdn(t.getPassword(Hdn,Gdn),$dn,"getMasterKey");if(e){let n=ULo(e);if(n)return{key:n,source:"useExisting"};throw new iVe}let r=Wdn.randomBytes(zdn);return await Vdn(t.setPassword(Hdn,Gdn,r.toString("base64")),$dn,"setMasterKey"),{key:r,source:"createNew"}}a(FLo,"getOrCreateMasterKey");function Vdn(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(Vdn,"withTimeout");var iVe=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function L8t(t,e){return{available:!1,errorPhase:t,error:e}}a(L8t,"unavailable");function ULo(t){let e=Buffer.from(t,"base64");return e.length===zdn?e:void 0}a(ULo,"decodeMasterKey");p();var hle=de(require("node:crypto"));var Q8t=0,cVe=1,EQ=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")}},sVe=class{static{a(this,"SecretCodec")}},U8t=class extends sVe{constructor(){super(...arguments);this.schemaVersion=Q8t}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},oVe=12,F8t=16,Ydn=32,aVe=class extends sVe{constructor(r){super();this.key=r;this.schemaVersion=cVe;if(r.length!==Ydn)throw new Error(`AesGcmCodec requires a ${Ydn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=hle.randomBytes(oVe),o=hle.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();tU(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();tU(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 tU(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();tU(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 upgradePlaintextRows(){let r=this.stmts.selectPlaintextTokenRows.all(),n=0,o=0,s=0;for(let c of r){let l;try{let d=this.secretStorage.unwrap({schemaVersion:U8t,ciphertext:c.token_ciphertext});l=this.secretStorage.wrap(d)}catch{o++;continue}let u=tU(this.db,()=>this.stmts.updateTokenCiphertext.run(l.ciphertext,l.schemaVersion,c.token_id));Number(u.changes)===1?n++:s++}return{attempted:r.length,upgraded:n,failed:o,skipped:s}}async decryptOauthTokensFromV1ToV0(){let r=this.stmts.selectEncryptedTokenRows.all(),n=0,o=0,s=0;for(let c of r){let l;try{l=this.secretStorage.unwrap({schemaVersion:sVe,ciphertext:c.token_ciphertext})}catch(d){if(d instanceof yQ){let{affectedEditors:f,tokenDeleted:h}=await this.deleteTokenCascade(c.token_id);h?(o++,sSe(this.ctx,{editorId:c.source_editor_id,trigger:"unwrap_failure",affectedEditors:f})):s++;continue}s++;continue}this.writePlaintextRow(c.token_id,l)===1?n++:s++}return{attempted:r.length,decrypted:n,purged:o,skipped:s}}writePlaintextRow(r,n){let o=tU(this.db,()=>this.stmts.updateTokenToPlaintext.run(Buffer.from(n,"utf8"),r));return Number(o.changes)}async toStoredTokenRecordOrPurge(r){try{let n=this.secretStorage.unwrap({schemaVersion:r.token_schema_version,ciphertext:r.token_ciphertext});if(r.token_schema_version===sVe){let o=r.token_id,s=n;setImmediate(()=>{try{this.writePlaintextRow(o,s)}catch(c){Q8t.info(this.ctx,`opportunistic v1->v0 heal failed tokenId=${o} (will retry on next read/boot)`,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 yQ&&n.kind==="tagMismatch"&&this.deleteTokenCascade(r.token_id).then(({affectedEditors:o,tokenDeleted:s})=>{s&&(Q8t.warn(this.ctx,`purged token after AES unwrap failure (tagMismatch) tokenId=${r.token_id} affectedEditors=${o}`),sSe(this.ctx,{editorId:r.source_editor_id,trigger:"unwrap_failure",affectedEditors:o}))}).catch(o=>Q8t.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 Jdn=de(require("fs")),q8t=de(require("node:sqlite")),Zdn=de(require("path"));var EQ=new fe("AuthRepoInit");function mle(){return typeof performance<"u"?performance.now():Date.now()}a(mle,"nowMs");function Kdn(t){try{t.close()}catch{}}a(Kdn,"safeClose");function LLo(t){let e=mle(),r={durationMs:0};try{Jdn.mkdirSync(Zdn.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=mle()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new q8t.default.DatabaseSync(t)}catch(o){return r.durationMs=mle()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{Pkt(n)}catch(o){return r.durationMs=mle()-e,r.errorPhase="applyPragmas",r.error=o,Kdn(n),{db:void 0,diagnostics:r}}try{Dkt(n)}catch(o){return r.durationMs=mle()-e,r.errorPhase="applySchema",r.error=o,Kdn(n),{db:void 0,diagnostics:r}}return r.durationMs=mle()-e,{db:n,diagnostics:r}}a(LLo,"tryOpenAuthDb");function BLo(t,e){let r=new q8t.default.DatabaseSync(":memory:");return Pkt(r),Dkt(r),new sIe(t,r,e)}a(BLo,"openInMemoryAuthRepo");function Xdn(t,e,r){let{db:n,diagnostics:o}=LLo(e);return n?{repo:new sIe(t,n,r),diagnostics:{...o,repoKind:"sqlite"}}:{repo:BLo(t,r),diagnostics:{...o,repoKind:"memory"}}}a(Xdn,"buildAuthRepository");function efn(t,e){if(e.repoKind==="memory"){EQ.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(ts).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=>{EQ.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){EQ.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(efn,"reportAuthRepoFallbackNotice");function tfn(t,e){ytn(t,e)}a(tfn,"reportAuthRepoTelemetry");async function j8t(t){let e=t.get(v3),r=t.get(pf);if(Udn(t)){EQ.info(t,"secret-store: encryption disabled by config; pinning writes to plaintext v0");let c={available:!1,errorPhase:"disabledByConfig"};return r.onInitialized(()=>hje(t,{writerKind:"plaintext",diagnostics:c})),{diagnostics:c}}let{masterKey:n,diagnostics:o}=await L8t.resolveMasterKey(t);if(!n)return ULo(t,o),r.onInitialized(()=>hje(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o};let s=new oVe(n);return e.addReader(s),r.onInitialized(()=>hje(t,{writerKind:"plaintext",diagnostics:o})),FLo(t),{diagnostics:o}}a(j8t,"initializeSecretStorage");function FLo(t){let e=t.get(pf);setImmediate(()=>{t.get(nx).decryptOauthTokensFromV1ToV0().then(r=>{r.attempted!==0&&e.onInitialized(()=>x5t(t,{result:r}))}).catch(r=>{EQ.error(t,"secret-store: v1->v0 decrypt pass failed",r),e.onInitialized(()=>x5t(t,{error:r}))})})}a(FLo,"scheduleDecryptOauthTokensFromV1ToV0");function ULo(t,e){EQ.info(t,`secret-store fallback: tokens stored in plaintext on disk (no OS keychain available; phase=${e.errorPhase??"n/a"})`);try{t.get(ts).showWarningMessageOnlyOnce("auth.secretStorage.plaintextFallback","GitHub Copilot could not access the OS keychain. OAuth tokens are stored in plaintext on disk.").catch(r=>{EQ.info(t,"reportSecretStorageFallbackNotice: notification failed",r)})}catch(r){EQ.info(t,"reportSecretStorageFallbackNotice: notification skipped",r)}}a(ULo,"reportSecretStorageFallbackNotice");p();p();var QLo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function qLo(t){return QLo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(qLo,"isOomError");function LY(t,e,r,n=Nr){if(!Gm(e)){if(e instanceof Error){let o=e;qLo(o)?t.get(ps).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(ps).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(ps).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(ps).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(ps).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(LY,"handleException");function rfn(t){process.addListener("uncaughtException",r=>{LY(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,LY(t,r,"unhandledRejection")}finally{e=!1}})}a(rfn,"registerDefaultHandlers");function nfn(){hQ("o200k_base").catch(()=>{})}a(nfn,"prewarmTokenizers");p();p();p();var C3={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 ifn=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],ofn={".php":[".blade"]},_Q=Object.keys(C3).flatMap(t=>C3[t].extensions);var H8t=de(require("node:path"));var Ale=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},aIe=class{static{a(this,"LanguageDetection")}},G8t=new Map,gle=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(C3)){for(let n of e)G8t.set(n,[...G8t.get(n)??[],t]);for(let n of r??[])gle.set(n,[...gle.get(n)??[],t])}var $8t=class extends aIe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=Ji(e.uri),n=H8t.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new Ale(s.languageId,s.isGuess,c):new Ale(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(ifn.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=H8t.extname(n).toLowerCase();if(o.length>0&&_Q.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=ofn[e];return!n||n.includes(r)}detectLanguageId(e,r){if(gle.has(e))return{languageId:gle.get(e)[0],isGuess:!1};let n=G8t.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),gle.has(e))return{languageId:gle.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},V8t=class extends aIe{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 Ale("cpp",n.isGuess,n.fileExtension):n}},W8t=class extends aIe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new Ale(r.languageId,!0,""):this.delegate.detectLanguage(r)}},jLo=new V8t(new W8t(new $8t));function nO({uri:t,languageId:e}){let r=jLo.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(nO,"detectLanguage");p();p();p();p();function Hh(t){if(t.isCancellationRequested)throw new aVe}a(Hh,"throwIfCancellationRequested");function xP(t){return t instanceof aVe?!0:t instanceof Error&&t.name===z8t&&t.message===z8t}a(xP,"isCancellationError");var aVe=class extends Error{static{a(this,"CancellationError")}constructor(){super(z8t),this.name=this.message}},z8t="Canceled",cVe=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 BY(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(BY,"isTypeDefinition");var hu=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=afn(e,e.length,o),sfn(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();rU(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();rU(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 rU(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();rU(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 upgradePlaintextRows(){let r=this.stmts.selectPlaintextTokenRows.all(),n=0,o=0,s=0;for(let c of r){let l;try{let d=this.secretStorage.unwrap({schemaVersion:Q8t,ciphertext:c.token_ciphertext});l=this.secretStorage.wrap(d)}catch{o++;continue}let u=rU(this.db,()=>this.stmts.updateTokenCiphertext.run(l.ciphertext,l.schemaVersion,c.token_id));Number(u.changes)===1?n++:s++}return{attempted:r.length,upgraded:n,failed:o,skipped:s}}async decryptOauthTokensFromV1ToV0(){let r=this.stmts.selectEncryptedTokenRows.all(),n=0,o=0,s=0;for(let c of r){let l;try{l=this.secretStorage.unwrap({schemaVersion:cVe,ciphertext:c.token_ciphertext})}catch(d){if(d instanceof EQ){let{affectedEditors:f,tokenDeleted:h}=await this.deleteTokenCascade(c.token_id);h?(o++,aSe(this.ctx,{editorId:c.source_editor_id,trigger:"unwrap_failure",affectedEditors:f})):s++;continue}s++;continue}this.writePlaintextRow(c.token_id,l)===1?n++:s++}return{attempted:r.length,decrypted:n,purged:o,skipped:s}}writePlaintextRow(r,n){let o=rU(this.db,()=>this.stmts.updateTokenToPlaintext.run(Buffer.from(n,"utf8"),r));return Number(o.changes)}async toStoredTokenRecordOrPurge(r){try{let n=this.secretStorage.unwrap({schemaVersion:r.token_schema_version,ciphertext:r.token_ciphertext});if(r.token_schema_version===cVe){let o=r.token_id,s=n;setImmediate(()=>{try{this.writePlaintextRow(o,s)}catch(c){q8t.info(this.ctx,`opportunistic v1->v0 heal failed tokenId=${o} (will retry on next read/boot)`,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 EQ&&n.kind==="tagMismatch"&&this.deleteTokenCascade(r.token_id).then(({affectedEditors:o,tokenDeleted:s})=>{s&&(q8t.warn(this.ctx,`purged token after AES unwrap failure (tagMismatch) tokenId=${r.token_id} affectedEditors=${o}`),aSe(this.ctx,{editorId:r.source_editor_id,trigger:"unwrap_failure",affectedEditors:o}))}).catch(o=>q8t.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 Zdn=de(require("fs")),j8t=de(require("node:sqlite")),Xdn=de(require("path"));var _Q=new fe("AuthRepoInit");function mle(){return typeof performance<"u"?performance.now():Date.now()}a(mle,"nowMs");function Jdn(t){try{t.close()}catch{}}a(Jdn,"safeClose");function QLo(t){let e=mle(),r={durationMs:0};try{Zdn.mkdirSync(Xdn.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=mle()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new j8t.default.DatabaseSync(t)}catch(o){return r.durationMs=mle()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{Dkt(n)}catch(o){return r.durationMs=mle()-e,r.errorPhase="applyPragmas",r.error=o,Jdn(n),{db:void 0,diagnostics:r}}try{Nkt(n)}catch(o){return r.durationMs=mle()-e,r.errorPhase="applySchema",r.error=o,Jdn(n),{db:void 0,diagnostics:r}}return r.durationMs=mle()-e,{db:n,diagnostics:r}}a(QLo,"tryOpenAuthDb");function qLo(t,e){let r=new j8t.default.DatabaseSync(":memory:");return Dkt(r),Nkt(r),new aIe(t,r,e)}a(qLo,"openInMemoryAuthRepo");function efn(t,e,r){let{db:n,diagnostics:o}=QLo(e);return n?{repo:new aIe(t,n,r),diagnostics:{...o,repoKind:"sqlite"}}:{repo:qLo(t,r),diagnostics:{...o,repoKind:"memory"}}}a(efn,"buildAuthRepository");function tfn(t,e){if(e.repoKind==="memory"){_Q.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(ts).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=>{_Q.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){_Q.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(tfn,"reportAuthRepoFallbackNotice");function rfn(t,e){Etn(t,e)}a(rfn,"reportAuthRepoTelemetry");async function H8t(t){let e=t.get(v3),r=t.get(pf);if(Qdn(t)){_Q.info(t,"secret-store: encryption disabled by config; pinning writes to plaintext v0");let c={available:!1,errorPhase:"disabledByConfig"};return r.onInitialized(()=>gje(t,{writerKind:"plaintext",diagnostics:c})),{diagnostics:c}}let{masterKey:n,diagnostics:o}=await B8t.resolveMasterKey(t);if(!n)return HLo(t,o),r.onInitialized(()=>gje(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o};let s=new aVe(n);return e.addReader(s),r.onInitialized(()=>gje(t,{writerKind:"plaintext",diagnostics:o})),jLo(t),{diagnostics:o}}a(H8t,"initializeSecretStorage");function jLo(t){let e=t.get(pf);setImmediate(()=>{t.get(ox).decryptOauthTokensFromV1ToV0().then(r=>{r.attempted!==0&&e.onInitialized(()=>w5t(t,{result:r}))}).catch(r=>{_Q.error(t,"secret-store: v1->v0 decrypt pass failed",r),e.onInitialized(()=>w5t(t,{error:r}))})})}a(jLo,"scheduleDecryptOauthTokensFromV1ToV0");function HLo(t,e){_Q.info(t,`secret-store fallback: tokens stored in plaintext on disk (no OS keychain available; phase=${e.errorPhase??"n/a"})`);try{t.get(ts).showWarningMessageOnlyOnce("auth.secretStorage.plaintextFallback","GitHub Copilot could not access the OS keychain. OAuth tokens are stored in plaintext on disk.").catch(r=>{_Q.info(t,"reportSecretStorageFallbackNotice: notification failed",r)})}catch(r){_Q.info(t,"reportSecretStorageFallbackNotice: notification skipped",r)}}a(HLo,"reportSecretStorageFallbackNotice");p();p();var GLo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function $Lo(t){return GLo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a($Lo,"isOomError");function BY(t,e,r,n=Nr){if(!Gm(e)){if(e instanceof Error){let o=e;$Lo(o)?t.get(ps).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(ps).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(ps).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(ps).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(ps).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(BY,"handleException");function nfn(t){process.addListener("uncaughtException",r=>{BY(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,BY(t,r,"unhandledRejection")}finally{e=!1}})}a(nfn,"registerDefaultHandlers");function ifn(){mQ("o200k_base").catch(()=>{})}a(ifn,"prewarmTokenizers");p();p();p();var C3={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 ofn=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],sfn={".php":[".blade"]},vQ=Object.keys(C3).flatMap(t=>C3[t].extensions);var G8t=de(require("node:path"));var Ale=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},cIe=class{static{a(this,"LanguageDetection")}},$8t=new Map,gle=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(C3)){for(let n of e)$8t.set(n,[...$8t.get(n)??[],t]);for(let n of r??[])gle.set(n,[...gle.get(n)??[],t])}var V8t=class extends cIe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=Ji(e.uri),n=G8t.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new Ale(s.languageId,s.isGuess,c):new Ale(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(ofn.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=G8t.extname(n).toLowerCase();if(o.length>0&&vQ.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=sfn[e];return!n||n.includes(r)}detectLanguageId(e,r){if(gle.has(e))return{languageId:gle.get(e)[0],isGuess:!1};let n=$8t.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),gle.has(e))return{languageId:gle.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},W8t=class extends cIe{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 Ale("cpp",n.isGuess,n.fileExtension):n}},z8t=class extends cIe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new Ale(r.languageId,!0,""):this.delegate.detectLanguage(r)}},VLo=new W8t(new z8t(new V8t));function iO({uri:t,languageId:e}){let r=VLo.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(iO,"detectLanguage");p();p();p();p();function Hh(t){if(t.isCancellationRequested)throw new lVe}a(Hh,"throwIfCancellationRequested");function wP(t){return t instanceof lVe?!0:t instanceof Error&&t.name===Y8t&&t.message===Y8t}a(wP,"isCancellationError");var lVe=class extends Error{static{a(this,"CancellationError")}constructor(){super(Y8t),this.name=this.message}},Y8t="Canceled",uVe=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 FY(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(FY,"isTypeDefinition");var hu=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=cfn(e,e.length,o),afn(n,r);o0||u>0||d>0||f>0?new Bx(r,"","",hu.fromBounds(s,c),hu.fromBounds(d,f),hu.fromBounds(h,m),y,t.kindFromString(g),0):null;if(E){t.updateScopesForSymbol(e,E);let _=E.nameRange.getText(n),v=this.createNameFromScopes(n,e.toArray());return v=A?`${A}.${v}`:v,new Bx(r,v,_.substring(_.lastIndexOf(".")+1),E.commentRange,E.nameRange,E.bodyRange,E.extentRange,E.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 lVe=class extends Gh{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,HLo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},uVe=class extends Gh{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,$Lo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,VLo),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}},dVe=class extends Gh{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,GLo),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 hu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new hu(f,h-f),g=new hu(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=hu.empty,y=hu.empty,E=d.substring(d.lastIndexOf("/")+1);o.add(new Bx(e,d,E,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},HLo=` +`),o=cfn(e,e.length,++o),afn(n,r)):o++;return n.join("")}};function afn(t,e){for(let r=0;r0||u>0||d>0||f>0?new Fx(r,"","",hu.fromBounds(s,c),hu.fromBounds(d,f),hu.fromBounds(h,m),y,t.kindFromString(g),0):null;if(E){t.updateScopesForSymbol(e,E);let _=E.nameRange.getText(n),v=this.createNameFromScopes(n,e.toArray());return v=A?`${A}.${v}`:v,new Fx(r,v,_.substring(_.lastIndexOf(".")+1),E.commentRange,E.nameRange,E.bodyRange,E.extentRange,E.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 dVe=class extends Gh{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,WLo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},fVe=class extends Gh{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,YLo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,KLo),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}},pVe=class extends Gh{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,zLo),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 hu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new hu(f,h-f),g=new hu(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=hu.empty,y=hu.empty,E=d.substring(d.lastIndexOf("/")+1);o.add(new Fx(e,d,E,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},WLo=` ( ((comment)* @comment) . @@ -2013,7 +2013,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la . (field_declaration name: (_) @name) @definition.field ) -`,GLo=` +`,zLo=` (import_declaration (import_spec name: (package_identifier)? @alias @@ -2024,15 +2024,15 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (import_spec name: (package_identifier)? @alias path: (interpreted_string_literal) @import.name))+) @import -`,$Lo=` +`,YLo=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`,VLo=` +`,KLo=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`;p();var pVe=class extends Gh{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,WLo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},hVe=class extends Gh{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,YLo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,KLo),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}},mVe=class extends Gh{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,zLo)).filter(o=>o.kind===0)}},WLo=` +`;p();var mVe=class extends Gh{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,JLo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},gVe=class extends Gh{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,XLo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,eBo),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}},AVe=class extends Gh{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,ZLo)).filter(o=>o.kind===0)}},JLo=` ( [ (block_comment) @comment @@ -2095,7 +2095,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la . (enum_constant name: (identifier) @name) @definition.enum_variant ) -`,zLo=` +`,ZLo=` ( [ ((line_comment)* @comment) @@ -2107,19 +2107,19 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (asterisk)? @wildcard ) @definition.class ) -`,YLo=` +`,XLo=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`,KLo=` +`,eBo=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`;p();var JLo=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),gVe=class extends Gh{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,ZLo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},AVe=class extends Gh{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,XLo)).filter(o=>!JLo.has(o.unqualifiedName))}};var ZLo=` +`;p();var tBo=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),yVe=class extends Gh{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,rBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},EVe=class extends Gh{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,nBo)).filter(o=>!tBo.has(o.unqualifiedName))}};var rBo=` ( ((comment)* @comment) . @@ -2129,9 +2129,9 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (export_statement declaration: (lexical_declaration (variable_declarator name: (identifier) @name value: (_) @body))) @definition.function ] ) -`,XLo=` +`,nBo=` (call_expression function: (_) @name) @reference -`;p();var eBo=new Set(["int","str","float","bool","list","dict","tuple","set"]),yVe=class extends Gh{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,tBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},EVe=class extends Gh{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,rBo)).filter(o=>!eBo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,iBo),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}},_Ve=class extends Gh{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,nBo),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 hu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new hu(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new hu(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=hu.empty,A=hu.empty,y=f.node.text,E=y.split(".").pop()||y,_;c?_=`${u.node.text}.${c.node.text}`:_=u.node.text,o.add(new Bx(e,_,E,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},tBo=` +`;p();var iBo=new Set(["int","str","float","bool","list","dict","tuple","set"]),_Ve=class extends Gh{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,oBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},vVe=class extends Gh{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,sBo)).filter(o=>!iBo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,cBo),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}},CVe=class extends Gh{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,aBo),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 hu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new hu(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new hu(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=hu.empty,A=hu.empty,y=f.node.text,E=y.split(".").pop()||y,_;c?_=`${u.node.text}.${c.node.text}`:_=u.node.text,o.add(new Fx(e,_,E,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},oBo=` ( ((comment)* @comment) . @@ -2143,7 +2143,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la . (function_definition name: (_) @name body: (_) @body) @definition.method ) -`,rBo=` +`,sBo=` (call function: (_) @name) @reference (type [ @@ -2152,7 +2152,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`,nBo=` +`,aBo=` (import_statement name: (dotted_name) @import.module) @import (import_from_statement @@ -2167,7 +2167,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (aliased_import name: ((dotted_name) @import.name) alias: (identifier) @alias)) @import -`,iBo=` +`,cBo=` (call function: (_) @name) @reference (type [ @@ -2176,7 +2176,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`;p();var oBo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),yle=class extends Gh{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,sBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},Ele=class extends Gh{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,aBo)).filter(o=>!oBo.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var sBo=` +`;p();var lBo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),yle=class extends Gh{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,uBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},Ele=class extends Gh{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,dBo)).filter(o=>!lBo.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var uBo=` ( ((comment)* @comment) . @@ -2201,13 +2201,13 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (variable_declarator name: (identifier) @name type: (type_annotation (type_identifier))) ] ) -`,aBo=` +`,dBo=` (call_expression function: (_) @name) @reference (type_identifier) @name @reference (new_expression constructor: (identifier) @name) @reference -`;p();var cBo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),vVe=class extends yle{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,lBo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},CVe=class extends Ele{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,uBo),super.extractReferences(e,r)]);return[...n.filter(s=>!cBo.has(s.unqualifiedName)),...o]}},lBo=` +`;p();var fBo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),bVe=class extends yle{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,pBo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},SVe=class extends Ele{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,hBo),super.extractReferences(e,r)]);return[...n.filter(s=>!fBo.has(s.unqualifiedName)),...o]}},pBo=` ( ((comment)* @comment) . @@ -2220,30 +2220,30 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la body: (_) @body))) @definition.function ] ) -`,uBo=` +`,hBo=` (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 cIe=[{symbolExtractor:new pVe,referenceExtractor:new hVe,importExtractor:new mVe,languageId:"java"},{symbolExtractor:new lVe,referenceExtractor:new uVe,importExtractor:new dVe,languageId:"go"},{symbolExtractor:new yVe,referenceExtractor:new EVe,importExtractor:new _Ve,languageId:"python"},{symbolExtractor:new yle,referenceExtractor:new Ele,languageId:"typescript"},{symbolExtractor:new vVe,referenceExtractor:new CVe,languageId:"typescriptreact"},{symbolExtractor:new gVe,referenceExtractor:new AVe,languageId:"javascript"}];function cfn(t){let e=nO({uri:t});if(e&&cIe.some(r=>e===r.languageId))return e}a(cfn,"getSupportedLanguageIdForMultiLanguageProvider");var lfn=new Map(cIe.map(t=>[t.languageId,t.referenceExtractor])),ufn=new Map(cIe.map(t=>[t.languageId,t.symbolExtractor])),dfn=new Map(cIe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),Y8t=cIe.map(t=>C3[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function K8t(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(K8t,"virtualNode");function ffn(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(ffn,"lineNode");function J8t(t){return{type:"blank",lineNumber:t,subs:[]}}a(J8t,"blankNode");function bVe(t){return{type:"top",indentation:-1,subs:t??[]}}a(bVe,"topNode");function xA(t){return t.type==="blank"}a(xA,"isBlank");function FY(t){return t.type==="line"}a(FY,"isLine");function UY(t){return t.type==="virtual"}a(UY,"isVirtual");p();function pfn(t,e){return rE(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(pfn,"clearLabelsIf");function QY(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>QY(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=>QY(r,e)),label:t.label?e(t.label):void 0}}}a(QY,"mapLabels");function rE(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(rE,"visitTree");function Z8t(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),rE(t,s,n),o}a(Z8t,"foldTree");function SVe(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:bVe()}a(SVe,"rebuildTree");p();function fBo(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[ffn(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"),rE(t,r,"bottomUp")}a(lIe,"labelLines");function TVe(t){function e(r){if(UY(r)&&r.label===void 0){let n=r.subs.filter(o=>!xA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),rE(t,e,"bottomUp")}a(TVe,"labelVirtualInherited");function uIe(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(uIe,"buildLabelRules");function X8t(t){let r=SVe(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&&(FY(l)||UY(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&xA(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?[K8t(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),xA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return pfn(t,n=>n==="newVirtual"),r}a(X8t,"combineClosersAndOpeners");function hfn(t,e=xA,r){return SVe(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=K8t(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)!xA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(gfn,"processJava");p();var ABo={heading:/^# /,subheading:/^## /,subsubheading:/### /},yBo=uIe(ABo);function Afn(t){let e=t;if(lIe(e,yBo),xA(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||xA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=hfn(e),e=qY(e),TVe(e),e}a(Afn,"processMarkdown");p();function yfn(t){return" ".repeat(t.indentation)+t.sourceLine+` -`}a(yfn,"deparseLine");e6t("markdown",Afn);e6t("java",gfn);var EBo={worthUp:.9,worthSibling:.88,worthDown:.8};function t6t(t,e,r=ws(),n=EBo){let o=QY(t,s=>s?1:void 0);return rE(o,s=>{if(xA(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"),rE(o,s=>{if(xA(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"),_Bo(o,e,r)}a(t6t,"fromTreeWithFocussedLines");function _Bo(t,e,r=ws()){let n=Z8t(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[yfn(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new Ar(n,e,r)}a(_Bo,"fromTreeWithValuedLines");function PS(t,e=!0,r=!0,n,o=ws()){let s=typeof t=="string"?jY(t):jY(t.source,t.languageId);qY(s);let c=QY(s,l=>e&&l!=="closer");return rE(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&rE(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&&rE(c,l=>{l.label||=(FY(l)||xA(l))&&l.lineNumber==0},"topDown"),t6t(c,n,o)}a(PS,"elidableTextForSourceCode");p();var dIe=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 lIe=[{symbolExtractor:new mVe,referenceExtractor:new gVe,importExtractor:new AVe,languageId:"java"},{symbolExtractor:new dVe,referenceExtractor:new fVe,importExtractor:new pVe,languageId:"go"},{symbolExtractor:new _Ve,referenceExtractor:new vVe,importExtractor:new CVe,languageId:"python"},{symbolExtractor:new yle,referenceExtractor:new Ele,languageId:"typescript"},{symbolExtractor:new bVe,referenceExtractor:new SVe,languageId:"typescriptreact"},{symbolExtractor:new yVe,referenceExtractor:new EVe,languageId:"javascript"}];function lfn(t){let e=iO({uri:t});if(e&&lIe.some(r=>e===r.languageId))return e}a(lfn,"getSupportedLanguageIdForMultiLanguageProvider");var ufn=new Map(lIe.map(t=>[t.languageId,t.referenceExtractor])),dfn=new Map(lIe.map(t=>[t.languageId,t.symbolExtractor])),ffn=new Map(lIe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),K8t=lIe.map(t=>C3[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function J8t(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(J8t,"virtualNode");function pfn(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(pfn,"lineNode");function Z8t(t){return{type:"blank",lineNumber:t,subs:[]}}a(Z8t,"blankNode");function TVe(t){return{type:"top",indentation:-1,subs:t??[]}}a(TVe,"topNode");function xA(t){return t.type==="blank"}a(xA,"isBlank");function UY(t){return t.type==="line"}a(UY,"isLine");function QY(t){return t.type==="virtual"}a(QY,"isVirtual");p();function hfn(t,e){return rE(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(hfn,"clearLabelsIf");function qY(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>qY(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=>qY(r,e)),label:t.label?e(t.label):void 0}}}a(qY,"mapLabels");function rE(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(rE,"visitTree");function X8t(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),rE(t,s,n),o}a(X8t,"foldTree");function IVe(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:TVe()}a(IVe,"rebuildTree");p();function gBo(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[pfn(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"),rE(t,r,"bottomUp")}a(uIe,"labelLines");function xVe(t){function e(r){if(QY(r)&&r.label===void 0){let n=r.subs.filter(o=>!xA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),rE(t,e,"bottomUp")}a(xVe,"labelVirtualInherited");function dIe(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(dIe,"buildLabelRules");function e6t(t){let r=IVe(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&&(UY(l)||QY(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&xA(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?[J8t(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),xA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return hfn(t,n=>n==="newVirtual"),r}a(e6t,"combineClosersAndOpeners");function mfn(t,e=xA,r){return IVe(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=J8t(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)!xA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(Afn,"processJava");p();var vBo={heading:/^# /,subheading:/^## /,subsubheading:/### /},CBo=dIe(vBo);function yfn(t){let e=t;if(uIe(e,CBo),xA(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||xA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=mfn(e),e=jY(e),xVe(e),e}a(yfn,"processMarkdown");p();function Efn(t){return" ".repeat(t.indentation)+t.sourceLine+` +`}a(Efn,"deparseLine");t6t("markdown",yfn);t6t("java",Afn);var bBo={worthUp:.9,worthSibling:.88,worthDown:.8};function r6t(t,e,r=ws(),n=bBo){let o=qY(t,s=>s?1:void 0);return rE(o,s=>{if(xA(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"),rE(o,s=>{if(xA(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"),SBo(o,e,r)}a(r6t,"fromTreeWithFocussedLines");function SBo(t,e,r=ws()){let n=X8t(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[Efn(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new Ar(n,e,r)}a(SBo,"fromTreeWithValuedLines");function DS(t,e=!0,r=!0,n,o=ws()){let s=typeof t=="string"?HY(t):HY(t.source,t.languageId);jY(s);let c=qY(s,l=>e&&l!=="closer");return rE(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&rE(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&&rE(c,l=>{l.label||=(UY(l)||xA(l))&&l.lineNumber==0},"topDown"),r6t(c,n,o)}a(DS,"elidableTextForSourceCode");p();var fIe=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=>ws().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 Ar=class t{constructor(e,r,n=ws()){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 dIe(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&&PS(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=>ws().tokenLength(r+` +`).forEach(u=>o.push(new fIe(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&&DS(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=>ws().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}=CBo(this.lines,o);if(u<=e)return r6t(l);bBo(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?SBo(l,m):"",y=Efn(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let E=m+1;if(E=0){let v=l[_];IVe(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return r6t([Efn("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)IVe(h[m],r)&&IVe(h[m-1],r)&&h.splice(m,1);return r6t(h)}};function vBo(t){return t?.text.match(/^\s*/)?.[0]??""}a(vBo,"getIndentation");function IVe(t,e){return t?.text.trim()===e.trim()}a(IVe,"isEllipsis");function r6t(t){return{getText:a(()=>t.map(e=>e.text).join(` -`),"getText"),getLines:a(()=>t,"getLines")}}a(r6t,"produceElidedText");function CBo(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(CBo,"initializeElisionContext");function bBo(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(bBo,"sortPriorityQueue");function SBo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=vBo(o);break}}return r}a(SBo,"getClosestIndentation");function Efn(t,e,r,n){let o=t+e;return new dIe(o,1/0,r.tokenLength(o+` -`),"loose",n?.metadata)}a(Efn,"getNewEllipsis");p();var _fn=require("fs");async function vfn(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,E)=>y+E.node.extentRange.length,0);for(let y of m){if(l<=5)return d;Hh(o);let E=y.node.extentRange.length/A,_=Math.min(l,E*u),v=(await TBo([y])).elide(_).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(vfn,"symbolRangesToCodeSnippets");async function TBo(t){if(t.length===0)return new Ar([]);let e=t[0].node.fileName,r=[],n="";try{let o=rs(e);o&&(n=(await _fn.promises.readFile(o)).toString())}catch{}for(let o of t)Cfn(o,n).forEach(s=>r.push(s));return new Ar(r)}a(TBo,"sameFileSymbolRangeToElidableText");function Cfn(t,e){let n=[],o=t.node,s=e.substring(n6t(e,o.commentRange.start),o.commentRange.end);n.push([i6t(s),1-3e-4]);let c=n6t(e,o.bodyRange.start),l=n6t(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(BY(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([i6t(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...Cfn(d,e));else{let d=1-(BY(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([i6t(f),d])}return BY(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(Cfn,"prepareForElidableText");function n6t(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(n6t,"shiftLeftToNearestLineEndingOrAlphanumeric");function i6t(t){let e=0;for(;ee)throw new Error("maxTokens must be larger than the ellipsis length");let{lines:l,totalCost:u,priorityQueue:d}=IBo(this.lines,o);if(u<=e)return n6t(l);xBo(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?wBo(l,m):"",y=_fn(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let E=m+1;if(E=0){let v=l[_];wVe(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return n6t([_fn("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)wVe(h[m],r)&&wVe(h[m-1],r)&&h.splice(m,1);return n6t(h)}};function TBo(t){return t?.text.match(/^\s*/)?.[0]??""}a(TBo,"getIndentation");function wVe(t,e){return t?.text.trim()===e.trim()}a(wVe,"isEllipsis");function n6t(t){return{getText:a(()=>t.map(e=>e.text).join(` +`),"getText"),getLines:a(()=>t,"getLines")}}a(n6t,"produceElidedText");function IBo(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(IBo,"initializeElisionContext");function xBo(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(xBo,"sortPriorityQueue");function wBo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=TBo(o);break}}return r}a(wBo,"getClosestIndentation");function _fn(t,e,r,n){let o=t+e;return new fIe(o,1/0,r.tokenLength(o+` +`),"loose",n?.metadata)}a(_fn,"getNewEllipsis");p();var vfn=require("fs");async function Cfn(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,E)=>y+E.node.extentRange.length,0);for(let y of m){if(l<=5)return d;Hh(o);let E=y.node.extentRange.length/A,_=Math.min(l,E*u),v=(await RBo([y])).elide(_).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(Cfn,"symbolRangesToCodeSnippets");async function RBo(t){if(t.length===0)return new Ar([]);let e=t[0].node.fileName,r=[],n="";try{let o=rs(e);o&&(n=(await vfn.promises.readFile(o)).toString())}catch{}for(let o of t)bfn(o,n).forEach(s=>r.push(s));return new Ar(r)}a(RBo,"sameFileSymbolRangeToElidableText");function bfn(t,e){let n=[],o=t.node,s=e.substring(i6t(e,o.commentRange.start),o.commentRange.end);n.push([o6t(s),1-3e-4]);let c=i6t(e,o.bodyRange.start),l=i6t(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(FY(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([o6t(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...bfn(d,e));else{let d=1-(FY(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([o6t(f),d])}return FY(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(bfn,"prepareForElidableText");function i6t(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(i6t,"shiftLeftToNearestLineEndingOrAlphanumeric");function o6t(t){let e=0;for(;e=0&&(t[r]==="\r"||t[r]===` -`||t[r]===" "||t[r]===" ");)r--;return t.substring(e,r+1)}a(i6t,"trimLineEndingsAndTrailingWhitespace");var o6t=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},vQ=class extends o6t{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[];Hh(c);let u=await l.extractReferences(e,r);Hh(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=>BY(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(Hh(r),BY(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}},xVe=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new vQ(e,r,!0,!0)),this.strategies.set("java",new vQ(e,r,!0,!0)),this.strategies.set("python",new vQ(e,r,!0,!1)),this.strategies.set("typescript",new vQ(e,r,!0,!0)),this.strategies.set("typescriptreact",new vQ(e,r,!0,!0)),this.strategies.set("javascript",new vQ(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);Hh(l);let d=ws();return vfn(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 HY={Id:"id"},DS={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},ua={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 wVe=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new s6t(HY.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(o6t,"trimLineEndingsAndTrailingWhitespace");var s6t=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},CQ=class extends s6t{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[];Hh(c);let u=await l.extractReferences(e,r);Hh(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=>FY(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(Hh(r),FY(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}},RVe=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new CQ(e,r,!0,!0)),this.strategies.set("java",new CQ(e,r,!0,!0)),this.strategies.set("python",new CQ(e,r,!0,!1)),this.strategies.set("typescript",new CQ(e,r,!0,!0)),this.strategies.set("typescriptreact",new CQ(e,r,!0,!0)),this.strategies.set("javascript",new CQ(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);Hh(l);let d=ws();return Cfn(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 GY={Id:"id"},NS={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},ua={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 kVe=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new a6t(GY.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(", ")})`}}},fIe=class t extends wVe{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${DS.FilePath}');`]);this.fields=[new mIe(DS.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new kC(DS.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},pIe=class t extends wVe{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${ua.DocumentId}', '${ua.ExtentStart}', '${ua.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${ua.UnqualifiedName}');`],`FOREIGN KEY(${ua.DocumentId}) REFERENCES Document(${HY.Id}) ON DELETE CASCADE`);this.fields=[new kC(ua.DocumentId),new mIe(ua.FullyQualifiedName,{notNull:!0}),new mIe(ua.UnqualifiedName,{notNull:!0}),new kC(ua.CommentStart,{notNull:!0}),new kC(ua.CommentLength,{notNull:!0}),new kC(ua.NameStart,{notNull:!0}),new kC(ua.NameLength,{notNull:!0}),new kC(ua.BodyStart,{notNull:!0}),new kC(ua.BodyLength,{notNull:!0}),new kC(ua.ExtentStart,{notNull:!0}),new kC(ua.ExtentLength,{notNull:!0}),new kC(ua.SymbolKind,{notNull:!0}),new kC(ua.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},hIe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},mIe=class extends hIe{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 hIe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},s6t=class extends hIe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var RVe=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?PVe(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&kVe(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${HY.Id} = ?`,[e])}},b3=class t extends RVe{static{a(this,"DocumentTable")}static{this.tableName=fIe.tableName}createQueryGenerator(){return new fIe}async updateTimestamp(e,r){let n=await this.init;n&&kVe(n,`UPDATE ${t.tableName} SET ${DS.LastWriteTimeUtc} = ? WHERE ${DS.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&kVe(r,`DELETE FROM ${t.tableName} WHERE ${DS.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?PVe(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${DS.FilePath} = ?`,[e]):[]}},$h=class t extends RVe{static{a(this,"SymbolTable")}static{this.tableName=pIe.tableName}createQueryGenerator(){return new pIe}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&kVe(r,`DELETE FROM ${t.tableName} WHERE ${ua.DocumentId} = ?`,[e])}};function PVe(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(PVe,"runDBQuery");function kVe(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(kVe,"runDBCommand");var bfn=de(require("node:sqlite"));var DVe=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${b3.tableName} ON ${$h.tableName}.${ua.DocumentId} = ${b3.tableName}.${HY.Id}`;this.db=this.initDb(e),this.documentTable=new b3(this.db),this.symbolTable=new $h(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new bfn.default.DatabaseSync(e,{open:!0});return r.exec(` +VALUES`,valuesTemplate:`(${Array(this.fields.length).fill("?").join(", ")})`}}},pIe=class t extends kVe{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${NS.FilePath}');`]);this.fields=[new gIe(NS.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new PC(NS.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},hIe=class t extends kVe{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${ua.DocumentId}', '${ua.ExtentStart}', '${ua.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${ua.UnqualifiedName}');`],`FOREIGN KEY(${ua.DocumentId}) REFERENCES Document(${GY.Id}) ON DELETE CASCADE`);this.fields=[new PC(ua.DocumentId),new gIe(ua.FullyQualifiedName,{notNull:!0}),new gIe(ua.UnqualifiedName,{notNull:!0}),new PC(ua.CommentStart,{notNull:!0}),new PC(ua.CommentLength,{notNull:!0}),new PC(ua.NameStart,{notNull:!0}),new PC(ua.NameLength,{notNull:!0}),new PC(ua.BodyStart,{notNull:!0}),new PC(ua.BodyLength,{notNull:!0}),new PC(ua.ExtentStart,{notNull:!0}),new PC(ua.ExtentLength,{notNull:!0}),new PC(ua.SymbolKind,{notNull:!0}),new PC(ua.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},mIe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},gIe=class extends mIe{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}`}},PC=class extends mIe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},a6t=class extends mIe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var PVe=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?NVe(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&DVe(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${GY.Id} = ?`,[e])}},b3=class t extends PVe{static{a(this,"DocumentTable")}static{this.tableName=pIe.tableName}createQueryGenerator(){return new pIe}async updateTimestamp(e,r){let n=await this.init;n&&DVe(n,`UPDATE ${t.tableName} SET ${NS.LastWriteTimeUtc} = ? WHERE ${NS.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&DVe(r,`DELETE FROM ${t.tableName} WHERE ${NS.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?NVe(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${NS.FilePath} = ?`,[e]):[]}},$h=class t extends PVe{static{a(this,"SymbolTable")}static{this.tableName=hIe.tableName}createQueryGenerator(){return new hIe}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&DVe(r,`DELETE FROM ${t.tableName} WHERE ${ua.DocumentId} = ?`,[e])}};function NVe(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(NVe,"runDBQuery");function DVe(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(DVe,"runDBCommand");var Sfn=de(require("node:sqlite"));var MVe=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${b3.tableName} ON ${$h.tableName}.${ua.DocumentId} = ${b3.tableName}.${GY.Id}`;this.db=this.initDb(e),this.documentTable=new b3(this.db),this.symbolTable=new $h(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new Sfn.default.DatabaseSync(e,{open:!0});return r.exec(` PRAGMA journal_mode = wal; PRAGMA synchronous = normal; PRAGMA optimize = 0x10002; @@ -2251,27 +2251,27 @@ VALUES`,valuesTemplate:`(${Array(this.fields.length).fill("?").join(", ")})`}}}, `),Promise.resolve(r)}catch(r){return console.error("Error initializing database:",r),Promise.resolve(void 0)}}async close(){let e=await this.db;e&&(await this.documentTable.init,await this.symbolTable.init,e.close())}async querySymbolsFuzzilyUsingUnqualifiedName(e,r){return await this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${ua.UnqualifiedName} BETWEEN ? AND (? || '~')`,`ORDER BY ${ua.UnqualifiedName}`,"LIMIT ?"].join(` `),[e,e,r])}async querySymbolsUsingUnqualifiedNames(e,r){let n=e.map(()=>"?").join(", "),o=r?"COLLATE NOCASE ":"";return await this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${ua.UnqualifiedName} ${o}IN (${n})`].join(` `),e)}async querySymbolsUsingFullyQualifiedName(e){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${ua.FullyQualifiedName} = ?`].join(` -`),[e])}async querySymbolsContainingPosition(e,r){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${b3.tableName}.${DS.FilePath} = ? AND ${$h.tableName}.${ua.ExtentStart} <= ? AND (${$h.tableName}.${ua.ExtentStart} + ${$h.tableName}.${ua.ExtentLength}) >= ?`].join(` -`),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${b3.tableName}.${DS.FilePath} = ? AND ${$h.tableName}.${ua.ExtentStart} >= ? AND (${$h.tableName}.${ua.ExtentStart} + ${$h.tableName}.${ua.ExtentLength}) <= ?`,`ORDER BY ${$h.tableName}.${ua.ExtentStart}`].join(` -`),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${b3.tableName}.${DS.FilePath} = ? AND ${$h.tableName}.${ua.FullyQualifiedName} LIKE ?`,`ORDER BY ${$h.tableName}.${ua.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,PVe(n,e,r)):[]}};var NVe=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new DVe(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 _le(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew Bx(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new hu(e.commentStart,e.commentLength),new hu(e.nameStart,e.nameLength),new hu(e.bodyStart,e.bodyLength),new hu(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(_le,"symbolsToSymbolRanges");var OVe=de(require("fs/promises"));var MVe=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new NVe(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=rs(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await OVe.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 OVe.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 a6t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>IBo(r))}a(a6t,"isIndexWorkerData");var gIe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},CQ=class extends gIe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},LVe=class extends gIe{constructor(r){super(nE.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},nE={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},BVe=class extends CQ{constructor(r,n,o){super(r,nE.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},FVe=class extends CQ{constructor(r,n){super(r,nE.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},UVe=class extends CQ{constructor(r,n,o){super(r,nE.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},QVe=class extends CQ{constructor(r,n){super(r,nE.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},qVe=class extends CQ{constructor(r,n,o,s,c,l){super(r,nE.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},jVe=class extends CQ{static{a(this,"ExitRequest")}constructor(e){super(e,nE.Exit)}},wP=class extends gIe{constructor(r,n,o){super(nE.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 IBo(t){return"databaseFilePath"in t&&"rootPath"in t}a(IBo,"isIndexableWorkspaceFolder");var Sfn=de(ri()),bQ=require("worker_threads");var HVe=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new MVe(e,ufn,dfn,r),this.contextRetreival=new xVe(this.index.reader,lfn)}},c6t=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 HVe(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 Sfn.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case nE.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case nE.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case nE.Cancel:n.get(e.id)?.cancel(),s=new wP(e.id,void 0,void 0);break;case nE.Exit:s=await this.dispatchExit(e,r,o.token);break;case nE.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case nE.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case nE.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 wP(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 wP(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 wP(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 wP(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 wP(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 HVe(e.databaseFilePath)),new wP(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 wP(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function Tfn(){return a6t(bQ.workerData)}a(Tfn,"isIndexWorker");function Ifn(){let t=bQ.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!a6t(bQ.workerData))throw new Error("Worker data must provide a valid database path.");let e=bQ.workerData.cwd;process.cwd=()=>e,new c6t(t,bQ.workerData.indexWorkspaceRoots,bQ.workerData.params)}a(Ifn,"runIndexWorker");p();p();var AIe=require("fs"),xfn=require("path");var SQ=class extends Qo{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await AIe.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 AIe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,xfn.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await AIe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await AIe.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();async function xBo(t){if(t.isCancellationRequested)return;let e=new vA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(xBo,"cancellationTokenToPromise");async function wfn(t,e){if(e){let r=xBo(e);await Promise.race([t,r])}else await t}a(wfn,"raceCancellation");function l6t(t){return Array.isArray(t)}a(l6t,"isArrayOfT");async function Rfn(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await u6t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(Rfn,"resolveAll");async function u6t(t,e){let r;return t instanceof Promise?r=await wBo(t,e):r=await RBo(t,e),r}a(u6t,"resolve");async function wBo(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:l6t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await wfn(o,e),n.resolutionTime=performance.now()-r,n}a(wBo,"resolvePromise");async function RBo(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 wfn(o,e),n.resolutionTime=performance.now()-r,n}a(RBo,"resolveIterable");p();p();var GVe="[...]",kBo=0,PC=-1;function Ef(){return kBo++}a(Ef,"getAvailableNodeId");function PBo(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(PBo,"elideChildren");function kfn(t,e=GVe){return r=>t.tokenLength(PBo(r,e))}a(kfn,"getTokenizerCostFunction");p();var IQ=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 DBo(t){let e={id:t.id??Ef(),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??GVe,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(DBo,"createRenderNode");function NBo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(NBo,"isRenderedChildRequired");function Pfn(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(Pfn,"rectifiedValue");function yIe(t,e){let r=Dfn(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(yIe,"rectifyWeights");function Dfn(t,e){let r=t.children.map(s=>Dfn(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 IQ([]);let n=new IQ(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(Dfn,"recursivelyRectifyWeights");function Nfn(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(E.id),"elider"),m=[],g=new Map;if(f6t(t,m,h,g),m.length===0)return d6t(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 IQ([{item:t,priority:Pfn(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,Pfn(m))}}for(;l.size>0;){let h=[],m=a(E=>!l.has(E.id),"elider"),g=new Map;if(f6t(t,h,m,g),h.length===0)return d6t(t,o);let A=h.join("");if(o===void 0){let E=[...g.values()].reduce((_,v)=>_+v.cost,0);return{text:A,cost:E,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 E=u.pop();l.has(E.id)&&(y-=E.cost,l.delete(E.id))}if(u.length===0)break}return d6t(t,o)}a(Nfn,"render");function d6t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(d6t,"renderEmpty");function f6t(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=NBo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=f6t(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(f6t,"recursivelyRender");function EIe(t,e,r=GVe){let n=t.children.map(c=>EIe(c,e,r));r=t.elisionMarker??r;let o=e(t);return DBo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(EIe,"snapshot");var xQ={id:Ef(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var RP=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var VVe={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function MBo(t,e,r=VVe,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=wa(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(MBo,"getDirectoryChildren");function OBo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=uf(e);for(;o.startsWith(r);){n.push(o);let s=uf(o);if(s.length>=o.length)break;o=s}return n}a(OBo,"getAncestors");function LBo(t,e,r=VVe.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=OBo(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(LBo,"getAncestorWeights");async function*p6t(t,e,r,n,o,s){let c={...VVe,...r},l=c.MaxResults,u=c.Decay,d=LBo(t,e,u),f=new IQ([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await MBo(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(p6t,"getNearbyDocuments");var $Ve=class extends RP{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=VVe;this.cache=new Pk(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of p6t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function o0(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(o0,"setDefault");var BBo={MaxActiveSymbols:500,SymbolCacheSize:1e6},WVe=class extends RP{constructor(){super(...arguments);this.config=BBo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new Cn(this.config.SymbolCacheSize);this.textSymbols=new Cn(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=o0(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 h6t(l)){let d=o0(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())o0(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&&Mfn(o))}},FBo=/^[a-zA-Z_]{2,}\w+$/;function Mfn(t){return FBo.test(t)}a(Mfn,"isSymbol");function UBo(t){return t.toLowerCase()}a(UBo,"normalizeWord");function*h6t(t){for(let e of t.split(/\W/))Mfn(e)&&(yield UBo(e))}a(h6t,"getTextSymbols");var QBo={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},zVe=class extends WVe{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=QBo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new Pk(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 h6t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=o0(this.textSymbols,l,()=>this.createSymbol(!1));o0(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 p6t(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 Ofn(t){return t.nodeId!==void 0}a(Ofn,"isNodeLocation");var Lfn={"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}},YVe=class extends RP{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=Lfn[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 E of g.locations)Ofn(E)?l.push({weight:y,uri:E.uri,id:E.nodeId,source:u}):l.push({weight:y,uri:E.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(Ofn(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:PC});r.locations=s,r.isFullyResolved=o}recordEvent(r,n,o){let s=Lfn[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};o0(this.eventsByType,r,()=>new Cn(s.maxEventCount)).set(++this.nextId,c)}};p();var KVe=class extends RP{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)??PC,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 E of A)l.set(E,(l.get(E)??0)+h/A.size);let y=this.nodeChildren.get(m);if(y&&y.size>1)for(let E of y)E!==f&&u.set(E,(u.get(E)??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 qBo(t){return t.id!==void 0}a(qBo,"isNodeItem");function jBo(t){return!("uri"in t)&&!("id"in t)}a(jBo,"isNullItem");var Bfn={"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 Ffn(t){return t in Bfn}a(Ffn,"isSourceId");var wQ="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",vle=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!==PC),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}},JVe=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=Bfn;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new vle([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new vle(r.items):new vle([])}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(PC);if(l!==void 0&&l>0){s.delete(PC);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 vle(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(jBo(r))return{weight:r.weight,uri:wQ,id:PC};let n=qBo(r)?r.id:PC,o=r.uri??this.activeContext.getUri(n)??wQ;return o===wQ&&(n=PC),{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=o0(r,s,()=>new Map),d=PC;(!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!==wQ?this.activeContext.normalizeUri(u)??wQ:wQ;for(let[h,m]of d.entries())u===wQ||h===PC?n.set(f,(n.get(f)??0)+m):r.push({uri:f,id:h,weight:m}),o+=m}if(o<=0)return[];n.delete(wQ),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:PC,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 m6t=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*Ufn(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=GBo(e,this.document),o=new m6t(Ef(),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;mHBo}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function GBo(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(GBo,"buildText");function*Ufn(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*Ufn(r,e))}a(Ufn,"walk");p();p();p();var XVe=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 g6t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:g6t(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=g6t(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 XVe(Ef(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(g6t,"recursivelyBuildNode");function Qfn(t){let e=jY(t.getText(),t.detectedLanguageId);return g6t(e,t.lineCount,t)??new XVe(Ef(),e,[],0,t.lineCount-1,t)}a(Qfn,"parse");var eWe={source:"indentation",parse:Qfn,update(t,e){return{root:Qfn(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var jfn=de(ale());function qfn(t){return{line:t.row,character:t.column}}a(qfn,"asPosition");var iO=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)}},RQ=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 jfn.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return eWe.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:qfn(e.startPosition),end:qfn(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var $Bo=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),VBo=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),WBo=new Set(["identifier"]),zBo=new Set(["string","comment"]),Hfn=new iO($Bo,VBo,WBo,zBo);p();var YBo=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),KBo=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),JBo=new Set(["identifier"]),ZBo=new Set(["string_literal","line_comment","block_comment"]),Gfn=new iO(YBo,KBo,JBo,ZBo);p();var XBo=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),e3o=new Set(["module","block","parameters","dictionary","list"]),t3o=new Set(["identifier"]),r3o=new Set(["string","comment"]),$fn=new iO(XBo,e3o,t3o,r3o);p();var n3o=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),i3o=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),o3o=new Set(["identifier"]),s3o=new Set(["string","comment"]),Vfn=new iO(n3o,i3o,o3o,s3o);var Wfn=de(ale());async function zfn(t){await Wfn.default.init();try{let e=await b8t(t);switch(t){case"python":return new RQ(e,"tree-sitter-python",$fn);case"typescript":return new RQ(e,"tree-sitter-typescript",Vfn);case"java":return new RQ(e,"tree-sitter-java",Gfn);case"cpp":return new RQ(e,"tree-sitter-cpp",Hfn);default:return new RQ(e,"tree-sitter-generic")}}catch{return eWe}}a(zfn,"getParser");var A6t=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}))}},tWe=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},Yfn=500,rWe=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 Cn(Yfn);this.allowedExtensions=new Set(_Q);this.invalidDocumentCache=new Pk(Yfn,this.config.InvalidCacheTime),this.cachedDocuments=new F9e(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=>C3[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(a7e(e),r=Fs(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(PKr(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 A6t(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 tWe(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new vA;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 tWe(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 ZVe(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=o0(this.createdNodes,e,()=>new Set),o=o0(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 zfn(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 a3o="WorkspaceContextWorker";function y6t(t){let e=t;return e?.workerId===a3o&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(y6t,"isContextWorkerData");var c3o=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function Kfn(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return c3o.includes(e)?e:void 0}a(Kfn,"getContextMessageType");var kQ=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();_6t();p();var tpn;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(tpn||(tpn={}));var v6t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(v6t||(v6t={}));var rpn;(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})(rpn||(rpn={}));var iWe;(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})(iWe||(iWe={}));var iE;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=iWe.MAX_VALUE),o===Number.MAX_VALUE&&(o=iWe.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})(iE||(iE={}));var mu;(function(t){function e(n,o,s,c){if(mt.uinteger(n)&&mt.uinteger(o)&&mt.uinteger(s)&&mt.uinteger(c))return{start:iE.create(n,o),end:iE.create(s,c)};if(iE.is(n)&&iE.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)&&iE.is(o.start)&&iE.is(o.end)}a(r,"is"),t.is=r})(mu||(mu={}));var oWe;(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)&&mu.is(o.range)&&(mt.string(o.uri)||mt.undefined(o.uri))}a(r,"is"),t.is=r})(oWe||(oWe={}));var npn;(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)&&mu.is(o.targetRange)&&mt.string(o.targetUri)&&mu.is(o.targetSelectionRange)&&(mu.is(o.originSelectionRange)||mt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(npn||(npn={}));var C6t;(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})(C6t||(C6t={}));var ipn;(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)&&mu.is(o.range)&&C6t.is(o.color)}a(r,"is"),t.is=r})(ipn||(ipn={}));var opn;(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)||ble.is(o))&&(mt.undefined(o.additionalTextEdits)||mt.typedArray(o.additionalTextEdits,ble.is))}a(r,"is"),t.is=r})(opn||(opn={}));var spn;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(spn||(spn={}));var apn;(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})(apn||(apn={}));var b6t;(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)&&oWe.is(o.location)&&mt.string(o.message)}a(r,"is"),t.is=r})(b6t||(b6t={}));var cpn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(cpn||(cpn={}));var lpn;(function(t){t.Unnecessary=1,t.Deprecated=2})(lpn||(lpn={}));var upn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&mt.string(n.href)}a(e,"is"),t.is=e})(upn||(upn={}));var sWe;(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)&&mu.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,b6t.is))}a(r,"is"),t.is=r})(sWe||(sWe={}));var Cle;(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})(Cle||(Cle={}));var ble;(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)&&mu.is(c.range)}a(o,"is"),t.is=o})(ble||(ble={}));var S6t;(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})(S6t||(S6t={}));var Sle;(function(t){function e(r){let n=r;return mt.string(n)}a(e,"is"),t.is=e})(Sle||(Sle={}));var dpn;(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 ble.is(c)&&(S6t.is(c.annotationId)||Sle.is(c.annotationId))}a(o,"is"),t.is=o})(dpn||(dpn={}));var T6t;(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)&&k6t.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(T6t||(T6t={}));var I6t;(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||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(I6t||(I6t={}));var x6t;(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||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(x6t||(x6t={}));var w6t;(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||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(w6t||(w6t={}));var R6t;(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)?I6t.is(o)||x6t.is(o)||w6t.is(o):T6t.is(o)))}a(e,"is"),t.is=e})(R6t||(R6t={}));var fpn;(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})(fpn||(fpn={}));var ppn;(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})(ppn||(ppn={}));var k6t;(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})(k6t||(k6t={}));var hpn;(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})(hpn||(hpn={}));var P6t;(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})(P6t||(P6t={}));var _Ie;(function(t){function e(r){let n=r;return mt.objectLiteral(r)&&P6t.is(n.kind)&&mt.string(n.value)}a(e,"is"),t.is=e})(_Ie||(_Ie={}));var mpn;(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})(mpn||(mpn={}));var gpn;(function(t){t.PlainText=1,t.Snippet=2})(gpn||(gpn={}));var Apn;(function(t){t.Deprecated=1})(Apn||(Apn={}));var ypn;(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)&&mu.is(o.insert)&&mu.is(o.replace)}a(r,"is"),t.is=r})(ypn||(ypn={}));var Epn;(function(t){t.asIs=1,t.adjustIndentation=2})(Epn||(Epn={}));var _pn;(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})(_pn||(_pn={}));var vpn;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(vpn||(vpn={}));var Cpn;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(Cpn||(Cpn={}));var aWe;(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})(aWe||(aWe={}));var bpn;(function(t){function e(r){let n=r;return!!n&&mt.objectLiteral(n)&&(_Ie.is(n.contents)||aWe.is(n.contents)||mt.typedArray(n.contents,aWe.is))&&(r.range===void 0||mu.is(r.range))}a(e,"is"),t.is=e})(bpn||(bpn={}));var Spn;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(Spn||(Spn={}));var Tpn;(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})(Tpn||(Tpn={}));var Ipn;(function(t){t.Text=1,t.Read=2,t.Write=3})(Ipn||(Ipn={}));var xpn;(function(t){function e(r,n){let o={range:r};return mt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(xpn||(xpn={}));var wpn;(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})(wpn||(wpn={}));var Rpn;(function(t){t.Deprecated=1})(Rpn||(Rpn={}));var kpn;(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})(kpn||(kpn={}));var Ppn;(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})(Ppn||(Ppn={}));var Dpn;(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)&&mu.is(o.range)&&mu.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})(Dpn||(Dpn={}));var Npn;(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"})(Npn||(Npn={}));var cWe;(function(t){t.Invoked=1,t.Automatic=2})(cWe||(cWe={}));var Mpn;(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,sWe.is)&&(o.only===void 0||mt.typedArray(o.only,mt.string))&&(o.triggerKind===void 0||o.triggerKind===cWe.Invoked||o.triggerKind===cWe.Automatic)}a(r,"is"),t.is=r})(Mpn||(Mpn={}));var Opn;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):Cle.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,sWe.is))&&(o.kind===void 0||mt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Cle.is(o.command))&&(o.isPreferred===void 0||mt.boolean(o.isPreferred))&&(o.edit===void 0||R6t.is(o.edit))}a(r,"is"),t.is=r})(Opn||(Opn={}));var Lpn;(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)&&mu.is(o.range)&&(mt.undefined(o.command)||Cle.is(o.command))}a(r,"is"),t.is=r})(Lpn||(Lpn={}));var Bpn;(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})(Bpn||(Bpn={}));var Fpn;(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)&&mu.is(o.range)&&(mt.undefined(o.target)||mt.string(o.target))}a(r,"is"),t.is=r})(Fpn||(Fpn={}));var Upn;(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)&&mu.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(Upn||(Upn={}));var Qpn;(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"})(Qpn||(Qpn={}));var qpn;(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"})(qpn||(qpn={}));var jpn;(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})(jpn||(jpn={}));var Hpn;(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&&mu.is(o.range)&&mt.string(o.text)}a(r,"is"),t.is=r})(Hpn||(Hpn={}));var Gpn;(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&&mu.is(o.range)&&mt.boolean(o.caseSensitiveLookup)&&(mt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(Gpn||(Gpn={}));var $pn;(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&&mu.is(o.range)&&(mt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})($pn||($pn={}));var Vpn;(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)&&mu.is(n.stoppedLocation)}a(r,"is"),t.is=r})(Vpn||(Vpn={}));var D6t;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(D6t||(D6t={}));var N6t;(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)||_Ie.is(o.tooltip))&&(o.location===void 0||oWe.is(o.location))&&(o.command===void 0||Cle.is(o.command))}a(r,"is"),t.is=r})(N6t||(N6t={}));var Wpn;(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)&&iE.is(o.position)&&(mt.string(o.label)||mt.typedArray(o.label,N6t.is))&&(o.kind===void 0||D6t.is(o.kind))&&o.textEdits===void 0||mt.typedArray(o.textEdits,ble.is)&&(o.tooltip===void 0||mt.string(o.tooltip)||_Ie.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})(Wpn||(Wpn={}));var zpn;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(zpn||(zpn={}));var Ypn;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(Ypn||(Ypn={}));var Kpn;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(Kpn||(Kpn={}));var Jpn;(function(t){t.Invoked=0,t.Automatic=1})(Jpn||(Jpn={}));var Zpn;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(Zpn||(Zpn={}));var Xpn;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(Xpn||(Xpn={}));var ehn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&v6t.is(n.uri)&&mt.string(n.name)}a(e,"is"),t.is=e})(ehn||(ehn={}));var thn;(function(t){function e(s,c,l,u){return new M6t(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(;f= ?`].join(` +`),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${b3.tableName}.${NS.FilePath} = ? AND ${$h.tableName}.${ua.ExtentStart} >= ? AND (${$h.tableName}.${ua.ExtentStart} + ${$h.tableName}.${ua.ExtentLength}) <= ?`,`ORDER BY ${$h.tableName}.${ua.ExtentStart}`].join(` +`),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${b3.tableName}.${NS.FilePath} = ? AND ${$h.tableName}.${ua.FullyQualifiedName} LIKE ?`,`ORDER BY ${$h.tableName}.${ua.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,NVe(n,e,r)):[]}};var OVe=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new MVe(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 _le(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew Fx(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new hu(e.commentStart,e.commentLength),new hu(e.nameStart,e.nameLength),new hu(e.bodyStart,e.bodyLength),new hu(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(_le,"symbolsToSymbolRanges");var BVe=de(require("fs/promises"));var LVe=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new OVe(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=rs(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await BVe.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 BVe.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 c6t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>kBo(r))}a(c6t,"isIndexWorkerData");var AIe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},bQ=class extends AIe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},FVe=class extends AIe{constructor(r){super(nE.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},nE={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},UVe=class extends bQ{constructor(r,n,o){super(r,nE.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},QVe=class extends bQ{constructor(r,n){super(r,nE.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},qVe=class extends bQ{constructor(r,n,o){super(r,nE.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},jVe=class extends bQ{constructor(r,n){super(r,nE.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},HVe=class extends bQ{constructor(r,n,o,s,c,l){super(r,nE.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},GVe=class extends bQ{static{a(this,"ExitRequest")}constructor(e){super(e,nE.Exit)}},RP=class extends AIe{constructor(r,n,o){super(nE.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 kBo(t){return"databaseFilePath"in t&&"rootPath"in t}a(kBo,"isIndexableWorkspaceFolder");var Tfn=de(ti()),SQ=require("worker_threads");var $Ve=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new LVe(e,dfn,ffn,r),this.contextRetreival=new RVe(this.index.reader,ufn)}},l6t=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 $Ve(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 Tfn.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case nE.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case nE.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case nE.Cancel:n.get(e.id)?.cancel(),s=new RP(e.id,void 0,void 0);break;case nE.Exit:s=await this.dispatchExit(e,r,o.token);break;case nE.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case nE.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case nE.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 RP(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 RP(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 RP(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 RP(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 RP(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 $Ve(e.databaseFilePath)),new RP(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 RP(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function Ifn(){return c6t(SQ.workerData)}a(Ifn,"isIndexWorker");function xfn(){let t=SQ.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!c6t(SQ.workerData))throw new Error("Worker data must provide a valid database path.");let e=SQ.workerData.cwd;process.cwd=()=>e,new l6t(t,SQ.workerData.indexWorkspaceRoots,SQ.workerData.params)}a(xfn,"runIndexWorker");p();p();var yIe=require("fs"),wfn=require("path");var TQ=class extends qo{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await yIe.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 yIe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,wfn.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await yIe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await yIe.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();async function PBo(t){if(t.isCancellationRequested)return;let e=new vA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(PBo,"cancellationTokenToPromise");async function Rfn(t,e){if(e){let r=PBo(e);await Promise.race([t,r])}else await t}a(Rfn,"raceCancellation");function u6t(t){return Array.isArray(t)}a(u6t,"isArrayOfT");async function kfn(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await d6t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(kfn,"resolveAll");async function d6t(t,e){let r;return t instanceof Promise?r=await DBo(t,e):r=await NBo(t,e),r}a(d6t,"resolve");async function DBo(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:u6t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await Rfn(o,e),n.resolutionTime=performance.now()-r,n}a(DBo,"resolvePromise");async function NBo(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 Rfn(o,e),n.resolutionTime=performance.now()-r,n}a(NBo,"resolveIterable");p();p();var VVe="[...]",MBo=0,DC=-1;function Ef(){return MBo++}a(Ef,"getAvailableNodeId");function OBo(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(OBo,"elideChildren");function Pfn(t,e=VVe){return r=>t.tokenLength(OBo(r,e))}a(Pfn,"getTokenizerCostFunction");p();var xQ=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 LBo(t){let e={id:t.id??Ef(),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??VVe,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(LBo,"createRenderNode");function BBo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(BBo,"isRenderedChildRequired");function Dfn(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(Dfn,"rectifiedValue");function EIe(t,e){let r=Nfn(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(EIe,"rectifyWeights");function Nfn(t,e){let r=t.children.map(s=>Nfn(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 xQ([]);let n=new xQ(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(Nfn,"recursivelyRectifyWeights");function Mfn(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(E.id),"elider"),m=[],g=new Map;if(p6t(t,m,h,g),m.length===0)return f6t(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 xQ([{item:t,priority:Dfn(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,Dfn(m))}}for(;l.size>0;){let h=[],m=a(E=>!l.has(E.id),"elider"),g=new Map;if(p6t(t,h,m,g),h.length===0)return f6t(t,o);let A=h.join("");if(o===void 0){let E=[...g.values()].reduce((_,v)=>_+v.cost,0);return{text:A,cost:E,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 E=u.pop();l.has(E.id)&&(y-=E.cost,l.delete(E.id))}if(u.length===0)break}return f6t(t,o)}a(Mfn,"render");function f6t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(f6t,"renderEmpty");function p6t(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=BBo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=p6t(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(p6t,"recursivelyRender");function _Ie(t,e,r=VVe){let n=t.children.map(c=>_Ie(c,e,r));r=t.elisionMarker??r;let o=e(t);return LBo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(_Ie,"snapshot");var wQ={id:Ef(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var kP=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var zVe={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function FBo(t,e,r=zVe,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=xa(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(FBo,"getDirectoryChildren");function UBo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=uf(e);for(;o.startsWith(r);){n.push(o);let s=uf(o);if(s.length>=o.length)break;o=s}return n}a(UBo,"getAncestors");function QBo(t,e,r=zVe.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=UBo(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(QBo,"getAncestorWeights");async function*h6t(t,e,r,n,o,s){let c={...zVe,...r},l=c.MaxResults,u=c.Decay,d=QBo(t,e,u),f=new xQ([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await FBo(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(h6t,"getNearbyDocuments");var WVe=class extends kP{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=zVe;this.cache=new Dk(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of h6t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function o0(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(o0,"setDefault");var qBo={MaxActiveSymbols:500,SymbolCacheSize:1e6},YVe=class extends kP{constructor(){super(...arguments);this.config=qBo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new Cn(this.config.SymbolCacheSize);this.textSymbols=new Cn(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=o0(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 m6t(l)){let d=o0(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())o0(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&&Ofn(o))}},jBo=/^[a-zA-Z_]{2,}\w+$/;function Ofn(t){return jBo.test(t)}a(Ofn,"isSymbol");function HBo(t){return t.toLowerCase()}a(HBo,"normalizeWord");function*m6t(t){for(let e of t.split(/\W/))Ofn(e)&&(yield HBo(e))}a(m6t,"getTextSymbols");var GBo={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},KVe=class extends YVe{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=GBo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new Dk(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 m6t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=o0(this.textSymbols,l,()=>this.createSymbol(!1));o0(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 h6t(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 Lfn(t){return t.nodeId!==void 0}a(Lfn,"isNodeLocation");var Bfn={"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}},JVe=class extends kP{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=Bfn[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 E of g.locations)Lfn(E)?l.push({weight:y,uri:E.uri,id:E.nodeId,source:u}):l.push({weight:y,uri:E.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(Lfn(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:DC});r.locations=s,r.isFullyResolved=o}recordEvent(r,n,o){let s=Bfn[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};o0(this.eventsByType,r,()=>new Cn(s.maxEventCount)).set(++this.nextId,c)}};p();var ZVe=class extends kP{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)??DC,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 E of A)l.set(E,(l.get(E)??0)+h/A.size);let y=this.nodeChildren.get(m);if(y&&y.size>1)for(let E of y)E!==f&&u.set(E,(u.get(E)??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 $Bo(t){return t.id!==void 0}a($Bo,"isNodeItem");function VBo(t){return!("uri"in t)&&!("id"in t)}a(VBo,"isNullItem");var Ffn={"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 Ufn(t){return t in Ffn}a(Ufn,"isSourceId");var RQ="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",vle=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!==DC),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}},XVe=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=Ffn;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new vle([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new vle(r.items):new vle([])}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(DC);if(l!==void 0&&l>0){s.delete(DC);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 vle(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(VBo(r))return{weight:r.weight,uri:RQ,id:DC};let n=$Bo(r)?r.id:DC,o=r.uri??this.activeContext.getUri(n)??RQ;return o===RQ&&(n=DC),{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=o0(r,s,()=>new Map),d=DC;(!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!==RQ?this.activeContext.normalizeUri(u)??RQ:RQ;for(let[h,m]of d.entries())u===RQ||h===DC?n.set(f,(n.get(f)??0)+m):r.push({uri:f,id:h,weight:m}),o+=m}if(o<=0)return[];n.delete(RQ),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:DC,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 g6t=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*Qfn(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=zBo(e,this.document),o=new g6t(Ef(),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;mWBo}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function zBo(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(zBo,"buildText");function*Qfn(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*Qfn(r,e))}a(Qfn,"walk");p();p();p();var tWe=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 A6t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:A6t(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=A6t(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 tWe(Ef(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(A6t,"recursivelyBuildNode");function qfn(t){let e=HY(t.getText(),t.detectedLanguageId);return A6t(e,t.lineCount,t)??new tWe(Ef(),e,[],0,t.lineCount-1,t)}a(qfn,"parse");var rWe={source:"indentation",parse:qfn,update(t,e){return{root:qfn(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var Hfn=de(ale());function jfn(t){return{line:t.row,character:t.column}}a(jfn,"asPosition");var oO=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)}},kQ=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 Hfn.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return rWe.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:jfn(e.startPosition),end:jfn(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var YBo=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),KBo=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),JBo=new Set(["identifier"]),ZBo=new Set(["string","comment"]),Gfn=new oO(YBo,KBo,JBo,ZBo);p();var XBo=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),e3o=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),t3o=new Set(["identifier"]),r3o=new Set(["string_literal","line_comment","block_comment"]),$fn=new oO(XBo,e3o,t3o,r3o);p();var n3o=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),i3o=new Set(["module","block","parameters","dictionary","list"]),o3o=new Set(["identifier"]),s3o=new Set(["string","comment"]),Vfn=new oO(n3o,i3o,o3o,s3o);p();var a3o=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),c3o=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),l3o=new Set(["identifier"]),u3o=new Set(["string","comment"]),Wfn=new oO(a3o,c3o,l3o,u3o);var zfn=de(ale());async function Yfn(t){await zfn.default.init();try{let e=await S8t(t);switch(t){case"python":return new kQ(e,"tree-sitter-python",Vfn);case"typescript":return new kQ(e,"tree-sitter-typescript",Wfn);case"java":return new kQ(e,"tree-sitter-java",$fn);case"cpp":return new kQ(e,"tree-sitter-cpp",Gfn);default:return new kQ(e,"tree-sitter-generic")}}catch{return rWe}}a(Yfn,"getParser");var y6t=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}))}},nWe=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},Kfn=500,iWe=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 Cn(Kfn);this.allowedExtensions=new Set(vQ);this.invalidDocumentCache=new Dk(Kfn,this.config.InvalidCacheTime),this.cachedDocuments=new Q9e(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=>C3[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(l7e(e),r=Fs(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(DKr(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 y6t(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 nWe(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new vA;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 nWe(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 eWe(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=o0(this.createdNodes,e,()=>new Set),o=o0(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 Yfn(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 d3o="WorkspaceContextWorker";function E6t(t){let e=t;return e?.workerId===d3o&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(E6t,"isContextWorkerData");var f3o=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function Jfn(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return f3o.includes(e)?e:void 0}a(Jfn,"getContextMessageType");var PQ=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();v6t();p();var rpn;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(rpn||(rpn={}));var C6t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(C6t||(C6t={}));var npn;(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})(npn||(npn={}));var sWe;(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})(sWe||(sWe={}));var iE;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=sWe.MAX_VALUE),o===Number.MAX_VALUE&&(o=sWe.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})(iE||(iE={}));var mu;(function(t){function e(n,o,s,c){if(mt.uinteger(n)&&mt.uinteger(o)&&mt.uinteger(s)&&mt.uinteger(c))return{start:iE.create(n,o),end:iE.create(s,c)};if(iE.is(n)&&iE.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)&&iE.is(o.start)&&iE.is(o.end)}a(r,"is"),t.is=r})(mu||(mu={}));var aWe;(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)&&mu.is(o.range)&&(mt.string(o.uri)||mt.undefined(o.uri))}a(r,"is"),t.is=r})(aWe||(aWe={}));var ipn;(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)&&mu.is(o.targetRange)&&mt.string(o.targetUri)&&mu.is(o.targetSelectionRange)&&(mu.is(o.originSelectionRange)||mt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(ipn||(ipn={}));var b6t;(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})(b6t||(b6t={}));var opn;(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)&&mu.is(o.range)&&b6t.is(o.color)}a(r,"is"),t.is=r})(opn||(opn={}));var spn;(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)||ble.is(o))&&(mt.undefined(o.additionalTextEdits)||mt.typedArray(o.additionalTextEdits,ble.is))}a(r,"is"),t.is=r})(spn||(spn={}));var apn;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(apn||(apn={}));var cpn;(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})(cpn||(cpn={}));var S6t;(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)&&aWe.is(o.location)&&mt.string(o.message)}a(r,"is"),t.is=r})(S6t||(S6t={}));var lpn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(lpn||(lpn={}));var upn;(function(t){t.Unnecessary=1,t.Deprecated=2})(upn||(upn={}));var dpn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&mt.string(n.href)}a(e,"is"),t.is=e})(dpn||(dpn={}));var cWe;(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)&&mu.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,S6t.is))}a(r,"is"),t.is=r})(cWe||(cWe={}));var Cle;(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})(Cle||(Cle={}));var ble;(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)&&mu.is(c.range)}a(o,"is"),t.is=o})(ble||(ble={}));var T6t;(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})(T6t||(T6t={}));var Sle;(function(t){function e(r){let n=r;return mt.string(n)}a(e,"is"),t.is=e})(Sle||(Sle={}));var fpn;(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 ble.is(c)&&(T6t.is(c.annotationId)||Sle.is(c.annotationId))}a(o,"is"),t.is=o})(fpn||(fpn={}));var I6t;(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)&&P6t.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(I6t||(I6t={}));var x6t;(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||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(x6t||(x6t={}));var w6t;(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||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(w6t||(w6t={}));var R6t;(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||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(R6t||(R6t={}));var k6t;(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)?x6t.is(o)||w6t.is(o)||R6t.is(o):I6t.is(o)))}a(e,"is"),t.is=e})(k6t||(k6t={}));var ppn;(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})(ppn||(ppn={}));var hpn;(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})(hpn||(hpn={}));var P6t;(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})(P6t||(P6t={}));var mpn;(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})(mpn||(mpn={}));var D6t;(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})(D6t||(D6t={}));var vIe;(function(t){function e(r){let n=r;return mt.objectLiteral(r)&&D6t.is(n.kind)&&mt.string(n.value)}a(e,"is"),t.is=e})(vIe||(vIe={}));var gpn;(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})(gpn||(gpn={}));var Apn;(function(t){t.PlainText=1,t.Snippet=2})(Apn||(Apn={}));var ypn;(function(t){t.Deprecated=1})(ypn||(ypn={}));var Epn;(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)&&mu.is(o.insert)&&mu.is(o.replace)}a(r,"is"),t.is=r})(Epn||(Epn={}));var _pn;(function(t){t.asIs=1,t.adjustIndentation=2})(_pn||(_pn={}));var vpn;(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})(vpn||(vpn={}));var Cpn;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(Cpn||(Cpn={}));var bpn;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(bpn||(bpn={}));var lWe;(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})(lWe||(lWe={}));var Spn;(function(t){function e(r){let n=r;return!!n&&mt.objectLiteral(n)&&(vIe.is(n.contents)||lWe.is(n.contents)||mt.typedArray(n.contents,lWe.is))&&(r.range===void 0||mu.is(r.range))}a(e,"is"),t.is=e})(Spn||(Spn={}));var Tpn;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(Tpn||(Tpn={}));var Ipn;(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})(Ipn||(Ipn={}));var xpn;(function(t){t.Text=1,t.Read=2,t.Write=3})(xpn||(xpn={}));var wpn;(function(t){function e(r,n){let o={range:r};return mt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(wpn||(wpn={}));var Rpn;(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})(Rpn||(Rpn={}));var kpn;(function(t){t.Deprecated=1})(kpn||(kpn={}));var Ppn;(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})(Ppn||(Ppn={}));var Dpn;(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})(Dpn||(Dpn={}));var Npn;(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)&&mu.is(o.range)&&mu.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})(Npn||(Npn={}));var Mpn;(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"})(Mpn||(Mpn={}));var uWe;(function(t){t.Invoked=1,t.Automatic=2})(uWe||(uWe={}));var Opn;(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,cWe.is)&&(o.only===void 0||mt.typedArray(o.only,mt.string))&&(o.triggerKind===void 0||o.triggerKind===uWe.Invoked||o.triggerKind===uWe.Automatic)}a(r,"is"),t.is=r})(Opn||(Opn={}));var Lpn;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):Cle.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,cWe.is))&&(o.kind===void 0||mt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Cle.is(o.command))&&(o.isPreferred===void 0||mt.boolean(o.isPreferred))&&(o.edit===void 0||k6t.is(o.edit))}a(r,"is"),t.is=r})(Lpn||(Lpn={}));var Bpn;(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)&&mu.is(o.range)&&(mt.undefined(o.command)||Cle.is(o.command))}a(r,"is"),t.is=r})(Bpn||(Bpn={}));var Fpn;(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})(Fpn||(Fpn={}));var Upn;(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)&&mu.is(o.range)&&(mt.undefined(o.target)||mt.string(o.target))}a(r,"is"),t.is=r})(Upn||(Upn={}));var Qpn;(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)&&mu.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(Qpn||(Qpn={}));var qpn;(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"})(qpn||(qpn={}));var jpn;(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"})(jpn||(jpn={}));var Hpn;(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})(Hpn||(Hpn={}));var Gpn;(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&&mu.is(o.range)&&mt.string(o.text)}a(r,"is"),t.is=r})(Gpn||(Gpn={}));var $pn;(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&&mu.is(o.range)&&mt.boolean(o.caseSensitiveLookup)&&(mt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})($pn||($pn={}));var Vpn;(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&&mu.is(o.range)&&(mt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})(Vpn||(Vpn={}));var Wpn;(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)&&mu.is(n.stoppedLocation)}a(r,"is"),t.is=r})(Wpn||(Wpn={}));var N6t;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(N6t||(N6t={}));var M6t;(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)||vIe.is(o.tooltip))&&(o.location===void 0||aWe.is(o.location))&&(o.command===void 0||Cle.is(o.command))}a(r,"is"),t.is=r})(M6t||(M6t={}));var zpn;(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)&&iE.is(o.position)&&(mt.string(o.label)||mt.typedArray(o.label,M6t.is))&&(o.kind===void 0||N6t.is(o.kind))&&o.textEdits===void 0||mt.typedArray(o.textEdits,ble.is)&&(o.tooltip===void 0||mt.string(o.tooltip)||vIe.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})(zpn||(zpn={}));var Ypn;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(Ypn||(Ypn={}));var Kpn;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(Kpn||(Kpn={}));var Jpn;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(Jpn||(Jpn={}));var Zpn;(function(t){t.Invoked=0,t.Automatic=1})(Zpn||(Zpn={}));var Xpn;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(Xpn||(Xpn={}));var ehn;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(ehn||(ehn={}));var thn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&C6t.is(n.uri)&&mt.string(n.name)}a(e,"is"),t.is=e})(thn||(thn={}));var rhn;(function(t){function e(s,c,l,u){return new O6t(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 iE.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return iE.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 gu=class{static{a(this,"LocationFactory")}static{this.range=mu.create.bind(mu)}static{this.position=iE.create.bind(iE)}},NS=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=S3.create(e.clientUri,e.clientLanguageId,n,e.getText());return S3.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=S3.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return S3.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=nO({uri:e,languageId:r})){return new t(Fs(e),S3.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=mu.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=mu.create(iE.create(r,0),iE.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var oO=require("worker_threads");var u3o=5,rhn=3e4,O6t=class extends SQ{constructor(r){super();this.worker=r;this.didChangeEmitter=new Wi;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>Fs(n))}getWorkspaceFolder(r){let n=Fs(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:NS.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},L6t=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new O6t(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 rWe(this.fileSystem,n),this.coordinator=new JVe(this.documentManager,n),this.recentActivityProvider=new YVe,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(!Kfn(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 kQ(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new kQ(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 ${rhn}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},rhn);r=new vA,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 kQ(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(u6t(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 kQ(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 B6t(){return oO.parentPort!==null&&y6t(oO.workerData)}a(B6t,"isContextWorker");function nhn(){if(!B6t())throw new Error("This must be run in a worker thread.");if(!y6t(oO.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(oO.workerData)}`);let t=oO.workerData.cwd;process.cwd=()=>t;let e=new L6t(oO.parentPort,oO.workerData.workspaceRoots,oO.workerData.config);e.addLocalProvider(new $Ve(e.fileSystem,e.documentManager)),e.addLocalProvider(new zVe(e.fileSystem,e.documentManager)),e.addLocalProvider(new KVe)}a(nhn,"runContextWorker");p();var vIe=de(require("util"));function ihn(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(MU(t)==="dev")return t.get(qf).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:",vIe.format(...o)))},e.dir=(n,o)=>r(4,vIe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(vIe.format(...n));o.name="Trace",e.log(o)},e}a(ihn,"createConsole");p();p();var uWe=de(require("path")),ohn=require("worker_threads");var dWe=new Map,d3o=0;function CIe(t,e){let r=d3o++;dWe.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,dWe.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(CIe,"registerWorker");function shn(t,e){let r=new ohn.Worker(uWe.default.resolve(f3o(),t),{workerData:e});return CIe(r,t),r}a(shn,"createWorker");function f3o(){return uWe.default.extname(__filename)!==".ts"?__dirname:uWe.default.resolve(__dirname,"../../dist")}a(f3o,"workerBundleDir");function ahn(){return dWe.size}a(ahn,"getActiveWorkerCount");async function chn(){let t=[],e=[];for(let[r,{worker:n,name:o}]of dWe)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(chn,"collectWorkerPerfStats");var fWe=de(require("os")),lhn=de(require("v8"));function p3o(t){let e=Ft(t,Ye.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(p3o,"getPerfState");var GY=class t{constructor(e){this.ctx=e;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=p3o(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=lhn.getHeapStatistics(),o=this.cpuDelta(),s=ahn(),c=0,l="";try{let u=await chn();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(At(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:fWe.freemem(),systemTotalMemBytes:fWe.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:IP(this.ctx)?1:0}),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 wk=de(PP()),Zao=require("worker_threads");p();p();var XWe=require("assert");p();p();var IFo={right:PFo,center:DFo},xFo=0,HWe=1,wFo=2,GWe=3,l9t=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&&MS.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),MS.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=MS.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>MS.stringWidth(c)&&(f+=" ".repeat(d-MS.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=IFo[e[l].align];f=m(f,d),MS.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=MS.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=MS.wrap(s.text,this.negatePadding(s),{hard:!0}).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 iE.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return iE.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 gu=class{static{a(this,"LocationFactory")}static{this.range=mu.create.bind(mu)}static{this.position=iE.create.bind(iE)}},MS=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=S3.create(e.clientUri,e.clientLanguageId,n,e.getText());return S3.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=S3.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return S3.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=iO({uri:e,languageId:r})){return new t(Fs(e),S3.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=mu.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=mu.create(iE.create(r,0),iE.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var sO=require("worker_threads");var h3o=5,nhn=3e4,L6t=class extends TQ{constructor(r){super();this.worker=r;this.didChangeEmitter=new Wi;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>Fs(n))}getWorkspaceFolder(r){let n=Fs(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:MS.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},B6t=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new L6t(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 iWe(this.fileSystem,n),this.coordinator=new XVe(this.documentManager,n),this.recentActivityProvider=new JVe,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(!Jfn(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 ${nhn}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},nhn);r=new vA,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(d6t(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 F6t(){return sO.parentPort!==null&&E6t(sO.workerData)}a(F6t,"isContextWorker");function ihn(){if(!F6t())throw new Error("This must be run in a worker thread.");if(!E6t(sO.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(sO.workerData)}`);let t=sO.workerData.cwd;process.cwd=()=>t;let e=new B6t(sO.parentPort,sO.workerData.workspaceRoots,sO.workerData.config);e.addLocalProvider(new WVe(e.fileSystem,e.documentManager)),e.addLocalProvider(new KVe(e.fileSystem,e.documentManager)),e.addLocalProvider(new ZVe)}a(ihn,"runContextWorker");p();var CIe=de(require("util"));function ohn(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(OU(t)==="dev")return t.get(qf).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:",CIe.format(...o)))},e.dir=(n,o)=>r(4,CIe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(CIe.format(...n));o.name="Trace",e.log(o)},e}a(ohn,"createConsole");p();p();var fWe=de(require("path")),shn=require("worker_threads");var pWe=new Map,m3o=0;function bIe(t,e){let r=m3o++;pWe.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,pWe.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(bIe,"registerWorker");function ahn(t,e){let r=new shn.Worker(fWe.default.resolve(g3o(),t),{workerData:e});return bIe(r,t),r}a(ahn,"createWorker");function g3o(){return fWe.default.extname(__filename)!==".ts"?__dirname:fWe.default.resolve(__dirname,"../../dist")}a(g3o,"workerBundleDir");function chn(){return pWe.size}a(chn,"getActiveWorkerCount");async function lhn(){let t=[],e=[];for(let[r,{worker:n,name:o}]of pWe)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(lhn,"collectWorkerPerfStats");var hWe=de(require("os")),uhn=de(require("v8"));function A3o(t){let e=Ft(t,Ye.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(A3o,"getPerfState");var $Y=class t{constructor(e){this.ctx=e;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=A3o(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=uhn.getHeapStatistics(),o=this.cpuDelta(),s=chn(),c=0,l="";try{let u=await lhn();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(At(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:hWe.freemem(),systemTotalMemBytes:hWe.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:xP(this.ctx)?1:0}),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 Rk=de(DP()),rco=require("worker_threads");p();p();var tze=require("assert");p();p();var kFo={right:OFo,center:LFo},PFo=0,$We=1,DFo=2,VWe=3,u9t=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&&OS.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),OS.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=OS.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>OS.stringWidth(c)&&(f+=" ".repeat(d-OS.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=kFo[e[l].align];f=m(f,d),OS.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=OS.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=OS.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[xFo]||0).fill("")),o.push(...new Array(s.padding[wFo]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||MS.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,RFo(e[l])):c)}};function nmn(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(nmn,"addBorder");function RFo(t){let e=t.padding||[],r=1+(e[GWe]||0)+(e[HWe]||0);return t.border?r+4:r}a(RFo,"_minWidth");function kFo(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(kFo,"getWindowWidth");function PFo(t,e){t=t.trim();let r=MS.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(DFo,"alignCenter");var MS;function imn(t,e){return MS=e,new l9t({width:t?.width||kFo(),wrap:t?.wrap})}a(imn,"cliui");p();p();p();function u9t({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(u9t,"ansiRegex");var NFo=u9t();function zY(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(NFo,"")}a(zY,"stripAnsi");p();p();function omn(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}a(omn,"isAmbiguous");function smn(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}a(smn,"isFullWidth");function amn(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9800&&t<=9811||t===9855||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101632&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129672||t>=129680&&t<=129725||t>=129727&&t<=129733||t>=129742&&t<=129755||t>=129760&&t<=129768||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}a(amn,"isWide");function MFo(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(MFo,"validate");function $We(t,{ambiguousAsWide:e=!1}={}){return MFo(t),smn(t)||amn(t)||e&&omn(t)?2:1}a($We,"eastAsianWidth");p();var cmn=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 OFo=new Intl.Segmenter,LFo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function T3(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=zY(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of OFo.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)&&!LFo.test(c)){if(cmn().test(c)){o+=2;continue}o+=$We(l,s)}}return o}a(T3,"stringWidth");p();p();var lmn=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),umn=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),dmn=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),Od={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]}},qLu=Object.keys(Od.modifier),BFo=Object.keys(Od.color),FFo=Object.keys(Od.bgColor),jLu=[...BFo,...FFo];function UFo(){let t=new Map;for(let[e,r]of Object.entries(Od)){for(let[n,o]of Object.entries(r))Od[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Od[n],t.set(o[0],o[1]);Object.defineProperty(Od,e,{value:r,enumerable:!1})}return Object.defineProperty(Od,"codes",{value:t,enumerable:!1}),Od.color.close="\x1B[39m",Od.bgColor.close="\x1B[49m",Od.color.ansi=lmn(),Od.color.ansi256=umn(),Od.color.ansi16m=dmn(),Od.bgColor.ansi=lmn(10),Od.bgColor.ansi256=umn(10),Od.bgColor.ansi16m=dmn(10),Object.defineProperties(Od,{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=>Od.rgbToAnsi256(...Od.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)=>Od.ansi256ToAnsi(Od.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Od.ansi256ToAnsi(Od.hexToAnsi256(e)),"value"),enumerable:!1}}),Od}a(UFo,"assembleStyles");var QFo=UFo(),fmn=QFo;var WWe=new Set(["\x1B","\x9B"]),qFo=39,f9t="\x07",mmn="[",jFo="]",gmn="m",VWe=`${jFo}8;;`,pmn=a(t=>`${WWe.values().next().value}${mmn}${t}${gmn}`,"wrapAnsiCode"),hmn=a(t=>`${WWe.values().next().value}${VWe}${t}${f9t}`,"wrapAnsiHyperlink"),HFo=a(t=>t.split(" ").map(e=>T3(e)),"wordLengths"),d9t=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=T3(zY(t.at(-1)));for(let[l,u]of n.entries()){let d=T3(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),WWe.has(u)&&(o=!0,s=n.slice(l+1,l+1+VWe.length).join("")===VWe),o){s?u===f9t&&(o=!1,s=!1):u===gmn&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),GFo=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(T3(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),$Fo=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=HFo(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=T3(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){d9t(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>GFo(h)));let u=l.join(` -`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,WWe.has(m)){let{groups:A}=new RegExp(`(?:\\${mmn}(?\\d+)m|\\${VWe}(?.*)${f9t})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===qFo?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=fmn.codes.get(Number(o));d[h+1]===` -`?(s&&(n+=hmn("")),o&&g&&(n+=pmn(g))):m===` -`&&(o&&g&&(n+=pmn(o)),s&&(n+=hmn(s))),f+=m.length}return n},"exec");function p9t(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[PFo]||0).fill("")),o.push(...new Array(s.padding[DFo]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||OS.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,NFo(e[l])):c)}};function imn(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(imn,"addBorder");function NFo(t){let e=t.padding||[],r=1+(e[VWe]||0)+(e[$We]||0);return t.border?r+4:r}a(NFo,"_minWidth");function MFo(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(MFo,"getWindowWidth");function OFo(t,e){t=t.trim();let r=OS.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(LFo,"alignCenter");var OS;function omn(t,e){return OS=e,new u9t({width:t?.width||MFo(),wrap:t?.wrap})}a(omn,"cliui");p();p();p();function d9t({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(d9t,"ansiRegex");var BFo=d9t();function YY(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(BFo,"")}a(YY,"stripAnsi");p();p();function smn(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}a(smn,"isAmbiguous");function amn(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}a(amn,"isFullWidth");function cmn(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9800&&t<=9811||t===9855||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101632&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129672||t>=129680&&t<=129725||t>=129727&&t<=129733||t>=129742&&t<=129755||t>=129760&&t<=129768||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}a(cmn,"isWide");function FFo(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(FFo,"validate");function WWe(t,{ambiguousAsWide:e=!1}={}){return FFo(t),amn(t)||cmn(t)||e&&smn(t)?2:1}a(WWe,"eastAsianWidth");p();var lmn=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 UFo=new Intl.Segmenter,QFo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function T3(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=YY(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of UFo.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)&&!QFo.test(c)){if(lmn().test(c)){o+=2;continue}o+=WWe(l,s)}}return o}a(T3,"stringWidth");p();p();var umn=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),dmn=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),fmn=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),Od={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]}},WLu=Object.keys(Od.modifier),qFo=Object.keys(Od.color),jFo=Object.keys(Od.bgColor),zLu=[...qFo,...jFo];function HFo(){let t=new Map;for(let[e,r]of Object.entries(Od)){for(let[n,o]of Object.entries(r))Od[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Od[n],t.set(o[0],o[1]);Object.defineProperty(Od,e,{value:r,enumerable:!1})}return Object.defineProperty(Od,"codes",{value:t,enumerable:!1}),Od.color.close="\x1B[39m",Od.bgColor.close="\x1B[49m",Od.color.ansi=umn(),Od.color.ansi256=dmn(),Od.color.ansi16m=fmn(),Od.bgColor.ansi=umn(10),Od.bgColor.ansi256=dmn(10),Od.bgColor.ansi16m=fmn(10),Object.defineProperties(Od,{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=>Od.rgbToAnsi256(...Od.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)=>Od.ansi256ToAnsi(Od.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Od.ansi256ToAnsi(Od.hexToAnsi256(e)),"value"),enumerable:!1}}),Od}a(HFo,"assembleStyles");var GFo=HFo(),pmn=GFo;var YWe=new Set(["\x1B","\x9B"]),$Fo=39,p9t="\x07",gmn="[",VFo="]",Amn="m",zWe=`${VFo}8;;`,hmn=a(t=>`${YWe.values().next().value}${gmn}${t}${Amn}`,"wrapAnsiCode"),mmn=a(t=>`${YWe.values().next().value}${zWe}${t}${p9t}`,"wrapAnsiHyperlink"),WFo=a(t=>t.split(" ").map(e=>T3(e)),"wordLengths"),f9t=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=T3(YY(t.at(-1)));for(let[l,u]of n.entries()){let d=T3(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),YWe.has(u)&&(o=!0,s=n.slice(l+1,l+1+zWe.length).join("")===zWe),o){s?u===p9t&&(o=!1,s=!1):u===Amn&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),zFo=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(T3(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),YFo=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=WFo(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=T3(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){f9t(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>zFo(h)));let u=l.join(` +`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,YWe.has(m)){let{groups:A}=new RegExp(`(?:\\${gmn}(?\\d+)m|\\${zWe}(?.*)${p9t})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===$Fo?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=pmn.codes.get(Number(o));d[h+1]===` +`?(s&&(n+=mmn("")),o&&g&&(n+=hmn(g))):m===` +`&&(o&&g&&(n+=hmn(o)),s&&(n+=mmn(s))),f+=m.length}return n},"exec");function h9t(t,e,r){return String(t).normalize().replaceAll(`\r `,` `).split(` -`).map(n=>$Fo(n,e,r)).join(` -`)}a(p9t,"wrapAnsi");function h9t(t){return imn(t,{stringWidth:T3,stripAnsi:zY,wrap:p9t})}a(h9t,"ui");p();var wle=require("path"),zWe=require("fs");function m9t(t,e){let r=(0,wle.resolve)(".",t),n;for((0,zWe.statSync)(r).isDirectory()||(r=(0,wle.dirname)(r));;){if(n=e(r,(0,zWe.readdirSync)(r)),n)return(0,wle.resolve)(r,n);if(r=(0,wle.dirname)(n=r),n===r)break}}a(m9t,"default");var Omn=require("util"),I9t=require("url");p();var Cmn=require("util"),ZWe=require("path");p();function YY(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(YWe,"decamelize");function KWe(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(KWe,"looksLikeNumber");p();p();function Amn(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 ue=="number"&&(E.nargs[Z]=ue,E.keys.push(Z))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([Z,ue])=>{typeof ue=="function"&&(E.coercions[Z]=ue,E.keys.push(Z))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(Z){E.configs[Z]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([Z,ue])=>{(typeof ue=="boolean"||typeof ue=="function")&&(E.configs[Z]=ue)})),ie(n.key,c,n.default,E.arrays),Object.keys(u).forEach(function(Z){(E.aliases[Z]||[]).forEach(function(ue){u[ue]=u[Z]})});let b=null;he();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let Z=0;Z=3&&(H(we[1],E.arrays)?Z=D(Z,we[1],o,we[2]):H(we[1],E.nargs)!==!1?Z=P(Z,we[1],o,we[2]):N(we[1],we[2],!0));else if(ue.match(v)&&l["boolean-negation"])we=ue.match(v),we!==null&&Array.isArray(we)&&we.length>=2&&(ce=we[1],N(ce,H(ce,E.arrays)?[!1]:!1));else if(ue.match(/^--.+/)||!l["short-option-groups"]&&ue.match(/^-[^-]+/))we=ue.match(/^--?(.+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(ce=we[1],H(ce,E.arrays)?Z=D(Z,ce,o):H(ce,E.nargs)!==!1?Z=P(Z,ce,o):(Be=o[Z+1],Be!==void 0&&(!Be.match(/^-/)||Be.match(_))&&!H(ce,E.bools)&&!H(ce,E.counts)||/^(true|false)$/.test(Be)?(N(ce,Be),Z++):N(ce,ke(ce))));else if(ue.match(/^-.\..+=/))we=ue.match(/^-([^=]+)=([\s\S]*)$/),we!==null&&Array.isArray(we)&&we.length>=3&&N(we[1],we[2]);else if(ue.match(/^-.\..+/)&&!ue.match(_))Be=o[Z+1],we=ue.match(/^-(.\..+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(ce=we[1],Be!==void 0&&!Be.match(/^-/)&&!H(ce,E.bools)&&!H(ce,E.counts)?(N(ce,Be),Z++):N(ce,ke(ce)));else if(ue.match(/^-[^-]+/)&&!ue.match(_)){Ne=ue.slice(1,-1).split(""),ne=!1;for(let st=0;stZ!=="--"&&Z.includes("-")).forEach(Z=>{delete w[Z]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(Z=>c[Z])).forEach(Z=>{l["camel-case-expansion"]&&Z.includes("-")&&delete w[Z.split(".").map(ue=>YY(ue)).join(".")],delete w[Z]});function x(Z){let ue=q("_",Z);(typeof ue=="string"||typeof ue=="number")&&w._.push(ue)}a(x,"pushPositional");function P(Z,ue,qe,ne){let ce,Ne=H(ue,E.nargs);if(Ne=typeof Ne!="number"||isNaN(Ne)?1:Ne,Ne===0)return K(ne)||(b=Error(y("Argument unexpected for: %s",ue))),N(ue,ke(ue)),Z;let we=K(ne)?0:1;if(l["nargs-eats-options"])qe.length-(Z+1)+we0&&(N(ue,ne),Be--),ce=Z+1;ce0||we&&typeof we=="number"&&ce.length>=we||(Ne=qe[Be],/^-/.test(Ne)&&!_.test(Ne)&&!ge(Ne)));Be++)Z=Be,ce.push(B(ue,Ne,s))}return typeof we=="number"&&(we&&ce.length1&&l["dot-notation"]&&(E.aliases[ce[0]]||[]).forEach(function(Ne){let we=Ne.split("."),Be=[].concat(ce);Be.shift(),we=we.concat(Be),(E.aliases[Z]||[]).includes(we.join("."))||z(w,we,ne)}),H(Z,E.normalize)&&!H(Z,E.arrays)&&[Z].concat(E.aliases[Z]||[]).forEach(function(we){Object.defineProperty(R,we,{enumerable:!0,get(){return ue},set(Be){ue=typeof Be=="string"?I3.normalize(Be):Be}})})}a(N,"setArg");function L(Z,ue){E.aliases[Z]&&E.aliases[Z].length||(E.aliases[Z]=[ue],g[ue]=!0),E.aliases[ue]&&E.aliases[ue].length||L(ue,Z)}a(L,"addNewAlias");function B(Z,ue,qe){qe&&(ue=WFo(ue)),(H(Z,E.bools)||H(Z,E.counts))&&typeof ue=="string"&&(ue=ue==="true");let ne=Array.isArray(ue)?ue.map(function(ce){return q(Z,ce)}):q(Z,ue);return H(Z,E.counts)&&(K(ne)||typeof ne=="boolean")&&(ne=g9t()),H(Z,E.normalize)&&H(Z,E.arrays)&&(Array.isArray(ue)?ne=ue.map(ce=>I3.normalize(ce)):ne=I3.normalize(ue)),ne}a(B,"processValue");function q(Z,ue){return!l["parse-positional-numbers"]&&Z==="_"||!H(Z,E.strings)&&!H(Z,E.bools)&&!Array.isArray(ue)&&(KWe(ue)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${ue}`)))||!K(ue)&&H(Z,E.numbers))&&(ue=Number(ue)),ue}a(q,"maybeCoerceNumber");function M(Z){let ue=Object.create(null);W(ue,E.aliases,u),Object.keys(E.configs).forEach(function(qe){let ne=Z[qe]||ue[qe];if(ne)try{let ce=null,Ne=I3.resolve(I3.cwd(),ne),we=E.configs[qe];if(typeof we=="function"){try{ce=we(Ne)}catch(Be){ce=Be}if(ce instanceof Error){b=ce;return}}else ce=I3.require(Ne);O(ce)}catch(ce){ce.name==="PermissionDenied"?b=ce:Z[qe]&&(b=Error(y("Invalid JSON config file: %s",ne)))}})}a(M,"setConfig");function O(Z,ue){Object.keys(Z).forEach(function(qe){let ne=Z[qe],ce=ue?ue+"."+qe:qe;typeof ne=="object"&&ne!==null&&!Array.isArray(ne)&&l["dot-notation"]?O(ne,ce):(!V(w,ce.split("."))||H(ce,E.arrays)&&l["combine-arrays"])&&N(ce,ne)})}a(O,"setConfigObject");function j(){typeof d<"u"&&d.forEach(function(Z){O(Z)})}a(j,"setConfigObjects");function Q(Z,ue){if(typeof f>"u")return;let qe=typeof f=="string"?f:"",ne=I3.env();Object.keys(ne).forEach(function(ce){if(qe===""||ce.lastIndexOf(qe,0)===0){let Ne=ce.split("__").map(function(we,Be){return Be===0&&(we=we.substring(qe.length)),YY(we)});(ue&&E.configs[Ne.join(".")]||!ue)&&!V(Z,Ne)&&N(Ne.join("."),ne[ce])}})}a(Q,"applyEnvVars");function U(Z){let ue,qe=new Set;Object.keys(Z).forEach(function(ne){if(!qe.has(ne)&&(ue=H(ne,E.coercions),typeof ue=="function"))try{let ce=q(ne,ue(Z[ne]));[].concat(E.aliases[ne]||[],ne).forEach(Ne=>{qe.add(Ne),Z[Ne]=ce})}catch(ce){b=ce}})}a(U,"applyCoercions");function Y(Z){return E.keys.forEach(ue=>{~ue.indexOf(".")||typeof Z[ue]>"u"&&(Z[ue]=void 0)}),Z}a(Y,"setPlaceholderKeys");function W(Z,ue,qe,ne=!1){Object.keys(qe).forEach(function(ce){V(Z,ce.split("."))||(z(Z,ce.split("."),qe[ce]),ne&&(A[ce]=!0),(ue[ce]||[]).forEach(function(Ne){V(Z,Ne.split("."))||z(Z,Ne.split("."),qe[ce])}))})}a(W,"applyDefaultsAndAliases");function V(Z,ue){let qe=Z;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(ce){qe=qe[ce]||{}});let ne=ue[ue.length-1];return typeof qe!="object"?!1:ne in qe}a(V,"hasKey");function z(Z,ue,qe){let ne=Z;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(rt){rt=ymn(rt),typeof ne=="object"&&ne[rt]===void 0&&(ne[rt]={}),typeof ne[rt]!="object"||Array.isArray(ne[rt])?(Array.isArray(ne[rt])?ne[rt].push({}):ne[rt]=[ne[rt],{}],ne=ne[rt][ne[rt].length-1]):ne=ne[rt]});let ce=ymn(ue[ue.length-1]),Ne=H(ue.join("."),E.arrays),we=Array.isArray(qe),Be=l["duplicate-arguments-array"];!Be&&H(ce,E.nargs)&&(Be=!0,(!K(ne[ce])&&E.nargs[ce]===1||Array.isArray(ne[ce])&&ne[ce].length===E.nargs[ce])&&(ne[ce]=void 0)),qe===g9t()?ne[ce]=g9t(ne[ce]):Array.isArray(ne[ce])?Be&&Ne&&we?ne[ce]=l["flatten-duplicate-arrays"]?ne[ce].concat(qe):(Array.isArray(ne[ce][0])?ne[ce]:[ne[ce]]).concat([qe]):!Be&&!!Ne==!!we?ne[ce]=qe:ne[ce]=ne[ce].concat([qe]):ne[ce]===void 0&&Ne?ne[ce]=we?qe:[qe]:Be&&!(ne[ce]===void 0||H(ce,E.counts)||H(ce,E.bools))?ne[ce]=[ne[ce],qe]:ne[ce]=qe}a(z,"setKey");function ie(...Z){Z.forEach(function(ue){Object.keys(ue||{}).forEach(function(qe){E.aliases[qe]||(E.aliases[qe]=[].concat(c[qe]||[]),E.aliases[qe].concat(qe).forEach(function(ne){if(/-/.test(ne)&&l["camel-case-expansion"]){let ce=YY(ne);ce!==qe&&E.aliases[qe].indexOf(ce)===-1&&(E.aliases[qe].push(ce),g[ce]=!0)}}),E.aliases[qe].concat(qe).forEach(function(ne){if(ne.length>1&&/[A-Z]/.test(ne)&&l["camel-case-expansion"]){let ce=YWe(ne,"-");ce!==qe&&E.aliases[qe].indexOf(ce)===-1&&(E.aliases[qe].push(ce),g[ce]=!0)}}),E.aliases[qe].forEach(function(ne){E.aliases[ne]=[qe].concat(E.aliases[qe].filter(function(ce){return ne!==ce}))}))})})}a(ie,"extendAliases");function H(Z,ue){let qe=[].concat(E.aliases[Z]||[],Z),ne=Object.keys(ue),ce=qe.find(Ne=>ne.includes(Ne));return ce?ue[ce]:!1}a(H,"checkAllAliases");function re(Z){let ue=Object.keys(E);return[].concat(ue.map(ne=>E[ne])).some(function(ne){return Array.isArray(ne)?ne.includes(Z):ne[Z]})}a(re,"hasAnyFlag");function le(Z,...ue){return[].concat(...ue).some(function(ne){let ce=Z.match(ne);return ce&&re(ce[1])})}a(le,"hasFlagsMatching");function Le(Z){if(Z.match(_)||!Z.match(/^-[^-]+/))return!1;let ue=!0,qe,ne=Z.slice(1).split("");for(let ce=0;ceH(Z,E.arrays)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",Z)),!0):H(Z,E.nargs)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",Z)),!0):!1)}return a(he,"checkConfiguration"),{aliases:Object.assign({},E.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:b,newAliases:Object.assign({},g)}}};function VFo(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;ozFo,"env"),format:Cmn.format,normalize:ZWe.normalize,resolve:ZWe.resolve,require:a(t=>{if(typeof vmn<"u")return vmn(t);if(t.match(/\.json$/))return JSON.parse((0,bmn.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),RIe=a(function(e,r){return Smn.parse(e.slice(),r).argv},"Parser");RIe.detailed=function(t,e){return Smn.parse(t.slice(),e)};RIe.camelCase=YY;RIe.decamelize=YWe;RIe.looksLikeNumber=KWe;var Tmn=RIe;var OS=require("path");p();function YFo(){return KFo()?0:1}a(YFo,"getProcessArgvBinIndex");function KFo(){return JFo()&&!process.defaultApp}a(KFo,"isBundledElectronApp");function JFo(){return!!process.versions.electron}a(JFo,"isElectronApp");function Imn(){return process.argv[YFo()]}a(Imn,"getProcessArgvBin");p();p();p();function v9t({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(v9t,"ansiRegex");var ZFo=v9t();function C9t(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(ZFo,"")}a(C9t,"stripAnsi");p();var xmn=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 XFo=new Intl.Segmenter,e8o=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function b9t(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=C9t(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of XFo.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)&&!e8o.test(c)){if(xmn().test(c)){o+=2;continue}o+=$We(l,s)}}return o}a(b9t,"stringWidth");p();p();var Rle=require("fs"),wmn=require("util"),Rmn=require("path");var kmn={fs:{readFileSync:Rle.readFileSync,writeFile:Rle.writeFile},format:wmn.format,resolve:Rmn.resolve,exists:a(t=>{try{return(0,Rle.statSync)(t).isFile()}catch{return!1}},"exists")};p();var DP,S9t=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(),DP.format.apply(DP.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),DP.format.apply(DP.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);DP.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{DP.fs.readFileSync&&(e=JSON.parse(DP.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=DP.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=DP.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return DP.exists(e)}};function Pmn(t,e){DP=e;let r=new S9t(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(Pmn,"y18n");var t8o=a(t=>Pmn(t,kmn),"y18n"),Dmn=t8o;var Lmn=require("node:module"),Bmn=de(Mmn(),1),eze=require("node:fs");var T9t=(0,I9t.fileURLToPath)(importMetaUrlShim),r8o=T9t.substring(0,T9t.lastIndexOf("node_modules")),n8o=(0,Lmn.createRequire)(importMetaUrlShim),Fmn={assert:{notStrictEqual:XWe.notStrictEqual,strictEqual:XWe.strictEqual},cliui:h9t,findUp:m9t,getEnv:a(t=>process.env[t],"getEnv"),inspect:Omn.inspect,getProcessArgvBin:Imn,mainFilename:r8o||process.cwd(),Parser:Tmn,path:{basename:OS.basename,dirname:OS.dirname,extname:OS.extname,relative:OS.relative,resolve:OS.resolve,join:OS.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:eze.readFileSync,readdirSync:eze.readdirSync,require:n8o,getCallerFile:a(()=>{let t=(0,Bmn.default)(3);return t.match(/^file:\/\//)?(0,I9t.fileURLToPath)(t):t},"getCallerFile"),stringWidth:b9t,y18n:Dmn({directory:(0,OS.resolve)(T9t,"../../../locales"),updateFiles:!1})};p();p();p();function B_(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(B_,"assertNotStrictEqual");function x9t(t,e){e.assert.strictEqual(typeof t,"string")}a(x9t,"assertSingleKey");function kle(t){return Object.keys(t)}a(kle,"objectKeys");p();function Ju(t){return!!t&&!!t.then&&typeof t.then=="function"}a(Ju,"isPromise");p();p();p();var Yp=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 MQ(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(MQ,"parseCommand");var i8o=["first","second","third","fourth","fifth","sixth"];function Ln(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[MQ(`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 Yp(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=Umn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&Qmn(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=Umn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&Qmn(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(Ln,"argsert");function Umn(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(Umn,"guessType");function Qmn(t,e,r){throw new Yp(`Invalid ${i8o[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(Qmn,"argumentTypeError");var tze=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(Ln(" [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 qmn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(qmn,"commandMiddlewareFactory");function KY(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(Ju(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return Ju(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(KY,"applyMiddleware");p();function JY(t,e,r=n=>{throw n}){try{let n=o8o(t)?t():t;return Ju(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(JY,"maybeAsyncResult");function o8o(t){return typeof t=="function"}a(o8o,"isFunction");var Ple=/(^\*)|(^\$0)/,w9t=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=qmn(s);if(o=o||(()=>{}),Array.isArray(e))if(s8o(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(c8o(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(jmn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=MQ(e);l=l.map(m=>MQ(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>Ple.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(Ple,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 Ju(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(rze(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if(Ju(h))return h.then(m=>(f=Gmn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else a8o(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 Ju(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=Ple.test(r.original)?r.original.replace(Ple,"").trim():r.original,o=e.filter(s=>!Ple.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=JY(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=KY(n,c,l,!1),n=JY(n,f=>{let h=r.handler(f);return Ju(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),Ju(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=KY(n,l,d,!0);return Ju(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=MQ(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=Ple.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(rze(r))return r(e,!0);jmn(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;B_(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();B_(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 Hmn(t,e,r,n){return new w9t(t,e,r,n)}a(Hmn,"command");function jmn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(jmn,"isCommandBuilderDefinition");function s8o(t){return t.every(e=>typeof e=="string")}a(s8o,"isCommandAndAliases");function rze(t){return typeof t=="function"}a(rze,"isCommandBuilderCallback");function a8o(t){return typeof t=="object"}a(a8o,"isCommandBuilderOptionDefinitions");function c8o(t){return typeof t=="object"&&!Array.isArray(t)}a(c8o,"isCommandHandlerDefinition");p();p();function OQ(t={},e=()=>!0){let r={};return kle(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(OQ,"objFilter");p();function LQ(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(LQ,"setBlocking");function l8o(t){return typeof t=="boolean"}a(l8o,"isBoolean");function Vmn(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,O]=typeof B=="string"?[!0,B]:[B,q];return t.getInternalMethods().isGlobalContext()&&(c=O),s=O,l=M,n},"showHelpOnFailFn");let u=!1;n.fail=a(function(B,q){let M=t.getInternalMethods().getLoggerInstance();if(o.length)for(let O=o.length-1;O>=0;--O){let j=o[O];if(l8o(j)){if(q)throw q;if(B)throw Error(B)}else j(B,q,n)}else{if(t.getExitProcess()&&LQ(!0),!u){u=!0,l&&(t.showHelp("error"),M.error()),(B||q)&&M.error(B||q);let O=s||c;O&&((B||q)&&M.error(""),M.error(O))}if(q=q||new Yp(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=(L,B)=>L===null?(f=!0,d=[],n):(f=!1,d.push([L,B||""]),n),n.getUsage=()=>d,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>r("Positionals:");let h=[];n.example=(L,B)=>{h.push([L,B||""])};let m=[];n.command=a(function(B,q,M,O,j=!1){M&&(m=m.map(Q=>(Q[2]=!1,Q))),m.push([B,q||"",M,O,j])},"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=L=>{A.push(L)};let y=!1,E;n.wrap=L=>{y=!0,E=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(E=P(),y=!0),E);let _="__yargsString__:";n.deferY18nLookup=L=>_+L,n.help=a(function(){if(T)return T;b();let B=t.customScriptName?t.$0:e.path.basename(t.$0),q=t.getDemandedOptions(),M=t.getDemandedCommands(),O=t.getDeprecatedOptions(),j=t.getGroups(),Q=t.getOptions(),U=[];U=U.concat(Object.keys(g)),U=U.concat(Object.keys(q)),U=U.concat(Object.keys(M)),U=U.concat(Object.keys(Q.default)),U=U.filter(R),U=Object.keys(U.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=>YFo(n,e,r)).join(` +`)}a(h9t,"wrapAnsi");function m9t(t){return omn(t,{stringWidth:T3,stripAnsi:YY,wrap:h9t})}a(m9t,"ui");p();var wle=require("path"),KWe=require("fs");function g9t(t,e){let r=(0,wle.resolve)(".",t),n;for((0,KWe.statSync)(r).isDirectory()||(r=(0,wle.dirname)(r));;){if(n=e(r,(0,KWe.readdirSync)(r)),n)return(0,wle.resolve)(r,n);if(r=(0,wle.dirname)(n=r),n===r)break}}a(g9t,"default");var Lmn=require("util"),x9t=require("url");p();var bmn=require("util"),eze=require("path");p();function KY(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(JWe,"decamelize");function ZWe(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(ZWe,"looksLikeNumber");p();p();function ymn(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 ue=="number"&&(E.nargs[Z]=ue,E.keys.push(Z))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([Z,ue])=>{typeof ue=="function"&&(E.coercions[Z]=ue,E.keys.push(Z))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(Z){E.configs[Z]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([Z,ue])=>{(typeof ue=="boolean"||typeof ue=="function")&&(E.configs[Z]=ue)})),ie(n.key,c,n.default,E.arrays),Object.keys(u).forEach(function(Z){(E.aliases[Z]||[]).forEach(function(ue){u[ue]=u[Z]})});let b=null;he();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let Z=0;Z=3&&(H(we[1],E.arrays)?Z=D(Z,we[1],o,we[2]):H(we[1],E.nargs)!==!1?Z=P(Z,we[1],o,we[2]):N(we[1],we[2],!0));else if(ue.match(v)&&l["boolean-negation"])we=ue.match(v),we!==null&&Array.isArray(we)&&we.length>=2&&(ce=we[1],N(ce,H(ce,E.arrays)?[!1]:!1));else if(ue.match(/^--.+/)||!l["short-option-groups"]&&ue.match(/^-[^-]+/))we=ue.match(/^--?(.+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(ce=we[1],H(ce,E.arrays)?Z=D(Z,ce,o):H(ce,E.nargs)!==!1?Z=P(Z,ce,o):(Be=o[Z+1],Be!==void 0&&(!Be.match(/^-/)||Be.match(_))&&!H(ce,E.bools)&&!H(ce,E.counts)||/^(true|false)$/.test(Be)?(N(ce,Be),Z++):N(ce,ke(ce))));else if(ue.match(/^-.\..+=/))we=ue.match(/^-([^=]+)=([\s\S]*)$/),we!==null&&Array.isArray(we)&&we.length>=3&&N(we[1],we[2]);else if(ue.match(/^-.\..+/)&&!ue.match(_))Be=o[Z+1],we=ue.match(/^-(.\..+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(ce=we[1],Be!==void 0&&!Be.match(/^-/)&&!H(ce,E.bools)&&!H(ce,E.counts)?(N(ce,Be),Z++):N(ce,ke(ce)));else if(ue.match(/^-[^-]+/)&&!ue.match(_)){Ne=ue.slice(1,-1).split(""),ne=!1;for(let st=0;stZ!=="--"&&Z.includes("-")).forEach(Z=>{delete w[Z]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(Z=>c[Z])).forEach(Z=>{l["camel-case-expansion"]&&Z.includes("-")&&delete w[Z.split(".").map(ue=>KY(ue)).join(".")],delete w[Z]});function x(Z){let ue=q("_",Z);(typeof ue=="string"||typeof ue=="number")&&w._.push(ue)}a(x,"pushPositional");function P(Z,ue,qe,ne){let ce,Ne=H(ue,E.nargs);if(Ne=typeof Ne!="number"||isNaN(Ne)?1:Ne,Ne===0)return K(ne)||(b=Error(y("Argument unexpected for: %s",ue))),N(ue,ke(ue)),Z;let we=K(ne)?0:1;if(l["nargs-eats-options"])qe.length-(Z+1)+we0&&(N(ue,ne),Be--),ce=Z+1;ce0||we&&typeof we=="number"&&ce.length>=we||(Ne=qe[Be],/^-/.test(Ne)&&!_.test(Ne)&&!ge(Ne)));Be++)Z=Be,ce.push(B(ue,Ne,s))}return typeof we=="number"&&(we&&ce.length1&&l["dot-notation"]&&(E.aliases[ce[0]]||[]).forEach(function(Ne){let we=Ne.split("."),Be=[].concat(ce);Be.shift(),we=we.concat(Be),(E.aliases[Z]||[]).includes(we.join("."))||z(w,we,ne)}),H(Z,E.normalize)&&!H(Z,E.arrays)&&[Z].concat(E.aliases[Z]||[]).forEach(function(we){Object.defineProperty(R,we,{enumerable:!0,get(){return ue},set(Be){ue=typeof Be=="string"?I3.normalize(Be):Be}})})}a(N,"setArg");function L(Z,ue){E.aliases[Z]&&E.aliases[Z].length||(E.aliases[Z]=[ue],g[ue]=!0),E.aliases[ue]&&E.aliases[ue].length||L(ue,Z)}a(L,"addNewAlias");function B(Z,ue,qe){qe&&(ue=JFo(ue)),(H(Z,E.bools)||H(Z,E.counts))&&typeof ue=="string"&&(ue=ue==="true");let ne=Array.isArray(ue)?ue.map(function(ce){return q(Z,ce)}):q(Z,ue);return H(Z,E.counts)&&(K(ne)||typeof ne=="boolean")&&(ne=A9t()),H(Z,E.normalize)&&H(Z,E.arrays)&&(Array.isArray(ue)?ne=ue.map(ce=>I3.normalize(ce)):ne=I3.normalize(ue)),ne}a(B,"processValue");function q(Z,ue){return!l["parse-positional-numbers"]&&Z==="_"||!H(Z,E.strings)&&!H(Z,E.bools)&&!Array.isArray(ue)&&(ZWe(ue)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${ue}`)))||!K(ue)&&H(Z,E.numbers))&&(ue=Number(ue)),ue}a(q,"maybeCoerceNumber");function M(Z){let ue=Object.create(null);W(ue,E.aliases,u),Object.keys(E.configs).forEach(function(qe){let ne=Z[qe]||ue[qe];if(ne)try{let ce=null,Ne=I3.resolve(I3.cwd(),ne),we=E.configs[qe];if(typeof we=="function"){try{ce=we(Ne)}catch(Be){ce=Be}if(ce instanceof Error){b=ce;return}}else ce=I3.require(Ne);O(ce)}catch(ce){ce.name==="PermissionDenied"?b=ce:Z[qe]&&(b=Error(y("Invalid JSON config file: %s",ne)))}})}a(M,"setConfig");function O(Z,ue){Object.keys(Z).forEach(function(qe){let ne=Z[qe],ce=ue?ue+"."+qe:qe;typeof ne=="object"&&ne!==null&&!Array.isArray(ne)&&l["dot-notation"]?O(ne,ce):(!V(w,ce.split("."))||H(ce,E.arrays)&&l["combine-arrays"])&&N(ce,ne)})}a(O,"setConfigObject");function j(){typeof d<"u"&&d.forEach(function(Z){O(Z)})}a(j,"setConfigObjects");function Q(Z,ue){if(typeof f>"u")return;let qe=typeof f=="string"?f:"",ne=I3.env();Object.keys(ne).forEach(function(ce){if(qe===""||ce.lastIndexOf(qe,0)===0){let Ne=ce.split("__").map(function(we,Be){return Be===0&&(we=we.substring(qe.length)),KY(we)});(ue&&E.configs[Ne.join(".")]||!ue)&&!V(Z,Ne)&&N(Ne.join("."),ne[ce])}})}a(Q,"applyEnvVars");function U(Z){let ue,qe=new Set;Object.keys(Z).forEach(function(ne){if(!qe.has(ne)&&(ue=H(ne,E.coercions),typeof ue=="function"))try{let ce=q(ne,ue(Z[ne]));[].concat(E.aliases[ne]||[],ne).forEach(Ne=>{qe.add(Ne),Z[Ne]=ce})}catch(ce){b=ce}})}a(U,"applyCoercions");function Y(Z){return E.keys.forEach(ue=>{~ue.indexOf(".")||typeof Z[ue]>"u"&&(Z[ue]=void 0)}),Z}a(Y,"setPlaceholderKeys");function W(Z,ue,qe,ne=!1){Object.keys(qe).forEach(function(ce){V(Z,ce.split("."))||(z(Z,ce.split("."),qe[ce]),ne&&(A[ce]=!0),(ue[ce]||[]).forEach(function(Ne){V(Z,Ne.split("."))||z(Z,Ne.split("."),qe[ce])}))})}a(W,"applyDefaultsAndAliases");function V(Z,ue){let qe=Z;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(ce){qe=qe[ce]||{}});let ne=ue[ue.length-1];return typeof qe!="object"?!1:ne in qe}a(V,"hasKey");function z(Z,ue,qe){let ne=Z;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(rt){rt=Emn(rt),typeof ne=="object"&&ne[rt]===void 0&&(ne[rt]={}),typeof ne[rt]!="object"||Array.isArray(ne[rt])?(Array.isArray(ne[rt])?ne[rt].push({}):ne[rt]=[ne[rt],{}],ne=ne[rt][ne[rt].length-1]):ne=ne[rt]});let ce=Emn(ue[ue.length-1]),Ne=H(ue.join("."),E.arrays),we=Array.isArray(qe),Be=l["duplicate-arguments-array"];!Be&&H(ce,E.nargs)&&(Be=!0,(!K(ne[ce])&&E.nargs[ce]===1||Array.isArray(ne[ce])&&ne[ce].length===E.nargs[ce])&&(ne[ce]=void 0)),qe===A9t()?ne[ce]=A9t(ne[ce]):Array.isArray(ne[ce])?Be&&Ne&&we?ne[ce]=l["flatten-duplicate-arrays"]?ne[ce].concat(qe):(Array.isArray(ne[ce][0])?ne[ce]:[ne[ce]]).concat([qe]):!Be&&!!Ne==!!we?ne[ce]=qe:ne[ce]=ne[ce].concat([qe]):ne[ce]===void 0&&Ne?ne[ce]=we?qe:[qe]:Be&&!(ne[ce]===void 0||H(ce,E.counts)||H(ce,E.bools))?ne[ce]=[ne[ce],qe]:ne[ce]=qe}a(z,"setKey");function ie(...Z){Z.forEach(function(ue){Object.keys(ue||{}).forEach(function(qe){E.aliases[qe]||(E.aliases[qe]=[].concat(c[qe]||[]),E.aliases[qe].concat(qe).forEach(function(ne){if(/-/.test(ne)&&l["camel-case-expansion"]){let ce=KY(ne);ce!==qe&&E.aliases[qe].indexOf(ce)===-1&&(E.aliases[qe].push(ce),g[ce]=!0)}}),E.aliases[qe].concat(qe).forEach(function(ne){if(ne.length>1&&/[A-Z]/.test(ne)&&l["camel-case-expansion"]){let ce=JWe(ne,"-");ce!==qe&&E.aliases[qe].indexOf(ce)===-1&&(E.aliases[qe].push(ce),g[ce]=!0)}}),E.aliases[qe].forEach(function(ne){E.aliases[ne]=[qe].concat(E.aliases[qe].filter(function(ce){return ne!==ce}))}))})})}a(ie,"extendAliases");function H(Z,ue){let qe=[].concat(E.aliases[Z]||[],Z),ne=Object.keys(ue),ce=qe.find(Ne=>ne.includes(Ne));return ce?ue[ce]:!1}a(H,"checkAllAliases");function re(Z){let ue=Object.keys(E);return[].concat(ue.map(ne=>E[ne])).some(function(ne){return Array.isArray(ne)?ne.includes(Z):ne[Z]})}a(re,"hasAnyFlag");function le(Z,...ue){return[].concat(...ue).some(function(ne){let ce=Z.match(ne);return ce&&re(ce[1])})}a(le,"hasFlagsMatching");function Le(Z){if(Z.match(_)||!Z.match(/^-[^-]+/))return!1;let ue=!0,qe,ne=Z.slice(1).split("");for(let ce=0;ceH(Z,E.arrays)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",Z)),!0):H(Z,E.nargs)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",Z)),!0):!1)}return a(he,"checkConfiguration"),{aliases:Object.assign({},E.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:b,newAliases:Object.assign({},g)}}};function KFo(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;oZFo,"env"),format:bmn.format,normalize:eze.normalize,resolve:eze.resolve,require:a(t=>{if(typeof Cmn<"u")return Cmn(t);if(t.match(/\.json$/))return JSON.parse((0,Smn.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),kIe=a(function(e,r){return Tmn.parse(e.slice(),r).argv},"Parser");kIe.detailed=function(t,e){return Tmn.parse(t.slice(),e)};kIe.camelCase=KY;kIe.decamelize=JWe;kIe.looksLikeNumber=ZWe;var Imn=kIe;var LS=require("path");p();function XFo(){return e8o()?0:1}a(XFo,"getProcessArgvBinIndex");function e8o(){return t8o()&&!process.defaultApp}a(e8o,"isBundledElectronApp");function t8o(){return!!process.versions.electron}a(t8o,"isElectronApp");function xmn(){return process.argv[XFo()]}a(xmn,"getProcessArgvBin");p();p();p();function C9t({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(C9t,"ansiRegex");var r8o=C9t();function b9t(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(r8o,"")}a(b9t,"stripAnsi");p();var wmn=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 n8o=new Intl.Segmenter,i8o=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function S9t(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=b9t(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of n8o.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)&&!i8o.test(c)){if(wmn().test(c)){o+=2;continue}o+=WWe(l,s)}}return o}a(S9t,"stringWidth");p();p();var Rle=require("fs"),Rmn=require("util"),kmn=require("path");var Pmn={fs:{readFileSync:Rle.readFileSync,writeFile:Rle.writeFile},format:Rmn.format,resolve:kmn.resolve,exists:a(t=>{try{return(0,Rle.statSync)(t).isFile()}catch{return!1}},"exists")};p();var NP,T9t=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(),NP.format.apply(NP.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),NP.format.apply(NP.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);NP.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{NP.fs.readFileSync&&(e=JSON.parse(NP.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=NP.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=NP.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return NP.exists(e)}};function Dmn(t,e){NP=e;let r=new T9t(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(Dmn,"y18n");var o8o=a(t=>Dmn(t,Pmn),"y18n"),Nmn=o8o;var Bmn=require("node:module"),Fmn=de(Omn(),1),rze=require("node:fs");var I9t=(0,x9t.fileURLToPath)(importMetaUrlShim),s8o=I9t.substring(0,I9t.lastIndexOf("node_modules")),a8o=(0,Bmn.createRequire)(importMetaUrlShim),Umn={assert:{notStrictEqual:tze.notStrictEqual,strictEqual:tze.strictEqual},cliui:m9t,findUp:g9t,getEnv:a(t=>process.env[t],"getEnv"),inspect:Lmn.inspect,getProcessArgvBin:xmn,mainFilename:s8o||process.cwd(),Parser:Imn,path:{basename:LS.basename,dirname:LS.dirname,extname:LS.extname,relative:LS.relative,resolve:LS.resolve,join:LS.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:rze.readFileSync,readdirSync:rze.readdirSync,require:a8o,getCallerFile:a(()=>{let t=(0,Fmn.default)(3);return t.match(/^file:\/\//)?(0,x9t.fileURLToPath)(t):t},"getCallerFile"),stringWidth:S9t,y18n:Nmn({directory:(0,LS.resolve)(I9t,"../../../locales"),updateFiles:!1})};p();p();p();function B_(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(B_,"assertNotStrictEqual");function w9t(t,e){e.assert.strictEqual(typeof t,"string")}a(w9t,"assertSingleKey");function kle(t){return Object.keys(t)}a(kle,"objectKeys");p();function Ju(t){return!!t&&!!t.then&&typeof t.then=="function"}a(Ju,"isPromise");p();p();p();var Yp=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 OQ(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(OQ,"parseCommand");var c8o=["first","second","third","fourth","fifth","sixth"];function Ln(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[OQ(`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 Yp(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=Qmn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&qmn(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=Qmn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&qmn(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(Ln,"argsert");function Qmn(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(Qmn,"guessType");function qmn(t,e,r){throw new Yp(`Invalid ${c8o[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(qmn,"argumentTypeError");var nze=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(Ln(" [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 jmn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(jmn,"commandMiddlewareFactory");function JY(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(Ju(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return Ju(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(JY,"applyMiddleware");p();function ZY(t,e,r=n=>{throw n}){try{let n=l8o(t)?t():t;return Ju(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(ZY,"maybeAsyncResult");function l8o(t){return typeof t=="function"}a(l8o,"isFunction");var Ple=/(^\*)|(^\$0)/,R9t=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=jmn(s);if(o=o||(()=>{}),Array.isArray(e))if(u8o(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(f8o(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(Hmn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=OQ(e);l=l.map(m=>OQ(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>Ple.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(Ple,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 Ju(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(ize(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if(Ju(h))return h.then(m=>(f=$mn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else d8o(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 Ju(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=Ple.test(r.original)?r.original.replace(Ple,"").trim():r.original,o=e.filter(s=>!Ple.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=ZY(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=JY(n,c,l,!1),n=ZY(n,f=>{let h=r.handler(f);return Ju(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),Ju(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=JY(n,l,d,!0);return Ju(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=OQ(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=Ple.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(ize(r))return r(e,!0);Hmn(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;B_(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();B_(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 Gmn(t,e,r,n){return new R9t(t,e,r,n)}a(Gmn,"command");function Hmn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(Hmn,"isCommandBuilderDefinition");function u8o(t){return t.every(e=>typeof e=="string")}a(u8o,"isCommandAndAliases");function ize(t){return typeof t=="function"}a(ize,"isCommandBuilderCallback");function d8o(t){return typeof t=="object"}a(d8o,"isCommandBuilderOptionDefinitions");function f8o(t){return typeof t=="object"&&!Array.isArray(t)}a(f8o,"isCommandHandlerDefinition");p();p();function LQ(t={},e=()=>!0){let r={};return kle(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(LQ,"objFilter");p();function BQ(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(BQ,"setBlocking");function p8o(t){return typeof t=="boolean"}a(p8o,"isBoolean");function Wmn(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,O]=typeof B=="string"?[!0,B]:[B,q];return t.getInternalMethods().isGlobalContext()&&(c=O),s=O,l=M,n},"showHelpOnFailFn");let u=!1;n.fail=a(function(B,q){let M=t.getInternalMethods().getLoggerInstance();if(o.length)for(let O=o.length-1;O>=0;--O){let j=o[O];if(p8o(j)){if(q)throw q;if(B)throw Error(B)}else j(B,q,n)}else{if(t.getExitProcess()&&BQ(!0),!u){u=!0,l&&(t.showHelp("error"),M.error()),(B||q)&&M.error(B||q);let O=s||c;O&&((B||q)&&M.error(""),M.error(O))}if(q=q||new Yp(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=(L,B)=>L===null?(f=!0,d=[],n):(f=!1,d.push([L,B||""]),n),n.getUsage=()=>d,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>r("Positionals:");let h=[];n.example=(L,B)=>{h.push([L,B||""])};let m=[];n.command=a(function(B,q,M,O,j=!1){M&&(m=m.map(Q=>(Q[2]=!1,Q))),m.push([B,q||"",M,O,j])},"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=L=>{A.push(L)};let y=!1,E;n.wrap=L=>{y=!0,E=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(E=P(),y=!0),E);let _="__yargsString__:";n.deferY18nLookup=L=>_+L,n.help=a(function(){if(T)return T;b();let B=t.customScriptName?t.$0:e.path.basename(t.$0),q=t.getDemandedOptions(),M=t.getDemandedCommands(),O=t.getDeprecatedOptions(),j=t.getGroups(),Q=t.getOptions(),U=[];U=U.concat(Object.keys(g)),U=U.concat(Object.keys(q)),U=U.concat(Object.keys(M)),U=U.concat(Object.keys(Q.default)),U=U.filter(R),U=Object.keys(U.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((Ue,ke)=>Ue[0].localeCompare(ke[0])));let ge=B?`${B} `:"";m.forEach(Ue=>{let ke=`${ge}${Le}${Ue[0].replace(/^\$0 ?/,"")}`;W.span({text:ke,padding:[0,2,0,2],width:v(m,Y,`${B}${Le}`)+4},{text:Ue[1]});let X=[];Ue[2]&&X.push(`[${r("default")}]`),Ue[3]&&Ue[3].length&&X.push(`[${r("aliases:")} ${Ue[3].join(", ")}]`),Ue[4]&&(typeof Ue[4]=="string"?X.push(`[${r("deprecated: %s",Ue[4])}]`):X.push(`[${r("deprecated")}]`)),X.length?W.div({text:X.join(" "),padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}let V=(Object.keys(Q.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);U=U.filter(le=>!t.parsed.newAliases[le]&&V.every(Le=>(Q.alias[Le]||[]).indexOf(le)===-1));let z=r("Options:");j[z]||(j[z]=[]),w(U,Q.alias,j,z);let ie=a(le=>/^--/.test(nze(le)),"isLongSwitch"),H=Object.keys(j).filter(le=>j[le].length>0).map(le=>{let Le=j[le].filter(R).map(ge=>{if(V.includes(ge))return ge;for(let Ue=0,ke;(ke=V[Ue])!==void 0;Ue++)if((Q.alias[ke]||[]).includes(ge))return ke;return ge});return{groupName:le,normalizedKeys:Le}}).filter(({normalizedKeys:le})=>le.length>0).map(({groupName:le,normalizedKeys:Le})=>{let ge=Le.reduce((Ue,ke)=>(Ue[ke]=[ke].concat(Q.alias[ke]||[]).map(X=>le===n.getPositionalGroupName()?X:(/^[0-9]$/.test(X)?Q.boolean.includes(ke)?"-":"--":X.length>1?"--":"-")+X).sort((X,ee)=>ie(X)===ie(ee)?0:ie(X)?1:-1).join(", "),Ue),{});return{groupName:le,normalizedKeys:Le,switches:ge}});if(H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).some(({normalizedKeys:le,switches:Le})=>!le.every(ge=>ie(Le[ge])))&&H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).forEach(({normalizedKeys:le,switches:Le})=>{le.forEach(ge=>{ie(Le[ge])&&(Le[ge]=u8o(Le[ge],4))})}),H.forEach(({groupName:le,normalizedKeys:Le,switches:ge})=>{W.div(le),Le.forEach(Ue=>{let ke=ge[Ue],X=g[Ue]||"",ee=null;X.includes(_)&&(X=r(X.substring(_.length))),Q.boolean.includes(Ue)&&(ee=`[${r("boolean")}]`),Q.count.includes(Ue)&&(ee=`[${r("count")}]`),Q.string.includes(Ue)&&(ee=`[${r("string")}]`),Q.normalize.includes(Ue)&&(ee=`[${r("string")}]`),Q.array.includes(Ue)&&(ee=`[${r("array")}]`),Q.number.includes(Ue)&&(ee=`[${r("number")}]`);let K=a(ue=>typeof ue=="string"?`[${r("deprecated: %s",ue)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),he=[Ue in O?K(O[Ue]):null,ee,Ue in q?`[${r("required")}]`:null,Q.choices&&Q.choices[Ue]?`[${r("choices:")} ${n.stringifiedValues(Q.choices[Ue])}]`:null,x(Q.default[Ue],Q.defaultDescription[Ue])].filter(Boolean).join(" ");W.span({text:nze(ke),padding:[0,2,0,2+$mn(ke)],width:v(ge,Y)+4},X);let Z=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;he&&!Z?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((Ue,ke)=>Ue[0].localeCompare(ke[0])));let ge=B?`${B} `:"";m.forEach(Ue=>{let ke=`${ge}${Le}${Ue[0].replace(/^\$0 ?/,"")}`;W.span({text:ke,padding:[0,2,0,2],width:v(m,Y,`${B}${Le}`)+4},{text:Ue[1]});let X=[];Ue[2]&&X.push(`[${r("default")}]`),Ue[3]&&Ue[3].length&&X.push(`[${r("aliases:")} ${Ue[3].join(", ")}]`),Ue[4]&&(typeof Ue[4]=="string"?X.push(`[${r("deprecated: %s",Ue[4])}]`):X.push(`[${r("deprecated")}]`)),X.length?W.div({text:X.join(" "),padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}let V=(Object.keys(Q.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);U=U.filter(le=>!t.parsed.newAliases[le]&&V.every(Le=>(Q.alias[Le]||[]).indexOf(le)===-1));let z=r("Options:");j[z]||(j[z]=[]),w(U,Q.alias,j,z);let ie=a(le=>/^--/.test(oze(le)),"isLongSwitch"),H=Object.keys(j).filter(le=>j[le].length>0).map(le=>{let Le=j[le].filter(R).map(ge=>{if(V.includes(ge))return ge;for(let Ue=0,ke;(ke=V[Ue])!==void 0;Ue++)if((Q.alias[ke]||[]).includes(ge))return ke;return ge});return{groupName:le,normalizedKeys:Le}}).filter(({normalizedKeys:le})=>le.length>0).map(({groupName:le,normalizedKeys:Le})=>{let ge=Le.reduce((Ue,ke)=>(Ue[ke]=[ke].concat(Q.alias[ke]||[]).map(X=>le===n.getPositionalGroupName()?X:(/^[0-9]$/.test(X)?Q.boolean.includes(ke)?"-":"--":X.length>1?"--":"-")+X).sort((X,ee)=>ie(X)===ie(ee)?0:ie(X)?1:-1).join(", "),Ue),{});return{groupName:le,normalizedKeys:Le,switches:ge}});if(H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).some(({normalizedKeys:le,switches:Le})=>!le.every(ge=>ie(Le[ge])))&&H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).forEach(({normalizedKeys:le,switches:Le})=>{le.forEach(ge=>{ie(Le[ge])&&(Le[ge]=h8o(Le[ge],4))})}),H.forEach(({groupName:le,normalizedKeys:Le,switches:ge})=>{W.div(le),Le.forEach(Ue=>{let ke=ge[Ue],X=g[Ue]||"",ee=null;X.includes(_)&&(X=r(X.substring(_.length))),Q.boolean.includes(Ue)&&(ee=`[${r("boolean")}]`),Q.count.includes(Ue)&&(ee=`[${r("count")}]`),Q.string.includes(Ue)&&(ee=`[${r("string")}]`),Q.normalize.includes(Ue)&&(ee=`[${r("string")}]`),Q.array.includes(Ue)&&(ee=`[${r("array")}]`),Q.number.includes(Ue)&&(ee=`[${r("number")}]`);let K=a(ue=>typeof ue=="string"?`[${r("deprecated: %s",ue)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),he=[Ue in O?K(O[Ue]):null,ee,Ue in q?`[${r("required")}]`:null,Q.choices&&Q.choices[Ue]?`[${r("choices:")} ${n.stringifiedValues(Q.choices[Ue])}]`:null,x(Q.default[Ue],Q.defaultDescription[Ue])].filter(Boolean).join(" ");W.span({text:oze(ke),padding:[0,2,0,2+Vmn(ke)],width:v(ge,Y)+4},X);let Z=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;he&&!Z?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(L,B,q){let M=0;return Array.isArray(L)||(L=Object.values(L).map(O=>[O])),L.forEach(O=>{M=Math.max(e.stringWidth(q?`${q} ${nze(O[0])}`:nze(O[0]))+$mn(O[0]),M)}),B&&(M=Math.min(M,parseInt((B*.5).toString(),10))),M}a(v,"maxWidth");function b(){let L=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 L&&t.demandOption(q,L[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(b,"normalizeAliases");let T;n.cacheHelpMessage=function(){T=this.help()},n.clearCachedHelpMessage=function(){T=void 0},n.hasCachedHelpMessage=function(){return!!T};function w(L,B,q,M){let O=[],j=null;return Object.keys(q).forEach(Q=>{O=O.concat(q[Q])}),L.forEach(Q=>{j=[Q].concat(B[Q]),j.some(U=>O.indexOf(U)!==-1)||q[M].push(Q)}),O}a(w,"addUngroupedKeys");function R(L){return t.getOptions().hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}a(R,"filterHiddenOptions"),n.showHelp=L=>{let B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=a(function(B,q){let M="",O=q||", ",j=[].concat(B);return!B||!j.length||j.forEach(Q=>{M.length&&(M+=O),M+=JSON.stringify(Q)}),M},"stringifiedValues");function x(L,B){let q=`[${r("default:")} `;if(L===void 0&&!B)return null;if(B)q+=B;else switch(typeof L){case"string":q+=`"${L}"`;break;case"object":q+=JSON.stringify(L);break;default:q+=L}return`${q}]`}a(x,"defaultString");function P(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(P,"windowWidth");let D=null;n.version=L=>{D=L},n.showVersion=L=>{let B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(D)},n.reset=a(function(B){return s=null,u=!1,d=[],f=!1,A=[],h=[],m=[],g=OQ(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(Vmn,"usage");function R9t(t){return typeof t=="object"}a(R9t,"isIndentedText");function u8o(t,e){return R9t(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(u8o,"addIndentation");function $mn(t){return R9t(t)?t.indentation:0}a($mn,"getIndentation");function nze(t){return R9t(t)?t.text:t}a(nze,"getText");p();p();var Wmn=`###-begin-{{app_name}}-completions-### +`)}return W.toString().replace(/\s*$/,"")},"help");function v(L,B,q){let M=0;return Array.isArray(L)||(L=Object.values(L).map(O=>[O])),L.forEach(O=>{M=Math.max(e.stringWidth(q?`${q} ${oze(O[0])}`:oze(O[0]))+Vmn(O[0]),M)}),B&&(M=Math.min(M,parseInt((B*.5).toString(),10))),M}a(v,"maxWidth");function b(){let L=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 L&&t.demandOption(q,L[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(b,"normalizeAliases");let T;n.cacheHelpMessage=function(){T=this.help()},n.clearCachedHelpMessage=function(){T=void 0},n.hasCachedHelpMessage=function(){return!!T};function w(L,B,q,M){let O=[],j=null;return Object.keys(q).forEach(Q=>{O=O.concat(q[Q])}),L.forEach(Q=>{j=[Q].concat(B[Q]),j.some(U=>O.indexOf(U)!==-1)||q[M].push(Q)}),O}a(w,"addUngroupedKeys");function R(L){return t.getOptions().hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}a(R,"filterHiddenOptions"),n.showHelp=L=>{let B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=a(function(B,q){let M="",O=q||", ",j=[].concat(B);return!B||!j.length||j.forEach(Q=>{M.length&&(M+=O),M+=JSON.stringify(Q)}),M},"stringifiedValues");function x(L,B){let q=`[${r("default:")} `;if(L===void 0&&!B)return null;if(B)q+=B;else switch(typeof L){case"string":q+=`"${L}"`;break;case"object":q+=JSON.stringify(L);break;default:q+=L}return`${q}]`}a(x,"defaultString");function P(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(P,"windowWidth");let D=null;n.version=L=>{D=L},n.showVersion=L=>{let B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(D)},n.reset=a(function(B){return s=null,u=!1,d=[],f=!1,A=[],h=[],m=[],g=LQ(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(Wmn,"usage");function k9t(t){return typeof t=="object"}a(k9t,"isIndentedText");function h8o(t,e){return k9t(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(h8o,"addIndentation");function Vmn(t){return k9t(t)?t.indentation:0}a(Vmn,"getIndentation");function oze(t){return k9t(t)?t.text:t}a(oze,"getText");p();p();var zmn=`###-begin-{{app_name}}-completions-### # # yargs command completion script # @@ -2300,7 +2300,7 @@ _{{app_name}}_yargs_completions() } complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} ###-end-{{app_name}}-completions-### -`,zmn=`#compdef {{app_name}} +`,Ymn=`#compdef {{app_name}} ###-begin-{{app_name}}-completions-### # # yargs command completion script @@ -2327,22 +2327,22 @@ else compdef _{{app_name}}_yargs_completions {{app_name}} fi ###-end-{{app_name}}-completions-### -`;var k9t=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=MQ(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(_=>{let v=g[_];return typeof v=="string"&&v.length>0}),y=A?g[A]:void 0,E=(u=(l=g[e])!==null&&l!==void 0?l:y)!==null&&u!==void 0?u:"";d=`${e.replace(/:/g,"\\:")}:${E.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(B_(this.customCompletionFunction,null,this.shim),f8o(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return Ju(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 p8o(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 Ju(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?zmn:Wmn,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 Ymn(t,e,r,n){return new k9t(t,e,r,n)}a(Ymn,"completion");function f8o(t){return t.length<3}a(f8o,"isSyncCompletionFunction");function p8o(t){return t.length>3}a(p8o,"isFallbackCompletionFunction");p();p();function Kmn(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(Kmn,"levenshtein");var Jmn=["$0","--","_"];function Zmn(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 E of Object.keys(g)){let _=g[E];_&&A.indexOf(_)<0&&A.push(_)}let y=A.length?` +`;var P9t=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=OQ(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(_=>{let v=g[_];return typeof v=="string"&&v.length>0}),y=A?g[A]:void 0,E=(u=(l=g[e])!==null&&l!==void 0?l:y)!==null&&u!==void 0?u:"";d=`${e.replace(/:/g,"\\:")}:${E.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(B_(this.customCompletionFunction,null,this.shim),g8o(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return Ju(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 A8o(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 Ju(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?Ymn:zmn,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 Kmn(t,e,r,n){return new P9t(t,e,r,n)}a(Kmn,"completion");function g8o(t){return t.length<3}a(g8o,"isSyncCompletionFunction");function A8o(t){return t.length>3}a(A8o,"isFallbackCompletionFunction");p();p();function Jmn(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(Jmn,"levenshtein");var Zmn=["$0","--","_"];function Xmn(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 E of Object.keys(g)){let _=g[E];_&&A.indexOf(_)<0&&A.push(_)}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 E;let _=t.getInternalMethods().getCommandInstance().getCommands(),v=[],b=t.getInternalMethods().getContext();if(Object.keys(h).forEach(T=>{!Jmn.includes(T)&&!Object.prototype.hasOwnProperty.call(g,T)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),T)&&!s.isValidAndSomeAliasIsNotNew(T,m)&&v.push(T)}),y&&(b.commands.length>0||_.length>0||A)&&h._.slice(b.commands.length).forEach(T=>{_.includes(""+T)||v.push(""+T)}),y){let w=((E=t.getDemandedCommands()._)===null||E===void 0?void 0:E.max)||0,R=b.commands.length+w;R{x=String(x),!b.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(E=>{Jmn.indexOf(E)===-1&&Object.prototype.hasOwnProperty.call(m.choices,E)&&[].concat(h[E]).forEach(_=>{m.choices[E].indexOf(_)===-1&&_!==void 0&&(g[E]=(g[E]||[]).concat(_))})});let A=Object.keys(g);if(!A.length)return;let y=n("Invalid values:");A.forEach(E=>{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 E;let _=t.getInternalMethods().getCommandInstance().getCommands(),v=[],b=t.getInternalMethods().getContext();if(Object.keys(h).forEach(T=>{!Zmn.includes(T)&&!Object.prototype.hasOwnProperty.call(g,T)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),T)&&!s.isValidAndSomeAliasIsNotNew(T,m)&&v.push(T)}),y&&(b.commands.length>0||_.length>0||A)&&h._.slice(b.commands.length).forEach(T=>{_.includes(""+T)||v.push(""+T)}),y){let w=((E=t.getDemandedCommands()._)===null||E===void 0?void 0:E.max)||0,R=b.commands.length+w;R{x=String(x),!b.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(E=>{Zmn.indexOf(E)===-1&&Object.prototype.hasOwnProperty.call(m.choices,E)&&[].concat(h[E]).forEach(_=>{m.choices[E].indexOf(_)===-1&&_!==void 0&&(g[E]=(g[E]||[]).concat(_))})});let A=Object.keys(g);if(!A.length)return;let y=n("Invalid values:");A.forEach(E=>{y+=` ${n("Argument: %s, Given: %s, Choices: %s",E,e.stringifiedValues(g[E]),e.stringifiedValues(m.choices[E]))}`}),e.fail(y)},"limitedChoices");let c={};s.implies=a(function(h,m){Ln(" [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)):(B_(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 E=A,_=y;E=l(h,E),y=l(h,y),E&&!y&&m.push(` ${A} -> ${_}`)})}),m.length){let g=`${n("Implications failed:")} -`;m.forEach(A=>{g+=A}),e.fail(g)}},"implications");let u={};s.conflicts=a(function(h,m){Ln(" [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,_)=>_.length-E.length);let A=null,y=1/0;for(let E=0,_;(_=m[E])!==void 0;E++){let v=Kmn(h,_);v<=3&&v!h[m]),u=OQ(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();B_(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(Zmn,"validation");p();var g8o={};var P9t=[],kIe;function ize(t,e,r,n){kIe=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=m8o(e,t.extends);else try{c=g8o.resolve(t.extends)}catch{return t}h8o(c),P9t.push(c),o=s?JSON.parse(kIe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=ize(o,kIe.path.dirname(c),r,kIe)}return P9t=[],r?Xmn(o,t):Object.assign({},o,t)}a(ize,"applyExtends");function h8o(t){if(P9t.indexOf(t)>-1)throw new Yp(`Circular extended configurations: '${t}'.`)}a(h8o,"checkForCircularExtends");function m8o(t,e){return kIe.path.resolve(t,e)}a(m8o,"getPathToDefaultConfig");function Xmn(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))n(e[o])&&n(r[o])?r[o]=Xmn(t[o],e[o]):r[o]=e[o];return r}a(Xmn,"mergeDeep");var Bn=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},Pe=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)},Kp,ZY,PIe,NC,LS,oze,BQ,XY,sze,Hx,aze,Gx,sO,BS,$x,cze,eK,cg,ni,lze,uze,FS,tK,Dle,rK,FQ,dze,Yi,nK,iK,oK,go,fze,aO,Zf;function E0n(t){return(e=[],r=t.process.cwd(),n)=>{let o=new j9t(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(E0n,"YargsFactory");var e0n=Symbol("copyDoubleDash"),t0n=Symbol("copyDoubleDash"),D9t=Symbol("deleteFromParserHintObject"),r0n=Symbol("emitWarning"),n0n=Symbol("freeze"),i0n=Symbol("getDollarZero"),sK=Symbol("getParserConfiguration"),o0n=Symbol("getUsageConfiguration"),N9t=Symbol("guessLocale"),s0n=Symbol("guessVersion"),a0n=Symbol("parsePositionalNumbers"),M9t=Symbol("pkgUp"),UQ=Symbol("populateParserHintArray"),Nle=Symbol("populateParserHintSingleValueDictionary"),O9t=Symbol("populateParserHintArrayDictionary"),L9t=Symbol("populateParserHintDictionary"),B9t=Symbol("sanitizeKey"),F9t=Symbol("setKey"),U9t=Symbol("unfreeze"),c0n=Symbol("validateAsync"),l0n=Symbol("getCommandInstance"),u0n=Symbol("getContext"),d0n=Symbol("getHasOutput"),f0n=Symbol("getLoggerInstance"),p0n=Symbol("getParseContext"),h0n=Symbol("getUsageInstance"),m0n=Symbol("getValidationInstance"),pze=Symbol("hasParseCallback"),g0n=Symbol("isGlobalContext"),aK=Symbol("postProcess"),A0n=Symbol("rebase"),Q9t=Symbol("reset"),DIe=Symbol("runYargsParserAndExecuteCommands"),q9t=Symbol("runValidation"),y0n=Symbol("setHasOutput"),cK=Symbol("kTrackManuallySetKeys"),A8o="en_US",j9t=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,Kp.set(this,void 0),ZY.set(this,void 0),PIe.set(this,{commands:[],fullCommands:[]}),NC.set(this,null),LS.set(this,null),oze.set(this,"show-hidden"),BQ.set(this,null),XY.set(this,!0),sze.set(this,{}),Hx.set(this,!0),aze.set(this,[]),Gx.set(this,void 0),sO.set(this,{}),BS.set(this,!1),$x.set(this,null),cze.set(this,!0),eK.set(this,void 0),cg.set(this,""),ni.set(this,void 0),lze.set(this,void 0),uze.set(this,{}),FS.set(this,null),tK.set(this,null),Dle.set(this,{}),rK.set(this,{}),FQ.set(this,void 0),dze.set(this,!1),Yi.set(this,void 0),nK.set(this,!1),iK.set(this,!1),oK.set(this,!1),go.set(this,void 0),fze.set(this,{}),aO.set(this,null),Zf.set(this,void 0),Bn(this,Yi,o,"f"),Bn(this,FQ,e,"f"),Bn(this,ZY,r,"f"),Bn(this,lze,n,"f"),Bn(this,Gx,new tze(this),"f"),this.$0=this[i0n](),this[Q9t](),Bn(this,Kp,Pe(this,Kp,"f"),"f"),Bn(this,go,Pe(this,go,"f"),"f"),Bn(this,Zf,Pe(this,Zf,"f"),"f"),Bn(this,ni,Pe(this,ni,"f"),"f"),Pe(this,ni,"f").showHiddenOpt=Pe(this,oze,"f"),Bn(this,eK,this[t0n](),"f"),Pe(this,Yi,"f").y18n.setLocale(A8o)}addHelpOpt(e,r){let n="help";return Ln("[string|boolean] [string]",[e,r],arguments.length),Pe(this,$x,"f")&&(this[D9t](Pe(this,$x,"f")),Bn(this,$x,null,"f")),e===!1&&r===void 0?this:(Bn(this,$x,typeof e=="string"?e:n,"f"),this.boolean(Pe(this,$x,"f")),this.describe(Pe(this,$x,"f"),r||Pe(this,go,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(Ln("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:Pe(this,oze,"f");return this.boolean(n),this.describe(n,r||Pe(this,go,"f").deferY18nLookup("Show hidden options")),Pe(this,ni,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[O9t](this.alias.bind(this),"alias",e,r),this}array(e){return Ln("",[e],arguments.length),this[UQ]("array",e),this[cK](e),this}boolean(e){return Ln("",[e],arguments.length),this[UQ]("boolean",e),this[cK](e),this}check(e,r){return Ln(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>JY(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&Pe(this,go,"f").fail(s.toString(),s):Pe(this,go,"f").fail(Pe(this,Yi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(Pe(this,go,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[O9t](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(Ln(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Yp("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 Yp("coerce callback must be provided");let n=e;return Pe(this,ni,"f").key[n]=!0,Pe(this,Gx,"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:JY(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new Yp(d.message)})},n),this}conflicts(e,r){return Ln(" [string|array]",[e,r],arguments.length),Pe(this,Zf,"f").conflicts(e,r),this}config(e="config",r,n){return Ln("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=ize(e,Pe(this,ZY,"f"),this[sK]()["deep-merge-config"]||!1,Pe(this,Yi,"f")),Pe(this,ni,"f").configObjects=(Pe(this,ni,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||Pe(this,go,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{Pe(this,ni,"f").config[o]=n||!0}),this)}completion(e,r,n){return Ln("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Bn(this,LS,e||Pe(this,LS,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(Pe(this,LS,"f"),r),n&&Pe(this,NC,"f").registerFunction(n),this}command(e,r,n,o,s,c){return Ln(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),Pe(this,Kp,"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){Ln(" [object]",[e,r],arguments.length);let n=Pe(this,lze,"f")||Pe(this,Yi,"f").require;return Pe(this,Kp,"f").addDirectory(e,n,Pe(this,Yi,"f").getCallerFile(),r),this}count(e){return Ln("",[e],arguments.length),this[UQ]("count",e),this[cK](e),this}default(e,r,n){return Ln(" [*] [string]",[e,r,n],arguments.length),n&&(x9t(e,Pe(this,Yi,"f")),Pe(this,ni,"f").defaultDescription[e]=n),typeof r=="function"&&(x9t(e,Pe(this,Yi,"f")),Pe(this,ni,"f").defaultDescription[e]||(Pe(this,ni,"f").defaultDescription[e]=Pe(this,go,"f").functionDescription(r)),r=r.call()),this[Nle](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 Ln("[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),Pe(this,ni,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{B_(n,!0,Pe(this,Yi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(B_(n,!0,Pe(this,Yi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{B_(n,!0,Pe(this,Yi,"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 Ln(" [string]",[e,r],arguments.length),this[Nle](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return Ln(" [string|boolean]",[e,r],arguments.length),Pe(this,ni,"f").deprecatedOptions[e]=r,this}describe(e,r){return Ln(" [string]",[e,r],arguments.length),this[F9t](e,!0),Pe(this,go,"f").describe(e,r),this}detectLocale(e){return Ln("",[e],arguments.length),Bn(this,XY,e,"f"),this}env(e){return Ln("[string|boolean]",[e],arguments.length),e===!1?delete Pe(this,ni,"f").envPrefix:Pe(this,ni,"f").envPrefix=e||"",this}epilogue(e){return Ln("",[e],arguments.length),Pe(this,go,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return Ln(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):Pe(this,go,"f").example(e,r),this}exit(e,r){Bn(this,BS,!0,"f"),Bn(this,BQ,r,"f"),Pe(this,Hx,"f")&&Pe(this,Yi,"f").process.exit(e)}exitProcess(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,Hx,e,"f"),this}fail(e){if(Ln("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Yp("Invalid first argument. Expected function or boolean 'false'");return Pe(this,go,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return Ln(" [function]",[e,r],arguments.length),r?Pe(this,NC,"f").getCompletion(e,r):new Promise((n,o)=>{Pe(this,NC,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return Ln([],0),Pe(this,ni,"f").demandedOptions}getDemandedCommands(){return Ln([],0),Pe(this,ni,"f").demandedCommands}getDeprecatedOptions(){return Ln([],0),Pe(this,ni,"f").deprecatedOptions}getDetectLocale(){return Pe(this,XY,"f")}getExitProcess(){return Pe(this,Hx,"f")}getGroups(){return Object.assign({},Pe(this,sO,"f"),Pe(this,rK,"f"))}getHelp(){if(Bn(this,BS,!0,"f"),!Pe(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[DIe](Pe(this,FQ,"f"),void 0,void 0,0,!0);if(Ju(r))return r.then(()=>Pe(this,go,"f").help())}let e=Pe(this,Kp,"f").runDefaultBuilderOn(this);if(Ju(e))return e.then(()=>Pe(this,go,"f").help())}return Promise.resolve(Pe(this,go,"f").help())}getOptions(){return Pe(this,ni,"f")}getStrict(){return Pe(this,nK,"f")}getStrictCommands(){return Pe(this,iK,"f")}getStrictOptions(){return Pe(this,oK,"f")}global(e,r){return Ln(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?Pe(this,ni,"f").local=Pe(this,ni,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{Pe(this,ni,"f").local.includes(n)||Pe(this,ni,"f").local.push(n)}),this}group(e,r){Ln(" ",[e,r],arguments.length);let n=Pe(this,rK,"f")[r]||Pe(this,sO,"f")[r];Pe(this,rK,"f")[r]&&delete Pe(this,rK,"f")[r];let o={};return Pe(this,sO,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return Ln("",[e],arguments.length),Pe(this,ni,"f").hiddenOptions.push(e),this}implies(e,r){return Ln(" [number|string|array]",[e,r],arguments.length),Pe(this,Zf,"f").implies(e,r),this}locale(e){return Ln("[string]",[e],arguments.length),e===void 0?(this[N9t](),Pe(this,Yi,"f").y18n.getLocale()):(Bn(this,XY,!1,"f"),Pe(this,Yi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return Pe(this,Gx,"f").addMiddleware(e,!!r,n)}nargs(e,r){return Ln(" [number]",[e,r],arguments.length),this[Nle](this.nargs.bind(this),"narg",e,r),this}normalize(e){return Ln("",[e],arguments.length),this[UQ]("normalize",e),this}number(e){return Ln("",[e],arguments.length),this[UQ]("number",e),this[cK](e),this}option(e,r){if(Ln(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[cK](e),Pe(this,aO,"f")&&(e==="version"||r?.alias==="version")&&this[r0n](['"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"),Pe(this,ni,"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&&(Pe(this,ni,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=Pe(this,go,"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){Ln("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[n0n](),typeof e>"u"&&(e=Pe(this,FQ,"f")),typeof r=="object"&&(Bn(this,tK,r,"f"),r=n),typeof r=="function"&&(Bn(this,FS,r,"f"),r=!1),r||Bn(this,FQ,e,"f"),Pe(this,FS,"f")&&Bn(this,Hx,!1,"f");let o=this[DIe](e,!!r),s=this.parsed;return Pe(this,NC,"f").setParsed(this.parsed),Ju(o)?o.then(c=>(Pe(this,FS,"f")&&Pe(this,FS,"f").call(this,Pe(this,BQ,"f"),c,Pe(this,cg,"f")),c)).catch(c=>{throw Pe(this,FS,"f")&&Pe(this,FS,"f")(c,this.parsed.argv,Pe(this,cg,"f")),c}).finally(()=>{this[U9t](),this.parsed=s}):(Pe(this,FS,"f")&&Pe(this,FS,"f").call(this,Pe(this,BQ,"f"),o,Pe(this,cg,"f")),this[U9t](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return Ju(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if(Ju(o))throw new Yp(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return Ln("",[e],arguments.length),Bn(this,uze,e,"f"),this}pkgConf(e,r){Ln(" [string]",[e,r],arguments.length);let n=null,o=this[M9t](r||Pe(this,ZY,"f"));return o[e]&&typeof o[e]=="object"&&(n=ize(o[e],r||Pe(this,ZY,"f"),this[sK]()["deep-merge-config"]||!1,Pe(this,Yi,"f")),Pe(this,ni,"f").configObjects=(Pe(this,ni,"f").configObjects||[]).concat(n)),this}positional(e,r){Ln(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=OQ(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=Pe(this,PIe,"f").fullCommands[Pe(this,PIe,"f").fullCommands.length-1],s=o?Pe(this,Kp,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return kle(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,Pe(this,go,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,dze,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 Ln(" [number]",[e],arguments.length),typeof e=="string"&&Pe(this,ni,"f").narg[e]?this:(this[Nle](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return Ln("[string] [string]",[e,r],arguments.length),e=e||this.$0,Pe(this,eK,"f").log(Pe(this,NC,"f").generateCompletionScript(e,r||Pe(this,LS,"f")||"completion")),this}showHelp(e){if(Ln("[string|function]",[e],arguments.length),Bn(this,BS,!0,"f"),!Pe(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[DIe](Pe(this,FQ,"f"),void 0,void 0,0,!0);if(Ju(n))return n.then(()=>{Pe(this,go,"f").showHelp(e)}),this}let r=Pe(this,Kp,"f").runDefaultBuilderOn(this);if(Ju(r))return r.then(()=>{Pe(this,go,"f").showHelp(e)}),this}return Pe(this,go,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return Ln("[boolean|string] [string]",[e,r],arguments.length),Pe(this,go,"f").showHelpOnFail(e,r),this}showVersion(e){return Ln("[string|function]",[e],arguments.length),Pe(this,go,"f").showVersion(e),this}skipValidation(e){return Ln("",[e],arguments.length),this[UQ]("skipValidation",e),this}strict(e){return Ln("[boolean]",[e],arguments.length),Bn(this,nK,e!==!1,"f"),this}strictCommands(e){return Ln("[boolean]",[e],arguments.length),Bn(this,iK,e!==!1,"f"),this}strictOptions(e){return Ln("[boolean]",[e],arguments.length),Bn(this,oK,e!==!1,"f"),this}string(e){return Ln("",[e],arguments.length),this[UQ]("string",e),this[cK](e),this}terminalWidth(){return Ln([],0),Pe(this,Yi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return Ln("",[e],arguments.length),Bn(this,XY,!1,"f"),Pe(this,Yi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(Ln(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(B_(e,null,Pe(this,Yi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new Yp(".usage() description must start with $0 if being used as alias for .command()")}else return Pe(this,go,"f").usage(e),this}usageConfiguration(e){return Ln("",[e],arguments.length),Bn(this,fze,e,"f"),this}version(e,r,n){let o="version";if(Ln("[boolean|string] [string] [string]",[e,r,n],arguments.length),Pe(this,aO,"f")&&(this[D9t](Pe(this,aO,"f")),Pe(this,go,"f").version(void 0),Bn(this,aO,null,"f")),arguments.length===0)n=this[s0n](),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 Bn(this,aO,typeof e=="string"?e:o,"f"),r=r||Pe(this,go,"f").deferY18nLookup("Show version number"),Pe(this,go,"f").version(n||void 0),this.boolean(Pe(this,aO,"f")),this.describe(Pe(this,aO,"f"),r),this}wrap(e){return Ln("",[e],arguments.length),Pe(this,go,"f").wrap(e),this}[(Kp=new WeakMap,ZY=new WeakMap,PIe=new WeakMap,NC=new WeakMap,LS=new WeakMap,oze=new WeakMap,BQ=new WeakMap,XY=new WeakMap,sze=new WeakMap,Hx=new WeakMap,aze=new WeakMap,Gx=new WeakMap,sO=new WeakMap,BS=new WeakMap,$x=new WeakMap,cze=new WeakMap,eK=new WeakMap,cg=new WeakMap,ni=new WeakMap,lze=new WeakMap,uze=new WeakMap,FS=new WeakMap,tK=new WeakMap,Dle=new WeakMap,rK=new WeakMap,FQ=new WeakMap,dze=new WeakMap,Yi=new WeakMap,nK=new WeakMap,iK=new WeakMap,oK=new WeakMap,go=new WeakMap,fze=new WeakMap,aO=new WeakMap,Zf=new WeakMap,e0n)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[t0n](){return{log:a((...e)=>{this[pze]()||console.log(...e),Bn(this,BS,!0,"f"),Pe(this,cg,"f").length&&Bn(this,cg,Pe(this,cg,"f")+` -`,"f"),Bn(this,cg,Pe(this,cg,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[pze]()||console.error(...e),Bn(this,BS,!0,"f"),Pe(this,cg,"f").length&&Bn(this,cg,Pe(this,cg,"f")+` -`,"f"),Bn(this,cg,Pe(this,cg,"f")+e.join(" "),"f")},"error")}}[D9t](e){kle(Pe(this,ni,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=Pe(this,ni,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete Pe(this,go,"f").getDescriptions()[e]}[r0n](e,r,n){Pe(this,sze,"f")[n]||(Pe(this,Yi,"f").process.emitWarning(e,r),Pe(this,sze,"f")[n]=!0)}[n0n](){Pe(this,aze,"f").push({options:Pe(this,ni,"f"),configObjects:Pe(this,ni,"f").configObjects.slice(0),exitProcess:Pe(this,Hx,"f"),groups:Pe(this,sO,"f"),strict:Pe(this,nK,"f"),strictCommands:Pe(this,iK,"f"),strictOptions:Pe(this,oK,"f"),completionCommand:Pe(this,LS,"f"),output:Pe(this,cg,"f"),exitError:Pe(this,BQ,"f"),hasOutput:Pe(this,BS,"f"),parsed:this.parsed,parseFn:Pe(this,FS,"f"),parseContext:Pe(this,tK,"f")}),Pe(this,go,"f").freeze(),Pe(this,Zf,"f").freeze(),Pe(this,Kp,"f").freeze(),Pe(this,Gx,"f").freeze()}[i0n](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(Pe(this,Yi,"f").process.argv()[0])?r=Pe(this,Yi,"f").process.argv().slice(1,2):r=Pe(this,Yi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[A0n](Pe(this,ZY,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});B_(s,void 0,Pe(this,Yi,"f")),n=JSON.parse(Pe(this,Yi,"f").readFileSync(s,"utf8"))}catch{}return Pe(this,Dle,"f")[r]=n||{},Pe(this,Dle,"f")[r]}[UQ](e,r){r=[].concat(r),r.forEach(n=>{n=this[B9t](n),Pe(this,ni,"f")[e].push(n)})}[Nle](e,r,n,o){this[L9t](e,r,n,o,(s,c,l)=>{Pe(this,ni,"f")[s][c]=l})}[O9t](e,r,n,o){this[L9t](e,r,n,o,(s,c,l)=>{Pe(this,ni,"f")[s][c]=(Pe(this,ni,"f")[s][c]||[]).concat(l)})}[L9t](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 kle(n))e(c,n[c]);else s(r,this[B9t](n),o)}[B9t](e){return e==="__proto__"?"___proto___":e}[F9t](e,r){return this[Nle](this[F9t].bind(this),"key",e,r),this}[U9t](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=Pe(this,aze,"f").pop();B_(g,void 0,Pe(this,Yi,"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){Bn(e,ni,y,"f")}}.value,configObjects:A,exitProcess:{set value(y){Bn(r,Hx,y,"f")}}.value,groups:{set value(y){Bn(n,sO,y,"f")}}.value,output:{set value(y){Bn(o,cg,y,"f")}}.value,exitError:{set value(y){Bn(s,BQ,y,"f")}}.value,hasOutput:{set value(y){Bn(c,BS,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Bn(l,nK,y,"f")}}.value,strictCommands:{set value(y){Bn(u,iK,y,"f")}}.value,strictOptions:{set value(y){Bn(d,oK,y,"f")}}.value,completionCommand:{set value(y){Bn(f,LS,y,"f")}}.value,parseFn:{set value(y){Bn(h,FS,y,"f")}}.value,parseContext:{set value(y){Bn(m,tK,y,"f")}}.value}=g,Pe(this,ni,"f").configObjects=A,Pe(this,go,"f").unfreeze(),Pe(this,Zf,"f").unfreeze(),Pe(this,Kp,"f").unfreeze(),Pe(this,Gx,"f").unfreeze()}[c0n](e,r){return JY(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[l0n].bind(this),getContext:this[u0n].bind(this),getHasOutput:this[d0n].bind(this),getLoggerInstance:this[f0n].bind(this),getParseContext:this[p0n].bind(this),getParserConfiguration:this[sK].bind(this),getUsageConfiguration:this[o0n].bind(this),getUsageInstance:this[h0n].bind(this),getValidationInstance:this[m0n].bind(this),hasParseCallback:this[pze].bind(this),isGlobalContext:this[g0n].bind(this),postProcess:this[aK].bind(this),reset:this[Q9t].bind(this),runValidation:this[q9t].bind(this),runYargsParserAndExecuteCommands:this[DIe].bind(this),setHasOutput:this[y0n].bind(this)}}[l0n](){return Pe(this,Kp,"f")}[u0n](){return Pe(this,PIe,"f")}[d0n](){return Pe(this,BS,"f")}[f0n](){return Pe(this,eK,"f")}[p0n](){return Pe(this,tK,"f")||{}}[h0n](){return Pe(this,go,"f")}[m0n](){return Pe(this,Zf,"f")}[pze](){return!!Pe(this,FS,"f")}[g0n](){return Pe(this,cze,"f")}[aK](e,r,n,o){return n||Ju(e)||(r||(e=this[e0n](e)),(this[sK]()["parse-positional-numbers"]||this[sK]()["parse-positional-numbers"]===void 0)&&(e=this[a0n](e)),o&&(e=KY(e,this,Pe(this,Gx,"f").getMiddleware(),!1))),e}[Q9t](e={}){Bn(this,ni,Pe(this,ni,"f")||{},"f");let r={};r.local=Pe(this,ni,"f").local||[],r.configObjects=Pe(this,ni,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(Pe(this,rK,"f"),Object.keys(Pe(this,sO,"f")).reduce((c,l)=>{let u=Pe(this,sO,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),Bn(this,sO,{},"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]=(Pe(this,ni,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=OQ(Pe(this,ni,"f")[c],l=>!n[l])}),r.envPrefix=Pe(this,ni,"f").envPrefix,Bn(this,ni,r,"f"),Bn(this,go,Pe(this,go,"f")?Pe(this,go,"f").reset(n):Vmn(this,Pe(this,Yi,"f")),"f"),Bn(this,Zf,Pe(this,Zf,"f")?Pe(this,Zf,"f").reset(n):Zmn(this,Pe(this,go,"f"),Pe(this,Yi,"f")),"f"),Bn(this,Kp,Pe(this,Kp,"f")?Pe(this,Kp,"f").reset():Hmn(Pe(this,go,"f"),Pe(this,Zf,"f"),Pe(this,Gx,"f"),Pe(this,Yi,"f")),"f"),Pe(this,NC,"f")||Bn(this,NC,Ymn(this,Pe(this,go,"f"),Pe(this,Kp,"f"),Pe(this,Yi,"f")),"f"),Pe(this,Gx,"f").reset(),Bn(this,LS,null,"f"),Bn(this,cg,"","f"),Bn(this,BQ,null,"f"),Bn(this,BS,!1,"f"),this.parsed=!1,this}[A0n](e,r){return Pe(this,Yi,"f").path.relative(e,r)}[DIe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||Pe(this,FQ,"f"),Pe(this,ni,"f").__=Pe(this,Yi,"f").y18n.__,Pe(this,ni,"f").configuration=this[sK]();let h=!!Pe(this,ni,"f").configuration["populate--"],m=Object.assign({},Pe(this,ni,"f").configuration,{"populate--":!0}),g=Pe(this,Yi,"f").Parser.detailed(e,Object.assign({},Pe(this,ni,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,Pe(this,tK,"f")),y,E=g.aliases,_=!1,v=!1;Object.keys(A).forEach(b=>{b===Pe(this,$x,"f")&&A[b]?_=!0:b===Pe(this,aO,"f")&&A[b]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&Pe(this,go,"f").clearCachedHelpMessage();try{if(this[N9t](),r)return this[aK](A,h,!!n,!1);Pe(this,$x,"f")&&[Pe(this,$x,"f")].concat(E[Pe(this,$x,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),_=!0),Bn(this,cze,!1,"f");let b=Pe(this,Kp,"f").getCommands(),T=!((c=Pe(this,NC,"f"))===null||c===void 0)&&c.completionKey?[(l=Pe(this,NC,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=Pe(this,NC,"f"))===null||u===void 0?void 0:u.completionKey])!==null&&d!==void 0?d:[]].some(R=>Object.prototype.hasOwnProperty.call(A,R)):!1,w=_||T||s;if(A._.length){if(b.length){let R;for(let x=o||0,P;A._[x]!==void 0;x++)if(P=String(A._[x]),b.includes(P)&&P!==Pe(this,LS,"f")){let D=Pe(this,Kp,"f").runCommand(P,this,g,x+1,s,_||v||s);return this[aK](D,h,!!n,!1)}else if(!R&&P!==Pe(this,LS,"f")){R=P;break}!Pe(this,Kp,"f").hasDefaultCommand()&&Pe(this,dze,"f")&&R&&!w&&Pe(this,Zf,"f").recommendCommands(R,b)}Pe(this,LS,"f")&&A._.includes(Pe(this,LS,"f"))&&!T&&(Pe(this,Hx,"f")&&LQ(!0),this.showCompletionScript(),this.exit(0))}if(Pe(this,Kp,"f").hasDefaultCommand()&&!w){let R=Pe(this,Kp,"f").runCommand(null,this,g,0,s,_||v||s);return this[aK](R,h,!!n,!1)}if(T){Pe(this,Hx,"f")&&LQ(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${Pe(this,NC,"f").completionKey}`)+1);return Pe(this,NC,"f").getCompletion(R,(x,P)=>{if(x)throw new Yp(x.message);(P||[]).forEach(D=>{Pe(this,eK,"f").log(D)}),this.exit(0)}),this[aK](A,!h,!!n,!1)}if(Pe(this,BS,"f")||(_?(Pe(this,Hx,"f")&&LQ(!0),f=!0,this.showHelp(R=>{Pe(this,eK,"f").log(R),this.exit(0)})):v&&(Pe(this,Hx,"f")&&LQ(!0),f=!0,Pe(this,go,"f").showVersion("log"),this.exit(0))),!f&&Pe(this,ni,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>Pe(this,ni,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new Yp(g.error.message);if(!T){let R=this[q9t](E,{},g.error);n||(y=KY(A,this,Pe(this,Gx,"f").getMiddleware(),!0)),y=this[c0n](R,y??A),Ju(y)&&!n&&(y=y.then(()=>KY(A,this,Pe(this,Gx,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Yp)Pe(this,go,"f").fail(b.message,b);else throw b}return this[aK](y??A,h,!!n,!0)}[q9t](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Yp(n.message);Pe(this,Zf,"f").nonOptionCount(c),Pe(this,Zf,"f").requiredArguments(c,s);let l=!1;Pe(this,iK,"f")&&(l=Pe(this,Zf,"f").unknownCommands(c)),Pe(this,nK,"f")&&!l?Pe(this,Zf,"f").unknownArguments(c,e,r,!!o):Pe(this,oK,"f")&&Pe(this,Zf,"f").unknownArguments(c,e,{},!1,!1),Pe(this,Zf,"f").limitedChoices(c),Pe(this,Zf,"f").implications(c),Pe(this,Zf,"f").conflicting(c)}}[y0n](){Bn(this,BS,!0,"f")}[cK](e){if(typeof e=="string")Pe(this,ni,"f").key[e]=!0;else for(let r of e)Pe(this,ni,"f").key[r]=!0}};function Gmn(t){return!!t&&typeof t.getInternalMethods=="function"}a(Gmn,"isYargsInstance");var y8o=E0n(Fmn),_0n=y8o;p();p();var b0n=require("node:child_process"),S0n=require("node:util");var E8o=(0,S0n.promisify)(b0n.execFile),QQ="1.0.60",v0n="COPILOT_CLI_PATH",_8o="GITHUB_COPILOT_ACP_USE_CLI",Mle="@github/copilot",v8o=3e4,C8o=1e4,C0n=6e4,Ole=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function T0n(){return process.env[_8o]!=="0"}a(T0n,"isCLIIntegrationEnabled");var H9t=process.platform==="win32";async function I0n(){if(process.env[v0n]){let l=process.env[v0n],u=await NIe(l,["--version"]);if(u)return S8o(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new Ole("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await NIe("copilot",["--version"]);if(t&&MIe(t,QQ))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await NIe(e,["--offline",Mle,"--version"],!1,C8o);if(r&&MIe(r,QQ))return{path:e,args:[Mle],version:r,source:"npx"};let n=`${Mle}@${QQ}`,o=await NIe(e,[n,"--version"],!1,C0n);if(o&&MIe(o,QQ))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${Mle}@latest`,c=await NIe(e,[s,"--version"],!0,C0n);if(c){if(MIe(c,QQ))return{path:e,args:[s],version:c,source:"npx-latest"};throw new Ole(`Latest published Copilot CLI version ${c} is below the minimum required ${QQ}.`)}throw new Ole(`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 ${Mle}`)}a(I0n,"discoverCLI");function b8o(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(b8o,"parseVersion");async function NIe(t,e,r=!1,n=v8o){try{let{stdout:o}=await E8o(t,e,{timeout:n,shell:H9t});return b8o(o)}catch(o){if(r)throw o;return null}}a(NIe,"tryGetVersion");function S8o(t,e){if(!MIe(t,QQ))throw new Ole(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${QQ}. Update with: npm install -g ${Mle}@latest`)}a(S8o,"validateVersion");function MIe(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!==""}},lK=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=Mt();this._timestamp=Date.now();this.uriSchemeCache=new hze;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 Vx=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 uK=(n=>(n.Local="LOCAL",n.Background="BACKGROUND",n.Claude="CLAUDE",n))(uK||{}),T8o=Object.values(uK);function x3(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"]:T8o.filter(r=>e.has(r))}a(x3,"unionProviders");function cO(t,e){return t?["BACKGROUND"]:e?.length?[...e]:["LOCAL","BACKGROUND"]}a(cO,"providersForListRow");p();p();p();var dK=de(require("child_process")),$9t=de(require("path")),H0n=de(j0n());function G0n(t){return t.replace(/^git version /,"")}a(G0n,"parseVersion");function V9t(t){return new Promise((e,r)=>{let n=[],o=dK.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:G0n(Buffer.concat(n).toString("utf8").trim())}))})}a(V9t,"findSpecificGit");function F8o(){return new Promise((t,e)=>{dK.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){dK.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:G0n(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);dK.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(F8o,"findGitDarwin");function mze(t){return t?V9t($9t.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(mze,"findSystemGitWin32");async function U8o(){let t=await(0,H0n.default)("git.exe");return V9t(t)}a(U8o,"findGitWin32InPath");function Q8o(){return mze(process.env.ProgramW6432).then(void 0,()=>mze(process.env["ProgramFiles(x86)"])).then(void 0,()=>mze(process.env.ProgramFiles)).then(void 0,()=>mze($9t.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>U8o())}a(Q8o,"findGitWin32");async function lO(){try{switch(process.platform){case"darwin":return await F8o();case"win32":return await Q8o();default:return await V9t("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(lO,"findGit");var $0n=require("node:child_process"),V0n=require("node:util");var q8o=(0,V0n.promisify)($0n.execFile);async function W0n(t){return W9t(t,["github.com"])}a(W0n,"resolveGitHubNwo");async function W9t(t,e){let r;try{r=(await lO()).path}catch{return}let n;try{n=(await q8o(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return j8o(n,e)}a(W9t,"resolveGitHubNwoForHosts");function j8o(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(j8o,"parseGitRemoteUrl");async function z0n(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(z0n,"resolveRepoIds");p();var H8o=3e4,gze=class{constructor(e,r=H8o){this.ctx=e;this.timeoutMs=r;this.logger=new fe("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=bB(n).api,c=`${Y0n(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(tr).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...i0(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=bB(s).api,u=new URL(`${Y0n(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(tr).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...i0(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(Ur).resolveSession())?.accessToken}catch(e){this.logger.debug(this.ctx,`[OrgCustomAgentClient] no GitHub session: ${String(e)}`);return}}};function Y0n(t){return t.endsWith("/")?t.slice(0,-1):t}a(Y0n,"trimTrailingSlash");p();p();var G8o=Object.create,K0n=Object.defineProperty,$8o=Object.getOwnPropertyDescriptor,V8o=Object.getOwnPropertyNames,W8o=Object.getPrototypeOf,z8o=Object.prototype.hasOwnProperty,Zu=a((t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),"__commonJSMin"),Y8o=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var o=V8o(e),s=0,c=o.length,l;se[u]).bind(null,l),enumerable:!(n=$8o(e,l))||n.enumerable});return t},"__copyProps"),K8o=a((t,e,r)=>(r=t!=null?G8o(W8o(t)):{},Y8o(e||!t||!t.__esModule?K0n(r,"default",{value:t,enumerable:!0}):r,t)),"__toESM"),OIe=Zu(((t,e)=>{function r(u){return typeof u>"u"||u===null}a(r,"isNothing");function n(u){return typeof u=="object"&&u!==null}a(n,"isObject");function o(u){return Array.isArray(u)?u:r(u)?[]:[u]}a(o,"toArray");function s(u,d){if(d){let f=Object.keys(d);for(let h=0,m=f.length;h{function r(o,s){let c="",l=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(c+='in "'+o.mark.name+'" '),c+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!s&&o.mark.snippet&&(c+=` +`;m.forEach(A=>{g+=A}),e.fail(g)}},"implications");let u={};s.conflicts=a(function(h,m){Ln(" [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,_)=>_.length-E.length);let A=null,y=1/0;for(let E=0,_;(_=m[E])!==void 0;E++){let v=Jmn(h,_);v<=3&&v!h[m]),u=LQ(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();B_(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(Xmn,"validation");p();var _8o={};var D9t=[],PIe;function sze(t,e,r,n){PIe=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=E8o(e,t.extends);else try{c=_8o.resolve(t.extends)}catch{return t}y8o(c),D9t.push(c),o=s?JSON.parse(PIe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=sze(o,PIe.path.dirname(c),r,PIe)}return D9t=[],r?e0n(o,t):Object.assign({},o,t)}a(sze,"applyExtends");function y8o(t){if(D9t.indexOf(t)>-1)throw new Yp(`Circular extended configurations: '${t}'.`)}a(y8o,"checkForCircularExtends");function E8o(t,e){return PIe.path.resolve(t,e)}a(E8o,"getPathToDefaultConfig");function e0n(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))n(e[o])&&n(r[o])?r[o]=e0n(t[o],e[o]):r[o]=e[o];return r}a(e0n,"mergeDeep");var Bn=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},Pe=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)},Kp,XY,DIe,MC,BS,aze,FQ,eK,cze,Gx,lze,$x,aO,FS,Vx,uze,tK,cg,ni,dze,fze,US,rK,Dle,nK,UQ,pze,Yi,iK,oK,sK,Ao,hze,cO,Zf;function _0n(t){return(e=[],r=t.process.cwd(),n)=>{let o=new H9t(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(_0n,"YargsFactory");var t0n=Symbol("copyDoubleDash"),r0n=Symbol("copyDoubleDash"),N9t=Symbol("deleteFromParserHintObject"),n0n=Symbol("emitWarning"),i0n=Symbol("freeze"),o0n=Symbol("getDollarZero"),aK=Symbol("getParserConfiguration"),s0n=Symbol("getUsageConfiguration"),M9t=Symbol("guessLocale"),a0n=Symbol("guessVersion"),c0n=Symbol("parsePositionalNumbers"),O9t=Symbol("pkgUp"),QQ=Symbol("populateParserHintArray"),Nle=Symbol("populateParserHintSingleValueDictionary"),L9t=Symbol("populateParserHintArrayDictionary"),B9t=Symbol("populateParserHintDictionary"),F9t=Symbol("sanitizeKey"),U9t=Symbol("setKey"),Q9t=Symbol("unfreeze"),l0n=Symbol("validateAsync"),u0n=Symbol("getCommandInstance"),d0n=Symbol("getContext"),f0n=Symbol("getHasOutput"),p0n=Symbol("getLoggerInstance"),h0n=Symbol("getParseContext"),m0n=Symbol("getUsageInstance"),g0n=Symbol("getValidationInstance"),mze=Symbol("hasParseCallback"),A0n=Symbol("isGlobalContext"),cK=Symbol("postProcess"),y0n=Symbol("rebase"),q9t=Symbol("reset"),NIe=Symbol("runYargsParserAndExecuteCommands"),j9t=Symbol("runValidation"),E0n=Symbol("setHasOutput"),lK=Symbol("kTrackManuallySetKeys"),v8o="en_US",H9t=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,Kp.set(this,void 0),XY.set(this,void 0),DIe.set(this,{commands:[],fullCommands:[]}),MC.set(this,null),BS.set(this,null),aze.set(this,"show-hidden"),FQ.set(this,null),eK.set(this,!0),cze.set(this,{}),Gx.set(this,!0),lze.set(this,[]),$x.set(this,void 0),aO.set(this,{}),FS.set(this,!1),Vx.set(this,null),uze.set(this,!0),tK.set(this,void 0),cg.set(this,""),ni.set(this,void 0),dze.set(this,void 0),fze.set(this,{}),US.set(this,null),rK.set(this,null),Dle.set(this,{}),nK.set(this,{}),UQ.set(this,void 0),pze.set(this,!1),Yi.set(this,void 0),iK.set(this,!1),oK.set(this,!1),sK.set(this,!1),Ao.set(this,void 0),hze.set(this,{}),cO.set(this,null),Zf.set(this,void 0),Bn(this,Yi,o,"f"),Bn(this,UQ,e,"f"),Bn(this,XY,r,"f"),Bn(this,dze,n,"f"),Bn(this,$x,new nze(this),"f"),this.$0=this[o0n](),this[q9t](),Bn(this,Kp,Pe(this,Kp,"f"),"f"),Bn(this,Ao,Pe(this,Ao,"f"),"f"),Bn(this,Zf,Pe(this,Zf,"f"),"f"),Bn(this,ni,Pe(this,ni,"f"),"f"),Pe(this,ni,"f").showHiddenOpt=Pe(this,aze,"f"),Bn(this,tK,this[r0n](),"f"),Pe(this,Yi,"f").y18n.setLocale(v8o)}addHelpOpt(e,r){let n="help";return Ln("[string|boolean] [string]",[e,r],arguments.length),Pe(this,Vx,"f")&&(this[N9t](Pe(this,Vx,"f")),Bn(this,Vx,null,"f")),e===!1&&r===void 0?this:(Bn(this,Vx,typeof e=="string"?e:n,"f"),this.boolean(Pe(this,Vx,"f")),this.describe(Pe(this,Vx,"f"),r||Pe(this,Ao,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(Ln("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:Pe(this,aze,"f");return this.boolean(n),this.describe(n,r||Pe(this,Ao,"f").deferY18nLookup("Show hidden options")),Pe(this,ni,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[L9t](this.alias.bind(this),"alias",e,r),this}array(e){return Ln("",[e],arguments.length),this[QQ]("array",e),this[lK](e),this}boolean(e){return Ln("",[e],arguments.length),this[QQ]("boolean",e),this[lK](e),this}check(e,r){return Ln(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>ZY(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&Pe(this,Ao,"f").fail(s.toString(),s):Pe(this,Ao,"f").fail(Pe(this,Yi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(Pe(this,Ao,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[L9t](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(Ln(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Yp("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 Yp("coerce callback must be provided");let n=e;return Pe(this,ni,"f").key[n]=!0,Pe(this,$x,"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:ZY(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new Yp(d.message)})},n),this}conflicts(e,r){return Ln(" [string|array]",[e,r],arguments.length),Pe(this,Zf,"f").conflicts(e,r),this}config(e="config",r,n){return Ln("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=sze(e,Pe(this,XY,"f"),this[aK]()["deep-merge-config"]||!1,Pe(this,Yi,"f")),Pe(this,ni,"f").configObjects=(Pe(this,ni,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||Pe(this,Ao,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{Pe(this,ni,"f").config[o]=n||!0}),this)}completion(e,r,n){return Ln("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Bn(this,BS,e||Pe(this,BS,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(Pe(this,BS,"f"),r),n&&Pe(this,MC,"f").registerFunction(n),this}command(e,r,n,o,s,c){return Ln(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),Pe(this,Kp,"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){Ln(" [object]",[e,r],arguments.length);let n=Pe(this,dze,"f")||Pe(this,Yi,"f").require;return Pe(this,Kp,"f").addDirectory(e,n,Pe(this,Yi,"f").getCallerFile(),r),this}count(e){return Ln("",[e],arguments.length),this[QQ]("count",e),this[lK](e),this}default(e,r,n){return Ln(" [*] [string]",[e,r,n],arguments.length),n&&(w9t(e,Pe(this,Yi,"f")),Pe(this,ni,"f").defaultDescription[e]=n),typeof r=="function"&&(w9t(e,Pe(this,Yi,"f")),Pe(this,ni,"f").defaultDescription[e]||(Pe(this,ni,"f").defaultDescription[e]=Pe(this,Ao,"f").functionDescription(r)),r=r.call()),this[Nle](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 Ln("[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),Pe(this,ni,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{B_(n,!0,Pe(this,Yi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(B_(n,!0,Pe(this,Yi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{B_(n,!0,Pe(this,Yi,"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 Ln(" [string]",[e,r],arguments.length),this[Nle](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return Ln(" [string|boolean]",[e,r],arguments.length),Pe(this,ni,"f").deprecatedOptions[e]=r,this}describe(e,r){return Ln(" [string]",[e,r],arguments.length),this[U9t](e,!0),Pe(this,Ao,"f").describe(e,r),this}detectLocale(e){return Ln("",[e],arguments.length),Bn(this,eK,e,"f"),this}env(e){return Ln("[string|boolean]",[e],arguments.length),e===!1?delete Pe(this,ni,"f").envPrefix:Pe(this,ni,"f").envPrefix=e||"",this}epilogue(e){return Ln("",[e],arguments.length),Pe(this,Ao,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return Ln(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):Pe(this,Ao,"f").example(e,r),this}exit(e,r){Bn(this,FS,!0,"f"),Bn(this,FQ,r,"f"),Pe(this,Gx,"f")&&Pe(this,Yi,"f").process.exit(e)}exitProcess(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,Gx,e,"f"),this}fail(e){if(Ln("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Yp("Invalid first argument. Expected function or boolean 'false'");return Pe(this,Ao,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return Ln(" [function]",[e,r],arguments.length),r?Pe(this,MC,"f").getCompletion(e,r):new Promise((n,o)=>{Pe(this,MC,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return Ln([],0),Pe(this,ni,"f").demandedOptions}getDemandedCommands(){return Ln([],0),Pe(this,ni,"f").demandedCommands}getDeprecatedOptions(){return Ln([],0),Pe(this,ni,"f").deprecatedOptions}getDetectLocale(){return Pe(this,eK,"f")}getExitProcess(){return Pe(this,Gx,"f")}getGroups(){return Object.assign({},Pe(this,aO,"f"),Pe(this,nK,"f"))}getHelp(){if(Bn(this,FS,!0,"f"),!Pe(this,Ao,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[NIe](Pe(this,UQ,"f"),void 0,void 0,0,!0);if(Ju(r))return r.then(()=>Pe(this,Ao,"f").help())}let e=Pe(this,Kp,"f").runDefaultBuilderOn(this);if(Ju(e))return e.then(()=>Pe(this,Ao,"f").help())}return Promise.resolve(Pe(this,Ao,"f").help())}getOptions(){return Pe(this,ni,"f")}getStrict(){return Pe(this,iK,"f")}getStrictCommands(){return Pe(this,oK,"f")}getStrictOptions(){return Pe(this,sK,"f")}global(e,r){return Ln(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?Pe(this,ni,"f").local=Pe(this,ni,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{Pe(this,ni,"f").local.includes(n)||Pe(this,ni,"f").local.push(n)}),this}group(e,r){Ln(" ",[e,r],arguments.length);let n=Pe(this,nK,"f")[r]||Pe(this,aO,"f")[r];Pe(this,nK,"f")[r]&&delete Pe(this,nK,"f")[r];let o={};return Pe(this,aO,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return Ln("",[e],arguments.length),Pe(this,ni,"f").hiddenOptions.push(e),this}implies(e,r){return Ln(" [number|string|array]",[e,r],arguments.length),Pe(this,Zf,"f").implies(e,r),this}locale(e){return Ln("[string]",[e],arguments.length),e===void 0?(this[M9t](),Pe(this,Yi,"f").y18n.getLocale()):(Bn(this,eK,!1,"f"),Pe(this,Yi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return Pe(this,$x,"f").addMiddleware(e,!!r,n)}nargs(e,r){return Ln(" [number]",[e,r],arguments.length),this[Nle](this.nargs.bind(this),"narg",e,r),this}normalize(e){return Ln("",[e],arguments.length),this[QQ]("normalize",e),this}number(e){return Ln("",[e],arguments.length),this[QQ]("number",e),this[lK](e),this}option(e,r){if(Ln(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[lK](e),Pe(this,cO,"f")&&(e==="version"||r?.alias==="version")&&this[n0n](['"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"),Pe(this,ni,"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&&(Pe(this,ni,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=Pe(this,Ao,"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){Ln("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[i0n](),typeof e>"u"&&(e=Pe(this,UQ,"f")),typeof r=="object"&&(Bn(this,rK,r,"f"),r=n),typeof r=="function"&&(Bn(this,US,r,"f"),r=!1),r||Bn(this,UQ,e,"f"),Pe(this,US,"f")&&Bn(this,Gx,!1,"f");let o=this[NIe](e,!!r),s=this.parsed;return Pe(this,MC,"f").setParsed(this.parsed),Ju(o)?o.then(c=>(Pe(this,US,"f")&&Pe(this,US,"f").call(this,Pe(this,FQ,"f"),c,Pe(this,cg,"f")),c)).catch(c=>{throw Pe(this,US,"f")&&Pe(this,US,"f")(c,this.parsed.argv,Pe(this,cg,"f")),c}).finally(()=>{this[Q9t](),this.parsed=s}):(Pe(this,US,"f")&&Pe(this,US,"f").call(this,Pe(this,FQ,"f"),o,Pe(this,cg,"f")),this[Q9t](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return Ju(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if(Ju(o))throw new Yp(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return Ln("",[e],arguments.length),Bn(this,fze,e,"f"),this}pkgConf(e,r){Ln(" [string]",[e,r],arguments.length);let n=null,o=this[O9t](r||Pe(this,XY,"f"));return o[e]&&typeof o[e]=="object"&&(n=sze(o[e],r||Pe(this,XY,"f"),this[aK]()["deep-merge-config"]||!1,Pe(this,Yi,"f")),Pe(this,ni,"f").configObjects=(Pe(this,ni,"f").configObjects||[]).concat(n)),this}positional(e,r){Ln(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=LQ(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=Pe(this,DIe,"f").fullCommands[Pe(this,DIe,"f").fullCommands.length-1],s=o?Pe(this,Kp,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return kle(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,Pe(this,Ao,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,pze,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 Ln(" [number]",[e],arguments.length),typeof e=="string"&&Pe(this,ni,"f").narg[e]?this:(this[Nle](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return Ln("[string] [string]",[e,r],arguments.length),e=e||this.$0,Pe(this,tK,"f").log(Pe(this,MC,"f").generateCompletionScript(e,r||Pe(this,BS,"f")||"completion")),this}showHelp(e){if(Ln("[string|function]",[e],arguments.length),Bn(this,FS,!0,"f"),!Pe(this,Ao,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[NIe](Pe(this,UQ,"f"),void 0,void 0,0,!0);if(Ju(n))return n.then(()=>{Pe(this,Ao,"f").showHelp(e)}),this}let r=Pe(this,Kp,"f").runDefaultBuilderOn(this);if(Ju(r))return r.then(()=>{Pe(this,Ao,"f").showHelp(e)}),this}return Pe(this,Ao,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return Ln("[boolean|string] [string]",[e,r],arguments.length),Pe(this,Ao,"f").showHelpOnFail(e,r),this}showVersion(e){return Ln("[string|function]",[e],arguments.length),Pe(this,Ao,"f").showVersion(e),this}skipValidation(e){return Ln("",[e],arguments.length),this[QQ]("skipValidation",e),this}strict(e){return Ln("[boolean]",[e],arguments.length),Bn(this,iK,e!==!1,"f"),this}strictCommands(e){return Ln("[boolean]",[e],arguments.length),Bn(this,oK,e!==!1,"f"),this}strictOptions(e){return Ln("[boolean]",[e],arguments.length),Bn(this,sK,e!==!1,"f"),this}string(e){return Ln("",[e],arguments.length),this[QQ]("string",e),this[lK](e),this}terminalWidth(){return Ln([],0),Pe(this,Yi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return Ln("",[e],arguments.length),Bn(this,eK,!1,"f"),Pe(this,Yi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(Ln(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(B_(e,null,Pe(this,Yi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new Yp(".usage() description must start with $0 if being used as alias for .command()")}else return Pe(this,Ao,"f").usage(e),this}usageConfiguration(e){return Ln("",[e],arguments.length),Bn(this,hze,e,"f"),this}version(e,r,n){let o="version";if(Ln("[boolean|string] [string] [string]",[e,r,n],arguments.length),Pe(this,cO,"f")&&(this[N9t](Pe(this,cO,"f")),Pe(this,Ao,"f").version(void 0),Bn(this,cO,null,"f")),arguments.length===0)n=this[a0n](),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 Bn(this,cO,typeof e=="string"?e:o,"f"),r=r||Pe(this,Ao,"f").deferY18nLookup("Show version number"),Pe(this,Ao,"f").version(n||void 0),this.boolean(Pe(this,cO,"f")),this.describe(Pe(this,cO,"f"),r),this}wrap(e){return Ln("",[e],arguments.length),Pe(this,Ao,"f").wrap(e),this}[(Kp=new WeakMap,XY=new WeakMap,DIe=new WeakMap,MC=new WeakMap,BS=new WeakMap,aze=new WeakMap,FQ=new WeakMap,eK=new WeakMap,cze=new WeakMap,Gx=new WeakMap,lze=new WeakMap,$x=new WeakMap,aO=new WeakMap,FS=new WeakMap,Vx=new WeakMap,uze=new WeakMap,tK=new WeakMap,cg=new WeakMap,ni=new WeakMap,dze=new WeakMap,fze=new WeakMap,US=new WeakMap,rK=new WeakMap,Dle=new WeakMap,nK=new WeakMap,UQ=new WeakMap,pze=new WeakMap,Yi=new WeakMap,iK=new WeakMap,oK=new WeakMap,sK=new WeakMap,Ao=new WeakMap,hze=new WeakMap,cO=new WeakMap,Zf=new WeakMap,t0n)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[r0n](){return{log:a((...e)=>{this[mze]()||console.log(...e),Bn(this,FS,!0,"f"),Pe(this,cg,"f").length&&Bn(this,cg,Pe(this,cg,"f")+` +`,"f"),Bn(this,cg,Pe(this,cg,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[mze]()||console.error(...e),Bn(this,FS,!0,"f"),Pe(this,cg,"f").length&&Bn(this,cg,Pe(this,cg,"f")+` +`,"f"),Bn(this,cg,Pe(this,cg,"f")+e.join(" "),"f")},"error")}}[N9t](e){kle(Pe(this,ni,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=Pe(this,ni,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete Pe(this,Ao,"f").getDescriptions()[e]}[n0n](e,r,n){Pe(this,cze,"f")[n]||(Pe(this,Yi,"f").process.emitWarning(e,r),Pe(this,cze,"f")[n]=!0)}[i0n](){Pe(this,lze,"f").push({options:Pe(this,ni,"f"),configObjects:Pe(this,ni,"f").configObjects.slice(0),exitProcess:Pe(this,Gx,"f"),groups:Pe(this,aO,"f"),strict:Pe(this,iK,"f"),strictCommands:Pe(this,oK,"f"),strictOptions:Pe(this,sK,"f"),completionCommand:Pe(this,BS,"f"),output:Pe(this,cg,"f"),exitError:Pe(this,FQ,"f"),hasOutput:Pe(this,FS,"f"),parsed:this.parsed,parseFn:Pe(this,US,"f"),parseContext:Pe(this,rK,"f")}),Pe(this,Ao,"f").freeze(),Pe(this,Zf,"f").freeze(),Pe(this,Kp,"f").freeze(),Pe(this,$x,"f").freeze()}[o0n](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(Pe(this,Yi,"f").process.argv()[0])?r=Pe(this,Yi,"f").process.argv().slice(1,2):r=Pe(this,Yi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[y0n](Pe(this,XY,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});B_(s,void 0,Pe(this,Yi,"f")),n=JSON.parse(Pe(this,Yi,"f").readFileSync(s,"utf8"))}catch{}return Pe(this,Dle,"f")[r]=n||{},Pe(this,Dle,"f")[r]}[QQ](e,r){r=[].concat(r),r.forEach(n=>{n=this[F9t](n),Pe(this,ni,"f")[e].push(n)})}[Nle](e,r,n,o){this[B9t](e,r,n,o,(s,c,l)=>{Pe(this,ni,"f")[s][c]=l})}[L9t](e,r,n,o){this[B9t](e,r,n,o,(s,c,l)=>{Pe(this,ni,"f")[s][c]=(Pe(this,ni,"f")[s][c]||[]).concat(l)})}[B9t](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 kle(n))e(c,n[c]);else s(r,this[F9t](n),o)}[F9t](e){return e==="__proto__"?"___proto___":e}[U9t](e,r){return this[Nle](this[U9t].bind(this),"key",e,r),this}[Q9t](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=Pe(this,lze,"f").pop();B_(g,void 0,Pe(this,Yi,"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){Bn(e,ni,y,"f")}}.value,configObjects:A,exitProcess:{set value(y){Bn(r,Gx,y,"f")}}.value,groups:{set value(y){Bn(n,aO,y,"f")}}.value,output:{set value(y){Bn(o,cg,y,"f")}}.value,exitError:{set value(y){Bn(s,FQ,y,"f")}}.value,hasOutput:{set value(y){Bn(c,FS,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Bn(l,iK,y,"f")}}.value,strictCommands:{set value(y){Bn(u,oK,y,"f")}}.value,strictOptions:{set value(y){Bn(d,sK,y,"f")}}.value,completionCommand:{set value(y){Bn(f,BS,y,"f")}}.value,parseFn:{set value(y){Bn(h,US,y,"f")}}.value,parseContext:{set value(y){Bn(m,rK,y,"f")}}.value}=g,Pe(this,ni,"f").configObjects=A,Pe(this,Ao,"f").unfreeze(),Pe(this,Zf,"f").unfreeze(),Pe(this,Kp,"f").unfreeze(),Pe(this,$x,"f").unfreeze()}[l0n](e,r){return ZY(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[u0n].bind(this),getContext:this[d0n].bind(this),getHasOutput:this[f0n].bind(this),getLoggerInstance:this[p0n].bind(this),getParseContext:this[h0n].bind(this),getParserConfiguration:this[aK].bind(this),getUsageConfiguration:this[s0n].bind(this),getUsageInstance:this[m0n].bind(this),getValidationInstance:this[g0n].bind(this),hasParseCallback:this[mze].bind(this),isGlobalContext:this[A0n].bind(this),postProcess:this[cK].bind(this),reset:this[q9t].bind(this),runValidation:this[j9t].bind(this),runYargsParserAndExecuteCommands:this[NIe].bind(this),setHasOutput:this[E0n].bind(this)}}[u0n](){return Pe(this,Kp,"f")}[d0n](){return Pe(this,DIe,"f")}[f0n](){return Pe(this,FS,"f")}[p0n](){return Pe(this,tK,"f")}[h0n](){return Pe(this,rK,"f")||{}}[m0n](){return Pe(this,Ao,"f")}[g0n](){return Pe(this,Zf,"f")}[mze](){return!!Pe(this,US,"f")}[A0n](){return Pe(this,uze,"f")}[cK](e,r,n,o){return n||Ju(e)||(r||(e=this[t0n](e)),(this[aK]()["parse-positional-numbers"]||this[aK]()["parse-positional-numbers"]===void 0)&&(e=this[c0n](e)),o&&(e=JY(e,this,Pe(this,$x,"f").getMiddleware(),!1))),e}[q9t](e={}){Bn(this,ni,Pe(this,ni,"f")||{},"f");let r={};r.local=Pe(this,ni,"f").local||[],r.configObjects=Pe(this,ni,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(Pe(this,nK,"f"),Object.keys(Pe(this,aO,"f")).reduce((c,l)=>{let u=Pe(this,aO,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),Bn(this,aO,{},"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]=(Pe(this,ni,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=LQ(Pe(this,ni,"f")[c],l=>!n[l])}),r.envPrefix=Pe(this,ni,"f").envPrefix,Bn(this,ni,r,"f"),Bn(this,Ao,Pe(this,Ao,"f")?Pe(this,Ao,"f").reset(n):Wmn(this,Pe(this,Yi,"f")),"f"),Bn(this,Zf,Pe(this,Zf,"f")?Pe(this,Zf,"f").reset(n):Xmn(this,Pe(this,Ao,"f"),Pe(this,Yi,"f")),"f"),Bn(this,Kp,Pe(this,Kp,"f")?Pe(this,Kp,"f").reset():Gmn(Pe(this,Ao,"f"),Pe(this,Zf,"f"),Pe(this,$x,"f"),Pe(this,Yi,"f")),"f"),Pe(this,MC,"f")||Bn(this,MC,Kmn(this,Pe(this,Ao,"f"),Pe(this,Kp,"f"),Pe(this,Yi,"f")),"f"),Pe(this,$x,"f").reset(),Bn(this,BS,null,"f"),Bn(this,cg,"","f"),Bn(this,FQ,null,"f"),Bn(this,FS,!1,"f"),this.parsed=!1,this}[y0n](e,r){return Pe(this,Yi,"f").path.relative(e,r)}[NIe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||Pe(this,UQ,"f"),Pe(this,ni,"f").__=Pe(this,Yi,"f").y18n.__,Pe(this,ni,"f").configuration=this[aK]();let h=!!Pe(this,ni,"f").configuration["populate--"],m=Object.assign({},Pe(this,ni,"f").configuration,{"populate--":!0}),g=Pe(this,Yi,"f").Parser.detailed(e,Object.assign({},Pe(this,ni,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,Pe(this,rK,"f")),y,E=g.aliases,_=!1,v=!1;Object.keys(A).forEach(b=>{b===Pe(this,Vx,"f")&&A[b]?_=!0:b===Pe(this,cO,"f")&&A[b]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&Pe(this,Ao,"f").clearCachedHelpMessage();try{if(this[M9t](),r)return this[cK](A,h,!!n,!1);Pe(this,Vx,"f")&&[Pe(this,Vx,"f")].concat(E[Pe(this,Vx,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),_=!0),Bn(this,uze,!1,"f");let b=Pe(this,Kp,"f").getCommands(),T=!((c=Pe(this,MC,"f"))===null||c===void 0)&&c.completionKey?[(l=Pe(this,MC,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=Pe(this,MC,"f"))===null||u===void 0?void 0:u.completionKey])!==null&&d!==void 0?d:[]].some(R=>Object.prototype.hasOwnProperty.call(A,R)):!1,w=_||T||s;if(A._.length){if(b.length){let R;for(let x=o||0,P;A._[x]!==void 0;x++)if(P=String(A._[x]),b.includes(P)&&P!==Pe(this,BS,"f")){let D=Pe(this,Kp,"f").runCommand(P,this,g,x+1,s,_||v||s);return this[cK](D,h,!!n,!1)}else if(!R&&P!==Pe(this,BS,"f")){R=P;break}!Pe(this,Kp,"f").hasDefaultCommand()&&Pe(this,pze,"f")&&R&&!w&&Pe(this,Zf,"f").recommendCommands(R,b)}Pe(this,BS,"f")&&A._.includes(Pe(this,BS,"f"))&&!T&&(Pe(this,Gx,"f")&&BQ(!0),this.showCompletionScript(),this.exit(0))}if(Pe(this,Kp,"f").hasDefaultCommand()&&!w){let R=Pe(this,Kp,"f").runCommand(null,this,g,0,s,_||v||s);return this[cK](R,h,!!n,!1)}if(T){Pe(this,Gx,"f")&&BQ(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${Pe(this,MC,"f").completionKey}`)+1);return Pe(this,MC,"f").getCompletion(R,(x,P)=>{if(x)throw new Yp(x.message);(P||[]).forEach(D=>{Pe(this,tK,"f").log(D)}),this.exit(0)}),this[cK](A,!h,!!n,!1)}if(Pe(this,FS,"f")||(_?(Pe(this,Gx,"f")&&BQ(!0),f=!0,this.showHelp(R=>{Pe(this,tK,"f").log(R),this.exit(0)})):v&&(Pe(this,Gx,"f")&&BQ(!0),f=!0,Pe(this,Ao,"f").showVersion("log"),this.exit(0))),!f&&Pe(this,ni,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>Pe(this,ni,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new Yp(g.error.message);if(!T){let R=this[j9t](E,{},g.error);n||(y=JY(A,this,Pe(this,$x,"f").getMiddleware(),!0)),y=this[l0n](R,y??A),Ju(y)&&!n&&(y=y.then(()=>JY(A,this,Pe(this,$x,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Yp)Pe(this,Ao,"f").fail(b.message,b);else throw b}return this[cK](y??A,h,!!n,!0)}[j9t](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Yp(n.message);Pe(this,Zf,"f").nonOptionCount(c),Pe(this,Zf,"f").requiredArguments(c,s);let l=!1;Pe(this,oK,"f")&&(l=Pe(this,Zf,"f").unknownCommands(c)),Pe(this,iK,"f")&&!l?Pe(this,Zf,"f").unknownArguments(c,e,r,!!o):Pe(this,sK,"f")&&Pe(this,Zf,"f").unknownArguments(c,e,{},!1,!1),Pe(this,Zf,"f").limitedChoices(c),Pe(this,Zf,"f").implications(c),Pe(this,Zf,"f").conflicting(c)}}[E0n](){Bn(this,FS,!0,"f")}[lK](e){if(typeof e=="string")Pe(this,ni,"f").key[e]=!0;else for(let r of e)Pe(this,ni,"f").key[r]=!0}};function $mn(t){return!!t&&typeof t.getInternalMethods=="function"}a($mn,"isYargsInstance");var C8o=_0n(Umn),v0n=C8o;p();p();var S0n=require("node:child_process"),T0n=require("node:util");var b8o=(0,T0n.promisify)(S0n.execFile),qQ="1.0.60",C0n="COPILOT_CLI_PATH",S8o="GITHUB_COPILOT_ACP_USE_CLI",Mle="@github/copilot",T8o=3e4,I8o=1e4,b0n=6e4,Ole=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function I0n(){return process.env[S8o]!=="0"}a(I0n,"isCLIIntegrationEnabled");var G9t=process.platform==="win32";async function x0n(){if(process.env[C0n]){let l=process.env[C0n],u=await MIe(l,["--version"]);if(u)return w8o(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new Ole("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await MIe("copilot",["--version"]);if(t&&OIe(t,qQ))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await MIe(e,["--offline",Mle,"--version"],!1,I8o);if(r&&OIe(r,qQ))return{path:e,args:[Mle],version:r,source:"npx"};let n=`${Mle}@${qQ}`,o=await MIe(e,[n,"--version"],!1,b0n);if(o&&OIe(o,qQ))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${Mle}@latest`,c=await MIe(e,[s,"--version"],!0,b0n);if(c){if(OIe(c,qQ))return{path:e,args:[s],version:c,source:"npx-latest"};throw new Ole(`Latest published Copilot CLI version ${c} is below the minimum required ${qQ}.`)}throw new Ole(`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 ${Mle}`)}a(x0n,"discoverCLI");function x8o(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(x8o,"parseVersion");async function MIe(t,e,r=!1,n=T8o){try{let{stdout:o}=await b8o(t,e,{timeout:n,shell:G9t});return x8o(o)}catch(o){if(r)throw o;return null}}a(MIe,"tryGetVersion");function w8o(t,e){if(!OIe(t,qQ))throw new Ole(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${qQ}. Update with: npm install -g ${Mle}@latest`)}a(w8o,"validateVersion");function OIe(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!==""}},uK=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=Mt();this._timestamp=Date.now();this.uriSchemeCache=new gze;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 Wx=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 x3=(n=>(n.Local="LOCAL",n.Background="BACKGROUND",n.Claude="CLAUDE",n))(x3||{}),R8o=Object.values(x3);function w3(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"]:R8o.filter(r=>e.has(r))}a(w3,"unionProviders");function QS(t,e){return t?["BACKGROUND"]:e?.length?[...e]:["LOCAL","BACKGROUND"]}a(QS,"providersForListRow");p();p();p();var dK=de(require("child_process")),V9t=de(require("path")),G0n=de(H0n());function $0n(t){return t.replace(/^git version /,"")}a($0n,"parseVersion");function W9t(t){return new Promise((e,r)=>{let n=[],o=dK.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:$0n(Buffer.concat(n).toString("utf8").trim())}))})}a(W9t,"findSpecificGit");function j8o(){return new Promise((t,e)=>{dK.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){dK.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:$0n(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);dK.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(j8o,"findGitDarwin");function Aze(t){return t?W9t(V9t.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(Aze,"findSystemGitWin32");async function H8o(){let t=await(0,G0n.default)("git.exe");return W9t(t)}a(H8o,"findGitWin32InPath");function G8o(){return Aze(process.env.ProgramW6432).then(void 0,()=>Aze(process.env["ProgramFiles(x86)"])).then(void 0,()=>Aze(process.env.ProgramFiles)).then(void 0,()=>Aze(V9t.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>H8o())}a(G8o,"findGitWin32");async function lO(){try{switch(process.platform){case"darwin":return await j8o();case"win32":return await G8o();default:return await W9t("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(lO,"findGit");var V0n=require("node:child_process"),W0n=require("node:util");var $8o=(0,W0n.promisify)(V0n.execFile);async function z0n(t){return z9t(t,["github.com"])}a(z0n,"resolveGitHubNwo");async function z9t(t,e){let r;try{r=(await lO()).path}catch{return}let n;try{n=(await $8o(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return V8o(n,e)}a(z9t,"resolveGitHubNwoForHosts");function V8o(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(V8o,"parseGitRemoteUrl");async function Y0n(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(Y0n,"resolveRepoIds");p();var W8o=3e4,yze=class{constructor(e,r=W8o){this.ctx=e;this.timeoutMs=r;this.logger=new fe("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=bB(n).api,c=`${K0n(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(nr).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...i0(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=bB(s).api,u=new URL(`${K0n(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(nr).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...i0(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(Ur).resolveSession())?.accessToken}catch(e){this.logger.debug(this.ctx,`[OrgCustomAgentClient] no GitHub session: ${String(e)}`);return}}};function K0n(t){return t.endsWith("/")?t.slice(0,-1):t}a(K0n,"trimTrailingSlash");p();p();var z8o=Object.create,J0n=Object.defineProperty,Y8o=Object.getOwnPropertyDescriptor,K8o=Object.getOwnPropertyNames,J8o=Object.getPrototypeOf,Z8o=Object.prototype.hasOwnProperty,Zu=a((t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),"__commonJSMin"),X8o=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var o=K8o(e),s=0,c=o.length,l;se[u]).bind(null,l),enumerable:!(n=Y8o(e,l))||n.enumerable});return t},"__copyProps"),e6o=a((t,e,r)=>(r=t!=null?z8o(J8o(t)):{},X8o(e||!t||!t.__esModule?J0n(r,"default",{value:t,enumerable:!0}):r,t)),"__toESM"),LIe=Zu(((t,e)=>{function r(u){return typeof u>"u"||u===null}a(r,"isNothing");function n(u){return typeof u=="object"&&u!==null}a(n,"isObject");function o(u){return Array.isArray(u)?u:r(u)?[]:[u]}a(o,"toArray");function s(u,d){if(d){let f=Object.keys(d);for(let h=0,m=f.length;h{function r(o,s){let c="",l=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(c+='in "'+o.mark.name+'" '),c+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!s&&o.mark.snippet&&(c+=` -`+o.mark.snippet),l+" "+c):l}a(r,"formatError");function n(o,s){Error.call(this),this.name="YAMLException",this.reason=o,this.mark=s,this.message=r(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}a(n,"YAMLException"),n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=a(function(s){return this.name+": "+r(this,s)},"toString"),e.exports=n})),J8o=Zu(((t,e)=>{var r=OIe();function n(c,l,u,d,f){let h="",m="",g=Math.floor(f/2)-1;return d-l>g&&(h=" ... ",l=d-g+h.length),u-d>g&&(m=" ...",u=d+g-m.length),{str:h+c.slice(l,u).replace(/\t/g,"\u2192")+m,pos:d-l+h.length}}a(n,"getLine");function o(c,l){return r.repeat(" ",l-c.length)+c}a(o,"padStart");function s(c,l){if(l=Object.create(l||null),!c.buffer)return null;l.maxLength||(l.maxLength=79),typeof l.indent!="number"&&(l.indent=1),typeof l.linesBefore!="number"&&(l.linesBefore=3),typeof l.linesAfter!="number"&&(l.linesAfter=2);let u=/\r?\n|\r|\0/g,d=[0],f=[],h,m=-1;for(;h=u.exec(c.buffer);)f.push(h.index),d.push(h.index+h[0].length),c.position<=h.index&&m<0&&(m=d.length-2);m<0&&(m=d.length-1);let g="",A=Math.min(c.line+l.linesAfter,f.length).toString().length,y=l.maxLength-(l.indent+A+3);for(let _=1;_<=l.linesBefore&&!(m-_<0);_++){let v=n(c.buffer,d[m-_],f[m-_],c.position-(d[m]-d[m-_]),y);g=r.repeat(" ",l.indent)+o((c.line-_+1).toString(),A)+" | "+v.str+` +`+o.mark.snippet),l+" "+c):l}a(r,"formatError");function n(o,s){Error.call(this),this.name="YAMLException",this.reason=o,this.mark=s,this.message=r(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}a(n,"YAMLException"),n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=a(function(s){return this.name+": "+r(this,s)},"toString"),e.exports=n})),t6o=Zu(((t,e)=>{var r=LIe();function n(c,l,u,d,f){let h="",m="",g=Math.floor(f/2)-1;return d-l>g&&(h=" ... ",l=d-g+h.length),u-d>g&&(m=" ...",u=d+g-m.length),{str:h+c.slice(l,u).replace(/\t/g,"\u2192")+m,pos:d-l+h.length}}a(n,"getLine");function o(c,l){return r.repeat(" ",l-c.length)+c}a(o,"padStart");function s(c,l){if(l=Object.create(l||null),!c.buffer)return null;l.maxLength||(l.maxLength=79),typeof l.indent!="number"&&(l.indent=1),typeof l.linesBefore!="number"&&(l.linesBefore=3),typeof l.linesAfter!="number"&&(l.linesAfter=2);let u=/\r?\n|\r|\0/g,d=[0],f=[],h,m=-1;for(;h=u.exec(c.buffer);)f.push(h.index),d.push(h.index+h[0].length),c.position<=h.index&&m<0&&(m=d.length-2);m<0&&(m=d.length-1);let g="",A=Math.min(c.line+l.linesAfter,f.length).toString().length,y=l.maxLength-(l.indent+A+3);for(let _=1;_<=l.linesBefore&&!(m-_<0);_++){let v=n(c.buffer,d[m-_],f[m-_],c.position-(d[m]-d[m-_]),y);g=r.repeat(" ",l.indent)+o((c.line-_+1).toString(),A)+" | "+v.str+` `+g}let E=n(c.buffer,d[m],f[m],c.position,y);g+=r.repeat(" ",l.indent)+o((c.line+1).toString(),A)+" | "+E.str+` `,g+=r.repeat("-",l.indent+A+3+E.pos)+`^ `;for(let _=1;_<=l.linesAfter&&!(m+_>=f.length);_++){let v=n(c.buffer,d[m+_],f[m+_],c.position-(d[m]-d[m+_]),y);g+=r.repeat(" ",l.indent)+o((c.line+_+1).toString(),A)+" | "+v.str+` -`}return g.replace(/\n$/,"")}a(s,"makeSnippet"),e.exports=s})),U_=Zu(((t,e)=>{var r=LIe(),n=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];function s(l){let u={};return l!==null&&Object.keys(l).forEach(function(d){l[d].forEach(function(f){u[String(f)]=d})}),u}a(s,"compileStyleAliases");function c(l,u){if(u=u||{},Object.keys(u).forEach(function(d){if(n.indexOf(d)===-1)throw new r('Unknown option "'+d+'" is met in definition of "'+l+'" YAML type.')}),this.options=u,this.tag=l,this.kind=u.kind||null,this.resolve=u.resolve||function(){return!0},this.construct=u.construct||function(d){return d},this.instanceOf=u.instanceOf||null,this.predicate=u.predicate||null,this.represent=u.represent||null,this.representName=u.representName||null,this.defaultStyle=u.defaultStyle||null,this.multi=u.multi||!1,this.styleAliases=s(u.styleAliases||null),o.indexOf(this.kind)===-1)throw new r('Unknown kind "'+this.kind+'" is specified for "'+l+'" YAML type.')}a(c,"Type"),e.exports=c})),J0n=Zu(((t,e)=>{var r=LIe(),n=U_();function o(l,u){let d=[];return l[u].forEach(function(f){let h=d.length;d.forEach(function(m,g){m.tag===f.tag&&m.kind===f.kind&&m.multi===f.multi&&(h=g)}),d[h]=f}),d}a(o,"compileList");function s(){let l={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function u(d){d.multi?(l.multi[d.kind].push(d),l.multi.fallback.push(d)):l[d.kind][d.tag]=l.fallback[d.tag]=d}a(u,"collectType");for(let d=0,f=arguments.length;d{e.exports=new(U_())("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(r){return r!==null?r:""},"construct")})})),X0n=Zu(((t,e)=>{e.exports=new(U_())("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(r){return r!==null?r:[]},"construct")})})),egn=Zu(((t,e)=>{e.exports=new(U_())("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(r){return r!==null?r:{}},"construct")})})),tgn=Zu(((t,e)=>{e.exports=new(J0n())({explicit:[Z0n(),X0n(),egn()]})})),rgn=Zu(((t,e)=>{var r=U_();function n(c){if(c===null)return!0;let l=c.length;return l===1&&c==="~"||l===4&&(c==="null"||c==="Null"||c==="NULL")}a(n,"resolveYamlNull");function o(){return null}a(o,"constructYamlNull");function s(c){return c===null}a(s,"isNull"),e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:o,predicate:s,represent:{canonical:a(function(){return"~"},"canonical"),lowercase:a(function(){return"null"},"lowercase"),uppercase:a(function(){return"NULL"},"uppercase"),camelcase:a(function(){return"Null"},"camelcase"),empty:a(function(){return""},"empty")},defaultStyle:"lowercase"})})),ngn=Zu(((t,e)=>{var r=U_();function n(c){if(c===null)return!1;let l=c.length;return l===4&&(c==="true"||c==="True"||c==="TRUE")||l===5&&(c==="false"||c==="False"||c==="FALSE")}a(n,"resolveYamlBoolean");function o(c){return c==="true"||c==="True"||c==="TRUE"}a(o,"constructYamlBoolean");function s(c){return Object.prototype.toString.call(c)==="[object Boolean]"}a(s,"isBoolean"),e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:o,predicate:s,represent:{lowercase:a(function(c){return c?"true":"false"},"lowercase"),uppercase:a(function(c){return c?"TRUE":"FALSE"},"uppercase"),camelcase:a(function(c){return c?"True":"False"},"camelcase")},defaultStyle:"lowercase"})})),ign=Zu(((t,e)=>{var r=OIe(),n=U_();function o(h){return h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102}a(o,"isHexCode");function s(h){return h>=48&&h<=55}a(s,"isOctCode");function c(h){return h>=48&&h<=57}a(c,"isDecCode");function l(h){if(h===null)return!1;let m=h.length,g=0,A=!1;if(!m)return!1;let y=h[g];if((y==="-"||y==="+")&&(y=h[++g]),y==="0"){if(g+1===m)return!0;if(y=h[++g],y==="b"){for(g++;g=0?"0b"+h.toString(2):"-0b"+h.toString(2).slice(1)},"binary"),octal:a(function(h){return h>=0?"0o"+h.toString(8):"-0o"+h.toString(8).slice(1)},"octal"),decimal:a(function(h){return h.toString(10)},"decimal"),hexadecimal:a(function(h){return h>=0?"0x"+h.toString(16).toUpperCase():"-0x"+h.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})})),ogn=Zu(((t,e)=>{var r=OIe(),n=U_(),o=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),s=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function c(h){return h===null||!o.test(h)?!1:Number.isFinite(parseFloat(h,10))?!0:s.test(h)}a(c,"resolveYamlFloat");function l(h){let m=h.toLowerCase(),g=m[0]==="-"?-1:1;return"+-".indexOf(m[0])>=0&&(m=m.slice(1)),m===".inf"?g===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:m===".nan"?NaN:g*parseFloat(m,10)}a(l,"constructYamlFloat");var u=/^[-+]?[0-9]+e/;function d(h,m){if(isNaN(h))switch(m){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===h)switch(m){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===h)switch(m){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(h))return"-0.0";let g=h.toString(10);return u.test(g)?g.replace("e",".e"):g}a(d,"representYamlFloat");function f(h){return Object.prototype.toString.call(h)==="[object Number]"&&(h%1!==0||r.isNegativeZero(h))}a(f,"isFloat"),e.exports=new n("tag:yaml.org,2002:float",{kind:"scalar",resolve:c,construct:l,predicate:f,represent:d,defaultStyle:"lowercase"})})),sgn=Zu(((t,e)=>{e.exports=tgn().extend({implicit:[rgn(),ngn(),ign(),ogn()]})})),agn=Zu(((t,e)=>{e.exports=sgn()})),cgn=Zu(((t,e)=>{var r=U_(),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=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 s(u){return u===null?!1:n.exec(u)!==null||o.exec(u)!==null}a(s,"resolveYamlTimestamp");function c(u){let d=0,f=null,h=n.exec(u);if(h===null&&(h=o.exec(u)),h===null)throw new Error("Date resolve error");let m=+h[1],g=+h[2]-1,A=+h[3];if(!h[4])return new Date(Date.UTC(m,g,A));let y=+h[4],E=+h[5],_=+h[6];if(h[7]){for(d=h[7].slice(0,3);d.length<3;)d+="0";d=+d}if(h[9]){let b=+h[10],T=+(h[11]||0);f=(b*60+T)*6e4,h[9]==="-"&&(f=-f)}let v=new Date(Date.UTC(m,g,A,y,E,_,d));return f&&v.setTime(v.getTime()-f),v}a(c,"constructYamlTimestamp");function l(u){return u.toISOString()}a(l,"representYamlTimestamp"),e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:s,construct:c,instanceOf:Date,represent:l})})),lgn=Zu(((t,e)=>{var r=U_();function n(o){return o==="<<"||o===null}a(n,"resolveYamlMerge"),e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})})),ugn=Zu(((t,e)=>{var r=U_(),n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function o(u){if(u===null)return!1;let d=0,f=u.length,h=n;for(let m=0;m64)){if(g<0)return!1;d+=6}}return d%8===0}a(o,"resolveYamlBinary");function s(u){let d=u.replace(/[\r\n=]/g,""),f=d.length,h=n,m=0,g=[];for(let y=0;y>16&255),g.push(m>>8&255),g.push(m&255)),m=m<<6|h.indexOf(d.charAt(y));let A=f%4*6;return A===0?(g.push(m>>16&255),g.push(m>>8&255),g.push(m&255)):A===18?(g.push(m>>10&255),g.push(m>>2&255)):A===12&&g.push(m>>4&255),new Uint8Array(g)}a(s,"constructYamlBinary");function c(u){let d="",f=0,h=u.length,m=n;for(let A=0;A>18&63],d+=m[f>>12&63],d+=m[f>>6&63],d+=m[f&63]),f=(f<<8)+u[A];let g=h%3;return g===0?(d+=m[f>>18&63],d+=m[f>>12&63],d+=m[f>>6&63],d+=m[f&63]):g===2?(d+=m[f>>10&63],d+=m[f>>4&63],d+=m[f<<2&63],d+=m[64]):g===1&&(d+=m[f>>2&63],d+=m[f<<4&63],d+=m[64],d+=m[64]),d}a(c,"representYamlBinary");function l(u){return Object.prototype.toString.call(u)==="[object Uint8Array]"}a(l,"isBinary"),e.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:o,construct:s,predicate:l,represent:c})})),dgn=Zu(((t,e)=>{var r=U_(),n=Object.prototype.hasOwnProperty,o=Object.prototype.toString;function s(l){if(l===null)return!0;let u=[],d=l;for(let f=0,h=d.length;f{var r=U_(),n=Object.prototype.toString;function o(c){if(c===null)return!0;let l=c,u=new Array(l.length);for(let d=0,f=l.length;d{var r=U_(),n=Object.prototype.hasOwnProperty;function o(c){if(c===null)return!0;let l=c;for(let u in l)if(n.call(l,u)&&l[u]!==null)return!1;return!0}a(o,"resolveYamlSet");function s(c){return c!==null?c:{}}a(s,"constructYamlSet"),e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:o,construct:s})})),z9t=Zu(((t,e)=>{e.exports=agn().extend({implicit:[cgn(),lgn()],explicit:[ugn(),dgn(),fgn(),pgn()]})})),Z8o=Zu(((t,e)=>{var r=OIe(),n=LIe(),o=J8o(),s=z9t(),c=Object.prototype.hasOwnProperty,l=1,u=2,d=3,f=4,h=1,m=2,g=3,A=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/[\x85\u2028\u2029]/,E=/[,\[\]{}]/,_=/^(?:!|!!|![0-9A-Za-z-]+!)$/,v=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function b(F){return Object.prototype.toString.call(F)}a(b,"_class");function T(F){return F===10||F===13}a(T,"isEol");function w(F){return F===9||F===32}a(w,"isWhiteSpace");function R(F){return F===9||F===32||F===10||F===13}a(R,"isWsOrEol");function x(F){return F===44||F===91||F===93||F===123||F===125}a(x,"isFlowIndicator");function P(F){if(F>=48&&F<=57)return F-48;let be=F|32;return be>=97&&be<=102?be-97+10:-1}a(P,"fromHexCode");function D(F){return F===120?2:F===117?4:F===85?8:0}a(D,"escapedHexLen");function N(F){return F>=48&&F<=57?F-48:-1}a(N,"fromDecimalCode");function L(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 g.replace(/\n$/,"")}a(s,"makeSnippet"),e.exports=s})),U_=Zu(((t,e)=>{var r=BIe(),n=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];function s(l){let u={};return l!==null&&Object.keys(l).forEach(function(d){l[d].forEach(function(f){u[String(f)]=d})}),u}a(s,"compileStyleAliases");function c(l,u){if(u=u||{},Object.keys(u).forEach(function(d){if(n.indexOf(d)===-1)throw new r('Unknown option "'+d+'" is met in definition of "'+l+'" YAML type.')}),this.options=u,this.tag=l,this.kind=u.kind||null,this.resolve=u.resolve||function(){return!0},this.construct=u.construct||function(d){return d},this.instanceOf=u.instanceOf||null,this.predicate=u.predicate||null,this.represent=u.represent||null,this.representName=u.representName||null,this.defaultStyle=u.defaultStyle||null,this.multi=u.multi||!1,this.styleAliases=s(u.styleAliases||null),o.indexOf(this.kind)===-1)throw new r('Unknown kind "'+this.kind+'" is specified for "'+l+'" YAML type.')}a(c,"Type"),e.exports=c})),Z0n=Zu(((t,e)=>{var r=BIe(),n=U_();function o(l,u){let d=[];return l[u].forEach(function(f){let h=d.length;d.forEach(function(m,g){m.tag===f.tag&&m.kind===f.kind&&m.multi===f.multi&&(h=g)}),d[h]=f}),d}a(o,"compileList");function s(){let l={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function u(d){d.multi?(l.multi[d.kind].push(d),l.multi.fallback.push(d)):l[d.kind][d.tag]=l.fallback[d.tag]=d}a(u,"collectType");for(let d=0,f=arguments.length;d{e.exports=new(U_())("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(r){return r!==null?r:""},"construct")})})),egn=Zu(((t,e)=>{e.exports=new(U_())("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(r){return r!==null?r:[]},"construct")})})),tgn=Zu(((t,e)=>{e.exports=new(U_())("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(r){return r!==null?r:{}},"construct")})})),rgn=Zu(((t,e)=>{e.exports=new(Z0n())({explicit:[X0n(),egn(),tgn()]})})),ngn=Zu(((t,e)=>{var r=U_();function n(c){if(c===null)return!0;let l=c.length;return l===1&&c==="~"||l===4&&(c==="null"||c==="Null"||c==="NULL")}a(n,"resolveYamlNull");function o(){return null}a(o,"constructYamlNull");function s(c){return c===null}a(s,"isNull"),e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:o,predicate:s,represent:{canonical:a(function(){return"~"},"canonical"),lowercase:a(function(){return"null"},"lowercase"),uppercase:a(function(){return"NULL"},"uppercase"),camelcase:a(function(){return"Null"},"camelcase"),empty:a(function(){return""},"empty")},defaultStyle:"lowercase"})})),ign=Zu(((t,e)=>{var r=U_();function n(c){if(c===null)return!1;let l=c.length;return l===4&&(c==="true"||c==="True"||c==="TRUE")||l===5&&(c==="false"||c==="False"||c==="FALSE")}a(n,"resolveYamlBoolean");function o(c){return c==="true"||c==="True"||c==="TRUE"}a(o,"constructYamlBoolean");function s(c){return Object.prototype.toString.call(c)==="[object Boolean]"}a(s,"isBoolean"),e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:o,predicate:s,represent:{lowercase:a(function(c){return c?"true":"false"},"lowercase"),uppercase:a(function(c){return c?"TRUE":"FALSE"},"uppercase"),camelcase:a(function(c){return c?"True":"False"},"camelcase")},defaultStyle:"lowercase"})})),ogn=Zu(((t,e)=>{var r=LIe(),n=U_();function o(h){return h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102}a(o,"isHexCode");function s(h){return h>=48&&h<=55}a(s,"isOctCode");function c(h){return h>=48&&h<=57}a(c,"isDecCode");function l(h){if(h===null)return!1;let m=h.length,g=0,A=!1;if(!m)return!1;let y=h[g];if((y==="-"||y==="+")&&(y=h[++g]),y==="0"){if(g+1===m)return!0;if(y=h[++g],y==="b"){for(g++;g=0?"0b"+h.toString(2):"-0b"+h.toString(2).slice(1)},"binary"),octal:a(function(h){return h>=0?"0o"+h.toString(8):"-0o"+h.toString(8).slice(1)},"octal"),decimal:a(function(h){return h.toString(10)},"decimal"),hexadecimal:a(function(h){return h>=0?"0x"+h.toString(16).toUpperCase():"-0x"+h.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})})),sgn=Zu(((t,e)=>{var r=LIe(),n=U_(),o=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),s=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function c(h){return h===null||!o.test(h)?!1:Number.isFinite(parseFloat(h,10))?!0:s.test(h)}a(c,"resolveYamlFloat");function l(h){let m=h.toLowerCase(),g=m[0]==="-"?-1:1;return"+-".indexOf(m[0])>=0&&(m=m.slice(1)),m===".inf"?g===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:m===".nan"?NaN:g*parseFloat(m,10)}a(l,"constructYamlFloat");var u=/^[-+]?[0-9]+e/;function d(h,m){if(isNaN(h))switch(m){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===h)switch(m){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===h)switch(m){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(h))return"-0.0";let g=h.toString(10);return u.test(g)?g.replace("e",".e"):g}a(d,"representYamlFloat");function f(h){return Object.prototype.toString.call(h)==="[object Number]"&&(h%1!==0||r.isNegativeZero(h))}a(f,"isFloat"),e.exports=new n("tag:yaml.org,2002:float",{kind:"scalar",resolve:c,construct:l,predicate:f,represent:d,defaultStyle:"lowercase"})})),agn=Zu(((t,e)=>{e.exports=rgn().extend({implicit:[ngn(),ign(),ogn(),sgn()]})})),cgn=Zu(((t,e)=>{e.exports=agn()})),lgn=Zu(((t,e)=>{var r=U_(),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=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 s(u){return u===null?!1:n.exec(u)!==null||o.exec(u)!==null}a(s,"resolveYamlTimestamp");function c(u){let d=0,f=null,h=n.exec(u);if(h===null&&(h=o.exec(u)),h===null)throw new Error("Date resolve error");let m=+h[1],g=+h[2]-1,A=+h[3];if(!h[4])return new Date(Date.UTC(m,g,A));let y=+h[4],E=+h[5],_=+h[6];if(h[7]){for(d=h[7].slice(0,3);d.length<3;)d+="0";d=+d}if(h[9]){let b=+h[10],T=+(h[11]||0);f=(b*60+T)*6e4,h[9]==="-"&&(f=-f)}let v=new Date(Date.UTC(m,g,A,y,E,_,d));return f&&v.setTime(v.getTime()-f),v}a(c,"constructYamlTimestamp");function l(u){return u.toISOString()}a(l,"representYamlTimestamp"),e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:s,construct:c,instanceOf:Date,represent:l})})),ugn=Zu(((t,e)=>{var r=U_();function n(o){return o==="<<"||o===null}a(n,"resolveYamlMerge"),e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})})),dgn=Zu(((t,e)=>{var r=U_(),n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function o(u){if(u===null)return!1;let d=0,f=u.length,h=n;for(let m=0;m64)){if(g<0)return!1;d+=6}}return d%8===0}a(o,"resolveYamlBinary");function s(u){let d=u.replace(/[\r\n=]/g,""),f=d.length,h=n,m=0,g=[];for(let y=0;y>16&255),g.push(m>>8&255),g.push(m&255)),m=m<<6|h.indexOf(d.charAt(y));let A=f%4*6;return A===0?(g.push(m>>16&255),g.push(m>>8&255),g.push(m&255)):A===18?(g.push(m>>10&255),g.push(m>>2&255)):A===12&&g.push(m>>4&255),new Uint8Array(g)}a(s,"constructYamlBinary");function c(u){let d="",f=0,h=u.length,m=n;for(let A=0;A>18&63],d+=m[f>>12&63],d+=m[f>>6&63],d+=m[f&63]),f=(f<<8)+u[A];let g=h%3;return g===0?(d+=m[f>>18&63],d+=m[f>>12&63],d+=m[f>>6&63],d+=m[f&63]):g===2?(d+=m[f>>10&63],d+=m[f>>4&63],d+=m[f<<2&63],d+=m[64]):g===1&&(d+=m[f>>2&63],d+=m[f<<4&63],d+=m[64],d+=m[64]),d}a(c,"representYamlBinary");function l(u){return Object.prototype.toString.call(u)==="[object Uint8Array]"}a(l,"isBinary"),e.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:o,construct:s,predicate:l,represent:c})})),fgn=Zu(((t,e)=>{var r=U_(),n=Object.prototype.hasOwnProperty,o=Object.prototype.toString;function s(l){if(l===null)return!0;let u=[],d=l;for(let f=0,h=d.length;f{var r=U_(),n=Object.prototype.toString;function o(c){if(c===null)return!0;let l=c,u=new Array(l.length);for(let d=0,f=l.length;d{var r=U_(),n=Object.prototype.hasOwnProperty;function o(c){if(c===null)return!0;let l=c;for(let u in l)if(n.call(l,u)&&l[u]!==null)return!1;return!0}a(o,"resolveYamlSet");function s(c){return c!==null?c:{}}a(s,"constructYamlSet"),e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:o,construct:s})})),Y9t=Zu(((t,e)=>{e.exports=cgn().extend({implicit:[lgn(),ugn()],explicit:[dgn(),fgn(),pgn(),hgn()]})})),r6o=Zu(((t,e)=>{var r=LIe(),n=BIe(),o=t6o(),s=Y9t(),c=Object.prototype.hasOwnProperty,l=1,u=2,d=3,f=4,h=1,m=2,g=3,A=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/[\x85\u2028\u2029]/,E=/[,\[\]{}]/,_=/^(?:!|!!|![0-9A-Za-z-]+!)$/,v=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function b(F){return Object.prototype.toString.call(F)}a(b,"_class");function T(F){return F===10||F===13}a(T,"isEol");function w(F){return F===9||F===32}a(w,"isWhiteSpace");function R(F){return F===9||F===32||F===10||F===13}a(R,"isWsOrEol");function x(F){return F===44||F===91||F===93||F===123||F===125}a(x,"isFlowIndicator");function P(F){if(F>=48&&F<=57)return F-48;let be=F|32;return be>=97&&be<=102?be-97+10:-1}a(P,"fromHexCode");function D(F){return F===120?2:F===117?4:F===85?8:0}a(D,"escapedHexLen");function N(F){return F>=48&&F<=57?F-48:-1}a(N,"fromDecimalCode");function L(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(L,"simpleEscapeSequence");function B(F){return F<=65535?String.fromCharCode(F):String.fromCharCode((F-65536>>10)+55296,(F-65536&1023)+56320)}a(B,"charFromCodepoint");function q(F,be,Qe){be==="__proto__"?Object.defineProperty(F,be,{configurable:!0,enumerable:!0,writable:!0,value:Qe}):F[be]=Qe}a(q,"setProperty");var M=new Array(256),O=new Array(256);for(let F=0;F<256;F++)M[F]=L(F)?1:0,O[F]=L(F);function j(F,be){this.input=F,this.filename=be.filename||null,this.schema=be.schema||s,this.onWarning=be.onWarning||null,this.legacy=be.legacy||!1,this.json=be.json||!1,this.listener=be.listener||null,this.maxDepth=typeof be.maxDepth=="number"?be.maxDepth:100,this.maxMergeSeqLength=typeof be.maxMergeSeqLength=="number"?be.maxMergeSeqLength:20,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.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}a(j,"State");function Q(F,be){let Qe={name:F.filename,buffer:F.input.slice(0,-1),position:F.position,line:F.line,column:F.position-F.lineStart};return Qe.snippet=o(Qe),new n(be,Qe)}a(Q,"generateError");function U(F,be){throw Q(F,be)}a(U,"throwError");function Y(F,be){F.onWarning&&F.onWarning.call(null,Q(F,be))}a(Y,"throwWarning");function W(F,be,Qe){let pe=F.anchorMapTransactions;if(pe.length!==0){let Se=pe[pe.length-1];c.call(Se,be)||(Se[be]={existed:c.call(F.anchorMap,be),value:F.anchorMap[be]})}F.anchorMap[be]=Qe}a(W,"storeAnchor");function V(F){F.anchorMapTransactions.push(Object.create(null))}a(V,"beginAnchorTransaction");function z(F){let be=F.anchorMapTransactions.pop(),Qe=F.anchorMapTransactions;if(Qe.length===0)return;let pe=Qe[Qe.length-1],Se=Object.keys(be);for(let Fe=0,te=Se.length;Fe=0;pe-=1){let Se=be[Qe[pe]];Se.existed?F.anchorMap[Qe[pe]]=Se.value:delete F.anchorMap[Qe[pe]]}}a(ie,"rollbackAnchorTransaction");function H(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(H,"snapshotState");function re(F,be){F.position=be.position,F.line=be.line,F.lineStart=be.lineStart,F.lineIndent=be.lineIndent,F.firstTabInLine=be.firstTabInLine,F.tag=be.tag,F.anchor=be.anchor,F.kind=be.kind,F.result=be.result}a(re,"restoreState");var le={YAML:a(function(be,Qe,pe){be.version!==null&&U(be,"duplication of %YAML directive"),pe.length!==1&&U(be,"YAML directive accepts exactly one argument");let Se=/^([0-9]+)\.([0-9]+)$/.exec(pe[0]);Se===null&&U(be,"ill-formed argument of the YAML directive");let Fe=parseInt(Se[1],10),te=parseInt(Se[2],10);Fe!==1&&U(be,"unacceptable YAML version of the document"),be.version=pe[0],be.checkLineBreaks=te<2,te!==1&&te!==2&&Y(be,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(be,Qe,pe){let Se;pe.length!==2&&U(be,"TAG directive accepts exactly two arguments");let Fe=pe[0];Se=pe[1],_.test(Fe)||U(be,"ill-formed tag handle (first argument) of the TAG directive"),c.call(be.tagMap,Fe)&&U(be,'there is a previously declared suffix for "'+Fe+'" tag handle'),v.test(Se)||U(be,"ill-formed tag prefix (second argument) of the TAG directive");try{Se=decodeURIComponent(Se)}catch{U(be,"tag prefix is malformed: "+Se)}be.tagMap[Fe]=Se},"handleTagDirective")};function Le(F,be,Qe,pe){if(be=32&&Te<=1114111||U(F,"expected valid JSON character")}else A.test(Se)&&U(F,"the stream contains non-printable characters");F.result+=Se}}a(Le,"captureSegment");function ge(F,be,Qe,pe){r.isObject(Qe)||U(F,"cannot merge mappings; the provided source object is unacceptable");let Se=Object.keys(Qe);for(let Fe=0,te=Se.length;FeF.maxMergeSeqLength&&U(F,"merge sequence length exceeded maxMergeSeqLength ("+F.maxMergeSeqLength+")");let J=new Set;for(let se=0,me=Fe.length;se1&&(F.result+=r.repeat(` `,be-1))}a(K,"writeFoldedLines");function he(F,be,Qe){let pe,Se,Fe,te,Te,Ge,J=F.kind,se=F.result,me=F.input.charCodeAt(F.position);if(R(me)||x(me)||me===35||me===38||me===42||me===33||me===124||me===62||me===39||me===34||me===37||me===64||me===96)return!1;if(me===63||me===45){let Ce=F.input.charCodeAt(F.position+1);if(R(Ce)||Qe&&x(Ce))return!1}for(F.kind="scalar",F.result="",pe=Se=F.position,Fe=!1;me!==0;){if(me===58){let Ce=F.input.charCodeAt(F.position+1);if(R(Ce)||Qe&&x(Ce))break}else if(me===35){if(R(F.input.charCodeAt(F.position-1)))break}else{if(F.position===F.lineStart&&ee(F)||Qe&&x(me))break;if(T(me))if(te=F.line,Te=F.lineStart,Ge=F.lineIndent,X(F,!1,-1),F.lineIndent>=be){Fe=!0,me=F.input.charCodeAt(F.position);continue}else{F.position=Se,F.line=te,F.lineStart=Te,F.lineIndent=Ge;break}}Fe&&(Le(F,pe,Se,!1),K(F,F.line-te),pe=Se=F.position,Fe=!1),w(me)||(Se=F.position+1),me=F.input.charCodeAt(++F.position)}return Le(F,pe,Se,!1),F.result?!0:(F.kind=J,F.result=se,!1)}a(he,"readPlainScalar");function Z(F,be){let Qe,pe,Se=F.input.charCodeAt(F.position);if(Se!==39)return!1;for(F.kind="scalar",F.result="",F.position++,Qe=pe=F.position;(Se=F.input.charCodeAt(F.position))!==0;)if(Se===39)if(Le(F,Qe,F.position,!0),Se=F.input.charCodeAt(++F.position),Se===39)Qe=F.position,F.position++,pe=F.position;else return!0;else T(Se)?(Le(F,Qe,pe,!0),K(F,X(F,!1,be)),Qe=pe=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a single quoted scalar"):(F.position++,w(Se)||(pe=F.position));U(F,"unexpected end of the stream within a single quoted scalar")}a(Z,"readSingleQuotedScalar");function ue(F,be){let Qe,pe,Se,Fe=F.input.charCodeAt(F.position);if(Fe!==34)return!1;for(F.kind="scalar",F.result="",F.position++,Qe=pe=F.position;(Fe=F.input.charCodeAt(F.position))!==0;){if(Fe===34)return Le(F,Qe,F.position,!0),F.position++,!0;if(Fe===92){if(Le(F,Qe,F.position,!0),Fe=F.input.charCodeAt(++F.position),T(Fe))X(F,!1,be);else if(Fe<256&&M[Fe])F.result+=O[Fe],F.position++;else if((Se=D(Fe))>0){let te=Se,Te=0;for(;te>0;te--)Fe=F.input.charCodeAt(++F.position),(Se=P(Fe))>=0?Te=(Te<<4)+Se:U(F,"expected hexadecimal character");F.result+=B(Te),F.position++}else U(F,"unknown escape sequence");Qe=pe=F.position}else T(Fe)?(Le(F,Qe,pe,!0),K(F,X(F,!1,be)),Qe=pe=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a double quoted scalar"):(F.position++,w(Fe)||(pe=F.position))}U(F,"unexpected end of the stream within a double quoted scalar")}a(ue,"readDoubleQuotedScalar");function qe(F,be){let Qe=!0,pe,Se,Fe,te=F.tag,Te,Ge=F.anchor,J,se,me,Ce,He=Object.create(null),$e,et,ct,bt=F.input.charCodeAt(F.position);if(bt===91)J=93,Ce=!1,Te=[];else if(bt===123)J=125,Ce=!0,Te={};else return!1;for(F.anchor!==null&&W(F,F.anchor,Te),bt=F.input.charCodeAt(++F.position);bt!==0;){if(X(F,!0,be),bt=F.input.charCodeAt(F.position),bt===J)return F.position++,F.tag=te,F.anchor=Ge,F.kind=Ce?"mapping":"sequence",F.result=Te,!0;Qe?bt===44&&U(F,"expected the node content, but found ','"):U(F,"missed comma between flow collection entries"),et=$e=ct=null,se=me=!1,bt===63&&R(F.input.charCodeAt(F.position+1))&&(se=me=!0,F.position++,X(F,!0,be)),pe=F.line,Se=F.lineStart,Fe=F.position,_t(F,be,l,!1,!0),et=F.tag,$e=F.result,X(F,!0,be),bt=F.input.charCodeAt(F.position),(me||F.line===pe)&&bt===58&&(se=!0,bt=F.input.charCodeAt(++F.position),X(F,!0,be),_t(F,be,l,!1,!0),ct=F.result),Ce?Ue(F,Te,He,et,$e,ct,pe,Se,Fe):se?Te.push(Ue(F,null,He,et,$e,ct,pe,Se,Fe)):Te.push($e),X(F,!0,be),bt=F.input.charCodeAt(F.position),bt===44?(Qe=!0,bt=F.input.charCodeAt(++F.position)):Qe=!1}U(F,"unexpected end of the stream within a flow collection")}a(qe,"readFlowCollection");function ne(F,be){let Qe,pe=h,Se=!1,Fe=!1,te=be,Te=0,Ge=!1,J,se=F.input.charCodeAt(F.position);if(se===124)Qe=!1;else if(se===62)Qe=!0;else return!1;for(F.kind="scalar",F.result="";se!==0;)if(se=F.input.charCodeAt(++F.position),se===43||se===45)h===pe?pe=se===43?g:m:U(F,"repeat of a chomping mode identifier");else if((J=N(se))>=0)J===0?U(F,"bad explicit indentation width of a block scalar; it cannot be less than one"):Fe?U(F,"repeat of an indentation width identifier"):(te=be+J-1,Fe=!0);else break;if(w(se)){do se=F.input.charCodeAt(++F.position);while(w(se));if(se===35)do se=F.input.charCodeAt(++F.position);while(!T(se)&&se!==0)}for(;se!==0;){for(ke(F),F.lineIndent=0,se=F.input.charCodeAt(F.position);(!Fe||F.lineIndentte&&(te=F.lineIndent),T(se)){Te++;continue}if(!Fe&&te===0&&U(F,"missing indentation for block scalar"),F.lineIndentbe)&&te!==0)U(F,"bad indentation of a sequence entry");else if(F.lineIndentbe)&&($e&&(Se=F.line,Fe=F.lineStart,te=F.position),_t(F,be,f,!0,pe)&&($e?Ce=F.result:He=F.result),$e||(Ue(F,J,se,me,Ce,He,Se,Fe,te),me=Ce=He=null),X(F,!0,-1),ct=F.input.charCodeAt(F.position)),(F.line===ht||F.lineIndent>be)&&ct!==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 $e=Fe=te=f===Qe||d===Qe;if(pe&&X(F,!0,-1)&&(Ge=!0,F.lineIndent>be?Te=1:F.lineIndent===be?Te=0:F.lineIndentbe?Te=1:F.lineIndent===be?Te=0:F.lineIndent tag; it should be "scalar", not "'+F.kind+'"');for(let et=0,ct=F.implicitTypes.length;et"),F.result!==null&&me.kind!==F.kind&&U(F,"unacceptable node kind for !<"+F.tag+'> tag; it should be "'+me.kind+'", not "'+F.kind+'"'),me.resolve(F.result,F.tag)?(F.result=me.construct(F.result,F.tag),F.anchor!==null&&W(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||J}a(_t,"composeNode");function Dt(F){let be=F.position,Qe=!1,pe;for(F.version=null,F.checkLineBreaks=F.legacy,F.tagMap=Object.create(null),F.anchorMap=Object.create(null);(pe=F.input.charCodeAt(F.position))!==0&&(X(F,!0,-1),pe=F.input.charCodeAt(F.position),!(F.lineIndent>0||pe!==37));){Qe=!0,pe=F.input.charCodeAt(++F.position);let Se=F.position;for(;pe!==0&&!R(pe);)pe=F.input.charCodeAt(++F.position);let Fe=F.input.slice(Se,F.position),te=[];for(Fe.length<1&&U(F,"directive name must not be less than one character in length");pe!==0;){for(;w(pe);)pe=F.input.charCodeAt(++F.position);if(pe===35){do pe=F.input.charCodeAt(++F.position);while(pe!==0&&!T(pe));break}if(T(pe))break;for(Se=F.position;pe!==0&&!R(pe);)pe=F.input.charCodeAt(++F.position);te.push(F.input.slice(Se,F.position))}pe!==0&&ke(F),c.call(le,Fe)?le[Fe](F,Fe,te):Y(F,'unknown document directive "'+Fe+'"')}if(X(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,X(F,!0,-1)):Qe&&U(F,"directives end mark is expected"),_t(F,F.lineIndent-1,f,!1,!0),X(F,!0,-1),F.checkLineBreaks&&y.test(F.input.slice(be,F.position))&&Y(F,"non-ASCII line breaks are interpreted as content"),F.documents.push(F.result),F.position===F.lineStart&&ee(F)){F.input.charCodeAt(F.position)===46&&(F.position+=3,X(F,!0,-1));return}F.position"u"&&(Qe=be,be=null);let pe=$t(F,Qe);if(typeof be!="function")return pe;for(let Se=0,Fe=pe.length;Se{var r=OIe(),n=LIe(),o=z9t(),s=Object.prototype.toString,c=Object.prototype.hasOwnProperty,l=65279,u=9,d=10,f=13,h=32,m=33,g=34,A=35,y=37,E=38,_=39,v=42,b=44,T=45,w=58,R=61,x=62,P=63,D=64,N=91,L=93,B=96,q=123,M=124,O=125,j={};j[0]="\\0",j[7]="\\a",j[8]="\\b",j[9]="\\t",j[10]="\\n",j[11]="\\v",j[12]="\\f",j[13]="\\r",j[27]="\\e",j[34]='\\"',j[92]="\\\\",j[133]="\\N",j[160]="\\_",j[8232]="\\L",j[8233]="\\P";var Q=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],U=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Y(te,Te){if(Te===null)return{};let Ge={},J=Object.keys(Te);for(let se=0,me=J.length;se"u"&&(Qe=be,be=null);let pe=$t(F,Qe);if(typeof be!="function")return pe;for(let Se=0,Fe=pe.length;Se{var r=LIe(),n=BIe(),o=Y9t(),s=Object.prototype.toString,c=Object.prototype.hasOwnProperty,l=65279,u=9,d=10,f=13,h=32,m=33,g=34,A=35,y=37,E=38,_=39,v=42,b=44,T=45,w=58,R=61,x=62,P=63,D=64,N=91,L=93,B=96,q=123,M=124,O=125,j={};j[0]="\\0",j[7]="\\a",j[8]="\\b",j[9]="\\t",j[10]="\\n",j[11]="\\v",j[12]="\\f",j[13]="\\r",j[27]="\\e",j[34]='\\"',j[92]="\\\\",j[133]="\\N",j[160]="\\_",j[8232]="\\L",j[8233]="\\P";var Q=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],U=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Y(te,Te){if(Te===null)return{};let Ge={},J=Object.keys(Te);for(let se=0,me=J.length;se=32&&te<=126||te>=161&&te<=55295&&te!==8232&&te!==8233||te>=57344&&te<=65533&&te!==l||te>=65536&&te<=1114111}a(ge,"isPrintable");function Ue(te){return ge(te)&&te!==l&&te!==f&&te!==d}a(Ue,"isNsCharOrWhitespace");function ke(te,Te,Ge){let J=Ue(te),se=J&&!Le(te);return(Ge?J:J&&te!==b&&te!==N&&te!==L&&te!==q&&te!==O)&&te!==A&&!(Te===w&&!se)||Ue(Te)&&!Le(Te)&&te===A||Te===w&&se}a(ke,"isPlainSafe");function X(te){return ge(te)&&te!==l&&!Le(te)&&te!==T&&te!==P&&te!==w&&te!==b&&te!==N&&te!==L&&te!==q&&te!==O&&te!==A&&te!==E&&te!==v&&te!==m&&te!==M&&te!==R&&te!==x&&te!==_&&te!==g&&te!==y&&te!==D&&te!==B}a(X,"isPlainSafeFirst");function ee(te){return!Le(te)&&te!==w}a(ee,"isPlainSafeLast");function K(te,Te){let Ge=te.charCodeAt(Te),J;return Ge>=55296&&Ge<=56319&&Te+1=56320&&J<=57343)?(Ge-55296)*1024+J-56320+65536:Ge}a(K,"codePointAt");function he(te){return/^\n* /.test(te)}a(he,"needIndentIndicator");var Z=1,ue=2,qe=3,ne=4,ce=5;function Ne(te,Te,Ge,J,se,me,Ce,He){let $e,et=0,ct=null,bt=!1,ht=!1,We=J!==-1,ae=-1,Re=X(K(te,0))&&ee(K(te,te.length-1));if(Te||Ce)for($e=0;$e=65536?$e+=2:$e++){if(et=K(te,$e),!ge(et))return ce;Re=Re&&ke(et,ct,He),ct=et}else{for($e=0;$e=65536?$e+=2:$e++){if(et=K(te,$e),et===d)bt=!0,We&&(ht=ht||$e-ae-1>J&&te[ae+1]!==" ",ae=$e);else if(!ge(et))return ce;Re=Re&&ke(et,ct,He),ct=et}ht=ht||We&&$e-ae-1>J&&te[ae+1]!==" "}return!bt&&!ht?Re&&!Ce&&!se(te)?Z:me===z?ce:ue:Ge>9&&he(te)?ce:Ce?me===z?ce:ue:ht?ne:qe}a(Ne,"chooseScalarStyle");function we(te,Te,Ge,J,se){te.dump=(function(){if(Te.length===0)return te.quotingType===z?'""':"''";if(!te.noCompatMode&&(Q.indexOf(Te)!==-1||U.test(Te)))return te.quotingType===z?'"'+Te+'"':"'"+Te+"'";let me=te.indent*Math.max(1,Ge),Ce=te.lineWidth===-1?-1:Math.max(Math.min(te.lineWidth,40),te.lineWidth-me),He=J||te.flowLevel>-1&&Ge>=te.flowLevel;function $e(et){return le(te,et)}switch(a($e,"testAmbiguity"),Ne(Te,He,te.indent,Ce,$e,te.quotingType,te.forceQuotes&&!J,se)){case Z:return Te;case ue:return"'"+Te.replace(/'/g,"''")+"'";case qe:return"|"+Be(Te,te.indent)+rt(H(Te,me));case ne:return">"+Be(Te,te.indent)+rt(H(st(Te,Ce),me));case ce:return'"'+Dt(Te,Ce)+'"';default:throw new n("impossible error: invalid scalar style")}})()}a(we,"writeScalar");function Be(te,Te){let Ge=he(te)?String(Te):"",J=te[te.length-1]===` @@ -2366,13 +2366,13 @@ Try running 'npx ${s} --version' manually to inspect the output, or install/upda `+te.slice(se,me),se=me+1),Ce=He;return $e+=` `,te.length-se>Te&&Ce>se?$e+=te.slice(se,Ce)+` `+te.slice(Ce+1):$e+=te.slice(se),$e.slice(1)}a(_t,"foldLine");function Dt(te){let Te="",Ge=0;for(let J=0;J=65536?J+=2:J++){Ge=K(te,J);let se=j[Ge];!se&&ge(Ge)?(Te+=te[J],Ge>=65536&&(Te+=te[J+1])):Te+=se||W(Ge)}return Te}a(Dt,"escapeString");function $t(te,Te,Ge){let J="",se=te.tag;for(let me=0,Ce=Ge.length;me"u"&&Qe(te,Te,null,!1,!1))&&(J!==""&&(J+=","+(te.condenseFlow?"":" ")),J+=te.dump)}te.tag=se,te.dump="["+J+"]"}a($t,"writeFlowSequence");function Gt(te,Te,Ge,J){let se="",me=te.tag;for(let Ce=0,He=Ge.length;Ce"u"&&Qe(te,Te+1,null,!0,!0,!1,!0))&&((!J||se!=="")&&(se+=re(te,Te)),te.dump&&d===te.dump.charCodeAt(0)?se+="-":se+="- ",se+=te.dump)}te.tag=me,te.dump=se||"[]"}a(Gt,"writeBlockSequence");function Ie(te,Te,Ge){let J="",se=te.tag,me=Object.keys(Ge);for(let Ce=0,He=me.length;Ce1024&&($e+="? "),$e+=te.dump+(te.condenseFlow?'"':"")+":"+(te.condenseFlow?"":" "),Qe(te,Te,ct,!1,!1)&&($e+=te.dump,J+=$e))}te.tag=se,te.dump="{"+J+"}"}a(Ie,"writeFlowMapping");function F(te,Te,Ge,J){let se="",me=te.tag,Ce=Object.keys(Ge);if(te.sortKeys===!0)Ce.sort();else if(typeof te.sortKeys=="function")Ce.sort(te.sortKeys);else if(te.sortKeys)throw new n("sortKeys must be a boolean or a function");for(let He=0,$e=Ce.length;He<$e;He+=1){let et="";(!J||se!=="")&&(et+=re(te,Te));let ct=Ce[He],bt=Ge[ct];if(te.replacer&&(bt=te.replacer.call(Ge,ct,bt)),!Qe(te,Te+1,ct,!0,!0,!0))continue;let ht=te.tag!==null&&te.tag!=="?"||te.dump&&te.dump.length>1024;ht&&(te.dump&&d===te.dump.charCodeAt(0)?et+="?":et+="? "),et+=te.dump,ht&&(et+=re(te,Te)),Qe(te,Te+1,bt,!0,ht)&&(te.dump&&d===te.dump.charCodeAt(0)?et+=":":et+=": ",et+=te.dump,se+=et)}te.tag=me,te.dump=se||"{}"}a(F,"writeBlockMapping");function be(te,Te,Ge){let J=Ge?te.explicitTypes:te.implicitTypes;for(let se=0,me=J.length;se tag resolver accepts not "'+He+'" style');te.dump=$e}return!0}}return!1}a(be,"detectType");function Qe(te,Te,Ge,J,se,me,Ce){te.tag=null,te.dump=Ge,be(te,Ge,!1)||be(te,Ge,!0);let He=s.call(te.dump),$e=J;J&&(J=te.flowLevel<0||te.flowLevel>Te);let et=He==="[object Object]"||He==="[object Array]",ct,bt;if(et&&(ct=te.duplicates.indexOf(Ge),bt=ct!==-1),(te.tag!==null&&te.tag!=="?"||bt||te.indent!==2&&Te>0)&&(se=!1),bt&&te.usedDuplicates[ct])te.dump="*ref_"+ct;else{if(et&&bt&&!te.usedDuplicates[ct]&&(te.usedDuplicates[ct]=!0),He==="[object Object]")J&&Object.keys(te.dump).length!==0?(F(te,Te,te.dump,se),bt&&(te.dump="&ref_"+ct+te.dump)):(Ie(te,Te,te.dump),bt&&(te.dump="&ref_"+ct+" "+te.dump));else if(He==="[object Array]")J&&te.dump.length!==0?(te.noArrayIndent&&!Ce&&Te>0?Gt(te,Te-1,te.dump,se):Gt(te,Te,te.dump,se),bt&&(te.dump="&ref_"+ct+te.dump)):($t(te,Te,te.dump),bt&&(te.dump="&ref_"+ct+" "+te.dump));else if(He==="[object String]")te.tag!=="?"&&we(te,te.dump,Te,me,$e);else{if(He==="[object Undefined]")return!1;if(te.skipInvalid)return!1;throw new n("unacceptable kind of an object to dump "+He)}if(te.tag!==null&&te.tag!=="?"){let ht=encodeURI(te.tag[0]==="!"?te.tag.slice(1):te.tag).replace(/!/g,"%21");te.tag[0]==="!"?ht="!"+ht:ht.slice(0,18)==="tag:yaml.org,2002:"?ht="!!"+ht.slice(18):ht="!<"+ht+">",te.dump=ht+" "+te.dump}}return!0}a(Qe,"writeNode");function pe(te,Te){let Ge=[],J=[];Se(te,Ge,J);let se=J.length;for(let me=0;me{var r=Z8o(),n=X8o();function o(s,c){return function(){throw new Error("Function yaml."+s+" is removed in js-yaml 4. Use yaml."+c+" instead, which is now safe by default.")}}a(o,"renamed"),e.exports.Type=U_(),e.exports.Schema=J0n(),e.exports.FAILSAFE_SCHEMA=tgn(),e.exports.JSON_SCHEMA=sgn(),e.exports.CORE_SCHEMA=agn(),e.exports.DEFAULT_SCHEMA=z9t(),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=n.dump,e.exports.YAMLException=LIe(),e.exports.types={binary:ugn(),float:ogn(),map:egn(),null:rgn(),pairs:fgn(),set:pgn(),timestamp:cgn(),bool:ngn(),int:ign(),merge:lgn(),omap:dgn(),seq:X0n(),str:Z0n()},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")}))(),1),{Type:U8u,Schema:Q8u,FAILSAFE_SCHEMA:q8u,JSON_SCHEMA:j8u,CORE_SCHEMA:H8u,DEFAULT_SCHEMA:G8u,load:$8u,loadAll:V8u,dump:fK,YAMLException:W8u,types:z8u,safeLoad:Y8u,safeLoadAll:K8u,safeDump:J8u}=hgn.default,Z8u=hgn.default;function ggn(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=fK(e,{sortKeys:!1,lineWidth:-1,noRefs:!0,noCompatMode:!0,quotingType:'"',forceQuotes:!1}).trim(),o=t.prompt??"";return`--- +`:""}a(Fe,"dump"),e.exports.dump=Fe})),mgn=e6o(Zu(((t,e)=>{var r=r6o(),n=n6o();function o(s,c){return function(){throw new Error("Function yaml."+s+" is removed in js-yaml 4. Use yaml."+c+" instead, which is now safe by default.")}}a(o,"renamed"),e.exports.Type=U_(),e.exports.Schema=Z0n(),e.exports.FAILSAFE_SCHEMA=rgn(),e.exports.JSON_SCHEMA=agn(),e.exports.CORE_SCHEMA=cgn(),e.exports.DEFAULT_SCHEMA=Y9t(),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=n.dump,e.exports.YAMLException=BIe(),e.exports.types={binary:dgn(),float:sgn(),map:tgn(),null:ngn(),pairs:pgn(),set:hgn(),timestamp:lgn(),bool:ign(),int:ogn(),merge:ugn(),omap:fgn(),seq:egn(),str:X0n()},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")}))(),1),{Type:$8u,Schema:V8u,FAILSAFE_SCHEMA:W8u,JSON_SCHEMA:z8u,CORE_SCHEMA:Y8u,DEFAULT_SCHEMA:K8u,load:J8u,loadAll:Z8u,dump:fK,YAMLException:X8u,types:e6u,safeLoad:t6u,safeLoadAll:r6u,safeDump:n6u}=mgn.default,i6u=mgn.default;function Agn(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=fK(e,{sortKeys:!1,lineWidth:-1,noRefs:!0,noCompatMode:!0,quotingType:'"',forceQuotes:!1}).trim(),o=t.prompt??"";return`--- ${n} --- ${o} -`}a(ggn,"generateAgentMarkdown");p();p();p();p();p();p();var BIe={isBlocked:!1,reason:"VALID_FILE"},Aze={isBlocked:!1,reason:"NO_MATCHING_POLICY"},Agn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},pK={all:"all",repo:"repo"},jQ=new fe("contentExclusion");p();p();var yze=class{static{a(this,"PolicyEvaluator")}};p();p();p();var Y9t=new fe("repository"),hK=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(".")}},NP=class{static{a(this,"GitConfigLoader")}},Eze=class extends NP{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 ygn=require("os");var _ze=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 LU.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=LU.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,ygn.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 vze=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(NP).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 _ze(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 e6o=100,K9t=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])}}},_f=class t{constructor(e){this.ctx=e;this.remoteResolver=new vze;this.cache=new Cn(e6o)}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=uf(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 K9t(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(Qo),o=wa(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=wa(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=$W(r,s[1]),l=wa(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=wa(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=wa(c,"commondir");c=$W(c,(await e.readFileString(d)).trimEnd());let f=wa(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var mK=a((t,e)=>{if(XM.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...XM.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");p();p();p();var Cze=new WeakMap;function bze(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]"&&Cze.has(t))return Cze.get(t);switch(Cze.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(t6o,"n");function vgn(t,e){return function(r,n){return t6o(t,e,r,n)}}a(vgn,"o");p();p();p();var Z9t=a((t,e,r)=>{let n=t instanceof RegExp?Cgn(t,r):t,o=e instanceof RegExp?Cgn(e,r):e,s=n!==null&&o!=null&&r6o(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"),Cgn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),r6o=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 bgn="\0SLASH"+Math.random()+"\0",Sgn="\0OPEN"+Math.random()+"\0",eUt="\0CLOSE"+Math.random()+"\0",Tgn="\0COMMA"+Math.random()+"\0",Ign="\0PERIOD"+Math.random()+"\0",n6o=new RegExp(bgn,"g"),i6o=new RegExp(Sgn,"g"),o6o=new RegExp(eUt,"g"),s6o=new RegExp(Tgn,"g"),a6o=new RegExp(Ign,"g"),c6o=/\\\\/g,l6o=/\\{/g,u6o=/\\}/g,d6o=/\\,/g,f6o=/\\\./g,p6o=1e5;function X9t(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a(X9t,"numeric");function h6o(t){return t.replace(c6o,bgn).replace(l6o,Sgn).replace(u6o,eUt).replace(d6o,Tgn).replace(f6o,Ign)}a(h6o,"escapeBraces");function m6o(t){return t.replace(n6o,"\\").replace(i6o,"{").replace(o6o,"}").replace(s6o,",").replace(a6o,".")}a(m6o,"unescapeBraces");function xgn(t){if(!t)return[""];let e=[],r=Z9t("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=xgn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(xgn,"parseCommaParts");function wgn(t,e={}){if(!t)return[];let{max:r=p6o}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),FIe(h6o(t),r,!0).map(m6o)}a(wgn,"expand");function g6o(t){return"{"+t+"}"}a(g6o,"embrace");function A6o(t){return/^-?0\d/.test(t)}a(A6o,"isPadded");function y6o(t,e){return t<=e}a(y6o,"lte");function E6o(t,e){return t>=e}a(E6o,"gte");function FIe(t,e,r){let n=[],o=Z9t("{","}",t);if(!o)return[t];let s=o.pre,c=o.post.length?FIe(o.post,e,!1):[""];if(/\$$/.test(o.pre))for(let l=0;l=0;if(!d&&!f)return o.post.match(/,(?!,).*\}/)?(t=o.pre+"{"+o.body+eUt+o.post,FIe(t,e,!0)):[t];let h;if(d)h=o.body.split(/\.\./);else if(h=xgn(o.body),h.length===1&&h[0]!==void 0&&(h=FIe(h[0],e,!1).map(g6o),h.length===1))return c.map(g=>o.pre+h[0]+g);let m;if(d&&h[0]!==void 0&&h[1]!==void 0){let g=X9t(h[0]),A=X9t(h[1]),y=Math.max(h[0].length,h[1].length),E=h.length===3&&h[2]!==void 0?Math.max(Math.abs(X9t(h[2])),1):1,_=y6o;A0){let x=new Array(R+1).join("0");T<0?w="-"+x+w.slice(1):w=x+w}}m.push(w)}}else{m=[];for(let g=0;g{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");p();p();var _6o={"[: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]},QIe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),v6o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),Rgn=a(t=>t.join(""),"rangesToString"),kgn=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(QIe(h)+"-"+QIe(y)):y===h&&n.push(QIe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(QIe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(QIe(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 MC,C6o=new Set(["!","?","+","*","@"]),tUt=a(t=>C6o.has(t),"isExtglobType"),Pgn=a(t=>tUt(t.type),"isExtglobAST"),b6o=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),S6o=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),T6o=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Dgn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),I6o="(?!(?:^|/)\\.\\.?(?:$|/))",Tze="(?!\\.)",x6o=new Set(["[","."]),w6o=new Set(["..","."]),R6o=new Set("().*{}+?[]^$\\!"),k6o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),rUt="[^/]",Ngn=rUt+"*?",Mgn=rUt+"+?",P6o=0,gK=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++P6o;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"?MC.#k(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||E,this.#r=this.#r||_,A}).join(""),f="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&w6o.has(this.#n[0]))){let A=x6o,y=r&&A.has(d.charAt(0))||d.startsWith("\\.")&&A.has(d.charAt(2))||d.startsWith("\\.\\.")&&A.has(d.charAt(4)),E=!r&&!e&&A.has(d.charAt(0));f=y?I6o:E?Tze:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,MP(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,MP(this.toString()),!1,!1]}let c=!n||e||r||!Tze?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?Tze:"")+Mgn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Tze:"")+Ngn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,MP(s),this.#t=!!this.#t,this.#r]}#S(){if(Pgn(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 vf=a((t,e,r={})=>(UIe(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Q_(e,r).match(t)),"minimatch"),D6o=/^\*+([^+@!?*[(]*)$/,N6o=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),M6o=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),O6o=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),L6o=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),B6o=/^\*+\.\*+$/,F6o=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),U6o=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),Q6o=/^\.\*+$/,q6o=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),j6o=/^\*+$/,H6o=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),G6o=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),$6o=/^\?+([^+@!?*[(]*)?$/,V6o=a(([t,e=""])=>{let r=Bgn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),W6o=a(([t,e=""])=>{let r=Fgn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),z6o=a(([t,e=""])=>{let r=Fgn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),Y6o=a(([t,e=""])=>{let r=Bgn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),Bgn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),Fgn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),Ugn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ogn={win32:{sep:"\\"},posix:{sep:"/"}},K6o=Ugn==="win32"?Ogn.win32.sep:Ogn.posix.sep;vf.sep=K6o;var Jp=Symbol("globstar **");vf.GLOBSTAR=Jp;var J6o="[^/]",Z6o=J6o+"*?",X6o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",e9o="(?:(?!(?:\\/|^)\\.).)*?",t9o=a((t,e={})=>r=>vf(r,t,e),"filter");vf.filter=t9o;var Wx=a((t,e={})=>Object.assign({},t,e),"ext"),r9o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return vf;let e=vf;return Object.assign(a((n,o,s={})=>e(n,o,Wx(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,Wx(t,s))}static defaults(o){return e.defaults(Wx(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,Wx(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Wx(t,s))}},unescape:a((n,o={})=>e.unescape(n,Wx(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,Wx(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,Wx(t,o)),"filter"),defaults:a(n=>e.defaults(Wx(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,Wx(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,Wx(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,Wx(t,s)),"match"),sep:e.sep,GLOBSTAR:Jp})},"defaults");vf.defaults=r9o;var Qgn=a((t,e={})=>(UIe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:wgn(t,{max:e.braceExpandMax})),"braceExpand");vf.braceExpand=Qgn;var n9o=a((t,e={})=>new Q_(t,e).makeRe(),"makeRe");vf.makeRe=n9o;var i9o=a((t,e,r={})=>{let n=new Q_(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");vf.match=i9o;var Lgn=/[?*]|[+@!]\(.*?\)|\[|\]/,o9o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Q_=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={}){UIe(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||Ugn,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]==="?"||!Lgn.test(s[2]))&&!Lgn.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(Jp)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(Jp,s),l=r.lastIndexOf(Jp),[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 b=o;b{let d=u.map(h=>{if(h instanceof RegExp)for(let m of h.flags.split(""))o.add(m);return typeof h=="string"?o9o(h):h===Jp?Jp:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==Jp||A===Jp||(A===void 0?g!==void 0&&g!==Jp?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==Jp&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=Jp))});let f=d.filter(h=>h!==Jp);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 vf.defaults(e).Minimatch}};vf.AST=gK;vf.Minimatch=Q_;vf.escape=Lle;vf.unescape=MP;var nUt="contentExclusion",Ize=class extends yze{static{a(this,"CopilotContentExclusion")}#e;#t=new Cn(1e4);#r=new Cn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=$W(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??pK.all);if(!o)return Aze;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 jQ.exception(this.#e,n,`${nUt}.evaluate`),Agn}return BIe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=BIe,c,l=BDt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(vf(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=iUt(u,"FILE_BLOCKED_PATH"),c=d;break e}return jQ.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 BIe;let c=this.evaluateFileContent(o,s,n);return jQ.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=>qgn(c)).some(c=>c.test(n)))return iUt(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>qgn(c)).some(c=>c.test(n)))return iUt(o,"FILE_BLOCKED_TEXT_BASED");return BIe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){qa(this.#e,e,`${nUt}.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=vgn(async e=>{let r=await this.#e.get(Qt).getGitHubSession();if(!r)throw new yi("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(pK.all);e.filter(u=>u!==pK.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==pK.all).join(",")),n.searchParams.set("scope",o?pK.all:pK.repo);let c=await Gf(this.#e,r,n.href),l=await c.json();if(!c.ok){if(c.status===404)return Array.from(e,()=>[]);throw this.#s("fetch.error",{message:l.message}),new aM(c)}return this.#s("fetch.success"),mK(l9o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(_f).getRepo(uf(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){Et(this.#e,`${nUt}.${e}`,Wt.createAndMarkAsIssued(r,n))}};function qgn(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(qgn,"stringToRegex");function iUt(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(iUt,"fileBlockedEvaluationResult");var s9o=S.Object({name:S.String(),type:S.String()}),a9o=S.Object({paths:S.Array(S.String()),ifNoneMatch:S.Optional(S.Array(S.String())),ifAnyMatch:S.Optional(S.Array(S.String())),source:s9o}),oUt=S.Array(a9o),c9o=S.Object({rules:oUt,last_updated_at:S.String(),scope:S.String()}),l9o=S.Array(c9o);var nc=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new Ize(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=z0(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get($r).onDidFocusTextDocument(r),bs(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){jQ.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(ps).setClsInactive(r??"Copilot is disabled"):this.ctx.get(ps).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===Aze.reason)return jQ.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 Et(this.ctx,e,Wt.createAndMarkAsIssued(l,u)),Et(this.ctx,e,Wt.createAndMarkAsIssued({...l,path:r},u),1),jQ.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 Ble(t,e,r){let n=await t.get(nc).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(Ble,"isDocumentValid");var $r=class{constructor(e,r=Ble){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=Fs(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(Qo).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(Qo).readFileString(e)}getWorkspaceFolder(e){let r=Fs(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(Fs(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=Fs(e.uri);for(let n of this.getWorkspaceFolders()){let o=Fs(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return Ji(r)}};p();p();var ot=new fe("chat");p();var xze=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new Wi;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 zx=class{constructor(e){this.ctx=e;this.watchers=new Cn(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(z0(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 HQ=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},u9o="workspaceLifecycleManager",sE=new fe(u9o),US=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=bs(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?sE.debug(this.ctx,`listener ${e.constructor.name} is already started`):(sE.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):sE.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);sE.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){sE.debug(r,"No workspaces to add.");return}sE.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];sE.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)));sE.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));sE.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));sE.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){sE.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(zx).terminateWatching(l);for(let d of this.activeListeners)sE.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;sE.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(zx);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){sE.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)sE.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)sE.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(zx).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 wze(t){t.set(US,new US(t))}a(wze,"setupWorkspaceLifecycleListener");var GQ=de(require("fs")),Yx=de(require("path"));var sUt=".agent.md",d9o=300*1e3,f9o="github",Hgn="agents";function qIe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(qIe,"sanitizeSegment");function p9o(t){return t.replace(/\\/g,"/")}a(p9o,"toPosix");var w3=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new fe("OrgCustomAgentService");this.fetchSequencer=new Vx;this.activated=!1;this.orgs=new Map;this.client=o.client??new gze(e),this.resolveNwo=o.resolveNwo??(s=>W9t(s,[e.get($m).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??d9o,this.cacheRoot=Yx.join(this.persistenceManager.directory,f9o),this.lifecycleListener=new aUt(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=p9o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${Hgn}/*${sUt}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:Ggn.githubOrg}),this.tokenSubscription=bs(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=>Fs(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(qIe(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=Yx.relative(this.cacheRoot,e);if(r.startsWith("..")||Yx.isAbsolute(r))return;let n=r.indexOf(Yx.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=Fs(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=Fs(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(Ft(this.ctx,Ye.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await GQ.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${sUt}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(Yx.join(o,l),ggn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return Yx.join(this.cacheRoot,qIe(e.owner),qIe(e.repo),Hgn)}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 GQ.promises.stat(e)).size===n.length&&(await GQ.promises.readFile(e)).equals(n))return}catch{}await GQ.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await GQ.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(sUt)&&!r.has(o.name))try{await GQ.promises.unlink(Yx.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=Yx.join(this.cacheRoot,qIe(e.owner),qIe(e.repo));try{await GQ.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)}`)}}},aUt=class extends HQ{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 a0=class{static{a(this,"PromptChangeNotifier")}},Rze=class extends a0{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function $gn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a($gn,"createPromptFilesChangedEvent");function Vgn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(Vgn,"createBatchPromptFilesChangedEvent");p();var ep=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 Fle(...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(Fle,"anyEvent");var Kgn=require("os"),jIe=de(require("path"));function Ule(t){return t.replace(/\\/g,"/")}a(Ule,"toForwardSlash");function Wgn(...t){return jIe.default.posix.join(...t.map(Ule))}a(Wgn,"globJoin");function m9o(t){let e=Ule(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(m9o,"containsTraversal");function zgn(t,e){let r=Ule(jIe.default.posix.normalize(Ule(t))),n=Ule(jIe.default.posix.normalize(Ule(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(zgn,"isContained");var Ygn=["*","?","{","["],wA=class{constructor(e,r){this.ctx=e;this.logger=new fe("PromptFileLocationRegistry");this._onLocationsChanged=new ep;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??Kgn.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(m9o(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=Ygn.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=Wgn(f,d.pattern.slice(2));if(!zgn(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=Wgn(f,d.pattern);zgn(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 Ygn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire($gn(e,"ConfigChanged"))}};p();p();p();p();var cUt=de(require("path"));function Kx(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=cUt.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!cUt.posix.isAbsolute(s)}a(Kx,"isEqualOrParent");var OC=process.platform==="linux";function $Q(t){return t.replace(/\\/g,"/")}a($Q,"normalizeSlashes");function lg(t){let e=$Q(t);return OC?e:e.toLowerCase()}a(lg,"canonicalKey");function Jgn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>OC?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&&Kx(h,d,OC))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(Jgn,"coalesceEvents");var kze=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=Fle(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=Fle(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 k3=de(require("fs"));var AK=new fe("NodeJSWatcherService"),g9o=1e3,Pze=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._onDidError=new ep;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??k3.watch,this._fsWatchFile=o??{watchFile:k3.watchFile,unwatchFile:k3.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=$Q(e.path),n=lg(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){AK.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){AK.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return k3.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?E9o(e,$Q(o)):e,c=A9o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),AK.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}),AK.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){AK.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=y9o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:g9o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),AK.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){AK.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function A9o(t,e){if(t==="change")return"update";try{return k3.statSync(e),"create"}catch{return"delete"}}a(A9o,"classify");function y9o(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(y9o,"classifyStat");function E9o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(E9o,"joinPosix");p();var PAn=de(kAn()),DAn=require("os"),NAn=de(require("path"));var Oze=new fe("ParcelWatcherService"),lUo=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",uUo=process.platform==="darwin"?[NAn.join((0,DAn.homedir)(),"Library","Containers")]:[],Lze=class{constructor(e,r){this.ctx=e;this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._onDidError=new ep;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??PAn.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=$Q(e.path),n=lg(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=$Q(e),o=this._findCoveringRoot(n);if(!o)return;let s=lg(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(Kx(r.path,e,OC))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&Kx(e.path,o.path,OC)){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=lg(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=>{Oze.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:lUo,ignore:uUo}).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=lg(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=$Q(s.path);n.push({path:c,type:s.type})}let o=Jgn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=lg(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){Oze.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(Oze.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(ts).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),Oze.warn(this.ctx,"Failed to watch for file changes at",r,e))}};function Bze(t){let e=new Lze(t),r=new Pze(t,e);return new kze(t,e,r)}a(Bze,"createUniversalWatcher");var MAn=de(require("fs"));var VQ=de(require("path"));var dUo=100,Fze=/[*?{[]/,EUt=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"||!Kx(e.path,this.request.path,OC)&&!Kx(this.request.path,e.path,OC))return;this._tryActivate();return}e.type==="delete"&&Kx(e.path,this.request.path,OC)&&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=VQ.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=fUo(this.request.path,this.statSync);if(n===void 0||pUo(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 fUo(t,e){let r=VQ.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=VQ.dirname(r)}}a(fUo,"findExistingAncestor");function pUo(t,e){return VQ.dirname(e)===t?!1:t===VQ.parse(t).root}a(pUo,"isAncestorTooBroad");var Uze=class{constructor(e,r,n=MAn.statSync){this._onPromptFileChanged=new ep;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??Bze(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=Fze.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new Q_(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=Vgn([...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 EUt(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!Fze.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 Fze.test(n)}_extractBaseDir(e){let r=Fze.exec(e);if(!r)return VQ.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=Kx(r.path,l,OC),d=Kx(l,r.path,OC);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()},dUo)}_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 Jx(t,e,...r){return e.replace(/\{(\d+)\}/g,(n,o)=>{let s=r[Number(o)];return s!==void 0?String(s):n})}a(Jx,"localize");function hUo(t,e=[],r={}){let o=new _Ut(t).scan();return new vUt(o,t,e,r).parse()}a(hUo,"parseRaw");function Xp(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(Xp,"makeToken");var _Ut=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(Xp(13,this.pos,this.pos)),this.tokens}scanLine(){if(this.seenBlockColon=!1,this.peekChar()===` +`}a(Agn,"generateAgentMarkdown");p();p();p();p();p();p();var FIe={isBlocked:!1,reason:"VALID_FILE"},Eze={isBlocked:!1,reason:"NO_MATCHING_POLICY"},ygn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},pK={all:"all",repo:"repo"},HQ=new fe("contentExclusion");p();p();var _ze=class{static{a(this,"PolicyEvaluator")}};p();p();p();var K9t=new fe("repository"),hK=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(".")}},MP=class{static{a(this,"GitConfigLoader")}},vze=class extends MP{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 Egn=require("os");var Cze=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 BU.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=BU.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,Egn.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 bze=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(MP).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 Cze(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 i6o=100,J9t=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])}}},_f=class t{constructor(e){this.ctx=e;this.remoteResolver=new bze;this.cache=new Cn(i6o)}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=uf(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 J9t(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(qo),o=xa(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=xa(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=VW(r,s[1]),l=xa(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=xa(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=xa(c,"commondir");c=VW(c,(await e.readFileString(d)).trimEnd());let f=xa(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var mK=a((t,e)=>{if(eO.Check(t,e))return e;let r=`Typebox schema validation failed: +${[...eO.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` +`)}`;throw new Error(r)},"assertShape");p();p();p();var Sze=new WeakMap;function Tze(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]"&&Sze.has(t))return Sze.get(t);switch(Sze.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(o6o,"n");function Cgn(t,e){return function(r,n){return o6o(t,e,r,n)}}a(Cgn,"o");p();p();p();var X9t=a((t,e,r)=>{let n=t instanceof RegExp?bgn(t,r):t,o=e instanceof RegExp?bgn(e,r):e,s=n!==null&&o!=null&&s6o(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"),bgn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),s6o=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 Sgn="\0SLASH"+Math.random()+"\0",Tgn="\0OPEN"+Math.random()+"\0",tUt="\0CLOSE"+Math.random()+"\0",Ign="\0COMMA"+Math.random()+"\0",xgn="\0PERIOD"+Math.random()+"\0",a6o=new RegExp(Sgn,"g"),c6o=new RegExp(Tgn,"g"),l6o=new RegExp(tUt,"g"),u6o=new RegExp(Ign,"g"),d6o=new RegExp(xgn,"g"),f6o=/\\\\/g,p6o=/\\{/g,h6o=/\\}/g,m6o=/\\,/g,g6o=/\\\./g,A6o=1e5;function eUt(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a(eUt,"numeric");function y6o(t){return t.replace(f6o,Sgn).replace(p6o,Tgn).replace(h6o,tUt).replace(m6o,Ign).replace(g6o,xgn)}a(y6o,"escapeBraces");function E6o(t){return t.replace(a6o,"\\").replace(c6o,"{").replace(l6o,"}").replace(u6o,",").replace(d6o,".")}a(E6o,"unescapeBraces");function wgn(t){if(!t)return[""];let e=[],r=X9t("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=wgn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(wgn,"parseCommaParts");function Rgn(t,e={}){if(!t)return[];let{max:r=A6o}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),UIe(y6o(t),r,!0).map(E6o)}a(Rgn,"expand");function _6o(t){return"{"+t+"}"}a(_6o,"embrace");function v6o(t){return/^-?0\d/.test(t)}a(v6o,"isPadded");function C6o(t,e){return t<=e}a(C6o,"lte");function b6o(t,e){return t>=e}a(b6o,"gte");function UIe(t,e,r){let n=[],o=X9t("{","}",t);if(!o)return[t];let s=o.pre,c=o.post.length?UIe(o.post,e,!1):[""];if(/\$$/.test(o.pre))for(let l=0;l=0;if(!d&&!f)return o.post.match(/,(?!,).*\}/)?(t=o.pre+"{"+o.body+tUt+o.post,UIe(t,e,!0)):[t];let h;if(d)h=o.body.split(/\.\./);else if(h=wgn(o.body),h.length===1&&h[0]!==void 0&&(h=UIe(h[0],e,!1).map(_6o),h.length===1))return c.map(g=>o.pre+h[0]+g);let m;if(d&&h[0]!==void 0&&h[1]!==void 0){let g=eUt(h[0]),A=eUt(h[1]),y=Math.max(h[0].length,h[1].length),E=h.length===3&&h[2]!==void 0?Math.max(Math.abs(eUt(h[2])),1):1,_=C6o;A0){let x=new Array(R+1).join("0");T<0?w="-"+x+w.slice(1):w=x+w}}m.push(w)}}else{m=[];for(let g=0;g{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");p();p();var S6o={"[: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]},qIe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),T6o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),kgn=a(t=>t.join(""),"rangesToString"),Pgn=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(qIe(h)+"-"+qIe(y)):y===h&&n.push(qIe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(qIe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(qIe(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 OC,I6o=new Set(["!","?","+","*","@"]),rUt=a(t=>I6o.has(t),"isExtglobType"),Dgn=a(t=>rUt(t.type),"isExtglobAST"),x6o=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),w6o=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),R6o=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Ngn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),k6o="(?!(?:^|/)\\.\\.?(?:$|/))",xze="(?!\\.)",P6o=new Set(["[","."]),D6o=new Set(["..","."]),N6o=new Set("().*{}+?[]^$\\!"),M6o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),nUt="[^/]",Mgn=nUt+"*?",Ogn=nUt+"+?",O6o=0,gK=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++O6o;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"?OC.#k(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||E,this.#r=this.#r||_,A}).join(""),f="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&D6o.has(this.#n[0]))){let A=P6o,y=r&&A.has(d.charAt(0))||d.startsWith("\\.")&&A.has(d.charAt(2))||d.startsWith("\\.\\.")&&A.has(d.charAt(4)),E=!r&&!e&&A.has(d.charAt(0));f=y?k6o:E?xze:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,OP(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,OP(this.toString()),!1,!1]}let c=!n||e||r||!xze?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?xze:"")+Ogn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?xze:"")+Mgn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,OP(s),this.#t=!!this.#t,this.#r]}#S(){if(Dgn(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 vf=a((t,e,r={})=>(QIe(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Q_(e,r).match(t)),"minimatch"),L6o=/^\*+([^+@!?*[(]*)$/,B6o=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),F6o=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),U6o=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),Q6o=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),q6o=/^\*+\.\*+$/,j6o=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),H6o=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),G6o=/^\.\*+$/,$6o=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),V6o=/^\*+$/,W6o=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),z6o=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),Y6o=/^\?+([^+@!?*[(]*)?$/,K6o=a(([t,e=""])=>{let r=Fgn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),J6o=a(([t,e=""])=>{let r=Ugn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),Z6o=a(([t,e=""])=>{let r=Ugn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),X6o=a(([t,e=""])=>{let r=Fgn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),Fgn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),Ugn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),Qgn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Lgn={win32:{sep:"\\"},posix:{sep:"/"}},e9o=Qgn==="win32"?Lgn.win32.sep:Lgn.posix.sep;vf.sep=e9o;var Jp=Symbol("globstar **");vf.GLOBSTAR=Jp;var t9o="[^/]",r9o=t9o+"*?",n9o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",i9o="(?:(?!(?:\\/|^)\\.).)*?",o9o=a((t,e={})=>r=>vf(r,t,e),"filter");vf.filter=o9o;var zx=a((t,e={})=>Object.assign({},t,e),"ext"),s9o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return vf;let e=vf;return Object.assign(a((n,o,s={})=>e(n,o,zx(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,zx(t,s))}static defaults(o){return e.defaults(zx(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,zx(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,zx(t,s))}},unescape:a((n,o={})=>e.unescape(n,zx(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,zx(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,zx(t,o)),"filter"),defaults:a(n=>e.defaults(zx(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,zx(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,zx(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,zx(t,s)),"match"),sep:e.sep,GLOBSTAR:Jp})},"defaults");vf.defaults=s9o;var qgn=a((t,e={})=>(QIe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Rgn(t,{max:e.braceExpandMax})),"braceExpand");vf.braceExpand=qgn;var a9o=a((t,e={})=>new Q_(t,e).makeRe(),"makeRe");vf.makeRe=a9o;var c9o=a((t,e,r={})=>{let n=new Q_(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");vf.match=c9o;var Bgn=/[?*]|[+@!]\(.*?\)|\[|\]/,l9o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Q_=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={}){QIe(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||Qgn,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]==="?"||!Bgn.test(s[2]))&&!Bgn.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(Jp)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(Jp,s),l=r.lastIndexOf(Jp),[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 b=o;b{let d=u.map(h=>{if(h instanceof RegExp)for(let m of h.flags.split(""))o.add(m);return typeof h=="string"?l9o(h):h===Jp?Jp:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==Jp||A===Jp||(A===void 0?g!==void 0&&g!==Jp?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==Jp&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=Jp))});let f=d.filter(h=>h!==Jp);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 vf.defaults(e).Minimatch}};vf.AST=gK;vf.Minimatch=Q_;vf.escape=Lle;vf.unescape=OP;var iUt="contentExclusion",wze=class extends _ze{static{a(this,"CopilotContentExclusion")}#e;#t=new Cn(1e4);#r=new Cn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=VW(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??pK.all);if(!o)return Eze;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 HQ.exception(this.#e,n,`${iUt}.evaluate`),ygn}return FIe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=FIe,c,l=FDt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(vf(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=oUt(u,"FILE_BLOCKED_PATH"),c=d;break e}return HQ.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 FIe;let c=this.evaluateFileContent(o,s,n);return HQ.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=>jgn(c)).some(c=>c.test(n)))return oUt(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>jgn(c)).some(c=>c.test(n)))return oUt(o,"FILE_BLOCKED_TEXT_BASED");return FIe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){Qa(this.#e,e,`${iUt}.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=Cgn(async e=>{let r=await this.#e.get(Qt).getGitHubSession();if(!r)throw new yi("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(pK.all);e.filter(u=>u!==pK.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==pK.all).join(",")),n.searchParams.set("scope",o?pK.all:pK.repo);let c=await Gf(this.#e,r,n.href),l=await c.json();if(!c.ok){if(c.status===404)return Array.from(e,()=>[]);throw this.#s("fetch.error",{message:l.message}),new cM(c)}return this.#s("fetch.success"),mK(p9o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(_f).getRepo(uf(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){Et(this.#e,`${iUt}.${e}`,Wt.createAndMarkAsIssued(r,n))}};function jgn(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(jgn,"stringToRegex");function oUt(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(oUt,"fileBlockedEvaluationResult");var u9o=S.Object({name:S.String(),type:S.String()}),d9o=S.Object({paths:S.Array(S.String()),ifNoneMatch:S.Optional(S.Array(S.String())),ifAnyMatch:S.Optional(S.Array(S.String())),source:u9o}),sUt=S.Array(d9o),f9o=S.Object({rules:sUt,last_updated_at:S.String(),scope:S.String()}),p9o=S.Array(f9o);var nc=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new wze(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=z0(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get($r).onDidFocusTextDocument(r),bs(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){HQ.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(ps).setClsInactive(r??"Copilot is disabled"):this.ctx.get(ps).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===Eze.reason)return HQ.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 Et(this.ctx,e,Wt.createAndMarkAsIssued(l,u)),Et(this.ctx,e,Wt.createAndMarkAsIssued({...l,path:r},u),1),HQ.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 Ble(t,e,r){let n=await t.get(nc).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(Ble,"isDocumentValid");var $r=class{constructor(e,r=Ble){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=Fs(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(qo).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(qo).readFileString(e)}getWorkspaceFolder(e){let r=Fs(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(Fs(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=Fs(e.uri);for(let n of this.getWorkspaceFolders()){let o=Fs(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return Ji(r)}};p();p();var ot=new fe("chat");p();var Rze=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new Wi;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 Yx=class{constructor(e){this.ctx=e;this.watchers=new Cn(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(z0(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 GQ=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},h9o="workspaceLifecycleManager",sE=new fe(h9o),qS=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=bs(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?sE.debug(this.ctx,`listener ${e.constructor.name} is already started`):(sE.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):sE.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);sE.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){sE.debug(r,"No workspaces to add.");return}sE.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];sE.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)));sE.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));sE.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));sE.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){sE.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(Yx).terminateWatching(l);for(let d of this.activeListeners)sE.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;sE.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(Yx);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){sE.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)sE.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)sE.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(Yx).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 kze(t){t.set(qS,new qS(t))}a(kze,"setupWorkspaceLifecycleListener");var $Q=de(require("fs")),Kx=de(require("path"));var aUt=".agent.md",m9o=300*1e3,g9o="github",Ggn="agents";function jIe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(jIe,"sanitizeSegment");function A9o(t){return t.replace(/\\/g,"/")}a(A9o,"toPosix");var R3=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new fe("OrgCustomAgentService");this.fetchSequencer=new Wx;this.activated=!1;this.orgs=new Map;this.client=o.client??new yze(e),this.resolveNwo=o.resolveNwo??(s=>z9t(s,[e.get($m).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??m9o,this.cacheRoot=Kx.join(this.persistenceManager.directory,g9o),this.lifecycleListener=new cUt(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=A9o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${Ggn}/*${aUt}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:$gn.githubOrg}),this.tokenSubscription=bs(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=>Fs(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(jIe(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=Kx.relative(this.cacheRoot,e);if(r.startsWith("..")||Kx.isAbsolute(r))return;let n=r.indexOf(Kx.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=Fs(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=Fs(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(Ft(this.ctx,Ye.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await $Q.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${aUt}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(Kx.join(o,l),Agn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return Kx.join(this.cacheRoot,jIe(e.owner),jIe(e.repo),Ggn)}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 $Q.promises.stat(e)).size===n.length&&(await $Q.promises.readFile(e)).equals(n))return}catch{}await $Q.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await $Q.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(aUt)&&!r.has(o.name))try{await $Q.promises.unlink(Kx.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=Kx.join(this.cacheRoot,jIe(e.owner),jIe(e.repo));try{await $Q.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)}`)}}},cUt=class extends GQ{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 a0=class{static{a(this,"PromptChangeNotifier")}},Pze=class extends a0{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function Vgn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a(Vgn,"createPromptFilesChangedEvent");function Wgn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(Wgn,"createBatchPromptFilesChangedEvent");p();var ep=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 Fle(...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(Fle,"anyEvent");var Jgn=require("os"),HIe=de(require("path"));function Ule(t){return t.replace(/\\/g,"/")}a(Ule,"toForwardSlash");function zgn(...t){return HIe.default.posix.join(...t.map(Ule))}a(zgn,"globJoin");function E9o(t){let e=Ule(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(E9o,"containsTraversal");function Ygn(t,e){let r=Ule(HIe.default.posix.normalize(Ule(t))),n=Ule(HIe.default.posix.normalize(Ule(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(Ygn,"isContained");var Kgn=["*","?","{","["],wA=class{constructor(e,r){this.ctx=e;this.logger=new fe("PromptFileLocationRegistry");this._onLocationsChanged=new ep;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??Jgn.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(E9o(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=Kgn.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=zgn(f,d.pattern.slice(2));if(!Ygn(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=zgn(f,d.pattern);Ygn(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 Kgn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire(Vgn(e,"ConfigChanged"))}};p();p();p();p();var lUt=de(require("path"));function Jx(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=lUt.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!lUt.posix.isAbsolute(s)}a(Jx,"isEqualOrParent");var LC=process.platform==="linux";function VQ(t){return t.replace(/\\/g,"/")}a(VQ,"normalizeSlashes");function lg(t){let e=VQ(t);return LC?e:e.toLowerCase()}a(lg,"canonicalKey");function Zgn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>LC?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&&Jx(h,d,LC))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(Zgn,"coalesceEvents");var Dze=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=Fle(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=Fle(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 P3=de(require("fs"));var AK=new fe("NodeJSWatcherService"),_9o=1e3,Nze=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._onDidError=new ep;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??P3.watch,this._fsWatchFile=o??{watchFile:P3.watchFile,unwatchFile:P3.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=VQ(e.path),n=lg(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){AK.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){AK.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return P3.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?b9o(e,VQ(o)):e,c=v9o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),AK.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}),AK.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){AK.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=C9o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:_9o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),AK.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){AK.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function v9o(t,e){if(t==="change")return"update";try{return P3.statSync(e),"create"}catch{return"delete"}}a(v9o,"classify");function C9o(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(C9o,"classifyStat");function b9o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(b9o,"joinPosix");p();var DAn=de(PAn()),NAn=require("os"),MAn=de(require("path"));var Bze=new fe("ParcelWatcherService"),pUo=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",hUo=process.platform==="darwin"?[MAn.join((0,NAn.homedir)(),"Library","Containers")]:[],Fze=class{constructor(e,r){this.ctx=e;this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._onDidError=new ep;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??DAn.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=VQ(e.path),n=lg(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=VQ(e),o=this._findCoveringRoot(n);if(!o)return;let s=lg(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(Jx(r.path,e,LC))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&Jx(e.path,o.path,LC)){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=lg(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=>{Bze.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:pUo,ignore:hUo}).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=lg(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=VQ(s.path);n.push({path:c,type:s.type})}let o=Zgn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=lg(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){Bze.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(Bze.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(ts).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),Bze.warn(this.ctx,"Failed to watch for file changes at",r,e))}};function Uze(t){let e=new Fze(t),r=new Nze(t,e);return new Dze(t,e,r)}a(Uze,"createUniversalWatcher");var OAn=de(require("fs"));var WQ=de(require("path"));var mUo=100,Qze=/[*?{[]/,_Ut=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"||!Jx(e.path,this.request.path,LC)&&!Jx(this.request.path,e.path,LC))return;this._tryActivate();return}e.type==="delete"&&Jx(e.path,this.request.path,LC)&&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=WQ.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=gUo(this.request.path,this.statSync);if(n===void 0||AUo(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 gUo(t,e){let r=WQ.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=WQ.dirname(r)}}a(gUo,"findExistingAncestor");function AUo(t,e){return WQ.dirname(e)===t?!1:t===WQ.parse(t).root}a(AUo,"isAncestorTooBroad");var qze=class{constructor(e,r,n=OAn.statSync){this._onPromptFileChanged=new ep;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??Uze(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=Qze.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new Q_(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=Wgn([...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 _Ut(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!Qze.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 Qze.test(n)}_extractBaseDir(e){let r=Qze.exec(e);if(!r)return WQ.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=Jx(r.path,l,LC),d=Jx(l,r.path,LC);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()},mUo)}_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 Zx(t,e,...r){return e.replace(/\{(\d+)\}/g,(n,o)=>{let s=r[Number(o)];return s!==void 0?String(s):n})}a(Zx,"localize");function yUo(t,e=[],r={}){let o=new vUt(t).scan();return new CUt(o,t,e,r).parse()}a(yUo,"parseRaw");function Xp(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(Xp,"makeToken");var vUt=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(Xp(13,this.pos,this.pos)),this.tokens}scanLine(){if(this.seenBlockColon=!1,this.peekChar()===` `){this.tokens.push(Xp(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(Xp(8,this.pos,n)),this.pos=n;return}let e=this.pos,r=0;for(;this.pos0&&this.tokens.push(Xp(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]}},vUt=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]}},CUt=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(Jx("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(Jx("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(Jx("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(Jx("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(Jx("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(Jx("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(Jx("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.currentIndent()<=e?(this.emitError(Jx("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(Jx("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(Jx("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(Jx("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(Jx("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 OAn(t,e=[],r={}){let n=[],o=hUo(t,n,r),s=mUo(t);for(let c of n)e.push({message:c.message,code:c.code,start:uO(s,c.startOffset),end:uO(s,c.endOffset)});return o===void 0?void 0:CUt(s,o)}a(OAn,"parse");function mUo(t){let e=[0];for(let r=0;re)this.emitError(Zx("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(Zx("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(Zx("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(Zx("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(Zx("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(Zx("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(Zx("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.currentIndent()<=e?(this.emitError(Zx("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(Zx("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(Zx("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(Zx("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(Zx("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 LAn(t,e=[],r={}){let n=[],o=yUo(t,n,r),s=EUo(t);for(let c of n)e.push({message:c.message,code:c.code,start:uO(s,c.startOffset),end:uO(s,c.endOffset)});return o===void 0?void 0:bUt(s,o)}a(LAn,"parse");function EUo(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(uO,"offsetToPosition");function CUt(t,e){switch(e.type){case"scalar":return gUo(t,e);case"sequence":return{type:"array",items:e.items.map(r=>CUt(t,r)),start:uO(t,e.startOffset),end:uO(t,e.endOffset)};case"map":return{type:"object",properties:e.properties.map(r=>({key:AUo(t,r.key),value:CUt(t,r.value)})),start:uO(t,e.startOffset),end:uO(t,e.endOffset)}}}a(CUt,"convertNode");function gUo(t,e){let r=uO(t,e.startOffset),n=uO(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(gUo,"convertScalar");function AUo(t,e){return{type:"string",value:e.value,start:uO(t,e.startOffset),end:uO(t,e.endOffset)}}a(AUo,"convertScalarAsString");var LP=de(eh());var dO=class{static{a(this,"PromptsParser")}constructor(){}parse(e,r){let n=this.#t(r);if(n.length===0)return new jze(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 LP.Range(2,1,l+1,1);o=new TUt(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 LP.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===EUo);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}}},IUt=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;sLP.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,E=new LP.Range(s+1,A+1,s+1,y+1);r.push({content:h[2],range:E,isMarkdownLink:!1})}}else{let A=h.index+1,y=h.index+h[0].length,E=new LP.Range(s+1,A+1,s+1,y+1);n.push({name:h[2],range:E,offset:c+h.index})}}c+=l.length}this._parsed={fileReferences:r.sort((s,c)=>LP.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();var _Uo=new Set(["sessionStart","sessionEnd","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),vUo="agentHook.event.load",Hze=class{constructor(){this.logger=new fe("HookParser")}static{a(this,"HookParser")}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 At(e,vUo,this.buildHookCountsByEventType(c)),{uri:r,version:1,hooks:c}}buildHookCountsByEventType(e){let r={};for(let[n,o]of Object.entries(e))o!==void 0&&(r[`${n}.hookCount`]=String(o.length));return r}isValidEventType(e){return _Uo.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")}};p();var BAn=require("os");var CUo=(0,BAn.platform)()==="win32",tp=class{constructor(){this.trustByUri=new Map;this.emitter=new Wi;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 xUt)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 HQ{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(f){c(f)}},e.get(US).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 xUt)this.notifyChange(h)}},"flushPending");this.trustSubscription=e.get(tp).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(tp),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=FAn(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(Qo).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(US).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(Qo).readFileString(r.uri))}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(FAn(o,Ks(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(a0).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=bUo(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(wA),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 xUt)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(tp);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=>Kx(s.normalized,o.normalized,OC))||n.push(o);return n.map(o=>o.raw)}};p();var jl=class{constructor(){this.policyChangeEmitter=new ep;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},Gze=class extends jl{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var wUt=64;var P3=(r=>(r.enabled="enabled",r.disabled="disabled",r))(P3||{}),dg={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},rp={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},EK=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,wUt),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},YQ=class extends EK{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},Rr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},KQ=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},_K=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};var Lr=class{static{a(this,"LanguageModelToolResult")}constructor(e,r){this.status=r,this.content=e}},JQ=class extends Lr{static{a(this,"ExtendedLanguageModelToolResult")}},UAn=S.Object({content:S.Array(S.Union([S.Object({value:S.String()}),S.Object({value:S.Unknown()})])),status:S.Optional(S.Union([S.Literal("success"),S.Literal("error"),S.Literal("cancelled")]))}),D3=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(D3||{}),QAn=S.Object({result:S.Enum(D3)});var RUt=de(require("fs"));var YIe=de(require("path"));var PUt=["user","model"],DUt="source",NUt={githubOrg:"github-org"},Ggn={githubOrg:{[DUt]:NUt.githubOrg}},kUt=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??Ji(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||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??PUt}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(NUt));for(let n of e){let o=n[DUt];if(typeof o=="string"&&r.has(o))return o}}get providers(){return x3(this.promptFileEntry.promptPath.metadata)}},qAn="./assets/prompts.contributions.json",HAn="CVE Remediator",SUo="Debugger",jAn=new Map([[HAn,"cveRemediatorAgent"],[SUo,"debuggerAgent"]]),TUo=new Map([[HAn,["LOCAL"]]]),Ld=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new fe("CustomAgentService");this.agentUpdateSequencer=new Vx;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(Lo);this.lastEnableCustomAgents=Ft(this.ctx,Ye.EnableCustomAgents),this.lastEnableOrgCustomAgents=Ft(this.ctx,Ye.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ye.EnableCustomAgents),n=Ft(this.ctx,Ye.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(jl);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(bn),r=Array.from(new Set(jAn.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(a0).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(YIe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e,r){if(this.ctx.get(jl).getPolicyValue("customAgent.enabled")===!1)return[];await this.ready;let s=(await this.ctx.get(ug).collect(this.ctx,"agent",e,{includePlugins:r?.includePlugins})).map(m=>new kUt(m)),c=this.ctx.get(w3),l=Ft(this.ctx,Ye.EnableOrgCustomAgents)!==!1,u=this.ctx.get(bn).getCapabilities(),d=s.filter(m=>{let g=m.promptFileEntry?.parsedPromptFile.header?.errors;if(g&&g.length>0){let E=g[0];return this.logger.warn(this.ctx,`Ignoring custom agent ${m.promptFileEntry?.promptPath.uri}: invalid frontmatter (${E.code}: ${E.message})`),!1}if(this.isOrgScopedAgent(m)){if(!l)return!1;let E=m.promptFileEntry?.parsedPromptFile.uri,_=E?rs(E):void 0;if(!_||!c.isCachedAgentVisibleFor(_,e))return!1}let A=jAn.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[DUt]===NUt.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=YIe.default.extname(__filename)===".ts"?YIe.default.resolve(__dirname,"../../../..",e):YIe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(qAn),n=await RUt.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=TUo.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 ${qAn}:`,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 E=y.map(_=>JSON.stringify(_).slice(1,-1)).map(_=>`'${_}'`).join(", ");m.push(`tools: [${E}]`)}else{let E=fK({[A]:y}).trim();m.push(E)}}u=m.join(` +`&&r++,e.push(r+1))}return e}a(EUo,"computeLineStartOffsets");function uO(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(uO,"offsetToPosition");function bUt(t,e){switch(e.type){case"scalar":return _Uo(t,e);case"sequence":return{type:"array",items:e.items.map(r=>bUt(t,r)),start:uO(t,e.startOffset),end:uO(t,e.endOffset)};case"map":return{type:"object",properties:e.properties.map(r=>({key:vUo(t,r.key),value:bUt(t,r.value)})),start:uO(t,e.startOffset),end:uO(t,e.endOffset)}}}a(bUt,"convertNode");function _Uo(t,e){let r=uO(t,e.startOffset),n=uO(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(_Uo,"convertScalar");function vUo(t,e){return{type:"string",value:e.value,start:uO(t,e.startOffset),end:uO(t,e.endOffset)}}a(vUo,"convertScalarAsString");var BP=de(eh());var dO=class{static{a(this,"PromptsParser")}constructor(){}parse(e,r){let n=this.#t(r);if(n.length===0)return new Gze(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 BP.Range(2,1,l+1,1);o=new IUt(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 BP.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===bUo);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}}},xUt=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;sBP.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,E=new BP.Range(s+1,A+1,s+1,y+1);r.push({content:h[2],range:E,isMarkdownLink:!1})}}else{let A=h.index+1,y=h.index+h[0].length,E=new BP.Range(s+1,A+1,s+1,y+1);n.push({name:h[2],range:E,offset:c+h.index})}}c+=l.length}this._parsed={fileReferences:r.sort((s,c)=>BP.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();var SUo=new Set(["sessionStart","sessionEnd","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),TUo="agentHook.event.load",$ze=class{constructor(){this.logger=new fe("HookParser")}static{a(this,"HookParser")}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 At(e,TUo,this.buildHookCountsByEventType(c)),{uri:r,version:1,hooks:c}}buildHookCountsByEventType(e){let r={};for(let[n,o]of Object.entries(e))o!==void 0&&(r[`${n}.hookCount`]=String(o.length));return r}isValidEventType(e){return SUo.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")}};p();var FAn=require("os");var IUo=(0,FAn.platform)()==="win32",tp=class{constructor(){this.trustByUri=new Map;this.emitter=new Wi;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 wUt)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 GQ{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(f){c(f)}},e.get(qS).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 wUt)this.notifyChange(h)}},"flushPending");this.trustSubscription=e.get(tp).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(tp),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=UAn(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(qo).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(qS).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(qo).readFileString(r.uri))}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(UAn(o,Ks(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(a0).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=xUo(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(wA),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 wUt)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(tp);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=>Jx(s.normalized,o.normalized,LC))||n.push(o);return n.map(o=>o.raw)}};p();var jl=class{constructor(){this.policyChangeEmitter=new ep;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},Vze=class extends jl{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var RUt=64;var D3=(r=>(r.enabled="enabled",r.disabled="disabled",r))(D3||{}),dg={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},rp={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},EK=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,RUt),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},KQ=class extends EK{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},Rr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},JQ=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},_K=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};var Lr=class{static{a(this,"LanguageModelToolResult")}constructor(e,r){this.status=r,this.content=e}},ZQ=class extends Lr{static{a(this,"ExtendedLanguageModelToolResult")}},QAn=S.Object({content:S.Array(S.Union([S.Object({value:S.String()}),S.Object({value:S.Unknown()})])),status:S.Optional(S.Union([S.Literal("success"),S.Literal("error"),S.Literal("cancelled")]))}),N3=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(N3||{}),qAn=S.Object({result:S.Enum(N3)});var kUt=de(require("fs"));var KIe=de(require("path"));var DUt=["user","model"],NUt="source",MUt={githubOrg:"github-org"},$gn={githubOrg:{[NUt]:MUt.githubOrg}},PUt=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??Ji(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||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??DUt}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get pluginUri(){return YQ(this.promptFileEntry.promptPath)}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(MUt));for(let n of e){let o=n[NUt];if(typeof o=="string"&&r.has(o))return o}}get providers(){return w3(this.promptFileEntry.promptPath.metadata)}},jAn="./assets/prompts.contributions.json",GAn="CVE Remediator",wUo="Debugger",HAn=new Map([[GAn,"cveRemediatorAgent"],[wUo,"debuggerAgent"]]),RUo=new Map([[GAn,["LOCAL"]]]),Ld=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new fe("CustomAgentService");this.agentUpdateSequencer=new Wx;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(Bo);this.lastEnableCustomAgents=Ft(this.ctx,Ye.EnableCustomAgents),this.lastEnableOrgCustomAgents=Ft(this.ctx,Ye.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ye.EnableCustomAgents),n=Ft(this.ctx,Ye.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(jl);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(bn),r=Array.from(new Set(HAn.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(a0).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(KIe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e,r){if(this.ctx.get(jl).getPolicyValue("customAgent.enabled")===!1)return[];await this.ready;let s=(await this.ctx.get(ug).collect(this.ctx,"agent",e,{includePlugins:r?.includePlugins})).map(m=>new PUt(m)),c=this.ctx.get(R3),l=Ft(this.ctx,Ye.EnableOrgCustomAgents)!==!1,u=this.ctx.get(bn).getCapabilities(),d=s.filter(m=>{let g=m.promptFileEntry?.parsedPromptFile.header?.errors;if(g&&g.length>0){let E=g[0];return this.logger.warn(this.ctx,`Ignoring custom agent ${m.promptFileEntry?.promptPath.uri}: invalid frontmatter (${E.code}: ${E.message})`),!1}if(this.isOrgScopedAgent(m)){if(!l)return!1;let E=m.promptFileEntry?.parsedPromptFile.uri,_=E?rs(E):void 0;if(!_||!c.isCachedAgentVisibleFor(_,e))return!1}let A=HAn.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[NUt]===MUt.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=KIe.default.extname(__filename)===".ts"?KIe.default.resolve(__dirname,"../../../..",e):KIe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(jAn),n=await kUt.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=RUo.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 ${jAn}:`,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 E=y.map(_=>JSON.stringify(_).slice(1,-1)).map(_=>`'${_}'`).join(", ");m.push(`tools: [${E}]`)}else{let E=fK({[A]:y}).trim();m.push(E)}}u=m.join(` `)+` `}let d=c.body?.content,f=u?`--- ${u}--- -${d}`:d||"",h=rs(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await RUt.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 JIe=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}},KIe=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")}},Cl={Ask:new KIe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new KIe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new KIe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function $An(t){return t===Cl.Agent||t.id===Cl.Agent.id}a($An,"isBuiltInAgentMode");function IUo(t){return t===Cl.InlineAgent||t.id===Cl.InlineAgent.id}a(IUo,"isBuiltInInlineAgentMode");function VAn(t){return t===Cl.Ask||t.id===Cl.Ask.id||$An(t)||IUo(t)}a(VAn,"isBuiltInChatMode");function ZIe(t){return $An(t)||!t.isBuiltIn&&t.customTools===void 0}a(ZIe,"shouldApplyGlobalToolsSetting");var j_=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[Cl.Ask,Cl.Agent,Cl.InlineAgent],o=await this.ctx.get(Ld).listCustomAgents(e||[],{includePlugins:!0});return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new JIe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return Cl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??Cl.Agent:Cl.Agent;case"InlineAgent":return Cl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var Oc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var $ze=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 xUo=new fe("conversationProgress"),ZQ={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var Tc=class{constructor(e){this.ctx=e;this.progressEntries=new Cn(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);xUo.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 io={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic"},wUo=new Set(Object.values(io));function vK(t){return!wUo.has(t)}a(vK,"isCustomEndpointProvider");var XIe="chatCompletions",RUo=128e3,kUo=16e3;function pO(t){return t===io.Azure?1:0}a(pO,"getAuthTypeForProvider");function WAn(t){switch(t){case"responses":return"responses";case"messages":return"v1/messages";default:return"completions"}}a(WAn,"customEndpointApiTypeToEndpoint");function Vze(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(Vze,"resolveCustomEndpointBaseUrl");function jle(t){return t===io.OpenAI||t===io.Gemini||t===io.Groq||t===io.OpenRouter||t===io.Anthropic}a(jle,"isOpenAICompatible");async function hO(t,e,r){let n=new da(t.get(Yn)),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=vK(e),d=u?RUo:1e5,f=u?kUo:8192,h=c?.maxInputTokens||d,m=c?.maxOutputTokens||f,g=s?.deploymentUrl,A;return u&&(A=(await n.getProviderConfig(e))?.apiType??XIe),{modelId:r,uiName:l,modelFamily:Rn.BYOK,providerName:e,deploymentUrl:g,apiType:A,maxRequestTokens:h,maxResponseTokens:m,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!!c?.toolCalling,supportsThinking:!!c?.thinking,originalBillingMultiplier:0}}a(hO,"resolveModelConfiguration");async function Wze(t,e,r){return await new da(t.get(Yn)).getAPIKey(e,r)}a(Wze,"resolveModelKey");function zAn(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(zAn,"resolveAzureUrl");function XQ(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(XQ,"isBYOKEnabled");var BC="byok",da=class{constructor(e){this.persistenceManager=e}static{a(this,"BYOKPersistence")}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(BC,this.modelApiKeyKey(e,r));if(o)return o}return await this.persistenceManager.read(BC,this.providerApiKeyKey(e))}async storeAPIKey(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(BC,this.providerApiKeyKey(e),r):n===1&&o&&await this.persistenceManager.update(BC,this.modelApiKeyKey(e,o),r))}async deleteAPIKey(e,r,n){r!==2&&(r===0?await this.persistenceManager.delete(BC,this.providerApiKeyKey(e)):r===1&&n&&await this.persistenceManager.delete(BC,this.modelApiKeyKey(e,n)))}async getStoredModelConfigs(e){return await this.persistenceManager.read(BC,this.modelsConfigKey(e))||{}}async getProviderConfig(e){return await this.persistenceManager.read(BC,this.providerConfigKey(e))}async saveProviderConfig(e,r){await this.persistenceManager.update(BC,this.providerConfigKey(e),r)}async deleteProviderConfig(e){await this.persistenceManager.delete(BC,this.providerConfigKey(e))}async listCustomProviderNames(){let e=await this.persistenceManager.listKeys(BC),r=this.providerConfigKey(""),n=new Set(Object.values(io));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(io),...e]))}async getAllModels(e){let r=[];if(!XQ(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){let c=await this.getStoredModelConfigs(e);c[r]=n,await this.persistenceManager.update(BC,this.modelsConfigKey(e),c),o&&s&&await this.storeAPIKey(e,o,s,r)}async removeModelConfig(e,r){let n=await this.getStoredModelConfigs(e),o=n[r];o&&(delete n[r],await this.persistenceManager.update(BC,this.modelsConfigKey(e),n),o.deploymentUrl&&await this.deleteAPIKey(e,1,r))}async removeAllModelConfigs(e){await this.persistenceManager.delete(BC,this.modelsConfigKey(e))}};p();p();p();p();function MUt(t,e){let r=CK(t,e);return r===-1?void 0:t[r]}a(MUt,"findLastMonotonous");function CK(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?Kze.isErrorNoTelemetry(e)?new Kze(e.message+` +${d}`:d||"",h=rs(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await kUt.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 ZIe=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}},JIe=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")}},Cl={Ask:new JIe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new JIe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new JIe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function VAn(t){return t===Cl.Agent||t.id===Cl.Agent.id}a(VAn,"isBuiltInAgentMode");function kUo(t){return t===Cl.InlineAgent||t.id===Cl.InlineAgent.id}a(kUo,"isBuiltInInlineAgentMode");function WAn(t){return t===Cl.Ask||t.id===Cl.Ask.id||VAn(t)||kUo(t)}a(WAn,"isBuiltInChatMode");function XIe(t){return VAn(t)||!t.isBuiltIn&&t.customTools===void 0}a(XIe,"shouldApplyGlobalToolsSetting");var j_=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[Cl.Ask,Cl.Agent,Cl.InlineAgent],o=await this.ctx.get(Ld).listCustomAgents(e||[],{includePlugins:!0});return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new ZIe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return Cl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??Cl.Agent:Cl.Agent;case"InlineAgent":return Cl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var Oc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var Wze=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 PUo=new fe("conversationProgress"),XQ={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var Tc=class{constructor(e){this.ctx=e;this.progressEntries=new Cn(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);PUo.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 io={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic"},DUo=new Set(Object.values(io));function vK(t){return!DUo.has(t)}a(vK,"isCustomEndpointProvider");var exe="chatCompletions",NUo=128e3,MUo=16e3;function pO(t){return t===io.Azure?1:0}a(pO,"getAuthTypeForProvider");function zAn(t){switch(t){case"responses":return"responses";case"messages":return"v1/messages";default:return"completions"}}a(zAn,"customEndpointApiTypeToEndpoint");function zze(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(zze,"resolveCustomEndpointBaseUrl");function jle(t){return t===io.OpenAI||t===io.Gemini||t===io.Groq||t===io.OpenRouter||t===io.Anthropic}a(jle,"isOpenAICompatible");async function hO(t,e,r){let n=new Ha(t.get(ri)),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=vK(e),d=u?NUo:1e5,f=u?MUo:8192,h=c?.maxInputTokens||d,m=c?.maxOutputTokens||f,g=s?.deploymentUrl,A;return u&&(A=(await n.getProviderConfig(e))?.apiType??exe),{modelId:r,uiName:l,modelFamily:Rn.BYOK,providerName:e,deploymentUrl:g,apiType:A,maxRequestTokens:h,maxResponseTokens:m,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(hO,"resolveModelConfiguration");async function Yze(t,e,r){return await new Ha(t.get(ri)).getAPIKey(e,r)}a(Yze,"resolveModelKey");function YAn(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(YAn,"resolveAzureUrl");function eq(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(eq,"isBYOKEnabled");var H_="byok",Ha=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(H_,this.modelApiKeyKey(e,r));if(o)return o}return await this.persistenceManager.read(H_,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(H_,this.providerApiKeyKey(e)):r===1&&n&&await this.persistenceManager.delete(H_,this.modelApiKeyKey(e,n)))})}async getStoredModelConfigs(e){return await this.persistenceManager.read(H_,this.modelsConfigKey(e))||{}}async getProviderConfig(e){return await this.persistenceManager.read(H_,this.providerConfigKey(e))}async saveProviderConfig(e,r){return t.enqueue(async()=>{await this.persistenceManager.update(H_,this.providerConfigKey(e),r)})}async deleteProviderConfig(e){return t.enqueue(async()=>{await this.persistenceManager.delete(H_,this.providerConfigKey(e))})}async listCustomProviderNames(){let e=await this.persistenceManager.listKeys(H_),r=this.providerConfigKey(""),n=new Set(Object.values(io));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(io),...e]))}async getAllModels(e){let r=[];if(!eq(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(H_,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(H_,this.providerApiKeyKey(e),r):n===1&&o&&await this.persistenceManager.update(H_,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(H_,this.modelsConfigKey(e),n),o.deploymentUrl&&await this.persistenceManager.delete(H_,this.modelApiKeyKey(e,r)))})}async removeAllModelConfigs(e){return t.enqueue(async()=>{await this.persistenceManager.delete(H_,this.modelsConfigKey(e))})}};p();p();p();p();function OUt(t,e){let r=CK(t,e);return r===-1?void 0:t[r]}a(OUt,"findLastMonotonous");function CK(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?Zze.isErrorNoTelemetry(e)?new Zze(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)}},PUo=new OUt;function Hle(t){exe(t)||PUo.onUnexpectedError(t)}a(Hle,"onUnexpectedError");var LUt="Canceled";function exe(t){return t instanceof H_?!0:t instanceof Error&&t.name===LUt&&t.message===LUt}a(exe,"isCancellationError");var H_=class extends Error{static{a(this,"CancellationError")}constructor(){super(LUt),this.name=this.message}};var Kze=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"}},Lc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function BUt(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(UUt,"shuffle");var JAn;(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})(JAn||={});function Gle(t,e){return(r,n)=>e(t(r),t(n))}a(Gle,"compareBy");var $le=a((t,e)=>t-e,"numberComparator");var KAn=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||JAn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function txe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(txe,"sumBy");p();function tyn(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(tyn,"groupBy");var XAn,eyn,ZAn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[XAn]="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))}[(eyn=Symbol.iterator,XAn=Symbol.toStringTag,eyn)](){return this.values()}};p();function QUt(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(QUt,"createSingleCallFunction");p();var qUt;(b=>{function t(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}b.is=t,a(t,"is");let e=Object.freeze([]);function r(){return e}b.empty=r,a(r,"empty");function*n(T){yield T}b.single=n,a(n,"single");function o(T){return t(T)?T:n(T)}b.wrap=o,a(o,"wrap");function s(T){return T||e}b.from=s,a(s,"from");function*c(T){for(let w=T.length-1;w>=0;w--)yield T[w]}b.reverse=c,a(c,"reverse");function l(T){return!T||T[Symbol.iterator]().next().done===!0}b.isEmpty=l,a(l,"isEmpty");function u(T){return T[Symbol.iterator]().next().value}b.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}b.some=d,a(d,"some");function f(T,w){for(let R of T)if(w(R))return R}b.find=f,a(f,"find");function*h(T,w){for(let R of T)w(R)&&(yield R)}b.filter=h,a(h,"filter");function*m(T,w){let R=0;for(let x of T)yield w(x,R++)}b.map=m,a(m,"map");function*g(T,w){let R=0;for(let x of T)yield*w(x,R++)}b.flatMap=g,a(g,"flatMap");function*A(...T){for(let w of T)yield*w}b.concat=A,a(A,"concat");function y(T,w,R){let x=R;for(let P of T)x=w(x,P);return x}b.reduce=y,a(y,"reduce");function*E(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 jUt(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]}*[(nyn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},iyn,ryn=class{constructor(e,r){this[iyn]="ResourceSet";!e||typeof e=="function"?this._map=new Jze(e):(this._map=new Jze(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()}[(iyn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var oyn,HUt=class{constructor(){this[oyn]="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}[(oyn=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)}},GUt=class extends HUt{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))}},Zze=class extends GUt{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 Xze=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 NUo=!1,Vle=null;var syn=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 Xze;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` +`+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)}},OUo=new LUt;function Hle(t){txe(t)||OUo.onUnexpectedError(t)}a(Hle,"onUnexpectedError");var BUt="Canceled";function txe(t){return t instanceof G_?!0:t instanceof Error&&t.name===BUt&&t.message===BUt}a(txe,"isCancellationError");var G_=class extends Error{static{a(this,"CancellationError")}constructor(){super(BUt),this.name=this.message}};var Zze=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"}},Lc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function FUt(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(QUt,"shuffle");var ZAn;(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})(ZAn||={});function Gle(t,e){return(r,n)=>e(t(r),t(n))}a(Gle,"compareBy");var $le=a((t,e)=>t-e,"numberComparator");var JAn=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||ZAn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function rxe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(rxe,"sumBy");p();function ryn(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(ryn,"groupBy");var eyn,tyn,XAn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[eyn]="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))}[(tyn=Symbol.iterator,eyn=Symbol.toStringTag,tyn)](){return this.values()}};p();function qUt(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(qUt,"createSingleCallFunction");p();var jUt;(b=>{function t(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}b.is=t,a(t,"is");let e=Object.freeze([]);function r(){return e}b.empty=r,a(r,"empty");function*n(T){yield T}b.single=n,a(n,"single");function o(T){return t(T)?T:n(T)}b.wrap=o,a(o,"wrap");function s(T){return T||e}b.from=s,a(s,"from");function*c(T){for(let w=T.length-1;w>=0;w--)yield T[w]}b.reverse=c,a(c,"reverse");function l(T){return!T||T[Symbol.iterator]().next().done===!0}b.isEmpty=l,a(l,"isEmpty");function u(T){return T[Symbol.iterator]().next().value}b.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}b.some=d,a(d,"some");function f(T,w){for(let R of T)if(w(R))return R}b.find=f,a(f,"find");function*h(T,w){for(let R of T)w(R)&&(yield R)}b.filter=h,a(h,"filter");function*m(T,w){let R=0;for(let x of T)yield w(x,R++)}b.map=m,a(m,"map");function*g(T,w){let R=0;for(let x of T)yield*w(x,R++)}b.flatMap=g,a(g,"flatMap");function*A(...T){for(let w of T)yield*w}b.concat=A,a(A,"concat");function y(T,w,R){let x=R;for(let P of T)x=w(x,P);return x}b.reduce=y,a(y,"reduce");function*E(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 HUt(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]}*[(iyn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},oyn,nyn=class{constructor(e,r){this[oyn]="ResourceSet";!e||typeof e=="function"?this._map=new Xze(e):(this._map=new Xze(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()}[(oyn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var syn,GUt=class{constructor(){this[syn]="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}[(syn=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)}},$Ut=class extends GUt{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))}},eYe=class extends $Ut{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 tYe=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 BUo=!1,Vle=null;var ayn=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 tYe;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(Gle(u=>u.idx,$le));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;ho(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` +`)),y=ryn([...A].map(E=>o(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` ==================== Leaking disposable ${l}/${n.length}: ${u.value.constructor.name} ==================== @@ -2435,7 +2435,7 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};function MUo(t){Vle=t}a(MUo,"setDisposableTracker");if(NUo){let t="__is_disposable_tracked__";MUo(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!==G_.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==G_.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function VUt(t){return Vle?.trackDisposable(t),t}a(VUt,"trackDisposable");function WUt(t){Vle?.markAsDisposed(t)}a(WUt,"markAsDisposed");function $Ut(t,e){Vle?.setParent(t,e)}a($Ut,"setParentOfDisposable");function OUo(t,e){if(Vle)for(let r of t)Vle.setParent(r,e)}a(OUo,"setParentOfDisposables");function ayn(t){if(qUt.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(ayn,"dispose");function cyn(...t){let e=eYe(()=>ayn(t));return OUo(t,e),e}a(cyn,"combinedDisposable");function eYe(t){let e=VUt({dispose:QUt(()=>{WUt(e),t()})});return e}a(eYe,"toDisposable");var eq=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;VUt(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(WUt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ayn(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 $Ut(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),$Ut(e,null))}},G_=class{constructor(){this._store=new eq;VUt(this),$Ut(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){WUt(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 Wle(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(Wle,"formatResetDate");var tq=class{static{a(this,"QuotaWarningNotifier")}};var bK=class{static{a(this,"QuotaChangeNotifier")}};var zUt=[50,75,90,95],Au=class extends G_{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(bs(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,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(bK).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=zUt[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(zUt[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(tq).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(tq).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 ${Wle(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function tYe(t){let e=await t.get(Ur).resolveSession();if(e){let r=await cbe(t,e);if(r.ok){let n=await r.json();t.get(Au).processUserInfoQuotaSnapshot(n)}}}a(tYe,"refreshUserQuota");p();p();var rxe=new fe("openAICompatibleLMProvider"),zle={[io.OpenAI]:"https://api.openai.com/v1",[io.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[io.Groq]:"https://api.groq.com/openai/v1",[io.OpenRouter]:"https://openrouter.ai/api/v1",[io.Anthropic]:"https://api.anthropic.com/v1"},Zx=class{constructor(e,r){this._lastFetchTime=0;this.providerName=e,this.ctx=r}static{a(this,"BaseOpenAICompatibleLMProvider")}async getAllModels(){await this.ensureKnownModelsCache();try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new da(this.ctx.get(Yn)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await fetch(e,{method:"GET",headers:r});if(!o.ok)throw new Error(`Failed to fetch models: ${o.status} ${o.statusText}`);let s=await o.json();if(s.error)throw new Error(`API Error: ${JSON.stringify(s.error)}`);let c=[];for(let l of s.data){let u=this._knownModels?.[l.id];u&&c.push({providerName:this.providerName,modelId:l.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:u})}return c}catch(e){throw rxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getBaseUrl(){let e=zle[this.providerName];if(!e)throw new Error(`Unsupported provider: ${this.providerName}`);return e}getFetchModelUrl(){return`${this.getBaseUrl()}/models`}async ensureKnownModelsCache(){let e=Date.now();!this._knownModels&&(this._knownModels=await this.fetchKnownModelList(),this._lastFetchTime=e)}async fetchKnownModelList(){let e=await(await this.ctx.get(tr).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*nxe(t,e){for await(let r of t)yield e(r)}a(nxe,"asyncIterableMap");async function*lyn(t,e){for await(let r of t)await e(r)&&(yield r)}a(lyn,"asyncIterableFilter");async function*ixe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(ixe,"asyncIterableMapFilter");p();var rYe="interleaved-thinking-2025-05-14",uyn="2023-06-01";p();var BP=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 el=class{static{a(this,"ModelConfigurationProvider")}},nYe=class extends el{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(xs).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(xs).getMetadata(),o=BUo(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===Rn.Gpt35turbo||r===Rn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:KUt(6144,s),maxLongContextTokens:void 0,maxResponseTokens:YUt(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===Rn.Gpt4||r===Rn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:KUt(10240,s),maxLongContextTokens:void 0,maxResponseTokens:YUt(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===Rn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await LUo(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:YUt(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:dyn(s),maxLongContextTokens:fyn(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(xs).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:dyn(o),maxLongContextTokens:fyn(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===Tun.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function LUo(t,e){let r=t.get(Zt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),KUt(o,e)}a(LUo,"getExpRequestTokens");function KUt(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(KUt,"getRequestTokens");function dyn(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(dyn,"getMaxRequestTokens");function fyn(t){return t.billing?.token_prices?.long_context?.context_max}a(fyn,"getMaxLongContextTokens");function YUt(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(YUt,"getResponseTokens");function BUo(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(BUo,"filterModelsByCapabilities");function mO(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(mO,"pickReasoningEffort");function FUo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(FUo,"shouldUseResponsesApi");function UUo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(UUo,"shouldUseMessagesApi");var pyn=["completions","responses","v1/messages"];function iYe(t,e){return e?"v1/messages":t&&FUo(t)?"responses":"completions"}a(iYe,"resolveEndpointRoute");function oYe(t,e){if(!UUo(e))return!1;let r=Ft(t,Ye.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(oYe,"willUseMessagesEndpoint");p();function sYe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(sYe,"isCodexStyleGptModel");function hyn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(hyn,"isGpt5PlusFamily");function myn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(myn,"isAnthropicModel");p();p();function gyn(t,e){if(!e||!e.providerName)return;let r=e.apiType==="messages";e.providerName===io.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)),e.providerName&&!r&&delete t.max_tokens}a(gyn,"adaptRequestForBYOKProvider");p();p();var qS=class{static{a(this,"RateLimitNotifier")}},aYe=class extends qS{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var JUt=[50,75,90,95],gO=class extends G_{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(bs(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(qS).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=JUt[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(JUt[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=Wle(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 fg="https://aka.ms/github-copilot-rate-limit-error";function QUo(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(QUo,"secondsToHumanReadableTime");var $_=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":QUo(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](${fg})`;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](${fg})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${fg})`;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](${fg})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${fg})`;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](${fg})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${fg})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${fg})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${fg})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${fg})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${fg})`}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](${fg})`:`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${fg})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${fg})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${fg})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${fg})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${fg})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${fg})`}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();var rq="copilot-edits-session";p();p();p();p();Mo();function cYe(t,e,r,n,o,s,c){return _Kr(t,e,r,o,n,c),{completionText:e,meanLogProb:qUo(t,r),meanAlternativeLogProb:jUo(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:Mt(),finishReason:r.finish_reason}}a(cYe,"convertToAPIChoice");function qUo(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){Nr.exception(t,r,"Error calculating mean prob")}}a(qUo,"calculateMeanLogProb");function jUo(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){Nr.exception(t,r,"Error calculating mean prob")}}a(jUo,"calculateMeanAlternativeLogProb");function Yle(t,e){return O1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(Yle,"getTemperatureForSamples");var HUo={markdown:[` +`),{leaks:n,details:c}}};function FUo(t){Vle=t}a(FUo,"setDisposableTracker");if(BUo){let t="__is_disposable_tracked__";FUo(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!==$_.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==$_.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function WUt(t){return Vle?.trackDisposable(t),t}a(WUt,"trackDisposable");function zUt(t){Vle?.markAsDisposed(t)}a(zUt,"markAsDisposed");function VUt(t,e){Vle?.setParent(t,e)}a(VUt,"setParentOfDisposable");function UUo(t,e){if(Vle)for(let r of t)Vle.setParent(r,e)}a(UUo,"setParentOfDisposables");function cyn(t){if(jUt.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(cyn,"dispose");function lyn(...t){let e=rYe(()=>cyn(t));return UUo(t,e),e}a(lyn,"combinedDisposable");function rYe(t){let e=WUt({dispose:qUt(()=>{zUt(e),t()})});return e}a(rYe,"toDisposable");var tq=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;WUt(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(zUt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{cyn(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 VUt(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),VUt(e,null))}},$_=class{constructor(){this._store=new tq;WUt(this),VUt(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){zUt(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 Wle(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(Wle,"formatResetDate");var rq=class{static{a(this,"QuotaWarningNotifier")}};var bK=class{static{a(this,"QuotaChangeNotifier")}};var YUt=[50,75,90,95],Au=class extends $_{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(bs(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,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(bK).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=YUt[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(YUt[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(rq).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(rq).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 ${Wle(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function nYe(t){let e=await t.get(Ur).resolveSession();if(e){let r=await lbe(t,e);if(r.ok){let n=await r.json();t.get(Au).processUserInfoQuotaSnapshot(n)}}}a(nYe,"refreshUserQuota");p();p();var iYe=new fe("openAICompatibleLMProvider"),zle={[io.OpenAI]:"https://api.openai.com/v1",[io.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[io.Groq]:"https://api.groq.com/openai/v1",[io.OpenRouter]:"https://openrouter.ai/api/v1",[io.Anthropic]:"https://api.anthropic.com/v1"},Xx=class{constructor(e,r){this._lastFetchTime=0;this.providerName=e,this.ctx=r}static{a(this,"BaseOpenAICompatibleLMProvider")}async getAllModels(){await this.ensureKnownModelsCache();try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new Ha(this.ctx.get(ri)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await this.ctx.get(nr).fetch(e,{method:"GET",headers:r});if(!o.ok)throw new Error(`Failed to fetch models: ${o.status} ${o.statusText}`);let s=await o.json();if(s.error)throw new Error(`API Error: ${JSON.stringify(s.error)}`);let c=[];for(let l of s.data){let u=this._knownModels?.[l.id]??this.resolveModelCapabilities(l);u&&c.push({providerName:this.providerName,modelId:l.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:u})}return c}catch(e){throw iYe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}resolveModelCapabilities(e){}getBaseUrl(){let e=zle[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){iYe.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(nr).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*nxe(t,e){for await(let r of t)yield e(r)}a(nxe,"asyncIterableMap");async function*uyn(t,e){for await(let r of t)await e(r)&&(yield r)}a(uyn,"asyncIterableFilter");async function*ixe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(ixe,"asyncIterableMapFilter");p();var oYe="interleaved-thinking-2025-05-14",dyn="2023-06-01";p();var FP=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 el=class{static{a(this,"ModelConfigurationProvider")}},sYe=class extends el{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(xs).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(xs).getMetadata(),o=qUo(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===Rn.Gpt35turbo||r===Rn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:JUt(6144,s),maxLongContextTokens:void 0,maxResponseTokens:KUt(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===Rn.Gpt4||r===Rn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:JUt(10240,s),maxLongContextTokens:void 0,maxResponseTokens:KUt(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===Rn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await QUo(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:KUt(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:fyn(s),maxLongContextTokens:pyn(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(xs).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:fyn(o),maxLongContextTokens:pyn(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===Iun.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function QUo(t,e){let r=t.get(Zt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),JUt(o,e)}a(QUo,"getExpRequestTokens");function JUt(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(JUt,"getRequestTokens");function fyn(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(fyn,"getMaxRequestTokens");function pyn(t){return t.billing?.token_prices?.long_context?.context_max}a(pyn,"getMaxLongContextTokens");function KUt(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(KUt,"getResponseTokens");function qUo(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(qUo,"filterModelsByCapabilities");function mO(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(mO,"pickReasoningEffort");function jUo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(jUo,"shouldUseResponsesApi");function HUo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(HUo,"shouldUseMessagesApi");var hyn=["completions","responses","v1/messages"];function aYe(t,e){return e?"v1/messages":t&&jUo(t)?"responses":"completions"}a(aYe,"resolveEndpointRoute");function cYe(t,e){if(!HUo(e))return!1;let r=Ft(t,Ye.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(cYe,"willUseMessagesEndpoint");p();function lYe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(lYe,"isCodexStyleGptModel");function myn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(myn,"isGpt5PlusFamily");function gyn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(gyn,"isAnthropicModel");p();p();function Ayn(t,e){if(!e||!e.providerName)return;let r=e.apiType==="messages";e.providerName===io.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)),e.providerName&&!r&&delete t.max_tokens}a(Ayn,"adaptRequestForBYOKProvider");p();p();var HS=class{static{a(this,"RateLimitNotifier")}},uYe=class extends HS{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var ZUt=[50,75,90,95],gO=class extends $_{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(bs(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(HS).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=ZUt[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(ZUt[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=Wle(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 fg="https://aka.ms/github-copilot-rate-limit-error";function GUo(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(GUo,"secondsToHumanReadableTime");var V_=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":GUo(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](${fg})`;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](${fg})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${fg})`;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](${fg})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${fg})`;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](${fg})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${fg})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${fg})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${fg})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${fg})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${fg})`}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](${fg})`:`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${fg})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${fg})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${fg})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${fg})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${fg})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${fg})`}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();var nq="copilot-edits-session";p();p();p();p();Oo();function dYe(t,e,r,n,o,s,c){return vKr(t,e,r,o,n,c),{completionText:e,meanLogProb:$Uo(t,r),meanAlternativeLogProb:VUo(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:Mt(),finishReason:r.finish_reason}}a(dYe,"convertToAPIChoice");function $Uo(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){Nr.exception(t,r,"Error calculating mean prob")}}a($Uo,"calculateMeanLogProb");function VUo(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){Nr.exception(t,r,"Error calculating mean prob")}}a(VUo,"calculateMeanAlternativeLogProb");function Yle(t,e){return O1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(Yle,"getTemperatureForSamples");var WUo={markdown:[` `],python:[` @@ -2443,23 +2443,23 @@ def `,` class `,` if `,` -#`]};function Ayn(t,e){return HUo[e??""]??[` +#`]};function yyn(t,e){return WUo[e??""]??[` -`,"\n```"]}a(Ayn,"getStops");function Kle(t){return 1}a(Kle,"getTopP");function lYe(t){return KTe}a(lYe,"getMaxSolutionTokens");p();p();var GUo=1.15,$Uo=1.17,VUo=2;function WUo(t){if(!t)return!1;let e=t.toLowerCase();return e.includes("opus")||e.includes("sonnet-4.6")}a(WUo,"isHighMultiplierModel");function zUo(t){return t.text?Array.isArray(t.text)?t.text.join(""):t.text:""}a(zUo,"getThinkingText");function Jle(t,e){let r=zUo(t);if(r.length>0){let n=ws(),o=WUo(e)?$Uo:GUo;return Math.ceil(n.tokenLength(r)*VUo*o)}return 0}a(Jle,"estimateThinkingTokens");function ZUt(t){let e=t.delta;if(!e)return;let r=KUo(e),n=YUo(e);if(r||n)return{id:r,text:n}}a(ZUt,"extractThinkingDeltaFromChoice");function YUo(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(YUo,"getThinkingDeltaText");function KUo(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(KUo,"getThinkingDeltaId");p();function Xu(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(Xu,"toString");var jS=new fe("streamChoices"),XUt=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new n7t;this.tool_calls=new t7t;this.function_call=new r7t;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=ZUt(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 JUo(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!=""),r]}a(JUo,"splitChunk");var e7t=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)}},t7t=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 e7t,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},r7t=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},n7t=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]??[]}},SK=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=M3(this.response);this.stats=new i7t;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(),jS.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),jS.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();jS.debug(this.ctx,"chunk",u);let[d,f]=JUo(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{jS.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&ZUo(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?jS.error(this.ctx,"Error in response:",g.error.message):jS.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=ws(),o=JUo(e)?YUo:zUo;return Math.ceil(n.tokenLength(r)*KUo*o)}return 0}a(Jle,"estimateThinkingTokens");function XUt(t){let e=t.delta;if(!e)return;let r=e7o(e),n=XUo(e);if(r||n)return{id:r,text:n}}a(XUt,"extractThinkingDeltaFromChoice");function XUo(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(XUo,"getThinkingDeltaText");function e7o(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(e7o,"getThinkingDeltaId");p();function Xu(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(Xu,"toString");var GS=new fe("streamChoices"),e7t=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new i7t;this.tool_calls=new r7t;this.function_call=new n7t;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=XUt(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 t7o(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!=""),r]}a(t7o,"splitChunk");var t7t=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)}},r7t=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 t7t,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},n7t=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},i7t=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]??[]}},SK=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=O3(this.response);this.stats=new o7t;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(),GS.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),GS.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();GS.debug(this.ctx,"chunk",u);let[d,f]=t7o(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{GS.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&r7o(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?GS.error(this.ctx,"Error in response:",g.error.message):GS.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=E?ZUt(y):void 0;if(y.finish_reason||b||T){let R=_.text.join("");if(v=this.asSolutionDecision(await e(R,{text:R,index:y.index,requestId:this.requestId,annotations:_.copilot_annotations,copilotReferences:_.copilot_references,getAPIJsonData:a(()=>sxe(_,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&&_.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(Et(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:mQ(this.ctx,this.telemetryData).engineChoiceSource})),this.dropCompletionReasons.includes(y.finish_reason)?this.solutions[y.index]=null:_.yielded||(this.stats.markYielded(y.index),yield{solution:_,finishOffset:v.finishOffset,reason:y.finish_reason,requestId:this.requestId,index:y.index,model:o,usage:s,copilot_usage:c},_.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&&(Et(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&&jS.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{jS.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(()=>sxe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),Et(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?(jS.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 s7t(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(jS.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),jS.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),jS.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=sxe(e.solution,t);return cYe(t,n,s,e.index,e.requestId,o,r)}a(s7t,"prepareSolutionForReturn");function sxe(t,e){let r=t.text.join(""),n=XUo(t,e),o=e7o(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(sxe,"convertToAPIJsonData");function ZUo(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(ZUo,"isCopilotConfirmation");function yyn(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}': ${Xu(s)}. Input: '${t}'.${c}`);throw o&&At(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(yyn,"parseCallArguments");function XUo(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=yyn(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(XUo,"extractToolCalls");function e7o(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=yyn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(e7o,"extractFunctionCall");var i7t=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new o7t,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(", ")}},o7t=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function uYe(t,e){return t!==null&&typeof t=="object"&&e in t}a(uYe,"hasKey");function Wh(t,e){return uYe(t,e)?t[e]:void 0}a(Wh,"getKey");var _yn=de(ri());var np=new fe("fetchCompletions");function M3(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(M3,"getRequestId");function O3(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(O3,"getProcessingTime");function vyn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(vyn,"uiKindToIntent");var AO=class{static{a(this,"OpenAIFetcher")}};function t7o(t,e,r,n){return tx(t,e,"proxy","v1/engines",r,n)}a(t7o,"getProxyEngineUrl");function dYe(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(dYe,"sanitizeRequestOptionTelemetry");async function r7o(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(ps),m=t7o(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},Ese(e));dYe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,Et(t,"request.sent",g);let A=yl(),y=vyn(l);return HW(t,m,c.token,y,o,s,d,f).then(E=>{let _=M3(E);g.extendWithRequestId(_);let v=yl()-A;return g.measurements.totalTimeMs=v,np.info(t,`Request ${o} at <${m}> finished with ${E.status} status after ${v}ms`),g.properties.status=String(E.status),np.debug(t,"request.response properties",g.properties),np.debug(t,"request.response measurements",g.measurements),np.debug(t,"prompt:",e),Et(t,"request.response",g),E}).catch(E=>{if(Gm(E))throw Et(t,"request.cancel",g),E;h.setWarning("cls",{message:Wh(E,"message")??""});let _=g.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",_),g.properties.message=String(Wh(E,"name")??""),g.properties.code=String(Wh(E,"code")??""),g.properties.errno=String(Wh(E,"errno")??""),g.properties.type=String(Wh(E,"type")??"");let v=yl()-A;throw g.measurements.totalTimeMs=v,np.info(t,`Request ${o} at <${m}> rejected with ${String(E)} after ${v}ms`),np.debug(t,"request.error properties",g.properties),np.debug(t,"request.error measurements",g.measurements),Et(t,"request.error",g),E}).finally(()=>{vKr(t,e,g)})}a(r7o,"fetchWithInstrumentation");async function n7o(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});dYe(s,f,["messages"]),f.properties.headerRequestId=o,Et(t,"request.sent",f);let h=yl(),m=vyn(l),g=i0(t);CB()&&(g=await C$e(t,g));try{let A=await HW(t,n,c.token,m,o,s,d,g),y=M3(A);f.extendWithRequestId(y);let E=yl()-h;return f.measurements.totalTimeMs=E,np.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${E}ms`),np.debug(t,"request.response properties",f.properties),np.debug(t,"request.response measurements",f.measurements),np.debug(t,"messages:",JSON.stringify(e)),Et(t,"request.response",f),A}catch(A){if(Gm(A))throw Et(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",y),f.properties.message=String(Wh(A,"name")??""),f.properties.code=String(Wh(A,"code")??""),f.properties.errno=String(Wh(A,"errno")??""),f.properties.type=String(Wh(A,"type")??"");let E=yl()-h;throw f.measurements.totalTimeMs=E,np.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${E}ms`),np.debug(t,"request.error properties",f.properties),np.debug(t,"request.error measurements",f.measurements),Et(t,"request.error",f),A}finally{Zle(t,e,f)}}a(n7o,"fetchChatWithInstrumentation");function Eyn(t){return lyn(t,e=>e.completionText.trim().length>0)}a(Eyn,"postProcessChoices");var i7o="github.copilot.completions.quotaExceeded",oxe=class extends AO{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(ps),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){np.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=SK.create(e,r.count,d,n,[],s).processSSE(o),m=nxe(h,g=>s7t(e,g,n));return{type:"success",choices:Eyn(m),getProcessingTime:a(()=>O3(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(ps),A=await e.get(Qt).getToken(),y=await n7o(e,r,l.id,f,s,h,A,o,m,d);if(d?.isCancellationRequested){let b=y.body();try{b&&"destroy"in b&&typeof b.destroy=="function"?b.destroy():b instanceof ReadableStream&&b.cancel()}catch(T){np.exception(e,T,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(y.status!==200){let b=Wt.createAndMarkAsIssued({endpoint:f,engineName:l.name,uiKind:o,headerRequestId:s});return this.handleError(e,g,b,y,o)}let _=SK.create(e,1,y,m,[],_yn.CancellationToken.None).processSSE(),v=nxe(_,b=>s7t(e,b,n));return{type:"success",choices:Eyn(v),getProcessingTime:a(()=>O3(y),"getProcessingTime")}}createTelemetryData(e,r,n){return Wt.createAndMarkAsIssued({endpoint:e,engineName:n.engineModelId,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s,c){let l=e.get(Zt).disableLogProb(s),u={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:lYe(e),temperature:Yle(e,n.count),top_p:Kle(e),n:n.count,stop:Ayn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=MY(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 bC(0),c?.isCancellationRequested?"not-sent":await r7o(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:i7o,title:"Learn More"});let l=bs(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}),np.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`;np.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?(np.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),Et(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=OU(o);At(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.`,np.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(np.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(np.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};Mo();async function axe(t,e,r,n){let o=Wt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(axe,"createTelemetryWithExpWithId");function tl(t,{turn:e,conversation:r}={},n){return axe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(tl,"createTelemetryWithExpWithTurn");function cxe(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(o7o(l))),c=c.extendedBy(d,f),c}a(cxe,"extendUserMessageTelemetryData");function o7o(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(o7o,"mapSkillResolutionsForTelemetry");function Cyn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),fYe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(Cyn,"createUserMessageTelemetryData");function byn(t,e,r,n,o,s,c){let l=a7o(r);return fYe(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(byn,"createModelMessageTelemetryData");function Syn(t,e,r,n,o,s,c){fYe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(Syn,"createOffTopicMessageTelemetryData");function Tyn(t,e,r,n,o,s,c,l,u){let d=fYe(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 s7o(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(Tyn,"createSuggestionMessageTelemetryData");async function Iyn(t,e,r){let n=await tl(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";HS(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(Iyn,"telemetryIndexCodesearch");function fYe(t,e,r,n,o,s,c){let l=c??Wt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=Mt();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=aE(r);return Et(t,`${h}.message`,d),Et(t,`${h}.messageText`,f,1),d}a(fYe,"telemetryMessage");function xyn(t,e,r,n){HS(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(xyn,"createSuggestionShownTelemetryData");function s7o(t,e,r,n,o,s,c,l){HS(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(s7o,"createSuggestionSelectedTelemetryData");function HS(t,e,r,n,o,s){let c=s??Wt.createAndMarkAsIssued();e&&(r.languageId=e.detectedLanguageId,n.documentLength=e.getText().length,n.documentLineCount=e.lineCount);let l=c.extendedBy(r,n);return Et(t,o,l),l}a(HS,"telemetryUserAction");function Zle(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return Et(t,"engine.messages",n,1)}a(Zle,"logEngineMessages");function aE(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(aE,"telemetryPrefixForUiKind");function a7o(t){let e=t.split(` -`),r=[],n;for(let o=0;o-1,T=E?XUt(y):void 0;if(y.finish_reason||b||T){let R=_.text.join("");if(v=this.asSolutionDecision(await e(R,{text:R,index:y.index,requestId:this.requestId,annotations:_.copilot_annotations,copilotReferences:_.copilot_references,getAPIJsonData:a(()=>sxe(_,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&&_.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(Et(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:gQ(this.ctx,this.telemetryData).engineChoiceSource})),this.dropCompletionReasons.includes(y.finish_reason)?this.solutions[y.index]=null:_.yielded||(this.stats.markYielded(y.index),yield{solution:_,finishOffset:v.finishOffset,reason:y.finish_reason,requestId:this.requestId,index:y.index,model:o,usage:s,copilot_usage:c},_.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&&(Et(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&&GS.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{GS.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(()=>sxe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),Et(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?(GS.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 a7t(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(GS.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),GS.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),GS.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=sxe(e.solution,t);return dYe(t,n,s,e.index,e.requestId,o,r)}a(a7t,"prepareSolutionForReturn");function sxe(t,e){let r=t.text.join(""),n=n7o(t,e),o=i7o(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(sxe,"convertToAPIJsonData");function r7o(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(r7o,"isCopilotConfirmation");function Eyn(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}': ${Xu(s)}. Input: '${t}'.${c}`);throw o&&At(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(Eyn,"parseCallArguments");function n7o(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=Eyn(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(n7o,"extractToolCalls");function i7o(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=Eyn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(i7o,"extractFunctionCall");var o7t=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new s7t,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(", ")}},s7t=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function pYe(t,e){return t!==null&&typeof t=="object"&&e in t}a(pYe,"hasKey");function Wh(t,e){return pYe(t,e)?t[e]:void 0}a(Wh,"getKey");var vyn=de(ti());var np=new fe("fetchCompletions");function O3(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(O3,"getRequestId");function L3(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(L3,"getProcessingTime");function Cyn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(Cyn,"uiKindToIntent");var AO=class{static{a(this,"OpenAIFetcher")}};function o7o(t,e,r,n){return nx(t,e,"proxy","v1/engines",r,n)}a(o7o,"getProxyEngineUrl");function hYe(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(hYe,"sanitizeRequestOptionTelemetry");async function s7o(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(ps),m=o7o(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},Ese(e));hYe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,Et(t,"request.sent",g);let A=yl(),y=Cyn(l);return GW(t,m,c.token,y,o,s,d,f).then(E=>{let _=O3(E);g.extendWithRequestId(_);let v=yl()-A;return g.measurements.totalTimeMs=v,np.info(t,`Request ${o} at <${m}> finished with ${E.status} status after ${v}ms`),g.properties.status=String(E.status),np.debug(t,"request.response properties",g.properties),np.debug(t,"request.response measurements",g.measurements),np.debug(t,"prompt:",e),Et(t,"request.response",g),E}).catch(E=>{if(Gm(E))throw Et(t,"request.cancel",g),E;h.setWarning("cls",{message:Wh(E,"message")??""});let _=g.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",_),g.properties.message=String(Wh(E,"name")??""),g.properties.code=String(Wh(E,"code")??""),g.properties.errno=String(Wh(E,"errno")??""),g.properties.type=String(Wh(E,"type")??"");let v=yl()-A;throw g.measurements.totalTimeMs=v,np.info(t,`Request ${o} at <${m}> rejected with ${String(E)} after ${v}ms`),np.debug(t,"request.error properties",g.properties),np.debug(t,"request.error measurements",g.measurements),Et(t,"request.error",g),E}).finally(()=>{CKr(t,e,g)})}a(s7o,"fetchWithInstrumentation");async function a7o(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});hYe(s,f,["messages"]),f.properties.headerRequestId=o,Et(t,"request.sent",f);let h=yl(),m=Cyn(l),g=i0(t);CB()&&(g=await S$e(t,g));try{let A=await GW(t,n,c.token,m,o,s,d,g),y=O3(A);f.extendWithRequestId(y);let E=yl()-h;return f.measurements.totalTimeMs=E,np.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${E}ms`),np.debug(t,"request.response properties",f.properties),np.debug(t,"request.response measurements",f.measurements),np.debug(t,"messages:",JSON.stringify(e)),Et(t,"request.response",f),A}catch(A){if(Gm(A))throw Et(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",y),f.properties.message=String(Wh(A,"name")??""),f.properties.code=String(Wh(A,"code")??""),f.properties.errno=String(Wh(A,"errno")??""),f.properties.type=String(Wh(A,"type")??"");let E=yl()-h;throw f.measurements.totalTimeMs=E,np.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${E}ms`),np.debug(t,"request.error properties",f.properties),np.debug(t,"request.error measurements",f.measurements),Et(t,"request.error",f),A}finally{Zle(t,e,f)}}a(a7o,"fetchChatWithInstrumentation");function _yn(t){return uyn(t,e=>e.completionText.trim().length>0)}a(_yn,"postProcessChoices");var c7o="github.copilot.completions.quotaExceeded",oxe=class extends AO{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(ps),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){np.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=SK.create(e,r.count,d,n,[],s).processSSE(o),m=nxe(h,g=>a7t(e,g,n));return{type:"success",choices:_yn(m),getProcessingTime:a(()=>L3(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(ps),A=await e.get(Qt).getToken(),y=await a7o(e,r,l.id,f,s,h,A,o,m,d);if(d?.isCancellationRequested){let b=y.body();try{b&&"destroy"in b&&typeof b.destroy=="function"?b.destroy():b instanceof ReadableStream&&b.cancel()}catch(T){np.exception(e,T,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(y.status!==200){let b=Wt.createAndMarkAsIssued({endpoint:f,engineName:l.name,uiKind:o,headerRequestId:s});return this.handleError(e,g,b,y,o)}let _=SK.create(e,1,y,m,[],vyn.CancellationToken.None).processSSE(),v=nxe(_,b=>a7t(e,b,n));return{type:"success",choices:_yn(v),getProcessingTime:a(()=>L3(y),"getProcessingTime")}}createTelemetryData(e,r,n){return Wt.createAndMarkAsIssued({endpoint:e,engineName:n.engineModelId,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s,c){let l=e.get(Zt).disableLogProb(s),u={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:fYe(e),temperature:Yle(e,n.count),top_p:Kle(e),n:n.count,stop:yyn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=OY(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 SC(0),c?.isCancellationRequested?"not-sent":await s7o(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:c7o,title:"Learn More"});let l=bs(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}),np.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`;np.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?(np.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),Et(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=LU(o);At(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.`,np.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(np.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(np.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};Oo();async function axe(t,e,r,n){let o=Wt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(axe,"createTelemetryWithExpWithId");function tl(t,{turn:e,conversation:r}={},n){return axe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(tl,"createTelemetryWithExpWithTurn");function cxe(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(l7o(l))),c=c.extendedBy(d,f),c}a(cxe,"extendUserMessageTelemetryData");function l7o(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(l7o,"mapSkillResolutionsForTelemetry");function byn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),mYe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(byn,"createUserMessageTelemetryData");function Syn(t,e,r,n,o,s,c){let l=d7o(r);return mYe(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(Syn,"createModelMessageTelemetryData");function Tyn(t,e,r,n,o,s,c){mYe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(Tyn,"createOffTopicMessageTelemetryData");function Iyn(t,e,r,n,o,s,c,l,u){let d=mYe(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 u7o(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(Iyn,"createSuggestionMessageTelemetryData");async function xyn(t,e,r){let n=await tl(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";$S(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(xyn,"telemetryIndexCodesearch");function mYe(t,e,r,n,o,s,c){let l=c??Wt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=Mt();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=aE(r);return Et(t,`${h}.message`,d),Et(t,`${h}.messageText`,f,1),d}a(mYe,"telemetryMessage");function wyn(t,e,r,n){$S(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(wyn,"createSuggestionShownTelemetryData");function u7o(t,e,r,n,o,s,c,l){$S(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(u7o,"createSuggestionSelectedTelemetryData");function $S(t,e,r,n,o,s){let c=s??Wt.createAndMarkAsIssued();e&&(r.languageId=e.detectedLanguageId,n.documentLength=e.getText().length,n.documentLineCount=e.lineCount);let l=c.extendedBy(r,n);return Et(t,o,l),l}a($S,"telemetryUserAction");function Zle(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return Et(t,"engine.messages",n,1)}a(Zle,"logEngineMessages");function aE(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(aE,"telemetryPrefixForUiKind");function d7o(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))(ic||{});function Pn(t){return t?(t=GS(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(Pn,"getTextPart");function Dyn(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(Dyn,"hasImageContent");function iq(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(Xle(n))return n.some(o=>o.type==="image_url");if(TK(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(iq,"hasImageContentInTurns");var Nyn=a((t,e)=>S.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),Myn=S.Optional(S.Object({agentSlug:S.String(),state:S.Union([S.Literal("accepted"),S.Literal("dismissed")]),confirmation:S.Any()}));function B3(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(B3,"parseToolCallArguments");function Oyn(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(Oyn,"toOpenAIToolCall");function Lyn(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),Zle(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=Jle(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(Lyn,"convertToChatCompletion");function Xle(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(Xle,"isChatCompletionContentPartArray");function TK(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(TK,"isChatMessageArray");function GS(t){if(typeof t=="string")return t;if(Xle(t))return t;if(TK(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(GS,"resolveAsChatMessageContent");function oq(t,e){return(typeof t=="string"||Xle(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(oq,"appendChatMessageContent");function yO(t,e){if(t){if(typeof t=="string"||Xle(t))return[{role:"assistant",content:t}];if(TK(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(yO,"resolveResponseAsChatMessages");p();var c7t=new fe("streamMessages");function Byn(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(c7t.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),c7t.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),c7t.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=sxe(e.solution,t),u={role:"assistant",content:s};return Lyn(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(Byn,"prepareChatCompletionForReturn");Mo();var pYe=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:Yle(e,r.count),top_p:Kle(e),n:r.count,stop:[` +`);return r+n}a(h7o,"truncateContentIfNeeded");var m7o=["requestSource","chatRequestModel","mapper","headerRequestId","mode","modelId","languageId","messageId","conversationId","uiKind"];function Dyn(t,e,r,n,o,s,c){let l=`${aE(e)}.${c}`,u=s.extendedBy(r,n);Et(t,l,u);let d={...r,uiKind:e||""};At(t,c,pU(d,m7o),n);let f={...r};o.currentFileContent!==void 0&&(f.completionTextJson=h7o(o.currentFileContent));let h=s.extendedBy(f,n);Et(t,`${l}.restricted`,h,1)}a(Dyn,"telemetryEditSurvivalTracking");var ic=(s=>(s.System="system",s.User="user",s.Assistant="assistant",s.Function="function",s.Tool="tool",s))(ic||{});function Pn(t){return t?(t=VS(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(Pn,"getTextPart");function Nyn(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(Nyn,"hasImageContent");function oq(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(Xle(n))return n.some(o=>o.type==="image_url");if(TK(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(oq,"hasImageContentInTurns");var Myn=a((t,e)=>S.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),Oyn=S.Optional(S.Object({agentSlug:S.String(),state:S.Union([S.Literal("accepted"),S.Literal("dismissed")]),confirmation:S.Any()}));function F3(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(F3,"parseToolCallArguments");function Lyn(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(Lyn,"toOpenAIToolCall");function Byn(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),Zle(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=Jle(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(Byn,"convertToChatCompletion");function Xle(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(Xle,"isChatCompletionContentPartArray");function TK(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(TK,"isChatMessageArray");function VS(t){if(typeof t=="string")return t;if(Xle(t))return t;if(TK(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(VS,"resolveAsChatMessageContent");function sq(t,e){return(typeof t=="string"||Xle(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(sq,"appendChatMessageContent");function yO(t,e){if(t){if(typeof t=="string"||Xle(t))return[{role:"assistant",content:t}];if(TK(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(yO,"resolveResponseAsChatMessages");p();var l7t=new fe("streamMessages");function Fyn(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(l7t.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),l7t.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),l7t.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=sxe(e.solution,t),u={role:"assistant",content:s};return Byn(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(Fyn,"prepareChatCompletionForReturn");Oo();var gYe=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:Yle(e,r.count),top_p:Kle(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=MY(r.repoInfo);if(s!==void 0&&(o.nwo=s),r.postOptions&&Object.assign(o,r.postOptions),r.enableThinking||r.modelConfiguration?.reasoningEfforts?.length){let c=mO(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}processResponse(e,r,n,o,s){let c=r.headers.get(rq)||void 0;return s.postOptions?.stream===!1?{type:"success",chatCompletions:this.processNonStreamingResponse(r,n,o,c),getProcessingTime:a(()=>O3(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")??Mt(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:Pn(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=Pn(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=SK.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:nxe(u,f=>Byn(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>O3(r),"getProcessingTime")}}};p();p();p();var cE=de(Io());var e_n="ephemeral",eQt=4,pQo=2;function t_n(t){let e=eQt-pQo-hQo(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===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===cE.Raw.ChatRole.Tool&&c?.role!==cE.Raw.ChatRole.Tool,d=s.role===cE.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===cE.Raw.ChatRole.User)||d)&&(s.content.push({type:cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e_n}),e--,e<=0))break;s.role===cE.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===cE.Raw.ChatRole.User||o.role===cE.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e_n})),o.role!==cE.Raw.ChatRole.User&&o.role!==cE.Raw.ChatRole.System)break}}a(t_n,"addCacheBreakpoints");function hQo(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(hQo,"countCacheBreakpoints");function r_n(t){for(let e of t)e.content=e.content.filter(r=>r.type!==cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(r_n,"removeCacheBreakpoints");var i_n=new fe("messagesApi"),mQo="Please continue.";function o_n(t){let e=yQo(t.tools),r=gQo(t.messages,t.ctx);EQo(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:mQo}]});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(o_n,"buildMessagesApiRequest");function gQo(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=GYe(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=GYe(s.content);s.copilot_cache_control&&n_n(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=GYe(s.content);if(s.thinking&&AQo(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{i_n.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&&n_n(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=GYe(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(gQo,"convertToAnthropicMessages");function GYe(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(GYe,"convertContentToAnthropicBlocks");function AQo(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&&i_n.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(AQo,"addThinkingBlocks");function n_n(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(n_n,"applyCacheControlToLastBlock");function yQo(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(yQo,"convertToAnthropicTools");function EQo(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=eQt-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(EQo,"addToolsAndSystemCacheControl");p();p();var iue=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;rL3(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")??Mt(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:Pn(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=Pn(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=SK.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:nxe(u,f=>Fyn(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>L3(r),"getProcessingTime")}}};p();p();p();var cE=de(xo());var t_n="ephemeral",tQt=4,AQo=2;function r_n(t){let e=tQt-AQo-yQo(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===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===cE.Raw.ChatRole.Tool&&c?.role!==cE.Raw.ChatRole.Tool,d=s.role===cE.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===cE.Raw.ChatRole.User)||d)&&(s.content.push({type:cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:t_n}),e--,e<=0))break;s.role===cE.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===cE.Raw.ChatRole.User||o.role===cE.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:t_n})),o.role!==cE.Raw.ChatRole.User&&o.role!==cE.Raw.ChatRole.System)break}}a(r_n,"addCacheBreakpoints");function yQo(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(yQo,"countCacheBreakpoints");function n_n(t){for(let e of t)e.content=e.content.filter(r=>r.type!==cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(n_n,"removeCacheBreakpoints");var o_n=new fe("messagesApi"),EQo="Please continue.";function s_n(t){let e=CQo(t.tools),r=_Qo(t.messages,t.ctx);bQo(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:EQo}]});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(s_n,"buildMessagesApiRequest");function _Qo(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=WYe(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=WYe(s.content);s.copilot_cache_control&&i_n(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=WYe(s.content);if(s.thinking&&vQo(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{o_n.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&&i_n(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=WYe(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(_Qo,"convertToAnthropicMessages");function WYe(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(WYe,"convertContentToAnthropicBlocks");function vQo(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&&o_n.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(vQo,"addThinkingBlocks");function i_n(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(i_n,"applyCacheControlToLastBlock");function CQo(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(CQo,"convertToAnthropicTools");function bQo(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=tQt-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(bQo,"addToolsAndSystemCacheControl");p();p();var iue=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(_){Cxe.warn(t,`Skipping malformed SSE event: ${String(_.message).substring(0,100)}`);return}let E=f.push(y,r);E&&h.push(E)}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){Cxe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(s_n,"processMessagesApiStream");var tQt=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}}):Cxe.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 Cxe.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&&Cxe.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=Jle(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 $Ye=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 o_n({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})}processResponse(e,r,n,o,s){let c=r.headers.get(rq)||void 0;return{type:"success",chatCompletions:s_n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>O3(r),"getProcessingTime")}}};p();p();p();p();var l_n=de(Io());var lr=class extends l_n.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?a_n(r):void 0,s=n?c_n(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?a_n(n):void 0,c=o?c_n(o):void 0;return this.renderCopilot(e,r,s,c)}};function a_n(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(a_n,"adaptProgressCallbackFromVSCode");function c_n(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(c_n,"adaptCancellationTokenFromVSCode");var u_n="phase_data",VYe=class extends lr{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:u_n,phase:e}})}};function WYe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===u_n&&typeof r.phase=="string")return r.phase}a(WYe,"rawPartAsPhaseData");p();var d_n="thinking",oue=class extends lr{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:d_n,thinking:e},tokenUsage:e.tokens??0})}};function zYe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===d_n&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(zYe,"rawPartAsThinkingData");var WS=de(Io());function _Qo(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=f_n(r);e.push({role:"system",content:n});break}case"user":{let n=f_n(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=CQo(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(_Qo,"convertToResponsesApiInput");function vQo(t){let e=[];for(let r of t)switch(r.role){case WS.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=bQo(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===WS.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=SQo(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 WS.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===WS.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===WS.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 WS.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===WS.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===WS.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 WS.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===WS.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(vQo,"convertRawMessagesToResponsesApiInput");function f_n(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(f_n,"convertMessageContentToInputParts");function CQo(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(CQo,"convertMessageContentToOutputParts");function bQo(t){let e=[];for(let r of t)if(r.type===WS.Raw.ChatCompletionContentPartKind.Opaque){let n=zYe(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a(bQo,"extractReasoningFromRawMessage");function SQo(t){for(let e of t)if(e.type===WS.Raw.ChatCompletionContentPartKind.Opaque){let r=WYe(e);if(r)return r}}a(SQo,"extractPhaseFromRawMessage");function p_n(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=vQo(r).input:u=_Qo(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(p_n,"buildResponsesApiRequest");p();var rQt=new fe("responsesApiStream"),TQo=10,YYe=500,OK=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function h_n(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${Xu(n)}. Input: '${t}'`)}}a(h_n,"parseCallArguments");async function*m_n(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 nQt(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new iue(E=>{try{let _={type:E.type,...JSON.parse(E.data)},v=f.push(_,r);v&&h.push(v)}catch(_){m=_}},(E,_)=>{if(A.length>=TQo)return;let v=E.trim(),b=_?.trim(),T=v&&b?`${v}: ${b}`:v||b||"";T.length>0&&A.push(T.length>YYe?T.substring(0,YYe):T)});for await(let E of l){if(s?.isCancellationRequested)break;for(y.feed(new Uint8Array(E));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 E=f.hasReceivedContentEvents();if(A.length>0){let _=A.join("; ");throw _.length>YYe&&(_=_.substring(0,YYe)+"\u2026"),rQt.error(t,`Non-SSE text received in stream for request ${u}: ${_}`),E?new OK(`The server disconnected unexpectedly while generating a response (${_}). The partial response above may be incomplete.`):new OK(`The server returned an error: ${_}`)}else if(E)throw rQt.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new OK("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){rQt.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(m_n,"processResponsesApiStream");var nQt=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 Cxe=new fe("messagesApiStream");async function*a_n(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 rQt(t,n,u,d,o,c),h=[],m;try{let g=new iue(A=>{try{if(A.data==="[DONE]")return;let y;try{y={type:A.type,...JSON.parse(A.data)}}catch(_){Cxe.warn(t,`Skipping malformed SSE event: ${String(_.message).substring(0,100)}`);return}let E=f.push(y,r);E&&h.push(E)}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){Cxe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(a_n,"processMessagesApiStream");var rQt=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}}):Cxe.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 Cxe.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&&Cxe.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=Jle(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 zYe=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 s_n({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})}processResponse(e,r,n,o,s){let c=r.headers.get(nq)||void 0;return{type:"success",chatCompletions:a_n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>L3(r),"getProcessingTime")}}};p();p();p();p();var u_n=de(xo());var lr=class extends u_n.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?c_n(r):void 0,s=n?l_n(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?c_n(n):void 0,c=o?l_n(o):void 0;return this.renderCopilot(e,r,s,c)}};function c_n(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(c_n,"adaptProgressCallbackFromVSCode");function l_n(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(l_n,"adaptCancellationTokenFromVSCode");var d_n="phase_data",YYe=class extends lr{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:d_n,phase:e}})}};function KYe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===d_n&&typeof r.phase=="string")return r.phase}a(KYe,"rawPartAsPhaseData");p();var f_n="thinking",oue=class extends lr{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:f_n,thinking:e},tokenUsage:e.tokens??0})}};function JYe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===f_n&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(JYe,"rawPartAsThinkingData");var YS=de(xo());function SQo(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=p_n(r);e.push({role:"system",content:n});break}case"user":{let n=p_n(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=IQo(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(SQo,"convertToResponsesApiInput");function TQo(t){let e=[];for(let r of t)switch(r.role){case YS.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=xQo(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===YS.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=wQo(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 YS.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===YS.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===YS.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 YS.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===YS.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===YS.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 YS.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===YS.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(TQo,"convertRawMessagesToResponsesApiInput");function p_n(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(p_n,"convertMessageContentToInputParts");function IQo(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(IQo,"convertMessageContentToOutputParts");function xQo(t){let e=[];for(let r of t)if(r.type===YS.Raw.ChatCompletionContentPartKind.Opaque){let n=JYe(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a(xQo,"extractReasoningFromRawMessage");function wQo(t){for(let e of t)if(e.type===YS.Raw.ChatCompletionContentPartKind.Opaque){let r=KYe(e);if(r)return r}}a(wQo,"extractPhaseFromRawMessage");function h_n(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=TQo(r).input:u=SQo(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(h_n,"buildResponsesApiRequest");p();var nQt=new fe("responsesApiStream"),RQo=10,ZYe=500,OK=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function m_n(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${Xu(n)}. Input: '${t}'`)}}a(m_n,"parseCallArguments");async function*g_n(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 iQt(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new iue(E=>{try{let _={type:E.type,...JSON.parse(E.data)},v=f.push(_,r);v&&h.push(v)}catch(_){m=_}},(E,_)=>{if(A.length>=RQo)return;let v=E.trim(),b=_?.trim(),T=v&&b?`${v}: ${b}`:v||b||"";T.length>0&&A.push(T.length>ZYe?T.substring(0,ZYe):T)});for await(let E of l){if(s?.isCancellationRequested)break;for(y.feed(new Uint8Array(E));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 E=f.hasReceivedContentEvents();if(A.length>0){let _=A.join("; ");throw _.length>ZYe&&(_=_.substring(0,ZYe)+"\u2026"),nQt.error(t,`Non-SSE text received in stream for request ${u}: ${_}`),E?new OK(`The server disconnected unexpectedly while generating a response (${_}). The partial response above may be incomplete.`):new OK(`The server returned an error: ${_}`)}else if(E)throw nQt.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new OK("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){nQt.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(g_n,"processResponsesApiStream");var iQt=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=h_n(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=h_n(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=Jle(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 KYe=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return p_n({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??Kle(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:mO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}processResponse(e,r,n,o,s){let c=r.headers.get(rq)||void 0;return{type:"success",chatCompletions:m_n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>O3(r),"getProcessingTime")}}};BP.register(new KYe);BP.register(new pYe);BP.register(new $Ye);p();var JYe=require("fs"),zS=de(require("path"));function eKe(t){return Zae(()=>!!Ft(t,Ye.PromptPersistBasePath)?.trim(),!1)}a(eKe,"isPromptPersistEnabled");var IQo={mkdir:a((t,e)=>JYe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>JYe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>JYe.promises.appendFile(t,e,r),"appendFile")},jP,ZYe,sQt,iQt=new Map,g_n=0,oQt=new Map,aQt=new Map;function cQt(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(cQt,"formatHumanTimestamp");function lQt(t,e){return ZYe||(ZYe=xQo(t,e)),ZYe}a(lQt,"getSharedProcessRoot");async function xQo(t,e){let r=cQt(new Date);jP=zS.join(t,`pid-${process.pid}_${r}`),await e.mkdir(jP,{recursive:!0});let n=new Date().toISOString();sQt=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:jP};return await e.writeFile(zS.join(jP,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await RQo(jP,e).catch(()=>{}),await kQo(jP,e).catch(()=>{}),jP}a(xQo,"initProcessRoot");async function wQo(t){if(jP)try{let e=zS.join(jP,"session.json"),r=new Date().toISOString(),n={createdAt:sQt??r,updatedAt:r,pid:process.pid,processRoot:jP};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(wQo,"touchProcessRootSessionJson");function uQt(t){return aQt.get(t)}a(uQt,"getTurnDir");function A_n(){jP=void 0,ZYe=void 0,sQt=void 0,iQt.clear(),g_n=0,oQt.clear(),aQt.clear()}a(A_n,"resetSharedProcessRoot");async function RQo(t,e){await e.writeFile(zS.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=m_n(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=m_n(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=Jle(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 XYe=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return h_n({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??Kle(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:mO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}processResponse(e,r,n,o,s){let c=r.headers.get(nq)||void 0;return{type:"success",chatCompletions:g_n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>L3(r),"getProcessingTime")}}};FP.register(new XYe);FP.register(new gYe);FP.register(new zYe);p();var eKe=require("fs"),KS=de(require("path"));function nKe(t){return Zae(()=>!!Ft(t,Ye.PromptPersistBasePath)?.trim(),!1)}a(nKe,"isPromptPersistEnabled");var kQo={mkdir:a((t,e)=>eKe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>eKe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>eKe.promises.appendFile(t,e,r),"appendFile")},HP,tKe,aQt,oQt=new Map,A_n=0,sQt=new Map,cQt=new Map;function lQt(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(lQt,"formatHumanTimestamp");function uQt(t,e){return tKe||(tKe=PQo(t,e)),tKe}a(uQt,"getSharedProcessRoot");async function PQo(t,e){let r=lQt(new Date);HP=KS.join(t,`pid-${process.pid}_${r}`),await e.mkdir(HP,{recursive:!0});let n=new Date().toISOString();aQt=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:HP};return await e.writeFile(KS.join(HP,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await NQo(HP,e).catch(()=>{}),await MQo(HP,e).catch(()=>{}),HP}a(PQo,"initProcessRoot");async function DQo(t){if(HP)try{let e=KS.join(HP,"session.json"),r=new Date().toISOString(),n={createdAt:aQt??r,updatedAt:r,pid:process.pid,processRoot:HP};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(DQo,"touchProcessRootSessionJson");function dQt(t){return cQt.get(t)}a(dQt,"getTurnDir");function y_n(){HP=void 0,tKe=void 0,aQt=void 0,oQt.clear(),A_n=0,sQt.clear(),cQt.clear()}a(y_n,"resetSharedProcessRoot");async function NQo(t,e){await e.writeFile(KS.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. @@ -2508,7 +2508,7 @@ node generateHar.js http-log my-session.har \`\`\` Run from this directory, or pass absolute paths. -`,"utf8")}a(RQo,"writeReadme");async function kQo(t,e){await e.writeFile(zS.join(t,"generateHar.js"),`#!/usr/bin/env node +`,"utf8")}a(NQo,"writeReadme");async function MQo(t,e){await e.writeFile(KS.join(t,"generateHar.js"),`#!/usr/bin/env node "use strict"; /** * Converts per-request JSON files from an http-log directory into a single HAR @@ -2577,37 +2577,37 @@ async function main() { } main().catch(e => { console.error(e); process.exit(1); }); -`,"utf8")}a(kQo,"writeGenerateHarScript");var XYe=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??IQo}static{a(this,"LLMRequestPersistence")}isEnabled(){return!!this.getBasePath()}async ensureInitialized(){if(this.isEnabled())try{await this.ensureSessionDir()}catch{}}getBasePath(){return Ft(this.ctx,Ye.PromptPersistBasePath)?.trim()||void 0}ensureSessionDir(){return this.sessionDirPromise||(this.sessionDirPromise=this.initSessionDir()),this.sessionDirPromise}async initSessionDir(){let e=this.getBasePath(),r=await lQt(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=(iQt.get(this.conversationId)??0)+1;iQt.set(this.conversationId,l);let u=String(l).padStart(6,"0"),d=this.parentTurnId?uQt(this.parentTurnId):void 0;if(this.subagentName&&d)this.sessionDir=zS.join(d,"runSubAgent",n,`${u}_${o}${c}`);else{let f=oQt.get(this.conversationId);f||(f=String(++g_n).padStart(6,"0"),oQt.set(this.conversationId,f)),this.sessionDir=zS.join(r,"conversations",`${f}_${n}`,`${u}_${o}${c}`)}await this.fileOps.mkdir(this.sessionDir,{recursive:!0}),aQt.set(this.turnId,this.sessionDir),await this.writeTurnMetadata(),wQo(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=zS.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=zS.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=zS.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=zS.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=zS.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 rKe=require("fs"),bO=de(require("path"));var y_n=require("stream");var PQo={mkdir:a((t,e)=>rKe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>rKe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>rKe.promises.appendFile(t,e,r),"appendFile")},tKe,nKe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??PQo,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(){tKe=void 0,A_n(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return Ft(this.ctx,Ye.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return tKe||(tKe=this.initHttpLogDir()),tKe}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 lQt(this.basePath,this.toPersistenceFileOps()),r=bO.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=uQt(e);if(!r)return;let n=bO.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(bO.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(bO.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(bO.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(bO.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(bO.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(bO.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(bO.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},iKe=class extends ex{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 y_n.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 LK=class t extends G_{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new fe("AutoModelService"),this._register(bs(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(xs).getMetadata(),c=await this._ctx.get(el).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 b$e(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 oKe="Auto",V_="auto";var xo=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 da(e.get(Yn)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(xs).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(Au);if(!s&&l.quotaExhausted&&!c){let u=await e.get(xs).getFallbackModel();if(u?.id)return e.get(el).getBestChatModelConfig([u.id])}if(r)return e.get(el).getBestChatModelConfig(xS(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===V_)return await e.get(LK).resolveModelConfiguration(n??"unknown",o);let s=await e.get(el).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===V_?V_:(await e.get(xs).getMetadata()).find(o=>o.capabilities.family===r&&o.capabilities.type==="chat"&&o.model_picker_enabled===!0)?.id}static transformMessages(e,r){return r===Rn.O1Ga||r===Rn.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}=dQt(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var th=new fe("fetchChat"),DQo=new Set([500,502,504]),NQo=[1e3,1e4,1e4],sKe=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(Gm(f)||!XI(f))throw f;th.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(LQo(l.status)){th.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 xo.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(Au).processQuotaHeaders(l.headers),e.get(gO).processRateLimitHeaders(l.headers);let u=BP.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){th.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 BQo(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){th.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}th.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 Wt.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=BP.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,apiType:n.apiType},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);return gyn(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await MQo(e,n.messages,n.copilotApiBaseUrl,n.engineName,r,n.ourRequestId,u,n.authToken,n.uiKind,o,n.llmInteraction,n.apiKey,n.modelProviderName,n.copilotEditsSessionHeader,n.copilotSessionToken,s,n.supportsAdaptiveThinking,n.apiType)}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`;th.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),Et(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 th.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=OU(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return At(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 th.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400){let f=$_.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:$_.translate402Reason(c,{retryAfterHeader:u??void 0,retryAfterSeconds:OU(n),copilotPlan:d.userInfo?.copilotPlan,isTBBEnabled:d.userInfo?.isTBBEnabled,canUpgradePlan:d.userInfo?.canUpgradePlan,overageEnabled:e.get(Au).overageEnabled}),code:n.status}:n.status===503?{type:"failed",reason:c,code:n.status}:(th.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function MQo(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=n===""&&o===""?r:wa(r,n,o),b=d.extendedBy({endpoint:o,engineName:n,uiKind:u});dYe(c,b,["messages"]),b.properties.headerRequestId=s,Et(t,"request.sent",b);let T=yl(),w=wyn(u),R={...i0(t),...f.toCapiHeaders()};CB()&&(R=await C$e(t,R)),c.messages?.some(D=>Array.isArray(D.content)?D.content.some(N=>"image_url"in N):!1)&&(R["Copilot-Vision-Request"]="true");let x=_==="messages"&&!!h;h&&(_==="messages"?(R["x-api-key"]=h,R["anthropic-version"]=uyn):R["api-key"]=h),g&&(R[rq]=g),A&&(R["copilot-session-token"]=A),o==="v1/messages"&&!E&&(R["anthropic-beta"]=rYe),c.messages&&c.messages.forEach(D=>{OQo(D)&&D.tool_calls&&(D.tool_calls=D.tool_calls.map(N=>Oyn(N)))});let P=Zae(()=>eKe(t)?new nKe(t):void 0,void 0);return HW(t,v,l,w,s,c,y,R,void 0,m,P,e,x).then(D=>{let N=M3(D);b.extendWithRequestId(N);let L=yl()-T;return b.measurements.totalTimeMs=L,th.info(t,`Request ${s} at <${v}> finished with ${D.status} status after ${L}ms`),th.debug(t,"request.response properties",b.properties),th.debug(t,"request.response measurements",b.measurements),th.debug(t,"messages:",JSON.stringify(e)),Et(t,"request.response",b),P?new iKe(D,P,s,T):D}).catch(D=>{if(Gm(D))throw D;let N=b.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",N),b.properties.message=String(Wh(D,"name")??""),b.properties.code=String(Wh(D,"code")??""),b.properties.errno=String(Wh(D,"errno")??""),b.properties.type=String(Wh(D,"type")??"");let L=yl()-T;throw b.measurements.totalTimeMs=L,th.info(t,`Request ${s} at <${v}> rejected with ${String(D)} after ${L}ms`),th.debug(t,"request.error properties",b.properties),th.debug(t,"request.error measurements",b.measurements),Et(t,"request.error",b),D}).finally(()=>{Zle(t,e,b)})}a(MQo,"fetchWithInstrumentation");function OQo(t){return"tool_calls"in t}a(OQo,"isChatMessageWithToolCalls");function LQo(t){return DQo.has(t)}a(LQo,"shouldRetryStatusCode");async function BQo(t,e,r,n,o=NQo){let s=t.get(tr),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(th.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([bC(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await bC(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 th.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,th.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,th.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return th.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(BQo,"checkNetworkConnectivity");p();var FQo=[{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 aKe(t){let e=t.slice();return e.reverse(),E_n(e)||E_n(e.filter(r=>r.trim().length>0))}a(aKe,"isRepetitive");function E_n(t){let e=UQo(t);for(let r of FQo){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(UQo,"kmp_prefix_function");Mo();var oc=class{constructor(e){this.ctx=e;this.fetcher=new sKe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=Mt(),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&&Ft(this.ctx,Ye.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&myn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=mO(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=Ft(this.ctx,Ye.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(!XQ(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await Wze(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===io.Azure)if(e.modelConfiguration.deploymentUrl)A=zAn(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(jle(e.modelConfiguration?.providerName))A=zle[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else{if(!e.modelConfiguration.deploymentUrl)throw new Error(`No endpoint URL found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);if(!E)throw new Error(`No API key found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);let D=e.modelConfiguration.apiType??XIe;A=Vze(e.modelConfiguration.deploymentUrl,D),y=WAn(D),e.authToken=E}}else{if(A=tx(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?oYe(this.ctx,f):!1;y=iYe(f,D)}ot.debug(this.ctx,`Endpoint routing: model=${f?.modelId}, supportedEndpoints=${JSON.stringify(f?.supportedEndpoints)}, selected=${y}`)}let v=f?.copilotSessionToken,b=e.authToken??m.token,T=BP.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:b,apiKey:E,modelProviderName:_,apiType:f?.apiType,...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 L=x;if(await c.onRetry?.(L,N),L.type==="failed"&&L.retryAfter!==void 0&&L.retryAfter>0){let B=L.retryAfter;if(await new Promise(q=>{let M=setTimeout(()=>{O.dispose(),q()},B*1e3),O=r.onCancellationRequested(()=>{clearTimeout(M),O.dispose(),q()})}),r.isCancellationRequested)break}x=await this.fetch(R,o,r,n),At(this.ctx,"request.throttled.retry",{requestSource:e.uiKind??"unknown",resultType:x.type,modelId:f?f.providerName?"custom-byok":f.modelId:"unknown"},{retryAfter:L.type==="failed"?L.retryAfter??-1:-1,resultCode:x.type==="failed"?x.code??-1:-1})}}let P=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,P,y),this.trackTurnCredits(e,x),Jae(()=>{if(s)return s.persistLLMRequest({requestId:R.ourRequestId,messages:R.messages,tools:R.tools,model:R.model,response:x,durationMs:P})},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=ixe(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:Pn(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:Pn(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=>Pn(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 aKe(e.tokens)?(r.extendWithRequestId(e.requestId),Et(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(Gm(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 OK?!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(Au).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),At(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var zh=class{static{a(this,"ConversationInspector")}};p();p();var Yh=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]}},fQt=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}}},pQt=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}}},gg=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 fQt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new pQt(this._processor(e),this.id)}};p();p();var bl=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")}},sue=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new bl(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 __n=new fe("EncodingConfigurationService"),SO=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),__n.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),__n.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var v_n=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 QQo=globalThis.performance&&typeof globalThis.performance.now=="function",cKe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=QQo&&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 C_n=!1,qQo=!1,Sxe;(M=>{M.None=a(()=>G_.None,"None");function e(O){if(qQo){let{onDidAddListener:j}=O,Q=bxe.create(),U=0;O.onDidAddListener=()=>{++U===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),Q.print()),j?.()}}}a(e,"_addLeakageTraceLogic");function r(O,j){return g(O,()=>{},0,void 0,!0,void 0,j)}M.defer=r,a(r,"defer");function n(O){return(j,Q=null,U)=>{let Y=!1,W;return W=O(V=>{if(!Y)return W?W.dispose():Y=!0,j.call(Q,V)},null,U),Y&&W.dispose(),W}}M.once=n,a(n,"once");function o(O,j){return M.once(M.filter(O,j))}M.onceIf=o,a(o,"onceIf");function s(O,j,Q){return h((U,Y=null,W)=>O(V=>U.call(Y,j(V)),null,W),Q)}M.map=s,a(s,"map");function c(O,j,Q){return h((U,Y=null,W)=>O(V=>{j(V),U.call(Y,V)},null,W),Q)}M.forEach=c,a(c,"forEach");function l(O,j,Q){return h((U,Y=null,W)=>O(V=>j(V)&&U.call(Y,V),null,W),Q)}M.filter=l,a(l,"filter");function u(O){return O}M.signal=u,a(u,"signal");function d(...O){return(j,Q=null,U)=>{let Y=cyn(...O.map(W=>W(V=>j.call(Q,V))));return m(Y,U)}}M.any=d,a(d,"any");function f(O,j,Q,U){let Y=Q;return s(O,W=>(Y=j(Y,W),Y),U)}M.reduce=f,a(f,"reduce");function h(O,j){let Q,U={onWillAddFirstListener(){Q=O(Y.fire,Y)},onDidRemoveLastListener(){Q?.dispose()}};j||e(U);let Y=new YS(U);return j?.add(Y),Y.event}a(h,"snapshot");function m(O,j){return j instanceof Array?j.push(O):j&&j.add(O),O}a(m,"addAndReturnDisposable");function g(O,j,Q=100,U=!1,Y=!1,W,V){let z,ie,H,re=0,le,Le={leakWarningThreshold:W,onWillAddFirstListener(){z=O(Ue=>{re++,ie=j(ie,Ue),U&&!H&&(ge.fire(ie),ie=void 0),le=a(()=>{let ke=ie;ie=void 0,H=void 0,(!U||re>1)&&ge.fire(ke),re=0},"doFire"),typeof Q=="number"?(clearTimeout(H),H=setTimeout(le,Q)):H===void 0&&(H=0,queueMicrotask(le))})},onWillRemoveListener(){Y&&re>0&&le?.()},onDidRemoveLastListener(){le=void 0,z.dispose()}};V||e(Le);let ge=new YS(Le);return V?.add(ge),ge.event}M.debounce=g,a(g,"debounce");function A(O,j=0,Q){return M.debounce(O,(U,Y)=>U?(U.push(Y),U):[Y],j,void 0,!0,void 0,Q)}M.accumulate=A,a(A,"accumulate");function y(O,j=(U,Y)=>U===Y,Q){let U=!0,Y;return l(O,W=>{let V=U||!j(W,Y);return U=!1,Y=W,V},Q)}M.latch=y,a(y,"latch");function E(O,j,Q){return[M.filter(O,j,Q),M.filter(O,U=>!j(U),Q)]}M.split=E,a(E,"split");function _(O,j=!1,Q=[],U){let Y=Q.slice(),W=O(ie=>{Y?Y.push(ie):z.fire(ie)});U&&U.add(W);let V=a(()=>{Y?.forEach(ie=>z.fire(ie)),Y=null},"flush"),z=new YS({onWillAddFirstListener(){W||(W=O(ie=>z.fire(ie)),U&&U.add(W))},onDidAddFirstListener(){Y&&(j?setTimeout(V):V())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return U&&U.add(z),z.event}M.buffer=_,a(_,"buffer");function v(O,j){return a((U,Y,W)=>{let V=j(new T);return O(function(z){let ie=V.evaluate(z);ie!==b&&U.call(Y,ie)},void 0,W)},"fn")}M.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(Q=>(j(Q),Q)),this}filter(j){return this.steps.push(Q=>j(Q)?Q:b),this}reduce(j,Q){let U=Q;return this.steps.push(Y=>(U=j(U,Y),U)),this}latch(j=(Q,U)=>Q===U){let Q=!0,U;return this.steps.push(Y=>{let W=Q||!j(Y,U);return Q=!1,U=Y,W?Y:b}),this}evaluate(j){for(let Q of this.steps)if(j=Q(j),j===b)break;return j}}function w(O,j,Q=U=>U){let U=a((...z)=>V.fire(Q(...z)),"fn"),Y=a(()=>O.on(j,U),"onFirstListenerAdd"),W=a(()=>O.removeListener(j,U),"onLastListenerRemove"),V=new YS({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(O,j,Q=U=>U){let U=a((...z)=>V.fire(Q(...z)),"fn"),Y=a(()=>O.addEventListener(j,U),"onFirstListenerAdd"),W=a(()=>O.removeEventListener(j,U),"onLastListenerRemove"),V=new YS({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(O,j){return new Promise(Q=>n(O)(Q,null,j))}M.toPromise=x,a(x,"toPromise");function P(O){let j=new YS;return O.then(Q=>{j.fire(Q)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}M.fromPromise=P,a(P,"fromPromise");function D(O,j){return O(Q=>j.fire(Q))}M.forward=D,a(D,"forward");function N(O,j,Q){return j(Q),O(U=>j(U))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class L{constructor(j,Q){this._observable=j;this._counter=0;this._hasChanged=!1;let U={onWillAddFirstListener:a(()=>{j.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{j.removeObserver(this)},"onDidRemoveLastListener")};Q||e(U),this.emitter=new YS(U),Q&&Q.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,Q){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(O,j){return new L(O,j).emitter.event}M.fromObservable=B,a(B,"fromObservable");function q(O){return(j,Q,U)=>{let Y=0,W=!1,V={beginUpdate(){Y++},endUpdate(){Y--,Y===0&&(O.reportChanges(),W&&(W=!1,j.call(Q)))},handlePossibleChange(){},handleChange(){W=!0}};O.addObserver(V),O.reportChanges();let z={dispose(){O.removeObserver(V)}};return U instanceof eq?U.add(z):Array.isArray(U)&&U.push(z),z}}M.fromObservableLight=q,a(q,"fromObservableLight")})(Sxe||={});var hQt=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 cKe,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}}},b_n=-1;var mQt=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 oKe=require("fs"),bO=de(require("path"));var E_n=require("stream");var OQo={mkdir:a((t,e)=>oKe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>oKe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>oKe.promises.appendFile(t,e,r),"appendFile")},iKe,sKe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??OQo,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(){iKe=void 0,y_n(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return Ft(this.ctx,Ye.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return iKe||(iKe=this.initHttpLogDir()),iKe}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 uQt(this.basePath,this.toPersistenceFileOps()),r=bO.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=dQt(e);if(!r)return;let n=bO.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(bO.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(bO.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(bO.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(bO.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(bO.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(bO.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(bO.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},aKe=class extends rx{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 E_n.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 LK=class t extends $_{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new fe("AutoModelService"),this._register(bs(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(xs).getMetadata(),c=await this._ctx.get(el).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 T$e(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 cKe="Auto",W_="auto";var wo=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 Ha(e.get(ri)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(xs).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(Au);if(!s&&l.quotaExhausted&&!c){let u=await e.get(xs).getFallbackModel();if(u?.id)return e.get(el).getBestChatModelConfig([u.id])}if(r)return e.get(el).getBestChatModelConfig(wS(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===W_)return await e.get(LK).resolveModelConfiguration(n??"unknown",o);let s=await e.get(el).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===W_?W_:(await e.get(xs).getMetadata()).find(o=>o.capabilities.family===r&&o.capabilities.type==="chat"&&o.model_picker_enabled===!0)?.id}static transformMessages(e,r){return r===Rn.O1Ga||r===Rn.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}=fQt(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var th=new fe("fetchChat"),LQo=new Set([500,502,504]),BQo=[1e3,1e4,1e4],lKe=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(Gm(f)||!tx(f))throw f;th.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(QQo(l.status)){th.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 wo.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(Au).processQuotaHeaders(l.headers),e.get(gO).processRateLimitHeaders(l.headers);let u=FP.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){th.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 qQo(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){th.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}th.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 Wt.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=FP.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,apiType:n.apiType},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);return Ayn(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await FQo(e,n.messages,n.copilotApiBaseUrl,n.engineName,r,n.ourRequestId,u,n.authToken,n.uiKind,o,n.llmInteraction,n.apiKey,n.modelProviderName,n.copilotEditsSessionHeader,n.copilotSessionToken,s,n.supportsAdaptiveThinking,n.apiType)}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`;th.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),Et(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 th.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=LU(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return At(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 th.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400){let f=V_.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:V_.translate402Reason(c,{retryAfterHeader:u??void 0,retryAfterSeconds:LU(n),copilotPlan:d.userInfo?.copilotPlan,isTBBEnabled:d.userInfo?.isTBBEnabled,canUpgradePlan:d.userInfo?.canUpgradePlan,overageEnabled:e.get(Au).overageEnabled}),code:n.status}:n.status===503?{type:"failed",reason:c,code:n.status}:(th.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function FQo(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=n===""&&o===""?r:xa(r,n,o),b=d.extendedBy({endpoint:o,engineName:n,uiKind:u});hYe(c,b,["messages"]),b.properties.headerRequestId=s,Et(t,"request.sent",b);let T=yl(),w=Ryn(u),R={...i0(t),...f.toCapiHeaders()};CB()&&(R=await S$e(t,R)),c.messages?.some(D=>Array.isArray(D.content)?D.content.some(N=>"image_url"in N):!1)&&(R["Copilot-Vision-Request"]="true");let x=_==="messages"&&!!h;h&&(_==="messages"?(R["x-api-key"]=h,R["anthropic-version"]=dyn):R["api-key"]=h),g&&(R[nq]=g),A&&(R["copilot-session-token"]=A),o==="v1/messages"&&!E&&(R["anthropic-beta"]=oYe),c.messages&&c.messages.forEach(D=>{UQo(D)&&D.tool_calls&&(D.tool_calls=D.tool_calls.map(N=>Lyn(N)))});let P=Zae(()=>nKe(t)?new sKe(t):void 0,void 0);return GW(t,v,l,w,s,c,y,R,void 0,m,P,e,x).then(D=>{let N=O3(D);b.extendWithRequestId(N);let L=yl()-T;return b.measurements.totalTimeMs=L,th.info(t,`Request ${s} at <${v}> finished with ${D.status} status after ${L}ms`),th.debug(t,"request.response properties",b.properties),th.debug(t,"request.response measurements",b.measurements),th.debug(t,"messages:",JSON.stringify(e)),Et(t,"request.response",b),P?new aKe(D,P,s,T):D}).catch(D=>{if(Gm(D))throw D;let N=b.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",N),b.properties.message=String(Wh(D,"name")??""),b.properties.code=String(Wh(D,"code")??""),b.properties.errno=String(Wh(D,"errno")??""),b.properties.type=String(Wh(D,"type")??"");let L=yl()-T;throw b.measurements.totalTimeMs=L,th.info(t,`Request ${s} at <${v}> rejected with ${String(D)} after ${L}ms`),th.debug(t,"request.error properties",b.properties),th.debug(t,"request.error measurements",b.measurements),Et(t,"request.error",b),D}).finally(()=>{Zle(t,e,b)})}a(FQo,"fetchWithInstrumentation");function UQo(t){return"tool_calls"in t}a(UQo,"isChatMessageWithToolCalls");function QQo(t){return LQo.has(t)}a(QQo,"shouldRetryStatusCode");async function qQo(t,e,r,n,o=BQo){let s=t.get(nr),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(th.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([SC(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await SC(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 th.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,th.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,th.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return th.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(qQo,"checkNetworkConnectivity");p();var jQo=[{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 uKe(t){let e=t.slice();return e.reverse(),__n(e)||__n(e.filter(r=>r.trim().length>0))}a(uKe,"isRepetitive");function __n(t){let e=HQo(t);for(let r of jQo){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(HQo,"kmp_prefix_function");Oo();var oc=class{constructor(e){this.ctx=e;this.fetcher=new lKe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=Mt(),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&&Ft(this.ctx,Ye.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&gyn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=mO(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=Ft(this.ctx,Ye.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(!eq(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await Yze(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===io.Azure)if(e.modelConfiguration.deploymentUrl)A=YAn(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(jle(e.modelConfiguration?.providerName))A=zle[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else{if(!e.modelConfiguration.deploymentUrl)throw new Error(`No endpoint URL found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);if(!E)throw new Error(`No API key found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);let D=e.modelConfiguration.apiType??exe;A=zze(e.modelConfiguration.deploymentUrl,D),y=zAn(D),e.authToken=E}}else{if(A=nx(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?cYe(this.ctx,f):!1;y=aYe(f,D)}ot.debug(this.ctx,`Endpoint routing: model=${f?.modelId}, supportedEndpoints=${JSON.stringify(f?.supportedEndpoints)}, selected=${y}`)}let v=f?.copilotSessionToken,b=e.authToken??m.token,T=FP.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:b,apiKey:E,modelProviderName:_,apiType:f?.apiType,...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 L=x;if(await c.onRetry?.(L,N),L.type==="failed"&&L.retryAfter!==void 0&&L.retryAfter>0){let B=L.retryAfter;if(await new Promise(q=>{let M=setTimeout(()=>{O.dispose(),q()},B*1e3),O=r.onCancellationRequested(()=>{clearTimeout(M),O.dispose(),q()})}),r.isCancellationRequested)break}x=await this.fetch(R,o,r,n),At(this.ctx,"request.throttled.retry",{requestSource:e.uiKind??"unknown",resultType:x.type,modelId:f?f.providerName?"custom-byok":f.modelId:"unknown"},{retryAfter:L.type==="failed"?L.retryAfter??-1:-1,resultCode:x.type==="failed"?x.code??-1:-1})}}let P=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,P,y),this.trackTurnCredits(e,x),Jae(()=>{if(s)return s.persistLLMRequest({requestId:R.ourRequestId,messages:R.messages,tools:R.tools,model:R.model,response:x,durationMs:P})},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=ixe(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:Pn(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:Pn(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=>Pn(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 uKe(e.tokens)?(r.extendWithRequestId(e.requestId),Et(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(Gm(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 OK?!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(Au).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),At(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var zh=class{static{a(this,"ConversationInspector")}};p();p();var Yh=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]}},pQt=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}}},hQt=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}}},gg=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 pQt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new hQt(this._processor(e),this.id)}};p();p();var bl=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")}},sue=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new bl(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 v_n=new fe("EncodingConfigurationService"),SO=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),v_n.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),v_n.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var C_n=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 GQo=globalThis.performance&&typeof globalThis.performance.now=="function",dKe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=GQo&&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 b_n=!1,$Qo=!1,Sxe;(M=>{M.None=a(()=>$_.None,"None");function e(O){if($Qo){let{onDidAddListener:j}=O,Q=bxe.create(),U=0;O.onDidAddListener=()=>{++U===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),Q.print()),j?.()}}}a(e,"_addLeakageTraceLogic");function r(O,j){return g(O,()=>{},0,void 0,!0,void 0,j)}M.defer=r,a(r,"defer");function n(O){return(j,Q=null,U)=>{let Y=!1,W;return W=O(V=>{if(!Y)return W?W.dispose():Y=!0,j.call(Q,V)},null,U),Y&&W.dispose(),W}}M.once=n,a(n,"once");function o(O,j){return M.once(M.filter(O,j))}M.onceIf=o,a(o,"onceIf");function s(O,j,Q){return h((U,Y=null,W)=>O(V=>U.call(Y,j(V)),null,W),Q)}M.map=s,a(s,"map");function c(O,j,Q){return h((U,Y=null,W)=>O(V=>{j(V),U.call(Y,V)},null,W),Q)}M.forEach=c,a(c,"forEach");function l(O,j,Q){return h((U,Y=null,W)=>O(V=>j(V)&&U.call(Y,V),null,W),Q)}M.filter=l,a(l,"filter");function u(O){return O}M.signal=u,a(u,"signal");function d(...O){return(j,Q=null,U)=>{let Y=lyn(...O.map(W=>W(V=>j.call(Q,V))));return m(Y,U)}}M.any=d,a(d,"any");function f(O,j,Q,U){let Y=Q;return s(O,W=>(Y=j(Y,W),Y),U)}M.reduce=f,a(f,"reduce");function h(O,j){let Q,U={onWillAddFirstListener(){Q=O(Y.fire,Y)},onDidRemoveLastListener(){Q?.dispose()}};j||e(U);let Y=new JS(U);return j?.add(Y),Y.event}a(h,"snapshot");function m(O,j){return j instanceof Array?j.push(O):j&&j.add(O),O}a(m,"addAndReturnDisposable");function g(O,j,Q=100,U=!1,Y=!1,W,V){let z,ie,H,re=0,le,Le={leakWarningThreshold:W,onWillAddFirstListener(){z=O(Ue=>{re++,ie=j(ie,Ue),U&&!H&&(ge.fire(ie),ie=void 0),le=a(()=>{let ke=ie;ie=void 0,H=void 0,(!U||re>1)&&ge.fire(ke),re=0},"doFire"),typeof Q=="number"?(clearTimeout(H),H=setTimeout(le,Q)):H===void 0&&(H=0,queueMicrotask(le))})},onWillRemoveListener(){Y&&re>0&&le?.()},onDidRemoveLastListener(){le=void 0,z.dispose()}};V||e(Le);let ge=new JS(Le);return V?.add(ge),ge.event}M.debounce=g,a(g,"debounce");function A(O,j=0,Q){return M.debounce(O,(U,Y)=>U?(U.push(Y),U):[Y],j,void 0,!0,void 0,Q)}M.accumulate=A,a(A,"accumulate");function y(O,j=(U,Y)=>U===Y,Q){let U=!0,Y;return l(O,W=>{let V=U||!j(W,Y);return U=!1,Y=W,V},Q)}M.latch=y,a(y,"latch");function E(O,j,Q){return[M.filter(O,j,Q),M.filter(O,U=>!j(U),Q)]}M.split=E,a(E,"split");function _(O,j=!1,Q=[],U){let Y=Q.slice(),W=O(ie=>{Y?Y.push(ie):z.fire(ie)});U&&U.add(W);let V=a(()=>{Y?.forEach(ie=>z.fire(ie)),Y=null},"flush"),z=new JS({onWillAddFirstListener(){W||(W=O(ie=>z.fire(ie)),U&&U.add(W))},onDidAddFirstListener(){Y&&(j?setTimeout(V):V())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return U&&U.add(z),z.event}M.buffer=_,a(_,"buffer");function v(O,j){return a((U,Y,W)=>{let V=j(new T);return O(function(z){let ie=V.evaluate(z);ie!==b&&U.call(Y,ie)},void 0,W)},"fn")}M.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(Q=>(j(Q),Q)),this}filter(j){return this.steps.push(Q=>j(Q)?Q:b),this}reduce(j,Q){let U=Q;return this.steps.push(Y=>(U=j(U,Y),U)),this}latch(j=(Q,U)=>Q===U){let Q=!0,U;return this.steps.push(Y=>{let W=Q||!j(Y,U);return Q=!1,U=Y,W?Y:b}),this}evaluate(j){for(let Q of this.steps)if(j=Q(j),j===b)break;return j}}function w(O,j,Q=U=>U){let U=a((...z)=>V.fire(Q(...z)),"fn"),Y=a(()=>O.on(j,U),"onFirstListenerAdd"),W=a(()=>O.removeListener(j,U),"onLastListenerRemove"),V=new JS({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(O,j,Q=U=>U){let U=a((...z)=>V.fire(Q(...z)),"fn"),Y=a(()=>O.addEventListener(j,U),"onFirstListenerAdd"),W=a(()=>O.removeEventListener(j,U),"onLastListenerRemove"),V=new JS({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(O,j){return new Promise(Q=>n(O)(Q,null,j))}M.toPromise=x,a(x,"toPromise");function P(O){let j=new JS;return O.then(Q=>{j.fire(Q)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}M.fromPromise=P,a(P,"fromPromise");function D(O,j){return O(Q=>j.fire(Q))}M.forward=D,a(D,"forward");function N(O,j,Q){return j(Q),O(U=>j(U))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class L{constructor(j,Q){this._observable=j;this._counter=0;this._hasChanged=!1;let U={onWillAddFirstListener:a(()=>{j.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{j.removeObserver(this)},"onDidRemoveLastListener")};Q||e(U),this.emitter=new JS(U),Q&&Q.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,Q){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(O,j){return new L(O,j).emitter.event}M.fromObservable=B,a(B,"fromObservable");function q(O){return(j,Q,U)=>{let Y=0,W=!1,V={beginUpdate(){Y++},endUpdate(){Y--,Y===0&&(O.reportChanges(),W&&(W=!1,j.call(Q)))},handlePossibleChange(){},handleChange(){W=!0}};O.addObserver(V),O.reportChanges();let z={dispose(){O.removeObserver(V)}};return U instanceof tq?U.add(z):Array.isArray(U)&&U.push(z),z}}M.fromObservableLight=q,a(q,"fromObservableLight")})(Sxe||={});var mQt=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 dKe,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}}},S_n=-1;var gQt=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 aue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new mQt(e?.onListenerError??Hle,this._options?.leakWarningThreshold??b_n):void 0,this._perfMon=this._options?._profName?new hQt(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(C_n){let e=this._listeners;queueMicrotask(()=>{GQo(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 AQt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||Hle)(f),G_.None}if(this._disposed)return G_.None;r&&(e=e.bind(r));let o=new aue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=bxe.create(),s=this._leakageMon.check(o.stack,this._size+1)),C_n&&(o.stack=c??bxe.create()),this._listeners?this._listeners instanceof aue?(this._deliveryQueue??=new yQt,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=eYe(()=>{s?.(),this._removeListener(o)});return n instanceof eq?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*HQo<=r.length){let s=0;for(let c=0;c0}};var yQt=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 S_n=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),$Qo;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof EQt?!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:Sxe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:S_n})})($Qo||={});var EQt=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?S_n:(this._emitter||(this._emitter=new YS),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function WQo(t){return t}a(WQo,"identity");var lKe=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=WQo):(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 Aq=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 _Qt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(_Qt,"escapeRegExpCharacters");function R_n(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(R_n,"ltrim");function uKe(t){return t.split(/\r\n|\r|\n/)}a(uKe,"splitLines");function vQt(t,e){return te?1:0}a(vQt,"compare");function dKe(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(dKe,"compareSubstring");function CQt(t,e){return Ixe(t,e,0,t.length,0,e.length)}a(CQt,"compareIgnoreCase");function Ixe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return dKe(t.toLowerCase(),e.toLowerCase(),r,n,o,s);T_n(u)&&(u-=32),T_n(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(Ixe,"compareSubstringIgnoreCase");function T_n(t){return t>=97&&t<=122}a(T_n,"isLowerAsciiLetter");function k_n(t,e){let r=e.length;return e.length>t.length?!1:Ixe(t,e,0,r)===0}a(k_n,"startsWithIgnoreCase");function cue(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(zQo,"startsWithUTF8BOM");function P_n(t){return zQo(t)?t.substr(1):t}a(P_n,"stripUTF8BOM");var I_n=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=YQo()}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 YQo(){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(YQo,"getGraphemeBreakRawData");var x_n=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new Aq(()=>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 lKe({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 Aq(()=>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;rD_n)return{status:"notfound",message:"File too large"};let c=await Ble(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:NS.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=to(e);if(la.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(la),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof bl))throw c}let o=(await this.ctx.get(Qo).stat(e)).size/1024/1024;return o>D_n?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(SO).getEncodingForFile(e)}catch(o){if(!(o instanceof bl))throw o}let n=await this.ctx.get(Qo).readFileString(e,r);return P_n(n)}};p();function wxe(t){for(var e=[],r=1;r{if(t instanceof aue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new gQt(e?.onListenerError??Hle,this._options?.leakWarningThreshold??S_n):void 0,this._perfMon=this._options?._profName?new mQt(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(b_n){let e=this._listeners;queueMicrotask(()=>{zQo(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 yQt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||Hle)(f),$_.None}if(this._disposed)return $_.None;r&&(e=e.bind(r));let o=new aue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=bxe.create(),s=this._leakageMon.check(o.stack,this._size+1)),b_n&&(o.stack=c??bxe.create()),this._listeners?this._listeners instanceof aue?(this._deliveryQueue??=new EQt,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=rYe(()=>{s?.(),this._removeListener(o)});return n instanceof tq?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*WQo<=r.length){let s=0;for(let c=0;c0}};var EQt=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 T_n=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),YQo;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof _Qt?!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:Sxe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:T_n})})(YQo||={});var _Qt=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?T_n:(this._emitter||(this._emitter=new JS),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function JQo(t){return t}a(JQo,"identity");var fKe=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=JQo):(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 yq=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 vQt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(vQt,"escapeRegExpCharacters");function k_n(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(k_n,"ltrim");function pKe(t){return t.split(/\r\n|\r|\n/)}a(pKe,"splitLines");function CQt(t,e){return te?1:0}a(CQt,"compare");function hKe(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(hKe,"compareSubstring");function bQt(t,e){return Ixe(t,e,0,t.length,0,e.length)}a(bQt,"compareIgnoreCase");function Ixe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return hKe(t.toLowerCase(),e.toLowerCase(),r,n,o,s);I_n(u)&&(u-=32),I_n(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(Ixe,"compareSubstringIgnoreCase");function I_n(t){return t>=97&&t<=122}a(I_n,"isLowerAsciiLetter");function P_n(t,e){let r=e.length;return e.length>t.length?!1:Ixe(t,e,0,r)===0}a(P_n,"startsWithIgnoreCase");function cue(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(ZQo,"startsWithUTF8BOM");function D_n(t){return ZQo(t)?t.substr(1):t}a(D_n,"stripUTF8BOM");var x_n=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=XQo()}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 XQo(){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(XQo,"getGraphemeBreakRawData");var w_n=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new yq(()=>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 fKe({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 yq(()=>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;rN_n)return{status:"notfound",message:"File too large"};let c=await Ble(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:MS.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=to(e);if(la.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(la),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof bl))throw c}let o=(await this.ctx.get(qo).stat(e)).size/1024/1024;return o>N_n?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(SO).getEncodingForFile(e)}catch(o){if(!(o instanceof bl))throw o}let n=await this.ctx.get(qo).readFileString(e,r);return D_n(n)}};p();function wxe(t){for(var e=[],r=1;rr.status!=="in-progress"&&(r.response===void 0||r.response?.type==="model")),e}a(N_n,"filterConversationTurns");function SQt(t){return N_n(t).getLastTurn()?.id}a(SQt,"getLastTurnId");async function M_n(t){let e=N_n(t.conversation),r=SQt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(Ag).getDump(r),s=ZQo(o,e.turns);Nr.debug(t.ctx,`conversation.dump +`)),c+=h+n[u+1]}),c}a(wxe,"dedent");var is=wxe;var SQt=class{constructor(){this.resolvedSkills={};this.resolutions=[]}static{a(this,"SkillDump")}},Ag=class{constructor(){this.dump=new Cn(25);this.promptsDump=new Cn(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 SQt,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 M_n(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(M_n,"filterConversationTurns");function TQt(t){return M_n(t).getLastTurn()?.id}a(TQt,"getLastTurnId");async function O_n(t){let e=M_n(t.conversation),r=TQt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(Ag).getDump(r),s=rqo(o,e.turns);Nr.debug(t.ctx,`conversation.dump `,` -`+s);let c=await XQo(o,t.ctx);return is` - ${JQo(t.conversation,r)} - ${KQo(t.ctx)} +`+s);let c=await nqo(o,t.ctx);return is` + ${tqo(t.conversation,r)} + ${eqo(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(M_n,"getConversationDump");function KQo(t){let e=t.get(Ir);return is` + `}a(O_n,"getConversationDump");function eqo(t){let e=t.get(Ir);return is` - IDE: \`${e.getEditorInfo().name} (${e.getEditorInfo().version})\` - Plugin: \`${e.getEditorPluginInfo().version}\` - `}a(KQo,"getEditorInfoDumpMessage");function JQo(t,e){return is` + `}a(eqo,"getEditorInfoDumpMessage");function tqo(t,e){return is` Debug information for the last turn of the conversation. - ConversationId: \`${t.id}\` - MessageId: \`${e}\` - `}a(JQo,"getInfoDumpMessage");async function O_n(t,e,r){let n=t.ctx.get(Yh),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(zo).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(tqo,"getInfoDumpMessage");async function L_n(t,e,r){let n=t.ctx.get(Yh),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(Yo).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&&Pn(t.turn.request.message).trim().length>0&&(o+=` **User message**: ${Pn(t.turn.request.message)}`);for(let c of s){o+=` @@ -2629,17 +2629,17 @@ ${c}`:""} **Unprocessable**`}else o+=` -**Unresolvable**`}return o}a(O_n,"getSkillsDump");function ZQo(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:Pn(n.request.message)};return n.response&&(s.response=Pn(n.response.message)),s})};return fK(r)}a(ZQo,"toSimulationFormat");async function XQo(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: +**Unresolvable**`}return o}a(L_n,"getSkillsDump");function rqo(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:Pn(n.request.message)};return n.response&&(s.response=Pn(n.response.message)),s})};return fK(r)}a(rqo,"toSimulationFormat");async function nqo(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(ii).getOrReadTextDocument(s),l;c.status==="valid"&&(l=c.document);let u=l?.getText();Nr.debug(e,`conversation.dump.file `,u),o+=` **${s.uri}** \`\`\`${l?.detectedLanguageId} ${u} -\`\`\``}return o}a(XQo,"fileDump");p();function TQt(t,e){let r=ws(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(Pn(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(TQt,"countMessagesTokens");p();function L_n(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(nqo,"fileDump");p();function IQt(t,e){let r=ws(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(Pn(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(IQt,"countMessagesTokens");p();function B_n(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(L_n,"chatBasePrompt");p();p();async function yq(t){return!!(await t.get(Qt).getToken()).userInfo?.isTBBEnabled}a(yq,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function pKe(t){return!!t&&typeof t.then=="function"}a(pKe,"isThenable");var fKe=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 Lc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Lc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var eqo;(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")})(eqo||={});var B_n=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 YS,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 hKe=!1,mKe=!1,Rxe=!1,tqo=!1,rqo=!1,F_n=!1,nqo=!1,iqo=!1,oqo=!1,sqo=!1;var j3,H3=globalThis,Xx;typeof H3.vscode<"u"&&typeof H3.vscode.process<"u"?Xx=H3.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Xx=process);var U_n=typeof Xx?.versions?.electron=="string",aqo=U_n&&Xx?.type==="renderer";typeof Xx=="object"?(hKe=Xx.platform==="win32",mKe=Xx.platform==="darwin",Rxe=Xx.platform==="linux",tqo=Rxe&&!!Xx.env.SNAP&&!!Xx.env.SNAP_REVISION,nqo=U_n,oqo=!!Xx.env.CI||!!Xx.env.BUILD_ARTIFACTSTAGINGDIRECTORY,rqo=!0):typeof navigator=="object"&&!aqo?(j3=navigator.userAgent,hKe=j3.indexOf("Windows")>=0,mKe=j3.indexOf("Macintosh")>=0,iqo=(j3.indexOf("Macintosh")>=0||j3.indexOf("iPad")>=0||j3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Rxe=j3.indexOf("Linux")>=0,sqo=j3?.indexOf("Mobi")>=0,F_n=!0):console.error("Unable to resolve platform.");var IQt=0;mKe?IQt=1:hKe?IQt=3:Rxe&&(IQt=2);var xQt=hKe,Q_n=mKe,q_n=Rxe;var cqo=F_n&&typeof H3.importScripts=="function",YXu=cqo?H3.origin:void 0;var TO=j3;var lqo=typeof H3.postMessage=="function"&&!H3.importScripts,KXu=(()=>{if(lqo){let t=[];H3.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}),H3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var uqo=!!(TO&&TO.indexOf("Chrome")>=0),JXu=!!(TO&&TO.indexOf("Firefox")>=0),ZXu=!!(!uqo&&TO&&TO.indexOf("Safari")>=0),XXu=!!(TO&&TO.indexOf("Edg/")>=0),eed=!!(TO&&TO.indexOf("Android")>=0);var BK,wQt=globalThis.vscode;if(typeof wQt<"u"&&typeof wQt.process<"u"){let t=wQt.process;BK={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"?BK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:BK={get platform(){return xQt?"win32":Q_n?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var kxe=BK.cwd,j_n=BK.env,H_n=BK.platform,sed=BK.arch;var fqo=65,pqo=97,hqo=90,mqo=122,vq=46,yg=47,QC=92,Eq=58,gqo=63,gKe=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 Aqo(t,e){if(t===null||typeof t!="object")throw new gKe(e,"Object",t)}a(Aqo,"validateObject");function op(t,e){if(typeof t!="string")throw new gKe(e,"string",t)}a(op,"validateString");var qC=H_n==="win32";function os(t){return t===yg||t===QC}a(os,"isPathSeparator");function RQt(t){return t===yg}a(RQt,"isPosixPathSeparator");function _q(t){return t>=fqo&&t<=hqo||t>=pqo&&t<=mqo}a(_q,"isWindowsDeviceRoot");function AKe(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===vq&&l!==-1?++l:l=-1}return o}a(AKe,"normalizeString");function yqo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(yqo,"formatExt");function G_n(t,e){Aqo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${yqo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(G_n,"_format");var Kh={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],op(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=kxe():(s=j_n[`=${e}`]||kxe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===QC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)os(f)&&(l=1,d=!0);else if(os(f))if(d=!0,os(s.charCodeAt(1))){let h=2,m=h;for(;h2&&os(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=AKe(r,!n,"\\",os),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){op(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return RQt(s)?"\\":t;if(os(s))if(o=!0,os(t.charCodeAt(1))){let l=2,u=l;for(;l2&&os(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&os(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){op(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return os(r)||e>2&&_q(r)&&t.charCodeAt(1)===Eq&&os(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"&&os(r.charCodeAt(0))){++o;let s=r.length;s>1&&os(r.charCodeAt(1))&&(++o,s>2&&(os(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Kh.normalize(e)},relative(t,e){if(op(t,"from"),op(e,"to"),t===e)return"";let r=Kh.resolve(t),n=Kh.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===QC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===QC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===QC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===QC?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)===QC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===QC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Kh.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===QC){if(e.charCodeAt(1)===QC){let r=e.charCodeAt(2);if(r!==gqo&&r!==vq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(_q(e.charCodeAt(0))&&e.charCodeAt(1)===Eq&&e.charCodeAt(2)===QC)return`\\\\?\\${e}`;return t},dirname(t){op(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return os(o)?t:".";if(os(o)){if(r=n=1,os(t.charCodeAt(1))){let l=2,u=l;for(;l2&&os(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(os(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&&op(e,"suffix"),op(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&_q(t.charCodeAt(0))&&t.charCodeAt(1)===Eq&&(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(os(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(os(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){op(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===Eq&&_q(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(os(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===vq?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:G_n.bind(null,"\\"),parse(t){op(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 os(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(os(o)){if(n=1,os(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),os(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===vq?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},Eqo=(()=>{if(qC){let t=/\\/g;return()=>{let e=kxe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>kxe()})(),Cf={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:Eqo();op(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===yg)}return e=AKe(e,!r,"/",RQt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(op(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===yg,r=t.charCodeAt(t.length-1)===yg;return t=AKe(t,!e,"/",RQt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return op(t,"path"),t.length>0&&t.charCodeAt(0)===yg},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?".":Cf.normalize(e)},relative(t,e){if(op(t,"from"),op(e,"to"),t===e||(t=Cf.resolve(t),e=Cf.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)===yg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===yg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===yg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(op(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===yg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===yg){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&&op(e,"ext"),op(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===yg){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)===yg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){op(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===yg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===vq?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:G_n.bind(null,"/"),parse(t){op(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===yg,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===yg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===vq?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};Cf.win32=Kh.win32=Kh;Cf.posix=Kh.posix=Cf;var _qo=qC?Kh.normalize:Cf.normalize,vqo=qC?Kh.isAbsolute:Cf.isAbsolute,yKe=qC?Kh.join:Cf.join,ced=qC?Kh.resolve:Cf.resolve,led=qC?Kh.relative:Cf.relative,ued=qC?Kh.dirname:Cf.dirname,$_n=qC?Kh.basename:Cf.basename,V_n=qC?Kh.extname:Cf.extname,ded=qC?Kh.format:Cf.format,fed=qC?Kh.parse:Cf.parse,ped=qC?Kh.toNamespacedPath:Cf.toNamespacedPath,FK=qC?Kh.sep:Cf.sep,hed=qC?Kh.delimiter:Cf.delimiter;p();p();function UK(t,e="unexpected state"){if(!t)throw new Lc(`Assertion Failed: ${e}`)}a(UK,"assert");function kQt(t){if(!t()){debugger;t(),Hle(new Lc("Assertion Failed"))}}a(kQt,"assertFn");function Pxe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!k_n(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(W_n,"isEqualOrParent");var EKe="**",z_n="/",_Ke="[/\\\\]",vKe="[^/\\\\]",bqo=/\//g;function Y_n(t,e){switch(t){case 0:return"";case 1:return`${vKe}*?`;default:return`(?:${_Ke}|${vKe}+${_Ke}${e?`|${_Ke}${vKe}+`:""})*?`}}a(Y_n,"starsToRegExp");function Dxe(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(Dxe,"splitGlobAware");function X_n(t){if(!t)return"";let e="",r=Dxe(t,z_n);if(r.every(n=>n===EKe))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===EKe){if(n)return;e+=Y_n(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===z_n?h="":h=_Qt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${Dxe(l,",").map(g=>X_n(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=vKe;continue;case"*":e+=Y_n(1);continue;default:e+=_Qt(f)}}sNQt(l,e)).filter(l=>l!==HP),t),n=r.length;if(!n)return HP;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(Dqo,"trivia3");function Z_n(t,e,r){let n=FK===Cf.sep,o=n?t:t.replace(bqo,FK),s=FK+o,c=Cf.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(Z_n,"trivia4and5");function Nqo(t){try{let e=new RegExp(`^${X_n(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return HP}}a(Nqo,"toRegExp");function tvn(t,e,r){return!t||typeof e!="string"?!1:MQt(t)(e,void 0,r)}a(tvn,"match");function MQt(t,e={}){if(!t)return DQt;if(typeof t=="string"||Mqo(t)){let r=NQt(t,e);if(r===HP)return DQt;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 Oqo(t,e)}a(MQt,"parse");function Mqo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(Mqo,"isRelativePattern");function Oqo(t,e){let r=rvn(Object.getOwnPropertyNames(t).map(l=>Lqo(l,t[l],e)).filter(l=>l!==HP)),n=r.length;if(!n)return HP;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(Oqo,"parsedExpression");function Lqo(t,e,r){if(e===!1)return HP;let n=NQt(t,r);if(n===HP)return HP;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 pKe(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Lqo,"parseExpressionPattern");function rvn(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(rvn,"aggregateBasenameMatches");function nvn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return Bqo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(nvn,"validate");function ivn(t,e){let r=Dxe(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(tvn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(ivn,"matches");function Bqo(t){try{let e=Dxe(t,",");if(e.length===0)return!1;for(let r of e){let n=MQt(r);if(evn(n))return!1}return!0}catch{return!1}}a(Bqo,"isValidGlob");var svn=de(require("path"));var Jh={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var LQt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??Ji(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 x3(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||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}},avn={name:"copilot-instructions",source:Jh.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},cvn={name:"git-commit-instructions",source:Jh.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},lvn={name:"agents-md-instructions",source:Jh.agentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["AGENTS.md"]},Fqo={name:"nested-agents-md-instructions",source:Jh.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},uvn={name:"claude-md-instructions",source:Jh.claudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},Uqo={name:"nested-claude-md-instructions",source:Jh.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},Qqo=[avn,cvn,lvn,Fqo,uvn,Uqo],qqo={name:"instruction-file",source:Jh.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},OQt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},jqo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function ovn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(ovn,"optionKey");function BQt(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=ovn(n);if(!(o in OQt)||(r=!0,!(e[o]??OQt[o])))continue;let c=jqo[n];if(c){let l=ovn(c);if(!(e[l]??OQt[l]))continue}return!0}return r?!1:void 0}a(BQt,"shouldIncludeSource");var FQt=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)BQt([n],e)!==!1&&r.push(...o);return r}},Hqo=new dO;function Gqo(t,e,r,n,o){if(!t)return;let s=`${WQ}${e}`,c=Hqo.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:x3(o?[{providers:o}]:void 0)}}a(Gqo,"resolveContent");var QK=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?Gqo(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(svn.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 $qo(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($qo,"stripSource");var Vqo="workspace",bf=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new FQt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[Jh.copilotInstructions,new QK(avn,this.inMemoryManager,n)],[Jh.gitCommitInstructions,new QK(cvn,this.inMemoryManager,n)],[Jh.agentsMdInstructions,new QK(lvn,this.inMemoryManager,n)],[Jh.claudeMdInstructions,new QK(uvn,this.inMemoryManager,n)],[Jh.customInstructionFiles,new QK(qqo,this.inMemoryManager,n)]]);for(let o of Qqo)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(Jh.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e,r){return(await this.ctx.get(ug).collect(this.ctx,"instructions",e,{includePlugins:r?.includePlugins})).map(o=>new LQt(o))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=Vqo){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=Jh.customInstructionFiles;else if(this.slotsBySource.has(s.source))c=s.source;else{Nr.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push($qo(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:Jh.customInstructionFiles}));this.dispatchToSlots(r,"global-instruction-files")}getGlobalInstructionFiles(){return this.inMemoryManager.get(Jh.customInstructionFiles)}setGlobalCopilotInstructions(e){let r=e?[{...e,source:Jh.copilotInstructions}]:[];this.dispatchToSlots(r,"global-copilot-instructions")}setGlobalGitCommitInstructions(e){let r=e?[{...e,source:Jh.gitCommitInstructions}]:[];this.dispatchToSlots(r,"global-git-commit-instructions")}setGlobalAgentsMdInstructions(e){let r=e?[{...e,source:Jh.agentsMdInstructions}]:[];this.dispatchToSlots(r,"global-agents-md-instructions")}setGlobalClaudeMdInstructions(e){let r=e?[{...e,source:Jh.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(B_n,"chatBasePrompt");p();p();async function Eq(t){return!!(await t.get(Qt).getToken()).userInfo?.isTBBEnabled}a(Eq,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function gKe(t){return!!t&&typeof t.then=="function"}a(gKe,"isThenable");var mKe=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 Lc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Lc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var iqo;(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")})(iqo||={});var F_n=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 JS,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 AKe=!1,yKe=!1,Rxe=!1,oqo=!1,sqo=!1,U_n=!1,aqo=!1,cqo=!1,lqo=!1,uqo=!1;var H3,G3=globalThis,ew;typeof G3.vscode<"u"&&typeof G3.vscode.process<"u"?ew=G3.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ew=process);var Q_n=typeof ew?.versions?.electron=="string",dqo=Q_n&&ew?.type==="renderer";typeof ew=="object"?(AKe=ew.platform==="win32",yKe=ew.platform==="darwin",Rxe=ew.platform==="linux",oqo=Rxe&&!!ew.env.SNAP&&!!ew.env.SNAP_REVISION,aqo=Q_n,lqo=!!ew.env.CI||!!ew.env.BUILD_ARTIFACTSTAGINGDIRECTORY,sqo=!0):typeof navigator=="object"&&!dqo?(H3=navigator.userAgent,AKe=H3.indexOf("Windows")>=0,yKe=H3.indexOf("Macintosh")>=0,cqo=(H3.indexOf("Macintosh")>=0||H3.indexOf("iPad")>=0||H3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Rxe=H3.indexOf("Linux")>=0,uqo=H3?.indexOf("Mobi")>=0,U_n=!0):console.error("Unable to resolve platform.");var xQt=0;yKe?xQt=1:AKe?xQt=3:Rxe&&(xQt=2);var wQt=AKe,q_n=yKe,j_n=Rxe;var fqo=U_n&&typeof G3.importScripts=="function",red=fqo?G3.origin:void 0;var TO=H3;var pqo=typeof G3.postMessage=="function"&&!G3.importScripts,ned=(()=>{if(pqo){let t=[];G3.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}),G3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var hqo=!!(TO&&TO.indexOf("Chrome")>=0),ied=!!(TO&&TO.indexOf("Firefox")>=0),oed=!!(!hqo&&TO&&TO.indexOf("Safari")>=0),sed=!!(TO&&TO.indexOf("Edg/")>=0),aed=!!(TO&&TO.indexOf("Android")>=0);var BK,RQt=globalThis.vscode;if(typeof RQt<"u"&&typeof RQt.process<"u"){let t=RQt.process;BK={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"?BK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:BK={get platform(){return wQt?"win32":q_n?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var kxe=BK.cwd,H_n=BK.env,G_n=BK.platform,ped=BK.arch;var gqo=65,Aqo=97,yqo=90,Eqo=122,Cq=46,yg=47,QC=92,_q=58,_qo=63,EKe=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 vqo(t,e){if(t===null||typeof t!="object")throw new EKe(e,"Object",t)}a(vqo,"validateObject");function op(t,e){if(typeof t!="string")throw new EKe(e,"string",t)}a(op,"validateString");var qC=G_n==="win32";function os(t){return t===yg||t===QC}a(os,"isPathSeparator");function kQt(t){return t===yg}a(kQt,"isPosixPathSeparator");function vq(t){return t>=gqo&&t<=yqo||t>=Aqo&&t<=Eqo}a(vq,"isWindowsDeviceRoot");function _Ke(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===Cq&&l!==-1?++l:l=-1}return o}a(_Ke,"normalizeString");function Cqo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(Cqo,"formatExt");function $_n(t,e){vqo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${Cqo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a($_n,"_format");var Kh={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],op(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=kxe():(s=H_n[`=${e}`]||kxe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===QC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)os(f)&&(l=1,d=!0);else if(os(f))if(d=!0,os(s.charCodeAt(1))){let h=2,m=h;for(;h2&&os(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=_Ke(r,!n,"\\",os),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){op(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return kQt(s)?"\\":t;if(os(s))if(o=!0,os(t.charCodeAt(1))){let l=2,u=l;for(;l2&&os(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&os(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){op(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return os(r)||e>2&&vq(r)&&t.charCodeAt(1)===_q&&os(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"&&os(r.charCodeAt(0))){++o;let s=r.length;s>1&&os(r.charCodeAt(1))&&(++o,s>2&&(os(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Kh.normalize(e)},relative(t,e){if(op(t,"from"),op(e,"to"),t===e)return"";let r=Kh.resolve(t),n=Kh.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===QC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===QC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===QC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===QC?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)===QC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===QC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Kh.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===QC){if(e.charCodeAt(1)===QC){let r=e.charCodeAt(2);if(r!==_qo&&r!==Cq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(vq(e.charCodeAt(0))&&e.charCodeAt(1)===_q&&e.charCodeAt(2)===QC)return`\\\\?\\${e}`;return t},dirname(t){op(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return os(o)?t:".";if(os(o)){if(r=n=1,os(t.charCodeAt(1))){let l=2,u=l;for(;l2&&os(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(os(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&&op(e,"suffix"),op(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&vq(t.charCodeAt(0))&&t.charCodeAt(1)===_q&&(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(os(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(os(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){op(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===_q&&vq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(os(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===Cq?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:$_n.bind(null,"\\"),parse(t){op(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 os(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(os(o)){if(n=1,os(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),os(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===Cq?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},bqo=(()=>{if(qC){let t=/\\/g;return()=>{let e=kxe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>kxe()})(),Cf={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:bqo();op(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===yg)}return e=_Ke(e,!r,"/",kQt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(op(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===yg,r=t.charCodeAt(t.length-1)===yg;return t=_Ke(t,!e,"/",kQt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return op(t,"path"),t.length>0&&t.charCodeAt(0)===yg},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?".":Cf.normalize(e)},relative(t,e){if(op(t,"from"),op(e,"to"),t===e||(t=Cf.resolve(t),e=Cf.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)===yg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===yg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===yg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(op(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===yg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===yg){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&&op(e,"ext"),op(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===yg){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)===yg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){op(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===yg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===Cq?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:$_n.bind(null,"/"),parse(t){op(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===yg,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===yg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===Cq?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};Cf.win32=Kh.win32=Kh;Cf.posix=Kh.posix=Cf;var Sqo=qC?Kh.normalize:Cf.normalize,Tqo=qC?Kh.isAbsolute:Cf.isAbsolute,vKe=qC?Kh.join:Cf.join,med=qC?Kh.resolve:Cf.resolve,ged=qC?Kh.relative:Cf.relative,Aed=qC?Kh.dirname:Cf.dirname,V_n=qC?Kh.basename:Cf.basename,W_n=qC?Kh.extname:Cf.extname,yed=qC?Kh.format:Cf.format,Eed=qC?Kh.parse:Cf.parse,_ed=qC?Kh.toNamespacedPath:Cf.toNamespacedPath,FK=qC?Kh.sep:Cf.sep,ved=qC?Kh.delimiter:Cf.delimiter;p();p();function UK(t,e="unexpected state"){if(!t)throw new Lc(`Assertion Failed: ${e}`)}a(UK,"assert");function PQt(t){if(!t()){debugger;t(),Hle(new Lc("Assertion Failed"))}}a(PQt,"assertFn");function Pxe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!P_n(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(z_n,"isEqualOrParent");var CKe="**",Y_n="/",bKe="[/\\\\]",SKe="[^/\\\\]",xqo=/\//g;function K_n(t,e){switch(t){case 0:return"";case 1:return`${SKe}*?`;default:return`(?:${bKe}|${SKe}+${bKe}${e?`|${bKe}${SKe}+`:""})*?`}}a(K_n,"starsToRegExp");function Dxe(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(Dxe,"splitGlobAware");function evn(t){if(!t)return"";let e="",r=Dxe(t,Y_n);if(r.every(n=>n===CKe))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===CKe){if(n)return;e+=K_n(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===Y_n?h="":h=vQt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${Dxe(l,",").map(g=>evn(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=SKe;continue;case"*":e+=K_n(1);continue;default:e+=vQt(f)}}sMQt(l,e)).filter(l=>l!==GP),t),n=r.length;if(!n)return GP;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(Lqo,"trivia3");function X_n(t,e,r){let n=FK===Cf.sep,o=n?t:t.replace(xqo,FK),s=FK+o,c=Cf.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(X_n,"trivia4and5");function Bqo(t){try{let e=new RegExp(`^${evn(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return GP}}a(Bqo,"toRegExp");function rvn(t,e,r){return!t||typeof e!="string"?!1:OQt(t)(e,void 0,r)}a(rvn,"match");function OQt(t,e={}){if(!t)return NQt;if(typeof t=="string"||Fqo(t)){let r=MQt(t,e);if(r===GP)return NQt;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 Uqo(t,e)}a(OQt,"parse");function Fqo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(Fqo,"isRelativePattern");function Uqo(t,e){let r=nvn(Object.getOwnPropertyNames(t).map(l=>Qqo(l,t[l],e)).filter(l=>l!==GP)),n=r.length;if(!n)return GP;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(Uqo,"parsedExpression");function Qqo(t,e,r){if(e===!1)return GP;let n=MQt(t,r);if(n===GP)return GP;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 gKe(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Qqo,"parseExpressionPattern");function nvn(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(nvn,"aggregateBasenameMatches");function ivn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return qqo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(ivn,"validate");function ovn(t,e){let r=Dxe(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(rvn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(ovn,"matches");function qqo(t){try{let e=Dxe(t,",");if(e.length===0)return!1;for(let r of e){let n=OQt(r);if(tvn(n))return!1}return!0}catch{return!1}}a(qqo,"isValidGlob");var avn=de(require("path"));var Jh={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var BQt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??Ji(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 w3(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||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return YQ(this.promptFileEntry.promptPath)}},cvn={name:"copilot-instructions",source:Jh.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},lvn={name:"git-commit-instructions",source:Jh.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},uvn={name:"agents-md-instructions",source:Jh.agentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["AGENTS.md"]},jqo={name:"nested-agents-md-instructions",source:Jh.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},dvn={name:"claude-md-instructions",source:Jh.claudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},Hqo={name:"nested-claude-md-instructions",source:Jh.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},Gqo=[cvn,lvn,uvn,jqo,dvn,Hqo],$qo={name:"instruction-file",source:Jh.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},LQt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},Vqo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function svn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(svn,"optionKey");function FQt(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=svn(n);if(!(o in LQt)||(r=!0,!(e[o]??LQt[o])))continue;let c=Vqo[n];if(c){let l=svn(c);if(!(e[l]??LQt[l]))continue}return!0}return r?!1:void 0}a(FQt,"shouldIncludeSource");var UQt=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)FQt([n],e)!==!1&&r.push(...o);return r}},Wqo=new dO;function zqo(t,e,r,n,o){if(!t)return;let s=`${zQ}${e}`,c=Wqo.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:w3(o?[{providers:o}]:void 0)}}a(zqo,"resolveContent");var QK=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?zqo(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(avn.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 Yqo(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(Yqo,"stripSource");var Kqo="workspace",bf=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new UQt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[Jh.copilotInstructions,new QK(cvn,this.inMemoryManager,n)],[Jh.gitCommitInstructions,new QK(lvn,this.inMemoryManager,n)],[Jh.agentsMdInstructions,new QK(uvn,this.inMemoryManager,n)],[Jh.claudeMdInstructions,new QK(dvn,this.inMemoryManager,n)],[Jh.customInstructionFiles,new QK($qo,this.inMemoryManager,n)]]);for(let o of Gqo)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(Jh.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e,r){return(await this.ctx.get(ug).collect(this.ctx,"instructions",e,{includePlugins:r?.includePlugins})).map(o=>new BQt(o))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=Kqo){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=Jh.customInstructionFiles;else if(this.slotsBySource.has(s.source))c=s.source;else{Nr.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push(Yqo(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:Jh.customInstructionFiles}));this.dispatchToSlots(r,"global-instruction-files")}getGlobalInstructionFiles(){return this.inMemoryManager.get(Jh.customInstructionFiles)}setGlobalCopilotInstructions(e){let r=e?[{...e,source:Jh.copilotInstructions}]:[];this.dispatchToSlots(r,"global-copilot-instructions")}setGlobalGitCommitInstructions(e){let r=e?[{...e,source:Jh.gitCommitInstructions}]:[];this.dispatchToSlots(r,"global-git-commit-instructions")}setGlobalAgentsMdInstructions(e){let r=e?[{...e,source:Jh.agentsMdInstructions}]:[];this.dispatchToSlots(r,"global-agents-md-instructions")}setGlobalClaudeMdInstructions(e){let r=e?[{...e,source:Jh.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."} @@ -2647,21 +2647,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=nvn(n);return o.isValid&&!!ivn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=BQt(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&&BQt(o.source,r)!==void 0).length;At(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function Cq(t,e){if(t.length==0)return new Ar([]);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 Ar(r)}a(Cq,"weighElidableList");p();function dvn(t){let e=t.split(` -`),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([PS(o.join(` -`)),1]),o=[],r.push([new Ar([s]),1])):r.push([new Ar([s]),1]),n=!n):n?o.push(s):r.push([new Ar([s]),.8]);return n&&(r.push([PS(o.join(` -`)),1]),r.push([new Ar(["```"]),1])),new Ar(r)}a(dvn,"fromMessage");function lue(t){let e=QQt(t),r=[];for(let n=0;n`}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=ivn(n);return o.isValid&&!!ovn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=FQt(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&&FQt(o.source,r)!==void 0).length;At(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function bq(t,e){if(t.length==0)return new Ar([]);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 Ar(r)}a(bq,"weighElidableList");p();function fvn(t){let e=t.split(` +`),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([DS(o.join(` +`)),1]),o=[],r.push([new Ar([s]),1])):r.push([new Ar([s]),1]),n=!n):n?o.push(s):r.push([new Ar([s]),.8]);return n&&(r.push([DS(o.join(` +`)),1]),r.push([new Ar(["```"]),1])),new Ar(r)}a(fvn,"fromMessage");function lue(t){let e=qQt(t),r=[];for(let n=0;n1&&n!==e.length-1?` -`:"")),r.push(dvn(l))}return r.length>0?new Ar([[new Ar(["Consider the following conversation history:"]),1],[Cq(r,"inverseLinear"),1]]):null}a(lue,"fromHistory");var Wqo=5;function QQt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&Pn(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,Wqo).reverse()}a(QQt,"filterTurns");function fvn(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=Pn(t.message).startsWith("```")?` -`:" ";return`${e>0?`${e}) `:""}${r}:${n}${Pn(t.message)}`}a(fvn,"formatTurnMessage");p();p();p();var zqo=4,qQt={skillIds:[]},CKe=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 xo.getModelConfiguration(e.ctx,"meta",{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(kA).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(zh).inspectFetchResult(m),this.handleResult(m,f,Pn(c),s,d.toolConfig)}else return qQt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),qQt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,zqo);else return ot.error(this.ctx,"Missing tool call in meta prompt response"),qQt;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return Et(this.ctx,`${aE(o)}.metaPrompt`,u,0),Et(this.ctx,`${aE(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});Et(this.ctx,"conversation.promptContextError",n,1)}};p();p();var IO=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 Ar([is(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!uue(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:PS(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||uue(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 Ar([["```"+this.doc.detectedLanguageId,1],[e,r??1],["```",1]])}addLineNumbers(e){let r=this.doc.getText(e).split(` +`:"")),r.push(fvn(l))}return r.length>0?new Ar([[new Ar(["Consider the following conversation history:"]),1],[bq(r,"inverseLinear"),1]]):null}a(lue,"fromHistory");var Jqo=5;function qQt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&Pn(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,Jqo).reverse()}a(qQt,"filterTurns");function pvn(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=Pn(t.message).startsWith("```")?` +`:" ";return`${e>0?`${e}) `:""}${r}:${n}${Pn(t.message)}`}a(pvn,"formatTurnMessage");p();p();p();var Zqo=4,jQt={skillIds:[]},TKe=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 wo.getModelConfiguration(e.ctx,"meta",{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(kA).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(zh).inspectFetchResult(m),this.handleResult(m,f,Pn(c),s,d.toolConfig)}else return jQt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),jQt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,Zqo);else return ot.error(this.ctx,"Missing tool call in meta prompt response"),jQt;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return Et(this.ctx,`${aE(o)}.metaPrompt`,u,0),Et(this.ctx,`${aE(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});Et(this.ctx,"conversation.promptContextError",n,1)}};p();p();var IO=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 Ar([is(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!uue(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:DS(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||uue(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 Ar([["```"+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 uue(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(uue,"isEmptyRange");p();p();var pvn=de(ri()),hvn=S.Object({accessToken:S.Optional(S.String({minLength:1})),handle:S.Optional(S.String({minLength:1})),login:S.Optional(S.String({minLength:1})),githubAppId:S.Optional(S.String({minLength:1})),apiUrl:S.Optional(S.String({})),serverUrl:S.Optional(S.String({})),tokenEndpoint:S.Optional(S.String({}))}),jQt;(r=>(r.method="github/didChangeAuth",r.type=new pvn.ProtocolNotificationType(r.method)))(jQt||={});p();var mvn=de(ri()),HQt;(r=>(r.method="copilot/ipCodeCitation",r.type=new mvn.NotificationType(r.method)))(HQt||={});p();var gvn=de(ri()),bKe;(r=>(r.method="context/update",r.type=new gvn.ProtocolRequestType(r.method)))(bKe||={});p();p();p();var Fn=de(ri()),Nxe=S.String(),jC=S.Object({uri:Nxe}),qK=S.Intersect([jC,S.Object({version:S.Optional(S.Integer())})]),ord=S.Required(qK),c0=S.Object({line:S.Integer({minimum:0}),character:S.Integer({minimum:0})}),Sf=S.Object({start:c0,end:c0}),GQt=S.Union([S.Integer(),S.String()]),srd=S.Object({isCancellationRequested:S.Boolean(),onCancellationRequested:S.Any()});p();var Avn=de(ri()),$Qt;(r=>(r.method="textDocument/didFocus",r.type=new Avn.ProtocolNotificationType(r.method)))($Qt||={});p();var Yqo=S.Object({didChangeFeatureFlags:S.Boolean(),fetch:S.Boolean(),ipCodeCitation:S.Boolean(),redirectedTelemetry:S.Boolean(),related:S.Boolean(),token:S.Boolean(),watchedFiles:S.Boolean(),showPanelMessage:S.Boolean(),mcpElicitation:S.Boolean(),mcpSampling:S.Boolean(),mcpAllowlist:S.Boolean(),stateDatabase:S.Boolean(),subAgent:S.Boolean(),mcpServerManagement:S.Boolean(),cveRemediatorAgent:S.Boolean(),debuggerAgent:S.Boolean(),contentProvider:S.Array(S.String()),manageTodoListTool:S.Boolean(),agentDebugLog:S.Boolean(),accountPickerEnabled:S.Boolean()}),Kqo=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),yvn=S.Object({name:S.String(),version:S.Optional(S.String()),readableName:S.Optional(S.String())}),Evn=S.Object({editorInfo:S.Optional(yvn),editorPluginInfo:S.Optional(yvn),relatedPluginInfo:S.Optional(S.Array(Kqo)),copilotIntegrationId:S.Optional(S.String()),copilotCapabilities:S.Optional(S.Partial(Yqo)),githubAppId:S.Optional(S.String()),sessionId:S.Optional(S.String())});p();var Mxe=de(ri());var VQt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(VQt||{}),Jqo=S.Enum(VQt),Zqo=S.Object({triggerKind:Jqo,selectedCompletionInfo:S.Optional(S.Object({text:S.String(),range:Sf,tooltipSignature:S.Optional(S.String())}))}),_vn=S.Object({textDocument:qK,position:c0,formattingOptions:S.Optional(S.Object({tabSize:S.Optional(S.Union([S.Integer({minimum:1}),S.String()])),insertSpaces:S.Optional(S.Union([S.Boolean(),S.String()]))})),context:Zqo,data:S.Optional(S.Unknown())}),WQt;(r=>(r.method="textDocument/inlineCompletion",r.type=new Mxe.ProtocolRequestType(r.method)))(WQt||={});var vvn=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),Cvn=S.Object({item:vvn}),zQt;(r=>(r.method="textDocument/didShowCompletion",r.type=new Mxe.ProtocolNotificationType(r.method)))(zQt||={});var bvn=S.Object({item:vvn,acceptedLength:S.Integer({minimum:1})}),YQt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new Mxe.ProtocolNotificationType(r.method)))(YQt||={});p();var Svn=de(ri()),Xqo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new Svn.ProtocolRequestType(r.method)))(Xqo||={});p();var Tvn=de(ri()),ejo=S.Object({severity:S.Union([S.Literal("error"),S.Literal("warning")]),message:S.String(),range:Sf,code:S.Optional(S.Union([S.String(),S.Number()])),source:S.Optional(S.String())}),Ivn=S.Object({textDocument:qK,position:c0,diagnostics:S.Optional(S.Array(ejo))}),tjo=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),xvn=S.Object({item:tjo}),KQt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new Tvn.ProtocolNotificationType(r.method)))(KQt||={});p();var SKe=de(ri());var wvn=S.Object({textDocument:qK,position:c0,partialResultToken:S.Optional(GQt),workDoneToken:S.Optional(GQt)}),TKe;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new SKe.ProtocolRequestType(n.method),n.partialResult=new SKe.ProgressType))(TKe||={});p();var Rvn=de(ri()),JQt;(r=>(r.method="copilot/related",r.type=new Rvn.ProtocolRequestType(r.method)))(JQt||={});p();var ZQt=de(ri()),XQt;(r=>(r.method="statusNotification",r.type=new ZQt.ProtocolNotificationType(r.method)))(XQt||={});var eqt;(r=>(r.method="didChangeStatus/v2",r.type=new ZQt.ProtocolNotificationType(r.method)))(eqt||={});var kvn=de(require("path"));var Pvn=S.Object({uri:S.String(),visibleRange:S.Optional(Sf),selection:S.Optional(Sf)}),tqt=class{constructor(e){this.turnContext=e}static{a(this,"CurrentEditorSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument(e),o=td(n);if(await this.turnContext.collectFile(lE,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new IO(n.document,e.selection,e.visibleRange),l=r.getRelativePath(n.document);if(o==="empty")return new Ar([`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(uue(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 Ar([...u,...d])}else if(n.status==="invalid")return new Ar([`The currently open file \`${kvn.basename(e.uri)}\` is content excluded.`])}},lE="current-editor",IKe=class{constructor(e){this._resolver=e;this.id=lE;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 tqt(e)}};p();var Dvn=S.Object({labels:S.Array(S.String())}),rqt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectLabelsSkillProcessor")}value(){return 1}processSkill(e){let r=[];return r.push([new Ar(["The developer is working on a project with the following characteristics (languages, frameworks):"]),1]),e.labels.forEach(n=>{r.push([new Ar([`- ${n}`]),.9]),this.turnContext.collectLabel(GP,n)}),new Ar(r)}},GP="project-labels",xKe=class{constructor(e){this._resolver=e;this.id=GP;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 rqt(e)}};p();p();p();var wKe=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}},RKe=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}},kKe=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}},PKe=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}},DKe=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}},NKe=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}},MKe=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}},OKe=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}},LKe=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}},BKe=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 FKe=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 Mvn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(Mvn,"determineProgrammingLanguage");var Nvn=[new wKe,new RKe,new kKe,new PKe,new DKe,new NKe,new MKe,new OKe,new LKe,new BKe];function Ovn(t){let e=Nvn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new FKe(t,Nvn);return new nqt(e)}a(Ovn,"getMetadataLookup");var nqt=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 Lvn=S.Object({name:S.String(),version:S.Optional(S.String())}),Bvn=S.Object({language:S.Object({id:S.String(),name:S.String(),version:S.Optional(S.String())}),libraries:S.Array(Lvn),buildTools:S.Array(Lvn)}),iqt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectMetadataSkillProcessor")}value(){return 1}processSkill(e){let r=[];r.push([new Ar([`The user is working on a project with the following characteristics: -`]),1]);let n=Ovn(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 Ar(r)}addProgrammingLanguage(e,r){let n=Mvn(e);this.turnContext.collectLabel(xO,n),r.push([new Ar([`- 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(xO,`${s.name}${s.version?" "+s.version:""}`)});let o=n.map(s=>` - ${s.name}${s.version?" "+s.version:""}`).join(` +`)}};function uue(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(uue,"isEmptyRange");p();p();var hvn=de(ti()),mvn=S.Object({accessToken:S.Optional(S.String({minLength:1})),handle:S.Optional(S.String({minLength:1})),login:S.Optional(S.String({minLength:1})),githubAppId:S.Optional(S.String({minLength:1})),apiUrl:S.Optional(S.String({})),serverUrl:S.Optional(S.String({})),tokenEndpoint:S.Optional(S.String({}))}),HQt;(r=>(r.method="github/didChangeAuth",r.type=new hvn.ProtocolNotificationType(r.method)))(HQt||={});p();var gvn=de(ti()),GQt;(r=>(r.method="copilot/ipCodeCitation",r.type=new gvn.NotificationType(r.method)))(GQt||={});p();var Avn=de(ti()),IKe;(r=>(r.method="context/update",r.type=new Avn.ProtocolRequestType(r.method)))(IKe||={});p();p();p();var Fn=de(ti()),Nxe=S.String(),jC=S.Object({uri:Nxe}),qK=S.Intersect([jC,S.Object({version:S.Optional(S.Integer())})]),frd=S.Required(qK),c0=S.Object({line:S.Integer({minimum:0}),character:S.Integer({minimum:0})}),Sf=S.Object({start:c0,end:c0}),$Qt=S.Union([S.Integer(),S.String()]),prd=S.Object({isCancellationRequested:S.Boolean(),onCancellationRequested:S.Any()});p();var yvn=de(ti()),VQt;(r=>(r.method="textDocument/didFocus",r.type=new yvn.ProtocolNotificationType(r.method)))(VQt||={});p();var Xqo=S.Object({didChangeFeatureFlags:S.Boolean(),fetch:S.Boolean(),ipCodeCitation:S.Boolean(),redirectedTelemetry:S.Boolean(),related:S.Boolean(),token:S.Boolean(),watchedFiles:S.Boolean(),showPanelMessage:S.Boolean(),mcpElicitation:S.Boolean(),mcpSampling:S.Boolean(),mcpAllowlist:S.Boolean(),stateDatabase:S.Boolean(),subAgent:S.Boolean(),mcpServerManagement:S.Boolean(),cveRemediatorAgent:S.Boolean(),debuggerAgent:S.Boolean(),contentProvider:S.Array(S.String()),manageTodoListTool:S.Boolean(),agentDebugLog:S.Boolean(),accountPickerEnabled:S.Boolean()}),ejo=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),Evn=S.Object({name:S.String(),version:S.Optional(S.String()),readableName:S.Optional(S.String())}),_vn=S.Object({editorInfo:S.Optional(Evn),editorPluginInfo:S.Optional(Evn),relatedPluginInfo:S.Optional(S.Array(ejo)),copilotIntegrationId:S.Optional(S.String()),copilotCapabilities:S.Optional(S.Partial(Xqo)),githubAppId:S.Optional(S.String()),sessionId:S.Optional(S.String())});p();var Mxe=de(ti());var WQt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(WQt||{}),tjo=S.Enum(WQt),rjo=S.Object({triggerKind:tjo,selectedCompletionInfo:S.Optional(S.Object({text:S.String(),range:Sf,tooltipSignature:S.Optional(S.String())}))}),vvn=S.Object({textDocument:qK,position:c0,formattingOptions:S.Optional(S.Object({tabSize:S.Optional(S.Union([S.Integer({minimum:1}),S.String()])),insertSpaces:S.Optional(S.Union([S.Boolean(),S.String()]))})),context:rjo,data:S.Optional(S.Unknown())}),zQt;(r=>(r.method="textDocument/inlineCompletion",r.type=new Mxe.ProtocolRequestType(r.method)))(zQt||={});var Cvn=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),bvn=S.Object({item:Cvn}),YQt;(r=>(r.method="textDocument/didShowCompletion",r.type=new Mxe.ProtocolNotificationType(r.method)))(YQt||={});var Svn=S.Object({item:Cvn,acceptedLength:S.Integer({minimum:1})}),KQt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new Mxe.ProtocolNotificationType(r.method)))(KQt||={});p();var Tvn=de(ti()),njo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new Tvn.ProtocolRequestType(r.method)))(njo||={});p();var Ivn=de(ti()),ijo=S.Object({severity:S.Union([S.Literal("error"),S.Literal("warning")]),message:S.String(),range:Sf,code:S.Optional(S.Union([S.String(),S.Number()])),source:S.Optional(S.String())}),xvn=S.Object({textDocument:qK,position:c0,diagnostics:S.Optional(S.Array(ijo))}),ojo=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),wvn=S.Object({item:ojo}),JQt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new Ivn.ProtocolNotificationType(r.method)))(JQt||={});p();var xKe=de(ti());var Rvn=S.Object({textDocument:qK,position:c0,partialResultToken:S.Optional($Qt),workDoneToken:S.Optional($Qt)}),wKe;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new xKe.ProtocolRequestType(n.method),n.partialResult=new xKe.ProgressType))(wKe||={});p();var kvn=de(ti()),ZQt;(r=>(r.method="copilot/related",r.type=new kvn.ProtocolRequestType(r.method)))(ZQt||={});p();var XQt=de(ti()),eqt;(r=>(r.method="statusNotification",r.type=new XQt.ProtocolNotificationType(r.method)))(eqt||={});var tqt;(r=>(r.method="didChangeStatus/v2",r.type=new XQt.ProtocolNotificationType(r.method)))(tqt||={});var Pvn=de(require("path"));var Dvn=S.Object({uri:S.String(),visibleRange:S.Optional(Sf),selection:S.Optional(Sf)}),rqt=class{constructor(e){this.turnContext=e}static{a(this,"CurrentEditorSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument(e),o=td(n);if(await this.turnContext.collectFile(lE,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new IO(n.document,e.selection,e.visibleRange),l=r.getRelativePath(n.document);if(o==="empty")return new Ar([`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(uue(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 Ar([...u,...d])}else if(n.status==="invalid")return new Ar([`The currently open file \`${Pvn.basename(e.uri)}\` is content excluded.`])}},lE="current-editor",RKe=class{constructor(e){this._resolver=e;this.id=lE;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 rqt(e)}};p();var Nvn=S.Object({labels:S.Array(S.String())}),nqt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectLabelsSkillProcessor")}value(){return 1}processSkill(e){let r=[];return r.push([new Ar(["The developer is working on a project with the following characteristics (languages, frameworks):"]),1]),e.labels.forEach(n=>{r.push([new Ar([`- ${n}`]),.9]),this.turnContext.collectLabel($P,n)}),new Ar(r)}},$P="project-labels",kKe=class{constructor(e){this._resolver=e;this.id=$P;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 nqt(e)}};p();p();p();var PKe=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}},DKe=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}},NKe=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}},MKe=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}},OKe=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}},LKe=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}},BKe=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}},FKe=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}},UKe=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}},QKe=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 qKe=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 Ovn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(Ovn,"determineProgrammingLanguage");var Mvn=[new PKe,new DKe,new NKe,new MKe,new OKe,new LKe,new BKe,new FKe,new UKe,new QKe];function Lvn(t){let e=Mvn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new qKe(t,Mvn);return new iqt(e)}a(Lvn,"getMetadataLookup");var iqt=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 Bvn=S.Object({name:S.String(),version:S.Optional(S.String())}),Fvn=S.Object({language:S.Object({id:S.String(),name:S.String(),version:S.Optional(S.String())}),libraries:S.Array(Bvn),buildTools:S.Array(Bvn)}),oqt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectMetadataSkillProcessor")}value(){return 1}processSkill(e){let r=[];r.push([new Ar([`The user is working on a project with the following characteristics: +`]),1]);let n=Lvn(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 Ar(r)}addProgrammingLanguage(e,r){let n=Ovn(e);this.turnContext.collectLabel(xO,n),r.push([new Ar([`- 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(xO,`${s.name}${s.version?" "+s.version:""}`)});let o=n.map(s=>` - ${s.name}${s.version?" "+s.version:""}`).join(` `);e.push([new Ar([`${r} -${o}`]),1])}}},xO="project-metadata",UKe=class{constructor(e){this._resolver=e;this.id=xO;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 iqt(e)}};p();var Fvn=de(require("path"));var oqt=class{constructor(e){this.turnContext=e}static{a(this,"ReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),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 Ar(["The user wants you to consider the following referenced files when computing your answer."]),1]),n.push(...s),new Ar(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=td(n);if(await this.turnContext.collectFile(qKe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new IO(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 Ar([`The referenced file \`${s}\` is empty.`]),1]]}else if(n.status==="invalid")return[[new Ar([`The referenced file \`${Fvn.basename(r.uri)}\` is content excluded.`]),1]]}},sqt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},qKe="references",QKe=class{constructor(){this.id=qKe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new sqt}processor(e){return new oqt(e)}};var jK=a(()=>[xO,GP,qKe,lE],"mandatorySkills"),due=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new CKe(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=>!jK().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)&&!jK().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!jK().includes(d)))}return l.push(...jK()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(zo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(zo).getSupportedSkills(r.id),c=e.get(Yh).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 ew(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...jK(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function HKe(t,e){let[r,n,o]=await rjo(t,e);return o.push(...ojo(t)),r.length>0||n.length>0?[new Ar([[new Ar(["Consider the additional context:"]),1],[Cq(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(HKe,"fromSkills");async function rjo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await sjo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await njo(t,c.skillId);l&&(jK().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(rjo,"handleSkillsInReverse");async function njo(t,e){let n=t.ctx.get(Yh).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 ijo(t,n,l,d,c,f):[void 0,await jKe(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await jKe(t,n,"unresolvable",void 0,c)]}catch(o){if(ot.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof Oxe)throw o;return[void 0,await jKe(t,n,"failed")]}}a(njo,"safelyProcessSkill");async function ijo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new Ar([[n,1]]):c=n,[[c,r?.value()||0],await jKe(t,e,"resolved",c,o,s)]}a(ijo,"handleProcessedSkill");async function jKe(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 yq(t.ctx),f=await t.ctx.get(el).getBestChatModelConfig(xS("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=ws(f.tokenizer).tokenLength(h)}return t.ctx.get(Ag).addResolution(t.turn.id,u),u}a(jKe,"determineResolution");function ojo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(ojo,"handleIgnoredSkills");async function sjo(t,e,r){if(e!==xO&&e!==GP)return!0;let n=t.ctx.get(Zt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===xO:e===GP}a(sjo,"includeSkill");var HK=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=lue(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 Ar(n),c]}async elidableSkills(e,r){return await HKe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(e.ctx,Ye.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(e.ctx,Ye.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(e.ctx,Ye.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(e.ctx,Ye.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(bf).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(bf).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=GS(e.conversation.getLastTurn().request.message),u;o?typeof l=="string"?u=o+` +${o}`]),1])}}},xO="project-metadata",jKe=class{constructor(e){this._resolver=e;this.id=xO;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 oqt(e)}};p();var Uvn=de(require("path"));var sqt=class{constructor(e){this.turnContext=e}static{a(this,"ReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),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 Ar(["The user wants you to consider the following referenced files when computing your answer."]),1]),n.push(...s),new Ar(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=td(n);if(await this.turnContext.collectFile(GKe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new IO(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 Ar([`The referenced file \`${s}\` is empty.`]),1]]}else if(n.status==="invalid")return[[new Ar([`The referenced file \`${Uvn.basename(r.uri)}\` is content excluded.`]),1]]}},aqt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},GKe="references",HKe=class{constructor(){this.id=GKe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new aqt}processor(e){return new sqt(e)}};var jK=a(()=>[xO,$P,GKe,lE],"mandatorySkills"),due=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new TKe(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=>!jK().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)&&!jK().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!jK().includes(d)))}return l.push(...jK()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(Yo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(Yo).getSupportedSkills(r.id),c=e.get(Yh).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 tw(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...jK(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function VKe(t,e){let[r,n,o]=await sjo(t,e);return o.push(...ljo(t)),r.length>0||n.length>0?[new Ar([[new Ar(["Consider the additional context:"]),1],[bq(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(VKe,"fromSkills");async function sjo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await ujo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await ajo(t,c.skillId);l&&(jK().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(sjo,"handleSkillsInReverse");async function ajo(t,e){let n=t.ctx.get(Yh).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 cjo(t,n,l,d,c,f):[void 0,await $Ke(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await $Ke(t,n,"unresolvable",void 0,c)]}catch(o){if(ot.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof Oxe)throw o;return[void 0,await $Ke(t,n,"failed")]}}a(ajo,"safelyProcessSkill");async function cjo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new Ar([[n,1]]):c=n,[[c,r?.value()||0],await $Ke(t,e,"resolved",c,o,s)]}a(cjo,"handleProcessedSkill");async function $Ke(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 Eq(t.ctx),f=await t.ctx.get(el).getBestChatModelConfig(wS("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=ws(f.tokenizer).tokenLength(h)}return t.ctx.get(Ag).addResolution(t.turn.id,u),u}a($Ke,"determineResolution");function ljo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(ljo,"handleIgnoredSkills");async function ujo(t,e,r){if(e!==xO&&e!==$P)return!0;let n=t.ctx.get(Zt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===xO:e===$P}a(ujo,"includeSkill");var HK=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=lue(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 Ar(n),c]}async elidableSkills(e,r){return await VKe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(e.ctx,Ye.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(e.ctx,Ye.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(e.ctx,Ye.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(e.ctx,Ye.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(bf).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(bf).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=VS(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]}},GKe=class extends HK{static{a(this,"PanelUserPromptStrategy")}suffix(e){return is` +`+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]}},WKe=class extends HK{static{a(this,"PanelUserPromptStrategy")}suffix(e){return is` 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. @@ -2679,7 +2679,7 @@ ${o}`]),1])}}},xO="project-metadata",UKe=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 $Ke=class extends HK{static{a(this,"InlineUserPromptStrategy")}suffix(e){return is` + `.trim()}};var zKe=class extends HK{static{a(this,"InlineUserPromptStrategy")}suffix(e){return is` 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. @@ -2734,7 +2734,7 @@ ${o}`]),1])}}},xO="project-metadata",UKe=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 VKe=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=lue(e.turns.slice(0,-1)),n=[];return r!==null&&n.push([r,.6]),new Ar(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 is` + `.trim()}};p();var YKe=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=lue(e.turns.slice(0,-1)),n=[];return r!==null&&n.push([r,.6]),new Ar(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 is` 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. @@ -2743,14 +2743,14 @@ ${o}`]),1])}}},xO="project-metadata",UKe=class{constructor(e){this._resolver=e;t ${e.map(r=>`${this.skillToPrompt(r)} `).join(` `)} - `.trim()}createFunctionArgumentSchema(e){let r=Nyn(e.map(n=>n.id));return S.Object({skillIds:S.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:B3(r).skillIds}}}}skillToPrompt(e){let r=e.description?e.description():e.id,n=`Skill Id: ${e.id} + `.trim()}createFunctionArgumentSchema(e){let r=Myn(e.map(n=>n.id));return S.Object({skillIds:S.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:F3(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(` `)}`),n}promptContent(e,r,n){let o=e.conversation.getLastTurn().request.message,s=this.elidableContent(e.conversation);return[[{role:"system",content:r},{role:"user",content:s},{role:"system",content:this.suffix(n)},{role:"user",content:is` This is the user's question: ${Pn(o).trim()} - `.trim()}],[]]}};p();var WKe=class{static{a(this,"SuggestionsPromptStrategy")}toolConfig(){return{tool_choice:{type:"function",function:{name:"showSuggestions"}},tools:[{type:"function",function:{name:"showSuggestions",description:"Show the computed suggestions to the user",parameters:S.Object({suggestedTitle:S.String({description:"The suggested title for the conversation"}),followUp:S.String({description:"The suggested follow-up question for the conversation"})})}}],extractArguments(e){let r=B3(e);return{suggestedTitle:r.suggestedTitle,followUp:r.followUp}}}}suffix(e){return is` + `.trim()}],[]]}};p();var KKe=class{static{a(this,"SuggestionsPromptStrategy")}toolConfig(){return{tool_choice:{type:"function",function:{name:"showSuggestions"}},tools:[{type:"function",function:{name:"showSuggestions",description:"Show the computed suggestions to the user",parameters:S.Object({suggestedTitle:S.String({description:"The suggested title for the conversation"}),followUp:S.String({description:"The suggested follow-up question for the conversation"})})}}],extractArguments(e){let r=F3(e);return{suggestedTitle:r.suggestedTitle,followUp:r.followUp}}}}suffix(e){return is` Your task is to come up with two suggestions: 1) Suggest a title for the current conversation based on the history of the conversation so far. @@ -2766,7 +2766,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=lue(e.turns.slice()),n=[];return r!==null&&n.push([r,.6]),new Ar(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 ajo=[{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:S.Object({keywords:S.Array(S.Object({keyword:S.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:S.Array(S.String(),{description:"An array of relevant variations of the keyword. Variations include synonyms and plural forms. Variations are not generic and do not repeat."})}))})}}],zKe=class extends HK{static{a(this,"UserQuerySynonymsPromptStrategy")}suffix(){return` + `.trim()}elidableContent(e){let r=lue(e.turns.slice()),n=[];return r!==null&&n.push([r,.6]),new Ar(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 djo=[{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:S.Object({keywords:S.Array(S.Object({keyword:S.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:S.Array(S.String(),{description:"An array of relevant variations of the keyword. Variations include synonyms and plural forms. Variations are not generic and do not repeat."})}))})}}],JKe=class extends HK{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. @@ -2789,39 +2789,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=GS(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:ajo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=B3(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!uYe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!uYe(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 aqt=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function Lxe(t,e,r){return new aqt(t,e,r)}a(Lxe,"descriptor");var Uvn=[Lxe("user",xS("user"),()=>new GKe),Lxe("inline",xS("inline"),()=>new $Ke),Lxe("meta",xS("meta"),()=>new VKe),Lxe("suggestions",xS("suggestions"),()=>new WKe),Lxe("synonyms",xS("synonyms"),()=>new zKe)],YKe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await yq(e),s=xS(r,o),c=Uvn.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 Uvn}};var qvn=require("console");var kA=class{constructor(e,r=new YKe){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(Ur).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(zh).inspectPrompt({type:r.promptType,prompt:Qvn(l),tokens:u}),this.ctx.get(Ag).addPrompt(e.turn.id,Qvn(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,qvn.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:cjo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,TQt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),TQt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Ir).getEditorInfo().readableName??this.ctx.get(Ir).getEditorInfo().name,o=ljo(process.platform);return L_n(this.ctx,n,r?.login,o,e)}};function cjo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(cjo,"processResultOfElidableText");function Qvn(t){return t.map(e=>Pn(e.content)).join(` +`.trim()}promptContent(e,r,n){if(n.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");let o=VS(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:djo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=F3(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!pYe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!pYe(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 cqt=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function Lxe(t,e,r){return new cqt(t,e,r)}a(Lxe,"descriptor");var Qvn=[Lxe("user",wS("user"),()=>new WKe),Lxe("inline",wS("inline"),()=>new zKe),Lxe("meta",wS("meta"),()=>new YKe),Lxe("suggestions",wS("suggestions"),()=>new KKe),Lxe("synonyms",wS("synonyms"),()=>new JKe)],ZKe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await Eq(e),s=wS(r,o),c=Qvn.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 Qvn}};var jvn=require("console");var kA=class{constructor(e,r=new ZKe){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(Ur).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(zh).inspectPrompt({type:r.promptType,prompt:qvn(l),tokens:u}),this.ctx.get(Ag).addPrompt(e.turn.id,qvn(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,jvn.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:fjo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,IQt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),IQt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Ir).getEditorInfo().readableName??this.ctx.get(Ir).getEditorInfo().name,o=pjo(process.platform);return B_n(this.ctx,n,r?.login,o,e)}};function fjo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(fjo,"processResultOfElidableText");function qvn(t){return t.map(e=>Pn(e.content)).join(` -`)}a(Qvn,"debugChatMessages");function ljo(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(ljo,"mapPlatformToOs");var bq=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await xo.getModelConfiguration(e.ctx,"suggestions",{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(kA).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 cqt="v1",$P=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},tw=class extends $P{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},l0=class extends $P{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},sp=class extends $P{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},Bxe=class extends $P{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var pue=new fe("codingAgentUtils"),fue=29950;function jvn(t,e,r){if(e.length>=fue)return pue.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${fue}`),e=e.slice(-fue),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=fue){let o=fue-e.length-2;pue.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${fue}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` +`)}a(qvn,"debugChatMessages");function pjo(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(pjo,"mapPlatformToOs");var Sq=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await wo.getModelConfiguration(e.ctx,"suggestions",{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(kA).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 lqt="v1",VP=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},rw=class extends VP{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},l0=class extends VP{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},sp=class extends VP{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},Bxe=class extends VP{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var pue=new fe("codingAgentUtils"),fue=29950;function Hvn(t,e,r){if(e.length>=fue)return pue.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${fue}`),e=e.slice(-fue),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=fue){let o=fue-e.length-2;pue.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${fue}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` -${r}`:""),isTruncated:n}}a(jvn,"truncatePrompt");function hue(t){return t.length<=20?t:t.substring(0,20)+"..."}a(hue,"generateTitleFromUserPrompt");function Hvn(t){return`Cloud agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a(Hvn,"formatBodyPlaceholder");function Gvn(t,e,r){let n=t.get(ii),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),pue.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`;pue.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),pue.debug(t,`Added active editor: ${c}`))}catch(c){pue.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(Gvn,"extractContextPaths");function $vn(t){return t.length===0?"":`The user has attached the following files from their workspace: +${r}`:""),isTruncated:n}}a(Hvn,"truncatePrompt");function hue(t){return t.length<=20?t:t.substring(0,20)+"..."}a(hue,"generateTitleFromUserPrompt");function Gvn(t){return`Cloud agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a(Gvn,"formatBodyPlaceholder");function $vn(t,e,r){let n=t.get(ii),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),pue.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`;pue.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),pue.debug(t,`Added active editor: ${c}`))}catch(c){pue.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a($vn,"extractContextPaths");function Vvn(t){return t.length===0?"":`The user has attached the following files from their workspace: ${t.map(r=>`- ${r}`).join(` -`)}`}a($vn,"formatContextFiles");p();p();var KKe=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},uE=class extends KKe{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},Fd=class extends KKe{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 lqt=(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))(lqt||{});p();p();p();function Sq(){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(Sq,"getUserAgent");p();p();function JKe(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)=>JKe.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(JKe,"register");p();function Vvn(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(Vvn,"addHook");p();function Wvn(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(Wvn,"removeHook");var zvn=Function.bind,Yvn=zvn.bind(zvn);function Kvn(t,e,r){let n=Yvn(Wvn,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]=Yvn(Vvn,null).apply(null,s)})}a(Kvn,"bindApi");function ujo(){let t=Symbol("Singular"),e={registry:{}},r=JKe.bind(null,e,t);return Kvn(r,e,t),r}a(ujo,"Singular");function djo(){let t={registry:{}},e=JKe.bind(null,t);return Kvn(e,t),e}a(djo,"Collection");var Jvn={Singular:ujo,Collection:djo};p();p();var fjo="0.0.0-development",pjo=`octokit-endpoint.js/${fjo} ${Sq()}`,hjo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":pjo},mediaType:{format:""}};function mjo(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(mjo,"lowercaseKeys");function gjo(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(gjo,"isPlainObject");function eCn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{gjo(e[n])?n in t?r[n]=eCn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(eCn,"mergeDeep");function Zvn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(Zvn,"removeUndefinedProperties");function dqt(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=mjo(r.headers),Zvn(r),Zvn(r.headers);let n=eCn(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(dqt,"merge");function Ajo(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(Ajo,"addQueryParameters");var yjo=/\{[^{}}]+\}/g;function Ejo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(_jo,"extractUrlVariableNames");function Xvn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(Xvn,"omit");function tCn(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(tCn,"encodeReserved");function gue(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(gue,"encodeUnreserved");function Fxe(t,e,r){return e=t==="+"||t==="#"?tCn(e):gue(e),r?gue(r)+"="+e:e}a(Fxe,"encodeValue");function mue(t){return t!=null}a(mue,"isDefined");function uqt(t){return t===";"||t==="&"||t==="?"}a(uqt,"isKeyOperator");function vjo(t,e,r,n){var o=t[r],s=[];if(mue(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(Fxe(e,o,uqt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(mue).forEach(function(c){s.push(Fxe(e,c,uqt(e)?r:""))}):Object.keys(o).forEach(function(c){mue(o[c])&&s.push(Fxe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(mue).forEach(function(l){c.push(Fxe(e,l))}):Object.keys(o).forEach(function(l){mue(o[l])&&(c.push(gue(l)),c.push(Fxe(e,o[l].toString())))}),uqt(e)?s.push(gue(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?mue(o)&&s.push(gue(r)):o===""&&(e==="&"||e==="?")?s.push(gue(r)+"="):o===""&&s.push("");return s}a(vjo,"getValues");function Cjo(t){return{expand:bjo.bind(null,t)}}a(Cjo,"parseUrl");function bjo(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(vjo(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 tCn(s)}),t==="/"?t:t.replace(/\/$/,"")}a(bjo,"expand");function rCn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=Xvn(t,["method","baseUrl","url","headers","request","mediaType"]),c=_jo(r);r=Cjo(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=Xvn(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=Ajo(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(rCn,"parse");function Sjo(t,e,r){return rCn(dqt(t,e,r))}a(Sjo,"endpointWithDefaults");function nCn(t,e){let r=dqt(t,e),n=Sjo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:nCn.bind(null,r),merge:dqt.bind(null,r),parse:rCn})}a(nCn,"withDefaults");var iCn=nCn(null,hjo);var ACn=de(cCn(),1);p();var Tjo=/^-?\d+$/,dCn=/^-?\d+n+$/,fqt=JSON.stringify,lCn=JSON.parse,Ijo=/^-?\d+n$/,xjo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,wjo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,fCn=a((t,e,r)=>"rawJSON"in JSON?fqt(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?fqt(t,(c,l)=>typeof l=="string"&&dCn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(xjo,"$1$2$3").replace(wjo,"$1$2$3"):fqt(t,e,r),"JSONStringify"),tJe=new Map,Rjo=a(()=>{let t=JSON.parse.toString();if(tJe.has(t))return tJe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return tJe.set(t,e),e}catch{return tJe.set(t,!1),!1}},"isContextSourceSupported"),kjo=a((t,e,r,n)=>typeof e=="string"&&Ijo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&dCn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),Pjo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return lCn(t,e);if(Rjo())return Pjo(t,e);let r=t.replace(Djo,(n,o,s,c)=>{let l=n[0]==='"';if(l&&Njo.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthkjo(n,o,s,e))},"JSONParse");p();var $K=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 gCn(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=Ljo(t.body)||Array.isArray(t.body)?fCn(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 $K(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 $K(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await pqt(c),new $K("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await pqt(c),new $K(Fjo(f.data),l,{response:f,request:t});return f.data=n?await pqt(c):c.body,f}a(gCn,"fetchWrapper");async function pqt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(mCn);let r=(0,ACn.safeParse)(e);if(Bjo(r)){let n="";try{return n=await t.text(),hCn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(mCn):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(pqt,"getResponseData");function Bjo(t){return t.type==="application/json"||t.type==="application/scim+json"}a(Bjo,"isJSONResponse");function Fjo(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(Fjo,"toErrorMessage");function hqt(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 gCn(r.parse(c));let l=a((u,d)=>gCn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:hqt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:hqt.bind(null,r)})}a(hqt,"withDefaults");var Qxe=hqt(iCn,Ojo);p();var Ujo="0.0.0-development";function Qjo(t){return`Request failed due to following response errors: +`)}`}a(Vvn,"formatContextFiles");p();p();var XKe=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},uE=class extends XKe{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},Fd=class extends XKe{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 uqt=(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))(uqt||{});p();p();p();function Tq(){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(Tq,"getUserAgent");p();p();function eJe(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)=>eJe.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(eJe,"register");p();function Wvn(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(Wvn,"addHook");p();function zvn(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(zvn,"removeHook");var Yvn=Function.bind,Kvn=Yvn.bind(Yvn);function Jvn(t,e,r){let n=Kvn(zvn,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]=Kvn(Wvn,null).apply(null,s)})}a(Jvn,"bindApi");function hjo(){let t=Symbol("Singular"),e={registry:{}},r=eJe.bind(null,e,t);return Jvn(r,e,t),r}a(hjo,"Singular");function mjo(){let t={registry:{}},e=eJe.bind(null,t);return Jvn(e,t),e}a(mjo,"Collection");var Zvn={Singular:hjo,Collection:mjo};p();p();var gjo="0.0.0-development",Ajo=`octokit-endpoint.js/${gjo} ${Tq()}`,yjo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Ajo},mediaType:{format:""}};function Ejo(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(Ejo,"lowercaseKeys");function _jo(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(_jo,"isPlainObject");function tCn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{_jo(e[n])?n in t?r[n]=tCn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(tCn,"mergeDeep");function Xvn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(Xvn,"removeUndefinedProperties");function fqt(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=Ejo(r.headers),Xvn(r),Xvn(r.headers);let n=tCn(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(fqt,"merge");function vjo(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(vjo,"addQueryParameters");var Cjo=/\{[^{}}]+\}/g;function bjo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(Sjo,"extractUrlVariableNames");function eCn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(eCn,"omit");function rCn(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(rCn,"encodeReserved");function gue(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(gue,"encodeUnreserved");function Fxe(t,e,r){return e=t==="+"||t==="#"?rCn(e):gue(e),r?gue(r)+"="+e:e}a(Fxe,"encodeValue");function mue(t){return t!=null}a(mue,"isDefined");function dqt(t){return t===";"||t==="&"||t==="?"}a(dqt,"isKeyOperator");function Tjo(t,e,r,n){var o=t[r],s=[];if(mue(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(Fxe(e,o,dqt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(mue).forEach(function(c){s.push(Fxe(e,c,dqt(e)?r:""))}):Object.keys(o).forEach(function(c){mue(o[c])&&s.push(Fxe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(mue).forEach(function(l){c.push(Fxe(e,l))}):Object.keys(o).forEach(function(l){mue(o[l])&&(c.push(gue(l)),c.push(Fxe(e,o[l].toString())))}),dqt(e)?s.push(gue(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?mue(o)&&s.push(gue(r)):o===""&&(e==="&"||e==="?")?s.push(gue(r)+"="):o===""&&s.push("");return s}a(Tjo,"getValues");function Ijo(t){return{expand:xjo.bind(null,t)}}a(Ijo,"parseUrl");function xjo(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(Tjo(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 rCn(s)}),t==="/"?t:t.replace(/\/$/,"")}a(xjo,"expand");function nCn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=eCn(t,["method","baseUrl","url","headers","request","mediaType"]),c=Sjo(r);r=Ijo(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=eCn(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=vjo(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(nCn,"parse");function wjo(t,e,r){return nCn(fqt(t,e,r))}a(wjo,"endpointWithDefaults");function iCn(t,e){let r=fqt(t,e),n=wjo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:iCn.bind(null,r),merge:fqt.bind(null,r),parse:nCn})}a(iCn,"withDefaults");var oCn=iCn(null,yjo);var yCn=de(lCn(),1);p();var Rjo=/^-?\d+$/,fCn=/^-?\d+n+$/,pqt=JSON.stringify,uCn=JSON.parse,kjo=/^-?\d+n$/,Pjo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,Djo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,pCn=a((t,e,r)=>"rawJSON"in JSON?pqt(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?pqt(t,(c,l)=>typeof l=="string"&&fCn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(Pjo,"$1$2$3").replace(Djo,"$1$2$3"):pqt(t,e,r),"JSONStringify"),iJe=new Map,Njo=a(()=>{let t=JSON.parse.toString();if(iJe.has(t))return iJe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return iJe.set(t,e),e}catch{return iJe.set(t,!1),!1}},"isContextSourceSupported"),Mjo=a((t,e,r,n)=>typeof e=="string"&&kjo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&fCn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),Ojo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return uCn(t,e);if(Njo())return Ojo(t,e);let r=t.replace(Ljo,(n,o,s,c)=>{let l=n[0]==='"';if(l&&Bjo.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthMjo(n,o,s,e))},"JSONParse");p();var $K=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 ACn(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=Qjo(t.body)||Array.isArray(t.body)?pCn(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 $K(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 $K(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await hqt(c),new $K("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await hqt(c),new $K(jjo(f.data),l,{response:f,request:t});return f.data=n?await hqt(c):c.body,f}a(ACn,"fetchWrapper");async function hqt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(gCn);let r=(0,yCn.safeParse)(e);if(qjo(r)){let n="";try{return n=await t.text(),mCn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(gCn):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(hqt,"getResponseData");function qjo(t){return t.type==="application/json"||t.type==="application/scim+json"}a(qjo,"isJSONResponse");function jjo(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(jjo,"toErrorMessage");function mqt(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 ACn(r.parse(c));let l=a((u,d)=>ACn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:mqt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:mqt.bind(null,r)})}a(mqt,"withDefaults");var Qxe=mqt(oCn,Ujo);p();var Hjo="0.0.0-development";function Gjo(t){return`Request failed due to following response errors: `+t.errors.map(e=>` - ${e.message}`).join(` -`)}a(Qjo,"_buildMessageForResponseErrors");var qjo=class extends Error{static{a(this,"GraphqlResponseError")}constructor(t,e,r){super(Qjo(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},jjo=["method","baseUrl","url","headers","request","query","mediaType","operationName"],Hjo=["query","method","url"],yCn=/\/api\/v3\/?$/;function Gjo(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(Hjo.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)=>jjo.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 yCn.test(s)&&(o.url=s.replace(yCn,"/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 qjo(o,l,c.data)}return c.data.data})}a(Gjo,"graphql");function mqt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>Gjo(r,o,s),"newApi"),{defaults:mqt.bind(null,r),endpoint:r.endpoint})}a(mqt,"withDefaults");var ECn=mqt(Qxe,{headers:{"user-agent":`octokit-graphql.js/${Ujo} ${Sq()}`},method:"POST",url:"/graphql"});function _Cn(t){return mqt(t,{method:"POST",url:"/graphql"})}a(_Cn,"withCustomRequest");p();var gqt="(?:[a-zA-Z0-9_-]+)",vCn="\\.",CCn=new RegExp(`^${gqt}${vCn}${gqt}${vCn}${gqt}$`),$jo=CCn.test.bind(CCn);async function Vjo(t){let e=$jo(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(Vjo,"auth");function Wjo(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(Wjo,"withAuthorizationPrefix");async function zjo(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=Wjo(t),e(o)}a(zjo,"hook");var bCn=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(Vjo.bind(null,e),{hook:zjo.bind(null,e)})},"createTokenAuth2");p();var Aqt="7.0.6";var SCn=a(()=>{},"noop"),Yjo=console.warn.bind(console),Kjo=console.error.bind(console);function Jjo(t={}){return typeof t.debug!="function"&&(t.debug=SCn),typeof t.info!="function"&&(t.info=SCn),typeof t.warn!="function"&&(t.warn=Yjo),typeof t.error!="function"&&(t.error=Kjo),t}a(Jjo,"createLogger");var TCn=`octokit-core.js/${Aqt} ${Sq()}`,rJe=class{static{a(this,"Octokit")}static VERSION=Aqt;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 Jvn.Collection,n={baseUrl:Qxe.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} ${TCn}`:TCn,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=Qxe.defaults(n),this.graphql=_Cn(this.request).defaults(n),this.log=Jjo(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=bCn(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(yqt,"requestLog");yqt.VERSION=ICn;p();var Zjo="0.0.0-development";function Xjo(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(Xjo,"normalizePaginatedListResponse");function Eqt(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=Xjo(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:wCn(t,e,r,n)})}a(wCn,"gather");var aad=Object.assign(xCn,{iterator:Eqt});function _qt(t){return{paginate:Object.assign(xCn.bind(null,t),{iterator:Eqt.bind(null,t)})}}a(_qt,"paginateRest");_qt.VERSION=Zjo;p();p();var vqt="17.0.0";p();p();var eHo={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"]}},RCn=eHo;var VK=new Map;for(let[t,e]of Object.entries(RCn))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);VK.has(t)||VK.set(t,new Map),VK.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var tHo={has({scope:t},e){return VK.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[...VK.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=VK.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=rHo(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function Cqt(t){let e={};for(let r of VK.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},tHo);return e}a(Cqt,"endpointsToMethods");function rHo(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(rHo,"decorate");function nHo(t){return{rest:Cqt(t)}}a(nHo,"restEndpointMethods");nHo.VERSION=vqt;function bqt(t){let e=Cqt(t);return{...e,rest:e}}a(bqt,"legacyRestEndpointMethods");bqt.VERSION=vqt;p();var kCn="22.0.1";var PCn=rJe.plugin(yqt,bqt,_qt).defaults({userAgent:`octokit-rest.js/${kCn}`});var oHo=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),Ac=new fe("GitHubClient"),Zh=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(tr);return this.octokit=new PCn({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!oHo.has(o))return Ac.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(Ac.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){Ac.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 Ac.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return Ac.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){Ac.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}),Ac.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(Ac.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){Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(Ac.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){Ac.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 Ac.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 Ac.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new Fd(c.status,c.message||"GitHub API error")}throw Ac.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){Ac.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 Ac.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 Ac.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 Ac.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){Ac.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 Ac.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 Ac.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 Ac.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(Ac.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw Ac.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(Ur).resolveSession();if(!e)throw new uE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var rl=new fe("CodingAgentClient"),HC=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){rl.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/${cqt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:Hvn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...i0(this.ctx)};if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new H_;let g=await this.ctx.get(tr).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new H_;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new H_;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new H_;let E=y.pull_request?.number;if(typeof E!="number")throw new l0("No valid pull request number returned from job");let v=await new Zh(this.ctx).getPullRequest(n,o,E);return rl.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 rl.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new sp("Title is required and cannot be empty");if(!r?.trim())throw rl.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new sp("ProblemStatement is required and cannot be empty");if(!n?.trim())throw rl.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new sp("Owner is required and cannot be empty");if(!o?.trim())throw rl.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new sp("Repository name is required and cannot be empty");rl.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Ur).resolveSession();if(!r?.accessToken)throw rl.debug(this.ctx,"Failed to get access token"),new tw("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(tr).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){rl.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 rl.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new H_;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...i0(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new H_;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get cloud agent sessions: HTTP ${l.status} - ${d}`;throw rl.error(this.ctx,f),new l0(f)}let u=await l.json();return rl.debug(this.ctx,`Found ${u.sessions?.length||0} coding agent sessions for pull request ID: ${e}`),u.sessions||null}catch(s){if(s instanceof $P)throw s;let c=`Failed to get cloud agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw rl.error(this.ctx,c),new Bxe(c)}}async getSessionLogs(e,r){if(rl.debug(this.ctx,`Getting coding agent session logs for session ID: ${e}`),!e?.trim())throw new sp("Session ID is required and cannot be empty");let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get session logs operation was cancelled before sending API request for session ID: ${e}`),new H_;try{let s=`${o}/agents/sessions/${e}/logs`,c={Authorization:`Bearer ${n}`,...i0(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get session logs operation was cancelled after sending API request for session ID: ${e}`),new H_;if(!l.ok){let u=await l.text().catch(()=>l.statusText),d=`Failed to get cloud agent session logs: HTTP ${l.status} - ${u}`;throw rl.error(this.ctx,d),new l0(d)}return await l.text()}catch(s){if(s instanceof $P)throw s;let c=`Failed to get cloud agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw rl.error(this.ctx,c),new Bxe(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 rl.error(this.ctx,`Cloud agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new l0("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 l0(`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 rl.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new l0(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw rl.error(this.ctx,"API response missing job_id or session_id",r),new l0("Invalid response from cloud agent");return r}};p();p();var wO=class{static{a(this,"LSPRequestSender")}};var DCn=de(ri());var nJe=class{constructor(){this.codingAgentMessageRequestType=new DCn.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(wO).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 GC=de(Io());function Sqt(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(Sqt,"adaptCancellationToken");function NCn(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(NCn,"adaptProgressCallback");function MCn(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(MCn,"createEndpointInfo");function OCn(t){let e={role:sHo(t.role),content:aHo(t.content)};if(t.role===GC.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===GC.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===GC.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=zYe(n);o&&(e.thinking=o);let s=WYe(n);s&&(e.phase=s)}n.type===GC.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(OCn,"convertToCopilotChatMessage");function sHo(t){switch(t){case GC.Raw.ChatRole.System:return"system";case GC.Raw.ChatRole.User:return"user";case GC.Raw.ChatRole.Assistant:return"assistant";case GC.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(sHo,"convertRole");function aHo(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===GC.Raw.ChatCompletionContentPartKind.Text||r.type===GC.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===GC.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===GC.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===GC.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(aHo,"convertContent");p();var G3=de(Io());var iJe=class extends G3.PromptRenderer{constructor(r,n,o,s,c){super(o,r,n,s);this.options=c}static{a(this,"InternalPromptRenderer")}async renderWithOptions(r,n,o){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===G3.Raw.ChatRole.System&&o?.role===G3.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===G3.Raw.ChatCompletionContentPartKind.Text&&l.type===G3.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` -`+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:G3.Raw.ChatCompletionContentPartKind.Text,text:` -`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===G3.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function LCn(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(fHo(e)){case"image/png":return cHo(e);case"image/gif":return lHo(e);case"image/jpeg":case"image/jpg":return uHo(e);case"image/webp":return dHo(e);default:throw new Error("Unsupported image format")}}a(LCn,"getImageDimensions");function cHo(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(cHo,"getPngDimensions");function lHo(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(lHo,"getGifDimensions");function uHo(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(uHo,"getJpegDimensions");function dHo(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 oJe(t){let e=ws(t.tokenizer);return new Tqt(e,t)}a(oJe,"createPromptTsxTokenizer");function mHo(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(mHo,"estimateDocumentTokenCost");var ap=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=MCn(n),c=oJe(n);this._internalRenderer=new iJe(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?NCn(e):void 0,s=r?Sqt(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?t_n(c.messages):r_n(c.messages),{messages:c.messages.map(OCn),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles}}async countTokens(e){let r=e?Sqt(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function Iqt(t,e,r,n,o,s){return await ap.create(t,e,r,s).renderPrompt(n,o,s)}a(Iqt,"renderTsxPrompt");p();p();p();var BCn=new fe("toolCallRoundsBuilder");function RO(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(RO,"buildAssistantRounds");p();var W_=de(Io());var qxe=new fe("toolCalling"),rw=class extends lr{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,W_.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 qxe.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(oue,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(VYe,{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=!!e.followUpUserMessage,_=[];if((A&&A.trim().length>0||y||E)&&_.push(vscpp(W_.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&_.push(vscpp(W_.UserMessage,null,vscpp(vscppf,null,v)))}return _}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"}`;qxe.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 _=this.getMessageContent(e.followUpUserMessage);if(_)return[vscpp(W_.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(W_.UserMessage,null,vscpp(vscppf,null,_))]}return[]}let E=[vscpp(W_.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);_&&E.push(vscpp(W_.UserMessage,null,vscpp(vscppf,null,_)))}return E}if(d.length{let y=(0,W_.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(W_.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(!_){let T=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;qxe.warn(this.props.ctx,`No tool result found for tool call ID ${y.id} in ${T}`);continue}let v=this.getMessageContent(_);this.props.truncateAt&&(v=this.truncateContent(v,this.props.truncateAt));let b=E;m.push(vscpp(b,{priority:r,flexGrow:r+1,flexReserve:`/${1/g}`},vscpp(W_.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(W_.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.lengthVjo.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 ECn.test(s)&&(o.url=s.replace(ECn,"/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 $jo(o,l,c.data)}return c.data.data})}a(zjo,"graphql");function gqt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>zjo(r,o,s),"newApi"),{defaults:gqt.bind(null,r),endpoint:r.endpoint})}a(gqt,"withDefaults");var _Cn=gqt(Qxe,{headers:{"user-agent":`octokit-graphql.js/${Hjo} ${Tq()}`},method:"POST",url:"/graphql"});function vCn(t){return gqt(t,{method:"POST",url:"/graphql"})}a(vCn,"withCustomRequest");p();var Aqt="(?:[a-zA-Z0-9_-]+)",CCn="\\.",bCn=new RegExp(`^${Aqt}${CCn}${Aqt}${CCn}${Aqt}$`),Yjo=bCn.test.bind(bCn);async function Kjo(t){let e=Yjo(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(Kjo,"auth");function Jjo(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(Jjo,"withAuthorizationPrefix");async function Zjo(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=Jjo(t),e(o)}a(Zjo,"hook");var SCn=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(Kjo.bind(null,e),{hook:Zjo.bind(null,e)})},"createTokenAuth2");p();var yqt="7.0.6";var TCn=a(()=>{},"noop"),Xjo=console.warn.bind(console),eHo=console.error.bind(console);function tHo(t={}){return typeof t.debug!="function"&&(t.debug=TCn),typeof t.info!="function"&&(t.info=TCn),typeof t.warn!="function"&&(t.warn=Xjo),typeof t.error!="function"&&(t.error=eHo),t}a(tHo,"createLogger");var ICn=`octokit-core.js/${yqt} ${Tq()}`,oJe=class{static{a(this,"Octokit")}static VERSION=yqt;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 Zvn.Collection,n={baseUrl:Qxe.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} ${ICn}`:ICn,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=Qxe.defaults(n),this.graphql=vCn(this.request).defaults(n),this.log=tHo(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=SCn(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(Eqt,"requestLog");Eqt.VERSION=xCn;p();var rHo="0.0.0-development";function nHo(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(nHo,"normalizePaginatedListResponse");function _qt(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=nHo(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:RCn(t,e,r,n)})}a(RCn,"gather");var had=Object.assign(wCn,{iterator:_qt});function vqt(t){return{paginate:Object.assign(wCn.bind(null,t),{iterator:_qt.bind(null,t)})}}a(vqt,"paginateRest");vqt.VERSION=rHo;p();p();var Cqt="17.0.0";p();p();var iHo={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"]}},kCn=iHo;var VK=new Map;for(let[t,e]of Object.entries(kCn))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);VK.has(t)||VK.set(t,new Map),VK.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var oHo={has({scope:t},e){return VK.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[...VK.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=VK.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=sHo(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function bqt(t){let e={};for(let r of VK.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},oHo);return e}a(bqt,"endpointsToMethods");function sHo(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(sHo,"decorate");function aHo(t){return{rest:bqt(t)}}a(aHo,"restEndpointMethods");aHo.VERSION=Cqt;function Sqt(t){let e=bqt(t);return{...e,rest:e}}a(Sqt,"legacyRestEndpointMethods");Sqt.VERSION=Cqt;p();var PCn="22.0.1";var DCn=oJe.plugin(Eqt,Sqt,vqt).defaults({userAgent:`octokit-rest.js/${PCn}`});var lHo=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),Ac=new fe("GitHubClient"),Zh=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(nr);return this.octokit=new DCn({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!lHo.has(o))return Ac.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(Ac.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){Ac.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 Ac.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return Ac.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){Ac.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}),Ac.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(Ac.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){Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(Ac.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){Ac.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 Ac.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 Ac.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new Fd(c.status,c.message||"GitHub API error")}throw Ac.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){Ac.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 Ac.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 Ac.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 Ac.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){Ac.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 Ac.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 Ac.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 Ac.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(Ac.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw Ac.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(Ur).resolveSession();if(!e)throw new uE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var rl=new fe("CodingAgentClient"),HC=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){rl.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/${lqt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:Gvn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...i0(this.ctx)};if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new G_;let g=await this.ctx.get(nr).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new G_;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new G_;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new G_;let E=y.pull_request?.number;if(typeof E!="number")throw new l0("No valid pull request number returned from job");let v=await new Zh(this.ctx).getPullRequest(n,o,E);return rl.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 rl.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new sp("Title is required and cannot be empty");if(!r?.trim())throw rl.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new sp("ProblemStatement is required and cannot be empty");if(!n?.trim())throw rl.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new sp("Owner is required and cannot be empty");if(!o?.trim())throw rl.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new sp("Repository name is required and cannot be empty");rl.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Ur).resolveSession();if(!r?.accessToken)throw rl.debug(this.ctx,"Failed to get access token"),new rw("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(nr).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){rl.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 rl.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new G_;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...i0(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new G_;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get cloud agent sessions: HTTP ${l.status} - ${d}`;throw rl.error(this.ctx,f),new l0(f)}let u=await l.json();return rl.debug(this.ctx,`Found ${u.sessions?.length||0} coding agent sessions for pull request ID: ${e}`),u.sessions||null}catch(s){if(s instanceof VP)throw s;let c=`Failed to get cloud agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw rl.error(this.ctx,c),new Bxe(c)}}async getSessionLogs(e,r){if(rl.debug(this.ctx,`Getting coding agent session logs for session ID: ${e}`),!e?.trim())throw new sp("Session ID is required and cannot be empty");let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get session logs operation was cancelled before sending API request for session ID: ${e}`),new G_;try{let s=`${o}/agents/sessions/${e}/logs`,c={Authorization:`Bearer ${n}`,...i0(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get session logs operation was cancelled after sending API request for session ID: ${e}`),new G_;if(!l.ok){let u=await l.text().catch(()=>l.statusText),d=`Failed to get cloud agent session logs: HTTP ${l.status} - ${u}`;throw rl.error(this.ctx,d),new l0(d)}return await l.text()}catch(s){if(s instanceof VP)throw s;let c=`Failed to get cloud agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw rl.error(this.ctx,c),new Bxe(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 rl.error(this.ctx,`Cloud agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new l0("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 l0(`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 rl.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new l0(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw rl.error(this.ctx,"API response missing job_id or session_id",r),new l0("Invalid response from cloud agent");return r}};p();p();var wO=class{static{a(this,"LSPRequestSender")}};var NCn=de(ti());var sJe=class{constructor(){this.codingAgentMessageRequestType=new NCn.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(wO).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 GC=de(xo());function Tqt(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(Tqt,"adaptCancellationToken");function MCn(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(MCn,"adaptProgressCallback");function OCn(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(OCn,"createEndpointInfo");function LCn(t){let e={role:uHo(t.role),content:dHo(t.content)};if(t.role===GC.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===GC.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===GC.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=JYe(n);o&&(e.thinking=o);let s=KYe(n);s&&(e.phase=s)}n.type===GC.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(LCn,"convertToCopilotChatMessage");function uHo(t){switch(t){case GC.Raw.ChatRole.System:return"system";case GC.Raw.ChatRole.User:return"user";case GC.Raw.ChatRole.Assistant:return"assistant";case GC.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(uHo,"convertRole");function dHo(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===GC.Raw.ChatCompletionContentPartKind.Text||r.type===GC.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===GC.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===GC.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===GC.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(dHo,"convertContent");p();var $3=de(xo());var aJe=class extends $3.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===$3.Raw.ChatRole.System&&o?.role===$3.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===$3.Raw.ChatCompletionContentPartKind.Text&&l.type===$3.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` +`+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:$3.Raw.ChatCompletionContentPartKind.Text,text:` +`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===$3.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function BCn(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(gHo(e)){case"image/png":return fHo(e);case"image/gif":return pHo(e);case"image/jpeg":case"image/jpg":return hHo(e);case"image/webp":return mHo(e);default:throw new Error("Unsupported image format")}}a(BCn,"getImageDimensions");function fHo(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(fHo,"getPngDimensions");function pHo(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(pHo,"getGifDimensions");function hHo(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(hHo,"getJpegDimensions");function mHo(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 cJe(t){let e=ws(t.tokenizer);return new Iqt(e,t)}a(cJe,"createPromptTsxTokenizer");function EHo(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(EHo,"estimateDocumentTokenCost");var ap=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=OCn(n),c=cJe(n);this._internalRenderer=new aJe(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?MCn(e):void 0,s=r?Tqt(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?r_n(c.messages):n_n(c.messages),{messages:c.messages.map(LCn),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles,promptTsxRemovedNodeCount:this._internalRenderer.promptTsxRemovedNodeCount}}async countTokens(e){let r=e?Tqt(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function xqt(t,e,r,n,o,s){return await ap.create(t,e,r,s).renderPrompt(n,o,s)}a(xqt,"renderTsxPrompt");p();p();p();var FCn=new fe("toolCallRoundsBuilder");function RO(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(RO,"buildAssistantRounds");p();var z_=de(xo());var qxe=new fe("toolCalling"),nw=class extends lr{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,z_.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 qxe.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(oue,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(YYe,{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=!!e.followUpUserMessage,_=[];if((A&&A.trim().length>0||y||E)&&_.push(vscpp(z_.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&_.push(vscpp(z_.UserMessage,null,vscpp(vscppf,null,v)))}return _}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"}`;qxe.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 _=this.getMessageContent(e.followUpUserMessage);if(_)return[vscpp(z_.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(z_.UserMessage,null,vscpp(vscppf,null,_))]}return[]}let E=[vscpp(z_.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);_&&E.push(vscpp(z_.UserMessage,null,vscpp(vscppf,null,_)))}return E}if(d.length{let y=(0,z_.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(z_.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(!_){let T=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;qxe.warn(this.props.ctx,`No tool result found for tool call ID ${y.id} in ${T}`);continue}let v=this.getMessageContent(_);this.props.truncateAt&&(v=this.truncateContent(v,this.props.truncateAt));let b=E;m.push(vscpp(b,{priority:r,flexGrow:r+1,flexReserve:`/${1/g}`},vscpp(z_.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(z_.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(gHo,"separateTextAndImages");function AHo(t){return t.map(e=>vscpp(Xh.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(AHo,"createImageElements");function sJe(t){let{imageUrls:e,textContent:r}=gHo(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(Xh.TextChunk,null,vscpp(vscppf,null,r)),...AHo(e)]}a(sJe,"renderMixedContent");function xqt(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(xqt,"convertToPromptTsxToolCall");function aJe(t){switch(t.role){case"assistant":return yHo(t);case"tool":return EHo(t);case"user":return _Ho(t);case"system":return vHo(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(aJe,"convertChatMessageToPromptTsx");function yHo(t){let e=t.thinking?vscpp(oue,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(Xh.AssistantMessage,{toolCalls:xqt(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(Xh.AssistantMessage,{toolCalls:xqt(t.tool_calls)},vscpp(vscppf,null,sJe(t.content)),e):vscpp(Xh.AssistantMessage,{toolCalls:xqt(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(yHo,"renderAssistantMessage");function EHo(t){return typeof t.content=="string"?vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},sJe(t.content)):vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(EHo,"renderToolMessage");function _Ho(t){return typeof t.content=="string"?vscpp(Xh.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.UserMessage,null,sJe(t.content)):vscpp(Xh.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(_Ho,"renderUserMessage");function vHo(t){return typeof t.content=="string"?vscpp(Xh.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.SystemMessage,null,sJe(t.content)):vscpp(Xh.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(vHo,"renderSystemMessage");var CHo=new fe("conversationHistoryPrompt"),Aue=class extends lr{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):CHo.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=RO(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 lJe=de(Io());var cJe=class extends lr{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(lJe.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(Aue,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(lJe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function FCn(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(FCn,"parseStructuredSummary");var uJe=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 hO(this.ctx,n.modelProviderName,n.userRequestedModelIdOrEmpty):await xo.getModelConfigurationById(this.ctx,n.userRequestedModelIdOrEmpty,e.id.toString(),iq(c));xo.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await ap.create(cJe,{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 jxe=new fe("repository"),$3=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)}},nw=class{static{a(this,"GitBranchLoader")}},kO=class extends nw{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 UCn=require("child_process");var PO=class extends nw{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,UCn.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){jxe.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=rs(r);if(n===void 0)return;let o;try{o=(await lO()).path}catch(c){jxe.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?$3.branch(c):$3.detachedHead()}}extraArgs(){return[]}};p();var DO=class extends nw{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(Qo),o=wa(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;jxe.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 $3.branch(r)}else return this.isCommitSha(e)?$3.detachedHead():$3.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var Tq=new fe("codingAgentTurnProcessor"),dJe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.turnSuggestions=new bq(e.ctx,this.chatFetcher),this.codingAgentClient=new HC(e.ctx),this.gitHubClient=new Zh(e.ctx),this.codingAgentMessageHandler=new nJe,this.conversationSummarizer=new uJe(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 tl(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),qa(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:ZQ.Unknown,responseIsIncomplete:!0}})}finally{tYe(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()=>{Tq.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 sp("No workspace folder available for git repository detection");let f=await new _f(this.turnContext.ctx).getRepo(u);if(!f||!f.isGitHub())throw new sp("No GitHub repository found in the workspace folder");if(!f.owner||!f.name)throw new sp("Could not determine repository owner and name");let h={owner:f.owner,name:f.name},g=await new kO([new PO,new DO]).getBranchInfo(this.turnContext.ctx,u),A;if(g?.currentBranch&&!g.isDetachedHead){A=g.currentBranch,Tq.debug(this.turnContext.ctx,`Found current branch: ${A}`);try{await this.gitHubClient.getBranch(h.owner,h.name,A),Tq.debug(this.turnContext.ctx,`Branch ${A} exists remotely`)}catch(N){if(N instanceof Fd&&N.status===404){let L=`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:`${L} +`,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 Xh=de(xo());function _Ho(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(_Ho,"separateTextAndImages");function vHo(t){return t.map(e=>vscpp(Xh.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(vHo,"createImageElements");function lJe(t){let{imageUrls:e,textContent:r}=_Ho(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(Xh.TextChunk,null,vscpp(vscppf,null,r)),...vHo(e)]}a(lJe,"renderMixedContent");function wqt(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(wqt,"convertToPromptTsxToolCall");function uJe(t){switch(t.role){case"assistant":return CHo(t);case"tool":return bHo(t);case"user":return SHo(t);case"system":return THo(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(uJe,"convertChatMessageToPromptTsx");function CHo(t){let e=t.thinking?vscpp(oue,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(Xh.AssistantMessage,{toolCalls:wqt(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(Xh.AssistantMessage,{toolCalls:wqt(t.tool_calls)},vscpp(vscppf,null,lJe(t.content)),e):vscpp(Xh.AssistantMessage,{toolCalls:wqt(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(CHo,"renderAssistantMessage");function bHo(t){return typeof t.content=="string"?vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},lJe(t.content)):vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(bHo,"renderToolMessage");function SHo(t){return typeof t.content=="string"?vscpp(Xh.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.UserMessage,null,lJe(t.content)):vscpp(Xh.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(SHo,"renderUserMessage");function THo(t){return typeof t.content=="string"?vscpp(Xh.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.SystemMessage,null,lJe(t.content)):vscpp(Xh.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(THo,"renderSystemMessage");var IHo=new fe("conversationHistoryPrompt"),Aue=class extends lr{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):IHo.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=RO(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(nw,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var fJe=de(xo());var dJe=class extends lr{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(fJe.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(Aue,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(fJe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function UCn(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(UCn,"parseStructuredSummary");var pJe=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 hO(this.ctx,n.modelProviderName,n.userRequestedModelIdOrEmpty):await wo.getModelConfigurationById(this.ctx,n.userRequestedModelIdOrEmpty,e.id.toString(),oq(c));wo.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await ap.create(dJe,{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 jxe=new fe("repository"),V3=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)}},iw=class{static{a(this,"GitBranchLoader")}},kO=class extends iw{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 QCn=require("child_process");var PO=class extends iw{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,QCn.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){jxe.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=rs(r);if(n===void 0)return;let o;try{o=(await lO()).path}catch(c){jxe.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?V3.branch(c):V3.detachedHead()}}extraArgs(){return[]}};p();var DO=class extends iw{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(qo),o=xa(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;jxe.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 V3.branch(r)}else return this.isCommitSha(e)?V3.detachedHead():V3.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var Iq=new fe("codingAgentTurnProcessor"),hJe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.turnSuggestions=new Sq(e.ctx,this.chatFetcher),this.codingAgentClient=new HC(e.ctx),this.gitHubClient=new Zh(e.ctx),this.codingAgentMessageHandler=new sJe,this.conversationSummarizer=new pJe(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 tl(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),Qa(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:XQ.Unknown,responseIsIncomplete:!0}})}finally{nYe(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()=>{Iq.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 sp("No workspace folder available for git repository detection");let f=await new _f(this.turnContext.ctx).getRepo(u);if(!f||!f.isGitHub())throw new sp("No GitHub repository found in the workspace folder");if(!f.owner||!f.name)throw new sp("Could not determine repository owner and name");let h={owner:f.owner,name:f.name},g=await new kO([new PO,new DO]).getBranchInfo(this.turnContext.ctx,u),A;if(g?.currentBranch&&!g.isDetachedHead){A=g.currentBranch,Iq.debug(this.turnContext.ctx,`Found current branch: ${A}`);try{await this.gitHubClient.getBranch(h.owner,h.name,A),Iq.debug(this.turnContext.ctx,`Branch ${A} exists remotely`)}catch(N){if(N instanceof Fd&&N.status===404){let L=`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:`${L} -`}),Tq.error(this.turnContext.ctx,L),new sp(L)}throw N}}else throw new sp("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let y=Pn(this.turn.request.message),E=Gvn(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),_=$vn(E);Tq.debug(this.turnContext.ctx,`Extracted ${E.length} context file paths (${_.length} characters formatted)`);let v="",b=hue(y);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... +`}),Iq.error(this.turnContext.ctx,L),new sp(L)}throw N}}else throw new sp("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let y=Pn(this.turn.request.message),E=$vn(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),_=Vvn(E);Iq.debug(this.turnContext.ctx,`Extracted ${E.length} context file paths (${_.length} characters formatted)`);let v="",b=hue(y);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... `});let{structuredSummary:N,rawSummary:L}=await this.summarizeConversation(r,o,l);if(r.isCancellationRequested)return;N&&N.title&&(b=N.title),v=L||""}let T=_;v&&(T=_+(_?` -`:"")+v);let{problemStatement:w}=jvn(this.turnContext.ctx,y,T||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to cloud agent... +`:"")+v);let{problemStatement:w}=Hvn(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(b,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){Tq.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 P={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let N=await this.fetchSuggestedTitle(r,o.extendedBy({messageSource:"chat.user"},{}));typeof N=="string"&&N!==""&&(P.suggestedTitle=N)}let D=o.extendedBy({modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});Et(this.turnContext.ctx,"codingAgent",D),ZI(this.turnContext.ctx,"codingAgent",D),await this.endProgress(P)}catch(u){if(n7e(this.turnContext.ctx,"codingAgent",u,o),u instanceof Oc)Tq.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,u),qa(this.turnContext.ctx,u,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(u instanceof $P)qa(this.turnContext.ctx,u,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(u.message),await this.endProgress({error:{message:u.message,code:ZQ.Default,responseIsIncomplete:!0}});else throw Tq.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=FCn(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=oq(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 QCn="```",Hxe=String.raw``,bHo=String.raw`${QCn}[\w]*?\n(?[\s\S]*?)\n${QCn}`,SHo=new RegExp(Hxe+` -`+bHo,"gs"),wqt=["replace","delete"];function Rqt(t,e){let r=t.matchAll(SHo),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!wqt.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(b,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){Iq.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 P={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let N=await this.fetchSuggestedTitle(r,o.extendedBy({messageSource:"chat.user"},{}));typeof N=="string"&&N!==""&&(P.suggestedTitle=N)}let D=o.extendedBy({modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});Et(this.turnContext.ctx,"codingAgent",D),ex(this.turnContext.ctx,"codingAgent",D),await this.endProgress(P)}catch(u){if(o7e(this.turnContext.ctx,"codingAgent",u,o),u instanceof Oc)Iq.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,u),Qa(this.turnContext.ctx,u,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(u instanceof VP)Qa(this.turnContext.ctx,u,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(u.message),await this.endProgress({error:{message:u.message,code:XQ.Default,responseIsIncomplete:!0}});else throw Iq.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=UCn(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=sq(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 qCn="```",Hxe=String.raw``,xHo=String.raw`${qCn}[\w]*?\n(?[\s\S]*?)\n${qCn}`,wHo=new RegExp(Hxe+` +`+xHo,"gs"),Rqt=["replace","delete"];function kqt(t,e){let r=t.matchAll(wHo),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!Rqt.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,E)=>{f[E]=y.slice(h.length)});let m={mode:c.mode,codeblock:f.join(` -`),start:l,end:u},g=kqt([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(Rqt,"extractEditsFromTaggedCodeblocks");function kqt(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=Pqt([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(kqt,"extractEditsFromTaggedCodeblocks");function Pqt(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(kqt,"applyEditsToDocument");var yue=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 xo.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(kA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},fJe=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 yq(e.ctx),u=await e.ctx.get(el).getBestChatModelConfig(xS(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(kA).toPrompt(e,d)}async processResponse(e){let r=[],n=Pn(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(lE);if(r)return r}async getDocumentIfValid(e){let r=await this.ctx.get(ii).getOrReadTextDocument({uri:e});if(r.status==="valid")return r.document}async processInlineResponse(e,r){let o=Rqt(e,r).filter(c=>wqt.includes(c.mode)),s=kqt(o,r);if(s)return await this.ctx.get(zh).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return Rqt(e,r)}};var pJe=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 yue(e.ctx);return new dJe(e,r)}};p();p();p();p();function qCn(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(qCn,"filterUnsupportedReferences");function jCn(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(jCn,"convertToCopilotReferences");var HCn=S.Object({type:S.Literal("github.web-search"),id:S.String(),data:S.Object({query:S.String(),type:S.String(),results:S.Optional(S.Array(S.Object({title:S.String(),excerpt:S.String(),url:S.String()})))}),metadata:S.Optional(S.Object({display_name:S.Optional(S.String()),display_icon:S.Optional(S.String())}))});var Iq=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,qCn(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 NO=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(Ur).resolveSession(),s;if(o&&new URL(o.serverUrl).hostname===n)s=o;else{let u=await this.ctx.get(nx).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(tr).fetch(l,{method:"GET",headers:c})}};p();p();var GCn=S.Object({name:S.String(),url:S.String()}),$Cn=S.Object({path:S.String(),head:S.Optional(S.Object({name:S.String(),upstream:S.Optional(GCn)})),remotes:S.Optional(S.Array(GCn))}),Pqt=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(MO,"git repository information");let r=[];return r.push([new Ar(["Metadata about the current git repository:"]),1]),e.head&&e.head.name?(r.push([new Ar([`- Current branch name: ${e.head.name}`]),1]),e.head.upstream&&r.push([new Ar([`- Upstream name and url: ${e.head.upstream.name} - ${e.head.upstream.url}`]),1])):r.push([new Ar(["- Detached HEAD: yes"]),1]),e.remotes&&e.remotes.length>0&&r.push([new Ar([`- Remotes: ${e.remotes.map(n=>n.name).join(", ")}`]),1]),new Ar(r)}},MO="git-metadata",hJe=class extends gg{static{a(this,"GitMetadataSkill")}constructor(e){super(MO,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new Pqt(r))}};async function VCn(t){let e=await t.skillResolver.resolve(lE);if(e){let c=e.uri,l=gQ(t.ctx,c);if(Sdn(l))return{repoInfo:l,skillUsed:lE}}let r=await t.skillResolver.resolve(MO);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=A8t(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:MO}}a(VCn,"extractRepoInfo");async function WCn(t){let e=[];return await THo(t,e),await IHo(t,e),await xHo(t,e),e}a(WCn,"skillsToReference");async function THo(t,e){let r=await wHo(t);r&&e.push(r)}a(THo,"addRepositoryReference");async function IHo(t,e){let r=await RHo(t);r&&e.push(r)}a(IHo,"addSelectionReference");async function xHo(t,e){let r=[],n=await PHo(t);n&&r.push(n),r.push(...await DHo(t)),r.length>0&&e.push(...r)}a(xHo,"addFileReferences");async function wHo(t){let e=await VCn(t);if(e){let r=t.ctx.get(NO),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(wHo,"gitMetadataToReference");async function RHo(t){let e=await t.skillResolver.resolve(lE);if(e&&e.selection){let n=await t.ctx.get(ii).getOrReadTextDocument(e),o=td(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return kHo(e,n.document)}}a(RHo,"currentEditorToSelectionReference");function kHo(t,e){if(t.selection&&!uue(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(kHo,"extractSelection");async function PHo(t){let e=await t.skillResolver.resolve(lE);if(e){let n=await t.ctx.get(ii).getOrReadTextDocument(e),o=td(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(PHo,"currentEditorToFileReference");async function DHo(t){let e=[],r=t.turn.request.references;if(r&&r.length>0){let n=t.ctx.get(ii);for(let o of r)if(o.type==="file"){let s=await n.getOrReadTextDocument(o),c=td(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(DHo,"fileReferenceToPlatformFileReference");p();Mo();var NHo=new fe("ChatFetchResultPostProcessor"),Eue=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(Cyn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s),await this.turnContext.ctx.get(zh).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:Pn(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"},NHo.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:$_.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===V_,copilotPlan:rx(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}=xo.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},byn(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:Pn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new bq(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:Mt(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return xyn(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",Syn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var mJe=S.Union([S.String(),S.Number()]),WK=S.Union([S.String(),S.Number()]),MHo=S.Union([S.Literal("included"),S.Literal("blocked"),S.Literal("notfound"),S.Literal("empty")]),gJe=S.Object({uri:S.String(),position:S.Optional(c0)}),OHo=S.Object({type:S.Literal("file"),uri:S.String(),position:S.Optional(c0),visibleRange:S.Optional(Sf),selection:S.Optional(Sf),status:S.Optional(MHo),range:S.Optional(Sf)}),LHo=S.Object({type:S.Literal("directory"),uri:S.String()}),BHo=S.Object({type:S.Literal("tool"),uri:S.String(),name:S.Optional(S.String()),server:S.Optional(S.String()),description:S.Optional(S.String())}),OO=S.Union([OHo,LHo,HCn,BHo]),LO=S.Union([S.Literal("panel"),S.Literal("inline")]),FHo=S.Union([S.Object({type:S.Literal("text"),text:S.String()}),S.Object({type:S.Literal("image_url"),imageUrl:S.Object({url:S.String(),detail:S.Optional(S.Union([S.Literal("low"),S.Literal("high")]))})})]),Dqt=S.Union([S.String(),S.Array(FHo)]),zCn=S.Object({request:Dqt,response:S.Optional(S.String()),agentSlug:S.Optional(S.String()),turnId:S.Optional(WK),model:S.Optional(S.String())});function AJe(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(AJe,"convertToMessageContent");function yJe(t,e){if(t=GS(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(yJe,"appendToMessage");var EJe=S.Union([S.Literal("Ask"),S.Literal("Agent"),S.Literal("InlineAgent")]),UHo=S.Object({type:S.String(),description:S.String()}),YCn=S.Object({name:S.String(),description:S.String(),inputSchema:S.Optional(S.Object({type:S.String(),properties:S.Record(S.String(),UHo),required:S.Array(S.String())})),confirmationMessages:S.Optional(S.Object({title:S.String(),message:S.String()}))}),Bc=S.Object({uri:S.String(),name:S.String()}),QHo=S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")]),_Je=S.Object({id:S.Number(),title:S.String(),description:S.Optional(S.String()),status:QHo});Mo();var Nqt="generate-response",vJe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},Gxe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(r.ctx),this.postProcessor=new Eue(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 vJe?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 tl(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(zh).inspectPrompt(l),await n.steps.start(Nqt,"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:GS(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 Mt()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return QQt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:GS(r.request.message)}),r.response&&r.response.type==="model"){let o=jCn(r.response.references);n.push({role:"assistant",content:GS(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await WCn(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 Iq((h,m,g,A,y,E)=>{let _=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:_,thinking:E}),this.turn.response?(this.turn.response.message=yJe(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??[]),_&&(this.turn.confirmationRequest=_)}),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:Pn(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()),Pn(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 vJe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return cxe(this.conversation,"conversationPanel",Pn(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(Nqt,e.error.message):await r.steps.finish(Nqt)}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 $xe=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 Gxe(this,e)}},CJe=class extends $xe{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 Gxe(this,e)}};p();var qHo="github",WP=class{static{a(this,"RemoteAgentRegistry")}},bJe=class extends WP{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 PY(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Nr.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)||Nr.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Nr.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==qHo).map(o=>new $xe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var KCn=de(require("fs")),z_=de(require("path"));var Mqt=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],Oqt="test_",Vxe={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"}},Wxe=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=Ji(e),n=z_.extname(r).replace(".",""),o=Vxe[n]??{location:"sameFolder",prefix:Oqt,suffix:Mqt},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=rs(uf(e)),l===void 0)return}else{let d=rs(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=z_.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=Ks(l);if(await this.fileExists(u))return wa(u,s[0])}parseTestFilePath(e){try{return Ks(e)}catch(r){Nr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=Ji(e),n=z_.extname(r).replace(".",""),o=Vxe[n]??{location:"sameFolder",prefix:Oqt,suffix:Mqt},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=uf(e):l=this.determineImplFolder(e);for(let u of s){let d=wa(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=rs(e);if(r===void 0)return;let n=z_.extname(Ji(e)).replace(".",""),o,s=Vxe[n]?.location??"sameFolder";s==="sameFolder"?o=z_.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,Vxe[n]);if(c.length>0)return Ks(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${z_.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 KCn.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&rs(this.baseUri))??"",o=z_.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(z_.sep)}getRelativeTestFolder(e,r,n,o){let s=z_.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=z_.extname(Ji(e)).replace(".",""),n=uf(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 zxe(t){let e=Ji(t),r=z_.extname(e),n=Vxe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(Mqt.some(s=>e.endsWith(s+r))||e.startsWith(Oqt))}a(zxe,"isTestFile");p();var Lqt=class extends Error{static{a(this,"UserQueryParserError")}constructor(e){super(String(e),{cause:e}),this.name="UserQueryParserError"}};async function JCn(t,e){let r=t.ctx,n=await xo.getModelConfiguration(r,"synonyms",{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(kA).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 oc(r),u=await tl(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:"";qa(r,new Lqt(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"UserQueryParser.parseUserQuery")}}a(JCn,"parseUserQuery");p();p();p();p();var Yo=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 Yo(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new Yo(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 ZCn=250;function PA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/ZCn)),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(PA,"getMaxChunks");var XCn=32e3,ebn=2e4,Yxe=.75;p();p();function DA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(DA,"getFenceForCodeBlock");p();var B1n=de(Sl()),F1n=de(eh());p();var $C=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 JGo=Object.freeze({[$C.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[$C.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function Jqt(t){return JGo[t.id]}a(Jqt,"getWellKnownEmbeddingTypeInfo");function ZGo(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:Kxe(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(fbn,"rankEmbeddings");p();p();var nF=de(nl()),L1n=de(eh());var qO=new fe("GitHubCodeSearch"),Hzo=300*1e3,pZe=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new nF.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()},Hzo)}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),qO.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){qO.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(qO.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),qO.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){qO.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,nF.raceTimeout)((async()=>{if(!await(0,nF.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,nF.raceCancellationError)((0,nF.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 qO.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 Gf(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return qO.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return qO.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=Pue(this._ctx),c=n.owner+"/"+n.name,l=await Gf(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(qO.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=Pue(this._ctx),u=await Gf(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:$zo(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 Gzo(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function Pue(t){let e=t.get(Ir);return{"X-Client-Application":`${M1(e.getEditorInfo())}`,"X-Client-Source":M1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(Pue,"editorVersionHeaders");async function Gzo(t,e,r){let o=[],s=new $C(e.embedding_model),c=Fs(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=wa(c,l.location.path)}catch(d){qO.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:hZe(l.chunk.text),rawText:void 0,range:new L1n.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(Gzo,"parseGithubCodeSearchResponse");function $zo(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($zo,"truncateToMaxUtf8Length");function hZe(t){let e=Vzo(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` -`):t}a(hZe,"stripChunkTextMetadata");function Vzo(t){return t.split(/\r\n|\r|\n/)}a(Vzo,"splitLines");var XP=de(nl()),U1n=de(vue()),Q1n=de(em());var mwe=new fe("ChunkingEndpointClient"),wHt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new U1n.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 XP.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,XP.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,XP.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,XP.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){mwe.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{mwe.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{mwe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},mZe=class{constructor(e){this.ctx=e;this._requestLimiter=new wHt(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,XP.raceCancellationError)(n.getText(),l);if((0,Q1n.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=Pue(this.ctx);return await Gf(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:rs(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,XP.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){mwe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,B1n.coalesce)(h.chunks.map(m=>{let g=new F1n.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:hZe(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 E=new $C(h.embedding_model);if(!E.equals(r))throw new Error(`Unexpected embedding model. Got: ${E.id}. Expected: ${r.id}`);y={type:E,value:new Float32Array(m.embedding.embedding)}}if(!(s.computeEmbeddings&&!y))return{chunk:{file:n.uri.toString(),text:hZe(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){mwe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var fE={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},f0=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=Wt.createAndMarkAsIssued(s,o);Et(e,r,c),At(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};qa(e,n,r,o),Vn(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,fE.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,fE.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,fE.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,fE.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,fE.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,fE.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,fE.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,fE.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=Wt.createAndMarkAsIssued(o,{});Et(e,r,s),At(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,fE.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,fE.Aggregate,r)}};var q1n=de(Sl()),j1n=de(nl()),RHt=de(FO());var iF=new fe("Remote Search"),gZe=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(_f),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 RHt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(iF.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(P=>`${P.owner}/${P.name}`),maxResults:PA(r)}),s.length===0)throw iF.error(this.ctx,"No GitHub repositories found"),f0.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 iF.error(this.ctx,"No GitHub session found"),f0.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 iF.error(this.ctx,"Remote index not ready for any repositories"),f0.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=PA(r),d=Promise.all(l.map(async P=>{Hh(n);let D=await e.resolveQuery(n),N=new RHt.StopWatch,L=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,P,D,u,n);return iF.info(this.ctx,`Search completed for ${P.owner}/${P.name}`,{searchTime:N.elapsed(),chunkCount:L.chunks.length}),L})),f=await this._localDiffSearch.getLocalDiff(r.workspaceFolders),h=new Set(f),m=this._localDiffSearch.shouldDoLocalDiffSearch(f,r.workspaceFolders);iF.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,j1n.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{iF.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(P=>{iF.error(this.ctx,"Local diff search failed",P)})??Promise.resolve(void 0)]),E=(0,q1n.coalesce)(A).flatMap(P=>P.chunks),_=y?.isOk()?y.val.result.chunks:[],v=_.length>0?[...E.filter(P=>!h.has(P.chunk.file)),..._]:E,b=v.length,w=new Set(v.map(P=>P.chunk.file)).size,R=o.elapsed();iF.info(this.ctx,`Search completed successfully in ${R}ms`,{totalTime:R,totalChunkCount:b,uniqueFileCount:w,indexedRepoCount:l.length,localDiffChunkCount:_.length,localDiffStrategy:y?.isOk()?y.val.strategy:"none"});let x=y?.isOk()?"mixed":"codesearch";return f0.sendRemoteSuccess(this.ctx,R,b,w,x),{chunks:v}}};p();p();var FIn=require("node:url"),UIn=require("path");p();var DZe=de(G1n(),1);p();var kHt=new WeakMap;function Nue(...t){let e=new String(t);return kHt.set(e,t),e}a(Nue,"c");function ow(t){return t instanceof String&&kHt.has(t)}a(ow,"r");function Mue(t){return kHt.get(t)??[]}a(Mue,"o");var kZe=de(J1n(),1),xTn=require("child_process");var dIn=de(MHt(),1),CIn=require("node:path");p();function*Z1n(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(Z1n,"U");var EYo=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),_Yo=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),vYo=new Set(["edit","remove-section","rename-section","set","unset"]),CYo=new Set(["get","get-color","get-colorbool","list"]);function bYo(t,e){for(let{name:n}of Z1n(t,"task")){if(EYo.has(n))return Fue(!0,e);if(_Yo.has(n))return Fue(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:vYo.has(r)?Fue(!0,e.slice(1)):CYo.has(r)?Fue(!1,e.slice(1)):e.length===1?Fue(!1,e):Fue(!0,e)}a(bYo,"F");function Fue(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(Fue,"p");function SYo(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(SYo,"A");function TYo(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(TYo,"M");function IYo(t){for(let{name:e}of Z1n(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(IYo,"N");function xYo({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(xYo,"G");function*wYo(t){for(let e of t){let r=xYo(e),n=r&&TYo(e.value);n&&(yield{...n,scope:r})}}a(wYo,"O");function RYo(t,e,r){let n={read:[],write:[...wYo(e)]};return t==="config"&&kYo(n,IYo(e),bYo(e,r)),n}a(RYo,"L");function kYo(t,e,r){if(r===null)return;let n=SYo(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(kYo,"$");var X1n={short:new Map([["c",!0]])},PYo={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...X1n.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},DYo={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"])}},NYo={short:new Map,long:new Set};function MYo(t){let e=DYo[t??""]??NYo;return{short:new Map([...X1n.short.entries(),...e.short.entries()]),long:e.long}}a(MYo,"I");function eSn(t,e=PYo){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 OYo(t,e.short)}a(eSn,"b");function OYo(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(OYo,"W");function LYo(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[nGt(t)[0]])(t=0)),e},"__init"),"__esm"),JYo=a((t,e)=>a(function(){return e||(0,t[nGt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),tm=a((t,e)=>{for(var r in e)rGt(t,r,{get:e[r],enumerable:!0})},"__export"),ZYo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of nGt(e))!KYo.call(t,o)&&o!==r&&rGt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=YYo(e,o))||n.enumerable});return t},"__copyProps"),rh=a(t=>ZYo(rGt({},"__esModule",{value:!0}),t),"__toCommonJS"),oF,Lq=Zr({"src/lib/errors/git-error.ts"(){"use strict";oF=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),_we,jue=Zr({"src/lib/errors/git-response-error.ts"(){"use strict";Lq(),_we=class extends oF{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),LSn,BSn=Zr({"src/lib/errors/task-configuration-error.ts"(){"use strict";Lq(),LSn=class extends oF{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function FSn(t){return typeof t!="function"?sJ:t}a(FSn,"asFunction");function USn(t){return typeof t=="function"&&t!==sJ}a(USn,"isUserFunction");function QSn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(QSn,"splitOn");function qSn(t,e=0){return jSn(t)&&t.length>e?t[e]:void 0}a(qSn,"first");function oJ(t,e=0){if(jSn(t)&&t.length>e)return t[t.length-1-e]}a(oJ,"last");function jSn(t){return LZe(t)}a(jSn,"isArrayLike");function vwe(t="",e=!0,r=` -`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(vwe,"toLinesWithContent");function iGt(t,e){return vwe(t,!0).map(r=>e(r))}a(iGt,"forEachLineWithContent");function oGt(t){return(0,DZe.exists)(t,DZe.FOLDER)}a(oGt,"folderExists");function cw(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(cw,"append");function HSn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(HSn,"including");function NZe(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(NZe,"remove");function jO(t){return Array.isArray(t)?t:[t]}a(jO,"asArray");function GSn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(GSn,"asCamelCase");function Hue(t){return jO(t).map(e=>e instanceof String?e:String(e))}a(Hue,"asStringArray");function Eu(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(Eu,"asNumber");function ywe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a($Sn,"pick");function qHt(t=0){return new Promise(e=>setTimeout(e,t))}a(qHt,"delay");function jHt(t){if(t!==!1)return t}a(jHt,"orVoid");var Que,sJ,Cwe,MZe=Zr({"src/lib/utils/util.ts"(){"use strict";sGt(),Que="\0",sJ=a(()=>{},"NOOP"),Cwe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function pE(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(pE,"filterType");function HHt(t,e){let r=ow(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(HHt,"filterPrimitives");function OZe(t){return!!t&&Cwe(t)==="[object Object]"}a(OZe,"filterPlainObject");function VSn(t){return typeof t=="function"}a(VSn,"filterFunction");var bwe,WSn,lp,wZe,LZe,sGt=Zr({"src/lib/utils/argument-filters.ts"(){"use strict";MZe(),bwe=a(t=>Array.isArray(t),"filterArray"),WSn=a(t=>typeof t=="number","filterNumber"),lp=a(t=>typeof t=="string"||ow(t),"filterString"),wZe=a(t=>lp(t)||Array.isArray(t)&&t.every(lp),"filterStringOrStringArray"),LZe=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),GHt,XYo=Zr({"src/lib/utils/exit-codes.ts"(){"use strict";GHt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(GHt||{})}}),RZe,eKo=Zr({"src/lib/utils/git-output-streams.ts"(){"use strict";RZe=class zSn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new zSn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function tKo(){throw new Error("LineParser:useMatches not implemented")}a(tKo,"useMatchesDefault");var ko,Oq,rKo=Zr({"src/lib/utils/line-parser.ts"(){"use strict";ko=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=tKo,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))}},Oq=class extends ko{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 YSn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...KSn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(YSn,"createInstanceConfig");var KSn,nKo=Zr({"src/lib/utils/simple-git-options.ts"(){"use strict";KSn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function aGt(t,e=[]){return OZe(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(ow(o))r.push(o);else if(HHt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)HHt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(aGt,"appendTaskOptions");function J_(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=vwe(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(JC,"parseStringResponse");var sKo=Zr({"src/lib/utils/task-parser.ts"(){"use strict";MZe()}}),JSn={};tm(JSn,{ExitCodes:a(()=>GHt,"ExitCodes"),GitOutputStreams:a(()=>RZe,"GitOutputStreams"),LineParser:a(()=>ko,"LineParser"),NOOP:a(()=>sJ,"NOOP"),NULL:a(()=>Que,"NULL"),RemoteLineParser:a(()=>Oq,"RemoteLineParser"),append:a(()=>cw,"append"),appendTaskOptions:a(()=>aGt,"appendTaskOptions"),asArray:a(()=>jO,"asArray"),asCamelCase:a(()=>GSn,"asCamelCase"),asFunction:a(()=>FSn,"asFunction"),asNumber:a(()=>Eu,"asNumber"),asStringArray:a(()=>Hue,"asStringArray"),bufferToString:a(()=>Ewe,"bufferToString"),callTaskParser:a(()=>$Ht,"callTaskParser"),createInstanceConfig:a(()=>YSn,"createInstanceConfig"),delay:a(()=>qHt,"delay"),filterArray:a(()=>bwe,"filterArray"),filterFunction:a(()=>VSn,"filterFunction"),filterHasLength:a(()=>LZe,"filterHasLength"),filterNumber:a(()=>WSn,"filterNumber"),filterPlainObject:a(()=>OZe,"filterPlainObject"),filterPrimitives:a(()=>HHt,"filterPrimitives"),filterString:a(()=>lp,"filterString"),filterStringOrStringArray:a(()=>wZe,"filterStringOrStringArray"),filterType:a(()=>pE,"filterType"),first:a(()=>qSn,"first"),folderExists:a(()=>oGt,"folderExists"),forEachLineWithContent:a(()=>iGt,"forEachLineWithContent"),getTrailingOptions:a(()=>J_,"getTrailingOptions"),including:a(()=>HSn,"including"),isUserFunction:a(()=>USn,"isUserFunction"),last:a(()=>oJ,"last"),objectToString:a(()=>Cwe,"objectToString"),orVoid:a(()=>jHt,"orVoid"),parseStringResponse:a(()=>JC,"parseStringResponse"),pick:a(()=>$Sn,"pick"),prefixedArray:a(()=>ywe,"prefixedArray"),remove:a(()=>NZe,"remove"),splitOn:a(()=>QSn,"splitOn"),toLinesWithContent:a(()=>vwe,"toLinesWithContent"),trailingFunctionArgument:a(()=>Qd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>cGt,"trailingOptionsArgument")});var oo=Zr({"src/lib/utils/index.ts"(){"use strict";sGt(),XYo(),eKo(),rKo(),nKo(),oKo(),sKo(),MZe()}}),ZSn={};tm(ZSn,{CheckRepoActions:a(()=>VHt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>eTn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>XSn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>aKo,"checkIsRepoTask")});function aKo(t){switch(t){case"bare":return eTn();case"root":return XSn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:BZe,parser:lGt}}a(aKo,"checkIsRepoTask");function XSn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:BZe,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(XSn,"checkIsRepoRootTask");function eTn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:BZe,parser:lGt}}a(eTn,"checkIsBareRepoTask");function cKo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(cKo,"isNotRepoMessage");var VHt,BZe,lGt,tTn=Zr({"src/lib/tasks/check-is-repo.ts"(){"use strict";oo(),VHt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(VHt||{}),BZe=a(({exitCode:t},e,r,n)=>{if(t===128&&cKo(e))return r(Buffer.from("false"));n(e)},"onError"),lGt=a(t=>t.trim()==="true","parser")}});function lKo(t,e){let r=new rTn(t),n=t?iTn:nTn;return vwe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(oTn.test(s)?r.folders:r.files).push(s)}),r}a(lKo,"cleanSummaryParser");var rTn,nTn,iTn,oTn,uKo=Zr({"src/lib/responses/CleanSummary.ts"(){"use strict";oo(),rTn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},nTn=/^[a-z]+\s*/i,iTn=/^[a-z]+\s+[a-z]+\s*/i,oTn=/\/$/}}),WHt={};tm(WHt,{EMPTY_COMMANDS:a(()=>FZe,"EMPTY_COMMANDS"),adhocExecTask:a(()=>sTn,"adhocExecTask"),configurationErrorTask:a(()=>KC,"configurationErrorTask"),isBufferTask:a(()=>cTn,"isBufferTask"),isEmptyTask:a(()=>lTn,"isEmptyTask"),straightThroughBufferTask:a(()=>aTn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>Z_,"straightThroughStringTask")});function sTn(t){return{commands:FZe,format:"empty",parser:t}}a(sTn,"adhocExecTask");function KC(t){return{commands:FZe,format:"empty",parser(){throw typeof t=="string"?new LSn(t):t}}}a(KC,"configurationErrorTask");function Z_(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(Z_,"straightThroughStringTask");function aTn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(aTn,"straightThroughBufferTask");function cTn(t){return t.format==="buffer"}a(cTn,"isBufferTask");function lTn(t){return t.format==="empty"||!t.commands.length}a(lTn,"isEmptyTask");var FZe,nh=Zr({"src/lib/tasks/task.ts"(){"use strict";BSn(),FZe=[]}}),uTn={};tm(uTn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>uGt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>dGt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>fGt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>SZe,"CleanOptions"),cleanTask:a(()=>dTn,"cleanTask"),cleanWithOptionsTask:a(()=>dKo,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>fKo,"isCleanOptionsArray")});function dKo(t,e){let{cleanMode:r,options:n,valid:o}=pKo(t);return r?o.options?(n.push(...e),n.some(gKo)?KC(uGt):dTn(r,n)):KC(fGt+JSON.stringify(t)):KC(dGt)}a(dKo,"cleanWithOptionsTask");function dTn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return lKo(t==="n",n)}}}a(dTn,"cleanTask");function fKo(t){return Array.isArray(t)&&t.every(e=>pGt.has(e))}a(fKo,"isCleanOptionsArray");function pKo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{hKo(o)?(e=o,n.cleanMode=!0):n.options=n.options&&mKo(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(pKo,"getCleanOptions");function hKo(t){return t==="f"||t==="n"}a(hKo,"isCleanMode");function mKo(t){return/^-[a-z]$/i.test(t)&&pGt.has(t.charAt(1))}a(mKo,"isKnownOption");function gKo(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(gKo,"isInteractiveMode");var uGt,dGt,fGt,SZe,pGt,fTn=Zr({"src/lib/tasks/clean.ts"(){"use strict";uKo(),oo(),nh(),uGt="Git clean interactive mode is not supported",dGt='Git clean mode parameter ("n" or "f") is required',fGt="Git clean unknown option found in: ",SZe=(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))(SZe||{}),pGt=new Set(["i",...Hue(Object.values(SZe))])}});function AKo(t){let e=new hTn;for(let r of pTn(t))e.addValue(r.file,String(r.key),r.value);return e}a(AKo,"configListParser");function yKo(t,e){let r=null,n=[],o=new Map;for(let s of pTn(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(yKo,"configGetParser");function EKo(t){return t.replace(/^(file):/,"")}a(EKo,"configFilePath");function*pTn(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=oJ(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 OHt(t,e){return typeof t=="string"&&Object.hasOwn(zHt,t)?t:e}a(OHt,"asConfigScope");function vKo(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(vKo,"addConfigTask");function CKo(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 yKo(n,t)}}}a(CKo,"getConfigTask");function bKo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return AKo(r)}}}a(bKo,"listConfigTask");function SKo(){return{addConfig(t,e,...r){return this._runTask(vKo(t,e,r[0]===!0,OHt(r[1],"local")),Qd(arguments))},getConfig(t,e){return this._runTask(CKo(t,OHt(e,void 0)),Qd(arguments))},listConfig(...t){return this._runTask(bKo(OHt(t[0],void 0)),Qd(arguments))}}}a(SKo,"config_default");var zHt,mTn=Zr({"src/lib/tasks/config.ts"(){"use strict";_Ko(),oo(),zHt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(zHt||{})}});function TKo(t){return gTn.has(t)}a(TKo,"isDiffNameStatus");var LHt,gTn,ATn=Zr({"src/lib/tasks/diff-name-status.ts"(){"use strict";LHt=(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))(LHt||{}),gTn=new Set(Object.values(LHt))}});function IKo(...t){return new ETn().param(...t)}a(IKo,"grepQueryBuilder");function xKo(t){let e=new Set,r={};return iGt(t,n=>{let[o,s,c]=n.split(Que);e.add(o),(r[o]=r[o]||[]).push({line:Eu(s),path:o,preview:c})}),{paths:e,results:r}}a(xKo,"parseGrep");function wKo(){return{grep(t){let e=Qd(arguments),r=J_(arguments);for(let o of yTn)if(r.includes(o))return this._runTask(KC(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=IKo().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return xKo(o)}},e)}}}a(wKo,"grep_default");var yTn,Awe,oSn,ETn,_Tn=Zr({"src/lib/tasks/grep.ts"(){"use strict";oo(),nh(),yTn=["-h"],Awe=Symbol("grepQuery"),ETn=class{static{a(this,"GrepQuery")}constructor(){this[oSn]=[]}*[(oSn=Awe,Symbol.iterator)](){for(let t of this[Awe])yield t}and(...t){return t.length&&this[Awe].push("--and","(",...ywe(t,"-e"),")"),this}param(...t){return this[Awe].push(...ywe(t,"-e")),this}}}}),vTn={};tm(vTn,{ResetMode:a(()=>TZe,"ResetMode"),getResetMode:a(()=>kKo,"getResetMode"),resetTask:a(()=>RKo,"resetTask")});function RKo(t,e){let r=["reset"];return CTn(t)&&r.push(`--${t}`),r.push(...e),Z_(r)}a(RKo,"resetTask");function kKo(t){if(CTn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(kKo,"getResetMode");function CTn(t){return typeof t=="string"&&bTn.includes(t)}a(CTn,"isValidResetMode");var TZe,bTn,STn=Zr({"src/lib/tasks/reset.ts"(){"use strict";oo(),nh(),TZe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(TZe||{}),bTn=Hue(Object.values(TZe))}});function PKo(){return(0,kZe.default)("simple-git")}a(PKo,"createLog");function sSn(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(sSn,"prefixedLogger");function DKo(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(DKo,"childLoggerName");function hGt(t,e,r,n=PKo()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=DKo(pE(e,lp),c,n);return d(r);function u(f,h){return cw(s,hGt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&sSn(c,h)||sJ,g=sSn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(hGt,"createLogger");var TTn=Zr({"src/lib/git-logger.ts"(){"use strict";oo(),kZe.default.formatters.L=t=>String(LZe(t)?t.length:"-"),kZe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Cwe(t)}}),ITn,NKo=Zr({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Lq(),TTn(),ITn=class YHt{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=YHt.getName(e.commands[0]),n=hGt(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 oF(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++YHt.counter}`}static{this.counter=0}}}});function iJ(t,e){return{method:qSn(t.commands)||"",commands:e}}a(iJ,"pluginContext");function MKo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(MKo,"onErrorReceived");function aSn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(aSn,"onDataReceived");var KHt,OKo=Zr({"src/lib/runners/git-executor-chain.ts"(){"use strict";Lq(),nh(),oo(),NKo(),KHt=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 ITn}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(lTn(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 oF?Object.assign(e,{task:t}):new oF(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","",iJ(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...iJ(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),cTn(t)?$Ht(t.parser,s):$Ht(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},{...iJ(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",Cwe(h)),u(new RZe(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 RZe(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},iJ(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,{...iJ(t,r),kill(m){f=m||f}});let h=(0,xTn.spawn)(e,r,c);h.stdout.on("data",aSn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",aSn(d,"stdErr",o,s.step("stdErr"))),h.on("error",MKo(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,{...iJ(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,{...iJ(t,e),kill(n){r=n||r}}),r}}}}),wTn={};tm(wTn,{GitExecutor:a(()=>RTn,"GitExecutor")});var RTn,LKo=Zr({"src/lib/runners/git-executor.ts"(){"use strict";OKo(),RTn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new KHt(this,this._scheduler,this._plugins)}chain(){return new KHt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function BKo(t,e,r=sJ){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof _we?FKo(s):s,void 0)},"onError2");e.then(n,o)}a(BKo,"taskCallback");function FKo(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=sJ},"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(FKo,"addDeprecationNoticeToError");var UKo=Zr({"src/lib/task-callback.ts"(){"use strict";jue(),oo()}});function cSn(t,e){return sTn(r=>{if(!oGt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(cSn,"changeWorkingDirectoryTask");var QKo=Zr({"src/lib/tasks/change-working-directory.ts"(){"use strict";oo(),nh()}});function BHt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=NZe(e,"-B")),Z_(e)}a(BHt,"checkoutTask");function qKo(){return{checkout(){return this._runTask(BHt(J_(arguments,1)),Qd(arguments))},checkoutBranch(t,e){return this._runTask(BHt(["-b",t,e,...J_(arguments)]),Qd(arguments))},checkoutLocalBranch(t){return this._runTask(BHt(["-b",t,...J_(arguments)]),Qd(arguments))}}}a(qKo,"checkout_default");var jKo=Zr({"src/lib/tasks/checkout.ts"(){"use strict";oo(),nh()}});function HKo(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(HKo,"countObjectsResponse");function GKo(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return JC(HKo(),[kTn],t)}})}}}a(GKo,"count_objects_default");var kTn,$Ko=Zr({"src/lib/tasks/count-objects.ts"(){"use strict";oo(),kTn=new ko(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=GSn(e);Object.hasOwn(t,n)&&(t[n]=Eu(r))})}});function VKo(t){return JC({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},PTn,t)}a(VKo,"parseCommitResult");var PTn,WKo=Zr({"src/lib/parsers/parse-commit.ts"(){"use strict";oo(),PTn=[new ko(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new ko(/\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 ko(/(\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 ko(/^(\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 zKo(t,e,r){return{commands:["-c","core.abbrev=40","commit",...ywe(t,"-m"),...e,...r],format:"utf-8",parser:VKo}}a(zKo,"commitTask");function YKo(){return{commit(e,...r){let n=Qd(arguments),o=t(e)||zKo(jO(e),jO(pE(r[0],wZe,[])),[...Hue(pE(r[1],bwe,[])),...J_(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!wZe(e)&&KC("git.commit: requires the commit message to be supplied as a string/string[]")}}a(YKo,"commit_default");var KKo=Zr({"src/lib/tasks/commit.ts"(){"use strict";WKo(),oo(),nh()}});function JKo(){return{firstCommit(){return this._runTask(Z_(["rev-list","--max-parents=0","HEAD"],!0),Qd(arguments))}}}a(JKo,"first_commit_default");var ZKo=Zr({"src/lib/tasks/first-commit.ts"(){"use strict";oo(),nh()}});function XKo(t,e){let r=["hash-object",t];return e&&r.push("-w"),Z_(r,!0)}a(XKo,"hashObjectTask");var eJo=Zr({"src/lib/tasks/hash-object.ts"(){"use strict";nh()}});function tJo(t,e,r){let n=String(r).trim(),o;if(o=DTn.exec(n))return new IZe(t,e,!1,o[1]);if(o=NTn.exec(n))return new IZe(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new IZe(t,e,/^re/i.test(n),s)}a(tJo,"parseInit");var IZe,DTn,NTn,rJo=Zr({"src/lib/responses/InitSummary.ts"(){"use strict";IZe=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},DTn=/^Init.+ repository in (.+)$/,NTn=/^Rein.+ in (.+)$/}});function nJo(t){return t.includes(mGt)}a(nJo,"hasBareCommand");function iJo(t=!1,e,r){let n=["init",...r];return t&&!nJo(n)&&n.splice(1,0,mGt),{commands:n,format:"utf-8",parser(o){return tJo(n.includes("--bare"),e,o)}}}a(iJo,"initTask");var mGt,oJo=Zr({"src/lib/tasks/init.ts"(){"use strict";rJo(),mGt="--bare"}});function gGt(t){for(let e=0;eJC(new MTn,e,r,!1)}a(OTn,"getDiffParser");var FHt,lSn,uSn,dSn,LTn,BTn=Zr({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Swe(),aJo(),ATn(),oo(),FHt=[new ko(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:Eu(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new ko(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:Eu(r),after:Eu(n),binary:!0})}),new ko(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);t.changed=Eu(e),t.insertions=Eu(n?.[1]),t.deletions=Eu(o?.[1])})],lSn=[new ko(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=Eu(e),s=Eu(r);t.changed++,t.insertions+=o,t.deletions+=s,t.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new ko(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],uSn=[new ko(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],dSn=[new ko(/([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:jHt(TKo(e)&&e),from:jHt(!!s&&n!==s&&n),similarity:Eu(r)})})],LTn={"":FHt,"--stat":FHt,"--numstat":lSn,"--name-status":dSn,"--name-only":uSn}}});function cJo(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(cJo,"lineBuilder");function FTn(t=_Gt,e=UTn,r=""){let n=OTn(r);return function(o){let s=vwe(o.trim(),!1,yGt).map(function(c){let l=c.split(EGt),u=cJo(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(FTn,"createListLogSummaryParser");var yGt,EGt,_Gt,UTn,QTn=Zr({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";oo(),BTn(),Swe(),yGt="\xF2\xF2\xF2\xF2\xF2\xF2 ",EGt=" \xF2\xF2",_Gt=" \xF2 ",UTn=["hash","date","message","refs","author_name","author_email"]}}),qTn={};tm(qTn,{diffSummaryTask:a(()=>lJo,"diffSummaryTask"),validateLogFormatConfig:a(()=>UZe,"validateLogFormatConfig")});function lJo(t){let e=gGt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),UZe(r)||{commands:r,format:"utf-8",parser:OTn(e)}}a(lJo,"diffSummaryTask");function UZe(t){let e=t.filter(sJo);if(e.length>1)return KC(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return KC(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a(UZe,"validateLogFormatConfig");var vGt=Zr({"src/lib/tasks/diff.ts"(){"use strict";Swe(),BTn(),nh()}});function uJo(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(uJo,"prettyFormat");function dJo(t){return Object.keys(t).reduce((e,r)=>(r in JHt||(e[r]=t[r]),e),{})}a(dJo,"userOptions");function jTn(t={},e=[]){let r=pE(t.splitter,lp,_Gt),n=OZe(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]=uJo(n,r),c=[],l=[`--pretty=format:${yGt}${s}${EGt}`,...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 lp(t.file)&&l.push("--follow",Nue(t.file)),aGt(dJo(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(jTn,"parseLogOptions");function fJo(t,e,r){let n=FTn(t,e,gGt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(fJo,"logTask");function pJo(){return{log(...r){let n=Qd(arguments),o=jTn(cGt(arguments),Hue(pE(arguments[0],bwe,[]))),s=e(...r)||UZe(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return fJo(r.splitter,r.fields,r.commands)}function e(r,n){return lp(r)&&lp(n)&&KC("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(pJo,"log_default");var JHt,HTn=Zr({"src/lib/tasks/log.ts"(){"use strict";Swe(),QTn(),oo(),nh(),vGt(),JHt=(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))(JHt||{})}}),xZe,GTn,hJo=Zr({"src/lib/responses/MergeSummary.ts"(){"use strict";xZe=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}`}},GTn=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"}}}}),ZHt,$Tn,mJo=Zr({"src/lib/responses/PullSummary.ts"(){"use strict";ZHt=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}}},$Tn=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function UHt(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(UHt,"objectEnumerationResult");function fSn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:Eu(e&&e[1]||"0"),delta:Eu(r&&r[1]||"0")}}a(fSn,"asObjectCount");var VTn,gJo=Zr({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";oo(),VTn=[new Oq(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=UHt(t.remoteMessages);Object.assign(o,{[n]:Eu(r)})}),new Oq(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=UHt(t.remoteMessages);Object.assign(o,{[n]:Eu(r)})}),new Oq(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=UHt(t.remoteMessages);o.total=fSn(e),o.reused=fSn(r),o.packReused=Eu(n)})]}});function WTn(t,e){return JC({remoteMessages:new YTn},zTn,e)}a(WTn,"parseRemoteMessages");var zTn,YTn,KTn=Zr({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";oo(),gJo(),zTn=[new Oq(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...VTn,new Oq([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new Oq([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:Eu(e),summary:r,url:n}})],YTn=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function AJo(t,e){let r=JC(new $Tn,JTn,[t,e]);return r.message&&r}a(AJo,"parsePullErrorResult");var pSn,hSn,mSn,gSn,JTn,ASn,CGt,ZTn=Zr({"src/lib/parsers/parse-pull.ts"(){"use strict";mJo(),oo(),KTn(),pSn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,hSn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,mSn=/^(create|delete) mode \d+ (.+)/,gSn=[new ko(pSn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new ko(hSn,(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 ko(mSn,(t,[e,r])=>{cw(t.files,r),cw(e==="create"?t.created:t.deleted,r)})],JTn=[new ko(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new ko(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new ko(/([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})],ASn=a((t,e)=>JC(new ZHt,gSn,[t,e]),"parsePullDetail"),CGt=a((t,e)=>Object.assign(new ZHt,ASn(t,e),WTn(t,e)),"parsePullResult")}}),ySn,XTn,ESn,yJo=Zr({"src/lib/parsers/parse-merge.ts"(){"use strict";hJo(),oo(),ZTn(),ySn=[new ko(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new ko(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new xZe(e,r))}),new ko(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new xZe(e,r,{deleteRef:n}))}),new ko(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new xZe(e,null))}),new ko(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],XTn=a((t,e)=>Object.assign(ESn(t,e),CGt(t,e)),"parseMergeResult"),ESn=a(t=>JC(new GTn,ySn,t),"parseMergeDetail")}});function _Sn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=XTn(e,r);if(n.failed)throw new _we(n);return n}}:KC("Git.merge requires at least one option")}a(_Sn,"mergeTask");var EJo=Zr({"src/lib/tasks/merge.ts"(){"use strict";jue(),yJo(),nh()}});function _Jo(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(_Jo,"pushResultPushedItem");var vSn,eIn,CSn,vJo=Zr({"src/lib/parsers/parse-push.ts"(){"use strict";oo(),KTn(),vSn=[new ko(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new ko(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new ko(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(_Jo(e,r,n))}),new ko(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:n}}),new ko(/^([^:]+):(\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}}})],eIn=a((t,e)=>{let r=CSn(t,e),n=WTn(t,e);return{...r,...n}},"parsePushResult"),CSn=a((t,e)=>JC({pushed:[]},vSn,[t,e]),"parsePushDetail")}}),tIn={};tm(tIn,{pushTagsTask:a(()=>CJo,"pushTagsTask"),pushTask:a(()=>bGt,"pushTask")});function CJo(t={},e){return cw(e,"--tags"),bGt(t,e)}a(CJo,"pushTagsTask");function bGt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),NZe(r,"-v"),cw(r,"--verbose"),cw(r,"--porcelain"),{commands:r,format:"utf-8",parser:eIn}}a(bGt,"pushTask");var rIn=Zr({"src/lib/tasks/push.ts"(){"use strict";vJo(),oo()}});function bJo(){return{showBuffer(){let t=["show",...J_(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(aTn(t),Qd(arguments))},show(){let t=["show",...J_(arguments,1)];return this._runTask(Z_(t),Qd(arguments))}}}a(bJo,"show_default");var SJo=Zr({"src/lib/tasks/show.ts"(){"use strict";oo(),nh()}}),bSn,nIn,TJo=Zr({"src/lib/responses/FileStatusSummary.ts"(){"use strict";bSn=/^(.+)\0(.+)$/,nIn=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=bSn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function SSn(t){let[e,r]=t.split(Que);return{from:r||e,to:e}}a(SSn,"renamedFile");function XS(t,e,r){return[`${t}${e}`,r]}a(XS,"parser3");function QHt(t,...e){return e.map(r=>XS(t,r,(n,o)=>n.conflicted.push(o)))}a(QHt,"conflicts");function IJo(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=iIn.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new nIn(c,o,s))}a(n,"data")}a(IJo,"splitLine");var TSn,iIn,oIn,xJo=Zr({"src/lib/responses/StatusSummary.ts"(){"use strict";oo(),TJo(),TSn=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}},iIn=new Map([XS(" ","A",(t,e)=>t.created.push(e)),XS(" ","D",(t,e)=>t.deleted.push(e)),XS(" ","M",(t,e)=>t.modified.push(e)),XS("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),XS("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),XS("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),XS("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),XS("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),XS("R"," ",(t,e)=>{t.renamed.push(SSn(e))}),XS("R","M",(t,e)=>{let r=SSn(e);t.renamed.push(r),t.modified.push(r.to)}),XS("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),XS("?","?",(t,e)=>t.not_added.push(e)),...QHt("A","A","U"),...QHt("D","D","U"),...QHt("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=pE(l?.[1],lp,null),l=s.exec(e),t.tracking=pE(l?.[1],lp,null),l=c.exec(e),l&&(t.current=pE(l?.[1],lp,t.current)),t.detached=/\(no branch\)/.test(e)}]]),oIn=a(function(t){let e=t.split(Que),r=new TSn;for(let n=0,o=e.length;n!sIn.includes(r))],parser(r){return oIn(r)}}}a(wJo,"statusTask");var sIn,RJo=Zr({"src/lib/tasks/status.ts"(){"use strict";xJo(),sIn=["--null","-z"]}});function PZe(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(PZe,"versionResponse");function kJo(){return PZe(0,0,0,"",!1)}a(kJo,"notInstalledResponse");function PJo(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:DJo,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(SGt));n(e)}})}}}a(PJo,"version_default");function DJo(t){return t===SGt?kJo():JC(PZe(0,0,0,t),aIn,t)}a(DJo,"versionParser");var SGt,aIn,NJo=Zr({"src/lib/tasks/version.ts"(){"use strict";oo(),SGt="installed=false",aIn=[new ko(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,PZe(Eu(e),Eu(r),Eu(n),o))}),new ko(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,PZe(Eu(e),Eu(r),n,o))})]}});function ISn(t,e,r,...n){return lp(r)?e(r,pE(n[0],lp),J_(arguments)):KC(`git.${t}() requires a string 'repoPath'`)}a(ISn,"createCloneTask");function MJo(){return{clone(t,...e){return this._runTask(ISn("clone",XHt,pE(t,lp),...e),Qd(arguments))},mirror(t,...e){return this._runTask(ISn("mirror",cIn,pE(t,lp),...e),Qd(arguments))}}}a(MJo,"clone_default");var XHt,cIn,OJo=Zr({"src/lib/tasks/clone.ts"(){"use strict";nh(),oo(),XHt=a((t,e,r)=>{let n=["clone",...r];return lp(t)&&n.push(Nue(t)),lp(e)&&n.push(Nue(e)),Z_(n)},"cloneTask"),cIn=a((t,e,r)=>(cw(r,"--mirror"),XHt(t,e,r)),"cloneMirrorTask")}}),lIn={};tm(lIn,{SimpleGitApi:a(()=>eGt,"SimpleGitApi")});var eGt,LJo=Zr({"src/lib/simple-git-api.ts"(){"use strict";UKo(),QKo(),jKo(),$Ko(),KKo(),mTn(),ZKo(),_Tn(),eJo(),oJo(),HTn(),EJo(),rIn(),SJo(),RJo(),nh(),NJo(),oo(),OJo(),eGt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&BKo(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(Z_(["add",...jO(t)]),Qd(arguments))}cwd(t){let e=Qd(arguments);return typeof t=="string"?this._runTask(cSn(t,this._executor),e):typeof t?.path=="string"?this._runTask(cSn(t.path,t.root&&this._executor||void 0),e):this._runTask(KC("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(XKo(t,e===!0),Qd(arguments))}init(t){return this._runTask(iJo(t===!0,this._executor.cwd,J_(arguments)),Qd(arguments))}merge(){return this._runTask(_Sn(J_(arguments)),Qd(arguments))}mergeFromTo(t,e){return lp(t)&&lp(e)?this._runTask(_Sn([t,e,...J_(arguments)]),Qd(arguments,!1)):this._runTask(KC("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=bGt({remote:pE(arguments[0],lp),branch:pE(arguments[1],lp)},J_(arguments));return this._runTask(t,Qd(arguments))}stash(){return this._runTask(Z_(["stash",...J_(arguments)]),Qd(arguments))}status(){return this._runTask(wJo(J_(arguments)),Qd(arguments))}},Object.assign(eGt.prototype,qKo(),MJo(),YKo(),SKo(),GKo(),JKo(),wKo(),pJo(),bJo(),PJo())}}),uIn={};tm(uIn,{Scheduler:a(()=>fIn,"Scheduler")});var xSn,fIn,BJo=Zr({"src/lib/runners/scheduler.ts"(){"use strict";oo(),TTn(),xSn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,dIn.createDeferred)();return{promise:e,done:r,id:t}}})(),fIn=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=hGt("","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=cw(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),NZe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=cw(this.pending,xSn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),pIn={};tm(pIn,{applyPatchTask:a(()=>FJo,"applyPatchTask")});function FJo(t,e){return Z_(["apply",...e,...t])}a(FJo,"applyPatchTask");var UJo=Zr({"src/lib/tasks/apply-patch.ts"(){"use strict";nh()}});function QJo(t,e){return{branch:t,hash:e,success:!0}}a(QJo,"branchDeletionSuccess");function qJo(t){return{branch:t,hash:null,success:!1}}a(qJo,"branchDeletionFailure");var hIn,jJo=Zr({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";hIn=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function mIn(t,e){return e===1&&tGt.test(t)}a(mIn,"hasBranchDeletionError");var wSn,tGt,RSn,QZe,HJo=Zr({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";jJo(),oo(),wSn=/(\S+)\s+\(\S+\s([^)]+)\)/,tGt=/^error[^']+'([^']+)'/m,RSn=[new ko(wSn,(t,[e,r])=>{let n=QJo(e,r);t.all.push(n),t.branches[e]=n}),new ko(tGt,(t,[e])=>{let r=qJo(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],QZe=a((t,e)=>JC(new hIn,RSn,[t,e]),"parseBranchDeletions")}}),gIn,GJo=Zr({"src/lib/responses/BranchSummary.ts"(){"use strict";gIn=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 kSn(t){return t?t.charAt(0):""}a(kSn,"branchStatus");function AIn(t,e=!1){return JC(new gIn,e?[EIn]:yIn,t)}a(AIn,"parseBranchSummary");var yIn,EIn,$Jo=Zr({"src/lib/parsers/parse-branch.ts"(){"use strict";GJo(),oo(),yIn=[new ko(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(kSn(e),!0,r,n,o)}),new ko(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(kSn(e),!1,r,n,o)})],EIn=new ko(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),_In={};tm(_In,{branchLocalTask:a(()=>WJo,"branchLocalTask"),branchTask:a(()=>VJo,"branchTask"),containsDeleteBranchCommand:a(()=>vIn,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>YJo,"deleteBranchTask"),deleteBranchesTask:a(()=>zJo,"deleteBranchesTask")});function vIn(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(vIn,"containsDeleteBranchCommand");function VJo(t){let e=vIn(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?QZe(o,s).all[0]:AIn(o,r)}}}a(VJo,"branchTask");function WJo(){return{format:"utf-8",commands:["branch","-v"],parser(t){return AIn(t)}}}a(WJo,"branchLocalTask");function zJo(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return QZe(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!mIn(String(o),r))return c(o);s(n)}}}a(zJo,"deleteBranchesTask");function YJo(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return QZe(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!mIn(String(c),n))return u(c);throw new _we(r.parser(Ewe(s),Ewe(o)),String(c))}};return r}a(YJo,"deleteBranchTask");var KJo=Zr({"src/lib/tasks/branch.ts"(){"use strict";jue(),HJo(),$Jo(),oo()}});function JJo(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,CIn.normalize)(e)}a(JJo,"toPath");var bIn,ZJo=Zr({"src/lib/responses/CheckIgnore.ts"(){"use strict";bIn=a(t=>t.split(/\n/g).map(JJo).filter(Boolean),"parseCheckIgnore")}}),SIn={};tm(SIn,{checkIgnoreTask:a(()=>XJo,"checkIgnoreTask")});function XJo(t){return{commands:["check-ignore",...t],format:"utf-8",parser:bIn}}a(XJo,"checkIgnoreTask");var eZo=Zr({"src/lib/tasks/check-ignore.ts"(){"use strict";ZJo()}});function tZo(t,e){return JC({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},TIn,[t,e])}a(tZo,"parseFetchResult");var TIn,rZo=Zr({"src/lib/parsers/parse-fetch.ts"(){"use strict";oo(),TIn=[new ko(/From (.+)$/,(t,[e])=>{t.remote=e}),new ko(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new ko(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new ko(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new ko(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,o])=>{t.updated.push({name:n,tracking:o,to:r,from:e})})]}}),IIn={};tm(IIn,{fetchTask:a(()=>iZo,"fetchTask")});function nZo(t){return/^--upload-pack(=|$)/.test(t)}a(nZo,"disallowedCommand");function iZo(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(nZo)?KC("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:tZo}}a(iZo,"fetchTask");var oZo=Zr({"src/lib/tasks/fetch.ts"(){"use strict";rZo(),nh()}});function sZo(t){return JC({moves:[]},xIn,t)}a(sZo,"parseMoveResult");var xIn,aZo=Zr({"src/lib/parsers/parse-move.ts"(){"use strict";oo(),xIn=[new ko(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),wIn={};tm(wIn,{moveTask:a(()=>cZo,"moveTask")});function cZo(t,e){return{commands:["mv","-v",...jO(t),e],format:"utf-8",parser:sZo}}a(cZo,"moveTask");var lZo=Zr({"src/lib/tasks/move.ts"(){"use strict";aZo(),oo()}}),RIn={};tm(RIn,{pullTask:a(()=>uZo,"pullTask")});function uZo(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 CGt(o,s)},onError(o,s,c,l){let u=AJo(Ewe(o.stdOut),Ewe(o.stdErr));if(u)return l(new _we(u));l(s)}}}a(uZo,"pullTask");var dZo=Zr({"src/lib/tasks/pull.ts"(){"use strict";jue(),ZTn(),oo()}});function fZo(t){let e={};return kIn(t,([r])=>e[r]={name:r}),Object.values(e)}a(fZo,"parseGetRemotes");function pZo(t){let e={};return kIn(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(pZo,"parseGetRemotesVerbose");function kIn(t,e){iGt(t,r=>e(r.split(/\s+/)))}a(kIn,"forEach");var hZo=Zr({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";oo()}}),PIn={};tm(PIn,{addRemoteTask:a(()=>mZo,"addRemoteTask"),getRemotesTask:a(()=>gZo,"getRemotesTask"),listRemotesTask:a(()=>AZo,"listRemotesTask"),remoteTask:a(()=>yZo,"remoteTask"),removeRemoteTask:a(()=>EZo,"removeRemoteTask")});function mZo(t,e,r){return Z_(["remote","add",...r,t,e])}a(mZo,"addRemoteTask");function gZo(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?pZo:fZo}}a(gZo,"getRemotesTask");function AZo(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),Z_(e)}a(AZo,"listRemotesTask");function yZo(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),Z_(e)}a(yZo,"remoteTask");function EZo(t){return Z_(["remote","remove",t])}a(EZo,"removeRemoteTask");var _Zo=Zr({"src/lib/tasks/remote.ts"(){"use strict";hZo(),nh()}}),DIn={};tm(DIn,{stashListTask:a(()=>vZo,"stashListTask")});function vZo(t={},e){let r=jTn(t),n=["stash","list",...r.commands,...e],o=FTn(r.splitter,r.fields,gGt(n));return UZe(n)||{commands:n,format:"utf-8",parser:o}}a(vZo,"stashListTask");var CZo=Zr({"src/lib/tasks/stash-list.ts"(){"use strict";Swe(),QTn(),vGt(),HTn()}}),NIn={};tm(NIn,{addSubModuleTask:a(()=>bZo,"addSubModuleTask"),initSubModuleTask:a(()=>SZo,"initSubModuleTask"),subModuleTask:a(()=>qZe,"subModuleTask"),updateSubModuleTask:a(()=>TZo,"updateSubModuleTask")});function bZo(t,e){return qZe(["add",t,e])}a(bZo,"addSubModuleTask");function SZo(t){return qZe(["init",...t])}a(SZo,"initSubModuleTask");function qZe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),Z_(e)}a(qZe,"subModuleTask");function TZo(t){return qZe(["update",...t])}a(TZo,"updateSubModuleTask");var IZo=Zr({"src/lib/tasks/sub-module.ts"(){"use strict";nh()}});function xZo(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?MIn(t,e):0}a(xZo,"singleSorted");function MIn(t,e){return t===e?0:t>e?1:-1}a(MIn,"sorted");function wZo(t){return t.trim()}a(wZo,"trimmed");function bZe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(bZe,"toNumber");var PSn,OIn,RZo=Zr({"src/lib/responses/TagList.ts"(){"use strict";PSn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},OIn=a(function(t,e=!1){let r=t.split(` -`).map(wZo).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return xZo(bZe(c[0]),bZe(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new PSn(r,n)},"parseTagList")}}),LIn={};tm(LIn,{addAnnotatedTagTask:a(()=>DZo,"addAnnotatedTagTask"),addTagTask:a(()=>PZo,"addTagTask"),tagListTask:a(()=>kZo,"tagListTask")});function kZo(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return OIn(r,e)}}}a(kZo,"tagListTask");function PZo(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(PZo,"addTagTask");function DZo(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(DZo,"addAnnotatedTagTask");var NZo=Zr({"src/lib/tasks/tag.ts"(){"use strict";RZo()}}),MZo=JYo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(LKo(),rh(wTn)),{SimpleGitApi:n}=(LJo(),rh(lIn)),{Scheduler:o}=(BJo(),rh(uIn)),{adhocExecTask:s,configurationErrorTask:c}=(nh(),rh(WHt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(oo(),rh(JSn)),{applyPatchTask:E}=(UJo(),rh(pIn)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:b,deleteBranchTask:T}=(KJo(),rh(_In)),{checkIgnoreTask:w}=(eZo(),rh(SIn)),{checkIsRepoTask:R}=(tTn(),rh(ZSn)),{cleanWithOptionsTask:x,isCleanOptionsArray:P}=(fTn(),rh(uTn)),{diffSummaryTask:D}=(vGt(),rh(qTn)),{fetchTask:N}=(oZo(),rh(IIn)),{moveTask:L}=(lZo(),rh(wIn)),{pullTask:B}=(dZo(),rh(RIn)),{pushTagsTask:q}=(rIn(),rh(tIn)),{addRemoteTask:M,getRemotesTask:O,listRemotesTask:j,remoteTask:Q,removeRemoteTask:U}=(_Zo(),rh(PIn)),{getResetMode:Y,resetTask:W}=(STn(),rh(vTn)),{stashListTask:V}=(CZo(),rh(DIn)),{addSubModuleTask:z,initSubModuleTask:ie,subModuleTask:H,updateSubModuleTask:re}=(IZo(),rh(NIn)),{addAnnotatedTagTask:le,addTagTask:Le,tagListTask:ge}=(NZo(),rh(LIn)),{straightThroughBufferTask:Ue,straightThroughStringTask:ke}=(nh(),rh(WHt));function X(ee,K){this._plugins=K,this._executor=new r(ee.baseDir,new o(ee.maxConcurrentProcesses),K),this._trimmed=ee.trimmed}a(X,"Git2"),(X.prototype=Object.create(n.prototype)).constructor=X,X.prototype.customBinary=function(ee){return this._plugins.reconfigure("binary",ee),this},X.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},X.prototype.stashList=function(ee){return this._runTask(V(y(arguments)||{},u(ee)&&ee||[]),A(arguments))},X.prototype.mv=function(ee,K){return this._runTask(L(ee,K),A(arguments))},X.prototype.checkoutLatestTag=function(ee){var K=this;return this.pull(function(){K.tags(function(he,Z){K.checkout(Z.latest,ee)})})},X.prototype.pull=function(ee,K,he,Z){return this._runTask(B(m(ee,f),m(K,f),g(arguments)),A(arguments))},X.prototype.fetch=function(ee,K){return this._runTask(N(m(ee,f),m(K,f),g(arguments)),A(arguments))},X.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.")))},X.prototype.tags=function(ee,K){return this._runTask(ge(g(arguments)),A(arguments))},X.prototype.rebase=function(){return this._runTask(ke(["rebase",...g(arguments)]),A(arguments))},X.prototype.reset=function(ee){return this._runTask(W(Y(ee),g(arguments)),A(arguments))},X.prototype.revert=function(ee){let K=A(arguments);return typeof ee!="string"?this._runTask(c("Commit must be a string"),K):this._runTask(ke(["revert",...g(arguments,0,!0),ee]),K)},X.prototype.addTag=function(ee){let K=typeof ee=="string"?Le(ee):c("Git.addTag requires a tag name");return this._runTask(K,A(arguments))},X.prototype.addAnnotatedTag=function(ee,K){return this._runTask(le(ee,K),A(arguments))},X.prototype.deleteLocalBranch=function(ee,K,he){return this._runTask(T(ee,typeof K=="boolean"?K:!1),A(arguments))},X.prototype.deleteLocalBranches=function(ee,K,he){return this._runTask(b(ee,typeof K=="boolean"?K:!1),A(arguments))},X.prototype.branch=function(ee,K){return this._runTask(_(g(arguments)),A(arguments))},X.prototype.branchLocal=function(ee){return this._runTask(v(),A(arguments))},X.prototype.raw=function(ee){let K=!Array.isArray(ee),he=[].slice.call(K?arguments:ee,0);for(let ue=0;ueconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},X.prototype.checkIgnore=function(ee,K){return this._runTask(w(l(m(ee,h,[]))),A(arguments))},X.prototype.checkIsRepo=function(ee,K){return this._runTask(R(m(ee,f)),A(arguments))},e.exports=X}});Lq();var OZo=class extends oF{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};Lq();Lq();var que=class extends oF{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};jue();BSn();tTn();fTn();mTn();ATn();_Tn();STn();function LZo(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new que(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new que(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(LZo,"abortPlugin");function BZo(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of iSn(e,r))if(t[n.category]!==!0)throw new que(void 0,"unsafe",n.message);return e}}}a(BZo,"blockUnsafeOperationsPlugin");oo();function FZo(t){let e=ywe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(FZo,"commandConfigPrefixingPlugin");oo();var DSn=(0,Uue.deferred)().promise;function UZo({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,Uue.deferred)(),closeTimeout:(0,Uue.deferred)(),exit:(0,Uue.deferred)(),exitTimeout:(0,Uue.deferred)()},c=Promise.race([t===!1?DSn:s.closeTimeout.promise,e===!1?DSn: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(()=>qHt(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 qHt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(UZo,"completionDetectionPlugin");oo();var QZo="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",NSn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function qZo(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a(qZo,"isBadArgument");function MSn(t,e){if(t.length<1||t.length>2)throw new que(void 0,"binary",QZo);if(t.some(qZo))if(e)console.warn(NSn);else throw new que(void 0,"binary",NSn);let[n,o]=t;return{binary:n,prefix:o}}a(MSn,"toBinaryConfig");function jZo(t,e=["git"],r=!1){let n=MSn(jO(e),r);t.on("binary",o=>{n=MSn(jO(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(jZo,"customBinaryPlugin");Lq();function HZo(t){return!!(t.exitCode&&t.stdErr.length)}a(HZo,"isTaskError");function GZo(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(GZo,"getErrorMessage");function $Zo(t=!1,e=HZo,r=GZo){return(n,o)=>!t&&n||!e(o)?n:r(o)}a($Zo,"errorDetectionHandler");function OSn(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 oF(void 0,n.toString("utf-8"))}:{error:n}}}}a(OSn,"errorDetectionPlugin");oo();var VZo=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new BIn.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=cw(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return jO(t).forEach(r=>r&&this.plugins.add(cw(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}};oo();function WZo(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?HSn(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:zZo(u[1]),progress:Eu(u[2]),processed:Eu(u[3]),total:Eu(u[4])})})}}]}a(WZo,"progressMonitorPlugin");function zZo(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(zZo,"progressEventStage");oo();function YZo(t){let e=$Sn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(YZo,"spawnOptionsPlugin");function KZo({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 que(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(KZo,"timeoutPlugin");function JZo(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;oow(c)&&Mue(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a(JZo,"suffixPathsPlugin");oo();var ZZo=MZo();function XZo(t,e){let r=new VZo,n=YSn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!oGt(n.baseDir))throw new OZo(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(FZo(n.config)),r.add(BZo(n.unsafe)),r.add(UZo(n.completion)),n.abort&&r.add(LZo(n.abort)),n.progress&&r.add(WZo(n.progress)),n.timeout&&r.add(KZo(n.timeout)),n.spawnOptions&&r.add(YZo(n.spawnOptions)),r.add(JZo()),r.add(OSn($Zo(!0))),n.errors&&r.add(OSn(n.errors)),jZo(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new ZZo(n,r)}a(XZo,"gitInstanceFactory");jue();var Gue=XZo;var lw=new fe("Git Service");var jZe=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 lO()).path;n=Gue({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,UIn.join)(n,r);return Ks(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,FIn.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 QIn=de(nl());var e2=new fe("Local Diff Tracker");var HZe=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._gitService=new jZe(e),this._repositoryManager=e.get(_f),this._diffRefreshTimer=new QIn.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{e2.info(this.ctx,"Initializing Local Diff Tracker"),await this._workspaceFileIndex.initialize();let e=a(n=>{for(let o of n)this._locallyChangedFiles.add(o)},"addFiles");this._fileWatcherDisposables.push(this._workspaceFileIndex.onDidCreateFiles(e),this._workspaceFileIndex.onDidChangeFiles(e),this._workspaceFileIndex.onDidDeleteFiles(n=>{for(let o of n)this._locallyChangedFiles.delete(o)}));let r=await this._repositoryManager.getRepo({uri:this._workspaceFileIndex.workspaceFolder.uri});r||(r=await this.tryInferRepoFromFiles()),r&&r.isGitHub()&&r.owner&&r.name?await this.openRepo(r):e2.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`)}catch(e){e2.error(this.ctx,"Initialization 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){e2.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)&&e2.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?e2.warn(this.ctx,n,o):e2.warn(this.ctx,n):o!==void 0?e2.debug(this.ctx,n,o):e2.debug(this.ctx,n)}dispose(){this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var Bq;(n=>{function t(o){return new TGt(o)}n.ok=t,a(t,"ok");function e(o){return new IGt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(Bq||={});var TGt=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}},IGt=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 xGt=new fe("GithubAvailableEmbeddingTypes"),GZe=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Qt).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):Bq.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):Bq.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=Pue(this._ctx);r=await Gf(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return xGt.error(this._ctx,"Error fetching available embedding types",c),Bq.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?Bq.error({type:"unauthorized",status:r.status}):Bq.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new $C(c.id);c.active===!1?s.push(l):o.push(l)}return Bq.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){xGt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return xGt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var eXo=new fe("GithubEmbeddingComputer"),$ue=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){eXo.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 Gf(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 $C(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 Twe=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var qIn=de(NA()),jIn=de(dU()),HIn=require("os"),wGt=de(require("path")),Vue=require("process");function $Ze(t){let e=un(t.workspaceFolder.uri),r=(0,qIn.basename)(e),o=(0,jIn.SHA256)(e).toString().substring(0,8);return wGt.default.join(tXo(),"project-index",`${r}.${o}`)}a($Ze,"getWorkspaceCachePath");function tXo(){return Vue.env.XDG_CACHE_HOME&&wGt.default.isAbsolute(Vue.env.XDG_CACHE_HOME)?Vue.env.XDG_CACHE_HOME+"/github-copilot":(0,HIn.platform)()==="win32"?Vue.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":Vue.env.HOME+"/.cache/github-copilot"}a(tXo,"getXdgCachePath");p();p();function GIn(t){if(Jqt(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(RGt,"unpackEmbedding");p();var $In=de(nl()),VIn=de(zP()),PGt=de(eh()),WIn=de(require("fs")),DGt=de(require("node:sqlite")),NGt=de(require("path"));var kGt=new fe("WorkspaceChunkAndEmbeddingCache");async function zIn(t,e,r,n){return await MGt.create(t,e,r??":memory:",n)}a(zIn,"createWorkspaceChunkAndEmbeddingCache");var MGt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new VIn.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 d=NGt.default.join(n,"workspace-chunks.db");try{await WIn.default.promises.mkdir(NGt.default.dirname(d),{recursive:!0}),c=new DGt.default.DatabaseSync(d,s),kGt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${d}`)}catch(f){kGt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",f)}}c||(c=new DGt.default.DatabaseSync(":memory:",s),kGt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` +`)}a(Pqt,"applyEditsToDocument");var yue=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 wo.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(kA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},mJe=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 Eq(e.ctx),u=await e.ctx.get(el).getBestChatModelConfig(wS(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(kA).toPrompt(e,d)}async processResponse(e){let r=[],n=Pn(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(lE);if(r)return r}async getDocumentIfValid(e){let r=await this.ctx.get(ii).getOrReadTextDocument({uri:e});if(r.status==="valid")return r.document}async processInlineResponse(e,r){let o=kqt(e,r).filter(c=>Rqt.includes(c.mode)),s=Pqt(o,r);if(s)return await this.ctx.get(zh).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return kqt(e,r)}};var gJe=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 yue(e.ctx);return new hJe(e,r)}};p();p();p();p();function jCn(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(jCn,"filterUnsupportedReferences");function HCn(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(HCn,"convertToCopilotReferences");var GCn=S.Object({type:S.Literal("github.web-search"),id:S.String(),data:S.Object({query:S.String(),type:S.String(),results:S.Optional(S.Array(S.Object({title:S.String(),excerpt:S.String(),url:S.String()})))}),metadata:S.Optional(S.Object({display_name:S.Optional(S.String()),display_icon:S.Optional(S.String())}))});var xq=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,jCn(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 NO=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(Ur).resolveSession(),s;if(o&&new URL(o.serverUrl).hostname===n)s=o;else{let u=await this.ctx.get(ox).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(nr).fetch(l,{method:"GET",headers:c})}};p();p();var $Cn=S.Object({name:S.String(),url:S.String()}),VCn=S.Object({path:S.String(),head:S.Optional(S.Object({name:S.String(),upstream:S.Optional($Cn)})),remotes:S.Optional(S.Array($Cn))}),Dqt=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(MO,"git repository information");let r=[];return r.push([new Ar(["Metadata about the current git repository:"]),1]),e.head&&e.head.name?(r.push([new Ar([`- Current branch name: ${e.head.name}`]),1]),e.head.upstream&&r.push([new Ar([`- Upstream name and url: ${e.head.upstream.name} - ${e.head.upstream.url}`]),1])):r.push([new Ar(["- Detached HEAD: yes"]),1]),e.remotes&&e.remotes.length>0&&r.push([new Ar([`- Remotes: ${e.remotes.map(n=>n.name).join(", ")}`]),1]),new Ar(r)}},MO="git-metadata",AJe=class extends gg{static{a(this,"GitMetadataSkill")}constructor(e){super(MO,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new Dqt(r))}};async function WCn(t){let e=await t.skillResolver.resolve(lE);if(e){let c=e.uri,l=AQ(t.ctx,c);if(Tdn(l))return{repoInfo:l,skillUsed:lE}}let r=await t.skillResolver.resolve(MO);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=y8t(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:MO}}a(WCn,"extractRepoInfo");async function zCn(t){let e=[];return await RHo(t,e),await kHo(t,e),await PHo(t,e),e}a(zCn,"skillsToReference");async function RHo(t,e){let r=await DHo(t);r&&e.push(r)}a(RHo,"addRepositoryReference");async function kHo(t,e){let r=await NHo(t);r&&e.push(r)}a(kHo,"addSelectionReference");async function PHo(t,e){let r=[],n=await OHo(t);n&&r.push(n),r.push(...await LHo(t)),r.length>0&&e.push(...r)}a(PHo,"addFileReferences");async function DHo(t){let e=await WCn(t);if(e){let r=t.ctx.get(NO),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(DHo,"gitMetadataToReference");async function NHo(t){let e=await t.skillResolver.resolve(lE);if(e&&e.selection){let n=await t.ctx.get(ii).getOrReadTextDocument(e),o=td(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return MHo(e,n.document)}}a(NHo,"currentEditorToSelectionReference");function MHo(t,e){if(t.selection&&!uue(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(MHo,"extractSelection");async function OHo(t){let e=await t.skillResolver.resolve(lE);if(e){let n=await t.ctx.get(ii).getOrReadTextDocument(e),o=td(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(OHo,"currentEditorToFileReference");async function LHo(t){let e=[],r=t.turn.request.references;if(r&&r.length>0){let n=t.ctx.get(ii);for(let o of r)if(o.type==="file"){let s=await n.getOrReadTextDocument(o),c=td(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(LHo,"fileReferenceToPlatformFileReference");p();Oo();var BHo=new fe("ChatFetchResultPostProcessor"),Eue=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(byn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s),await this.turnContext.ctx.get(zh).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:Pn(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"},BHo.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:V_.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===W_,copilotPlan:ix(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}=wo.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},Syn(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:Pn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new Sq(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:Mt(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return wyn(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",Tyn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var yJe=S.Union([S.String(),S.Number()]),WK=S.Union([S.String(),S.Number()]),FHo=S.Union([S.Literal("included"),S.Literal("blocked"),S.Literal("notfound"),S.Literal("empty")]),EJe=S.Object({uri:S.String(),position:S.Optional(c0)}),UHo=S.Object({type:S.Literal("file"),uri:S.String(),position:S.Optional(c0),visibleRange:S.Optional(Sf),selection:S.Optional(Sf),status:S.Optional(FHo),range:S.Optional(Sf)}),QHo=S.Object({type:S.Literal("directory"),uri:S.String()}),qHo=S.Object({type:S.Literal("tool"),uri:S.String(),name:S.Optional(S.String()),server:S.Optional(S.String()),description:S.Optional(S.String())}),OO=S.Union([UHo,QHo,GCn,qHo]),LO=S.Union([S.Literal("panel"),S.Literal("inline")]),jHo=S.Union([S.Object({type:S.Literal("text"),text:S.String()}),S.Object({type:S.Literal("image_url"),imageUrl:S.Object({url:S.String(),detail:S.Optional(S.Union([S.Literal("low"),S.Literal("high")]))})})]),Nqt=S.Union([S.String(),S.Array(jHo)]),YCn=S.Object({request:Nqt,response:S.Optional(S.String()),agentSlug:S.Optional(S.String()),turnId:S.Optional(WK),model:S.Optional(S.String())});function _Je(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(_Je,"convertToMessageContent");function vJe(t,e){if(t=VS(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(vJe,"appendToMessage");var CJe=S.Union([S.Literal("Ask"),S.Literal("Agent"),S.Literal("InlineAgent")]),HHo=S.Object({type:S.String(),description:S.String()}),KCn=S.Object({name:S.String(),description:S.String(),inputSchema:S.Optional(S.Object({type:S.String(),properties:S.Record(S.String(),HHo),required:S.Array(S.String())})),confirmationMessages:S.Optional(S.Object({title:S.String(),message:S.String()}))}),Bc=S.Object({uri:S.String(),name:S.String()}),GHo=S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")]),bJe=S.Object({id:S.Number(),title:S.String(),description:S.Optional(S.String()),status:GHo});Oo();var Mqt="generate-response",SJe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},Gxe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(r.ctx),this.postProcessor=new Eue(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 SJe?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 tl(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(zh).inspectPrompt(l),await n.steps.start(Mqt,"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:VS(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 Mt()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return qQt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:VS(r.request.message)}),r.response&&r.response.type==="model"){let o=HCn(r.response.references);n.push({role:"assistant",content:VS(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await zCn(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 xq((h,m,g,A,y,E)=>{let _=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:_,thinking:E}),this.turn.response?(this.turn.response.message=vJe(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??[]),_&&(this.turn.confirmationRequest=_)}),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:Pn(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()),Pn(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 SJe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return cxe(this.conversation,"conversationPanel",Pn(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(Mqt,e.error.message):await r.steps.finish(Mqt)}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 $xe=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 Gxe(this,e)}},TJe=class extends $xe{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 Gxe(this,e)}};p();var $Ho="github",zP=class{static{a(this,"RemoteAgentRegistry")}},IJe=class extends zP{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 DY(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Nr.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)||Nr.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Nr.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==$Ho).map(o=>new $xe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var JCn=de(require("fs")),Y_=de(require("path"));var Oqt=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],Lqt="test_",Vxe={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"}},Wxe=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=Ji(e),n=Y_.extname(r).replace(".",""),o=Vxe[n]??{location:"sameFolder",prefix:Lqt,suffix:Oqt},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=rs(uf(e)),l===void 0)return}else{let d=rs(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=Y_.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=Ks(l);if(await this.fileExists(u))return xa(u,s[0])}parseTestFilePath(e){try{return Ks(e)}catch(r){Nr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=Ji(e),n=Y_.extname(r).replace(".",""),o=Vxe[n]??{location:"sameFolder",prefix:Lqt,suffix:Oqt},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=uf(e):l=this.determineImplFolder(e);for(let u of s){let d=xa(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=rs(e);if(r===void 0)return;let n=Y_.extname(Ji(e)).replace(".",""),o,s=Vxe[n]?.location??"sameFolder";s==="sameFolder"?o=Y_.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,Vxe[n]);if(c.length>0)return Ks(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${Y_.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 JCn.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&rs(this.baseUri))??"",o=Y_.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(Y_.sep)}getRelativeTestFolder(e,r,n,o){let s=Y_.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=Y_.extname(Ji(e)).replace(".",""),n=uf(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 zxe(t){let e=Ji(t),r=Y_.extname(e),n=Vxe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(Oqt.some(s=>e.endsWith(s+r))||e.startsWith(Lqt))}a(zxe,"isTestFile");p();var Bqt=class extends Error{static{a(this,"UserQueryParserError")}constructor(e){super(String(e),{cause:e}),this.name="UserQueryParserError"}};async function ZCn(t,e){let r=t.ctx,n=await wo.getModelConfiguration(r,"synonyms",{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(kA).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 oc(r),u=await tl(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:"";Qa(r,new Bqt(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"UserQueryParser.parseUserQuery")}}a(ZCn,"parseUserQuery");p();p();p();p();var Ko=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 Ko(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new Ko(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 XCn=250;function PA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/XCn)),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(PA,"getMaxChunks");var ebn=32e3,tbn=2e4,Yxe=.75;p();p();function DA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(DA,"getFenceForCodeBlock");p();var F1n=de(Sl()),U1n=de(eh());p();var $C=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 t$o=Object.freeze({[$C.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[$C.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function Zqt(t){return t$o[t.id]}a(Zqt,"getWellKnownEmbeddingTypeInfo");function r$o(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:Kxe(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(pbn,"rankEmbeddings");p();p();var iF=de(nl()),B1n=de(eh());var qO=new fe("GitHubCodeSearch"),Wzo=300*1e3,gZe=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new iF.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()},Wzo)}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),qO.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){qO.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(qO.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),qO.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){qO.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,iF.raceTimeout)((async()=>{if(!await(0,iF.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,iF.raceCancellationError)((0,iF.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 qO.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 Gf(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return qO.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return qO.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=Pue(this._ctx),c=n.owner+"/"+n.name,l=await Gf(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(qO.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=Pue(this._ctx),u=await Gf(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:Yzo(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 zzo(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function Pue(t){let e=t.get(Ir);return{"X-Client-Application":`${M1(e.getEditorInfo())}`,"X-Client-Source":M1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(Pue,"editorVersionHeaders");async function zzo(t,e,r){let o=[],s=new $C(e.embedding_model),c=Fs(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=xa(c,l.location.path)}catch(d){qO.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:AZe(l.chunk.text),rawText:void 0,range:new B1n.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(zzo,"parseGithubCodeSearchResponse");function Yzo(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(Yzo,"truncateToMaxUtf8Length");function AZe(t){let e=Kzo(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` +`):t}a(AZe,"stripChunkTextMetadata");function Kzo(t){return t.split(/\r\n|\r|\n/)}a(Kzo,"splitLines");var e2=de(nl()),Q1n=de(vue()),q1n=de(em());var mwe=new fe("ChunkingEndpointClient"),RHt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new Q1n.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 e2.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,e2.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,e2.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,e2.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){mwe.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{mwe.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{mwe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},yZe=class{constructor(e){this.ctx=e;this._requestLimiter=new RHt(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,e2.raceCancellationError)(n.getText(),l);if((0,q1n.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=Pue(this.ctx);return await Gf(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:rs(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,e2.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){mwe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,F1n.coalesce)(h.chunks.map(m=>{let g=new U1n.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:AZe(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 E=new $C(h.embedding_model);if(!E.equals(r))throw new Error(`Unexpected embedding model. Got: ${E.id}. Expected: ${r.id}`);y={type:E,value:new Float32Array(m.embedding.embedding)}}if(!(s.computeEmbeddings&&!y))return{chunk:{file:n.uri.toString(),text:AZe(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){mwe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var fE={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},f0=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=Wt.createAndMarkAsIssued(s,o);Et(e,r,c),At(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};Qa(e,n,r,o),Vn(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,fE.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,fE.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,fE.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,fE.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,fE.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,fE.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,fE.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,fE.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=Wt.createAndMarkAsIssued(o,{});Et(e,r,s),At(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,fE.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,fE.Aggregate,r)}};var j1n=de(Sl()),H1n=de(nl()),kHt=de(FO());var oF=new fe("Remote Search"),EZe=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(_f),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 kHt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(oF.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(P=>`${P.owner}/${P.name}`),maxResults:PA(r)}),s.length===0)throw oF.error(this.ctx,"No GitHub repositories found"),f0.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 oF.error(this.ctx,"No GitHub session found"),f0.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 oF.error(this.ctx,"Remote index not ready for any repositories"),f0.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=PA(r),d=Promise.all(l.map(async P=>{Hh(n);let D=await e.resolveQuery(n),N=new kHt.StopWatch,L=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,P,D,u,n);return oF.info(this.ctx,`Search completed for ${P.owner}/${P.name}`,{searchTime:N.elapsed(),chunkCount:L.chunks.length}),L})),f=await this._localDiffSearch.getLocalDiff(r.workspaceFolders),h=new Set(f),m=this._localDiffSearch.shouldDoLocalDiffSearch(f,r.workspaceFolders);oF.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,H1n.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{oF.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(P=>{oF.error(this.ctx,"Local diff search failed",P)})??Promise.resolve(void 0)]),E=(0,j1n.coalesce)(A).flatMap(P=>P.chunks),_=y?.isOk()?y.val.result.chunks:[],v=_.length>0?[...E.filter(P=>!h.has(P.chunk.file)),..._]:E,b=v.length,w=new Set(v.map(P=>P.chunk.file)).size,R=o.elapsed();oF.info(this.ctx,`Search completed successfully in ${R}ms`,{totalTime:R,totalChunkCount:b,uniqueFileCount:w,indexedRepoCount:l.length,localDiffChunkCount:_.length,localDiffStrategy:y?.isOk()?y.val.strategy:"none"});let x=y?.isOk()?"mixed":"codesearch";return f0.sendRemoteSuccess(this.ctx,R,b,w,x),{chunks:v}}};p();p();var UIn=require("node:url"),QIn=require("path");p();var OZe=de($1n(),1);p();var PHt=new WeakMap;function Nue(...t){let e=new String(t);return PHt.set(e,t),e}a(Nue,"c");function sw(t){return t instanceof String&&PHt.has(t)}a(sw,"r");function Mue(t){return PHt.get(t)??[]}a(Mue,"o");var NZe=de(Z1n(),1),wTn=require("child_process");var fIn=de(OHt(),1),bIn=require("node:path");p();function*X1n(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(X1n,"U");var bYo=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),SYo=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),TYo=new Set(["edit","remove-section","rename-section","set","unset"]),IYo=new Set(["get","get-color","get-colorbool","list"]);function xYo(t,e){for(let{name:n}of X1n(t,"task")){if(bYo.has(n))return Fue(!0,e);if(SYo.has(n))return Fue(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:TYo.has(r)?Fue(!0,e.slice(1)):IYo.has(r)?Fue(!1,e.slice(1)):e.length===1?Fue(!1,e):Fue(!0,e)}a(xYo,"F");function Fue(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(Fue,"p");function wYo(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(wYo,"A");function RYo(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(RYo,"M");function kYo(t){for(let{name:e}of X1n(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(kYo,"N");function PYo({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(PYo,"G");function*DYo(t){for(let e of t){let r=PYo(e),n=r&&RYo(e.value);n&&(yield{...n,scope:r})}}a(DYo,"O");function NYo(t,e,r){let n={read:[],write:[...DYo(e)]};return t==="config"&&MYo(n,kYo(e),xYo(e,r)),n}a(NYo,"L");function MYo(t,e,r){if(r===null)return;let n=wYo(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(MYo,"$");var eSn={short:new Map([["c",!0]])},OYo={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...eSn.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},LYo={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"])}},BYo={short:new Map,long:new Set};function FYo(t){let e=LYo[t??""]??BYo;return{short:new Map([...eSn.short.entries(),...e.short.entries()]),long:e.long}}a(FYo,"I");function tSn(t,e=OYo){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 UYo(t,e.short)}a(tSn,"b");function UYo(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(UYo,"W");function QYo(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[iGt(t)[0]])(t=0)),e},"__init"),"__esm"),tKo=a((t,e)=>a(function(){return e||(0,t[iGt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),tm=a((t,e)=>{for(var r in e)nGt(t,r,{get:e[r],enumerable:!0})},"__export"),rKo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of iGt(e))!eKo.call(t,o)&&o!==r&&nGt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=XYo(e,o))||n.enumerable});return t},"__copyProps"),rh=a(t=>rKo(nGt({},"__esModule",{value:!0}),t),"__toCommonJS"),sF,Bq=Zr({"src/lib/errors/git-error.ts"(){"use strict";sF=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),_we,jue=Zr({"src/lib/errors/git-response-error.ts"(){"use strict";Bq(),_we=class extends sF{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),BSn,FSn=Zr({"src/lib/errors/task-configuration-error.ts"(){"use strict";Bq(),BSn=class extends sF{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function USn(t){return typeof t!="function"?sJ:t}a(USn,"asFunction");function QSn(t){return typeof t=="function"&&t!==sJ}a(QSn,"isUserFunction");function qSn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(qSn,"splitOn");function jSn(t,e=0){return HSn(t)&&t.length>e?t[e]:void 0}a(jSn,"first");function oJ(t,e=0){if(HSn(t)&&t.length>e)return t[t.length-1-e]}a(oJ,"last");function HSn(t){return UZe(t)}a(HSn,"isArrayLike");function vwe(t="",e=!0,r=` +`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(vwe,"toLinesWithContent");function oGt(t,e){return vwe(t,!0).map(r=>e(r))}a(oGt,"forEachLineWithContent");function sGt(t){return(0,OZe.exists)(t,OZe.FOLDER)}a(sGt,"folderExists");function lw(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(lw,"append");function GSn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(GSn,"including");function LZe(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(LZe,"remove");function jO(t){return Array.isArray(t)?t:[t]}a(jO,"asArray");function $Sn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a($Sn,"asCamelCase");function Hue(t){return jO(t).map(e=>e instanceof String?e:String(e))}a(Hue,"asStringArray");function Eu(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(Eu,"asNumber");function ywe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a(VSn,"pick");function jHt(t=0){return new Promise(e=>setTimeout(e,t))}a(jHt,"delay");function HHt(t){if(t!==!1)return t}a(HHt,"orVoid");var Que,sJ,Cwe,BZe=Zr({"src/lib/utils/util.ts"(){"use strict";aGt(),Que="\0",sJ=a(()=>{},"NOOP"),Cwe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function pE(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(pE,"filterType");function GHt(t,e){let r=sw(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(GHt,"filterPrimitives");function FZe(t){return!!t&&Cwe(t)==="[object Object]"}a(FZe,"filterPlainObject");function WSn(t){return typeof t=="function"}a(WSn,"filterFunction");var bwe,zSn,lp,PZe,UZe,aGt=Zr({"src/lib/utils/argument-filters.ts"(){"use strict";BZe(),bwe=a(t=>Array.isArray(t),"filterArray"),zSn=a(t=>typeof t=="number","filterNumber"),lp=a(t=>typeof t=="string"||sw(t),"filterString"),PZe=a(t=>lp(t)||Array.isArray(t)&&t.every(lp),"filterStringOrStringArray"),UZe=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),$Ht,nKo=Zr({"src/lib/utils/exit-codes.ts"(){"use strict";$Ht=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))($Ht||{})}}),DZe,iKo=Zr({"src/lib/utils/git-output-streams.ts"(){"use strict";DZe=class YSn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new YSn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function oKo(){throw new Error("LineParser:useMatches not implemented")}a(oKo,"useMatchesDefault");var Po,Lq,sKo=Zr({"src/lib/utils/line-parser.ts"(){"use strict";Po=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=oKo,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))}},Lq=class extends Po{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 KSn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...JSn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(KSn,"createInstanceConfig");var JSn,aKo=Zr({"src/lib/utils/simple-git-options.ts"(){"use strict";JSn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function cGt(t,e=[]){return FZe(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(sw(o))r.push(o);else if(GHt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)GHt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(cGt,"appendTaskOptions");function Z_(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=vwe(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(JC,"parseStringResponse");var uKo=Zr({"src/lib/utils/task-parser.ts"(){"use strict";BZe()}}),ZSn={};tm(ZSn,{ExitCodes:a(()=>$Ht,"ExitCodes"),GitOutputStreams:a(()=>DZe,"GitOutputStreams"),LineParser:a(()=>Po,"LineParser"),NOOP:a(()=>sJ,"NOOP"),NULL:a(()=>Que,"NULL"),RemoteLineParser:a(()=>Lq,"RemoteLineParser"),append:a(()=>lw,"append"),appendTaskOptions:a(()=>cGt,"appendTaskOptions"),asArray:a(()=>jO,"asArray"),asCamelCase:a(()=>$Sn,"asCamelCase"),asFunction:a(()=>USn,"asFunction"),asNumber:a(()=>Eu,"asNumber"),asStringArray:a(()=>Hue,"asStringArray"),bufferToString:a(()=>Ewe,"bufferToString"),callTaskParser:a(()=>VHt,"callTaskParser"),createInstanceConfig:a(()=>KSn,"createInstanceConfig"),delay:a(()=>jHt,"delay"),filterArray:a(()=>bwe,"filterArray"),filterFunction:a(()=>WSn,"filterFunction"),filterHasLength:a(()=>UZe,"filterHasLength"),filterNumber:a(()=>zSn,"filterNumber"),filterPlainObject:a(()=>FZe,"filterPlainObject"),filterPrimitives:a(()=>GHt,"filterPrimitives"),filterString:a(()=>lp,"filterString"),filterStringOrStringArray:a(()=>PZe,"filterStringOrStringArray"),filterType:a(()=>pE,"filterType"),first:a(()=>jSn,"first"),folderExists:a(()=>sGt,"folderExists"),forEachLineWithContent:a(()=>oGt,"forEachLineWithContent"),getTrailingOptions:a(()=>Z_,"getTrailingOptions"),including:a(()=>GSn,"including"),isUserFunction:a(()=>QSn,"isUserFunction"),last:a(()=>oJ,"last"),objectToString:a(()=>Cwe,"objectToString"),orVoid:a(()=>HHt,"orVoid"),parseStringResponse:a(()=>JC,"parseStringResponse"),pick:a(()=>VSn,"pick"),prefixedArray:a(()=>ywe,"prefixedArray"),remove:a(()=>LZe,"remove"),splitOn:a(()=>qSn,"splitOn"),toLinesWithContent:a(()=>vwe,"toLinesWithContent"),trailingFunctionArgument:a(()=>Qd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>lGt,"trailingOptionsArgument")});var oo=Zr({"src/lib/utils/index.ts"(){"use strict";aGt(),nKo(),iKo(),sKo(),aKo(),lKo(),uKo(),BZe()}}),XSn={};tm(XSn,{CheckRepoActions:a(()=>WHt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>tTn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>eTn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>dKo,"checkIsRepoTask")});function dKo(t){switch(t){case"bare":return tTn();case"root":return eTn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:QZe,parser:uGt}}a(dKo,"checkIsRepoTask");function eTn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:QZe,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(eTn,"checkIsRepoRootTask");function tTn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:QZe,parser:uGt}}a(tTn,"checkIsBareRepoTask");function fKo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(fKo,"isNotRepoMessage");var WHt,QZe,uGt,rTn=Zr({"src/lib/tasks/check-is-repo.ts"(){"use strict";oo(),WHt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(WHt||{}),QZe=a(({exitCode:t},e,r,n)=>{if(t===128&&fKo(e))return r(Buffer.from("false"));n(e)},"onError"),uGt=a(t=>t.trim()==="true","parser")}});function pKo(t,e){let r=new nTn(t),n=t?oTn:iTn;return vwe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(sTn.test(s)?r.folders:r.files).push(s)}),r}a(pKo,"cleanSummaryParser");var nTn,iTn,oTn,sTn,hKo=Zr({"src/lib/responses/CleanSummary.ts"(){"use strict";oo(),nTn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},iTn=/^[a-z]+\s*/i,oTn=/^[a-z]+\s+[a-z]+\s*/i,sTn=/\/$/}}),zHt={};tm(zHt,{EMPTY_COMMANDS:a(()=>qZe,"EMPTY_COMMANDS"),adhocExecTask:a(()=>aTn,"adhocExecTask"),configurationErrorTask:a(()=>KC,"configurationErrorTask"),isBufferTask:a(()=>lTn,"isBufferTask"),isEmptyTask:a(()=>uTn,"isEmptyTask"),straightThroughBufferTask:a(()=>cTn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>X_,"straightThroughStringTask")});function aTn(t){return{commands:qZe,format:"empty",parser:t}}a(aTn,"adhocExecTask");function KC(t){return{commands:qZe,format:"empty",parser(){throw typeof t=="string"?new BSn(t):t}}}a(KC,"configurationErrorTask");function X_(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(X_,"straightThroughStringTask");function cTn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(cTn,"straightThroughBufferTask");function lTn(t){return t.format==="buffer"}a(lTn,"isBufferTask");function uTn(t){return t.format==="empty"||!t.commands.length}a(uTn,"isEmptyTask");var qZe,nh=Zr({"src/lib/tasks/task.ts"(){"use strict";FSn(),qZe=[]}}),dTn={};tm(dTn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>dGt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>fGt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>pGt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>xZe,"CleanOptions"),cleanTask:a(()=>fTn,"cleanTask"),cleanWithOptionsTask:a(()=>mKo,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>gKo,"isCleanOptionsArray")});function mKo(t,e){let{cleanMode:r,options:n,valid:o}=AKo(t);return r?o.options?(n.push(...e),n.some(_Ko)?KC(dGt):fTn(r,n)):KC(pGt+JSON.stringify(t)):KC(fGt)}a(mKo,"cleanWithOptionsTask");function fTn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return pKo(t==="n",n)}}}a(fTn,"cleanTask");function gKo(t){return Array.isArray(t)&&t.every(e=>hGt.has(e))}a(gKo,"isCleanOptionsArray");function AKo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{yKo(o)?(e=o,n.cleanMode=!0):n.options=n.options&&EKo(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(AKo,"getCleanOptions");function yKo(t){return t==="f"||t==="n"}a(yKo,"isCleanMode");function EKo(t){return/^-[a-z]$/i.test(t)&&hGt.has(t.charAt(1))}a(EKo,"isKnownOption");function _Ko(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(_Ko,"isInteractiveMode");var dGt,fGt,pGt,xZe,hGt,pTn=Zr({"src/lib/tasks/clean.ts"(){"use strict";hKo(),oo(),nh(),dGt="Git clean interactive mode is not supported",fGt='Git clean mode parameter ("n" or "f") is required',pGt="Git clean unknown option found in: ",xZe=(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))(xZe||{}),hGt=new Set(["i",...Hue(Object.values(xZe))])}});function vKo(t){let e=new mTn;for(let r of hTn(t))e.addValue(r.file,String(r.key),r.value);return e}a(vKo,"configListParser");function CKo(t,e){let r=null,n=[],o=new Map;for(let s of hTn(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(CKo,"configGetParser");function bKo(t){return t.replace(/^(file):/,"")}a(bKo,"configFilePath");function*hTn(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=oJ(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 LHt(t,e){return typeof t=="string"&&Object.hasOwn(YHt,t)?t:e}a(LHt,"asConfigScope");function TKo(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(TKo,"addConfigTask");function IKo(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 CKo(n,t)}}}a(IKo,"getConfigTask");function xKo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return vKo(r)}}}a(xKo,"listConfigTask");function wKo(){return{addConfig(t,e,...r){return this._runTask(TKo(t,e,r[0]===!0,LHt(r[1],"local")),Qd(arguments))},getConfig(t,e){return this._runTask(IKo(t,LHt(e,void 0)),Qd(arguments))},listConfig(...t){return this._runTask(xKo(LHt(t[0],void 0)),Qd(arguments))}}}a(wKo,"config_default");var YHt,gTn=Zr({"src/lib/tasks/config.ts"(){"use strict";SKo(),oo(),YHt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(YHt||{})}});function RKo(t){return ATn.has(t)}a(RKo,"isDiffNameStatus");var BHt,ATn,yTn=Zr({"src/lib/tasks/diff-name-status.ts"(){"use strict";BHt=(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))(BHt||{}),ATn=new Set(Object.values(BHt))}});function kKo(...t){return new _Tn().param(...t)}a(kKo,"grepQueryBuilder");function PKo(t){let e=new Set,r={};return oGt(t,n=>{let[o,s,c]=n.split(Que);e.add(o),(r[o]=r[o]||[]).push({line:Eu(s),path:o,preview:c})}),{paths:e,results:r}}a(PKo,"parseGrep");function DKo(){return{grep(t){let e=Qd(arguments),r=Z_(arguments);for(let o of ETn)if(r.includes(o))return this._runTask(KC(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=kKo().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return PKo(o)}},e)}}}a(DKo,"grep_default");var ETn,Awe,sSn,_Tn,vTn=Zr({"src/lib/tasks/grep.ts"(){"use strict";oo(),nh(),ETn=["-h"],Awe=Symbol("grepQuery"),_Tn=class{static{a(this,"GrepQuery")}constructor(){this[sSn]=[]}*[(sSn=Awe,Symbol.iterator)](){for(let t of this[Awe])yield t}and(...t){return t.length&&this[Awe].push("--and","(",...ywe(t,"-e"),")"),this}param(...t){return this[Awe].push(...ywe(t,"-e")),this}}}}),CTn={};tm(CTn,{ResetMode:a(()=>wZe,"ResetMode"),getResetMode:a(()=>MKo,"getResetMode"),resetTask:a(()=>NKo,"resetTask")});function NKo(t,e){let r=["reset"];return bTn(t)&&r.push(`--${t}`),r.push(...e),X_(r)}a(NKo,"resetTask");function MKo(t){if(bTn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(MKo,"getResetMode");function bTn(t){return typeof t=="string"&&STn.includes(t)}a(bTn,"isValidResetMode");var wZe,STn,TTn=Zr({"src/lib/tasks/reset.ts"(){"use strict";oo(),nh(),wZe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(wZe||{}),STn=Hue(Object.values(wZe))}});function OKo(){return(0,NZe.default)("simple-git")}a(OKo,"createLog");function aSn(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(aSn,"prefixedLogger");function LKo(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(LKo,"childLoggerName");function mGt(t,e,r,n=OKo()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=LKo(pE(e,lp),c,n);return d(r);function u(f,h){return lw(s,mGt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&aSn(c,h)||sJ,g=aSn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(mGt,"createLogger");var ITn=Zr({"src/lib/git-logger.ts"(){"use strict";oo(),NZe.default.formatters.L=t=>String(UZe(t)?t.length:"-"),NZe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Cwe(t)}}),xTn,BKo=Zr({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Bq(),ITn(),xTn=class KHt{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=KHt.getName(e.commands[0]),n=mGt(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 sF(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++KHt.counter}`}static{this.counter=0}}}});function iJ(t,e){return{method:jSn(t.commands)||"",commands:e}}a(iJ,"pluginContext");function FKo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(FKo,"onErrorReceived");function cSn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(cSn,"onDataReceived");var JHt,UKo=Zr({"src/lib/runners/git-executor-chain.ts"(){"use strict";Bq(),nh(),oo(),BKo(),JHt=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 xTn}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(uTn(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 sF?Object.assign(e,{task:t}):new sF(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","",iJ(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...iJ(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),lTn(t)?VHt(t.parser,s):VHt(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},{...iJ(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",Cwe(h)),u(new DZe(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 DZe(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},iJ(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,{...iJ(t,r),kill(m){f=m||f}});let h=(0,wTn.spawn)(e,r,c);h.stdout.on("data",cSn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",cSn(d,"stdErr",o,s.step("stdErr"))),h.on("error",FKo(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,{...iJ(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,{...iJ(t,e),kill(n){r=n||r}}),r}}}}),RTn={};tm(RTn,{GitExecutor:a(()=>kTn,"GitExecutor")});var kTn,QKo=Zr({"src/lib/runners/git-executor.ts"(){"use strict";UKo(),kTn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new JHt(this,this._scheduler,this._plugins)}chain(){return new JHt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function qKo(t,e,r=sJ){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof _we?jKo(s):s,void 0)},"onError2");e.then(n,o)}a(qKo,"taskCallback");function jKo(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=sJ},"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(jKo,"addDeprecationNoticeToError");var HKo=Zr({"src/lib/task-callback.ts"(){"use strict";jue(),oo()}});function lSn(t,e){return aTn(r=>{if(!sGt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(lSn,"changeWorkingDirectoryTask");var GKo=Zr({"src/lib/tasks/change-working-directory.ts"(){"use strict";oo(),nh()}});function FHt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=LZe(e,"-B")),X_(e)}a(FHt,"checkoutTask");function $Ko(){return{checkout(){return this._runTask(FHt(Z_(arguments,1)),Qd(arguments))},checkoutBranch(t,e){return this._runTask(FHt(["-b",t,e,...Z_(arguments)]),Qd(arguments))},checkoutLocalBranch(t){return this._runTask(FHt(["-b",t,...Z_(arguments)]),Qd(arguments))}}}a($Ko,"checkout_default");var VKo=Zr({"src/lib/tasks/checkout.ts"(){"use strict";oo(),nh()}});function WKo(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(WKo,"countObjectsResponse");function zKo(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return JC(WKo(),[PTn],t)}})}}}a(zKo,"count_objects_default");var PTn,YKo=Zr({"src/lib/tasks/count-objects.ts"(){"use strict";oo(),PTn=new Po(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=$Sn(e);Object.hasOwn(t,n)&&(t[n]=Eu(r))})}});function KKo(t){return JC({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},DTn,t)}a(KKo,"parseCommitResult");var DTn,JKo=Zr({"src/lib/parsers/parse-commit.ts"(){"use strict";oo(),DTn=[new Po(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new Po(/\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 Po(/(\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 Po(/^(\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 ZKo(t,e,r){return{commands:["-c","core.abbrev=40","commit",...ywe(t,"-m"),...e,...r],format:"utf-8",parser:KKo}}a(ZKo,"commitTask");function XKo(){return{commit(e,...r){let n=Qd(arguments),o=t(e)||ZKo(jO(e),jO(pE(r[0],PZe,[])),[...Hue(pE(r[1],bwe,[])),...Z_(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!PZe(e)&&KC("git.commit: requires the commit message to be supplied as a string/string[]")}}a(XKo,"commit_default");var eJo=Zr({"src/lib/tasks/commit.ts"(){"use strict";JKo(),oo(),nh()}});function tJo(){return{firstCommit(){return this._runTask(X_(["rev-list","--max-parents=0","HEAD"],!0),Qd(arguments))}}}a(tJo,"first_commit_default");var rJo=Zr({"src/lib/tasks/first-commit.ts"(){"use strict";oo(),nh()}});function nJo(t,e){let r=["hash-object",t];return e&&r.push("-w"),X_(r,!0)}a(nJo,"hashObjectTask");var iJo=Zr({"src/lib/tasks/hash-object.ts"(){"use strict";nh()}});function oJo(t,e,r){let n=String(r).trim(),o;if(o=NTn.exec(n))return new RZe(t,e,!1,o[1]);if(o=MTn.exec(n))return new RZe(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new RZe(t,e,/^re/i.test(n),s)}a(oJo,"parseInit");var RZe,NTn,MTn,sJo=Zr({"src/lib/responses/InitSummary.ts"(){"use strict";RZe=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},NTn=/^Init.+ repository in (.+)$/,MTn=/^Rein.+ in (.+)$/}});function aJo(t){return t.includes(gGt)}a(aJo,"hasBareCommand");function cJo(t=!1,e,r){let n=["init",...r];return t&&!aJo(n)&&n.splice(1,0,gGt),{commands:n,format:"utf-8",parser(o){return oJo(n.includes("--bare"),e,o)}}}a(cJo,"initTask");var gGt,lJo=Zr({"src/lib/tasks/init.ts"(){"use strict";sJo(),gGt="--bare"}});function AGt(t){for(let e=0;eJC(new OTn,e,r,!1)}a(LTn,"getDiffParser");var UHt,uSn,dSn,fSn,BTn,FTn=Zr({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Swe(),dJo(),yTn(),oo(),UHt=[new Po(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:Eu(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new Po(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:Eu(r),after:Eu(n),binary:!0})}),new Po(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);t.changed=Eu(e),t.insertions=Eu(n?.[1]),t.deletions=Eu(o?.[1])})],uSn=[new Po(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=Eu(e),s=Eu(r);t.changed++,t.insertions+=o,t.deletions+=s,t.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new Po(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],dSn=[new Po(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],fSn=[new Po(/([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:HHt(RKo(e)&&e),from:HHt(!!s&&n!==s&&n),similarity:Eu(r)})})],BTn={"":UHt,"--stat":UHt,"--numstat":uSn,"--name-status":fSn,"--name-only":dSn}}});function fJo(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(fJo,"lineBuilder");function UTn(t=vGt,e=QTn,r=""){let n=LTn(r);return function(o){let s=vwe(o.trim(),!1,EGt).map(function(c){let l=c.split(_Gt),u=fJo(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(UTn,"createListLogSummaryParser");var EGt,_Gt,vGt,QTn,qTn=Zr({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";oo(),FTn(),Swe(),EGt="\xF2\xF2\xF2\xF2\xF2\xF2 ",_Gt=" \xF2\xF2",vGt=" \xF2 ",QTn=["hash","date","message","refs","author_name","author_email"]}}),jTn={};tm(jTn,{diffSummaryTask:a(()=>pJo,"diffSummaryTask"),validateLogFormatConfig:a(()=>jZe,"validateLogFormatConfig")});function pJo(t){let e=AGt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),jZe(r)||{commands:r,format:"utf-8",parser:LTn(e)}}a(pJo,"diffSummaryTask");function jZe(t){let e=t.filter(uJo);if(e.length>1)return KC(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return KC(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a(jZe,"validateLogFormatConfig");var CGt=Zr({"src/lib/tasks/diff.ts"(){"use strict";Swe(),FTn(),nh()}});function hJo(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(hJo,"prettyFormat");function mJo(t){return Object.keys(t).reduce((e,r)=>(r in ZHt||(e[r]=t[r]),e),{})}a(mJo,"userOptions");function HTn(t={},e=[]){let r=pE(t.splitter,lp,vGt),n=FZe(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]=hJo(n,r),c=[],l=[`--pretty=format:${EGt}${s}${_Gt}`,...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 lp(t.file)&&l.push("--follow",Nue(t.file)),cGt(mJo(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(HTn,"parseLogOptions");function gJo(t,e,r){let n=UTn(t,e,AGt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(gJo,"logTask");function AJo(){return{log(...r){let n=Qd(arguments),o=HTn(lGt(arguments),Hue(pE(arguments[0],bwe,[]))),s=e(...r)||jZe(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return gJo(r.splitter,r.fields,r.commands)}function e(r,n){return lp(r)&&lp(n)&&KC("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(AJo,"log_default");var ZHt,GTn=Zr({"src/lib/tasks/log.ts"(){"use strict";Swe(),qTn(),oo(),nh(),CGt(),ZHt=(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))(ZHt||{})}}),kZe,$Tn,yJo=Zr({"src/lib/responses/MergeSummary.ts"(){"use strict";kZe=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}`}},$Tn=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"}}}}),XHt,VTn,EJo=Zr({"src/lib/responses/PullSummary.ts"(){"use strict";XHt=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}}},VTn=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function QHt(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(QHt,"objectEnumerationResult");function pSn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:Eu(e&&e[1]||"0"),delta:Eu(r&&r[1]||"0")}}a(pSn,"asObjectCount");var WTn,_Jo=Zr({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";oo(),WTn=[new Lq(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=QHt(t.remoteMessages);Object.assign(o,{[n]:Eu(r)})}),new Lq(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=QHt(t.remoteMessages);Object.assign(o,{[n]:Eu(r)})}),new Lq(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=QHt(t.remoteMessages);o.total=pSn(e),o.reused=pSn(r),o.packReused=Eu(n)})]}});function zTn(t,e){return JC({remoteMessages:new KTn},YTn,e)}a(zTn,"parseRemoteMessages");var YTn,KTn,JTn=Zr({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";oo(),_Jo(),YTn=[new Lq(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...WTn,new Lq([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new Lq([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:Eu(e),summary:r,url:n}})],KTn=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function vJo(t,e){let r=JC(new VTn,ZTn,[t,e]);return r.message&&r}a(vJo,"parsePullErrorResult");var hSn,mSn,gSn,ASn,ZTn,ySn,bGt,XTn=Zr({"src/lib/parsers/parse-pull.ts"(){"use strict";EJo(),oo(),JTn(),hSn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,mSn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,gSn=/^(create|delete) mode \d+ (.+)/,ASn=[new Po(hSn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new Po(mSn,(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 Po(gSn,(t,[e,r])=>{lw(t.files,r),lw(e==="create"?t.created:t.deleted,r)})],ZTn=[new Po(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new Po(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new Po(/([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})],ySn=a((t,e)=>JC(new XHt,ASn,[t,e]),"parsePullDetail"),bGt=a((t,e)=>Object.assign(new XHt,ySn(t,e),zTn(t,e)),"parsePullResult")}}),ESn,eIn,_Sn,CJo=Zr({"src/lib/parsers/parse-merge.ts"(){"use strict";yJo(),oo(),XTn(),ESn=[new Po(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new Po(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new kZe(e,r))}),new Po(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new kZe(e,r,{deleteRef:n}))}),new Po(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new kZe(e,null))}),new Po(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],eIn=a((t,e)=>Object.assign(_Sn(t,e),bGt(t,e)),"parseMergeResult"),_Sn=a(t=>JC(new $Tn,ESn,t),"parseMergeDetail")}});function vSn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=eIn(e,r);if(n.failed)throw new _we(n);return n}}:KC("Git.merge requires at least one option")}a(vSn,"mergeTask");var bJo=Zr({"src/lib/tasks/merge.ts"(){"use strict";jue(),CJo(),nh()}});function SJo(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(SJo,"pushResultPushedItem");var CSn,tIn,bSn,TJo=Zr({"src/lib/parsers/parse-push.ts"(){"use strict";oo(),JTn(),CSn=[new Po(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new Po(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new Po(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(SJo(e,r,n))}),new Po(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:n}}),new Po(/^([^:]+):(\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}}})],tIn=a((t,e)=>{let r=bSn(t,e),n=zTn(t,e);return{...r,...n}},"parsePushResult"),bSn=a((t,e)=>JC({pushed:[]},CSn,[t,e]),"parsePushDetail")}}),rIn={};tm(rIn,{pushTagsTask:a(()=>IJo,"pushTagsTask"),pushTask:a(()=>SGt,"pushTask")});function IJo(t={},e){return lw(e,"--tags"),SGt(t,e)}a(IJo,"pushTagsTask");function SGt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),LZe(r,"-v"),lw(r,"--verbose"),lw(r,"--porcelain"),{commands:r,format:"utf-8",parser:tIn}}a(SGt,"pushTask");var nIn=Zr({"src/lib/tasks/push.ts"(){"use strict";TJo(),oo()}});function xJo(){return{showBuffer(){let t=["show",...Z_(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(cTn(t),Qd(arguments))},show(){let t=["show",...Z_(arguments,1)];return this._runTask(X_(t),Qd(arguments))}}}a(xJo,"show_default");var wJo=Zr({"src/lib/tasks/show.ts"(){"use strict";oo(),nh()}}),SSn,iIn,RJo=Zr({"src/lib/responses/FileStatusSummary.ts"(){"use strict";SSn=/^(.+)\0(.+)$/,iIn=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=SSn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function TSn(t){let[e,r]=t.split(Que);return{from:r||e,to:e}}a(TSn,"renamedFile");function tT(t,e,r){return[`${t}${e}`,r]}a(tT,"parser3");function qHt(t,...e){return e.map(r=>tT(t,r,(n,o)=>n.conflicted.push(o)))}a(qHt,"conflicts");function kJo(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=oIn.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new iIn(c,o,s))}a(n,"data")}a(kJo,"splitLine");var ISn,oIn,sIn,PJo=Zr({"src/lib/responses/StatusSummary.ts"(){"use strict";oo(),RJo(),ISn=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}},oIn=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(TSn(e))}),tT("R","M",(t,e)=>{let r=TSn(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)),...qHt("A","A","U"),...qHt("D","D","U"),...qHt("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=pE(l?.[1],lp,null),l=s.exec(e),t.tracking=pE(l?.[1],lp,null),l=c.exec(e),l&&(t.current=pE(l?.[1],lp,t.current)),t.detached=/\(no branch\)/.test(e)}]]),sIn=a(function(t){let e=t.split(Que),r=new ISn;for(let n=0,o=e.length;n!aIn.includes(r))],parser(r){return sIn(r)}}}a(DJo,"statusTask");var aIn,NJo=Zr({"src/lib/tasks/status.ts"(){"use strict";PJo(),aIn=["--null","-z"]}});function MZe(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(MZe,"versionResponse");function MJo(){return MZe(0,0,0,"",!1)}a(MJo,"notInstalledResponse");function OJo(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:LJo,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(TGt));n(e)}})}}}a(OJo,"version_default");function LJo(t){return t===TGt?MJo():JC(MZe(0,0,0,t),cIn,t)}a(LJo,"versionParser");var TGt,cIn,BJo=Zr({"src/lib/tasks/version.ts"(){"use strict";oo(),TGt="installed=false",cIn=[new Po(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,MZe(Eu(e),Eu(r),Eu(n),o))}),new Po(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,MZe(Eu(e),Eu(r),n,o))})]}});function xSn(t,e,r,...n){return lp(r)?e(r,pE(n[0],lp),Z_(arguments)):KC(`git.${t}() requires a string 'repoPath'`)}a(xSn,"createCloneTask");function FJo(){return{clone(t,...e){return this._runTask(xSn("clone",eGt,pE(t,lp),...e),Qd(arguments))},mirror(t,...e){return this._runTask(xSn("mirror",lIn,pE(t,lp),...e),Qd(arguments))}}}a(FJo,"clone_default");var eGt,lIn,UJo=Zr({"src/lib/tasks/clone.ts"(){"use strict";nh(),oo(),eGt=a((t,e,r)=>{let n=["clone",...r];return lp(t)&&n.push(Nue(t)),lp(e)&&n.push(Nue(e)),X_(n)},"cloneTask"),lIn=a((t,e,r)=>(lw(r,"--mirror"),eGt(t,e,r)),"cloneMirrorTask")}}),uIn={};tm(uIn,{SimpleGitApi:a(()=>tGt,"SimpleGitApi")});var tGt,QJo=Zr({"src/lib/simple-git-api.ts"(){"use strict";HKo(),GKo(),VKo(),YKo(),eJo(),gTn(),rJo(),vTn(),iJo(),lJo(),GTn(),bJo(),nIn(),wJo(),NJo(),nh(),BJo(),oo(),UJo(),tGt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&qKo(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(X_(["add",...jO(t)]),Qd(arguments))}cwd(t){let e=Qd(arguments);return typeof t=="string"?this._runTask(lSn(t,this._executor),e):typeof t?.path=="string"?this._runTask(lSn(t.path,t.root&&this._executor||void 0),e):this._runTask(KC("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(nJo(t,e===!0),Qd(arguments))}init(t){return this._runTask(cJo(t===!0,this._executor.cwd,Z_(arguments)),Qd(arguments))}merge(){return this._runTask(vSn(Z_(arguments)),Qd(arguments))}mergeFromTo(t,e){return lp(t)&&lp(e)?this._runTask(vSn([t,e,...Z_(arguments)]),Qd(arguments,!1)):this._runTask(KC("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=SGt({remote:pE(arguments[0],lp),branch:pE(arguments[1],lp)},Z_(arguments));return this._runTask(t,Qd(arguments))}stash(){return this._runTask(X_(["stash",...Z_(arguments)]),Qd(arguments))}status(){return this._runTask(DJo(Z_(arguments)),Qd(arguments))}},Object.assign(tGt.prototype,$Ko(),FJo(),XKo(),wKo(),zKo(),tJo(),DKo(),AJo(),xJo(),OJo())}}),dIn={};tm(dIn,{Scheduler:a(()=>pIn,"Scheduler")});var wSn,pIn,qJo=Zr({"src/lib/runners/scheduler.ts"(){"use strict";oo(),ITn(),wSn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,fIn.createDeferred)();return{promise:e,done:r,id:t}}})(),pIn=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=mGt("","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=lw(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),LZe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=lw(this.pending,wSn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),hIn={};tm(hIn,{applyPatchTask:a(()=>jJo,"applyPatchTask")});function jJo(t,e){return X_(["apply",...e,...t])}a(jJo,"applyPatchTask");var HJo=Zr({"src/lib/tasks/apply-patch.ts"(){"use strict";nh()}});function GJo(t,e){return{branch:t,hash:e,success:!0}}a(GJo,"branchDeletionSuccess");function $Jo(t){return{branch:t,hash:null,success:!1}}a($Jo,"branchDeletionFailure");var mIn,VJo=Zr({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";mIn=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function gIn(t,e){return e===1&&rGt.test(t)}a(gIn,"hasBranchDeletionError");var RSn,rGt,kSn,HZe,WJo=Zr({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";VJo(),oo(),RSn=/(\S+)\s+\(\S+\s([^)]+)\)/,rGt=/^error[^']+'([^']+)'/m,kSn=[new Po(RSn,(t,[e,r])=>{let n=GJo(e,r);t.all.push(n),t.branches[e]=n}),new Po(rGt,(t,[e])=>{let r=$Jo(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],HZe=a((t,e)=>JC(new mIn,kSn,[t,e]),"parseBranchDeletions")}}),AIn,zJo=Zr({"src/lib/responses/BranchSummary.ts"(){"use strict";AIn=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 PSn(t){return t?t.charAt(0):""}a(PSn,"branchStatus");function yIn(t,e=!1){return JC(new AIn,e?[_In]:EIn,t)}a(yIn,"parseBranchSummary");var EIn,_In,YJo=Zr({"src/lib/parsers/parse-branch.ts"(){"use strict";zJo(),oo(),EIn=[new Po(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(PSn(e),!0,r,n,o)}),new Po(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(PSn(e),!1,r,n,o)})],_In=new Po(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),vIn={};tm(vIn,{branchLocalTask:a(()=>JJo,"branchLocalTask"),branchTask:a(()=>KJo,"branchTask"),containsDeleteBranchCommand:a(()=>CIn,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>XJo,"deleteBranchTask"),deleteBranchesTask:a(()=>ZJo,"deleteBranchesTask")});function CIn(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(CIn,"containsDeleteBranchCommand");function KJo(t){let e=CIn(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?HZe(o,s).all[0]:yIn(o,r)}}}a(KJo,"branchTask");function JJo(){return{format:"utf-8",commands:["branch","-v"],parser(t){return yIn(t)}}}a(JJo,"branchLocalTask");function ZJo(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return HZe(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!gIn(String(o),r))return c(o);s(n)}}}a(ZJo,"deleteBranchesTask");function XJo(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return HZe(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!gIn(String(c),n))return u(c);throw new _we(r.parser(Ewe(s),Ewe(o)),String(c))}};return r}a(XJo,"deleteBranchTask");var eZo=Zr({"src/lib/tasks/branch.ts"(){"use strict";jue(),WJo(),YJo(),oo()}});function tZo(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,bIn.normalize)(e)}a(tZo,"toPath");var SIn,rZo=Zr({"src/lib/responses/CheckIgnore.ts"(){"use strict";SIn=a(t=>t.split(/\n/g).map(tZo).filter(Boolean),"parseCheckIgnore")}}),TIn={};tm(TIn,{checkIgnoreTask:a(()=>nZo,"checkIgnoreTask")});function nZo(t){return{commands:["check-ignore",...t],format:"utf-8",parser:SIn}}a(nZo,"checkIgnoreTask");var iZo=Zr({"src/lib/tasks/check-ignore.ts"(){"use strict";rZo()}});function oZo(t,e){return JC({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},IIn,[t,e])}a(oZo,"parseFetchResult");var IIn,sZo=Zr({"src/lib/parsers/parse-fetch.ts"(){"use strict";oo(),IIn=[new Po(/From (.+)$/,(t,[e])=>{t.remote=e}),new Po(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new Po(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new Po(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new Po(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,o])=>{t.updated.push({name:n,tracking:o,to:r,from:e})})]}}),xIn={};tm(xIn,{fetchTask:a(()=>cZo,"fetchTask")});function aZo(t){return/^--upload-pack(=|$)/.test(t)}a(aZo,"disallowedCommand");function cZo(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(aZo)?KC("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:oZo}}a(cZo,"fetchTask");var lZo=Zr({"src/lib/tasks/fetch.ts"(){"use strict";sZo(),nh()}});function uZo(t){return JC({moves:[]},wIn,t)}a(uZo,"parseMoveResult");var wIn,dZo=Zr({"src/lib/parsers/parse-move.ts"(){"use strict";oo(),wIn=[new Po(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),RIn={};tm(RIn,{moveTask:a(()=>fZo,"moveTask")});function fZo(t,e){return{commands:["mv","-v",...jO(t),e],format:"utf-8",parser:uZo}}a(fZo,"moveTask");var pZo=Zr({"src/lib/tasks/move.ts"(){"use strict";dZo(),oo()}}),kIn={};tm(kIn,{pullTask:a(()=>hZo,"pullTask")});function hZo(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 bGt(o,s)},onError(o,s,c,l){let u=vJo(Ewe(o.stdOut),Ewe(o.stdErr));if(u)return l(new _we(u));l(s)}}}a(hZo,"pullTask");var mZo=Zr({"src/lib/tasks/pull.ts"(){"use strict";jue(),XTn(),oo()}});function gZo(t){let e={};return PIn(t,([r])=>e[r]={name:r}),Object.values(e)}a(gZo,"parseGetRemotes");function AZo(t){let e={};return PIn(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(AZo,"parseGetRemotesVerbose");function PIn(t,e){oGt(t,r=>e(r.split(/\s+/)))}a(PIn,"forEach");var yZo=Zr({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";oo()}}),DIn={};tm(DIn,{addRemoteTask:a(()=>EZo,"addRemoteTask"),getRemotesTask:a(()=>_Zo,"getRemotesTask"),listRemotesTask:a(()=>vZo,"listRemotesTask"),remoteTask:a(()=>CZo,"remoteTask"),removeRemoteTask:a(()=>bZo,"removeRemoteTask")});function EZo(t,e,r){return X_(["remote","add",...r,t,e])}a(EZo,"addRemoteTask");function _Zo(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?AZo:gZo}}a(_Zo,"getRemotesTask");function vZo(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),X_(e)}a(vZo,"listRemotesTask");function CZo(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),X_(e)}a(CZo,"remoteTask");function bZo(t){return X_(["remote","remove",t])}a(bZo,"removeRemoteTask");var SZo=Zr({"src/lib/tasks/remote.ts"(){"use strict";yZo(),nh()}}),NIn={};tm(NIn,{stashListTask:a(()=>TZo,"stashListTask")});function TZo(t={},e){let r=HTn(t),n=["stash","list",...r.commands,...e],o=UTn(r.splitter,r.fields,AGt(n));return jZe(n)||{commands:n,format:"utf-8",parser:o}}a(TZo,"stashListTask");var IZo=Zr({"src/lib/tasks/stash-list.ts"(){"use strict";Swe(),qTn(),CGt(),GTn()}}),MIn={};tm(MIn,{addSubModuleTask:a(()=>xZo,"addSubModuleTask"),initSubModuleTask:a(()=>wZo,"initSubModuleTask"),subModuleTask:a(()=>GZe,"subModuleTask"),updateSubModuleTask:a(()=>RZo,"updateSubModuleTask")});function xZo(t,e){return GZe(["add",t,e])}a(xZo,"addSubModuleTask");function wZo(t){return GZe(["init",...t])}a(wZo,"initSubModuleTask");function GZe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),X_(e)}a(GZe,"subModuleTask");function RZo(t){return GZe(["update",...t])}a(RZo,"updateSubModuleTask");var kZo=Zr({"src/lib/tasks/sub-module.ts"(){"use strict";nh()}});function PZo(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?OIn(t,e):0}a(PZo,"singleSorted");function OIn(t,e){return t===e?0:t>e?1:-1}a(OIn,"sorted");function DZo(t){return t.trim()}a(DZo,"trimmed");function IZe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(IZe,"toNumber");var DSn,LIn,NZo=Zr({"src/lib/responses/TagList.ts"(){"use strict";DSn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},LIn=a(function(t,e=!1){let r=t.split(` +`).map(DZo).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return PZo(IZe(c[0]),IZe(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new DSn(r,n)},"parseTagList")}}),BIn={};tm(BIn,{addAnnotatedTagTask:a(()=>LZo,"addAnnotatedTagTask"),addTagTask:a(()=>OZo,"addTagTask"),tagListTask:a(()=>MZo,"tagListTask")});function MZo(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return LIn(r,e)}}}a(MZo,"tagListTask");function OZo(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(OZo,"addTagTask");function LZo(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(LZo,"addAnnotatedTagTask");var BZo=Zr({"src/lib/tasks/tag.ts"(){"use strict";NZo()}}),FZo=tKo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(QKo(),rh(RTn)),{SimpleGitApi:n}=(QJo(),rh(uIn)),{Scheduler:o}=(qJo(),rh(dIn)),{adhocExecTask:s,configurationErrorTask:c}=(nh(),rh(zHt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(oo(),rh(ZSn)),{applyPatchTask:E}=(HJo(),rh(hIn)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:b,deleteBranchTask:T}=(eZo(),rh(vIn)),{checkIgnoreTask:w}=(iZo(),rh(TIn)),{checkIsRepoTask:R}=(rTn(),rh(XSn)),{cleanWithOptionsTask:x,isCleanOptionsArray:P}=(pTn(),rh(dTn)),{diffSummaryTask:D}=(CGt(),rh(jTn)),{fetchTask:N}=(lZo(),rh(xIn)),{moveTask:L}=(pZo(),rh(RIn)),{pullTask:B}=(mZo(),rh(kIn)),{pushTagsTask:q}=(nIn(),rh(rIn)),{addRemoteTask:M,getRemotesTask:O,listRemotesTask:j,remoteTask:Q,removeRemoteTask:U}=(SZo(),rh(DIn)),{getResetMode:Y,resetTask:W}=(TTn(),rh(CTn)),{stashListTask:V}=(IZo(),rh(NIn)),{addSubModuleTask:z,initSubModuleTask:ie,subModuleTask:H,updateSubModuleTask:re}=(kZo(),rh(MIn)),{addAnnotatedTagTask:le,addTagTask:Le,tagListTask:ge}=(BZo(),rh(BIn)),{straightThroughBufferTask:Ue,straightThroughStringTask:ke}=(nh(),rh(zHt));function X(ee,K){this._plugins=K,this._executor=new r(ee.baseDir,new o(ee.maxConcurrentProcesses),K),this._trimmed=ee.trimmed}a(X,"Git2"),(X.prototype=Object.create(n.prototype)).constructor=X,X.prototype.customBinary=function(ee){return this._plugins.reconfigure("binary",ee),this},X.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},X.prototype.stashList=function(ee){return this._runTask(V(y(arguments)||{},u(ee)&&ee||[]),A(arguments))},X.prototype.mv=function(ee,K){return this._runTask(L(ee,K),A(arguments))},X.prototype.checkoutLatestTag=function(ee){var K=this;return this.pull(function(){K.tags(function(he,Z){K.checkout(Z.latest,ee)})})},X.prototype.pull=function(ee,K,he,Z){return this._runTask(B(m(ee,f),m(K,f),g(arguments)),A(arguments))},X.prototype.fetch=function(ee,K){return this._runTask(N(m(ee,f),m(K,f),g(arguments)),A(arguments))},X.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.")))},X.prototype.tags=function(ee,K){return this._runTask(ge(g(arguments)),A(arguments))},X.prototype.rebase=function(){return this._runTask(ke(["rebase",...g(arguments)]),A(arguments))},X.prototype.reset=function(ee){return this._runTask(W(Y(ee),g(arguments)),A(arguments))},X.prototype.revert=function(ee){let K=A(arguments);return typeof ee!="string"?this._runTask(c("Commit must be a string"),K):this._runTask(ke(["revert",...g(arguments,0,!0),ee]),K)},X.prototype.addTag=function(ee){let K=typeof ee=="string"?Le(ee):c("Git.addTag requires a tag name");return this._runTask(K,A(arguments))},X.prototype.addAnnotatedTag=function(ee,K){return this._runTask(le(ee,K),A(arguments))},X.prototype.deleteLocalBranch=function(ee,K,he){return this._runTask(T(ee,typeof K=="boolean"?K:!1),A(arguments))},X.prototype.deleteLocalBranches=function(ee,K,he){return this._runTask(b(ee,typeof K=="boolean"?K:!1),A(arguments))},X.prototype.branch=function(ee,K){return this._runTask(_(g(arguments)),A(arguments))},X.prototype.branchLocal=function(ee){return this._runTask(v(),A(arguments))},X.prototype.raw=function(ee){let K=!Array.isArray(ee),he=[].slice.call(K?arguments:ee,0);for(let ue=0;ueconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},X.prototype.checkIgnore=function(ee,K){return this._runTask(w(l(m(ee,h,[]))),A(arguments))},X.prototype.checkIsRepo=function(ee,K){return this._runTask(R(m(ee,f)),A(arguments))},e.exports=X}});Bq();var UZo=class extends sF{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};Bq();Bq();var que=class extends sF{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};jue();FSn();rTn();pTn();gTn();yTn();vTn();TTn();function QZo(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new que(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new que(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(QZo,"abortPlugin");function qZo(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of oSn(e,r))if(t[n.category]!==!0)throw new que(void 0,"unsafe",n.message);return e}}}a(qZo,"blockUnsafeOperationsPlugin");oo();function jZo(t){let e=ywe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(jZo,"commandConfigPrefixingPlugin");oo();var NSn=(0,Uue.deferred)().promise;function HZo({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,Uue.deferred)(),closeTimeout:(0,Uue.deferred)(),exit:(0,Uue.deferred)(),exitTimeout:(0,Uue.deferred)()},c=Promise.race([t===!1?NSn:s.closeTimeout.promise,e===!1?NSn: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(()=>jHt(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 jHt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(HZo,"completionDetectionPlugin");oo();var GZo="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",MSn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function $Zo(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a($Zo,"isBadArgument");function OSn(t,e){if(t.length<1||t.length>2)throw new que(void 0,"binary",GZo);if(t.some($Zo))if(e)console.warn(MSn);else throw new que(void 0,"binary",MSn);let[n,o]=t;return{binary:n,prefix:o}}a(OSn,"toBinaryConfig");function VZo(t,e=["git"],r=!1){let n=OSn(jO(e),r);t.on("binary",o=>{n=OSn(jO(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(VZo,"customBinaryPlugin");Bq();function WZo(t){return!!(t.exitCode&&t.stdErr.length)}a(WZo,"isTaskError");function zZo(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(zZo,"getErrorMessage");function YZo(t=!1,e=WZo,r=zZo){return(n,o)=>!t&&n||!e(o)?n:r(o)}a(YZo,"errorDetectionHandler");function LSn(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 sF(void 0,n.toString("utf-8"))}:{error:n}}}}a(LSn,"errorDetectionPlugin");oo();var KZo=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new FIn.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=lw(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return jO(t).forEach(r=>r&&this.plugins.add(lw(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}};oo();function JZo(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?GSn(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:ZZo(u[1]),progress:Eu(u[2]),processed:Eu(u[3]),total:Eu(u[4])})})}}]}a(JZo,"progressMonitorPlugin");function ZZo(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(ZZo,"progressEventStage");oo();function XZo(t){let e=VSn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(XZo,"spawnOptionsPlugin");function eXo({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 que(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(eXo,"timeoutPlugin");function tXo(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;osw(c)&&Mue(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a(tXo,"suffixPathsPlugin");oo();var rXo=FZo();function nXo(t,e){let r=new KZo,n=KSn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!sGt(n.baseDir))throw new UZo(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(jZo(n.config)),r.add(qZo(n.unsafe)),r.add(HZo(n.completion)),n.abort&&r.add(QZo(n.abort)),n.progress&&r.add(JZo(n.progress)),n.timeout&&r.add(eXo(n.timeout)),n.spawnOptions&&r.add(XZo(n.spawnOptions)),r.add(tXo()),r.add(LSn(YZo(!0))),n.errors&&r.add(LSn(n.errors)),VZo(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new rXo(n,r)}a(nXo,"gitInstanceFactory");jue();var Gue=nXo;var uw=new fe("Git Service");var $Ze=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 lO()).path;n=Gue({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,QIn.join)(n,r);return Ks(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){uw.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){uw.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){uw.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){uw.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){uw.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 uw.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};uw.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){uw.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){uw.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,UIn.fileURLToPath)(e)}catch(r){uw.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 uw.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var qIn=de(nl());var t2=new fe("Local Diff Tracker");var VZe=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._gitService=new $Ze(e),this._repositoryManager=e.get(_f),this._diffRefreshTimer=new qIn.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{t2.info(this.ctx,"Initializing Local Diff Tracker"),await this._workspaceFileIndex.initialize();let e=a(n=>{for(let o of n)this._locallyChangedFiles.add(o)},"addFiles");this._fileWatcherDisposables.push(this._workspaceFileIndex.onDidCreateFiles(e),this._workspaceFileIndex.onDidChangeFiles(e),this._workspaceFileIndex.onDidDeleteFiles(n=>{for(let o of n)this._locallyChangedFiles.delete(o)}));let r=await this._repositoryManager.getRepo({uri:this._workspaceFileIndex.workspaceFolder.uri});r||(r=await this.tryInferRepoFromFiles()),r&&r.isGitHub()&&r.owner&&r.name?await this.openRepo(r):t2.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`)}catch(e){t2.error(this.ctx,"Initialization 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){t2.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)&&t2.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?t2.warn(this.ctx,n,o):t2.warn(this.ctx,n):o!==void 0?t2.debug(this.ctx,n,o):t2.debug(this.ctx,n)}dispose(){this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var Fq;(n=>{function t(o){return new IGt(o)}n.ok=t,a(t,"ok");function e(o){return new xGt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(Fq||={});var IGt=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}},xGt=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 wGt=new fe("GithubAvailableEmbeddingTypes"),WZe=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Qt).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):Fq.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):Fq.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=Pue(this._ctx);r=await Gf(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return wGt.error(this._ctx,"Error fetching available embedding types",c),Fq.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?Fq.error({type:"unauthorized",status:r.status}):Fq.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new $C(c.id);c.active===!1?s.push(l):o.push(l)}return Fq.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){wGt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return wGt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var iXo=new fe("GithubEmbeddingComputer"),$ue=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){iXo.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 Gf(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 $C(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 Twe=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var jIn=de(NA()),HIn=de(fU()),GIn=require("os"),RGt=de(require("path")),Vue=require("process");function zZe(t){let e=un(t.workspaceFolder.uri),r=(0,jIn.basename)(e),o=(0,HIn.SHA256)(e).toString().substring(0,8);return RGt.default.join(oXo(),"project-index",`${r}.${o}`)}a(zZe,"getWorkspaceCachePath");function oXo(){return Vue.env.XDG_CACHE_HOME&&RGt.default.isAbsolute(Vue.env.XDG_CACHE_HOME)?Vue.env.XDG_CACHE_HOME+"/github-copilot":(0,GIn.platform)()==="win32"?Vue.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":Vue.env.HOME+"/.cache/github-copilot"}a(oXo,"getXdgCachePath");p();p();function $In(t){if(Zqt(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(kGt,"unpackEmbedding");p();var VIn=de(nl()),WIn=de(YP()),DGt=de(eh()),zIn=de(require("fs")),NGt=de(require("node:sqlite")),MGt=de(require("path"));var PGt=new fe("WorkspaceChunkAndEmbeddingCache");async function YIn(t,e,r,n){return await OGt.create(t,e,r??":memory:",n)}a(YIn,"createWorkspaceChunkAndEmbeddingCache");var OGt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new WIn.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 d=MGt.default.join(n,"workspace-chunks.db");try{await zIn.default.promises.mkdir(MGt.default.dirname(d),{recursive:!0}),c=new NGt.default.DatabaseSync(d,s),PGt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${d}`)}catch(f){PGt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",f)}}c||(c=new NGt.default.DatabaseSync(":memory:",s),PGt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` PRAGMA journal_mode = OFF; PRAGMA synchronous = 0; PRAGMA cache_size = ${-32768}; @@ -2854,20 +2854,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");try{c.exec("BEGIN TRANSACTION");for(let d of u.all()){let f=d;try{if(o.get(f.uri))continue}catch{}c.prepare("DELETE FROM Files WHERE id = ?").run(f.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=to(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=RGt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new PGt.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=to(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 PGt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:RGt(this.embeddingType,l.embedding),chunkHash:l.chunkHash}))}}async update(e,r){let n=to(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,$In.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,GIn(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var YIn=de(Sl()),Iwe=de(nl()),KIn=de(eF());var VZe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new KIn.Lazy(async()=>(this._cacheRoot=$Ze(this._workspaceFileIndex),await zIn(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;return await Promise.all(r.map(async o=>{await e.isIndexed(o)&&n++})),{totalFileCount:r.length,indexedFileCount:n}}get fileCount(){return this._workspaceFileIndex.fileCount}async triggerIndexingOfWorkspace(e,r){let n=Array.from(this._workspaceFileIndex.values());await Promise.all(n.map(o=>this.triggerIndexingOfFile(o.uri,e,r)))}async triggerIndexingOfFile(e,r,n){let o=this._workspaceFileIndex.get(e);o&&await this.getChunksAndEmbeddings(r,o,new Twe,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,Iwe.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,Iwe.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return fbn(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 Twe,s=await Promise.all(r.map(async c=>{let l=this._workspaceFileIndex.get(c);if(l)return await this.getChunksAndEmbeddings(e,l,o,"Batch",n)}));return(0,YIn.coalesce)(s).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,Iwe.raceCancellationError)(this._cache.value,s),l=await(0,Iwe.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 JIn=de(nl()),ZIn=de(zP()),Wue=de(FO());var MA=new fe("Embeddings Search"),WZe=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 Fn.CancellationTokenSource;this._reindexRequests=new ZIn.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(MA.info(this._ctx,"Triggering local indexing..."),await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAutomaticIndexing"){MA.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 Wue.StopWatch;MA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:PA(r),indexStatus:this._state});let s=await this._ctx.get(Qt).getGitHubSession();if(!s)throw MA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let c=e.resolveQueryEmbeddings(n);if(await this.doInitialIndexing(),Hh(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new Wue.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,PA(r),n),f=u.elapsed(),h=o.elapsed(),m=d.length,A=new Set(d.map(E=>E.chunk.file)).size,y=this._workspaceFileIndex.fileCount;return MA.info(this._ctx,`Workspace search completed successfully in ${h}ms`,{totalTime:h,searchTime:f,chunkCount:m,uniqueFileCount:A,indexStatus:this._state}),f0.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,fE.Aggregate),{chunks:d}}else{MA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),f0.sendEmbeddingsSkipped(this._ctx,"index_not_ready");return}}async searchFiles(e,r,n,o){if(!n.length)return MA.info(this._ctx,"No files to search, returning empty results"),{chunks:[]};let s=new Wue.StopWatch;MA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:PA(r),fileCount:n.length});let c=await this._ctx.get(Qt).getGitHubSession();if(!c)throw MA.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){MA.info(this._ctx,"Too many files for subset search",{fileCount:n.length});return}Hh(o);let d=new Wue.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,PA(r),o),h=d.elapsed(),m=s.elapsed(),g=f.length,y=new Set(f.map(_=>_.chunk.file)).size,E=this._workspaceFileIndex.fileCount;return MA.info(this._ctx,`File subset search completed successfully in ${m}ms`,{totalTime:m,searchTime:h,chunkCount:g,uniqueFileCount:y}),f0.sendEmbeddingsSuccess(this._ctx,m,h,g,y,E,fE.Remote),{chunks:f}}async initializeForFileSubset(e){await this._workspaceFileIndex.initialize();let r=this.getAutoIndexFileCap();if(e>r){MA.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?(MA.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 VZe(this._ctx,this.embeddingType,this._workspaceFileIndex,this.chunkingEndpointClient),MA.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 Wue.StopWatch;MA.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 Fn.CancellationTokenSource().token),this.setState("ready"),MA.info(this._ctx,`Workspace indexing completed in ${e.elapsed()}ms`,{status:"ready",indexingTime:e.elapsed()})}catch(r){MA.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=to(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=to(o),c=this._reindexRequests.get(s);c||(c=new JIn.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 wwe=de(uw());async function JZe(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 wwe.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&xP(r.reason)))return wwe.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!xP(r.reason))return wwe.Result.error({errorDiagMessage:r.reason+""});return wwe.Result.error({errorDiagMessage:"unknown error"})}a(JZe,"raceSearchOperations");var Rwe=de(uw()),kwe=de(nl());var fXo=2e3,pXo=.7,ixn=8e3,hXo=300,ZZe=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>fXo)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>pXo)}async searchLocalDiff(e,r,n,o){if(e.length===0)return Rwe.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 Rwe.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,kwe.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return Rwe.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>hXo){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return Rwe.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,kwe.raceTimeout)(u,ixn),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 JZe([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,kwe.raceTimeout)(u,ixn);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:Kxe(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 oxn=de(require("path")),sxn=require("worker_threads");var QGt=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 mXo(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(mXo,"createRpcProxy");var eXe=class{constructor(e,r,n){this.responseHandler=new QGt;this.worker=new sxn.Worker(e,r),CIe(this.worker,oxn.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=mXo((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 nXe=de(nl()),axn=de(eF()),cxn=de(Ro()),zue=de(FO()),lxn=require("fs"),tXe=de(require("path"));var rm=new fe("Tfidf Search"),gXo=100,rXe=class extends cxn.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 XZe(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new axn.Lazy(()=>{let s=this.firstExistingPath([tXe.join(__dirname,"tfidfWorker.js"),tXe.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(ii).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)=>(rm.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(rm.error(r,u,...d),Promise.resolve()),"logError")};return new eXe(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(){rm.info(this.ctx,"Starting initialization...");let r=new zue.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return rm.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 zue.StopWatch;rm.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:PA(n)});try{if(await this.initialize(),this._isDisposed)throw f0.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:PA(n),maxSpread:Yxe},l=await r.resolveQuery(o),u=new zue.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();rm.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),Hh(o);let h=await this.applyEmbeddingReranking(l,d.chunks,PA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount,E=s.elapsed();return rm.info(this.ctx,`Search with reranking completed successfully in ${E}ms`,{totalTime:E,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),f0.sendTfidfSuccess(this.ctx,E,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,fE.Aggregate),{chunks:h.chunks}}catch(c){throw rm.error(this.ctx,"TF-IDF search failed",c),f0.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new zue.StopWatch;if(rm.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return rm.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:PA(n),maxSpread:Yxe},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));rm.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,PA(n),s),A=g.chunks.length,E=new Set(g.chunks.map(v=>v.chunk.file)).size,_=c.elapsed();return rm.info(this.ctx,`File-scoped search completed in ${_}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),f0.sendTfidfSuccess(this.ctx,_,m,g.telemetry.rerankTime,A,E,h.length,o.length,fE.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new zue.StopWatch,l=[];if(rm.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new Fn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,nXe.raceTimeout)(h,f,()=>{rm.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,rm.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(rm.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){rm.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 rm.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),rm.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),rm.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new nXe.Limiter(gXo),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(Qo).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=$Ze(this._workspaceFileIndex);return tXe.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,lxn.existsSync)(n))return n}};p();p();p();var qGt=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 HGt(e,r))}static forPaths(e=!1){return new t(new iXe(void 0,!e))}static forStrings(){return new t(new qGt)}static forConfigKeys(){return new t(new jGt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);UUt(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);UUt(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 Yue,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 Yue,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new Yue,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new Yue,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=sF.unwrap(o.value);o.value=sF.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 sF.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:UK(!1);case 1:UK(!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=sF.unwrap(n.value)||o,n=n.mid;else break}return n&&sF.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?sF.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,sF.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 uxn=de(nl()),dxn=de(require("fs")),fxn=de(ri());var AXo=1.5*1024*1024,GGt=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new fxn.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}`}},sXe=class extends GGt{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(Qo).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(nc).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,uxn.raceCancellationError)(yXo(r,AXo),this._disposedCts.token)}))}catch{return}}};async function yXo(t,e){return new Promise((r,n)=>{let o=dxn.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(yXo,"readLocalTextFileUsingReadStream");var aXe=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new $Gt;this._onDidCreateFiles=new Wi;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new Wi;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new Wi;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=rs(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 sXe(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(zx).getWatchedFileUris(this.workspaceFolder),r=this.ctx.get(nc);(r.enabled?(await Promise.all(e.map(async o=>(await r.evaluate(o.uri,"")).isBlocked?void 0:o))).filter(o=>o!==void 0):e).forEach(o=>{let s=rs(o.uri);s&&this._fsFileTree.addFile(s,new sXe(o.uri,this.limiter,this.ctx))})})(),this._initializePromise}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(Qo).stat(e)).type}catch{return}}},$Gt=class{constructor(){this._tree=oXe.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 pxn=de(nl());var cXe=class extends HQ{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new Wi;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new Wi;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(US).addListener(this),this._fileReadLimiter=new pxn.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 aXe(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 Pwe=de(uw()),hxn=de(Sl()),dw=de(nl()),Uq=de(FO());var il=new fe("Semantic Search"),t2=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new GZe(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 VGt(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)}},VGt=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 cXe(this._ctx),o=new mZe(this._ctx);this._localDiffSearch=new ZZe(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new pZe(this._ctx),this._codeSearchChunkSearch=new gZe(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new WZe(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new rXe(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new HZe(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&!IP(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 Uq.StopWatch,s=await this.resolveQueryText(e,n);il.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:PA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw il.error(this._ctx,"Semantic search failed",l.err),f0.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);il.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,dw.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);il.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,PA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return il.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),f0.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){Hh(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(xP(n))throw n;return il.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new $ue(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){il.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,dw.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new Uq.StopWatch;il.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,dw.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,dw.raceCancellationError)((0,dw.raceTimeout)(u,n),c);if(d?.isOk())return il.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;il.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 Uq.StopWatch,m=await JZe([u,f]);return il.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){il.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){il.info(this._ctx,`Both strategies available for folder: ${l}, using embeddings with TF-IDF fallback`);let f=8e3,h=new Uq.StopWatch,m=await this.runSearchStrategyWithFallback(u,()=>(0,dw.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),il.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){il.info(this._ctx,`Using embeddings search for folder: ${l}`);let f=new Uq.StopWatch,h=await this.runSearchStrategy(u,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(u.id),il.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){il.info(this._ctx,`Using TF-IDF search for folder: ${l}`);let f=new Uq.StopWatch,h=await this.runSearchStrategy(d,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(d.id),il.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 il.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return il.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),Pwe.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new Uq.StopWatch;il.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,dw.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(il.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),Pwe.Result.ok({strategy:e.id,result:c})):(il.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),Pwe.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(xP(c))throw il.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return il.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),Pwe.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,hxn.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(nc).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){il.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,dw.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*Yxe,d=s.filter(f=>f.distance.value>=u);return il.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return xP(s)||il.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,dw.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:Kxe(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,rs(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=DA(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");try{c.exec("BEGIN TRANSACTION");for(let d of u.all()){let f=d;try{if(o.get(f.uri))continue}catch{}c.prepare("DELETE FROM Files WHERE id = ?").run(f.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=to(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=kGt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new DGt.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=to(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 DGt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:kGt(this.embeddingType,l.embedding),chunkHash:l.chunkHash}))}}async update(e,r){let n=to(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,VIn.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,$In(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var KIn=de(Sl()),Iwe=de(nl()),JIn=de(tF());var YZe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new JIn.Lazy(async()=>(this._cacheRoot=zZe(this._workspaceFileIndex),await YIn(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;return await Promise.all(r.map(async o=>{await e.isIndexed(o)&&n++})),{totalFileCount:r.length,indexedFileCount:n}}get fileCount(){return this._workspaceFileIndex.fileCount}async triggerIndexingOfWorkspace(e,r){let n=Array.from(this._workspaceFileIndex.values());await Promise.all(n.map(o=>this.triggerIndexingOfFile(o.uri,e,r)))}async triggerIndexingOfFile(e,r,n){let o=this._workspaceFileIndex.get(e);o&&await this.getChunksAndEmbeddings(r,o,new Twe,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,Iwe.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,Iwe.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return pbn(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 Twe,s=await Promise.all(r.map(async c=>{let l=this._workspaceFileIndex.get(c);if(l)return await this.getChunksAndEmbeddings(e,l,o,"Batch",n)}));return(0,KIn.coalesce)(s).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,Iwe.raceCancellationError)(this._cache.value,s),l=await(0,Iwe.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 ZIn=de(nl()),XIn=de(YP()),Wue=de(FO());var MA=new fe("Embeddings Search"),KZe=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 Fn.CancellationTokenSource;this._reindexRequests=new XIn.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(MA.info(this._ctx,"Triggering local indexing..."),await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAutomaticIndexing"){MA.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 Wue.StopWatch;MA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:PA(r),indexStatus:this._state});let s=await this._ctx.get(Qt).getGitHubSession();if(!s)throw MA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let c=e.resolveQueryEmbeddings(n);if(await this.doInitialIndexing(),Hh(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new Wue.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,PA(r),n),f=u.elapsed(),h=o.elapsed(),m=d.length,A=new Set(d.map(E=>E.chunk.file)).size,y=this._workspaceFileIndex.fileCount;return MA.info(this._ctx,`Workspace search completed successfully in ${h}ms`,{totalTime:h,searchTime:f,chunkCount:m,uniqueFileCount:A,indexStatus:this._state}),f0.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,fE.Aggregate),{chunks:d}}else{MA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),f0.sendEmbeddingsSkipped(this._ctx,"index_not_ready");return}}async searchFiles(e,r,n,o){if(!n.length)return MA.info(this._ctx,"No files to search, returning empty results"),{chunks:[]};let s=new Wue.StopWatch;MA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:PA(r),fileCount:n.length});let c=await this._ctx.get(Qt).getGitHubSession();if(!c)throw MA.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){MA.info(this._ctx,"Too many files for subset search",{fileCount:n.length});return}Hh(o);let d=new Wue.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,PA(r),o),h=d.elapsed(),m=s.elapsed(),g=f.length,y=new Set(f.map(_=>_.chunk.file)).size,E=this._workspaceFileIndex.fileCount;return MA.info(this._ctx,`File subset search completed successfully in ${m}ms`,{totalTime:m,searchTime:h,chunkCount:g,uniqueFileCount:y}),f0.sendEmbeddingsSuccess(this._ctx,m,h,g,y,E,fE.Remote),{chunks:f}}async initializeForFileSubset(e){await this._workspaceFileIndex.initialize();let r=this.getAutoIndexFileCap();if(e>r){MA.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?(MA.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 YZe(this._ctx,this.embeddingType,this._workspaceFileIndex,this.chunkingEndpointClient),MA.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 Wue.StopWatch;MA.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 Fn.CancellationTokenSource().token),this.setState("ready"),MA.info(this._ctx,`Workspace indexing completed in ${e.elapsed()}ms`,{status:"ready",indexingTime:e.elapsed()})}catch(r){MA.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=to(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=to(o),c=this._reindexRequests.get(s);c||(c=new ZIn.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 wwe=de(dw());async function eXe(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 wwe.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&wP(r.reason)))return wwe.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!wP(r.reason))return wwe.Result.error({errorDiagMessage:r.reason+""});return wwe.Result.error({errorDiagMessage:"unknown error"})}a(eXe,"raceSearchOperations");var Rwe=de(dw()),kwe=de(nl());var gXo=2e3,AXo=.7,oxn=8e3,yXo=300,tXe=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>gXo)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>AXo)}async searchLocalDiff(e,r,n,o){if(e.length===0)return Rwe.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 Rwe.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,kwe.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return Rwe.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>yXo){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return Rwe.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,kwe.raceTimeout)(u,oxn),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 eXe([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,kwe.raceTimeout)(u,oxn);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:Kxe(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 sxn=de(require("path")),axn=require("worker_threads");var qGt=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 EXo(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(EXo,"createRpcProxy");var nXe=class{constructor(e,r,n){this.responseHandler=new qGt;this.worker=new axn.Worker(e,r),bIe(this.worker,sxn.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=EXo((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 sXe=de(nl()),cxn=de(tF()),lxn=de(ko()),zue=de(FO()),uxn=require("fs"),iXe=de(require("path"));var rm=new fe("Tfidf Search"),_Xo=100,oXe=class extends lxn.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 rXe(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new cxn.Lazy(()=>{let s=this.firstExistingPath([iXe.join(__dirname,"tfidfWorker.js"),iXe.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(ii).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)=>(rm.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(rm.error(r,u,...d),Promise.resolve()),"logError")};return new nXe(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(){rm.info(this.ctx,"Starting initialization...");let r=new zue.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return rm.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 zue.StopWatch;rm.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:PA(n)});try{if(await this.initialize(),this._isDisposed)throw f0.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:PA(n),maxSpread:Yxe},l=await r.resolveQuery(o),u=new zue.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();rm.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),Hh(o);let h=await this.applyEmbeddingReranking(l,d.chunks,PA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount,E=s.elapsed();return rm.info(this.ctx,`Search with reranking completed successfully in ${E}ms`,{totalTime:E,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),f0.sendTfidfSuccess(this.ctx,E,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,fE.Aggregate),{chunks:h.chunks}}catch(c){throw rm.error(this.ctx,"TF-IDF search failed",c),f0.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new zue.StopWatch;if(rm.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return rm.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:PA(n),maxSpread:Yxe},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));rm.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,PA(n),s),A=g.chunks.length,E=new Set(g.chunks.map(v=>v.chunk.file)).size,_=c.elapsed();return rm.info(this.ctx,`File-scoped search completed in ${_}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),f0.sendTfidfSuccess(this.ctx,_,m,g.telemetry.rerankTime,A,E,h.length,o.length,fE.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new zue.StopWatch,l=[];if(rm.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new Fn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,sXe.raceTimeout)(h,f,()=>{rm.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,rm.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(rm.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){rm.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 rm.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),rm.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),rm.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new sXe.Limiter(_Xo),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(qo).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=zZe(this._workspaceFileIndex);return iXe.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,uxn.existsSync)(n))return n}};p();p();p();var jGt=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 GGt(e,r))}static forPaths(e=!1){return new t(new aXe(void 0,!e))}static forStrings(){return new t(new jGt)}static forConfigKeys(){return new t(new HGt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);QUt(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);QUt(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 Yue,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 Yue,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new Yue,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new Yue,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=aF.unwrap(o.value);o.value=aF.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 aF.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:UK(!1);case 1:UK(!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=aF.unwrap(n.value)||o,n=n.mid;else break}return n&&aF.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?aF.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,aF.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 dxn=de(nl()),fxn=de(require("fs")),pxn=de(ti());var vXo=1.5*1024*1024,$Gt=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new pxn.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}`}},lXe=class extends $Gt{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(qo).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(nc).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,dxn.raceCancellationError)(CXo(r,vXo),this._disposedCts.token)}))}catch{return}}};async function CXo(t,e){return new Promise((r,n)=>{let o=fxn.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(CXo,"readLocalTextFileUsingReadStream");var uXe=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new VGt;this._onDidCreateFiles=new Wi;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new Wi;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new Wi;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=rs(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 lXe(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(Yx).getWatchedFileUris(this.workspaceFolder),r=this.ctx.get(nc);(r.enabled?(await Promise.all(e.map(async o=>(await r.evaluate(o.uri,"")).isBlocked?void 0:o))).filter(o=>o!==void 0):e).forEach(o=>{let s=rs(o.uri);s&&this._fsFileTree.addFile(s,new lXe(o.uri,this.limiter,this.ctx))})})(),this._initializePromise}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(qo).stat(e)).type}catch{return}}},VGt=class{constructor(){this._tree=cXe.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 hxn=de(nl());var dXe=class extends GQ{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new Wi;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new Wi;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(qS).addListener(this),this._fileReadLimiter=new hxn.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 uXe(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 Pwe=de(dw()),mxn=de(Sl()),fw=de(nl()),Qq=de(FO());var il=new fe("Semantic Search"),r2=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new WZe(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 WGt(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)}},WGt=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 dXe(this._ctx),o=new yZe(this._ctx);this._localDiffSearch=new tXe(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new gZe(this._ctx),this._codeSearchChunkSearch=new EZe(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new KZe(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new oXe(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new VZe(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&!xP(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 Qq.StopWatch,s=await this.resolveQueryText(e,n);il.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:PA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw il.error(this._ctx,"Semantic search failed",l.err),f0.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);il.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,fw.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);il.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,PA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return il.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),f0.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){Hh(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(wP(n))throw n;return il.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new $ue(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){il.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,fw.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new Qq.StopWatch;il.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,fw.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,fw.raceCancellationError)((0,fw.raceTimeout)(u,n),c);if(d?.isOk())return il.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;il.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 Qq.StopWatch,m=await eXe([u,f]);return il.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){il.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){il.info(this._ctx,`Both strategies available for folder: ${l}, using embeddings with TF-IDF fallback`);let f=8e3,h=new Qq.StopWatch,m=await this.runSearchStrategyWithFallback(u,()=>(0,fw.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),il.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){il.info(this._ctx,`Using embeddings search for folder: ${l}`);let f=new Qq.StopWatch,h=await this.runSearchStrategy(u,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(u.id),il.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){il.info(this._ctx,`Using TF-IDF search for folder: ${l}`);let f=new Qq.StopWatch,h=await this.runSearchStrategy(d,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(d.id),il.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 il.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return il.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),Pwe.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new Qq.StopWatch;il.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,fw.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(il.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),Pwe.Result.ok({strategy:e.id,result:c})):(il.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),Pwe.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(wP(c))throw il.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return il.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),Pwe.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,mxn.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(nc).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){il.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,fw.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*Yxe,d=s.filter(f=>f.distance.value>=u);return il.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return wP(s)||il.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,fw.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:Kxe(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,rs(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=DA(e.text);return`File: \`${r}\` ${n} ${e.text} -${n}`}};var mxn=new fe("ProjectContextSkill"),q_d=S.Object({uri:S.String(),snippet:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})})}),EXo=47,WGt=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(aF);return}let r=[],n=this.turnContext.ctx.get(ii),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 IO(d.document,u,u),h=new Ar([l]),g=zxe(c)?.5:.8;r.push([`Code excerpt from file \`${rs(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(Kue,c,td(d),u)}}if(r.length>0)return r.unshift([new Ar(["The user wants you to consider the following snippets when computing your answer."]),1]),new Ar(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)}},aF="collect-project-context",lXe=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if(mxn.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(aF,"Collecting relevant project context"),IP(e.ctx)){await e.steps.error(aF,"Workspace indexing is disabled by configuration");return}await e.info(is`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(t2);if(!r){await e.steps.error(aF,"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(aF,"No workspace folders available for search");return}let o=Pn(e.turn.request.message),c=await(this.dependencies.parseUserQuery??JCn)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(aF,"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:XCn,maxResults:Math.min(10*c.length,EXo),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??Iyn)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(aF,"No project context found");return}return await e.steps.finish(aF),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(aF,"Project context search failed"),mxn.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}},Kue="project-context",uXe=class extends gg{static{a(this,"ProjectContextSkill")}constructor(e){super(Kue,"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 WGt(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=>!IP(r))}};var zGt=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[Kue]}};async function ew(t){let e=[];return e.push(new CJe),e.push(...await t.get(WP).agents()),e.push(new zGt),e.push(new pJe),e}a(ew,"getAgents");p();p();var fw=require("fs"),aJ=de(require("path"));Mo();var p0=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return Ft(this.ctx,Ye.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=aJ.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:Mt(),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 aJ.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return aJ.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=aJ.dirname(o);await fw.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` +${n}`}};var gxn=new fe("ProjectContextSkill"),z_d=S.Object({uri:S.String(),snippet:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})})}),bXo=47,zGt=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(cF);return}let r=[],n=this.turnContext.ctx.get(ii),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 IO(d.document,u,u),h=new Ar([l]),g=zxe(c)?.5:.8;r.push([`Code excerpt from file \`${rs(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(Kue,c,td(d),u)}}if(r.length>0)return r.unshift([new Ar(["The user wants you to consider the following snippets when computing your answer."]),1]),new Ar(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)}},cF="collect-project-context",fXe=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if(gxn.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(cF,"Collecting relevant project context"),xP(e.ctx)){await e.steps.error(cF,"Workspace indexing is disabled by configuration");return}await e.info(is`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(cF,"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(cF,"No workspace folders available for search");return}let o=Pn(e.turn.request.message),c=await(this.dependencies.parseUserQuery??ZCn)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(cF,"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:ebn,maxResults:Math.min(10*c.length,bXo),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??xyn)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(cF,"No project context found");return}return await e.steps.finish(cF),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(cF,"Project context search failed"),gxn.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}},Kue="project-context",pXe=class extends gg{static{a(this,"ProjectContextSkill")}constructor(e){super(Kue,"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 zGt(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=>!xP(r))}};var YGt=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[Kue]}};async function tw(t){let e=[];return e.push(new TJe),e.push(...await t.get(zP).agents()),e.push(new YGt),e.push(new gJe),e}a(tw,"getAgents");p();p();var pw=require("fs"),aJ=de(require("path"));Oo();var p0=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return Ft(this.ctx,Ye.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=aJ.dirname(o);await pw.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` +`;await pw.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:Mt(),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 aJ.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return aJ.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await pw.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 pw.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 pw.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=aJ.dirname(o);await pw.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 aJ.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 Xf({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=gxn(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 Xf({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 Xf({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=gxn(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 Xf({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 E=o.data.result;E&&(u=E.result,d=E.error,f=E.resultDetails,h=E.toolSpecificData,m=E.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 Axn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(Axn,"createUserMessageEvent");function yxn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(yxn,"createUserMessageRenderedEvent");function dXe(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(dXe,"createAssistantMessageEvent");function Exn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:Mt(),timestamp:new Date().toISOString(),parentId:n}}a(Exn,"createToolExecutionStartEvent");function _xn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:Mt(),timestamp:new Date().toISOString(),parentId:n}}a(_xn,"createToolExecutionCompleteEvent");function fXe(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:Mt(),timestamp:new Date().toISOString(),parentId:e}}a(fXe,"createAssistantTurnStartEvent");function Jue(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(Jue,"createAssistantTurnEndEvent");function gxn(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(gxn,"parseAssistantMessageContent");var cF=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},HO=class{constructor(e){this.ctx=e;this.transcriptPersistence=new p0(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 cF(`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 cF(`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 cF(`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 cF("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 cF(`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 cF(`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 cF||(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 Xf)return e;let r=e,n=new Xf(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=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r)},{});Et(this.ctx,"conversationPartition.restoration.started",n,0)}sendCompletedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),partitionId:String(n)},{turnCount:o,restorationTimeMs:s});Et(this.ctx,"conversationPartition.restoration.completed",c,0)}sendFailedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),errorCode:n},{restorationTimeMs:o});Et(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();p();p();p();var vxn={id:0,start_offset:0,stop_offset:0,type:"ip_code_citations",details:{},citations:{snippet:`html lang="en"> +`;await pw.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 aJ.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 pw.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 Xf({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=Axn(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 Xf({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 pw.promises.access(s)}catch{continue}await pw.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 Xf({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=Axn(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 Xf({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 E=o.data.result;E&&(u=E.result,d=E.error,f=E.resultDetails,h=E.toolSpecificData,m=E.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 pw.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 yxn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(yxn,"createUserMessageEvent");function Exn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(Exn,"createUserMessageRenderedEvent");function hXe(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(hXe,"createAssistantMessageEvent");function _xn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:Mt(),timestamp:new Date().toISOString(),parentId:n}}a(_xn,"createToolExecutionStartEvent");function vxn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:Mt(),timestamp:new Date().toISOString(),parentId:n}}a(vxn,"createToolExecutionCompleteEvent");function mXe(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:Mt(),timestamp:new Date().toISOString(),parentId:e}}a(mXe,"createAssistantTurnStartEvent");function Jue(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(Jue,"createAssistantTurnEndEvent");function Axn(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(Axn,"parseAssistantMessageContent");var lF=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},HO=class{constructor(e){this.ctx=e;this.transcriptPersistence=new p0(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 lF(`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 lF(`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 lF(`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 lF("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 lF(`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 lF(`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 lF||(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 Xf)return e;let r=e,n=new Xf(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=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r)},{});Et(this.ctx,"conversationPartition.restoration.started",n,0)}sendCompletedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),partitionId:String(n)},{turnCount:o,restorationTimeMs:s});Et(this.ctx,"conversationPartition.restoration.completed",c,0)}sendFailedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),errorCode:n},{restorationTimeMs:o});Et(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();p();p();p();var Cxn={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"}},Cxn="Alright, This response contains a code citation.";p();var bxn=` +<`,url:"https://github.com/duonghle285/gnoud9x.github.io/tree/c95127bc5b7a491d9223f21ac3b8c5100996e754/26062020-vehinhchunhat%2Findex.html",ip_type:"LICENSE",license:"NOASSERTION"}},bxn="Alright, This response contains a code citation.";p();var Sxn=` # Should render ## Links @@ -3077,16 +3077,16 @@ 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 Sxn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",_Xo=95,vXo={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 Txn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(Txn,"parseFirstNumber");function CXo(t){return Math.min(100,Math.max(0,t))}a(CXo,"clampPercentage");function bXo(t){return t.includes("session")?"session":"weekly"}a(bXo,"getRateLimitNotificationKind");function SXo(t,e,r){let n=Wle(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(SXo,"getRateLimitNotificationMessage");function TXo(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(TXo,"getRateLimitErrorVariant");var YGt=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 ih(Sxn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},ZGt=new YGt,KGt=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=bXo(n),s=CXo(Txn(n)??_Xo),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=SXo(o,s,c);return await e.ctx.get(qS).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new ih("Alright, I'm producing a rate limit notification")}},XGt=new KGt,JGt=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=TXo(n),s=Txn(n),c=$_.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:vXo[o],isAuto:n.includes("auto")});return new ih(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},e$t=new JGt;p();function IXo(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(IXo,"createVulnerability");var xxn=wxe` +`;p();var Txn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",SXo=95,TXo={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 Ixn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(Ixn,"parseFirstNumber");function IXo(t){return Math.min(100,Math.max(0,t))}a(IXo,"clampPercentage");function xXo(t){return t.includes("session")?"session":"weekly"}a(xXo,"getRateLimitNotificationKind");function wXo(t,e,r){let n=Wle(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(wXo,"getRateLimitNotificationMessage");function RXo(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(RXo,"getRateLimitErrorVariant");var KGt=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 ih(Txn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},XGt=new KGt,JGt=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=xXo(n),s=IXo(Ixn(n)??SXo),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=wXo(o,s,c);return await e.ctx.get(HS).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new ih("Alright, I'm producing a rate limit notification")}},e$t=new JGt,ZGt=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=RXo(n),s=Ixn(n),c=V_.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:TXo[o],isAuto:n.includes("auto")});return new ih(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},t$t=new ZGt;p();function kXo(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(kXo,"createVulnerability");var wxn=wxe` 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. -`,pXe=wxe` +`,gXe=wxe` \`\`\`kotlin fun main() { println("Hello, World!") } \`\`\` -`,xXo=wxe` +`,PXo=wxe` ### Inputs \`p\` - paragraph message @@ -3102,20 +3102,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 -`,t$t=` +`,r$t=` -`,Ixn=xxn+t$t+pXe;function wxn(t){let e=1,r="",n=[];if(t.length===0)r=Ixn;else if(t==="0")r=Ixn,e=0;else{if(t==="help")return{reply:xXo,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+=xxn+t$t:s==="c"&&(r+=pXe+t$t);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(pXe,o);if(c===-1)break;let l=c+pXe.length;for(let u=0;u0?r:"Debug Fail")}},RXo=new r$t,n$t=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 ih("Alright, I'm producing a notification",void 0,[],s)}},kXo=new n$t,i$t=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 ih(wXo,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},PXo=new i$t,o$t=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 ih(await M_n(e))}},DXo=new o$t,s$t=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[GP,lE]}instructions(e,r){return"Create a function that prints a christmas tree"}},NXo=new s$t,a$t=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 ih(Pn(e.turn.request.message))}},MXo=new a$t,c$t=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(Ag).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+=is` +`,xxn=wxn+r$t+gXe;function Rxn(t){let e=1,r="",n=[];if(t.length===0)r=xxn;else if(t==="0")r=xxn,e=0;else{if(t==="help")return{reply:PXo,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+=wxn+r$t:s==="c"&&(r+=gXe+r$t);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(gXe,o);if(c===-1)break;let l=c+gXe.length;for(let u=0;u0?r:"Debug Fail")}},NXo=new n$t,i$t=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 ih("Alright, I'm producing a notification",void 0,[],s)}},MXo=new i$t,o$t=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 ih(DXo,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},OXo=new o$t,s$t=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 ih(await O_n(e))}},LXo=new s$t,a$t=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[$P,lE]}instructions(e,r){return"Create a function that prints a christmas tree"}},BXo=new a$t,c$t=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 ih(Pn(e.turn.request.message))}},FXo=new c$t,l$t=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(Ag).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+=is` ### ${c} prompt \`\`\`\` ${s} \`\`\`\` - `}),new ih(o)}return new ih("No prompt available")}},OXo=new c$t,l$t=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 ih(await O_n(e,n,o))}},LXo=new l$t,u$t=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}=wxn(r);return e.turn.annotations.push(...o),new ih(n,void 0,e.turn.annotations)}},BXo=new u$t,d$t=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(vxn),new ih(Cxn,void 0,e.turn.annotations)}},FXo=new d$t,f$t=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 ih(bxn)}},UXo=new f$t,p$t=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"}},QXo=new p$t,h$t=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[Kue]}},qXo=new h$t,m$t=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 ih("Alright, I'm producing a notification",void 0,[],[],[],e)}},jXo=new m$t;function Rxn(){return[RXo,ZGt,XGt,e$t,kXo,PXo,NXo,DXo,MXo,OXo,LXo,BXo,FXo,jXo,UXo,QXo,qXo]}a(Rxn,"getDebugTemplates");p();var kxn=S.Object({uri:S.String(),problems:S.Array(S.Object({message:S.String(),range:Sf}))}),g$t=class{constructor(e){this.turnContext=e}static{a(this,"ProblemsInActiveDocumentSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument(e);if(await this.turnContext.collectFile(Qq,e.uri,td(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(Qq,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(Qq,"problem markers")}getElidableProblems(e,r,n){let o=[];return o.push(new Ar([`Problems and errors in the active document (\`${n}\`):`])),o.push(...this.createElidableProblems(e,r)),Cq(o,"linear")}createElidableProblems(e,r){return e.problems.map(n=>{let o=[];o.push(new Ar([`- "${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 Ar([["```"+l,1],[PS(c),.8],["```",1]]))}return new Ar(o)})}isEmpty(e){return e.start.line===e.end.line&&e.start.character===e.end.character}async preElideDocuments(e){let r=(await xo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},Qq="problems-in-active-document",hXe=class extends gg{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(Qq,"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 g$t(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 mXe=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 Wxe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=zxe(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(!zxe(e))return;let n=this.turnContext.ctx.get($r).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new Wxe(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 Ar([[`${HXo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async asTestFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${GXo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async asExampleFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${$Xo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async fileInfoForPrompt(e){if(!this.turnContext.isFileIncluded(e)){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument({uri:e});if(await this.turnContext.collectFile(r2,e,td(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[PS(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(Qo).stat(e),!0}catch{return!1}}}},HXo="Code excerpt from the implementation source file",GXo="Code excerpt from the test file",$Xo="Code excerpt from an example test file";var Pxn=S.Object({currentFileUri:S.String(),sourceFileUri:S.Optional(S.String()),testFileUri:S.Optional(S.String())}),A$t=class{constructor(e){this.turnContext=e}static{a(this,"TestContextSkillProcessor")}value(){return .9}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=new mXe(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(r2,e.testFileUri,td(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(r2,e.sourceFileUri,td(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(r2,e.sourceFileUri,td(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(r2,e.testFileUri,td(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},r2="test-context",gXe=class extends gg{static{a(this,"TestContextSkill")}constructor(e){super(r2,"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 A$t(r))}};p();var Dxn=S.Object({failures:S.Array(S.Object({testName:S.String(),testSuite:S.Optional(S.String()),testFileUri:S.String(),failureReason:S.Optional(S.String()),testLocation:Sf}))}),y$t=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(cJ,"test failures");let r=await this.createElidableFailures(e.failures);if(r){let n=new Ar(["The latest test run produced the following failures and errors:"]);return new Ar([[n,1],[r,1]])}}}async createElidableFailures(e){let r=this.turnContext.ctx.get(ii),n=[],o=this.groupFailuresByFile(e);for(let[s,c]of o.entries()){let l=await r.getOrReadTextDocument({uri:s});if(await this.turnContext.collectFile(cJ,s,td(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 Ar(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 ih(o)}return new ih("No prompt available")}},UXo=new l$t,u$t=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 ih(await L_n(e,n,o))}},QXo=new u$t,d$t=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}=Rxn(r);return e.turn.annotations.push(...o),new ih(n,void 0,e.turn.annotations)}},qXo=new d$t,f$t=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(Cxn),new ih(bxn,void 0,e.turn.annotations)}},jXo=new f$t,p$t=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 ih(Sxn)}},HXo=new p$t,h$t=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"}},GXo=new h$t,m$t=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[Kue]}},$Xo=new m$t,g$t=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 ih("Alright, I'm producing a notification",void 0,[],[],[],e)}},VXo=new g$t;function kxn(){return[NXo,XGt,e$t,t$t,MXo,OXo,BXo,LXo,FXo,UXo,QXo,qXo,jXo,VXo,HXo,GXo,$Xo]}a(kxn,"getDebugTemplates");p();var Pxn=S.Object({uri:S.String(),problems:S.Array(S.Object({message:S.String(),range:Sf}))}),A$t=class{constructor(e){this.turnContext=e}static{a(this,"ProblemsInActiveDocumentSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument(e);if(await this.turnContext.collectFile(qq,e.uri,td(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(qq,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(qq,"problem markers")}getElidableProblems(e,r,n){let o=[];return o.push(new Ar([`Problems and errors in the active document (\`${n}\`):`])),o.push(...this.createElidableProblems(e,r)),bq(o,"linear")}createElidableProblems(e,r){return e.problems.map(n=>{let o=[];o.push(new Ar([`- "${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 Ar([["```"+l,1],[DS(c),.8],["```",1]]))}return new Ar(o)})}isEmpty(e){return e.start.line===e.end.line&&e.start.character===e.end.character}async preElideDocuments(e){let r=(await wo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},qq="problems-in-active-document",AXe=class extends gg{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(qq,"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 A$t(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 yXe=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 Wxe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=zxe(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(!zxe(e))return;let n=this.turnContext.ctx.get($r).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new Wxe(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 Ar([[`${WXo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async asTestFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${zXo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async asExampleFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${YXo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async fileInfoForPrompt(e){if(!this.turnContext.isFileIncluded(e)){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument({uri:e});if(await this.turnContext.collectFile(n2,e,td(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[DS(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(qo).stat(e),!0}catch{return!1}}}},WXo="Code excerpt from the implementation source file",zXo="Code excerpt from the test file",YXo="Code excerpt from an example test file";var Dxn=S.Object({currentFileUri:S.String(),sourceFileUri:S.Optional(S.String()),testFileUri:S.Optional(S.String())}),y$t=class{constructor(e){this.turnContext=e}static{a(this,"TestContextSkillProcessor")}value(){return .9}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=new yXe(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(n2,e.testFileUri,td(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(n2,e.sourceFileUri,td(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(n2,e.sourceFileUri,td(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(n2,e.testFileUri,td(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},n2="test-context",EXe=class extends gg{static{a(this,"TestContextSkill")}constructor(e){super(n2,"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 y$t(r))}};p();var Nxn=S.Object({failures:S.Array(S.Object({testName:S.String(),testSuite:S.Optional(S.String()),testFileUri:S.String(),failureReason:S.Optional(S.String()),testLocation:Sf}))}),E$t=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(cJ,"test failures");let r=await this.createElidableFailures(e.failures);if(r){let n=new Ar(["The latest test run produced the following failures and errors:"]);return new Ar([[n,1],[r,1]])}}}async createElidableFailures(e){let r=this.turnContext.ctx.get(ii),n=[],o=this.groupFailuresByFile(e);for(let[s,c]of o.entries()){let l=await r.getOrReadTextDocument({uri:s});if(await this.turnContext.collectFile(cJ,s,td(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 Ar(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 Ar([is`\n\n- Test ${s}${c}${l}failed${u}The failed test is ${d}.\n`]),1]});return new Ar(n)}appendCode(e,r,n){let o=[new Ar([` The code of file \`${r}\` is: -`]),.6],s=[new Ar([["```"+n.detectedLanguageId,1],[PS(n.getText()),.9],["```",1]]),.7];return new Ar([[e,1],o,s])}},cJ="test-failures",AXe=class extends gg{static{a(this,"TestFailuresSkill")}constructor(e){super(cJ,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new y$t(r))}};var ih=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")}},pw=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}},VXo=new pw("tests","Generate unit tests","Generate Tests",is` +`]),.6],s=[new Ar([["```"+n.detectedLanguageId,1],[DS(n.getText()),.9],["```",1]]),.7];return new Ar([[e,1],o,s])}},cJ="test-failures",_Xe=class extends gg{static{a(this,"TestFailuresSkill")}constructor(e){super(cJ,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new E$t(r))}};var ih=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")}},hw=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}},KXo=new hw("tests","Generate unit tests","Generate Tests",is` 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. @@ -3126,7 +3126,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. - `,[r2,cJ],["chat-panel","agent-panel","editor"]),WXo=new pw("simplify","Simplify the code","Simplify This",is` + `,[n2,cJ],["chat-panel","agent-panel","editor"]),JXo=new hw("simplify","Simplify the code","Simplify This",is` 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. @@ -3137,7 +3137,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),zXo=new pw("fix","Fix problems and compile errors","Fix This",is` + Do not reply with the original code but only a simplified version.`,!0),ZXo=new hw("fix","Fix problems and compile errors","Fix This",is` Fix the provided errors and problems. Do not invent new problems. The fixed code should still be readable and easy to understand. @@ -3148,13 +3148,13 @@ The code of file \`${r}\` is: Show how the error can be fixed by providing a code snippet that displays the code before and after it has been fixed after each group. Shorten fully qualified class names to the simple class name and full file paths to the file names only. When enumerating the groups, start with the word "Problem" followed by the number and a quick summary of the problem. Format this headline bold. - At last provide a completely fixed version of the code if the fixes required multiple code changes.`,[Qq],["editor","chat-panel","agent-panel","inline","inline-agent"],is` + At last provide a completely fixed version of the code if the fixes required multiple code changes.`,[qq],["editor","chat-panel","agent-panel","inline","inline-agent"],is` Fix the provided errors and problems. Do not invent new problems. 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),YXo=new pw("explain","Explain how the code works","Explain This",is` + Briefly explain the problems without repeating the detailed error message.`,!0),XXo=new hw("explain","Explain how the code works","Explain This",is` 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. @@ -3162,14 +3162,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),KXo=new pw("doc","Document the current selection or file","Generate Docs",is` + 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),ees=new hw("doc","Document the current selection or file","Generate Docs",is` 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"],is` 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),Nxn=new pw("create-agent","Create a new custom agent","Create Agent",is` + Place the comments before functions and methods, unless the language has a different convention (for example Python's docstring).`,!0),Mxn=new hw("create-agent","Create a new custom agent","Create Agent",is` 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. @@ -3188,7 +3188,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"]),Mxn=new pw("create-skill","Create a new custom skill","Create Skill",is` + After the file is created, open it and briefly summarize what you created and how to use it.`,[],["chat-panel","agent-panel"]),Oxn=new hw("create-skill","Create a new custom skill","Create Skill",is` 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. @@ -3206,7 +3206,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Oxn=new pw("create-instruction","Create a new instruction file","Create Instruction",is` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Lxn=new hw("create-instruction","Create a new instruction file","Create Instruction",is` 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. @@ -3224,7 +3224,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Lxn=new pw("create-prompt","Create a new prompt file","Create Prompt",is` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Bxn=new hw("create-prompt","Create a new prompt file","Create Prompt",is` 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. @@ -3242,7 +3242,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Bxn=new pw("create-hook","Create a new hook configuration","Create Hook",is` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Fxn=new hw("create-hook","Create a new hook configuration","Create Hook",is` 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 @@ -3295,7 +3295,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"]),E$t=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=SQt(e.conversation),n=is` + \`preToolUse\` filter).`,[],["chat-panel","agent-panel"]),_$t=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=TQt(e.conversation),n=is` 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 ih(n+` @@ -3303,7 +3303,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 ih(n)}},JXo=new E$t,_$t=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=v$t(e.ctx).filter(o=>o!=this),n=is` +\`\`\``):new ih(n)}},tes=new _$t,v$t=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=C$t(e.ctx).filter(o=>o!=this),n=is` 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(` @@ -3315,39 +3315,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 ih(n)}},ZXo=new _$t,Fxn=new Set([Nxn.id,Mxn.id,Oxn.id,Lxn.id,Bxn.id]);function n2(){return[VXo,WXo,zXo,YXo,KXo,Nxn,Mxn,Oxn,Lxn,Bxn,JXo,ZXo,...Rxn()]}a(n2,"getPromptTemplates");function v$t(t){let e=n2();return!kCe(t)&&!O1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(v$t,"getUserFacingPromptTemplates");var Uxn=de(require("path"));var C$t=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??Ji(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||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}get providers(){return x3(this.promptFileEntry.promptPath.metadata)}},Cg=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 dO}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(Uxn.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(`${WQ}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${WQ}${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(ug).collect(this.ctx,"prompt",e,{includePlugins:r?.includePlugins})).map(u=>new C$t(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(WQ))return e.message=`Follow instructions: ${f.content} + `;return new ih(n)}},res=new v$t,Uxn=new Set([Mxn.id,Oxn.id,Lxn.id,Bxn.id,Fxn.id]);function i2(){return[KXo,JXo,ZXo,XXo,ees,Mxn,Oxn,Lxn,Bxn,Fxn,tes,res,...kxn()]}a(i2,"getPromptTemplates");function C$t(t){let e=i2();return!PCe(t)&&!O1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(C$t,"getUserFacingPromptTemplates");var Qxn=de(require("path"));var b$t=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??Ji(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||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return YQ(this.promptFileEntry.promptPath)}get providers(){return w3(this.promptFileEntry.promptPath.metadata)}},Cg=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 dO}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(Qxn.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(`${zQ}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${zQ}${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(ug).collect(this.ctx,"prompt",e,{includePlugins:r?.includePlugins})).map(u=>new b$t(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(zQ))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=n2().find(g=>g.id===u&&g.scopes.includes(h));return m?.instructions?(e.message=m.instructions(this.ctx,d,"inline"),!0):!1}};var yXe=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},zo=class{constructor(e){this.ctx=e;this.conversations=new Cn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new lK([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(Yh).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new yXe(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(HO).restoreConversation(r,n);if(!u){ot.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new lK(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(Yh).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new yXe(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}`),At(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new p0(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"&&!GW.has(to(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!GW.has(to(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 p0(this.ctx);if(!n.isEnabled())return;let o=Axn(Pn(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new p0(this.ctx);if(!n.isEnabled()||!r.response)return;let o=Pn(r.response.message),s=String(r.id),c=dXe(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=Jue(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&Pn(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"@");(await ew(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(Pn(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"/"),s=n2().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(Pn(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(Pn(n.request.message),"/"),l=await e.get(Cg).getPromptTemplate(o);l&&(l.uri.startsWith(WQ)?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=i2().find(g=>g.id===u&&g.scopes.includes(h));return m?.instructions?(e.message=m.instructions(this.ctx,d,"inline"),!0):!1}};var vXe=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},Yo=class{constructor(e){this.ctx=e;this.conversations=new Cn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new uK([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(Yh).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new vXe(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(HO).restoreConversation(r,n);if(!u){ot.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new uK(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(Yh).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new vXe(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}`),At(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new p0(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"&&!$W.has(to(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!$W.has(to(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 p0(this.ctx);if(!n.isEnabled())return;let o=yxn(Pn(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new p0(this.ctx);if(!n.isEnabled()||!r.response)return;let o=Pn(r.response.message),s=String(r.id),c=hXe(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=Jue(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&Pn(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"@");(await tw(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(Pn(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"/"),s=i2().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(Pn(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(Pn(n.request.message),"/"),l=await e.get(Cg).getPromptTemplate(o);l&&(l.uri.startsWith(zQ)?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(Yh).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 p0(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 EXe=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 _Xe=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 XXo="X-Initiator",ees="X-Interaction-ID",tes="X-Interaction-Type";var vXe=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},b$t=class extends vXe{static{a(this,"User")}static id(){return"user"}},S$t=class extends vXe{static{a(this,"Agent")}static id(){return"agent"}},T$t=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[XXo]:this.initiator,[ees]:this.interactionId,[tes]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return OA.agent(e??this.interactionType,this.interactionId)}},OA=class t extends T$t{static{a(this,"LlmInteraction")}static user(e,r){return new t(b$t,e,r)}static agent(e,r){return new t(S$t,e,r)}};function Qxn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(Qxn,"interactionTypeForChatMode");var hw=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new I$t(this),this.steps=new _Xe(e,r,n,e.get(Tc)),this.collector=new x$t(r,n,e.get(Tc)),this.agentToolCalls=new EXe(e,r,n,e.get(Tc))}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 OA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?OA.agent(e,this.turn.telemetryId):OA.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(Tc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},CXe=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")}},Oxe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},I$t=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(zo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(Ag).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 CXe(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(Yh).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(Ag).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof CXe||o instanceof Oxe)throw o;ot.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},x$t=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 res={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function qxn(t){let e=Ft(t,Ye.AutoCompress);return{...res,enabled:e}}a(qxn,"getAutomaticCompressionConfig");p();var qq=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(gs).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 E=Pn(y.request.message),_=this.estimateTokensFromText(E)+n.baseTokensPerMessage;if(l+=Math.ceil(_*t.MESSAGE_OVERHEAD_MULTIPLIER),y.request.references?.length&&(d+=Math.ceil(y.request.references.length*50*t.MESSAGE_OVERHEAD_MULTIPLIER)),y.response){let v=Pn(y.response.message),b=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(b*t.MESSAGE_OVERHEAD_MULTIPLIER),TK(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 b of v.toolCalls)if(b.result&&Array.isArray(b.result)){let T="";for(let w of b.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 ZC=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new qq}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=qxn(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(E){ot.warn(this.ctx,`Failed to calculate context size after compression: ${E instanceof Error?E.message:String(E)}`)}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=Wt.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});Et(this.ctx,"automaticCompression.skipped",c,0)}sendTriggeredTelemetry(e,r,n,o,s,c,l){let u=Wt.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});Et(this.ctx,"automaticCompression.triggered",u,0)}sendExceptionTelemetry(e,r,n,o,s,c){let l=Wt.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});Et(this.ctx,"automaticCompression.triggered",l,0)}};p();var LA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var qd=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var bXe=de(ale());var jxn=new Map;function hE(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(hE,"createNumberRange");function w$t(t){return[...t].sort((e,r)=>r.length-e.length)}a(w$t,"sortByStringLengthDesc");async function nes(t){let e=jxn.get(t);if(e)return e;let r=(async()=>{try{let n=await k$e(`tree-sitter-${t}.wasm`);return await bXe.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return jxn.set(t,r),r}a(nes,"loadShellLanguage");function Hxn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(Hxn,"isPowerShell");var ies=new Map([["sh",w$t([...hE(1,9).concat("").map(t=>`${t}<<<`),...hE(1,9).concat("").flatMap(t=>hE(1,9).map(e=>`${t}>&${e}`)),...hE(1,9).concat("").map(t=>`${t}<>`),...hE(1,9).concat("&","").map(t=>`${t}>>`),...hE(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",w$t([...hE(1,9).concat("").map(t=>`${t}<<<`),...hE(1,9).concat("").flatMap(t=>hE(1,9).map(e=>`${t}>&${e}`)),...hE(1,9).concat("").map(t=>`${t}<>`),...hE(1,9).concat("&","").map(t=>`${t}>>`),...hE(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",w$t([...hE(1,6).concat("*","").flatMap(t=>hE(1,6).map(e=>`${t}>&${e}`)),...hE(1,6).concat("*","").map(t=>`${t}>>`),...hE(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function oes(t,e){let r,n=e.replace(/\.exe$/,"");Hxn(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=ies.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(oes,"splitCommandLineIntoSubCommands");async function SXe(t,e){try{let r;Hxn(e)?r="powershell":r="bash",await bXe.default.init();let n,o;try{n=new bXe.default;let s=await nes(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 oes(t,e)}}a(SXe,"extractSubCommandsWithTreeSitter");var ses=new Set(["sudo","env"]),aes=/^[A-Za-z_][A-Za-z0-9_]*=/;function R$t(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(aes.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||ses.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(R$t,"extractCommandNameFromSubCommand");var Zue=new fe("CommandLineAutoApprover"),Gxn=/(?!.*)/,ces=/^[A-Z_][A-Z0-9_]*=/i,tT=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(ces.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 SXe(e,r);Zue.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 Zue.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 Zue.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Zue.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await SXe(e,r),o=[...new Set(n.map(R$t).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await SXe(e,r),o=n.map(s=>R$t(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})}}}),Zue.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Zue.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)?Gxn:c}catch{return Gxn}}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 TXe=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 IXe=class{constructor(e){this.ctx=e}static{a(this,"DefaultTextDocumentProvider")}async getByUri(e){return await this.ctx.get(ii).getOrReadTextDocument({uri:e})}};p();p();p();p();p();p();var xXe=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=les(this.stdout)}static{a(this,"CommandHookResult")}};function les(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(les,"parseOutput");var D$t=require("child_process");var wXe=new fe("HookExecutor"),RXe=class{constructor(){this.handlers=[new k$t,new P$t]}static{a(this,"HookExecutor")}async execute(e,r,n,o){if(!e.get(tp).isTrusted(r.source)){wXe.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){wXe.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}wXe.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},kXe=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"&&wXe.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,E=setTimeout(()=>{s.kill("SIGTERM"),A(new Error(`Command timed out after ${y} seconds`))},y*1e3),_=a(()=>{clearTimeout(E)},"cleanup");s.on("error",v=>{_(),A(new Error(`Failed to execute command: ${v.message}`))}),s.on("close",v=>{_(),g(new xXe(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"]}}},k$t=class extends kXe{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,D$t.spawn)(e.bash,[],n)}},P$t=class extends kXe{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,D$t.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var ues=new RXe,XC=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 ues.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var lF=class extends XC{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var i2=class extends XC{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var Xue={allow:"allow",deny:"deny",ask:"ask"},o2=class extends XC{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var lJ=class extends XC{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var uJ=class extends XC{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var s2=class extends XC{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var dJ=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 fJ(t){try{return!(!Ft(t,Ye.EnableHooks)||t.get(jl).getPolicyValue("customHook.enabled")===!1)}catch{return!1}}a(fJ,"hooksEnabled");var des=".github/hooks/**/*.json",fes="agentHook.execution",pes={sessionStart:uJ,sessionEnd:lJ,userPromptSubmitted:s2,preToolUse:o2,postToolUse:i2,errorOccurred:lF},mE=class{constructor(e){this.logger=new fe("HookService");this.gateSubscriptions=[];this.ctx=e,this.registration=this.ctx.get(wA).register("hook",[des]),this.subscribeToGateChanges()}static{a(this,"HookService")}dispose(){this.registration.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&&At(e,fes,{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()?this.ctx.get(ug).collect(this.ctx,"hook",e):[]}areHooksEnabled(){let e=fJ(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(Lo);this.lastEnableHooks=Ft(this.ctx,Ye.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ye.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(jl);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(a0).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(pes).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(ug).collect(e,"hook",[n]),c=[];for(let l of s){let u=l.parsedPromptFile,d=u.hooks[o];d!==void 0&&c.push(new r(u.uri,[...d]))}return c}};p();function BA(t){return`[${Ji(t)}](${t})`}a(BA,"formatUriForFileWidget");function id(t,e){let r=hes(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(id,"resolvePathInput");function hes(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 GW.has(s)||la.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(la.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||$xn()&&ges(t)||$xn()&&t.startsWith("\\\\"))return Ks(t)}a(hes,"resolveFsUri");function $xn(){return process.platform==="win32"}a($xn,"isWindows");function mes(t){return t>=65&&t<=90||t>=97&&t<=122}a(mes,"isWindowsDriveLetter");function ges(t){return mes(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(ges,"hasDriveLetter");function GO(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof Rr?r.value:r instanceof _K?"":r instanceof KQ?JSON.stringify(r.value):"").join(` -`)),e===""?"(empty)":e}a(GO,"parseToolResultToString");function PXe(t){let{content:e}=t;return{message:GO(e)}}a(PXe,"formatToolErrorResult");function Vxn(t){let{content:e}=t,r={data:e.map(n=>n instanceof Rr?{type:"text",value:n.value}:n instanceof _K?{type:"text",value:""}:n instanceof KQ?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof JQ&&(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(Vxn,"formatToolSuccessResult");function pJ(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(pJ,"extractShellFromToolDescription");var DXe=new fe("HookTrigger"),ede=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(mE),c=o?new dJ(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,o2,{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 DXe.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(mE),l=s?new dJ(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,i2,{timestamp:Date.now(),cwd:un(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:GO(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){DXe.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(mE),o=this.extractPromptFromMessage(e),s=r?new dJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,s2,{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){DXe.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(mE),o=Ft(this.ctx,Ye.HookErrorOccurredStackTrace),s=r?new dJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,lF,{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){DXe.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===Xue.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 N$t=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},Nwe=class extends N$t{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var hJ=de(Io());var Hn=class t extends hJ.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(hJ.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,hJ.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> -`)),vscpp(M$t,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},M$t=class extends hJ.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function Wxn(){return vscpp(Hn,{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(Hn,{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(Hn,{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(Hn,{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(Wxn,"renderAskModeInstructionBody");p();p();var jq=class extends lr{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 NXe=class extends lr{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var zxn=require("path");var MXe=class extends lr{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,zxn.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(gs).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=pJ(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 Hq=class extends lr{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=to(c.uri);return` - ${la.isRegisteredScheme(l.scheme)?c.uri:rs(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 Yxn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(Yxn,"partsLength");async function Jxn(t,e=1/0,r){let n=Kxn(0,t,e),o=e-Yxn(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 Aes();let d=Kxn(l.level+1,u,o-1);d.length&&(s=!0,o-=Yxn(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(Jxn,"visualFileTree");function Kxn(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(Kxn,"toParts");var Aes=a(()=>({tree:"",files:[]}),"emptyTree");p();async function OXe(t,e){let r=to(e);return la.isRegisteredScheme(r.scheme)?(await t.get(la).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(Qo).readDirectory(e)}a(OXe,"readDirectory");var yes=new fe("fileReferencesPrompt");async function Zxn(t,e,r,n){let o=await Xxn(t,e,r,n);if(!o.length)return"";let s="";for(let{label:l,uri:u,tree:d}of o){let f=to(u),h=la.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(Yh).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 p0(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 CXe=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 bXe=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 nes="X-Initiator",ies="X-Interaction-ID",oes="X-Interaction-Type";var SXe=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},S$t=class extends SXe{static{a(this,"User")}static id(){return"user"}},T$t=class extends SXe{static{a(this,"Agent")}static id(){return"agent"}},I$t=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[nes]:this.initiator,[ies]:this.interactionId,[oes]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return OA.agent(e??this.interactionType,this.interactionId)}},OA=class t extends I$t{static{a(this,"LlmInteraction")}static user(e,r){return new t(S$t,e,r)}static agent(e,r){return new t(T$t,e,r)}};function qxn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(qxn,"interactionTypeForChatMode");var mw=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new x$t(this),this.steps=new bXe(e,r,n,e.get(Tc)),this.collector=new w$t(r,n,e.get(Tc)),this.agentToolCalls=new CXe(e,r,n,e.get(Tc))}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 OA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?OA.agent(e,this.turn.telemetryId):OA.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(Tc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},TXe=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")}},Oxe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},x$t=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(Yo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(Ag).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 TXe(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(Yh).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(Ag).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof TXe||o instanceof Oxe)throw o;ot.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},w$t=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 ses={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function jxn(t){let e=Ft(t,Ye.AutoCompress);return{...ses,enabled:e}}a(jxn,"getAutomaticCompressionConfig");p();var jq=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(gs).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 E=Pn(y.request.message),_=this.estimateTokensFromText(E)+n.baseTokensPerMessage;if(l+=Math.ceil(_*t.MESSAGE_OVERHEAD_MULTIPLIER),y.request.references?.length&&(d+=Math.ceil(y.request.references.length*50*t.MESSAGE_OVERHEAD_MULTIPLIER)),y.response){let v=Pn(y.response.message),b=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(b*t.MESSAGE_OVERHEAD_MULTIPLIER),TK(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 b of v.toolCalls)if(b.result&&Array.isArray(b.result)){let T="";for(let w of b.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 ZC=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new jq}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=jxn(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(E){ot.warn(this.ctx,`Failed to calculate context size after compression: ${E instanceof Error?E.message:String(E)}`)}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=Wt.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});Et(this.ctx,"automaticCompression.skipped",c,0)}sendTriggeredTelemetry(e,r,n,o,s,c,l){let u=Wt.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});Et(this.ctx,"automaticCompression.triggered",u,0)}sendExceptionTelemetry(e,r,n,o,s,c){let l=Wt.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});Et(this.ctx,"automaticCompression.triggered",l,0)}};p();var LA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var qd=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var IXe=de(ale());var Hxn=new Map;function hE(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(hE,"createNumberRange");function R$t(t){return[...t].sort((e,r)=>r.length-e.length)}a(R$t,"sortByStringLengthDesc");async function aes(t){let e=Hxn.get(t);if(e)return e;let r=(async()=>{try{let n=await D$e(`tree-sitter-${t}.wasm`);return await IXe.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return Hxn.set(t,r),r}a(aes,"loadShellLanguage");function Gxn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(Gxn,"isPowerShell");var ces=new Map([["sh",R$t([...hE(1,9).concat("").map(t=>`${t}<<<`),...hE(1,9).concat("").flatMap(t=>hE(1,9).map(e=>`${t}>&${e}`)),...hE(1,9).concat("").map(t=>`${t}<>`),...hE(1,9).concat("&","").map(t=>`${t}>>`),...hE(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",R$t([...hE(1,9).concat("").map(t=>`${t}<<<`),...hE(1,9).concat("").flatMap(t=>hE(1,9).map(e=>`${t}>&${e}`)),...hE(1,9).concat("").map(t=>`${t}<>`),...hE(1,9).concat("&","").map(t=>`${t}>>`),...hE(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",R$t([...hE(1,6).concat("*","").flatMap(t=>hE(1,6).map(e=>`${t}>&${e}`)),...hE(1,6).concat("*","").map(t=>`${t}>>`),...hE(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function les(t,e){let r,n=e.replace(/\.exe$/,"");Gxn(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=ces.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(les,"splitCommandLineIntoSubCommands");async function xXe(t,e){try{let r;Gxn(e)?r="powershell":r="bash",await IXe.default.init();let n,o;try{n=new IXe.default;let s=await aes(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 les(t,e)}}a(xXe,"extractSubCommandsWithTreeSitter");var ues=new Set(["sudo","env"]),des=/^[A-Za-z_][A-Za-z0-9_]*=/;function k$t(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(des.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||ues.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(k$t,"extractCommandNameFromSubCommand");var Zue=new fe("CommandLineAutoApprover"),$xn=/(?!.*)/,fes=/^[A-Z_][A-Z0-9_]*=/i,nT=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(fes.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 xXe(e,r);Zue.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 Zue.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 Zue.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Zue.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await xXe(e,r),o=[...new Set(n.map(k$t).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await xXe(e,r),o=n.map(s=>k$t(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})}}}),Zue.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Zue.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)?$xn:c}catch{return $xn}}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 wXe=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 RXe=class{constructor(e){this.ctx=e}static{a(this,"DefaultTextDocumentProvider")}async getByUri(e){return await this.ctx.get(ii).getOrReadTextDocument({uri:e})}};p();p();p();p();p();p();var kXe=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=pes(this.stdout)}static{a(this,"CommandHookResult")}};function pes(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(pes,"parseOutput");var N$t=require("child_process");var PXe=new fe("HookExecutor"),DXe=class{constructor(){this.handlers=[new P$t,new D$t]}static{a(this,"HookExecutor")}async execute(e,r,n,o){if(!e.get(tp).isTrusted(r.source)){PXe.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){PXe.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}PXe.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},NXe=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"&&PXe.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,E=setTimeout(()=>{s.kill("SIGTERM"),A(new Error(`Command timed out after ${y} seconds`))},y*1e3),_=a(()=>{clearTimeout(E)},"cleanup");s.on("error",v=>{_(),A(new Error(`Failed to execute command: ${v.message}`))}),s.on("close",v=>{_(),g(new kXe(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"]}}},P$t=class extends NXe{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,N$t.spawn)(e.bash,[],n)}},D$t=class extends NXe{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,N$t.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var hes=new DXe,XC=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 hes.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var uF=class extends XC{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var o2=class extends XC{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var Xue={allow:"allow",deny:"deny",ask:"ask"},s2=class extends XC{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var lJ=class extends XC{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var uJ=class extends XC{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var a2=class extends XC{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var dJ=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 fJ(t){try{return!(!Ft(t,Ye.EnableHooks)||t.get(jl).getPolicyValue("customHook.enabled")===!1)}catch{return!1}}a(fJ,"hooksEnabled");var mes=".github/hooks/**/*.json",ges="agentHook.execution",Aes={sessionStart:uJ,sessionEnd:lJ,userPromptSubmitted:a2,preToolUse:s2,postToolUse:o2,errorOccurred:uF},mE=class{constructor(e){this.logger=new fe("HookService");this.gateSubscriptions=[];this.ctx=e,this.registration=this.ctx.get(wA).register("hook",[mes]),this.subscribeToGateChanges()}static{a(this,"HookService")}dispose(){this.registration.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&&At(e,ges,{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()?this.ctx.get(ug).collect(this.ctx,"hook",e):[]}areHooksEnabled(){let e=fJ(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(Bo);this.lastEnableHooks=Ft(this.ctx,Ye.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ye.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(jl);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(a0).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(Aes).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(ug).collect(e,"hook",[n]),c=[];for(let l of s){let u=l.parsedPromptFile,d=u.hooks[o];d!==void 0&&c.push(new r(u.uri,[...d]))}return c}};p();function BA(t){return`[${Ji(t)}](${t})`}a(BA,"formatUriForFileWidget");function id(t,e){let r=yes(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(id,"resolvePathInput");function yes(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 $W.has(s)||la.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(la.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||Vxn()&&_es(t)||Vxn()&&t.startsWith("\\\\"))return Ks(t)}a(yes,"resolveFsUri");function Vxn(){return process.platform==="win32"}a(Vxn,"isWindows");function Ees(t){return t>=65&&t<=90||t>=97&&t<=122}a(Ees,"isWindowsDriveLetter");function _es(t){return Ees(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(_es,"hasDriveLetter");function GO(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof Rr?r.value:r instanceof _K?"":r instanceof JQ?JSON.stringify(r.value):"").join(` +`)),e===""?"(empty)":e}a(GO,"parseToolResultToString");function MXe(t){let{content:e}=t;return{message:GO(e)}}a(MXe,"formatToolErrorResult");function Wxn(t){let{content:e}=t,r={data:e.map(n=>n instanceof Rr?{type:"text",value:n.value}:n instanceof _K?{type:"text",value:""}:n instanceof JQ?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof ZQ&&(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(Wxn,"formatToolSuccessResult");function pJ(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(pJ,"extractShellFromToolDescription");var OXe=new fe("HookTrigger"),ede=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(mE),c=o?new dJ(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,s2,{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 OXe.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(mE),l=s?new dJ(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,o2,{timestamp:Date.now(),cwd:un(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:GO(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){OXe.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(mE),o=this.extractPromptFromMessage(e),s=r?new dJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,a2,{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){OXe.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(mE),o=Ft(this.ctx,Ye.HookErrorOccurredStackTrace),s=r?new dJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,uF,{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){OXe.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===Xue.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 M$t=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},Nwe=class extends M$t{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var hJ=de(xo());var Hn=class t extends hJ.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(hJ.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,hJ.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> +`)),vscpp(O$t,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},O$t=class extends hJ.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function zxn(){return vscpp(Hn,{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(Hn,{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(Hn,{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(Hn,{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(zxn,"renderAskModeInstructionBody");p();p();var Hq=class extends lr{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 LXe=class extends lr{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var Yxn=require("path");var BXe=class extends lr{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,Yxn.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(gs).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=pJ(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 Gq=class extends lr{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=to(c.uri);return` - ${la.isRegisteredScheme(l.scheme)?c.uri:rs(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 Kxn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(Kxn,"partsLength");async function Zxn(t,e=1/0,r){let n=Jxn(0,t,e),o=e-Kxn(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 ves();let d=Jxn(l.level+1,u,o-1);d.length&&(s=!0,o-=Kxn(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(Zxn,"visualFileTree");function Jxn(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(Jxn,"toParts");var ves=a(()=>({tree:"",files:[]}),"emptyTree");p();async function FXe(t,e){let r=to(e);return la.isRegisteredScheme(r.scheme)?(await t.get(la).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(qo).readDirectory(e)}a(FXe,"readDirectory");var Ces=new fe("fileReferencesPrompt");async function Xxn(t,e,r,n){let o=await ewn(t,e,r,n);if(!o.length)return"";let s="";for(let{label:l,uri:u,tree:d}of o){let f=to(u),h=la.isRegisteredScheme(f.scheme)?u:un(u);s+=`${l} (Absolute Path: ${h})/ `;for(let m of d.tree.split(` `))s+=` ${m} `}let c=DA(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(Zxn,"generateWorkspaceStructurePrompt");async function Xxn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await Jxn(await ewn(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(Xxn,"generateWorkspaceStructure");async function ewn(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await OXe(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=wa(e,s);return!la.isRegisteredScheme(to(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||ves(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>ewn(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(ewn,"buildFileList");var Ees=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],_es=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function ves(t){return!!(_es.includes(Ji(t).toLowerCase())||rs(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>Ees.includes(r)))}a(ves,"shouldAlwaysIgnoreFile");async function LXe(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:Ji(c.uri)})),o=await Xxn(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 yes.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(LXe,"processDirectoryReferences");var tde=class extends lr{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await Zxn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||Fn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var twn=de(Io());var Mwe=class extends lr{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(twn.UserMessage,null,vscpp(Hn,{name:"environment_info"},vscpp(jq,{ctx:this.props.ctx}),vscpp(MXe,{ctx:this.props.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Hq,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(tde,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(NXe,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var BXe=de(require("path"));function L$t(t){let e=Ft(t,Ye.EnableSkills),r=t.get(jl).getPolicyValue("customSkill.enabled")!==!1;return e&&r}a(L$t,"isSkillsEnabled");var O$t=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||Ji(uf(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}get providers(){return x3(this.promptFileEntry.promptPath.metadata)}},h0=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.registrySkillPatterns=[];this.skillFileLocationsPatterns=[];this.logger=new fe("CustomSkillService");this._onDidChangeSkillsEnabled=new ep;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}}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(jl);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(a0).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=Ft(this.ctx,Ye.EnableSkills);return()=>{let n=Ft(this.ctx,Ye.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){return L$t(this.ctx)}syncRegistry(){if(this.disposeSkillPatterns(),!Ft(this.ctx,Ye.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(BXe.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(ug).collect(this.ctx,"skill",e,{includePlugins:r?.includePlugins})).map(s=>new O$t(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=BXe.default.dirname(r)),!!r)return BXe.default.normalize(r)}};var FXe=class extends lr{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(h0).listSkills(e);if(At(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(Xxn,"generateWorkspaceStructurePrompt");async function ewn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await Zxn(await twn(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(ewn,"generateWorkspaceStructure");async function twn(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await FXe(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=xa(e,s);return!la.isRegisteredScheme(to(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||Tes(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>twn(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(twn,"buildFileList");var bes=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],Ses=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function Tes(t){return!!(Ses.includes(Ji(t).toLowerCase())||rs(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>bes.includes(r)))}a(Tes,"shouldAlwaysIgnoreFile");async function UXe(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:Ji(c.uri)})),o=await ewn(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 Ces.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(UXe,"processDirectoryReferences");var tde=class extends lr{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await Xxn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||Fn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var rwn=de(xo());var Mwe=class extends lr{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(rwn.UserMessage,null,vscpp(Hn,{name:"environment_info"},vscpp(Hq,{ctx:this.props.ctx}),vscpp(BXe,{ctx:this.props.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Gq,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(tde,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(LXe,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var QXe=de(require("path"));function B$t(t){let e=Ft(t,Ye.EnableSkills),r=t.get(jl).getPolicyValue("customSkill.enabled")!==!1;return e&&r}a(B$t,"isSkillsEnabled");var L$t=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||Ji(uf(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}get pluginUri(){return YQ(this.promptFileEntry.promptPath)}get providers(){return w3(this.promptFileEntry.promptPath.metadata)}},h0=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.registrySkillPatterns=[];this.skillFileLocationsPatterns=[];this.logger=new fe("CustomSkillService");this._onDidChangeSkillsEnabled=new ep;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}}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(jl);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(a0).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=Ft(this.ctx,Ye.EnableSkills);return()=>{let n=Ft(this.ctx,Ye.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){return B$t(this.ctx)}syncRegistry(){if(this.disposeSkillPatterns(),!Ft(this.ctx,Ye.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(QXe.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(ug).collect(this.ctx,"skill",e,{includePlugins:r?.includePlugins})).map(s=>new L$t(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=QXe.default.dirname(r)),!!r)return QXe.default.normalize(r)}};var qXe=class extends lr{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(h0).listSkills(e);if(At(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(Hn,{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 rwn={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},rde=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await K$e(e.ctx)&&r.set(rwn.name,rwn);let o=await e.ctx.get(Ld).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&&At(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 Ces=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"],["semantic_search","safe_tool"],["list_dir","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 nwn(t){return Ces.get(t)??"unknown"}a(nwn,"getToolFunctionalType");var bes=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"]]),Ses=new Map;for(let[t,e]of bes)Ses.set(e,t);var iwn=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),own=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var UXe=class extends lr{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 rde().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(Hn,{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 nde=class extends lr{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 Tes=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],$O=class extends lr{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&Tes.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var swn=de(Io());var QXe=class extends lr{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(swn.SystemMessage,null,vscpp(Hn,{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(nde,null)),vscpp(Hn,{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(Hn,{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(Hn,{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(Hn,{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(Hn,{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($O,{languageOverride:this.props.languageOverride}))}};p();var awn=de(Io());var qXe=class extends lr{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(awn.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($O,{languageOverride:this.props.languageOverride}))}};p();p();var cwn="filepath:",FA="...existing code...";p();var jXe=class extends lr{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 Gq=class extends lr{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!sYe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===Rn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(Rn.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 lwn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(lwn,"modelSupportsReplaceString");function uwn(t){return t?t.startsWith("gpt-5"):!1}a(uwn,"isGpt5PlusFamily");function Ies(t){return t?t==="gpt-5.2-codex":!1}a(Ies,"isGpt52CodexFamily");function xes(t){return t?t==="gpt-5.2":!1}a(xes,"isGpt52Family");function dwn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||Ies(e)||xes(e))}a(dwn,"modelSupportsApplyPatch");var fwn=de(Io());var HXe=class extends lr{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=uwn(this.props.modelConfiguration.modelFamily);return vscpp(fwn.SystemMessage,null,vscpp(Hn,{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(Gq,{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(Hn,{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(Hn,{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(Hn,{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(jXe,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),"// ",FA,vscpp("br",null),"changed code",vscpp("br",null),"// ",FA,vscpp("br",null),"changed code",vscpp("br",null),"// ",FA,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 {",` // ${FA}`," age: number;",` // ${FA}`," getAge() {"," return this.age;"," }","}"].join(` -`))),vscpp(Hn,{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(Hn,{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($O,{languageOverride:this.props.languageOverride}))}};p();var GXe=class extends lr{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.")}},$Xe=class extends lr{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var ide=class extends lr{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))}},VXe=class extends lr{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))}},WXe=class extends lr{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 pwn=de(Io());var zXe=class extends lr{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(pwn.SystemMessage,{priority:1e3},vscpp(Hn,{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(Gq,{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(Hn,{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 `",FA,"` 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($O,{languageOverride:this.props.languageOverride}))}},YXe=class extends lr{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 KXe=de(Io());var JXe=class extends lr{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=Ft(this.props.turnContext.ctx,Ye.UseAgentsMd);return sYe(n.modelFamily)?vscpp(qXe,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(QXe,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp(zXe,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(HXe,{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(bn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(KXe.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(Rn.Gpt5)?vscpp(vscppf,null,vscpp($Xe,null),vscpp(VXe,null)):vscpp(vscppf,null,vscpp(GXe,null),vscpp(ide,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(KXe.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(KXe.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 hwn=de(Io());var ZXe=class extends lr{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=yO(this.props.currentTurn.response?.message,!0),r=RO(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,hwn.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 XXe=class extends lr{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 eet=class extends lr{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(Hn,{name:"editorContext"},vscpp(vscppf,null,e))}renderActiveTextEditor(e){let r=e.selection,n=r&&wes(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 wes(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(wes,"notEmptySelection");p();var tet=class extends lr{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 `",FA,"` to represent regions of unchanged code.")}};p();var ret=class extends lr{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(Rn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(Rn.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(Hn,{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 VO=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=DA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${cwn} ${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(Hn,{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 nwn={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},rde=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await Z$e(e.ctx)&&r.set(nwn.name,nwn);let o=await e.ctx.get(Ld).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&&At(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 Ies=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"],["semantic_search","safe_tool"],["list_dir","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 iwn(t){return Ies.get(t)??"unknown"}a(iwn,"getToolFunctionalType");var xes=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"]]),wes=new Map;for(let[t,e]of xes)wes.set(e,t);var own=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),swn=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var jXe=class extends lr{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 rde().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(Hn,{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 nde=class extends lr{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 Res=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],$O=class extends lr{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&Res.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var awn=de(xo());var HXe=class extends lr{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(awn.SystemMessage,null,vscpp(Hn,{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(nde,null)),vscpp(Hn,{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(Hn,{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(Hn,{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(Hn,{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(Hn,{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($O,{languageOverride:this.props.languageOverride}))}};p();var cwn=de(xo());var GXe=class extends lr{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(cwn.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($O,{languageOverride:this.props.languageOverride}))}};p();p();var lwn="filepath:",FA="...existing code...";p();var $Xe=class extends lr{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 $q=class extends lr{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!lYe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===Rn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(Rn.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 uwn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(uwn,"modelSupportsReplaceString");function dwn(t){return t?t.startsWith("gpt-5"):!1}a(dwn,"isGpt5PlusFamily");function kes(t){return t?t==="gpt-5.2-codex":!1}a(kes,"isGpt52CodexFamily");function Pes(t){return t?t==="gpt-5.2":!1}a(Pes,"isGpt52Family");function fwn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||kes(e)||Pes(e))}a(fwn,"modelSupportsApplyPatch");var pwn=de(xo());var VXe=class extends lr{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=dwn(this.props.modelConfiguration.modelFamily);return vscpp(pwn.SystemMessage,null,vscpp(Hn,{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($q,{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(Hn,{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(Hn,{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(Hn,{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($Xe,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),"// ",FA,vscpp("br",null),"changed code",vscpp("br",null),"// ",FA,vscpp("br",null),"changed code",vscpp("br",null),"// ",FA,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 {",` // ${FA}`," age: number;",` // ${FA}`," getAge() {"," return this.age;"," }","}"].join(` +`))),vscpp(Hn,{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(Hn,{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($O,{languageOverride:this.props.languageOverride}))}};p();var WXe=class extends lr{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.")}},zXe=class extends lr{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var ide=class extends lr{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))}},YXe=class extends lr{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))}},KXe=class extends lr{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 hwn=de(xo());var JXe=class extends lr{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(hwn.SystemMessage,{priority:1e3},vscpp(Hn,{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($q,{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(Hn,{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 `",FA,"` 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($O,{languageOverride:this.props.languageOverride}))}},ZXe=class extends lr{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 XXe=de(xo());var eet=class extends lr{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=Ft(this.props.turnContext.ctx,Ye.UseAgentsMd);return lYe(n.modelFamily)?vscpp(GXe,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(HXe,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp(JXe,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(VXe,{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(bn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(XXe.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(Rn.Gpt5)?vscpp(vscppf,null,vscpp(zXe,null),vscpp(YXe,null)):vscpp(vscppf,null,vscpp(WXe,null),vscpp(ide,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(XXe.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(XXe.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 mwn=de(xo());var tet=class extends lr{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=yO(this.props.currentTurn.response?.message,!0),r=RO(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,mwn.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(nw,{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 ret=class extends lr{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 net=class extends lr{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(Hn,{name:"editorContext"},vscpp(vscppf,null,e))}renderActiveTextEditor(e){let r=e.selection,n=r&&Des(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 Des(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(Des,"notEmptySelection");p();var iet=class extends lr{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 `",FA,"` to represent regions of unchanged code.")}};p();var oet=class extends lr{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(Rn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(Rn.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(Hn,{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 VO=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=DA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${lwn} ${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 a2=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 VO({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=rs(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 Res=new fe("activeEditorPrompt");async function mwn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new Oc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&kes(n.selection)){let s=new a2(o,n.selection,["User's active selection, this should be the main focus:",`Excerpt from ${Ji(n.uri)}, line range (1-based) ${n.selection.start.line+1} to ${n.selection.end.line+1}:`]);r.push(...s.render());let c=new a2(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new a2(o,n.visibleRange,["User's current visible code:",`Excerpt from ${Ji(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 a2(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else Res.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(mwn,"processActiveEditor");function kes(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(kes,"notEmptySelection");p();var Pes=["png","jpg","jpeg","bmp","gif","webp"];function Des(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!Pes.some(n=>r.endsWith(`.${n}`))})}a(Des,"filterOutImageFiles");function net(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:Des(e)}}a(net,"getFileAndDirectoryReferences");var Nes=new fe("fileReferencesPrompt");async function gwn(t,e){let{validFileReferences:r,directoryReferences:n}=net(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([Mes({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),mwn(t,e),LXe(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(gwn,"processFileReferences");async function Mes(t,e){let r=new Map,n=t.validFileReferences.map(s=>{let c=Ji(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 Oc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new a2(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 a2(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new a2(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else Nes.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(Mes,"processValidFileReferences");var Awn=de(Io());var Oes=new fe("fileReferences"),iet=class extends lr{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new Fn.CancellationTokenSource().token,c=[];try{c=await gwn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){Oes.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(B$t,{fileReferencesParts:c})}},B$t=class extends lr{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(Awn.TextChunk,null,[this.props.fileReferencesParts.join(` -`)])}};p();var ywn=de(Io());var oet=class extends lr{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=net(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(ii);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(ywn.TextChunk,null,[n.join(` -`)])}};p();var Ewn=new fe("SkillContextPrompt"),Les=5e4,set=class extends lr{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 HKe(s);if(!c)return;Ewn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(Les).getText();return!d||d.trim().length===0?void 0:vscpp(Hn,{name:"skillContext"},vscpp(vscppf,null,d))}catch(c){let l=s.turn.skills.map(u=>u.skillId).join(", ");Ewn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var vu=class extends YQ{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:dg,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Oc;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(qd).invokeClientToolConfirmation(e,o)}};p();var m0=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 Bes(){let t=S.Object({id:S.Number({description:"Unique identifier for the todo. Use sequential numbers starting from 1."}),title:S.String({description:"Concise action-oriented todo label (3-7 words). Displayed in UI."}),description:S.Optional(S.String({description:"Detailed context, requirements, or implementation notes. Include file paths, specific methods, or acceptance criteria."})),status:S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")],{description:"not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished with no blockers"})}),e={operation:S.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:S.Optional(S.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 S.Object(e)}a(Bes,"createManageTodoListInputSchema");var WO=class t extends vu{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:Bes()}),this.ctx=e}get service(){return this.ctx.get(m0)}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 Lr([new Rr("Error: Unknown operation")],"error")):Promise.resolve(new Lr([new Rr("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Lr([new Rr(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Lr([new Rr("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Lr([new Rr(`# Todo List +`){return this.renderAsArray().join(e)}};var c2=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 VO({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=rs(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 Nes=new fe("activeEditorPrompt");async function gwn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new Oc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&Mes(n.selection)){let s=new c2(o,n.selection,["User's active selection, this should be the main focus:",`Excerpt from ${Ji(n.uri)}, line range (1-based) ${n.selection.start.line+1} to ${n.selection.end.line+1}:`]);r.push(...s.render());let c=new c2(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new c2(o,n.visibleRange,["User's current visible code:",`Excerpt from ${Ji(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 c2(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else Nes.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(gwn,"processActiveEditor");function Mes(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(Mes,"notEmptySelection");p();var Oes=["png","jpg","jpeg","bmp","gif","webp"];function Les(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!Oes.some(n=>r.endsWith(`.${n}`))})}a(Les,"filterOutImageFiles");function set(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:Les(e)}}a(set,"getFileAndDirectoryReferences");var Bes=new fe("fileReferencesPrompt");async function Awn(t,e){let{validFileReferences:r,directoryReferences:n}=set(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([Fes({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),gwn(t,e),UXe(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(Awn,"processFileReferences");async function Fes(t,e){let r=new Map,n=t.validFileReferences.map(s=>{let c=Ji(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 Oc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new c2(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 c2(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new c2(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else Bes.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(Fes,"processValidFileReferences");var ywn=de(xo());var Ues=new fe("fileReferences"),aet=class extends lr{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new Fn.CancellationTokenSource().token,c=[];try{c=await Awn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){Ues.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(F$t,{fileReferencesParts:c})}},F$t=class extends lr{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(ywn.TextChunk,null,[this.props.fileReferencesParts.join(` +`)])}};p();var Ewn=de(xo());var cet=class extends lr{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=set(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(ii);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(Ewn.TextChunk,null,[n.join(` +`)])}};p();var _wn=new fe("SkillContextPrompt"),Qes=5e4,uet=class extends lr{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 VKe(s);if(!c)return;_wn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(Qes).getText();return!d||d.trim().length===0?void 0:vscpp(Hn,{name:"skillContext"},vscpp(vscppf,null,d))}catch(c){let l=s.turn.skills.map(u=>u.skillId).join(", ");_wn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var vu=class extends KQ{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:dg,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Oc;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(qd).invokeClientToolConfirmation(e,o)}};p();var m0=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 qes(){let t=S.Object({id:S.Number({description:"Unique identifier for the todo. Use sequential numbers starting from 1."}),title:S.String({description:"Concise action-oriented todo label (3-7 words). Displayed in UI."}),description:S.Optional(S.String({description:"Detailed context, requirements, or implementation notes. Include file paths, specific methods, or acceptance criteria."})),status:S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")],{description:"not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished with no blockers"})}),e={operation:S.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:S.Optional(S.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 S.Object(e)}a(qes,"createManageTodoListInputSchema");var WO=class t extends vu{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:qes()}),this.ctx=e}get service(){return this.ctx.get(m0)}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 Lr([new Rr("Error: Unknown operation")],"error")):Promise.resolve(new Lr([new Rr("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Lr([new Rr(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Lr([new Rr("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Lr([new Rr(`# Todo List ${n}`)],"success")}handleWriteOperation(e,r){if(!r)return new Lr([new Rr("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 JQ([new Rr(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 ZQ([new Rr(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(m0).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return hyn(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(m0).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return myn(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. @@ -3377,50 +3377,50 @@ 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 aet=class extends lr{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(bn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??WO.getTodoList(this.props.turnContext);if(r.length===0)return;let n=WO.formatTodoListAsMarkdown(r);return vscpp(Hn,{name:"todoList"},[n])}};p();p();var Fes=new fe("fileReferencesPrompt");function _wn(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 Fes.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(_wn,"processMcpToolsReferences");var Ues=new fe("ToolContext"),cet=class extends lr{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 Oc;let n=_wn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(Hn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` -`)))}catch(r){Ues.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var ode=de(Io());var uet=class extends lr{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=Pn(this.props.userRawMessage),c=Xle(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(ode.UserMessage,null,vscpp(ode.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp(iet,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(ode.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(oet,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(cet,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(set,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(Hn,{name:"context"},vscpp(XXe,null),vscpp(aet,{turnContext:this.props.turnContext})),vscpp(eet,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(Hn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(nde,null):vscpp(Gq,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(tet,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(YXe,null),vscpp(ret,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(Hn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var mJ=de(Io());var F$t=new fe("agentPrompt"),det=class extends lr{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(bn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(JXe,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(mJ.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(mJ.UserMessage,null,vscpp(UXe,{turnContext:this.turnContext})),vscpp(mJ.UserMessage,null,vscpp(FXe,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(Aue,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(uet,{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(ZXe,{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?Qes(e):[vscpp(Mwe,{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(Nwe);if(s?.renderedGlobalContext)return F$t.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}F$t.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await Iqt(Mwe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new Nwe(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(bf).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(this.ctx,Ye.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(this.ctx,Ye.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(this.ctx,Ye.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(this.ctx,Ye.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(Wxn());else if(s&&s.instruction&&s.instruction.trim().length>0){let{name:l,instruction:u}=s;e.push(vscpp(Hn,{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(mJ.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){F$t.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function Qes(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(mJ.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(Qes,"renderedMessageToTsxChildren");p();var fet="uncategorized_tools",vwn="Tools that could not be automatically categorized into existing groups.";p();var $q=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var uF=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 sde=new fe("roundMetricsTracker"),pet=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=qes(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:U$t(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:U$t(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:U$t(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}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;sde.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){sde.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 sde.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;sde.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(sde.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}}),Ft(this.ctx,Ye.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else sde.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 det=class extends lr{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(bn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??WO.getTodoList(this.props.turnContext);if(r.length===0)return;let n=WO.formatTodoListAsMarkdown(r);return vscpp(Hn,{name:"todoList"},[n])}};p();p();var jes=new fe("fileReferencesPrompt");function vwn(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 jes.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(vwn,"processMcpToolsReferences");var Hes=new fe("ToolContext"),fet=class extends lr{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 Oc;let n=vwn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(Hn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` +`)))}catch(r){Hes.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var ode=de(xo());var pet=class extends lr{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=Pn(this.props.userRawMessage),c=Xle(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(ode.UserMessage,null,vscpp(ode.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp(aet,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(ode.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(cet,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(fet,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(uet,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(Hn,{name:"context"},vscpp(ret,null),vscpp(det,{turnContext:this.props.turnContext})),vscpp(net,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(Hn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(nde,null):vscpp($q,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(iet,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(ZXe,null),vscpp(oet,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(Hn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var mJ=de(xo());var U$t=new fe("agentPrompt"),het=class extends lr{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(bn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(eet,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(mJ.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(mJ.UserMessage,null,vscpp(jXe,{turnContext:this.turnContext})),vscpp(mJ.UserMessage,null,vscpp(qXe,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(Aue,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(pet,{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(tet,{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?Ges(e):[vscpp(Mwe,{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(Nwe);if(s?.renderedGlobalContext)return U$t.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}U$t.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await xqt(Mwe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new Nwe(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(bf).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(this.ctx,Ye.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(this.ctx,Ye.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(this.ctx,Ye.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(this.ctx,Ye.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(zxn());else if(s&&s.instruction&&s.instruction.trim().length>0){let{name:l,instruction:u}=s;e.push(vscpp(Hn,{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(mJ.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){U$t.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function Ges(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(mJ.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(Ges,"renderedMessageToTsxChildren");p();var met="uncategorized_tools",Cwn="Tools that could not be automatically categorized into existing groups.";p();var Vq=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var dF=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 sde=new fe("roundMetricsTracker");function $es(t,e){let r=e>0;return t&&r?"both":t?"compacted":r?"prompt_tsx_pruned":"none"}a($es,"deriveContextManagementAction");var get=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=Ves(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:Q$t(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:Q$t(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:Q$t(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:$es(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;sde.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){sde.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 sde.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;sde.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(sde.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}}),Ft(this.ctx,Ye.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else sde.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 U$t(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(qes,"stripDriftingFields");p();p();var het=new fe("agentModePolicy");function Cwn(t){try{let e=rx(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(het.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(jl).getPolicyValue("agentMode.autoApproval.enabled")===!1?(het.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(het.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return het.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(Cwn,"isAutoApprovalEnabled");p();var met=new fe("McpAutoApproveService"),dF=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){met.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return met.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||met.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})),met.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 gJ=de(require("path"));var mw=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 fe("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&&la.isRegisteredScheme(s[1].toLowerCase()))return;let c=Ks(e);if(!this.isPathInCurrentWorkspace(c,r))return{rule:{pattern:"outside-workspace",requiresConfirmation:!0,description:"files outside workspace"},isOutsideWorkspace:!0};if(!n)return;o||this.ensureInitialized();let u=o?this.defaultRules:this.rules;for(let d of u)if(this.matchesPattern(e,d.pattern))return{rule:d,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=gJ.normalize(s),l=gJ.normalize(n),u=gJ.relative(c,l);return!u.startsWith("..")&&!gJ.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return vf(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 Twn=`*** Begin Patch +`}}return s+="```\n",s}};function Q$t(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(Ves,"stripDriftingFields");p();p();var Aet=new fe("agentModePolicy");function bwn(t){try{let e=ix(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(Aet.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(jl).getPolicyValue("agentMode.autoApproval.enabled")===!1?(Aet.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(Aet.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return Aet.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(bwn,"isAutoApprovalEnabled");p();var yet=new fe("McpAutoApproveService"),fF=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){yet.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return yet.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||yet.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})),yet.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 gJ=de(require("path"));var gw=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 fe("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&&la.isRegisteredScheme(s[1].toLowerCase()))return;let c=Ks(e);if(!this.isPathInCurrentWorkspace(c,r))return{rule:{pattern:"outside-workspace",requiresConfirmation:!0,description:"files outside workspace"},isOutsideWorkspace:!0};if(!n)return;o||this.ensureInitialized();let u=o?this.defaultRules:this.rules;for(let d of u)if(this.matchesPattern(e,d.pattern))return{rule:d,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=gJ.normalize(s),l=gJ.normalize(n),u=gJ.relative(c,l);return!u.startsWith("..")&&!gJ.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return vf(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 Iwn=`*** Begin Patch `,ade=` -*** End Patch`,cde="*** Add File: ",Vq="*** Delete File: ",lde="*** Update File: ",jes="*** Move to: ",Q$t="*** End of File";var Hes=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var nm=class extends Error{static{a(this,"DiffError")}},ude=class extends nm{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},zO=class extends nm{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function bwn(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(bwn,"guessIndentation");function Swn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(Swn,"computeIndentLevel");function Ges(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(Ges,"getIndentationChar");function $es(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($es,"transformIndentation");function Ves(t){return!t||!t.trim()}a(Ves,"isFalsyOrWhitespace");function Wes(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(Wes,"countOccurrences");function zes(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(zes,"computeLevenshteinDistance");function Owe(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(Owe,"replaceExplicitTabs");function get(t){return Owe(t.replaceAll("\\n",` -`))}a(get,"replaceExplicitNl");var q$t=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]=bwn(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 nm(`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([ade]);){let e=this.readStr(lde);if(e){if(this.patch.actions[e])throw new nm(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(jes);if(!(e in this.currentFiles))throw new nm(`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(Vq),e){if(this.patch.actions[e])throw new nm(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new nm(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(cde),e){if(this.patch.actions[e])throw new nm(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new nm(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new nm(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(ade.trim()))throw new zO("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=!Hes.test(e.trimEnd()),l=0;for(;!this.isDone([ade,lde,Vq,cde,Q$t]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new nm(`Invalid line. Consider splitting each change into individual apply_patch tool calls: +*** End Patch`,cde="*** Add File: ",Wq="*** Delete File: ",lde="*** Update File: ",Wes="*** Move to: ",q$t="*** End of File";var zes=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var nm=class extends Error{static{a(this,"DiffError")}},ude=class extends nm{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},zO=class extends nm{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function Swn(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(Swn,"guessIndentation");function Twn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(Twn,"computeIndentLevel");function Yes(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(Yes,"getIndentationChar");function Kes(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(Kes,"transformIndentation");function Jes(t){return!t||!t.trim()}a(Jes,"isFalsyOrWhitespace");function Zes(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(Zes,"countOccurrences");function Xes(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(Xes,"computeLevenshteinDistance");function Owe(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(Owe,"replaceExplicitTabs");function Eet(t){return Owe(t.replaceAll("\\n",` +`))}a(Eet,"replaceExplicitNl");var j$t=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]=Swn(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 nm(`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([ade]);){let e=this.readStr(lde);if(e){if(this.patch.actions[e])throw new nm(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(Wes);if(!(e in this.currentFiles))throw new nm(`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(Wq),e){if(this.patch.actions[e])throw new nm(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new nm(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(cde),e){if(this.patch.actions[e])throw new nm(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new nm(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new nm(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(ade.trim()))throw new zO("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=!zes.test(e.trimEnd()),l=0;for(;!this.isDone([ade,lde,Wq,cde,q$t]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new nm(`Invalid line. Consider splitting each change into individual apply_patch tool calls: ${this.lines[this.index]}`);if(d){let _=!1,v=a(b=>this.canonicalize(b),"canonLocal");if(!s.slice(0,l).some(b=>v(b)===v(d)))for(let b=l;bv(b.trim())===v(d)))for(let b=l;b0&&(f=this.peekNextSection(this.lines,this.index,_)),h=this.findContext(e,s,f.nextChunkContext,l,f.eof),h||(h=this.findContext(e,s,f.nextChunkContext,0,f.eof)),_>0&&h&&(h.fuzz|=64);if(!h){let _=f.nextChunkContext.join(` `);if(f.eof)throw new ude(`Invalid EOF context at character ${l}: ${_}`,r,"invalidContext-eof");{let v=_.match(/^\\t/)?"invalidContext-maybeInvalidTab":_.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new ude(`Invalid context at character ${l}: -${_}`,r,v)}}this.fuzz+=h.fuzz;let m=bwn(f.chunks.flatMap(_=>_.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=Swn(s[h.line]??"",n.tabSize),A=h.fuzz&4?Owe(f.nextChunkContext[0]??""):h.fuzz&128?get(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?Swn(A,m.tabSize):0,E=Ges(n).repeat(Math.max(0,g-y));for(let _ of f.chunks)_.origIndex+=h.line,h.fuzz&128&&(_.insLines=_.insLines.map(get),_.delLines=_.delLines.map(get)),(c||h.fuzz&4)&&(_.insLines=_.insLines.map(Owe)),_.insLines=_.insLines.map(v=>Ves(v)?v:E+$es(v,m,n)),h.fuzz&4&&(_.delLines=_.delLines.map(Owe)),o.chunks.push(_);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([ade,lde,Vq,cde]);){let r=this.readStr();if(!r.startsWith("+"))throw new zO(`Invalid Add File Line: ${r}`,"invalidAddFileLine");e.push(r.slice(1))}return{type:"add",newFile:e.join(` +${_}`,r,v)}}this.fuzz+=h.fuzz;let m=Swn(f.chunks.flatMap(_=>_.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=Twn(s[h.line]??"",n.tabSize),A=h.fuzz&4?Owe(f.nextChunkContext[0]??""):h.fuzz&128?Eet(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?Twn(A,m.tabSize):0,E=Yes(n).repeat(Math.max(0,g-y));for(let _ of f.chunks)_.origIndex+=h.line,h.fuzz&128&&(_.insLines=_.insLines.map(Eet),_.delLines=_.delLines.map(Eet)),(c||h.fuzz&4)&&(_.insLines=_.insLines.map(Owe)),_.insLines=_.insLines.map(v=>Jes(v)?v:E+Kes(v,m,n)),h.fuzz&4&&(_.delLines=_.delLines.map(Owe)),o.chunks.push(_);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([ade,lde,Wq,cde]);){let r=this.readStr();if(!r.startsWith("+"))throw new zO(`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 zO(`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],E=y?.[0]==="+"?0:y?.[0]==="-"?1:2,_=f!==2&&E===f;f=2,A=" "+A,_&&(h++,n===h&&(f=E))}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 zO(`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],E=y?.[0]==="+"?0:y?.[0]==="-"?1:2,_=f!==2&&E===f;f=2,A=" "+A,_&&(h++,n===h&&(f=E))}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 nm(`${r}: chunk.origIndex ${c.origIndex} > len(lines) ${n.length}`);if(s>c.origIndex)throw new nm(`${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(Kes,"getUpdatedFile");function Jes(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=Kes(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(Jes,"patchToCommit");async function Zes(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new nm(`File not found: ${n}`)}return r}a(Zes,"loadFiles");async function xwn(t,e){if(!t.startsWith(Twn))throw new zO("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=AJ(t),n=await Zes(r,e),[o]=Yes(t,n);return Jes(o,n)}a(xwn,"processPatch");var YO=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"},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","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=AJ(s),l=dde(s);return c.length>0?{filePath:c[0],isNewFile:!1}:l.length>0?{filePath:l[0],isNewFile:!0}: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(mw),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(mw),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(tts,"getUpdatedFile");function rts(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=tts(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(rts,"patchToCommit");async function nts(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new nm(`File not found: ${n}`)}return r}a(nts,"loadFiles");async function wwn(t,e){if(!t.startsWith(Iwn))throw new zO("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=AJ(t),n=await nts(r,e),[o]=ets(t,n);return rts(o,n)}a(wwn,"processPatch");var YO=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"},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","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=AJ(s),l=dde(s);return c.length>0?{filePath:c[0],isNewFile:!1}:l.length>0?{filePath:l[0],isNewFile:!0}: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(gw),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(gw),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 fde=new fe("AutoApproveService"),yJ=class{constructor(e){this.ctx=e}static{a(this,"AutoApproveService")}async checkApproval(e,r,n){if(CB()&&process.env.HMAC_SECRET)return{needConfirm:!1};if(Ft(e.ctx,Ye.EditorHandlesAllConfirmation)===!0)return{needConfirm:!0};let o=this.classifyTool(r);if(o==="other")return fde.debug(this.ctx,"Auto approve check for build-in safe tool decided: approve (always auto-approved)"),{needConfirm:!1};if(!Cwn(this.ctx)){if(o==="file-operation"){let u=this.checkSensitiveFileApproval(r,n,e,!0),d=u.action==="confirm";return fde.debug(this.ctx,`Auto approve check (policy disabled, file-operation, default rules only) decided: ${u.action}`),{needConfirm:d}}return fde.info(this.ctx,"Tool confirmation required: auto-approval disabled by policy"),{needConfirm:!0}}if(Ft(e.ctx,Ye.AutoApproveYoloMode)===!0)return fde.info(this.ctx,`Auto approve yolo mode: auto-approving ${o} tool call`),{needConfirm:!1};let s=Ft(e.ctx,Ye.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=Ft(e.ctx,Ye.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=Ft(e.ctx,Ye.AutoApproveUnmatchedFileOp);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c={action:"approve"}}break}}let l=c.action==="confirm";return fde.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":YO.isPotentiallySensitiveTool(e)?"file-operation":"other"}checkMcpApproval(e){if(this.ctx.get(dF).isApproved(e.toolProvider.id,e.name))return{action:"approve"};if(Ft(this.ctx,Ye.TrustToolAnnotations)){let o=this.ctx.get(gs).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(tT),c=pJ(e.description)||"sh";fde.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=YO.getMatchingRuleForToolCall(e,r,n,o);return s?s.rule.requiresConfirmation?{action:"confirm"}:{action:"approve"}:{action:"continue"}}};p();p();p();function Lwe(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(ets,"isUndefined");function j$t(t){return Buffer.from(t,"base64").toString("utf-8")}a(j$t,"decodeBase64");function kwn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(kwn,"isObject");p();var Wq="activate_",ev=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(Wq))throw new Error(`Virtual tool name must start with '${Wq}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(Wq+e+this.name.slice(Wq.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))}},H$t=class extends lr{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))}},Aet=class extends lr{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(zq.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(zq.UserMessage,null,this.props.tools.map(e=>vscpp(Bwe,{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)))}},yet=class extends lr{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(zq.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(zq.UserMessage,null,this.props.tools.map(e=>vscpp(Bwe,{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)))}},Eet=class extends lr{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(zq.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(zq.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(H$t,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(Bwe,{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 Z$t={};ki(Z$t,{arrayReplaceAt:()=>J$t,asciiTrim:()=>bJ,assign:()=>gde,escapeHtml:()=>pF,escapeRE:()=>Lts,fromCodePoint:()=>Ade,has:()=>Tts,isMdAsciiPunct:()=>vJ,isPunctChar:()=>Jwn,isPunctCharCode:()=>_J,isSpace:()=>Zs,isString:()=>Det,isValidEntityCode:()=>Net,isWhiteSpace:()=>EJ,lib:()=>Bts,normalizeReference:()=>CJ,unescapeAll:()=>fF,unescapeMd:()=>kts});p();var Tet={};ki(Tet,{decode:()=>Fwe,encode:()=>Cet,format:()=>pde,parse:()=>Uwe});p();p();var Pwn={};function tts(t){let e=Pwn[t];if(e)return e;e=Pwn[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(_et,"decode");_et.defaultChars=";/?:@&=+$,#";_et.componentChars="";var Fwe=_et;p();var Dwn={};function rts(t){let e=Dwn[t];if(e)return e;e=Dwn[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=rts(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(vet,"encode");vet.defaultChars=";/?:@&=+$,-_.!~*'()#";vet.componentChars="-_.!~*'()";var Cet=vet;p();function pde(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(pde,"format");p();function bet(){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(bet,"Url");var nts=/^([a-z0-9.+-]+:)/i,its=/:[0-9]*$/,ots=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,sts=["<",">",'"',"`"," ","\r",` -`," "],ats=["{","}","|","\\","^","`"].concat(sts),cts=["'"].concat(ats),Nwn=["%","/","?",";","#"].concat(cts),Mwn=["/","?","#"],lts=255,Own=/^[+a-z0-9A-Z_-]{0,63}$/,uts=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Lwn={javascript:!0,"javascript:":!0},Bwn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function dts(t,e){if(t&&t instanceof bet)return t;let r=new bet;return r.parse(t,e),r}a(dts,"urlParse");bet.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=ots.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=nts.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&&Lwn[c])&&(s=s.substr(2),this.slashes=!0)),!Lwn[c]&&(o||c&&!Bwn[c])){let d=-1;for(let A=0;A127?v+="x":v+=_[b];if(!v.match(Own)){let b=A.slice(0,y),T=A.slice(y+1),w=_.match(uts);w&&(b.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>lts&&(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),Bwn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};bet.prototype.parseHost=function(t){let e=its.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 Uwe=dts;var G$t={};ki(G$t,{Any:()=>Iet,Cc:()=>xet,Cf:()=>Fwn,P:()=>hde,S:()=>wet,Z:()=>Ret});p();p();var Iet=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var xet=/[\0-\x1F\x7F-\x9F]/;p();var Fwn=/[\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 hde=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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 wet=/[\$\+<->\^`\|~\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 Ret=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var Uwn=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 Qwn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var $$t,fts=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]]),V$t=($$t=String.fromCodePoint)!==null&&$$t!==void 0?$$t: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 W$t(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=fts.get(t))!==null&&e!==void 0?e:t}a(W$t,"replaceCodePoint");var Tg;(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"})(Tg||(Tg={}));var pts=32,Yq;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Yq||(Yq={}));function z$t(t){return t>=Tg.ZERO&&t<=Tg.NINE}a(z$t,"isNumber");function hts(t){return t>=Tg.UPPER_A&&t<=Tg.UPPER_F||t>=Tg.LOWER_A&&t<=Tg.LOWER_F}a(hts,"isHexadecimalCharacter");function mts(t){return t>=Tg.UPPER_A&&t<=Tg.UPPER_Z||t>=Tg.LOWER_A&&t<=Tg.LOWER_Z||z$t(t)}a(mts,"isAsciiAlphaNumeric");function gts(t){return t===Tg.EQUALS||mts(t)}a(gts,"isEntityInAttributeInvalidEnd");var Sg;(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"})(Sg||(Sg={}));var c2;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(c2||(c2={}));var ket=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=Sg.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=c2.Strict}startEntity(e){this.decodeMode=e,this.state=Sg.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case Sg.EntityStart:return e.charCodeAt(r)===Tg.NUM?(this.state=Sg.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=Sg.NamedEntity,this.stateNamedEntity(e,r));case Sg.NumericStart:return this.stateNumericStart(e,r);case Sg.NumericDecimal:return this.stateNumericDecimal(e,r);case Sg.NumericHex:return this.stateNumericHex(e,r);case Sg.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|pts)===Tg.LOWER_X?(this.state=Sg.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=Sg.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===Tg.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==c2.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]&Yq.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]&~Yq.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Sg.NamedEntity:return this.result!==0&&(this.decodeMode!==c2.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Sg.NumericDecimal:return this.emitNumericEntity(0,2);case Sg.NumericHex:return this.emitNumericEntity(0,3);case Sg.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Sg.EntityStart:return 0}}};function qwn(t){let e="",r=new ket(t,n=>e+=V$t(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(qwn,"getDecoder");function Ats(t,e,r,n){let o=(e&Yq.BRANCH_LENGTH)>>7,s=e&Yq.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(Ats,"determineBranch");var jwn=qwn(Uwn),vMd=qwn(Qwn);function mde(t,e=c2.Legacy){return jwn(t,e)}a(mde,"decodeHTML");function Qwe(t){return jwn(t,c2.Strict)}a(Qwe,"decodeHTMLStrict");p();p();function Pet(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 Y$t(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(Y$t,"getEscaper");var Hwn=Y$t(/[&<>'"]/g,Ets),Gwn=Y$t(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),$wn=Y$t(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var Vwn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(Vwn||(Vwn={}));var Wwn;(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"})(Wwn||(Wwn={}));function bts(t){return Object.prototype.toString.call(t)}a(bts,"_class");function Det(t){return bts(t)==="[object String]"}a(Det,"isString");var Sts=Object.prototype.hasOwnProperty;function Tts(t,e){return Sts.call(t,e)}a(Tts,"has");function gde(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(gde,"assign");function J$t(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(J$t,"arrayReplaceAt");function Net(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(Net,"isValidEntityCode");function Ade(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(Ade,"fromCodePoint");var Kwn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Its=/&([a-z#][a-z0-9]{1,31});/gi,xts=new RegExp(Kwn.source+"|"+Its.source,"gi"),wts=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Rts(t,e){if(e.charCodeAt(0)===35&&wts.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Net(n)?Ade(n):t}let r=mde(t);return r!==t?r:t}a(Rts,"replaceEntityPattern");function kts(t){return t.indexOf("\\")<0?t:t.replace(Kwn,"$1")}a(kts,"unescapeMd");function fF(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(xts,function(e,r,n){return r||Rts(e,n)})}a(fF,"unescapeAll");var Pts=/[&<>"]/,Dts=/[&<>"]/g,Nts={"&":"&","<":"<",">":">",'"':"""};function Mts(t){return Nts[t]}a(Mts,"replaceUnsafeChar");function pF(t){return Pts.test(t)?t.replace(Dts,Mts):t}a(pF,"escapeHtml");var Ots=/[.?*+^$[\]\\(){}|-]/g;function Lts(t){return t.replace(Ots,"\\$&")}a(Lts,"escapeRE");function Zs(t){switch(t){case 9:case 32:return!0}return!1}a(Zs,"isSpace");function EJ(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(EJ,"isWhiteSpace");function Jwn(t){return hde.test(t)||wet.test(t)}a(Jwn,"isPunctChar");function _J(t){return Jwn(Ade(t))}a(_J,"isPunctCharCode");function vJ(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(vJ,"isMdAsciiPunct");function CJ(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(CJ,"normalizeReference");function Ywn(t){return t===32||t===9||t===10||t===13}a(Ywn,"isAsciiTrimmable");function bJ(t){let e=0;for(;e=e&&Ywn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(bJ,"asciiTrim");var Bts={mdurl:Tet,ucmicro:G$t};var rVt={};ki(rVt,{parseLinkDestination:()=>eVt,parseLinkLabel:()=>X$t,parseLinkTitle:()=>tVt});p();p();function X$t(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=fF(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(eVt,"parseLinkDestination");p();function tVt(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"+pF(s.content)+""};KO.code_block=function(t,e,r,n,o){let s=t[e];return""+pF(t[e].content)+` -`};KO.fence=function(t,e,r,n,o){let s=t[e],c=s.info?fF(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)||pF(s.content):d=pF(s.content),d.indexOf("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(ots,"isUndefined");function H$t(t){return Buffer.from(t,"base64").toString("utf-8")}a(H$t,"decodeBase64");function Pwn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Pwn,"isObject");p();var zq="activate_",tv=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(zq))throw new Error(`Virtual tool name must start with '${zq}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(zq+e+this.name.slice(zq.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))}},G$t=class extends lr{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))}},_et=class extends lr{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Yq.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(Yq.UserMessage,null,this.props.tools.map(e=>vscpp(Bwe,{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)))}},vet=class extends lr{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Yq.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(Yq.UserMessage,null,this.props.tools.map(e=>vscpp(Bwe,{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)))}},Cet=class extends lr{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Yq.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(Yq.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(G$t,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(Bwe,{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 X$t={};ki(X$t,{arrayReplaceAt:()=>Z$t,asciiTrim:()=>bJ,assign:()=>gde,escapeHtml:()=>hF,escapeRE:()=>qts,fromCodePoint:()=>Ade,has:()=>kts,isMdAsciiPunct:()=>vJ,isPunctChar:()=>Zwn,isPunctCharCode:()=>_J,isSpace:()=>Zs,isString:()=>Oet,isValidEntityCode:()=>Let,isWhiteSpace:()=>EJ,lib:()=>jts,normalizeReference:()=>CJ,unescapeAll:()=>pF,unescapeMd:()=>Ots});p();var wet={};ki(wet,{decode:()=>Fwe,encode:()=>Iet,format:()=>pde,parse:()=>Uwe});p();p();var Dwn={};function sts(t){let e=Dwn[t];if(e)return e;e=Dwn[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(bet,"decode");bet.defaultChars=";/?:@&=+$,#";bet.componentChars="";var Fwe=bet;p();var Nwn={};function ats(t){let e=Nwn[t];if(e)return e;e=Nwn[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=ats(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(Tet,"encode");Tet.defaultChars=";/?:@&=+$,-_.!~*'()#";Tet.componentChars="-_.!~*'()";var Iet=Tet;p();function pde(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(pde,"format");p();function xet(){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(xet,"Url");var cts=/^([a-z0-9.+-]+:)/i,lts=/:[0-9]*$/,uts=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,dts=["<",">",'"',"`"," ","\r",` +`," "],fts=["{","}","|","\\","^","`"].concat(dts),pts=["'"].concat(fts),Mwn=["%","/","?",";","#"].concat(pts),Own=["/","?","#"],hts=255,Lwn=/^[+a-z0-9A-Z_-]{0,63}$/,mts=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Bwn={javascript:!0,"javascript:":!0},Fwn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function gts(t,e){if(t&&t instanceof xet)return t;let r=new xet;return r.parse(t,e),r}a(gts,"urlParse");xet.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=uts.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=cts.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&&Bwn[c])&&(s=s.substr(2),this.slashes=!0)),!Bwn[c]&&(o||c&&!Fwn[c])){let d=-1;for(let A=0;A127?v+="x":v+=_[b];if(!v.match(Lwn)){let b=A.slice(0,y),T=A.slice(y+1),w=_.match(mts);w&&(b.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>hts&&(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),Fwn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};xet.prototype.parseHost=function(t){let e=lts.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 Uwe=gts;var $$t={};ki($$t,{Any:()=>Ret,Cc:()=>ket,Cf:()=>Uwn,P:()=>hde,S:()=>Pet,Z:()=>Det});p();p();var Ret=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var ket=/[\0-\x1F\x7F-\x9F]/;p();var Uwn=/[\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 hde=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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 Pet=/[\$\+<->\^`\|~\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 Det=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var Qwn=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 qwn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var V$t,Ats=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]]),W$t=(V$t=String.fromCodePoint)!==null&&V$t!==void 0?V$t: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 z$t(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Ats.get(t))!==null&&e!==void 0?e:t}a(z$t,"replaceCodePoint");var Tg;(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"})(Tg||(Tg={}));var yts=32,Kq;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Kq||(Kq={}));function Y$t(t){return t>=Tg.ZERO&&t<=Tg.NINE}a(Y$t,"isNumber");function Ets(t){return t>=Tg.UPPER_A&&t<=Tg.UPPER_F||t>=Tg.LOWER_A&&t<=Tg.LOWER_F}a(Ets,"isHexadecimalCharacter");function _ts(t){return t>=Tg.UPPER_A&&t<=Tg.UPPER_Z||t>=Tg.LOWER_A&&t<=Tg.LOWER_Z||Y$t(t)}a(_ts,"isAsciiAlphaNumeric");function vts(t){return t===Tg.EQUALS||_ts(t)}a(vts,"isEntityInAttributeInvalidEnd");var Sg;(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"})(Sg||(Sg={}));var l2;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(l2||(l2={}));var Net=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=Sg.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=l2.Strict}startEntity(e){this.decodeMode=e,this.state=Sg.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case Sg.EntityStart:return e.charCodeAt(r)===Tg.NUM?(this.state=Sg.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=Sg.NamedEntity,this.stateNamedEntity(e,r));case Sg.NumericStart:return this.stateNumericStart(e,r);case Sg.NumericDecimal:return this.stateNumericDecimal(e,r);case Sg.NumericHex:return this.stateNumericHex(e,r);case Sg.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|yts)===Tg.LOWER_X?(this.state=Sg.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=Sg.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===Tg.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]&Kq.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]&~Kq.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Sg.NamedEntity:return this.result!==0&&(this.decodeMode!==l2.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Sg.NumericDecimal:return this.emitNumericEntity(0,2);case Sg.NumericHex:return this.emitNumericEntity(0,3);case Sg.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Sg.EntityStart:return 0}}};function jwn(t){let e="",r=new Net(t,n=>e+=W$t(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(jwn,"getDecoder");function Cts(t,e,r,n){let o=(e&Kq.BRANCH_LENGTH)>>7,s=e&Kq.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(Cts,"determineBranch");var Hwn=jwn(Qwn),wMd=jwn(qwn);function mde(t,e=l2.Legacy){return Hwn(t,e)}a(mde,"decodeHTML");function Qwe(t){return Hwn(t,l2.Strict)}a(Qwe,"decodeHTMLStrict");p();p();function Met(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 K$t(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(K$t,"getEscaper");var Gwn=K$t(/[&<>'"]/g,Sts),$wn=K$t(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),Vwn=K$t(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var Wwn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(Wwn||(Wwn={}));var zwn;(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"})(zwn||(zwn={}));function wts(t){return Object.prototype.toString.call(t)}a(wts,"_class");function Oet(t){return wts(t)==="[object String]"}a(Oet,"isString");var Rts=Object.prototype.hasOwnProperty;function kts(t,e){return Rts.call(t,e)}a(kts,"has");function gde(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(gde,"assign");function Z$t(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(Z$t,"arrayReplaceAt");function Let(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(Let,"isValidEntityCode");function Ade(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(Ade,"fromCodePoint");var Jwn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Pts=/&([a-z#][a-z0-9]{1,31});/gi,Dts=new RegExp(Jwn.source+"|"+Pts.source,"gi"),Nts=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Mts(t,e){if(e.charCodeAt(0)===35&&Nts.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Let(n)?Ade(n):t}let r=mde(t);return r!==t?r:t}a(Mts,"replaceEntityPattern");function Ots(t){return t.indexOf("\\")<0?t:t.replace(Jwn,"$1")}a(Ots,"unescapeMd");function pF(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Dts,function(e,r,n){return r||Mts(e,n)})}a(pF,"unescapeAll");var Lts=/[&<>"]/,Bts=/[&<>"]/g,Fts={"&":"&","<":"<",">":">",'"':"""};function Uts(t){return Fts[t]}a(Uts,"replaceUnsafeChar");function hF(t){return Lts.test(t)?t.replace(Bts,Uts):t}a(hF,"escapeHtml");var Qts=/[.?*+^$[\]\\(){}|-]/g;function qts(t){return t.replace(Qts,"\\$&")}a(qts,"escapeRE");function Zs(t){switch(t){case 9:case 32:return!0}return!1}a(Zs,"isSpace");function EJ(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(EJ,"isWhiteSpace");function Zwn(t){return hde.test(t)||Pet.test(t)}a(Zwn,"isPunctChar");function _J(t){return Zwn(Ade(t))}a(_J,"isPunctCharCode");function vJ(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(vJ,"isMdAsciiPunct");function CJ(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(CJ,"normalizeReference");function Kwn(t){return t===32||t===9||t===10||t===13}a(Kwn,"isAsciiTrimmable");function bJ(t){let e=0;for(;e=e&&Kwn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(bJ,"asciiTrim");var jts={mdurl:wet,ucmicro:$$t};var nVt={};ki(nVt,{parseLinkDestination:()=>tVt,parseLinkLabel:()=>eVt,parseLinkTitle:()=>rVt});p();p();function eVt(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=pF(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(tVt,"parseLinkDestination");p();function rVt(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"+hF(s.content)+""};KO.code_block=function(t,e,r,n,o){let s=t[e];return""+hF(t[e].content)+` +`};KO.fence=function(t,e,r,n,o){let s=t[e],c=s.info?pF(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)||hF(s.content):d=hF(s.content),d.indexOf("${d} `}return`
${d}
`};KO.image=function(t,e,r,n,o){let s=t[e];return s.attrs[s.attrIndex("alt")][1]=o.renderInlineAsText(s.children,r,n),o.renderToken(t,e,r)};KO.hardbreak=function(t,e,r){return r.xhtmlOut?`
@@ -3428,22 +3428,22 @@ Do you want to allow this?`,matchingRuleInfo:f}}return{title:h,message:`The mode `};KO.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
`:`
`:` -`};KO.text=function(t,e){return pF(t[e].content)};KO.html_block=function(t,e){return t[e].content};KO.html_inline=function(t,e){return t[e].content};function yde(){this.rules=gde({},KO)}a(yde,"Renderer");yde.prototype.renderAttrs=a(function(e){let r,n,o;if(!e.attrs)return"";for(o="",r=0,n=e.attrs.length;r `:">",s},"renderToken");yde.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");Ede.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 hF=Ede;function Xwn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(Xwn,"StateCore");Xwn.prototype.Token=hF;var eRn=Xwn;p();var Fts=/\r\n?|\n/g,Uts=/\0/g;function nVt(t){let e;e=t.src.replace(Fts,` -`),e=e.replace(Uts,"\uFFFD"),t.src=e}a(nVt,"normalize");p();function iVt(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(iVt,"block");p();function oVt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a(Qts,"isLinkOpen");function qts(t){return/^<\/a\s*>/i.test(t)}a(qts,"isLinkClose");function sVt(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"&&(Qts(l.content)&&s>0&&s--,qts(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,_),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 b=new t.Token("text","",0);b.content=E,b.level=h,f.push(b);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(Hts,$ts)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(Vts,"replace_scoped");function Wts(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&tRn.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(Wts,"replace_rare");function aVt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(jts.test(t.tokens[e].content)&&Vts(t.tokens[e].children),tRn.test(t.tokens[e].content)&&Wts(t.tokens[e].children))}a(aVt,"replace");p();var zts=/['"]/,rRn=/['"]/g,nRn="\u2019";function Met(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(Met,"addReplacement");function Yts(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 E=32;if(d=48&&y<=57&&(g=m=!1),m&&g&&(m=_,g=v),!m&&!g){A&&Met(o,s,h.index,nRn);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"||!zts.test(t.tokens[e].content)||Kts(t.tokens[e].children,t)}a(cVt,"smartquotes");p();function lVt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};JO.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");JO.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!Zs(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");JO.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");JO.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");JO.prototype.Token=hF;var oRn=JO;p();var Jts=65536;function fVt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(fVt,"getLine");function sRn(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&&!Zs(l)||c===45&&Zs(l))return!1;for(;s=4)return!1;d=sRn(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 E=t.push("thead_open","thead",1);E.map=[e,e+1];let _=t.push("tr_open","tr",1);_.map=[e,e+1];for(let T=0;T=4||(d=sRn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),b+=h-d.length,b>Jts))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(hVt,"code");p();function mVt(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&&!b){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 P=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]=P-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,0];E.map=_,t.md.block.tokenize(t,e,A);let v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=c,t.parentType=m,_[1]=t.line;for(let b=0;b=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=cRn(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=aRn(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 E=[u,0];l.map=E,l.markup=String.fromCharCode(A);let _=!1,v=t.md.block.ruler.getRules("list"),b=t.parentType;for(t.parentType="list";u=o?x=1:x=w-T,x>4&&(x=1);let P=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,L=t.tShift[u],B=t.sCount[u],q=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=P,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||_)&&(d=!1),_=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=q,t.tShift[u]=L,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 O=0,j=v.length;O=4||t.src.charCodeAt(o)!==91)return!1;function l(v){let b=t.lineMax;if(v>=b||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"),P=t.parentType;t.parentType="reference";let D=!1;for(let N=0,L=x.length;N"u"&&(t.env.references={}),typeof t.env.references[_]>"u"&&(t.env.references[_]={title:E,href:h}),t.line=c),!0):!1}a(EVt,"reference");p();p();var lRn=["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 Xts="[a-zA-Z_:][a-zA-Z0-9:._-]*",ers="[^\"'=<>`\\x00-\\x20]+",trs="'[^']*'",rrs='"[^"]*"',nrs="(?:"+ers+"|"+trs+"|"+rrs+")",irs="(?:\\s+"+Xts+"(?:\\s*=\\s*"+nrs+")?)",uRn="<[A-Za-z][A-Za-z0-9\\-]*"+irs+"*\\s*\\/?>",dRn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ors="",srs="<[?][\\s\\S]*?[?]>",ars="]*>",crs="",fRn=new RegExp("^(?:"+uRn+"|"+dRn+"|"+ors+"|"+srs+"|"+ars+"|"+crs+")"),pRn=new RegExp("^(?:"+uRn+"|"+dRn+")");var TJ=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(pRn.source+"\\s*$"),/^$/,!1]];function _Vt(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&&Zs(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=bJ(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(vVt,"heading");p();function CVt(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};qwe.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 E=this.src.charCodeAt(t-2);o=(E&64512)===55296?65536+(E-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(urs);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(TVt,"linkify");p();function IVt(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){xVt[t.charCodeAt(0)]=1});function wVt(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&&xVt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(wVt,"escape");p();function RVt(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(ARn,"postProcess");function hrs(t){let e=t.tokens_meta,r=t.tokens_meta.length;ARn(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[CJ(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),E=[["href",c]];y.attrs=E,l&&E.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(DVt,"link");p();function NVt(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[CJ(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 E=t.push("image","img",0),_=[["src",f],["alt",""]];E.attrs=_,E.children=y,E.content=n,u&&_.push(["title",u])}return t.pos=s,t.posMax=m,!0}a(NVt,"image");p();var mrs=/^([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])?)*)$/,grs=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function MVt(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(grs.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(mrs.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(MVt,"autolink");p();function Ars(t){return/^\s]/i.test(t)}a(Ars,"isLinkOpen");function yrs(t){return/^<\/a\s*>/i.test(t)}a(yrs,"isLinkClose");function Ers(t){let e=t|32;return e>=97&&e<=122}a(Ers,"isLetter");function OVt(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&&!Ers(o))return!1;let s=t.src.slice(n).match(fRn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],Ars(c.content)&&t.linkLevel++,yrs(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(OVt,"html_inline");p();var _rs=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,vrs=/^&([a-z][a-z0-9]{1,31});/i;function LVt(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(_rs);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=Net(c)?Ade(c):Ade(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(vrs);if(s){let c=Qwe(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(LVt,"entity");p();function yRn(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(yRn,"processDelimiters");function BVt(t){let e=t.tokens_meta,r=t.tokens_meta.length;yRn(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};jwe.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()};jwe.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(qVt,"default");function jVt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(jVt,"assign");function Fet(t){return Object.prototype.toString.call(t)}a(Fet,"_class");function Crs(t){return Fet(t)==="[object String]"}a(Crs,"isString");function brs(t){return Fet(t)==="[object Object]"}a(brs,"isObject");function Srs(t){return Fet(t)==="[object RegExp]"}a(Srs,"isRegExp");function _Rn(t){return Fet(t)==="[object Function]"}a(_Rn,"isFunction");function Trs(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(Trs,"escapeRE");var CRn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Irs(t){return Object.keys(t||{}).reduce(function(e,r){return e||CRn.hasOwnProperty(r)},!1)}a(Irs,"isOptionsObj");var xrs={"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")}},wrs="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]",Rrs="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function krs(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(krs,"createValidator");function vRn(){return function(t,e){e.normalize(t)}}a(vRn,"createNormalizer");function Bet(t){let e=t.re=qVt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(wrs),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,brs(u)){Srs(u.validate)?d.validate=krs(u.validate):_Rn(u.validate)?d.validate=u.validate:s(l,u),_Rn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=vRn();return}if(Crs(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:vRn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(Trs).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(Bet,"compile");function bRn(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(bRn,"Match");function rT(t,e){if(!(this instanceof rT))return new rT(t,e);e||Irs(t)&&(e=t,t={}),this.__opts__=jVt({},CRn,e),this.__schemas__=jVt({},xrs,t),this.__compiled__={},this.__tlds__=Rrs,this.__tlds_replaced__=!1,this.re={},Bet(this)}a(rT,"LinkifyIt");rT.prototype.add=a(function(e,r){return this.__schemas__[e]=r,Bet(this),this},"add");rT.prototype.set=a(function(e){return this.__opts__=jVt(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"},HVt=35,ZO=Math.floor,GVt=String.fromCharCode;function Kq(t){throw new RangeError(Mrs[t])}a(Kq,"error");function Ors(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(Ors,"map");function IRn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(Nrs,".");let o=t.split("."),s=Ors(o,e).join(".");return n+s}a(IRn,"mapDomain");function xRn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),Brs=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"),TRn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),wRn=a(function(t,e,r){let n=0;for(t=r?ZO(t/700):t>>1,t+=ZO(t/e);t>HVt*26>>1;n+=36)t=ZO(t/HVt);return ZO(n+(HVt+1)*t/(t+38))},"adapt"),RRn=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&&Kq("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&Kq("invalid-input");let m=Brs(t.charCodeAt(l++));m>=36&&Kq("invalid-input"),m>ZO((2147483647-n)/f)&&Kq("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(mZO(2147483647/A)&&Kq("overflow"),f*=A}let d=e.length+1;s=wRn(n-u,d,u==0),ZO(n/d)>2147483647-o&&Kq("overflow"),o+=ZO(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),kRn=a(function(t){let e=[];t=xRn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(GVt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fZO((2147483647-o)/d)&&Kq("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&Kq("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=$Vt.toASCII(e.hostname)}catch{}return Cet(pde(e))}a($rs,"normalizeLink");function Vrs(t){let e=Uwe(t,!0);if(e.hostname&&(!e.protocol||MRn.indexOf(e.protocol)>=0))try{e.hostname=$Vt.toUnicode(e.hostname)}catch{}return Fwe(pde(e),Fwe.defaultChars+"%")}a(Vrs,"normalizeLinkText");function gw(t,e){if(!(this instanceof gw))return new gw(t,e);e||Det(t)||(e=t||{},t="default"),this.inline=new ERn,this.block=new hRn,this.core=new iRn,this.renderer=new Zwn,this.linkify=new SRn,this.validateLink=Grs,this.normalizeLink=$rs,this.normalizeLinkText=Vrs,this.utils=Z$t,this.helpers=gde({},rVt),this.options={},this.configure(t),e&&this.set(e)}a(gw,"MarkdownIt");gw.prototype.set=function(t){return gde(this.options,t),this};gw.prototype.configure=function(t){let e=this;if(Det(t)){let r=t;if(t=qrs[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};gw.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};gw.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};gw.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};gw.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};gw.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};gw.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};gw.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var VVt=gw;function WVt(t){return Array.isArray(t)}a(WVt,"isArray");function Wrs(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||WVt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(Wrs,"isFenceToken");function*ORn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;WVt(r.children)&&(yield*ORn(r.children))}}a(ORn,"flattenTokensLists");function zrs(){return new VVt}a(zrs,"createMarkdownIt");function LRn(t){let e=[],n=zrs().parse(t,{});if(!WVt(n))return e;for(let o of ORn(n)){if(!o||typeof o!="object")continue;let s=o;if(Wrs(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(LRn,"extractCodeBlocks");function zVt(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(zVt,"escapeProblematicHtmlTags");var KVt=Rn.Gpt4oMini,BRn=new fe("virtualToolSummarizer"),Hwe=class extends Error{static{a(this,"SummarizerError")}};function FRn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(FRn,"isValidCategoryItem");function URn(t,e){if(!Array.isArray(t))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(FRn))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(URn,"validateCategoriesWithoutToolsResponse");function Yrs(t){return FRn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(Yrs,"isValidCategorizationItem");function QRn(t,e){if(URn(t,e),!t.every(Yrs))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(QRn,"validateCategorizationResponse");function qRn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(qRn,"deduplicateTools");function Krs(t){let e=new Map;for(let r of t){let n=HRn(r.name),o=e.get(n);o?(r.summary&&r.summary!==o.summary&&(o.summary=`${o.summary} +`;break;default:}return n};yde.prototype.render=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");Ede.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 mF=Ede;function eRn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(eRn,"StateCore");eRn.prototype.Token=mF;var tRn=eRn;p();var Hts=/\r\n?|\n/g,Gts=/\0/g;function iVt(t){let e;e=t.src.replace(Hts,` +`),e=e.replace(Gts,"\uFFFD"),t.src=e}a(iVt,"normalize");p();function oVt(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(oVt,"block");p();function sVt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a($ts,"isLinkOpen");function Vts(t){return/^<\/a\s*>/i.test(t)}a(Vts,"isLinkClose");function aVt(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"&&($ts(l.content)&&s>0&&s--,Vts(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,_),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 b=new t.Token("text","",0);b.content=E,b.level=h,f.push(b);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(zts,Kts)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(Jts,"replace_scoped");function Zts(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&rRn.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(Zts,"replace_rare");function cVt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(Wts.test(t.tokens[e].content)&&Jts(t.tokens[e].children),rRn.test(t.tokens[e].content)&&Zts(t.tokens[e].children))}a(cVt,"replace");p();var Xts=/['"]/,nRn=/['"]/g,iRn="\u2019";function Bet(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(Bet,"addReplacement");function ers(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 E=32;if(d=48&&y<=57&&(g=m=!1),m&&g&&(m=_,g=v),!m&&!g){A&&Bet(o,s,h.index,iRn);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"||!Xts.test(t.tokens[e].content)||trs(t.tokens[e].children,t)}a(lVt,"smartquotes");p();function uVt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};JO.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");JO.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!Zs(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");JO.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");JO.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");JO.prototype.Token=mF;var sRn=JO;p();var rrs=65536;function pVt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(pVt,"getLine");function aRn(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&&!Zs(l)||c===45&&Zs(l))return!1;for(;s=4)return!1;d=aRn(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 E=t.push("thead_open","thead",1);E.map=[e,e+1];let _=t.push("tr_open","tr",1);_.map=[e,e+1];for(let T=0;T=4||(d=aRn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),b+=h-d.length,b>rrs))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(mVt,"code");p();function gVt(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&&!b){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 P=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]=P-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,0];E.map=_,t.md.block.tokenize(t,e,A);let v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=c,t.parentType=m,_[1]=t.line;for(let b=0;b=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=lRn(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=cRn(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 E=[u,0];l.map=E,l.markup=String.fromCharCode(A);let _=!1,v=t.md.block.ruler.getRules("list"),b=t.parentType;for(t.parentType="list";u=o?x=1:x=w-T,x>4&&(x=1);let P=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,L=t.tShift[u],B=t.sCount[u],q=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=P,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||_)&&(d=!1),_=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=q,t.tShift[u]=L,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 O=0,j=v.length;O=4||t.src.charCodeAt(o)!==91)return!1;function l(v){let b=t.lineMax;if(v>=b||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"),P=t.parentType;t.parentType="reference";let D=!1;for(let N=0,L=x.length;N"u"&&(t.env.references={}),typeof t.env.references[_]>"u"&&(t.env.references[_]={title:E,href:h}),t.line=c),!0):!1}a(_Vt,"reference");p();p();var uRn=["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 irs="[a-zA-Z_:][a-zA-Z0-9:._-]*",ors="[^\"'=<>`\\x00-\\x20]+",srs="'[^']*'",ars='"[^"]*"',crs="(?:"+ors+"|"+srs+"|"+ars+")",lrs="(?:\\s+"+irs+"(?:\\s*=\\s*"+crs+")?)",dRn="<[A-Za-z][A-Za-z0-9\\-]*"+lrs+"*\\s*\\/?>",fRn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",urs="",drs="<[?][\\s\\S]*?[?]>",frs="]*>",prs="",pRn=new RegExp("^(?:"+dRn+"|"+fRn+"|"+urs+"|"+drs+"|"+frs+"|"+prs+")"),hRn=new RegExp("^(?:"+dRn+"|"+fRn+")");var TJ=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(hRn.source+"\\s*$"),/^$/,!1]];function vVt(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&&Zs(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=bJ(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(CVt,"heading");p();function bVt(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};qwe.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 E=this.src.charCodeAt(t-2);o=(E&64512)===55296?65536+(E-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(mrs);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(IVt,"linkify");p();function xVt(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){wVt[t.charCodeAt(0)]=1});function RVt(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&&wVt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(RVt,"escape");p();function kVt(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(yRn,"postProcess");function Ers(t){let e=t.tokens_meta,r=t.tokens_meta.length;yRn(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[CJ(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),E=[["href",c]];y.attrs=E,l&&E.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(NVt,"link");p();function MVt(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[CJ(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 E=t.push("image","img",0),_=[["src",f],["alt",""]];E.attrs=_,E.children=y,E.content=n,u&&_.push(["title",u])}return t.pos=s,t.posMax=m,!0}a(MVt,"image");p();var _rs=/^([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])?)*)$/,vrs=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function OVt(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(vrs.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(_rs.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(OVt,"autolink");p();function Crs(t){return/^\s]/i.test(t)}a(Crs,"isLinkOpen");function brs(t){return/^<\/a\s*>/i.test(t)}a(brs,"isLinkClose");function Srs(t){let e=t|32;return e>=97&&e<=122}a(Srs,"isLetter");function LVt(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&&!Srs(o))return!1;let s=t.src.slice(n).match(pRn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],Crs(c.content)&&t.linkLevel++,brs(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(LVt,"html_inline");p();var Trs=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Irs=/^&([a-z][a-z0-9]{1,31});/i;function BVt(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(Trs);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=Let(c)?Ade(c):Ade(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(Irs);if(s){let c=Qwe(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(BVt,"entity");p();function ERn(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(ERn,"processDelimiters");function FVt(t){let e=t.tokens_meta,r=t.tokens_meta.length;ERn(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};jwe.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()};jwe.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(jVt,"default");function HVt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(HVt,"assign");function qet(t){return Object.prototype.toString.call(t)}a(qet,"_class");function xrs(t){return qet(t)==="[object String]"}a(xrs,"isString");function wrs(t){return qet(t)==="[object Object]"}a(wrs,"isObject");function Rrs(t){return qet(t)==="[object RegExp]"}a(Rrs,"isRegExp");function vRn(t){return qet(t)==="[object Function]"}a(vRn,"isFunction");function krs(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(krs,"escapeRE");var bRn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Prs(t){return Object.keys(t||{}).reduce(function(e,r){return e||bRn.hasOwnProperty(r)},!1)}a(Prs,"isOptionsObj");var Drs={"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")}},Nrs="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]",Mrs="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function Ors(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(Ors,"createValidator");function CRn(){return function(t,e){e.normalize(t)}}a(CRn,"createNormalizer");function Qet(t){let e=t.re=jVt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(Nrs),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,wrs(u)){Rrs(u.validate)?d.validate=Ors(u.validate):vRn(u.validate)?d.validate=u.validate:s(l,u),vRn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=CRn();return}if(xrs(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:CRn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(krs).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(Qet,"compile");function SRn(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(SRn,"Match");function iT(t,e){if(!(this instanceof iT))return new iT(t,e);e||Prs(t)&&(e=t,t={}),this.__opts__=HVt({},bRn,e),this.__schemas__=HVt({},Drs,t),this.__compiled__={},this.__tlds__=Mrs,this.__tlds_replaced__=!1,this.re={},Qet(this)}a(iT,"LinkifyIt");iT.prototype.add=a(function(e,r){return this.__schemas__[e]=r,Qet(this),this},"add");iT.prototype.set=a(function(e){return this.__opts__=HVt(this.__opts__,e),this},"set");iT.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");iT.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");iT.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");iT.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"},GVt=35,ZO=Math.floor,$Vt=String.fromCharCode;function Jq(t){throw new RangeError(Urs[t])}a(Jq,"error");function Qrs(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(Qrs,"map");function xRn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(Frs,".");let o=t.split("."),s=Qrs(o,e).join(".");return n+s}a(xRn,"mapDomain");function wRn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),jrs=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"),IRn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),RRn=a(function(t,e,r){let n=0;for(t=r?ZO(t/700):t>>1,t+=ZO(t/e);t>GVt*26>>1;n+=36)t=ZO(t/GVt);return ZO(n+(GVt+1)*t/(t+38))},"adapt"),kRn=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&&Jq("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&Jq("invalid-input");let m=jrs(t.charCodeAt(l++));m>=36&&Jq("invalid-input"),m>ZO((2147483647-n)/f)&&Jq("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(mZO(2147483647/A)&&Jq("overflow"),f*=A}let d=e.length+1;s=RRn(n-u,d,u==0),ZO(n/d)>2147483647-o&&Jq("overflow"),o+=ZO(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),PRn=a(function(t){let e=[];t=wRn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push($Vt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fZO((2147483647-o)/d)&&Jq("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&Jq("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=VVt.toASCII(e.hostname)}catch{}return Iet(pde(e))}a(Krs,"normalizeLink");function Jrs(t){let e=Uwe(t,!0);if(e.hostname&&(!e.protocol||ORn.indexOf(e.protocol)>=0))try{e.hostname=VVt.toUnicode(e.hostname)}catch{}return Fwe(pde(e),Fwe.defaultChars+"%")}a(Jrs,"normalizeLinkText");function Aw(t,e){if(!(this instanceof Aw))return new Aw(t,e);e||Oet(t)||(e=t||{},t="default"),this.inline=new _Rn,this.block=new mRn,this.core=new oRn,this.renderer=new Xwn,this.linkify=new TRn,this.validateLink=Yrs,this.normalizeLink=Krs,this.normalizeLinkText=Jrs,this.utils=X$t,this.helpers=gde({},nVt),this.options={},this.configure(t),e&&this.set(e)}a(Aw,"MarkdownIt");Aw.prototype.set=function(t){return gde(this.options,t),this};Aw.prototype.configure=function(t){let e=this;if(Oet(t)){let r=t;if(t=Vrs[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};Aw.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};Aw.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};Aw.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Aw.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};Aw.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Aw.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};Aw.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var WVt=Aw;function zVt(t){return Array.isArray(t)}a(zVt,"isArray");function Zrs(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||zVt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(Zrs,"isFenceToken");function*LRn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;zVt(r.children)&&(yield*LRn(r.children))}}a(LRn,"flattenTokensLists");function Xrs(){return new WVt}a(Xrs,"createMarkdownIt");function BRn(t){let e=[],n=Xrs().parse(t,{});if(!zVt(n))return e;for(let o of LRn(n)){if(!o||typeof o!="object")continue;let s=o;if(Zrs(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(BRn,"extractCodeBlocks");function YVt(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(YVt,"escapeProblematicHtmlTags");var JVt=Rn.Gpt4oMini,FRn=new fe("virtualToolSummarizer"),Hwe=class extends Error{static{a(this,"SummarizerError")}};function URn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(URn,"isValidCategoryItem");function QRn(t,e){if(!Array.isArray(t))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(URn))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(QRn,"validateCategoriesWithoutToolsResponse");function ens(t){return URn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(ens,"isValidCategorizationItem");function qRn(t,e){if(QRn(t,e),!t.every(ens))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(qRn,"validateCategorizationResponse");function jRn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(jRn,"deduplicateTools");function tns(t){let e=new Map;for(let r of t){let n=GRn(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=qRn(r.tools);return[...e.values()]}a(Krs,"validateAndCleanupCategories");function jRn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(Rwn)}));return Krs(r)}a(jRn,"processCategorizationResponse");function HRn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(HRn,"normalizeGroupName");function YVt(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:fet,summary:vwn,tools:[...r.values()]}),t}a(YVt,"addUncategorizedToolsIfNeeded");async function JVt(t,e,r,n){if(n.isCancellationRequested)return BRn.debug(t.ctx,"Summarization cancelled"),null;let o=OA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await tl(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new oc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return BRn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of LRn(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(JVt,"getResponse");async function GRn(t,e,r){let n=await t.ctx.get(el).getBestChatModelConfig([KVt]),s=await ap.create(Aet,{tools:e},n).renderPrompt(void 0,r),c=await JVt(t,s,n,r);if(!c)return;let l=[c];return URn(l,"categorizer"),{...l[0],tools:qRn(e),name:HRn(l[0].name)}}a(GRn,"summarizeToolGroup");async function $Rn(t,e,r){let n=await t.ctx.get(el).getBestChatModelConfig([KVt]),s=await ap.create(yet,{tools:e},n).renderPrompt(void 0,r),c=await JVt(t,s,n,r);if(!c)return;QRn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=jRn(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 ZVt(t,u,f,r);h&&(u=h),u=YVt(u,l)}return u}a($Rn,"divideToolsIntoGroups");async function ZVt(t,e,r,n){let o=await t.ctx.get(el).getBestChatModelConfig([KVt]),c=await ap.create(Eet,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await JVt(t,c,o,n);if(!l)return;QRn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=jRn(l,d);return YVt(f,d)}a(ZVt,"divideToolsIntoExistingGroups");var zRn=de(require("crypto"));var XVt=new fe("virtualToolGrouper"),WRn="builtin",ens=`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=jRn(r.tools);return[...e.values()]}a(tns,"validateAndCleanupCategories");function HRn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(kwn)}));return tns(r)}a(HRn,"processCategorizationResponse");function GRn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(GRn,"normalizeGroupName");function KVt(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:met,summary:Cwn,tools:[...r.values()]}),t}a(KVt,"addUncategorizedToolsIfNeeded");async function ZVt(t,e,r,n){if(n.isCancellationRequested)return FRn.debug(t.ctx,"Summarization cancelled"),null;let o=OA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await tl(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new oc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return FRn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of BRn(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(ZVt,"getResponse");async function $Rn(t,e,r){let n=await t.ctx.get(el).getBestChatModelConfig([JVt]),s=await ap.create(_et,{tools:e},n).renderPrompt(void 0,r),c=await ZVt(t,s,n,r);if(!c)return;let l=[c];return QRn(l,"categorizer"),{...l[0],tools:jRn(e),name:GRn(l[0].name)}}a($Rn,"summarizeToolGroup");async function VRn(t,e,r){let n=await t.ctx.get(el).getBestChatModelConfig([JVt]),s=await ap.create(vet,{tools:e},n).renderPrompt(void 0,r),c=await ZVt(t,s,n,r);if(!c)return;qRn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=HRn(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 XVt(t,u,f,r);h&&(u=h),u=KVt(u,l)}return u}a(VRn,"divideToolsIntoGroups");async function XVt(t,e,r,n){let o=await t.ctx.get(el).getBestChatModelConfig([JVt]),c=await ap.create(Cet,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await ZVt(t,c,o,n);if(!l)return;qRn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=HRn(l,d);return KVt(f,d)}a(XVt,"divideToolsIntoExistingGroups");var YRn=de(require("crypto"));var eWt=new fe("virtualToolGrouper"),zRn="builtin",ons=`Call this tool when you need access to a new category of tools. The category of tools is described as follows: -`,tns=` +`,sns=` -Be sure to call this tool if you need a capability related to the above.`,Uet=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"?WRn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof ev&&(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===WRn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof EK);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 ev){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){XVt.error(this.turnContext.ctx,`Failed to categorize tools: ${Xu(d)}`)}}XVt.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===fet);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 ev(Wq+d.name,ens+d.summary+tns,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 ev&&!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 GRn(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 ZVt(this.turnContext,r,e,n):await $Rn(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 ev&&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 ev&&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 zRn.createHash("sha256").update(r).digest("hex")}};var Qet=class{constructor(e){this._root=new ev(Wq,"",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){Lwe(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new Uet(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 ev)return o.isExpanded=!0,new Lr([new Rr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var XO=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===Cl.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 Qet(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 YRn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(YRn,"calculateReducedMaxRequestTokens");Mo();var ons=500,qet=3,Ig=new fe("toolCallingLoop"),sns="internal.tool_calling_loop_continue_confirmation",_de=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.toolCallRounds=[];this.maxOutputTokenRecoveryCount=0;this.conversationProgress=e.ctx.get(Tc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(gs),this.transcriptPersistence=new p0(e.ctx),this.llmRequestPersistence=Zae(()=>{if(!eKe(e.ctx))return;let d=e.subagentInfo;return new XYe(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 ede(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new pet(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=YRn(c),u=c-l;Ig.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=Mt(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(ons,Ft(e.ctx,Ye.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new TXe(new IXe(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(m0).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=oYe(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 K$e(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(Ryn(this.turnContext.ctx,this.turnContext,r,performance.now()-s,this.baseTelemetryWithExp,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics,c.routeForTelemetry),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.`,jet=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"?zRn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof tv&&(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===zRn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof EK);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 tv){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){eWt.error(this.turnContext.ctx,`Failed to categorize tools: ${Xu(d)}`)}}eWt.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===met);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 tv(zq+d.name,ons+d.summary+sns,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 tv&&!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 $Rn(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 XVt(this.turnContext,r,e,n):await VRn(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 tv&&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 tv&&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 YRn.createHash("sha256").update(r).digest("hex")}};var Het=class{constructor(e){this._root=new tv(zq,"",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){Lwe(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new jet(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 tv)return o.isExpanded=!0,new Lr([new Rr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var XO=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===Cl.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 Het(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 KRn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(KRn,"calculateReducedMaxRequestTokens");Oo();var uns=500,Get=3,Ig=new fe("toolCallingLoop"),dns="internal.tool_calling_loop_continue_confirmation",_de=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.toolCallRounds=[];this.maxOutputTokenRecoveryCount=0;this.conversationProgress=e.ctx.get(Tc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(gs),this.transcriptPersistence=new p0(e.ctx),this.llmRequestPersistence=Zae(()=>{if(!nKe(e.ctx))return;let d=e.subagentInfo;return new rKe(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 ede(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new get(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=KRn(c),u=c-l;Ig.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=Mt(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(uns,Ft(e.ctx,Ye.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new wXe(new RXe(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(m0).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=cYe(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 Z$e(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(kyn(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 uF?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} +`}]}));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 dF?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 R=this.subagentConfig.filterTools?.(o);R!==void 0&&(o=R),s=this.subagentConfig.createPromptRenderer(this.turnContext,o,this.modelConfiguration,{oneBasedIterationNum:e,maxRounds:this.maxToolCallingLoop})}else{let R=this.createAgentPromptProps(o);s=ap.create(det,R,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=iYe(this.modelConfiguration,c),u=(await s.renderPrompt(void 0,r,{collapseSystemMessages:!0,enableCacheBreakpoints:c})).messages;if(e===1&&!this.turn.renderedUserMessage)for(let R=u.length-1;R>=0;R--){let x=u[R];if(x.role==="user"&&x.content){this.turn.renderedUserMessage=x.content,this.recordRenderedUserMessageTranscript(x.content);break}}let d="",f=new Iq((R,x,P,D,N,L)=>{let B=R.trim(),M=B.match(Hxe)!==null&&B.endsWith("-->")||!!this.subagentConfig?.hideReplyText;this.conversationProgress.report(this.conversation,this.turn,{annotations:x,references:P,hideText:M,notifications:D.map(O=>({severity:"warning",message:O.message})),thinking:L,editAgentRounds:[{roundId:e,reply:M?"":R}]}),this.turn.annotations.push(...x??[]),d+=R});this.abortIfCanceled(r);let h=await this.getAvailableChatTools(o,r);this.abortIfCanceled(r);let m=this.metricsTracker.computePromptPrefixMetrics(u,h),g={messages:u,modelConfiguration:this.modelConfiguration,uiKind:"agentPanel",chatModeKind:this.turnContext.turn.chatMode?.kind,tools:h,intentParams:{intent:!0},llmInteraction:this.turnContext.toLlmInteraction(),endpoint:l,turnId:String(this.turn.id)};this.checkChatPayload(g),Ig.debug(this.turnContext.ctx,`Send request for iteration ${e} for turn ${this.turn.id} with: ${JSON.stringify(g,null,2)}`);let A,y=this.metricsTracker.getTimeSinceLastLLMCall(),E=performance.now(),_=30,v={shouldRetry:a(R=>R.type==="failed"&&R.code===429&&R.retryAfter!==void 0&&R.retryAfter>=0&&R.retryAfter<=_,"shouldRetry"),onRetry:a(async R=>{let x=R.type==="failed"?R.retryAfter:void 0;x!==void 0&&(Ig.info(this.turnContext.ctx,`Rate limited in iteration ${e} for turn ${this.turn.id}, retrying in ${x}s`),await this.turnContext.warn("Service is busy. Retrying shortly \u2014 you can cancel anytime."))},"onRetry"),maxRetryAttempts:3},b=await this.chatFetcher.fetchResponse(g,r,this.baseTelemetryWithExp,(R,x)=>(x.phase&&(A=x.phase),f.isFinishedAfter(R,x)),this.llmRequestPersistence,v),T=performance.now()-E;if(this.metricsTracker.recordLlmFetchComplete(),b.type==="length"){if(this.addToolCallModelResponseToTurn(d,[],b.thinking,A),this.recordAssistantRoundTranscript(d,e,b.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 LA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new Oc;case"failed":throw this.turn.status="error",Ig.error(this.turnContext.ctx,"Fetch failed:",r),new LA({message:$_.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===V_,copilotPlan:rx(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new LA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new LA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new LA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new LA({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 LA({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}=xo.parseModelNotSupportedReason(r.reason);throw new LA({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 LA({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 LA({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=>{if(!u.id){let d=`cls_${t.NextToolCallId++}`;u.id=d}return 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 ev)this.handleVirtualToolCall(c,e,n);else if(c instanceof EK)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;Ig.error(this.turnContext.ctx,l);let u=new Lr([new Rr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=PXe(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(XO).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Lr([new Rr(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;a7t(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=B3(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){Ig.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Lr([new Rr(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=Vxn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=PXe(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 $q||u instanceof Oc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Lr([new Rr("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{Ig.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${Xu(u)}`,u),l="error";let d=new Lr([new Rr(Xu(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=PXe(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),a7t(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=B3(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){Ig.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${Xu(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(XO);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 Ig.error(this.turnContext.ctx,`Error while computing tool grouping: ${Xu(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof ev?{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"?lwn(this.modelConfiguration):e.name==="apply_patch"?dwn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?WO.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=oq(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+GO(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(TK(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){Ig.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=oq(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(XO).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(yJ).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(tT),c=pJ(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!YO.isPotentiallySensitiveTool(e))return;let n=YO.getMatchingRuleForToolCall(e,r,this.turnContext),o=YO.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 Oc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){Ig.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=YO.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=nwn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?pJ(n.description)||"sh":void 0,E=await this.toolsService.invokeToolConfirmation(this.turnContext,n.id,{title:d.title,message:d.message,input:{...o,toolType:A,...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(E.result){case"dismiss":throw this.turn.status="cancelled",new $q("Cancelled by user");case"accept":return Promise.resolve();default:throw new $q(`Invalid confirmation result ${E.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(Ig.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,Ig.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new uF}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(qd)}catch(s){return Ig.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${Xu(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:sns,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 Ig.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${Xu(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new LA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new LA({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(ZC).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){Ig.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${Xu(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=dXe(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=yxn(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=Exn(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=_xn(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}));Jae(()=>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||Jae(()=>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=GO(n.content),c=Math.round(performance.now()-o);Jae(()=>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 eWt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},tWt=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 dQt(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(dQt,"parseModelString");var jet=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 Xf({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 JIe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new lK([c],e.conversation.source,e.conversation.userLanguage),f=new hw(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let b=dQt(this.config.model),T=b.modelName.toLowerCase(),w=b.provider.toLowerCase()||"copilot";if(w==="copilot"){let P=(await f.ctx.get(xs).getMetadata()).find(D=>D.name.toLowerCase()===T);if(P)h=await xo.getModelConfigurationById(e.ctx,P.id);else if(T===oKe.toLowerCase())m=!0,h=await xo.getModelConfigurationById(e.ctx,V_,d.id.toString(),iq(d.turns));else throw new Error(`Model "${b.modelName}" not found in available models`)}else{let P=(await new da(f.ctx.get(Yn)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(P)h=await hO(f.ctx,P.provider,P.name);else throw new Error(`BYOK model "${b.modelName}" with provider "${b.provider}" not found`)}}else this.subagentConfig.resolveModelFamily&&e.turn.resolvedModelConfiguration?.providerName===void 0?h=await ans(e,b=>this.subagentConfig.resolveModelFamily(b)):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 oc(e.ctx),A=await tl(e.ctx,f,{languageId:""}),y=n||new eWt,E=new tWt(y,e.turn.id);await e.ctx.get(Tc).begin(d,c,E),await new _de(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(Au).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?Pn(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 ans(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 xo.resolveModelIdFromFamily(t.ctx,s);if(!c)continue;let l=await xo.getModelConfigurationById(t.ctx,c);if(o!==void 0&&l.originalBillingMultiplier!==void 0&&l.originalBillingMultiplier>o)continue;return l}catch{continue}return r}a(ans,"resolvePreferredSubagentModel");p();p();p();var Jq=de(Io());var Het=class extends lr{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=Pn(r.request.message),c=yO(r.response?.message,!0),l=RO(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,Jq.useKeepWith)();return vscpp(vscppf,null,vscpp(Jq.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(Jq.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(jq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Hq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(tde,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(Jq.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(Jq.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 rWt=10,cns=new Set(["file_search","grep_search","read_file"]),Get=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[Rn.ClaudeHaiku45,Rn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:rWt,isLastTurn:o.oneBasedIterationNum>rWt};return ap.create(Het,s,n)}filterTools(e){return e.filter(r=>cns.has(r.name))}getMaxRounds(){return rWt+1}};p();var xJ=de(Io());var $et=class extends lr{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=yO(r.response?.message,!0),l=RO(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,xJ.useKeepWith)(),d=Pn(r.request.message);return vscpp(vscppf,null,vscpp(xJ.SystemMessage,{priority:1e3},vscpp(ide,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(xJ.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(jq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Hq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(xJ.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 nWt=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 ap.create($et,s,n)}};function KRn(t){return t.isBuiltIn&&t.name==="Search"?new Get:new nWt(t)}a(KRn,"resolveSubagentConfig");var vde=class extends vu{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=ap.create(het,D,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=aYe(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 xq((D,N,L,B,q,M)=>{let O=D.trim(),Q=O.match(Hxe)!==null&&O.endsWith("-->")||!!this.subagentConfig?.hideReplyText;this.conversationProgress.report(this.conversation,this.turn,{annotations:N,references:L,hideText:Q,notifications:B.map(U=>({severity:"warning",message:U.message})),thinking:M,editAgentRounds:[{roundId:e,reply:Q?"":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),E={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(E),Ig.debug(this.turnContext.ctx,`Send request for iteration ${e} for turn ${this.turn.id} with: ${JSON.stringify(E,null,2)}`);let _,v=this.metricsTracker.getTimeSinceLastLLMCall(),b=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&&(Ig.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(E,r,this.baseTelemetryWithExp,(D,N)=>(N.phase&&(_=N.phase),m.isFinishedAfter(D,N)),this.llmRequestPersistence,w),x=performance.now()-b;if(this.metricsTracker.recordLlmFetchComplete(),R.type==="length"){if(this.addToolCallModelResponseToTurn(h,[],R.thinking,_),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 LA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new Oc;case"failed":throw this.turn.status="error",Ig.error(this.turnContext.ctx,"Fetch failed:",r),new LA({message:V_.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===W_,copilotPlan:ix(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new LA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new LA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new LA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new LA({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 LA({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}=wo.parseModelNotSupportedReason(r.reason);throw new LA({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 LA({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 LA({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=>{if(!u.id){let d=`cls_${t.NextToolCallId++}`;u.id=d}return 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 tv)this.handleVirtualToolCall(c,e,n);else if(c instanceof EK)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;Ig.error(this.turnContext.ctx,l);let u=new Lr([new Rr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=MXe(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(XO).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Lr([new Rr(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;c7t(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=F3(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){Ig.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Lr([new Rr(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=Wxn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=MXe(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 Vq||u instanceof Oc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Lr([new Rr("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{Ig.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${Xu(u)}`,u),l="error";let d=new Lr([new Rr(Xu(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=MXe(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),c7t(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=F3(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){Ig.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${Xu(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(XO);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 Ig.error(this.turnContext.ctx,`Error while computing tool grouping: ${Xu(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof tv?{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"?uwn(this.modelConfiguration):e.name==="apply_patch"?fwn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?WO.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=sq(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+GO(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(TK(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){Ig.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=sq(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(XO).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(yJ).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(nT),c=pJ(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!YO.isPotentiallySensitiveTool(e))return;let n=YO.getMatchingRuleForToolCall(e,r,this.turnContext),o=YO.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 Oc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){Ig.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=YO.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=iwn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?pJ(n.description)||"sh":void 0,E=await this.toolsService.invokeToolConfirmation(this.turnContext,n.id,{title:d.title,message:d.message,input:{...o,toolType:A,...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(E.result){case"dismiss":throw this.turn.status="cancelled",new Vq("Cancelled by user");case"accept":return Promise.resolve();default:throw new Vq(`Invalid confirmation result ${E.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(Ig.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,Ig.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new dF}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(qd)}catch(s){return Ig.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${Xu(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:dns,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 Ig.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${Xu(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new LA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new LA({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(ZC).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){Ig.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${Xu(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=hXe(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=Exn(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=_xn(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=vxn(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}));Jae(()=>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||Jae(()=>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=GO(n.content),c=Math.round(performance.now()-o);Jae(()=>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 tWt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},rWt=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 fQt(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(fQt,"parseModelString");var $et=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 Xf({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 ZIe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new uK([c],e.conversation.source,e.conversation.userLanguage),f=new mw(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let b=fQt(this.config.model),T=b.modelName.toLowerCase(),w=b.provider.toLowerCase()||"copilot";if(w==="copilot"){let P=(await f.ctx.get(xs).getMetadata()).find(D=>D.name.toLowerCase()===T);if(P)h=await wo.getModelConfigurationById(e.ctx,P.id);else if(T===cKe.toLowerCase())m=!0,h=await wo.getModelConfigurationById(e.ctx,W_,d.id.toString(),oq(d.turns));else throw new Error(`Model "${b.modelName}" not found in available models`)}else{let P=(await new Ha(f.ctx.get(ri)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(P)h=await hO(f.ctx,P.provider,P.name);else throw new Error(`BYOK model "${b.modelName}" with provider "${b.provider}" not found`)}}else this.subagentConfig.resolveModelFamily&&e.turn.resolvedModelConfiguration?.providerName===void 0?h=await fns(e,b=>this.subagentConfig.resolveModelFamily(b)):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 oc(e.ctx),A=await tl(e.ctx,f,{languageId:""}),y=n||new tWt,E=new rWt(y,e.turn.id);await e.ctx.get(Tc).begin(d,c,E),await new _de(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(Au).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?Pn(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 fns(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 wo.resolveModelIdFromFamily(t.ctx,s);if(!c)continue;let l=await wo.getModelConfigurationById(t.ctx,c);if(o!==void 0&&l.originalBillingMultiplier!==void 0&&l.originalBillingMultiplier>o)continue;return l}catch{continue}return r}a(fns,"resolvePreferredSubagentModel");p();p();p();var Zq=de(xo());var Vet=class extends lr{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=Pn(r.request.message),c=yO(r.response?.message,!0),l=RO(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,Zq.useKeepWith)();return vscpp(vscppf,null,vscpp(Zq.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(Zq.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(Hq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Gq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(tde,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(Zq.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(nw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(Zq.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 nWt=10,pns=new Set(["file_search","grep_search","read_file"]),Wet=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[Rn.ClaudeHaiku45,Rn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:nWt,isLastTurn:o.oneBasedIterationNum>nWt};return ap.create(Vet,s,n)}filterTools(e){return e.filter(r=>pns.has(r.name))}getMaxRounds(){return nWt+1}};p();var xJ=de(xo());var zet=class extends lr{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=yO(r.response?.message,!0),l=RO(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,xJ.useKeepWith)(),d=Pn(r.request.message);return vscpp(vscppf,null,vscpp(xJ.SystemMessage,{priority:1e3},vscpp(ide,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(xJ.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(Hq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Gq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(xJ.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(nw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var iWt=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 ap.create(zet,s,n)}};function JRn(t){return t.isBuiltIn&&t.name==="Search"?new Wet:new iWt(t)}a(JRn,"resolveSubagentConfig");var vde=class extends vu{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. @@ -3460,9 +3460,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:S.Object({task:S.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:S.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:S.Optional(S.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 rde}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await tl(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",eg(r.ctx,"runSubagentTool.error",l),ZI(r.ctx,"runSubagentTool.error",l),new Lr([new Rr(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",eg(r.ctx,"runSubagentTool.error",l),ZI(r.ctx,"runSubagentTool.error",l),new Lr([new Rr(`Agent '${c}' is not available for model invocation`)],"error");u=KRn(d);let f=new jet(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(Tc).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});Et(r.ctx,"runSubagentTool.success",y),ZI(r.ctx,"runSubagentTool.success",y);let E=`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:S.Object({task:S.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:S.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:S.Optional(S.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 rde}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await tl(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",eg(r.ctx,"runSubagentTool.error",l),ex(r.ctx,"runSubagentTool.error",l),new Lr([new Rr(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",eg(r.ctx,"runSubagentTool.error",l),ex(r.ctx,"runSubagentTool.error",l),new Lr([new Rr(`Agent '${c}' is not available for model invocation`)],"error");u=JRn(d);let f=new $et(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(Tc).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});Et(r.ctx,"runSubagentTool.success",y),ex(r.ctx,"runSubagentTool.success",y);let E=`This is what has been accomplished by Custom Agent "${c}": -${A.response}`,_=new Lr([new Rr(E)],"success");return _.subagentConversationId=A.conversationId,_.subagentTurnId=A.turnId,_}catch(d){let f="";return d instanceof uF?(l.properties.message="Tool call round exceed",eg(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",n7e(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Lr([new Rr(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 wJ=new fe("applyPatchTool"),lns=`Use the \`apply_patch\` tool to edit files. +${A.response}`,_=new Lr([new Rr(E)],"success");return _.subagentConversationId=A.conversationId,_.subagentTurnId=A.turnId,_}catch(d){let f="";return d instanceof dF?(l.properties.message="Tool call round exceed",eg(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",o7e(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Lr([new Rr(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 wJ=new fe("applyPatchTool"),hns=`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 @@ -3531,7 +3531,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.`,Vet=class extends vu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:lns,displayDescription:"Apply a patch to edit a single file in the workspace.",inputSchema:S.Object({input:S.String({description:"The patch content following the apply_patch format specification."}),explanation:S.String({description:"A brief explanation of what the patch accomplishes."}),filePath:S.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 Lr([new Rr("Missing patch text")],"error");let c=Iwn(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 wJ.warn(e.ctx,h),new Lr([new Rr(h)],"error")}let l=AJ(o),u=dde(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 wJ.warn(e.ctx,h),new Lr([new Rr(h)],"error")}let f={};try{wJ.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 ude)return wJ.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Lr([new Rr(`Applying patch failed: ${h.message}`)],"error");if(h instanceof zO)return wJ.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Lr([new Rr(`Invalid patch format: ${h.message}`)],"error");if(h instanceof nm)return wJ.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Lr([new Rr(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return wJ.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Lr([new Rr(m)],"error")}}async buildCommit(e,r,n,o){return xwn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=id(c,n.uriSchemeCache),d=await n.ctx.get(ii).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new nm(`File not found: ${c}`);if(d.status==="invalid")throw new nm(`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.`,Yet=class extends vu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:hns,displayDescription:"Apply a patch to edit a single file in the workspace.",inputSchema:S.Object({input:S.String({description:"The patch content following the apply_patch format specification."}),explanation:S.String({description:"A brief explanation of what the patch accomplishes."}),filePath:S.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 Lr([new Rr("Missing patch text")],"error");let c=xwn(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 wJ.warn(e.ctx,h),new Lr([new Rr(h)],"error")}let l=AJ(o),u=dde(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 wJ.warn(e.ctx,h),new Lr([new Rr(h)],"error")}let f={};try{wJ.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 ude)return wJ.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Lr([new Rr(`Applying patch failed: ${h.message}`)],"error");if(h instanceof zO)return wJ.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Lr([new Rr(`Invalid patch format: ${h.message}`)],"error");if(h instanceof nm)return wJ.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Lr([new Rr(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return wJ.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Lr([new Rr(m)],"error")}}async buildCommit(e,r,n,o){return wwn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=id(c,n.uriSchemeCache),d=await n.ctx.get(ii).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new nm(`File not found: ${c}`);if(d.status==="invalid")throw new nm(`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(` @@ -3539,7 +3539,7 @@ ${c.map(f=>` - ${f}`).join(` ${l.map(f=>` - ${f}`).join(` `)}`);let d=u.length>0?u.join(` -`):"No changes were applied.";return new Lr([new Rr(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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(gs).getToolByNameAndProvider("create_file",rp);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(gs).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=AJ(n.input),s=dde(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=id(u,e.uriSchemeCache);return BA(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=AJ(n.input),s=dde(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=id(u,e.uriSchemeCache);return BA(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 JRn=require("path");var uns=16,Gwe=class extends vu{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 Lr([new Rr(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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(gs).getToolByNameAndProvider("create_file",rp);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(gs).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=AJ(n.input),s=dde(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=id(u,e.uriSchemeCache);return BA(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=AJ(n.input),s=dde(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=id(u,e.uriSchemeCache);return BA(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 ZRn=require("path");var mns=16,Gwe=class extends vu{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 @@ -3558,16 +3558,16 @@ 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:S.Object({query:S.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:S.Optional(S.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(t2),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:ebn,maxResults:r.input.maxResults??uns,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Lr([new Rr("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=un(f.chunk.file),m=DA(f.chunk.text);return new Rr(`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:S.Object({query:S.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:S.Optional(S.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:tbn,maxResults:r.input.maxResults??mns,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Lr([new Rr("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=un(f.chunk.file),m=DA(f.chunk.text);return new Rr(`Here is a potentially relevant text excerpt in \`${h}\` starting at line ${f.chunk.range.startLineNumber-1}: ${m} ${f.chunk.text} -${m}`)}),d=new JQ(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,JRn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(IP(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(bn).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 Wet=class extends vu{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:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.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 Lr([new Rr(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(gs).getToolByNameAndProvider("create_file",rp);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(gs).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=nO({uri:id(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=GO(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 VO({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Lr([new Rr(c.join(` -`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${BA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),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=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${BA(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();Mo();function RJ(){return Mt()}a(RJ,"uuidV4");p();var oh={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function ekn(t){let e=[],r=[],n=[],o,s;for(let c of dns(t))switch(c.marker){case void 0:r=c.content;break;case oh.FILEPATH:o=c.content.join(` -`).trim();break;case oh.FIND:s=ZRn(c.content);break;case oh.REPLACE:if(o&&s){let l=ZRn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case oh.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(ekn,"parsePatchResponse");function ZRn(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(ZRn,"extractCodeBlock");function*dns(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(oh.FILEPATH)?s=oh.FILEPATH:o.startsWith(oh.FIND)?s=oh.FIND:o.startsWith(oh.REPLACE)?s=oh.REPLACE:o.startsWith(oh.COMPLETE)?s=oh.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(dns,"iterateSections");function fns(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=pns(r,n);if(s===void 0)return;let{startIndex:c,endIndex:l,indentLevel:u,indentCharCount:d}=s,f="";if(d>0)for(let E=c;E<=l;E++){let _=r[E],v=$we(_);if(v===d&&v<_.length){f=_.substring(0,d);break}}let h=!1;for(let E=c;E<=l&&!h;E++){let _=r[E];if(/^\s*\/\*|^\s*\*/.test(_))continue;let v=$we(_);if(v>0&&v<_.length){h=_.substring(0,v).indexOf(" ")!==-1;break}}let m=mns(o,u,f,h),g=r.slice(0,c),A=r.slice(l+1);return[...g,...m,...A].join(` -`)}a(fns,"applyPatch");function pns(t,e,r=4){if(e.length===0)return;let n=0;for(;n=0&&o>=r&&t.charCodeAt(n)===e.charCodeAt(o);)n--,o--;if(o>=r)return!1;for(;n>=0&&tkn(t.charCodeAt(n));)n--;return n<0}a(XRn,"endsWith");function hns(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}=rkn(u,n),h=f;if(hs&&zet(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 E=m-l;n?y=r+" ".repeat(E):y=r+" ".repeat(o*E)}else n?y=" ".repeat(A):y=" ".repeat(o*A);d.push(y+h.substring(g))}}return d}a(mns,"adjustIndentation");function nkn(t,e){let r=t;for(let n of e){let o=fns(r,n);o!==void 0&&(r=o)}return r}a(nkn,"applyPatches");p();var gns="InstantApplyChat";function Ans(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(Ans,"isProxyModel");function yns(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(Ans):[]}a(yns,"parseProxyModels");var Zq=class{constructor(e){this.ctx=e;this.logger=new fe("ProxyModelService");this.models=[];bs(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===gns)}async fetchModels(e){try{let r=tx(this.ctx,e,"proxy","models"),n=await this.ctx.get(tr).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...Gy(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=yns(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 Yet=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var gE=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var kJ=de(Io());var Cde=class extends lr{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=DA(d),g=DA(o);return vscpp(vscppf,null,vscpp(kJ.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 ",FA," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(kJ.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(Hn,{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(Hn,{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(kJ.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(kJ.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var Jet=de(Io());var iWt=class extends lr{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 `",oh.FILEPATH,"`, `",oh.FIND,"` and `",oh.REPLACE,"`.",vscpp("br",null),"After ",oh.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",oh.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 ",oh.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 ",oh.COMPLETE,".",vscpp("br",null))}},Ket=class extends lr{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=DA(u),h=DA(o),m=rs(this.props.uri);return vscpp(vscppf,null,vscpp(Jet.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 `",FA,"` 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(iWt,null),vscpp("br",null),vscpp(WXe,null),vscpp(Hn,{name:"example"},vscpp(Hn,{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(Hn,{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(Jet.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${oh.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(Hn,{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(Hn,{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 yc=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Lc(`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 Lc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Lc(`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,$le)}static subtract(e,r){return r?e.startLineNumberr)throw new Lc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=CK(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=MUt(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=MUt(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 $l(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=Yze(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=CK(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 $l(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var e5=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 Ui(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Ui(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Ui(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return $l.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new Yo(e.lineNumber,e.column+this.columnCount):new Yo(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Ui.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};var Vwe=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 yc(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=CK(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new Yo(n,o)}getRange(e){return Ui.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return e5.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new e5(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var oWt=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new Yo(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getLineLength(e){return this.getValueOfRange(new Ui(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Vwe(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Ui(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return uKe(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var mF=class extends oWt{constructor(r){super();this.value=r;this._t=new Vwe(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 Wwe=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Lc(`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 E=d.slice(yc.emptyAt(h),new yc(0,m));s.push(E)}if(!f)throw new Lc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(yc.ofStartAndLength(f.replaceRange.endExclusive,0),new yc(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new yc(h,l.replaceRange.endExclusive-c),y=l.slice(A,new yc(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 yc(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(yc.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 txe(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 yc(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},ikn=class t extends Wwe{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 ett=class extends Wwe{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(UA.replace(yc.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new tv(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 tv(r)}normalizeEOL(e){return new tv(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=UA.replace(yc.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?tv.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new mF(this.apply(e.value))}mapData(e){return new sWt(this.replacements.map(r=>new bde(r.replaceRange,r.newText,e(r))))}},ttt=class extends Xet{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=cue(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,xxe(n,this.newText)),c=new yc(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new UA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new UA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=cue(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new yc(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=xxe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new yc(0,this.newText.length-o))}toEdit(){return new tv([this])}},tv=class t extends ett{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 UA(e,r)])}static insert(e,r){return new t([new UA(yc.emptyAt(e),r)])}static delete(e){return new t([new UA(e,"")])}static fromJson(e){return new t(e.map(UA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew UA(e.replaceRange,e.newText)))}},bde=class t extends ttt{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(yc.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 zwe=class t{constructor(e){this.replacements=e;kQt(()=>Pxe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>AE.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new AE(e,r)])}static insert(e,r){return new t([new AE(Ui.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 AE(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=e5.ofText(s.text);if(e.isBefore(l)){let d=new Yo(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return rtt(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 Yo(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof Yo?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof Yo?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return rtt(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 Yo(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=rtt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=rtt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new mF(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new AE(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=e5.ofText(s.text),l=Yo.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 Lc;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 mF(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Ui.fromPositions(new Yo(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=Ui.fromPositions(r.range.getEndPosition(),new Yo(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}`)}),d=new ZQ(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,ZRn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(xP(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(bn).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 Ket=class extends vu{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:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.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 Lr([new Rr(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(gs).getToolByNameAndProvider("create_file",rp);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(gs).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=iO({uri:id(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=GO(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 VO({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Lr([new Rr(c.join(` +`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${BA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),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=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${BA(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();Oo();function RJ(){return Mt()}a(RJ,"uuidV4");p();var oh={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function tkn(t){let e=[],r=[],n=[],o,s;for(let c of gns(t))switch(c.marker){case void 0:r=c.content;break;case oh.FILEPATH:o=c.content.join(` +`).trim();break;case oh.FIND:s=XRn(c.content);break;case oh.REPLACE:if(o&&s){let l=XRn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case oh.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(tkn,"parsePatchResponse");function XRn(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(XRn,"extractCodeBlock");function*gns(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(oh.FILEPATH)?s=oh.FILEPATH:o.startsWith(oh.FIND)?s=oh.FIND:o.startsWith(oh.REPLACE)?s=oh.REPLACE:o.startsWith(oh.COMPLETE)?s=oh.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(gns,"iterateSections");function Ans(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=yns(r,n);if(s===void 0)return;let{startIndex:c,endIndex:l,indentLevel:u,indentCharCount:d}=s,f="";if(d>0)for(let E=c;E<=l;E++){let _=r[E],v=$we(_);if(v===d&&v<_.length){f=_.substring(0,d);break}}let h=!1;for(let E=c;E<=l&&!h;E++){let _=r[E];if(/^\s*\/\*|^\s*\*/.test(_))continue;let v=$we(_);if(v>0&&v<_.length){h=_.substring(0,v).indexOf(" ")!==-1;break}}let m=_ns(o,u,f,h),g=r.slice(0,c),A=r.slice(l+1);return[...g,...m,...A].join(` +`)}a(Ans,"applyPatch");function yns(t,e,r=4){if(e.length===0)return;let n=0;for(;n=0&&o>=r&&t.charCodeAt(n)===e.charCodeAt(o);)n--,o--;if(o>=r)return!1;for(;n>=0&&rkn(t.charCodeAt(n));)n--;return n<0}a(ekn,"endsWith");function Ens(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}=nkn(u,n),h=f;if(hs&&Jet(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 E=m-l;n?y=r+" ".repeat(E):y=r+" ".repeat(o*E)}else n?y=" ".repeat(A):y=" ".repeat(o*A);d.push(y+h.substring(g))}}return d}a(_ns,"adjustIndentation");function ikn(t,e){let r=t;for(let n of e){let o=Ans(r,n);o!==void 0&&(r=o)}return r}a(ikn,"applyPatches");p();var vns="InstantApplyChat";function Cns(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(Cns,"isProxyModel");function bns(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(Cns):[]}a(bns,"parseProxyModels");var Xq=class{constructor(e){this.ctx=e;this.logger=new fe("ProxyModelService");this.models=[];bs(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===vns)}async fetchModels(e){try{let r=nx(this.ctx,e,"proxy","models"),n=await this.ctx.get(nr).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...Gy(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=bns(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 Zet=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var gE=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var kJ=de(xo());var Cde=class extends lr{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=DA(d),g=DA(o);return vscpp(vscppf,null,vscpp(kJ.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 ",FA," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(kJ.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(Hn,{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(Hn,{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(kJ.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(kJ.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var ett=de(xo());var oWt=class extends lr{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 `",oh.FILEPATH,"`, `",oh.FIND,"` and `",oh.REPLACE,"`.",vscpp("br",null),"After ",oh.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",oh.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 ",oh.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 ",oh.COMPLETE,".",vscpp("br",null))}},Xet=class extends lr{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=DA(u),h=DA(o),m=rs(this.props.uri);return vscpp(vscppf,null,vscpp(ett.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 `",FA,"` 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(oWt,null),vscpp("br",null),vscpp(KXe,null),vscpp(Hn,{name:"example"},vscpp(Hn,{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(Hn,{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(ett.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${oh.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(Hn,{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(Hn,{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 yc=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Lc(`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 Lc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Lc(`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,$le)}static subtract(e,r){return r?e.startLineNumberr)throw new Lc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=CK(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=OUt(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=OUt(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 $l(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=Jze(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=CK(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 $l(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var e5=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 Ui(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Ui(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Ui(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return $l.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new Ko(e.lineNumber,e.column+this.columnCount):new Ko(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Ui.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};var Vwe=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 yc(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=CK(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new Ko(n,o)}getRange(e){return Ui.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return e5.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new e5(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var sWt=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new Ko(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getLineLength(e){return this.getValueOfRange(new Ui(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Vwe(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Ui(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return pKe(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var gF=class extends sWt{constructor(r){super();this.value=r;this._t=new Vwe(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 Wwe=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Lc(`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 E=d.slice(yc.emptyAt(h),new yc(0,m));s.push(E)}if(!f)throw new Lc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(yc.ofStartAndLength(f.replaceRange.endExclusive,0),new yc(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new yc(h,l.replaceRange.endExclusive-c),y=l.slice(A,new yc(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 yc(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(yc.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 rxe(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 yc(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},okn=class t extends Wwe{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 ntt=class extends Wwe{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(UA.replace(yc.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new rv(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 rv(r)}normalizeEOL(e){return new rv(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=UA.replace(yc.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?rv.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new gF(this.apply(e.value))}mapData(e){return new aWt(this.replacements.map(r=>new bde(r.replaceRange,r.newText,e(r))))}},itt=class extends rtt{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=cue(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,xxe(n,this.newText)),c=new yc(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new UA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new UA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=cue(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new yc(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=xxe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new yc(0,this.newText.length-o))}toEdit(){return new rv([this])}},rv=class t extends ntt{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 UA(e,r)])}static insert(e,r){return new t([new UA(yc.emptyAt(e),r)])}static delete(e){return new t([new UA(e,"")])}static fromJson(e){return new t(e.map(UA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew UA(e.replaceRange,e.newText)))}},bde=class t extends itt{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(yc.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 zwe=class t{constructor(e){this.replacements=e;PQt(()=>Pxe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>AE.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new AE(e,r)])}static insert(e,r){return new t([new AE(Ui.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 AE(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=e5.ofText(s.text);if(e.isBefore(l)){let d=new Ko(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return ott(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 Ko(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof Ko?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof Ko?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return ott(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 Ko(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=ott(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=ott(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new gF(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new AE(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=e5.ofText(s.text),l=Ko.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 Lc;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 gF(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Ui.fromPositions(new Ko(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=Ui.fromPositions(r.range.getEndPosition(),new Ko(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(` `)}},AE=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 Lc;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=>Sde.deserialize(r)))}static fromEdit(e,r){let n=zwe.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,$le)),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 tv(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($l.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 $l(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 Sde(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 FUt(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 Sde(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},Sde=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t($l.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=uKe(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Ui.fromPositions(new Yo(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(Ui.fromPositions(e.range.getEndPosition(),new Yo(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 Yo(s,c)}else n=new Yo(1,1);let o=r.addToPosition(new Yo(1,1));return new AE(Ui.fromPositions(n,o),"")}else return new AE(new Ui(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=cue(r,n);r=r.substring(o),n=n.substring(o);let s=xxe(r,n);return r=r.substring(0,r.length-s),n=n.substring(0,n.length-s),r===""}};function ott(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return Ui.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Lc("start must be before end");return new Ui(t.lineNumber,t.column,e.lineNumber,e.column)}a(ott,"rangeFromPositions");var Ywe=class t{constructor(e){this.replacements=e;UK(Pxe(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=>Sde.deserialize(r)))}static fromEdit(e,r){let n=zwe.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,$le)),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 rv(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($l.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 $l(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 Sde(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 UUt(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 Sde(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},Sde=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t($l.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=pKe(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Ui.fromPositions(new Ko(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(Ui.fromPositions(e.range.getEndPosition(),new Ko(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 Ko(s,c)}else n=new Ko(1,1);let o=r.addToPosition(new Ko(1,1));return new AE(Ui.fromPositions(n,o),"")}else return new AE(new Ui(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 AE(Ui.fromPositions(new Yo(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Ui(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new AE(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new UA(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")})(Ens||={});var Tde=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new ntt(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new ntt(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return okn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return okn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=Ywe.fromEdit(e,new mF(this.originalText)),n=txe(r.replacements,s=>s.lineRange.length),o=txe(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}))}}},ntt=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function okn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(okn,"sum");p();var Ide=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=tv.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=_ns(s,this._combinedEditsSinceStart);this._debugLog.push(`[CALC] Processing ${s.length} edits:`);for(let d=0;d"${m}"->"${A}" | 4gram:${y.toFixed(2)} noRevert:(${E.toFixed(2)},${_.toFixed(2)})`),E!==1){let v=1-Math.max(_-E,0)/(1-E);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 aWt(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(aWt,"compute4GramTextSimilarity");function _ns(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(_ns,"applyEditsToRanges");p();p();var Kwe=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 Yo(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 itt(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new Kwe(t),c=new Kwe(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 yc(g,A);l.push(new UA(y,m))}return new tv(l)}a(itt,"stringEditFromDiff");p();p();var skn=de(require("path")),akn=require("worker_threads");var cWt=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 vns(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(vns,"createRpcProxy");var ott=class{constructor(e,r,n){this.responseHandler=new cWt;this.worker=new akn.Worker(e,r),CIe(this.worker,skn.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=vns((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 stt=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 Jwe=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 $l(s,u.original.startLineNumber),new $l(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new $l(s,r+1),new $l(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 t5(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Lc("not a valid diff");return new t5(new Ui(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ui(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new t5(new Ui(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new Ui(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(ckn(this.original.endLineNumberExclusive,e)&&ckn(this.modified.endLineNumberExclusive,r))return new t5(new Ui(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ui(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new t5(Ui.fromPositions(new Yo(this.original.startLineNumber,1),xde(new Yo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(new Yo(this.modified.startLineNumber,1),xde(new Yo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new t5(Ui.fromPositions(xde(new Yo(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),xde(new Yo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(xde(new Yo(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),xde(new Yo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Lc}};function xde(t,e){if(t.lineNumber<1)return new Yo(1,1);if(t.lineNumber>e.length)return new Yo(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new Yo(t.lineNumber,r.length+1):t}a(xde,"normalizePosition");function ckn(t,e){return t>=1&&t<=e.length}a(ckn,"isValidLineNumber");var att=class t extends Jwe{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=$l.join(e.map(o=>$l.fromRangeInclusive(o.originalRange))),n=$l.join(e.map(o=>$l.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()])}},t5=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 Lc("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 AE(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var ukn=require("fs");var Aw=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new Aq(()=>{let e=Cns([yKe(__dirname,"diffWorker.js"),yKe(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new ott(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:lkn(o.changes),moves:o.moves.map(c=>new stt(new Jwe(new $l(c[0],c[1]),new $l(c[2],c[3])),lkn(c[4])))}}};function lkn(t){return t.map(e=>new att(new $l(e[0],e[1]),new $l(e[2],e[3]),e[4]?.map(r=>new t5(new Ui(r[0],r[1],r[2],r[3]),new Ui(r[4],r[5],r[6],r[7])))))}a(lkn,"toLineRangeMappings");function Cns(t){for(let e of t)if((0,ukn.existsSync)(e))return e}a(Cns,"firstExistingPath");var ctt=new fe("editSurvivalReporter"),lWt=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 eq;this._editSurvivalTracker=new Ide(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=uf(this._document.uri),r=this.ctx.get(nw);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){ctt.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=uf(this._document.uri),n=await this.ctx.get(nw).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 ctt.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(ii).getOrReadTextDocument({uri:r.uri}),s=performance.now()-n;if(o.status!=="valid")throw new Lc(`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 itt(r,n,e.get(Aw)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var ltt=class extends lWt{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new fKe(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{ctt.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 Ide(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new Ide(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw ctt.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var dkn=new fe("editSurvivalTrackerService"),bns=[0,30*1e3,120*1e3,300*1e3,600*1e3],nT=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n,o){dkn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let s=o?.timeouts??bns,c;return{startReporter:a(l=>{(async()=>{try{let u=await itt(r,n,this.ctx.get(Aw));c=new ltt(this.ctx,e,r,n,u,l,s)}catch(u){dkn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${Xu(u)}`,u)}})()},"startReporter"),cancel:a(()=>{c?.cancel()},"cancel")}}};var Sns=1e3,fkn=256e3,pkn=64e3;function Tns(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(Tns,"makeProxyInstantApplyModelConfiguration");var Ins=8e3,hkn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:Rn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},xns={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:Rn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},utt=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new fe("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new gE("No uri found in code block");if(o.isCancellationRequested)throw new Yet;e.code.includes(FA)||this.logger.debug(this.ctx,`Code block for uri ${e.resource} does not contain existing code marker`);let u=await this.ctx.get(ii).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 gE(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(FA))return s&&await this.reportCodeBlock(e,s),{code:e.code};s&&await s({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:Ji(e.resource),editDescription:e.markdownBeforeBlock});let f=await this.ctx.get(Qt).getToken(),h=await this.ctx.get(Zt).updateExPValuesAndAssignments(f),m=this.ctx.get(Zt).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: ${Xu(g)}`),Vn(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(Zq).instantApplyModels[0]?.name??"unknown":"default"}),Ft(this.ctx,Ye.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=ws("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 gE("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(nT),E=RJ(),_=[],v=0,b=0,T=f.length+e.code.length+Sns;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 ${E} in iteration ${b} with params: ${JSON.stringify(w,null,2)}`);let x=await this.ctx.get(oc).fetchResponse(w,s,c);if(this.logger.debug(this.ctx,`Received map code response ${E} in iteration ${b} with result: ${JSON.stringify(x,null,2)}`),v=this.calculateResponseLength(x,_,v),x.type==="length"){if(v>T)throw new gE(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await ap.create(Cde,{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 P=_.join("");if(P){l&&await l({fileGenerationStatus:"updated-code-generated",uri:e.resource,basename:Ji(e.resource),partialText:P,languageId:r.document.detectedLanguageId,markdownCodeFence:DA(P)});let D=y.initialize(r.document,f,P);return{code:P,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 gE(D)}}else{if(x.type==="canceled")throw new Oc;{let P=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,P,x),new gE(P)}}b+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",Cde,e,r,n,o,s,c,l,u,d=>wns(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",Ket,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=ekn(d);if(h.patches.length===0)throw new gE(`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=nkn(f,h.patches);if(m===void 0)throw new gE(`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 gE(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await xo.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}:{}},_=(await ap.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(nT),b=await this.ctx.get(Qt).getToken(),T=await this.ctx.get(Zt).updateExPValuesAndAssignments(b),w=RJ(),R={copilotApiProvider:"api",modelConfiguration:g,messages:_,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 P=await this.ctx.get(oc).fetchResponse(R,l,T);if(this.logger.debug(this.ctx,`Received ${e} response ${w} with result: ${JSON.stringify(P,null,2)}`),P.type==="success"){let D=P.value;if(!D)throw new gE(`No valid completion found for uri ${n.resource}`);let N=h(D,m);u&&await u({fileGenerationStatus:"updated-code-generated",uri:n.resource,basename:Ji(n.resource),partialText:N,languageId:o.document.detectedLanguageId,markdownCodeFence:DA(N)});let L=v.initialize(o.document,m,N);return{code:N,editSurvivalTrackingSession:L,telemetry:{requestSource:c.chatRequestSource,chatRequestModel:c.chatRequestModel,mapper:`${g.modelId}-${e}`,headerRequestId:P.requestId}}}else{if(P.type==="canceled")throw new Oc;{let D=`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} failed for uri ${n.resource} with result type ${P.type}`;throw this.logger.error(this.ctx,D,P),new gE(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>fkn)throw new gE(`Document too large: ${l} characters (limit: ${fkn})`);let u=this.ctx.get(Zq).instantApplyModels[0],d=u?Tns(u.name):void 0,h=await ap.create(Cde,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??hkn).renderPrompt(void 0,n),m=h.tokenCount;if(m>pkn)throw new gE(`Prompt too large: ${m} tokens (limit: ${pkn})`);let g=h.messages.map(_=>typeof _.content=="string"?_.content:JSON.stringify(_.content)).join(` -`),A=this.ctx.get(Zt).instantApplyModelMigration(o),y;return A&&d?y=d:y=g.length{let o=Pn(n.content);return n.role==="system"?`${r} +`).join("")),new AE(Ui.fromPositions(new Ko(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Ui(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` +`);return new AE(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new UA(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")})(Sns||={});var Tde=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new stt(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new stt(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return skn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return skn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=Ywe.fromEdit(e,new gF(this.originalText)),n=rxe(r.replacements,s=>s.lineRange.length),o=rxe(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}))}}},stt=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function skn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(skn,"sum");p();var Ide=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=rv.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=Tns(s,this._combinedEditsSinceStart);this._debugLog.push(`[CALC] Processing ${s.length} edits:`);for(let d=0;d"${m}"->"${A}" | 4gram:${y.toFixed(2)} noRevert:(${E.toFixed(2)},${_.toFixed(2)})`),E!==1){let v=1-Math.max(_-E,0)/(1-E);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 cWt(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(cWt,"compute4GramTextSimilarity");function Tns(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(Tns,"applyEditsToRanges");p();p();var Kwe=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 Ko(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 att(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new Kwe(t),c=new Kwe(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 yc(g,A);l.push(new UA(y,m))}return new rv(l)}a(att,"stringEditFromDiff");p();p();var akn=de(require("path")),ckn=require("worker_threads");var lWt=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 Ins(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(Ins,"createRpcProxy");var ctt=class{constructor(e,r,n){this.responseHandler=new lWt;this.worker=new ckn.Worker(e,r),bIe(this.worker,akn.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=Ins((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 ltt=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 Jwe=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 $l(s,u.original.startLineNumber),new $l(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new $l(s,r+1),new $l(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 t5(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Lc("not a valid diff");return new t5(new Ui(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ui(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new t5(new Ui(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new Ui(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(lkn(this.original.endLineNumberExclusive,e)&&lkn(this.modified.endLineNumberExclusive,r))return new t5(new Ui(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ui(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new t5(Ui.fromPositions(new Ko(this.original.startLineNumber,1),xde(new Ko(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(new Ko(this.modified.startLineNumber,1),xde(new Ko(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new t5(Ui.fromPositions(xde(new Ko(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),xde(new Ko(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(xde(new Ko(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),xde(new Ko(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Lc}};function xde(t,e){if(t.lineNumber<1)return new Ko(1,1);if(t.lineNumber>e.length)return new Ko(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new Ko(t.lineNumber,r.length+1):t}a(xde,"normalizePosition");function lkn(t,e){return t>=1&&t<=e.length}a(lkn,"isValidLineNumber");var utt=class t extends Jwe{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=$l.join(e.map(o=>$l.fromRangeInclusive(o.originalRange))),n=$l.join(e.map(o=>$l.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()])}},t5=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 Lc("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 AE(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var dkn=require("fs");var yw=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new yq(()=>{let e=xns([vKe(__dirname,"diffWorker.js"),vKe(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new ctt(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:ukn(o.changes),moves:o.moves.map(c=>new ltt(new Jwe(new $l(c[0],c[1]),new $l(c[2],c[3])),ukn(c[4])))}}};function ukn(t){return t.map(e=>new utt(new $l(e[0],e[1]),new $l(e[2],e[3]),e[4]?.map(r=>new t5(new Ui(r[0],r[1],r[2],r[3]),new Ui(r[4],r[5],r[6],r[7])))))}a(ukn,"toLineRangeMappings");function xns(t){for(let e of t)if((0,dkn.existsSync)(e))return e}a(xns,"firstExistingPath");var dtt=new fe("editSurvivalReporter"),uWt=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 tq;this._editSurvivalTracker=new Ide(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=uf(this._document.uri),r=this.ctx.get(iw);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){dtt.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=uf(this._document.uri),n=await this.ctx.get(iw).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 dtt.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(ii).getOrReadTextDocument({uri:r.uri}),s=performance.now()-n;if(o.status!=="valid")throw new Lc(`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 att(r,n,e.get(yw)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var ftt=class extends uWt{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new mKe(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{dtt.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 Ide(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new Ide(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw dtt.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var fkn=new fe("editSurvivalTrackerService"),wns=[0,30*1e3,120*1e3,300*1e3,600*1e3],oT=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n,o){fkn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let s=o?.timeouts??wns,c;return{startReporter:a(l=>{(async()=>{try{let u=await att(r,n,this.ctx.get(yw));c=new ftt(this.ctx,e,r,n,u,l,s)}catch(u){fkn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${Xu(u)}`,u)}})()},"startReporter"),cancel:a(()=>{c?.cancel()},"cancel")}}};var Rns=1e3,pkn=256e3,hkn=64e3;function kns(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(kns,"makeProxyInstantApplyModelConfiguration");var Pns=8e3,mkn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:Rn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},Dns={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:Rn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},ptt=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new fe("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new gE("No uri found in code block");if(o.isCancellationRequested)throw new Zet;e.code.includes(FA)||this.logger.debug(this.ctx,`Code block for uri ${e.resource} does not contain existing code marker`);let u=await this.ctx.get(ii).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 gE(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(FA))return s&&await this.reportCodeBlock(e,s),{code:e.code};s&&await s({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:Ji(e.resource),editDescription:e.markdownBeforeBlock});let f=await this.ctx.get(Qt).getToken(),h=await this.ctx.get(Zt).updateExPValuesAndAssignments(f),m=this.ctx.get(Zt).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: ${Xu(g)}`),Vn(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(Xq).instantApplyModels[0]?.name??"unknown":"default"}),Ft(this.ctx,Ye.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=ws("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 gE("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(oT),E=RJ(),_=[],v=0,b=0,T=f.length+e.code.length+Rns;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 ${E} in iteration ${b} with params: ${JSON.stringify(w,null,2)}`);let x=await this.ctx.get(oc).fetchResponse(w,s,c);if(this.logger.debug(this.ctx,`Received map code response ${E} in iteration ${b} with result: ${JSON.stringify(x,null,2)}`),v=this.calculateResponseLength(x,_,v),x.type==="length"){if(v>T)throw new gE(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await ap.create(Cde,{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 P=_.join("");if(P){l&&await l({fileGenerationStatus:"updated-code-generated",uri:e.resource,basename:Ji(e.resource),partialText:P,languageId:r.document.detectedLanguageId,markdownCodeFence:DA(P)});let D=y.initialize(r.document,f,P);return{code:P,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 gE(D)}}else{if(x.type==="canceled")throw new Oc;{let P=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,P,x),new gE(P)}}b+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",Cde,e,r,n,o,s,c,l,u,d=>Nns(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",Xet,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=tkn(d);if(h.patches.length===0)throw new gE(`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=ikn(f,h.patches);if(m===void 0)throw new gE(`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 gE(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await wo.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}:{}},_=(await ap.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(oT),b=await this.ctx.get(Qt).getToken(),T=await this.ctx.get(Zt).updateExPValuesAndAssignments(b),w=RJ(),R={copilotApiProvider:"api",modelConfiguration:g,messages:_,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 P=await this.ctx.get(oc).fetchResponse(R,l,T);if(this.logger.debug(this.ctx,`Received ${e} response ${w} with result: ${JSON.stringify(P,null,2)}`),P.type==="success"){let D=P.value;if(!D)throw new gE(`No valid completion found for uri ${n.resource}`);let N=h(D,m);u&&await u({fileGenerationStatus:"updated-code-generated",uri:n.resource,basename:Ji(n.resource),partialText:N,languageId:o.document.detectedLanguageId,markdownCodeFence:DA(N)});let L=v.initialize(o.document,m,N);return{code:N,editSurvivalTrackingSession:L,telemetry:{requestSource:c.chatRequestSource,chatRequestModel:c.chatRequestModel,mapper:`${g.modelId}-${e}`,headerRequestId:P.requestId}}}else{if(P.type==="canceled")throw new Oc;{let D=`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} failed for uri ${n.resource} with result type ${P.type}`;throw this.logger.error(this.ctx,D,P),new gE(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>pkn)throw new gE(`Document too large: ${l} characters (limit: ${pkn})`);let u=this.ctx.get(Xq).instantApplyModels[0],d=u?kns(u.name):void 0,h=await ap.create(Cde,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??mkn).renderPrompt(void 0,n),m=h.tokenCount;if(m>hkn)throw new gE(`Prompt too large: ${m} tokens (limit: ${hkn})`);let g=h.messages.map(_=>typeof _.content=="string"?_.content:JSON.stringify(_.content)).join(` +`),A=this.ctx.get(Zt).instantApplyModelMigration(o),y;return A&&d?y=d:y=g.length{let o=Pn(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:Ji(e.resource),editDescription:e.markdownBeforeBlock}),await r({fileGenerationStatus:"updated-code-generated",partialText:e.code,uri:e.resource,basename:Ji(e.resource)})}};function wns(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(wns,"extractCodeBlock");var dtt=class extends vu{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:Ji(e.resource),editDescription:e.markdownBeforeBlock}),await r({fileGenerationStatus:"updated-code-generated",partialText:e.code,uri:e.resource,basename:Ji(e.resource)})}};function Nns(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(Nns,"extractCodeBlock");var htt=class extends vu{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... @@ -3622,9 +3622,9 @@ class Person { getAge() { return this.age; } -}`}),explanation:S.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 Lr([new Rr(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=id(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new utt(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(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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=nO({uri:id(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await tl(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=GO(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 VO({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Lr([new Rr(u.join(` -`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){Pyn(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=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${BA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),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=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${BA(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 mkn=require("crypto"),n5=de(require("fs/promises")),gkn=require("os"),r5=de(require("path"));var gF=class{constructor(e){this.ctx=e;this.logger=new fe("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=r5.extname(__filename)===".ts"?r5.resolve(__dirname,"../../../packages/ripgrep/bin"):r5.resolve(__dirname,"./bin"),c=r5.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 n5.readFile(c),u=(0,mkn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||r5.join((0,gkn.homedir)(),".cache"),f=r5.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await n5.mkdir(f,{recursive:!0});let h=Ji(Ks(c)),m=r5.join(f,h);try{await n5.stat(m)}catch{await n5.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await n5.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 Akn=require("child_process"),uWt=require("perf_hooks");var AF=new fe("ripgrepProcessManager"),yF=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,AF.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){AF.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){AF.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){AF.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){AF.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}AF.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:RJ(),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(` -`);AF.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=uWt.performance.now();AF.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,Akn.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=uWt.performance.now()-r;AF.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 ftt(t){return t.some(e=>!la.isRegisteredScheme(to(e.uri).scheme))}a(ftt,"hasRipgrepWorkspaceFolder");async function ptt(t,e){try{return{rgPath:await t.ctx.get(gF).resolvePath(),ripgrepManager:t.ctx.get(yF)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(ptt,"resolveRipgrepResources");var ykn=new fe("findFilesTool"),htt=class t extends vu{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:S.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 Lr([new Rr(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=id(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new ptt(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(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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=iO({uri:id(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await tl(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=GO(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 VO({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Lr([new Rr(u.join(` +`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){Dyn(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=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${BA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),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=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${BA(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 gkn=require("crypto"),n5=de(require("fs/promises")),Akn=require("os"),r5=de(require("path"));var AF=class{constructor(e){this.ctx=e;this.logger=new fe("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=r5.extname(__filename)===".ts"?r5.resolve(__dirname,"../../../packages/ripgrep/bin"):r5.resolve(__dirname,"./bin"),c=r5.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 n5.readFile(c),u=(0,gkn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||r5.join((0,Akn.homedir)(),".cache"),f=r5.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await n5.mkdir(f,{recursive:!0});let h=Ji(Ks(c)),m=r5.join(f,h);try{await n5.stat(m)}catch{await n5.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await n5.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 ykn=require("child_process"),dWt=require("perf_hooks");var yF=new fe("ripgrepProcessManager"),EF=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,yF.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){yF.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){yF.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){yF.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){yF.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}yF.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:RJ(),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(` +`);yF.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=dWt.performance.now();yF.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,ykn.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=dWt.performance.now()-r;yF.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 mtt(t){return t.some(e=>!la.isRegisteredScheme(to(e.uri).scheme))}a(mtt,"hasRipgrepWorkspaceFolder");async function gtt(t,e){try{return{rgPath:await t.ctx.get(AF).resolvePath(),ripgrepManager:t.ctx.get(EF)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(gtt,"resolveRipgrepResources");var Ekn=new fe("findFilesTool"),Att=class t extends vu{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 @@ -3640,12 +3640,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:S.Object({query:S.String({description:"Search for files with names or paths matching this glob pattern."}),maxResults:S.Optional(S.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 Lr([new Rr("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(ftt(c)){if(n.isCancellationRequested)return new Lr([new Rr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await ptt(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{ykn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),la.isRegisteredScheme(to(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),ykn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` +- **/foo/**/*.js to match all js files under any foo folder`,displayDescription:"Search for files in the workspace by glob pattern.",inputSchema:S.Object({query:S.String({description:"Search for files with names or paths matching this glob pattern."}),maxResults:S.Optional(S.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 Lr([new Rr("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(mtt(c)){if(n.isCancellationRequested)return new Lr([new Rr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await gtt(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{Ekn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),la.isRegisteredScheme(to(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),Ekn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` `)}`)}catch(E){if(E instanceof bl){d[y]=[];return}let _=E instanceof Error?E.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${y}: ${_}`)}});try{await Promise.all(f)}catch(A){let y=A instanceof Error?A.message:"An unknown error occurred";return new Lr([new Rr(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 Lr([new Rr(g)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Lr([new Rr(s)],"error")}}async searchViaContentProvider(e,r,n,o){return(await e.ctx.get(la).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(wa(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 Ekn=new fe("findTextInFilesTool"),mtt=class t extends vu{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. +`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${un(xa(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 _kn=new fe("findTextInFilesTool"),ytt=class t extends vu{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) @@ -3658,13 +3658,13 @@ 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:S.Object({query:S.String({description:"The pattern to search for in files in the workspace. Can be a regex or plain text pattern"}),isRegexp:S.Optional(S.Boolean({description:"Whether the pattern is a regex. False by default."})),includePattern:S.Optional(S.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 Lr([new Rr("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(ftt(u)){if(n.isCancellationRequested)return new Lr([new Rr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await ptt(e,"grep_search"))}let h={},m=u.map(async E=>{if(n.isCancellationRequested)throw new Error("Canceled");let _=E.uri.toString();try{Ekn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${_}`),la.isRegisteredScheme(to(E.uri).scheme)?h[_]=await this.searchViaContentProvider(e,E,o,s,c,l):h[_]=await this.searchViaRipgrep(f,d,E,o,s,c,n),Ekn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${_} with results: ${h[_].join(` +- Use includePattern to filter by file type (e.g., "*.js", "*.{ts,tsx}")`,displayDescription:"Do a text search in the workspace.",inputSchema:S.Object({query:S.String({description:"The pattern to search for in files in the workspace. Can be a regex or plain text pattern"}),isRegexp:S.Optional(S.Boolean({description:"Whether the pattern is a regex. False by default."})),includePattern:S.Optional(S.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 Lr([new Rr("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(mtt(u)){if(n.isCancellationRequested)return new Lr([new Rr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await gtt(e,"grep_search"))}let h={},m=u.map(async E=>{if(n.isCancellationRequested)throw new Error("Canceled");let _=E.uri.toString();try{_kn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${_}`),la.isRegisteredScheme(to(E.uri).scheme)?h[_]=await this.searchViaContentProvider(e,E,o,s,c,l):h[_]=await this.searchViaRipgrep(f,d,E,o,s,c,n),_kn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${_} with results: ${h[_].join(` `)}`)}catch(v){if(v instanceof bl){h[_]=[];return}let b=v instanceof Error?v.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${_}: ${b}`)}});try{await Promise.all(m)}catch(E){let _=E instanceof Error?E.message:"An unknown error occurred";return new Lr([new Rr(_)],"error")}let g=[],A=l;for(;A>0;){let E=!1;for(let _ in h)h[_].length>0&&A>0&&(g.push(h[_].shift()),A--,E=!0);if(!E)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 Lr([new Rr(y)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Lr([new Rr(s)],"error")}}async searchViaContentProvider(e,r,n,o,s,c){return(await e.ctx.get(la).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 Att=de(require("path"));var gtt=class extends vu{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:S.Object({path:S.String({description:"The absolute path to the directory to list."})})})}async invoke(e,r,n){let{path:o}=r.input,s=e.turn.workspaceFolders,c=e.turn.workspaceFolder,l=id(o,e.uriSchemeCache);if(!this.isPathWithinWorkspace(l,s,c))return new Lr([new Rr("Error: Path is outside of workspace folders")],"error");let u=await OXe(e.ctx,l.toString());return u.length===0?new Lr([new Rr("Folder is empty")],"success"):new Lr([new Rr(u.map(([d,f])=>`${d}${f&2?"/":""}`).join(` -`))],"success")}prepareInvocation(e,r){let n=id(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${BA(n)}`}}prepareCompletion(e,r){let n=id(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${BA(n)}`}}isPathWithinWorkspace(e,r,n){return!r&&!n?!0:r&&r.length>0?r.some(o=>this.isUriWithinDirectory(e,o.uri)):n?this.isUriWithinDirectory(e,n.uri):!1}isUriWithinDirectory(e,r){let n=rs(e),o=rs(r);if(!n||!o)return!1;let s=Att.relative(o,n);return s===""?!0:!s.startsWith("..")&&!Att.isAbsolute(s)}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var ytt=2e3,Ett=class t extends vu{static{a(this,"ReadFileTool")}constructor(){super({name:"read_file",displayName:"Read File",description:`Read the contents of a file from the local filesystem. +`).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 _tt=de(require("path"));var Ett=class extends vu{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:S.Object({path:S.String({description:"The absolute path to the directory to list."})})})}async invoke(e,r,n){let{path:o}=r.input,s=e.turn.workspaceFolders,c=e.turn.workspaceFolder,l=id(o,e.uriSchemeCache);if(!this.isPathWithinWorkspace(l,s,c))return new Lr([new Rr("Error: Path is outside of workspace folders")],"error");let u=await FXe(e.ctx,l.toString());return u.length===0?new Lr([new Rr("Folder is empty")],"success"):new Lr([new Rr(u.map(([d,f])=>`${d}${f&2?"/":""}`).join(` +`))],"success")}prepareInvocation(e,r){let n=id(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${BA(n)}`}}prepareCompletion(e,r){let n=id(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${BA(n)}`}}isPathWithinWorkspace(e,r,n){return!r&&!n?!0:r&&r.length>0?r.some(o=>this.isUriWithinDirectory(e,o.uri)):n?this.isUriWithinDirectory(e,n.uri):!1}isUriWithinDirectory(e,r){let n=rs(e),o=rs(r);if(!n||!o)return!1;let s=_tt.relative(o,n);return s===""?!0:!s.startsWith("..")&&!_tt.isAbsolute(s)}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var vtt=2e3,Ctt=class t extends vu{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: - Reading known files you've already located @@ -3675,33 +3675,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:S.Object({filePath:S.String({description:"The absolute path of the file to read."}),offset:S.Optional(S.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:S.Optional(S.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??ytt),ytt),u=Math.max(1,s??1),d=u+l-1,f=id(o,e.uriSchemeCache);if(!f)throw new Error(`Invalid file path: ${o}`);let m=await e.ctx.get(ii).getOrReadTextDocument({uri:f});if(m.status==="valid"){let g=m.document.getText();if(g.length===0)return new Lr([new Rr(`The file \`${o}\` exists, but is empty.`)],"success");if(g.trim().length===0)return new Lr([new Rr(`The file \`${o}\` exists, but contains only whitespace.`)],"success");let A=m.document.lineCount,y=Math.min(d,A),E=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 Zwe=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},_tt=class extends Zwe{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},vtt=class extends Zwe{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},Ctt=class extends Zwe{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function Rns(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Rns,"escapeRegex");function kns(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(kns,"calculateSimilarity");function dWt(t,e,r,n){let o=r.replace(/\r\n/g,` -`).replace(/\n/g,n),s=Pns(t,e,o);if(s.type!=="none")return s;let c=Dns(t,e,o,n);if(c.type!=="none")return c;let l=Nns(t,e,o,n);if(l.type!=="none")return l;let u=Mns(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(dWt,"findAndReplaceOne");function Pns(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(Pns,"tryExactMatch");function Dns(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(Dns,"tryWhitespaceFlexibleMatch");function Nns(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 Lr([new Rr(T)],"success")}else return new Lr([new Rr(`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 Lr([new Rr(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=id(n,e.uriSchemeCache);return{progressMessage:this.formatFileMessage(c,o,s,"Reading")}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),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=id(n,e.uriSchemeCache);return{completionMessage:this.formatFileMessage(c,o,s,"Read file")}}formatFileMessage(e,r,n,o){let s=BA(e),c=Math.max(1,r??1),l=Math.min(Math.max(1,n??vtt),vtt),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 Zwe=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},btt=class extends Zwe{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},Stt=class extends Zwe{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},Ttt=class extends Zwe{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function Mns(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Mns,"escapeRegex");function Ons(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(Ons,"calculateSimilarity");function fWt(t,e,r,n){let o=r.replace(/\r\n/g,` +`).replace(/\n/g,n),s=Lns(t,e,o);if(s.type!=="none")return s;let c=Bns(t,e,o,n);if(c.type!=="none")return c;let l=Fns(t,e,o,n);if(l.type!=="none")return l;let u=Uns(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(fWt,"findAndReplaceOne");function Lns(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(Lns,"tryExactMatch");function Bns(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(Bns,"tryWhitespaceFlexibleMatch");function Fns(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 E=o.indexOf(s),_=0,v=0;for(let x=0;x0;x++)t[x]==="\r"&&t[x+1]===` -`?(x++,T--,b=x+1):(T--,b=x+1);let w=t.substring(0,_),R=t.substring(b);return{text:w+r+R,editPosition:[[_,b]],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=Rns(E);return _1)return{text:t,type:"multiple",editPosition:[],suggestion:"Multiple fuzzy matches found. Try including more context in your search string.",strategy:"fuzzy",matchPositions:h.map(E=>E.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(Nns,"tryFuzzyMatch");function Mns(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(Mns,"trySimilarityMatch");var _kn=new fe("replaceStringTool"),btt=class extends vu{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:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.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:S.String({description:"The exact literal text to replace oldString with."}),explanation:S.Optional(S.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{_kn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=id(o,e.uriSchemeCache);if(s===c)throw new Ctt("Input and output are identical",o);let u=await this.readFileContent(e,l,n),d=u.includes(`\r +`?(x++,T--,b=x+1):(T--,b=x+1);let w=t.substring(0,_),R=t.substring(b);return{text:w+r+R,editPosition:[[_,b]],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=Mns(E);return _1)return{text:t,type:"multiple",editPosition:[],suggestion:"Multiple fuzzy matches found. Try including more context in your search string.",strategy:"fuzzy",matchPositions:h.map(E=>E.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(Fns,"tryFuzzyMatch");function Uns(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(Uns,"trySimilarityMatch");var vkn=new fe("replaceStringTool"),Itt=class extends vu{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:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.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:S.String({description:"The exact literal text to replace oldString with."}),explanation:S.Optional(S.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{vkn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=id(o,e.uriSchemeCache);if(s===c)throw new Ttt("Input and output are identical",o);let u=await this.readFileContent(e,l,n),d=u.includes(`\r `)?`\r `:` -`,f=dWt(u,s,c,d);if(f.type==="none"&&s.endsWith(` +`,f=fWt(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)&&(_kn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=dWt(u,g,c,d))}if(f.type==="none")throw new _tt(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new vtt(`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 Lr([new Rr(u)],"error")}}async readFileContent(e,r,n){let s=await e.ctx.get(ii).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(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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 Lr([new Rr(n)],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running replace_string_in_file tool"};let o=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${BA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),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=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${BA(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 Ttt=de(AP());var up=new fe("validateCvesTool"),Stt=class t extends vu{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:S.Object({dependencies:S.Array(S.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:S.Enum(lqt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return up.debug(e.ctx,"CVE validation cancelled at start"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return up.debug(e.ctx,"No dependencies provided to validate"),new Lr([new Rr("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(up.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return up.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(up.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");up.debug(e.ctx,`CVE summary: ${u}`)}return new Lr([new Rr(l)],"success")}catch(c){if(xP(c))return up.debug(e.ctx,"CVE validation cancelled"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return up.exception(e.ctx,c,".invoke"),new Lr([new Rr(`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){up.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 up.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw up.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){up.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),up.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=Ttt.coerce(m);if(!g){f.push(h.id),up.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}up.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||Ttt.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return up.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}): ${zVt(f.summary)} +`,g=s.substring(0,s.length-m.length);u.endsWith(g)&&(vkn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=fWt(u,g,c,d))}if(f.type==="none")throw new btt(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new Stt(`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 Lr([new Rr(u)],"error")}}async readFileContent(e,r,n){let s=await e.ctx.get(ii).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(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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 Lr([new Rr(n)],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running replace_string_in_file tool"};let o=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${BA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),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=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${BA(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 wtt=de(yP());var up=new fe("validateCvesTool"),xtt=class t extends vu{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:S.Object({dependencies:S.Array(S.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:S.Enum(uqt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return up.debug(e.ctx,"CVE validation cancelled at start"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return up.debug(e.ctx,"No dependencies provided to validate"),new Lr([new Rr("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(up.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return up.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(up.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");up.debug(e.ctx,`CVE summary: ${u}`)}return new Lr([new Rr(l)],"success")}catch(c){if(wP(c))return up.debug(e.ctx,"CVE validation cancelled"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return up.exception(e.ctx,c,".invoke"),new Lr([new Rr(`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){up.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 up.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw up.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){up.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),up.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=wtt.coerce(m);if(!g){f.push(h.id),up.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}up.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||wtt.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return up.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}): ${YVt(f.summary)} `;return h+=` - **Severity**: **${f.severity.toUpperCase()}** -`,h+=` - **Details**: ${zVt(f.description)}`,h}).join(` +`,h+=` - **Details**: ${YVt(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 Ons(t){return[new gtt,new Ett,new dtt,new btt,new Vet,new Wet,new htt,new mtt,new Stt]}a(Ons,"getAllClsTools");function vkn(t,e){Ons(t).forEach(e.registerTool.bind(e)),t.get(bn).onDidSetCapabilities(r=>{t.get(jl).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new vde):r.subAgent?e.registerTool(new vde):e.unregisterTool(new vde),r.manageTodoListTool?e.registerTool(new WO(t)):e.unregisterTool(new WO(t)),r.watchedFiles?e.registerTool(new Gwe):e.unregisterTool(new Gwe)})}a(vkn,"registerAllClsTools");var gs=class{constructor(e){this.ctx=e;this._toolRegistry=new $ze;vkn(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 Oc;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 Lr([],"success")}async invokeToolConfirmation(e,r,n,o){if(o.isCancellationRequested)throw new Oc;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=>iwn.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>own.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(dg.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(dg.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(dg.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(dg.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get(rp.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get(rp.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(dg.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(dg.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get(rp.id)?.find(m=>m.name==="create_file");if(c){let m=e.get(rp.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(dg.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(dg.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(rp.id)??[],f=e.get(dg.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==dg.id&&m!==rp.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(Ld);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(!ZIe(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===dg.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===rp.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===dg.id||o.toolProvider.id===rp.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===dg.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===rp.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(ZIe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===rp.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===dg.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===dg.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 Xq=class extends YQ{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:rp,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(F_).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 Oc;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(qd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var k={};ki(k,{$brand:()=>fWt,$input:()=>cKt,$output:()=>aKt,NEVER:()=>eRe,TimePrecision:()=>dKt,ZodAny:()=>Xkn,ZodArray:()=>nPn,ZodBase64:()=>vJt,ZodBase64URL:()=>CJt,ZodBigInt:()=>QRe,ZodBigIntFormat:()=>TJt,ZodBoolean:()=>URe,ZodCIDRv4:()=>EJt,ZodCIDRv6:()=>_Jt,ZodCUID:()=>fJt,ZodCUID2:()=>pJt,ZodCatch:()=>yPn,ZodCustom:()=>_rt,ZodCustomStringFormat:()=>Ykn,ZodDate:()=>Art,ZodDefault:()=>fPn,ZodDiscriminatedUnion:()=>iPn,ZodE164:()=>bJt,ZodEmail:()=>aJt,ZodEmoji:()=>uJt,ZodEnum:()=>LRe,ZodError:()=>_os,ZodFile:()=>uPn,ZodGUID:()=>frt,ZodIPv4:()=>AJt,ZodIPv6:()=>yJt,ZodISODate:()=>lrt,ZodISODateTime:()=>crt,ZodISODuration:()=>drt,ZodISOTime:()=>urt,ZodIntersection:()=>oPn,ZodIssueCode:()=>OJt,ZodJWT:()=>SJt,ZodKSUID:()=>gJt,ZodLazy:()=>SPn,ZodLiteral:()=>lPn,ZodMap:()=>aPn,ZodNaN:()=>_Pn,ZodNanoID:()=>dJt,ZodNever:()=>tPn,ZodNonOptional:()=>DJt,ZodNull:()=>Zkn,ZodNullable:()=>dPn,ZodNumber:()=>FRe,ZodNumberFormat:()=>qde,ZodObject:()=>yrt,ZodOptional:()=>PJt,ZodPipe:()=>NJt,ZodPrefault:()=>hPn,ZodPromise:()=>IPn,ZodReadonly:()=>vPn,ZodRealError:()=>Qde,ZodRecord:()=>wJt,ZodSet:()=>cPn,ZodString:()=>BRe,ZodStringFormat:()=>Cu,ZodSuccess:()=>APn,ZodSymbol:()=>Kkn,ZodTemplateLiteral:()=>bPn,ZodTransform:()=>RJt,ZodTuple:()=>sPn,ZodType:()=>ks,ZodULID:()=>hJt,ZodURL:()=>cJt,ZodUUID:()=>SF,ZodUndefined:()=>Jkn,ZodUnion:()=>xJt,ZodUnknown:()=>ePn,ZodVoid:()=>rPn,ZodXID:()=>mJt,_ZodString:()=>sJt,_default:()=>pPn,any:()=>IJt,array:()=>Fr,base64:()=>Uos,base64url:()=>Qos,bigint:()=>zos,boolean:()=>ol,catch:()=>EPn,check:()=>xPn,cidrv4:()=>Bos,cidrv6:()=>Fos,clone:()=>iT,coerce:()=>jRe,config:()=>im,core:()=>bF,cuid:()=>kos,cuid2:()=>Pos,custom:()=>MJt,date:()=>ess,discriminatedUnion:()=>Ert,e164:()=>qos,email:()=>Cos,emoji:()=>wos,endsWith:()=>wRe,enum:()=>rv,file:()=>css,flattenError:()=>lRe,float32:()=>Gos,float64:()=>$os,formatError:()=>uRe,function:()=>YKt,getErrorMap:()=>yss,globalRegistry:()=>s5,gt:()=>vF,gte:()=>tb,guid:()=>bos,includes:()=>IRe,instanceof:()=>hss,int:()=>oJt,int32:()=>Vos,int64:()=>Yos,intersection:()=>qRe,ipv4:()=>Oos,ipv6:()=>Los,iso:()=>Ude,json:()=>gss,jwt:()=>jos,keyof:()=>tss,ksuid:()=>Mos,lazy:()=>TPn,length:()=>Fde,literal:()=>Gn,locales:()=>_Re,looseObject:()=>om,lowercase:()=>SRe,lt:()=>_F,lte:()=>yw,map:()=>oss,maxLength:()=>Bde,maxSize:()=>Lde,mime:()=>RRe,minLength:()=>tj,minSize:()=>FJ,multipleOf:()=>BJ,nan:()=>dss,nanoid:()=>Ros,nativeEnum:()=>ass,negative:()=>UKt,never:()=>grt,nonnegative:()=>qKt,nonoptional:()=>gPn,nonpositive:()=>QKt,normalize:()=>kRe,null:()=>mrt,nullable:()=>prt,nullish:()=>lss,number:()=>ka,object:()=>zr,optional:()=>bu,overwrite:()=>CF,parse:()=>tJt,parseAsync:()=>rJt,partialRecord:()=>iss,pipe:()=>hrt,positive:()=>FKt,prefault:()=>mPn,preprocess:()=>vrt,prettifyError:()=>TWt,promise:()=>pss,property:()=>jKt,readonly:()=>CPn,record:()=>xl,refine:()=>wPn,regex:()=>bRe,regexes:()=>MJ,registry:()=>Utt,safeParse:()=>nJt,safeParseAsync:()=>iJt,set:()=>sss,setErrorMap:()=>Ass,size:()=>CRe,startsWith:()=>xRe,strictObject:()=>rss,string:()=>Je,stringFormat:()=>Hos,stringbool:()=>mss,success:()=>uss,superRefine:()=>RPn,symbol:()=>Jos,templateLiteral:()=>fss,toJSONSchema:()=>KKt,toLowerCase:()=>DRe,toUpperCase:()=>NRe,transform:()=>kJt,treeifyError:()=>SWt,trim:()=>PRe,tuple:()=>nss,uint32:()=>Wos,uint64:()=>Kos,ulid:()=>Dos,undefined:()=>Zos,union:()=>Il,unknown:()=>od,uppercase:()=>TRe,url:()=>lJt,uuid:()=>Sos,uuidv4:()=>Tos,uuidv6:()=>Ios,uuidv7:()=>xos,void:()=>Xos,xid:()=>Nos});p();var bF={};ki(bF,{$ZodAny:()=>Jzt,$ZodArray:()=>gRe,$ZodAsyncError:()=>i5,$ZodBase64:()=>qzt,$ZodBase64URL:()=>jzt,$ZodBigInt:()=>Btt,$ZodBigIntFormat:()=>Wzt,$ZodBoolean:()=>mRe,$ZodCIDRv4:()=>Fzt,$ZodCIDRv6:()=>Uzt,$ZodCUID:()=>xzt,$ZodCUID2:()=>wzt,$ZodCatch:()=>gYt,$ZodCheck:()=>Tf,$ZodCheckBigIntFormat:()=>nzt,$ZodCheckEndsWith:()=>mzt,$ZodCheckGreaterThan:()=>Ntt,$ZodCheckIncludes:()=>pzt,$ZodCheckLengthEquals:()=>lzt,$ZodCheckLessThan:()=>Dtt,$ZodCheckLowerCase:()=>dzt,$ZodCheckMaxLength:()=>azt,$ZodCheckMaxSize:()=>izt,$ZodCheckMimeType:()=>Azt,$ZodCheckMinLength:()=>czt,$ZodCheckMinSize:()=>ozt,$ZodCheckMultipleOf:()=>tzt,$ZodCheckNumberFormat:()=>rzt,$ZodCheckOverwrite:()=>yzt,$ZodCheckProperty:()=>gzt,$ZodCheckRegex:()=>uzt,$ZodCheckSizeEquals:()=>szt,$ZodCheckStartsWith:()=>hzt,$ZodCheckStringFormat:()=>Dde,$ZodCheckUpperCase:()=>fzt,$ZodCustom:()=>CYt,$ZodCustomStringFormat:()=>$zt,$ZodDate:()=>eYt,$ZodDefault:()=>fYt,$ZodDiscriminatedUnion:()=>rYt,$ZodE164:()=>Hzt,$ZodEmail:()=>bzt,$ZodEmoji:()=>Tzt,$ZodEnum:()=>aYt,$ZodError:()=>cRe,$ZodFile:()=>lYt,$ZodFunction:()=>art,$ZodGUID:()=>vzt,$ZodIPv4:()=>Lzt,$ZodIPv6:()=>Bzt,$ZodISODate:()=>Nzt,$ZodISODateTime:()=>Dzt,$ZodISODuration:()=>Ozt,$ZodISOTime:()=>Mzt,$ZodIntersection:()=>nYt,$ZodJWT:()=>Gzt,$ZodKSUID:()=>Pzt,$ZodLazy:()=>vYt,$ZodLiteral:()=>cYt,$ZodMap:()=>oYt,$ZodNaN:()=>AYt,$ZodNanoID:()=>Izt,$ZodNever:()=>Zzt,$ZodNonOptional:()=>hYt,$ZodNull:()=>Kzt,$ZodNullable:()=>dYt,$ZodNumber:()=>Ltt,$ZodNumberFormat:()=>Vzt,$ZodObject:()=>tYt,$ZodOptional:()=>uYt,$ZodPipe:()=>yRe,$ZodPrefault:()=>pYt,$ZodPromise:()=>_Yt,$ZodReadonly:()=>yYt,$ZodRealError:()=>kde,$ZodRecord:()=>iYt,$ZodRegistry:()=>Mde,$ZodSet:()=>sYt,$ZodString:()=>OJ,$ZodStringFormat:()=>Vl,$ZodSuccess:()=>mYt,$ZodSymbol:()=>zzt,$ZodTemplateLiteral:()=>EYt,$ZodTransform:()=>ARe,$ZodTuple:()=>LJ,$ZodType:()=>uo,$ZodULID:()=>Rzt,$ZodURL:()=>Szt,$ZodUUID:()=>Czt,$ZodUndefined:()=>Yzt,$ZodUnion:()=>Ftt,$ZodUnknown:()=>Nde,$ZodVoid:()=>Xzt,$ZodXID:()=>kzt,$brand:()=>fWt,$constructor:()=>dt,$input:()=>cKt,$output:()=>aKt,Doc:()=>hRe,JSONSchema:()=>Vkn,JSONSchemaGenerator:()=>ORe,NEVER:()=>eRe,TimePrecision:()=>dKt,_any:()=>DKt,_array:()=>MRe,_base64:()=>nrt,_base64url:()=>irt,_bigint:()=>TKt,_boolean:()=>bKt,_catch:()=>pos,_cidrv4:()=>trt,_cidrv6:()=>rrt,_coercedBigint:()=>IKt,_coercedBoolean:()=>SKt,_coercedDate:()=>LKt,_coercedNumber:()=>AKt,_coercedString:()=>uKt,_cuid:()=>ztt,_cuid2:()=>Ytt,_custom:()=>$Kt,_date:()=>OKt,_default:()=>uos,_discriminatedUnion:()=>Xis,_e164:()=>ort,_email:()=>Qtt,_emoji:()=>Vtt,_endsWith:()=>wRe,_enum:()=>ios,_file:()=>GKt,_float32:()=>EKt,_float64:()=>_Kt,_gt:()=>vF,_gte:()=>tb,_guid:()=>vRe,_includes:()=>IRe,_int:()=>yKt,_int32:()=>vKt,_int64:()=>xKt,_intersection:()=>eos,_ipv4:()=>Xtt,_ipv6:()=>ert,_isoDate:()=>pKt,_isoDateTime:()=>fKt,_isoDuration:()=>mKt,_isoTime:()=>hKt,_jwt:()=>srt,_ksuid:()=>Ztt,_lazy:()=>Aos,_length:()=>Fde,_literal:()=>sos,_lowercase:()=>SRe,_lt:()=>_F,_lte:()=>yw,_map:()=>ros,_max:()=>yw,_maxLength:()=>Bde,_maxSize:()=>Lde,_mime:()=>RRe,_min:()=>tb,_minLength:()=>tj,_minSize:()=>FJ,_multipleOf:()=>BJ,_nan:()=>BKt,_nanoid:()=>Wtt,_nativeEnum:()=>oos,_negative:()=>UKt,_never:()=>NKt,_nonnegative:()=>qKt,_nonoptional:()=>dos,_nonpositive:()=>QKt,_normalize:()=>kRe,_null:()=>PKt,_nullable:()=>los,_number:()=>gKt,_optional:()=>cos,_overwrite:()=>CF,_parse:()=>xtt,_parseAsync:()=>wtt,_pipe:()=>hos,_positive:()=>FKt,_promise:()=>yos,_property:()=>jKt,_readonly:()=>mos,_record:()=>tos,_refine:()=>VKt,_regex:()=>bRe,_safeParse:()=>Rtt,_safeParseAsync:()=>ktt,_set:()=>nos,_size:()=>CRe,_startsWith:()=>xRe,_string:()=>lKt,_stringFormat:()=>zKt,_stringbool:()=>WKt,_success:()=>fos,_symbol:()=>RKt,_templateLiteral:()=>gos,_toLowerCase:()=>DRe,_toUpperCase:()=>NRe,_transform:()=>aos,_trim:()=>PRe,_tuple:()=>HKt,_uint32:()=>CKt,_uint64:()=>wKt,_ulid:()=>Ktt,_undefined:()=>kKt,_union:()=>Zis,_unknown:()=>Ode,_uppercase:()=>TRe,_url:()=>$tt,_uuid:()=>qtt,_uuidv4:()=>jtt,_uuidv6:()=>Htt,_uuidv7:()=>Gtt,_void:()=>MKt,_xid:()=>Jtt,clone:()=>iT,config:()=>im,flattenError:()=>lRe,formatError:()=>uRe,function:()=>YKt,globalConfig:()=>Xwe,globalRegistry:()=>s5,isValidBase64:()=>Qzt,isValidBase64URL:()=>qkn,isValidJWT:()=>jkn,locales:()=>_Re,parse:()=>dRe,parseAsync:()=>fRe,prettifyError:()=>TWt,regexes:()=>MJ,registry:()=>Utt,safeParse:()=>Pde,safeParseAsync:()=>pRe,toDotPath:()=>bkn,toJSONSchema:()=>KKt,treeifyError:()=>SWt,util:()=>qr,version:()=>Ezt});p();p();var eRe=Object.freeze({status:"aborted"});function dt(t,e,r){function n(l,u){var d;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(d=l._zod).traits??(d.traits=new Set),l._zod.traits.add(t),e(l,u);for(let f in c.prototype)f in l||Object.defineProperty(l,f,{value:c.prototype[f].bind(l)});l._zod.constr=c,l._zod.def=u}a(n,"init");let o=r?.Parent??Object;class s extends o{static{a(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(l){var u;let d=r?.Parent?new s:this;n(d,l),(u=d._zod).deferred??(u.deferred=[]);for(let f of d._zod.deferred)f();return d}return a(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:a(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}a(dt,"$constructor");var fWt=Symbol("zod_brand"),i5=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Xwe={};function im(t){return t&&Object.assign(Xwe,t),Xwe}a(im,"config");p();p();var qr={};ki(qr,{BIGINT_FORMAT_RANGES:()=>CWt,Class:()=>hWt,NUMBER_FORMAT_RANGES:()=>vWt,aborted:()=>DJ,allowsEval:()=>yWt,assert:()=>Qns,assertEqual:()=>Lns,assertIs:()=>Fns,assertNever:()=>Uns,assertNotEqual:()=>Bns,assignProp:()=>AWt,cached:()=>nRe,captureStackTrace:()=>Itt,cleanEnum:()=>Xns,cleanRegex:()=>iRe,clone:()=>iT,createTransparentProxy:()=>Vns,defineLazy:()=>xc,esc:()=>PJ,escapeRegex:()=>EF,extend:()=>Yns,finalizeIssue:()=>oT,floatSafeRemainder:()=>gWt,getElementAtPath:()=>qns,getEnumValues:()=>rRe,getLengthableOrigin:()=>aRe,getParsedType:()=>$ns,getSizableOrigin:()=>sRe,isObject:()=>wde,isPlainObject:()=>Rde,issue:()=>bWt,joinValues:()=>jt,jsonStringifyReplacer:()=>mWt,merge:()=>Kns,normalizeParams:()=>Tr,nullish:()=>ej,numKeys:()=>Gns,omit:()=>zns,optionalKeys:()=>_Wt,partial:()=>Jns,pick:()=>Wns,prefixIssues:()=>eb,primitiveTypes:()=>EWt,promiseAllObject:()=>jns,propertyKeyTypes:()=>oRe,randomString:()=>Hns,required:()=>Zns,stringifyPrimitive:()=>Qr,unwrapMessage:()=>tRe});p();function Lns(t){return t}a(Lns,"assertEqual");function Bns(t){return t}a(Bns,"assertNotEqual");function Fns(t){}a(Fns,"assertIs");function Uns(t){throw new Error}a(Uns,"assertNever");function Qns(t){}a(Qns,"assert");function rRe(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(rRe,"getEnumValues");function jt(t,e="|"){return t.map(r=>Qr(r)).join(e)}a(jt,"joinValues");function mWt(t,e){return typeof e=="bigint"?e.toString():e}a(mWt,"jsonStringifyReplacer");function nRe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(nRe,"cached");function ej(t){return t==null}a(ej,"nullish");function iRe(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(iRe,"cleanRegex");function gWt(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}a(gWt,"floatSafeRemainder");function xc(t,e,r){Object.defineProperty(t,e,{get(){{let o=r();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}a(xc,"defineLazy");function AWt(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(AWt,"assignProp");function qns(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(qns,"getElementAtPath");function jns(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 wde(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(wde,"isObject");var yWt=nRe(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Rde(t){if(wde(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(wde(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Rde,"isPlainObject");function Gns(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(Gns,"numKeys");var $ns=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"),oRe=new Set(["string","number","symbol"]),EWt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function EF(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(EF,"escapeRegex");function iT(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(iT,"clone");function Tr(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(Tr,"normalizeParams");function Vns(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(Vns,"createTransparentProxy");function Qr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Qr,"stringifyPrimitive");function _Wt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(_Wt,"optionalKeys");var vWt={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]},CWt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Wns(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return iT(t,{...t._zod.def,shape:r,checks:[]})}a(Wns,"pick");function zns(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return iT(t,{...t._zod.def,shape:r,checks:[]})}a(zns,"omit");function Yns(t,e){if(!Rde(e))throw new Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return AWt(this,"shape",n),n},checks:[]};return iT(t,r)}a(Yns,"extend");function Kns(t,e){return iT(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return AWt(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}a(Kns,"merge");function Jns(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new 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 iT(e,{...e._zod.def,shape:o,checks:[]})}a(Jns,"partial");function Zns(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new 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 iT(e,{...e._zod.def,shape:o,checks:[]})}a(Zns,"required");function DJ(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(eb,"prefixIssues");function tRe(t){return typeof t=="string"?t:t?.message}a(tRe,"unwrapMessage");function oT(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=tRe(t.inst?._zod.def?.error?.(t))??tRe(e?.error?.(t))??tRe(r.customError?.(t))??tRe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}a(oT,"finalizeIssue");function sRe(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(sRe,"getSizableOrigin");function aRe(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(aRe,"getLengthableOrigin");function bWt(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(bWt,"issue");function Xns(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(Xns,"cleanEnum");var hWt=class{static{a(this,"Class")}constructor(...e){}};var Ckn=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,mWt,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),cRe=dt("$ZodError",Ckn),kde=dt("$ZodError",Ckn,{Parent:Error});function lRe(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(lRe,"flattenError");function uRe(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 ${bkn(n.path)}`);return e.join(` -`)}a(TWt,"prettifyError");var xtt=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 i5;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>oT(u,s,im())));throw Itt(l,o?.callee),l}return c.value},"_parse"),dRe=xtt(kde),wtt=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=>oT(u,s,im())));throw Itt(l,o?.callee),l}return c.value},"_parseAsync"),fRe=wtt(kde),Rtt=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 i5;return s.issues.length?{success:!1,error:new(t??cRe)(s.issues.map(c=>oT(c,o,im())))}:{success:!0,data:s.value}},"_safeParse"),Pde=Rtt(kde),ktt=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=>oT(c,o,im())))}:{success:!0,data:s.value}},"_safeParseAsync"),pRe=ktt(kde);p();p();var MJ={};ki(MJ,{_emoji:()=>Skn,base64:()=>QWt,base64url:()=>Ptt,bigint:()=>WWt,boolean:()=>KWt,browserEmail:()=>cis,cidrv4:()=>FWt,cidrv6:()=>UWt,cuid:()=>IWt,cuid2:()=>xWt,date:()=>HWt,datetime:()=>$Wt,domain:()=>lis,duration:()=>DWt,e164:()=>jWt,email:()=>MWt,emoji:()=>OWt,extendedDuration:()=>tis,guid:()=>NWt,hostname:()=>qWt,html5Email:()=>ois,integer:()=>zWt,ipv4:()=>LWt,ipv6:()=>BWt,ksuid:()=>kWt,lowercase:()=>XWt,nanoid:()=>PWt,null:()=>JWt,number:()=>YWt,rfc5322Email:()=>sis,string:()=>VWt,time:()=>GWt,ulid:()=>wWt,undefined:()=>ZWt,unicodeEmail:()=>ais,uppercase:()=>ezt,uuid:()=>NJ,uuid4:()=>ris,uuid6:()=>nis,uuid7:()=>iis,xid:()=>RWt});p();var IWt=/^[cC][^\s-]{8,}$/,xWt=/^[0-9a-z]+$/,wWt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RWt=/^[0-9a-vA-V]{20}$/,kWt=/^[A-Za-z0-9]{27}$/,PWt=/^[a-zA-Z0-9_-]{21}$/,DWt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tis=/^[-+]?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)?)??$/,NWt=/^([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})$/,NJ=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)$/,"uuid"),ris=NJ(4),nis=NJ(6),iis=NJ(7),MWt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ois=/^[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])?)*$/,sis=/^(([^<>()\[\]\\.,;:\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,}))$/,ais=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,cis=/^[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])?)*$/,Skn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function OWt(){return new RegExp(Skn,"u")}a(OWt,"emoji");var LWt=/^(?:(?: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])$/,BWt=/^(([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})$/,FWt=/^((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])$/,UWt=/^(([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])$/,QWt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ptt=/^[A-Za-z0-9_-]*$/,qWt=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,lis=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,jWt=/^\+(?:[0-9]){6,14}[0-9]$/,Tkn="(?:(?:\\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])))",HWt=new RegExp(`^${Tkn}$`);function Ikn(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(Ikn,"timeSource");function GWt(t){return new RegExp(`^${Ikn(t)}$`)}a(GWt,"time");function $Wt(t){let e=Ikn({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(`^${Tkn}T(?:${n})$`)}a($Wt,"datetime");var VWt=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),WWt=/^\d+n?$/,zWt=/^\d+$/,YWt=/^-?\d+(?:\.\d+)?/i,KWt=/true|false/i,JWt=/null/i;var ZWt=/undefined/i;var XWt=/^[^A-Z]*$/,ezt=/^[^a-z]*$/;var Tf=dt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),wkn={number:"number",bigint:"bigint",object:"date"},Dtt=dt("$ZodCheckLessThan",(t,e)=>{Tf.init(t,e);let r=wkn[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{Tf.init(t,e);let r=wkn[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})}}),tzt=dt("$ZodCheckMultipleOf",(t,e)=>{Tf.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):gWt(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})}}),rzt=dt("$ZodCheckNumberFormat",(t,e)=>{Tf.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=vWt[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=zWt)}),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})}}),nzt=dt("$ZodCheckBigIntFormat",(t,e)=>{Tf.init(t,e);let[r,n]=CWt[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})}}),izt=dt("$ZodCheckMaxSize",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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:sRe(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),ozt=dt("$ZodCheckMinSize",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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:sRe(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),szt=dt("$ZodCheckSizeEquals",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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:sRe(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})}}),azt=dt("$ZodCheckMaxLength",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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=aRe(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),czt=dt("$ZodCheckMinLength",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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=aRe(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),lzt=dt("$ZodCheckLengthEquals",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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=aRe(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})}}),Dde=dt("$ZodCheckStringFormat",(t,e)=>{var r,n;Tf.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=()=>{})}),uzt=dt("$ZodCheckRegex",(t,e)=>{Dde.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})}}),dzt=dt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=XWt),Dde.init(t,e)}),fzt=dt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=ezt),Dde.init(t,e)}),pzt=dt("$ZodCheckIncludes",(t,e)=>{Tf.init(t,e);let r=EF(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})}}),hzt=dt("$ZodCheckStartsWith",(t,e)=>{Tf.init(t,e);let r=new RegExp(`^${EF(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})}}),mzt=dt("$ZodCheckEndsWith",(t,e)=>{Tf.init(t,e);let r=new RegExp(`.*${EF(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 xkn(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues))}a(xkn,"handleCheckPropertyResult");var gzt=dt("$ZodCheckProperty",(t,e)=>{Tf.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=>xkn(o,r,e.property));xkn(n,r,e.property)}}),Azt=dt("$ZodCheckMimeType",(t,e)=>{Tf.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})}}),yzt=dt("$ZodCheckOverwrite",(t,e)=>{Tf.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var hRe=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 Qns(t){return[new Ett,new Ctt,new htt,new Itt,new Yet,new Ket,new Att,new ytt,new xtt]}a(Qns,"getAllClsTools");function Ckn(t,e){Qns(t).forEach(e.registerTool.bind(e)),t.get(bn).onDidSetCapabilities(r=>{t.get(jl).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new vde):r.subAgent?e.registerTool(new vde):e.unregisterTool(new vde),r.manageTodoListTool?e.registerTool(new WO(t)):e.unregisterTool(new WO(t)),r.watchedFiles?e.registerTool(new Gwe):e.unregisterTool(new Gwe)})}a(Ckn,"registerAllClsTools");var gs=class{constructor(e){this.ctx=e;this._toolRegistry=new Wze;Ckn(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 Oc;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 Lr([],"success")}async invokeToolConfirmation(e,r,n,o){if(o.isCancellationRequested)throw new Oc;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=>own.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>swn.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(dg.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(dg.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(dg.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(dg.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get(rp.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get(rp.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(dg.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(dg.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get(rp.id)?.find(m=>m.name==="create_file");if(c){let m=e.get(rp.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(dg.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(dg.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(rp.id)??[],f=e.get(dg.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==dg.id&&m!==rp.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(Ld);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(!XIe(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===dg.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===rp.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===dg.id||o.toolProvider.id===rp.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===dg.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===rp.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(XIe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===rp.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===dg.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===dg.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 ej=class extends KQ{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:rp,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(F_).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 Oc;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(qd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var k={};ki(k,{$brand:()=>pWt,$input:()=>lKt,$output:()=>cKt,NEVER:()=>eRe,TimePrecision:()=>fKt,ZodAny:()=>ePn,ZodArray:()=>iPn,ZodBase64:()=>CJt,ZodBase64URL:()=>bJt,ZodBigInt:()=>QRe,ZodBigIntFormat:()=>IJt,ZodBoolean:()=>URe,ZodCIDRv4:()=>_Jt,ZodCIDRv6:()=>vJt,ZodCUID:()=>pJt,ZodCUID2:()=>hJt,ZodCatch:()=>EPn,ZodCustom:()=>brt,ZodCustomStringFormat:()=>Kkn,ZodDate:()=>_rt,ZodDefault:()=>pPn,ZodDiscriminatedUnion:()=>oPn,ZodE164:()=>SJt,ZodEmail:()=>cJt,ZodEmoji:()=>dJt,ZodEnum:()=>LRe,ZodError:()=>Tos,ZodFile:()=>dPn,ZodGUID:()=>mrt,ZodIPv4:()=>yJt,ZodIPv6:()=>EJt,ZodISODate:()=>frt,ZodISODateTime:()=>drt,ZodISODuration:()=>hrt,ZodISOTime:()=>prt,ZodIntersection:()=>sPn,ZodIssueCode:()=>LJt,ZodJWT:()=>TJt,ZodKSUID:()=>AJt,ZodLazy:()=>TPn,ZodLiteral:()=>uPn,ZodMap:()=>cPn,ZodNaN:()=>vPn,ZodNanoID:()=>fJt,ZodNever:()=>rPn,ZodNonOptional:()=>NJt,ZodNull:()=>Xkn,ZodNullable:()=>fPn,ZodNumber:()=>FRe,ZodNumberFormat:()=>qde,ZodObject:()=>vrt,ZodOptional:()=>DJt,ZodPipe:()=>MJt,ZodPrefault:()=>mPn,ZodPromise:()=>xPn,ZodReadonly:()=>CPn,ZodRealError:()=>Qde,ZodRecord:()=>RJt,ZodSet:()=>lPn,ZodString:()=>BRe,ZodStringFormat:()=>Cu,ZodSuccess:()=>yPn,ZodSymbol:()=>Jkn,ZodTemplateLiteral:()=>SPn,ZodTransform:()=>kJt,ZodTuple:()=>aPn,ZodType:()=>ks,ZodULID:()=>mJt,ZodURL:()=>lJt,ZodUUID:()=>TF,ZodUndefined:()=>Zkn,ZodUnion:()=>wJt,ZodUnknown:()=>tPn,ZodVoid:()=>nPn,ZodXID:()=>gJt,_ZodString:()=>aJt,_default:()=>hPn,any:()=>xJt,array:()=>Fr,base64:()=>Gos,base64url:()=>$os,bigint:()=>Xos,boolean:()=>ol,catch:()=>_Pn,check:()=>wPn,cidrv4:()=>jos,cidrv6:()=>Hos,clone:()=>sT,coerce:()=>jRe,config:()=>im,core:()=>SF,cuid:()=>Oos,cuid2:()=>Los,custom:()=>OJt,date:()=>oss,discriminatedUnion:()=>Crt,e164:()=>Vos,email:()=>xos,emoji:()=>Nos,endsWith:()=>wRe,enum:()=>nv,file:()=>pss,flattenError:()=>lRe,float32:()=>Yos,float64:()=>Kos,formatError:()=>uRe,function:()=>KKt,getErrorMap:()=>bss,globalRegistry:()=>s5,gt:()=>CF,gte:()=>tb,guid:()=>wos,includes:()=>IRe,instanceof:()=>Ess,int:()=>sJt,int32:()=>Jos,int64:()=>ess,intersection:()=>qRe,ipv4:()=>Qos,ipv6:()=>qos,iso:()=>Ude,json:()=>vss,jwt:()=>Wos,keyof:()=>sss,ksuid:()=>Uos,lazy:()=>IPn,length:()=>Fde,literal:()=>Gn,locales:()=>_Re,looseObject:()=>om,lowercase:()=>SRe,lt:()=>vF,lte:()=>Ew,map:()=>uss,maxLength:()=>Bde,maxSize:()=>Lde,mime:()=>RRe,minLength:()=>rj,minSize:()=>FJ,multipleOf:()=>BJ,nan:()=>gss,nanoid:()=>Mos,nativeEnum:()=>fss,negative:()=>QKt,never:()=>Ert,nonnegative:()=>jKt,nonoptional:()=>APn,nonpositive:()=>qKt,normalize:()=>kRe,null:()=>yrt,nullable:()=>grt,nullish:()=>hss,number:()=>Ra,object:()=>zr,optional:()=>bu,overwrite:()=>bF,parse:()=>rJt,parseAsync:()=>nJt,partialRecord:()=>lss,pipe:()=>Art,positive:()=>UKt,prefault:()=>gPn,preprocess:()=>Srt,prettifyError:()=>IWt,promise:()=>yss,property:()=>HKt,readonly:()=>bPn,record:()=>xl,refine:()=>RPn,regex:()=>bRe,regexes:()=>MJ,registry:()=>jtt,safeParse:()=>iJt,safeParseAsync:()=>oJt,set:()=>dss,setErrorMap:()=>Css,size:()=>CRe,startsWith:()=>xRe,strictObject:()=>ass,string:()=>Je,stringFormat:()=>zos,stringbool:()=>_ss,success:()=>mss,superRefine:()=>kPn,symbol:()=>rss,templateLiteral:()=>Ass,toJSONSchema:()=>JKt,toLowerCase:()=>DRe,toUpperCase:()=>NRe,transform:()=>PJt,treeifyError:()=>TWt,trim:()=>PRe,tuple:()=>css,uint32:()=>Zos,uint64:()=>tss,ulid:()=>Bos,undefined:()=>nss,union:()=>Il,unknown:()=>od,uppercase:()=>TRe,url:()=>uJt,uuid:()=>Ros,uuidv4:()=>kos,uuidv6:()=>Pos,uuidv7:()=>Dos,void:()=>iss,xid:()=>Fos});p();var SF={};ki(SF,{$ZodAny:()=>Zzt,$ZodArray:()=>gRe,$ZodAsyncError:()=>i5,$ZodBase64:()=>jzt,$ZodBase64URL:()=>Hzt,$ZodBigInt:()=>Qtt,$ZodBigIntFormat:()=>zzt,$ZodBoolean:()=>mRe,$ZodCIDRv4:()=>Uzt,$ZodCIDRv6:()=>Qzt,$ZodCUID:()=>wzt,$ZodCUID2:()=>Rzt,$ZodCatch:()=>AYt,$ZodCheck:()=>Tf,$ZodCheckBigIntFormat:()=>izt,$ZodCheckEndsWith:()=>gzt,$ZodCheckGreaterThan:()=>Ltt,$ZodCheckIncludes:()=>hzt,$ZodCheckLengthEquals:()=>uzt,$ZodCheckLessThan:()=>Ott,$ZodCheckLowerCase:()=>fzt,$ZodCheckMaxLength:()=>czt,$ZodCheckMaxSize:()=>ozt,$ZodCheckMimeType:()=>yzt,$ZodCheckMinLength:()=>lzt,$ZodCheckMinSize:()=>szt,$ZodCheckMultipleOf:()=>rzt,$ZodCheckNumberFormat:()=>nzt,$ZodCheckOverwrite:()=>Ezt,$ZodCheckProperty:()=>Azt,$ZodCheckRegex:()=>dzt,$ZodCheckSizeEquals:()=>azt,$ZodCheckStartsWith:()=>mzt,$ZodCheckStringFormat:()=>Dde,$ZodCheckUpperCase:()=>pzt,$ZodCustom:()=>bYt,$ZodCustomStringFormat:()=>Vzt,$ZodDate:()=>tYt,$ZodDefault:()=>pYt,$ZodDiscriminatedUnion:()=>nYt,$ZodE164:()=>Gzt,$ZodEmail:()=>Szt,$ZodEmoji:()=>Izt,$ZodEnum:()=>cYt,$ZodError:()=>cRe,$ZodFile:()=>uYt,$ZodFunction:()=>urt,$ZodGUID:()=>Czt,$ZodIPv4:()=>Bzt,$ZodIPv6:()=>Fzt,$ZodISODate:()=>Mzt,$ZodISODateTime:()=>Nzt,$ZodISODuration:()=>Lzt,$ZodISOTime:()=>Ozt,$ZodIntersection:()=>iYt,$ZodJWT:()=>$zt,$ZodKSUID:()=>Dzt,$ZodLazy:()=>CYt,$ZodLiteral:()=>lYt,$ZodMap:()=>sYt,$ZodNaN:()=>yYt,$ZodNanoID:()=>xzt,$ZodNever:()=>Xzt,$ZodNonOptional:()=>mYt,$ZodNull:()=>Jzt,$ZodNullable:()=>fYt,$ZodNumber:()=>Utt,$ZodNumberFormat:()=>Wzt,$ZodObject:()=>rYt,$ZodOptional:()=>dYt,$ZodPipe:()=>yRe,$ZodPrefault:()=>hYt,$ZodPromise:()=>vYt,$ZodReadonly:()=>EYt,$ZodRealError:()=>kde,$ZodRecord:()=>oYt,$ZodRegistry:()=>Mde,$ZodSet:()=>aYt,$ZodString:()=>OJ,$ZodStringFormat:()=>Vl,$ZodSuccess:()=>gYt,$ZodSymbol:()=>Yzt,$ZodTemplateLiteral:()=>_Yt,$ZodTransform:()=>ARe,$ZodTuple:()=>LJ,$ZodType:()=>uo,$ZodULID:()=>kzt,$ZodURL:()=>Tzt,$ZodUUID:()=>bzt,$ZodUndefined:()=>Kzt,$ZodUnion:()=>qtt,$ZodUnknown:()=>Nde,$ZodVoid:()=>eYt,$ZodXID:()=>Pzt,$brand:()=>pWt,$constructor:()=>dt,$input:()=>lKt,$output:()=>cKt,Doc:()=>hRe,JSONSchema:()=>Wkn,JSONSchemaGenerator:()=>ORe,NEVER:()=>eRe,TimePrecision:()=>fKt,_any:()=>NKt,_array:()=>MRe,_base64:()=>srt,_base64url:()=>art,_bigint:()=>IKt,_boolean:()=>SKt,_catch:()=>yos,_cidrv4:()=>irt,_cidrv6:()=>ort,_coercedBigint:()=>xKt,_coercedBoolean:()=>TKt,_coercedDate:()=>BKt,_coercedNumber:()=>yKt,_coercedString:()=>dKt,_cuid:()=>Jtt,_cuid2:()=>Ztt,_custom:()=>VKt,_date:()=>LKt,_default:()=>mos,_discriminatedUnion:()=>ios,_e164:()=>crt,_email:()=>Htt,_emoji:()=>Ytt,_endsWith:()=>wRe,_enum:()=>los,_file:()=>$Kt,_float32:()=>_Kt,_float64:()=>vKt,_gt:()=>CF,_gte:()=>tb,_guid:()=>vRe,_includes:()=>IRe,_int:()=>EKt,_int32:()=>CKt,_int64:()=>wKt,_intersection:()=>oos,_ipv4:()=>rrt,_ipv6:()=>nrt,_isoDate:()=>hKt,_isoDateTime:()=>pKt,_isoDuration:()=>gKt,_isoTime:()=>mKt,_jwt:()=>lrt,_ksuid:()=>trt,_lazy:()=>Cos,_length:()=>Fde,_literal:()=>dos,_lowercase:()=>SRe,_lt:()=>vF,_lte:()=>Ew,_map:()=>aos,_max:()=>Ew,_maxLength:()=>Bde,_maxSize:()=>Lde,_mime:()=>RRe,_min:()=>tb,_minLength:()=>rj,_minSize:()=>FJ,_multipleOf:()=>BJ,_nan:()=>FKt,_nanoid:()=>Ktt,_nativeEnum:()=>uos,_negative:()=>QKt,_never:()=>MKt,_nonnegative:()=>jKt,_nonoptional:()=>gos,_nonpositive:()=>qKt,_normalize:()=>kRe,_null:()=>DKt,_nullable:()=>hos,_number:()=>AKt,_optional:()=>pos,_overwrite:()=>bF,_parse:()=>ktt,_parseAsync:()=>Ptt,_pipe:()=>Eos,_positive:()=>UKt,_promise:()=>bos,_property:()=>HKt,_readonly:()=>_os,_record:()=>sos,_refine:()=>WKt,_regex:()=>bRe,_safeParse:()=>Dtt,_safeParseAsync:()=>Ntt,_set:()=>cos,_size:()=>CRe,_startsWith:()=>xRe,_string:()=>uKt,_stringFormat:()=>YKt,_stringbool:()=>zKt,_success:()=>Aos,_symbol:()=>kKt,_templateLiteral:()=>vos,_toLowerCase:()=>DRe,_toUpperCase:()=>NRe,_transform:()=>fos,_trim:()=>PRe,_tuple:()=>GKt,_uint32:()=>bKt,_uint64:()=>RKt,_ulid:()=>Xtt,_undefined:()=>PKt,_union:()=>nos,_unknown:()=>Ode,_uppercase:()=>TRe,_url:()=>ztt,_uuid:()=>Gtt,_uuidv4:()=>$tt,_uuidv6:()=>Vtt,_uuidv7:()=>Wtt,_void:()=>OKt,_xid:()=>ert,clone:()=>sT,config:()=>im,flattenError:()=>lRe,formatError:()=>uRe,function:()=>KKt,globalConfig:()=>Xwe,globalRegistry:()=>s5,isValidBase64:()=>qzt,isValidBase64URL:()=>jkn,isValidJWT:()=>Hkn,locales:()=>_Re,parse:()=>dRe,parseAsync:()=>fRe,prettifyError:()=>IWt,regexes:()=>MJ,registry:()=>jtt,safeParse:()=>Pde,safeParseAsync:()=>pRe,toDotPath:()=>Skn,toJSONSchema:()=>JKt,treeifyError:()=>TWt,util:()=>qr,version:()=>_zt});p();p();var eRe=Object.freeze({status:"aborted"});function dt(t,e,r){function n(l,u){var d;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(d=l._zod).traits??(d.traits=new Set),l._zod.traits.add(t),e(l,u);for(let f in c.prototype)f in l||Object.defineProperty(l,f,{value:c.prototype[f].bind(l)});l._zod.constr=c,l._zod.def=u}a(n,"init");let o=r?.Parent??Object;class s extends o{static{a(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(l){var u;let d=r?.Parent?new s:this;n(d,l),(u=d._zod).deferred??(u.deferred=[]);for(let f of d._zod.deferred)f();return d}return a(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:a(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}a(dt,"$constructor");var pWt=Symbol("zod_brand"),i5=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Xwe={};function im(t){return t&&Object.assign(Xwe,t),Xwe}a(im,"config");p();p();var qr={};ki(qr,{BIGINT_FORMAT_RANGES:()=>bWt,Class:()=>mWt,NUMBER_FORMAT_RANGES:()=>CWt,aborted:()=>DJ,allowsEval:()=>EWt,assert:()=>$ns,assertEqual:()=>qns,assertIs:()=>Hns,assertNever:()=>Gns,assertNotEqual:()=>jns,assignProp:()=>yWt,cached:()=>nRe,captureStackTrace:()=>Rtt,cleanEnum:()=>iis,cleanRegex:()=>iRe,clone:()=>sT,createTransparentProxy:()=>Jns,defineLazy:()=>xc,esc:()=>PJ,escapeRegex:()=>_F,extend:()=>eis,finalizeIssue:()=>aT,floatSafeRemainder:()=>AWt,getElementAtPath:()=>Vns,getEnumValues:()=>rRe,getLengthableOrigin:()=>aRe,getParsedType:()=>Kns,getSizableOrigin:()=>sRe,isObject:()=>wde,isPlainObject:()=>Rde,issue:()=>SWt,joinValues:()=>jt,jsonStringifyReplacer:()=>gWt,merge:()=>tis,normalizeParams:()=>Tr,nullish:()=>tj,numKeys:()=>Yns,omit:()=>Xns,optionalKeys:()=>vWt,partial:()=>ris,pick:()=>Zns,prefixIssues:()=>eb,primitiveTypes:()=>_Wt,promiseAllObject:()=>Wns,propertyKeyTypes:()=>oRe,randomString:()=>zns,required:()=>nis,stringifyPrimitive:()=>Qr,unwrapMessage:()=>tRe});p();function qns(t){return t}a(qns,"assertEqual");function jns(t){return t}a(jns,"assertNotEqual");function Hns(t){}a(Hns,"assertIs");function Gns(t){throw new Error}a(Gns,"assertNever");function $ns(t){}a($ns,"assert");function rRe(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(rRe,"getEnumValues");function jt(t,e="|"){return t.map(r=>Qr(r)).join(e)}a(jt,"joinValues");function gWt(t,e){return typeof e=="bigint"?e.toString():e}a(gWt,"jsonStringifyReplacer");function nRe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(nRe,"cached");function tj(t){return t==null}a(tj,"nullish");function iRe(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(iRe,"cleanRegex");function AWt(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}a(AWt,"floatSafeRemainder");function xc(t,e,r){Object.defineProperty(t,e,{get(){{let o=r();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}a(xc,"defineLazy");function yWt(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(yWt,"assignProp");function Vns(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(Vns,"getElementAtPath");function Wns(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 wde(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(wde,"isObject");var EWt=nRe(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Rde(t){if(wde(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(wde(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Rde,"isPlainObject");function Yns(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(Yns,"numKeys");var Kns=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"),oRe=new Set(["string","number","symbol"]),_Wt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function _F(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(_F,"escapeRegex");function sT(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(sT,"clone");function Tr(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(Tr,"normalizeParams");function Jns(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(Jns,"createTransparentProxy");function Qr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Qr,"stringifyPrimitive");function vWt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(vWt,"optionalKeys");var CWt={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]},bWt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Zns(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return sT(t,{...t._zod.def,shape:r,checks:[]})}a(Zns,"pick");function Xns(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return sT(t,{...t._zod.def,shape:r,checks:[]})}a(Xns,"omit");function eis(t,e){if(!Rde(e))throw new Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return yWt(this,"shape",n),n},checks:[]};return sT(t,r)}a(eis,"extend");function tis(t,e){return sT(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return yWt(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}a(tis,"merge");function ris(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new 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 sT(e,{...e._zod.def,shape:o,checks:[]})}a(ris,"partial");function nis(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new 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 sT(e,{...e._zod.def,shape:o,checks:[]})}a(nis,"required");function DJ(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(eb,"prefixIssues");function tRe(t){return typeof t=="string"?t:t?.message}a(tRe,"unwrapMessage");function aT(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=tRe(t.inst?._zod.def?.error?.(t))??tRe(e?.error?.(t))??tRe(r.customError?.(t))??tRe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}a(aT,"finalizeIssue");function sRe(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(sRe,"getSizableOrigin");function aRe(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(aRe,"getLengthableOrigin");function SWt(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(SWt,"issue");function iis(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(iis,"cleanEnum");var mWt=class{static{a(this,"Class")}constructor(...e){}};var bkn=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,gWt,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),cRe=dt("$ZodError",bkn),kde=dt("$ZodError",bkn,{Parent:Error});function lRe(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(lRe,"flattenError");function uRe(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 ${Skn(n.path)}`);return e.join(` +`)}a(IWt,"prettifyError");var ktt=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 i5;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>aT(u,s,im())));throw Rtt(l,o?.callee),l}return c.value},"_parse"),dRe=ktt(kde),Ptt=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=>aT(u,s,im())));throw Rtt(l,o?.callee),l}return c.value},"_parseAsync"),fRe=Ptt(kde),Dtt=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 i5;return s.issues.length?{success:!1,error:new(t??cRe)(s.issues.map(c=>aT(c,o,im())))}:{success:!0,data:s.value}},"_safeParse"),Pde=Dtt(kde),Ntt=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=>aT(c,o,im())))}:{success:!0,data:s.value}},"_safeParseAsync"),pRe=Ntt(kde);p();p();var MJ={};ki(MJ,{_emoji:()=>Tkn,base64:()=>qWt,base64url:()=>Mtt,bigint:()=>zWt,boolean:()=>JWt,browserEmail:()=>pis,cidrv4:()=>UWt,cidrv6:()=>QWt,cuid:()=>xWt,cuid2:()=>wWt,date:()=>GWt,datetime:()=>VWt,domain:()=>his,duration:()=>NWt,e164:()=>HWt,email:()=>OWt,emoji:()=>LWt,extendedDuration:()=>sis,guid:()=>MWt,hostname:()=>jWt,html5Email:()=>uis,integer:()=>YWt,ipv4:()=>BWt,ipv6:()=>FWt,ksuid:()=>PWt,lowercase:()=>ezt,nanoid:()=>DWt,null:()=>ZWt,number:()=>KWt,rfc5322Email:()=>dis,string:()=>WWt,time:()=>$Wt,ulid:()=>RWt,undefined:()=>XWt,unicodeEmail:()=>fis,uppercase:()=>tzt,uuid:()=>NJ,uuid4:()=>ais,uuid6:()=>cis,uuid7:()=>lis,xid:()=>kWt});p();var xWt=/^[cC][^\s-]{8,}$/,wWt=/^[0-9a-z]+$/,RWt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kWt=/^[0-9a-vA-V]{20}$/,PWt=/^[A-Za-z0-9]{27}$/,DWt=/^[a-zA-Z0-9_-]{21}$/,NWt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sis=/^[-+]?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)?)??$/,MWt=/^([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})$/,NJ=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)$/,"uuid"),ais=NJ(4),cis=NJ(6),lis=NJ(7),OWt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uis=/^[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])?)*$/,dis=/^(([^<>()\[\]\\.,;:\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,}))$/,fis=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,pis=/^[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])?)*$/,Tkn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function LWt(){return new RegExp(Tkn,"u")}a(LWt,"emoji");var BWt=/^(?:(?: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])$/,FWt=/^(([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})$/,UWt=/^((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])$/,QWt=/^(([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])$/,qWt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mtt=/^[A-Za-z0-9_-]*$/,jWt=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,his=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,HWt=/^\+(?:[0-9]){6,14}[0-9]$/,Ikn="(?:(?:\\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])))",GWt=new RegExp(`^${Ikn}$`);function xkn(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(xkn,"timeSource");function $Wt(t){return new RegExp(`^${xkn(t)}$`)}a($Wt,"time");function VWt(t){let e=xkn({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(`^${Ikn}T(?:${n})$`)}a(VWt,"datetime");var WWt=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),zWt=/^\d+n?$/,YWt=/^\d+$/,KWt=/^-?\d+(?:\.\d+)?/i,JWt=/true|false/i,ZWt=/null/i;var XWt=/undefined/i;var ezt=/^[^A-Z]*$/,tzt=/^[^a-z]*$/;var Tf=dt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Rkn={number:"number",bigint:"bigint",object:"date"},Ott=dt("$ZodCheckLessThan",(t,e)=>{Tf.init(t,e);let r=Rkn[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{Tf.init(t,e);let r=Rkn[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})}}),rzt=dt("$ZodCheckMultipleOf",(t,e)=>{Tf.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):AWt(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})}}),nzt=dt("$ZodCheckNumberFormat",(t,e)=>{Tf.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=CWt[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=YWt)}),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})}}),izt=dt("$ZodCheckBigIntFormat",(t,e)=>{Tf.init(t,e);let[r,n]=bWt[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})}}),ozt=dt("$ZodCheckMaxSize",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!tj(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:sRe(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),szt=dt("$ZodCheckMinSize",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!tj(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:sRe(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),azt=dt("$ZodCheckSizeEquals",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!tj(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:sRe(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})}}),czt=dt("$ZodCheckMaxLength",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!tj(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=aRe(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),lzt=dt("$ZodCheckMinLength",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!tj(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=aRe(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),uzt=dt("$ZodCheckLengthEquals",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!tj(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=aRe(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})}}),Dde=dt("$ZodCheckStringFormat",(t,e)=>{var r,n;Tf.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=()=>{})}),dzt=dt("$ZodCheckRegex",(t,e)=>{Dde.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})}}),fzt=dt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=ezt),Dde.init(t,e)}),pzt=dt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=tzt),Dde.init(t,e)}),hzt=dt("$ZodCheckIncludes",(t,e)=>{Tf.init(t,e);let r=_F(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})}}),mzt=dt("$ZodCheckStartsWith",(t,e)=>{Tf.init(t,e);let r=new RegExp(`^${_F(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})}}),gzt=dt("$ZodCheckEndsWith",(t,e)=>{Tf.init(t,e);let r=new RegExp(`.*${_F(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 wkn(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues))}a(wkn,"handleCheckPropertyResult");var Azt=dt("$ZodCheckProperty",(t,e)=>{Tf.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=>wkn(o,r,e.property));wkn(n,r,e.property)}}),yzt=dt("$ZodCheckMimeType",(t,e)=>{Tf.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})}}),Ezt=dt("$ZodCheckOverwrite",(t,e)=>{Tf.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var hRe=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 Ezt={major:4,minor:0,patch:0};var uo=dt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Ezt;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=DJ(s),d;for(let f of c){if(f._zod.def.when){if(!f._zod.def.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 i5;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=DJ(s,h)))});else{if(s.issues.length===h)continue;u||(u=DJ(s,h))}}return d?d.then(()=>s):s},"runChecks");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new i5;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Pde(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return pRe(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),OJ=dt("$ZodString",(t,e)=>{uo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??VWt(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}}),Vl=dt("$ZodStringFormat",(t,e)=>{Dde.init(t,e),OJ.init(t,e)}),vzt=dt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=NWt),Vl.init(t,e)}),Czt=dt("$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=NJ(n))}else e.pattern??(e.pattern=NJ());Vl.init(t,e)}),bzt=dt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=MWt),Vl.init(t,e)}),Szt=dt("$ZodURL",(t,e)=>{Vl.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:qWt.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})}}}),Tzt=dt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=OWt()),Vl.init(t,e)}),Izt=dt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=PWt),Vl.init(t,e)}),xzt=dt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=IWt),Vl.init(t,e)}),wzt=dt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=xWt),Vl.init(t,e)}),Rzt=dt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=wWt),Vl.init(t,e)}),kzt=dt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=RWt),Vl.init(t,e)}),Pzt=dt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=kWt),Vl.init(t,e)}),Dzt=dt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=$Wt(e)),Vl.init(t,e)}),Nzt=dt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=HWt),Vl.init(t,e)}),Mzt=dt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=GWt(e)),Vl.init(t,e)}),Ozt=dt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=DWt),Vl.init(t,e)}),Lzt=dt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=LWt),Vl.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Bzt=dt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=BWt),Vl.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})}}}),Fzt=dt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=FWt),Vl.init(t,e)}),Uzt=dt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=UWt),Vl.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Qzt(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(Qzt,"isValidBase64");var qzt=dt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=QWt),Vl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{Qzt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function qkn(t){if(!Ptt.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Qzt(r)}a(qkn,"isValidBase64URL");var jzt=dt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Ptt),Vl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{qkn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Hzt=dt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=jWt),Vl.init(t,e)});function jkn(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(jkn,"isValidJWT");var Gzt=dt("$ZodJWT",(t,e)=>{Vl.init(t,e),t._zod.check=r=>{jkn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),$zt=dt("$ZodCustomStringFormat",(t,e)=>{Vl.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})}}),Ltt=dt("$ZodNumber",(t,e)=>{uo.init(t,e),t._zod.pattern=t._zod.bag.pattern??YWt,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}}),Vzt=dt("$ZodNumber",(t,e)=>{rzt.init(t,e),Ltt.init(t,e)}),mRe=dt("$ZodBoolean",(t,e)=>{uo.init(t,e),t._zod.pattern=KWt,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}}),Btt=dt("$ZodBigInt",(t,e)=>{uo.init(t,e),t._zod.pattern=WWt,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}}),Wzt=dt("$ZodBigInt",(t,e)=>{nzt.init(t,e),Btt.init(t,e)}),zzt=dt("$ZodSymbol",(t,e)=>{uo.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}}),Yzt=dt("$ZodUndefined",(t,e)=>{uo.init(t,e),t._zod.pattern=ZWt,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}}),Kzt=dt("$ZodNull",(t,e)=>{uo.init(t,e),t._zod.pattern=JWt,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}}),Jzt=dt("$ZodAny",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Nde=dt("$ZodUnknown",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Zzt=dt("$ZodNever",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),Xzt=dt("$ZodVoid",(t,e)=>{uo.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}}),eYt=dt("$ZodDate",(t,e)=>{uo.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 kkn(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(kkn,"handleArrayResult");var gRe=dt("$ZodArray",(t,e)=>{uo.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;ckkn(d,r,c))):kkn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Mtt(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(Mtt,"handleObjectResult");function Pkn(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(...eb(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}a(Pkn,"handleOptionalObjectResult");var tYt=dt("$ZodObject",(t,e)=>{uo.init(t,e);let r=nRe(()=>{let h=Object.keys(e.shape);for(let g of h)if(!(e.shape[g]instanceof uo))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let m=_Wt(e.shape);return{shape:e.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});xc(t._zod,"propValues",()=>{let h=e.shape,m={};for(let g in h){let A=h[g]._zod;if(A.values){m[g]??(m[g]=new Set);for(let y of A.values)m[g].add(y)}}return m});let n=a(h=>{let m=new hRe(["shape","payload","ctx"]),g=r.value,A=a(v=>{let b=PJ(v);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`},"parseStr");m.write("const input = payload.value;");let y=Object.create(null),E=0;for(let v of g.keys)y[v]=`key_${E++}`;m.write("const newResult = {}");for(let v of g.keys)if(g.optionalKeys.has(v)){let b=y[v];m.write(`const ${b} = ${A(v)};`);let T=PJ(v);m.write(` +`))}};p();var _zt={major:4,minor:0,patch:0};var uo=dt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=_zt;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=DJ(s),d;for(let f of c){if(f._zod.def.when){if(!f._zod.def.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 i5;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=DJ(s,h)))});else{if(s.issues.length===h)continue;u||(u=DJ(s,h))}}return d?d.then(()=>s):s},"runChecks");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new i5;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Pde(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return pRe(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),OJ=dt("$ZodString",(t,e)=>{uo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??WWt(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}}),Vl=dt("$ZodStringFormat",(t,e)=>{Dde.init(t,e),OJ.init(t,e)}),Czt=dt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=MWt),Vl.init(t,e)}),bzt=dt("$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=NJ(n))}else e.pattern??(e.pattern=NJ());Vl.init(t,e)}),Szt=dt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=OWt),Vl.init(t,e)}),Tzt=dt("$ZodURL",(t,e)=>{Vl.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:jWt.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})}}}),Izt=dt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=LWt()),Vl.init(t,e)}),xzt=dt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=DWt),Vl.init(t,e)}),wzt=dt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=xWt),Vl.init(t,e)}),Rzt=dt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=wWt),Vl.init(t,e)}),kzt=dt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=RWt),Vl.init(t,e)}),Pzt=dt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=kWt),Vl.init(t,e)}),Dzt=dt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=PWt),Vl.init(t,e)}),Nzt=dt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=VWt(e)),Vl.init(t,e)}),Mzt=dt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=GWt),Vl.init(t,e)}),Ozt=dt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=$Wt(e)),Vl.init(t,e)}),Lzt=dt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=NWt),Vl.init(t,e)}),Bzt=dt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=BWt),Vl.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Fzt=dt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=FWt),Vl.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})}}}),Uzt=dt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=UWt),Vl.init(t,e)}),Qzt=dt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=QWt),Vl.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function qzt(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(qzt,"isValidBase64");var jzt=dt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=qWt),Vl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{qzt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function jkn(t){if(!Mtt.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return qzt(r)}a(jkn,"isValidBase64URL");var Hzt=dt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Mtt),Vl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{jkn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Gzt=dt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=HWt),Vl.init(t,e)});function Hkn(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(Hkn,"isValidJWT");var $zt=dt("$ZodJWT",(t,e)=>{Vl.init(t,e),t._zod.check=r=>{Hkn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Vzt=dt("$ZodCustomStringFormat",(t,e)=>{Vl.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})}}),Utt=dt("$ZodNumber",(t,e)=>{uo.init(t,e),t._zod.pattern=t._zod.bag.pattern??KWt,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}}),Wzt=dt("$ZodNumber",(t,e)=>{nzt.init(t,e),Utt.init(t,e)}),mRe=dt("$ZodBoolean",(t,e)=>{uo.init(t,e),t._zod.pattern=JWt,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}}),Qtt=dt("$ZodBigInt",(t,e)=>{uo.init(t,e),t._zod.pattern=zWt,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}}),zzt=dt("$ZodBigInt",(t,e)=>{izt.init(t,e),Qtt.init(t,e)}),Yzt=dt("$ZodSymbol",(t,e)=>{uo.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}}),Kzt=dt("$ZodUndefined",(t,e)=>{uo.init(t,e),t._zod.pattern=XWt,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}}),Jzt=dt("$ZodNull",(t,e)=>{uo.init(t,e),t._zod.pattern=ZWt,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}}),Zzt=dt("$ZodAny",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Nde=dt("$ZodUnknown",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Xzt=dt("$ZodNever",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),eYt=dt("$ZodVoid",(t,e)=>{uo.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}}),tYt=dt("$ZodDate",(t,e)=>{uo.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 Pkn(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(Pkn,"handleArrayResult");var gRe=dt("$ZodArray",(t,e)=>{uo.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;cPkn(d,r,c))):Pkn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Btt(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(Btt,"handleObjectResult");function Dkn(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(...eb(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}a(Dkn,"handleOptionalObjectResult");var rYt=dt("$ZodObject",(t,e)=>{uo.init(t,e);let r=nRe(()=>{let h=Object.keys(e.shape);for(let g of h)if(!(e.shape[g]instanceof uo))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let m=vWt(e.shape);return{shape:e.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});xc(t._zod,"propValues",()=>{let h=e.shape,m={};for(let g in h){let A=h[g]._zod;if(A.values){m[g]??(m[g]=new Set);for(let y of A.values)m[g].add(y)}}return m});let n=a(h=>{let m=new hRe(["shape","payload","ctx"]),g=r.value,A=a(v=>{let b=PJ(v);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`},"parseStr");m.write("const input = payload.value;");let y=Object.create(null),E=0;for(let v of g.keys)y[v]=`key_${E++}`;m.write("const newResult = {}");for(let v of g.keys)if(g.optionalKeys.has(v)){let b=y[v];m.write(`const ${b} = ${A(v)};`);let T=PJ(v);m.write(` if (${b}.issues.length) { if (input[${T}] === undefined) { if (${T} in input) { @@ -3724,161 +3724,161 @@ ${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${zVt(f.summar if (${b}.issues.length) payload.issues = payload.issues.concat(${b}.issues.map(iss => ({ ...iss, path: iss.path ? [${PJ(v)}, ...iss.path] : [${PJ(v)}] - })));`),m.write(`newResult[${PJ(v)}] = ${b}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,b)=>_(h,v,b)},"generateFastpass"),o,s=wde,c=!Xwe.jitless,u=c&&yWt.value,d=e.catchall,f;t._zod.parse=(h,m)=>{f??(f=r.value);let g=h.value;if(!s(g))return h.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),h;let A=[];if(c&&u&&m?.async===!1&&m.jitless!==!0)o||(o=n(e.shape)),h=o(h,m);else{h.value={};let b=f.shape;for(let T of f.keys){let w=b[T],R=w._zod.run({value:g[T],issues:[]},m),x=w._zod.optin==="optional"&&w._zod.optout==="optional";R instanceof Promise?A.push(R.then(P=>x?Pkn(P,h,T,g):Mtt(P,h,T))):x?Pkn(R,h,T,g):Mtt(R,h,T)}}if(!d)return A.length?Promise.all(A).then(()=>h):h;let y=[],E=f.keySet,_=d._zod,v=_.def.type;for(let b of Object.keys(g)){if(E.has(b))continue;if(v==="never"){y.push(b);continue}let T=_.run({value:g[b],issues:[]},m);T instanceof Promise?A.push(T.then(w=>Mtt(w,h,b))):Mtt(T,h,b)}return y.length&&h.issues.push({code:"unrecognized_keys",keys:y,input:g,inst:t}),A.length?Promise.all(A).then(()=>h):h}});function Dkn(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=>oT(s,n,im())))}),e}a(Dkn,"handleUnionResults");var Ftt=dt("$ZodUnion",(t,e)=>{uo.init(t,e),xc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),xc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),xc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),xc(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=>iRe(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=>Dkn(c,r,t,n)):Dkn(s,r,t,n)}}),rYt=dt("$ZodDiscriminatedUnion",(t,e)=>{Ftt.init(t,e);let r=t._zod.parse;xc(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=nRe(()=>{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(!wde(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)}}),nYt=dt("$ZodIntersection",(t,e)=>{uo.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])=>Nkn(r,u,d)):Nkn(r,s,c)}});function _zt(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(Rde(t)&&Rde(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=_zt(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{uo.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=>Ott(h,o,u))):Ott(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=>Ott(m,o,u))):Ott(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});function Ott(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(Ott,"handleTupleResult");var iYt=dt("$ZodRecord",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Rde(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(...eb(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...eb(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 new 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=>oT(d,n,im())),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(...eb(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...eb(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),oYt=dt("$ZodMap",(t,e)=>{uo.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])=>{Mkn(f,h,r,c,o,t,n)})):Mkn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function Mkn(t,e,r,n,o,s,c){t.issues.length&&(oRe.has(typeof n)?r.issues.push(...eb(n,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:o,inst:s,issues:t.issues.map(l=>oT(l,c,im()))})),e.issues.length&&(oRe.has(typeof n)?r.issues.push(...eb(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>oT(l,c,im()))})),r.value.set(t.value,e.value)}a(Mkn,"handleMapResult");var sYt=dt("$ZodSet",(t,e)=>{uo.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=>Okn(u,r))):Okn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function Okn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(Okn,"handleSetResult");var aYt=dt("$ZodEnum",(t,e)=>{uo.init(t,e);let r=rRe(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>oRe.has(typeof n)).map(n=>typeof n=="string"?EF(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}}),cYt=dt("$ZodLiteral",(t,e)=>{uo.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?EF(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}}),lYt=dt("$ZodFile",(t,e)=>{uo.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}}),ARe=dt("$ZodTransform",(t,e)=>{uo.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(c=>(r.value=c,r));if(o instanceof Promise)throw new i5;return r.value=o,r}}),uYt=dt("$ZodOptional",(t,e)=>{uo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",xc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),xc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${iRe(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)}),dYt=dt("$ZodNullable",(t,e)=>{uo.init(t,e),xc(t._zod,"optin",()=>e.innerType._zod.optin),xc(t._zod,"optout",()=>e.innerType._zod.optout),xc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${iRe(r.source)}|null)$`):void 0}),xc(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)}),fYt=dt("$ZodDefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(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=>Lkn(s,e)):Lkn(o,e)}});function Lkn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(Lkn,"handleDefaultResult");var pYt=dt("$ZodPrefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(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))}),hYt=dt("$ZodNonOptional",(t,e)=>{uo.init(t,e),xc(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=>Bkn(s,t)):Bkn(o,t)}});function Bkn(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(Bkn,"handleNonOptionalResult");var mYt=dt("$ZodSuccess",(t,e)=>{uo.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)}}),gYt=dt("$ZodCatch",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(t._zod,"optout",()=>e.innerType._zod.optout),xc(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=>oT(c,n,im()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>oT(s,n,im()))},input:r.value}),r.issues=[]),r)}}),AYt=dt("$ZodNaN",(t,e)=>{uo.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)}),yRe=dt("$ZodPipe",(t,e)=>{uo.init(t,e),xc(t._zod,"values",()=>e.in._zod.values),xc(t._zod,"optin",()=>e.in._zod.optin),xc(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=>Fkn(s,e,n)):Fkn(o,e,n)}});function Fkn(t,e,r){return DJ(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}a(Fkn,"handlePipeResult");var yYt=dt("$ZodReadonly",(t,e)=>{uo.init(t,e),xc(t._zod,"propValues",()=>e.innerType._zod.propValues),xc(t._zod,"values",()=>e.innerType._zod.values),xc(t._zod,"optin",()=>e.innerType._zod.optin),xc(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(Ukn):Ukn(o)}});function Ukn(t){return t.value=Object.freeze(t.value),t}a(Ukn,"handleReadonlyResult");var EYt=dt("$ZodTemplateLiteral",(t,e)=>{uo.init(t,e);let r=[];for(let n of e.parts)if(n instanceof uo){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||EWt.has(typeof n))r.push(EF(`${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:"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)}),_Yt=dt("$ZodPromise",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),vYt=dt("$ZodLazy",(t,e)=>{uo.init(t,e),xc(t._zod,"innerType",()=>e.getter()),xc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),xc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),xc(t._zod,"optin",()=>t._zod.innerType._zod.optin),xc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),CYt=dt("$ZodCustom",(t,e)=>{Tf.init(t,e),uo.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=>Qkn(s,r,n,t));Qkn(o,r,n,t)}});function Qkn(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(bWt(o))}}a(Qkn,"handleRefineResult");var _Re={};ki(_Re,{ar:()=>bYt,az:()=>SYt,be:()=>TYt,ca:()=>IYt,cs:()=>xYt,de:()=>wYt,en:()=>ERe,eo:()=>RYt,es:()=>kYt,fa:()=>PYt,fi:()=>DYt,fr:()=>NYt,frCA:()=>MYt,he:()=>OYt,hu:()=>LYt,id:()=>BYt,it:()=>FYt,ja:()=>UYt,kh:()=>QYt,ko:()=>qYt,mk:()=>jYt,ms:()=>HYt,nl:()=>GYt,no:()=>$Yt,ota:()=>VYt,pl:()=>zYt,ps:()=>WYt,pt:()=>YYt,ru:()=>KYt,sl:()=>JYt,sv:()=>ZYt,ta:()=>XYt,th:()=>eKt,tr:()=>tKt,ua:()=>rKt,ur:()=>nKt,vi:()=>iKt,zhCN:()=>oKt,zhTW:()=>sKt});p();p();var uis=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=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},"parsedType"),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 ${Qr(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: ${jt(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":""}: ${jt(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 bYt(){return{localeError:uis()}}a(bYt,"default");p();var dis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${jt(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":""}: ${jt(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 SYt(){return{localeError:dis()}}a(SYt,"default");p();function Gkn(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(Gkn,"getBelarusianPlural");var fis=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=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},"parsedType"),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 ${Qr(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 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Gkn(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=Gkn(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"}: ${jt(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 TYt(){return{localeError:fis()}}a(TYt,"default");p();var pis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${jt(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":""}: ${jt(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 IYt(){return{localeError:pis()}}a(IYt,"default");p();var his=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${jt(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: ${jt(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 xYt(){return{localeError:his()}}a(xYt,"default");p();var mis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${jt(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"}: ${jt(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 wYt(){return{localeError:mis()}}a(wYt,"default");p();var gis=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},"parsedType"),Ais=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,"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"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${gis(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qr(n.values[0])}`:`Invalid option: expected one of ${jt(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":""}: ${jt(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"}}},"error");function ERe(){return{localeError:Ais()}}a(ERe,"default");p();var yis=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},"parsedType"),Eis=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,"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"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${yis(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Qr(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${jt(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":""}: ${jt(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"}}},"error");function RYt(){return{localeError:Eis()}}a(RYt,"default");p();var _is=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${jt(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":""}: ${jt(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"}}},"error");function kYt(){return{localeError:_is()}}a(kYt,"default");p();var vis=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=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},"parsedType"),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 ${Qr(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 ${jt(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: ${jt(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 PYt(){return{localeError:vis()}}a(PYt,"default");p();var Cis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${jt(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"}: ${jt(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 DYt(){return{localeError:Cis()}}a(DYt,"default");p();var bis=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=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},"parsedType"),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 : ${Qr(o.values[0])} attendu`:`Option invalide : une valeur parmi ${jt(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":""} : ${jt(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 NYt(){return{localeError:bis()}}a(NYt,"default");p();var Sis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${jt(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":""} : ${jt(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 MYt(){return{localeError:Sis()}}a(MYt,"default");p();var Tis=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,"getSizing");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},"parsedType"),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 ${Qr(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 ${jt(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"}: ${jt(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"}}},"error");function OYt(){return{localeError:Tis()}}a(OYt,"default");p();var Iis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${jt(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":""}: ${jt(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 LYt(){return{localeError:Iis()}}a(LYt,"default");p();var xis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${jt(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":""}: ${jt(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 BYt(){return{localeError:xis()}}a(BYt,"default");p();var wis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Opzione non valida: atteso uno tra ${jt(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"}: ${jt(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 FYt(){return{localeError:wis()}}a(FYt,"default");p();var Ris=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=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},"parsedType"),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: ${Qr(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${jt(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":""}: ${jt(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 UYt(){return{localeError:Ris()}}a(UYt,"default");p();var kis=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=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},"parsedType"),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 ${Qr(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 ${jt(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 ${jt(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 QYt(){return{localeError:kis()}}a(QYt,"default");p();var Pis=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=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},"parsedType"),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 ${Qr(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${jt(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: ${jt(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 qYt(){return{localeError:Pis()}}a(qYt,"default");p();var Dis=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=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},"parsedType"),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 ${Qr(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 ${jt(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"}: ${jt(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 jYt(){return{localeError:Dis()}}a(jYt,"default");p();var Nis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${jt(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: ${jt(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 HYt(){return{localeError:Nis()}}a(HYt,"default");p();var Mis=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"getSizing");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},"parsedType"),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 ${Qr(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${jt(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":""}: ${jt(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 GYt(){return{localeError:Mis()}}a(GYt,"default");p();var Ois=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Ugyldig valg: forventet en av ${jt(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"}: ${jt(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 $Yt(){return{localeError:Ois()}}a($Yt,"default");p();var Lis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${jt(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":""}: ${jt(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 VYt(){return{localeError:Lis()}}a(VYt,"default");p();var Bis=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=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},"parsedType"),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 ${Qr(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${jt(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"}: ${jt(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 WYt(){return{localeError:Bis()}}a(WYt,"default");p();var Fis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${jt(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":""}: ${jt(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 zYt(){return{localeError:Fis()}}a(zYt,"default");p();var Uis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${jt(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":""}: ${jt(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 YYt(){return{localeError:Uis()}}a(YYt,"default");p();function $kn(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($kn,"getRussianPlural");var Qis=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=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},"parsedType"),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 ${Qr(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 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=$kn(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=$kn(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":""}: ${jt(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 KYt(){return{localeError:Qis()}}a(KYt,"default");p();var qis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${jt(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"}: ${jt(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 JYt(){return{localeError:qis()}}a(JYt,"default");p();var jis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${jt(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"}: ${jt(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 ZYt(){return{localeError:jis()}}a(ZYt,"default");p();var His=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=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},"parsedType"),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 ${Qr(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 ${jt(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":""}: ${jt(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 XYt(){return{localeError:His()}}a(XYt,"default");p();var Gis=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=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},"parsedType"),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 ${Qr(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 ${jt(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: ${jt(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 eKt(){return{localeError:Gis()}}a(eKt,"default");p();var $is=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},"parsedType"),Vis=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,"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"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${$is(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Qr(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${jt(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":""}: ${jt(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"}}},"error");function tKt(){return{localeError:Vis()}}a(tKt,"default");p();var Wis=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=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},"parsedType"),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 ${Qr(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 ${jt(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":""}: ${jt(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 rKt(){return{localeError:Wis()}}a(rKt,"default");p();var zis=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=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},"parsedType"),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: ${Qr(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${jt(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":""}: ${jt(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 nKt(){return{localeError:zis()}}a(nKt,"default");p();var Yis=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=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},"parsedType"),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 ${Qr(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 ${jt(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: ${jt(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 iKt(){return{localeError:Yis()}}a(iKt,"default");p();var Kis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${jt(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): ${jt(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 oKt(){return{localeError:Kis()}}a(oKt,"default");p();var Jis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${jt(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${jt(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 sKt(){return{localeError:Jis()}}a(sKt,"default");p();var aKt=Symbol("ZodOutput"),cKt=Symbol("ZodInput"),Mde=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new Map,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 new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,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)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function Utt(){return new Mde}a(Utt,"registry");var s5=Utt();p();p();function lKt(t,e){return new t({type:"string",...Tr(e)})}a(lKt,"_string");function uKt(t,e){return new t({type:"string",coerce:!0,...Tr(e)})}a(uKt,"_coercedString");function Qtt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Tr(e)})}a(Qtt,"_email");function vRe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Tr(e)})}a(vRe,"_guid");function qtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Tr(e)})}a(qtt,"_uuid");function jtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tr(e)})}a(jtt,"_uuidv4");function Htt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tr(e)})}a(Htt,"_uuidv6");function Gtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tr(e)})}a(Gtt,"_uuidv7");function $tt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Tr(e)})}a($tt,"_url");function Vtt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Tr(e)})}a(Vtt,"_emoji");function Wtt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tr(e)})}a(Wtt,"_nanoid");function ztt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Tr(e)})}a(ztt,"_cuid");function Ytt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tr(e)})}a(Ytt,"_cuid2");function Ktt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Tr(e)})}a(Ktt,"_ulid");function Jtt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Tr(e)})}a(Jtt,"_xid");function Ztt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tr(e)})}a(Ztt,"_ksuid");function Xtt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tr(e)})}a(Xtt,"_ipv4");function ert(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tr(e)})}a(ert,"_ipv6");function trt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tr(e)})}a(trt,"_cidrv4");function rrt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tr(e)})}a(rrt,"_cidrv6");function nrt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Tr(e)})}a(nrt,"_base64");function irt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Tr(e)})}a(irt,"_base64url");function ort(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Tr(e)})}a(ort,"_e164");function srt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Tr(e)})}a(srt,"_jwt");var dKt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function fKt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tr(e)})}a(fKt,"_isoDateTime");function pKt(t,e){return new t({type:"string",format:"date",check:"string_format",...Tr(e)})}a(pKt,"_isoDate");function hKt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Tr(e)})}a(hKt,"_isoTime");function mKt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Tr(e)})}a(mKt,"_isoDuration");function gKt(t,e){return new t({type:"number",checks:[],...Tr(e)})}a(gKt,"_number");function AKt(t,e){return new t({type:"number",coerce:!0,checks:[],...Tr(e)})}a(AKt,"_coercedNumber");function yKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Tr(e)})}a(yKt,"_int");function EKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Tr(e)})}a(EKt,"_float32");function _Kt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Tr(e)})}a(_Kt,"_float64");function vKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Tr(e)})}a(vKt,"_int32");function CKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Tr(e)})}a(CKt,"_uint32");function bKt(t,e){return new t({type:"boolean",...Tr(e)})}a(bKt,"_boolean");function SKt(t,e){return new t({type:"boolean",coerce:!0,...Tr(e)})}a(SKt,"_coercedBoolean");function TKt(t,e){return new t({type:"bigint",...Tr(e)})}a(TKt,"_bigint");function IKt(t,e){return new t({type:"bigint",coerce:!0,...Tr(e)})}a(IKt,"_coercedBigint");function xKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Tr(e)})}a(xKt,"_int64");function wKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Tr(e)})}a(wKt,"_uint64");function RKt(t,e){return new t({type:"symbol",...Tr(e)})}a(RKt,"_symbol");function kKt(t,e){return new t({type:"undefined",...Tr(e)})}a(kKt,"_undefined");function PKt(t,e){return new t({type:"null",...Tr(e)})}a(PKt,"_null");function DKt(t){return new t({type:"any"})}a(DKt,"_any");function Ode(t){return new t({type:"unknown"})}a(Ode,"_unknown");function NKt(t,e){return new t({type:"never",...Tr(e)})}a(NKt,"_never");function MKt(t,e){return new t({type:"void",...Tr(e)})}a(MKt,"_void");function OKt(t,e){return new t({type:"date",...Tr(e)})}a(OKt,"_date");function LKt(t,e){return new t({type:"date",coerce:!0,...Tr(e)})}a(LKt,"_coercedDate");function BKt(t,e){return new t({type:"nan",...Tr(e)})}a(BKt,"_nan");function _F(t,e){return new Dtt({check:"less_than",...Tr(e),value:t,inclusive:!1})}a(_F,"_lt");function yw(t,e){return new Dtt({check:"less_than",...Tr(e),value:t,inclusive:!0})}a(yw,"_lte");function vF(t,e){return new Ntt({check:"greater_than",...Tr(e),value:t,inclusive:!1})}a(vF,"_gt");function tb(t,e){return new Ntt({check:"greater_than",...Tr(e),value:t,inclusive:!0})}a(tb,"_gte");function FKt(t){return vF(0,t)}a(FKt,"_positive");function UKt(t){return _F(0,t)}a(UKt,"_negative");function QKt(t){return yw(0,t)}a(QKt,"_nonpositive");function qKt(t){return tb(0,t)}a(qKt,"_nonnegative");function BJ(t,e){return new tzt({check:"multiple_of",...Tr(e),value:t})}a(BJ,"_multipleOf");function Lde(t,e){return new izt({check:"max_size",...Tr(e),maximum:t})}a(Lde,"_maxSize");function FJ(t,e){return new ozt({check:"min_size",...Tr(e),minimum:t})}a(FJ,"_minSize");function CRe(t,e){return new szt({check:"size_equals",...Tr(e),size:t})}a(CRe,"_size");function Bde(t,e){return new azt({check:"max_length",...Tr(e),maximum:t})}a(Bde,"_maxLength");function tj(t,e){return new czt({check:"min_length",...Tr(e),minimum:t})}a(tj,"_minLength");function Fde(t,e){return new lzt({check:"length_equals",...Tr(e),length:t})}a(Fde,"_length");function bRe(t,e){return new uzt({check:"string_format",format:"regex",...Tr(e),pattern:t})}a(bRe,"_regex");function SRe(t){return new dzt({check:"string_format",format:"lowercase",...Tr(t)})}a(SRe,"_lowercase");function TRe(t){return new fzt({check:"string_format",format:"uppercase",...Tr(t)})}a(TRe,"_uppercase");function IRe(t,e){return new pzt({check:"string_format",format:"includes",...Tr(e),includes:t})}a(IRe,"_includes");function xRe(t,e){return new hzt({check:"string_format",format:"starts_with",...Tr(e),prefix:t})}a(xRe,"_startsWith");function wRe(t,e){return new mzt({check:"string_format",format:"ends_with",...Tr(e),suffix:t})}a(wRe,"_endsWith");function jKt(t,e,r){return new gzt({check:"property",property:t,schema:e,...Tr(r)})}a(jKt,"_property");function RRe(t,e){return new Azt({check:"mime_type",mime:t,...Tr(e)})}a(RRe,"_mime");function CF(t){return new yzt({check:"overwrite",tx:t})}a(CF,"_overwrite");function kRe(t){return CF(e=>e.normalize(t))}a(kRe,"_normalize");function PRe(){return CF(t=>t.trim())}a(PRe,"_trim");function DRe(){return CF(t=>t.toLowerCase())}a(DRe,"_toLowerCase");function NRe(){return CF(t=>t.toUpperCase())}a(NRe,"_toUpperCase");function MRe(t,e,r){return new t({type:"array",element:e,...Tr(r)})}a(MRe,"_array");function Zis(t,e,r){return new t({type:"union",options:e,...Tr(r)})}a(Zis,"_union");function Xis(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Tr(n)})}a(Xis,"_discriminatedUnion");function eos(t,e,r){return new t({type:"intersection",left:e,right:r})}a(eos,"_intersection");function HKt(t,e,r,n){let o=r instanceof uo,s=o?n:r,c=o?r:null;return new t({type:"tuple",items:e,rest:c,...Tr(s)})}a(HKt,"_tuple");function tos(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Tr(n)})}a(tos,"_record");function ros(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Tr(n)})}a(ros,"_map");function nos(t,e,r){return new t({type:"set",valueType:e,...Tr(r)})}a(nos,"_set");function ios(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Tr(r)})}a(ios,"_enum");function oos(t,e,r){return new t({type:"enum",entries:e,...Tr(r)})}a(oos,"_nativeEnum");function sos(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Tr(r)})}a(sos,"_literal");function GKt(t,e){return new t({type:"file",...Tr(e)})}a(GKt,"_file");function aos(t,e){return new t({type:"transform",transform:e})}a(aos,"_transform");function cos(t,e){return new t({type:"optional",innerType:e})}a(cos,"_optional");function los(t,e){return new t({type:"nullable",innerType:e})}a(los,"_nullable");function uos(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}a(uos,"_default");function dos(t,e,r){return new t({type:"nonoptional",innerType:e,...Tr(r)})}a(dos,"_nonoptional");function fos(t,e){return new t({type:"success",innerType:e})}a(fos,"_success");function pos(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(pos,"_catch");function hos(t,e,r){return new t({type:"pipe",in:e,out:r})}a(hos,"_pipe");function mos(t,e){return new t({type:"readonly",innerType:e})}a(mos,"_readonly");function gos(t,e,r){return new t({type:"template_literal",parts:e,...Tr(r)})}a(gos,"_templateLiteral");function Aos(t,e){return new t({type:"lazy",getter:e})}a(Aos,"_lazy");function yos(t,e){return new t({type:"promise",innerType:e})}a(yos,"_promise");function $Kt(t,e,r){let n=Tr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a($Kt,"_custom");function VKt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Tr(r)})}a(VKt,"_refine");function WKt(t,e){let r=Tr(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(A=>typeof A=="string"?A.toLowerCase():A),o=o.map(A=>typeof A=="string"?A.toLowerCase():A));let s=new Set(n),c=new Set(o),l=t.Pipe??yRe,u=t.Boolean??mRe,d=t.String??OJ,f=t.Transform??ARe,h=new f({type:"transform",transform:a((A,y)=>{let E=A;return r.case!=="sensitive"&&(E=E.toLowerCase()),s.has(E)?!0:c.has(E)?!1:(y.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:y.value,inst:h}),{})},"transform"),error:r.error}),m=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:h,error:r.error});return new l({type:"pipe",in:m,out:new u({type:"boolean",error:r.error}),error:r.error})}a(WKt,"_stringbool");function zKt(t,e,r,n={}){let o=Tr(n),s={...Tr(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(zKt,"_stringFormat");var art=class{static{a(this,"$ZodFunction")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a(((...n)=>{let o=this._def.input?dRe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?dRe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}implementAsync(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a((async(...n)=>{let o=this._def.input?await fRe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?fRe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new LJ({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){let r=this.constructor;return new r({type:"function",input:this._def.input,output:e})}};function YKt(t){return new art({type:"function",input:Array.isArray(t?.input)?HKt(LJ,t?.input):t?.input??MRe(gRe,Ode(Nde)),output:t?.output??Ode(Nde)})}a(YKt,"_function");p();var ORe=class{static{a(this,"JSONSchemaGenerator")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??s5,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 h={...r,schemaPath:[...r.schemaPath,e],path:r.path},m=e._zod.parent;if(m)l.ref=m,this.process(m,h),this.seen.get(m).isParent=!0;else{let g=l.schema;switch(o.type){case"string":{let A=g;A.type="string";let{minimum:y,maximum:E,format:_,patterns:v,contentEncoding:b}=e._zod.bag;if(typeof y=="number"&&(A.minLength=y),typeof E=="number"&&(A.maxLength=E),_&&(A.format=s[_]??_,A.format===""&&delete A.format),b&&(A.contentEncoding=b),v&&v.size>0){let T=[...v];T.length===1?A.pattern=T[0].source:T.length>1&&(l.schema.allOf=[...T.map(w=>({...this.target==="draft-7"?{type:"string"}:{},pattern:w.source}))])}break}case"number":{let A=g,{minimum:y,maximum:E,format:_,multipleOf:v,exclusiveMaximum:b,exclusiveMinimum:T}=e._zod.bag;typeof _=="string"&&_.includes("int")?A.type="integer":A.type="number",typeof T=="number"&&(A.exclusiveMinimum=T),typeof y=="number"&&(A.minimum=y,typeof T=="number"&&(T>=y?delete A.minimum:delete A.exclusiveMinimum)),typeof b=="number"&&(A.exclusiveMaximum=b),typeof E=="number"&&(A.maximum=E,typeof b=="number"&&(b<=E?delete A.maximum:delete A.exclusiveMaximum)),typeof v=="number"&&(A.multipleOf=v);break}case"boolean":{let A=g;A.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{g.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{g.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let A=g,{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(A.minItems=y),typeof E=="number"&&(A.maxItems=E),A.type="array",A.items=this.process(o.element,{...h,path:[...h.path,"items"]});break}case"object":{let A=g;A.type="object",A.properties={};let y=o.shape;for(let v in y)A.properties[v]=this.process(y[v],{...h,path:[...h.path,"properties",v]});let E=new Set(Object.keys(y)),_=new Set([...E].filter(v=>{let b=o.shape[v]._zod;return this.io==="input"?b.optin===void 0:b.optout===void 0}));_.size>0&&(A.required=Array.from(_)),o.catchall?._zod.def.type==="never"?A.additionalProperties=!1:o.catchall?o.catchall&&(A.additionalProperties=this.process(o.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(A.additionalProperties=!1);break}case"union":{let A=g;A.anyOf=o.options.map((y,E)=>this.process(y,{...h,path:[...h.path,"anyOf",E]}));break}case"intersection":{let A=g,y=this.process(o.left,{...h,path:[...h.path,"allOf",0]}),E=this.process(o.right,{...h,path:[...h.path,"allOf",1]}),_=a(b=>"allOf"in b&&Object.keys(b).length===1,"isSimpleIntersection"),v=[..._(y)?y.allOf:[y],..._(E)?E.allOf:[E]];A.allOf=v;break}case"tuple":{let A=g;A.type="array";let y=o.items.map((v,b)=>this.process(v,{...h,path:[...h.path,"prefixItems",b]}));if(this.target==="draft-2020-12"?A.prefixItems=y:A.items=y,o.rest){let v=this.process(o.rest,{...h,path:[...h.path,"items"]});this.target==="draft-2020-12"?A.items=v:A.additionalItems=v}o.rest&&(A.items=this.process(o.rest,{...h,path:[...h.path,"items"]}));let{minimum:E,maximum:_}=e._zod.bag;typeof E=="number"&&(A.minItems=E),typeof _=="number"&&(A.maxItems=_);break}case"record":{let A=g;A.type="object",A.propertyNames=this.process(o.keyType,{...h,path:[...h.path,"propertyNames"]}),A.additionalProperties=this.process(o.valueType,{...h,path:[...h.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let A=g,y=rRe(o.entries);y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),A.enum=y;break}case"literal":{let A=g,y=[];for(let E of o.values)if(E===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof E=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(E))}else y.push(E);if(y.length!==0)if(y.length===1){let E=y[0];A.type=E===null?"null":typeof E,A.const=E}else y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),y.every(E=>typeof E=="boolean")&&(A.type="string"),y.every(E=>E===null)&&(A.type="null"),A.enum=y;break}case"file":{let A=g,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:E,maximum:_,mime:v}=e._zod.bag;E!==void 0&&(y.minLength=E),_!==void 0&&(y.maxLength=_),v?v.length===1?(y.contentMediaType=v[0],Object.assign(A,y)):A.anyOf=v.map(b=>({...y,contentMediaType:b})):Object.assign(A,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let A=this.process(o.innerType,h);g.anyOf=[A,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"success":{let A=g;A.type="boolean";break}case"default":{this.process(o.innerType,h),l.ref=o.innerType,g.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,h),l.ref=o.innerType,this.io==="input"&&(g._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,h),l.ref=o.innerType;let A;try{A=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}g.default=A;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let A=g,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");A.type="string",A.pattern=y.source;break}case"pipe":{let A=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(A,h),l.ref=A;break}case"readonly":{this.process(o.innerType,h),l.ref=o.innerType,g.readOnly=!0;break}case"promise":{this.process(o.innerType,h),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"lazy":{let A=e._zod.innerType;this.process(A,h),l.ref=A;break}case"custom":{if(this.unrepresentable==="throw")throw new 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"&&g0(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 new 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 y=n.external.registry.get(f[0])?.id,E=n.external.uri??(v=>v);if(y)return{ref:E(y)};let _=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=_,{defId:_,ref:`${E("__shared")}#/${h}/${_}`}}if(f[1]===o)return{ref:"#"};let g=`#/${h}/`,A=f[1].schema.id??`__schema${this.counter++}`;return{defId:A,ref:g+A}},"makeURI"),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},"extractToDef");if(n.cycles==="throw")for(let f of this.seen.entries()){let h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/ + })));`),m.write(`newResult[${PJ(v)}] = ${b}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,b)=>_(h,v,b)},"generateFastpass"),o,s=wde,c=!Xwe.jitless,u=c&&EWt.value,d=e.catchall,f;t._zod.parse=(h,m)=>{f??(f=r.value);let g=h.value;if(!s(g))return h.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),h;let A=[];if(c&&u&&m?.async===!1&&m.jitless!==!0)o||(o=n(e.shape)),h=o(h,m);else{h.value={};let b=f.shape;for(let T of f.keys){let w=b[T],R=w._zod.run({value:g[T],issues:[]},m),x=w._zod.optin==="optional"&&w._zod.optout==="optional";R instanceof Promise?A.push(R.then(P=>x?Dkn(P,h,T,g):Btt(P,h,T))):x?Dkn(R,h,T,g):Btt(R,h,T)}}if(!d)return A.length?Promise.all(A).then(()=>h):h;let y=[],E=f.keySet,_=d._zod,v=_.def.type;for(let b of Object.keys(g)){if(E.has(b))continue;if(v==="never"){y.push(b);continue}let T=_.run({value:g[b],issues:[]},m);T instanceof Promise?A.push(T.then(w=>Btt(w,h,b))):Btt(T,h,b)}return y.length&&h.issues.push({code:"unrecognized_keys",keys:y,input:g,inst:t}),A.length?Promise.all(A).then(()=>h):h}});function Nkn(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=>aT(s,n,im())))}),e}a(Nkn,"handleUnionResults");var qtt=dt("$ZodUnion",(t,e)=>{uo.init(t,e),xc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),xc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),xc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),xc(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=>iRe(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=>Nkn(c,r,t,n)):Nkn(s,r,t,n)}}),nYt=dt("$ZodDiscriminatedUnion",(t,e)=>{qtt.init(t,e);let r=t._zod.parse;xc(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=nRe(()=>{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(!wde(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)}}),iYt=dt("$ZodIntersection",(t,e)=>{uo.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])=>Mkn(r,u,d)):Mkn(r,s,c)}});function vzt(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(Rde(t)&&Rde(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=vzt(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{uo.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=>Ftt(h,o,u))):Ftt(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=>Ftt(m,o,u))):Ftt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});function Ftt(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(Ftt,"handleTupleResult");var oYt=dt("$ZodRecord",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Rde(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(...eb(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...eb(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 new 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=>aT(d,n,im())),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(...eb(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...eb(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),sYt=dt("$ZodMap",(t,e)=>{uo.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])=>{Okn(f,h,r,c,o,t,n)})):Okn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function Okn(t,e,r,n,o,s,c){t.issues.length&&(oRe.has(typeof n)?r.issues.push(...eb(n,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:o,inst:s,issues:t.issues.map(l=>aT(l,c,im()))})),e.issues.length&&(oRe.has(typeof n)?r.issues.push(...eb(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>aT(l,c,im()))})),r.value.set(t.value,e.value)}a(Okn,"handleMapResult");var aYt=dt("$ZodSet",(t,e)=>{uo.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=>Lkn(u,r))):Lkn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function Lkn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(Lkn,"handleSetResult");var cYt=dt("$ZodEnum",(t,e)=>{uo.init(t,e);let r=rRe(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>oRe.has(typeof n)).map(n=>typeof n=="string"?_F(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}}),lYt=dt("$ZodLiteral",(t,e)=>{uo.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?_F(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}}),uYt=dt("$ZodFile",(t,e)=>{uo.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}}),ARe=dt("$ZodTransform",(t,e)=>{uo.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(c=>(r.value=c,r));if(o instanceof Promise)throw new i5;return r.value=o,r}}),dYt=dt("$ZodOptional",(t,e)=>{uo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",xc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),xc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${iRe(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)}),fYt=dt("$ZodNullable",(t,e)=>{uo.init(t,e),xc(t._zod,"optin",()=>e.innerType._zod.optin),xc(t._zod,"optout",()=>e.innerType._zod.optout),xc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${iRe(r.source)}|null)$`):void 0}),xc(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)}),pYt=dt("$ZodDefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(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=>Bkn(s,e)):Bkn(o,e)}});function Bkn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(Bkn,"handleDefaultResult");var hYt=dt("$ZodPrefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(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))}),mYt=dt("$ZodNonOptional",(t,e)=>{uo.init(t,e),xc(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=>Fkn(s,t)):Fkn(o,t)}});function Fkn(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(Fkn,"handleNonOptionalResult");var gYt=dt("$ZodSuccess",(t,e)=>{uo.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)}}),AYt=dt("$ZodCatch",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(t._zod,"optout",()=>e.innerType._zod.optout),xc(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=>aT(c,n,im()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>aT(s,n,im()))},input:r.value}),r.issues=[]),r)}}),yYt=dt("$ZodNaN",(t,e)=>{uo.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)}),yRe=dt("$ZodPipe",(t,e)=>{uo.init(t,e),xc(t._zod,"values",()=>e.in._zod.values),xc(t._zod,"optin",()=>e.in._zod.optin),xc(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=>Ukn(s,e,n)):Ukn(o,e,n)}});function Ukn(t,e,r){return DJ(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}a(Ukn,"handlePipeResult");var EYt=dt("$ZodReadonly",(t,e)=>{uo.init(t,e),xc(t._zod,"propValues",()=>e.innerType._zod.propValues),xc(t._zod,"values",()=>e.innerType._zod.values),xc(t._zod,"optin",()=>e.innerType._zod.optin),xc(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(Qkn):Qkn(o)}});function Qkn(t){return t.value=Object.freeze(t.value),t}a(Qkn,"handleReadonlyResult");var _Yt=dt("$ZodTemplateLiteral",(t,e)=>{uo.init(t,e);let r=[];for(let n of e.parts)if(n instanceof uo){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||_Wt.has(typeof n))r.push(_F(`${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:"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)}),vYt=dt("$ZodPromise",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),CYt=dt("$ZodLazy",(t,e)=>{uo.init(t,e),xc(t._zod,"innerType",()=>e.getter()),xc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),xc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),xc(t._zod,"optin",()=>t._zod.innerType._zod.optin),xc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),bYt=dt("$ZodCustom",(t,e)=>{Tf.init(t,e),uo.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=>qkn(s,r,n,t));qkn(o,r,n,t)}});function qkn(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(SWt(o))}}a(qkn,"handleRefineResult");var _Re={};ki(_Re,{ar:()=>SYt,az:()=>TYt,be:()=>IYt,ca:()=>xYt,cs:()=>wYt,de:()=>RYt,en:()=>ERe,eo:()=>kYt,es:()=>PYt,fa:()=>DYt,fi:()=>NYt,fr:()=>MYt,frCA:()=>OYt,he:()=>LYt,hu:()=>BYt,id:()=>FYt,it:()=>UYt,ja:()=>QYt,kh:()=>qYt,ko:()=>jYt,mk:()=>HYt,ms:()=>GYt,nl:()=>$Yt,no:()=>VYt,ota:()=>WYt,pl:()=>YYt,ps:()=>zYt,pt:()=>KYt,ru:()=>JYt,sl:()=>ZYt,sv:()=>XYt,ta:()=>eKt,th:()=>tKt,tr:()=>rKt,ua:()=>nKt,ur:()=>iKt,vi:()=>oKt,zhCN:()=>sKt,zhTW:()=>aKt});p();p();var mis=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=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},"parsedType"),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 ${Qr(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: ${jt(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":""}: ${jt(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 SYt(){return{localeError:mis()}}a(SYt,"default");p();var gis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${jt(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":""}: ${jt(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 TYt(){return{localeError:gis()}}a(TYt,"default");p();function $kn(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($kn,"getBelarusianPlural");var Ais=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=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},"parsedType"),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 ${Qr(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 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=$kn(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=$kn(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"}: ${jt(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 IYt(){return{localeError:Ais()}}a(IYt,"default");p();var yis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${jt(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":""}: ${jt(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 xYt(){return{localeError:yis()}}a(xYt,"default");p();var Eis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${jt(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: ${jt(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 wYt(){return{localeError:Eis()}}a(wYt,"default");p();var _is=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${jt(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"}: ${jt(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 RYt(){return{localeError:_is()}}a(RYt,"default");p();var vis=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},"parsedType"),Cis=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,"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"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${vis(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qr(n.values[0])}`:`Invalid option: expected one of ${jt(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":""}: ${jt(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"}}},"error");function ERe(){return{localeError:Cis()}}a(ERe,"default");p();var bis=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},"parsedType"),Sis=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,"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"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${bis(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Qr(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${jt(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":""}: ${jt(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"}}},"error");function kYt(){return{localeError:Sis()}}a(kYt,"default");p();var Tis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${jt(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":""}: ${jt(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"}}},"error");function PYt(){return{localeError:Tis()}}a(PYt,"default");p();var Iis=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=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},"parsedType"),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 ${Qr(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 ${jt(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: ${jt(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 DYt(){return{localeError:Iis()}}a(DYt,"default");p();var xis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${jt(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"}: ${jt(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 NYt(){return{localeError:xis()}}a(NYt,"default");p();var wis=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=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},"parsedType"),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 : ${Qr(o.values[0])} attendu`:`Option invalide : une valeur parmi ${jt(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":""} : ${jt(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 MYt(){return{localeError:wis()}}a(MYt,"default");p();var Ris=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${jt(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":""} : ${jt(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 OYt(){return{localeError:Ris()}}a(OYt,"default");p();var kis=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,"getSizing");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},"parsedType"),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 ${Qr(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 ${jt(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"}: ${jt(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"}}},"error");function LYt(){return{localeError:kis()}}a(LYt,"default");p();var Pis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${jt(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":""}: ${jt(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 BYt(){return{localeError:Pis()}}a(BYt,"default");p();var Dis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${jt(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":""}: ${jt(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 FYt(){return{localeError:Dis()}}a(FYt,"default");p();var Nis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Opzione non valida: atteso uno tra ${jt(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"}: ${jt(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 UYt(){return{localeError:Nis()}}a(UYt,"default");p();var Mis=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=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},"parsedType"),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: ${Qr(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${jt(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":""}: ${jt(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 QYt(){return{localeError:Mis()}}a(QYt,"default");p();var Ois=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=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},"parsedType"),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 ${Qr(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 ${jt(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 ${jt(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 qYt(){return{localeError:Ois()}}a(qYt,"default");p();var Lis=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=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},"parsedType"),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 ${Qr(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${jt(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: ${jt(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 jYt(){return{localeError:Lis()}}a(jYt,"default");p();var Bis=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=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},"parsedType"),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 ${Qr(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 ${jt(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"}: ${jt(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 HYt(){return{localeError:Bis()}}a(HYt,"default");p();var Fis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${jt(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: ${jt(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 GYt(){return{localeError:Fis()}}a(GYt,"default");p();var Uis=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"getSizing");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},"parsedType"),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 ${Qr(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${jt(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":""}: ${jt(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 $Yt(){return{localeError:Uis()}}a($Yt,"default");p();var Qis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Ugyldig valg: forventet en av ${jt(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"}: ${jt(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 VYt(){return{localeError:Qis()}}a(VYt,"default");p();var qis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${jt(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":""}: ${jt(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 WYt(){return{localeError:qis()}}a(WYt,"default");p();var jis=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=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},"parsedType"),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 ${Qr(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${jt(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"}: ${jt(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 zYt(){return{localeError:jis()}}a(zYt,"default");p();var His=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${jt(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":""}: ${jt(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 YYt(){return{localeError:His()}}a(YYt,"default");p();var Gis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${jt(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":""}: ${jt(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 KYt(){return{localeError:Gis()}}a(KYt,"default");p();function Vkn(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(Vkn,"getRussianPlural");var $is=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=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},"parsedType"),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 ${Qr(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 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Vkn(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=Vkn(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":""}: ${jt(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 JYt(){return{localeError:$is()}}a(JYt,"default");p();var Vis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${jt(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"}: ${jt(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 ZYt(){return{localeError:Vis()}}a(ZYt,"default");p();var Wis=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${jt(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"}: ${jt(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 XYt(){return{localeError:Wis()}}a(XYt,"default");p();var zis=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=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},"parsedType"),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 ${Qr(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 ${jt(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":""}: ${jt(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 eKt(){return{localeError:zis()}}a(eKt,"default");p();var Yis=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=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},"parsedType"),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 ${Qr(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 ${jt(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: ${jt(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 tKt(){return{localeError:Yis()}}a(tKt,"default");p();var Kis=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},"parsedType"),Jis=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,"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"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${Kis(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Qr(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${jt(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":""}: ${jt(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"}}},"error");function rKt(){return{localeError:Jis()}}a(rKt,"default");p();var Zis=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=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},"parsedType"),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 ${Qr(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 ${jt(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":""}: ${jt(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 nKt(){return{localeError:Zis()}}a(nKt,"default");p();var Xis=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=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},"parsedType"),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: ${Qr(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${jt(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":""}: ${jt(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 iKt(){return{localeError:Xis()}}a(iKt,"default");p();var eos=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=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},"parsedType"),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 ${Qr(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 ${jt(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: ${jt(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 oKt(){return{localeError:eos()}}a(oKt,"default");p();var tos=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${jt(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): ${jt(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 sKt(){return{localeError:tos()}}a(sKt,"default");p();var ros=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=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},"parsedType"),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 ${Qr(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${jt(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${jt(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 aKt(){return{localeError:ros()}}a(aKt,"default");p();var cKt=Symbol("ZodOutput"),lKt=Symbol("ZodInput"),Mde=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new Map,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 new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,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)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function jtt(){return new Mde}a(jtt,"registry");var s5=jtt();p();p();function uKt(t,e){return new t({type:"string",...Tr(e)})}a(uKt,"_string");function dKt(t,e){return new t({type:"string",coerce:!0,...Tr(e)})}a(dKt,"_coercedString");function Htt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Tr(e)})}a(Htt,"_email");function vRe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Tr(e)})}a(vRe,"_guid");function Gtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Tr(e)})}a(Gtt,"_uuid");function $tt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tr(e)})}a($tt,"_uuidv4");function Vtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tr(e)})}a(Vtt,"_uuidv6");function Wtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tr(e)})}a(Wtt,"_uuidv7");function ztt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Tr(e)})}a(ztt,"_url");function Ytt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Tr(e)})}a(Ytt,"_emoji");function Ktt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tr(e)})}a(Ktt,"_nanoid");function Jtt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Tr(e)})}a(Jtt,"_cuid");function Ztt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tr(e)})}a(Ztt,"_cuid2");function Xtt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Tr(e)})}a(Xtt,"_ulid");function ert(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Tr(e)})}a(ert,"_xid");function trt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tr(e)})}a(trt,"_ksuid");function rrt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tr(e)})}a(rrt,"_ipv4");function nrt(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tr(e)})}a(nrt,"_ipv6");function irt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tr(e)})}a(irt,"_cidrv4");function ort(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tr(e)})}a(ort,"_cidrv6");function srt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Tr(e)})}a(srt,"_base64");function art(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Tr(e)})}a(art,"_base64url");function crt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Tr(e)})}a(crt,"_e164");function lrt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Tr(e)})}a(lrt,"_jwt");var fKt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function pKt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tr(e)})}a(pKt,"_isoDateTime");function hKt(t,e){return new t({type:"string",format:"date",check:"string_format",...Tr(e)})}a(hKt,"_isoDate");function mKt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Tr(e)})}a(mKt,"_isoTime");function gKt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Tr(e)})}a(gKt,"_isoDuration");function AKt(t,e){return new t({type:"number",checks:[],...Tr(e)})}a(AKt,"_number");function yKt(t,e){return new t({type:"number",coerce:!0,checks:[],...Tr(e)})}a(yKt,"_coercedNumber");function EKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Tr(e)})}a(EKt,"_int");function _Kt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Tr(e)})}a(_Kt,"_float32");function vKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Tr(e)})}a(vKt,"_float64");function CKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Tr(e)})}a(CKt,"_int32");function bKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Tr(e)})}a(bKt,"_uint32");function SKt(t,e){return new t({type:"boolean",...Tr(e)})}a(SKt,"_boolean");function TKt(t,e){return new t({type:"boolean",coerce:!0,...Tr(e)})}a(TKt,"_coercedBoolean");function IKt(t,e){return new t({type:"bigint",...Tr(e)})}a(IKt,"_bigint");function xKt(t,e){return new t({type:"bigint",coerce:!0,...Tr(e)})}a(xKt,"_coercedBigint");function wKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Tr(e)})}a(wKt,"_int64");function RKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Tr(e)})}a(RKt,"_uint64");function kKt(t,e){return new t({type:"symbol",...Tr(e)})}a(kKt,"_symbol");function PKt(t,e){return new t({type:"undefined",...Tr(e)})}a(PKt,"_undefined");function DKt(t,e){return new t({type:"null",...Tr(e)})}a(DKt,"_null");function NKt(t){return new t({type:"any"})}a(NKt,"_any");function Ode(t){return new t({type:"unknown"})}a(Ode,"_unknown");function MKt(t,e){return new t({type:"never",...Tr(e)})}a(MKt,"_never");function OKt(t,e){return new t({type:"void",...Tr(e)})}a(OKt,"_void");function LKt(t,e){return new t({type:"date",...Tr(e)})}a(LKt,"_date");function BKt(t,e){return new t({type:"date",coerce:!0,...Tr(e)})}a(BKt,"_coercedDate");function FKt(t,e){return new t({type:"nan",...Tr(e)})}a(FKt,"_nan");function vF(t,e){return new Ott({check:"less_than",...Tr(e),value:t,inclusive:!1})}a(vF,"_lt");function Ew(t,e){return new Ott({check:"less_than",...Tr(e),value:t,inclusive:!0})}a(Ew,"_lte");function CF(t,e){return new Ltt({check:"greater_than",...Tr(e),value:t,inclusive:!1})}a(CF,"_gt");function tb(t,e){return new Ltt({check:"greater_than",...Tr(e),value:t,inclusive:!0})}a(tb,"_gte");function UKt(t){return CF(0,t)}a(UKt,"_positive");function QKt(t){return vF(0,t)}a(QKt,"_negative");function qKt(t){return Ew(0,t)}a(qKt,"_nonpositive");function jKt(t){return tb(0,t)}a(jKt,"_nonnegative");function BJ(t,e){return new rzt({check:"multiple_of",...Tr(e),value:t})}a(BJ,"_multipleOf");function Lde(t,e){return new ozt({check:"max_size",...Tr(e),maximum:t})}a(Lde,"_maxSize");function FJ(t,e){return new szt({check:"min_size",...Tr(e),minimum:t})}a(FJ,"_minSize");function CRe(t,e){return new azt({check:"size_equals",...Tr(e),size:t})}a(CRe,"_size");function Bde(t,e){return new czt({check:"max_length",...Tr(e),maximum:t})}a(Bde,"_maxLength");function rj(t,e){return new lzt({check:"min_length",...Tr(e),minimum:t})}a(rj,"_minLength");function Fde(t,e){return new uzt({check:"length_equals",...Tr(e),length:t})}a(Fde,"_length");function bRe(t,e){return new dzt({check:"string_format",format:"regex",...Tr(e),pattern:t})}a(bRe,"_regex");function SRe(t){return new fzt({check:"string_format",format:"lowercase",...Tr(t)})}a(SRe,"_lowercase");function TRe(t){return new pzt({check:"string_format",format:"uppercase",...Tr(t)})}a(TRe,"_uppercase");function IRe(t,e){return new hzt({check:"string_format",format:"includes",...Tr(e),includes:t})}a(IRe,"_includes");function xRe(t,e){return new mzt({check:"string_format",format:"starts_with",...Tr(e),prefix:t})}a(xRe,"_startsWith");function wRe(t,e){return new gzt({check:"string_format",format:"ends_with",...Tr(e),suffix:t})}a(wRe,"_endsWith");function HKt(t,e,r){return new Azt({check:"property",property:t,schema:e,...Tr(r)})}a(HKt,"_property");function RRe(t,e){return new yzt({check:"mime_type",mime:t,...Tr(e)})}a(RRe,"_mime");function bF(t){return new Ezt({check:"overwrite",tx:t})}a(bF,"_overwrite");function kRe(t){return bF(e=>e.normalize(t))}a(kRe,"_normalize");function PRe(){return bF(t=>t.trim())}a(PRe,"_trim");function DRe(){return bF(t=>t.toLowerCase())}a(DRe,"_toLowerCase");function NRe(){return bF(t=>t.toUpperCase())}a(NRe,"_toUpperCase");function MRe(t,e,r){return new t({type:"array",element:e,...Tr(r)})}a(MRe,"_array");function nos(t,e,r){return new t({type:"union",options:e,...Tr(r)})}a(nos,"_union");function ios(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Tr(n)})}a(ios,"_discriminatedUnion");function oos(t,e,r){return new t({type:"intersection",left:e,right:r})}a(oos,"_intersection");function GKt(t,e,r,n){let o=r instanceof uo,s=o?n:r,c=o?r:null;return new t({type:"tuple",items:e,rest:c,...Tr(s)})}a(GKt,"_tuple");function sos(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Tr(n)})}a(sos,"_record");function aos(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Tr(n)})}a(aos,"_map");function cos(t,e,r){return new t({type:"set",valueType:e,...Tr(r)})}a(cos,"_set");function los(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Tr(r)})}a(los,"_enum");function uos(t,e,r){return new t({type:"enum",entries:e,...Tr(r)})}a(uos,"_nativeEnum");function dos(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Tr(r)})}a(dos,"_literal");function $Kt(t,e){return new t({type:"file",...Tr(e)})}a($Kt,"_file");function fos(t,e){return new t({type:"transform",transform:e})}a(fos,"_transform");function pos(t,e){return new t({type:"optional",innerType:e})}a(pos,"_optional");function hos(t,e){return new t({type:"nullable",innerType:e})}a(hos,"_nullable");function mos(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}a(mos,"_default");function gos(t,e,r){return new t({type:"nonoptional",innerType:e,...Tr(r)})}a(gos,"_nonoptional");function Aos(t,e){return new t({type:"success",innerType:e})}a(Aos,"_success");function yos(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(yos,"_catch");function Eos(t,e,r){return new t({type:"pipe",in:e,out:r})}a(Eos,"_pipe");function _os(t,e){return new t({type:"readonly",innerType:e})}a(_os,"_readonly");function vos(t,e,r){return new t({type:"template_literal",parts:e,...Tr(r)})}a(vos,"_templateLiteral");function Cos(t,e){return new t({type:"lazy",getter:e})}a(Cos,"_lazy");function bos(t,e){return new t({type:"promise",innerType:e})}a(bos,"_promise");function VKt(t,e,r){let n=Tr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a(VKt,"_custom");function WKt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Tr(r)})}a(WKt,"_refine");function zKt(t,e){let r=Tr(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(A=>typeof A=="string"?A.toLowerCase():A),o=o.map(A=>typeof A=="string"?A.toLowerCase():A));let s=new Set(n),c=new Set(o),l=t.Pipe??yRe,u=t.Boolean??mRe,d=t.String??OJ,f=t.Transform??ARe,h=new f({type:"transform",transform:a((A,y)=>{let E=A;return r.case!=="sensitive"&&(E=E.toLowerCase()),s.has(E)?!0:c.has(E)?!1:(y.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:y.value,inst:h}),{})},"transform"),error:r.error}),m=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:h,error:r.error});return new l({type:"pipe",in:m,out:new u({type:"boolean",error:r.error}),error:r.error})}a(zKt,"_stringbool");function YKt(t,e,r,n={}){let o=Tr(n),s={...Tr(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(YKt,"_stringFormat");var urt=class{static{a(this,"$ZodFunction")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a(((...n)=>{let o=this._def.input?dRe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?dRe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}implementAsync(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a((async(...n)=>{let o=this._def.input?await fRe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?fRe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new LJ({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){let r=this.constructor;return new r({type:"function",input:this._def.input,output:e})}};function KKt(t){return new urt({type:"function",input:Array.isArray(t?.input)?GKt(LJ,t?.input):t?.input??MRe(gRe,Ode(Nde)),output:t?.output??Ode(Nde)})}a(KKt,"_function");p();var ORe=class{static{a(this,"JSONSchemaGenerator")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??s5,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 h={...r,schemaPath:[...r.schemaPath,e],path:r.path},m=e._zod.parent;if(m)l.ref=m,this.process(m,h),this.seen.get(m).isParent=!0;else{let g=l.schema;switch(o.type){case"string":{let A=g;A.type="string";let{minimum:y,maximum:E,format:_,patterns:v,contentEncoding:b}=e._zod.bag;if(typeof y=="number"&&(A.minLength=y),typeof E=="number"&&(A.maxLength=E),_&&(A.format=s[_]??_,A.format===""&&delete A.format),b&&(A.contentEncoding=b),v&&v.size>0){let T=[...v];T.length===1?A.pattern=T[0].source:T.length>1&&(l.schema.allOf=[...T.map(w=>({...this.target==="draft-7"?{type:"string"}:{},pattern:w.source}))])}break}case"number":{let A=g,{minimum:y,maximum:E,format:_,multipleOf:v,exclusiveMaximum:b,exclusiveMinimum:T}=e._zod.bag;typeof _=="string"&&_.includes("int")?A.type="integer":A.type="number",typeof T=="number"&&(A.exclusiveMinimum=T),typeof y=="number"&&(A.minimum=y,typeof T=="number"&&(T>=y?delete A.minimum:delete A.exclusiveMinimum)),typeof b=="number"&&(A.exclusiveMaximum=b),typeof E=="number"&&(A.maximum=E,typeof b=="number"&&(b<=E?delete A.maximum:delete A.exclusiveMaximum)),typeof v=="number"&&(A.multipleOf=v);break}case"boolean":{let A=g;A.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{g.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{g.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let A=g,{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(A.minItems=y),typeof E=="number"&&(A.maxItems=E),A.type="array",A.items=this.process(o.element,{...h,path:[...h.path,"items"]});break}case"object":{let A=g;A.type="object",A.properties={};let y=o.shape;for(let v in y)A.properties[v]=this.process(y[v],{...h,path:[...h.path,"properties",v]});let E=new Set(Object.keys(y)),_=new Set([...E].filter(v=>{let b=o.shape[v]._zod;return this.io==="input"?b.optin===void 0:b.optout===void 0}));_.size>0&&(A.required=Array.from(_)),o.catchall?._zod.def.type==="never"?A.additionalProperties=!1:o.catchall?o.catchall&&(A.additionalProperties=this.process(o.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(A.additionalProperties=!1);break}case"union":{let A=g;A.anyOf=o.options.map((y,E)=>this.process(y,{...h,path:[...h.path,"anyOf",E]}));break}case"intersection":{let A=g,y=this.process(o.left,{...h,path:[...h.path,"allOf",0]}),E=this.process(o.right,{...h,path:[...h.path,"allOf",1]}),_=a(b=>"allOf"in b&&Object.keys(b).length===1,"isSimpleIntersection"),v=[..._(y)?y.allOf:[y],..._(E)?E.allOf:[E]];A.allOf=v;break}case"tuple":{let A=g;A.type="array";let y=o.items.map((v,b)=>this.process(v,{...h,path:[...h.path,"prefixItems",b]}));if(this.target==="draft-2020-12"?A.prefixItems=y:A.items=y,o.rest){let v=this.process(o.rest,{...h,path:[...h.path,"items"]});this.target==="draft-2020-12"?A.items=v:A.additionalItems=v}o.rest&&(A.items=this.process(o.rest,{...h,path:[...h.path,"items"]}));let{minimum:E,maximum:_}=e._zod.bag;typeof E=="number"&&(A.minItems=E),typeof _=="number"&&(A.maxItems=_);break}case"record":{let A=g;A.type="object",A.propertyNames=this.process(o.keyType,{...h,path:[...h.path,"propertyNames"]}),A.additionalProperties=this.process(o.valueType,{...h,path:[...h.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let A=g,y=rRe(o.entries);y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),A.enum=y;break}case"literal":{let A=g,y=[];for(let E of o.values)if(E===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof E=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(E))}else y.push(E);if(y.length!==0)if(y.length===1){let E=y[0];A.type=E===null?"null":typeof E,A.const=E}else y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),y.every(E=>typeof E=="boolean")&&(A.type="string"),y.every(E=>E===null)&&(A.type="null"),A.enum=y;break}case"file":{let A=g,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:E,maximum:_,mime:v}=e._zod.bag;E!==void 0&&(y.minLength=E),_!==void 0&&(y.maxLength=_),v?v.length===1?(y.contentMediaType=v[0],Object.assign(A,y)):A.anyOf=v.map(b=>({...y,contentMediaType:b})):Object.assign(A,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let A=this.process(o.innerType,h);g.anyOf=[A,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"success":{let A=g;A.type="boolean";break}case"default":{this.process(o.innerType,h),l.ref=o.innerType,g.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,h),l.ref=o.innerType,this.io==="input"&&(g._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,h),l.ref=o.innerType;let A;try{A=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}g.default=A;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let A=g,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");A.type="string",A.pattern=y.source;break}case"pipe":{let A=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(A,h),l.ref=A;break}case"readonly":{this.process(o.innerType,h),l.ref=o.innerType,g.readOnly=!0;break}case"promise":{this.process(o.innerType,h),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"lazy":{let A=e._zod.innerType;this.process(A,h),l.ref=A;break}case"custom":{if(this.unrepresentable==="throw")throw new 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"&&g0(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 new 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 y=n.external.registry.get(f[0])?.id,E=n.external.uri??(v=>v);if(y)return{ref:E(y)};let _=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=_,{defId:_,ref:`${E("__shared")}#/${h}/${_}`}}if(f[1]===o)return{ref:"#"};let g=`#/${h}/`,A=f[1].schema.id??`__schema${this.counter++}`;return{defId:A,ref:g+A}},"makeURI"),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},"extractToDef");if(n.cycles==="throw")for(let f of this.seen.entries()){let h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let g=n.external.registry.get(f[0])?.id;if(e!==f[0]&&g){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){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 E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"flattenRef");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};if(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}`),n.external?.uri){let f=n.external.registry.get(e)?.id;if(!f)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(f)}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 new Error("Error converting schema to JSON.")}}};function KKt(t,e){if(t instanceof Mde){let n=new ORe(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri,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 ORe(e);return r.process(t),r.emit(t,e)}a(KKt,"toJSONSchema");function g0(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;switch(o.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 g0(o.element,r);case"object":{for(let s in o.shape)if(g0(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(g0(s,r))return!0;return!1}case"intersection":return g0(o.left,r)||g0(o.right,r);case"tuple":{for(let s of o.items)if(g0(s,r))return!0;return!!(o.rest&&g0(o.rest,r))}case"record":return g0(o.keyType,r)||g0(o.valueType,r);case"map":return g0(o.keyType,r)||g0(o.valueType,r);case"set":return g0(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return g0(o.innerType,r);case"lazy":return g0(o.getter(),r);case"default":return g0(o.innerType,r);case"prefault":return g0(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return g0(o.in,r)||g0(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}a(g0,"isTransforming");var Vkn={};p();p();p();var Ude={};ki(Ude,{ZodISODate:()=>lrt,ZodISODateTime:()=>crt,ZodISODuration:()=>drt,ZodISOTime:()=>urt,date:()=>ZKt,datetime:()=>JKt,duration:()=>eJt,time:()=>XKt});p();var crt=dt("ZodISODateTime",(t,e)=>{Dzt.init(t,e),Cu.init(t,e)});function JKt(t){return fKt(crt,t)}a(JKt,"datetime");var lrt=dt("ZodISODate",(t,e)=>{Nzt.init(t,e),Cu.init(t,e)});function ZKt(t){return pKt(lrt,t)}a(ZKt,"date");var urt=dt("ZodISOTime",(t,e)=>{Mzt.init(t,e),Cu.init(t,e)});function XKt(t){return hKt(urt,t)}a(XKt,"time");var drt=dt("ZodISODuration",(t,e)=>{Ozt.init(t,e),Cu.init(t,e)});function eJt(t){return mKt(drt,t)}a(eJt,"duration");p();p();var zkn=a((t,e)=>{cRe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>uRe(t,r),"value")},flatten:{value:a(r=>lRe(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}}})},"initializer"),_os=dt("ZodError",zkn),Qde=dt("ZodError",zkn,{Parent:Error});var tJt=xtt(Qde),rJt=wtt(Qde),nJt=Rtt(Qde),iJt=ktt(Qde);var ks=dt("ZodType",(t,e)=>(uo.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)=>iT(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>tJt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>nJt(t,r,n),t.parseAsync=async(r,n)=>rJt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>iJt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(wPn(r,n)),t.superRefine=r=>t.check(RPn(r)),t.overwrite=r=>t.check(CF(r)),t.optional=()=>bu(t),t.nullable=()=>prt(t),t.nullish=()=>bu(prt(t)),t.nonoptional=r=>gPn(t,r),t.array=()=>Fr(t),t.or=r=>Il([t,r]),t.and=r=>qRe(t,r),t.transform=r=>hrt(t,kJt(r)),t.default=r=>pPn(t,r),t.prefault=r=>mPn(t,r),t.catch=r=>EPn(t,r),t.pipe=r=>hrt(t,r),t.readonly=()=>CPn(t),t.describe=r=>{let n=t.clone();return s5.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return s5.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return s5.get(t);let n=t.clone();return s5.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),sJt=dt("_ZodString",(t,e)=>{OJ.init(t,e),ks.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(bRe(...n)),t.includes=(...n)=>t.check(IRe(...n)),t.startsWith=(...n)=>t.check(xRe(...n)),t.endsWith=(...n)=>t.check(wRe(...n)),t.min=(...n)=>t.check(tj(...n)),t.max=(...n)=>t.check(Bde(...n)),t.length=(...n)=>t.check(Fde(...n)),t.nonempty=(...n)=>t.check(tj(1,...n)),t.lowercase=n=>t.check(SRe(n)),t.uppercase=n=>t.check(TRe(n)),t.trim=()=>t.check(PRe()),t.normalize=(...n)=>t.check(kRe(...n)),t.toLowerCase=()=>t.check(DRe()),t.toUpperCase=()=>t.check(NRe())}),BRe=dt("ZodString",(t,e)=>{OJ.init(t,e),sJt.init(t,e),t.email=r=>t.check(Qtt(aJt,r)),t.url=r=>t.check($tt(cJt,r)),t.jwt=r=>t.check(srt(SJt,r)),t.emoji=r=>t.check(Vtt(uJt,r)),t.guid=r=>t.check(vRe(frt,r)),t.uuid=r=>t.check(qtt(SF,r)),t.uuidv4=r=>t.check(jtt(SF,r)),t.uuidv6=r=>t.check(Htt(SF,r)),t.uuidv7=r=>t.check(Gtt(SF,r)),t.nanoid=r=>t.check(Wtt(dJt,r)),t.guid=r=>t.check(vRe(frt,r)),t.cuid=r=>t.check(ztt(fJt,r)),t.cuid2=r=>t.check(Ytt(pJt,r)),t.ulid=r=>t.check(Ktt(hJt,r)),t.base64=r=>t.check(nrt(vJt,r)),t.base64url=r=>t.check(irt(CJt,r)),t.xid=r=>t.check(Jtt(mJt,r)),t.ksuid=r=>t.check(Ztt(gJt,r)),t.ipv4=r=>t.check(Xtt(AJt,r)),t.ipv6=r=>t.check(ert(yJt,r)),t.cidrv4=r=>t.check(trt(EJt,r)),t.cidrv6=r=>t.check(rrt(_Jt,r)),t.e164=r=>t.check(ort(bJt,r)),t.datetime=r=>t.check(JKt(r)),t.date=r=>t.check(ZKt(r)),t.time=r=>t.check(XKt(r)),t.duration=r=>t.check(eJt(r))});function Je(t){return lKt(BRe,t)}a(Je,"string");var Cu=dt("ZodStringFormat",(t,e)=>{Vl.init(t,e),sJt.init(t,e)}),aJt=dt("ZodEmail",(t,e)=>{bzt.init(t,e),Cu.init(t,e)});function Cos(t){return Qtt(aJt,t)}a(Cos,"email");var frt=dt("ZodGUID",(t,e)=>{vzt.init(t,e),Cu.init(t,e)});function bos(t){return vRe(frt,t)}a(bos,"guid");var SF=dt("ZodUUID",(t,e)=>{Czt.init(t,e),Cu.init(t,e)});function Sos(t){return qtt(SF,t)}a(Sos,"uuid");function Tos(t){return jtt(SF,t)}a(Tos,"uuidv4");function Ios(t){return Htt(SF,t)}a(Ios,"uuidv6");function xos(t){return Gtt(SF,t)}a(xos,"uuidv7");var cJt=dt("ZodURL",(t,e)=>{Szt.init(t,e),Cu.init(t,e)});function lJt(t){return $tt(cJt,t)}a(lJt,"url");var uJt=dt("ZodEmoji",(t,e)=>{Tzt.init(t,e),Cu.init(t,e)});function wos(t){return Vtt(uJt,t)}a(wos,"emoji");var dJt=dt("ZodNanoID",(t,e)=>{Izt.init(t,e),Cu.init(t,e)});function Ros(t){return Wtt(dJt,t)}a(Ros,"nanoid");var fJt=dt("ZodCUID",(t,e)=>{xzt.init(t,e),Cu.init(t,e)});function kos(t){return ztt(fJt,t)}a(kos,"cuid");var pJt=dt("ZodCUID2",(t,e)=>{wzt.init(t,e),Cu.init(t,e)});function Pos(t){return Ytt(pJt,t)}a(Pos,"cuid2");var hJt=dt("ZodULID",(t,e)=>{Rzt.init(t,e),Cu.init(t,e)});function Dos(t){return Ktt(hJt,t)}a(Dos,"ulid");var mJt=dt("ZodXID",(t,e)=>{kzt.init(t,e),Cu.init(t,e)});function Nos(t){return Jtt(mJt,t)}a(Nos,"xid");var gJt=dt("ZodKSUID",(t,e)=>{Pzt.init(t,e),Cu.init(t,e)});function Mos(t){return Ztt(gJt,t)}a(Mos,"ksuid");var AJt=dt("ZodIPv4",(t,e)=>{Lzt.init(t,e),Cu.init(t,e)});function Oos(t){return Xtt(AJt,t)}a(Oos,"ipv4");var yJt=dt("ZodIPv6",(t,e)=>{Bzt.init(t,e),Cu.init(t,e)});function Los(t){return ert(yJt,t)}a(Los,"ipv6");var EJt=dt("ZodCIDRv4",(t,e)=>{Fzt.init(t,e),Cu.init(t,e)});function Bos(t){return trt(EJt,t)}a(Bos,"cidrv4");var _Jt=dt("ZodCIDRv6",(t,e)=>{Uzt.init(t,e),Cu.init(t,e)});function Fos(t){return rrt(_Jt,t)}a(Fos,"cidrv6");var vJt=dt("ZodBase64",(t,e)=>{qzt.init(t,e),Cu.init(t,e)});function Uos(t){return nrt(vJt,t)}a(Uos,"base64");var CJt=dt("ZodBase64URL",(t,e)=>{jzt.init(t,e),Cu.init(t,e)});function Qos(t){return irt(CJt,t)}a(Qos,"base64url");var bJt=dt("ZodE164",(t,e)=>{Hzt.init(t,e),Cu.init(t,e)});function qos(t){return ort(bJt,t)}a(qos,"e164");var SJt=dt("ZodJWT",(t,e)=>{Gzt.init(t,e),Cu.init(t,e)});function jos(t){return srt(SJt,t)}a(jos,"jwt");var Ykn=dt("ZodCustomStringFormat",(t,e)=>{$zt.init(t,e),Cu.init(t,e)});function Hos(t,e,r={}){return zKt(Ykn,t,e,r)}a(Hos,"stringFormat");var FRe=dt("ZodNumber",(t,e)=>{Ltt.init(t,e),ks.init(t,e),t.gt=(n,o)=>t.check(vF(n,o)),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.lt=(n,o)=>t.check(_F(n,o)),t.lte=(n,o)=>t.check(yw(n,o)),t.max=(n,o)=>t.check(yw(n,o)),t.int=n=>t.check(oJt(n)),t.safe=n=>t.check(oJt(n)),t.positive=n=>t.check(vF(0,n)),t.nonnegative=n=>t.check(tb(0,n)),t.negative=n=>t.check(_F(0,n)),t.nonpositive=n=>t.check(yw(0,n)),t.multipleOf=(n,o)=>t.check(BJ(n,o)),t.step=(n,o)=>t.check(BJ(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});function ka(t){return gKt(FRe,t)}a(ka,"number");var qde=dt("ZodNumberFormat",(t,e)=>{Vzt.init(t,e),FRe.init(t,e)});function oJt(t){return yKt(qde,t)}a(oJt,"int");function Gos(t){return EKt(qde,t)}a(Gos,"float32");function $os(t){return _Kt(qde,t)}a($os,"float64");function Vos(t){return vKt(qde,t)}a(Vos,"int32");function Wos(t){return CKt(qde,t)}a(Wos,"uint32");var URe=dt("ZodBoolean",(t,e)=>{mRe.init(t,e),ks.init(t,e)});function ol(t){return bKt(URe,t)}a(ol,"boolean");var QRe=dt("ZodBigInt",(t,e)=>{Btt.init(t,e),ks.init(t,e),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.gt=(n,o)=>t.check(vF(n,o)),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.lt=(n,o)=>t.check(_F(n,o)),t.lte=(n,o)=>t.check(yw(n,o)),t.max=(n,o)=>t.check(yw(n,o)),t.positive=n=>t.check(vF(BigInt(0),n)),t.negative=n=>t.check(_F(BigInt(0),n)),t.nonpositive=n=>t.check(yw(BigInt(0),n)),t.nonnegative=n=>t.check(tb(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(BJ(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function zos(t){return TKt(QRe,t)}a(zos,"bigint");var TJt=dt("ZodBigIntFormat",(t,e)=>{Wzt.init(t,e),QRe.init(t,e)});function Yos(t){return xKt(TJt,t)}a(Yos,"int64");function Kos(t){return wKt(TJt,t)}a(Kos,"uint64");var Kkn=dt("ZodSymbol",(t,e)=>{zzt.init(t,e),ks.init(t,e)});function Jos(t){return RKt(Kkn,t)}a(Jos,"symbol");var Jkn=dt("ZodUndefined",(t,e)=>{Yzt.init(t,e),ks.init(t,e)});function Zos(t){return kKt(Jkn,t)}a(Zos,"_undefined");var Zkn=dt("ZodNull",(t,e)=>{Kzt.init(t,e),ks.init(t,e)});function mrt(t){return PKt(Zkn,t)}a(mrt,"_null");var Xkn=dt("ZodAny",(t,e)=>{Jzt.init(t,e),ks.init(t,e)});function IJt(){return DKt(Xkn)}a(IJt,"any");var ePn=dt("ZodUnknown",(t,e)=>{Nde.init(t,e),ks.init(t,e)});function od(){return Ode(ePn)}a(od,"unknown");var tPn=dt("ZodNever",(t,e)=>{Zzt.init(t,e),ks.init(t,e)});function grt(t){return NKt(tPn,t)}a(grt,"never");var rPn=dt("ZodVoid",(t,e)=>{Xzt.init(t,e),ks.init(t,e)});function Xos(t){return MKt(rPn,t)}a(Xos,"_void");var Art=dt("ZodDate",(t,e)=>{eYt.init(t,e),ks.init(t,e),t.min=(n,o)=>t.check(tb(n,o)),t.max=(n,o)=>t.check(yw(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 ess(t){return OKt(Art,t)}a(ess,"date");var nPn=dt("ZodArray",(t,e)=>{gRe.init(t,e),ks.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(tj(r,n)),t.nonempty=r=>t.check(tj(1,r)),t.max=(r,n)=>t.check(Bde(r,n)),t.length=(r,n)=>t.check(Fde(r,n)),t.unwrap=()=>t.element});function Fr(t,e){return MRe(nPn,t,e)}a(Fr,"array");function tss(t){let e=t._zod.def.shape;return Gn(Object.keys(e))}a(tss,"keyof");var yrt=dt("ZodObject",(t,e)=>{tYt.init(t,e),ks.init(t,e),qr.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>rv(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:od()}),t.loose=()=>t.clone({...t._zod.def,catchall:od()}),t.strict=()=>t.clone({...t._zod.def,catchall:grt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>qr.extend(t,r),t.merge=r=>qr.merge(t,r),t.pick=r=>qr.pick(t,r),t.omit=r=>qr.omit(t,r),t.partial=(...r)=>qr.partial(PJt,t,r[0]),t.required=(...r)=>qr.required(DJt,t,r[0])});function zr(t,e){let r={type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},...qr.normalizeParams(e)};return new yrt(r)}a(zr,"object");function rss(t,e){return new yrt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:grt(),...qr.normalizeParams(e)})}a(rss,"strictObject");function om(t,e){return new yrt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:od(),...qr.normalizeParams(e)})}a(om,"looseObject");var xJt=dt("ZodUnion",(t,e)=>{Ftt.init(t,e),ks.init(t,e),t.options=e.options});function Il(t,e){return new xJt({type:"union",options:t,...qr.normalizeParams(e)})}a(Il,"union");var iPn=dt("ZodDiscriminatedUnion",(t,e)=>{xJt.init(t,e),rYt.init(t,e)});function Ert(t,e,r){return new iPn({type:"union",options:e,discriminator:t,...qr.normalizeParams(r)})}a(Ert,"discriminatedUnion");var oPn=dt("ZodIntersection",(t,e)=>{nYt.init(t,e),ks.init(t,e)});function qRe(t,e){return new oPn({type:"intersection",left:t,right:e})}a(qRe,"intersection");var sPn=dt("ZodTuple",(t,e)=>{LJ.init(t,e),ks.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function nss(t,e,r){let n=e instanceof uo,o=n?r:e,s=n?e:null;return new sPn({type:"tuple",items:t,rest:s,...qr.normalizeParams(o)})}a(nss,"tuple");var wJt=dt("ZodRecord",(t,e)=>{iYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function xl(t,e,r){return new wJt({type:"record",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(xl,"record");function iss(t,e,r){return new wJt({type:"record",keyType:Il([t,grt()]),valueType:e,...qr.normalizeParams(r)})}a(iss,"partialRecord");var aPn=dt("ZodMap",(t,e)=>{oYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function oss(t,e,r){return new aPn({type:"map",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(oss,"map");var cPn=dt("ZodSet",(t,e)=>{sYt.init(t,e),ks.init(t,e),t.min=(...r)=>t.check(FJ(...r)),t.nonempty=r=>t.check(FJ(1,r)),t.max=(...r)=>t.check(Lde(...r)),t.size=(...r)=>t.check(CRe(...r))});function sss(t,e){return new cPn({type:"set",valueType:t,...qr.normalizeParams(e)})}a(sss,"set");var LRe=dt("ZodEnum",(t,e)=>{aYt.init(t,e),ks.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 new Error(`Key ${c} not found in enum`);return new LRe({...e,checks:[],...qr.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 LRe({...e,checks:[],...qr.normalizeParams(o),entries:s})}});function rv(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new LRe({type:"enum",entries:r,...qr.normalizeParams(e)})}a(rv,"_enum");function ass(t,e){return new LRe({type:"enum",entries:t,...qr.normalizeParams(e)})}a(ass,"nativeEnum");var lPn=dt("ZodLiteral",(t,e)=>{cYt.init(t,e),ks.init(t,e),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 Gn(t,e){return new lPn({type:"literal",values:Array.isArray(t)?t:[t],...qr.normalizeParams(e)})}a(Gn,"literal");var uPn=dt("ZodFile",(t,e)=>{lYt.init(t,e),ks.init(t,e),t.min=(r,n)=>t.check(FJ(r,n)),t.max=(r,n)=>t.check(Lde(r,n)),t.mime=(r,n)=>t.check(RRe(Array.isArray(r)?r:[r],n))});function css(t){return GKt(uPn,t)}a(css,"file");var RJt=dt("ZodTransform",(t,e)=>{ARe.init(t,e),ks.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(qr.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(qr.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function kJt(t){return new RJt({type:"transform",transform:t})}a(kJt,"transform");var PJt=dt("ZodOptional",(t,e)=>{uYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function bu(t){return new PJt({type:"optional",innerType:t})}a(bu,"optional");var dPn=dt("ZodNullable",(t,e)=>{dYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function prt(t){return new dPn({type:"nullable",innerType:t})}a(prt,"nullable");function lss(t){return bu(prt(t))}a(lss,"nullish");var fPn=dt("ZodDefault",(t,e)=>{fYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function pPn(t,e){return new fPn({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(pPn,"_default");var hPn=dt("ZodPrefault",(t,e)=>{pYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function mPn(t,e){return new hPn({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(mPn,"prefault");var DJt=dt("ZodNonOptional",(t,e)=>{hYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function gPn(t,e){return new DJt({type:"nonoptional",innerType:t,...qr.normalizeParams(e)})}a(gPn,"nonoptional");var APn=dt("ZodSuccess",(t,e)=>{mYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function uss(t){return new APn({type:"success",innerType:t})}a(uss,"success");var yPn=dt("ZodCatch",(t,e)=>{gYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function EPn(t,e){return new yPn({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(EPn,"_catch");var _Pn=dt("ZodNaN",(t,e)=>{AYt.init(t,e),ks.init(t,e)});function dss(t){return BKt(_Pn,t)}a(dss,"nan");var NJt=dt("ZodPipe",(t,e)=>{yRe.init(t,e),ks.init(t,e),t.in=e.in,t.out=e.out});function hrt(t,e){return new NJt({type:"pipe",in:t,out:e})}a(hrt,"pipe");var vPn=dt("ZodReadonly",(t,e)=>{yYt.init(t,e),ks.init(t,e)});function CPn(t){return new vPn({type:"readonly",innerType:t})}a(CPn,"readonly");var bPn=dt("ZodTemplateLiteral",(t,e)=>{EYt.init(t,e),ks.init(t,e)});function fss(t,e){return new bPn({type:"template_literal",parts:t,...qr.normalizeParams(e)})}a(fss,"templateLiteral");var SPn=dt("ZodLazy",(t,e)=>{vYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.getter()});function TPn(t){return new SPn({type:"lazy",getter:t})}a(TPn,"lazy");var IPn=dt("ZodPromise",(t,e)=>{_Yt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function pss(t){return new IPn({type:"promise",innerType:t})}a(pss,"promise");var _rt=dt("ZodCustom",(t,e)=>{CYt.init(t,e),ks.init(t,e)});function xPn(t){let e=new Tf({check:"custom"});return e._zod.check=t,e}a(xPn,"check");function MJt(t,e){return $Kt(_rt,t??(()=>!0),e)}a(MJt,"custom");function wPn(t,e={}){return VKt(_rt,t,e)}a(wPn,"refine");function RPn(t){let e=xPn(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(qr.issue(n,r.value,e._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),r.issues.push(qr.issue(o))}},t(r.value,r)));return e}a(RPn,"superRefine");function hss(t,e={error:`Input not instance of ${t.name}`}){let r=new _rt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...qr.normalizeParams(e)});return r._zod.bag.Class=t,r}a(hss,"_instanceof");var mss=a((...t)=>WKt({Pipe:NJt,Boolean:URe,String:BRe,Transform:RJt},...t),"stringbool");function gss(t){let e=TPn(()=>Il([Je(t),ka(),ol(),mrt(),Fr(e),xl(Je(),e)]));return e}a(gss,"json");function vrt(t,e){return hrt(kJt(t),e)}a(vrt,"preprocess");p();var OJt={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 Ass(t){im({customError:t})}a(Ass,"setErrorMap");function yss(){return im().customError}a(yss,"getErrorMap");var jRe={};ki(jRe,{bigint:()=>Css,boolean:()=>vss,date:()=>bss,number:()=>_ss,string:()=>Ess});p();function Ess(t){return uKt(BRe,t)}a(Ess,"string");function _ss(t){return AKt(FRe,t)}a(_ss,"number");function vss(t){return SKt(URe,t)}a(vss,"boolean");function Css(t){return IKt(QRe,t)}a(Css,"bigint");function bss(t){return LKt(Art,t)}a(bss,"date");im(ERe());p();var ci={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"},If={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"},Crt=1;p();var Tss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminal:k.boolean().optional().default(!1)}),Iss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),label:k.string().nullish(),name:k.string(),optional:k.boolean().optional().default(!1),secret:k.boolean().optional().default(!0)}),xss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),name:k.string()}),wss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),link:k.string().nullish(),name:k.string(),vars:k.array(Iss)}),Rss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()).optional(),description:k.string().nullish(),env:k.record(k.string(),k.string()).optional(),id:k.string(),name:k.string()}),kss=k.union([wss.and(k.object({type:k.literal("env_var")})),Rss.and(k.object({type:k.literal("terminal")})),xss]),BJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),methodId:k.string()}),Pss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Dss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),blob:k.string(),mimeType:k.string().nullish(),uri:k.string()}),Nss=k.object({default:k.boolean().nullish(),description:k.string().nullish(),title:k.string().nullish()}),Mss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Oss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Lss=k.object({amount:k.number(),currency:k.string()}),Bss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Fss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Uss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),newText:k.string(),oldText:k.string().nullish(),path:k.string()}),FJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string()}),Qss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),qss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),jss=k.union([k.string(),k.number(),k.number(),k.boolean(),k.array(k.string())]),Hss=k.object({content:k.record(k.string(),jss).nullish()}),Gss=k.intersection(k.union([Hss.and(k.object({action:k.literal("accept")})),k.object({action:k.literal("decline")}),k.object({action:k.literal("cancel")})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish()})),$ss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),kPn=k.string(),UJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),elicitationId:kPn}),Vss=k.literal("object"),Wss=k.literal("string"),zss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Yss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),form:$ss.nullish(),url:zss.nullish()}),PPn=k.object({const:k.string(),title:k.string()}),DPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),Kss=k.union([k.literal(-32700),k.literal(-32600),k.literal(-32601),k.literal(-32602),k.literal(-32603),k.literal(-32800),k.literal(-32e3),k.literal(-32002),k.literal(-32042),k.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),NPn=k.object({code:Kss,data:k.unknown().optional(),message:k.string()}),MPn=k.unknown(),OPn=k.unknown(),LPn=k.unknown(),Jss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),readTextFile:k.boolean().optional().default(!1),writeTextFile:k.boolean().optional().default(!1)}),BPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),FPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),title:k.string().nullish(),version:k.string()}),Zss=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),Xss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),QJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),qJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cursor:k.string().nullish(),cwd:k.string().nullish()}),jJt=k.union([k.literal("anthropic"),k.literal("openai"),k.literal("azure"),k.literal("vertex"),k.literal("bedrock"),k.string()]),eas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),tas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),logout:eas.nullish()}),HJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ras=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),nas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acp:k.boolean().optional().default(!1),http:k.boolean().optional().default(!1),sse:k.boolean().optional().default(!1)}),brt=k.string(),ias=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt}),oas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt}),UPn=k.string(),sas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acpId:UPn}),aas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:UPn,name:k.string()}),cas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(BPn),name:k.string(),url:k.string()}),las=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(BPn),name:k.string(),url:k.string()}),uas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()),command:k.string(),env:k.array(DPn),name:k.string()}),Srt=k.union([cas.and(k.object({type:k.literal("http")})),las.and(k.object({type:k.literal("sse")})),aas.and(k.object({type:k.literal("acp")})),uas]),QPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),qPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),jPn=k.unknown(),GJt=k.string(),das=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),modelId:GJt,name:k.string()}),fas=k.union([k.literal("error"),k.literal("warning"),k.literal("information"),k.literal("hint")]),pas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),has=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),mas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),gas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Aas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),yas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Eas=k.object({diff:k.string(),uri:k.string()}),_as=k.object({endLine:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:k.string()}),vas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Cas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),bas=k.object({languageId:k.string(),text:k.string(),uri:k.string()}),Sas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Tas=k.union([k.literal("rejected"),k.literal("ignored"),k.literal("replaced"),k.literal("cancelled")]),Ias=k.object({excerpts:k.array(_as),uri:k.string()}),xas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),was=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ras=k.object({name:k.string(),owner:k.string(),remoteUrl:k.string()}),kas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Pas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),jump:vas.nullish(),rename:was.nullish(),searchAndReplace:kas.nullish()}),Das=k.object({id:k.string(),isRegex:k.boolean().nullish(),replace:k.string(),search:k.string(),uri:k.string()}),Nas=k.union([k.literal("automatic"),k.literal("diagnostic"),k.literal("manual")]),Mas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Oas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:pas.nullish(),editHistory:yas.nullish(),openFiles:Cas.nullish(),recentFiles:Sas.nullish(),relatedSnippets:xas.nullish(),userActions:Mas.nullish()}),$Jt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt)}),Las=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),HPn=k.string(),Bas=k.union([k.literal("allow_once"),k.literal("allow_always"),k.literal("reject_once"),k.literal("reject_always")]),Fas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),kind:Bas,name:k.string(),optionId:HPn}),Uas=k.union([k.literal("high"),k.literal("medium"),k.literal("low")]),Qas=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed")]),qas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),priority:Uas,status:Qas}),jas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),entries:k.array(qas)}),rj=k.object({character:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),Has=k.object({id:k.string(),position:rj,uri:k.string()}),Gas=k.object({id:k.string(),newName:k.string(),position:rj,uri:k.string()}),$as=k.object({action:k.string(),position:rj,timestampMs:k.number(),uri:k.string()}),GPn=k.union([k.literal("utf-16"),k.literal("utf-32"),k.literal("utf-8")]),Vas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:Tss.optional().default({terminal:!1}),elicitation:Yss.nullish(),fs:Jss.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Pas.nullish(),positionEncodings:k.array(GPn).optional(),terminal:k.boolean().optional().default(!1)}),Was=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audio:k.boolean().optional().default(!1),embeddedContext:k.boolean().optional().default(!1),image:k.boolean().optional().default(!1)}),$Pn=k.number().int().gte(0).lte(65535),VJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),clientCapabilities:Vas.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:FPn.nullish(),protocolVersion:$Pn}),zas=k.object({apiType:jJt,baseUrl:k.string()}),Yas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),current:zas.nullish(),id:k.string(),required:k.boolean(),supported:k.array(jJt)}),Kas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),providers:k.array(Yas)}),Jas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),jde=k.object({end:rj,start:rj}),Zas=k.object({message:k.string(),range:jde,severity:fas,uri:k.string()}),Xas=k.object({languageId:k.string(),lastFocusedMs:k.number().nullish(),uri:k.string(),visibleRange:jde.nullish()}),ecs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:k.array(Zas).nullish(),editHistory:k.array(Eas).nullish(),openFiles:k.array(Xas).nullish(),recentFiles:k.array(bas).nullish(),relatedSnippets:k.array(Ias).nullish(),userActions:k.array($as).nullish()}),tcs=k.object({newText:k.string(),range:jde}),rcs=k.object({cursorPosition:rj.nullish(),edits:k.array(tcs),id:k.string(),uri:k.string()}),ncs=k.union([rcs.and(k.object({kind:k.literal("edit")})),Has.and(k.object({kind:k.literal("jump")})),Gas.and(k.object({kind:k.literal("rename")})),Das.and(k.object({kind:k.literal("searchAndReplace")}))]),ics=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string()}),ocs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),nj=k.union([k.number(),k.string()]).nullable(),zYd=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),requestId:nj}),VPn=k.object({requestId:nj}),scs=k.enum(["assistant","user"]),HRe=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audience:k.array(scs).nullish(),lastModified:k.string().nullish(),priority:k.number().nullish()}),acs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),data:k.string(),mimeType:k.string()}),ccs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),data:k.string(),mimeType:k.string(),uri:k.string().nullish()}),lcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),description:k.string().nullish(),mimeType:k.string().nullish(),name:k.string(),size:k.number().nullish(),title:k.string().nullish(),uri:k.string()}),ucs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),optionId:HPn}),dcs=k.union([k.object({outcome:k.literal("cancelled")}),ucs.and(k.object({outcome:k.literal("selected")}))]),fcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),outcome:dcs}),pcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),hcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),mcs=k.object({currentValue:k.boolean()}),gcs=k.string(),WPn=k.string(),Acs=k.union([k.literal("mode"),k.literal("model"),k.literal("thought_level"),k.string()]),WJt=k.string(),zPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),name:k.string(),value:WJt}),ycs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),group:gcs,name:k.string(),options:k.array(zPn)}),Ecs=k.union([k.array(zPn),k.array(ycs)]),_cs=k.object({currentValue:WJt,options:Ecs}),Hde=k.intersection(k.union([_cs.and(k.object({type:k.literal("select")})),mcs.and(k.object({type:k.literal("boolean")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),category:Acs.nullish(),description:k.string().nullish(),id:WPn,name:k.string()})),vcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde)}),Ccs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),bcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),sc=k.string(),zJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),sessionId:sc}),YJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),KJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),JJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),ZJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()).optional(),command:k.string(),cwd:k.string().nullish(),env:k.array(DPn).optional(),outputByteLimit:k.number().nullish(),sessionId:sc}),XJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),eZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,uri:k.string()}),tZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),position:rj,sessionId:sc,uri:k.string(),version:k.number(),visibleRange:jde}),rZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),languageId:k.string(),sessionId:sc,text:k.string(),uri:k.string(),version:k.number()}),nZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,uri:k.string()}),iZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt).optional(),sessionId:sc}),oZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),sZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt),sessionId:sc}),aZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),limit:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:k.string(),sessionId:sc}),cZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),reason:Tas.nullish(),sessionId:sc}),lZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),uZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt).optional(),sessionId:sc}),Scs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),sessionId:sc,title:k.string().nullish(),updatedAt:k.string().nullish()}),Tcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),nextCursor:k.string().nullish(),sessions:k.array(Scs)}),Ics=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),title:k.string().nullish(),updatedAt:k.string().nullish()}),xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Trt=k.string(),wcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),currentModeId:Trt}),Rcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:Trt,name:k.string()}),Irt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModes:k.array(Rcs),currentModeId:Trt}),xrt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModels:k.array(das),currentModelId:GJt}),kcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish(),sessionId:sc}),Pcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish()}),Dcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish(),sessionId:sc}),Ncs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish()}),Mcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ocs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:pcs.nullish(),close:hcs.nullish(),delete:Ccs.nullish(),fork:bcs.nullish(),list:xcs.nullish(),resume:Mcs.nullish()}),dZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),apiType:jJt,baseUrl:k.string(),headers:k.record(k.string(),k.string()).optional(),id:k.string()}),Lcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),fZt=k.intersection(k.union([k.object({type:k.literal("boolean"),value:k.boolean()}),k.object({value:WJt})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configId:WPn,sessionId:sc})),Bcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde)}),pZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modeId:Trt,sessionId:sc}),Fcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),hZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modelId:GJt,sessionId:sc}),Ucs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Qcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),qcs=k.union([k.literal("end_turn"),k.literal("max_tokens"),k.literal("max_turn_requests"),k.literal("refusal"),k.literal("cancelled")]),jcs=k.union([k.literal("email"),k.literal("uri"),k.literal("date"),k.literal("date-time")]),Hcs=k.object({default:k.string().nullish(),description:k.string().nullish(),enum:k.array(k.string()).nullish(),format:jcs.nullish(),maxLength:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:k.array(PPn).nullish(),pattern:k.string().nullish(),title:k.string().nullish()}),mZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:ecs.nullish(),position:rj,selection:jde.nullish(),sessionId:sc,triggerKind:Nas,uri:k.string(),version:k.number()}),Gcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),suggestions:k.array(ncs)}),$cs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Vcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitCode:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:k.string().nullish()}),gZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),Wcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitStatus:Vcs.nullish(),output:k.string(),truncated:k.boolean()}),zcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),text:k.string()}),Ycs=k.object({range:jde.nullish(),text:k.string()}),AZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),contentChanges:k.array(Ycs),sessionId:sc,uri:k.string(),version:k.number()}),YYd=k.object({method:k.string(),params:k.union([YJt,rZt,AZt,eZt,nZt,tZt,zJt,cZt,QPn,MPn]).nullish()}),Kcs=k.union([k.literal("full"),k.literal("incremental")]),Jcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),syncKind:Kcs}),Zcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),didChange:Jcs.nullish(),didClose:has.nullish(),didFocus:mas.nullish(),didOpen:gas.nullish(),didSave:Aas.nullish()}),Xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),document:Zcs.nullish()}),els=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:Oas.nullish(),events:Xcs.nullish()}),tls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:tas.optional().default({}),loadSession:k.boolean().optional().default(!1),mcpCapabilities:nas.optional().default({acp:!1,http:!1,sse:!1}),nes:els.nullish(),positionEncoding:GPn.nullish(),promptCapabilities:Was.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:Jas.nullish(),sessionCapabilities:Ocs.optional().default({})}),rls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),agentCapabilities:tls.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:FPn.nullish(),authMethods:k.array(kss).optional().default([]),protocolVersion:$Pn}),nls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),mimeType:k.string().nullish(),text:k.string(),uri:k.string()}),ils=k.union([nls,Dss]),ols=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),resource:ils}),yZt=k.union([zcs.and(k.object({type:k.literal("text")})),ccs.and(k.object({type:k.literal("image")})),acs.and(k.object({type:k.literal("audio")})),lcs.and(k.object({type:k.literal("resource_link")})),ols.and(k.object({type:k.literal("resource")}))]),sls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:yZt}),LJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:yZt,messageId:k.string().nullish()}),EZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),messageId:k.string().nullish(),prompt:k.array(yZt),sessionId:sc}),als=k.object({anyOf:k.array(PPn)}),YPn=k.union([sls.and(k.object({type:k.literal("content")})),Uss.and(k.object({type:k.literal("diff")})),$cs.and(k.object({type:k.literal("terminal")}))]),_Zt=k.string(),KPn=k.object({sessionId:sc,toolCallId:_Zt.nullish()}),cls=k.intersection(k.union([KPn,VPn]),k.object({elicitationId:kPn,url:k.string().url()})),JPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:k.string()}),ZPn=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed"),k.literal("failed")]),XPn=k.union([k.literal("read"),k.literal("edit"),k.literal("delete"),k.literal("move"),k.literal("search"),k.literal("execute"),k.literal("think"),k.literal("fetch"),k.literal("switch_mode"),k.literal("other")]),lls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(YPn).optional(),kind:XPn.optional(),locations:k.array(JPn).optional(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:ZPn.optional(),title:k.string(),toolCallId:_Zt}),e2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(YPn).nullish(),kind:XPn.nullish(),locations:k.array(JPn).nullish(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:ZPn.nullish(),title:k.string().nullish(),toolCallId:_Zt}),vZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),options:k.array(Fas),sessionId:sc,toolCall:e2n}),uls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),hint:k.string()}),dls=uls,fls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string(),input:dls.nullish(),name:k.string()}),pls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableCommands:k.array(fls)}),hls=k.object({enum:k.array(k.string()),type:Wss}),mls=k.union([hls,als]),gls=k.object({default:k.array(k.string()).nullish(),description:k.string().nullish(),items:mls,maxItems:k.number().nullish(),minItems:k.number().nullish(),title:k.string().nullish()}),Als=k.union([Hcs.and(k.object({type:k.literal("string")})),Las.and(k.object({type:k.literal("number")})),Zss.and(k.object({type:k.literal("integer")})),Nss.and(k.object({type:k.literal("boolean")})),gls.and(k.object({type:k.literal("array")}))]),yls=k.object({description:k.string().nullish(),properties:k.record(k.string(),Als).optional().default({}),required:k.array(k.string()).nullish(),title:k.string().nullish(),type:Vss.optional().default("object")}),Els=k.intersection(k.union([KPn,VPn]),k.object({requestedSchema:yls})),CZt=k.intersection(k.union([Els.and(k.object({mode:k.literal("form")})),cls.and(k.object({mode:k.literal("url")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),message:k.string()})),_ls=k.object({cachedReadTokens:k.number().nullish(),cachedWriteTokens:k.number().nullish(),inputTokens:k.number(),outputTokens:k.number(),thoughtTokens:k.number().nullish(),totalTokens:k.number()}),vls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),stopReason:qcs,usage:_ls.nullish(),userMessageId:k.string().nullish()}),KYd=k.union([k.object({id:nj,result:k.union([rls,Pss,Kas,Lcs,Qss,ras,Dcs,Pcs,Tcs,Fss,kcs,Ncs,Oss,Fcs,Bcs,vls,Ucs,Qcs,Gcs,Mss,LPn,jPn])}),k.object({error:NPn,id:nj})]),Cls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cost:Lss.nullish(),size:k.number(),used:k.number()}),bls=k.union([LJt.and(k.object({sessionUpdate:k.literal("user_message_chunk")})),LJt.and(k.object({sessionUpdate:k.literal("agent_message_chunk")})),LJt.and(k.object({sessionUpdate:k.literal("agent_thought_chunk")})),lls.and(k.object({sessionUpdate:k.literal("tool_call")})),e2n.and(k.object({sessionUpdate:k.literal("tool_call_update")})),jas.and(k.object({sessionUpdate:k.literal("plan")})),pls.and(k.object({sessionUpdate:k.literal("available_commands_update")})),wcs.and(k.object({sessionUpdate:k.literal("current_mode_update")})),vcs.and(k.object({sessionUpdate:k.literal("config_option_update")})),Ics.and(k.object({sessionUpdate:k.literal("session_info_update")})),Cls.and(k.object({sessionUpdate:k.literal("usage_update")}))]),bZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,update:bls}),JYd=k.object({method:k.string(),params:k.union([bZt,UJt,QPn,MPn]).nullish()}),SZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),Sls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitCode:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:k.string().nullish()}),Tls=k.object({name:k.string(),uri:k.string()}),TZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),repository:Ras.nullish(),workspaceFolders:k.array(Tls).nullish(),workspaceUri:k.string().nullish()}),ZYd=k.object({id:nj,method:k.string(),params:k.union([VJt,BJt,QJt,dZt,FJt,HJt,$Jt,sZt,qJt,XJt,iZt,uZt,JJt,pZt,fZt,EZt,hZt,TZt,mZt,KJt,qPn,OPn]).nullish()}),IZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),path:k.string(),sessionId:sc}),XYd=k.object({id:nj,method:k.string(),params:k.union([IZt,aZt,vZt,ZJt,gZt,lZt,SZt,oZt,CZt,sas,qPn,oas,OPn]).nullish()}),Ils=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),eKd=k.union([k.object({id:nj,result:k.union([Ils,ics,fcs,Bss,Wcs,ocs,Sls,Xss,Gss,ias,qss,LPn,jPn])}),k.object({error:NPn,id:nj})]);p();function GRe(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 f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let g=n.external.registry.get(f[0])?.id;if(e!==f[0]&&g){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){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 E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"flattenRef");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};if(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}`),n.external?.uri){let f=n.external.registry.get(e)?.id;if(!f)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(f)}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 new Error("Error converting schema to JSON.")}}};function JKt(t,e){if(t instanceof Mde){let n=new ORe(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri,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 ORe(e);return r.process(t),r.emit(t,e)}a(JKt,"toJSONSchema");function g0(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;switch(o.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 g0(o.element,r);case"object":{for(let s in o.shape)if(g0(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(g0(s,r))return!0;return!1}case"intersection":return g0(o.left,r)||g0(o.right,r);case"tuple":{for(let s of o.items)if(g0(s,r))return!0;return!!(o.rest&&g0(o.rest,r))}case"record":return g0(o.keyType,r)||g0(o.valueType,r);case"map":return g0(o.keyType,r)||g0(o.valueType,r);case"set":return g0(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return g0(o.innerType,r);case"lazy":return g0(o.getter(),r);case"default":return g0(o.innerType,r);case"prefault":return g0(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return g0(o.in,r)||g0(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}a(g0,"isTransforming");var Wkn={};p();p();p();var Ude={};ki(Ude,{ZodISODate:()=>frt,ZodISODateTime:()=>drt,ZodISODuration:()=>hrt,ZodISOTime:()=>prt,date:()=>XKt,datetime:()=>ZKt,duration:()=>tJt,time:()=>eJt});p();var drt=dt("ZodISODateTime",(t,e)=>{Nzt.init(t,e),Cu.init(t,e)});function ZKt(t){return pKt(drt,t)}a(ZKt,"datetime");var frt=dt("ZodISODate",(t,e)=>{Mzt.init(t,e),Cu.init(t,e)});function XKt(t){return hKt(frt,t)}a(XKt,"date");var prt=dt("ZodISOTime",(t,e)=>{Ozt.init(t,e),Cu.init(t,e)});function eJt(t){return mKt(prt,t)}a(eJt,"time");var hrt=dt("ZodISODuration",(t,e)=>{Lzt.init(t,e),Cu.init(t,e)});function tJt(t){return gKt(hrt,t)}a(tJt,"duration");p();p();var Ykn=a((t,e)=>{cRe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>uRe(t,r),"value")},flatten:{value:a(r=>lRe(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}}})},"initializer"),Tos=dt("ZodError",Ykn),Qde=dt("ZodError",Ykn,{Parent:Error});var rJt=ktt(Qde),nJt=Ptt(Qde),iJt=Dtt(Qde),oJt=Ntt(Qde);var ks=dt("ZodType",(t,e)=>(uo.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)=>sT(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>rJt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>iJt(t,r,n),t.parseAsync=async(r,n)=>nJt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>oJt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(RPn(r,n)),t.superRefine=r=>t.check(kPn(r)),t.overwrite=r=>t.check(bF(r)),t.optional=()=>bu(t),t.nullable=()=>grt(t),t.nullish=()=>bu(grt(t)),t.nonoptional=r=>APn(t,r),t.array=()=>Fr(t),t.or=r=>Il([t,r]),t.and=r=>qRe(t,r),t.transform=r=>Art(t,PJt(r)),t.default=r=>hPn(t,r),t.prefault=r=>gPn(t,r),t.catch=r=>_Pn(t,r),t.pipe=r=>Art(t,r),t.readonly=()=>bPn(t),t.describe=r=>{let n=t.clone();return s5.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return s5.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return s5.get(t);let n=t.clone();return s5.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),aJt=dt("_ZodString",(t,e)=>{OJ.init(t,e),ks.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(bRe(...n)),t.includes=(...n)=>t.check(IRe(...n)),t.startsWith=(...n)=>t.check(xRe(...n)),t.endsWith=(...n)=>t.check(wRe(...n)),t.min=(...n)=>t.check(rj(...n)),t.max=(...n)=>t.check(Bde(...n)),t.length=(...n)=>t.check(Fde(...n)),t.nonempty=(...n)=>t.check(rj(1,...n)),t.lowercase=n=>t.check(SRe(n)),t.uppercase=n=>t.check(TRe(n)),t.trim=()=>t.check(PRe()),t.normalize=(...n)=>t.check(kRe(...n)),t.toLowerCase=()=>t.check(DRe()),t.toUpperCase=()=>t.check(NRe())}),BRe=dt("ZodString",(t,e)=>{OJ.init(t,e),aJt.init(t,e),t.email=r=>t.check(Htt(cJt,r)),t.url=r=>t.check(ztt(lJt,r)),t.jwt=r=>t.check(lrt(TJt,r)),t.emoji=r=>t.check(Ytt(dJt,r)),t.guid=r=>t.check(vRe(mrt,r)),t.uuid=r=>t.check(Gtt(TF,r)),t.uuidv4=r=>t.check($tt(TF,r)),t.uuidv6=r=>t.check(Vtt(TF,r)),t.uuidv7=r=>t.check(Wtt(TF,r)),t.nanoid=r=>t.check(Ktt(fJt,r)),t.guid=r=>t.check(vRe(mrt,r)),t.cuid=r=>t.check(Jtt(pJt,r)),t.cuid2=r=>t.check(Ztt(hJt,r)),t.ulid=r=>t.check(Xtt(mJt,r)),t.base64=r=>t.check(srt(CJt,r)),t.base64url=r=>t.check(art(bJt,r)),t.xid=r=>t.check(ert(gJt,r)),t.ksuid=r=>t.check(trt(AJt,r)),t.ipv4=r=>t.check(rrt(yJt,r)),t.ipv6=r=>t.check(nrt(EJt,r)),t.cidrv4=r=>t.check(irt(_Jt,r)),t.cidrv6=r=>t.check(ort(vJt,r)),t.e164=r=>t.check(crt(SJt,r)),t.datetime=r=>t.check(ZKt(r)),t.date=r=>t.check(XKt(r)),t.time=r=>t.check(eJt(r)),t.duration=r=>t.check(tJt(r))});function Je(t){return uKt(BRe,t)}a(Je,"string");var Cu=dt("ZodStringFormat",(t,e)=>{Vl.init(t,e),aJt.init(t,e)}),cJt=dt("ZodEmail",(t,e)=>{Szt.init(t,e),Cu.init(t,e)});function xos(t){return Htt(cJt,t)}a(xos,"email");var mrt=dt("ZodGUID",(t,e)=>{Czt.init(t,e),Cu.init(t,e)});function wos(t){return vRe(mrt,t)}a(wos,"guid");var TF=dt("ZodUUID",(t,e)=>{bzt.init(t,e),Cu.init(t,e)});function Ros(t){return Gtt(TF,t)}a(Ros,"uuid");function kos(t){return $tt(TF,t)}a(kos,"uuidv4");function Pos(t){return Vtt(TF,t)}a(Pos,"uuidv6");function Dos(t){return Wtt(TF,t)}a(Dos,"uuidv7");var lJt=dt("ZodURL",(t,e)=>{Tzt.init(t,e),Cu.init(t,e)});function uJt(t){return ztt(lJt,t)}a(uJt,"url");var dJt=dt("ZodEmoji",(t,e)=>{Izt.init(t,e),Cu.init(t,e)});function Nos(t){return Ytt(dJt,t)}a(Nos,"emoji");var fJt=dt("ZodNanoID",(t,e)=>{xzt.init(t,e),Cu.init(t,e)});function Mos(t){return Ktt(fJt,t)}a(Mos,"nanoid");var pJt=dt("ZodCUID",(t,e)=>{wzt.init(t,e),Cu.init(t,e)});function Oos(t){return Jtt(pJt,t)}a(Oos,"cuid");var hJt=dt("ZodCUID2",(t,e)=>{Rzt.init(t,e),Cu.init(t,e)});function Los(t){return Ztt(hJt,t)}a(Los,"cuid2");var mJt=dt("ZodULID",(t,e)=>{kzt.init(t,e),Cu.init(t,e)});function Bos(t){return Xtt(mJt,t)}a(Bos,"ulid");var gJt=dt("ZodXID",(t,e)=>{Pzt.init(t,e),Cu.init(t,e)});function Fos(t){return ert(gJt,t)}a(Fos,"xid");var AJt=dt("ZodKSUID",(t,e)=>{Dzt.init(t,e),Cu.init(t,e)});function Uos(t){return trt(AJt,t)}a(Uos,"ksuid");var yJt=dt("ZodIPv4",(t,e)=>{Bzt.init(t,e),Cu.init(t,e)});function Qos(t){return rrt(yJt,t)}a(Qos,"ipv4");var EJt=dt("ZodIPv6",(t,e)=>{Fzt.init(t,e),Cu.init(t,e)});function qos(t){return nrt(EJt,t)}a(qos,"ipv6");var _Jt=dt("ZodCIDRv4",(t,e)=>{Uzt.init(t,e),Cu.init(t,e)});function jos(t){return irt(_Jt,t)}a(jos,"cidrv4");var vJt=dt("ZodCIDRv6",(t,e)=>{Qzt.init(t,e),Cu.init(t,e)});function Hos(t){return ort(vJt,t)}a(Hos,"cidrv6");var CJt=dt("ZodBase64",(t,e)=>{jzt.init(t,e),Cu.init(t,e)});function Gos(t){return srt(CJt,t)}a(Gos,"base64");var bJt=dt("ZodBase64URL",(t,e)=>{Hzt.init(t,e),Cu.init(t,e)});function $os(t){return art(bJt,t)}a($os,"base64url");var SJt=dt("ZodE164",(t,e)=>{Gzt.init(t,e),Cu.init(t,e)});function Vos(t){return crt(SJt,t)}a(Vos,"e164");var TJt=dt("ZodJWT",(t,e)=>{$zt.init(t,e),Cu.init(t,e)});function Wos(t){return lrt(TJt,t)}a(Wos,"jwt");var Kkn=dt("ZodCustomStringFormat",(t,e)=>{Vzt.init(t,e),Cu.init(t,e)});function zos(t,e,r={}){return YKt(Kkn,t,e,r)}a(zos,"stringFormat");var FRe=dt("ZodNumber",(t,e)=>{Utt.init(t,e),ks.init(t,e),t.gt=(n,o)=>t.check(CF(n,o)),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.lt=(n,o)=>t.check(vF(n,o)),t.lte=(n,o)=>t.check(Ew(n,o)),t.max=(n,o)=>t.check(Ew(n,o)),t.int=n=>t.check(sJt(n)),t.safe=n=>t.check(sJt(n)),t.positive=n=>t.check(CF(0,n)),t.nonnegative=n=>t.check(tb(0,n)),t.negative=n=>t.check(vF(0,n)),t.nonpositive=n=>t.check(Ew(0,n)),t.multipleOf=(n,o)=>t.check(BJ(n,o)),t.step=(n,o)=>t.check(BJ(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});function Ra(t){return AKt(FRe,t)}a(Ra,"number");var qde=dt("ZodNumberFormat",(t,e)=>{Wzt.init(t,e),FRe.init(t,e)});function sJt(t){return EKt(qde,t)}a(sJt,"int");function Yos(t){return _Kt(qde,t)}a(Yos,"float32");function Kos(t){return vKt(qde,t)}a(Kos,"float64");function Jos(t){return CKt(qde,t)}a(Jos,"int32");function Zos(t){return bKt(qde,t)}a(Zos,"uint32");var URe=dt("ZodBoolean",(t,e)=>{mRe.init(t,e),ks.init(t,e)});function ol(t){return SKt(URe,t)}a(ol,"boolean");var QRe=dt("ZodBigInt",(t,e)=>{Qtt.init(t,e),ks.init(t,e),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.gt=(n,o)=>t.check(CF(n,o)),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.lt=(n,o)=>t.check(vF(n,o)),t.lte=(n,o)=>t.check(Ew(n,o)),t.max=(n,o)=>t.check(Ew(n,o)),t.positive=n=>t.check(CF(BigInt(0),n)),t.negative=n=>t.check(vF(BigInt(0),n)),t.nonpositive=n=>t.check(Ew(BigInt(0),n)),t.nonnegative=n=>t.check(tb(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(BJ(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function Xos(t){return IKt(QRe,t)}a(Xos,"bigint");var IJt=dt("ZodBigIntFormat",(t,e)=>{zzt.init(t,e),QRe.init(t,e)});function ess(t){return wKt(IJt,t)}a(ess,"int64");function tss(t){return RKt(IJt,t)}a(tss,"uint64");var Jkn=dt("ZodSymbol",(t,e)=>{Yzt.init(t,e),ks.init(t,e)});function rss(t){return kKt(Jkn,t)}a(rss,"symbol");var Zkn=dt("ZodUndefined",(t,e)=>{Kzt.init(t,e),ks.init(t,e)});function nss(t){return PKt(Zkn,t)}a(nss,"_undefined");var Xkn=dt("ZodNull",(t,e)=>{Jzt.init(t,e),ks.init(t,e)});function yrt(t){return DKt(Xkn,t)}a(yrt,"_null");var ePn=dt("ZodAny",(t,e)=>{Zzt.init(t,e),ks.init(t,e)});function xJt(){return NKt(ePn)}a(xJt,"any");var tPn=dt("ZodUnknown",(t,e)=>{Nde.init(t,e),ks.init(t,e)});function od(){return Ode(tPn)}a(od,"unknown");var rPn=dt("ZodNever",(t,e)=>{Xzt.init(t,e),ks.init(t,e)});function Ert(t){return MKt(rPn,t)}a(Ert,"never");var nPn=dt("ZodVoid",(t,e)=>{eYt.init(t,e),ks.init(t,e)});function iss(t){return OKt(nPn,t)}a(iss,"_void");var _rt=dt("ZodDate",(t,e)=>{tYt.init(t,e),ks.init(t,e),t.min=(n,o)=>t.check(tb(n,o)),t.max=(n,o)=>t.check(Ew(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 oss(t){return LKt(_rt,t)}a(oss,"date");var iPn=dt("ZodArray",(t,e)=>{gRe.init(t,e),ks.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(rj(r,n)),t.nonempty=r=>t.check(rj(1,r)),t.max=(r,n)=>t.check(Bde(r,n)),t.length=(r,n)=>t.check(Fde(r,n)),t.unwrap=()=>t.element});function Fr(t,e){return MRe(iPn,t,e)}a(Fr,"array");function sss(t){let e=t._zod.def.shape;return Gn(Object.keys(e))}a(sss,"keyof");var vrt=dt("ZodObject",(t,e)=>{rYt.init(t,e),ks.init(t,e),qr.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>nv(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:od()}),t.loose=()=>t.clone({...t._zod.def,catchall:od()}),t.strict=()=>t.clone({...t._zod.def,catchall:Ert()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>qr.extend(t,r),t.merge=r=>qr.merge(t,r),t.pick=r=>qr.pick(t,r),t.omit=r=>qr.omit(t,r),t.partial=(...r)=>qr.partial(DJt,t,r[0]),t.required=(...r)=>qr.required(NJt,t,r[0])});function zr(t,e){let r={type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},...qr.normalizeParams(e)};return new vrt(r)}a(zr,"object");function ass(t,e){return new vrt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:Ert(),...qr.normalizeParams(e)})}a(ass,"strictObject");function om(t,e){return new vrt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:od(),...qr.normalizeParams(e)})}a(om,"looseObject");var wJt=dt("ZodUnion",(t,e)=>{qtt.init(t,e),ks.init(t,e),t.options=e.options});function Il(t,e){return new wJt({type:"union",options:t,...qr.normalizeParams(e)})}a(Il,"union");var oPn=dt("ZodDiscriminatedUnion",(t,e)=>{wJt.init(t,e),nYt.init(t,e)});function Crt(t,e,r){return new oPn({type:"union",options:e,discriminator:t,...qr.normalizeParams(r)})}a(Crt,"discriminatedUnion");var sPn=dt("ZodIntersection",(t,e)=>{iYt.init(t,e),ks.init(t,e)});function qRe(t,e){return new sPn({type:"intersection",left:t,right:e})}a(qRe,"intersection");var aPn=dt("ZodTuple",(t,e)=>{LJ.init(t,e),ks.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function css(t,e,r){let n=e instanceof uo,o=n?r:e,s=n?e:null;return new aPn({type:"tuple",items:t,rest:s,...qr.normalizeParams(o)})}a(css,"tuple");var RJt=dt("ZodRecord",(t,e)=>{oYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function xl(t,e,r){return new RJt({type:"record",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(xl,"record");function lss(t,e,r){return new RJt({type:"record",keyType:Il([t,Ert()]),valueType:e,...qr.normalizeParams(r)})}a(lss,"partialRecord");var cPn=dt("ZodMap",(t,e)=>{sYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function uss(t,e,r){return new cPn({type:"map",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(uss,"map");var lPn=dt("ZodSet",(t,e)=>{aYt.init(t,e),ks.init(t,e),t.min=(...r)=>t.check(FJ(...r)),t.nonempty=r=>t.check(FJ(1,r)),t.max=(...r)=>t.check(Lde(...r)),t.size=(...r)=>t.check(CRe(...r))});function dss(t,e){return new lPn({type:"set",valueType:t,...qr.normalizeParams(e)})}a(dss,"set");var LRe=dt("ZodEnum",(t,e)=>{cYt.init(t,e),ks.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 new Error(`Key ${c} not found in enum`);return new LRe({...e,checks:[],...qr.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 LRe({...e,checks:[],...qr.normalizeParams(o),entries:s})}});function nv(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new LRe({type:"enum",entries:r,...qr.normalizeParams(e)})}a(nv,"_enum");function fss(t,e){return new LRe({type:"enum",entries:t,...qr.normalizeParams(e)})}a(fss,"nativeEnum");var uPn=dt("ZodLiteral",(t,e)=>{lYt.init(t,e),ks.init(t,e),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 Gn(t,e){return new uPn({type:"literal",values:Array.isArray(t)?t:[t],...qr.normalizeParams(e)})}a(Gn,"literal");var dPn=dt("ZodFile",(t,e)=>{uYt.init(t,e),ks.init(t,e),t.min=(r,n)=>t.check(FJ(r,n)),t.max=(r,n)=>t.check(Lde(r,n)),t.mime=(r,n)=>t.check(RRe(Array.isArray(r)?r:[r],n))});function pss(t){return $Kt(dPn,t)}a(pss,"file");var kJt=dt("ZodTransform",(t,e)=>{ARe.init(t,e),ks.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(qr.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(qr.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function PJt(t){return new kJt({type:"transform",transform:t})}a(PJt,"transform");var DJt=dt("ZodOptional",(t,e)=>{dYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function bu(t){return new DJt({type:"optional",innerType:t})}a(bu,"optional");var fPn=dt("ZodNullable",(t,e)=>{fYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function grt(t){return new fPn({type:"nullable",innerType:t})}a(grt,"nullable");function hss(t){return bu(grt(t))}a(hss,"nullish");var pPn=dt("ZodDefault",(t,e)=>{pYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function hPn(t,e){return new pPn({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(hPn,"_default");var mPn=dt("ZodPrefault",(t,e)=>{hYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function gPn(t,e){return new mPn({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(gPn,"prefault");var NJt=dt("ZodNonOptional",(t,e)=>{mYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function APn(t,e){return new NJt({type:"nonoptional",innerType:t,...qr.normalizeParams(e)})}a(APn,"nonoptional");var yPn=dt("ZodSuccess",(t,e)=>{gYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function mss(t){return new yPn({type:"success",innerType:t})}a(mss,"success");var EPn=dt("ZodCatch",(t,e)=>{AYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function _Pn(t,e){return new EPn({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(_Pn,"_catch");var vPn=dt("ZodNaN",(t,e)=>{yYt.init(t,e),ks.init(t,e)});function gss(t){return FKt(vPn,t)}a(gss,"nan");var MJt=dt("ZodPipe",(t,e)=>{yRe.init(t,e),ks.init(t,e),t.in=e.in,t.out=e.out});function Art(t,e){return new MJt({type:"pipe",in:t,out:e})}a(Art,"pipe");var CPn=dt("ZodReadonly",(t,e)=>{EYt.init(t,e),ks.init(t,e)});function bPn(t){return new CPn({type:"readonly",innerType:t})}a(bPn,"readonly");var SPn=dt("ZodTemplateLiteral",(t,e)=>{_Yt.init(t,e),ks.init(t,e)});function Ass(t,e){return new SPn({type:"template_literal",parts:t,...qr.normalizeParams(e)})}a(Ass,"templateLiteral");var TPn=dt("ZodLazy",(t,e)=>{CYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.getter()});function IPn(t){return new TPn({type:"lazy",getter:t})}a(IPn,"lazy");var xPn=dt("ZodPromise",(t,e)=>{vYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function yss(t){return new xPn({type:"promise",innerType:t})}a(yss,"promise");var brt=dt("ZodCustom",(t,e)=>{bYt.init(t,e),ks.init(t,e)});function wPn(t){let e=new Tf({check:"custom"});return e._zod.check=t,e}a(wPn,"check");function OJt(t,e){return VKt(brt,t??(()=>!0),e)}a(OJt,"custom");function RPn(t,e={}){return WKt(brt,t,e)}a(RPn,"refine");function kPn(t){let e=wPn(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(qr.issue(n,r.value,e._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),r.issues.push(qr.issue(o))}},t(r.value,r)));return e}a(kPn,"superRefine");function Ess(t,e={error:`Input not instance of ${t.name}`}){let r=new brt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...qr.normalizeParams(e)});return r._zod.bag.Class=t,r}a(Ess,"_instanceof");var _ss=a((...t)=>zKt({Pipe:MJt,Boolean:URe,String:BRe,Transform:kJt},...t),"stringbool");function vss(t){let e=IPn(()=>Il([Je(t),Ra(),ol(),yrt(),Fr(e),xl(Je(),e)]));return e}a(vss,"json");function Srt(t,e){return Art(PJt(t),e)}a(Srt,"preprocess");p();var LJt={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 Css(t){im({customError:t})}a(Css,"setErrorMap");function bss(){return im().customError}a(bss,"getErrorMap");var jRe={};ki(jRe,{bigint:()=>xss,boolean:()=>Iss,date:()=>wss,number:()=>Tss,string:()=>Sss});p();function Sss(t){return dKt(BRe,t)}a(Sss,"string");function Tss(t){return yKt(FRe,t)}a(Tss,"number");function Iss(t){return TKt(URe,t)}a(Iss,"boolean");function xss(t){return xKt(QRe,t)}a(xss,"bigint");function wss(t){return BKt(_rt,t)}a(wss,"date");im(ERe());p();var ci={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"},If={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"},Trt=1;p();var kss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminal:k.boolean().optional().default(!1)}),Pss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),label:k.string().nullish(),name:k.string(),optional:k.boolean().optional().default(!1),secret:k.boolean().optional().default(!0)}),Dss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),name:k.string()}),Nss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),link:k.string().nullish(),name:k.string(),vars:k.array(Pss)}),Mss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()).optional(),description:k.string().nullish(),env:k.record(k.string(),k.string()).optional(),id:k.string(),name:k.string()}),Oss=k.union([Nss.and(k.object({type:k.literal("env_var")})),Mss.and(k.object({type:k.literal("terminal")})),Dss]),FJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),methodId:k.string()}),Lss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Bss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),blob:k.string(),mimeType:k.string().nullish(),uri:k.string()}),Fss=k.object({default:k.boolean().nullish(),description:k.string().nullish(),title:k.string().nullish()}),Uss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Qss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),qss=k.object({amount:k.number(),currency:k.string()}),jss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Hss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Gss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),newText:k.string(),oldText:k.string().nullish(),path:k.string()}),UJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string()}),$ss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Vss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Wss=k.union([k.string(),k.number(),k.number(),k.boolean(),k.array(k.string())]),zss=k.object({content:k.record(k.string(),Wss).nullish()}),Yss=k.intersection(k.union([zss.and(k.object({action:k.literal("accept")})),k.object({action:k.literal("decline")}),k.object({action:k.literal("cancel")})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish()})),Kss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),PPn=k.string(),QJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),elicitationId:PPn}),Jss=k.literal("object"),Zss=k.literal("string"),Xss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),eas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),form:Kss.nullish(),url:Xss.nullish()}),DPn=k.object({const:k.string(),title:k.string()}),NPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),tas=k.union([k.literal(-32700),k.literal(-32600),k.literal(-32601),k.literal(-32602),k.literal(-32603),k.literal(-32800),k.literal(-32e3),k.literal(-32002),k.literal(-32042),k.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),MPn=k.object({code:tas,data:k.unknown().optional(),message:k.string()}),OPn=k.unknown(),LPn=k.unknown(),BPn=k.unknown(),ras=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),readTextFile:k.boolean().optional().default(!1),writeTextFile:k.boolean().optional().default(!1)}),FPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),UPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),title:k.string().nullish(),version:k.string()}),nas=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),ias=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),qJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),jJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cursor:k.string().nullish(),cwd:k.string().nullish()}),HJt=k.union([k.literal("anthropic"),k.literal("openai"),k.literal("azure"),k.literal("vertex"),k.literal("bedrock"),k.string()]),oas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),sas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),logout:oas.nullish()}),GJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),aas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),cas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acp:k.boolean().optional().default(!1),http:k.boolean().optional().default(!1),sse:k.boolean().optional().default(!1)}),Irt=k.string(),las=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Irt}),uas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Irt}),QPn=k.string(),das=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acpId:QPn}),fas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:QPn,name:k.string()}),pas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(FPn),name:k.string(),url:k.string()}),has=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(FPn),name:k.string(),url:k.string()}),mas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()),command:k.string(),env:k.array(NPn),name:k.string()}),xrt=k.union([pas.and(k.object({type:k.literal("http")})),has.and(k.object({type:k.literal("sse")})),fas.and(k.object({type:k.literal("acp")})),mas]),qPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Irt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),jPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Irt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),HPn=k.unknown(),$Jt=k.string(),gas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),modelId:$Jt,name:k.string()}),Aas=k.union([k.literal("error"),k.literal("warning"),k.literal("information"),k.literal("hint")]),yas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Eas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),_as=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),vas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Cas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),bas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Sas=k.object({diff:k.string(),uri:k.string()}),Tas=k.object({endLine:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:k.string()}),Ias=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),xas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),was=k.object({languageId:k.string(),text:k.string(),uri:k.string()}),Ras=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),kas=k.union([k.literal("rejected"),k.literal("ignored"),k.literal("replaced"),k.literal("cancelled")]),Pas=k.object({excerpts:k.array(Tas),uri:k.string()}),Das=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Nas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Mas=k.object({name:k.string(),owner:k.string(),remoteUrl:k.string()}),Oas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Las=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),jump:Ias.nullish(),rename:Nas.nullish(),searchAndReplace:Oas.nullish()}),Bas=k.object({id:k.string(),isRegex:k.boolean().nullish(),replace:k.string(),search:k.string(),uri:k.string()}),Fas=k.union([k.literal("automatic"),k.literal("diagnostic"),k.literal("manual")]),Uas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Qas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:yas.nullish(),editHistory:bas.nullish(),openFiles:xas.nullish(),recentFiles:Ras.nullish(),relatedSnippets:Das.nullish(),userActions:Uas.nullish()}),VJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(xrt)}),qas=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),GPn=k.string(),jas=k.union([k.literal("allow_once"),k.literal("allow_always"),k.literal("reject_once"),k.literal("reject_always")]),Has=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),kind:jas,name:k.string(),optionId:GPn}),Gas=k.union([k.literal("high"),k.literal("medium"),k.literal("low")]),$as=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed")]),Vas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),priority:Gas,status:$as}),Was=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),entries:k.array(Vas)}),nj=k.object({character:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),zas=k.object({id:k.string(),position:nj,uri:k.string()}),Yas=k.object({id:k.string(),newName:k.string(),position:nj,uri:k.string()}),Kas=k.object({action:k.string(),position:nj,timestampMs:k.number(),uri:k.string()}),$Pn=k.union([k.literal("utf-16"),k.literal("utf-32"),k.literal("utf-8")]),Jas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:kss.optional().default({terminal:!1}),elicitation:eas.nullish(),fs:ras.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Las.nullish(),positionEncodings:k.array($Pn).optional(),terminal:k.boolean().optional().default(!1)}),Zas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audio:k.boolean().optional().default(!1),embeddedContext:k.boolean().optional().default(!1),image:k.boolean().optional().default(!1)}),VPn=k.number().int().gte(0).lte(65535),WJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),clientCapabilities:Jas.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:UPn.nullish(),protocolVersion:VPn}),Xas=k.object({apiType:HJt,baseUrl:k.string()}),ecs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),current:Xas.nullish(),id:k.string(),required:k.boolean(),supported:k.array(HJt)}),tcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),providers:k.array(ecs)}),rcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),jde=k.object({end:nj,start:nj}),ncs=k.object({message:k.string(),range:jde,severity:Aas,uri:k.string()}),ics=k.object({languageId:k.string(),lastFocusedMs:k.number().nullish(),uri:k.string(),visibleRange:jde.nullish()}),ocs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:k.array(ncs).nullish(),editHistory:k.array(Sas).nullish(),openFiles:k.array(ics).nullish(),recentFiles:k.array(was).nullish(),relatedSnippets:k.array(Pas).nullish(),userActions:k.array(Kas).nullish()}),scs=k.object({newText:k.string(),range:jde}),acs=k.object({cursorPosition:nj.nullish(),edits:k.array(scs),id:k.string(),uri:k.string()}),ccs=k.union([acs.and(k.object({kind:k.literal("edit")})),zas.and(k.object({kind:k.literal("jump")})),Yas.and(k.object({kind:k.literal("rename")})),Bas.and(k.object({kind:k.literal("searchAndReplace")}))]),lcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string()}),ucs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ij=k.union([k.number(),k.string()]).nullable(),rKd=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),requestId:ij}),WPn=k.object({requestId:ij}),dcs=k.enum(["assistant","user"]),HRe=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audience:k.array(dcs).nullish(),lastModified:k.string().nullish(),priority:k.number().nullish()}),fcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),data:k.string(),mimeType:k.string()}),pcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),data:k.string(),mimeType:k.string(),uri:k.string().nullish()}),hcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),description:k.string().nullish(),mimeType:k.string().nullish(),name:k.string(),size:k.number().nullish(),title:k.string().nullish(),uri:k.string()}),mcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),optionId:GPn}),gcs=k.union([k.object({outcome:k.literal("cancelled")}),mcs.and(k.object({outcome:k.literal("selected")}))]),Acs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),outcome:gcs}),ycs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ecs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),_cs=k.object({currentValue:k.boolean()}),vcs=k.string(),zPn=k.string(),Ccs=k.union([k.literal("mode"),k.literal("model"),k.literal("thought_level"),k.string()]),zJt=k.string(),YPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),name:k.string(),value:zJt}),bcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),group:vcs,name:k.string(),options:k.array(YPn)}),Scs=k.union([k.array(YPn),k.array(bcs)]),Tcs=k.object({currentValue:zJt,options:Scs}),Hde=k.intersection(k.union([Tcs.and(k.object({type:k.literal("select")})),_cs.and(k.object({type:k.literal("boolean")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),category:Ccs.nullish(),description:k.string().nullish(),id:zPn,name:k.string()})),Ics=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde)}),xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),wcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),sc=k.string(),YJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),sessionId:sc}),KJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),JJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),ZJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),XJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()).optional(),command:k.string(),cwd:k.string().nullish(),env:k.array(NPn).optional(),outputByteLimit:k.number().nullish(),sessionId:sc}),eZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),tZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,uri:k.string()}),rZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),position:nj,sessionId:sc,uri:k.string(),version:k.number(),visibleRange:jde}),nZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),languageId:k.string(),sessionId:sc,text:k.string(),uri:k.string(),version:k.number()}),iZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,uri:k.string()}),oZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(xrt).optional(),sessionId:sc}),sZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),aZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(xrt),sessionId:sc}),cZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),limit:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:k.string(),sessionId:sc}),lZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),reason:kas.nullish(),sessionId:sc}),uZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),dZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(xrt).optional(),sessionId:sc}),Rcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),sessionId:sc,title:k.string().nullish(),updatedAt:k.string().nullish()}),kcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),nextCursor:k.string().nullish(),sessions:k.array(Rcs)}),Pcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),title:k.string().nullish(),updatedAt:k.string().nullish()}),Dcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),wrt=k.string(),Ncs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),currentModeId:wrt}),Mcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:wrt,name:k.string()}),Rrt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModes:k.array(Mcs),currentModeId:wrt}),krt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModels:k.array(gas),currentModelId:$Jt}),Ocs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:krt.nullish(),modes:Rrt.nullish(),sessionId:sc}),Lcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:krt.nullish(),modes:Rrt.nullish()}),Bcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:krt.nullish(),modes:Rrt.nullish(),sessionId:sc}),Fcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:krt.nullish(),modes:Rrt.nullish()}),Ucs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Qcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:ycs.nullish(),close:Ecs.nullish(),delete:xcs.nullish(),fork:wcs.nullish(),list:Dcs.nullish(),resume:Ucs.nullish()}),fZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),apiType:HJt,baseUrl:k.string(),headers:k.record(k.string(),k.string()).optional(),id:k.string()}),qcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),pZt=k.intersection(k.union([k.object({type:k.literal("boolean"),value:k.boolean()}),k.object({value:zJt})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configId:zPn,sessionId:sc})),jcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde)}),hZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modeId:wrt,sessionId:sc}),Hcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),mZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modelId:$Jt,sessionId:sc}),Gcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),$cs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),Vcs=k.union([k.literal("end_turn"),k.literal("max_tokens"),k.literal("max_turn_requests"),k.literal("refusal"),k.literal("cancelled")]),Wcs=k.union([k.literal("email"),k.literal("uri"),k.literal("date"),k.literal("date-time")]),zcs=k.object({default:k.string().nullish(),description:k.string().nullish(),enum:k.array(k.string()).nullish(),format:Wcs.nullish(),maxLength:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:k.array(DPn).nullish(),pattern:k.string().nullish(),title:k.string().nullish()}),gZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:ocs.nullish(),position:nj,selection:jde.nullish(),sessionId:sc,triggerKind:Fas,uri:k.string(),version:k.number()}),Ycs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),suggestions:k.array(ccs)}),Kcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Jcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitCode:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:k.string().nullish()}),AZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),Zcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitStatus:Jcs.nullish(),output:k.string(),truncated:k.boolean()}),Xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),text:k.string()}),els=k.object({range:jde.nullish(),text:k.string()}),yZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),contentChanges:k.array(els),sessionId:sc,uri:k.string(),version:k.number()}),nKd=k.object({method:k.string(),params:k.union([KJt,nZt,yZt,tZt,iZt,rZt,YJt,lZt,qPn,OPn]).nullish()}),tls=k.union([k.literal("full"),k.literal("incremental")]),rls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),syncKind:tls}),nls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),didChange:rls.nullish(),didClose:Eas.nullish(),didFocus:_as.nullish(),didOpen:vas.nullish(),didSave:Cas.nullish()}),ils=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),document:nls.nullish()}),ols=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:Qas.nullish(),events:ils.nullish()}),sls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:sas.optional().default({}),loadSession:k.boolean().optional().default(!1),mcpCapabilities:cas.optional().default({acp:!1,http:!1,sse:!1}),nes:ols.nullish(),positionEncoding:$Pn.nullish(),promptCapabilities:Zas.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:rcs.nullish(),sessionCapabilities:Qcs.optional().default({})}),als=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),agentCapabilities:sls.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:UPn.nullish(),authMethods:k.array(Oss).optional().default([]),protocolVersion:VPn}),cls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),mimeType:k.string().nullish(),text:k.string(),uri:k.string()}),lls=k.union([cls,Bss]),uls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),resource:lls}),EZt=k.union([Xcs.and(k.object({type:k.literal("text")})),pcs.and(k.object({type:k.literal("image")})),fcs.and(k.object({type:k.literal("audio")})),hcs.and(k.object({type:k.literal("resource_link")})),uls.and(k.object({type:k.literal("resource")}))]),dls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:EZt}),BJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:EZt,messageId:k.string().nullish()}),_Zt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),messageId:k.string().nullish(),prompt:k.array(EZt),sessionId:sc}),fls=k.object({anyOf:k.array(DPn)}),KPn=k.union([dls.and(k.object({type:k.literal("content")})),Gss.and(k.object({type:k.literal("diff")})),Kcs.and(k.object({type:k.literal("terminal")}))]),vZt=k.string(),JPn=k.object({sessionId:sc,toolCallId:vZt.nullish()}),pls=k.intersection(k.union([JPn,WPn]),k.object({elicitationId:PPn,url:k.string().url()})),ZPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:k.string()}),XPn=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed"),k.literal("failed")]),e2n=k.union([k.literal("read"),k.literal("edit"),k.literal("delete"),k.literal("move"),k.literal("search"),k.literal("execute"),k.literal("think"),k.literal("fetch"),k.literal("switch_mode"),k.literal("other")]),hls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(KPn).optional(),kind:e2n.optional(),locations:k.array(ZPn).optional(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:XPn.optional(),title:k.string(),toolCallId:vZt}),t2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(KPn).nullish(),kind:e2n.nullish(),locations:k.array(ZPn).nullish(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:XPn.nullish(),title:k.string().nullish(),toolCallId:vZt}),CZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),options:k.array(Has),sessionId:sc,toolCall:t2n}),mls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),hint:k.string()}),gls=mls,Als=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string(),input:gls.nullish(),name:k.string()}),yls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableCommands:k.array(Als)}),Els=k.object({enum:k.array(k.string()),type:Zss}),_ls=k.union([Els,fls]),vls=k.object({default:k.array(k.string()).nullish(),description:k.string().nullish(),items:_ls,maxItems:k.number().nullish(),minItems:k.number().nullish(),title:k.string().nullish()}),Cls=k.union([zcs.and(k.object({type:k.literal("string")})),qas.and(k.object({type:k.literal("number")})),nas.and(k.object({type:k.literal("integer")})),Fss.and(k.object({type:k.literal("boolean")})),vls.and(k.object({type:k.literal("array")}))]),bls=k.object({description:k.string().nullish(),properties:k.record(k.string(),Cls).optional().default({}),required:k.array(k.string()).nullish(),title:k.string().nullish(),type:Jss.optional().default("object")}),Sls=k.intersection(k.union([JPn,WPn]),k.object({requestedSchema:bls})),bZt=k.intersection(k.union([Sls.and(k.object({mode:k.literal("form")})),pls.and(k.object({mode:k.literal("url")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),message:k.string()})),Tls=k.object({cachedReadTokens:k.number().nullish(),cachedWriteTokens:k.number().nullish(),inputTokens:k.number(),outputTokens:k.number(),thoughtTokens:k.number().nullish(),totalTokens:k.number()}),Ils=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),stopReason:Vcs,usage:Tls.nullish(),userMessageId:k.string().nullish()}),iKd=k.union([k.object({id:ij,result:k.union([als,Lss,tcs,qcs,$ss,aas,Bcs,Lcs,kcs,Hss,Ocs,Fcs,Qss,Hcs,jcs,Ils,Gcs,$cs,Ycs,Uss,BPn,HPn])}),k.object({error:MPn,id:ij})]),xls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cost:qss.nullish(),size:k.number(),used:k.number()}),wls=k.union([BJt.and(k.object({sessionUpdate:k.literal("user_message_chunk")})),BJt.and(k.object({sessionUpdate:k.literal("agent_message_chunk")})),BJt.and(k.object({sessionUpdate:k.literal("agent_thought_chunk")})),hls.and(k.object({sessionUpdate:k.literal("tool_call")})),t2n.and(k.object({sessionUpdate:k.literal("tool_call_update")})),Was.and(k.object({sessionUpdate:k.literal("plan")})),yls.and(k.object({sessionUpdate:k.literal("available_commands_update")})),Ncs.and(k.object({sessionUpdate:k.literal("current_mode_update")})),Ics.and(k.object({sessionUpdate:k.literal("config_option_update")})),Pcs.and(k.object({sessionUpdate:k.literal("session_info_update")})),xls.and(k.object({sessionUpdate:k.literal("usage_update")}))]),SZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,update:wls}),oKd=k.object({method:k.string(),params:k.union([SZt,QJt,qPn,OPn]).nullish()}),TZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),Rls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitCode:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:k.string().nullish()}),kls=k.object({name:k.string(),uri:k.string()}),IZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),repository:Mas.nullish(),workspaceFolders:k.array(kls).nullish(),workspaceUri:k.string().nullish()}),sKd=k.object({id:ij,method:k.string(),params:k.union([WJt,FJt,qJt,fZt,UJt,GJt,VJt,aZt,jJt,eZt,oZt,dZt,ZJt,hZt,pZt,_Zt,mZt,IZt,gZt,JJt,jPn,LPn]).nullish()}),xZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),path:k.string(),sessionId:sc}),aKd=k.object({id:ij,method:k.string(),params:k.union([xZt,cZt,CZt,XJt,AZt,uZt,TZt,sZt,bZt,das,jPn,uas,LPn]).nullish()}),Pls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),cKd=k.union([k.object({id:ij,result:k.union([Pls,lcs,Acs,jss,Zcs,ucs,Rls,ias,Yss,las,Vss,BPn,HPn])}),k.object({error:MPn,id:ij})]);p();function GRe(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(GRe,"ndJsonStream");function Ew(t){return t??{}}a(Ew,"emptyObjectResponse");function t2n(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(t2n,"rejectedPromise");var $Re=class{static{a(this,"AgentSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case ci.initialize:{let u=VJt.parse(l);return n.initialize(u)}case ci.session_new:{let u=$Jt.parse(l);return n.newSession(u)}case ci.session_load:{if(!n.loadSession)throw fo.methodNotFound(c);let u=sZt.parse(l);return n.loadSession(u)}case ci.session_list:{if(!n.listSessions)throw fo.methodNotFound(c);let u=qJt.parse(l);return n.listSessions(u)}case ci.session_delete:{if(!n.unstable_deleteSession)throw fo.methodNotFound(c);let u=XJt.parse(l);return await n.unstable_deleteSession(u)??{}}case ci.session_fork:{if(!n.unstable_forkSession)throw fo.methodNotFound(c);let u=iZt.parse(l);return n.unstable_forkSession(u)}case ci.session_resume:{if(!n.resumeSession)throw fo.methodNotFound(c);let u=uZt.parse(l);return n.resumeSession(u)}case ci.session_close:{if(!n.closeSession)throw fo.methodNotFound(c);let u=JJt.parse(l);return await n.closeSession(u)??{}}case ci.session_set_mode:{if(!n.setSessionMode)throw fo.methodNotFound(c);let u=pZt.parse(l);return await n.setSessionMode(u)??{}}case ci.authenticate:{let u=BJt.parse(l);return await n.authenticate(u)??{}}case ci.providers_list:{if(!n.unstable_listProviders)throw fo.methodNotFound(c);let u=QJt.parse(l);return n.unstable_listProviders(u)}case ci.providers_set:{if(!n.unstable_setProvider)throw fo.methodNotFound(c);let u=dZt.parse(l);return await n.unstable_setProvider(u)??{}}case ci.providers_disable:{if(!n.unstable_disableProvider)throw fo.methodNotFound(c);let u=FJt.parse(l);return await n.unstable_disableProvider(u)??{}}case ci.logout:{if(!n.unstable_logout)throw fo.methodNotFound(c);let u=HJt.parse(l);return await n.unstable_logout(u)??{}}case ci.session_prompt:{let u=EZt.parse(l);return n.prompt(u)}case ci.session_set_model:{if(!n.unstable_setSessionModel)throw fo.methodNotFound(c);let u=hZt.parse(l);return await n.unstable_setSessionModel(u)??{}}case ci.session_set_config_option:{if(!n.setSessionConfigOption)throw fo.methodNotFound(c);let u=fZt.parse(l);return n.setSessionConfigOption(u)}case ci.nes_start:{if(!n.unstable_startNes)throw fo.methodNotFound(c);let u=TZt.parse(l);return n.unstable_startNes(u)}case ci.nes_suggest:{if(!n.unstable_suggestNes)throw fo.methodNotFound(c);let u=mZt.parse(l);return n.unstable_suggestNes(u)}case ci.nes_close:{if(!n.unstable_closeNes)throw fo.methodNotFound(c);let u=KJt.parse(l);return await n.unstable_closeNes(u)??{}}default:if(n.extMethod)return n.extMethod(c,l);throw fo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case ci.session_cancel:{let u=YJt.parse(l);return n.cancel(u)}case ci.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=rZt.parse(l);return n.unstable_didOpenDocument(u)}case ci.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=AZt.parse(l);return n.unstable_didChangeDocument(u)}case ci.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=eZt.parse(l);return n.unstable_didCloseDocument(u)}case ci.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=nZt.parse(l);return n.unstable_didSaveDocument(u)}case ci.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=tZt.parse(l);return n.unstable_didFocusDocument(u)}case ci.nes_accept:{if(!n.unstable_acceptNes)return;let u=zJt.parse(l);return n.unstable_acceptNes(u)}case ci.nes_reject:{if(!n.unstable_rejectNes)return;let u=cZt.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new Rrt(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(If.session_update,e)}requestPermission(e){return this.connection.sendRequest(If.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(If.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(If.fs_write_text_file,e,Ew)}createTerminal(e){return this.connection.sendRequest(If.terminal_create,e,r=>new xZt(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(If.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(If.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}},xZt=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(If.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(If.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(If.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},Ew)}release(){return this.connection.sendRequest(If.terminal_release,{sessionId:this.sessionId,terminalId:this.id},Ew)}async[Symbol.asyncDispose](){await this.release()}},wrt=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case If.fs_write_text_file:{let u=IZt.parse(l);return await n.writeTextFile?.(u)??{}}case If.fs_read_text_file:{let u=aZt.parse(l);return n.readTextFile?.(u)}case If.session_request_permission:{let u=vZt.parse(l);return n.requestPermission(u)}case If.terminal_create:{let u=ZJt.parse(l);return n.createTerminal?.(u)}case If.terminal_output:{let u=gZt.parse(l);return n.terminalOutput?.(u)}case If.terminal_release:{let u=lZt.parse(l);return await n.releaseTerminal?.(u)??{}}case If.terminal_wait_for_exit:{let u=SZt.parse(l);return n.waitForTerminalExit?.(u)}case If.terminal_kill:{let u=oZt.parse(l);return await n.killTerminal?.(u)??{}}case If.elicitation_create:{if(!n.unstable_createElicitation)throw fo.methodNotFound(c);let u=CZt.parse(l);return n.unstable_createElicitation(u)}default:if(n.extMethod)return n.extMethod(c,l);throw fo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case If.session_update:{let u=bZt.parse(l);return n.sessionUpdate(u)}case If.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=UJt.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new Rrt(o,s,r)}initialize(e){return this.connection.sendRequest(ci.initialize,e)}newSession(e){return this.connection.sendRequest(ci.session_new,e)}loadSession(e){return this.connection.sendRequest(ci.session_load,e,Ew)}unstable_forkSession(e){return this.connection.sendRequest(ci.session_fork,e)}listSessions(e){return this.connection.sendRequest(ci.session_list,e)}unstable_deleteSession(e){return this.connection.sendRequest(ci.session_delete,e,Ew)}resumeSession(e){return this.connection.sendRequest(ci.session_resume,e)}closeSession(e){return this.connection.sendRequest(ci.session_close,e)}setSessionMode(e){return this.connection.sendRequest(ci.session_set_mode,e,Ew)}unstable_setSessionModel(e){return this.connection.sendRequest(ci.session_set_model,e,Ew)}setSessionConfigOption(e){return this.connection.sendRequest(ci.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(ci.authenticate,e,Ew)}unstable_listProviders(e){return this.connection.sendRequest(ci.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(ci.providers_set,e,Ew)}unstable_disableProvider(e){return this.connection.sendRequest(ci.providers_disable,e,Ew)}unstable_logout(e){return this.connection.sendRequest(ci.logout,e,Ew)}prompt(e){return this.connection.sendRequest(ci.session_prompt,e)}cancel(e){return this.connection.sendNotification(ci.session_cancel,e)}unstable_startNes(e){return this.connection.sendRequest(ci.nes_start,e)}unstable_suggestNes(e){return this.connection.sendRequest(ci.nes_suggest,e)}unstable_closeNes(e){return this.connection.sendRequest(ci.nes_close,e,Ew)}unstable_didOpenDocument(e){return this.connection.sendNotification(ci.document_did_open,e)}unstable_didChangeDocument(e){return this.connection.sendNotification(ci.document_did_change,e)}unstable_didCloseDocument(e){return this.connection.sendNotification(ci.document_did_close,e)}unstable_didSaveDocument(e){return this.connection.sendNotification(ci.document_did_save,e)}unstable_didFocusDocument(e){return this.connection.sendNotification(ci.document_did_focus,e)}unstable_acceptNes(e){return this.connection.sendNotification(ci.nes_accept,e)}unstable_rejectNes(e){return this.connection.sendNotification(ci.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}},Rrt=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 fo)return n.toResult();if(n instanceof k.ZodError)return fo.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 fo.internalError(o?JSON.parse(o):{}).toResult()}catch{return fo.internalError({details:o}).toResult()}}}async tryCallNotificationHandler(e,r){try{return await this.notificationHandler(e,r),{result:null}}catch(n){if(n instanceof fo)return n.toResult();if(n instanceof k.ZodError)return fo.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 fo.internalError(o?JSON.parse(o):{}).toResult()}catch{return fo.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 fo(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 t2n(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?t2n(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}},fo=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 aCe=require("node:stream");p();Mo();p();var rb=class extends OY{constructor(r){super(new fle,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","EnableCopilotNesNonFree","EnableMapCodeFallback","SearchAgent","UseHelixFetcher","PerfEnabled","TransparentTokenRefresh","AuthTokenEncryption","DisableWorkspaceIndex"].forEach(s=>{for(let c of["AGENT_DEBUG_","GITHUB_COPILOT_","GH_COPILOT_"]){let l=`${c}${wls(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(Ye[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 wls(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(wls,"camelCaseToSnakeCaseAllCaps");var Rls="unknown-editor",r2n="unknown-editor-plugin",ij=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:Rls,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:r2n,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}isEditorPluginInfoKnown(){return this._editorPluginInfo!==void 0&&this._editorPluginInfo.name!==r2n}};p();p();var krt=new fe("agenticTurnProcessor"),WRe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.turnSuggestions=new bq(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new p0(e.ctx),this.hookTrigger=new ede(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:ZQ.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 tl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!VAn(this.turn.chatMode)){let h=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});Et(this.turnContext.ctx,"customAgent.turn",h),ZI(this.turnContext.ctx,"customAgent.turn",h)}r.onCancellationRequested(async()=>{krt.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let u=n2().find(h=>h.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let f=(await ew(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 hO(this.turnContext.ctx,m,h):await xo.getModelConfigurationById(this.turnContext.ctx,h,this.conversation.id.toString(),iq(this.conversation.turns));xo.applyModelConfigurationOverrides(this.turnContext.ctx,g,c),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(ZC).checkAndCompress(this.conversation,g,"pre-turn",r,String(this.turn.id))}catch(E){ot.exception(this.turnContext.ctx,E,"Pre-turn automatic compression check failed")}await new _de(this.turnContext,this.chatFetcher,g,l).run(r);let y={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let E=await this.fetchSuggestedTitle(r,l.extendedBy({messageSource:"chat.user"},{}));typeof E=="string"&&E!==""&&(y.suggestedTitle=E)}await this.endProgress(y)}catch(h){if(h instanceof $q)krt.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,h),this.turn.status="cancelled",await this.cancelProgress();else if(h instanceof Oc)krt.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 uF)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:{message:h.message,code:ZQ.ToolRoundExceedError,responseIsIncomplete:!0}});else if(h instanceof LA)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:h.conversationError});else throw krt.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 due(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=oq(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=fXe(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=Jue(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 wZt="collect-context",RZt="generate-response",Prt=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.postProcessor=new Eue(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new p0(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:ZQ.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 tl(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=n2().find(A=>A.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let d=(await ew(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(wZt,"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 xo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),iq(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(wZt,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(wZt),await n.steps.start(RZt,"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),E=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:E}))}}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 due(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 Iq((E,_,v,b,T,w)=>{let R=E.trim(),x=R.match(Hxe)!==null&&R.endsWith("-->");if(this.conversationProgress.report(this.conversation,this.turn,{reply:E,annotations:_,references:v,hideText:x,notifications:b.map(P=>({severity:"warning",message:P.message})),thinking:w}),this.turn.response?this.turn.response.message=yJe(this.turn.response.message,E):this.turn.response={message:E,type:"model"},this.turn.annotations.push(..._??[]),l+=E,this.strategy.currentDocument){let P=this.strategy.extractEditsFromResponse(l,this.strategy.currentDocument);P&&P.length>0&&(l="",this.conversationProgress.report(this.conversation,this.turn,{codeEdits:P}),u+=P.length)}}),f=c?.id,h=c?.providerName,m=h&&f?await hO(this.turnContext.ctx,h,f):await xo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),Dyn(e));xo.applyModelConfigurationOverrides(this.turnContext.ctx,m,c),e=xo.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(ZC).checkAndCompress(this.conversation,m,"pre-turn",r,String(this.turn.id))}catch(E){ot.exception(this.turnContext.ctx,E,"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:Pn(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,Pn(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",Tyn(this.turnContext.ctx,this.conversation,this.strategy.uiKind,Pn(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=cxe(this.conversation,this.strategy.uiKind,Pn(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=cxe(this.conversation,this.strategy.uiKind,Pn(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(RZt,e.error.message):await r.steps.finish(RZt)}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=fXe(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=Jue(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();Mo();p();var RYi=de(Xc()),kYi=de(PP());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 QA=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(n2n(e))}};function Oe(t,e){let r=qu.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=n2n(r.Errors(s));return[null,{code:Ze.InvalidParams,message:c}]}return e(n,o,s)}}a(Oe,"addMethodHandlerValidation");function n2n(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(GRe,"ndJsonStream");function _w(t){return t??{}}a(_w,"emptyObjectResponse");function r2n(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(r2n,"rejectedPromise");var $Re=class{static{a(this,"AgentSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case ci.initialize:{let u=WJt.parse(l);return n.initialize(u)}case ci.session_new:{let u=VJt.parse(l);return n.newSession(u)}case ci.session_load:{if(!n.loadSession)throw fo.methodNotFound(c);let u=aZt.parse(l);return n.loadSession(u)}case ci.session_list:{if(!n.listSessions)throw fo.methodNotFound(c);let u=jJt.parse(l);return n.listSessions(u)}case ci.session_delete:{if(!n.unstable_deleteSession)throw fo.methodNotFound(c);let u=eZt.parse(l);return await n.unstable_deleteSession(u)??{}}case ci.session_fork:{if(!n.unstable_forkSession)throw fo.methodNotFound(c);let u=oZt.parse(l);return n.unstable_forkSession(u)}case ci.session_resume:{if(!n.resumeSession)throw fo.methodNotFound(c);let u=dZt.parse(l);return n.resumeSession(u)}case ci.session_close:{if(!n.closeSession)throw fo.methodNotFound(c);let u=ZJt.parse(l);return await n.closeSession(u)??{}}case ci.session_set_mode:{if(!n.setSessionMode)throw fo.methodNotFound(c);let u=hZt.parse(l);return await n.setSessionMode(u)??{}}case ci.authenticate:{let u=FJt.parse(l);return await n.authenticate(u)??{}}case ci.providers_list:{if(!n.unstable_listProviders)throw fo.methodNotFound(c);let u=qJt.parse(l);return n.unstable_listProviders(u)}case ci.providers_set:{if(!n.unstable_setProvider)throw fo.methodNotFound(c);let u=fZt.parse(l);return await n.unstable_setProvider(u)??{}}case ci.providers_disable:{if(!n.unstable_disableProvider)throw fo.methodNotFound(c);let u=UJt.parse(l);return await n.unstable_disableProvider(u)??{}}case ci.logout:{if(!n.unstable_logout)throw fo.methodNotFound(c);let u=GJt.parse(l);return await n.unstable_logout(u)??{}}case ci.session_prompt:{let u=_Zt.parse(l);return n.prompt(u)}case ci.session_set_model:{if(!n.unstable_setSessionModel)throw fo.methodNotFound(c);let u=mZt.parse(l);return await n.unstable_setSessionModel(u)??{}}case ci.session_set_config_option:{if(!n.setSessionConfigOption)throw fo.methodNotFound(c);let u=pZt.parse(l);return n.setSessionConfigOption(u)}case ci.nes_start:{if(!n.unstable_startNes)throw fo.methodNotFound(c);let u=IZt.parse(l);return n.unstable_startNes(u)}case ci.nes_suggest:{if(!n.unstable_suggestNes)throw fo.methodNotFound(c);let u=gZt.parse(l);return n.unstable_suggestNes(u)}case ci.nes_close:{if(!n.unstable_closeNes)throw fo.methodNotFound(c);let u=JJt.parse(l);return await n.unstable_closeNes(u)??{}}default:if(n.extMethod)return n.extMethod(c,l);throw fo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case ci.session_cancel:{let u=KJt.parse(l);return n.cancel(u)}case ci.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=nZt.parse(l);return n.unstable_didOpenDocument(u)}case ci.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=yZt.parse(l);return n.unstable_didChangeDocument(u)}case ci.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=tZt.parse(l);return n.unstable_didCloseDocument(u)}case ci.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=iZt.parse(l);return n.unstable_didSaveDocument(u)}case ci.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=rZt.parse(l);return n.unstable_didFocusDocument(u)}case ci.nes_accept:{if(!n.unstable_acceptNes)return;let u=YJt.parse(l);return n.unstable_acceptNes(u)}case ci.nes_reject:{if(!n.unstable_rejectNes)return;let u=lZt.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new Drt(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(If.session_update,e)}requestPermission(e){return this.connection.sendRequest(If.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(If.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(If.fs_write_text_file,e,_w)}createTerminal(e){return this.connection.sendRequest(If.terminal_create,e,r=>new wZt(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(If.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(If.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}},wZt=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(If.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(If.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(If.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},_w)}release(){return this.connection.sendRequest(If.terminal_release,{sessionId:this.sessionId,terminalId:this.id},_w)}async[Symbol.asyncDispose](){await this.release()}},Prt=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case If.fs_write_text_file:{let u=xZt.parse(l);return await n.writeTextFile?.(u)??{}}case If.fs_read_text_file:{let u=cZt.parse(l);return n.readTextFile?.(u)}case If.session_request_permission:{let u=CZt.parse(l);return n.requestPermission(u)}case If.terminal_create:{let u=XJt.parse(l);return n.createTerminal?.(u)}case If.terminal_output:{let u=AZt.parse(l);return n.terminalOutput?.(u)}case If.terminal_release:{let u=uZt.parse(l);return await n.releaseTerminal?.(u)??{}}case If.terminal_wait_for_exit:{let u=TZt.parse(l);return n.waitForTerminalExit?.(u)}case If.terminal_kill:{let u=sZt.parse(l);return await n.killTerminal?.(u)??{}}case If.elicitation_create:{if(!n.unstable_createElicitation)throw fo.methodNotFound(c);let u=bZt.parse(l);return n.unstable_createElicitation(u)}default:if(n.extMethod)return n.extMethod(c,l);throw fo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case If.session_update:{let u=SZt.parse(l);return n.sessionUpdate(u)}case If.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=QJt.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new Drt(o,s,r)}initialize(e){return this.connection.sendRequest(ci.initialize,e)}newSession(e){return this.connection.sendRequest(ci.session_new,e)}loadSession(e){return this.connection.sendRequest(ci.session_load,e,_w)}unstable_forkSession(e){return this.connection.sendRequest(ci.session_fork,e)}listSessions(e){return this.connection.sendRequest(ci.session_list,e)}unstable_deleteSession(e){return this.connection.sendRequest(ci.session_delete,e,_w)}resumeSession(e){return this.connection.sendRequest(ci.session_resume,e)}closeSession(e){return this.connection.sendRequest(ci.session_close,e)}setSessionMode(e){return this.connection.sendRequest(ci.session_set_mode,e,_w)}unstable_setSessionModel(e){return this.connection.sendRequest(ci.session_set_model,e,_w)}setSessionConfigOption(e){return this.connection.sendRequest(ci.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(ci.authenticate,e,_w)}unstable_listProviders(e){return this.connection.sendRequest(ci.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(ci.providers_set,e,_w)}unstable_disableProvider(e){return this.connection.sendRequest(ci.providers_disable,e,_w)}unstable_logout(e){return this.connection.sendRequest(ci.logout,e,_w)}prompt(e){return this.connection.sendRequest(ci.session_prompt,e)}cancel(e){return this.connection.sendNotification(ci.session_cancel,e)}unstable_startNes(e){return this.connection.sendRequest(ci.nes_start,e)}unstable_suggestNes(e){return this.connection.sendRequest(ci.nes_suggest,e)}unstable_closeNes(e){return this.connection.sendRequest(ci.nes_close,e,_w)}unstable_didOpenDocument(e){return this.connection.sendNotification(ci.document_did_open,e)}unstable_didChangeDocument(e){return this.connection.sendNotification(ci.document_did_change,e)}unstable_didCloseDocument(e){return this.connection.sendNotification(ci.document_did_close,e)}unstable_didSaveDocument(e){return this.connection.sendNotification(ci.document_did_save,e)}unstable_didFocusDocument(e){return this.connection.sendNotification(ci.document_did_focus,e)}unstable_acceptNes(e){return this.connection.sendNotification(ci.nes_accept,e)}unstable_rejectNes(e){return this.connection.sendNotification(ci.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}},Drt=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 fo)return n.toResult();if(n instanceof k.ZodError)return fo.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 fo.internalError(o?JSON.parse(o):{}).toResult()}catch{return fo.internalError({details:o}).toResult()}}}async tryCallNotificationHandler(e,r){try{return await this.notificationHandler(e,r),{result:null}}catch(n){if(n instanceof fo)return n.toResult();if(n instanceof k.ZodError)return fo.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 fo.internalError(o?JSON.parse(o):{}).toResult()}catch{return fo.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 fo(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 r2n(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?r2n(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}},fo=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 cCe=require("node:stream");p();Oo();p();var rb=class extends LY{constructor(r){super(new fle,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","EnableCopilotNesNonFree","EnableMapCodeFallback","SearchAgent","UseHelixFetcher","PerfEnabled","TransparentTokenRefresh","AuthTokenEncryption","DisableWorkspaceIndex"].forEach(s=>{for(let c of["AGENT_DEBUG_","GITHUB_COPILOT_","GH_COPILOT_"]){let l=`${c}${Nls(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(Ye[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 Nls(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(Nls,"camelCaseToSnakeCaseAllCaps");var Mls="unknown-editor",n2n="unknown-editor-plugin",oj=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:Mls,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:n2n,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}isEditorPluginInfoKnown(){return this._editorPluginInfo!==void 0&&this._editorPluginInfo.name!==n2n}};p();p();var Nrt=new fe("agenticTurnProcessor"),WRe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.turnSuggestions=new Sq(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new p0(e.ctx),this.hookTrigger=new ede(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:XQ.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 tl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!WAn(this.turn.chatMode)){let h=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});Et(this.turnContext.ctx,"customAgent.turn",h),ex(this.turnContext.ctx,"customAgent.turn",h)}r.onCancellationRequested(async()=>{Nrt.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let u=i2().find(h=>h.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let f=(await tw(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 hO(this.turnContext.ctx,m,h):await wo.getModelConfigurationById(this.turnContext.ctx,h,this.conversation.id.toString(),oq(this.conversation.turns));wo.applyModelConfigurationOverrides(this.turnContext.ctx,g,c),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(ZC).checkAndCompress(this.conversation,g,"pre-turn",r,String(this.turn.id))}catch(E){ot.exception(this.turnContext.ctx,E,"Pre-turn automatic compression check failed")}await new _de(this.turnContext,this.chatFetcher,g,l).run(r);let y={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let E=await this.fetchSuggestedTitle(r,l.extendedBy({messageSource:"chat.user"},{}));typeof E=="string"&&E!==""&&(y.suggestedTitle=E)}await this.endProgress(y)}catch(h){if(h instanceof Vq)Nrt.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,h),this.turn.status="cancelled",await this.cancelProgress();else if(h instanceof Oc)Nrt.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 dF)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:{message:h.message,code:XQ.ToolRoundExceedError,responseIsIncomplete:!0}});else if(h instanceof LA)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:h.conversationError});else throw Nrt.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 due(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=sq(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=mXe(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=Jue(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 RZt="collect-context",kZt="generate-response",Mrt=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.postProcessor=new Eue(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new p0(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:XQ.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 tl(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=i2().find(A=>A.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let d=(await tw(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(RZt,"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 wo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),oq(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(RZt,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(RZt),await n.steps.start(kZt,"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),E=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:E}))}}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 due(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 xq((E,_,v,b,T,w)=>{let R=E.trim(),x=R.match(Hxe)!==null&&R.endsWith("-->");if(this.conversationProgress.report(this.conversation,this.turn,{reply:E,annotations:_,references:v,hideText:x,notifications:b.map(P=>({severity:"warning",message:P.message})),thinking:w}),this.turn.response?this.turn.response.message=vJe(this.turn.response.message,E):this.turn.response={message:E,type:"model"},this.turn.annotations.push(..._??[]),l+=E,this.strategy.currentDocument){let P=this.strategy.extractEditsFromResponse(l,this.strategy.currentDocument);P&&P.length>0&&(l="",this.conversationProgress.report(this.conversation,this.turn,{codeEdits:P}),u+=P.length)}}),f=c?.id,h=c?.providerName,m=h&&f?await hO(this.turnContext.ctx,h,f):await wo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),Nyn(e));wo.applyModelConfigurationOverrides(this.turnContext.ctx,m,c),e=wo.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(ZC).checkAndCompress(this.conversation,m,"pre-turn",r,String(this.turn.id))}catch(E){ot.exception(this.turnContext.ctx,E,"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:Pn(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,Pn(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",Iyn(this.turnContext.ctx,this.conversation,this.strategy.uiKind,Pn(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=cxe(this.conversation,this.strategy.uiKind,Pn(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=cxe(this.conversation,this.strategy.uiKind,Pn(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(kZt,e.error.message):await r.steps.finish(kZt)}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=mXe(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=Jue(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();Oo();p();var NYi=de(Xc()),MYi=de(DP());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 QA=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(i2n(e))}};function Oe(t,e){let r=qu.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=i2n(r.Errors(s));return[null,{code:Ze.InvalidParams,message:c}]}return e(n,o,s)}}a(Oe,"addMethodHandlerValidation");function i2n(t){return`Schema validation failed with the following errors: ${Array.from(t).map(r=>`- ${r.path}: ${r.message}`).join(` -`)}`}a(n2n,"createErrorMessage");p();p();p();p();function Drt(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}:{}},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:mO(e)}:{}}}a(Drt,"toAgentModelInfo");p();var i2n=new fe("BackgroundAgent.AuthBinding"),Nrt=class{constructor(e){this.ctx=e}static{a(this,"AuthBinding")}async buildAuthInfo(){let r=await this.ctx.get(Ur).resolveSession();if(!r)throw new Error("Not authenticated. Please sign in first.");let n=r.serverUrl.replace(/\/+$/,"")||"https://github.com",o;try{let l=(await this.ctx.get(Qt).getToken()).endpoints.api;l&&(o={endpoints:{api:l}})}catch(s){i2n.warn(this.ctx,"Could not retrieve CopilotToken endpoints for SDK authInfo",{error:s instanceof Error?s.message:String(s)})}return{type:"token",token:r.accessToken,host:n,...o&&{copilotUser:o}}}async detectIdentityChange(){let e;try{e=(await this.ctx.get(Ur).resolveSession())?.accessToken}catch(o){return i2n.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 kls=new fe("BackgroundAgent.Attachments");function o2n(t,e){let r=[];for(let n of t){let o=Pls(n);o?r.push(o):kls.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(o2n,"convertReferencesToAttachments");function Pls(t){switch(t.type){case"file":{let e=to(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=to(t.uri).fsPath;return{type:"directory",path:e,displayName:e}}default:return null}}a(Pls,"convertReferenceToAttachment");p();var UJ=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}};function kZt(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(kZt,"describeCauseChain");function Mrt(t){let e=t instanceof Error?t.message:String(t),r=kZt(t);return r?`${e} (cause: ${r})`:e}a(Mrt,"formatErrorWithCause");var zRe=class extends UJ{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},YRe=class extends UJ{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();function s2n(t,e){switch(e.type){case"permission":t.respondToPermission(e.requestId,e.result);break;case"user_input":t.respondToUserInput(e.requestId,e.response);break;case"elicitation":t.respondToElicitation(e.requestId,e.response);break;case"exit_plan_mode":t.respondToExitPlanMode(e.requestId,e.response);break;case"queued_command":t.respondToQueuedCommand(e.requestId,e.result);break;case"external_tool":t.respondToExternalTool(e.requestId,e.result);break;default:throw new Error(`Unknown interaction type: ${e.type}`)}return{success:!0}}a(s2n,"routeInteraction");p();var a2n=new fe("BackgroundAgent.OTelEnv"),PZt=new Map,DZt=new Set;function Ort(t,e){process.env[t]||(PZt.has(t)||PZt.set(t,process.env[t]),process.env[t]=e,DZt.add(t))}a(Ort,"setEnvIfAbsent");function c2n(){for(let t of DZt){let e=PZt.get(t);e===void 0?delete process.env[t]:process.env[t]=e}DZt.clear()}a(c2n,"restoreOTelEnvironment");function l2n(t){if(!t.get(bn).getCapabilities().agentDebugLog)return;process.env.COPILOT_OTEL_ENABLED&&process.env.COPILOT_OTEL_ENABLED!=="true"&&a2n.info(t,"COPILOT_OTEL_ENABLED already set by user, skipping OTel env setup",{value:process.env.COPILOT_OTEL_ENABLED}),Ort("COPILOT_OTEL_ENABLED","true");let e=!!process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||!!process.env.OTEL_EXPORTER_OTLP_ENDPOINT,r=process.env.COPILOT_OTEL_EXPORTER_TYPE==="file";!e&&!r&&(Ort("COPILOT_OTEL_EXPORTER_TYPE","file"),Ort("COPILOT_OTEL_FILE_EXPORTER_PATH",process.platform==="win32"?"NUL":"/dev/null"),Ort("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","true")),a2n.info(t,"Applied OTel environment for SDK bridge",{userConfiguredOtlpEndpoint:e,userConfiguredFileExporter:r})}a(l2n,"applyOTelEnvironment");p();p();var i8n=de(require("crypto")),o8n=de(require("fs")),dot=de(r8n()),s8n=require("tls"),a8n=de(n8n());var epe=new fe("certificates"),pp=class{static{a(this,"RootCertificateReader")}};function fot(t,e=process.platform){return new onr(t,[new snr,new anr,kSs(t,e)])}a(fot,"getRootCertificateReader");function kSs(t,e){switch(e){case"linux":return new cnr(t);case"darwin":return new lnr(t);case"win32":return new unr(t);default:return new dnr}}a(kSs,"createPlatformReader");var inr=class extends pp{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 epe.warn(this.ctx,"Failed to read root certificates:",r),[]}}},onr=class extends pp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new inr(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 i8n.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return epe.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&epe.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},snr=class extends pp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return s8n.rootCertificates}},anr=class extends pp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await c8n(e):[]}},cnr=class extends pp{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 c8n(n);epe.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},lnr=class extends pp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=dot.get({excludeBundled:!1,format:dot.Format.pem});return epe.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},unr=class extends pp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=a8n.all();return epe.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},dnr=class extends pp{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function c8n(t){let e;try{e=await o8n.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(c8n,"readCertsFromFile");var oH=de($ar());var War=new fe("BackgroundAgent.ProxyEnv"),zar=new Map,Yar=new Set,A2e;function Kar(){for(let t of Yar){let e=zar.get(t);e===void 0?delete process.env[t]:process.env[t]=e}Yar.clear(),A2e&&((0,oH.setGlobalDispatcher)(A2e),A2e=void 0)}a(Kar,"restoreProxyEnvironment");function Var(t,e,r){process.env[t]||process.env[e]||(zar.has(t)||zar.set(t,process.env[t]),process.env[t]=r,Yar.add(t))}a(Var,"setEnvIfAbsent");function QBs(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(QBs,"buildProxyUrl");async function qBs(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(pp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{War.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(qBs,"buildTlsOptions");async function uat(t){try{Kar();let e=t.get(Lo).getHttpSettings();if(!e.proxy)return;let r=QBs(e.proxy,e.proxyAuthorization);Var("HTTPS_PROXY","https_proxy",r),Var("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&Var("NO_PROXY","no_proxy",n),A2e||(A2e=(0,oH.getGlobalDispatcher)());let o=await qBs(t,e.proxyStrictSSL);(0,oH.setGlobalDispatcher)(new oH.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),War.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,oH.getGlobalDispatcher)().constructor.name})}catch(e){War.warn(t,"Failed to apply proxy settings to environment:",e)}}a(uat,"applyProxyToEnvironment");p();var jBs=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"],dat=["get_errors"],Jar=[...dat,"edit","str_replace_editor","apply_patch"],HBs=["ask","inline-ask","inline"];function fat(t){return t!==void 0&&HBs.includes(t)}a(fat,"isClampedChatMode");var GBs={ask:jBs,inline:Jar,"inline-ask":dat};async function MGn(t,e,r){let n,o,s,c;e==="agent"?(n=null,o=await r.loadCustomAgents(),s=new Set(await r.getPolicyDisabledSkillNames()),c=await r.getMcpServers()):(n=[...GBs[e]],o=[],s=new Set(await r.getAllLoadedSkillNames()),c={});let l={availableTools:n,customAgents:o,disabledSkills:s,mcpServers:c};t.updateOptions(l,{emitToolDefinitionsChanged:!0})}a(MGn,"applyChatMode");p();var wT=de(require("node:path"));var BGn="copilot-language-server:inline-chat",$Bs=["file","path","filePath","file_path"],VBs=new Set(["edit","create","str_replace_editor","write"]),WBs=new Set(["git_apply_patch"]),OGn=/^\*\*\* (?:Add File|Delete File|Update File|Move to): (.+)$/gm;function zBs(t){let e=wT.dirname(t);return{confinedFsPath:t,confinedName:wT.basename(t),baseDir:e,confinedComparable:Zar(t,e)}}a(zBs,"buildContext");function YBs(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(YBs,"parseToolArgs");function KBs(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(KBs,"extractApplyPatchBody");function JBs(t){if(!t.includes("*** Begin Patch"))return;let e=[];OGn.lastIndex=0;for(let r of t.matchAll(OGn)){let n=r[1].trim();n.length>0&&e.push(n)}return e}a(JBs,"extractApplyPatchPaths");function ZBs(t){for(let e of $Bs){let r=t[e];if(typeof r=="string"&&r.trim().length>0)return r}}a(ZBs,"extractTargetPath");function Zar(t,e){let r=t.startsWith("file:")?un(t):t,n=wT.isAbsolute(r)?wT.normalize(r):wT.resolve(e,r);return process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n}a(Zar,"toComparablePath");function LGn(t,e){return wT.isAbsolute(t)?wT.normalize(t):wT.resolve(e,t)}a(LGn,"resolveTargetPath");function XBs(t,e,r){if(WBs.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=KBs(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=JBs(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(Zar(c,r.baseDir)!==r.confinedComparable)return{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${LGn(c,r.baseDir)} (apply_patch header: ${c}).`};return{allowed:!0}}if(!VBs.has(t))return{allowed:!0};let n=ZBs(YBs(e));return n?Zar(n,r.baseDir)!==r.confinedComparable?{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${LGn(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(XBs,"evaluateWithContext");function FGn(t){let e=0;return{hook:{source:BGn,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(FGn,"createInlineTurnLimitHook");function UGn(t){let e=t.startsWith("file:")?un(t):t,r=zBs(e);return{source:BGn,handler:a(n=>{let o=XBs(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(UGn,"createInlineEditConfinementHook");p();var Xar=de(require("fs"));var jpe=new fe("BackgroundAgent.InlineFileContext"),e3s=50*1024,pat=100,t3s=.4,QGn=25;async function qGn(t,e,r){let n;try{n=to(t).fsPath}catch{return jpe.debug(r,`buildInlineFileContext: failed to parse URI ${t}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let o;try{o=await Xar.promises.stat(n)}catch{return jpe.debug(r,`buildInlineFileContext: failed to stat ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let s=o.size>e3s,c;try{c=await Xar.promises.readFile(n,"utf-8")}catch{return jpe.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(i2n,"createErrorMessage");p();p();p();p();function Ort(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}:{}},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:mO(e)}:{}}}a(Ort,"toAgentModelInfo");p();var o2n=new fe("BackgroundAgent.AuthBinding"),Lrt=class{constructor(e){this.ctx=e}static{a(this,"AuthBinding")}async buildAuthInfo(){let r=await this.ctx.get(Ur).resolveSession();if(!r)throw new Error("Not authenticated. Please sign in first.");let n=r.serverUrl.replace(/\/+$/,"")||"https://github.com",o;try{let l=(await this.ctx.get(Qt).getToken()).endpoints.api;l&&(o={endpoints:{api:l}})}catch(s){o2n.warn(this.ctx,"Could not retrieve CopilotToken endpoints for SDK authInfo",{error:s instanceof Error?s.message:String(s)})}return{type:"token",token:r.accessToken,host:n,...o&&{copilotUser:o}}}async detectIdentityChange(){let e;try{e=(await this.ctx.get(Ur).resolveSession())?.accessToken}catch(o){return o2n.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 Ols=new fe("BackgroundAgent.Attachments");function s2n(t,e){let r=[];for(let n of t){let o=Lls(n);o?r.push(o):Ols.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(s2n,"convertReferencesToAttachments");function Lls(t){switch(t.type){case"file":{let e=to(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=to(t.uri).fsPath;return{type:"directory",path:e,displayName:e}}default:return null}}a(Lls,"convertReferenceToAttachment");p();var UJ=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}};function PZt(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(PZt,"describeCauseChain");function Brt(t){let e=t instanceof Error?t.message:String(t),r=PZt(t);return r?`${e} (cause: ${r})`:e}a(Brt,"formatErrorWithCause");var zRe=class extends UJ{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},YRe=class extends UJ{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();function a2n(t,e){switch(e.type){case"permission":t.respondToPermission(e.requestId,e.result);break;case"user_input":t.respondToUserInput(e.requestId,e.response);break;case"elicitation":t.respondToElicitation(e.requestId,e.response);break;case"exit_plan_mode":t.respondToExitPlanMode(e.requestId,e.response);break;case"queued_command":t.respondToQueuedCommand(e.requestId,e.result);break;case"external_tool":t.respondToExternalTool(e.requestId,e.result);break;default:throw new Error(`Unknown interaction type: ${e.type}`)}return{success:!0}}a(a2n,"routeInteraction");p();var c2n=new fe("BackgroundAgent.OTelEnv"),DZt=new Map,NZt=new Set;function Frt(t,e){process.env[t]||(DZt.has(t)||DZt.set(t,process.env[t]),process.env[t]=e,NZt.add(t))}a(Frt,"setEnvIfAbsent");function l2n(){for(let t of NZt){let e=DZt.get(t);e===void 0?delete process.env[t]:process.env[t]=e}NZt.clear()}a(l2n,"restoreOTelEnvironment");function u2n(t){if(!t.get(bn).getCapabilities().agentDebugLog)return;process.env.COPILOT_OTEL_ENABLED&&process.env.COPILOT_OTEL_ENABLED!=="true"&&c2n.info(t,"COPILOT_OTEL_ENABLED already set by user, skipping OTel env setup",{value:process.env.COPILOT_OTEL_ENABLED}),Frt("COPILOT_OTEL_ENABLED","true");let e=!!process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||!!process.env.OTEL_EXPORTER_OTLP_ENDPOINT,r=process.env.COPILOT_OTEL_EXPORTER_TYPE==="file";!e&&!r&&(Frt("COPILOT_OTEL_EXPORTER_TYPE","file"),Frt("COPILOT_OTEL_FILE_EXPORTER_PATH",process.platform==="win32"?"NUL":"/dev/null"),Frt("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","true")),c2n.info(t,"Applied OTel environment for SDK bridge",{userConfiguredOtlpEndpoint:e,userConfiguredFileExporter:r})}a(u2n,"applyOTelEnvironment");p();p();var o8n=de(require("crypto")),s8n=de(require("fs")),hot=de(n8n()),a8n=require("tls"),c8n=de(i8n());var epe=new fe("certificates"),pp=class{static{a(this,"RootCertificateReader")}};function mot(t,e=process.platform){return new snr(t,[new anr,new cnr,OSs(t,e)])}a(mot,"getRootCertificateReader");function OSs(t,e){switch(e){case"linux":return new lnr(t);case"darwin":return new unr(t);case"win32":return new dnr(t);default:return new fnr}}a(OSs,"createPlatformReader");var onr=class extends pp{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 epe.warn(this.ctx,"Failed to read root certificates:",r),[]}}},snr=class extends pp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new onr(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 o8n.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return epe.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&epe.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},anr=class extends pp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return a8n.rootCertificates}},cnr=class extends pp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await l8n(e):[]}},lnr=class extends pp{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 l8n(n);epe.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},unr=class extends pp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=hot.get({excludeBundled:!1,format:hot.Format.pem});return epe.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},dnr=class extends pp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=c8n.all();return epe.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},fnr=class extends pp{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function l8n(t){let e;try{e=await s8n.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(l8n,"readCertsFromFile");var sH=de(Var());var zar=new fe("BackgroundAgent.ProxyEnv"),Yar=new Map,Kar=new Set,A2e;function Jar(){for(let t of Kar){let e=Yar.get(t);e===void 0?delete process.env[t]:process.env[t]=e}Kar.clear(),A2e&&((0,sH.setGlobalDispatcher)(A2e),A2e=void 0)}a(Jar,"restoreProxyEnvironment");function War(t,e,r){process.env[t]||process.env[e]||(Yar.has(t)||Yar.set(t,process.env[t]),process.env[t]=r,Kar.add(t))}a(War,"setEnvIfAbsent");function $Bs(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($Bs,"buildProxyUrl");async function VBs(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(pp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{zar.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(VBs,"buildTlsOptions");async function pat(t){try{Jar();let e=t.get(Bo).getHttpSettings();if(!e.proxy)return;let r=$Bs(e.proxy,e.proxyAuthorization);War("HTTPS_PROXY","https_proxy",r),War("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&War("NO_PROXY","no_proxy",n),A2e||(A2e=(0,sH.getGlobalDispatcher)());let o=await VBs(t,e.proxyStrictSSL);(0,sH.setGlobalDispatcher)(new sH.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),zar.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,sH.getGlobalDispatcher)().constructor.name})}catch(e){zar.warn(t,"Failed to apply proxy settings to environment:",e)}}a(pat,"applyProxyToEnvironment");p();var WBs=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"],hat=["get_errors"],Zar=[...hat,"edit","str_replace_editor","apply_patch"],zBs=["ask","inline-ask","inline"];function mat(t){return t!==void 0&&zBs.includes(t)}a(mat,"isClampedChatMode");var YBs={ask:WBs,inline:Zar,"inline-ask":hat};async function OGn(t,e,r){let n,o,s,c;e==="agent"?(n=null,o=await r.loadCustomAgents(),s=new Set(await r.getPolicyDisabledSkillNames()),c=await r.getMcpServers()):(n=[...YBs[e]],o=[],s=new Set(await r.getAllLoadedSkillNames()),c={});let l={availableTools:n,customAgents:o,disabledSkills:s,mcpServers:c};t.updateOptions(l,{emitToolDefinitionsChanged:!0})}a(OGn,"applyChatMode");p();var kT=de(require("node:path"));var FGn="copilot-language-server:inline-chat",KBs=["file","path","filePath","file_path"],JBs=new Set(["edit","create","str_replace_editor","write"]),ZBs=new Set(["git_apply_patch"]),LGn=/^\*\*\* (?:Add File|Delete File|Update File|Move to): (.+)$/gm;function XBs(t){let e=kT.dirname(t);return{confinedFsPath:t,confinedName:kT.basename(t),baseDir:e,confinedComparable:Xar(t,e)}}a(XBs,"buildContext");function e3s(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(e3s,"parseToolArgs");function t3s(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(t3s,"extractApplyPatchBody");function r3s(t){if(!t.includes("*** Begin Patch"))return;let e=[];LGn.lastIndex=0;for(let r of t.matchAll(LGn)){let n=r[1].trim();n.length>0&&e.push(n)}return e}a(r3s,"extractApplyPatchPaths");function n3s(t){for(let e of KBs){let r=t[e];if(typeof r=="string"&&r.trim().length>0)return r}}a(n3s,"extractTargetPath");function Xar(t,e){let r=t.startsWith("file:")?un(t):t,n=kT.isAbsolute(r)?kT.normalize(r):kT.resolve(e,r);return process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n}a(Xar,"toComparablePath");function BGn(t,e){return kT.isAbsolute(t)?kT.normalize(t):kT.resolve(e,t)}a(BGn,"resolveTargetPath");function i3s(t,e,r){if(ZBs.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=t3s(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=r3s(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(Xar(c,r.baseDir)!==r.confinedComparable)return{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${BGn(c,r.baseDir)} (apply_patch header: ${c}).`};return{allowed:!0}}if(!JBs.has(t))return{allowed:!0};let n=n3s(e3s(e));return n?Xar(n,r.baseDir)!==r.confinedComparable?{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${BGn(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(i3s,"evaluateWithContext");function UGn(t){let e=0;return{hook:{source:FGn,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(UGn,"createInlineTurnLimitHook");function QGn(t){let e=t.startsWith("file:")?un(t):t,r=XBs(e);return{source:FGn,handler:a(n=>{let o=i3s(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(QGn,"createInlineEditConfinementHook");p();var ecr=de(require("fs"));var jpe=new fe("BackgroundAgent.InlineFileContext"),o3s=50*1024,gat=100,s3s=.4,qGn=25;async function jGn(t,e,r){let n;try{n=to(t).fsPath}catch{return jpe.debug(r,`buildInlineFileContext: failed to parse URI ${t}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let o;try{o=await ecr.promises.stat(n)}catch{return jpe.debug(r,`buildInlineFileContext: failed to stat ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let s=o.size>o3s,c;try{c=await ecr.promises.readFile(n,"utf-8")}catch{return jpe.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=n3s(c,n,l),jpe.debug(r,`buildInlineFileContext: cropped large file around selection: ${n}`);else if(u)d=i3s(c,n,u),jpe.debug(r,`buildInlineFileContext: cropped large file around cursor: ${n}`);else return jpe.debug(r,`buildInlineFileContext: large file (${o.size} bytes), no cursor or selection: ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!0};if(l)d+=r3s(c,n,l);else if(u){let h=Math.min(u.line,c.split(` +\`\`\``,f=!0;else if(l)d=c3s(c,n,l),jpe.debug(r,`buildInlineFileContext: cropped large file around selection: ${n}`);else if(u)d=l3s(c,n,u),jpe.debug(r,`buildInlineFileContext: cropped large file around cursor: ${n}`);else return jpe.debug(r,`buildInlineFileContext: large file (${o.size} bytes), no cursor or selection: ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!0};if(l)d+=a3s(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(qGn,"buildInlineFileContext");function r3s(t,e,r){let n=t.split(` +The cursor is at 1-based line ${h+1}.`}return{promptFragment:d,isFullContent:f,isLargeFile:s}}a(jGn,"buildInlineFileContext");function a3s(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(r3s,"buildSelectionFragment");function n3s(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-QGn),u=Math.min(o-1,c+QGn),f=n.slice(l,u+1).map((h,m)=>`${l+m+1} | ${h}`).join(` +\`\`\``}a(a3s,"buildSelectionFragment");function c3s(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-qGn),u=Math.min(o-1,c+qGn),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(n3s,"buildCropAroundSelectionFragment");function i3s(t,e,r){let n=t.split(` -`),o=n.length,s=Math.min(r.line,o-1),c=Math.floor(pat*t3s),l=pat-c,u=Math.max(0,s-c),d=Math.min(o,s+l);u===0?d=Math.min(o,pat):d>=o&&(u=Math.max(0,o-pat));let h=n.slice(u,d).map((m,g)=>`${u+g+1} | ${m}`).join(` +\`\`\``}a(c3s,"buildCropAroundSelectionFragment");function l3s(t,e,r){let n=t.split(` +`),o=n.length,s=Math.min(r.line,o-1),c=Math.floor(gat*s3s),l=gat-c,u=Math.max(0,s-c),d=Math.min(o,s+l);u===0?d=Math.min(o,gat):d>=o&&(u=Math.max(0,o-gat));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(i3s,"buildCursorCropFragment");p();p();var jGn=require("node:crypto"),hat=de(require("node:fs")),Hw=de(require("node:fs/promises")),HGn=require("node:os"),H5=de(require("node:path"));var nX=new fe("BackgroundAgent.SandboxBinaryResolver");async function GGn(t){if(!process.env.MXC_BIN_DIR)try{let e=H5.join(__dirname,"node_modules","@github","copilot","mxc-bin");if(!hat.existsSync(e)){nX.debug(t,`Local sandbox binaries not found at ${e}; sandbox will be unavailable`);return}if(!("pkg"in process)){process.env.MXC_BIN_DIR=e,nX.debug(t,`Local sandbox binaries located; MXC_BIN_DIR=${e}`);return}let r=await s3s(t,e);r&&(process.env.MXC_BIN_DIR=r,nX.debug(t,`Local sandbox binaries extracted; MXC_BIN_DIR=${r}`))}catch(e){nX.warn(t,"Failed to resolve MXC_BIN_DIR for the local sandbox",{error:e instanceof Error?e.message:String(e)})}}a(GGn,"ensureSandboxBinDirEnv");function o3s(){switch(process.platform){case"win32":return"wxc-exec.exe";case"darwin":return"mxc-exec-mac";default:return"lxc-exec"}}a(o3s,"sandboxMainBinaryName");async function s3s(t,e){if(process.arch!=="x64"&&process.arch!=="arm64"){nX.debug(t,`Local sandbox unsupported on architecture ${process.arch}; sandbox will be unavailable`);return}let r=process.arch,n=H5.join(e,r),o=o3s(),s=H5.join(n,o);if(!hat.existsSync(s)){nX.warn(t,`Local sandbox binary ${r}/${o} not embedded; sandbox will be unavailable`);return}let c=(0,jGn.createHash)("sha256").update(await Hw.readFile(s)).digest("hex"),l=process.env.PKG_NATIVE_CACHE_PATH||H5.join((0,HGn.homedir)(),".cache"),u=H5.join(l,"pkg",`mxc-bin-${c}`),d=H5.join(u,r),f=H5.join(d,".extraction-complete");if(hat.existsSync(f))return u;await Hw.mkdir(d,{recursive:!0});let h=await Hw.readdir(n,{withFileTypes:!0});for(let m of h){if(!m.isFile())continue;let g=H5.join(d,m.name);await Hw.copyFile(H5.join(n,m.name),g),process.platform!=="win32"&&await Hw.chmod(g,493).catch(A=>nX.warn(t,`Failed to set executable permission for ${g}`,{error:A instanceof Error?A.message:String(A)}))}return await Hw.writeFile(f,""),u}a(s3s,"extractSandboxBinDirFromPkg");p();function $Gn(t,e){let r=t,n=r.permissions?.setRequired;if(typeof n=="function"){Promise.resolve(n.call(r.permissions,{required:e}));return}typeof r.setPermissionsRequired=="function"&&r.setPermissionsRequired(e)}a($Gn,"setPermissionsRequired");function VGn(t,e){let r=t;return typeof r.setRemoteDelegate!="function"?!1:(r.setRemoteDelegate(e),!0)}a(VGn,"setRemoteDelegate");function ecr(t,e,r){let n=t;return typeof n.emit!="function"?!1:(n.emit(e,r),!0)}a(ecr,"emitSessionEvent");function tcr(t){let r=t.remote;if(!(!r||typeof r.enable!="function"||typeof r.disable!="function"))return r}a(tcr,"getRemoteHandle");function WGn(t){let e=t.AutoModeSessionManager;if(typeof e=="function")try{return new e}catch{return}}a(WGn,"createAutoModeSessionManager");function zGn(t){if(t)try{t.clear()}catch{}}a(zGn,"clearAutoModeManager");p();p();p();var mat=require("fs"),gat=de(require("path"));var rcr=new fe("OtelSpanFilePersistence"),a3s="debug.jsonl",pv=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=Ft(this.ctx,Ye.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=c3s(n);if(!o){rcr.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 mat.promises.mkdir(gat.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` +\`\`\``}a(l3s,"buildCursorCropFragment");p();p();var HGn=require("node:crypto"),Aat=de(require("node:fs")),Gw=de(require("node:fs/promises")),GGn=require("node:os"),H5=de(require("node:path"));var nX=new fe("BackgroundAgent.SandboxBinaryResolver");async function $Gn(t){if(!process.env.MXC_BIN_DIR)try{let e=H5.join(__dirname,"node_modules","@github","copilot","mxc-bin");if(!Aat.existsSync(e)){nX.debug(t,`Local sandbox binaries not found at ${e}; sandbox will be unavailable`);return}if(!("pkg"in process)){process.env.MXC_BIN_DIR=e,nX.debug(t,`Local sandbox binaries located; MXC_BIN_DIR=${e}`);return}let r=await d3s(t,e);r&&(process.env.MXC_BIN_DIR=r,nX.debug(t,`Local sandbox binaries extracted; MXC_BIN_DIR=${r}`))}catch(e){nX.warn(t,"Failed to resolve MXC_BIN_DIR for the local sandbox",{error:e instanceof Error?e.message:String(e)})}}a($Gn,"ensureSandboxBinDirEnv");function u3s(){switch(process.platform){case"win32":return"wxc-exec.exe";case"darwin":return"mxc-exec-mac";default:return"lxc-exec"}}a(u3s,"sandboxMainBinaryName");async function d3s(t,e){if(process.arch!=="x64"&&process.arch!=="arm64"){nX.debug(t,`Local sandbox unsupported on architecture ${process.arch}; sandbox will be unavailable`);return}let r=process.arch,n=H5.join(e,r),o=u3s(),s=H5.join(n,o);if(!Aat.existsSync(s)){nX.warn(t,`Local sandbox binary ${r}/${o} not embedded; sandbox will be unavailable`);return}let c=(0,HGn.createHash)("sha256").update(await Gw.readFile(s)).digest("hex"),l=process.env.PKG_NATIVE_CACHE_PATH||H5.join((0,GGn.homedir)(),".cache"),u=H5.join(l,"pkg",`mxc-bin-${c}`),d=H5.join(u,r),f=H5.join(d,".extraction-complete");if(Aat.existsSync(f))return u;await Gw.mkdir(d,{recursive:!0});let h=await Gw.readdir(n,{withFileTypes:!0});for(let m of h){if(!m.isFile())continue;let g=H5.join(d,m.name);await Gw.copyFile(H5.join(n,m.name),g),process.platform!=="win32"&&await Gw.chmod(g,493).catch(A=>nX.warn(t,`Failed to set executable permission for ${g}`,{error:A instanceof Error?A.message:String(A)}))}return await Gw.writeFile(f,""),u}a(d3s,"extractSandboxBinDirFromPkg");p();function VGn(t,e){let r=t,n=r.permissions?.setRequired;if(typeof n=="function"){Promise.resolve(n.call(r.permissions,{required:e}));return}typeof r.setPermissionsRequired=="function"&&r.setPermissionsRequired(e)}a(VGn,"setPermissionsRequired");function WGn(t,e){let r=t;return typeof r.setRemoteDelegate!="function"?!1:(r.setRemoteDelegate(e),!0)}a(WGn,"setRemoteDelegate");function tcr(t,e,r){let n=t;return typeof n.emit!="function"?!1:(n.emit(e,r),!0)}a(tcr,"emitSessionEvent");function rcr(t){let r=t.remote;if(!(!r||typeof r.enable!="function"||typeof r.disable!="function"))return r}a(rcr,"getRemoteHandle");function zGn(t){let e=t.AutoModeSessionManager;if(typeof e=="function")try{return new e}catch{return}}a(zGn,"createAutoModeSessionManager");function YGn(t){if(t)try{t.clear()}catch{}}a(YGn,"clearAutoModeManager");p();p();p();var yat=require("fs"),Eat=de(require("path"));var ncr=new fe("OtelSpanFilePersistence"),f3s="debug.jsonl",hv=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=Ft(this.ctx,Ye.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=p3s(n);if(!o){ncr.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 yat.promises.mkdir(Eat.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` `)+` -`;await mat.promises.appendFile(s,c,{encoding:"utf8",mode:384})}catch(s){rcr.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 mat.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"?[]:(rcr.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 gat.join(r,l3s(e),a3s)}};function c3s(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(c3s,"conversationIdOf");function l3s(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(l3s,"sanitizeForPath");p();var u3s={0:1,1:2,2:3,3:4,4:5};function ncr(t){return String(BigInt(t[0])*BigInt(1e9)+BigInt(t[1]))}a(ncr,"hrTimeToNano");function YGn(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=>YGn(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(YGn,"encodeAnyValue");function k2(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=YGn(n);o!==void 0&&e.push({key:r,value:o})}return e}a(k2,"encodeAttributes");function KGn(t){let e=t.spanContext(),r={traceId:e.traceId,spanId:e.spanId,name:t.name,kind:u3s[t.kind]??1,startTimeUnixNano:ncr(t.startTime),endTimeUnixNano:ncr(t.endTime),attributes:k2(t.attributes),events:t.events.map(n=>({name:n.name,timeUnixNano:ncr(n.time),attributes:k2(n.attributes)})),status:t.status.message?{code:t.status.code??0,message:t.status.message}:{code:t.status.code??0}};return t.parentSpanContext?.spanId&&(r.parentSpanId=t.parentSpanContext.spanId),r}a(KGn,"encodeSpan");function d3s(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(d3s,"wrapInResourceSpans");function JGn(t,e){let r=d3s(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(JGn,"buildChatDebugLogExport");var x2e=new fe("OtelBridge"),nFs=1e3,w2e=class t{constructor(e){this.pending=[];this.flushTimer=null;this.disposed=!1;this.ctx=e,this.persistence=e.get(pv)}static{a(this,"BridgeSpanProcessor")}static installInto(e){try{let n=(co(),ba(V5)).trace.getTracerProvider(),o=n._delegate??n,c=o._activeSpanProcessor?._spanProcessors;if(!Array.isArray(c)){let u=o?Object.keys(o).join(", "):"null";return x2e.warn(e,`Could not access SDK TracerProvider internals. delegate keys: [${u}]`),{installed:!1}}let l=new t(e);return c.push(l),x2e.info(e,`Bridge SpanProcessor installed (total processors=${c.length}).`),{installed:!0,processor:l}}catch(r){return x2e.warn(e,`Failed to install bridge SpanProcessor: ${String(r)}`),{installed:!1}}}onStart(e,r){}onEnd(e){this.disposed||(this.pending.push(e),this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flush()},nFs)))}async forceFlush(){await this.flush()}async shutdown(){this.disposed=!0,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),await this.flush()}async flush(){if(this.flushTimer=null,this.pending.length===0)return;let e=this.pending;this.pending=[];let r;try{r=e.map(KGn)}catch(n){x2e.warn(this.ctx,`Failed to encode spans: ${String(n)}`);return}try{await this.persistence.appendSpans(r)}catch(n){x2e.warn(this.ctx,`Failed to persist otel spans: ${String(n)}`)}}};var oVn=require("node:module");var iVn=new fe("BackgroundAgent.ManagerLifecycle");async function iFs(){return"pkg"in process?(0,oVn.createRequire)(__filename)("./node_modules/@github/copilot/sdk/index.cjs"):import("@github/copilot/sdk")}a(iFs,"importSdk");var kat=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("LocalSessionManager initialization succeeded but manager is undefined");return this.manager}getSdk(){return this.sdk}getAutoModeManager(){return this.autoModeManager}ensureBridgeInstalled(){if(this.installedBridge!==void 0||!this.ctx.get(bn).getCapabilities().agentDebugLog)return;let e=w2e.installInto(this.ctx);this.installedBridge=e.processor}clearAutoMode(){zGn(this.autoModeManager)}async dispose(){this.manager&&(await this.manager.dispose(),this.manager=void 0),this.sdk=void 0,this.autoModeManager=void 0,this.managerInitPromise=void 0}setStubManagerForTesting(e){this.manager=e}setStubSdkForTesting(e){this.sdk=e}setAutoModeManagerForTesting(e){this.autoModeManager=e}async initManager(){iVn.info(this.ctx,"Initializing LocalSessionManager (in-process SDK)..."),l2n(this.ctx);let e=performance.now();try{this.sdk=await iFs(),At(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(o){throw Vn(this.ctx,"backgroundAgent.importSdk",o,{status_text:"failure"},{duration_ms:performance.now()-e}),o}await GGn(this.ctx),await uat(this.ctx);let r={telemetryService:new this.sdk.internal.NoopTelemetryService};typeof this.sdk.createLocalFeatureFlagServiceCreator=="function"&&(r.createFeatureFlagService=this.sdk.createLocalFeatureFlagServiceCreator()),typeof this.sdk.createLocalFeatureFlagService=="function"&&(r.featureFlagService=this.sdk.createLocalFeatureFlagService());let n=WGn(this.sdk);n!==void 0&&(r.autoModeManager=n),this.autoModeManager=n,this.manager=new this.sdk.internal.LocalSessionManager(r),iVn.info(this.ctx,"LocalSessionManager initialized.")}};p();p();p();p();function W5(t){try{return Ft(t,Ye.EnablePlugins)===!0}catch{return!1}}a(W5,"pluginsEnabled");var PT=class{static{a(this,"McpGatewayHost")}constructor(e,r,n){this._ctx=e,this._service=r,this._manager=n}get service(){return this._service}buildMcpServers(e){let r=this._manager.listReadyEntries(),n=W5(this._ctx),o=new Map,s=new Map,c=new Map;for(let u of r){if(u.url===null)continue;let d=u.key.source;d.kind==="user"?o.set(u.key.name,{type:"http",url:u.url,tools:["*"]}):d.kind==="project"&&e!==void 0&&d.workspaceFolder===e?s.set(u.key.name,{type:"http",url:u.url,tools:["*"]}):d.kind==="plugin"&&n&&c.set(u.key.name,{type:"http",url:u.url,tools:["*"]})}let l={};for(let[u,d]of c)l[u]=d;for(let[u,d]of o)l[u]=d;for(let[u,d]of s)l[u]=d;return l}async dispose(){}};p();p();var zl={ToolsListChanged:"tools/listChanged",ResourcesListChanged:"resources/listChanged",PromptsListChanged:"prompts/listChanged",LoggingMessage:"logging/message"};p();p();var Icr;Icr=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function oFs(t){return(await Icr).getRandomValues(new Uint8Array(t))}a(oFs,"getRandomValues");async function sFs(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await oFs(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await aFs(t),r=await cFs(e);return{code_verifier:e,code_challenge:r}}a(xcr,"pkceChallenge");p();var Gw="2025-11-25";var Dat=[Gw,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],cH="io.modelcontextprotocol/related-task",Nat="2.0",y0=MJt(t=>t!==null&&(typeof t=="object"||typeof t=="function")),sVn=Il([Je(),ka().int()]),aVn=Je(),L0f=om({ttl:ka().optional(),pollInterval:ka().optional()}),uFs=zr({ttl:ka().optional()}),dFs=zr({taskId:Je()}),Rcr=om({progressToken:sVn.optional(),[cH]:dFs.optional()}),DT=zr({_meta:Rcr.optional()}),R2e=DT.extend({task:uFs.optional()}),cVn=a(t=>R2e.safeParse(t).success,"isTaskAugmentedRequestParams"),WA=zr({method:Je(),params:DT.loose().optional()}),$w=zr({_meta:Rcr.optional()}),Vw=zr({method:Je(),params:$w.loose().optional()}),zA=om({_meta:Rcr.optional()}),Mat=Il([Je(),ka().int()]),lVn=zr({jsonrpc:Gn(Nat),id:Mat,...WA.shape}).strict(),k2e=a(t=>lVn.safeParse(t).success,"isJSONRPCRequest"),uVn=zr({jsonrpc:Gn(Nat),...Vw.shape}).strict(),dVn=a(t=>uVn.safeParse(t).success,"isJSONRPCNotification"),kcr=zr({jsonrpc:Gn(Nat),id:Mat,result:zA}).strict(),lX=a(t=>kcr.safeParse(t).success,"isJSONRPCResultResponse");var ei;(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"})(ei||(ei={}));var Pcr=zr({jsonrpc:Gn(Nat),id:Mat.optional(),error:zr({code:ka().int(),message:Je(),data:od().optional()})}).strict();var fVn=a(t=>Pcr.safeParse(t).success,"isJSONRPCErrorResponse");var lH=Il([lVn,uVn,kcr,Pcr]),B0f=Il([kcr,Pcr]),uX=zA.strict(),fFs=$w.extend({requestId:Mat.optional(),reason:Je().optional()}),Oat=Vw.extend({method:Gn("notifications/cancelled"),params:fFs}),pFs=zr({src:Je(),mimeType:Je().optional(),sizes:Fr(Je()).optional(),theme:rv(["light","dark"]).optional()}),P2e=zr({icons:Fr(pFs).optional()}),Wpe=zr({name:Je(),title:Je().optional()}),pVn=Wpe.extend({...Wpe.shape,...P2e.shape,version:Je(),websiteUrl:Je().optional(),description:Je().optional()}),hFs=qRe(zr({applyDefaults:ol().optional()}),xl(Je(),od())),mFs=vrt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,qRe(zr({form:hFs.optional(),url:y0.optional()}),xl(Je(),od()).optional())),gFs=om({list:y0.optional(),cancel:y0.optional(),requests:om({sampling:om({createMessage:y0.optional()}).optional(),elicitation:om({create:y0.optional()}).optional()}).optional()}),AFs=om({list:y0.optional(),cancel:y0.optional(),requests:om({tools:om({call:y0.optional()}).optional()}).optional()}),yFs=zr({experimental:xl(Je(),y0).optional(),sampling:zr({context:y0.optional(),tools:y0.optional()}).optional(),elicitation:mFs.optional(),roots:zr({listChanged:ol().optional()}).optional(),tasks:gFs.optional(),extensions:xl(Je(),y0).optional()}),EFs=DT.extend({protocolVersion:Je(),capabilities:yFs,clientInfo:pVn}),_Fs=WA.extend({method:Gn("initialize"),params:EFs});var vFs=zr({experimental:xl(Je(),y0).optional(),logging:y0.optional(),completions:y0.optional(),prompts:zr({listChanged:ol().optional()}).optional(),resources:zr({subscribe:ol().optional(),listChanged:ol().optional()}).optional(),tools:zr({listChanged:ol().optional()}).optional(),tasks:AFs.optional(),extensions:xl(Je(),y0).optional()}),Dcr=zA.extend({protocolVersion:Je(),capabilities:vFs,serverInfo:pVn,instructions:Je().optional()}),hVn=Vw.extend({method:Gn("notifications/initialized"),params:$w.optional()}),mVn=a(t=>hVn.safeParse(t).success,"isInitializedNotification"),Lat=WA.extend({method:Gn("ping"),params:DT.optional()}),CFs=zr({progress:ka(),total:bu(ka()),message:bu(Je())}),bFs=zr({...$w.shape,...CFs.shape,progressToken:sVn}),Bat=Vw.extend({method:Gn("notifications/progress"),params:bFs}),SFs=DT.extend({cursor:aVn.optional()}),D2e=WA.extend({params:SFs.optional()}),N2e=zA.extend({nextCursor:aVn.optional()}),TFs=rv(["working","input_required","completed","failed","cancelled"]),M2e=zr({taskId:Je(),status:TFs,ttl:Il([ka(),mrt()]),createdAt:Je(),lastUpdatedAt:Je(),pollInterval:bu(ka()),statusMessage:bu(Je())}),dX=zA.extend({task:M2e}),IFs=$w.merge(M2e),O2e=Vw.extend({method:Gn("notifications/tasks/status"),params:IFs}),Fat=WA.extend({method:Gn("tasks/get"),params:DT.extend({taskId:Je()})}),Uat=zA.merge(M2e),Qat=WA.extend({method:Gn("tasks/result"),params:DT.extend({taskId:Je()})}),F0f=zA.loose(),qat=D2e.extend({method:Gn("tasks/list")}),jat=N2e.extend({tasks:Fr(M2e)}),Hat=WA.extend({method:Gn("tasks/cancel"),params:DT.extend({taskId:Je()})}),gVn=zA.merge(M2e),AVn=zr({uri:Je(),mimeType:bu(Je()),_meta:xl(Je(),od()).optional()}),yVn=AVn.extend({text:Je()}),Ncr=Je().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),EVn=AVn.extend({blob:Ncr}),L2e=rv(["user","assistant"]),zpe=zr({audience:Fr(L2e).optional(),priority:ka().min(0).max(1).optional(),lastModified:Ude.datetime({offset:!0}).optional()}),_Vn=zr({...Wpe.shape,...P2e.shape,uri:Je(),description:bu(Je()),mimeType:bu(Je()),size:bu(ka()),annotations:zpe.optional(),_meta:bu(om({}))}),xFs=zr({...Wpe.shape,...P2e.shape,uriTemplate:Je(),description:bu(Je()),mimeType:bu(Je()),annotations:zpe.optional(),_meta:bu(om({}))}),wFs=D2e.extend({method:Gn("resources/list")}),Mcr=N2e.extend({resources:Fr(_Vn)}),RFs=D2e.extend({method:Gn("resources/templates/list")}),Ocr=N2e.extend({resourceTemplates:Fr(xFs)}),Lcr=DT.extend({uri:Je()}),kFs=Lcr,PFs=WA.extend({method:Gn("resources/read"),params:kFs}),Bcr=zA.extend({contents:Fr(Il([yVn,EVn]))}),o8=Vw.extend({method:Gn("notifications/resources/list_changed"),params:$w.optional()}),DFs=Lcr,NFs=WA.extend({method:Gn("resources/subscribe"),params:DFs}),MFs=Lcr,OFs=WA.extend({method:Gn("resources/unsubscribe"),params:MFs}),LFs=$w.extend({uri:Je()}),Fcr=Vw.extend({method:Gn("notifications/resources/updated"),params:LFs}),BFs=zr({name:Je(),description:bu(Je()),required:bu(ol())}),FFs=zr({...Wpe.shape,...P2e.shape,description:bu(Je()),arguments:bu(Fr(BFs)),_meta:bu(om({}))}),UFs=D2e.extend({method:Gn("prompts/list")}),Ucr=N2e.extend({prompts:Fr(FFs)}),QFs=DT.extend({name:Je(),arguments:xl(Je(),Je()).optional()}),qFs=WA.extend({method:Gn("prompts/get"),params:QFs}),Qcr=zr({type:Gn("text"),text:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),qcr=zr({type:Gn("image"),data:Ncr,mimeType:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),jcr=zr({type:Gn("audio"),data:Ncr,mimeType:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),jFs=zr({type:Gn("tool_use"),name:Je(),id:Je(),input:xl(Je(),od()),_meta:xl(Je(),od()).optional()}),HFs=zr({type:Gn("resource"),resource:Il([yVn,EVn]),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),GFs=_Vn.extend({type:Gn("resource_link")}),Hcr=Il([Qcr,qcr,jcr,GFs,HFs]),$Fs=zr({role:L2e,content:Hcr}),Gcr=zA.extend({description:Je().optional(),messages:Fr($Fs)}),s8=Vw.extend({method:Gn("notifications/prompts/list_changed"),params:$w.optional()}),VFs=zr({title:Je().optional(),readOnlyHint:ol().optional(),destructiveHint:ol().optional(),idempotentHint:ol().optional(),openWorldHint:ol().optional()}),WFs=zr({taskSupport:rv(["required","optional","forbidden"]).optional()}),vVn=zr({...Wpe.shape,...P2e.shape,description:Je().optional(),inputSchema:zr({type:Gn("object"),properties:xl(Je(),y0).optional(),required:Fr(Je()).optional()}).catchall(od()),outputSchema:zr({type:Gn("object"),properties:xl(Je(),y0).optional(),required:Fr(Je()).optional()}).catchall(od()).optional(),annotations:VFs.optional(),execution:WFs.optional(),_meta:xl(Je(),od()).optional()}),zFs=D2e.extend({method:Gn("tools/list")}),$cr=N2e.extend({tools:Fr(vVn)}),uH=zA.extend({content:Fr(Hcr).default([]),structuredContent:xl(Je(),od()).optional(),isError:ol().optional()}),U0f=uH.or(zA.extend({toolResult:od()})),YFs=R2e.extend({name:Je(),arguments:xl(Je(),od()).optional()}),KFs=WA.extend({method:Gn("tools/call"),params:YFs}),a8=Vw.extend({method:Gn("notifications/tools/list_changed"),params:$w.optional()}),CVn=zr({autoRefresh:ol().default(!0),debounceMs:ka().int().nonnegative().default(300)}),bVn=rv(["debug","info","notice","warning","error","critical","alert","emergency"]),JFs=DT.extend({level:bVn}),ZFs=WA.extend({method:Gn("logging/setLevel"),params:JFs}),XFs=$w.extend({level:bVn,logger:Je().optional(),data:od()}),fX=Vw.extend({method:Gn("notifications/message"),params:XFs}),e8s=zr({name:Je().optional()}),t8s=zr({hints:Fr(e8s).optional(),costPriority:ka().min(0).max(1).optional(),speedPriority:ka().min(0).max(1).optional(),intelligencePriority:ka().min(0).max(1).optional()}),r8s=zr({mode:rv(["auto","required","none"]).optional()}),n8s=zr({type:Gn("tool_result"),toolUseId:Je().describe("The unique identifier for the corresponding tool call."),content:Fr(Hcr).default([]),structuredContent:zr({}).loose().optional(),isError:ol().optional(),_meta:xl(Je(),od()).optional()}),i8s=Ert("type",[Qcr,qcr,jcr]),Pat=Ert("type",[Qcr,qcr,jcr,jFs,n8s]),o8s=zr({role:L2e,content:Il([Pat,Fr(Pat)]),_meta:xl(Je(),od()).optional()}),s8s=R2e.extend({messages:Fr(o8s),modelPreferences:t8s.optional(),systemPrompt:Je().optional(),includeContext:rv(["none","thisServer","allServers"]).optional(),temperature:ka().optional(),maxTokens:ka().int(),stopSequences:Fr(Je()).optional(),metadata:y0.optional(),tools:Fr(vVn).optional(),toolChoice:r8s.optional()}),B2e=WA.extend({method:Gn("sampling/createMessage"),params:s8s}),Vcr=zA.extend({model:Je(),stopReason:bu(rv(["endTurn","stopSequence","maxTokens"]).or(Je())),role:L2e,content:i8s}),Wcr=zA.extend({model:Je(),stopReason:bu(rv(["endTurn","stopSequence","maxTokens","toolUse"]).or(Je())),role:L2e,content:Il([Pat,Fr(Pat)])}),a8s=zr({type:Gn("boolean"),title:Je().optional(),description:Je().optional(),default:ol().optional()}),c8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),minLength:ka().optional(),maxLength:ka().optional(),format:rv(["email","uri","date","date-time"]).optional(),default:Je().optional()}),l8s=zr({type:rv(["number","integer"]),title:Je().optional(),description:Je().optional(),minimum:ka().optional(),maximum:ka().optional(),default:ka().optional()}),u8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Fr(Je()),default:Je().optional()}),d8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),oneOf:Fr(zr({const:Je(),title:Je()})),default:Je().optional()}),f8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Fr(Je()),enumNames:Fr(Je()).optional(),default:Je().optional()}),p8s=Il([u8s,d8s]),h8s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:ka().optional(),maxItems:ka().optional(),items:zr({type:Gn("string"),enum:Fr(Je())}),default:Fr(Je()).optional()}),m8s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:ka().optional(),maxItems:ka().optional(),items:zr({anyOf:Fr(zr({const:Je(),title:Je()}))}),default:Fr(Je()).optional()}),g8s=Il([h8s,m8s]),A8s=Il([f8s,p8s,g8s]),y8s=Il([A8s,a8s,c8s,l8s]),E8s=R2e.extend({mode:Gn("form").optional(),message:Je(),requestedSchema:zr({type:Gn("object"),properties:xl(Je(),y8s),required:Fr(Je()).optional()})}),_8s=R2e.extend({mode:Gn("url"),message:Je(),elicitationId:Je(),url:Je().url()}),v8s=Il([E8s,_8s]),F2e=WA.extend({method:Gn("elicitation/create"),params:v8s}),C8s=$w.extend({elicitationId:Je()}),b8s=Vw.extend({method:Gn("notifications/elicitation/complete"),params:C8s}),zcr=zA.extend({action:rv(["accept","decline","cancel"]),content:vrt(t=>t===null?void 0:t,xl(Je(),Il([Je(),ka(),ol(),Fr(Je())])).optional())}),S8s=zr({type:Gn("ref/resource"),uri:Je()});var T8s=zr({type:Gn("ref/prompt"),name:Je()}),I8s=DT.extend({ref:Il([T8s,S8s]),argument:zr({name:Je(),value:Je()}),context:zr({arguments:xl(Je(),Je()).optional()}).optional()}),x8s=WA.extend({method:Gn("completion/complete"),params:I8s});var Ycr=zA.extend({completion:om({values:Fr(Je()).max(100),total:bu(ka().int()),hasMore:bu(ol())})}),w8s=zr({uri:Je().startsWith("file://"),name:Je().optional(),_meta:xl(Je(),od()).optional()}),Kcr=WA.extend({method:Gn("roots/list"),params:DT.optional()}),R8s=zA.extend({roots:Fr(w8s)}),k8s=Vw.extend({method:Gn("notifications/roots/list_changed"),params:$w.optional()}),Q0f=Il([Lat,_Fs,x8s,ZFs,qFs,UFs,wFs,RFs,PFs,NFs,OFs,KFs,zFs,Fat,Qat,qat,Hat]),q0f=Il([Oat,Bat,hVn,k8s,O2e]),j0f=Il([uX,Vcr,Wcr,zcr,R8s,Uat,jat,dX]),H0f=Il([Lat,B2e,F2e,Kcr,Fat,Qat,qat,Hat]),G0f=Il([Oat,Bat,fX,Fcr,o8,a8,s8,O2e,b8s]),$0f=Il([uX,Dcr,Ycr,Gcr,Ucr,Mcr,Ocr,Bcr,uH,$cr,Uat,jat,dX]),Un=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===ei.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new wcr(o.elicitations,r)}return new t(e,r,n)}},wcr=class extends Un{static{a(this,"UrlElicitationRequiredError")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(ei.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};p();var YA=lJt().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:OJt.custom,message:"URL must be parseable",fatal:!0}),eRe}).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"}),TVn=om({resource:Je().url(),authorization_servers:Fr(YA).optional(),jwks_uri:Je().url().optional(),scopes_supported:Fr(Je()).optional(),bearer_methods_supported:Fr(Je()).optional(),resource_signing_alg_values_supported:Fr(Je()).optional(),resource_name:Je().optional(),resource_documentation:Je().optional(),resource_policy_uri:Je().url().optional(),resource_tos_uri:Je().url().optional(),tls_client_certificate_bound_access_tokens:ol().optional(),authorization_details_types_supported:Fr(Je()).optional(),dpop_signing_alg_values_supported:Fr(Je()).optional(),dpop_bound_access_tokens_required:ol().optional()}),Jcr=om({issuer:Je(),authorization_endpoint:YA,token_endpoint:YA,registration_endpoint:YA.optional(),scopes_supported:Fr(Je()).optional(),response_types_supported:Fr(Je()),response_modes_supported:Fr(Je()).optional(),grant_types_supported:Fr(Je()).optional(),token_endpoint_auth_methods_supported:Fr(Je()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),service_documentation:YA.optional(),revocation_endpoint:YA.optional(),revocation_endpoint_auth_methods_supported:Fr(Je()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),introspection_endpoint:Je().optional(),introspection_endpoint_auth_methods_supported:Fr(Je()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),code_challenge_methods_supported:Fr(Je()).optional(),client_id_metadata_document_supported:ol().optional()}),P8s=om({issuer:Je(),authorization_endpoint:YA,token_endpoint:YA,userinfo_endpoint:YA.optional(),jwks_uri:YA,registration_endpoint:YA.optional(),scopes_supported:Fr(Je()).optional(),response_types_supported:Fr(Je()),response_modes_supported:Fr(Je()).optional(),grant_types_supported:Fr(Je()).optional(),acr_values_supported:Fr(Je()).optional(),subject_types_supported:Fr(Je()),id_token_signing_alg_values_supported:Fr(Je()),id_token_encryption_alg_values_supported:Fr(Je()).optional(),id_token_encryption_enc_values_supported:Fr(Je()).optional(),userinfo_signing_alg_values_supported:Fr(Je()).optional(),userinfo_encryption_alg_values_supported:Fr(Je()).optional(),userinfo_encryption_enc_values_supported:Fr(Je()).optional(),request_object_signing_alg_values_supported:Fr(Je()).optional(),request_object_encryption_alg_values_supported:Fr(Je()).optional(),request_object_encryption_enc_values_supported:Fr(Je()).optional(),token_endpoint_auth_methods_supported:Fr(Je()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),display_values_supported:Fr(Je()).optional(),claim_types_supported:Fr(Je()).optional(),claims_supported:Fr(Je()).optional(),service_documentation:Je().optional(),claims_locales_supported:Fr(Je()).optional(),ui_locales_supported:Fr(Je()).optional(),claims_parameter_supported:ol().optional(),request_parameter_supported:ol().optional(),request_uri_parameter_supported:ol().optional(),require_request_uri_registration:ol().optional(),op_policy_uri:YA.optional(),op_tos_uri:YA.optional(),client_id_metadata_document_supported:ol().optional()}),IVn=zr({...P8s.shape,...Jcr.pick({code_challenge_methods_supported:!0}).shape}),xVn=zr({access_token:Je(),id_token:Je().optional(),token_type:Je(),expires_in:jRe.number().optional(),scope:Je().optional(),refresh_token:Je().optional()}).strip(),wVn=zr({error:Je(),error_description:Je().optional(),error_uri:Je().optional()}),SVn=YA.optional().or(Gn("").transform(()=>{})),D8s=zr({redirect_uris:Fr(YA),token_endpoint_auth_method:Je().optional(),grant_types:Fr(Je()).optional(),response_types:Fr(Je()).optional(),client_name:Je().optional(),client_uri:YA.optional(),logo_uri:SVn,scope:Je().optional(),contacts:Fr(Je()).optional(),tos_uri:SVn,policy_uri:Je().optional(),jwks_uri:YA.optional(),jwks:IJt().optional(),software_id:Je().optional(),software_version:Je().optional(),software_statement:Je().optional()}).strip(),N8s=zr({client_id:Je(),client_secret:Je().optional(),client_id_issued_at:ka().optional(),client_secret_expires_at:ka().optional()}).strip(),RVn=D8s.merge(N8s),Y0f=zr({error:Je(),error_description:Je().optional()}).strip(),K0f=zr({token:Je(),token_type_hint:Je().optional()}).strip();p();function kVn(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(kVn,"resourceUrlFromServerUrl");function PVn({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(H8s,"shouldAttemptFallback");async function G8s(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??Gw,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=j8s(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await NVn(c,s,r);if(!n?.metadataUrl&&H8s(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await NVn(u,s,r)}return l}a(G8s,"discoverMetadataWithFallback");function $8s(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($8s,"buildDiscoveryUrls");async function LVn(t,{fetchFn:e=fetch,protocolVersion:r=Gw}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=$8s(t);for(let{url:s,type:c}of o){let l=await rlr(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"?Jcr.parse(await l.json()):IVn.parse(await l.json())}}}a(LVn,"discoverAuthorizationServerMetadata");async function V8s(t,e){let r,n;try{r=await OVn(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 LVn(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a(V8s,"discoverOAuthServerInfo");async function W8s(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(Zcr))throw new Error(`Incompatible auth server: does not support response type ${Zcr}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(Xcr))throw new Error(`Incompatible auth server: does not support code challenge method ${Xcr}`)}else l=new URL("/authorize",t);let u=await xcr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",Zcr),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",Xcr),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(W8s,"startAuthorization");function z8s(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(z8s,"prepareAuthorizationCodeRequest");async function BVn(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=O8s(n,f);L8s(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await MVn(d);return xVn.parse(await d.json())}a(BVn,"executeTokenRequest");async function Y8s(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 BVn(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(Y8s,"refreshAuthorization");async function K8s(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=z8s(o,d,t.redirectUrl)}let u=await t.clientInformation();return BVn(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(K8s,"fetchToken");async function J8s(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 MVn(c);return RVn.parse(await c.json())}a(J8s,"registerClient");p();p();p();p();function Kpe(t){return!!t._zod}a(Kpe,"isZ4Schema");function P2(t,e){return Kpe(t)?Pde(t,e):t.safeParse(e)}a(P2,"safeParse");function Gat(t){if(!t)return;let e;if(Kpe(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Gat,"getObjectShape");function FVn(t){if(Kpe(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(FVn,"getLiteralValue");p();function dH(t){return t==="completed"||t==="failed"||t==="cancelled"}a(dH,"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 NAf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function nlr(t){let r=Gat(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=FVn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(nlr,"getMethodLiteral");function ilr(t,e){let r=P2(t,e);if(!r.success)throw r.error;return r.data}a(ilr,"parseWithCompat");var n6s=6e4,$at=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(Oat,r=>{this._oncancel(r)}),this.setNotificationHandler(Bat,r=>{this._onprogress(r)}),this.setRequestHandler(Lat,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Fat,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(ei.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Qat,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 Un(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 Un(ei.InvalidParams,`Task not found: ${s}`);if(!dH(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(dH(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[cH]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(qat,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 Un(ei.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Hat,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(ei.InvalidParams,`Task not found: ${r.params.taskId}`);if(dH(o.status))throw new Un(ei.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 Un(ei.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Un?o:new Un(ei.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),Un.fromError(ei.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),lX(s)||fVn(s)?this._onresponse(s):k2e(s)?this._onrequest(s,c):dVn(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=Un.fromError(ei.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?.[cH]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:ei.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=cVn(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 Un(ei.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:ei.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),lX(e))n(e);else{let c=new Un(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(lX(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),lX(e))o(e);else{let c=Un.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 Un?c:new Un(ei.InternalError,String(c))}}return}let s;try{let c=await this.request(e,dX,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Un(ei.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},dH(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Un(ei.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Un(ei.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 Un?c:new Un(ei.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||{},[cH]: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 b=v instanceof Un?v:new Un(ei.RequestTimeout,String(v));f(b)},"cancel");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=P2(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??n6s,E=a(()=>A(Un.fromError(ei.RequestTimeout,"Request timed out",{timeout:y})),"timeoutHandler");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))},"responseResolver");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}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},Uat,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},jat,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},gVn,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||{},[cH]: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||{},[cH]: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||{},[cH]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=nlr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=ilr(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=nlr(e);this._notificationHandlers.set(n,o=>{let s=ilr(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"&&k2e(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Un(ei.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 Un(ei.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Un(ei.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 Un(ei.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=O2e.parse({method:"notifications/tasks/status",params:l});await this.notification(u),dH(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 Un(ei.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(dH(l.status))throw new Un(ei.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=O2e.parse({method:"notifications/tasks/status",params:u});await this.notification(d),dH(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function UVn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(UVn,"isPlainObject");function QVn(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];UVn(c)&&UVn(s)?r[o]={...c,...s}:r[o]=s}return r}a(QVn,"mergeCapabilities");p();var PYn=de(Gur(),1),DYn=de(kYn(),1);function sjs(){let t=new PYn.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,DYn.default)(t),t}a(sjs,"createDefaultAjvInstance");var Ict=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??sjs()}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 xct=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=uH,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 Un(ei.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 Un(ei.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Un){yield{type:"error",error:f};return}yield{type:"error",error:new Un(ei.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 NYn(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(NYn,"assertToolsCallTaskCapability");function MYn(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(MYn,"assertClientRequestTaskCapability");function wct(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&&wct(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&wct(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&wct(r,e)}}a(wct,"applyElicitationDefaults");function ajs(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(ajs,"getSupportedElicitationModes");var _H=class extends $at{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 Ict,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",a8,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",s8,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",o8,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new xct(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=QVn(this._capabilities,e)}setRequestHandler(e,r){let o=Gat(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Kpe(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=P2(F2e,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Un(ei.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=ajs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Un(ei.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Un(ei.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=P2(dX,A);if(!v.success){let b=v.error instanceof Error?v.error.message:String(v.error);throw new Un(ei.InvalidParams,`Invalid task creation result: ${b}`)}return v.data}let y=P2(zcr,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Un(ei.InvalidParams,`Invalid elicitation result: ${v}`)}let E=y.data,_=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&E.action==="accept"&&E.content&&_&&this._capabilities.elicitation?.form?.applyDefaults)try{wct(_,E.content)}catch{}return E},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=P2(B2e,u);if(!f.success){let E=f.error instanceof Error?f.error.message:String(f.error);throw new Un(ei.InvalidParams,`Invalid sampling request: ${E}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let E=P2(dX,m);if(!E.success){let _=E.error instanceof Error?E.error.message:String(E.error);throw new Un(ei.InvalidParams,`Invalid task creation result: ${_}`)}return E.data}let A=h.tools||h.toolChoice?Wcr:Vcr,y=P2(A,m);if(!y.success){let E=y.error instanceof Error?y.error.message:String(y.error);throw new Un(ei.InvalidParams,`Invalid sampling result: ${E}`)}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:Gw,capabilities:this._capabilities,clientInfo:this._clientInfo}},Dcr,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Dat.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){NYn(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&MYn(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},uX,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},Ycr,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},uX,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},Gcr,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Ucr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},Mcr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},Ocr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Bcr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},uX,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},uX,r)}async callTool(e,r=uH,n){if(this.isToolTaskRequired(e.name))throw new Un(ei.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 Un(ei.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 Un(ei.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Un?c:new Un(ei.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},$cr,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=CVn.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 Rct=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 Zur(t){}a(Zur,"noop");function kct(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=Zur,onError:r=Zur,onRetry:n=Zur,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let E=c?y.replace(/^\xEF\xBB\xBF/,""):y,[_,v]=cjs(`${s}${E}`);for(let b of _)h(b);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 E=y.indexOf(":");if(E!==-1){let _=y.slice(0,E),v=y[E+1]===" "?2:1,b=y.slice(E+v);m(_,b,y);return}m(y,"",y)}a(h,"parseLine");function m(y,E,_){switch(y){case"event":d=E;break;case"data":u=`${u}${E} -`;break;case"id":l=E.includes("\0")?void 0:E;break;case"retry":/^\d+$/.test(E)?n(parseInt(E,10)):r(new Rct(`Invalid \`retry\` value: "${E}"`,{type:"invalid-retry",value:E,line:_}));break;default:r(new Rct(`Unknown field "${y.length>20?`${y.slice(0,20)}\u2026`:y}"`,{type:"unknown-field",field:y,value:E,line:_}));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(kct,"createParser");function cjs(t){let e=[],r="",n=0;for(;n0)return r}}a(p3s,"conversationIdOf");function h3s(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(h3s,"sanitizeForPath");p();var m3s={0:1,1:2,2:3,3:4,4:5};function icr(t){return String(BigInt(t[0])*BigInt(1e9)+BigInt(t[1]))}a(icr,"hrTimeToNano");function KGn(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=>KGn(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(KGn,"encodeAnyValue");function P2(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=KGn(n);o!==void 0&&e.push({key:r,value:o})}return e}a(P2,"encodeAttributes");function JGn(t){let e=t.spanContext(),r={traceId:e.traceId,spanId:e.spanId,name:t.name,kind:m3s[t.kind]??1,startTimeUnixNano:icr(t.startTime),endTimeUnixNano:icr(t.endTime),attributes:P2(t.attributes),events:t.events.map(n=>({name:n.name,timeUnixNano:icr(n.time),attributes:P2(n.attributes)})),status:t.status.message?{code:t.status.code??0,message:t.status.message}:{code:t.status.code??0}};return t.parentSpanContext?.spanId&&(r.parentSpanId=t.parentSpanContext.spanId),r}a(JGn,"encodeSpan");function g3s(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(g3s,"wrapInResourceSpans");function ZGn(t,e){let r=g3s(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(ZGn,"buildChatDebugLogExport");var x2e=new fe("OtelBridge"),cFs=1e3,w2e=class t{constructor(e){this.pending=[];this.flushTimer=null;this.disposed=!1;this.ctx=e,this.persistence=e.get(hv)}static{a(this,"BridgeSpanProcessor")}static installInto(e){try{let n=(co(),Ca(V5)).trace.getTracerProvider(),o=n._delegate??n,c=o._activeSpanProcessor?._spanProcessors;if(!Array.isArray(c)){let u=o?Object.keys(o).join(", "):"null";return x2e.warn(e,`Could not access SDK TracerProvider internals. delegate keys: [${u}]`),{installed:!1}}let l=new t(e);return c.push(l),x2e.info(e,`Bridge SpanProcessor installed (total processors=${c.length}).`),{installed:!0,processor:l}}catch(r){return x2e.warn(e,`Failed to install bridge SpanProcessor: ${String(r)}`),{installed:!1}}}onStart(e,r){}onEnd(e){this.disposed||(this.pending.push(e),this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flush()},cFs)))}async forceFlush(){await this.flush()}async shutdown(){this.disposed=!0,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),await this.flush()}async flush(){if(this.flushTimer=null,this.pending.length===0)return;let e=this.pending;this.pending=[];let r;try{r=e.map(JGn)}catch(n){x2e.warn(this.ctx,`Failed to encode spans: ${String(n)}`);return}try{await this.persistence.appendSpans(r)}catch(n){x2e.warn(this.ctx,`Failed to persist otel spans: ${String(n)}`)}}};var sVn=require("node:module");var oVn=new fe("BackgroundAgent.ManagerLifecycle");async function lFs(){return"pkg"in process?(0,sVn.createRequire)(__filename)("./node_modules/@github/copilot/sdk/index.cjs"):import("@github/copilot/sdk")}a(lFs,"importSdk");var Nat=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("LocalSessionManager initialization succeeded but manager is undefined");return this.manager}getSdk(){return this.sdk}getAutoModeManager(){return this.autoModeManager}ensureBridgeInstalled(){if(this.installedBridge!==void 0||!this.ctx.get(bn).getCapabilities().agentDebugLog)return;let e=w2e.installInto(this.ctx);this.installedBridge=e.processor}clearAutoMode(){YGn(this.autoModeManager)}async dispose(){this.manager&&(await this.manager.dispose(),this.manager=void 0),this.sdk=void 0,this.autoModeManager=void 0,this.managerInitPromise=void 0}setStubManagerForTesting(e){this.manager=e}setStubSdkForTesting(e){this.sdk=e}setAutoModeManagerForTesting(e){this.autoModeManager=e}async initManager(){oVn.info(this.ctx,"Initializing LocalSessionManager (in-process SDK)..."),u2n(this.ctx);let e=performance.now();try{this.sdk=await lFs(),At(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(o){throw Vn(this.ctx,"backgroundAgent.importSdk",o,{status_text:"failure"},{duration_ms:performance.now()-e}),o}await $Gn(this.ctx),await pat(this.ctx);let r={telemetryService:new this.sdk.internal.NoopTelemetryService};typeof this.sdk.createLocalFeatureFlagServiceCreator=="function"&&(r.createFeatureFlagService=this.sdk.createLocalFeatureFlagServiceCreator()),typeof this.sdk.createLocalFeatureFlagService=="function"&&(r.featureFlagService=this.sdk.createLocalFeatureFlagService());let n=zGn(this.sdk);n!==void 0&&(r.autoModeManager=n),this.autoModeManager=n,this.manager=new this.sdk.internal.LocalSessionManager(r),oVn.info(this.ctx,"LocalSessionManager initialized.")}};p();p();p();p();function W5(t){try{return Ft(t,Ye.EnablePlugins)===!0}catch{return!1}}a(W5,"pluginsEnabled");var NT=class{static{a(this,"McpGatewayHost")}constructor(e,r,n){this._ctx=e,this._service=r,this._manager=n}get service(){return this._service}buildMcpServers(e){let r=this._manager.listReadyEntries(),n=W5(this._ctx),o=new Map,s=new Map,c=new Map;for(let u of r){if(u.url===null)continue;let d=u.key.source;d.kind==="user"?o.set(u.key.name,{type:"http",url:u.url,tools:["*"]}):d.kind==="project"&&e!==void 0&&d.workspaceFolder===e?s.set(u.key.name,{type:"http",url:u.url,tools:["*"]}):d.kind==="plugin"&&n&&c.set(u.key.name,{type:"http",url:u.url,tools:["*"]})}let l={};for(let[u,d]of c)l[u]=d;for(let[u,d]of o)l[u]=d;for(let[u,d]of s)l[u]=d;return l}async dispose(){}};p();p();var zl={ToolsListChanged:"tools/listChanged",ResourcesListChanged:"resources/listChanged",PromptsListChanged:"prompts/listChanged",LoggingMessage:"logging/message"};p();p();var xcr;xcr=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function uFs(t){return(await xcr).getRandomValues(new Uint8Array(t))}a(uFs,"getRandomValues");async function dFs(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await uFs(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await fFs(t),r=await pFs(e);return{code_verifier:e,code_challenge:r}}a(wcr,"pkceChallenge");p();var $w="2025-11-25";var Oat=[$w,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],lH="io.modelcontextprotocol/related-task",Lat="2.0",y0=OJt(t=>t!==null&&(typeof t=="object"||typeof t=="function")),aVn=Il([Je(),Ra().int()]),cVn=Je(),G0f=om({ttl:Ra().optional(),pollInterval:Ra().optional()}),mFs=zr({ttl:Ra().optional()}),gFs=zr({taskId:Je()}),kcr=om({progressToken:aVn.optional(),[lH]:gFs.optional()}),MT=zr({_meta:kcr.optional()}),R2e=MT.extend({task:mFs.optional()}),lVn=a(t=>R2e.safeParse(t).success,"isTaskAugmentedRequestParams"),WA=zr({method:Je(),params:MT.loose().optional()}),Vw=zr({_meta:kcr.optional()}),Ww=zr({method:Je(),params:Vw.loose().optional()}),zA=om({_meta:kcr.optional()}),Bat=Il([Je(),Ra().int()]),uVn=zr({jsonrpc:Gn(Lat),id:Bat,...WA.shape}).strict(),k2e=a(t=>uVn.safeParse(t).success,"isJSONRPCRequest"),dVn=zr({jsonrpc:Gn(Lat),...Ww.shape}).strict(),fVn=a(t=>dVn.safeParse(t).success,"isJSONRPCNotification"),Pcr=zr({jsonrpc:Gn(Lat),id:Bat,result:zA}).strict(),lX=a(t=>Pcr.safeParse(t).success,"isJSONRPCResultResponse");var Xn;(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"})(Xn||(Xn={}));var Dcr=zr({jsonrpc:Gn(Lat),id:Bat.optional(),error:zr({code:Ra().int(),message:Je(),data:od().optional()})}).strict();var pVn=a(t=>Dcr.safeParse(t).success,"isJSONRPCErrorResponse");var uH=Il([uVn,dVn,Pcr,Dcr]),$0f=Il([Pcr,Dcr]),uX=zA.strict(),AFs=Vw.extend({requestId:Bat.optional(),reason:Je().optional()}),Fat=Ww.extend({method:Gn("notifications/cancelled"),params:AFs}),yFs=zr({src:Je(),mimeType:Je().optional(),sizes:Fr(Je()).optional(),theme:nv(["light","dark"]).optional()}),P2e=zr({icons:Fr(yFs).optional()}),Wpe=zr({name:Je(),title:Je().optional()}),hVn=Wpe.extend({...Wpe.shape,...P2e.shape,version:Je(),websiteUrl:Je().optional(),description:Je().optional()}),EFs=qRe(zr({applyDefaults:ol().optional()}),xl(Je(),od())),_Fs=Srt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,qRe(zr({form:EFs.optional(),url:y0.optional()}),xl(Je(),od()).optional())),vFs=om({list:y0.optional(),cancel:y0.optional(),requests:om({sampling:om({createMessage:y0.optional()}).optional(),elicitation:om({create:y0.optional()}).optional()}).optional()}),CFs=om({list:y0.optional(),cancel:y0.optional(),requests:om({tools:om({call:y0.optional()}).optional()}).optional()}),bFs=zr({experimental:xl(Je(),y0).optional(),sampling:zr({context:y0.optional(),tools:y0.optional()}).optional(),elicitation:_Fs.optional(),roots:zr({listChanged:ol().optional()}).optional(),tasks:vFs.optional(),extensions:xl(Je(),y0).optional()}),SFs=MT.extend({protocolVersion:Je(),capabilities:bFs,clientInfo:hVn}),TFs=WA.extend({method:Gn("initialize"),params:SFs});var IFs=zr({experimental:xl(Je(),y0).optional(),logging:y0.optional(),completions:y0.optional(),prompts:zr({listChanged:ol().optional()}).optional(),resources:zr({subscribe:ol().optional(),listChanged:ol().optional()}).optional(),tools:zr({listChanged:ol().optional()}).optional(),tasks:CFs.optional(),extensions:xl(Je(),y0).optional()}),Ncr=zA.extend({protocolVersion:Je(),capabilities:IFs,serverInfo:hVn,instructions:Je().optional()}),mVn=Ww.extend({method:Gn("notifications/initialized"),params:Vw.optional()}),gVn=a(t=>mVn.safeParse(t).success,"isInitializedNotification"),Uat=WA.extend({method:Gn("ping"),params:MT.optional()}),xFs=zr({progress:Ra(),total:bu(Ra()),message:bu(Je())}),wFs=zr({...Vw.shape,...xFs.shape,progressToken:aVn}),Qat=Ww.extend({method:Gn("notifications/progress"),params:wFs}),RFs=MT.extend({cursor:cVn.optional()}),D2e=WA.extend({params:RFs.optional()}),N2e=zA.extend({nextCursor:cVn.optional()}),kFs=nv(["working","input_required","completed","failed","cancelled"]),M2e=zr({taskId:Je(),status:kFs,ttl:Il([Ra(),yrt()]),createdAt:Je(),lastUpdatedAt:Je(),pollInterval:bu(Ra()),statusMessage:bu(Je())}),dX=zA.extend({task:M2e}),PFs=Vw.merge(M2e),O2e=Ww.extend({method:Gn("notifications/tasks/status"),params:PFs}),qat=WA.extend({method:Gn("tasks/get"),params:MT.extend({taskId:Je()})}),jat=zA.merge(M2e),Hat=WA.extend({method:Gn("tasks/result"),params:MT.extend({taskId:Je()})}),V0f=zA.loose(),Gat=D2e.extend({method:Gn("tasks/list")}),$at=N2e.extend({tasks:Fr(M2e)}),Vat=WA.extend({method:Gn("tasks/cancel"),params:MT.extend({taskId:Je()})}),AVn=zA.merge(M2e),yVn=zr({uri:Je(),mimeType:bu(Je()),_meta:xl(Je(),od()).optional()}),EVn=yVn.extend({text:Je()}),Mcr=Je().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),_Vn=yVn.extend({blob:Mcr}),L2e=nv(["user","assistant"]),zpe=zr({audience:Fr(L2e).optional(),priority:Ra().min(0).max(1).optional(),lastModified:Ude.datetime({offset:!0}).optional()}),vVn=zr({...Wpe.shape,...P2e.shape,uri:Je(),description:bu(Je()),mimeType:bu(Je()),size:bu(Ra()),annotations:zpe.optional(),_meta:bu(om({}))}),DFs=zr({...Wpe.shape,...P2e.shape,uriTemplate:Je(),description:bu(Je()),mimeType:bu(Je()),annotations:zpe.optional(),_meta:bu(om({}))}),NFs=D2e.extend({method:Gn("resources/list")}),Ocr=N2e.extend({resources:Fr(vVn)}),MFs=D2e.extend({method:Gn("resources/templates/list")}),Lcr=N2e.extend({resourceTemplates:Fr(DFs)}),Bcr=MT.extend({uri:Je()}),OFs=Bcr,LFs=WA.extend({method:Gn("resources/read"),params:OFs}),Fcr=zA.extend({contents:Fr(Il([EVn,_Vn]))}),s8=Ww.extend({method:Gn("notifications/resources/list_changed"),params:Vw.optional()}),BFs=Bcr,FFs=WA.extend({method:Gn("resources/subscribe"),params:BFs}),UFs=Bcr,QFs=WA.extend({method:Gn("resources/unsubscribe"),params:UFs}),qFs=Vw.extend({uri:Je()}),Ucr=Ww.extend({method:Gn("notifications/resources/updated"),params:qFs}),jFs=zr({name:Je(),description:bu(Je()),required:bu(ol())}),HFs=zr({...Wpe.shape,...P2e.shape,description:bu(Je()),arguments:bu(Fr(jFs)),_meta:bu(om({}))}),GFs=D2e.extend({method:Gn("prompts/list")}),Qcr=N2e.extend({prompts:Fr(HFs)}),$Fs=MT.extend({name:Je(),arguments:xl(Je(),Je()).optional()}),VFs=WA.extend({method:Gn("prompts/get"),params:$Fs}),qcr=zr({type:Gn("text"),text:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),jcr=zr({type:Gn("image"),data:Mcr,mimeType:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),Hcr=zr({type:Gn("audio"),data:Mcr,mimeType:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),WFs=zr({type:Gn("tool_use"),name:Je(),id:Je(),input:xl(Je(),od()),_meta:xl(Je(),od()).optional()}),zFs=zr({type:Gn("resource"),resource:Il([EVn,_Vn]),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),YFs=vVn.extend({type:Gn("resource_link")}),Gcr=Il([qcr,jcr,Hcr,YFs,zFs]),KFs=zr({role:L2e,content:Gcr}),$cr=zA.extend({description:Je().optional(),messages:Fr(KFs)}),a8=Ww.extend({method:Gn("notifications/prompts/list_changed"),params:Vw.optional()}),JFs=zr({title:Je().optional(),readOnlyHint:ol().optional(),destructiveHint:ol().optional(),idempotentHint:ol().optional(),openWorldHint:ol().optional()}),ZFs=zr({taskSupport:nv(["required","optional","forbidden"]).optional()}),CVn=zr({...Wpe.shape,...P2e.shape,description:Je().optional(),inputSchema:zr({type:Gn("object"),properties:xl(Je(),y0).optional(),required:Fr(Je()).optional()}).catchall(od()),outputSchema:zr({type:Gn("object"),properties:xl(Je(),y0).optional(),required:Fr(Je()).optional()}).catchall(od()).optional(),annotations:JFs.optional(),execution:ZFs.optional(),_meta:xl(Je(),od()).optional()}),XFs=D2e.extend({method:Gn("tools/list")}),Vcr=N2e.extend({tools:Fr(CVn)}),dH=zA.extend({content:Fr(Gcr).default([]),structuredContent:xl(Je(),od()).optional(),isError:ol().optional()}),W0f=dH.or(zA.extend({toolResult:od()})),e8s=R2e.extend({name:Je(),arguments:xl(Je(),od()).optional()}),t8s=WA.extend({method:Gn("tools/call"),params:e8s}),c8=Ww.extend({method:Gn("notifications/tools/list_changed"),params:Vw.optional()}),bVn=zr({autoRefresh:ol().default(!0),debounceMs:Ra().int().nonnegative().default(300)}),SVn=nv(["debug","info","notice","warning","error","critical","alert","emergency"]),r8s=MT.extend({level:SVn}),n8s=WA.extend({method:Gn("logging/setLevel"),params:r8s}),i8s=Vw.extend({level:SVn,logger:Je().optional(),data:od()}),fX=Ww.extend({method:Gn("notifications/message"),params:i8s}),o8s=zr({name:Je().optional()}),s8s=zr({hints:Fr(o8s).optional(),costPriority:Ra().min(0).max(1).optional(),speedPriority:Ra().min(0).max(1).optional(),intelligencePriority:Ra().min(0).max(1).optional()}),a8s=zr({mode:nv(["auto","required","none"]).optional()}),c8s=zr({type:Gn("tool_result"),toolUseId:Je().describe("The unique identifier for the corresponding tool call."),content:Fr(Gcr).default([]),structuredContent:zr({}).loose().optional(),isError:ol().optional(),_meta:xl(Je(),od()).optional()}),l8s=Crt("type",[qcr,jcr,Hcr]),Mat=Crt("type",[qcr,jcr,Hcr,WFs,c8s]),u8s=zr({role:L2e,content:Il([Mat,Fr(Mat)]),_meta:xl(Je(),od()).optional()}),d8s=R2e.extend({messages:Fr(u8s),modelPreferences:s8s.optional(),systemPrompt:Je().optional(),includeContext:nv(["none","thisServer","allServers"]).optional(),temperature:Ra().optional(),maxTokens:Ra().int(),stopSequences:Fr(Je()).optional(),metadata:y0.optional(),tools:Fr(CVn).optional(),toolChoice:a8s.optional()}),B2e=WA.extend({method:Gn("sampling/createMessage"),params:d8s}),Wcr=zA.extend({model:Je(),stopReason:bu(nv(["endTurn","stopSequence","maxTokens"]).or(Je())),role:L2e,content:l8s}),zcr=zA.extend({model:Je(),stopReason:bu(nv(["endTurn","stopSequence","maxTokens","toolUse"]).or(Je())),role:L2e,content:Il([Mat,Fr(Mat)])}),f8s=zr({type:Gn("boolean"),title:Je().optional(),description:Je().optional(),default:ol().optional()}),p8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),minLength:Ra().optional(),maxLength:Ra().optional(),format:nv(["email","uri","date","date-time"]).optional(),default:Je().optional()}),h8s=zr({type:nv(["number","integer"]),title:Je().optional(),description:Je().optional(),minimum:Ra().optional(),maximum:Ra().optional(),default:Ra().optional()}),m8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Fr(Je()),default:Je().optional()}),g8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),oneOf:Fr(zr({const:Je(),title:Je()})),default:Je().optional()}),A8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Fr(Je()),enumNames:Fr(Je()).optional(),default:Je().optional()}),y8s=Il([m8s,g8s]),E8s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:Ra().optional(),maxItems:Ra().optional(),items:zr({type:Gn("string"),enum:Fr(Je())}),default:Fr(Je()).optional()}),_8s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:Ra().optional(),maxItems:Ra().optional(),items:zr({anyOf:Fr(zr({const:Je(),title:Je()}))}),default:Fr(Je()).optional()}),v8s=Il([E8s,_8s]),C8s=Il([A8s,y8s,v8s]),b8s=Il([C8s,f8s,p8s,h8s]),S8s=R2e.extend({mode:Gn("form").optional(),message:Je(),requestedSchema:zr({type:Gn("object"),properties:xl(Je(),b8s),required:Fr(Je()).optional()})}),T8s=R2e.extend({mode:Gn("url"),message:Je(),elicitationId:Je(),url:Je().url()}),I8s=Il([S8s,T8s]),F2e=WA.extend({method:Gn("elicitation/create"),params:I8s}),x8s=Vw.extend({elicitationId:Je()}),w8s=Ww.extend({method:Gn("notifications/elicitation/complete"),params:x8s}),Ycr=zA.extend({action:nv(["accept","decline","cancel"]),content:Srt(t=>t===null?void 0:t,xl(Je(),Il([Je(),Ra(),ol(),Fr(Je())])).optional())}),R8s=zr({type:Gn("ref/resource"),uri:Je()});var k8s=zr({type:Gn("ref/prompt"),name:Je()}),P8s=MT.extend({ref:Il([k8s,R8s]),argument:zr({name:Je(),value:Je()}),context:zr({arguments:xl(Je(),Je()).optional()}).optional()}),D8s=WA.extend({method:Gn("completion/complete"),params:P8s});var Kcr=zA.extend({completion:om({values:Fr(Je()).max(100),total:bu(Ra().int()),hasMore:bu(ol())})}),N8s=zr({uri:Je().startsWith("file://"),name:Je().optional(),_meta:xl(Je(),od()).optional()}),Jcr=WA.extend({method:Gn("roots/list"),params:MT.optional()}),M8s=zA.extend({roots:Fr(N8s)}),O8s=Ww.extend({method:Gn("notifications/roots/list_changed"),params:Vw.optional()}),z0f=Il([Uat,TFs,D8s,n8s,VFs,GFs,NFs,MFs,LFs,FFs,QFs,t8s,XFs,qat,Hat,Gat,Vat]),Y0f=Il([Fat,Qat,mVn,O8s,O2e]),K0f=Il([uX,Wcr,zcr,Ycr,M8s,jat,$at,dX]),J0f=Il([Uat,B2e,F2e,Jcr,qat,Hat,Gat,Vat]),Z0f=Il([Fat,Qat,fX,Ucr,s8,c8,a8,O2e,w8s]),X0f=Il([uX,Ncr,Kcr,$cr,Qcr,Ocr,Lcr,Fcr,dH,Vcr,jat,$at,dX]),Un=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===Xn.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Rcr(o.elicitations,r)}return new t(e,r,n)}},Rcr=class extends Un{static{a(this,"UrlElicitationRequiredError")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Xn.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};p();var YA=uJt().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:LJt.custom,message:"URL must be parseable",fatal:!0}),eRe}).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"}),IVn=om({resource:Je().url(),authorization_servers:Fr(YA).optional(),jwks_uri:Je().url().optional(),scopes_supported:Fr(Je()).optional(),bearer_methods_supported:Fr(Je()).optional(),resource_signing_alg_values_supported:Fr(Je()).optional(),resource_name:Je().optional(),resource_documentation:Je().optional(),resource_policy_uri:Je().url().optional(),resource_tos_uri:Je().url().optional(),tls_client_certificate_bound_access_tokens:ol().optional(),authorization_details_types_supported:Fr(Je()).optional(),dpop_signing_alg_values_supported:Fr(Je()).optional(),dpop_bound_access_tokens_required:ol().optional()}),Zcr=om({issuer:Je(),authorization_endpoint:YA,token_endpoint:YA,registration_endpoint:YA.optional(),scopes_supported:Fr(Je()).optional(),response_types_supported:Fr(Je()),response_modes_supported:Fr(Je()).optional(),grant_types_supported:Fr(Je()).optional(),token_endpoint_auth_methods_supported:Fr(Je()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),service_documentation:YA.optional(),revocation_endpoint:YA.optional(),revocation_endpoint_auth_methods_supported:Fr(Je()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),introspection_endpoint:Je().optional(),introspection_endpoint_auth_methods_supported:Fr(Je()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),code_challenge_methods_supported:Fr(Je()).optional(),client_id_metadata_document_supported:ol().optional()}),L8s=om({issuer:Je(),authorization_endpoint:YA,token_endpoint:YA,userinfo_endpoint:YA.optional(),jwks_uri:YA,registration_endpoint:YA.optional(),scopes_supported:Fr(Je()).optional(),response_types_supported:Fr(Je()),response_modes_supported:Fr(Je()).optional(),grant_types_supported:Fr(Je()).optional(),acr_values_supported:Fr(Je()).optional(),subject_types_supported:Fr(Je()),id_token_signing_alg_values_supported:Fr(Je()),id_token_encryption_alg_values_supported:Fr(Je()).optional(),id_token_encryption_enc_values_supported:Fr(Je()).optional(),userinfo_signing_alg_values_supported:Fr(Je()).optional(),userinfo_encryption_alg_values_supported:Fr(Je()).optional(),userinfo_encryption_enc_values_supported:Fr(Je()).optional(),request_object_signing_alg_values_supported:Fr(Je()).optional(),request_object_encryption_alg_values_supported:Fr(Je()).optional(),request_object_encryption_enc_values_supported:Fr(Je()).optional(),token_endpoint_auth_methods_supported:Fr(Je()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),display_values_supported:Fr(Je()).optional(),claim_types_supported:Fr(Je()).optional(),claims_supported:Fr(Je()).optional(),service_documentation:Je().optional(),claims_locales_supported:Fr(Je()).optional(),ui_locales_supported:Fr(Je()).optional(),claims_parameter_supported:ol().optional(),request_parameter_supported:ol().optional(),request_uri_parameter_supported:ol().optional(),require_request_uri_registration:ol().optional(),op_policy_uri:YA.optional(),op_tos_uri:YA.optional(),client_id_metadata_document_supported:ol().optional()}),xVn=zr({...L8s.shape,...Zcr.pick({code_challenge_methods_supported:!0}).shape}),wVn=zr({access_token:Je(),id_token:Je().optional(),token_type:Je(),expires_in:jRe.number().optional(),scope:Je().optional(),refresh_token:Je().optional()}).strip(),RVn=zr({error:Je(),error_description:Je().optional(),error_uri:Je().optional()}),TVn=YA.optional().or(Gn("").transform(()=>{})),B8s=zr({redirect_uris:Fr(YA),token_endpoint_auth_method:Je().optional(),grant_types:Fr(Je()).optional(),response_types:Fr(Je()).optional(),client_name:Je().optional(),client_uri:YA.optional(),logo_uri:TVn,scope:Je().optional(),contacts:Fr(Je()).optional(),tos_uri:TVn,policy_uri:Je().optional(),jwks_uri:YA.optional(),jwks:xJt().optional(),software_id:Je().optional(),software_version:Je().optional(),software_statement:Je().optional()}).strip(),F8s=zr({client_id:Je(),client_secret:Je().optional(),client_id_issued_at:Ra().optional(),client_secret_expires_at:Ra().optional()}).strip(),kVn=B8s.merge(F8s),ngf=zr({error:Je(),error_description:Je().optional()}).strip(),igf=zr({token:Je(),token_type_hint:Je().optional()}).strip();p();function PVn(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(PVn,"resourceUrlFromServerUrl");function DVn({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(z8s,"shouldAttemptFallback");async function Y8s(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??$w,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=W8s(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await MVn(c,s,r);if(!n?.metadataUrl&&z8s(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await MVn(u,s,r)}return l}a(Y8s,"discoverMetadataWithFallback");function K8s(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(K8s,"buildDiscoveryUrls");async function BVn(t,{fetchFn:e=fetch,protocolVersion:r=$w}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=K8s(t);for(let{url:s,type:c}of o){let l=await nlr(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"?Zcr.parse(await l.json()):xVn.parse(await l.json())}}}a(BVn,"discoverAuthorizationServerMetadata");async function J8s(t,e){let r,n;try{r=await LVn(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 BVn(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a(J8s,"discoverOAuthServerInfo");async function Z8s(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(Xcr))throw new Error(`Incompatible auth server: does not support response type ${Xcr}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(elr))throw new Error(`Incompatible auth server: does not support code challenge method ${elr}`)}else l=new URL("/authorize",t);let u=await wcr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",Xcr),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",elr),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(Z8s,"startAuthorization");function X8s(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(X8s,"prepareAuthorizationCodeRequest");async function FVn(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=Q8s(n,f);q8s(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await OVn(d);return wVn.parse(await d.json())}a(FVn,"executeTokenRequest");async function e6s(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 FVn(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(e6s,"refreshAuthorization");async function t6s(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=X8s(o,d,t.redirectUrl)}let u=await t.clientInformation();return FVn(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(t6s,"fetchToken");async function r6s(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 OVn(c);return kVn.parse(await c.json())}a(r6s,"registerClient");p();p();p();p();function Kpe(t){return!!t._zod}a(Kpe,"isZ4Schema");function D2(t,e){return Kpe(t)?Pde(t,e):t.safeParse(e)}a(D2,"safeParse");function Wat(t){if(!t)return;let e;if(Kpe(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Wat,"getObjectShape");function UVn(t){if(Kpe(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(UVn,"getLiteralValue");p();function fH(t){return t==="completed"||t==="failed"||t==="cancelled"}a(fH,"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 qAf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function ilr(t){let r=Wat(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=UVn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(ilr,"getMethodLiteral");function olr(t,e){let r=D2(t,e);if(!r.success)throw r.error;return r.data}a(olr,"parseWithCompat");var c6s=6e4,zat=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(Fat,r=>{this._oncancel(r)}),this.setNotificationHandler(Qat,r=>{this._onprogress(r)}),this.setRequestHandler(Uat,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(qat,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(Xn.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Hat,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 Un(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 Un(Xn.InvalidParams,`Task not found: ${s}`);if(!fH(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(fH(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[lH]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(Gat,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 Un(Xn.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Vat,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(Xn.InvalidParams,`Task not found: ${r.params.taskId}`);if(fH(o.status))throw new Un(Xn.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 Un(Xn.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Un?o:new Un(Xn.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),Un.fromError(Xn.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),lX(s)||pVn(s)?this._onresponse(s):k2e(s)?this._onrequest(s,c):fVn(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=Un.fromError(Xn.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?.[lH]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Xn.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=lVn(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 Un(Xn.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:Xn.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),lX(e))n(e);else{let c=new Un(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(lX(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),lX(e))o(e);else{let c=Un.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 Un?c:new Un(Xn.InternalError,String(c))}}return}let s;try{let c=await this.request(e,dX,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Un(Xn.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},fH(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Un(Xn.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Un(Xn.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 Un?c:new Un(Xn.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||{},[lH]: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 b=v instanceof Un?v:new Un(Xn.RequestTimeout,String(v));f(b)},"cancel");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=D2(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??c6s,E=a(()=>A(Un.fromError(Xn.RequestTimeout,"Request timed out",{timeout:y})),"timeoutHandler");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))},"responseResolver");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}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},jat,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},$at,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},AVn,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||{},[lH]: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||{},[lH]: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||{},[lH]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=ilr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=olr(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=ilr(e);this._notificationHandlers.set(n,o=>{let s=olr(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"&&k2e(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Un(Xn.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 Un(Xn.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Un(Xn.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 Un(Xn.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=O2e.parse({method:"notifications/tasks/status",params:l});await this.notification(u),fH(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 Un(Xn.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(fH(l.status))throw new Un(Xn.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=O2e.parse({method:"notifications/tasks/status",params:u});await this.notification(d),fH(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function QVn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(QVn,"isPlainObject");function qVn(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];QVn(c)&&QVn(s)?r[o]={...c,...s}:r[o]=s}return r}a(qVn,"mergeCapabilities");p();var DYn=de($ur(),1),NYn=de(PYn(),1);function djs(){let t=new DYn.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,NYn.default)(t),t}a(djs,"createDefaultAjvInstance");var Rct=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??djs()}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 kct=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=dH,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 Un(Xn.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 Un(Xn.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Un){yield{type:"error",error:f};return}yield{type:"error",error:new Un(Xn.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 MYn(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(MYn,"assertToolsCallTaskCapability");function OYn(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(OYn,"assertClientRequestTaskCapability");function Pct(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&&Pct(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&Pct(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&Pct(r,e)}}a(Pct,"applyElicitationDefaults");function fjs(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(fjs,"getSupportedElicitationModes");var vH=class extends zat{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 Rct,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",c8,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",a8,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",s8,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new kct(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=qVn(this._capabilities,e)}setRequestHandler(e,r){let o=Wat(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Kpe(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=D2(F2e,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Un(Xn.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=fjs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Un(Xn.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Un(Xn.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=D2(dX,A);if(!v.success){let b=v.error instanceof Error?v.error.message:String(v.error);throw new Un(Xn.InvalidParams,`Invalid task creation result: ${b}`)}return v.data}let y=D2(Ycr,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Un(Xn.InvalidParams,`Invalid elicitation result: ${v}`)}let E=y.data,_=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&E.action==="accept"&&E.content&&_&&this._capabilities.elicitation?.form?.applyDefaults)try{Pct(_,E.content)}catch{}return E},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=D2(B2e,u);if(!f.success){let E=f.error instanceof Error?f.error.message:String(f.error);throw new Un(Xn.InvalidParams,`Invalid sampling request: ${E}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let E=D2(dX,m);if(!E.success){let _=E.error instanceof Error?E.error.message:String(E.error);throw new Un(Xn.InvalidParams,`Invalid task creation result: ${_}`)}return E.data}let A=h.tools||h.toolChoice?zcr:Wcr,y=D2(A,m);if(!y.success){let E=y.error instanceof Error?y.error.message:String(y.error);throw new Un(Xn.InvalidParams,`Invalid sampling result: ${E}`)}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:$w,capabilities:this._capabilities,clientInfo:this._clientInfo}},Ncr,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Oat.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){MYn(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&OYn(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},uX,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},Kcr,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},uX,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},$cr,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Qcr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},Ocr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},Lcr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Fcr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},uX,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},uX,r)}async callTool(e,r=dH,n){if(this.isToolTaskRequired(e.name))throw new Un(Xn.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 Un(Xn.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 Un(Xn.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Un?c:new Un(Xn.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},Vcr,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=bVn.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 Dct=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 Xur(t){}a(Xur,"noop");function Nct(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=Xur,onError:r=Xur,onRetry:n=Xur,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let E=c?y.replace(/^\xEF\xBB\xBF/,""):y,[_,v]=pjs(`${s}${E}`);for(let b of _)h(b);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 E=y.indexOf(":");if(E!==-1){let _=y.slice(0,E),v=y[E+1]===" "?2:1,b=y.slice(E+v);m(_,b,y);return}m(y,"",y)}a(h,"parseLine");function m(y,E,_){switch(y){case"event":d=E;break;case"data":u=`${u}${E} +`;break;case"id":l=E.includes("\0")?void 0:E;break;case"retry":/^\d+$/.test(E)?n(parseInt(E,10)):r(new Dct(`Invalid \`retry\` value: "${E}"`,{type:"invalid-retry",value:E,line:_}));break;default:r(new Dct(`Unknown field "${y.length>20?`${y.slice(0,20)}\u2026`:y}"`,{type:"unknown-field",field:y,value:E,line:_}));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(Nct,"createParser");function pjs(t){let e=[],r="",n=0;for(;n{throw TypeError(t)},"__typeError"),adr=a((t,e,r)=>e.has(t)||BYn("Cannot "+r),"__accessCheck"),na=a((t,e,r)=>(adr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),E0=a((t,e,r)=>e.has(t)?BYn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),Vd=a((t,e,r,n)=>(adr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),m8=a((t,e,r)=>(adr(t,e,"access private method"),r),"__privateMethod"),xb,wX,mhe,Pct,Nct,RDe,yhe,kDe,vH,ghe,Ehe,Ahe,xDe,B2,edr,tdr,rdr,LYn,ndr,idr,wDe,odr,sdr,RX=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),E0(this,B2),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,E0(this,xb),E0(this,wX),E0(this,mhe),E0(this,Pct),E0(this,Nct),E0(this,RDe),E0(this,yhe),E0(this,kDe,null),E0(this,vH),E0(this,ghe),E0(this,Ehe,null),E0(this,Ahe,null),E0(this,xDe,null),E0(this,tdr,async s=>{var c;na(this,ghe).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){m8(this,B2,wDe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?Vd(this,mhe,new URL(s.url)):Vd(this,mhe,void 0),d!==200){m8(this,B2,wDe).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){m8(this,B2,wDe).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(na(this,xb)===this.CLOSED)return;Vd(this,xb,this.OPEN);let h=new Event("open");if((c=na(this,xDe))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){m8(this,B2,wDe).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:E}=await g.read();E&&na(this,ghe).feed(m.decode(E,{stream:!y})),y&&(A=!1,na(this,ghe).reset(),m8(this,B2,odr).call(this))}while(A)}),E0(this,rdr,s=>{Vd(this,vH,void 0),!(s.name==="AbortError"||s.type==="aborted")&&m8(this,B2,odr).call(this,Xur(s))}),E0(this,ndr,s=>{typeof s.id=="string"&&Vd(this,kDe,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:na(this,mhe)?na(this,mhe).origin:na(this,wX).origin,lastEventId:s.id||""});na(this,Ahe)&&(!s.event||s.event==="message")&&na(this,Ahe).call(this,c),this.dispatchEvent(c)}),E0(this,idr,s=>{Vd(this,RDe,s)}),E0(this,sdr,()=>{Vd(this,yhe,void 0),na(this,xb)===this.CONNECTING&&m8(this,B2,edr).call(this)});try{if(e instanceof URL)Vd(this,wX,e);else if(typeof e=="string")Vd(this,wX,new URL(e,ujs()));else throw new Error("Invalid URL")}catch{throw ljs("An invalid or illegal string was specified")}Vd(this,ghe,kct({onEvent:na(this,ndr),onRetry:na(this,idr)})),Vd(this,xb,this.CONNECTING),Vd(this,RDe,3e3),Vd(this,Nct,(n=r?.fetch)!=null?n:globalThis.fetch),Vd(this,Pct,(o=r?.withCredentials)!=null?o:!1),m8(this,B2,edr).call(this)}get readyState(){return na(this,xb)}get url(){return na(this,wX).href}get withCredentials(){return na(this,Pct)}get onerror(){return na(this,Ehe)}set onerror(e){Vd(this,Ehe,e)}get onmessage(){return na(this,Ahe)}set onmessage(e){Vd(this,Ahe,e)}get onopen(){return na(this,xDe)}set onopen(e){Vd(this,xDe,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(){na(this,yhe)&&clearTimeout(na(this,yhe)),na(this,xb)!==this.CLOSED&&(na(this,vH)&&na(this,vH).abort(),Vd(this,xb,this.CLOSED),Vd(this,vH,void 0))}};xb=new WeakMap,wX=new WeakMap,mhe=new WeakMap,Pct=new WeakMap,Nct=new WeakMap,RDe=new WeakMap,yhe=new WeakMap,kDe=new WeakMap,vH=new WeakMap,ghe=new WeakMap,Ehe=new WeakMap,Ahe=new WeakMap,xDe=new WeakMap,B2=new WeakSet,edr=a(function(){Vd(this,xb,this.CONNECTING),Vd(this,vH,new AbortController),na(this,Nct)(na(this,wX),m8(this,B2,LYn).call(this)).then(na(this,tdr)).catch(na(this,rdr))},"connect_fn"),tdr=new WeakMap,rdr=new WeakMap,LYn=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...na(this,kDe)?{"Last-Event-ID":na(this,kDe)}:void 0},cache:"no-store",signal:(t=na(this,vH))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),ndr=new WeakMap,idr=new WeakMap,wDe=a(function(t,e){var r;na(this,xb)!==this.CLOSED&&Vd(this,xb,this.CLOSED);let n=new Dct("error",{code:e,message:t});(r=na(this,Ehe))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),odr=a(function(t,e){var r;if(na(this,xb)===this.CLOSED)return;Vd(this,xb,this.CONNECTING);let n=new Dct("error",{code:e,message:t});(r=na(this,Ehe))==null||r.call(this,n),this.dispatchEvent(n),Vd(this,yhe,setTimeout(na(this,sdr),na(this,RDe)))},"scheduleReconnect_fn"),sdr=new WeakMap,RX.CONNECTING=0,RX.OPEN=1,RX.CLOSED=2;function ujs(){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(ujs,"getBaseURL");p();function _he(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(_he,"normalizeHeaders");function Mct(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{..._he(e.headers),..._he(n.headers)}:e.headers};return t(r,o)}:t}a(Mct,"createFetchWithInit");var PDe=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},vhe=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=Mct(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new KA("No auth provider");let e;try{e=await l8(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 KA;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=_he(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 RX(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}=Ype(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 PDe(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=lH.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 KA("No auth provider");if(await l8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA("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}=Ype(o);if(this._resourceMetadataUrl=c,this._scope=l,await l8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA;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 Oct=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=kct({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 djs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Jw=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},Che=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=Mct(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??djs}async _authThenStart(){if(!this._authProvider)throw new KA("No auth provider");let e;try{e=await l8(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 KA;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=_he(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 Jw(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 Oct({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=lH.parse(JSON.parse(g.data));lX(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 KA("No auth provider");if(await l8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA("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:k2e(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 Jw(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=Ype(l);if(this._resourceMetadataUrl=g,this._scope=A,await l8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=Ype(l);if(y==="insufficient_scope"){let E=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new Jw(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=E??void 0,await l8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new KA;return this.send(e)}}throw new Jw(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),mVn(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=>lH.parse(A)):[lH.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new Jw(-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 Jw(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 QYn=require("events");var bhe=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},DDe=class{constructor(e){this._transport=null;this._emitter=new QYn.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 _H({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=fjs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!FYn(l))throw l}}throw FYn(n)?new bhe: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 vhe(r,UYn(this._options.sseOptions,e)):new Che(r,UYn(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(a8,()=>{this._emitter.emit(zl.ToolsListChanged)}),this._client.setNotificationHandler(o8,()=>{this._emitter.emit(zl.ResourcesListChanged)}),this._client.setNotificationHandler(s8,()=>{this._emitter.emit(zl.PromptsListChanged)}),this._client.setNotificationHandler(fX,o=>{this._emitter.emit(zl.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){return this._client.callTool({name:e,arguments:r})}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 FYn(t){if(t instanceof KA)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(FYn,"isUnauthorized");function fjs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof Jw||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(fjs,"httpFallbackCode");function UYn(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(UYn,"withBearer");p();function Lct(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(Lct,"isJsonRpcRequest");function qYn(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}a(qYn,"isJsonRpcNotification");var Xw={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603},Zw=class extends Error{constructor(r,n,o){super(n);this.code=r;this.data=o;this.name="JsonRpcError"}static{a(this,"JsonRpcError")}};p();p();p();p();p();var F2=class{static{a(this,"McpRuntimeNotifier")}},Bct=class extends F2{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var sr=new fe("CopilotMCP");async function cdr(t,e){await t.get(F2).notifyLog(e)}a(cdr,"notifyMCPRuntimeLog");async function _0(t,e){await cdr(t,{...e,level:"error"})}a(_0,"notifyMCPRuntimeError");async function kX(t,e){await cdr(t,{...e,level:"warning"})}a(kX,"notifyMCPRuntimeWarning");async function lc(t,e){await cdr(t,{...e,level:"info"})}a(lc,"notifyMCPRuntimeInfo");p();async function PX(t,e,r,n,o){return await t.get(tr).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(PX,"fetchOauthServer");async function ldr(t){try{return await t.text()}catch{return t.statusText}}a(ldr,"getErrText");p();var jYn="/.well-known",udr=`${jYn}/oauth-protected-resource`,HYn=`${jYn}/oauth-authorization-server`,GYn=" ";function $Yn(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a($Yn,"isAuthorizationProtectedResourceMetadata");function VYn(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(VYn,"isAuthorizationServerMetadata");function Fct(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(Fct,"parseWWWAuthenticateHeader");function WYn(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(WYn,"getMetadataWithDefaultValues");function zYn(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(zYn,"getDefaultMetadataForUrl");function YYn(t){let e=new URL(t);if(!e.pathname.startsWith(udr))throw new Error(`Invalid discovery URL: expected path to start with ${udr}`);let r=e.pathname.substring(udr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(YYn,"getResourceServerBaseUrlFromDiscoveryUrl");function KYn(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(KYn,"isAuthorizationDynamicClientRegistrationResponse");function Uct(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(Uct,"isAuthorizationTokenResponse");function ddr(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(j$t(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(j$t(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(ddr,"getClaimsFromJWT");var fdr=class{static{a(this,"AuthMetadata")}},She=class extends fdr{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=WYn(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},sr.info(this.ctx,"authMetadata",f),f}catch(m){sr.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=zYn(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 PX(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}=Fct(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 PX(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":Gw});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await ldr(c)}`);let l=await c.json();if($Yn(l)){let u=YYn(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(HYn,e).toString()+o,c=await PX(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Gw});if(c.status!==200&&(c=await PX(this.ctx,wa(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Gw}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await ldr(c)}`);let l=await c.json();if(VYn(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var wb=class{static{a(this,"McpAuthService")}};var X5=new fe("mcpGateway");async function JYn(t,e,r){X5.info(t,`OAuth discovery: probing ${e}`);try{let n=await new She(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return X5.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),At(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){X5.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),Vn(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(JYn,"discoverAuthMetadata");async function Qct(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=XYn(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return At(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return At(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(Qct,"acquireSilent");async function ZYn(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=pjs(t),d=XYn(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"){X5.warn(t,`mount '${o}': user cancelled the account selection`),At(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){X5.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),At(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}At(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){X5.error(t,`mount '${o}': failed during account selection`,h),Vn(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"){X5.warn(t,`mount '${o}': user declined OAuth confirmation`),At(t,"mcpGateway.oauth.interactive",{result:"declined"});return}At(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){X5.error(t,`mount '${o}': failed to show auth confirmation`,f),Vn(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||X5.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}.`),At(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){X5.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)}`),Vn(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(ZYn,"acquireInteractive");function pjs(t){try{return t.get(ts)}catch{return}}a(pjs,"tryGetNotificationSender");function XYn(t){try{return t.get(wb)}catch{return}}a(XYn,"tryGetMcpAuthService");p();var U2=new fe("mcpGateway"),MDe="Copilot MCP Gateway",ODe="0.1.0",NDe=class{constructor(e,r,n,o){this.id=e;this._ctx=r;this._invoker=n;this._onDidDispose=o;this._sseClients=new Set;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(zl.ToolsListChanged,this._onToolsListChanged),this._invoker.on(zl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(zl.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(zl.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(pjs,"splitLines");var Oct=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(LYn(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(LYn(this),r)}};function hjs(t){let e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}a(hjs,"syntaxError");function edr(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(edr).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${edr(t.cause)}`:t.message:`${t}`}a(edr,"flattenError");function LYn(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}a(LYn,"inspectableError");var FYn=a(t=>{throw TypeError(t)},"__typeError"),cdr=a((t,e,r)=>e.has(t)||FYn("Cannot "+r),"__accessCheck"),na=a((t,e,r)=>(cdr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),E0=a((t,e,r)=>e.has(t)?FYn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),Vd=a((t,e,r,n)=>(cdr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),g8=a((t,e,r)=>(cdr(t,e,"access private method"),r),"__privateMethod"),xb,wX,mhe,Mct,Lct,RDe,yhe,kDe,CH,ghe,Ehe,Ahe,xDe,F2,tdr,rdr,ndr,BYn,idr,odr,wDe,sdr,adr,RX=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),E0(this,F2),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,E0(this,xb),E0(this,wX),E0(this,mhe),E0(this,Mct),E0(this,Lct),E0(this,RDe),E0(this,yhe),E0(this,kDe,null),E0(this,CH),E0(this,ghe),E0(this,Ehe,null),E0(this,Ahe,null),E0(this,xDe,null),E0(this,rdr,async s=>{var c;na(this,ghe).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){g8(this,F2,wDe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?Vd(this,mhe,new URL(s.url)):Vd(this,mhe,void 0),d!==200){g8(this,F2,wDe).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){g8(this,F2,wDe).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(na(this,xb)===this.CLOSED)return;Vd(this,xb,this.OPEN);let h=new Event("open");if((c=na(this,xDe))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){g8(this,F2,wDe).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:E}=await g.read();E&&na(this,ghe).feed(m.decode(E,{stream:!y})),y&&(A=!1,na(this,ghe).reset(),g8(this,F2,sdr).call(this))}while(A)}),E0(this,ndr,s=>{Vd(this,CH,void 0),!(s.name==="AbortError"||s.type==="aborted")&&g8(this,F2,sdr).call(this,edr(s))}),E0(this,idr,s=>{typeof s.id=="string"&&Vd(this,kDe,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:na(this,mhe)?na(this,mhe).origin:na(this,wX).origin,lastEventId:s.id||""});na(this,Ahe)&&(!s.event||s.event==="message")&&na(this,Ahe).call(this,c),this.dispatchEvent(c)}),E0(this,odr,s=>{Vd(this,RDe,s)}),E0(this,adr,()=>{Vd(this,yhe,void 0),na(this,xb)===this.CONNECTING&&g8(this,F2,tdr).call(this)});try{if(e instanceof URL)Vd(this,wX,e);else if(typeof e=="string")Vd(this,wX,new URL(e,mjs()));else throw new Error("Invalid URL")}catch{throw hjs("An invalid or illegal string was specified")}Vd(this,ghe,Nct({onEvent:na(this,idr),onRetry:na(this,odr)})),Vd(this,xb,this.CONNECTING),Vd(this,RDe,3e3),Vd(this,Lct,(n=r?.fetch)!=null?n:globalThis.fetch),Vd(this,Mct,(o=r?.withCredentials)!=null?o:!1),g8(this,F2,tdr).call(this)}get readyState(){return na(this,xb)}get url(){return na(this,wX).href}get withCredentials(){return na(this,Mct)}get onerror(){return na(this,Ehe)}set onerror(e){Vd(this,Ehe,e)}get onmessage(){return na(this,Ahe)}set onmessage(e){Vd(this,Ahe,e)}get onopen(){return na(this,xDe)}set onopen(e){Vd(this,xDe,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(){na(this,yhe)&&clearTimeout(na(this,yhe)),na(this,xb)!==this.CLOSED&&(na(this,CH)&&na(this,CH).abort(),Vd(this,xb,this.CLOSED),Vd(this,CH,void 0))}};xb=new WeakMap,wX=new WeakMap,mhe=new WeakMap,Mct=new WeakMap,Lct=new WeakMap,RDe=new WeakMap,yhe=new WeakMap,kDe=new WeakMap,CH=new WeakMap,ghe=new WeakMap,Ehe=new WeakMap,Ahe=new WeakMap,xDe=new WeakMap,F2=new WeakSet,tdr=a(function(){Vd(this,xb,this.CONNECTING),Vd(this,CH,new AbortController),na(this,Lct)(na(this,wX),g8(this,F2,BYn).call(this)).then(na(this,rdr)).catch(na(this,ndr))},"connect_fn"),rdr=new WeakMap,ndr=new WeakMap,BYn=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...na(this,kDe)?{"Last-Event-ID":na(this,kDe)}:void 0},cache:"no-store",signal:(t=na(this,CH))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),idr=new WeakMap,odr=new WeakMap,wDe=a(function(t,e){var r;na(this,xb)!==this.CLOSED&&Vd(this,xb,this.CLOSED);let n=new Oct("error",{code:e,message:t});(r=na(this,Ehe))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),sdr=a(function(t,e){var r;if(na(this,xb)===this.CLOSED)return;Vd(this,xb,this.CONNECTING);let n=new Oct("error",{code:e,message:t});(r=na(this,Ehe))==null||r.call(this,n),this.dispatchEvent(n),Vd(this,yhe,setTimeout(na(this,adr),na(this,RDe)))},"scheduleReconnect_fn"),adr=new WeakMap,RX.CONNECTING=0,RX.OPEN=1,RX.CLOSED=2;function mjs(){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(mjs,"getBaseURL");p();function _he(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(_he,"normalizeHeaders");function Bct(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{..._he(e.headers),..._he(n.headers)}:e.headers};return t(r,o)}:t}a(Bct,"createFetchWithInit");var PDe=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},vhe=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=Bct(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new KA("No auth provider");let e;try{e=await u8(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 KA;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=_he(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 RX(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}=Ype(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 PDe(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=uH.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 KA("No auth provider");if(await u8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA("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}=Ype(o);if(this._resourceMetadataUrl=c,this._scope=l,await u8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA;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 Fct=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=Nct({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 gjs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Zw=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},Che=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=Bct(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??gjs}async _authThenStart(){if(!this._authProvider)throw new KA("No auth provider");let e;try{e=await u8(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 KA;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=_he(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 Zw(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 Fct({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=uH.parse(JSON.parse(g.data));lX(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 KA("No auth provider");if(await u8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA("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:k2e(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 Zw(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=Ype(l);if(this._resourceMetadataUrl=g,this._scope=A,await u8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=Ype(l);if(y==="insufficient_scope"){let E=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new Zw(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=E??void 0,await u8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new KA;return this.send(e)}}throw new Zw(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),gVn(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=>uH.parse(A)):[uH.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new Zw(-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 Zw(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 qYn=require("events");var bhe=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},DDe=class{constructor(e){this._transport=null;this._emitter=new qYn.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 vH({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=Ajs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!UYn(l))throw l}}throw UYn(n)?new bhe: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 vhe(r,QYn(this._options.sseOptions,e)):new Che(r,QYn(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(c8,()=>{this._emitter.emit(zl.ToolsListChanged)}),this._client.setNotificationHandler(s8,()=>{this._emitter.emit(zl.ResourcesListChanged)}),this._client.setNotificationHandler(a8,()=>{this._emitter.emit(zl.PromptsListChanged)}),this._client.setNotificationHandler(fX,o=>{this._emitter.emit(zl.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){return this._client.callTool({name:e,arguments:r})}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 UYn(t){if(t instanceof KA)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(UYn,"isUnauthorized");function Ajs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof Zw||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(Ajs,"httpFallbackCode");function QYn(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(QYn,"withBearer");p();function Uct(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(Uct,"isJsonRpcRequest");function jYn(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}a(jYn,"isJsonRpcNotification");var eR={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603},Xw=class extends Error{constructor(r,n,o){super(n);this.code=r;this.data=o;this.name="JsonRpcError"}static{a(this,"JsonRpcError")}};p();p();p();p();p();var U2=class{static{a(this,"McpRuntimeNotifier")}},Qct=class extends U2{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var sr=new fe("CopilotMCP");async function ldr(t,e){await t.get(U2).notifyLog(e)}a(ldr,"notifyMCPRuntimeLog");async function _0(t,e){await ldr(t,{...e,level:"error"})}a(_0,"notifyMCPRuntimeError");async function kX(t,e){await ldr(t,{...e,level:"warning"})}a(kX,"notifyMCPRuntimeWarning");async function lc(t,e){await ldr(t,{...e,level:"info"})}a(lc,"notifyMCPRuntimeInfo");p();async function PX(t,e,r,n,o){return await t.get(nr).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(PX,"fetchOauthServer");async function udr(t){try{return await t.text()}catch{return t.statusText}}a(udr,"getErrText");p();var HYn="/.well-known",ddr=`${HYn}/oauth-protected-resource`,GYn=`${HYn}/oauth-authorization-server`,$Yn=" ";function VYn(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a(VYn,"isAuthorizationProtectedResourceMetadata");function WYn(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(WYn,"isAuthorizationServerMetadata");function qct(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(qct,"parseWWWAuthenticateHeader");function zYn(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(zYn,"getMetadataWithDefaultValues");function YYn(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(YYn,"getDefaultMetadataForUrl");function KYn(t){let e=new URL(t);if(!e.pathname.startsWith(ddr))throw new Error(`Invalid discovery URL: expected path to start with ${ddr}`);let r=e.pathname.substring(ddr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(KYn,"getResourceServerBaseUrlFromDiscoveryUrl");function JYn(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(JYn,"isAuthorizationDynamicClientRegistrationResponse");function jct(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(jct,"isAuthorizationTokenResponse");function fdr(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(H$t(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(H$t(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(fdr,"getClaimsFromJWT");var pdr=class{static{a(this,"AuthMetadata")}},She=class extends pdr{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=zYn(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},sr.info(this.ctx,"authMetadata",f),f}catch(m){sr.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=YYn(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 PX(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}=qct(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 PX(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":$w});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await udr(c)}`);let l=await c.json();if(VYn(l)){let u=KYn(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(GYn,e).toString()+o,c=await PX(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":$w});if(c.status!==200&&(c=await PX(this.ctx,xa(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":$w}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await udr(c)}`);let l=await c.json();if(WYn(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var wb=class{static{a(this,"McpAuthService")}};var X5=new fe("mcpGateway");async function ZYn(t,e,r){X5.info(t,`OAuth discovery: probing ${e}`);try{let n=await new She(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return X5.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),At(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){X5.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),Vn(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(ZYn,"discoverAuthMetadata");async function Hct(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=eKn(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return At(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return At(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(Hct,"acquireSilent");async function XYn(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=yjs(t),d=eKn(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"){X5.warn(t,`mount '${o}': user cancelled the account selection`),At(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){X5.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),At(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}At(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){X5.error(t,`mount '${o}': failed during account selection`,h),Vn(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"){X5.warn(t,`mount '${o}': user declined OAuth confirmation`),At(t,"mcpGateway.oauth.interactive",{result:"declined"});return}At(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){X5.error(t,`mount '${o}': failed to show auth confirmation`,f),Vn(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||X5.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}.`),At(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){X5.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)}`),Vn(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(XYn,"acquireInteractive");function yjs(t){try{return t.get(ts)}catch{return}}a(yjs,"tryGetNotificationSender");function eKn(t){try{return t.get(wb)}catch{return}}a(eKn,"tryGetMcpAuthService");p();var Q2=new fe("mcpGateway"),MDe="Copilot MCP Gateway",ODe="0.1.0",NDe=class{constructor(e,r,n,o){this.id=e;this._ctx=r;this._invoker=n;this._onDidDispose=o;this._sseClients=new Set;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(zl.ToolsListChanged,this._onToolsListChanged),this._invoker.on(zl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(zl.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(zl.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),U2.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),U2.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)Lct(o)?n.push(await this._dispatchRequest(o)):qYn(o)?this._dispatchNotification(o):U2.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0,U2.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(zl.ToolsListChanged,this._onToolsListChanged),this._invoker.off(zl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(zl.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(zl.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){U2.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 Zw?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(U2.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:Xw.InternalError,message:r instanceof Error?r.message:String(r)}})}}async _handleRequest(e){if(e.method==="initialize")return this._handleInitialize(e);if(!this._isInitialized)throw new Zw(Xw.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 Zw(Xw.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&&Dat.includes(n)?n:Gw;return U2.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&U2.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:MDe,version:ODe}}}_handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Zw(Xw.InvalidParams,"Missing tool name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};return this._invoker.callTool(r.name,n)}_handleReadResource(e){let r=this._requireObjectParams(e);if(typeof r.uri!="string")throw new Zw(Xw.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Zw(Xw.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 Zw(Xw.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new Zw(Xw.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){U2.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,U2.info(this._ctx,`[session ${this.id}] initialized`))}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){U2.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 eKn(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(eKn,"isInitializeMessage");p();p();var GKn=de(jKn(),1),Hct=de(require("node:process"),1),$Kn=require("node:stream");p();var jct=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),Qjs(r)}clear(){this._buffer=void 0}};function Qjs(t){return lH.parse(JSON.parse(t))}a(Qjs,"deserializeMessage");function HKn(t){return JSON.stringify(t)+` -`}a(HKn,"serializeMessage");var qjs=Hct.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function jjs(){let t={};for(let e of qjs){let r=Hct.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(jjs,"getDefaultEnvironment");var xhe=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new jct,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new $Kn.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,GKn.default)(this._serverParams.command,this._serverParams.args??[],{env:{...jjs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:Hct.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=HKn(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var VKn=require("child_process"),WKn=require("events"),zKn=require("util");var Cdr=1e4,Hjs=(0,zKn.promisify)(VKn.exec),LDe=class{constructor(e){this._transport=null;this._emitter=new WKn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new _H({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 xhe(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(a8,()=>{this._emitter.emit(zl.ToolsListChanged)}),this._client.setNotificationHandler(o8,()=>{this._emitter.emit(zl.ResourcesListChanged)}),this._client.setNotificationHandler(s8,()=>{this._emitter.emit(zl.PromptsListChanged)}),this._client.setNotificationHandler(fX,n=>{this._emitter.emit(zl.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),Cdr))]),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 Hjs(`taskkill /pid ${o} /t /f`,{timeout:Cdr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,Cdr));try{process.kill(o,"SIGKILL")}catch{}}this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r){return this._client.callTool({name:e,arguments:r})}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 dm=class{static{a(this,"AuthenticationService")}};var NT=new fe("mcpGateway.manager"),bH=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},Gjs={tools:[],resources:[],resourceTemplates:[],prompts:[]},ey=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}static{a(this,"McpServerManager")}listServers(e){let r=[];for(let n of this._entries.values())Wjs(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(CH(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")continue;let n=CH(r.key),o=this._service.listMounts().find(s=>s.id===n);e.push({key:r.key,url:o?.url??null})}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=$js(n),c=s!==this._lastUserHash;c&&(await this._applyScope({kind:"user"},n),this._lastUserHash=s),await this._applyScope({kind:"project",workspaceFolder:r},o),At(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=Yjs(l,u);if(!d){o.push(l);continue}n.set(CH({source:e,name:l}),{classified:d,hash:YKn(u)})}o.length>0&&NT.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries in ${zjs(e)}: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)Vjs(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,this._beginStart(l))}c&&this._sender.serversChanged(e4(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=CH(e),o=this._entries.get(n);if(!o)throw new bH("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new bH("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new bH("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(e4(n.key.source));return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(e4(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;let e=[...this._entries.values()].map(r=>this._stopInvoker(r,"stopped").catch(()=>{}));this._entries.clear(),await Promise.all(e)}_createEntry(e,r,n){let o={key:e,classified:r,entryHash:n,invoker:null,status:"stopped",contents:{...Gjs},listeners:null};return this._entries.set(CH(e),o),o}async _removeEntry(e){let r=this._entries.get(e);if(!r)return;let n=e4(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;r.invoker?await this._stopInvoker(r,"starting"):(r.status="starting",r.error=void 0,this._sender.serversChanged(e4(r.key.source)));let n=this._buildInvoker(r);r.invoker=n,this._wireInvokerEvents(r);try{if(await n.start(),r.invoker!==n){await n.stop().catch(()=>{});return}r.status="running",r.error=void 0;try{await this._service.registerMount(n,r.key.name)}catch(o){throw NT.error(this._ctx,`failed to register mount for '${r.key.name}'`,o),o}if(r.invoker!==n){this._service.unregisterMount(CH(r.key)),await n.stop().catch(()=>{});return}if(await this._refreshContents(r).catch(o=>{NT.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(o)}`)}),r.invoker!==n)return;this._sender.serversChanged(e4(r.key.source)),this._sender.serverDetailsChanged(r.key)}catch(o){if(r.invoker!==n){await n.stop().catch(()=>{});return}o instanceof bhe?(r.status="unauthorized",r.error=void 0,NT.warn(this._ctx,`server '${r.key.name}' requires authorization`)):(r.status="error",r.error=o instanceof Error?o.message:String(o),NT.error(this._ctx,`server '${r.key.name}' failed to start`,o)),await n.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged(e4(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(CH(e.key)),this._sender.serversChanged(e4(e.key.source)),n&&await n.stop().catch(o=>{NT.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")};r.on(zl.ToolsListChanged,n.toolsChanged),r.on(zl.ResourcesListChanged,n.resourcesChanged),r.on(zl.PromptsListChanged,n.promptsChanged),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(zl.ToolsListChanged,n.toolsChanged),r.off(zl.ResourcesListChanged,n.resourcesChanged),r.off(zl.PromptsListChanged,n.promptsChanged)),e.listeners=null}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){NT.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=CH(e.key),o=e.key.name;return r.kind==="stdio"?new LDe({id:n,label:o,params:r.params,clientInfo:{name:MDe,version:ODe}}):new DDe({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,clientInfo:{name:MDe,version:ODe},authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:s})=>{NT.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${s}, falling back to legacy SSE`),At(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(s)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(dm)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await JYn(this._ctx,r,n);if(!s){NT.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await Qct(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){NT.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 Qct(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 Qct(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 ZYn(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(e4(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=>NT.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){NT.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){NT.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged(e4(e.key.source))}};function CH(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(CH,"serializeKey");function YKn(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(YKn,"canonicalEntryHash");function $js(t){let e=Object.keys(t).sort(),r={};for(let n of e)r[n]=YKn(t[n]);return JSON.stringify(r)}a($js,"canonicalConfigHash");function e4(t){return t.kind==="project"?{kind:"project",workspaceFolder:t.workspaceFolder}:{kind:"user"}}a(e4,"notificationScopeFor");function Vjs(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(Vjs,"sameScope");function Wjs(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(Wjs,"entryInScope");function zjs(t){switch(t.kind){case"user":return"user";case"project":return`project<${t.workspaceFolder}>`;case"plugin":return`plugin<${t.pluginId}>`}}a(zjs,"describeScope");function Yjs(t,e){if(!e||typeof e!="object")return;let r=e;if(typeof r.command=="string")return{kind:"stdio",name:t,params:e};if(typeof r.url=="string"){let o=(typeof r.type=="string"?r.type:void 0)==="sse"?"sse":"http";return{kind:"http",name:t,url:r.url,type:o,httpOptions:o==="http"?e:void 0,sseOptions:o==="sse"?e:void 0}}}a(Yjs,"classifyEntry");p();var bdr=require("crypto"),KKn=require("events"),JKn=de(require("http"));var SH=new fe("mcpGateway"),Kjs="mcp-session-id",Jjs=1024*1024,Zjs=5e3,ZKn={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},DX={MountsChanged:"mountsChanged"},TH=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new KKn.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}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,SH.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),At(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(DX.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=ZKn.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,bdr.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 SH.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),At(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(DX.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),SH.info(this._ctx,`unregistered mount '${n.label}' (${e})`),At(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(DX.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=JKn.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")),Zjs);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),SH.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){SH.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:Xw.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){SH.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(!eKn(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,bdr.randomUUID)(),c=new NDe(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&SH.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),SH.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(Lct)}_getSessionId(e){let r=e.headers[Kjs];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>Jjs)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:`http://${this._host}:${this._port}/${n}/mcp`,status:o}}};var Sdr=new fe("BackgroundAgent.McpSync"),Gct=class{constructor(e,r){this.ctx=e;this.registry=r;this.syncScheduled=!1;try{let n=e.get(PT);this.host=n,this.mountsChangedListener=()=>this.schedule(),n.service.on(DX.MountsChanged,this.mountsChangedListener)}catch(n){if(!(n instanceof bl))throw n}}static{a(this,"McpSync")}dispose(){this.host&&this.mountsChangedListener&&(this.host.service.off(DX.MountsChanged,this.mountsChangedListener),this.mountsChangedListener=void 0,this.host=void 0)}schedule(){this.syncScheduled||(this.syncScheduled=!0,queueMicrotask(()=>{this.syncScheduled=!1,this.syncToActiveSessions()}))}async syncToActiveSessions(){if(this.registry.size()===0)return;let e;try{e=this.ctx.get(PT)}catch(r){r instanceof bl||Sdr.warn(this.ctx,"Failed to read MCP gateway host for active-session sync",{error:r instanceof Error?r.message:String(r)});return}Sdr.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){Sdr.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:c instanceof Error?c.message:String(c)})}}))}};p();p();var $ct="/agents/sessions",Vct=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($ct),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 XKn(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(`${$ct}/${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 XKn(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(`${$ct}/${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(`${$ct}/${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 XKn(t){try{return await t.text()}catch{return""}}a(XKn,"safeReadText");p();p();var Wct=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 Xjs=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 eJn(t){return!(!t.type||Xjs.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(eJn,"shouldForwardMissionControlEvent");function Tdr(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a(Tdr,"getMissionControlEventData");function tJn(t,e){if(e.type!=="user.message")return;let r=e.data?.source;if(typeof r!="string"||!r.startsWith("command-"))return;let n=r.slice(8);n&&t.completedCommandIds.push(n)}a(tJn,"maybeAcknowledgeMissionControlCommandFromEvent");var iJn=require("node:crypto");var eHs=500,tHs=3e3,rHs=1e4,nHs=500,BDe=2e3,iHs=256,rJn=80,zct=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new Wct({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 W0n(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await z0n(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=sHs(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_complete","tool.execution_start","tool.execution_complete"]);try{let A=Array.from(this.sdkSession.getEvents()),y=0;for(let E of A)E.type&&g.has(E.type)&&(this.bufferEvent(h,E),y++);o.info(s,`Mission Control replayed ${y}/${A.length} historical events`)}catch(A){o.warn(s,`Mission Control history replay failed: ${NX(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: ${NX(A)}`)}try{ecr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!0})}catch(A){o.warn(s,`sdk.emit(remote_steerable_changed=true) failed: ${NX(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}`))},eHs),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},tHs),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{ecr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!1})}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`sdk.emit(remote_steerable_changed=false) failed: ${NX(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,iJn.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(!eJn(r))return;tJn(e,r),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:Tdr(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",Tdr(r))),e.eventBuffer.length>BDe&&e.eventBuffer.splice(0,e.eventBuffer.length-BDe)}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=oHs(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>=iHs){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>BDe&&e.eventBuffer.splice(0,e.eventBuffer.length-BDe);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=rHs;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,nHs);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<=BDe&&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)}`);try{await this.dispatchCommand(e,o),this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch ok: id=${o.id} type=${o.type??""}`)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc dispatch ${o.type??"user_message"} failed: ${NX(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=nJn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s=n.approved?{kind:n.scope==="session"?"approve-session":"approve-once"}:{kind:"denied-interactively-by-user",...n.feedback?{feedback:n.feedback}:{}};try{this.sdkSession.respondToPermission(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc permission_response forward failed (promptId=${n.promptId}, requestId=${o}): ${NX(c)}`)}return}case"ask_user_response":{let n=nJn(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{this.sdkSession.respondToUserInput(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc ask_user_response forward failed (promptId=${n.promptId}, requestId=${o}): ${NX(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,`command-${r.id}`);return}}}};function nJn(t){try{return JSON.parse(t)}catch{return}}a(nJn,"safeJsonParse");function NX(t){return t instanceof Error?t.message:String(t)}a(NX,"errMsg");function oHs(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>rJn?e.slice(0,rJn-1).trimEnd()+"\u2026":e:""}a(oHs,"deriveTitleFromMessage");function sHs(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(sHs,"toVscodeUriShape");var Idr=new fe("BackgroundAgent.RemoteController"),Yct=class{constructor(e,r){this.ctx=e;this.deps=r;this.delegates=new Map}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 Vct(this.ctx,Idr,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new zct(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:Idr,ctx:this.ctx,injectUserMessage:a((l,u,d)=>this.deps.injectUserMessage(l,u,d),"injectUserMessage")});if(!VGn(r,c))throw new Error("SDK capability missing: LocalSession.setRemoteDelegate");return this.delegates.set(e,c),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")}),c}async enableForSession(e,r){this.attachLazy(e,r);let n=tcr(r);if(!n)throw new Error("Remote steering not supported by this SDK version");return n.enable()}async disableForSession(e){let r=tcr(e);r&&await r.disable()}getStatus(e){let r=this.delegates.get(e);return r?r.getStatus():{remoteSteerable:!1}}delegateCount(){return this.delegates.size}fireAndForgetTearDown(e){let r=this.delegates.get(e);r&&(this.delegates.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){Idr.warn(this.ctx,"Mission Control deleteSession failed during destroySession",{sessionId:e,error:n instanceof Error?n.message:String(n)})}this.delegates.delete(e)}}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(Ur).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 xdr=new fe("BackgroundAgent.CustomAgents");async function Kct(t,e){try{if(Ft(t,Ye.EnableCustomAgents)===!1)return xdr.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(Ld).listCustomAgents([e],{includePlugins:!0});return o.length>0&&xdr.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>aHs(s))}catch(r){return xdr.warn(t,"Failed to load custom agents:",r),[]}}a(Kct,"loadCustomAgents");function aHs(t){let e=t.instruction??"";return{name:t.name,displayName:t.name,description:t.description??"",tools:t.tools??null,prompt:a(()=>Promise.resolve(e),"prompt"),disableModelInvocation:!1,model:t.model}}a(aHs,"toSweCustomAgent");p();var wdr=new fe("BackgroundAgent.Hooks"),Rdr="copilot-language-server";function oJn(t,e){return{preToolUse:[cHs(t,e)],postToolUse:[lHs(t,e)],userPromptSubmitted:[uHs(t,e)]}}a(oJn,"buildSessionHooks");function cHs(t,e){return{source:Rdr,handler:a(async r=>{try{let o=await t.get(mE).hook(t,o2,{timestamp:r.timestamp,cwd:un(e.uri),toolName:r.toolName,toolArgs:FDe(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===Xue.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){wdr.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(cHs,"createPreToolUseHandler");function lHs(t,e){return{source:Rdr,handler:a(async r=>{try{await t.get(mE).hook(t,i2,{timestamp:r.timestamp,cwd:un(e.uri),toolName:r.toolName,toolArgs:FDe(r.toolArgs),toolResult:{resultType:kdr(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){wdr.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(lHs,"createPostToolUseHandler");function uHs(t,e){return{source:Rdr,handler:a(async r=>{try{await t.get(mE).hook(t,s2,{timestamp:r.timestamp,cwd:un(e.uri),prompt:r.prompt},e);return}catch(n){wdr.error(t,"Failed to execute UserPromptSubmitted hook",n);return}},"handler")}}a(uHs,"createUserPromptSubmittedHandler");function FDe(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(FDe,"safeStringifyToolArgs");function kdr(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(kdr,"toClsToolResultType");p();var dHs=["model-agents-md","cwd-model-agents-md"],fHs=["model-claude-md","cwd-model-claude-md"],pHs="nested-agents";function sJn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of dHs)e.add(r);if(t.useClaudeMdFile===!1)for(let r of fHs)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(pHs),e}a(sJn,"computeDisabledInstructionSources");var hHs=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),mHs=2,gHs="CLAUDE.md",AHs="AGENTS.md";function yHs(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(yHs,"joinPath");async function EHs(t,e,r){let n=[],o=a(async(s,c)=>{let l;try{l=await t(yHs(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(` +`),this._sseClients.add(e),Q2.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),Q2.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)Uct(o)?n.push(await this._dispatchRequest(o)):jYn(o)?this._dispatchNotification(o):Q2.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0,Q2.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(zl.ToolsListChanged,this._onToolsListChanged),this._invoker.off(zl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(zl.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(zl.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){Q2.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 Xw?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(Q2.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:eR.InternalError,message:r instanceof Error?r.message:String(r)}})}}async _handleRequest(e){if(e.method==="initialize")return this._handleInitialize(e);if(!this._isInitialized)throw new Xw(eR.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 Xw(eR.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&&Oat.includes(n)?n:$w;return Q2.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&Q2.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:MDe,version:ODe}}}_handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Xw(eR.InvalidParams,"Missing tool name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};return this._invoker.callTool(r.name,n)}_handleReadResource(e){let r=this._requireObjectParams(e);if(typeof r.uri!="string")throw new Xw(eR.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Xw(eR.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 Xw(eR.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new Xw(eR.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){Q2.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,Q2.info(this._ctx,`[session ${this.id}] initialized`))}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){Q2.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 tKn(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(tKn,"isInitializeMessage");p();p();var $Kn=de(HKn(),1),Vct=de(require("node:process"),1),VKn=require("node:stream");p();var $ct=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),$js(r)}clear(){this._buffer=void 0}};function $js(t){return uH.parse(JSON.parse(t))}a($js,"deserializeMessage");function GKn(t){return JSON.stringify(t)+` +`}a(GKn,"serializeMessage");var Vjs=Vct.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function Wjs(){let t={};for(let e of Vjs){let r=Vct.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(Wjs,"getDefaultEnvironment");var xhe=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new $ct,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new VKn.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,$Kn.default)(this._serverParams.command,this._serverParams.args??[],{env:{...Wjs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:Vct.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=GKn(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var WKn=require("child_process"),zKn=require("events"),YKn=require("util");var bdr=1e4,zjs=(0,YKn.promisify)(WKn.exec),LDe=class{constructor(e){this._transport=null;this._emitter=new zKn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new vH({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 xhe(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(c8,()=>{this._emitter.emit(zl.ToolsListChanged)}),this._client.setNotificationHandler(s8,()=>{this._emitter.emit(zl.ResourcesListChanged)}),this._client.setNotificationHandler(a8,()=>{this._emitter.emit(zl.PromptsListChanged)}),this._client.setNotificationHandler(fX,n=>{this._emitter.emit(zl.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),bdr))]),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 zjs(`taskkill /pid ${o} /t /f`,{timeout:bdr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,bdr));try{process.kill(o,"SIGKILL")}catch{}}this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r){return this._client.callTool({name:e,arguments:r})}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 dm=class{static{a(this,"AuthenticationService")}};var OT=new fe("mcpGateway.manager"),SH=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},Yjs={tools:[],resources:[],resourceTemplates:[],prompts:[]},ey=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}static{a(this,"McpServerManager")}listServers(e){let r=[];for(let n of this._entries.values())Zjs(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(bH(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")continue;let n=bH(r.key),o=this._service.listMounts().find(s=>s.id===n);e.push({key:r.key,url:o?.url??null})}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=Kjs(n),c=s!==this._lastUserHash;c&&(await this._applyScope({kind:"user"},n),this._lastUserHash=s),await this._applyScope({kind:"project",workspaceFolder:r},o),At(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=eHs(l,u);if(!d){o.push(l);continue}n.set(bH({source:e,name:l}),{classified:d,hash:KKn(u)})}o.length>0&&OT.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries in ${Xjs(e)}: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)Jjs(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,this._beginStart(l))}c&&this._sender.serversChanged(e4(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=bH(e),o=this._entries.get(n);if(!o)throw new SH("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new SH("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new SH("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(e4(n.key.source));return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(e4(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;let e=[...this._entries.values()].map(r=>this._stopInvoker(r,"stopped").catch(()=>{}));this._entries.clear(),await Promise.all(e)}_createEntry(e,r,n){let o={key:e,classified:r,entryHash:n,invoker:null,status:"stopped",contents:{...Yjs},listeners:null};return this._entries.set(bH(e),o),o}async _removeEntry(e){let r=this._entries.get(e);if(!r)return;let n=e4(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;r.invoker?await this._stopInvoker(r,"starting"):(r.status="starting",r.error=void 0,this._sender.serversChanged(e4(r.key.source)));let n=this._buildInvoker(r);r.invoker=n,this._wireInvokerEvents(r);try{if(await n.start(),r.invoker!==n){await n.stop().catch(()=>{});return}r.status="running",r.error=void 0;try{await this._service.registerMount(n,r.key.name)}catch(o){throw OT.error(this._ctx,`failed to register mount for '${r.key.name}'`,o),o}if(r.invoker!==n){this._service.unregisterMount(bH(r.key)),await n.stop().catch(()=>{});return}if(await this._refreshContents(r).catch(o=>{OT.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(o)}`)}),r.invoker!==n)return;this._sender.serversChanged(e4(r.key.source)),this._sender.serverDetailsChanged(r.key)}catch(o){if(r.invoker!==n){await n.stop().catch(()=>{});return}o instanceof bhe?(r.status="unauthorized",r.error=void 0,OT.warn(this._ctx,`server '${r.key.name}' requires authorization`)):(r.status="error",r.error=o instanceof Error?o.message:String(o),OT.error(this._ctx,`server '${r.key.name}' failed to start`,o)),await n.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged(e4(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(bH(e.key)),this._sender.serversChanged(e4(e.key.source)),n&&await n.stop().catch(o=>{OT.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")};r.on(zl.ToolsListChanged,n.toolsChanged),r.on(zl.ResourcesListChanged,n.resourcesChanged),r.on(zl.PromptsListChanged,n.promptsChanged),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(zl.ToolsListChanged,n.toolsChanged),r.off(zl.ResourcesListChanged,n.resourcesChanged),r.off(zl.PromptsListChanged,n.promptsChanged)),e.listeners=null}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){OT.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=bH(e.key),o=e.key.name;return r.kind==="stdio"?new LDe({id:n,label:o,params:r.params,clientInfo:{name:MDe,version:ODe}}):new DDe({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,clientInfo:{name:MDe,version:ODe},authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:s})=>{OT.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${s}, falling back to legacy SSE`),At(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(s)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(dm)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await ZYn(this._ctx,r,n);if(!s){OT.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await Hct(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){OT.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 Hct(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 Hct(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 XYn(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(e4(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=>OT.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){OT.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){OT.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged(e4(e.key.source))}};function bH(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(bH,"serializeKey");function KKn(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(KKn,"canonicalEntryHash");function Kjs(t){let e=Object.keys(t).sort(),r={};for(let n of e)r[n]=KKn(t[n]);return JSON.stringify(r)}a(Kjs,"canonicalConfigHash");function e4(t){return t.kind==="project"?{kind:"project",workspaceFolder:t.workspaceFolder}:{kind:"user"}}a(e4,"notificationScopeFor");function Jjs(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(Jjs,"sameScope");function Zjs(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(Zjs,"entryInScope");function Xjs(t){switch(t.kind){case"user":return"user";case"project":return`project<${t.workspaceFolder}>`;case"plugin":return`plugin<${t.pluginId}>`}}a(Xjs,"describeScope");function eHs(t,e){if(!e||typeof e!="object")return;let r=e;if(typeof r.command=="string")return{kind:"stdio",name:t,params:e};if(typeof r.url=="string"){let o=(typeof r.type=="string"?r.type:void 0)==="sse"?"sse":"http";return{kind:"http",name:t,url:r.url,type:o,httpOptions:o==="http"?e:void 0,sseOptions:o==="sse"?e:void 0}}}a(eHs,"classifyEntry");p();var Sdr=require("crypto"),JKn=require("events"),ZKn=de(require("http"));var TH=new fe("mcpGateway"),tHs="mcp-session-id",rHs=1024*1024,nHs=5e3,XKn={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},DX={MountsChanged:"mountsChanged"},IH=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new JKn.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}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,TH.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),At(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(DX.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=XKn.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,Sdr.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 TH.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),At(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(DX.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),TH.info(this._ctx,`unregistered mount '${n.label}' (${e})`),At(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(DX.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=ZKn.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")),nHs);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),TH.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){TH.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:eR.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){TH.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(!tKn(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,Sdr.randomUUID)(),c=new NDe(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&TH.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),TH.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(Uct)}_getSessionId(e){let r=e.headers[tHs];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>rHs)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:`http://${this._host}:${this._port}/${n}/mcp`,status:o}}};var Tdr=new fe("BackgroundAgent.McpSync"),Wct=class{constructor(e,r){this.ctx=e;this.registry=r;this.syncScheduled=!1;try{let n=e.get(NT);this.host=n,this.mountsChangedListener=()=>this.schedule(),n.service.on(DX.MountsChanged,this.mountsChangedListener)}catch(n){if(!(n instanceof bl))throw n}}static{a(this,"McpSync")}dispose(){this.host&&this.mountsChangedListener&&(this.host.service.off(DX.MountsChanged,this.mountsChangedListener),this.mountsChangedListener=void 0,this.host=void 0)}schedule(){this.syncScheduled||(this.syncScheduled=!0,queueMicrotask(()=>{this.syncScheduled=!1,this.syncToActiveSessions()}))}async syncToActiveSessions(){if(this.registry.size()===0)return;let e;try{e=this.ctx.get(NT)}catch(r){r instanceof bl||Tdr.warn(this.ctx,"Failed to read MCP gateway host for active-session sync",{error:r instanceof Error?r.message:String(r)});return}Tdr.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){Tdr.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:c instanceof Error?c.message:String(c)})}}))}};p();p();var zct="/agents/sessions",Yct=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(zct),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 eJn(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(`${zct}/${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 eJn(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(`${zct}/${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(`${zct}/${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 eJn(t){try{return await t.text()}catch{return""}}a(eJn,"safeReadText");p();p();var Kct=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 iHs=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 tJn(t){return!(!t.type||iHs.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(tJn,"shouldForwardMissionControlEvent");function Idr(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a(Idr,"getMissionControlEventData");function rJn(t,e){if(e.type!=="user.message")return;let r=e.data?.source;if(typeof r!="string"||!r.startsWith("command-"))return;let n=r.slice(8);n&&t.completedCommandIds.push(n)}a(rJn,"maybeAcknowledgeMissionControlCommandFromEvent");var oJn=require("node:crypto");var oHs=500,sHs=3e3,aHs=1e4,cHs=500,BDe=2e3,lHs=256,nJn=80,Jct=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new Kct({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 z0n(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await Y0n(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=dHs(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_complete","tool.execution_start","tool.execution_complete"]);try{let A=Array.from(this.sdkSession.getEvents()),y=0;for(let E of A)E.type&&g.has(E.type)&&(this.bufferEvent(h,E),y++);o.info(s,`Mission Control replayed ${y}/${A.length} historical events`)}catch(A){o.warn(s,`Mission Control history replay failed: ${NX(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: ${NX(A)}`)}try{tcr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!0})}catch(A){o.warn(s,`sdk.emit(remote_steerable_changed=true) failed: ${NX(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}`))},oHs),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},sHs),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{tcr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!1})}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`sdk.emit(remote_steerable_changed=false) failed: ${NX(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,oJn.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(!tJn(r))return;rJn(e,r),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:Idr(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",Idr(r))),e.eventBuffer.length>BDe&&e.eventBuffer.splice(0,e.eventBuffer.length-BDe)}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=uHs(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>=lHs){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>BDe&&e.eventBuffer.splice(0,e.eventBuffer.length-BDe);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=aHs;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,cHs);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<=BDe&&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)}`);try{await this.dispatchCommand(e,o),this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch ok: id=${o.id} type=${o.type??""}`)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc dispatch ${o.type??"user_message"} failed: ${NX(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=iJn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s=n.approved?{kind:n.scope==="session"?"approve-session":"approve-once"}:{kind:"denied-interactively-by-user",...n.feedback?{feedback:n.feedback}:{}};try{this.sdkSession.respondToPermission(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc permission_response forward failed (promptId=${n.promptId}, requestId=${o}): ${NX(c)}`)}return}case"ask_user_response":{let n=iJn(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{this.sdkSession.respondToUserInput(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc ask_user_response forward failed (promptId=${n.promptId}, requestId=${o}): ${NX(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,`command-${r.id}`);return}}}};function iJn(t){try{return JSON.parse(t)}catch{return}}a(iJn,"safeJsonParse");function NX(t){return t instanceof Error?t.message:String(t)}a(NX,"errMsg");function uHs(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>nJn?e.slice(0,nJn-1).trimEnd()+"\u2026":e:""}a(uHs,"deriveTitleFromMessage");function dHs(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(dHs,"toVscodeUriShape");var xdr=new fe("BackgroundAgent.RemoteController"),Zct=class{constructor(e,r){this.ctx=e;this.deps=r;this.delegates=new Map}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 Yct(this.ctx,xdr,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new Jct(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:xdr,ctx:this.ctx,injectUserMessage:a((l,u,d)=>this.deps.injectUserMessage(l,u,d),"injectUserMessage")});if(!WGn(r,c))throw new Error("SDK capability missing: LocalSession.setRemoteDelegate");return this.delegates.set(e,c),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")}),c}async enableForSession(e,r){this.attachLazy(e,r);let n=rcr(r);if(!n)throw new Error("Remote steering not supported by this SDK version");return n.enable()}async disableForSession(e){let r=rcr(e);r&&await r.disable()}getStatus(e){let r=this.delegates.get(e);return r?r.getStatus():{remoteSteerable:!1}}delegateCount(){return this.delegates.size}fireAndForgetTearDown(e){let r=this.delegates.get(e);r&&(this.delegates.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){xdr.warn(this.ctx,"Mission Control deleteSession failed during destroySession",{sessionId:e,error:n instanceof Error?n.message:String(n)})}this.delegates.delete(e)}}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(Ur).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 wdr=new fe("BackgroundAgent.CustomAgents");async function Xct(t,e){try{if(Ft(t,Ye.EnableCustomAgents)===!1)return wdr.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(Ld).listCustomAgents([e],{includePlugins:!0});return o.length>0&&wdr.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>fHs(s))}catch(r){return wdr.warn(t,"Failed to load custom agents:",r),[]}}a(Xct,"loadCustomAgents");function fHs(t){let e=t.instruction??"";return{name:t.name,displayName:t.name,description:t.description??"",tools:t.tools??null,prompt:a(()=>Promise.resolve(e),"prompt"),disableModelInvocation:!1,model:t.model}}a(fHs,"toSweCustomAgent");p();var Rdr=new fe("BackgroundAgent.Hooks"),kdr="copilot-language-server";function sJn(t,e){return{preToolUse:[pHs(t,e)],postToolUse:[hHs(t,e)],userPromptSubmitted:[mHs(t,e)]}}a(sJn,"buildSessionHooks");function pHs(t,e){return{source:kdr,handler:a(async r=>{try{let o=await t.get(mE).hook(t,s2,{timestamp:r.timestamp,cwd:un(e.uri),toolName:r.toolName,toolArgs:FDe(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===Xue.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){Rdr.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(pHs,"createPreToolUseHandler");function hHs(t,e){return{source:kdr,handler:a(async r=>{try{await t.get(mE).hook(t,o2,{timestamp:r.timestamp,cwd:un(e.uri),toolName:r.toolName,toolArgs:FDe(r.toolArgs),toolResult:{resultType:Pdr(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){Rdr.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(hHs,"createPostToolUseHandler");function mHs(t,e){return{source:kdr,handler:a(async r=>{try{await t.get(mE).hook(t,a2,{timestamp:r.timestamp,cwd:un(e.uri),prompt:r.prompt},e);return}catch(n){Rdr.error(t,"Failed to execute UserPromptSubmitted hook",n);return}},"handler")}}a(mHs,"createUserPromptSubmittedHandler");function FDe(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(FDe,"safeStringifyToolArgs");function Pdr(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(Pdr,"toClsToolResultType");p();var gHs=["model-agents-md","cwd-model-agents-md"],AHs=["model-claude-md","cwd-model-claude-md"],yHs="nested-agents";function aJn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of gHs)e.add(r);if(t.useClaudeMdFile===!1)for(let r of AHs)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(yHs),e}a(aJn,"computeDisabledInstructionSources");var EHs=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),_Hs=2,vHs="CLAUDE.md",CHs="AGENTS.md";function bHs(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(bHs,"joinPath");async function SHs(t,e,r){let n=[],o=a(async(s,c)=>{let l;try{l=await t(bHs(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&&c<_Hs&&!EHs.has(u)&&await o([...s,u],c+1)}},"walk");return await o([],0),n.sort()}a(SHs,"scanNestedInstructionFiles");function THs(t,e){let r=t.filter(o=>o.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(_Hs,"buildNestedInstructionsSection");async function aJn(t,e,r,n){let o=await EHs(t,r,n),s=await Promise.all(o.map(async c=>({relativePath:c,content:await e(c)??""})));return _Hs(s,n)}a(aJn,"scanNestedInstructionsSection");function cJn(t,e,r){return aJn(t,e,r,gHs)}a(cJn,"scanNestedClaudeInstructions");function lJn(t,e,r){return aJn(t,e,r,AHs)}a(lJn,"scanNestedAgentsInstructions");function uJn(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(THs,"buildNestedInstructionsSection");async function cJn(t,e,r,n){let o=await SHs(t,r,n),s=await Promise.all(o.map(async c=>({relativePath:c,content:await e(c)??""})));return THs(s,n)}a(cJn,"scanNestedInstructionsSection");function lJn(t,e,r){return cJn(t,e,r,vHs)}a(lJn,"scanNestedClaudeInstructions");function uJn(t,e,r){return cJn(t,e,r,CHs)}a(uJn,"scanNestedAgentsInstructions");function dJn(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(uJn,"composeBackgroundAgentSystemMessage");p();p();p();p();var UDe=(n=>(n.Copilot="copilot",n.Claude="claude",n.OpenPlugin="openPlugin",n))(UDe||{});var MX=(n=>(n.GitHubShorthand="githubShorthand",n.GitUri="gitUri",n.LocalFileUri="localFileUri",n))(MX||{});p();p();var OX=require("fs"),whe=de(require("path"));var vHs=32,CHs=5e3,bHs=5*1024*1024,SHs=32,THs=xtn(SHs);async function MT(t,e){return THs.run(()=>o3(t(),CHs,e))}a(MT,"boundedFsOp");async function Pdr(t){let e=await MT(()=>OX.promises.stat(t),void 0);if(e)return{path:t,isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:!1}}a(Pdr,"statEntry");async function QDe(t){let e=await MT(()=>OX.promises.readdir(t,{withFileTypes:!0}),void 0);return e?vx(e,vHs,async r=>{let n=whe.join(t,r.name);if(r.isSymbolicLink()){let o=await Pdr(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(QDe,"readChildren");var dJn=process.platform==="linux";function wE(t,e){let r=dJn?t:t.toLowerCase(),n=dJn?e:e.toLowerCase(),o=whe.relative(r,n);return o===""||!o.startsWith("..")&&!whe.isAbsolute(o)}a(wE,"isAtOrUnder");async function eR(t,e){if(t===void 0)return!0;let r=await MT(()=>OX.promises.realpath(e),void 0);return r!==void 0&&wE(t,r)}a(eR,"withinRealBoundary");async function LX(t){if(t!==void 0)return MT(()=>OX.promises.realpath(t),t)}a(LX,"resolveRealBoundary");async function Jct(t){let e=await MT(()=>OX.promises.stat(t),void 0);if(!(!e||!e.isFile()||e.size>bHs))return MT(()=>OX.promises.readFile(t,"utf8"),void 0)}a(Jct,"readTextFileCapped");var fJn=require("fs"),Ddr=de(require("path"));function OT(t){let e=t.replace(/[\\/:*?"<>|]/g,"_");return/^\.+$/.test(e)?e.replace(/\./g,"_"):e}a(OT,"sanitizeCacheSegment");function Rhe(t){return t?[`ref_${encodeURIComponent(t)}`]:[]}a(Rhe,"refCacheSegment");function Zct(t,e){return e?[`sha_${encodeURIComponent(e)}`]:Rhe(t)}a(Zct,"gitRevisionCacheSuffix");function pJn(t,e,r){try{let n=new URL(t),o=OT((n.host||"unknown").toLowerCase()),s=n.pathname.replace(/\/+/g,"/").replace(/^\/+/,"").replace(/\/+$/g,"").replace(/\.git$/i,""),c=s?s.split("/").map(OT):[];return[o,...c,...Zct(e,r)]}catch{return["git",OT(t),...Zct(e,r)]}}a(pJn,"gitUrlToCacheSegments");async function Wd(t){return MT(()=>fJn.promises.stat(t).then(()=>!0,()=>!1),!1)}a(Wd,"exists");function qDe(t,e){let r=Ddr.join(t,...e);if(!wE(t,r))throw new Error(`plugin cache path escapes the cache root: ${e.join("/")}`);return r}a(qDe,"joinCacheSegments");function jDe(t,e){if(!e)return t;let r=e.trim().replace(/^\.?\/+|\/+$/g,"");if(!r)return t;let n=Ddr.join(t,r);return wE(t,n)?n:t}a(jDe,"joinContained");var Xct=require("node:url");function hJn(t){let e=new Map;for(let r of t){let n=LT(r);n&&!e.has(n.canonicalId)&&e.set(n.canonicalId,n)}return[...e.values()]}a(hJn,"parseMarketplaceReferences");function LT(t){let e=t.trim();if(e)return xHs(e)??wHs(e)??IHs(e)}a(LT,"parseMarketplaceReference");function IHs(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:gJn(r,n,o),cacheSegments:["github.com",OT(r),OT(n),...Rhe(o)],kind:"githubShorthand",ref:o,githubRepo:`${r}/${n}`}}a(IHs,"parseShorthandMarketplaceReference");function xHs(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,Xct.fileURLToPath)(e)}catch{return}return{rawValue:t,displayLabel:y,cloneUrl:t,canonicalId:`file:${(0,Xct.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=RHs(e),s=e.host.toLowerCase(),c=OT(s),l=e.pathname.replace(/\/+/g,"/").replace(/\/+$/g,"").replace(/^\/+/,"");if(!l)return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:Ndr(`git:${s}/`,n),cacheSegments:[c,...Rhe(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(OT),m=d?l.toLowerCase():`${l.toLowerCase()}${u}`,g=mJn(s,f),A=AJn(g,n,`git:${s}/${m}`);return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:A,cacheSegments:[c,...h,...Rhe(n)],kind:"gitUri",ref:n,githubRepo:g}}a(xHs,"parseUriMarketplaceReference");function wHs(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(OT),f=mJn(o,u),h=AJn(f,c,`git:${o.toLowerCase()}/${l.toLowerCase()}`);return{rawValue:t,displayLabel:t,cloneUrl:`${n}@${o}:${l}`,canonicalId:h,cacheSegments:[OT(o.toLowerCase()),...d,...Rhe(c)],kind:"gitUri",ref:c,githubRepo:f}}a(wHs,"parseScpMarketplaceReference");function RHs(t){if(!t.hash)return t.toString();let e=new URL(t.toString());return e.hash="",e.toString()}a(RHs,"refStrippedUrl");function mJn(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(mJn,"extractGitHubRepo");function gJn(t,e,r){return Ndr(`github:${t.toLowerCase()}/${e.toLowerCase()}`,r)}a(gJn,"getGitHubCanonicalId");function AJn(t,e,r){if(t){let[n,o]=t.split("/");return gJn(n,o,e)}return Ndr(r,e)}a(AJn,"gitCanonicalId");function Ndr(t,e){return e?`${t}#${encodeURIComponent(e)}`:t}a(Ndr,"appendRefSuffix");p();p();p();p();function yJn(t,e){return/^~(?=$|[/\\])/.test(t)?e+t.slice(1):t}a(yJn,"untildify");var kHs=200;function elt(t,e){return Mdr(t,e,new Set,0)}a(elt,"cloneAndChange");function Mdr(t,e,r,n){if(t==null)return t;let o=e(t);if(o!==void 0)return o;if(n>=kHs)throw new Error("Cannot clone: structure nested too deeply");if(Array.isArray(t))return t.map(s=>Mdr(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]=Mdr(t[c],e,r,n+1);return r.delete(t),s}return t}a(Mdr,"cloneAndChangeInner");function HDe(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(HDe,"toStringRecord");var tlt=de(require("path"));var DHs=/[\s&|<>()^;!`"'$]/;function NHs(t){return t.replace(/(\\*)("|$)/g,(e,r,n)=>r+r+(n?'\\"':""))}a(NHs,"escapeWindowsDoubleQuoted");function MHs(t,e,r){if(!t.includes(r))return t;if(!DHs.test(e))return t.replaceAll(r,e);let n=process.platform==="win32",o=new RegExp(`(["']?)${Toe(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(MHs,"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 LHs(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=HDe(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(LHs,"normalizeHookCommand");function EJn(t,e){let r=LHs(t);if(!r)return;let n,o=typeof t.cwd=="string"?t.cwd:void 0;if(o){let s=yJn(o,e);n=tlt.isAbsolute(s)?tlt.normalize(s):s}return{...r,...n!==void 0&&{cwd:n}}}a(EJn,"resolveHookCommand");function BHs(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=EJn(s,e);c&&n.push(c)}}else{let s=EJn(r,e);s&&n.push(s)}return n}a(BHs,"extractHookCommands");function Ldr(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(...BHs(h,r));f.length>0&&c.push({type:u,hooks:f,uri:t,originalId:l})}return c}a(Ldr,"parseHooksJson");function Odr(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]=MHs(f,c,o))}(!u.env||typeof u.env!="object")&&(u.env={}),u.env[s]=c},"mutateHookCommand");try{let u=elt(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 Odr(u,o,c),Ldr(t,u,n)}catch{return[]}}a(Bdr,"interpolateHookPluginRoot");p();var Ydr=require("fs");zdr();function YDe(t){try{return Wdr(t)}catch{return}}a(YDe,"parseJsonc");async function Nhe(t,e){let r=await MT(()=>Ydr.promises.stat(t),void 0);if(!r||!r.isFile()||e!==void 0&&r.size>e)return;let n=await MT(()=>Ydr.promises.readFile(t,"utf8"),void 0);if(n!==void 0)return YDe(n)}a(Nhe,"readJsoncFile");var IH=de(require("path"));var iGs={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 Ldr(t,e,n)}},oGs={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 Bdr(t,e,r,n,"${CLAUDE_PLUGIN_ROOT}","CLAUDE_PLUGIN_ROOT")}},sGs={format:2,manifestPath:".plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${PLUGIN_ROOT}",pluginRootEnvVar:"PLUGIN_ROOT",parseHooks(t,e,r,n){return Bdr(t,e,r,n,"${PLUGIN_ROOT}","PLUGIN_ROOT")}};async function PJn(t){return await Wd(IH.join(t,".plugin","plugin.json"))?sGs:t.split(/[/\\]/).includes(".claude")||await Wd(IH.join(t,".claude-plugin","plugin.json"))?oGs:iGs}a(PJn,"detectPluginFormat");async function DJn(t,e,r){let n=await LX(r);for(let o of[e.manifestPath,...e.altManifestPaths??[]]){let s=IH.join(t,o);if(!await eR(n,s))continue;let c=await Jct(s),l=c===void 0?void 0:YDe(c);if(l&&typeof l=="object"&&!Array.isArray(l))return{manifest:l,manifestUri:s}}}a(DJn,"readPluginManifest");function NJn(t){return[t.hookConfigPath,...t.altHookConfigPaths??[]]}a(NJn,"defaultHookConfigPaths");var Kdr={paths:[],exclusive:!1};function Mhe(t){if(t==null)return Kdr;if(typeof t=="string"){let e=t.trim();return e?{paths:[e],exclusive:!1}:Kdr}if(Array.isArray(t))return{paths:kJn(t),exclusive:!1};if(typeof t=="object"){let e=t;if(Array.isArray(e.paths))return{paths:kJn(e.paths),exclusive:e.exclusive===!0}}return Kdr}a(Mhe,"parseComponentPathConfig");function kJn(t){return t.filter(e=>typeof e=="string").map(e=>e.trim()).filter(e=>e.length>0)}a(kJn,"cleanPaths");function alt(t,e,r,n){let o=n&&wE(n,t)?n:t,s=[];r.exclusive||s.push(IH.join(t,e));for(let c of r.paths){let l=IH.normalize(IH.join(t,c));wE(o,l)&&s.push(l)}return s}a(alt,"resolveComponentDirs");p();p();var FT=de(require("path"));var aGs=new dO,clt=16,MJn=".md",cGs=[".instructions.md",".mdc",".md"];async function lGs(t){let e=FT.basename(t).replace(/(\.agent)?\.md$/i,"");return OJn(t,e)}a(lGs,"parseAgentFile");async function uGs(t){return OJn(t,FT.basename(FT.dirname(t)))}a(uGs,"parseSkillFile");async function OJn(t,e){let r=await Jct(t);if(r===void 0)return{name:e};try{let n=aGs.parse(t,r).header,o=n?.name?.trim()||e,s=n?.description?.trim();return{name:o,...s&&{description:s}}}catch{return{name:e}}}a(OJn,"readNameDescription");async function LJn(t,e,r){let n=await LX(r),s=(await vx(e,clt,async d=>{if(!await eR(n,d))return[];let f=FT.join(d,"SKILL.md");if(await Wd(f)&&await eR(n,f))return[f];let h=(await QDe(d)).filter(g=>g.isDirectory);return h.sort((g,A)=>g.path.localeCompare(A.path)),(await vx(h,clt,async g=>{if(g.isSymlink&&!await eR(n,g.path))return;let A=FT.join(g.path,"SKILL.md");if(!(!await Wd(A)||!await eR(n,A)))return A})).filter(g=>g!==void 0)})).flat();if(s.length===0){let d=FT.join(t,"SKILL.md");await Wd(d)&&await eR(n,d)&&s.push(d)}let c=await vx(s,clt,async d=>({uri:d,...await uGs(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(LJn,"readSkills");async function BJn(t,e,r){let n=await LX(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 eR(n,l))continue;let u=await Pdr(l);if(!u)continue;if(u.isFile){c(l);continue}if(!u.isDirectory)continue;let d=await QDe(l);d.sort((f,h)=>f.path.localeCompare(h.path));for(let f of d)f.isFile&&(f.isSymlink&&!await eR(n,f.path)||c(f.path))}return s.sort((l,u)=>l.name.localeCompare(u.name)),s}a(BJn,"scanComponentFiles");function dGs(t){return FT.extname(t).toLowerCase()===MJn?FT.basename(t).slice(0,-MJn.length):void 0}a(dGs,"getMarkdownComponentName");function Jdr(t,e){return BJn(t,dGs,e)}a(Jdr,"readMarkdownComponents");async function FJn(t,e){let r=await Jdr(t,e);if(r.length===0)return r;let n=await vx(r,clt,async c=>{let{name:l,description:u}=await lGs(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(FJn,"readAgentComponents");function fGs(t){let e=FT.basename(t),r=e.toLowerCase(),n=cGs.find(o=>r.endsWith(o));return n?e.slice(0,-n.length):void 0}a(fGs,"getInstructionFileName");function UJn(t,e){return BJn(t,fGs,e)}a(UJn,"readInstructionComponents");p();function pGs(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(pGs,"resolveMcpServersMap");function hGs(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=HDe(e.env,!0),u=r(e.envFile),d=r(e.cwd),f=HDe(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(hGs,"normalizeMcpServerConfiguration");function mGs(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(mGs,"interpolateMcpPluginRoot");var gGs=/\$\{(?![A-Za-z]+:)([A-Z_][A-Z0-9_]*)\}/g;function AGs(t){return elt(t,e=>{if(typeof e=="string"){let r=e.replace(gGs,"${env:$1}");return r!==e?r:void 0}})}a(AGs,"convertBareEnvVarsToVsCodeSyntax");function Zdr(t,e,r,n){let o=pGs(e);if(!o)return[];let s=[];for(let[c,l]of Object.entries(o)){let u=hGs(l);if(!u)continue;let d={name:c,configuration:u,uri:t};n.pluginRootToken&&n.pluginRootEnvVar&&(d=mGs(d,r,n.pluginRootToken,n.pluginRootEnvVar)),d=AGs(d),s.push(d)}return s}a(Zdr,"parseMcpServerDefinitionMap");p();var UX=require("fs"),Rb=de(require("path"));var efr=".copilot",tfr="installed-plugins",Mkf=Rb.join(efr,tfr),QJn="config.json",llt=5e3,ult=16,rfr=5*1024*1024;async function Ohe(t){return MT(()=>t().then(e=>({ok:!0,value:e}),e=>({ok:!1,code:e.code??"error"})),{ok:!1,code:"timeout"})}a(Ohe,"boundedFsResult");function Xdr(t){return t==="ENOENT"||t==="ENOTDIR"}a(Xdr,"isAbsentCode");async function qJn(t){let e=await Ohe(()=>UX.promises.stat(Rb.dirname(t)));return e.ok&&e.value.isDirectory()}a(qJn,"parentDirSurvives");async function nfr(t){let e=await Ohe(()=>UX.promises.stat(t));return e.ok||e.code!=="ENOENT"?!1:qJn(t)}a(nfr,"isDefinitivelyGone");var yGs={name:"marketplace",discover:_Gs},EGs={name:"copilotCli",discover:vGs,changeSignal:{dir:a(t=>t.copilotHome,"dir"),files:new Set([QJn]),createDir:!1,listing:a(t=>CGs(t.copilotHome),"listing")}},Lhe=[yGs,EGs];async function jJn(t){let e=await Promise.all(Lhe.map(o=>o.discover(t))),r=new Set,n=[];for(let o of e)for(let s of o){let c=lg(s.fsPath);r.has(c)||(r.add(c),n.push(s))}return n}a(jJn,"discoverPlugins");async function _Gs(t){return(await vx(t.installed,ult,async r=>{let n;if(Rb.isAbsolute(r.pluginUri))n=r.pluginUri;else{let u=Rb.resolve(t.sharedContentDir,r.pluginUri);if(!wE(t.sharedContentDir,u))return;n=u}let o=await Ohe(()=>UX.promises.stat(n));if(o.ok){if(!o.value.isDirectory())return}else if(o.code==="ENOENT"&&await qJn(n))return;let s=LT(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:ifr(n,t.copilotHome),...l&&{fromMarketplace:l},...c!==void 0&&{repositoryBoundary:c}}})).filter(r=>r!==void 0)}a(_Gs,"discoverMarketplace");async function vGs(t){return(await HJn(t.copilotHome)??[]).map(r=>({uri:r.fsPath,fsPath:r.fsPath,readOnly:!0,...r.displayName!==void 0&&{displayName:r.displayName}}))}a(vGs,"discoverCopilotCli");async function HJn(t){return o3(bGs(t),llt,void 0)}a(HJn,"listCopilotCliInstalls");async function CGs(t){return(await HJn(t))?.map(e=>e.fsPath)}a(CGs,"listCopilotCliPluginDirs");async function bGs(t){let e=Rb.join(t,tfr),[r,n]=await Promise.all([SGs(t),TGs(e)]);if(r===void 0&&n===void 0)return;let o=[];for(let u of r??[]){let f=(u.cachePath!==void 0&&Rb.isAbsolute(u.cachePath)?u.cachePath:void 0)??(u.name!==void 0&&u.marketplace!==void 0?Rb.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 vx(o,ult,async u=>await nfr(u.fsPath)?void 0:u),c=[],l=new Set;for(let u of s){if(u===void 0)continue;let d=lg(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=lg(u);l.has(d)||(l.add(d),c.push({fsPath:u}))}return c}a(bGs,"collectCopilotCliInstalls");async function SGs(t){let e=Rb.join(t,QJn),r=await Ohe(()=>UX.promises.stat(e));if(!r.ok)return Xdr(r.code)?[]:void 0;if(!r.value.isFile()||r.value.size>rfr)return;let n=await Ohe(()=>UX.promises.readFile(e,"utf8"));if(!n.ok)return Xdr(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(SGs,"readCliInstalledPlugins");async function TGs(t){let e=await Ohe(()=>UX.promises.readdir(t,{withFileTypes:!0}));if(!e.ok)return Xdr(e.code)?[]:void 0;let r=e.value,n=[];for(let o of r)if(o.isDirectory())for(let s of await QDe(Rb.join(t,o.name)))s.isDirectory&&n.push(s.path);return n}a(TGs,"scanCopilotCliPluginDirs");function ifr(t,e){return wE(Rb.join(e,tfr),t)}a(ifr,"isCopilotCliPath");var ofr=de(require("path"));var IGs="commands",xGs="skills",wGs="agents",RGs="rules",kGs=".mcp.json";async function $Jn(t,e,r){let n=r.repositoryBoundary,o=n&&wE(n,t)?n:t,s=await LX(o),c=await DJn(t,e,s),l=c?.manifest,u=c?.manifestUri??ofr.join(t,e.manifestPath),d=a((v,b)=>alt(t,b,Mhe(l?.[v]),n),"dirsFor"),[f,h,m,g,A,y]=await Promise.all([Jdr(d("commands",IGs),s),LJn(t,d("skills",xGs),s),FJn(d("agents",wGs),s),UJn(d("rules",RGs),s),PGs(t,l,u,e,n,s,r),NGs(t,l,u,e,n,s)]),E=l?.name,_=typeof E=="string"&&E.trim()?E.trim():void 0;return{hooks:A,commands:f,skills:h,agents:m,instructions:g,mcpServerDefinitions:y,..._&&{manifestName:_}}}a($Jn,"readPluginContributions");function dlt(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&!Object.hasOwn(t,"paths")}a(dlt,"isEmbeddedSection");async function VJn(t,e){if(await eR(e,t))return Nhe(t,rfr)}a(VJn,"readJsoncWithinBoundary");async function PGs(t,e,r,n,o,s,c){let l=e?.hooks;if(dlt(l)){let h=Object.hasOwn(l,"hooks")||Object.hasOwn(l,"disableAllHooks")?l:{hooks:l},m=GJn(n,r,h,t,c);if(m.length>0)return m}let u=dlt(l)?Mhe(void 0):Mhe(l),d=DGs(t,n,u,o);for(let f of d){let h=await VJn(f,s);if(h)return GJn(n,f,h,t,c)}return[]}a(PGs,"readHooks");function GJn(t,e,r,n,o){try{return t.parseHooks(e,r,n,o.userHome)}catch{return[]}}a(GJn,"parseHooksSafely");function DGs(t,e,r,n){let o=[];if(!r.exclusive)for(let s of NJn(e))o.push(ofr.join(t,s));for(let s of alt(t,"",{paths:r.paths,exclusive:!0},n))o.includes(s)||o.push(s);return o}a(DGs,"resolveHookConfigPaths");async function NGs(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(dlt(u)&&l(Zdr(r,{mcpServers:u},t,n)),c.size===0){let d=dlt(u)?Mhe(void 0):Mhe(u),f=alt(t,kGs,d,o);for(let h of f){let m=await VJn(h,s);m&&l(Zdr(h,m,t,n))}}return[...c.values()].sort((d,f)=>d.name.localeCompare(f.name))}a(NGs,"readMcpServers");p();function KDe(t){return t.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)[^/@\s]*@/g,"$1")}a(KDe,"redactUrlCredentials");var xH=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredPluginError"}static{a(this,"StructuredPluginError")}},flt=class extends xH{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"}},Bhe=class extends xH{static{a(this,"PluginCloneError")}constructor(e,r){let n=KDe(e),o=KDe(r instanceof Error?r.message:String(r)),s={kind:"pluginCloneFailed",cloneUrl:n,cause:o};super(`Failed to clone plugin source '${n}': ${o}`,s),this.name="PluginCloneError"}},Fhe=class extends xH{static{a(this,"LocalMarketplaceMissingError")}constructor(e){let r={kind:"localMarketplaceMissing",repositoryPath:e};super(`Local marketplace repository does not exist: ${e}`,r),this.name="LocalMarketplaceMissingError"}},Uhe=class extends xH{static{a(this,"InvalidPluginSourceError")}constructor(e,r="plugin source"){let n=KDe(e),o={kind:"invalidPluginSource",source:n};super(`Invalid ${r}: ${n}`,o),this.name="InvalidPluginSourceError"}};p();var WJn=require("fs"),sfr=de(require("path"));var MGs=new Set(["installed.json","enablement.json"]);function afr(t){return(e,r)=>{let n=lg(e.path);return sfr.posix.dirname(n)===r&&t.has(sfr.posix.basename(n))}}a(afr,"matchNamedFiles");var zJn=afr(MGs),JDe=class{constructor(e,r,n,o,s=50){this.ctx=e;this.dir=r;this.debounceMs=s;this.logger=new fe("PluginFileWatcher");this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._disposed=!1;this._dirKey=lg(r),this._recursive=n.recursive??!1,this._createDir=n.createDir??!0,this._matches=n.matches,this._watcher=o??Bze(e),this._ownsWatcher=o===void 0}static{a(this,"PluginFileWatcher")}async start(){if(!this._disposed)try{if(this._createDir)await WJn.promises.mkdir(this.dir,{recursive:!0,mode:448});else if(!await Wd(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 YJn=require("fs"),KJn=de(require("path"));var OGs=new fe("plugins.git"),LGs=12e4,plt=class{constructor(e){this.ctx=e;this.gitInstances=new Map}static{a(this,"PluginGitService")}async cloneRepository(e,r,n){try{let o=KJn.dirname(r);await YJn.promises.mkdir(o,{recursive:!0,mode:448}),await(await this.instanceFor(o)).clone(e,r)}catch(o){throw OGs.warn(this.ctx,`clone failed for ${KDe(e)}`,o),new Bhe(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 lO()).path),r=Gue({baseDir:e,binary:this._binary,unsafe:{allowUnsafeCustomBinary:!0},timeout:{block:LGs}}),this.gitInstances.set(e,r)),r}forget(e){this.gitInstances.delete(e)}dispose(){this.gitInstances.clear()}};p();var hlt=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 Wd(r))throw new Bhe(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=LT(e.marketplace);if(!r)return;let n=this.repository.getRepositoryUri(r);if(await Wd(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 JJn({kind:"github",repo:r.githubRepo},r,e.name);if(r.kind==="gitUri")return JJn({kind:"url",url:r.cloneUrl},r,e.name)}};function JJn(t,e,r){return{name:r,description:"",version:"",sourceDescriptor:t,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:"openPlugin"}}a(JJn,"synthesizePlugin");p();p();var BGs=new fe("plugins.catalog");function cfr(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(cfr,"parseMarketplaceCatalog");function FGs(t,e,r,n){let o=a(s=>{n&&BGs.warn(n,`skipping plugin '${r}': ${s}`)},"skip");if(t==null||typeof t=="string"){let c=UGs(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"):qGs(t.repo)?!Qhe(t.ref)||!Qhe(t.path)?o("github source 'ref'/'path' must be strings when provided"):XJn(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'"):Qhe(t.ref)?XJn(t.sha)?t.source==="git-subdir"&&(typeof t.path!="string"||!t.path)?o("git-subdir source is missing required 'path' field"):t.source==="url"&&!Qhe(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`):!Qhe(t.version)||!Qhe(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 UGs(t,e){let r=ZJn(t??""),n=ZJn(e);return r&&(n===r||n.startsWith(`${r}/`))?n:QGs(`/${r}/${n}`).replace(/^\/+/,"")}a(UGs,"resolvePluginSource");function ZJn(t){return t.trim().replace(/\\/g,"/").replace(/^\.?\/+/,"").replace(/\/+$/g,"")}a(ZJn,"normalizeMarketplacePath");function QGs(t){let e=[];for(let r of t.split("/"))r===""||r==="."||(r===".."?e.pop():e.push(r));return`/${e.join("/")}`}a(QGs,"posixNormalize");function Qhe(t){return t===void 0||typeof t=="string"}a(Qhe,"isOptionalString");function XJn(t){return t===void 0||typeof t=="string"&&/^[0-9a-fA-F]{40}$/.test(t)}a(XJn,"isOptionalGitSha");function qGs(t){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(t)}a(qGs,"isValidGitHubRepo");var XDe=de(require("path"));var qhe=new fe("plugins.marketplace"),jGs=480*60*1e3,HGs=3e4,GGs=15e4,eZn=[{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"}],mlt=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(()=>{qhe.debug(this.ctx,"marketplace fetch exceeded deadline",{reference:r.rawValue}),c({plugins:[],error:WGs(r)})},GGs);l.unref?.();let u=n?.onCancellationRequested(()=>c({plugins:[]}));n?.isCancellationRequested&&c({plugins:[]}),e.then(c,d=>c({plugins:[],error:tZn(r,d)}))})}async readPluginsFromDirectory(e,r,n){return this.readPluginsFromDefinitions(r,async o=>{if(!n?.isCancellationRequested)return Nhe(XDe.join(e,o))},e)}async readAllPluginsFromDirectory(e,r,n){let o=new Map;for(let s of eZn){if(n?.isCancellationRequested)return[];let c=await Nhe(XDe.join(e,s.path));if(!(!c?.plugins||!Array.isArray(c.plugins)))for(let l of cfr(c,r,s.type,this.ctx))o.has(l.name)||o.set(l.name,rZn(l,e))}return[...o.values()]}async readSinglePluginManifest(e,r){if(!(r.kind!=="githubShorthand"&&r.kind!=="gitUri")){for(let n of $Gs){let o=await Nhe(XDe.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?oZn(r.githubRepo,""):iZn(e,"")}}qhe.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=>zGs(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=VGs(n);try{let m=await this.ctx.get(tr).fetch(f,{method:"GET",timeout:HGs,signal:h.signal});if(m.status!==200){m.status>=500&&(c=m.status),s&&=m.status>=400&&m.status<500;return}return YDe(await m.text())}catch(m){qhe.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?(qhe.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 qhe.debug(this.ctx,"failed to prepare marketplace repository",{reference:e.rawValue,err:String(o)}),{plugins:[],error:tZn(e,o)}}return{plugins:await this.readPluginsFromDirectory(n,e,r)}}async readPluginsFromDefinitions(e,r,n){for(let o of eZn){let s=await r(o.path);if(!(!s?.plugins||!Array.isArray(s.plugins)))return cfr(s,e,o.type,this.ctx).map(c=>rZn(c,n))}return qhe.debug(this.ctx,"no marketplace catalog found",{reference:e.rawValue}),[]}now(){return this.ctx.get(Cx).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()+jGs})}};function VGs(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(VGs,"abortSignalFor");function WGs(t){return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:"unavailable",message:`Marketplace '${t.displayLabel}' did not respond in time`}}a(WGs,"deadlineError");function tZn(t,e){let r=e instanceof Error?e.message:String(e),n=e instanceof Fhe?"localMissing":"cloneFailed";return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:n,message:r}}a(tZn,"toFetchError");function zGs(t,e){return{...t,marketplace:e.displayLabel,marketplaceReference:e}}a(zGs,"restamp");function rZn(t,e){let r=t.sourceDescriptor.kind==="relativePath"?t.sourceDescriptor.path:"",n=e?iZn(e,r):oZn(t.marketplaceReference.githubRepo??"",r);return{...t,readmeUri:n}}a(rZn,"withReadme");function nZn(t){let e=t.trim().replace(/^\.?\/+|\/+$/g,"");return e?`${e}/README.md`:"README.md"}a(nZn,"readmeRelPath");function iZn(t,e){return XDe.join(t,nZn(e))}a(iZn,"fileReadmeUri");function oZn(t,e){return`https://github.com/${t}/blob/main/${nZn(e)}`}a(oZn,"githubBlobReadmeUri");p();p();var jhe=require("fs"),sZn=de(require("path"));var YGs=1e4,KGs=3e4,JGs=25;async function Hhe(t,e){await jhe.promises.mkdir(sZn.dirname(t),{recursive:!0,mode:448});let r=Date.now()+KGs;for(;;)try{await jhe.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 ZGs(t)>YGs&&await jhe.promises.rm(t,{force:!0}).catch(()=>{}),await bC(JGs)}try{return await e()}finally{await jhe.promises.rm(t,{force:!0}).catch(()=>{})}}a(Hhe,"withFileLock");async function ZGs(t){try{let e=await jhe.promises.stat(t);return Date.now()-e.mtimeMs}catch{return 1/0}}a(ZGs,"lockAgeMs");p();var Ghe=require("fs"),QX=de(require("path"));var XGs=new fe("plugins.source"),e$s=0,aZn=".clone-tmp";function t$s(t){try{return process.kill(t,0),!0}catch(e){return e.code==="EPERM"}}a(t$s,"isProcessAlive");async function r$s(t){let e=QX.dirname(t),r=`${QX.basename(t)}.`,n;try{n=await Ghe.promises.readdir(e)}catch{return}await Promise.all(n.map(async o=>{if(!o.startsWith(r)||!o.endsWith(aZn))return;let s=Number.parseInt(o.slice(r.length).split(".")[0],10);!Number.isInteger(s)||s<=0||s===process.pid||t$s(s)||await Ghe.promises.rm(QX.join(e,o),{recursive:!0,force:!0}).catch(()=>{})}))}a(r$s,"sweepOrphanedCloneTemps");async function lfr(t,e,r,n,o){if(await Wd(r))return;await r$s(r);let s=`${r}.${process.pid}.${e$s++}${aZn}`;try{await t.git.cloneRepository(e,s,n),o?await t.git.checkout(s,o,!0):n&&await t.git.checkout(s,n),await Hhe(`${r}.lock`,async()=>{await Wd(r)||(await Ghe.promises.mkdir(QX.dirname(r),{recursive:!0,mode:448}),await Ghe.promises.rename(s,r))})}finally{t.git.forget(s),await Ghe.promises.rm(s,{recursive:!0,force:!0}).catch(()=>{})}}a(lfr,"cloneIntoPlace");var glt=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||"."}},Alt=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 Wd(o)?await this.checkoutRevision(o,n):await lfr(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 Wd(o))return XGs.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)}},ylt=class extends Alt{constructor(){super(...arguments);this.kind="github"}static{a(this,"GitHubPluginSource")}getInstallUri(r,n){let o=n;return jDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n,[s,c]=o.repo.split("/");return qDe(r,["github.com",OT(s),OT(c),...Zct(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`}},Elt=class extends Alt{constructor(){super(...arguments);this.kind="url"}static{a(this,"GitUrlPluginSource")}getInstallUri(r,n){let o=n;return jDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n;return qDe(r,pJn(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 eNe=require("fs"),qX=de(require("path"));var n$s=0,_lt=class{constructor(e,r,n){this.ctx=e;this.store=r;this.git=n;this.logger=new fe("plugins.repository");this.cloneSequencer=new Vx;this.cacheRoot=r.sharedContentDir;let o={ctx:e,git:n};this.sources=new Map([["relativePath",new glt],["github",new ylt(o)],["url",new Elt(o)]])}static{a(this,"PluginRepositoryService")}getPluginSource(e){let r=this.sources.get(e);if(!r)throw new flt(e);return r}getRepositoryUri(e){return e.kind==="localFileUri"&&e.localRepositoryUri?e.localRepositoryUri:qDe(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 jDe(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 Wd(r))return r;if(e.kind==="localFileUri")throw new Fhe(r);return await lfr({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 Wd(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 Wd(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||!wE(this.cacheRoot,n))return;let o=!1,s=`${n}.gc-${process.pid}-${n$s++}`;if(await Hhe(`${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 Wd(n)&&await eNe.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 eNe.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=qX.isAbsolute(n.pluginUri)?n.pluginUri:qX.resolve(this.cacheRoot,n.pluginUri);return wE(e,o)})}async pruneEmptyParents(e){let r=qX.dirname(e);for(;wE(this.cacheRoot,r)&&r!==this.cacheRoot;){try{if((await eNe.promises.readdir(r)).length>0)break;await eNe.promises.rmdir(r)}catch{break}r=qX.dirname(r)}}};p();p();function cZn(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(cZn,"isInstalledEntry");var wH=require("fs"),Q2=de(require("path"));var lZn="plugins",a$s="plugins",c$s="installed.json",l$s="enablement.json",u$s="marketplaces.json",d$s=".lock",f$s=0,uZn=a(t=>typeof t=="string","isString"),tNe=class t{constructor(e){this.rootDir=e}static{a(this,"PluginStore")}get sharedContentDir(){return Q2.join(this.rootDir,lZn)}editorPluginsDir(e){return Q2.join(this.rootDir,this.safeEditorSegment(e),a$s)}installedJsonPath(e){return Q2.join(this.editorPluginsDir(e),c$s)}enablementJsonPath(e){return Q2.join(this.editorPluginsDir(e),l$s)}marketplacesJsonPath(e){return Q2.join(this.editorPluginsDir(e),u$s)}async readInstalled(e){let{version:r,items:n}=await this.readManifest(this.installedJsonPath(e),"installed",1,cZn);return{version:r,installed:n}}async readEnablement(e){let{version:r,items:n}=await this.readManifest(this.enablementJsonPath(e),"disabled",1,uZn);return{version:r,disabled:n}}async readMarketplaces(e){let{version:r,items:n}=await this.readManifest(this.marketplacesJsonPath(e),"marketplaces",1,uZn);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=Q2.join(this.editorPluginsDir(e),d$s);return Hhe(n,r)}async listEditorIds(){let e;try{e=await wH.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=>wH.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()===lZn||e!==Q2.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 wH.promises.readFile(e,{encoding:"utf8"});return JSON.parse(r)}catch{return}}async writeJsonAtomic(e,r){let n=Q2.dirname(e);await wH.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${f$s++}.tmp`,s=JSON.stringify(r,null,2)+` -`;try{await wH.promises.writeFile(o,s,{encoding:"utf8",mode:384}),await wH.promises.rename(o,e)}catch(c){throw await wH.promises.rm(o,{force:!0}).catch(()=>{}),c}}};var pZn=require("os"),$he=de(require("path"));var dZn={hooks:[],commands:[],skills:[],agents:[],instructions:[],mcpServerDefinitions:[]},fZn=new Set,p$s=new Set(Lhe.filter(t=>t.changeSignal).map(t=>t.name)),uc=class{constructor(e,r,n=50,o=(0,pZn.homedir)(),s=process.env.COPILOT_HOME||$he.join(o,efr)){this.ctx=e;this.watchDebounceMs=n;this.userHome=o;this.copilotHome=s;this.logger=new fe("AgentPluginService");this._onDidChangePlugins=new ep;this.onDidChangePlugins=a((e,r,n)=>(this.ensureWatching(),this._onDidChangePlugins.event(e,r,n)),"onDidChangePlugins");this.mutationSequencer=new Vx;this._sourceWatchers=[];this._sourceSubscriptions=[];this._watchStarted=!1;this._disposed=!1;this._lastSourceListings=new Map;this._injectedWatcher=r,this.ensureWatching()}static{a(this,"AgentPluginService")}get store(){return this._store||(this._store=new tNe(this.ctx.get(Yn).directory)),this._store}get repository(){return this._repository||(this._git??=new plt(this.ctx),this._repository=new _lt(this.ctx,this.store,this._git)),this._repository}get marketplace(){return this._marketplace||(this._marketplace=new mlt(this.ctx,this.repository)),this._marketplace}get install(){return this._install||(this._install=new hlt(this.repository,this.marketplace)),this._install}get editorId(){return this.ctx.get(Ir).getEditorIdentity().editorId}guardEditorId(e){let r=this.editorId;if(tNe.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 jJn(this.discoveryDeps(r)),c=await vx(s,ult,l=>this.toPlugin(l,o));return c.sort((l,u)=>l.uri.localeCompare(u.uri)),c}async toPlugin(e,r){let n=await this.readContributionsSafely(e),o=e.fromMarketplace?.name||n.manifestName||e.displayName||$he.basename(e.fsPath);return{uri:e.uri,label:o,enabled:!r.has(e.uri),hooks:n.hooks,commands:n.commands,skills:n.skills,agents:n.agents,instructions:n.instructions,mcpServerDefinitions:n.mcpServerDefinitions,...e.fromMarketplace&&{fromMarketplace:e.fromMarketplace}}}readContributionsSafely(e){let r=(async()=>{let n=await PJn(e.fsPath);return $Jn(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)}),dZn));return o3(r,llt,dZn)}discoveryRoots(){return{sharedContentDir:this.store.sharedContentDir,copilotHome:this.copilotHome}}isReadOnlyPlugin(e){return ifr(e,this.copilotHome)}discoveryDeps(e){let r=new Map;return{...this.discoveryRoots(),installed:e,getRepositoryUri:a(n=>this.repository.getRepositoryUri(n),"getRepositoryUri"),resolveMarketplace:a(n=>this.resolveMarketplaceForList(n,r),"resolveMarketplace")}}resolveMarketplaceForList(e,r){let n=LT(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 o3(o,llt,void 0)}async readMarketplacePluginFromDir(e,r,n,o){if(!await Wd(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){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(fZn)}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 $he.isAbsolute(e.pluginUri)?nfr(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 JDe(this.ctx,r,{matches:zJn},this._injectedWatcher,this.watchDebounceMs),this._watchSubscription=this._fileWatcher.onDidChange(()=>{this.refreshAndMaybeFire(fZn)});let n=this.discoveryRoots();for(let o of Lhe){let s=o.changeSignal;if(!s)continue;let c=new JDe(this.ctx,s.dir(n),{createDir:s.createDir,matches:afr(s.files)},this._injectedWatcher,this.watchDebounceMs);this._sourceSubscriptions.push(c.onDidChange(()=>{this.refreshAndMaybeFire(new Set([o.name]))})),this._sourceWatchers.push(c)}this.seedAndStart()}async seedAndStart(){await this.mutationSequencer.queue(this.editorId,async()=>{if(this._lastStateKey===void 0)try{this._lastStateKey=await this.stateKey(p$s)}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 l of Lhe){let u=l.changeSignal;if(!u||!e.has(l.name)&&this._lastSourceListings.has(l.name))continue;let d=await u.listing(s);d!==void 0&&this._lastSourceListings.set(l.name,d)}let c={};for(let l of Lhe)l.changeSignal&&(c[l.name]=[...this._lastSourceListings.get(l.name)??[]].sort());return JSON.stringify({installed:n.map(l=>[l.pluginUri,l.name]).sort((l,u)=>l[0].localeCompare(u[0])||l[1].localeCompare(u[1])),disabled:[...o].sort(),sources:c})}async installPlugin(e){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=LT(e);if(!n)throw new Uhe(e);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}async addMarketplaceReference(e){await this.mutate(async r=>{let n=await this.store.readMarketplaces(r);return n.marketplaces.some(s=>LT(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);return hJn(r)}async addMarketplace(e){let r=LT(e);if(!r)throw new Uhe(e,"marketplace source");await this.addMarketplaceReference(r)}async removeMarketplace(e){let r=LT(e);await this.mutate(async n=>{let o=await this.store.readMarketplaces(n),s=o.marketplaces.filter(c=>c===e?!1:r?LT(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=LT(e);if(!n)throw new Uhe(e,"marketplace source");r=[n]}else r=await this.listMarketplaces();return this.marketplace.fetchMarketplacePlugins(r)}dispose(){if(!this._disposed){this._disposed=!0,this._watchSubscription?.dispose(),this._fileWatcher?.dispose();for(let e of this._sourceSubscriptions)e.dispose();for(let e of this._sourceWatchers)e.dispose();this._git?.dispose(),this._onDidChangePlugins.dispose()}}};var vlt=de(require("path"));var jX=new fe("BackgroundAgent.PluginHooks"),Vhe="copilot-plugin",ufr={SessionStart:"sessionStart",SessionEnd:"sessionEnd",UserPromptSubmit:"userPromptSubmitted",PreToolUse:"preToolUse",PostToolUse:"postToolUse",ErrorOccurred:"errorOccurred"};function h$s(t,e){let r={};for(let o of t)for(let s of o.hooks){let c=ufr[s.type];if(c!==void 0)for(let l of s.hooks){let u=dfr(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(h$s,"groupPluginHooksBySource");async function hZn(t,e){if(!W5(t)||!fJ(t))return{};let r;try{r=(await t.get(uc).listPlugins()).filter(c=>c.enabled)}catch(c){return c instanceof bl?{}:(jX.warn(t,"failed to list plugins for hook injection",{err:String(c)}),{})}if(r.length===0)return{};let n=un(e.uri),o=h$s(r,n),s={};return o.preToolUse&&(s.preToolUse=[g$s(t,n,o.preToolUse)]),o.postToolUse&&(s.postToolUse=[A$s(t,n,o.postToolUse)]),o.userPromptSubmitted&&(s.userPromptSubmitted=[y$s(t,n,o.userPromptSubmitted)]),o.sessionStart&&(s.sessionStart=[E$s(t,n,o.sessionStart)]),o.sessionEnd&&(s.sessionEnd=[_$s(t,n,o.sessionEnd)]),o.errorOccurred&&(s.errorOccurred=[v$s(t,n,o.errorOccurred)]),s}a(hZn,"buildPluginHookHandlers");function mZn(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(mZn,"mergePluginHooks");function dfr(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=m$s(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(dfr,"toCommandHook");function m$s(t,e){if(t!==void 0)return vlt.isAbsolute(t)?t:vlt.join(e,t)}a(m$s,"resolveHookCwd");function Whe(t,e){return async r=>{if(fJ(t))return e(r)}}a(Whe,"gated");function g$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:FDe(n.toolArgs)};for(let s of r){let c=await new o2(s.source,s.hooks).fire(t,o);for(let l of c){let u=l.output;if(u&&u.permissionDecision===Xue.deny)return{permissionDecision:"deny",permissionDecisionReason:u.permissionDecisionReason||"Tool execution denied by plugin hook"}}}return}catch(o){jX.error(t,`Failed to execute plugin PreToolUse hook for tool ${n.toolName}`,o);return}})}}a(g$s,"pluginPreToolUseHandler");function A$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:FDe(n.toolArgs),toolResult:{resultType:kdr(n.toolResult.resultType),textResultForLlm:n.toolResult.textResultForLlm}};for(let s of r)await new i2(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,`Failed to execute plugin PostToolUse hook for tool ${n.toolName}`,o)}})}}a(A$s,"pluginPostToolUseHandler");function y$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,prompt:n.prompt};for(let s of r)await new s2(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin UserPromptSubmitted hook",o)}})}}a(y$s,"pluginUserPromptSubmittedHandler");function E$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,source:n.source,...n.initialPrompt!==void 0&&{initialPrompt:n.initialPrompt}};for(let s of r)await new uJ(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin SessionStart hook",o)}})}}a(E$s,"pluginSessionStartHandler");function _$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,reason:n.reason};for(let s of r)await new lJ(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin SessionEnd hook",o)}})}}a(_$s,"pluginSessionEndHandler");function v$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,error:{message:n.error.message,name:n.error.name,...n.error.stack!==void 0&&{stack:n.error.stack}}};for(let s of r)await new lF(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin ErrorOccurred hook",o)}})}}a(v$s,"pluginErrorOccurredHandler");p();var gZn=de(require("node:path"));function AZn(t){let e="";for(let r of t){let n=r.codePointAt(0)??0;n>=32&&n!==127&&(e+=r)}return e.trim()}a(AZn,"sanitizeForPrompt");function C$s(t){let e=t.startsWith("file:")?un(t):t;return AZn(gZn.basename(e))}a(C$s,"confinedBasename");function b$s(t){let e=t.startsWith("file:")?un(t):t;return AZn(e)}a(b$s,"confinedAbsolutePath");function yZn(t){let e=C$s(t),r=b$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(dJn,"composeBackgroundAgentSystemMessage");p();p();p();p();var UDe=(n=>(n.Copilot="copilot",n.Claude="claude",n.OpenPlugin="openPlugin",n))(UDe||{});var MX=(n=>(n.GitHubShorthand="githubShorthand",n.GitUri="gitUri",n.LocalFileUri="localFileUri",n))(MX||{});p();p();var OX=require("fs"),whe=de(require("path"));var IHs=32,xHs=5e3,wHs=5*1024*1024,RHs=32,kHs=wtn(RHs);async function LT(t,e){return kHs.run(()=>o3(t(),xHs,e))}a(LT,"boundedFsOp");async function Ddr(t){let e=await LT(()=>OX.promises.stat(t),void 0);if(e)return{path:t,isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:!1}}a(Ddr,"statEntry");async function QDe(t){let e=await LT(()=>OX.promises.readdir(t,{withFileTypes:!0}),void 0);return e?hS(e,IHs,async r=>{let n=whe.join(t,r.name);if(r.isSymbolicLink()){let o=await Ddr(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(QDe,"readChildren");var fJn=process.platform==="linux";function wE(t,e){let r=fJn?t:t.toLowerCase(),n=fJn?e:e.toLowerCase(),o=whe.relative(r,n);return o===""||!o.startsWith("..")&&!whe.isAbsolute(o)}a(wE,"isAtOrUnder");async function tR(t,e){if(t===void 0)return!0;let r=await LT(()=>OX.promises.realpath(e),void 0);return r!==void 0&&wE(t,r)}a(tR,"withinRealBoundary");async function LX(t){if(t!==void 0)return LT(()=>OX.promises.realpath(t),t)}a(LX,"resolveRealBoundary");async function qDe(t){let e=await LT(()=>OX.promises.stat(t),void 0);if(!(!e||!e.isFile()||e.size>wHs))return LT(()=>OX.promises.readFile(t,"utf8"),void 0)}a(qDe,"readTextFileCapped");var pJn=require("fs"),Ndr=de(require("path"));function BT(t){let e=t.replace(/[\\/:*?"<>|]/g,"_");return/^\.+$/.test(e)?e.replace(/\./g,"_"):e}a(BT,"sanitizeCacheSegment");function Rhe(t){return t?[`ref_${encodeURIComponent(t)}`]:[]}a(Rhe,"refCacheSegment");function elt(t,e){return e?[`sha_${encodeURIComponent(e)}`]:Rhe(t)}a(elt,"gitRevisionCacheSuffix");function hJn(t,e,r){try{let n=new URL(t),o=BT((n.host||"unknown").toLowerCase()),s=n.pathname.replace(/\/+/g,"/").replace(/^\/+/,"").replace(/\/+$/g,"").replace(/\.git$/i,""),c=s?s.split("/").map(BT):[];return[o,...c,...elt(e,r)]}catch{return["git",BT(t),...elt(e,r)]}}a(hJn,"gitUrlToCacheSegments");async function Wd(t){return LT(()=>pJn.promises.stat(t).then(()=>!0,()=>!1),!1)}a(Wd,"exists");function jDe(t,e){let r=Ndr.join(t,...e);if(!wE(t,r))throw new Error(`plugin cache path escapes the cache root: ${e.join("/")}`);return r}a(jDe,"joinCacheSegments");function HDe(t,e){if(!e)return t;let r=e.trim().replace(/^\.?\/+|\/+$/g,"");if(!r)return t;let n=Ndr.join(t,r);return wE(t,n)?n:t}a(HDe,"joinContained");var tlt=require("node:url");function mJn(t){let e=new Map;for(let r of t){let n=FT(r);n&&!e.has(n.canonicalId)&&e.set(n.canonicalId,n)}return[...e.values()]}a(mJn,"parseMarketplaceReferences");function FT(t){let e=t.trim();if(e)return DHs(e)??NHs(e)??PHs(e)}a(FT,"parseMarketplaceReference");function PHs(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:AJn(r,n,o),cacheSegments:["github.com",BT(r),BT(n),...Rhe(o)],kind:"githubShorthand",ref:o,githubRepo:`${r}/${n}`}}a(PHs,"parseShorthandMarketplaceReference");function DHs(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,tlt.fileURLToPath)(e)}catch{return}return{rawValue:t,displayLabel:y,cloneUrl:t,canonicalId:`file:${(0,tlt.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=MHs(e),s=e.host.toLowerCase(),c=BT(s),l=e.pathname.replace(/\/+/g,"/").replace(/\/+$/g,"").replace(/^\/+/,"");if(!l)return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:Mdr(`git:${s}/`,n),cacheSegments:[c,...Rhe(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(BT),m=d?l.toLowerCase():`${l.toLowerCase()}${u}`,g=gJn(s,f),A=yJn(g,n,`git:${s}/${m}`);return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:A,cacheSegments:[c,...h,...Rhe(n)],kind:"gitUri",ref:n,githubRepo:g}}a(DHs,"parseUriMarketplaceReference");function NHs(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(BT),f=gJn(o,u),h=yJn(f,c,`git:${o.toLowerCase()}/${l.toLowerCase()}`);return{rawValue:t,displayLabel:t,cloneUrl:`${n}@${o}:${l}`,canonicalId:h,cacheSegments:[BT(o.toLowerCase()),...d,...Rhe(c)],kind:"gitUri",ref:c,githubRepo:f}}a(NHs,"parseScpMarketplaceReference");function MHs(t){if(!t.hash)return t.toString();let e=new URL(t.toString());return e.hash="",e.toString()}a(MHs,"refStrippedUrl");function gJn(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(gJn,"extractGitHubRepo");function AJn(t,e,r){return Mdr(`github:${t.toLowerCase()}/${e.toLowerCase()}`,r)}a(AJn,"getGitHubCanonicalId");function yJn(t,e,r){if(t){let[n,o]=t.split("/");return AJn(n,o,e)}return Mdr(r,e)}a(yJn,"gitCanonicalId");function Mdr(t,e){return e?`${t}#${encodeURIComponent(e)}`:t}a(Mdr,"appendRefSuffix");p();p();p();p();function EJn(t,e){return/^~(?=$|[/\\])/.test(t)?e+t.slice(1):t}a(EJn,"untildify");var OHs=200;function rlt(t,e){return Odr(t,e,new Set,0)}a(rlt,"cloneAndChange");function Odr(t,e,r,n){if(t==null)return t;let o=e(t);if(o!==void 0)return o;if(n>=OHs)throw new Error("Cannot clone: structure nested too deeply");if(Array.isArray(t))return t.map(s=>Odr(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]=Odr(t[c],e,r,n+1);return r.delete(t),s}return t}a(Odr,"cloneAndChangeInner");function GDe(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(GDe,"toStringRecord");var nlt=de(require("path"));var BHs=/[\s&|<>()^;!`"'$]/;function FHs(t){return t.replace(/(\\*)("|$)/g,(e,r,n)=>r+r+(n?'\\"':""))}a(FHs,"escapeWindowsDoubleQuoted");function UHs(t,e,r){if(!t.includes(r))return t;if(!BHs.test(e))return t.replaceAll(r,e);let n=process.platform==="win32",o=new RegExp(`(["']?)${Toe(r)}([\\w./\\\\~:@-]*)`,"g");return t.replace(o,(s,c,l)=>{let u=e+l;if(c==="'")return c+u.replace(/'/g,"'\\''");let d=n?FHs(u):u.replace(/([\\"$`])/g,"\\$&");return c?c+d:'"'+d+'"'})}a(UHs,"shellQuotePluginRootInCommand");var QHs={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 qHs(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=GDe(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(qHs,"normalizeHookCommand");function _Jn(t,e){let r=qHs(t);if(!r)return;let n,o=typeof t.cwd=="string"?t.cwd:void 0;if(o){let s=EJn(o,e);n=nlt.isAbsolute(s)?nlt.normalize(s):s}return{...r,...n!==void 0&&{cwd:n}}}a(_Jn,"resolveHookCommand");function jHs(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=_Jn(s,e);c&&n.push(c)}}else{let s=_Jn(r,e);s&&n.push(s)}return n}a(jHs,"extractHookCommands");function Bdr(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=QHs[l];if(!u)continue;let d=s[l];if(!Array.isArray(d))continue;let f=[];for(let h of d)f.push(...jHs(h,r));f.length>0&&c.push({type:u,hooks:f,uri:t,originalId:l})}return c}a(Bdr,"parseHooksJson");function Ldr(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]=UHs(f,c,o))}(!u.env||typeof u.env!="object")&&(u.env={}),u.env[s]=c},"mutateHookCommand");try{let u=rlt(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 Ldr(u,o,c),Bdr(t,u,n)}catch{return[]}}a(Fdr,"interpolateHookPluginRoot");p();var Kdr=require("fs");Ydr();function KDe(t){try{return zdr(t)}catch{return}}a(KDe,"parseJsonc");async function Nhe(t,e){let r=await LT(()=>Kdr.promises.stat(t),void 0);if(!r||!r.isFile()||e!==void 0&&r.size>e)return;let n=await LT(()=>Kdr.promises.readFile(t,"utf8"),void 0);if(n!==void 0)return KDe(n)}a(Nhe,"readJsoncFile");var xH=de(require("path"));var lGs={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 Bdr(t,e,n)}},uGs={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 Fdr(t,e,r,n,"${CLAUDE_PLUGIN_ROOT}","CLAUDE_PLUGIN_ROOT")}},dGs={format:2,manifestPath:".plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${PLUGIN_ROOT}",pluginRootEnvVar:"PLUGIN_ROOT",parseHooks(t,e,r,n){return Fdr(t,e,r,n,"${PLUGIN_ROOT}","PLUGIN_ROOT")}};async function DJn(t){return await Wd(xH.join(t,".plugin","plugin.json"))?dGs:t.split(/[/\\]/).includes(".claude")||await Wd(xH.join(t,".claude-plugin","plugin.json"))?uGs:lGs}a(DJn,"detectPluginFormat");async function NJn(t,e,r){let n=await LX(r);for(let o of[e.manifestPath,...e.altManifestPaths??[]]){let s=xH.join(t,o);if(!await tR(n,s))continue;let c=await qDe(s),l=c===void 0?void 0:KDe(c);if(l&&typeof l=="object"&&!Array.isArray(l))return{manifest:l,manifestUri:s}}}a(NJn,"readPluginManifest");function MJn(t){return[t.hookConfigPath,...t.altHookConfigPaths??[]]}a(MJn,"defaultHookConfigPaths");var Jdr={paths:[],exclusive:!1};function Mhe(t){if(t==null)return Jdr;if(typeof t=="string"){let e=t.trim();return e?{paths:[e],exclusive:!1}:Jdr}if(Array.isArray(t))return{paths:PJn(t),exclusive:!1};if(typeof t=="object"){let e=t;if(Array.isArray(e.paths))return{paths:PJn(e.paths),exclusive:e.exclusive===!0}}return Jdr}a(Mhe,"parseComponentPathConfig");function PJn(t){return t.filter(e=>typeof e=="string").map(e=>e.trim()).filter(e=>e.length>0)}a(PJn,"cleanPaths");function llt(t,e,r,n){let o=n&&wE(n,t)?n:t,s=[];r.exclusive||s.push(xH.join(t,e));for(let c of r.paths){let l=xH.normalize(xH.join(t,c));wE(o,l)&&s.push(l)}return s}a(llt,"resolveComponentDirs");p();p();var QT=de(require("path"));var LJn=new dO,JDe=16,OJn=".md",fGs=[".instructions.md",".mdc",".md"];async function pGs(t){let e=QT.basename(t).replace(/(\.agent)?\.md$/i,"");return BJn(t,e)}a(pGs,"parseAgentFile");async function hGs(t){return BJn(t,QT.basename(QT.dirname(t)))}a(hGs,"parseSkillFile");async function BJn(t,e){let r=await qDe(t);if(r===void 0)return{name:e};try{let n=LJn.parse(t,r).header,o=n?.name?.trim()||e,s=n?.description?.trim();return{name:o,...s&&{description:s}}}catch{return{name:e}}}a(BJn,"readNameDescription");async function mGs(t){let e=await qDe(t);if(e!==void 0)try{return LJn.parse(t,e).header?.description?.trim()||void 0}catch{return}}a(mGs,"parseCommandDescription");async function FJn(t,e,r){let n=await LX(r),s=(await hS(e,JDe,async d=>{if(!await tR(n,d))return[];let f=QT.join(d,"SKILL.md");if(await Wd(f)&&await tR(n,f))return[f];let h=(await QDe(d)).filter(g=>g.isDirectory);return h.sort((g,A)=>g.path.localeCompare(A.path)),(await hS(h,JDe,async g=>{if(g.isSymlink&&!await tR(n,g.path))return;let A=QT.join(g.path,"SKILL.md");if(!(!await Wd(A)||!await tR(n,A)))return A})).filter(g=>g!==void 0)})).flat();if(s.length===0){let d=QT.join(t,"SKILL.md");await Wd(d)&&await tR(n,d)&&s.push(d)}let c=await hS(s,JDe,async d=>({uri:d,...await hGs(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(FJn,"readSkills");async function UJn(t,e,r){let n=await LX(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 tR(n,l))continue;let u=await Ddr(l);if(!u)continue;if(u.isFile){c(l);continue}if(!u.isDirectory)continue;let d=await QDe(l);d.sort((f,h)=>f.path.localeCompare(h.path));for(let f of d)f.isFile&&(f.isSymlink&&!await tR(n,f.path)||c(f.path))}return s.sort((l,u)=>l.name.localeCompare(u.name)),s}a(UJn,"scanComponentFiles");function gGs(t){return QT.extname(t).toLowerCase()===OJn?QT.basename(t).slice(0,-OJn.length):void 0}a(gGs,"getMarkdownComponentName");function QJn(t,e){return UJn(t,gGs,e)}a(QJn,"readMarkdownComponents");async function qJn(t,e){let r=await QJn(t,e);return hS(r,JDe,async n=>{let o=await mGs(n.uri);return{...n,...o&&{description:o}}})}a(qJn,"readCommandComponents");async function jJn(t,e){let r=await QJn(t,e);if(r.length===0)return r;let n=await hS(r,JDe,async c=>{let{name:l,description:u}=await pGs(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(jJn,"readAgentComponents");function AGs(t){let e=QT.basename(t),r=e.toLowerCase(),n=fGs.find(o=>r.endsWith(o));return n?e.slice(0,-n.length):void 0}a(AGs,"getInstructionFileName");function HJn(t,e){return UJn(t,AGs,e)}a(HJn,"readInstructionComponents");p();function yGs(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(yGs,"resolveMcpServersMap");function EGs(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=GDe(e.env,!0),u=r(e.envFile),d=r(e.cwd),f=GDe(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(EGs,"normalizeMcpServerConfiguration");function _Gs(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(_Gs,"interpolateMcpPluginRoot");var vGs=/\$\{(?![A-Za-z]+:)([A-Z_][A-Z0-9_]*)\}/g;function CGs(t){return rlt(t,e=>{if(typeof e=="string"){let r=e.replace(vGs,"${env:$1}");return r!==e?r:void 0}})}a(CGs,"convertBareEnvVarsToVsCodeSyntax");function Zdr(t,e,r,n){let o=yGs(e);if(!o)return[];let s=[];for(let[c,l]of Object.entries(o)){let u=EGs(l);if(!u)continue;let d={name:c,configuration:u,uri:t};n.pluginRootToken&&n.pluginRootEnvVar&&(d=_Gs(d,r,n.pluginRootToken,n.pluginRootEnvVar)),d=CGs(d),s.push(d)}return s}a(Zdr,"parseMcpServerDefinitionMap");p();var UX=require("fs"),Rb=de(require("path"));var efr=".copilot",tfr="installed-plugins",jkf=Rb.join(efr,tfr),GJn="config.json",ult=5e3,dlt=16,rfr=5*1024*1024;async function Ohe(t){return LT(()=>t().then(e=>({ok:!0,value:e}),e=>({ok:!1,code:e.code??"error"})),{ok:!1,code:"timeout"})}a(Ohe,"boundedFsResult");function Xdr(t){return t==="ENOENT"||t==="ENOTDIR"}a(Xdr,"isAbsentCode");async function $Jn(t){let e=await Ohe(()=>UX.promises.stat(Rb.dirname(t)));return e.ok&&e.value.isDirectory()}a($Jn,"parentDirSurvives");async function nfr(t){let e=await Ohe(()=>UX.promises.stat(t));return e.ok||e.code!=="ENOENT"?!1:$Jn(t)}a(nfr,"isDefinitivelyGone");var bGs={name:"marketplace",discover:TGs},SGs={name:"copilotCli",discover:IGs,changeSignal:{dir:a(t=>t.copilotHome,"dir"),files:new Set([GJn]),createDir:!1,listing:a(t=>xGs(t.copilotHome),"listing")}},Lhe=[bGs,SGs];async function VJn(t){let e=await Promise.all(Lhe.map(o=>o.discover(t))),r=new Set,n=[];for(let o of e)for(let s of o){let c=lg(s.fsPath);r.has(c)||(r.add(c),n.push(s))}return n}a(VJn,"discoverPlugins");async function TGs(t){return(await hS(t.installed,dlt,async r=>{let n;if(Rb.isAbsolute(r.pluginUri))n=r.pluginUri;else{let u=Rb.resolve(t.sharedContentDir,r.pluginUri);if(!wE(t.sharedContentDir,u))return;n=u}let o=await Ohe(()=>UX.promises.stat(n));if(o.ok){if(!o.value.isDirectory())return}else if(o.code==="ENOENT"&&await $Jn(n))return;let s=FT(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:ifr(n,t.copilotHome),...l&&{fromMarketplace:l},...c!==void 0&&{repositoryBoundary:c}}})).filter(r=>r!==void 0)}a(TGs,"discoverMarketplace");async function IGs(t){return(await WJn(t.copilotHome)??[]).map(r=>({uri:r.fsPath,fsPath:r.fsPath,readOnly:!0,...r.displayName!==void 0&&{displayName:r.displayName}}))}a(IGs,"discoverCopilotCli");async function WJn(t){return o3(wGs(t),ult,void 0)}a(WJn,"listCopilotCliInstalls");async function xGs(t){return(await WJn(t))?.map(e=>e.fsPath)}a(xGs,"listCopilotCliPluginDirs");async function wGs(t){let e=Rb.join(t,tfr),[r,n]=await Promise.all([RGs(t),kGs(e)]);if(r===void 0&&n===void 0)return;let o=[];for(let u of r??[]){let f=(u.cachePath!==void 0&&Rb.isAbsolute(u.cachePath)?u.cachePath:void 0)??(u.name!==void 0&&u.marketplace!==void 0?Rb.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 hS(o,dlt,async u=>await nfr(u.fsPath)?void 0:u),c=[],l=new Set;for(let u of s){if(u===void 0)continue;let d=lg(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=lg(u);l.has(d)||(l.add(d),c.push({fsPath:u}))}return c}a(wGs,"collectCopilotCliInstalls");async function RGs(t){let e=Rb.join(t,GJn),r=await Ohe(()=>UX.promises.stat(e));if(!r.ok)return Xdr(r.code)?[]:void 0;if(!r.value.isFile()||r.value.size>rfr)return;let n=await Ohe(()=>UX.promises.readFile(e,"utf8"));if(!n.ok)return Xdr(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(RGs,"readCliInstalledPlugins");async function kGs(t){let e=await Ohe(()=>UX.promises.readdir(t,{withFileTypes:!0}));if(!e.ok)return Xdr(e.code)?[]:void 0;let r=e.value,n=[];for(let o of r)if(o.isDirectory())for(let s of await QDe(Rb.join(t,o.name)))s.isDirectory&&n.push(s.path);return n}a(kGs,"scanCopilotCliPluginDirs");function ifr(t,e){return wE(Rb.join(e,tfr),t)}a(ifr,"isCopilotCliPath");var ofr=de(require("path"));var PGs="commands",DGs="skills",NGs="agents",MGs="rules",OGs=".mcp.json";async function YJn(t,e,r){let n=r.repositoryBoundary,o=n&&wE(n,t)?n:t,s=await LX(o),c=await NJn(t,e,s),l=c?.manifest,u=c?.manifestUri??ofr.join(t,e.manifestPath),d=a((v,b)=>llt(t,b,Mhe(l?.[v]),n),"dirsFor"),[f,h,m,g,A,y]=await Promise.all([qJn(d("commands",PGs),s),FJn(t,d("skills",DGs),s),jJn(d("agents",NGs),s),HJn(d("rules",MGs),s),LGs(t,l,u,e,n,s,r),FGs(t,l,u,e,n,s)]),E=l?.name,_=typeof E=="string"&&E.trim()?E.trim():void 0;return{hooks:A,commands:f,skills:h,agents:m,instructions:g,mcpServerDefinitions:y,..._&&{manifestName:_}}}a(YJn,"readPluginContributions");function flt(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&!Object.hasOwn(t,"paths")}a(flt,"isEmbeddedSection");async function KJn(t,e){if(await tR(e,t))return Nhe(t,rfr)}a(KJn,"readJsoncWithinBoundary");async function LGs(t,e,r,n,o,s,c){let l=e?.hooks;if(flt(l)){let h=Object.hasOwn(l,"hooks")||Object.hasOwn(l,"disableAllHooks")?l:{hooks:l},m=zJn(n,r,h,t,c);if(m.length>0)return m}let u=flt(l)?Mhe(void 0):Mhe(l),d=BGs(t,n,u,o);for(let f of d){let h=await KJn(f,s);if(h)return zJn(n,f,h,t,c)}return[]}a(LGs,"readHooks");function zJn(t,e,r,n,o){try{return t.parseHooks(e,r,n,o.userHome)}catch{return[]}}a(zJn,"parseHooksSafely");function BGs(t,e,r,n){let o=[];if(!r.exclusive)for(let s of MJn(e))o.push(ofr.join(t,s));for(let s of llt(t,"",{paths:r.paths,exclusive:!0},n))o.includes(s)||o.push(s);return o}a(BGs,"resolveHookConfigPaths");async function FGs(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(flt(u)&&l(Zdr(r,{mcpServers:u},t,n)),c.size===0){let d=flt(u)?Mhe(void 0):Mhe(u),f=llt(t,OGs,d,o);for(let h of f){let m=await KJn(h,s);m&&l(Zdr(h,m,t,n))}}return[...c.values()].sort((d,f)=>d.name.localeCompare(f.name))}a(FGs,"readMcpServers");p();function ZDe(t){return t.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)[^/@\s]*@/g,"$1")}a(ZDe,"redactUrlCredentials");var wH=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredPluginError"}static{a(this,"StructuredPluginError")}},plt=class extends wH{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"}},Bhe=class extends wH{static{a(this,"PluginCloneError")}constructor(e,r){let n=ZDe(e),o=ZDe(r instanceof Error?r.message:String(r)),s={kind:"pluginCloneFailed",cloneUrl:n,cause:o};super(`Failed to clone plugin source '${n}': ${o}`,s),this.name="PluginCloneError"}},Fhe=class extends wH{static{a(this,"LocalMarketplaceMissingError")}constructor(e){let r={kind:"localMarketplaceMissing",repositoryPath:e};super(`Local marketplace repository does not exist: ${e}`,r),this.name="LocalMarketplaceMissingError"}},Uhe=class extends wH{static{a(this,"InvalidPluginSourceError")}constructor(e,r="plugin source"){let n=ZDe(e),o={kind:"invalidPluginSource",source:n};super(`Invalid ${r}: ${n}`,o),this.name="InvalidPluginSourceError"}};p();var JJn=require("fs"),sfr=de(require("path"));var UGs=new Set(["installed.json","enablement.json"]);function afr(t){return(e,r)=>{let n=lg(e.path);return sfr.posix.dirname(n)===r&&t.has(sfr.posix.basename(n))}}a(afr,"matchNamedFiles");var ZJn=afr(UGs),XDe=class{constructor(e,r,n,o,s=50){this.ctx=e;this.dir=r;this.debounceMs=s;this.logger=new fe("PluginFileWatcher");this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._disposed=!1;this._dirKey=lg(r),this._recursive=n.recursive??!1,this._createDir=n.createDir??!0,this._matches=n.matches,this._watcher=o??Uze(e),this._ownsWatcher=o===void 0}static{a(this,"PluginFileWatcher")}async start(){if(!this._disposed)try{if(this._createDir)await JJn.promises.mkdir(this.dir,{recursive:!0,mode:448});else if(!await Wd(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 XJn=require("fs"),eZn=de(require("path"));var QGs=new fe("plugins.git"),qGs=12e4,hlt=class{constructor(e){this.ctx=e;this.gitInstances=new Map}static{a(this,"PluginGitService")}async cloneRepository(e,r,n){try{let o=eZn.dirname(r);await XJn.promises.mkdir(o,{recursive:!0,mode:448}),await(await this.instanceFor(o)).clone(e,r)}catch(o){throw QGs.warn(this.ctx,`clone failed for ${ZDe(e)}`,o),new Bhe(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 lO()).path),r=Gue({baseDir:e,binary:this._binary,unsafe:{allowUnsafeCustomBinary:!0},timeout:{block:qGs}}),this.gitInstances.set(e,r)),r}forget(e){this.gitInstances.delete(e)}dispose(){this.gitInstances.clear()}};p();var mlt=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 Wd(r))throw new Bhe(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=FT(e.marketplace);if(!r)return;let n=this.repository.getRepositoryUri(r);if(await Wd(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 tZn({kind:"github",repo:r.githubRepo},r,e.name);if(r.kind==="gitUri")return tZn({kind:"url",url:r.cloneUrl},r,e.name)}};function tZn(t,e,r){return{name:r,description:"",version:"",sourceDescriptor:t,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:"openPlugin"}}a(tZn,"synthesizePlugin");p();p();var jGs=new fe("plugins.catalog");function cfr(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=HGs(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(cfr,"parseMarketplaceCatalog");function HGs(t,e,r,n){let o=a(s=>{n&&jGs.warn(n,`skipping plugin '${r}': ${s}`)},"skip");if(t==null||typeof t=="string"){let c=GGs(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"):VGs(t.repo)?!Qhe(t.ref)||!Qhe(t.path)?o("github source 'ref'/'path' must be strings when provided"):nZn(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'"):Qhe(t.ref)?nZn(t.sha)?t.source==="git-subdir"&&(typeof t.path!="string"||!t.path)?o("git-subdir source is missing required 'path' field"):t.source==="url"&&!Qhe(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`):!Qhe(t.version)||!Qhe(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(HGs,"parsePluginSource");function GGs(t,e){let r=rZn(t??""),n=rZn(e);return r&&(n===r||n.startsWith(`${r}/`))?n:$Gs(`/${r}/${n}`).replace(/^\/+/,"")}a(GGs,"resolvePluginSource");function rZn(t){return t.trim().replace(/\\/g,"/").replace(/^\.?\/+/,"").replace(/\/+$/g,"")}a(rZn,"normalizeMarketplacePath");function $Gs(t){let e=[];for(let r of t.split("/"))r===""||r==="."||(r===".."?e.pop():e.push(r));return`/${e.join("/")}`}a($Gs,"posixNormalize");function Qhe(t){return t===void 0||typeof t=="string"}a(Qhe,"isOptionalString");function nZn(t){return t===void 0||typeof t=="string"&&/^[0-9a-fA-F]{40}$/.test(t)}a(nZn,"isOptionalGitSha");function VGs(t){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(t)}a(VGs,"isValidGitHubRepo");var tNe=de(require("path"));var qhe=new fe("plugins.marketplace"),WGs=480*60*1e3,zGs=3e4,YGs=15e4,iZn=[{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"}],KGs=[{type:"openPlugin",path:".plugin/plugin.json"},{type:"claude",path:".claude-plugin/plugin.json"},{type:"copilot",path:"plugin.json"}],glt=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(()=>{qhe.debug(this.ctx,"marketplace fetch exceeded deadline",{reference:r.rawValue}),c({plugins:[],error:ZGs(r)})},YGs);l.unref?.();let u=n?.onCancellationRequested(()=>c({plugins:[]}));n?.isCancellationRequested&&c({plugins:[]}),e.then(c,d=>c({plugins:[],error:oZn(r,d)}))})}async readPluginsFromDirectory(e,r,n){return this.readPluginsFromDefinitions(r,async o=>{if(!n?.isCancellationRequested)return Nhe(tNe.join(e,o))},e)}async readAllPluginsFromDirectory(e,r,n){let o=new Map;for(let s of iZn){if(n?.isCancellationRequested)return[];let c=await Nhe(tNe.join(e,s.path));if(!(!c?.plugins||!Array.isArray(c.plugins)))for(let l of cfr(c,r,s.type,this.ctx))o.has(l.name)||o.set(l.name,sZn(l,e))}return[...o.values()]}async readSinglePluginManifest(e,r){if(!(r.kind!=="githubShorthand"&&r.kind!=="gitUri")){for(let n of KGs){let o=await Nhe(tNe.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?lZn(r.githubRepo,""):cZn(e,"")}}qhe.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=>XGs(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=JGs(n);try{let m=await this.ctx.get(nr).fetch(f,{method:"GET",timeout:zGs,signal:h.signal});if(m.status!==200){m.status>=500&&(c=m.status),s&&=m.status>=400&&m.status<500;return}return KDe(await m.text())}catch(m){qhe.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?(qhe.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 qhe.debug(this.ctx,"failed to prepare marketplace repository",{reference:e.rawValue,err:String(o)}),{plugins:[],error:oZn(e,o)}}return{plugins:await this.readPluginsFromDirectory(n,e,r)}}async readPluginsFromDefinitions(e,r,n){for(let o of iZn){let s=await r(o.path);if(!(!s?.plugins||!Array.isArray(s.plugins)))return cfr(s,e,o.type,this.ctx).map(c=>sZn(c,n))}return qhe.debug(this.ctx,"no marketplace catalog found",{reference:e.rawValue}),[]}now(){return this.ctx.get(bx).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()+WGs})}};function JGs(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(JGs,"abortSignalFor");function ZGs(t){return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:"unavailable",message:`Marketplace '${t.displayLabel}' did not respond in time`}}a(ZGs,"deadlineError");function oZn(t,e){let r=e instanceof Error?e.message:String(e),n=e instanceof Fhe?"localMissing":"cloneFailed";return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:n,message:r}}a(oZn,"toFetchError");function XGs(t,e){return{...t,marketplace:e.displayLabel,marketplaceReference:e}}a(XGs,"restamp");function sZn(t,e){let r=t.sourceDescriptor.kind==="relativePath"?t.sourceDescriptor.path:"",n=e?cZn(e,r):lZn(t.marketplaceReference.githubRepo??"",r);return{...t,readmeUri:n}}a(sZn,"withReadme");function aZn(t){let e=t.trim().replace(/^\.?\/+|\/+$/g,"");return e?`${e}/README.md`:"README.md"}a(aZn,"readmeRelPath");function cZn(t,e){return tNe.join(t,aZn(e))}a(cZn,"fileReadmeUri");function lZn(t,e){return`https://github.com/${t}/blob/main/${aZn(e)}`}a(lZn,"githubBlobReadmeUri");p();p();var jhe=require("fs"),uZn=de(require("path"));var e$s=1e4,t$s=3e4,r$s=25;async function Hhe(t,e){await jhe.promises.mkdir(uZn.dirname(t),{recursive:!0,mode:448});let r=Date.now()+t$s;for(;;)try{await jhe.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 n$s(t)>e$s&&await jhe.promises.rm(t,{force:!0}).catch(()=>{}),await SC(r$s)}try{return await e()}finally{await jhe.promises.rm(t,{force:!0}).catch(()=>{})}}a(Hhe,"withFileLock");async function n$s(t){try{let e=await jhe.promises.stat(t);return Date.now()-e.mtimeMs}catch{return 1/0}}a(n$s,"lockAgeMs");p();var Ghe=require("fs"),QX=de(require("path"));var i$s=new fe("plugins.source"),o$s=0,dZn=".clone-tmp";function s$s(t){try{return process.kill(t,0),!0}catch(e){return e.code==="EPERM"}}a(s$s,"isProcessAlive");async function a$s(t){let e=QX.dirname(t),r=`${QX.basename(t)}.`,n;try{n=await Ghe.promises.readdir(e)}catch{return}await Promise.all(n.map(async o=>{if(!o.startsWith(r)||!o.endsWith(dZn))return;let s=Number.parseInt(o.slice(r.length).split(".")[0],10);!Number.isInteger(s)||s<=0||s===process.pid||s$s(s)||await Ghe.promises.rm(QX.join(e,o),{recursive:!0,force:!0}).catch(()=>{})}))}a(a$s,"sweepOrphanedCloneTemps");async function lfr(t,e,r,n,o){if(await Wd(r))return;await a$s(r);let s=`${r}.${process.pid}.${o$s++}${dZn}`;try{await t.git.cloneRepository(e,s,n),o?await t.git.checkout(s,o,!0):n&&await t.git.checkout(s,n),await Hhe(`${r}.lock`,async()=>{await Wd(r)||(await Ghe.promises.mkdir(QX.dirname(r),{recursive:!0,mode:448}),await Ghe.promises.rename(s,r))})}finally{t.git.forget(s),await Ghe.promises.rm(s,{recursive:!0,force:!0}).catch(()=>{})}}a(lfr,"cloneIntoPlace");var Alt=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||"."}},ylt=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 Wd(o)?await this.checkoutRevision(o,n):await lfr(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 Wd(o))return i$s.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)}},Elt=class extends ylt{constructor(){super(...arguments);this.kind="github"}static{a(this,"GitHubPluginSource")}getInstallUri(r,n){let o=n;return HDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n,[s,c]=o.repo.split("/");return jDe(r,["github.com",BT(s),BT(c),...elt(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`}},_lt=class extends ylt{constructor(){super(...arguments);this.kind="url"}static{a(this,"GitUrlPluginSource")}getInstallUri(r,n){let o=n;return HDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n;return jDe(r,hJn(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 rNe=require("fs"),qX=de(require("path"));var c$s=0,vlt=class{constructor(e,r,n){this.ctx=e;this.store=r;this.git=n;this.logger=new fe("plugins.repository");this.cloneSequencer=new Wx;this.cacheRoot=r.sharedContentDir;let o={ctx:e,git:n};this.sources=new Map([["relativePath",new Alt],["github",new Elt(o)],["url",new _lt(o)]])}static{a(this,"PluginRepositoryService")}getPluginSource(e){let r=this.sources.get(e);if(!r)throw new plt(e);return r}getRepositoryUri(e){return e.kind==="localFileUri"&&e.localRepositoryUri?e.localRepositoryUri:jDe(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 HDe(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 Wd(r))return r;if(e.kind==="localFileUri")throw new Fhe(r);return await lfr({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 Wd(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 Wd(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||!wE(this.cacheRoot,n))return;let o=!1,s=`${n}.gc-${process.pid}-${c$s++}`;if(await Hhe(`${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 Wd(n)&&await rNe.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 rNe.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=qX.isAbsolute(n.pluginUri)?n.pluginUri:qX.resolve(this.cacheRoot,n.pluginUri);return wE(e,o)})}async pruneEmptyParents(e){let r=qX.dirname(e);for(;wE(this.cacheRoot,r)&&r!==this.cacheRoot;){try{if((await rNe.promises.readdir(r)).length>0)break;await rNe.promises.rmdir(r)}catch{break}r=qX.dirname(r)}}};p();p();function fZn(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(fZn,"isInstalledEntry");var RH=require("fs"),q2=de(require("path"));var pZn="plugins",f$s="plugins",p$s="installed.json",h$s="enablement.json",m$s="marketplaces.json",g$s=".lock",A$s=0,hZn=a(t=>typeof t=="string","isString"),nNe=class t{constructor(e){this.rootDir=e}static{a(this,"PluginStore")}get sharedContentDir(){return q2.join(this.rootDir,pZn)}editorPluginsDir(e){return q2.join(this.rootDir,this.safeEditorSegment(e),f$s)}installedJsonPath(e){return q2.join(this.editorPluginsDir(e),p$s)}enablementJsonPath(e){return q2.join(this.editorPluginsDir(e),h$s)}marketplacesJsonPath(e){return q2.join(this.editorPluginsDir(e),m$s)}async readInstalled(e){let{version:r,items:n}=await this.readManifest(this.installedJsonPath(e),"installed",1,fZn);return{version:r,installed:n}}async readEnablement(e){let{version:r,items:n}=await this.readManifest(this.enablementJsonPath(e),"disabled",1,hZn);return{version:r,disabled:n}}async readMarketplaces(e){let{version:r,items:n}=await this.readManifest(this.marketplacesJsonPath(e),"marketplaces",1,hZn);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=q2.join(this.editorPluginsDir(e),g$s);return Hhe(n,r)}async listEditorIds(){let e;try{e=await RH.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=>RH.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()===pZn||e!==q2.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 RH.promises.readFile(e,{encoding:"utf8"});return JSON.parse(r)}catch{return}}async writeJsonAtomic(e,r){let n=q2.dirname(e);await RH.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${A$s++}.tmp`,s=JSON.stringify(r,null,2)+` +`;try{await RH.promises.writeFile(o,s,{encoding:"utf8",mode:384}),await RH.promises.rename(o,e)}catch(c){throw await RH.promises.rm(o,{force:!0}).catch(()=>{}),c}}};var AZn=require("os"),$he=de(require("path"));var mZn={hooks:[],commands:[],skills:[],agents:[],instructions:[],mcpServerDefinitions:[]},gZn=new Set,y$s=new Set(Lhe.filter(t=>t.changeSignal).map(t=>t.name)),uc=class{constructor(e,r,n=50,o=(0,AZn.homedir)(),s=process.env.COPILOT_HOME||$he.join(o,efr)){this.ctx=e;this.watchDebounceMs=n;this.userHome=o;this.copilotHome=s;this.logger=new fe("AgentPluginService");this._onDidChangePlugins=new ep;this.onDidChangePlugins=a((e,r,n)=>(this.ensureWatching(),this._onDidChangePlugins.event(e,r,n)),"onDidChangePlugins");this.mutationSequencer=new Wx;this._sourceWatchers=[];this._sourceSubscriptions=[];this._watchStarted=!1;this._disposed=!1;this._lastSourceListings=new Map;this._injectedWatcher=r,this.ensureWatching()}static{a(this,"AgentPluginService")}get store(){return this._store||(this._store=new nNe(this.ctx.get(ri).directory)),this._store}get repository(){return this._repository||(this._git??=new hlt(this.ctx),this._repository=new vlt(this.ctx,this.store,this._git)),this._repository}get marketplace(){return this._marketplace||(this._marketplace=new glt(this.ctx,this.repository)),this._marketplace}get install(){return this._install||(this._install=new mlt(this.repository,this.marketplace)),this._install}get editorId(){return this.ctx.get(Ir).getEditorIdentity().editorId}guardEditorId(e){let r=this.editorId;if(nNe.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 VJn(this.discoveryDeps(r)),c=await hS(s,dlt,l=>this.toPlugin(l,o));return c.sort((l,u)=>l.uri.localeCompare(u.uri)),c}async toPlugin(e,r){let n=await this.readContributionsSafely(e),o=e.fromMarketplace?.name||n.manifestName||e.displayName||$he.basename(e.fsPath);return{uri:e.uri,label:o,enabled:!r.has(e.uri),hooks:n.hooks,commands:n.commands,skills:n.skills,agents:n.agents,instructions:n.instructions,mcpServerDefinitions:n.mcpServerDefinitions,...e.fromMarketplace&&{fromMarketplace:e.fromMarketplace}}}readContributionsSafely(e){let r=(async()=>{let n=await DJn(e.fsPath);return YJn(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)}),mZn));return o3(r,ult,mZn)}discoveryRoots(){return{sharedContentDir:this.store.sharedContentDir,copilotHome:this.copilotHome}}isReadOnlyPlugin(e){return ifr(e,this.copilotHome)}discoveryDeps(e){let r=new Map;return{...this.discoveryRoots(),installed:e,getRepositoryUri:a(n=>this.repository.getRepositoryUri(n),"getRepositoryUri"),resolveMarketplace:a(n=>this.resolveMarketplaceForList(n,r),"resolveMarketplace")}}resolveMarketplaceForList(e,r){let n=FT(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 o3(o,ult,void 0)}async readMarketplacePluginFromDir(e,r,n,o){if(!await Wd(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){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(gZn)}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 $he.isAbsolute(e.pluginUri)?nfr(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 XDe(this.ctx,r,{matches:ZJn},this._injectedWatcher,this.watchDebounceMs),this._watchSubscription=this._fileWatcher.onDidChange(()=>{this.refreshAndMaybeFire(gZn)});let n=this.discoveryRoots();for(let o of Lhe){let s=o.changeSignal;if(!s)continue;let c=new XDe(this.ctx,s.dir(n),{createDir:s.createDir,matches:afr(s.files)},this._injectedWatcher,this.watchDebounceMs);this._sourceSubscriptions.push(c.onDidChange(()=>{this.refreshAndMaybeFire(new Set([o.name]))})),this._sourceWatchers.push(c)}this.seedAndStart()}async seedAndStart(){await this.mutationSequencer.queue(this.editorId,async()=>{if(this._lastStateKey===void 0)try{this._lastStateKey=await this.stateKey(y$s)}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 l of Lhe){let u=l.changeSignal;if(!u||!e.has(l.name)&&this._lastSourceListings.has(l.name))continue;let d=await u.listing(s);d!==void 0&&this._lastSourceListings.set(l.name,d)}let c={};for(let l of Lhe)l.changeSignal&&(c[l.name]=[...this._lastSourceListings.get(l.name)??[]].sort());return JSON.stringify({installed:n.map(l=>[l.pluginUri,l.name]).sort((l,u)=>l[0].localeCompare(u[0])||l[1].localeCompare(u[1])),disabled:[...o].sort(),sources:c})}async installPlugin(e){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=FT(e);if(!n)throw new Uhe(e);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}async addMarketplaceReference(e){await this.mutate(async r=>{let n=await this.store.readMarketplaces(r);return n.marketplaces.some(s=>FT(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);return mJn(r)}async addMarketplace(e){let r=FT(e);if(!r)throw new Uhe(e,"marketplace source");await this.addMarketplaceReference(r)}async removeMarketplace(e){let r=FT(e);await this.mutate(async n=>{let o=await this.store.readMarketplaces(n),s=o.marketplaces.filter(c=>c===e?!1:r?FT(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=FT(e);if(!n)throw new Uhe(e,"marketplace source");r=[n]}else r=await this.listMarketplaces();return this.marketplace.fetchMarketplacePlugins(r)}dispose(){if(!this._disposed){this._disposed=!0,this._watchSubscription?.dispose(),this._fileWatcher?.dispose();for(let e of this._sourceSubscriptions)e.dispose();for(let e of this._sourceWatchers)e.dispose();this._git?.dispose(),this._onDidChangePlugins.dispose()}}};var Clt=de(require("path"));var jX=new fe("BackgroundAgent.PluginHooks"),Vhe="copilot-plugin",ufr={SessionStart:"sessionStart",SessionEnd:"sessionEnd",UserPromptSubmit:"userPromptSubmitted",PreToolUse:"preToolUse",PostToolUse:"postToolUse",ErrorOccurred:"errorOccurred"};function E$s(t,e){let r={};for(let o of t)for(let s of o.hooks){let c=ufr[s.type];if(c!==void 0)for(let l of s.hooks){let u=dfr(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(E$s,"groupPluginHooksBySource");async function yZn(t,e){if(!W5(t)||!fJ(t))return{};let r;try{r=(await t.get(uc).listPlugins()).filter(c=>c.enabled)}catch(c){return c instanceof bl?{}:(jX.warn(t,"failed to list plugins for hook injection",{err:String(c)}),{})}if(r.length===0)return{};let n=un(e.uri),o=E$s(r,n),s={};return o.preToolUse&&(s.preToolUse=[v$s(t,n,o.preToolUse)]),o.postToolUse&&(s.postToolUse=[C$s(t,n,o.postToolUse)]),o.userPromptSubmitted&&(s.userPromptSubmitted=[b$s(t,n,o.userPromptSubmitted)]),o.sessionStart&&(s.sessionStart=[S$s(t,n,o.sessionStart)]),o.sessionEnd&&(s.sessionEnd=[T$s(t,n,o.sessionEnd)]),o.errorOccurred&&(s.errorOccurred=[I$s(t,n,o.errorOccurred)]),s}a(yZn,"buildPluginHookHandlers");function EZn(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(EZn,"mergePluginHooks");function dfr(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=_$s(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(dfr,"toCommandHook");function _$s(t,e){if(t!==void 0)return Clt.isAbsolute(t)?t:Clt.join(e,t)}a(_$s,"resolveHookCwd");function Whe(t,e){return async r=>{if(fJ(t))return e(r)}}a(Whe,"gated");function v$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:FDe(n.toolArgs)};for(let s of r){let c=await new s2(s.source,s.hooks).fire(t,o);for(let l of c){let u=l.output;if(u&&u.permissionDecision===Xue.deny)return{permissionDecision:"deny",permissionDecisionReason:u.permissionDecisionReason||"Tool execution denied by plugin hook"}}}return}catch(o){jX.error(t,`Failed to execute plugin PreToolUse hook for tool ${n.toolName}`,o);return}})}}a(v$s,"pluginPreToolUseHandler");function C$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:FDe(n.toolArgs),toolResult:{resultType:Pdr(n.toolResult.resultType),textResultForLlm:n.toolResult.textResultForLlm}};for(let s of r)await new o2(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,`Failed to execute plugin PostToolUse hook for tool ${n.toolName}`,o)}})}}a(C$s,"pluginPostToolUseHandler");function b$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,prompt:n.prompt};for(let s of r)await new a2(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin UserPromptSubmitted hook",o)}})}}a(b$s,"pluginUserPromptSubmittedHandler");function S$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,source:n.source,...n.initialPrompt!==void 0&&{initialPrompt:n.initialPrompt}};for(let s of r)await new uJ(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin SessionStart hook",o)}})}}a(S$s,"pluginSessionStartHandler");function T$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,reason:n.reason};for(let s of r)await new lJ(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin SessionEnd hook",o)}})}}a(T$s,"pluginSessionEndHandler");function I$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,error:{message:n.error.message,name:n.error.name,...n.error.stack!==void 0&&{stack:n.error.stack}}};for(let s of r)await new uF(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin ErrorOccurred hook",o)}})}}a(I$s,"pluginErrorOccurredHandler");p();var _Zn=de(require("node:path"));function vZn(t){let e="";for(let r of t){let n=r.codePointAt(0)??0;n>=32&&n!==127&&(e+=r)}return e.trim()}a(vZn,"sanitizeForPrompt");function x$s(t){let e=t.startsWith("file:")?un(t):t;return vZn(_Zn.basename(e))}a(x$s,"confinedBasename");function w$s(t){let e=t.startsWith("file:")?un(t):t;return vZn(e)}a(w$s,"confinedAbsolutePath");function CZn(t){let e=x$s(t),r=w$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(yZn,"buildInlineSystemPrompt");p();function S$s(t){return Ft(t,Ye.EnableSandbox)===!0}a(S$s,"isSandboxEnabled");function Clt(t){if(!S$s(t))return;let e={enabled:!0},r=Ft(t,Ye.SandboxAddCurrentWorkingDirectory);typeof r=="boolean"&&(e.addCurrentWorkingDirectory=r);let n=Ft(t,Ye.SandboxUserPolicy);return typeof n=="object"&&n!==null&&!Array.isArray(n)&&(e.userPolicy=n),e}a(Clt,"getSandboxConfig");p();Mo();var T$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 ffr(t,e){return t.get(bf).getInstructions(t,e,T$s)}a(ffr,"getGitCommitInstructions");var HX=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(CZn,"buildInlineSystemPrompt");p();function R$s(t){return Ft(t,Ye.EnableSandbox)===!0}a(R$s,"isSandboxEnabled");function blt(t){if(!R$s(t))return;let e={enabled:!0},r=Ft(t,Ye.SandboxAddCurrentWorkingDirectory);typeof r=="boolean"&&(e.addCurrentWorkingDirectory=r);let n=Ft(t,Ye.SandboxUserPolicy);return typeof n=="object"&&n!==null&&!Array.isArray(n)&&(e.userPolicy=n),e}a(blt,"getSandboxConfig");p();Oo();var k$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 ffr(t,e){return t.get(bf).getInstructions(t,e,k$s)}a(ffr,"getGitCommitInstructions");var HX=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.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")}],g8=class{constructor(e,r){this.ctx=e;this.service=r;this.logger=new fe("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(Lo);return this.lastPluginsEnabled=W5(this.ctx),e.onDidChangeCopilotSettings(()=>{let r=W5(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(!W5(this.ctx))return this.teardownAll(),!0;let e;try{e=(await this.service.listPlugins()).filter(n=>n.enabled)}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=I$s(r),s=x$s(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 EZn)for(let l of c(r))o.push(n.register(s,[w$s(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=R$s(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(wA)}tryManager(){return this.tryGet(ey)}tryGet(e){try{return this.ctx.get(e)}catch(r){if(r instanceof bl)return;throw r}}dispose(){this.disposed||(this.disposed=!0,this.changeSubscription.dispose(),this.gateSubscription?.dispose(),this.teardownAll())}};function I$s(t){let e=EZn.flatMap(({pick:r})=>r(t).map(n=>JSON.stringify([n.uri,n.name,n.description??""]))).sort();return JSON.stringify(e)}a(I$s,"fileContentHash");function x$s(t){let e=t.mcpServerDefinitions.map(r=>JSON.stringify([r.name,r.configuration])).sort();return JSON.stringify(e)}a(x$s,"mcpContentHash");function w$s(t){return t.includes("://")?un(t):t}a(w$s,"toPathPattern");function R$s(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(R$s,"toMcpServersConfig");var _Zn=de(require("node:path"));var blt=new fe("BackgroundAgent.SessionOptionsBuilder"),k$s=5e3;async function vZn(t,e,r,n){let o=o3((async()=>{try{await t.get(g8).ensureInitialSync()}catch(A){if(!(A instanceof bl))throw A}})(),k$s,void 0),s=await n.buildAuthInfo(),c=to(r.workspaceFolder.uri).fsPath;await o;let l;try{l=t.get(h0).getSkillDirectories(c),l.length===0&&(l=void 0)}catch{}let u={clientName:t.get(Ir).getEditorPluginInfo().name,integrationId:S$e(t.get(Ir))??"jetbrains-chat",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};try{await t.get(w3)._handleWorkspaceAdded({uri:r.workspaceFolder.uri,name:r.workspaceFolder.name??""})}catch{}let d=await Kct(t,r.workspaceFolder);d.length>0&&(u.customAgents=d);let f=r.mcpDirectory??r.workspaceFolder.uri;try{let A=t.get(PT).buildMcpServers(f);blt.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 bl))throw A}u.hooks=oJn(t,r.workspaceFolder);let h=await hZn(t,r.workspaceFolder);if(u.hooks=mZn(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:yZn(r.inlineConfinedFile)}}else{let A=await ffr(t,[r.workspaceFolder]).catch(v=>{blt.warn(t,"Failed to load git commit instructions for systemMessage",v)}),y=r.useNestedAgentsMdFiles===!0?await D$s(t,c):void 0,E=r.useNestedClaudeMdFiles===!0?await P$s(t,c):void 0,_=uJn({gitCommitInstructions:A,globalAgentsMdInstructions:r.globalAgentsMdInstructions,nestedAgentsInstructions:y,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:E});_!==void 0&&(u.systemMessage={mode:"append",content:_})}r.externalToolDefinitions?.length&&(u.externalToolDefinitions=r.externalToolDefinitions);let m=sJn(r);m.size>0&&(u.disabledInstructionSources=m);let g=Clt(t);return g&&(u.sandboxConfig=g),u}a(vZn,"buildSessionOptions");async function P$s(t,e){let r;try{r=t.get(Qo)}catch{return}try{return await cJn(async n=>r.readDirectory(Ks(n)),async n=>CZn(r,e,n),e)}catch(n){blt.warn(t,"Failed to scan nested CLAUDE.md files",n);return}}a(P$s,"scanNestedClaudeSection");async function D$s(t,e){let r;try{r=t.get(Qo)}catch{return}try{return await lJn(async n=>r.readDirectory(Ks(n)),async n=>CZn(r,e,n),e)}catch(n){blt.warn(t,"Failed to scan nested AGENTS.md files",n);return}}a(D$s,"scanNestedAgentsSection");async function CZn(t,e,r){try{return await t.readFileString(Ks(_Zn.join(e,r)))}catch{return}}a(CZn,"readNestedFile");p();var N$s=20,Slt=new fe("BackgroundAgent.SessionRegistry"),Tlt=class{constructor(e){this.ctx=e;this.sessions=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>N$s){let n=this.sessions.keys().next().value;n!==void 0&&n!==e&&(Slt.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.remove(n).catch(o=>Slt.warn(this.ctx,`Failed to evict session ${n}`,{error:o instanceof Error?o.message:String(o)})))}}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)}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),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){Slt.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!==r){Slt.debug(this.ctx,`Skipping map clear for session ${e}: re-cached during removal`);return}this.sessions.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.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 pfr=require("node:fs"),GX=de(require("node:path"));function bZn(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(bZn,"sanitizePathSegment");function xlt(t){return typeof t=="string"?t:void 0}a(xlt,"asString");function Ilt(t){return typeof t=="number"?t:void 0}a(Ilt,"asNumber");function M$s(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:xlt(r.toolCallId),tool:xlt(r.name)}}):[]}a(M$s,"asToolCallArray");function O$s(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(O$s,"toToolResultText");function L$s(t){try{return JSON.stringify(t)}catch{return}}a(L$s,"safeStringify");var hfr=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=cQt(new Date),s=bZn(r);this.sessionDir=GX.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?GX.join(this.sessionDir,"runSubAgent",bZn(e)):this.sessionDir}appendJsonl(e,r){let n=L$s(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await pfr.promises.mkdir(GX.dirname(e),{recursive:!0}),await pfr.promises.appendFile(e,`${n} -`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:Ilt(e.data.inputTokens),outputTokens:Ilt(e.data.outputTokens),cacheReadTokens:Ilt(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=M$s(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(GX.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:Ilt(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=xlt(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=xlt(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(GX.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:O$s(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function SZn(t,e,r){let n=Ft(t,Ye.PromptPersistBasePath)?.trim()||void 0;if(n)return new hfr(n,e,r)}a(SZn,"createBackgroundAgentPersistence");p();var wlt=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 Jo={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"};var xZn=require("crypto");var mfr=new fe("BackgroundAgent.CliOTelTracker"),B$s={USER_REQUEST:"copilot_chat.user_request"},gfr="main";function zhe(t){return(0,xZn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(zhe,"generateHexId");function wZn(){return BigInt(Date.now())*1000000n}a(wZn,"nowNano");function Yhe(t){if(t){let e=Date.parse(t);if(!Number.isNaN(e))return BigInt(e)*1000000n}return wZn()}a(Yhe,"isoToNano");function TZn(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(TZn,"toAttributeString");function IZn(t){return JSON.stringify([{role:"assistant",parts:[{type:"text",content:t}]}])}a(IZn,"outputMessagesJson");function RZn(t,e,r){if(!t.get(bn).getCapabilities().agentDebugLog)return;let n=t.get(pv);if(n.isEnabled())return new Afr(t,e,r,n)}a(RZn,"createCliOTelTracker");var Afr=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(Yhe(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=>{mfr.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:zhe(16),invokeAgentSpanId:zhe(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(Yhe(e.timestamp)),n={data:e.data,endNano:Yhe(e.timestamp),agentKey:e.data.parentToolCallId??gfr,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??gfr;r.responseByAgent.set(o,(r.responseByAgent.get(o)??"")+n)}_onToolStart(e){let r=e.data.toolCallId;if(!r)return;let n=this._ensureRequest(Yhe(e.timestamp)),o=e.data.parentToolCallId,s=(o?n.toolSpanIds.get(o):void 0)??n.invokeAgentSpanId,c=zhe(8);this._pendingTools.set(r,{traceId:n.traceId,spanId:c,parentSpanId:s,toolName:e.data.toolName??"unknown",arguments:e.data.arguments,startNano:Yhe(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=Yhe(e.timestamp),s=e.data.success===!1,c=e.data.error?.message,l={[Jo.OPERATION_NAME]:"execute_tool",[Jo.CONVERSATION_ID]:this._sessionId,[Jo.TOOL_NAME]:n.toolName,[Jo.TOOL_CALL_ID]:r},u=TZn(n.arguments);u!==void 0&&(l[Jo.TOOL_CALL_ARGUMENTS]=u);let d=e.data.result??e.data.error,f=TZn(d);f!==void 0&&(l[Jo.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:k2(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=wZn(),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:k2({[Jo.OPERATION_NAME]:"invoke_agent",[Jo.AGENT_NAME]:"copilotcli",[Jo.CONVERSATION_ID]:this._sessionId}),events:[],status:{code:1}}}_buildUserMessageSpan(e){if(!e.userRequest)return;let r=e.startNano.toString();return{traceId:e.traceId,spanId:zhe(8),parentSpanId:e.invokeAgentSpanId,name:"user_message",kind:1,startTimeUnixNano:r,endTimeUnixNano:r,attributes:k2({[Jo.OPERATION_NAME]:"user_message",[Jo.CONVERSATION_ID]:this._sessionId,[B$s.USER_REQUEST]:e.userRequest}),events:[{name:"user_message",timeUnixNano:r,attributes:k2({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===gfr?e.invokeAgentSpanId:e.toolSpanIds.get(o)??e.invokeAgentSpanId,l=(r.get(o)??e.startNano).toString();n.push({traceId:e.traceId,spanId:zhe(8),parentSpanId:c,name:"agent_response",kind:1,startTimeUnixNano:l,endTimeUnixNano:l,attributes:k2({[Jo.OPERATION_NAME]:"agent_response",[Jo.CONVERSATION_ID]:this._sessionId,[Jo.OUTPUT_MESSAGES]:IZn(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={[Jo.OPERATION_NAME]:"chat",[Jo.CONVERSATION_ID]:this._sessionId,[Jo.RESPONSE_MODEL]:o},l=r.data.inputTokens,u=r.data.outputTokens,d=r.data.cacheReadTokens,f=r.data.cacheWriteTokens;typeof l=="number"&&(c[Jo.USAGE_INPUT_TOKENS]=l),typeof u=="number"&&(c[Jo.USAGE_OUTPUT_TOKENS]=u),typeof d=="number"&&(c[Jo.USAGE_CACHE_READ_INPUT_TOKENS]=d),typeof f=="number"&&(c[Jo.USAGE_CACHE_CREATION_INPUT_TOKENS]=f),r.systemInstructions&&(c[Jo.SYSTEM_INSTRUCTIONS]=r.systemInstructions),r.inputMessagesJson&&(c[Jo.INPUT_MESSAGES]=r.inputMessagesJson);let h=n?e.responseByAgent.get(r.agentKey):void 0;h&&(c[Jo.OUTPUT_MESSAGES]=IZn(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:zhe(8),parentSpanId:s,name:`chat ${o}`,kind:1,startTimeUnixNano:A.toString(),endTimeUnixNano:m.toString(),attributes:k2(c),events:[],status:{code:1}}}async _readAssembled(){try{let e=await this._session.getChatContextMessages();return{inputMessagesJson:e.length>0?JSON.stringify(e):void 0,systemInstructions:this._session.getCurrentSystemMessage()}}catch(e){return mfr.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){mfr.warn(this._ctx,`Failed to persist debug spans for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`)}};Mo();var A8=new fe("BackgroundAgent.TurnDriver"),yfr="backgroundAgent",Rlt=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=SZn(this.ctx,e,`bg-turn-${Mt()}`),d=RZn(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=a(()=>{},"noop"),h=r.on("user_input.requested",f),m=r.on("permission.requested",f),g=r.on("exit_plan_mode.requested",f);$Gn(r,!0);let A=new wlt,y=r.on("*",w=>{if(w.type==="assistant.turn_start"&&this.registry.getTurnLimiter(e)?.onTurnStart(),u)try{u.persistEvent(w)}catch(R){A8.warn(this.ctx,"Failed to persist background-agent event",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}if(A.trackEvent(w),d)try{d.onEvent(w)}catch(R){A8.warn(this.ctx,"Failed to synthesize debug span",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}this.handleSessionEvent(e,w,o)}),E=!1,_=a(()=>{E||(E=!0,this.emitTurnCompleteTelemetry(e,r,l,A.data,o),this.emitSessionMetricsTelemetry(e,r,o,c)),T?.dispose(),h(),m(),g(),y(),v(),b(),this.forget(e)},"cleanup"),v=r.on("session.idle",()=>{_()}),b=r.on("session.error",()=>{_()}),T;s&&(T=s.onCancellationRequested(()=>{A8.info(this.ctx,"Cancellation requested, aborting session:",e),r.clearPendingItems(),r.abort()})),r.send(n).catch(w=>{_();let R=Mrt(w);s?.isCancellationRequested?A8.info(this.ctx,"session.send aborted by cancellation",{sessionId:e,turnIndex:o}):(A8.error(this.ctx,"session.send failed",{sessionId:e,turnIndex:o,error:R,stack:w instanceof Error?w.stack:void 0}),this.emitTurnFailedTelemetry(e,o,"SendMessageError"));let x={type:"session.error",id:Mt(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:R}};this.sendSessionUpdateNotification(e,x,o)})}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)){A8.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){A8.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;At(this.ctx,"backgroundAgent.turn.complete",{requestSource:yfr,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){A8.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}emitTurnFailedTelemetry(e,r,n){At(this.ctx,"backgroundAgent.turn.failed",{requestSource:yfr,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))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);At(this.ctx,"backgroundAgent.session.metrics",{requestSource:yfr,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){A8.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}};p();function kZn(t,e,r){e.agentMode&&(t.currentMode=e.agentMode,r.agentMode=e.agentMode)}a(kZn,"applyAgentModeOverride");p();async function PZn(t,e,r,n,o){let s=n.chatMode??"agent",c=fat(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;let u=o.getWorkingDir(e);if(!u)throw new Error(`Cannot apply chatMode for session ${e}: working directory is not cached`);let d={uri:Ks(u)};o.deleteChatMode(e),await MGn(r,c,{loadCustomAgents:a(()=>Kct(t,d),"loadCustomAgents"),getAllLoadedSkillNames:a(async()=>(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(f=>f.name)),"getAllLoadedSkillNames"),getPolicyDisabledSkillNames:a(async()=>{let f;try{f=t.get(h0)}catch{return[]}return f.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(h=>h.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{let f=o.getMcpDirectory(e)??o.getWorkspaceFolderUri(e);try{return Promise.resolve(t.get(PT).buildMcpServers(f))}catch(h){if(h instanceof bl)return Promise.resolve({});throw h}},"getMcpServers")}),o.setChatMode(e,c)}a(PZn,"applyChatModeOverride");p();var DZn=new fe("BackgroundAgent.applyChatModeSelection");async function NZn(t,e,r){if(r.chatMode===void 0||fat(r.chatMode))return;let n=r.chatMode==="agent";try{n?(await e.agent.deselect(),DZn.info(t,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:r.chatMode}),DZn.info(t,`Applied custom agent '${r.chatMode}' for session ${r.sessionId}`))}catch(o){let s=o instanceof Error?o.message:String(o);throw n?new Error(`Failed to clear custom agent selection on session ${r.sessionId}: ${s}`):new Error(`Failed to select custom agent '${r.chatMode}' on session ${r.sessionId}: ${s}. Verify the agent is registered via a workspace .agent.md file.`)}}a(NZn,"applyChatModeSelection");p();var MZn=require("node:util");function OZn(t,e,r,n){let o=Clt(t)??{enabled:!1},s=n.getAppliedSandboxConfig(e);s!==void 0&&(0,MZn.isDeepStrictEqual)(s,o)||(r.updateOptions({sandboxConfig:o}),n.setAppliedSandboxConfig(e,o))}a(OZn,"applySandboxOverride");p();p();var $X=new fe("BackgroundAgent.ProviderConfig");async function LZn(t,e,r){if(!e)return;let n=await Wze(t,e,r);if(!n){$X.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let d=await new da(t.get(Yn)).getStoredModelConfigs(e),f=r?d[r]:void 0;o=f?.deploymentUrl,s=f?.modelCapabilities?.maxInputTokens,c=f?.modelCapabilities?.maxOutputTokens}catch(u){$X.warn(t,"Failed to load BYOK model config; using defaults",{providerName:e,modelId:r,error:u instanceof Error?u.message:String(u)})}let l={...s!==void 0&&{maxPromptTokens:s},...c!==void 0&&{maxOutputTokens:c}};if(e===io.Anthropic)return{type:"anthropic",baseUrl:o??zle[e],apiKey:n,modelId:r,wireModel:r,...l};if(e===io.Azure){if(!o){$X.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return U$s(t,o,n,r,l)}if(jle(e))return{type:"openai",baseUrl:o??zle[e],apiKey:n,modelId:r,wireModel:r,...l};if(vK(e))return F$s(t,e,n,r,o,l);$X.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}a(LZn,"buildProviderConfig");async function F$s(t,e,r,n,o,s){if(!o){$X.warn(t,`Custom endpoint '${e}' has no configured URL; skipping provider config.`);return}let u=(await new da(t.get(Yn)).getProviderConfig(e))?.apiType,d=u==="chatCompletions"||u==="responses"||u==="messages"?u:XIe,f=Vze(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(F$s,"buildCustomEndpointProviderConfig");function U$s(t,e,r,n,o){let s;try{s=new URL(e)}catch{$X.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};$X.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(U$s,"buildAzureProviderConfig");var Efr=new fe("BackgroundAgent.applyTurnOverrides");async function BZn(t,e,r,n){let o=r.providerName?r.providerName:void 0;if(o!==void 0&&!XQ(await t.get(Qt).getToken()))throw new YRe(`BYOK is disabled for this account. Provider '${o}' cannot be used for model '${r.model??""}'.`,o,r.model);let s=await LZn(t,o,r.model);if(o!==void 0&&s===void 0)throw new zRe(`BYOK provider '${o}' is misconfigured for model '${r.model??""}'. Verify the API key`+(o===io.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){Efr.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)));Efr.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{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}),Efr.info(t,`Rebound session ${r.sessionId} for this turn: provider=${o??"(built-in)"}, model=${l??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),h}a(BZn,"applyTurnOverrides");p();async function FZn(t,e,r,n,o){let s=q$s(e,n),c=o==="inline"||o==="inline-ask";await t.get(Cg).applyPromptTemplateToRequest(r,s?[s]:[],c,{includePlugins:!0})||Q$s(t,r)}a(FZn,"expandPromptTemplate");function Q$s(t,e){let r=e.message.trim();if(!r.startsWith("/"))return!1;let[n,...o]=r.split(" "),s=n.slice(1);if(!Fxn.has(s))return!1;let c=n2().find(l=>l.id===s);return c?.instructions?(e.message=c.instructions(t,o.join(" ")),!0):!1}a(Q$s,"applyBuiltinCreateTemplate");function q$s(t,e){let r=e.getWorkingDir(t);return r?{uri:Ks(r)}:void 0}a(q$s,"getWorkspaceFolderForSession");Mo();var ty=new fe("BackgroundAgent"),RH="backgroundAgent",j$s="backgroundAgent.remote",H$s=new Set(["system.message","hook.start","hook.end"]),Hs=class{constructor(e){this.ctx=e;this.pendingExternalToolDefs=new Map;this.notificationSender=e.get(ts),this.managerLifecycle=new kat(e),this.authBinding=new Nrt(e),this.registry=new Tlt(e),this.mcpSync=new Gct(e,this.registry),this.remoteController=new Yct(e,{registry:this.registry,injectUserMessage:a((n,o,s)=>this.injectRemoteUserMessage(n,o,s),"injectUserMessage")}),this.turnDriver=new Rlt(e,this.registry,this.notificationSender),e.get(Lo).onDidChangeHttpSettings(()=>{uat(this.ctx)}),bs(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(h0).onDidChangeSkillsEnabled(()=>{this.registry.clearChatMode()})}catch(n){if(!(n instanceof bl))throw n}}static{a(this,"BackgroundAgentService")}async handleAuthStateChange(){let{changed:e,hadPrevious:r,hasCurrent:n}=await this.authBinding.detectIdentityChange();e&&(ty.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(),this.managerLifecycle.clearAutoMode()}ensureManager(){return this.managerLifecycle.ensureManager()}get sdk(){return this.managerLifecycle.getSdk()}get autoModeManager(){return this.managerLifecycle.getAutoModeManager()}installBridgeSpanProcessor(){this.managerLifecycle.ensureBridgeInstalled()}async handleInteraction(e){let r=performance.now(),n=await this.getOrResumeSession(e.sessionId),o=s2n(n,e);return At(this.ctx,"backgroundAgent.interaction",{requestSource:RH,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 BZn(this.ctx,e,r,{registry:this.registry,managerLifecycle:this.managerLifecycle,getOrResumeSession:a(n=>this.getOrResumeSession(n),"getOrResumeSession")})}applyChatModeSelection(e,r){return NZn(this.ctx,e,r)}buildSessionOptions(e,r){return vZn(this.ctx,e,r,{buildAuthInfo:a(()=>this.buildAuthInfo(),"buildAuthInfo")})}async createSession(e){let r=performance.now();ty.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??Mt(),s=e.inlineConfinedFile?FGn(2):void 0,c=e.inlineConfinedFile?UGn(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),ty.info(this.ctx,"Session created:",o),this.installBridgeSpanProcessor(),At(this.ctx,"backgroundAgent.create",{requestSource:RH,reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.registry.set(o,u),this.registry.setWorkingDir(o,to(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),ty.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 h=this.pendingExternalToolDefs.get(e);return h&&(this.pendingExternalToolDefs.delete(e),n.updateOptions({externalToolDefinitions:h}),ty.info(this.ctx,"Applied pending external tool definitions to cached session",{sessionId:e,toolCount:h.length})),n}let o=await this.ensureManager(),s=r.workspaceFolder;if(!s){let h=await o.getSessionMetadata({sessionId:e});if(!h)throw new Error(`Session not found: ${e}`);let m=h.context?.cwd;if(!m)throw new Error(`Cannot resume session ${e} from disk: persisted metadata is missing working-directory context`);s={uri:Ks(m)},ty.info(this.ctx,"Resuming session from disk via metadata fallback",{sessionId:e})}let c=this.pendingExternalToolDefs.get(e);c&&this.pendingExternalToolDefs.delete(e);let l=await this.buildSessionOptions(e,{...r,externalToolDefinitions:r.externalToolDefinitions??c,workspaceFolder:s}),u=await o.getSession(l,!0);if(!u)throw new Error(`Session not found: ${e}`);this.registry.set(e,u);let d=Array.from(u.getEvents()).filter(h=>h.type==="user.message").length;d>0&&this.registry.seedTurnIndexIfAbsent(e,d-1),this.registry.deleteChatMode(e),this.registry.deleteAppliedSandboxConfig(e),this.installBridgeSpanProcessor();let f=s?.uri?to(s.uri).fsPath:void 0;return f&&this.registry.setWorkingDir(e,f),s?.uri&&this.registry.setWorkspaceFolderUri(e,s.uri),r.mcpDirectory&&this.registry.setMcpDirectory(e,r.mcpDirectory),u}async sendMessage(e,r){let n=await this.getOrResumeSession(e.sessionId),o=await this.applyTurnOverrides(n,e);await this.applyChatModeOverride(e.sessionId,o,e),this.applySandboxOverride(e.sessionId,o);let s=e.message;await this.expandPromptTemplate(e.sessionId,e,e.chatMode),await this.applyChatModeSelection(o,e);let c={prompt:e.message,...e.message!==s?{displayPrompt:s}:{},...e.sendMode?{mode:e.sendMode}:{}};this.applyAgentModeOverride(o,e,c);let l=e.chatMode==="inline-ask"||e.chatMode==="inline";if(e.references?.length&&!l){let m=o2n(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 qGn(m,g,this.ctx);if(A.promptFragment&&(c.prompt=`${c.prompt}${A.promptFragment}`),A.isLargeFile){let y=e.chatMode==="inline-ask"?dat:Jar;o.updateOptions({availableTools:[...y,"view"]},{emitToolDefinitionsChanged:!0})}}}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:RH,chatMode:this.registry.getChatMode(e.sessionId)??"agent",sessionId:e.sessionId,safeModelId:G$s(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 At(this.ctx,"backgroundAgent.send",f,h),Et(this.ctx,"backgroundAgent.send",Wt.createAndMarkAsIssued(f,h)),{}}async truncateHistory(e){let r=performance.now(),o=await(await this.getOrResumeSession(e.sessionId)).history.truncate({eventId:e.eventId});return At(this.ctx,"backgroundAgent.truncateHistory",{requestSource:RH,providerName:e.providerName,sessionId:e.sessionId,eventId:e.eventId},{totalTimeMs:performance.now()-r,eventsRemoved:o.eventsRemoved}),{eventId:e.eventId,eventsRemoved:o.eventsRemoved}}applyChatModeOverride(e,r,n){return PZn(this.ctx,e,r,n,this.registry)}applySandboxOverride(e,r){OZn(this.ctx,e,r,this.registry)}applyAgentModeOverride(e,r,n){kZn(e,r,n)}async injectRemoteUserMessage(e,r,n){let o=await this.getOrResumeSession(e),s={message:r};await this.expandPromptTemplate(e,s);let c={prompt:s.message,...s.message!==r?{displayPrompt:r}:{},source:n},l=performance.now(),u=this.registry.incrementTurnIndex(e);this.turnDriver.wireAndSend(e,o,c,u),At(this.ctx,"backgroundAgent.send",{requestSource:j$s,sessionId:e,safeModelId:"",providerName:"",reasoningEffort:"",contextTier:"",hasReferences:"false",turnIndex:String(u)},{totalTimeMs:performance.now()-l,messageCharLen:s.message.length,referenceCount:0})}expandPromptTemplate(e,r,n){return FZn(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 ty.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);ty.info(this.ctx,"Stopping session via abort:",e),n.abortManualCompaction()&&ty.info(this.ctx,"Aborted in-progress manual compaction:",e),n.clearPendingItems(),await n.abort(),At(this.ctx,"backgroundAgent.stop",{requestSource:RH,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);ty.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return At(this.ctx,"backgroundAgent.compactHistory",{requestSource:RH,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);ty.info(this.ctx,"Aborting manual compaction for session:",e);let o=n.abortManualCompaction();return At(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:RH,sessionId:e,aborted:String(o)},{totalTimeMs:performance.now()-r}),{aborted:o}}async getPlanPath(e){return(await this.getOrResumeSession(e)).getPlanPath()}async resumeSession(e){let r=performance.now();ty.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());At(this.ctx,"backgroundAgent.resume",{requestSource:RH,reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!H$s.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!==e.cwd||e.gitRoot&&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){ty.info(this.ctx,"listModels called",{forceRefresh:e}),await this.managerLifecycle.ensureManager();let r=performance.now();try{let n=await this.ctx.get(xs).getMetadata(e),o=this.sdk?.EXCLUDED_MODELS,s=n.filter(u=>u.model_picker_enabled===!0).filter(u=>u.capabilities.type==="chat").filter(u=>!o?.has(u.id)).map(Drt);s.length===0?ty.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):ty.info(this.ctx,`Successfully retrieved ${s.length} models`);let c=[];this.ctx.get(jl).getPolicyValue("autoModel.enabled")!==!1&&c.push(this.buildAutoModelEntry());let l=[...c,...s];return ty.debug(this.ctx,"Models retrieved:",l.map(u=>u.id)),At(this.ctx,"backgroundAgent.listModels",{status_text:"success"},{duration_ms:performance.now()-r,model_count:l.length}),{models:l}}catch(n){let o=n instanceof Error?n.message:String(n),s=kZt(n);throw ty.error(this.ctx,"listModels failed",{error:o,cause:s,stack:n instanceof Error?n.stack:void 0}),Vn(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(),Kar(),c2n(),await this.managerLifecycle.dispose()}};function G$s(t,e){return e?"byok models":t??""}a(G$s,"safeModelId");p();p();var Ap=(o=>(o.Background="BACKGROUND",o.Claude="CLAUDE",o.Codex="CODEX",o.Cloud="CLOUD",o))(Ap||{});p();async function kb(t,e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return UZn(t,e,n,o),s}catch(s){throw o.error??=s,UZn(t,e,n,o),s}}a(kb,"runWithTelemetry");function UZn(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?Vn(t,`${e}.failure`,n.error,s,c):At(t,e,s,c)}a(UZn,"flushTelemetry");p();var QZn=de(require("path"));p();var _fr=["default","acceptEdits","bypassPermissions","plan","auto"];function VX(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(VX,"assertClaudeProvider");function Khe(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(Khe,"assertNonEmptyString");function $$s(t,e,r){if(r===void 0)throw new Error(`${t}: ${e} is required`);try{to(r)}catch(n){throw new Error(`${t}: ${e} is not a valid URI: ${r}`,{cause:n})}}a($$s,"assertFsUri");function V$s(t,e,r){if(!QZn.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(V$s,"assertAbsolutePath");function W$s(t,e){if(e!==void 0&&!_fr.includes(e))throw new Error(`${t}: agentMode must be one of ${_fr.join(", ")}, got '${e}'`)}a(W$s,"assertAllowedAgentMode");async function rNe(t,e){if(e===void 0)return;let n=(await t.get(xs).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!w$e(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(rNe,"validateClaudeModel");async function qZn(t,e){VX("createSession",e.agentProvider),$$s("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await rNe(t,e.model)}a(qZn,"validateAgentCreate");async function jZn(t,e){VX("resumeSession",e.agentProvider),Khe("resumeSession","sessionId",e.sessionId),await rNe(t,e.model)}a(jZn,"validateAgentResume");async function HZn(t,e){VX("sendMessage",e.agentProvider),Khe("sendMessage","sessionId",e.sessionId),Khe("sendMessage","message",e.message),W$s("sendMessage",e.agentMode),await rNe(t,e.model)}a(HZn,"validateAgentSend");function GZn(t,e){VX("stopSession",e.agentProvider),Khe("stopSession","sessionId",e.sessionId)}a(GZn,"validateAgentStop");function $Zn(t,e){VX("destroySession",e.agentProvider),Khe("destroySession","sessionId",e.sessionId)}a($Zn,"validateAgentDestroy");function VZn(t,e){VX("listSessions",e.agentProvider),Khe("listSessions","cwd",e.cwd),V$s("listSessions","cwd",e.cwd)}a(VZn,"validateAgentListSessions");function WZn(t,e){VX("listModels",e.agentProvider)}a(WZn,"validateAgentListModels");p();p();p();var JZn=require("child_process"),Jhe=de(require("path")),ZZn=de(AP()),XZn=require("util");var zZn=5e3,YZn=200,Zhe=class{constructor(e){this.execFile=(0,XZn.promisify)(JZn.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=Jhe.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(Jhe.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:zZn,windowsHide:!0})).stdout}catch(c){return{severity:"error",message:this.formatSpawnError(e,c)}}let o=ZZn.coerce(n);if(!o)return{severity:"error",message:`Could not parse ${this.config.displayName} version from "${e}" --version output: "${KZn(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=Jhe.basename(e).toLowerCase();if(!r.includes(n))return`${this.config.displayName} path "${e}" must point at the "${r[0]}" executable, but the basename is "${Jhe.basename(e)}".`}formatSpawnError(e,r){let n=r;if(n?.code==="ENOENT")return`${this.config.displayName} not found at "${e}". Check that the file exists and is executable.`;if(n?.killed&&n?.signal==="SIGTERM")return`${this.config.displayName} at "${e}" did not respond to --version within ${zZn/1e3}s.`;let o=typeof n?.stderr=="string"?KZn(n.stderr):"",s=n?.code!==void 0?` (exit code ${String(n.code)})`:"",c=o?` stderr: "${o}"`:"",l=n?.message?`: ${n.message}`:"";return`Failed to run "${e} --version"${s}${l}${c}`}};function KZn(t){let e=t.trim();return e.length<=YZn?e:`${e.slice(0,YZn)}\u2026`}a(KZn,"truncate");var klt=de(AP());function z$s(){let t=oIe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(z$s,"getExpectedVersionRaw");var vfr=class extends Zhe{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,r){let n=z$s(),o=klt.coerce(n);if(!o)return{severity:"error",message:`Could not parse expected Claude Code CLI version "${n}" from packaged metadata. This is an internal error; please report it.`};if(!klt.satisfies(e,`~${o.major}.${o.minor}.0`))return{severity:"warning",message:`Claude Code CLI at "${r}" reports version ${e.version}, but this language server was built against ${o.version}. The session will still start, but SDK behavior may be unstable on protocol drift. Run \`npm install -g @anthropic-ai/claude-code@${o.version}\` to align versions.`}}})}},Xhe=new vfr;p();var eme=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 eXn(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(eXn,"buildPermissionRequest");function tXn(t,e){return t.kind==="approve-once"?{behavior:"allow",updatedInput:e}:{behavior:"deny",message:Y$s(t)}}a(tXn,"translatePermissionResult");function Y$s(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(Y$s,"formatDenyMessage");function rXn(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(rXn,"buildPreparedQuestions");function nXn(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(nXn,"buildUserInputRequest");p();var iXn=require("crypto");var K$s=new fe("ClaudeOTelTracker");function Cfr(t){return(0,iXn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(Cfr,"generateHexId");function Plt(){return BigInt(Date.now())*1000000n}a(Plt,"nowNano");var Dlt=class{constructor(e,r,n){this._ctx=e;this._sessionId=r;this._persistence=n;this._toolSpans=new Map;this._inputTokens=0;this._outputTokens=0;this._cacheReadTokens=0;this._cacheCreationTokens=0}static{a(this,"ClaudeOTelTracker")}startRequest(e){this._rootSpan&&this._endRootSpan(2,"New request started before previous ended");let r=Cfr(16),n=Cfr(8);this._rootSpan={traceId:r,spanId:n,name:"invoke_agent claude",startNano:Plt(),attributes:{[Jo.OPERATION_NAME]:"invoke_agent",[Jo.AGENT_NAME]:"claude",[Jo.SYSTEM]:"anthropic",[Jo.CONVERSATION_ID]:this._sessionId,...e?{[Jo.REQUEST_MODEL]:e}:{}}},this._inputTokens=0,this._outputTokens=0,this._cacheReadTokens=0,this._cacheCreationTokens=0,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)}_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)}}}_onResultMessage(e){if(!this._rootSpan)return;let r=e.usage;if(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),e.modelUsage){let n=Object.keys(e.modelUsage);n.length>0&&(this._rootSpan.attributes[Jo.RESPONSE_MODEL]=n[0])}typeof e.num_turns=="number"&&(this._rootSpan.attributes[Jo.TURN_COUNT]=e.num_turns),typeof e.total_cost_usd=="number"&&(this._rootSpan.attributes[Jo.TOTAL_COST_USD]=e.total_cost_usd)}_startToolSpan(e,r){!this._rootSpan||this._toolSpans.has(e)||this._toolSpans.set(e,{traceId:this._rootSpan.traceId,spanId:Cfr(8),parentSpanId:this._rootSpan.spanId,name:`execute_tool ${r}`,startNano:Plt(),attributes:{[Jo.OPERATION_NAME]:"execute_tool",[Jo.TOOL_NAME]:r,[Jo.TOOL_CALL_ID]:e,[Jo.CONVERSATION_ID]:this._sessionId}})}_endToolSpan(e,r){let n=this._toolSpans.get(e);if(!n)return;this._toolSpans.delete(e);let o=Plt(),s=this._buildOtlpSpan(n,o,r?2:1,r?"Tool execution error":void 0);this._flush([s])}_endRootSpan(e,r){let n=this._rootSpan;if(!n)return;this._rootSpan=void 0,this._inputTokens>0&&(n.attributes[Jo.USAGE_INPUT_TOKENS]=this._inputTokens),this._outputTokens>0&&(n.attributes[Jo.USAGE_OUTPUT_TOKENS]=this._outputTokens),this._cacheReadTokens>0&&(n.attributes[Jo.USAGE_CACHE_READ_INPUT_TOKENS]=this._cacheReadTokens),this._cacheCreationTokens>0&&(n.attributes[Jo.USAGE_CACHE_CREATION_INPUT_TOKENS]=this._cacheCreationTokens);let o=Plt(),s=[];for(let[,l]of this._toolSpans)s.push(this._buildOtlpSpan(l,o,2,"Tool span orphaned at turn end"));this._toolSpans.clear();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:k2(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=>{K$s.warn(this._ctx,`Failed to persist OTel spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)})}};p();var bfr=require("fs"),sXn=de(require("path"));var nNe=new fe("ClaudeCode.ReferenceFormatter"),J$s={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},oXn=5*1024*1024;async function aXn(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=rs(s.uri);if(!c){nNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=X$s(c);if(l){let u=await Z$s(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=rs(s.uri);if(!c){nNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:nNe.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:eVs(n)}),o}a(aXn,"buildReferences");async function Z$s(t,e,r){try{let n=await bfr.promises.stat(t);if(n.size>oXn){nNe.debug(r,`Skipping oversize image reference (${n.size} > ${oXn} bytes): ${t}`);return}let o=(await bfr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){nNe.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(Z$s,"tryReadImageBlock");function X$s(t){return J$s[sXn.extname(t).toLowerCase()]}a(X$s,"imageMediaTypeForPath");function eVs(t){return` +`)}updateAttemptCount(e){if(e.length!==this.lastChanges.length){this.attemptCount=0;return}for(let r=0;rt.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")}],A8=class{constructor(e,r){this.ctx=e;this.service=r;this.logger=new fe("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(Bo);return this.lastPluginsEnabled=W5(this.ctx),e.onDidChangeCopilotSettings(()=>{let r=W5(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(!W5(this.ctx))return this.teardownAll(),!0;let e;try{e=(await this.service.listPlugins()).filter(n=>n.enabled)}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=P$s(r),s=D$s(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 bZn)for(let l of c(r))o.push(n.register(s,[N$s(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=M$s(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(wA)}tryManager(){return this.tryGet(ey)}tryGet(e){try{return this.ctx.get(e)}catch(r){if(r instanceof bl)return;throw r}}dispose(){this.disposed||(this.disposed=!0,this.changeSubscription.dispose(),this.gateSubscription?.dispose(),this.teardownAll())}};function P$s(t){let e=bZn.flatMap(({pick:r})=>r(t).map(n=>JSON.stringify([n.uri,n.name,n.description??""]))).sort();return JSON.stringify(e)}a(P$s,"fileContentHash");function D$s(t){let e=t.mcpServerDefinitions.map(r=>JSON.stringify([r.name,r.configuration])).sort();return JSON.stringify(e)}a(D$s,"mcpContentHash");function N$s(t){return t.includes("://")?un(t):t}a(N$s,"toPathPattern");function M$s(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(M$s,"toMcpServersConfig");var SZn=de(require("node:path"));var Slt=new fe("BackgroundAgent.SessionOptionsBuilder"),O$s=5e3;async function TZn(t,e,r,n){let o=o3((async()=>{try{await t.get(A8).ensureInitialSync()}catch(A){if(!(A instanceof bl))throw A}})(),O$s,void 0),s=await n.buildAuthInfo(),c=to(r.workspaceFolder.uri).fsPath;await o;let l;try{l=t.get(h0).getSkillDirectories(c),l.length===0&&(l=void 0)}catch{}let u={clientName:t.get(Ir).getEditorPluginInfo().name,integrationId:I$e(t.get(Ir))??"jetbrains-chat",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};try{await t.get(R3)._handleWorkspaceAdded({uri:r.workspaceFolder.uri,name:r.workspaceFolder.name??""})}catch{}let d=await Xct(t,r.workspaceFolder);d.length>0&&(u.customAgents=d);let f=r.mcpDirectory??r.workspaceFolder.uri;try{let A=t.get(NT).buildMcpServers(f);Slt.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 bl))throw A}u.hooks=sJn(t,r.workspaceFolder);let h=await yZn(t,r.workspaceFolder);if(u.hooks=EZn(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:CZn(r.inlineConfinedFile)}}else{let A=await ffr(t,[r.workspaceFolder]).catch(v=>{Slt.warn(t,"Failed to load git commit instructions for systemMessage",v)}),y=r.useNestedAgentsMdFiles===!0?await B$s(t,c):void 0,E=r.useNestedClaudeMdFiles===!0?await L$s(t,c):void 0,_=dJn({gitCommitInstructions:A,globalAgentsMdInstructions:r.globalAgentsMdInstructions,nestedAgentsInstructions:y,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:E});_!==void 0&&(u.systemMessage={mode:"append",content:_})}r.externalToolDefinitions?.length&&(u.externalToolDefinitions=r.externalToolDefinitions);let m=aJn(r);m.size>0&&(u.disabledInstructionSources=m);let g=blt(t);return g&&(u.sandboxConfig=g),u}a(TZn,"buildSessionOptions");async function L$s(t,e){let r;try{r=t.get(qo)}catch{return}try{return await lJn(async n=>r.readDirectory(Ks(n)),async n=>IZn(r,e,n),e)}catch(n){Slt.warn(t,"Failed to scan nested CLAUDE.md files",n);return}}a(L$s,"scanNestedClaudeSection");async function B$s(t,e){let r;try{r=t.get(qo)}catch{return}try{return await uJn(async n=>r.readDirectory(Ks(n)),async n=>IZn(r,e,n),e)}catch(n){Slt.warn(t,"Failed to scan nested AGENTS.md files",n);return}}a(B$s,"scanNestedAgentsSection");async function IZn(t,e,r){try{return await t.readFileString(Ks(SZn.join(e,r)))}catch{return}}a(IZn,"readNestedFile");p();var F$s=20,Tlt=new fe("BackgroundAgent.SessionRegistry"),Ilt=class{constructor(e){this.ctx=e;this.sessions=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>F$s){let n=this.sessions.keys().next().value;n!==void 0&&n!==e&&(Tlt.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.remove(n).catch(o=>Tlt.warn(this.ctx,`Failed to evict session ${n}`,{error:o instanceof Error?o.message:String(o)})))}}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)}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),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){Tlt.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!==r){Tlt.debug(this.ctx,`Skipping map clear for session ${e}: re-cached during removal`);return}this.sessions.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.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 pfr=require("node:fs"),GX=de(require("node:path"));function xZn(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(xZn,"sanitizePathSegment");function wlt(t){return typeof t=="string"?t:void 0}a(wlt,"asString");function xlt(t){return typeof t=="number"?t:void 0}a(xlt,"asNumber");function U$s(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:wlt(r.toolCallId),tool:wlt(r.name)}}):[]}a(U$s,"asToolCallArray");function Q$s(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(Q$s,"toToolResultText");function q$s(t){try{return JSON.stringify(t)}catch{return}}a(q$s,"safeStringify");var hfr=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=lQt(new Date),s=xZn(r);this.sessionDir=GX.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?GX.join(this.sessionDir,"runSubAgent",xZn(e)):this.sessionDir}appendJsonl(e,r){let n=q$s(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await pfr.promises.mkdir(GX.dirname(e),{recursive:!0}),await pfr.promises.appendFile(e,`${n} +`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:xlt(e.data.inputTokens),outputTokens:xlt(e.data.outputTokens),cacheReadTokens:xlt(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=U$s(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(GX.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:xlt(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=wlt(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=wlt(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(GX.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:Q$s(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function wZn(t,e,r){let n=Ft(t,Ye.PromptPersistBasePath)?.trim()||void 0;if(n)return new hfr(n,e,r)}a(wZn,"createBackgroundAgentPersistence");p();var Rlt=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 mfr={INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool"},ho={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 zhe(t,e){return JSON.stringify([{role:t,parts:[{type:"text",content:e}]}])}a(zhe,"genAiMessagesJson");var kZn=require("crypto");var gfr=new fe("BackgroundAgent.CliOTelTracker"),j$s={USER_REQUEST:"copilot_chat.user_request"},Afr="main";function Yhe(t){return(0,kZn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(Yhe,"generateHexId");function PZn(){return BigInt(Date.now())*1000000n}a(PZn,"nowNano");function Khe(t){if(t){let e=Date.parse(t);if(!Number.isNaN(e))return BigInt(e)*1000000n}return PZn()}a(Khe,"isoToNano");function RZn(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(RZn,"toAttributeString");function DZn(t,e,r){if(!t.get(bn).getCapabilities().agentDebugLog)return;let n=t.get(hv);if(n.isEnabled())return new yfr(t,e,r,n)}a(DZn,"createCliOTelTracker");var yfr=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(Khe(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=>{gfr.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:Yhe(16),invokeAgentSpanId:Yhe(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(Khe(e.timestamp)),n={data:e.data,endNano:Khe(e.timestamp),agentKey:e.data.parentToolCallId??Afr,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??Afr;r.responseByAgent.set(o,(r.responseByAgent.get(o)??"")+n)}_onToolStart(e){let r=e.data.toolCallId;if(!r)return;let n=this._ensureRequest(Khe(e.timestamp)),o=e.data.parentToolCallId,s=(o?n.toolSpanIds.get(o):void 0)??n.invokeAgentSpanId,c=Yhe(8);this._pendingTools.set(r,{traceId:n.traceId,spanId:c,parentSpanId:s,toolName:e.data.toolName??"unknown",arguments:e.data.arguments,startNano:Khe(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=Khe(e.timestamp),s=e.data.success===!1,c=e.data.error?.message,l={[ho.OPERATION_NAME]:"execute_tool",[ho.CONVERSATION_ID]:this._sessionId,[ho.TOOL_NAME]:n.toolName,[ho.TOOL_CALL_ID]:r},u=RZn(n.arguments);u!==void 0&&(l[ho.TOOL_CALL_ARGUMENTS]=u);let d=e.data.result??e.data.error,f=RZn(d);f!==void 0&&(l[ho.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:P2(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=PZn(),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:P2({[ho.OPERATION_NAME]:"invoke_agent",[ho.AGENT_NAME]:"copilotcli",[ho.CONVERSATION_ID]:this._sessionId}),events:[],status:{code:1}}}_buildUserMessageSpan(e){if(!e.userRequest)return;let r=e.startNano.toString();return{traceId:e.traceId,spanId:Yhe(8),parentSpanId:e.invokeAgentSpanId,name:"user_message",kind:1,startTimeUnixNano:r,endTimeUnixNano:r,attributes:P2({[ho.OPERATION_NAME]:"user_message",[ho.CONVERSATION_ID]:this._sessionId,[j$s.USER_REQUEST]:e.userRequest}),events:[{name:"user_message",timeUnixNano:r,attributes:P2({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===Afr?e.invokeAgentSpanId:e.toolSpanIds.get(o)??e.invokeAgentSpanId,l=(r.get(o)??e.startNano).toString();n.push({traceId:e.traceId,spanId:Yhe(8),parentSpanId:c,name:"agent_response",kind:1,startTimeUnixNano:l,endTimeUnixNano:l,attributes:P2({[ho.OPERATION_NAME]:"agent_response",[ho.CONVERSATION_ID]:this._sessionId,[ho.OUTPUT_MESSAGES]:zhe("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={[ho.OPERATION_NAME]:"chat",[ho.CONVERSATION_ID]:this._sessionId,[ho.RESPONSE_MODEL]:o},l=r.data.inputTokens,u=r.data.outputTokens,d=r.data.cacheReadTokens,f=r.data.cacheWriteTokens;typeof l=="number"&&(c[ho.USAGE_INPUT_TOKENS]=l),typeof u=="number"&&(c[ho.USAGE_OUTPUT_TOKENS]=u),typeof d=="number"&&(c[ho.USAGE_CACHE_READ_INPUT_TOKENS]=d),typeof f=="number"&&(c[ho.USAGE_CACHE_CREATION_INPUT_TOKENS]=f),r.systemInstructions&&(c[ho.SYSTEM_INSTRUCTIONS]=r.systemInstructions),r.inputMessagesJson&&(c[ho.INPUT_MESSAGES]=r.inputMessagesJson);let h=n?e.responseByAgent.get(r.agentKey):void 0;h&&(c[ho.OUTPUT_MESSAGES]=zhe("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:Yhe(8),parentSpanId:s,name:`chat ${o}`,kind:1,startTimeUnixNano:A.toString(),endTimeUnixNano:m.toString(),attributes:P2(c),events:[],status:{code:1}}}async _readAssembled(){try{let e=await this._session.getChatContextMessages();return{inputMessagesJson:e.length>0?JSON.stringify(e):void 0,systemInstructions:this._session.getCurrentSystemMessage()}}catch(e){return gfr.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){gfr.warn(this._ctx,`Failed to persist debug spans for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`)}};Oo();var y8=new fe("BackgroundAgent.TurnDriver"),Efr="backgroundAgent",klt=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=wZn(this.ctx,e,`bg-turn-${Mt()}`),d=DZn(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=a(()=>{},"noop"),h=r.on("user_input.requested",f),m=r.on("permission.requested",f),g=r.on("exit_plan_mode.requested",f);VGn(r,!0);let A=new Rlt,y=r.on("*",w=>{if(w.type==="assistant.turn_start"&&this.registry.getTurnLimiter(e)?.onTurnStart(),u)try{u.persistEvent(w)}catch(R){y8.warn(this.ctx,"Failed to persist background-agent event",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}if(A.trackEvent(w),d)try{d.onEvent(w)}catch(R){y8.warn(this.ctx,"Failed to synthesize debug span",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}this.handleSessionEvent(e,w,o)}),E=!1,_=a(()=>{E||(E=!0,this.emitTurnCompleteTelemetry(e,r,l,A.data,o),this.emitSessionMetricsTelemetry(e,r,o,c)),T?.dispose(),h(),m(),g(),y(),v(),b(),this.forget(e)},"cleanup"),v=r.on("session.idle",()=>{_()}),b=r.on("session.error",()=>{_()}),T;s&&(T=s.onCancellationRequested(()=>{y8.info(this.ctx,"Cancellation requested, aborting session:",e),r.clearPendingItems(),r.abort()})),r.send(n).catch(w=>{_();let R=Brt(w);s?.isCancellationRequested?y8.info(this.ctx,"session.send aborted by cancellation",{sessionId:e,turnIndex:o}):(y8.error(this.ctx,"session.send failed",{sessionId:e,turnIndex:o,error:R,stack:w instanceof Error?w.stack:void 0}),this.emitTurnFailedTelemetry(e,o,"SendMessageError"));let x={type:"session.error",id:Mt(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:R}};this.sendSessionUpdateNotification(e,x,o)})}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)){y8.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){y8.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;At(this.ctx,"backgroundAgent.turn.complete",{requestSource:Efr,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){y8.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}emitTurnFailedTelemetry(e,r,n){At(this.ctx,"backgroundAgent.turn.failed",{requestSource:Efr,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))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);At(this.ctx,"backgroundAgent.session.metrics",{requestSource:Efr,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){y8.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}};p();function NZn(t,e,r){e.agentMode&&(t.currentMode=e.agentMode,r.agentMode=e.agentMode)}a(NZn,"applyAgentModeOverride");p();async function MZn(t,e,r,n,o){let s=n.chatMode??"agent",c=mat(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;let u=o.getWorkingDir(e);if(!u)throw new Error(`Cannot apply chatMode for session ${e}: working directory is not cached`);let d={uri:Ks(u)};o.deleteChatMode(e),await OGn(r,c,{loadCustomAgents:a(()=>Xct(t,d),"loadCustomAgents"),getAllLoadedSkillNames:a(async()=>(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(f=>f.name)),"getAllLoadedSkillNames"),getPolicyDisabledSkillNames:a(async()=>{let f;try{f=t.get(h0)}catch{return[]}return f.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(h=>h.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{let f=o.getMcpDirectory(e)??o.getWorkspaceFolderUri(e);try{return Promise.resolve(t.get(NT).buildMcpServers(f))}catch(h){if(h instanceof bl)return Promise.resolve({});throw h}},"getMcpServers")}),o.setChatMode(e,c)}a(MZn,"applyChatModeOverride");p();var OZn=new fe("BackgroundAgent.applyChatModeSelection");async function LZn(t,e,r){if(r.chatMode===void 0||mat(r.chatMode))return;let n=r.chatMode==="agent";try{n?(await e.agent.deselect(),OZn.info(t,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:r.chatMode}),OZn.info(t,`Applied custom agent '${r.chatMode}' for session ${r.sessionId}`))}catch(o){let s=o instanceof Error?o.message:String(o);throw n?new Error(`Failed to clear custom agent selection on session ${r.sessionId}: ${s}`):new Error(`Failed to select custom agent '${r.chatMode}' on session ${r.sessionId}: ${s}. Verify the agent is registered via a workspace .agent.md file.`)}}a(LZn,"applyChatModeSelection");p();var BZn=require("node:util");function FZn(t,e,r,n){let o=blt(t)??{enabled:!1},s=n.getAppliedSandboxConfig(e);s!==void 0&&(0,BZn.isDeepStrictEqual)(s,o)||(r.updateOptions({sandboxConfig:o}),n.setAppliedSandboxConfig(e,o))}a(FZn,"applySandboxOverride");p();p();var $X=new fe("BackgroundAgent.ProviderConfig");async function UZn(t,e,r){if(!e)return;let n=await Yze(t,e,r);if(!n){$X.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let d=await new Ha(t.get(ri)).getStoredModelConfigs(e),f=r?d[r]:void 0;o=f?.deploymentUrl,s=f?.modelCapabilities?.maxInputTokens,c=f?.modelCapabilities?.maxOutputTokens}catch(u){$X.warn(t,"Failed to load BYOK model config; using defaults",{providerName:e,modelId:r,error:u instanceof Error?u.message:String(u)})}let l={...s!==void 0&&{maxPromptTokens:s},...c!==void 0&&{maxOutputTokens:c}};if(e===io.Anthropic)return{type:"anthropic",baseUrl:o??zle[e],apiKey:n,modelId:r,wireModel:r,...l};if(e===io.Azure){if(!o){$X.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return G$s(t,o,n,r,l)}if(jle(e))return{type:"openai",baseUrl:o??zle[e],apiKey:n,modelId:r,wireModel:r,...l};if(vK(e))return H$s(t,e,n,r,o,l);$X.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}a(UZn,"buildProviderConfig");async function H$s(t,e,r,n,o,s){if(!o){$X.warn(t,`Custom endpoint '${e}' has no configured URL; skipping provider config.`);return}let u=(await new Ha(t.get(ri)).getProviderConfig(e))?.apiType,d=u==="chatCompletions"||u==="responses"||u==="messages"?u:exe,f=zze(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(H$s,"buildCustomEndpointProviderConfig");function G$s(t,e,r,n,o){let s;try{s=new URL(e)}catch{$X.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};$X.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(G$s,"buildAzureProviderConfig");var _fr=new fe("BackgroundAgent.applyTurnOverrides");async function QZn(t,e,r,n){let o=r.providerName?r.providerName:void 0;if(o!==void 0&&!eq(await t.get(Qt).getToken()))throw new YRe(`BYOK is disabled for this account. Provider '${o}' cannot be used for model '${r.model??""}'.`,o,r.model);let s=await UZn(t,o,r.model);if(o!==void 0&&s===void 0)throw new zRe(`BYOK provider '${o}' is misconfigured for model '${r.model??""}'. Verify the API key`+(o===io.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){_fr.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)));_fr.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{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}),_fr.info(t,`Rebound session ${r.sessionId} for this turn: provider=${o??"(built-in)"}, model=${l??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),h}a(QZn,"applyTurnOverrides");p();async function qZn(t,e,r,n,o){let s=V$s(e,n),c=o==="inline"||o==="inline-ask";await t.get(Cg).applyPromptTemplateToRequest(r,s?[s]:[],c,{includePlugins:!0})||$$s(t,r)}a(qZn,"expandPromptTemplate");function $$s(t,e){let r=e.message.trim();if(!r.startsWith("/"))return!1;let[n,...o]=r.split(" "),s=n.slice(1);if(!Uxn.has(s))return!1;let c=i2().find(l=>l.id===s);return c?.instructions?(e.message=c.instructions(t,o.join(" ")),!0):!1}a($$s,"applyBuiltinCreateTemplate");function V$s(t,e){let r=e.getWorkingDir(t);return r?{uri:Ks(r)}:void 0}a(V$s,"getWorkspaceFolderForSession");Oo();var ty=new fe("BackgroundAgent"),kH="backgroundAgent",W$s="backgroundAgent.remote",z$s=new Set(["system.message","hook.start","hook.end"]),Hs=class{constructor(e){this.ctx=e;this.pendingExternalToolDefs=new Map;this.notificationSender=e.get(ts),this.managerLifecycle=new Nat(e),this.authBinding=new Lrt(e),this.registry=new Ilt(e),this.mcpSync=new Wct(e,this.registry),this.remoteController=new Zct(e,{registry:this.registry,injectUserMessage:a((n,o,s)=>this.injectRemoteUserMessage(n,o,s),"injectUserMessage")}),this.turnDriver=new klt(e,this.registry,this.notificationSender),e.get(Bo).onDidChangeHttpSettings(()=>{pat(this.ctx)}),bs(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(h0).onDidChangeSkillsEnabled(()=>{this.registry.clearChatMode()})}catch(n){if(!(n instanceof bl))throw n}}static{a(this,"BackgroundAgentService")}async handleAuthStateChange(){let{changed:e,hadPrevious:r,hasCurrent:n}=await this.authBinding.detectIdentityChange();e&&(ty.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(),this.managerLifecycle.clearAutoMode()}ensureManager(){return this.managerLifecycle.ensureManager()}get sdk(){return this.managerLifecycle.getSdk()}get autoModeManager(){return this.managerLifecycle.getAutoModeManager()}installBridgeSpanProcessor(){this.managerLifecycle.ensureBridgeInstalled()}async handleInteraction(e){let r=performance.now(),n=await this.getOrResumeSession(e.sessionId),o=a2n(n,e);return At(this.ctx,"backgroundAgent.interaction",{requestSource:kH,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 QZn(this.ctx,e,r,{registry:this.registry,managerLifecycle:this.managerLifecycle,getOrResumeSession:a(n=>this.getOrResumeSession(n),"getOrResumeSession")})}applyChatModeSelection(e,r){return LZn(this.ctx,e,r)}buildSessionOptions(e,r){return TZn(this.ctx,e,r,{buildAuthInfo:a(()=>this.buildAuthInfo(),"buildAuthInfo")})}async createSession(e){let r=performance.now();ty.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??Mt(),s=e.inlineConfinedFile?UGn(2):void 0,c=e.inlineConfinedFile?QGn(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),ty.info(this.ctx,"Session created:",o),this.installBridgeSpanProcessor(),At(this.ctx,"backgroundAgent.create",{requestSource:kH,reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.registry.set(o,u),this.registry.setWorkingDir(o,to(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),ty.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 h=this.pendingExternalToolDefs.get(e);return h&&(this.pendingExternalToolDefs.delete(e),n.updateOptions({externalToolDefinitions:h}),ty.info(this.ctx,"Applied pending external tool definitions to cached session",{sessionId:e,toolCount:h.length})),n}let o=await this.ensureManager(),s=r.workspaceFolder;if(!s){let h=await o.getSessionMetadata({sessionId:e});if(!h)throw new Error(`Session not found: ${e}`);let m=h.context?.cwd;if(!m)throw new Error(`Cannot resume session ${e} from disk: persisted metadata is missing working-directory context`);s={uri:Ks(m)},ty.info(this.ctx,"Resuming session from disk via metadata fallback",{sessionId:e})}let c=this.pendingExternalToolDefs.get(e);c&&this.pendingExternalToolDefs.delete(e);let l=await this.buildSessionOptions(e,{...r,externalToolDefinitions:r.externalToolDefinitions??c,workspaceFolder:s}),u=await o.getSession(l,!0);if(!u)throw new Error(`Session not found: ${e}`);this.registry.set(e,u);let d=Array.from(u.getEvents()).filter(h=>h.type==="user.message").length;d>0&&this.registry.seedTurnIndexIfAbsent(e,d-1),this.registry.deleteChatMode(e),this.registry.deleteAppliedSandboxConfig(e),this.installBridgeSpanProcessor();let f=s?.uri?to(s.uri).fsPath:void 0;return f&&this.registry.setWorkingDir(e,f),s?.uri&&this.registry.setWorkspaceFolderUri(e,s.uri),r.mcpDirectory&&this.registry.setMcpDirectory(e,r.mcpDirectory),u}async sendMessage(e,r){let n=await this.getOrResumeSession(e.sessionId),o=await this.applyTurnOverrides(n,e);await this.applyChatModeOverride(e.sessionId,o,e),this.applySandboxOverride(e.sessionId,o);let s=e.message;await this.expandPromptTemplate(e.sessionId,e,e.chatMode),await this.applyChatModeSelection(o,e);let c={prompt:e.message,...e.message!==s?{displayPrompt:s}:{},...e.sendMode?{mode:e.sendMode}:{}};this.applyAgentModeOverride(o,e,c);let l=e.chatMode==="inline-ask"||e.chatMode==="inline";if(e.references?.length&&!l){let m=s2n(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 jGn(m,g,this.ctx);if(A.promptFragment&&(c.prompt=`${c.prompt}${A.promptFragment}`),A.isLargeFile){let y=e.chatMode==="inline-ask"?hat:Zar;o.updateOptions({availableTools:[...y,"view"]},{emitToolDefinitionsChanged:!0})}}}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:kH,chatMode:this.registry.getChatMode(e.sessionId)??"agent",sessionId:e.sessionId,safeModelId:Y$s(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 At(this.ctx,"backgroundAgent.send",f,h),Et(this.ctx,"backgroundAgent.send",Wt.createAndMarkAsIssued(f,h)),{}}async truncateHistory(e){let r=performance.now(),o=await(await this.getOrResumeSession(e.sessionId)).history.truncate({eventId:e.eventId});return At(this.ctx,"backgroundAgent.truncateHistory",{requestSource:kH,providerName:e.providerName,sessionId:e.sessionId,eventId:e.eventId},{totalTimeMs:performance.now()-r,eventsRemoved:o.eventsRemoved}),{eventId:e.eventId,eventsRemoved:o.eventsRemoved}}applyChatModeOverride(e,r,n){return MZn(this.ctx,e,r,n,this.registry)}applySandboxOverride(e,r){FZn(this.ctx,e,r,this.registry)}applyAgentModeOverride(e,r,n){NZn(e,r,n)}async injectRemoteUserMessage(e,r,n){let o=await this.getOrResumeSession(e),s={message:r};await this.expandPromptTemplate(e,s);let c={prompt:s.message,...s.message!==r?{displayPrompt:r}:{},source:n},l=performance.now(),u=this.registry.incrementTurnIndex(e);this.turnDriver.wireAndSend(e,o,c,u),At(this.ctx,"backgroundAgent.send",{requestSource:W$s,sessionId:e,safeModelId:"",providerName:"",reasoningEffort:"",contextTier:"",hasReferences:"false",turnIndex:String(u)},{totalTimeMs:performance.now()-l,messageCharLen:s.message.length,referenceCount:0})}expandPromptTemplate(e,r,n){return qZn(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 ty.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);ty.info(this.ctx,"Stopping session via abort:",e),n.abortManualCompaction()&&ty.info(this.ctx,"Aborted in-progress manual compaction:",e),n.clearPendingItems(),await n.abort(),At(this.ctx,"backgroundAgent.stop",{requestSource:kH,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);ty.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return At(this.ctx,"backgroundAgent.compactHistory",{requestSource:kH,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);ty.info(this.ctx,"Aborting manual compaction for session:",e);let o=n.abortManualCompaction();return At(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:kH,sessionId:e,aborted:String(o)},{totalTimeMs:performance.now()-r}),{aborted:o}}async getPlanPath(e){return(await this.getOrResumeSession(e)).getPlanPath()}async resumeSession(e){let r=performance.now();ty.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());At(this.ctx,"backgroundAgent.resume",{requestSource:kH,reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!z$s.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!==e.cwd||e.gitRoot&&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){ty.info(this.ctx,"listModels called",{forceRefresh:e}),await this.managerLifecycle.ensureManager();let r=performance.now();try{let n=await this.ctx.get(xs).getMetadata(e),o=this.sdk?.EXCLUDED_MODELS,s=n.filter(u=>u.model_picker_enabled===!0).filter(u=>u.capabilities.type==="chat").filter(u=>!o?.has(u.id)).map(Ort);s.length===0?ty.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):ty.info(this.ctx,`Successfully retrieved ${s.length} models`);let c=[];this.ctx.get(jl).getPolicyValue("autoModel.enabled")!==!1&&c.push(this.buildAutoModelEntry());let l=[...c,...s];return ty.debug(this.ctx,"Models retrieved:",l.map(u=>u.id)),At(this.ctx,"backgroundAgent.listModels",{status_text:"success"},{duration_ms:performance.now()-r,model_count:l.length}),{models:l}}catch(n){let o=n instanceof Error?n.message:String(n),s=PZt(n);throw ty.error(this.ctx,"listModels failed",{error:o,cause:s,stack:n instanceof Error?n.stack:void 0}),Vn(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(),Jar(),l2n(),await this.managerLifecycle.dispose()}};function Y$s(t,e){return e?"byok models":t??""}a(Y$s,"safeModelId");p();p();var Ap=(o=>(o.Background="BACKGROUND",o.Claude="CLAUDE",o.Codex="CODEX",o.Cloud="CLOUD",o))(Ap||{});p();async function kb(t,e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return jZn(t,e,n,o),s}catch(s){throw o.error??=s,jZn(t,e,n,o),s}}a(kb,"runWithTelemetry");function jZn(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?Vn(t,`${e}.failure`,n.error,s,c):At(t,e,s,c)}a(jZn,"flushTelemetry");p();var HZn=de(require("path"));p();var vfr=["default","acceptEdits","bypassPermissions","plan","auto"];function VX(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(VX,"assertClaudeProvider");function Jhe(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(Jhe,"assertNonEmptyString");function K$s(t,e,r){if(r===void 0)throw new Error(`${t}: ${e} is required`);try{to(r)}catch(n){throw new Error(`${t}: ${e} is not a valid URI: ${r}`,{cause:n})}}a(K$s,"assertFsUri");function J$s(t,e,r){if(!HZn.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(J$s,"assertAbsolutePath");function Z$s(t,e){if(e!==void 0&&!vfr.includes(e))throw new Error(`${t}: agentMode must be one of ${vfr.join(", ")}, got '${e}'`)}a(Z$s,"assertAllowedAgentMode");async function iNe(t,e){if(e===void 0)return;let n=(await t.get(xs).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!k$e(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(iNe,"validateClaudeModel");async function GZn(t,e){VX("createSession",e.agentProvider),K$s("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await iNe(t,e.model)}a(GZn,"validateAgentCreate");async function $Zn(t,e){VX("resumeSession",e.agentProvider),Jhe("resumeSession","sessionId",e.sessionId),await iNe(t,e.model)}a($Zn,"validateAgentResume");async function VZn(t,e){VX("sendMessage",e.agentProvider),Jhe("sendMessage","sessionId",e.sessionId),Jhe("sendMessage","message",e.message),Z$s("sendMessage",e.agentMode),await iNe(t,e.model)}a(VZn,"validateAgentSend");function WZn(t,e){VX("stopSession",e.agentProvider),Jhe("stopSession","sessionId",e.sessionId)}a(WZn,"validateAgentStop");function zZn(t,e){VX("destroySession",e.agentProvider),Jhe("destroySession","sessionId",e.sessionId)}a(zZn,"validateAgentDestroy");function YZn(t,e){VX("listSessions",e.agentProvider),Jhe("listSessions","cwd",e.cwd),J$s("listSessions","cwd",e.cwd)}a(YZn,"validateAgentListSessions");function KZn(t,e){VX("listModels",e.agentProvider)}a(KZn,"validateAgentListModels");p();p();p();var eXn=require("child_process"),Zhe=de(require("path")),tXn=de(yP()),rXn=require("util");var JZn=5e3,ZZn=200,Xhe=class{constructor(e){this.execFile=(0,rXn.promisify)(eXn.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=Zhe.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(Zhe.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:JZn,windowsHide:!0})).stdout}catch(c){return{severity:"error",message:this.formatSpawnError(e,c)}}let o=tXn.coerce(n);if(!o)return{severity:"error",message:`Could not parse ${this.config.displayName} version from "${e}" --version output: "${XZn(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=Zhe.basename(e).toLowerCase();if(!r.includes(n))return`${this.config.displayName} path "${e}" must point at the "${r[0]}" executable, but the basename is "${Zhe.basename(e)}".`}formatSpawnError(e,r){let n=r;if(n?.code==="ENOENT")return`${this.config.displayName} not found at "${e}". Check that the file exists and is executable.`;if(n?.killed&&n?.signal==="SIGTERM")return`${this.config.displayName} at "${e}" did not respond to --version within ${JZn/1e3}s.`;let o=typeof n?.stderr=="string"?XZn(n.stderr):"",s=n?.code!==void 0?` (exit code ${String(n.code)})`:"",c=o?` stderr: "${o}"`:"",l=n?.message?`: ${n.message}`:"";return`Failed to run "${e} --version"${s}${l}${c}`}};function XZn(t){let e=t.trim();return e.length<=ZZn?e:`${e.slice(0,ZZn)}\u2026`}a(XZn,"truncate");var Plt=de(yP());function X$s(){let t=sIe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(X$s,"getExpectedVersionRaw");var Cfr=class extends Xhe{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,r){let n=X$s(),o=Plt.coerce(n);if(!o)return{severity:"error",message:`Could not parse expected Claude Code CLI version "${n}" from packaged metadata. This is an internal error; please report it.`};if(!Plt.satisfies(e,`~${o.major}.${o.minor}.0`))return{severity:"warning",message:`Claude Code CLI at "${r}" reports version ${e.version}, but this language server was built against ${o.version}. The session will still start, but SDK behavior may be unstable on protocol drift. Run \`npm install -g @anthropic-ai/claude-code@${o.version}\` to align versions.`}}})}},eme=new Cfr;p();var tme=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 nXn(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(nXn,"buildPermissionRequest");function iXn(t,e){return t.kind==="approve-once"?{behavior:"allow",updatedInput:e}:{behavior:"deny",message:eVs(t)}}a(iXn,"translatePermissionResult");function eVs(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(eVs,"formatDenyMessage");function oXn(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(oXn,"buildPreparedQuestions");function sXn(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(sXn,"buildUserInputRequest");p();var aXn=require("crypto");var tVs=new fe("ClaudeOTelTracker");function cXn(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(cXn,"toAttributeString");function rVs(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 cXn(t)}a(rVs,"stringifyToolResult");function bfr(t){return(0,aXn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(bfr,"generateHexId");function Dlt(){return BigInt(Date.now())*1000000n}a(Dlt,"nowNano");var Nlt=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=bfr(16),o=bfr(8);this._rootSpan={traceId:n,spanId:o,name:"invoke_agent claude",startNano:Dlt(),attributes:{[ho.OPERATION_NAME]:mfr.INVOKE_AGENT,[ho.AGENT_NAME]:"claude",[ho.SYSTEM]:"anthropic",[ho.CONVERSATION_ID]:this._sessionId,...e?{[ho.REQUEST_MODEL]:e}:{},...r?{[ho.INPUT_MESSAGES]:zhe("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;if(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),e.modelUsage){let n=Object.keys(e.modelUsage);n.length>0&&(this._rootSpan.attributes[ho.RESPONSE_MODEL]=n[0])}typeof e.num_turns=="number"&&(this._rootSpan.attributes[ho.TURN_COUNT]=e.num_turns),typeof e.total_cost_usd=="number"&&(this._rootSpan.attributes[ho.TOTAL_COST_USD]=e.total_cost_usd)}_startToolSpan(e,r,n){if(!this._rootSpan||this._toolSpans.has(e))return;let o={[ho.OPERATION_NAME]:mfr.EXECUTE_TOOL,[ho.TOOL_NAME]:r,[ho.TOOL_CALL_ID]:e,[ho.CONVERSATION_ID]:this._sessionId},s=cXn(n);s!==void 0&&(o[ho.TOOL_CALL_ARGUMENTS]=s),this._toolSpans.set(e,{traceId:this._rootSpan.traceId,spanId:bfr(8),parentSpanId:this._rootSpan.spanId,name:`execute_tool ${r}`,startNano:Dlt(),attributes:o})}_endToolSpan(e,r,n){let o=this._toolSpans.get(e);if(!o)return;this._toolSpans.delete(e);let s=rVs(n);s!==void 0&&(o.attributes[ho.TOOL_CALL_RESULT]=s);let c=Dlt(),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[ho.USAGE_INPUT_TOKENS]=this._inputTokens),this._outputTokens>0&&(n.attributes[ho.USAGE_OUTPUT_TOKENS]=this._outputTokens),this._cacheReadTokens>0&&(n.attributes[ho.USAGE_CACHE_READ_INPUT_TOKENS]=this._cacheReadTokens),this._cacheCreationTokens>0&&(n.attributes[ho.USAGE_CACHE_CREATION_INPUT_TOKENS]=this._cacheCreationTokens);let o=Dlt(),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[ho.OUTPUT_MESSAGES]=zhe("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:P2(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=>{tVs.warn(this._ctx,`Failed to persist OTel spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)})}};p();var Sfr=require("fs"),uXn=de(require("path"));var oNe=new fe("ClaudeCode.ReferenceFormatter"),nVs={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},lXn=5*1024*1024;async function dXn(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=rs(s.uri);if(!c){oNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=oVs(c);if(l){let u=await iVs(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=rs(s.uri);if(!c){oNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:oNe.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:sVs(n)}),o}a(dXn,"buildReferences");async function iVs(t,e,r){try{let n=await Sfr.promises.stat(t);if(n.size>lXn){oNe.debug(r,`Skipping oversize image reference (${n.size} > ${lXn} bytes): ${t}`);return}let o=(await Sfr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){oNe.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(iVs,"tryReadImageBlock");function oVs(t){return nVs[uXn.extname(t).toLowerCase()]}a(oVs,"imageMediaTypeForPath");function sVs(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(eVs,"wrapInSystemReminder");p();var uXn=require("crypto");var tVs=new Set(["ExitPlanMode"]);function Sfr(t,e={}){let r=e.timestamp??new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[pXn(r,"synthetic",t.error)];switch(t.type){case"system":return rVs(t,r);case"assistant":return cXn(nVs(t,r,e.streamingEnabled===!0,e.blockCursor,e.interactionId,e.mapModelId),e.suppressedToolUseIds);case"user":return cXn(e.includeUserText===!0?oVs(t,r):iVs(t,r),e.suppressedToolUseIds);case"result":return cVs(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(Sfr,"translate");function cXn(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&&tVs.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(cXn,"dropDedicatedChannelToolEvents");function dXn(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:Lg(),timestamp:o,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${n.index}`,deltaContent:s.text}}];case"thinking_delta":return[{id:Lg(),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(dXn,"translatePartial");function rVs(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:Lg(),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:Lg(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:Lg(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(rVs,"translateSystem");function nVs(t,e,r,n,o,s){let c=t.message?.id??Lg(),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:Lg(),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:Lg(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${c}:${A}`,content:y}});break}case"tool_use":{let y=g;l.push({id:Lg(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof y.id=="string"?y.id:Lg(),toolName:typeof y.name=="string"?y.name:"unknown",arguments:y.input}});break}default:break}}),h.set(c,m),l}a(nVs,"translateAssistant");function iVs(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(fXn(o,e));return n}a(iVs,"translateUserLive");function oVs(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=Nlt(n);return o.length>0&&r.push(lXn(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(fXn(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=Nlt(s);c.length>0&&r.push(lXn(e,c))}}}return r}a(oVs,"translateUserHistory");function fXn(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=lVs(t.content);return{id:Lg(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:Lg(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(fXn,"buildToolExecutionComplete");function lXn(t,e){return{id:Lg(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(lXn,"buildUserMessage");function sVs(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(sVs,"stripSystemReminders");var aVs=/^\[Request interrupted by user[^\]]*\]$/;function Nlt(t){let e=sVs(t);return aVs.test(e)?"":e}a(Nlt,"sanitizeUserText");function cVs(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:Lg(),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(pXn(e,typeof l=="string"?l:"error",f))}return o.push({id:Lg(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(cVs,"translateResult");function pXn(t,e,r){return{id:Lg(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(pXn,"buildSessionError");function lVs(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(lVs,"flattenToolResultContent");function Lg(){return(0,uXn.randomUUID)()}a(Lg,"newId");function hXn(t,e){let r=[],n=new Map,o=new Set,s;for(let c of t){let l=dVs(c);if(!l)continue;(l.type==="user"&&uVs(l)||l.type==="assistant"&&s===void 0)&&(s=Lg());let u=l.type==="assistant"?s:void 0,d=c.timestamp,f=typeof d=="string"?d:void 0;try{r.push(...Sfr(l,{streamingEnabled:!1,includeUserText:!0,blockCursor:n,suppressedToolUseIds:o,timestamp:f,interactionId:u,mapModelId:e}))}catch{}}return r}a(hXn,"translateHistory");function uVs(t){let e=(t.message??{}).content;if(typeof e=="string")return Nlt(e).length>0;if(!Array.isArray(e))return!1;for(let r of e)if(r.type==="text"&&typeof r.text=="string"&&Nlt(r.text).length>0)return!0;return!1}a(uVs,"userMessageStartsInteraction");function dVs(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&fVs(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(dVs,"adaptHistoryMessage");function fVs(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(fVs,"isSyntheticReplayUserMessage");p();var fm=class{constructor(){this._modelBySession=new Map;this._permissionModeBySession=new Map;this._reasoningEffortBySession=new Map;this._copilotUsageNanoAiuBySession=new Map}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){if(!Number.isFinite(r)||r<=0)return;let n=this._copilotUsageNanoAiuBySession.get(e)??0;this._copilotUsageNanoAiuBySession.set(e,n+r)}takeCopilotUsageNanoAiuForSession(e){let r=this._copilotUsageNanoAiuBySession.get(e);return this._copilotUsageNanoAiuBySession.delete(e),r}clear(e){this._modelBySession.delete(e),this._permissionModeBySession.delete(e),this._reasoningEffortBySession.delete(e),this._copilotUsageNanoAiuBySession.delete(e)}};var Mlt=de(require("path"));Mo();var qc=new fe("ClaudeCodeAgent.session"),jc="ClaudeCodeSession",iNe=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;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 eme;this._userInputRegistry=new eme;this._exitPlanModeRegistry=new eme;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(fm);if(s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode),this.ctx.get(bn).getCapabilities().agentDebugLog){let c=new pv(this.ctx);c.isEnabled()&&(this._otelTracker=new Dlt(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(fm).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){qc.warn(this.ctx,`${jc}: 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 qc.warn(this.ctx,`${jc}: supportedAgents query failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),[]}}_notifyAgentListChanged(){try{this.ctx.get(a0).notify("agent").catch(e=>{qc.warn(this.ctx,`${jc}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})})}catch(e){qc.warn(this.ctx,`${jc}: 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){qc.info(this.ctx,`${jc}: setPermissionMode skipped (undefined preserves existing)`,{sessionId:this.sessionId,existingMode:this._permissionMode});return}let r=e??"default";if(this._permissionMode=r,this.ctx.get(fm).setPermissionModeForSession(this.sessionId,r),this._query)try{await this._query.setPermissionMode(r),qc.info(this.ctx,`${jc}: setPermissionMode propagated to live Query`,{sessionId:this.sessionId,effectiveMode:r})}catch(n){qc.warn(this.ctx,`${jc}: 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){qc.warn(this.ctx,`${jc}: interrupt() failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}dispose(){if(this._disposed)return;this._disposed=!0,this._dropAllPending("disposed"),this._abortController.abort(),this.ctx.get(fm).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=>{qc.warn(this.ctx,`${jc}: 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(fm).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(fm).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new vA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1,this._currentTurnInteractionId=Mt();let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{qc.info(this.ctx,`${jc}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),qc.info(this.ctx,`${jc}.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 aXn(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??Mt()};this._otelTracker?.startRequest(this._model),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=Ft(this.ctx,Ye.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await Xhe.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(qc.warn(this.ctx,`${jc}: ${o.message}`,{sessionId:this.sessionId}),this.notificationSender.showWarningMessageOnlyOnce("claude.cliVersionMismatch",o.message));let s={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()}},systemPrompt:{type:"preset",preset:"claude_code"},settingSources:["user","project","local"],...L$t(this.ctx)?{}:{skills:[]},disallowedTools:["WebSearch"],canUseTool:this._handleCanUseTool,thinking:{type:"adaptive"},includePartialMessages:!0,allowDangerouslySkipPermissions:!0,...this._model&&{model:this._model},...this._permissionMode&&{permissionMode:this._permissionMode},...r?{resume:this.sessionId}:{sessionId:this.sessionId}},c=await this.sdkWrapper.query({prompt:this._createPromptIterable(),options:s});this._query=c,this._isResumed=!0,this._notifyAgentListChanged(),qc.info(this.ctx,`${jc}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(c).catch(l=>{qc.error(this.ctx,`${jc}: consume loop crashed`,{sessionId:this.sessionId,error:l instanceof Error?l.message:String(l)})})}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(gF).resolvePath();return`${Mlt.dirname(e)}${Mlt.delimiter}${process.env.PATH??""}`}catch(e){return qc.warn(this.ctx,`${jc}: bundled ripgrep unavailable, falling back to process PATH`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),process.env.PATH??""}}async*_createPromptIterable(){for(;!this._disposed;){if(this._pendingPromptInput){let r=this._pendingPromptInput;this._pendingPromptInput=void 0,yield r;continue}let e=new vA;this._promptWaiter=e,await e.promise}}async _processMessages(e){let r;try{for await(let n of e){if(this._checkSessionIdConsistency(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){qc.error(this.ctx,`${jc}: 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._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&&qc.error(this.ctx,`${jc}: 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(fm).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=Sfr(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){qc.error(this.ctx,`${jc}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=dXn(e,r,this._currentTurnInteractionId);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){qc.error(this.ctx,`${jc}: 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 qc.warn(this.ctx,`${jc}: 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 qc.warn(this.ctx,`${jc}: 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||qc.warn(this.ctx,`${jc}: 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??Mt();if(n.signal.aborted)return Promise.resolve({behavior:"deny",message:"Permission request aborted"});let s=eXn(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=rXn(e);if(!n)return{behavior:"deny",message:"AskUserQuestion: invalid input"};try{let o=await Promise.all(n.map(async c=>{let l=Mt(),u=await this._requestUserInputFromIde(l,nXn(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??Mt();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()||(qc.error(this.ctx,`${jc}: 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 qc.info(this.ctx,`${jc}: 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=>{qc.warn(this.ctx,`${jc}: 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(fm).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()||(qc.error(this.ctx,`${jc}: 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=tXn(h,n);qc.info(this.ctx,`${jc}: 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=>{qc.warn(this.ctx,`${jc}: 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()||(qc.error(this.ctx,`${jc}: 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=>{qc.warn(this.ctx,`${jc}: 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:Mt(),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:Mt(),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:Mt(),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:Mt(),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:Mt(),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:Mt(),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 AXn=de(require("http")),yXn=require("node:stream"),Ifr=require("node:stream/promises"),EXn=require("node:string_decoder");Mo();var Bg=new fe("ClaudeMessagesProxyServer"),pVs=["interleaved-thinking","context-management","advanced-tool-use"],Tfr="cls_claude_agent",Fg={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"},hVs=new Map([[400,Fg.InvalidRequest],[401,Fg.Authentication],[402,Fg.Permission],[403,Fg.Permission],[404,Fg.NotFound],[413,Fg.RequestTooLarge],[424,Fg.InvalidRequest],[429,Fg.RateLimit],[466,Fg.InvalidRequest],[529,Fg.Overloaded]]),mXn=1024,mVs=32e3,WX=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-${Mt()}`,r=AXn.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},Bg.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(Bg.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,Fg.NotFound,"Not found")}catch(o){Bg.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,Fg.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=gVs(e.headers,n);if(!o.valid){Bg.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,Fg.Authentication,"Invalid authentication");return}o.sessionId&&Bg.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await IVs(e),c;try{c=JSON.parse(s)}catch(l){Bg.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,Fg.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(tr),u;try{u=await c.getToken()}catch(_){Bg.exception(this.ctx,_,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,Fg.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=ile(this.ctx,u,"v1/messages"),g=yVs(this.ctx,n,d),A;try{({headers:A}=await nle(this.ctx,g,u.token))}catch(_){Bg.exception(this.ctx,_,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,Fg.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,E=a(()=>{y.signal.aborted||(Bg.debug(this.ctx,"client disconnected \u2014 aborting upstream request"),y.abort())},"onClose");o.on("close",E);try{let _=await l.fetch(m,{method:"POST",headers:A,body:h,signal:y.signal});if(ole(this.ctx,_,"v1/messages"),!_.ok){let w=await _.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";Bg.error(this.ctx,`upstream CAPI returned ${_.status} ${_.statusText}: ${R}`),this._sendErrorResponse(o,_.status,xVs(_.status),this._buildTranslatedErrorMessage(_,w,u));return}let v=_.headers.get("content-type")??"text/event-stream";o.writeHead(_.status,{"Content-Type":v,"Cache-Control":"no-cache",Connection:"keep-alive"});let b=_.body();if(!b){o.end();return}let T=v.toLowerCase().includes("text/event-stream");if(s&&T){let w=this.ctx.get(fm),R=wVs(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,Ifr.pipeline)(b,R,o)}else await(0,Ifr.pipeline)(b,o)}catch(_){if(y.signal.aborted){Bg.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(Bg.exception(this.ctx,_,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,Fg.Api,"Upstream request failed")}finally{o.removeListener("close",E)}}async _lookupModelMetadata(e){let r=typeof e.model=="string"?e.model:void 0;if(r)try{return(await this.ctx.get(xs).getMetadata()).find(s=>s.id===r)}catch(n){Bg.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 xfr(e)?(Bg.debug(this.ctx,"stripped output_config.effort for request with unresolved model metadata"),JSON.stringify(e)):r;let s=o?this.ctx.get(fm).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&Bg.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return vVs(e,n,s)?(Bg.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 _Vs(e)?(Bg.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:RVs(r),copilotPlan:n.userInfo?.copilotPlan,suggestSwitchToAuto:!1}:void 0;return $_.translateErrorMessage(o,s,void 0,OU(e),void 0,c)}_buildReasonForStatus(e,r,n){let o=e.status;if(o===402)try{let s=this.ctx.get(Au).overageEnabled;return $_.translate402Reason(r,{retryAfterHeader:e.headers.get("retry-after")??void 0,retryAfterSeconds:OU(e),copilotPlan:n.userInfo?.copilotPlan,isTBBEnabled:n.userInfo?.isTBBEnabled,canUpgradePlan:n.userInfo?.canUpgradePlan,overageEnabled:s})}catch(s){return Bg.exception(this.ctx,s,"._buildReasonForStatus/402"),gXn(r)??"Quota Exceeded."}if(o===400){let s=$_.translate400Reason(r);if(s!==void 0)return s}return gXn(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 gVs(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(gVs,"extractSessionId");function AVs(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&pVs.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(AVs,"filterSupportedBetas");function yVs(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...i0(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?AVs(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=EVs(u,d?rYe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Tfr}/${h}`:`${Tfr}${h.substring(m)}`}else s["User-Agent"]=Tfr;return s}a(yVs,"buildUpstreamHeaders");function EVs(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(EVs,"mergeBetas");function _Vs(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(_Vs,"sanitizeCacheControl");function vVs(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?CVs(t,n,e,r):TVs(t,n):bVs(t,e)}a(vVs,"normalizeThinkingForModel");function CVs(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"},xfr(t),!0)}let u=SVs(n,o),d=mO(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(CVs,"_writeAdaptiveShape");function xfr(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(xfr,"_deleteEffortKey");function bVs(t,e){let r=e.capabilities?.supports?.reasoning_effort;return!!r&&r.length>0?!1:xfr(t)}a(bVs,"_stripUnsupportedThinkingEffort");function SVs(t,e){if(t&&!(!e||!e.includes(t)))return t}a(SVs,"_normaliseUserEffortForCapi");function TVs(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:mXn,o=Math.min(mVs,Math.max(mXn,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(TVs,"_writeLegacyShape");function IVs(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(IVs,"readRequestBody");function xVs(t){return hVs.get(t)??Fg.Api}a(xVs,"mapStatusToAnthropicErrorType");function wVs(t){let e=new EXn.StringDecoder("utf8"),r="",n=0,o=a(s=>{if(!s.startsWith("data:"))return;let c=s.slice(5).trimStart();if(!(!c||c==="[DONE]")&&c.includes("copilot_usage"))try{let u=JSON.parse(c).copilot_usage?.total_nano_aiu;typeof u=="number"&&Number.isFinite(u)&&u>0&&(n=u)}catch{}},"inspectLine");return new yXn.Transform({transform(s,c,l){try{r+=e.write(s);let u=r.indexOf(` +`}a(sVs,"wrapInSystemReminder");p();var hXn=require("crypto");var aVs=new Set(["ExitPlanMode"]);function Tfr(t,e={}){let r=e.timestamp??new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[AXn(r,"synthetic",t.error)];switch(t.type){case"system":return cVs(t,r);case"assistant":return fXn(lVs(t,r,e.streamingEnabled===!0,e.blockCursor,e.interactionId,e.mapModelId),e.suppressedToolUseIds);case"user":return fXn(e.includeUserText===!0?dVs(t,r):uVs(t,r),e.suppressedToolUseIds);case"result":return hVs(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(Tfr,"translate");function fXn(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&&aVs.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(fXn,"dropDedicatedChannelToolEvents");function mXn(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:Lg(),timestamp:o,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${n.index}`,deltaContent:s.text}}];case"thinking_delta":return[{id:Lg(),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(mXn,"translatePartial");function cVs(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:Lg(),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:Lg(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:Lg(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(cVs,"translateSystem");function lVs(t,e,r,n,o,s){let c=t.message?.id??Lg(),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:Lg(),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:Lg(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${c}:${A}`,content:y}});break}case"tool_use":{let y=g;l.push({id:Lg(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof y.id=="string"?y.id:Lg(),toolName:typeof y.name=="string"?y.name:"unknown",arguments:y.input}});break}default:break}}),h.set(c,m),l}a(lVs,"translateAssistant");function uVs(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(gXn(o,e));return n}a(uVs,"translateUserLive");function dVs(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=Mlt(n);return o.length>0&&r.push(pXn(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(gXn(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=Mlt(s);c.length>0&&r.push(pXn(e,c))}}}return r}a(dVs,"translateUserHistory");function gXn(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=mVs(t.content);return{id:Lg(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:Lg(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(gXn,"buildToolExecutionComplete");function pXn(t,e){return{id:Lg(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(pXn,"buildUserMessage");function fVs(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(fVs,"stripSystemReminders");var pVs=/^\[Request interrupted by user[^\]]*\]$/;function Mlt(t){let e=fVs(t);return pVs.test(e)?"":e}a(Mlt,"sanitizeUserText");function hVs(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:Lg(),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(AXn(e,typeof l=="string"?l:"error",f))}return o.push({id:Lg(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(hVs,"translateResult");function AXn(t,e,r){return{id:Lg(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(AXn,"buildSessionError");function mVs(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(mVs,"flattenToolResultContent");function Lg(){return(0,hXn.randomUUID)()}a(Lg,"newId");function yXn(t,e){let r=[],n=new Map,o=new Set,s;for(let c of t){let l=AVs(c);if(!l)continue;(l.type==="user"&&gVs(l)||l.type==="assistant"&&s===void 0)&&(s=Lg());let u=l.type==="assistant"?s:void 0,d=c.timestamp,f=typeof d=="string"?d:void 0;try{r.push(...Tfr(l,{streamingEnabled:!1,includeUserText:!0,blockCursor:n,suppressedToolUseIds:o,timestamp:f,interactionId:u,mapModelId:e}))}catch{}}return r}a(yXn,"translateHistory");function gVs(t){let e=(t.message??{}).content;if(typeof e=="string")return Mlt(e).length>0;if(!Array.isArray(e))return!1;for(let r of e)if(r.type==="text"&&typeof r.text=="string"&&Mlt(r.text).length>0)return!0;return!1}a(gVs,"userMessageStartsInteraction");function AVs(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&yVs(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(AVs,"adaptHistoryMessage");function yVs(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(yVs,"isSyntheticReplayUserMessage");p();var fm=class{constructor(){this._modelBySession=new Map;this._permissionModeBySession=new Map;this._reasoningEffortBySession=new Map;this._copilotUsageNanoAiuBySession=new Map}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){if(!Number.isFinite(r)||r<=0)return;let n=this._copilotUsageNanoAiuBySession.get(e)??0;this._copilotUsageNanoAiuBySession.set(e,n+r)}takeCopilotUsageNanoAiuForSession(e){let r=this._copilotUsageNanoAiuBySession.get(e);return this._copilotUsageNanoAiuBySession.delete(e),r}clear(e){this._modelBySession.delete(e),this._permissionModeBySession.delete(e),this._reasoningEffortBySession.delete(e),this._copilotUsageNanoAiuBySession.delete(e)}};var Olt=de(require("path"));Oo();var qc=new fe("ClaudeCodeAgent.session"),jc="ClaudeCodeSession",sNe=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;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 tme;this._userInputRegistry=new tme;this._exitPlanModeRegistry=new tme;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(fm);if(s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode),this.ctx.get(bn).getCapabilities().agentDebugLog){let c=new hv(this.ctx);c.isEnabled()&&(this._otelTracker=new Nlt(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(fm).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){qc.warn(this.ctx,`${jc}: 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 qc.warn(this.ctx,`${jc}: supportedAgents query failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),[]}}_notifyAgentListChanged(){try{this.ctx.get(a0).notify("agent").catch(e=>{qc.warn(this.ctx,`${jc}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})})}catch(e){qc.warn(this.ctx,`${jc}: 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){qc.info(this.ctx,`${jc}: setPermissionMode skipped (undefined preserves existing)`,{sessionId:this.sessionId,existingMode:this._permissionMode});return}let r=e??"default";if(this._permissionMode=r,this.ctx.get(fm).setPermissionModeForSession(this.sessionId,r),this._query)try{await this._query.setPermissionMode(r),qc.info(this.ctx,`${jc}: setPermissionMode propagated to live Query`,{sessionId:this.sessionId,effectiveMode:r})}catch(n){qc.warn(this.ctx,`${jc}: 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){qc.warn(this.ctx,`${jc}: interrupt() failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}dispose(){if(this._disposed)return;this._disposed=!0,this._dropAllPending("disposed"),this._abortController.abort(),this.ctx.get(fm).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=>{qc.warn(this.ctx,`${jc}: 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(fm).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(fm).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new vA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1,this._currentTurnInteractionId=Mt();let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{qc.info(this.ctx,`${jc}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),qc.info(this.ctx,`${jc}.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 dXn(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??Mt()};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=Ft(this.ctx,Ye.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await eme.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(qc.warn(this.ctx,`${jc}: ${o.message}`,{sessionId:this.sessionId}),this.notificationSender.showWarningMessageOnlyOnce("claude.cliVersionMismatch",o.message));let s={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()}},systemPrompt:{type:"preset",preset:"claude_code"},settingSources:["user","project","local"],...B$t(this.ctx)?{}:{skills:[]},disallowedTools:["WebSearch"],canUseTool:this._handleCanUseTool,thinking:{type:"adaptive"},includePartialMessages:!0,allowDangerouslySkipPermissions:!0,...this._model&&{model:this._model},...this._permissionMode&&{permissionMode:this._permissionMode},...r?{resume:this.sessionId}:{sessionId:this.sessionId}},c=await this.sdkWrapper.query({prompt:this._createPromptIterable(),options:s});this._query=c,this._isResumed=!0,this._notifyAgentListChanged(),qc.info(this.ctx,`${jc}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(c).catch(l=>{qc.error(this.ctx,`${jc}: consume loop crashed`,{sessionId:this.sessionId,error:l instanceof Error?l.message:String(l)})})}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(AF).resolvePath();return`${Olt.dirname(e)}${Olt.delimiter}${process.env.PATH??""}`}catch(e){return qc.warn(this.ctx,`${jc}: bundled ripgrep unavailable, falling back to process PATH`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),process.env.PATH??""}}async*_createPromptIterable(){for(;!this._disposed;){if(this._pendingPromptInput){let r=this._pendingPromptInput;this._pendingPromptInput=void 0,yield r;continue}let e=new vA;this._promptWaiter=e,await e.promise}}async _processMessages(e){let r;try{for await(let n of e){if(this._checkSessionIdConsistency(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){qc.error(this.ctx,`${jc}: 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._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&&qc.error(this.ctx,`${jc}: 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(fm).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=Tfr(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){qc.error(this.ctx,`${jc}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=mXn(e,r,this._currentTurnInteractionId);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){qc.error(this.ctx,`${jc}: 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 qc.warn(this.ctx,`${jc}: 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 qc.warn(this.ctx,`${jc}: 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||qc.warn(this.ctx,`${jc}: 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??Mt();if(n.signal.aborted)return Promise.resolve({behavior:"deny",message:"Permission request aborted"});let s=nXn(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=oXn(e);if(!n)return{behavior:"deny",message:"AskUserQuestion: invalid input"};try{let o=await Promise.all(n.map(async c=>{let l=Mt(),u=await this._requestUserInputFromIde(l,sXn(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??Mt();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()||(qc.error(this.ctx,`${jc}: 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 qc.info(this.ctx,`${jc}: 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=>{qc.warn(this.ctx,`${jc}: 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(fm).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()||(qc.error(this.ctx,`${jc}: 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=iXn(h,n);qc.info(this.ctx,`${jc}: 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=>{qc.warn(this.ctx,`${jc}: 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()||(qc.error(this.ctx,`${jc}: 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=>{qc.warn(this.ctx,`${jc}: 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:Mt(),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:Mt(),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:Mt(),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:Mt(),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:Mt(),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:Mt(),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 vXn=de(require("http")),CXn=require("node:stream"),xfr=require("node:stream/promises"),bXn=require("node:string_decoder");Oo();var Bg=new fe("ClaudeMessagesProxyServer"),EVs=["interleaved-thinking","context-management","advanced-tool-use"],Ifr="cls_claude_agent",Fg={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"},_Vs=new Map([[400,Fg.InvalidRequest],[401,Fg.Authentication],[402,Fg.Permission],[403,Fg.Permission],[404,Fg.NotFound],[413,Fg.RequestTooLarge],[424,Fg.InvalidRequest],[429,Fg.RateLimit],[466,Fg.InvalidRequest],[529,Fg.Overloaded]]),EXn=1024,vVs=32e3,WX=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-${Mt()}`,r=vXn.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},Bg.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(Bg.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,Fg.NotFound,"Not found")}catch(o){Bg.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,Fg.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=CVs(e.headers,n);if(!o.valid){Bg.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,Fg.Authentication,"Invalid authentication");return}o.sessionId&&Bg.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await DVs(e),c;try{c=JSON.parse(s)}catch(l){Bg.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,Fg.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(nr),u;try{u=await c.getToken()}catch(_){Bg.exception(this.ctx,_,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,Fg.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=ile(this.ctx,u,"v1/messages"),g=SVs(this.ctx,n,d),A;try{({headers:A}=await nle(this.ctx,g,u.token))}catch(_){Bg.exception(this.ctx,_,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,Fg.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,E=a(()=>{y.signal.aborted||(Bg.debug(this.ctx,"client disconnected \u2014 aborting upstream request"),y.abort())},"onClose");o.on("close",E);try{let _=await l.fetch(m,{method:"POST",headers:A,body:h,signal:y.signal});if(ole(this.ctx,_,"v1/messages"),!_.ok){let w=await _.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";Bg.error(this.ctx,`upstream CAPI returned ${_.status} ${_.statusText}: ${R}`),this._sendErrorResponse(o,_.status,NVs(_.status),this._buildTranslatedErrorMessage(_,w,u));return}let v=_.headers.get("content-type")??"text/event-stream";o.writeHead(_.status,{"Content-Type":v,"Cache-Control":"no-cache",Connection:"keep-alive"});let b=_.body();if(!b){o.end();return}let T=v.toLowerCase().includes("text/event-stream");if(s&&T){let w=this.ctx.get(fm),R=MVs(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,xfr.pipeline)(b,R,o)}else await(0,xfr.pipeline)(b,o)}catch(_){if(y.signal.aborted){Bg.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(Bg.exception(this.ctx,_,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,Fg.Api,"Upstream request failed")}finally{o.removeListener("close",E)}}async _lookupModelMetadata(e){let r=typeof e.model=="string"?e.model:void 0;if(r)try{return(await this.ctx.get(xs).getMetadata()).find(s=>s.id===r)}catch(n){Bg.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 wfr(e)?(Bg.debug(this.ctx,"stripped output_config.effort for request with unresolved model metadata"),JSON.stringify(e)):r;let s=o?this.ctx.get(fm).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&Bg.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return xVs(e,n,s)?(Bg.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 IVs(e)?(Bg.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:OVs(r),copilotPlan:n.userInfo?.copilotPlan,suggestSwitchToAuto:!1}:void 0;return V_.translateErrorMessage(o,s,void 0,LU(e),void 0,c)}_buildReasonForStatus(e,r,n){let o=e.status;if(o===402)try{let s=this.ctx.get(Au).overageEnabled;return V_.translate402Reason(r,{retryAfterHeader:e.headers.get("retry-after")??void 0,retryAfterSeconds:LU(e),copilotPlan:n.userInfo?.copilotPlan,isTBBEnabled:n.userInfo?.isTBBEnabled,canUpgradePlan:n.userInfo?.canUpgradePlan,overageEnabled:s})}catch(s){return Bg.exception(this.ctx,s,"._buildReasonForStatus/402"),_Xn(r)??"Quota Exceeded."}if(o===400){let s=V_.translate400Reason(r);if(s!==void 0)return s}return _Xn(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 CVs(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(CVs,"extractSessionId");function bVs(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&EVs.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(bVs,"filterSupportedBetas");function SVs(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...i0(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?bVs(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=TVs(u,d?oYe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Ifr}/${h}`:`${Ifr}${h.substring(m)}`}else s["User-Agent"]=Ifr;return s}a(SVs,"buildUpstreamHeaders");function TVs(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(TVs,"mergeBetas");function IVs(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(IVs,"sanitizeCacheControl");function xVs(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?wVs(t,n,e,r):PVs(t,n):RVs(t,e)}a(xVs,"normalizeThinkingForModel");function wVs(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"},wfr(t),!0)}let u=kVs(n,o),d=mO(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(wVs,"_writeAdaptiveShape");function wfr(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(wfr,"_deleteEffortKey");function RVs(t,e){let r=e.capabilities?.supports?.reasoning_effort;return!!r&&r.length>0?!1:wfr(t)}a(RVs,"_stripUnsupportedThinkingEffort");function kVs(t,e){if(t&&!(!e||!e.includes(t)))return t}a(kVs,"_normaliseUserEffortForCapi");function PVs(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:EXn,o=Math.min(vVs,Math.max(EXn,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(PVs,"_writeLegacyShape");function DVs(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(DVs,"readRequestBody");function NVs(t){return _Vs.get(t)??Fg.Api}a(NVs,"mapStatusToAnthropicErrorType");function MVs(t){let e=new bXn.StringDecoder("utf8"),r="",n=0,o=a(s=>{if(!s.startsWith("data:"))return;let c=s.slice(5).trimStart();if(!(!c||c==="[DONE]")&&c.includes("copilot_usage"))try{let u=JSON.parse(c).copilot_usage?.total_nano_aiu;typeof u=="number"&&Number.isFinite(u)&&u>0&&(n=u)}catch{}},"inspectLine");return new CXn.Transform({transform(s,c,l){try{r+=e.write(s);let u=r.indexOf(` `);for(;u!==-1;){let d=r.slice(0,u).replace(/\r$/,"");r=r.slice(u+1),o(d),u=r.indexOf(` -`)}}catch{}l(null,s)},flush(s){try{r+=e.end(),r&&o(r.replace(/\r$/,"")),n>0&&t(n)}catch{}s()}})}a(wVs,"createCopilotUsageSniffer");function gXn(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(gXn,"extractErrorMessage");function RVs(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(RVs,"extractErrorCode");p();function _Xn(t){return t.replace(/[-.]/g,"").toLowerCase()}a(_Xn,"normalizeModelId");function vXn(t,e){if(!t||e.some(s=>s.id===t))return t;let r=t.replace(/-\d{8}$/,""),n=_Xn(r);return e.find(s=>_Xn(s.id)===n)?.id??t}a(vXn,"mapCapiModelIdToPickerId");Mo();var Ug=new fe("ClaudeCodeAgent"),Qg="ClaudeCodeAgentService";function kVs(t){return{id:`claude-code:/agents/${encodeURIComponent(t.name)}`,name:t.name,description:t.description,providers:["CLAUDE"],invokePolicy:PUt,isReadonly:!0,isBuiltIn:!0}}a(kVs,"toRuntimeClaudeAgent");var y8=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this.notificationSender=e.get(ts);try{this.runtimeSourceRegistration=e.get(Ld).registerRuntimeAgentSource({provider:"CLAUDE",getAgents:a(async n=>(await this.getSupportedAgentsForWorkspace(n)).map(kVs),"getAgents")})}catch(n){if(!(n instanceof bl&&n.ctor===Ld))throw n}}static{a(this,"ClaudeCodeAgentService")}async getSupportedAgentsForWorkspace(e){let r=new Set(e.map(c=>lg(un(c.uri)))),n=[...this._sessions.values()].filter(c=>r.has(lg(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()]}async createSession(e){return kb(this.ctx,"claudeCodeAgent.createSession",async r=>{await qZn(this.ctx,e);let n=e.sessionId??Mt(),o=this._sessions.get(n);if(o)return Ug.info(this.ctx,`${Qg}.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 iNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,isNewSession:!0,proxyConfig:c});return this._sessions.set(n,l),Ug.info(this.ctx,`${Qg}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return kb(this.ctx,"claudeCodeAgent.resumeSession",async r=>{await jZn(this.ctx,e);let{sessionId:n}=e,o,s,c=this._sessions.get(n);if(c)Ug.info(this.ctx,`${Qg}.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 iNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:d,model:e.model,isNewSession:!1,proxyConfig:f});this._sessions.set(n,h),Ug.info(this.ctx,`${Qg}.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(xs).getMetadata().catch(m=>(Ug.debug(this.ctx,`${Qg}.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=hXn(f,m=>vXn(m,h)),r.properties.transcriptOk="true"}catch(u){Ug.warn(this.ctx,`${Qg}.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 kb(this.ctx,"claudeCodeAgent.sendMessage",async n=>{await HZn(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:Ks(s.cwd)};await this.ctx.get(Cg).applyPromptTemplateToRequest(e,[c]);let l=Mt(),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=>{Ug.warn(this.ctx,`${Qg}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),Vn(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"))}async listSessions(e){return kb(this.ctx,"claudeCodeAgent.listSessions",async r=>{VZn(this.ctx,e),Ug.info(this.ctx,`${Qg}.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 Ug.info(this.ctx,`${Qg}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return kb(this.ctx,"claudeCodeAgent.listModels",async r=>{WZn(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),Ug.info(this.ctx,`${Qg}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(xs).getMetadata(e)).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>w$e(c.capabilities.family)).map(Drt);return Ug.info(this.ctx,`${Qg}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await kb(this.ctx,"claudeCodeAgent.stopSession",async r=>{GZn(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){Ug.info(this.ctx,`${Qg}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return kb(this.ctx,"claudeCodeAgent.destroySession",r=>{$Zn(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this._sessions.delete(n),Ug.info(this.ctx,`${Qg}.destroySession`,{sessionId:n}),{success:!0}):(Ug.info(this.ctx,`${Qg}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return Ug.error(this.ctx,`${Qg}.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 kb(this.ctx,"claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){Ug.info(this.ctx,`${Qg}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await rNe(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await kb(this.ctx,"claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){Ug.info(this.ctx,`${Qg}.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 Ug.warn(this.ctx,`${Qg}.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;for(let e of this._sessions.values())e.dispose();this._sessions.clear()}async _ensureProxyConfig(){return this.ctx.get(WX).start()}};p();var wfr=new Cn;function CXn(t){return[...t].sort((e,r)=>{let n=wfr.get(e.uri)??0;return(wfr.get(r.uri)??0)-n})}a(CXn,"sortByAccessTimes");var bXn=a(t=>t.get($r).onDidFocusTextDocument(e=>{e.document&&wfr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var SXn=de(require("events"));var Olt="CompletionRequested",t4=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new SXn.default;notifyRequest(e,r,n,o,s){return this.#e.emit(Olt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=z0(this.ctx,e,`event.${Olt}`);return this.#e.on(Olt,r),Fn.Disposable.create(()=>this.#e.off(Olt,r))}};p();p();var Rfr=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?.()}},Llt=class extends Rfr{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 Pb=class{constructor(e){this.ctx=e;this.#e=new fe("AsyncCompletionManager");this.requests=new Cn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(kfr(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 Llt;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(Zt).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 vA,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(kfr(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)kfr(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 kfr(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(kfr,"isCandidate");p();p();var sNe=class{constructor(e){this.maxSize=e;this.root=new oNe;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 oNe;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 oNe;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 sNe(100)}};p();var Db=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&&TXn(this.choices[0].completionText,n))return PVs(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 PVs(t,e){return t.filter(r=>TXn(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(PVs,"adjustChoicesStart");function TXn(t,e){return t.startsWith(e)&&t.length>e.length}a(TXn,"startsWithAndExceeds");p();p();var E8={" ":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 IXn(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 E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.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 b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.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 P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.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 L;t[308]>1e-35?L=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?L=.023223358334607133:L=-.04383410185346742:L=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?L=.023406489302867494:L=-.085521220804058:L=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?L=.028120059780969632:L=-.04211009474298743:t[294]>1e-35?L=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?L=-.0993035220737934:L=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?L=.029770210551187937:L=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?L=.06421359317599738:L=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?L=.024368404612215164:L=-.04045232374803373:t[131]>1e-35?L=.017372701982485795:t[120]>1e-35?L=.08812710275150198:t[18]>1e-35?t[90]>1e-35?L=.18451364351180236:t[7]>33.50000000000001?L=-.03850813130183531:t[195]>1e-35?L=.06966114053446336:t[3]>16.500000000000004?L=-.0012869181693341211:t[0]>4242.500000000001?L=-.054625548611291035:L=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?L=.006302103427145562:L=.13967622319898698:t[121]>1e-35?L=-.038798585213145644:t[5]>4544.500000000001?L=-.08050498033009466:L=-.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 O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let j;t[0]>384.50000000000006?t[84]>1e-35?j=-.06088131453064195:t[147]>1e-35?j=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?j=.04219361472548491:j=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?j=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?j=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?j=-.11431764534511478:j=.013549717238356157:j=-.020987333767091276:t[6]>2.5000000000000004?j=-.02914877855133127:j=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?j=-.10087072787978416:t[37]>1e-35?j=-.030467397753331196:t[229]>1e-35?j=-.1017559811057469:t[4]>20.500000000000004?j=-.00413177742240167:t[20]>1e-35?j=.05213315982685969:j=.0037921635866823133:t[8]>51.50000000000001?j=.07327913092421544:t[6]>49.50000000000001?j=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?j=.02744420891894289:j=.11288946357194463:j=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?j=-.012329314369909049:j=.026816658655600168:j=-.0872405354618811:j=.007872673500247845:t[1]>42.50000000000001?j=-.04309044198258254:t[145]>1e-35?j=.07572529147860785:t[7]>5.500000000000001?j=-.013837187093264945:t[1]>17.500000000000004?j=.04208698439539668:j=-.06284346769019863;let Q;t[294]>1e-35?Q=-.0384794324818203:t[266]>1e-35?Q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?Q=.07432960094940501:Q=-.035248735855751855:t[134]>1e-35?Q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?Q=-.01706896375068821:Q=.08212247914968074:t[2]>59.50000000000001?Q=-.09546478958824225:t[6]>53.50000000000001?Q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?Q=.02816463285971267:Q=.15449139016588445:Q=-.10199787406123524:Q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?Q=-.13924786681478077:Q=-.0072772442570213335:t[39]>1e-35?Q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?Q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?Q=-.11174465335620831:Q=.00013144040097180107:Q=-.08493919336681105:t[42]>1e-35?Q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?Q=-.015540659878839153:Q=-.14442609417300142:t[21]>1e-35?Q=-.025251979447574083:Q=.0023698372645272847:t[18]>1e-35?Q=.07269739695712212:t[8]>2592.5000000000005?Q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?Q=-.01835130329646532:t[9]>45.50000000000001?Q=.02023047454629885:Q=.16469378262221102:Q=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.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?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.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 ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Ue;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Ue=.009769895322846493:Ue=-.10620052926943656:t[9]>19.500000000000004?Ue=.03781202525403449:t[9]>14.500000000000002?Ue=-.11485785321365344:t[9]>6.500000000000001?Ue=.07677177833073881:t[0]>4342.500000000001?Ue=-.07079285609687631:t[49]>1e-35?Ue=.06156814809246001:Ue=-.014788509042554625:Ue=-.032659201618470655:t[5]>5207.500000000001?Ue=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Ue=-.03094160322187924:t[1]>29.500000000000004?Ue=.09474646043921069:Ue=.023445783928231618:Ue=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Ue=-.07164443768784848:t[1]>29.500000000000004?Ue=.089473622509272:t[8]>597.5000000000001?Ue=-.08155349903101317:Ue=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Ue=-.004003900679358653:t[190]>1e-35?Ue=-.09236113461485262:t[8]>3198.5000000000005?Ue=-.0124130160451179:Ue=.018453070064009328:t[15]>1e-35?Ue=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Ue=-.0009580759587680961:Ue=-.03227283036698222:Ue=.01369287669536875:t[1]>50.50000000000001?Ue=-.04213060332500437:t[35]>1e-35?Ue=-.11508095777767471:t[190]>1e-35?Ue=-.08611884672400155:t[297]>1e-35?Ue=.05723551879433584:Ue=-.004829340082311461;let ke;t[183]>1e-35?ke=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?ke=-.11753465135886734:ke=-.007515490299047085:ke=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?ke=-.12371142493530439:t[1]>36.50000000000001?ke=.032189417575190435:ke=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?ke=-.0784518658439288:t[2]>54.50000000000001?ke=.12477882322370665:ke=.000313468482399738:ke=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?ke=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?ke=.0353146070135579:ke=-.06327619611098285:ke=.02813577701641991:ke=-.12354390728506215:t[34]>1e-35?ke=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?ke=-.01245803535276381:ke=-.07169472553475001:t[1]>11.500000000000002?ke=.12989984824561698:ke=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?ke=.010390226893521422:t[10]>14.500000000000002?ke=.16790888126487719:ke=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?ke=-.043398307129729134:ke=.09963544907820426:t[9]>30.500000000000004?ke=-.13540713124984502:t[9]>17.500000000000004?ke=.0509435850590757:ke=-.04761897852404613:t[4]>78.50000000000001?ke=.09197086656470652:ke=.0006771050176682337;let X;t[122]>1e-35?t[6]>36.50000000000001?X=.05686884451670743:X=-.05334759543084309:t[266]>1e-35?X=-.08603579519816038:t[157]>1e-35?X=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?X=-.0499592651503952:t[0]>725.5000000000001?X=.11780353905132664:X=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?X=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?X=-.03190157229022304:X=.07985197845805492:X=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?X=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?X=-.027174047777029083:X=.057117284879796476:t[3]>43.50000000000001?X=-.0016147040913107311:X=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?X=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?X=-.01466076988151239:X=.13375695925484857:X=-.04885873081899647:t[0]>5566.500000000001?X=.11086813028591343:t[8]>992.5000000000001?X=-.07622304217072383:X=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?X=.03285858361708423:X=-.12354858211764992:X=.0672788301823281:t[15]>1e-35?X=.08658836986585006:X=-.02741484278509758:t[290]>1e-35?X=-.08161310335133287:t[135]>1e-35?X=-.04824156054814152:X=.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 Z;t[179]>1e-35?Z=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?Z=.1470294450403005:Z=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?Z=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?Z=.07965955447707423:t[10]>10.500000000000002?Z=-.09236156404262426:Z=.03396273196231458:Z=-.13246465021467432:Z=.07092822261735353:Z=-.08753829085942:Z=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?Z=.004705878789890202:Z=.13775378964952867:Z=-.04770928980587811:t[10]>29.500000000000004?Z=.011221519891071544:t[0]>3853.5000000000005?Z=.06365381191628273:Z=.15506252245336827:t[1]>37.50000000000001?Z=-.07254777021042061:Z=.026514587757252385:t[308]>1e-35?Z=.04115804816617256:t[10]>26.500000000000004?Z=.02077721353011946:t[5]>3548.5000000000005?Z=-.1280907116663952:Z=-.021974774274438:t[306]>1e-35?Z=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?Z=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?Z=-.005710865560475598:t[94]>1e-35?Z=-.06751507982853555:Z=.027250040757588703:t[9]>52.50000000000001?Z=.07060357924595577:Z=-.030297760713011795:Z=-.0006005400085266517;let ue;t[113]>1e-35?ue=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ue=-.06996356565314456:ue=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ue=-.08317707559926495:t[21]>1e-35?ue=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ue=-.010538203005984922:ue=.08454819465349446:t[9]>124.50000000000001?ue=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ue=-.08542251249346582:t[9]>50.50000000000001?ue=-.023428882537657472:ue=.010042500833979073:ue=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ue=.03006025206979096:t[9]>108.50000000000001?ue=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ue=.04222035773042132:ue=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ue=-.07209095448054853:ue=.028065954981903313:ue=.08714651929917122:ue=-.006678820669279169:t[10]>40.50000000000001?ue=.006982396294941626:ue=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ue=-.09351114982645548:t[4]>3.5000000000000004?ue=-.004837550129223451:ue=-.08324141237464677:t[303]>1e-35?ue=.10703037493990825:t[9]>156.50000000000003?ue=-.10803018621648303:t[116]>1e-35?ue=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ue=.10261721665006701:ue=.018994509090668264:ue=.0011244262442038839;let qe;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?qe=-.08404263465005328:t[0]>3682.5000000000005?qe=.041259223920298876:t[1]>29.500000000000004?qe=-.09541257493441671:qe=.001482192721625409:qe=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?qe=-.08268996098437432:t[230]>1e-35?qe=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?qe=-913218977737457e-19:t[4]>10.500000000000002?qe=-.056334165674005156:t[127]>1e-35?qe=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?qe=-.04231200150318989:t[10]>42.50000000000001?qe=.10182973257894812:qe=.015934763950068445:qe=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?qe=-.041117068322885315:qe=.1167767830037126:qe=.13611206992387337:t[10]>41.50000000000001?qe=-.07120286010564107:qe=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?qe=-.07702290997669524:t[198]>1e-35?qe=.08776558554437136:qe=-.008290740324975692:t[2]>32.50000000000001?qe=.07198457624219955:qe=.005463113714361629:qe=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?qe=.03295785445437507:qe=.15140250150674536:qe=-.035613213948910254:t[186]>1e-35?qe=.06849425535860769:t[96]>1e-35?qe=.06028225812727254:qe=-.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 ce;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ce=-.01386103677247845:ce=.11386694333005128:t[4]>27.500000000000004?ce=-.021862617610091336:t[2]>31.500000000000004?ce=.0828858469030438:ce=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ce=.11303635767048735:ce=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ce=-.04238798044549342:ce=.022091190130494303:t[5]>5082.500000000001?ce=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ce=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ce=-.04291104140431434:t[17]>1e-35?ce=.11256797532342613:ce=-.017206916368289193:ce=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ce=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ce=.03581712466863222:ce=.14770264307668884:t[8]>73.50000000000001?ce=-.13093289429740068:ce=.042461737442702936:t[52]>1e-35?ce=.0501831919044939:ce=-.010450249720465756:ce=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ce=.0005381332165438493:ce=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ce=.04849637311285226:ce=-.036671377119808564:t[0]>421.50000000000006?ce=.00020968499911058945:ce=.11636422423182405:ce=-.12687837788222575:ce=.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 we;t[294]>1e-35?t[10]>50.50000000000001?we=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?we=-.06063239096209816:we=.03317022411417386:we=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?we=-.013608609329298802:we=.09078000157330264:t[99]>1e-35?we=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?we=-.07536137260189814:we=.006253266595455118:t[10]>28.500000000000004?we=-.006106041147592768:t[9]>156.50000000000003?we=-.11828932797811101:t[94]>1e-35?we=-.02566078479505714:t[303]>1e-35?we=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?we=-.08401252789168523:t[5]>4244.500000000001?we=.026372887658499107:t[1]>16.500000000000004?we=-.027836756345634026:we=.09205362097909099:we=.00934612788718244:t[203]>1e-35?we=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?we=-.09580979052540028:t[1]>50.50000000000001?we=-.06402211827281554:we=.08342858760095972:t[2]>36.50000000000001?we=.008114897658204584:t[92]>1e-35?we=.09541587072672864:we=-.022342147210555434:we=-.01660492519175128:we=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?we=.15846731118501817:we=.039498507912023195:t[245]>1e-35?we=.07008718676813333:we=.0019806389728814727;let Be;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Be=-.01192072916082109:Be=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Be=.06874032717466054:t[4]>40.50000000000001?Be=-.07752510020707537:t[1]>76.50000000000001?Be=-.09944032260703917:t[8]>1381.5000000000002?Be=-.054466635810800745:t[1]>32.50000000000001?Be=.05974084520839573:Be=-.0384718740755954:Be=-.11374190719134032:t[0]>2151.5000000000005?Be=-.13703645155803298:Be=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Be=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Be=.013539805885738608:Be=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Be=.09941880179344399:Be=-.01608127391210995:Be=.08025226531247417:t[9]>67.50000000000001?Be=.13525448212444113:t[6]>61.50000000000001?Be=-.05511099182158894:t[94]>1e-35?Be=-.06821509831783572:t[128]>1e-35?Be=.11361314817714643:Be=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Be=-.09954181329804547:t[197]>1e-35?Be=.10102833149755386:t[188]>1e-35?Be=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Be=-.03781554214742005:Be=.09927933385592314:Be=-.020006000056720083:Be=-.10520473615957895:Be=-.12006990846253787:Be=-.00026111570975317574;let rt;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?rt=-.019188245509744628:rt=-.13354864350075848:t[0]>2461.5000000000005?rt=.051885477468354396:rt=-.0833581968852119:rt=.08233441701532287:rt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?rt=.09926337893072812:rt=-.027753610497327715:t[0]>1972.5000000000002?rt=-.09780045823152517:rt=.032380915168504935:rt=.11502632261226381:t[17]>1e-35?rt=-.06094965899579662:t[10]>40.50000000000001?rt=-.07500475582440802:rt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?rt=-.09584538995220808:rt=-.00908705814304442:rt=.03203281520813893:t[10]>49.50000000000001?rt=-.03146271513986384:t[2]>63.50000000000001?rt=.13172001315536286:t[224]>1e-35?rt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?rt=.09521549382082259:rt=-.04414925613522197:t[0]>1847.5000000000002?rt=-.09118580379557353:rt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?rt=.03525144509943896:rt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?rt=-.04766112322938157:t[2]>10.500000000000002?rt=.0728516504357201:rt=-.05049625965272536:rt=-.10868663055825774:rt=.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 _t;t[115]>1e-35?_t=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?_t=-.10131179514695865:t[8]>938.5000000000001?_t=.10203729808015481:_t=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?_t=.03574015165562999:_t=-.07763042506449493:_t=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?_t=.0665706259130275:_t=-.06586817559309924:_t=.11925564412287476:_t=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?_t=.046017146627455346:_t=-.08623321630086885:t[8]>1765.5000000000002?_t=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?_t=.11143827902215087:_t=-.01817808730473413:_t=.16980985030210127:_t=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?_t=.010168994879727824:_t=-.09099594488792513:t[9]>1.5000000000000002?_t=.0533459678147928:_t=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?_t=-.062346959148773695:t[1]>47.50000000000001?_t=-.0021578343835599316:t[2]>27.500000000000004?_t=.19567373210166172:_t=.07851555379116423:t[18]>1e-35?_t=.03711549097804649:t[8]>359.50000000000006?_t=.012492346746905587:t[4]>20.500000000000004?_t=.047511695735697544:_t=-.07999269063948773:_t=6802045404471004e-20;let Dt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Dt=.0011484728213539738:Dt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Dt=-.09828874964938798:t[8]>1586.5000000000002?Dt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Dt=.011938269926919522:Dt=.17541983715953954:t[19]>1e-35?Dt=.023002786011088672:Dt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Dt=.06508934844183291:Dt=-.10168553534835639:Dt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Dt=.021140806225203937:Dt=-.1167833342453639:t[2]>33.50000000000001?Dt=.13163585734056618:Dt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Dt=.06314479201263888:Dt=-.09639088327091713:t[10]>29.500000000000004?Dt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Dt=40577156464836036e-21:Dt=.12322387121810757:Dt=-.03697224045046014:t[1]>22.500000000000004?Dt=.016474835887320276:Dt=.16919298733903063:Dt=.07633203630214054:Dt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Dt=.14150493354700563:Dt=-.01831155354975749:t[1]>28.500000000000004?Dt=-.07952557178685365:t[10]>28.500000000000004?Dt=.0665695554984927:Dt=-.053640139319277094:Dt=.0004754840665898665;let $t;t[76]>1e-35?$t=-.06814884255939921:t[179]>1e-35?$t=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?$t=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?$t=.004193658608848433:$t=-.1066968975983452:t[8]>302.50000000000006?$t=.05476730110440451:$t=-.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?$t=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?$t=.013555772109446666:$t=-.09856116699770784:$t=.0284329611813383:t[2]>52.50000000000001?$t=.04008708444763762:t[9]>29.500000000000004?$t=-.1289599546008197:$t=-.018566534248335896:t[8]>747.5000000000001?$t=.02236484980076122:$t=.1148871655157582:t[8]>3084.0000000000005?$t=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?$t=.03164751204281298:$t=.11752140436184891:t[9]>42.50000000000001?$t=-.07180559595410106:t[22]>1e-35?$t=.09325040416256854:$t=-.016041122807939914:$t=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?$t=-.010718250133458515:$t=.09818827994853763:$t=.010180038981174032:$t=-.039472162599295535:t[9]>170.50000000000003?$t=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?$t=-.08674788057474031:$t=.02077653508548371:$t=-.0003536561382007414;let Gt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?Gt=.018337297491457794:Gt=-.05926206443180149:Gt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?Gt=.10747078482128616:t[126]>1e-35?Gt=-.10550625192391357:t[7]>71.50000000000001?Gt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?Gt=.1317396472229434:Gt=-.025035791351328947:Gt=-.0728334305864372:t[8]>963.5000000000001?Gt=.023642201723096064:Gt=.183010326734258:t[128]>1e-35?Gt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?Gt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?Gt=-.1088876900335281:Gt=.02758317023002635:Gt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?Gt=-.01928020117446408:Gt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?Gt=.07893723375925096:Gt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?Gt=-.10301657587280551:Gt=.005787463140224318:Gt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?Gt=-.019296977889522397:Gt=-.07274529751752634:t[1]>30.500000000000004?Gt=-.050368901143148286:Gt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?Gt=.0015332402792773946:Gt=.09930153676749967:Gt=-.06370844564357069:Gt=.00042272155209927616;let Ie;t[71]>1e-35?t[4]>17.500000000000004?Ie=.12586844370423247:Ie=-.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?Ie=-.08474891624263797:t[8]>125.50000000000001?Ie=.08125086980439704:Ie=-.04082085238068532:t[0]>3863.5000000000005?Ie=.020481535807469208:Ie=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ie=-.019110200161573936:Ie=-.12387719685855114:t[0]>1102.5000000000002?Ie=.08376595701957407:Ie=-.031821919580524834:t[9]>4.500000000000001?Ie=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ie=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ie=.1349841206807871:Ie=.011864053595560297:t[1]>41.50000000000001?Ie=-.08203662486612544:t[2]>18.500000000000004?Ie=-.009541865642346947:Ie=.08345043168501759:t[2]>10.500000000000002?Ie=-.09585031818030947:Ie=.019432330487099865:Ie=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ie=.11951517733981365:Ie=-.016651014735738538:t[1]>28.500000000000004?Ie=-.07410922545030711:t[10]>28.500000000000004?Ie=.05886430683844788:Ie=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ie=.04802269879144705:Ie=-.026208212831796737:t[4]>45.50000000000001?Ie=-.03227476944664786:Ie=.05124575625622705:Ie=.00020506696916003137;let F;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?F=-.03042091758483443:t[10]>14.500000000000002?F=.09816619204768777:F=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?F=-.02381165060401718:F=-.10950361804974783:F=.03538211665111128:t[212]>1e-35?t[19]>1e-35?F=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?F=-.06371052144380579:F=.0835500621252692:F=-.10408255929333915:t[1]>74.50000000000001?F=.13208968122712403:t[1]>64.50000000000001?F=-.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?F=.09922816902423433:F=.016366955328796718:F=.1592412560903584:t[1]>39.50000000000001?F=.05409467990258923:F=-.08260633210459611:F=-.06307205775247567:t[9]>36.50000000000001?F=.040253940015648144:F=.14202568969471283:F=-.028761848341594044:F=.08994073058773508:t[0]>807.5000000000001?F=-.043427848826323195:F=.04573516446846493:t[20]>1e-35?t[188]>1e-35?F=-.0758877731600639:t[23]>1e-35?F=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?F=.08124700978741987:F=.013296063087086852:t[7]>5.500000000000001?F=-.01640196088612987:F=-.12685498840146067:F=-.0004940792382459551;let be;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?be=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?be=.08513773825688947:be=-.1184664832315282:be=.05676963535893477:be=.14263843210340613:be=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?be=-.10669720555606924:be=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?be=.0664744575868955:be=-.08469256188890871:be=-.026746678040592144:t[281]>1e-35?be=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?be=.012131807587207655:be=-.12776015795398743:be=.04320472481083551:be=.08390980661550446:t[10]>227.50000000000003?be=-.09771783809101153:t[10]>130.50000000000003?be=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?be=-.07610698254064358:t[8]>902.5000000000001?be=-.03136381213599649:t[131]>1e-35?be=.0704821739127936:t[224]>1e-35?be=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?be=.10431473040024908:t[8]>841.5000000000001?be=.07304745320500514:be=-.038011541882439825:be=-.01679746695007364:t[0]>3129.5000000000005?be=.05589952587431965:t[210]>1e-35?be=.06227198085800842:be=-.0011341890997947812:t[8]>740.5000000000001?be=.04817300084412584:be=-.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 pe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.07554189644995735:pe=-.052089349455904946:pe=-.10148206848169845:t[113]>1e-35?pe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?pe=.07172653627995676:pe=-.07602959317610998:pe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?pe=-.0399322883690891:pe=.06523495517476098:pe=-.10358715295743802:t[193]>1e-35?pe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?pe=.015928764772252406:pe=.1341513061552287:pe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?pe=-.033592997607280156:pe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?pe=-.08402551858097379:pe=.017401984506038796:t[1]>25.500000000000004?pe=.13337205393591278:pe=-.01160208350090984:pe=.06708317942315471:t[8]>227.50000000000003?pe=-.08486943882418681:pe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?pe=-.10496268177586783:pe=-.020921489532370493:pe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?pe=.11639296062157028:pe=-.004275784356569115:t[32]>1e-35?pe=-.07297384970166025:pe=.006026841626381599:pe=.002034611134960428;let Se;t[248]>1e-35?Se=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Se=-.06455513326540585:t[1]>29.500000000000004?Se=.07718474591552532:t[4]>7.500000000000001?Se=.040139336931404826:Se=-.09685734690563386:Se=.00015327283570347363:t[9]>88.50000000000001?Se=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Se=-.04077257804338707:Se=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Se=.03778141591008941:Se=-.06459919920634845:Se=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Se=.14063930759326346:t[0]>179.50000000000003?Se=.07287482250668585:t[8]>1180.5000000000002?Se=-.14419393112726253:t[10]>28.500000000000004?Se=-.07993142770099469:t[17]>1e-35?Se=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Se=.05527969663610186:Se=-.10824385941441346:t[3]>11.500000000000002?Se=.12358502961047915:Se=-.017509147119622873:t[0]>74.50000000000001?Se=-.014907705458730486:t[8]>95.50000000000001?Se=-.02225118168342062:Se=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Se=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Se=.04962819555610421:Se=-.07213577821855309:Se=.09139529824708481:t[19]>1e-35?Se=.013439401088345224:Se=-.049274647207292056:Se=.10531673719686951;let Fe;t[40]>1e-35?t[0]>1937.5000000000002?Fe=-.06421671152073961:Fe=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Fe=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Fe=-.03520420769287065:t[8]>1085.5000000000002?Fe=-.019817352506127633:Fe=.11444439424520964:Fe=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Fe=-.010490117519863269:Fe=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Fe=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Fe=.06619344145920268:t[0]>4091.5000000000005?Fe=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Fe=.10016091391222309:Fe=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Fe=-.019511460451434884:Fe=-.11643672465055221:t[2]>18.500000000000004?Fe=.07848228087333317:t[8]>55.50000000000001?Fe=.032583027899956235:Fe=-.11209832692153521:t[11]>1e-35?Fe=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Fe=-.09996887746328006:t[9]>2.5000000000000004?Fe=.02157682011863397:Fe=-.05247727848991843:Fe=.07409150201483244:t[1]>38.50000000000001?Fe=-.11378466075449625:t[224]>1e-35?Fe=-.10741749127732923:t[1]>26.500000000000004?Fe=.07343136534146562:Fe=-.07013573628594773:t[25]>1e-35?Fe=-.04626669734164317:Fe=.05518333197956482:Fe=.00032434010867555516;let te;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?te=.026313251010808853:te=-.08997339150292381:te=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?te=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?te=.0905155504503746:t[8]>1049.5000000000002?te=-.062312558183394054:t[8]>719.5000000000001?te=.09583836191410239:t[0]>3719.5000000000005?te=-.0778097309430818:te=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?te=-.12920865648544927:t[0]>2699.5000000000005?te=-.07086587879041864:te=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?te=-.11377786322600797:te=-.009486325820117998:t[1]>55.50000000000001?te=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?te=-.07938291201004219:t[2]>36.50000000000001?te=.01520046732530246:te=.13649854049662832:te=-.07145015938528873:t[8]>407.50000000000006?te=-.00350257360822279:te=.11332047082193297:te=-.10060624458629897:te=.05429496612497562:t[8]>1446.5000000000002?te=.006073419197482838:te=-.08718676350883998:te=-.11532497988252638:te=.10766270463068293:t[34]>1e-35?te=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?te=-.0004109812623829506:te=.021601073497455662:te=-7343540098965853e-20;let Te;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?Te=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?Te=.05995640200798119:t[0]>3443.5000000000005?Te=-.14698883458733583:Te=-.030039164579240187:t[189]>1e-35?Te=-.06086763220538141:t[1]>86.50000000000001?Te=-.05096727866142538:t[4]>64.50000000000001?Te=.11240554253834577:t[4]>45.50000000000001?Te=-.030279760168394117:t[6]>45.50000000000001?Te=.10161088917815142:t[10]>77.50000000000001?Te=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?Te=-.06672020005240323:Te=.08831457502630258:t[8]>2592.5000000000005?Te=-.052617701047376654:t[10]>29.500000000000004?Te=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?Te=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?Te=-.064099222705728:Te=.044332487521538365:t[0]>2882.5000000000005?Te=.031099546885005065:Te=.12938467051623853:t[0]>4221.500000000001?Te=-.0928676413498701:t[9]>30.500000000000004?Te=-.05781824812803708:Te=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?Te=-.06648105454098469:Te=.05985487552383097:Te=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?Te=.05282385499619401:t[1]>66.50000000000001?Te=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?Te=.027885690791379255:Te=-.08407126408362446:Te=.014432924125571093:Te=-9903435845205118e-20;let Ge;t[76]>1e-35?Ge=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?Ge=.013633653464240465:Ge=-.10164319411983509:Ge=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?Ge=.00632864847804078:Ge=-.08393000368134668:Ge=.07870508617440916:t[284]>1e-35?Ge=.1092302727710421:Ge=-.0025505047582483234:t[248]>1e-35?Ge=.07101822393621864:t[274]>1e-35?Ge=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?Ge=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?Ge=.025081789181021243:Ge=-.014813325803582618:t[9]>33.50000000000001?Ge=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?Ge=.11926990418060353:Ge=.01852125513565268:Ge=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?Ge=-.1178464984373743:t[283]>1e-35?Ge=.043370859226927405:t[5]>4320.500000000001?Ge=-.01103141226366587:t[8]>1104.5000000000002?Ge=-.023053423988095886:Ge=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?Ge=.000579145585864887:Ge=.03389152834202143:t[128]>1e-35?Ge=-.14527722052568462:t[210]>1e-35?Ge=-.08915971541902741:t[7]>9.500000000000002?Ge=-.03307314577076116:t[18]>1e-35?Ge=-.05521712302023565:Ge=.009315605032770029:Ge=.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 se;t[3]>7.500000000000001?t[157]>1e-35?se=-.07514182877923786:se=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?se=.028692053800951845:se=.14081686716133598:se=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?se=.0037139292567243084:se=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?se=.01202688580305612:se=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?se=.043935495082738626:se=-.05639305759669704:t[247]>1e-35?se=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?se=.10331836202616368:se=.0006926658459781341:t[96]>1e-35?se=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?se=-.0741403257305367:se=.022900127535540854:t[7]>3.5000000000000004?se=.038110741403836294:se=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?se=-.09552842289807008:t[1]>27.500000000000004?se=.012505935885798007:se=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?se=-.1046104767723845:se=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?se=.023466328488582572:se=.11730925774586994:se=-.04771965631104874:se=.17059689880751394:se=-.08181850955999449:t[26]>1e-35?se=-.12727482696678769:se=-.014343123272734182;let me;t[147]>1e-35?t[1]>53.50000000000001?me=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?me=-.02763546051134888:me=.06423344777499343:me=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?me=.049825139823021586:t[7]>22.500000000000004?me=-.01131680751379858:t[0]>2579.5000000000005?me=-.10673674485369694:me=-.015387212937189957:me=.04347325151148724:t[179]>1e-35?me=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.0650355590939066:me=-.0473332870892226:me=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?me=.11139543329789044:t[126]>1e-35?me=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?me=.06370903833231022:t[10]>29.500000000000004?me=.03415223859607161:t[10]>3.5000000000000004?me=-.07415518117873297:me=-.0014119203473324082:me=.12617652343819508:t[9]>41.50000000000001?me=-.10311145857176976:t[8]>2757.5000000000005?me=-.08106484219011428:t[7]>71.50000000000001?me=-.09783384432091176:t[1]>88.50000000000001?me=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?me=-.008884084501608536:me=.061339437777743616:me=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?me=.01526664064166223:me=.13534828515415498:me=-.06985484465894776:me=.0005758961943178744;let Ce;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Ce=-.029152732370514342:Ce=.07173628916139178:t[1]>36.50000000000001?Ce=-.08859111297255318:Ce=.0018030071815630785:Ce=.13652461563759322:Ce=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Ce=-.07145140450454163:t[21]>1e-35?Ce=-.07422841663493233:Ce=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Ce=.11864240653986852:t[3]>33.50000000000001?Ce=-.08821209591953476:Ce=.05706392280054726:Ce=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Ce=.01953613016837112:Ce=-.059781039130025006:t[148]>1e-35?Ce=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Ce=.07207826841738371:t[202]>1e-35?Ce=.08163917539410503:Ce=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Ce=-.06858280496900336:Ce=-.1781828899516648:Ce=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Ce=.018232649414147116:Ce=-.04419781124222661:Ce=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Ce=.11452368095776105:Ce=-.036496437259924026:Ce=-.040445338739465486:Ce=.0816572651001145:Ce=-.08968914517368663:Ce=.0002826343082585516;let He;t[189]>1e-35?t[0]>5269.500000000001?He=-.08839493050459957:t[10]>85.50000000000001?He=.10046908365702462:t[8]>2592.5000000000005?He=-.09632233975926387:t[8]>2000.5000000000002?He=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?He=.035504970430426296:t[1]>31.500000000000004?He=-.1133764813142531:He=-.01138280942244812:t[8]>1125.5000000000002?He=.09800530246229806:He=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?He=.07316772160107896:He=-.059095014819051765:He=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?He=-.09150209066166894:t[8]>3084.0000000000005?He=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?He=-.04449234460408263:He=.05568837973347338:He=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?He=.12741077850267066:He=.007372371864985329:t[2]>39.50000000000001?He=.02295917234617787:He=.14966532083907075:t[1]>39.50000000000001?He=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?He=-.02511861881285652:t[1]>27.500000000000004?He=.08683660011672288:He=.02956214835267301:t[9]>15.500000000000002?He=-.016538805462996232:He=.04352738094981517:He=-.05561856645643868:t[9]>170.50000000000003?He=-.07996752635874248:t[179]>1e-35?He=-.09065975936933919:He=-.00042817975060427177;let $e;t[39]>1e-35?t[4]>25.500000000000004?$e=.03443173196222934:$e=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?$e=-.0013415395759330318:$e=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?$e=.002297618040307216:$e=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?$e=-.015297257305397608:$e=.09651828834062742:$e=-.06636003334371929:t[10]>11.500000000000002?$e=.17631616138309397:t[0]>1639.5000000000002?$e=3804386478092585e-20:$e=-.09099296398683193:$e=-.06874415876172972:t[0]>2151.5000000000005?$e=-.1311264883406766:$e=.00809052010141122:t[253]>1e-35?$e=-.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?$e=.045038497754638605:$e=-.07770167665661752:$e=-.08596294280650517:$e=.08538655727027213:$e=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?$e=.054627956617973275:t[1]>61.50000000000001?$e=-.11994465088415499:t[4]>8.500000000000002?$e=.06676200239406452:$e=-.027503148069376867:t[8]>676.5000000000001?$e=-.10363964928357075:t[4]>8.500000000000002?$e=-.07589816227175682:$e=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?$e=.009093153189012338:$e=-.06119765876605404:$e=.0004668642103528348;let et;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?et=-.10100794502567233:et=.08000205636470442:et=-.11945419826856896:t[113]>1e-35?et=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?et=.1224302423880318:et=-.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?et=.0019277012166729114:t[1]>28.500000000000004?et=-.054445821715687494:et=.045645722976713245:t[30]>1e-35?et=.13402660155331655:et=.008921176001777645:et=-.058547426505451076:et=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?et=-.13526418192218206:et=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?et=.0007263224246135398:et=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?et=-.11575657261278308:et=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?et=-.01995960178292952:et=.11216586049153021:et=-.10050961087149474:et=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?et=.10303451081526649:et=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?et=-.043799548968209395:et=-.12451444314954115:t[4]>12.500000000000002?et=-.03838117361958468:et=.06504990789767144:t[57]>1e-35?et=.06890006938293915:et=.0003914274695562949;let ct;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?ct=.004271749009686975:ct=-.10523878297127605:ct=.04633982158107851:ct=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?ct=-.08655730561951676:t[8]>919.5000000000001?ct=-.0676453705610183:t[7]>18.500000000000004?ct=-.027787974193650575:ct=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?ct=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?ct=-.03473877164537313:t[8]>719.5000000000001?ct=.10471053866934404:ct=.008236107678382981:t[4]>57.50000000000001?ct=.09412219478825269:t[10]>66.50000000000001?ct=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?ct=-.040681323751002293:ct=.06374650297561021:ct=.12884615227401788:t[10]>5.500000000000001?ct=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?ct=-.05474068967150784:ct=.03744700650806603:ct=-.07846396348680855:t[1]>42.50000000000001?ct=.018972315810821302:ct=.10953621007604744:t[5]>4439.500000000001?ct=.010999776705494586:t[1]>40.50000000000001?ct=-.12394200059775967:t[10]>2.5000000000000004?ct=.013528093962849453:ct=-.09222088417048682:ct=-.12662967149701485:ct=.09327296405849603:t[3]>99.50000000000001?ct=-.013581954439986752:ct=.0005526498251862075;let bt;t[187]>1e-35?t[243]>1e-35?bt=-.08392792551692502:t[10]>68.50000000000001?bt=.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?bt=-.0825306209711224:bt=.049559996084532945:bt=-.1064938580886302:bt=.03353240732240275:bt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?bt=.16966001471529374:t[1]>57.50000000000001?bt=-.005772777673676247:bt=.09383677041525058:t[8]>747.5000000000001?bt=.054068175469351235:bt=-.049968216310277036:t[8]>753.5000000000001?bt=-.0679383555784074:t[4]>8.500000000000002?bt=-.059757341189735386:bt=.05701083682780414:bt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?bt=.05820296128730006:bt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?bt=.15340611616954566:bt=.04385036188666874:t[0]>4449.500000000001?bt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?bt=.004840354641006495:bt=.09967827580276283:bt=.11605363537391578:t[9]>19.500000000000004?bt=-.0735831692725717:bt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?bt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?bt=-.02442182361342386:bt=.10334853004243093:bt=-.030431948680167104:bt=-956078595250818e-19;let ht;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?ht=-.040232505718244854:t[0]>3030.5000000000005?ht=.0634109586813073:ht=-.04043617034245621:ht=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?ht=-.007859096946435131:ht=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?ht=.05515771679628051:ht=-.04214471312668263:ht=-.09589322222261765:t[193]>1e-35?ht=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?ht=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?ht=-.08152604001147906:t[11]>1e-35?ht=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?ht=.13100930780107503:t[10]>25.500000000000004?ht=.05921074710011526:ht=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?ht=.0009447118243153454:ht=-.09820565036865991:ht=.057146909749745546:t[0]>2115.5000000000005?ht=-.12331216726611678:ht=.007281983677694285:t[2]>56.50000000000001?ht=.012310154675612615:ht=-.08873665774670461:t[6]>25.500000000000004?ht=.134708740821879:t[9]>5.500000000000001?ht=-.0805901581148979:t[224]>1e-35?ht=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?ht=.10842593386554122:t[2]>13.500000000000002?ht=.06466798320378395:ht=-.08578130788886655:ht=-.03590892078300114:ht=.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 ae;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ae=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ae=.020637047900190317:ae=-.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?ae=-.04632587527094407:ae=.08603684785510396:ae=-.05101401015448496:ae=.025466432054358498:ae=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ae=.020385355430046367:ae=.12032592051335252:ae=-.012387370292173013:t[2]>23.500000000000004?ae=-.12568545484492677:ae=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ae=.043528764484784536:ae=.14352071657196003:ae=-.009332833816977268:ae=.11186782227735846:ae=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ae=-.05649104643152564:ae=.03884200719305747:t[42]>1e-35?ae=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ae=-.04103416502526736:ae=.04881823954656287:t[4]>15.500000000000002?ae=.009342724662897898:t[0]>3969.5000000000005?ae=-.025637309961309498:ae=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ae=-.08185697075265091:t[0]>2215.5000000000005?ae=.030063975892297354:t[0]>807.5000000000001?ae=-.03924325550733229:ae=.0415330999189793:ae=-.00024374664461674863;let Re;t[3]>7.500000000000001?Re=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Re=.025798416259686565:Re=.13251610353146012:Re=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Re=-.11098564237775424:Re=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Re=.15347826616466054:t[3]>4.500000000000001?Re=.10379320730958941:Re=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Re=.03159791088468647:Re=-.10612873364104258:Re=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Re=-.02335760775001469:Re=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Re=-.011164334474672973:Re=-.06594044410501655:t[207]>1e-35?Re=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Re=-.01725821503981916:Re=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Re=-.04226531631656534:Re=-.14409800530171432:Re=-.03245576341206398:t[8]>4214.500000000001?Re=.0895409165534886:t[247]>1e-35?Re=-.06506383629143335:t[118]>1e-35?Re=-.07214270121257443:t[8]>546.5000000000001?Re=-.004385020865473831:Re=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Re=.046278501133958524:Re=-.030835570926968044:t[0]>493.50000000000006?Re=-.12794504651610425:Re=.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 ze;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?ze=.029186512383291244:t[7]>1.5000000000000002?ze=-.14984127276725573:t[1]>40.50000000000001?ze=.032757060730648144:ze=-.07675575422749602:t[6]>8.500000000000002?ze=.10599766037117893:ze=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?ze=-.051394622947855385:ze=.03237141302699347:ze=.12526173027943244:ze=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?ze=-.07383912482657777:t[0]>5147.500000000001?ze=.07008813937042091:t[10]>38.50000000000001?ze=-.06779203808365307:ze=-.013782769999524498:ze=.0880038869117715:ze=-.12846294176070952:t[281]>1e-35?ze=-.06810806903850834:t[10]>227.50000000000003?ze=-.08937977001661111:t[10]>130.50000000000003?ze=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?ze=.011036530162093841:ze=-.11500797478569702:ze=.03702229366129399:ze=.07242026683784307:t[189]>1e-35?ze=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?ze=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?ze=-.02608892716555304:ze=.09609599320761308:t[9]>105.50000000000001?ze=-.06848127135991534:ze=.0023675721254089715:t[86]>1e-35?ze=-.11049635625500497:ze=-.004847764219432233;let at;t[125]>1e-35?t[0]>3969.5000000000005?at=-.09462233499115416:at=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?at=-.030700661288166148:at=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?at=.03149547314036763:at=-.08166208257451366:t[0]>5850.500000000001?at=-.10228136324773157:t[102]>1e-35?at=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?at=.01782894842128785:t[13]>1e-35?at=.002680190260979968:at=.1773965720476949:t[2]>72.50000000000001?at=.09090831938627947:t[1]>59.50000000000001?at=-.12297206702816128:t[0]>4977.500000000001?at=.09899015653118268:at=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?at=-.0675900954187773:at=.012336403425364092:at=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?at=-.02671721777458802:at=-.09242452991958029:t[284]>1e-35?at=-.08585691288582491:at=.013332890564324447:t[4]>14.500000000000002?at=-.005245022074799553:t[23]>1e-35?at=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?at=-.09289852307936758:t[116]>1e-35?at=-.09686573010015055:t[8]>804.5000000000001?at=.03812547148215318:at=.005162744968176633:t[9]>43.50000000000001?at=-.059246106396159376:at=.050370113808135275:at=.000794041852811028;let Vt;t[3]>7.500000000000001?Vt=.0004981426543104341:t[9]>114.50000000000001?Vt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Vt=-.019061766497948867:Vt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Vt=-.006044199577160493:Vt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Vt=.11486607015912494:t[9]>16.500000000000004?Vt=-.08686820858087294:Vt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Vt=-.022230207980026437:Vt=.1056683690528792:Vt=-.05859530800943035:Vt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Vt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Vt=-.05177544573528314:Vt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Vt=.15159657923771555:Vt=-.0060542654587671055:t[9]>5.500000000000001?Vt=-.042808028205051786:t[1]>48.50000000000001?Vt=-.010449538258110742:Vt=.10026907521968294:Vt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Vt=-.02272452389409874:Vt=-.11202691218244319:t[5]>1809.5000000000002?Vt=-.04460413584255906:Vt=.08196329474205256:t[10]>69.50000000000001?Vt=.10221481166238167:Vt=.0004063052701699382:t[243]>1e-35?Vt=-.07563941678849846:t[18]>1e-35?Vt=.02563513231103432:Vt=-.004740081147303786;let gr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?gr=.057446442918106:gr=-.04404018270156349:gr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?gr=-.05930486238817954:t[1]>29.500000000000004?gr=.06955866121256543:t[8]>597.5000000000001?gr=-.06538593556505168:gr=.06212512595497445:gr=.00021102929959182257:t[9]>90.50000000000001?gr=.0958061289119631:t[102]>1e-35?gr=.07172059675638813:t[1]>47.50000000000001?gr=-.03879798603977766:t[297]>1e-35?gr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?gr=.003805910996312012:gr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?gr=.11252376801858695:t[288]>1e-35?gr=-.10293901912180432:gr=.014669268837893872:t[1]>42.50000000000001?gr=-.05988274123836837:t[145]>1e-35?gr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?gr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?gr=-.03366718308159971:gr=.11936550608549797:t[1]>31.500000000000004?gr=-.07454716789539667:gr=.027859650621164217:t[10]>10.500000000000002?gr=-.11806374092321247:gr=-.03506042229223101:gr=-.0007080765837654515:t[10]>6.500000000000001?gr=-.028077713664996503:t[2]>7.500000000000001?gr=.15803724124216814:gr=.0351381284833169:gr=-.07877953381054767;let cr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?cr=.14144941521975005:cr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?cr=.10514088112381886:t[7]>18.500000000000004?cr=-.10370643555956745:cr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?cr=-.0508129468802936:t[224]>1e-35?cr=-.037816066368733595:t[10]>43.50000000000001?cr=.07793408602607932:cr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?cr=.036972453794202324:cr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?cr=.09475302525132188:cr=-.03580104945898193:cr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?cr=-.1282448778804823:cr=-.014395808269207212:cr=-.008940927190750592:cr=-.1459118815453748:t[0]>4897.500000000001?cr=-.09733068457286576:t[1]>57.50000000000001?cr=.06575271409540207:cr=-.019556422817450115:cr=-.10623959222984136:t[18]>1e-35?cr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?cr=.008125645893104896:cr=-.11084368630465868:cr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?cr=-.05854904579626861:t[4]>5.500000000000001?cr=.02985784951394175:cr=-.03247600140149334:cr=-.11152899295304973:cr=-.00035424577714215764;let Mr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Mr=-.06563670567578264:Mr=.067656954313663:Mr=-.10388217548685377:t[8]>2302.5000000000005?Mr=.07190621943790435:t[4]>67.50000000000001?Mr=.060020507643618604:t[4]>38.50000000000001?Mr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Mr=-.06568134366461277:t[8]>1075.5000000000002?Mr=-.004768057709758692:Mr=.11785959165999467:Mr=-.05080221682879267:Mr=.14814206127494542:Mr=-.07241946332311736:t[253]>1e-35?Mr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Mr=-.02471195342450034:Mr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Mr=-.10741850739482771:Mr=.010051635824944:Mr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Mr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Mr=-.08992396138178163:Mr=.010944365997007212:Mr=.06221307021813793:Mr=.1286024087559141:t[127]>1e-35?Mr=.06568148624531012:t[10]>40.50000000000001?Mr=-.07567979134643352:t[5]>5647.500000000001?Mr=.07594672895572069:Mr=-.018158016446439187:t[6]>55.50000000000001?Mr=.009293422430111872:t[4]>45.50000000000001?Mr=-.017749818406964022:t[2]>46.50000000000001?Mr=.01714136511113982:Mr=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let Yt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?Yt=.05517359070460923:Yt=-.04758751221404857:Yt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?Yt=.1040436595565776:t[9]>21.500000000000004?Yt=.04032250517675179:t[107]>1e-35?Yt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?Yt=.1192453009230486:t[1]>51.50000000000001?Yt=.0443376336292195:Yt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?Yt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?Yt=-.08999822408398037:Yt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?Yt=-.061850439226075:Yt=.08849196353361093:Yt=.10536348167793089:t[92]>1e-35?Yt=.04894947712119185:t[9]>16.500000000000004?Yt=.05900227903883853:t[9]>5.500000000000001?Yt=-.11946594348916476:Yt=-.03652096348071964:t[1]>41.50000000000001?Yt=-.07411603110840567:Yt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?Yt=.08493634342741495:t[11]>1e-35?Yt=-.10899097825564363:Yt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?Yt=.08356655906359918:t[7]>25.500000000000004?Yt=-.09475076526194888:t[10]>5.500000000000001?Yt=-.01999406228763778:Yt=.06696212545889428:t[6]>20.500000000000004?Yt=.14713592661393468:Yt=.0459917279002218:Yt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let $0=DVs(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+L+B+q+M+O+j+Q+U+Y+W+V+z+ie+H+re+le+Le+ge+Ue+ke+X+ee+K+he+Z+ue+qe+ne+ce+Ne+we+Be+rt+st+_t+Dt+$t+Gt+Ie+F+be+Qe+pe+Se+Fe+te+Te+Ge+J+se+me+Ce+He+$e+et+ct+bt+ht+We+ae+Re+Me+ye+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-$0,$0]}a(IXn,"multilineModelPredict");function DVs(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(DVs,"sigmoid");var NVs={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},xXn={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function wXn(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(NVs[r]??[]).some(l=>s.includes(l))}a(wXn,"hasComment");var Blt=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=wXn(e,-2,r),this.rstripSecondToLastLineHasComment=wXn(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`)}}catch{}l(null,s)},flush(s){try{r+=e.end(),r&&o(r.replace(/\r$/,"")),n>0&&t(n)}catch{}s()}})}a(MVs,"createCopilotUsageSniffer");function _Xn(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(_Xn,"extractErrorMessage");function OVs(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(OVs,"extractErrorCode");p();function SXn(t){return t.replace(/[-.]/g,"").toLowerCase()}a(SXn,"normalizeModelId");function TXn(t,e){if(!t||e.some(s=>s.id===t))return t;let r=t.replace(/-\d{8}$/,""),n=SXn(r);return e.find(s=>SXn(s.id)===n)?.id??t}a(TXn,"mapCapiModelIdToPickerId");Oo();var Ug=new fe("ClaudeCodeAgent"),Qg="ClaudeCodeAgentService";function LVs(t){return{id:`claude-code:/agents/${encodeURIComponent(t.name)}`,name:t.name,description:t.description,providers:["CLAUDE"],invokePolicy:DUt,isReadonly:!0,isBuiltIn:!0}}a(LVs,"toRuntimeClaudeAgent");var E8=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this.notificationSender=e.get(ts);try{this.runtimeSourceRegistration=e.get(Ld).registerRuntimeAgentSource({provider:"CLAUDE",getAgents:a(async n=>(await this.getSupportedAgentsForWorkspace(n)).map(LVs),"getAgents")})}catch(n){if(!(n instanceof bl&&n.ctor===Ld))throw n}}static{a(this,"ClaudeCodeAgentService")}async getSupportedAgentsForWorkspace(e){let r=new Set(e.map(c=>lg(un(c.uri)))),n=[...this._sessions.values()].filter(c=>r.has(lg(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()]}async createSession(e){return kb(this.ctx,"claudeCodeAgent.createSession",async r=>{await GZn(this.ctx,e);let n=e.sessionId??Mt(),o=this._sessions.get(n);if(o)return Ug.info(this.ctx,`${Qg}.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 sNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,isNewSession:!0,proxyConfig:c});return this._sessions.set(n,l),Ug.info(this.ctx,`${Qg}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return kb(this.ctx,"claudeCodeAgent.resumeSession",async r=>{await $Zn(this.ctx,e);let{sessionId:n}=e,o,s,c=this._sessions.get(n);if(c)Ug.info(this.ctx,`${Qg}.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 sNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:d,model:e.model,isNewSession:!1,proxyConfig:f});this._sessions.set(n,h),Ug.info(this.ctx,`${Qg}.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(xs).getMetadata().catch(m=>(Ug.debug(this.ctx,`${Qg}.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=yXn(f,m=>TXn(m,h)),r.properties.transcriptOk="true"}catch(u){Ug.warn(this.ctx,`${Qg}.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 kb(this.ctx,"claudeCodeAgent.sendMessage",async n=>{await VZn(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:Ks(s.cwd)};await this.ctx.get(Cg).applyPromptTemplateToRequest(e,[c]);let l=Mt(),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=>{Ug.warn(this.ctx,`${Qg}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),Vn(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"))}async listSessions(e){return kb(this.ctx,"claudeCodeAgent.listSessions",async r=>{YZn(this.ctx,e),Ug.info(this.ctx,`${Qg}.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 Ug.info(this.ctx,`${Qg}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return kb(this.ctx,"claudeCodeAgent.listModels",async r=>{KZn(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),Ug.info(this.ctx,`${Qg}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(xs).getMetadata(e)).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>k$e(c.capabilities.family)).map(Ort);return Ug.info(this.ctx,`${Qg}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await kb(this.ctx,"claudeCodeAgent.stopSession",async r=>{WZn(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){Ug.info(this.ctx,`${Qg}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return kb(this.ctx,"claudeCodeAgent.destroySession",r=>{zZn(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this._sessions.delete(n),Ug.info(this.ctx,`${Qg}.destroySession`,{sessionId:n}),{success:!0}):(Ug.info(this.ctx,`${Qg}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return Ug.error(this.ctx,`${Qg}.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 kb(this.ctx,"claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){Ug.info(this.ctx,`${Qg}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await iNe(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await kb(this.ctx,"claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){Ug.info(this.ctx,`${Qg}.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 Ug.warn(this.ctx,`${Qg}.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;for(let e of this._sessions.values())e.dispose();this._sessions.clear()}async _ensureProxyConfig(){return this.ctx.get(WX).start()}};p();var Rfr=new Cn;function IXn(t){return[...t].sort((e,r)=>{let n=Rfr.get(e.uri)??0;return(Rfr.get(r.uri)??0)-n})}a(IXn,"sortByAccessTimes");var xXn=a(t=>t.get($r).onDidFocusTextDocument(e=>{e.document&&Rfr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var wXn=de(require("events"));var Llt="CompletionRequested",t4=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new wXn.default;notifyRequest(e,r,n,o,s){return this.#e.emit(Llt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=z0(this.ctx,e,`event.${Llt}`);return this.#e.on(Llt,r),Fn.Disposable.create(()=>this.#e.off(Llt,r))}};p();p();var kfr=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?.()}},Blt=class extends kfr{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 Pb=class{constructor(e){this.ctx=e;this.#e=new fe("AsyncCompletionManager");this.requests=new Cn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(Pfr(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 Blt;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(Zt).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 vA,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(Pfr(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)Pfr(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 Pfr(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(Pfr,"isCandidate");p();p();var cNe=class{constructor(e){this.maxSize=e;this.root=new aNe;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 aNe;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 aNe;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 cNe(100)}};p();var Db=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&&RXn(this.choices[0].completionText,n))return BVs(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 BVs(t,e){return t.filter(r=>RXn(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(BVs,"adjustChoicesStart");function RXn(t,e){return t.startsWith(e)&&t.length>e.length}a(RXn,"startsWithAndExceeds");p();p();var _8={" ":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 kXn(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 E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.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 b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.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 P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.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 L;t[308]>1e-35?L=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?L=.023223358334607133:L=-.04383410185346742:L=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?L=.023406489302867494:L=-.085521220804058:L=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?L=.028120059780969632:L=-.04211009474298743:t[294]>1e-35?L=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?L=-.0993035220737934:L=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?L=.029770210551187937:L=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?L=.06421359317599738:L=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?L=.024368404612215164:L=-.04045232374803373:t[131]>1e-35?L=.017372701982485795:t[120]>1e-35?L=.08812710275150198:t[18]>1e-35?t[90]>1e-35?L=.18451364351180236:t[7]>33.50000000000001?L=-.03850813130183531:t[195]>1e-35?L=.06966114053446336:t[3]>16.500000000000004?L=-.0012869181693341211:t[0]>4242.500000000001?L=-.054625548611291035:L=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?L=.006302103427145562:L=.13967622319898698:t[121]>1e-35?L=-.038798585213145644:t[5]>4544.500000000001?L=-.08050498033009466:L=-.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 O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let j;t[0]>384.50000000000006?t[84]>1e-35?j=-.06088131453064195:t[147]>1e-35?j=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?j=.04219361472548491:j=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?j=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?j=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?j=-.11431764534511478:j=.013549717238356157:j=-.020987333767091276:t[6]>2.5000000000000004?j=-.02914877855133127:j=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?j=-.10087072787978416:t[37]>1e-35?j=-.030467397753331196:t[229]>1e-35?j=-.1017559811057469:t[4]>20.500000000000004?j=-.00413177742240167:t[20]>1e-35?j=.05213315982685969:j=.0037921635866823133:t[8]>51.50000000000001?j=.07327913092421544:t[6]>49.50000000000001?j=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?j=.02744420891894289:j=.11288946357194463:j=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?j=-.012329314369909049:j=.026816658655600168:j=-.0872405354618811:j=.007872673500247845:t[1]>42.50000000000001?j=-.04309044198258254:t[145]>1e-35?j=.07572529147860785:t[7]>5.500000000000001?j=-.013837187093264945:t[1]>17.500000000000004?j=.04208698439539668:j=-.06284346769019863;let Q;t[294]>1e-35?Q=-.0384794324818203:t[266]>1e-35?Q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?Q=.07432960094940501:Q=-.035248735855751855:t[134]>1e-35?Q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?Q=-.01706896375068821:Q=.08212247914968074:t[2]>59.50000000000001?Q=-.09546478958824225:t[6]>53.50000000000001?Q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?Q=.02816463285971267:Q=.15449139016588445:Q=-.10199787406123524:Q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?Q=-.13924786681478077:Q=-.0072772442570213335:t[39]>1e-35?Q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?Q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?Q=-.11174465335620831:Q=.00013144040097180107:Q=-.08493919336681105:t[42]>1e-35?Q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?Q=-.015540659878839153:Q=-.14442609417300142:t[21]>1e-35?Q=-.025251979447574083:Q=.0023698372645272847:t[18]>1e-35?Q=.07269739695712212:t[8]>2592.5000000000005?Q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?Q=-.01835130329646532:t[9]>45.50000000000001?Q=.02023047454629885:Q=.16469378262221102:Q=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.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?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.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 ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Ue;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Ue=.009769895322846493:Ue=-.10620052926943656:t[9]>19.500000000000004?Ue=.03781202525403449:t[9]>14.500000000000002?Ue=-.11485785321365344:t[9]>6.500000000000001?Ue=.07677177833073881:t[0]>4342.500000000001?Ue=-.07079285609687631:t[49]>1e-35?Ue=.06156814809246001:Ue=-.014788509042554625:Ue=-.032659201618470655:t[5]>5207.500000000001?Ue=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Ue=-.03094160322187924:t[1]>29.500000000000004?Ue=.09474646043921069:Ue=.023445783928231618:Ue=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Ue=-.07164443768784848:t[1]>29.500000000000004?Ue=.089473622509272:t[8]>597.5000000000001?Ue=-.08155349903101317:Ue=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Ue=-.004003900679358653:t[190]>1e-35?Ue=-.09236113461485262:t[8]>3198.5000000000005?Ue=-.0124130160451179:Ue=.018453070064009328:t[15]>1e-35?Ue=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Ue=-.0009580759587680961:Ue=-.03227283036698222:Ue=.01369287669536875:t[1]>50.50000000000001?Ue=-.04213060332500437:t[35]>1e-35?Ue=-.11508095777767471:t[190]>1e-35?Ue=-.08611884672400155:t[297]>1e-35?Ue=.05723551879433584:Ue=-.004829340082311461;let ke;t[183]>1e-35?ke=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?ke=-.11753465135886734:ke=-.007515490299047085:ke=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?ke=-.12371142493530439:t[1]>36.50000000000001?ke=.032189417575190435:ke=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?ke=-.0784518658439288:t[2]>54.50000000000001?ke=.12477882322370665:ke=.000313468482399738:ke=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?ke=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?ke=.0353146070135579:ke=-.06327619611098285:ke=.02813577701641991:ke=-.12354390728506215:t[34]>1e-35?ke=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?ke=-.01245803535276381:ke=-.07169472553475001:t[1]>11.500000000000002?ke=.12989984824561698:ke=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?ke=.010390226893521422:t[10]>14.500000000000002?ke=.16790888126487719:ke=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?ke=-.043398307129729134:ke=.09963544907820426:t[9]>30.500000000000004?ke=-.13540713124984502:t[9]>17.500000000000004?ke=.0509435850590757:ke=-.04761897852404613:t[4]>78.50000000000001?ke=.09197086656470652:ke=.0006771050176682337;let X;t[122]>1e-35?t[6]>36.50000000000001?X=.05686884451670743:X=-.05334759543084309:t[266]>1e-35?X=-.08603579519816038:t[157]>1e-35?X=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?X=-.0499592651503952:t[0]>725.5000000000001?X=.11780353905132664:X=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?X=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?X=-.03190157229022304:X=.07985197845805492:X=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?X=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?X=-.027174047777029083:X=.057117284879796476:t[3]>43.50000000000001?X=-.0016147040913107311:X=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?X=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?X=-.01466076988151239:X=.13375695925484857:X=-.04885873081899647:t[0]>5566.500000000001?X=.11086813028591343:t[8]>992.5000000000001?X=-.07622304217072383:X=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?X=.03285858361708423:X=-.12354858211764992:X=.0672788301823281:t[15]>1e-35?X=.08658836986585006:X=-.02741484278509758:t[290]>1e-35?X=-.08161310335133287:t[135]>1e-35?X=-.04824156054814152:X=.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 Z;t[179]>1e-35?Z=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?Z=.1470294450403005:Z=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?Z=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?Z=.07965955447707423:t[10]>10.500000000000002?Z=-.09236156404262426:Z=.03396273196231458:Z=-.13246465021467432:Z=.07092822261735353:Z=-.08753829085942:Z=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?Z=.004705878789890202:Z=.13775378964952867:Z=-.04770928980587811:t[10]>29.500000000000004?Z=.011221519891071544:t[0]>3853.5000000000005?Z=.06365381191628273:Z=.15506252245336827:t[1]>37.50000000000001?Z=-.07254777021042061:Z=.026514587757252385:t[308]>1e-35?Z=.04115804816617256:t[10]>26.500000000000004?Z=.02077721353011946:t[5]>3548.5000000000005?Z=-.1280907116663952:Z=-.021974774274438:t[306]>1e-35?Z=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?Z=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?Z=-.005710865560475598:t[94]>1e-35?Z=-.06751507982853555:Z=.027250040757588703:t[9]>52.50000000000001?Z=.07060357924595577:Z=-.030297760713011795:Z=-.0006005400085266517;let ue;t[113]>1e-35?ue=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ue=-.06996356565314456:ue=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ue=-.08317707559926495:t[21]>1e-35?ue=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ue=-.010538203005984922:ue=.08454819465349446:t[9]>124.50000000000001?ue=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ue=-.08542251249346582:t[9]>50.50000000000001?ue=-.023428882537657472:ue=.010042500833979073:ue=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ue=.03006025206979096:t[9]>108.50000000000001?ue=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ue=.04222035773042132:ue=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ue=-.07209095448054853:ue=.028065954981903313:ue=.08714651929917122:ue=-.006678820669279169:t[10]>40.50000000000001?ue=.006982396294941626:ue=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ue=-.09351114982645548:t[4]>3.5000000000000004?ue=-.004837550129223451:ue=-.08324141237464677:t[303]>1e-35?ue=.10703037493990825:t[9]>156.50000000000003?ue=-.10803018621648303:t[116]>1e-35?ue=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ue=.10261721665006701:ue=.018994509090668264:ue=.0011244262442038839;let qe;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?qe=-.08404263465005328:t[0]>3682.5000000000005?qe=.041259223920298876:t[1]>29.500000000000004?qe=-.09541257493441671:qe=.001482192721625409:qe=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?qe=-.08268996098437432:t[230]>1e-35?qe=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?qe=-913218977737457e-19:t[4]>10.500000000000002?qe=-.056334165674005156:t[127]>1e-35?qe=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?qe=-.04231200150318989:t[10]>42.50000000000001?qe=.10182973257894812:qe=.015934763950068445:qe=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?qe=-.041117068322885315:qe=.1167767830037126:qe=.13611206992387337:t[10]>41.50000000000001?qe=-.07120286010564107:qe=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?qe=-.07702290997669524:t[198]>1e-35?qe=.08776558554437136:qe=-.008290740324975692:t[2]>32.50000000000001?qe=.07198457624219955:qe=.005463113714361629:qe=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?qe=.03295785445437507:qe=.15140250150674536:qe=-.035613213948910254:t[186]>1e-35?qe=.06849425535860769:t[96]>1e-35?qe=.06028225812727254:qe=-.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 ce;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ce=-.01386103677247845:ce=.11386694333005128:t[4]>27.500000000000004?ce=-.021862617610091336:t[2]>31.500000000000004?ce=.0828858469030438:ce=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ce=.11303635767048735:ce=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ce=-.04238798044549342:ce=.022091190130494303:t[5]>5082.500000000001?ce=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ce=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ce=-.04291104140431434:t[17]>1e-35?ce=.11256797532342613:ce=-.017206916368289193:ce=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ce=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ce=.03581712466863222:ce=.14770264307668884:t[8]>73.50000000000001?ce=-.13093289429740068:ce=.042461737442702936:t[52]>1e-35?ce=.0501831919044939:ce=-.010450249720465756:ce=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ce=.0005381332165438493:ce=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ce=.04849637311285226:ce=-.036671377119808564:t[0]>421.50000000000006?ce=.00020968499911058945:ce=.11636422423182405:ce=-.12687837788222575:ce=.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 we;t[294]>1e-35?t[10]>50.50000000000001?we=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?we=-.06063239096209816:we=.03317022411417386:we=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?we=-.013608609329298802:we=.09078000157330264:t[99]>1e-35?we=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?we=-.07536137260189814:we=.006253266595455118:t[10]>28.500000000000004?we=-.006106041147592768:t[9]>156.50000000000003?we=-.11828932797811101:t[94]>1e-35?we=-.02566078479505714:t[303]>1e-35?we=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?we=-.08401252789168523:t[5]>4244.500000000001?we=.026372887658499107:t[1]>16.500000000000004?we=-.027836756345634026:we=.09205362097909099:we=.00934612788718244:t[203]>1e-35?we=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?we=-.09580979052540028:t[1]>50.50000000000001?we=-.06402211827281554:we=.08342858760095972:t[2]>36.50000000000001?we=.008114897658204584:t[92]>1e-35?we=.09541587072672864:we=-.022342147210555434:we=-.01660492519175128:we=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?we=.15846731118501817:we=.039498507912023195:t[245]>1e-35?we=.07008718676813333:we=.0019806389728814727;let Be;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Be=-.01192072916082109:Be=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Be=.06874032717466054:t[4]>40.50000000000001?Be=-.07752510020707537:t[1]>76.50000000000001?Be=-.09944032260703917:t[8]>1381.5000000000002?Be=-.054466635810800745:t[1]>32.50000000000001?Be=.05974084520839573:Be=-.0384718740755954:Be=-.11374190719134032:t[0]>2151.5000000000005?Be=-.13703645155803298:Be=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Be=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Be=.013539805885738608:Be=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Be=.09941880179344399:Be=-.01608127391210995:Be=.08025226531247417:t[9]>67.50000000000001?Be=.13525448212444113:t[6]>61.50000000000001?Be=-.05511099182158894:t[94]>1e-35?Be=-.06821509831783572:t[128]>1e-35?Be=.11361314817714643:Be=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Be=-.09954181329804547:t[197]>1e-35?Be=.10102833149755386:t[188]>1e-35?Be=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Be=-.03781554214742005:Be=.09927933385592314:Be=-.020006000056720083:Be=-.10520473615957895:Be=-.12006990846253787:Be=-.00026111570975317574;let rt;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?rt=-.019188245509744628:rt=-.13354864350075848:t[0]>2461.5000000000005?rt=.051885477468354396:rt=-.0833581968852119:rt=.08233441701532287:rt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?rt=.09926337893072812:rt=-.027753610497327715:t[0]>1972.5000000000002?rt=-.09780045823152517:rt=.032380915168504935:rt=.11502632261226381:t[17]>1e-35?rt=-.06094965899579662:t[10]>40.50000000000001?rt=-.07500475582440802:rt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?rt=-.09584538995220808:rt=-.00908705814304442:rt=.03203281520813893:t[10]>49.50000000000001?rt=-.03146271513986384:t[2]>63.50000000000001?rt=.13172001315536286:t[224]>1e-35?rt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?rt=.09521549382082259:rt=-.04414925613522197:t[0]>1847.5000000000002?rt=-.09118580379557353:rt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?rt=.03525144509943896:rt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?rt=-.04766112322938157:t[2]>10.500000000000002?rt=.0728516504357201:rt=-.05049625965272536:rt=-.10868663055825774:rt=.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 _t;t[115]>1e-35?_t=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?_t=-.10131179514695865:t[8]>938.5000000000001?_t=.10203729808015481:_t=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?_t=.03574015165562999:_t=-.07763042506449493:_t=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?_t=.0665706259130275:_t=-.06586817559309924:_t=.11925564412287476:_t=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?_t=.046017146627455346:_t=-.08623321630086885:t[8]>1765.5000000000002?_t=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?_t=.11143827902215087:_t=-.01817808730473413:_t=.16980985030210127:_t=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?_t=.010168994879727824:_t=-.09099594488792513:t[9]>1.5000000000000002?_t=.0533459678147928:_t=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?_t=-.062346959148773695:t[1]>47.50000000000001?_t=-.0021578343835599316:t[2]>27.500000000000004?_t=.19567373210166172:_t=.07851555379116423:t[18]>1e-35?_t=.03711549097804649:t[8]>359.50000000000006?_t=.012492346746905587:t[4]>20.500000000000004?_t=.047511695735697544:_t=-.07999269063948773:_t=6802045404471004e-20;let Dt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Dt=.0011484728213539738:Dt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Dt=-.09828874964938798:t[8]>1586.5000000000002?Dt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Dt=.011938269926919522:Dt=.17541983715953954:t[19]>1e-35?Dt=.023002786011088672:Dt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Dt=.06508934844183291:Dt=-.10168553534835639:Dt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Dt=.021140806225203937:Dt=-.1167833342453639:t[2]>33.50000000000001?Dt=.13163585734056618:Dt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Dt=.06314479201263888:Dt=-.09639088327091713:t[10]>29.500000000000004?Dt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Dt=40577156464836036e-21:Dt=.12322387121810757:Dt=-.03697224045046014:t[1]>22.500000000000004?Dt=.016474835887320276:Dt=.16919298733903063:Dt=.07633203630214054:Dt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Dt=.14150493354700563:Dt=-.01831155354975749:t[1]>28.500000000000004?Dt=-.07952557178685365:t[10]>28.500000000000004?Dt=.0665695554984927:Dt=-.053640139319277094:Dt=.0004754840665898665;let $t;t[76]>1e-35?$t=-.06814884255939921:t[179]>1e-35?$t=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?$t=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?$t=.004193658608848433:$t=-.1066968975983452:t[8]>302.50000000000006?$t=.05476730110440451:$t=-.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?$t=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?$t=.013555772109446666:$t=-.09856116699770784:$t=.0284329611813383:t[2]>52.50000000000001?$t=.04008708444763762:t[9]>29.500000000000004?$t=-.1289599546008197:$t=-.018566534248335896:t[8]>747.5000000000001?$t=.02236484980076122:$t=.1148871655157582:t[8]>3084.0000000000005?$t=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?$t=.03164751204281298:$t=.11752140436184891:t[9]>42.50000000000001?$t=-.07180559595410106:t[22]>1e-35?$t=.09325040416256854:$t=-.016041122807939914:$t=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?$t=-.010718250133458515:$t=.09818827994853763:$t=.010180038981174032:$t=-.039472162599295535:t[9]>170.50000000000003?$t=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?$t=-.08674788057474031:$t=.02077653508548371:$t=-.0003536561382007414;let Gt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?Gt=.018337297491457794:Gt=-.05926206443180149:Gt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?Gt=.10747078482128616:t[126]>1e-35?Gt=-.10550625192391357:t[7]>71.50000000000001?Gt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?Gt=.1317396472229434:Gt=-.025035791351328947:Gt=-.0728334305864372:t[8]>963.5000000000001?Gt=.023642201723096064:Gt=.183010326734258:t[128]>1e-35?Gt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?Gt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?Gt=-.1088876900335281:Gt=.02758317023002635:Gt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?Gt=-.01928020117446408:Gt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?Gt=.07893723375925096:Gt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?Gt=-.10301657587280551:Gt=.005787463140224318:Gt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?Gt=-.019296977889522397:Gt=-.07274529751752634:t[1]>30.500000000000004?Gt=-.050368901143148286:Gt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?Gt=.0015332402792773946:Gt=.09930153676749967:Gt=-.06370844564357069:Gt=.00042272155209927616;let Ie;t[71]>1e-35?t[4]>17.500000000000004?Ie=.12586844370423247:Ie=-.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?Ie=-.08474891624263797:t[8]>125.50000000000001?Ie=.08125086980439704:Ie=-.04082085238068532:t[0]>3863.5000000000005?Ie=.020481535807469208:Ie=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ie=-.019110200161573936:Ie=-.12387719685855114:t[0]>1102.5000000000002?Ie=.08376595701957407:Ie=-.031821919580524834:t[9]>4.500000000000001?Ie=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ie=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ie=.1349841206807871:Ie=.011864053595560297:t[1]>41.50000000000001?Ie=-.08203662486612544:t[2]>18.500000000000004?Ie=-.009541865642346947:Ie=.08345043168501759:t[2]>10.500000000000002?Ie=-.09585031818030947:Ie=.019432330487099865:Ie=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ie=.11951517733981365:Ie=-.016651014735738538:t[1]>28.500000000000004?Ie=-.07410922545030711:t[10]>28.500000000000004?Ie=.05886430683844788:Ie=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ie=.04802269879144705:Ie=-.026208212831796737:t[4]>45.50000000000001?Ie=-.03227476944664786:Ie=.05124575625622705:Ie=.00020506696916003137;let F;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?F=-.03042091758483443:t[10]>14.500000000000002?F=.09816619204768777:F=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?F=-.02381165060401718:F=-.10950361804974783:F=.03538211665111128:t[212]>1e-35?t[19]>1e-35?F=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?F=-.06371052144380579:F=.0835500621252692:F=-.10408255929333915:t[1]>74.50000000000001?F=.13208968122712403:t[1]>64.50000000000001?F=-.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?F=.09922816902423433:F=.016366955328796718:F=.1592412560903584:t[1]>39.50000000000001?F=.05409467990258923:F=-.08260633210459611:F=-.06307205775247567:t[9]>36.50000000000001?F=.040253940015648144:F=.14202568969471283:F=-.028761848341594044:F=.08994073058773508:t[0]>807.5000000000001?F=-.043427848826323195:F=.04573516446846493:t[20]>1e-35?t[188]>1e-35?F=-.0758877731600639:t[23]>1e-35?F=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?F=.08124700978741987:F=.013296063087086852:t[7]>5.500000000000001?F=-.01640196088612987:F=-.12685498840146067:F=-.0004940792382459551;let be;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?be=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?be=.08513773825688947:be=-.1184664832315282:be=.05676963535893477:be=.14263843210340613:be=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?be=-.10669720555606924:be=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?be=.0664744575868955:be=-.08469256188890871:be=-.026746678040592144:t[281]>1e-35?be=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?be=.012131807587207655:be=-.12776015795398743:be=.04320472481083551:be=.08390980661550446:t[10]>227.50000000000003?be=-.09771783809101153:t[10]>130.50000000000003?be=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?be=-.07610698254064358:t[8]>902.5000000000001?be=-.03136381213599649:t[131]>1e-35?be=.0704821739127936:t[224]>1e-35?be=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?be=.10431473040024908:t[8]>841.5000000000001?be=.07304745320500514:be=-.038011541882439825:be=-.01679746695007364:t[0]>3129.5000000000005?be=.05589952587431965:t[210]>1e-35?be=.06227198085800842:be=-.0011341890997947812:t[8]>740.5000000000001?be=.04817300084412584:be=-.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 pe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.07554189644995735:pe=-.052089349455904946:pe=-.10148206848169845:t[113]>1e-35?pe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?pe=.07172653627995676:pe=-.07602959317610998:pe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?pe=-.0399322883690891:pe=.06523495517476098:pe=-.10358715295743802:t[193]>1e-35?pe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?pe=.015928764772252406:pe=.1341513061552287:pe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?pe=-.033592997607280156:pe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?pe=-.08402551858097379:pe=.017401984506038796:t[1]>25.500000000000004?pe=.13337205393591278:pe=-.01160208350090984:pe=.06708317942315471:t[8]>227.50000000000003?pe=-.08486943882418681:pe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?pe=-.10496268177586783:pe=-.020921489532370493:pe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?pe=.11639296062157028:pe=-.004275784356569115:t[32]>1e-35?pe=-.07297384970166025:pe=.006026841626381599:pe=.002034611134960428;let Se;t[248]>1e-35?Se=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Se=-.06455513326540585:t[1]>29.500000000000004?Se=.07718474591552532:t[4]>7.500000000000001?Se=.040139336931404826:Se=-.09685734690563386:Se=.00015327283570347363:t[9]>88.50000000000001?Se=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Se=-.04077257804338707:Se=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Se=.03778141591008941:Se=-.06459919920634845:Se=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Se=.14063930759326346:t[0]>179.50000000000003?Se=.07287482250668585:t[8]>1180.5000000000002?Se=-.14419393112726253:t[10]>28.500000000000004?Se=-.07993142770099469:t[17]>1e-35?Se=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Se=.05527969663610186:Se=-.10824385941441346:t[3]>11.500000000000002?Se=.12358502961047915:Se=-.017509147119622873:t[0]>74.50000000000001?Se=-.014907705458730486:t[8]>95.50000000000001?Se=-.02225118168342062:Se=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Se=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Se=.04962819555610421:Se=-.07213577821855309:Se=.09139529824708481:t[19]>1e-35?Se=.013439401088345224:Se=-.049274647207292056:Se=.10531673719686951;let Fe;t[40]>1e-35?t[0]>1937.5000000000002?Fe=-.06421671152073961:Fe=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Fe=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Fe=-.03520420769287065:t[8]>1085.5000000000002?Fe=-.019817352506127633:Fe=.11444439424520964:Fe=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Fe=-.010490117519863269:Fe=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Fe=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Fe=.06619344145920268:t[0]>4091.5000000000005?Fe=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Fe=.10016091391222309:Fe=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Fe=-.019511460451434884:Fe=-.11643672465055221:t[2]>18.500000000000004?Fe=.07848228087333317:t[8]>55.50000000000001?Fe=.032583027899956235:Fe=-.11209832692153521:t[11]>1e-35?Fe=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Fe=-.09996887746328006:t[9]>2.5000000000000004?Fe=.02157682011863397:Fe=-.05247727848991843:Fe=.07409150201483244:t[1]>38.50000000000001?Fe=-.11378466075449625:t[224]>1e-35?Fe=-.10741749127732923:t[1]>26.500000000000004?Fe=.07343136534146562:Fe=-.07013573628594773:t[25]>1e-35?Fe=-.04626669734164317:Fe=.05518333197956482:Fe=.00032434010867555516;let te;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?te=.026313251010808853:te=-.08997339150292381:te=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?te=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?te=.0905155504503746:t[8]>1049.5000000000002?te=-.062312558183394054:t[8]>719.5000000000001?te=.09583836191410239:t[0]>3719.5000000000005?te=-.0778097309430818:te=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?te=-.12920865648544927:t[0]>2699.5000000000005?te=-.07086587879041864:te=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?te=-.11377786322600797:te=-.009486325820117998:t[1]>55.50000000000001?te=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?te=-.07938291201004219:t[2]>36.50000000000001?te=.01520046732530246:te=.13649854049662832:te=-.07145015938528873:t[8]>407.50000000000006?te=-.00350257360822279:te=.11332047082193297:te=-.10060624458629897:te=.05429496612497562:t[8]>1446.5000000000002?te=.006073419197482838:te=-.08718676350883998:te=-.11532497988252638:te=.10766270463068293:t[34]>1e-35?te=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?te=-.0004109812623829506:te=.021601073497455662:te=-7343540098965853e-20;let Te;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?Te=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?Te=.05995640200798119:t[0]>3443.5000000000005?Te=-.14698883458733583:Te=-.030039164579240187:t[189]>1e-35?Te=-.06086763220538141:t[1]>86.50000000000001?Te=-.05096727866142538:t[4]>64.50000000000001?Te=.11240554253834577:t[4]>45.50000000000001?Te=-.030279760168394117:t[6]>45.50000000000001?Te=.10161088917815142:t[10]>77.50000000000001?Te=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?Te=-.06672020005240323:Te=.08831457502630258:t[8]>2592.5000000000005?Te=-.052617701047376654:t[10]>29.500000000000004?Te=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?Te=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?Te=-.064099222705728:Te=.044332487521538365:t[0]>2882.5000000000005?Te=.031099546885005065:Te=.12938467051623853:t[0]>4221.500000000001?Te=-.0928676413498701:t[9]>30.500000000000004?Te=-.05781824812803708:Te=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?Te=-.06648105454098469:Te=.05985487552383097:Te=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?Te=.05282385499619401:t[1]>66.50000000000001?Te=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?Te=.027885690791379255:Te=-.08407126408362446:Te=.014432924125571093:Te=-9903435845205118e-20;let Ge;t[76]>1e-35?Ge=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?Ge=.013633653464240465:Ge=-.10164319411983509:Ge=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?Ge=.00632864847804078:Ge=-.08393000368134668:Ge=.07870508617440916:t[284]>1e-35?Ge=.1092302727710421:Ge=-.0025505047582483234:t[248]>1e-35?Ge=.07101822393621864:t[274]>1e-35?Ge=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?Ge=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?Ge=.025081789181021243:Ge=-.014813325803582618:t[9]>33.50000000000001?Ge=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?Ge=.11926990418060353:Ge=.01852125513565268:Ge=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?Ge=-.1178464984373743:t[283]>1e-35?Ge=.043370859226927405:t[5]>4320.500000000001?Ge=-.01103141226366587:t[8]>1104.5000000000002?Ge=-.023053423988095886:Ge=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?Ge=.000579145585864887:Ge=.03389152834202143:t[128]>1e-35?Ge=-.14527722052568462:t[210]>1e-35?Ge=-.08915971541902741:t[7]>9.500000000000002?Ge=-.03307314577076116:t[18]>1e-35?Ge=-.05521712302023565:Ge=.009315605032770029:Ge=.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 se;t[3]>7.500000000000001?t[157]>1e-35?se=-.07514182877923786:se=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?se=.028692053800951845:se=.14081686716133598:se=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?se=.0037139292567243084:se=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?se=.01202688580305612:se=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?se=.043935495082738626:se=-.05639305759669704:t[247]>1e-35?se=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?se=.10331836202616368:se=.0006926658459781341:t[96]>1e-35?se=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?se=-.0741403257305367:se=.022900127535540854:t[7]>3.5000000000000004?se=.038110741403836294:se=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?se=-.09552842289807008:t[1]>27.500000000000004?se=.012505935885798007:se=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?se=-.1046104767723845:se=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?se=.023466328488582572:se=.11730925774586994:se=-.04771965631104874:se=.17059689880751394:se=-.08181850955999449:t[26]>1e-35?se=-.12727482696678769:se=-.014343123272734182;let me;t[147]>1e-35?t[1]>53.50000000000001?me=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?me=-.02763546051134888:me=.06423344777499343:me=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?me=.049825139823021586:t[7]>22.500000000000004?me=-.01131680751379858:t[0]>2579.5000000000005?me=-.10673674485369694:me=-.015387212937189957:me=.04347325151148724:t[179]>1e-35?me=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.0650355590939066:me=-.0473332870892226:me=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?me=.11139543329789044:t[126]>1e-35?me=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?me=.06370903833231022:t[10]>29.500000000000004?me=.03415223859607161:t[10]>3.5000000000000004?me=-.07415518117873297:me=-.0014119203473324082:me=.12617652343819508:t[9]>41.50000000000001?me=-.10311145857176976:t[8]>2757.5000000000005?me=-.08106484219011428:t[7]>71.50000000000001?me=-.09783384432091176:t[1]>88.50000000000001?me=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?me=-.008884084501608536:me=.061339437777743616:me=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?me=.01526664064166223:me=.13534828515415498:me=-.06985484465894776:me=.0005758961943178744;let Ce;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Ce=-.029152732370514342:Ce=.07173628916139178:t[1]>36.50000000000001?Ce=-.08859111297255318:Ce=.0018030071815630785:Ce=.13652461563759322:Ce=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Ce=-.07145140450454163:t[21]>1e-35?Ce=-.07422841663493233:Ce=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Ce=.11864240653986852:t[3]>33.50000000000001?Ce=-.08821209591953476:Ce=.05706392280054726:Ce=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Ce=.01953613016837112:Ce=-.059781039130025006:t[148]>1e-35?Ce=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Ce=.07207826841738371:t[202]>1e-35?Ce=.08163917539410503:Ce=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Ce=-.06858280496900336:Ce=-.1781828899516648:Ce=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Ce=.018232649414147116:Ce=-.04419781124222661:Ce=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Ce=.11452368095776105:Ce=-.036496437259924026:Ce=-.040445338739465486:Ce=.0816572651001145:Ce=-.08968914517368663:Ce=.0002826343082585516;let He;t[189]>1e-35?t[0]>5269.500000000001?He=-.08839493050459957:t[10]>85.50000000000001?He=.10046908365702462:t[8]>2592.5000000000005?He=-.09632233975926387:t[8]>2000.5000000000002?He=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?He=.035504970430426296:t[1]>31.500000000000004?He=-.1133764813142531:He=-.01138280942244812:t[8]>1125.5000000000002?He=.09800530246229806:He=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?He=.07316772160107896:He=-.059095014819051765:He=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?He=-.09150209066166894:t[8]>3084.0000000000005?He=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?He=-.04449234460408263:He=.05568837973347338:He=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?He=.12741077850267066:He=.007372371864985329:t[2]>39.50000000000001?He=.02295917234617787:He=.14966532083907075:t[1]>39.50000000000001?He=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?He=-.02511861881285652:t[1]>27.500000000000004?He=.08683660011672288:He=.02956214835267301:t[9]>15.500000000000002?He=-.016538805462996232:He=.04352738094981517:He=-.05561856645643868:t[9]>170.50000000000003?He=-.07996752635874248:t[179]>1e-35?He=-.09065975936933919:He=-.00042817975060427177;let $e;t[39]>1e-35?t[4]>25.500000000000004?$e=.03443173196222934:$e=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?$e=-.0013415395759330318:$e=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?$e=.002297618040307216:$e=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?$e=-.015297257305397608:$e=.09651828834062742:$e=-.06636003334371929:t[10]>11.500000000000002?$e=.17631616138309397:t[0]>1639.5000000000002?$e=3804386478092585e-20:$e=-.09099296398683193:$e=-.06874415876172972:t[0]>2151.5000000000005?$e=-.1311264883406766:$e=.00809052010141122:t[253]>1e-35?$e=-.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?$e=.045038497754638605:$e=-.07770167665661752:$e=-.08596294280650517:$e=.08538655727027213:$e=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?$e=.054627956617973275:t[1]>61.50000000000001?$e=-.11994465088415499:t[4]>8.500000000000002?$e=.06676200239406452:$e=-.027503148069376867:t[8]>676.5000000000001?$e=-.10363964928357075:t[4]>8.500000000000002?$e=-.07589816227175682:$e=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?$e=.009093153189012338:$e=-.06119765876605404:$e=.0004668642103528348;let et;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?et=-.10100794502567233:et=.08000205636470442:et=-.11945419826856896:t[113]>1e-35?et=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?et=.1224302423880318:et=-.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?et=.0019277012166729114:t[1]>28.500000000000004?et=-.054445821715687494:et=.045645722976713245:t[30]>1e-35?et=.13402660155331655:et=.008921176001777645:et=-.058547426505451076:et=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?et=-.13526418192218206:et=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?et=.0007263224246135398:et=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?et=-.11575657261278308:et=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?et=-.01995960178292952:et=.11216586049153021:et=-.10050961087149474:et=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?et=.10303451081526649:et=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?et=-.043799548968209395:et=-.12451444314954115:t[4]>12.500000000000002?et=-.03838117361958468:et=.06504990789767144:t[57]>1e-35?et=.06890006938293915:et=.0003914274695562949;let ct;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?ct=.004271749009686975:ct=-.10523878297127605:ct=.04633982158107851:ct=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?ct=-.08655730561951676:t[8]>919.5000000000001?ct=-.0676453705610183:t[7]>18.500000000000004?ct=-.027787974193650575:ct=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?ct=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?ct=-.03473877164537313:t[8]>719.5000000000001?ct=.10471053866934404:ct=.008236107678382981:t[4]>57.50000000000001?ct=.09412219478825269:t[10]>66.50000000000001?ct=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?ct=-.040681323751002293:ct=.06374650297561021:ct=.12884615227401788:t[10]>5.500000000000001?ct=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?ct=-.05474068967150784:ct=.03744700650806603:ct=-.07846396348680855:t[1]>42.50000000000001?ct=.018972315810821302:ct=.10953621007604744:t[5]>4439.500000000001?ct=.010999776705494586:t[1]>40.50000000000001?ct=-.12394200059775967:t[10]>2.5000000000000004?ct=.013528093962849453:ct=-.09222088417048682:ct=-.12662967149701485:ct=.09327296405849603:t[3]>99.50000000000001?ct=-.013581954439986752:ct=.0005526498251862075;let bt;t[187]>1e-35?t[243]>1e-35?bt=-.08392792551692502:t[10]>68.50000000000001?bt=.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?bt=-.0825306209711224:bt=.049559996084532945:bt=-.1064938580886302:bt=.03353240732240275:bt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?bt=.16966001471529374:t[1]>57.50000000000001?bt=-.005772777673676247:bt=.09383677041525058:t[8]>747.5000000000001?bt=.054068175469351235:bt=-.049968216310277036:t[8]>753.5000000000001?bt=-.0679383555784074:t[4]>8.500000000000002?bt=-.059757341189735386:bt=.05701083682780414:bt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?bt=.05820296128730006:bt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?bt=.15340611616954566:bt=.04385036188666874:t[0]>4449.500000000001?bt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?bt=.004840354641006495:bt=.09967827580276283:bt=.11605363537391578:t[9]>19.500000000000004?bt=-.0735831692725717:bt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?bt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?bt=-.02442182361342386:bt=.10334853004243093:bt=-.030431948680167104:bt=-956078595250818e-19;let ht;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?ht=-.040232505718244854:t[0]>3030.5000000000005?ht=.0634109586813073:ht=-.04043617034245621:ht=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?ht=-.007859096946435131:ht=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?ht=.05515771679628051:ht=-.04214471312668263:ht=-.09589322222261765:t[193]>1e-35?ht=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?ht=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?ht=-.08152604001147906:t[11]>1e-35?ht=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?ht=.13100930780107503:t[10]>25.500000000000004?ht=.05921074710011526:ht=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?ht=.0009447118243153454:ht=-.09820565036865991:ht=.057146909749745546:t[0]>2115.5000000000005?ht=-.12331216726611678:ht=.007281983677694285:t[2]>56.50000000000001?ht=.012310154675612615:ht=-.08873665774670461:t[6]>25.500000000000004?ht=.134708740821879:t[9]>5.500000000000001?ht=-.0805901581148979:t[224]>1e-35?ht=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?ht=.10842593386554122:t[2]>13.500000000000002?ht=.06466798320378395:ht=-.08578130788886655:ht=-.03590892078300114:ht=.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 ae;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ae=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ae=.020637047900190317:ae=-.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?ae=-.04632587527094407:ae=.08603684785510396:ae=-.05101401015448496:ae=.025466432054358498:ae=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ae=.020385355430046367:ae=.12032592051335252:ae=-.012387370292173013:t[2]>23.500000000000004?ae=-.12568545484492677:ae=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ae=.043528764484784536:ae=.14352071657196003:ae=-.009332833816977268:ae=.11186782227735846:ae=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ae=-.05649104643152564:ae=.03884200719305747:t[42]>1e-35?ae=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ae=-.04103416502526736:ae=.04881823954656287:t[4]>15.500000000000002?ae=.009342724662897898:t[0]>3969.5000000000005?ae=-.025637309961309498:ae=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ae=-.08185697075265091:t[0]>2215.5000000000005?ae=.030063975892297354:t[0]>807.5000000000001?ae=-.03924325550733229:ae=.0415330999189793:ae=-.00024374664461674863;let Re;t[3]>7.500000000000001?Re=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Re=.025798416259686565:Re=.13251610353146012:Re=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Re=-.11098564237775424:Re=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Re=.15347826616466054:t[3]>4.500000000000001?Re=.10379320730958941:Re=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Re=.03159791088468647:Re=-.10612873364104258:Re=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Re=-.02335760775001469:Re=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Re=-.011164334474672973:Re=-.06594044410501655:t[207]>1e-35?Re=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Re=-.01725821503981916:Re=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Re=-.04226531631656534:Re=-.14409800530171432:Re=-.03245576341206398:t[8]>4214.500000000001?Re=.0895409165534886:t[247]>1e-35?Re=-.06506383629143335:t[118]>1e-35?Re=-.07214270121257443:t[8]>546.5000000000001?Re=-.004385020865473831:Re=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Re=.046278501133958524:Re=-.030835570926968044:t[0]>493.50000000000006?Re=-.12794504651610425:Re=.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 ze;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?ze=.029186512383291244:t[7]>1.5000000000000002?ze=-.14984127276725573:t[1]>40.50000000000001?ze=.032757060730648144:ze=-.07675575422749602:t[6]>8.500000000000002?ze=.10599766037117893:ze=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?ze=-.051394622947855385:ze=.03237141302699347:ze=.12526173027943244:ze=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?ze=-.07383912482657777:t[0]>5147.500000000001?ze=.07008813937042091:t[10]>38.50000000000001?ze=-.06779203808365307:ze=-.013782769999524498:ze=.0880038869117715:ze=-.12846294176070952:t[281]>1e-35?ze=-.06810806903850834:t[10]>227.50000000000003?ze=-.08937977001661111:t[10]>130.50000000000003?ze=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?ze=.011036530162093841:ze=-.11500797478569702:ze=.03702229366129399:ze=.07242026683784307:t[189]>1e-35?ze=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?ze=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?ze=-.02608892716555304:ze=.09609599320761308:t[9]>105.50000000000001?ze=-.06848127135991534:ze=.0023675721254089715:t[86]>1e-35?ze=-.11049635625500497:ze=-.004847764219432233;let at;t[125]>1e-35?t[0]>3969.5000000000005?at=-.09462233499115416:at=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?at=-.030700661288166148:at=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?at=.03149547314036763:at=-.08166208257451366:t[0]>5850.500000000001?at=-.10228136324773157:t[102]>1e-35?at=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?at=.01782894842128785:t[13]>1e-35?at=.002680190260979968:at=.1773965720476949:t[2]>72.50000000000001?at=.09090831938627947:t[1]>59.50000000000001?at=-.12297206702816128:t[0]>4977.500000000001?at=.09899015653118268:at=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?at=-.0675900954187773:at=.012336403425364092:at=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?at=-.02671721777458802:at=-.09242452991958029:t[284]>1e-35?at=-.08585691288582491:at=.013332890564324447:t[4]>14.500000000000002?at=-.005245022074799553:t[23]>1e-35?at=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?at=-.09289852307936758:t[116]>1e-35?at=-.09686573010015055:t[8]>804.5000000000001?at=.03812547148215318:at=.005162744968176633:t[9]>43.50000000000001?at=-.059246106396159376:at=.050370113808135275:at=.000794041852811028;let Vt;t[3]>7.500000000000001?Vt=.0004981426543104341:t[9]>114.50000000000001?Vt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Vt=-.019061766497948867:Vt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Vt=-.006044199577160493:Vt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Vt=.11486607015912494:t[9]>16.500000000000004?Vt=-.08686820858087294:Vt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Vt=-.022230207980026437:Vt=.1056683690528792:Vt=-.05859530800943035:Vt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Vt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Vt=-.05177544573528314:Vt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Vt=.15159657923771555:Vt=-.0060542654587671055:t[9]>5.500000000000001?Vt=-.042808028205051786:t[1]>48.50000000000001?Vt=-.010449538258110742:Vt=.10026907521968294:Vt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Vt=-.02272452389409874:Vt=-.11202691218244319:t[5]>1809.5000000000002?Vt=-.04460413584255906:Vt=.08196329474205256:t[10]>69.50000000000001?Vt=.10221481166238167:Vt=.0004063052701699382:t[243]>1e-35?Vt=-.07563941678849846:t[18]>1e-35?Vt=.02563513231103432:Vt=-.004740081147303786;let gr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?gr=.057446442918106:gr=-.04404018270156349:gr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?gr=-.05930486238817954:t[1]>29.500000000000004?gr=.06955866121256543:t[8]>597.5000000000001?gr=-.06538593556505168:gr=.06212512595497445:gr=.00021102929959182257:t[9]>90.50000000000001?gr=.0958061289119631:t[102]>1e-35?gr=.07172059675638813:t[1]>47.50000000000001?gr=-.03879798603977766:t[297]>1e-35?gr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?gr=.003805910996312012:gr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?gr=.11252376801858695:t[288]>1e-35?gr=-.10293901912180432:gr=.014669268837893872:t[1]>42.50000000000001?gr=-.05988274123836837:t[145]>1e-35?gr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?gr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?gr=-.03366718308159971:gr=.11936550608549797:t[1]>31.500000000000004?gr=-.07454716789539667:gr=.027859650621164217:t[10]>10.500000000000002?gr=-.11806374092321247:gr=-.03506042229223101:gr=-.0007080765837654515:t[10]>6.500000000000001?gr=-.028077713664996503:t[2]>7.500000000000001?gr=.15803724124216814:gr=.0351381284833169:gr=-.07877953381054767;let cr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?cr=.14144941521975005:cr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?cr=.10514088112381886:t[7]>18.500000000000004?cr=-.10370643555956745:cr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?cr=-.0508129468802936:t[224]>1e-35?cr=-.037816066368733595:t[10]>43.50000000000001?cr=.07793408602607932:cr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?cr=.036972453794202324:cr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?cr=.09475302525132188:cr=-.03580104945898193:cr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?cr=-.1282448778804823:cr=-.014395808269207212:cr=-.008940927190750592:cr=-.1459118815453748:t[0]>4897.500000000001?cr=-.09733068457286576:t[1]>57.50000000000001?cr=.06575271409540207:cr=-.019556422817450115:cr=-.10623959222984136:t[18]>1e-35?cr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?cr=.008125645893104896:cr=-.11084368630465868:cr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?cr=-.05854904579626861:t[4]>5.500000000000001?cr=.02985784951394175:cr=-.03247600140149334:cr=-.11152899295304973:cr=-.00035424577714215764;let Mr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Mr=-.06563670567578264:Mr=.067656954313663:Mr=-.10388217548685377:t[8]>2302.5000000000005?Mr=.07190621943790435:t[4]>67.50000000000001?Mr=.060020507643618604:t[4]>38.50000000000001?Mr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Mr=-.06568134366461277:t[8]>1075.5000000000002?Mr=-.004768057709758692:Mr=.11785959165999467:Mr=-.05080221682879267:Mr=.14814206127494542:Mr=-.07241946332311736:t[253]>1e-35?Mr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Mr=-.02471195342450034:Mr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Mr=-.10741850739482771:Mr=.010051635824944:Mr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Mr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Mr=-.08992396138178163:Mr=.010944365997007212:Mr=.06221307021813793:Mr=.1286024087559141:t[127]>1e-35?Mr=.06568148624531012:t[10]>40.50000000000001?Mr=-.07567979134643352:t[5]>5647.500000000001?Mr=.07594672895572069:Mr=-.018158016446439187:t[6]>55.50000000000001?Mr=.009293422430111872:t[4]>45.50000000000001?Mr=-.017749818406964022:t[2]>46.50000000000001?Mr=.01714136511113982:Mr=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let Yt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?Yt=.05517359070460923:Yt=-.04758751221404857:Yt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?Yt=.1040436595565776:t[9]>21.500000000000004?Yt=.04032250517675179:t[107]>1e-35?Yt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?Yt=.1192453009230486:t[1]>51.50000000000001?Yt=.0443376336292195:Yt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?Yt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?Yt=-.08999822408398037:Yt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?Yt=-.061850439226075:Yt=.08849196353361093:Yt=.10536348167793089:t[92]>1e-35?Yt=.04894947712119185:t[9]>16.500000000000004?Yt=.05900227903883853:t[9]>5.500000000000001?Yt=-.11946594348916476:Yt=-.03652096348071964:t[1]>41.50000000000001?Yt=-.07411603110840567:Yt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?Yt=.08493634342741495:t[11]>1e-35?Yt=-.10899097825564363:Yt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?Yt=.08356655906359918:t[7]>25.500000000000004?Yt=-.09475076526194888:t[10]>5.500000000000001?Yt=-.01999406228763778:Yt=.06696212545889428:t[6]>20.500000000000004?Yt=.14713592661393468:Yt=.0459917279002218:Yt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let $0=FVs(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+L+B+q+M+O+j+Q+U+Y+W+V+z+ie+H+re+le+Le+ge+Ue+ke+X+ee+K+he+Z+ue+qe+ne+ce+Ne+we+Be+rt+st+_t+Dt+$t+Gt+Ie+F+be+Qe+pe+Se+Fe+te+Te+Ge+J+se+me+Ce+He+$e+et+ct+bt+ht+We+ae+Re+Me+ye+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-$0,$0]}a(kXn,"multilineModelPredict");function FVs(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(FVs,"sigmoid");var UVs={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},PXn={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function DXn(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(UVs[r]??[]).some(l=>s.includes(l))}a(DXn,"hasComment");var Flt=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=DXn(e,-2,r),this.rstripSecondToLastLineHasComment=DXn(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]}},Pfr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Blt(e,n),this.suffixFeatures=new Blt(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(xXn).length+1).fill(0);r[xXn[this.language]??0]=1;let n=new Array(Object.keys(E8).length+1).fill(0);n[E8[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(E8).length+1).fill(0);o[E8[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(E8).length+1).fill(0);s[E8[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(E8).length+1).fill(0);return c[E8[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function MVs(t,e){return new Pfr(t.prefix,t.suffix,e)}a(MVs,"constructMultilineFeatures");function RXn(t,e){let r=MVs(t,e).constructFeatures();return IXn(r)[1]}a(RXn,"requestMultilineScore");p();var Dfr=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}},Flt=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 Dfr(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 eVe(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=cYe(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 ry=class{static{a(this,"InlineCompletionManager")}};var Ult=new fe("getCompletions"),aNe="legacy",cNe=["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 Qlt(t,e,r){t.get(ry).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=rme(r.resultType),n.properties.completionsImplementation??=aNe,Et(t,o,n),At(t,o,fU(n.properties,cNe),n.measurements)}a(Qlt,"telemetryShown");function kXn(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=aNe,Et(t,n,r),At(t,n,fU(r.properties,cNe),r.measurements)}a(kXn,"telemetryAccepted");function PXn(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=aNe,Et(t,n,r),At(t,n,fU(r.properties,cNe),r.measurements)}a(PXn,"telemetryRejected");function kH(t,e={}){return t.properties.completionsImplementation??=aNe,{...e,telemetryBlob:t}}a(kH,"mkCanceledResultTelemetry");function yp(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??aNe};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(kk).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(yp,"mkBasicResultTelemetry");function DXn(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=yl()-e.telemetryBlob.issuedTime,n=rme(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 Ult.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),vse(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(Ult.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){Et(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}vse(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(DXn,"handleGhostTextResultTelemetry");function rme(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(rme,"resultTypeToString");p();p();p();var OVs={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},LVs="ms-vscode.cpptools",BVs="CppCompletionContextProvider";function NXn(t,e,r,n){(e.includes(BVs)||e.length===1&&e[0]==="*")&&OXn(t,r,n)}a(NXn,"fillInCppVSActiveExperiments");function MXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(LVs))&&OXn(t,r,n)}a(MXn,"fillInCppVSCodeActiveExperiments");function OXn(t,e,r){try{let n=OVs,o=t.get(Zt).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Nr.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Nr.exception(t,n,"fillInCppActiveExperiments")}}a(OXn,"addActiveExperiments");p();function qlt(t,e,r){try{let n=t.get(Zt).csharpContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a(qlt,"fillInCSharpActiveExperiments");p();var Nfr="fallbackContextProvider",Mfr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function LXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Nfr))&&FVs(t,r,n)}a(LXn,"fillInMultiLanguageActiveExperiments");function FVs(t,e,r){try{let n=UVs(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Nr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(FVs,"addActiveExperiments");function UVs(t,e){let r=Mfr,n=t.get(Zt).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Nr.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a(UVs,"getMultiLanguageContextProviderParamsFromExp");p();var QVs="typescript-ai-context-provider";function BXn(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(QVs)))return!1;try{let o=t.get(Zt).tsContextProviderParams(n);if(o){let s=JSON.parse(o);for(let[c,l]of Object.entries(s))r.set(c,l)}}catch(o){return Nr.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a(BXn,"fillInTsActiveExperiments");p();Mo();var FXn=S.Object({importance:S.Optional(S.Integer({minimum:0,maximum:100})),id:S.Optional(S.String()),origin:S.Optional(S.Union([S.Literal("request"),S.Literal("update")]))}),UXn=S.Intersect([S.Object({name:S.String(),value:S.String()}),FXn]),QXn=S.Intersect([S.Object({uri:S.String(),value:S.String(),additionalUris:S.Optional(S.Array(S.String()))}),FXn]),qVs=[UXn,QXn],jVs=S.Union(qVs),HVs=new Map([["Trait",qu.Compile(UXn)],["CodeSnippet",qu.Compile(QXn)]]),GVs=a(t=>t,"ensureTypesAreEqual");GVs(!0);var $Vs=S.Object({contextItems:S.Array(jVs)}),VVs=S.Object({selector:S.Array(S.Union([S.String(),S.Object({language:S.Optional(S.String()),scheme:S.Optional(S.String()),pattern:S.Optional(S.String())})]))}),Ofr=S.Object({id:S.String()}),WVs=S.Intersect([Ofr,VVs]),zVs=S.Intersect([Ofr,$Vs]),qXn=S.Object({providers:S.Array(WVs)}),jXn=S.Object({providers:S.Array(Ofr)}),Lfr=S.Object({providers:S.Array(zVs),updating:S.Optional(S.Array(S.String()))}),HXn=S.Intersect([_vn,S.Object({contextItems:S.Optional(Lfr)})]);function jlt(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(jlt,"filterContextItemsByType");function GXn(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of HVs.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(GXn,"filterSupportedContextItems");function YVs(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(YVs,"validateContextItemId");function $Xn(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??Mt();if(!YVs(s)){let c=Mt();Nr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=Mt();Nr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a($Xn,"addOrValidateContextItemsIDs");p();var pm=class{constructor(e=()=>new Bfr){this.createStatistics=e;this.statistics=new Cn(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)}}},Bfr=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 Hlt(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(Hlt,"componentStatisticsToPromptMatcher");var VXn=de(ri());var hm=class{static{a(this,"ContextProviderRegistry")}},r4=class{static{a(this,"DefaultContextProviders")}},nme=class extends r4{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},Ffr=class extends hm{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 Nr.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;qlt(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 Nr.debug(this.ctx,"Resolving context providers cancelled"),[];MXn(this.ctx,h.map(T=>T[0].id),u,s),LXn(this.ctx,h.map(T=>T[0].id),u,s),BXn(this.ctx,h.map(T=>T[0].id),u,s);let g=new VXn.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=kCe(this.ctx)&&!Q9e(this.ctx)?0:KVs(this.ctx,s),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=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(pm).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);_.set(T.id,R)}let b=await Rfn(_,g.token);E&&clearTimeout(E);for(let[T,w]of h){let R=b.get(T.id);if(R){if(R.status==="error")xP(R.reason)||Nr.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")&&(Nr.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let B=T.resolver.resolveOnTimeout(v);l6t(B)?x.push(...B):B&&x.push(B),x.length>0&&(R.status="partial")}catch(B){Nr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,B)}let[P,D]=GXn(x);D&&Nr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=$Xn(this.ctx,P),L={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(L)}this.ctx.get(pm).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Nr.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=WXn(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}},Ufr=class extends hm{constructor(r){super();this.delegate=r;this._cachedContextItems=new Cn(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 Glt(t,e){return new Ufr(new Ffr(t,e))}a(Glt,"getContextProviderRegistry");function $lt(t,e,r){let n=t.get(pm).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(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a($lt,"telemetrizeContextItems");function Vlt(t){return t.matchScore>0&&t.resolution!=="error"}a(Vlt,"matchContextItems");function WXn(t,e){let r=Qfr(t,e),n=Ft(t,Ye.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(r4).getIds();return Array.from(new Set([...o,...r,...n]))}a(WXn,"getActiveContextProviders");function Qfr(t,e){return kCe(t)?["*"]:t.get(Zt).contextProviders(e)}a(Qfr,"getExpContextProviders");function ime(t,e){return WXn(t,e).length>0}a(ime,"useContextProviderAPI");function KVs(t,e){let r=Ft(t,Ye.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(Zt).contextProviderTimeBudget(e)}a(KVs,"getContextProviderTimeBudget");var Nb=class{constructor(e){this.ctx=e;this.scheduledResolutions=new Cn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(hm),{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 Wlt=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 AQ(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)}},zlt=class extends Wlt{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]}},Dfr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Flt(e,n),this.suffixFeatures=new Flt(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(PXn).length+1).fill(0);r[PXn[this.language]??0]=1;let n=new Array(Object.keys(_8).length+1).fill(0);n[_8[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(_8).length+1).fill(0);o[_8[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(_8).length+1).fill(0);s[_8[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(_8).length+1).fill(0);return c[_8[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function QVs(t,e){return new Dfr(t.prefix,t.suffix,e)}a(QVs,"constructMultilineFeatures");function NXn(t,e){let r=QVs(t,e).constructFeatures();return kXn(r)[1]}a(NXn,"requestMultilineScore");p();var Nfr=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}},Ult=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 Nfr(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 rVe(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=dYe(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 ry=class{static{a(this,"InlineCompletionManager")}};var Qlt=new fe("getCompletions"),lNe="legacy",uNe=["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 qlt(t,e,r){t.get(ry).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=nme(r.resultType),n.properties.completionsImplementation??=lNe,Et(t,o,n),At(t,o,pU(n.properties,uNe),n.measurements)}a(qlt,"telemetryShown");function MXn(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=lNe,Et(t,n,r),At(t,n,pU(r.properties,uNe),r.measurements)}a(MXn,"telemetryAccepted");function OXn(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=lNe,Et(t,n,r),At(t,n,pU(r.properties,uNe),r.measurements)}a(OXn,"telemetryRejected");function PH(t,e={}){return t.properties.completionsImplementation??=lNe,{...e,telemetryBlob:t}}a(PH,"mkCanceledResultTelemetry");function yp(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??lNe};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(Pk).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(yp,"mkBasicResultTelemetry");function LXn(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=yl()-e.telemetryBlob.issuedTime,n=nme(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 Qlt.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),vse(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(Qlt.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){Et(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}vse(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(LXn,"handleGhostTextResultTelemetry");function nme(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(nme,"resultTypeToString");p();p();p();var qVs={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},jVs="ms-vscode.cpptools",HVs="CppCompletionContextProvider";function BXn(t,e,r,n){(e.includes(HVs)||e.length===1&&e[0]==="*")&&UXn(t,r,n)}a(BXn,"fillInCppVSActiveExperiments");function FXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(jVs))&&UXn(t,r,n)}a(FXn,"fillInCppVSCodeActiveExperiments");function UXn(t,e,r){try{let n=qVs,o=t.get(Zt).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Nr.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Nr.exception(t,n,"fillInCppActiveExperiments")}}a(UXn,"addActiveExperiments");p();function jlt(t,e,r){try{let n=t.get(Zt).csharpContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a(jlt,"fillInCSharpActiveExperiments");p();var Mfr="fallbackContextProvider",Ofr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function QXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Mfr))&&GVs(t,r,n)}a(QXn,"fillInMultiLanguageActiveExperiments");function GVs(t,e,r){try{let n=$Vs(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Nr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(GVs,"addActiveExperiments");function $Vs(t,e){let r=Ofr,n=t.get(Zt).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Nr.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a($Vs,"getMultiLanguageContextProviderParamsFromExp");p();var VVs="typescript-ai-context-provider";function qXn(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(VVs)))return!1;try{let o=t.get(Zt).tsContextProviderParams(n);if(o){let s=JSON.parse(o);for(let[c,l]of Object.entries(s))r.set(c,l)}}catch(o){return Nr.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a(qXn,"fillInTsActiveExperiments");p();Oo();var jXn=S.Object({importance:S.Optional(S.Integer({minimum:0,maximum:100})),id:S.Optional(S.String()),origin:S.Optional(S.Union([S.Literal("request"),S.Literal("update")]))}),HXn=S.Intersect([S.Object({name:S.String(),value:S.String()}),jXn]),GXn=S.Intersect([S.Object({uri:S.String(),value:S.String(),additionalUris:S.Optional(S.Array(S.String()))}),jXn]),WVs=[HXn,GXn],zVs=S.Union(WVs),YVs=new Map([["Trait",qu.Compile(HXn)],["CodeSnippet",qu.Compile(GXn)]]),KVs=a(t=>t,"ensureTypesAreEqual");KVs(!0);var JVs=S.Object({contextItems:S.Array(zVs)}),ZVs=S.Object({selector:S.Array(S.Union([S.String(),S.Object({language:S.Optional(S.String()),scheme:S.Optional(S.String()),pattern:S.Optional(S.String())})]))}),Lfr=S.Object({id:S.String()}),XVs=S.Intersect([Lfr,ZVs]),eWs=S.Intersect([Lfr,JVs]),$Xn=S.Object({providers:S.Array(XVs)}),VXn=S.Object({providers:S.Array(Lfr)}),Bfr=S.Object({providers:S.Array(eWs),updating:S.Optional(S.Array(S.String()))}),WXn=S.Intersect([vvn,S.Object({contextItems:S.Optional(Bfr)})]);function Hlt(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(Hlt,"filterContextItemsByType");function zXn(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of YVs.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(zXn,"filterSupportedContextItems");function tWs(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(tWs,"validateContextItemId");function YXn(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??Mt();if(!tWs(s)){let c=Mt();Nr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=Mt();Nr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a(YXn,"addOrValidateContextItemsIDs");p();var pm=class{constructor(e=()=>new Ffr){this.createStatistics=e;this.statistics=new Cn(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)}}},Ffr=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 Glt(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(Glt,"componentStatisticsToPromptMatcher");var KXn=de(ti());var hm=class{static{a(this,"ContextProviderRegistry")}},r4=class{static{a(this,"DefaultContextProviders")}},ime=class extends r4{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},Ufr=class extends hm{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 Nr.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;jlt(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 Nr.debug(this.ctx,"Resolving context providers cancelled"),[];FXn(this.ctx,h.map(T=>T[0].id),u,s),QXn(this.ctx,h.map(T=>T[0].id),u,s),qXn(this.ctx,h.map(T=>T[0].id),u,s);let g=new KXn.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=PCe(this.ctx)&&!j9e(this.ctx)?0:rWs(this.ctx,s),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=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(pm).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);_.set(T.id,R)}let b=await kfn(_,g.token);E&&clearTimeout(E);for(let[T,w]of h){let R=b.get(T.id);if(R){if(R.status==="error")wP(R.reason)||Nr.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")&&(Nr.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let B=T.resolver.resolveOnTimeout(v);u6t(B)?x.push(...B):B&&x.push(B),x.length>0&&(R.status="partial")}catch(B){Nr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,B)}let[P,D]=zXn(x);D&&Nr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=YXn(this.ctx,P),L={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(L)}this.ctx.get(pm).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Nr.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=JXn(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}},Qfr=class extends hm{constructor(r){super();this.delegate=r;this._cachedContextItems=new Cn(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 $lt(t,e){return new Qfr(new Ufr(t,e))}a($lt,"getContextProviderRegistry");function Vlt(t,e,r){let n=t.get(pm).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(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(Vlt,"telemetrizeContextItems");function Wlt(t){return t.matchScore>0&&t.resolution!=="error"}a(Wlt,"matchContextItems");function JXn(t,e){let r=qfr(t,e),n=Ft(t,Ye.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(r4).getIds();return Array.from(new Set([...o,...r,...n]))}a(JXn,"getActiveContextProviders");function qfr(t,e){return PCe(t)?["*"]:t.get(Zt).contextProviders(e)}a(qfr,"getExpContextProviders");function ome(t,e){return JXn(t,e).length>0}a(ome,"useContextProviderAPI");function rWs(t,e){let r=Ft(t,Ye.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(Zt).contextProviderTimeBudget(e)}a(rWs,"getContextProviderTimeBudget");var Nb=class{constructor(e){this.ctx=e;this.scheduledResolutions=new Cn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(hm),{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 zlt=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 yQ(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)}},Ylt=class extends zlt{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(YXn,"rewindToNearestNonWs");function zXn(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(zXn,"indent");function ZVs(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=zXn(t,r),o=zXn(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(ZVs,"outdented");var n4=class extends Wlt{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&&Ddn(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(E=>E.hasError)?.children.find(E=>E.type=="block"));let A,y=0;for(let E of l.children){if(E.type==":"&&y==0){A=E;break}E.type=="("&&(y+=1),E.type==")"&&(y-=1)}if(A&&m.endIndex<=A.startIndex&&A.nextSibling){if(m.type=="def"){let E=A.nextSibling;if(E.type=='"'||E.type=="'"||E.type=="ERROR"&&(E.text=='"""'||E.text=="'''"))return!0}return!1}break}case"javascript":{if(m.type==="class")if(s<=13){if(h.find(_=>_.type==="formal_parameters"))return!0}else{let E=l.children;for(let _=0;_E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}case"typescript":{let A=h.find(E=>E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.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()}}},XVs={python:new n4("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 n4("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 n4("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 n4("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 zlt("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 zlt("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 n4("csharp",{},new Map([]),[],"block",null,!0),java:new n4("java",{},new Map([]),[],"block",null,!0),php:new n4("php",{},new Map([]),[],"block",null,!0),cpp:new n4("cpp",{},new Map([]),[],"block",null,!0)};function qfr(t){if(!kS(t))throw new Error(`Language ${t} is not supported`);return XVs[Z$e(t)]}a(qfr,"getBlockParser");async function KXn(t,e,r){return kS(t)?qfr(t).isEmptyBlockStart(e,r):!1}a(KXn,"isEmptyBlockStart");async function JXn(t,e,r,n){if(kS(t))return qfr(t).isBlockBodyFinished(e,r,n)}a(JXn,"isBlockBodyFinished");async function ZXn(t,e,r){if(kS(t))return qfr(t).getNodeStart(e,r)}a(ZXn,"getNodeStart");var T3f=new fe("parseBlock");function lNe(t,e,r){let n=e.getText(gu.range(gu.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>JXn(s,n,c,o)}a(lNe,"parsingBlockFinished");function Klt(t,e){return KXn(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(Klt,"isEmptyBlockStartUtil");async function XXn(t,e,r,n){let s=e.getText(gu.range(gu.position(0,0),r))+n,c=await ZXn(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(XXn,"getNodeStartUtil");var eWs=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),tWs=new RegExp(`^(${eWs.join("|")})`);function rWs(t){return tWs.test(t.trimLeft().toLowerCase())}a(rWs,"isContinuationLine");function Ylt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Ylt,"indentationOfLine");function Jlt(t,e){let r=t.getText(),n=t.offsetAt(e);return jfr(r,n,t.detectedLanguageId)}a(Jlt,"contextIndentation");function jfr(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(nWs,"getLineAtOffset");function XXn(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(XXn,"rewindToNearestNonWs");function ZXn(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(ZXn,"indent");function iWs(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=ZXn(t,r),o=ZXn(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(iWs,"outdented");var n4=class extends zlt{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&&Ndn(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(E=>E.hasError)?.children.find(E=>E.type=="block"));let A,y=0;for(let E of l.children){if(E.type==":"&&y==0){A=E;break}E.type=="("&&(y+=1),E.type==")"&&(y-=1)}if(A&&m.endIndex<=A.startIndex&&A.nextSibling){if(m.type=="def"){let E=A.nextSibling;if(E.type=='"'||E.type=="'"||E.type=="ERROR"&&(E.text=='"""'||E.text=="'''"))return!0}return!1}break}case"javascript":{if(m.type==="class")if(s<=13){if(h.find(_=>_.type==="formal_parameters"))return!0}else{let E=l.children;for(let _=0;_E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}case"typescript":{let A=h.find(E=>E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.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()}}},oWs={python:new n4("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 n4("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 n4("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 n4("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 Ylt("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 Ylt("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 n4("csharp",{},new Map([]),[],"block",null,!0),java:new n4("java",{},new Map([]),[],"block",null,!0),php:new n4("php",{},new Map([]),[],"block",null,!0),cpp:new n4("cpp",{},new Map([]),[],"block",null,!0)};function jfr(t){if(!PS(t))throw new Error(`Language ${t} is not supported`);return oWs[eVe(t)]}a(jfr,"getBlockParser");async function eei(t,e,r){return PS(t)?jfr(t).isEmptyBlockStart(e,r):!1}a(eei,"isEmptyBlockStart");async function tei(t,e,r,n){if(PS(t))return jfr(t).isBlockBodyFinished(e,r,n)}a(tei,"isBlockBodyFinished");async function rei(t,e,r){if(PS(t))return jfr(t).getNodeStart(e,r)}a(rei,"getNodeStart");var M3f=new fe("parseBlock");function dNe(t,e,r){let n=e.getText(gu.range(gu.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>tei(s,n,c,o)}a(dNe,"parsingBlockFinished");function Jlt(t,e){return eei(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(Jlt,"isEmptyBlockStartUtil");async function nei(t,e,r,n){let s=e.getText(gu.range(gu.position(0,0),r))+n,c=await rei(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(nei,"getNodeStartUtil");var sWs=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),aWs=new RegExp(`^(${sWs.join("|")})`);function cWs(t){return aWs.test(t.trimLeft().toLowerCase())}a(cWs,"isContinuationLine");function Klt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Klt,"indentationOfLine");function Zlt(t,e){let r=t.getText(),n=t.offsetAt(e);return Hfr(r,n,t.detectedLanguageId)}a(Zlt,"contextIndentation");function Hfr(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=Ylt(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=Ylt(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=Klt(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=Klt(n[f]);if(h!==void 0&&h{let n=iWs(r,t,e);return n==="continue"?void 0:n}}a(eei,"indentationBlockFinished");p();p();p();p();p();p();var oWs={tokenizerName:"o200k_base"};function sWs(t){return{...oWs,...t}}a(sWs,"cursorContextOptions");function uNe(t,e={}){let r=sWs(e),n=ws(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&&lWs&&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=uWs(r,t,e);return n==="continue"?void 0:n}}a(iei,"indentationBlockFinished");p();p();p();p();p();p();var dWs={tokenizerName:"o200k_base"};function fWs(t){return{...dWs,...t}}a(fWs,"cursorContextOptions");function fNe(t,e={}){let r=fWs(e),n=ws(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(uNe,"getCursorContext");p();p();var aWs={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 tei(t){let e=aWs[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(tei,"announceSnippet");var Hfr=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 Gfr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=dWs.get(e.languageId)??uWs}tokenize(e){return new Set(cWs(e).filter(r=>!this.stopsForLanguage.has(r)))}},rei=new Hfr(20),ome=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new Gfr(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=rei.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(E=>A.add(E),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 $fr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=AWs.get(e.languageId)??gWs}tokenize(e){return new Set(hWs(e).filter(r=>!this.stopsForLanguage.has(r)))}},sei=new Gfr(20),sme=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new $fr(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=sei.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(E=>A.add(E),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(cWs,"splitIntoWords");var lWs=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"]),uWs=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",...lWs]),dWs=new Map([]);p();function Zlt(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 Zlt(this.windowLength,e)}_getCursorContextInfo(e){return uNe(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return fWs(e,r)}};function fWs(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(fWs,"computeScore");p();var eut=class t extends ome{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 Zlt(this.windowLength,e)}_getCursorContextInfo(e){return uNe(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):uNe(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return pWs(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await AQ(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 pWs(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(pWs,"computeScore");var hWs=0,mWs=60,gWs=4,AWs=1,yWs=20,EWs=1e4,nei={snippetLength:mWs,threshold:hWs,maxTopSnippets:gWs,maxCharPerFile:EWs,maxNumberOfFiles:yWs,maxSnippetsPerFile:AWs,useSubsetMatching:!1};var $fr={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function _Ws(t,e){return(e.useSubsetMatching?eut.FACTORY(e.snippetLength):Xlt.FACTORY(e.snippetLength)).to(t)}a(_Ws,"getMatcher");async function iei(t,e,r){let n=_Ws(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(iei,"getSimilarSnippets");function oei(t,e){return{...$fr,useSubsetMatching:Vfr(t,e)}}a(oei,"getCppSimilarFilesOptions");function sei(t){return $fr.maxTopSnippets}a(sei,"getCppNumberOfSnippets");var vWs=new Map([["cpp",oei]]);function tut(t,e,r){let n=vWs.get(r);return n?n(t,e):{...nei,useSubsetMatching:Vfr(t,e)}}a(tut,"getSimilarFilesOptions");var CWs=new Map([["cpp",sei]]);function aei(t,e){let r=CWs.get(e);return r?r(t):xdn}a(aei,"getNumberOfSnippets");function Vfr(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||Ft(t,Ye.UseSubsetMatching))??!1}a(Vfr,"useSubsetMatching");p();p();p();p();var bWs="content_excluded";async function rut(t,e,r,n){let o=jlt(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(pm).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,bWs]]),m}).map(f=>f.data)}a(rut,"getCodeSnippetsFromContextItems");function cei(t,e){let r=t.get($r);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(cei,"addRelativePathToCodeSnippets");p();function Ep(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(Ep,"Text");function PH(t){return t.children}a(PH,"Chunk");p();function Kn(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(Kn,"functionComponentFunction");function j2(t){return{type:"f",children:t}}a(j2,"fragmentFunction");j2.isFragmentFunction=!0;var nut=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(Mb,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=cei(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(Kn(Ep,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(Kn(Ep,{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=Kfr(c);return Kn(j2,{children:[Kn(zX,{document:r,position:o,maxCharacters:m}),Kn(aut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(fNe,"CurrentFile");function zX(t){if(t.document===void 0||t.position===void 0)return Kn(Ep,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),Kn(Ep,{children:e})}a(zX,"BeforeCursor");function aut(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return Kn(Ep,{});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 Kn(Ep,{});if(r===s)return Kn(Ep,{children:r});let c=s;if(r!==""){let l=ws(t.tokenizer),u=l.takeFirstTokens(s,dNe);u.tokens.length>0&&100*sut(u.tokens,l.takeFirstTokens(r,dNe).tokens)?.score<(t.suffixMatchThreshold??z$e)*u.tokens.length&&(c=r)}return c!==r&&n(c),Kn(Ep,{children:c})}a(aut,"AfterCursor");function lei(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(Mb,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=Kfr(c);return Kn(zX,{document:r,position:o,maxCharacters:u})}a(lei,"DocumentPrefix");function uei(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(Mb,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=Kfr(c);return Kn(aut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(uei,"DocumentSuffix");p();var cut=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 dei(t){return t.map(e=>e.elidedValue).join("")}a(dei,"makePrompt");function fei(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(fei,"makePrefixPrompt");function pei(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(pei,"makeContextPrompt");p();var sme=class{constructor(e,r=Jfr()){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 Jfr(){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===PH.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(Jfr,"defaultTransformers");p();var Zfr={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"]}},hei={};for(let[t,e]of Object.entries(Zfr))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)hei[r]=t;else hei[t]=t;var SWs={start:"//",end:""},TWs=["php","plaintext"],Xfr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function mei(t){return Object.values(Xfr).includes(t.trim())}a(mei,"isShebangLine");function IWs({source:t}){return t.startsWith("#!")||t.startsWith("e.length>0)}a(hWs,"splitIntoWords");var mWs=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"]),gWs=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",...mWs]),AWs=new Map([]);p();function Xlt(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 Xlt(this.windowLength,e)}_getCursorContextInfo(e){return fNe(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return yWs(e,r)}};function yWs(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(yWs,"computeScore");p();var tut=class t extends sme{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 Xlt(this.windowLength,e)}_getCursorContextInfo(e){return fNe(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):fNe(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return EWs(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await yQ(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 EWs(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(EWs,"computeScore");var _Ws=0,vWs=60,CWs=4,bWs=1,SWs=20,TWs=1e4,aei={snippetLength:vWs,threshold:_Ws,maxTopSnippets:CWs,maxCharPerFile:TWs,maxNumberOfFiles:SWs,maxSnippetsPerFile:bWs,useSubsetMatching:!1};var Vfr={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function IWs(t,e){return(e.useSubsetMatching?tut.FACTORY(e.snippetLength):eut.FACTORY(e.snippetLength)).to(t)}a(IWs,"getMatcher");async function cei(t,e,r){let n=IWs(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(cei,"getSimilarSnippets");function lei(t,e){return{...Vfr,useSubsetMatching:Wfr(t,e)}}a(lei,"getCppSimilarFilesOptions");function uei(t){return Vfr.maxTopSnippets}a(uei,"getCppNumberOfSnippets");var xWs=new Map([["cpp",lei]]);function rut(t,e,r){let n=xWs.get(r);return n?n(t,e):{...aei,useSubsetMatching:Wfr(t,e)}}a(rut,"getSimilarFilesOptions");var wWs=new Map([["cpp",uei]]);function dei(t,e){let r=wWs.get(e);return r?r(t):wdn}a(dei,"getNumberOfSnippets");function Wfr(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||Ft(t,Ye.UseSubsetMatching))??!1}a(Wfr,"useSubsetMatching");p();p();p();p();var RWs="content_excluded";async function nut(t,e,r,n){let o=Hlt(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(pm).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,RWs]]),m}).map(f=>f.data)}a(nut,"getCodeSnippetsFromContextItems");function fei(t,e){let r=t.get($r);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(fei,"addRelativePathToCodeSnippets");p();function Ep(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(Ep,"Text");function DH(t){return t.children}a(DH,"Chunk");p();function Yn(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(Yn,"functionComponentFunction");function H2(t){return{type:"f",children:t}}a(H2,"fragmentFunction");H2.isFragmentFunction=!0;var iut=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(Mb,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=fei(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(Yn(Ep,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(Yn(Ep,{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=Jfr(c);return Yn(H2,{children:[Yn(zX,{document:r,position:o,maxCharacters:m}),Yn(cut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(hNe,"CurrentFile");function zX(t){if(t.document===void 0||t.position===void 0)return Yn(Ep,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),Yn(Ep,{children:e})}a(zX,"BeforeCursor");function cut(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return Yn(Ep,{});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 Yn(Ep,{});if(r===s)return Yn(Ep,{children:r});let c=s;if(r!==""){let l=ws(t.tokenizer),u=l.takeFirstTokens(s,pNe);u.tokens.length>0&&100*aut(u.tokens,l.takeFirstTokens(r,pNe).tokens)?.score<(t.suffixMatchThreshold??K$e)*u.tokens.length&&(c=r)}return c!==r&&n(c),Yn(Ep,{children:c})}a(cut,"AfterCursor");function pei(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(Mb,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=Jfr(c);return Yn(zX,{document:r,position:o,maxCharacters:u})}a(pei,"DocumentPrefix");function hei(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(Mb,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=Jfr(c);return Yn(cut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(hei,"DocumentSuffix");p();var lut=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 mei(t){return t.map(e=>e.elidedValue).join("")}a(mei,"makePrompt");function gei(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(gei,"makePrefixPrompt");function Aei(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(Aei,"makeContextPrompt");p();var ame=class{constructor(e,r=Zfr()){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 Zfr(){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===DH.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(Zfr,"defaultTransformers");p();var Xfr={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"]}},yei={};for(let[t,e]of Object.entries(Xfr))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)yei[r]=t;else yei[t]=t;var kWs={start:"//",end:""},PWs=["php","plaintext"],epr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function Eei(t){return Object.values(epr).includes(t.trim())}a(Eei,"isShebangLine");function DWs({source:t}){return t.startsWith("#!")||t.startsWith("xWs(s,e)).join(` +`).map(s=>NWs(s,e)).join(` `);return r?o+` -`:o}a(i4,"commentBlockAsSingles");function lut(t){let{languageId:e}=t;return TWs.indexOf(e)===-1&&!IWs(t)?e in Xfr?Xfr[e]:`Language: ${e}`:""}a(lut,"getLanguageMarker");function uut(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(uut,"getPathMarker");function pNe(t){return t===""||t.endsWith(` +`:o}a(i4,"commentBlockAsSingles");function uut(t){let{languageId:e}=t;return PWs.indexOf(e)===-1&&!DWs(t)?e in epr?epr[e]:`Language: ${e}`:""}a(uut,"getLanguageMarker");function dut(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(dut,"getPathMarker");function mNe(t){return t===""||t.endsWith(` `)?t:t+` -`}a(pNe,"newLineEnded");var wWs=5,ame=class{constructor(){this.renderId=0;this.formatPrefix=dei}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 cut,{blocks:[y,...E]}=A.elide(u,h,d,m,ws(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...RWs([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-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-wWs: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 sme(e,epr).walkSnapshot((f,h,m)=>{if(f===e||(f.name===fNe.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:hNe(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:mei(f.value)?y=A:y=i4(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:hNe(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${fNe.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}}},epr=[...Jfr(),(t,e,r)=>iut(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===zX.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===aut.name?{...r,type:"suffix"}:r];function RWs(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(RWs,"computeComponentStatistics");function hNe(t){return t.replace(/\r\n?/g,` -`)}a(hNe,"normalizeLineEndings");p();var dut=a((t,e)=>{let[r,n]=e.useState();if(e.useData(Mb,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?Kn(kWs,{docInfo:c}):Kn(PWs,{docInfo:c})}},"DocumentMarker"),kWs=a(t=>Kn(Ep,{children:uut(t.docInfo)}),"PathMarker"),PWs=a(t=>Kn(Ep,{children:lut(t.docInfo)}),"LanguageMarker");p();p();p();var PKs=de(cee()),DKs=de(h4()),sri=de(Ro()),NKs=de(Dut());var m4=class extends sri.Disposable{static{a(this,"RecentEditsProvider")}};function MKs(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(MKs,"editIsTooCloseToCursor");var odt=a((t,e)=>{let[r,n]=e.useState();return e.useData(Mb,async o=>{if(!o.document)return;let s=t.ctx.get(m4);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 E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(MKs(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift(pNe(`File: ${T}`)+pNe(b))}}if(f.length===0){n(void 0);return}let h=pNe("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+pNe("End of recent edits");n(h)}),r?Kn(PH,{children:Kn(Ep,{children:r})}):void 0},"RecentEdits");p();p();p();var sdt=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>uee.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&adt(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(CXn(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 ari(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(ari,"shortCircuit");p();function LKs(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(LKs,"defaultHash");function nhr(t,e={}){let{hash:r=LKs,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(nhr,"memoize");var cri={entries:[],traits:[]},cdt={entries:new Map,traits:[]},ihr=class extends Cn{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=FKs?c=cdt:c=void 0);let l=performance.now()-s;if(v0.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 ldt;return c}a(uri,"getRelatedFiles");var ohr=nhr(uri,{cache:lri,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});ohr=ari(ohr,200,cdt);async function udt(t,e,r,n,o,s=!1){let c=t.get(dee),l=cdt;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await uri(t,u,r,n,c):await ohr(t,u,r,n,c)}catch(u){l=cdt,u instanceof ldt&&Et(t,"getRelatedFilesList",r)}return v0.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(udt,"getRelatedFilesAndTraits");function adt(t,e){return JTe(t)===JTe(e)}a(adt,"considerNeighborFile");var uee=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 sdt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(UKs(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return v0.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 v0.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await udt(e,f,o,s,c,l);return m.entries.size===0?(v0.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(_,h.uri);if(!v||d.docs.has(_))return;let b={relativePath:v,uri:_,source:E};y.unshift(b),d.docs.set(_,b)}),y.length>0&&d.neighborSource.set(A,y.map(E=>E.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 UKs(t,e){return t.get(Zt).excludeRelatedFiles(e)||Ft(t,Ye.ExcludeRelatedFiles)}a(UKs,"isExcludeRelatedFilesActive");function dri(t,e){return t.get(Zt).includeNeighboringFiles(e)||Ft(t,Ye.IncludeNeighboringFiles)}a(dri,"isIncludeNeighborFilesActive");var ddt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(Mb,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=uee.defaultEmptyResult();u.turnOffSimilarFiles||(d=await uee.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=xme(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=>({...tei(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||tut(t.ctx,d,f.detectedLanguageId),y=t.ctx.get($r).getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await iei(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),Kn(j2,{children:[...o.map((u,d)=>Kn(QKs,{snippet:u}))]})},"SimilarFiles"),QKs=a((t,e)=>Kn(PH,{children:[Kn(Ep,{children:t.snippet.headline}),Kn(Ep,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var fdt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(Mb,c=>{c.traits!==r&&n(c.traits);let l=JTe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return Kn(j2,{children:[Kn(Ep,{children:`Consider this related information: -`}),...r.map(c=>Kn(Ep,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function fri(t,e){return Ft(t,Ye.UseSplitContextPrompt)??t.get(Zt).enablePromptContextProxyField(e)}a(fri,"shouldUseSplitContextPrompt");function pri(t){return Kn(j2,{children:[Kn(zfr,{children:[Kn(dut,{ctx:t,weight:.7}),Kn(fdt,{weight:.6}),Kn(nut,{ctx:t,weight:.9}),Kn(ddt,{ctx:t,weight:.8})]}),Kn(uei,{weight:1}),Kn(Yfr,{children:Kn(odt,{ctx:t,weight:.99})}),Kn(lei,{weight:1})]})}a(pri,"splitContextCompletionsPrompt");p();var hri=0;function qKs(){hri=0}a(qKs,"resetContextIndex");function jKs(){return hri++}a(jKs,"getNextContextIndex");var pdt=class extends ame{constructor(){super(...arguments);this.formatPrefix=fei;this.formatContext=pei}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if(qKs(),new sme(r,HKs).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===zX.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:hNe(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let y=A==="prefix",E=y||f.value.endsWith(n)?f.value:f.value+n;o.push({type:y?"prefix":"context",value:hNe(E),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 ${zX.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}}},HKs=[...epr,(t,e,r)=>iut(t)?{...r,index:jKs()}:r];p();function hdt(t,e,r){let n=jlt(r,"Trait");for(let s of n)GKs(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(hdt,"getTraitsFromContextItems");function GKs(t,e,r,n){let o=t.get(pm).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(GKs,"setupExpectationsForTraits");var $Ks=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function mdt(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=$Ks.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return Et(e,t,l)}}a(mdt,"ReportTraitsTelemetry");p();p();p();var gdt=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}},Adt=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 ydt=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(VKs(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 ahr(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 shr([])),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)}},shr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},ahr=class{constructor(e){this.lifecycleData=e;this.stateHook=new gdt(e.state),this.dataHook=new Adt(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 VKs(t){return typeof t=="function"&&"isFragmentFunction"in t}a(VKs,"isFragmentFunction");var NNe=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new ydt(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 Mb(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(Mb,"isCompletionRequestData");var chr={default:{promptFunction:mri,renderer:ame},splitContext:{promptFunction:pri,renderer:pdt}};function mri(t){return Kn(j2,{children:[Kn(Wfr,{children:[Kn(dut,{ctx:t,weight:.7}),Kn(fdt,{weight:.6}),Kn(nut,{ctx:t,weight:.9}),Kn(ddt,{ctx:t,weight:.8}),Kn(odt,{ctx:t,weight:.99})]}),Kn(fNe,{weight:1})]})}a(mri,"defaultCompletionsPrompt");var Edt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new NNe(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}=xme(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 S8;let E=this.virtualPrompt.snapshot(s),_=E.status;if(_==="cancelled")return S8;if(_==="error")return this.errorPrompt(E.error);let v=this.renderer.render(E.snapshot,{delimiter:` -`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(v.status==="cancelled")return S8;if(v.status==="error")return this.errorPrompt(v.error);let[b,T]=FH(v.prefix),w={...v,prefix:b},R;if(ime(this.ctx,n)){let P=Hlt(v.metadata.componentStatistics);this.ctx.get(pm).getStatisticsForCompletion(e).computeMatch(P),R=$lt(this.ctx,e,y),Nr.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(ime(this.ctx,n)){c=await this.ctx.get(Nb).resolution(e);let{textDocument:f}=r,h=c.filter(Vlt);zKs(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=hdt(this.ctx,e,h),mdt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await rut(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 S8;if((await this.ctx.get(nc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Cdt;if((n>0?e.getText().length:e.offsetAt(r))<_dt)return vdt}createRequestData(e,r,n,o,s,c,l,u,d,f,h){return{document:e,position:r,telemetryData:n,cancellationToken:o,data:s.data,traits:l,codeSnippets:u,turnOffSimilarFiles:d,suffixMatchThreshold:f,maxPromptTokens:c,tokenizer:h}}resetIfEmpty(e){e.prefix.length===0&&e.suffix.length===0&&this.reset()}successPrompt(e,r,n,o,s){return{type:"prompt",prompt:{prefix:e.prefix,prefixTokens:e.prefixTokens,suffix:e.suffix,suffixTokens:e.suffixTokens,context:e.context,isFimEnabled:e.suffix.length>0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return qa(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),wme}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new NNe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(chr[this.promptOrdering]?.promptFunction??mri)(this.ctx)}getRenderer(){let e=chr[this.promptOrdering]??chr.default;return new e.renderer}};function zKs(t,e,r,n){let o=["cpp","c"];return dri(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(zKs,"similarFilesEnabled");p();p();p();var Eri=2e4,gri=0,Ari=new Cn;function _ri(t,e,r,n){gri++;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=Ari?.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=ws(o);m=Nfn(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),Ari.set(c.id,{budget:e,mask:f,tokenizer:o,render:m})}let{text:g,cost:A,renderedNodes:y}=m,E=performance.now();for(let[v,b]of u?.entries()??[])b.actualTokens=y.get(v)?.cost??0;let _={renderId:gri,rendererName:"renderNode",tokenizer:o,elisionTimeMs:E-d,renderTimeMs:d-s,updateDataTimeMs:0,componentStatistics:[{componentPath:t.name,actualTokens:A}]};return{root:c,renderedNodes:y,text:g,cost:A,metadata:_}}a(_ri,"renderWithMetadata");function vri(t,e){return r=>{let n=r.text.join("")+` -`;return o0(e,n,()=>t.tokenLength(n)+1)}}a(vri,"cachedLineCostFunction");function Cri(t,e,r){let o=t.split(` +`}a(mNe,"newLineEnded");var MWs=5,cme=class{constructor(){this.renderId=0;this.formatPrefix=mei}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 lut,{blocks:[y,...E]}=A.elide(u,h,d,m,ws(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...OWs([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-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-MWs: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 ame(e,tpr).walkSnapshot((f,h,m)=>{if(f===e||(f.name===hNe.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:gNe(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:Eei(f.value)?y=A:y=i4(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:gNe(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${hNe.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}}},tpr=[...Zfr(),(t,e,r)=>sut(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===zX.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===cut.name?{...r,type:"suffix"}:r];function OWs(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(OWs,"computeComponentStatistics");function gNe(t){return t.replace(/\r\n?/g,` +`)}a(gNe,"normalizeLineEndings");p();var fut=a((t,e)=>{let[r,n]=e.useState();if(e.useData(Mb,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?Yn(LWs,{docInfo:c}):Yn(BWs,{docInfo:c})}},"DocumentMarker"),LWs=a(t=>Yn(Ep,{children:dut(t.docInfo)}),"PathMarker"),BWs=a(t=>Yn(Ep,{children:uut(t.docInfo)}),"LanguageMarker");p();p();p();var BKs=de(cee()),FKs=de(h4()),uri=de(ko()),UKs=de(Nut());var m4=class extends uri.Disposable{static{a(this,"RecentEditsProvider")}};function QKs(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(QKs,"editIsTooCloseToCursor");var sdt=a((t,e)=>{let[r,n]=e.useState();return e.useData(Mb,async o=>{if(!o.document)return;let s=t.ctx.get(m4);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 E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(QKs(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift(mNe(`File: ${T}`)+mNe(b))}}if(f.length===0){n(void 0);return}let h=mNe("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+mNe("End of recent edits");n(h)}),r?Yn(DH,{children:Yn(Ep,{children:r})}):void 0},"RecentEdits");p();p();p();var adt=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>uee.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&cdt(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(IXn(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 dri(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(dri,"shortCircuit");p();function jKs(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(jKs,"defaultHash");function ihr(t,e={}){let{hash:r=jKs,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(ihr,"memoize");var fri={entries:[],traits:[]},ldt={entries:new Map,traits:[]},ohr=class extends Cn{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=GKs?c=ldt:c=void 0);let l=performance.now()-s;if(v0.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 udt;return c}a(hri,"getRelatedFiles");var shr=ihr(hri,{cache:pri,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});shr=dri(shr,200,ldt);async function ddt(t,e,r,n,o,s=!1){let c=t.get(dee),l=ldt;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await hri(t,u,r,n,c):await shr(t,u,r,n,c)}catch(u){l=ldt,u instanceof udt&&Et(t,"getRelatedFilesList",r)}return v0.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(ddt,"getRelatedFilesAndTraits");function cdt(t,e){return ZTe(t)===ZTe(e)}a(cdt,"considerNeighborFile");var uee=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 adt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if($Ks(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return v0.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 v0.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await ddt(e,f,o,s,c,l);return m.entries.size===0?(v0.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(_,h.uri);if(!v||d.docs.has(_))return;let b={relativePath:v,uri:_,source:E};y.unshift(b),d.docs.set(_,b)}),y.length>0&&d.neighborSource.set(A,y.map(E=>E.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 $Ks(t,e){return t.get(Zt).excludeRelatedFiles(e)||Ft(t,Ye.ExcludeRelatedFiles)}a($Ks,"isExcludeRelatedFilesActive");function mri(t,e){return t.get(Zt).includeNeighboringFiles(e)||Ft(t,Ye.IncludeNeighboringFiles)}a(mri,"isIncludeNeighborFilesActive");var fdt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(Mb,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=uee.defaultEmptyResult();u.turnOffSimilarFiles||(d=await uee.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=wme(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=>({...oei(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||rut(t.ctx,d,f.detectedLanguageId),y=t.ctx.get($r).getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await cei(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),Yn(H2,{children:[...o.map((u,d)=>Yn(VKs,{snippet:u}))]})},"SimilarFiles"),VKs=a((t,e)=>Yn(DH,{children:[Yn(Ep,{children:t.snippet.headline}),Yn(Ep,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var pdt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(Mb,c=>{c.traits!==r&&n(c.traits);let l=ZTe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return Yn(H2,{children:[Yn(Ep,{children:`Consider this related information: +`}),...r.map(c=>Yn(Ep,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function gri(t,e){return Ft(t,Ye.UseSplitContextPrompt)??t.get(Zt).enablePromptContextProxyField(e)}a(gri,"shouldUseSplitContextPrompt");function Ari(t){return Yn(H2,{children:[Yn(Yfr,{children:[Yn(fut,{ctx:t,weight:.7}),Yn(pdt,{weight:.6}),Yn(iut,{ctx:t,weight:.9}),Yn(fdt,{ctx:t,weight:.8})]}),Yn(hei,{weight:1}),Yn(Kfr,{children:Yn(sdt,{ctx:t,weight:.99})}),Yn(pei,{weight:1})]})}a(Ari,"splitContextCompletionsPrompt");p();var yri=0;function WKs(){yri=0}a(WKs,"resetContextIndex");function zKs(){return yri++}a(zKs,"getNextContextIndex");var hdt=class extends cme{constructor(){super(...arguments);this.formatPrefix=gei;this.formatContext=Aei}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if(WKs(),new ame(r,YKs).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===zX.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:gNe(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let y=A==="prefix",E=y||f.value.endsWith(n)?f.value:f.value+n;o.push({type:y?"prefix":"context",value:gNe(E),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 ${zX.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}}},YKs=[...tpr,(t,e,r)=>sut(t)?{...r,index:zKs()}:r];p();function mdt(t,e,r){let n=Hlt(r,"Trait");for(let s of n)KKs(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(mdt,"getTraitsFromContextItems");function KKs(t,e,r,n){let o=t.get(pm).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(KKs,"setupExpectationsForTraits");var JKs=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function gdt(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=JKs.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return Et(e,t,l)}}a(gdt,"ReportTraitsTelemetry");p();p();p();var Adt=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}},ydt=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 Edt=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(ZKs(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 chr(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 ahr([])),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)}},ahr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},chr=class{constructor(e){this.lifecycleData=e;this.stateHook=new Adt(e.state),this.dataHook=new ydt(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 ZKs(t){return typeof t=="function"&&"isFragmentFunction"in t}a(ZKs,"isFragmentFunction");var ONe=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new Edt(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 Mb(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(Mb,"isCompletionRequestData");var lhr={default:{promptFunction:Eri,renderer:cme},splitContext:{promptFunction:Ari,renderer:hdt}};function Eri(t){return Yn(H2,{children:[Yn(zfr,{children:[Yn(fut,{ctx:t,weight:.7}),Yn(pdt,{weight:.6}),Yn(iut,{ctx:t,weight:.9}),Yn(fdt,{ctx:t,weight:.8}),Yn(sdt,{ctx:t,weight:.99})]}),Yn(hNe,{weight:1})]})}a(Eri,"defaultCompletionsPrompt");var _dt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new ONe(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}=wme(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 T8;let E=this.virtualPrompt.snapshot(s),_=E.status;if(_==="cancelled")return T8;if(_==="error")return this.errorPrompt(E.error);let v=this.renderer.render(E.snapshot,{delimiter:` +`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(v.status==="cancelled")return T8;if(v.status==="error")return this.errorPrompt(v.error);let[b,T]=UH(v.prefix),w={...v,prefix:b},R;if(ome(this.ctx,n)){let P=Glt(v.metadata.componentStatistics);this.ctx.get(pm).getStatisticsForCompletion(e).computeMatch(P),R=Vlt(this.ctx,e,y),Nr.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(ome(this.ctx,n)){c=await this.ctx.get(Nb).resolution(e);let{textDocument:f}=r,h=c.filter(Wlt);eJs(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=mdt(this.ctx,e,h),gdt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await nut(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 T8;if((await this.ctx.get(nc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return bdt;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 Qa(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),Rme}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new ONe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(lhr[this.promptOrdering]?.promptFunction??Eri)(this.ctx)}getRenderer(){let e=lhr[this.promptOrdering]??lhr.default;return new e.renderer}};function eJs(t,e,r,n){let o=["cpp","c"];return mri(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(eJs,"similarFilesEnabled");p();p();p();var bri=2e4,_ri=0,vri=new Cn;function Sri(t,e,r,n){_ri++;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=vri?.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=ws(o);m=Mfn(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),vri.set(c.id,{budget:e,mask:f,tokenizer:o,render:m})}let{text:g,cost:A,renderedNodes:y}=m,E=performance.now();for(let[v,b]of u?.entries()??[])b.actualTokens=y.get(v)?.cost??0;let _={renderId:_ri,rendererName:"renderNode",tokenizer:o,elisionTimeMs:E-d,renderTimeMs:d-s,updateDataTimeMs:0,componentStatistics:[{componentPath:t.name,actualTokens:A}]};return{root:c,renderedNodes:y,text:g,cost:A,metadata:_}}a(Sri,"renderWithMetadata");function Tri(t,e){return r=>{let n=r.text.join("")+` +`;return o0(e,n,()=>t.tokenLength(n)+1)}}a(Tri,"cachedLineCostFunction");function Iri(t,e,r){let o=t.split(` `).map(f=>({id:Ef(),text:[f],children:[],canMerge:!0})),s=[""];o.length>=1&&s.push(...Array(o.length-1).fill(` -`),"");let c={id:Ef(),text:s,children:o,canMerge:!0},u=EIe(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(Cri,"getLinewiseNode");var bdt=class{constructor(){this.name="basicPrefix";this.costCache=new Cn(Eri)}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=ws(n?.tokenizer),c=vri(s,this.costCache);return{root:Cri(o,c,!1)}}},yri={root:xQ,text:"",cost:0},Sdt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new Cn(5);this.costCache=new Cn(Eri)}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 yri;let l=this.cache.get(r.textDocument.uri)||yri;if(l.text===c)return l;let u=this.ctx.get(Zt).suffixMatchThreshold(n);if(l.text!==""){let g=new pQ,A=g.takeFirstTokens(c,dNe);if(A.tokens.length>0&&100*sut(A.tokens,g.takeFirstTokens(l.text,dNe).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},Tdt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.traits.length===0)return{root:xQ};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=Ef(),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:Ef(),text:s,children:o,canMerge:!0},u=_Ie(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(Iri,"getLinewiseNode");var Sdt=class{constructor(){this.name="basicPrefix";this.costCache=new Cn(bri)}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=ws(n?.tokenizer),c=Tri(s,this.costCache);return{root:Iri(o,c,!1)}}},Cri={root:wQ,text:"",cost:0},Tdt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new Cn(5);this.costCache=new Cn(bri)}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 Cri;let l=this.cache.get(r.textDocument.uri)||Cri;if(l.text===c)return l;let u=this.ctx.get(Zt).suffixMatchThreshold(n);if(l.text!==""){let g=new hQ,A=g.takeFirstTokens(c,pNe);if(A.tokens.length>0&&100*aut(A.tokens,g.takeFirstTokens(l.text,pNe).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},Idt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.traits.length===0)return{root:wQ};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=Ef(),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:Ef(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return yIe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},Idt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:xQ};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;o0(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,_=[`Compare ${A.length>1?"these snippets":"this snippet"} from ${y}: +`)],h={id:Ef(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return EIe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},xdt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:wQ};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;o0(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,_=[`Compare ${A.length>1?"these snippets":"this snippet"} from ${y}: `,...new Array(A.length).fill(` -`)],v=[];for(let b of A){let T=Ef();u.set(T,b.importance??0);let w={id:T,text:[b.value],children:[],cost:o.tokenLength(b.value),weight:b.importance??0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};v.push(w),d+=b.importance??0,c.set(T,{componentPath:b.id,source:b,expectedTokens:w.cost})}l.push({id:Ef(),text:_,children:v,cost:o.tokenLength(_.join("")),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0})}d=Math.max(d,1);let h=new Array(l.length+1).fill(""),m={id:Ef(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return yIe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},xdt=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!==xQ.id);if(o.length===0)return{root:xQ};let s=["",...Array(o.length-1).fill(` -`),""],c={id:Ef(),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 YKs=.8,wdt=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(Zt).suffixPercent(e),n=this.ctx.get(Zt).stableContextPercent(e),o=this.ctx.get(Zt).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;ime(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}=xme(this.ctx,s,g),y=this.getComponentAllocation(s),E=y.suffix*A,_=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];E>YKs*(_??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let b=0;for(let N of v){let L=b+A*y[N],B=_ri(this.components[N],L,e,d);b=L-B.cost,h[N]=B,KKs(m,B.metadata)}let[T,w]=FH(h.prefix.text),R=performance.now(),x=ime(this.ctx,s)?this.telemetrizeContext(n,m.componentStatistics,d?.resolvedContextItems??[]):[],P=[h.stableContext.text.trim(),h.volatileContext.text.trim()];return{type:"prompt",prompt:{prefix:c?.separateContext?T:i4(P.join(` +`)],v=[];for(let b of A){let T=Ef();u.set(T,b.importance??0);let w={id:T,text:[b.value],children:[],cost:o.tokenLength(b.value),weight:b.importance??0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};v.push(w),d+=b.importance??0,c.set(T,{componentPath:b.id,source:b,expectedTokens:w.cost})}l.push({id:Ef(),text:_,children:v,cost:o.tokenLength(_.join("")),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0})}d=Math.max(d,1);let h=new Array(l.length+1).fill(""),m={id:Ef(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return EIe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},wdt=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!==wQ.id);if(o.length===0)return{root:wQ};let s=["",...Array(o.length-1).fill(` +`),""],c={id:Ef(),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 tJs=.8,Rdt=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(Zt).suffixPercent(e),n=this.ctx.get(Zt).stableContextPercent(e),o=this.ctx.get(Zt).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;ome(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}=wme(this.ctx,s,g),y=this.getComponentAllocation(s),E=y.suffix*A,_=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];E>tJs*(_??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let b=0;for(let N of v){let L=b+A*y[N],B=Sri(this.components[N],L,e,d);b=L-B.cost,h[N]=B,rJs(m,B.metadata)}let[T,w]=UH(h.prefix.text),R=performance.now(),x=ome(this.ctx,s)?this.telemetrizeContext(n,m.componentStatistics,d?.resolvedContextItems??[]):[],P=[h.stableContext.text.trim(),h.volatileContext.text.trim()];return{type:"prompt",prompt:{prefix:c?.separateContext?T:i4(P.join(` `),g)+` -`+T,prefixTokens:h.prefix.cost+h.stableContext.cost+h.volatileContext.cost,suffix:h.suffix.text,suffixTokens:h.suffix.cost,context:c?.separateContext?P: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(Nb).resolution(e),{textDocument:c}=r,l=s.filter(Vlt),u=hdt(this.ctx,e,l);mdt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await rut(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=Hlt(r);this.ctx.get(pm).getStatisticsForCompletion(e).computeMatch(o);let s=$lt(this.ctx,e,n);return Nr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return S8;if((await this.ctx.get(nc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Cdt;if(e.getText().length<_dt)return vdt}errorPrompt(e){return qa(this.ctx,e,"WorkspaceContextPromptFactory"),wme}};function KKs(t,e){t.elisionTimeMs+=e.elisionTimeMs,t.renderTimeMs+=e.renderTimeMs,t.updateDataTimeMs+=e.updateDataTimeMs,t.componentStatistics.push(...e.componentStatistics)}a(KKs,"aggregateMetadata");p();p();var bri=de(require("events"));var JKs={UpdateInterval:1e3,InvalidCacheTime:1e3*60*10,StaleWeightHalflife:1e3*10,MinNodeSize:100,Laziness:.5,MaxActiveFiles:8,MaxActiveNodes:2e3},ZKs=5,z2=class t{constructor(e){this.ctx=e;this.didDispose=!1;this.deferredStart=new vA;this.config=JKs;this.emitter=new bri.default;this.client=void 0;this.nextRequest={};this.lastEvent=void 0;this.emitter.setMaxListeners(27)}static{a(this,"WorkspaceContextFeature")}static{this.UpdateEventName="WorkspaceContextUpdate"}static{this.DisposeEventName="WorkspaceContextDispose"}get didStart(){return this.client!==void 0}async maybeStart(e,r){if(this.didStart||this.didDispose)return;let n=Ft(this.ctx,Ye.UseWorkspaceContextCoordinator);if(n===void 0&&r){let o=await this.ctx.get(Zt).updateExPValuesAndAssignments(r);n=this.isEnabled(o)}n&&this.start(e)}isActive(){return this.didStart&&!this.didDispose&&this.client!==void 0&&this.client.isActive()}get activation(){return this.deferredStart.promise}isEnabled(e){return Ft(this.ctx,Ye.UseWorkspaceContextCoordinator)??this.ctx.get(Zt).workspaceContextCoordinator(e)}start(e){!this.didStart&&!this.didDispose&&(this.client=e,this.fileChangeDisposable=this.ctx.get($r).onDidChangeTextDocument(r=>{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),Fn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),Fn.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(LY(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=ZKs){this.dispose();break}}await bC(this.config.UpdateInterval)}}};function Sri(t,e){let r=z0(t,e,"event.WorkspaceContextUpdate");return t.get(z2).onUpdate(r)}a(Sri,"onWorkspaceContextUpdate");p();var Rdt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=xQ;this.disposables=[];this.rootWithPathCache=new Cn;this.disposables.push(Sri(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(Zt).workspaceContextCacheTime(n):performance.now();let o=o0(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:Ef(),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?i4(uut(s),s.languageId):i4(lut(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:Ef(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=nO({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:Ef(),text:[o,` +`+T,prefixTokens:h.prefix.cost+h.stableContext.cost+h.volatileContext.cost,suffix:h.suffix.text,suffixTokens:h.suffix.cost,context:c?.separateContext?P: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(Nb).resolution(e),{textDocument:c}=r,l=s.filter(Wlt),u=mdt(this.ctx,e,l);gdt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await nut(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=Glt(r);this.ctx.get(pm).getStatisticsForCompletion(e).computeMatch(o);let s=Vlt(this.ctx,e,n);return Nr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return T8;if((await this.ctx.get(nc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return bdt;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),Fn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),Fn.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(BY(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=iJs){this.dispose();break}}await SC(this.config.UpdateInterval)}}};function wri(t,e){let r=z0(t,e,"event.WorkspaceContextUpdate");return t.get(Y2).onUpdate(r)}a(wri,"onWorkspaceContextUpdate");p();var kdt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=wQ;this.disposables=[];this.rootWithPathCache=new Cn;this.disposables.push(wri(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(Zt).workspaceContextCacheTime(n):performance.now();let o=o0(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:Ef(),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?i4(dut(s),s.languageId):i4(uut(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:Ef(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=iO({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:Ef(),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 i4(`Related portions of ${o??e}: -`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var kdt=class extends wdt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new Rdt(e),prefix:new bdt,suffix:new Sdt(e),volatileContext:new xdt("volatileContext",[new Tdt,new Idt(e)])};super(e,r)}};var Tri=de(ri());var T8=class{static{a(this,"CompletionsPromptFactory")}};function Pdt(t,e,r){return new lhr(new uhr(new dhr(t,new Edt(t,e,r),new kdt(t),eJs)))}a(Pdt,"createCompletionsPromptFactory");var lhr=class extends T8{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 S8;try{return await this.delegate.prompt(r,n)}catch{return wme}}},XKs=1200,uhr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new Tri.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(Iri)},XKs)})])}},dhr=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 eJs(t,e){let r=t.get(z2);return r.isEnabled(e)&&r.isActive()}a(eJs,"workspaceContextEnabledAndActive");var _dt=10,vdt={type:"contextTooShort"},Cdt={type:"copilotContentExclusion"},wme={type:"promptError"},S8={type:"promptCancelled"},Iri={type:"promptTimeout"};function FH(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(FH,"trimLastLine");function Rme(t,e,r,n,o,s={}){let l=t.get($r).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=rJs(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=fri(t,n);return t.get(T8).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(Rme,"extractPrompt");function tJs(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:i4(n,e)}a(tJs,"addNeighboringCellsToPrompt");function rJs(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>tJs(l,r.document.detectedLanguageId)).join(` +`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var Pdt=class extends Rdt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new kdt(e),prefix:new Sdt,suffix:new Tdt(e),volatileContext:new wdt("volatileContext",[new Idt,new xdt(e)])};super(e,r)}};var Rri=de(ti());var I8=class{static{a(this,"CompletionsPromptFactory")}};function Ddt(t,e,r){return new uhr(new dhr(new fhr(t,new _dt(t,e,r),new Pdt(t),sJs)))}a(Ddt,"createCompletionsPromptFactory");var uhr=class extends I8{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 T8;try{return await this.delegate.prompt(r,n)}catch{return Rme}}},oJs=1200,dhr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new Rri.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(kri)},oJs)})])}},fhr=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 sJs(t,e){let r=t.get(Y2);return r.isEnabled(e)&&r.isActive()}a(sJs,"workspaceContextEnabledAndActive");var vdt=10,Cdt={type:"contextTooShort"},bdt={type:"copilotContentExclusion"},Rme={type:"promptError"},T8={type:"promptCancelled"},kri={type:"promptTimeout"};function UH(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(UH,"trimLastLine");function kme(t,e,r,n,o,s={}){let l=t.get($r).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=cJs(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=gri(t,n);return t.get(I8).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(kme,"extractPrompt");function aJs(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:i4(n,e)}a(aJs,"addNeighboringCellsToPrompt");function cJs(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>aJs(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(rJs,"applyEditsForNotebook");function xme(t,e,r){let o=t.get(Zt).maxPromptCompletionTokens(e)-lYe(t),s=aei(e,r),c=tut(t,e,r),l=t.get(Zt).suffixPercent(e),u=t.get(Zt).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(xme,"getPromptOptions");p();p();var xri=2.98410452738298,wri=-.838732736843507,Rri=1.50314646255716,kri=-.237798634012662,Ddt={python:.314368072478742},Pri={"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 nJs={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function iJs(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)}},fhr=class{constructor(e,r,n){this.link=nJs;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 iJs(n,this.logitsToQuantiles)}},Dri=new fhr(xri,[new kme("compCharLen",wri,t=>Math.log(1+t)),new kme("meanLogProb",Rri),new kme("meanAlternativeLogProb",kri)].concat(Object.entries(Ddt).map(t=>new kme(t[0],t[1]))),Pri);function Nri(t,e){let r={...e.measurements};return Object.keys(Ddt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Dri.predict(t,r)}a(Nri,"ghostTextScoreConfidence");function Mri(t,e){let r={...e.measurements};return Object.keys(Ddt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Dri.quantile(t,r)}a(Mri,"ghostTextScoreQuantile");p();function oJs(t,e,r,n){let o="}";try{o=Pdn(e.detectedLanguageId)??"}"}catch{}return sJs({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(oJs,"maybeSnipCompletion");function sJs(t,e,r,n){let o=aJs(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(sJs,"maybeSnipCompletionImpl");function aJs(t){let e=t.includes(`\r +`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(cJs,"applyEditsForNotebook");function wme(t,e,r){let o=t.get(Zt).maxPromptCompletionTokens(e)-fYe(t),s=dei(e,r),c=rut(t,e,r),l=t.get(Zt).suffixPercent(e),u=t.get(Zt).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(wme,"getPromptOptions");p();p();var Pri=2.98410452738298,Dri=-.838732736843507,Nri=1.50314646255716,Mri=-.237798634012662,Ndt={python:.314368072478742},Ori={"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 lJs={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function uJs(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)}},phr=class{constructor(e,r,n){this.link=lJs;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 uJs(n,this.logitsToQuantiles)}},Lri=new phr(Pri,[new Pme("compCharLen",Dri,t=>Math.log(1+t)),new Pme("meanLogProb",Nri),new Pme("meanAlternativeLogProb",Mri)].concat(Object.entries(Ndt).map(t=>new Pme(t[0],t[1]))),Ori);function Bri(t,e){let r={...e.measurements};return Object.keys(Ndt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Lri.predict(t,r)}a(Bri,"ghostTextScoreConfidence");function Fri(t,e){let r={...e.measurements};return Object.keys(Ndt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Lri.quantile(t,r)}a(Fri,"ghostTextScoreQuantile");p();function dJs(t,e,r,n){let o="}";try{o=Ddn(e.detectedLanguageId)??"}"}catch{}return fJs({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(dJs,"maybeSnipCompletion");function fJs(t,e,r,n){let o=pJs(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(fJs,"maybeSnipCompletionImpl");function pJs(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(aJs,"splitByNewLine");function cJs(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(Ori,"checkSuffix");var Uri=de(dU());Mo();var ul=new fe("ghostText");var Lri=20;async function Qri(t,e,r,n,o,s,c){ul.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=Yle(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:Ldn(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=Ft(t,Ye.ModelAlwaysTerminatesSingleline)??t.get(Zt).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&tO.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},E=await t.get(AO).fetchAndStreamCompletions(t,y,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:yp(r,t)}:E.type==="canceled"?(ul.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:kH(r)}):c(g,E.getProcessingTime(),E.choices)}catch(y){if(Gm(y))return{type:"canceled",reason:"network request aborted",telemetryData:kH(r,{cancelledNetworkRequest:!0})};if(ul.exception(t,y,"Error on ghost text request"),t.get(CC).notifyUser(t,y),RCe(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:yp(r,t)}}}a(Qri,"genericGetCompletionsFromNetwork");function phr(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(phr,"postProcessChoices");async function uJs(t,e,r,n,o){return Qri(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return ul.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:yp(r,t)};if(n?.isCancellationRequested)return ul.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:kH(r)};let f=d.value;if(f===void 0)return ul.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:yp(r,t)};jri(t,"performance",f,s,c),ul.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=phr(f,e);h&&(Ndt(t,e,h),ul.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;ul.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=phr(A,e,g);y&&(g.push(y),Ndt(t,e,y))}})();return O1(t)&&await m,h?{type:"success",value:[hhr(h,{forceSingleLine:!1}),m],telemetryData:yp(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:yp(r,t)}})}a(uJs,"getCompletionsFromNetwork");async function dJs(t,e,r,n,o){return Qri(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return ul.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:kH(r)};let f=phr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)Ndt(t,e,d);jri(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:yp(r,t),telemetryBlob:r,resultType:3}})}a(dJs,"getAllCompletionsFromNetwork");function hhr(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(pJs,"splitByNewLine");function hJs(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(Uri,"checkSuffix");var Hri=de(fU());Oo();var ul=new fe("ghostText");var Qri=20;async function Gri(t,e,r,n,o,s,c){ul.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=Yle(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:Bdn(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=Ft(t,Ye.ModelAlwaysTerminatesSingleline)??t.get(Zt).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&rO.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},E=await t.get(AO).fetchAndStreamCompletions(t,y,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:yp(r,t)}:E.type==="canceled"?(ul.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:PH(r)}):c(g,E.getProcessingTime(),E.choices)}catch(y){if(Gm(y))return{type:"canceled",reason:"network request aborted",telemetryData:PH(r,{cancelledNetworkRequest:!0})};if(ul.exception(t,y,"Error on ghost text request"),t.get(bC).notifyUser(t,y),kCe(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:yp(r,t)}}}a(Gri,"genericGetCompletionsFromNetwork");function hhr(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(hhr,"postProcessChoices");async function gJs(t,e,r,n,o){return Gri(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return ul.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:yp(r,t)};if(n?.isCancellationRequested)return ul.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:PH(r)};let f=d.value;if(f===void 0)return ul.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:yp(r,t)};Vri(t,"performance",f,s,c),ul.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=hhr(f,e);h&&(Mdt(t,e,h),ul.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;ul.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=hhr(A,e,g);y&&(g.push(y),Mdt(t,e,y))}})();return O1(t)&&await m,h?{type:"success",value:[mhr(h,{forceSingleLine:!1}),m],telemetryData:yp(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:yp(r,t)}})}a(gJs,"getCompletionsFromNetwork");async function AJs(t,e,r,n,o){return Gri(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return ul.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:PH(r)};let f=hhr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)Mdt(t,e,d);Vri(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:yp(r,t),telemetryBlob:r,resultType:3}})}a(AJs,"getAllCompletionsFromNetwork");function mhr(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(hhr,"makeGhostAPIChoice");function Bri(t){return e=>{let r=e?.split(` +`)[0]}return r}a(mhr,"makeGhostAPIChoice");function qri(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(Bri,"takeNLines");async function fJs(t,e,r,n,o,s,c,l){let u=t.get(Zt).multilineAfterAcceptLines(l),d=t.get(TP).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:Bri(u),stop:[` +`).length}}a(qri,"takeNLines");async function yJs(t,e,r,n,o,s,c,l){let u=t.get(Zt).multilineAfterAcceptLines(l),d=t.get(IP).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:qri(u),stop:[` -`],maxTokens:Lri*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await vJs(t,d,e.textDocument,e.position,s,c,n)}catch{f={requestMultiline:!1}}if(!c&&f.requestMultiline&&t.get(Zt).singleLineUnlessAccepted(l)&&(f.requestMultiline=!1),f.requestMultiline){let h;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?h=gu.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...Fri(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:Bri(u),stop:[` +`],maxTokens:Qri*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await xJs(t,d,e.textDocument,e.position,s,c,n)}catch{f={requestMultiline:!1}}if(!c&&f.requestMultiline&&t.get(Zt).singleLineUnlessAccepted(l)&&(f.requestMultiline=!1),f.requestMultiline){let h;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?h=gu.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...jri(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:qri(u),stop:[` -`],maxTokens:Lri*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...Fri(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(fJs,"getGhostTextStrategy");function Fri(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&tO.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(Zt).longLookaheadSize(u):t.get(Zt).shortLookaheadSize(u);return{finishedCb:new Flt(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};Ndt(t,g,m)}).getFinishedCallback(),maxTokens:t.get(Zt).maxMultilineTokens(u)}}return{finishedCb:c?lNe(t,r,n):d=>{}}}a(Fri,"buildFinishedCallback");var pJs={isCycling:!1,promptOnly:!1,isSpeculative:!1};function hJs(t,e,r){let n=Ft(t,Ye.CompletionsDebounce)??t.get(Zt).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=yl()-r.issuedTime;return Math.max(0,n-o)}a(hJs,"getRemainingDebounceMs");function ONe(t,e,r){return r?.isCancellationRequested||e!==t.get(Db).currentRequestId}a(ONe,"inlineCompletionRequestCancelled");async function mJs(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(E){let _=yl();l.push([E,_-c]),c=_}a(u,"recordPerformance"),u("telemetry");let d=t.get(Zt);if(ONe(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:yp(n,t)};let f=AJs(e.textDocument,e.position);if(f===void 0)return ul.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:yp(n,t)};let h=mQ(t,n),m={...pJs,...s,tokenizer:h.tokenizer},g=await Rme(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return ul.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:yp(n,t)};if(g.type==="contextTooShort")return ul.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:yp(n,t)};if(g.type==="promptError")return ul.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:yp(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return ul.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:yp(n,t)};if(g.type==="promptTimeout")return ul.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:yp(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return ul.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:yp(n,t)};let A=hJs(t,m,n);return A>0&&(ul.debug(t,`Debouncing ghost text request for ${A}ms`),await bC(A),ONe(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:yp(n,t)}:t.get(ps).trackCompletionJob(async()=>{let[E]=FH(e.textDocument.getText(gu.range(gu.position(0,0),e.position))),_=t.get(Db).hasAcceptedCurrentCompletion(E,g.prompt.suffix),v=g.prompt,b=await fJs(t,e,E,g,m.isCycling,f,_,n);u("strategy");let T=gJs(t,E,v,b.requestMultiline);u("cache");let w=gQ(t,e.textDocument.uri),R={blockMode:b.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:w,engineModelId:h.modelId,ourRequestId:r,prefix:E,prompt:g.prompt,multiline:b.requestMultiline,indentation:Jlt(e.textDocument,e.position),isCycling:m.isCycling,headers:h.headers,stop:b.stop,maxTokens:b.maxTokens,afterAccept:_};R.headers={...R.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":m.isSpeculative?"true":"false"};let x=IJs(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(Pb).shouldWaitForAsyncCompletions(E,g.prompt)){let j=await t.get(Pb).getFirstMatchingRequestWithTimeout(r,E,g.prompt,m.isSpeculative,x);if(u("asyncWait"),j){let Q=!b.requestMultiline;T=[[hhr(j[0],{forceSingleLine:Q})],4]}if(ONe(t,r,o))return ul.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:yp(x,t)}}let P=b.blockMode==="moremultiline"&&tO.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(j=>MNe(t,e.textDocument,e.position,j,P,ul)).filter(j=>j!==void 0)),T!==void 0&&T[0].length===0)return ul.debug(t,`Found empty inline suggestions locally via ${rme(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:yp(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))ul.debug(t,`Found inline suggestions locally via ${rme(T[1])}`);else{if(m.isCycling){let j=await dJs(t,R,x,o,b.finishedCb);if(j.type==="success"){let Q=T?.[0]??[];j.value[0].forEach(U=>{Q.findIndex(Y=>Y.completionText.trim()===U.completionText.trim())===-1&&Q.push(U)}),T=[Q,3]}else if(T===void 0)return j}else{let j=a((W,V)=>(t.get(Pb).updateCompletion(r,W),b.finishedCb(W,V)),"finishedCb"),Q=new Fn.CancellationTokenSource,U=uJs(t,R,x,Q.token,j);t.get(Pb).queueCompletionRequest(r,E,g.prompt,Q,U);let Y=await t.get(Pb).getFirstMatchingRequest(r,E,g.prompt,m.isSpeculative);if(Y===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:yp(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:yp(x,t)};let[D,N]=T,L=D.map(j=>MNe(t,e.textDocument,e.position,j,P,ul)).filter(j=>j!==void 0),B=Ft(t,Ye.CompletionsDelay)??d.completionsDelay(n),q=yl()-n.issuedTime,M=Math.max(B-q,0);if(N!==2&&!m.isCycling&&M>0&&(ul.debug(t,`Waiting ${M}ms before returning completion`),await bC(M),ONe(t,r,o)))return ul.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:kH(x)};let O=[];for(let j of L){let Q=TJs(t,e.textDocument,R,j,x),U=f?Ori(e.textDocument,e.position,j):0,W={completion:CJs(j.choiceIndex,j.completionText,g.trailingWs),telemetry:Q,isMiddleOfTheLine:f,suffixCoverage:U,copilotAnnotations:j.copilotAnnotations,clientCompletionId:j.clientCompletionId};O.push(W)}return x.properties.clientCompletionId=O[0]?.clientCompletionId,x.measurements.foundOffset=O?.[0]?.telemetry?.measurements?.foundOffset??-1,ul.debug(t,`Produced ${O.length} results from ${rme(N)} at ${x.measurements.foundOffset} offset`),ONe(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:kH(x)}:(m.isSpeculative||t.get(Db).setGhostText(E,g.prompt.suffix,L,N),u("complete"),{type:"success",value:[O,N],telemetryData:yp(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(mJs,"getGhostTextWithoutAbortHandling");async function mhr(t,e,r,n){let o=Mt();t.get(Db).currentRequestId=o;let s=await SJs(t,e.textDocument,o,n);await hQ().catch(()=>{});try{return t.get(Nb).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(t4).notifyRequest(e,o,s,r,n),await mJs(t,e,o,s,r,n)}catch(c){if(Gm(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:kH(s,{cancelledNetworkRequest:!0})};throw c}}a(mhr,"getGhostText");function gJs(t,e,r,n){let o=t.get(Db).getCompletionsForUserTyping(e,r.suffix),s=bJs(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(gJs,"getLocalInlineSuggestion");function AJs(t,e){let r=yJs(e,t),n=EJs(e,t);return r&&!n?void 0:r&&n}a(AJs,"isInlineSuggestion");function yJs(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(yJs,"isMiddleOfTheLine");function EJs(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(EJs,"isValidMiddleOfTheLinePosition");function _Js(t,e){return e.lineAt(t).text.trim().length===0}a(_Js,"isNewLine");var I8=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function vJs(t,e,r,n,o,s,c){if(t.get(I8).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)Et(t,"ghostText.longFileMultilineSkip",Wt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&tO.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await Ndn(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&_Js(n,r))return{requestMultiline:!0};let u=!1;return!o&&kS(r.detectedLanguageId)?u=await Klt(r,n):o&&kS(r.detectedLanguageId)&&(u=await Klt(r,n)||await Klt(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=RXn(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(vJs,"shouldRequestMultiline");function Ndt(t,e,r){t.get(q2).append(e.prefix,e.prompt.suffix,r)}a(Ndt,"appendToCache");function CJs(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(CJs,"adjustLeadingWhitespace");function bJs(t,e,r,n){let o=t.get(q2).findAll(e,r);return o.length===0?(ul.debug(t,"Found no completions in cache"),[]):(ul.debug(t,`Found ${o.length} completions in cache`),o.map(s=>hhr(s,{forceSingleLine:!n})))}a(bJs,"getCompletionsFromCache");async function SJs(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=Wt.createAndMarkAsIssued(o);return await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},s)}a(SJs,"createTelemetryWithExp");function TJs(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,qri(u,e),u.extendWithRequestId(s),u.measurements.confidence=Nri(t,u),u.measurements.quantile=Mri(t,u),ul.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(TJs,"telemetryWithAddData");function IJs(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);qri(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(gu.range(h.range.start,n)),g=e.getText(gu.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Uri.SHA256)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...Ese(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 _=d.extendedBy(y,E);return Et(t,"ghostText.issued",_),d}a(IJs,"telemetryIssued");function qri(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(qri,"addDocumentTelemetry");function jri(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),Et(t,`ghostText.${e}`,l)}a(jri,"telemetryPerformance");p();p();var fee=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 jT=class{static{a(this,"CitationManager")}},Mdt=class extends jT{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var ghr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??Fn.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=Ldt.indexOf(_);v!==-1&&Ldt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of Ldt)_()}a(e,"afterUpdateConnection");function r(_){Y2.connection!==_&&(Y2.connection=_,e())}a(r,"updateConnection");function n(){return Y2.connection==="connected"}a(n,"isConnected");function o(){return Y2.connection==="disconnected"}a(o,"isDisconnected");function s(){return Y2.connection==="retry"}a(s,"isRetrying");function c(){return Y2.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(_){Y2.initialWait!==_&&(Y2.initialWait=_)}a(h,"setInitialWait");function m(_,v=xJs){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return Y2.initialWait}a(g,"isInitialWait");async function A(_,v){Ob.info(_,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let b=_.get(tr);function T(w,R){if(w>Gri){Ob.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{Y2.retryAttempts=Math.min(Y2.retryAttempts+1,$ri);try{Ob.info(R,`Pinging service after ${w} second(s)`);let P=await b.fetch(new URL("_ping",bB(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(P.status!==200||!P.ok)T(w**2,R);else{Ob.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),Ob.info(_,"Attempting to reconnect."),T(Ahr,_)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),Odt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},Odt}a(wJs,"registerConnectionState");var hee=wJs();p();var qg={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},LNe={[qg.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[qg.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[qg.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function yhr(t){return t===401?qg.Unauthorized:t===400?qg.BadArguments:t===404?qg.NotFound:t===429?qg.RateLimit:t>=500&&t<600?qg.InternalError:t>=600?qg.ConnectionError:qg.Unknown}a(yhr,"getErrorType");function g4(t,e,r={}){return{kind:"failure",reason:yhr(Number(t)),code:Number(t),msg:e,meta:r}}a(g4,"createErrorResponse");p();var RJs=/^[1-6][0-9][0-9]$/,kJs=/([A-Z][a-z]+)/,PJs="code_referencing",BNe=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[PJs,this.baseKey,...e].join(".")}},Ehr=class extends BNe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=Wt.createAndMarkAsIssued();Et(e,r,n)}handleFocus({context:e}){let r=Wt.createAndMarkAsIssued(),n=this.buildKey("focus","count");Et(e,n,r)}handleWrite({context:e}){let r=Wt.createAndMarkAsIssued(),n=this.buildKey("write","count");Et(e,n,r)}},v$f=new Ehr,_hr=class extends BNe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=Wt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");Et(e,o,n)}handleDismiss({context:e,actor:r}){let n=Wt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");Et(e,o,n)}},C$f=new _hr,vhr=class extends BNe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});eg(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});eg(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(RJs)){Ob.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(kJs).filter(l=>!!l).join("_").toLowerCase(),c=Wt.createAndMarkAsIssued({message:o});eg(e,this.buildKey(s,r),c)}},Bdt=new vhr;var DJs="twirp/github.snippy.v1.SnippyAPI";async function Chr(t,e,r,n){let o;try{o=await t.get(Qt).getToken()}catch{return hee.setDisconnected(),g4(401,LNe[qg.Unauthorized])}if(Ob.info(t,`Calling ${e}`),hee.isRetrying())return g4(600,"Attempting to reconnect to the public code matching service.");if(hee.isDisconnected())return g4(601,"The public code matching service is offline.");let s;try{s=await t.get(tr).fetch(tx(t,o,"origin-tracker",`${DJs}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...Gy(t)},signal:n})}catch{return hee.enableRetry(t),g4(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 Bdt.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=yhr(h),g=d||"unknown error";switch(m){case qg.Unauthorized:return g4(u,LNe[qg.Unauthorized],f);case qg.BadArguments:return g4(u,g,f);case qg.RateLimit:return hee.enableRetry(t,60*1e3),g4(u,LNe.RateLimitError,f);case qg.InternalError:return hee.enableRetry(t),g4(u,LNe[qg.InternalError],f);default:return g4(u,g,f)}}a(Chr,"call");p();var Fdt=S.Object({kind:S.Literal("failure"),reason:S.String(),code:S.Number(),msg:S.String(),meta:S.Optional(S.Any())}),MJs=S.Object({matched_source:S.String(),occurrences:S.String(),capped:S.Boolean(),cursor:S.String(),github_url:S.String()}),Vri=S.Object({source:S.String()}),OJs=S.Object({snippets:S.Array(MJs)}),Wri=S.Union([OJs,Fdt]),zri=S.Object({cursor:S.String()}),LJs=S.Object({commit_id:S.String(),license:S.String(),nwo:S.String(),path:S.String(),url:S.String()}),BJs=S.Object({has_next_page:S.Boolean(),cursor:S.String()}),FJs=S.Object({count:S.Record(S.String(),S.String())}),UJs=S.Object({file_matches:S.Array(LJs),page_info:BJs,license_stats:FJs}),Yri=S.Union([UJs,Fdt]);async function Kri(t,e,r){let n=await Chr(t,"Match",{method:"POST",body:mK(Vri,{source:e})},r);return mK(Wri,n)}a(Kri,"Match");async function Jri(t,{cursor:e},r){let n=await Chr(t,"FilesForMatch",{method:"POST",body:mK(zri,{cursor:e})},r);return mK(Yri,n)}a(Jri,"FilesForMatch");p();var FNe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),Udt=65;function jJs(t){let e=0,r;FNe.lastIndex=0;do if(r=FNe.exec(t),r&&(e+=1),e>=Udt)break;while(r);return e}a(jJs,"lexemeLength");function HJs(t,e){let r=0,n;FNe.lastIndex=0;do if(n=FNe.exec(t),n&&(r+=1,r>=e))return FNe.lastIndex;while(n);return t.length}a(HJs,"offsetFirstLexemes");function Zri(t,e){let r=t.split("").reverse().join(""),n=HJs(r,e);return r.length-n}a(Zri,"offsetLastLexemes");function UNe(t){return jJs(t)>=Udt}a(UNe,"hasMinLexemeLength");function $Js(t){return XM.Check(Fdt,t)}a($Js,"isError");async function Xri(t,e){let r=await e();if($Js(r)){Bdt.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(Xri,"snippyRequest");function eni(t){return"kind"in t&&t.kind==="failure"}a(eni,"isMatchError");async function tni(t,e,r,n){let s=await t.get($r).getTextDocument({uri:e});if(!s){Ob.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!UNe(c)||!UNe(c))return;let l=r;if(!UNe(r)){let g=c.slice(0,n),A=Zri(g,Udt);l=c.slice(A,n+r.length)}if(!UNe(l))return;let u=await Xri(t,()=>Kri(t,l));if(!u||eni(u)||!u.snippets.length){Ob.info(t,"No match found");return}Ob.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await Xri(t,()=>Jri(t,{cursor:g.cursor}));if(!A||eni(A))return;let y=A.file_matches,E=A.license_stats;return{match:g,files:y,licenseStats:E}}),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(),E=n,_=n+g.match.matched_source.length,v=s.positionAt(E),b=s.positionAt(_);await t.get(jT).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:E,offsetEnd:_,version:s.version,location:{start:v,end:b},matchingText:l,details:y.map(T=>({license:T,url:g.match.github_url}))})}}a(tni,"fetchCitations");p();function bhr(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(zJs,"lexGeneratorWords");function rni(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(rni,"lexicalAnalyzer");function nni(t){return t!==" "}a(nni,"notSingleSpace");function ini(t,e,r=zJs){let[n,o]=rni(t,VJs(),r,nni),[s,c]=rni(e,o,r,nni);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=WJs(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 b=l[n[_][0]];return v==0&&b.endsWith(d)||v==u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=bhr(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(ini,"lexEditDistance");p();function UH(t){return t.length===0?0:t.split(` -`).length}a(UH,"countLines");function oni(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(oni,"computeCompletionText");var QH=new fe("postInsertion"),sni=[{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}],ani=50,YJs=1500,KJs=.5,JJs=500,Shr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function cni(t,e,r,n,o){let s=await t.get(ii).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return QH.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 Rme(t,r.properties.headerRequestId,pee(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=jfr(u,n,c.detectedLanguageId),y=eei(g,void 0)(m),E=Math.min(l.length,n+(y?y*2:JJs)),_=l.substring(n,E);return{prompt:h,capturedCode:_,terminationOffset:y??-1}}}a(cni,"captureCode");function Qdt(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{QH.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),PXn(t,e,d)});let s=new fee(t,n,r-1),c=new fee(t,n,r),l=a(async u=>{QH.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await cni(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});QH.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),Et(t,e+".capturedAfterRejected",A,1)},"checkInCode");sni.filter(u=>u.captureRejection).map(u=>s.push(z0(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(Qdt,"postRejectionTasks");function QNe(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});QH.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),kXn(t,e,u);let d=r;r=oni(r,c);let f=r.trim(),h=new fee(t,o,n),m=new fee(t,o,n+r.length),g=a(async A=>{await tZs(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(Shr.triggerPostInsertionSynchroneously&&O1(t)){let A=g({seconds:0,captureCode:Shr.captureCode,captureRejection:Shr.captureRejection});t.get(xd).register(A)}else sni.map(A=>h.push(z0(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));z0(t,ZJs,"post insertion citation check")(t,o,d,r,n,l)}a(QNe,"postInsertionTasks");async function ZJs(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(rx(t)?.getTokenValue("sn")==="1")return;await tni(t,e,n,o);return}let c=await t.get($r).getTextDocument({uri:e});if(c){let l=Thr(c.getText(),n,ani,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=XJs(r.length,n.length,l.start_offset);if(u===void 0){QH.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+eZs(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(jT).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(ZJs,"citationCheck");function XJs(t,e,r){if(!(ee))return r}a(XJs,"computeCitationStart");function eZs(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(iZs,"computeRejectedCompletions");function Ihr(t,e){let r=t.get(iy);if(!r.position||!r.uri)return;let n=iZs(r);n.length>0&&Qdt(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(Ihr,"rejectLastShown");function lni(t,e,r,n){let o=t.get(iy);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&Ihr(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(lni,"setLastShown");function uni(t,e){let r=t.get(iy);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;nZs.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,Qlt(t,"ghostText",e)}}a(uni,"handleGhostTextShown");function oZs(t,e,r){let n=t.get(iy);n.linesLeft===void 0&&(n.linesAccepted=UH(e.insertText.substring(0,r)),n.linesLeft=UH(e.displayText));let o=UH(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(oZs,"handleLineAcceptance");function Pme(t,e,r="ghostText"){let n=t.get(iy),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:UH(e.displayText)},n.resetState(),QNe(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Pme,"handleGhostTextPostInsert");function qdt(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(iy),l;return s==="cumulative"?(sZs(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(oZs(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),QNe(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(qdt,"handlePartialGhostTextPostInsert");function sZs(t,e,r){let n=t.get(iy);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=UH(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(sZs,"handleCumulativeAcceptance");p();var A4=new Map;A4.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});A4.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});A4.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});A4.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});A4.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});A4.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var aZs=new fe("sdk");function jdt(t,e){A4.has(t.get(Ir).getEditorPluginInfo().name)||aZs.warn(t,...e)}a(jdt,"deprecationWarning");var wYi=de(AP()),TI=de(PP());p();p();p();p();var Hdt={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function Dme(t,e){let r=Wt.createAndMarkAsIssued({authType:e});Et(t,Hdt.NewGitHubLogin,r),At(t,Hdt.NewGitHubLogin,{authType:e})}a(Dme,"telemetryNewGitHubLogin");function K2(t,e,r,n,o){Vn(t,Hdt.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(K2,"telemetryGitHubLoginResult");function qNe(t,e,r){Vn(t,Hdt.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(qNe,"telemetryCodeFlowError");var dni=["repo","workflow"],xhr=class extends yi{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function cZs(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:e,scope:dni.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(tr).fetch(s,n)}catch(c){throw c instanceof Error&&XI(c)?new yi(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(cZs,"requestDeviceFlowStage1");async function lZs(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(tr).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 xhr(c):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(lZs,"requestDeviceFlowStage2");async function uZs(t,e){let n=await(await Gf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(uZs,"requestUserInfo");var HT=class{constructor(e){this.ctx=e;this.pendingSignIn=void 0}static{a(this,"GitHubDeviceFlow")}get authManager(){return this.ctx.get(Ur)}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(zp).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(zp).githubAppId=n;let d=await this.save(u);return K2(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{K2(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw K2(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(CC).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;Dme(n,"deviceFlow");let o=await cZs(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 lZs(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await uZs(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):dni;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new yi(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var whr=de(ri());p();var cR=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var Gdt="github.copilot.finishDeviceFlow",Rhr=class extends cR{constructor(){super(...arguments);this.name=Gdt;this.arguments=S.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get(HT),s=o.pendingSignIn;if(!s)throw new whr.ResponseError(Ze.InvalidRequest,"No pending sign in");try{await this.ctx.get(Vm).open(s.verificationUri)}catch(c){b_.warn(this.ctx,"Failed to open",s.verificationUri),b_.exception(this.ctx,c,Gdt)}try{return await s.status}catch(c){throw new whr.ResponseError(Ze.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},fni=[Rhr];p();p();var Ru=class extends Cn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var jNe="github.copilot.didAcceptCompletionItem",khr=class extends cR{constructor(){super(...arguments);this.name=jNe;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(Ru).get(n);return s?(Pme(this.ctx,s),!0):!1}},pni=[khr];p();p();p();var d1t=de(u1t()),mQi=de(K$());function Zwc(t){switch(t){case d1t.TokenizerName.cl100k:return"cl100k_base";case d1t.TokenizerName.o200k:return"o200k_base";case d1t.TokenizerName.mock:return"mock"}}a(Zwc,"toClsTokenizerName");var gQi={getTokenizer:a(t=>ws(Zwc(t)),"getTokenizer"),ensureLoaded:a(()=>Lun(),"ensureLoaded")},Xwc=new pQ,eRc={encode:a(t=>Xwc.tokenize(t),"encode")},f1t=class extends mQi.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(eRc)}};p();p();p();p();function AQi(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` +`],maxTokens:Qri*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...jri(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(yJs,"getGhostTextStrategy");function jri(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&rO.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(Zt).longLookaheadSize(u):t.get(Zt).shortLookaheadSize(u);return{finishedCb:new Ult(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};Mdt(t,g,m)}).getFinishedCallback(),maxTokens:t.get(Zt).maxMultilineTokens(u)}}return{finishedCb:c?dNe(t,r,n):d=>{}}}a(jri,"buildFinishedCallback");var EJs={isCycling:!1,promptOnly:!1,isSpeculative:!1};function _Js(t,e,r){let n=Ft(t,Ye.CompletionsDebounce)??t.get(Zt).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=yl()-r.issuedTime;return Math.max(0,n-o)}a(_Js,"getRemainingDebounceMs");function BNe(t,e,r){return r?.isCancellationRequested||e!==t.get(Db).currentRequestId}a(BNe,"inlineCompletionRequestCancelled");async function vJs(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(E){let _=yl();l.push([E,_-c]),c=_}a(u,"recordPerformance"),u("telemetry");let d=t.get(Zt);if(BNe(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:yp(n,t)};let f=bJs(e.textDocument,e.position);if(f===void 0)return ul.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:yp(n,t)};let h=gQ(t,n),m={...EJs,...s,tokenizer:h.tokenizer},g=await kme(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return ul.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:yp(n,t)};if(g.type==="contextTooShort")return ul.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:yp(n,t)};if(g.type==="promptError")return ul.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:yp(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return ul.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:yp(n,t)};if(g.type==="promptTimeout")return ul.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:yp(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return ul.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:yp(n,t)};let A=_Js(t,m,n);return A>0&&(ul.debug(t,`Debouncing ghost text request for ${A}ms`),await SC(A),BNe(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:yp(n,t)}:t.get(ps).trackCompletionJob(async()=>{let[E]=UH(e.textDocument.getText(gu.range(gu.position(0,0),e.position))),_=t.get(Db).hasAcceptedCurrentCompletion(E,g.prompt.suffix),v=g.prompt,b=await yJs(t,e,E,g,m.isCycling,f,_,n);u("strategy");let T=CJs(t,E,v,b.requestMultiline);u("cache");let w=AQ(t,e.textDocument.uri),R={blockMode:b.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:w,engineModelId:h.modelId,ourRequestId:r,prefix:E,prompt:g.prompt,multiline:b.requestMultiline,indentation:Zlt(e.textDocument,e.position),isCycling:m.isCycling,headers:h.headers,stop:b.stop,maxTokens:b.maxTokens,afterAccept:_};R.headers={...R.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":m.isSpeculative?"true":"false"};let x=DJs(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(Pb).shouldWaitForAsyncCompletions(E,g.prompt)){let j=await t.get(Pb).getFirstMatchingRequestWithTimeout(r,E,g.prompt,m.isSpeculative,x);if(u("asyncWait"),j){let Q=!b.requestMultiline;T=[[mhr(j[0],{forceSingleLine:Q})],4]}if(BNe(t,r,o))return ul.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:yp(x,t)}}let P=b.blockMode==="moremultiline"&&rO.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(j=>LNe(t,e.textDocument,e.position,j,P,ul)).filter(j=>j!==void 0)),T!==void 0&&T[0].length===0)return ul.debug(t,`Found empty inline suggestions locally via ${nme(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:yp(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))ul.debug(t,`Found inline suggestions locally via ${nme(T[1])}`);else{if(m.isCycling){let j=await AJs(t,R,x,o,b.finishedCb);if(j.type==="success"){let Q=T?.[0]??[];j.value[0].forEach(U=>{Q.findIndex(Y=>Y.completionText.trim()===U.completionText.trim())===-1&&Q.push(U)}),T=[Q,3]}else if(T===void 0)return j}else{let j=a((W,V)=>(t.get(Pb).updateCompletion(r,W),b.finishedCb(W,V)),"finishedCb"),Q=new Fn.CancellationTokenSource,U=gJs(t,R,x,Q.token,j);t.get(Pb).queueCompletionRequest(r,E,g.prompt,Q,U);let Y=await t.get(Pb).getFirstMatchingRequest(r,E,g.prompt,m.isSpeculative);if(Y===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:yp(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:yp(x,t)};let[D,N]=T,L=D.map(j=>LNe(t,e.textDocument,e.position,j,P,ul)).filter(j=>j!==void 0),B=Ft(t,Ye.CompletionsDelay)??d.completionsDelay(n),q=yl()-n.issuedTime,M=Math.max(B-q,0);if(N!==2&&!m.isCycling&&M>0&&(ul.debug(t,`Waiting ${M}ms before returning completion`),await SC(M),BNe(t,r,o)))return ul.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:PH(x)};let O=[];for(let j of L){let Q=PJs(t,e.textDocument,R,j,x),U=f?Uri(e.textDocument,e.position,j):0,W={completion:wJs(j.choiceIndex,j.completionText,g.trailingWs),telemetry:Q,isMiddleOfTheLine:f,suffixCoverage:U,copilotAnnotations:j.copilotAnnotations,clientCompletionId:j.clientCompletionId};O.push(W)}return x.properties.clientCompletionId=O[0]?.clientCompletionId,x.measurements.foundOffset=O?.[0]?.telemetry?.measurements?.foundOffset??-1,ul.debug(t,`Produced ${O.length} results from ${nme(N)} at ${x.measurements.foundOffset} offset`),BNe(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:PH(x)}:(m.isSpeculative||t.get(Db).setGhostText(E,g.prompt.suffix,L,N),u("complete"),{type:"success",value:[O,N],telemetryData:yp(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(vJs,"getGhostTextWithoutAbortHandling");async function ghr(t,e,r,n){let o=Mt();t.get(Db).currentRequestId=o;let s=await kJs(t,e.textDocument,o,n);await mQ().catch(()=>{});try{return t.get(Nb).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(t4).notifyRequest(e,o,s,r,n),await vJs(t,e,o,s,r,n)}catch(c){if(Gm(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:PH(s,{cancelledNetworkRequest:!0})};throw c}}a(ghr,"getGhostText");function CJs(t,e,r,n){let o=t.get(Db).getCompletionsForUserTyping(e,r.suffix),s=RJs(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(CJs,"getLocalInlineSuggestion");function bJs(t,e){let r=SJs(e,t),n=TJs(e,t);return r&&!n?void 0:r&&n}a(bJs,"isInlineSuggestion");function SJs(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(SJs,"isMiddleOfTheLine");function TJs(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(TJs,"isValidMiddleOfTheLinePosition");function IJs(t,e){return e.lineAt(t).text.trim().length===0}a(IJs,"isNewLine");var x8=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function xJs(t,e,r,n,o,s,c){if(t.get(x8).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)Et(t,"ghostText.longFileMultilineSkip",Wt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&rO.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await Mdn(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&IJs(n,r))return{requestMultiline:!0};let u=!1;return!o&&PS(r.detectedLanguageId)?u=await Jlt(r,n):o&&PS(r.detectedLanguageId)&&(u=await Jlt(r,n)||await Jlt(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=NXn(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(xJs,"shouldRequestMultiline");function Mdt(t,e,r){t.get(j2).append(e.prefix,e.prompt.suffix,r)}a(Mdt,"appendToCache");function wJs(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(wJs,"adjustLeadingWhitespace");function RJs(t,e,r,n){let o=t.get(j2).findAll(e,r);return o.length===0?(ul.debug(t,"Found no completions in cache"),[]):(ul.debug(t,`Found ${o.length} completions in cache`),o.map(s=>mhr(s,{forceSingleLine:!n})))}a(RJs,"getCompletionsFromCache");async function kJs(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=Wt.createAndMarkAsIssued(o);return await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},s)}a(kJs,"createTelemetryWithExp");function PJs(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,$ri(u,e),u.extendWithRequestId(s),u.measurements.confidence=Bri(t,u),u.measurements.quantile=Fri(t,u),ul.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(PJs,"telemetryWithAddData");function DJs(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);$ri(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(gu.range(h.range.start,n)),g=e.getText(gu.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Hri.SHA256)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...Ese(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 _=d.extendedBy(y,E);return Et(t,"ghostText.issued",_),d}a(DJs,"telemetryIssued");function $ri(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a($ri,"addDocumentTelemetry");function Vri(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),Et(t,`ghostText.${e}`,l)}a(Vri,"telemetryPerformance");p();p();var fee=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 GT=class{static{a(this,"CitationManager")}},Odt=class extends GT{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var Ahr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??Fn.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=Bdt.indexOf(_);v!==-1&&Bdt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of Bdt)_()}a(e,"afterUpdateConnection");function r(_){K2.connection!==_&&(K2.connection=_,e())}a(r,"updateConnection");function n(){return K2.connection==="connected"}a(n,"isConnected");function o(){return K2.connection==="disconnected"}a(o,"isDisconnected");function s(){return K2.connection==="retry"}a(s,"isRetrying");function c(){return K2.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(_){K2.initialWait!==_&&(K2.initialWait=_)}a(h,"setInitialWait");function m(_,v=NJs){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return K2.initialWait}a(g,"isInitialWait");async function A(_,v){Ob.info(_,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let b=_.get(nr);function T(w,R){if(w>zri){Ob.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{K2.retryAttempts=Math.min(K2.retryAttempts+1,Yri);try{Ob.info(R,`Pinging service after ${w} second(s)`);let P=await b.fetch(new URL("_ping",bB(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(P.status!==200||!P.ok)T(w**2,R);else{Ob.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),Ob.info(_,"Attempting to reconnect."),T(yhr,_)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),Ldt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},Ldt}a(MJs,"registerConnectionState");var hee=MJs();p();var qg={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},FNe={[qg.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[qg.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[qg.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function Ehr(t){return t===401?qg.Unauthorized:t===400?qg.BadArguments:t===404?qg.NotFound:t===429?qg.RateLimit:t>=500&&t<600?qg.InternalError:t>=600?qg.ConnectionError:qg.Unknown}a(Ehr,"getErrorType");function g4(t,e,r={}){return{kind:"failure",reason:Ehr(Number(t)),code:Number(t),msg:e,meta:r}}a(g4,"createErrorResponse");p();var OJs=/^[1-6][0-9][0-9]$/,LJs=/([A-Z][a-z]+)/,BJs="code_referencing",UNe=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[BJs,this.baseKey,...e].join(".")}},_hr=class extends UNe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=Wt.createAndMarkAsIssued();Et(e,r,n)}handleFocus({context:e}){let r=Wt.createAndMarkAsIssued(),n=this.buildKey("focus","count");Et(e,n,r)}handleWrite({context:e}){let r=Wt.createAndMarkAsIssued(),n=this.buildKey("write","count");Et(e,n,r)}},k$f=new _hr,vhr=class extends UNe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=Wt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");Et(e,o,n)}handleDismiss({context:e,actor:r}){let n=Wt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");Et(e,o,n)}},P$f=new vhr,Chr=class extends UNe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});eg(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});eg(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(OJs)){Ob.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(LJs).filter(l=>!!l).join("_").toLowerCase(),c=Wt.createAndMarkAsIssued({message:o});eg(e,this.buildKey(s,r),c)}},Fdt=new Chr;var FJs="twirp/github.snippy.v1.SnippyAPI";async function bhr(t,e,r,n){let o;try{o=await t.get(Qt).getToken()}catch{return hee.setDisconnected(),g4(401,FNe[qg.Unauthorized])}if(Ob.info(t,`Calling ${e}`),hee.isRetrying())return g4(600,"Attempting to reconnect to the public code matching service.");if(hee.isDisconnected())return g4(601,"The public code matching service is offline.");let s;try{s=await t.get(nr).fetch(nx(t,o,"origin-tracker",`${FJs}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...Gy(t)},signal:n})}catch{return hee.enableRetry(t),g4(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 Fdt.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=Ehr(h),g=d||"unknown error";switch(m){case qg.Unauthorized:return g4(u,FNe[qg.Unauthorized],f);case qg.BadArguments:return g4(u,g,f);case qg.RateLimit:return hee.enableRetry(t,60*1e3),g4(u,FNe.RateLimitError,f);case qg.InternalError:return hee.enableRetry(t),g4(u,FNe[qg.InternalError],f);default:return g4(u,g,f)}}a(bhr,"call");p();var Udt=S.Object({kind:S.Literal("failure"),reason:S.String(),code:S.Number(),msg:S.String(),meta:S.Optional(S.Any())}),QJs=S.Object({matched_source:S.String(),occurrences:S.String(),capped:S.Boolean(),cursor:S.String(),github_url:S.String()}),Kri=S.Object({source:S.String()}),qJs=S.Object({snippets:S.Array(QJs)}),Jri=S.Union([qJs,Udt]),Zri=S.Object({cursor:S.String()}),jJs=S.Object({commit_id:S.String(),license:S.String(),nwo:S.String(),path:S.String(),url:S.String()}),HJs=S.Object({has_next_page:S.Boolean(),cursor:S.String()}),GJs=S.Object({count:S.Record(S.String(),S.String())}),$Js=S.Object({file_matches:S.Array(jJs),page_info:HJs,license_stats:GJs}),Xri=S.Union([$Js,Udt]);async function eni(t,e,r){let n=await bhr(t,"Match",{method:"POST",body:mK(Kri,{source:e})},r);return mK(Jri,n)}a(eni,"Match");async function tni(t,{cursor:e},r){let n=await bhr(t,"FilesForMatch",{method:"POST",body:mK(Zri,{cursor:e})},r);return mK(Xri,n)}a(tni,"FilesForMatch");p();var QNe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),Qdt=65;function zJs(t){let e=0,r;QNe.lastIndex=0;do if(r=QNe.exec(t),r&&(e+=1),e>=Qdt)break;while(r);return e}a(zJs,"lexemeLength");function YJs(t,e){let r=0,n;QNe.lastIndex=0;do if(n=QNe.exec(t),n&&(r+=1,r>=e))return QNe.lastIndex;while(n);return t.length}a(YJs,"offsetFirstLexemes");function rni(t,e){let r=t.split("").reverse().join(""),n=YJs(r,e);return r.length-n}a(rni,"offsetLastLexemes");function qNe(t){return zJs(t)>=Qdt}a(qNe,"hasMinLexemeLength");function JJs(t){return eO.Check(Udt,t)}a(JJs,"isError");async function nni(t,e){let r=await e();if(JJs(r)){Fdt.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(nni,"snippyRequest");function ini(t){return"kind"in t&&t.kind==="failure"}a(ini,"isMatchError");async function oni(t,e,r,n){let s=await t.get($r).getTextDocument({uri:e});if(!s){Ob.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!qNe(c)||!qNe(c))return;let l=r;if(!qNe(r)){let g=c.slice(0,n),A=rni(g,Qdt);l=c.slice(A,n+r.length)}if(!qNe(l))return;let u=await nni(t,()=>eni(t,l));if(!u||ini(u)||!u.snippets.length){Ob.info(t,"No match found");return}Ob.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await nni(t,()=>tni(t,{cursor:g.cursor}));if(!A||ini(A))return;let y=A.file_matches,E=A.license_stats;return{match:g,files:y,licenseStats:E}}),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(),E=n,_=n+g.match.matched_source.length,v=s.positionAt(E),b=s.positionAt(_);await t.get(GT).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:E,offsetEnd:_,version:s.version,location:{start:v,end:b},matchingText:l,details:y.map(T=>({license:T,url:g.match.github_url}))})}}a(oni,"fetchCitations");p();function Shr(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(eZs,"lexGeneratorWords");function sni(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(sni,"lexicalAnalyzer");function ani(t){return t!==" "}a(ani,"notSingleSpace");function cni(t,e,r=eZs){let[n,o]=sni(t,ZJs(),r,ani),[s,c]=sni(e,o,r,ani);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=XJs(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 b=l[n[_][0]];return v==0&&b.endsWith(d)||v==u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=Shr(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(cni,"lexEditDistance");p();function QH(t){return t.length===0?0:t.split(` +`).length}a(QH,"countLines");function lni(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(lni,"computeCompletionText");var qH=new fe("postInsertion"),uni=[{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}],dni=50,tZs=1500,rZs=.5,nZs=500,Thr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function fni(t,e,r,n,o){let s=await t.get(ii).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return qH.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 kme(t,r.properties.headerRequestId,pee(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=Hfr(u,n,c.detectedLanguageId),y=iei(g,void 0)(m),E=Math.min(l.length,n+(y?y*2:nZs)),_=l.substring(n,E);return{prompt:h,capturedCode:_,terminationOffset:y??-1}}}a(fni,"captureCode");function qdt(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{qH.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),OXn(t,e,d)});let s=new fee(t,n,r-1),c=new fee(t,n,r),l=a(async u=>{qH.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await fni(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});qH.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),Et(t,e+".capturedAfterRejected",A,1)},"checkInCode");uni.filter(u=>u.captureRejection).map(u=>s.push(z0(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(qdt,"postRejectionTasks");function jNe(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});qH.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),MXn(t,e,u);let d=r;r=lni(r,c);let f=r.trim(),h=new fee(t,o,n),m=new fee(t,o,n+r.length),g=a(async A=>{await aZs(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(Thr.triggerPostInsertionSynchroneously&&O1(t)){let A=g({seconds:0,captureCode:Thr.captureCode,captureRejection:Thr.captureRejection});t.get(xd).register(A)}else uni.map(A=>h.push(z0(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));z0(t,iZs,"post insertion citation check")(t,o,d,r,n,l)}a(jNe,"postInsertionTasks");async function iZs(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(ix(t)?.getTokenValue("sn")==="1")return;await oni(t,e,n,o);return}let c=await t.get($r).getTextDocument({uri:e});if(c){let l=Ihr(c.getText(),n,dni,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=oZs(r.length,n.length,l.start_offset);if(u===void 0){qH.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+sZs(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(GT).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(iZs,"citationCheck");function oZs(t,e,r){if(!(ee))return r}a(oZs,"computeCitationStart");function sZs(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(uZs,"computeRejectedCompletions");function xhr(t,e){let r=t.get(iy);if(!r.position||!r.uri)return;let n=uZs(r);n.length>0&&qdt(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(xhr,"rejectLastShown");function pni(t,e,r,n){let o=t.get(iy);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&xhr(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(pni,"setLastShown");function hni(t,e){let r=t.get(iy);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;lZs.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,qlt(t,"ghostText",e)}}a(hni,"handleGhostTextShown");function dZs(t,e,r){let n=t.get(iy);n.linesLeft===void 0&&(n.linesAccepted=QH(e.insertText.substring(0,r)),n.linesLeft=QH(e.displayText));let o=QH(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(dZs,"handleLineAcceptance");function Dme(t,e,r="ghostText"){let n=t.get(iy),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:QH(e.displayText)},n.resetState(),jNe(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Dme,"handleGhostTextPostInsert");function jdt(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(iy),l;return s==="cumulative"?(fZs(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(dZs(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),jNe(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(jdt,"handlePartialGhostTextPostInsert");function fZs(t,e,r){let n=t.get(iy);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=QH(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(fZs,"handleCumulativeAcceptance");p();var A4=new Map;A4.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});A4.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});A4.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});A4.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});A4.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});A4.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var pZs=new fe("sdk");function Hdt(t,e){A4.has(t.get(Ir).getEditorPluginInfo().name)||pZs.warn(t,...e)}a(Hdt,"deprecationWarning");var DYi=de(yP()),xI=de(DP());p();p();p();p();var Gdt={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function Nme(t,e){let r=Wt.createAndMarkAsIssued({authType:e});Et(t,Gdt.NewGitHubLogin,r),At(t,Gdt.NewGitHubLogin,{authType:e})}a(Nme,"telemetryNewGitHubLogin");function J2(t,e,r,n,o){Vn(t,Gdt.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(J2,"telemetryGitHubLoginResult");function HNe(t,e,r){Vn(t,Gdt.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(HNe,"telemetryCodeFlowError");var mni=["repo","workflow"],whr=class extends yi{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function hZs(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:e,scope:mni.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(nr).fetch(s,n)}catch(c){throw c instanceof Error&&tx(c)?new yi(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(hZs,"requestDeviceFlowStage1");async function mZs(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(nr).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 whr(c):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(mZs,"requestDeviceFlowStage2");async function gZs(t,e){let n=await(await Gf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(gZs,"requestUserInfo");var $T=class{constructor(e){this.ctx=e;this.pendingSignIn=void 0}static{a(this,"GitHubDeviceFlow")}get authManager(){return this.ctx.get(Ur)}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(zp).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(zp).githubAppId=n;let d=await this.save(u);return J2(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{J2(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw J2(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(bC).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;Nme(n,"deviceFlow");let o=await hZs(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 mZs(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await gZs(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):mni;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new yi(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var Rhr=de(ti());p();var lR=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var $dt="github.copilot.finishDeviceFlow",khr=class extends lR{constructor(){super(...arguments);this.name=$dt;this.arguments=S.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get($T),s=o.pendingSignIn;if(!s)throw new Rhr.ResponseError(Ze.InvalidRequest,"No pending sign in");try{await this.ctx.get(Vm).open(s.verificationUri)}catch(c){b_.warn(this.ctx,"Failed to open",s.verificationUri),b_.exception(this.ctx,c,$dt)}try{return await s.status}catch(c){throw new Rhr.ResponseError(Ze.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},gni=[khr];p();p();var Ru=class extends Cn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var GNe="github.copilot.didAcceptCompletionItem",Phr=class extends lR{constructor(){super(...arguments);this.name=GNe;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(Ru).get(n);return s?(Dme(this.ctx,s),!0):!1}},Ani=[Phr];p();p();p();var f1t=de(d1t()),EQi=de(J$());function iRc(t){switch(t){case f1t.TokenizerName.cl100k:return"cl100k_base";case f1t.TokenizerName.o200k:return"o200k_base";case f1t.TokenizerName.mock:return"mock"}}a(iRc,"toClsTokenizerName");var _Qi={getTokenizer:a(t=>ws(iRc(t)),"getTokenizer"),ensureLoaded:a(()=>Fun(),"ensureLoaded")},oRc=new hQ,sRc={encode:a(t=>oRc.tokenize(t),"encode")},p1t=class extends EQi.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(sRc)}};p();p();p();p();function vQi(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(AQi,"normalizeIndentCharacter");Mo();function yQi(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=gu.range(gu.position(o.line,0),gu.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=AQi(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=gu.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:Mt(),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(yQi,"completionsFromGhostTextResults");p();var CN=class{constructor(){this.cache=new Cn(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 dEe=class extends ry{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 mhr(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=lni(s,r.textDocument,r.position,d),h=yQi(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(()=>mhr(s,r,void 0,g),"fn");s.get(CN).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,E=Fn.Range.create(A,Fn.Position.create(y.line,y.character-c));return{...g,range:E}});return{...l,value:m}}async getPrompt(r,n,o,s={}){let c=await this.getInlineCompletionsResult(pee(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(pee(r,n),o,s);return DXn(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}});Ult.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(CN).request(r.clientCompletionId)}};p();var fEe=de(Vne()),EQi=de(iN()),p4r=de(rdt()),m1t=de(cee()),_Qi=de(Rs()),vQi=de(W2()),n3e=de(kE()),h1t=de(q_()),h4r=de(hd()),CQi=de(qT()),bQi=de(ri());p();var p1t=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new Wi;this._onDidChangeTextDocument=new Wi;this._onDidCloseTextDocument=new Wi;this._onDidSelectTextDocument=new Wi;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 bV=class extends m1t.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,vQi.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new p1t(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=fEe.DocumentId.create(Fs(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=fEe.DocumentId.create(Fs(Fs(r)));return this.addDocument({id:s,initialValue:o,languageId:p4r.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=fEe.DocumentId.create(Fs(Fs(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=fEe.DocumentId.create(Fs(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=fEe.DocumentId.create(Fs(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 m4r(r.id,new CQi.StringText(r.initialValue??""),[],r.languageId??p4r.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()}},m4r=class extends m1t.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 h1t.Position(e.lineNumber+1,e.column+1));this.updateSelection([new h4r.OffsetRange(r,r)])}editFromLspContentChanges(e){return new EQi.Edits(n3e.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(bQi.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new h1t.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new h1t.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 _Qi.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 n3e.StringEdit.single(new n3e.StringReplacement(new h4r.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var SQi=de(u1t()),TQi=de(hgt()),g4r=de(cee()),pEe=de(Ic()),C4r=de(Ro());var A4r=class extends C4r.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 pEe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new pEe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidCopilotTokenChange=this._register(new pEe.Emitter);this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new pEe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(bs(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(Ur).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(),g1t(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(Ur).resolveSession();return g1t(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Qt).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function g1t(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new TQi.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(pf).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(g1t,"asChatLibCopilotToken");var y4r=class extends C4r.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new pEe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(bs(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(Ox),o=await this.ctx.get(Qt).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){qa(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.")}},E4r=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(nc).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)}},_4r=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}}}},v4r=class extends ry{constructor(r){super();this.ctx=r;this._telemetrySender=new i3e(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(hm).matchFunction,o=new s3e(this.ctx.get(tr)),s=ple(r),c={fetcher:o,authService:new A4r(r),telemetrySender:this._telemetrySender,logTarget:new o3e(r),isRunningInTest:O1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new _4r(r.get(ps)),documentManager:r.get($r),workspace:r.get(g4r.ObservableWorkspace),urlOpener:r.get(Vm),editorInfo:r.get(Ir).getEditorInfo(),editorPluginInfo:r.get(Ir).getEditorPluginInfo(),relatedPluginInfo:r.get(Ir).getRelatedPluginInfo(),editorSession:r.get(Ua),notificationSender:r.get(ts),ignoreService:new E4r(r),waitForTreatmentVariables:!1,endpointProvider:new y4r(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s,tokenizerProvider:gQi},l=(0,SQi.createInlineCompletionsProvider)(c);return this.ctx.get(Lo).onDidChangeCopilotSettings(()=>{let u=ple(this.ctx);l.setConfigs(u).catch(d=>{qa(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=this.completionProvider,l=this.ctx.get(g4r.ObservableWorkspace);l instanceof bV&&await l.syncSafeDocuments();let u=await this.ctx.get(Zt).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 JI({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new iB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new nC(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)}},A1t=class extends ry{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new dEe(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new v4r(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();return Ft(this.ctx,Ye.UseChatLibCompletions)??this.ctx.get(Zt).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)}},i3e=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),vse(this.ctx,e,o.properties,o.measurements,0),At(this.ctx,e,fU(o.properties,cNe),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),vse(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",Wt.createAndMarkAsIssued(n,o)}};p();var IQi=de(T$()),xQi=de(Ic()),a3e=de(BIr()),wQi=de(nL());var tRc=16,h9=class extends IQi.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new Cn(tRc);this._onDidChangeDiagnostics=new xQi.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(rRc);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 rRc(t){let e=new wQi.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?a3e.DiagnosticSeverity.Error:a3e.DiagnosticSeverity.Warning,n=new a3e.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(rRc,"toVscodeDiagnostic");p();var nRc="nes.reportInlineEditArc";function RQi(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};At(t,nRc,r,n)}a(RQi,"emitNESArcTelemetry");var m9=de(u1t()),PQi=de(Vne()),S4r=de(cee()),DQi=de(_y()),NQi=de(abt()),MQi=de(Ic()),T4r=require("node:stream");Mo();var kQi=10,iRc=[0,30*1e3,120*1e3,300*1e3,600*1e3,900*1e3],b4r=new fe("nextEditSuggestions"),oRc={[m9.LogLevel.Off]:4,[m9.LogLevel.Trace]:4,[m9.LogLevel.Debug]:4,[m9.LogLevel.Info]:3,[m9.LogLevel.Warning]:2,[m9.LogLevel.Error]:1},o3e=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(qf).logIt(this.ctx,oRc[e],r,...n)}},Vv=class{constructor(e){this.lastResultsById=new Cn(kQi);this.lastResultsByUri=new Cn(kQi);this.ctx=e,this.telemetrySender=new i3e(this.ctx)}static{a(this,"NextEditSuggestionsManager")}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(S4r.ObservableWorkspace);if(s instanceof bV&&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=Fs(e),l=PQi.DocumentId.create(c),u=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();o.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(u.filtersAndExp.exp);let d=await o.getNextEdit(l.toUri(),n);if(d.result==null)return;let f=await aRc({textDocumentManager:this.ctx.get($r)},d.result,{normalizedUri:c,version:r});if(!f)return;f.isCrossFile&&b4r.debug(this.ctx,`Cross-file NES: edit requested for ${l.uri} targets ${f.document.uri}`);let h=sRc(d)??Mt(),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(nT).initialize(o,e.originalText,n,{timeouts:iRc}).startReporter(c=>{RQi(this.ctx,{...c,opportunityId:e.resultId,languageId:e.languageId})})}).catch(o=>{b4r.warn(this.ctx,"Failed to start NES ARC telemetry",o)})}catch(r){b4r.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&&cRc(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(S4r.ObservableWorkspace),r=new s3e(this.ctx.get(tr)),n=new I4r(this.ctx),o=ple(this.ctx),s=await(0,m9.createNESProvider)({configOverrides:o,workspace:e,fetcher:r,copilotTokenManager:n,terminalService:NQi.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new o3e(this.ctx),languageDiagnosticsService:this.ctx.get(h9),tokenizerProvider:new f1t});return this.ctx.get(Lo).onDidChangeCopilotSettings(()=>{let c=ple(this.ctx);s.setConfigs(c).catch(l=>{qa(this.ctx,l,"nesProvider.setConfigs")})}),s}shouldUseExplicitRejection(){return Ft(this.ctx,Ye.NESUseExplicitRejection)}};function sRc(t){let e=t.requestUuid;return typeof e=="string"&&e.length>0?e:void 0}a(sRc,"readOpportunityId");async function aRc(t,e,r){let n=r.normalizedUri,o=e.targetDocumentUri,s=o!==void 0&&Fs(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(aRc,"resolveNextEditTarget");function cRc(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){qa(t,o,"nesProvider.setDisposalReason")}}a(cRc,"trySetChatLibDisposalReason");var I4r=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new MQi.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(Ur).resolveSession();return g1t(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Qt).resetToken("nes",e)}},s3e=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 T4r.Readable?c=T4r.Readable.toWeb(s):c=s),new DQi.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},Mt(),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 XI(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 lRc="github.copilot.didAcceptNextEditSuggestionItem",x4r=class extends cR{constructor(){super(...arguments);this.name=lRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(Vv).handleAcceptance(n),!0}},uRc="github.copilot.didRejectNextEditSuggestionItem",w4r=class extends cR{constructor(){super(...arguments);this.name=uRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(Vv).handleRejection(n),!0}},dRc="github.copilot.didIgnoreNextEditSuggestionItem",R4r=class extends cR{constructor(){super(...arguments);this.name=dRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(Vv).handleIgnored(n),!0}},OQi=[x4r,w4r,R4r];p();var P4r="github.copilot.didAcceptPanelCompletionItem",k4r=class extends cR{constructor(){super(...arguments);this.name=P4r;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(Ru).get(o);return c?(QNe(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:UH(c.displayText)},c.copilotAnnotations),!0):!1}},LQi=[k4r];var fRc=[...fni,...pni,...OQi,...LQi];function BQi(t,e){let r=new Map;for(let n of fRc){let o=new n(t),s=qu.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=g9(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Ir).getEditorPluginInfo();await e.get(Yn).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(Yn).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,c3e.gt)((0,c3e.coerce)(r.version),(0,c3e.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(Yn).delete("versions",r.name),(await e.get(Yn).listKeys("versions")).length===0&&await e.get(Yn).deleteSetting("versions")}};p();var jQi=de(nl()),HQi=require("crypto"),C1t=de(require("path")),mEe=de(Xc());var mRc={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},gRc=new mEe.ProgressType,bN=class t{constructor(e){this.ctx=e;this.#e=new Wi;this._changeHandlerLimiter=new jQi.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new mEe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(ar).connection}init(){this.ctx.get(bn).getCapabilities().watchedFiles&&this.connection.onNotification(mEe.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(bn).getCapabilities().watchedFiles)return mRc;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(bn).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=C1t.extname(l).toLowerCase();_Q.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=C1t.extname(s.uri).toLowerCase();if(!_Q.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(nc).enabled?this.getValidDocument(e):NS.create(e,"UNKNOWN",-1,"")}async getValidDocument(e){let n=await this.ctx.get(ii).getOrReadTextDocument({uri:e});return n.status==="valid"?n.document:void 0}async fetchWatchedFileEntries(e){let r=e.partialResultToken??(0,HQi.randomUUID)(),n=[],o=this.connection.onProgress(gRc,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=C1t.extname(l).toLowerCase();if(!_Q.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 ARc=new fe("mcpGateway.projectCleanup"),iie=class{constructor(e){this._dispose=e}static{a(this,"McpProjectCleanupSubscription")}dispose(){this._dispose()}};function GQi(t){let e=t.get($r),r=t.get(ey),n=e.onDidChangeWorkspaceFolders(o=>{if(o.removed.length!==0)for(let s of o.removed)r.removeProject(s.uri).catch(c=>{ARc.warn(t,"removeProject failed during workspace-folder cleanup",{workspaceFolder:s.uri,error:c instanceof Error?c.message:String(c)})})});return new iie(()=>n.dispose())}a(GQi,"installMcpProjectCleanup");p();p();p();p();p();var WQi=require("crypto");var yRc=new fe("CloudAgentLogParser"),ERc=new Set(["run_setup","run_custom_setup_step"]),b1t=class{constructor(){this.counter=0}static{a(this,"CloudAgentIdSource")}next(){return++this.counter}};function SN(t){if(t!=null)return typeof t=="string"?t:JSON.stringify(t)}a(SN,"asString");function _Rc(t){return typeof t=="number"&&Number.isFinite(t)?new Date(t*1e3).toISOString():new Date().toISOString()}a(_Rc,"chunkTimestamp");function gEe(t,e,r){return{id:(0,WQi.randomUUID)(),timestamp:r,parentId:null,type:t,data:e}}a(gEe,"event");function S1t(t,e,r){if(!e||e.trim().length===0)return[];let n=[];return bRc(t,e,o=>{let s=_Rc(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"||SN(d.role)==="assistant"&&vRc(d,u,n,r,s)}}),n}a(S1t,"parseCloudAgentLogs");function vRc(t,e,r,n,o){let s=t.tool_calls,c=Array.isArray(s)&&s.length>0?s:void 0,l=SN(t.content),u=SN(e.finish_reason);if(u==="tool_calls"&&c){let m=c[0],g=m.function,A=SN(g?.name);if(A&&ERc.has(A)){if(l&&l.trim().length>0){let y=VQi(SN(g?.arguments)),E=SN(y?.name)??l,_=SN(m.id)??`setup-${E}`;zQi(r,_,A,{name:E},E,o)}return}}let d=l?.trimStart(),f=d?.startsWith("")===!0,h=d&&!d.startsWith("")&&!d.startsWith("")?d.trim():"";if(c){h.length>0&&r.push($Qi(h,n,o));for(let m of c){let g=m,A=g.function,y=SN(A?.name);if(!y)continue;let E=VQi(SN(A?.arguments));CRc(r,g,y,l,E,n,o)}if(f){let m=(l??"").replace(/^\s*\s*/i,"").replace(/\s*<\/error>\s*$/i,"").trim(),g=`command-error-${n.next()}`;r.push(gEe("tool.execution_start",{toolCallId:g,toolName:"command",arguments:{}},o)),r.push(gEe("tool.execution_complete",{toolCallId:g,success:!1,error:{message:m.length>0?m:"Command failed"}},o))}return}h.length>0&&(u==="stop"?r.push($Qi(h,n,o)):r.push(YQi(h,n,o)))}a(vRc,"processAssistantDelta");function CRc(t,e,r,n,o,s,c){if(r==="reply_to_comment")return;let l=SN(e.id);if(!l)return;if(r==="think"){let d=SN(o?.thought)??n;d&&d.trim().length>0&&t.push(YQi(d,s,c));return}let u=n?.trim();zQi(t,l,r,o,u&&u.length>0?u:void 0,c)}a(CRc,"appendToolPart");function zQi(t,e,r,n,o,s){t.push(gEe("tool.execution_start",{toolCallId:e,toolName:r,arguments:n??{}},s)),t.push(gEe("tool.execution_complete",{toolCallId:e,success:!0,result:{content:o??""}},s))}a(zQi,"pushToolCall");function $Qi(t,e,r){return gEe("assistant.message",{messageId:`cloud-text-${e.next()}`,content:t},r)}a($Qi,"textEvent");function YQi(t,e,r){return gEe("assistant.reasoning",{reasoningId:`cloud-reasoning-${e.next()}`,content:t},r)}a(YQi,"reasoningEvent");function VQi(t){if(!(!t||t.trim().length===0))try{let e=JSON.parse(t);return e&&typeof e=="object"?e:void 0}catch{return}}a(VQi,"parseArguments");function bRc(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{yRc.debug(t,"parseCloudAgentLogs: skipping malformed SSE data chunk",{data:s});continue}c&&typeof c=="object"&&r(c)}}a(bRc,"forEachDataChunk");p();var T1t=require("crypto");var oie=new fe("CloudAgentSession"),sie="CloudAgentSession",KQi="cloud:",SRc="cloud.pull_request_card";function N4r(t,e){let r=e?new Date(e):null,n=r&&!isNaN(r.getTime())?r.toISOString():new Date().toISOString();return{id:(0,T1t.randomUUID)(),timestamp:n,parentId:null,type:SRc,data:{number:t.number,title:t.title?.trim()||`Pull request #${t.number}`,body:t.body?.trim()||null,htmlUrl:t.html_url??null}}}a(N4r,"buildCloudPullRequestCardEvent");function ZQi(t){if(!t.startsWith(KQi))return;let e=t.slice(KQi.length),r=Number(e);return e.length>0&&Number.isInteger(r)&&r>0?r:void 0}a(ZQi,"parseCloudPullRequestNumber");var DL={InProgress:"in_progress",Queued:"queued",Completed:"completed",Failed:"failed"},D4r=3e3,TRc=120*1e3,IRc=300*1e3,JQi=10,I1t=class{constructor(e,r,n,o){this.ctx=e;this.notificationSender=r;this.client=n;this._ids=new b1t;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}async startInitialJob(e){let n=this.resetCancellation().token;try{let{owner:o,name:s,baseRef:c}=await this.resolveRepo(n),l=hue(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(N4r(d)),oie.info(this.ctx,`${sie}.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||exe(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 Zh(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,T1t.randomUUID)(),interactionId:this.localSessionId})),n!==DL.InProgress){let s=await this.waitForInProgress(e,o);if(o.isCancellationRequested)return;switch(s?.state){case DL.InProgress:break;case DL.Failed:this.emitError(s.error?.message??"The cloud agent session failed.");return;case DL.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()+TRc;for(;!r.isCancellationRequested&&Date.now()=JQi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}if(!c){oie.warn(this.ctx,`${sie}.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(oie.warn(this.ctx,`${sie}.streamSessionLogs: log fetch failed; will retry`,{cloudSessionId:e,error:this.errorMessage(f)}),++s>=JQi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}s=0;let u=c.state,d=u!==DL.InProgress&&u!==DL.Queued;if(l.length>o){let f=l.slice(o);o=l.length;let h=S1t(this.ctx,f,this._ids);for(let m of h)this.emit(m)}if(d){u===DL.Failed?this.emitError(c.error?.message??"The cloud agent session failed."):this.emitIdle();return}}}async waitForNewSession(e,r,n){let o=Date.now()+IRc;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(D4r,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 _f(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 kO([new PO,new DO]).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=>{oie.warn(this.ctx,`${sie}.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,T1t.randomUUID)(),timestamp:new Date().toISOString(),parentId:null,type:e,data:r}}resetCancellation(){this.stop();let e=new Fn.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)}};var XQi=require("crypto");Mo();var y9=new fe("CloudAgent"),E9="CloudAgentService";function xRc(){return{id:"auto",name:"Auto",preview:!1,capabilities:{family:"auto",supports:{vision:!0},limits:{max_context_window_tokens:0}}}}a(xRc,"buildCloudAutoModel");var aie=class{constructor(e){this.ctx=e;this._sessions=new Map;this.notificationSender=e.get(ts),this.client=new HC(e)}static{a(this,"CloudAgentService")}async createSession(e){let r=e.sessionId??Mt(),n=await this.getOrCreateSession(r,e.workspaceFolder);return{sessionId:r,workspacePath:n.cwd}}async resumeSession(e){let{sessionId:r}=e,n=await this.getOrCreateSession(r,e.workspaceFolder);if(!n.pullRequest)return{sessionId:r,workspacePath:n.cwd,events:[]};let{events:o,streamStatus:s}=await this.loadSessionHistory(n.pullRequest,n.idSource);if(s&&(s.state==="in_progress"||s.state==="queued")){let{stream:c}=n.resumeStreaming(s);c.catch(l=>{y9.warn(this.ctx,`${E9}.resumeSession: stream failed`,{sessionId:r,error:l instanceof Error?l.message:String(l)})})}return y9.info(this.ctx,`${E9}.resumeSession`,{sessionId:r,pullRequestNumber:n.pullRequest.number,events:o.length}),{sessionId:r,workspacePath:n.cwd,events:o}}async sendMessage(e,r){let n=this._sessions.get(e.sessionId);if(!n)return Promise.reject(new Error(`Cannot start cloud session ${e.sessionId}: session was not created or resumed first.`));let o=Mt(),s=n.hasPullRequest,{stream:c}=s?await n.submitFollowUp(e.message):await n.startInitialJob(e.message);return c.catch(l=>{y9.warn(this.ctx,`${E9}.sendMessage: turn failed`,{sessionId:e.sessionId,isFollowUp:s,error:l instanceof Error?l.message:String(l)})}),{messageId:o}}stopSession(e){let r=this._sessions.get(e);return r?(r.stopByUser(),y9.info(this.ctx,`${E9}.stopSession`,{sessionId:e}),Promise.resolve()):(y9.warn(this.ctx,`${E9}.stopSession: unknown session`,{sessionId:e}),Promise.resolve())}destroySession(e){return Promise.reject(this.unsupported("destroySession"))}listSessions(e){return Promise.reject(this.unsupported("listSessions"))}listModels(e){return Promise.resolve({models:[xRc()]})}createCloudSession(e,r,n){return new I1t(this.ctx,this.notificationSender,this.client,{localSessionId:e,workspaceFolder:r,pullRequest:n})}async getOrCreateSession(e,r){let n=this._sessions.get(e);if(n)return n;let o=await this.resolvePullRequest(e,r),s=this.createCloudSession(e,r,o);return this._sessions.set(e,s),s}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)):y9.warn(this.ctx,`${E9}.loadSessionHistory: session has no prompt`,{cloudSessionId:u.id,pullRequestNumber:e.number}),l===0&&s.push(N4r(e,u.created_at)),l++;let f;try{f=await this.client.getSessionLogs(u.id)}catch(h){y9.warn(this.ctx,`${E9}.loadSessionHistory: log fetch failed`,{cloudSessionId:u.id,error:h instanceof Error?h.message:String(h)});continue}s.push(...S1t(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,XQi.randomUUID)(),timestamp:o,parentId:null,type:"user.message",data:{content:e}}}async resolvePullRequest(e,r){let n=ZQi(e);if(n!==void 0)try{let o=await this.ctx.get(_f).getRepo({uri:r.uri});if(!o||!o.isGitHub()||!o.owner||!o.name){y9.warn(this.ctx,`${E9}.resolvePullRequest: workspace is not a GitHub repo`,{sessionId:e});return}return await new Zh(this.ctx).getPullRequest(o.owner,o.name,n)}catch(o){y9.warn(this.ctx,`${E9}.resolvePullRequest: failed`,{sessionId:e,error:o instanceof Error?o.message:String(o)});return}}unsupported(e){return new Error(`${e} is not supported by CloudAgentService`)}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}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 eqi=require("node:child_process"),tqi=require("node:events"),M4r=de(require("node:readline"));var SV=new fe("CodexProcessManager"),x1t=class extends tqi.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.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"]'];SV.debug(this.ctx,`start: cmd=${r} args=${JSON.stringify(n)} cwd=${this.cwd}`);try{this.process=(0,eqi.spawn)(r,n,{env:{...process.env,OPENAI_API_KEY:"copilot-proxy"},stdio:["pipe","pipe","pipe"],cwd:this.cwd||void 0}),SV.debug(this.ctx,`start: spawn succeeded, pid=${this.process.pid}`)}catch(o){let s=o instanceof Error?o.message:String(o);throw SV.error(this.ctx,`start: spawn failed: ${s}`),new Error(`Failed to spawn codex app-server: ${s}`)}this.process.on("error",o=>{SV.error(this.ctx,`process error event: ${o.message}`),this.handleProcessExit(-1)}),this.process.on("exit",o=>{SV.debug(this.ctx,`process exit event: code=${o}`),this.handleProcessExit(o??-1)}),this.process.stdout&&(this.rl=M4r.default.createInterface({input:this.process.stdout}),this.rl.on("line",o=>this.handleLine(o))),this.process.stderr&&M4r.default.createInterface({input:this.process.stderr}).on("line",s=>{SV.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+` +`)[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(vQi,"normalizeIndentCharacter");Oo();function CQi(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=gu.range(gu.position(o.line,0),gu.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=vQi(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=gu.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:Mt(),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(CQi,"completionsFromGhostTextResults");p();var bN=class{constructor(){this.cache=new Cn(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 ry{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 ghr(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=pni(s,r.textDocument,r.position,d),h=CQi(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(()=>ghr(s,r,void 0,g),"fn");s.get(bN).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,E=Fn.Range.create(A,Fn.Position.create(y.line,y.character-c));return{...g,range:E}});return{...l,value:m}}async getPrompt(r,n,o,s={}){let c=await this.getInlineCompletionsResult(pee(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(pee(r,n),o,s);return LXn(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}});Qlt.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(bN).request(r.clientCompletionId)}};p();var pEe=de(Vne()),bQi=de(oN()),h4r=de(ndt()),g1t=de(cee()),SQi=de(Rs()),TQi=de(z2()),o3e=de(kE()),m1t=de(q_()),m4r=de(hd()),IQi=de(HT()),xQi=de(ti());p();var h1t=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new Wi;this._onDidChangeTextDocument=new Wi;this._onDidCloseTextDocument=new Wi;this._onDidSelectTextDocument=new Wi;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 SV=class extends g1t.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,TQi.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new h1t(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=pEe.DocumentId.create(Fs(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=pEe.DocumentId.create(Fs(Fs(r)));return this.addDocument({id:s,initialValue:o,languageId:h4r.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=pEe.DocumentId.create(Fs(Fs(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=pEe.DocumentId.create(Fs(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=pEe.DocumentId.create(Fs(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 g4r(r.id,new IQi.StringText(r.initialValue??""),[],r.languageId??h4r.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()}},g4r=class extends g1t.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 m1t.Position(e.lineNumber+1,e.column+1));this.updateSelection([new m4r.OffsetRange(r,r)])}editFromLspContentChanges(e){return new bQi.Edits(o3e.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(xQi.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new m1t.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new m1t.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 SQi.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 o3e.StringEdit.single(new o3e.StringReplacement(new m4r.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var wQi=de(d1t()),RQi=de(mgt()),A4r=de(cee()),hEe=de(Ic()),b4r=de(ko());var y4r=class extends b4r.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 hEe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new hEe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidCopilotTokenChange=this._register(new hEe.Emitter);this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new hEe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(bs(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(Ur).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(),A1t(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(Ur).resolveSession();return A1t(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Qt).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function A1t(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new RQi.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(pf).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(A1t,"asChatLibCopilotToken");var E4r=class extends b4r.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new hEe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(bs(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(Lx),o=await this.ctx.get(Qt).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){Qa(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.")}},_4r=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(nc).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)}},v4r=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}}}},C4r=class extends ry{constructor(r){super();this.ctx=r;this._telemetrySender=new s3e(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(hm).matchFunction,o=new c3e(this.ctx.get(nr)),s=ple(r),c={fetcher:o,authService:new y4r(r),telemetrySender:this._telemetrySender,logTarget:new a3e(r),isRunningInTest:O1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new v4r(r.get(ps)),documentManager:r.get($r),workspace:r.get(A4r.ObservableWorkspace),urlOpener:r.get(Vm),editorInfo:r.get(Ir).getEditorInfo(),editorPluginInfo:r.get(Ir).getEditorPluginInfo(),relatedPluginInfo:r.get(Ir).getRelatedPluginInfo(),editorSession:r.get(Fa),notificationSender:r.get(ts),ignoreService:new _4r(r),waitForTreatmentVariables:!1,endpointProvider:new E4r(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s,tokenizerProvider:_Qi},l=(0,wQi.createInlineCompletionsProvider)(c);return this.ctx.get(Bo).onDidChangeCopilotSettings(()=>{let u=ple(this.ctx);l.setConfigs(u).catch(d=>{Qa(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=this.completionProvider,l=this.ctx.get(A4r.ObservableWorkspace);l instanceof SV&&await l.syncSafeDocuments();let u=await this.ctx.get(Zt).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 XI({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new iB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new iC(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)}},y1t=class extends ry{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 C4r(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();return Ft(this.ctx,Ye.UseChatLibCompletions)??this.ctx.get(Zt).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)}},s3e=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),vse(this.ctx,e,o.properties,o.measurements,0),At(this.ctx,e,pU(o.properties,uNe),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),vse(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",Wt.createAndMarkAsIssued(n,o)}};p();var kQi=de(I$()),PQi=de(Ic()),l3e=de(FIr()),DQi=de(nL());var aRc=16,m9=class extends kQi.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new Cn(aRc);this._onDidChangeDiagnostics=new PQi.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(cRc);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 cRc(t){let e=new DQi.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?l3e.DiagnosticSeverity.Error:l3e.DiagnosticSeverity.Warning,n=new l3e.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(cRc,"toVscodeDiagnostic");p();var lRc="nes.reportInlineEditArc";function NQi(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};At(t,lRc,r,n)}a(NQi,"emitNESArcTelemetry");var g9=de(d1t()),OQi=de(Vne()),T4r=de(cee()),LQi=de(_y()),BQi=de(cbt()),FQi=de(Ic()),I4r=require("node:stream");Oo();var MQi=10,uRc=[0,30*1e3,120*1e3,300*1e3,600*1e3,900*1e3],S4r=new fe("nextEditSuggestions"),dRc={[g9.LogLevel.Off]:4,[g9.LogLevel.Trace]:4,[g9.LogLevel.Debug]:4,[g9.LogLevel.Info]:3,[g9.LogLevel.Warning]:2,[g9.LogLevel.Error]:1},a3e=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(qf).logIt(this.ctx,dRc[e],r,...n)}},Wv=class{constructor(e){this.lastResultsById=new Cn(MQi);this.lastResultsByUri=new Cn(MQi);this.ctx=e,this.telemetrySender=new s3e(this.ctx)}static{a(this,"NextEditSuggestionsManager")}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(T4r.ObservableWorkspace);if(s instanceof SV&&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=Fs(e),l=OQi.DocumentId.create(c),u=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();o.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(u.filtersAndExp.exp);let d=await o.getNextEdit(l.toUri(),n);if(d.result==null)return;let f=await pRc({textDocumentManager:this.ctx.get($r)},d.result,{normalizedUri:c,version:r});if(!f)return;f.isCrossFile&&S4r.debug(this.ctx,`Cross-file NES: edit requested for ${l.uri} targets ${f.document.uri}`);let h=fRc(d)??Mt(),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(oT).initialize(o,e.originalText,n,{timeouts:uRc}).startReporter(c=>{NQi(this.ctx,{...c,opportunityId:e.resultId,languageId:e.languageId})})}).catch(o=>{S4r.warn(this.ctx,"Failed to start NES ARC telemetry",o)})}catch(r){S4r.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&&hRc(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(T4r.ObservableWorkspace),r=new c3e(this.ctx.get(nr)),n=new x4r(this.ctx),o=ple(this.ctx),s=await(0,g9.createNESProvider)({configOverrides:o,workspace:e,fetcher:r,copilotTokenManager:n,terminalService:BQi.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new a3e(this.ctx),languageDiagnosticsService:this.ctx.get(m9),tokenizerProvider:new p1t});return this.ctx.get(Bo).onDidChangeCopilotSettings(()=>{let c=ple(this.ctx);s.setConfigs(c).catch(l=>{Qa(this.ctx,l,"nesProvider.setConfigs")})}),s}shouldUseExplicitRejection(){return Ft(this.ctx,Ye.NESUseExplicitRejection)}};function fRc(t){let e=t.requestUuid;return typeof e=="string"&&e.length>0?e:void 0}a(fRc,"readOpportunityId");async function pRc(t,e,r){let n=r.normalizedUri,o=e.targetDocumentUri,s=o!==void 0&&Fs(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(pRc,"resolveNextEditTarget");function hRc(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){Qa(t,o,"nesProvider.setDisposalReason")}}a(hRc,"trySetChatLibDisposalReason");var x4r=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new FQi.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(Ur).resolveSession();return A1t(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Qt).resetToken("nes",e)}},c3e=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 I4r.Readable?c=I4r.Readable.toWeb(s):c=s),new LQi.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},Mt(),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 tx(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 mRc="github.copilot.didAcceptNextEditSuggestionItem",w4r=class extends lR{constructor(){super(...arguments);this.name=mRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(Wv).handleAcceptance(n),!0}},gRc="github.copilot.didRejectNextEditSuggestionItem",R4r=class extends lR{constructor(){super(...arguments);this.name=gRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(Wv).handleRejection(n),!0}},ARc="github.copilot.didIgnoreNextEditSuggestionItem",k4r=class extends lR{constructor(){super(...arguments);this.name=ARc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(Wv).handleIgnored(n),!0}},UQi=[w4r,R4r,k4r];p();var D4r="github.copilot.didAcceptPanelCompletionItem",P4r=class extends lR{constructor(){super(...arguments);this.name=D4r;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(Ru).get(o);return c?(jNe(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:QH(c.displayText)},c.copilotAnnotations),!0):!1}},QQi=[P4r];var yRc=[...gni,...Ani,...UQi,...QQi];function qQi(t,e){let r=new Map;for(let n of yRc){let o=new n(t),s=qu.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=A9(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Ir).getEditorPluginInfo();await e.get(ri).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(ri).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,u3e.gt)((0,u3e.coerce)(r.version),(0,u3e.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(ri).delete("versions",r.name),(await e.get(ri).listKeys("versions")).length===0&&await e.get(ri).deleteSetting("versions")}};p();var VQi=de(nl()),WQi=require("crypto"),b1t=de(require("path")),gEe=de(Xc());var vRc={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},CRc=new gEe.ProgressType,SN=class t{constructor(e){this.ctx=e;this.#e=new Wi;this._changeHandlerLimiter=new VQi.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new gEe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(ar).connection}init(){this.ctx.get(bn).getCapabilities().watchedFiles&&this.connection.onNotification(gEe.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(bn).getCapabilities().watchedFiles)return vRc;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(bn).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=b1t.extname(l).toLowerCase();vQ.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=b1t.extname(s.uri).toLowerCase();if(!vQ.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(nc).enabled?this.getValidDocument(e):MS.create(e,"UNKNOWN",-1,"")}async getValidDocument(e){let n=await this.ctx.get(ii).getOrReadTextDocument({uri:e});return n.status==="valid"?n.document:void 0}async fetchWatchedFileEntries(e){let r=e.partialResultToken??(0,WQi.randomUUID)(),n=[],o=this.connection.onProgress(CRc,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=b1t.extname(l).toLowerCase();if(!vQ.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 bRc=new fe("mcpGateway.projectCleanup"),iie=class{constructor(e){this._dispose=e}static{a(this,"McpProjectCleanupSubscription")}dispose(){this._dispose()}};function zQi(t){let e=t.get($r),r=t.get(ey),n=e.onDidChangeWorkspaceFolders(o=>{if(o.removed.length!==0)for(let s of o.removed)r.removeProject(s.uri).catch(c=>{bRc.warn(t,"removeProject failed during workspace-folder cleanup",{workspaceFolder:s.uri,error:c instanceof Error?c.message:String(c)})})});return new iie(()=>n.dispose())}a(zQi,"installMcpProjectCleanup");p();p();p();p();p();var JQi=require("crypto");var SRc=new fe("CloudAgentLogParser"),TRc=new Set(["run_setup","run_custom_setup_step"]),S1t=class{constructor(){this.counter=0}static{a(this,"CloudAgentIdSource")}next(){return++this.counter}};function TN(t){if(t!=null)return typeof t=="string"?t:JSON.stringify(t)}a(TN,"asString");function IRc(t){return typeof t=="number"&&Number.isFinite(t)?new Date(t*1e3).toISOString():new Date().toISOString()}a(IRc,"chunkTimestamp");function AEe(t,e,r){return{id:(0,JQi.randomUUID)(),timestamp:r,parentId:null,type:t,data:e}}a(AEe,"event");function T1t(t,e,r){if(!e||e.trim().length===0)return[];let n=[];return RRc(t,e,o=>{let s=IRc(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"||TN(d.role)==="assistant"&&xRc(d,u,n,r,s)}}),n}a(T1t,"parseCloudAgentLogs");function xRc(t,e,r,n,o){let s=t.tool_calls,c=Array.isArray(s)&&s.length>0?s:void 0,l=TN(t.content),u=TN(e.finish_reason);if(u==="tool_calls"&&c){let m=c[0],g=m.function,A=TN(g?.name);if(A&&TRc.has(A)){if(l&&l.trim().length>0){let y=KQi(TN(g?.arguments)),E=TN(y?.name)??l,_=TN(m.id)??`setup-${E}`;ZQi(r,_,A,{name:E},E,o)}return}}let d=l?.trimStart(),f=d?.startsWith("")===!0,h=d&&!d.startsWith("")&&!d.startsWith("")?d.trim():"";if(c){h.length>0&&r.push(YQi(h,n,o));for(let m of c){let g=m,A=g.function,y=TN(A?.name);if(!y)continue;let E=KQi(TN(A?.arguments));wRc(r,g,y,l,E,n,o)}if(f){let m=(l??"").replace(/^\s*\s*/i,"").replace(/\s*<\/error>\s*$/i,"").trim(),g=`command-error-${n.next()}`;r.push(AEe("tool.execution_start",{toolCallId:g,toolName:"command",arguments:{}},o)),r.push(AEe("tool.execution_complete",{toolCallId:g,success:!1,error:{message:m.length>0?m:"Command failed"}},o))}return}h.length>0&&(u==="stop"?r.push(YQi(h,n,o)):r.push(XQi(h,n,o)))}a(xRc,"processAssistantDelta");function wRc(t,e,r,n,o,s,c){if(r==="reply_to_comment")return;let l=TN(e.id);if(!l)return;if(r==="think"){let d=TN(o?.thought)??n;d&&d.trim().length>0&&t.push(XQi(d,s,c));return}let u=n?.trim();ZQi(t,l,r,o,u&&u.length>0?u:void 0,c)}a(wRc,"appendToolPart");function ZQi(t,e,r,n,o,s){t.push(AEe("tool.execution_start",{toolCallId:e,toolName:r,arguments:n??{}},s)),t.push(AEe("tool.execution_complete",{toolCallId:e,success:!0,result:{content:o??""}},s))}a(ZQi,"pushToolCall");function YQi(t,e,r){return AEe("assistant.message",{messageId:`cloud-text-${e.next()}`,content:t},r)}a(YQi,"textEvent");function XQi(t,e,r){return AEe("assistant.reasoning",{reasoningId:`cloud-reasoning-${e.next()}`,content:t},r)}a(XQi,"reasoningEvent");function KQi(t){if(!(!t||t.trim().length===0))try{let e=JSON.parse(t);return e&&typeof e=="object"?e:void 0}catch{return}}a(KQi,"parseArguments");function RRc(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{SRc.debug(t,"parseCloudAgentLogs: skipping malformed SSE data chunk",{data:s});continue}c&&typeof c=="object"&&r(c)}}a(RRc,"forEachDataChunk");p();var I1t=require("crypto");var oie=new fe("CloudAgentSession"),sie="CloudAgentSession",eqi="cloud:",kRc="cloud.pull_request_card";function M4r(t,e){let r=e?new Date(e):null,n=r&&!isNaN(r.getTime())?r.toISOString():new Date().toISOString();return{id:(0,I1t.randomUUID)(),timestamp:n,parentId:null,type:kRc,data:{number:t.number,title:t.title?.trim()||`Pull request #${t.number}`,body:t.body?.trim()||null,htmlUrl:t.html_url??null}}}a(M4r,"buildCloudPullRequestCardEvent");function rqi(t){if(!t.startsWith(eqi))return;let e=t.slice(eqi.length),r=Number(e);return e.length>0&&Number.isInteger(r)&&r>0?r:void 0}a(rqi,"parseCloudPullRequestNumber");var DL={InProgress:"in_progress",Queued:"queued",Completed:"completed",Failed:"failed"},N4r=3e3,PRc=120*1e3,DRc=300*1e3,tqi=10,x1t=class{constructor(e,r,n,o){this.ctx=e;this.notificationSender=r;this.client=n;this._ids=new S1t;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}async startInitialJob(e){let n=this.resetCancellation().token;try{let{owner:o,name:s,baseRef:c}=await this.resolveRepo(n),l=hue(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(M4r(d)),oie.info(this.ctx,`${sie}.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||txe(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 Zh(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,I1t.randomUUID)(),interactionId:this.localSessionId})),n!==DL.InProgress){let s=await this.waitForInProgress(e,o);if(o.isCancellationRequested)return;switch(s?.state){case DL.InProgress:break;case DL.Failed:this.emitError(s.error?.message??"The cloud agent session failed.");return;case DL.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()+PRc;for(;!r.isCancellationRequested&&Date.now()=tqi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}if(!c){oie.warn(this.ctx,`${sie}.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(oie.warn(this.ctx,`${sie}.streamSessionLogs: log fetch failed; will retry`,{cloudSessionId:e,error:this.errorMessage(f)}),++s>=tqi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}s=0;let u=c.state,d=u!==DL.InProgress&&u!==DL.Queued;if(l.length>o){let f=l.slice(o);o=l.length;let h=T1t(this.ctx,f,this._ids);for(let m of h)this.emit(m)}if(d){u===DL.Failed?this.emitError(c.error?.message??"The cloud agent session failed."):this.emitIdle();return}}}async waitForNewSession(e,r,n){let o=Date.now()+DRc;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(N4r,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 _f(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 kO([new PO,new DO]).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=>{oie.warn(this.ctx,`${sie}.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,I1t.randomUUID)(),timestamp:new Date().toISOString(),parentId:null,type:e,data:r}}resetCancellation(){this.stop();let e=new Fn.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)}};var nqi=require("crypto");Oo();var E9=new fe("CloudAgent"),_9="CloudAgentService";function NRc(){return{id:"auto",name:"Auto",preview:!1,capabilities:{family:"auto",supports:{vision:!0},limits:{max_context_window_tokens:0}}}}a(NRc,"buildCloudAutoModel");var aie=class{constructor(e){this.ctx=e;this._sessions=new Map;this.notificationSender=e.get(ts),this.client=new HC(e)}static{a(this,"CloudAgentService")}async createSession(e){let r=e.sessionId??Mt(),n=await this.getOrCreateSession(r,e.workspaceFolder);return{sessionId:r,workspacePath:n.cwd}}async resumeSession(e){let{sessionId:r}=e,n=await this.getOrCreateSession(r,e.workspaceFolder);if(!n.pullRequest)return{sessionId:r,workspacePath:n.cwd,events:[]};let{events:o,streamStatus:s}=await this.loadSessionHistory(n.pullRequest,n.idSource);if(s&&(s.state==="in_progress"||s.state==="queued")){let{stream:c}=n.resumeStreaming(s);c.catch(l=>{E9.warn(this.ctx,`${_9}.resumeSession: stream failed`,{sessionId:r,error:l instanceof Error?l.message:String(l)})})}return E9.info(this.ctx,`${_9}.resumeSession`,{sessionId:r,pullRequestNumber:n.pullRequest.number,events:o.length}),{sessionId:r,workspacePath:n.cwd,events:o}}async sendMessage(e,r){let n=this._sessions.get(e.sessionId);if(!n)return Promise.reject(new Error(`Cannot start cloud session ${e.sessionId}: session was not created or resumed first.`));let o=Mt(),s=n.hasPullRequest,{stream:c}=s?await n.submitFollowUp(e.message):await n.startInitialJob(e.message);return c.catch(l=>{E9.warn(this.ctx,`${_9}.sendMessage: turn failed`,{sessionId:e.sessionId,isFollowUp:s,error:l instanceof Error?l.message:String(l)})}),{messageId:o}}stopSession(e){let r=this._sessions.get(e);return r?(r.stopByUser(),E9.info(this.ctx,`${_9}.stopSession`,{sessionId:e}),Promise.resolve()):(E9.warn(this.ctx,`${_9}.stopSession: unknown session`,{sessionId:e}),Promise.resolve())}destroySession(e){return Promise.reject(this.unsupported("destroySession"))}listSessions(e){return Promise.reject(this.unsupported("listSessions"))}listModels(e){return Promise.resolve({models:[NRc()]})}createCloudSession(e,r,n){return new x1t(this.ctx,this.notificationSender,this.client,{localSessionId:e,workspaceFolder:r,pullRequest:n})}async getOrCreateSession(e,r){let n=this._sessions.get(e);if(n)return n;let o=await this.resolvePullRequest(e,r),s=this.createCloudSession(e,r,o);return this._sessions.set(e,s),s}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)):E9.warn(this.ctx,`${_9}.loadSessionHistory: session has no prompt`,{cloudSessionId:u.id,pullRequestNumber:e.number}),l===0&&s.push(M4r(e,u.created_at)),l++;let f;try{f=await this.client.getSessionLogs(u.id)}catch(h){E9.warn(this.ctx,`${_9}.loadSessionHistory: log fetch failed`,{cloudSessionId:u.id,error:h instanceof Error?h.message:String(h)});continue}s.push(...T1t(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,nqi.randomUUID)(),timestamp:o,parentId:null,type:"user.message",data:{content:e}}}async resolvePullRequest(e,r){let n=rqi(e);if(n!==void 0)try{let o=await this.ctx.get(_f).getRepo({uri:r.uri});if(!o||!o.isGitHub()||!o.owner||!o.name){E9.warn(this.ctx,`${_9}.resolvePullRequest: workspace is not a GitHub repo`,{sessionId:e});return}return await new Zh(this.ctx).getPullRequest(o.owner,o.name,n)}catch(o){E9.warn(this.ctx,`${_9}.resolvePullRequest: failed`,{sessionId:e,error:o instanceof Error?o.message:String(o)});return}}unsupported(e){return new Error(`${e} is not supported by CloudAgentService`)}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}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 iqi=require("node:child_process"),oqi=require("node:events"),O4r=de(require("node:readline"));var TV=new fe("CodexProcessManager"),w1t=class extends oqi.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.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"]'];TV.debug(this.ctx,`start: cmd=${r} args=${JSON.stringify(n)} cwd=${this.cwd}`);try{this.process=(0,iqi.spawn)(r,n,{env:{...process.env,OPENAI_API_KEY:"copilot-proxy"},stdio:["pipe","pipe","pipe"],cwd:this.cwd||void 0}),TV.debug(this.ctx,`start: spawn succeeded, pid=${this.process.pid}`)}catch(o){let s=o instanceof Error?o.message:String(o);throw TV.error(this.ctx,`start: spawn failed: ${s}`),new Error(`Failed to spawn codex app-server: ${s}`)}this.process.on("error",o=>{TV.error(this.ctx,`process error event: ${o.message}`),this.handleProcessExit(-1)}),this.process.on("exit",o=>{TV.debug(this.ctx,`process exit event: code=${o}`),this.handleProcessExit(o??-1)}),this.process.stdout&&(this.rl=O4r.default.createInterface({input:this.process.stdout}),this.rl.on("line",o=>this.handleLine(o))),this.process.stderr&&O4r.default.createInterface({input:this.process.stderr}).on("line",s=>{TV.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)return;let o=JSON.stringify({jsonrpc:"2.0",method:r,params:n??{}});this.process.stdin.write(o+` -`)}onNotification(r){this.notificationHandlers.push(r)}isRunning(){return this.process!==void 0&&!this.process.killed}handleLine(r){if(r.trim())try{let n=JSON.parse(r);if(n.id!==void 0&&this.pendingRequests.has(n.id)){let o=this.pendingRequests.get(n.id);this.pendingRequests.delete(n.id),clearTimeout(o.timer),n.error?o.reject(new Error(JSON.stringify(n.error))):o.resolve(n.result)}else if(n.id!==void 0&&n.method)SV.info(this.ctx,`CodexProcessManager: \u2190 REQUEST ${n.method} (id=${n.id}) params=${JSON.stringify(n.params).slice(0,500)}`),this.handleServerRequest(n.id,n.method,n.params);else if(n.method)for(let o of this.notificationHandlers)o(n.method,n.params)}catch{}}handleServerRequest(r,n,o){SV.debug(this.ctx,`CodexProcessManager: server request ${n} (id=${r})`);let s;n.includes("applyPatch")?s={decision:"approved"}:s={decision:"accept"};let c=JSON.stringify({jsonrpc:"2.0",id:r,result:s});this.process?.stdin?.write(c+` -`);for(let l of this.notificationHandlers)l(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();var rqi=de(require("node:http")),nqi=require("node:stream/promises");var _9=new fe("CodexResponsesProxyServer"),wRc=16*1024*1024,w1t=class{constructor(e){this.ctx=e;this.port=0}static{a(this,"CodexResponsesProxyServer")}async start(){if(this.server)return this.port;let e=rqi.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,_9.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(_9.info(this.ctx,`handleRequest: ${e.method} ${e.url}`),e.method==="POST"&&e.url?.includes("/responses")){let n=await this.readBody(e);_9.info(this.ctx,`proxyToCapiResponses: forwarding ${n.length} bytes`),await this.proxyToCapiResponses(n,r),_9.info(this.ctx,"proxyToCapiResponses: completed")}else _9.debug(this.ctx,`CodexResponsesProxyServer: unhandled ${e.method} ${e.url}`),r.writeHead(404),r.end("{}")}catch(n){_9.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(tr),s;try{s=await n.getToken()}catch(h){_9.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=ile(this.ctx,s,"v1/responses"),l={...i0(this.ctx),"Content-Type":"application/json"},{headers:u}=await nle(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});ole(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();g?await(0,nqi.pipeline)(g,r):r.end()}catch(h){if(d.signal.aborted){_9.debug(this.ctx,"upstream fetch aborted by client disconnect"),r.writableEnded||r.end();return}if(_9.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>wRc){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 O4r=require("node:fs"),iqi=de(require("node:os")),R1t=de(require("node:path"));Mo();function RRc(){let t=process.env.CODEX_HOME;return t||R1t.join(iqi.homedir(),".codex")}a(RRc,"codexHome");async function oqi(t){let e=R1t.join(RRc(),"sessions");try{return await sqi(e,t)}catch{return null}}a(oqi,"findRolloutFile");async function sqi(t,e){let r;try{r=await O4r.promises.readdir(t,{withFileTypes:!0})}catch{return null}for(let n of r){let o=R1t.join(t,n.name);if(n.isDirectory()){let s=await sqi(o,e);if(s)return s}else if(n.isFile()&&n.name.endsWith(".jsonl")&&n.name.includes(e))return o}return null}a(sqi,"searchForRollout");async function aqi(t){let e;try{e=await O4r.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,eventMsgCompletionCallIds:kRc(n),sealedCallIds:new Set};for(let c of n){let l=PRc(c,s);l&&(Array.isArray(l)?o.push(...l):o.push(l))}return o}a(aqi,"readAndTranslateRollout");function kRc(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(kRc,"collectEventMsgCompletionCallIds");function PRc(t,e){switch(t.type){case"event_msg":return DRc(t.timestamp,t.payload,e);case"response_item":return NRc(t.timestamp,t.payload,e);case"turn_context":return null;default:return null}}a(PRc,"translateRolloutLine");function DRc(t,e,r){switch(e.type){case"task_started":return r.currentTurnId=e.turn_id||void 0,r.sessionStarted?null:(r.sessionStarted=!0,{id:Mt(),timestamp:t,type:"session.start",data:{producer:"codex",startTime:t}});case"user_message":{let o=e.message||"",{content:s,attachments:c}=jRc(o),l={content:s};return c.length>0&&(l.attachments=c),{id:Mt(),timestamp:t,type:"user.message",data:l}}case"agent_message":{let o=e.message||"",s=Mt(),c=r.currentTurnId||s;return[{id:Mt(),timestamp:t,type:"assistant.turn_start",data:{turnId:s,interactionId:c}},{id:s,timestamp:t,type:"assistant.message",data:{content:o,messageId:s}}]}case"token_count":{let s=e.info?.last_token_usage;return s?{id:Mt(),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:Mt(),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:Mt(),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:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:o,toolName:"web_search",arguments:{query:e.query,action:e.action}}},{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:!0}}])}default:return null}}a(DRc,"translateEventMsg");function NRc(t,e,r){switch(e.type){case"message":return null;case"reasoning":return MRc(t,e);case"function_call":return LRc(t,e,r);case"function_call_output":return BRc(t,e,r);case"custom_tool_call":return FRc(t,e,r);case"custom_tool_call_output":return URc(t,e,r);case"web_search_call":return null;default:return null}}a(NRc,"translateResponseItem");function MRc(t,e){let r=ORc(e);if(!r)return null;let n=e.id||Mt();return{id:Mt(),timestamp:t,type:"assistant.reasoning",data:{reasoningId:n,content:r}}}a(MRc,"translateReasoningItem");function ORc(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(ORc,"extractReasoningText");function LRc(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=QRc(e.arguments);return{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:c??{}}}}a(LRc,"translateFunctionCall");function BRc(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:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(BRc,"translateFunctionCallOutput");function FRc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let o=e.name||"unknown",s=o==="apply_patch"?"file_change":o;return{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:{input:e.input}}}}a(FRc,"translateCustomToolCall");function URc(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:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(URc,"translateCustomToolCallOutput");function QRc(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(QRc,"parseJsonSafe");var qRc=/^\[Referenced files:([^\]]*)\]\r?\n\r?\n/;function jRc(t){let e=qRc.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:HRc(n)}));return{content:t.slice(e[0].length),attachments:r}}a(jRc,"extractReferencedFiles");function HRc(t){let e=t.replace(/\\/g,"/"),r=e.lastIndexOf("/");return r===-1?e:e.slice(r+1)}a(HRc,"basename");p();Mo();function Fm(t,e,r){return{id:Mt(),timestamp:new Date().toISOString(),type:t,...e!==void 0?{data:e}:{},...r?{ephemeral:r}:{}}}a(Fm,"envelope");function AEe(){return{turnStreamCtx:new Map}}a(AEe,"createCodexTranslatorState");function cqi(t,e){let r=t.turnStreamCtx.get(e);return r||(r={agentMessageIds:[],reasoningIds:[]},t.turnStreamCtx.set(e,r)),r}a(cqi,"ctxFor");function lqi(t,e,r){switch(t){case"turn/started":return GRc(e);case"turn/completed":return $Rc(e,r);case"item/started":return VRc(e,r);case"item/completed":return WRc(e,r);case"thread/tokenUsage/updated":return zRc(e);case"item/agentMessage/delta":return KRc(e);case"item/reasoning/summaryTextDelta":return hkc(e,r);case"item/commandExecution/outputDelta":return tkc(e);default:return null}}a(lqi,"translateCodexNotification");function GRc(t){return null}a(GRc,"translateTurnStarted");function $Rc(t,e){let r=[];return r.push(Fm("assistant.usage",{model:"codex",duration:t.turn?.durationMs??void 0},!0)),r.push(Fm("session.idle",{},!0)),t.turn?.id&&e.turnStreamCtx.delete(t.turn.id),r}a($Rc,"translateTurnCompleted");function VRc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return YRc(e,t.turnId,r);case"commandExecution":return XRc(r);case"fileChange":return rkc(r);case"mcpToolCall":return ikc(r);case"webSearch":return akc(r);case"imageView":return lkc(r);case"dynamicToolCall":return dkc(r);case"reasoning":return pkc(e,t.turnId,r);default:return null}}a(VRc,"translateItemStarted");function WRc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return JRc(e,t.turnId,r);case"commandExecution":return ekc(r);case"fileChange":return nkc(r);case"mcpToolCall":return okc(r);case"webSearch":return ckc(r);case"imageView":return ukc(r);case"dynamicToolCall":return fkc(r);case"reasoning":return mkc(e,t.turnId,r);default:return null}}a(WRc,"translateItemCompleted");function zRc(t){let e=t.tokenUsage.last;return Fm("assistant.usage",{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheReadTokens:e.cachedInputTokens})}a(zRc,"translateTokenUsageUpdated");function YRc(t,e,r){return cqi(t,e).agentMessageIds.push(r.id),Fm("assistant.turn_start",{turnId:r.id,interactionId:e})}a(YRc,"translateAgentMessageItemStarted");function KRc(t){return Fm("assistant.message_delta",{messageId:t.itemId||t.turnId,deltaContent:t.delta},!0)}a(KRc,"translateAgentMessageDelta");function JRc(t,e,r){let n=r.text??"";if(n.length===0)return null;let o=t.turnStreamCtx.get(e)?.agentMessageIds.shift()??r.id;return Fm("assistant.message",{messageId:o,content:n})}a(JRc,"translateAgentMessageItemCompleted");function yEe(t){return t==="failed"||t==="cancelled"||t==="declined"}a(yEe,"isFailedStatus");var L4r=4096;function ZRc(t){return t.length<=L4r?t:`${t.slice(0,L4r)} -\u2026 [truncated ${t.length-L4r} chars]`}a(ZRc,"truncateForError");function XRc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"shell",arguments:{command:t.command,cwd:t.cwd,commandActions:t.commandActions}})}a(XRc,"translateCommandExecutionItemStarted");function ekc(t){let e=!yEe(t.status),r=t.aggregatedOutput??"";return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:r}:void 0,error:e?void 0:{message:r.length>0?ZRc(r):`Command ${t.status??"failed"} with exit code ${t.exitCode??"unknown"}`},durationMs:t.durationMs??void 0,exitCode:t.exitCode??void 0})}a(ekc,"translateCommandExecutionItemCompleted");function tkc(t){return null}a(tkc,"translateCommandExecutionOutputDelta");function rkc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"file_change",arguments:{changes:t.changes}})}a(rkc,"translateFileChangeItemStarted");function nkc(t){let e=!yEe(t.status);return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{changes:t.changes}:void 0,error:e?void 0:{message:`File change ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(nkc,"translateFileChangeItemCompleted");function ikc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:`mcp:${t.server}.${t.tool}`,arguments:t.arguments??{}})}a(ikc,"translateMcpToolCallItemStarted");function okc(t){let e=!yEe(t.status)&&!t.error;return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?skc(t.result):void 0,error:e?void 0:{message:t.error??`MCP tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(okc,"translateMcpToolCallItemCompleted");function skc(t){return t&&typeof t=="object"&&!Array.isArray(t)&&"content"in t?t:{content:t}}a(skc,"wrapMcpResult");function akc(t){return null}a(akc,"translateWebSearchItemStarted");function ckc(t){let e=!yEe(t.status),r=t.query?.trim()?t.query:t.action?.query??t.action?.queries?.join(", "),n=t.results!==void 0&&t.results!==null;return[Fm("tool.execution_start",{toolCallId:t.id,toolName:"web_search",arguments:{query:r,action:t.action}}),Fm("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(ckc,"translateWebSearchItemCompleted");function lkc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"view_image",arguments:{path:t.path}})}a(lkc,"translateImageViewItemStarted");function ukc(t){let e=!yEe(t.status);return Fm("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(ukc,"translateImageViewItemCompleted");function dkc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:t.tool,arguments:t.arguments??{}})}a(dkc,"translateDynamicToolCallItemStarted");function fkc(t){let e=t.success!==void 0?t.success:!yEe(t.status)&&!t.error;return Fm("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(fkc,"translateDynamicToolCallItemCompleted");function pkc(t,e,r){return cqi(t,e).reasoningIds.push(r.id),null}a(pkc,"translateReasoningItemStarted");function hkc(t,e){let r=e.turnStreamCtx.get(t.turnId)?.reasoningIds,n=r&&r.length>0?r[r.length-1]:void 0;return Fm("assistant.reasoning_delta",{reasoningId:t.itemId||t.reasoningId||n||`codex-reasoning:${t.turnId}`,deltaContent:t.delta},!0)}a(hkc,"translateReasoningDelta");function mkc(t,e,r){let n=t.turnStreamCtx.get(e)?.reasoningIds.shift()??r.id,o=gkc(r);return o?Fm("assistant.reasoning",{reasoningId:n,content:o}):null}a(mkc,"translateReasoningItemCompleted");function gkc(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(gkc,"extractReasoningText");Mo();var nA=new fe("CodexAgentService"),cie=class{constructor(e){this.ctx=e;this.initialized=!1;this.sessions=new Map;this.proxyServer=new w1t(e),this.notificationSender=e.get(ts),this.codexPath=this.resolveCodexPath()}static{a(this,"CodexAgentService")}resolveCodexPath(){let e=Ft(this.ctx,Ye.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();if(r.length>0){let n=new URL(r[0].uri);this.workspaceCwd=n.pathname.replace(/^\/([A-Za-z]:)/,"$1")}}catch{}let e=await this.proxyServer.start();this.processManager=new x1t(this.ctx,this.codexPath,e,this.workspaceCwd),this.processManager.onNotification((r,n)=>{this.handleNotification(r,n)}),this.processManager.on("error",r=>{nA.error(this.ctx,"Codex process died",{error:r.message}),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:{}}),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 kb(this.ctx,"codexAgent.createSession",async r=>{if(nA.info(this.ctx,"createSession",{clientSessionId:e.sessionId,model:e.model}),!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();let n=await this.processManager.sendRequest("thread/start"),o=n.thread.id,s=new Date().toISOString();return this.sessions.set(o,{sessionId:o,threadId:n.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:s,modifiedTime:s,translatorState:AEe()}),r.properties.sessionId=o,r.properties.modelId=e.model??"",{sessionId:o,workspacePath:e.workspaceFolder?.uri}})}async resumeSession(e){return kb(this.ctx,"codexAgent.resumeSession",async r=>{let n=e.sessionId;nA.info(this.ctx,"resumeSession",{threadId:n}),r.properties.sessionId=n;let o=this.sessions.get(n);if(o){r.properties.reason="inMemory";let c=await this.loadHistoricalEvents(n,r,e.model??o.model);return r.measurements.eventCount=c?.length??0,{sessionId:n,workspacePath:o.workspacePath,events:c}}if(!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();try{let c=await this.processManager.sendRequest("thread/resume",{threadId:n}),l=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:c.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:l,modifiedTime:l,summary:"(resumed)",translatorState:AEe()})}catch(c){let l=c instanceof Error?c.message:String(c);nA.warn(this.ctx,"resumeSession: thread/resume failed, creating fresh thread",{threadId:n,error:l});let u=await this.processManager.sendRequest("thread/start",{}),d=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:u.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:d,modifiedTime:d,summary:"(resumed - fresh)",translatorState:AEe()}),r.properties.freshThread="true"}let s=await this.loadHistoricalEvents(n,r,e.model);return r.measurements.eventCount=s?.length??0,{sessionId:n,workspacePath:e.workspaceFolder?.uri,events:s}})}async loadHistoricalEvents(e,r,n){try{let o=await oqi(e);if(!o){r.properties.rolloutMissing="true",nA.debug(this.ctx,"loadHistoricalEvents: rollout file not found",{threadId:e});return}let s=await aqi(o);if(!s){r.properties.rolloutReadFailed="true",nA.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",nA.warn(this.ctx,"loadHistoricalEvents: error reading rollout",{threadId:e,error:s});return}}async sendMessage(e,r){return kb(this.ctx,"codexAgent.sendMessage",async n=>{nA.info(this.ctx,"sendMessage",{sessionId:e.sessionId}),n.properties.sessionId=e.sessionId,n.properties.modelId=e.model??"",await this.ensureInitialized();let o=this.sessions.get(e.sessionId);if(!o){nA.info(this.ctx,"sendMessage: session not in memory, auto-recovering");try{let l=await this.processManager.sendRequest("thread/resume",{threadId:e.sessionId}),u=new Date().toISOString();o={sessionId:e.sessionId,threadId:l.thread.id,workspacePath:this.workspaceCwd,model:e.model,startTime:u,modifiedTime:u,translatorState:AEe()},this.sessions.set(e.sessionId,o)}catch(l){nA.warn(this.ctx,"sendMessage: thread/resume failed, creating fresh thread",{error:String(l)});let u=await this.processManager.sendRequest("thread/start",{}),d=new Date().toISOString();o={sessionId:e.sessionId,threadId:u.thread.id,workspacePath:this.workspaceCwd,model:e.model,startTime:d,modifiedTime:d,translatorState:AEe()},this.sessions.set(e.sessionId,o)}}let s=[];if(e.references?.length){let l=e.references.filter(u=>u.type==="file").map(u=>{try{return new URL(u.uri).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{return u.uri}});l.length>0&&s.push({type:"text",text:`[Referenced files: ${l.join(", ")}] +`)}onNotification(r){this.notificationHandlers.push(r)}isRunning(){return this.process!==void 0&&!this.process.killed}handleLine(r){if(r.trim())try{let n=JSON.parse(r);if(n.id!==void 0&&this.pendingRequests.has(n.id)){let o=this.pendingRequests.get(n.id);this.pendingRequests.delete(n.id),clearTimeout(o.timer),n.error?o.reject(new Error(JSON.stringify(n.error))):o.resolve(n.result)}else if(n.id!==void 0&&n.method)TV.info(this.ctx,`CodexProcessManager: \u2190 REQUEST ${n.method} (id=${n.id}) params=${JSON.stringify(n.params).slice(0,500)}`),this.handleServerRequest(n.id,n.method,n.params);else if(n.method)for(let o of this.notificationHandlers)o(n.method,n.params)}catch{}}handleServerRequest(r,n,o){TV.debug(this.ctx,`CodexProcessManager: server request ${n} (id=${r})`);let s;n.includes("applyPatch")?s={decision:"approved"}:s={decision:"accept"};let c=JSON.stringify({jsonrpc:"2.0",id:r,result:s});this.process?.stdin?.write(c+` +`);for(let l of this.notificationHandlers)l(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();var sqi=de(require("node:http")),aqi=require("node:stream/promises");var v9=new fe("CodexResponsesProxyServer"),MRc=16*1024*1024,R1t=class{constructor(e){this.ctx=e;this.port=0}static{a(this,"CodexResponsesProxyServer")}async start(){if(this.server)return this.port;let e=sqi.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,v9.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(v9.info(this.ctx,`handleRequest: ${e.method} ${e.url}`),e.method==="POST"&&e.url?.includes("/responses")){let n=await this.readBody(e);v9.info(this.ctx,`proxyToCapiResponses: forwarding ${n.length} bytes`),await this.proxyToCapiResponses(n,r),v9.info(this.ctx,"proxyToCapiResponses: completed")}else v9.debug(this.ctx,`CodexResponsesProxyServer: unhandled ${e.method} ${e.url}`),r.writeHead(404),r.end("{}")}catch(n){v9.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(nr),s;try{s=await n.getToken()}catch(h){v9.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=ile(this.ctx,s,"v1/responses"),l={...i0(this.ctx),"Content-Type":"application/json"},{headers:u}=await nle(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});ole(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();g?await(0,aqi.pipeline)(g,r):r.end()}catch(h){if(d.signal.aborted){v9.debug(this.ctx,"upstream fetch aborted by client disconnect"),r.writableEnded||r.end();return}if(v9.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>MRc){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 L4r=require("node:fs"),cqi=de(require("node:os")),k1t=de(require("node:path"));Oo();function ORc(){let t=process.env.CODEX_HOME;return t||k1t.join(cqi.homedir(),".codex")}a(ORc,"codexHome");async function lqi(t){let e=k1t.join(ORc(),"sessions");try{return await uqi(e,t)}catch{return null}}a(lqi,"findRolloutFile");async function uqi(t,e){let r;try{r=await L4r.promises.readdir(t,{withFileTypes:!0})}catch{return null}for(let n of r){let o=k1t.join(t,n.name);if(n.isDirectory()){let s=await uqi(o,e);if(s)return s}else if(n.isFile()&&n.name.endsWith(".jsonl")&&n.name.includes(e))return o}return null}a(uqi,"searchForRollout");async function dqi(t){let e;try{e=await L4r.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,eventMsgCompletionCallIds:LRc(n),sealedCallIds:new Set};for(let c of n){let l=BRc(c,s);l&&(Array.isArray(l)?o.push(...l):o.push(l))}return o}a(dqi,"readAndTranslateRollout");function LRc(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(LRc,"collectEventMsgCompletionCallIds");function BRc(t,e){switch(t.type){case"event_msg":return FRc(t.timestamp,t.payload,e);case"response_item":return URc(t.timestamp,t.payload,e);case"turn_context":return null;default:return null}}a(BRc,"translateRolloutLine");function FRc(t,e,r){switch(e.type){case"task_started":return r.currentTurnId=e.turn_id||void 0,r.sessionStarted?null:(r.sessionStarted=!0,{id:Mt(),timestamp:t,type:"session.start",data:{producer:"codex",startTime:t}});case"user_message":{let o=e.message||"",{content:s,attachments:c}=zRc(o),l={content:s};return c.length>0&&(l.attachments=c),{id:Mt(),timestamp:t,type:"user.message",data:l}}case"agent_message":{let o=e.message||"",s=Mt(),c=r.currentTurnId||s;return[{id:Mt(),timestamp:t,type:"assistant.turn_start",data:{turnId:s,interactionId:c}},{id:s,timestamp:t,type:"assistant.message",data:{content:o,messageId:s}}]}case"token_count":{let s=e.info?.last_token_usage;return s?{id:Mt(),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:Mt(),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:Mt(),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:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:o,toolName:"web_search",arguments:{query:e.query,action:e.action}}},{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:!0}}])}default:return null}}a(FRc,"translateEventMsg");function URc(t,e,r){switch(e.type){case"message":return null;case"reasoning":return QRc(t,e);case"function_call":return jRc(t,e,r);case"function_call_output":return HRc(t,e,r);case"custom_tool_call":return GRc(t,e,r);case"custom_tool_call_output":return $Rc(t,e,r);case"web_search_call":return null;default:return null}}a(URc,"translateResponseItem");function QRc(t,e){let r=qRc(e);if(!r)return null;let n=e.id||Mt();return{id:Mt(),timestamp:t,type:"assistant.reasoning",data:{reasoningId:n,content:r}}}a(QRc,"translateReasoningItem");function qRc(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(qRc,"extractReasoningText");function jRc(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=VRc(e.arguments);return{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:c??{}}}}a(jRc,"translateFunctionCall");function HRc(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:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(HRc,"translateFunctionCallOutput");function GRc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let o=e.name||"unknown",s=o==="apply_patch"?"file_change":o;return{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:{input:e.input}}}}a(GRc,"translateCustomToolCall");function $Rc(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:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a($Rc,"translateCustomToolCallOutput");function VRc(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(VRc,"parseJsonSafe");var WRc=/^\[Referenced files:([^\]]*)\]\r?\n\r?\n/;function zRc(t){let e=WRc.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:YRc(n)}));return{content:t.slice(e[0].length),attachments:r}}a(zRc,"extractReferencedFiles");function YRc(t){let e=t.replace(/\\/g,"/"),r=e.lastIndexOf("/");return r===-1?e:e.slice(r+1)}a(YRc,"basename");p();Oo();function Fm(t,e,r){return{id:Mt(),timestamp:new Date().toISOString(),type:t,...e!==void 0?{data:e}:{},...r?{ephemeral:r}:{}}}a(Fm,"envelope");function yEe(){return{turnStreamCtx:new Map}}a(yEe,"createCodexTranslatorState");function fqi(t,e){let r=t.turnStreamCtx.get(e);return r||(r={agentMessageIds:[],reasoningIds:[]},t.turnStreamCtx.set(e,r)),r}a(fqi,"ctxFor");function pqi(t,e,r){switch(t){case"turn/started":return KRc(e);case"turn/completed":return JRc(e,r);case"item/started":return ZRc(e,r);case"item/completed":return XRc(e,r);case"thread/tokenUsage/updated":return ekc(e);case"item/agentMessage/delta":return rkc(e);case"item/reasoning/summaryTextDelta":return _kc(e,r);case"item/commandExecution/outputDelta":return akc(e);default:return null}}a(pqi,"translateCodexNotification");function KRc(t){return null}a(KRc,"translateTurnStarted");function JRc(t,e){let r=[];return r.push(Fm("assistant.usage",{model:"codex",duration:t.turn?.durationMs??void 0},!0)),r.push(Fm("session.idle",{},!0)),t.turn?.id&&e.turnStreamCtx.delete(t.turn.id),r}a(JRc,"translateTurnCompleted");function ZRc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return tkc(e,t.turnId,r);case"commandExecution":return okc(r);case"fileChange":return ckc(r);case"mcpToolCall":return ukc(r);case"webSearch":return pkc(r);case"imageView":return mkc(r);case"dynamicToolCall":return Akc(r);case"reasoning":return Ekc(e,t.turnId,r);default:return null}}a(ZRc,"translateItemStarted");function XRc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return nkc(e,t.turnId,r);case"commandExecution":return skc(r);case"fileChange":return lkc(r);case"mcpToolCall":return dkc(r);case"webSearch":return hkc(r);case"imageView":return gkc(r);case"dynamicToolCall":return ykc(r);case"reasoning":return vkc(e,t.turnId,r);default:return null}}a(XRc,"translateItemCompleted");function ekc(t){let e=t.tokenUsage.last;return Fm("assistant.usage",{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheReadTokens:e.cachedInputTokens})}a(ekc,"translateTokenUsageUpdated");function tkc(t,e,r){return fqi(t,e).agentMessageIds.push(r.id),Fm("assistant.turn_start",{turnId:r.id,interactionId:e})}a(tkc,"translateAgentMessageItemStarted");function rkc(t){return Fm("assistant.message_delta",{messageId:t.itemId||t.turnId,deltaContent:t.delta},!0)}a(rkc,"translateAgentMessageDelta");function nkc(t,e,r){let n=r.text??"";if(n.length===0)return null;let o=t.turnStreamCtx.get(e)?.agentMessageIds.shift()??r.id;return Fm("assistant.message",{messageId:o,content:n})}a(nkc,"translateAgentMessageItemCompleted");function EEe(t){return t==="failed"||t==="cancelled"||t==="declined"}a(EEe,"isFailedStatus");var B4r=4096;function ikc(t){return t.length<=B4r?t:`${t.slice(0,B4r)} +\u2026 [truncated ${t.length-B4r} chars]`}a(ikc,"truncateForError");function okc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"shell",arguments:{command:t.command,cwd:t.cwd,commandActions:t.commandActions}})}a(okc,"translateCommandExecutionItemStarted");function skc(t){let e=!EEe(t.status),r=t.aggregatedOutput??"";return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:r}:void 0,error:e?void 0:{message:r.length>0?ikc(r):`Command ${t.status??"failed"} with exit code ${t.exitCode??"unknown"}`},durationMs:t.durationMs??void 0,exitCode:t.exitCode??void 0})}a(skc,"translateCommandExecutionItemCompleted");function akc(t){return null}a(akc,"translateCommandExecutionOutputDelta");function ckc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"file_change",arguments:{changes:t.changes}})}a(ckc,"translateFileChangeItemStarted");function lkc(t){let e=!EEe(t.status);return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{changes:t.changes}:void 0,error:e?void 0:{message:`File change ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(lkc,"translateFileChangeItemCompleted");function ukc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:`mcp:${t.server}.${t.tool}`,arguments:t.arguments??{}})}a(ukc,"translateMcpToolCallItemStarted");function dkc(t){let e=!EEe(t.status)&&!t.error;return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?fkc(t.result):void 0,error:e?void 0:{message:t.error??`MCP tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(dkc,"translateMcpToolCallItemCompleted");function fkc(t){return t&&typeof t=="object"&&!Array.isArray(t)&&"content"in t?t:{content:t}}a(fkc,"wrapMcpResult");function pkc(t){return null}a(pkc,"translateWebSearchItemStarted");function hkc(t){let e=!EEe(t.status),r=t.query?.trim()?t.query:t.action?.query??t.action?.queries?.join(", "),n=t.results!==void 0&&t.results!==null;return[Fm("tool.execution_start",{toolCallId:t.id,toolName:"web_search",arguments:{query:r,action:t.action}}),Fm("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(hkc,"translateWebSearchItemCompleted");function mkc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"view_image",arguments:{path:t.path}})}a(mkc,"translateImageViewItemStarted");function gkc(t){let e=!EEe(t.status);return Fm("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(gkc,"translateImageViewItemCompleted");function Akc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:t.tool,arguments:t.arguments??{}})}a(Akc,"translateDynamicToolCallItemStarted");function ykc(t){let e=t.success!==void 0?t.success:!EEe(t.status)&&!t.error;return Fm("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(ykc,"translateDynamicToolCallItemCompleted");function Ekc(t,e,r){return fqi(t,e).reasoningIds.push(r.id),null}a(Ekc,"translateReasoningItemStarted");function _kc(t,e){let r=e.turnStreamCtx.get(t.turnId)?.reasoningIds,n=r&&r.length>0?r[r.length-1]:void 0;return Fm("assistant.reasoning_delta",{reasoningId:t.itemId||t.reasoningId||n||`codex-reasoning:${t.turnId}`,deltaContent:t.delta},!0)}a(_kc,"translateReasoningDelta");function vkc(t,e,r){let n=t.turnStreamCtx.get(e)?.reasoningIds.shift()??r.id,o=Ckc(r);return o?Fm("assistant.reasoning",{reasoningId:n,content:o}):null}a(vkc,"translateReasoningItemCompleted");function Ckc(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(Ckc,"extractReasoningText");Oo();var nA=new fe("CodexAgentService"),cie=class{constructor(e){this.ctx=e;this.initialized=!1;this.sessions=new Map;this.proxyServer=new R1t(e),this.notificationSender=e.get(ts),this.codexPath=this.resolveCodexPath()}static{a(this,"CodexAgentService")}resolveCodexPath(){let e=Ft(this.ctx,Ye.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();if(r.length>0){let n=new URL(r[0].uri);this.workspaceCwd=n.pathname.replace(/^\/([A-Za-z]:)/,"$1")}}catch{}let e=await this.proxyServer.start();this.processManager=new w1t(this.ctx,this.codexPath,e,this.workspaceCwd),this.processManager.onNotification((r,n)=>{this.handleNotification(r,n)}),this.processManager.on("error",r=>{nA.error(this.ctx,"Codex process died",{error:r.message}),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:{}}),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 kb(this.ctx,"codexAgent.createSession",async r=>{if(nA.info(this.ctx,"createSession",{clientSessionId:e.sessionId,model:e.model}),!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();let n=await this.processManager.sendRequest("thread/start"),o=n.thread.id,s=new Date().toISOString();return this.sessions.set(o,{sessionId:o,threadId:n.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:s,modifiedTime:s,translatorState:yEe()}),r.properties.sessionId=o,r.properties.modelId=e.model??"",{sessionId:o,workspacePath:e.workspaceFolder?.uri}})}async resumeSession(e){return kb(this.ctx,"codexAgent.resumeSession",async r=>{let n=e.sessionId;nA.info(this.ctx,"resumeSession",{threadId:n}),r.properties.sessionId=n;let o=this.sessions.get(n);if(o){r.properties.reason="inMemory";let c=await this.loadHistoricalEvents(n,r,e.model??o.model);return r.measurements.eventCount=c?.length??0,{sessionId:n,workspacePath:o.workspacePath,events:c}}if(!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();try{let c=await this.processManager.sendRequest("thread/resume",{threadId:n}),l=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:c.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:l,modifiedTime:l,summary:"(resumed)",translatorState:yEe()})}catch(c){let l=c instanceof Error?c.message:String(c);nA.warn(this.ctx,"resumeSession: thread/resume failed, creating fresh thread",{threadId:n,error:l});let u=await this.processManager.sendRequest("thread/start",{}),d=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:u.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:d,modifiedTime:d,summary:"(resumed - fresh)",translatorState:yEe()}),r.properties.freshThread="true"}let s=await this.loadHistoricalEvents(n,r,e.model);return r.measurements.eventCount=s?.length??0,{sessionId:n,workspacePath:e.workspaceFolder?.uri,events:s}})}async loadHistoricalEvents(e,r,n){try{let o=await lqi(e);if(!o){r.properties.rolloutMissing="true",nA.debug(this.ctx,"loadHistoricalEvents: rollout file not found",{threadId:e});return}let s=await dqi(o);if(!s){r.properties.rolloutReadFailed="true",nA.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",nA.warn(this.ctx,"loadHistoricalEvents: error reading rollout",{threadId:e,error:s});return}}async sendMessage(e,r){return kb(this.ctx,"codexAgent.sendMessage",async n=>{nA.info(this.ctx,"sendMessage",{sessionId:e.sessionId}),n.properties.sessionId=e.sessionId,n.properties.modelId=e.model??"",await this.ensureInitialized();let o=this.sessions.get(e.sessionId);if(!o){nA.info(this.ctx,"sendMessage: session not in memory, auto-recovering");try{let u=await this.processManager.sendRequest("thread/resume",{threadId:e.sessionId}),d=new Date().toISOString();o={sessionId:e.sessionId,threadId:u.thread.id,workspacePath:this.workspaceCwd,model:e.model,startTime:d,modifiedTime:d,translatorState:yEe()},this.sessions.set(e.sessionId,o)}catch(u){nA.warn(this.ctx,"sendMessage: thread/resume failed, creating fresh thread",{error:String(u)});let d=await this.processManager.sendRequest("thread/start",{}),f=new Date().toISOString();o={sessionId:e.sessionId,threadId:d.thread.id,workspacePath:this.workspaceCwd,model:e.model,startTime:f,modifiedTime:f,translatorState:yEe()},this.sessions.set(e.sessionId,o)}}let s=[];if(e.references?.length){let u=e.references.filter(d=>d.type==="file").map(d=>{try{return new URL(d.uri).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{return d.uri}});u.length>0&&s.push({type:"text",text:`[Referenced files: ${u.join(", ")}] -`})}s.push({type:"text",text:e.message});let c=await this.processManager.sendRequest("turn/start",{threadId:o.threadId,input:s});return o.turnId=c.turnId,e.model&&(o.model=e.model),o.modifiedTime=new Date().toISOString(),o.summary||(o.summary=e.message.slice(0,100)),n.measurements.messageCharLen=e.message.length,{messageId:c.turnId}})}truncateHistory(e){return Promise.reject(new Error("truncateHistory is not supported for Codex sessions"))}async stopSession(e){let r=this.sessions.get(e);!r||!r.turnId||(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),nA.info(this.ctx,"CodexAgentService.stopSession",{sessionId:e}))}destroySession(e){return this.sessions.delete(e.sessionId),nA.info(this.ctx,"CodexAgentService.destroySession",{sessionId:e.sessionId}),Promise.resolve({success:!0})}listSessions(e){let r=Array.from(this.sessions.values()).map(n=>{let o;if(n.workspacePath)try{o=new URL(n.workspacePath).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{o=n.workspacePath}return{sessionId:n.sessionId,startTime:n.startTime,modifiedTime:n.modifiedTime,summary:n.summary,isRemote:!1,context:o?{cwd:o}:void 0}});return r.sort((n,o)=>o.modifiedTime.localeCompare(n.modifiedTime)),nA.info(this.ctx,`CodexAgentService.listSessions: ${r.length} sessions`),Promise.resolve({sessions:r})}async listModels(e){try{let o=(await this.ctx.get(xs).getMetadata(e)).filter(s=>s.supported_endpoints?.includes(x$e.Responses)&&s.model_picker_enabled&&s.capabilities.type==="chat");if(o.length>0){let s=o.map((c,l)=>({id:c.id,name:c.name,vendor:c.vendor,preview:c.preview??!1,isDefault:c.is_chat_default??l===0,modelPickerEnabled:c.model_picker_enabled,modelPickerCategory:c.model_picker_category,modelPickerPriceCategory:c.model_picker_price_category,capabilities:{family:c.capabilities.family,supports:{vision:c.capabilities.supports?.vision??!1,reasoningEfforts:c.capabilities.supports?.reasoning_effort},limits:c.capabilities.limits?{max_context_window_tokens:c.capabilities.limits.max_context_window_tokens,max_output_tokens:c.capabilities.limits.max_output_tokens}:{max_context_window_tokens:128e3}},billing:c.billing?{isPremium:c.billing.is_premium??!0,multiplier:c.billing.multiplier??0}:void 0,policy:c.policy}));return nA.info(this.ctx,`CodexAgentService.listModels: ${s.length} responses-capable models from CAPI`),{models:s}}nA.warn(this.ctx,"CodexAgentService.listModels: no responses-capable models found in CAPI")}catch(r){let n=r instanceof Error?r.message:String(r);nA.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){return Promise.reject(new Error("Codex interaction handling not yet implemented"))}getPlanPath(e){return Promise.resolve(null)}async enableRemote(e){await this.ensureInitialized();try{return await this.processManager.sendRequest("remoteControl/enable",{}),{remoteSteerable:!0}}catch{throw new Error("Codex remote control not available")}}async disableRemote(e){await this.ensureInitialized(),await this.processManager.sendRequest("remoteControl/disable",{})}getRemoteStatus(e){return{remoteSteerable:!1}}async compactHistory(e){await this.ensureInitialized();let r=this.sessions.get(e);return r?(await this.processManager.sendRequest("thread/compact/start",{threadId:r.threadId}),{success:!0,tokensRemoved:0,messagesRemoved:0,summaryContent:""}):{success:!1,tokensRemoved:0,messagesRemoved:0,summaryContent:""}}async stopCompactHistory(e){let r=this.sessions.get(e);return!r||!r.turnId?{aborted:!1}:(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),{aborted:!0})}handleNotification(e,r){nA.info(this.ctx,`handleNotification: method=${e}`,{params:JSON.stringify(r).slice(0,500)});let o=r?.threadId;if(!o){nA.warn(this.ctx,`handleNotification: no threadId in params for method=${e}`);return}let s=this.findSessionByThreadId(o);if(!s)return;if(e==="turn/started"){let u=r;u.turn?.id&&(s.turnId=u.turn.id)}let c=lqi(e,r,s.translatorState);if(!c)return;let l=Array.isArray(c)?c:[c];for(let u of l)u.type==="assistant.usage"&&u.data&&s.model&&(u.data.model=s.model),this.notificationSender.sendBackgroundAgentSessionUpdate(s.sessionId,u,"CODEX")}findSessionByThreadId(e){for(let r of this.sessions.values())if(r.threadId===e)return r}emitErrorToAllSessions(e){for(let r of this.sessions.values()){let n={id:Mt(),timestamp:new Date().toISOString(),type:"session.error",data:{errorType:"process_crash",message:`Codex process terminated unexpectedly: ${e}. Send a new message to retry.`}};this.notificationSender.sendBackgroundAgentSessionUpdate(r.sessionId,n,"CODEX");let o={id:Mt(),timestamp:new Date().toISOString(),type:"session.idle"};this.notificationSender.sendBackgroundAgentSessionUpdate(r.sessionId,o,"CODEX")}}async dispose(){await this.processManager?.stop(),await this.proxyServer.stop()}};var uqi=new fe("AgentRouter"),dqi="AgentRouter";function AI(t){return t.agentProvider??"BACKGROUND"}a(AI,"resolveProvider");var fc=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Hs);case"CLAUDE":return this.ctx.get(y8);case"CODEX":return this.ctx.get(cie);case"CLOUD":return this.ctx.get(aie)}}logDispatch(e,r){uqi.debug(this.ctx,`${dqi}.${e}`,r)}create(e){this.logDispatch("create",e);let r=AI(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=AI(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=AI(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})}stop(e){this.logDispatch("stop",e);let r=AI(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=AI(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=AI(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=AI(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=AI(e);return this.serviceFor(r).handleInteraction(e)}async getPlanPath(e){this.logDispatch("getPlanPath",e);let r=AI(e);return{path:await this.serviceFor(r).getPlanPath(e.sessionId)}}enableRemote(e){this.logDispatch("enableRemote",e);let r=AI(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=AI(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=AI(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=AI(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{uqi.info(this.ctx,`${dqi}.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 Akc=S.Union([S.String(),S.Number()]),wi=S.String(),EEe=S.Optional(S.String()),ykc=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),parameters:S.Optional(S.Record(S.String(),S.Unknown())),overridesBuiltInTool:S.Optional(S.Boolean()),skipPermission:S.Optional(S.Boolean())}),B4r=S.Array(ykc),l3e=S.Union([S.Literal("default"),S.Literal("long_context")]),_Ee=S.Object({model:S.Optional(S.String()),reasoningEffort:EEe,workspaceFolder:S.Object({uri:S.String(),name:S.Optional(S.String())}),globalAgentsMdInstructions:S.Optional(S.String()),globalClaudeMdInstructions:S.Optional(S.String()),externalToolDefinitions:S.Optional(B4r),useAgentsMdFile:S.Optional(S.Boolean()),useNestedAgentsMdFiles:S.Optional(S.Boolean()),useClaudeMdFile:S.Optional(S.Boolean()),useNestedClaudeMdFiles:S.Optional(S.Boolean()),inlineConfinedFile:S.Optional(S.String()),mcpDirectory:S.Optional(S.String())});async function _i(t){try{return[await t(),null]}catch(e){let r=Mrt(e),n=e instanceof UJ?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(_i,"withServiceErrorHandling");var fqi=new fe("BackgroundAgent.compactHistory"),Ekc=S.Object({sessionId:wi});async function F4r(t,e,r){fqi.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Hs),o=e.onCancellationRequested(()=>{fqi.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await _i(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(F4r,"handleBackgroundAgentCompactHistoryChecked");var Eth=Oe(Ekc,F4r);p();var U4r=S.Union(Object.values(Ap).map(t=>S.Literal(t))),Fl=S.Optional(U4r),k1t=S.Intersect([_Ee,S.Object({agentProvider:Fl})]);var pqi=new fe("BackgroundAgent.compactHistory"),_kc=S.Object({sessionId:wi,agentProvider:Fl});async function vkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return F4r(t,e,r);pqi.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.compactHistory(s,e);return pqi.info(t,"compactHistory succeeded"),c})}a(vkc,"handleAgentCompactHistoryChecked");var hqi=Oe(_kc,vkc);p();p();var mqi=new fe("BackgroundAgent.create"),Ckc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),_Ee]);async function Q4r(t,e,r){mqi.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Hs),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 _i(async()=>{let s=await n.createSession(o);return mqi.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(Q4r,"handleBackgroundAgentCreateChecked");var Wth=Oe(Ckc,Q4r);var gqi=new fe("BackgroundAgent.create"),bkc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),k1t]);async function Skc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return Q4r(t,e,r);gqi.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.create(s);return gqi.info(t,"create succeeded:",c.sessionId),c})}a(Skc,"handleAgentCreateChecked");var Aqi=Oe(bkc,Skc);p();p();var Tkc=S.Object({sessionId:wi});async function q4r(t,e,r){let n=t.get(Hs);return _i(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(q4r,"handleBackgroundAgentDestroyChecked");var prh=Oe(Tkc,q4r);var Ikc=new fe("BackgroundAgent.destroy"),xkc=S.Object({sessionId:wi,agentProvider:Fl});async function wkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return q4r(t,e,r);Ikc.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.destroy(s))}a(wkc,"handleAgentDestroyChecked");var yqi=Oe(xkc,wkc);p();p();var Rkc=new fe("BackgroundAgent.disableRemote"),kkc=S.Object({sessionId:wi});async function j4r(t,e,r){Rkc.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(j4r,"handleBackgroundAgentDisableRemoteChecked");var Mrh=Oe(kkc,j4r);var Eqi=new fe("BackgroundAgent.disableRemote"),Pkc=S.Object({sessionId:wi,agentProvider:Fl});async function Dkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return j4r(t,e,r);Eqi.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.disableRemote(s);return Eqi.info(t,"disableRemote succeeded"),c})}a(Dkc,"handleAgentDisableRemoteChecked");var _qi=Oe(Pkc,Dkc);p();p();var Nkc=new fe("BackgroundAgent.enableRemote"),Mkc=S.Object({sessionId:wi});async function H4r(t,e,r){Nkc.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>n.enableRemote(r.sessionId))}a(H4r,"handleBackgroundAgentEnableRemoteChecked");var tnh=Oe(Mkc,H4r);var vqi=new fe("BackgroundAgent.enableRemote"),Okc=S.Object({sessionId:wi,agentProvider:Fl});async function Lkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return H4r(t,e,r);vqi.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.enableRemote(s);return vqi.info(t,"enableRemote succeeded"),c})}a(Lkc,"handleAgentEnableRemoteChecked");var Cqi=Oe(Okc,Lkc);p();p();var Bkc=S.Object({sessionId:wi});async function G4r(t,e,r){let n=t.get(Hs);return _i(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(G4r,"handleBackgroundAgentGetPlanPathChecked");var vnh=Oe(Bkc,G4r);var Fkc=new fe("BackgroundAgent.getPlanPath"),Ukc=S.Object({sessionId:wi,agentProvider:Fl});async function Qkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return G4r(t,e,r);Fkc.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.getPlanPath(s))}a(Qkc,"handleAgentGetPlanPathChecked");var bqi=Oe(Ukc,Qkc);p();p();var qkc=new fe("BackgroundAgent.getRemoteStatus"),jkc=S.Object({sessionId:wi});async function $4r(t,e,r){qkc.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a($4r,"handleBackgroundAgentGetRemoteStatusChecked");var jnh=Oe(jkc,$4r);var Hkc=new fe("BackgroundAgent.getRemoteStatus"),Gkc=S.Object({sessionId:wi,agentProvider:Fl});async function $kc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return $4r(t,e,r);Hkc.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.getRemoteStatus(s))}a($kc,"handleAgentGetRemoteStatusChecked");var Sqi=Oe(Gkc,$kc);p();p();var Vkc=new fe("BackgroundAgent.interaction"),Wkc=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),zkc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),Ykc=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),Kkc=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),Jkc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),Zkc=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),Xkc=S.Union([S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("permission"),result:Wkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("user_input"),response:zkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("elicitation"),response:Ykc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:Kkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("queued_command"),result:Jkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("external_tool"),result:Zkc})]);async function V4r(t,e,r){Vkc.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Hs);return _i(async()=>await n.handleInteraction(r))}a(V4r,"handleBackgroundAgentInteractionChecked");var lih=Oe(Xkc,V4r);var Tqi=new fe("BackgroundAgent.interaction"),ePc=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),tPc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),rPc=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),nPc=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),iPc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),oPc=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),sPc=S.Union([S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("permission"),result:ePc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("user_input"),response:tPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("elicitation"),response:rPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:nPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("queued_command"),result:iPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("external_tool"),result:oPc,agentProvider:Fl})]);async function aPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return V4r(t,e,r);Tqi.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.interaction(s);return Tqi.info(t,"interaction succeeded"),c})}a(aPc,"handleAgentInteractionChecked");var Iqi=Oe(sPc,aPc);p();p();var xqi=new fe("BackgroundAgent.listSessions"),cPc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String())});async function W4r(t,e,r){xqi.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Hs);return _i(async()=>{let o=await n.listSessions(r);return xqi.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(W4r,"handleBackgroundAgentSessionsListChecked");var Pih=Oe(cPc,W4r);var wqi=new fe("BackgroundAgent.listSessions"),lPc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String()),agentProvider:Fl});async function uPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return W4r(t,e,r);wqi.info(t,"handleAgentSessionsList called",r);let o=t.get(fc),s=r;return _i(async()=>{let c=await o.listSessions(s);return wqi.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(uPc,"handleAgentSessionsListChecked");var Rqi=Oe(lPc,uPc);p();p();var kqi=new fe("BackgroundAgent.listModels"),dPc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function z4r(t,e,r){kqi.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Hs);return _i(async()=>{let o=await n.listModels(r.forceRefresh);return kqi.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(z4r,"handleBackgroundAgentListModelsChecked");var Xih=Oe(dPc,z4r);var Pqi=new fe("BackgroundAgent.listModels"),fPc=S.Object({forceRefresh:S.Optional(S.Boolean()),agentProvider:Fl});async function pPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return z4r(t,e,r);Pqi.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.listModels(s);return Pqi.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(pPc,"handleAgentListModelsChecked");var Dqi=Oe(fPc,pPc);p();p();var Nqi=new fe("BackgroundAgent.resume"),hPc=S.Intersect([S.Object({sessionId:wi}),_Ee]);async function Y4r(t,e,r){Nqi.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Hs),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 _i(async()=>{let s=await n.resumeSession(o);return Nqi.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(Y4r,"handleBackgroundAgentResumeChecked");var _oh=Oe(hPc,Y4r);var Mqi=new fe("BackgroundAgent.resume"),mPc=S.Intersect([S.Object({sessionId:wi}),k1t]);async function gPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return Y4r(t,e,r);Mqi.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.resume(s);return Mqi.info(t,"resume succeeded:",c.sessionId),c})}a(gPc,"handleAgentResumeChecked");var Oqi=Oe(mPc,gPc);p();p();var APc=S.String(),P1t=["interactive","plan","autopilot"],yPc=S.Union(P1t.map(t=>S.Literal(t))),EPc=S.String({minLength:1}),_Pc=S.Object({sessionId:wi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(APc),reasoningEffort:EEe,references:S.Optional(S.Array(OO)),agentMode:S.Optional(yPc),chatMode:S.Optional(EPc),contextTier:S.Optional(l3e),sendMode:S.Optional(S.Union([S.Literal("enqueue"),S.Literal("immediate")]))});async function K4r(t,e,r){let n=t.get(Hs),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 _i(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(K4r,"handleBackgroundAgentSendChecked");var joh=Oe(_Pc,K4r);var Lqi=new fe("BackgroundAgent.send"),vPc=S.String(),CPc=S.String(),bPc=S.String({minLength:1}),SPc=S.Object({sessionId:wi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(vPc),reasoningEffort:EEe,references:S.Optional(S.Array(OO)),agentMode:S.Optional(CPc),chatMode:S.Optional(bPc),contextTier:S.Optional(l3e),agentProvider:Fl});async function TPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return r.agentMode!==void 0&&!P1t.includes(r.agentMode)?[null,{code:Ze.InvalidParams,message:`Unknown agentMode for Background provider: ${JSON.stringify(r.agentMode)}. Expected one of ${P1t.join(", ")}.`}]:K4r(t,e,{...r,agentMode:r.agentMode});Lqi.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.send(s,e);return Lqi.info(t,"resume succeeded:",c.messageId),c})}a(TPc,"handleAgentSendChecked");var Bqi=Oe(SPc,TPc);p();p();var IPc=new fe("BackgroundAgent.stop"),xPc=S.Object({sessionId:wi});async function J4r(t,e,r){IPc.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(J4r,"handleBackgroundAgentStopChecked");var dsh=Oe(xPc,J4r);var wPc=new fe("BackgroundAgent.stop"),RPc=S.Object({sessionId:wi,agentProvider:Fl});async function kPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await J4r(t,e,r);return c?[null,c]:[void 0,null]}wPc.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.stop(s))}a(kPc,"handleAgentStopChecked");var Fqi=Oe(RPc,kPc);p();var PPc=S.Object({sessionId:wi,eventId:S.String(),agentProvider:U4r});async function DPc(t,e,r){let n=t.get(fc),o={sessionId:r.sessionId,eventId:r.eventId,providerName:r.agentProvider};return _i(async()=>n.truncateHistory(o))}a(DPc,"handleAgentTruncateHistoryChecked");var Uqi=Oe(PPc,DPc);p();var NPc=S.Object({});async function MPc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Ur).listAvailableTokens()},null]}a(MPc,"handleListAvailableTokensChecked");var Qqi=Oe(NPc,MPc);p();var OPc=S.Object({tokenId:S.Number()});async function LPc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Ur).useExistingToken(r.tokenId),null]}a(LPc,"handleUseExistingTokenChecked");var qqi=Oe(OPc,LPc);p();var BPc=S.Object({providerName:S.String()});async function FPc(t,e,r){try{let{providerName:n}=r,o=pO(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 da(t.get(Yn));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(FPc,"handleBYOKDeleteApiKeyChecked");var jqi=Oe(BPc,FPc);p();var UPc=S.Object({providerName:S.String(),modelId:S.String()});async function QPc(t,e,r){try{let n=new da(t.get(Yn)),{providerName:o,modelId:s}=r,c=pO(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(QPc,"handleBYOKDeleteModelChecked");var Hqi=Oe(UPc,QPc);p();var qPc=S.Object({providerName:S.Optional(S.String()),modelId:S.Optional(S.String())}),Gqi="-api-key";async function jPc(t,e){let r=await e.listKeys("byok"),n=new Set(await t.listCustomProviderNames()),o=new Set(Object.keys(await t.getStoredModelConfigs(io.Azure))),s=new Set(Object.values(io).filter(u=>u!==io.Azure)),c=`${io.Azure}-`,l=[];for(let u of r){if(!u.endsWith(Gqi))continue;let d=await e.read("byok",u);if(!d)continue;let f=u.slice(0,-Gqi.length),h=f.startsWith(c)?f.slice(c.length):void 0;if(h!==void 0&&o.has(h)&&!n.has(f)){l.push({providerName:io.Azure,modelId:h,apiKey:d});continue}(s.has(f)||n.has(f))&&l.push({providerName:f,apiKey:d})}return l}a(jPc,"listAllApiKeys");async function HPc(t,e,r){try{let n=new da(t.get(Yn)),{providerName:o,modelId:s}=r;return o?[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]:[{apiKeys:await jPc(n,t.get(Yn))},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(HPc,"handleBYOKListApiKeysChecked");var $qi=Oe(qPc,HPc);p();var GPc=S.Object({providerName:S.Optional(S.String())});async function $Pc(t,e,r){try{let n=new da(t.get(Yn)),o=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($Pc,"handleBYOKListCustomProviderConfigsChecked");var Vqi=Oe(GPc,$Pc);p();p();p();qLr();var USt=class extends Zx{static{a(this,"AnthropicProvider")}constructor(e){super(io.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new da(this.ctx.get(Yn)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new BL({apiKey:e,fetch:zDc(this.ctx.get(tr))});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 rxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function zDc(t){return async(e,r)=>{let n=YDc(e,r),o=JDc(r),s=await t.fetch(n,o);return XDc(s)}}a(zDc,"createAnthropicFetchAdapter");function YDc(t,e){return t instanceof Request?(KDc(t,e),t.url):t instanceof URL?t.toString():t}a(YDc,"convertInputToString");function KDc(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(KDc,"mergeRequestInit");function JDc(t){let e;return t?.headers&&(e=ZDc(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(JDc,"convertToFetchOptions");function ZDc(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(ZDc,"convertHeaders");async function XDc(t){let e=t.body(),r=null;if(e)r=eNc(e);else{let n=await t.text();r=rNc(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(XDc,"convertToWebResponse");function eNc(t){return new ReadableStream({start(e){let r=tNc(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(eNc,"createReadableStreamFromNodeStream");function tNc(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(tNc,"setupStreamHandlers");function rNc(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(rNc,"createReadableStreamFromText");p();var QSt=class extends Zx{static{a(this,"GeminiProvider")}constructor(e){super(io.Gemini,e)}};p();var qSt=class extends Zx{static{a(this,"GroqProvider")}constructor(e){super(io.Groq,e)}};p();var jSt=class extends Zx{static{a(this,"OpenAIProvider")}constructor(e){super(io.OpenAI,e)}};p();var hGi=16e3,HSt=class extends Zx{static{a(this,"OpenRouterProvider")}constructor(e){super(io.OpenRouter,e)}async getAllModels(){try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new da(this.ctx.get(Yn)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await this.ctx.get(tr).fetch(e,{method:"GET",headers:r});if(!o.ok)throw new Error(`Failed to fetch models: ${o.status} ${o.statusText}`);let s=await o.json();if(s.error)throw new Error(`API Error: ${JSON.stringify(s.error)}`);let c=[];for(let l of s.data)c.push({providerName:this.providerName,modelId:l.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:{name:l.name,maxInputTokens:Math.max(0,l.top_provider.context_length-hGi),maxOutputTokens:hGi,toolCalling:l.supported_parameters?.includes("tools")??!1,vision:l.architecture?.input_modalities?.includes("image")??!1}});return c}catch(e){throw rxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getFetchModelUrl(){return`${this.getBaseUrl()}/models?supported_parameters=tools`}};var wie=class{static{a(this,"BYOKProviderFactory")}constructor(e){this.providers=new Map([[io.OpenAI,new jSt(e)],[io.Gemini,new QSt(e)],[io.Groq,new qSt(e)],[io.OpenRouter,new HSt(e)],[io.Anthropic,new USt(e)]])}getBYOKProvider(e){return this.providers.get(e)}};var nNc=S.Object({providerName:S.Optional(S.String()),enableFetchUrl:S.Optional(S.Boolean())});async function iNc(t,e,r){try{let{providerName:n,enableFetchUrl:o}=r,s=new da(t.get(Yn)),c=[];if(n)if(o){if(!jle(n))return[null,{code:Ze.InvalidRequest,message:`enableFetchUrl is not supported for the ${n} provider`}];if(!await s.getAPIKey(n))return[null,{code:Ze.InvalidRequest,message:`API key is required to fetch models from ${n}`}];let u=t.get(wie).getBYOKProvider(n);if(u){let d=await u.getAllModels(),f=new Map;d.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)});let h=await s.getStoredModelConfigs(n),m=[];Object.entries(h).forEach(([g,A])=>{m.push({providerName:n,modelId:g,deploymentUrl:A.deploymentUrl,isRegistered:A.isRegistered,isCustomModel:A.isCustomModel,modelCapabilities:A.modelCapabilities})}),m.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)}),c.push(...f.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: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: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(iNc,"handleBYOKListModelsChecked");var mGi=Oe(nNc,iNc);p();var oNc=S.Object({providerName:S.String(),apiKey:S.String(),modelId:S.Optional(S.String())});async function sNc(t,e,r){try{let n=new da(t.get(Yn)),{providerName:o,apiKey:s,modelId:c}=r,l=pO(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(sNc,"handleBYOKSaveApiKeyChecked");var gGi=Oe(oNc,sNc);p();var aNc=S.Object({providerName:S.String(),apiKey:S.String(),groupName:S.String(),apiType:S.Optional(S.Union([S.Literal("chatCompletions"),S.Literal("responses"),S.Literal("messages")]))});async function cNc(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(!vK(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 da(t.get(Yn));return await l.storeAPIKey(n,o,pO(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(cNc,"handleBYOKSaveCustomProviderConfigChecked");var AGi=Oe(aNc,cNc);p();var lNc=S.Object({providerName:S.String(),modelId:S.String(),isRegistered:S.Boolean(),isCustomModel:S.Boolean(),deploymentUrl:S.Optional(S.String()),apiKey:S.Optional(S.String()),modelCapabilities:S.Optional(S.Object({name:S.String(),maxInputTokens:S.Optional(S.Number()),maxOutputTokens:S.Optional(S.Number()),toolCalling:S.Boolean(),vision:S.Boolean(),thinking:S.Optional(S.Boolean())}))});async function uNc(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new da(t.get(Yn)),h=pO(n);if(h===1&&!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];if(vK(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(uNc,"handleBYOKSaveModelChecked");var yGi=Oe(lNc,uNc);p();var dNc=S.Object({cliPath:S.String()});async function fNc(t,e,r){return[await Xhe.check(r.cliPath),null]}a(fNc,"handleCheckClaudeCliCompatibilityChecked");var EGi=Oe(dNc,fNc);p();p();var vGi=de(AP()),_Gi="0.135.0",GSt=new Zhe({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,e){if(vGi.lt(t,_Gi))return{severity:"error",message:`Codex CLI at "${e}" reports version ${t.version}, but version ${_Gi} or later is required. Run \`npm install -g @openai/codex\` to upgrade.`}}});var pNc=S.Object({cliPath:S.String()});async function hNc(t,e,r){return[await GSt.check(r.cliPath),null]}a(hNc,"handleCheckCodexCliCompatibilityChecked");var CGi=Oe(pNc,hNc);p();var mNc=S.Object({uri:S.String({minLength:1})});async function gNc(t,e,r){let n=await t.get(ii).getOrReadTextDocument(r);return[{status:td(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(gNc,"handleCheckFileStatusChecked");var bGi=Oe(mNc,gNc);p();var ANc=S.Object({});function SGi(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(SGi,"calculatePercentRemaining");function GBr(t){return{percentRemaining:t?.percent_remaining??100,unlimited:t?.unlimited??!1,overagePermitted:t?.overage_permitted??!1,overageCount:t?.overage_count,entitlement:t?.entitlement,quotaRemaining:t?.quota_remaining,timeStamp:t?.timestamp_utc}}a(GBr,"buildQuotaSnapshot");async function yNc(t,e,r){let n=await t.get(Ur).resolveSession();if(!n)return[null,{code:Ze.InternalError,message:"Not signed in"}];let o=await cbe(t,n);if(o.ok){let s=await o.json();return t.get(Au).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:GBr(s.quota_snapshots?.chat),completions:GBr(s.quota_snapshots?.completions),premiumInteractions:GBr(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:SGi(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:SGi(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(yNc,"handleCheckQuotaChecked");var TGi=Oe(ANc,yNc);p();var ENc=S.Object({options:S.Optional(S.Object({localChecksOnly:S.Optional(S.Boolean()),forceRefresh:S.Optional(S.Boolean())}))});async function _Nc(t,e,r){return[await t.get(Ur).checkAndUpdateStatus(r.options),null]}a(_Nc,"handleCheckStatusChecked");var IGi=Oe(ENc,_Nc);p();var vNc=S.Object({pullRequestNumber:S.Integer({minimum:1}),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),body:S.String({minLength:1})});async function CNc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await new Zh(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return At(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(Vn(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof uE)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(CNc,"handleCloudAgentAddPullRequestCommentChecked");var xGi=Oe(vNc,CNc);p();var bNc=S.Object({pullRequestId:S.Number(),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1})});async function SNc(t,e,r){try{let o=await new HC(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"?(Et(t,"githubApi.cancelCodingAgent",Wt.createAndMarkAsIssued()),At(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new Zh(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),Et(t,"githubApi.cancelCodingAgent",Wt.createAndMarkAsIssued()),At(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:Ze.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(qa(t,n,"githubApi.cancelCodingAgent"),Vn(t,"githubApi.cancelCodingAgent",n),n instanceof tw)return[null,{code:Ze.NoCopilotToken,message:n.message}];if(n instanceof sp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof uE)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(SNc,"handleCancelCodingAgentChecked");var wGi=Oe(bNc,SNc);p();var TNc=S.Object({problemStatement:S.String({minLength:1}),workspaceFolder:S.Optional(S.String({minLength:1})),workspaceFolders:S.Optional(S.Array(Bc))});function INc(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(INc,"pickWorkspaceFolder");async function xNc(t,e,r){try{let n=INc(r);if(!n)return[null,{code:Ze.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a cloud agent job."}];let s=await new _f(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 kO([new PO,new DO]).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=hue(r.problemStatement);if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let h=await new HC(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return At(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(Vn(t,"cloudAgent.createJob",n,{result:"error"}),exe(n))return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(n instanceof tw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof uE)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(xNc,"handleCloudAgentCreateJobChecked");var RGi=Oe(TNc,xNc);p();var wNc=S.Object({sessionId:S.String({minLength:1})});async function RNc(t,e,r){try{let o=await new HC(t).getSessionLogs(r.sessionId,e);return At(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(Vn(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof tw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp||n instanceof l0)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(RNc,"handleCloudAgentGetSessionLogsChecked");var kGi=Oe(wNc,RNc);p();var kNc=S.Object({pullRequestId:S.Integer()});async function PNc(t,e,r){try{let o=await new HC(t).getAllSessions(r.pullRequestId,e);return At(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(Vn(t,"cloudAgent.listSessions",n),n instanceof tw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp||n instanceof l0)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(PNc,"handleCloudAgentListSessionsChecked");var PGi=Oe(kNc,PNc);p();var DNc=S.Object({});async function NNc(t,e,r){return[(await ew(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(NNc,"handleConversationAgentsChecked");var DGi=Oe(DNc,NNc);p();p();var Y3e=de(Xc());function MNc(t,e,r){let n=Wt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return Et(t,"getCompletions.docVersionMismatch",n)}a(MNc,"telemetryVersionMismatch");async function P9(t,e,r){let o=t.get($r).getTextDocumentUnsafe(e);if(!o)throw new Y3e.ResponseError(Ze.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await Ble(t,e,o.getText());if(s.status==="invalid")throw t.get(ps).setClsInactive(s.reason),new Y3e.ResponseError(Ze.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(MNc(t,o,e.version),$o.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new Y3e.ResponseError(Ze.ContentModified,"Document Version Mismatch");return o}a(P9,"getTextDocument");async function FL(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await P9(t,n,r)}catch(o){if(o instanceof Y3e.ResponseError){if(o.code===Ze.CopilotNotAvailable)return;if(o.code===Ze.InvalidParams){$o.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(FL,"getTextDocumentIfAvailable");var ONc=S.Union([S.Literal("keyboard"),S.Literal("toolbar")]),LNc=S.Object({turnId:WK,codeBlockIndex:S.Number(),source:ONc,copiedCharacters:S.Number(),totalCharacters:S.Number(),copiedText:S.String(),doc:S.Optional(gJe),textDocument:S.Optional(jC),position:S.Optional(c0),conversationSource:S.Optional(LO)});async function BNc(t,e,r){let n=await FL(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=nq(r.conversationSource),l=t.get(zo).findByTurnId(r.turnId),u=await tl(t,l,{languageId:n?.detectedLanguageId??""});return HS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${aE(c)}.acceptedCopy`,u),["OK",null]}a(BNc,"handleConversationCodeCopyChecked");var NGi=Oe(LNc,BNc);p();var FNc=S.Union([S.Literal("keyboard"),S.Literal("toolbar"),S.Literal("diff")]),UNc=S.Object({turnId:WK,source:FNc,codeBlockIndex:S.Number(),acceptedLength:S.Optional(S.Number()),totalCharacters:S.Number(),newFile:S.Optional(S.Boolean()),doc:S.Optional(gJe),textDocument:S.Optional(jC),position:S.Optional(c0),conversationSource:S.Optional(LO)});async function QNc(t,e,r){let n=await FL(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=nq(r.conversationSource),l=t.get(zo).findByTurnId(r.turnId),u=await tl(t,l,{languageId:n?.detectedLanguageId??""});return HS(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=await this.processManager.sendRequest("turn/start",{...c?{model:c}:{},threadId:o.threadId,input:s});return o.turnId=l.turnId,e.model&&(o.model=e.model),o.modifiedTime=new Date().toISOString(),o.summary||(o.summary=e.message.slice(0,100)),n.measurements.messageCharLen=e.message.length,{messageId:l.turnId}})}truncateHistory(e){return Promise.reject(new Error("truncateHistory is not supported for Codex sessions"))}async stopSession(e){let r=this.sessions.get(e);!r||!r.turnId||(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),nA.info(this.ctx,"CodexAgentService.stopSession",{sessionId:e}))}destroySession(e){return this.sessions.delete(e.sessionId),nA.info(this.ctx,"CodexAgentService.destroySession",{sessionId:e.sessionId}),Promise.resolve({success:!0})}listSessions(e){let r=Array.from(this.sessions.values()).map(n=>{let o;if(n.workspacePath)try{o=new URL(n.workspacePath).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{o=n.workspacePath}return{sessionId:n.sessionId,startTime:n.startTime,modifiedTime:n.modifiedTime,summary:n.summary,isRemote:!1,context:o?{cwd:o}:void 0}});return r.sort((n,o)=>o.modifiedTime.localeCompare(n.modifiedTime)),nA.info(this.ctx,`CodexAgentService.listSessions: ${r.length} sessions`),Promise.resolve({sessions:r})}async listModels(e){try{let o=(await this.ctx.get(xs).getMetadata(e)).filter(s=>s.supported_endpoints?.includes(R$e.Responses)&&s.model_picker_enabled&&s.capabilities.type==="chat");if(o.length>0){let s=o.map((c,l)=>({id:c.id,name:c.name,vendor:c.vendor,preview:c.preview??!1,isDefault:c.is_chat_default??l===0,modelPickerEnabled:c.model_picker_enabled,modelPickerCategory:c.model_picker_category,modelPickerPriceCategory:c.model_picker_price_category,capabilities:{family:c.capabilities.family,supports:{vision:c.capabilities.supports?.vision??!1,reasoningEfforts:c.capabilities.supports?.reasoning_effort},limits:c.capabilities.limits?{max_context_window_tokens:c.capabilities.limits.max_context_window_tokens,max_output_tokens:c.capabilities.limits.max_output_tokens}:{max_context_window_tokens:128e3}},billing:c.billing?{isPremium:c.billing.is_premium??!0,multiplier:c.billing.multiplier??0}:void 0,policy:c.policy}));return nA.info(this.ctx,`CodexAgentService.listModels: ${s.length} responses-capable models from CAPI`),{models:s}}nA.warn(this.ctx,"CodexAgentService.listModels: no responses-capable models found in CAPI")}catch(r){let n=r instanceof Error?r.message:String(r);nA.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){return Promise.reject(new Error("Codex interaction handling not yet implemented"))}getPlanPath(e){return Promise.resolve(null)}async enableRemote(e){await this.ensureInitialized();try{return await this.processManager.sendRequest("remoteControl/enable",{}),{remoteSteerable:!0}}catch{throw new Error("Codex remote control not available")}}async disableRemote(e){await this.ensureInitialized(),await this.processManager.sendRequest("remoteControl/disable",{})}getRemoteStatus(e){return{remoteSteerable:!1}}async compactHistory(e){await this.ensureInitialized();let r=this.sessions.get(e);return r?(await this.processManager.sendRequest("thread/compact/start",{threadId:r.threadId}),{success:!0,tokensRemoved:0,messagesRemoved:0,summaryContent:""}):{success:!1,tokensRemoved:0,messagesRemoved:0,summaryContent:""}}async stopCompactHistory(e){let r=this.sessions.get(e);return!r||!r.turnId?{aborted:!1}:(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),{aborted:!0})}handleNotification(e,r){nA.info(this.ctx,`handleNotification: method=${e}`,{params:JSON.stringify(r).slice(0,500)});let o=r?.threadId;if(!o){nA.warn(this.ctx,`handleNotification: no threadId in params for method=${e}`);return}let s=this.findSessionByThreadId(o);if(!s)return;if(e==="turn/started"){let u=r;u.turn?.id&&(s.turnId=u.turn.id)}let c=pqi(e,r,s.translatorState);if(!c)return;let l=Array.isArray(c)?c:[c];for(let u of l)u.type==="assistant.usage"&&u.data&&s.model&&(u.data.model=s.model),this.notificationSender.sendBackgroundAgentSessionUpdate(s.sessionId,u,"CODEX")}findSessionByThreadId(e){for(let r of this.sessions.values())if(r.threadId===e)return r}emitErrorToAllSessions(e){for(let r of this.sessions.values()){let n={id:Mt(),timestamp:new Date().toISOString(),type:"session.error",data:{errorType:"process_crash",message:`Codex process terminated unexpectedly: ${e}. Send a new message to retry.`}};this.notificationSender.sendBackgroundAgentSessionUpdate(r.sessionId,n,"CODEX");let o={id:Mt(),timestamp:new Date().toISOString(),type:"session.idle"};this.notificationSender.sendBackgroundAgentSessionUpdate(r.sessionId,o,"CODEX")}}async dispose(){await this.processManager?.stop(),await this.proxyServer.stop()}};var hqi=new fe("AgentRouter"),mqi="AgentRouter";function EI(t){return t.agentProvider??"BACKGROUND"}a(EI,"resolveProvider");var fc=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Hs);case"CLAUDE":return this.ctx.get(E8);case"CODEX":return this.ctx.get(cie);case"CLOUD":return this.ctx.get(aie)}}logDispatch(e,r){hqi.debug(this.ctx,`${mqi}.${e}`,r)}create(e){this.logDispatch("create",e);let r=EI(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=EI(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=EI(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})}stop(e){this.logDispatch("stop",e);let r=EI(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=EI(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=EI(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=EI(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=EI(e);return this.serviceFor(r).handleInteraction(e)}async getPlanPath(e){this.logDispatch("getPlanPath",e);let r=EI(e);return{path:await this.serviceFor(r).getPlanPath(e.sessionId)}}enableRemote(e){this.logDispatch("enableRemote",e);let r=EI(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=EI(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=EI(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=EI(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{hqi.info(this.ctx,`${mqi}.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 bkc=S.Union([S.String(),S.Number()]),wi=S.String(),_Ee=S.Optional(S.String()),Skc=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),parameters:S.Optional(S.Record(S.String(),S.Unknown())),overridesBuiltInTool:S.Optional(S.Boolean()),skipPermission:S.Optional(S.Boolean())}),F4r=S.Array(Skc),d3e=S.Union([S.Literal("default"),S.Literal("long_context")]),vEe=S.Object({model:S.Optional(S.String()),reasoningEffort:_Ee,workspaceFolder:S.Object({uri:S.String(),name:S.Optional(S.String())}),globalAgentsMdInstructions:S.Optional(S.String()),globalClaudeMdInstructions:S.Optional(S.String()),externalToolDefinitions:S.Optional(F4r),useAgentsMdFile:S.Optional(S.Boolean()),useNestedAgentsMdFiles:S.Optional(S.Boolean()),useClaudeMdFile:S.Optional(S.Boolean()),useNestedClaudeMdFiles:S.Optional(S.Boolean()),inlineConfinedFile:S.Optional(S.String()),mcpDirectory:S.Optional(S.String())});async function _i(t){try{return[await t(),null]}catch(e){let r=Brt(e),n=e instanceof UJ?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(_i,"withServiceErrorHandling");var gqi=new fe("BackgroundAgent.compactHistory"),Tkc=S.Object({sessionId:wi});async function U4r(t,e,r){gqi.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Hs),o=e.onCancellationRequested(()=>{gqi.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await _i(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(U4r,"handleBackgroundAgentCompactHistoryChecked");var wth=Oe(Tkc,U4r);p();var Q4r=S.Union(Object.values(Ap).map(t=>S.Literal(t))),Fl=S.Optional(Q4r),P1t=S.Intersect([vEe,S.Object({agentProvider:Fl})]);var Aqi=new fe("BackgroundAgent.compactHistory"),Ikc=S.Object({sessionId:wi,agentProvider:Fl});async function xkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return U4r(t,e,r);Aqi.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.compactHistory(s,e);return Aqi.info(t,"compactHistory succeeded"),c})}a(xkc,"handleAgentCompactHistoryChecked");var yqi=Oe(Ikc,xkc);p();p();var Eqi=new fe("BackgroundAgent.create"),wkc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),vEe]);async function q4r(t,e,r){Eqi.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Hs),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 _i(async()=>{let s=await n.createSession(o);return Eqi.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(q4r,"handleBackgroundAgentCreateChecked");var rrh=Oe(wkc,q4r);var _qi=new fe("BackgroundAgent.create"),Rkc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),P1t]);async function kkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return q4r(t,e,r);_qi.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.create(s);return _qi.info(t,"create succeeded:",c.sessionId),c})}a(kkc,"handleAgentCreateChecked");var vqi=Oe(Rkc,kkc);p();p();var Pkc=S.Object({sessionId:wi});async function j4r(t,e,r){let n=t.get(Hs);return _i(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(j4r,"handleBackgroundAgentDestroyChecked");var Crh=Oe(Pkc,j4r);var Dkc=new fe("BackgroundAgent.destroy"),Nkc=S.Object({sessionId:wi,agentProvider:Fl});async function Mkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return j4r(t,e,r);Dkc.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.destroy(s))}a(Mkc,"handleAgentDestroyChecked");var Cqi=Oe(Nkc,Mkc);p();p();var Okc=new fe("BackgroundAgent.disableRemote"),Lkc=S.Object({sessionId:wi});async function H4r(t,e,r){Okc.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(H4r,"handleBackgroundAgentDisableRemoteChecked");var Hrh=Oe(Lkc,H4r);var bqi=new fe("BackgroundAgent.disableRemote"),Bkc=S.Object({sessionId:wi,agentProvider:Fl});async function Fkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return H4r(t,e,r);bqi.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.disableRemote(s);return bqi.info(t,"disableRemote succeeded"),c})}a(Fkc,"handleAgentDisableRemoteChecked");var Sqi=Oe(Bkc,Fkc);p();p();var Ukc=new fe("BackgroundAgent.enableRemote"),Qkc=S.Object({sessionId:wi});async function G4r(t,e,r){Ukc.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>n.enableRemote(r.sessionId))}a(G4r,"handleBackgroundAgentEnableRemoteChecked");var unh=Oe(Qkc,G4r);var Tqi=new fe("BackgroundAgent.enableRemote"),qkc=S.Object({sessionId:wi,agentProvider:Fl});async function jkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return G4r(t,e,r);Tqi.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.enableRemote(s);return Tqi.info(t,"enableRemote succeeded"),c})}a(jkc,"handleAgentEnableRemoteChecked");var Iqi=Oe(qkc,jkc);p();p();var Hkc=S.Object({sessionId:wi});async function $4r(t,e,r){let n=t.get(Hs);return _i(async()=>({path:await n.getPlanPath(r.sessionId)}))}a($4r,"handleBackgroundAgentGetPlanPathChecked");var knh=Oe(Hkc,$4r);var Gkc=new fe("BackgroundAgent.getPlanPath"),$kc=S.Object({sessionId:wi,agentProvider:Fl});async function Vkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return $4r(t,e,r);Gkc.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.getPlanPath(s))}a(Vkc,"handleAgentGetPlanPathChecked");var xqi=Oe($kc,Vkc);p();p();var Wkc=new fe("BackgroundAgent.getRemoteStatus"),zkc=S.Object({sessionId:wi});async function V4r(t,e,r){Wkc.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a(V4r,"handleBackgroundAgentGetRemoteStatusChecked");var Jnh=Oe(zkc,V4r);var Ykc=new fe("BackgroundAgent.getRemoteStatus"),Kkc=S.Object({sessionId:wi,agentProvider:Fl});async function Jkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return V4r(t,e,r);Ykc.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.getRemoteStatus(s))}a(Jkc,"handleAgentGetRemoteStatusChecked");var wqi=Oe(Kkc,Jkc);p();p();var Zkc=new fe("BackgroundAgent.interaction"),Xkc=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),ePc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),tPc=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),rPc=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),nPc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),iPc=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),oPc=S.Union([S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("permission"),result:Xkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("user_input"),response:ePc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("elicitation"),response:tPc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:rPc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("queued_command"),result:nPc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("external_tool"),result:iPc})]);async function W4r(t,e,r){Zkc.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Hs);return _i(async()=>await n.handleInteraction(r))}a(W4r,"handleBackgroundAgentInteractionChecked");var yih=Oe(oPc,W4r);var Rqi=new fe("BackgroundAgent.interaction"),sPc=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),aPc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),cPc=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),lPc=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),uPc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),dPc=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),fPc=S.Union([S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("permission"),result:sPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("user_input"),response:aPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("elicitation"),response:cPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:lPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("queued_command"),result:uPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("external_tool"),result:dPc,agentProvider:Fl})]);async function pPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return W4r(t,e,r);Rqi.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.interaction(s);return Rqi.info(t,"interaction succeeded"),c})}a(pPc,"handleAgentInteractionChecked");var kqi=Oe(fPc,pPc);p();p();var Pqi=new fe("BackgroundAgent.listSessions"),hPc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String())});async function z4r(t,e,r){Pqi.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Hs);return _i(async()=>{let o=await n.listSessions(r);return Pqi.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(z4r,"handleBackgroundAgentSessionsListChecked");var Qih=Oe(hPc,z4r);var Dqi=new fe("BackgroundAgent.listSessions"),mPc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String()),agentProvider:Fl});async function gPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return z4r(t,e,r);Dqi.info(t,"handleAgentSessionsList called",r);let o=t.get(fc),s=r;return _i(async()=>{let c=await o.listSessions(s);return Dqi.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(gPc,"handleAgentSessionsListChecked");var Nqi=Oe(mPc,gPc);p();p();var Mqi=new fe("BackgroundAgent.listModels"),APc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function Y4r(t,e,r){Mqi.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Hs);return _i(async()=>{let o=await n.listModels(r.forceRefresh);return Mqi.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(Y4r,"handleBackgroundAgentListModelsChecked");var coh=Oe(APc,Y4r);var Oqi=new fe("BackgroundAgent.listModels"),yPc=S.Object({forceRefresh:S.Optional(S.Boolean()),agentProvider:Fl});async function EPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return Y4r(t,e,r);Oqi.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.listModels(s);return Oqi.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(EPc,"handleAgentListModelsChecked");var Lqi=Oe(yPc,EPc);p();p();var Bqi=new fe("BackgroundAgent.resume"),_Pc=S.Intersect([S.Object({sessionId:wi}),vEe]);async function K4r(t,e,r){Bqi.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Hs),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 _i(async()=>{let s=await n.resumeSession(o);return Bqi.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(K4r,"handleBackgroundAgentResumeChecked");var Roh=Oe(_Pc,K4r);var Fqi=new fe("BackgroundAgent.resume"),vPc=S.Intersect([S.Object({sessionId:wi}),P1t]);async function CPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return K4r(t,e,r);Fqi.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.resume(s);return Fqi.info(t,"resume succeeded:",c.sessionId),c})}a(CPc,"handleAgentResumeChecked");var Uqi=Oe(vPc,CPc);p();p();var bPc=S.String(),D1t=["interactive","plan","autopilot"],SPc=S.Union(D1t.map(t=>S.Literal(t))),TPc=S.String({minLength:1}),IPc=S.Object({sessionId:wi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(bPc),reasoningEffort:_Ee,references:S.Optional(S.Array(OO)),agentMode:S.Optional(SPc),chatMode:S.Optional(TPc),contextTier:S.Optional(d3e),sendMode:S.Optional(S.Union([S.Literal("enqueue"),S.Literal("immediate")]))});async function J4r(t,e,r){let n=t.get(Hs),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 _i(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(J4r,"handleBackgroundAgentSendChecked");var Joh=Oe(IPc,J4r);var Qqi=new fe("BackgroundAgent.send"),xPc=S.String(),wPc=S.String(),RPc=S.String({minLength:1}),kPc=S.Object({sessionId:wi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(xPc),reasoningEffort:_Ee,references:S.Optional(S.Array(OO)),agentMode:S.Optional(wPc),chatMode:S.Optional(RPc),contextTier:S.Optional(d3e),agentProvider:Fl});async function PPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return r.agentMode!==void 0&&!D1t.includes(r.agentMode)?[null,{code:Ze.InvalidParams,message:`Unknown agentMode for Background provider: ${JSON.stringify(r.agentMode)}. Expected one of ${D1t.join(", ")}.`}]:J4r(t,e,{...r,agentMode:r.agentMode});Qqi.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.send(s,e);return Qqi.info(t,"resume succeeded:",c.messageId),c})}a(PPc,"handleAgentSendChecked");var qqi=Oe(kPc,PPc);p();p();var DPc=new fe("BackgroundAgent.stop"),NPc=S.Object({sessionId:wi});async function Z4r(t,e,r){DPc.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(Z4r,"handleBackgroundAgentStopChecked");var _sh=Oe(NPc,Z4r);var MPc=new fe("BackgroundAgent.stop"),OPc=S.Object({sessionId:wi,agentProvider:Fl});async function LPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await Z4r(t,e,r);return c?[null,c]:[void 0,null]}MPc.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.stop(s))}a(LPc,"handleAgentStopChecked");var jqi=Oe(OPc,LPc);p();var BPc=S.Object({sessionId:wi,eventId:S.String(),agentProvider:Q4r});async function FPc(t,e,r){let n=t.get(fc),o={sessionId:r.sessionId,eventId:r.eventId,providerName:r.agentProvider};return _i(async()=>n.truncateHistory(o))}a(FPc,"handleAgentTruncateHistoryChecked");var Hqi=Oe(BPc,FPc);p();var UPc=S.Object({});async function QPc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Ur).listAvailableTokens()},null]}a(QPc,"handleListAvailableTokensChecked");var Gqi=Oe(UPc,QPc);p();var qPc=S.Object({tokenId:S.Number()});async function jPc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Ur).useExistingToken(r.tokenId),null]}a(jPc,"handleUseExistingTokenChecked");var $qi=Oe(qPc,jPc);p();var HPc=S.Object({providerName:S.String()});async function GPc(t,e,r){try{let{providerName:n}=r,o=pO(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 Ha(t.get(ri));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(GPc,"handleBYOKDeleteApiKeyChecked");var Vqi=Oe(HPc,GPc);p();var $Pc=S.Object({providerName:S.String(),modelId:S.String()});async function VPc(t,e,r){try{let n=new Ha(t.get(ri)),{providerName:o,modelId:s}=r,c=pO(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(VPc,"handleBYOKDeleteModelChecked");var Wqi=Oe($Pc,VPc);p();var WPc=S.Object({providerName:S.Optional(S.String()),modelId:S.Optional(S.String())}),zqi="-api-key";async function zPc(t,e){let r=await e.listKeys("byok"),n=new Set(await t.listCustomProviderNames()),o=new Set(Object.keys(await t.getStoredModelConfigs(io.Azure))),s=new Set(Object.values(io).filter(u=>u!==io.Azure)),c=`${io.Azure}-`,l=[];for(let u of r){if(!u.endsWith(zqi))continue;let d=await e.read("byok",u);if(!d)continue;let f=u.slice(0,-zqi.length),h=f.startsWith(c)?f.slice(c.length):void 0;if(h!==void 0&&o.has(h)&&!n.has(f)){l.push({providerName:io.Azure,modelId:h,apiKey:d});continue}(s.has(f)||n.has(f))&&l.push({providerName:f,apiKey:d})}return l}a(zPc,"listAllApiKeys");async function YPc(t,e,r){try{let n=new Ha(t.get(ri)),{providerName:o,modelId:s}=r;return o?[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]:[{apiKeys:await zPc(n,t.get(ri))},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(YPc,"handleBYOKListApiKeysChecked");var Yqi=Oe(WPc,YPc);p();var KPc=S.Object({providerName:S.Optional(S.String())});async function JPc(t,e,r){try{let n=new Ha(t.get(ri)),o=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(JPc,"handleBYOKListCustomProviderConfigsChecked");var Kqi=Oe(KPc,JPc);p();p();p();jLr();var QSt=class extends Xx{static{a(this,"AnthropicProvider")}constructor(e){super(io.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new Ha(this.ctx.get(ri)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new BL({apiKey:e,fetch:eNc(this.ctx.get(nr))});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 iYe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function eNc(t){return async(e,r)=>{let n=tNc(e,r),o=nNc(r),s=await t.fetch(n,o);return oNc(s)}}a(eNc,"createAnthropicFetchAdapter");function tNc(t,e){return t instanceof Request?(rNc(t,e),t.url):t instanceof URL?t.toString():t}a(tNc,"convertInputToString");function rNc(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(rNc,"mergeRequestInit");function nNc(t){let e;return t?.headers&&(e=iNc(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(nNc,"convertToFetchOptions");function iNc(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(iNc,"convertHeaders");async function oNc(t){let e=t.body(),r=null;if(e)r=sNc(e);else{let n=await t.text();r=cNc(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(oNc,"convertToWebResponse");function sNc(t){return new ReadableStream({start(e){let r=aNc(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(sNc,"createReadableStreamFromNodeStream");function aNc(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(aNc,"setupStreamHandlers");function cNc(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(cNc,"createReadableStreamFromText");p();var qSt=class extends Xx{static{a(this,"GeminiProvider")}constructor(e){super(io.Gemini,e)}};p();var jSt=class extends Xx{static{a(this,"GroqProvider")}constructor(e){super(io.Groq,e)}};p();var HSt=class extends Xx{static{a(this,"OpenAIProvider")}constructor(e){super(io.OpenAI,e)}};p();var yGi=16e3,GSt=class extends Xx{static{a(this,"OpenRouterProvider")}constructor(e){super(io.OpenRouter,e)}getFetchModelUrl(){return`${this.getBaseUrl()}/models?supported_parameters=tools`}resolveModelCapabilities(e){let r=e,n=r.top_provider?.context_length;if(typeof r.name!="string"||typeof n!="number")return;let o=r.supported_parameters??[],s=o.includes("reasoning")||o.includes("reasoning_effort")?["low","medium","high"]:void 0;return{name:r.name,maxInputTokens:Math.max(0,n-yGi),maxOutputTokens:yGi,toolCalling:o.includes("tools"),vision:r.architecture?.input_modalities?.includes("image")??!1,supportsReasoningEffort:s}}};var wie=class{static{a(this,"BYOKProviderFactory")}constructor(e){this.providers=new Map([[io.OpenAI,new HSt(e)],[io.Gemini,new qSt(e)],[io.Groq,new jSt(e)],[io.OpenRouter,new GSt(e)],[io.Anthropic,new QSt(e)]])}getBYOKProvider(e){return this.providers.get(e)}};var lNc=S.Object({providerName:S.Optional(S.String()),enableFetchUrl:S.Optional(S.Boolean())});async function uNc(t,e,r){try{let{providerName:n,enableFetchUrl:o}=r,s=new Ha(t.get(ri)),c=[];if(n)if(o){if(!jle(n))return[null,{code:Ze.InvalidRequest,message:`enableFetchUrl is not supported for the ${n} provider`}];if(!await s.getAPIKey(n))return[null,{code:Ze.InvalidRequest,message:`API key is required to fetch models from ${n}`}];let u=t.get(wie).getBYOKProvider(n);if(u){let d=await u.getAllModels(),f=new Map;d.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)});let h=await s.getStoredModelConfigs(n),m=[];Object.entries(h).forEach(([g,A])=>{m.push({providerName:n,modelId:g,deploymentUrl:A.deploymentUrl,isRegistered:A.isRegistered,isCustomModel:A.isCustomModel,modelCapabilities:A.modelCapabilities})}),m.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)}),c.push(...f.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: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: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(uNc,"handleBYOKListModelsChecked");var EGi=Oe(lNc,uNc);p();var dNc=S.Object({providerName:S.String(),apiKey:S.String(),modelId:S.Optional(S.String())});async function fNc(t,e,r){try{let n=new Ha(t.get(ri)),{providerName:o,apiKey:s,modelId:c}=r,l=pO(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(fNc,"handleBYOKSaveApiKeyChecked");var _Gi=Oe(dNc,fNc);p();var pNc=S.Object({providerName:S.String(),apiKey:S.String(),groupName:S.String(),apiType:S.Optional(S.Union([S.Literal("chatCompletions"),S.Literal("responses"),S.Literal("messages")]))});async function hNc(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(!vK(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 Ha(t.get(ri));return await l.storeAPIKey(n,o,pO(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(hNc,"handleBYOKSaveCustomProviderConfigChecked");var vGi=Oe(pNc,hNc);p();var mNc=S.Object({providerName:S.String(),modelId:S.String(),isRegistered:S.Boolean(),isCustomModel:S.Boolean(),deploymentUrl:S.Optional(S.String()),apiKey:S.Optional(S.String()),modelCapabilities:S.Optional(S.Object({name:S.String(),maxInputTokens:S.Optional(S.Number()),maxOutputTokens:S.Optional(S.Number()),toolCalling:S.Boolean(),vision:S.Boolean(),thinking:S.Optional(S.Boolean())}))});async function gNc(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new Ha(t.get(ri)),h=pO(n);if(h===1&&!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];if(vK(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(gNc,"handleBYOKSaveModelChecked");var CGi=Oe(mNc,gNc);p();var ANc=S.Object({cliPath:S.String()});async function yNc(t,e,r){return[await eme.check(r.cliPath),null]}a(yNc,"handleCheckClaudeCliCompatibilityChecked");var bGi=Oe(ANc,yNc);p();p();var TGi=de(yP()),SGi="0.135.0",$St=new Xhe({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,e){if(TGi.lt(t,SGi))return{severity:"error",message:`Codex CLI at "${e}" reports version ${t.version}, but version ${SGi} or later is required. Run \`npm install -g @openai/codex\` to upgrade.`}}});var ENc=S.Object({cliPath:S.String()});async function _Nc(t,e,r){return[await $St.check(r.cliPath),null]}a(_Nc,"handleCheckCodexCliCompatibilityChecked");var IGi=Oe(ENc,_Nc);p();var vNc=S.Object({uri:S.String({minLength:1})});async function CNc(t,e,r){let n=await t.get(ii).getOrReadTextDocument(r);return[{status:td(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(CNc,"handleCheckFileStatusChecked");var xGi=Oe(vNc,CNc);p();var bNc=S.Object({});function wGi(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(wGi,"calculatePercentRemaining");function $Br(t){return{percentRemaining:t?.percent_remaining??100,unlimited:t?.unlimited??!1,overagePermitted:t?.overage_permitted??!1,overageCount:t?.overage_count,entitlement:t?.entitlement,quotaRemaining:t?.quota_remaining,timeStamp:t?.timestamp_utc}}a($Br,"buildQuotaSnapshot");async function SNc(t,e,r){let n=await t.get(Ur).resolveSession();if(!n)return[null,{code:Ze.InternalError,message:"Not signed in"}];let o=await lbe(t,n);if(o.ok){let s=await o.json();return t.get(Au).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:$Br(s.quota_snapshots?.chat),completions:$Br(s.quota_snapshots?.completions),premiumInteractions:$Br(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:wGi(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:wGi(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(SNc,"handleCheckQuotaChecked");var RGi=Oe(bNc,SNc);p();var TNc=S.Object({options:S.Optional(S.Object({localChecksOnly:S.Optional(S.Boolean()),forceRefresh:S.Optional(S.Boolean())}))});async function INc(t,e,r){return[await t.get(Ur).checkAndUpdateStatus(r.options),null]}a(INc,"handleCheckStatusChecked");var kGi=Oe(TNc,INc);p();var xNc=S.Object({pullRequestNumber:S.Integer({minimum:1}),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),body:S.String({minLength:1})});async function wNc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await new Zh(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return At(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(Vn(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof uE)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(wNc,"handleCloudAgentAddPullRequestCommentChecked");var PGi=Oe(xNc,wNc);p();var RNc=S.Object({pullRequestId:S.Number(),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1})});async function kNc(t,e,r){try{let o=await new HC(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"?(Et(t,"githubApi.cancelCodingAgent",Wt.createAndMarkAsIssued()),At(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new Zh(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),Et(t,"githubApi.cancelCodingAgent",Wt.createAndMarkAsIssued()),At(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:Ze.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(Qa(t,n,"githubApi.cancelCodingAgent"),Vn(t,"githubApi.cancelCodingAgent",n),n instanceof rw)return[null,{code:Ze.NoCopilotToken,message:n.message}];if(n instanceof sp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof uE)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(kNc,"handleCancelCodingAgentChecked");var DGi=Oe(RNc,kNc);p();var PNc=S.Object({problemStatement:S.String({minLength:1}),workspaceFolder:S.Optional(S.String({minLength:1})),workspaceFolders:S.Optional(S.Array(Bc))});function DNc(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(DNc,"pickWorkspaceFolder");async function NNc(t,e,r){try{let n=DNc(r);if(!n)return[null,{code:Ze.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a cloud agent job."}];let s=await new _f(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 kO([new PO,new DO]).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=hue(r.problemStatement);if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let h=await new HC(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return At(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(Vn(t,"cloudAgent.createJob",n,{result:"error"}),txe(n))return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(n instanceof rw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof uE)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(NNc,"handleCloudAgentCreateJobChecked");var NGi=Oe(PNc,NNc);p();var MNc=S.Object({sessionId:S.String({minLength:1})});async function ONc(t,e,r){try{let o=await new HC(t).getSessionLogs(r.sessionId,e);return At(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(Vn(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof rw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp||n instanceof l0)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(ONc,"handleCloudAgentGetSessionLogsChecked");var MGi=Oe(MNc,ONc);p();var LNc=S.Object({pullRequestId:S.Integer()});async function BNc(t,e,r){try{let o=await new HC(t).getAllSessions(r.pullRequestId,e);return At(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(Vn(t,"cloudAgent.listSessions",n),n instanceof rw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp||n instanceof l0)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(BNc,"handleCloudAgentListSessionsChecked");var OGi=Oe(LNc,BNc);p();var FNc=S.Object({});async function UNc(t,e,r){return[(await tw(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(UNc,"handleConversationAgentsChecked");var LGi=Oe(FNc,UNc);p();p();var J3e=de(Xc());function QNc(t,e,r){let n=Wt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return Et(t,"getCompletions.docVersionMismatch",n)}a(QNc,"telemetryVersionMismatch");async function D9(t,e,r){let o=t.get($r).getTextDocumentUnsafe(e);if(!o)throw new J3e.ResponseError(Ze.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await Ble(t,e,o.getText());if(s.status==="invalid")throw t.get(ps).setClsInactive(s.reason),new J3e.ResponseError(Ze.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(QNc(t,o,e.version),Vo.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new J3e.ResponseError(Ze.ContentModified,"Document Version Mismatch");return o}a(D9,"getTextDocument");async function FL(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await D9(t,n,r)}catch(o){if(o instanceof J3e.ResponseError){if(o.code===Ze.CopilotNotAvailable)return;if(o.code===Ze.InvalidParams){Vo.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(FL,"getTextDocumentIfAvailable");var qNc=S.Union([S.Literal("keyboard"),S.Literal("toolbar")]),jNc=S.Object({turnId:WK,codeBlockIndex:S.Number(),source:qNc,copiedCharacters:S.Number(),totalCharacters:S.Number(),copiedText:S.String(),doc:S.Optional(EJe),textDocument:S.Optional(jC),position:S.Optional(c0),conversationSource:S.Optional(LO)});async function HNc(t,e,r){let n=await FL(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=iq(r.conversationSource),l=t.get(Yo).findByTurnId(r.turnId),u=await tl(t,l,{languageId:n?.detectedLanguageId??""});return $S(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${aE(c)}.acceptedCopy`,u),["OK",null]}a(HNc,"handleConversationCodeCopyChecked");var BGi=Oe(jNc,HNc);p();var GNc=S.Union([S.Literal("keyboard"),S.Literal("toolbar"),S.Literal("diff")]),$Nc=S.Object({turnId:WK,source:GNc,codeBlockIndex:S.Number(),acceptedLength:S.Optional(S.Number()),totalCharacters:S.Number(),newFile:S.Optional(S.Boolean()),doc:S.Optional(EJe),textDocument:S.Optional(jC),position:S.Optional(c0),conversationSource:S.Optional(LO)});async function VNc(t,e,r){let n=await FL(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=iq(r.conversationSource),l=t.get(Yo).findByTurnId(r.turnId),u=await tl(t,l,{languageId:n?.detectedLanguageId??""});return $S(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=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:s},{turnCount:n});Et(this.ctx,"conversationPartition.compression.started",c,0)}sendArchivedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{turnCount:n});Et(this.ctx,"conversationPartition.compression.archived",s,0)}sendSummarizedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{summaryLength:n});Et(this.ctx,"conversationPartition.compression.summarized",s,0)}sendCompletedTelemetry(e,r,n,o,s,c,l){let u=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),newPartitionId:String(n),modelId:l},{archivedTurnCount:o,summaryLength:s,compressionTimeMs:c});Et(this.ctx,"conversationPartition.compression.completed",u,0)}sendFailedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),error:n,modelId:s},{compressionTimeMs:o});Et(this.ctx,"conversationPartition.compression.failed",c,0)}sendCancelledTelemetry(e,r,n,o){let s=Date.now()-n,c=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:o},{compressionTimeMs:s});Et(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 WSt=de(Io());var VSt=class extends lr{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(WSt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(WSt.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=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:s},{turnCount:n});Et(this.ctx,"conversationPartition.compression.started",c,0)}sendArchivedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{turnCount:n});Et(this.ctx,"conversationPartition.compression.archived",s,0)}sendSummarizedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{summaryLength:n});Et(this.ctx,"conversationPartition.compression.summarized",s,0)}sendCompletedTelemetry(e,r,n,o,s,c,l){let u=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),newPartitionId:String(n),modelId:l},{archivedTurnCount:o,summaryLength:s,compressionTimeMs:c});Et(this.ctx,"conversationPartition.compression.completed",u,0)}sendFailedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),error:n,modelId:s},{compressionTimeMs:o});Et(this.ctx,"conversationPartition.compression.failed",c,0)}sendCancelledTelemetry(e,r,n,o){let s=Date.now()-n,c=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:o},{compressionTimeMs:s});Et(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 zSt=de(xo());var WSt=class extends lr{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(zSt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(zSt.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. @@ -3987,7 +3987,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(aJe({role:"user",content:GS(o.request.message)})),o.response){let s=yO(o.response.message,!0),c=RO(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 p0(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(uJe({role:"user",content:VS(o.request.message)})),o.response){let s=yO(o.response.message,!0),c=RO(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(nw,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new p0(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. @@ -4005,7 +4005,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}};Mo();var xN=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 ap.create(VSt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=OA.user(o,Mt()),f=JI.createEmptyConfigForTesting(),h;try{h=this.ctx.get(oc)}catch{h=new oc(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=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:r.modelId},{turnCount:e.turnCount});Et(this.ctx,"partition.summary.started",n,0)}sendSuccessTelemetry(e,r,n,o){let s=Date.now()-r,c=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:o.modelId},{summaryLength:n.length,generationTimeMs:s,turnCount:e.turnCount});Et(this.ctx,"partition.summary.success",c,0)}sendErrorTelemetry(e,r,n,o,s){let c=Date.now()-r,l=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),errorType:n,errorMessage:s||"Unknown error",modelId:o.modelId},{generationTimeMs:c});Et(this.ctx,"partition.summary.error",l,0)}sendCancelledTelemetry(e,r,n){let o=Date.now()-r,s=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:n.modelId},{generationTimeMs:o});Et(this.ctx,"partition.summary.cancelled",s,0)}};var qNc=S.Object({conversationId:S.String()});async function jNc(t,e,r){let{conversationId:n}=r,o=Date.now();ot.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(bI);HNc(t,n,o);try{if(e.isCancellationRequested)return ot.debug(t,`Manual compression cancelled before start: ${n}`),[K3e(n,"Compression cancelled"),null];let c=t.get(zo),l;try{l=c.get(n)}catch{return ot.warn(t,`Conversation not found: ${n}`),J3e(t,n,0,"Conversation not found",Date.now()-o),[K3e(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}`),J3e(t,n,0,"No turns to compress",Date.now()-o),[K3e(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}`),J3e(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[K3e(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(el).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(xN),y=new sk(A,t),E=l.currentPartitionId;await s.notifyCompressionStarted({conversationId:n,partitionId:E,reason:"manual"});let _=await y.compressCurrentPartition(l,m,e);if(_.success){let v=l.turns[0],b=typeof v?.request?.message=="string"?v.request.message:"",T=Date.now()-o;ot.debug(t,`Manual compression completed: conversationId=${n}, archivedPartitionId=${_.archivedPartitionId}, newPartitionId=${_.newPartitionId}, turnCount=${u}, summaryLength=${b.length}, durationMs=${T}`);let w;try{w=new qq().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:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryLength:b.length,turnCount:u,durationMs:T,contextInfo:w}),GNc(t,n,_.archivedPartitionId,_.newPartitionId,u,b.length,T,m.modelId),[{success:!0,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryContent:b,summaryLength:b.length,turnCount:u,contextInfo:w},null]}else{let v=_.error||"Compression failed",b=Date.now()-o;return ot.warn(t,`Manual compression failed: conversationId=${n}, error=${v}`),J3e(t,n,_.archivedPartitionId,v,b,m.modelId),[{success:!1,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.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}`),J3e(t,n,0,l,u),[K3e(n,`Compression failed: ${l}`),null]}}a(jNc,"handleConversationCompressChecked");function K3e(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(K3e,"createErrorResult");function HNc(t,e,r,n){let o=Wt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});Et(t,"conversationPartition.manualCompression.started",o,0)}a(HNc,"sendStartedTelemetry");function GNc(t,e,r,n,o,s,c,l){let u=Wt.createAndMarkAsIssued({conversationId:e,archivedPartitionId:String(r),newPartitionId:String(n),success:"true",...l?{modelId:l}:{}},{turnCount:o,summaryLength:s,durationMs:c});Et(t,"conversationPartition.manualCompression.completed",u,0)}a(GNc,"sendCompletedTelemetry");function J3e(t,e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});Et(t,"conversationPartition.manualCompression.failed",c,0)}a(J3e,"sendFailedTelemetry");var OGi=Oe(qNc,jNc);p();p();var zSt=S.Array(Sf);function YSt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(YSt,"resolveAsActiveEditor");p();var LGi=de(Xc());var KSt=new LGi.ProgressType,$Br=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new qq}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(ar).connection.sendProgress(KSt,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(ar).connection.sendProgress(KSt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(ar).connection.sendProgress(KSt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(ar).connection.sendProgress(KSt,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 m_e(t){return new $Br(t.workDoneToken)}a(m_e,"createProgressHandler");p();var BGi=de(Xc());var g_e=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 BGi.ResponseError(Ze.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function JSt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:Ji(t.uri)}]}a(JSt,"resolveAsWorkspaceFolders");p();p();var $Nc=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),i_=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?$Nc(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 wN=class{constructor(){this.tokens=new Cn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new Fn.CancellationTokenSource,o=new i_([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 FGi(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(FGi,"calculateBillingMultiplier");async function ZSt(t,e){let r=e,n=e.modelInfo?.id;if(!n&&r.model&&(n=r.modelProviderName?r.model:await xo.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(ZSt,"resolveTurnModelInfo");function XSt(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:FGi(r)}}a(XSt,"buildTurnSummary");p();function eTt(t,e,r,n,o,s){let{properties:c,measurements:l}=WNc(e,r,n,o,s),u=VNc(e,r,n,o,s);Et(t,"conversation.turnCompleted",Wt.createAndMarkAsIssued(u)),At(t,"conversation.turnCompleted",c,l)}a(eTt,"sendTurnTelemetry");function VNc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};return ak(s,"chatMode",n.chatMode),ak(s,"conversationSource",o?.conversationSource),s}a(VNc,"buildGithubTurnTelemetryProperties");function WNc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};ak(s,"modelName",n.modelName),ak(s,"modelProviderName",n.modelProviderName),ak(s,"userRequestedModel",n.userRequestedModel),ak(s,"reasoningEffort",n.reasoningEffort),ak(s,"chatMode",n.chatMode),ak(s,"agentSlug",n.agentSlug),ak(s,"conversationSource",o?.conversationSource);let c={};return ak(c,"billingMultiplier",n.billingMultiplier),ak(c,"credits",o?.credits),ak(c,"totalTimeMs",o?.totalTimeMs),{properties:s,measurements:c}}a(WNc,"buildTurnTelemetryData");function tTt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(tTt,"formatCredits");function ak(t,e,r){r!==void 0&&(t[e]=r)}a(ak,"assignDefined");var zNc=S.Object({conversationId:S.Optional(mJe),workDoneToken:S.Union([S.String(),S.Number()]),turns:S.Array(zCn,{minItems:1}),capabilities:S.Optional(S.Object({allSkills:S.Optional(S.Boolean()),skills:S.Optional(S.Array(S.String()))})),doc:S.Optional(jC),textDocument:S.Optional(jC),selection:S.Optional(Sf),visibleRanges:S.Optional(zSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(OO)),source:S.Optional(LO),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),ignoredSkills:S.Optional(S.Array(S.String())),userLanguage:S.Optional(S.String()),model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(EJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),todoList:S.Optional(S.Array(_Je)),restoreToTurnId:S.Optional(S.String())});async function YNc(t,e,r){g_e.validate(r.workspaceFolders);let n=await FL(t,r,e),o=await t.get(zo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(m0).setTodos(o,r.todoList);let s=await ZSt(t,r),c=o.turns.length>0?r.turns.slice(-1):r.turns;await KNc(t,o,{...r,turns:c},s.id,n);let l=o.turns[o.turns.length-1],u=m_e(r),d=t.get(wN).add(u.progressToken,e),f=new hw(t,o,l,d),h=await t.get(RN).createProcessor(f,u.progressToken,r.computeSuggestions),m=t.get(Au),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 E=Math.round(performance.now()-y),_=XSt(l,s);return eTt(t,"conversation/create",o,l,_,{totalTimeMs:E,credits:A,conversationSource:o.source}),[{conversationId:o.id,turnId:l.id,agentSlug:_.agentSlug,modelName:_.modelName,modelProviderName:_.modelProviderName,billingMultiplier:_.billingMultiplier,modelInfo:r.modelInfo,credits:tTt(A),preciseCredits:A},null]}a(YNc,"handleConversationCreateChecked");async function KNc(t,e,r,n,o){for(let s of r.turns){let c=AJe(s.request),l=new Xf({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:JSt(u),f=t.get(j_),h=qQ(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=s.model??n,l.needToolCallConfirmation=r.needToolCallConfirmation;let m=YSt({textDocument:o,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(zo).addTurn(e.id,l,r.references,m,u,d,r.ignoredSkills,void 0)}}a(KNc,"addTurns");var UGi=Oe(zNc,YNc);p();var JNc=S.Object({conversationId:S.String()});function ZNc(t,e,r){return t.get(zo).destroy(r.conversationId),["OK",null]}a(ZNc,"handleConversationDestroyChecked");var QGi=Oe(JNc,ZNc);p();var XNc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function eMc(t,e,r){return[(await t.get(j_).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(eMc,"handleConversationModesChecked");var qGi=Oe(XNc,eMc);p();var tMc=S.Object({turnId:S.String(),acceptedFileCount:S.Number({minimum:0}),totalFileCount:S.Number({minimum:1})}),rMc=new fe("conversationNotifyCodeAcceptance");async function nMc(t,e,r){let n=t.get(zo).findByTurnId(r.turnId);if(!n)return rMc.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await tl(t,n,{languageId:""});return HS(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${aE("agentPanel")}.codeAcceptance`,o),["OK",null]}a(nMc,"handleConversationNotifyCodeAcceptanceChecked");var jGi=Oe(tMc,nMc);p();var iMc=S.Object({});function oMc(t,e,r){return[{path:t.get(Yn).directory},null]}a(oMc,"handleConversationPersistenceChecked");var HGi=Oe(iMc,oMc);p();p();var VBr=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Ur).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},WBr=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Qt).getToken()).envelope.chat_enabled?"ok":"failed"}}},sMc=[new VBr,new WBr],ck=class{constructor(e,r=sMc){this.ctx=e;this.checks=r;this.emitter=new Wi;this.onChange=this.emitter.event;bs(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 aMc=S.Object({forceCheck:S.Optional(S.Boolean())});async function cMc(t,e,r){let n=r.forceCheck??!1;return[await t.get(ck).check(n),null]}a(cMc,"handleConversationPreconditionsChecked");var GGi=Oe(aMc,cMc);p();var lMc=S.Object({turnId:S.Optional(S.String()),rating:S.Number(),doc:S.Optional(jC),textDocument:S.Optional(jC),source:S.Optional(LO)});async function uMc(t,e,r){let n=await FL(t,r,e),o=nq(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await tl(t,r.turnId?t.get(zo).findByTurnId(r.turnId):void 0,{languageId:n?.detectedLanguageId??""}),l=`${aE(o)}.messageRating`,u=HS(t,n,{rating:s,uiKind:o},{},l,c);return ZI(t,l,u),["OK",null]}a(uMc,"handleConversationRatingChecked");var $Gi=Oe(lMc,uMc);p();var dMc=S.Object({tools:S.Array(YCn)});function fMc(t,e,r){let n=t.get(gs);return r.tools.forEach(s=>{n.registerTool(new Xq({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(fMc,"conversationRegisterToolsChecked");var VGi=Oe(dMc,fMc);p();var pMc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function hMc(t,e,r){let n=v$t(t).map(u=>({id:u.id,description:u.description,shortDescription:u.shortDescription,scopes:u.scopes,source:"builtin"})),o=t.get(Cg),s=r.workspaceFolders??[],l=(await o.listCustomPrompts(s)).map(u=>({id:u.uri,name:u.name,description:u.description||"",shortDescription:"",scopes:mMc(u.mode),source:"prompt",mode:u.mode,model:u.model}));if(n.push(...l),r.workspaceFolders&&r.workspaceFolders.length>0){let f=(await t.get(h0).listSkills(r.workspaceFolders)).map(h=>({id:`skill:${Ji(uf(h.uri))}`,description:h.description||"",shortDescription:h.name,scopes:["agent-panel"],source:"skill"})).filter(h=>!n.some(m=>m.id===h.id));n.push(...f)}return[n,null]}a(hMc,"handleConversationTemplatesChecked");function mMc(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(mMc,"getCustomPromptScopes");var WGi=Oe(pMc,hMc);p();var gMc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),conversationId:mJe,turnId:S.Optional(WK),message:Dqt,followUp:S.Optional(S.Object({id:S.String(),type:S.String()})),doc:S.Optional(jC),textDocument:S.Optional(jC),selection:S.Optional(Sf),visibleRanges:S.Optional(zSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(OO)),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),ignoredSkills:S.Optional(S.Array(S.String())),confirmationResponse:Myn,model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(EJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),agentSlug:S.Optional(S.String()),todoList:S.Optional(S.Array(_Je))});async function AMc(t,e,r){g_e.validate(r.workspaceFolders);let n=await FL(t,r,e),o=t.get(zo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(m0).setTodos(s,r.todoList);let c=AJe(r.message),l=new Xf({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:JSt(u),f=await ZSt(t,r),h=t.get(j_),m=qQ(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=YSt({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=m_e(r),y=t.get(wN).add(A.progressToken,e),E=new hw(t,s,l,y),_=await t.get(RN).createProcessor(E,A.progressToken,r.computeSuggestions),v=t.get(Au),b=String(l.id);v.resetTurnCredits(b);let T,w=performance.now();try{await _.process(A,y,r.followUp,n,f),T=v.getCreditsForTurn(b)}finally{v.resetTurnCredits(b)}let R=Math.round(performance.now()-w),x=XSt(l,f);return eTt(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:tTt(T),preciseCredits:T},null]}a(AMc,"handleConversationTurnChecked");var zGi=Oe(gMc,AMc);p();var yMc=S.Object({conversationId:S.String(),turnId:S.String(),source:S.Optional(LO)});async function EMc(t,e,r){t.get(zo).deleteTurn(r.conversationId,r.turnId);let o=nq(r.source),s=await tl(t,t.get(zo).findByTurnId(r.turnId),{languageId:""});return HS(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${aE(o)}.messageDelete`,s),["OK",null]}a(EMc,"handleConversationTurnDeleteChecked");var YGi=Oe(yMc,EMc);p();var _Mc=S.Object({toolIds:S.Array(S.String())});function vMc(t,e,r){let n=t.get(gs);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(vMc,"conversationUnregisterToolsChecked");var KGi=Oe(_Mc,vMc);p();var CMc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),tools:S.Array(S.Object({name:S.String(),status:S.Enum(P3)}))});async function bMc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(j_).getChatMode(n?qQ(n):"Agent",o,s),l=t.get(gs),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(bMc,"conversationUpdateToolsStatusChecked");var JGi=Oe(CMc,bMc);p();p();Mo();var SMc=5e3,Rie=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}};Oo();var wN=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 ap.create(WSt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=OA.user(o,Mt()),f=XI.createEmptyConfigForTesting(),h;try{h=this.ctx.get(oc)}catch{h=new oc(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=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:r.modelId},{turnCount:e.turnCount});Et(this.ctx,"partition.summary.started",n,0)}sendSuccessTelemetry(e,r,n,o){let s=Date.now()-r,c=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:o.modelId},{summaryLength:n.length,generationTimeMs:s,turnCount:e.turnCount});Et(this.ctx,"partition.summary.success",c,0)}sendErrorTelemetry(e,r,n,o,s){let c=Date.now()-r,l=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),errorType:n,errorMessage:s||"Unknown error",modelId:o.modelId},{generationTimeMs:c});Et(this.ctx,"partition.summary.error",l,0)}sendCancelledTelemetry(e,r,n){let o=Date.now()-r,s=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:n.modelId},{generationTimeMs:o});Et(this.ctx,"partition.summary.cancelled",s,0)}};var WNc=S.Object({conversationId:S.String()});async function zNc(t,e,r){let{conversationId:n}=r,o=Date.now();ot.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(TI);YNc(t,n,o);try{if(e.isCancellationRequested)return ot.debug(t,`Manual compression cancelled before start: ${n}`),[Z3e(n,"Compression cancelled"),null];let c=t.get(Yo),l;try{l=c.get(n)}catch{return ot.warn(t,`Conversation not found: ${n}`),X3e(t,n,0,"Conversation not found",Date.now()-o),[Z3e(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}`),X3e(t,n,0,"No turns to compress",Date.now()-o),[Z3e(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}`),X3e(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[Z3e(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(el).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(wN),y=new ak(A,t),E=l.currentPartitionId;await s.notifyCompressionStarted({conversationId:n,partitionId:E,reason:"manual"});let _=await y.compressCurrentPartition(l,m,e);if(_.success){let v=l.turns[0],b=typeof v?.request?.message=="string"?v.request.message:"",T=Date.now()-o;ot.debug(t,`Manual compression completed: conversationId=${n}, archivedPartitionId=${_.archivedPartitionId}, newPartitionId=${_.newPartitionId}, turnCount=${u}, summaryLength=${b.length}, durationMs=${T}`);let w;try{w=new jq().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:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryLength:b.length,turnCount:u,durationMs:T,contextInfo:w}),KNc(t,n,_.archivedPartitionId,_.newPartitionId,u,b.length,T,m.modelId),[{success:!0,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryContent:b,summaryLength:b.length,turnCount:u,contextInfo:w},null]}else{let v=_.error||"Compression failed",b=Date.now()-o;return ot.warn(t,`Manual compression failed: conversationId=${n}, error=${v}`),X3e(t,n,_.archivedPartitionId,v,b,m.modelId),[{success:!1,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.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}`),X3e(t,n,0,l,u),[Z3e(n,`Compression failed: ${l}`),null]}}a(zNc,"handleConversationCompressChecked");function Z3e(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(Z3e,"createErrorResult");function YNc(t,e,r,n){let o=Wt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});Et(t,"conversationPartition.manualCompression.started",o,0)}a(YNc,"sendStartedTelemetry");function KNc(t,e,r,n,o,s,c,l){let u=Wt.createAndMarkAsIssued({conversationId:e,archivedPartitionId:String(r),newPartitionId:String(n),success:"true",...l?{modelId:l}:{}},{turnCount:o,summaryLength:s,durationMs:c});Et(t,"conversationPartition.manualCompression.completed",u,0)}a(KNc,"sendCompletedTelemetry");function X3e(t,e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});Et(t,"conversationPartition.manualCompression.failed",c,0)}a(X3e,"sendFailedTelemetry");var UGi=Oe(WNc,zNc);p();p();var YSt=S.Array(Sf);function KSt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(KSt,"resolveAsActiveEditor");p();var QGi=de(Xc());var JSt=new QGi.ProgressType,VBr=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new jq}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(ar).connection.sendProgress(JSt,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(ar).connection.sendProgress(JSt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(ar).connection.sendProgress(JSt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(ar).connection.sendProgress(JSt,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 g_e(t){return new VBr(t.workDoneToken)}a(g_e,"createProgressHandler");p();var qGi=de(Xc());var A_e=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 qGi.ResponseError(Ze.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function ZSt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:Ji(t.uri)}]}a(ZSt,"resolveAsWorkspaceFolders");p();p();var JNc=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),i_=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?JNc(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 RN=class{constructor(){this.tokens=new Cn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new Fn.CancellationTokenSource,o=new i_([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 jGi(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(jGi,"calculateBillingMultiplier");async function XSt(t,e){let r=e,n=e.modelInfo?.id;if(!n&&r.model&&(n=r.modelProviderName?r.model:await wo.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(XSt,"resolveTurnModelInfo");function eTt(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:jGi(r)}}a(eTt,"buildTurnSummary");p();function tTt(t,e,r,n,o,s){let{properties:c,measurements:l}=XNc(e,r,n,o,s),u=ZNc(e,r,n,o,s);Et(t,"conversation.turnCompleted",Wt.createAndMarkAsIssued(u)),At(t,"conversation.turnCompleted",c,l)}a(tTt,"sendTurnTelemetry");function ZNc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};return ck(s,"chatMode",n.chatMode),ck(s,"conversationSource",o?.conversationSource),s}a(ZNc,"buildGithubTurnTelemetryProperties");function XNc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};ck(s,"modelName",n.modelName),ck(s,"modelProviderName",n.modelProviderName),ck(s,"userRequestedModel",n.userRequestedModel),ck(s,"reasoningEffort",n.reasoningEffort),ck(s,"chatMode",n.chatMode),ck(s,"agentSlug",n.agentSlug),ck(s,"conversationSource",o?.conversationSource);let c={};return ck(c,"billingMultiplier",n.billingMultiplier),ck(c,"credits",o?.credits),ck(c,"totalTimeMs",o?.totalTimeMs),{properties:s,measurements:c}}a(XNc,"buildTurnTelemetryData");function rTt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(rTt,"formatCredits");function ck(t,e,r){r!==void 0&&(t[e]=r)}a(ck,"assignDefined");var eMc=S.Object({conversationId:S.Optional(yJe),workDoneToken:S.Union([S.String(),S.Number()]),turns:S.Array(YCn,{minItems:1}),capabilities:S.Optional(S.Object({allSkills:S.Optional(S.Boolean()),skills:S.Optional(S.Array(S.String()))})),doc:S.Optional(jC),textDocument:S.Optional(jC),selection:S.Optional(Sf),visibleRanges:S.Optional(YSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(OO)),source:S.Optional(LO),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),ignoredSkills:S.Optional(S.Array(S.String())),userLanguage:S.Optional(S.String()),model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(CJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),todoList:S.Optional(S.Array(bJe)),restoreToTurnId:S.Optional(S.String())});async function tMc(t,e,r){A_e.validate(r.workspaceFolders);let n=await FL(t,r,e),o=await t.get(Yo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(m0).setTodos(o,r.todoList);let s=await XSt(t,r),c=o.turns.length>0?r.turns.slice(-1):r.turns;await rMc(t,o,{...r,turns:c},s.id,n);let l=o.turns[o.turns.length-1],u=g_e(r),d=t.get(RN).add(u.progressToken,e),f=new mw(t,o,l,d),h=await t.get(kN).createProcessor(f,u.progressToken,r.computeSuggestions),m=t.get(Au),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 E=Math.round(performance.now()-y),_=eTt(l,s);return tTt(t,"conversation/create",o,l,_,{totalTimeMs:E,credits:A,conversationSource:o.source}),[{conversationId:o.id,turnId:l.id,agentSlug:_.agentSlug,modelName:_.modelName,modelProviderName:_.modelProviderName,billingMultiplier:_.billingMultiplier,modelInfo:r.modelInfo,credits:rTt(A),preciseCredits:A},null]}a(tMc,"handleConversationCreateChecked");async function rMc(t,e,r,n,o){for(let s of r.turns){let c=_Je(s.request),l=new Xf({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:ZSt(u),f=t.get(j_),h=jQ(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=s.model??n,l.needToolCallConfirmation=r.needToolCallConfirmation;let m=KSt({textDocument:o,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(Yo).addTurn(e.id,l,r.references,m,u,d,r.ignoredSkills,void 0)}}a(rMc,"addTurns");var HGi=Oe(eMc,tMc);p();var nMc=S.Object({conversationId:S.String()});function iMc(t,e,r){return t.get(Yo).destroy(r.conversationId),["OK",null]}a(iMc,"handleConversationDestroyChecked");var GGi=Oe(nMc,iMc);p();var oMc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function sMc(t,e,r){return[(await t.get(j_).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(sMc,"handleConversationModesChecked");var $Gi=Oe(oMc,sMc);p();var aMc=S.Object({turnId:S.String(),acceptedFileCount:S.Number({minimum:0}),totalFileCount:S.Number({minimum:1})}),cMc=new fe("conversationNotifyCodeAcceptance");async function lMc(t,e,r){let n=t.get(Yo).findByTurnId(r.turnId);if(!n)return cMc.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await tl(t,n,{languageId:""});return $S(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${aE("agentPanel")}.codeAcceptance`,o),["OK",null]}a(lMc,"handleConversationNotifyCodeAcceptanceChecked");var VGi=Oe(aMc,lMc);p();var uMc=S.Object({});function dMc(t,e,r){return[{path:t.get(ri).directory},null]}a(dMc,"handleConversationPersistenceChecked");var WGi=Oe(uMc,dMc);p();p();var WBr=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Ur).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},zBr=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Qt).getToken()).envelope.chat_enabled?"ok":"failed"}}},fMc=[new WBr,new zBr],lk=class{constructor(e,r=fMc){this.ctx=e;this.checks=r;this.emitter=new Wi;this.onChange=this.emitter.event;bs(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 pMc=S.Object({forceCheck:S.Optional(S.Boolean())});async function hMc(t,e,r){let n=r.forceCheck??!1;return[await t.get(lk).check(n),null]}a(hMc,"handleConversationPreconditionsChecked");var zGi=Oe(pMc,hMc);p();var mMc=S.Object({turnId:S.Optional(S.String()),rating:S.Number(),doc:S.Optional(jC),textDocument:S.Optional(jC),source:S.Optional(LO)});async function gMc(t,e,r){let n=await FL(t,r,e),o=iq(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await tl(t,r.turnId?t.get(Yo).findByTurnId(r.turnId):void 0,{languageId:n?.detectedLanguageId??""}),l=`${aE(o)}.messageRating`,u=$S(t,n,{rating:s,uiKind:o},{},l,c);return ex(t,l,u),["OK",null]}a(gMc,"handleConversationRatingChecked");var YGi=Oe(mMc,gMc);p();var AMc=S.Object({tools:S.Array(KCn)});function yMc(t,e,r){let n=t.get(gs);return r.tools.forEach(s=>{n.registerTool(new ej({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(yMc,"conversationRegisterToolsChecked");var KGi=Oe(AMc,yMc);p();var EMc=S.Object({workspaceFolders:S.Optional(S.Array(Bc)),providers:S.Optional(S.Array(S.Enum(x3)))});async function _Mc(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=C$t(t).map(h=>({id:h.id,description:h.description,shortDescription:h.shortDescription,scopes:h.scopes,source:"builtin",providers:["LOCAL"]})).filter(s),l=t.get(Cg),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"]:vMc(h.mode),source:"prompt",mode:h.mode,model:h.model,providers:QS(m,h.providers)}}).filter(s);if(c.push(...f),r.workspaceFolders&&r.workspaceFolders.length>0){let g=(await t.get(h0).listSkills(r.workspaceFolders,{includePlugins:o})).map(A=>({id:`skill:${Ji(uf(A.uri))}`,description:A.description||"",shortDescription:A.name,scopes:["agent-panel"],source:"skill",providers:QS(A.pluginUri!==void 0,A.providers)})).filter(s).filter(A=>!c.some(y=>y.id===A.id));c.push(...g)}return[c,null]}a(_Mc,"handleConversationTemplatesChecked");function vMc(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(vMc,"getCustomPromptScopes");var JGi=Oe(EMc,_Mc);p();var CMc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),conversationId:yJe,turnId:S.Optional(WK),message:Nqt,followUp:S.Optional(S.Object({id:S.String(),type:S.String()})),doc:S.Optional(jC),textDocument:S.Optional(jC),selection:S.Optional(Sf),visibleRanges:S.Optional(YSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(OO)),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),ignoredSkills:S.Optional(S.Array(S.String())),confirmationResponse:Oyn,model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(CJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),agentSlug:S.Optional(S.String()),todoList:S.Optional(S.Array(bJe))});async function bMc(t,e,r){A_e.validate(r.workspaceFolders);let n=await FL(t,r,e),o=t.get(Yo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(m0).setTodos(s,r.todoList);let c=_Je(r.message),l=new Xf({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:ZSt(u),f=await XSt(t,r),h=t.get(j_),m=jQ(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=KSt({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=g_e(r),y=t.get(RN).add(A.progressToken,e),E=new mw(t,s,l,y),_=await t.get(kN).createProcessor(E,A.progressToken,r.computeSuggestions),v=t.get(Au),b=String(l.id);v.resetTurnCredits(b);let T,w=performance.now();try{await _.process(A,y,r.followUp,n,f),T=v.getCreditsForTurn(b)}finally{v.resetTurnCredits(b)}let R=Math.round(performance.now()-w),x=eTt(l,f);return tTt(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:rTt(T),preciseCredits:T},null]}a(bMc,"handleConversationTurnChecked");var ZGi=Oe(CMc,bMc);p();var SMc=S.Object({conversationId:S.String(),turnId:S.String(),source:S.Optional(LO)});async function TMc(t,e,r){t.get(Yo).deleteTurn(r.conversationId,r.turnId);let o=iq(r.source),s=await tl(t,t.get(Yo).findByTurnId(r.turnId),{languageId:""});return $S(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${aE(o)}.messageDelete`,s),["OK",null]}a(TMc,"handleConversationTurnDeleteChecked");var XGi=Oe(SMc,TMc);p();var IMc=S.Object({toolIds:S.Array(S.String())});function xMc(t,e,r){let n=t.get(gs);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(xMc,"conversationUnregisterToolsChecked");var e$i=Oe(IMc,xMc);p();var wMc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),tools:S.Array(S.Object({name:S.String(),status:S.Enum(D3)}))});async function RMc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(j_).getChatMode(n?jQ(n):"Agent",o,s),l=t.get(gs),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(RMc,"conversationUpdateToolsStatusChecked");var t$i=Oe(wMc,RMc);p();p();Oo();var kMc=5e3,Rie=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 @@ -4047,16 +4047,16 @@ 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 Fn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),SMc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new oc(e),u=await xo.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Qt).getToken(),h=await e.get(Zt).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:OA.user("conversation-panel",Mt())},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}`),At(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var TMc=S.Object({thinkingContent:S.Optional(S.String()),extractedTitles:S.Optional(S.Array(S.String()))});async function IMc(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(Rie).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(IMc,"handleThinkingTitleGenerateChecked");var ZGi=Oe(TMc,IMc);p();p();p();var rTt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var A_e=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(rTt,"")}static extractSuggestionAndText(e){rTt.lastIndex=0;let n=rTt.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 Fn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),kMc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new oc(e),u=await wo.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Qt).getToken(),h=await e.get(Zt).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:OA.user("conversation-panel",Mt())},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}`),At(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var PMc=S.Object({thinkingContent:S.Optional(S.String()),extractedTitles:S.Optional(S.Array(S.String()))});async function DMc(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(Rie).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(DMc,"handleThinkingTitleGenerateChecked");var r$i=Oe(PMc,DMc);p();p();p();var nTt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var y_e=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(nTt,"")}static extractSuggestionAndText(e){nTt.lastIndex=0;let n=nTt.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 nTt=require("path");var y_e=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=tx(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=i0(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=yl();try{return await HW(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=M3(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=yl()-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(Gm(d))throw d;let f=yl()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{tYe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,nTt.basename)(e,(0,nTt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(bf).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();Mo();var E_e=class t{constructor(e,r={}){this.ctx=e;this.id=Mt(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return Wt.createAndMarkAsIssued(r)}telemetrySent(){Et(this.ctx,"request.sent",this.telemetryData),At(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){Et(this.ctx,"request.response",this.telemetryData),At(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(Wh(e,"name")??""),this.telemetryData.properties.code=String(Wh(e,"code")??""),this.telemetryData.properties.errno=String(Wh(e,"errno")??""),this.telemetryData.properties.type=String(Wh(e,"type")??""),Et(this.ctx,"request.error",this.telemetryData),At(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var iTt=class t extends y_e{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new E_e(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(nc),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 xMc=S.Object({uri:S.String(),path:S.String(),baseContent:S.String(),headContent:S.String()}),wMc=S.Object({changes:S.Array(xMc),workspaceFolders:S.Optional(S.Array(Bc))}),Z3e;async function RMc(t,e,r){Z3e&&(Z3e.cancel(),Z3e.dispose()),Z3e=new Fn.CancellationTokenSource;let n=new i_([e,Z3e.token]),o=new iTt(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."}]:(Nr.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:A_e.parseReviewResponse(u,d)},null]}a(RMc,"handleCopilotCodeReviewReviewChangesChecked");var XGi=Oe(wMc,RMc);p();p();var oTt=class t extends y_e{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new E_e(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(nc),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 kMc=S.Object({uri:S.String(),path:S.String(),content:S.String(),startLine:S.Number(),endLine:S.Number()}),PMc=S.Object({snippets:S.Array(kMc),workspaceFolders:S.Optional(S.Array(Bc))}),X3e;async function DMc(t,e,r){X3e&&(X3e.cancel(),X3e.dispose()),X3e=new Fn.CancellationTokenSource;let n=new i_([e,X3e.token]),o=new oTt(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:A_e.parseReviewResponse(u,d)},null]}a(DMc,"handleCopilotCodeReviewReviewSnippetsChecked");var e$i=Oe(PMc,DMc);p();p();var sTt=Symbol("onMCPToolsListChanged"),aTt=Symbol("onMCPResourcesListChanged"),cTt=Symbol("onMCPPromptsListChanged"),t$i=Symbol("onMCPResourceUpdated"),FV=Symbol("onMCPCacheUpdated");function eFe(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(eFe,"normalizeMcpHeaders");var o_=class{static{a(this,"McpManager")}};var NMc=S.Object({}),MMc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),servers:S.Array(S.Object({name:S.String(),tools:S.Array(S.Object({name:S.String(),status:S.Enum(P3)}))}))}),OMc=S.Object({serverName:S.String(),promptName:S.String(),arguments:S.Optional(S.Record(S.String(),S.String()))}),LMc=S.Object({serverName:S.String(),promptName:S.String(),argumentName:S.String(),prefix:S.String(),alreadyResolved:S.Optional(S.Record(S.String(),S.String()))}),BMc=S.Object({serverName:S.String(),uri:S.String()}),FMc=S.Object({serverName:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});function UMc(t,e,r){return[t.get(o_).getAllContents(),null]}a(UMc,"handleGetMCPContentsChecked");async function QMc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(j_).getChatMode(n?qQ(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(o_).updateMCPToolsStatus(c,l),[t.get(o_).getAllContents(c),null]}a(QMc,"handleUpdateMCPToolsStatusChecked");async function qMc(t,e,r){return[await t.get(o_).readResource(r.serverName,r.uri),null]}a(qMc,"handleReadResourceChecked");async function jMc(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(o_).getPrompt(n,o,s),null]}a(jMc,"handleGetPromptChecked");async function HMc(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(o_).completePrompt(n,o,s,c,l),null]}a(HMc,"handleCompletePromptChecked");async function GMc(t,e,r){let n=t.get(o_),{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(GMc,"handleMCPServerActionChecked");var r$i=Oe(NMc,UMc),n$i=Oe(MMc,QMc),i$i=Oe(BMc,qMc),o$i=Oe(OMc,jMc),s$i=Oe(LMc,HMc),a$i=Oe(FMc,GMc);p();var $Mc=S.Object({});async function VMc(t,e,r){let n=await t.get(Qt).getToken();return[KMc(t,await t.get(xs).getMetadata(),n),null]}a(VMc,"handleCopilotModelsChecked");function WMc(t){return(t.capabilities.supports?.reasoning_effort?.length??0)<=1?!1:t.supported_endpoints?.includes(x$e.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!0}a(WMc,"supportReasoningEffortLevel");function zMc(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!sle.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(zMc,"getModelScopes");function YMc(t){return t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(YMc,"shouldExposeModel");function KMc(t,e,r){let n=[];return e.forEach(o=>{YMc(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:zMc(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:WMc(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,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,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}: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:xun(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(jl).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:V_,modelName:oKe,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:V_,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(KMc,"filterModels");var c$i=Oe($Mc,VMc);p();var JMc=S.Object({});async function ZMc(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(xs).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(ZMc,"handleCopilotModelsGetModelMetadataListChecked");var l$i=Oe(JMc,ZMc);p();var XMc=S.Object({model:S.Optional(S.String()),status:S.Optional(S.String())});async function eOc(t,e,r){return r.model&&r.status==="enabled"?await t.get(xs).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(eOc,"handleCopilotModelsPolicyChecked");var u$i=Oe(XMc,eOc);p();p();p();p();Mo();function tOc(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(tOc,"panelPositionForDocument");async function*d$i(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(d$i,"trimChoices");var __e=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=tOc(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function zBr(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await zBr(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(zBr,"reportSolutions");async function YBr(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:YBr(t,e)}}a(YBr,"generateSolutionsStream");function lTt(t){return t.replace(/\s+/g,"")}a(lTt,"normalizeCompletionText");async function f$i(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=gQ(t,l.uri),d=Mt(),f=Wt.createAndMarkAsIssued({headerRequestId:d,languageId:l.detectedLanguageId,source:r},{});e.savedTelemetryData=await t.get(Zt).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 Rme(t,d,pee(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=gu.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{...Ese(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),Et(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(f$i,"setupPromptAndTelemetry");function p$i(t,e,r,n,o,s){let c=t.get(TP).forLanguage(t,e.detectedLanguageId,s),l=kS(e.detectedLanguageId),u=Jlt(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 iTt=require("path");var E_e=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=nx(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=i0(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=yl();try{return await GW(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=O3(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=yl()-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(Gm(d))throw d;let f=yl()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{nYe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,iTt.basename)(e,(0,iTt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(bf).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();Oo();var __e=class t{constructor(e,r={}){this.ctx=e;this.id=Mt(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return Wt.createAndMarkAsIssued(r)}telemetrySent(){Et(this.ctx,"request.sent",this.telemetryData),At(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){Et(this.ctx,"request.response",this.telemetryData),At(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(Wh(e,"name")??""),this.telemetryData.properties.code=String(Wh(e,"code")??""),this.telemetryData.properties.errno=String(Wh(e,"errno")??""),this.telemetryData.properties.type=String(Wh(e,"type")??""),Et(this.ctx,"request.error",this.telemetryData),At(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var oTt=class t extends E_e{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new __e(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(nc),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 NMc=S.Object({uri:S.String(),path:S.String(),baseContent:S.String(),headContent:S.String()}),MMc=S.Object({changes:S.Array(NMc),workspaceFolders:S.Optional(S.Array(Bc))}),eFe;async function OMc(t,e,r){eFe&&(eFe.cancel(),eFe.dispose()),eFe=new Fn.CancellationTokenSource;let n=new i_([e,eFe.token]),o=new oTt(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."}]:(Nr.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:y_e.parseReviewResponse(u,d)},null]}a(OMc,"handleCopilotCodeReviewReviewChangesChecked");var n$i=Oe(MMc,OMc);p();p();var sTt=class t extends E_e{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new __e(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(nc),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 LMc=S.Object({uri:S.String(),path:S.String(),content:S.String(),startLine:S.Number(),endLine:S.Number()}),BMc=S.Object({snippets:S.Array(LMc),workspaceFolders:S.Optional(S.Array(Bc))}),tFe;async function FMc(t,e,r){tFe&&(tFe.cancel(),tFe.dispose()),tFe=new Fn.CancellationTokenSource;let n=new i_([e,tFe.token]),o=new sTt(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:y_e.parseReviewResponse(u,d)},null]}a(FMc,"handleCopilotCodeReviewReviewSnippetsChecked");var i$i=Oe(BMc,FMc);p();p();var aTt=Symbol("onMCPToolsListChanged"),cTt=Symbol("onMCPResourcesListChanged"),lTt=Symbol("onMCPPromptsListChanged"),o$i=Symbol("onMCPResourceUpdated"),UV=Symbol("onMCPCacheUpdated");function rFe(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(rFe,"normalizeMcpHeaders");var o_=class{static{a(this,"McpManager")}};var UMc=S.Object({}),QMc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),servers:S.Array(S.Object({name:S.String(),tools:S.Array(S.Object({name:S.String(),status:S.Enum(D3)}))}))}),qMc=S.Object({serverName:S.String(),promptName:S.String(),arguments:S.Optional(S.Record(S.String(),S.String()))}),jMc=S.Object({serverName:S.String(),promptName:S.String(),argumentName:S.String(),prefix:S.String(),alreadyResolved:S.Optional(S.Record(S.String(),S.String()))}),HMc=S.Object({serverName:S.String(),uri:S.String()}),GMc=S.Object({serverName:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});function $Mc(t,e,r){return[t.get(o_).getAllContents(),null]}a($Mc,"handleGetMCPContentsChecked");async function VMc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(j_).getChatMode(n?jQ(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(o_).updateMCPToolsStatus(c,l),[t.get(o_).getAllContents(c),null]}a(VMc,"handleUpdateMCPToolsStatusChecked");async function WMc(t,e,r){return[await t.get(o_).readResource(r.serverName,r.uri),null]}a(WMc,"handleReadResourceChecked");async function zMc(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(o_).getPrompt(n,o,s),null]}a(zMc,"handleGetPromptChecked");async function YMc(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(o_).completePrompt(n,o,s,c,l),null]}a(YMc,"handleCompletePromptChecked");async function KMc(t,e,r){let n=t.get(o_),{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(KMc,"handleMCPServerActionChecked");var s$i=Oe(UMc,$Mc),a$i=Oe(QMc,VMc),c$i=Oe(HMc,WMc),l$i=Oe(qMc,zMc),u$i=Oe(jMc,YMc),d$i=Oe(GMc,KMc);p();var JMc=S.Object({});async function ZMc(t,e,r){let n=await t.get(Qt).getToken();return[rOc(t,await t.get(xs).getMetadata(),n),null]}a(ZMc,"handleCopilotModelsChecked");function XMc(t){return(t.capabilities.supports?.reasoning_effort?.length??0)<=1?!1:t.supported_endpoints?.includes(R$e.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!0}a(XMc,"supportReasoningEffortLevel");function eOc(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!sle.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(eOc,"getModelScopes");function tOc(t){return t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(tOc,"shouldExposeModel");function rOc(t,e,r){let n=[];return e.forEach(o=>{tOc(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:eOc(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:XMc(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,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,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}: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:wun(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(jl).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:W_,modelName:cKe,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:W_,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(rOc,"filterModels");var f$i=Oe(JMc,ZMc);p();var nOc=S.Object({});async function iOc(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(xs).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(iOc,"handleCopilotModelsGetModelMetadataListChecked");var p$i=Oe(nOc,iOc);p();var oOc=S.Object({model:S.Optional(S.String()),status:S.Optional(S.String())});async function sOc(t,e,r){return r.model&&r.status==="enabled"?await t.get(xs).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(sOc,"handleCopilotModelsPolicyChecked");var h$i=Oe(oOc,sOc);p();p();p();p();Oo();function aOc(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(aOc,"panelPositionForDocument");async function*m$i(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(m$i,"trimChoices");var v_e=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=aOc(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function YBr(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await YBr(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(YBr,"reportSolutions");async function KBr(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:KBr(t,e)}}a(KBr,"generateSolutionsStream");function uTt(t){return t.replace(/\s+/g,"")}a(uTt,"normalizeCompletionText");async function g$i(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=AQ(t,l.uri),d=Mt(),f=Wt.createAndMarkAsIssued({headerRequestId:d,languageId:l.detectedLanguageId,source:r},{});e.savedTelemetryData=await t.get(Zt).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 kme(t,d,pee(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=gu.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{...Ese(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),Et(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(g$i,"setupPromptAndTelemetry");function A$i(t,e,r,n,o,s){let c=t.get(IP).forLanguage(t,e.detectedLanguageId,s),l=PS(e.detectedLanguageId),u=Zlt(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=mQ(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?lNe(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?lNe(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a(p$i,"setupCompletionParams");var KBr=new fe("solutions");async function rOc(t,e){let r=e.targetPosition,n=e.textDocument,o=await f$i(t,e,"open copilot",KBr);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}=p$i(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},E=await t.get(AO).fetchAndStreamCompletions(t,y,l.extendedBy(),m,A);if(E.type==="failed"||E.type==="canceled")return{status:"FinishedWithError",error:`${E.type}: ${E.reason}`};let _=E.choices;_=d$i(_),_=ixe(_,T=>MNe(t,n,r,T,!1,KBr));let v=ixe(_,async T=>{let w=T.completionText;KBr.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await XXn(t,n,r,T.completionText)??gu.position(r.line,0),[x]=FH(n.getText(gu.range(R,r)));w=x+w;let P=T.completionText;c.length>0&&P.startsWith(c)&&(P=P.substring(c.length));let D=T.meanLogProb,N=D!==void 0?Math.exp(D):0,L=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:P,insertText:w,range:gu.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:L,copilotAnnotations:T.copilotAnnotations}});return YBr(A,v[Symbol.asyncIterator]())}a(rOc,"launchSolutions");async function uTt(t,e,r){return t.get(ps).trackCompletionJob(async()=>{let o=rOc(t,e);return await zBr(o,r)})}a(uTt,"runSolutions");var m$i=de(dU()),rFe=de(Xc());p();Mo();p();function dTt(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(dTt,"parseChallengeDoc");var nOc=S.Object({text:S.String(),score:S.Number()}),iOc=S.Object({documents:S.Array(nOc),options:S.Optional(S.Object({}))});async function fTt(t,e,r){let n=Mt();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:JI.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(fTt,"runTestSolutions");var kN=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function oOc(t,e,r){return t.forceSet(kN,new kN(r.documents)),["OK",null]}a(oOc,"handleTestingSetPanelCompletionDocumentsChecked");var h$i=Oe(iOc,oOc);var g$i=TKe.type;function sOc(t,e,r,n,o){let s=lTt(n.completionText),c=(0,m$i.SHA256)(s).toString();return t.get(Ru).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:P4r,title:`Accept completion ${o}`,arguments:[c]}}}a(sOc,"makeCompletion");function ZBr(t,e){return`${t}/${e}`}a(ZBr,"progressMessage");var JBr=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(ar)}async onSolution(e){this.count+=1;let r=sOc(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(rFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:ZBr(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return aOc(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(rFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function aOc(t,e,r=0){t!==void 0&&await e.connection.sendProgress(rFe.WorkDoneProgress.type,t,{kind:"end",message:ZBr(r,10)})}a(aOc,"reportDone");var tFe;async function cOc(t,e,r){let n=await P9(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(ar).connection.sendProgress(rFe.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:ZBr(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(ar).connection.sendProgress(TKe.partialResult,l,{items:[f]})},"onCompletion"));let u=new JBr(t,r,c),d=t.get(kN);if(d.documents){let f=d.documents;await fTt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new __e(n,o,e,10);await uTt(t,f,u)}return u.error!==void 0?[null,{code:Ze.InternalError,message:u.error}]:[{items:s},null]}a(cOc,"handleChecked");async function lOc(t,e,r){tFe&&(tFe.cancel(),tFe.dispose()),tFe=new Fn.CancellationTokenSource;let n=tFe.token,o=new i_([e,n]);try{return await cOc(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(lOc,"handleCheckedWithAbort");var A$i=Oe(wvn,lOc);p();var dOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function fOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Ld).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:cO(c.pluginUri!==void 0,c.providers)}}),null]}a(fOc,"listCustomAgents");var y$i=Oe(dOc,fOc);p();var pOc=new fe("customAgent/registerExtensionAgents"),hOc=S.Object({uri:S.String(),name:S.String(),description:S.String()}),mOc=S.Object({extensionId:S.String(),agents:S.Array(hOc)});function gOc(t,e,r){try{t.get(Ld).registerExtensionAgent(r.extensionId,r.agents)}catch(n){pOc.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(gOc,"registerExtensionAgents");var E$i=Oe(mOc,gOc);p();var AOc=S.Object({extensionId:S.String()});function yOc(t,e,r){return t.get(Ld).unregisterExtensionAgents(r.extensionId),[null,null]}a(yOc,"unregisterExtensionAgents");var _$i=Oe(AOc,yOc);p();var EOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function _Oc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(bf).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:cO(c.pluginUri!==void 0,c.providers)})),null]}a(_Oc,"listCustomInstructions");var v$i=Oe(EOc,_Oc);p();var vOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function COc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Cg).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:cO(c.pluginUri!==void 0,c.providers)}}),null]}a(COc,"listCustomPrompts");var C$i=Oe(vOc,COc);p();var bOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function SOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(h0).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:cO(c.pluginUri!==void 0,c.providers)})),null]}a(SOc,"listCustomSkills");var b$i=Oe(bOc,SOc);p();p();p();function TOc(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get($m).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(TOc,"urlsToCheck");async function S$i(t,e,r=bB(t),n,o){let s=TOc(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await IOc(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(S$i,"checkReachability");async function IOc(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(IOc,"determineReachability");var SI=de(require("os")),v_e=de(require("tls"));async function I$i(t,e){let r=await t.get(tr).getImplementation(),n=await t.get(Qt).getGitHubSession(),o=await t.get(Qt).getToken().catch(()=>{});return{sections:[wOc(t),xOc(t,n),ROc(t,r),await kOc(t,r,o?.endpoints,n,e)]}}a(I$i,"collectDiagnostics");function x$i(t){return t.sections.map(POc).join(SI.EOL+SI.EOL)+SI.EOL}a(x$i,"formatDiagnosticsAsMarkdown");function xOc(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:V1(t),"GitHub Account":n,"Session ID":t.get(Ua).sessionId,"Send Restricted Telemetry":_se(t)?"enabled":"disabled","Content Exclusion":t.get(nc).enabled?"enabled":"unavailable"}}}a(xOc,"collectCopilotSection");function wOc(t){let e={Plugin:NOc(t),Editor:DOc(t),"Operating System":`${SI.type()} ${SI.release()} (${SI.arch()})`};return UL(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(wOc,"collectEnvironmentSection");function ROc(t,e){let r=t.get(Lo).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":v_e.rootCertificates.length,"TLS Default Min Version":v_e.DEFAULT_MIN_VERSION,"TLS Default Max Version":v_e.DEFAULT_MAX_VERSION};return UL(n,"http_proxy"),UL(n,"https_proxy"),UL(n,"no_proxy"),UL(n,"SSL_CERT_FILE"),UL(n,"SSL_CERT_DIR"),UL(n,"OPENSSL_CONF"),UL(n,"NODE_EXTRA_CA_CERTS"),UL(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(ROc,"collectNetworkConfigSection");async function kOc(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await S$i(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(kOc,"collectReachabilitySection");function T$i(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(T$i,"quoteCode");function UL(t,e){let r=process.env[e];r&&(t[T$i(e)]=T$i(r)),r!==process.env[e.toUpperCase()]&&UL(t,e.toUpperCase())}a(UL,"addEnvironmentVariable");function POc(t){return`## ${t.name}`+SI.EOL+SI.EOL+Object.keys(t.items).filter(e=>e!=="name").map(e=>`- ${e}: ${t.items[e]??"N/A"}`).join(SI.EOL)}a(POc,"formatSectionAsMarkdown");function DOc(t){let e=t.get(Ir).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(DOc,"getEditorDisplayVersion");function NOc(t){let e=t.get(Ir).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(NOc,"getPluginDisplayVersion");var MOc=S.Object({});async function OOc(t,e){return[{report:x$i(await I$i(t,e))},null]}a(OOc,"handleDiagnosticsChecked");var w$i=Oe(MOc,OOc);p();var LOc=S.Object({conversationId:S.String(),sessionTitle:S.Optional(S.String())});async function BOc(t,e,r){let o=await t.get(pv).readSpans(r.conversationId),s=JGn(o,{conversationId:r.conversationId,sessionTitle:r.sessionTitle});return[{content:JSON.stringify(s,null,2)},null]}a(BOc,"handleExportAgentDebugLogChecked");var R$i=Oe(LOc,BOc);p();var FOc=S.Object({conversationId:S.String()});async function UOc(t,e,r){return[{spans:await t.get(pv).readSpans(r.conversationId)},null]}a(UOc,"handleGetAgentDebugLogChecked");var k$i=Oe(FOc,UOc);p();Mo();var L$i=de(Xc());p();var P$i=require("crypto");var C_e=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new e3r(e,this.id)}},e3r=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(ar),s=(0,P$i.randomUUID)(),c=o.connection.onProgress(bKe.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(bKe.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 pTt(t,e,r){try{let n=t.get(hm),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 C_e&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof C_e&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Nr.error(t,"Failed to set context items on context providers",n)}}a(pTt,"setContextItems");var XBr={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function D$i(t,e,r){return e.map(o=>{try{if(typeof o=="string")return vf(r.uri,o,XBr);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=vf(r.uri,o.scheme||"",XBr)),"pattern"in o&&(s&&=vf(r.uri,o.pattern||"",XBr)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(D$i,"match");p();var QOc=S.Object({documents:S.Array(S.String()),basename:S.Optional(S.String()),options:S.Optional(S.Object({}))}),QV=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function qOc(t,e,r){return t.forceSet(QV,new QV(r.documents,r.basename||"")),["OK",null]}a(qOc,"handleTestingSetCompletionDocumentsChecked");var N$i=new fe("setCompletionDocuments"),O$i=Oe(QOc,qOc);function hTt(t,e,r,n){let o=t.get(QV);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){N$i.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=jOc(o,r);return c&&c.length>0?M$i(c,s,e):void 0}else return N$i.debug(t,"Returning completions for all pre-set documents"),M$i(o.documents,s,e)}}a(hTt,"getTestCompletions");function M$i(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=dTt(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(M$i,"sliceAndMapCompletions");function jOc(t,e){return t.basename===Ji(e)?t.documents||[]:[]}a(jOc,"getFilteredDocs");var B$i=S.Object({doc:S.Object({position:c0,insertSpaces:S.Optional(S.Boolean()),tabSize:S.Optional(S.Number()),uri:Nxe,version:S.Number()}),contextItems:S.Optional(Lfr)}),nFe;async function F$i(t,e,r,n){nFe&&(nFe.cancel(),nFe.dispose()),nFe=new Fn.CancellationTokenSource;let o=new i_([e,nFe.token]);r.contextItems&&pTt(t,r.contextItems);let s=hTt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:Mt(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await P9(t,r.doc,o)}catch(h){if(!(h instanceof L$i.ResponseError))throw h;switch(h.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position,u=await t.get(ry).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(Ru);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(F$i,"handleGetCompletionsHelper");var U$i=Oe(B$i,(t,e,r)=>F$i(t,e,r,!1)),Q$i=Oe(B$i,(t,e,r)=>F$i(t,e,r,!0));p();var HOc=S.Object({});function GOc(t,e,r){return[{defaultRules:t.get(mw).getDefaultRules()},null]}a(GOc,"handleGetDefaultFileSafetyRulesChecked");var q$i=Oe(HOc,GOc);p();var j$i=de(dU()),b_e=de(Xc());var $Oc=S.Object({doc:S.Object({position:c0,uri:Nxe,version:S.Number()}),panelId:S.String()});function VOc(t,e,r,n,o){let s=lTt(o.completionText),c=(0,j$i.SHA256)(s).toString();return t.get(Ru).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(VOc,"makeSolution");var t3r=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(ar)}onSolution(e){return this.service.connection.sendNotification(new b_e.NotificationType("PanelSolution"),VOc(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return H$i(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new b_e.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function H$i(t,e){return e.connection.sendNotification(new b_e.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(H$i,"reportDone");var iFe;async function WOc(t,e,r){iFe&&(iFe.cancel(),iFe.dispose()),iFe=new Fn.CancellationTokenSource;let n=new i_([e,iFe.token]),o=r.doc.position,s=gu.range(o,o),c=new t3r(t,r,s),l=t.get(kN);if(l.documents){let u=l.documents;fTt(o,u,c)}else{let u;try{u=await P9(t,r.doc,n)}catch(f){if(!(f instanceof b_e.ResponseError))throw f;switch(f.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return zOc(t,r)}throw f}c.offset=u.offsetAt(o);let d=new __e(u,o,n,10);uTt(t,d,c)}return[{solutionCountTarget:10},null]}a(WOc,"handleGetPanelCompletionsChecked");async function zOc(t,e){return await H$i(e.panelId,t.get(ar)),[{solutionCountTarget:0},null]}a(zOc,"produceEmptySolutions");var G$i=Oe($Oc,WOc);p();var YOc=S.Object({});async function KOc(t,e,r){let o=(await t.get(Qt).getToken()).userInfo,s=o.raw,l=(await t.get(Ur).resolveSession())?.login;return!s||!l?[null,null]:[{userName:l,copilotPlan:o.copilotPlan,rawUserInfo:s},null]}a(KOc,"handleGetUserInfoChecked");var $$i=Oe(YOc,KOc);p();var JOc=S.Object({});function ZOc(t,e,r){return[{version:t.get(ds).getDisplayVersion(),buildType:MU(t),runtimeVersion:`node/${process.versions.node}`},null]}a(ZOc,"handleGetVersionChecked");var V$i=Oe(JOc,ZOc);p();Mo();var XOc=S.Object({changes:S.Array(S.String()),userCommits:S.Array(S.String()),recentCommits:S.Array(S.String()),workspaceFolder:S.Optional(S.String()),userLanguage:S.Optional(S.String())});async function e5c(t,e,r){if(r.changes.length===0)return[null,{code:Ze.InvalidRequest,message:"No changes provided"}];let n=t.get(zo),o=n.create({capabilities:{skills:[MO]}}),s=new Xf({message:"",type:"user"});await n.addTurn(o.id,s);let c=m_e({workDoneToken:Mt()});await t.get(Tc).begin(o,s,c);let d=(await new hw(t,o,s,e).skillResolver.resolve(MO))?.head?.name,h=await t.get(HX).generateCommitMessage(t,e,r,d);return h==null?[null,{code:Ze.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(e5c,"handleGitCommitGenerateChecked");var W$i=Oe(XOc,e5c);p();var t5c=S.Object({repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),pullRequestNumber:S.Number()});async function r5c(t,e,r){try{let o=await new Zh(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return Et(t,"githubApi.listPullRequestChangedFiles",Wt.createAndMarkAsIssued()),At(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(qa(t,n,"githubApi.listPullRequestChangedFiles"),Vn(t,"githubApi.listPullRequestChangedFiles",n),n instanceof uE)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(r5c,"handleListPullRequestChangedFilesChecked");var z$i=Oe(t5c,r5c);p();p();var mTt=new fe("GitHubGraphQLClient"),gTt=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(tr);return this.graphqlClient=ECn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){mTt.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++,mTt.debug(this.ctx,`Fetching page ${c} of pull requests search results`);let u=await r(` +`]);let h=gQ(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?dNe(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?dNe(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a(A$i,"setupCompletionParams");var JBr=new fe("solutions");async function cOc(t,e){let r=e.targetPosition,n=e.textDocument,o=await g$i(t,e,"open copilot",JBr);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}=A$i(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},E=await t.get(AO).fetchAndStreamCompletions(t,y,l.extendedBy(),m,A);if(E.type==="failed"||E.type==="canceled")return{status:"FinishedWithError",error:`${E.type}: ${E.reason}`};let _=E.choices;_=m$i(_),_=ixe(_,T=>LNe(t,n,r,T,!1,JBr));let v=ixe(_,async T=>{let w=T.completionText;JBr.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await nei(t,n,r,T.completionText)??gu.position(r.line,0),[x]=UH(n.getText(gu.range(R,r)));w=x+w;let P=T.completionText;c.length>0&&P.startsWith(c)&&(P=P.substring(c.length));let D=T.meanLogProb,N=D!==void 0?Math.exp(D):0,L=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:P,insertText:w,range:gu.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:L,copilotAnnotations:T.copilotAnnotations}});return KBr(A,v[Symbol.asyncIterator]())}a(cOc,"launchSolutions");async function dTt(t,e,r){return t.get(ps).trackCompletionJob(async()=>{let o=cOc(t,e);return await YBr(o,r)})}a(dTt,"runSolutions");var E$i=de(fU()),iFe=de(Xc());p();Oo();p();function fTt(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(fTt,"parseChallengeDoc");var lOc=S.Object({text:S.String(),score:S.Number()}),uOc=S.Object({documents:S.Array(lOc),options:S.Optional(S.Object({}))});async function pTt(t,e,r){let n=Mt();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:XI.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(pTt,"runTestSolutions");var PN=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function dOc(t,e,r){return t.forceSet(PN,new PN(r.documents)),["OK",null]}a(dOc,"handleTestingSetPanelCompletionDocumentsChecked");var y$i=Oe(uOc,dOc);var _$i=wKe.type;function fOc(t,e,r,n,o){let s=uTt(n.completionText),c=(0,E$i.SHA256)(s).toString();return t.get(Ru).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:D4r,title:`Accept completion ${o}`,arguments:[c]}}}a(fOc,"makeCompletion");function XBr(t,e){return`${t}/${e}`}a(XBr,"progressMessage");var ZBr=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(ar)}async onSolution(e){this.count+=1;let r=fOc(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(iFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:XBr(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return pOc(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(iFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function pOc(t,e,r=0){t!==void 0&&await e.connection.sendProgress(iFe.WorkDoneProgress.type,t,{kind:"end",message:XBr(r,10)})}a(pOc,"reportDone");var nFe;async function hOc(t,e,r){let n=await D9(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(ar).connection.sendProgress(iFe.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:XBr(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(ar).connection.sendProgress(wKe.partialResult,l,{items:[f]})},"onCompletion"));let u=new ZBr(t,r,c),d=t.get(PN);if(d.documents){let f=d.documents;await pTt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new v_e(n,o,e,10);await dTt(t,f,u)}return u.error!==void 0?[null,{code:Ze.InternalError,message:u.error}]:[{items:s},null]}a(hOc,"handleChecked");async function mOc(t,e,r){nFe&&(nFe.cancel(),nFe.dispose()),nFe=new Fn.CancellationTokenSource;let n=nFe.token,o=new i_([e,n]);try{return await hOc(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(mOc,"handleCheckedWithAbort");var v$i=Oe(Rvn,mOc);p();var AOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function yOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Ld).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:QS(c.pluginUri!==void 0,c.providers)}}),null]}a(yOc,"listCustomAgents");var C$i=Oe(AOc,yOc);p();var EOc=new fe("customAgent/registerExtensionAgents"),_Oc=S.Object({uri:S.String(),name:S.String(),description:S.String()}),vOc=S.Object({extensionId:S.String(),agents:S.Array(_Oc)});function COc(t,e,r){try{t.get(Ld).registerExtensionAgent(r.extensionId,r.agents)}catch(n){EOc.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(COc,"registerExtensionAgents");var b$i=Oe(vOc,COc);p();var bOc=S.Object({extensionId:S.String()});function SOc(t,e,r){return t.get(Ld).unregisterExtensionAgents(r.extensionId),[null,null]}a(SOc,"unregisterExtensionAgents");var S$i=Oe(bOc,SOc);p();var TOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function IOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(bf).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:QS(c.pluginUri!==void 0,c.providers)})),null]}a(IOc,"listCustomInstructions");var T$i=Oe(TOc,IOc);p();var xOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function wOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Cg).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:QS(c.pluginUri!==void 0,c.providers)}}),null]}a(wOc,"listCustomPrompts");var I$i=Oe(xOc,wOc);p();var ROc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function kOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(h0).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:QS(c.pluginUri!==void 0,c.providers)})),null]}a(kOc,"listCustomSkills");var x$i=Oe(ROc,kOc);p();p();p();function POc(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get($m).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(POc,"urlsToCheck");async function w$i(t,e,r=bB(t),n,o){let s=POc(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await DOc(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(w$i,"checkReachability");async function DOc(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(DOc,"determineReachability");var II=de(require("os")),C_e=de(require("tls"));async function k$i(t,e){let r=await t.get(nr).getImplementation(),n=await t.get(Qt).getGitHubSession(),o=await t.get(Qt).getToken().catch(()=>{});return{sections:[MOc(t),NOc(t,n),OOc(t,r),await LOc(t,r,o?.endpoints,n,e)]}}a(k$i,"collectDiagnostics");function P$i(t){return t.sections.map(BOc).join(II.EOL+II.EOL)+II.EOL}a(P$i,"formatDiagnosticsAsMarkdown");function NOc(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:V1(t),"GitHub Account":n,"Session ID":t.get(Fa).sessionId,"Send Restricted Telemetry":_se(t)?"enabled":"disabled","Content Exclusion":t.get(nc).enabled?"enabled":"unavailable"}}}a(NOc,"collectCopilotSection");function MOc(t){let e={Plugin:UOc(t),Editor:FOc(t),"Operating System":`${II.type()} ${II.release()} (${II.arch()})`};return UL(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(MOc,"collectEnvironmentSection");function OOc(t,e){let r=t.get(Bo).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":C_e.rootCertificates.length,"TLS Default Min Version":C_e.DEFAULT_MIN_VERSION,"TLS Default Max Version":C_e.DEFAULT_MAX_VERSION};return UL(n,"http_proxy"),UL(n,"https_proxy"),UL(n,"no_proxy"),UL(n,"SSL_CERT_FILE"),UL(n,"SSL_CERT_DIR"),UL(n,"OPENSSL_CONF"),UL(n,"NODE_EXTRA_CA_CERTS"),UL(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(OOc,"collectNetworkConfigSection");async function LOc(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await w$i(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(LOc,"collectReachabilitySection");function R$i(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(R$i,"quoteCode");function UL(t,e){let r=process.env[e];r&&(t[R$i(e)]=R$i(r)),r!==process.env[e.toUpperCase()]&&UL(t,e.toUpperCase())}a(UL,"addEnvironmentVariable");function BOc(t){return`## ${t.name}`+II.EOL+II.EOL+Object.keys(t.items).filter(e=>e!=="name").map(e=>`- ${e}: ${t.items[e]??"N/A"}`).join(II.EOL)}a(BOc,"formatSectionAsMarkdown");function FOc(t){let e=t.get(Ir).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(FOc,"getEditorDisplayVersion");function UOc(t){let e=t.get(Ir).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(UOc,"getPluginDisplayVersion");var QOc=S.Object({});async function qOc(t,e){return[{report:P$i(await k$i(t,e))},null]}a(qOc,"handleDiagnosticsChecked");var D$i=Oe(QOc,qOc);p();var jOc=S.Object({conversationId:S.String(),sessionTitle:S.Optional(S.String())});async function HOc(t,e,r){let o=await t.get(hv).readSpans(r.conversationId),s=ZGn(o,{conversationId:r.conversationId,sessionTitle:r.sessionTitle});return[{content:JSON.stringify(s,null,2)},null]}a(HOc,"handleExportAgentDebugLogChecked");var N$i=Oe(jOc,HOc);p();var GOc=S.Object({conversationId:S.String()});async function $Oc(t,e,r){return[{spans:await t.get(hv).readSpans(r.conversationId)},null]}a($Oc,"handleGetAgentDebugLogChecked");var M$i=Oe(GOc,$Oc);p();Oo();var Q$i=de(Xc());p();var O$i=require("crypto");var b_e=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new t3r(e,this.id)}},t3r=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(ar),s=(0,O$i.randomUUID)(),c=o.connection.onProgress(IKe.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(IKe.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 hTt(t,e,r){try{let n=t.get(hm),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 b_e&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof b_e&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Nr.error(t,"Failed to set context items on context providers",n)}}a(hTt,"setContextItems");var e3r={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function L$i(t,e,r){return e.map(o=>{try{if(typeof o=="string")return vf(r.uri,o,e3r);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=vf(r.uri,o.scheme||"",e3r)),"pattern"in o&&(s&&=vf(r.uri,o.pattern||"",e3r)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(L$i,"match");p();var VOc=S.Object({documents:S.Array(S.String()),basename:S.Optional(S.String()),options:S.Optional(S.Object({}))}),qV=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function WOc(t,e,r){return t.forceSet(qV,new qV(r.documents,r.basename||"")),["OK",null]}a(WOc,"handleTestingSetCompletionDocumentsChecked");var B$i=new fe("setCompletionDocuments"),U$i=Oe(VOc,WOc);function mTt(t,e,r,n){let o=t.get(qV);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){B$i.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=zOc(o,r);return c&&c.length>0?F$i(c,s,e):void 0}else return B$i.debug(t,"Returning completions for all pre-set documents"),F$i(o.documents,s,e)}}a(mTt,"getTestCompletions");function F$i(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=fTt(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(F$i,"sliceAndMapCompletions");function zOc(t,e){return t.basename===Ji(e)?t.documents||[]:[]}a(zOc,"getFilteredDocs");var q$i=S.Object({doc:S.Object({position:c0,insertSpaces:S.Optional(S.Boolean()),tabSize:S.Optional(S.Number()),uri:Nxe,version:S.Number()}),contextItems:S.Optional(Bfr)}),oFe;async function j$i(t,e,r,n){oFe&&(oFe.cancel(),oFe.dispose()),oFe=new Fn.CancellationTokenSource;let o=new i_([e,oFe.token]);r.contextItems&&hTt(t,r.contextItems);let s=mTt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:Mt(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await D9(t,r.doc,o)}catch(h){if(!(h instanceof Q$i.ResponseError))throw h;switch(h.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position,u=await t.get(ry).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(Ru);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(j$i,"handleGetCompletionsHelper");var H$i=Oe(q$i,(t,e,r)=>j$i(t,e,r,!1)),G$i=Oe(q$i,(t,e,r)=>j$i(t,e,r,!0));p();var YOc=S.Object({});function KOc(t,e,r){return[{defaultRules:t.get(gw).getDefaultRules()},null]}a(KOc,"handleGetDefaultFileSafetyRulesChecked");var $$i=Oe(YOc,KOc);p();var V$i=de(fU()),S_e=de(Xc());var JOc=S.Object({doc:S.Object({position:c0,uri:Nxe,version:S.Number()}),panelId:S.String()});function ZOc(t,e,r,n,o){let s=uTt(o.completionText),c=(0,V$i.SHA256)(s).toString();return t.get(Ru).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(ZOc,"makeSolution");var r3r=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(ar)}onSolution(e){return this.service.connection.sendNotification(new S_e.NotificationType("PanelSolution"),ZOc(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return W$i(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new S_e.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function W$i(t,e){return e.connection.sendNotification(new S_e.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(W$i,"reportDone");var sFe;async function XOc(t,e,r){sFe&&(sFe.cancel(),sFe.dispose()),sFe=new Fn.CancellationTokenSource;let n=new i_([e,sFe.token]),o=r.doc.position,s=gu.range(o,o),c=new r3r(t,r,s),l=t.get(PN);if(l.documents){let u=l.documents;pTt(o,u,c)}else{let u;try{u=await D9(t,r.doc,n)}catch(f){if(!(f instanceof S_e.ResponseError))throw f;switch(f.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return e5c(t,r)}throw f}c.offset=u.offsetAt(o);let d=new v_e(u,o,n,10);dTt(t,d,c)}return[{solutionCountTarget:10},null]}a(XOc,"handleGetPanelCompletionsChecked");async function e5c(t,e){return await W$i(e.panelId,t.get(ar)),[{solutionCountTarget:0},null]}a(e5c,"produceEmptySolutions");var z$i=Oe(JOc,XOc);p();var t5c=S.Object({});async function r5c(t,e,r){let o=(await t.get(Qt).getToken()).userInfo,s=o.raw,l=(await t.get(Ur).resolveSession())?.login;return!s||!l?[null,null]:[{userName:l,copilotPlan:o.copilotPlan,rawUserInfo:s},null]}a(r5c,"handleGetUserInfoChecked");var Y$i=Oe(t5c,r5c);p();var n5c=S.Object({});function i5c(t,e,r){return[{version:t.get(ds).getDisplayVersion(),buildType:OU(t),runtimeVersion:`node/${process.versions.node}`},null]}a(i5c,"handleGetVersionChecked");var K$i=Oe(n5c,i5c);p();Oo();var o5c=S.Object({changes:S.Array(S.String()),userCommits:S.Array(S.String()),recentCommits:S.Array(S.String()),workspaceFolder:S.Optional(S.String()),userLanguage:S.Optional(S.String())});async function s5c(t,e,r){if(r.changes.length===0)return[null,{code:Ze.InvalidRequest,message:"No changes provided"}];let n=t.get(Yo),o=n.create({capabilities:{skills:[MO]}}),s=new Xf({message:"",type:"user"});await n.addTurn(o.id,s);let c=g_e({workDoneToken:Mt()});await t.get(Tc).begin(o,s,c);let d=(await new mw(t,o,s,e).skillResolver.resolve(MO))?.head?.name,h=await t.get(HX).generateCommitMessage(t,e,r,d);return h==null?[null,{code:Ze.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(s5c,"handleGitCommitGenerateChecked");var J$i=Oe(o5c,s5c);p();var a5c=S.Object({repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),pullRequestNumber:S.Number()});async function c5c(t,e,r){try{let o=await new Zh(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return Et(t,"githubApi.listPullRequestChangedFiles",Wt.createAndMarkAsIssued()),At(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(Qa(t,n,"githubApi.listPullRequestChangedFiles"),Vn(t,"githubApi.listPullRequestChangedFiles",n),n instanceof uE)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(c5c,"handleListPullRequestChangedFilesChecked");var Z$i=Oe(a5c,c5c);p();p();var gTt=new fe("GitHubGraphQLClient"),ATt=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(nr);return this.graphqlClient=_Cn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){gTt.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++,gTt.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 { @@ -4085,7 +4085,7 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new Fn.CancellationTokenSource,s } } } - `,{searchQuery:e,cursor:o}),d=u.search.nodes.map(f=>({id:f.fullDatabaseId,number:f.number,title:f.title,user:f.author,html_url:f.url,draft:f.isDraft,body:f.body,updated_at:f.updatedAt,repository:f.repository}));n.push(...d),s=u.search.pageInfo.hasNextPage,o=u.search.pageInfo.endCursor}return mTt.debug(this.ctx,`Found ${n.length} pull requests`),n}catch(n){if(mTt.error(this.ctx,`Failed to search pull requests with query '${e}':`,n),n&&typeof n=="object"&&"status"in n){let o=n;throw new Fd(o.status,o.message||"GitHub GraphQL API failed")}throw n}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new uE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var n5c=S.Object({query:S.String(),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc))}),Y$i=4,S_e=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function i5c(t,e,r){try{let n=new gTt(t),o=await s5c(t,r),s=await n.searchPullRequests(o);await o5c(t,s);let c=a5c(s);return Et(t,"githubApi.searchPR",Wt.createAndMarkAsIssued()),At(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof S_e)return[null,{code:n.errorCode,message:n.message}];if(n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(qa(t,n,"githubApi.searchPR"),Vn(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(i5c,"handleSearchPRChecked");async function o5c(t,e){let r=new Zh(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(o5c,"appendCopilotWorkStatus");async function s5c(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Ur).resolveSession();if(!n)throw new S_e("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 S_e("No workspace folder provided",Ze.InvalidRequest);let s=await t.get(_f).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 S_e(l,Ze.NoGitHubRepository)}}return r}a(s5c,"replaceTemplateVariables");function a5c(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(a5c,"buildCopilotWorkStatusMeasurements");var K$i=Oe(n5c,i5c);p();var c5c=new fe("hook.list"),l5c=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});function u5c(t){let e=[];for(let r of t){let n=new Map;for(let o of r.hooks){let s=ufr[o.type];if(s===void 0)continue;let c=o.hooks.map(u=>dfr(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(u5c,"pluginHookRows");async function d5c(t,e,r){let n=r.workspaceFolders??[],o=W5(t)&&fJ(t)?(async()=>{try{let l=(await t.get(uc).listPlugins()).filter(u=>u.enabled);return u5c(l)}catch(l){return l instanceof bl||c5c.warn(t,"failed to list plugin hooks for hook/list",{err:String(l)}),[]}})():void 0,c=(await t.get(mE).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,providers:["LOCAL","BACKGROUND"],hooks:u}});return o&&c.push(...await o),[c,null]}a(d5c,"listHooks");var J$i=Oe(l5c,d5c);p();Mo();var X$i=WQt.type,oFe;function Z$i(t){return{title:"Completion Accepted",command:jNe,arguments:[t]}}a(Z$i,"makeCommand");async function f5c(t,e,r){oFe&&(oFe.cancel(),oFe.dispose());let n=r.context.triggerKind===1;oFe=new Fn.CancellationTokenSource;let o=oFe.token,s=new i_([e,o]);r.contextItems&&pTt(t,r.contextItems,r.data);let c=hTt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:Z$i(Mt()),...g}))},null];let l=await P9(t,r.textDocument,s),u=r.position,d=await t.get(ry).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(Ru);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:Z$i(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(f5c,"handleChecked");var eVi=Oe(HXn,(t,e,r)=>f5c(t,e,r));p();p();function r3r(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 T_e(o)}a(r3r,"asReadableCert");function T_e(t){return t.replace(/\s/g,"")}a(T_e,"normalizeNewlines");var h5c=S.Object({});async function m5c(t){return[{certificates:(await t.get(pp).getAllRootCAs()).map(T_e)},null]}a(m5c,"handleListCertificatesChecked");var tVi=Oe(h5c,m5c);p();var nVi="mcpGateway/serversChanged",iVi="mcpGateway/serverDetailsChanged",oVi=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()}),S.Object({kind:S.Literal("plugin"),pluginId:S.String()})]),g5c=S.Object({source:oVi,name:S.String()}),A5c=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()})]),rVi=S.Record(S.String(),S.Unknown()),y5c=S.Object({workspaceFolder:S.String(),user:rVi,project:rVi});async function E5c(t,e,r){let n=eFe(r.user),o=eFe(r.project);return await t.get(ey).applyConfig({workspaceFolder:r.workspaceFolder,user:n,project:o}),[null,null]}a(E5c,"handleApplyConfigChecked");var sVi=Oe(y5c,E5c),_5c=S.Object({scope:A5c});function v5c(t,e,r){return[{servers:t.get(ey).listServers(r.scope).map(s=>({...s,providers:cO(s.source.kind==="plugin",void 0)}))},null]}a(v5c,"handleListServersChecked");var aVi=Oe(_5c,v5c),C5c=g5c;function b5c(t,e,r){return[{details:t.get(ey).getServerDetails(r)},null]}a(b5c,"handleGetServerDetailsChecked");var cVi=Oe(C5c,b5c),S5c=S.Object({source:oVi,name:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});async function T5c(t,e,r){try{return await t.get(ey).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof bH)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(T5c,"handleServerActionChecked");var lVi=Oe(S5c,T5c);p();p();p();var uVi=de(Xc());var n3r=class extends uVi.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=Ze.InternalError){super(o,e,{errorType:r,...n})}},kie=class extends n3r{static{a(this,"HttpStatusError")}constructor(e,r,n,o=Ze.InternalError){super(e,r,{status:n},o)}},ATt=class extends kie{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,Ze.NoCopilotToken)}},yTt=class extends kie{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var ETt=class extends kie{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function dVi(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(dVi,"getRegistryMetadataFromConfig");function fVi(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?I5c(t,r):!1}catch{return!1}}a(fVi,"validateServerConfigurationMatch");function I5c(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(I5c,"validateRemoteURL");var pVi=300*1e3,PN=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 ETt(u)]:[null,new kie(`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=dVi(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?fVi(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(tr).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 x5c=S.Object({url:S.String(),source:S.String(),id:S.String(),subfolder:S.Optional(S.String())}),hVi=S.Object({description:S.Optional(S.String()),isRequired:S.Optional(S.Boolean()),format:S.Optional(S.Union([S.Literal("string"),S.Literal("number"),S.Literal("boolean"),S.Literal("filepath")])),value:S.Optional(S.String()),isSecret:S.Optional(S.Boolean()),default:S.Optional(S.String()),placeholder:S.Optional(S.String()),choices:S.Optional(S.Array(S.String()))}),i3r=S.Intersect([hVi,S.Object({variables:S.Optional(S.Record(S.String(),hVi))})]),w5c=S.Intersect([i3r,S.Object({type:S.Literal("positional"),valueHint:S.Optional(S.String()),isRepeated:S.Optional(S.Boolean())})]),R5c=S.Intersect([i3r,S.Object({type:S.Literal("named"),name:S.String(),isRepeated:S.Optional(S.Boolean())})]),mVi=S.Union([w5c,R5c]),sFe=S.Intersect([i3r,S.Object({name:S.String()})]),k5c=S.Object({registryType:S.String(),registryBaseUrl:S.Optional(S.String()),identifier:S.String(),version:S.Optional(S.String()),fileSha256:S.Optional(S.String()),runtimeHint:S.Optional(S.String()),transport:S.Optional(S.Union([S.Object({type:S.Literal("stdio")}),S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(sFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(sFe))})])),runtimeArguments:S.Optional(S.Array(mVi)),packageArguments:S.Optional(S.Array(mVi)),environmentVariables:S.Optional(S.Array(sFe))}),P5c=S.Union([S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(sFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(sFe))})]),D5c=S.Object({src:S.String(),mimeType:S.Optional(S.Union([S.Literal("image/png"),S.Literal("image/jpeg"),S.Literal("image/jpg"),S.Literal("image/svg+xml"),S.Literal("image/webp")])),sizes:S.Optional(S.Array(S.String())),theme:S.Optional(S.Union([S.Literal("light"),S.Literal("dark")]))}),N5c=S.Object({status:S.Optional(S.Union([S.Literal("active"),S.Literal("deprecated"),S.Literal("deleted")])),publishedAt:S.Optional(S.String()),updatedAt:S.Optional(S.String()),isLatest:S.Optional(S.Boolean())},{additionalProperties:!1}),M5c=S.Object({"io.modelcontextprotocol.registry/publisher-provided":S.Optional(S.Object({tool:S.Optional(S.String()),version:S.Optional(S.String()),buildInfo:S.Optional(S.Object({commit:S.Optional(S.String()),timestamp:S.Optional(S.String()),pipelineId:S.Optional(S.String())}))},{additionalProperties:!0}))},{additionalProperties:!0}),O5c=S.Object({"io.modelcontextprotocol.registry/official":S.Optional(N5c)},{additionalProperties:!0}),L5c=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),repository:S.Optional(x5c),version:S.String(),websiteUrl:S.Optional(S.String()),icons:S.Optional(S.Array(D5c)),$schema:S.Optional(S.String()),packages:S.Optional(S.Array(k5c)),remotes:S.Optional(S.Array(P5c)),_meta:S.Optional(M5c)}),B5c=S.Object({server:L5c,_meta:O5c}),INh=S.Object({servers:S.Array(B5c),metadata:S.Optional(S.Object({nextCursor:S.Optional(S.String()),count:S.Optional(S.Number())}))}),gVi=S.Object({baseUrl:S.String(),cursor:S.Optional(S.String()),limit:S.Optional(S.Number({minimum:1})),search:S.Optional(S.String()),updatedSince:S.Optional(S.String()),version:S.Optional(S.String())}),AVi=S.Object({baseUrl:S.String(),serverName:S.String(),version:S.String()});var aFe="mcp.registry.listServers",I_e="mcp.registry.getServer";async function F5c(t,e,r,n){return await t.get(PN).fetchServer(e,r,n)}a(F5c,"fetchServer");async function U5c(t,e,r){if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];let n=t.get(tr),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 eg(t,aFe,Wt.createAndMarkAsIssued({message:d})),[null,{code:Ze.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return Et(t,aFe,Wt.createAndMarkAsIssued()),At(t,aFe),[u,null]}catch(c){Vn(t,aFe,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return eg(t,aFe,Wt.createAndMarkAsIssued({message:l})),[null,{code:Ze.InternalError,message:l}]}}a(U5c,"handleListServersChecked");async function Q5c(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 F5c(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return eg(t,I_e,Wt.createAndMarkAsIssued(s)),At(t,I_e,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return eg(t,I_e,Wt.createAndMarkAsIssued(c)),At(t,I_e,c),[null,{code:Ze.InternalError,message:s}]}return Et(t,I_e,Wt.createAndMarkAsIssued()),At(t,I_e),[n,null]}a(Q5c,"handleGetServerChecked");var yVi=Oe(gVi,U5c),EVi=Oe(AVi,Q5c);p();p();var _Vi=S.Object({}),q5c=S.Object({login:S.String(),id:S.Number(),type:S.String(),parent_login:S.Union([S.String(),S.Null()]),parent_id:S.Union([S.Number(),S.Null()])}),j5c=S.Object({url:S.String(),registry_access:S.Union([S.Literal("registry_only"),S.Literal("allow_all")]),owner:q5c}),HNh=S.Object({mcp_registries:S.Array(j5c)});async function H5c(t){return await t.get(PN).fetchMcpRegistryAllowlist()}a(H5c,"fetchMcpRegistryAllowlist");async function G5c(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await H5c(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(G5c,"handleGetMcpRegistryAllowlistChecked");var vVi=Oe(_Vi,G5c);p();var SVi=de(cee()),TVi=de(nd()),IVi=de(q_());p();Mo();var $5c=S.Object({edits:S.Array(S.Object({text:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})}),predictedCursorPosition:S.Object({line:S.Number(),character:S.Number()})}))}),qV=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},o3r=new fe("setNextEditDocument");function V5c(t,e,r){return o3r.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(qV,new qV(r.edits)),["OK",null]}a(V5c,"handleTestingSetNextEditDocumentChecked");var CVi=Oe($5c,V5c);function bVi(t,e,r,n){let o=t.get(qV);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?(o3r.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(o3r.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>W5c(c,r,n)))}}a(bVi,"getTestNextEditSuggestions");function W5c(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:[Mt()]}}}a(W5c,"createNextEditSuggestion");async function z5c(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=Fs(r.textDocument.uri);t.get(h9).setForRequest(TVi.URI.parse(n),r.diagnostics??[]);let o=bVi(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(Vv);t.get(SVi.ObservableWorkspace).onUserPositionChange(n,new IVi.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:jNe,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(z5c,"handleChecked");var xVi=Oe(Ivn,z5c);p();var K5c=S.Object({uuid:S.String({minLength:1}),acceptedLength:S.Optional(S.Number({minimum:1}))});function J5c(t,e,r){let n=t.get(Ru),o=n.get(r.uuid);return o&&(Z5c(r,o)==="full"?(n.delete(r.uuid),Pme(t,o,o.triggerCategory)):qdt(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(J5c,"notifyAcceptedChecked");function Z5c(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}));Qdt(t,"ghostText",s.offset,s.uri,c),t.get(iy).resetState()}return["OK",null]}a(r4c,"notifyRejectedChecked");var kVi=Oe(t4c,r4c);p();var n4c=S.Object({uuid:S.String({minLength:1})});function i4c(t,e,r){let o=t.get(Ru).get(r.uuid);return o&&Qlt(t,o.triggerCategory,o),["OK",null]}a(i4c,"notifyShownChecked");var PVi=Oe(n4c,i4c);p();var o4c=S.Object({commandLine:S.String(),shell:S.Optional(S.String())});async function s4c(t,e,r){let n=t.get(tT),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(s4c,"handleParseTerminalCommandChecked");var DVi=Oe(o4c,s4c);p();p();function NVi(t){return S.Union(Object.values(t).map(e=>S.Literal(e)))}a(NVi,"enumSchema");var a4c=S.Union([S.Object({kind:S.Literal("relativePath"),path:S.String()}),S.Object({kind:S.Literal("github"),repo:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("url"),url:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("npm"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())}),S.Object({kind:S.Literal("pip"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())})]),c4c=S.Object({rawValue:S.String(),displayLabel:S.String(),cloneUrl:S.String(),canonicalId:S.String(),cacheSegments:S.Array(S.String()),kind:NVi(MX),ref:S.Optional(S.String()),githubRepo:S.Optional(S.String()),localRepositoryUri:S.Optional(S.String())}),MVi=S.Object({name:S.String(),description:S.String(),version:S.String(),sourceDescriptor:a4c,marketplace:S.String(),marketplaceReference:c4c,marketplaceType:NVi(UDe),readmeUri:S.Optional(S.String())}),jV=S.Object({pluginUri:S.String()}),_Tt=S.Object({source:S.String()});p();var l4c="_direct";function OVi(t,e){let r=t.fromMarketplace,n=r?.name??t.label,o=r?.marketplaceReference.canonicalId??l4c;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(OVi,"toPluginListRow");async function Dp(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof xH?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(Dp,"withPluginErrorHandling");async function u4c(t,e,r){return Dp(()=>t.get(uc).disablePlugin(r.pluginUri))}a(u4c,"handlePluginsDisableChecked");var LVi=Oe(jV,u4c);p();async function d4c(t,e,r){return Dp(()=>t.get(uc).enablePlugin(r.pluginUri))}a(d4c,"handlePluginsEnableChecked");var BVi=Oe(jV,d4c);p();var f4c=S.Object({plugin:MVi});async function p4c(t,e,r){return Dp(async()=>({pluginUri:await t.get(uc).installPlugin(r.plugin)}))}a(p4c,"handlePluginsInstallChecked");var FVi=Oe(f4c,p4c);p();var h4c=S.Object({source:S.String(),pluginName:S.Optional(S.String())});async function m4c(t,e,r){return Dp(()=>t.get(uc).installPluginFromSource(r.source,r.pluginName))}a(m4c,"handlePluginsInstallFromSourceChecked");var UVi=Oe(h4c,m4c);p();var g4c=S.Object({});async function A4c(t,e,r){return Dp(async()=>{let n=t.get(uc);return(await n.listPlugins()).map(s=>OVi(s,c=>n.isReadOnlyPlugin(c)))})}a(A4c,"handlePluginsListChecked");var QVi=Oe(g4c,A4c);p();async function y4c(t,e,r){return Dp(()=>t.get(uc).addMarketplace(r.source))}a(y4c,"handleMarketplaceAddChecked");var qVi=Oe(_Tt,y4c);p();var E4c=S.Object({source:S.Optional(S.String())});async function _4c(t,e,r){return Dp(()=>t.get(uc).browseMarketplace(r.source))}a(_4c,"handleMarketplaceBrowseChecked");var jVi=Oe(E4c,_4c);p();var v4c=S.Object({});async function C4c(t,e,r){return Dp(async()=>[...await t.get(uc).listMarketplaces()])}a(C4c,"handleMarketplaceListChecked");var HVi=Oe(v4c,C4c);p();async function b4c(t,e,r){return Dp(()=>t.get(uc).removeMarketplace(r.source))}a(b4c,"handleMarketplaceRemoveChecked");var GVi=Oe(_Tt,b4c);p();async function S4c(t,e,r){return Dp(()=>t.get(uc).uninstallPlugin(r.pluginUri))}a(S4c,"handlePluginsUninstallChecked");var $Vi=Oe(jV,S4c);p();async function T4c(t,e,r){return Dp(async()=>({updated:await t.get(uc).updatePlugin(r.pluginUri)}))}a(T4c,"handlePluginsUpdateChecked");var VVi=Oe(jV,T4c);p();var I4c=qXn;function x4c(t,e,r){let n=t.get(hm),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new C_e(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(x4c,"registerContextProviders");var WVi=Oe(I4c,x4c);p();p();var w4c=S.Object({uri:S.Optional(S.String())}),R4c=S.Object({showEditorCompletions:S.Optional(S.Boolean()),enableAutoCompletions:S.Optional(S.Boolean()),delayCompletions:S.Optional(S.Boolean()),filterCompletions:S.Optional(S.Boolean())}),YVi=S.Object({github:S.Optional(S.Object({copilot:S.Optional(S.Object({}))})),[gQr]:S.Optional(w4c),http:S.Optional(Mdn),telemetry:S.Optional(S.Object({telemetryLevel:S.Optional(S.String())}))}),cFe=Object.keys(YVi.properties).filter(t=>t!=="github"),k4c=S.Intersect([YVi,R4c]),P4c=S.Object({settings:S.Optional(S.Union([S.Object({}),S.Array(S.Unknown(),{maxItems:0})])),authProvider:S.Optional(S.Never())}),zVi=qu.Compile(P4c),s3r=qu.Compile(k4c);function QL(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(QL,"normalizePromptSetting");async function CTt(t,e){if(!zVi.Check(e))throw vTt(t),new QA(zVi.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&D4c(t,r),vTt(t,r),Promise.resolve()}a(CTt,"notifyChangeConfiguration");function D4c(t,e){for(let n of s3r.Errors(e)){let o=n.path.split("/")?.[1];$o.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!s3r.Check(e))throw new QA(s3r.Errors(e));e.http&&a3r(t,e.http);let r=e["github-enterprise"];r&&l7e(t,r.uri),e.github?.copilot&&N4c(t,e.github.copilot)}a(D4c,"applySettingsToConfiguration");function N4c(t,e){let r=t.get(rb),n={};for(let o of Object.values(Ye)){let s=Bdn(e,o);n[o]=s}r.setCopilotSettings(n),Xhe.clearCache(),GSt.clearCache(),typeof e.mcp=="string"&&W4c(t,e.mcp),e.agent&&typeof e.agent=="object"&&(z4c(t,e.agent),Y4c(t,e.agent),K4c(t,e.agent)),M4c(t,e.globalCopilotInstructions),O4c(t,e.globalGitCommitInstructions),L4c(t,e.globalAgentsMdInstructions),B4c(t,e.globalClaudeMdInstructions),F4c(t,e.globalInstructionFiles),U4c(t,e.globalPromptFiles),H4c(t,e.instructionFileLocations),G4c(t,e.promptFileLocations),$4c(t,e.agentFileLocations),V4c(t,e.skillFileLocations)}a(N4c,"applyCopilotConfiguration");function M4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalCopilotInstructions(n)}catch(r){$o.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(M4c,"applyGlobalCopilotInstructionsConfiguration");function O4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalGitCommitInstructions(n)}catch(r){$o.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(O4c,"applyGlobalGitCommitInstructionsConfiguration");function L4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalAgentsMdInstructions(n)}catch(r){$o.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(L4c,"applyGlobalAgentsMdInstructionsConfiguration");function B4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalClaudeMdInstructions(n)}catch(r){$o.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(B4c,"applyGlobalClaudeMdInstructionsConfiguration");function F4c(t,e){try{let r=t.get(bf),n=(e||[]).map(QL);r.setGlobalInstructionFiles(n)}catch(r){$o.error(t,"Failed to apply global instruction files configuration",r)}}a(F4c,"applyGlobalInstructionFilesConfiguration");function U4c(t,e){try{let r=t.get(Cg),n=(e||[]).map(QL);r.setGlobalPromptFiles(n)}catch(r){$o.error(t,"Failed to apply global prompt files configuration",r)}}a(U4c,"applyGlobalPromptFilesConfiguration");function Q4c(t){return t?Array.isArray(t)?t.map(QL):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(Q4c,"normalizeFileLocations");function q4c(t){let e=QL(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(q4c,"normalizeInstructionPromptSetting");function j4c(t){return t?Array.isArray(t)?t.map(q4c):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(j4c,"normalizeInstructionFileLocations");function H4c(t,e){try{let r=t.get(bf);if(e===void 0)return;r.setInstructionFileLocations(j4c(e))}catch(r){$o.error(t,"Failed to apply instruction file locations configuration",r)}}a(H4c,"applyInstructionFileLocationsConfiguration");function G4c(t,e){try{let r=t.get(Cg);if(e===void 0)return;r.setPromptFileLocations(Q4c(e))}catch(r){$o.error(t,"Failed to apply prompt file locations configuration",r)}}a(G4c,"applyPromptFileLocationsConfiguration");function $4c(t,e){try{let r=t.get(Ld);if(e===void 0)return;let n=e.map(QL);r.setAgentFileLocations(n)}catch(r){$o.error(t,"Failed to apply agent file locations configuration",r)}}a($4c,"applyAgentFileLocationsConfiguration");function V4c(t,e){try{let r=t.get(h0);if(e===void 0)return;let n=e.map(QL);r.setSkillFileLocations(n)}catch(r){$o.error(t,"Failed to apply skill file locations configuration",r)}}a(V4c,"applySkillFileLocationsConfiguration");function a3r(t,e){let r=t.get(rb);e.proxy===void 0&&(e=Odn(r.env));try{r.setHttpSettings(iIe(e))}catch(n){if(!(n instanceof TypeError))throw n;$o.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(a3r,"applyHttpConfiguration");async function W4c(t,e){let r;try{r=eFe(JSON.parse(e||"{}"))}catch(n){$o.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(o_).updateMCPServers(r)}catch(n){$o.error(t,"Failed to apply MCP configuration to McpManager",n)}}a(W4c,"applyMCPConfiguration");function z4c(t,e){try{let r=e;t.get(tT).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){$o.error(t,"Failed to apply settings configuration",r)}}a(z4c,"applyTerminalAutoApproveConfiguration");function Y4c(t,e){try{let r=e;t.get(mw).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){$o.error(t,"Failed to apply edit auto approve configuration",r)}}a(Y4c,"applyEditAutoApproveConfiguration");function K4c(t,e){try{let r=e;t.get(dF).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){$o.error(t,"Failed to apply MCP auto approve configuration",r)}}a(K4c,"applyMCPAutoApproveConfiguration");function vTt(t,e){if(t.get(rb).markReady(),!t.get(bn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(pf).initialize(r)}}a(vTt,"initializePostConfigurationDependencies");var KVi=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),J4c=S.Object({editorInfo:KVi,editorPluginInfo:KVi,editorConfiguration:S.Optional(S.Object({}))});async function Z4c(t,e,r){t.get(Ir).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),jdt(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await CTt(t,{settings:r.editorConfiguration}),Et(t,"setEditorInfo");for(let n of["github",...cFe])r.editorConfiguration&&n in r.editorConfiguration&&Et(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(Z4c,"handleSetEditorInfoChecked");var JVi=Oe(J4c,Z4c);p();var X4c=S.Object({options:S.Optional(S.Object({}))});async function eLc(t,e,r){let n=t.get(HT),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(eLc,"handleSignInConfirmChecked");var ZVi=Oe(X4c,eLc);p();var tLc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function rLc(t,e,r){try{let o=await t.get(Ur).checkAndUpdateStatus({githubAppId:r.githubAppId});if(o.status==="OK")return[{status:"AlreadySignedIn",user:o.user},null];let c=await t.get(HT).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:Gdt,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof yi))throw n;return[null,{code:Ze.DeviceFlowFailed,message:n.message}]}}a(rLc,"handleSignInInitiateChecked");var c3r=Oe(tLc,rLc);p();p();p();var XVi=["google","apple"],bTt=S.Optional(S.Union(XVi.map(t=>S.Literal(t))));function eWi(t){return typeof t=="string"&&XVi.includes(t)}a(eWi,"isGitHubSocialProvider");function l3r(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(l3r,"isGitHubSocialProviderApplicableHostname");function tWi(t,e){if(!e)return t;try{let r=new URL(t);return l3r(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(tWi,"addGitHubSocialProviderToVerificationUri");p();function rWi(){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(rWi,"isBrowserAvailable");function nLc(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(nLc,"getGitHubOAuthServerMetadata");async function STt(t,e,r={},n){let o=performance.now();Dme(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!rWi())throw new FU("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=UU(t,r.authAuthority),u=nLc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=l3r(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(zp).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new yi("Could not resolve GitHub username during sign-in. Please try again.");return s=await t.get(Ur).signInEditor({accessToken:m.accessToken,user:y,githubAppId:A,authAuthority:l,scopes:g?[...g]:void 0}),K2(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw K2(t,"codeFlow",s.status,performance.now()-o,c),c}}a(STt,"performGitHubOAuthCodeFlow");p();p();p();p$e();var x_e=class extends Vm{constructor(r,n=new u3r){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(ar);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)}},u3r=class extends Vm{static{a(this,"SpawnUrlOpener")}async open(e){await PTe(e)}};p();var nWi=require("crypto"),iWi=de(require("http"));p();var TTt=new fe("OAuth Code Flow");function d3r(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({id:f.fullDatabaseId,number:f.number,title:f.title,user:f.author,html_url:f.url,draft:f.isDraft,body:f.body,updated_at:f.updatedAt,repository:f.repository}));n.push(...d),s=u.search.pageInfo.hasNextPage,o=u.search.pageInfo.endCursor}return gTt.debug(this.ctx,`Found ${n.length} pull requests`),n}catch(n){if(gTt.error(this.ctx,`Failed to search pull requests with query '${e}':`,n),n&&typeof n=="object"&&"status"in n){let o=n;throw new Fd(o.status,o.message||"GitHub GraphQL API failed")}throw n}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new uE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var l5c=S.Object({query:S.String(),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc))}),X$i=4,T_e=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function u5c(t,e,r){try{let n=new ATt(t),o=await f5c(t,r),s=await n.searchPullRequests(o);await d5c(t,s);let c=p5c(s);return Et(t,"githubApi.searchPR",Wt.createAndMarkAsIssued()),At(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof T_e)return[null,{code:n.errorCode,message:n.message}];if(n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(Qa(t,n,"githubApi.searchPR"),Vn(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(u5c,"handleSearchPRChecked");async function d5c(t,e){let r=new Zh(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(d5c,"appendCopilotWorkStatus");async function f5c(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Ur).resolveSession();if(!n)throw new T_e("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 T_e("No workspace folder provided",Ze.InvalidRequest);let s=await t.get(_f).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 T_e(l,Ze.NoGitHubRepository)}}return r}a(f5c,"replaceTemplateVariables");function p5c(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(p5c,"buildCopilotWorkStatusMeasurements");var eVi=Oe(l5c,u5c);p();var h5c=new fe("hook.list"),m5c=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});function g5c(t){let e=[];for(let r of t){let n=new Map;for(let o of r.hooks){let s=ufr[o.type];if(s===void 0)continue;let c=o.hooks.map(u=>dfr(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(g5c,"pluginHookRows");async function A5c(t,e,r){let n=r.workspaceFolders??[],o=W5(t)&&fJ(t)?(async()=>{try{let l=(await t.get(uc).listPlugins()).filter(u=>u.enabled);return g5c(l)}catch(l){return l instanceof bl||h5c.warn(t,"failed to list plugin hooks for hook/list",{err:String(l)}),[]}})():void 0,c=(await t.get(mE).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,providers:["LOCAL","BACKGROUND"],hooks:u}});return o&&c.push(...await o),[c,null]}a(A5c,"listHooks");var tVi=Oe(m5c,A5c);p();Oo();var nVi=zQt.type,aFe;function rVi(t){return{title:"Completion Accepted",command:GNe,arguments:[t]}}a(rVi,"makeCommand");async function y5c(t,e,r){aFe&&(aFe.cancel(),aFe.dispose());let n=r.context.triggerKind===1;aFe=new Fn.CancellationTokenSource;let o=aFe.token,s=new i_([e,o]);r.contextItems&&hTt(t,r.contextItems,r.data);let c=mTt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:rVi(Mt()),...g}))},null];let l=await D9(t,r.textDocument,s),u=r.position,d=await t.get(ry).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(Ru);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:rVi(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(y5c,"handleChecked");var iVi=Oe(WXn,(t,e,r)=>y5c(t,e,r));p();p();function n3r(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 I_e(o)}a(n3r,"asReadableCert");function I_e(t){return t.replace(/\s/g,"")}a(I_e,"normalizeNewlines");var _5c=S.Object({});async function v5c(t){return[{certificates:(await t.get(pp).getAllRootCAs()).map(I_e)},null]}a(v5c,"handleListCertificatesChecked");var oVi=Oe(_5c,v5c);p();var aVi="mcpGateway/serversChanged",cVi="mcpGateway/serverDetailsChanged",lVi=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()}),S.Object({kind:S.Literal("plugin"),pluginId:S.String()})]),C5c=S.Object({source:lVi,name:S.String()}),b5c=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()})]),sVi=S.Record(S.String(),S.Unknown()),S5c=S.Object({workspaceFolder:S.String(),user:sVi,project:sVi});async function T5c(t,e,r){let n=rFe(r.user),o=rFe(r.project);return await t.get(ey).applyConfig({workspaceFolder:r.workspaceFolder,user:n,project:o}),[null,null]}a(T5c,"handleApplyConfigChecked");var uVi=Oe(S5c,T5c),I5c=S.Object({scope:b5c});function x5c(t,e,r){return[{servers:t.get(ey).listServers(r.scope).map(s=>({...s,providers:QS(s.source.kind==="plugin",void 0)}))},null]}a(x5c,"handleListServersChecked");var dVi=Oe(I5c,x5c),w5c=C5c;function R5c(t,e,r){return[{details:t.get(ey).getServerDetails(r)},null]}a(R5c,"handleGetServerDetailsChecked");var fVi=Oe(w5c,R5c),k5c=S.Object({source:lVi,name:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});async function P5c(t,e,r){try{return await t.get(ey).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof SH)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(P5c,"handleServerActionChecked");var pVi=Oe(k5c,P5c);p();p();p();var hVi=de(Xc());var i3r=class extends hVi.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=Ze.InternalError){super(o,e,{errorType:r,...n})}},kie=class extends i3r{static{a(this,"HttpStatusError")}constructor(e,r,n,o=Ze.InternalError){super(e,r,{status:n},o)}},yTt=class extends kie{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,Ze.NoCopilotToken)}},ETt=class extends kie{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var _Tt=class extends kie{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function mVi(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(mVi,"getRegistryMetadataFromConfig");function gVi(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?D5c(t,r):!1}catch{return!1}}a(gVi,"validateServerConfigurationMatch");function D5c(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(D5c,"validateRemoteURL");var AVi=300*1e3,DN=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 _Tt(u)]:[null,new kie(`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=mVi(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?gVi(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(nr).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 N5c=S.Object({url:S.String(),source:S.String(),id:S.String(),subfolder:S.Optional(S.String())}),yVi=S.Object({description:S.Optional(S.String()),isRequired:S.Optional(S.Boolean()),format:S.Optional(S.Union([S.Literal("string"),S.Literal("number"),S.Literal("boolean"),S.Literal("filepath")])),value:S.Optional(S.String()),isSecret:S.Optional(S.Boolean()),default:S.Optional(S.String()),placeholder:S.Optional(S.String()),choices:S.Optional(S.Array(S.String()))}),o3r=S.Intersect([yVi,S.Object({variables:S.Optional(S.Record(S.String(),yVi))})]),M5c=S.Intersect([o3r,S.Object({type:S.Literal("positional"),valueHint:S.Optional(S.String()),isRepeated:S.Optional(S.Boolean())})]),O5c=S.Intersect([o3r,S.Object({type:S.Literal("named"),name:S.String(),isRepeated:S.Optional(S.Boolean())})]),EVi=S.Union([M5c,O5c]),cFe=S.Intersect([o3r,S.Object({name:S.String()})]),L5c=S.Object({registryType:S.String(),registryBaseUrl:S.Optional(S.String()),identifier:S.String(),version:S.Optional(S.String()),fileSha256:S.Optional(S.String()),runtimeHint:S.Optional(S.String()),transport:S.Optional(S.Union([S.Object({type:S.Literal("stdio")}),S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(cFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(cFe))})])),runtimeArguments:S.Optional(S.Array(EVi)),packageArguments:S.Optional(S.Array(EVi)),environmentVariables:S.Optional(S.Array(cFe))}),B5c=S.Union([S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(cFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(cFe))})]),F5c=S.Object({src:S.String(),mimeType:S.Optional(S.Union([S.Literal("image/png"),S.Literal("image/jpeg"),S.Literal("image/jpg"),S.Literal("image/svg+xml"),S.Literal("image/webp")])),sizes:S.Optional(S.Array(S.String())),theme:S.Optional(S.Union([S.Literal("light"),S.Literal("dark")]))}),U5c=S.Object({status:S.Optional(S.Union([S.Literal("active"),S.Literal("deprecated"),S.Literal("deleted")])),publishedAt:S.Optional(S.String()),updatedAt:S.Optional(S.String()),isLatest:S.Optional(S.Boolean())},{additionalProperties:!1}),Q5c=S.Object({"io.modelcontextprotocol.registry/publisher-provided":S.Optional(S.Object({tool:S.Optional(S.String()),version:S.Optional(S.String()),buildInfo:S.Optional(S.Object({commit:S.Optional(S.String()),timestamp:S.Optional(S.String()),pipelineId:S.Optional(S.String())}))},{additionalProperties:!0}))},{additionalProperties:!0}),q5c=S.Object({"io.modelcontextprotocol.registry/official":S.Optional(U5c)},{additionalProperties:!0}),j5c=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),repository:S.Optional(N5c),version:S.String(),websiteUrl:S.Optional(S.String()),icons:S.Optional(S.Array(F5c)),$schema:S.Optional(S.String()),packages:S.Optional(S.Array(L5c)),remotes:S.Optional(S.Array(B5c)),_meta:S.Optional(Q5c)}),H5c=S.Object({server:j5c,_meta:q5c}),NNh=S.Object({servers:S.Array(H5c),metadata:S.Optional(S.Object({nextCursor:S.Optional(S.String()),count:S.Optional(S.Number())}))}),_Vi=S.Object({baseUrl:S.String(),cursor:S.Optional(S.String()),limit:S.Optional(S.Number({minimum:1})),search:S.Optional(S.String()),updatedSince:S.Optional(S.String()),version:S.Optional(S.String())}),vVi=S.Object({baseUrl:S.String(),serverName:S.String(),version:S.String()});var lFe="mcp.registry.listServers",x_e="mcp.registry.getServer";async function G5c(t,e,r,n){return await t.get(DN).fetchServer(e,r,n)}a(G5c,"fetchServer");async function $5c(t,e,r){if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];let n=t.get(nr),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 eg(t,lFe,Wt.createAndMarkAsIssued({message:d})),[null,{code:Ze.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return Et(t,lFe,Wt.createAndMarkAsIssued()),At(t,lFe),[u,null]}catch(c){Vn(t,lFe,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return eg(t,lFe,Wt.createAndMarkAsIssued({message:l})),[null,{code:Ze.InternalError,message:l}]}}a($5c,"handleListServersChecked");async function V5c(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 G5c(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return eg(t,x_e,Wt.createAndMarkAsIssued(s)),At(t,x_e,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return eg(t,x_e,Wt.createAndMarkAsIssued(c)),At(t,x_e,c),[null,{code:Ze.InternalError,message:s}]}return Et(t,x_e,Wt.createAndMarkAsIssued()),At(t,x_e),[n,null]}a(V5c,"handleGetServerChecked");var CVi=Oe(_Vi,$5c),bVi=Oe(vVi,V5c);p();p();var SVi=S.Object({}),W5c=S.Object({login:S.String(),id:S.Number(),type:S.String(),parent_login:S.Union([S.String(),S.Null()]),parent_id:S.Union([S.Number(),S.Null()])}),z5c=S.Object({url:S.String(),registry_access:S.Union([S.Literal("registry_only"),S.Literal("allow_all")]),owner:W5c}),KNh=S.Object({mcp_registries:S.Array(z5c)});async function Y5c(t){return await t.get(DN).fetchMcpRegistryAllowlist()}a(Y5c,"fetchMcpRegistryAllowlist");async function K5c(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await Y5c(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(K5c,"handleGetMcpRegistryAllowlistChecked");var TVi=Oe(SVi,K5c);p();var wVi=de(cee()),RVi=de(nd()),kVi=de(q_());p();Oo();var J5c=S.Object({edits:S.Array(S.Object({text:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})}),predictedCursorPosition:S.Object({line:S.Number(),character:S.Number()})}))}),jV=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},s3r=new fe("setNextEditDocument");function Z5c(t,e,r){return s3r.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(jV,new jV(r.edits)),["OK",null]}a(Z5c,"handleTestingSetNextEditDocumentChecked");var IVi=Oe(J5c,Z5c);function xVi(t,e,r,n){let o=t.get(jV);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?(s3r.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(s3r.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>X5c(c,r,n)))}}a(xVi,"getTestNextEditSuggestions");function X5c(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:[Mt()]}}}a(X5c,"createNextEditSuggestion");async function e4c(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=Fs(r.textDocument.uri);t.get(m9).setForRequest(RVi.URI.parse(n),r.diagnostics??[]);let o=xVi(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(Wv);t.get(wVi.ObservableWorkspace).onUserPositionChange(n,new kVi.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:GNe,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(e4c,"handleChecked");var PVi=Oe(xvn,e4c);p();var r4c=S.Object({uuid:S.String({minLength:1}),acceptedLength:S.Optional(S.Number({minimum:1}))});function n4c(t,e,r){let n=t.get(Ru),o=n.get(r.uuid);return o&&(i4c(r,o)==="full"?(n.delete(r.uuid),Dme(t,o,o.triggerCategory)):jdt(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(n4c,"notifyAcceptedChecked");function i4c(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}));qdt(t,"ghostText",s.offset,s.uri,c),t.get(iy).resetState()}return["OK",null]}a(c4c,"notifyRejectedChecked");var MVi=Oe(a4c,c4c);p();var l4c=S.Object({uuid:S.String({minLength:1})});function u4c(t,e,r){let o=t.get(Ru).get(r.uuid);return o&&qlt(t,o.triggerCategory,o),["OK",null]}a(u4c,"notifyShownChecked");var OVi=Oe(l4c,u4c);p();var d4c=S.Object({commandLine:S.String(),shell:S.Optional(S.String())});async function f4c(t,e,r){let n=t.get(nT),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(f4c,"handleParseTerminalCommandChecked");var LVi=Oe(d4c,f4c);p();p();function BVi(t){return S.Union(Object.values(t).map(e=>S.Literal(e)))}a(BVi,"enumSchema");var p4c=S.Union([S.Object({kind:S.Literal("relativePath"),path:S.String()}),S.Object({kind:S.Literal("github"),repo:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("url"),url:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("npm"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())}),S.Object({kind:S.Literal("pip"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())})]),h4c=S.Object({rawValue:S.String(),displayLabel:S.String(),cloneUrl:S.String(),canonicalId:S.String(),cacheSegments:S.Array(S.String()),kind:BVi(MX),ref:S.Optional(S.String()),githubRepo:S.Optional(S.String()),localRepositoryUri:S.Optional(S.String())}),FVi=S.Object({name:S.String(),description:S.String(),version:S.String(),sourceDescriptor:p4c,marketplace:S.String(),marketplaceReference:h4c,marketplaceType:BVi(UDe),readmeUri:S.Optional(S.String())}),HV=S.Object({pluginUri:S.String()}),vTt=S.Object({source:S.String()});p();var m4c="_direct";function UVi(t,e){let r=t.fromMarketplace,n=r?.name??t.label,o=r?.marketplaceReference.canonicalId??m4c;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(UVi,"toPluginListRow");async function Dp(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof wH?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(Dp,"withPluginErrorHandling");async function g4c(t,e,r){return Dp(()=>t.get(uc).disablePlugin(r.pluginUri))}a(g4c,"handlePluginsDisableChecked");var QVi=Oe(HV,g4c);p();async function A4c(t,e,r){return Dp(()=>t.get(uc).enablePlugin(r.pluginUri))}a(A4c,"handlePluginsEnableChecked");var qVi=Oe(HV,A4c);p();var y4c=S.Object({plugin:FVi});async function E4c(t,e,r){return Dp(async()=>({pluginUri:await t.get(uc).installPlugin(r.plugin)}))}a(E4c,"handlePluginsInstallChecked");var jVi=Oe(y4c,E4c);p();var _4c=S.Object({source:S.String(),pluginName:S.Optional(S.String())});async function v4c(t,e,r){return Dp(()=>t.get(uc).installPluginFromSource(r.source,r.pluginName))}a(v4c,"handlePluginsInstallFromSourceChecked");var HVi=Oe(_4c,v4c);p();var C4c=S.Object({});async function b4c(t,e,r){return Dp(async()=>{let n=t.get(uc);return(await n.listPlugins()).map(s=>UVi(s,c=>n.isReadOnlyPlugin(c)))})}a(b4c,"handlePluginsListChecked");var GVi=Oe(C4c,b4c);p();async function S4c(t,e,r){return Dp(()=>t.get(uc).addMarketplace(r.source))}a(S4c,"handleMarketplaceAddChecked");var $Vi=Oe(vTt,S4c);p();var T4c=S.Object({source:S.Optional(S.String())});async function I4c(t,e,r){return Dp(()=>t.get(uc).browseMarketplace(r.source))}a(I4c,"handleMarketplaceBrowseChecked");var VVi=Oe(T4c,I4c);p();var x4c=S.Object({});async function w4c(t,e,r){return Dp(async()=>[...await t.get(uc).listMarketplaces()])}a(w4c,"handleMarketplaceListChecked");var WVi=Oe(x4c,w4c);p();async function R4c(t,e,r){return Dp(()=>t.get(uc).removeMarketplace(r.source))}a(R4c,"handleMarketplaceRemoveChecked");var zVi=Oe(vTt,R4c);p();async function k4c(t,e,r){return Dp(()=>t.get(uc).uninstallPlugin(r.pluginUri))}a(k4c,"handlePluginsUninstallChecked");var YVi=Oe(HV,k4c);p();async function P4c(t,e,r){return Dp(async()=>({updated:await t.get(uc).updatePlugin(r.pluginUri)}))}a(P4c,"handlePluginsUpdateChecked");var KVi=Oe(HV,P4c);p();var D4c=$Xn;function N4c(t,e,r){let n=t.get(hm),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new b_e(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(N4c,"registerContextProviders");var JVi=Oe(D4c,N4c);p();p();var M4c=S.Object({uri:S.Optional(S.String())}),O4c=S.Object({showEditorCompletions:S.Optional(S.Boolean()),enableAutoCompletions:S.Optional(S.Boolean()),delayCompletions:S.Optional(S.Boolean()),filterCompletions:S.Optional(S.Boolean())}),XVi=S.Object({github:S.Optional(S.Object({copilot:S.Optional(S.Object({}))})),[AQr]:S.Optional(M4c),http:S.Optional(Odn),telemetry:S.Optional(S.Object({telemetryLevel:S.Optional(S.String())}))}),uFe=Object.keys(XVi.properties).filter(t=>t!=="github"),L4c=S.Intersect([XVi,O4c]),B4c=S.Object({settings:S.Optional(S.Union([S.Object({}),S.Array(S.Unknown(),{maxItems:0})])),authProvider:S.Optional(S.Never())}),ZVi=qu.Compile(B4c),a3r=qu.Compile(L4c);function QL(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(QL,"normalizePromptSetting");async function bTt(t,e){if(!ZVi.Check(e))throw CTt(t),new QA(ZVi.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&F4c(t,r),CTt(t,r),Promise.resolve()}a(bTt,"notifyChangeConfiguration");function F4c(t,e){for(let n of a3r.Errors(e)){let o=n.path.split("/")?.[1];Vo.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!a3r.Check(e))throw new QA(a3r.Errors(e));e.http&&c3r(t,e.http);let r=e["github-enterprise"];r&&d7e(t,r.uri),e.github?.copilot&&U4c(t,e.github.copilot)}a(F4c,"applySettingsToConfiguration");function U4c(t,e){let r=t.get(rb),n={};for(let o of Object.values(Ye)){let s=Fdn(e,o);n[o]=s}r.setCopilotSettings(n),eme.clearCache(),$St.clearCache(),typeof e.mcp=="string"&&X4c(t,e.mcp),e.agent&&typeof e.agent=="object"&&(eLc(t,e.agent),tLc(t,e.agent),rLc(t,e.agent)),Q4c(t,e.globalCopilotInstructions),q4c(t,e.globalGitCommitInstructions),j4c(t,e.globalAgentsMdInstructions),H4c(t,e.globalClaudeMdInstructions),G4c(t,e.globalInstructionFiles),$4c(t,e.globalPromptFiles),Y4c(t,e.instructionFileLocations),K4c(t,e.promptFileLocations),J4c(t,e.agentFileLocations),Z4c(t,e.skillFileLocations)}a(U4c,"applyCopilotConfiguration");function Q4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalCopilotInstructions(n)}catch(r){Vo.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(Q4c,"applyGlobalCopilotInstructionsConfiguration");function q4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalGitCommitInstructions(n)}catch(r){Vo.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(q4c,"applyGlobalGitCommitInstructionsConfiguration");function j4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalAgentsMdInstructions(n)}catch(r){Vo.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(j4c,"applyGlobalAgentsMdInstructionsConfiguration");function H4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalClaudeMdInstructions(n)}catch(r){Vo.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(H4c,"applyGlobalClaudeMdInstructionsConfiguration");function G4c(t,e){try{let r=t.get(bf),n=(e||[]).map(QL);r.setGlobalInstructionFiles(n)}catch(r){Vo.error(t,"Failed to apply global instruction files configuration",r)}}a(G4c,"applyGlobalInstructionFilesConfiguration");function $4c(t,e){try{let r=t.get(Cg),n=(e||[]).map(QL);r.setGlobalPromptFiles(n)}catch(r){Vo.error(t,"Failed to apply global prompt files configuration",r)}}a($4c,"applyGlobalPromptFilesConfiguration");function V4c(t){return t?Array.isArray(t)?t.map(QL):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(V4c,"normalizeFileLocations");function W4c(t){let e=QL(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(W4c,"normalizeInstructionPromptSetting");function z4c(t){return t?Array.isArray(t)?t.map(W4c):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(z4c,"normalizeInstructionFileLocations");function Y4c(t,e){try{let r=t.get(bf);if(e===void 0)return;r.setInstructionFileLocations(z4c(e))}catch(r){Vo.error(t,"Failed to apply instruction file locations configuration",r)}}a(Y4c,"applyInstructionFileLocationsConfiguration");function K4c(t,e){try{let r=t.get(Cg);if(e===void 0)return;r.setPromptFileLocations(V4c(e))}catch(r){Vo.error(t,"Failed to apply prompt file locations configuration",r)}}a(K4c,"applyPromptFileLocationsConfiguration");function J4c(t,e){try{let r=t.get(Ld);if(e===void 0)return;let n=e.map(QL);r.setAgentFileLocations(n)}catch(r){Vo.error(t,"Failed to apply agent file locations configuration",r)}}a(J4c,"applyAgentFileLocationsConfiguration");function Z4c(t,e){try{let r=t.get(h0);if(e===void 0)return;let n=e.map(QL);r.setSkillFileLocations(n)}catch(r){Vo.error(t,"Failed to apply skill file locations configuration",r)}}a(Z4c,"applySkillFileLocationsConfiguration");function c3r(t,e){let r=t.get(rb);e.proxy===void 0&&(e=Ldn(r.env));try{r.setHttpSettings(oIe(e))}catch(n){if(!(n instanceof TypeError))throw n;Vo.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(c3r,"applyHttpConfiguration");async function X4c(t,e){let r;try{r=rFe(JSON.parse(e||"{}"))}catch(n){Vo.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(o_).updateMCPServers(r)}catch(n){Vo.error(t,"Failed to apply MCP configuration to McpManager",n)}}a(X4c,"applyMCPConfiguration");function eLc(t,e){try{let r=e;t.get(nT).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){Vo.error(t,"Failed to apply settings configuration",r)}}a(eLc,"applyTerminalAutoApproveConfiguration");function tLc(t,e){try{let r=e;t.get(gw).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){Vo.error(t,"Failed to apply edit auto approve configuration",r)}}a(tLc,"applyEditAutoApproveConfiguration");function rLc(t,e){try{let r=e;t.get(fF).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){Vo.error(t,"Failed to apply MCP auto approve configuration",r)}}a(rLc,"applyMCPAutoApproveConfiguration");function CTt(t,e){if(t.get(rb).markReady(),!t.get(bn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(pf).initialize(r)}}a(CTt,"initializePostConfigurationDependencies");var eWi=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),nLc=S.Object({editorInfo:eWi,editorPluginInfo:eWi,editorConfiguration:S.Optional(S.Object({}))});async function iLc(t,e,r){t.get(Ir).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),Hdt(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await bTt(t,{settings:r.editorConfiguration}),Et(t,"setEditorInfo");for(let n of["github",...uFe])r.editorConfiguration&&n in r.editorConfiguration&&Et(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(iLc,"handleSetEditorInfoChecked");var tWi=Oe(nLc,iLc);p();var oLc=S.Object({options:S.Optional(S.Object({}))});async function sLc(t,e,r){let n=t.get($T),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(sLc,"handleSignInConfirmChecked");var rWi=Oe(oLc,sLc);p();var aLc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function cLc(t,e,r){try{let o=await t.get(Ur).checkAndUpdateStatus({githubAppId:r.githubAppId});if(o.status==="OK")return[{status:"AlreadySignedIn",user:o.user},null];let c=await t.get($T).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:$dt,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof yi))throw n;return[null,{code:Ze.DeviceFlowFailed,message:n.message}]}}a(cLc,"handleSignInInitiateChecked");var l3r=Oe(aLc,cLc);p();p();p();var nWi=["google","apple"],STt=S.Optional(S.Union(nWi.map(t=>S.Literal(t))));function iWi(t){return typeof t=="string"&&nWi.includes(t)}a(iWi,"isGitHubSocialProvider");function u3r(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(u3r,"isGitHubSocialProviderApplicableHostname");function oWi(t,e){if(!e)return t;try{let r=new URL(t);return u3r(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(oWi,"addGitHubSocialProviderToVerificationUri");p();function sWi(){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(sWi,"isBrowserAvailable");function lLc(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(lLc,"getGitHubOAuthServerMetadata");async function TTt(t,e,r={},n){let o=performance.now();Nme(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!sWi())throw new UU("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=QU(t,r.authAuthority),u=lLc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=u3r(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(zp).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new yi("Could not resolve GitHub username during sign-in. Please try again.");return s=await t.get(Ur).signInEditor({accessToken:m.accessToken,user:y,githubAppId:A,authAuthority:l,scopes:g?[...g]:void 0}),J2(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw J2(t,"codeFlow",s.status,performance.now()-o,c),c}}a(TTt,"performGitHubOAuthCodeFlow");p();p();p();m$e();var w_e=class extends Vm{constructor(r,n=new d3r){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(ar);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)}},d3r=class extends Vm{static{a(this,"SpawnUrlOpener")}async open(e){await DTe(e)}};p();var aWi=require("crypto"),cWi=de(require("http"));p();var ITt=new fe("OAuth Code Flow");function f3r(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 @@ -4159,49 +4159,49 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new Fn.CancellationTokenSource,s } -`;var p3r=["authorization_code","refresh_token"],w_e=33428,ITt=class{constructor(e,r){this._logger=new fe("LoopbackAuthServer");this.nonce=(0,nWi.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=iWi.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 yi("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),qNe(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 yi(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),qNe(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 yi("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}),qNe(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 yi("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}),qNe(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(f3r,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(f3r)}})}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 ${w_e} 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(w_e,"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 xTt=require("crypto");var lFe=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,xTt.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,xTt.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 iLc="Timed out",oWi="Sign-in request was cancelled",h3r=class{static{a(this,"CodeFlow")}},R_e=class extends h3r{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=lFe.isServerSupported(n.code_challenge_methods_supported),h=f?lFe.createPKCEParameters():void 0;f?Nr.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Nr.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 ITt(A,this.ctx),_=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Nr.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new x_e(this.ctx).open(_);let v,b=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,P)=>{let D=setTimeout(()=>P(new Error(iLc)),3e5);b.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((P,D)=>{if(x.isCancellationRequested){Nr.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(oWi));return}let N=x.onCancellationRequested(()=>{Nr.info(this.ctx,"OAuth flow cancelled"),D(new Error(oWi))});b.push(N)}))}v=(await Promise.race(w)).code,Nr.info(this.ctx,"OAuth response received successfully")}catch(w){throw Nr.error(this.ctx,"OAuth flow error",w),w}finally{for(let x of b)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=>{Nr.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);Nr.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await PX(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 Nr.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 DN=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=>d3r([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(Yn).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(zp),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=eWi(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 R_e(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&&d3r([...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(Yn).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(tr).fetch(new URL(r).href,{method:"GET",headers:{Authorization:`token ${e}`}})}catch(o){return TTt.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 TTt.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 TTt.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 oLc=S.Object({scopes:S.Optional(S.Array(S.String({minLength:1}),{minItems:1})),authServer:S.Optional(S.String({minLength:1})),socialProvider:bTt,loginHint:S.Optional(S.String({minLength:1}))});async function sLc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];let n=t.get(Ur),{status:o,user:s,sourceEnvVar:c}=await n.checkAndUpdateStatus({authAuthority:r.authServer});if(o==="OK")return[{status:o,user:s},null];if(c)return[null,{code:Ze.AuthEnvVarConflict,message:d7e(c)}];let l=await STt(t,(u,d)=>new DN(u,DN.providerId,d,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider,loginHint:r.loginHint},e);if(!["OK","MaybeOK"].includes(l.status))throw new yi("OAuth authentication failed for unknown reasons. Please try again later.");return[l,null]}catch(n){if(n instanceof FU)return[null,{code:Ze.NoBrowserAvailable,message:n.message}];if(!(n instanceof yi))throw n;return[null,{code:Ze.CodeFlowFailed,message:n.message}]}}a(sLc,"handleSignInWithCodeFlowChecked");var sWi=Oe(oLc,sLc);p();p();p();var D9=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},uFe=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function aWi(t,e,r){return e.isCancellationRequested?Promise.reject(new D9):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new D9))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new uFe))},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(aWi,"raceWithCancellationAndTimeout");var aLc=["repo","workflow"];async function cLc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(tr).fetch(s,o)}catch(l){throw l instanceof Error&&XI(l)?new yi(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(cLc,"requestDeviceCode");async function lLc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...Gy(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(tr).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&XI(l)?new yi(`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 yi(c.error_description):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(lLc,"requestAccessToken");async function uLc(t,e){let n=await(await Gf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(uLc,"requestUserInfo");async function dLc(t,e,r){let n=r?.githubAppId??t.get(zp).findAppIdToAuthenticate(),o=r?.scopes??aLc,{serverUrl:s,apiUrl:c,authAuthority:l}=UU(t,r?.authAuthority),u=await cLc(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 D9("Sign-in request was cancelled");m=await lLc(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await uLc(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new D9("Sign-in request was cancelled");let y=m.scope?m.scope.split(" ").filter(E=>E.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(Ur),{status:c,user:l,sourceEnvVar:u}=await s.checkAndUpdateStatus({authAuthority:r.authServer});if(c==="OK")return[{status:c,user:l},null];if(u)return[null,{code:Ze.AuthEnvVarConflict,message:d7e(u)}];Dme(t,"deviceFlow");let d=t.get(Pie),f=await d.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(ar).connection.sendNotification(hLc,{userCode:f.userCode,verificationUri:f.verificationUri,expiresIn:f.expiresIn});let h=await aWi(f.waitForAuth,e,mLc),m=await d.save(h);return K2(t,"deviceFlow",m.status,o()),[m,null]}catch(s){if(s instanceof D9)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof uFe)return K2(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:Ze.DeviceFlowFailed,message:"Sign-in request timed out"}];if(K2(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof yi))throw s;return[null,{code:Ze.DeviceFlowFailed,message:s.message}]}}a(gLc,"handleSignInWithDeviceFlowChecked");var lWi=Oe(pLc,gLc);p();var ALc=S.Object({githubToken:S.String({minLength:1}),user:S.String({minLength:1}),githubAppId:S.Optional(S.String({minLength:1}))});async function yLc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Ur);return[await t.get(HT).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(yLc,"handleSignInWithGithubTokenChecked");var uWi=Oe(ALc,yLc);p();var ELc=S.Object({options:S.Optional(S.Object({}))});async function _Lc(t,e,r){return[await t.get(Ur).signOutEditor(),null]}a(_Lc,"handleSignOutChecked");var dWi=Oe(ELc,_Lc);p();var vLc=S.Object({transaction:S.Optional(S.String()),stacktrace:S.Optional(S.String()),properties:S.Optional(S.Record(S.String(),S.String())),platform:S.Optional(S.String()),exception_detail:S.Optional(S.Array(S.Object({type:S.Optional(S.String()),value:S.Optional(S.String()),stacktrace:S.Optional(S.Array(S.Object({filename:S.Optional(S.String()),lineno:S.Optional(S.Union([S.String(),S.Integer()])),colno:S.Optional(S.Union([S.String(),S.Integer()])),function:S.Optional(S.String()),in_app:S.Optional(S.Boolean())})))})))}),m3r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function CLc(t,e,r){let n=t.get(ds),o=t.get(Ir).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&A4.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:cPt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},A4.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new m3r(r.stacktrace??"N/A",o.name);return l.stack=void 0,qa(t,l,r.transaction??"",s,c),["OK",null]}a(CLc,"handleTelemetryExceptionChecked");var fWi=Oe(vLc,CLc);p();p();p();Mo();function g3r(t,e){let r=Date.now()+((t?.refresh_in??0)+QDt)*1e3;return new WW({token:`test token ${Mt()}`,refresh_in:0,expires_at:r,...t},e,r)}a(g3r,"createTestCopilotToken");var k_e=class extends Rh{constructor(){super(...arguments);this.defaultToken=g3r({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:g3r({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 wTt=class extends Rh{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:g3r(await this.envelopeFn())}}};var bLc=S.Object({options:S.Optional(S.Object({}))});async function SLc(t,e,r){let n=new k_e;return t.get(Ur).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet(Rh,n),t.get(ps).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(SLc,"handleTestingAlwaysAuthChecked");var A3r=Oe(bLc,SLc);p();Mo();var TLc=S.Object({messages:S.Array(S.Object({role:S.Enum(ic),content:S.String(),name:S.Optional(S.String())})),modelFamily:S.Optional(S.Enum(Rn)),stop:S.Optional(S.Array(S.String())),conversationOptions:S.Optional(S.Object({maxResponseTokens:S.Optional(S.Number()),temperature:S.Optional(S.Number())}))});async function ILc(t,e,r){let n=new oc(t),s=await yq(t)?Rn.Gpt35turbo:Rn.CopilotBase,c=await t.get(el).getBestChatModelConfig([r.modelFamily??s]),l=await axe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:OA.user("test",Mt())},e,l),null]}a(ILc,"handleChatMLChecked");var pWi=Oe(TLc,ILc);p();p();p();var O_e=de(Azi(),1),v8h={ALPN_HTTP2:O_e.default.ALPN_HTTP2,ALPN_HTTP2C:O_e.default.ALPN_HTTP2C,ALPN_HTTP1_1:O_e.default.ALPN_HTTP1_1,ALPN_HTTP1_0:O_e.default.ALPN_HTTP1_0},{fetch:C8h,context:yzi,reset:b8h,noCache:S8h,h1:T8h,keepAlive:I8h,h1NoCache:x8h,keepAliveNoCache:w8h,cacheStats:R8h,clearCache:k8h,offPush:P8h,onPush:D8h,createUrl:N8h,timeoutSignal:M8h,Body:O8h,Headers:Ezi,Request:L8h,Response:B8h,AbortController:F8h,AbortError:$Tt,AbortSignal:U8h,FetchBaseError:Q8h,FetchError:q8h,ALPN_HTTP2:j8h,ALPN_HTTP2C:H8h,ALPN_HTTP1_1:G8h,ALPN_HTTP1_0:$8h}=O_e.default;var vzi=require("crypto"),Czi=require("http"),bzi=require("stream"),Szi=require("util"),B_e=de(PP());var z3c=6e5,Y3c=new B_e.ProtocolRequestType("copilot/fetch"),K3c=new B_e.ProtocolRequestType("copilot/fetchCancel"),J3c=new B_e.ProgressType,Z3c=new B_e.ProtocolRequestType("copilot/fetchDisconnectAll"),qL=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},L_e=class extends tr{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(ds).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(ar).connection.sendRequest(Z3c,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(ar).connection,c=(0,vzi.randomUUID)(),l=new Fn.CancellationTokenSource,u=new bzi.PassThrough,d=a(()=>{s.sendRequest(K3c,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new $Tt("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new qL("EditorFetcher received unexpected abort signal");if(o.aborted)throw new $Tt("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(J3c,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new qL(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??z3c,y=setTimeout(()=>{At(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new qL("Request timed out from lsp server"))},A),E=a(()=>{g(new $Tt("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",E),s.sendRequest(Y3c,eFc(r,c,n),l.token).then(m).catch(_=>{let v="EditorFetcher request failed";_&&typeof _=="object"&&"message"in _&&(v+=`: ${String(_.message)}`),_&&typeof _=="object"&&"data"in _&&(v+=`: ${(0,Szi.inspect)(_.data)}`),g(new qL(v))}).finally(()=>{o?.removeEventListener("abort",E),clearTimeout(y)})});if(!h.status)throw new qL("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new ex(h.status,Czi.STATUS_CODES[h.status]??"",new Ezi(h.headers),()=>X3c(u),()=>u)}};function X3c(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(X3c,"consumeStream");function eFc(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(eFc,"convertOptionsToParams");var tFc=S.Object({url:S.String(),headers:S.Optional(S.Record(S.String(),S.String())),body:S.Optional(S.String()),timeout:S.Optional(S.Number()),method:S.Optional(S.Union([S.Literal("GET"),S.Literal("POST"),S.Literal("DELETE")])),cancelBeforeRequest:S.Optional(S.Boolean()),cancelAfterRequest:S.Optional(S.Boolean()),cancelAfterFirstChunk:S.Optional(S.Boolean())});async function rFc(t,e,r){let n=new L_e(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 qL?y.message:String(y)}`},null]}let{status:g}=m,A=Object.fromEntries(Array.from(m.headers));try{if(d){let E=m.body();for await(let _ of E){let v=_.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 qL?y.message:String(y)}`},null]}}a(rFc,"handleTestingFetchChecked");var Tzi=Oe(tFc,rFc);p();var nFc=S.Object({});async function iFc(t,e,r){return await t.get(xd).flush(),["OK",null]}a(iFc,"handleTestingFlushPromiseQueueChecked");var Izi=Oe(nFc,iFc);p();p();p();var $V=class{static{a(this,"FileSearch")}};p();p();p();var VTt=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 xzi=de(ri());var WTt="main.js",zTt=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=shn(WTt,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new VTt(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new jVe(this.id++),xzi.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new UVe(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new QVe(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new qVe(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new BVe(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 FVe(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 LVe(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(WTt+"'")&&(r=new Error(`Failed to load ${WTt}`),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(`${WTt} 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 yFe=de(ri());var B9=new fe(Nfr),YTt=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){B9.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,yFe.CancellationToken.None);return}B9.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new zTt(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{B9.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 oFc(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,yFe.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{B9.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){B9.debug(this.ctx,`indexing workspace ${e}`);let r=Y8t.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${Y8t.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get($V),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,yFe.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));B9.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)})),B9.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{B9.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,yFe.CancellationToken.None)}catch(n){B9.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return cfn(e)}};async function oFc(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(oFc,"createIndexableWorkspaceFolder");var sFc=S.Object({filePath:S.String(),code:S.String(),offset:S.Number(),languageId:S.String(),timeout:S.Optional(S.Number()),waitForContext:S.Optional(S.Boolean())});async function aFc(t,e,r){try{await t.get(US).start();let n=t.get(YTt),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,Mfr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(dFc,"handleTestingNeverAuthChecked");var V3r=Oe(uFc,dFc);p();p();p();var W3r=class extends pp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},kzi=a(t=>new W3r(t),"createTestCertificateReader");function Y3r(t,e,r){let n=new z3r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new ex(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(Y3r,"createFakeResponse");function Pzi(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),Y3r(t,n,Object.assign({"content-type":"application/json"},r))}a(Pzi,"createFakeJsonResponse");var EFe=class extends tr{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var KTt=class extends EFe{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var z3r=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 K3r=class extends EFe{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(Pzi(200,this.fullConfig)):Promise.resolve(Y3r(404,""))}},JTt=class extends K3r{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 fFc=S.Object({expFlags:S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean()]))});function pFc(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(tr,new JTt(n,t.get(tr)))}return["OK",null]}a(pFc,"handleTestingOverrideExpFlagsChecked");var Dzi=Oe(fFc,pFc);p();var hFc=S.Object({rules:oUt});function mFc(t,e,r){return t.get(nc).setTestingRules(r.rules),["OK",null]}a(mFc,"handleTestingSetContentExclusionRulesChecked");var Nzi=Oe(hFc,mFc);p();var gFc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),chunks:S.Array(S.String()),followUp:S.Optional(S.String()),suggestedTitle:S.Optional(S.String()),skills:S.Optional(S.Array(S.String())),references:S.Optional(S.Array(OO)),options:S.Optional(S.Object({}))});function AFc(t,e,r){return t.get(F9).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(AFc,"handleTestingSetSyntheticTurnsChecked");var Mzi=Oe(gFc,AFc);p();var yFc=S.Object({});async function EFc(t,e,r){let n=t.get(ts),o=t.get(qf);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(EFc,"handleTriggerShowMessageChecked");var Ozi=Oe(yFc,EFc);p();p();p();p();var Lzi=de(require("tls"));var F_e=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(pp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=Lzi.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 zzi=de(require("http"));var GFc=407,wy=new fe("proxySocketFactory"),uk=class{static{a(this,"ProxySocketFactory")}},Lie=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 ZTt(t){return new X3r(t,new eFr(t))}a(ZTt,"getProxySocketFactory");var X3r=class extends uk{constructor(r,n,o=new vFe,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new Cn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(wy.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 Lie&&o.code===`ProxyStatusCode${GFc}`){wy.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return wy.debug(this.ctx,"Proxy authorization successful, caching result"),Et(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&&(wy.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(wy.debug(this.ctx,"Proxy authorization successful, received token"),o)return wy.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){wy.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);wy.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);wy.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return wy.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return wy.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return wy.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},eFr=class extends uk{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(ds).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{wy.debug(this.ctx,"Attempting to establish connection to proxy");let l=zzi.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{wy.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new Lie(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new Lie(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(wy.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{wy.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new Lie(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{wy.debug(this.ctx,"Proxy socket connection timeout"),c(new Lie(`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"])}},vFe=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>de(Wzi()))}};var Bie=class extends tr{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new F_e(r),this.proxySocketFactory=r.get(uk),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Lo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Lo).getHttpSettings()),this.updateNoProxy(r.get(Lo).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(ds),s=this.proxySocketTimeoutForTesting;return yzi({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 jW(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new ex(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var q_e=class extends $m{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(pf).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=$y({serverUrl:c7e(r,n.serverUrl),apiUrl:c7e(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 j_e=class extends ZL{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){qa(e,r,n)}};p();var H_e=class extends m4{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var XTt=class extends WP{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var eIt=class extends zh{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 tIt=class extends $V{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 Yzi(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(Yzi,"fakeChatModelConfiguration");function $Fc(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a($Fc,"fakeEmbeddingModelConfiguration");var rIt=class extends el{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(Yzi(r))}getModelConfigurationById(e){return Promise.resolve({...Yzi(e),modelId:e})}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve($Fc(e))}};p();var nIt=class extends Vm{constructor(){super(...arguments);this.openedUrls=[];this.opened=new vA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},iIt=class extends ts{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()}async waitForMessages(){await Promise.all(this.warningPromises),await Promise.all(this.informationPromises)}};p();function Kzi(t,e,r,n){return NS.create(a7e(t),e,r,n,e)}a(Kzi,"createTextDocument");var tFr=class extends $r{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new Wi;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new Wi;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new Wi;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new Wi;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new Wi;this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event}static{a(this,"SimpleTestTextDocumentManager")}init(r){this._workspaceFolders=r.map(n=>({uri:n.uri,name:n.name??Ji(n.uri)}))}async readTextDocumentFromDisk(r){return super.readTextDocumentFromDisk(r)}getTextDocumentsUnsafe(){return this._openTextDocuments}setTextDocument(r,n,o){let s=Kzi(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]=Kzi(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}},oIt=class extends tFr{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 rFr=class extends qf{static{a(this,"NullLog")}logIt(...e){}},nFr=class extends Ur{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 VFc(t){let e=new sue;e.set(Lo,t),e.set(OY,t);let r=new nFr(e,{accessToken:"",login:"user"});e.set(Ur,r),e.set(ds,new ds),e.set(tp,new tp),e.set(QI,new QI({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(pp,kzi([])),e.set(uk,ZTt(e)),e.set(Cx,new Cx),e.set(dP,new gje);let n=new k_e;e.set(Rh,n);let o=new Qt(e,!0);e.set(Qt,o);let s=new Op(e);return s.updateFromToken(n.defaultToken),e.set(Op,s),e.set(X0,new X0),e.set(XN,new XN),e.set(ts,new iIt),e.set(Vm,new nIt),e.set(ZL,new j_e),e.set(qf,new rFr),e.set(CC,new CC),e.set(Ua,new Ua("test-session","test-machine","test-device")),e.set(UI,new UI(()=>Promise.resolve("test-device"))),e.set($m,new q_e(e)),e.set(kk,new boe),e.set(pf,new pf(e,"copilot-test")),e.set(Zt,new Zt(e)),e.set(rO,new rO(e,o)),e.set(q2,new q2),e.set(TP,new dle),e.set(ps,new pje),e.set(xd,new xd),e.set(t4,new t4(e)),e.set($V,new tIt),e.set(z2,new z2(e)),e.set(T8,Pdt(e)),e.set(iy,new iy),e.set(Db,new Db),e.set(I8,I8.default),e.set(Ox,new Ox(e,!1)),e.set(zp,new zp),e.set(ii,new ii(e)),e.set(jT,new Mdt),e.set(pm,new pm),e.set(hm,Glt(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(Nb,new Nb(e)),WFc(e),e.set(Pb,new Pb(e)),e.set(bn,new bn),e.set(m4,new H_e),e.set(CN,new CN),e.set(Aw,new Aw),e.set(nT,new nT(e)),e}a(VFc,"_createBaselineContext");function WFc(t){t.set(zo,new zo(t)),t.set(Tc,new Tc(t)),t.set(kA,new kA(t)),t.set(Yh,new Yh),t.set(Ag,new Ag),t.set(zh,new eIt),t.set(ck,new ck(t,[])),t.set(el,new rIt),t.set(WP,new XTt),t.set(NO,new NO(t));let e=new xN(t);t.set(xN,e),t.set(sk,new sk(e,t)),t.set(HO,new HO(t)),t.set(bI,new $St),t.set(ZC,new ZC(t.get(sk),t.get(bI),t)),t.set(m0,new m0)}a(WFc,"registerConversation");function Jzi(){let t=VFc(new OY(new fle,new Map));return t.set(tr,new KTt),t.set(Ir,new iFr),t.set($r,new oIt(t)),t.set(Qo,new SQ),t.set(nc,new nc(t)),t.set(Au,new Au(t)),t.set(qS,new aYe),t.set(gO,new gO(t)),t.set(r4,new nme),t.set(F2,new Bct),t.set(jl,new Gze),t.set(wA,new wA(t)),t.set(a0,new Rze),t.set(fm,new fm),wze(t),t.set(ry,new dEe(t)),t}a(Jzi,"createLibTestingContext");var iFr=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 Xzi=de(require("fs"));var Zzi=`${process.env.HOME}/.copilot-testing-gh-token`,sIt,aIt;function eYi(t){let e=tYi(),r=new wTt(zFc);return t.forceSet(Rh,r),t.get(Ur).setTransientSession(e),r}a(eYi,"setIntegrationTokenManager");var zFc=a(async()=>{if(aIt)return aIt;let t=await tYi(),e=Jzi(),r=new Bie(e);return e.forceSet(tr,r),aIt=qDt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new yi('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),aIt},"getEnvelope");async function tYi(){let{session:t}=R5t(process.env);if(t)return t;try{sIt??=(await Xzi.promises.readFile(Zzi)).toString().trim()}catch{sIt??=process.env.GITHUB_TOKEN??""}if(!sIt)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 ${Zzi}. Run "npm run get_token" to get one.`);return{...$y({}),accessToken:sIt,login:"copilot-client tests"}}a(tYi,"getTestingGitHubSession");var YFc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function KFc(t,e,r){return eYi(t),await t.get(Qt).primeToken(),["OK",null]}a(KFc,"handleTestingUseTestingTokenChecked");var rYi=Oe(YFc,KFc);p();var JFc=S.Object({});async function ZFc(t,e,r){return await new hEe().uninstall(t),["OK",null]}a(ZFc,"handleUninstallChecked");var nYi=Oe(JFc,ZFc);p();var XFc=jXn;function e8c(t,e,r){let n=t.get(hm),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(e8c,"unregisterContextProviders");var iYi=Oe(XFc,e8c);p();var oFr=de(require("os"));var t8c=S.Object({expectedCertificate:S.String()});async function r8c(t,e,r){let o=(await fot(t).getAllRootCAs()).map(T_e),s=T_e(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${r3r(s)}. Only found those installed on the system:${oFr.EOL}${o.map(c=>"- "+r3r(c)).join(oFr.EOL)}`},null]}a(r8c,"handleVerifyCertificateChecked");var oYi=Oe(t8c,r8c);p();var n8c=S.Object({});async function i8c(){return[{status:!!await new vFe().load()},null]}a(i8c,"handleVerifyKerberosChecked");var sYi=Oe(n8c,i8c);p();var o8c=S.Object({source:S.String(),version:S.Number(),uri:S.String()});async function s8c(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(s8c,"handleVerifyStateChecked");var aYi=Oe(o8c,s8c);p();var a8c=S.Object({});function c8c(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(c8c,"handleVerifyWorkspaceStateChecked");var cYi=Oe(a8c,c8c);p();p();var $_e=de(require("fs/promises")),lYi=de(require("os")),Xd=de(require("path"));var Np=new fe("GitWorktreeService"),l8c=20,G_e=class{constructor(e){this.ctx=e;this.gitInstances=new Cn(l8c)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=Xd.resolve(e),n=this.gitInstances.get(r);return n||(n=Gue(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=Xd.resolve(e);Np.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return Np.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw Np.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?(Np.info(this.ctx,`Skipping checkpoint commit for ${Xd.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)),Np.info(this.ctx,`Created ${n} commit for ${Xd.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){Np.info(this.ctx,`Snapshotting copied changes in ${Xd.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 Np.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await $_e.mkdtemp(Xd.join(lYi.tmpdir(),"copilot-worktree-")),o=Xd.join(n,"changes.patch");try{Np.info(this.ctx,`Writing temporary patch for ${Xd.resolve(e)} to ${o} (${r.length} chars)`),await $_e.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 $_e.rm(n,{recursive:!0,force:!0}),Np.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=Xd.basename(r),h=Xd.join(Xd.dirname(r),`${f}.worktrees`),m=Xd.join(h,d);return Np.info(this.ctx,`Preparing worktree creation for ${Xd.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])),Np.info(this.ctx,`Created worktree ${m} from ${Xd.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){Np.info(this.ctx,`Preparing to remove worktree ${e} from ${Xd.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),Np.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return Np.info(this.ctx,`Skipping status lookup for ${Xd.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){Np.info(this.ctx,`Applying worktree changes from ${Xd.resolve(e)} to ${Xd.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");Np.info(this.ctx,o?`Committed pending worktree changes in ${Xd.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${Xd.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return Np.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 Np.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 Np.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"])),Np.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),Np.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),Np.info(this.ctx,`Popped stash in ${e}`)}};p();var uYi=de(ri());var x1=new fe("WorktreeService");var u8c=new uYi.ProtocolRequestType("worktree/requestUserDecision"),CFe=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 x1.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";x1.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(ar).connection.sendRequest(u8c,{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?(x1.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(x1.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){x1.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(x1.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&&(x1.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(x1.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},x1.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);x1.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw x1.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return x1.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){x1.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return x1.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var d8c="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",f8c=["already exists in working directory","patch does not apply","patch failed"];function p8c(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&f8c.some(n=>e.includes(n))?d8c:`Failed to apply worktree changes: ${e}`}a(p8c,"getWorktreeCompleteErrorMessage");var h8c=S.Object({repositoryPath:S.String()});async function m8c(t,e,r){try{let n=new G_e(t),o=new CFe(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(m8c,"handleWorktreeCreateChecked");var dYi=Oe(h8c,m8c),g8c=S.Object({repositoryPath:S.String(),worktreePath:S.String(),baseCommit:S.String()});async function A8c(t,e,r){try{let n=new G_e(t);return[{success:!0,baseCommit:(await new CFe(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:Ze.InternalError,message:p8c(n)}]}}a(A8c,"handleWorktreeCompleteChecked");var fYi=Oe(g8c,A8c),y8c=S.Object({worktreePath:S.String(),repositoryPath:S.String()});async function E8c(t,e,r){try{return await new G_e(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(E8c,"handleWorktreeDeleteChecked");var pYi=Oe(y8c,E8c);var Fie=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function hYi(){let t=new Map;return t.set(X$i.method,eVi),t.set("getCompletions",U$i),t.set("getCompletionsCycling",Q$i),t.set("getDefaultFileSafetyRules",q$i),t.set("copilot/parseTerminalCommand",DVi),t.set("getPanelCompletions",G$i),t.set(g$i.method,A$i),t.set("getVersion",V$i),t.set("getUserInfo",$$i),t.set("setEditorInfo",JVi),t.set("checkStatus",IGi),t.set("checkQuota",TGi),t.set("checkFileStatus",bGi),t.set("claude/checkCliCompatibility",EGi),t.set("codex/checkCliCompatibility",CGi),t.set("signInInitiate",c3r),t.set("signIn",c3r),t.set("signInWithCodeFlow",sWi),t.set("signInWithDeviceFlow",lWi),t.set("signInConfirm",ZVi),t.set("signInWithGithubToken",uWi),t.set("signOut",dWi),t.set("auth/listAvailableTokens",Qqi),t.set("auth/useExistingToken",qqi),t.set("notifyShown",PVi),t.set("notifyAccepted",wVi),t.set("notifyRejected",kVi),t.set("notifyNextEditRejected",RVi),t.set("telemetry/exception",fWi),t.set("textDocument/copilotInlineEdit",xVi),t.set("testing/overrideExpFlags",Dzi),t.set("testing/alwaysAuth",A3r),t.set("testing/setAlwaysAuthed",A3r),t.set("testing/neverAuth",V3r),t.set("testing/setNeverAuthed",V3r),t.set("testing/useTestingToken",rYi),t.set("testing/setCompletionDocuments",O$i),t.set("testing/setPanelCompletionDocuments",h$i),t.set("testing/setNextEditDocument",CVi),t.set("testing/triggerShowMessageRequest",Ozi),t.set("testing/flushPromiseQueue",Izi),t.set("testing/getDocument",Rzi),t.set("testing/chatml",pWi),t.set("testing/setSyntheticTurns",Mzi),t.set("testing/fetch",Tzi),t.set("testing/setContentExclusionRules",Nzi),t.set("testing/getContext",wzi),t.set("uninstall",nYi),t.set("debug/diagnostics",w$i),t.set("debug/listCertificates",tVi),t.set("debug/verifyState",aYi),t.set("debug/verifyCertificate",oYi),t.set("debug/verifyKerberos",sYi),t.set("debug/verifyWorkspaceState",cYi),t.set("debug/getAgentDebugLog",k$i),t.set("debug/exportAgentDebugLog",R$i),t.set("context/registerProviders",WVi),t.set("context/unregisterProviders",iYi),t.set("conversation/preconditions",GGi),t.set("conversation/persistence",HGi),t.set("conversation/create",UGi),t.set("conversation/turn",zGi),t.set("conversation/turnDelete",YGi),t.set("conversation/destroy",QGi),t.set("conversation/compress",OGi),t.set("conversation/rating",$Gi),t.set("conversation/copyCode",NGi),t.set("conversation/insertCode",MGi),t.set("conversation/templates",WGi),t.set("conversation/modes",qGi),t.set("conversation/agents",DGi),t.set("conversation/registerTools",VGi),t.set("conversation/unregisterTools",KGi),t.set("conversation/updateToolsStatus",JGi),t.set("conversation/notifyCodeAcceptance",jGi),t.set("customAgent/registerExtensionAgents",E$i),t.set("customAgent/unregisterExtensionAgents",_$i),t.set("copilot/customAgent/list",y$i),t.set("copilot/customSkill/list",b$i),t.set("copilot/customPrompt/list",C$i),t.set("copilot/customInstruction/list",v$i),t.set("copilot/hook/list",J$i),t.set("copilot/models",c$i),t.set("copilot/models/getModelMetadataList",l$i),t.set("copilot/byok/saveModel",yGi),t.set("copilot/byok/deleteModel",Hqi),t.set("copilot/byok/listModels",mGi),t.set("copilot/byok/saveApiKey",gGi),t.set("copilot/byok/deleteApiKey",jqi),t.set("copilot/byok/listApiKeys",$qi),t.set("copilot/byok/saveCustomProviderConfig",AGi),t.set("copilot/byok/listCustomProviderConfigs",Vqi),t.set("copilot/setModelPolicy",u$i),t.set("copilot/codeReview/reviewChanges",XGi),t.set("copilot/codeReview/reviewSnippets",e$i),t.set("git/commitGenerate",W$i),t.set("thinking/generateTitle",ZGi),t.set("mcp/getTools",r$i),t.set("mcp/updateToolsStatus",n$i),t.set("mcp/readResource",i$i),t.set("mcp/registry/listServers",yVi),t.set("mcp/registry/getServer",EVi),t.set("mcp/registry/getAllowlist",vVi),t.set("mcp/getPrompt",o$i),t.set("mcp/completePrompt",s$i),t.set("mcp/serverAction",a$i),t.set("mcpGateway/listServers",aVi),t.set("mcpGateway/getServerDetails",cVi),t.set("mcpGateway/serverAction",lVi),t.set("mcpGateway/applyConfig",sVi),t.set("plugins/list",QVi),t.set("plugins/install",FVi),t.set("plugins/installFromSource",UVi),t.set("plugins/uninstall",$Vi),t.set("plugins/enable",BVi),t.set("plugins/disable",LVi),t.set("plugins/update",VVi),t.set("plugins/marketplace/add",qVi),t.set("plugins/marketplace/remove",GVi),t.set("plugins/marketplace/list",HVi),t.set("plugins/marketplace/browse",jVi),t.set("githubApi/searchPR",K$i),t.set("githubApi/cancelCodingAgent",wGi),t.set("cloudAgent/listSessions",PGi),t.set("cloudAgent/getSessionLogs",kGi),t.set("cloudAgent/createJob",RGi),t.set("cloudAgent/addPullRequestComment",xGi),t.set("githubApi/listPullRequestChangedFiles",z$i),t.set("worktree/create",dYi),t.set("worktree/complete",fYi),t.set("worktree/delete",pYi),t.set("backgroundAgent/create",Aqi),t.set("backgroundAgent/send",Bqi),t.set("backgroundAgent/truncateHistory",Uqi),t.set("backgroundAgent/destroy",yqi),t.set("backgroundAgent/listModels",Dqi),t.set("backgroundAgent/listSessions",Rqi),t.set("backgroundAgent/resume",Oqi),t.set("backgroundAgent/stop",Fqi),t.set("backgroundAgent/interaction",Iqi),t.set("backgroundAgent/enableRemote",Cqi),t.set("backgroundAgent/disableRemote",_qi),t.set("backgroundAgent/getRemoteStatus",Sqi),t.set("backgroundAgent/getPlanPath",bqi),t.set("backgroundAgent/compactHistory",hqi),new Fie(t)}a(hYi,"getAllMethods");p();p();p();var mYi=de(PP());var Ry=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new mYi.NotificationType(this.name)}};var _8c=new fe("BackgroundAgent.notifications"),sFr=class extends Ry{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=S.Object({sessionId:S.String(),event:S.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},aFr=class extends Ry{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=S.Object({sessionId:S.String(),externalToolDefinitions:B4r})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){_8c.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Hs).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},gYi=[sFr,aFr];p();var cFr=class extends Ry{constructor(){super(...arguments);this.name="copilot/didChangeToken";this.params=S.Unknown()}static{a(this,"DidChangeTokenNotificationHandler")}handle(){this.ctx.get(Qt).resetToken("did_change_token_notification")}},AYi=[cFr];p();var v8c=new fe("agentCopilotTokenManager");function uFr(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(uFr,"tokenEndpointToApiUrl");function C8c(t,e){if(!e.tokenEndpoint)return $y(e);let r=uFr(e.tokenEndpoint);return r||v8c.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),$y({apiUrl:r})}a(C8c,"getUrlsFromParams");var lFr=class extends Ry{constructor(){super(...arguments);this.name=jQt.method;this.params=hvn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Ur),o=C8c(this.ctx,r);this.ctx.get($m).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})}},yYi=[lFr];p();var dFr=class extends Ry{constructor(){super(...arguments);this.name=zQt.method;this.params=Cvn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(Ru).get(n);s&&uni(this.ctx,s)}},fFr=class extends Ry{constructor(){super(...arguments);this.name=KQt.method;this.params=xvn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(Vv).handleShown(n)}},pFr=class extends Ry{constructor(){super(...arguments);this.name=YQt.method;this.params=bvn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(Ru),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),Pme(this.ctx,c)):qdt(this.ctx,c,o,void 0,void 0,"cumulative"))}},EYi=[dFr,fFr,pFr];p();var cIt=class extends Ry{constructor(){super(...arguments);this.name="window/workDoneProgress/cancel";this.params=S.Object({token:S.Union([S.String(),S.Number()])})}static{a(this,"WorkDoneProgressCancelNotification")}handle(r){this.ctx.get(wN).cancel(r.token)}};p();var hFr=class extends Ry{constructor(){super(...arguments);this.name="copilot/workspace/didChangeTrust";this.params=S.Object({items:S.Array(S.Object({folderUri:S.String(),trusted:S.Boolean()}))})}static{a(this,"WorkspaceDidChangeTrustNotificationHandler")}handle(r){let n=this.ctx.get(tp);for(let o of r.items)n.setTrust(o.folderUri,o.trusted)}},_Yi=[hFr];var b8c=[...gYi,...AYi,...yYi,...EYi,..._Yi,cIt];function vYi(t,e){for(let r of b8c){let n=new r(t),o=qu.Compile(n.params);e.onNotification(n.type,z0(t,async s=>{g9(s),o.Check(s)?await n.handle(s):$o.error(t,`Notification ${n.name}:`,new QA(o.Errors(s)))},`Notification ${n.name}`))}}a(vYi,"registerNotifications");p();var CYi=de(Xc());p();var V_e=de(Xc());var S8c=new V_e.ProtocolNotificationType("copilot/customAgent/didChange"),T8c=new V_e.ProtocolNotificationType("copilot/customSkill/didChange"),I8c=new V_e.ProtocolNotificationType("copilot/customPrompt/didChange"),x8c=new V_e.ProtocolNotificationType("copilot/customInstruction/didChange"),mFr=new V_e.ProtocolNotificationType("copilot/hook/didChange");function w8c(t){switch(t){case"agent":return S8c;case"skill":return T8c;case"prompt":return I8c;case"instructions":return x8c;case"hook":return mFr;default:return}}a(w8c,"notificationTypeFor");var lIt=class extends a0{constructor(r){super();this.ctx=r;this.logger=new fe("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=w8c(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(ar).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};var R8c=new CYi.ProtocolNotificationType("copilot/plugins/didChange"),Uie=class{constructor(e,r){this.ctx=e;this.logger=new fe("pluginChangeNotifier");this.subscription=r.onDidChangePlugins(()=>{this.notify()})}static{a(this,"CLSPluginChangeNotifier")}async notify(){let e;try{e=this.ctx.get(ar).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(R8c,{}),e.sendNotification(mFr,{})]);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 bYi=de(require("crypto")),SYi=require("os");Mo();var k8c=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function P8c(t){let e=t.replace(/-/g,":").toLowerCase();return!k8c.has(e)}a(P8c,"validateMacAddress");function D8c(){let t=(0,SYi.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(P8c(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(D8c,"getMac");var gFr;function N8c(){try{let t=D8c();return bYi.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(N8c,"getMacMachineId");function AFr(){return gFr||(gFr=N8c()||Mt()),gFr}a(AFr,"getMachineId");Mo();function yFr(t){let e=t??Mt()+Date.now();return new Ua(e,AFr(),AFr())}a(yFr,"createEditorSession");var TYi=yFr();p();var uIt=de(Xc());var EFr=new fe("AgentTextDocumentConfiguration"),_Fr=class{constructor(e){this.ctx=e;this.#e=new Wi;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return NS.create(e,r,n,o)}catch(s){throw EFr.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=NS.withChanges(e,r,n);for(let l of r)if(uIt.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])}.`;EFr.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=Wt.createAndMarkAsIssued({message:`Received ${g}`});Et(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 EFr.exception(this.ctx,o,".update"),o}}},WV=class extends $r{constructor(){super(...arguments);this.#e=new Wi;this.onDidOpenTextDocument=this.#e.event;this.#t=new Wi;this.onDidCloseTextDocument=this.#t.event;this.#r=new Wi;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new _Fr(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new uIt.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new Wi;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(ar).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(Fs(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=Fs(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=Fs(o.textDocument.uri);this._documents.delete(s),this.#t.fire({document:{uri:s}})}),this.connection.onNotification($Qt.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(tp);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(tp).forget(r.uri)}registerWorkspaceFolder(r){let n=r.trusted;typeof n=="boolean"&&this.ctx.get(tp).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(Fs(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 IYi=qu.Compile(Evn);function g9(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(xYi.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of cFe)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(SO).handleConfigurationChange(e.settings)}catch(n){$o.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return CTt(this.ctx,g9(e))}catch(r){$o.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(qf)}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)),vYi(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(ds).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(WV).didChangeWorkspaceFolders(c)}catch(l){$o.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(tp).setCapabilityEnabled(this.isWorkspaceTrustGateEnabled());let l=c.capabilities.copilot,u=g9(c.initializationOptions);if(u){if(!IYi.Check(u))throw new QA(IYi.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??[]):$o.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(zp).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(Ua,yFr(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(WV).init(c.workspaceFolders??[]),bXn(this.ctx),l&&(e.get(bn).setCapabilities(l),l.contentProvider&&la.registerSchemes(l.contentProvider),"openURL"in l&&jdt(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,$o.info(e,`${n.name} ${n.version} initialized`),e.get(Qt).primeToken().catch(m=>{e.get(ps).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(TI.DidChangeConfigurationNotification.type,{section:xYi}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(rb).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||vTt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(ps).sendInitNonAuthStatus(),new hEe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(z0(e,h,"onInitialized")),e.get(bN).init(),l?.token&&e.get(Ur).setTransientSession({}),l?.redirectedTelemetry&&qQi(e),wYi.lt(process.versions.node,"22.0.0")&&$o.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:TI.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:BQi(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 E1t;this.ctx.forceSet(qf,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");Vn(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(Fie).handlers.get(e);if(!o)return new TI.ResponseError(Ze.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new TI.ResponseError(Ze.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new TI.ResponseError(Ze.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!this.ctx.get(Ir).isEditorPluginInfoKnown())throw new TI.ResponseError(Ze.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),g9(r);try{let[s,c]=await o(this.ctx,n,r);return c?new TI.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new TI.ResponseError(Ze.RequestCancelled,"Request was canceled");if(s instanceof yi)return this.telemetryMethodFailure(e,s),new TI.ResponseError(Ze.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof TI.ResponseError||$o.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(GY).stop()}catch(e){$o.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(yF).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(g8).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose plugin contribution injector")}try{this.ctx.get(Uie).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose plugin change notifier")}try{this.ctx.get(iie).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP project cleanup subscription")}try{this.ctx.get(ey).dispose().catch(e=>{$o.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(TH).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(t2).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(y8).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose Claude Code agent service")}try{this.ctx.get(uc).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose agent plugin service")}this.ctx.get(Hs).shutdown().catch(e=>{$o.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(ug).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(qf,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(rb).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),Ihr(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(xd).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(X0).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},$o=new fe("lsp");var zv=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new RYi.ProtocolRequestType("conversation/context");this.typeCheck=qu.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(ar).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 kYi.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 QA(this.typeCheck.Errors(o));return o}}};var vFr=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")}},F9=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new vFr(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},dIt=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(Tc)}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(zo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new zv(this.turnContext.ctx,s,S.Object({value:S.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 bC(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:Mt()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var RN=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(F9).get(r);if(o)return new dIt(e,o);let c=(await ew(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 fJe(e.ctx):l=new yue(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new WRe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new WRe(e,l):new Prt(e,l)}};p();var zV=class extends F_{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 Lr([new Rr(r)],"success")}errorResult(r){return new Lr([new Rr(r)],"error")}};p();function M8c(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(M8c,"mapToolNameToKind");function O8c(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(O8c,"extractLocationsFromInput");function L8c(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(L8c,"mapToolCallStatus");var fIt=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=L8c(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=O8c(c.name,c.input);await this.reportToolCallStart(c.id,c.name,M8c(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 h3r=["authorization_code","refresh_token"],R_e=33428,xTt=class{constructor(e,r){this._logger=new fe("LoopbackAuthServer");this.nonce=(0,aWi.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=cWi.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 yi("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),HNe(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 yi(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),HNe(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 yi("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}),HNe(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 yi("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}),HNe(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(p3r,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(p3r)}})}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 ${R_e} 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(R_e,"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 wTt=require("crypto");var dFe=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,wTt.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,wTt.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 uLc="Timed out",lWi="Sign-in request was cancelled",m3r=class{static{a(this,"CodeFlow")}},k_e=class extends m3r{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=dFe.isServerSupported(n.code_challenge_methods_supported),h=f?dFe.createPKCEParameters():void 0;f?Nr.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Nr.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 xTt(A,this.ctx),_=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Nr.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new w_e(this.ctx).open(_);let v,b=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,P)=>{let D=setTimeout(()=>P(new Error(uLc)),3e5);b.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((P,D)=>{if(x.isCancellationRequested){Nr.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(lWi));return}let N=x.onCancellationRequested(()=>{Nr.info(this.ctx,"OAuth flow cancelled"),D(new Error(lWi))});b.push(N)}))}v=(await Promise.race(w)).code,Nr.info(this.ctx,"OAuth response received successfully")}catch(w){throw Nr.error(this.ctx,"OAuth flow error",w),w}finally{for(let x of b)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=>{Nr.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);Nr.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await PX(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 Nr.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 NN=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=>f3r([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(ri).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(zp),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=iWi(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 k_e(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&&f3r([...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(ri).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(nr).fetch(new URL(r).href,{method:"GET",headers:{Authorization:`token ${e}`}})}catch(o){return ITt.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 ITt.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 ITt.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 dLc=S.Object({scopes:S.Optional(S.Array(S.String({minLength:1}),{minItems:1})),authServer:S.Optional(S.String({minLength:1})),socialProvider:STt,loginHint:S.Optional(S.String({minLength:1}))});async function fLc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];let n=t.get(Ur),{status:o,user:s,sourceEnvVar:c}=await n.checkAndUpdateStatus({authAuthority:r.authServer});if(o==="OK")return[{status:o,user:s},null];if(c)return[null,{code:Ze.AuthEnvVarConflict,message:p7e(c)}];let l=await TTt(t,(u,d)=>new NN(u,NN.providerId,d,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider,loginHint:r.loginHint},e);if(!["OK","MaybeOK"].includes(l.status))throw new yi("OAuth authentication failed for unknown reasons. Please try again later.");return[l,null]}catch(n){if(n instanceof UU)return[null,{code:Ze.NoBrowserAvailable,message:n.message}];if(!(n instanceof yi))throw n;return[null,{code:Ze.CodeFlowFailed,message:n.message}]}}a(fLc,"handleSignInWithCodeFlowChecked");var uWi=Oe(dLc,fLc);p();p();p();var N9=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},fFe=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function dWi(t,e,r){return e.isCancellationRequested?Promise.reject(new N9):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new N9))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new fFe))},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(dWi,"raceWithCancellationAndTimeout");var pLc=["repo","workflow"];async function hLc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(nr).fetch(s,o)}catch(l){throw l instanceof Error&&tx(l)?new yi(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(hLc,"requestDeviceCode");async function mLc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...Gy(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(nr).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&tx(l)?new yi(`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 yi(c.error_description):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(mLc,"requestAccessToken");async function gLc(t,e){let n=await(await Gf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(gLc,"requestUserInfo");async function ALc(t,e,r){let n=r?.githubAppId??t.get(zp).findAppIdToAuthenticate(),o=r?.scopes??pLc,{serverUrl:s,apiUrl:c,authAuthority:l}=QU(t,r?.authAuthority),u=await hLc(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 N9("Sign-in request was cancelled");m=await mLc(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await gLc(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new N9("Sign-in request was cancelled");let y=m.scope?m.scope.split(" ").filter(E=>E.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(Ur),{status:c,user:l,sourceEnvVar:u}=await s.checkAndUpdateStatus({authAuthority:r.authServer});if(c==="OK")return[{status:c,user:l},null];if(u)return[null,{code:Ze.AuthEnvVarConflict,message:p7e(u)}];Nme(t,"deviceFlow");let d=t.get(Pie),f=await d.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(ar).connection.sendNotification(_Lc,{userCode:f.userCode,verificationUri:f.verificationUri,expiresIn:f.expiresIn});let h=await dWi(f.waitForAuth,e,vLc),m=await d.save(h);return J2(t,"deviceFlow",m.status,o()),[m,null]}catch(s){if(s instanceof N9)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof fFe)return J2(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:Ze.DeviceFlowFailed,message:"Sign-in request timed out"}];if(J2(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof yi))throw s;return[null,{code:Ze.DeviceFlowFailed,message:s.message}]}}a(CLc,"handleSignInWithDeviceFlowChecked");var pWi=Oe(ELc,CLc);p();var bLc=S.Object({githubToken:S.String({minLength:1}),user:S.String({minLength:1}),githubAppId:S.Optional(S.String({minLength:1}))});async function SLc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Ur);return[await t.get($T).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(SLc,"handleSignInWithGithubTokenChecked");var hWi=Oe(bLc,SLc);p();var TLc=S.Object({options:S.Optional(S.Object({}))});async function ILc(t,e,r){return[await t.get(Ur).signOutEditor(),null]}a(ILc,"handleSignOutChecked");var mWi=Oe(TLc,ILc);p();var xLc=S.Object({transaction:S.Optional(S.String()),stacktrace:S.Optional(S.String()),properties:S.Optional(S.Record(S.String(),S.String())),platform:S.Optional(S.String()),exception_detail:S.Optional(S.Array(S.Object({type:S.Optional(S.String()),value:S.Optional(S.String()),stacktrace:S.Optional(S.Array(S.Object({filename:S.Optional(S.String()),lineno:S.Optional(S.Union([S.String(),S.Integer()])),colno:S.Optional(S.Union([S.String(),S.Integer()])),function:S.Optional(S.String()),in_app:S.Optional(S.Boolean())})))})))}),g3r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function wLc(t,e,r){let n=t.get(ds),o=t.get(Ir).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&A4.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:lPt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},A4.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new g3r(r.stacktrace??"N/A",o.name);return l.stack=void 0,Qa(t,l,r.transaction??"",s,c),["OK",null]}a(wLc,"handleTelemetryExceptionChecked");var gWi=Oe(xLc,wLc);p();p();p();Oo();function A3r(t,e){let r=Date.now()+((t?.refresh_in??0)+qDt)*1e3;return new zW({token:`test token ${Mt()}`,refresh_in:0,expires_at:r,...t},e,r)}a(A3r,"createTestCopilotToken");var P_e=class extends Rh{constructor(){super(...arguments);this.defaultToken=A3r({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:A3r({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 RTt=class extends Rh{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:A3r(await this.envelopeFn())}}};var RLc=S.Object({options:S.Optional(S.Object({}))});async function kLc(t,e,r){let n=new P_e;return t.get(Ur).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet(Rh,n),t.get(ps).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(kLc,"handleTestingAlwaysAuthChecked");var y3r=Oe(RLc,kLc);p();Oo();var PLc=S.Object({messages:S.Array(S.Object({role:S.Enum(ic),content:S.String(),name:S.Optional(S.String())})),modelFamily:S.Optional(S.Enum(Rn)),stop:S.Optional(S.Array(S.String())),conversationOptions:S.Optional(S.Object({maxResponseTokens:S.Optional(S.Number()),temperature:S.Optional(S.Number())}))});async function DLc(t,e,r){let n=new oc(t),s=await Eq(t)?Rn.Gpt35turbo:Rn.CopilotBase,c=await t.get(el).getBestChatModelConfig([r.modelFamily??s]),l=await axe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:OA.user("test",Mt())},e,l),null]}a(DLc,"handleChatMLChecked");var AWi=Oe(PLc,DLc);p();p();p();var L_e=de(vzi(),1),w8h={ALPN_HTTP2:L_e.default.ALPN_HTTP2,ALPN_HTTP2C:L_e.default.ALPN_HTTP2C,ALPN_HTTP1_1:L_e.default.ALPN_HTTP1_1,ALPN_HTTP1_0:L_e.default.ALPN_HTTP1_0},{fetch:R8h,context:Czi,reset:k8h,noCache:P8h,h1:D8h,keepAlive:N8h,h1NoCache:M8h,keepAliveNoCache:O8h,cacheStats:L8h,clearCache:B8h,offPush:F8h,onPush:U8h,createUrl:Q8h,timeoutSignal:q8h,Body:j8h,Headers:bzi,Request:H8h,Response:G8h,AbortController:$8h,AbortError:VTt,AbortSignal:V8h,FetchBaseError:W8h,FetchError:z8h,ALPN_HTTP2:Y8h,ALPN_HTTP2C:K8h,ALPN_HTTP1_1:J8h,ALPN_HTTP1_0:Z8h}=L_e.default;var Tzi=require("crypto"),Izi=require("http"),xzi=require("stream"),wzi=require("util"),F_e=de(DP());var eFc=6e5,tFc=new F_e.ProtocolRequestType("copilot/fetch"),rFc=new F_e.ProtocolRequestType("copilot/fetchCancel"),nFc=new F_e.ProgressType,iFc=new F_e.ProtocolRequestType("copilot/fetchDisconnectAll"),qL=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},B_e=class extends nr{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(ds).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(ar).connection.sendRequest(iFc,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(ar).connection,c=(0,Tzi.randomUUID)(),l=new Fn.CancellationTokenSource,u=new xzi.PassThrough,d=a(()=>{s.sendRequest(rFc,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new VTt("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new qL("EditorFetcher received unexpected abort signal");if(o.aborted)throw new VTt("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(nFc,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new qL(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??eFc,y=setTimeout(()=>{At(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new qL("Request timed out from lsp server"))},A),E=a(()=>{g(new VTt("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",E),s.sendRequest(tFc,sFc(r,c,n),l.token).then(m).catch(_=>{let v="EditorFetcher request failed";_&&typeof _=="object"&&"message"in _&&(v+=`: ${String(_.message)}`),_&&typeof _=="object"&&"data"in _&&(v+=`: ${(0,wzi.inspect)(_.data)}`),g(new qL(v))}).finally(()=>{o?.removeEventListener("abort",E),clearTimeout(y)})});if(!h.status)throw new qL("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new rx(h.status,Izi.STATUS_CODES[h.status]??"",new bzi(h.headers),()=>oFc(u),()=>u)}};function oFc(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(oFc,"consumeStream");function sFc(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(sFc,"convertOptionsToParams");var aFc=S.Object({url:S.String(),headers:S.Optional(S.Record(S.String(),S.String())),body:S.Optional(S.String()),timeout:S.Optional(S.Number()),method:S.Optional(S.Union([S.Literal("GET"),S.Literal("POST"),S.Literal("DELETE")])),cancelBeforeRequest:S.Optional(S.Boolean()),cancelAfterRequest:S.Optional(S.Boolean()),cancelAfterFirstChunk:S.Optional(S.Boolean())});async function cFc(t,e,r){let n=new B_e(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 qL?y.message:String(y)}`},null]}let{status:g}=m,A=Object.fromEntries(Array.from(m.headers));try{if(d){let E=m.body();for await(let _ of E){let v=_.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 qL?y.message:String(y)}`},null]}}a(cFc,"handleTestingFetchChecked");var Rzi=Oe(aFc,cFc);p();var lFc=S.Object({});async function uFc(t,e,r){return await t.get(xd).flush(),["OK",null]}a(uFc,"handleTestingFlushPromiseQueueChecked");var kzi=Oe(lFc,uFc);p();p();p();var VV=class{static{a(this,"FileSearch")}};p();p();p();var WTt=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 Pzi=de(ti());var zTt="main.js",YTt=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=ahn(zTt,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new WTt(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new GVe(this.id++),Pzi.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new qVe(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new jVe(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new HVe(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new UVe(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 QVe(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 FVe(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(zTt+"'")&&(r=new Error(`Failed to load ${zTt}`),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(`${zTt} 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 _Fe=de(ti());var F9=new fe(Mfr),KTt=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){F9.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,_Fe.CancellationToken.None);return}F9.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new YTt(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{F9.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 dFc(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,_Fe.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{F9.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){F9.debug(this.ctx,`indexing workspace ${e}`);let r=K8t.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${K8t.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get(VV),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,_Fe.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));F9.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)})),F9.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{F9.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,_Fe.CancellationToken.None)}catch(n){F9.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return lfn(e)}};async function dFc(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(dFc,"createIndexableWorkspaceFolder");var fFc=S.Object({filePath:S.String(),code:S.String(),offset:S.Number(),languageId:S.String(),timeout:S.Optional(S.Number()),waitForContext:S.Optional(S.Boolean())});async function pFc(t,e,r){try{await t.get(qS).start();let n=t.get(KTt),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,Ofr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(AFc,"handleTestingNeverAuthChecked");var W3r=Oe(gFc,AFc);p();p();p();var z3r=class extends pp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},Mzi=a(t=>new z3r(t),"createTestCertificateReader");function K3r(t,e,r){let n=new Y3r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new rx(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(K3r,"createFakeResponse");function Ozi(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),K3r(t,n,Object.assign({"content-type":"application/json"},r))}a(Ozi,"createFakeJsonResponse");var vFe=class extends nr{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var JTt=class extends vFe{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var Y3r=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 J3r=class extends vFe{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(Ozi(200,this.fullConfig)):Promise.resolve(K3r(404,""))}},ZTt=class extends J3r{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 yFc=S.Object({expFlags:S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean()]))});function EFc(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(nr,new ZTt(n,t.get(nr)))}return["OK",null]}a(EFc,"handleTestingOverrideExpFlagsChecked");var Lzi=Oe(yFc,EFc);p();var _Fc=S.Object({rules:sUt});function vFc(t,e,r){return t.get(nc).setTestingRules(r.rules),["OK",null]}a(vFc,"handleTestingSetContentExclusionRulesChecked");var Bzi=Oe(_Fc,vFc);p();var CFc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),chunks:S.Array(S.String()),followUp:S.Optional(S.String()),suggestedTitle:S.Optional(S.String()),skills:S.Optional(S.Array(S.String())),references:S.Optional(S.Array(OO)),options:S.Optional(S.Object({}))});function bFc(t,e,r){return t.get(U9).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(bFc,"handleTestingSetSyntheticTurnsChecked");var Fzi=Oe(CFc,bFc);p();var SFc=S.Object({});async function TFc(t,e,r){let n=t.get(ts),o=t.get(qf);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(TFc,"handleTriggerShowMessageChecked");var Uzi=Oe(SFc,TFc);p();p();p();p();var Qzi=de(require("tls"));var U_e=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(pp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=Qzi.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 Zzi=de(require("http"));var KFc=407,wy=new fe("proxySocketFactory"),dk=class{static{a(this,"ProxySocketFactory")}},Lie=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 XTt(t){return new eFr(t,new tFr(t))}a(XTt,"getProxySocketFactory");var eFr=class extends dk{constructor(r,n,o=new bFe,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new Cn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(wy.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 Lie&&o.code===`ProxyStatusCode${KFc}`){wy.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return wy.debug(this.ctx,"Proxy authorization successful, caching result"),Et(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&&(wy.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(wy.debug(this.ctx,"Proxy authorization successful, received token"),o)return wy.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){wy.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);wy.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);wy.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return wy.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return wy.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return wy.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},tFr=class extends dk{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(ds).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{wy.debug(this.ctx,"Attempting to establish connection to proxy");let l=Zzi.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{wy.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new Lie(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new Lie(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(wy.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{wy.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new Lie(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{wy.debug(this.ctx,"Proxy socket connection timeout"),c(new Lie(`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"])}},bFe=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>de(Jzi()))}};var Bie=class extends nr{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new U_e(r),this.proxySocketFactory=r.get(dk),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Bo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Bo).getHttpSettings()),this.updateNoProxy(r.get(Bo).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(ds),s=this.proxySocketTimeoutForTesting;return Czi({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 HW(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new rx(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var j_e=class extends $m{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(pf).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=$y({serverUrl:u7e(r,n.serverUrl),apiUrl:u7e(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 H_e=class extends ZL{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){Qa(e,r,n)}};p();var G_e=class extends m4{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var eIt=class extends zP{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var tIt=class extends zh{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 rIt=class extends VV{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 Xzi(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(Xzi,"fakeChatModelConfiguration");function JFc(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a(JFc,"fakeEmbeddingModelConfiguration");var nIt=class extends el{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(Xzi(r))}getModelConfigurationById(e){return Promise.resolve({...Xzi(e),modelId:e})}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve(JFc(e))}};p();var iIt=class extends Vm{constructor(){super(...arguments);this.openedUrls=[];this.opened=new vA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},oIt=class extends ts{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()}async waitForMessages(){await Promise.all(this.warningPromises),await Promise.all(this.informationPromises)}};p();function eYi(t,e,r,n){return MS.create(l7e(t),e,r,n,e)}a(eYi,"createTextDocument");var rFr=class extends $r{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new Wi;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new Wi;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new Wi;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new Wi;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new Wi;this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event}static{a(this,"SimpleTestTextDocumentManager")}init(r){this._workspaceFolders=r.map(n=>({uri:n.uri,name:n.name??Ji(n.uri)}))}async readTextDocumentFromDisk(r){return super.readTextDocumentFromDisk(r)}getTextDocumentsUnsafe(){return this._openTextDocuments}setTextDocument(r,n,o){let s=eYi(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]=eYi(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}},sIt=class extends rFr{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 nFr=class extends qf{static{a(this,"NullLog")}logIt(...e){}},iFr=class extends Ur{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 ZFc(t){let e=new sue;e.set(Bo,t),e.set(LY,t);let r=new iFr(e,{accessToken:"",login:"user"});e.set(Ur,r),e.set(ds,new ds),e.set(tp,new tp),e.set(jI,new jI({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(pp,Mzi([])),e.set(dk,XTt(e)),e.set(bx,new bx),e.set(fP,new yje);let n=new P_e;e.set(Rh,n);let o=new Qt(e,!0);e.set(Qt,o);let s=new Op(e);return s.updateFromToken(n.defaultToken),e.set(Op,s),e.set(X0,new X0),e.set(eM,new eM),e.set(ts,new oIt),e.set(Vm,new iIt),e.set(ZL,new H_e),e.set(qf,new nFr),e.set(bC,new bC),e.set(Fa,new Fa("test-session","test-machine","test-device")),e.set(qI,new qI(()=>Promise.resolve("test-device"))),e.set($m,new j_e(e)),e.set(Pk,new boe),e.set(pf,new pf(e,"copilot-test")),e.set(Zt,new Zt(e)),e.set(nO,new nO(e,o)),e.set(j2,new j2),e.set(IP,new dle),e.set(ps,new mje),e.set(xd,new xd),e.set(t4,new t4(e)),e.set(VV,new rIt),e.set(Y2,new Y2(e)),e.set(I8,Ddt(e)),e.set(iy,new iy),e.set(Db,new Db),e.set(x8,x8.default),e.set(Lx,new Lx(e,!1)),e.set(zp,new zp),e.set(ii,new ii(e)),e.set(GT,new Odt),e.set(pm,new pm),e.set(hm,$lt(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(Nb,new Nb(e)),XFc(e),e.set(Pb,new Pb(e)),e.set(bn,new bn),e.set(m4,new G_e),e.set(bN,new bN),e.set(yw,new yw),e.set(oT,new oT(e)),e}a(ZFc,"_createBaselineContext");function XFc(t){t.set(Yo,new Yo(t)),t.set(Tc,new Tc(t)),t.set(kA,new kA(t)),t.set(Yh,new Yh),t.set(Ag,new Ag),t.set(zh,new tIt),t.set(lk,new lk(t,[])),t.set(el,new nIt),t.set(zP,new eIt),t.set(NO,new NO(t));let e=new wN(t);t.set(wN,e),t.set(ak,new ak(e,t)),t.set(HO,new HO(t)),t.set(TI,new VSt),t.set(ZC,new ZC(t.get(ak),t.get(TI),t)),t.set(m0,new m0)}a(XFc,"registerConversation");function tYi(){let t=ZFc(new LY(new fle,new Map));return t.set(nr,new JTt),t.set(Ir,new oFr),t.set($r,new sIt(t)),t.set(qo,new TQ),t.set(nc,new nc(t)),t.set(Au,new Au(t)),t.set(HS,new uYe),t.set(gO,new gO(t)),t.set(r4,new ime),t.set(U2,new Qct),t.set(jl,new Vze),t.set(wA,new wA(t)),t.set(a0,new Pze),t.set(fm,new fm),kze(t),t.set(ry,new fEe(t)),t}a(tYi,"createLibTestingContext");var oFr=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 nYi=de(require("fs"));var rYi=`${process.env.HOME}/.copilot-testing-gh-token`,aIt,cIt;function iYi(t){let e=oYi(),r=new RTt(e8c);return t.forceSet(Rh,r),t.get(Ur).setTransientSession(e),r}a(iYi,"setIntegrationTokenManager");var e8c=a(async()=>{if(cIt)return cIt;let t=await oYi(),e=tYi(),r=new Bie(e);return e.forceSet(nr,r),cIt=jDt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new yi('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),cIt},"getEnvelope");async function oYi(){let{session:t}=k5t(process.env);if(t)return t;try{aIt??=(await nYi.promises.readFile(rYi)).toString().trim()}catch{aIt??=process.env.GITHUB_TOKEN??""}if(!aIt)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 ${rYi}. Run "npm run get_token" to get one.`);return{...$y({}),accessToken:aIt,login:"copilot-client tests"}}a(oYi,"getTestingGitHubSession");var t8c=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function r8c(t,e,r){return iYi(t),await t.get(Qt).primeToken(),["OK",null]}a(r8c,"handleTestingUseTestingTokenChecked");var sYi=Oe(t8c,r8c);p();var n8c=S.Object({});async function i8c(t,e,r){return await new mEe().uninstall(t),["OK",null]}a(i8c,"handleUninstallChecked");var aYi=Oe(n8c,i8c);p();var o8c=VXn;function s8c(t,e,r){let n=t.get(hm),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(s8c,"unregisterContextProviders");var cYi=Oe(o8c,s8c);p();var sFr=de(require("os"));var a8c=S.Object({expectedCertificate:S.String()});async function c8c(t,e,r){let o=(await mot(t).getAllRootCAs()).map(I_e),s=I_e(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${n3r(s)}. Only found those installed on the system:${sFr.EOL}${o.map(c=>"- "+n3r(c)).join(sFr.EOL)}`},null]}a(c8c,"handleVerifyCertificateChecked");var lYi=Oe(a8c,c8c);p();var l8c=S.Object({});async function u8c(){return[{status:!!await new bFe().load()},null]}a(u8c,"handleVerifyKerberosChecked");var uYi=Oe(l8c,u8c);p();var d8c=S.Object({source:S.String(),version:S.Number(),uri:S.String()});async function f8c(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(f8c,"handleVerifyStateChecked");var dYi=Oe(d8c,f8c);p();var p8c=S.Object({});function h8c(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(h8c,"handleVerifyWorkspaceStateChecked");var fYi=Oe(p8c,h8c);p();p();var V_e=de(require("fs/promises")),pYi=de(require("os")),Xd=de(require("path"));var Np=new fe("GitWorktreeService"),m8c=20,$_e=class{constructor(e){this.ctx=e;this.gitInstances=new Cn(m8c)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=Xd.resolve(e),n=this.gitInstances.get(r);return n||(n=Gue(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=Xd.resolve(e);Np.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return Np.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw Np.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?(Np.info(this.ctx,`Skipping checkpoint commit for ${Xd.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)),Np.info(this.ctx,`Created ${n} commit for ${Xd.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){Np.info(this.ctx,`Snapshotting copied changes in ${Xd.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 Np.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await V_e.mkdtemp(Xd.join(pYi.tmpdir(),"copilot-worktree-")),o=Xd.join(n,"changes.patch");try{Np.info(this.ctx,`Writing temporary patch for ${Xd.resolve(e)} to ${o} (${r.length} chars)`),await V_e.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 V_e.rm(n,{recursive:!0,force:!0}),Np.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=Xd.basename(r),h=Xd.join(Xd.dirname(r),`${f}.worktrees`),m=Xd.join(h,d);return Np.info(this.ctx,`Preparing worktree creation for ${Xd.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])),Np.info(this.ctx,`Created worktree ${m} from ${Xd.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){Np.info(this.ctx,`Preparing to remove worktree ${e} from ${Xd.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),Np.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return Np.info(this.ctx,`Skipping status lookup for ${Xd.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){Np.info(this.ctx,`Applying worktree changes from ${Xd.resolve(e)} to ${Xd.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");Np.info(this.ctx,o?`Committed pending worktree changes in ${Xd.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${Xd.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return Np.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 Np.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 Np.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"])),Np.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),Np.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),Np.info(this.ctx,`Popped stash in ${e}`)}};p();var hYi=de(ti());var x1=new fe("WorktreeService");var g8c=new hYi.ProtocolRequestType("worktree/requestUserDecision"),SFe=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 x1.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";x1.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(ar).connection.sendRequest(g8c,{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?(x1.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(x1.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){x1.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(x1.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&&(x1.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(x1.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},x1.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);x1.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw x1.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return x1.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){x1.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return x1.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var A8c="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",y8c=["already exists in working directory","patch does not apply","patch failed"];function E8c(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&y8c.some(n=>e.includes(n))?A8c:`Failed to apply worktree changes: ${e}`}a(E8c,"getWorktreeCompleteErrorMessage");var _8c=S.Object({repositoryPath:S.String()});async function v8c(t,e,r){try{let n=new $_e(t),o=new SFe(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(v8c,"handleWorktreeCreateChecked");var mYi=Oe(_8c,v8c),C8c=S.Object({repositoryPath:S.String(),worktreePath:S.String(),baseCommit:S.String()});async function b8c(t,e,r){try{let n=new $_e(t);return[{success:!0,baseCommit:(await new SFe(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:Ze.InternalError,message:E8c(n)}]}}a(b8c,"handleWorktreeCompleteChecked");var gYi=Oe(C8c,b8c),S8c=S.Object({worktreePath:S.String(),repositoryPath:S.String()});async function T8c(t,e,r){try{return await new $_e(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(T8c,"handleWorktreeDeleteChecked");var AYi=Oe(S8c,T8c);var Fie=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function yYi(){let t=new Map;return t.set(nVi.method,iVi),t.set("getCompletions",H$i),t.set("getCompletionsCycling",G$i),t.set("getDefaultFileSafetyRules",$$i),t.set("copilot/parseTerminalCommand",LVi),t.set("getPanelCompletions",z$i),t.set(_$i.method,v$i),t.set("getVersion",K$i),t.set("getUserInfo",Y$i),t.set("setEditorInfo",tWi),t.set("checkStatus",kGi),t.set("checkQuota",RGi),t.set("checkFileStatus",xGi),t.set("claude/checkCliCompatibility",bGi),t.set("codex/checkCliCompatibility",IGi),t.set("signInInitiate",l3r),t.set("signIn",l3r),t.set("signInWithCodeFlow",uWi),t.set("signInWithDeviceFlow",pWi),t.set("signInConfirm",rWi),t.set("signInWithGithubToken",hWi),t.set("signOut",mWi),t.set("auth/listAvailableTokens",Gqi),t.set("auth/useExistingToken",$qi),t.set("notifyShown",OVi),t.set("notifyAccepted",DVi),t.set("notifyRejected",MVi),t.set("notifyNextEditRejected",NVi),t.set("telemetry/exception",gWi),t.set("textDocument/copilotInlineEdit",PVi),t.set("testing/overrideExpFlags",Lzi),t.set("testing/alwaysAuth",y3r),t.set("testing/setAlwaysAuthed",y3r),t.set("testing/neverAuth",W3r),t.set("testing/setNeverAuthed",W3r),t.set("testing/useTestingToken",sYi),t.set("testing/setCompletionDocuments",U$i),t.set("testing/setPanelCompletionDocuments",y$i),t.set("testing/setNextEditDocument",IVi),t.set("testing/triggerShowMessageRequest",Uzi),t.set("testing/flushPromiseQueue",kzi),t.set("testing/getDocument",Nzi),t.set("testing/chatml",AWi),t.set("testing/setSyntheticTurns",Fzi),t.set("testing/fetch",Rzi),t.set("testing/setContentExclusionRules",Bzi),t.set("testing/getContext",Dzi),t.set("uninstall",aYi),t.set("debug/diagnostics",D$i),t.set("debug/listCertificates",oVi),t.set("debug/verifyState",dYi),t.set("debug/verifyCertificate",lYi),t.set("debug/verifyKerberos",uYi),t.set("debug/verifyWorkspaceState",fYi),t.set("debug/getAgentDebugLog",M$i),t.set("debug/exportAgentDebugLog",N$i),t.set("context/registerProviders",JVi),t.set("context/unregisterProviders",cYi),t.set("conversation/preconditions",zGi),t.set("conversation/persistence",WGi),t.set("conversation/create",HGi),t.set("conversation/turn",ZGi),t.set("conversation/turnDelete",XGi),t.set("conversation/destroy",GGi),t.set("conversation/compress",UGi),t.set("conversation/rating",YGi),t.set("conversation/copyCode",BGi),t.set("conversation/insertCode",FGi),t.set("conversation/templates",JGi),t.set("conversation/modes",$Gi),t.set("conversation/agents",LGi),t.set("conversation/registerTools",KGi),t.set("conversation/unregisterTools",e$i),t.set("conversation/updateToolsStatus",t$i),t.set("conversation/notifyCodeAcceptance",VGi),t.set("customAgent/registerExtensionAgents",b$i),t.set("customAgent/unregisterExtensionAgents",S$i),t.set("copilot/customAgent/list",C$i),t.set("copilot/customSkill/list",x$i),t.set("copilot/customPrompt/list",I$i),t.set("copilot/customInstruction/list",T$i),t.set("copilot/hook/list",tVi),t.set("copilot/models",f$i),t.set("copilot/models/getModelMetadataList",p$i),t.set("copilot/byok/saveModel",CGi),t.set("copilot/byok/deleteModel",Wqi),t.set("copilot/byok/listModels",EGi),t.set("copilot/byok/saveApiKey",_Gi),t.set("copilot/byok/deleteApiKey",Vqi),t.set("copilot/byok/listApiKeys",Yqi),t.set("copilot/byok/saveCustomProviderConfig",vGi),t.set("copilot/byok/listCustomProviderConfigs",Kqi),t.set("copilot/setModelPolicy",h$i),t.set("copilot/codeReview/reviewChanges",n$i),t.set("copilot/codeReview/reviewSnippets",i$i),t.set("git/commitGenerate",J$i),t.set("thinking/generateTitle",r$i),t.set("mcp/getTools",s$i),t.set("mcp/updateToolsStatus",a$i),t.set("mcp/readResource",c$i),t.set("mcp/registry/listServers",CVi),t.set("mcp/registry/getServer",bVi),t.set("mcp/registry/getAllowlist",TVi),t.set("mcp/getPrompt",l$i),t.set("mcp/completePrompt",u$i),t.set("mcp/serverAction",d$i),t.set("mcpGateway/listServers",dVi),t.set("mcpGateway/getServerDetails",fVi),t.set("mcpGateway/serverAction",pVi),t.set("mcpGateway/applyConfig",uVi),t.set("plugins/list",GVi),t.set("plugins/install",jVi),t.set("plugins/installFromSource",HVi),t.set("plugins/uninstall",YVi),t.set("plugins/enable",qVi),t.set("plugins/disable",QVi),t.set("plugins/update",KVi),t.set("plugins/marketplace/add",$Vi),t.set("plugins/marketplace/remove",zVi),t.set("plugins/marketplace/list",WVi),t.set("plugins/marketplace/browse",VVi),t.set("githubApi/searchPR",eVi),t.set("githubApi/cancelCodingAgent",DGi),t.set("cloudAgent/listSessions",OGi),t.set("cloudAgent/getSessionLogs",MGi),t.set("cloudAgent/createJob",NGi),t.set("cloudAgent/addPullRequestComment",PGi),t.set("githubApi/listPullRequestChangedFiles",Z$i),t.set("worktree/create",mYi),t.set("worktree/complete",gYi),t.set("worktree/delete",AYi),t.set("backgroundAgent/create",vqi),t.set("backgroundAgent/send",qqi),t.set("backgroundAgent/truncateHistory",Hqi),t.set("backgroundAgent/destroy",Cqi),t.set("backgroundAgent/listModels",Lqi),t.set("backgroundAgent/listSessions",Nqi),t.set("backgroundAgent/resume",Uqi),t.set("backgroundAgent/stop",jqi),t.set("backgroundAgent/interaction",kqi),t.set("backgroundAgent/enableRemote",Iqi),t.set("backgroundAgent/disableRemote",Sqi),t.set("backgroundAgent/getRemoteStatus",wqi),t.set("backgroundAgent/getPlanPath",xqi),t.set("backgroundAgent/compactHistory",yqi),new Fie(t)}a(yYi,"getAllMethods");p();p();p();var EYi=de(DP());var Ry=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new EYi.NotificationType(this.name)}};var I8c=new fe("BackgroundAgent.notifications"),aFr=class extends Ry{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=S.Object({sessionId:S.String(),event:S.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},cFr=class extends Ry{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=S.Object({sessionId:S.String(),externalToolDefinitions:F4r})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){I8c.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Hs).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},_Yi=[aFr,cFr];p();var lFr=class extends Ry{constructor(){super(...arguments);this.name="copilot/didChangeToken";this.params=S.Unknown()}static{a(this,"DidChangeTokenNotificationHandler")}handle(){this.ctx.get(Qt).resetToken("did_change_token_notification")}},vYi=[lFr];p();var x8c=new fe("agentCopilotTokenManager");function dFr(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(dFr,"tokenEndpointToApiUrl");function w8c(t,e){if(!e.tokenEndpoint)return $y(e);let r=dFr(e.tokenEndpoint);return r||x8c.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),$y({apiUrl:r})}a(w8c,"getUrlsFromParams");var uFr=class extends Ry{constructor(){super(...arguments);this.name=HQt.method;this.params=mvn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Ur),o=w8c(this.ctx,r);this.ctx.get($m).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})}},CYi=[uFr];p();var fFr=class extends Ry{constructor(){super(...arguments);this.name=YQt.method;this.params=bvn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(Ru).get(n);s&&hni(this.ctx,s)}},pFr=class extends Ry{constructor(){super(...arguments);this.name=JQt.method;this.params=wvn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(Wv).handleShown(n)}},hFr=class extends Ry{constructor(){super(...arguments);this.name=KQt.method;this.params=Svn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(Ru),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),Dme(this.ctx,c)):jdt(this.ctx,c,o,void 0,void 0,"cumulative"))}},bYi=[fFr,pFr,hFr];p();var lIt=class extends Ry{constructor(){super(...arguments);this.name="window/workDoneProgress/cancel";this.params=S.Object({token:S.Union([S.String(),S.Number()])})}static{a(this,"WorkDoneProgressCancelNotification")}handle(r){this.ctx.get(RN).cancel(r.token)}};p();var mFr=class extends Ry{constructor(){super(...arguments);this.name="copilot/workspace/didChangeTrust";this.params=S.Object({items:S.Array(S.Object({folderUri:S.String(),trusted:S.Boolean()}))})}static{a(this,"WorkspaceDidChangeTrustNotificationHandler")}handle(r){let n=this.ctx.get(tp);for(let o of r.items)n.setTrust(o.folderUri,o.trusted)}},SYi=[mFr];var R8c=[..._Yi,...vYi,...CYi,...bYi,...SYi,lIt];function TYi(t,e){for(let r of R8c){let n=new r(t),o=qu.Compile(n.params);e.onNotification(n.type,z0(t,async s=>{A9(s),o.Check(s)?await n.handle(s):Vo.error(t,`Notification ${n.name}:`,new QA(o.Errors(s)))},`Notification ${n.name}`))}}a(TYi,"registerNotifications");p();var IYi=de(Xc());p();var W_e=de(Xc());var k8c=new W_e.ProtocolNotificationType("copilot/customAgent/didChange"),P8c=new W_e.ProtocolNotificationType("copilot/customSkill/didChange"),D8c=new W_e.ProtocolNotificationType("copilot/customPrompt/didChange"),N8c=new W_e.ProtocolNotificationType("copilot/customInstruction/didChange"),gFr=new W_e.ProtocolNotificationType("copilot/hook/didChange");function M8c(t){switch(t){case"agent":return k8c;case"skill":return P8c;case"prompt":return D8c;case"instructions":return N8c;case"hook":return gFr;default:return}}a(M8c,"notificationTypeFor");var uIt=class extends a0{constructor(r){super();this.ctx=r;this.logger=new fe("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=M8c(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(ar).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};var O8c=new IYi.ProtocolNotificationType("copilot/plugins/didChange"),Uie=class{constructor(e,r){this.ctx=e;this.logger=new fe("pluginChangeNotifier");this.subscription=r.onDidChangePlugins(()=>{this.notify()})}static{a(this,"CLSPluginChangeNotifier")}async notify(){let e;try{e=this.ctx.get(ar).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(O8c,{}),e.sendNotification(gFr,{})]);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 xYi=de(require("crypto")),wYi=require("os");Oo();var L8c=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function B8c(t){let e=t.replace(/-/g,":").toLowerCase();return!L8c.has(e)}a(B8c,"validateMacAddress");function F8c(){let t=(0,wYi.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(B8c(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(F8c,"getMac");var AFr;function U8c(){try{let t=F8c();return xYi.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(U8c,"getMacMachineId");function yFr(){return AFr||(AFr=U8c()||Mt()),AFr}a(yFr,"getMachineId");Oo();function EFr(t){let e=t??Mt()+Date.now();return new Fa(e,yFr(),yFr())}a(EFr,"createEditorSession");var RYi=EFr();p();var dIt=de(Xc());var _Fr=new fe("AgentTextDocumentConfiguration"),vFr=class{constructor(e){this.ctx=e;this.#e=new Wi;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return MS.create(e,r,n,o)}catch(s){throw _Fr.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=MS.withChanges(e,r,n);for(let l of r)if(dIt.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])}.`;_Fr.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=Wt.createAndMarkAsIssued({message:`Received ${g}`});Et(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 _Fr.exception(this.ctx,o,".update"),o}}},zV=class extends $r{constructor(){super(...arguments);this.#e=new Wi;this.onDidOpenTextDocument=this.#e.event;this.#t=new Wi;this.onDidCloseTextDocument=this.#t.event;this.#r=new Wi;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new vFr(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new dIt.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new Wi;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(ar).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(Fs(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=Fs(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=Fs(o.textDocument.uri);this._documents.delete(s),this.#t.fire({document:{uri:s}})}),this.connection.onNotification(VQt.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(tp);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(tp).forget(r.uri)}registerWorkspaceFolder(r){let n=r.trusted;typeof n=="boolean"&&this.ctx.get(tp).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(Fs(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 kYi=qu.Compile(_vn);function A9(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(PYi.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of uFe)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(SO).handleConfigurationChange(e.settings)}catch(n){Vo.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return bTt(this.ctx,A9(e))}catch(r){Vo.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(qf)}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)),TYi(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(ds).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(zV).didChangeWorkspaceFolders(c)}catch(l){Vo.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(tp).setCapabilityEnabled(this.isWorkspaceTrustGateEnabled());let l=c.capabilities.copilot,u=A9(c.initializationOptions);if(u){if(!kYi.Check(u))throw new QA(kYi.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??[]):Vo.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(zp).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(Fa,EFr(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(zV).init(c.workspaceFolders??[]),xXn(this.ctx),l&&(e.get(bn).setCapabilities(l),l.contentProvider&&la.registerSchemes(l.contentProvider),"openURL"in l&&Hdt(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,Vo.info(e,`${n.name} ${n.version} initialized`),e.get(Qt).primeToken().catch(m=>{e.get(ps).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(xI.DidChangeConfigurationNotification.type,{section:PYi}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(rb).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||CTt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(ps).sendInitNonAuthStatus(),new mEe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(z0(e,h,"onInitialized")),e.get(SN).init(),l?.token&&e.get(Ur).setTransientSession({}),l?.redirectedTelemetry&&$Qi(e),DYi.lt(process.versions.node,"22.0.0")&&Vo.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:xI.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:qQi(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 _1t;this.ctx.forceSet(qf,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");Vn(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(Fie).handlers.get(e);if(!o)return new xI.ResponseError(Ze.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new xI.ResponseError(Ze.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new xI.ResponseError(Ze.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!this.ctx.get(Ir).isEditorPluginInfoKnown())throw new xI.ResponseError(Ze.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),A9(r);try{let[s,c]=await o(this.ctx,n,r);return c?new xI.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new xI.ResponseError(Ze.RequestCancelled,"Request was canceled");if(s instanceof yi)return this.telemetryMethodFailure(e,s),new xI.ResponseError(Ze.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof xI.ResponseError||Vo.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get($Y).stop()}catch(e){Vo.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(EF).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(A8).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose plugin contribution injector")}try{this.ctx.get(Uie).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose plugin change notifier")}try{this.ctx.get(iie).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose MCP project cleanup subscription")}try{this.ctx.get(ey).dispose().catch(e=>{Vo.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){Vo.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(IH).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(r2).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(E8).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose Claude Code agent service")}try{this.ctx.get(uc).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose agent plugin service")}this.ctx.get(Hs).shutdown().catch(e=>{Vo.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(ug).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(qf,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(rb).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),xhr(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(xd).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(X0).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},Vo=new fe("lsp");var Yv=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new NYi.ProtocolRequestType("conversation/context");this.typeCheck=qu.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(ar).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 MYi.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 QA(this.typeCheck.Errors(o));return o}}};var CFr=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")}},U9=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new CFr(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},fIt=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(Tc)}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(Yo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new Yv(this.turnContext.ctx,s,S.Object({value:S.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 SC(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:Mt()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var kN=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(U9).get(r);if(o)return new fIt(e,o);let c=(await tw(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 mJe(e.ctx):l=new yue(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new WRe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new WRe(e,l):new Mrt(e,l)}};p();var YV=class extends F_{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 Lr([new Rr(r)],"success")}errorResult(r){return new Lr([new Rr(r)],"error")}};p();function Q8c(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(Q8c,"mapToolNameToKind");function q8c(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(q8c,"extractLocationsFromInput");function j8c(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(j8c,"mapToolCallStatus");var pIt=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=j8c(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=q8c(c.name,c.input);await this.reportToolCallStart(c.id,c.name,Q8c(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 pIt(t){try{if((await t.get(Ur).checkAndUpdateStatus()).status==="OK")return;let n=await STt(t,(o,s)=>new DN(o,DN.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new fo(Ze.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof FU?new fo(Ze.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof yi?new fo(Ze.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(pIt,"performACPGitHubOAuth");function hIt(t){if(t!=="github_oauth")throw new fo(Ze.InvalidParams,`Unknown authentication method: ${t}`)}a(hIt,"validateAuthMethodId");async function mIt(t){let r=await t.get(Ur).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw fo.authRequired()}a(mIt,"requireACPAuthenticated");var PYi=[{id:Cl.Ask.id,name:Cl.Ask.name,description:Cl.Ask.description},{id:Cl.Agent.id,name:Cl.Agent.name,description:Cl.Agent.description}],gIt=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 ij&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}At(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:Crt,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:V1(this.ctx)},authMethods:n})}async newSession(e){At(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=Mt(),n=Mt(),s=this.ctx.get(zo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:Ks(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 At(this.ctx,"acp.authenticate"),hIt(e.methodId),await pIt(this.ctx),{}}async requireAuthenticated(){await mIt(this.ctx)}async prompt(e){At(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 Fn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=Mt(),l=new Xf(s,c),u=r.currentModeId===Cl.Ask.id?Cl.Ask:Cl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(zo),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 fIt(this.connection,e.sessionId),g=new hw(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(F_);A instanceof zV&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let E=await this.ctx.get(RN).createProcessor(g,e.sessionId);try{await E.process(m,r.cancellationTokenSource.token,void 0,void 0,{id:n})}finally{A instanceof zV&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(F_);if(s instanceof zV&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){At(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){At(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ze.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new fo(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){At(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ze.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new fo(Ze.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return rx(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?PYi:PYi.filter(e=>e.id===Cl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?Cl.Agent.id:Cl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(xs).getMetadata(),r=[],n=V_;r.push({modelId:V_,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!(sle.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 DYi=require("node:child_process"),yIt=require("node:stream");var AIt=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,DYi.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:H9t}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{Vn(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||At(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=yIt.Writable.toWeb(this.cliProcess.stdin),c=yIt.Readable.toWeb(this.cliProcess.stdout),l=GRe(s,c);return this._cliConnection=new wrt(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 EIt=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 ij&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return At(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:Crt,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:V1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return At(this.ctx,"acp.cli.authenticate"),hIt(e.methodId),await pIt(this.ctx),{}}async newSession(e){return At(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return At(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return At(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return At(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return At(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return At(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return At(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return At(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 fo(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:V1(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]),At(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw Vn(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 fo(Ze.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await mIt(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 Xwt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(voo(),_oo)),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 Coo(t){let e=new sue;e.set(Lo,t),e.set(Cx,new Cx),e.set(ds,new ds),e.set(q2,new q2);let r=new Qt(e);return e.set(Qt,r),e.set(Zt,new Zt(e)),e.set(rO,new rO(e,r)),e.set(XN,new XN),e.set(Op,new Op(e)),e.set(X0,new X0),e.set(CC,new CC),e.set(AO,new oxe),e.set(TP,new dle),e.set(dP,new aSe),e.set(xd,new xd),e.set(t4,new t4(e)),e.set(ii,new ii(e)),e.set(z2,new z2(e)),e.set(T8,Pdt(e)),e.set(iy,new iy),e.set(Db,new Db),e.set(I8,I8.default),e.set(_f,new _f(e)),e.set(Ox,new Ox(e)),e.set(zp,new zp),e.set(Pb,new Pb(e)),e.set(bn,new bn),e.set(Au,new Au(e)),e.set(gO,new gO(e)),e.set(CN,new CN),e.set(LK,new LK(e)),e}a(Coo,"createCommonContext");p();var eRt=class extends qf{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||y1t(r))&&this.console.warn(`[${o}]`,...s)}};p();var Ioo=require("node:os");var grl=new fe("repository"),uoe="\\\\",xoo="(?:[#;].*)",zve=`(?:[^"${uoe}]|${uoe}.)`,Arl="[0-9A-Za-z-]",boo=`[A-Za-z]${Arl}*`,woo=`\\s*${xoo}?$`,Roo=`(?:[^"${uoe};#]|${uoe}.)`,yrl=`(?:"${zve}*"|"${zve}*(?${uoe})$)`,Erl=`(?:${Roo}|${yrl})+`,_rl=`(?:(?${uoe})$)`,koo=`(?${Erl})${_rl}?${woo}`,Soo=new RegExp(`^${koo}`),vrl=new RegExp(`^(?${zve}*(?:(?${uoe})$|(?")))`),Crl=new RegExp(`^\\s*(?:(?${boo})\\s*=\\s*${koo}|(?${boo})${woo})`),brl=new RegExp(`(?${Roo}+)|"(?${zve}*)"`,"g"),Too="[-.0-9A-Za-z]+",Srl=`\\s+"(?${zve}*)"`,Trl=`\\s+"(?${zve}*)"`,Irl=new RegExp(`^\\s*\\[(?:(?${Too})${Srl}|${Trl}|(?${Too}))\\]`),xrl=new RegExp(`^\\s*${xoo}$`),l7r=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(Irl);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(Crl);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(vrl),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(Soo),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(Soo),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(brl)].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(){xrl.test(this.line)&&(this.line="")}},tRt=class extends NP{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await _f.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 hK)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new l7r(o),c=new hK;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(Qo).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&grl.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=wa(this.xdgConfigUri(),"git","config"),s=wa(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(Ji(r).toLowerCase()!=="config.worktree")return;let n=uf(r),o=wa(n,"commondir");try{let s=(await e.get(Qo).readFileString(o)).trimEnd();return wa($W(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?Ks(process.env.XDG_CONFIG_HOME):wa(this.homeUri(),".config")}homeUri(){return Ks((0,Ioo.homedir)())}};p();var Poo=require("child_process");var rRt=class extends NP{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,Poo.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){Y9t.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=rs(r);if(n===void 0)return;let o;try{o=(await lO()).path}catch(c){Y9t.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 hK;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 Doo(t){let e=Coo(t);return wrl(e),e.set(pp,fot(e)),e.set(uk,ZTt(e)),e.set(NP,new Eze([new rRt,new tRt])),e}a(Doo,"createProductionContext");function wrl(t){t.set(QI,QI.fromEnvironment(!1)),t.set(ZL,new j_e),t.set(qf,new eRt(console))}a(wrl,"setupRudimentaryLogging");var nXh=new fe("context");p();var aso=require("fs");p();p();var rso=require("node:url");p();p();var Yve=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Moo=new Set,u7r=typeof process=="object"&&process?process:{},Ooo=a((t,e,r,n)=>{typeof u7r.emitWarning=="function"?u7r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),nRt=globalThis.AbortController,Noo=globalThis.AbortSignal;if(typeof nRt>"u"){Noo=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},nRt=class{static{a(this,"AbortController")}constructor(){e()}signal=new Noo;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=u7r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Ooo("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 Rrl=a(t=>!Moo.has(t),"shouldWarn");var gW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),Loo=a(t=>gW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Kve:null:null,"getUintArray"),Kve=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},d7r=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=Loo(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]}},J8e=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;#E;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#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.#_(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:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!gW(r))throw new TypeError("max option must be a nonnegative integer");let x=r?Loo(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(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,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=d7r.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&&!gW(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!gW(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=gW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!gW(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 P="LRU_CACHE_UNBOUNDED";Rrl(P)&&(Moo.add(P),Ooo("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new Kve(this.#e),r=new Kve(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=Yve.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?Yve.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=Yve.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.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#updateItemAge");#d=a(()=>{},"#statusTTL");#L=a(()=>{},"#setItemTTL");#_=a(()=>!1,"#isStale");#D(){let e=new Kve(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(!gW(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!gW(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.#_(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.#_(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.#_(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.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(Yve.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.#E&&this.#T){c.ttl=this.#E[r];let l=Yve.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=Yve.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.#E&&this.#k(),this.#E&&(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.#_(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.#_(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 nRt,{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,E=!1)=>{let{aborted:_}=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),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__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:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(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,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),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 nRt}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:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={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:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let N=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",N&&(_.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),D=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",D&&R&&(_.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.#_(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.#E&&this.#T&&(this.#E.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 Xve=require("node:path"),Voo=require("node:url"),KL=require("fs"),Url=de(require("node:fs"),1),EW=require("node:fs/promises");p();var uRt=require("node:events"),y7r=de(require("node:stream"),1),qoo=require("node:string_decoder");var Boo=typeof process=="object"&&process?process:{stdout:null,stderr:null},krl=a(t=>!!t&&typeof t=="object"&&(t instanceof yW||t instanceof y7r.default||Prl(t)||Drl(t)),"isStream"),Prl=a(t=>!!t&&typeof t=="object"&&t instanceof uRt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==y7r.default.Writable.prototype.pipe,"isReadable"),Drl=a(t=>!!t&&typeof t=="object"&&t instanceof uRt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),J9=Symbol("EOF"),Z9=Symbol("maybeEmitEnd"),AW=Symbol("emittedEnd"),iRt=Symbol("emittingEnd"),Z8e=Symbol("emittedError"),oRt=Symbol("closed"),Foo=Symbol("read"),sRt=Symbol("flush"),Uoo=Symbol("flushChunk"),VN=Symbol("encoding"),Jve=Symbol("decoder"),aA=Symbol("flowing"),X8e=Symbol("paused"),Zve=Symbol("resume"),cA=Symbol("buffer"),eC=Symbol("pipes"),lA=Symbol("bufferLength"),f7r=Symbol("bufferPush"),aRt=Symbol("bufferShift"),u_=Symbol("objectMode"),Th=Symbol("destroyed"),p7r=Symbol("error"),h7r=Symbol("emitData"),Qoo=Symbol("emitEnd"),m7r=Symbol("emitEnd2"),zL=Symbol("async"),g7r=Symbol("abort"),cRt=Symbol("aborted"),e6e=Symbol("signal"),doe=Symbol("dataListeners"),OI=Symbol("discarded"),t6e=a(t=>Promise.resolve().then(t),"defer"),Nrl=a(t=>t(),"nodefer"),Mrl=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),Orl=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),Lrl=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),lRt=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[Zve](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},A7r=class extends lRt{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)}},Brl=a(t=>!!t.objectMode,"isObjectModeOptions"),Frl=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),yW=class extends uRt.EventEmitter{static{a(this,"Minipass")}[aA]=!1;[X8e]=!1;[eC]=[];[cA]=[];[u_];[VN];[zL];[Jve];[J9]=!1;[AW]=!1;[iRt]=!1;[oRt]=!1;[Z8e]=null;[lA]=0;[Th]=!1;[e6e];[cRt]=!1;[doe]=0;[OI]=!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");Brl(r)?(this[u_]=!0,this[VN]=null):Frl(r)?(this[VN]=r.encoding,this[u_]=!1):(this[u_]=!1,this[VN]=null),this[zL]=!!r.async,this[Jve]=this[VN]?new qoo.StringDecoder(this[VN]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[cA],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[eC],"get")});let{signal:n}=r;n&&(this[e6e]=n,n.aborted?this[g7r]():n.addEventListener("abort",()=>this[g7r]()))}get bufferLength(){return this[lA]}get encoding(){return this[VN]}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[u_]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[zL]}set async(e){this[zL]=this[zL]||!!e}[g7r](){this[cRt]=!0,this.emit("abort",this[e6e]?.reason),this.destroy(this[e6e]?.reason)}get aborted(){return this[cRt]}set aborted(e){}write(e,r,n){if(this[cRt])return!1;if(this[J9])throw new Error("write after end");if(this[Th])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[zL]?t6e:Nrl;if(!this[u_]&&!Buffer.isBuffer(e)){if(Lrl(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Orl(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[u_]?(this[aA]&&this[lA]!==0&&this[sRt](!0),this[aA]?this.emit("data",e):this[f7r](e),this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA]):e.length?(typeof e=="string"&&!(r===this[VN]&&!this[Jve]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[VN]&&(e=this[Jve].write(e)),this[aA]&&this[lA]!==0&&this[sRt](!0),this[aA]?this.emit("data",e):this[f7r](e),this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA]):(this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA])}read(e){if(this[Th])return null;if(this[OI]=!1,this[lA]===0||e===0||e&&e>this[lA])return this[Z9](),null;this[u_]&&(e=null),this[cA].length>1&&!this[u_]&&(this[cA]=[this[VN]?this[cA].join(""):Buffer.concat(this[cA],this[lA])]);let r=this[Foo](e||null,this[cA][0]);return this[Z9](),r}[Foo](e,r){if(this[u_])this[aRt]();else{let n=r;e===n.length||e===null?this[aRt]():typeof n=="string"?(this[cA][0]=n.slice(e),r=n.slice(0,e),this[lA]-=e):(this[cA][0]=n.subarray(e),r=n.subarray(0,e),this[lA]-=e)}return this.emit("data",r),!this[cA].length&&!this[J9]&&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[J9]=!0,this.writable=!1,(this[aA]||!this[X8e])&&this[Z9](),this}[Zve](){this[Th]||(!this[doe]&&!this[eC].length&&(this[OI]=!0),this[X8e]=!1,this[aA]=!0,this.emit("resume"),this[cA].length?this[sRt]():this[J9]?this[Z9]():this.emit("drain"))}resume(){return this[Zve]()}pause(){this[aA]=!1,this[X8e]=!0,this[OI]=!1}get destroyed(){return this[Th]}get flowing(){return this[aA]}get paused(){return this[X8e]}[f7r](e){this[u_]?this[lA]+=1:this[lA]+=e.length,this[cA].push(e)}[aRt](){return this[u_]?this[lA]-=1:this[lA]-=this[cA][0].length,this[cA].shift()}[sRt](e=!1){do;while(this[Uoo](this[aRt]())&&this[cA].length);!e&&!this[cA].length&&!this[J9]&&this.emit("drain")}[Uoo](e){return this.emit("data",e),this[aA]}pipe(e,r){if(this[Th])return e;this[OI]=!1;let n=this[AW];return r=r||{},e===Boo.stdout||e===Boo.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[eC].push(r.proxyErrors?new A7r(this,e,r):new lRt(this,e,r)),this[zL]?t6e(()=>this[Zve]()):this[Zve]()),e}unpipe(e){let r=this[eC].find(n=>n.dest===e);r&&(this[eC].length===1?(this[aA]&&this[doe]===0&&(this[aA]=!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[OI]=!1,this[doe]++,!this[eC].length&&!this[aA]&&this[Zve]();else if(e==="readable"&&this[lA]!==0)super.emit("readable");else if(Mrl(e)&&this[AW])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Z8e]){let o=r;this[zL]?t6e(()=>o.call(this,this[Z8e])):o.call(this,this[Z8e])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[doe]=this.listeners("data").length,this[doe]===0&&!this[OI]&&!this[eC].length&&(this[aA]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[doe]=0,!this[OI]&&!this[eC].length&&(this[aA]=!1)),r}get emittedEnd(){return this[AW]}[Z9](){!this[iRt]&&!this[AW]&&!this[Th]&&this[cA].length===0&&this[J9]&&(this[iRt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[oRt]&&this.emit("close"),this[iRt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==Th&&this[Th])return!1;if(e==="data")return!this[u_]&&!n?!1:this[zL]?(t6e(()=>this[h7r](n)),!0):this[h7r](n);if(e==="end")return this[Qoo]();if(e==="close"){if(this[oRt]=!0,!this[AW]&&!this[Th])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Z8e]=n,super.emit(p7r,n);let s=!this[e6e]||this.listeners("error").length?super.emit("error",n):!1;return this[Z9](),s}else if(e==="resume"){let s=super.emit("resume");return this[Z9](),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[Z9](),o}[h7r](e){for(let n of this[eC])n.dest.write(e)===!1&&this.pause();let r=this[OI]?!1:super.emit("data",e);return this[Z9](),r}[Qoo](){return this[AW]?!1:(this[AW]=!0,this.readable=!1,this[zL]?(t6e(()=>this[m7r]()),!0):this[m7r]())}[m7r](){if(this[Jve]){let r=this[Jve].end();if(r){for(let n of this[eC])n.dest.write(r);this[OI]||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[u_]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[u_]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[u_])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[VN]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Th,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[OI]=!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[J9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(Th,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(Th,f),this.pause(),s({value:h,done:!!this[J9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(Th,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(Th,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[OI]=!1;let e=!1,r=a(()=>(this.pause(),this.off(p7r,r),this.off(Th,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(p7r,r),this.once(Th,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Th])return e?this.emit("error",e):this.emit(Th),this;this[Th]=!0,this[OI]=!0,this[cA].length=0,this[lA]=0;let r=this;return typeof r.close=="function"&&!this[oRt]&&r.close(),e?this.emit("error",e):this.emit(Th),this}static get isStream(){return krl}};var Qrl=KL.realpathSync.native,n6e={lstatSync:KL.lstatSync,readdir:KL.readdir,readdirSync:KL.readdirSync,readlinkSync:KL.readlinkSync,realpathSync:Qrl,promises:{lstat:EW.lstat,readdir:EW.readdir,readlink:EW.readlink,realpath:EW.realpath}},Woo=a(t=>!t||t===n6e||t===Url?n6e:{...n6e,...t,promises:{...n6e.promises,...t.promises||{}}},"fsFromOption"),zoo=/^\\\\\?\\([a-z]:)\\?$/i,qrl=a(t=>t.replace(/\//g,"\\").replace(zoo,"$1\\"),"uncToDrive"),jrl=/[\\\/]/,Tk=0,Yoo=1,Koo=2,YL=4,Joo=6,Zoo=8,foe=10,Xoo=12,Sk=15,r6e=~Sk,E7r=16,joo=32,i6e=64,WN=128,dRt=256,pRt=512,Hoo=i6e|WN|pRt,Hrl=1023,_7r=a(t=>t.isFile()?Zoo:t.isDirectory()?YL:t.isSymbolicLink()?foe:t.isCharacterDevice()?Koo:t.isBlockDevice()?Joo:t.isSocket()?Xoo:t.isFIFO()?Yoo:Tk,"entToType"),Goo=new Map,o6e=a(t=>{let e=Goo.get(t);if(e)return e;let r=t.normalize("NFKD");return Goo.set(t,r),r},"normalize"),$oo=new Map,fRt=a(t=>{let e=$oo.get(t);if(e)return e;let r=o6e(t.toLowerCase());return $oo.set(t,r),r},"normalizeNocase"),hRt=class extends J8e{static{a(this,"ResolveCache")}constructor(){super({max:256})}},v7r=class extends J8e{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},eso=Symbol("PathScurry setAsCwd"),d_=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}#E;#C;#S;#y;#k;#R;#d;#L;#_;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=Tk,n,o,s,c,l){this.name=e,this.#E=s?fRt(e):o6e(e),this.#d=r&Hrl,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=Woo(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&=~E7r,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?fRt(e):o6e(e);for(let u of n)if(u.#E===o)return u;let s=this.parent?this.sep:"",c=this.#S?this.#S+s+e:void 0,l=this.newChild(e,Tk,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=WN),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&Sk)===Tk}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&Sk)===Zoo}isDirectory(){return(this.#d&Sk)===YL}isCharacterDevice(){return(this.#d&Sk)===Koo}isBlockDevice(){return(this.#d&Sk)===Joo}isFIFO(){return(this.#d&Sk)===Yoo}isSocket(){return(this.#d&Sk)===Xoo}isSymbolicLink(){return(this.#d&foe)===foe}lstatCached(){return this.#d&joo?this:void 0}readlinkCached(){return this.#_}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#_)return!0;if(!this.parent)return!1;let e=this.#d&Sk;return!(e!==Tk&&e!==foe||this.#d&dRt||this.#d&WN)}calledReaddir(){return!!(this.#d&E7r)}isENOENT(){return!!(this.#d&WN)}isNamed(e){return this.nocase?this.#E===fRt(e):this.#E===o6e(e)}async readlink(){let e=this.#_;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.#_=n}catch(r){this.#f(r.code);return}}readlinkSync(){let e=this.#_;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.#_=n}catch(r){this.#f(r.code);return}}#N(e){this.#d|=E7r;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&Hoo)return!1;let e=Sk&this.#d;return e===Tk||e===YL||e===foe}shouldWalk(e,r){return(this.#d&YL)===YL&&!(this.#d&Hoo)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((pRt|dRt|WN)&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(!((pRt|dRt|WN)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[eso](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}},mRt=class t extends d_{static{a(this,"PathWin32")}sep="\\";splitSep=jrl;constructor(e,r=Tk,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=Tk,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Xve.win32.parse(e).root}getRoot(e){if(e=qrl(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 eCe(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(zoo,"$1\\"),e===r}},gRt=class t extends d_{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=Tk,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=Tk,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},ARt=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=n6e}={}){this.#n=Woo(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Voo.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new hRt,this.#t=new hRt,this.#r=new v7r(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 E=a(()=>{--y===0&&m()},"next");for(let _ of A)(!s||s(_))&&l.push(n?_:_.fullpath()),o&&_.isSymbolicLink()?_.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(u,c)?d(v,E):E()):_.shouldWalk(u,c)?d(_,E):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 d_||(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 d_||(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 d_||(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 d_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new yW({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(E)return l.emit("error",E);if(o&&!v){let b=[];for(let T of _)T.isSymbolicLink()&&b.push(T.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(b.length){Promise.all(b).then(()=>A(null,_,!0));return}}for(let b of _)b&&(!s||s(b))&&(l.write(n?b:b.fullpath())||(m=!0));f--;for(let b of _){let T=b.realpathCached()||b;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 d_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new yW({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 E=y;if(y.isSymbolicLink()){if(!(o&&(E=y.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(u,c)&&d.push(E)}}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[eso](r)}},eCe=class extends ARt{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,Xve.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return Xve.win32.parse(e).root.toUpperCase()}newRoot(e){return new mRt(this.rootPath,YL,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},tCe=class extends ARt{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,Xve.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new gRt(this.rootPath,YL,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},s6e=class extends tCe{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},AXh=process.platform==="win32"?mRt:gRt,tso=process.platform==="win32"?eCe:process.platform==="darwin"?s6e:tCe;p();var Grl=a(t=>t.length>=1,"isPatternList"),$rl=a(t=>t.length>=1,"isGlobList"),rCe=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!Grl(e))throw new TypeError("empty pattern list");if(!$rl(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("/"),E=[f,h,m,g,""].join("/");this.#e=[y,...d],this.#t=[E,...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]===Jp}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 Vrl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",nCe=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=Vrl}){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 Q_(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},S7r=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())}},a6e=class t{static{a(this,"Processor")}hasWalkedCache;matches=new b7r;subwalks=new S7r;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new C7r}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===Jp){(!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===Jp?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 Wrl=a((t,e)=>typeof t=="string"?new nCe([t],e):Array.isArray(t)?new nCe(t,e):t,"makeIgnore"),yRt=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=Wrl(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 a6e(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 a6e(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()}},c6e=class extends yRt{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}},l6e=class extends yRt{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new yW({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 zrl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",zN=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,rso.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||zrl,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"?eCe:r.platform==="darwin"?s6e:r.platform?tCe:tso;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 Q_(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 rCe(u,f,0,this.platform)})}async walk(){return[...await new c6e(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 c6e(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 l6e(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 l6e(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 T7r=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Q_(r,e).hasMagic())return!0;return!1},"hasMagic");function _Rt(t,e={}){return new zN(t,e).streamSync()}a(_Rt,"globStreamSync");function iso(t,e={}){return new zN(t,e).stream()}a(iso,"globStream");function oso(t,e={}){return new zN(t,e).walkSync()}a(oso,"globSync");async function nso(t,e={}){return new zN(t,e).walk()}a(nso,"glob_");function vRt(t,e={}){return new zN(t,e).iterateSync()}a(vRt,"globIterateSync");function sso(t,e={}){return new zN(t,e).iterate()}a(sso,"globIterate");var Yrl=_Rt,Krl=Object.assign(iso,{sync:_Rt}),Jrl=vRt,Zrl=Object.assign(sso,{sync:vRt}),Xrl=Object.assign(oso,{stream:_Rt,iterate:vRt}),ERt=Object.assign(nso,{glob:nso,globSync:oso,sync:Xrl,globStream:iso,stream:Krl,globStreamSync:_Rt,streamSync:Yrl,globIterate:sso,iterate:Zrl,globIterateSync:vRt,iterateSync:Jrl,Glob:zN,hasMagic:T7r,escape:Lle,unescape:MP});ERt.glob=ERt;var u6e=class t{constructor(){this.logger=new fe("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(wA),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(Ks(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 ERt(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 aso.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=Ks(r);try{let o=await e.get(Qo).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 Tem=new fe("exp");function lso(t){let e=t.get(Zt);e.registerStaticFilters(rnl(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>Ft(t,Ye.DebugOverrideEngine)||Ft(t,Ye.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>o7e()?"copilot-web":t.get(Ir).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>cso(t)),e.registerDynamicFilter(Soe.CopilotRelatedPluginVersionGithubCopilot,()=>cso(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>enl(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Ir).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>CRt(t.get(Ir).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>tnl(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(UI).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getRelatedPluginInfo()){let o=E_+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(Soe).includes(o)){K6e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=CRt(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getEditorPluginSpecificFilters()){let o=n.isVersion?CRt(n.value):n.value;r[n.filter]=o}return r})}a(lso,"setupExperimentationService");function cso(t){return CRt(!t.get(ds).isProduction()&&t.get(Ir).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Ir).getEditorPluginInfo().version)}a(cso,"getEditorPluginVersion");function enl(t){let e=t.get(Ir).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a(enl,"getPluginRelease");function tnl(t){let e=t.get(Ir).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(tnl,"getTargetPopulation");function rnl(t){return nnl(t)}a(rnl,"createAllFilters");function nnl(t){let e=t.get(Ua);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(ds).isProduction()?V1(t):"1.999.0"}}a(nnl,"createDefaultFilters");function CRt(t){return t.split("-")[0]}a(CRt,"trimVersionSuffix");p();var _W=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var iCe=class{static{a(this,"AbstractCopilotMessageSender")}};p();var uso=100,dso=1e3*60*5;function fso(t){let e=new I7r(t);t.get(hm).registerContextProvider(e),t.get(r4).add(e.id)}a(fso,"registerRelatedFilesShim");var I7r=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new Pk(uso,dso);this.relatedFilesCache=new Pk(uso,dso);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(Zt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e,languageId:n}),c={uri:e,clientLanguageId:r,detectedLanguageId:n},l=await udt(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){LY(this.ctx,s,"relatedFilesShim")}}};var oao=de(cee()),sao=de(require("path"));p();var d6e=de(ri());var inl=new d6e.ProtocolRequestType("workspace/readFile"),onl=new d6e.ProtocolRequestType("workspace/readDirectory"),snl=new d6e.ProtocolRequestType("workspace/findFiles"),anl=new d6e.ProtocolRequestType("workspace/findTextInFiles"),bRt=class extends la{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(inl,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(onl,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(snl,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(anl,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(ar).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 At(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw Vn(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var SRt=class extends wO{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(ar);try{return await o.connection.sendRequest(r,n)}catch(s){throw Vn(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var TRt=class t extends dee{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(ar)}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),v0.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){v0.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(bn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return v0.debug(this.context,"`copilot/related` not supported"),cri;try{let c=await this.service.connection.sendRequest(JQt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){v0.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,Et(r,"copilotRelated.hasRelatedCapability",n)}catch(s){v0.exception(r,s,"copilotRelated")}}};p();p();var Eso=de(ri());p();p();function pso(t,e){return(e<<5)-e+t|0}a(pso,"numberHash");function hso(t,e){e=pso(149417,e);for(let r=0,n=t.length;rnew NN(o,NN.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new fo(Ze.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof UU?new fo(Ze.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof yi?new fo(Ze.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(hIt,"performACPGitHubOAuth");function mIt(t){if(t!=="github_oauth")throw new fo(Ze.InvalidParams,`Unknown authentication method: ${t}`)}a(mIt,"validateAuthMethodId");async function gIt(t){let r=await t.get(Ur).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw fo.authRequired()}a(gIt,"requireACPAuthenticated");var OYi=[{id:Cl.Ask.id,name:Cl.Ask.name,description:Cl.Ask.description},{id:Cl.Agent.id,name:Cl.Agent.name,description:Cl.Agent.description}],AIt=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 oj&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}At(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:Trt,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:V1(this.ctx)},authMethods:n})}async newSession(e){At(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=Mt(),n=Mt(),s=this.ctx.get(Yo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:Ks(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 At(this.ctx,"acp.authenticate"),mIt(e.methodId),await hIt(this.ctx),{}}async requireAuthenticated(){await gIt(this.ctx)}async prompt(e){At(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 Fn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=Mt(),l=new Xf(s,c),u=r.currentModeId===Cl.Ask.id?Cl.Ask:Cl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(Yo),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 pIt(this.connection,e.sessionId),g=new mw(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(F_);A instanceof YV&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let E=await this.ctx.get(kN).createProcessor(g,e.sessionId);try{await E.process(m,r.cancellationTokenSource.token,void 0,void 0,{id:n})}finally{A instanceof YV&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(F_);if(s instanceof YV&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){At(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){At(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ze.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new fo(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){At(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ze.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new fo(Ze.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return ix(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?OYi:OYi.filter(e=>e.id===Cl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?Cl.Agent.id:Cl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(xs).getMetadata(),r=[],n=W_;r.push({modelId:W_,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!(sle.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 LYi=require("node:child_process"),EIt=require("node:stream");var yIt=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,LYi.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:G9t}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{Vn(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||At(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=EIt.Writable.toWeb(this.cliProcess.stdin),c=EIt.Readable.toWeb(this.cliProcess.stdout),l=GRe(s,c);return this._cliConnection=new Prt(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 _It=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 oj&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return At(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:Trt,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:V1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return At(this.ctx,"acp.cli.authenticate"),mIt(e.methodId),await hIt(this.ctx),{}}async newSession(e){return At(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return At(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return At(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return At(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return At(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return At(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return At(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return At(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 fo(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:V1(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]),At(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw Vn(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 fo(Ze.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await gIt(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 eRt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(Too(),Soo)),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 Ioo(t){let e=new sue;e.set(Bo,t),e.set(bx,new bx),e.set(ds,new ds),e.set(j2,new j2);let r=new Qt(e);return e.set(Qt,r),e.set(Zt,new Zt(e)),e.set(nO,new nO(e,r)),e.set(eM,new eM),e.set(Op,new Op(e)),e.set(X0,new X0),e.set(bC,new bC),e.set(AO,new oxe),e.set(IP,new dle),e.set(fP,new cSe),e.set(xd,new xd),e.set(t4,new t4(e)),e.set(ii,new ii(e)),e.set(Y2,new Y2(e)),e.set(I8,Ddt(e)),e.set(iy,new iy),e.set(Db,new Db),e.set(x8,x8.default),e.set(_f,new _f(e)),e.set(Lx,new Lx(e)),e.set(zp,new zp),e.set(Pb,new Pb(e)),e.set(bn,new bn),e.set(Au,new Au(e)),e.set(gO,new gO(e)),e.set(bN,new bN),e.set(LK,new LK(e)),e}a(Ioo,"createCommonContext");p();var tRt=class extends qf{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||E1t(r))&&this.console.warn(`[${o}]`,...s)}};p();var koo=require("node:os");var Crl=new fe("repository"),uoe="\\\\",Poo="(?:[#;].*)",Yve=`(?:[^"${uoe}]|${uoe}.)`,brl="[0-9A-Za-z-]",xoo=`[A-Za-z]${brl}*`,Doo=`\\s*${Poo}?$`,Noo=`(?:[^"${uoe};#]|${uoe}.)`,Srl=`(?:"${Yve}*"|"${Yve}*(?${uoe})$)`,Trl=`(?:${Noo}|${Srl})+`,Irl=`(?:(?${uoe})$)`,Moo=`(?${Trl})${Irl}?${Doo}`,woo=new RegExp(`^${Moo}`),xrl=new RegExp(`^(?${Yve}*(?:(?${uoe})$|(?")))`),wrl=new RegExp(`^\\s*(?:(?${xoo})\\s*=\\s*${Moo}|(?${xoo})${Doo})`),Rrl=new RegExp(`(?${Noo}+)|"(?${Yve}*)"`,"g"),Roo="[-.0-9A-Za-z]+",krl=`\\s+"(?${Yve}*)"`,Prl=`\\s+"(?${Yve}*)"`,Drl=new RegExp(`^\\s*\\[(?:(?${Roo})${krl}|${Prl}|(?${Roo}))\\]`),Nrl=new RegExp(`^\\s*${Poo}$`),u7r=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(Drl);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(wrl);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(xrl),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(woo),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(woo),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(Rrl)].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(){Nrl.test(this.line)&&(this.line="")}},rRt=class extends MP{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await _f.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 hK)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new u7r(o),c=new hK;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(qo).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&Crl.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=xa(this.xdgConfigUri(),"git","config"),s=xa(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(Ji(r).toLowerCase()!=="config.worktree")return;let n=uf(r),o=xa(n,"commondir");try{let s=(await e.get(qo).readFileString(o)).trimEnd();return xa(VW(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?Ks(process.env.XDG_CONFIG_HOME):xa(this.homeUri(),".config")}homeUri(){return Ks((0,koo.homedir)())}};p();var Ooo=require("child_process");var nRt=class extends MP{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,Ooo.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){K9t.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=rs(r);if(n===void 0)return;let o;try{o=(await lO()).path}catch(c){K9t.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 hK;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 Loo(t){let e=Ioo(t);return Mrl(e),e.set(pp,mot(e)),e.set(dk,XTt(e)),e.set(MP,new vze([new nRt,new rRt])),e}a(Loo,"createProductionContext");function Mrl(t){t.set(jI,jI.fromEnvironment(!1)),t.set(ZL,new H_e),t.set(qf,new tRt(console))}a(Mrl,"setupRudimentaryLogging");var uXh=new fe("context");p();var dso=require("fs");p();p();var sso=require("node:url");p();p();var Kve=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Foo=new Set,d7r=typeof process=="object"&&process?process:{},Uoo=a((t,e,r,n)=>{typeof d7r.emitWarning=="function"?d7r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),iRt=globalThis.AbortController,Boo=globalThis.AbortSignal;if(typeof iRt>"u"){Boo=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},iRt=class{static{a(this,"AbortController")}constructor(){e()}signal=new Boo;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=d7r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Uoo("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 Orl=a(t=>!Foo.has(t),"shouldWarn");var AW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),Qoo=a(t=>AW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Jve:null:null,"getUintArray"),Jve=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},f7r=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=Qoo(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]}},X8e=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;#E;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#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.#_(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:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!AW(r))throw new TypeError("max option must be a nonnegative integer");let x=r?Qoo(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(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,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=f7r.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&&!AW(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!AW(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=AW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!AW(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 P="LRU_CACHE_UNBOUNDED";Orl(P)&&(Foo.add(P),Uoo("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new Jve(this.#e),r=new Jve(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=Kve.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?Kve.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=Kve.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.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#updateItemAge");#d=a(()=>{},"#statusTTL");#L=a(()=>{},"#setItemTTL");#_=a(()=>!1,"#isStale");#D(){let e=new Jve(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(!AW(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!AW(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.#_(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.#_(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.#_(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.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(Kve.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.#E&&this.#T){c.ttl=this.#E[r];let l=Kve.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=Kve.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.#E&&this.#k(),this.#E&&(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.#_(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.#_(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 iRt,{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,E=!1)=>{let{aborted:_}=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),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__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:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(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,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),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 iRt}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:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={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:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let N=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",N&&(_.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),D=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",D&&R&&(_.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.#_(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.#E&&this.#T&&(this.#E.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 eCe=require("node:path"),Koo=require("node:url"),KL=require("fs"),$rl=de(require("node:fs"),1),_W=require("node:fs/promises");p();var dRt=require("node:events"),E7r=de(require("node:stream"),1),$oo=require("node:string_decoder");var qoo=typeof process=="object"&&process?process:{stdout:null,stderr:null},Lrl=a(t=>!!t&&typeof t=="object"&&(t instanceof EW||t instanceof E7r.default||Brl(t)||Frl(t)),"isStream"),Brl=a(t=>!!t&&typeof t=="object"&&t instanceof dRt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==E7r.default.Writable.prototype.pipe,"isReadable"),Frl=a(t=>!!t&&typeof t=="object"&&t instanceof dRt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),Z9=Symbol("EOF"),X9=Symbol("maybeEmitEnd"),yW=Symbol("emittedEnd"),oRt=Symbol("emittingEnd"),e6e=Symbol("emittedError"),sRt=Symbol("closed"),joo=Symbol("read"),aRt=Symbol("flush"),Hoo=Symbol("flushChunk"),WN=Symbol("encoding"),Zve=Symbol("decoder"),aA=Symbol("flowing"),t6e=Symbol("paused"),Xve=Symbol("resume"),cA=Symbol("buffer"),tC=Symbol("pipes"),lA=Symbol("bufferLength"),p7r=Symbol("bufferPush"),cRt=Symbol("bufferShift"),u_=Symbol("objectMode"),Th=Symbol("destroyed"),h7r=Symbol("error"),m7r=Symbol("emitData"),Goo=Symbol("emitEnd"),g7r=Symbol("emitEnd2"),zL=Symbol("async"),A7r=Symbol("abort"),lRt=Symbol("aborted"),r6e=Symbol("signal"),doe=Symbol("dataListeners"),BI=Symbol("discarded"),n6e=a(t=>Promise.resolve().then(t),"defer"),Url=a(t=>t(),"nodefer"),Qrl=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),qrl=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),jrl=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),uRt=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[Xve](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},y7r=class extends uRt{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)}},Hrl=a(t=>!!t.objectMode,"isObjectModeOptions"),Grl=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),EW=class extends dRt.EventEmitter{static{a(this,"Minipass")}[aA]=!1;[t6e]=!1;[tC]=[];[cA]=[];[u_];[WN];[zL];[Zve];[Z9]=!1;[yW]=!1;[oRt]=!1;[sRt]=!1;[e6e]=null;[lA]=0;[Th]=!1;[r6e];[lRt]=!1;[doe]=0;[BI]=!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");Hrl(r)?(this[u_]=!0,this[WN]=null):Grl(r)?(this[WN]=r.encoding,this[u_]=!1):(this[u_]=!1,this[WN]=null),this[zL]=!!r.async,this[Zve]=this[WN]?new $oo.StringDecoder(this[WN]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[cA],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[tC],"get")});let{signal:n}=r;n&&(this[r6e]=n,n.aborted?this[A7r]():n.addEventListener("abort",()=>this[A7r]()))}get bufferLength(){return this[lA]}get encoding(){return this[WN]}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[u_]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[zL]}set async(e){this[zL]=this[zL]||!!e}[A7r](){this[lRt]=!0,this.emit("abort",this[r6e]?.reason),this.destroy(this[r6e]?.reason)}get aborted(){return this[lRt]}set aborted(e){}write(e,r,n){if(this[lRt])return!1;if(this[Z9])throw new Error("write after end");if(this[Th])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[zL]?n6e:Url;if(!this[u_]&&!Buffer.isBuffer(e)){if(jrl(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(qrl(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[u_]?(this[aA]&&this[lA]!==0&&this[aRt](!0),this[aA]?this.emit("data",e):this[p7r](e),this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA]):e.length?(typeof e=="string"&&!(r===this[WN]&&!this[Zve]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[WN]&&(e=this[Zve].write(e)),this[aA]&&this[lA]!==0&&this[aRt](!0),this[aA]?this.emit("data",e):this[p7r](e),this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA]):(this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA])}read(e){if(this[Th])return null;if(this[BI]=!1,this[lA]===0||e===0||e&&e>this[lA])return this[X9](),null;this[u_]&&(e=null),this[cA].length>1&&!this[u_]&&(this[cA]=[this[WN]?this[cA].join(""):Buffer.concat(this[cA],this[lA])]);let r=this[joo](e||null,this[cA][0]);return this[X9](),r}[joo](e,r){if(this[u_])this[cRt]();else{let n=r;e===n.length||e===null?this[cRt]():typeof n=="string"?(this[cA][0]=n.slice(e),r=n.slice(0,e),this[lA]-=e):(this[cA][0]=n.subarray(e),r=n.subarray(0,e),this[lA]-=e)}return this.emit("data",r),!this[cA].length&&!this[Z9]&&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[Z9]=!0,this.writable=!1,(this[aA]||!this[t6e])&&this[X9](),this}[Xve](){this[Th]||(!this[doe]&&!this[tC].length&&(this[BI]=!0),this[t6e]=!1,this[aA]=!0,this.emit("resume"),this[cA].length?this[aRt]():this[Z9]?this[X9]():this.emit("drain"))}resume(){return this[Xve]()}pause(){this[aA]=!1,this[t6e]=!0,this[BI]=!1}get destroyed(){return this[Th]}get flowing(){return this[aA]}get paused(){return this[t6e]}[p7r](e){this[u_]?this[lA]+=1:this[lA]+=e.length,this[cA].push(e)}[cRt](){return this[u_]?this[lA]-=1:this[lA]-=this[cA][0].length,this[cA].shift()}[aRt](e=!1){do;while(this[Hoo](this[cRt]())&&this[cA].length);!e&&!this[cA].length&&!this[Z9]&&this.emit("drain")}[Hoo](e){return this.emit("data",e),this[aA]}pipe(e,r){if(this[Th])return e;this[BI]=!1;let n=this[yW];return r=r||{},e===qoo.stdout||e===qoo.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[tC].push(r.proxyErrors?new y7r(this,e,r):new uRt(this,e,r)),this[zL]?n6e(()=>this[Xve]()):this[Xve]()),e}unpipe(e){let r=this[tC].find(n=>n.dest===e);r&&(this[tC].length===1?(this[aA]&&this[doe]===0&&(this[aA]=!1),this[tC]=[]):this[tC].splice(this[tC].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[BI]=!1,this[doe]++,!this[tC].length&&!this[aA]&&this[Xve]();else if(e==="readable"&&this[lA]!==0)super.emit("readable");else if(Qrl(e)&&this[yW])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[e6e]){let o=r;this[zL]?n6e(()=>o.call(this,this[e6e])):o.call(this,this[e6e])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[doe]=this.listeners("data").length,this[doe]===0&&!this[BI]&&!this[tC].length&&(this[aA]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[doe]=0,!this[BI]&&!this[tC].length&&(this[aA]=!1)),r}get emittedEnd(){return this[yW]}[X9](){!this[oRt]&&!this[yW]&&!this[Th]&&this[cA].length===0&&this[Z9]&&(this[oRt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[sRt]&&this.emit("close"),this[oRt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==Th&&this[Th])return!1;if(e==="data")return!this[u_]&&!n?!1:this[zL]?(n6e(()=>this[m7r](n)),!0):this[m7r](n);if(e==="end")return this[Goo]();if(e==="close"){if(this[sRt]=!0,!this[yW]&&!this[Th])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[e6e]=n,super.emit(h7r,n);let s=!this[r6e]||this.listeners("error").length?super.emit("error",n):!1;return this[X9](),s}else if(e==="resume"){let s=super.emit("resume");return this[X9](),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[X9](),o}[m7r](e){for(let n of this[tC])n.dest.write(e)===!1&&this.pause();let r=this[BI]?!1:super.emit("data",e);return this[X9](),r}[Goo](){return this[yW]?!1:(this[yW]=!0,this.readable=!1,this[zL]?(n6e(()=>this[g7r]()),!0):this[g7r]())}[g7r](){if(this[Zve]){let r=this[Zve].end();if(r){for(let n of this[tC])n.dest.write(r);this[BI]||super.emit("data",r)}}for(let r of this[tC])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[u_]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[u_]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[u_])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[WN]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Th,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[BI]=!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[Z9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(Th,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(Th,f),this.pause(),s({value:h,done:!!this[Z9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(Th,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(Th,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[BI]=!1;let e=!1,r=a(()=>(this.pause(),this.off(h7r,r),this.off(Th,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(h7r,r),this.once(Th,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Th])return e?this.emit("error",e):this.emit(Th),this;this[Th]=!0,this[BI]=!0,this[cA].length=0,this[lA]=0;let r=this;return typeof r.close=="function"&&!this[sRt]&&r.close(),e?this.emit("error",e):this.emit(Th),this}static get isStream(){return Lrl}};var Vrl=KL.realpathSync.native,o6e={lstatSync:KL.lstatSync,readdir:KL.readdir,readdirSync:KL.readdirSync,readlinkSync:KL.readlinkSync,realpathSync:Vrl,promises:{lstat:_W.lstat,readdir:_W.readdir,readlink:_W.readlink,realpath:_W.realpath}},Joo=a(t=>!t||t===o6e||t===$rl?o6e:{...o6e,...t,promises:{...o6e.promises,...t.promises||{}}},"fsFromOption"),Zoo=/^\\\\\?\\([a-z]:)\\?$/i,Wrl=a(t=>t.replace(/\//g,"\\").replace(Zoo,"$1\\"),"uncToDrive"),zrl=/[\\\/]/,Ik=0,Xoo=1,eso=2,YL=4,tso=6,rso=8,foe=10,nso=12,Tk=15,i6e=~Tk,_7r=16,Voo=32,s6e=64,zN=128,fRt=256,hRt=512,Woo=s6e|zN|hRt,Yrl=1023,v7r=a(t=>t.isFile()?rso:t.isDirectory()?YL:t.isSymbolicLink()?foe:t.isCharacterDevice()?eso:t.isBlockDevice()?tso:t.isSocket()?nso:t.isFIFO()?Xoo:Ik,"entToType"),zoo=new Map,a6e=a(t=>{let e=zoo.get(t);if(e)return e;let r=t.normalize("NFKD");return zoo.set(t,r),r},"normalize"),Yoo=new Map,pRt=a(t=>{let e=Yoo.get(t);if(e)return e;let r=a6e(t.toLowerCase());return Yoo.set(t,r),r},"normalizeNocase"),mRt=class extends X8e{static{a(this,"ResolveCache")}constructor(){super({max:256})}},C7r=class extends X8e{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},iso=Symbol("PathScurry setAsCwd"),d_=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}#E;#C;#S;#y;#k;#R;#d;#L;#_;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=Ik,n,o,s,c,l){this.name=e,this.#E=s?pRt(e):a6e(e),this.#d=r&Yrl,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=Joo(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&=~_7r,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?pRt(e):a6e(e);for(let u of n)if(u.#E===o)return u;let s=this.parent?this.sep:"",c=this.#S?this.#S+s+e:void 0,l=this.newChild(e,Ik,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=zN),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&Tk)===Ik}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&Tk)===rso}isDirectory(){return(this.#d&Tk)===YL}isCharacterDevice(){return(this.#d&Tk)===eso}isBlockDevice(){return(this.#d&Tk)===tso}isFIFO(){return(this.#d&Tk)===Xoo}isSocket(){return(this.#d&Tk)===nso}isSymbolicLink(){return(this.#d&foe)===foe}lstatCached(){return this.#d&Voo?this:void 0}readlinkCached(){return this.#_}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#_)return!0;if(!this.parent)return!1;let e=this.#d&Tk;return!(e!==Ik&&e!==foe||this.#d&fRt||this.#d&zN)}calledReaddir(){return!!(this.#d&_7r)}isENOENT(){return!!(this.#d&zN)}isNamed(e){return this.nocase?this.#E===pRt(e):this.#E===a6e(e)}async readlink(){let e=this.#_;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.#_=n}catch(r){this.#f(r.code);return}}readlinkSync(){let e=this.#_;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.#_=n}catch(r){this.#f(r.code);return}}#N(e){this.#d|=_7r;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&Woo)return!1;let e=Tk&this.#d;return e===Ik||e===YL||e===foe}shouldWalk(e,r){return(this.#d&YL)===YL&&!(this.#d&Woo)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((hRt|fRt|zN)&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(!((hRt|fRt|zN)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[iso](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}},gRt=class t extends d_{static{a(this,"PathWin32")}sep="\\";splitSep=zrl;constructor(e,r=Ik,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=Ik,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return eCe.win32.parse(e).root}getRoot(e){if(e=Wrl(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 tCe(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Zoo,"$1\\"),e===r}},ARt=class t extends d_{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=Ik,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=Ik,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},yRt=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=o6e}={}){this.#n=Joo(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Koo.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new mRt,this.#t=new mRt,this.#r=new C7r(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 E=a(()=>{--y===0&&m()},"next");for(let _ of A)(!s||s(_))&&l.push(n?_:_.fullpath()),o&&_.isSymbolicLink()?_.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(u,c)?d(v,E):E()):_.shouldWalk(u,c)?d(_,E):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 d_||(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 d_||(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 d_||(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 d_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new EW({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(E)return l.emit("error",E);if(o&&!v){let b=[];for(let T of _)T.isSymbolicLink()&&b.push(T.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(b.length){Promise.all(b).then(()=>A(null,_,!0));return}}for(let b of _)b&&(!s||s(b))&&(l.write(n?b:b.fullpath())||(m=!0));f--;for(let b of _){let T=b.realpathCached()||b;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 d_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new EW({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 E=y;if(y.isSymbolicLink()){if(!(o&&(E=y.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(u,c)&&d.push(E)}}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[iso](r)}},tCe=class extends yRt{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,eCe.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return eCe.win32.parse(e).root.toUpperCase()}newRoot(e){return new gRt(this.rootPath,YL,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},rCe=class extends yRt{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,eCe.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new ARt(this.rootPath,YL,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},c6e=class extends rCe{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},SXh=process.platform==="win32"?gRt:ARt,oso=process.platform==="win32"?tCe:process.platform==="darwin"?c6e:rCe;p();var Krl=a(t=>t.length>=1,"isPatternList"),Jrl=a(t=>t.length>=1,"isGlobList"),nCe=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!Krl(e))throw new TypeError("empty pattern list");if(!Jrl(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("/"),E=[f,h,m,g,""].join("/");this.#e=[y,...d],this.#t=[E,...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]===Jp}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 Zrl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",iCe=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=Zrl}){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 Q_(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},T7r=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())}},l6e=class t{static{a(this,"Processor")}hasWalkedCache;matches=new S7r;subwalks=new T7r;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new b7r}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===Jp){(!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===Jp?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 Xrl=a((t,e)=>typeof t=="string"?new iCe([t],e):Array.isArray(t)?new iCe(t,e):t,"makeIgnore"),ERt=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=Xrl(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 l6e(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 l6e(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()}},u6e=class extends ERt{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}},d6e=class extends ERt{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new EW({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 enl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",YN=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,sso.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||enl,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"?tCe:r.platform==="darwin"?c6e:r.platform?rCe:oso;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 Q_(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 nCe(u,f,0,this.platform)})}async walk(){return[...await new u6e(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 u6e(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 d6e(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 d6e(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 I7r=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Q_(r,e).hasMagic())return!0;return!1},"hasMagic");function vRt(t,e={}){return new YN(t,e).streamSync()}a(vRt,"globStreamSync");function cso(t,e={}){return new YN(t,e).stream()}a(cso,"globStream");function lso(t,e={}){return new YN(t,e).walkSync()}a(lso,"globSync");async function aso(t,e={}){return new YN(t,e).walk()}a(aso,"glob_");function CRt(t,e={}){return new YN(t,e).iterateSync()}a(CRt,"globIterateSync");function uso(t,e={}){return new YN(t,e).iterate()}a(uso,"globIterate");var tnl=vRt,rnl=Object.assign(cso,{sync:vRt}),nnl=CRt,inl=Object.assign(uso,{sync:CRt}),onl=Object.assign(lso,{stream:vRt,iterate:CRt}),_Rt=Object.assign(aso,{glob:aso,globSync:lso,sync:onl,globStream:cso,stream:rnl,globStreamSync:vRt,streamSync:tnl,globIterate:uso,iterate:inl,globIterateSync:CRt,iterateSync:nnl,Glob:YN,hasMagic:I7r,escape:Lle,unescape:OP});_Rt.glob=_Rt;var f6e=class t{constructor(){this.logger=new fe("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(wA),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(Ks(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 _Rt(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 dso.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=Ks(r);try{let o=await e.get(qo).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 Dem=new fe("exp");function pso(t){let e=t.get(Zt);e.registerStaticFilters(cnl(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>Ft(t,Ye.DebugOverrideEngine)||Ft(t,Ye.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>a7e()?"copilot-web":t.get(Ir).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>fso(t)),e.registerDynamicFilter(Soe.CopilotRelatedPluginVersionGithubCopilot,()=>fso(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>snl(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Ir).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>bRt(t.get(Ir).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>anl(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(qI).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getRelatedPluginInfo()){let o=E_+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(Soe).includes(o)){Z6e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=bRt(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getEditorPluginSpecificFilters()){let o=n.isVersion?bRt(n.value):n.value;r[n.filter]=o}return r})}a(pso,"setupExperimentationService");function fso(t){return bRt(!t.get(ds).isProduction()&&t.get(Ir).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Ir).getEditorPluginInfo().version)}a(fso,"getEditorPluginVersion");function snl(t){let e=t.get(Ir).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a(snl,"getPluginRelease");function anl(t){let e=t.get(Ir).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(anl,"getTargetPopulation");function cnl(t){return lnl(t)}a(cnl,"createAllFilters");function lnl(t){let e=t.get(Fa);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(ds).isProduction()?V1(t):"1.999.0"}}a(lnl,"createDefaultFilters");function bRt(t){return t.split("-")[0]}a(bRt,"trimVersionSuffix");p();var vW=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var oCe=class{static{a(this,"AbstractCopilotMessageSender")}};p();var hso=100,mso=1e3*60*5;function gso(t){let e=new x7r(t);t.get(hm).registerContextProvider(e),t.get(r4).add(e.id)}a(gso,"registerRelatedFilesShim");var x7r=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new Dk(hso,mso);this.relatedFilesCache=new Dk(hso,mso);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(Zt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e,languageId:n}),c={uri:e,clientLanguageId:r,detectedLanguageId:n},l=await ddt(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){BY(this.ctx,s,"relatedFilesShim")}}};var lao=de(cee()),uao=de(require("path"));p();var p6e=de(ti());var unl=new p6e.ProtocolRequestType("workspace/readFile"),dnl=new p6e.ProtocolRequestType("workspace/readDirectory"),fnl=new p6e.ProtocolRequestType("workspace/findFiles"),pnl=new p6e.ProtocolRequestType("workspace/findTextInFiles"),SRt=class extends la{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(unl,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(dnl,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(fnl,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(pnl,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(ar).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 At(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw Vn(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var TRt=class extends wO{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(ar);try{return await o.connection.sendRequest(r,n)}catch(s){throw Vn(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var IRt=class t extends dee{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(ar)}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),v0.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){v0.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(bn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return v0.debug(this.context,"`copilot/related` not supported"),fri;try{let c=await this.service.connection.sendRequest(ZQt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){v0.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,Et(r,"copilotRelated.hasRelatedCapability",n)}catch(s){v0.exception(r,s,"copilotRelated")}}};p();p();var bso=de(ti());p();p();function Aso(t,e){return(e<<5)-e+t|0}a(Aso,"numberHash");function yso(t,e){e=Aso(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=kwn(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(bn).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,oCe.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){oCe.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,yso.setTimeout)(unl).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 gso.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` - ${dnl}; - ${fnl}; - ${pnl}; - ${hnl}; - ${mnl}; - `);let n=this.all(r,Anl,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):oCe.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){oCe.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(Yn).directory;await mso.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return Aso.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Ir).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||lnl}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=cnl;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=>{oCe.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){oCe.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,gnl,[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 tC=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},IRt=class extends tC{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"&&Uct(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(uA).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(uA).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(uA).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(uA).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(uA).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(uA).delete(n)}};var f_=new fe("DynamicAuthenticationProvider"),xRt=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 x7r(e,l,{set:a(u=>{this.ctx.get(tC).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(f_.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=>Lwe([...c.scopes].sort(),n));if(f_.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(f_.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){f_.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&&(f_.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),f_.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){f_.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=>Lwe([...d.scopes].sort(),n))),f_.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new R_e(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(f_.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 f_.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){f_.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return f_.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]}),f_.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(f_.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(tr).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if(Uct(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},x7r=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}){f_.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)),f_.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=ddr(e.id_token)}catch{}if(!r)try{r=ddr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:hso(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 LI=new fe("DynamicAuthProviderService"),YN=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new Eso.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 xRt(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){LI.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${Xu(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${w_e}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(ar).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)? +`,bnl="SELECT key, value FROM state",sCe=new fe("state-database"),uA=class{constructor(e){this.cache=new Map;this.changeEmitter=new Wi;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(bn).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=Pwn(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(bn).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,sCe.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){sCe.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,Cso.setTimeout)(gnl).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 _so.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` + ${Anl}; + ${ynl}; + ${Enl}; + ${_nl}; + ${vnl}; + `);let n=this.all(r,bnl,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):sCe.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){sCe.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(ri).directory;await Eso.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return vso.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Ir).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||mnl}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=hnl;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=>{sCe.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){sCe.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,Cnl,[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 rC=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},xRt=class extends rC{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"&&jct(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(uA).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(uA).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(uA).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(uA).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(uA).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(uA).delete(n)}};var f_=new fe("DynamicAuthenticationProvider"),wRt=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 w7r(e,l,{set:a(u=>{this.ctx.get(rC).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(f_.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=>Lwe([...c.scopes].sort(),n));if(f_.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(f_.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){f_.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&&(f_.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),f_.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){f_.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=>Lwe([...d.scopes].sort(),n))),f_.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new k_e(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(f_.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 f_.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){f_.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return f_.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]}),f_.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(f_.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(nr).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if(jct(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},w7r=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}){f_.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)),f_.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=fdr(e.id_token)}catch{}if(!r)try{r=fdr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:yso(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 FI=new fe("DynamicAuthProviderService"),KN=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new bso.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 wRt(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){FI.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${Xu(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${R_e}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(ar).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){LI.error(this.ctx,`Failed to get client ID and secret from user: ${Xu(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,LI.info(this.ctx,`User provided client registration for ${e.toString()}`),s?LI.info(this.ctx,`User provided client secret for ${e.toString()}`):LI.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(tr).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=>p3r.includes(s)):p3r,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${w_e}/callback`,`http://127.0.0.1:${w_e}/callback`],scope:r?.join(GYn),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(KYn(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(dm).registerAuthenticationProvider(e.id,e),this.ctx.get(tC).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(dm);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);LI.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);LI.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw LI.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(dm);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});LI.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);LI.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw LI.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(dm),n=this.ctx.get(tC);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),LI.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw LI.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var wRt=class extends dm{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===DN.providerId){let s=new DN(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(tC).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(tC).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(YN).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 vso=de(Xc());var _so=new fe("agentCopilotTokenManager"),ynl={type:new vso.ProtocolRequestType("copilot/token")},RRt=class extends Rh{constructor(){super(...arguments);this.networkFetcher=new u7e}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(bn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(ar).connection;try{let c=await s.sendRequest(ynl.type,{force:!1,session:n});if(!c?.envelope)throw new yi("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(_so.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(bn),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(bn),o=this.ctx.get(Zt),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 Enl=new fe("Public Code References"),kRt=class extends jT{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," ");Enl.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(bn).getCapabilities().ipCodeCitation===!0&&await e.get(ar).connection.sendNotification(HQt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var w7r=de(Xc());var _nl=new w7r.ProtocolNotificationType("$/copilot/compressionStarted"),vnl=new w7r.ProtocolNotificationType("$/copilot/compressionCompleted"),PRt=class extends bI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(ar).connection.sendNotification(_nl,r)}async notifyCompressionCompleted(r){await this.ctx.get(ar).connection.sendNotification(vnl,r)}};p();p();function Cso(t){Cnl(t)}a(Cso,"activateExtensibilityPlatformFeature");function Cnl(t){t.set(WP,new bJe(t)),t.set(NO,new NO(t))}a(Cnl,"registerContextDependencies");p();var bso=S.String(),R7r=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(NRt,"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){FI.error(this.ctx,`Failed to get client ID and secret from user: ${Xu(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,FI.info(this.ctx,`User provided client registration for ${e.toString()}`),s?FI.info(this.ctx,`User provided client secret for ${e.toString()}`):FI.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(nr).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=>h3r.includes(s)):h3r,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${R_e}/callback`,`http://127.0.0.1:${R_e}/callback`],scope:r?.join($Yn),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(JYn(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(dm).registerAuthenticationProvider(e.id,e),this.ctx.get(rC).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(dm);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);FI.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);FI.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw FI.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(dm);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});FI.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);FI.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw FI.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(dm),n=this.ctx.get(rC);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),FI.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw FI.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var RRt=class extends dm{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===NN.providerId){let s=new NN(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(rC).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(rC).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(KN).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 Tso=de(Xc());var Sso=new fe("agentCopilotTokenManager"),Snl={type:new Tso.ProtocolRequestType("copilot/token")},kRt=class extends Rh{constructor(){super(...arguments);this.networkFetcher=new f7e}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(bn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(ar).connection;try{let c=await s.sendRequest(Snl.type,{force:!1,session:n});if(!c?.envelope)throw new yi("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(Sso.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(bn),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(bn),o=this.ctx.get(Zt),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 Tnl=new fe("Public Code References"),PRt=class extends GT{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," ");Tnl.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(bn).getCapabilities().ipCodeCitation===!0&&await e.get(ar).connection.sendNotification(GQt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var R7r=de(Xc());var Inl=new R7r.ProtocolNotificationType("$/copilot/compressionStarted"),xnl=new R7r.ProtocolNotificationType("$/copilot/compressionCompleted"),DRt=class extends TI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(ar).connection.sendNotification(Inl,r)}async notifyCompressionCompleted(r){await this.ctx.get(ar).connection.sendNotification(xnl,r)}};p();p();function Iso(t){wnl(t)}a(Iso,"activateExtensibilityPlatformFeature");function wnl(t){t.set(zP,new IJe(t)),t.set(NO,new NO(t))}a(wnl,"registerContextDependencies");p();var xso=S.String(),k7r=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(MRt,"build logs"),`The contents of the application build logs: \`\`\` ${e} -\`\`\``}},NRt="build-logs",DRt=class extends gg{static{a(this,"BuildLogsSkill")}constructor(e){super(NRt,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new R7r(r))}};p();var k7r=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 LXe(this.turnContext.ctx,this.turnContext.cancelationToken,r);if(n.length>0){let o=[[new Ar(["The user wants you to consider the following directory structures when computing your answer."]),1]];for(let s of n)o.push([new Ar([s]),1]);return new Ar(o)}}filterDirectoryReferences(e){return e.filter(r=>r.type==="directory")}},P7r=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},bnl="directory-references",MRt=class{constructor(){this.id=bnl;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new P7r}processor(e){return new k7r(e)}};p();var Snl=S.Object({uri:S.String(),visibleRange:S.Optional(Sf),openedAt:S.Optional(S.String()),activeAt:S.Optional(S.String())}),Sso=S.Object({files:S.Array(Snl)}),Tnl=3,D7r=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=Cq(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(ii),o=[];for(let s of r){let c=await n.getOrReadTextDocument(s),l=td(c);if(await this.turnContext.collectFile(LRt,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===Tnl))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(ii).getRelativePath(n),c=new IO(n,void 0,o.visibleRange);return new Ar([[`Code excerpt from file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),.9]])})}async preElideDocuments(e){let r=(await xo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},LRt="recent-files",ORt=class extends gg{static{a(this,"RecentFilesSkill")}constructor(e){super(LRt,"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 D7r(r))}};p();var Tso=S.String(),N7r=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(FRt,"runtime logs"),`The contents of the application runtime logs: +\`\`\``}},MRt="build-logs",NRt=class extends gg{static{a(this,"BuildLogsSkill")}constructor(e){super(MRt,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new k7r(r))}};p();var P7r=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 UXe(this.turnContext.ctx,this.turnContext.cancelationToken,r);if(n.length>0){let o=[[new Ar(["The user wants you to consider the following directory structures when computing your answer."]),1]];for(let s of n)o.push([new Ar([s]),1]);return new Ar(o)}}filterDirectoryReferences(e){return e.filter(r=>r.type==="directory")}},D7r=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},Rnl="directory-references",ORt=class{constructor(){this.id=Rnl;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new D7r}processor(e){return new P7r(e)}};p();var knl=S.Object({uri:S.String(),visibleRange:S.Optional(Sf),openedAt:S.Optional(S.String()),activeAt:S.Optional(S.String())}),wso=S.Object({files:S.Array(knl)}),Pnl=3,N7r=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=bq(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(ii),o=[];for(let s of r){let c=await n.getOrReadTextDocument(s),l=td(c);if(await this.turnContext.collectFile(BRt,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===Pnl))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(ii).getRelativePath(n),c=new IO(n,void 0,o.visibleRange);return new Ar([[`Code excerpt from file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),.9]])})}async preElideDocuments(e){let r=(await wo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},BRt="recent-files",LRt=class extends gg{static{a(this,"RecentFilesSkill")}constructor(e){super(BRt,"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 N7r(r))}};p();var Rso=S.String(),M7r=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(URt,"runtime logs"),`The contents of the application runtime logs: \`\`\` ${e} -\`\`\``}},FRt="runtime-logs",BRt=class extends gg{static{a(this,"RuntimeLogsSkill")}constructor(e){super(FRt,"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 N7r(r))}};p();var URt=de(PP());var QRt=class extends zh{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return Q9e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(ar).connection}async inspectPrompt(r){return this.connection?.sendNotification(new URt.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new URt.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new URt.NotificationType("conversation/documentDiff"),r)}};p();var Iso=de(Xc());var p6e=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(ck).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(ar).connection.sendNotification(new Iso.NotificationType(this.notificationEndpoint),e)}};function xso(t){Inl(t),xnl(t),Cso(t)}a(xso,"activateConversationFeature");function Inl(t){t.set(zo,new zo(t)),t.set(Ag,new Ag),t.set(kA,new kA(t)),t.set(el,new nYe(t)),t.set(F9,new F9),t.set(Tc,new Tc(t)),t.set(ck,new ck(t)),t.set(p6e,new p6e(t)),t.set(xs,new I$e(t,new T$e(t))),t.set(RN,new RN),t.set(zh,new QRt(t)),t.set(t2,new t2(t))}a(Inl,"registerContextDependencies");function xnl(t){let e=new Yh;e.registerSkill(new uXe(new lXe)),e.registerSkill(new UKe(new zv(t,xO,Bvn))),e.registerSkill(new xKe(new zv(t,GP,Dvn))),e.registerSkill(new IKe(new zv(t,lE,Pvn))),e.registerSkill(new QKe),e.registerSkill(new MRt),e.registerSkill(new ORt(new zv(t,LRt,Sso))),e.registerSkill(new hJe(new zv(t,MO,$Cn))),e.registerSkill(new hXe(new zv(t,Qq,kxn))),e.registerSkill(new BRt(new zv(t,FRt,Tso))),e.registerSkill(new DRt(new zv(t,NRt,bso))),e.registerSkill(new gXe(new zv(t,r2,Pxn))),e.registerSkill(new AXe(new zv(t,cJ,Dxn))),t.set(Yh,e)}a(xnl,"registerSkills");p();var wso=de(Xc()),Rso=de(PP());var qRt=class extends qd{constructor(){super(...arguments);this.requestType=new wso.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=qu.Compile(QAn)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(ar).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Rso.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 QA(this.typeCheck.Errors(s));return s}};p();var kso=de(Xc()),Pso=de(PP());var jRt=class extends F_{constructor(){super(...arguments);this.requestType=new kso.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=qu.Compile(UAn)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(ar).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Pso.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 QA(this.typeCheck.Errors(s));return this.transformToToolResult(s)}transformToToolResult(r){let n=r.content.map(o=>typeof o.value=="string"?new Rr(o.value):new _K(o.value));return new Lr(n,r.status??"success")}};p();p();function Dso(t,e,r){try{let n=t.get(Zt).javaContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(Dso,"fillInJavaActiveExperiments");var M7r=de(PP());var wnl={type:new M7r.NotificationType("featureFlagsNotification")},Rnl={type:new M7r.NotificationType("copilot/didChangeFeatureFlags")},h6e=class{constructor(e){this.ctx=e;bs(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=!1,d=r.get(Zt),f=await d.updateExPValuesAndAssignments(e);n=d.ideDataMigrationCompleted(f),o=d.appmodContextMenuEnabled(f),s=d.appmodProblemsViewEnabled(f),c=d.cliAsDefaultAgentProviderEnabled(f),l=kdn(r,f),u=d.inlineChatUseCliEnabled(f);let h={};r.get(Zt).excludeRelatedFiles(f)&&(h.ExcludeRelatedFiles=!0);let m=Qfr(r,f);m.length>0&&(h.ExpContextProviders=m);let g=new Map;NXn(r,m,g,f),qlt(r,g,f),Dso(r,g,f);for(let[E,_]of g.entries())h[E]=_;let A=r.get(bn),y=r.get(ar).connection;if(A.getCapabilities().didChangeFeatureFlags)await y.sendNotification(Rnl.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:h,byok:XQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u,user_info__cli_enabled:e.userInfo.cliEnabled,copilot_plan:e.userInfo.copilotPlan});else{let E={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:h,byok:XQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u};e.getTokenValue("agent_mode")==="0"&&(E.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(E.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(E.mcp=!1),e.envelope.chat_enabled&&(E.xc=!0),e.userInfo.cliEnabled!==void 0&&(E.user_info__cli_enabled=e.userInfo.cliEnabled),await y.sendNotification(wnl.type,E)}}};p();var HRt=class extends ps{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(ar).connection.sendNotification(XQt.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(ar).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(ar).connection.sendNotification(eqt.type,r)}};p();var Nso=new fe("AgentEncodingConfigurationService"),GRt=class extends SO{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(ar)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){Nso.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){Nso.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var Mso=new SQ;p();var Bso=de(ri());var Fso={"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"}},knl=new Bso.NotificationType("policy/didChange"),Pnl=Object.fromEntries(Object.entries(Fso).map(([t,e])=>[t,{type:e.type}])),m6e=class extends jl{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(Fso).map(([r,n])=>[r,n.defaultValue]));let o=r.get(ar);o.onActivation(()=>{this.startWatching().catch(s=>{Nr.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(()=>de(Lso()));this.policyWatcher=r("IDEGitHubCopilot",Pnl,n=>{this.handlePolicyUpdate(n).catch(o=>{Nr.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Nr.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Nr.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Nr.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Nr.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),Nr.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(bn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(bn).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(knl,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Nr.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Nr.debug(this.ctx,"Policy watcher stopped")}}};p();var $Rt=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(e){this.ctx.get(ar).connection.sendNotification(nVi,{scope:e}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(ar).connection.sendNotification(iVi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(YN).unregisterProvider(e)}};p();var VRt=class extends wb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(uA).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(uA).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(uA).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var Uso=de(ri());var WRt="mcp.elicitation",zRt=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new Uso.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Un(ei.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 Un(ei.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;sr.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await lc(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(wO).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 Et(e.ctx,WRt,Wt.createAndMarkAsIssued()),At(e.ctx,WRt),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw sr.error(e.ctx,l,c),await _0(e.ctx,{message:l,server:r}),qa(e.ctx,c,WRt),Vn(e.ctx,WRt,c),new Un(ei.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var Ik=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var g6e=class extends Ik{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":sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),lc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":sr.warn(this.ctx,`MCP server ${this.serverName} log:`,r),kX(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":sr.error(this.ctx,`MCP server ${this.serverName} log:`,r),_0(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),lc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var A6e=class extends Ik{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Prompts list changed, refreshing prompts..."),lc(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(cTt)}};p();var y6e=class extends Ik{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Resource list changed, refreshing resources..."),lc(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(aTt)}};p();var E6e=class extends Ik{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),lc(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(t$i)}};p();var YRt=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},_6e=class extends YRt{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){sr.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get($r).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),lc(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){sr.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),_0(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 v6e=class extends Ik{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Tool list changed, refreshing tools..."),lc(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(sTt)}};p();var Qso="mcp.sampling",KRt=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 Un(ei.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,sr.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await lc(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(_W).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"),E=y[y.length-1];if((await e.ctx.get(qd).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:{...E,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 Oc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await axe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new Fn.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 At(e.ctx,Qso,{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 sr.error(e.ctx,u,l),await _0(e.ctx,{message:u,server:o}),At(e.ctx,Qso,{success:"false",errorMessage:u}),new Un(ei.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){sr.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 sr.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",sr.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?hO(e,u.provider,l):await e.get(el).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(xs).getMetadata()).filter(n=>n.capabilities.type&&!sle.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 da(e.get(Yn)).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 sCe=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function qso(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=Fct(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(qso,"parseScopeChallenge");p();var L7r=/[^a-z0-9_-]/gi;var Dnl=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function jso(){let t={};for(let e of Dnl){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(jso,"getDefaultEnvironment");async function Hso(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;sr.warn(t,n),await kX(t,{message:n,server:r,tool:e.name}),e.description=""}if(L7r.lastIndex=0,L7r.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;sr.warn(t,n),await kX(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(L7r,"_")}else e._nameForModel=e.name;return e}a(Hso,"normalizeTool");var JRt=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*B7r(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(B7r,"paginateRequest");async function F7r(t){let e=[];for await(let r of t)e.push(...r);return e}a(F7r,"flattenAsyncIterable");var Gso=de(require("events"));var U7r=6e4,vW=class{constructor(e,r,n){this.transport=null;this.emitter=new Gso.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(bn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new KRt),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new zRt);let s=this.ctx.get(Ir).getEditorInfo(),c=this.ctx.get(Ir).getEditorPluginInfo();this.mcp=new _H({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 sr.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw sr.error(this.ctx,"Connection failed:",r),await _0(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(FV)}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 Hso(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof sCe){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(sr.info(this.ctx,l),await _0(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===ei.MethodNotFound){if(sr.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(sr.error(this.ctx,c),await _0(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=B7r(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 F7r(this.getResourcesIterable(e));return lc(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=B7r(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 F7r(this.getResourceTemplatesIterable(e));return lc(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=RJ();this.ongoingMcpToolCalls.push({requestId:l,toolName:e,turnContext:o,roundId:s,toolCallId:c});let u=a(d=>{let f=new Lr([],"error");return f.content.push(new Rr(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}},uH,{onprogress:a(m=>{sr.info(this.ctx,`${e} calling progress`,m),lc(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 sr.error(this.ctx,m),await _0(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return sr.error(this.ctx,h),await _0(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=()=>{sr.info(this.ctx,`MCP server ${this.name} connection closed.`),lc(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{sr.error(this.ctx,`MCP server ${this.name} error:`,e),_0(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(fX,e=>new g6e(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(a8,e=>new v6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(s8,e=>new A6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(o8,e=>new y6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(Fcr,e=>new E6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(Kcr,e=>(this.initRootsTracker(),new _6e(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(B2e,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw sr.error(this.ctx,o),new Un(ei.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw sr.error(this.ctx,o),new Un(ei.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new oc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(F2e,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw sr.error(this.ctx,n),new Un(ei.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(sTt,()=>{this.refreshToolsCache()}),this.emitter.on(aTt,()=>{this.refreshResourcesCache()}),this.emitter.on(cTt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(U7r),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)))),sr.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit(FV)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(U7r),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,sr.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit(FV)}catch(r){sr.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(U7r),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,sr.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit(FV)},"refresh prompts",{defaultValue:void 0})}formatToolResult(e){let r=new Lr([],e.isError===!0?"error":"success");for(let n of e.content??[])if(n.type==="text")r.content.push(new Rr(n.text));else if(n.type==="image"||n.type==="audio")r.content.push(new KQ({mimeType:n.mimeType,data:n.data}));else if(n.type==="resource"){let o=n.resource;if("text"in o)r.content.push(new Rr(o.text));else if("blob"in o){let s=o.mimeType||"application/octet-stream";r.content.push(new KQ({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new Rr(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 Nnl(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=qso(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new sCe(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(Nnl,"createFetchAdapter");function ZRt(t,e){let r=t.get(tr),n=Nnl(r);return{...e,fetch:n}}a(ZRt,"createConfigWithFetch");var XRt=class extends vW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=ZRt(this.ctx,r),{url:o,...s}=n;return new vhe(new URL(o),s)}};p();var $so=require("child_process"),Vso=require("util");var ekt=class extends vW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...jso(),...r.env||{}},r.stderr="pipe",new xhe(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{kX(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,Vso.promisify)($so.exec);sr.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),lc(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),sr.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){sr.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),_0(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var C6e=class extends vW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=ZRt(this.ctx,r),{url:o,...s}=n;return new Che(new URL(o),s)}};p();var tkt=class extends YQ{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 Oc;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(qd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var Kso=de(Xc());p();var Wso="mcp-servers-cache",zso="mcp-first-boot-completed",rkt=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(uA),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(zso)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(zso,"true")}parseCache(){let e=this.stateDb.get(Wso);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(Wso,e)}};p();function Yso(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(Yso,"isNightlyOrDevBuild");var nkt=class t extends o_{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new Vx;this.prefixGenerator=new JRt;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new rkt(r),this.registryService=r.get(PN),bs(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(sr.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(sr.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(bn).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(sr.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new Kso.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return sr.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(bn).getCapabilities().mcpAllowlist)return sr.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=Yso(this.ctx);return n||sr.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:(sr.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(bn).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),sr.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),sr.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),sr.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)}`);sr.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){sr.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}ZIe(r)&&(d._status=c),this.ctx.get(gs).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(gs).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 Et(this.ctx,"mcp.getPrompt",Wt.createAndMarkAsIssued()),At(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){sr.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){sr.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await lc(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){sr.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await lc(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(FV),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await lc(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await lc(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 lc(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){sr.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await lc(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),sr.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(YN).unregisterProvider(o)}catch{sr.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;sr.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(wb).removeAccountPreference(r,c);try{let u=this.ctx.get(dm).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),sr.info(this.ctx,`Successfully removed session for account ${l}`)):sr.warn(this.ctx,`No session found for account ${l}`)}catch(u){sr.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 sr.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),sr.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){sr.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on(FV,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await lc(this.ctx,{message:"Connection state: Running",server:r})}catch(c){sr.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof Jw||c instanceof PDe,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof C6e&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;sr.info(this.ctx,f),lc(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 sr.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 _0(this.ctx,{message:d,server:r}),this.ctx.get(ts).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=>{sr.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){sr.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new XRt(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new C6e(this.ctx,r.name,r.version||"1.0.0"):new ekt(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(ar).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){sr.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(gs).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 tkt({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(sr.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){sr.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(gs).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){sr.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){sr.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;sr.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(wb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new She(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw sr.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(dm).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(dm).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(dm).createDynamicAuthenticationProvider(o,s,c),!A)){sr.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(dm).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(wb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(dm).getProvider(l),g=!!this.ctx.get(tC).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",E=d.map(v=>({title:v.account.label}));E.push({title:y}),E.push({title:"Cancel"});let _=await this.ctx.get(ts).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,...E);if(!_||_.title==="Cancel"){sr.warn(this.ctx,"user cancelled the account selection");return}if(_.title!==y){let v=d.find(b=>b.account.label===_.title);if(!v){sr.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(wb).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){sr.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(ts).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){sr.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){sr.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(ts).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(wb).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){sr.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(ts).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 Jso=de(Xc());var ikt=class t extends F2{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new Jso.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(ar).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var Zso=de(Xc());var Mnl=new Zso.ProtocolRequestType("copilot/readMcpSamplingConfig"),okt=class extends _W{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(ar).connection,o;try{o=await n.sendRequest(Mnl,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${Xu(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 akt=de(Xc());var Onl=new akt.ProtocolRequestType("copilot/showPanelMessageRequest"),Lnl=new akt.ProtocolNotificationType("copilot/showPanelMessage"),skt=class extends iCe{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(ar).connection.sendNotification(Lnl,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(ar).connection,o;try{o=await n.sendRequest(Onl,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${Xu(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 eao=require("node:stream"),poe=de($ar());var X9=new fe("UndiciFetcher"),lkt=class extends tr{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(ds).getVersion()}`,this.certificateConfigurator=new F_e(r),this.proxySocketFactory=r.get(uk),this.settings=r.get(Lo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),X9.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Lo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),X9.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=Unl(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};X9.debug(this.ctx,"Starting Undici fetch.",{target:ckt(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,poe.fetch)(r,{...h,dispatcher:m});return X9.debug(this.ctx,"Undici fetch completed.",{target:ckt(r),status:A.status,isProxy:g}),new ex(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?eao.Readable.fromWeb(A.body):null)}catch(h){throw l?(X9.warn(this.ctx,"Undici fetch timed out.",{target:ckt(r),timeout:n.timeout}),new jW(`Request to <${r}> timed out after ${n.timeout}ms`,h)):Qnl(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&&(X9.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||(X9.debug(this.ctx,"Creating direct Undici agent.",{target:ckt(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new poe.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,poe.buildConnector)(r);return X9.debug(this.ctx,"Creating proxied Undici agent.",{proxy:Xso(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new poe.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)&&X9.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}=Bnl(s),u=Fnl(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:Xso(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 Bnl(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(Bnl,"splitHostPort");function Fnl(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(Fnl,"compileHostPattern");function ckt(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(ckt,"describeUrl");function Xso(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(Xso,"describeProxy");function Unl(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(Unl,"toNativeAbortSignal");function Qnl(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(Qnl,"withCauseNetworkProperties");p();var b6e=new fe("fetcher"),qnl="https://default.exp-tas.com/",S6e=class extends tr{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(Gm(o)||`${r}/`.startsWith(qnl))throw o;b6e.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),b6e.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()}},ukt=class extends tr{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new S6e(r,n,o,(s,c)=>{this.current!==o&&(b6e.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,Vn(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:Hnl(c),...Gnl(s),...$nl(r)}),n.disconnectAll().catch(l=>{b6e.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(b6e.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()])}},jnl=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function Hnl(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return jnl.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(Hnl,"describeHost");function Gnl(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(Gnl,"buildErrorCauseProperties");function $nl(t){try{let e=t.get(Lo).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($nl,"describeHttpContext");var tao=new fe("fetcher");function Vnl(t){return Ft(t,Ye.UseHelixFetcher)==="true"}a(Vnl,"isHelixFetcherForced");function Wnl(t){if(Vnl(t))return new Bie(t);let e=new ukt(t,new lkt(t),new Bie(t));return t.get(Lo).onDidChangeHttpSettings(()=>e.reset()),e}a(Wnl,"createDefaultFetcher");var dkt=class extends tr{constructor(r,n=Wnl(r),o=new L_e(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=Ft(this.ctx,Ye.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&&(tao.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new S6e(r,n,o,()=>{tao.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(bn).onDidSetCapabilities(this.updateFetcher),r.get(Lo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return Ft(this.ctx,Ye.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(bn).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 pkt=de(ri());var fkt=class extends ts{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(ar).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(pkt.ShowMessageRequest.type,{type:pkt.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})}};p();var rao=de(Xc());var hkt=class t extends bK{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new rao.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var nao=de(Xc());var mkt=class t extends tq{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new nao.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var iao=de(Xc());var znl=new iao.ProtocolNotificationType("$/copilot/rateLimitWarning"),gkt=class extends qS{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(ar).connection.sendNotification(znl,r)}};p();p();var Akt=class extends xze{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(bN).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(bN).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(bN);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 ykt=class extends zx{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new Akt(this.ctx,e)}shouldStartWatching(e){return IP(this.ctx)?!1:!!this.ctx.get(bn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped")}};function Ekt(t){let e=new rb(process.env),r=Doo(e);r.set(rb,e),r.set(tr,new dkt(r)),r.set(oc,new oc(r)),a3r(r,{});let n=mtn();r.set(Yn,n),r.set(uA,new uA(r));let o=new RRt;r.set(Rh,o);let s=sao.join(n.directory,mQr),c=v3.plaintextOnly();r.set(v3,c);let{repo:l,diagnostics:u}=Xdn(r,s,c);r.set(nx,l),r.set(Ur,new mje(r,process.env)),r.set(HT,new HT(r)),r.set(Pie,new Pie(r));let d=new pf(r,"agent");d.onInitialized(()=>tfn(r,u)),r.set(pf,d),r.set(Ua,TYi),r.set(UI,new UI),r.set(Ir,new ij),r.set(Fie,hYi()),r.set(Ru,new Ru),r.set(Qo,Mso),r.set(la,new bRt(r)),r.set(dee,new TRt(r)),r.set(zx,new ykt(r)),r.set(bN,new bN(r)),r.set(pm,new pm),r.set(hm,Glt(r,D$i)),r.set(Nb,new Nb(r)),r.set(r4,new nme),fso(r),wze(r),rfn(r),r.set(ar,new ar(r,t)),r.set(wO,new SRt(r)),r.set(ts,new fkt(r)),efn(r,u),r.set(iCe,new skt(r)),r.set(_W,new okt(r)),r.set(Vm,new x_e(r)),r.set(ps,new HRt(r));let f=new m6e(r,t);r.set(m6e,f),r.set(jl,f),r.set(h6e,new h6e(r)),r.set(f6e,new f6e(r)),r.set(tp,new tp);let h=new WV(r);r.set($r,h),r.set(WV,h),r.set($m,new q_e(r,process.env)),r.set(kk,new boe),r.set(nc,new nc(r)),xso(r),lso(r),r.set(wN,new wN),r.set(QV,new QV),r.set(kN,new kN),r.set(qV,new qV([])),r.set(jT,new kRt),r.set(oao.ObservableWorkspace,new bV(r,!0,!0)),r.set(m4,new H_e),r.set(h9,new h9),r.set(Vv,new Vv(r)),r.set(ry,new A1t(r)),r.set(F_,new jRt(r)),r.set(qd,new qRt(r)),r.set(mw,new mw(r)),r.set(gs,new gs(r)),r.set(gF,new gF(r)),r.set(yF,new yF(r)),r.set(tT,new tT(r)),r.set(yJ,new yJ(r)),r.set(XO,new XO),r.set(m0,new m0),r.set(PN,new PN(r)),r.set(o_,new nkt(r)),r.set(F2,new ikt(r)),r.set(dF,new dF(r)),r.set(wb,new VRt(r));let m=new TH(r);r.set(TH,m);let g=new ey(r,m,new $Rt(r));r.set(ey,g),r.set(PT,new PT(r,m,g)),r.set(iie,GQi(r)),r.set(qS,new gkt(r)),r.set(HX,new HX),r.set(Rie,new Rie),r.set(dm,new wRt(r)),r.set(tC,new IRt(r)),r.set(YN,new YN(r));let A=new wA(r);r.set(wA,A),r.set(bf,new bf(r,A)),r.set(Cg,new Cg(r,A)),r.set(Ld,new Ld(r,A)),r.set(h0,new h0(r,e,A));let y=new w3(r,A,n);r.set(w3,y),r.get(US).addListener(y.lifecycleListener);let E=new u6e;r.set(u6e,E),r.set(a0,new lIt(r)),r.set(ug,new ug(r,E)),r.set(Aw,new Aw),r.set(nT,new nT(r)),r.set(Zq,new Zq(r)),r.set(nw,new kO([new PO,new DO])),r.set(wie,new wie(r)),r.set(j_,new j_(r)),r.set(tq,new mkt(r)),r.set(bK,new hkt(r)),r.set(pv,new pv(r)),r.set(Hs,new Hs(r)),r.set(fm,new fm),r.set(WX,new WX(r)),r.set(y8,new y8(r,new Xwt)),r.set(cie,new cie(r)),r.set(aie,new aie(r)),r.set(fc,new fc(r)),r.set(SO,new GRt(r)),r.set(xN,new xN(r)),r.set(sk,new sk(r.get(xN),r)),r.set(HO,new HO(r)),r.set(bI,new PRt(r)),r.set(ZC,new ZC(r.get(sk),r.get(bI),r)),r.set(mE,new mE(r));let _=new uc(r);r.set(uc,_);let v=new g8(r,_);return r.set(g8,v),r.set(Uie,new Uie(r,_)),r.get(ar).onActivation(()=>{v.ensureInitialSync()}),r}a(Ekt,"createLanguageServerContext");var KN=new fe("ACP");async function aao(t){let e=t.get(ds);KN.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(rb).markReady(),t.get(zp).githubAppId=Kae,Jnl(t),Knl(t),t.get(bn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Qt).primeToken()?KN.info(t,"Token primed successfully"):KN.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(pf).initialize(!0),T0n()?await Ynl(t):(At(t,"acp.server.start",{acpPipeline:"internal"}),await cao(t))}a(aao,"startACPServer");async function cao(t){KN.info(t,"Starting ACP server with internal pipeline");let e=aCe.Writable.toWeb(process.stdout),r=aCe.Readable.toWeb(process.stdin),n=GRe(e,r),o=new $Re(s=>new gIt(s,t),n);o.signal.addEventListener("abort",()=>{KN.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(cao,"startACPServerInternal");async function Ynl(t){KN.info(t,"Starting ACP server with CLI proxy"),At(t,"acp.cli.discover");let e;try{e=await I0n()}catch(u){let d=u instanceof Error?u.message:String(u);KN.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),Vn(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await cao(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;KN.info(t,`Found Copilot CLI: ${r} v${e.version}`),At(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new AIt(e,t),o=aCe.Writable.toWeb(process.stdout),s=aCe.Readable.toWeb(process.stdin),c=GRe(o,s),l=new $Re(u=>new EIt(u,t,n),c);l.signal.addEventListener("abort",()=>{KN.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(Ynl,"startACPServerWithCLI");function Knl(t){let e=t.get(gs);e.registerTool(new Xq({name:"create_file",description:"Create a new file in the workspace with the specified content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.String({description:"The content to write to the new file."})})})),e.registerTool(new Xq({name:"insert_edit_into_file",description:"Edit an existing file by inserting, replacing, or deleting content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),content:S.Optional(S.String({description:"The new content for the file."})),edits:S.Optional(S.Array(S.Object({startLine:S.Number({description:"The starting line number (1-based)."}),endLine:S.Number({description:"The ending line number (1-based)."}),newContent:S.String({description:"The new content to replace the range with."})})))})})),e.registerTool(new Xq({name:"replace_string_in_file",description:"Replace a specific string in a file with a new string.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.String({description:"The string to find and replace."}),newString:S.String({description:"The string to replace it with."})})})),KN.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(Knl,"registerACPClientTools");function lao(){let e=Ekt({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 zV(e);return e.forceSet(F_,r),{ctx:e,acpToolInvoker:r}}a(lao,"createACPContext");function Jnl(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(KN.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),l7e(t,r))}a(Jnl,"configureGitHubEnterpriseUrl");p();var Q7r=require("events"),T6e=de(require("fs"));p$e();var vkt=de(Xc());p();var dao=de(require("fs")),fao=de(require("http")),cCe=de(require("path"));var _kt=class{constructor(e,r){this.port=e;let n;this.server=fao.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=>{uao(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{uao(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;cCe.basename(__dirname)!=="debug"&&(c=cCe.dirname(__dirname)),n??=dao.readFileSync(cCe.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 uao(t,e){t.write("data: "+e.toString().replace(/\n/g,` +\`\`\``}},URt="runtime-logs",FRt=class extends gg{static{a(this,"RuntimeLogsSkill")}constructor(e){super(URt,"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 M7r(r))}};p();var QRt=de(DP());var qRt=class extends zh{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return j9e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(ar).connection}async inspectPrompt(r){return this.connection?.sendNotification(new QRt.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new QRt.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new QRt.NotificationType("conversation/documentDiff"),r)}};p();var kso=de(Xc());var m6e=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(lk).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(ar).connection.sendNotification(new kso.NotificationType(this.notificationEndpoint),e)}};function Pso(t){Dnl(t),Nnl(t),Iso(t)}a(Pso,"activateConversationFeature");function Dnl(t){t.set(Yo,new Yo(t)),t.set(Ag,new Ag),t.set(kA,new kA(t)),t.set(el,new sYe(t)),t.set(U9,new U9),t.set(Tc,new Tc(t)),t.set(lk,new lk(t)),t.set(m6e,new m6e(t)),t.set(xs,new w$e(t,new x$e(t))),t.set(kN,new kN),t.set(zh,new qRt(t)),t.set(r2,new r2(t))}a(Dnl,"registerContextDependencies");function Nnl(t){let e=new Yh;e.registerSkill(new pXe(new fXe)),e.registerSkill(new jKe(new Yv(t,xO,Fvn))),e.registerSkill(new kKe(new Yv(t,$P,Nvn))),e.registerSkill(new RKe(new Yv(t,lE,Dvn))),e.registerSkill(new HKe),e.registerSkill(new ORt),e.registerSkill(new LRt(new Yv(t,BRt,wso))),e.registerSkill(new AJe(new Yv(t,MO,VCn))),e.registerSkill(new AXe(new Yv(t,qq,Pxn))),e.registerSkill(new FRt(new Yv(t,URt,Rso))),e.registerSkill(new NRt(new Yv(t,MRt,xso))),e.registerSkill(new EXe(new Yv(t,n2,Dxn))),e.registerSkill(new _Xe(new Yv(t,cJ,Nxn))),t.set(Yh,e)}a(Nnl,"registerSkills");p();var Dso=de(Xc()),Nso=de(DP());var jRt=class extends qd{constructor(){super(...arguments);this.requestType=new Dso.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=qu.Compile(qAn)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(ar).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Nso.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 QA(this.typeCheck.Errors(s));return s}};p();var Mso=de(Xc()),Oso=de(DP());var HRt=class extends F_{constructor(){super(...arguments);this.requestType=new Mso.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=qu.Compile(QAn)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(ar).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Oso.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 QA(this.typeCheck.Errors(s));return this.transformToToolResult(s)}transformToToolResult(r){let n=r.content.map(o=>typeof o.value=="string"?new Rr(o.value):new _K(o.value));return new Lr(n,r.status??"success")}};p();p();function Lso(t,e,r){try{let n=t.get(Zt).javaContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(Lso,"fillInJavaActiveExperiments");var O7r=de(DP());var Mnl={type:new O7r.NotificationType("featureFlagsNotification")},Onl={type:new O7r.NotificationType("copilot/didChangeFeatureFlags")},g6e=class{constructor(e){this.ctx=e;bs(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=!1,d=r.get(Zt),f=await d.updateExPValuesAndAssignments(e);n=d.ideDataMigrationCompleted(f),o=d.appmodContextMenuEnabled(f),s=d.appmodProblemsViewEnabled(f),c=d.cliAsDefaultAgentProviderEnabled(f),l=Pdn(r,f),u=d.inlineChatUseCliEnabled(f);let h={};r.get(Zt).excludeRelatedFiles(f)&&(h.ExcludeRelatedFiles=!0);let m=qfr(r,f);m.length>0&&(h.ExpContextProviders=m);let g=new Map;BXn(r,m,g,f),jlt(r,g,f),Lso(r,g,f);for(let[E,_]of g.entries())h[E]=_;let A=r.get(bn),y=r.get(ar).connection;if(A.getCapabilities().didChangeFeatureFlags)await y.sendNotification(Onl.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:h,byok:eq(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u,user_info__cli_enabled:e.userInfo.cliEnabled,copilot_plan:e.userInfo.copilotPlan,abexp_features:f.filtersAndExp.exp.features,abexp_assignment_context:f.filtersAndExp.exp.assignmentContext});else{let E={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:h,byok:eq(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u};e.getTokenValue("agent_mode")==="0"&&(E.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(E.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(E.mcp=!1),e.envelope.chat_enabled&&(E.xc=!0),e.userInfo.cliEnabled!==void 0&&(E.user_info__cli_enabled=e.userInfo.cliEnabled),await y.sendNotification(Mnl.type,E)}}};p();var GRt=class extends ps{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(ar).connection.sendNotification(eqt.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(ar).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(ar).connection.sendNotification(tqt.type,r)}};p();var Bso=new fe("AgentEncodingConfigurationService"),$Rt=class extends SO{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(ar)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){Bso.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){Bso.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var Fso=new TQ;p();var qso=de(ti());var jso={"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"}},Lnl=new qso.NotificationType("policy/didChange"),Bnl=Object.fromEntries(Object.entries(jso).map(([t,e])=>[t,{type:e.type}])),A6e=class extends jl{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(jso).map(([r,n])=>[r,n.defaultValue]));let o=r.get(ar);o.onActivation(()=>{this.startWatching().catch(s=>{Nr.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(()=>de(Qso()));this.policyWatcher=r("IDEGitHubCopilot",Bnl,n=>{this.handlePolicyUpdate(n).catch(o=>{Nr.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Nr.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Nr.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Nr.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Nr.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),Nr.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(bn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(bn).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(Lnl,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Nr.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Nr.debug(this.ctx,"Policy watcher stopped")}}};p();var VRt=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(e){this.ctx.get(ar).connection.sendNotification(aVi,{scope:e}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(ar).connection.sendNotification(cVi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(KN).unregisterProvider(e)}};p();var WRt=class extends wb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(uA).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(uA).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(uA).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var Hso=de(ti());var zRt="mcp.elicitation",YRt=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new Hso.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Un(Xn.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 Un(Xn.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;sr.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await lc(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(wO).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 Et(e.ctx,zRt,Wt.createAndMarkAsIssued()),At(e.ctx,zRt),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw sr.error(e.ctx,l,c),await _0(e.ctx,{message:l,server:r}),Qa(e.ctx,c,zRt),Vn(e.ctx,zRt,c),new Un(Xn.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var xk=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var y6e=class extends xk{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":sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),lc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":sr.warn(this.ctx,`MCP server ${this.serverName} log:`,r),kX(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":sr.error(this.ctx,`MCP server ${this.serverName} log:`,r),_0(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),lc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var E6e=class extends xk{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Prompts list changed, refreshing prompts..."),lc(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(lTt)}};p();var _6e=class extends xk{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Resource list changed, refreshing resources..."),lc(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(cTt)}};p();var v6e=class extends xk{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),lc(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(o$i)}};p();var KRt=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},C6e=class extends KRt{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){sr.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get($r).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),lc(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){sr.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),_0(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 b6e=class extends xk{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Tool list changed, refreshing tools..."),lc(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(aTt)}};p();var Gso="mcp.sampling",JRt=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 Un(Xn.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,sr.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await lc(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(vW).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"),E=y[y.length-1];if((await e.ctx.get(qd).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:{...E,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 Oc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await axe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new Fn.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 At(e.ctx,Gso,{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 sr.error(e.ctx,u,l),await _0(e.ctx,{message:u,server:o}),At(e.ctx,Gso,{success:"false",errorMessage:u}),new Un(Xn.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){sr.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 sr.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",sr.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?hO(e,u.provider,l):await e.get(el).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(xs).getMetadata()).filter(n=>n.capabilities.type&&!sle.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 Ha(e.get(ri)).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 aCe=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function $so(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=qct(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($so,"parseScopeChallenge");p();var B7r=/[^a-z0-9_-]/gi;var Fnl=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function Vso(){let t={};for(let e of Fnl){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(Vso,"getDefaultEnvironment");async function Wso(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;sr.warn(t,n),await kX(t,{message:n,server:r,tool:e.name}),e.description=""}if(B7r.lastIndex=0,B7r.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;sr.warn(t,n),await kX(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(B7r,"_")}else e._nameForModel=e.name;return e}a(Wso,"normalizeTool");var ZRt=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*F7r(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(F7r,"paginateRequest");async function U7r(t){let e=[];for await(let r of t)e.push(...r);return e}a(U7r,"flattenAsyncIterable");var zso=de(require("events"));var Q7r=6e4,CW=class{constructor(e,r,n){this.transport=null;this.emitter=new zso.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(bn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new JRt),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new YRt);let s=this.ctx.get(Ir).getEditorInfo(),c=this.ctx.get(Ir).getEditorPluginInfo();this.mcp=new vH({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 sr.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw sr.error(this.ctx,"Connection failed:",r),await _0(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(UV)}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 Wso(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof aCe){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(sr.info(this.ctx,l),await _0(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===Xn.MethodNotFound){if(sr.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(sr.error(this.ctx,c),await _0(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=F7r(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 U7r(this.getResourcesIterable(e));return lc(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=F7r(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 U7r(this.getResourceTemplatesIterable(e));return lc(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=RJ();this.ongoingMcpToolCalls.push({requestId:l,toolName:e,turnContext:o,roundId:s,toolCallId:c});let u=a(d=>{let f=new Lr([],"error");return f.content.push(new Rr(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}},dH,{onprogress:a(m=>{sr.info(this.ctx,`${e} calling progress`,m),lc(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 sr.error(this.ctx,m),await _0(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return sr.error(this.ctx,h),await _0(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=()=>{sr.info(this.ctx,`MCP server ${this.name} connection closed.`),lc(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{sr.error(this.ctx,`MCP server ${this.name} error:`,e),_0(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(fX,e=>new y6e(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(c8,e=>new b6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(a8,e=>new E6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(s8,e=>new _6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(Ucr,e=>new v6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(Jcr,e=>(this.initRootsTracker(),new C6e(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(B2e,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw sr.error(this.ctx,o),new Un(Xn.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw sr.error(this.ctx,o),new Un(Xn.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new oc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(F2e,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw sr.error(this.ctx,n),new Un(Xn.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(aTt,()=>{this.refreshToolsCache()}),this.emitter.on(cTt,()=>{this.refreshResourcesCache()}),this.emitter.on(lTt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(Q7r),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)))),sr.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit(UV)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(Q7r),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,sr.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit(UV)}catch(r){sr.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(Q7r),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,sr.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit(UV)},"refresh prompts",{defaultValue:void 0})}formatToolResult(e){let r=new Lr([],e.isError===!0?"error":"success");for(let n of e.content??[])if(n.type==="text")r.content.push(new Rr(n.text));else if(n.type==="image"||n.type==="audio")r.content.push(new JQ({mimeType:n.mimeType,data:n.data}));else if(n.type==="resource"){let o=n.resource;if("text"in o)r.content.push(new Rr(o.text));else if("blob"in o){let s=o.mimeType||"application/octet-stream";r.content.push(new JQ({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new Rr(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 Unl(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=$so(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new aCe(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(Unl,"createFetchAdapter");function XRt(t,e){let r=t.get(nr),n=Unl(r);return{...e,fetch:n}}a(XRt,"createConfigWithFetch");var ekt=class extends CW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=XRt(this.ctx,r),{url:o,...s}=n;return new vhe(new URL(o),s)}};p();var Yso=require("child_process"),Kso=require("util");var tkt=class extends CW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...Vso(),...r.env||{}},r.stderr="pipe",new xhe(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{kX(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,Kso.promisify)(Yso.exec);sr.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),lc(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),sr.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){sr.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),_0(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var S6e=class extends CW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=XRt(this.ctx,r),{url:o,...s}=n;return new Che(new URL(o),s)}};p();var rkt=class extends KQ{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 Oc;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(qd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var eao=de(Xc());p();var Jso="mcp-servers-cache",Zso="mcp-first-boot-completed",nkt=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(uA),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(Zso)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(Zso,"true")}parseCache(){let e=this.stateDb.get(Jso);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(Jso,e)}};p();function Xso(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(Xso,"isNightlyOrDevBuild");var ikt=class t extends o_{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new Wx;this.prefixGenerator=new ZRt;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new nkt(r),this.registryService=r.get(DN),bs(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(sr.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(sr.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(bn).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(sr.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new eao.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return sr.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(bn).getCapabilities().mcpAllowlist)return sr.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=Xso(this.ctx);return n||sr.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:(sr.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(bn).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),sr.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),sr.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),sr.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)}`);sr.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){sr.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}XIe(r)&&(d._status=c),this.ctx.get(gs).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(gs).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 Et(this.ctx,"mcp.getPrompt",Wt.createAndMarkAsIssued()),At(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){sr.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){sr.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await lc(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){sr.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await lc(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(UV),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await lc(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await lc(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 lc(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){sr.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await lc(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),sr.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(KN).unregisterProvider(o)}catch{sr.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;sr.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(wb).removeAccountPreference(r,c);try{let u=this.ctx.get(dm).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),sr.info(this.ctx,`Successfully removed session for account ${l}`)):sr.warn(this.ctx,`No session found for account ${l}`)}catch(u){sr.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 sr.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),sr.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){sr.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on(UV,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await lc(this.ctx,{message:"Connection state: Running",server:r})}catch(c){sr.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof Zw||c instanceof PDe,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof S6e&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;sr.info(this.ctx,f),lc(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 sr.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 _0(this.ctx,{message:d,server:r}),this.ctx.get(ts).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=>{sr.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){sr.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new ekt(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new S6e(this.ctx,r.name,r.version||"1.0.0"):new tkt(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(ar).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){sr.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(gs).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 rkt({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(sr.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){sr.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(gs).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){sr.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){sr.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;sr.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(wb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new She(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw sr.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(dm).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(dm).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(dm).createDynamicAuthenticationProvider(o,s,c),!A)){sr.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(dm).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(wb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(dm).getProvider(l),g=!!this.ctx.get(rC).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",E=d.map(v=>({title:v.account.label}));E.push({title:y}),E.push({title:"Cancel"});let _=await this.ctx.get(ts).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,...E);if(!_||_.title==="Cancel"){sr.warn(this.ctx,"user cancelled the account selection");return}if(_.title!==y){let v=d.find(b=>b.account.label===_.title);if(!v){sr.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(wb).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){sr.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(ts).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){sr.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){sr.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(ts).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(wb).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){sr.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(ts).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 tao=de(Xc());var okt=class t extends U2{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new tao.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(ar).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var rao=de(Xc());var Qnl=new rao.ProtocolRequestType("copilot/readMcpSamplingConfig"),skt=class extends vW{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(ar).connection,o;try{o=await n.sendRequest(Qnl,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${Xu(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 ckt=de(Xc());var qnl=new ckt.ProtocolRequestType("copilot/showPanelMessageRequest"),jnl=new ckt.ProtocolNotificationType("copilot/showPanelMessage"),akt=class extends oCe{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(ar).connection.sendNotification(jnl,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(ar).connection,o;try{o=await n.sendRequest(qnl,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${Xu(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 iao=require("node:stream"),poe=de(Var());var eU=new fe("UndiciFetcher"),ukt=class extends nr{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(ds).getVersion()}`,this.certificateConfigurator=new U_e(r),this.proxySocketFactory=r.get(dk),this.settings=r.get(Bo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),eU.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Bo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),eU.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=$nl(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};eU.debug(this.ctx,"Starting Undici fetch.",{target:lkt(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,poe.fetch)(r,{...h,dispatcher:m});return eU.debug(this.ctx,"Undici fetch completed.",{target:lkt(r),status:A.status,isProxy:g}),new rx(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?iao.Readable.fromWeb(A.body):null)}catch(h){throw l?(eU.warn(this.ctx,"Undici fetch timed out.",{target:lkt(r),timeout:n.timeout}),new HW(`Request to <${r}> timed out after ${n.timeout}ms`,h)):Vnl(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&&(eU.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||(eU.debug(this.ctx,"Creating direct Undici agent.",{target:lkt(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new poe.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,poe.buildConnector)(r);return eU.debug(this.ctx,"Creating proxied Undici agent.",{proxy:nao(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new poe.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)&&eU.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}=Hnl(s),u=Gnl(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:nao(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 Hnl(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(Hnl,"splitHostPort");function Gnl(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(Gnl,"compileHostPattern");function lkt(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(lkt,"describeUrl");function nao(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(nao,"describeProxy");function $nl(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($nl,"toNativeAbortSignal");function Vnl(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(Vnl,"withCauseNetworkProperties");p();var T6e=new fe("fetcher"),Wnl="https://default.exp-tas.com/",I6e=class extends nr{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(Gm(o)||`${r}/`.startsWith(Wnl))throw o;T6e.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),T6e.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()}},dkt=class extends nr{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new I6e(r,n,o,(s,c)=>{this.current!==o&&(T6e.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,Vn(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:Ynl(c),...Knl(s),...Jnl(r)}),n.disconnectAll().catch(l=>{T6e.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(T6e.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()])}},znl=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function Ynl(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return znl.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(Ynl,"describeHost");function Knl(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(Knl,"buildErrorCauseProperties");function Jnl(t){try{let e=t.get(Bo).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(Jnl,"describeHttpContext");var oao=new fe("fetcher");function Znl(t){return Ft(t,Ye.UseHelixFetcher)==="true"}a(Znl,"isHelixFetcherForced");function Xnl(t){if(Znl(t))return new Bie(t);let e=new dkt(t,new ukt(t),new Bie(t));return t.get(Bo).onDidChangeHttpSettings(()=>e.reset()),e}a(Xnl,"createDefaultFetcher");var fkt=class extends nr{constructor(r,n=Xnl(r),o=new B_e(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=Ft(this.ctx,Ye.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&&(oao.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new I6e(r,n,o,()=>{oao.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(bn).onDidSetCapabilities(this.updateFetcher),r.get(Bo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return Ft(this.ctx,Ye.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(bn).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 hkt=de(ti());var pkt=class extends ts{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(ar).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(hkt.ShowMessageRequest.type,{type:hkt.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})}};p();var sao=de(Xc());var mkt=class t extends bK{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new sao.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var aao=de(Xc());var gkt=class t extends rq{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new aao.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var cao=de(Xc());var eil=new cao.ProtocolNotificationType("$/copilot/rateLimitWarning"),Akt=class extends HS{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(ar).connection.sendNotification(eil,r)}};p();p();var ykt=class extends Rze{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(SN).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(SN).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(SN);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 Ekt=class extends Yx{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new ykt(this.ctx,e)}shouldStartWatching(e){return xP(this.ctx)?!1:!!this.ctx.get(bn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped")}};function _kt(t){let e=new rb(process.env),r=Loo(e);r.set(rb,e),r.set(nr,new fkt(r)),r.set(oc,new oc(r)),c3r(r,{});let n=gtn();r.set(ri,n),r.set(uA,new uA(r));let o=new kRt;r.set(Rh,o);let s=uao.join(n.directory,gQr),c=v3.plaintextOnly();r.set(v3,c);let{repo:l,diagnostics:u}=efn(r,s,c);r.set(ox,l),r.set(Ur,new Aje(r,process.env)),r.set($T,new $T(r)),r.set(Pie,new Pie(r));let d=new pf(r,"agent");d.onInitialized(()=>rfn(r,u)),r.set(pf,d),r.set(Fa,RYi),r.set(qI,new qI),r.set(Ir,new oj),r.set(Fie,yYi()),r.set(Ru,new Ru),r.set(qo,Fso),r.set(la,new SRt(r)),r.set(dee,new IRt(r)),r.set(Yx,new Ekt(r)),r.set(SN,new SN(r)),r.set(pm,new pm),r.set(hm,$lt(r,L$i)),r.set(Nb,new Nb(r)),r.set(r4,new ime),gso(r),kze(r),nfn(r),r.set(ar,new ar(r,t)),r.set(wO,new TRt(r)),r.set(ts,new pkt(r)),tfn(r,u),r.set(oCe,new akt(r)),r.set(vW,new skt(r)),r.set(Vm,new w_e(r)),r.set(ps,new GRt(r));let f=new A6e(r,t);r.set(A6e,f),r.set(jl,f),r.set(g6e,new g6e(r)),r.set(h6e,new h6e(r)),r.set(tp,new tp);let h=new zV(r);r.set($r,h),r.set(zV,h),r.set($m,new j_e(r,process.env)),r.set(Pk,new boe),r.set(nc,new nc(r)),Pso(r),pso(r),r.set(RN,new RN),r.set(qV,new qV),r.set(PN,new PN),r.set(jV,new jV([])),r.set(GT,new PRt),r.set(lao.ObservableWorkspace,new SV(r,!0,!0)),r.set(m4,new G_e),r.set(m9,new m9),r.set(Wv,new Wv(r)),r.set(ry,new y1t(r)),r.set(F_,new HRt(r)),r.set(qd,new jRt(r)),r.set(gw,new gw(r)),r.set(gs,new gs(r)),r.set(AF,new AF(r)),r.set(EF,new EF(r)),r.set(nT,new nT(r)),r.set(yJ,new yJ(r)),r.set(XO,new XO),r.set(m0,new m0),r.set(DN,new DN(r)),r.set(o_,new ikt(r)),r.set(U2,new okt(r)),r.set(fF,new fF(r)),r.set(wb,new WRt(r));let m=new IH(r);r.set(IH,m);let g=new ey(r,m,new VRt(r));r.set(ey,g),r.set(NT,new NT(r,m,g)),r.set(iie,zQi(r)),r.set(HS,new Akt(r)),r.set(HX,new HX),r.set(Rie,new Rie),r.set(dm,new RRt(r)),r.set(rC,new xRt(r)),r.set(KN,new KN(r));let A=new wA(r);r.set(wA,A),r.set(bf,new bf(r,A)),r.set(Cg,new Cg(r,A)),r.set(Ld,new Ld(r,A)),r.set(h0,new h0(r,e,A));let y=new R3(r,A,n);r.set(R3,y),r.get(qS).addListener(y.lifecycleListener);let E=new f6e;r.set(f6e,E),r.set(a0,new uIt(r)),r.set(ug,new ug(r,E)),r.set(yw,new yw),r.set(oT,new oT(r)),r.set(Xq,new Xq(r)),r.set(iw,new kO([new PO,new DO])),r.set(wie,new wie(r)),r.set(j_,new j_(r)),r.set(rq,new gkt(r)),r.set(bK,new mkt(r)),r.set(hv,new hv(r)),r.set(Hs,new Hs(r)),r.set(fm,new fm),r.set(WX,new WX(r)),r.set(E8,new E8(r,new eRt)),r.set(cie,new cie(r)),r.set(aie,new aie(r)),r.set(fc,new fc(r)),r.set(SO,new $Rt(r)),r.set(wN,new wN(r)),r.set(ak,new ak(r.get(wN),r)),r.set(HO,new HO(r)),r.set(TI,new DRt(r)),r.set(ZC,new ZC(r.get(ak),r.get(TI),r)),r.set(mE,new mE(r));let _=new uc(r);r.set(uc,_);let v=new A8(r,_);return r.set(A8,v),r.set(Uie,new Uie(r,_)),r.get(ar).onActivation(()=>{v.ensureInitialSync()}),r}a(_kt,"createLanguageServerContext");var JN=new fe("ACP");async function dao(t){let e=t.get(ds);JN.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(rb).markReady(),t.get(zp).githubAppId=Kae,nil(t),ril(t),t.get(bn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Qt).primeToken()?JN.info(t,"Token primed successfully"):JN.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(pf).initialize(!0),I0n()?await til(t):(At(t,"acp.server.start",{acpPipeline:"internal"}),await fao(t))}a(dao,"startACPServer");async function fao(t){JN.info(t,"Starting ACP server with internal pipeline");let e=cCe.Writable.toWeb(process.stdout),r=cCe.Readable.toWeb(process.stdin),n=GRe(e,r),o=new $Re(s=>new AIt(s,t),n);o.signal.addEventListener("abort",()=>{JN.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(fao,"startACPServerInternal");async function til(t){JN.info(t,"Starting ACP server with CLI proxy"),At(t,"acp.cli.discover");let e;try{e=await x0n()}catch(u){let d=u instanceof Error?u.message:String(u);JN.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),Vn(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await fao(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;JN.info(t,`Found Copilot CLI: ${r} v${e.version}`),At(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new yIt(e,t),o=cCe.Writable.toWeb(process.stdout),s=cCe.Readable.toWeb(process.stdin),c=GRe(o,s),l=new $Re(u=>new _It(u,t,n),c);l.signal.addEventListener("abort",()=>{JN.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(til,"startACPServerWithCLI");function ril(t){let e=t.get(gs);e.registerTool(new ej({name:"create_file",description:"Create a new file in the workspace with the specified content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.String({description:"The content to write to the new file."})})})),e.registerTool(new ej({name:"insert_edit_into_file",description:"Edit an existing file by inserting, replacing, or deleting content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),content:S.Optional(S.String({description:"The new content for the file."})),edits:S.Optional(S.Array(S.Object({startLine:S.Number({description:"The starting line number (1-based)."}),endLine:S.Number({description:"The ending line number (1-based)."}),newContent:S.String({description:"The new content to replace the range with."})})))})})),e.registerTool(new ej({name:"replace_string_in_file",description:"Replace a specific string in a file with a new string.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.String({description:"The string to find and replace."}),newString:S.String({description:"The string to replace it with."})})})),JN.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(ril,"registerACPClientTools");function pao(){let e=_kt({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 YV(e);return e.forceSet(F_,r),{ctx:e,acpToolInvoker:r}}a(pao,"createACPContext");function nil(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(JN.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),d7e(t,r))}a(nil,"configureGitHubEnterpriseUrl");p();var q7r=require("events"),x6e=de(require("fs"));m$e();var Ckt=de(Xc());p();var mao=de(require("fs")),gao=de(require("http")),lCe=de(require("path"));var vkt=class{constructor(e,r){this.port=e;let n;this.server=gao.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=>{hao(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{hao(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;lCe.basename(__dirname)!=="debug"&&(c=lCe.dirname(__dirname)),n??=mao.readFileSync(lCe.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 hao(t,e){t.write("data: "+e.toString().replace(/\n/g,` data: `)+` -`)}a(uao,"writeData");var q7r=class extends vkt.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()}},j7r=class extends vkt.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 pao(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new Q7r.EventEmitter;let l=new _kt(o,n).listen();o===0&&await PTe(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=T6e.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=T6e.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&T6e.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new Q7r.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} +`)}a(hao,"writeData");var j7r=class extends Ckt.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()}},H7r=class extends Ckt.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 Aao(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new q7r.EventEmitter;let l=new vkt(o,n).listen();o===0&&await DTe(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=x6e.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=x6e.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&x6e.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new q7r.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} `)),n.on("write",u=>l(`--> ${JSON.stringify(u)} -`))}return n&&(e=new j7r(e,n),r=new q7r(r,n)),[e,r]}a(pao,"wrapTransports");p();var Ckt=de(require("fs/promises")),hao=de(require("os")),mao=de(require("path"));var Znl={tmpdir:a(()=>hao.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function gao(t=Znl){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await Ckt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await Ckt.mkdtemp(mao.join(e,"github-copilot-"))}}a(gao,"mitigateTempFolder");function Bil(){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(Bil,"shouldEnableSourceMapSupport");Bil()&&Jao();async function Xao(){let t=_0n(process.argv.slice(2)).version(new ds().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}=lao();await j8t(u),await aao(u);return}let r,n;e["node-ipc"]?(r=new wk.IPCMessageReader(process),n=new wk.IPCMessageWriter(process)):e.stdio?(r=new wk.StreamMessageReader(process.stdin),n=new wk.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await gao();let o=(0,wk.createConnection)(wk.ProposedFeatures.all,...await pao(process.env,r,n)),s=Ekt(o);console=ihn(s),await j8t(s);let c=s.get(ar),l=new GY(s);s.set(GY,l),c.onActivation(()=>{l.start(),nfn()}),Fil(c,r),c.listen()}a(Xao,"main");function Fil(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(Fil,"setupExitHandlers");Zao.isMainThread?require.main===module&&Xao():(Tfn()&&Ifn(),B6t()&&nhn());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); +`))}return n&&(e=new H7r(e,n),r=new j7r(r,n)),[e,r]}a(Aao,"wrapTransports");p();var bkt=de(require("fs/promises")),yao=de(require("os")),Eao=de(require("path"));var iil={tmpdir:a(()=>yao.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function _ao(t=iil){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await bkt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await bkt.mkdtemp(Eao.join(e,"github-copilot-"))}}a(_ao,"mitigateTempFolder");function Hil(){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(Hil,"shouldEnableSourceMapSupport");Hil()&&tco();async function nco(){let t=v0n(process.argv.slice(2)).version(new ds().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}=pao();await H8t(u),await dao(u);return}let r,n;e["node-ipc"]?(r=new Rk.IPCMessageReader(process),n=new Rk.IPCMessageWriter(process)):e.stdio?(r=new Rk.StreamMessageReader(process.stdin),n=new Rk.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await _ao();let o=(0,Rk.createConnection)(Rk.ProposedFeatures.all,...await Aao(process.env,r,n)),s=_kt(o);console=ohn(s),await H8t(s);let c=s.get(ar),l=new $Y(s);s.set($Y,l),c.onActivation(()=>{l.start(),ifn()}),Gil(c,r),c.listen()}a(nco,"main");function Gil(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(Gil,"setupExitHandlers");rco.isMainThread?require.main===module&&nco():(Ifn()&&xfn(),F6t()&&ihn());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 0a246189..56a10c65 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.517.0", + version = "1.519.0", }, } return info